diff --git a/README.md b/README.md index 854cae7e40..c50d026338 100644 --- a/README.md +++ b/README.md @@ -256,7 +256,7 @@ When it graduates draft mode, we may remove it from DefinitelyTyped and deprecat #### I want to update a package to a new major version -Before making your change, please create a new subfolder with the current version e.g. `v2`, and copy existing files to it. You will need to: +If you intend to continue updating the older version of the package, you may create a new subfolder with the current version e.g. `v2`, and copy existing files to it. If so, you will need to: 1. Update the relative paths in `tsconfig.json` as well as `tslint.json`. 2. Add path mapping rules to ensure that tests are running against the intended version. @@ -279,7 +279,8 @@ For example [history v2 `tsconfig.json`](https://github.com/DefinitelyTyped/Defi } ``` -Please note that unless upgrading something backwards-compatible like `node`, all packages depending of the updated package need a path mapping to it, as well as packages depending on *those*. +If there are other packages on DefinitelyTyped that are incompatible with the new version, you will need to add path mappings to the old version. You will also need to do this for packages depending on packages depending on the old version. + For example, `react-router` depends on `history@2`, so [react-router `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router/tsconfig.json) has a path mapping to `"history": [ "history/v2" ]`; transitively `react-router-bootstrap` (which depends on `react-router`) also adds a path mapping in its [tsconfig.json](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router-bootstrap/tsconfig.json). diff --git a/notNeededPackages.json b/notNeededPackages.json index 8f3270392f..7683c07522 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -6,6 +6,12 @@ "sourceRepoURL": "https://github.com/betterwaysystems/packer", "asOfVersion": "1.1.3" }, + { + "libraryName": "Ably Realtime and Rest client library", + "typingsPackageName": "ably", + "sourceRepoURL": "https://www.ably.io/", + "asOfVersion": "1.0.0" + }, { "libraryName": "ag-grid", "typingsPackageName": "ag-grid", @@ -78,6 +84,12 @@ "sourceRepoURL": "https://github.com/AlexTeixeira/Askmethat-Rating", "asOfVersion": "0.4.0" }, + { + "libraryName": "assertion-error", + "typingsPackageName": "assertion-error", + "sourceRepoURL": "https://github.com/chaijs/assertion-error", + "asOfVersion": "1.1.0" + }, { "libraryName": "asyncblock", "typingsPackageName": "asyncblock", @@ -582,6 +594,12 @@ "sourceRepoURL": "https://github.com/panuhorsmalahti/gulp-tslint", "asOfVersion": "4.2.0" }, + { + "libraryName": "gulp-typedoc", + "typingsPackageName": "gulp-typedoc", + "sourceRepoURL": "https://github.com/rogierschouten/gulp-typedoc", + "asOfVersion": "2.2.0" + }, { "libraryName": "gulp-typescript", "typingsPackageName": "gulp-typescript", @@ -798,6 +816,12 @@ "sourceRepoURL": "https://linqjs.codeplex.com/", "asOfVersion": "2.2.33" }, + { + "libraryName": "Linq4JS", + "typingsPackageName": "linq4js", + "sourceRepoURL": "https://github.com/morrisjdev/Linq4JS", + "asOfVersion": "2.1.8" + }, { "libraryName": "LinqSharp", "typingsPackageName": "linqsharp", @@ -810,6 +834,12 @@ "sourceRepoURL": "https://github.com/localForage/localForage", "asOfVersion": "0.0.34" }, + { + "libraryName": "localforage-cordovasqlitedriver", + "typingsPackageName": "localforage-cordovasqlitedriver", + "sourceRepoURL": "https://github.com/thgreasi/localForage-cordovaSQLiteDriver", + "asOfVersion": "1.5.0" + }, { "libraryName": "lodash-decorators", "typingsPackageName": "lodash-decorators", @@ -912,6 +942,12 @@ "sourceRepoURL": "https://github.com/theoephraim/node-pg-migrate#readme", "asOfVersion": "2.15.0" }, + { + "libraryName": "node-waves", + "typingsPackageName": "node-waves", + "sourceRepoURL": "http://fian.my.id/Waves", + "asOfVersion": "0.7.6" + }, { "libraryName": "Normalizr", "typingsPackageName": "normalizr", @@ -1194,6 +1230,12 @@ "sourceRepoURL": "https://github.com/EnoF/rest-io", "asOfVersion": "4.1.0" }, + { + "libraryName": "rollup", + "typingsPackageName": "rollup", + "sourceRepoURL": "https://github.com/rollup/rollup", + "asOfVersion": "0.54.0" + }, { "libraryName": "route-recognizer", "typingsPackageName": "route-recognizer", @@ -1482,6 +1524,12 @@ "sourceRepoURL": "https://webgme.org", "asOfVersion": "2.11.0" }, + { + "libraryName": "Webix UI", + "typingsPackageName": "webix", + "sourceRepoURL": "http://webix.com", + "asOfVersion": "5.1.1" + }, { "libraryName": "wolfy87-eventemitter", "typingsPackageName": "wolfy87-eventemitter", @@ -1512,6 +1560,12 @@ "sourceRepoURL": "https://github.com/PeculiarVentures/xadesjs", "asOfVersion": "2.0.2" }, + { + "libraryName": "xhr-mock", + "typingsPackageName": "xhr-mock", + "sourceRepoURL": "https://github.com/jameslnewell/xhr-mock#readme", + "asOfVersion": "2.0.0" + }, { "libraryName": "xlsx", "typingsPackageName": "xlsx", @@ -1530,6 +1584,18 @@ "sourceRepoURL": "github.com/node-xmpp/node-xmpp/", "asOfVersion": "1.2.0" }, + { + "libraryName": "xterm.js", + "typingsPackageName": "xterm", + "sourceRepoURL": "https://github.com/sourcelair/xterm.js/", + "asOfVersion": "3.0.0" + }, + { + "libraryName": "yFiles for HTML", + "typingsPackageName": "yfiles", + "sourceRepoURL": "none", + "asOfVersion": "2.1.0" + }, { "libraryName": "zetapush-js", "typingsPackageName": "zetapush-js", diff --git a/scripts/generate-tsconfigs.ts b/scripts/generate-tsconfigs.ts index 0115067e34..e1e1998950 100644 --- a/scripts/generate-tsconfigs.ts +++ b/scripts/generate-tsconfigs.ts @@ -5,7 +5,7 @@ import * as fs from 'fs'; import * as path from 'path'; -const home = path.join(__dirname, '..'); +const home = path.join(__dirname, "..", "types"); for (const dirName of fs.readdirSync(home)) { if (dirName.startsWith(".") || dirName === "node_modules" || dirName === "scripts") { diff --git a/types/abbrev/tsconfig.json b/types/abbrev/tsconfig.json index 0755c19fe1..b33fbb06bc 100644 --- a/types/abbrev/tsconfig.json +++ b/types/abbrev/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ably/ably-tests.ts b/types/ably/ably-tests.ts deleted file mode 100644 index bc50d03ce6..0000000000 --- a/types/ably/ably-tests.ts +++ /dev/null @@ -1,253 +0,0 @@ -import * as Ably from 'ably'; - -declare const console: { log(message: any): void }; - -const ApiKey = 'appId.keyId:secret'; -const client = new Ably.Realtime(ApiKey); -const restClient = new Ably.Rest(ApiKey); - -// Connection -// Successful connection: - -client.connection.on('connected', () => { - // successful connection -}); - -// Failed connection: - -client.connection.on('failed', () => { - // failed connection -}); - -// Subscribing to a channel - -const channel = client.channels.get('test'); -channel.subscribe(message => { - message.name; // 'greeting' - message.data; // 'Hello World!' -}); - -// Only certain events: - -channel.subscribe('myEvent', message => { - message.name; // 'myEvent' - message.data; // 'myData' -}); - -// Publishing to a channel - -// Publish a single message with name and data -channel.publish('greeting', 'Hello World!'); - -// Optionally, you can use a callback to be notified of success or failure -channel.publish('greeting', 'Hello World!', err => { - if (err) { - console.log('publish failed with error ' + err); - } else { - console.log('publish succeeded'); - } -}); - -// Publish several messages at once -channel.publish([{name: 'greeting', data: 'Hello World!'}], () => { }); - -// Querying the History - -channel.history((err, messagesPage) => { - messagesPage.items; // array of Message - messagesPage.items[0].data; // payload for first message - messagesPage.items.length; // number of messages in the current page of history - messagesPage.hasNext(); // true if there are further pages - messagesPage.isLast(); // true if this page is the last page - messagesPage.next(nextPage => { nextPage; }); // retrieves the next page as PaginatedResult -}); - -// Can optionally take an options param, see https://www.ably.io/documentation/rest-api/#message-history -channel.history({ start: Date.now() - 10000, end: Date.now(), limit: 100, direction: 'forwards'}, (err, messagesPage) => { - console.log(messagesPage.items.length); -}); - -// Presence on a channel -// Getting presence: - -channel.presence.get(presenceSet => { - presenceSet; // array of PresenceMessages -}); - -// Note that presence#get on a realtime channel does not return a PaginatedResult, as the library maintains a local copy of the presence set. - -// Entering (and leaving) the presence set: - -channel.presence.enter('my status', err => { - // now I am entered -}); - -channel.presence.update('new status', err => { - // my presence data is updated -}); - -channel.presence.leave(null, err => { - // I've left the presence set -}); - -channel.presence.enterClient('myClientId', 'status', err => { -}); - -// and similiarly, updateClient and leaveClient -// Querying the Presence History - -channel.presence.history((err, messagesPage) => { // PaginatedResult - messagesPage.items; // array of PresenceMessage - messagesPage.items[0].data; // payload for first message - messagesPage.items.length; // number of messages in the current page of history - messagesPage.hasNext(); // true if there are further pages - messagesPage.isLast(); // true if this page is the last page - messagesPage.next(nextPage => { }); // retrieves the next page as PaginatedResult -}); - -// Can optionally take an options param, see https://www.ably.io/documentation/rest-api/#message-history -channel.history({ start: Date.now() - 10000, end: Date.now(), limit: 100, direction: 'forwards' }, (err, messagesPage) => {}); - -// Symmetrical end-to-end encrypted payloads on a channel - -// When a 128 bit or 256 bit key is provided to the library, the data attributes of all messages are encrypted and decrypted automatically using that key. -// The secret key is never transmitted to Ably. See https://www.ably.io/documentation/realtime/encryption - -// Generate a random 256-bit key for demonstration purposes (in -// practice you need to create one and distribute it to clients yourselves) -Ably.Realtime.Crypto.generateRandomKey((err, key) => { - const channel = client.channels.get('channelName', { cipher: { key } }); - - channel.subscribe(message => { - message.name; // 'name is not encrypted' - message.data; // 'sensitive data is encrypted' - }); - - channel.publish('name is not encrypted', 'sensitive data is encrypted'); -}); - -// You can also change the key on an existing channel using setOptions (which takes a callback which is called after the new encryption settings have taken effect): - -channel.setOptions({cipher: {key: ''}}, () => { - // New encryption settings are in effect -}); - -// Using the REST API - -const restChannel = restClient.channels.get('test'); - -// Publishing to a channel - -// Publish a single message with name and data -restChannel.publish('greeting', 'Hello World!'); - -// Optionally, you can use a callback to be notified of success or failure -restChannel.publish('greeting', 'Hello World!', err => { - if (err) { - console.log('publish failed with error ' + err); - } else { - console.log('publish succeeded'); - } -}); - -// Publish several messages at once -restChannel.publish([{name: 'greeting', data: 'Hello World!'}], () => {}); - -// Querying the History - -restChannel.history((err, messagesPage) => { - messagesPage; // PaginatedResult - messagesPage.items; // array of Message - messagesPage.items[0].data; // payload for first message - messagesPage.items.length; // number of messages in the current page of history - messagesPage.hasNext(); // true if there are further pages - messagesPage.isLast(); // true if this page is the last page - messagesPage.next(nextPage => {}); // retrieves the next page as PaginatedResult -}); - -// Can optionally take an options param, see https://www.ably.io/documentation/rest-api/#message-history -restChannel.history({ start: Date.now() - 10000, end: Date.now(), limit: 100, direction: 'forwards' }, (err, messagesPage) => {}); - -// Presence on a channel - -restChannel.presence.get((err, presencePage) => { // PaginatedResult - presencePage.items; // array of PresenceMessage - presencePage.items[0].data; // payload for first message - presencePage.items.length; // number of messages in the current page of members - presencePage.hasNext(); // true if there are further pages - presencePage.isLast(); // true if this page is the last page - presencePage.next(nextPage => {}); // retrieves the next page as PaginatedResult -}); - -// Querying the Presence History - -restChannel.presence.history((err, messagesPage) => { // PaginatedResult - messagesPage.items; // array of PresenceMessage - messagesPage.items[0].data; // payload for first message - messagesPage.items.length; // number of messages in the current page of history - messagesPage.hasNext(); // true if there are further pages - messagesPage.isLast(); // true if this page is the last page - messagesPage.next(nextPage => { }); // retrieves the next page as PaginatedResult -}); - -// Can optionally take an options param, see https://www.ably.io/documentation/rest-api/#message-history -restChannel.history({ start: Date.now() - 10000, end: Date.now(), limit: 100, direction: 'forwards' }, (err, messagesPage) => {}); - -// Generate Token and Token Request -// See https://www.ably.io/documentation/general/authentication for an explanation of Ably's authentication mechanism. - -// Requesting a token: - -client.auth.requestToken((err, tokenDetails) => { - // tokenDetails is instance of TokenDetails - // see https://www.ably.io/documentation/rest/authentication/#token-details for its properties - - // Now we have the token, we can send it to someone who can instantiate a client with it: - const clientUsingToken = new Ably.Realtime(tokenDetails.token); -}); - -// requestToken can take two optional params -// tokenParams: https://www.ably.io/documentation/rest/authentication/#token-params -// authOptions: https://www.ably.io/documentation/rest/authentication/#auth-options -client.auth.requestToken({}, {}, (err, tokenDetails) => { }); - -// Creating a token request (for example, on a server in response to a request by a client using the authCallback or authUrl mechanisms): - -client.auth.createTokenRequest((err, tokenRequest) => { - // now send the tokenRequest back to the client, which will - // use it to request a token and connect to Ably -}); - -// createTokenRequest can take two optional params -// tokenParams: https://www.ably.io/documentation/rest/authentication/#token-params -// authOptions: https://www.ably.io/documentation/rest/authentication/#auth-options -client.auth.createTokenRequest({}, {}, (err, tokenRequest) => { }); - -// Fetching your application's stats - -client.stats({ limit: 50 }, (err, statsPage) => { // statsPage as PaginatedResult - statsPage.items; // array of Stats - statsPage.items[0].inbound.rest.messages.count; // total messages published over REST - statsPage.items.length; // number of stats in the current page of history - statsPage.hasNext(); // true if there are wrther pages - statsPage.isLast(); // true if this page is the last page - statsPage.next((nextPage) => {}); // retrieves the next page as PaginatedResult -}); - -// Fetching the Ably service time - -client.time({}, (err, time) => {}); // time is in ms since epoch - -// Getting decoded Message objects from JSON -const messages = Ably.Realtime.Message.fromEncodedArray([{ id: 'foo' }]); -console.log(messages[0].id); - -const message = Ably.Rest.Message.fromEncoded({ id: 'foo' }); -console.log(message.id); - -// Getting decoded PresenceMessage objects from JSON -const presenceMessages = Ably.Realtime.PresenceMessage.fromEncodedArray([{ id: 'foo' }]); -console.log(presenceMessages[0].action); - -const presenceMessage = Ably.Rest.PresenceMessage.fromEncoded({ id: 'foo' }); -console.log(presenceMessage.action); diff --git a/types/ably/index.d.ts b/types/ably/index.d.ts deleted file mode 100644 index 3a150257ba..0000000000 --- a/types/ably/index.d.ts +++ /dev/null @@ -1,473 +0,0 @@ -// Type definitions for Ably Realtime and Rest client library 0.9 -// Project: https://www.ably.io/ -// Definitions by: Ably -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export namespace ablyLib { - namespace ChannelState { - type INITIALIZED = 'initialized'; - type ATTACHING = 'attaching'; - type ATTACHED = "attached"; - type DETACHING = "detaching"; - type DETACHED = "detached"; - type SUSPENDED = "suspended"; - type FAILED = "failed"; - } - type ChannelState = ChannelState.FAILED | ChannelState.INITIALIZED | ChannelState.SUSPENDED | ChannelState.ATTACHED | ChannelState.ATTACHING | ChannelState.DETACHED | ChannelState.DETACHING; - - namespace ConnectionState { - type INITIALIZED = "initialized"; - type CONNECTING = "connecting"; - type CONNECTED = "connected"; - type DISCONNECTED = "disconnected"; - type SUSPENDED = "suspended"; - type CLOSING = "closing"; - type CLOSED = "closed"; - type FAILED = "failed"; - } - type ConnectionState = ConnectionState.INITIALIZED | ConnectionState.CONNECTED | ConnectionState.CONNECTING | ConnectionState.DISCONNECTED | - ConnectionState.SUSPENDED | ConnectionState.CLOSED | ConnectionState.CLOSING | ConnectionState.FAILED; - - namespace ConnectionEvent { - type INITIALIZED = "initialized"; - type CONNECTING = "connecting"; - type CONNECTED = "connected"; - type DISCONNECTED = "disconnected"; - type SUSPENDED = "suspended"; - type CLOSING = "closing"; - type CLOSED = "closed"; - type FAILED = "failed"; - type UPDATE = "update"; - } - type ConnectionEvent = ConnectionEvent.INITIALIZED | ConnectionEvent.CONNECTED | ConnectionEvent.CONNECTING | ConnectionEvent.DISCONNECTED | - ConnectionEvent.SUSPENDED | ConnectionEvent.CLOSED | ConnectionEvent.CLOSING | ConnectionEvent.FAILED | ConnectionEvent.UPDATE; - - namespace PresenceAction { - type ABSENT = "absent"; - type PRESENT = "present"; - type ENTER = "enter"; - type LEAVE = "leave"; - type UPDATE = "update"; - } - type PresenceAction = PresenceAction.ABSENT | PresenceAction.PRESENT | PresenceAction.ENTER | PresenceAction.LEAVE | PresenceAction.UPDATE; - - namespace StatsIntervalGranularity { - type MINUTE = "minute"; - type HOUR = "hour"; - type DAY = "day"; - type MONTH = "month"; - } - type StatsIntervalGranularity = StatsIntervalGranularity.MINUTE | StatsIntervalGranularity.HOUR | StatsIntervalGranularity.DAY | StatsIntervalGranularity.MONTH; - - namespace HTTPMethods { - type POST = "POST"; - type GET = "GET"; - } - type HTTPMethods = HTTPMethods.GET | HTTPMethods.POST; - - // Interfaces - interface ClientOptions extends AuthOptions { - /** - * When true will automatically connect to Ably when library is instanced. This is true by default - */ - autoConnect?: boolean; - - /** - * Optional clientId that can be used to specify the identity for this client. In most cases - * it is preferable to instead specift a clientId in the token issued to this client. - */ - clientId?: string; - - defaultTokenParams?: TokenParams; - - /** - * When true, messages published on channels by this client will be echoed back to this client. - * This is true by default - */ - echoMessages?: boolean; - - /** - * Use this only if you have been provided a dedicated environment by Ably - */ - environment?: string; - - /** - * Logger configuration - */ - log?: LogInfo; - port?: number; - - /** - * When true, messages will be queued whilst the connection is disconnected. True by default. - */ - queueMessages?: boolean; - - restHost?: string; - realtimeHost?: string; - fallbackHosts?: string[]; - - /** - * Can be used to explicitly recover a connection. - * See https://www.ably.io/documentation/realtime/connection#connection-state-recovery - */ - recover?: standardCallback | string; - - /** - * Use a non-secure connection connection. By default, a TLS connection is used to connect to Ably - */ - tls?: boolean; - tlsPort?: number; - - /** - * When true, the more efficient MsgPack binary encoding is used. - * When false, JSON text encoding is used. - */ - useBinaryProtocol?: boolean; - } - - interface AuthOptions { - /** - * A function which is called when a new token is required. - * The role of the callback is to either generate a signed TokenRequest which may then be submitted automatically - * by the library to the Ably REST API requestToken; or to provide a valid token in as a TokenDetails object. - */ - authCallback?(data: TokenParams, callback: (error: ErrorInfo | string, tokenRequestOrDetails: TokenDetails | TokenRequest | string) => void): void; - authHeaders?: { [index: string]: string }; - authMethod?: HTTPMethods; - authParams?: { [index: string]: string }; - - /** - * A URL that the library may use to obtain a token string (in plain text format), or a signed TokenRequest or TokenDetails (in JSON format). - */ - authUrl?: string; - key?: string; - queryTime?: boolean; - token?: TokenDetails | string; - tokenDetails?: TokenDetails; - useTokenAuth?: boolean; - } - - interface TokenParams { - capability?: string; - clientId?: string; - nonce?: string; - timestamp?: number; - ttl?: number; - } - - interface CipherParams { - algorithm: string; - key: any; - keyLength: number; - mode: string; - } - - interface ErrorInfo { - code: number; - message: string; - statusCode: number; - } - - interface StatsMessageCount { - count: number; - data: number; - } - - interface StatsMessageTypes { - all: StatsMessageCount; - messages: StatsMessageCount; - presence: StatsMessageCount; - } - - interface StatsRequestCount { - failed: number; - refused: number; - succeeded: number; - } - - interface StatsResourceCount { - mean: number; - min: number; - opened: number; - peak: number; - refused: number; - } - - interface StatsConnectionTypes { - all: StatsResourceCount; - plain: StatsResourceCount; - tls: StatsResourceCount; - } - - interface StatsMessageTraffic { - all: StatsMessageTypes; - realtime: StatsMessageTypes; - rest: StatsMessageTypes; - webhook: StatsMessageTypes; - } - - interface TokenDetails { - capability: string; - clientId?: string; - expires: number; - issued: number; - token: string; - } - - interface TokenRequest { - capability: string; - clientId?: string; - keyName: string; - mac: string; - nonce: string; - timestamp: number; - ttl?: number; - } - - interface ChannelOptions { - cipher: any; - } - - interface RestPresenceHistoryParams { - start?: number; - end?: number; - direction?: string; - limit?: number; - } - - interface RestPresenceParams { - limit?: number; - clientId?: string; - connectionId?: string; - } - - interface RealtimePresenceParams { - waitForSync?: boolean; - clientId?: string; - connectionId?: string; - } - - interface RealtimePresenceHistoryParams { - start?: number; - end?: number; - direction?: string; - limit?: number; - untilAttach?: boolean; - } - - interface LogInfo { - /** - * A number controlling the verbosity of the output. Valid values are: 0 (no logs), 1 (errors only), - * 2 (errors plus connection and channel state changes), 3 (high-level debug output), and 4 (full debug output). - */ - level?: number; - - /** - * A function to handle each line of log output. If handler is not specified, console.log is used. - */ - handler?(...args: any[]): void; - } - - interface ChannelEvent { - state: ChannelState; - } - - interface ChannelStateChange { - current: ChannelState; - previous: ChannelState; - reason?: ErrorInfo; - resumed: boolean; - } - - interface ConnectionStateChange { - current: ConnectionState; - previous: ConnectionState; - reason?: ErrorInfo; - retryIn?: number; - } - - // Common Listeners - type paginatedResultCallback = (error: ErrorInfo, results: PaginatedResult) => void; - type standardCallback = (error: ErrorInfo, results: any) => void; - type messageCallback = (message: T) => void; - type errorCallback = (error: ErrorInfo) => void; - type channelEventCallback = (channelEvent: ChannelEvent, changeStateChange: ChannelStateChange) => void; - type connectionEventCallback = (connectionEvent: ConnectionEvent, connectionStateChange: ConnectionStateChange) => void; - type timeCallback = (error: ErrorInfo, time: number) => void; - type realtimePresenceGetCallback = (error: ErrorInfo, messages: PresenceMessage[]) => void; - type tokenDetailsCallback = (error: ErrorInfo, Results: TokenDetails) => void; - type tokenRequestCallback = (error: ErrorInfo, Results: TokenRequest) => void; - type fromEncoded = (JsonObject: any, channelOptions?: ChannelOptions) => T; - type fromEncodedArray = (JsonArray: any[], channelOptions?: ChannelOptions) => T[]; - - // Internal Classes - class EventEmitter { - on: (eventOrCallback: string | T, callback?: T) => void; - once: (eventOrCallback: string | T, callback?: T) => void; - off: (eventOrCallback?: string | T, callback?: T) => void; - } - - // Classes - class Auth { - clientId: string; - authorize: (tokenParams?: TokenParams | tokenDetailsCallback, authOptions?: AuthOptions | tokenDetailsCallback, callback?: tokenDetailsCallback) => void; - createTokenRequest: (tokenParams?: TokenParams | tokenRequestCallback, authOptions?: AuthOptions | tokenRequestCallback, callback?: tokenRequestCallback) => void; - requestToken: (TokenParams?: TokenParams | tokenDetailsCallback, authOptions?: AuthOptions | tokenDetailsCallback, callback?: tokenDetailsCallback) => void; - } - - class Presence { - get: (params: RestPresenceParams | paginatedResultCallback, callback?: paginatedResultCallback) => void; - history: (params: RestPresenceHistoryParams | paginatedResultCallback, callback?: paginatedResultCallback) => void; - } - - class RealtimePresence { - syncComplete: () => boolean; - get: (Params: realtimePresenceGetCallback | RealtimePresenceParams, callback?: realtimePresenceGetCallback) => void; - history: (ParamsOrCallback: RealtimePresenceHistoryParams | paginatedResultCallback, callback?: paginatedResultCallback) => void; - subscribe: (presenceOrCallback: PresenceAction | messageCallback, listener?: messageCallback) => void; - unsubscribe: (presence?: PresenceAction, listener?: messageCallback) => void; - enter: (data?: errorCallback | any, callback?: errorCallback) => void; - update: (data?: errorCallback | any, callback?: errorCallback) => void; - leave: (data?: errorCallback | any, callback?: errorCallback) => void; - enterClient: (clientId: string, data?: errorCallback | any, callback?: errorCallback) => void; - updateClient: (clientId: string, data?: errorCallback | any, callback?: errorCallback) => void; - leaveClient: (clientId: string, data?: errorCallback | any, callback?: errorCallback) => void; - } - - class Channel { - name: string; - presence: Presence; - history: (paramsOrCallback?: RestPresenceHistoryParams | paginatedResultCallback, callback?: paginatedResultCallback) => void; - publish: (messagesOrName: any, messagedataOrCallback?: errorCallback | any, callback?: errorCallback) => void; - } - - class RealtimeChannel extends EventEmitter { - name: string; - errorReason: ErrorInfo; - state: ChannelState; - presence: RealtimePresence; - attach: (callback?: standardCallback) => void; - detach: (callback?: standardCallback) => void; - history: (paramsOrCallback?: RealtimePresenceHistoryParams | paginatedResultCallback, callback?: paginatedResultCallback) => void; - subscribe: (eventOrCallback: messageCallback | string, listener?: messageCallback) => void; - unsubscribe: (eventOrCallback?: messageCallback | string, listener?: messageCallback) => void; - publish: (messagesOrName: any, messageDataOrCallback?: errorCallback | any, callback?: errorCallback) => void; - setOptions: (options: any, callback?: errorCallback) => void; - } - - class Channels { - get: (name: string, channelOptions?: ChannelOptions) => T; - release: (name: string) => void; - } - - class Message { - constructor(); - static fromEncoded: fromEncoded; - static fromEncodedArray: fromEncodedArray; - clientId: string; - connectionId: string; - data: any; - encoding: string; - extras: any; - id: string; - name: string; - timestamp: number; - } - - interface MessageStatic { - fromEncoded: fromEncoded; - fromEncodedArray: fromEncodedArray; - } - - class PresenceMessage { - constructor(); - static fromEncoded: fromEncoded; - static fromEncodedArray: fromEncodedArray; - action: PresenceAction; - clientId: string; - connectionId: string; - data: any; - encoding: string; - id: string; - timestamp: number; - } - - interface PresenceMessageStatic { - fromEncoded: fromEncoded; - fromEncodedArray: fromEncodedArray; - } - - interface Crypto { - generateRandomKey(callback: (error: ErrorInfo, key: string) => void): void; - } - - class Connection extends EventEmitter { - errorReason: ErrorInfo; - id: string; - key: string; - recoveryKey: string; - serial: number; - state: ConnectionState; - close: () => void; - connect: () => void; - ping: (callback?: (error: ErrorInfo, responseTime: number) => void) => void; - } - - class Stats { - all: StatsMessageTypes; - apiRequests: StatsRequestCount; - channels: StatsResourceCount; - connections: StatsConnectionTypes; - inbound: StatsMessageTraffic; - intervalId: string; - outbound: StatsMessageTraffic; - persisted: StatsMessageTypes; - tokenRequests: StatsRequestCount; - } - - class PaginatedResult { - items: T[]; - first: (results: paginatedResultCallback) => void; - next: (results: paginatedResultCallback) => void; - current: (results: paginatedResultCallback) => void; - hasNext: () => boolean; - isLast: () => boolean; - } - - class HttpPaginatedResponse extends PaginatedResult { - items: string[]; - statusCode: number; - success: boolean; - errorCode: number; - errorMessage: string; - headers: any; - } -} - -export class Rest { - constructor(options: ablyLib.ClientOptions | string); - static Crypto: ablyLib.Crypto; - static Message: ablyLib.MessageStatic; - static PresenceMessage: ablyLib.PresenceMessageStatic; - auth: ablyLib.Auth; - channels: ablyLib.Channels; - request: (method: string, path: string, params?: any, body?: any[] | any, headers?: any, callback?: (error: ablyLib.ErrorInfo, response: ablyLib.HttpPaginatedResponse) => void) => void; - stats: (paramsOrCallback?: ablyLib.paginatedResultCallback | any, callback?: ablyLib.paginatedResultCallback) => void; - time: (paramsOrCallback?: ablyLib.timeCallback | any, callback?: ablyLib.timeCallback) => void; -} - -export class Realtime { - constructor(options: ablyLib.ClientOptions | string); - static Crypto: ablyLib.Crypto; - static Message: ablyLib.MessageStatic; - static PresenceMessage: ablyLib.PresenceMessageStatic; - auth: ablyLib.Auth; - channels: ablyLib.Channels; - clientId: string; - connection: ablyLib.Connection; - request: (method: string, path: string, params?: any, body?: any[] | any, headers?: any, callback?: (error: ablyLib.ErrorInfo, response: ablyLib.HttpPaginatedResponse) => void) => void; - stats: (paramsOrCallback?: ablyLib.paginatedResultCallback | any, callback?: ablyLib.paginatedResultCallback) => void; - close: () => void; - connect: () => void; - time: (paramsOrCallback?: ablyLib.timeCallback | any, callback?: ablyLib.timeCallback) => void; -} diff --git a/types/ably/tslint.json b/types/ably/tslint.json deleted file mode 100644 index d9d49e375e..0000000000 --- a/types/ably/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "no-any-union": false - } -} diff --git a/types/abs/tsconfig.json b/types/abs/tsconfig.json index 2bcb3f7094..be1e00e9b9 100644 --- a/types/abs/tsconfig.json +++ b/types/abs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/absolute/tsconfig.json b/types/absolute/tsconfig.json index ba18df791e..9932020aa3 100644 --- a/types/absolute/tsconfig.json +++ b/types/absolute/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/acc-wizard/tsconfig.json b/types/acc-wizard/tsconfig.json index a20aeba97b..f63878ba9b 100644 --- a/types/acc-wizard/tsconfig.json +++ b/types/acc-wizard/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/accept-language-parser/tsconfig.json b/types/accept-language-parser/tsconfig.json index 11532082db..86f839c4be 100644 --- a/types/accept-language-parser/tsconfig.json +++ b/types/accept-language-parser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/accepts/tsconfig.json b/types/accepts/tsconfig.json index 35b618292d..9d62081738 100644 --- a/types/accepts/tsconfig.json +++ b/types/accepts/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/accounting/tsconfig.json b/types/accounting/tsconfig.json index f815c5b01e..7ec0b3a159 100644 --- a/types/accounting/tsconfig.json +++ b/types/accounting/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ace/tsconfig.json b/types/ace/tsconfig.json index eb52fff185..97c51e2bf9 100644 --- a/types/ace/tsconfig.json +++ b/types/ace/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/acl/tsconfig.json b/types/acl/tsconfig.json index 9f5c6a01ef..ada20a1b2c 100644 --- a/types/acl/tsconfig.json +++ b/types/acl/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/acorn/tsconfig.json b/types/acorn/tsconfig.json index 0b4760b0fc..9a9bbdd763 100644 --- a/types/acorn/tsconfig.json +++ b/types/acorn/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/actioncable/tsconfig.json b/types/actioncable/tsconfig.json index cb137a8982..544fc4d502 100644 --- a/types/actioncable/tsconfig.json +++ b/types/actioncable/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/actions-on-google/actions-on-google-tests.ts b/types/actions-on-google/actions-on-google-tests.ts index e57e1e8d98..d24c3093b4 100644 --- a/types/actions-on-google/actions-on-google-tests.ts +++ b/types/actions-on-google/actions-on-google-tests.ts @@ -1,6 +1,6 @@ import { ActionsSdkApp, ActionsSdkAppOptions, DialogflowApp, DialogflowAppOptions, AssistantApp, Responses, Transactions } from 'actions-on-google'; -import * as express from 'express'; +import express = require('express'); function testActionsSdk(request: express.Request, response: express.Response) { const app = new ActionsSdkApp({request, response}); diff --git a/types/actions-on-google/assistant-app.d.ts b/types/actions-on-google/assistant-app.d.ts index 58d933baf2..d835915259 100644 --- a/types/actions-on-google/assistant-app.d.ts +++ b/types/actions-on-google/assistant-app.d.ts @@ -263,8 +263,8 @@ export interface UserName { * User's permissioned device location. */ export interface DeviceLocation { - /** {latitude, longitude}. Requested with SupportedPermissions.DEVICE_PRECISE_LOCATION. */ - coordinates: object; + /** Coordinates: {latitude, longitude}. Requested with SupportedPermissions.DEVICE_PRECISE_LOCATION. */ + coordinates: Coordinates; /** Full, formatted street address. Requested with SupportedPermissions.DEVICE_PRECISE_LOCATION. */ address: string; /** Zip code. Requested with SupportedPermissions.DEVICE_COARSE_LOCATION. */ @@ -273,6 +273,16 @@ export interface DeviceLocation { city: string; } +/** + * Coordinates containing latitude and longitude + */ +export interface Coordinates { + /** Latitude coordinate. */ + latitude: number; + /** Longitude coordinate. */ + longitude: number; +} + /** * User object. */ diff --git a/types/actions-on-google/tsconfig.json b/types/actions-on-google/tsconfig.json index 6682b5c194..82fc80a44f 100644 --- a/types/actions-on-google/tsconfig.json +++ b/types/actions-on-google/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -25,4 +26,4 @@ "transactions.d.ts", "actions-on-google-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/activex-access/tsconfig.json b/types/activex-access/tsconfig.json index a376fcb722..d1fac56caa 100644 --- a/types/activex-access/tsconfig.json +++ b/types/activex-access/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/activex-access/tslint.json b/types/activex-access/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-access/tslint.json +++ b/types/activex-access/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-adodb/tsconfig.json b/types/activex-adodb/tsconfig.json index 5cb32f94c9..7a5b6e8f13 100644 --- a/types/activex-adodb/tsconfig.json +++ b/types/activex-adodb/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/activex-adodb/tslint.json b/types/activex-adodb/tslint.json index 2750cc0197..3224b40b8b 100644 --- a/types/activex-adodb/tslint.json +++ b/types/activex-adodb/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } \ No newline at end of file +{ + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } +} diff --git a/types/activex-dao/tsconfig.json b/types/activex-dao/tsconfig.json index 2ddea247b9..da7ac77da9 100644 --- a/types/activex-dao/tsconfig.json +++ b/types/activex-dao/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/activex-dao/tslint.json b/types/activex-dao/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-dao/tslint.json +++ b/types/activex-dao/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-diskquota/activex-diskquota-tests.ts b/types/activex-diskquota/activex-diskquota-tests.ts new file mode 100644 index 0000000000..2672b590ca --- /dev/null +++ b/types/activex-diskquota/activex-diskquota-tests.ts @@ -0,0 +1,44 @@ +const collectionToArray = (col: any) => { // tslint:disable-line no-unnecessary-generics + const results: T[] = []; + const enumerator = new Enumerator(col); + enumerator.moveFirst(); + while (!enumerator.atEnd()) { + results.push(enumerator.item()); + enumerator.moveNext(); + } + return results; +}; + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787925(v=vs.85).aspx +(() => { + const enumUsers = (label: string) => { + const volume = new ActiveXObject('Microsoft.DiskQuota'); + volume.Initialize(label, true); + collectionToArray(volume).forEach(x => { + // Use the QuotaUser object to retrieve or set one or more of the user's disk quota properties + }); + }; +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787916(v=vs.85).aspx +(() => { + const volume = new ActiveXObject('Microsoft.DiskQuota'); + volume.Initialize('MYDISK', true); + ActiveXObject.on(volume, 'OnUserNameChanged', ['pUser'], p => { + // Code to handle the event. + }); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787904(v=vs.85).aspx +(() => { + const dqc = new ActiveXObject('Microsoft.DiskQuota'); + dqc.Initialize('MYDISK', true); + const findName = (name: string) => { + try { + return dqc.FindUser(name); + } catch { } + try { + return dqc.FindUser(dqc.TranslateLogonNameToSID(name)); + } catch { } + }; +})(); diff --git a/types/activex-diskquota/index.d.ts b/types/activex-diskquota/index.d.ts new file mode 100644 index 0000000000..d27863de3c --- /dev/null +++ b/types/activex-diskquota/index.d.ts @@ -0,0 +1,152 @@ +// Type definitions for DiskQuotaTypeLibrary 1.0 +// Project: https://msdn.microsoft.com/en-us/library/windows/desktop/bb773938(v=vs.85).aspx +// Definitions by: Zev Spitz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.5 + +declare namespace DiskQuotaTypeLibrary { + // tslint:disable-next-line no-const-enum + const enum AccountStatusConstants { + dqAcctDeleted = 2, + dqAcctInvalid = 3, + dqAcctResolved = 0, + dqAcctUnavailable = 1, + dqAcctUnknown = 4, + dqAcctUnresolved = 5, + } + + // tslint:disable-next-line no-const-enum + const enum QuotaStateConstants { + dqStateDisable = 0, + dqStateEnforce = 2, + dqStateTrack = 1, + } + + // tslint:disable-next-line no-const-enum + const enum UserNameResolutionConstants { + dqResolveAsync = 2, + dqResolveNone = 0, + dqResolveSync = 1, + } + + /** Automation interface for DiskQuotaUser */ + class DIDiskQuotaUser { + private 'DiskQuotaTypeLibrary.DIDiskQuotaUser_typekey': DIDiskQuotaUser; + private constructor(); + + /** Name of user's account container */ + readonly AccountContainerName: string; + + /** Status of user's account */ + readonly AccountStatus: AccountStatusConstants; + + /** User's display name */ + readonly DisplayName: string; + + /** Unique ID number */ + readonly ID: number; + + /** Invalidate data cached in user object */ + Invalidate(): void; + + /** User's logon account name */ + readonly LogonName: string; + + /** User's quota limit (bytes) */ + QuotaLimit: number; + + /** User's quota limit (text) */ + readonly QuotaLimitText: string; + + /** User's quota warning threshold (bytes) */ + QuotaThreshold: number; + + /** User's quota warning threshold (text) */ + readonly QuotaThresholdText: string; + + /** Quota charged to user (bytes) */ + readonly QuotaUsed: number; + + /** Quota charged to user (text) */ + readonly QuotaUsedText: string; + } + + /** Microsoft Disk Quota */ + class DiskQuotaControl { + private 'DiskQuotaTypeLibrary.DiskQuotaControl_typekey': DiskQuotaControl; + private constructor(); + + /** Add a user quota entry by Name */ + AddUser(LogonName: string): DIDiskQuotaUser; + + /** Default quota limit applied to new volume users (byte value) */ + DefaultQuotaLimit: number; + + /** Default quota limit applied to new volume users (text string) */ + readonly DefaultQuotaLimitText: string; + + /** Default warning threshold applied to new volume users (byte value) */ + DefaultQuotaThreshold: number; + + /** Default warning threshold applied to new volume users (text string) */ + readonly DefaultQuotaThresholdText: string; + + /** Delete a user quota entry */ + DeleteUser(pUser: DIDiskQuotaUser): void; + + /** Find a user quota entry by Name */ + FindUser(LogonName: string): DIDiskQuotaUser; + + /** Promote a user quota entry to the head of the name resolution queue */ + GiveUserNameResolutionPriority(pUser: DIDiskQuotaUser): void; + + /** Initialize the quota control object for a specified volume */ + Initialize(path: string, bReadWrite: boolean): void; + + /** Invalidate the cache of user name information */ + InvalidateSidNameCache(): void; + + /** Write event log entry when user exceeds quota limit */ + LogQuotaLimit: boolean; + + /** Write event log entry when user exceeds quota warning threshold */ + LogQuotaThreshold: boolean; + + /** Indicates if quota information is out of date */ + readonly QuotaFileIncomplete: boolean; + + /** Indicates if quota information is being rebuilt */ + readonly QuotaFileRebuilding: boolean; + + /** State of the volume's disk quota system */ + QuotaState: QuotaStateConstants; + + /** Terminate the user name resolution thread */ + ShutdownNameResolution(): void; + + /** Translates a user logon name to a security ID */ + TranslateLogonNameToSID(LogonName: string): string; + + /** Control the resolution of user Security IDs to user Names */ + UserNameResolution: UserNameResolutionConstants; + } +} + +interface ActiveXObject { + on( + obj: DiskQuotaTypeLibrary.DiskQuotaControl, event: 'OnUserNameChanged', argNames: ['pUser'], handler: ( + this: DiskQuotaTypeLibrary.DiskQuotaControl, parameter: {readonly pUser: DiskQuotaTypeLibrary.DIDiskQuotaUser}) => void): void; + new(progid: K): ActiveXObjectNameMap[K]; +} + +interface ActiveXObjectNameMap { + 'Microsoft.DiskQuota': DiskQuotaTypeLibrary.DiskQuotaControl; +} + +interface EnumeratorConstructor { + new(col: DiskQuotaTypeLibrary.DiskQuotaControl): Enumerator; +} + +interface SafeArray { + _brand: SafeArray; +} diff --git a/types/activex-diskquota/package.json b/types/activex-diskquota/package.json new file mode 100644 index 0000000000..d9b1031263 --- /dev/null +++ b/types/activex-diskquota/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "activex-helpers": "*" + } +} \ No newline at end of file diff --git a/types/activex-diskquota/tsconfig.json b/types/activex-diskquota/tsconfig.json new file mode 100644 index 0000000000..61686bd769 --- /dev/null +++ b/types/activex-diskquota/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5", + "scripthost" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "activex-diskquota-tests.ts" + ] +} \ No newline at end of file diff --git a/types/activex-diskquota/tslint.json b/types/activex-diskquota/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/activex-diskquota/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/activex-excel/tsconfig.json b/types/activex-excel/tsconfig.json index 244ab1d0ef..a9599850ef 100644 --- a/types/activex-excel/tsconfig.json +++ b/types/activex-excel/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/activex-excel/tslint.json b/types/activex-excel/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-excel/tslint.json +++ b/types/activex-excel/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-faxcomexlib/activex-faxcomexlib-tests.ts b/types/activex-faxcomexlib/activex-faxcomexlib-tests.ts new file mode 100644 index 0000000000..9ae8c7641d --- /dev/null +++ b/types/activex-faxcomexlib/activex-faxcomexlib-tests.ts @@ -0,0 +1,730 @@ +/// + +const collectionToArray = (col: { Item(index: any): T } | SafeArray) => { + const results: T[] = []; + const enumerator = new Enumerator(col); + enumerator.moveFirst(); + while (!enumerator.atEnd()) { + results.push(enumerator.item()); + enumerator.moveNext(); + } + return results; +}; + +const toSafeArray = (...items: T[]): SafeArray => { + const dict = new ActiveXObject('Scripting.Dictionary'); + items.forEach((x, index) => dict.Add(index, x)); + return dict.Items() as SafeArray; +}; + +const VB = { + InputBox: (prompt: string): string => '' +}; + +const getServer = () => { + const server = new ActiveXObject('FaxComEx.FaxServer'); + server.Connect(''); + return server; +}; + +(() => { + // https://msdn.microsoft.com/en-us/library/windows/desktop/ms693376(v=vs.85).aspx + const server = new ActiveXObject('FaxComEx.FaxServer'); + const document = new ActiveXObject('FaxComEx.FaxDocument'); + + // https://msdn.microsoft.com/en-us/library/windows/desktop/ms692919(v=vs.85).aspx + server.Connect(''); + server.Connect('computername'); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693502(v=vs.85).aspx +(() => { + const getInitializedDevice = () => { + const ret = getServer().GetDevices().ItemById(1); + ret.ReceiveMode = FAXCOMEXLib.FAX_DEVICE_RECEIVE_MODE_ENUM.fdrmAUTO_ANSWER; + ret.RingsBeforeAnswer = 5; + ret.SendEnabled = true; + return ret; + }; + + // saving configuration + let device = getInitializedDevice(); + device.Save(); + + // abandoning changes to configuration, using the Refresh method + device = getInitializedDevice(); + device.Refresh(); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693502(v=vs.85).aspx +(() => { + const incomingJob = getServer().Folders.IncomingQueue.GetJobs().Item(1); + incomingJob.Refresh(); + const currentPage = incomingJob.CurrentPage; +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms692922(v=vs.85).aspx +(() => { + const server = getServer(); + + WScript.Echo(`Server information: +API Version: ${server.APIVersion} +Debug: ${server.Debug} +Build and version: ${server.MajorBuild}.${server.MinorBuild}.${server.MajorVersion}.${server.MinorVersion} +Server name: ${server.ServerName}`); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693455(v=vs.85).aspx +(() => { + const activity = getServer().Activity; + activity.Refresh(); + + WScript.Echo(` +${activity.IncomingMessages} incoming messages +${activity.OutgoingMessages} outgoing messages +${activity.RoutingMessages} routing messages +${activity.QueuedMessages} queued messages`); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693400(v=vs.85).aspx +(() => { + const device = getServer().GetDevices().Item(1); + device.CSID = 'Accounts payable'; + device.Description = 'Primary fax device'; + device.ReceiveMode = FAXCOMEXLib.FAX_DEVICE_RECEIVE_MODE_ENUM.fdrmAUTO_ANSWER; + device.RingsBeforeAnswer = 5; + device.SendEnabled = true; + device.TSID = 'Accounts payable'; + device.Save(); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms692985(v=vs.85).aspx +(() => { + const devices = getServer().GetDevices(); + WScript.Echo(`This server has ${devices.Count} fax devices`); + for (let i = 1; i <= devices.Count; i++) { + WScript.Echo(`Device ID for device number ${i} is ${devices.Item(i).Id}`); + } + + collectionToArray(devices).forEach(device => { + device.Refresh(); + WScript.Echo(` +Device name: ${device.DeviceName} +Provider unique name: ${device.ProviderUniqueName} +Powered off: ${device.PoweredOff} +Receiving now: ${device.ReceivingNow} +Ringing now: ${device.RingingNow} +Sending now: ${device.SendingNow}`); + + const routingMethods = new VBArray(device.UsedRoutingMethods).toArray(); + routingMethods.forEach((guid, index) => { + WScript.Echo(`Method number ${index} = ${guid}`); + }); + + device.UseRoutingMethod(routingMethods[0], false); + device.Save(); + }); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693486(v=vs.85).aspx +(() => { + const outputRuleInfo = (rule: FAXCOMEXLib.FaxOutboundRoutingRule, index?: number) => { + WScript.Echo(` +Outbound routing rule number: ${index || 'unknown'} +Area code: ${rule.AreaCode} +Country/region code: ${rule.CountryCode} +Device ID: ${rule.DeviceId} +Group name: ${rule.GroupName} +Status: ${rule.Status} +Is device used: ${rule.UseDevice}` + .trim()); + }; + + const server = getServer(); + const device = server.GetDevices().Item(1); + const id = device.Id; + const rules = server.OutboundRouting.GetRules(); + const outboundRoutingRules = server.OutboundRouting.GetRules(); + WScript.Echo(`There are ${outboundRoutingRules.Count} outbound routing rules on this server.`); + + collectionToArray(outboundRoutingRules).forEach((rule, index) => { + rule.Refresh(); + outputRuleInfo(rule, index); + + if (!rule.UseDevice) { return; } + if (VB.InputBox('Do you want to change the device for this rule (Y/N)?') === 'Y') { + const newDeviceID = parseInt(VB.InputBox('Enter new device ID'), 10); + rule.DeviceId = newDeviceID; + rule.Save(); + } + }); + + const msg = ` +Do you want to: +1) display an item based on its country/region and area code, +2) remove an item based on its country/region and area code, +3) remove an item based on its item number, or +4) add a rule? +Input 1, 2, 3, 4, or 0 to exit +`.trim(); + const result = parseInt(VB.InputBox(msg), 10); + let countryCode: number; + let areaCode: number; + let itemNumber: number; + let rule: FAXCOMEXLib.FaxOutboundRoutingRule; + switch (result) { + case 1: + countryCode = parseInt(VB.InputBox('Enter the country/region code'), 10); + areaCode = parseInt(VB.InputBox('Enter the area code'), 10); + rule = outboundRoutingRules.ItemByCountryAndArea(countryCode, areaCode); + outputRuleInfo(rule); + break; + case 2: + countryCode = parseInt(VB.InputBox('Enter the country/region code'), 10); + areaCode = parseInt(VB.InputBox('Enter the area code'), 10); + outboundRoutingRules.RemoveByCountryAndArea(countryCode, areaCode); + break; + case 3: + itemNumber = parseInt(VB.InputBox('Enter the item number'), 10); + outboundRoutingRules.Remove(itemNumber); + break; + case 4: + countryCode = parseInt(VB.InputBox('Enter the country/region code'), 10); + areaCode = parseInt(VB.InputBox('Enter the area code'), 10); + rule = outboundRoutingRules.Add(countryCode, areaCode, true, '', id); + break; + default: + return; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693408(v=vs.85).aspx +(() => { + const server = getServer(); + const outboundRouting = server.OutboundRouting; + const outboundRoutingGroups = outboundRouting.GetGroups(); + const groupName = VB.InputBox('Provide a name for the outbound routing group'); + const outboundRoutingGroup = outboundRoutingGroups.Add(groupName); + const devices = collectionToArray(server.GetDevices()); + + // add the devices to the routing group + devices.forEach(device => outboundRoutingGroup.DeviceIds.Add(device.Id)); + // move the last device to the top of the order + outboundRoutingGroup.DeviceIds.SetOrder(devices[devices.length - 1].Id, 1); + + // display the number of devices, and the device ID of the first device,to confirm its location in the order + const msg = ` +Number of devices: ${outboundRoutingGroup.DeviceIds.Count} +ID of first device: ${outboundRoutingGroup.DeviceIds.Item(1)} +`.trim(); + WScript.Echo(msg); + + // remove the first device + outboundRoutingGroup.DeviceIds.Remove(1); + + WScript.Echo(`There are now ${outboundRoutingGroups.Count} routing groups on the server`); + + collectionToArray(outboundRoutingGroups).forEach((routingGroup, index) => { + const msg = ` +Routing group number: ${index} +Outbound routing group name: ${routingGroup.Name} +Device status: ${routingGroup.Status} +`.trim(); + }); + + // allow user to remove a routing group + if (VB.InputBox('Do you want to remove a routing group (Y/N)?') === 'N') { return; } + const itemNumber = VB.InputBox('Enter the item number for the group you want to remove'); + outboundRoutingGroups.Remove(itemNumber); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/aa964960(v=vs.85).aspx +(() => { + const accountSet = getServer().FaxAccountSet; + const accounts = collectionToArray(accountSet.GetAccounts()); + WScript.Echo(`Number of accounts: ${accounts.length}`); + accounts.forEach(account => WScript.Echo(account.AccountName)); + + const accountName = VB.InputBox('Enter an account name'); + accountSet.AddAccount(accountName); + accountSet.RemoveAccount(accountName); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms692952(v=vs.85).aspx +(() => { + const incomingJobs = collectionToArray(getServer().Folders.IncomingQueue.GetJobs()); + WScript.Echo(`There are ${incomingJobs.length} jobs in the incoming queue.`); + const n = parseInt(VB.InputBox('Input the number of a job for which you want information'), 10); + const job = incomingJobs[n - 1]; + WScript.Echo(` +Available operations: ${job.AvailableOperations} +Caller ID: ${job.CallerId} +CSID: ${job.CSID} +Current page: ${job.CurrentPage} +Device ID: ${job.DeviceId} +Extended status: ${job.ExtendedStatus} +Extended status code: ${job.ExtendedStatusCode} +Job ID: ${job.Id} +Job type: ${job.JobType} +Retries: ${job.Retries} +Routing information: ${job.RoutingInformation} +Size: ${job.Size} +Status: ${job.Status} +Transmission start: ${new Date(job.TransmissionStart)} +Transmission end: ${new Date(job.TransmissionEnd)} +TSID: ${job.TSID} +`.trim()); + + if (VB.InputBox('Cancel this fax (Y/N)?') === 'Y') { + job.Cancel(); + } + + if (VB.InputBox('Open this fax (Y/N)?') === 'Y') { + const fileName = VB.InputBox('Enter path to save'); + job.CopyTiff(fileName); + new ActiveXObject('WScript.Shell').Run(fileName); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms692914(v=vs.85).aspx +(() => { + const server = new ActiveXObject('FaxComEx.FaxServer'); + server.Connect(''); + const outgoingQueue = server.Folders.OutgoingQueue; + outgoingQueue.AgeLimit = 2; + outgoingQueue.AllowPersonalCoverPages = true; + outgoingQueue.Blocked = false; + outgoingQueue.Paused = false; + outgoingQueue.Branding = true; + outgoingQueue.DiscountRateStart = new Date(0, 0, 0, 0).getVarDate(); + outgoingQueue.DiscountRateStart = new Date(0, 0, 0, 1).getVarDate(); + outgoingQueue.UseDeviceTSID = true; + outgoingQueue.Save(); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693393(v=vs.85).aspx +(() => { + const outgoingQueue = getServer().Folders.OutgoingQueue; + outgoingQueue.Refresh(); + WScript.Echo(`There are ${outgoingQueue.GetJobs().Count} faxes in the outgoing queue`); + const inputResult = VB.InputBox('Which fax should be displayed (item number or job name)?'); + const itemNumber = parseInt(inputResult, 10); + const job = + isNaN(itemNumber) ? + outgoingQueue.GetJob(inputResult) : + outgoingQueue.GetJobs().Item(itemNumber); + + WScript.Echo(` +Available operations: ${job.AvailableOperations} +Broadcast receipts grouped? ${job.GroupBroadcastReceipts} +CSID: ${job.CSID} +Current page: ${job.CurrentPage} +Device ID: ${job.DeviceId} +Document name: ${job.DocumentName} +Extended status: ${job.ExtendedStatus} +Extended status code: ${job.ExtendedStatusCode} +Job ID: ${job.Id} +Original scheduled time: ${new Date(job.OriginalScheduledTime)} +Pages: ${job.Pages} +Priority: ${job.Priority} +Receipt type: ${job.ReceiptType} +`.trim()); + + const fileName = VB.InputBox('Enter path to save'); + job.CopyTiff(fileName); + new ActiveXObject('WScript.Shell').Run(fileName); + + const answer = VB.InputBox(` +Do you want to: +(C) cancel +(P) pause +(R) restart +(E) resume +the job? +`.trim()); + + switch (answer) { + case 'C': + job.Cancel(); + break; + case 'P': + job.Pause(); + break; + case 'R': + job.Restart(); + break; + case 'E': + job.Resume(); + break; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms692936(v=vs.85).aspx +(() => { + const document = new ActiveXObject('FaxComEx.FaxDocument'); + document.Body = 'C:\\docs\\body.txt'; + document.DocumentName = 'My First Fax'; + document.Priority = FAXCOMEXLib.FAX_PRIORITY_TYPE_ENUM.fptHIGH; + document.Recipients.Add('12225550100', 'Bud'); + document.AttachFaxToReceipt = true; + document.CoverPageType = FAXCOMEXLib.FAX_COVERPAGE_TYPE_ENUM.fcptSERVER; + document.Note = 'Here is the info you requested'; + document.ReceiptAddress = 'someone@example.com'; + document.ReceiptType = FAXCOMEXLib.FAX_RECEIPT_TYPE_ENUM.frtMAIL; + document.ScheduleType = FAXCOMEXLib.FAX_SCHEDULE_TYPE_ENUM.fstSPECIFIC_TIME; + document.ScheduleTime = new Date(0, 0, 0, 16, 35, 47).getVarDate(); + document.Subject = 'Today\'s fax'; + + // set sender properties + const sender = document.Sender; + sender.Title = 'Mr.'; + sender.Name = 'Bob'; + sender.City = 'Cleveland Heights'; + sender.State = 'Ohio'; + sender.Company = 'Microsoft'; + sender.Country = 'USA'; + sender.Email = 'someone@microsoft.com'; + sender.FaxNumber = '12165555554'; + sender.HomePhone = '12165555555'; + sender.OfficeLocation = 'Downtown'; + sender.OfficePhone = '12165555553'; + sender.StreetAddress = '123 Main Street'; + sender.TSID = 'Office fax machine'; + sender.ZipCode = '44118'; + sender.BillingCode = '23A54'; + sender.Department = 'Accts Payable'; + sender.SaveDefaultSender(); + + const server = getServer(); + + const jobID = document.ConnectedSubmit(server); + WScript.Echo(`The job ID is ${jobID}`); + + server.Disconnect(); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693479(v=vs.85).aspx +(() => { + const document = new ActiveXObject('FaxComEx.FaxDocument'); + document.Body = 'C:\\docs\\body.txt'; + document.DocumentName = 'My First Fax'; + + const recipients = document.Recipients; + recipients.Add('12225550105', 'H'); + recipients.Add('12225550104', 'N'); + recipients.Add('12225550103', 'G'); + + WScript.Echo(`Number of recipients: ${recipients.Count}`); + collectionToArray(recipients).forEach((recipient, index) => + WScript.Echo(`Recipient number ${index}: ${recipient.Name}, ${recipient.FaxNumber}`) + ); + + document.Sender.LoadDefaultSender(); + document.GroupBroadcastReceipts = true; + + const jobIDs = document.Submit(''); + collectionToArray(jobIDs).forEach(jobID => WScript.Echo(`The job ID is ${jobID}`)); + + while (recipients.Count > 0) { + recipients.Remove(1); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/aa964962(v=vs.85).aspx +(() => { + const server = getServer(); + const prefetchCount = parseInt(VB.InputBox('How many messages should be prefetched?'), 10); + server.CurrentAccount.Folders.IncomingArchive.Refresh(); + const messageIterator = server.Folders.IncomingArchive.GetMessages(prefetchCount); + messageIterator.MoveFirst(); + for (let i = 1; i <= prefetchCount; i++) { + if (i > 1 && VB.InputBox('View next message? (Y/N)') !== 'Y') { break; } + const message = messageIterator.Message as FAXCOMEXLib.FaxIncomingMessage; + if (messageIterator.AtEOF) { + WScript.Echo(`End of file reached`); + return; + } + if (!message.WasReAssigned) { + if (VB.InputBox('Message not reassigned. Reassign (Y/N)?') === 'Y') { + message.Subject = 'Reassigning message'; + message.SenderName = 'Test user'; + message.Recipients = VB.InputBox('Enter username, e.g. Domain\\UserName'); + message.SenderFaxNumber = '1234'; + message.ReAssign(); + } + } + messageIterator.MoveNext(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693402(v=vs.85).aspx +(() => { + const server = getServer(); + const prefetchCount = parseInt(VB.InputBox('How many messages should be prefetched?'), 10); + server.Folders.OutgoingArchive.Refresh(); + const messageIterator = server.Folders.OutgoingArchive.GetMessages(prefetchCount); + messageIterator.MoveFirst(); + for (let i = 1; i <= prefetchCount; i++) { + if (i > 1 && VB.InputBox('View next message? (Y/N)') !== 'Y') { break; } + if (messageIterator.AtEOF) { + WScript.Echo(`End of file reached`); + return; + } + const message = messageIterator.Message as FAXCOMEXLib.FaxOutgoingMessage; + + const fileName = VB.InputBox('Enter path to save'); + message.CopyTiff(fileName); + new ActiveXObject('WScript.Shell').Run(fileName); + + WScript.Echo(`Message information: +CSID: ${message.CSID} +Device name: ${message.DeviceName} +Document name: ${message.DocumentName} +Message ID: ${message.Id} +Original scheduled time: ${new Date(message.OriginalScheduledTime)} +Pages: ${message.Pages} +Recipient fax number: ${message.Recipient.FaxNumber} +Retries: ${message.Retries} +Sender name: ${message.Sender.Name} +Size: ${message.Size} +Subject: ${message.Subject} +Submission ID: ${message.SubmissionId} +Submission time: ${new Date(message.SubmissionTime)} +Transmission end time: ${new Date(message.TransmissionEnd)} +Transmission start time: ${new Date(message.TransmissionStart)} +TSID: ${message.TSID}`); + + if (VB.InputBox('Delete this fax from the archive (Y/N)?') === 'Y') { + message.Delete(); + } + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693472(v=vs.85).aspx +(() => { + const server = getServer(); + const outgoingArchive = server.Folders.OutgoingArchive; + WScript.Echo(` +Age limit: ${outgoingArchive.AgeLimit} +Archive folder: ${outgoingArchive.ArchiveFolder} +High quota mark: ${outgoingArchive.HighQuotaWaterMark} +Low quota water mark: ${outgoingArchive.LowQuotaWaterMark} +Size high: ${outgoingArchive.SizeHigh} +Size low: ${outgoingArchive.SizeLow} +Size quota warning: ${outgoingArchive.SizeQuotaWarning} +Is archive used? ${outgoingArchive.UseArchive}`.trim() + ); + + const newLimit = VB.InputBox('Set new age limit (enter empty value or Cancel to leave unchanged'); + if (newLimit) { + outgoingArchive.AgeLimit = parseInt(newLimit, 10); + } + + const messageID = VB.InputBox('Retrieve a message by ID (enter an empty value or press Cancel to exit'); + if (messageID) { + const fileName = VB.InputBox('Enter path to save'); + outgoingArchive.GetMessage(messageID).CopyTiff(fileName); + new ActiveXObject('WScript.Shell').Run(fileName); + } +})(); + +(() => { + const server = getServer(); + const messageIterator = server.Folders.OutgoingArchive.GetMessages(); + if (messageIterator.AtEOF) { return; } + messageIterator.MoveFirst(); + while (!messageIterator.AtEOF) { + const message = messageIterator.Message; + WScript.Echo(` +Document name: ${message.DocumentName} +ID: ${message.Id} +Transmission end: ${new Date(message.TransmissionEnd)} +Transmission start: ${new Date(message.TransmissionStart)} +`.trim()); + messageIterator.MoveNext(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms692976(v=vs.85).aspx +(() => { + const server = getServer(); + const prefetchCount = parseInt(VB.InputBox('How many messages should be prefetched?'), 10); + server.Folders.IncomingArchive.Refresh(); + const messageIterator = server.Folders.IncomingArchive.GetMessages(prefetchCount); + messageIterator.MoveFirst(); + for (let i = 1; i <= prefetchCount; i++) { + if (i > 1 && VB.InputBox('View next message? (Y/N)') !== 'Y') { break; } + const message = messageIterator.Message as FAXCOMEXLib.FaxIncomingMessage; + if (messageIterator.AtEOF) { + WScript.Echo(`End of file reached`); + return; + } + const fileName = VB.InputBox('Enter path to save TIFF file'); + message.CopyTiff(fileName); + new ActiveXObject('WScript.Shell').Run(fileName); + + messageIterator.MoveNext(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693406(v=vs.85).aspx +(() => { + const server = getServer(); + const incomingArchive = server.Folders.IncomingArchive; + incomingArchive.Refresh(); + WScript.Echo(` +High quota water mark: ${incomingArchive.HighQuotaWaterMark} +Low quota water mark: ${incomingArchive.LowQuotaWaterMark} +Archive folder: ${incomingArchive.ArchiveFolder} +Age limit: ${incomingArchive.AgeLimit} +Size high: ${incomingArchive.SizeHigh} +Size low: ${incomingArchive.SizeLow} +Is size quota warning on? ${incomingArchive.SizeQuotaWarning} +Is archive used? ${incomingArchive.UseArchive} +`.trim()); + + incomingArchive.AgeLimit = 4; + incomingArchive.Save(); + + const messageID = VB.InputBox('Message ID to retrieve information? (Leave empty, or Cancel, to exit)'); + if (messageID === '') { return; } + const message = incomingArchive.GetMessage(messageID); + WScript.Echo(` +Caller ID: ${message.CallerId} +CSID: ${message.CSID} +Device name: ${message.DeviceName} +Message ID: ${message.Id} +Number of pages: ${message.Pages} +Retries: ${message.Retries} +Routing information: ${message.RoutingInformation} +Size: ${message.Size} +Transmission start: ${new Date(message.TransmissionStart)} +Transmission end: ${new Date(message.TransmissionEnd)} +TSID: ${message.TSID} +`.trim()); + + if (VB.InputBox('Delete this message from the archive (Y/N)?') === 'Y') { + message.Delete(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693401(v=vs.85).aspx +(() => { + const server = getServer(); + const loggingOptions = server.LoggingOptions; + const activityLogging = loggingOptions.ActivityLogging; + const eventLogging = loggingOptions.EventLogging; + + activityLogging.Refresh(); + activityLogging.LogIncoming = true; + activityLogging.LogOutgoing = true; + activityLogging.Save(); + + eventLogging.Refresh(); + eventLogging.GeneralEventsLevel = FAXCOMEXLib.FAX_LOG_LEVEL_ENUM.fllMED; + eventLogging.InboundEventsLevel = FAXCOMEXLib.FAX_LOG_LEVEL_ENUM.fllMAX; + eventLogging.InitEventsLevel = FAXCOMEXLib.FAX_LOG_LEVEL_ENUM.fllMAX; + eventLogging.OutboundEventsLevel = FAXCOMEXLib.FAX_LOG_LEVEL_ENUM.fllNONE; + eventLogging.Save(); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693387(v=vs.85).aspx +(() => { + const server = getServer(); + const receiptOptions = server.ReceiptOptions; + receiptOptions.Refresh(); + WScript.Echo(` +Allowed receipt types: ${receiptOptions.AllowedReceipts} +Authentication types: ${receiptOptions.AuthenticationType} +SMTP port: ${receiptOptions.SMTPPort} +SMTP sender: ${receiptOptions.SMTPSender} +SMTP server: ${receiptOptions.SMTPSender} +Use for inbound routing? ${receiptOptions.UseForInboundRouting} +`.trim()); + + receiptOptions.AllowedReceipts = FAXCOMEXLib.FAX_RECEIPT_TYPE_ENUM.frtMAIL; + receiptOptions.AuthenticationType = FAXCOMEXLib.FAX_SMTP_AUTHENTICATION_TYPE_ENUM.fsatBASIC; + receiptOptions.SMTPPort = 25; + receiptOptions.SMTPSender = 'someone@example.com'; + receiptOptions.SMTPServer = 'My SMTP Server'; + receiptOptions.UseForInboundRouting = true; + receiptOptions.Save(); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693462(v=vs.85).aspx +(() => { + const server = getServer(); + collectionToArray(server.GetDeviceProviders()).forEach((provider, index) => { + WScript.Echo(` +Debug: ${provider.Debug} +Name: ${provider.FriendlyName} +Image name: ${provider.ImageName} +Init error code: ${provider.InitErrorCode} +Build and version: ${provider.MajorBuild}.${provider.MajorVersion}.${provider.MinorBuild}.${provider.MinorVersion} +Status: ${provider.Status} +TAPI provider: ${provider.TapiProviderName} +Unique name: ${provider.UniqueName} +`.trim()); + + new VBArray(provider.DeviceIds).toArray().forEach(id => WScript.Echo(id)); + }); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693437(v=vs.85).aspx -- for a fax device +(() => { + const server = getServer(); + const device = server.GetDevices().Item(1); + const deviceProperty = toSafeArray(1, 2, 3); + const propertyName = '{B1F944B9-9A16-45d1-933A-4060A4871AB0}'; + device.SetExtensionProperty(propertyName, deviceProperty); + new VBArray(device.GetExtensionProperty(propertyName)).toArray().forEach(x => WScript.Echo(x)); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693437(v=vs.85).aspx -- for a fax device +(() => { + const server = getServer(); + const serverProperty = toSafeArray(4, 2, 3); + const propertyName = `{AC7D0DEE-B6E5-4a44-AF45-835C58CB44D2}`; + server.SetExtensionProperty(propertyName, serverProperty); + new VBArray(server.GetExtensionProperty(propertyName)).toArray().forEach(x => WScript.Echo(x)); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693013(v=vs.85).aspx +(() => { + const server = getServer(); + + ActiveXObject.on(server, 'OnOutgoingJobAdded', ['pFaxServer', 'bstrJobId'], prm => WScript.Echo('New job added to queue')); + + ActiveXObject.on(server, 'OnOutgoingJobChanged', ['pFaxServer', 'bstrJobId', 'pJobStatus'], prm => { + const status = prm.pJobStatus; + WScript.Echo(` +Available operations: ${status.AvailableOperations} +Caller ID: ${status.CallerId} +CSID: ${status.CSID} +Current page: ${status.CurrentPage} +Device ID: ${status.DeviceId} +Extended status: ${status.ExtendedStatus} +Extended status code: ${status.ExtendedStatusCode} +Job type: ${status.JobType} +Pages: ${status.Pages} +Retries: ${status.Retries} +Routing information: ${status.RoutingInformation} +Scheduled time: ${new Date(status.ScheduledTime)} +Size: ${status.Size} +Status: ${status.Status} +Transmission start: ${new Date(status.TransmissionStart)} +TSID: ${status.TSID} +`.trim()); + + try { + WScript.Echo(`Transmission end: ${new Date(status.TransmissionEnd)}`); + } catch {} + }); + + ActiveXObject.on(server, 'OnServerShutDown', ['pFaxServer'], prm => WScript.Echo('The local fax server has been shut down')); + + server.ListenToServerEvents( + FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetFXSSVC_ENDED + + FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetOUT_QUEUE + ); +})(); diff --git a/types/activex-faxcomexlib/index.d.ts b/types/activex-faxcomexlib/index.d.ts new file mode 100644 index 0000000000..237c841fda --- /dev/null +++ b/types/activex-faxcomexlib/index.d.ts @@ -0,0 +1,2053 @@ +// Type definitions for Microsoft Fax Service Extended COM Type Library - FAXCOMEXLib 1.0 +// Project: https://msdn.microsoft.com/en-us/library/windows/desktop/ms684513(v=vs.85).aspx +// Definitions by: Zev Spitz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/// + +declare namespace FAXCOMEXLib { + // tslint:disable-next-line no-const-enum + const enum FAX_ACCESS_RIGHTS_ENUM { + farMANAGE_CONFIG = 64, + farMANAGE_IN_ARCHIVE = 256, + farMANAGE_JOBS = 16, + farMANAGE_OUT_ARCHIVE = 1024, + farQUERY_CONFIG = 32, + farQUERY_IN_ARCHIVE = 128, + farQUERY_JOBS = 8, + farQUERY_OUT_ARCHIVE = 512, + farSUBMIT_HIGH = 4, + farSUBMIT_LOW = 1, + farSUBMIT_NORMAL = 2, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_ACCESS_RIGHTS_ENUM_2 { + far2MANAGE_ARCHIVES = 256, + far2MANAGE_CONFIG = 64, + far2MANAGE_OUT_JOBS = 16, + far2MANAGE_RECEIVE_FOLDER = 512, + far2QUERY_ARCHIVES = 128, + far2QUERY_CONFIG = 32, + far2QUERY_OUT_JOBS = 8, + far2SUBMIT_HIGH = 4, + far2SUBMIT_LOW = 1, + far2SUBMIT_NORMAL = 2, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_ACCOUNT_EVENTS_TYPE_ENUM { + faetFXSSVC_ENDED = 16, + faetIN_ARCHIVE = 4, + faetIN_QUEUE = 1, + faetNONE = 0, + faetOUT_ARCHIVE = 8, + faetOUT_QUEUE = 2, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_COVERPAGE_TYPE_ENUM { + fcptLOCAL = 1, + fcptNONE = 0, + fcptSERVER = 2, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_DEVICE_RECEIVE_MODE_ENUM { + fdrmAUTO_ANSWER = 1, + fdrmMANUAL_ANSWER = 2, + fdrmNO_ANSWER = 0, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_GROUP_STATUS_ENUM { + fgsALL_DEV_NOT_VALID = 2, + fgsALL_DEV_VALID = 0, + fgsEMPTY = 1, + fgsSOME_DEV_NOT_VALID = 3, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_JOB_EXTENDED_STATUS_ENUM { + fjesANSWERED = 5, + fjesBAD_ADDRESS = 10, + fjesBUSY = 8, + fjesCALL_ABORTED = 19, + fjesCALL_BLACKLISTED = 14, + fjesCALL_COMPLETED = 18, + fjesCALL_DELAYED = 13, + fjesDIALING = 3, + fjesDISCONNECTED = 1, + fjesFATAL_ERROR = 12, + fjesHANDLED = 17, + fjesINITIALIZING = 2, + fjesLINE_UNAVAILABLE = 7, + fjesNO_ANSWER = 9, + fjesNO_DIAL_TONE = 11, + fjesNONE = 0, + fjesNOT_FAX_CALL = 15, + fjesPARTIALLY_RECEIVED = 16, + fjesPROPRIETARY = 16777216, + fjesRECEIVING = 6, + fjesTRANSMITTING = 4, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_JOB_OPERATIONS_ENUM { + fjoDELETE = 16, + fjoPAUSE = 2, + fjoRECIPIENT_INFO = 32, + fjoRESTART = 8, + fjoRESUME = 4, + fjoSENDER_INFO = 64, + fjoVIEW = 1, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_JOB_STATUS_ENUM { + fjsCANCELED = 512, + fjsCANCELING = 1024, + fjsCOMPLETED = 256, + fjsFAILED = 8, + fjsINPROGRESS = 2, + fjsNOLINE = 32, + fjsPAUSED = 16, + fjsPENDING = 1, + fjsRETRIES_EXCEEDED = 128, + fjsRETRYING = 64, + fjsROUTING = 2048, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_JOB_TYPE_ENUM { + fjtRECEIVE = 1, + fjtROUTING = 2, + fjtSEND = 0, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_LOG_LEVEL_ENUM { + fllMAX = 3, + fllMED = 2, + fllMIN = 1, + fllNONE = 0, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_PRIORITY_TYPE_ENUM { + fptHIGH = 2, + fptLOW = 0, + fptNORMAL = 1, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_PROVIDER_STATUS_ENUM { + fpsBAD_GUID = 2, + fpsBAD_VERSION = 3, + fpsCANT_INIT = 6, + fpsCANT_LINK = 5, + fpsCANT_LOAD = 4, + fpsSERVER_ERROR = 1, + fpsSUCCESS = 0, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_RECEIPT_TYPE_ENUM { + frtMAIL = 1, + frtMSGBOX = 4, + frtNONE = 0, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_ROUTING_RULE_CODE_ENUM { + frrcANY_CODE = 0, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_RULE_STATUS_ENUM { + frsALL_GROUP_DEV_NOT_VALID = 2, + frsBAD_DEVICE = 4, + frsEMPTY_GROUP = 1, + frsSOME_GROUP_DEV_NOT_VALID = 3, + frsVALID = 0, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_SCHEDULE_TYPE_ENUM { + fstDISCOUNT_PERIOD = 2, + fstNOW = 0, + fstSPECIFIC_TIME = 1, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_SERVER_APIVERSION_ENUM { + fsAPI_VERSION_0 = 0, + fsAPI_VERSION_1 = 65536, + fsAPI_VERSION_2 = 131072, + fsAPI_VERSION_3 = 196608, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_SERVER_EVENTS_TYPE_ENUM { + fsetACTIVITY = 8, + fsetCONFIG = 4, + fsetDEVICE_STATUS = 256, + fsetFXSSVC_ENDED = 128, + fsetIN_ARCHIVE = 32, + fsetIN_QUEUE = 1, + fsetINCOMING_CALL = 512, + fsetNONE = 0, + fsetOUT_ARCHIVE = 64, + fsetOUT_QUEUE = 2, + fsetQUEUE_STATE = 16, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_SMTP_AUTHENTICATION_TYPE_ENUM { + fsatANONYMOUS = 0, + fsatBASIC = 1, + fsatNTLM = 2, + } + + // tslint:disable-next-line no-const-enum + const enum FaxConstants { + bstrGROUPNAME_ALLDEVICES = '', + lDEFAULT_PREFETCH_SIZE = 100, + wcharREASSIGN_RECIPIENTS_DELIMITER = 59, + } + + /** FaxAccount Class */ + class FaxAccount { + private 'FAXCOMEXLib.FaxAccount_typekey': FaxAccount; + private constructor(); + + /** Name of the fax account */ + readonly AccountName: string; + + /** Folders belonging to the account */ + readonly Folders: FaxAccountFolders; + + /** Set bit-wise combination of events the fax account listens to */ + ListenToAccountEvents(EventTypes: FAX_ACCOUNT_EVENTS_TYPE_ENUM): void; + + /** Events the fax account is listening to */ + readonly RegisteredEvents: FAX_ACCOUNT_EVENTS_TYPE_ENUM; + } + + /** FaxAccountFolders Class */ + class FaxAccountFolders { + private 'FAXCOMEXLib.FaxAccountFolders_typekey': FaxAccountFolders; + private constructor(); + + /** Incoming archive */ + readonly IncomingArchive: FaxAccountIncomingArchive; + + /** Incoming queue */ + readonly IncomingQueue: FaxAccountIncomingQueue; + + /** Outgoing archive */ + readonly OutgoingArchive: FaxAccountOutgoingArchive; + + /** Outgoing queue */ + readonly OutgoingQueue: FaxAccountOutgoingQueue; + } + + /** FaxAccountIncomingArchive Class */ + class FaxAccountIncomingArchive { + private 'FAXCOMEXLib.FaxAccountIncomingArchive_typekey': FaxAccountIncomingArchive; + private constructor(); + + /** Get an archived message by its ID */ + GetMessage(bstrMessageId: string): IFaxIncomingMessage; + + /** + * Iterator on the archived messages + * @param number [lPrefetchSize=100] + */ + GetMessages(lPrefetchSize?: number): FaxIncomingMessageIterator; + + /** Refresh the object */ + Refresh(): void; + + /** The high 32-bit value of the archive size */ + readonly SizeHigh: number; + + /** The low 32-bit value of the archive size */ + readonly SizeLow: number; + } + + /** FaxAccountIncomingQueue Class */ + class FaxAccountIncomingQueue { + private 'FAXCOMEXLib.FaxAccountIncomingQueue_typekey': FaxAccountIncomingQueue; + private constructor(); + + /** Get incoming job by ID */ + GetJob(bstrJobId: string): FaxIncomingJob; + + /** Collection of incoming jobs */ + GetJobs(): FaxIncomingJobs; + } + + /** FaxAccountOutgoingArchive Class */ + class FaxAccountOutgoingArchive { + private 'FAXCOMEXLib.FaxAccountOutgoingArchive_typekey': FaxAccountOutgoingArchive; + private constructor(); + + /** Get an archived message by its ID */ + GetMessage(bstrMessageId: string): IFaxOutgoingMessage; + + /** + * Iterator on the archived messages + * @param number [lPrefetchSize=100] + */ + GetMessages(lPrefetchSize?: number): FaxOutgoingMessageIterator; + + /** Refresh the object */ + Refresh(): void; + + /** The high 32-bit value of the archive size */ + readonly SizeHigh: number; + + /** The low 32-bit value of the archive size */ + readonly SizeLow: number; + } + + /** FaxAccountOutgoingQueue Class */ + class FaxAccountOutgoingQueue { + private 'FAXCOMEXLib.FaxAccountOutgoingQueue_typekey': FaxAccountOutgoingQueue; + private constructor(); + + /** Get outgoing job by ID */ + GetJob(bstrJobId: string): IFaxOutgoingJob; + + /** Collection of outgoing jobs */ + GetJobs(): FaxOutgoingJobs; + } + + /** FaxAccounts Class */ + class FaxAccounts { + private 'FAXCOMEXLib.FaxAccounts_typekey': FaxAccounts; + private constructor(); + readonly Count: number; + Item(vIndex: any): FaxAccount; + } + + /** FaxAccountSet Class */ + class FaxAccountSet { + private 'FAXCOMEXLib.FaxAccountSet_typekey': FaxAccountSet; + private constructor(); + + /** Adds a fax account */ + AddAccount(bstrAccountName: string): FaxAccount; + + /** Get fax account by name */ + GetAccount(bstrAccountName: string): FaxAccount; + + /** Collection of fax accounts */ + GetAccounts(): FaxAccounts; + + /** Removes a fax account by name */ + RemoveAccount(bstrAccountName: string): void; + } + + /** FaxActivity Class */ + class FaxActivity { + private 'FAXCOMEXLib.FaxActivity_typekey': FaxActivity; + private constructor(); + + /** Number of incoming messages */ + readonly IncomingMessages: number; + + /** Number of outgoing messages */ + readonly OutgoingMessages: number; + + /** Number of queued messages */ + readonly QueuedMessages: number; + + /** Refresh the object */ + Refresh(): void; + + /** Number of routed incoming messages */ + readonly RoutingMessages: number; + } + + /** FaxActivityLogging Class */ + class FaxActivityLogging { + private 'FAXCOMEXLib.FaxActivityLogging_typekey': FaxActivityLogging; + private constructor(); + + /** Activity log database files path */ + DatabasePath: string; + + /** Does the server log incoming fax activity */ + LogIncoming: boolean; + + /** Does the server log outgoing fax activity */ + LogOutgoing: boolean; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + } + + /** FaxConfiguration Class */ + class FaxConfiguration { + private 'FAXCOMEXLib.FaxConfiguration_typekey': FaxConfiguration; + private constructor(); + + /** Are personal cover pages allowed */ + AllowPersonalCoverPages: boolean; + + /** Indicates how long the fax message is kept on the server */ + ArchiveAgeLimit: number; + + /** Location of the archive on the server */ + ArchiveLocation: string; + + /** The high 32-bit value of the archive size */ + readonly ArchiveSizeHigh: number; + + /** The low 32-bit value of the archive size */ + readonly ArchiveSizeLow: number; + + /** Does the server auto-create fax account on connect */ + AutoCreateAccountOnConnect: boolean; + + /** Does the server generate a brand */ + Branding: boolean; + + /** End of the discount rate period */ + DiscountRateEnd: VarDate; + + /** Start of the discount rate period */ + DiscountRateStart: VarDate; + + /** High quota water mark */ + HighQuotaWaterMark: number; + + /** Are incoming faxes viewable by everyone */ + IncomingFaxesArePublic: boolean; + + /** Is queue blocked for incoming faxes */ + IncomingQueueBlocked: boolean; + + /** Low quota water mark */ + LowQuotaWaterMark: number; + + /** How long the failed fax job is kept on the server */ + OutgoingQueueAgeLimit: number; + + /** Is queue blocked for outgoing faxes */ + OutgoingQueueBlocked: boolean; + + /** Is queue paused for outgoing faxes */ + OutgoingQueuePaused: boolean; + + /** Refresh the object */ + Refresh(): void; + + /** Number of retries */ + Retries: number; + + /** Retry delay */ + RetryDelay: number; + + /** Save the object */ + Save(): void; + + /** Is size quota warning on */ + SizeQuotaWarning: boolean; + + /** Whether faxes should be archived */ + UseArchive: boolean; + + /** Is device Transmitting Station ID used */ + UseDeviceTSID: boolean; + } + + /** FaxDevice Class */ + class FaxDevice { + private 'FAXCOMEXLib.FaxDevice_typekey': FaxDevice; + private constructor(); + + /** Answer the call */ + AnswerCall(): void; + + /** Device's Called Station ID */ + CSID: string; + + /** Description of the device */ + Description: string; + + /** Device name */ + readonly DeviceName: string; + + /** Get the device level extention property */ + GetExtensionProperty(bstrGUID: string): SafeArray; + + /** Unique device ID */ + readonly Id: number; + + /** Is the device is turned off */ + readonly PoweredOff: boolean; + + /** Device provider */ + readonly ProviderUniqueName: string; + + /** The receive mode of the device */ + ReceiveMode: FAX_DEVICE_RECEIVE_MODE_ENUM; + + /** Is the device receiving now */ + readonly ReceivingNow: boolean; + + /** Refresh the object */ + Refresh(): void; + + /** Is the device ringing now */ + readonly RingingNow: boolean; + + /** Number of rings before the device answers */ + RingsBeforeAnswer: number; + + /** Save the object */ + Save(): void; + + /** Is the device is enabled to send */ + SendEnabled: boolean; + + /** Is the device sending now */ + readonly SendingNow: boolean; + + /** Set the device level extention property */ + SetExtensionProperty(bstrGUID: string, vProperty: SafeArray): void; + + /** Device's Transmitting Station ID */ + TSID: string; + + /** Array of routing methods GUIDs */ + readonly UsedRoutingMethods: SafeArray; + + /** Adds or removes routing method */ + UseRoutingMethod(bstrMethodGUID: string, bUse: boolean): void; + } + + /** FaxDeviceIds Class */ + class FaxDeviceIds { + private 'FAXCOMEXLib.FaxDeviceIds_typekey': FaxDeviceIds; + private constructor(); + + /** Add a device */ + Add(lDeviceId: number): void; + readonly Count: number; + Item(lIndex: number): number; + + /** Remove a device */ + Remove(lIndex: number): void; + + /** Set order of the device */ + SetOrder(lDeviceId: number, lNewOrder: number): void; + } + + /** FaxDeviceProvider Class */ + class FaxDeviceProvider { + private 'FAXCOMEXLib.FaxDeviceProvider_typekey': FaxDeviceProvider; + private constructor(); + + /** Is device provider built in debug environment */ + readonly Debug: boolean; + + /** Array of device IDs exposed by the provider */ + readonly DeviceIds: SafeArray; + + /** Provider's friendly name */ + readonly FriendlyName: string; + + /** Full path and file name of the provider DLL */ + readonly ImageName: string; + + /** Last error code at load or initialization */ + readonly InitErrorCode: number; + + /** The major part of the device provider's build number */ + readonly MajorBuild: number; + + /** The major part of the device provider's version number */ + readonly MajorVersion: number; + + /** The minor part of the device provider's build number */ + readonly MinorBuild: number; + + /** The minor part of the device provider's version number */ + readonly MinorVersion: number; + + /** Status of the device provider */ + readonly Status: FAX_PROVIDER_STATUS_ENUM; + + /** TSP name used by the provider */ + readonly TapiProviderName: string; + + /** Unique name of the provider */ + readonly UniqueName: string; + } + + /** FaxDeviceProviders Class */ + class FaxDeviceProviders { + private 'FAXCOMEXLib.FaxDeviceProviders_typekey': FaxDeviceProviders; + private constructor(); + readonly Count: number; + Item(vIndex: any): FaxDeviceProvider; + } + + /** FaxDevices Class */ + class FaxDevices { + private 'FAXCOMEXLib.FaxDevices_typekey': FaxDevices; + private constructor(); + readonly Count: number; + Item(vIndex: any): FaxDevice; + + /** Get device by its ID */ + ItemById(lId: number): FaxDevice; + } + + /** FaxDocument Class */ + class FaxDocument { + private 'FAXCOMEXLib.FaxDocument_typekey': FaxDocument; + private constructor(); + + /** Whether to attach a fax to the receipt */ + AttachFaxToReceipt: boolean; + + /** Full paths to the fax document body files */ + Bodies: any; + + /** Full path to the fax document body file */ + Body: string; + + /** Call handle */ + CallHandle: number; + + /** Submit the fax document on the already connected server */ + ConnectedSubmit(pFaxServer: IFaxServer): any; + + /** Submit the fax document on the already connected server */ + ConnectedSubmit2(pFaxServer: IFaxServer, pvFaxOutgoingJobIDs: any): number; + + /** Cover page file path */ + CoverPage: string; + + /** Is server, local, or no cover page used */ + CoverPageType: FAX_COVERPAGE_TYPE_ENUM; + + /** The document name */ + DocumentName: string; + + /** Whether to group the broadcast receipts */ + GroupBroadcastReceipts: boolean; + + /** Contents of cover page note field */ + Note: string; + + /** Priority of the fax */ + Priority: FAX_PRIORITY_TYPE_ENUM; + + /** Address of the receipt */ + ReceiptAddress: string; + + /** Type of the receipt */ + ReceiptType: FAX_RECEIPT_TYPE_ENUM; + + /** Collection of recipients */ + readonly Recipients: FaxRecipients; + + /** Time to send the fax */ + ScheduleTime: VarDate; + + /** When to send the fax */ + ScheduleType: FAX_SCHEDULE_TYPE_ENUM; + + /** Sender information object */ + readonly Sender: FaxSender; + + /** Contents of cover page subject field */ + Subject: string; + + /** Submission Id for the Fax document */ + readonly SubmissionId: string; + + /** Connect to server, submit the fax document, disconnect */ + Submit(bstrFaxServerName: string): SafeArray; + + /** Connect to server, submit the fax document, disconnect */ + Submit2(bstrFaxServerName: string, pvFaxOutgoingJobIDs: any): number; + + /** Tapi connection */ + TapiConnection: any; + } + + /** FaxEventLogging Class */ + class FaxEventLogging { + private 'FAXCOMEXLib.FaxEventLogging_typekey': FaxEventLogging; + private constructor(); + + /** Detail level of event logs for general (other) events */ + GeneralEventsLevel: FAX_LOG_LEVEL_ENUM; + + /** Detail level of event logs for inbound fax events */ + InboundEventsLevel: FAX_LOG_LEVEL_ENUM; + + /** Detail level of event logs for initialization events */ + InitEventsLevel: FAX_LOG_LEVEL_ENUM; + + /** Detail level of event logs for outbound fax events */ + OutboundEventsLevel: FAX_LOG_LEVEL_ENUM; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + } + + /** FaxFolders Class */ + class FaxFolders { + private 'FAXCOMEXLib.FaxFolders_typekey': FaxFolders; + private constructor(); + + /** Incoming archive */ + readonly IncomingArchive: FaxIncomingArchive; + + /** Incoming queue */ + readonly IncomingQueue: FaxIncomingQueue; + + /** Outgoing archive */ + readonly OutgoingArchive: FaxOutgoingArchive; + + /** Outgoing queue */ + readonly OutgoingQueue: FaxOutgoingQueue; + } + + /** FaxInboundRouting Class */ + class FaxInboundRouting { + private 'FAXCOMEXLib.FaxInboundRouting_typekey': FaxInboundRouting; + private constructor(); + + /** Registered inbound routing extensions collection */ + GetExtensions(): FaxInboundRoutingExtensions; + + /** Ordered collection of all the registered methods */ + GetMethods(): FaxInboundRoutingMethods; + } + + /** FaxInboundRoutingExtension Class */ + class FaxInboundRoutingExtension { + private 'FAXCOMEXLib.FaxInboundRoutingExtension_typekey': FaxInboundRoutingExtension; + private constructor(); + + /** Is extension built in debug environment */ + readonly Debug: boolean; + + /** Extension's friendly name */ + readonly FriendlyName: string; + + /** Full path and file name of the extension DLL */ + readonly ImageName: string; + + /** Last error code at load or initialization */ + readonly InitErrorCode: number; + + /** The major part of extension's build number */ + readonly MajorBuild: number; + + /** The major part of extension's version number */ + readonly MajorVersion: number; + + /** Array of methods exposed by extension */ + readonly Methods: any; + + /** The minor part of extension's build number */ + readonly MinorBuild: number; + + /** The minor part of extension's version number */ + readonly MinorVersion: number; + + /** Load and initialization status of the extension */ + readonly Status: FAX_PROVIDER_STATUS_ENUM; + + /** Extension's unique name */ + readonly UniqueName: string; + } + + /** FaxInboundRoutingExtensions Class */ + class FaxInboundRoutingExtensions { + private 'FAXCOMEXLib.FaxInboundRoutingExtensions_typekey': FaxInboundRoutingExtensions; + private constructor(); + readonly Count: number; + Item(vIndex: any): FaxInboundRoutingExtension; + } + + /** FaxInboundRoutingMethod Class */ + class FaxInboundRoutingMethod { + private 'FAXCOMEXLib.FaxInboundRoutingMethod_typekey': FaxInboundRoutingMethod; + private constructor(); + + /** Friendly name of the extension exposing this method */ + readonly ExtensionFriendlyName: string; + + /** Image name of the extension exposing this method */ + readonly ExtensionImageName: string; + + /** Internal function name */ + readonly FunctionName: string; + + /** GUID of the method */ + readonly GUID: string; + + /** The name of the method */ + readonly Name: string; + + /** Priority of the method */ + Priority: number; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + } + + /** FaxInboundRoutingMethods Class */ + class FaxInboundRoutingMethods { + private 'FAXCOMEXLib.FaxInboundRoutingMethods_typekey': FaxInboundRoutingMethods; + private constructor(); + readonly Count: number; + Item(vIndex: any): FaxInboundRoutingMethod; + } + + /** FaxIncomingArchive Class */ + class FaxIncomingArchive { + private 'FAXCOMEXLib.FaxIncomingArchive_typekey': FaxIncomingArchive; + private constructor(); + + /** How long the fax message is kept on the Server */ + AgeLimit: number; + + /** Location of the archive folder on the server */ + ArchiveFolder: string; + + /** Get archived message by its ID */ + GetMessage(bstrMessageId: string): IFaxIncomingMessage; + + /** + * Iterator on the archived messages + * @param number [lPrefetchSize=100] + */ + GetMessages(lPrefetchSize?: number): FaxIncomingMessageIterator; + + /** High quota water mark */ + HighQuotaWaterMark: number; + + /** Low quota water mark */ + LowQuotaWaterMark: number; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + + /** The high 32-bit value of the archive size */ + readonly SizeHigh: number; + + /** The low 32-bit value of the archive size */ + readonly SizeLow: number; + + /** Is size quota warning on */ + SizeQuotaWarning: boolean; + + /** Whether received faxes should be archived */ + UseArchive: boolean; + } + + /** FaxIncomingJob Class */ + class FaxIncomingJob { + private 'FAXCOMEXLib.FaxIncomingJob_typekey': FaxIncomingJob; + private constructor(); + + /** Available operations, a bit-wise combination of FAX_JOB_OPERATIONS values */ + readonly AvailableOperations: FAX_JOB_OPERATIONS_ENUM; + + /** Caller ID */ + readonly CallerId: string; + + /** Cancel the incoming job */ + Cancel(): void; + + /** Copy TIFF image to the local file */ + CopyTiff(bstrTiffPath: string): void; + + /** Called Station ID */ + readonly CSID: string; + + /** Page currently in transmision */ + readonly CurrentPage: number; + + /** Device ID that transmits the job */ + readonly DeviceId: number; + + /** Extended status description */ + readonly ExtendedStatus: string; + + /** Code of the job's extended status */ + readonly ExtendedStatusCode: FAX_JOB_EXTENDED_STATUS_ENUM; + + /** Unique message ID */ + readonly Id: string; + + /** Job type */ + readonly JobType: FAX_JOB_TYPE_ENUM; + + /** Refresh the object */ + Refresh(): void; + + /** Number of failed transmission retries */ + readonly Retries: number; + + /** Routing information */ + readonly RoutingInformation: string; + + /** Size in bytes of the message's TIFF file */ + readonly Size: number; + + /** Current queue status of the job, a bit-wise combination of FAX_JOB_STATUS values */ + readonly Status: FAX_JOB_STATUS_ENUM; + + /** Transmission end time */ + readonly TransmissionEnd: VarDate; + + /** Transmission start time */ + readonly TransmissionStart: VarDate; + + /** Transmitting Station ID */ + readonly TSID: string; + } + + /** FaxIncomingJobs Class */ + class FaxIncomingJobs { + private 'FAXCOMEXLib.FaxIncomingJobs_typekey': FaxIncomingJobs; + private constructor(); + readonly Count: number; + Item(vIndex: any): FaxIncomingJob; + } + + /** FaxIncomingMessage Class */ + class FaxIncomingMessage extends IFaxIncomingMessage { + private 'FAXCOMEXLib.FaxIncomingMessage_typekey': FaxIncomingMessage; + private constructor(); + + /** Has Cover page */ + HasCoverPage: boolean; + + /** Read flag on the message */ + Read: boolean; + + /** Reassigns the message */ + ReAssign(): void; + + /** Set of recipient names */ + Recipients: string; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + + /** Sender's fax number */ + SenderFaxNumber: string; + + /** Sender's name */ + SenderName: string; + + /** Contents of cover page subject field */ + Subject: string; + + /** Is message reassigned? */ + readonly WasReAssigned: boolean; + } + + /** FaxIncomingMessageIterator Class */ + class FaxIncomingMessageIterator { + private 'FAXCOMEXLib.FaxIncomingMessageIterator_typekey': FaxIncomingMessageIterator; + private constructor(); + + /** End of archive marker */ + readonly AtEOF: boolean; + + /** The current message */ + readonly Message: IFaxIncomingMessage; + + /** Move to the first message in the archive */ + MoveFirst(): void; + + /** Move to the next message in the archive */ + MoveNext(): void; + + /** Size of the prefetch buffer */ + PrefetchSize: number; + } + + /** FaxIncomingQueue Class */ + class FaxIncomingQueue { + private 'FAXCOMEXLib.FaxIncomingQueue_typekey': FaxIncomingQueue; + private constructor(); + + /** Is queue blocked */ + Blocked: boolean; + + /** Get incoming job by ID */ + GetJob(bstrJobId: string): FaxIncomingJob; + + /** Collection of incoming jobs */ + GetJobs(): FaxIncomingJobs; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + } + + /** FaxJobStatus Class */ + class FaxJobStatus { + private 'FAXCOMEXLib.FaxJobStatus_typekey': FaxJobStatus; + private constructor(); + + /** Available operations, a bit-wise combination of FAX_JOB_OPERATIONS values */ + readonly AvailableOperations: FAX_JOB_OPERATIONS_ENUM; + + /** Caller ID */ + readonly CallerId: string; + + /** Called Station ID */ + readonly CSID: string; + + /** Page currently in transmision */ + readonly CurrentPage: number; + + /** Device ID of device that transmits the job */ + readonly DeviceId: number; + + /** Extended status description */ + readonly ExtendedStatus: string; + + /** Code of the job's extended status */ + readonly ExtendedStatusCode: FAX_JOB_EXTENDED_STATUS_ENUM; + + /** Job type */ + readonly JobType: FAX_JOB_TYPE_ENUM; + + /** Total number of pages */ + readonly Pages: number; + + /** Number of failed transmission retries */ + readonly Retries: number; + + /** Routing information */ + readonly RoutingInformation: string; + + /** The time the fax job is scheduled to be transmitted */ + readonly ScheduledTime: VarDate; + + /** Size in bytes of TIFF file */ + readonly Size: number; + + /** Current queue status of the job, a bit-wise combination of FAX_JOB_STATUS values */ + readonly Status: FAX_JOB_STATUS_ENUM; + + /** The time the fax job finished its transmission */ + readonly TransmissionEnd: VarDate; + + /** The time the fax job started its transmission */ + readonly TransmissionStart: VarDate; + + /** Transmitting Station ID */ + readonly TSID: string; + } + + /** FaxLoggingOptions Class */ + class FaxLoggingOptions { + private 'FAXCOMEXLib.FaxLoggingOptions_typekey': FaxLoggingOptions; + private constructor(); + + /** Activity logging configuration object */ + readonly ActivityLogging: FaxActivityLogging; + + /** Event logging configuration object */ + readonly EventLogging: FaxEventLogging; + } + + /** FaxOutboundRouting Class */ + class FaxOutboundRouting { + private 'FAXCOMEXLib.FaxOutboundRouting_typekey': FaxOutboundRouting; + private constructor(); + + /** Configuration of the outbound routing groups */ + GetGroups(): FaxOutboundRoutingGroups; + + /** Configuration of the outbound routing rules */ + GetRules(): FaxOutboundRoutingRules; + } + + /** FaxOutboundRoutingGroup Class */ + class FaxOutboundRoutingGroup { + private 'FAXCOMEXLib.FaxOutboundRoutingGroup_typekey': FaxOutboundRoutingGroup; + private constructor(); + + /** Ordered collection of device IDs */ + readonly DeviceIds: FaxDeviceIds; + + /** Name of the group */ + readonly Name: string; + + /** Status of the group */ + readonly Status: FAX_GROUP_STATUS_ENUM; + } + + /** FaxOutboundRoutingGroups Class */ + class FaxOutboundRoutingGroups { + private 'FAXCOMEXLib.FaxOutboundRoutingGroups_typekey': FaxOutboundRoutingGroups; + private constructor(); + + /** Add a group */ + Add(bstrName: string): FaxOutboundRoutingGroup; + readonly Count: number; + Item(vIndex: number | string): FaxOutboundRoutingGroup; + + /** Remove a group */ + Remove(vIndex: number | string): void; + } + + /** FaxOutboundRoutingRule Class */ + class FaxOutboundRoutingRule { + private 'FAXCOMEXLib.FaxOutboundRoutingRule_typekey': FaxOutboundRoutingRule; + private constructor(); + + /** Area code */ + readonly AreaCode: number; + + /** Country code */ + readonly CountryCode: number; + + /** Destination device */ + DeviceId: number; + + /** Group name */ + GroupName: string; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + + /** Status */ + readonly Status: FAX_RULE_STATUS_ENUM; + + /** Uses single device or group */ + UseDevice: boolean; + } + + /** FaxOutboundRoutingRules Class */ + class FaxOutboundRoutingRules { + private 'FAXCOMEXLib.FaxOutboundRoutingRules_typekey': FaxOutboundRoutingRules; + private constructor(); + + /** Add a rule */ + Add(lCountryCode: number, lAreaCode: number, bUseDevice: boolean, bstrGroupName: string, lDeviceId: number): FaxOutboundRoutingRule; + readonly Count: number; + Item(lIndex: number): FaxOutboundRoutingRule; + + /** Get a rule by criteria */ + ItemByCountryAndArea(lCountryCode: number, lAreaCode: number): FaxOutboundRoutingRule; + + /** Remove a rule */ + Remove(lIndex: number): void; + + /** Remove a rule by criteria */ + RemoveByCountryAndArea(lCountryCode: number, lAreaCode: number): void; + } + + /** FaxOutgoingArchive Class */ + class FaxOutgoingArchive { + private 'FAXCOMEXLib.FaxOutgoingArchive_typekey': FaxOutgoingArchive; + private constructor(); + + /** Indicates how long the fax message is kept on the server */ + AgeLimit: number; + + /** Location of the outgoing archive on the server */ + ArchiveFolder: string; + + /** Get an archived message by its ID */ + GetMessage(bstrMessageId: string): IFaxOutgoingMessage; + + /** + * Iterator on the archived messages + * @param number [lPrefetchSize=100] + */ + GetMessages(lPrefetchSize?: number): FaxOutgoingMessageIterator; + + /** High quota water mark */ + HighQuotaWaterMark: number; + + /** Low quota water mark */ + LowQuotaWaterMark: number; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + + /** The high 32-bit value of the archive size */ + readonly SizeHigh: number; + + /** The low 32-bit value of the archive size */ + readonly SizeLow: number; + + /** Is the size quota warning on or off */ + SizeQuotaWarning: boolean; + + /** Whether sent faxes should be archived */ + UseArchive: boolean; + } + + /** FaxOutgoingJob Class */ + class FaxOutgoingJob { + private 'FAXCOMEXLib.FaxOutgoingJob_typekey': FaxOutgoingJob; + private constructor(); + + /** Available operations, a bit-wise combination of FAX_JOB_OPERATIONS values */ + readonly AvailableOperations: FAX_JOB_OPERATIONS_ENUM; + + /** Cancel the outbound job */ + Cancel(): void; + + /** Copy the job's TIFF image */ + CopyTiff(bstrTiffPath: string): void; + + /** Called Station ID */ + readonly CSID: string; + + /** Page currently in transmision */ + readonly CurrentPage: number; + + /** Device ID that transmits the job */ + readonly DeviceId: number; + + /** Document's friendly name */ + readonly DocumentName: string; + + /** Extended status description */ + readonly ExtendedStatus: string; + + /** Code of the job's extended status */ + readonly ExtendedStatusCode: FAX_JOB_EXTENDED_STATUS_ENUM; + + /** Whether to group broadcast receipts */ + readonly GroupBroadcastReceipts: boolean; + + /** Has Cover page */ + readonly HasCoverPage: boolean; + + /** Unique job ID */ + readonly Id: string; + + /** Time the job was originally scheduled to be transmitted */ + readonly OriginalScheduledTime: VarDate; + + /** Total number of pages */ + readonly Pages: number; + + /** Pause the outbound job */ + Pause(): void; + + /** Priority of the fax */ + readonly Priority: FAX_PRIORITY_TYPE_ENUM; + + /** Address of the receipt */ + readonly ReceiptAddress: string; + + /** Type of receipt */ + readonly ReceiptType: FAX_RECEIPT_TYPE_ENUM; + + /** Recipient information object */ + readonly Recipient: FaxRecipient; + + /** Refresh the object */ + Refresh(): void; + + /** Restart the outbound job */ + Restart(): void; + + /** Resume the outbound job */ + Resume(): void; + + /** Number of failed transmission retries */ + readonly Retries: number; + + /** The time the fax job is scheduled to be transmitted */ + readonly ScheduledTime: VarDate; + + /** When to send the fax */ + readonly ScheduleType: FAX_SCHEDULE_TYPE_ENUM; + + /** Sender information object */ + readonly Sender: FaxSender; + + /** Size in bytes of TIFF file */ + readonly Size: number; + + /** Current queue status of the job */ + readonly Status: FAX_JOB_STATUS_ENUM; + + /** Cover page's subject field */ + readonly Subject: string; + + /** Unique ID the submission process created for the Job */ + readonly SubmissionId: string; + + /** Time the job was submitted */ + readonly SubmissionTime: VarDate; + + /** The time the fax job finished its transmission */ + readonly TransmissionEnd: VarDate; + + /** The time the fax job started its transmission */ + readonly TransmissionStart: VarDate; + + /** Transmitting Station ID */ + readonly TSID: string; + } + + /** FaxOutgoingJobs Class */ + class FaxOutgoingJobs { + private 'FAXCOMEXLib.FaxOutgoingJobs_typekey': FaxOutgoingJobs; + private constructor(); + readonly Count: number; + Item(vIndex: any): IFaxOutgoingJob; + } + + /** FaxOutgoingMessage Class */ + class FaxOutgoingMessage extends IFaxOutgoingMessage { + private 'FAXCOMEXLib.FaxOutgoingMessage_typekey': FaxOutgoingMessage; + private constructor(); + + /** Copy Tiff image to the local file */ + CopyTiff(bstrTiffPath: string): void; + + /** Has Cover page */ + readonly HasCoverPage: boolean; + + /** Read flag on the message */ + Read: boolean; + + /** Address of the receipt */ + readonly ReceiptAddress: string; + + /** Type of the receipt */ + readonly ReceiptType: FAX_RECEIPT_TYPE_ENUM; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + } + + /** FaxOutgoingMessageIterator Class */ + class FaxOutgoingMessageIterator { + private 'FAXCOMEXLib.FaxOutgoingMessageIterator_typekey': FaxOutgoingMessageIterator; + private constructor(); + + /** End of archive marker */ + readonly AtEOF: boolean; + + /** Current message */ + readonly Message: IFaxOutgoingMessage; + + /** Move to the first message */ + MoveFirst(): void; + + /** Move to the next message */ + MoveNext(): void; + + /** Size of prefetch buffer */ + PrefetchSize: number; + } + + /** FaxOutgoingQueue Class */ + class FaxOutgoingQueue { + private 'FAXCOMEXLib.FaxOutgoingQueue_typekey': FaxOutgoingQueue; + private constructor(); + + /** How long the failed fax message is kept on the server */ + AgeLimit: number; + + /** Are personal cover pages allowed */ + AllowPersonalCoverPages: boolean; + + /** Is the queue blocked */ + Blocked: boolean; + + /** Does the server generate a brand */ + Branding: boolean; + + /** End of the discount rate period */ + DiscountRateEnd: VarDate; + + /** Start of the discount rate period */ + DiscountRateStart: VarDate; + + /** Outgoing job by ID */ + GetJob(bstrJobId: string): IFaxOutgoingJob; + + /** Collection of outgoing jobs */ + GetJobs(): FaxOutgoingJobs; + + /** Is the queue paused */ + Paused: boolean; + + /** Refresh the object */ + Refresh(): void; + + /** Number of retries */ + Retries: number; + + /** Retry delay */ + RetryDelay: number; + + /** Save the object */ + Save(): void; + + /** Is device Transmitting Station ID used */ + UseDeviceTSID: boolean; + } + + /** FaxReceiptOptions Class */ + class FaxReceiptOptions { + private 'FAXCOMEXLib.FaxReceiptOptions_typekey': FaxReceiptOptions; + private constructor(); + + /** Allowed receipt types, a bit-wise combination of FAX_RECEIPT_TYPE values */ + AllowedReceipts: FAX_RECEIPT_TYPE_ENUM; + + /** Authentication type used by server */ + AuthenticationType: FAX_SMTP_AUTHENTICATION_TYPE_ENUM; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + + /** SMTP password */ + SMTPPassword: string; + + /** SMTP port number */ + SMTPPort: number; + + /** SMTP sender e-mail address */ + SMTPSender: string; + + /** Name of the SMTP server */ + SMTPServer: string; + + /** SMTP user name */ + SMTPUser: string; + + /** Whether to use the IFaxReceiptOptions settings for MS routing extension */ + UseForInboundRouting: boolean; + } + + /** FaxRecipient Class */ + class FaxRecipient { + private 'FAXCOMEXLib.FaxRecipient_typekey': FaxRecipient; + private constructor(); + + /** Recipient's fax number */ + FaxNumber: string; + + /** Recipient's name */ + Name: string; + } + + /** FaxRecipients Class */ + class FaxRecipients { + private 'FAXCOMEXLib.FaxRecipients_typekey': FaxRecipients; + private constructor(); + + /** + * Add a recipient + * @param string [bstrRecipientName=''] + */ + Add(bstrFaxNumber: string, bstrRecipientName?: string): FaxRecipient; + readonly Count: number; + Item(lIndex: number): FaxRecipient; + + /** Remove a recipient */ + Remove(lIndex: number): void; + } + + /** FaxSecurity Class */ + class FaxSecurity { + private 'FAXCOMEXLib.FaxSecurity_typekey': FaxSecurity; + private constructor(); + + /** Security descriptor */ + Descriptor: any; + + /** Granted rights, a bit-wise combination of FAX_ACCESS_RIGHTS values */ + readonly GrantedRights: FAX_ACCESS_RIGHTS_ENUM; + + /** Security Information Type */ + InformationType: number; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + } + + /** FaxSecurity2 Class */ + class FaxSecurity2 { + private 'FAXCOMEXLib.FaxSecurity2_typekey': FaxSecurity2; + private constructor(); + + /** Security descriptor */ + Descriptor: any; + + /** Granted rights, a bit-wise combination */ + readonly GrantedRights: FAX_ACCESS_RIGHTS_ENUM_2; + + /** Security Information Type */ + InformationType: number; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + } + + /** FaxSender Class */ + class FaxSender { + private 'FAXCOMEXLib.FaxSender_typekey': FaxSender; + private constructor(); + + /** Sender's billing code */ + BillingCode: string; + + /** City */ + City: string; + + /** Sender's company */ + Company: string; + + /** Sender's country or region */ + Country: string; + + /** Sender's department */ + Department: string; + + /** Sender's e-mail address */ + Email: string; + + /** Sender's fax number */ + FaxNumber: string; + + /** Sender's home phone */ + HomePhone: string; + + /** Load default sender */ + LoadDefaultSender(): void; + + /** Sender's name */ + Name: string; + + /** Sender's office location */ + OfficeLocation: string; + + /** Sender's office phone */ + OfficePhone: string; + + /** Save default sender */ + SaveDefaultSender(): void; + + /** Sender's state */ + State: string; + + /** Sender's street address */ + StreetAddress: string; + + /** Sender's title */ + Title: string; + + /** Transmitting Station ID */ + TSID: string; + + /** Sender's zip code */ + ZipCode: string; + } + + /** FaxServer Class */ + class FaxServer extends IFaxServer { + private 'FAXCOMEXLib.FaxServer_typekey': FaxServer; + private constructor(); + + /** Fax server configuration */ + readonly Configuration: FaxConfiguration; + + /** FaxAccount for the current connection */ + readonly CurrentAccount: FaxAccount; + + /** The FaxAccountSet configuration object */ + readonly FaxAccountSet: FaxAccountSet; + + /** The security configuration object */ + readonly Security2: FaxSecurity2; + } + + /** IFaxIncomingMessage interface */ + class IFaxIncomingMessage { + /** Caller ID */ + readonly CallerId: string; + + /** Copy Tiff image to the local file */ + CopyTiff(bstrTiffPath: string): void; + + /** Called Station ID */ + readonly CSID: string; + + /** Delete the message from the archive */ + Delete(): void; + + /** Name of the device that received the message */ + readonly DeviceName: string; + + /** Unique message ID */ + readonly Id: string; + + /** Total number of pages */ + readonly Pages: number; + + /** Number of failed routing retries */ + readonly Retries: number; + + /** Routing information */ + readonly RoutingInformation: string; + + /** Size in bytes of the message's TIFF file */ + readonly Size: number; + + /** Transmission end time */ + readonly TransmissionEnd: VarDate; + + /** Transmission start time */ + readonly TransmissionStart: VarDate; + + /** Transmitting Station ID */ + readonly TSID: string; + } + + /** IFaxOutgoingJob interface */ + class IFaxOutgoingJob { + private 'FAXCOMEXLib.IFaxOutgoingJob_typekey': IFaxOutgoingJob; + private constructor(); + + /** Available operations, a bit-wise combination of FAX_JOB_OPERATIONS values */ + readonly AvailableOperations: FAX_JOB_OPERATIONS_ENUM; + + /** Cancel the outbound job */ + Cancel(): void; + + /** Copy the job's TIFF image */ + CopyTiff(bstrTiffPath: string): void; + + /** Called Station ID */ + readonly CSID: string; + + /** Page currently in transmision */ + readonly CurrentPage: number; + + /** Device ID that transmits the job */ + readonly DeviceId: number; + + /** Document's friendly name */ + readonly DocumentName: string; + + /** Extended status description */ + readonly ExtendedStatus: string; + + /** Code of the job's extended status */ + readonly ExtendedStatusCode: FAX_JOB_EXTENDED_STATUS_ENUM; + + /** Whether to group broadcast receipts */ + readonly GroupBroadcastReceipts: boolean; + + /** Unique job ID */ + readonly Id: string; + + /** Time the job was originally scheduled to be transmitted */ + readonly OriginalScheduledTime: VarDate; + + /** Total number of pages */ + readonly Pages: number; + + /** Pause the outbound job */ + Pause(): void; + + /** Priority of the fax */ + readonly Priority: FAX_PRIORITY_TYPE_ENUM; + + /** Type of receipt */ + readonly ReceiptType: FAX_RECEIPT_TYPE_ENUM; + + /** Recipient information object */ + readonly Recipient: FaxRecipient; + + /** Refresh the object */ + Refresh(): void; + + /** Restart the outbound job */ + Restart(): void; + + /** Resume the outbound job */ + Resume(): void; + + /** Number of failed transmission retries */ + readonly Retries: number; + + /** The time the fax job is scheduled to be transmitted */ + readonly ScheduledTime: VarDate; + + /** Sender information object */ + readonly Sender: FaxSender; + + /** Size in bytes of TIFF file */ + readonly Size: number; + + /** Current queue status of the job */ + readonly Status: FAX_JOB_STATUS_ENUM; + + /** Cover page's subject field */ + readonly Subject: string; + + /** Unique ID the submission process created for the Job */ + readonly SubmissionId: string; + + /** Time the job was submitted */ + readonly SubmissionTime: VarDate; + + /** The time the fax job finished its transmission */ + readonly TransmissionEnd: VarDate; + + /** The time the fax job started its transmission */ + readonly TransmissionStart: VarDate; + + /** Transmitting Station ID */ + readonly TSID: string; + } + + /** IFaxOutgoingMessage interface */ + class IFaxOutgoingMessage { + /** Copy Tiff image to the local file */ + CopyTiff(bstrTiffPath: string): void; + + /** Called Station ID */ + readonly CSID: string; + + /** Delete the message from the archive */ + Delete(): void; + + /** Name of the device transmitting the message */ + readonly DeviceName: string; + + /** Document's friendly name */ + readonly DocumentName: string; + + /** Unique message ID */ + readonly Id: string; + + /** Time the job was originally scheduled to be transmitted */ + readonly OriginalScheduledTime: VarDate; + + /** Total number of pages */ + readonly Pages: number; + + /** Priority of the fax */ + readonly Priority: FAX_PRIORITY_TYPE_ENUM; + + /** Recipient information object */ + readonly Recipient: FaxRecipient; + + /** Number of failed routing retries */ + readonly Retries: number; + + /** Sender information object */ + readonly Sender: FaxSender; + + /** Size in bytes of TIFF file */ + readonly Size: number; + + /** Cover page's subject field */ + readonly Subject: string; + + /** Unique ID the submission process created for the job */ + readonly SubmissionId: string; + + /** Time the job was submitted */ + readonly SubmissionTime: VarDate; + + /** Transmission end time */ + readonly TransmissionEnd: VarDate; + + /** Transmission start time */ + readonly TransmissionStart: VarDate; + + /** Transmitting Station ID */ + readonly TSID: string; + } + + /** IFaxServer interface */ + class IFaxServer { + /** The fax server activity status object */ + readonly Activity: FaxActivity; + + /** Version of the fax server API */ + readonly APIVersion: FAX_SERVER_APIVERSION_ENUM; + + /** Connect to the fax server */ + Connect(bstrServerName: string): void; + + /** Is fax server built in debug environment */ + readonly Debug: boolean; + + /** Disconnect from the fax server */ + Disconnect(): void; + + /** The fax folders object */ + readonly Folders: FaxFolders; + + /** The collection of device providers */ + GetDeviceProviders(): FaxDeviceProviders; + + /** The collection of all available devices */ + GetDevices(): FaxDevices; + + /** Return server level extention property */ + GetExtensionProperty(bstrGUID: string): any; + + /** The inbound routing configuration object */ + readonly InboundRouting: FaxInboundRouting; + + /** Set bit-wise combination of events the fax server listens to */ + ListenToServerEvents(EventTypes: FAX_SERVER_EVENTS_TYPE_ENUM): void; + + /** The logging options configuration object */ + readonly LoggingOptions: FaxLoggingOptions; + + /** The major part of the fax server's build number */ + readonly MajorBuild: number; + + /** The major part of the fax server's version number */ + readonly MajorVersion: number; + + /** The minor part of the fax server's build number */ + readonly MinorBuild: number; + + /** The minor part of the fax server's version number */ + readonly MinorVersion: number; + + /** The outbound routing configuration object */ + readonly OutboundRouting: FaxOutboundRouting; + + /** The receipt options configuration object */ + readonly ReceiptOptions: FaxReceiptOptions; + + /** Register device provider */ + RegisterDeviceProvider(bstrGUID: string, bstrFriendlyName: string, bstrImageName: string, TspName: string, lFSPIVersion: number): void; + + /** Events the fax Server is listening to */ + readonly RegisteredEvents: FAX_SERVER_EVENTS_TYPE_ENUM; + + /** Register inbound routing extension */ + RegisterInboundRoutingExtension(bstrExtensionName: string, bstrFriendlyName: string, bstrImageName: string, vMethods: any): void; + + /** The security configuration object */ + readonly Security: FaxSecurity; + + /** The name of the fax server */ + readonly ServerName: string; + + /** Set server level extention property */ + SetExtensionProperty(bstrGUID: string, vProperty: SafeArray): void; + + /** Unregister device provider */ + UnregisterDeviceProvider(bstrUniqueName: string): void; + + /** Unregister inbound routing extension */ + UnregisterInboundRoutingExtension(bstrExtensionUniqueName: string): void; + } + + namespace EventHelperTypes { + type FaxAccount_Invoke_ArgNames = ['dispidMember', 'riid', 'lcid', 'wFlags', 'pdispparams', 'pvarResult', 'pexcepinfo', 'puArgErr']; + + type FaxServer_Invoke_ArgNames = ['dispidMember', 'riid', 'lcid', 'wFlags', 'pdispparams', 'pvarResult', 'pexcepinfo', 'puArgErr']; + + type FaxServer_OnDeviceStatusChange_ArgNames = ['pFaxServer', 'lDeviceId', 'bPoweredOff', 'bSending', 'bReceiving', 'bRinging']; + + interface FaxAccount_Invoke_Parameter { + readonly dispidMember: number; + readonly lcid: number; + readonly pdispparams: stdole.DISPPARAMS; + pexcepinfo: stdole.EXCEPINFO; + puArgErr: number; + pvarResult: any; + readonly riid: stdole.GUID; + readonly wFlags: number; + } + + interface FaxServer_Invoke_Parameter { + readonly dispidMember: number; + readonly lcid: number; + readonly pdispparams: stdole.DISPPARAMS; + pexcepinfo: stdole.EXCEPINFO; + puArgErr: number; + pvarResult: any; + readonly riid: stdole.GUID; + readonly wFlags: number; + } + + interface FaxServer_OnDeviceStatusChange_Parameter { + readonly bPoweredOff: boolean; + readonly bReceiving: boolean; + readonly bRinging: boolean; + readonly bSending: boolean; + readonly lDeviceId: number; + readonly pFaxServer: FaxServer; + } + } +} + +interface ActiveXObject { + on( + obj: FAXCOMEXLib.FaxAccount, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( + this: FAXCOMEXLib.FaxAccount, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; + on( + obj: FAXCOMEXLib.FaxAccount, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( + this: FAXCOMEXLib.FaxAccount, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; + on(obj: FAXCOMEXLib.FaxAccount, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: FAXCOMEXLib.FaxAccount, parameter: {pctinfo: number}) => void): void; + on( + obj: FAXCOMEXLib.FaxAccount, event: 'Invoke', argNames: FAXCOMEXLib.EventHelperTypes.FaxAccount_Invoke_ArgNames, handler: ( + this: FAXCOMEXLib.FaxAccount, parameter: FAXCOMEXLib.EventHelperTypes.FaxAccount_Invoke_Parameter) => void): void; + on( + obj: FAXCOMEXLib.FaxAccount, event: 'OnIncomingJobAdded' | 'OnIncomingJobRemoved' | 'OnOutgoingJobAdded' | 'OnOutgoingJobRemoved', + argNames: ['pFaxAccount', 'bstrJobId'], handler: (this: FAXCOMEXLib.FaxAccount, parameter: {readonly pFaxAccount: FAXCOMEXLib.FaxAccount, readonly bstrJobId: string}) => void): void; + on( + obj: FAXCOMEXLib.FaxAccount, event: 'OnIncomingJobChanged' | 'OnOutgoingJobChanged', argNames: ['pFaxAccount', 'bstrJobId', 'pJobStatus'], + handler: (this: FAXCOMEXLib.FaxAccount, parameter: {readonly pFaxAccount: FAXCOMEXLib.FaxAccount, readonly bstrJobId: string, readonly pJobStatus: FAXCOMEXLib.FaxJobStatus}) => void): void; + on( + obj: FAXCOMEXLib.FaxAccount, event: 'OnIncomingMessageAdded', argNames: ['pFaxAccount', 'bstrMessageId', 'fAddedToReceiveFolder'], + handler: (this: FAXCOMEXLib.FaxAccount, parameter: {readonly pFaxAccount: FAXCOMEXLib.FaxAccount, readonly bstrMessageId: string, readonly fAddedToReceiveFolder: boolean}) => void): void; + on( + obj: FAXCOMEXLib.FaxAccount, event: 'OnIncomingMessageRemoved', argNames: ['pFaxAccount', 'bstrMessageId', 'fRemovedFromReceiveFolder'], + handler: (this: FAXCOMEXLib.FaxAccount, parameter: {readonly pFaxAccount: FAXCOMEXLib.FaxAccount, readonly bstrMessageId: string, readonly fRemovedFromReceiveFolder: boolean}) => void): void; + on( + obj: FAXCOMEXLib.FaxAccount, event: 'OnOutgoingMessageAdded' | 'OnOutgoingMessageRemoved', argNames: ['pFaxAccount', 'bstrMessageId'], + handler: (this: FAXCOMEXLib.FaxAccount, parameter: {readonly pFaxAccount: FAXCOMEXLib.FaxAccount, readonly bstrMessageId: string}) => void): void; + on( + obj: FAXCOMEXLib.FaxAccount, event: 'OnServerShutDown', argNames: ['pFaxServer'], handler: ( + this: FAXCOMEXLib.FaxAccount, parameter: {readonly pFaxServer: FAXCOMEXLib.FaxServer}) => void): void; + on( + obj: FAXCOMEXLib.FaxAccount, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: ( + this: FAXCOMEXLib.FaxAccount, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( + this: FAXCOMEXLib.FaxServer, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( + this: FAXCOMEXLib.FaxServer, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; + on(obj: FAXCOMEXLib.FaxServer, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: FAXCOMEXLib.FaxServer, parameter: {pctinfo: number}) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'Invoke', argNames: FAXCOMEXLib.EventHelperTypes.FaxServer_Invoke_ArgNames, handler: ( + this: FAXCOMEXLib.FaxServer, parameter: FAXCOMEXLib.EventHelperTypes.FaxServer_Invoke_Parameter) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'OnActivityLoggingConfigChange' | 'OnDevicesConfigChange' | 'OnEventLoggingConfigChange' | 'OnGeneralServerConfigChanged' | + 'OnIncomingArchiveConfigChange' | 'OnOutboundRoutingGroupsConfigChange' | 'OnOutboundRoutingRulesConfigChange' | 'OnOutgoingArchiveConfigChange' | + 'OnOutgoingQueueConfigChange' | 'OnReceiptOptionsChange' | 'OnSecurityConfigChange' | 'OnServerShutDown', + argNames: ['pFaxServer'], + handler: (this: FAXCOMEXLib.FaxServer, parameter: {readonly pFaxServer: FAXCOMEXLib.FaxServer}) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'OnDeviceStatusChange', argNames: FAXCOMEXLib.EventHelperTypes.FaxServer_OnDeviceStatusChange_ArgNames, + handler: (this: FAXCOMEXLib.FaxServer, parameter: FAXCOMEXLib.EventHelperTypes.FaxServer_OnDeviceStatusChange_Parameter) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'OnIncomingJobAdded' | 'OnIncomingJobRemoved' | 'OnOutgoingJobAdded' | 'OnOutgoingJobRemoved', + argNames: ['pFaxServer', 'bstrJobId'], handler: (this: FAXCOMEXLib.FaxServer, parameter: {readonly pFaxServer: FAXCOMEXLib.FaxServer, readonly bstrJobId: string}) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'OnIncomingJobChanged' | 'OnOutgoingJobChanged', argNames: ['pFaxServer', 'bstrJobId', 'pJobStatus'], + handler: (this: FAXCOMEXLib.FaxServer, parameter: {readonly pFaxServer: FAXCOMEXLib.FaxServer, readonly bstrJobId: string, readonly pJobStatus: FAXCOMEXLib.FaxJobStatus}) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'OnIncomingMessageAdded' | 'OnIncomingMessageRemoved' | 'OnOutgoingMessageAdded' | 'OnOutgoingMessageRemoved', + argNames: ['pFaxServer', 'bstrMessageId'], handler: (this: FAXCOMEXLib.FaxServer, parameter: {readonly pFaxServer: FAXCOMEXLib.FaxServer, readonly bstrMessageId: string}) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'OnNewCall', argNames: ['pFaxServer', 'lCallId', 'lDeviceId', 'bstrCallerId'], handler: ( + this: FAXCOMEXLib.FaxServer, parameter: {readonly pFaxServer: FAXCOMEXLib.FaxServer, readonly lCallId: number, readonly lDeviceId: number, readonly bstrCallerId: string}) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'OnQueuesStatusChange', argNames: ['pFaxServer', 'bOutgoingQueueBlocked', 'bOutgoingQueuePaused', 'bIncomingQueueBlocked'], + handler: ( + this: FAXCOMEXLib.FaxServer, + parameter: { + readonly pFaxServer: FAXCOMEXLib.FaxServer, readonly bOutgoingQueueBlocked: boolean, readonly bOutgoingQueuePaused: boolean, readonly bIncomingQueueBlocked: boolean}) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'OnServerActivityChange', + argNames: ['pFaxServer', 'lIncomingMessages', 'lRoutingMessages', 'lOutgoingMessages', 'lQueuedMessages'], handler: ( + this: FAXCOMEXLib.FaxServer, + parameter: { + readonly pFaxServer: FAXCOMEXLib.FaxServer, readonly lIncomingMessages: number, readonly lRoutingMessages: number, readonly lOutgoingMessages: number, readonly lQueuedMessages: number + }) => void + ): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: ( + this: FAXCOMEXLib.FaxServer, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; + on(obj: FAXCOMEXLib.FaxAccount, event: 'AddRef' | 'Release', handler: (this: FAXCOMEXLib.FaxAccount, parameter: {}) => void): void; + on(obj: FAXCOMEXLib.FaxServer, event: 'AddRef' | 'Release', handler: (this: FAXCOMEXLib.FaxServer, parameter: {}) => void): void; + new(progid: K): ActiveXObjectNameMap[K]; +} + +interface ActiveXObjectNameMap { + 'FaxComEx.FaxDocument': FAXCOMEXLib.FaxDocument; + 'FaxComEx.FaxServer': FAXCOMEXLib.FaxServer; +} + +interface EnumeratorConstructor { + new(col: FAXCOMEXLib.FaxAccounts): Enumerator; + new(col: FAXCOMEXLib.FaxDeviceIds): Enumerator; + new(col: FAXCOMEXLib.FaxDeviceProviders): Enumerator; + new(col: FAXCOMEXLib.FaxDevices): Enumerator; + new(col: FAXCOMEXLib.FaxInboundRoutingExtensions): Enumerator; + new(col: FAXCOMEXLib.FaxInboundRoutingMethods): Enumerator; + new(col: FAXCOMEXLib.FaxIncomingJobs): Enumerator; + new(col: FAXCOMEXLib.FaxOutboundRoutingGroups): Enumerator; + new(col: FAXCOMEXLib.FaxOutboundRoutingRules): Enumerator; + new(col: FAXCOMEXLib.FaxOutgoingJobs): Enumerator; + new(col: FAXCOMEXLib.FaxRecipients): Enumerator; +} + +interface SafeArray { + _brand: SafeArray; +} diff --git a/types/activex-faxcomexlib/package.json b/types/activex-faxcomexlib/package.json new file mode 100644 index 0000000000..d9b1031263 --- /dev/null +++ b/types/activex-faxcomexlib/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "activex-helpers": "*" + } +} \ No newline at end of file diff --git a/types/activex-faxcomexlib/tsconfig.json b/types/activex-faxcomexlib/tsconfig.json new file mode 100644 index 0000000000..673e3f49ea --- /dev/null +++ b/types/activex-faxcomexlib/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5", + "scripthost" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "activex-faxcomexlib-tests.ts" + ] +} \ No newline at end of file diff --git a/types/activex-faxcomexlib/tslint.json b/types/activex-faxcomexlib/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/activex-faxcomexlib/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/activex-infopath/tsconfig.json b/types/activex-infopath/tsconfig.json index 6feef8496c..e6479e5c7c 100644 --- a/types/activex-infopath/tsconfig.json +++ b/types/activex-infopath/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/activex-infopath/tslint.json b/types/activex-infopath/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-infopath/tslint.json +++ b/types/activex-infopath/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-iwshruntimelibrary/activex-iwshruntimelibrary-tests.ts b/types/activex-iwshruntimelibrary/activex-iwshruntimelibrary-tests.ts new file mode 100644 index 0000000000..f39627cc1a --- /dev/null +++ b/types/activex-iwshruntimelibrary/activex-iwshruntimelibrary-tests.ts @@ -0,0 +1,49 @@ +const wshn = new ActiveXObject('WScript.Network'); + +// https://msdn.microsoft.com/en-us/library/s6wt333f(v=vs.84).aspx +// https://msdn.microsoft.com/en-us/library/wck0hkd7(v=vs.84).aspx +// https://msdn.microsoft.com/en-us/library/tte130y1(v=vs.84).aspx +// https://msdn.microsoft.com/en-us/library/3fxhka75(v=vs.84).aspx +(() => { + WScript.Echo('Domain = ' + wshn.UserDomain); + WScript.Echo('Computer Name = ' + wshn.ComputerName); + WScript.Echo('User Name = ' + wshn.UserName); +})(); + +// https://msdn.microsoft.com/en-us/library/zsdh7hkb(v=vs.84).aspx +wshn.AddWindowsPrinterConnection('\\\\printserv\\DefaultPrinter'); + +// https://msdn.microsoft.com/en-us/library/kxsdca3c(v=vs.84).aspx +wshn.AddPrinterConnection("LPT1", "\\\\Server\\Print1"); + +// https://msdn.microsoft.com/en-us/library/t9zt39at(v=vs.84).aspx +// https://msdn.microsoft.com/en-us/library/zhds6k80(v=vs.84).aspx +(() => { + const drives = wshn.EnumNetworkDrives(); + const printers = wshn.EnumPrinterConnections(); + WScript.Echo("Network drive mappings:"); + for (let i = 0; i < drives.length; i += 2) { + WScript.Echo(`Drive ${drives.Item(i)} = ${drives.Item(i + 1)}`); + } + WScript.Echo(''); + WScript.Echo("Network printer mappings:"); + for (let i = 0; i < printers.length; i += 2) { + WScript.Echo(`Port ${printers.Item(i)} = ${printers.Item(i + 1)}`); + } +})(); + +// https://msdn.microsoft.com/en-us/library/8kst88h6(v=vs.84).aspx +wshn.MapNetworkDrive('E:', '\\\\Server\\Public'); + +// https://msdn.microsoft.com/en-us/library/d16d7wbf(v=vs.84).aspx +wshn.RemoveNetworkDrive('E:'); + +// https://msdn.microsoft.com/en-us/library/tsbh2yy7(v=vs.84).aspx +wshn.RemovePrinterConnection('\\\\PRN-CORP1\\B41-4523-A', true, true); + +// https://msdn.microsoft.com/en-us/library/2ccwwdct(v=vs.84).aspx +(() => { + const printerPath = "\\\\research\\library1"; + wshn.AddWindowsPrinterConnection(printerPath); + wshn.SetDefaultPrinter(printerPath); +})(); diff --git a/types/activex-iwshruntimelibrary/index.d.ts b/types/activex-iwshruntimelibrary/index.d.ts new file mode 100644 index 0000000000..c50c9670a2 --- /dev/null +++ b/types/activex-iwshruntimelibrary/index.d.ts @@ -0,0 +1,247 @@ +// Type definitions for Windows Script Host Object Model - IWshRuntimeLibrary 1.0 +// Project: https://msdn.microsoft.com/en-us/library/9bbdkx3k(v=vs.84).aspx +// Definitions by: Zev Spitz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +declare namespace IWshRuntimeLibrary { + // tslint:disable-next-line no-const-enum + const enum ButtonType { + OK, + OKCancel, + AbortRetryIgnore, + YesNoCancel, + YesNo, + RetryCancel, + CancelTryagainContinue + } + + // tslint:disable-next-line no-const-enum + const enum IconType { + Stop = 16, + QuestionMark = 32, + ExclamationMakr = 48, + InformationMark = 64, + } + + // tslint:disable-next-line no-const-enum + const enum PopupType { + SecondButtonDefault = 256, + ThirdButtonDefault = 512, + Modal = 4096, + RightJustified = 524288, + RTL = 1048576, + } + + // tslint:disable-next-line no-const-enum + const enum PopupSelection { + NoButton = -1, + OK = 1, + Cancel = 2, + Abort = 3, + Retry = 4, + Ignore = 5, + Yes = 6, + No = 7, + TryAgain = 10, + Continue = 11, + } + + // tslint:disable-next-line no-const-enum + const enum WshExecStatus { + WshFailed = 2, + WshFinished = 1, + WshRunning = 0, + } + + // tslint:disable-next-line no-const-enum + const enum WshWindowStyle { + WshHide = 0, + WshMaximizedFocus = 3, + WshMinimizedFocus = 2, + WshMinimizedNoFocus = 6, + WshNormalFocus = 1, + WshNormalNoFocus = 4, + } + + class TextStream { + private 'IWshRuntimeLibrary.TextStream_typekey': TextStream; + private constructor(); + readonly AtEndOfLine: boolean; + readonly AtEndOfStream: boolean; + Close(): void; + readonly Column: number; + readonly Line: number; + Read(Characters: number): string; + ReadAll(): string; + ReadLine(): string; + Skip(Characters: number): void; + SkipLine(): void; + Write(Text: string): void; + WriteBlankLines(Lines: number): void; + + /** @param string [Text=''] */ + WriteLine(Text?: string): void; + } + + /** Generic Collection Object */ + class WshCollection { + private 'IWshRuntimeLibrary.WshCollection_typekey': WshCollection; + private constructor(); + Count(): number; + Item(Index: any): any; + readonly length: number; + } + + /** Environment Variables Collection Object */ + class WshEnvironment { + private 'IWshRuntimeLibrary.WshEnvironment_typekey': WshEnvironment; + private constructor(); + Count(): number; + Item(Name: string): string; + readonly length: number; + Remove(Name: string): void; + } + + /** WSHExec object */ + class WshExec { + private 'IWshRuntimeLibrary.WshExec_typekey': WshExec; + private constructor(); + readonly ExitCode: number; + readonly ProcessID: number; + readonly Status: WshExecStatus; + readonly StdErr: TextStream; + readonly StdIn: TextStream; + readonly StdOut: TextStream; + Terminate(): void; + } + + /** Network Object */ + class WshNetwork { + private 'IWshRuntimeLibrary.WshNetwork_typekey': WshNetwork; + private constructor(); + + /** + * Adds a remote MS-DOS-based printer connection to your computer system. + * @param LocalName Local name to assign to the connected printer. + * @param RemoteName Name of the remote printer. + * @param UpdateProfile [false] Whether the printer mapping is stored in the current user's profile. + * + * If you are mapping a remote printer using the profile of someone other than current user, you can specify _UserName_ and _Password_. + */ + AddPrinterConnection(LocalName: string, RemoteName: string, UpdateProfile?: boolean, UserName?: string, Password?: string): void; + + /** + * @param string Path to printer connection + * @param string [DriverName=''] + * @param string [Port='LPT1'] + * + * Unlike the **AddPrinterConnection** method, this method allows you to create a printer connection without directing it to a specific port, such as LPT1. + */ + AddWindowsPrinterConnection(PrinterName: string, DriverName?: string, Port?: string): void; + readonly ComputerName: string; + EnumNetworkDrives(): WshCollection; + EnumPrinterConnections(): WshCollection; + + /** + * Adds a remote MS-DOS-based printer connection to your computer system. + * @param LocalName Name by which the mapped drive will be known locally + * @param RemoteName Share's UNC name (\\xxx\yyy) + * @param UpdateProfile [false] Whether the printer mapping is stored in the current user's profile. + * + * If you are mapping a network drive using the profile of someone other than current user, you can specify _UserName_ and _Password_. + */ + MapNetworkDrive(LocalName: string, RemoteName: string, UpdateProfile?: boolean, UserName?: string, Password?: string): void; + readonly Organization: string; + + /** + * Removes a shared network drive from your computer system + * @param Name Name of the mapped drive you want to remove. This will be the drive letter if the drive has a mapping between a local name (drive letter) and a remote name (UNC name); + * it will be the UNC path if there is no such mapping + * @param Force [false] Remove the connections even if the resource is in use + * @param UpdateProfile [false] Remove the mapping from the user's profile + */ + RemoveNetworkDrive(Name: string, Force?: any, UpdateProfile?: any): void; + + /** + * Removes a shared network printer connection from your computer system + * @param Name Name that identifies the printer. Can be a UNC name (in the form `\\xxx\yyy`) or a local name (such as `LPT1`) + * @param Force [false] Remove printer connection even if a user is still connected + * @param UpdateProfile [false] Remove the printer connection from the user's profile + * + * The **RemovePrinterConnection** method removes both Windows and MS-DOS based printer connections. If the printer was connected using the method **AddPrinterConnection**, + * _Name_ must be the printer's local name. If the printer was connected using the **AddWindowsPrinterConnection** method or was added manually (using the Add Printer wizard), + * then _Name_ must be the printer's UNC name. + */ + RemovePrinterConnection(Name: string, Force?: any, UpdateProfile?: any): void; + SetDefaultPrinter(Name: string): void; + readonly Site: string; + readonly UserDomain: string; + readonly UserName: string; + readonly UserProfile: string; + } + + /** Shell Object */ + class WshShell { + private 'IWshRuntimeLibrary.WshShell_typekey': WshShell; + private constructor(); + AppActivate(App: any, Wait?: any): boolean; + CreateShortcut(PathLink: string): any; + CurrentDirectory: string; + Environment(Type?: any): WshEnvironment; + Exec(Command: string): WshExec; + ExpandEnvironmentStrings(Src: string): string; + + /** @param string [Target=''] */ + LogEvent(Type: any, Message: string, Target?: string): boolean; + Popup(Text: any, SecondsToWait?: number, Title?: string, Type?: ButtonType | IconType | PopupType): PopupSelection; + RegDelete(Name: string): void; + RegRead(Name: string): any; + RegWrite(Name: string, Value: any, Type?: any): void; + Run(Command: string, WindowStyle?: any, WaitOnReturn?: any): number; + SendKeys(Keys: string, Wait?: any): void; + readonly SpecialFolders: WshCollection; + } + + /** Shortcut Object */ + class WshShortcut { + private 'IWshRuntimeLibrary.WshShortcut_typekey': WshShortcut; + private constructor(); + Arguments: string; + Description: string; + readonly FullName: string; + Hotkey: string; + IconLocation: string; + Load(PathLink: string): void; + readonly RelativePath: string; + Save(): void; + TargetPath: string; + WindowStyle: number; + WorkingDirectory: string; + } + + /** URLShortcut Object */ + class WshURLShortcut { + private 'IWshRuntimeLibrary.WshURLShortcut_typekey': WshURLShortcut; + private constructor(); + readonly FullName: string; + Load(PathLink: string): void; + Save(): void; + TargetPath: string; + } +} + +interface ActiveXObject { + set(obj: IWshRuntimeLibrary.WshEnvironment, propertyName: 'Item', parameterTypes: [string], newValue: string): void; + new (progid: K): ActiveXObjectNameMap[K]; +} + +interface ActiveXObjectNameMap { + 'WScript.Network': IWshRuntimeLibrary.WshNetwork; + 'WScript.Shell': IWshRuntimeLibrary.WshShell; +} + +interface EnumeratorConstructor { + new(col: IWshRuntimeLibrary.WshCollection): Enumerator; + new(col: IWshRuntimeLibrary.WshEnvironment): Enumerator; +} diff --git a/types/activex-iwshruntimelibrary/package.json b/types/activex-iwshruntimelibrary/package.json new file mode 100644 index 0000000000..d9b1031263 --- /dev/null +++ b/types/activex-iwshruntimelibrary/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "activex-helpers": "*" + } +} \ No newline at end of file diff --git a/types/activex-iwshruntimelibrary/tsconfig.json b/types/activex-iwshruntimelibrary/tsconfig.json new file mode 100644 index 0000000000..0c79715db6 --- /dev/null +++ b/types/activex-iwshruntimelibrary/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5", + "scripthost" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "activex-iwshruntimelibrary-tests.ts" + ] +} \ No newline at end of file diff --git a/types/activex-iwshruntimelibrary/tslint.json b/types/activex-iwshruntimelibrary/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/activex-iwshruntimelibrary/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/activex-libreoffice/tsconfig.json b/types/activex-libreoffice/tsconfig.json index 712ea46ca1..c72038c18a 100644 --- a/types/activex-libreoffice/tsconfig.json +++ b/types/activex-libreoffice/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/activex-libreoffice/tslint.json b/types/activex-libreoffice/tslint.json index 8e56cb082c..37a3c27489 100644 --- a/types/activex-libreoffice/tslint.json +++ b/types/activex-libreoffice/tslint.json @@ -1,8 +1,8 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false], "ban-types": false, + "no-const-enum": false, "no-redundant-jsdoc": false, "no-redundant-jsdoc-2": false, "no-unnecessary-qualifier": false diff --git a/types/activex-msforms/tsconfig.json b/types/activex-msforms/tsconfig.json index 38f907552d..ee18e776a1 100644 --- a/types/activex-msforms/tsconfig.json +++ b/types/activex-msforms/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/activex-msforms/tslint.json b/types/activex-msforms/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-msforms/tslint.json +++ b/types/activex-msforms/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-mshtml/tsconfig.json b/types/activex-mshtml/tsconfig.json index deba2b6ba3..9f0594a26d 100644 --- a/types/activex-mshtml/tsconfig.json +++ b/types/activex-mshtml/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/activex-mshtml/tslint.json b/types/activex-mshtml/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-mshtml/tslint.json +++ b/types/activex-mshtml/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-msxml2/tsconfig.json b/types/activex-msxml2/tsconfig.json index 49c53f71ca..5d1cee05aa 100644 --- a/types/activex-msxml2/tsconfig.json +++ b/types/activex-msxml2/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/activex-msxml2/tslint.json b/types/activex-msxml2/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-msxml2/tslint.json +++ b/types/activex-msxml2/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-office/tsconfig.json b/types/activex-office/tsconfig.json index 729657e813..4c8b5ce9e5 100644 --- a/types/activex-office/tsconfig.json +++ b/types/activex-office/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/activex-office/tslint.json b/types/activex-office/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-office/tslint.json +++ b/types/activex-office/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-outlook/tsconfig.json b/types/activex-outlook/tsconfig.json index 1a9fddc714..5d2f6c157b 100644 --- a/types/activex-outlook/tsconfig.json +++ b/types/activex-outlook/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/activex-outlook/tslint.json b/types/activex-outlook/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-outlook/tslint.json +++ b/types/activex-outlook/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-powerpoint/tsconfig.json b/types/activex-powerpoint/tsconfig.json index 8a0392da3f..4ecc0048fb 100644 --- a/types/activex-powerpoint/tsconfig.json +++ b/types/activex-powerpoint/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/activex-powerpoint/tslint.json b/types/activex-powerpoint/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-powerpoint/tslint.json +++ b/types/activex-powerpoint/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-scripting/tsconfig.json b/types/activex-scripting/tsconfig.json index e2008551fd..1d660ed39c 100644 --- a/types/activex-scripting/tsconfig.json +++ b/types/activex-scripting/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/activex-scripting/tslint.json b/types/activex-scripting/tslint.json index 2750cc0197..3224b40b8b 100644 --- a/types/activex-scripting/tslint.json +++ b/types/activex-scripting/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } \ No newline at end of file +{ + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } +} diff --git a/types/activex-shdocvw/activex-shdocvw-tests.ts b/types/activex-shdocvw/activex-shdocvw-tests.ts new file mode 100644 index 0000000000..713578fb06 --- /dev/null +++ b/types/activex-shdocvw/activex-shdocvw-tests.ts @@ -0,0 +1,12 @@ +// https://msdn.microsoft.com/en-us/library/aa752044(v=vs.85).aspx +(() => { + const ie = new ActiveXObject('InternetExplorer.Application'); + ie.Navigate('http://contoso.com'); + ie.Visible = true; +})(); + +let obj1 = new ActiveXObject('ShellNameSpace.ShellNameSpace'); + +let obj2 = new ActiveXObject('Shell.UIHelper'); + +let obj3 = new ActiveXObject('Shell.Explorer'); diff --git a/types/activex-shdocvw/index.d.ts b/types/activex-shdocvw/index.d.ts new file mode 100644 index 0000000000..86568f6c5d --- /dev/null +++ b/types/activex-shdocvw/index.d.ts @@ -0,0 +1,1577 @@ +// Type definitions for Microsoft Internet Controls - SHDocVw 1.1 +// Project: https://msdn.microsoft.com/en-us/library/aa752040(v=vs.85).aspx +// Definitions by: Zev Spitz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +declare namespace SHDocVw { + // tslint:disable-next-line no-const-enum + const enum BrowserBarConstants { + AddressBar = 0x0009, + Tools = 0x000A, + Links = 0x000B, + Search = '{30D02401-6A81-11D0-8274-00C04FD5AE38}', + Favorites = '{EFA24E61-B078-11D0-89E4-00C04FC9E26E}', + History = '{EFA24E62-B078-11D0-89E4-00C04FC9E26E}', + Channels = '{EFA24E63-B078-11D0-89E4-00C04FC9E26E}' + } + + // tslint:disable-next-line no-const-enum + const enum BrowserNavConstants { + /** Open the resource or file in a new window. */ + OpenInNewWindow = 1, + + /** Do not add the resource or file to the history list. The new page replaces the current page in the list. */ + NoHistory = 2, + + /** If the navigation fails, the autosearch functionality attempts to navigate common root domains (.com, .edu, and so on). If this also fails, the URL is passed to a search engine. */ + AllowAutosearch = 16, + + /** Causes the current Explorer Bar to navigate to the given item, if possible. */ + BrowserBar = 32, + + /** + * Internet Explorer 6 for Windows XP SP2 and later. If the navigation fails when a hyperlink is being followed, this constant specifies that the resource should then be bound to the + * moniker using the [**BINDF_HYPERLINK**](https://msdn.microsoft.com/en-us/library/ms775130(v=vs.85).aspx) flag. + */ + Hyperlink = 64, + + /** Internet Explorer 6 for Windows XP SP2 and later. Force the URL into the restricted zone. */ + EnforceRestricted = 128, + + /** Internet Explorer 6 for Windows XP SP2 and later. Use the default Popup Manager to block pop-up windows. */ + NewWindowsManaged = 256, + + /** Internet Explorer 6 for Windows XP SP2 and later. Block files that normally trigger a file download dialog box. */ + UntrustedForDownload = 512, + + /** Internet Explorer 6 for Windows XP SP2 and later. Prompt for the installation of ActiveX controls. */ + TrustedForActiveX = 1024, + + /** Internet Explorer 7. Open the resource or file in a new tab. Allow the destination window to come to the foreground, if necessary. */ + OpenInNewTab = 2048, + + /** Internet Explorer 7. Open the resource or file in a new background tab; the currently active window and/or tab remains open on top. */ + OpenInBackgroundTab = 4096, + + /** + * Internet Explorer 7. Maintain state for dynamic navigation based on the filter string entered in the search band text box (wordwheel). Restore the wordwheel text when the navigation + * completes. + */ + KeepWordWheelText = 8192, + + /** + * Internet Explorer 8. Open the resource as a replacement for the current or target tab. The existing tab is closed while the new tab takes its place in the tab bar and replaces it in the + * tab group, if any. Browser history is copied forward to the new tab. On Windows Vista, this flag is implied if the navigation would cross integrity levels and **navOpenInNewTab**, + * **navOpenInBackgroundTab**, or **navOpenInNewWindow**> is not specified. + */ + VirtualTab = 16384, + + /** + * Internet Explorer 8. Block cross-domain redirect requests. The navigation triggers the + * [**DWebBrowserEvents2::RedirectXDomainBlocked**](https://msdn.microsoft.com/en-us/library/dd565686(v=vs.85).aspx) event if blocked. + */ + BlockRedirectsXDomain = 32768, + + /** Internet Explorer 8 and later. Open the resource in a new tab that becomes the foreground tab. */ + OpenNewForegroundTab = 65536 + } + + /** Constants for WebBrowser CommandStateChange */ + // tslint:disable-next-line no-const-enum + const enum CommandStateChangeConstants { + CSC_NAVIGATEBACK = 2, + CSC_NAVIGATEFORWARD = 1, + CSC_UPDATECOMMANDS = -1, + } + + /** Constants for WebBrowser NewProcess notification */ + // tslint:disable-next-line no-const-enum + const enum NewProcessCauseConstants { + ProtectedModeRedirect = 1, + } + + // tslint:disable-next-line no-const-enum + const enum OLECMDEXECOPT { + OLECMDEXECOPT_DODEFAULT = 0, + OLECMDEXECOPT_DONTPROMPTUSER = 2, + OLECMDEXECOPT_PROMPTUSER = 1, + OLECMDEXECOPT_SHOWHELP = 3, + } + + // tslint:disable-next-line no-const-enum + const enum OLECMDF { + OLECMDF_DEFHIDEONCTXTMENU = 32, + OLECMDF_ENABLED = 2, + OLECMDF_INVISIBLE = 16, + OLECMDF_LATCHED = 4, + OLECMDF_NINCHED = 8, + OLECMDF_SUPPORTED = 1, + } + + // tslint:disable-next-line no-const-enum + const enum OLECMDID { + OLECMDID_ACTIVEXINSTALLSCOPE = 66, + OLECMDID_ADDTRAVELENTRY = 60, + OLECMDID_ALLOWUILESSSAVEAS = 46, + OLECMDID_CLEARSELECTION = 18, + OLECMDID_CLOSE = 45, + OLECMDID_COPY = 12, + OLECMDID_CUT = 11, + OLECMDID_DELETE = 33, + OLECMDID_DONTDOWNLOADCSS = 47, + OLECMDID_ENABLE_INTERACTION = 36, + OLECMDID_ENABLE_VISIBILITY = 77, + OLECMDID_EXITFULLSCREEN = 81, + OLECMDID_FIND = 32, + OLECMDID_FOCUSVIEWCONTROLS = 57, + OLECMDID_FOCUSVIEWCONTROLSQUERY = 58, + OLECMDID_GETPRINTTEMPLATE = 52, + OLECMDID_GETUSERSCALABLE = 75, + OLECMDID_GETZOOMRANGE = 20, + OLECMDID_HIDETOOLBARS = 24, + OLECMDID_HTTPEQUIV = 34, + OLECMDID_HTTPEQUIV_DONE = 35, + OLECMDID_LAYOUT_VIEWPORT_WIDTH = 71, + OLECMDID_MEDIA_PLAYBACK = 78, + OLECMDID_NEW = 2, + OLECMDID_ONBEFOREUNLOAD = 83, + OLECMDID_ONTOOLBARACTIVATED = 31, + OLECMDID_ONUNLOAD = 37, + OLECMDID_OPEN = 1, + OLECMDID_OPTICAL_GETZOOMRANGE = 64, + OLECMDID_OPTICAL_ZOOM = 63, + OLECMDID_PAGEACTIONBLOCKED = 55, + OLECMDID_PAGEACTIONUIQUERY = 56, + OLECMDID_PAGEAVAILABLE = 74, + OLECMDID_PAGESETUP = 8, + OLECMDID_PASTE = 13, + OLECMDID_PASTESPECIAL = 14, + OLECMDID_POPSTATEEVENT = 69, + OLECMDID_PREREFRESH = 39, + OLECMDID_PRINT = 6, + OLECMDID_PRINT2 = 49, + OLECMDID_PRINTPREVIEW = 7, + OLECMDID_PRINTPREVIEW2 = 50, + OLECMDID_PROPERTIES = 10, + OLECMDID_PROPERTYBAG2 = 38, + OLECMDID_REDO = 16, + OLECMDID_REFRESH = 22, + OLECMDID_SAVE = 3, + OLECMDID_SAVEAS = 4, + OLECMDID_SAVECOPYAS = 5, + OLECMDID_SCROLLCOMPLETE = 82, + OLECMDID_SELECTALL = 17, + OLECMDID_SET_HOST_FULLSCREENMODE = 80, + OLECMDID_SETDOWNLOADSTATE = 29, + OLECMDID_SETFAVICON = 79, + OLECMDID_SETPRINTTEMPLATE = 51, + OLECMDID_SETPROGRESSMAX = 25, + OLECMDID_SETPROGRESSPOS = 26, + OLECMDID_SETPROGRESSTEXT = 27, + OLECMDID_SETTITLE = 28, + OLECMDID_SHOWFIND = 42, + OLECMDID_SHOWMESSAGE = 41, + OLECMDID_SHOWMESSAGE_BLOCKABLE = 84, + OLECMDID_SHOWPAGEACTIONMENU = 59, + OLECMDID_SHOWPAGESETUP = 43, + OLECMDID_SHOWPRINT = 44, + OLECMDID_SHOWSCRIPTERROR = 40, + OLECMDID_SHOWTASKDLG = 68, + OLECMDID_SHOWTASKDLG_BLOCKABLE = 85, + OLECMDID_SPELL = 9, + OLECMDID_STOP = 23, + OLECMDID_STOPDOWNLOAD = 30, + OLECMDID_UNDO = 15, + OLECMDID_UPDATE_CARET = 76, + OLECMDID_UPDATEBACKFORWARDSTATE = 62, + OLECMDID_UPDATECOMMANDS = 21, + OLECMDID_UPDATEPAGESTATUS = 48, + OLECMDID_UPDATETRAVELENTRY = 61, + OLECMDID_UPDATETRAVELENTRY_DATARECOVERY = 67, + OLECMDID_USER_OPTICAL_ZOOM = 73, + OLECMDID_VIEWPORT_MODE = 70, + OLECMDID_VISUAL_VIEWPORT_EXCLUDE_BOTTOM = 72, + OLECMDID_WINDOWSTATECHANGED = 65, + OLECMDID_ZOOM = 19, + } + + // tslint:disable-next-line no-const-enum + const enum RefreshConstants { + Normal = 0, + IfExpired = 1, + Completely = 3 + } + + /** Constants for WebBrowser security icon notification */ + // tslint:disable-next-line no-const-enum + const enum SecureLockIconConstants { + secureLockIconMixed = 1, + secureLockIconSecure128Bit = 6, + secureLockIconSecure40Bit = 3, + secureLockIconSecure56Bit = 4, + secureLockIconSecureFortezza = 5, + secureLockIconSecureUnknownBits = 2, + secureLockIconUnsecure = 0, + } + + /** Options for ShellWindows FindWindow */ + // tslint:disable-next-line no-const-enum + const enum ShellWindowFindWindowOptions { + SWFO_COOKIEPASSED = 4, + SWFO_INCLUDEPENDING = 2, + SWFO_NEEDDISPATCH = 1, + } + + /** Constants for ShellWindows registration */ + // tslint:disable-next-line no-const-enum + const enum ShellWindowTypeConstants { + SWC_3RDPARTY = 2, + SWC_BROWSER = 1, + SWC_CALLBACK = 4, + SWC_DESKTOP = 8, + SWC_EXPLORER = 0, + } + + // tslint:disable-next-line no-const-enum + const enum tagREADYSTATE { + READYSTATE_COMPLETE = 4, + READYSTATE_INTERACTIVE = 3, + READYSTATE_LOADED = 2, + READYSTATE_LOADING = 1, + READYSTATE_UNINITIALIZED = 0, + } + + type TargetFrameValues = '_blank' | '_parent' | '_self' | '_top' ; + + class CScriptErrorList { + private 'SHDocVw.CScriptErrorList_typekey': CScriptErrorList; + private constructor(); + advanceError(): void; + canAdvanceError(): number; + canRetreatError(): number; + getAlwaysShowLockState(): number; + getDetailsPaneOpen(): number; + getErrorChar(): number; + getErrorCode(): number; + getErrorLine(): number; + getErrorMsg(): string; + getErrorUrl(): string; + getPerErrorDisplay(): number; + retreatError(): void; + setDetailsPaneOpen(fDetailsPaneOpen: number): void; + setPerErrorDisplay(fPerErrorDisplay: number): void; + } + + /** Internet Explorer Application. */ + class InternetExplorer { + private 'SHDocVw.InternetExplorer_typekey': InternetExplorer; + private constructor(); + + /** Controls whether address bar is shown */ + AddressBar: boolean; + + /** Returns the application automation object if accessible, this automation object otherwise.. */ + readonly Application: any; + + /** Query to see if something is still in progress. */ + readonly Busy: boolean; + + /** Converts client sizes into window sizes. */ + ClientToWindow(pcx: number, pcy: number): void; + + /** Returns the container/parent automation object, if any. */ + readonly Container: any; + + /** Returns the active Document automation object, if any. */ + readonly Document: any; + + /** IOleCommandTarget::Exec */ + ExecWB(cmdID: OLECMDID, cmdexecopt: OLECMDEXECOPT, pvaIn?: any, pvaOut?: any): void; + + /** Returns file specification of the application, including path. */ + readonly FullName: string; + + /** Maximizes window and turns off statusbar, toolbar, menubar, and titlebar. */ + FullScreen: boolean; + + /** Retrieve the Associated value for the property vtValue in the context of the object. */ + GetProperty(Property: string): any; + + /** Navigates to the previous item in the history list. */ + GoBack(): void; + + /** Navigates to the next item in the history list. */ + GoForward(): void; + + /** Go home/start page. */ + GoHome(): void; + + /** Go Search Page. */ + GoSearch(): void; + + /** The vertical dimension (pixels) of the frame window/object. */ + Height: number; + + /** Returns the HWND of the current IE window. */ + readonly HWND: number; + + /** The horizontal position (pixels) of the frame window relative to the screen/container. */ + Left: number; + + /** Gets the short (UI-friendly) name of the URL/file currently viewed. */ + readonly LocationName: string; + + /** Gets the full URL/path currently viewed. */ + readonly LocationURL: string; + + /** Controls whether menubar is shown. */ + MenuBar: boolean; + + /** Returns name of the application. */ + readonly Name: string; + + /** Navigates to a URL or file. */ + Navigate(URL: string, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Navigates to a URL or file or pidl. */ + Navigate2(URL: any, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Controls if the frame is offline (read from cache) */ + Offline: boolean; + + /** Returns the automation object of the container/parent if one exists or this automation object. */ + readonly Parent: any; + + /** Returns the path to the application. */ + readonly Path: string; + + /** Associates vtValue with the name szProperty in the context of the object. */ + PutProperty(Property: string, vtValue: any): void; + + /** IOleCommandTarget::QueryStatus */ + QueryStatusWB(cmdID: OLECMDID): OLECMDF; + + /** Exits application and closes the open document. */ + Quit(): void; + readonly ReadyState: tagREADYSTATE; + + /** Refresh the currently viewed page. */ + Refresh(): void; + + /** Refresh the currently viewed page. */ + Refresh2(Level?: RefreshConstants): void; + + /** Registers OC as a top-level browser (for target name resolution) */ + RegisterAsBrowser: boolean; + + /** Registers OC as a drop target for navigation */ + RegisterAsDropTarget: boolean; + + /** Controls whether the window is resizable */ + Resizable: boolean; + + /** Set BrowserBar to Clsid */ + ShowBrowserBar(pvaClsid: string | BrowserBarConstants, pvarShow?: boolean): void; + + /** Controls if any dialog boxes can be shown */ + Silent: boolean; + + /** Turn on or off the statusbar. */ + StatusBar: boolean; + + /** Text of Status window. */ + StatusText: string; + + /** Stops opening a file. */ + Stop(): void; + + /** Controls if the browser is in theater mode */ + TheaterMode: boolean; + + /** Controls which toolbar is shown. */ + ToolBar: number; + + /** The vertical position (pixels) of the frame window relative to the screen/container. */ + Top: number; + + /** Returns True if this is the top level object. */ + readonly TopLevelContainer: boolean; + + /** Returns the type of the contained document object. */ + readonly Type: string; + + /** Determines whether the application is visible or hidden. */ + Visible: boolean; + + /** The horizontal dimension (pixels) of the frame window/object. */ + Width: number; + } + + /** Internet Explorer Application with default integrity of Medium */ + class InternetExplorerMedium { + private 'SHDocVw.InternetExplorerMedium_typekey': InternetExplorerMedium; + private constructor(); + + /** Controls whether address bar is shown */ + AddressBar: boolean; + + /** Returns the application automation object if accessible, this automation object otherwise.. */ + readonly Application: any; + + /** Query to see if something is still in progress. */ + readonly Busy: boolean; + + /** Converts client sizes into window sizes. */ + ClientToWindow(pcx: number, pcy: number): void; + + /** Returns the container/parent automation object, if any. */ + readonly Container: any; + + /** Returns the active Document automation object, if any. */ + readonly Document: any; + + /** IOleCommandTarget::Exec */ + ExecWB(cmdID: OLECMDID, cmdexecopt: OLECMDEXECOPT, pvaIn?: any, pvaOut?: any): void; + + /** Returns file specification of the application, including path. */ + readonly FullName: string; + + /** Maximizes window and turns off statusbar, toolbar, menubar, and titlebar. */ + FullScreen: boolean; + + /** Retrieve the Associated value for the property vtValue in the context of the object. */ + GetProperty(Property: string): any; + + /** Navigates to the previous item in the history list. */ + GoBack(): void; + + /** Navigates to the next item in the history list. */ + GoForward(): void; + + /** Go home/start page. */ + GoHome(): void; + + /** Go Search Page. */ + GoSearch(): void; + + /** The vertical dimension (pixels) of the frame window/object. */ + Height: number; + + /** Returns the HWND of the current IE window. */ + readonly HWND: number; + + /** The horizontal position (pixels) of the frame window relative to the screen/container. */ + Left: number; + + /** Gets the short (UI-friendly) name of the URL/file currently viewed. */ + readonly LocationName: string; + + /** Gets the full URL/path currently viewed. */ + readonly LocationURL: string; + + /** Controls whether menubar is shown. */ + MenuBar: boolean; + + /** Returns name of the application. */ + readonly Name: string; + + /** Navigates to a URL or file. */ + Navigate(URL: string, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Navigates to a URL or file or pidl. */ + Navigate2(URL: any, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Controls if the frame is offline (read from cache) */ + Offline: boolean; + + /** Returns the automation object of the container/parent if one exists or this automation object. */ + readonly Parent: any; + + /** Returns the path to the application. */ + readonly Path: string; + + /** Associates vtValue with the name szProperty in the context of the object. */ + PutProperty(Property: string, vtValue: any): void; + + /** IOleCommandTarget::QueryStatus */ + QueryStatusWB(cmdID: OLECMDID): OLECMDF; + + /** Exits application and closes the open document. */ + Quit(): void; + readonly ReadyState: tagREADYSTATE; + + /** Refresh the currently viewed page. */ + Refresh(): void; + + /** Refresh the currently viewed page. */ + Refresh2(Level?: RefreshConstants): void; + + /** Registers OC as a top-level browser (for target name resolution) */ + RegisterAsBrowser: boolean; + + /** Registers OC as a drop target for navigation */ + RegisterAsDropTarget: boolean; + + /** Controls whether the window is resizable */ + Resizable: boolean; + + /** Set BrowserBar to Clsid */ + ShowBrowserBar(pvaClsid: string | BrowserBarConstants, pvarShow?: boolean): void; + + /** Controls if any dialog boxes can be shown */ + Silent: boolean; + + /** Turn on or off the statusbar. */ + StatusBar: boolean; + + /** Text of Status window. */ + StatusText: string; + + /** Stops opening a file. */ + Stop(): void; + + /** Controls if the browser is in theater mode */ + TheaterMode: boolean; + + /** Controls which toolbar is shown. */ + ToolBar: number; + + /** The vertical position (pixels) of the frame window relative to the screen/container. */ + Top: number; + + /** Returns True if this is the top level object. */ + readonly TopLevelContainer: boolean; + + /** Returns the type of the contained document object. */ + readonly Type: string; + + /** Determines whether the application is visible or hidden. */ + Visible: boolean; + + /** The horizontal dimension (pixels) of the frame window/object. */ + Width: number; + } + + /** Shell Browser Window. */ + class ShellBrowserWindow { + private 'SHDocVw.ShellBrowserWindow_typekey': ShellBrowserWindow; + private constructor(); + + /** Controls whether address bar is shown */ + AddressBar: boolean; + + /** Returns the application automation object if accessible, this automation object otherwise.. */ + readonly Application: any; + + /** Query to see if something is still in progress. */ + readonly Busy: boolean; + + /** Converts client sizes into window sizes. */ + ClientToWindow(pcx: number, pcy: number): void; + + /** Returns the container/parent automation object, if any. */ + readonly Container: any; + + /** Returns the active Document automation object, if any. */ + readonly Document: any; + + /** IOleCommandTarget::Exec */ + ExecWB(cmdID: OLECMDID, cmdexecopt: OLECMDEXECOPT, pvaIn?: any, pvaOut?: any): void; + + /** Returns file specification of the application, including path. */ + readonly FullName: string; + + /** Maximizes window and turns off statusbar, toolbar, menubar, and titlebar. */ + FullScreen: boolean; + + /** Retrieve the Associated value for the property vtValue in the context of the object. */ + GetProperty(Property: string): any; + + /** Navigates to the previous item in the history list. */ + GoBack(): void; + + /** Navigates to the next item in the history list. */ + GoForward(): void; + + /** Go home/start page. */ + GoHome(): void; + + /** Go Search Page. */ + GoSearch(): void; + + /** The vertical dimension (pixels) of the frame window/object. */ + Height: number; + + /** Returns the HWND of the current IE window. */ + readonly HWND: number; + + /** The horizontal position (pixels) of the frame window relative to the screen/container. */ + Left: number; + + /** Gets the short (UI-friendly) name of the URL/file currently viewed. */ + readonly LocationName: string; + + /** Gets the full URL/path currently viewed. */ + readonly LocationURL: string; + + /** Controls whether menubar is shown. */ + MenuBar: boolean; + + /** Returns name of the application. */ + readonly Name: string; + + /** Navigates to a URL or file. */ + Navigate(URL: string, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Navigates to a URL or file or pidl. */ + Navigate2(URL: any, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Controls if the frame is offline (read from cache) */ + Offline: boolean; + + /** Returns the automation object of the container/parent if one exists or this automation object. */ + readonly Parent: any; + + /** Returns the path to the application. */ + readonly Path: string; + + /** Associates vtValue with the name szProperty in the context of the object. */ + PutProperty(Property: string, vtValue: any): void; + + /** IOleCommandTarget::QueryStatus */ + QueryStatusWB(cmdID: OLECMDID): OLECMDF; + + /** Exits application and closes the open document. */ + Quit(): void; + readonly ReadyState: tagREADYSTATE; + + /** Refresh the currently viewed page. */ + Refresh(): void; + + /** Refresh the currently viewed page. */ + Refresh2(Level?: RefreshConstants): void; + + /** Registers OC as a top-level browser (for target name resolution) */ + RegisterAsBrowser: boolean; + + /** Registers OC as a drop target for navigation */ + RegisterAsDropTarget: boolean; + + /** Controls whether the window is resizable */ + Resizable: boolean; + + /** Set BrowserBar to Clsid */ + ShowBrowserBar(pvaClsid: string | BrowserBarConstants, pvarShow?: boolean): void; + + /** Controls if any dialog boxes can be shown */ + Silent: boolean; + + /** Turn on or off the statusbar. */ + StatusBar: boolean; + + /** Text of Status window. */ + StatusText: string; + + /** Stops opening a file. */ + Stop(): void; + + /** Controls if the browser is in theater mode */ + TheaterMode: boolean; + + /** Controls which toolbar is shown. */ + ToolBar: number; + + /** The vertical position (pixels) of the frame window relative to the screen/container. */ + Top: number; + + /** Returns True if this is the top level object. */ + readonly TopLevelContainer: boolean; + + /** Returns the type of the contained document object. */ + readonly Type: string; + + /** Determines whether the application is visible or hidden. */ + Visible: boolean; + + /** The horizontal dimension (pixels) of the frame window/object. */ + Width: number; + } + + class ShellNameSpace { + private 'SHDocVw.ShellNameSpace_typekey': ShellNameSpace; + private constructor(); + Columns: string; + + /** number of view types */ + readonly CountViewTypes: number; + + /** method CreateSubscriptionForSelection */ + CreateSubscriptionForSelection(): boolean; + + /** method DeleteSubscriptionForSelection */ + DeleteSubscriptionForSelection(): boolean; + Depth: number; + + /** options */ + EnumOptions: number; + + /** expands item specified depth */ + Expand(var_0: any, iDepth: number): void; + + /** method Export */ + Export(): void; + Flags: number; + + /** method Import */ + Import(): void; + + /** method InvokeContextMenuCommand */ + InvokeContextMenuCommand(strCommand: string): void; + Mode: number; + + /** method MoveSelectionDown */ + MoveSelectionDown(): void; + + /** method MoveSelectionTo */ + MoveSelectionTo(): void; + + /** method MoveSelectionUp */ + MoveSelectionUp(): void; + + /** method NewFolder */ + NewFolder(): void; + + /** method ResetSort */ + ResetSort(): void; + + /** get the root item */ + Root: any; + + /** get the selected item */ + SelectedItem: any; + + /** collection of selected items */ + SelectedItems(): any; + + /** old, use put_Root() instead */ + SetRoot(bstrFullPath: string): void; + + /** set view type */ + SetViewType(iType: number): void; + + /** Query to see if subscriptions are enabled */ + readonly SubscriptionsEnabled: boolean; + + /** method Synchronize */ + Synchronize(): void; + TVFlags: number; + + /** unselects all items */ + UnselectAll(): void; + } + + class ShellUIHelper { + private 'SHDocVw.ShellUIHelper_typekey': ShellUIHelper; + private constructor(); + AddChannel(URL: string): void; + AddDesktopComponent(URL: string, Type: string, Left?: any, Top?: any, Width?: any, Height?: any): void; + AddFavorite(URL: string, Title?: any): void; + AddSearchProvider(URL: string): void; + AddService(URL: string): void; + AddToFavoritesBar(URL: string, Title: string, Type?: any): void; + AutoCompleteAttach(Reserved?: any): void; + AutoCompleteSaveForm(Form?: any): void; + AutoScan(strSearch: string, strFailureUrl: string, pvarTargetFrame?: any): void; + BrandImageUri(): string; + BuildNewTabPage(): void; + ContentDiscoveryReset(): void; + CustomizeClearType(fSet: boolean): void; + CustomizeSettings(fSQM: boolean, fPhishing: boolean, bstrLocale: string): void; + DefaultSearchProvider(): string; + DiagnoseConnection(): void; + EnableSuggestedSites(fEnable: boolean): void; + GetCVListData(): string; + GetCVListLocalData(): string; + GetEMIEListData(): string; + GetEMIEListLocalData(): string; + GetExperimentalFlag(bstrFlagString: string): boolean; + GetExperimentalValue(bstrValueString: string): number; + GetNeedIEAutoLaunchFlag(bstrUrl: string): boolean; + HasNeedIEAutoLaunchFlag(bstrUrl: string): boolean; + ImportExportFavorites(fImport: boolean, strImpExpPath: string): void; + InPrivateFilteringEnabled(): boolean; + IsSearchMigrated(): boolean; + IsSearchProviderInstalled(URL: string): number; + IsServiceInstalled(URL: string, Verb: string): number; + IsSubscribed(URL: string): boolean; + IsSuggestedSitesEnabled(): boolean; + LaunchIE(bstrUrl: string, automated: boolean): void; + LaunchInHVSI(bstrUrl: string): void; + msActiveXFilteringEnabled(): boolean; + msAddSiteMode(): void; + msAddTrackingProtectionList(URL: string, bstrFilterName: string): void; + msChangeDefaultBrowser(fChange: boolean): void; + msClearTile(): void; + msDiagnoseConnectionUILess(): void; + msEnableTileNotificationQueue(fChange: boolean): void; + msEnableTileNotificationQueueForSquare150x150(fChange: boolean): void; + msEnableTileNotificationQueueForSquare310x310(fChange: boolean): void; + msEnableTileNotificationQueueForWide310x150(fChange: boolean): void; + msIsSiteMode(): boolean; + msIsSiteModeFirstRun(fPreserveState: boolean): any; + msLaunchInternetOptions(): void; + msLaunchNetworkClientHelp(): void; + msPinnedSiteState(): any; + msProvisionNetworks(bstrProvisioningXml: string): any; + msRemoveScheduledTileNotification(bstrNotificationId: string): void; + msReportSafeUrl(): void; + msScheduledTileNotification(bstrNotificationXml: string, bstrNotificationId: string, bstrNotificationTag: string, startTime?: any, expirationTime?: any): void; + msSiteModeActivate(): void; + msSiteModeAddButtonStyle(uiButtonID: any, bstrIconURL: string, bstrTooltip: string): any; + msSiteModeAddJumpListItem(bstrName: string, bstrActionUri: string, bstrIconUri: string, pvarWindowType?: any): void; + msSiteModeAddThumbBarButton(bstrIconURL: string, bstrTooltip: string): any; + msSiteModeClearBadge(): void; + msSiteModeClearIconOverlay(): void; + msSiteModeClearJumpList(): void; + msSiteModeCreateJumpList(bstrHeader: string): void; + msSiteModeRefreshBadge(): void; + msSiteModeSetIconOverlay(IconUrl: string, pvarDescription?: any): void; + msSiteModeShowButtonStyle(uiButtonID: any, uiStyleID: any): void; + msSiteModeShowJumpList(): void; + msSiteModeShowThumbBar(): void; + msSiteModeUpdateThumbBarButton(ButtonID: any, fEnabled: boolean, fVisible: boolean): void; + msStartPeriodicBadgeUpdate(pollingUri: string, startTime?: any, uiUpdateRecurrence?: any): void; + msStartPeriodicTileUpdate(pollingUris: any, startTime?: any, uiUpdateRecurrence?: any): void; + msStartPeriodicTileUpdateBatch(pollingUris: any, startTime?: any, uiUpdateRecurrence?: any): void; + msStopPeriodicBadgeUpdate(): void; + msStopPeriodicTileUpdate(): void; + msTrackingProtectionEnabled(): boolean; + NavigateAndFind(URL: string, strQuery: string, varTargetFrame: any): void; + NavigateToSuggestedSites(bstrRelativeUrl: string): void; + OpenFavoritesPane(): void; + OpenFavoritesSettings(): void; + PhishingEnabled(): boolean; + RefreshOfflineDesktop(): void; + ResetAllExperimentalFlagsAndValues(): void; + ResetFirstBootMode(): void; + ResetSafeMode(): void; + RunOnceHasShown(): boolean; + RunOnceRequiredSettingsComplete(fComplete: boolean): void; + RunOnceShown(): void; + SearchGuideUrl(): string; + SetActivitiesVisible(fVisible: boolean): void; + SetExperimentalFlag(bstrFlagString: string, vfFlag: boolean): void; + SetExperimentalValue(bstrValueString: string, dwValue: number): void; + SetNeedIEAutoLaunchFlag(bstrUrl: string, flag: boolean): void; + SetRecentlyClosedVisible(fVisible: boolean): void; + ShowBrowserUI(bstrName: string, pvarIn: any): any; + ShowInPrivateHelp(): void; + ShowTabsHelp(): void; + SkipRunOnce(): void; + SkipTabsWelcome(): void; + SqmEnabled(): boolean; + } + + /** ShellDispatch Load in Shell Context */ + class ShellWindows { + private 'SHDocVw.ShellWindows_typekey': ShellWindows; + private constructor(); + + /** Get count of open Shell windows */ + readonly Count: number; + + /** Find the window based on the location */ + FindWindowSW(pvarloc: any, pvarlocRoot: any, swClass: number, pHWND: number, swfwOptions: number): any; + + /** Return the shell window for the given index */ + Item(index?: any): any; + + /** Notifies the activation */ + OnActivated(lCookie: number, fActive: boolean): void; + + /** Notifies on creation and frame name set */ + OnCreated(lCookie: number, punk: any): void; + + /** Notifies the new location */ + OnNavigate(lCookie: number, pvarloc: any): void; + + /** Used by IExplore to register different processes */ + ProcessAttachDetach(fAttach: boolean): void; + + /** Register a window with the list */ + Register(pid: any, HWND: number, swClass: number, plCookie: number): void; + + /** Register a pending open with the list */ + RegisterPending(lThreadId: number, pvarloc: any, pvarlocRoot: any, swClass: number, plCookie: number): void; + + /** Remove a window from the list */ + Revoke(lCookie: number): void; + } + + /** WebBrowser Control */ + class WebBrowser { + private 'SHDocVw.WebBrowser_typekey': WebBrowser; + private constructor(); + + /** Controls whether address bar is shown (ignored by WebBrowser) */ + AddressBar: boolean; + + /** Returns the application automation object if accessible, this automation object otherwise.. */ + readonly Application: any; + + /** Query to see if something is still in progress. */ + readonly Busy: boolean; + + /** Converts client sizes into window sizes. */ + ClientToWindow(pcx: number, pcy: number): void; + + /** Returns the container/parent automation object, if any. */ + readonly Container: any; + + /** Returns the active Document automation object, if any. */ + readonly Document: any; + + /** IOleCommandTarget::Exec */ + ExecWB(cmdID: OLECMDID, cmdexecopt: OLECMDEXECOPT, pvaIn?: any, pvaOut?: any): void; + + /** Returns file specification of the application, including path. */ + readonly FullName: string; + + /** Maximizes window and turns off statusbar, toolbar, menubar, and titlebar. */ + FullScreen: boolean; + + /** Retrieve the Associated value for the property vtValue in the context of the object. */ + GetProperty(Property: string): any; + + /** Navigates to the previous item in the history list. */ + GoBack(): void; + + /** Navigates to the next item in the history list. */ + GoForward(): void; + + /** Go home/start page. */ + GoHome(): void; + + /** Go Search Page. */ + GoSearch(): void; + + /** The vertical dimension (pixels) of the frame window/object. */ + Height: number; + + /** Returns the HWND of the current IE window. */ + readonly HWND: number; + + /** The horizontal position (pixels) of the frame window relative to the screen/container. */ + Left: number; + + /** Gets the short (UI-friendly) name of the URL/file currently viewed. */ + readonly LocationName: string; + + /** Gets the full URL/path currently viewed. */ + readonly LocationURL: string; + + /** Controls whether menubar is shown. */ + MenuBar: boolean; + + /** Returns name of the application. */ + readonly Name: string; + + /** Navigates to a URL or file. */ + Navigate(URL: string, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Navigates to a URL or file or pidl. */ + Navigate2(URL: any, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Controls if the frame is offline (read from cache) */ + Offline: boolean; + + /** Returns the automation object of the container/parent if one exists or this automation object. */ + readonly Parent: any; + + /** Returns the path to the application. */ + readonly Path: string; + + /** Associates vtValue with the name szProperty in the context of the object. */ + PutProperty(Property: string, vtValue: any): void; + + /** IOleCommandTarget::QueryStatus */ + QueryStatusWB(cmdID: OLECMDID): OLECMDF; + + /** Exits application and closes the open document. */ + Quit(): void; + readonly ReadyState: tagREADYSTATE; + + /** Refresh the currently viewed page. */ + Refresh(): void; + + /** Refresh the currently viewed page. */ + Refresh2(Level?: RefreshConstants): void; + + /** Registers OC as a top-level browser (for target name resolution) */ + RegisterAsBrowser: boolean; + + /** Registers OC as a drop target for navigation */ + RegisterAsDropTarget: boolean; + + /** Controls whether the window is resizable */ + Resizable: boolean; + + /** Set BrowserBar to Clsid */ + ShowBrowserBar(pvaClsid: string | BrowserBarConstants, pvarShow?: boolean): void; + + /** Controls if any dialog boxes can be shown */ + Silent: boolean; + + /** Turn on or off the statusbar. */ + StatusBar: boolean; + + /** Text of Status window. */ + StatusText: string; + + /** Stops opening a file. */ + Stop(): void; + + /** Controls if the browser is in theater mode */ + TheaterMode: boolean; + + /** Controls which toolbar is shown. */ + ToolBar: number; + + /** The vertical position (pixels) of the frame window relative to the screen/container. */ + Top: number; + + /** Returns True if this is the top level object. */ + readonly TopLevelContainer: boolean; + + /** Returns the type of the contained document object. */ + readonly Type: string; + + /** Determines whether the application is visible or hidden. */ + Visible: boolean; + + /** The horizontal dimension (pixels) of the frame window/object. */ + Width: number; + } + + /** WebBrowser Control */ + class WebBrowser_V1 { + private 'SHDocVw.WebBrowser_V1_typekey': WebBrowser_V1; + private constructor(); + + /** Returns the application automation object if accessible, this automation object otherwise.. */ + readonly Application: any; + + /** Query to see if something is still in progress. */ + readonly Busy: boolean; + + /** Returns the container/parent automation object, if any. */ + readonly Container: any; + + /** Returns the active Document automation object, if any. */ + readonly Document: any; + + /** Navigates to the previous item in the history list. */ + GoBack(): void; + + /** Navigates to the next item in the history list. */ + GoForward(): void; + + /** Go home/start page. */ + GoHome(): void; + + /** Go Search Page. */ + GoSearch(): void; + + /** The vertical dimension (pixels) of the frame window/object. */ + Height: number; + + /** The horizontal position (pixels) of the frame window relative to the screen/container. */ + Left: number; + + /** Gets the short (UI-friendly) name of the URL/file currently viewed. */ + readonly LocationName: string; + + /** Gets the full URL/path currently viewed. */ + readonly LocationURL: string; + + /** Navigates to a URL or file. */ + Navigate(URL: string, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Returns the automation object of the container/parent if one exists or this automation object. */ + readonly Parent: any; + + /** Refresh the currently viewed page. */ + Refresh(): void; + + /** Refresh the currently viewed page. */ + Refresh2(Level?: RefreshConstants): void; + + /** Stops opening a file. */ + Stop(): void; + + /** The vertical position (pixels) of the frame window relative to the screen/container. */ + Top: number; + + /** Returns True if this is the top level object. */ + readonly TopLevelContainer: boolean; + + /** Returns the type of the contained document object. */ + readonly Type: string; + + /** The horizontal dimension (pixels) of the frame window/object. */ + Width: number; + } + + namespace EventHelperTypes { + type InternetExplorer_BeforeNavigate2_ArgNames = ['pDisp', 'URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Cancel']; + + type InternetExplorerMedium_BeforeNavigate2_ArgNames = ['pDisp', 'URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Cancel']; + + type ShellBrowserWindow_BeforeNavigate2_ArgNames = ['pDisp', 'URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Cancel']; + + type ShellNameSpace_FavoritesSelectionChange_ArgNames = ['cItems', 'hItem', 'strName', 'strUrl', 'cVisits', 'strDate', 'fAvailableOffline']; + + type WebBrowser_BeforeNavigate2_ArgNames = ['pDisp', 'URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Cancel']; + + type WebBrowser_V1_BeforeNavigate_ArgNames = ['URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Cancel']; + + type WebBrowser_V1_FrameBeforeNavigate_ArgNames = ['URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Cancel']; + + type WebBrowser_V1_FrameNewWindow_ArgNames = ['URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Processed']; + + type WebBrowser_V1_NewWindow_ArgNames = ['URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Processed']; + + interface InternetExplorer_BeforeNavigate2_Parameter { + Cancel: boolean; + readonly Flags: any; + readonly Headers: any; + readonly pDisp: any; + readonly PostData: any; + readonly TargetFrameName: any; + readonly URL: any; + } + + interface InternetExplorerMedium_BeforeNavigate2_Parameter { + Cancel: boolean; + readonly Flags: any; + readonly Headers: any; + readonly pDisp: any; + readonly PostData: any; + readonly TargetFrameName: any; + readonly URL: any; + } + + interface ShellBrowserWindow_BeforeNavigate2_Parameter { + Cancel: boolean; + readonly Flags: any; + readonly Headers: any; + readonly pDisp: any; + readonly PostData: any; + readonly TargetFrameName: any; + readonly URL: any; + } + + interface ShellNameSpace_FavoritesSelectionChange_Parameter { + readonly cItems: number; + readonly cVisits: number; + readonly fAvailableOffline: number; + readonly hItem: number; + readonly strDate: string; + readonly strName: string; + readonly strUrl: string; + } + + interface WebBrowser_BeforeNavigate2_Parameter { + Cancel: boolean; + readonly Flags: any; + readonly Headers: any; + readonly pDisp: any; + readonly PostData: any; + readonly TargetFrameName: any; + readonly URL: any; + } + + interface WebBrowser_V1_BeforeNavigate_Parameter { + Cancel: boolean; + readonly Flags: number; + readonly Headers: string; + readonly PostData: any; + readonly TargetFrameName: string; + readonly URL: string; + } + + interface WebBrowser_V1_FrameBeforeNavigate_Parameter { + Cancel: boolean; + readonly Flags: number; + readonly Headers: string; + readonly PostData: any; + readonly TargetFrameName: string; + readonly URL: string; + } + + interface WebBrowser_V1_FrameNewWindow_Parameter { + readonly Flags: number; + readonly Headers: string; + readonly PostData: any; + Processed: boolean; + readonly TargetFrameName: string; + readonly URL: string; + } + + interface WebBrowser_V1_NewWindow_Parameter { + readonly Flags: number; + readonly Headers: string; + readonly PostData: any; + Processed: boolean; + readonly TargetFrameName: string; + readonly URL: string; + } + } +} + +interface ActiveXObject { + on( + obj: SHDocVw.InternetExplorer, event: 'BeforeNavigate2', argNames: SHDocVw.EventHelperTypes.InternetExplorer_BeforeNavigate2_ArgNames, + handler: (this: SHDocVw.InternetExplorer, parameter: SHDocVw.EventHelperTypes.InternetExplorer_BeforeNavigate2_Parameter) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'BeforeScriptExecute', argNames: ['pDispWindow'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly pDispWindow: any }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'ClientToHostWindow', argNames: ['CX', 'CY'], handler: (this: SHDocVw.InternetExplorer, parameter: { CX: number, CY: number }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'CommandStateChange', argNames: ['Command', 'Enable'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly Command: number, readonly Enable: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'DocumentComplete' | 'NavigateComplete2', argNames: ['pDisp', 'URL'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly pDisp: any, readonly URL: any }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'FileDownload', argNames: ['ActiveDocument', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly ActiveDocument: boolean, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'NavigateError', argNames: ['pDisp', 'URL', 'Frame', 'StatusCode', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly pDisp: any, readonly URL: any, readonly Frame: any, readonly StatusCode: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'NewProcess', argNames: ['lCauseFlag', 'pWB2', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly lCauseFlag: number, readonly pWB2: any, Cancel: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'NewWindow2', argNames: ['ppDisp', 'Cancel'], handler: (this: SHDocVw.InternetExplorer, parameter: { ppDisp: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'NewWindow3', argNames: ['ppDisp', 'Cancel', 'dwFlags', 'bstrUrlContext', 'bstrUrl'], + handler: (this: SHDocVw.InternetExplorer, parameter: { ppDisp: any, Cancel: boolean, readonly dwFlags: number, readonly bstrUrlContext: string, readonly bstrUrl: string }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'OnFullScreen', argNames: ['FullScreen'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly FullScreen: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'OnMenuBar', argNames: ['MenuBar'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly MenuBar: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'OnStatusBar', argNames: ['StatusBar'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly StatusBar: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'OnTheaterMode', argNames: ['TheaterMode'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly TheaterMode: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'OnToolBar', argNames: ['ToolBar'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly ToolBar: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'OnVisible', argNames: ['Visible'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly Visible: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'PrintTemplateInstantiation' | 'PrintTemplateTeardown', argNames: ['pDisp'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly pDisp: any }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'PrivacyImpactedStateChange', argNames: ['bImpacted'], handler: (this: SHDocVw.InternetExplorer, + parameter: { readonly bImpacted: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'ProgressChange', argNames: ['Progress', 'ProgressMax'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly Progress: number, readonly ProgressMax: number }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'PropertyChange', argNames: ['szProperty'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly szProperty: string }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'RedirectXDomainBlocked', argNames: ['pDisp', 'StartURL', 'RedirectURL', 'Frame', 'StatusCode'], + handler: (this: SHDocVw.InternetExplorer, parameter: { readonly pDisp: any, readonly StartURL: any, readonly RedirectURL: any, readonly Frame: any, readonly StatusCode: any }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'SetPhishingFilterStatus', argNames: ['PhishingFilterStatus'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly PhishingFilterStatus: number }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'SetSecureLockIcon', argNames: ['SecureLockIcon'], handler: (this: SHDocVw.InternetExplorer, + parameter: { readonly SecureLockIcon: number }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'StatusTextChange' | 'TitleChange', argNames: ['Text'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly Text: string }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'ThirdPartyUrlBlocked', argNames: ['URL', 'dwCount'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly URL: any, readonly dwCount: number }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'UpdatePageStatus', argNames: ['pDisp', 'nPage', 'fDone'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly pDisp: any, readonly nPage: any, readonly fDone: any }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'WebWorkerFinsihed', argNames: ['dwUniqueID'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly dwUniqueID: number }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'WebWorkerStarted', argNames: ['dwUniqueID', 'bstrWorkerLabel'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly dwUniqueID: number, readonly bstrWorkerLabel: string }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'WindowClosing', argNames: ['IsChildWindow', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly IsChildWindow: boolean, Cancel: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'WindowSetHeight', argNames: ['Height'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly Height: number }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'WindowSetLeft', argNames: ['Left'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly Left: number }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'WindowSetResizable', argNames: ['Resizable'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly Resizable: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'WindowSetTop', argNames: ['Top'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly Top: number }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'WindowSetWidth', argNames: ['Width'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly Width: number }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'WindowStateChanged', argNames: ['dwWindowStateFlags', 'dwValidFlagsMask'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly dwWindowStateFlags: number, readonly dwValidFlagsMask: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'BeforeNavigate2', argNames: SHDocVw.EventHelperTypes.InternetExplorerMedium_BeforeNavigate2_ArgNames, + handler: (this: SHDocVw.InternetExplorerMedium, parameter: SHDocVw.EventHelperTypes.InternetExplorerMedium_BeforeNavigate2_Parameter) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'BeforeScriptExecute', argNames: ['pDispWindow'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly pDispWindow: any }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'ClientToHostWindow', argNames: ['CX', 'CY'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { CX: number, CY: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'CommandStateChange', argNames: ['Command', 'Enable'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly Command: number, readonly Enable: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'DocumentComplete' | 'NavigateComplete2', argNames: ['pDisp', 'URL'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly pDisp: any, readonly URL: any }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'FileDownload', argNames: ['ActiveDocument', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly ActiveDocument: boolean, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'NavigateError', argNames: ['pDisp', 'URL', 'Frame', 'StatusCode', 'Cancel'], + handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly pDisp: any, readonly URL: any, readonly Frame: any, readonly StatusCode: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'NewProcess', argNames: ['lCauseFlag', 'pWB2', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly lCauseFlag: number, readonly pWB2: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'NewWindow2', argNames: ['ppDisp', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { ppDisp: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'NewWindow3', argNames: ['ppDisp', 'Cancel', 'dwFlags', 'bstrUrlContext', 'bstrUrl'], + handler: (this: SHDocVw.InternetExplorerMedium, parameter: { + ppDisp: any, Cancel: boolean, readonly dwFlags: number, readonly bstrUrlContext: string, + readonly bstrUrl: string + }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'OnFullScreen', argNames: ['FullScreen'], handler: (this: SHDocVw.InternetExplorerMedium, + parameter: { readonly FullScreen: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'OnMenuBar', argNames: ['MenuBar'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly MenuBar: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'OnStatusBar', argNames: ['StatusBar'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly StatusBar: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'OnTheaterMode', argNames: ['TheaterMode'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly TheaterMode: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'OnToolBar', argNames: ['ToolBar'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly ToolBar: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'OnVisible', argNames: ['Visible'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly Visible: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'PrintTemplateInstantiation' | 'PrintTemplateTeardown', argNames: ['pDisp'], + handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly pDisp: any }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'PrivacyImpactedStateChange', argNames: ['bImpacted'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly bImpacted: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'ProgressChange', argNames: ['Progress', 'ProgressMax'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly Progress: number, readonly ProgressMax: number }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'PropertyChange', argNames: ['szProperty'], handler: (this: SHDocVw.InternetExplorerMedium, + parameter: { readonly szProperty: string }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'RedirectXDomainBlocked', argNames: ['pDisp', 'StartURL', 'RedirectURL', 'Frame', 'StatusCode'], + handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly pDisp: any, readonly StartURL: any, readonly RedirectURL: any, readonly Frame: any, readonly StatusCode: any }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'SetPhishingFilterStatus', argNames: ['PhishingFilterStatus'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly PhishingFilterStatus: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'SetSecureLockIcon', argNames: ['SecureLockIcon'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly SecureLockIcon: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'StatusTextChange' | 'TitleChange', argNames: ['Text'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly Text: string }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'ThirdPartyUrlBlocked', argNames: ['URL', 'dwCount'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly URL: any, readonly dwCount: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'UpdatePageStatus', argNames: ['pDisp', 'nPage', 'fDone'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly pDisp: any, readonly nPage: any, readonly fDone: any }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'WebWorkerFinsihed', argNames: ['dwUniqueID'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly dwUniqueID: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'WebWorkerStarted', argNames: ['dwUniqueID', 'bstrWorkerLabel'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly dwUniqueID: number, readonly bstrWorkerLabel: string }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'WindowClosing', argNames: ['IsChildWindow', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly IsChildWindow: boolean, Cancel: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'WindowSetHeight', argNames: ['Height'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly Height: number }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'WindowSetLeft', argNames: ['Left'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly Left: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'WindowSetResizable', argNames: ['Resizable'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly Resizable: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'WindowSetTop', argNames: ['Top'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly Top: number }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'WindowSetWidth', argNames: ['Width'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly Width: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'WindowStateChanged', argNames: ['dwWindowStateFlags', 'dwValidFlagsMask'], + handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly dwWindowStateFlags: number, readonly dwValidFlagsMask: number }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'BeforeNavigate2', argNames: SHDocVw.EventHelperTypes.ShellBrowserWindow_BeforeNavigate2_ArgNames, + handler: (this: SHDocVw.ShellBrowserWindow, parameter: SHDocVw.EventHelperTypes.ShellBrowserWindow_BeforeNavigate2_Parameter) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'BeforeScriptExecute', argNames: ['pDispWindow'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly pDispWindow: any }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'ClientToHostWindow', argNames: ['CX', 'CY'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { CX: number, CY: number }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'CommandStateChange', argNames: ['Command', 'Enable'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly Command: number, readonly Enable: boolean }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'DocumentComplete' | 'NavigateComplete2', argNames: ['pDisp', 'URL'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly pDisp: any, readonly URL: any }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'FileDownload', argNames: ['ActiveDocument', 'Cancel'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly ActiveDocument: boolean, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'NavigateError', argNames: ['pDisp', 'URL', 'Frame', 'StatusCode', 'Cancel'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly pDisp: any, readonly URL: any, readonly Frame: any, readonly StatusCode: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'NewProcess', argNames: ['lCauseFlag', 'pWB2', 'Cancel'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly lCauseFlag: number, readonly pWB2: any, Cancel: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'NewWindow2', argNames: ['ppDisp', 'Cancel'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { ppDisp: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'NewWindow3', argNames: ['ppDisp', 'Cancel', 'dwFlags', 'bstrUrlContext', 'bstrUrl'], + handler: (this: SHDocVw.ShellBrowserWindow, parameter: { ppDisp: any, Cancel: boolean, readonly dwFlags: number, readonly bstrUrlContext: string, readonly bstrUrl: string }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'OnFullScreen', argNames: ['FullScreen'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly FullScreen: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'OnMenuBar', argNames: ['MenuBar'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly MenuBar: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'OnStatusBar', argNames: ['StatusBar'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly StatusBar: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'OnTheaterMode', argNames: ['TheaterMode'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly TheaterMode: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'OnToolBar', argNames: ['ToolBar'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly ToolBar: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'OnVisible', argNames: ['Visible'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly Visible: boolean }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'PrintTemplateInstantiation' | 'PrintTemplateTeardown', argNames: ['pDisp'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly pDisp: any }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'PrivacyImpactedStateChange', argNames: ['bImpacted'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly bImpacted: boolean }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'ProgressChange', argNames: ['Progress', 'ProgressMax'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly Progress: number, readonly ProgressMax: number }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'PropertyChange', argNames: ['szProperty'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly szProperty: string }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'RedirectXDomainBlocked', argNames: ['pDisp', 'StartURL', 'RedirectURL', 'Frame', 'StatusCode'], + handler: (this: SHDocVw.ShellBrowserWindow, parameter: { + readonly pDisp: any, readonly StartURL: any, readonly RedirectURL: any, readonly Frame: any, + readonly StatusCode: any + }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'SetPhishingFilterStatus', argNames: ['PhishingFilterStatus'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly PhishingFilterStatus: number }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'SetSecureLockIcon', argNames: ['SecureLockIcon'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly SecureLockIcon: number }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'StatusTextChange' | 'TitleChange', argNames: ['Text'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly Text: string }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'ThirdPartyUrlBlocked', argNames: ['URL', 'dwCount'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly URL: any, readonly dwCount: number }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'UpdatePageStatus', argNames: ['pDisp', 'nPage', 'fDone'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly pDisp: any, readonly nPage: any, readonly fDone: any }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'WebWorkerFinsihed', argNames: ['dwUniqueID'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly dwUniqueID: number }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'WebWorkerStarted', argNames: ['dwUniqueID', 'bstrWorkerLabel'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly dwUniqueID: number, readonly bstrWorkerLabel: string }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'WindowClosing', argNames: ['IsChildWindow', 'Cancel'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly IsChildWindow: boolean, Cancel: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'WindowSetHeight', argNames: ['Height'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly Height: number }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'WindowSetLeft', argNames: ['Left'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly Left: number }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'WindowSetResizable', argNames: ['Resizable'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly Resizable: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'WindowSetTop', argNames: ['Top'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly Top: number }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'WindowSetWidth', argNames: ['Width'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly Width: number }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'WindowStateChanged', argNames: ['dwWindowStateFlags', 'dwValidFlagsMask'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly dwWindowStateFlags: number, readonly dwValidFlagsMask: number }) => void): void; + on( + obj: SHDocVw.ShellNameSpace, event: 'FavoritesSelectionChange', argNames: SHDocVw.EventHelperTypes.ShellNameSpace_FavoritesSelectionChange_ArgNames, + handler: (this: SHDocVw.ShellNameSpace, parameter: SHDocVw.EventHelperTypes.ShellNameSpace_FavoritesSelectionChange_Parameter) => void): void; + on(obj: SHDocVw.ShellWindows, event: 'WindowRegistered' | 'WindowRevoked', argNames: ['lCookie'], handler: (this: SHDocVw.ShellWindows, parameter: { readonly lCookie: number }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'BeforeNavigate2', argNames: SHDocVw.EventHelperTypes.WebBrowser_BeforeNavigate2_ArgNames, handler: ( + this: SHDocVw.WebBrowser, parameter: SHDocVw.EventHelperTypes.WebBrowser_BeforeNavigate2_Parameter) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'BeforeScriptExecute', argNames: ['pDispWindow'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly pDispWindow: any }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'ClientToHostWindow', argNames: ['CX', 'CY'], handler: (this: SHDocVw.WebBrowser, parameter: { CX: number, CY: number }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'CommandStateChange', argNames: ['Command', 'Enable'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly Command: number, readonly Enable: boolean }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'DocumentComplete' | 'NavigateComplete2', argNames: ['pDisp', 'URL'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly pDisp: any, readonly URL: any }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'FileDownload', argNames: ['ActiveDocument', 'Cancel'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly ActiveDocument: boolean, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'NavigateError', argNames: ['pDisp', 'URL', 'Frame', 'StatusCode', 'Cancel'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly pDisp: any, readonly URL: any, readonly Frame: any, readonly StatusCode: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'NewProcess', argNames: ['lCauseFlag', 'pWB2', 'Cancel'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly lCauseFlag: number, readonly pWB2: any, Cancel: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'NewWindow2', argNames: ['ppDisp', 'Cancel'], handler: (this: SHDocVw.WebBrowser, parameter: { ppDisp: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'NewWindow3', argNames: ['ppDisp', 'Cancel', 'dwFlags', 'bstrUrlContext', 'bstrUrl'], handler: ( + this: SHDocVw.WebBrowser, parameter: { ppDisp: any, Cancel: boolean, readonly dwFlags: number, readonly bstrUrlContext: string, readonly bstrUrl: string }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'OnFullScreen', argNames: ['FullScreen'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly FullScreen: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'OnMenuBar', argNames: ['MenuBar'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly MenuBar: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'OnStatusBar', argNames: ['StatusBar'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly StatusBar: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'OnTheaterMode', argNames: ['TheaterMode'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly TheaterMode: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'OnToolBar', argNames: ['ToolBar'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly ToolBar: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'OnVisible', argNames: ['Visible'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly Visible: boolean }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'PrintTemplateInstantiation' | 'PrintTemplateTeardown', argNames: ['pDisp'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly pDisp: any }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'PrivacyImpactedStateChange', argNames: ['bImpacted'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly bImpacted: boolean }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'ProgressChange', argNames: ['Progress', 'ProgressMax'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly Progress: number, readonly ProgressMax: number }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'PropertyChange', argNames: ['szProperty'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly szProperty: string }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'RedirectXDomainBlocked', argNames: ['pDisp', 'StartURL', 'RedirectURL', 'Frame', 'StatusCode'], + handler: (this: SHDocVw.WebBrowser, parameter: { readonly pDisp: any, readonly StartURL: any, readonly RedirectURL: any, readonly Frame: any, readonly StatusCode: any }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'SetPhishingFilterStatus', argNames: ['PhishingFilterStatus'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly PhishingFilterStatus: number }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'SetSecureLockIcon', argNames: ['SecureLockIcon'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly SecureLockIcon: number }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'StatusTextChange' | 'TitleChange', argNames: ['Text'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly Text: string }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'ThirdPartyUrlBlocked', argNames: ['URL', 'dwCount'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly URL: any, readonly dwCount: number }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'UpdatePageStatus', argNames: ['pDisp', 'nPage', 'fDone'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly pDisp: any, readonly nPage: any, readonly fDone: any }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'WebWorkerFinsihed', argNames: ['dwUniqueID'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly dwUniqueID: number }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'WebWorkerStarted', argNames: ['dwUniqueID', 'bstrWorkerLabel'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly dwUniqueID: number, readonly bstrWorkerLabel: string }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'WindowClosing', argNames: ['IsChildWindow', 'Cancel'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly IsChildWindow: boolean, Cancel: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'WindowSetHeight', argNames: ['Height'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly Height: number }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'WindowSetLeft', argNames: ['Left'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly Left: number }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'WindowSetResizable', argNames: ['Resizable'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly Resizable: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'WindowSetTop', argNames: ['Top'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly Top: number }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'WindowSetWidth', argNames: ['Width'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly Width: number }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'WindowStateChanged', argNames: ['dwWindowStateFlags', 'dwValidFlagsMask'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly dwWindowStateFlags: number, readonly dwValidFlagsMask: number }) => void): void; + on( + obj: SHDocVw.WebBrowser_V1, event: 'BeforeNavigate', argNames: SHDocVw.EventHelperTypes.WebBrowser_V1_BeforeNavigate_ArgNames, + handler: (this: SHDocVw.WebBrowser_V1, parameter: SHDocVw.EventHelperTypes.WebBrowser_V1_BeforeNavigate_Parameter) => void): void; + on( + obj: SHDocVw.WebBrowser_V1, event: 'CommandStateChange', argNames: ['Command', 'Enable'], handler: ( + this: SHDocVw.WebBrowser_V1, parameter: { readonly Command: number, readonly Enable: boolean }) => void): void; + on( + obj: SHDocVw.WebBrowser_V1, event: 'FrameBeforeNavigate', argNames: SHDocVw.EventHelperTypes.WebBrowser_V1_FrameBeforeNavigate_ArgNames, + handler: (this: SHDocVw.WebBrowser_V1, parameter: SHDocVw.EventHelperTypes.WebBrowser_V1_FrameBeforeNavigate_Parameter) => void): void; + on(obj: SHDocVw.WebBrowser_V1, event: 'FrameNavigateComplete' | 'NavigateComplete', argNames: ['URL'], handler: (this: SHDocVw.WebBrowser_V1, parameter: { readonly URL: string }) => void): void; + on( + obj: SHDocVw.WebBrowser_V1, event: 'FrameNewWindow', argNames: SHDocVw.EventHelperTypes.WebBrowser_V1_FrameNewWindow_ArgNames, + handler: (this: SHDocVw.WebBrowser_V1, parameter: SHDocVw.EventHelperTypes.WebBrowser_V1_FrameNewWindow_Parameter) => void): void; + on( + obj: SHDocVw.WebBrowser_V1, event: 'NewWindow', argNames: SHDocVw.EventHelperTypes.WebBrowser_V1_NewWindow_ArgNames, handler: ( + this: SHDocVw.WebBrowser_V1, parameter: SHDocVw.EventHelperTypes.WebBrowser_V1_NewWindow_Parameter) => void): void; + on( + obj: SHDocVw.WebBrowser_V1, event: 'ProgressChange', argNames: ['Progress', 'ProgressMax'], handler: ( + this: SHDocVw.WebBrowser_V1, parameter: { readonly Progress: number, readonly ProgressMax: number }) => void): void; + on(obj: SHDocVw.WebBrowser_V1, event: 'PropertyChange', argNames: ['Property'], handler: (this: SHDocVw.WebBrowser_V1, parameter: { readonly Property: string }) => void): void; + on(obj: SHDocVw.WebBrowser_V1, event: 'Quit', argNames: ['Cancel'], handler: (this: SHDocVw.WebBrowser_V1, parameter: { Cancel: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser_V1, event: 'StatusTextChange' | 'TitleChange', argNames: ['Text'], handler: (this: SHDocVw.WebBrowser_V1, parameter: { readonly Text: string }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'DownloadBegin' | 'DownloadComplete' | 'OnQuit', handler: (this: SHDocVw.InternetExplorer, parameter: {}) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'DownloadBegin' | 'DownloadComplete' | 'OnQuit', handler: (this: SHDocVw.InternetExplorerMedium, parameter: {}) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'DownloadBegin' | 'DownloadComplete' | 'OnQuit', handler: (this: SHDocVw.ShellBrowserWindow, parameter: {}) => void): void; + on(obj: SHDocVw.ShellNameSpace, event: 'DoubleClick' | 'Initialized' | 'SelectionChange', handler: (this: SHDocVw.ShellNameSpace, parameter: {}) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'DownloadBegin' | 'DownloadComplete' | 'OnQuit', handler: (this: SHDocVw.WebBrowser, parameter: {}) => void): void; + on(obj: SHDocVw.WebBrowser_V1, event: 'DownloadBegin' | 'DownloadComplete' | 'WindowActivate' | 'WindowMove' | 'WindowResize', handler: (this: SHDocVw.WebBrowser_V1, parameter: {}) => void): void; + new (progid: K): ActiveXObjectNameMap[K]; +} + +interface ActiveXObjectNameMap { + 'InternetExplorer.Application': SHDocVw.InternetExplorer; + 'Shell.Explorer': SHDocVw.WebBrowser; + 'Shell.UIHelper': SHDocVw.ShellUIHelper; + 'ShellNameSpace.ShellNameSpace': SHDocVw.ShellNameSpace; +} + +interface EnumeratorConstructor { + new(col: SHDocVw.ShellWindows): Enumerator; +} diff --git a/types/activex-shdocvw/package.json b/types/activex-shdocvw/package.json new file mode 100644 index 0000000000..d9b1031263 --- /dev/null +++ b/types/activex-shdocvw/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "activex-helpers": "*" + } +} \ No newline at end of file diff --git a/types/xhr-mock/tsconfig.json b/types/activex-shdocvw/tsconfig.json similarity index 81% rename from types/xhr-mock/tsconfig.json rename to types/activex-shdocvw/tsconfig.json index f8246e1177..1759b6965f 100644 --- a/types/xhr-mock/tsconfig.json +++ b/types/activex-shdocvw/tsconfig.json @@ -1,10 +1,8 @@ + { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6", - "dom" - ], + "lib": ["es5", "scripthost"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, @@ -19,6 +17,6 @@ }, "files": [ "index.d.ts", - "xhr-mock-tests.ts" + "activex-shdocvw-tests.ts" ] } \ No newline at end of file diff --git a/types/activex-shdocvw/tslint.json b/types/activex-shdocvw/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/activex-shdocvw/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/activex-shell/activex-shell-tests.ts b/types/activex-shell/activex-shell-tests.ts new file mode 100644 index 0000000000..1a7e08754c --- /dev/null +++ b/types/activex-shell/activex-shell-tests.ts @@ -0,0 +1,489 @@ +/// + +const shell = new ActiveXObject('Shell.Application'); + +const getWindowsFolder = () => shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfWINDOWS); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537735(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + if (!folder) { return; } + const folderItem = folder.ParseName('system.ini'); + if (!folderItem) { return; } + shell.AddToRecent(folderItem.Path); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774065(v=vs.85).aspx +(() => { + const folder = shell.BrowseForFolder(0, 'Example', 0, Shell32.ShellSpecialFolderConstants.ssfWINDOWS); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537736(v=vs.85).aspx +const canStartStop = shell.CanStartStopService('service name'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774069(v=vs.85).aspx +shell.ControlPanelItem('desk.cpl'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774073(v=vs.85).aspx +shell.Explore('C:\\'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537737(v=vs.85).aspx +const explorerPolicy = shell.ExplorerPolicy('ValueName'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537739(v=vs.85).aspx +const settingValue = shell.GetSetting(Shell32.SettingKey.SSF_SHOWALLOBJECTS); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537740(v=vs.85).aspx +const processorLevel = shell.GetSystemInformation('ProcessorLevel'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537741(v=vs.85).aspx +const isRestricted = shell.IsRestricted('system', 'undockwithoutlogon'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537742(v=vs.85).aspx +const isServiceRunning = shell.IsServiceRunning('Themes'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774086(v=vs.85).aspx +shell.Open(Shell32.ShellSpecialFolderConstants.ssfWINDOWS); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537743(v=vs.85).aspx +shell.ServiceStart('Messenger', true); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537744(v=vs.85).aspx +shell.ServiceStop('Messenger', true); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537745(v=vs.85).aspx +shell.ShellExecute("notepad.exe", "", "", "open", Shell32.ShellExecuteShow.Normal); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537746(v=vs.85).aspx?cs-save-lang=1&cs-lang=jscript#code-snippet-1 +shell.ShowBrowserBar(Shell32.ExplorerBarCLSID.Favorites, true); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774107(v=vs.85).aspx +const wshShell = new ActiveXObject('WScript.Shell'); +wshShell.Popup(shell.Windows().Count); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787866(v=vs.85).aspx +shell.NameSpace(`c:\\windows`)!.CopyHere('c:\\autoexec.bat'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787870(v=vs.85).aspx +(() => { + const folder = shell.NameSpace('c:\\windows'); + const folderItem = folder ? folder.ParseName('clock.avi') : undefined; + if (folder && folderItem) { + const info = folder.GetDetailsOf(folderItem, Shell32.FileSystemDetails.Type); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787874(v=vs.85).aspx +shell.NameSpace('c:\\windows')!.MoveHere('c:\\temp.txt', Shell32.FileOperationFlag.FOF_NOCONFIRMATION); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787876(v=vs.85).aspx +shell.NameSpace('c:\\')!.NewFolder('TestFolder'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787858(v=vs.85).aspx +(() => { + const folder = shell.NameSpace("\\\\server\\share\\folder"); + const offlineStatus = folder ? folder.OfflineStatus : undefined; +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787880(v=vs.85).aspx +(() => { + const folder = shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfPROGRAMS); + WScript.Echo(folder!.ParentFolder.Title); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787860(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787816(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787850(v=vs.85).aspx +(() => { + const folder = shell.NameSpace('C:\\WINDOWS'); + const folderItem = folder ? folder.Self : undefined; + if (folderItem) { + const verbs = folderItem.Verbs(); + folderItem.InvokeVerb(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787812(v=vs.85).aspx +(() => { + const parentFolder = getWindowsFolder(); + const folderItem = parentFolder ? parentFolder.ParseName('system32') : undefined; + const folder = folderItem ? folderItem.GetFolder : undefined; +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787814(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787824(v=vs.85).aspx +(() => { + const folder = shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfPROGRAMS); + const folderItem = folder ? folder.ParseName('Internet Explorer.lnk') : undefined; + if (folderItem && folderItem.IsLink) { + const link = folderItem.GetLink; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787818(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787819(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787821(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItem = folder ? folder.Self : undefined; + if (folderItem) { + const isBrowsable = folderItem.IsBrowsable; + const isFileSystem = folderItem.IsFileSystem; + const isFolder = folderItem.IsFolder; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787825(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItem = folder!.ParseName('notepad.exe'); + if (folderItem) { + const oldDate = folderItem.ModifyDate; + folderItem.ModifyDate = new Date(1900, 1, 1, 18, 5).getVarDate(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787827(v=vs.85).aspx +(() => { + const rootFolder = shell.NameSpace('C:\\'); + const folderItem = rootFolder ? rootFolder.ParseName('autoexec.bat') : undefined; + if (folderItem) { + const oldName = folderItem.Name; + folderItem.Name = 'test.bat'; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787829(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItem = folder ? folder.Self : undefined; + const parent = folderItem ? folderItem.Parent : undefined; + if (parent) { + WScript.Echo('Got parent object'); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787844(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItem = folder ? folder.Self : undefined; + const path = folderItem ? folderItem.Path : ''; +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787846(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItem = folder!.ParseName('notepad.exe'); + const size = folderItem ? folderItem.Size : undefined; +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787848(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + if (folder) { + WScript.Echo(folder.Self.Type); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787798(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItems = folder ? folder.Items() : undefined; + const count = folderItems ? folderItems.Count : undefined; +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787794(v=vs.85).aspx +(() => { + const folder = shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfDRIVES); + if (folder) { + folder.Items().InvokeVerbEx(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774170(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774174(v=vs.85).aspx +(() => { + const folder = shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfPROGRAMS); + const verbs = folder ? folder.Self.Verbs() : undefined; + if (verbs) { + const verb = verbs.Item(0); + WScript.Echo(verb.Name); + verb.DoIt(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787787(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + if (folder) { + const folderItems = folder.Items(); + WScript.Echo(folderItems.Count); + folderItems.Filter(Shell32.ShellFolderEnumerationFlags.SHCONTF_NONFOLDERS, '*.txt'); + WScript.Echo(folderItems.Count); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787791(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774162(v=vs.85).aspx +(() => { + const echoFirstVerbName = (folder: Shell32.Folder3 | null) => { + if (!folder) { return; } + const verbs = folder.Items().Verbs; + WScript.Echo(verbs.Item(0).Name); + }; + + let folder = getWindowsFolder(); + echoFirstVerbName(folder); + + folder = shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfCONTROLS); + echoFirstVerbName(folder); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774158(v=vs.85).aspx +(() => { + const folder = shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfCONTROLS); + if (folder) { + const verbs = folder.Self.Verbs(); + WScript.Echo(verbs.Count); + } +})(); + +const getIELink = () => { + const folder = shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfPROGRAMS); + const folderItem = folder ? folder.ParseName('Internet Explorer.lnk') : undefined; + return { + link: folderItem ? folderItem.GetLink : undefined, + folderItem + }; +}; + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773990(v=vs.85).aspx +(() => { + const { link, folderItem } = getIELink(); + if (link && folderItem) { + WScript.Echo(link.GetIconLocation(folderItem.Path)); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773996(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + link.Resolve(Shell32.ShellLinkResolveFlags.NoUI); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773998(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + link.Description = 'New Description'; + link.Save(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774002(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + link.SetIconLocation(link.Path, 1); + link.Save(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773986(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + WScript.Echo(link.Arguments); + link.Arguments = '/s'; + link.Save(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773988(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + WScript.Echo(link.Description); + link.Description = 'Test'; + link.Save(); + } +})(); + +const parseHotkey = (hotkey: number) => { + // missing implementation + return { + shift: false, + ctrl: false, + alt: false, + extended: false, + hotkey + }; +}; +const buildHotkey = (hotkey: number, shift: boolean = false, ctrl: boolean = false, alt: boolean = false, extended: boolean = false) => { + // missing implementation + return 0; +}; + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773992(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + const { hotkey } = parseHotkey(link.Hotkey); + WScript.Echo(hotkey); + link.Hotkey = buildHotkey(4); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773994(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + WScript.Echo(link.Path); + link.Path = 'C:\\Program Files\\IE\\IEXPLORE.EXE'; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774006(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + WScript.Echo(link.ShowCommand); + link.ShowCommand = Shell32.LinkShowWindowState.Normal; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774008(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + WScript.Echo(link.WorkingDirectory); + link.WorkingDirectory = ''; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774115(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + const target = link.Target; + if (target) { + WScript.Echo(target.Size); + } + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774055(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItem = folder ? folder.ParseName('notepad.exe') : undefined; + if (folderItem) { + WScript.Echo(folderItem.ExtendedProperty('infotip')); + } + + const wordDoc = shell.NameSpace('C:\\')!.ParseName('test.doc'); + if (wordDoc) { + const FMTID_SummaryInfo = "{F29F85E0-4FF9-1068-AB91-08002B27B3D9}"; + const PID_TITLE = "2"; + const PID_AUTHOR = "4"; + const SCID_TITLE = `${FMTID_SummaryInfo} ${PID_TITLE}`; + const SCID_AUTHOR = `${FMTID_SummaryInfo} ${PID_AUTHOR}`; + const docTitle = wordDoc.ExtendedProperty(SCID_TITLE); + const docAuthor = wordDoc.ExtendedProperty(SCID_AUTHOR); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774057(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItem = folder ? folder.ParseName('notepad.exe') : undefined; + if (folderItem) { + folderItem.InvokeVerbEx("open", "c:\\autoexec.bat"); + } +})(); + +const collectionToArray = (col: any): T[] => { // tslint:disable-line no-unnecessary-generics + const results: T[] = []; + const enumerator = new Enumerator(col); + enumerator.moveFirst(); + while (!enumerator.atEnd()) { + results.push(enumerator.item()); + enumerator.moveNext(); + } + return results; +}; + +interface String { + endsWith(searchString: string, length?: number): boolean; +} +if (!String.prototype.endsWith) { + String.prototype.endsWith = function(search, this_len) { + if (this_len === undefined || this_len > this.length) { + this_len = this.length; + } + return this.substring(this_len - search.length, this_len) === search; + }; +} + +// shell.Windows() includes items other than Explorer windows, such as Internet Explorer tabs +const getExplorerWindows = () => + collectionToArray(shell.Windows()) + .filter(x => x.FullName.toLowerCase().endsWith('explorer.exe')); + +const getFolderViews = () => + getExplorerWindows() + .map(x => x.Document as Shell32.ShellFolderView); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774045(v=vs.85).aspx +(() => { + getFolderViews().forEach(x => + ActiveXObject.on(x, 'SelectionChanged', function(this: Shell32.ShellFolderView) { + WScript.Echo(`Selection change in ${this.Folder.Title} -- count: ${this.SelectedItems().Count}`); + }) + ); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773970(v=vs.85).aspx +WScript.Echo(shell.Windows().Item().Path); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773969(v=vs.85).aspx +WScript.Echo(shell.Windows().Count); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774043(v=vs.85).aspx +(() => { + getFolderViews().forEach(x => + WScript.Echo(`${x.Folder.Title} -- ${x.SelectedItems().Count} selected items`) + ); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774047(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774022(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774053(v=vs.85).aspx +(() => { + const folderView = getExplorerWindows()[0].Document as Shell32.ShellFolderView; + const folder = folderView.Folder; + if (folder) { + const folderItem = folder.Self; + folderView.SelectItem(folder.Self, Shell32.ShellFolderViewSelectItem.Focus); + } + WScript.Echo(folderView.ViewOptions); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774020(v=vs.85).aspx +(() => { + const folderView = getExplorerWindows()[0].Document as Shell32.ShellFolderView; + const focusedItem = folderView.FocusedItem; + if (focusedItem) { + WScript.Echo(`Focused item in first Excplorer window -- ${focusedItem.Path}`); + } +})(); + +(() => { + const router = new ActiveXObject('Shell.FolderView'); + const folder = getFolderViews()[0]; + router.SetFolderView(folder); + ActiveXObject.on(router, 'EnumDone', () => WScript.Echo('Current folder view was finisehd enumerating')); + ActiveXObject.on(router, 'SelectionChanged', () => WScript.Echo('Selection changed in current folder view')); + // the folder view monitored by the ShellFolderViewOC object can be changed via SetFolderView without disconnecting and reconnecting the handlers +})(); diff --git a/types/activex-shell/index.d.ts b/types/activex-shell/index.d.ts new file mode 100644 index 0000000000..cb59a11c5e --- /dev/null +++ b/types/activex-shell/index.d.ts @@ -0,0 +1,1016 @@ +// Type definitions for Microsoft Shell Controls And Automation - Shell32 1.0 +// Project: https://msdn.microsoft.com/en-us/library/windows/desktop/bb773938(v=vs.85).aspx +// Definitions by: Zev Spitz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/// + +declare namespace Shell32 { + // tslint:disable-next-line no-const-enum + const enum BrowseInfoFlags { + /** + * Allow folder junctions such as a library or a compressed file with a .zip file name extension to be browsed. + * + * _Windows 7 and later._ + */ + BIF_BROWSEFILEJUNCTIONS = 0x00010000, + + /** Only return computers. If the user selects anything other than a computer, the **OK** button is grayed. */ + BIF_BROWSEFORCOMPUTER = 0x00001000, + + /** + * Only allow the selection of printers. If the user selects anything other than a printer, the **OK** button is grayed. + * + * In Windows XP and later systems, the best practice is to use a Windows XP-style dialog, setting the root of the dialog to the **Printers and Faxes** folder (`CSIDL_PRINTERS`). + */ + BIF_BROWSEFORPRINTER = 0x00002000, + + /** + * The browse dialog box displays files as well as folders. + * + * _[Version 4.7.1](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_BROWSEINCLUDEFILES = 0x00004000, + + /** + * The browse dialog box can display URLs. The `BIF_USENEWUI` and `BIF_BROWSEINCLUDEFILES` flags must also be set. If any of these three flags are not set, the browser dialog box rejects URLs. + * Even when these flags are set, the browse dialog box displays URLs only if the folder that contains the selected item supports URLs. + * + * When the folder's [IShellFolder::GetAttributesOf](https://msdn.microsoft.com/en-us/library/windows/desktop/bb775068.aspx) method is called to request the selected item's attributes, the + * folder must set the `SFGAO_FOLDER` attribute flag. Otherwise, the browse dialog box will not display the URL. + * + * _[Version 5.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_BROWSEINCLUDEURLS = 0x00000080, + + /** Do not include network folders below the domain level in the dialog box's tree view control. */ + BIF_DONTGOBELOWDOMAIN = 0x00000002, + + /** + * Include an edit control in the browse dialog box that allows the user to type the name of an item. + * + * _[Version 4.7.1](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_EDITBOX = 0x00000010, + + /** + * Use the new user interface. Setting this flag provides the user with a larger dialog box that can be resized. The dialog box has several new capabilities, including: drag-and-drop + * capability within the dialog box, reordering, shortcut menus, new folders, delete, and other shortcut menu commands. + * + * _[Version 5.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_NEWDIALOGSTYLE = 0x00000040, + + /** + * Do not include the **New Folder** button in the browse dialog box. + * + * _[Version 6.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_NONEWFOLDERBUTTON = 0x00000200, + + /** + * When the selected item is a shortcut, return the PIDL of the shortcut itself rather than its target. + * + * _[Version 6.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_NOTRANSLATETARGETS = 0x00000400, + + /** + * Only return file system ancestors. An ancestor is a subfolder that is beneath the root folder in the namespace hierarchy. If the user selects an ancestor of the root folder that is not + * part of the file system, the **OK** button is grayed. + */ + BIF_RETURNFSANCESTORS = 0x00000008, + + /** + * Only return file system directories. If the user selects folders that are not part of the file system, the **OK** button is grayed. + * + * **Note** The **OK** button remains enabled for `\\server` items, as well as `\\server\share` and directory items. However, if the user selects a `\\server` item, passing the PIDL + * returned by [SHBrowseForFolder](https://msdn.microsoft.com/en-us/library/windows/desktop/bb762115.aspx) to + * [SHGetPathFromIDList](https://msdn.microsoft.com/en-us/library/windows/desktop/bb762194.aspx) fails. + */ + BIF_RETURNONLYFSDIRS = 0x00000001, + + /** + * The browse dialog box can display sharable resources on remote systems. This is intended for applications that want to expose remote shares on a local system. The BIF_NEWDIALOGSTYLE flag + * must also be set. + * + * _[Version 5.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_SHAREABLE = 0x00008000, + + /** + * Include a status area in the dialog box. The callback function can set the status text by sending messages to the dialog box. This flag is not supported when BIF_NEWDIALOGSTYLE + * is specified. + */ + BIF_STATUSTEXT = 0x00000004, + + /** + * When combined with `BIF_NEWDIALOGSTYLE`, adds a usage hint to the dialog box, in place of the edit box. `BIF_EDITBOX` overrides this flag. + * + * _[Version 6.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_UAHINT = 0x00000100, + + /** + * Use the new user interface, including an edit box. This flag is equivalent to `BIF_EDITBOX | BIF_NEWDIALOGSTYLE`. + * + * _[Version 5.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_USENEWUI = 0x00000090, + + /** + * If the user types an invalid name into the edit box, the browse dialog box calls the application's + * [BrowseCallbackProc](https://msdn.microsoft.com/en-us/library/windows/desktop/bb762598.aspx) with the **BFFM_VALIDATEFAILED** message. This flag is ignored if BIF_EDITBOX is not specified. + * + * _[Version 4.71](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779)_ + */ + BIF_VALIDATE = 0x00000020, + } + + // tslint:disable-next-line no-const-enum + const enum ExplorerBarCLSID { + Favorites = '{EFA24E61-B078-11d0-89E4-00C04FC9E26E}', + Folders = '{EFA24E64-B078-11d0-89E4-00C04FC9E26E}', + History = '{EFA24E62-B078-11d0-89E4-00C04FC9E26E}', + Search = '{30D02401-6A81-11d0-8274-00C04FD5AE38}', + } + + // tslint:disable-next-line no-const-enum + const enum FileOperationFlag { + /** Preserve undo information, if possible. */ + FOF_ALLOWUNDO = 64, + + /** Perform the operation on files only if a wildcard file name (*.*) is specified. */ + FOF_FILESONLY = 128, + + /** Respond with "Yes to All" for any dialog box that is displayed. */ + FOF_NOCONFIRMATION = 16, + + /** Do not confirm the creation of a new directory if the operation requires one to be created. */ + FOF_NOCONFIRMMKDIR = 512, + + /** + * Do not copy connected files as a group. Only copy the specified files. + * + * _[Version 5.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + FOF_NO_CONNECTED_ELEMENTS = 8192, + + /** + * Do not copy the security attributes of the file. + * + * _[Version 4.7.1](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + FOF_NOCOPYSECURITYATTRIBS = 2048, + + /** Do not display a user interface if an error occurs. */ + FOF_NOERRORUI = 1024, + + /** Only operate in the local directory. Do not operate recursively into subdirectories. */ + FOF_NORECURSION = 4096, + + /** Give the file being operated on a new name in a move, copy, or rename operation if a file with the target name already exists. */ + FOF_RENAMEONCOLLISION = 8, + + /** Do not display a progress dialog box. */ + FOF_SILENT = 4, + + /** Display a progress dialog box but do not show the file names. */ + FOF_SIMPLEPROGRESS = 256, + } + + // tslint:disable-next-line no-const-enum + const enum FileSystemDetails { + Name = 0, + Size = 1, + Type = 2, + LastModified = 3, + Attributes = 4, + InfoTip = -1, + } + + // tslint:disable-next-line no-const-enum + const enum HotkeyModifiers { + SHIFT = 1, + CTRL = 2, + ALT = 4, + Extended = 8 + } + + // tslint:disable-next-line no-const-enum + const enum LinkShowWindowState { + /** Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. */ + Normal = 1, + + /** Activates the window and displays it as a minimized window. */ + Minimized = 2, + + /** Activates the window and displays it as a maximized window. */ + Maximized = 3 + } + + /** Constants for Folder2.OfflineStatus */ + // tslint:disable-next-line no-const-enum + const enum OfflineFolderStatus { + OFS_DIRTYCACHE = 3, + OFS_INACTIVE = -1, + OFS_OFFLINE = 1, + OFS_ONLINE = 0, + OFS_SERVERBACK = 2, + } + + // tslint:disable-next-line no-const-enum + const enum ShellFolderEnumerationFlags { + /** **Windows 7 and later** The calling application is checking for the existence of child items in the folder. */ + SHCONTF_CHECKING_FOR_CHILDREN = 0x00010, + + /** Include items that are folders in the enumeration. */ + SHCONTF_FOLDERS = 0x00020, + + /** Include items that are not folders in the enumeration. */ + SHCONTF_NONFOLDERS = 0x00040, + + /** Include hidden items in the enumeration. This does not include hidden system items. (To include hidden system items, use SHCONTF_INCLUDESUPERHIDDEN.) */ + SHCONTF_INCLUDEHIDDEN = 0x00080, + + /** The calling application is looking for printer objects. */ + SHCONTF_NETPRINTERSRCH = 0x00200, + + /** The calling application is looking for resources that can be shared. */ + SHCONTF_SHAREABLE = 0x00400, + + /** Include items with accessible storage and their ancestors, including hidden items. */ + SHCONTF_STORAGE = 0x00800, + + /** **Windows 7 and later**. Child folders should provide a navigation enumeration. */ + SHCONTF_NAVIGATION_ENUM = 0x01000, + + /** **Windows Vista and later**. The calling application is looking for resources that can be enumerated quickly. */ + SHCONTF_FASTITEMS = 0x02000, + + /** **Windows Vista and later**. Enumerate items as a simple list even if the folder itself is not structured in that way. */ + SHCONTF_FLATLIST = 0x04000, + + /** + * **Windows Vista and later**. The calling application is monitoring for change notifications.This means that the enumerator does not have to return all results. + * Items can be reported through change notifications. + */ + SHCONTF_ENABLE_ASYNC = 0x08000, + + /** + * **Windows 7 and later**. Include hidden system items in the enumeration. This value does not include hidden non-system items. + * (To include hidden non-system items, use SHCONTF_INCLUDEHIDDEN.) + */ + SHCONTF_INCLUDESUPERHIDDEN = 0x10000, + } + + // tslint:disable-next-line no-const-enum + const enum ShellFolderViewOptions { + /** The **Show All Files** option is enabled. */ + SFVVO_SHOWALLOBJECTS = 0x00000001, + + /** The **Hide extensions for known file types** option is disabled. */ + SFVVO_SHOWEXTENSIONS = 0x00000002, + + /** The **Display Compressed Files and Folders with Alternate Color** option is enabled. */ + SFVVO_SHOWCOMPCOLOR = 0x00000008, + + /** The **Do Not Show Hidden Files** option is enabled. */ + SFVVO_SHOWSYSFILES = 0x00000020, + + /** The **Classic Style** option is enabled. */ + SFVVO_WIN95CLASSIC = 0x00000040, + + /** The **Double-Click to Open an Item** option is enabled. */ + SFVVO_DOUBLECLICKINWEBVIEW = 0x00000080, + + /** The **Active Desktop – View as Web Page** option is enabled. */ + SFVVO_DESKTOPHTML = 0x00000200 + } + + // tslint:disable-next-line no-const-enum + const enum ShellFolderViewSelectItem { + Deselect = 0, + Select = 1, + EditMode = 3, + DeselectAllButThis = 4, + ScrollIntoView = 8, + Focus = 16 + } + + // tslint:disable-next-line no-const-enum + const enum ShellLinkResolveFlags { + /** + * Do not display a dialog box if the link cannot be resolved. When this flag is set, the high-order word of _fFlags_ specifies a time-out duration, in milliseconds. + * The method returns if the link cannot be resolved within the time-out duration. If the high-order word is set to zero, the time-out duration defaults to 3000 milliseconds (3 seconds). + */ + NoUI = 1, + + /** If the link has changed, update its path and list of identifiers. */ + Update = 4, + + /** Do not update the link information. */ + NoUpdate = 8, + + /** Do not execute the search heuristics. */ + NoSearch = 16, + + /** Do not use distributed link tracking. */ + NoTrack = 32, + + /** + * Disable distributed link tracking. By default, distributed link tracking tracks removable media across multiple devices based on the volume name. + * It also uses the UNC path to track remote file systems whose drive letter has changed. Setting this flag disables both types of tracking. + */ + NoLinkInfo = 64, + + /** Call the Windows Installer. */ + InvokeMSI = 128 + } + + // tslint:disable-next-line no-const-enum + const enum SettingKey { + /** + * The state of the **Use check boxes to select items** option. This option is enabled automatically when the system has a pen input device configured. + * + * _Windows Vista and later_ + */ + SSF_AUTOCHECKSELECT = 0x00800000, + + /** Not used. */ + SSF_DESKTOPHTML = 0x00000200, + + /** The state of the **Allow all uppercase names** option. As of Windows Vista, this folder option is no longer available. */ + SSF_DONTPRETTYPATH = 0x00000800, + + /** The state of the **Double-click to open an item (single-click to select)** option. */ + SSF_DOUBLECLICKINWEBVIEW = 0x00000080, + + /** Not used. */ + SSF_FILTER = 0x00010000, + + /** Not used. */ + SSF_HIDDENFILEEXTS = 0x00000004, + + /** The state of icon display in the Windows Explorer list view. If this option is active, no icons are displayed in the list view. */ + SSF_HIDEICONS = 0x00004000, + + /** + * The state of display name display in the Windows Explorer list view. If this option is active, icons are displayed in the list view, but display names are not. + * + * _Windows Vista and later_ + */ + SSF_ICONSONLY = 0x01000000, + + /** The state of the **Show map network drive button in toolbar** option. As of Windows Vista, this option is no longer available. */ + SSF_MAPNETDRVBUTTON = 0x00001000, + + /** The state of the Recycle Bin's **Display delete confirmation dialog** option. */ + SSF_NOCONFIRMRECYCLE = 0x00008000, + + /** The state of the **Automatically search for network folders and printers** option. As of Windows Vista, this option is no longer available. */ + SSF_NONETCRAWLING = 0x00100000, + + /** The state of the **Launch folder windows in a separate process** option. */ + SSF_SEPPROCESS = 0x00080000, + + /** Not used. */ + SSF_SERVERADMINUI = 0x00000004, + + /** The state of the **Hidden files and folders** option. */ + SSF_SHOWALLOBJECTS = 0x00000001, + + /** The state of the **Show File Attributes in Detail View** option. As of Windows Vista, this option is no longer available. */ + SSF_SHOWATTRIBCOL = 0x00000100, + + /** The state of the **Show encrypted or compressed NTFS files in color** option. */ + SSF_SHOWCOMPCOLOR = 0x00000008, + + /** The state of the **Hide extensions for known file types** option. */ + SSF_SHOWEXTENSIONS = 0x00000002, + + /** The state of the **Show pop-up description for folder and desktop items** option. */ + SSF_SHOWINFOTIP = 0x00002000, + + /** Not used. */ + SSF_SHOWSTARTPAGE = 0x00400000, + + /** The state of the **Hide protected operating system files** option. */ + SSF_SHOWSUPERHIDDEN = 0x00040000, + + /** + * The state of the **Hidden files and folders** option. In Windows Vista and later, this is equivalent to `SSF_SHOWALLOBJECTS`. In versions of Windows before Windows Vista, this value + * referred to the state of the **Do not show hidden files and folders** option. + */ + SSF_SHOWSYSFILES = 0x00000020, + + /** + * The state of the **Display file icon on thumbnails** option. If this option is active, a file type overlay is applied when a file supplies a thumbnail representation. + * + * _Windows Vista and later_ + */ + SSF_SHOWTYPEOVERLAY = 0x02000000, + + /** Not used. */ + SSF_SORTCOLUMNS = 0x00000010, + + /** The state of the Windows XP display option, which selects between the Windows XP style and the classic style. As of Windows Vista, this option is no longer available. */ + SSF_STARTPANELON = 0x00200000, + + /** The state of the **Display as a web view option**. As of Windows Vista, this option is no longer available. */ + SSF_WEBVIEW = 0x00020000, + + /** The state of the **Classic Style** option. As of Windows Vista, this option is no longer available. */ + SSF_WIN95CLASSIC = 0x00000400, + } + + // tslint:disable-next-line no-const-enum + const enum ShellExecuteShow { + /** Open the application with a hidden window. */ + Hidden = 0, + + /** Open the application with a normal window. If the window is minimized or maximized, the system restores it to its original size and position. */ + Normal = 1, + + /** Open the application with a minimized window. */ + Minimized = 2, + + /** Open the application with a maximized window. */ + Maximized = 3, + + /** Open the application with its window at its most recent size and position. The active window remains active. */ + Last = 4, + + /** Open the application with its window at its current size and position. */ + Current = 5, + + /** Open the application with a minimized window. The active window remains active. */ + MinimizedNotActivated = 7, + + /** Open the application with its window in the default state specified by the application. */ + Application = 10, + } + + /** Constants for Special Folders for open/Explore */ + // tslint:disable-next-line no-const-enum + const enum ShellSpecialFolderConstants { + ssfALTSTARTUP = 29, + ssfAPPDATA = 26, + ssfBITBUCKET = 10, + ssfCOMMONALTSTARTUP = 30, + ssfCOMMONAPPDATA = 35, + ssfCOMMONDESKTOPDIR = 25, + ssfCOMMONFAVORITES = 31, + ssfCOMMONPROGRAMS = 23, + ssfCOMMONSTARTMENU = 22, + ssfCOMMONSTARTUP = 24, + ssfCONTROLS = 3, + ssfCOOKIES = 33, + ssfDESKTOP = 0, + ssfDESKTOPDIRECTORY = 16, + ssfDRIVES = 17, + ssfFAVORITES = 6, + ssfFONTS = 20, + ssfHISTORY = 34, + ssfINTERNETCACHE = 32, + ssfLOCALAPPDATA = 28, + ssfMYPICTURES = 39, + ssfNETHOOD = 19, + ssfNETWORK = 18, + ssfPERSONAL = 5, + ssfPRINTERS = 4, + ssfPRINTHOOD = 27, + ssfPROFILE = 40, + ssfPROGRAMFILES = 38, + ssfPROGRAMFILESx86 = 48, + ssfPROGRAMS = 2, + ssfRECENT = 8, + ssfSENDTO = 9, + ssfSTARTMENU = 11, + ssfSTARTUP = 7, + ssfSYSTEM = 37, + ssfSYSTEMx86 = 41, + ssfTEMPLATES = 21, + ssfWINDOWS = 36, + } + + /** FileSearchBand Class */ + class FileSearchBand { + private 'Shell32.FileSearchBand_typekey': FileSearchBand; + private constructor(); + + /** Retrieve the file from which the search was restored. */ + readonly QueryFile: any; + + /** Get the search scope */ + readonly Scope: any; + + /** Retrieve the guid of the currently active search. */ + readonly SearchID: string; + + /** method SetFocus */ + SetFocus(): void; + + /** method SetSearchParameters */ + SetSearchParameters(pbstrSearchID: string, bNavToResults: boolean, pvarScope?: any, pvarQueryFile?: any): void; + } + + /** Definition of interface Folder version 3 */ + class Folder3 { + private 'Shell32.Folder3_typekey': Folder3; + private constructor(); + + /** Get Application object */ + readonly Application: any; + + /** Copy Items to this folder. */ + CopyHere(vItem: string | ShellFolderItem | FolderItems3, vOptions?: FileOperationFlag): void; + + /** Call this after the WebView barricade is dismissed by the user */ + DismissedWebViewBarricade(): void; + + /** + * Get the details about an item. + * @param vItem The item for which to retrieve the information. + * @param iColumn An integer value that specifies the information to be retrieved. The information available for an item depends on the folder in which it is displayed. This value + * corresponds to the zero-based column number that is displayed in a Shell view. + */ + GetDetailsOf(vItem: ShellFolderItem, iColumn: number): string; + + /** Should the WebView barricade be shown? */ + readonly HaveToShowWebViewBarricade: boolean; + + /** The collection of Items in folder */ + Items(): FolderItems3; + + /** Move Items to this folder. */ + MoveHere(vItem: string | ShellFolderItem | FolderItems3, vOptions?: FileOperationFlag): void; + + /** Create a new sub folder in this folder. */ + NewFolder(bName: string): void; + + /** Offline status of the server? */ + readonly OfflineStatus: OfflineFolderStatus; + + /** Get Parent object */ + readonly ParentFolder: Folder3; + + /** Parse the name to get an item. */ + ParseName(bName: string): ShellFolderItem | null; + + /** Folder's FolderItem interface */ + readonly Self: ShellFolderItem; + + /** Ask if the WebView barricade should be shown or not */ + ShowWebViewBarricade: boolean; + + /** Synchronize all offline files */ + Synchronize(): void; + + /** Get the display name for the window */ + readonly Title: string; + } + + /** Definition of interface FolderItems3 */ + class FolderItems3 { + private 'Shell32.FolderItems3_typekey': FolderItems3; + private constructor(); + + /** Get Application object */ + readonly Application: any; + + /** Get count of items in the folder */ + readonly Count: number; + + /** Set a wildcard filter to apply to the items returned */ + Filter(grfFlags: ShellFolderEnumerationFlags, bstrFileSpec: string): void; + + /** + * Executes a verb on a collection of `FolderItem` objects + * @param vVerb String that corresponds to the command to be executed. If no verb is specified, the default verb is executed. + * @param vArgs String with one or more arguments to the command specified by vVerb. The format of this string depends on the particular verb. + */ + InvokeVerbEx(vVerb?: string, vArgs?: string): void; + + /** Return the figure for the given index */ + Item(index?: any): ShellFolderItem; + + /** Get the list of verbs common to all the items */ + readonly Verbs: FolderItemVerbs; + } + + /** Definition of interface FolderItemVerb */ + class FolderItemVerb { + private 'Shell32.FolderItemVerb_typekey': FolderItemVerb; + private constructor(); + + /** Execute the verb */ + DoIt(): void; + + /** Get display name for item */ + readonly Name: string; + } + + /** Definition of interface FolderItemVerbs */ + class FolderItemVerbs { + private 'Shell32.FolderItemVerbs_typekey': FolderItemVerbs; + private constructor(); + + /** Get count of open folder windows */ + readonly Count: number; + + /** Return the specified verb */ + Item(index?: any): FolderItemVerb; + } + + /** Shell Object Type Information */ + class Shell { + private 'Shell32.Shell_typekey': Shell; + private constructor(); + + /** Add an object to the Recent Docuements */ + AddToRecent(varFile: string | null, bstrCategory?: string): void; + + /** Get Application object */ + readonly Application: any; + + /** Browse the name space for a Folder */ + BrowseForFolder(Hwnd: number, Title: string, Options: number | BrowseInfoFlags, RootFolder?: string | ShellSpecialFolderConstants): Folder3; + + /** Determine if the current user can start/stop the named service. */ + CanStartStopService(ServiceName: string): boolean; + + /** Cascade Windows */ + CascadeWindows(): void; + + /* + * Runs the specified Control Panel (*.cpl) application. If the application is already open, it will activate the running instance. + * + * **Note** As of Windows Vista, most Control Panel applications are Shell items and cannot be opened with this function. To open those Control Panel applications, pass the canonical name to + * `control.exe`. For example: + * + * `control.exe /name Microsoft.Personalization` + */ + ControlPanelItem(bstrDir: string): void; + + /** Eject the pc */ + EjectPC(): void; + + /** Explore a folder */ + Explore(vDir: string | ShellSpecialFolderConstants): void; + + /** + * Return explorer policy value + * + * The specified value name must be within the **HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer** subkey. + * If the value name does not exist then the method returns null. + */ + ExplorerPolicy(bstrPolicyName: string): any; + + /** Bring up the file run dialog box */ + FileRun(): void; + + /** Find a computer */ + FindComputer(): void; + + /** Find Files */ + FindFiles(): void; + + /** Find a Printer in the Directory Service */ + FindPrinter(Name?: string, location?: string, model?: string): void; + + /** Return shell global setting */ + GetSetting(lSetting: number | SettingKey): boolean; + + /** + * `DirectoryServiceAvailable` -- Returns **true** if the directory service is available + * + * `IsOS_DomainMember` -- Returns **true** if the computer is a member of a domain (_Windows XP and later_) + * + * `IsOS_Personal` -- Returns **true** if the operating system is Windows XP Home Edition (_Windows XP only_) + * + * `IsOS_Professional` -- Returns **true** if the operating system is Windows XP Professional Edition (_Windows XP only_) + */ + GetSystemInformation(Name: 'DirectoryServiceAvailable' | 'IsOS_DomainMember' | 'IsOS_Personal' | 'IsOS_Professional'): boolean; + + /** + * `DoubleClickTime` -- The double-click time, in milliseconds + * + * `PhysicalMemoryInstalled` -- The amount of physical memory installed, in bytes + * + * `ProcessorArchitecture` -- The processor architecture. For details, see the discussion of the **wProcessorArchitecture** member of the + * [`SYSTEM_INFO`](https://msdn.microsoft.com/en-us/library/windows/desktop/ms724958.aspx) structure + * + * `ProcessorLevel` -- The processor level. Returns 3, 4, or 5, for x386, x486, and Pentium-level processors, respectively (_Windows Vista and later_) + * + * `ProcessorSpeed` -- The processor speed, in megahertz (MHz) + */ + GetSystemInformation(Name: 'DoubleClickTime' | 'PhysicalMemoryInstalled' | 'ProcessorArchitecture' | 'ProcessorLevel' | 'ProcessorSpeed'): number; + + /** Display shell help */ + Help(): void; + + /** get restriction settings */ + IsRestricted(Group: string, Restriction: string): number; + + /** Determine if a service is running by name. */ + IsServiceRunning(ServiceName: string): any; + + /** Minimize all windows */ + MinimizeAll(): void; + + /** Get special folder from ShellSpecialFolderConstants */ + NameSpace(vDir: string | ShellSpecialFolderConstants): Folder3 | null; + + /** Open a folder */ + Open(vDir: string | ShellSpecialFolderConstants): void; + + /** Get Parent object */ + readonly Parent: any; + + /** Refresh the menu */ + RefreshMenu(): void; + + /** Immersive Search */ + SearchCommand(): void; + + /** + * Start a service by name, and optionally set it to autostart. + * + * The method returns `false` if the service has already been started. Before calling this method, you can call + * [Shell.IsServiceRunning](https://msdn.microsoft.com/en-us/library/windows/desktop/gg537742.aspx) to ascertain the status of the service. + */ + ServiceStart(ServiceName: string, Persistent?: boolean): boolean; + + /** + * Stop a service by name, and optionally disable autostart. + * + * The method returns `false` if the service has already been stopped. Before calling this method, you can call + * [Shell.IsServiceRunning](https://msdn.microsoft.com/en-us/library/windows/desktop/gg537742.aspx) to ascertain the status of the service. + */ + ServiceStop(ServiceName: string, Persistent?: boolean): boolean; + + /** Displays the **Date and Time Properties** dialog box. */ + SetTime(): void; + + /** + * Execute generic command + * @param sFile A string that contains the name of the file on which `ShellExecute` will perform the action specified by `vOperation`. + * @param [vArgs] A string that contains parameter values for the operation. + * @param [vDir] The fully qualified path of the directory that contains the file specified by `sFile`. If this parameter is not specified, the current working directory is used. + * @param [vOperation] The operation to be performed. This value is set to one of the verb strings that is supported by the file. If this parameter is not specified, the default operation is + * performed. + * @param [vShow] A recommendation as to how the application window should be displayed initially. The application can ignore this recommendation. + */ + ShellExecute(File: string, vArgs?: string, vDir?: string, vOperation?: string, vShow?: ShellExecuteShow): void; + + /** Show/Hide browser bar. */ + ShowBrowserBar(bstrClsid: ExplorerBarCLSID, bShow: boolean): any; + + /** Exit Windows */ + ShutdownWindows(): void; + + /** Tile windows horizontally */ + TileHorizontally(): void; + + /** Tile windows vertically */ + TileVertically(): void; + + /** Raise/lower the desktop */ + ToggleDesktop(): void; + + /** Displays the **Taskbar and Start Menu Properties** dialog box. */ + TrayProperties(): void; + + /** Undo Minimize All */ + UndoMinimizeALL(): void; + + /** The collection of open folder windows */ + Windows(): ShellWindows; + + /** Displays the **Windows Security** dialog box. */ + WindowsSecurity(): void; + + /** Displays your open windows in a 3D stack that you can flip through. */ + WindowSwitcher(): void; + } + + /** ShellDispatch Load in Shell Context */ + class ShellDispatchInproc { + private 'Shell32.ShellDispatchInproc_typekey': ShellDispatchInproc; + private constructor(); + } + + /** Shell Folder Item */ + class ShellFolderItem { + private 'Shell32.ShellFolderItem_typekey': ShellFolderItem; + private constructor(); + + /** Get Application object */ + readonly Application: any; + + /** Access an extended property */ + ExtendedProperty(bstrPropName: string): any; + + /** If item is a folder return folder object */ + readonly GetFolder: Folder3 | null; + + /** If item is link return link object */ + readonly GetLink: ShellLinkObject | null; + + /** + * Execute a command on the item. + * Must be one of the values returned by the item's `FolderItemVerb.Name` property. + * If no verb is specified, the default verb will be invoked. + */ + InvokeVerb(vVerb?: string): void; + + /** + * Extended version of InvokeVerb + * @param vVerb String that corresponds to the command to be executed. If no verb is specified, the default verb is executed. + * @param vArgs String with one or more arguments to the command specified by vVerb. The format of this string depends on the particular verb. + */ + InvokeVerbEx(vVerb?: string, vArgs?: string): void; + + /** Indicates if the item can be hosted inside a browser or Windows Explorer frame. */ + readonly IsBrowsable: boolean; + + /** Is the item a file system object? */ + readonly IsFileSystem: boolean; + + /** Is the item a Folder? */ + readonly IsFolder: boolean; + + /** Is the item a link? */ + readonly IsLink: boolean; + + /** Modification Date? */ + ModifyDate: VarDate; + + /** Get display name for item */ + Name: string; + + /** Get Parent object */ + readonly Parent: any; + + /** Get the pathname to the item */ + readonly Path: string; + + /** Size */ + readonly Size: number; + + /** Contains a string representation of the item's type */ + readonly Type: string; + + /** Get the list of verbs for the object */ + Verbs(): FolderItemVerbs; + } + + /** Shell Folder View Object */ + class ShellFolderView { + private 'Shell32.ShellFolderView_typekey': ShellFolderView; + private constructor(); + + /** Get Application object */ + readonly Application: any; + + /** Get Current View Mode */ + CurrentViewMode: number; + + /** Filter View */ + FilterView(bstrFilterText: string): void; + + /** The currently focused item in the folder */ + readonly FocusedItem: ShellFolderItem; + + /** Get the folder being viewed */ + readonly Folder: Folder3; + + /** Get Folder Flags */ + FolderFlags: number; + + /** Get Group By Column */ + GroupBy: string; + + /** Set Icon Size */ + IconSize: number; + + /** Show items menu and return command selected */ + PopupItemMenu(pfi: ShellFolderItem, vx?: any, vy?: any): string; + + /** The collection of Selected Items in folder */ + SelectedItems(): FolderItems3; + + /** Select the item */ + SelectItem(pvfi: ShellFolderItem, dwFlags: ShellFolderViewSelectItem): void; + + /** Select Item relative to the Current Item */ + SelectItemRelative(iRelative: number): void; + + /** Get Sorting Columns */ + SortColumns: string; + + /** Returns the view options for showing a folder. */ + readonly ViewOptions: ShellFolderViewOptions; + } + + /** + * The **ShellFolderView** object fires two events, **EnumDone** and **SelectionChanged**, that are typically handled by applications. However, some applications + * must handle events from a series of **ShellFolderView** objects. For example, an application might host a **WebBrowser** control that allows users to navigate through + * a series of folders. Each folder has its own **ShellFolderView** object with its associated events. Handling these events can be difficult. + * + * The **ShellFolderViewOC** object simplifies event handling for such scenarios. It allows applications to handle events for all ShellFolderView objects with a single + * pair of **ShellFolderViewOC** event handlers. Each time the user navigates to a new folder, the application passes the associated **ShellFolderView** object to the + * **ShellFolderViewOC** object by calling **SetFolderView**. Then, when an **EnumDone** or **SelectionChanged** event is fired, the **ShellFolderViewOC** object + * forwards the event to its own handler for processing. + */ + class ShellFolderViewOC { + private 'Shell32.ShellFolderViewOC_typekey': ShellFolderViewOC; + private constructor(); + + /** Set the ShellFolderView object to monitor events of. */ + SetFolderView(pdisp: ShellFolderView): void; + } + + /** Shell Link object */ + class ShellLinkObject { + private 'Shell32.ShellLinkObject_typekey': ShellLinkObject; + private constructor(); + + /** Arguments for the link */ + Arguments: string; + + /** Description of the link */ + Description: string; + + /** Get the IconLocation for the link */ + GetIconLocation(pbs: string): number; + + /** Hotkey for the link */ + Hotkey: number; + + /** Fully qualified path of the link */ + Path: string; + + /** Tell the link to resolve itself */ + Resolve(fFlags: ShellLinkResolveFlags): void; + + /** + * Tell the link to save the changes + * @param sFile The fully qualified path of the file where the new link information is to be saved. If no file is specified, the current file is used. + */ + Save(vWhere?: string): void; + + /** + * Set the IconLocation for the link + * @param sPath The fully qualified path of the file that contains the icon. + * @param iIcon The index of the icon in the file specified by _sPath_. + */ + SetIconLocation(sPath: string, iIcon: number): void; + + /** Get the Show Command for the link */ + ShowCommand: LinkShowWindowState; + + /** Get the target of a link object */ + readonly Target: ShellFolderItem | null; + + /** Get the working directory for the link */ + WorkingDirectory: string; + } + + class ShellWindows { + private 'Shell32.ShellWindows_typekey': ShellWindows; + private constructor(); + + /** + * Retrieves an InternetExplorer object that represents the Shell window. + * @param index Default is 0 + */ + Item(index?: number): SHDocVw.InternetExplorer; + + /** Contains the number of items in the collection. */ + readonly Count: number; + } +} + +interface ActiveXObject { + on( + obj: Shell32.ShellFolderView, event: 'BeginDrag' | 'DefaultVerbInvoked' | 'EnumDone' | 'SelectionChanged' | 'VerbInvoked', handler: ( + this: Shell32.ShellFolderView, parameter: {}) => void): void; + on( + obj: Shell32.ShellFolderViewOC, event: 'BeginDrag' | 'DefaultVerbInvoked' | 'EnumDone' | 'SelectionChanged' | 'VerbInvoked', + handler: (this: Shell32.ShellFolderViewOC, parameter: {}) => void): void; + new (progid: K): ActiveXObjectNameMap[K]; +} + +interface ActiveXObjectNameMap { + 'Shell.Application': Shell32.Shell; + 'Shell.FolderView': Shell32.ShellFolderViewOC; +} + +interface EnumeratorConstructor { + new(col: Shell32.FolderItems3): Enumerator; + new(col: Shell32.FolderItemVerbs): Enumerator; + new(col: Shell32.ShellWindows): Enumerator; +} diff --git a/types/activex-shell/package.json b/types/activex-shell/package.json new file mode 100644 index 0000000000..d9b1031263 --- /dev/null +++ b/types/activex-shell/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "activex-helpers": "*" + } +} \ No newline at end of file diff --git a/types/ably/tsconfig.json b/types/activex-shell/tsconfig.json similarity index 85% rename from types/ably/tsconfig.json rename to types/activex-shell/tsconfig.json index 844463ce68..97b3ee81cb 100644 --- a/types/ably/tsconfig.json +++ b/types/activex-shell/tsconfig.json @@ -1,9 +1,8 @@ + { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6" - ], + "lib": ["es5", "scripthost"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, @@ -18,6 +17,6 @@ }, "files": [ "index.d.ts", - "ably-tests.ts" + "activex-shell-tests.ts" ] } \ No newline at end of file diff --git a/types/activex-shell/tslint.json b/types/activex-shell/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/activex-shell/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/activex-stdole/tsconfig.json b/types/activex-stdole/tsconfig.json index cbe3ce7aae..d96d7fd4dc 100644 --- a/types/activex-stdole/tsconfig.json +++ b/types/activex-stdole/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/activex-stdole/tslint.json b/types/activex-stdole/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-stdole/tslint.json +++ b/types/activex-stdole/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-vbide/tsconfig.json b/types/activex-vbide/tsconfig.json index 6fb205a3c4..504d5c01b2 100644 --- a/types/activex-vbide/tsconfig.json +++ b/types/activex-vbide/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/activex-vbide/tslint.json b/types/activex-vbide/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-vbide/tslint.json +++ b/types/activex-vbide/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-wia/tsconfig.json b/types/activex-wia/tsconfig.json index e77b3d1b66..b1b82a2134 100644 --- a/types/activex-wia/tsconfig.json +++ b/types/activex-wia/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/activex-wia/tslint.json b/types/activex-wia/tslint.json index 2750cc0197..3224b40b8b 100644 --- a/types/activex-wia/tslint.json +++ b/types/activex-wia/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } \ No newline at end of file +{ + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } +} diff --git a/types/activex-word/tsconfig.json b/types/activex-word/tsconfig.json index c62626ca52..e220df56dc 100644 --- a/types/activex-word/tsconfig.json +++ b/types/activex-word/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/activex-word/tslint.json b/types/activex-word/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-word/tslint.json +++ b/types/activex-word/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/adal-angular/tsconfig.json b/types/adal-angular/tsconfig.json index 9052e3fc04..b7adaf8e3c 100644 --- a/types/adal-angular/tsconfig.json +++ b/types/adal-angular/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/add-zero/tsconfig.json b/types/add-zero/tsconfig.json index e71d235cdf..bb76d7ed20 100644 --- a/types/add-zero/tsconfig.json +++ b/types/add-zero/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "add-zero-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/add2home/tsconfig.json b/types/add2home/tsconfig.json index 904e5e7453..d32b9dc570 100644 --- a/types/add2home/tsconfig.json +++ b/types/add2home/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/adm-zip/tsconfig.json b/types/adm-zip/tsconfig.json index 8e998c6f38..da3abd8503 100644 --- a/types/adm-zip/tsconfig.json +++ b/types/adm-zip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/adone/adone.d.ts b/types/adone/adone.d.ts index 34540761b5..0d6e3255ee 100644 --- a/types/adone/adone.d.ts +++ b/types/adone/adone.d.ts @@ -110,6 +110,8 @@ declare namespace adone { export function require(path: string): object; export const package: object; + export function sprintf(format: string, ...args: any[]): string; + namespace I { interface Runtime { term: object; // TODO diff --git a/types/adone/glosses/application.d.ts b/types/adone/glosses/application.d.ts index 6b2b783d68..4c9661843a 100644 --- a/types/adone/glosses/application.d.ts +++ b/types/adone/glosses/application.d.ts @@ -1,5 +1,275 @@ declare namespace adone { namespace application { - function run(app: object, ignoreArgs?: boolean): Promise; + namespace I { + type ArgumentType = ((x: string, index: number) => any) | RegExp; + + interface ArgumentInfo { + name: string | string[]; + action?: "store" + | "store_const" + | "store_true" + | "store_false" + | "append" + | "count" + | "set"; + nargs?: number | "+" | "*" | "?" + type?: ArgumentType | ArgumentType[]; + verify?: (args: any, opts: any) => boolean; // TODO + required?: boolean; + description?: string; + help?: string; + holder?: string | string[]; + appendDefaultMessage?: boolean; + appendChoicesHelpMessage?: boolean; + default?: any; + enabled?: boolean; + } + + interface Group { + name: string; + description?: string; + } + + interface MainCommandInfo { + arguments?: Array; + options?: Array; + description?: string; + optionsGroups?: Group[]; + blindMode?: boolean; + match?: (name: string) => boolean; + handler?: (args: object, opts: object) => void; + } + + interface CommandInfo extends MainCommandInfo { + name?: string | string[]; + group?: string; + } + + interface ApplicationInfo { + name?: string; + description?: string; + subsystems?: SubsystemInfo[]; + commandsGroups?: Group[] + } + + interface SubsystemInfo { + name: string; + description?: string; + subsystem: string; + transpile?: boolean; + group?: string; + } + } + + function DSubsystem(info?: I.ApplicationInfo): (...args: any[]) => void; + + function DApplication(info?: I.ApplicationInfo): (...args: any[]) => void; + + function DCliCommand(info?: I.CommandInfo): (...args: any[]) => void; + + function DMainCliCommand(info?: I.MainCommandInfo): (...args: any[]) => void; + + namespace I { + interface LoadSubsystemOptions { + name?: string, + description?: string, + group?: string, + transpile?: boolean + } + + interface CommonAddSubsystemInfo { + name?: string, + useFilename?: boolean + description?: string, + group?: string, + configureArgs?: any[] + transpile?: boolean, + bind?: boolean | string + } + + interface AddSubsystemInfo extends CommonAddSubsystemInfo { + subsystem: Subsystem | string, + } + + interface SysInfo { + name: string; + description: string; + group: string; + configureArgs: any[]; + instance: Subsystem; + path: string | null; + } + + interface SysInfoWithPath extends SysInfo { + path: string; + } + + interface SysInfoNoPath extends SysInfo { + path: null; + } + + interface AddSubsystemsFromOptions extends CommonAddSubsystemInfo { + filter?: string[] | ((file: string) => boolean | Promise) + } + } + + class Subsystem extends event.AsyncEmitter { + constructor(options?: { name?: string }); + + readonly name?: string; + + readonly root?: Subsystem; + + setRoot(root: Subsystem): void; + + readonly parent?: Subsystem; + + readonly state: number; + + readonly isOwned: boolean; + + setState(state: number): void; + + waitForState(expectedState: number, timeout?: number): Promise; + + configure(): void; + + initialize(): void; + + uninitialize(): void; + + configureSubsystems(): Promise; + + uninitializeSubsystems(): Promise; + + reinitializeSubsystems(): Promise; + + configureSubsystem(name: string): Promise; + + loadSubsystem(subsystem: string | Subsystem, options?: I.LoadSubsystemOptions): Promise; + + unloadSubsystem(name: string): Promise; + + initializeSubsystem(name: string): Promise; + + uninitializeSubsystem(name: string): Promise; + + reinitializeSubsystem(name: string): Promise; + + getSubsystem(name: string): Subsystem; + + hasSubsystem(name: string): boolean; + + hasSubsystems(): boolean; + + addSubsystem(info: I.AddSubsystemInfo & { subsystem: Subsystem }): I.SysInfoNoPath; + addSubsystem(info: I.AddSubsystemInfo & { subsystem: string }): I.SysInfoWithPath; + + addSubsystemsFrom(path: string, options?: I.AddSubsystemsFromOptions): I.SysInfoWithPath; + + instantiateSubsystem(subsystem: string | Subsystem, options?: { + transpile?: boolean + }): Subsystem; + + deleteSubsystem(name: string, force?: boolean): void; + + getSubsystemInfo(name: string): I.SysInfo; + + getSubsystems(): I.SysInfo[]; + } + + namespace I { + interface ReportOptions { + events?: string; + signal?: string; + filename?: string; + directory?: string; + } + } + + class Application extends Subsystem { + readonly isMain: boolean; + + main(): void; + + enableReport(opts?: I.ReportOptions): void; + + reportEnabled(): boolean; + + run(): Promise; + + exit(code?: number): Promise; + + exitOnSignal(...names: string[]): void; + + removeProcesshandlers(): void; + + _uncaughtException(err: any): void; + + _unhandledRejection(reson: any, p: Promise): void; + + _rejectionHandled(p: Promise): void; + + _signalExit(sigName: string): void; + + } + + namespace I { + interface Command { + // ? + } + + interface Argument { + // ? + } + + interface PositionalArgument extends Argument { + // ? + } + + interface OptionalArgument extends Argument { + // ? + } + + interface DefineCommandFromSubsystemOptions { + name?: string; + description?: string; + group?: string; + subsystem: string | Subsystem; + configureArgs?: any[]; + lazily?: boolean; + transpile?: boolean; + } + } + + class CliApplication extends Application { + run(options?: { ignoreArgs?: boolean }): Promise; + + getVersion(): Promise; + + exposeCliInterface(ctxId?: string): void; + + readonly mainCommand: I.Command; + + defineMainCommand(schema: I.MainCommandInfo): this; + + defineArguments(schema: I.MainCommandInfo): this; + + defineCommand(schema: I.CommandInfo): I.Command; + + defineCommandFromSubsystem(options?: I.DefineCommandFromSubsystemOptions): void; + + defineOption(schema: I.ArgumentInfo): void; + + defineOptionsGroup(schema: I.Group): void; + + defineCommandsGroup(schema: I.Group): void; + + option(path: string, options?: { value?: boolean }): any; + } + + function run(app: Application, ignoreArgs?: boolean): Promise; + + function runCli(app: CliApplication, ignoreArgs?: boolean): Promise; } } diff --git a/types/adone/glosses/archives.d.ts b/types/adone/glosses/archives.d.ts index 3f059ff14d..ddeb25d891 100644 --- a/types/adone/glosses/archives.d.ts +++ b/types/adone/glosses/archives.d.ts @@ -448,7 +448,7 @@ declare namespace adone { isCompressed(): boolean; } - interface ZipFile extends event.EventEmitter { + interface ZipFile extends event.Emitter { /** * true until close() is called; then it's false */ diff --git a/types/adone/glosses/assertion.d.ts b/types/adone/glosses/assertion.d.ts index e7ba662791..ca0d75bdf5 100644 --- a/types/adone/glosses/assertion.d.ts +++ b/types/adone/glosses/assertion.d.ts @@ -38,7 +38,7 @@ declare namespace adone { proxyExcludedKeys: string[]; } - type PossibleTypes = util.I.PossibleTypes | "array"; + type PossibleTypes = meta.I.PossibleTypes | "array"; type UseFunction = (fn: () => void) => assertion; @@ -53,18 +53,10 @@ declare namespace adone { * Throws an AssertionError, like node.js */ fail(actual?: any, expected?: any, message?: string, operator?: any): void; - /** - * Asserts that value is truthy - */ - isOk(value: any, message?: string): void; /** * Asserts that value is truthy */ ok(value: any, message?: string): void; - /** - * Asserts that value is falsy - */ - isNotOk(value: any, message?: string): void; /** * Asserts that value is falsy */ @@ -104,51 +96,51 @@ declare namespace adone { /** * Asserts that value > above */ - isAbove(value: any, above: any, message?: string): void; + above(value: any, above: any, message?: string): void; /** * Asserts that value >= atLeast */ - isAtLeast(value: any, atLeast: any, message?: string): void; + atLeast(value: any, atLeast: any, message?: string): void; /** * Asserts that value < below */ - isBelow(value: any, below: any, message?: string): void; + below(value: any, below: any, message?: string): void; /** * Asserts that value <= atMost */ - isAtMost(value: any, atMost: any, message?: string): void; + atMost(value: any, atMost: any, message?: string): void; /** * Asserts that value is true */ - isTrue(value: any, message?: string): void; + true(value: any, message?: string): void; /** * Asserts that value is not true */ - isNotTrue(value: any, message?: string): void; + notTrue(value: any, message?: string): void; /** * Asserts that value is false */ - isFalse(value: any, message?: string): void; + false(value: any, message?: string): void; /** * Asserts that value is not false */ - isNotFalse(value: any, message?: string): void; + notFalse(value: any, message?: string): void; /** * Asserts that value is null */ - isNull(value: any, message?: string): void; + null(value: any, message?: string): void; /** * Asserts that valus is not null */ - isNotNull(value: any, message?: string): void; + notNull(value: any, message?: string): void; /** * Asserts that value is NaN */ - isNaN(value: any, message?: string): void; + NaN(value: any, message?: string): void; /** * Asserts that value is not NaN */ - isNotNaN(value: any, message?: string): void; + NotNaN(value: any, message?: string): void; /** * Asserts that value is neither null nor undefined */ @@ -160,63 +152,63 @@ declare namespace adone { /** * Asserts that value is undefined */ - isUndefined(value: any, message?: string): void; + undefined(value: any, message?: string): void; /** * Asserts that value is not undefined */ - isDefined(value: any, message?: string): void; + defined(value: any, message?: string): void; /** * Asserts that value is a function */ - isFunction(value: any, message?: string): void; + function(value: any, message?: string): void; /** * Asserts that value is not a function */ - isNotFunction(value: any, message?: string): void; + notFunction(value: any, message?: string): void; /** * Asserts that value is an object of type Object */ - isObject(value: any, message?: string): void; + object(value: any, message?: string): void; /** * Asserts that value is not an object of type Object */ - isNotObject(value: any, message?: string): void; + notObject(value: any, message?: string): void; /** * Asserts that value is an array */ - isArray(value: any, message?: string): void; + array(value: any, message?: string): void; /** * Asserts that value is not an array */ - isNotArray(value: any, message?: string): void; + notArray(value: any, message?: string): void; /** * Asserts that value is a string */ - isString(value: any, message?: string): void; + string(value: any, message?: string): void; /** * Asserts that value is not a string */ - isNotString(value: any, message?: string): void; + notString(value: any, message?: string): void; /** * Asserts that value is a number */ - isNumber(value: any, message?: string): void; + number(value: any, message?: string): void; /** * Asserts that value is not a number */ - isNotNumber(value: any, message?: string): void; + notNumber(value: any, message?: string): void; /** * Asserts that value is a finite number */ - isFinite(value: any, message?: string): void; + finite(value: any, message?: string): void; /** * Asserts that value is a boolean */ - isBoolean(value: any, message?: string): void; + boolean(value: any, message?: string): void; /** * Asserts that value is not a boolean */ - isNotBoolean(value: any, message?: string): void; + notBoolean(value: any, message?: string): void; /** * Asserts that value's type is `type` */ @@ -562,66 +554,34 @@ declare namespace adone { * Throws an error if value is truthy */ ifError(value: any): void; - /** - * Asserts that object is extensible - */ - isExtensible(object: object, message?: string): void; /** * Asserts that object is extensible */ extensible(object: object, message?: string): void; - /** - * Asserts that object is not extensible - */ - isNotExtensible(object: object, message?: string): void; /** * Asserts that object is not extensible */ notExtensible(object: object, message?: string): void; - /** - * Asserts that object is sealed - */ - isSealed(object: object, message?: string): void; /** * Asserts that object is sealed */ sealed(object: object, message?: string): void; - /** - * Asserts that object is not sealed - */ - isNotSealed(object: object, message?: string): void; /** * Asserts that object is not sealed */ notSealed(object: object, message?: string): void; - /** - * Asserts that object is frozen - */ - isFrozen(object: object, message?: string): void; /** * Asserts that object is frozen */ frozen(object: object, message?: string): void; - /** - * Asserts that object is not frozen - */ - isNotFrozen(object: object, message?: string): void; /** * Asserts that object is not frozen */ notFrozen(object: object, message?: string): void; - /** - * Asserts that value is empty - */ - isEmpty(value: any, message?: string): void; /** * Asserts that value is empty */ empty(value: any, message?: string): void; - /** - * Asserts that value is not empty - */ - isNotEmpty(value: any, message?: string): void; /** * Asserts that value is not empty */ @@ -710,43 +670,43 @@ declare namespace adone { /** * Asserts that the target is non-strictly equal to true */ - ok: this; + ok(): this; /** * Asserts that the target is true */ - true: this; + true(): this; /** * Asserts that the target is false */ - false: this; + false(): this; /** * Asserts that the target is null */ - null: this; + null(): this; /** * Asserts that the target is undefined */ - undefined: this; + undefined(): this; /** * Asserts that the target is NaN */ - NaN: this; + NaN(): this; /** * Asserts that the target is neither null nor undefined */ - exist: this; + exist(): this; /** * Asserts that the target is empty */ - empty: this; + empty(): this; /** * Asserts that the target is an arguments object */ - arguments: this; + arguments(): this; /** * Asserts that the target is an arguments object */ - Arguments: this; + Arguments(): this; /** * Asserts that the target is strictly equal to value(===) */ @@ -976,26 +936,26 @@ declare namespace adone { /** * Asserts that the target is extensible */ - extensible: this; + extensible(): this; /** * Asserts that the target is sealed */ - sealed: this; + sealed(): this; /** * Asserts that the target is frozen */ - frozen: this; + frozen(): this; /** * Asserts that the target is a finite number */ - finite: this; + finite(): this; } interface MockAssertions extends Assertion { /** * Asserts that the spy has been called */ - called: this; + called(): this; /** * Asserts that the spy has been called n times */ @@ -1003,15 +963,15 @@ declare namespace adone { /** * Asserts that the spy has been called once */ - calledOnce: this; + calledOnce(): this; /** * Asserts that the spy has been called twice */ - calledTwice: this; + calledTwice(): this; /** * Asserts that the spy has been been called with `new` */ - calledThrice: this; + calledThrice(): this; /** * Asserts that the spy has been called before anotherSpy */ @@ -1059,7 +1019,7 @@ declare namespace adone { } } - class AssertionError extends x.Exception { + class AssertionError extends exception.Exception { constructor(message?: string, props?: object, ssf?: object) } diff --git a/types/adone/glosses/collections.d.ts b/types/adone/glosses/collections.d.ts deleted file mode 100644 index 178921136d..0000000000 --- a/types/adone/glosses/collections.d.ts +++ /dev/null @@ -1,1965 +0,0 @@ -declare namespace adone { - namespace collection { - namespace I.LinkedList { - /** - * Represents the node of a linked list - */ - interface Node { - /** - * The next node - */ - next?: Node; - - /** - * The previous node - */ - prev?: Node; - - /** - * The value this node contains - */ - value: T; - } - } - - /** - * Represents a linked list - */ - class LinkedList { - /** - * The maximum length of the list - */ - readonly maxLength: number; - - /** - * Current length of the list - */ - readonly length: number; - - /** - * Whether the list is autoresizable - */ - readonly autoresize: boolean; - - /** - * @param maxLength Maximum length of the linked list - */ - constructor(maxLength?: number); - - /** - * Whether the list is full - */ - readonly full: boolean; - - /** - * Whether the list is empty - */ - readonly empty: boolean; - - /** - * Resizes the list - */ - resize(newLength: number): this; - - /** - * Adds a new node to the end - * - * @returns Added node - */ - push(value: T): I.LinkedList.Node; - - /** - * Removes the last node, returns undefined if the list is empty - */ - pop(): T | undefined; - - /** - * Removes the first node, returns undefined if the list is empty - */ - shift(): T | undefined; - - /** - * Inserts a new node at the beginning of the list - * - * @returns Added node - */ - unshift(value: T): I.LinkedList.Node; - - /** - * Moves the given node to the end of the list - */ - pushNode(node: I.LinkedList.Node): void; - - /** - * Moved the given node to the beginning of the list - */ - unshiftNode(node: I.LinkedList.Node): void; - - /** - * Removes the given node from the list - */ - removeNode(node: I.LinkedList.Node): void; - - /** - * Clears the list - * - * @param strong Whether to reset all the node's values - */ - clear(strong?: boolean): void; - - /** - * Convers the list to an array - */ - toArray(): T[]; - - /** - * The first element of the list - */ - readonly front: T; - - /** - * The last element of the list - */ - readonly back: T; - - /** - * Returns an iterator over the list elements - */ - [Symbol.iterator](): IterableIterator; - - /** - * Returns the next node for the given node - */ - nextNode(node: I.LinkedList.Node): I.LinkedList.Node; - - /** - * Maps this linked list to a new one using the given function - */ - map(fn: (value: T, index: number) => R): LinkedList; - - /** - * Invokes the given callback for each value from the beginning to the end (much faster than for-of). - * If the given function returns false it stops iterating. - */ - forEach(callback: (value: T, index: number) => void | boolean): void; - - /** - * Default length of a new created linked list - */ - static DEFAULT_LENGTH: number; - } - - namespace I { - type Long = math.Long; - - type Longable = math.I.Longable; - - namespace ByteArray { - interface Varint32 { - value: number; - length: number; - } - - interface Varint64 { - value: Long; - length: number; - } - - interface String { - string: string; - length: number; - } - - type Wrappable = string | ByteArray | Buffer | Uint8Array | ArrayBuffer; - - type Metrics = "b" | "c"; - } - } - - /** - * Represents an array of bytes, enhanced Node.js Buffer - */ - class ByteArray { - /** - * Constructs a new ByteArray - * - * @param capacity Initial capacity. Defaults to ByteArray.DEFAULT_CAPACITY(64) - * @param noAssert Whether to skip assertions of offsets and values. Defaults to ByteArray.DEFAULT_NOASSERT(false) - */ - constructor(capacity?: number, noAssert?: boolean); - - /** - * Reads a BitSet as an array of booleans. - * - * @param offset Offset to read from. Will use and increase offset by length if omitted. - */ - readBitSet(offset?: number): boolean[]; - - /** - * Reads the specified number of bytes. - * - * @param length Number of bytes to read - * @param offset Offset to read from. Will use and increase offset by length if omitted. - */ - read(length: number, offset?: number): ByteArray; - - /** - * Reads an 8bit signed integer - * - * @param offset Offset to read from - */ - readInt8(offset?: number): number; - - /** - * Reads an 8bit unsigned integer - * - * @param offset Offset to read from - */ - readUInt8(offset?: number): number; - - /** - * Reads a 16bit signed le integer - * - * @param offset Offset to read from - */ - readInt16LE(offset?: number): number; - - /** - * Reads a 16bit unsigned le integer - * - * @param offset Offset to read from - */ - readUInt16LE(offset?: number): number; - - /** - * Reads a 16bit signed be integer - * - * @param offset Offset to read from - */ - readInt16BE(offset?: number): number; - - /** - * Reads a 16bit unsigned be integer - * - * @param offset Offset to read from - */ - readUInt16BE(offset?: number): number; - - /** - * Reads a 32bit signed le integer - * - * @param offset Offset to read from - */ - readInt32LE(offset?: number): number; - - /** - * Reads a 32bit unsigned le integer - * - * @param offset Offset to read from - */ - readUInt32LE(offset?: number): number; - - /** - * Reads a 32bit signed be integer - * - * @param offset Offset to read from - */ - readInt32BE(offset?: number): number; - - /** - * Reads a 32bit unsigned be integer - * - * @param offset Offset to read from - */ - readUInt32BE(offset?: number): number; - - /** - * Reads a 64bit signed le integer as math.Long - * - * @param offset Offset to read from - */ - readInt64LE(offset?: number): math.Long; - - /** - * Reads a 64bit unsigned le integer as math.Long - * - * @param offset Offset to read from - */ - readUInt64LE(offset?: number): math.Long; - - /** - * Reads a 64bit signed be integer as math.Long - * - * @param offset Offset to read from - */ - readInt64BE(offset?: number): math.Long; - - /** - * Reads a 64bit unsigned be integer as math.Long - * - * @param offset Offset to read from - */ - readUInt64BE(offset?: number): math.Long; - - /** - * Reads a 32bit le float - * - * @param offset Offset to read from - */ - readFloatLE(offset?: number): number; - - /** - * Reads a 32bit be float - * - * @param offset Offset to read from - */ - readFloatBE(offset?: number): number; - - /** - * Reads a 64bit le float - * - * @param offset Offset to read from - */ - readDoubleLE(offset?: number): number; - - /** - * Reads a 64bit be float - * - * @param offset Offset to read from - */ - readDoubleBE(offset?: number): number; - - /** - * Appends some data to this ByteArray. - * This will overwrite any contents behind the specified offset up to the appended data's length. - * - * @param source The source write from - * @param offset Offset to write to - * @param length length to read from the source - * @param encoding encoding to use for wrapping the source in bytearray - */ - write(source: I.ByteArray.Wrappable, offset?: number, length?: number, encoding?: string): this; - - /** - * Writes the array as a bitset. - * @param value Array of booleans to write - */ - writeBitSet(value: number[]): this; - - /** - * Writes the array as a bitset. - * @param value Array of booleans to write - * @param offset Offset to write to - */ - writeBitSet(value: number[], offset: number): number; - - /** - * Writes an 8bit signed integer - * - * @param offset Offset to write to - */ - writeInt8(value: number, offset?: number): this; - - /** - * Writes an 8bit unsigned integer - * - * @param offset Offset to write to - */ - writeUInt8(value: number, offset?: number): this; - - /** - * Writes a 16bit signed le integer - * - * @param offset Offset to write to - */ - writeInt16LE(value: number, offset?: number): this; - - /** - * Writes a 16bit signed be integer - * - * @param offset Offset to write to - */ - writeInt16BE(value: number, offset?: number): this; - - /** - * Writes a 16bit unsigned le integer - * - * @param offset Offset to write to - */ - writeUInt16LE(value: number, offset?: number): this; - - /** - * Writes a 16bit unsigned be integer - * - * @param offset Offset to write to - */ - writeUInt16BE(value: number, offset?: number): this; - - /** - * Writes a 32bit signed le integer - * - * @param offset Offset to write to - */ - writeInt32LE(value: number, offset?: number): this; - - /** - * Writes a 32bit signed be integer - * - * @param offset Offset to write to - */ - writeInt32BE(value: number, offset?: number): this; - - /** - * Writes a 32bit unsigned le integer - * - * @param offset Offset to write to - */ - writeUInt32LE(value: number, offset?: number): this; - - /** - * Writes a 32bit unsigned be integer - * - * @param offset Offset to write to - */ - writeUInt32BE(value: number, offset?: number): this; - - /** - * Writes a 64bit signed le long integer - * - * @param offset Offset to write to - */ - writeInt64LE(value: math.Long | string | number, offset?: number): this; - - /** - * Writes a 64bit signed be long integer - * - * @param offset Offset to write to - */ - writeInt64BE(value: math.Long | string | number, offset?: number): this; - - /** - * Writes a 64bit unsigned le long integer - * - * @param offset Offset to write to - */ - writeUInt64LE(value: math.Long | string | number, offset?: number): this; - - /** - * Writes a 64bit unsigned be long integer - * - * @param offset Offset to write to - */ - writeUInt64BE(value: math.Long | string | number, offset?: number): this; - - /** - * Writes a 32bit le float - * - * @param offset Offset to write to - */ - writeFloatLE(value: number, offset?: number): this; - - /** - * Writes a 32bit be float - * - * @param offset Offset to write to - */ - writeFloatBE(value: number, offset?: number): this; - - /** - * Writes a 64bit le float - * - * @param offset Offset to write to - */ - writeDoubleLE(value: number, offset?: number): this; - - /** - * Writes a 64bit be float - * - * @param offset Offset to write to - */ - writeDoubleBE(value: number, offset?: number): this; - - /** - * Writes a 32bit base 128 variable-length integer - */ - writeVarint32(value: number): this; - - /** - * Writes a 32bit base 128 variable-length integer - * - * @param offset Offset to write to - */ - writeVarint32(value: number, offset: number): number; - - /** - * Writes a zig-zag encoded 32bit base 128 variable-length integer - */ - writeVarint32ZigZag(value: number): this; - - /** - * Writes a zig-zag encoded 32bit base 128 variable-length integer - * - * @param offset Offset to write to - */ - writeVarint32ZigZag(value: number, offset: number): number; - - /** - * Reads a 32bit base 128 variable-length integer - */ - readVarint32(): number; - - /** - * Reads a 32bit base 128 variable-length integer - * - * @param offset Offset to read from - */ - readVarint32(offset: number): I.ByteArray.Varint32; - - /** - * Reads a zig-zag encoded 32bit base 128 variable-length integer - */ - readVarint32ZigZag(): number; - - /** - * Reads a zig-zag encoded 32bit base 128 variable-length integer - * - * @param offset Offset to read from - */ - readVarint32ZigZag(offset: number): I.ByteArray.Varint32; - - /** - * Writes a 64bit base 128 variable-length integer - */ - writeVarint64(value: math.Long | string | number): this; - - /** - * Writes a 64bit base 128 variable-length integer - * - * @param offset Offset to write to - */ - writeVarint64(value: math.Long | string | number, offset: number): number; - - /** - * Writes a zig-zag encoded 64bit base 128 variable-length integer - */ - writeVarint64ZigZag(value: math.Long | string | number): this; - - /** - * Writes a zig-zag encoded 64bit base 128 variable-length integer - * - * @param offset Offset to write to - */ - writeVarint64ZigZag(value: math.Long | string | number, offset: number): number; - - /** - * Reads a 64bit base 128 variable-length integer - */ - readVarint64(): I.Long; - - /** - * Reads a 64bit base 128 variable-length integer - * - * @param offset Offset to read from - */ - readVarint64(offset: number): I.ByteArray.Varint64; - - /** - * Reads a zig-zag encoded 64bit base 128 variable-length integer - */ - readVarint64ZigZag(): math.Long; - - /** - * Reads a zig-zag encoded 64bit base 128 variable-length integer - * - * @param offset Offset to read from - */ - readVarint64ZigZag(offset: number): I.ByteArray.Varint64; - - /** - * Writes a NULL-terminated UTF8 encoded string. - * For this to work the specified string must not contain any NULL characters itself - */ - writeCString(str: string): this; - - /** - * Writes a NULL-terminated UTF8 encoded string. - * For this to work the specified string must not contain any NULL characters itself - * - * @param offset Offset to write to - */ - writeCString(str: string, offset: number): number; - - /** - * Reads a NULL-terminated UTF8 encoded string. - * For this to work the string read must not contain any NULL characters itself - */ - readCString(): string; - - /** - * Reads a NULL-terminated UTF8 encoded string. - * For this to work the string read must not contain any NULL characters itself - * - * @param offset Offset to read from - */ - readCString(offset: number): I.ByteArray.String; - - /** - * Writes an UTF8 encoded string - */ - writeString(str: string): this; - - /** - * Writes an UTF8 encoded string - * - * @param offset Offset to write to - */ - writeString(str: string, offset: number): number; - - /** - * Reads an UTF8 encoded string - * - * @param length Number of characters or bytes to read - * @param metrics Metrics specifying what n is meant to count. Defaults to ByteArray.METRICS_CHARS("c") - */ - readString(length: number, metrics?: I.ByteArray.Metrics): string; - - /** - * Reads an UTF8 encoded string - * - * @param length Number of characters or bytes to read - * @param metrics Metrics specifying what n is meant to count. Defaults to ByteArray.METRICS_CHARS("c") - * @param offset Offset to read from - */ - readString(length: number, metrics: I.ByteArray.Metrics, offset: number): I.ByteArray.String; - - /** - * Reads an UTF8 encoded string - * - * @param length Number of characters or bytes to read - * @param offset Offset to read from - */ - readString(length: number, offset: number): I.ByteArray.String; - - /** - * Writes a length as varint32 prefixed UTF8 encoded string - */ - writeVString(str: string): this; - - /** - * Writes a length as varint32 prefixed UTF8 encoded string - * - * @param offset Offset to read from - */ - writeVString(str: string, offset: number): number; - - /** - * Reads a length as varint32 prefixed UTF8 encoded string - */ - readVString(): string; - - /** - * Reads a length as varint32 prefixed UTF8 encoded string - * - * @param offset Offset to read from - */ - readVString(offset: number): I.ByteArray.String; - - /** - * Appends this ByteArray's contents to another ByteArray. - * This will overwrite any contents behind the specified offset up to the length of this ByteArray's data - * - * @param offset Offset to append to - */ - appendTo(target: ByteArray, offset?: number): this; - - /** - * Enables or disables assertions of argument types and offsets. - * Assertions are enabled by default but you can opt to disable them if your code already makes sure that everything is valid - */ - assert(assert?: boolean): this; - - /** - * Gets the capacity of this ByteArray's backing buffer - */ - capacity(): number; - - /** - * Clears this ByteArray's offsets by setting offset to 0 and limit to the backing buffer's capacity - */ - clear(): this; - - /** - * Creates a cloned instance of this ByteArray, - * preset with this ByteArray's values for offset, markedOffset and limit - * - * @param copy Whether to copy the backing buffer or to return another view on the same, false by default - */ - clone(copy?: boolean): ByteArray; - - /** - * Compacts this ByteArray to be backed by a buffer of its contents' length. - * Will set offset = 0 and limit = capacity and adapt markedOffset to the same relative position if set - * - * @param begin Offset to start at, buffer offset by default - * @param end Offset to end at, buffer limit by default - */ - compact(begin?: number, end?: number): this; - - /** - * Creates a copy of this ByteArray's contents. - * - * @param begin Begin offset, buffer offset by default - * @param end End offset, buffer limit by default - */ - copy(begin?: number, end?: number): ByteArray; - - /** - * Copies this ByteArray's contents to another ByteArray. - * - * @param targetOffset Offset to copy to. Will use and increase the target's offset by the number of bytes copied if omitted - * @param sourceOffset Offset to start copying from. Will use and increase offset by the number of bytes copied if omitted - * @param sourceLimit Offset to end copying from, defaults to the buffer limit - */ - copyTo(target: ByteArray, targetOffset?: number, souceOffset?: number, sourceLimit?: number): this | ByteArray; - - /** - * Makes sure that this ByteArray is backed by a ByteArray#buffer of at least the specified capacity. - * If the current capacity is exceeded, it will be doubled. - * If double the current capacity is less than the required capacity, the required capacity will be used instead - */ - ensureCapacity(capacity: number): this; - - /** - * Overwrites this ByteArray's contents with the specified value. - * - * @param value Byte value to fill with. If given as a string, the first character is used - * @param begin Begin offset. Will use and increase offset by the number of bytes written if omitted. defaults to offset - * @param end End offset, defaults to limit. - */ - fill(value: string | number, begin?: number, end?: number): this; - - /** - * Makes this ByteArray ready for a new sequence of write or relative read operations. - * Sets limit = offset and offset = 0. - * Make sure always to flip a ByteArray when all relative read or write operations are complete - */ - flip(): this; - - /** - * Marks an offset on this ByteArray to be used later - * - * @param offset Offset to mark. Defaults to offset. - */ - mark(offset?: number): this; - - /** - * Prepends some data to this ByteArray. - * This will overwrite any contents before the specified offset up to the prepended data's length. - * If there is not enough space available before the specified offset, - * the backing buffer will be resized and its contents moved accordingly - * - * @param source Data to prepend - * @param offset Offset to prepend at. Will use and decrease offset by the number of bytes prepended if omitted. - */ - prepend(source: I.ByteArray.Wrappable, offset: number): this; - - /** - * Prepends some data to this ByteArray. - * This will overwrite any contents before the specified offset up to the prepended data's length. - * If there is not enough space available before the specified offset, - * the backing buffer will be resized and its contents moved accordingly - * - * @param source Data to prepend - * @param encoding Encoding if data is a string - * @param offset Offset to prepend at. Will use and decrease offset by the number of bytes prepended if omitted. - */ - prepend(source: I.ByteArray.Wrappable, encoding?: string, offset?: number): this; - - /** - * Prepends this ByteArray to another ByteArray. - * This will overwrite any contents before the specified offset up to the prepended data's length. - * If there is not enough space available before the specified offset, - * the backing buffer will be resized and its contents moved accordingly - * - * @param offset Offset to prepend at - */ - prependTo(target: ByteArray, offset?: number): this; - - /** - * Gets the number of remaining readable bytes - */ - remaining(): number; - - /** - * Resets this ByteArray's offset. - * If an offset has been marked through mark before, offset will be set to markedOffset, which will then be discarded. - * If no offset has been marked, sets offset = 0 - */ - reset(): this; - - /** - * Resizes this ByteArray to be backed by a buffer of at least the given capacity. - * Will do nothing if already that large or larger. - * - * @param capacity Capacity required - */ - resize(capacity: number): this; - - /** - * Reverses this ByteArray's contents. - * - * @param begin Offset to start at, defaults to offset - * @param end Offset to end at, defaults to limit - */ - reverse(begin?: number, end?: number): this; - - /** - * Skips the next length bytes. This will just advance - */ - skip(length: number): this; - - /** - * Slices this ByteArray by creating a cloned instance with offset = begin and limit = end - * - * @param begin Begin offset, defaults to offset - * @param end End offset, defaults to limit - */ - slice(begin?: number, end?: number): ByteArray; - - /** - * Returns a copy of the backing buffer that contains this ByteArray's contents. - * - * @param forceCopy If true returns a copy, otherwise returns a view referencing the same memory if possible, false by default - * @param begin Begin offset, offset by default - * @param end End offset, limit by default - */ - toBuffer(forceCopy?: boolean, begin?: number, end?: number): Buffer; - - /** - * Returns a raw buffer compacted to contain this ByteArray's contents - */ - toArrayBuffer(): ArrayBuffer; - - /** - * Converts the ByteArray's contents to a string - * - * @param encoding Output encoding - * @param begin Begin offset, offset by default - * @param end End offset, limit by default - */ - toString(encoding?: string, begin?: number, end?: number): string; - - /** - * Encodes this ByteArray's contents to a base64 encoded string - * - * @param begin Begin offset, offset by default - * @param end End offset, limit by default - */ - toBase64(begin?: number, end?: number): string; - - /** - * Encodes this ByteArray to a binary encoded string, that is using only characters 0x00-0xFF as bytes - * - * @param begin Begin offset, offset by default - * @param end End offset, limit by default - */ - toBinary(begin?: number, end?: number): string; - - /** - * Encodes this ByteArray to a hex encoded string with marked offsets - * - * @param columns If true returns two columns hex + ascii, defaults to false - */ - toDebug(columns?: boolean): string; - - /** - * Encodes this ByteArray's contents to a hex encoded string - * - * @param begin Begin offset, offset by default - * @param end End offset, limit by default - */ - toHex(begin?: number, end?: number): string; - - /** - * Encodes this ByteArray's contents to an UTF8 encoded string - * - * @param begin Begin offset, offset by default - * @param end End offset, limit by default - */ - toUTF8(begin?: number, end?: number): string; - - static accessor(): typeof Buffer; - - /** - * Allocates a new ByteArray backed by a buffer of the specified capacity. - * - * @param capacity Initial capacity. Defaults to ByteArray.DEFAULT_CAPACITY(64) - * @param noAssert Whether to skip assertions of offsets and values. Defaults to ByteArray.DEFAULT_NOASSERT(false) - */ - static allocate(capacity?: number, noAssert?: boolean): ByteArray; - - /** - * Concatenates multiple ByteArrays into one - * - * @param encoding Encoding for strings - * @param noAssert Whether to skip assertions of offsets and values. Defaults to ByteArray.DEFAULT_NOASSERT(false) - */ - static concat(buffers: I.ByteArray.Wrappable[], encoding?: string, noAssert?: boolean): ByteArray; - - static type(): typeof Buffer; - - /** - * Wraps a buffer or a string. - * Sets the allocated ByteArray's offset to 0 and its limit to the length of the wrapped data - * - * @param encoding Encoding for strings - * @param noAssert Whether to skip assertions of offsets and values. Defaults to ByteArray.DEFAULT_NOASSERT(false) - */ - static wrap(buffer: I.ByteArray.Wrappable, encoding?: string, noAssert?: boolean): ByteArray; - - /** - * Calculates the actual number of bytes required to store a 32bit base 128 variable-length integer - */ - static calculateVarint32(value: number): number; - - /** - * Zigzag encodes a signed 32bit integer so that it can be effectively used with varint encoding - */ - static zigZagEncode32(n: number): number; - - /** - * Decodes a zigzag encoded signed 32bit integer - */ - static zigZagDecode32(n: number): number; - - /** - * Calculates the actual number of bytes required to store a 64bit base 128 variable-length integer - */ - static calculateVarint64(value: number | string): number; - - /** - * Zigzag encodes a signed 64bit integer so that it can be effectively used with varint encoding - */ - static zigZagEncode64(value: number | string | I.Long): I.Long; - - /** - * Decodes a zigzag encoded signed 64bit integer. - */ - static zigZagDecode64(value: number | string | I.Long): I.Long; - - /** - * Calculates the number of UTF8 characters of a string. - * JavaScript itself uses UTF-16, - * so that a string's length property does not reflect its actual UTF8 size if it contains code points larger than 0xFFFF - */ - static calculateUTF8Chars(str: string): number; - - /** - * Calculates the number of UTF8 bytes of a string. - */ - static calculateString(str: string): number; - - /** - * Decodes a base64 encoded string to a ByteArray - */ - static fromBase64(str: string): ByteArray; - - /** - * Encodes a binary string to base64 like window.btoa does - */ - static btoa(str: string): string; - - /** - * Decodes a base64 encoded string to binary like window.atob does - */ - static atob(b64: string): string; - - /** - * Decodes a binary encoded string, that is using only characters 0x00-0xFF as bytes, to a ByteArray - */ - static fromBinary(str: string): ByteArray; - - /** - * Decodes a hex encoded string with marked offsets to a ByteArray - */ - static fromDebug(str: string, noAssert?: boolean): ByteArray; - - /** - * Decodes a hex encoded string to a ByteArray - */ - static fromHex(str: string, noAssert?: boolean): ByteArray; - - /** - * Decodes an UTF8 encoded string to a ByteArray - */ - static fromUTF8(str: string, noAssert?: boolean): ByteArray; - - /** - * Default initial capacity - */ - static DEFAULT_CAPACITY: number; - - /** - * Default no assertions flag - */ - static DEFAULT_NOASSERT: boolean; - - /** - * Maximum number of bytes required to store a 32bit base 128 variable-length integer - */ - static MAX_VARINT32_BYTES: number; - - /** - * Maximum number of bytes required to store a 64bit base 128 variable-length integer - */ - static MAX_VARINT64_BYTES: number; - - /** - * Metrics representing number of UTF8 characters. Evaluates to `c`. - */ - static METRICS_CHARS: string; - - /** - * Metrics representing number of bytes. Evaluates to `b`. - */ - static METRICS_BYTES: string; - } - - /** - * Represents a queue - */ - class Queue { - /** - * Whether the queue is full - */ - readonly full: boolean; - - /** - * The length of the queue - */ - readonly length: number; - - /** - * Whether the queue is empty - */ - readonly empty: boolean; - - /** - * Inserts a new element at the end - */ - push(x: S): this; - - /** - * Removes and returns an element from the beginning - */ - pop(): T | undefined; - } - - /** - * Represents an asynchronous queue, each pop is a promise - * that is resolved with an existing element or an element that will be pushed in the future - */ - class AsyncQueue extends Queue> { - /** - * Returns a promise that will be resolved with an existing element or an element that will be pushed in the future - */ - pop(): Promise; - } - - namespace I.PriorityQueue { - interface ConstructorOptions { - /** - * Function that compares objects. - * - * Must return a positive value if a > b, a negative if a < b, and zero for equal objects - */ - compare?(a: T, b: T): number; - - /** - * Function that evaluates the priority value by the given objects, - * if the returned value > 0, then the first argument has higher priority, - * = 0 same priority, < 0 lower priority. - * By default the top element is an element that has the highest priority, - * the default priority function is equal to the compare function - */ - priority?(a: T, b: T): number; - } - } - - /** - * Represents a priority queue - */ - class PriorityQueue { - /** - * Whether the queue is empty - */ - readonly empty: boolean; - - /** - * The length of the queue - */ - readonly length: number; - - constructor(options?: I.PriorityQueue.ConstructorOptions); - - /** - * Clones the queue - */ - clone(): PriorityQueue; - - /** - * Inserts a new element - */ - push(x: T): this; - - /** - * Removes the top element (that has the highest priority) - */ - pop(): T | undefined; - - /** - * Deletes the given element from the queue - */ - delete(x: T): this; - - /** - * Replaces the top element (pop + push) - */ - replace(x: T): T; - - /** - * Faster push + pop - */ - pushpop(x: T): T; - - /** - * Converts the queue to an array, it works with a clone of the queue, so the original queue is untouched - */ - toArray(): T[]; - - /** - * Creates a queue object from the given iterable - */ - static from(iterable: Iterable, options?: I.PriorityQueue.ConstructorOptions): PriorityQueue; - } - - /** - * Represents a faster LRU cache but with less functionality - */ - class FastLRU { - /** - * @param size Cache size, unlimited by default - */ - constructor(size?: number, options?: { - /** - * Function that is called when a value is deleted - */ - dispose?(key: K, value: V): void - }); - - /** - * The actual size of the cache - */ - readonly size: number; - - /** - * Gets the value by the given key - */ - get(key: K): V | undefined; - - /** - * Sets a new value for the given key - */ - set(key: K, value: V): void; - - /** - * Deletes the given key from the cache - */ - delete(key: K): boolean; - - /** - * Checks whether the cache has an element with the given key - */ - has(key: K): boolean; - - /** - * Returns the keys iterator - */ - keys(): IterableIterator; - - /** - * Returns the values iterator - */ - values(): IterableIterator; - - /** - * Returns the entries iterator - */ - entries(): IterableIterator<[K, V]>; - - /** - * Clears the cache - */ - clear(): void; - } - - /** - * Represents a stack - */ - class Stack { - /** - * Whether the stack is empty - */ - readonly empty: boolean; - - /** - * The top element of the stack - */ - readonly top: T; - - /** - * Inserts a new element - */ - push(x: T): this; - - /** - * Removes the top element - */ - pop(): T | undefined; - - /** - * Returns an iterator over the values - */ - [Symbol.iterator](): IterableIterator; - - /** - * Creates a stack and pushed all the values from the given iterable object - */ - static from(iterable: Iterable): Stack; - } - - namespace I.BinarySearchTree { - interface ConstructorOptions { - /** - * The parent tree - */ - parent?: Tree; - - /** - * Value to keep in this node - */ - value?: V; - - /** - * WHether the values must be unique, false by default. - * If false you can store many values for same keys, otherwise only one - */ - unique?: boolean; - - /** - * Custom keys comparator, by default if a > b => -1, a < b -1, a === b => 0 - */ - compareKeys?(a: K, b: K): number; - - /** - * Function that defines whether 2 values are the same, by default a === b - */ - checkValueEquality?(a: V, b: V): boolean; - } - - interface Query { - $lt?: K; - $lte?: K; - $gt?: K; - $gte?: K; - } - } - - /** - * Represents a binary search tree - */ - class BinarySearchTree { - constructor(options?: I.BinarySearchTree.ConstructorOptions>); - - /** - * Returns the max descendant tree - */ - getMaxKeyDescendant(): BinarySearchTree; - - /** - * Returns the maximum key - */ - getMaxKey(): K; - - /** - * Returns the min descendant tree - */ - getMinKeyDescendant(): BinarySearchTree; - - /** - * Returns the minumum key - */ - getMinKey(): K; - - /** - * Traverses the tree and calls the given function for each node - */ - checkAllNodesFullfillCondition(test: (key: K, value: V) => void): void; - - /** - * Checks whether the tree is a binary search tree - */ - checkIsBST(): void; - - /** - * Returns the of keys in the tree - */ - getNumberOfKeys(): number; - - /** - * Inserts a new key/value - */ - insert(key: K, value: V): void; - - /** - * Searches the given key in the tree - */ - search(key: K): V[]; - - /** - * Returns all the values from the given key bounds - */ - betweenBounds(query: I.BinarySearchTree.Query): V[]; - - /** - * Deletes the given key/value from the tree - */ - delete(key: K, value?: V): void; - - /** - * Executed the given callback for each node from left to right - */ - executeOnEveryNode(fn: (tree: BinarySearchTree) => void): void; - - /** - * Prints the tree - */ - prettyPrint(printData?: boolean, spacing?: string): void; - } - - /** - * Represents an AVL tree, a self-balancing binary search tree - */ - class AVLTree { - constructor(options?: I.BinarySearchTree.ConstructorOptions>); - - /** - * Checks whether the tree is an avl tree - */ - checkIsAVLT(): void; - - /** - * Inserts a new key/value - */ - insert(key: K, value: V): void; - - /** - * Deletes the given key/value from the tree - */ - delete(key: K, value?: V): void; - - /** - * Returns the of keys in the tree - */ - getNumberOFKeys(): number; - - /** - * Searches the given key in the tree - */ - search(key: K): V[]; - - /** - * Returns all the values from the given key bounds - */ - betweenBounds(query: I.BinarySearchTree.Query): V[]; - - /** - * Executed the given callback for each node from left to right - */ - executeOnEveryNode(fn: (tree: AVLTree) => void): void; - - /** - * Prints the tree - */ - prettyPrint(printDate?: boolean, spacing?: string): void; - } - - namespace I.RedBlackTree { - interface Node { - /** - * The key associated to the node - */ - key: K; - - /** - * The value associated to the node - */ - value: V; - - /** - * The left subtree of the node - */ - left?: Node; - - /** - * The right subtree of the node - */ - right?: Node; - } - - interface Iterator { - /** - * Checks if the iterator is valid - */ - readonly valid: boolean; - - /** - * The value of the node at the iterator's current position, null if invalid - */ - readonly node: Node | null; - - /** - * The key of the item referenced by the iterator, undefined if invalid - */ - readonly key?: K; - - /** - * The value of the item referenced by the iterator, undefined if invalid - */ - readonly value?: V; - - /** - * Returns the position of this iterator in the sequence - */ - readonly index: number; - - /** - * If true, then the iterator is not at the end of the sequence - */ - readonly hasNext: boolean; - - /** - * If true, then the iterator is not at the beginning of the sequence - */ - readonly hasPrev: boolean; - - /** - * The tree associated to the iterator - */ - tree: RedBlackTree; - - /** - * Makes a copy of the iterator - */ - clone(): Iterator; - - /** - * Removes the item at the position of the iterator and returns a new rb-tree - */ - remove(): RedBlackTree; - - /** - * Advances the iterator to the next position - */ - next(): void; - - /** - * Updates the value of the node in the tree at this iterator and returns a new rb-tree - */ - update(value: V): RedBlackTree; - - /** - * Moves the iterator backward one element - */ - prev(): void; - } - } - - /** - * Represents a fully persistent red-black tree - */ - class RedBlackTree { - /** - * The root node of the tree - */ - root: I.RedBlackTree.Node; - - constructor(compare?: (a: K, b: K) => number, root?: RedBlackTree); - - /** - * A sorted array of all the keys in the tree - */ - readonly keys: K[]; - - /** - * An array of all the values in the tree - */ - readonly values: V[]; - - /** - * The number of items in the tree - */ - readonly length: number; - - /** - * An iterator pointing to the first element in the tree - */ - readonly begin: I.RedBlackTree.Iterator; - - /** - * An iterator pointing to the last element in the tree - */ - readonly end: I.RedBlackTree.Iterator; - - /** - * Creates a new tree with the new pair inserted - */ - insert(key: K, value: V): RedBlackTree; - - /** - * Walks a visitor function over the nodes of the tree in order - * - * @param visit A callback that gets executed on each node. - * If a truthy value is returned from the visitor, then iteration is stopped. - * @param lo An optional start of the range to visit (inclusive) - * @param hi An optional end of the range to visit (non-inclusive) - */ - forEach(visit: (key: K, value: V) => T, lo?: K, hi?: K): T; - - /** - * Finds an iterator starting at the given element - */ - at(idx: number): I.RedBlackTree.Iterator; - - /** - * Finds the first item in the tree whose key is >= key - */ - ge(key: K): I.RedBlackTree.Iterator; - - /** - * Finds the first item in the tree whose key is > key - */ - gt(key: K): I.RedBlackTree.Iterator; - - /** - * Finds the first item in the tree whose key is < key - */ - lt(key: K): I.RedBlackTree.Iterator; - - /** - * Finds the first item in the tree whose key is <= key - */ - le(key: K): I.RedBlackTree.Iterator; - - /** - * Returns an iterator pointing to the first item in the tree with key, otherwise null - */ - find(key: K): I.RedBlackTree.Iterator | null; - - /** - * Removes the first item with key in the tree - */ - remove(key: K): RedBlackTree; - - /** - * Retrieves the value associated to the given key - */ - get(key: K): V | undefined; - } - - /** - * Respresetns a data structure which is a combination of an array and a set. - * Adding a new member is O(1), testing for membership is O(1), - * and finding the index of an element is O(1). - */ - class ArraySet { - /** - * The number of unique items in this ArraySet. - * If duplicates have been added, than those do not count towards the size. - */ - readonly length: number; - - /** - * Adds the given value to this set. - * - * @param allowDuplicates Whether to allow duplicates in the set, false by default - */ - add(value: T, allowDuplicates?: boolean): this; - - /** - * Checks whether the given value is a member of the set - */ - has(value: T): boolean; - - /** - * Returns the index of the given element. - * If the value is not present it will return -1 - */ - indexOf(value: T): number; - - /** - * Converts the set to an array - */ - toArray(): T[]; - - /** - * Creates an ArraySet from the given iterable object - * - * @param allowDuplicates Whether to allow duplicates in the set, false by default - */ - static from(iterable: Iterable, allowDuplicates?: boolean): ArraySet; - } - - namespace I.BufferList { - type Appendable = Buffer | BufferList | string | number | Array; - } - - /** - * Represents a Node.js Buffer list collector, reader and streamer with callback/promise interface support - */ - class BufferList extends std.stream.Duplex implements PromiseLike { - /** - * Creates a new buffer list - */ - constructor(); - - /** - * Creates a new buffer list and initiates with the given value - */ - constructor(buffer: I.BufferList.Appendable); - - /** - * Creates a new buffer list and subscribes the given callback on the end/error event - */ - constructor(callback: (err: any, data: Buffer) => void); - - /** - * Adds an additional buffer or BufferList to the internal list - */ - append(buf: I.BufferList.Appendable): this; - - /** - * Ends the stream - */ - end(chunk?: Buffer): void; - end(chunk?: () => void): void; - - /** - * Returns the byte at the specified index - */ - get(idx: number): number; - - /** - * Returns a new Buffer object containing the bytes within the range specified. - */ - slice(start?: number, end?: number): Buffer; - - /** - * Copies the content of the list in the dest buffer - * starting from destStart and containing the bytes within the range specified with srcStart to srcEnd - * - * @param dstStart writes from this position - * @param srcStart reads bytes from this position - * @param srcEnd read bytes to this position - */ - copy(dst: T, dstStart?: number, srcStart?: number, srcEnd?: number): T; - - /** - * Returns a new BufferList object containing the bytes within the range specified. - * No copies will be performed. All buffers in the result share memory with the original list. - * - * @param start slice from - * @param end slice to - */ - shallowSlice(start?: number, end?: number): BufferList; - - /** - * Return a string representation of the buffer - */ - toString(encoding?: fs.I.Encoding, start?: number, end?: number): string; - - /** - * Shifts bytes off the start of the list - */ - consume(bytes: number): this; - - /** - * Performs a shallow-copy of the list. - */ - duplicate(): BufferList; - - /** - * Destroys the stream - */ - destroy(): void; - - then( - onfulfilled?: ((value: Buffer) => T1 | PromiseLike) | null, - onrejected?: ((reason: any) => T2 | PromiseLike) | null - ): PromiseLike; - - catch(onrejected?: ((reason: any) => T | PromiseLike) | null): PromiseLike; - } - - /** - * Represents a Map that has a default values factory object or function. - * Each get of non-existent key goes through the factory - */ - class DefaultMap extends Map { - constructor(factory?: ((key: K) => V) | { [key: string]: V }, iterable?: Iterable<[K, V]>); - } - - namespace I.LRU { - type LengthCalculator = (value: V, key: K) => number; - interface ConstructorOptions { - /** - * The maximum size of the cache, checked by applying the length function to all values in the cache. - * Default is Infinity - */ - max?: number; - - /** - * Maximum age in ms. Items are not pro-actively pruned out as they age, - * but if you try to get an item that is too old, - * it'll drop it and return undefined instead of giving it to you - */ - maxAge?: number; - - /** - * Function that is used to calculate the length of stored items - */ - length?: LengthCalculator; - - /** - * Function that is called on items when they are dropped from the cache - */ - dispose?(key: K, value: V): void; - - /** - * Whether to return the stale value before deleting it - */ - stale?: boolean; - - /** - * Dispose will only be called when a key falls out of the cache, not when it is overwritten - */ - noDisposeOnSet?: boolean; - } - - interface SerializedEntry { - /** - * key - */ - key: K; - - /** - * value - */ - value: V; - - /** - * when it becomes expired - */ - e: number; - } - - interface Entry { - /** - * key - */ - key: K; - - /** - * value - */ - value: V; - - /** - * entry length - */ - length: number; - - /** - * Timestamp when the entry was created - */ - now: number; - - /** - * Maximum live time - */ - maxAge: number; - } - } - - /** - * Represent an LRU cache - */ - class LRU { - /** - * Creates an LRU cache of the given size - */ - constructor(max: number); - - /** - * Creates an LRU cache with the given options - */ - constructor(options?: I.LRU.ConstructorOptions); - - /** - * The length of the cache, setter resizes the cache - */ - max: number; - - /** - * stale setting - */ - allowStale: boolean; - - /** - * maxAge setting - */ - maxAge: number; - - /** - * length setting - */ - lengthCalculator: I.LRU.LengthCalculator; - - /** - * Total length of objects in cache taking into account length options function - */ - readonly length: number; - - /** - * Total quantity of objects currently in cache. - * Note, that stale items are returned as part of this item count. - */ - readonly itemCount: number; - - /** - * Iterates over all the keys in the cache, in reverse recent-ness order. (ie, less recently used items are iterated over first.) - */ - rforEach(fn: (this: T, value: V, key: K, cache: LRU) => void, thisp?: T): void; - - /** - * Iterates over all the keys in the cache, in order of recent-ness - */ - forEach(fn: (this: T, value: V, key: K, cache: LRU) => void, thisp?: T): void; - - /** - * Returns an array of the keys in the cache - */ - keys(): K[]; - - /** - * Returns an array of the values in the cache - */ - values(): V[]; - - /** - * Clears the cache entirely, throwing away all values - */ - reset(): void; - - /** - * Return an array of the cache entries ready for serialization and usage with 'destinationCache.load(arr)` - */ - dump(): Array>; - - /** - * Returns an internal lru list of entries - */ - dumpLru(): LinkedList>; - - /** - * @param opts std.util.inspect options - */ - inspect(opts?: object): string; - - /** - * Sets a new value for the given key. Updates the "recently used"-ness of the key - * - * @param maxAge maxAge option specific for this key - * @returns Whether the key was set - */ - set(key: K, value: V, maxAge?: number): boolean; - - /** - * Check if a key is in the cache, without updating the recent-ness or deleting it for being stale - */ - has(key: K): boolean; - - /** - * Gets the value of the given key. Updates the "recently used"-ness of the key - */ - get(key: K): V | undefined; - - /** - * Returns the key value without updating the "recently used"-ness of the key - */ - peek(key: K): V | undefined; - - /** - * Deletes the less recently used element - */ - pop(): I.LRU.Entry; - - /** - * Deletes a key out of the cache - */ - del(key: K): void; - - /** - * Loads another cache entries array, obtained with sourceCache.dump(), into the cache. - * The destination cache is reset before loading new entries - */ - load(arr: Array>): void; - - /** - * Manually iterates over the entire cache proactively pruning old entries - */ - prune(): void; - } - - /** - * Represents a Map that keeps keys only for a specified interval of time - */ - class TimedoutMap extends Map { - /** - * @param timeout maximum age of the keys, 1000 by default - * @param callback callback that is called with each key when the timeout is passed - */ - constructor(timeout?: number, callback?: (key: K) => void); - - /** - * Gets the timeout - */ - getTimeout(): number; - - /** - * Sets the timeout - */ - setTimeout(ms: number): void; - - /** - * Iterates over the map and calls the callback for each element - */ - forEach(callback: (this: T, value: V, key: K, cache: this) => void, thisArg?: T): this; - - /** - * Deletes the given key - */ - delete(key: K): boolean; - } - } -} diff --git a/types/adone/glosses/collections/array_set.d.ts b/types/adone/glosses/collections/array_set.d.ts new file mode 100644 index 0000000000..c13d8769f1 --- /dev/null +++ b/types/adone/glosses/collections/array_set.d.ts @@ -0,0 +1,44 @@ +declare namespace adone.collection { + /** + * Respresetns a data structure which is a combination of an array and a set. + * Adding a new member is O(1), testing for membership is O(1), + * and finding the index of an element is O(1). + */ + class ArraySet { + /** + * The number of unique items in this ArraySet. + * If duplicates have been added, than those do not count towards the size. + */ + readonly length: number; + + /** + * Adds the given value to this set. + * + * @param allowDuplicates Whether to allow duplicates in the set, false by default + */ + add(value: T, allowDuplicates?: boolean): this; + + /** + * Checks whether the given value is a member of the set + */ + has(value: T): boolean; + + /** + * Returns the index of the given element. + * If the value is not present it will return -1 + */ + indexOf(value: T): number; + + /** + * Converts the set to an array + */ + toArray(): T[]; + + /** + * Creates an ArraySet from the given iterable object + * + * @param allowDuplicates Whether to allow duplicates in the set, false by default + */ + static from(iterable: Iterable, allowDuplicates?: boolean): ArraySet; + } +} diff --git a/types/adone/glosses/collections/async_queue.d.ts b/types/adone/glosses/collections/async_queue.d.ts new file mode 100644 index 0000000000..9a575a33be --- /dev/null +++ b/types/adone/glosses/collections/async_queue.d.ts @@ -0,0 +1,12 @@ +declare namespace adone.collection { + /** + * Represents an asynchronous queue, each pop is a promise + * that is resolved with an existing element or an element that will be pushed in the future + */ + class AsyncQueue extends Queue> { + /** + * Returns a promise that will be resolved with an existing element or an element that will be pushed in the future + */ + pop(): Promise; + } +} diff --git a/types/adone/glosses/collections/avl_tree.d.ts b/types/adone/glosses/collections/avl_tree.d.ts new file mode 100644 index 0000000000..2b5dc132b6 --- /dev/null +++ b/types/adone/glosses/collections/avl_tree.d.ts @@ -0,0 +1,48 @@ +declare namespace adone.collection { + /** + * Represents an AVL tree, a self-balancing binary search tree + */ + class AVLTree { + constructor(options?: I.BinarySearchTree.ConstructorOptions>); + + /** + * Checks whether the tree is an avl tree + */ + checkIsAVLT(): void; + + /** + * Inserts a new key/value + */ + insert(key: K, value: V): void; + + /** + * Deletes the given key/value from the tree + */ + delete(key: K, value?: V): void; + + /** + * Returns the of keys in the tree + */ + getNumberOFKeys(): number; + + /** + * Searches the given key in the tree + */ + search(key: K): V[]; + + /** + * Returns all the values from the given key bounds + */ + betweenBounds(query: I.BinarySearchTree.Query): V[]; + + /** + * Executed the given callback for each node from left to right + */ + executeOnEveryNode(fn: (tree: AVLTree) => void): void; + + /** + * Prints the tree + */ + prettyPrint(printDate?: boolean, spacing?: string): void; + } +} diff --git a/types/adone/glosses/collections/binary_search_tree.d.ts b/types/adone/glosses/collections/binary_search_tree.d.ts new file mode 100644 index 0000000000..878bd7e6a4 --- /dev/null +++ b/types/adone/glosses/collections/binary_search_tree.d.ts @@ -0,0 +1,110 @@ +declare namespace adone.collection { + namespace I.BinarySearchTree { + interface ConstructorOptions { + /** + * The parent tree + */ + parent?: Tree; + + /** + * Value to keep in this node + */ + value?: V; + + /** + * WHether the values must be unique, false by default. + * If false you can store many values for same keys, otherwise only one + */ + unique?: boolean; + + /** + * Custom keys comparator, by default if a > b => -1, a < b -1, a === b => 0 + */ + compareKeys?(a: K, b: K): number; + + /** + * Function that defines whether 2 values are the same, by default a === b + */ + checkValueEquality?(a: V, b: V): boolean; + } + + interface Query { + $lt?: K; + $lte?: K; + $gt?: K; + $gte?: K; + } + } + + /** + * Represents a binary search tree + */ + class BinarySearchTree { + constructor(options?: I.BinarySearchTree.ConstructorOptions>); + + /** + * Returns the max descendant tree + */ + getMaxKeyDescendant(): BinarySearchTree; + + /** + * Returns the maximum key + */ + getMaxKey(): K; + + /** + * Returns the min descendant tree + */ + getMinKeyDescendant(): BinarySearchTree; + + /** + * Returns the minumum key + */ + getMinKey(): K; + + /** + * Traverses the tree and calls the given function for each node + */ + checkAllNodesFullfillCondition(test: (key: K, value: V) => void): void; + + /** + * Checks whether the tree is a binary search tree + */ + checkIsBST(): void; + + /** + * Returns the of keys in the tree + */ + getNumberOfKeys(): number; + + /** + * Inserts a new key/value + */ + insert(key: K, value: V): void; + + /** + * Searches the given key in the tree + */ + search(key: K): V[]; + + /** + * Returns all the values from the given key bounds + */ + betweenBounds(query: I.BinarySearchTree.Query): V[]; + + /** + * Deletes the given key/value from the tree + */ + delete(key: K, value?: V): void; + + /** + * Executed the given callback for each node from left to right + */ + executeOnEveryNode(fn: (tree: BinarySearchTree) => void): void; + + /** + * Prints the tree + */ + prettyPrint(printData?: boolean, spacing?: string): void; + } +} diff --git a/types/adone/glosses/collections/buffer_list.d.ts b/types/adone/glosses/collections/buffer_list.d.ts new file mode 100644 index 0000000000..b2a4157385 --- /dev/null +++ b/types/adone/glosses/collections/buffer_list.d.ts @@ -0,0 +1,92 @@ +declare namespace adone.collection { + namespace I.BufferList { + type Appendable = Buffer | BufferList | string | number | Array; + } + + /** + * Represents a Node.js Buffer list collector, reader and streamer with callback/promise interface support + */ + class BufferList extends std.stream.Duplex implements PromiseLike { + /** + * Creates a new buffer list + */ + constructor(); + + /** + * Creates a new buffer list and initiates with the given value + */ + constructor(buffer: I.BufferList.Appendable); + + /** + * Creates a new buffer list and subscribes the given callback on the end/error event + */ + constructor(callback: (err: any, data: Buffer) => void); + + /** + * Adds an additional buffer or BufferList to the internal list + */ + append(buf: I.BufferList.Appendable): this; + + /** + * Ends the stream + */ + end(chunk?: Buffer): void; + end(chunk?: () => void): void; + + /** + * Returns the byte at the specified index + */ + get(idx: number): number; + + /** + * Returns a new Buffer object containing the bytes within the range specified. + */ + slice(start?: number, end?: number): Buffer; + + /** + * Copies the content of the list in the dest buffer + * starting from destStart and containing the bytes within the range specified with srcStart to srcEnd + * + * @param dstStart writes from this position + * @param srcStart reads bytes from this position + * @param srcEnd read bytes to this position + */ + copy(dst: T, dstStart?: number, srcStart?: number, srcEnd?: number): T; + + /** + * Returns a new BufferList object containing the bytes within the range specified. + * No copies will be performed. All buffers in the result share memory with the original list. + * + * @param start slice from + * @param end slice to + */ + shallowSlice(start?: number, end?: number): BufferList; + + /** + * Return a string representation of the buffer + */ + toString(encoding?: fs.I.Encoding, start?: number, end?: number): string; + + /** + * Shifts bytes off the start of the list + */ + consume(bytes: number): this; + + /** + * Performs a shallow-copy of the list. + */ + duplicate(): BufferList; + + /** + * Destroys the stream + */ + destroy(): void; + + then( + onfulfilled?: ((value: Buffer) => T1 | PromiseLike) | null, + onrejected?: ((reason: any) => T2 | PromiseLike) | null + ): PromiseLike; + + catch(onrejected?: ((reason: any) => T | PromiseLike) | null): PromiseLike; + } +} diff --git a/types/adone/glosses/collections/byte_array.d.ts b/types/adone/glosses/collections/byte_array.d.ts new file mode 100644 index 0000000000..1dc3080fb3 --- /dev/null +++ b/types/adone/glosses/collections/byte_array.d.ts @@ -0,0 +1,892 @@ +declare namespace adone.collection { + namespace I { + type Long = math.Long; + + type Longable = math.I.Longable; + + namespace ByteArray { + interface Varint32 { + value: number; + length: number; + } + + interface Varint64 { + value: Long; + length: number; + } + + interface String { + string: string; + length: number; + } + + type Wrappable = string | ByteArray | Buffer | Uint8Array | ArrayBuffer; + + type Metrics = "b" | "c"; + } + } + + /** + * Represents an array of bytes, enhanced Node.js Buffer + */ + class ByteArray { + readonly woffset: number; + + readonly roffset: number; + + readonly buffer: Buffer; + + readonly noAssert: boolean; + + /** + * Constructs a new ByteArray + * + * @param capacity Initial capacity. Defaults to ByteArray.DEFAULT_CAPACITY(64) + * @param noAssert Whether to skip assertions of offsets and values. Defaults to ByteArray.DEFAULT_NOASSERT(false) + */ + constructor(capacity?: number, noAssert?: boolean); + + /** + * Reads a BitSet as an array of booleans. + * + * @param offset Offset to read from. Will use and increase offset by length if omitted. + */ + readBitSet(offset?: number): boolean[]; + + /** + * Reads the specified number of bytes. + * + * @param length Number of bytes to read + * @param offset Offset to read from. Will use and increase offset by length if omitted. + */ + read(length: number, offset?: number): ByteArray; + + /** + * Reads an 8bit signed integer + * + * @param offset Offset to read from + */ + readInt8(offset?: number): number; + + /** + * Reads an 8bit unsigned integer + * + * @param offset Offset to read from + */ + readUInt8(offset?: number): number; + + /** + * Reads a 16bit signed le integer + * + * @param offset Offset to read from + */ + readInt16LE(offset?: number): number; + + /** + * Reads a 16bit unsigned le integer + * + * @param offset Offset to read from + */ + readUInt16LE(offset?: number): number; + + /** + * Reads a 16bit signed be integer + * + * @param offset Offset to read from + */ + readInt16BE(offset?: number): number; + + /** + * Reads a 16bit unsigned be integer + * + * @param offset Offset to read from + */ + readUInt16BE(offset?: number): number; + + /** + * Reads a 32bit signed le integer + * + * @param offset Offset to read from + */ + readInt32LE(offset?: number): number; + + /** + * Reads a 32bit unsigned le integer + * + * @param offset Offset to read from + */ + readUInt32LE(offset?: number): number; + + /** + * Reads a 32bit signed be integer + * + * @param offset Offset to read from + */ + readInt32BE(offset?: number): number; + + /** + * Reads a 32bit unsigned be integer + * + * @param offset Offset to read from + */ + readUInt32BE(offset?: number): number; + + /** + * Reads a 64bit signed le integer as math.Long + * + * @param offset Offset to read from + */ + readInt64LE(offset?: number): math.Long; + + /** + * Reads a 64bit unsigned le integer as math.Long + * + * @param offset Offset to read from + */ + readUInt64LE(offset?: number): math.Long; + + /** + * Reads a 64bit signed be integer as math.Long + * + * @param offset Offset to read from + */ + readInt64BE(offset?: number): math.Long; + + /** + * Reads a 64bit unsigned be integer as math.Long + * + * @param offset Offset to read from + */ + readUInt64BE(offset?: number): math.Long; + + /** + * Reads a 32bit le float + * + * @param offset Offset to read from + */ + readFloatLE(offset?: number): number; + + /** + * Reads a 32bit be float + * + * @param offset Offset to read from + */ + readFloatBE(offset?: number): number; + + /** + * Reads a 64bit le float + * + * @param offset Offset to read from + */ + readDoubleLE(offset?: number): number; + + /** + * Reads a 64bit be float + * + * @param offset Offset to read from + */ + readDoubleBE(offset?: number): number; + + /** + * Appends some data to this ByteArray. + * This will overwrite any contents behind the specified offset up to the appended data's length. + * + * @param source The source write from + * @param offset Offset to write at + * @param length length to read from the source + * @param encoding encoding to use for wrapping the source in bytearray + */ + write(source: I.ByteArray.Wrappable, offset?: number, length?: number, encoding?: string): this; + + /** + * Writes the array as a bitset. + * @param value Array of booleans to write + */ + writeBitSet(value: number[]): this; + + /** + * Writes the array as a bitset. + * @param value Array of booleans to write + * @param offset Offset to write at + */ + writeBitSet(value: number[], offset: number): number; + + /** + * Writes a buffer at the given offset + * @param buf Buffer to write + * @param offset Offset to write at + */ + writeBuffer(buf: Buffer, offset?: number): this; + + /** + * Writes an 8bit signed integer + * + * @param offset Offset to write at + */ + writeInt8(value: number, offset?: number): this; + + /** + * Writes an 8bit unsigned integer + * + * @param offset Offset to write at + */ + writeUInt8(value: number, offset?: number): this; + + /** + * Writes a 16bit signed le integer + * + * @param offset Offset to write at + */ + writeInt16LE(value: number, offset?: number): this; + + /** + * Writes a 16bit signed be integer + * + * @param offset Offset to write at + */ + writeInt16BE(value: number, offset?: number): this; + + /** + * Writes a 16bit unsigned le integer + * + * @param offset Offset to write at + */ + writeUInt16LE(value: number, offset?: number): this; + + /** + * Writes a 16bit unsigned be integer + * + * @param offset Offset to write at + */ + writeUInt16BE(value: number, offset?: number): this; + + /** + * Writes a 32bit signed le integer + * + * @param offset Offset to write at + */ + writeInt32LE(value: number, offset?: number): this; + + /** + * Writes a 32bit signed be integer + * + * @param offset Offset to write at + */ + writeInt32BE(value: number, offset?: number): this; + + /** + * Writes a 32bit unsigned le integer + * + * @param offset Offset to write at + */ + writeUInt32LE(value: number, offset?: number): this; + + /** + * Writes a 32bit unsigned be integer + * + * @param offset Offset to write at + */ + writeUInt32BE(value: number, offset?: number): this; + + /** + * Writes a 64bit signed le long integer + * + * @param offset Offset to write at + */ + writeInt64LE(value: math.Long | string | number, offset?: number): this; + + /** + * Writes a 64bit signed be long integer + * + * @param offset Offset to write at + */ + writeInt64BE(value: math.Long | string | number, offset?: number): this; + + /** + * Writes a 64bit unsigned le long integer + * + * @param offset Offset to write at + */ + writeUInt64LE(value: math.Long | string | number, offset?: number): this; + + /** + * Writes a 64bit unsigned be long integer + * + * @param offset Offset to write at + */ + writeUInt64BE(value: math.Long | string | number, offset?: number): this; + + /** + * Writes a 32bit le float + * + * @param offset Offset to write at + */ + writeFloatLE(value: number, offset?: number): this; + + /** + * Writes a 32bit be float + * + * @param offset Offset to write at + */ + writeFloatBE(value: number, offset?: number): this; + + /** + * Writes a 64bit le float + * + * @param offset Offset to write at + */ + writeDoubleLE(value: number, offset?: number): this; + + /** + * Writes a 64bit be float + * + * @param offset Offset to write at + */ + writeDoubleBE(value: number, offset?: number): this; + + /** + * Writes a 32bit base 128 variable-length integer + */ + writeVarint32(value: number): this; + + /** + * Writes a 32bit base 128 variable-length integer + * + * @param offset Offset to write at + */ + writeVarint32(value: number, offset: number): number; + + /** + * Writes a zig-zag encoded 32bit base 128 variable-length integer + */ + writeVarint32ZigZag(value: number): this; + + /** + * Writes a zig-zag encoded 32bit base 128 variable-length integer + * + * @param offset Offset to write at + */ + writeVarint32ZigZag(value: number, offset: number): number; + + /** + * Reads a 32bit base 128 variable-length integer + */ + readVarint32(): number; + + /** + * Reads a 32bit base 128 variable-length integer + * + * @param offset Offset to read from + */ + readVarint32(offset: number): I.ByteArray.Varint32; + + /** + * Reads a zig-zag encoded 32bit base 128 variable-length integer + */ + readVarint32ZigZag(): number; + + /** + * Reads a zig-zag encoded 32bit base 128 variable-length integer + * + * @param offset Offset to read from + */ + readVarint32ZigZag(offset: number): I.ByteArray.Varint32; + + /** + * Writes a 64bit base 128 variable-length integer + */ + writeVarint64(value: math.Long | string | number): this; + + /** + * Writes a 64bit base 128 variable-length integer + * + * @param offset Offset to write at + */ + writeVarint64(value: math.Long | string | number, offset: number): number; + + /** + * Writes a zig-zag encoded 64bit base 128 variable-length integer + */ + writeVarint64ZigZag(value: math.Long | string | number): this; + + /** + * Writes a zig-zag encoded 64bit base 128 variable-length integer + * + * @param offset Offset to write at + */ + writeVarint64ZigZag(value: math.Long | string | number, offset: number): number; + + /** + * Reads a 64bit base 128 variable-length integer + */ + readVarint64(): I.Long; + + /** + * Reads a 64bit base 128 variable-length integer + * + * @param offset Offset to read from + */ + readVarint64(offset: number): I.ByteArray.Varint64; + + /** + * Reads a zig-zag encoded 64bit base 128 variable-length integer + */ + readVarint64ZigZag(): math.Long; + + /** + * Reads a zig-zag encoded 64bit base 128 variable-length integer + * + * @param offset Offset to read from + */ + readVarint64ZigZag(offset: number): I.ByteArray.Varint64; + + /** + * Writes a NULL-terminated UTF8 encoded string. + * For this to work the specified string must not contain any NULL characters itself + */ + writeCString(str: string): this; + + /** + * Writes a NULL-terminated UTF8 encoded string. + * For this to work the specified string must not contain any NULL characters itself + * + * @param offset Offset to write at + */ + writeCString(str: string, offset: number): number; + + /** + * Reads a NULL-terminated UTF8 encoded string. + * For this to work the string read must not contain any NULL characters itself + */ + readCString(): string; + + /** + * Reads a NULL-terminated UTF8 encoded string. + * For this to work the string read must not contain any NULL characters itself + * + * @param offset Offset to read from + */ + readCString(offset: number): I.ByteArray.String; + + /** + * Writes an UTF8 encoded string + */ + writeString(str: string): this; + + /** + * Writes an UTF8 encoded string + * + * @param offset Offset to write at + */ + writeString(str: string, offset: number): number; + + /** + * Reads an UTF8 encoded string + * + * @param length Number of characters or bytes to read + * @param metrics Metrics specifying what n is meant to count. Defaults to ByteArray.METRICS_CHARS("c") + */ + readString(length: number, metrics?: I.ByteArray.Metrics): string; + + /** + * Reads an UTF8 encoded string + * + * @param length Number of characters or bytes to read + * @param metrics Metrics specifying what n is meant to count. Defaults to ByteArray.METRICS_CHARS("c") + * @param offset Offset to read from + */ + readString(length: number, metrics: I.ByteArray.Metrics, offset: number): I.ByteArray.String; + + /** + * Reads an UTF8 encoded string + * + * @param length Number of characters or bytes to read + * @param offset Offset to read from + */ + readString(length: number, offset: number): I.ByteArray.String; + + /** + * Writes a length as varint32 prefixed UTF8 encoded string + */ + writeVString(str: string): this; + + /** + * Writes a length as varint32 prefixed UTF8 encoded string + * + * @param offset Offset to read from + */ + writeVString(str: string, offset: number): number; + + /** + * Reads a length as varint32 prefixed UTF8 encoded string + */ + readVString(): string; + + /** + * Reads a length as varint32 prefixed UTF8 encoded string + * + * @param offset Offset to read from + */ + readVString(offset: number): I.ByteArray.String; + + /** + * Appends this ByteArray's contents to another ByteArray. + * This will overwrite any contents behind the specified offset up to the length of this ByteArray's data + * + * @param offset Offset to append to + */ + appendTo(target: ByteArray, offset?: number): this; + + /** + * Enables or disables assertions of argument types and offsets. + * Assertions are enabled by default but you can opt to disable them if your code already makes sure that everything is valid + */ + assert(assert?: boolean): this; + + /** + * Gets the capacity of this ByteArray's backing buffer + */ + capacity(): number; + + /** + * Clears this ByteArray's offsets by setting offset to 0 and limit to the backing buffer's capacity + */ + clear(): this; + + /** + * Creates a cloned instance of this ByteArray, + * preset with this ByteArray's values for offset, markedOffset and limit + * + * @param copy Whether to copy the backing buffer or to return another view on the same, false by default + */ + clone(copy?: boolean): ByteArray; + + /** + * Compacts this ByteArray to be backed by a buffer of its contents' length. + * Will set offset = 0 and limit = capacity and adapt markedOffset to the same relative position if set + * + * @param begin Offset to start at, buffer offset by default + * @param end Offset to end at, buffer limit by default + */ + compact(begin?: number, end?: number): this; + + /** + * Creates a copy of this ByteArray's contents. + * + * @param begin Begin offset, buffer offset by default + * @param end End offset, buffer limit by default + */ + copy(begin?: number, end?: number): ByteArray; + + /** + * Copies this ByteArray's contents to another ByteArray. + * + * @param targetOffset Offset to copy to. Will use and increase the target's offset by the number of bytes copied if omitted + * @param sourceOffset Offset to start copying from. Will use and increase offset by the number of bytes copied if omitted + * @param sourceLimit Offset to end copying from, defaults to the buffer limit + */ + copyTo(target: ByteArray, targetOffset?: number, souceOffset?: number, sourceLimit?: number): this | ByteArray; + + /** + * Makes sure that this ByteArray is backed by a ByteArray#buffer of at least the specified capacity. + * If the current capacity is exceeded, it will be doubled. + * If double the current capacity is less than the required capacity, the required capacity will be used instead + */ + ensureCapacity(capacity: number): this; + + /** + * Overwrites this ByteArray's contents with the specified value. + * + * @param value Byte value to fill with. If given as a string, the first character is used + * @param begin Begin offset. Will use and increase offset by the number of bytes written if omitted. defaults to offset + * @param end End offset, defaults to limit. + */ + fill(value: string | number, begin?: number, end?: number): this; + + /** + * Makes this ByteArray ready for a new sequence of write or relative read operations. + * Sets limit = offset and offset = 0. + * Make sure always to flip a ByteArray when all relative read or write operations are complete + */ + flip(): this; + + /** + * Marks an offset on this ByteArray to be used later + * + * @param offset Offset to mark. Defaults to offset. + */ + mark(offset?: number): this; + + /** + * Prepends some data to this ByteArray. + * This will overwrite any contents before the specified offset up to the prepended data's length. + * If there is not enough space available before the specified offset, + * the backing buffer will be resized and its contents moved accordingly + * + * @param source Data to prepend + * @param offset Offset to prepend at. Will use and decrease offset by the number of bytes prepended if omitted. + */ + prepend(source: I.ByteArray.Wrappable, offset: number): this; + + /** + * Prepends some data to this ByteArray. + * This will overwrite any contents before the specified offset up to the prepended data's length. + * If there is not enough space available before the specified offset, + * the backing buffer will be resized and its contents moved accordingly + * + * @param source Data to prepend + * @param encoding Encoding if data is a string + * @param offset Offset to prepend at. Will use and decrease offset by the number of bytes prepended if omitted. + */ + prepend(source: I.ByteArray.Wrappable, encoding?: string, offset?: number): this; + + /** + * Prepends this ByteArray to another ByteArray. + * This will overwrite any contents before the specified offset up to the prepended data's length. + * If there is not enough space available before the specified offset, + * the backing buffer will be resized and its contents moved accordingly + * + * @param offset Offset to prepend at + */ + prependTo(target: ByteArray, offset?: number): this; + + /** + * Gets the number of remaining readable bytes + */ + remaining(): number; + + /** + * Resets this ByteArray's offset. + * If an offset has been marked through mark before, offset will be set to markedOffset, which will then be discarded. + * If no offset has been marked, sets offset = 0 + */ + reset(): this; + + /** + * Resizes this ByteArray to be backed by a buffer of at least the given capacity. + * Will do nothing if already that large or larger. + * + * @param capacity Capacity required + */ + resize(capacity: number): this; + + /** + * Reverses this ByteArray's contents. + * + * @param begin Offset to start at, defaults to offset + * @param end Offset to end at, defaults to limit + */ + reverse(begin?: number, end?: number): this; + + /** + * Skips the next length bytes. This will just advance + */ + skip(length: number): this; + + /** + * Slices this ByteArray by creating a cloned instance with offset = begin and limit = end + * + * @param begin Begin offset, defaults to offset + * @param end End offset, defaults to limit + */ + slice(begin?: number, end?: number): ByteArray; + + /** + * Returns a copy of the backing buffer that contains this ByteArray's contents. + * + * @param forceCopy If true returns a copy, otherwise returns a view referencing the same memory if possible, false by default + * @param begin Begin offset, offset by default + * @param end End offset, limit by default + */ + toBuffer(forceCopy?: boolean, begin?: number, end?: number): Buffer; + + /** + * Returns a raw buffer compacted to contain this ByteArray's contents + */ + toArrayBuffer(): ArrayBuffer; + + /** + * Converts the ByteArray's contents to a string + * + * @param encoding Output encoding + * @param begin Begin offset, offset by default + * @param end End offset, limit by default + */ + toString(encoding?: string, begin?: number, end?: number): string; + + /** + * Encodes this ByteArray's contents to a base64 encoded string + * + * @param begin Begin offset, offset by default + * @param end End offset, limit by default + */ + toBase64(begin?: number, end?: number): string; + + /** + * Encodes this ByteArray to a binary encoded string, that is using only characters 0x00-0xFF as bytes + * + * @param begin Begin offset, offset by default + * @param end End offset, limit by default + */ + toBinary(begin?: number, end?: number): string; + + /** + * Encodes this ByteArray to a hex encoded string with marked offsets + * + * @param columns If true returns two columns hex + ascii, defaults to false + */ + toDebug(columns?: boolean): string; + + /** + * Encodes this ByteArray's contents to a hex encoded string + * + * @param begin Begin offset, offset by default + * @param end End offset, limit by default + */ + toHex(begin?: number, end?: number): string; + + /** + * Encodes this ByteArray's contents to an UTF8 encoded string + * + * @param begin Begin offset, offset by default + * @param end End offset, limit by default + */ + toUTF8(begin?: number, end?: number): string; + + static accessor(): typeof Buffer; + + /** + * Allocates a new ByteArray backed by a buffer of the specified capacity. + * + * @param capacity Initial capacity. Defaults to ByteArray.DEFAULT_CAPACITY(64) + * @param noAssert Whether to skip assertions of offsets and values. Defaults to ByteArray.DEFAULT_NOASSERT(false) + */ + static allocate(capacity?: number, noAssert?: boolean): ByteArray; + + /** + * Concatenates multiple ByteArrays into one + * + * @param encoding Encoding for strings + * @param noAssert Whether to skip assertions of offsets and values. Defaults to ByteArray.DEFAULT_NOASSERT(false) + */ + static concat(buffers: I.ByteArray.Wrappable[], encoding?: string, noAssert?: boolean): ByteArray; + + static type(): typeof Buffer; + + /** + * Wraps a buffer or a string. + * Sets the allocated ByteArray's offset to 0 and its limit to the length of the wrapped data + * + * @param encoding Encoding for strings + * @param noAssert Whether to skip assertions of offsets and values. Defaults to ByteArray.DEFAULT_NOASSERT(false) + */ + static wrap(buffer: I.ByteArray.Wrappable, encoding?: string, noAssert?: boolean): ByteArray; + + /** + * Calculates the actual number of bytes required to store a 32bit base 128 variable-length integer + */ + static calculateVarint32(value: number): number; + + /** + * Zigzag encodes a signed 32bit integer so that it can be effectively used with varint encoding + */ + static zigZagEncode32(n: number): number; + + /** + * Decodes a zigzag encoded signed 32bit integer + */ + static zigZagDecode32(n: number): number; + + /** + * Calculates the actual number of bytes required to store a 64bit base 128 variable-length integer + */ + static calculateVarint64(value: number | string): number; + + /** + * Zigzag encodes a signed 64bit integer so that it can be effectively used with varint encoding + */ + static zigZagEncode64(value: number | string | I.Long): I.Long; + + /** + * Decodes a zigzag encoded signed 64bit integer. + */ + static zigZagDecode64(value: number | string | I.Long): I.Long; + + /** + * Calculates the number of UTF8 characters of a string. + * JavaScript itself uses UTF-16, + * so that a string's length property does not reflect its actual UTF8 size if it contains code points larger than 0xFFFF + */ + static calculateUTF8Chars(str: string): number; + + /** + * Calculates the number of UTF8 bytes of a string. + */ + static calculateString(str: string): number; + + /** + * Decodes a base64 encoded string to a ByteArray + */ + static fromBase64(str: string): ByteArray; + + /** + * Encodes a binary string to base64 like window.btoa does + */ + static btoa(str: string): string; + + /** + * Decodes a base64 encoded string to binary like window.atob does + */ + static atob(b64: string): string; + + /** + * Decodes a binary encoded string, that is using only characters 0x00-0xFF as bytes, to a ByteArray + */ + static fromBinary(str: string): ByteArray; + + /** + * Decodes a hex encoded string with marked offsets to a ByteArray + */ + static fromDebug(str: string, noAssert?: boolean): ByteArray; + + /** + * Decodes a hex encoded string to a ByteArray + */ + static fromHex(str: string, noAssert?: boolean): ByteArray; + + /** + * Decodes an UTF8 encoded string to a ByteArray + */ + static fromUTF8(str: string, noAssert?: boolean): ByteArray; + + /** + * Default initial capacity + */ + static DEFAULT_CAPACITY: number; + + /** + * Default no assertions flag + */ + static DEFAULT_NOASSERT: boolean; + + /** + * Maximum number of bytes required to store a 32bit base 128 variable-length integer + */ + static MAX_VARINT32_BYTES: number; + + /** + * Maximum number of bytes required to store a 64bit base 128 variable-length integer + */ + static MAX_VARINT64_BYTES: number; + + /** + * Metrics representing number of UTF8 characters. Evaluates to `c`. + */ + static METRICS_CHARS: string; + + /** + * Metrics representing number of bytes. Evaluates to `b`. + */ + static METRICS_BYTES: string; + } +} diff --git a/types/adone/glosses/collections/default_map.d.ts b/types/adone/glosses/collections/default_map.d.ts new file mode 100644 index 0000000000..46b8ccebfe --- /dev/null +++ b/types/adone/glosses/collections/default_map.d.ts @@ -0,0 +1,9 @@ +declare namespace adone.collection { + /** + * Represents a Map that has a default values factory object or function. + * Each get of non-existent key goes through the factory + */ + class DefaultMap extends Map { + constructor(factory?: ((key: K) => V) | { [key: string]: V }, iterable?: Iterable<[K, V]>); + } +} diff --git a/types/adone/glosses/collections/fast_lru.d.ts b/types/adone/glosses/collections/fast_lru.d.ts new file mode 100644 index 0000000000..e991322bc0 --- /dev/null +++ b/types/adone/glosses/collections/fast_lru.d.ts @@ -0,0 +1,61 @@ +declare namespace adone.collection { + /** + * Represents a faster LRU cache but with less functionality + */ + class FastLRU { + /** + * @param size Cache size, unlimited by default + */ + constructor(size?: number, options?: { + /** + * Function that is called when a value is deleted + */ + dispose?(key: K, value: V): void + }); + + /** + * The actual size of the cache + */ + readonly size: number; + + /** + * Gets the value by the given key + */ + get(key: K): V | undefined; + + /** + * Sets a new value for the given key + */ + set(key: K, value: V): void; + + /** + * Deletes the given key from the cache + */ + delete(key: K): boolean; + + /** + * Checks whether the cache has an element with the given key + */ + has(key: K): boolean; + + /** + * Returns the keys iterator + */ + keys(): IterableIterator; + + /** + * Returns the values iterator + */ + values(): IterableIterator; + + /** + * Returns the entries iterator + */ + entries(): IterableIterator<[K, V]>; + + /** + * Clears the cache + */ + clear(): void; + } +} diff --git a/types/adone/glosses/collections/index.d.ts b/types/adone/glosses/collections/index.d.ts new file mode 100644 index 0000000000..234ffe85f4 --- /dev/null +++ b/types/adone/glosses/collections/index.d.ts @@ -0,0 +1,28 @@ +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + +declare namespace adone { + /** + * Data structures + */ + namespace collection { + // + } +} diff --git a/types/adone/glosses/collections/linked_list.d.ts b/types/adone/glosses/collections/linked_list.d.ts new file mode 100644 index 0000000000..69ffa4da4b --- /dev/null +++ b/types/adone/glosses/collections/linked_list.d.ts @@ -0,0 +1,150 @@ +declare namespace adone.collection { + namespace I.LinkedList { + /** + * Represents the node of a linked list + */ + interface Node { + /** + * The next node + */ + next?: Node; + + /** + * The previous node + */ + prev?: Node; + + /** + * The value this node contains + */ + value: T; + } + } + + /** + * Represents a linked list + */ + class LinkedList { + /** + * The maximum length of the list + */ + readonly maxLength: number; + + /** + * Current length of the list + */ + readonly length: number; + + /** + * Whether the list is autoresizable + */ + readonly autoresize: boolean; + + /** + * @param maxLength Maximum length of the linked list + */ + constructor(maxLength?: number); + + /** + * Whether the list is full + */ + readonly full: boolean; + + /** + * Whether the list is empty + */ + readonly empty: boolean; + + /** + * Resizes the list + */ + resize(newLength: number): this; + + /** + * Adds a new node to the end + * + * @returns Added node + */ + push(value: T): I.LinkedList.Node; + + /** + * Removes the last node, returns undefined if the list is empty + */ + pop(): T | undefined; + + /** + * Removes the first node, returns undefined if the list is empty + */ + shift(): T | undefined; + + /** + * Inserts a new node at the beginning of the list + * + * @returns Added node + */ + unshift(value: T): I.LinkedList.Node; + + /** + * Moves the given node to the end of the list + */ + pushNode(node: I.LinkedList.Node): void; + + /** + * Moved the given node to the beginning of the list + */ + unshiftNode(node: I.LinkedList.Node): void; + + /** + * Removes the given node from the list + */ + removeNode(node: I.LinkedList.Node): void; + + /** + * Clears the list + * + * @param strong Whether to reset all the node's values + */ + clear(strong?: boolean): void; + + /** + * Convers the list to an array + */ + toArray(): T[]; + + /** + * The first element of the list + */ + readonly front: T; + + /** + * The last element of the list + */ + readonly back: T; + + /** + * Returns an iterator over the list elements + */ + [Symbol.iterator](): IterableIterator; + + /** + * Returns the next node for the given node + */ + nextNode(node: I.LinkedList.Node): I.LinkedList.Node; + + /** + * Maps this linked list to a new one using the given function + */ + map(fn: (value: T, index: number) => R): LinkedList; + + /** + * Invokes the given callback for each value from the beginning to the end (much faster than for-of). + * If the given function returns false it stops iterating. + */ + forEach(callback: (value: T, index: number) => void | boolean): void; + + /** + * Default length of a new created linked list + */ + static DEFAULT_LENGTH: number; + } +} diff --git a/types/adone/glosses/collections/lru.d.ts b/types/adone/glosses/collections/lru.d.ts new file mode 100644 index 0000000000..7d41e32cd5 --- /dev/null +++ b/types/adone/glosses/collections/lru.d.ts @@ -0,0 +1,213 @@ +declare namespace adone.collection { + namespace I.LRU { + type LengthCalculator = (value: V, key: K) => number; + interface ConstructorOptions { + /** + * The maximum size of the cache, checked by applying the length function to all values in the cache. + * Default is Infinity + */ + max?: number; + + /** + * Maximum age in ms. Items are not pro-actively pruned out as they age, + * but if you try to get an item that is too old, + * it'll drop it and return undefined instead of giving it to you + */ + maxAge?: number; + + /** + * Function that is used to calculate the length of stored items + */ + length?: LengthCalculator; + + /** + * Function that is called on items when they are dropped from the cache + */ + dispose?(key: K, value: V): void; + + /** + * Whether to return the stale value before deleting it + */ + stale?: boolean; + + /** + * Dispose will only be called when a key falls out of the cache, not when it is overwritten + */ + noDisposeOnSet?: boolean; + } + + interface SerializedEntry { + /** + * key + */ + key: K; + + /** + * value + */ + value: V; + + /** + * when it becomes expired + */ + e: number; + } + + interface Entry { + /** + * key + */ + key: K; + + /** + * value + */ + value: V; + + /** + * entry length + */ + length: number; + + /** + * Timestamp when the entry was created + */ + now: number; + + /** + * Maximum live time + */ + maxAge: number; + } + } + + /** + * Represent an LRU cache + */ + class LRU { + /** + * Creates an LRU cache of the given size + */ + constructor(max: number); + + /** + * Creates an LRU cache with the given options + */ + constructor(options?: I.LRU.ConstructorOptions); + + /** + * The length of the cache, setter resizes the cache + */ + max: number; + + /** + * stale setting + */ + allowStale: boolean; + + /** + * maxAge setting + */ + maxAge: number; + + /** + * length setting + */ + lengthCalculator: I.LRU.LengthCalculator; + + /** + * Total length of objects in cache taking into account length options function + */ + readonly length: number; + + /** + * Total quantity of objects currently in cache. + * Note, that stale items are returned as part of this item count. + */ + readonly itemCount: number; + + /** + * Iterates over all the keys in the cache, in reverse recent-ness order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (this: T, value: V, key: K, cache: LRU) => void, thisp?: T): void; + + /** + * Iterates over all the keys in the cache, in order of recent-ness + */ + forEach(fn: (this: T, value: V, key: K, cache: LRU) => void, thisp?: T): void; + + /** + * Returns an array of the keys in the cache + */ + keys(): K[]; + + /** + * Returns an array of the values in the cache + */ + values(): V[]; + + /** + * Clears the cache entirely, throwing away all values + */ + reset(): void; + + /** + * Return an array of the cache entries ready for serialization and usage with 'destinationCache.load(arr)` + */ + dump(): Array>; + + /** + * Returns an internal lru list of entries + */ + dumpLru(): LinkedList>; + + /** + * @param opts std.util.inspect options + */ + inspect(opts?: object): string; + + /** + * Sets a new value for the given key. Updates the "recently used"-ness of the key + * + * @param maxAge maxAge option specific for this key + * @returns Whether the key was set + */ + set(key: K, value: V, maxAge?: number): boolean; + + /** + * Check if a key is in the cache, without updating the recent-ness or deleting it for being stale + */ + has(key: K): boolean; + + /** + * Gets the value of the given key. Updates the "recently used"-ness of the key + */ + get(key: K): V | undefined; + + /** + * Returns the key value without updating the "recently used"-ness of the key + */ + peek(key: K): V | undefined; + + /** + * Deletes the less recently used element + */ + pop(): I.LRU.Entry; + + /** + * Deletes a key out of the cache + */ + del(key: K): void; + + /** + * Loads another cache entries array, obtained with sourceCache.dump(), into the cache. + * The destination cache is reset before loading new entries + */ + load(arr: Array>): void; + + /** + * Manually iterates over the entire cache proactively pruning old entries + */ + prune(): void; + } +} diff --git a/types/adone/glosses/collections/map_cache.d.ts b/types/adone/glosses/collections/map_cache.d.ts new file mode 100644 index 0000000000..55bbb6e05f --- /dev/null +++ b/types/adone/glosses/collections/map_cache.d.ts @@ -0,0 +1,13 @@ +declare namespace adone.collection { + class MapCache { + has(key: string): boolean; + + get(key: string): T; + + set(key: string, value: T): void; + + delete(key: string): void; + + clear(): void; + } +} diff --git a/types/adone/glosses/collections/ns_cache.d.ts b/types/adone/glosses/collections/ns_cache.d.ts new file mode 100644 index 0000000000..5630c295d3 --- /dev/null +++ b/types/adone/glosses/collections/ns_cache.d.ts @@ -0,0 +1,17 @@ +declare namespace adone.collection { + class NSCache { + constructor(size: number, namespaces: string[]); + + resize(newSize: number): void; + + set(ns: string, key: string, value: T): void; + + get(ns: string, key: string): T; + + has(ns: string, key: string): boolean; + + delete(ns: string, key: string): void; + + clear(): void; + } +} diff --git a/types/adone/glosses/collections/priority_queue.d.ts b/types/adone/glosses/collections/priority_queue.d.ts new file mode 100644 index 0000000000..0fb1e92814 --- /dev/null +++ b/types/adone/glosses/collections/priority_queue.d.ts @@ -0,0 +1,78 @@ +declare namespace adone.collection { + namespace I.PriorityQueue { + interface ConstructorOptions { + /** + * Function that compares objects. + * + * Must return a positive value if a > b, a negative if a < b, and zero for equal objects + */ + compare?(a: T, b: T): number; + + /** + * Function that evaluates the priority value by the given objects, + * if the returned value > 0, then the first argument has higher priority, + * = 0 same priority, < 0 lower priority. + * By default the top element is an element that has the highest priority, + * the default priority function is equal to the compare function + */ + priority?(a: T, b: T): number; + } + } + + /** + * Represents a priority queue + */ + class PriorityQueue { + /** + * Whether the queue is empty + */ + readonly empty: boolean; + + /** + * The length of the queue + */ + readonly length: number; + + constructor(options?: I.PriorityQueue.ConstructorOptions); + + /** + * Clones the queue + */ + clone(): PriorityQueue; + + /** + * Inserts a new element + */ + push(x: T): this; + + /** + * Removes the top element (that has the highest priority) + */ + pop(): T | undefined; + + /** + * Deletes the given element from the queue + */ + delete(x: T): this; + + /** + * Replaces the top element (pop + push) + */ + replace(x: T): T; + + /** + * Faster push + pop + */ + pushpop(x: T): T; + + /** + * Converts the queue to an array, it works with a clone of the queue, so the original queue is untouched + */ + toArray(): T[]; + + /** + * Creates a queue object from the given iterable + */ + static from(iterable: Iterable, options?: I.PriorityQueue.ConstructorOptions): PriorityQueue; + } +} diff --git a/types/adone/glosses/collections/queue.d.ts b/types/adone/glosses/collections/queue.d.ts new file mode 100644 index 0000000000..e67eb8fda9 --- /dev/null +++ b/types/adone/glosses/collections/queue.d.ts @@ -0,0 +1,31 @@ +declare namespace adone.collection { + /** + * Represents a queue + */ + class Queue { + /** + * Whether the queue is full + */ + readonly full: boolean; + + /** + * The length of the queue + */ + readonly length: number; + + /** + * Whether the queue is empty + */ + readonly empty: boolean; + + /** + * Inserts a new element at the end + */ + push(x: S): this; + + /** + * Removes and returns an element from the beginning + */ + pop(): T | undefined; + } +} diff --git a/types/adone/glosses/collections/rb_tree.d.ts b/types/adone/glosses/collections/rb_tree.d.ts new file mode 100644 index 0000000000..2ed7a81323 --- /dev/null +++ b/types/adone/glosses/collections/rb_tree.d.ts @@ -0,0 +1,184 @@ +declare namespace adone.collection { + namespace I.RedBlackTree { + interface Node { + /** + * The key associated to the node + */ + key: K; + + /** + * The value associated to the node + */ + value: V; + + /** + * The left subtree of the node + */ + left?: Node; + + /** + * The right subtree of the node + */ + right?: Node; + } + + interface Iterator { + /** + * Checks if the iterator is valid + */ + readonly valid: boolean; + + /** + * The value of the node at the iterator's current position, null if invalid + */ + readonly node: Node | null; + + /** + * The key of the item referenced by the iterator, undefined if invalid + */ + readonly key?: K; + + /** + * The value of the item referenced by the iterator, undefined if invalid + */ + readonly value?: V; + + /** + * Returns the position of this iterator in the sequence + */ + readonly index: number; + + /** + * If true, then the iterator is not at the end of the sequence + */ + readonly hasNext: boolean; + + /** + * If true, then the iterator is not at the beginning of the sequence + */ + readonly hasPrev: boolean; + + /** + * The tree associated to the iterator + */ + tree: RedBlackTree; + + /** + * Makes a copy of the iterator + */ + clone(): Iterator; + + /** + * Removes the item at the position of the iterator and returns a new rb-tree + */ + remove(): RedBlackTree; + + /** + * Advances the iterator to the next position + */ + next(): void; + + /** + * Updates the value of the node in the tree at this iterator and returns a new rb-tree + */ + update(value: V): RedBlackTree; + + /** + * Moves the iterator backward one element + */ + prev(): void; + } + } + + /** + * Represents a fully persistent red-black tree + */ + class RedBlackTree { + /** + * The root node of the tree + */ + root: I.RedBlackTree.Node; + + constructor(compare?: (a: K, b: K) => number, root?: RedBlackTree); + + /** + * A sorted array of all the keys in the tree + */ + readonly keys: K[]; + + /** + * An array of all the values in the tree + */ + readonly values: V[]; + + /** + * The number of items in the tree + */ + readonly length: number; + + /** + * An iterator pointing to the first element in the tree + */ + readonly begin: I.RedBlackTree.Iterator; + + /** + * An iterator pointing to the last element in the tree + */ + readonly end: I.RedBlackTree.Iterator; + + /** + * Creates a new tree with the new pair inserted + */ + insert(key: K, value: V): RedBlackTree; + + /** + * Walks a visitor function over the nodes of the tree in order + * + * @param visit A callback that gets executed on each node. + * If a truthy value is returned from the visitor, then iteration is stopped. + * @param lo An optional start of the range to visit (inclusive) + * @param hi An optional end of the range to visit (non-inclusive) + */ + forEach(visit: (key: K, value: V) => T, lo?: K, hi?: K): T; + + /** + * Finds an iterator starting at the given element + */ + at(idx: number): I.RedBlackTree.Iterator; + + /** + * Finds the first item in the tree whose key is >= key + */ + ge(key: K): I.RedBlackTree.Iterator; + + /** + * Finds the first item in the tree whose key is > key + */ + gt(key: K): I.RedBlackTree.Iterator; + + /** + * Finds the first item in the tree whose key is < key + */ + lt(key: K): I.RedBlackTree.Iterator; + + /** + * Finds the first item in the tree whose key is <= key + */ + le(key: K): I.RedBlackTree.Iterator; + + /** + * Returns an iterator pointing to the first item in the tree with key, otherwise null + */ + find(key: K): I.RedBlackTree.Iterator | null; + + /** + * Removes the first item with key in the tree + */ + remove(key: K): RedBlackTree; + + /** + * Retrieves the value associated to the given key + */ + get(key: K): V | undefined; + } +} diff --git a/types/adone/glosses/collections/refcounted_cache.d.ts b/types/adone/glosses/collections/refcounted_cache.d.ts new file mode 100644 index 0000000000..79410423a4 --- /dev/null +++ b/types/adone/glosses/collections/refcounted_cache.d.ts @@ -0,0 +1,9 @@ +declare namespace adone.collection { + class RefcountedCache extends MapCache { + ref(key: string): void; + + unref(key: string): void; + + references(key: string): number; + } +} diff --git a/types/adone/glosses/collections/set.d.ts b/types/adone/glosses/collections/set.d.ts new file mode 100644 index 0000000000..f1a6bae96d --- /dev/null +++ b/types/adone/glosses/collections/set.d.ts @@ -0,0 +1,17 @@ +declare namespace adone.collection { + class Set { + constructor(key?: (x: T) => any); + + has(value: T): boolean; + + add(value: T): void; + + delete(value: T): void; + + get(value: T): T; // ??? + + readonly size: number; + + only(): T; + } +} diff --git a/types/adone/glosses/collections/stack.d.ts b/types/adone/glosses/collections/stack.d.ts new file mode 100644 index 0000000000..90fe35b99b --- /dev/null +++ b/types/adone/glosses/collections/stack.d.ts @@ -0,0 +1,36 @@ +declare namespace adone.collection { + /** + * Represents a stack + */ + class Stack { + /** + * Whether the stack is empty + */ + readonly empty: boolean; + + /** + * The top element of the stack + */ + readonly top: T; + + /** + * Inserts a new element + */ + push(x: T): this; + + /** + * Removes the top element + */ + pop(): T | undefined; + + /** + * Returns an iterator over the values + */ + [Symbol.iterator](): IterableIterator; + + /** + * Creates a stack and pushed all the values from the given iterable object + */ + static from(iterable: Iterable): Stack; + } +} diff --git a/types/adone/glosses/collections/timedout_map.d.ts b/types/adone/glosses/collections/timedout_map.d.ts new file mode 100644 index 0000000000..fedcf79fa2 --- /dev/null +++ b/types/adone/glosses/collections/timedout_map.d.ts @@ -0,0 +1,32 @@ +declare namespace adone.collection { + /** + * Represents a Map that keeps keys only for a specified interval of time + */ + class TimedoutMap extends Map { + /** + * @param timeout maximum age of the keys, 1000 by default + * @param callback callback that is called with each key when the timeout is passed + */ + constructor(timeout?: number, callback?: (key: K) => void); + + /** + * Gets the timeout + */ + getTimeout(): number; + + /** + * Sets the timeout + */ + setTimeout(ms: number): void; + + /** + * Iterates over the map and calls the callback for each element + */ + forEach(callback: (this: T, value: V, key: K, cache: this) => void, thisArg?: T): this; + + /** + * Deletes the given key + */ + delete(key: K): boolean; + } +} diff --git a/types/adone/glosses/data.d.ts b/types/adone/glosses/data.d.ts index f711836bdd..4d3dae7b2b 100644 --- a/types/adone/glosses/data.d.ts +++ b/types/adone/glosses/data.d.ts @@ -30,7 +30,12 @@ declare namespace adone { * or an array of String and Number objects that serve as a whitelist * for selecting/filtering the properties of the value object to be included in the JSON string */ - replacer?: I.Replacer + replacer?: I.Replacer, + + /** + * Wheter to append a newline + */ + newline?: boolean }): Buffer; /** @@ -84,6 +89,8 @@ declare namespace adone { */ function decode(buf: collection.I.ByteArray.Wrappable): any; + function tryDecode(buf: collection.ByteArray): any; + namespace I { type Type = string | number; // ? type DecodeFunction = (buf: collection.ByteArray) => any; @@ -153,6 +160,8 @@ declare namespace adone { * Represents a MessagePack serializer */ class Serializer { + constructor(initialCapacity?: number); + /** * Encoder instance */ @@ -211,6 +220,8 @@ declare namespace adone { * x.Exception, Error, Date, Map, Set, math.Long */ const serializer: Serializer; + + function registerCommonTypesFor(s: Serializer): void; } /** @@ -244,21 +255,32 @@ declare namespace adone { * Base64 encoder */ namespace base64 { + namespace I { + interface DecodeOptions { + buffer?: boolean; + encoding?: string; + } + + interface EncodeOptions { + buffer?: boolean; + } + } + /** * Encodes a string/Buffer to base64 */ - function encode(str: string | Buffer, options: { buffer: false }): string; - function encode(str: string | Buffer, options?: { buffer?: true }): Buffer; + function encode(str: string | Buffer, options: I.EncodeOptions & { buffer: false }): string; + function encode(str: string | Buffer, options?: I.EncodeOptions): Buffer; /** * Decodes base64 string/buffer into a buffer */ - function decode(str: string | Buffer, options: { buffer: true }): Buffer; + function decode(str: string | Buffer, options: I.DecodeOptions & { buffer: true }): Buffer; /** * Decodes base64 string/buffer into a string */ - function decode(str: string | Buffer, options?: { buffer?: false }): string; + function decode(str: string | Buffer, options?: I.DecodeOptions): string; function encodeVLQ(value: number): string; @@ -560,7 +582,7 @@ declare namespace adone { /** * Represents a YAML exception */ - class Exception extends adone.x.Exception { + class Exception extends adone.exception.Exception { reason: string; mark: Mark; @@ -1028,5 +1050,183 @@ declare namespace adone { */ function decode(buf: Buffer, options?: I.DeserializeOptions): any; } + + namespace protobuf { + namespace schema { + namespace I { + interface Field { + name: string | null; + type: string | null; + tag: number; + map: { + from: string; + to: string; + } | null; + oneof: string | null; + required: boolean; + repeated: boolean; + options: object; + } + + interface Enum { + name: string; + values: object; + options: object; + } + + interface Extend { + name: string; + message: Message; + } + + interface Message { + name: string; + enums: Enum[]; + extends: Extend[]; + messages: Message[]; + fields: Field[]; + extensions: { + from: number, + to: number + } | null; + } + + interface RPCMethod { + name: string; + input_type: string | null; + output_type: string | null; + client_streaming: boolean; + server_streaming: boolean; + options: object; + } + + interface Service { + name: string; + methods: RPCMethod[]; + options: object; + } + + interface Schema { + syntax: any; // ?? + package: string | null; + imports: string[]; + enums: Enum[]; + messages: Message[]; + options: object; + extends: Extend[]; + services?: Service[]; + } + } + + function parse(buf: Buffer | string): I.Schema; + + function stringify(schema: object): string; + } + + function create(proto: Buffer | string | object, opts?: object): object; + } + + namespace base32 { + function charmap(alphabet: string, mappings?: T): T; + + namespace I { + interface Spec { + alphabet: string; + charmap: { + [c: string]: number; + }; + } + } + + const rfc4648: I.Spec; + + const crockford: I.Spec; + + const base32hex: I.Spec; + + namespace I { + interface DecoderOptions { + type: "rfc4648" | "crockford" | "base32hex"; + charmap?: object; + } + + interface EncoderOptions { + type: "rfc4648" | "crockford" | "base32hex"; + alphabet?: string; + } + } + + class Decoder { + constructor(options?: I.DecoderOptions); + + write(str: string): this; + + finalize(str?: string): Buffer; + } + + class Encoder { + constructor(options?: I.EncoderOptions); + + write(buf: Buffer): this; + + finalize(buf?: Buffer): string; + } + + function encode(buf: Buffer, options?: I.EncoderOptions): string; + + function decode(str: string, options?: I.DecoderOptions): Buffer; + } + + namespace I { + interface BaseX { + encode(buf: Buffer): string; + + decode(str: string): Buffer; + + decodeUnsafe(str: string): Buffer; + } + } + + function basex(alphabet: string): I.BaseX; + + const base58: I.BaseX; + + namespace base64url { + function unescape(str: string): string; + + function escape(str: string): string; + + namespace I { + interface EncodeOptions { + encoding?: string; + } + + interface DecodeOptions { + encoding?: string; + buffer?: boolean; + } + } + + function encode(str: Buffer | string, options?: I.EncodeOptions): string; + + function decode(str: string, options: I.DecodeOptions & { buffer: true }): Buffer; + function decode(str: string, options?: I.DecodeOptions): string; + } + + namespace varint { + function encode(num: number, out?: T[], offset?: number): T[]; + + function decode(buf: Buffer, offset?: number): number; + + function encodingLength(value: number): number; + } + + namespace varintSigned { + function encode(num: number, out?: T[], offset?: number): T[]; + + function decode(buf: Buffer, offset?: number): number; + + function encodingLength(value: number): number; + } } } diff --git a/types/adone/glosses/events.d.ts b/types/adone/glosses/events.d.ts index ecb323f925..e812624aa9 100644 --- a/types/adone/glosses/events.d.ts +++ b/types/adone/glosses/events.d.ts @@ -1,25 +1,48 @@ declare namespace adone { namespace event { - class EventEmitter { - static listenerCount(emitter: EventEmitter, event: string | symbol): number; + namespace I { + interface PropagateEventsEnder { + end(): void; + } + } + + class Emitter { + static listenerCount(emitter: Emitter, event: string | symbol): number; + static defaultMaxListeners: number; addListener(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeAllListeners(event?: string | symbol): this; + setMaxListeners(n: number): this; + getMaxListeners(): number; + listeners(event: string | symbol): Array<(...args: any[]) => any>; + emit(event: string | symbol, ...args: any[]): boolean; + eventNames(): Array; + listenerCount(type: string | symbol): number; + + propagateEvents(dest: Emitter, events: string[]): I.PropagateEventsEnder; + + static propagateEvents(source: Emitter, dest: Emitter, events: string[]): I.PropagateEventsEnder; } - class AsyncEmitter extends EventEmitter { + class AsyncEmitter extends Emitter { constructor(concurrency?: number); setConcurrency(max?: number): this; diff --git a/types/adone/glosses/exceptions.d.ts b/types/adone/glosses/exceptions.d.ts index 347a3c632d..1b1981f80e 100644 --- a/types/adone/glosses/exceptions.d.ts +++ b/types/adone/glosses/exceptions.d.ts @@ -1,5 +1,5 @@ declare namespace adone { - namespace x { + namespace exception { class Exception extends Error { constructor(message?: string | Error, captureStackTrace?: boolean); } diff --git a/types/adone/glosses/fake.d.ts b/types/adone/glosses/fake.d.ts new file mode 100644 index 0000000000..0c403747e4 --- /dev/null +++ b/types/adone/glosses/fake.d.ts @@ -0,0 +1,337 @@ +declare namespace adone { + namespace fake { + namespace I { + interface Card { + name: string; + username: string; + email: string; + address: FullAddress; + phone: string; + website: string; + company: Company; + posts: Post[]; + accountHistory: string[]; + } + + interface FullAddress { + streetA: string; + streetB: string; + streetC: string; + streetD: string; + city: string; + state: string; + county: string; + zipcode: string; + geo: Geo; + } + + interface Geo { + lat: string; + lng: string; + } + + interface Company { + name: string; + catchPhrase: string; + bs: string; + } + + interface Post { + words: string; + sentence: string; + sentences: string; + paragraph: string; + } + + interface ContextualCard { + name: string; + username: string; + email: string; + dob: Date; + phone: string; + address: Address; + website: string; + company: Company; + } + + interface Address { + street: string; + suite: string; + city: string; + state: string; + zipcode: string; + geo: Geo; + } + + interface UserCard { + name: string; + username: string; + email: string; + address: Address; + phone: string; + website: string; + company: Company; + } + + interface Transaction { + amount: string; + date: Date; + business: string; + name: string; + type: string; + account: string; + } + } + + namespace address { + function zipCode(format?: string): string; + function city(format?: number): string; + function cityPrefix(): string; + function citySuffix(): string; + function streetName(): string; + function streetAddress(useFullAddress?: boolean): string; + function streetSuffix(): string; + function streetPrefix(): string; + function secondaryAddress(): string; + function county(): string; + function country(): string; + function countryCode(): string; + function state(useAbbr?: boolean): string; + function stateAbbr(): string; + function latitude(): string; + function longitude(): string; + } + + namespace commerce { + function color(): string; + function department(): string; + function productName(): string; + function price(min?: number, max?: number, dec?: number, symbol?: string): string; + function productAdjective(): string; + function productMaterial(): string; + function product(): string; + } + + namespace company { + function suffixes(): string[]; + function companyName(format?: number): string; + function companySuffix(): string; + function catchPhrase(): string; + function bs(): string; + function catchPhraseAdjective(): string; + function catchPhraseDescriptor(): string; + function catchPhraseNoun(): string; + function bsAdjective(): string; + function bsBuzz(): string; + function bsNoun(): string; + } + + namespace database { + function column(): string; + function type(): string; + function collation(): string; + function engine(): string; + } + + namespace date { + function past(years?: number, refDate?: string|Date): Date; + function future(years?: number, refDate?: string|Date): Date; + function between(from: string|number|Date, to: string|Date): Date; + function recent(days?: number): Date; + function soon(days?: number): Date; + function month(options?: { abbr?: boolean, context?: boolean }): string; + function weekday(options?: { abbr?: boolean, context?: boolean }): string; + } + + function fake(str: string): string; + + namespace finance { + function account(length?: number): string; + function accountName(): string; + function mask(length?: number, parens?: boolean, elipsis?: boolean): string; + function amount(min?: number, max?: number, dec?: number, symbol?: string): string; + function transactionType(): string; + function currencyCode(): string; + function currencyName(): string; + function currencySymbol(): string; + function bitcoinAddress(): string; + function ethereumAddress(): string; + function iban(formatted?: boolean): string; + function bic(): string; + } + + namespace hacker { + function abbreviation(): string; + function adjective(): string; + function noun(): string; + function verb(): string; + function ingverb(): string; + function phrase(): string; + } + + namespace helpers { + function randomize(array: T[]): T; + function randomize(): string; + function slugify(string?: string): string; + function replaceSymbolWithNumber(string?: string, symbol?: string): string; + function replaceSymbols(string?: string): string; + function shuffle(o: T[]): T[]; + function shuffle(): string[]; + function mustache(str: string, data: { [key: string]: string|((substring: string, ...args: any[]) => string) }): string; + function createCard(): I.Card; + function contextualCard(): I.ContextualCard; + function userCard(): I.UserCard; + function createTransaction(): I.Transaction; + } + + namespace image { + function image(): string; + function avatar(): string; + function imageUrl(width?: number, height?: number, category?: string): string; + function abstract(width?: number, height?: number): string; + function animals(width?: number, height?: number): string; + function business(width?: number, height?: number): string; + function cats(width?: number, height?: number): string; + function city(width?: number, height?: number): string; + function food(width?: number, height?: number): string; + function nightlife(width?: number, height?: number): string; + function fashion(width?: number, height?: number): string; + function people(width?: number, height?: number): string; + function nature(width?: number, height?: number): string; + function sports(width?: number, height?: number): string; + function technics(width?: number, height?: number): string; + function transport(width?: number, height?: number): string; + function dataUri(width?: number, height?: number): string; + } + + namespace internet { + function avatar(): string; + function email(firstName?: string, lastName?: string, provider?: string): string; + function exampleEmail(firstName?: string, lastName?: string): string; + function userName(firstName?: string, lastName?: string): string; + function protocol(): string; + function url(): string; + function domainName(): string; + function domainSuffix(): string; + function domainWord(): string; + function ip(): string; + function ipv6(): string; + function userAgent(): string; + function color(baseRed255?: number, baseGreen255?: number, baseBlue255?: number): string; + function mac(): string; + function password(len?: number, memorable?: boolean, pattern?: string|RegExp, prefix?: string): string; + } + + namespace lorem { + function word(): string; + function words(num?: number): string; + function sentence(wordCount?: number, range?: number): string; + function slug(wordCount?: number): string; + function sentences(sentenceCount?: number): string; + function paragraph(sentenceCount?: number): string; + function paragraphs(paragraphCount?: number, separator?: string): string; + function text(times?: number): string; + function lines(lineCount?: number): string; + } + + namespace name { + function firstName(gender?: number): string; + function lastName(gender?: number): string; + function findName(firstName?: string, lastName?: string, gender?: number): string; + function jobTitle(): string; + function prefix(): string; + function suffix(): string; + function title(): string; + function jobDescriptor(): string; + function jobArea(): string; + function jobType(): string; + } + + namespace phone { + function phoneNumber(format?: string): string; + function phoneNumberFormat(phoneFormatsArrayIndex?: number): string; + function phoneFormats(): string; + } + + namespace random { + function number(max: number): number; + function number(options?: { min?: number, max?: number, precision?: number }): number; + function arrayElement(): string; + function arrayElement(array: T[]): T; + function objectElement(object?: { [key: string]: any }, field?: "key"): string; + function objectElement(object?: { [key: string]: T }, field?: any): T; + function uuid(): string; + function boolean(): boolean; + function word(type?: string): string; + function words(count?: number): string; + function image(): string; + function locale(): string; + function alphaNumeric(count?: number): string; + function hexaDecimal(count?: number): string; + } + + namespace system { + function fileName(ext: string, type: string): string; + function commonFileName(ext: string, type: string): string; + function mimeType(): string; + function commonFileType(): string; + function commonFileExt(): string; + function fileType(): string; + function fileExt(mimeType: string): string; + function directoryPath(): string; + function filePath(): string; + function semver(): string; + } + + function seed(value: number): void; + + namespace I { + type Locale = + | "az" + | "cz" + | "de" + | "de_AT" + | "de_CH" + | "el" + | "en" + | "en_AU" + | "en_BORK" + | "en_CA" + | "en_GB" + | "en_IE" + | "en_IND" + | "en_US" + | "en_au_ocker" + | "es" + | "es_MX" + | "fa" + | "fr" + | "fr_CA" + | "ge" + | "id_ID" + | "it" + | "ja" + | "ko" + | "lv" + | "nb_NO" + | "nep" + | "nl" + | "nl_BE" + | "pl" + | "pt_BR" + | "ro" + | "ru" + | "sk" + | "sv" + | "tr" + | "uk" + | "vi" + | "zh_CN" + | "zh_TW"; + } + + function getLocale(): I.Locale; + + function setLocale(locale: I.Locale): void; + } +} diff --git a/types/adone/glosses/fast.d.ts b/types/adone/glosses/fast.d.ts index 725e0e9db3..1b04bec6d3 100644 --- a/types/adone/glosses/fast.d.ts +++ b/types/adone/glosses/fast.d.ts @@ -152,7 +152,7 @@ declare namespace adone { type SymbolicFile = File; /* tslint:disable-next-line:no-empty-interface */ - interface Stream extends stream.CoreStream { + interface Stream extends stream.core.Stream { // } } @@ -160,7 +160,7 @@ declare namespace adone { export const File: I.FileConstructor; namespace I { - type CoreStreamSource = stream.I.CoreStream.Source; + type CoreStreamSource = stream.core.I.Source; interface LocalStreamConstructorOptions { /** @@ -586,7 +586,7 @@ declare namespace adone { /** * Read JSON manifests written out by revisionHash */ - manifest?: File[] | stream.CoreStream, + manifest?: File[] | stream.core.Stream, /** * Modify the name of the unreved files before using them diff --git a/types/adone/glosses/fs.d.ts b/types/adone/glosses/fs.d.ts index 7fa8f51593..7517764faf 100644 --- a/types/adone/glosses/fs.d.ts +++ b/types/adone/glosses/fs.d.ts @@ -22,6 +22,14 @@ declare namespace adone { function readlink(path: string | Buffer | I.URL, options: { encoding: null }): Promise; function readlink(path: string | Buffer | I.URL, options?: { encoding?: I.Encoding }): Promise; + /** + * Reads the value of a symbolic link + */ + function readlinkSync(path: string | Buffer | I.URL, encoding: null): Buffer; + function readlinkSync(path: string | Buffer | I.URL, encoding: I.Encoding): string; + function readlinkSync(path: string | Buffer | I.URL, options: { encoding: null }): Buffer; + function readlinkSync(path: string | Buffer | I.URL, options?: { encoding?: I.Encoding }): string; + /** * Deletes a name and possibly the file it refers to */ @@ -32,6 +40,21 @@ declare namespace adone { */ function unlinkSync(path: string | Buffer | I.URL): void; + /** + * Changes the file system timestamps of the object referenced by path + */ + function utimes(path: string | Buffer | I.URL, atime: number | string | Date, mtime: number | string | Date): Promise; + + /** + * Changes the file system timestamps of the object referenced by path + */ + function utimesSync(path: string | Buffer | I.URL, atime: number | string | Date, mtime: number | string | Date): void; + + /** + * Changes the file system timestamps of the object referenced by path + */ + function utimesMillis(path: string | Buffer | I.URL, atime: number, mtime: number): Promise; + /** * Changes permissions of a file */ @@ -42,6 +65,11 @@ declare namespace adone { */ function chown(path: string | Buffer | I.URL, uid: number, gid: number): Promise; + /** + * Changes ownership recursively for a given path + */ + function chownr(path: string | Buffer | I.URL, uid: number, gid: number): Promise; + /** * Deletes a directory */ @@ -63,6 +91,87 @@ declare namespace adone { function readdirSync(path: string | Buffer | I.URL, options: { encoding: null }): Buffer[]; function readdirSync(path: string | Buffer | I.URL, options?: { encoding?: I.Encoding }): string[]; + namespace I { + interface ReaddirpEntry { + /** + * filename + */ + name: string; + + /** + * full path to a file + */ + fullPath: string; + + /** + * relative path to a file + */ + path: string; + + /** + * relative path to the parent dir + */ + parentDir: string; + + /** + * full path to the parent dir + */ + fullParentDir: string; + + /** + * file stats + */ + stat: fs.I.Stats; + } + + type ReaddirpFilter = string | ((entry: ReaddirpEntry) => boolean); + + interface ReaddirpOptions { + /** + * filter for files + */ + fileFilter?: ReaddirpFilter | ReaddirpFilter[]; + + /** + * filter for directories + */ + directoryFilter?: ReaddirpFilter | ReaddirpFilter[]; + + /** + * maximum recursion depth + * + * Infinity by default + */ + depth?: number; + + /** + * whether to emit files + * + * true by default + */ + files?: boolean; + + /** + * whether to emit directories + * + * true by default + */ + directories?: boolean; + + /** + * whether to use lstat for stating + * + * false by default + */ + lstat?: boolean; + } + } + + /** + * Traverses the given path + */ + function readdirp(root: string | Buffer | I.URL, options?: I.ReaddirpOptions): stream.core.Stream; + /** * Gets file status, identical to stat, except that if pathname is a symbolic link, * then it returns information about the link itself, not the file that it refers to @@ -117,6 +226,15 @@ declare namespace adone { flag?: I.Flag }): Promise; + /** + * Appends data to a file, creating the file if it does not yet exist + */ + function appendFileSync(file: string | Buffer | number, data: string | Buffer, options?: { + encoding?: I.Encoding, + mode?: number, + flag?: I.Flag + }): void; + /** * Tests a user's permissions for the file or directory specified by path */ @@ -154,6 +272,14 @@ declare namespace adone { cwd?: string }): Promise; + /** + * Recursively deletes empty directiries inside the given directory + */ + function rmEmpty(path: string, options?: { + cwd?: string; + filter?: (filename: string) => boolean + }): Promise; + namespace I { interface Access { read: boolean; @@ -460,12 +586,12 @@ declare namespace adone { /** * Copies this from this directory to the given path */ - copyTo(destPath: string, options?: I.CopyOptions): Promise; + copyTo(destPath: string, options?: I.CopyToOptions): Promise; /** * Copies files from the given path to this directory */ - copyFrom(srcPath: string, options?: I.CopyOptions): Promise; + copyFrom(srcPath: string, options?: I.CopyToOptions): Promise; /** * Creates a new directory with the given path @@ -560,7 +686,7 @@ declare namespace adone { /** * Represents a file that supports random access */ - class RandomAccessFile extends event.EventEmitter { + class RandomAccessFile extends event.Emitter { constructor(filename: string, options?: I.RandomAccessFile.ConstructorOptions); /** @@ -602,7 +728,7 @@ declare namespace adone { /** * Represents an abstract random access reader */ - class AbstractRandomAccessReader extends event.EventEmitter { + class AbstractRandomAccessReader extends event.Emitter { /** * Increments the reference counter */ @@ -826,7 +952,7 @@ declare namespace adone { }>; } - type Stream = stream.CoreStream; + type Stream = stream.core.Stream; interface EmitterConstructor { new(pattern: string, optons: Options, callback?: (error: any, matches: string[]) => void): Emitter; @@ -835,7 +961,7 @@ declare namespace adone { prototype: Emitter; } - interface Emitter extends event.EventEmitter { + interface Emitter extends event.Emitter { isIgnored(path: string): boolean; /** @@ -999,7 +1125,7 @@ declare namespace adone { /** * Represents a file watcher */ - class Watcher extends event.EventEmitter { + class Watcher extends event.Emitter { constructor(options?: I.Watcher.ConstructorOptions); /** @@ -1128,214 +1254,209 @@ declare namespace adone { function whichSync(cmd: string, options?: I.Which.Options): string; /** - * Functions to work with files using file descriptors + * Opens and possibly creates a file */ - namespace fd { - /** - * Opens and possibly create a file - */ - function open(path: string | Buffer | I.URL, flags: I.Flag | number, mode?: number): Promise; + function open(path: string | Buffer | I.URL, flags: I.Flag | number, mode?: number): Promise; - /** - * Opens and possibly create a file - */ - function openSync(path: string | Buffer | I.URL, flags: I.Flag | number, mode?: number): I.FD; + /** + * Opens and possibly creates a file + */ + function openSync(path: string | Buffer | I.URL, flags: I.Flag | number, mode?: number): I.FD; - /** - * Closes a file descriptor - */ - function close(fd: I.FD): Promise; + /** + * Closes a file descriptor + */ + function close(fd: I.FD): Promise; - /** - * Closes a file descriptor - */ - function closeSync(fd: I.FD): void; + /** + * Closes a file descriptor + */ + function closeSync(fd: I.FD): void; - /** - * Changes the file timestamps of a file referenced by the supplied file descriptor - */ - function utimes(fd: I.FD, atime: number, mtime: number): Promise; + /** + * Changes the file timestamps of a file referenced by the supplied file descriptor + */ + function futimes(fd: I.FD, atime: number, mtime: number): Promise; - /** - * Changes the file timestamps of a file referenced by the supplied file descriptor - */ - function utimesSync(fd: I.FD, atime: number, mtime: number): void; + /** + * Changes the file timestamps of a file referenced by the supplied file descriptor + */ + function futimesSync(fd: I.FD, atime: number, mtime: number): void; - /** - * Gets file status - */ - function stat(fd: I.FD): Promise; + /** + * Gets file status + */ + function fstat(fd: I.FD): Promise; - /** - * Gets file status - */ - function statSync(fd: I.FD): I.Stats; + /** + * Gets file status + */ + function fstatSync(fd: I.FD): I.Stats; - /** - * Truncates a file to a specified length - */ - function truncate(fd: I.FD, length?: number): Promise; + /** + * Truncates a file to a specified length + */ + function ftruncate(fd: I.FD, length?: number): Promise; - /** - * Truncates a file to a specified length - */ - function truncateSync(fd: I.FD, length?: number): void; + /** + * Truncates a file to a specified length + */ + function ftruncateSync(fd: I.FD, length?: number): void; + /** + * Read data from the file specified by fd + */ + function read( + fd: I.FD, /** - * Read data from the file specified by fd + * The buffer that the data will be written to */ - function read( - fd: I.FD, - /** - * The buffer that the data will be written to - */ - buffer: Buffer | Uint8Array, - /** - * The offset in the buffer to start writing at - */ - offset: number, - /** - * An integer specifying the number of bytes to read - */ - length: number, - /** - * An argument specifying where to begin reading from in the file - */ - position: number - ): Promise; - - function readSync( - fd: I.FD, - /** - * The buffer that the data will be written to - */ - buffer: Buffer | Uint8Array, - /** - * The offset in the buffer to start writing at - */ - offset: number, - /** - * An integer specifying the number of bytes to read - */ - length: number, - /** - * An argument specifying where to begin reading from in the file - */ - position: number - ): number; - + buffer: Buffer | Uint8Array, /** - * Writes buffer to the file specified by fd + * The offset in the buffer to start writing at */ - function write( - fd: I.FD, - buffer: Buffer | Uint8Array, - /** - * Determines the part of the buffer to be written - */ - offset?: number, - /** - * An integer specifying the number of bytes to write - */ - length?: number, - /** - * The offset from the beginning of the file where this data should be written - */ - position?: number - ): Promise; - + offset: number, /** - * Writes string to the file specified by fd + * An integer specifying the number of bytes to read */ - function write( - fd: I.FD, - string: string, - /** - * The offset from the beginning of the file where this data should be written - */ - position?: number, - /** - * The expected string encoding - */ - encoding?: I.Encoding - ): Promise; - + length: number, /** - * Writes buffer to the file specified by fd + * An argument specifying where to begin reading from in the file */ - function writeSync( - fd: I.FD, - buffer: Buffer | Uint8Array, - /** - * Determines the part of the buffer to be written - */ - offset?: number, - /** - * An integer specifying the number of bytes to write - */ - length?: number, - /** - * The offset from the beginning of the file where this data should be written - */ - position?: number - ): number; + position: number + ): Promise; + function readSync( + fd: I.FD, /** - * Writes string to the file specified by fd + * The buffer that the data will be written to */ - function writeSync( - fd: I.FD, - string: string, - /** - * The offset from the beginning of the file where this data should be written - */ - position?: number, - /** - * The expected string encoding - */ - encoding?: I.Encoding - ): number; + buffer: Buffer | Uint8Array, + /** + * The offset in the buffer to start writing at + */ + offset: number, + /** + * An integer specifying the number of bytes to read + */ + length: number, + /** + * An argument specifying where to begin reading from in the file + */ + position: number + ): number; + /** + * Writes buffer to the file specified by fd + */ + function write( + fd: I.FD, + buffer: Buffer | Uint8Array, /** - * Synchronizes a file's in-core state with storage + * Determines the part of the buffer to be written */ - function sync(fd: I.FD): Promise; + offset?: number, + /** + * An integer specifying the number of bytes to write + */ + length?: number, + /** + * The offset from the beginning of the file where this data should be written + */ + position?: number + ): Promise; + /** + * Writes string to the file specified by fd + */ + function write( + fd: I.FD, + string: string, /** - * Synchronizes a file's in-core state with storage + * The offset from the beginning of the file where this data should be written */ - function syncSync(fd: I.FD): void; + position?: number, + /** + * The expected string encoding + */ + encoding?: I.Encoding + ): Promise; + /** + * Writes buffer to the file specified by fd + */ + function writeSync( + fd: I.FD, + buffer: Buffer | Uint8Array, /** - * Changes ownership of a file + * Determines the part of the buffer to be written */ - function chown(fd: I.FD, uid: number, gid: number): Promise; + offset?: number, + /** + * An integer specifying the number of bytes to write + */ + length?: number, + /** + * The offset from the beginning of the file where this data should be written + */ + position?: number + ): number; + /** + * Writes string to the file specified by fd + */ + function writeSync( + fd: I.FD, + string: string, /** - * Changes ownership of a file + * The offset from the beginning of the file where this data should be written */ - function chownSync(fd: I.FD, uid: number, gid: number): void; + position?: number, + /** + * The expected string encoding + */ + encoding?: I.Encoding + ): number; - /** - * Changes permissions of a file - */ - function chmod(fd: I.FD, mode: number): Promise; + /** + * Synchronizes a file's in-core state with storage + */ + function fsync(fd: I.FD): Promise; - /** - * Changes permissions of a file - */ - function chmodSync(fd: I.FD, mode: number): void; + /** + * Synchronizes a file's in-core state with storage + */ + function fsyncSync(fd: I.FD): void; - /** - * Repositions read/write file offset - */ - function seek(fd: I.FD, offset: number, whence: number): Promise; + /** + * Changes ownership of a file + */ + function fchown(fd: I.FD, uid: number, gid: number): Promise; - /** - * Applies or removes an advisory lock on an open file - */ - function lock(fd: I.FD, flags: "sh" | "ex" | "shnb" | "exnb" | "un" | number): Promise; - } + /** + * Changes ownership of a file + */ + function fchownSync(fd: I.FD, uid: number, gid: number): void; + + /** + * Changes permissions of a file + */ + function fchmod(fd: I.FD, mode: number): Promise; + + /** + * Changes permissions of a file + */ + function fchmodSync(fd: I.FD, mode: number): void; + + /** + * Repositions read/write file offset + */ + function seek(fd: I.FD, offset: number, whence: number): Promise; + + /** + * Applies or removes an advisory lock on an open file + */ + function flock(fd: I.FD, flags: "sh" | "ex" | "shnb" | "exnb" | "un" | number): Promise; namespace constants { const F_OK: number; @@ -1475,12 +1596,63 @@ declare namespace adone { function existsSync(path: string | Buffer | I.URL): boolean; /** - * Creates a new directory and any necessary subdirectories + * Creates a new directory */ function mkdir(path: string, mode?: number): Promise; + /** + * Creates a new directory + */ + function mkdirSync(path: string, mode?: number): Promise; + + /** + * Creates a new directory and any necessary subdirectories + */ + function mkdirp(path: string, mode?: number): Promise; + + /** + * Creates a new directory and any necessary subdirectories + */ + function mkdirpSync(path: string, mode?: number): Promise; + namespace I { interface CopyOptions { + /** + * regexp or function against which each filename is tested whether to copy it or not + */ + filter?: RegExp | ((src: string, dst: string) => boolean); + + /** + * transform function which applies when files are streamed + */ + transform?( + readStream: NodeJS.ReadableStream, + writeStream: NodeJS.WritableStream, + file: { + name: string, + mode: number, + mtime: Date, + atime: Date, + stats: adone.fs.I.Stats + } + ): void; + + /** + * Whether to overwrite destination files if they exist. + * + * true by default + */ + clobber?: boolean; // ??? + + /** + * Whether to overwrite destination files if they exist. + * + * true by default + */ + overwrite?: boolean; + } + + interface CopyToOptions { /** * Do not replace existing files */ @@ -1494,10 +1666,15 @@ declare namespace adone { } /** - * Copies all files from src to dst + * Recursively copies all the files from src to dst */ function copy(src: string, dst: string, options?: I.CopyOptions): Promise; + /** + * Copies all files from src to dst + */ + function copyTo(src: string, dst: string, options?: I.CopyToOptions): Promise; + /** * Renames a file */ @@ -1514,8 +1691,32 @@ declare namespace adone { /** * Returns the last lines of a file + * + * @param path path to a file + * @param n number of lines to return */ - function tail(path: string, n: number, options?: { separator?: string, chunkLength?: number }): Promise; + function tail(path: string, n: number, options?: { + /** + * Line separator + * + * By default "\r\n" for windows and "\n" for others + */ + separator?: string, + + /** + * The number of bytes to read at once + * + * By default 4096 + */ + chunkLength?: number + + /** + * Position from which to start reading (from the end) + * + * By default stats.size of the file + */ + pos?: number + }): Promise; namespace I { interface StatVFS { @@ -1667,11 +1868,6 @@ declare namespace adone { */ function lookup(path: string): Promise; - /** - * Recursively changes ownership of files - */ - function chownr(path: string, uid: number, gid: number): Promise; - namespace I.TailWatcher { interface ConstructorOptions { /** @@ -1709,7 +1905,7 @@ declare namespace adone { * Represents an event emitter that watches for a file growing, * emits "line" event for each new line in a file */ - class TailWatcher extends event.EventEmitter { + class TailWatcher extends event.Emitter { constructor(filename: string, options?: I.TailWatcher.ConstructorOptions); /** diff --git a/types/adone/glosses/is.d.ts b/types/adone/glosses/is.d.ts index 335439a0bf..9065da138b 100644 --- a/types/adone/glosses/is.d.ts +++ b/types/adone/glosses/is.d.ts @@ -6,13 +6,13 @@ declare namespace adone { /** * Checks whether the given object is `null` */ - function _null(obj: any): boolean; + function _null(obj: any): obj is null; export { _null as null }; /** * Checks whether the given object is `undefined` */ - export function undefined(obj: any): boolean; + export function undefined(obj: any): obj is undefined; /** * Checks whether the given object is nither `undefined` nor `null` @@ -22,52 +22,54 @@ declare namespace adone { /** * Checks whether the given object is either `undefined` or `null` */ - export function nil(obj: any): boolean; + export function nil(obj: any): obj is undefined | null; /** * Checks whether the given object is a number */ - export function number(obj: any): boolean; + export function number(obj: any): obj is number; /** * Checks whether the given object is a finite number or a string represents a finite number */ - export function numeral(obj: any): boolean; + export function numeral(obj: number): obj is number; + export function numeral(obj: string): obj is string; + export function numeral(obj: any): obj is number | string; /** * Checks whether the given object is either +Infinity or -Inginity */ - export function infinite(obj: any): boolean; + export function infinite(obj: any): obj is number; /** * Checks whether the given object is an odd number */ - export function odd(obj: any): boolean; + export function odd(obj: any): obj is number; /** * Checks whether the given object is an even number */ - export function even(obj: any): boolean; + export function even(obj: any): obj is number; /** * Checks whether the given object is a float */ - export function float(obj: any): boolean; + export function float(obj: any): obj is number; /** * Checks whether the given object is -0 */ - export function negativeZero(obj: any): boolean; + export function negativeZero(obj: any): obj is number; /** * Checks whether the given object is a string */ - export function string(obj: any): boolean; + export function string(obj: any): obj is string; /** - * Checks whether the given object is an empty string + * Checks whether the given object is an empty string, i.e. a string with only whitespace characters */ - export function emptyString(obj: any): boolean; + export function emptyString(obj: any): obj is string; /** * Checks whether the first string is a substring of the second string from the given offset @@ -87,7 +89,7 @@ declare namespace adone { /** * Checks whether the given object is a boolean */ - export function boolean(obj: any): boolean; + export function boolean(obj: any): obj is boolean; /** * Checks whether the given object is a string with ".json" extension or an object @@ -215,7 +217,7 @@ declare namespace adone { /** * Checks whether the given string is a glob */ - export function glob(str: string): boolean; + export function glob(str: any): str is string; /** * Checks whether the given path is not a dot-file path (.secret) @@ -225,18 +227,18 @@ declare namespace adone { /** * Checks whether the given object is a function */ - function _function(obj: any): boolean; + function _function(obj: any): obj is (...args: any[]) => any; export { _function as function }; /** * Checks whether the given object is an async function */ - export function asyncFunction(obj: any): boolean; + export function asyncFunction(obj: any): obj is (...args: any[]) => Promise; /** * Checks whether the given object is a promise */ - export function promise(obj: any): boolean; + export function promise(obj: any): obj is PromiseLike; /** * Checks whether the given string is a valid date-string @@ -246,7 +248,7 @@ declare namespace adone { /** * Checks whether the given object is a buffer */ - export function buffer(obj: any): boolean; + export function buffer(obj: any): obj is Buffer; /** * Checks whether the given object is a callback function, i.e. it has a common function name @@ -266,27 +268,27 @@ declare namespace adone { /** * Checks whether the given object is a finite number */ - export function finite(obj: any): boolean; + export function finite(obj: any): obj is number; /** * Checks whether the given object is an integer */ - export function integer(obj: any): boolean; + export function integer(obj: any): obj is number; /** * Checks whether the given object is a safe integer */ - export function safeInteger(obj: any): boolean; + export function safeInteger(obj: any): obj is number; /** * Checks whether the given object is an array */ - export function array(obj: any): boolean; + export function array(obj: any): obj is any[]; /** * Checks whether the given object is a Uint8 array */ - export function uint8Array(obj: any): boolean; + export function uint8Array(obj: any): obj is Uint8Array; /** * Checks whether the given object is an adone configuration @@ -296,22 +298,22 @@ declare namespace adone { /** * Checks whether the given object is an instance of adone.math.Long */ - export function long(obj: any): boolean; + export function long(obj: any): obj is adone.math.Long; /** * Checks whether the given object is an instance of adone.math.BigNumber */ - export function bigNumber(obj: any): boolean; + export function bigNumber(obj: any): obj is adone.math.BigNumber; /** * Checks whether the given object is an instance of adone.collection.ByteArray */ - export function byteArray(obj: any): boolean; + export function byteArray(obj: any): obj is adone.collection.ByteArray; /** * Checks whether the given object is an instance of adone.datetime */ - export function datetime(obj: any): boolean; + export function datetime(obj: any): obj is adone.I.datetime.Datetime; export function transform(obj: any): boolean; @@ -498,17 +500,17 @@ declare namespace adone { /** * Checks whether the given object is an array buffer */ - export function arrayBuffer(obj: any): boolean; + export function arrayBuffer(obj: any): obj is ArrayBuffer; /** * Checks whether the given object is an array buffer view */ - export function arrayBufferView(obj: any): boolean; + export function arrayBufferView(obj: any): obj is ArrayBufferView; /** * Checks whether the given object is a date */ - export function date(obj: any): boolean; + export function date(obj: any): obj is Date; /** * Checks whether the given object is an error, instance of Error @@ -518,27 +520,22 @@ declare namespace adone { /** * Checks whether the given object is a map */ - export function map(obj: any): boolean; + export function map(obj: any): obj is Map; /** * Checks whether the given object is a regexp */ - export function regexp(obj: any): boolean; + export function regexp(obj: any): obj is RegExp; /** * Checks whether the given object is a set */ - export function set(obj: any): boolean; + export function set(obj: any): obj is Set; /** * Checks whether the given object is a symbol */ - export function symbol(obj: any): boolean; - - /** - * Checks whether the given buffer a valid UTF-8 encoded text - */ - export function validUTF8(obj: Buffer): boolean; + export function symbol(obj: any): obj is symbol; /** * Checks whether the given object is a vault valuable @@ -549,5 +546,135 @@ declare namespace adone { * Checks whether the given object is an adone task */ export function task(obj: any): boolean; + + namespace I { + interface FQDNOptions { + /** + * Whether to require top-level domain, default `true` + */ + requireTld?: boolean; + + /** + * Whether to allow underscores("_"), default `false` + */ + allowUnderscores?: boolean; + + /** + * Whether to allow trailing dot, default `false` + */ + allowTrailingDot?: boolean; + } + } + + /** + * Checks whether the given object(string) is a fully qualified domain name (e.g. domain.com). + */ + export function fqdn(obj: any, options?: I.FQDNOptions): obj is string; + + /** + * Checks whether the given object(string) is a url + */ + export function url(obj: any, options?: I.FQDNOptions & { + /** + * List of valid protocols. + * Used when requireValidProtocol is `true`. + * Default ["http", "https", "ftp"] + */ + protocols?: string[], + + /** + * Whether to require protocol, default `true` + */ + requireProtocol?: boolean, + + /** + * Whether to require host, default `true` + */ + requireHost?: boolean, + + /** + * Whether to require valid protocol defined in `protocols` options, default `true` + */ + requireValidProtocol?: boolean, + + /** + * Whether to allow urls like "//example.com", default `false` + */ + allowProtocolRelativeUrls?: boolean + }): obj is string; + + /** + * Checks whether the given object(string) is a valid email address + */ + export function email(obj: any, options?: { + /** + * Whether to allow email addresses with display names ("Name "") + */ + allowDisplayName?: boolean, + + /** + * Whether to require display name + */ + requireDisplayName?: boolean, + + /** + * Whether to allow UTF8 characters in the local part + */ + allowUtf8LocalPart?: boolean, + + /** + * Whether to require top-level domain, default `true` + */ + requireTld?: boolean + }): obj is string; + + /** + * Checks whether the given object is a valid IPv4 address + */ + export function ip(obj: any, version: 4): boolean; + + /** + * Checks whether the given object is a valid IPv6 address + */ + export function ip(obj: any, version: 6): boolean; + + /** + * Checks whether the given object in a valid IPv4 or IPv6 address + */ + export function ip(obj: any): boolean; + + /** + * Checks whether the given object is a valid UUIDv1 identifier + */ + export function uuid(obj: any, version: 1): obj is string; + + /** + * Checks whether the given object is a valid UUIDv2 identifier + */ + export function uuid(obj: any, version: 2): obj is string; + + /** + * Checks whether the given object is a valid UUIDv3 identifier + */ + export function uuid(obj: any, version: 3): obj is string; + + /** + * Checks whether the given object is a valid UUIDv4 identifier + */ + export function uuid(obj: any, version: 4): obj is string; + + /** + * Checks whether the given object is a valid UUIDv5 identifier + */ + export function uuid(obj: any, version: 5): obj is string; + + /** + * Checks whether the given object is a valid UUID identifier (v1, v2, v3, v4 or v5) + */ + export function uuid(obj: any, version?: "all"): obj is string; + + export function emitter(obj: any): obj is event.Emitter; + + export function asyncEmitter(obj: any): obj is event.AsyncEmitter; } } diff --git a/types/adone/glosses/meta.d.ts b/types/adone/glosses/meta.d.ts new file mode 100644 index 0000000000..bc96c1e148 --- /dev/null +++ b/types/adone/glosses/meta.d.ts @@ -0,0 +1,13 @@ +declare namespace adone { + namespace meta { + namespace I { + type PossibleTypes = "object" | "class" | "null" | "global" | "Array" | "RegExp" | "Date" + | "Promise" | "Set" | "Map" | "WeakSet" | "DataView" | "Map Iterator" | "Set Iterator" + | "Array Iterator" | "String Iterator" | "Object" | "function" | "boolean" | "number" + | "undefined" | "string" | "symbol"; + } + + function typeOf(obj: any): I.PossibleTypes; + function typeOf(obj: any): string; + } +} diff --git a/types/adone/glosses/promise.d.ts b/types/adone/glosses/promise.d.ts index cdfe0ec2f5..cc0eac9c73 100644 --- a/types/adone/glosses/promise.d.ts +++ b/types/adone/glosses/promise.d.ts @@ -125,5 +125,36 @@ declare namespace adone { */ function _finally(promise: Promise, onFinally?: (...args: any[]) => void): Promise; export { _finally as finally }; + + namespace I { + type ResolvableProps = object & {[K in keyof T]: PromiseLike | T[K]}; + } + + /** + * Returns a promise that is fulfilled when all the object's values are fulfilled + */ + export function props(obj: I.ResolvableProps): Promise; + + namespace I { + interface _RetryOptions { + max: number; + + timeout: number; + + match: (string | RegExp | Error) | Array; + + backOffBase: number; + + backOffExponent: number; + + report: (message: string, options: _RetryOptions, err: any) => void; + + name: string; + } + + type RetryOptions = Partial<_RetryOptions>; + } + + export function retry(fn: (info: { current: number }) => PromiseLike | T, options?: number | I.RetryOptions): Promise; } } diff --git a/types/adone/glosses/shani.d.ts b/types/adone/glosses/shani.d.ts index 0b79633f78..5bc2d0153f 100644 --- a/types/adone/glosses/shani.d.ts +++ b/types/adone/glosses/shani.d.ts @@ -94,6 +94,11 @@ declare namespace adone { * Mark this block as exclusive */ skip: DescribeFunction; + + /** + * Mark this block as todo + */ + todo: DescribeFunction; } interface TestOptions { @@ -146,6 +151,11 @@ declare namespace adone { * Mark this test as exclusive */ skip: TestFunction; + + /** + * Mark this test as todo + */ + todo: TestFunction; } interface HookRuntimeContext { @@ -172,7 +182,7 @@ declare namespace adone { | "end before each hook" | "end after each hook" | "end before test hook" | "end after test hook"; - interface Emitter extends event.EventEmitter { + interface Emitter extends event.Emitter { on(event: "enter block", listener: (event: { block: Block }) => void): this; on(event: "exit block", listener: (event: { block: Block }) => void): this; on(event: "start test", listener: (event: { block: Block, test: Test }) => void): this; @@ -267,6 +277,11 @@ declare namespace adone { */ only(): this; + /** + * Marks this test as todo + */ + todo(): this; + /** * Returns the timeout of the test */ @@ -355,6 +370,11 @@ declare namespace adone { */ only(): this; + /** + * Marks this block as todo + */ + todo(): this; + /** * Returns the timeout of the block */ @@ -1423,7 +1443,7 @@ declare namespace adone { /** * Requires the value to be of the given type */ - typeOf(type: adone.util.I.PossibleTypes): Matcher; + typeOf(type: adone.meta.I.PossibleTypes): Matcher; typeOf(type: string): Matcher; /** diff --git a/types/adone/glosses/std.d.ts b/types/adone/glosses/std.d.ts index ec4bc4c37a..58be35f3b5 100644 --- a/types/adone/glosses/std.d.ts +++ b/types/adone/glosses/std.d.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert = require("assert"); import * as fs from "fs"; import * as path from "path"; import * as util from "util"; diff --git a/types/adone/glosses/streams.d.ts b/types/adone/glosses/streams.d.ts index 012a6aadc3..e4d07065b6 100644 --- a/types/adone/glosses/streams.d.ts +++ b/types/adone/glosses/streams.d.ts @@ -1,223 +1,225 @@ declare namespace adone { namespace stream { - namespace I.CoreStream { - interface ConstructorOptions { - /** - * Whether the initial stream is asynchronous - */ - async?: boolean; + namespace core { + namespace I { + interface ConstructorOptions { + /** + * Whether the initial stream is asynchronous + */ + async?: boolean; - /** - * Whether the initial stream is synchronous - */ - sync?: boolean; + /** + * Whether the initial stream is synchronous + */ + sync?: boolean; - /** - * The initial transform (passthrough is default) - */ - transform?: TransformFunction; + /** + * The initial transform (passthrough is default) + */ + transform?: TransformFunction; - /** - * The initial flush function - */ - flush?: FlushFunction; + /** + * The initial flush function + */ + flush?: FlushFunction; + } + + type Source = S[] | Stream; + + interface TransformContext { + /** + * Pushes the given value into the stream + */ + push(value: T): boolean; + } + + type TransformFunction = (this: TransformContext, value: S) => void; + type FlushFunction = (this: TransformContext) => void; } - type Source = S[] | CoreStream; + /** + * Represents a chain of transform streams + */ + class Stream implements PromiseLike { + constructor(source?: I.Source, options?: I.ConstructorOptions); + + /** + * Writes the given value into the stream + */ + write(value: S): boolean; - interface TransformContext { /** * Pushes the given value into the stream */ push(value: T): boolean; + + /** + * Ends the stream + */ + end(): this; + + /** + * Destroys the stream + */ + destroy(): this; + + /** + * Pauses the stream + */ + pause(): this; + + /** + * Resumes the stream + */ + resume(): this; + + /** + * Whether the stream is paused + */ + isPaused(): boolean; + + /** + * Whether the stream is ended + */ + isEnded(): boolean; + + /** + * Pipes this stream to another + */ + pipe(stream: T, options?: { end?: boolean }): T; + + /** + * Adds a new synchronous transform stream into the chain + */ + throughSync(transform: I.TransformFunction, flush?: I.FlushFunction): Stream; + + /** + * Adds a new asynchronous transform stream into the chain + */ + throughAsync(transform: I.TransformFunction, flush?: I.FlushFunction): Stream; + + /** + * Adds a new transform stream into the chain + */ + through(transform: I.TransformFunction, flush?: I.FlushFunction): Stream; + + /** + * Adds a new map transform into the chain. + * + * Note: synchronous functions create a synchronous transform. + * If your function returns a promise use an asynchronous function if you don't want to pass a promise through the stream + */ + map(callback: (value: T) => R | Promise): Stream; + + /** + * Adds a new conditional map transform into the chain + */ + mapIf(condition: (value: T) => boolean | Promise, callback: (value: T) => R): Stream; + + /** + * Adds a new filter transform into the chain + */ + filter(callback: (value: T) => boolean | Promise): this; + + /** + * Adds a new transform that calls the given callback for each value from the stream. + * + * This method resumes the stream. + */ + forEach(callback: (value: T) => void, options?: { + /** + * Whethe to wait for asynchronous functions (await) + */ + wait?: boolean, + + /** + * Passthrough the read values, by default it eats everything + */ + passthrough?: boolean + }): this; + + /** + * Adds a new transform that calls the given callback when the underlying stream ends. + * + * This method resumes the stream. + */ + done(callback: () => void, options?: { + /** + * Passthrough the read values, by default it eats everything + */ + passthrough?: boolean + }): this; + + /** + * Adds a new transform that gather all the read values into an array and calls the given callback + * when the underlying stream ends. + * + * This method resumes the stream. + */ + toArray(callback: (result: T[]) => void, options?: { + /** + * Passthrough the read values, by default it eats everything + */ + passthrough?: boolean + }): this; + + /** + * Adds a new transform that filters the values by their uniqueness + * + * @param prop callback that calculates value's hash which is used in uniqueness checks + */ + unique(prop?: (value: T) => any): this; + + /** + * Adds a new transform that filters the values using the given given function with ability to restore the filtered values + */ + stash(name: string, filter: (value: T) => boolean): this; + stash(filter: (value: T) => boolean): this; + + /** + * Adds a new transform that restores the previous stashed values + */ + unstash(name?: string): Stream; // ?? + + /** + * Flattens all the read array values + */ + flatten(): Stream; // ?? + + /** + * Merges the given stream into a core stream + */ + static merge(streams: Array | nodestd.stream.Transform | nodestd.stream.Readable | nodestd.stream.Duplex>, options?: { + /** + * Whether to end the stream when all the given streams end + */ + end?: boolean, + + /** + * Options for the initial core stream + */ + sourceOptions?: I.ConstructorOptions + }): Stream; + + /** + * Creates a promise that will be fulfilled with an array of all the emitted values or the first occurred error. + * + * This method resumes the stream. + */ + then(onResolve?: (value: T[]) => T1 | PromiseLike, onReject?: (reason: any) => T2 | PromiseLike): Promise; + + /** + * Creates a promise that will be fulfilled with an array of all the emitted values or the first occurred error. + * + * This method resumes the stream. + */ + catch(onReject?: (reason: any) => T1 | PromiseLike): Promise; } - type TransformFunction = (this: TransformContext, value: S) => void; - type FlushFunction = (this: TransformContext) => void; + /** + * Creates a CoreStream instance + */ + function create(source?: I.Source, options?: I.ConstructorOptions): Stream; } - - /** - * Represents a chain of transform streams - */ - class CoreStream implements PromiseLike { - constructor(source?: I.CoreStream.Source, options?: I.CoreStream.ConstructorOptions); - - /** - * Writes the given value into the stream - */ - write(value: S): boolean; - - /** - * Pushes the given value into the stream - */ - push(value: T): boolean; - - /** - * Ends the stream - */ - end(): this; - - /** - * Destroys the stream - */ - destroy(): this; - - /** - * Pauses the stream - */ - pause(): this; - - /** - * Resumes the stream - */ - resume(): this; - - /** - * Whether the stream is paused - */ - isPaused(): boolean; - - /** - * Whether the stream is ended - */ - isEnded(): boolean; - - /** - * Pipes this stream to another - */ - pipe(stream: T, options?: { end?: boolean }): T; - - /** - * Adds a new synchronous transform stream into the chain - */ - throughSync(transform: I.CoreStream.TransformFunction, flush?: I.CoreStream.FlushFunction): CoreStream; - - /** - * Adds a new asynchronous transform stream into the chain - */ - throughAsync(transform: I.CoreStream.TransformFunction, flush?: I.CoreStream.FlushFunction): CoreStream; - - /** - * Adds a new transform stream into the chain - */ - through(transform: I.CoreStream.TransformFunction, flush?: I.CoreStream.FlushFunction): CoreStream; - - /** - * Adds a new map transform into the chain. - * - * Note: synchronous functions create a synchronous transform. - * If your function returns a promise use an asynchronous function if you don't want to pass a promise through the stream - */ - map(callback: (value: T) => R | Promise): CoreStream; - - /** - * Adds a new conditional map transform into the chain - */ - mapIf(condition: (value: T) => boolean | Promise, callback: (value: T) => R): CoreStream; - - /** - * Adds a new filter transform into the chain - */ - filter(callback: (value: T) => boolean | Promise): this; - - /** - * Adds a new transform that calls the given callback for each value from the stream. - * - * This method resumes the stream. - */ - forEach(callback: (value: T) => void, options?: { - /** - * Whethe to wait for asynchronous functions (await) - */ - wait?: boolean, - - /** - * Passthrough the read values, by default it eats everything - */ - passthrough?: boolean - }): this; - - /** - * Adds a new transform that calls the given callback when the underlying stream ends. - * - * This method resumes the stream. - */ - done(callback: () => void, options?: { - /** - * Passthrough the read values, by default it eats everything - */ - passthrough?: boolean - }): this; - - /** - * Adds a new transform that gather all the read values into an array and calls the given callback - * when the underlying stream ends. - * - * This method resumes the stream. - */ - toArray(callback: (result: T[]) => void, options?: { - /** - * Passthrough the read values, by default it eats everything - */ - passthrough?: boolean - }): this; - - /** - * Adds a new transform that filters the values by their uniqueness - * - * @param prop callback that calculates value's hash which is used in uniqueness checks - */ - unique(prop?: (value: T) => any): this; - - /** - * Adds a new transform that filters the values using the given given function with ability to restore the filtered values - */ - stash(name: string, filter: (value: T) => boolean): this; - stash(filter: (value: T) => boolean): this; - - /** - * Adds a new transform that restores the previous stashed values - */ - unstash(name?: string): CoreStream; // ?? - - /** - * Flattens all the read array values - */ - flatten(): CoreStream; // ?? - - /** - * Merges the given stream into a core stream - */ - static merge(streams: Array | nodestd.stream.Transform | nodestd.stream.Readable | nodestd.stream.Duplex>, options?: { - /** - * Whether to end the stream when all the given streams end - */ - end?: boolean, - - /** - * Options for the initial core stream - */ - sourceOptions?: I.CoreStream.ConstructorOptions - }): CoreStream; - - /** - * Creates a promise that will be fulfilled with an array of all the emitted values or the first occurred error. - * - * This method resumes the stream. - */ - then(onResolve?: (value: T[]) => T1 | PromiseLike, onReject?: (reason: any) => T2 | PromiseLike): Promise; - - /** - * Creates a promise that will be fulfilled with an array of all the emitted values or the first occurred error. - * - * This method resumes the stream. - */ - catch(onReject?: (reason: any) => T1 | PromiseLike): Promise; - } - - /** - * Creates a CoreStream instance - */ - function core(source?: I.CoreStream.Source, options?: I.CoreStream.ConstructorOptions): CoreStream; } } diff --git a/types/adone/glosses/utils.d.ts b/types/adone/glosses/utils.d.ts index 6a05273ffd..480c2354ce 100644 --- a/types/adone/glosses/utils.d.ts +++ b/types/adone/glosses/utils.d.ts @@ -16,10 +16,6 @@ declare namespace adone { function functionName(fn: (...args: any[]) => any): string; - function mapArguments(argmap: (...args: any[]) => any): (...args: any[]) => any; - function mapArguments(argmap: number): (...args: T[]) => T[]; - function mapArguments(...args: any[]): (x: T) => T; - namespace I { interface ParseMsResult { days: number; @@ -33,8 +29,6 @@ declare namespace adone { function pluralizeWord(str: string, plural?: string, count?: number): string; - function functionParams(func: (...args: any[]) => any): string[]; - function randomChoice(arrayLike: ArrayLike, from?: number, to?: number): T; function shuffleArray(array: T[]): T[]; @@ -70,19 +64,8 @@ declare namespace adone { function globParent(str: string): string; - namespace I { - interface ByResult { - (a: S, b: S): R; - compare(a: T, b: T): R; - by(a: S): T; - } - } - function by(by: (a: S) => T, compare?: (a: T, b: T) => R): I.ByResult; - function toFastProperties(object: object): object; - function stripBom(x: string): string; - namespace I { interface SortKeysOptions { deep?: boolean; @@ -118,12 +101,42 @@ declare namespace adone { namespace I { interface CloneOptions { + /** + * Clone recursively + * + * `true` by default + */ deep?: boolean; + + /** + * Clone non-plain object, they will be plain objects + * + * `false` by default + */ + nonPlainObjects?: boolean; + + /** + * Clone only enumerable properties + * + * `true` by default + */ + onlyEnumerable?: boolean; } } - function clone(object: object, options?: I.CloneOptions): object; - function toUTF8Array(str: string): number[]; + class Cloner { + /** + * Clones the given object + */ + clone(obj: any, options?: I.CloneOptions): any; + + /** + * Returns a clone function that is binded to this cloner + */ + binding(): (obj: any, options?: I.CloneOptions) => any; + } + + function clone(object: any, options?: I.CloneOptions): any; function asyncIter(array: T[], iter: (elem: T, index: number, cb: () => void) => any, cb: () => void): void; @@ -150,20 +163,31 @@ declare namespace adone { function assignDeep(target: T, ...sources: object[]): T; namespace I { - interface MatchOptions { + interface MatchPathOptions { index?: boolean; start?: number; end?: number; dot?: boolean; } } - function match(criteria: any, options?: I.MatchOptions): (value: any, options?: I.MatchOptions) => number | boolean; - function match(criteria: any, value: any, options?: I.MatchOptions): number | boolean; + function matchPath(criteria: any, options?: I.MatchPathOptions): (value: any, options?: I.MatchPathOptions) => number | boolean; + function matchPath(criteria: any, value: any, options?: I.MatchPathOptions): number | boolean; namespace I { + class Sorter { + edges: string[]; + + add(item: string, deps: string | string[]): void; + + sort(): string[]; + + clear(): void; + } + interface ToposortFunction { - (edges: Array<[T, T]>): T[]; - array(nodes: T[], edges: Array<[T, T]>): T[]; + (edges: Array<[string, string]>): string[]; + array(nodes: string[], edges: Array<[string, string]>): string[]; + Sorter: typeof Sorter; } } const toposort: I.ToposortFunction; @@ -188,16 +212,6 @@ declare namespace adone { } function jsesc(argument: any, options?: I.JSEscOptions): string; - namespace I { - type PossibleTypes = "object" | "class" | "null" | "global" | "Array" | "RegExp" | "Date" - | "Promise" | "Set" | "Map" | "WeakSet" | "DataView" | "Map Iterator" | "Set Iterator" - | "Array Iterator" | "String Iterator" | "Object" | "function" | "boolean" | "number" - | "undefined" | "string" | "symbol"; - } - - function typeOf(obj: any): I.PossibleTypes; - function typeOf(obj: any): string; - namespace memcpy { function utou(target: Buffer, targetOffset: number, source: Buffer, sourceStart: number, sourceEnd: number): number; function atoa(target: ArrayBuffer, targetOffset: number, source: ArrayBuffer, sourceStart: number, sourceEnd: number): number; @@ -217,12 +231,12 @@ declare namespace adone { function v1(options?: I.V1Options): string; function v1(options: I.V1Options, buf: any[], offset?: number): number[]; - function v4(options?: any): string; - function v4(options: any, buf: any[], offset?: number): number[]; - function v3(name: string | number[], namespace: string | number[]): string; function v3(name: string | number[], namespace: string | number[], buf: any[], offset?: number): number[]; + function v4(options?: any): string; + function v4(options: any, buf: any[], offset?: number): number[]; + function v5(name: string | number[], namespace: string | number[]): string; function v5(name: string | number[], namespace: string | number[], buf: any[], offset?: number): number[]; } @@ -237,40 +251,6 @@ declare namespace adone { } function delegate(object: object, property: string): I.Delegator; - namespace I { - interface GlobExpOptions { - nocomment?: boolean; - nonegate?: boolean; - nobrace?: boolean; - noglobstar?: boolean; - nocase?: boolean; - dot?: boolean; - noext?: boolean; - matchBase?: boolean; - flipNegate?: boolean; - } - } - - class GlobExp { - constructor(pattern: string, options?: I.GlobExpOptions); - - hasMagic(): boolean; - - static hasMagic(pattern: string, options?: I.GlobExpOptions): boolean; - - expandBraces(): string[]; - - static expandBraces(pattern: string, options?: I.GlobExpOptions): string[]; - - makeRe(): RegExp; - - static makeRe(pattern: string, options?: I.GlobExpOptions): RegExp; - - static test(p: string, pattern: string, options?: I.GlobExpOptions): boolean; - - test(p: string): boolean; - } - namespace iconv { // TODO: need to normalize source code } @@ -278,9 +258,6 @@ declare namespace adone { namespace sqlstring { function escapeId(val: string | string[], forbidQualified?: boolean): string; function dateToString(date: any, timeZone?: string): string; - function arrayToList(array: any[]): string; - function bufferToString(buffer: Buffer): string; - function objectToValues(object: object, timeZone?: string): string; function escape(value: any, stringifyObjects?: boolean, timeZone?: string): string; function format(sql: string, values?: any, stringifyObjects?: boolean, timeZone?: string): string; } @@ -316,49 +293,71 @@ declare namespace adone { } const binarySearch: I.BinarySearchFunction; + /** + * buffer tools + */ namespace buffer { - function concat(list: Buffer[], totalLength: number): Buffer; - function mask(buffer: Buffer, mask: Buffer, output: Buffer, offset: number, length: number): void; - function unmask(buffer: Buffer, mask: Buffer): void; + /** + * Converts the given Buffer to ArrayBuffer + */ + function toArrayBuffer(buf: Buffer): ArrayBuffer; + + /** + * Returns a new buffer that represents a^b + * + * If the lengths are not equal, it assumes missing bytes as 0x00 + * + * @param length length of the result buffer. max(a.length, b.length) by default + */ + function xor(a: Buffer, b: Buffer, length?: number): Buffer; } function shebang(str: string): string | null; - class ReInterval { - constructor(callback: (...args: any[]) => void, interval: number, args?: any[]); - - reschedule(interval: number): void; - - clear(): void; - - destroy(): void; - } - - class RateLimiter { - constructor(tokensPerInterval?: number, interval?: number, fireImmediately?: boolean); - - removeTokens(count: number): Promise; - - tryRemoveTokens(count: number): boolean; - - getTokensRemaining(): number; - } - namespace I { - interface ThrottleOptions { - max?: number; - interval?: number; - ordered?: boolean; - waitForReturn?: boolean; + interface ReInterval { + reschedule(interval: number): void; + + clear(): void; + + destroy(): void; } } - function throttle(fn: () => R, options?: I.ThrottleOptions): () => Promise; - function throttle(fn: (a: T1) => R, options?: I.ThrottleOptions): (a: T1) => Promise; - function throttle(fn: (a: T1, b: T2) => R, options?: I.ThrottleOptions): (a: T1, b: T2) => Promise; - function throttle(fn: (a: T1, b: T2, c: T3) => R, options?: I.ThrottleOptions): (a: T1, b: T2, c: T3) => Promise; - function throttle(fn: (a: T1, b: T2, c: T3, d: T4) => R, options?: I.ThrottleOptions): (a: T1, b: T2, c: T3, d: T4) => Promise; - function throttle(fn: (a: T1, b: T2, c: T3, d: T4, e: T5) => R, options?: I.ThrottleOptions): (a: T1, b: T2, c: T3, d: T4, e: T5) => Promise; - function throttle(fn: (...args: any[]) => R, options?: I.ThrottleOptions): (...args: any[]) => Promise; + + function reinterval(callback: (...args: any[]) => void, interval: number, args?: any[]): I.ReInterval; + + namespace throttle { + namespace I { + interface Options { + max?: number; + interval?: number; + ordered?: boolean; + waitForReturn?: boolean; + onDone?: () => void; + drop?: boolean; + dropLast?: boolean; + } + } + function create(fn: () => R, options?: I.Options): () => Promise; + function create(fn: (a: T1) => R, options?: I.Options): (a: T1) => Promise; + function create(fn: (a: T1, b: T2) => R, options?: I.Options): (a: T1, b: T2) => Promise; + function create(fn: (a: T1, b: T2, c: T3) => R, options?: I.Options): (a: T1, b: T2, c: T3) => Promise; + function create(fn: (a: T1, b: T2, c: T3, d: T4) => R, options?: I.Options): (a: T1, b: T2, c: T3, d: T4) => Promise; + function create(fn: (a: T1, b: T2, c: T3, d: T4, e: T5) => R, options?: I.Options): (a: T1, b: T2, c: T3, d: T4, e: T5) => Promise; + function create(fn: (...args: any[]) => R, options?: I.Options): (...args: any[]) => Promise; + + class RateLimiter { + constructor(tokensPerInterval?: number, interval?: number, fireImmediately?: boolean); + + removeTokens(count: number): Promise; + + tryRemoveTokens(count: number): boolean; + + getTokensRemaining(): number; + } + + const DROPPED: symbol; + } namespace I.fakeClock { interface Timer { @@ -475,36 +474,6 @@ declare namespace adone { function lowerBoundKey(range: I.Range): T | undefined; } - /** - * Utils for uid/gid - */ - namespace userid { - /** - * Returns uid by the given username - */ - function uid(username: string): { uid: number, gid: number }; - - /** - * Returns gid by the given groupname - */ - function gid(groupname: string): number; - - /** - * Returns username by the given uid - */ - function username(uid: number): string; - - /** - * Returns groupname by the given gid - */ - function groupname(gid: number): string; - - /** - * Returns gids the given user belongs - */ - function gids(username: string): number[]; - } - /** * Represents a log file rotator */ @@ -572,5 +541,598 @@ declare namespace adone { function debounce(fn: (a: T1, b: T2, c: T3, d: T4) => R, timeout: number, options?: I.DebounceOptions): (a: T1, b: T2, c: T3, d: T4) => R; function debounce(fn: (a: T1, b: T2, c: T3, d: T4, e: T5) => R, timeout: number, options?: I.DebounceOptions): (a: T1, b: T2, c: T3, d: T4, e: T5) => R; function debounce(fn: (...args: any[]) => R, timeout: number, options?: I.DebounceOptions): (...args: any[]) => R; + + /** + * Finds difference between the given arrays + */ + function arrayDiff(...arrays: T[][]): T[]; + + namespace I { + type FillRangeTransform = () => void; + + interface FillRangeOptions { + /** + * The increment to use for the range. Can be used with letters or numbers + */ + step?: number; + + /** + * By default, null is returned when an invalid range is passed. + * Enable this option to throw a RangeError on invalid ranges + * + * false by default + */ + strictRanges?: boolean; + + /** + * Cast all returned values to strings. + * + * By default, integers are returned as numbers. + */ + stringify?: boolean; + + /** + * Create a regex-compatible source string, instead of expanding values to an array. + * + * false by default + */ + toRegex?: boolean; + + /** + * Customize each value in the returned array (or string) + */ + transform?: FillRangeTransform; + } + } + + /** + * Expands numbers and letters + */ + function fillRange(from: number, to: number, options: I.FillRangeOptions & { toRegex: true }): string; + function fillRange(from: number, to: number, options: I.FillRangeOptions & { stringify: true }): string[]; + function fillRange(from: number, to: number, options?: I.FillRangeOptions): number[]; + + function fillRange(from: string, to: string, options: I.FillRangeOptions & { toRegex: true }): string; + function fillRange(from: string, to: string, options?: I.FillRangeOptions): string[]; + + function fillRange(from: string | number, to: string | number, options: I.FillRangeOptions & { toRegex: true }): string; + function fillRange(from: string | number, to: string | number, options?: I.FillRangeOptions): Array; + + namespace inflection { + function singularizeWord(str: string, singular?: string): string; + function pluralizeWord(str: string, plural?: string): string; + function underscore(str: string, allUpperCase?: boolean): string; + } + + function machineId(original?: boolean): Promise; + + namespace I { + interface MergeOptions { + plainObjects?: boolean; + allowPrototypes?: boolean; + } + } + + function merge(target: any, source: any, options?: I.MergeOptions): any; + + function omit(obj: any, props: ((v: string) => boolean) | string[] | string): object; + + function parseTime(val: number): number; + function parseTime(val: any): number | null; + + function pick(obj: any, props: Iterable): object; + + // pool: TODO + + namespace querystring { + function escape(str: string): string; + + const formats: { + RFC1738: "RFC1738" + RFC3986: "RFC3986", + default: string, + formatters: { + RFC1738(val: string): string, + RFC3986(val: string): string + } + }; + + namespace I { + interface ParseOptions { + ignoreQueryPrefix?: boolean; + delimiter?: string; + depth?: number; + arrayLimit?: number; + parseArrays?: boolean; + decoder?: (str: string, defaultDecoder: (str: string) => string) => string; + allowDots?: boolean; + plainObjects?: boolean; + allowPrototypes?: boolean; + parameterLimit?: number; + strictNullHandling?: boolean; + } + + interface StringifyOptions { + delimiter?: string; + strictNullHandling?: boolean; + skipNulls?: boolean; + encode?: boolean; + encoder?: (str: string) => any; + filter?: Array | ((prefix: string, value: any) => any); + arrayFormat?: "indices" | "brackets" | "repeat"; + indices?: boolean; + sort?: (a: any, b: any) => number; + serializeDate?: (d: Date) => string; + format?: "RFC1738" | "RFC3986"; + encodeValuesOnly?: boolean; + addQueryPrefix?: boolean; + allowDots?: boolean; + } + } + + function parse(str: string, options?: I.ParseOptions): any; + + function stringify(obj: any, options?: I.StringifyOptions): string; + + function unescape(str: string): string; + } + + namespace I { + interface RegexNotOptions { + contains?: boolean; + } + } + + function regexNot(pattern: string, options?: I.RegexNotOptions): RegExp; + + function repeat(item: T, n: number): T[]; + + // retry: TODO + + function signalNameToCode(signame: string): number; + + function splitBuffer(buf: string | Buffer, splitBuf: string | Buffer, includeDelim?: boolean): Buffer[]; + + namespace I { + type SplitStringSplitFunction = (token: { + val: string; + idx: number; + arr: string[]; + str: string; + }) => void; + + interface SplitStringOptions { + braces?: object | boolean; + keepEscaping?: boolean; + keepQuotes?: boolean; + keepDoubleQuotes?: boolean; + keepSingleQuotes?: boolean; + separator?: string; + split?: SplitStringSplitFunction; + } + } + + function splitString(str: string): string[]; + function splitString(str: string, options: I.SplitStringOptions): string[]; + function splitString(str: string, splitter: I.SplitStringSplitFunction): string[]; + function splitString(str: string, options: I.SplitStringOptions, splitter: I.SplitStringSplitFunction): string[]; + + // terraformer: TODO + + namespace I { + interface ToRegexOptions { + contains?: boolean; + negate?: boolean; + nocase?: boolean; + flags?: string; + cache?: boolean; + } + } + + function toRegex(patterns: string | string[], options?: I.ToRegexOptions): RegExp; + + namespace I { + interface ToRegexRangeOptions { + capture?: boolean; + shorthand?: boolean; + relaxZeros?: boolean; + } + } + + function toRegexRange(min: string | number, max: string | number, options?: I.ToRegexRangeOptions): RegExp; + + namespace xorDistance { + function compare(a: Buffer, b: Buffer): boolean; + + function create(a: Buffer, b: Buffer): Buffer; + + function gt(a: Buffer, b: Buffer): boolean; + + function lt(a: Buffer, b: Buffer): boolean; + + function eq(a: Buffer, b: Buffer): boolean; + } + + namespace I { + interface BracesOptions { + /** + * Generate an "expanded" brace pattern (this option is unncessary with the `.expand` method, which does the same thing). + * + * @default undefined + */ + expand?: boolean; + + /** + * Enabled by default. + * + * @default true + */ + optimize?: boolean; + + /** + * Duplicates are removed by default. To keep duplicates, pass `{nodupes: false}` on the options + * + * @default true + */ + nodupes?: boolean; + + /** + * When `braces.expand()` is used, or `options.expand` is true, brace patterns will automatically be [optimized](#optionsoptimize) + * when the difference between the range minimum and range maximum exceeds the `rangeLimit`. + * This is to prevent huge ranges from freezing your application. + * + * You can set this to any number, or change `options.rangeLimit` to `Inifinity` to disable this altogether. + * + * @default 250 + */ + rangeLimit?: number; + + /** + * Customize range expansion. + * + * @default undefined + */ + transform?: (str: string) => string; + + /** + * In regular expressions, quanitifiers can be used to specify how many times a token can be repeated. For example, `a{1,3}` will match the letter `a` one to three times. + * + * Unfortunately, regex quantifiers happen to share the same syntax as [Bash lists](#lists) + * + * The `quantifiers` option tells braces to detect when [regex quantifiers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#quantifiers) + * are defined in the given pattern, and not to try to expand them as lists. + * + * @default undefined + */ + quantifiers?: boolean; + + /** + * Strip backslashes that were used for escaping from the result. + * + * @default undefined + */ + unescape?: boolean; + } + interface BracesFunction { + (pattern: string, options?: BracesOptions): string[]; + expand(pattern: string, options?: BracesOptions): string[]; + MAX_LENGTH: number; + clearCache(): void; + resizeCache(newSize: number): void; + getCache(): object; // TODO + makeRe(pattern: string, options?: BracesOptions): RegExp; + } + } + + const braces: I.BracesFunction; + + namespace I { + interface MatchOptions { + /** + * Allow glob patterns without slashes to match a file path based on its basename. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `matchBase`. + * + * @default false + */ + basename?: boolean; + + /** + * Enabled by default, this option enforces bash-like behavior with stars immediately following a bracket expression. + * Bash bracket expressions are similar to regex character classes, but unlike regex, a star following a bracket expression **does not repeat the bracketed characters**. + * Instead, the star is treated the same as an other star. + * + * @default true + */ + bash?: boolean; + + /** + * Disable regex and function memoization. + * + * @default undefined + */ + cache?: boolean; + + /** + * Match dotfiles. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `dot`. + * + * @default false + */ + dot?: boolean; + + /** + * Similar to the `--failglob` behavior in Bash, throws an error when no matches are found. + * + * @default undefined + */ + failglob?: boolean; + + /** + * String or array of glob patterns to match files to ignore. + * + * @default undefined + */ + ignore?: string | string[]; + + /** + * Alias for [options.basename](#options-basename). + */ + matchBase?: boolean; + + /** + * Disable expansion of brace patterns. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `nobrace`. + * + * @default undefined + */ + nobrace?: boolean; + + /** + * Use a case-insensitive regex for matching files. Same behavior as [minimatch](https://github.com/isaacs/minimatch). + * + * @default undefined + */ + nocase?: boolean; + + /** + * Remove duplicate elements from the result array. + * + * @default undefined + */ + nodupes?: boolean; + + /** + * Disable extglob support, so that extglobs are regarded as literal characters. + * + * @default undefined + */ + noext?: boolean; + + /** + * Disallow negation (`!`) patterns, and treat leading `!` as a literal character to match. + * + * @default undefined + */ + nonegate?: boolean; + + /** + * Disable matching with globstars (`**`). + * + * @default undefined + */ + noglobstar?: boolean; + + /** + * Alias for [options.nullglob](#options-nullglob). + */ + nonull?: boolean; + + /** + * If `true`, when no matches are found the actual (arrayified) glob pattern is returned instead of an empty array. + * Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `nonull`. + * + * @default undefined + */ + nullglob?: boolean; + + /** + * Pass your own instance of [snapdragon](https://github.com/jonschlinkert/snapdragon), to customize parsers or compilers. + * + * @default undefined + */ + snapdragon?: object; + + /** + * Generate a source map by enabling the `sourcemap` option with the `.parse`, `.compile`, or `.create` methods. + * + * _(Note that sourcemaps are currently not enabled for brace patterns)_ + */ + sourcemap?: boolean; + + /** + * Remove backslashes from returned matches. + * + * @default undefined + */ + unescape?: boolean; + + /** + * Convert path separators on returned files to posix/unix-style forward slashes. + * + * @default true + */ + unixify?: boolean; + } + + interface MatchFunction { + /** + * The main function takes a list of strings and one or more glob patterns to use for matching. + * + * @param list A list of strings to match + * @param patterns One or more glob patterns to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns an array of matches + */ + (list: string[], patterns: string | string[], options?: MatchOptions): string[]; + + /** + * Similar to the main function, but `pattern` must be a string. + * + * @param list Array of strings to match + * @param pattern Glob pattern to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns an array of matches + */ + match(list: string[], pattern: string, options?: MatchOptions): string[]; + + /** + * Returns true if the specified `string` matches the given glob `pattern`. + * + * @param string String to match + * @param pattern Glob pattern to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns true if the string matches the glob pattern. + */ + isMatch(string: string, pattern: string, options?: MatchOptions): boolean; + + /** + * Returns true if some of the strings in the given `list` match any of the given glob `patterns`. + * + * @param list The string or array of strings to test. Returns as soon as the first match is found. + * @param patterns One or more glob patterns to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns true if any patterns match `str` + */ + some(list: string | string[], patterns: string | string[], options?: MatchOptions): boolean; + + /** + * Returns true if every string in the given `list` matches any of the given glob `patterns`. + * + * @param list The string or array of strings to test. + * @param patterns One or more glob patterns to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns true if any patterns match `str` + */ + every(list: string | string[], patterns: string | string[], options?: MatchOptions): boolean; + + /** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * @param str The string to test. + * @param patterns One or more glob patterns to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns true if any patterns match `str` + */ + any(str: string | string[], patterns: string | string[], options?: MatchOptions): boolean; + + /** + * Returns true if **all** of the given `patterns` match the specified string. + * + * @param str The string to test. + * @param patterns One or more glob patterns to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns true if any patterns match `str` + */ + all(str: string | string[], patterns: string | string[], options?: MatchOptions): boolean; + + /** + * Returns a list of strings that _**do not match any**_ of the given `patterns`. + * + * @param list Array of strings to match. + * @param patterns One or more glob pattern to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns an array of strings that **do not match** the given patterns. + */ + not(list: string[], patterns: string | string[], options?: MatchOptions): string[]; + + /** + * Returns true if the given `string` contains the given pattern. Similar to [.isMatch](#isMatch) but the pattern can match any part of the string. + * + * @param str The string to match. + * @param patterns Glob pattern to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns true if the patter matches any part of `str`. + */ + contains(str: string, patterns: string | string[], options?: MatchOptions): boolean; + + /** + * Filter the keys of the given object with the given `glob` pattern and `options`. Does not attempt to match nested keys. + * If you need this feature, use [glob-object](https://github.com/jonschlinkert/glob-object) instead. + * + * @param object The object with keys to filter. + * @param patterns One or more glob patterns to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns an object with only keys that match the given patterns. + */ + matchKeys(object: T, patterns: string | string[], options?: MatchOptions): Partial; + + /** + * Returns a memoized matcher function from the given glob `pattern` and `options`. + * The returned function takes a string to match as its only argument and returns true if the string is a match. + * + * @param pattern Glob pattern + * @param options See available options for changing how matches are performed. + * @returns Returns a matcher function. + */ + matcher(pattern: string | string[], options?: MatchOptions): (str: string) => boolean; + + /** + * Returns an array of matches captured by `pattern` in `string, or`null` if the pattern did not match. + * + * @param pattern Glob pattern to use for matching. + * @param string String to match + * @param options See available options for changing how matches are performed + * @returns Returns an array of captures if the string matches the glob pattern, otherwise `null`. + */ + capture(pattern: string, string: string, options?: MatchOptions): string[] | null; + + /** + * Create a regular expression from the given glob `pattern`. + * + * @param pattern A glob pattern to convert to regex. + * @param options See available options for changing how matches are performed. + * @returns Returns a regex created from the given pattern. + */ + makeRe(pattern: string, options?: MatchOptions): RegExp; + + /** + * Expand the given brace `pattern`. + * + * @param pattern String with brace pattern to expand. + * @param options Any options to change how expansion is performed. See the [braces](https://github.com/micromatch/braces) library for all available options. + */ + braces(pattern: string, options?: MatchOptions): string[]; + + /** + * Parses the given glob `pattern` and returns an array of abstract syntax trees (ASTs), with the compiled `output` and optional source `map` on each AST. + * + * @param pattern Glob pattern to parse and compile. + * @param options Any options to change how parsing and compiling is performed. + * @returns Returns an object with the parsed AST, compiled string and optional source map. + */ + create(pattern: string, options?: MatchOptions): object; + + /** + * Parse the given `str` with the given `options`. + * + * @returns Returns an AST + */ + parse(str: string, options?: MatchOptions): object; + + /** + * Compile the given `ast` or string with the given `options`. + * + * @returns Returns an object that has an `output` property with the compiled string. + */ + compile(ast: object | string, options?: MatchOptions): object; + + MAX_LENGTH: number; + + clearCache(): void; + + resizeCache(newSize: number): void; + + getCache(): object; // TODO + } + } + + const match: I.MatchFunction; } } diff --git a/types/adone/index.d.ts b/types/adone/index.d.ts index 74883c2185..5d22ac1bfd 100644 --- a/types/adone/index.d.ts +++ b/types/adone/index.d.ts @@ -8,16 +8,18 @@ /// /// /// -/// +/// /// /// /// /// /// +/// /// /// /// /// +/// /// /// /// diff --git a/types/adone/test/glosses/application.ts b/types/adone/test/glosses/application.ts new file mode 100644 index 0000000000..38c5b0c8ff --- /dev/null +++ b/types/adone/test/glosses/application.ts @@ -0,0 +1,1663 @@ +namespace applicationTests { + const { + CliApplication, + DApplication, + DSubsystem, + DCliCommand, + DMainCliCommand, + Subsystem, + runCli, + Application + } = adone.application; + + namespace DApplicationTests { + { + @DApplication() + class App extends CliApplication {} + } + { + @DApplication({}) + class App extends CliApplication {} + } + { + @DApplication({ + name: "hello" + }) + class App extends CliApplication {} + } + { + @DApplication({ + description: "hello" + }) + class App extends CliApplication {} + } + { + @DApplication({ + subsystems: [ + { + name: "hello", + subsystem: "a.js" + } + ] + }) + class App extends CliApplication {} + } + { + @DApplication({ + subsystems: [ + { + name: "hello", + subsystem: "a.js", + transpile: true + } + ] + }) + class App extends CliApplication {} + } + { + @DApplication({ + commandsGroups: [{ + name: "a", + description: "b" + }] + }) + class App extends CliApplication {} + } + } + + namespace DSubsystemTests { + { + @DSubsystem() + class App extends Subsystem {} + } + { + @DSubsystem({}) + class App extends Subsystem {} + } + { + @DSubsystem({ + name: "hello" + }) + class App extends Subsystem {} + } + { + @DSubsystem({ + description: "hello" + }) + class App extends Subsystem {} + } + { + @DSubsystem({ + subsystems: [ + { + name: "hello", + subsystem: "a.js" + } + ] + }) + class App extends Subsystem {} + } + { + @DSubsystem({ + subsystems: [ + { + name: "hello", + subsystem: "a.js", + transpile: true + } + ] + }) + class App extends Subsystem {} + } + { + @DSubsystem({ + commandsGroups: [{ + name: "a", + description: "b" + }] + }) + class App extends Subsystem {} + } + } + + namespace DMainCliCommandTests { + { + class App extends CliApplication { + @DMainCliCommand() + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({}) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({}) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + blindMode: true + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + description: "a" + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + match: (arg) => arg.startsWith("hello") + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + optionsGroups: [{ + description: "a", + name: "a" + }] + }) + main() {} + } + } + + namespace argumentsTests { + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: ["hello"] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: ["hello"] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + action: "append" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + action: "count" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + action: "set" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + action: "store_const" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + action: "store_false" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + action: "store_true" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + action: "store" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + appendChoicesHelpMessage: true + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + appendDefaultMessage: false + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + default: null + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + description: "hello" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + enabled: false + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + help: "asd" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + holder: "a" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + holder: ["a"] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + nargs: 1 + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + nargs: "*" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + nargs: "+" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + nargs: "?" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + required: false + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + type: String + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + type: (x: string, i: number) => { + return true; + } + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + type: [(x: string, i: number) => { + return true; + }] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + type: [/^abc$/] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + verify: (args, opts) => { + return true; + } + }] + }) + main() {} + } + } + } + + namespace optionsTests { + { + class App extends CliApplication { + @DMainCliCommand({ + options: ["--hello"] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: ["hello"] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + action: "append" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + action: "count" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + action: "set" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + action: "store_const" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + action: "store_false" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + action: "store_true" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + action: "store" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + appendChoicesHelpMessage: true + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + appendDefaultMessage: false + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + default: null + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + description: "hello" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + enabled: false + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + help: "asd" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + holder: "a" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + holder: ["a"] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + nargs: 1 + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + nargs: "*" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + nargs: "+" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + nargs: "?" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + required: false + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + type: String + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + type: (x: string, i: number) => { + return true; + } + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + type: [(x: string, i: number) => { + return true; + }] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + type: [/^abc$/] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + verify: (args, opts) => { + return true; + } + }] + }) + main() {} + } + } + } + } + + namespace DCliCommandTests { + { + class App extends CliApplication { + @DCliCommand() + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({}) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({}) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + blindMode: true + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + description: "a" + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + match: (arg) => arg.startsWith("hello") + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + optionsGroups: [{ + description: "a", + name: "a" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + name: "cmdd" + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + group: "asdasd" + }) + cmd() {} + } + } + + namespace argumentsTests { + { + class App extends CliApplication { + @DCliCommand({ + arguments: ["hello"] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: ["hello"] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + action: "append" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + action: "count" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + action: "set" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + action: "store_const" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + action: "store_false" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + action: "store_true" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + action: "store" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + appendChoicesHelpMessage: true + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + appendDefaultMessage: false + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + default: null + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + description: "hello" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + enabled: false + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + help: "asd" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + holder: "a" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + holder: ["a"] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + nargs: 1 + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + nargs: "*" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + nargs: "+" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + nargs: "?" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + required: false + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + type: String + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + type: (x: string, i: number) => { + return true; + } + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + type: [(x: string, i: number) => { + return true; + }] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + type: [/^abc$/] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + verify: (args, opts) => { + return true; + } + }] + }) + cmd() {} + } + } + } + + namespace optionsTests { + { + class App extends CliApplication { + @DCliCommand({ + options: ["--hello"] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: ["hello"] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + action: "append" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + action: "count" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + action: "set" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + action: "store_const" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + action: "store_false" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + action: "store_true" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + action: "store" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + appendChoicesHelpMessage: true + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + appendDefaultMessage: false + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + default: null + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + description: "hello" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + enabled: false + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + help: "asd" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + holder: "a" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + holder: ["a"] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + nargs: 1 + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + nargs: "*" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + nargs: "+" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + nargs: "?" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + required: false + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + type: String + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + type: (x: string, i: number) => { + return true; + } + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + type: [(x: string, i: number) => { + return true; + }] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + type: [/^abc$/] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + verify: (args, opts) => { + return true; + } + }] + }) + cmd() {} + } + } + } + } + + namespace subsystemTests { + new Subsystem().name; + new Subsystem().root; + new Subsystem().setRoot(new Subsystem()); + new Subsystem().parent; + new Subsystem().state + 2; + new Subsystem().isOwned === true; + new Subsystem().setState(1); + new Subsystem().waitForState(2).then(() => {}); + new Subsystem().waitForState(2, 100).then(() => {}); + new Subsystem().configure(); + new Subsystem().initialize(); + new Subsystem().uninitialize(); + new Subsystem().configureSubsystems().then(() => {}); + new Subsystem().uninitializeSubsystems().then(() => {}); + new Subsystem().reinitializeSubsystems().then(() => {}); + new Subsystem().configureSubsystem("a").then(() => {}); + new Subsystem().loadSubsystem("a").then(() => {}); + new Subsystem().loadSubsystem(new Subsystem()).then(() => {}); + new Subsystem().loadSubsystem(new Subsystem(), {}).then(() => {}); + new Subsystem().loadSubsystem(new Subsystem(), { description: "a" }).then(() => {}); + new Subsystem().loadSubsystem(new Subsystem(), { group: "a" }).then(() => {}); + new Subsystem().loadSubsystem(new Subsystem(), { name: "a" }).then(() => {}); + new Subsystem().loadSubsystem(new Subsystem(), { transpile: false }).then(() => {}); + new Subsystem().unloadSubsystem("a").then(() => {}); + new Subsystem().initializeSubsystem("a").then(() => {}); + new Subsystem().uninitializeSubsystem("a").then(() => {}); + new Subsystem().getSubsystem("a").waitForState(2).then(() => {}); + new Subsystem().hasSubsystem("a") === true; + new Subsystem().hasSubsystem("a") === true; + new Subsystem().hasSubsystems() === true; + new Subsystem().addSubsystem({ subsystem: "ppp" }); + new Subsystem().addSubsystem({ subsystem: "ppp", bind: true }); + new Subsystem().addSubsystem({ subsystem: "ppp", bind: "a" }); + new Subsystem().addSubsystem({ subsystem: "ppp", configureArgs: [1] }); + new Subsystem().addSubsystem({ subsystem: "ppp", description: "a" }); + new Subsystem().addSubsystem({ subsystem: "ppp", group: "a" }); + new Subsystem().addSubsystem({ subsystem: "ppp", name: "a" }); + new Subsystem().addSubsystem({ subsystem: "ppp", transpile: false }); + new Subsystem().addSubsystem({ subsystem: "ppp", useFilename: true }); + { + const sysInfo = new Subsystem().addSubsystem({ subsystem: "ppp" }); + sysInfo.configureArgs[0]; + sysInfo.description.charCodeAt(10); + sysInfo.group.charCodeAt(10); + sysInfo.instance.waitForState(2, 30).then(() => {}); + sysInfo.name.charCodeAt(100); + sysInfo.path.charCodeAt(100); + } + { + const sysInfo = new Subsystem().addSubsystem({ subsystem: new Subsystem() }); + sysInfo.configureArgs[0]; + sysInfo.description.charCodeAt(10); + sysInfo.group.charCodeAt(10); + sysInfo.instance.waitForState(2, 30).then(() => {}); + sysInfo.name.charCodeAt(100); + sysInfo.path === null; + } + new Subsystem().addSubsystemsFrom("asd", {}); + new Subsystem().addSubsystemsFrom("asd", { filter: ["a"] }); + new Subsystem().addSubsystemsFrom("asd", { filter: (file) => file.charCodeAt(100) === 100 }); + new Subsystem().addSubsystemsFrom("asd", { filter: async (file) => file.charCodeAt(100) === 100 }); + new Subsystem().addSubsystemsFrom("asd", { bind: "a" }); + new Subsystem().addSubsystemsFrom("asd", { bind: true }); + new Subsystem().addSubsystemsFrom("asd", { configureArgs: [1] }); + new Subsystem().addSubsystemsFrom("asd", { description: "a" }); + new Subsystem().addSubsystemsFrom("asd", { group: "a" }); + new Subsystem().addSubsystemsFrom("asd", { name: "a" }); + new Subsystem().addSubsystemsFrom("asd", { transpile: true }); + new Subsystem().addSubsystemsFrom("asd", { useFilename: true }); + + new Subsystem().instantiateSubsystem("asd").waitForState(2, 200).then(() => {}); + new Subsystem().instantiateSubsystem(new Subsystem()).waitForState(2, 200).then(() => {}); + new Subsystem().instantiateSubsystem(new Subsystem(), { transpile: false }).waitForState(2, 200).then(() => {}); + new Subsystem().deleteSubsystem("name"); + new Subsystem().deleteSubsystem("name", true); + new Subsystem().getSubsystemInfo("name").configureArgs[0]; + new Subsystem().getSubsystems()[0].configureArgs[0]; + } + + namespace applicationTests { + new Application().isMain === true; + new Application().main(); + new Application().enableReport(); + new Application().enableReport({}); + new Application().enableReport({ directory: "a" }); + new Application().enableReport({ events: "a" }); + new Application().enableReport({ filename: "a" }); + new Application().enableReport({ signal: "a" }); + new Application().run().then(() => {}); + new Application().exit().then(() => {}); + new Application().exit(1).then(() => {}); + new Application().exitOnSignal("SIGINT", "SIGUSR1"); + new Application().removeProcesshandlers(); + new Application()._uncaughtException; + new Application()._unhandledRejection; + new Application()._rejectionHandled; + new Application()._signalExit("asd"); + } + + namespace cliApplicationTests { + new CliApplication().run({ ignoreArgs: true }).then(() => {}); + new CliApplication().getVersion().then(() => {}); + new CliApplication().exposeCliInterface(); + new CliApplication().mainCommand; + new CliApplication().defineMainCommand({ + arguments: [{ + name: "a", + default: 100500, + nargs: 100, + required: false + }], + options: [{ + name: "--a", + default: 1000, + nargs: 101231 + }], + optionsGroups: [{ + name: "a", + description: "a" + }] + }); + new CliApplication().defineCommand({ + name: "a", + arguments: [{ + name: "a", + default: 100500, + nargs: 100, + required: false + }], + options: [{ + name: "--a", + default: 1000, + nargs: 101231 + }], + optionsGroups: [{ + name: "a", + description: "a" + }] + }); + new CliApplication().defineCommandFromSubsystem({ + configureArgs: [1], + description: "a", + lazily: true, + subsystem: "a", + group: "a", + name: "a", + transpile: false + }); + new CliApplication().defineOption({ + name: "--a", + action: "store" + }); + new CliApplication().defineOptionsGroup({ + name: "a", + description: "b" + }); + new CliApplication().defineCommandsGroup({ + name: "a", + description: "b" + }); + new CliApplication().option("a"); + new CliApplication().option("a", { value: true }); + } +} diff --git a/types/adone/test/glosses/assertion.ts b/types/adone/test/glosses/assertion.ts index 4d07c78182..3e457dc876 100644 --- a/types/adone/test/glosses/assertion.ts +++ b/types/adone/test/glosses/assertion.ts @@ -3,9 +3,9 @@ namespace assertionTests { namespace assertionInterface { namespace exception { - const a: adone.x.Exception = new assertion.AssertionError(); - const b: adone.x.Exception = new assertion.AssertionError("hello"); - const c: adone.x.Exception = new assertion.AssertionError("hello", { actual: 2, expected: 3 }, () => {}); + const a: adone.exception.Exception = new assertion.AssertionError(); + const b: adone.exception.Exception = new assertion.AssertionError("hello"); + const c: adone.exception.Exception = new assertion.AssertionError("hello", { actual: 2, expected: 3 }, () => {}); } namespace config { @@ -38,11 +38,11 @@ namespace assertionTests { assert.fail(1, 2, "hello"); assert.fail(1, 2, "hello", "<"); - assert.isOk(1); - assert.isOk(1, "hello"); + assert.ok(1); + assert.ok(1, "hello"); - assert.isNotOk(1); - assert.isNotOk(1, "hello"); + assert.notOk(1); + assert.notOk(1, "hello"); assert.equal(1, 2); assert.equal(1, 2, "hello"); @@ -68,38 +68,38 @@ namespace assertionTests { assert.notDeepEqual(1, 2); assert.notDeepEqual(1, 2, "hello"); - assert.isAbove(1, 2); - assert.isAbove(1, 2, "hello"); + assert.above(1, 2); + assert.above(1, 2, "hello"); - assert.isAtLeast(1, 2); - assert.isAtLeast(1, 2, "hello"); + assert.atLeast(1, 2); + assert.atLeast(1, 2, "hello"); - assert.isBelow(1, 2); - assert.isBelow(1, 2, "hello"); + assert.below(1, 2); + assert.below(1, 2, "hello"); - assert.isAtMost(1, 2); - assert.isAtMost(1, 2, "hello"); + assert.atMost(1, 2); + assert.atMost(1, 2, "hello"); - assert.isTrue(1); - assert.isTrue(1, "hello"); + assert.true(1); + assert.true(1, "hello"); - assert.isNotTrue(1); - assert.isNotTrue(1, "hello"); + assert.notTrue(1); + assert.notTrue(1, "hello"); - assert.isFalse(1); - assert.isFalse(1, "hello"); + assert.false(1); + assert.false(1, "hello"); - assert.isNotFalse(1); - assert.isNotFalse(1, "hello"); + assert.notFalse(1); + assert.notFalse(1, "hello"); - assert.isNull(1); - assert.isNull(1, "hello"); + assert.null(1); + assert.null(1, "hello"); - assert.isNaN(1); - assert.isNaN(1, "hello"); + assert.NaN(1); + assert.NaN(1, "hello"); - assert.isNotNaN(1); - assert.isNotNaN(1, "hello"); + assert.NotNaN(1); + assert.NotNaN(1, "hello"); assert.exists(1); assert.exists(1, "hello"); @@ -107,49 +107,49 @@ namespace assertionTests { assert.notExists(1); assert.notExists(1, "hello"); - assert.isUndefined(1); - assert.isUndefined(1, "hello"); + assert.undefined(1); + assert.undefined(1, "hello"); - assert.isDefined(1); - assert.isDefined(1, "hello"); + assert.defined(1); + assert.defined(1, "hello"); - assert.isFunction(1); - assert.isFunction(1, "hello"); + assert.function(1); + assert.function(1, "hello"); - assert.isNotFunction(1); - assert.isNotFunction(1, "hello"); + assert.notFunction(1); + assert.notFunction(1, "hello"); - assert.isObject(1); - assert.isObject(1, "hello"); + assert.object(1); + assert.object(1, "hello"); - assert.isNotObject(1); - assert.isNotObject(1, "hello"); + assert.notObject(1); + assert.notObject(1, "hello"); - assert.isArray(1); - assert.isArray(1, "hello"); + assert.array(1); + assert.array(1, "hello"); - assert.isNotArray(1); - assert.isNotArray(1, "hello"); + assert.notArray(1); + assert.notArray(1, "hello"); - assert.isString(1, "hello"); + assert.string(1, "hello"); - assert.isNotString(1); - assert.isNotString(1, "hello"); + assert.notString(1); + assert.notString(1, "hello"); - assert.isNumber(1); - assert.isNumber(1, "hello"); + assert.number(1); + assert.number(1, "hello"); - assert.isNotNumber(1); - assert.isNotNumber(1, "hello"); + assert.notNumber(1); + assert.notNumber(1, "hello"); - assert.isFinite(1); - assert.isFinite(1, "hello"); + assert.finite(1); + assert.finite(1, "hello"); - assert.isBoolean(1); - assert.isBoolean(1, "hello"); + assert.boolean(1); + assert.boolean(1, "hello"); - assert.isNotBoolean(1); - assert.isNotBoolean(1, "hello"); + assert.notBoolean(1); + assert.notBoolean(1, "hello"); assert.typeOf(1, "string"); assert.typeOf(1, "number", "hello"); @@ -457,26 +457,26 @@ namespace assertionTests { assert.ifError(1); - assert.isExtensible({}); - assert.isExtensible({}, "hello"); + assert.extensible({}); + assert.extensible({}, "hello"); - assert.isNotExtensible({}); - assert.isNotExtensible({}, "hello"); + assert.notExtensible({}); + assert.notExtensible({}, "hello"); - assert.isSealed({}); - assert.isSealed({}, "hello"); + assert.sealed({}); + assert.sealed({}, "hello"); - assert.isNotSealed({}); - assert.isNotSealed({}, "hello"); + assert.notSealed({}); + assert.notSealed({}, "hello"); - assert.isFrozen({}); - assert.isFrozen({}, "hello"); + assert.frozen({}); + assert.frozen({}, "hello"); - assert.isNotFrozen({}); - assert.isNotFrozen({}, "hello"); + assert.notFrozen({}); + assert.notFrozen({}, "hello"); - assert.isEmpty({}); - assert.isEmpty({}, "hello"); + assert.empty({}); + assert.empty({}, "hello"); } const { expect } = assertion; @@ -499,16 +499,16 @@ namespace assertionTests { expect(1).to.contain(2, "hello").and; expect(1).but.contains(2).and; expect(1).but.contains(2, "hello").and; - expect(1).to.ok.not.ok; - expect(1).to.be.true.but.false; - expect(1).to.be.false.but.true; - expect(1).to.be.null.and.null; - expect(1).to.be.undefined.and.true; - expect(1).to.be.NaN.and.null; - expect(1).to.exist.and.be.null; - expect(1).to.be.empty.and.true; - expect(1).to.be.arguments.and.a("number"); - expect(1).to.be.Arguments.and.false; + expect(1).to.ok().and.a("string"); + expect(1).to.be.true().but.false(); + expect(1).to.be.false().but.true(); + expect(1).to.be.null().and.null(); + expect(1).to.be.undefined().and.true(); + expect(1).to.be.NaN().and.null(); + expect(1).to.exist().and.be.null(); + expect(1).to.be.empty().and.true(); + expect(1).to.be.arguments().and.a("number"); + expect(1).to.be.Arguments().and.false(); expect(1).to.be.equal(2).and; expect(1).to.be.equal(2, "hello").and; expect(1).but.equals(2).and; @@ -624,19 +624,19 @@ namespace assertionTests { expect(() => {}).but.decreases({}, "a", "hello").and; expect(() => {}).to.decreases({}).by(2).and; expect(() => {}).to.decreases({}).by(2, "hello").and; - expect({}).to.be.extensible.and; - expect({}).to.be.sealed.and; - expect({}).to.be.frozen.and; - expect({}).to.be.finite.and; + expect({}).to.be.extensible().and; + expect({}).to.be.sealed().and; + expect({}).to.be.frozen().and; + expect({}).to.be.finite().and; namespace mockTests { const s1 = adone.shani.util.spy(); const s2 = adone.shani.util.spy(); - expect(s1).to.have.been.called; - expect(s1).to.have.been.calledOnce; - expect(s1).to.have.been.calledTwice; - expect(s1).to.have.been.calledThrice; + expect(s1).to.have.been.called(); + expect(s1).to.have.been.calledOnce(); + expect(s1).to.have.been.calledTwice(); + expect(s1).to.have.been.calledThrice(); expect(s1).to.have.callCount(100); expect(s1).to.have.been.calledBefore(s2); expect(s1).to.have.been.calledAfter(s2); diff --git a/types/adone/test/glosses/collections.ts b/types/adone/test/glosses/collections.ts deleted file mode 100644 index ec227d4440..0000000000 --- a/types/adone/test/glosses/collections.ts +++ /dev/null @@ -1,1003 +0,0 @@ -namespace collectionTests { - const { collection } = adone; - - namespace linkedListTests { - const { LinkedList } = collection; - - namespace creation { - new LinkedList(); - new LinkedList(10); - } - - namespace properties { - { const a: boolean = new LinkedList().full; } - { const a: boolean = new LinkedList().empty; } - { const a: number = new LinkedList().maxLength; } - { const a: number = new LinkedList().length; } - { const a: boolean = new LinkedList().autoresize; } - } - - namespace resize { - { const a: boolean = new LinkedList().resize(100).full; } - } - - namespace push { - const a = new LinkedList().push(10); - a.next; - a.prev; - const b: number = a.value; - } - - namespace pop { - const a: number | undefined = new LinkedList().pop(); - } - - namespace shift { - const a: number | undefined = new LinkedList().shift(); - } - - namespace unshift { - const a = new LinkedList().unshift("hello"); - a.next; - a.prev; - const b: string = a.value; - } - - namespace pushNode { - const a = new LinkedList(); - const node = a.push("1230"); - a.pushNode(node); - } - - namespace unshiftNode { - const a = new LinkedList(); - const node = a.push(10); - a.unshiftNode(node); - } - - namespace removeNode { - const a = new LinkedList(); - const node = a.unshift("10"); - a.removeNode(node); - } - - namespace clear { - new LinkedList().clear(); - new LinkedList().clear(true); - } - - namespace toArray { - const a = new LinkedList(); - const b: number[] = a.toArray(); - } - - namespace front { - const a = new LinkedList(); - const b: number = a.front; - } - - namespace back { - const a = new LinkedList(); - const b: number = a.back; - } - - namespace iterating { - const a = new LinkedList(); - for (const b of a) { - const i: string = b; - } - const c = new LinkedList(); - for (const b of c) { - const i: number = b; - } - } - - namespace nextNode { - const a = new LinkedList(); - const n1 = a.push("h"); - const n2 = a.nextNode(n1); - n1.next; - n1.prev; - const t: string = n1.value; - } - - namespace map { - const a = new LinkedList(); - const f = (a: number, idx: number) => `${a}${idx}`; - const b = a.map(f); - const c: string = b.front; - } - - namespace forEach { - const a = new LinkedList(); - - a.forEach((a: number, b: number) => { - const c = a + b; - }); - } - - namespace static { - const a: number = LinkedList.DEFAULT_LENGTH; - } - } - - namespace ByteArrayTests { - const { ByteArray } = collection; - - new ByteArray(); - new ByteArray(10); - new ByteArray(10, true); - - const buffer = new ByteArray(); - - namespace readBitSet { - const a: boolean[] = buffer.readBitSet(); - const b: boolean[] = buffer.readBitSet(10); - } - - namespace read { - const a: adone.collection.ByteArray = buffer.read(1); - const b: adone.collection.ByteArray = buffer.read(1, 10); - } - - namespace readInt8 { - const a: number = buffer.readInt8(); - const b: number = buffer.readInt8(10); - } - - namespace readUInt8 { - const a: number = buffer.readUInt8(); - const b: number = buffer.readUInt8(10); - } - - namespace readInt16LE { - const a: number = buffer.readInt16LE(); - const b: number = buffer.readInt16LE(10); - } - - namespace readUInt16LE { - const a: number = buffer.readUInt16LE(); - const b: number = buffer.readUInt16LE(10); - } - - namespace readInt16BE { - const a: number = buffer.readInt16BE(); - const b: number = buffer.readInt16BE(10); - } - - namespace readUInt16BE { - const a: number = buffer.readUInt16BE(); - const b: number = buffer.readUInt16BE(10); - } - - namespace readInt32LE { - const a: number = buffer.readInt32LE(); - const b: number = buffer.readInt32LE(10); - } - - namespace readUInt32LE { - const a: number = buffer.readUInt32LE(); - const b: number = buffer.readUInt32LE(10); - } - - namespace readInt32BE { - const a: number = buffer.readInt32BE(); - const b: number = buffer.readInt32BE(10); - } - - namespace readUInt32BE { - const a: number = buffer.readUInt32BE(); - const b: number = buffer.readUInt32BE(10); - } - - namespace readInt64LE { - const a: adone.math.Long = buffer.readInt64LE(); - const b: adone.math.Long = buffer.readInt64LE(10); - } - - namespace readUInt64LE { - const a: adone.math.Long = buffer.readUInt64LE(); - const b: adone.math.Long = buffer.readUInt64LE(10); - } - - namespace readInt64BE { - const a: adone.math.Long = buffer.readInt64BE(); - const b: adone.math.Long = buffer.readInt64BE(10); - } - - namespace readUInt64BE { - const a: adone.math.Long = buffer.readUInt64BE(); - const b: adone.math.Long = buffer.readUInt64BE(10); - } - - namespace readFloatLE { - const a: number = buffer.readFloatLE(); - const b: number = buffer.readFloatLE(10); - } - - namespace readFloatBE { - const a: number = buffer.readFloatBE(); - const b: number = buffer.readFloatBE(10); - } - - namespace readDoubleLE { - const a: number = buffer.readDoubleLE(); - const b: number = buffer.readDoubleLE(10); - } - - namespace readDoubleBE { - const a: number = buffer.readDoubleBE(); - const b: number = buffer.readDoubleBE(10); - } - - namespace write { - const a: adone.collection.ByteArray = buffer.write("1"); - const b: adone.collection.ByteArray = buffer.write(new ByteArray()); - const c: adone.collection.ByteArray = buffer.write(Buffer.alloc(10)); - const d: adone.collection.ByteArray = buffer.write(new Uint8Array([1, 2, 3])); - const e: adone.collection.ByteArray = buffer.write(new ArrayBuffer(10)); - const f: adone.collection.ByteArray = buffer.write("1", 10); - const g: adone.collection.ByteArray = buffer.write("1", 10, 10); - const h: adone.collection.ByteArray = buffer.write("1", 10, 10, "utf8"); - } - - namespace writeBitSet { - const a: adone.collection.ByteArray = buffer.writeBitSet([1, 2, 3]); - const b: number = buffer.writeBitSet([1, 2, 3], 10); - } - - namespace writeInt8 { - const a: adone.collection.ByteArray = buffer.writeInt8(10); - const b: adone.collection.ByteArray = buffer.writeInt8(10, 10); - } - - namespace writeUInt8 { - const a: adone.collection.ByteArray = buffer.writeUInt8(10); - const b: adone.collection.ByteArray = buffer.writeUInt8(10, 10); - } - - namespace writeInt16LE { - const a: adone.collection.ByteArray = buffer.writeInt16LE(10); - const b: adone.collection.ByteArray = buffer.writeInt16LE(10, 10); - } - - namespace writeInt16BE { - const a: adone.collection.ByteArray = buffer.writeInt16BE(10); - const b: adone.collection.ByteArray = buffer.writeInt16BE(10, 10); - } - - namespace writeUInt16LE { - const a: adone.collection.ByteArray = buffer.writeUInt16LE(10); - const b: adone.collection.ByteArray = buffer.writeUInt16LE(10, 10); - } - - namespace writeUInt16BE { - const a: adone.collection.ByteArray = buffer.writeUInt16BE(10); - const b: adone.collection.ByteArray = buffer.writeUInt16BE(10, 10); - } - - namespace writeInt32LE { - const a: adone.collection.ByteArray = buffer.writeInt32LE(10); - const b: adone.collection.ByteArray = buffer.writeInt32LE(10, 10); - } - - namespace writeInt32BE { - const a: adone.collection.ByteArray = buffer.writeInt32BE(10); - const b: adone.collection.ByteArray = buffer.writeInt32BE(10, 10); - } - - namespace writeUInt32LE { - const a: adone.collection.ByteArray = buffer.writeUInt32LE(10); - const b: adone.collection.ByteArray = buffer.writeUInt32LE(10, 10); - } - - namespace writeUInt32BE { - const a: adone.collection.ByteArray = buffer.writeUInt32BE(10); - const b: adone.collection.ByteArray = buffer.writeUInt32BE(10, 10); - } - - namespace writeInt64LE { - const a: adone.collection.ByteArray = buffer.writeInt64LE(10); - const b: adone.collection.ByteArray = buffer.writeInt64LE(10, 10); - } - - namespace writeInt64BE { - const a: adone.collection.ByteArray = buffer.writeInt64BE(10); - const b: adone.collection.ByteArray = buffer.writeInt64BE(10, 10); - } - - namespace writeUInt64LE { - const a: adone.collection.ByteArray = buffer.writeUInt64LE(10); - const b: adone.collection.ByteArray = buffer.writeUInt64LE(10, 10); - } - - namespace writeUInt64BE { - const a: adone.collection.ByteArray = buffer.writeUInt64BE(10); - const b: adone.collection.ByteArray = buffer.writeUInt64BE(10, 10); - } - - namespace writeFloatLE { - const a: adone.collection.ByteArray = buffer.writeFloatLE(10); - const b: adone.collection.ByteArray = buffer.writeFloatLE(10, 10); - } - - namespace writeFloatBE { - const a: adone.collection.ByteArray = buffer.writeFloatBE(10); - const b: adone.collection.ByteArray = buffer.writeFloatBE(10, 10); - } - - namespace writeDoubleLE { - const a: adone.collection.ByteArray = buffer.writeDoubleLE(10); - const b: adone.collection.ByteArray = buffer.writeDoubleLE(10, 10); - } - - namespace writeDoubleBE { - const a: adone.collection.ByteArray = buffer.writeDoubleBE(10); - const b: adone.collection.ByteArray = buffer.writeDoubleBE(10, 10); - } - - namespace writeVarInt32 { - const a: adone.collection.ByteArray = buffer.writeVarint32(10); - const b: number = buffer.writeVarint32(10, 10); - } - - namespace writeVarInt32ZigZag { - const a: adone.collection.ByteArray = buffer.writeVarint32ZigZag(10); - const b: number = buffer.writeVarint32ZigZag(10, 10); - } - - namespace readVarint32 { - const a: number = buffer.readVarint32(); - const b: { value: number, length: number } = buffer.readVarint32(10); - } - - namespace readVarint32ZigZag { - const a: number = buffer.readVarint32ZigZag(); - const b: { value: number, length: number } = buffer.readVarint32ZigZag(10); - } - - namespace writeVarint64 { - const a: adone.collection.ByteArray = buffer.writeVarint64(10); - const b: number = buffer.writeVarint64(10, 10); - } - - namespace writeVarint64ZigZag { - const a: adone.collection.ByteArray = buffer.writeVarint64ZigZag(10); - const b: number = buffer.writeVarint64ZigZag(10, 10); - } - - namespace readVarint64 { - const a: adone.math.Long = buffer.readVarint64(); - const b: { value: adone.math.Long, length: number } = buffer.readVarint64(10); - } - - namespace readVarint64ZigZag { - const a: adone.math.Long = buffer.readVarint64ZigZag(); - const b: { value: adone.math.Long, length: number } = buffer.readVarint64ZigZag(10); - } - - namespace writeCString { - const a: adone.collection.ByteArray = buffer.writeCString("asd"); - const b: number = buffer.writeCString("123", 10); - } - - namespace readCString { - const a: string = buffer.readCString(); - const b: { string: string, length: number } = buffer.readCString(10); - } - - namespace writeString { - const a: adone.collection.ByteArray = buffer.writeString("abc"); - const b: number = buffer.writeString("abc", 10); - } - - namespace readString { - const a: string = buffer.readString(10); - const b: string = buffer.readString(10, "b"); - const c: string = buffer.readString(10, "c"); - const d: { string: string, length: number } = buffer.readString(10, "c", 10); - } - - namespace writeVString { - const a: adone.collection.ByteArray = buffer.writeVString("abc"); - const b: number = buffer.writeVString("abc", 10); - } - - namespace readVString { - const a: string = buffer.readVString(); - const b: { string: string, length: number } = buffer.readVString(10); - } - - namespace appendTo { - const a: adone.collection.ByteArray = buffer.appendTo(new ByteArray()); - const b: adone.collection.ByteArray = buffer.appendTo(new ByteArray(), 10); - } - - namespace assert { - const a: adone.collection.ByteArray = buffer.assert(); - const b: adone.collection.ByteArray = buffer.assert(true); - } - - namespace capacity { - const a: number = buffer.capacity(); - } - - namespace clear { - const a: adone.collection.ByteArray = buffer.clear(); - } - - namespace copy { - const a: adone.collection.ByteArray = buffer.clone(); - const c: adone.collection.ByteArray = buffer.clone(true); - } - - namespace compact { - const a: adone.collection.ByteArray = buffer.compact(); - const b: adone.collection.ByteArray = buffer.compact(1); - const c: adone.collection.ByteArray = buffer.compact(1, 10); - } - - namespace copyTo { - const a: adone.collection.ByteArray = buffer.copyTo(new ByteArray()); - const b: adone.collection.ByteArray = buffer.copyTo(new ByteArray(), 0); - const c: adone.collection.ByteArray = buffer.copyTo(new ByteArray(), 0, 0); - const d: adone.collection.ByteArray = buffer.copyTo(new ByteArray(), 0, 0, 10); - } - - namespace ensureCapacity { - const a: adone.collection.ByteArray = buffer.ensureCapacity(10); - } - - namespace fill { - const a: adone.collection.ByteArray = buffer.fill("0"); - const b: adone.collection.ByteArray = buffer.fill(0); - const c: adone.collection.ByteArray = buffer.fill(0, 0); - const d: adone.collection.ByteArray = buffer.fill(0, 0, 10); - } - - namespace flip { - const a: adone.collection.ByteArray = buffer.flip(); - } - - namespace mark { - const a: adone.collection.ByteArray = buffer.mark(); - const b: adone.collection.ByteArray = buffer.mark(10); - } - - namespace prepend { - const a: adone.collection.ByteArray = buffer.prepend(""); - const b: adone.collection.ByteArray = buffer.prepend(new ByteArray()); - const c: adone.collection.ByteArray = buffer.prepend(Buffer.alloc(10)); - const d: adone.collection.ByteArray = buffer.prepend(new Uint8Array([1, 2, 3])); - const e: adone.collection.ByteArray = buffer.prepend(new ArrayBuffer(10)); - const f: adone.collection.ByteArray = buffer.prepend("", "utf8"); - const g: adone.collection.ByteArray = buffer.prepend("", "utf8", 10); - const h: adone.collection.ByteArray = buffer.prepend("", 10); - } - - namespace prependTo { - const a: adone.collection.ByteArray = buffer.prependTo(new ByteArray()); - const b: adone.collection.ByteArray = buffer.prependTo(new ByteArray(), 10); - } - - namespace remaining { - const a: number = buffer.remaining(); - } - - namespace reset { - const a: adone.collection.ByteArray = buffer.reset(); - } - - namespace resize { - const a: adone.collection.ByteArray = buffer.resize(10); - } - - namespace reverse { - const a: adone.collection.ByteArray = buffer.reverse(); - const b: adone.collection.ByteArray = buffer.reverse(1); - const c: adone.collection.ByteArray = buffer.reverse(1, 10); - } - - namespace skip { - const a: adone.collection.ByteArray = buffer.skip(10); - } - - namespace slice { - const a: adone.collection.ByteArray = buffer.slice(); - const b: adone.collection.ByteArray = buffer.slice(1); - const c: adone.collection.ByteArray = buffer.slice(1, 10); - } - - namespace toBuffer { - const a: Buffer = buffer.toBuffer(); - const b: Buffer = buffer.toBuffer(true); - const c: Buffer = buffer.toBuffer(true, 0); - const d: Buffer = buffer.toBuffer(true, 0, 10); - } - - namespace toArrayBuffer { - const a: ArrayBuffer = buffer.toArrayBuffer(); - } - - namespace toString { - const a: string = buffer.toString(); - const b: string = buffer.toString("utf8"); - const c: string = buffer.toString("utf8", 0); - const d: string = buffer.toString("utf8", 0, 10); - } - - namespace toBase64 { - const a: string = buffer.toBase64(); - const b: string = buffer.toBase64(0); - const c: string = buffer.toBase64(0, 10); - } - - namespace toBinary { - const a: string = buffer.toBinary(); - const b: string = buffer.toBinary(0); - const c: string = buffer.toBinary(0, 10); - } - - namespace toDebug { - const a: string = buffer.toDebug(); - const b: string = buffer.toDebug(true); - } - - namespace toUTF8 { - const a: string = buffer.toUTF8(); - const b: string = buffer.toUTF8(0); - const c: string = buffer.toUTF8(0, 10); - } - - namespace static { - namespace accessor { - const a: typeof Buffer = ByteArray.accessor(); - } - - namespace allocate { - const a: adone.collection.ByteArray = ByteArray.allocate(); - const b: adone.collection.ByteArray = ByteArray.allocate(10); - const c: adone.collection.ByteArray = ByteArray.allocate(10, true); - } - - namespace concat { - const a: adone.collection.ByteArray = ByteArray.concat([ - new ByteArray(), - Buffer.alloc(10), - new Uint8Array([1, 2, 3]), - new ArrayBuffer(10) - ]); - const b: adone.collection.ByteArray = ByteArray.concat([ - new ByteArray(), - Buffer.alloc(10), - new Uint8Array([1, 2, 3]), - new ArrayBuffer(10) - ], "utf8"); - const c: adone.collection.ByteArray = ByteArray.concat([ - new ByteArray(), - Buffer.alloc(10), - new Uint8Array([1, 2, 3]), - new ArrayBuffer(10) - ], "utf8", true); - } - - namespace type { - const a: typeof Buffer = ByteArray.type(); - } - - namespace wrap { - const a: adone.collection.ByteArray = ByteArray.wrap(""); - const b: adone.collection.ByteArray = ByteArray.wrap(new ByteArray()); - const c: adone.collection.ByteArray = ByteArray.wrap(Buffer.alloc(10)); - const d: adone.collection.ByteArray = ByteArray.wrap(new Uint8Array([1, 2, 3])); - const e: adone.collection.ByteArray = ByteArray.wrap(new ArrayBuffer(10)); - const f: adone.collection.ByteArray = ByteArray.wrap("", "utf8"); - const g: adone.collection.ByteArray = ByteArray.wrap("", "utf8", true); - } - - namespace calculateVarint32 { - const a: number = ByteArray.calculateVarint32(10); - } - - namespace zigZagEncode32 { - const a: number = ByteArray.zigZagEncode32(10); - } - - namespace zigZagDecode32 { - const a: number = ByteArray.zigZagDecode32(10); - } - - namespace calculateVarint64 { - const a: number = ByteArray.calculateVarint64(10); - const b: number = ByteArray.calculateVarint64("10"); - } - - namespace zigZagEncode64 { - const a: adone.math.Long = ByteArray.zigZagEncode64(10); - const b: adone.math.Long = ByteArray.zigZagEncode64("10"); - const c: adone.math.Long = ByteArray.zigZagEncode64(adone.math.Long.fromValue(10)); - } - - namespace zigZagDecode64 { - const a: adone.math.Long = ByteArray.zigZagDecode64(10); - const b: adone.math.Long = ByteArray.zigZagDecode64("10"); - const c: adone.math.Long = ByteArray.zigZagDecode64(adone.math.Long.fromValue(10)); - } - - namespace calculateUTF8Chars { - const a: number = ByteArray.calculateUTF8Chars("123"); - } - - namespace calculateString { - const a: number = ByteArray.calculateString("123"); - } - - namespace fromBase64 { - const a: adone.collection.ByteArray = ByteArray.fromBase64("123"); - } - - namespace btoa { - const a: string = ByteArray.btoa("123"); - } - - namespace atob { - const a: string = ByteArray.atob("123"); - } - - namespace fromBinary { - const a: adone.collection.ByteArray = ByteArray.fromBinary("123"); - } - - namespace fromDebug { - const a: adone.collection.ByteArray = ByteArray.fromDebug("12"); - const b: adone.collection.ByteArray = ByteArray.fromDebug("12", true); - } - - namespace fromHex { - const a: adone.collection.ByteArray = ByteArray.fromHex("192"); - const b: adone.collection.ByteArray = ByteArray.fromHex("192", true); - } - - namespace fromUTF8 { - const a: adone.collection.ByteArray = ByteArray.fromUTF8("123"); - const b: adone.collection.ByteArray = ByteArray.fromUTF8("123", true); - } - - namespace constants { - const a: number = ByteArray.DEFAULT_CAPACITY; - const b: boolean = ByteArray.DEFAULT_NOASSERT; - const c: number = ByteArray.MAX_VARINT32_BYTES; - const d: number = ByteArray.MAX_VARINT64_BYTES; - const e: string = ByteArray.METRICS_CHARS; - const f: string = ByteArray.METRICS_BYTES; - } - } - } - - namespace queueTests { - const { Queue } = collection; - type Queue = adone.collection.Queue; - - new Queue(); - { const a: Queue = new Queue().push(123).push(123); } - { const a: number | undefined = new Queue().push(123).pop(); } - { const a: string | undefined = new Queue().push(123).pop(); } - { const a: boolean = new Queue().full; } - { const a: number = new Queue().length; } - { const a: boolean = new Queue().empty; } - } - - namespace asyncQueueTests { - const { AsyncQueue } = collection; - type AsyncQueue = adone.collection.AsyncQueue; - - { const a: AsyncQueue = new AsyncQueue().push(123); } - { const a: Promise = new AsyncQueue().push(123).pop(); } - } - - namespace priorityQueueTests { - const { PriorityQueue } = collection; - type PriorityQueue = adone.collection.PriorityQueue; - - { const a: boolean = new PriorityQueue().empty; } - { const a: number = new PriorityQueue().length; } - new PriorityQueue(); - new PriorityQueue({}); - new PriorityQueue({ - compare(a: number, b: number) { - return a - b; - } - }); - new PriorityQueue({ - priority(a: string, b: string) { - return a.length - b.length; - } - }); - { const a: PriorityQueue = new PriorityQueue().clone(); } - { const a: PriorityQueue = new PriorityQueue().push("123"); } - { const a: string | undefined = new PriorityQueue().pop(); } - { const a: PriorityQueue = new PriorityQueue().delete("123"); } - { const a: PriorityQueue = new PriorityQueue().delete("123"); } - { const a: string = new PriorityQueue().replace("123"); } - { const a: string = new PriorityQueue().pushpop("123"); } - { const a: string[] = new PriorityQueue().toArray(); } - { const a: PriorityQueue = PriorityQueue.from(["1"]); } - { const a: PriorityQueue = PriorityQueue.from(["1"], {}); } - { const a: PriorityQueue = PriorityQueue.from(["1"], { compare: (a: string, b: string) => a.length - b.length }); } - { const a: PriorityQueue = PriorityQueue.from(["1"], { priority: (a: string, b: string) => a.length - b.length }); } - } - - namespace fastlruTests { - const { FastLRU } = collection; - - new FastLRU(); - new FastLRU(100); - new FastLRU(100, { dispose: (key: string, value: number) => null }); - { const a: number = new FastLRU().size; } - { const a: number | undefined = new FastLRU().get("key"); } - new FastLRU().set("key", 123); - { const a: boolean = new FastLRU().delete("key"); } - { const a: boolean = new FastLRU().has("key"); } - { const a: string[] = [...new FastLRU().keys()]; } - { const a: number[] = [...new FastLRU().values()]; } - { const a: number[] = [...new FastLRU().values()]; } - { const a: Array<[string, number]> = [...new FastLRU().entries()]; } - new FastLRU().clear(); - } - - namespace stackTests { - const { Stack } = collection; - type Stack = adone.collection.Stack; - - { const a: boolean = new Stack().empty; } - { const a: number = new Stack().top; } - { const a: Stack = new Stack().push(123); } - { const a: number | undefined = new Stack().pop(); } - { const a: number[] = [...new Stack()]; } - { const a: Stack = Stack.from([1, 2, 3]); } - } - - namespace binarySearchTreeTests { - const { BinarySearchTree } = collection; - type BinarySearchTree = adone.collection.BinarySearchTree; - - new BinarySearchTree(); - new BinarySearchTree({}); - new BinarySearchTree({ checkValueEquality: (a: number, b: number) => a === b }); - new BinarySearchTree({ compareKeys: (a: string, b: string) => a.length - b.length }); - new BinarySearchTree({ parent: new BinarySearchTree() }); - new BinarySearchTree({ unique: true }); - new BinarySearchTree({ value: 123 }); - { const a: BinarySearchTree = new BinarySearchTree().getMaxKeyDescendant(); } - { const a: string = new BinarySearchTree().getMaxKey(); } - { const a: BinarySearchTree = new BinarySearchTree().getMinKeyDescendant(); } - { const a: string = new BinarySearchTree().getMinKey(); } - new BinarySearchTree().checkAllNodesFullfillCondition((key: string, value: number) => null); - new BinarySearchTree().checkIsBST(); - { const a: number = new BinarySearchTree().getNumberOfKeys(); } - new BinarySearchTree().insert("asd", 123); - { const a: number[] = new BinarySearchTree().search("asd"); } - { const a: number[] = new BinarySearchTree().betweenBounds({ $gt: "" }); } - { const a: number[] = new BinarySearchTree().betweenBounds({ $lt: "" }); } - { const a: number[] = new BinarySearchTree().betweenBounds({ $lte: "" }); } - { const a: number[] = new BinarySearchTree().betweenBounds({ $gte: "" }); } - new BinarySearchTree().delete("key"); - new BinarySearchTree().delete("key", 123); - new BinarySearchTree().executeOnEveryNode((tree: BinarySearchTree) => null); - new BinarySearchTree().prettyPrint(); - new BinarySearchTree().prettyPrint(true); - new BinarySearchTree().prettyPrint(true, " "); - } - - namespace avlTreeTests { - const { AVLTree } = collection; - type AVLTree = adone.collection.AVLTree; - - new AVLTree(); - new AVLTree({ checkValueEquality: (a: number, b: number) => a === b }); - new AVLTree({ compareKeys: (a: string, b: string) => a.length - b.length }); - new AVLTree({ parent: new AVLTree() }); - new AVLTree({ unique: false }); - new AVLTree({ value: 123 }); - new AVLTree().checkIsAVLT(); - new AVLTree().insert("123", 123); - new AVLTree().delete("123"); - new AVLTree().delete("123", 123); - { const a: number = new AVLTree().getNumberOFKeys(); } - { const a: number[] = new AVLTree().search("key"); } - { const a: number[] = new AVLTree().betweenBounds({}); } - { const a: number[] = new AVLTree().betweenBounds({ $gt: "ads" }); } - { const a: number[] = new AVLTree().betweenBounds({ $lt: "ads" }); } - { const a: number[] = new AVLTree().betweenBounds({ $gte: "ads" }); } - { const a: number[] = new AVLTree().betweenBounds({ $lte: "ads" }); } - new AVLTree().executeOnEveryNode((tree: AVLTree) => null); - } - - namespace redBlackTreeTests { - const { RedBlackTree } = collection; - type RedBlackTree = adone.collection.RedBlackTree; - type RedBlackTreeIterator = adone.collection.I.RedBlackTree.Iterator; - type RedBlackTreeNode = adone.collection.I.RedBlackTree.Node; - - new RedBlackTree(); - new RedBlackTree((a: string, b: string) => a.length - b.length); - new RedBlackTree(undefined, new RedBlackTree()); - { const a: string[] = new RedBlackTree().keys; } - { const a: number[] = new RedBlackTree().values; } - { const a: number = new RedBlackTree().length; } - { - const a: RedBlackTreeIterator = new RedBlackTree().begin; - { const b: boolean = a.valid; } - { const b: RedBlackTreeNode | null = a.node; } - { const b: string | undefined = a.key; } - { const b: number | undefined = a.value; } - { const b: number = a.index; } - { const b: boolean = a.hasNext; } - { const b: boolean = a.hasPrev; } - { const b: RedBlackTree = a.tree; } - { const b: RedBlackTreeIterator = a.clone(); } - { const b: RedBlackTree = a.remove(); } - a.next(); - { const b: RedBlackTree = a.update(333); } - a.prev(); - } - { const a: RedBlackTreeIterator = new RedBlackTree().end; } - { const a: RedBlackTree = new RedBlackTree().insert("123", 456); } - { const a: number = new RedBlackTree().forEach((key: string, value: number) => value); } - { const a: number = new RedBlackTree().forEach((key: string, value: number) => value, "1"); } - { const a: number = new RedBlackTree().forEach((key: string, value: number) => value, "1", "2"); } - { const a: RedBlackTreeIterator = new RedBlackTree().at(1); } - { const a: RedBlackTreeIterator = new RedBlackTree().ge("1"); } - { const a: RedBlackTreeIterator = new RedBlackTree().gt("1"); } - { const a: RedBlackTreeIterator = new RedBlackTree().lt("1"); } - { const a: RedBlackTreeIterator = new RedBlackTree().le("1"); } - { const a: RedBlackTreeIterator | null = new RedBlackTree().find("1"); } - { const a: RedBlackTree = new RedBlackTree().remove("1"); } - { const a: RedBlackTree = new RedBlackTree().remove("1"); } - { const a: number | undefined = new RedBlackTree().get("1"); } - } - - namespace arraySetTests { - const { ArraySet } = collection; - type ArraySet = adone.collection.ArraySet; - - new ArraySet(); - { const a: number = new ArraySet().length; } - { const a: ArraySet = new ArraySet().add("hello"); } - { const a: ArraySet = new ArraySet().add("hello", true); } - { const a: boolean = new ArraySet().has("string"); } - { const a: number = new ArraySet().indexOf("hello"); } - { const a: string[] = new ArraySet().toArray(); } - { const a: ArraySet = ArraySet.from([1]); } - { const a: ArraySet = ArraySet.from([1], true); } - } - - namespace bufferListTests { - const { BufferList } = collection; - type BufferList = adone.collection.BufferList; - - new BufferList(); - new BufferList(Buffer.from("123")); - new BufferList("123"); - new BufferList(123); - new BufferList([Buffer.from("123"), "123", 123]); - new BufferList((err: any, data: Buffer) => null); - new BufferList().append(Buffer.from("123")); - new BufferList().append("123"); - new BufferList().append(123); - new BufferList().append([Buffer.from("123"), "123", 123]); - new BufferList().end(Buffer.from("123")); - new BufferList().end(); - { const a: number = new BufferList().get(123); } - { const a: Buffer = new BufferList().slice(); } - { const a: Buffer = new BufferList().slice(1); } - { const a: Buffer = new BufferList().slice(1, 2); } - { const a: Buffer = new BufferList().copy(Buffer.alloc(100)); } - { const a: Buffer = new BufferList().copy(Buffer.alloc(100), 0); } - { const a: Buffer = new BufferList().copy(Buffer.alloc(100), 0, 1); } - { const a: Buffer = new BufferList().copy(Buffer.alloc(100), 0, 1, 2); } - { const a: BufferList = new BufferList().shallowSlice(); } - { const a: BufferList = new BufferList().shallowSlice(1); } - { const a: BufferList = new BufferList().shallowSlice(1, 2); } - { const a: string = new BufferList().toString(); } - { const a: string = new BufferList().toString("utf8"); } - { const a: string = new BufferList().toString("utf8", 1); } - { const a: string = new BufferList().toString("utf8", 1, 2); } - { const a: BufferList = new BufferList().consume(10); } - { const a: BufferList = new BufferList().duplicate(); } - new BufferList().destroy(); - new BufferList().then((x: Buffer) => null); - new BufferList().catch((err: any) => null); - } - - namespace defaultMapTests { - const { DefaultMap } = collection; - type DefaultMap = adone.collection.DefaultMap; - - new DefaultMap(); - { const a: DefaultMap = new DefaultMap(undefined, [["1", 2]]); } - { const a: DefaultMap = new DefaultMap((key: string) => 123); } - { const a: DefaultMap = new DefaultMap({ a: 123 }); } - } - - namespace lruTests { - const { LRU } = collection; - type LRU = adone.collection.LRU; - - new LRU(); - new LRU(100); - new LRU({}); - new LRU({ max: 100 }); - new LRU({ dispose: (key: string, value: number) => null }); - new LRU({ maxAge: 100 }); - new LRU({ noDisposeOnSet: false }); - new LRU({ stale: true }); - { const a: number = new LRU().max; } - { new LRU().max = 100; } - { const a: boolean = new LRU().allowStale; } - { new LRU().allowStale = false; } - { const a: number = new LRU().maxAge; } - { new LRU().maxAge = 100; } - { const a: (v: number, k: string) => number = new LRU().lengthCalculator; } - { new LRU().lengthCalculator = () => 123; } - { const a: number = new LRU().length; } - { const a: number = new LRU().itemCount; } - new LRU().rforEach((value: number, key: string) => null); - new LRU().rforEach(function (value: number, key: string) { - const b: number = this.a; - }, { a: 1 }); - new LRU().forEach((value: number, key: string) => null); - new LRU().forEach(function (value: number, key: string) { - const b: number = this.a; - }, { a: 1 }); - { const a: string[] = new LRU().keys(); } - { const a: number[] = new LRU().values(); } - new LRU().reset(); - { - const a: Array> = new LRU().dump(); - const [b] = a; - { const c: number = b.e; } - { const c: string = b.key; } - { const c: number = b.value; } - } - { - const a: adone.collection.LinkedList> = new LRU().dumpLru(); - const b = a.shift(); - if (b !== undefined) { - { const a: string = b.key; } - { const a: number = b.value; } - { const a: number = b.now; } - { const a: number = b.maxAge; } - } - } - { const a: string = new LRU().inspect(); } - { const a: string = new LRU().inspect({}); } - { const a: boolean = new LRU().set("asd", 13); } - { const a: boolean = new LRU().set("asd", 13, 100500); } - { const a: boolean = new LRU().has("asd"); } - { const a: number | undefined = new LRU().get("asd"); } - { const a: number | undefined = new LRU().peek("asd"); } - { const a: adone.collection.I.LRU.Entry = new LRU().pop(); } - new LRU().del("asd"); - new LRU().load(new LRU().dump()); - new LRU().prune(); - } - - namespace timedoutMapTests { - const { TimedoutMap } = collection; - type TimedoutMap = adone.collection.TimedoutMap; - - new TimedoutMap(); - new TimedoutMap(1000); - new TimedoutMap(1000, (key: string) => null); - { - const a: TimedoutMap = new TimedoutMap().forEach((value: number, key: string) => null); - } - { - const a: TimedoutMap = new TimedoutMap().forEach(function (value: number, key: string) { - const a: number = this.a; - }, { a: 1 }); - } - { const a: boolean = new TimedoutMap().delete("123"); } - } -} diff --git a/types/adone/test/glosses/collections/array_set.ts b/types/adone/test/glosses/collections/array_set.ts new file mode 100644 index 0000000000..49fd8582ce --- /dev/null +++ b/types/adone/test/glosses/collections/array_set.ts @@ -0,0 +1,19 @@ +namespace adoneTests.collection.ArraySet { + const { + collection: { + ArraySet + } + } = adone; + + type ArraySet = adone.collection.ArraySet; + + new ArraySet(); + { const a: number = new ArraySet().length; } + { const a: ArraySet = new ArraySet().add("hello"); } + { const a: ArraySet = new ArraySet().add("hello", true); } + { const a: boolean = new ArraySet().has("string"); } + { const a: number = new ArraySet().indexOf("hello"); } + { const a: string[] = new ArraySet().toArray(); } + { const a: ArraySet = ArraySet.from([1]); } + { const a: ArraySet = ArraySet.from([1], true); } +} diff --git a/types/adone/test/glosses/collections/async_queue.ts b/types/adone/test/glosses/collections/async_queue.ts new file mode 100644 index 0000000000..43374e6d3a --- /dev/null +++ b/types/adone/test/glosses/collections/async_queue.ts @@ -0,0 +1,12 @@ +namespace adoneTests.collection.AsyncQueue { + const { + collection: { + AsyncQueue + } + } = adone; + + type AsyncQueue = adone.collection.AsyncQueue; + + { const a: AsyncQueue = new AsyncQueue().push(123); } + { const a: Promise = new AsyncQueue().push(123).pop(); } +} diff --git a/types/adone/test/glosses/collections/avl_tree.ts b/types/adone/test/glosses/collections/avl_tree.ts new file mode 100644 index 0000000000..9c032deb2d --- /dev/null +++ b/types/adone/test/glosses/collections/avl_tree.ts @@ -0,0 +1,28 @@ +namespace adoneTests.collection.AVLTree { + const { + collection: { + AVLTree + } + } = adone; + + type AVLTree = adone.collection.AVLTree; + + new AVLTree(); + new AVLTree({ checkValueEquality: (a: number, b: number) => a === b }); + new AVLTree({ compareKeys: (a: string, b: string) => a.length - b.length }); + new AVLTree({ parent: new AVLTree() }); + new AVLTree({ unique: false }); + new AVLTree({ value: 123 }); + new AVLTree().checkIsAVLT(); + new AVLTree().insert("123", 123); + new AVLTree().delete("123"); + new AVLTree().delete("123", 123); + { const a: number = new AVLTree().getNumberOFKeys(); } + { const a: number[] = new AVLTree().search("key"); } + { const a: number[] = new AVLTree().betweenBounds({}); } + { const a: number[] = new AVLTree().betweenBounds({ $gt: "ads" }); } + { const a: number[] = new AVLTree().betweenBounds({ $lt: "ads" }); } + { const a: number[] = new AVLTree().betweenBounds({ $gte: "ads" }); } + { const a: number[] = new AVLTree().betweenBounds({ $lte: "ads" }); } + new AVLTree().executeOnEveryNode((tree: AVLTree) => null); +} diff --git a/types/adone/test/glosses/collections/binary_search_tree.ts b/types/adone/test/glosses/collections/binary_search_tree.ts new file mode 100644 index 0000000000..56f9a28e72 --- /dev/null +++ b/types/adone/test/glosses/collections/binary_search_tree.ts @@ -0,0 +1,36 @@ +namespace adoneTests.collection.BinarySearchTree { + const { + collection: { + BinarySearchTree + } + } = adone; + + type BinarySearchTree = adone.collection.BinarySearchTree; + + new BinarySearchTree(); + new BinarySearchTree({}); + new BinarySearchTree({ checkValueEquality: (a: number, b: number) => a === b }); + new BinarySearchTree({ compareKeys: (a: string, b: string) => a.length - b.length }); + new BinarySearchTree({ parent: new BinarySearchTree() }); + new BinarySearchTree({ unique: true }); + new BinarySearchTree({ value: 123 }); + { const a: BinarySearchTree = new BinarySearchTree().getMaxKeyDescendant(); } + { const a: string = new BinarySearchTree().getMaxKey(); } + { const a: BinarySearchTree = new BinarySearchTree().getMinKeyDescendant(); } + { const a: string = new BinarySearchTree().getMinKey(); } + new BinarySearchTree().checkAllNodesFullfillCondition((key: string, value: number) => null); + new BinarySearchTree().checkIsBST(); + { const a: number = new BinarySearchTree().getNumberOfKeys(); } + new BinarySearchTree().insert("asd", 123); + { const a: number[] = new BinarySearchTree().search("asd"); } + { const a: number[] = new BinarySearchTree().betweenBounds({ $gt: "" }); } + { const a: number[] = new BinarySearchTree().betweenBounds({ $lt: "" }); } + { const a: number[] = new BinarySearchTree().betweenBounds({ $lte: "" }); } + { const a: number[] = new BinarySearchTree().betweenBounds({ $gte: "" }); } + new BinarySearchTree().delete("key"); + new BinarySearchTree().delete("key", 123); + new BinarySearchTree().executeOnEveryNode((tree: BinarySearchTree) => null); + new BinarySearchTree().prettyPrint(); + new BinarySearchTree().prettyPrint(true); + new BinarySearchTree().prettyPrint(true, " "); +} diff --git a/types/adone/test/glosses/collections/buffer_list.ts b/types/adone/test/glosses/collections/buffer_list.ts new file mode 100644 index 0000000000..265d54033f --- /dev/null +++ b/types/adone/test/glosses/collections/buffer_list.ts @@ -0,0 +1,42 @@ +namespace adoneTests.collection.BufferList { + const { + collection: { + BufferList + } + } = adone; + + type BufferList = adone.collection.BufferList; + + new BufferList(); + new BufferList(Buffer.from("123")); + new BufferList("123"); + new BufferList(123); + new BufferList([Buffer.from("123"), "123", 123]); + new BufferList((err: any, data: Buffer) => null); + new BufferList().append(Buffer.from("123")); + new BufferList().append("123"); + new BufferList().append(123); + new BufferList().append([Buffer.from("123"), "123", 123]); + new BufferList().end(Buffer.from("123")); + new BufferList().end(); + { const a: number = new BufferList().get(123); } + { const a: Buffer = new BufferList().slice(); } + { const a: Buffer = new BufferList().slice(1); } + { const a: Buffer = new BufferList().slice(1, 2); } + { const a: Buffer = new BufferList().copy(Buffer.alloc(100)); } + { const a: Buffer = new BufferList().copy(Buffer.alloc(100), 0); } + { const a: Buffer = new BufferList().copy(Buffer.alloc(100), 0, 1); } + { const a: Buffer = new BufferList().copy(Buffer.alloc(100), 0, 1, 2); } + { const a: BufferList = new BufferList().shallowSlice(); } + { const a: BufferList = new BufferList().shallowSlice(1); } + { const a: BufferList = new BufferList().shallowSlice(1, 2); } + { const a: string = new BufferList().toString(); } + { const a: string = new BufferList().toString("utf8"); } + { const a: string = new BufferList().toString("utf8", 1); } + { const a: string = new BufferList().toString("utf8", 1, 2); } + { const a: BufferList = new BufferList().consume(10); } + { const a: BufferList = new BufferList().duplicate(); } + new BufferList().destroy(); + new BufferList().then((x: Buffer) => null); + new BufferList().catch((err: any) => null); +} diff --git a/types/adone/test/glosses/collections/byte_array.ts b/types/adone/test/glosses/collections/byte_array.ts new file mode 100644 index 0000000000..7254008322 --- /dev/null +++ b/types/adone/test/glosses/collections/byte_array.ts @@ -0,0 +1,561 @@ +namespace adoneTests.collection.ByteArray { + const { + collection: { + ByteArray + } + } = adone; + + new ByteArray(); + new ByteArray(10); + new ByteArray(10, true); + + const buffer = new ByteArray(); + + buffer.woffset === 2; + buffer.roffset === 3; + buffer.noAssert === true; + buffer.buffer.writeUInt8(0, 0); + + namespace readBitSet { + const a: boolean[] = buffer.readBitSet(); + const b: boolean[] = buffer.readBitSet(10); + } + + namespace read { + const a: adone.collection.ByteArray = buffer.read(1); + const b: adone.collection.ByteArray = buffer.read(1, 10); + } + + namespace readInt8 { + const a: number = buffer.readInt8(); + const b: number = buffer.readInt8(10); + } + + namespace readUInt8 { + const a: number = buffer.readUInt8(); + const b: number = buffer.readUInt8(10); + } + + namespace readInt16LE { + const a: number = buffer.readInt16LE(); + const b: number = buffer.readInt16LE(10); + } + + namespace readUInt16LE { + const a: number = buffer.readUInt16LE(); + const b: number = buffer.readUInt16LE(10); + } + + namespace readInt16BE { + const a: number = buffer.readInt16BE(); + const b: number = buffer.readInt16BE(10); + } + + namespace readUInt16BE { + const a: number = buffer.readUInt16BE(); + const b: number = buffer.readUInt16BE(10); + } + + namespace readInt32LE { + const a: number = buffer.readInt32LE(); + const b: number = buffer.readInt32LE(10); + } + + namespace readUInt32LE { + const a: number = buffer.readUInt32LE(); + const b: number = buffer.readUInt32LE(10); + } + + namespace readInt32BE { + const a: number = buffer.readInt32BE(); + const b: number = buffer.readInt32BE(10); + } + + namespace readUInt32BE { + const a: number = buffer.readUInt32BE(); + const b: number = buffer.readUInt32BE(10); + } + + namespace readInt64LE { + const a: adone.math.Long = buffer.readInt64LE(); + const b: adone.math.Long = buffer.readInt64LE(10); + } + + namespace readUInt64LE { + const a: adone.math.Long = buffer.readUInt64LE(); + const b: adone.math.Long = buffer.readUInt64LE(10); + } + + namespace readInt64BE { + const a: adone.math.Long = buffer.readInt64BE(); + const b: adone.math.Long = buffer.readInt64BE(10); + } + + namespace readUInt64BE { + const a: adone.math.Long = buffer.readUInt64BE(); + const b: adone.math.Long = buffer.readUInt64BE(10); + } + + namespace readFloatLE { + const a: number = buffer.readFloatLE(); + const b: number = buffer.readFloatLE(10); + } + + namespace readFloatBE { + const a: number = buffer.readFloatBE(); + const b: number = buffer.readFloatBE(10); + } + + namespace readDoubleLE { + const a: number = buffer.readDoubleLE(); + const b: number = buffer.readDoubleLE(10); + } + + namespace readDoubleBE { + const a: number = buffer.readDoubleBE(); + const b: number = buffer.readDoubleBE(10); + } + + namespace write { + const a: adone.collection.ByteArray = buffer.write("1"); + const b: adone.collection.ByteArray = buffer.write(new ByteArray()); + const c: adone.collection.ByteArray = buffer.write(Buffer.alloc(10)); + const d: adone.collection.ByteArray = buffer.write(new Uint8Array([1, 2, 3])); + const e: adone.collection.ByteArray = buffer.write(new ArrayBuffer(10)); + const f: adone.collection.ByteArray = buffer.write("1", 10); + const g: adone.collection.ByteArray = buffer.write("1", 10, 10); + const h: adone.collection.ByteArray = buffer.write("1", 10, 10, "utf8"); + } + + namespace writeBitSet { + const a: adone.collection.ByteArray = buffer.writeBitSet([1, 2, 3]); + const b: number = buffer.writeBitSet([1, 2, 3], 10); + } + + namespace writeInt8 { + const a: adone.collection.ByteArray = buffer.writeInt8(10); + const b: adone.collection.ByteArray = buffer.writeInt8(10, 10); + } + + namespace writeUInt8 { + const a: adone.collection.ByteArray = buffer.writeUInt8(10); + const b: adone.collection.ByteArray = buffer.writeUInt8(10, 10); + } + + namespace writeInt16LE { + const a: adone.collection.ByteArray = buffer.writeInt16LE(10); + const b: adone.collection.ByteArray = buffer.writeInt16LE(10, 10); + } + + namespace writeInt16BE { + const a: adone.collection.ByteArray = buffer.writeInt16BE(10); + const b: adone.collection.ByteArray = buffer.writeInt16BE(10, 10); + } + + namespace writeUInt16LE { + const a: adone.collection.ByteArray = buffer.writeUInt16LE(10); + const b: adone.collection.ByteArray = buffer.writeUInt16LE(10, 10); + } + + namespace writeUInt16BE { + const a: adone.collection.ByteArray = buffer.writeUInt16BE(10); + const b: adone.collection.ByteArray = buffer.writeUInt16BE(10, 10); + } + + namespace writeInt32LE { + const a: adone.collection.ByteArray = buffer.writeInt32LE(10); + const b: adone.collection.ByteArray = buffer.writeInt32LE(10, 10); + } + + namespace writeInt32BE { + const a: adone.collection.ByteArray = buffer.writeInt32BE(10); + const b: adone.collection.ByteArray = buffer.writeInt32BE(10, 10); + } + + namespace writeUInt32LE { + const a: adone.collection.ByteArray = buffer.writeUInt32LE(10); + const b: adone.collection.ByteArray = buffer.writeUInt32LE(10, 10); + } + + namespace writeUInt32BE { + const a: adone.collection.ByteArray = buffer.writeUInt32BE(10); + const b: adone.collection.ByteArray = buffer.writeUInt32BE(10, 10); + } + + namespace writeInt64LE { + const a: adone.collection.ByteArray = buffer.writeInt64LE(10); + const b: adone.collection.ByteArray = buffer.writeInt64LE(10, 10); + } + + namespace writeInt64BE { + const a: adone.collection.ByteArray = buffer.writeInt64BE(10); + const b: adone.collection.ByteArray = buffer.writeInt64BE(10, 10); + } + + namespace writeUInt64LE { + const a: adone.collection.ByteArray = buffer.writeUInt64LE(10); + const b: adone.collection.ByteArray = buffer.writeUInt64LE(10, 10); + } + + namespace writeUInt64BE { + const a: adone.collection.ByteArray = buffer.writeUInt64BE(10); + const b: adone.collection.ByteArray = buffer.writeUInt64BE(10, 10); + } + + namespace writeFloatLE { + const a: adone.collection.ByteArray = buffer.writeFloatLE(10); + const b: adone.collection.ByteArray = buffer.writeFloatLE(10, 10); + } + + namespace writeFloatBE { + const a: adone.collection.ByteArray = buffer.writeFloatBE(10); + const b: adone.collection.ByteArray = buffer.writeFloatBE(10, 10); + } + + namespace writeDoubleLE { + const a: adone.collection.ByteArray = buffer.writeDoubleLE(10); + const b: adone.collection.ByteArray = buffer.writeDoubleLE(10, 10); + } + + namespace writeDoubleBE { + const a: adone.collection.ByteArray = buffer.writeDoubleBE(10); + const b: adone.collection.ByteArray = buffer.writeDoubleBE(10, 10); + } + + namespace writeVarInt32 { + const a: adone.collection.ByteArray = buffer.writeVarint32(10); + const b: number = buffer.writeVarint32(10, 10); + } + + namespace writeVarInt32ZigZag { + const a: adone.collection.ByteArray = buffer.writeVarint32ZigZag(10); + const b: number = buffer.writeVarint32ZigZag(10, 10); + } + + namespace readVarint32 { + const a: number = buffer.readVarint32(); + const b: { value: number, length: number } = buffer.readVarint32(10); + } + + namespace readVarint32ZigZag { + const a: number = buffer.readVarint32ZigZag(); + const b: { value: number, length: number } = buffer.readVarint32ZigZag(10); + } + + namespace writeVarint64 { + const a: adone.collection.ByteArray = buffer.writeVarint64(10); + const b: number = buffer.writeVarint64(10, 10); + } + + namespace writeVarint64ZigZag { + const a: adone.collection.ByteArray = buffer.writeVarint64ZigZag(10); + const b: number = buffer.writeVarint64ZigZag(10, 10); + } + + namespace readVarint64 { + const a: adone.math.Long = buffer.readVarint64(); + const b: { value: adone.math.Long, length: number } = buffer.readVarint64(10); + } + + namespace readVarint64ZigZag { + const a: adone.math.Long = buffer.readVarint64ZigZag(); + const b: { value: adone.math.Long, length: number } = buffer.readVarint64ZigZag(10); + } + + namespace writeCString { + const a: adone.collection.ByteArray = buffer.writeCString("asd"); + const b: number = buffer.writeCString("123", 10); + } + + namespace readCString { + const a: string = buffer.readCString(); + const b: { string: string, length: number } = buffer.readCString(10); + } + + namespace writeString { + const a: adone.collection.ByteArray = buffer.writeString("abc"); + const b: number = buffer.writeString("abc", 10); + } + + namespace readString { + const a: string = buffer.readString(10); + const b: string = buffer.readString(10, "b"); + const c: string = buffer.readString(10, "c"); + const d: { string: string, length: number } = buffer.readString(10, "c", 10); + } + + namespace writeVString { + const a: adone.collection.ByteArray = buffer.writeVString("abc"); + const b: number = buffer.writeVString("abc", 10); + } + + namespace readVString { + const a: string = buffer.readVString(); + const b: { string: string, length: number } = buffer.readVString(10); + } + + namespace appendTo { + const a: adone.collection.ByteArray = buffer.appendTo(new ByteArray()); + const b: adone.collection.ByteArray = buffer.appendTo(new ByteArray(), 10); + } + + namespace assert { + const a: adone.collection.ByteArray = buffer.assert(); + const b: adone.collection.ByteArray = buffer.assert(true); + } + + namespace capacity { + const a: number = buffer.capacity(); + } + + namespace clear { + const a: adone.collection.ByteArray = buffer.clear(); + } + + namespace copy { + const a: adone.collection.ByteArray = buffer.clone(); + const c: adone.collection.ByteArray = buffer.clone(true); + } + + namespace compact { + const a: adone.collection.ByteArray = buffer.compact(); + const b: adone.collection.ByteArray = buffer.compact(1); + const c: adone.collection.ByteArray = buffer.compact(1, 10); + } + + namespace copyTo { + const a: adone.collection.ByteArray = buffer.copyTo(new ByteArray()); + const b: adone.collection.ByteArray = buffer.copyTo(new ByteArray(), 0); + const c: adone.collection.ByteArray = buffer.copyTo(new ByteArray(), 0, 0); + const d: adone.collection.ByteArray = buffer.copyTo(new ByteArray(), 0, 0, 10); + } + + namespace ensureCapacity { + const a: adone.collection.ByteArray = buffer.ensureCapacity(10); + } + + namespace fill { + const a: adone.collection.ByteArray = buffer.fill("0"); + const b: adone.collection.ByteArray = buffer.fill(0); + const c: adone.collection.ByteArray = buffer.fill(0, 0); + const d: adone.collection.ByteArray = buffer.fill(0, 0, 10); + } + + namespace flip { + const a: adone.collection.ByteArray = buffer.flip(); + } + + namespace mark { + const a: adone.collection.ByteArray = buffer.mark(); + const b: adone.collection.ByteArray = buffer.mark(10); + } + + namespace prepend { + const a: adone.collection.ByteArray = buffer.prepend(""); + const b: adone.collection.ByteArray = buffer.prepend(new ByteArray()); + const c: adone.collection.ByteArray = buffer.prepend(Buffer.alloc(10)); + const d: adone.collection.ByteArray = buffer.prepend(new Uint8Array([1, 2, 3])); + const e: adone.collection.ByteArray = buffer.prepend(new ArrayBuffer(10)); + const f: adone.collection.ByteArray = buffer.prepend("", "utf8"); + const g: adone.collection.ByteArray = buffer.prepend("", "utf8", 10); + const h: adone.collection.ByteArray = buffer.prepend("", 10); + } + + namespace prependTo { + const a: adone.collection.ByteArray = buffer.prependTo(new ByteArray()); + const b: adone.collection.ByteArray = buffer.prependTo(new ByteArray(), 10); + } + + namespace remaining { + const a: number = buffer.remaining(); + } + + namespace reset { + const a: adone.collection.ByteArray = buffer.reset(); + } + + namespace resize { + const a: adone.collection.ByteArray = buffer.resize(10); + } + + namespace reverse { + const a: adone.collection.ByteArray = buffer.reverse(); + const b: adone.collection.ByteArray = buffer.reverse(1); + const c: adone.collection.ByteArray = buffer.reverse(1, 10); + } + + namespace skip { + const a: adone.collection.ByteArray = buffer.skip(10); + } + + namespace slice { + const a: adone.collection.ByteArray = buffer.slice(); + const b: adone.collection.ByteArray = buffer.slice(1); + const c: adone.collection.ByteArray = buffer.slice(1, 10); + } + + namespace toBuffer { + const a: Buffer = buffer.toBuffer(); + const b: Buffer = buffer.toBuffer(true); + const c: Buffer = buffer.toBuffer(true, 0); + const d: Buffer = buffer.toBuffer(true, 0, 10); + } + + namespace toArrayBuffer { + const a: ArrayBuffer = buffer.toArrayBuffer(); + } + + namespace toString { + const a: string = buffer.toString(); + const b: string = buffer.toString("utf8"); + const c: string = buffer.toString("utf8", 0); + const d: string = buffer.toString("utf8", 0, 10); + } + + namespace toBase64 { + const a: string = buffer.toBase64(); + const b: string = buffer.toBase64(0); + const c: string = buffer.toBase64(0, 10); + } + + namespace toBinary { + const a: string = buffer.toBinary(); + const b: string = buffer.toBinary(0); + const c: string = buffer.toBinary(0, 10); + } + + namespace toDebug { + const a: string = buffer.toDebug(); + const b: string = buffer.toDebug(true); + } + + namespace toUTF8 { + const a: string = buffer.toUTF8(); + const b: string = buffer.toUTF8(0); + const c: string = buffer.toUTF8(0, 10); + } + + namespace static { + namespace accessor { + const a: typeof Buffer = ByteArray.accessor(); + } + + namespace allocate { + const a: adone.collection.ByteArray = ByteArray.allocate(); + const b: adone.collection.ByteArray = ByteArray.allocate(10); + const c: adone.collection.ByteArray = ByteArray.allocate(10, true); + } + + namespace concat { + const a: adone.collection.ByteArray = ByteArray.concat([ + new ByteArray(), + Buffer.alloc(10), + new Uint8Array([1, 2, 3]), + new ArrayBuffer(10) + ]); + const b: adone.collection.ByteArray = ByteArray.concat([ + new ByteArray(), + Buffer.alloc(10), + new Uint8Array([1, 2, 3]), + new ArrayBuffer(10) + ], "utf8"); + const c: adone.collection.ByteArray = ByteArray.concat([ + new ByteArray(), + Buffer.alloc(10), + new Uint8Array([1, 2, 3]), + new ArrayBuffer(10) + ], "utf8", true); + } + + namespace type { + const a: typeof Buffer = ByteArray.type(); + } + + namespace wrap { + const a: adone.collection.ByteArray = ByteArray.wrap(""); + const b: adone.collection.ByteArray = ByteArray.wrap(new ByteArray()); + const c: adone.collection.ByteArray = ByteArray.wrap(Buffer.alloc(10)); + const d: adone.collection.ByteArray = ByteArray.wrap(new Uint8Array([1, 2, 3])); + const e: adone.collection.ByteArray = ByteArray.wrap(new ArrayBuffer(10)); + const f: adone.collection.ByteArray = ByteArray.wrap("", "utf8"); + const g: adone.collection.ByteArray = ByteArray.wrap("", "utf8", true); + } + + namespace calculateVarint32 { + const a: number = ByteArray.calculateVarint32(10); + } + + namespace zigZagEncode32 { + const a: number = ByteArray.zigZagEncode32(10); + } + + namespace zigZagDecode32 { + const a: number = ByteArray.zigZagDecode32(10); + } + + namespace calculateVarint64 { + const a: number = ByteArray.calculateVarint64(10); + const b: number = ByteArray.calculateVarint64("10"); + } + + namespace zigZagEncode64 { + const a: adone.math.Long = ByteArray.zigZagEncode64(10); + const b: adone.math.Long = ByteArray.zigZagEncode64("10"); + const c: adone.math.Long = ByteArray.zigZagEncode64(adone.math.Long.fromValue(10)); + } + + namespace zigZagDecode64 { + const a: adone.math.Long = ByteArray.zigZagDecode64(10); + const b: adone.math.Long = ByteArray.zigZagDecode64("10"); + const c: adone.math.Long = ByteArray.zigZagDecode64(adone.math.Long.fromValue(10)); + } + + namespace calculateUTF8Chars { + const a: number = ByteArray.calculateUTF8Chars("123"); + } + + namespace calculateString { + const a: number = ByteArray.calculateString("123"); + } + + namespace fromBase64 { + const a: adone.collection.ByteArray = ByteArray.fromBase64("123"); + } + + namespace btoa { + const a: string = ByteArray.btoa("123"); + } + + namespace atob { + const a: string = ByteArray.atob("123"); + } + + namespace fromBinary { + const a: adone.collection.ByteArray = ByteArray.fromBinary("123"); + } + + namespace fromDebug { + const a: adone.collection.ByteArray = ByteArray.fromDebug("12"); + const b: adone.collection.ByteArray = ByteArray.fromDebug("12", true); + } + + namespace fromHex { + const a: adone.collection.ByteArray = ByteArray.fromHex("192"); + const b: adone.collection.ByteArray = ByteArray.fromHex("192", true); + } + + namespace fromUTF8 { + const a: adone.collection.ByteArray = ByteArray.fromUTF8("123"); + const b: adone.collection.ByteArray = ByteArray.fromUTF8("123", true); + } + + namespace constants { + const a: number = ByteArray.DEFAULT_CAPACITY; + const b: boolean = ByteArray.DEFAULT_NOASSERT; + const c: number = ByteArray.MAX_VARINT32_BYTES; + const d: number = ByteArray.MAX_VARINT64_BYTES; + const e: string = ByteArray.METRICS_CHARS; + const f: string = ByteArray.METRICS_BYTES; + } + } +} diff --git a/types/adone/test/glosses/collections/default_map.ts b/types/adone/test/glosses/collections/default_map.ts new file mode 100644 index 0000000000..1273b91982 --- /dev/null +++ b/types/adone/test/glosses/collections/default_map.ts @@ -0,0 +1,14 @@ +namespace adoneTests.collection.DefaultMap { + const { + collection: { + DefaultMap + } + } = adone; + + type DefaultMap = adone.collection.DefaultMap; + + new DefaultMap(); + { const a: DefaultMap = new DefaultMap(undefined, [["1", 2]]); } + { const a: DefaultMap = new DefaultMap((key: string) => 123); } + { const a: DefaultMap = new DefaultMap({ a: 123 }); } +} diff --git a/types/adone/test/glosses/collections/fast_lru.ts b/types/adone/test/glosses/collections/fast_lru.ts new file mode 100644 index 0000000000..0e61f51dc5 --- /dev/null +++ b/types/adone/test/glosses/collections/fast_lru.ts @@ -0,0 +1,21 @@ +namespace adoneTests.collection.FastLRU { + const { + collection: { + FastLRU + } + } = adone; + + new FastLRU(); + new FastLRU(100); + new FastLRU(100, { dispose: (key: string, value: number) => null }); + { const a: number = new FastLRU().size; } + { const a: number | undefined = new FastLRU().get("key"); } + new FastLRU().set("key", 123); + { const a: boolean = new FastLRU().delete("key"); } + { const a: boolean = new FastLRU().has("key"); } + { const a: string[] = [...new FastLRU().keys()]; } + { const a: number[] = [...new FastLRU().values()]; } + { const a: number[] = [...new FastLRU().values()]; } + { const a: Array<[string, number]> = [...new FastLRU().entries()]; } + new FastLRU().clear(); +} diff --git a/types/adone/test/glosses/collections/linked_list.ts b/types/adone/test/glosses/collections/linked_list.ts new file mode 100644 index 0000000000..f64a32c1aa --- /dev/null +++ b/types/adone/test/glosses/collections/linked_list.ts @@ -0,0 +1,123 @@ +namespace adoneTests.collection.LinkedList { + const { + collection: { + LinkedList + } + } = adone; + + namespace creation { + new LinkedList(); + new LinkedList(10); + } + + namespace properties { + { const a: boolean = new LinkedList().full; } + { const a: boolean = new LinkedList().empty; } + { const a: number = new LinkedList().maxLength; } + { const a: number = new LinkedList().length; } + { const a: boolean = new LinkedList().autoresize; } + } + + namespace resize { + { const a: boolean = new LinkedList().resize(100).full; } + } + + namespace push { + const a = new LinkedList().push(10); + a.next; + a.prev; + const b: number = a.value; + } + + namespace pop { + const a: number | undefined = new LinkedList().pop(); + } + + namespace shift { + const a: number | undefined = new LinkedList().shift(); + } + + namespace unshift { + const a = new LinkedList().unshift("hello"); + a.next; + a.prev; + const b: string = a.value; + } + + namespace pushNode { + const a = new LinkedList(); + const node = a.push("1230"); + a.pushNode(node); + } + + namespace unshiftNode { + const a = new LinkedList(); + const node = a.push(10); + a.unshiftNode(node); + } + + namespace removeNode { + const a = new LinkedList(); + const node = a.unshift("10"); + a.removeNode(node); + } + + namespace clear { + new LinkedList().clear(); + new LinkedList().clear(true); + } + + namespace toArray { + const a = new LinkedList(); + const b: number[] = a.toArray(); + } + + namespace front { + const a = new LinkedList(); + const b: number = a.front; + } + + namespace back { + const a = new LinkedList(); + const b: number = a.back; + } + + namespace iterating { + const a = new LinkedList(); + for (const b of a) { + const i: string = b; + } + const c = new LinkedList(); + for (const b of c) { + const i: number = b; + } + } + + namespace nextNode { + const a = new LinkedList(); + const n1 = a.push("h"); + const n2 = a.nextNode(n1); + n1.next; + n1.prev; + const t: string = n1.value; + } + + namespace map { + const a = new LinkedList(); + const f = (a: number, idx: number) => `${a}${idx}`; + const b = a.map(f); + const c: string = b.front; + } + + namespace forEach { + const a = new LinkedList(); + + a.forEach((a: number, b: number) => { + const c = a + b; + }); + } + + namespace static { + const a: number = LinkedList.DEFAULT_LENGTH; + } +} diff --git a/types/adone/test/glosses/collections/lru.ts b/types/adone/test/glosses/collections/lru.ts new file mode 100644 index 0000000000..934e5a1fbf --- /dev/null +++ b/types/adone/test/glosses/collections/lru.ts @@ -0,0 +1,67 @@ +namespace adoneTests.collection.LRU { + const { + collection: { + LRU + } + } = adone; + + type LRU = adone.collection.LRU; + + new LRU(); + new LRU(100); + new LRU({}); + new LRU({ max: 100 }); + new LRU({ dispose: (key: string, value: number) => null }); + new LRU({ maxAge: 100 }); + new LRU({ noDisposeOnSet: false }); + new LRU({ stale: true }); + { const a: number = new LRU().max; } + { new LRU().max = 100; } + { const a: boolean = new LRU().allowStale; } + { new LRU().allowStale = false; } + { const a: number = new LRU().maxAge; } + { new LRU().maxAge = 100; } + { const a: (v: number, k: string) => number = new LRU().lengthCalculator; } + { new LRU().lengthCalculator = () => 123; } + { const a: number = new LRU().length; } + { const a: number = new LRU().itemCount; } + new LRU().rforEach((value: number, key: string) => null); + new LRU().rforEach(function (value: number, key: string) { + const b: number = this.a; + }, { a: 1 }); + new LRU().forEach((value: number, key: string) => null); + new LRU().forEach(function (value: number, key: string) { + const b: number = this.a; + }, { a: 1 }); + { const a: string[] = new LRU().keys(); } + { const a: number[] = new LRU().values(); } + new LRU().reset(); + { + const a: Array> = new LRU().dump(); + const [b] = a; + { const c: number = b.e; } + { const c: string = b.key; } + { const c: number = b.value; } + } + { + const a: adone.collection.LinkedList> = new LRU().dumpLru(); + const b = a.shift(); + if (b !== undefined) { + { const a: string = b.key; } + { const a: number = b.value; } + { const a: number = b.now; } + { const a: number = b.maxAge; } + } + } + { const a: string = new LRU().inspect(); } + { const a: string = new LRU().inspect({}); } + { const a: boolean = new LRU().set("asd", 13); } + { const a: boolean = new LRU().set("asd", 13, 100500); } + { const a: boolean = new LRU().has("asd"); } + { const a: number | undefined = new LRU().get("asd"); } + { const a: number | undefined = new LRU().peek("asd"); } + { const a: adone.collection.I.LRU.Entry = new LRU().pop(); } + new LRU().del("asd"); + new LRU().load(new LRU().dump()); + new LRU().prune(); +} diff --git a/types/adone/test/glosses/collections/map_cache.ts b/types/adone/test/glosses/collections/map_cache.ts new file mode 100644 index 0000000000..bcd0ffb887 --- /dev/null +++ b/types/adone/test/glosses/collections/map_cache.ts @@ -0,0 +1,21 @@ +namespace adoneTests.collection.MapCache { + const { + collection: { + MapCache + } + } = adone; + + new MapCache(); + + new MapCache().has("hello"); + new MapCache().get("hello"); + new MapCache().set("hello", "world"); + new MapCache().delete("hello"); + new MapCache().clear(); + + { + const a = new MapCache(); + a.set("a", "b"); + a.get("a").charCodeAt(20); + } +} diff --git a/types/adone/test/glosses/collections/ns_cache.ts b/types/adone/test/glosses/collections/ns_cache.ts new file mode 100644 index 0000000000..a8e8c14397 --- /dev/null +++ b/types/adone/test/glosses/collections/ns_cache.ts @@ -0,0 +1,21 @@ +namespace adoneTests.collection.NSCache { + const { + collection: { + NSCache + } + } = adone; + + new NSCache(10, ["a", "b", "c"]); + new NSCache(10, ["a", "b", "c"]).resize(100); + new NSCache(10, ["a", "b", "c"]).set("a", "b", "c"); + new NSCache(10, ["a", "b", "c"]).get("a", "b"); + new NSCache(10, ["a", "b", "c"]).has("a", "b"); + new NSCache(10, ["a", "b", "c"]).delete("a", "b"); + new NSCache(10, ["a", "b", "c"]).clear(); + + { + const a = new NSCache(10, ["a", "b", "c"]); + a.set("a", "b", "c"); + a.get("a", "b").charCodeAt(100); + } +} diff --git a/types/adone/test/glosses/collections/priority_queue.ts b/types/adone/test/glosses/collections/priority_queue.ts new file mode 100644 index 0000000000..950e7394e7 --- /dev/null +++ b/types/adone/test/glosses/collections/priority_queue.ts @@ -0,0 +1,36 @@ +namespace adoneTests.collection.PriorityQueue { + const { + collection: { + PriorityQueue + } + } = adone; + + type PriorityQueue = adone.collection.PriorityQueue; + + { const a: boolean = new PriorityQueue().empty; } + { const a: number = new PriorityQueue().length; } + new PriorityQueue(); + new PriorityQueue({}); + new PriorityQueue({ + compare(a: number, b: number) { + return a - b; + } + }); + new PriorityQueue({ + priority(a: string, b: string) { + return a.length - b.length; + } + }); + { const a: PriorityQueue = new PriorityQueue().clone(); } + { const a: PriorityQueue = new PriorityQueue().push("123"); } + { const a: string | undefined = new PriorityQueue().pop(); } + { const a: PriorityQueue = new PriorityQueue().delete("123"); } + { const a: PriorityQueue = new PriorityQueue().delete("123"); } + { const a: string = new PriorityQueue().replace("123"); } + { const a: string = new PriorityQueue().pushpop("123"); } + { const a: string[] = new PriorityQueue().toArray(); } + { const a: PriorityQueue = PriorityQueue.from(["1"]); } + { const a: PriorityQueue = PriorityQueue.from(["1"], {}); } + { const a: PriorityQueue = PriorityQueue.from(["1"], { compare: (a: string, b: string) => a.length - b.length }); } + { const a: PriorityQueue = PriorityQueue.from(["1"], { priority: (a: string, b: string) => a.length - b.length }); } +} diff --git a/types/adone/test/glosses/collections/queue.ts b/types/adone/test/glosses/collections/queue.ts new file mode 100644 index 0000000000..fd6df7f39b --- /dev/null +++ b/types/adone/test/glosses/collections/queue.ts @@ -0,0 +1,17 @@ +namespace adoneTests.collection.Queue { + const { + collection: { + Queue + } + } = adone; + + type Queue = adone.collection.Queue; + + new Queue(); + { const a: Queue = new Queue().push(123).push(123); } + { const a: number | undefined = new Queue().push(123).pop(); } + { const a: string | undefined = new Queue().push(123).pop(); } + { const a: boolean = new Queue().full; } + { const a: number = new Queue().length; } + { const a: boolean = new Queue().empty; } +} diff --git a/types/adone/test/glosses/collections/rb_tree.ts b/types/adone/test/glosses/collections/rb_tree.ts new file mode 100644 index 0000000000..1b624284f6 --- /dev/null +++ b/types/adone/test/glosses/collections/rb_tree.ts @@ -0,0 +1,48 @@ +namespace adoneTests.collection.RedBlackTree { + const { + collection: { + RedBlackTree + } + } = adone; + + type RedBlackTree = adone.collection.RedBlackTree; + type RedBlackTreeIterator = adone.collection.I.RedBlackTree.Iterator; + type RedBlackTreeNode = adone.collection.I.RedBlackTree.Node; + + new RedBlackTree(); + new RedBlackTree((a: string, b: string) => a.length - b.length); + new RedBlackTree(undefined, new RedBlackTree()); + { const a: string[] = new RedBlackTree().keys; } + { const a: number[] = new RedBlackTree().values; } + { const a: number = new RedBlackTree().length; } + { + const a: RedBlackTreeIterator = new RedBlackTree().begin; + { const b: boolean = a.valid; } + { const b: RedBlackTreeNode | null = a.node; } + { const b: string | undefined = a.key; } + { const b: number | undefined = a.value; } + { const b: number = a.index; } + { const b: boolean = a.hasNext; } + { const b: boolean = a.hasPrev; } + { const b: RedBlackTree = a.tree; } + { const b: RedBlackTreeIterator = a.clone(); } + { const b: RedBlackTree = a.remove(); } + a.next(); + { const b: RedBlackTree = a.update(333); } + a.prev(); + } + { const a: RedBlackTreeIterator = new RedBlackTree().end; } + { const a: RedBlackTree = new RedBlackTree().insert("123", 456); } + { const a: number = new RedBlackTree().forEach((key: string, value: number) => value); } + { const a: number = new RedBlackTree().forEach((key: string, value: number) => value, "1"); } + { const a: number = new RedBlackTree().forEach((key: string, value: number) => value, "1", "2"); } + { const a: RedBlackTreeIterator = new RedBlackTree().at(1); } + { const a: RedBlackTreeIterator = new RedBlackTree().ge("1"); } + { const a: RedBlackTreeIterator = new RedBlackTree().gt("1"); } + { const a: RedBlackTreeIterator = new RedBlackTree().lt("1"); } + { const a: RedBlackTreeIterator = new RedBlackTree().le("1"); } + { const a: RedBlackTreeIterator | null = new RedBlackTree().find("1"); } + { const a: RedBlackTree = new RedBlackTree().remove("1"); } + { const a: RedBlackTree = new RedBlackTree().remove("1"); } + { const a: number | undefined = new RedBlackTree().get("1"); } +} diff --git a/types/adone/test/glosses/collections/refcounted_cache.ts b/types/adone/test/glosses/collections/refcounted_cache.ts new file mode 100644 index 0000000000..6262d57d60 --- /dev/null +++ b/types/adone/test/glosses/collections/refcounted_cache.ts @@ -0,0 +1,17 @@ +namespace adoneTests.collection.RefcountedCache { + const { + collection: { + RefcountedCache + } + } = adone; + + new RefcountedCache(); + new RefcountedCache().ref("a"); + new RefcountedCache().unref("a"); + new RefcountedCache().references("a") === 5; + + { + const a = new RefcountedCache(); + a.get("b").charCodeAt(100); + } +} diff --git a/types/adone/test/glosses/collections/set.ts b/types/adone/test/glosses/collections/set.ts new file mode 100644 index 0000000000..2e2314956e --- /dev/null +++ b/types/adone/test/glosses/collections/set.ts @@ -0,0 +1,26 @@ +namespace adoneTests.collection.Set { + const { + collection: { + Set + } + } = adone; + + new Set().add("a"); + new Set().has("a"); + new Set().delete("a"); + new Set().get("a"); + new Set().has("a") === true; + new Set().only(); + new Set().size === 5; + + { + const a = new Set(); + + a.add(1); + a.has(2); + a.delete(2); + a.get(2); // ??? + a.only() === 5; + a.size === 5; + } +} diff --git a/types/adone/test/glosses/collections/stack.ts b/types/adone/test/glosses/collections/stack.ts new file mode 100644 index 0000000000..df13f82f8e --- /dev/null +++ b/types/adone/test/glosses/collections/stack.ts @@ -0,0 +1,16 @@ +namespace adoneTests.collection.Stack { + const { + collection: { + Stack + } + } = adone; + + type Stack = adone.collection.Stack; + + { const a: boolean = new Stack().empty; } + { const a: number = new Stack().top; } + { const a: Stack = new Stack().push(123); } + { const a: number | undefined = new Stack().pop(); } + { const a: number[] = [...new Stack()]; } + { const a: Stack = Stack.from([1, 2, 3]); } +} diff --git a/types/adone/test/glosses/collections/timedout_map.ts b/types/adone/test/glosses/collections/timedout_map.ts new file mode 100644 index 0000000000..ffca754e2a --- /dev/null +++ b/types/adone/test/glosses/collections/timedout_map.ts @@ -0,0 +1,22 @@ +namespace adoneTests.collection.TimedoutMap { + const { + collection: { + TimedoutMap + } + } = adone; + + type TimedoutMap = adone.collection.TimedoutMap; + + new TimedoutMap(); + new TimedoutMap(1000); + new TimedoutMap(1000, (key: string) => null); + { + const a: TimedoutMap = new TimedoutMap().forEach((value: number, key: string) => null); + } + { + const a: TimedoutMap = new TimedoutMap().forEach(function (value: number, key: string) { + const a: number = this.a; + }, { a: 1 }); + } + { const a: boolean = new TimedoutMap().delete("123"); } +} diff --git a/types/adone/test/glosses/data.ts b/types/adone/test/glosses/data.ts index e8ccedddcc..00403a56da 100644 --- a/types/adone/test/glosses/data.ts +++ b/types/adone/test/glosses/data.ts @@ -11,6 +11,7 @@ namespace dataTests { { const a: Buffer = json.encode(1, { replacer: ["a", "b", "c"] }); } { const a: Buffer = json.encode(1, { replacer: (k: string, v: any) => null }); } { const a: Buffer = json.encode(1, { space: " " }); } + { const a: Buffer = json.encode(1, { newline: true }); } json.decode("123"); json.decode(Buffer.from("123")); @@ -52,6 +53,8 @@ namespace dataTests { mpak.decode(new Uint8Array(10)); mpak.decode(new ArrayBuffer(10)); + mpak.tryDecode(new adone.collection.ByteArray()); + new mpak.Encoder([]); new mpak.Encoder([{ type: 10, @@ -73,6 +76,9 @@ namespace dataTests { new mpak.Decoder([]).decode(new ArrayBuffer(10)); new mpak.Decoder([]).tryDecode(adone.collection.ByteArray.wrap("hello")); + new mpak.Serializer(); + new mpak.Serializer(100); + mpak.registerCommonTypesFor(new mpak.Serializer()); { const a: adone.data.mpak.Encoder = new mpak.Serializer().encoder; } { const a: adone.data.mpak.Decoder = new mpak.Serializer().decoder; } { const a: adone.data.mpak.Serializer = new mpak.Serializer().registerEncoder(10, (x) => true, (x) => new adone.collection.ByteArray(10)); } @@ -125,6 +131,7 @@ namespace dataTests { { const a: string = base64.decode("string", {}); } { const a: string = base64.decode("string", { buffer: false }); } { const a: Buffer = base64.decode("string", { buffer: true }); } + { const a: string = base64.decode("string", { encoding: "utf8" }); } { const a: string = base64.encodeVLQ(123); } { const a: number = base64.decodeVLQ("H"); } @@ -563,4 +570,277 @@ namespace dataTests { bson.decode(bson.encode({ a: 1 }), { promoteLongs: false }).a; bson.decode(bson.encode({ a: 1 }), { promoteValues: true }).a; } + + namespace protobuf { + const { + protobuf + } = data; + + protobuf.create("hello"); + protobuf.create(Buffer.from("hello")); + protobuf.create({}); + protobuf.create({}, {}); + + namespace schema { + const { + schema + } = protobuf; + + const s = schema.parse("hello"); + s.syntax; + s.package; + if (!adone.is.null(s.package)) { + const c: string = s.package; + } + s.imports[0].charCodeAt(100); + + namespace enums { + const [a] = s.enums; + a.name.charCodeAt(100); + a.values; + a.options; + } + + namespace message { + const [msg] = s.messages; + msg.name; + { + const [a] = msg.enums; + a.name; + a.options; + a.values; + } + { + const [a] = msg.extends; + a.name; + a.message; + } + { + const [a] = msg.messages; + a.name; + a.enums; + a.extends; + a.messages; + a.fields; + a.extensions; + } + { + const [a] = msg.fields; + if (!adone.is.null(a.name)) { + a.name.charCodeAt(100); + } + if (!adone.is.null(a.type)) { + a.type.charCodeAt(100); + } + a.tag === 3; + if (!adone.is.null(a.map)) { + a.map.from.charCodeAt(100); + a.map.to.charCodeAt(100); + } + if (!adone.is.null(a.oneof)) { + a.oneof.charCodeAt(100); + } + a.required === false; + a.repeated === true; + a.options; + } + if (!adone.is.null(msg.extensions)) { + msg.extensions.from === 2; + msg.extensions.to === 3; + } + } + + s.options; + + s.extends[0].message; + s.extends[0].name; + + if (!adone.is.nil(s.services)) { + const [svc] = s.services; + + svc.name.charCodeAt(100); + svc.options; + + const [m] = svc.methods; + + m.name.charCodeAt(100); + if (!adone.is.null(m.input_type)) { + m.input_type.charCodeAt(100); + } + if (!adone.is.null(m.output_type)) { + m.output_type.charCodeAt(100); + } + m.client_streaming === true; + m.server_streaming === true; + m.options; + } + } + } + + namespace base32 { + const { + base32 + } = data; + + base32.charmap("asd"); + base32.charmap("asd", {}); + + base32.rfc4648.alphabet.charCodeAt(0); + base32.rfc4648.charmap["X"] === 2; + + base32.crockford.alphabet.charCodeAt(0); + base32.crockford.charmap["X"] === 2; + + base32.base32hex.alphabet.charCodeAt(0); + base32.base32hex.charmap["X"] === 2; + + namespace decoder { + const { + Decoder + } = base32; + new Decoder(); + new Decoder({ + type: "base32hex" + }); + new Decoder({ + type: "crockford" + }); + new Decoder({ + type: "rfc4648" + }); + new Decoder({ + type: "rfc4648", + charmap: {} + }); + const d = new Decoder(); + d.write("asd").write("aa"); + { const a: Buffer = d.finalize(); } + { const a: Buffer = d.finalize("c"); } + } + + namespace encoder { + const { + Encoder + } = base32; + + new Encoder(); + new Encoder({ + type: "base32hex" + }); + new Encoder({ + type: "crockford" + }); + new Encoder({ + type: "rfc4648" + }); + new Encoder({ + type: "rfc4648", + alphabet: "a" + }); + + const e = new Encoder(); + e.write(Buffer.from("b")).write(Buffer.from("a")); + { const a: string = e.finalize(); } + { const a: string = e.finalize(Buffer.from("c")); } + } + + base32.encode(Buffer.from("hello")).charCodeAt(100); + base32.encode(Buffer.from("hello"), { + type: "rfc4648" + }).charCodeAt(100); + base32.encode(Buffer.from("hello"), { + type: "crockford" + }).charCodeAt(100); + base32.encode(Buffer.from("hello"), { + type: "base32hex" + }).charCodeAt(100); + base32.encode(Buffer.from("hello"), { + type: "base32hex", + alphabet: "asd" + }).charCodeAt(100); + + base32.decode("asd").writeUInt8(100, 0); + base32.decode("asd", { + type: "base32hex" + }).writeUInt8(100, 0); + base32.decode("asd", { + type: "crockford" + }).writeUInt8(100, 0); + base32.decode("asd", { + type: "rfc4648" + }).writeUInt8(100, 0); + base32.decode("asd", { + type: "rfc4648", + charmap: {} + }).writeUInt8(100, 0); + } + + namespace basex { + const { + basex + } = data; + + const d = basex("abc"); + const a: Buffer = d.decode("str"); + const b: string = d.encode(Buffer.from("hello")); + const c: Buffer = d.decodeUnsafe("hello"); + } + + namespace base58 { + const { + base58 + } = data; + + const a: Buffer = base58.decode("str"); + const b: string = base58.encode(Buffer.from("hello")); + const c: Buffer = base58.decodeUnsafe("hello"); + } + + namespace base64url { + const { + base64url + } = data; + + base64url.unescape("a").charCodeAt(100); + base64url.escape("a").charCodeAt(100); + + base64url.encode("a").charCodeAt(100); + base64url.encode(Buffer.from("a")).charCodeAt(100); + base64url.encode(Buffer.from("a"), {}).charCodeAt(100); + base64url.encode(Buffer.from("a"), { + encoding: "utf8" + }).charCodeAt(100); + + base64url.decode("a").charCodeAt(100); + base64url.decode("a", { buffer: true }).writeUInt8(0, 0); + base64url.decode("a", { encoding: "utf8" }).charCodeAt(100); + } + + namespace varint { + const { + varint + } = data; + + varint.encode(12)[0]; + varint.encode(12, [])[0]; + varint.encode(12, [], 1)[0]; + + varint.decode(Buffer.from("hello")) === 5; + varint.decode(Buffer.from("hello"), 2) === 5; + varint.encodingLength(100500) === 5; + } + + namespace varintSigned { + const { + varintSigned + } = data; + + varintSigned.encode(12)[0]; + varintSigned.encode(12, [])[0]; + varintSigned.encode(12, [], 1)[0]; + + varintSigned.decode(Buffer.from("hello")) === 5; + varintSigned.decode(Buffer.from("hello"), 2) === 5; + varintSigned.encodingLength(100500) === 5; + } } diff --git a/types/adone/test/glosses/events.ts b/types/adone/test/glosses/events.ts index 7f31089b52..448867951e 100644 --- a/types/adone/test/glosses/events.ts +++ b/types/adone/test/glosses/events.ts @@ -1,76 +1,86 @@ namespace eventsTests { namespace EventEmitter { namespace static { - const a: number = adone.event.EventEmitter.listenerCount(new adone.event.EventEmitter(), "event"); - const b: number = adone.event.EventEmitter.defaultMaxListeners; + const a: number = adone.event.Emitter.listenerCount(new adone.event.Emitter(), "event"); + const b: number = adone.event.Emitter.defaultMaxListeners; } namespace addListener { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().addListener("event", () => { }); - const b: adone.event.EventEmitter = new adone.event.EventEmitter().addListener(Symbol("event"), () => { }); + const a: adone.event.Emitter = new adone.event.Emitter().addListener("event", () => { }); + const b: adone.event.Emitter = new adone.event.Emitter().addListener(Symbol("event"), () => { }); } namespace on { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().on("event", () => { }); - const b: adone.event.EventEmitter = new adone.event.EventEmitter().on(Symbol("event"), () => { }); + const a: adone.event.Emitter = new adone.event.Emitter().on("event", () => { }); + const b: adone.event.Emitter = new adone.event.Emitter().on(Symbol("event"), () => { }); } namespace once { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().once("event", () => { }); - const b: adone.event.EventEmitter = new adone.event.EventEmitter().once(Symbol("event"), () => { }); + const a: adone.event.Emitter = new adone.event.Emitter().once("event", () => { }); + const b: adone.event.Emitter = new adone.event.Emitter().once(Symbol("event"), () => { }); } namespace prependListener { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().prependListener("event", () => { }); - const b: adone.event.EventEmitter = new adone.event.EventEmitter().prependListener(Symbol("event"), () => { }); + const a: adone.event.Emitter = new adone.event.Emitter().prependListener("event", () => { }); + const b: adone.event.Emitter = new adone.event.Emitter().prependListener(Symbol("event"), () => { }); } namespace prependOnceListener { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().prependOnceListener("event", () => { }); - const b: adone.event.EventEmitter = new adone.event.EventEmitter().prependOnceListener(Symbol("event"), () => { }); + const a: adone.event.Emitter = new adone.event.Emitter().prependOnceListener("event", () => { }); + const b: adone.event.Emitter = new adone.event.Emitter().prependOnceListener(Symbol("event"), () => { }); } namespace removeListener { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().removeListener("event", () => { }); - const b: adone.event.EventEmitter = new adone.event.EventEmitter().removeListener(Symbol("event"), () => { }); + const a: adone.event.Emitter = new adone.event.Emitter().removeListener("event", () => { }); + const b: adone.event.Emitter = new adone.event.Emitter().removeListener(Symbol("event"), () => { }); } namespace removeAllListeners { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().removeAllListeners("event"); - const b: adone.event.EventEmitter = new adone.event.EventEmitter().removeAllListeners(Symbol("event")); + const a: adone.event.Emitter = new adone.event.Emitter().removeAllListeners("event"); + const b: adone.event.Emitter = new adone.event.Emitter().removeAllListeners(Symbol("event")); } namespace setMaxListeners { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().setMaxListeners(10); + const a: adone.event.Emitter = new adone.event.Emitter().setMaxListeners(10); } namespace getMaxListeners { - const a: number = new adone.event.EventEmitter().getMaxListeners(); + const a: number = new adone.event.Emitter().getMaxListeners(); } namespace listeners { - const a: Array<(...args: any[]) => any> = new adone.event.EventEmitter().listeners("event"); - const b: Array<(...args: any[]) => any> = new adone.event.EventEmitter().listeners(Symbol("event")); + const a: Array<(...args: any[]) => any> = new adone.event.Emitter().listeners("event"); + const b: Array<(...args: any[]) => any> = new adone.event.Emitter().listeners(Symbol("event")); } namespace emit { - const a: boolean = new adone.event.EventEmitter().emit("event", 1, 2, 3); - const b: boolean = new adone.event.EventEmitter().emit(Symbol("event"), 1, 2, 3); + const a: boolean = new adone.event.Emitter().emit("event", 1, 2, 3); + const b: boolean = new adone.event.Emitter().emit(Symbol("event"), 1, 2, 3); } namespace eventNames { - const a: Array = new adone.event.EventEmitter().eventNames(); - const b: Array = new adone.event.EventEmitter().eventNames(); + const a: Array = new adone.event.Emitter().eventNames(); + const b: Array = new adone.event.Emitter().eventNames(); } namespace listenerCount { - const a: number = new adone.event.EventEmitter().listenerCount("event"); - const b: number = new adone.event.EventEmitter().listenerCount(Symbol("event")); + const a: number = new adone.event.Emitter().listenerCount("event"); + const b: number = new adone.event.Emitter().listenerCount(Symbol("event")); + } + + namespace propagateEvents { + const e = new adone.event.Emitter().propagateEvents(new adone.event.Emitter(), ["a"]); + e.end(); + } + + namespace staticPropagateEvents { + const e = adone.event.Emitter.propagateEvents(new adone.event.Emitter(), new adone.event.Emitter(), ["a"]); + e.end(); } } namespace AsyncEmitter { - const a: adone.event.EventEmitter = new adone.event.AsyncEmitter(); + const a: adone.event.Emitter = new adone.event.AsyncEmitter(); new adone.event.AsyncEmitter(10); namespace setConcurrency { diff --git a/types/adone/test/glosses/exceptions.ts b/types/adone/test/glosses/exceptions.ts index e13dc3fff7..d9694990d0 100644 --- a/types/adone/test/glosses/exceptions.ts +++ b/types/adone/test/glosses/exceptions.ts @@ -1,36 +1,36 @@ namespace ExcetpionsTests { - { const a: Error = new adone.x.Exception(); } - { const a: Error = new adone.x.Exception("message"); } - { const a: Error = new adone.x.Exception(new Error()); } - { const a: Error = new adone.x.Exception(new Error(), true); } - { const a: adone.x.Exception = new adone.x.Runtime(); } - { const a: adone.x.Exception = new adone.x.IncompleteBufferError(); } - { const a: adone.x.Exception = new adone.x.NotImplemented(); } - { const a: adone.x.Exception = new adone.x.IllegalState(); } - { const a: adone.x.Exception = new adone.x.NotValid(); } - { const a: adone.x.Exception = new adone.x.Unknown(); } - { const a: adone.x.Exception = new adone.x.NotExists(); } - { const a: adone.x.Exception = new adone.x.Exists(); } - { const a: adone.x.Exception = new adone.x.Empty(); } - { const a: adone.x.Exception = new adone.x.InvalidAccess(); } - { const a: adone.x.Exception = new adone.x.NotSupported(); } - { const a: adone.x.Exception = new adone.x.InvalidArgument(); } - { const a: adone.x.Exception = new adone.x.InvalidNumberOfArguments(); } - { const a: adone.x.Exception = new adone.x.NotFound(); } - { const a: adone.x.Exception = new adone.x.Timeout(); } - { const a: adone.x.Exception = new adone.x.Incorrect(); } - { const a: adone.x.Exception = new adone.x.NotAllowed(); } - { const a: adone.x.Exception = new adone.x.LimitExceeded(); } - { const a: adone.x.Exception = new adone.x.Encoding(); } - { const a: adone.x.Exception = new adone.x.Network(); } - { const a: adone.x.Exception = new adone.x.Bind(); } - { const a: adone.x.Exception = new adone.x.Connect(); } - { const a: adone.x.Exception = new adone.x.Database(); } - { const a: adone.x.Exception = new adone.x.DatabaseInitialization(); } - { const a: adone.x.Exception = new adone.x.DatabaseOpen(); } - { const a: adone.x.Exception = new adone.x.DatabaseRead(); } - { const a: adone.x.Exception = new adone.x.DatabaseWrite(); } - { const a: adone.x.Exception = new adone.x.NetronIllegalState(); } - { const a: adone.x.Exception = new adone.x.NetronPeerDisconnected(); } - { const a: adone.x.Exception = new adone.x.NetronTimeout(); } + { const a: Error = new adone.exception.Exception(); } + { const a: Error = new adone.exception.Exception("message"); } + { const a: Error = new adone.exception.Exception(new Error()); } + { const a: Error = new adone.exception.Exception(new Error(), true); } + { const a: adone.exception.Exception = new adone.exception.Runtime(); } + { const a: adone.exception.Exception = new adone.exception.IncompleteBufferError(); } + { const a: adone.exception.Exception = new adone.exception.NotImplemented(); } + { const a: adone.exception.Exception = new adone.exception.IllegalState(); } + { const a: adone.exception.Exception = new adone.exception.NotValid(); } + { const a: adone.exception.Exception = new adone.exception.Unknown(); } + { const a: adone.exception.Exception = new adone.exception.NotExists(); } + { const a: adone.exception.Exception = new adone.exception.Exists(); } + { const a: adone.exception.Exception = new adone.exception.Empty(); } + { const a: adone.exception.Exception = new adone.exception.InvalidAccess(); } + { const a: adone.exception.Exception = new adone.exception.NotSupported(); } + { const a: adone.exception.Exception = new adone.exception.InvalidArgument(); } + { const a: adone.exception.Exception = new adone.exception.InvalidNumberOfArguments(); } + { const a: adone.exception.Exception = new adone.exception.NotFound(); } + { const a: adone.exception.Exception = new adone.exception.Timeout(); } + { const a: adone.exception.Exception = new adone.exception.Incorrect(); } + { const a: adone.exception.Exception = new adone.exception.NotAllowed(); } + { const a: adone.exception.Exception = new adone.exception.LimitExceeded(); } + { const a: adone.exception.Exception = new adone.exception.Encoding(); } + { const a: adone.exception.Exception = new adone.exception.Network(); } + { const a: adone.exception.Exception = new adone.exception.Bind(); } + { const a: adone.exception.Exception = new adone.exception.Connect(); } + { const a: adone.exception.Exception = new adone.exception.Database(); } + { const a: adone.exception.Exception = new adone.exception.DatabaseInitialization(); } + { const a: adone.exception.Exception = new adone.exception.DatabaseOpen(); } + { const a: adone.exception.Exception = new adone.exception.DatabaseRead(); } + { const a: adone.exception.Exception = new adone.exception.DatabaseWrite(); } + { const a: adone.exception.Exception = new adone.exception.NetronIllegalState(); } + { const a: adone.exception.Exception = new adone.exception.NetronPeerDisconnected(); } + { const a: adone.exception.Exception = new adone.exception.NetronTimeout(); } } diff --git a/types/adone/test/glosses/fake.ts b/types/adone/test/glosses/fake.ts new file mode 100644 index 0000000000..016d7ba7b0 --- /dev/null +++ b/types/adone/test/glosses/fake.ts @@ -0,0 +1,206 @@ +namespace adoneTests.fake { + const { + fake + } = adone; + + { const a: string = fake.address.zipCode(); } + { const a: string = fake.address.zipCode('###'); } + { const a: string = fake.address.city(); } + { const a: string = fake.address.city(0); } + { const a: string = fake.address.cityPrefix(); } + { const a: string = fake.address.citySuffix(); } + { const a: string = fake.address.streetName(); } + { const a: string = fake.address.streetAddress(); } + { const a: string = fake.address.streetAddress(false); } + { const a: string = fake.address.streetSuffix(); } + { const a: string = fake.address.streetPrefix(); } + { const a: string = fake.address.secondaryAddress(); } + { const a: string = fake.address.county(); } + { const a: string = fake.address.country(); } + { const a: string = fake.address.countryCode(); } + { const a: string = fake.address.state(); } + { const a: string = fake.address.state(false); } + { const a: string = fake.address.stateAbbr(); } + { const a: string = fake.address.latitude(); } + { const a: string = fake.address.longitude(); } + + { const a: string = fake.commerce.color(); } + { const a: string = fake.commerce.department(); } + { const a: string = fake.commerce.productName(); } + { const a: string = fake.commerce.price(); } + { const a: string = fake.commerce.price(0, 0, 0, '#'); } + { const a: string = fake.commerce.productAdjective(); } + { const a: string = fake.commerce.productMaterial(); } + { const a: string = fake.commerce.product(); } + + { const a: string[] = fake.company.suffixes(); } + { const a: string = fake.company.companyName(); } + { const a: string = fake.company.companyName(0); } + { const a: string = fake.company.companySuffix(); } + { const a: string = fake.company.catchPhrase(); } + { const a: string = fake.company.bs(); } + { const a: string = fake.company.catchPhraseAdjective(); } + { const a: string = fake.company.catchPhraseDescriptor(); } + { const a: string = fake.company.catchPhraseNoun(); } + { const a: string = fake.company.bsAdjective(); } + { const a: string = fake.company.bsBuzz(); } + { const a: string = fake.company.bsNoun(); } + + { const a: string = fake.database.column(); } + { const a: string = fake.database.type(); } + { const a: string = fake.database.collation(); } + { const a: string = fake.database.engine(); } + + { const a: Date = fake.date.past(); } + { const a: Date = fake.date.future(); } + { const a: Date = fake.date.between('foo', 'bar'); } + { const a: Date = fake.date.between(new Date(), new Date()); } + { const a: Date = fake.date.recent(); } + { const a: Date = fake.date.recent(100); } + { const a: Date = fake.date.soon(); } + { const a: Date = fake.date.soon(30); } + { const a: string = fake.date.month(); } + { const a: string = fake.date.month({ + abbr: true, + context: true + }); } + { const a: string = fake.date.weekday(); } + { const a: string = fake.date.weekday({ + abbr: true, + context: true + }); } + + { const a: string = fake.finance.account(); } + { const a: string = fake.finance.account(0); } + { const a: string = fake.finance.accountName(); } + { const a: string = fake.finance.mask(); } + { const a: string = fake.finance.mask(0, false, false); } + { const a: string = fake.finance.amount(); } + { const a: string = fake.finance.amount(0, 0, 0, '#'); } + { const a: string = fake.finance.transactionType(); } + { const a: string = fake.finance.currencyCode(); } + { const a: string = fake.finance.currencyName(); } + { const a: string = fake.finance.currencySymbol(); } + { const a: string = fake.finance.bitcoinAddress(); } + { const a: string = fake.finance.ethereumAddress(); } + { const a: string = fake.finance.iban(); } + { const a: string = fake.finance.iban(true); } + { const a: string = fake.finance.bic(); } + + { const a: string = fake.hacker.abbreviation(); } + { const a: string = fake.hacker.adjective(); } + { const a: string = fake.hacker.noun(); } + { const a: string = fake.hacker.verb(); } + { const a: string = fake.hacker.ingverb(); } + { const a: string = fake.hacker.phrase(); } + + { const a: string = fake.helpers.randomize(); } + { const a: number = fake.helpers.randomize([1, 2, 3, 4]); } + { const a: string = fake.helpers.randomize(['foo', 'bar', 'quux']); } + { const a: string = fake.helpers.slugify('foo bar quux'); } + { const a: string = fake.helpers.replaceSymbolWithNumber('foo# bar#'); } + { const a: string = fake.helpers.replaceSymbols('foo# bar? quux#'); } + { const a: string[] = fake.helpers.shuffle(['foo', 'bar', 'quux']); } + { const a: string = fake.helpers.mustache('{{foo}}{{bar}}', {foo: 'x', bar: 'y'}); } + + const card = fake.helpers.createCard(); + { const a: string = card.name; } + { const a: string = card.address.streetA; } + const contextualCard = fake.helpers.contextualCard(); + { const a: string = contextualCard.name; } + { const a: string = contextualCard.address.suite; } + const userCard = fake.helpers.userCard(); + { const a: string = userCard.name; } + { const a: string = userCard.address.suite; } + + { const a: string = fake.internet.avatar(); } + { const a: string = fake.internet.email(); } + { const a: string = fake.internet.email('foo', 'bar', 'quux'); } + { const a: string = fake.internet.exampleEmail(); } + { const a: string = fake.internet.exampleEmail('foo', 'bar'); } + { const a: string = fake.internet.protocol(); } + { const a: string = fake.internet.url(); } + { const a: string = fake.internet.domainName(); } + { const a: string = fake.internet.domainSuffix(); } + { const a: string = fake.internet.domainWord(); } + { const a: string = fake.internet.ip(); } + { const a: string = fake.internet.userAgent(); } + { const a: string = fake.internet.color(); } + { const a: string = fake.internet.color(0, 0, 0); } + { const a: string = fake.internet.mac(); } + { const a: string = fake.internet.password(); } + { const a: string = fake.internet.password(0, false, '#', 'foo'); } + + { const a: string = fake.lorem.word(); } + { const a: string = fake.lorem.words(); } + { const a: string = fake.lorem.words(0); } + { const a: string = fake.lorem.sentence(); } + { const a: string = fake.lorem.sentence(0, 0); } + { const a: string = fake.lorem.slug(); } + { const a: string = fake.lorem.slug(0); } + { const a: string = fake.lorem.sentences(); } + { const a: string = fake.lorem.sentences(0); } + { const a: string = fake.lorem.paragraph(); } + { const a: string = fake.lorem.paragraph(0); } + { const a: string = fake.lorem.paragraphs(); } + { const a: string = fake.lorem.paragraphs(0, ''); } + { const a: string = fake.lorem.text(); } + { const a: string = fake.lorem.text(0); } + { const a: string = fake.lorem.lines(); } + { const a: string = fake.lorem.lines(0); } + + { const a: string = fake.name.firstName(); } + { const a: string = fake.name.firstName(0); } + { const a: string = fake.name.lastName(); } + { const a: string = fake.name.lastName(0); } + { const a: string = fake.name.findName(); } + { const a: string = fake.name.findName('', '', 0); } + { const a: string = fake.name.jobTitle(); } + { const a: string = fake.name.prefix(); } + { const a: string = fake.name.suffix(); } + { const a: string = fake.name.title(); } + { const a: string = fake.name.jobDescriptor(); } + { const a: string = fake.name.jobArea(); } + { const a: string = fake.name.jobType(); } + + { const a: string = fake.phone.phoneNumber(); } + { const a: string = fake.phone.phoneNumber('#'); } + { const a: string = fake.phone.phoneNumberFormat(); } + { const a: string = fake.phone.phoneNumberFormat(0); } + { const a: string = fake.phone.phoneFormats(); } + + { const a: number = fake.random.number(); } + { const a: number = fake.random.number(0); } + { const a: number = fake.random.number({ + min: 0, + max: 0, + precision: 0 + }); } + { const a: string = fake.random.arrayElement(); } + { const a: string = fake.random.arrayElement(['foo', 'bar', 'quux']); } + { const a: string = fake.random.objectElement(); } + { const a: string = fake.random.objectElement({foo: 'bar', field: 'foo'}); } + { const a: string = fake.random.uuid(); } + { const a: boolean = fake.random.boolean(); } + { const a: string = fake.random.word(); } + { const a: string = fake.random.word("noun"); } + { const a: string = fake.random.words(); } + { const a: string = fake.random.words(0); } + { const a: string = fake.random.image(); } + { const a: string = fake.random.locale(); } + { const a: string = fake.random.alphaNumeric(); } + { const a: string = fake.random.alphaNumeric(0); } + { const a: string = fake.random.hexaDecimal(); } + { const a: string = fake.random.hexaDecimal(3); } + + { const a: string = fake.system.fileName("foo", "bar"); } + { const a: string = fake.system.commonFileName("foo", "bar"); } + { const a: string = fake.system.mimeType(); } + { const a: string = fake.system.commonFileType(); } + { const a: string = fake.system.commonFileExt(); } + { const a: string = fake.system.fileType(); } + { const a: string = fake.system.fileExt("foo"); } + { const a: string = fake.system.directoryPath(); } + { const a: string = fake.system.filePath(); } + { const a: string = fake.system.semver(); } +} diff --git a/types/adone/test/glosses/fs.ts b/types/adone/test/glosses/fs.ts index 8b7e765c9f..e7c5333624 100644 --- a/types/adone/test/glosses/fs.ts +++ b/types/adone/test/glosses/fs.ts @@ -11,6 +11,15 @@ namespace fsTests { fs.readlink("file", null).then((x: Buffer) => x); fs.readlink("file", "hex").then((x: string) => x); fs.readlink("file").then((x: string) => x); + fs.readlinkSync("file"); + fs.readlinkSync(Buffer.from("file")); + fs.readlinkSync(new URL("file://file")); + { const a: string = fs.readlinkSync("file", {}); } + { const a: string = fs.readlinkSync("file", { encoding: "utf8" }); } + { const a: Buffer = fs.readlinkSync("file", { encoding: null }); } + { const a: Buffer = fs.readlinkSync("file", null); } + { const a: string = fs.readlinkSync("file", "hex"); } + { const a: string = fs.readlinkSync("file"); } } namespace unlinkTests { @@ -22,6 +31,24 @@ namespace fsTests { fs.unlinkSync(new URL("file://file")); } + namespace utimesTests { + fs.utimes("hello", 100, 100).then(() => {}); + fs.utimes(Buffer.from("hello"), 100, 100).then(() => {}); + fs.utimes(new URL("hello"), 100, 100).then(() => {}); + fs.utimes("hello", "100", "100").then(() => {}); + fs.utimes("hello", new Date(100), new Date(100)).then(() => {}); + + fs.utimesSync("hello", 100, 100); + fs.utimesSync(Buffer.from("hello"), 100, 100); + fs.utimesSync(new URL("hello"), 100, 100); + fs.utimesSync("hello", "100", "100"); + fs.utimesSync("hello", new Date(100), new Date(100)); + + fs.utimesMillis("hello", 100, 100); + fs.utimesMillis(Buffer.from("hello"), 100, 100); + fs.utimesMillis(new URL("hello"), 100, 100); + } + namespace chmodTests { fs.chmod("file", 0o333).then(() => {}); fs.chmod(Buffer.from("file"), 0o333).then(() => {}); @@ -60,6 +87,87 @@ namespace fsTests { const e: Buffer[] = fs.readdirSync("file", { encoding: null }); } + namespace readdirpTests { + fs.readdirp("hello").forEach((entry) => { + { const a: string = entry.fullParentDir; } + { const a: string = entry.fullPath; } + { const a: string = entry.name; } + { const a: string = entry.parentDir; } + { const a: string = entry.path; } + { const a: adone.fs.I.Stats = entry.stat; } + }); + + fs.readdirp(Buffer.from("hello")); + fs.readdirp(new URL("hello")); + fs.readdirp("hello", {}); + fs.readdirp("hello", { depth: 100 }); + fs.readdirp("hello", { directories: true }); + fs.readdirp("hello", { directoryFilter: () => true }); + fs.readdirp("hello", { + directoryFilter: (entry) => { + { const a: string = entry.fullParentDir; } + { const a: string = entry.fullPath; } + { const a: string = entry.name; } + { const a: string = entry.parentDir; } + { const a: string = entry.path; } + { const a: adone.fs.I.Stats = entry.stat; } + return true; + } + }); + fs.readdirp("hello", { + directoryFilter: [(entry) => { + { const a: string = entry.fullParentDir; } + { const a: string = entry.fullPath; } + { const a: string = entry.name; } + { const a: string = entry.parentDir; } + { const a: string = entry.path; } + { const a: adone.fs.I.Stats = entry.stat; } + return true; + }] + }); + fs.readdirp("hello", { + directoryFilter: ["*"] + }); + fs.readdirp("hello", { + directoryFilter: "*" + }); + fs.readdirp("hello", { fileFilter: () => true }); + fs.readdirp("hello", { + fileFilter: (entry) => { + { const a: string = entry.fullParentDir; } + { const a: string = entry.fullPath; } + { const a: string = entry.name; } + { const a: string = entry.parentDir; } + { const a: string = entry.path; } + { const a: adone.fs.I.Stats = entry.stat; } + return true; + } + }); + fs.readdirp("hello", { + fileFilter: [(entry) => { + { const a: string = entry.fullParentDir; } + { const a: string = entry.fullPath; } + { const a: string = entry.name; } + { const a: string = entry.parentDir; } + { const a: string = entry.path; } + { const a: adone.fs.I.Stats = entry.stat; } + return true; + }] + }); + fs.readdirp("hello", { + fileFilter: ["*"] + }); + fs.readdirp("hello", { + fileFilter: "*" + }); + fs.readdirp("hello", { + files: false + }); + fs.readdirp("hello", { + lstat: true + }); + } + namespace lstatTests { fs.lstat("file").then((x: nodestd.fs.Stats) => {}); fs.lstat(Buffer.from("file")).then((x: nodestd.fs.Stats) => {}); @@ -119,6 +227,15 @@ namespace fsTests { fs.appendFile("file", "hello", { encoding: "utf8" }).then(() => {}); fs.appendFile("file", "hello", { mode: 0o755 }).then(() => {}); fs.appendFile("file", "hello", { flag: "w" }).then(() => {}); + + fs.appendFileSync("file", "hello"); + fs.appendFileSync(Buffer.from("file"), "hello"); + fs.appendFileSync(10, "hello"); + fs.appendFileSync("file", Buffer.from("hello")); + fs.appendFileSync("file", "hello", {}); + fs.appendFileSync("file", "hello", { encoding: "utf8" }); + fs.appendFileSync("file", "hello", { mode: 0o755 }); + fs.appendFileSync("file", "hello", { flag: "w" }); } namespace accessTests { @@ -153,6 +270,12 @@ namespace fsTests { fs.rm("file", { cwd: __dirname }).then((x) => {}); } + namespace rmEmptyTests { + fs.rmEmpty("file").then(() => {}); + fs.rmEmpty("file", { cwd: "a" }).then(() => {}); + fs.rmEmpty("file", { filter: (filename) => filename.charCodeAt(0) === 100 }).then(() => {}); + } + namespace ModeTests { const stat = fs.statSync("file"); const mode = new fs.Mode(stat); @@ -513,37 +636,36 @@ namespace fsTests { } namespace fdTests { - const { fd } = fs; - fd.open("hello", "r+").then((x: number) => {}); - fd.open(Buffer.from("hello"), "r+").then((x: number) => {}); - fd.open(new URL("file://hello"), "r+").then((x: number) => {}); - { const a: number = fd.openSync("hello", "r+"); } - { const a: number = fd.openSync(Buffer.from("hello"), "r+"); } - { const a: number = fd.openSync(new URL("file://hello"), "r+"); } - fd.close(10).then(() => {}); - fd.closeSync(10); - fd.utimes(10, 100500, 100500).then(() => {}); - fd.utimesSync(10, 100500, 100500); - fd.stat(10).then((x: adone.fs.I.Stats) => {}); - { const a: adone.fs.I.Stats = fd.statSync(10); } - fd.truncate(10).then(() => {}); - fd.truncate(10, 10).then(() => {}); - fd.truncateSync(10); - fd.truncateSync(10, 10); - fd.read(10, Buffer.alloc(10), 0, 10, 10).then((x: number) => {}); - { const a: number = fd.readSync(10, Buffer.alloc(10), 0, 10, 10); } - fd.write(10, Buffer.alloc(10), 0, 10, 10).then((x: number) => {}); - { const a: number = fd.writeSync(10, Buffer.alloc(10), 0, 10, 10); } - fd.write(10, "hello", 10, "utf8").then((x: number) => {}); - { const a: number = fd.writeSync(10, "hello", 10, "utf8"); } - fd.sync(10).then(() => {}); - fd.syncSync(10); - fd.chown(10, 0, 0).then(() => {}); - fd.chownSync(10, 0, 0); - fd.chmod(10, 0o755).then(() => {}); - fd.chmodSync(10, 0o755); - fd.seek(10, 100, 0).then((x: number) => {}); - fd.lock(10, "sh").then(() => {}); + fs.open("hello", "r+").then((x: number) => {}); + fs.open(Buffer.from("hello"), "r+").then((x: number) => {}); + fs.open(new URL("file://hello"), "r+").then((x: number) => {}); + { const a: number = fs.openSync("hello", "r+"); } + { const a: number = fs.openSync(Buffer.from("hello"), "r+"); } + { const a: number = fs.openSync(new URL("file://hello"), "r+"); } + fs.close(10).then(() => {}); + fs.closeSync(10); + fs.futimes(10, 100500, 100500).then(() => {}); + fs.futimesSync(10, 100500, 100500); + fs.fstat(10).then((x: adone.fs.I.Stats) => {}); + { const a: adone.fs.I.Stats = fs.fstatSync(10); } + fs.ftruncate(10).then(() => {}); + fs.ftruncate(10, 10).then(() => {}); + fs.ftruncateSync(10); + fs.ftruncateSync(10, 10); + fs.read(10, Buffer.alloc(10), 0, 10, 10).then((x: number) => {}); + { const a: number = fs.readSync(10, Buffer.alloc(10), 0, 10, 10); } + fs.write(10, Buffer.alloc(10), 0, 10, 10).then((x: number) => {}); + { const a: number = fs.writeSync(10, Buffer.alloc(10), 0, 10, 10); } + fs.write(10, "hello", 10, "utf8").then((x: number) => {}); + { const a: number = fs.writeSync(10, "hello", 10, "utf8"); } + fs.fsync(10).then(() => {}); + fs.fsyncSync(10); + fs.fchown(10, 0, 0).then(() => {}); + fs.fchownSync(10, 0, 0); + fs.fchmod(10, 0o755).then(() => {}); + fs.fchmodSync(10, 0o755); + fs.seek(10, 100, 0).then((x: number) => {}); + fs.flock(10, "sh").then(() => {}); } namespace constantsTests { @@ -668,13 +790,44 @@ namespace fsTests { namespace mkdirTests { fs.mkdir("/path/to/some/dir").then(() => {}); fs.mkdir("/path/to/some/dir", 0o755).then(() => {}); + + fs.mkdirSync("/path/to/some/dir").then(() => {}); + fs.mkdirSync("/path/to/some/dir", 0o755).then(() => {}); + } + + namespace mkdirTests { + fs.mkdirp("/path/to/some/dir").then(() => {}); + fs.mkdirp("/path/to/some/dir", 0o755).then(() => {}); + + fs.mkdirpSync("/path/to/some/dir").then(() => {}); + fs.mkdirpSync("/path/to/some/dir", 0o755).then(() => {}); } namespace copyTests { fs.copy("a", "b").then(() => {}); - fs.copy("a", "b", {}).then(() => {}); - fs.copy("a", "b", { cwd: "/tmp" }).then(() => {}); - fs.copy("a", "b", { ignoreExisting: true }).then(() => {}); + fs.copy("a", "b", {}); + fs.copy("a", "b", { clobber: true }).then(() => {}); + fs.copy("a", "b", { overwrite: true }).then(() => {}); + fs.copy("a", "b", { filter: /asd/ }).then(() => {}); + fs.copy("a", "b", { filter: () => true }).then(() => {}); + fs.copy("a", "b", { filter: (a) => a.charCodeAt(0) === 100 }).then(() => {}); + fs.copy("a", "b", { + transform(r, w, file) { + file.atime.getDay(); + file.mtime.getDay(); + file.mode.toExponential(); + file.name.charCodeAt(0); + file.stats.atimeMs.toExponential(); + r.pipe(w); + } + }).then(() => {}); + } + + namespace copyTests { + fs.copyTo("a", "b").then(() => {}); + fs.copyTo("a", "b", {}); + fs.copyTo("a", "b", { cwd: "/tmp" }).then(() => {}); + fs.copyTo("a", "b", { ignoreExisting: true }).then(() => {}); } namespace renameTests { @@ -689,6 +842,7 @@ namespace fsTests { fs.tail("file", 10, {}).then((x: Buffer[]) => {}); fs.tail("file", 10, { separator: "\n" }).then((x: Buffer[]) => {}); fs.tail("file", 10, { chunkLength: 4096 }).then((x: Buffer[]) => {}); + fs.tail("file", 10, { pos: 10 }).then((x: Buffer[]) => {}); } namespace statVFSTests { diff --git a/types/adone/test/glosses/is.ts b/types/adone/test/glosses/is.ts index 2734824822..2065dfe01b 100644 --- a/types/adone/test/glosses/is.ts +++ b/types/adone/test/glosses/is.ts @@ -1,115 +1,423 @@ namespace isTests { - { const a: boolean = adone.is.null({}); } - { const a: boolean = adone.is.undefined({}); } - { const a: boolean = adone.is.exist({}); } - { const a: boolean = adone.is.nil({}); } - { const a: boolean = adone.is.number({}); } - { const a: boolean = adone.is.numeral({}); } - { const a: boolean = adone.is.infinite({}); } - { const a: boolean = adone.is.odd({}); } - { const a: boolean = adone.is.even({}); } - { const a: boolean = adone.is.float({}); } - { const a: boolean = adone.is.negativeZero({}); } - { const a: boolean = adone.is.string({}); } - { const a: boolean = adone.is.emptyString({}); } - { const a: boolean = adone.is.substring("abc", "abcdef"); } - { const a: boolean = adone.is.substring("abc", "abcdef", 0); } - { const a: boolean = adone.is.prefix("abc", "abcdef"); } - { const a: boolean = adone.is.suffix("def", "abbdef"); } - { const a: boolean = adone.is.boolean({}); } - { const a: boolean = adone.is.json({}); } - { const a: boolean = adone.is.object({}); } - { const a: boolean = adone.is.plainObject({}); } - { const a: boolean = adone.is.class({}); } - { const a: boolean = adone.is.emptyObject({}); } - { const a: boolean = adone.is.propertyOwned({}, "a"); } - { const a: boolean = adone.is.propertyDefined({}, "a"); } - { const a: boolean = adone.is.conforms({}, {}); } - { const a: boolean = adone.is.conforms({}, {}, true); } - { const a: boolean = adone.is.arrayLikeObject({}); } - { const a: boolean = adone.is.inArray(1, [1, 2, 3]); } - { const a: boolean = adone.is.inArray(1, [1, 2, 3], 0); } - { const a: boolean = adone.is.inArray(1, [1, 2, 3], 0, (a, b) => a === b); } - { const a: boolean = adone.is.sameType({}, {}); } - { const a: boolean = adone.is.primitive({}); } - { const a: boolean = adone.is.equalArrays([], []); } - { const a: boolean = adone.is.deepEqual({}, {}); } - { const a: boolean = adone.is.shallowEqual({}, {}); } - { const a: boolean = adone.is.stream({}); } - { const a: boolean = adone.is.writableStream({}); } - { const a: boolean = adone.is.readableStream({}); } - { const a: boolean = adone.is.duplexStream({}); } - { const a: boolean = adone.is.transformStream({}); } - { const a: boolean = adone.is.utf8(Buffer.alloc(10)); } - { const a: boolean = adone.is.win32PathAbsolute("abc"); } - { const a: boolean = adone.is.posixPathAbsolute("abc"); } - { const a: boolean = adone.is.pathAbsolute("abc"); } - { const a: boolean = adone.is.glob("abc"); } - { const a: boolean = adone.is.dotfile("abc"); } - { const a: boolean = adone.is.function(() => { }); } - { const a: boolean = adone.is.asyncFunction(async () => { }); } - { const a: boolean = adone.is.promise({}); } - { const a: boolean = adone.is.validDate("07.08.2017"); } - { const a: boolean = adone.is.buffer({}); } - { const a: boolean = adone.is.callback({}); } - { const a: boolean = adone.is.generator({}); } - { const a: boolean = adone.is.nan({}); } - { const a: boolean = adone.is.finite({}); } - { const a: boolean = adone.is.integer({}); } - { const a: boolean = adone.is.safeInteger({}); } - { const a: boolean = adone.is.array({}); } - { const a: boolean = adone.is.uint8Array({}); } - { const a: boolean = adone.is.configuration({}); } - { const a: boolean = adone.is.long({}); } - { const a: boolean = adone.is.bigNumber({}); } - { const a: boolean = adone.is.byteArray({}); } - { const a: boolean = adone.is.datetime({}); } - { const a: boolean = adone.is.transform({}); } - { const a: boolean = adone.is.subsystem({}); } - { const a: boolean = adone.is.application({}); } - { const a: boolean = adone.is.logger({}); } - { const a: boolean = adone.is.coreStream({}); } - { const a: boolean = adone.is.fastStream({}); } - { const a: boolean = adone.is.fastLocalStream({}); } - { const a: boolean = adone.is.fastLocalMapStream({}); } - { const a: boolean = adone.is.genesisNetron({}); } - { const a: boolean = adone.is.genesisPeer({}); } - { const a: boolean = adone.is.netronAdapter({}); } - { const a: boolean = adone.is.netron({}); } - { const a: boolean = adone.is.netronPeer({}); } - { const a: boolean = adone.is.netronDefinition({}); } - { const a: boolean = adone.is.netronDefinitions({}); } - { const a: boolean = adone.is.netronReference({}); } - { const a: boolean = adone.is.netronInterface({}); } - { const a: boolean = adone.is.netronContext({}); } - { const a: boolean = adone.is.netronIMethod({}, "hello"); } - { const a: boolean = adone.is.netronIProperty({}, "hello"); } - { const a: boolean = adone.is.netronStub({}); } - { const a: boolean = adone.is.netronRemoteStub({}); } - { const a: boolean = adone.is.netronStream({}); } - { const a: boolean = adone.is.iterable({}); } - { const a: boolean = adone.is.windows; } - { const a: boolean = adone.is.linux; } - { const a: boolean = adone.is.freebsd; } - { const a: boolean = adone.is.darwin; } - { const a: boolean = adone.is.sunos; } - { const a: boolean = adone.is.uppercase("abc"); } - { const a: boolean = adone.is.lowercase("abc"); } - { const a: boolean = adone.is.digits("012"); } - { const a: boolean = adone.is.identifier("someMethod"); } - { const a: boolean = adone.is.binaryExtension("mp3"); } - { const a: boolean = adone.is.binaryPath("a.mp3"); } - { const a: boolean = adone.is.ip4("192.168.1.1"); } - { const a: boolean = adone.is.ip6("::192.168.1.1"); } - { const a: boolean = adone.is.arrayBuffer({}); } - { const a: boolean = adone.is.arrayBufferView({}); } - { const a: boolean = adone.is.date({}); } - { const a: boolean = adone.is.error({}); } - { const a: boolean = adone.is.map({}); } - { const a: boolean = adone.is.regexp({}); } - { const a: boolean = adone.is.set({}); } - { const a: boolean = adone.is.symbol({}); } - { const a: boolean = adone.is.validUTF8(Buffer.from("hello")); } - { const a: boolean = adone.is.vaultValuable({}); } - { const a: boolean = adone.is.task({}); } + const { + is + } = adone; + { + const a: boolean = is.null({}); + const b: any = 2; + if (is.null(b)) { + const c: null = b; + } + } + { + const a: boolean = is.undefined({}); + const b: any = 2; + if (is.undefined(b)) { + const c: undefined = b; + } + } + { const a: boolean = is.exist({}); } + { + const a: boolean = is.nil({}); + const b: any = 2; + if (is.nil(b)) { + const c: null | undefined = b; + } + } + { + const a: boolean = is.number({}); + const b: any = 2; + if (is.number(b)) { + b.toExponential(); + } + } + { + const a: boolean = is.numeral({}); + const b: any = 2; + if (is.numeral(b)) { + const c: string | number = b; + } + } + { + const a: boolean = is.infinite({}); + const b: any = 2; + if (is.infinite(b)) { + b.toPrecision(); + } + } + { + const a: boolean = is.odd({}); + const b: any = 2; + if (is.odd(b)) { + b.toFixed(2); + } + } + { + const a: boolean = is.even({}); + const b: any = 2; + if (is.even(b)) { + b.toFixed(2); + } + } + { + const a: boolean = is.float({}); + const b: any = 2; + if (is.float(b)) { + b.toFixed(); + } + } + { + const a: boolean = is.negativeZero({}); + const b: any = 2; + if (is.negativeZero(b)) { + b.toFixed(); + } + } + { + const a: boolean = is.string({}); + const b: any = 2; + if (is.string(b)) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.emptyString({}); + const b: any = 2; + if (is.emptyString(b)) { + b.charCodeAt(0); + } + } + { const a: boolean = is.substring("abc", "abcdef"); } + { const a: boolean = is.substring("abc", "abcdef", 0); } + { const a: boolean = is.prefix("abc", "abcdef"); } + { const a: boolean = is.suffix("def", "abbdef"); } + { + const a: boolean = is.boolean({}); + const b: any = 2; + if (is.boolean(b)) { + b === true; + } + } + { const a: boolean = is.json({}); } + { const a: boolean = is.object({}); } + { const a: boolean = is.plainObject({}); } + { const a: boolean = is.class({}); } + { const a: boolean = is.emptyObject({}); } + { const a: boolean = is.propertyOwned({}, "a"); } + { const a: boolean = is.propertyDefined({}, "a"); } + { const a: boolean = is.conforms({}, {}); } + { const a: boolean = is.conforms({}, {}, true); } + { const a: boolean = is.arrayLikeObject({}); } + { const a: boolean = is.inArray(1, [1, 2, 3]); } + { const a: boolean = is.inArray(1, [1, 2, 3], 0); } + { const a: boolean = is.inArray(1, [1, 2, 3], 0, (a, b) => a === b); } + { const a: boolean = is.sameType({}, {}); } + { const a: boolean = is.primitive({}); } + { const a: boolean = is.equalArrays([], []); } + { const a: boolean = is.deepEqual({}, {}); } + { const a: boolean = is.shallowEqual({}, {}); } + { const a: boolean = is.stream({}); } + { const a: boolean = is.writableStream({}); } + { const a: boolean = is.readableStream({}); } + { const a: boolean = is.duplexStream({}); } + { const a: boolean = is.transformStream({}); } + { const a: boolean = is.utf8(Buffer.alloc(10)); } + { const a: boolean = is.win32PathAbsolute("abc"); } + { const a: boolean = is.posixPathAbsolute("abc"); } + { const a: boolean = is.pathAbsolute("abc"); } + { + const a: boolean = is.glob("abc"); + const b: any = 2; + if (is.glob(b)) { + b.charCodeAt(0); + } + } + { const a: boolean = is.dotfile("abc"); } + { + const a: boolean = is.function(() => { }); + const b: any = 2; + if (is.function(b)) { + b(); + } + } + { + const a: boolean = is.asyncFunction(async () => { }); + const b: any = 2; + if (is.asyncFunction(b)) { + b().then(() => {}); + } + } + { + const a: boolean = is.promise({}); + const b: any = 2; + if (is.promise(b)) { + b.then(() => {}); + } + const c = Promise.resolve(2); + if (is.promise(c)) { + c.then((x) => x.toFixed(2)); + } + } + { const a: boolean = is.validDate("07.08.2017"); } + { + const a: boolean = is.buffer({}); + const b: any = 2; + if (is.buffer(b)) { + b.writeDoubleBE(10, 10); + } + } + { const a: boolean = is.callback({}); } + { const a: boolean = is.generator({}); } + { const a: boolean = is.nan({}); } + { + const a: boolean = is.finite({}); + const b: any = 2; + if (is.finite(b)) { + b.toFixed(); + } + } + { + const a: boolean = is.integer({}); + const b: any = 2; + if (is.integer(b)) { + b.toFixed(); + } + } + { + const a: boolean = is.safeInteger({}); + const b: any = 2; + if (is.safeInteger(b)) { + b.toFixed(); + } + } + { + const a: boolean = is.array({}); + const b: any = 2; + if (is.array(b)) { + b.length + b[0]; + } + const c = [1, 2, 3]; + if (is.array(c)) { + c[0].toFixed(0); + } + } + { + const a: boolean = is.uint8Array({}); + const b: any = 2; + if (is.uint8Array(b)) { + b.copyWithin(1, 2); + } + } + { const a: boolean = is.configuration({}); } + { + const a: boolean = is.long({}); + const b: any = 2; + if (is.long(b)) { + b.getHighBitsUnsigned(); + } + } + { + const a: boolean = is.bigNumber({}); + const b: any = 2; + if (is.bigNumber(b)) { + b.add(b).isBitSet(10); + } + } + { + const a: boolean = is.byteArray({}); + const b: any = 2; + if (is.byteArray(b)) { + b.toBuffer(); + } + } + { + const a: boolean = is.datetime({}); + const b: any = 2; + if (is.datetime(b)) { + b.add(2, "hours"); + } + } + { const a: boolean = is.transform({}); } + { const a: boolean = is.subsystem({}); } + { const a: boolean = is.application({}); } + { const a: boolean = is.logger({}); } + { const a: boolean = is.coreStream({}); } + { const a: boolean = is.fastStream({}); } + { const a: boolean = is.fastLocalStream({}); } + { const a: boolean = is.fastLocalMapStream({}); } + { const a: boolean = is.genesisNetron({}); } + { const a: boolean = is.genesisPeer({}); } + { const a: boolean = is.netronAdapter({}); } + { const a: boolean = is.netron({}); } + { const a: boolean = is.netronPeer({}); } + { const a: boolean = is.netronDefinition({}); } + { const a: boolean = is.netronDefinitions({}); } + { const a: boolean = is.netronReference({}); } + { const a: boolean = is.netronInterface({}); } + { const a: boolean = is.netronContext({}); } + { const a: boolean = is.netronIMethod({}, "hello"); } + { const a: boolean = is.netronIProperty({}, "hello"); } + { const a: boolean = is.netronStub({}); } + { const a: boolean = is.netronRemoteStub({}); } + { const a: boolean = is.netronStream({}); } + { const a: boolean = is.iterable({}); } + { const a: boolean = is.windows; } + { const a: boolean = is.linux; } + { const a: boolean = is.freebsd; } + { const a: boolean = is.darwin; } + { const a: boolean = is.sunos; } + { const a: boolean = is.uppercase("abc"); } + { const a: boolean = is.lowercase("abc"); } + { const a: boolean = is.digits("012"); } + { const a: boolean = is.identifier("someMethod"); } + { const a: boolean = is.binaryExtension("mp3"); } + { const a: boolean = is.binaryPath("a.mp3"); } + { const a: boolean = is.ip4("192.168.1.1"); } + { const a: boolean = is.ip6("::192.168.1.1"); } + { + const a: boolean = is.arrayBuffer({}); + const b: any = 2; + if (is.arrayBuffer(b)) { + b.slice(10); + } + } + { + const a: boolean = is.arrayBufferView({}); + const b: any = 2; + if (is.arrayBufferView(b)) { + b.byteLength + b.byteOffset; + } + } + { + const a: boolean = is.date({}); + const b: any = 2; + if (is.date(b)) { + b.getMonth() + b.getDate(); + } + } + { const a: boolean = is.error({}); } + { + const a: boolean = is.map({}); + const b: any = 2; + if (is.map(b)) { + b.has("asd"); + b.set(1, 2); + b.set("1", 2); + } + } + { + const a: boolean = is.regexp({}); + const b: any = 2; + if (is.regexp(b)) { + b.test("hello"); + } + } + { + const a: boolean = is.set({}); + const b: any = 2; + if (is.set(b)) { + b.add("h"); + b.has(1); + } + } + { const a: boolean = is.symbol({}); } + { const a: boolean = is.vaultValuable({}); } + { const a: boolean = is.task({}); } + { + const a: boolean = is.fqdn(1); + const b: any = 2; + if (is.fqdn(b)) { + b.charCodeAt(0); + } + if (is.fqdn(b, {})) { + b.charCodeAt(0); + } + is.fqdn(1, { + allowTrailingDot: false + }); + is.fqdn(1, { + allowUnderscores: false + }); + is.fqdn(1, { + requireTld: true + }); + } + { + const a: boolean = is.email(1); + const b: any = 2; + if (is.email(b)) { + b.charCodeAt(0); + } + if (is.email(b, {})) { + b.charCodeAt(0); + } + is.email(1, { + allowDisplayName: false + }); + is.email(1, { + allowUtf8LocalPart: false + }); + is.email(1, { + requireDisplayName: false + }); + is.email(1, { + requireTld: false + }); + } + { + const a: boolean = is.uuid(2); + const b: any = 2; + if (is.uuid(b)) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.uuid(2, "all"); + const b: any = 2; + if (is.uuid(b, "all")) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.uuid(2, "all"); + const b: any = 2; + if (is.uuid(b, "all")) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.uuid(2, 1); + const b: any = 2; + if (is.uuid(b, 1)) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.uuid(2, 2); + const b: any = 2; + if (is.uuid(b, 2)) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.uuid(2, 3); + const b: any = 2; + if (is.uuid(b, 2)) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.uuid(2, 4); + const b: any = 2; + if (is.uuid(b, 2)) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.uuid(2, 5); + const b: any = 2; + if (is.uuid(b, 2)) { + b.charCodeAt(0); + } + } } diff --git a/types/adone/test/glosses/meta.ts b/types/adone/test/glosses/meta.ts new file mode 100644 index 0000000000..fbcde09b1a --- /dev/null +++ b/types/adone/test/glosses/meta.ts @@ -0,0 +1,7 @@ +namespace metaTests { + const { meta } = adone; + + namespace typeOf { + const a: string = meta.typeOf(1); + } +} diff --git a/types/adone/test/glosses/promise.ts b/types/adone/test/glosses/promise.ts index a8866d95a1..9df672cae8 100644 --- a/types/adone/test/glosses/promise.ts +++ b/types/adone/test/glosses/promise.ts @@ -106,4 +106,34 @@ namespace promiseTests { namespace _finally { promise.finally(Promise.resolve(2), () => 2).then((x: number) => {}); } + + namespace props { + promise.props({ a: Promise.resolve(2) }).then((x) => x.a); + } + + namespace retry { + promise.retry((info) => { + { const a: number = info.current; } + }); + + promise.retry(() => {}, {}); + promise.retry(() => {}, { backOffBase: 1000 }); + promise.retry(() => {}, { backOffExponent: 2 }); + promise.retry(() => {}, { match: "a" }); + promise.retry(() => {}, { match: ["a"] }); + promise.retry(() => {}, { match: [/abc/] }); + promise.retry(() => {}, { match: /abc/ }); + promise.retry(() => {}, { match: [new Error()] }); + promise.retry(() => {}, { match: new Error() }); + promise.retry(() => {}, { max: 100 }); + promise.retry(() => {}, { name: "asd" }); + promise.retry(() => {}, { + report(msg: string, opts) { + opts.backOffBase < 100; + } + }); + promise.retry(() => {}, { + timeout: 100 + }); + } } diff --git a/types/adone/test/glosses/streams.ts b/types/adone/test/glosses/streams.ts index bd090dc467..caa278955a 100644 --- a/types/adone/test/glosses/streams.ts +++ b/types/adone/test/glosses/streams.ts @@ -2,82 +2,82 @@ namespace streamsTests { const { stream } = adone; namespace CoreStreamTests { - const { CoreStream } = stream; + const { core: { Stream } } = stream; - new CoreStream(); - new CoreStream(undefined); - new CoreStream(undefined, {}); - new CoreStream(undefined, { async: true }); - new CoreStream(undefined, { sync: true }); - new CoreStream(undefined, { + new Stream(); + new Stream(undefined); + new Stream(undefined, {}); + new Stream(undefined, { async: true }); + new Stream(undefined, { sync: true }); + new Stream(undefined, { transform(x) { this.push(x); } }); - new CoreStream(undefined, { + new Stream(undefined, { flush() { this.push(1); } }); - new CoreStream([]); - new CoreStream(new CoreStream([])); + new Stream([]); + new Stream(new Stream([])); - { const a: boolean = new CoreStream().write(1); } - { const a: boolean = new CoreStream().push(1); } - { const a: adone.stream.CoreStream = new CoreStream().end(); } - { const a: adone.stream.CoreStream = new CoreStream().destroy(); } - { const a: adone.stream.CoreStream = new CoreStream().pause(); } - { const a: adone.stream.CoreStream = new CoreStream().resume(); } - { const a: boolean = new CoreStream().isPaused(); } - { const a: boolean = new CoreStream().isEnded(); } - { const a: nodestd.stream.Transform = new CoreStream().pipe(new adone.std.stream.Transform()); } - { const a: adone.stream.CoreStream = new CoreStream().throughSync(function () { this.push(1); }); } - { const a: adone.stream.CoreStream = new CoreStream().throughSync(function () { this.push(1); }, function () { this.push(1); }); } - { const a: adone.stream.CoreStream = new CoreStream().throughAsync(function () { this.push(1); }); } - { const a: adone.stream.CoreStream = new CoreStream().throughAsync(function () { this.push(1); }, function () { this.push(1); }); } - { const a: adone.stream.CoreStream = new CoreStream().through(function () { this.push(1); }, function () { this.push(1); }); } - { const a: adone.stream.CoreStream = new CoreStream([1, 2, 3]).map((x) => `${x}`); } - { const a: adone.stream.CoreStream = new CoreStream().mapIf((x) => x === "1", () => 1); } - { const a: adone.stream.CoreStream = new CoreStream().mapIf(async (x) => x === "1", () => 1); } - { const a: adone.stream.CoreStream = new CoreStream().filter((x) => x === 1); } - { const a: adone.stream.CoreStream = new CoreStream().filter(async (x) => x === 1); } - { const a: adone.stream.CoreStream = new CoreStream().forEach(async (x) => x === 1); } - { const a: adone.stream.CoreStream = new CoreStream().forEach(async (x) => x === 1, {}); } - { const a: adone.stream.CoreStream = new CoreStream().forEach(async (x) => x === 1, { passthrough: true }); } - { const a: adone.stream.CoreStream = new CoreStream().forEach(async (x) => x === 1, { wait: true }); } - { const a: adone.stream.CoreStream = new CoreStream().done(() => {}); } - { const a: adone.stream.CoreStream = new CoreStream().done(() => {}, {}); } - { const a: adone.stream.CoreStream = new CoreStream().done(() => {}, { passthrough: true }); } - { const a: adone.stream.CoreStream = new CoreStream().toArray((x: any[]) => {}); } - { const a: adone.stream.CoreStream = new CoreStream().toArray((x: any[]) => {}, {}); } - { const a: adone.stream.CoreStream = new CoreStream().toArray((x: any[]) => {}, { passthrough: true }); } - { const a: adone.stream.CoreStream = new CoreStream().unique(); } - { const a: adone.stream.CoreStream = new CoreStream().unique((x) => x + 1); } - { const a: adone.stream.CoreStream = new CoreStream().stash((x) => x === 1); } - { const a: adone.stream.CoreStream = new CoreStream().stash("hello", (x) => x === 1); } - { const a: adone.stream.CoreStream = new CoreStream().unstash("hello"); } - { const a: adone.stream.CoreStream = new CoreStream().unstash(); } - { const a: adone.stream.CoreStream = new CoreStream().flatten(); } - { const a: Promise = new CoreStream().then(); } - { const a: Promise = new CoreStream().then(() => "1"); } - { const a: Promise = new CoreStream().then(() => 1, () => 2); } - { const a: Promise = new CoreStream().catch(); } - { const a: Promise = new CoreStream().catch(() => 1); } - { const a: adone.stream.CoreStream = CoreStream.merge([new CoreStream()]); } - { const a: adone.stream.CoreStream = CoreStream.merge([new adone.std.stream.Readable()]); } - { const a: adone.stream.CoreStream = CoreStream.merge([new adone.std.stream.Transform()]); } - { const a: adone.stream.CoreStream = CoreStream.merge([new adone.std.stream.Transform()]); } - { const a: adone.stream.CoreStream = CoreStream.merge([new adone.std.stream.Duplex()]); } - { const a: adone.stream.CoreStream = CoreStream.merge([], {}); } - { const a: adone.stream.CoreStream = CoreStream.merge([], { end: true }); } - { const a: adone.stream.CoreStream = CoreStream.merge([], { sourceOptions: {} }); } - { const a: adone.stream.CoreStream = CoreStream.merge([], { sourceOptions: { async: true } }); } - { const a: adone.stream.CoreStream = CoreStream.merge([], { sourceOptions: { sync: false } }); } - { const a: adone.stream.CoreStream = CoreStream.merge([], { sourceOptions: { transform(x) { this.push(x); } } }); } - { const a: adone.stream.CoreStream = CoreStream.merge([], { sourceOptions: { flush() { this.push(1); } } }); } + { const a: boolean = new Stream().write(1); } + { const a: boolean = new Stream().push(1); } + { const a: adone.stream.core.Stream = new Stream().end(); } + { const a: adone.stream.core.Stream = new Stream().destroy(); } + { const a: adone.stream.core.Stream = new Stream().pause(); } + { const a: adone.stream.core.Stream = new Stream().resume(); } + { const a: boolean = new Stream().isPaused(); } + { const a: boolean = new Stream().isEnded(); } + { const a: nodestd.stream.Transform = new Stream().pipe(new adone.std.stream.Transform()); } + { const a: adone.stream.core.Stream = new Stream().throughSync(function () { this.push(1); }); } + { const a: adone.stream.core.Stream = new Stream().throughSync(function () { this.push(1); }, function () { this.push(1); }); } + { const a: adone.stream.core.Stream = new Stream().throughAsync(function () { this.push(1); }); } + { const a: adone.stream.core.Stream = new Stream().throughAsync(function () { this.push(1); }, function () { this.push(1); }); } + { const a: adone.stream.core.Stream = new Stream().through(function () { this.push(1); }, function () { this.push(1); }); } + { const a: adone.stream.core.Stream = new Stream([1, 2, 3]).map((x) => `${x}`); } + { const a: adone.stream.core.Stream = new Stream().mapIf((x) => x === "1", () => 1); } + { const a: adone.stream.core.Stream = new Stream().mapIf(async (x) => x === "1", () => 1); } + { const a: adone.stream.core.Stream = new Stream().filter((x) => x === 1); } + { const a: adone.stream.core.Stream = new Stream().filter(async (x) => x === 1); } + { const a: adone.stream.core.Stream = new Stream().forEach(async (x) => x === 1); } + { const a: adone.stream.core.Stream = new Stream().forEach(async (x) => x === 1, {}); } + { const a: adone.stream.core.Stream = new Stream().forEach(async (x) => x === 1, { passthrough: true }); } + { const a: adone.stream.core.Stream = new Stream().forEach(async (x) => x === 1, { wait: true }); } + { const a: adone.stream.core.Stream = new Stream().done(() => {}); } + { const a: adone.stream.core.Stream = new Stream().done(() => {}, {}); } + { const a: adone.stream.core.Stream = new Stream().done(() => {}, { passthrough: true }); } + { const a: adone.stream.core.Stream = new Stream().toArray((x: any[]) => {}); } + { const a: adone.stream.core.Stream = new Stream().toArray((x: any[]) => {}, {}); } + { const a: adone.stream.core.Stream = new Stream().toArray((x: any[]) => {}, { passthrough: true }); } + { const a: adone.stream.core.Stream = new Stream().unique(); } + { const a: adone.stream.core.Stream = new Stream().unique((x) => x + 1); } + { const a: adone.stream.core.Stream = new Stream().stash((x) => x === 1); } + { const a: adone.stream.core.Stream = new Stream().stash("hello", (x) => x === 1); } + { const a: adone.stream.core.Stream = new Stream().unstash("hello"); } + { const a: adone.stream.core.Stream = new Stream().unstash(); } + { const a: adone.stream.core.Stream = new Stream().flatten(); } + { const a: Promise = new Stream().then(); } + { const a: Promise = new Stream().then(() => "1"); } + { const a: Promise = new Stream().then(() => 1, () => 2); } + { const a: Promise = new Stream().catch(); } + { const a: Promise = new Stream().catch(() => 1); } + { const a: adone.stream.core.Stream = Stream.merge([new Stream()]); } + { const a: adone.stream.core.Stream = Stream.merge([new adone.std.stream.Readable()]); } + { const a: adone.stream.core.Stream = Stream.merge([new adone.std.stream.Transform()]); } + { const a: adone.stream.core.Stream = Stream.merge([new adone.std.stream.Transform()]); } + { const a: adone.stream.core.Stream = Stream.merge([new adone.std.stream.Duplex()]); } + { const a: adone.stream.core.Stream = Stream.merge([], {}); } + { const a: adone.stream.core.Stream = Stream.merge([], { end: true }); } + { const a: adone.stream.core.Stream = Stream.merge([], { sourceOptions: {} }); } + { const a: adone.stream.core.Stream = Stream.merge([], { sourceOptions: { async: true } }); } + { const a: adone.stream.core.Stream = Stream.merge([], { sourceOptions: { sync: false } }); } + { const a: adone.stream.core.Stream = Stream.merge([], { sourceOptions: { transform(x) { this.push(x); } } }); } + { const a: adone.stream.core.Stream = Stream.merge([], { sourceOptions: { flush() { this.push(1); } } }); } (async () => { - const res = await new CoreStream([1, 2, 3, 4, 5]) + const res = await new Stream([1, 2, 3, 4, 5]) .map((x: number) => `${x}`) .mapIf((x: string) => x[0] === "1", (x) => x.slice(1)) .map((x) => [x, x, x]) @@ -91,13 +91,13 @@ namespace streamsTests { } namespace coreTests { - { const a: adone.stream.CoreStream = stream.core(); } - { const a: adone.stream.CoreStream = stream.core([1, 2, 3]); } - { const a: adone.stream.CoreStream = stream.core(stream.core([])); } - { const a: adone.stream.CoreStream = stream.core(undefined, {}); } - { const a: adone.stream.CoreStream = stream.core(undefined, { async: true }); } - { const a: adone.stream.CoreStream = stream.core(undefined, { sync: false }); } - { const a: adone.stream.CoreStream = stream.core(undefined, { transform(x) { this.push(Number(x)); } }); } - { const a: adone.stream.CoreStream = stream.core(undefined, { flush() { this.push(1); } }); } + { const a: adone.stream.core.Stream = stream.core.create(); } + { const a: adone.stream.core.Stream = stream.core.create([1, 2, 3]); } + { const a: adone.stream.core.Stream = stream.core.create(stream.core.create([])); } + { const a: adone.stream.core.Stream = stream.core.create(undefined, {}); } + { const a: adone.stream.core.Stream = stream.core.create(undefined, { async: true }); } + { const a: adone.stream.core.Stream = stream.core.create(undefined, { sync: false }); } + { const a: adone.stream.core.Stream = stream.core.create(undefined, { transform(x) { this.push(Number(x)); } }); } + { const a: adone.stream.core.Stream = stream.core.create(undefined, { flush() { this.push(1); } }); } } } diff --git a/types/adone/test/glosses/utils.ts b/types/adone/test/glosses/utils.ts index 33698bfb29..1ffabbd59b 100644 --- a/types/adone/test/glosses/utils.ts +++ b/types/adone/test/glosses/utils.ts @@ -34,13 +34,6 @@ namespace utilTests { const b: string = util.functionName((a, b, c) => { }); } - namespace mapArguments { - const a: (...args: any[]) => any = util.mapArguments(() => { }); - const b: (...args: T[]) => T[] = util.mapArguments(1); - const c: (...args: any[]) => any = util.mapArguments([1]); - const d: (x: T) => T = util.mapArguments(); - } - namespace parseMs { const result: { days: number; @@ -56,10 +49,6 @@ namespace utilTests { const c: string = util.pluralizeWord("day", "days", 1); } - namespace functionParams { - const a: string[] = util.functionParams((a: any, b: any, c: any) => { }); - } - namespace randomChoice { const a: number = util.randomChoice([1, 2, 3]); const b: string = util.randomChoice(["1", "2", "3"]); @@ -174,19 +163,10 @@ namespace utilTests { const a: string = util.globParent("a/b/c/**"); } - namespace by { - const a: (a: number, b: number) => any = util.by((x: number): number => x); - const b: (a: number, b: number) => number = util.by((x: number): string => `${x}`, (a: string, b: string) => a.length - b.length); - } - namespace toFastProperties { const a: object = util.toFastProperties({}); } - namespace stripBom { - const a: string = util.stripBom("123"); - } - namespace sortKeys { const a: object = util.sortKeys({}); const b: object = util.sortKeys({}, {}); @@ -234,16 +214,27 @@ namespace utilTests { const b: number | null = util.parseSize("123Kb"); } + namespace Cloner { + const a = new util.Cloner(); + a.clone({}); + a.clone({}, {}); + a.clone({}, { deep: true }); + a.clone({}, { nonPlainObjects: false }); + a.clone({}, { onlyEnumerable: true }); + const c = a.binding(); + c({}); + c({}, {}); + c({}, { deep: true }); + c({}, { onlyEnumerable: false }); + c({}, { nonPlainObjects: true }); + } + namespace clone { const a: object = util.clone({}); const b: object = util.clone({}, {}); const c: object = util.clone({}, { deep: true }); } - namespace toUTF8Array { - const a: number[] = util.toUTF8Array("hello"); - } - namespace asyncIter { util.asyncIter([1, 2, 3], () => { }, () => { }); } @@ -298,28 +289,34 @@ namespace utilTests { const a: object = util.assignDeep({ a: 1 }, { a: 2 }); } - namespace match { - const a: number | boolean = util.match(["a", "b", "c"], "a"); - const b: (a: any, b: any) => number | boolean = util.match("a", { index: true }); - const c: number | boolean = util.match(["a", "b", "c"], "a", { dot: true }); - const d: (a: any, b: any) => number | boolean = util.match("a", { end: 2 }); - const e: (a: any, b: any) => number | boolean = util.match("a", { start: 2 }); - const f: (a: any, b: any) => number | boolean = util.match("a"); + namespace matchPath { + const a: number | boolean = util.matchPath(["a", "b", "c"], "a"); + const b: (a: any, b: any) => number | boolean = util.matchPath("a", { index: true }); + const c: number | boolean = util.matchPath(["a", "b", "c"], "a", { dot: true }); + const d: (a: any, b: any) => number | boolean = util.matchPath("a", { end: 2 }); + const e: (a: any, b: any) => number | boolean = util.matchPath("a", { start: 2 }); + const f: (a: any, b: any) => number | boolean = util.matchPath("a"); } namespace toposort { - const a: number[] = util.toposort([ - [0, 1], - [2, 3], - [4, 5], - [6, 7] + const a: string[] = util.toposort([ + ["0", "1"], + ["2", "3"], + ["4", "5"], + ["6", "7"] ]); - const b: number[] = util.toposort.array([0, 1, 2], [ - [0, 1], - [2, 3], - [4, 5], - [6, 7] + const b: string[] = util.toposort.array(["0", "1", "2"], [ + ["0", "1"], + ["2", "3"], + ["4", "5"], + ["6", "7"] ]); + const sorter = new util.toposort.Sorter(); + sorter.add("a", "b"); + sorter.add("a", ["c"]); + const c: string[] = sorter.sort(); + sorter.clear(); + sorter.edges[0][0].charCodeAt(100); } namespace jsesc { @@ -340,10 +337,6 @@ namespace utilTests { const o: string = util.jsesc({ a: 1 }, { __inline2__: true }); } - namespace typeOf { - const a: string = util.typeOf(1); - } - namespace memcpy { const a: number = util.memcpy.utou(Buffer.alloc(10), 0, Buffer.alloc(10), 0, 10); const b: number = util.memcpy.atoa(new ArrayBuffer(10), 0, new ArrayBuffer(10), 0, 10); @@ -394,73 +387,6 @@ namespace utilTests { a.getter("a").access("b").method("c").setter("d"); } - namespace GlobExp { - { - const glob = new util.GlobExp("*.js"); - const a: boolean = glob.hasMagic(); - const b: string[] = glob.expandBraces(); - const c: RegExp = glob.makeRe(); - const d: boolean = glob.test("a.js"); - } - { - const a: boolean = util.GlobExp.hasMagic("*.js"); - const b: string[] = util.GlobExp.expandBraces("*.js"); - const c: RegExp = util.GlobExp.makeRe("*.js"); - const d: boolean = util.GlobExp.test("*.js", "a.js"); - } - new util.GlobExp(""); - new util.GlobExp("", {}); - new util.GlobExp("", { dot: true }); - new util.GlobExp("", { flipNegate: true }); - new util.GlobExp("", { matchBase: true }); - new util.GlobExp("", { nobrace: true }); - new util.GlobExp("", { nocase: true }); - new util.GlobExp("", { nocomment: true }); - new util.GlobExp("", { noext: true }); - new util.GlobExp("", { noglobstar: true }); - new util.GlobExp("", { nonegate: true }); - util.GlobExp.hasMagic("", {}); - util.GlobExp.hasMagic("", { dot: true }); - util.GlobExp.hasMagic("", { flipNegate: true }); - util.GlobExp.hasMagic("", { matchBase: true }); - util.GlobExp.hasMagic("", { nobrace: true }); - util.GlobExp.hasMagic("", { nocase: true }); - util.GlobExp.hasMagic("", { nocomment: true }); - util.GlobExp.hasMagic("", { noext: true }); - util.GlobExp.hasMagic("", { noglobstar: true }); - util.GlobExp.hasMagic("", { nonegate: true }); - util.GlobExp.expandBraces("", {}); - util.GlobExp.expandBraces("", { dot: true }); - util.GlobExp.expandBraces("", { flipNegate: true }); - util.GlobExp.expandBraces("", { matchBase: true }); - util.GlobExp.expandBraces("", { nobrace: true }); - util.GlobExp.expandBraces("", { nocase: true }); - util.GlobExp.expandBraces("", { nocomment: true }); - util.GlobExp.expandBraces("", { noext: true }); - util.GlobExp.expandBraces("", { noglobstar: true }); - util.GlobExp.expandBraces("", { nonegate: true }); - util.GlobExp.makeRe("", {}); - util.GlobExp.makeRe("", { dot: true }); - util.GlobExp.makeRe("", { flipNegate: true }); - util.GlobExp.makeRe("", { matchBase: true }); - util.GlobExp.makeRe("", { nobrace: true }); - util.GlobExp.makeRe("", { nocase: true }); - util.GlobExp.makeRe("", { nocomment: true }); - util.GlobExp.makeRe("", { noext: true }); - util.GlobExp.makeRe("", { noglobstar: true }); - util.GlobExp.makeRe("", { nonegate: true }); - util.GlobExp.test("a", "b", {}); - util.GlobExp.test("a", "b", { dot: true }); - util.GlobExp.test("a", "b", { flipNegate: true }); - util.GlobExp.test("a", "b", { matchBase: true }); - util.GlobExp.test("a", "b", { nobrace: true }); - util.GlobExp.test("a", "b", { nocase: true }); - util.GlobExp.test("a", "b", { nocomment: true }); - util.GlobExp.test("a", "b", { noext: true }); - util.GlobExp.test("a", "b", { noglobstar: true }); - util.GlobExp.test("a", "b", { nonegate: true }); - } - namespace iconv { // TODO } @@ -477,19 +403,6 @@ namespace utilTests { const b: string = util.sqlstring.dateToString(123, "local"); } - namespace arrayToList { - const a: string = util.sqlstring.arrayToList(["1", "a"]); - } - - namespace bufferToString { - const a: string = util.sqlstring.bufferToString(Buffer.alloc(10)); - } - - namespace objectToValues { - const a: string = util.sqlstring.objectToValues({ a: 1 }); - const b: string = util.sqlstring.objectToValues({ a: 1 }, "local"); - } - namespace escape { const a: string = util.sqlstring.escape(1); const b: string = util.sqlstring.escape(1, true); @@ -532,44 +445,55 @@ namespace utilTests { } namespace buffer { - const a: Buffer = util.buffer.concat([Buffer.alloc(10), Buffer.alloc(20)], 30); - util.buffer.mask(Buffer.alloc(10), Buffer.alloc(10), Buffer.alloc(10), 0, 10); - util.buffer.unmask(Buffer.alloc(10), Buffer.alloc(10)); + namespace toArrayBuffer { + const a = util.buffer.toArrayBuffer(Buffer.from("hello")); + a.slice(10); + } + + namespace xor { + const a = util.buffer.xor(Buffer.from("hello"), Buffer.from("world")); + a.writeUInt32LE(20, 1); + } } namespace shebang { const a: string | null = util.shebang("#!/bin/sh"); } - namespace ReInterval { - new util.ReInterval(() => { }, 1000); - new util.ReInterval(() => { }, 1000, [1]); - const a = new util.ReInterval(() => { }, 1000); + namespace reinterval { + util.reinterval(() => { }, 1000); + util.reinterval(() => { }, 1000, [1]); + const a = util.reinterval(() => { }, 1000); a.reschedule(400); a.clear(); a.destroy(); } - namespace RateLimiter { - new util.RateLimiter(); - new util.RateLimiter(1); - new util.RateLimiter(1, 1000); - new util.RateLimiter(1, 1000, true); - const a = new util.RateLimiter(); - a.removeTokens(1).then((x: number) => { }); - const b: boolean = a.tryRemoveTokens(10); - const c: number = a.getTokensRemaining(); - } - namespace throttle { - const a: () => Promise = util.throttle(() => 42); - const b: (a: number) => Promise = util.throttle((a: number) => `${a}`); - const c: (a: number, b: string) => Promise = util.throttle((a: number, b: string) => String(a) + b); - const d = util.throttle(() => { }, {}); - const e = util.throttle(() => { }, { interval: 1000 }); - const f = util.throttle(() => { }, { max: 10 }); - const g = util.throttle(() => { }, { ordered: true }); - const h = util.throttle(() => { }, { waitForReturn: true }); + namespace RateLimiter { + new util.throttle.RateLimiter(); + new util.throttle.RateLimiter(1); + new util.throttle.RateLimiter(1, 1000); + new util.throttle.RateLimiter(1, 1000, true); + const a = new util.throttle.RateLimiter(); + a.removeTokens(1).then((x: number) => { }); + const b: boolean = a.tryRemoveTokens(10); + const c: number = a.getTokensRemaining(); + } + + const a: () => Promise = util.throttle.create(() => 42); + const b: (a: number) => Promise = util.throttle.create((a: number) => `${a}`); + const c: (a: number, b: string) => Promise = util.throttle.create((a: number, b: string) => String(a) + b); + const d = util.throttle.create(() => { }, {}); + const e = util.throttle.create(() => { }, { interval: 1000 }); + const f = util.throttle.create(() => { }, { max: 10 }); + const g = util.throttle.create(() => { }, { ordered: true }); + const h = util.throttle.create(() => { }, { waitForReturn: true }); + const i = util.throttle.create(() => { }, { onDone() {} }); + const j = util.throttle.create(() => { }, { drop: true }); + const k = util.throttle.create(() => { }, { dropLast: true }); + + const l: symbol = util.throttle.DROPPED; } namespace fakeClock { @@ -741,17 +665,6 @@ namespace utilTests { } } - namespace userid { - const { userid } = util; - - { const a: number = userid.uid("someone").gid; } - { const a: number = userid.uid("someone").uid; } - { const a: number = userid.gid("someone"); } - { const a: string = userid.username(1000); } - { const a: string = userid.groupname(1000); } - { const gids: number[] = userid.gids("someone"); } - } - namespace LogRotator { const { LogRotator } = util; new LogRotator("file.log"); @@ -766,4 +679,679 @@ namespace utilTests { new LogRotator("file.log").start(); new LogRotator("file.log").stop(); } + + namespace arrayDiff { + const { arrayDiff } = util; + + arrayDiff([1, 2, 3], [4, 5, 6])[0].toFixed(); + arrayDiff(["1"])[0].charCodeAt(100); + } + + namespace fillRange { + const { fillRange } = util; + + { const a: number[] = fillRange(1, 2); } + { const a: string[] = fillRange(1, 2, { stringify: true }); } + { const a: string = fillRange(1, 2, { toRegex: true }); } + { const a: string[] = fillRange("1", "2"); } + { const a: string = fillRange("1", "2", { toRegex: true }); } + } + + namespace inflection { + const { inflection } = util; + + { const a: string = inflection.singularizeWord("hello"); } + { const a: string = inflection.singularizeWord("hello", "aaaa"); } + { const a: string = inflection.pluralizeWord("hello"); } + { const a: string = inflection.pluralizeWord("hello", "aaaa"); } + { const a: string = inflection.underscore("hello"); } + } + + namespace machineId { + const { machineId } = util; + + (async () => { + const a: string = await machineId(); + }); + } + + namespace merge { + const { merge } = util; + + merge({}, {}); + merge({}, {}, { allowPrototypes: true }); + merge({}, {}, { plainObjects: false }); + } + + namespace omit { + const { omit } = util; + + omit({}, ["a"]); + omit({}, "a"); + omit({}, (x) => x === "a"); + } + + namespace parseTime { + const { parseTime } = util; + + { const a: number = parseTime(123); } + { const a: number | null = parseTime("12"); } + } + + namespace pick { + const { pick } = util; + + pick({}, ["a", "b", "c"]); + pick({}, new Set(["a", "b", "c"])); + } + + namespace querystring { + const { querystring: qs } = util; + + { const a: string = qs.escape("asd"); } + { const a: string = qs.formats.default; } + { const a: string = qs.formats.RFC1738; } + { const a: string = qs.formats.RFC3986; } + { const a: string = qs.formats.formatters.RFC1738("ha"); } + { const a: string = qs.formats.formatters.RFC3986("ha"); } + { const a: object = qs.parse("asdasd"); } + { const a: object = qs.parse("asdasd", {}); } + { const a: object = qs.parse("asdasd", { allowDots: false }); } + { const a: object = qs.parse("asdasd", { allowPrototypes: false }); } + { const a: object = qs.parse("asdasd", { arrayLimit: 100 }); } + { const a: object = qs.parse("asdasd", { decoder: (s) => s }); } + { const a: object = qs.parse("asdasd", { decoder: (s, d) => d(s) }); } + { const a: object = qs.parse("asdasd", { delimiter: "a" }); } + { const a: object = qs.parse("asdasd", { depth: 100 }); } + { const a: object = qs.parse("asdasd", { ignoreQueryPrefix: false }); } + { const a: object = qs.parse("asdasd", { parameterLimit: 100 }); } + { const a: object = qs.parse("asdasd", { parseArrays: false }); } + { const a: object = qs.parse("asdasd", { plainObjects: true }); } + { const a: object = qs.parse("asdasd", { strictNullHandling: false }); } + { const a: string = qs.stringify({}); } + { const a: string = qs.stringify({}, {}); } + { const a: string = qs.stringify({}, { addQueryPrefix: false }); } + { const a: string = qs.stringify({}, { allowDots: false }); } + { const a: string = qs.stringify({}, { arrayFormat: "indices" }); } + { const a: string = qs.stringify({}, { arrayFormat: "brackets" }); } + { const a: string = qs.stringify({}, { arrayFormat: "repeat" }); } + { const a: string = qs.stringify({}, { delimiter: "1" }); } + { const a: string = qs.stringify({}, { encode: true }); } + { const a: string = qs.stringify({}, { encoder: (s) => s }); } + { const a: string = qs.stringify({}, { encodeValuesOnly: false }); } + { const a: string = qs.stringify({}, { filter: [1, 2, 3] }); } + { const a: string = qs.stringify({}, { filter: ["1", "2", "3"] }); } + { const a: string = qs.stringify({}, { filter: (prefix: string, value: any) => value === 1 }); } + { const a: string = qs.stringify({}, { indices: false }); } + { const a: string = qs.stringify({}, { serializeDate(d) { return String(d.getTime()); } }); } + { const a: string = qs.stringify({}, { skipNulls: false }); } + { const a: string = qs.stringify({}, { sort(a, b) { return a - b; } }); } + { const a: string = qs.stringify({}, { strictNullHandling: false }); } + } + + namespace regexNot { + const { regexNot } = util; + + { const a: RegExp = regexNot("a"); } + { const a: RegExp = regexNot("a", {}); } + { const a: RegExp = regexNot("a", { contains: false }); } + } + + namespace repeat { + const { repeat } = util; + { const a: number[] = repeat(1, 10); } + { const a: string[] = repeat("a", 10); } + { const a: number[][] = repeat([2], 10); } + } + + namespace signalNameToCode { + const { signalNameToCode } = util; + signalNameToCode("SIGINT").toFixed(2); + } + + namespace splitBuffer { + const { splitBuffer } = util; + + { const a: Buffer[] = splitBuffer(Buffer.from("asd"), Buffer.from("|")); } + { const a: Buffer[] = splitBuffer(Buffer.from("asd"), Buffer.from("|"), true); } + { const a: Buffer[] = splitBuffer("asd", Buffer.from("|"), true); } + { const a: Buffer[] = splitBuffer("asd", "|"); } + } + + namespace splitString { + const { splitString } = util; + + splitString("a"); + splitString("a", {}); + splitString("a", { braces: false }); + splitString("a", { keepDoubleQuotes: false }); + splitString("a", { keepEscaping: false }); + splitString("a", { keepQuotes: false }); + splitString("a", { keepSingleQuotes: false }); + splitString("a", { separator: "|" }); + splitString("a", { + split(token) { + { const a: string[] = token.arr; } + { const a: number = token.idx; } + { const a: string = token.str; } + { const a: string = token.val; } + } + }); + splitString("a", (token) => { + { const a: string[] = token.arr; } + { const a: number = token.idx; } + { const a: string = token.str; } + { const a: string = token.val; } + }); + splitString("a", {}, (token) => { + { const a: string[] = token.arr; } + { const a: number = token.idx; } + { const a: string = token.str; } + { const a: string = token.val; } + }); + } + + namespace toRegex { + const { toRegex } = util; + + { const a: RegExp = toRegex("a"); } + { const a: RegExp = toRegex(["a"]); } + { const a: RegExp = toRegex(["a"], {}); } + { const a: RegExp = toRegex(["a"], { cache: false }); } + { const a: RegExp = toRegex(["a"], { contains: false }); } + { const a: RegExp = toRegex(["a"], { flags: "i" }); } + { const a: RegExp = toRegex(["a"], { negate: false }); } + { const a: RegExp = toRegex(["a"], { nocase: false }); } + } + + namespace toRegexRange { + const { toRegexRange } = util; + + { const a: RegExp = toRegexRange(1, 10); } + { const a: RegExp = toRegexRange("1", "10"); } + { const a: RegExp = toRegexRange(1, 10, {}); } + { const a: RegExp = toRegexRange(1, 10, { capture: false }); } + { const a: RegExp = toRegexRange(1, 10, { relaxZeros: true }); } + { const a: RegExp = toRegexRange(1, 10, { shorthand: false }); } + } + + namespace xorDistance { + const { compare, create, eq, gt, lt } = util.xorDistance; + + { const a: boolean = compare(Buffer.from("1"), Buffer.from("2")); } + { const a: Buffer = create(Buffer.from("1"), Buffer.from("2")); } + { const a: boolean = gt(Buffer.from("1"), Buffer.from("2")); } + { const a: boolean = lt(Buffer.from("1"), Buffer.from("2")); } + { const a: boolean = eq(Buffer.from("1"), Buffer.from("2")); } + } + + namespace braces { + const { braces } = util; + + { const a: string[] = braces("a"); } + { const a: string[] = braces("a", {}); } + { const a: string[] = braces("a", { expand: false }); } + { const a: string[] = braces("a", { nodupes: false }); } + { const a: string[] = braces("a", { optimize: true }); } + { const a: string[] = braces("a", { quantifiers: false }); } + { const a: string[] = braces("a", { rangeLimit: 100 }); } + { const a: string[] = braces("a", { transform: (s: string) => s }); } + { const a: string[] = braces("a", { unescape: false }); } + + { const a: string[] = braces.expand("a"); } + { const a: string[] = braces.expand("a", {}); } + { const a: string[] = braces.expand("a", { expand: false }); } + { const a: string[] = braces.expand("a", { nodupes: false }); } + { const a: string[] = braces.expand("a", { optimize: true }); } + { const a: string[] = braces.expand("a", { quantifiers: false }); } + { const a: string[] = braces.expand("a", { rangeLimit: 100 }); } + { const a: string[] = braces.expand("a", { transform: (s: string) => s }); } + { const a: string[] = braces.expand("a", { unescape: false }); } + + { const a: RegExp = braces.makeRe("a"); } + { const a: RegExp = braces.makeRe("a", {}); } + { const a: RegExp = braces.makeRe("a", { expand: false }); } + { const a: RegExp = braces.makeRe("a", { nodupes: false }); } + { const a: RegExp = braces.makeRe("a", { optimize: true }); } + { const a: RegExp = braces.makeRe("a", { quantifiers: false }); } + { const a: RegExp = braces.makeRe("a", { rangeLimit: 100 }); } + { const a: RegExp = braces.makeRe("a", { transform: (s: string) => s }); } + { const a: RegExp = braces.makeRe("a", { unescape: false }); } + + { const a: number = braces.MAX_LENGTH; } + { const a: object = braces.getCache(); } + braces.clearCache(); + braces.resizeCache(100500); + } + + namespace match { + const { match } = util; + + { const a: string[] = match(["a"], "a"); } + { const a: string[] = match(["a"], ["a"]); } + { const a: string[] = match(["a"], ["a"], {}); } + { const a: string[] = match(["a"], ["a"], { basename: false }); } + { const a: string[] = match(["a"], ["a"], { bash: false }); } + { const a: string[] = match(["a"], ["a"], { cache: false }); } + { const a: string[] = match(["a"], ["a"], { dot: true }); } + { const a: string[] = match(["a"], ["a"], { failglob: false }); } + { const a: string[] = match(["a"], ["a"], { ignore: "a" }); } + { const a: string[] = match(["a"], ["a"], { ignore: ["a"] }); } + { const a: string[] = match(["a"], ["a"], { matchBase: false }); } + { const a: string[] = match(["a"], ["a"], { nobrace: true }); } + { const a: string[] = match(["a"], ["a"], { nocase: false }); } + { const a: string[] = match(["a"], ["a"], { nodupes: true }); } + { const a: string[] = match(["a"], ["a"], { noext: false }); } + { const a: string[] = match(["a"], ["a"], { noglobstar: true }); } + { const a: string[] = match(["a"], ["a"], { nonegate: false }); } + { const a: string[] = match(["a"], ["a"], { nonull: false }); } + { const a: string[] = match(["a"], ["a"], { nullglob: false }); } + { const a: string[] = match(["a"], ["a"], { snapdragon: {} }); } + { const a: string[] = match(["a"], ["a"], { sourcemap: false }); } + { const a: string[] = match(["a"], ["a"], { unescape: false }); } + { const a: string[] = match(["a"], ["a"], { unixify: false }); } + + { const a: string[] = match.match(["a"], "a"); } + { const a: string[] = match.match(["a"], "a", {}); } + { const a: string[] = match.match(["a"], "a", { basename: false }); } + { const a: string[] = match.match(["a"], "a", { bash: false }); } + { const a: string[] = match.match(["a"], "a", { cache: false }); } + { const a: string[] = match.match(["a"], "a", { dot: true }); } + { const a: string[] = match.match(["a"], "a", { failglob: false }); } + { const a: string[] = match.match(["a"], "a", { ignore: "a" }); } + { const a: string[] = match.match(["a"], "a", { ignore: ["a"] }); } + { const a: string[] = match.match(["a"], "a", { matchBase: false }); } + { const a: string[] = match.match(["a"], "a", { nobrace: true }); } + { const a: string[] = match.match(["a"], "a", { nocase: false }); } + { const a: string[] = match.match(["a"], "a", { nodupes: true }); } + { const a: string[] = match.match(["a"], "a", { noext: false }); } + { const a: string[] = match.match(["a"], "a", { noglobstar: true }); } + { const a: string[] = match.match(["a"], "a", { nonegate: false }); } + { const a: string[] = match.match(["a"], "a", { nonull: false }); } + { const a: string[] = match.match(["a"], "a", { nullglob: false }); } + { const a: string[] = match.match(["a"], "a", { snapdragon: {} }); } + { const a: string[] = match.match(["a"], "a", { sourcemap: false }); } + { const a: string[] = match.match(["a"], "a", { unescape: false }); } + { const a: string[] = match.match(["a"], "a", { unixify: false }); } + + { const a: boolean = match.isMatch("a", "a"); } + { const a: boolean = match.isMatch("a", "a", {}); } + { const a: boolean = match.isMatch("a", "a", { basename: false }); } + { const a: boolean = match.isMatch("a", "a", { bash: false }); } + { const a: boolean = match.isMatch("a", "a", { cache: false }); } + { const a: boolean = match.isMatch("a", "a", { dot: true }); } + { const a: boolean = match.isMatch("a", "a", { failglob: false }); } + { const a: boolean = match.isMatch("a", "a", { ignore: "a" }); } + { const a: boolean = match.isMatch("a", "a", { ignore: ["a"] }); } + { const a: boolean = match.isMatch("a", "a", { matchBase: false }); } + { const a: boolean = match.isMatch("a", "a", { nobrace: true }); } + { const a: boolean = match.isMatch("a", "a", { nocase: false }); } + { const a: boolean = match.isMatch("a", "a", { nodupes: true }); } + { const a: boolean = match.isMatch("a", "a", { noext: false }); } + { const a: boolean = match.isMatch("a", "a", { noglobstar: true }); } + { const a: boolean = match.isMatch("a", "a", { nonegate: false }); } + { const a: boolean = match.isMatch("a", "a", { nonull: false }); } + { const a: boolean = match.isMatch("a", "a", { nullglob: false }); } + { const a: boolean = match.isMatch("a", "a", { snapdragon: {} }); } + { const a: boolean = match.isMatch("a", "a", { sourcemap: false }); } + { const a: boolean = match.isMatch("a", "a", { unescape: false }); } + { const a: boolean = match.isMatch("a", "a", { unixify: false }); } + + { const a: boolean = match.some(["a"], ["a"]); } + { const a: boolean = match.some("a", "a"); } + { const a: boolean = match.some("a", "a", {}); } + { const a: boolean = match.some("a", "a", { basename: false }); } + { const a: boolean = match.some("a", "a", { bash: false }); } + { const a: boolean = match.some("a", "a", { cache: false }); } + { const a: boolean = match.some("a", "a", { dot: true }); } + { const a: boolean = match.some("a", "a", { failglob: false }); } + { const a: boolean = match.some("a", "a", { ignore: "a" }); } + { const a: boolean = match.some("a", "a", { ignore: ["a"] }); } + { const a: boolean = match.some("a", "a", { matchBase: false }); } + { const a: boolean = match.some("a", "a", { nobrace: true }); } + { const a: boolean = match.some("a", "a", { nocase: false }); } + { const a: boolean = match.some("a", "a", { nodupes: true }); } + { const a: boolean = match.some("a", "a", { noext: false }); } + { const a: boolean = match.some("a", "a", { noglobstar: true }); } + { const a: boolean = match.some("a", "a", { nonegate: false }); } + { const a: boolean = match.some("a", "a", { nonull: false }); } + { const a: boolean = match.some("a", "a", { nullglob: false }); } + { const a: boolean = match.some("a", "a", { snapdragon: {} }); } + { const a: boolean = match.some("a", "a", { sourcemap: false }); } + { const a: boolean = match.some("a", "a", { unescape: false }); } + { const a: boolean = match.some("a", "a", { unixify: false }); } + + { const a: boolean = match.every(["a"], ["a"]); } + { const a: boolean = match.every("a", "a"); } + { const a: boolean = match.every("a", "a", {}); } + { const a: boolean = match.every("a", "a", { basename: false }); } + { const a: boolean = match.every("a", "a", { bash: false }); } + { const a: boolean = match.every("a", "a", { cache: false }); } + { const a: boolean = match.every("a", "a", { dot: true }); } + { const a: boolean = match.every("a", "a", { failglob: false }); } + { const a: boolean = match.every("a", "a", { ignore: "a" }); } + { const a: boolean = match.every("a", "a", { ignore: ["a"] }); } + { const a: boolean = match.every("a", "a", { matchBase: false }); } + { const a: boolean = match.every("a", "a", { nobrace: true }); } + { const a: boolean = match.every("a", "a", { nocase: false }); } + { const a: boolean = match.every("a", "a", { nodupes: true }); } + { const a: boolean = match.every("a", "a", { noext: false }); } + { const a: boolean = match.every("a", "a", { noglobstar: true }); } + { const a: boolean = match.every("a", "a", { nonegate: false }); } + { const a: boolean = match.every("a", "a", { nonull: false }); } + { const a: boolean = match.every("a", "a", { nullglob: false }); } + { const a: boolean = match.every("a", "a", { snapdragon: {} }); } + { const a: boolean = match.every("a", "a", { sourcemap: false }); } + { const a: boolean = match.every("a", "a", { unescape: false }); } + { const a: boolean = match.every("a", "a", { unixify: false }); } + + { const a: boolean = match.any(["a"], ["a"]); } + { const a: boolean = match.any("a", "a"); } + { const a: boolean = match.any("a", "a", {}); } + { const a: boolean = match.any("a", "a", { basename: false }); } + { const a: boolean = match.any("a", "a", { bash: false }); } + { const a: boolean = match.any("a", "a", { cache: false }); } + { const a: boolean = match.any("a", "a", { dot: true }); } + { const a: boolean = match.any("a", "a", { failglob: false }); } + { const a: boolean = match.any("a", "a", { ignore: "a" }); } + { const a: boolean = match.any("a", "a", { ignore: ["a"] }); } + { const a: boolean = match.any("a", "a", { matchBase: false }); } + { const a: boolean = match.any("a", "a", { nobrace: true }); } + { const a: boolean = match.any("a", "a", { nocase: false }); } + { const a: boolean = match.any("a", "a", { nodupes: true }); } + { const a: boolean = match.any("a", "a", { noext: false }); } + { const a: boolean = match.any("a", "a", { noglobstar: true }); } + { const a: boolean = match.any("a", "a", { nonegate: false }); } + { const a: boolean = match.any("a", "a", { nonull: false }); } + { const a: boolean = match.any("a", "a", { nullglob: false }); } + { const a: boolean = match.any("a", "a", { snapdragon: {} }); } + { const a: boolean = match.any("a", "a", { sourcemap: false }); } + { const a: boolean = match.any("a", "a", { unescape: false }); } + { const a: boolean = match.any("a", "a", { unixify: false }); } + + { const a: boolean = match.all("a", "a"); } + { const a: boolean = match.all("a", ["a"]); } + { const a: boolean = match.all(["a"], "a"); } + { const a: boolean = match.all(["a"], "a", {}); } + { const a: boolean = match.all(["a"], ["a"], { basename: false }); } + { const a: boolean = match.all(["a"], ["a"], { bash: false }); } + { const a: boolean = match.all(["a"], ["a"], { cache: false }); } + { const a: boolean = match.all(["a"], ["a"], { dot: true }); } + { const a: boolean = match.all(["a"], ["a"], { failglob: false }); } + { const a: boolean = match.all(["a"], ["a"], { ignore: "a" }); } + { const a: boolean = match.all(["a"], ["a"], { ignore: ["a"] }); } + { const a: boolean = match.all(["a"], ["a"], { matchBase: false }); } + { const a: boolean = match.all(["a"], ["a"], { nobrace: true }); } + { const a: boolean = match.all(["a"], ["a"], { nocase: false }); } + { const a: boolean = match.all(["a"], ["a"], { nodupes: true }); } + { const a: boolean = match.all(["a"], ["a"], { noext: false }); } + { const a: boolean = match.all(["a"], ["a"], { noglobstar: true }); } + { const a: boolean = match.all(["a"], ["a"], { nonegate: false }); } + { const a: boolean = match.all(["a"], ["a"], { nonull: false }); } + { const a: boolean = match.all(["a"], ["a"], { nullglob: false }); } + { const a: boolean = match.all(["a"], ["a"], { snapdragon: {} }); } + { const a: boolean = match.all(["a"], ["a"], { sourcemap: false }); } + { const a: boolean = match.all(["a"], ["a"], { unescape: false }); } + { const a: boolean = match.all(["a"], ["a"], { unixify: false }); } + + { const a: string[] = match.not(["a"], ["a"]); } + { const a: string[] = match.not(["a"], "a"); } + { const a: string[] = match.not(["a"], "a", {}); } + { const a: string[] = match.not(["a"], "a", { basename: false }); } + { const a: string[] = match.not(["a"], "a", { bash: false }); } + { const a: string[] = match.not(["a"], "a", { cache: false }); } + { const a: string[] = match.not(["a"], "a", { dot: true }); } + { const a: string[] = match.not(["a"], "a", { failglob: false }); } + { const a: string[] = match.not(["a"], "a", { ignore: "a" }); } + { const a: string[] = match.not(["a"], "a", { ignore: ["a"] }); } + { const a: string[] = match.not(["a"], "a", { matchBase: false }); } + { const a: string[] = match.not(["a"], "a", { nobrace: true }); } + { const a: string[] = match.not(["a"], "a", { nocase: false }); } + { const a: string[] = match.not(["a"], "a", { nodupes: true }); } + { const a: string[] = match.not(["a"], "a", { noext: false }); } + { const a: string[] = match.not(["a"], "a", { noglobstar: true }); } + { const a: string[] = match.not(["a"], "a", { nonegate: false }); } + { const a: string[] = match.not(["a"], "a", { nonull: false }); } + { const a: string[] = match.not(["a"], "a", { nullglob: false }); } + { const a: string[] = match.not(["a"], "a", { snapdragon: {} }); } + { const a: string[] = match.not(["a"], "a", { sourcemap: false }); } + { const a: string[] = match.not(["a"], "a", { unescape: false }); } + { const a: string[] = match.not(["a"], "a", { unixify: false }); } + + { const a: boolean = match.contains("a", "a"); } + { const a: boolean = match.contains("a", ["a"]); } + { const a: boolean = match.contains("a", ["a"], {}); } + { const a: boolean = match.contains("a", ["a"], { basename: false }); } + { const a: boolean = match.contains("a", ["a"], { bash: false }); } + { const a: boolean = match.contains("a", ["a"], { cache: false }); } + { const a: boolean = match.contains("a", ["a"], { dot: true }); } + { const a: boolean = match.contains("a", ["a"], { failglob: false }); } + { const a: boolean = match.contains("a", ["a"], { ignore: "a" }); } + { const a: boolean = match.contains("a", ["a"], { ignore: ["a"] }); } + { const a: boolean = match.contains("a", ["a"], { matchBase: false }); } + { const a: boolean = match.contains("a", ["a"], { nobrace: true }); } + { const a: boolean = match.contains("a", ["a"], { nocase: false }); } + { const a: boolean = match.contains("a", ["a"], { nodupes: true }); } + { const a: boolean = match.contains("a", ["a"], { noext: false }); } + { const a: boolean = match.contains("a", ["a"], { noglobstar: true }); } + { const a: boolean = match.contains("a", ["a"], { nonegate: false }); } + { const a: boolean = match.contains("a", ["a"], { nonull: false }); } + { const a: boolean = match.contains("a", ["a"], { nullglob: false }); } + { const a: boolean = match.contains("a", ["a"], { snapdragon: {} }); } + { const a: boolean = match.contains("a", ["a"], { sourcemap: false }); } + { const a: boolean = match.contains("a", ["a"], { unescape: false }); } + { const a: boolean = match.contains("a", ["a"], { unixify: false }); } + + { const a: object = match.matchKeys({}, "a"); } + { const a: object = match.matchKeys({}, ["a"]); } + { const a: object = match.matchKeys({}, ["a"], {}); } + { const a: object = match.matchKeys({}, ["a"], { basename: false }); } + { const a: object = match.matchKeys({}, ["a"], { bash: false }); } + { const a: object = match.matchKeys({}, ["a"], { cache: false }); } + { const a: object = match.matchKeys({}, ["a"], { dot: true }); } + { const a: object = match.matchKeys({}, ["a"], { failglob: false }); } + { const a: object = match.matchKeys({}, ["a"], { ignore: "a" }); } + { const a: object = match.matchKeys({}, ["a"], { ignore: ["a"] }); } + { const a: object = match.matchKeys({}, ["a"], { matchBase: false }); } + { const a: object = match.matchKeys({}, ["a"], { nobrace: true }); } + { const a: object = match.matchKeys({}, ["a"], { nocase: false }); } + { const a: object = match.matchKeys({}, ["a"], { nodupes: true }); } + { const a: object = match.matchKeys({}, ["a"], { noext: false }); } + { const a: object = match.matchKeys({}, ["a"], { noglobstar: true }); } + { const a: object = match.matchKeys({}, ["a"], { nonegate: false }); } + { const a: object = match.matchKeys({}, ["a"], { nonull: false }); } + { const a: object = match.matchKeys({}, ["a"], { nullglob: false }); } + { const a: object = match.matchKeys({}, ["a"], { snapdragon: {} }); } + { const a: object = match.matchKeys({}, ["a"], { sourcemap: false }); } + { const a: object = match.matchKeys({}, ["a"], { unescape: false }); } + { const a: object = match.matchKeys({}, ["a"], { unixify: false }); } + + { const a: (s: string) => boolean = match.matcher("a"); } + { const a: (s: string) => boolean = match.matcher(["a"]); } + { const a: (s: string) => boolean = match.matcher(["a"], {}); } + { const a: (s: string) => boolean = match.matcher(["a"], { basename: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { bash: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { cache: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { dot: true }); } + { const a: (s: string) => boolean = match.matcher(["a"], { failglob: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { ignore: "a" }); } + { const a: (s: string) => boolean = match.matcher(["a"], { ignore: ["a"] }); } + { const a: (s: string) => boolean = match.matcher(["a"], { matchBase: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { nobrace: true }); } + { const a: (s: string) => boolean = match.matcher(["a"], { nocase: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { nodupes: true }); } + { const a: (s: string) => boolean = match.matcher(["a"], { noext: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { noglobstar: true }); } + { const a: (s: string) => boolean = match.matcher(["a"], { nonegate: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { nonull: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { nullglob: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { snapdragon: {} }); } + { const a: (s: string) => boolean = match.matcher(["a"], { sourcemap: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { unescape: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { unixify: false }); } + + { const a: string[] | null = match.capture("a", "a"); } + { const a: string[] | null = match.capture("a", "a", {}); } + { const a: string[] | null = match.capture("a", "a", { basename: false }); } + { const a: string[] | null = match.capture("a", "a", { bash: false }); } + { const a: string[] | null = match.capture("a", "a", { cache: false }); } + { const a: string[] | null = match.capture("a", "a", { dot: true }); } + { const a: string[] | null = match.capture("a", "a", { failglob: false }); } + { const a: string[] | null = match.capture("a", "a", { ignore: "a" }); } + { const a: string[] | null = match.capture("a", "a", { ignore: ["a"] }); } + { const a: string[] | null = match.capture("a", "a", { matchBase: false }); } + { const a: string[] | null = match.capture("a", "a", { nobrace: true }); } + { const a: string[] | null = match.capture("a", "a", { nocase: false }); } + { const a: string[] | null = match.capture("a", "a", { nodupes: true }); } + { const a: string[] | null = match.capture("a", "a", { noext: false }); } + { const a: string[] | null = match.capture("a", "a", { noglobstar: true }); } + { const a: string[] | null = match.capture("a", "a", { nonegate: false }); } + { const a: string[] | null = match.capture("a", "a", { nonull: false }); } + { const a: string[] | null = match.capture("a", "a", { nullglob: false }); } + { const a: string[] | null = match.capture("a", "a", { snapdragon: {} }); } + { const a: string[] | null = match.capture("a", "a", { sourcemap: false }); } + { const a: string[] | null = match.capture("a", "a", { unescape: false }); } + { const a: string[] | null = match.capture("a", "a", { unixify: false }); } + + { const a: RegExp = match.makeRe("a"); } + { const a: RegExp = match.makeRe("a", {}); } + { const a: RegExp = match.makeRe("a", { basename: false }); } + { const a: RegExp = match.makeRe("a", { bash: false }); } + { const a: RegExp = match.makeRe("a", { cache: false }); } + { const a: RegExp = match.makeRe("a", { dot: true }); } + { const a: RegExp = match.makeRe("a", { failglob: false }); } + { const a: RegExp = match.makeRe("a", { ignore: "a" }); } + { const a: RegExp = match.makeRe("a", { ignore: ["a"] }); } + { const a: RegExp = match.makeRe("a", { matchBase: false }); } + { const a: RegExp = match.makeRe("a", { nobrace: true }); } + { const a: RegExp = match.makeRe("a", { nocase: false }); } + { const a: RegExp = match.makeRe("a", { nodupes: true }); } + { const a: RegExp = match.makeRe("a", { noext: false }); } + { const a: RegExp = match.makeRe("a", { noglobstar: true }); } + { const a: RegExp = match.makeRe("a", { nonegate: false }); } + { const a: RegExp = match.makeRe("a", { nonull: false }); } + { const a: RegExp = match.makeRe("a", { nullglob: false }); } + { const a: RegExp = match.makeRe("a", { snapdragon: {} }); } + { const a: RegExp = match.makeRe("a", { sourcemap: false }); } + { const a: RegExp = match.makeRe("a", { unescape: false }); } + { const a: RegExp = match.makeRe("a", { unixify: false }); } + + { const a: string[] = match.braces("a"); } + { const a: string[] = match.braces("a", {}); } + { const a: string[] = match.braces("a", {}); } + { const a: string[] = match.braces("a", { basename: false }); } + { const a: string[] = match.braces("a", { bash: false }); } + { const a: string[] = match.braces("a", { cache: false }); } + { const a: string[] = match.braces("a", { dot: true }); } + { const a: string[] = match.braces("a", { failglob: false }); } + { const a: string[] = match.braces("a", { ignore: "a" }); } + { const a: string[] = match.braces("a", { ignore: ["a"] }); } + { const a: string[] = match.braces("a", { matchBase: false }); } + { const a: string[] = match.braces("a", { nobrace: true }); } + { const a: string[] = match.braces("a", { nocase: false }); } + { const a: string[] = match.braces("a", { nodupes: true }); } + { const a: string[] = match.braces("a", { noext: false }); } + { const a: string[] = match.braces("a", { noglobstar: true }); } + { const a: string[] = match.braces("a", { nonegate: false }); } + { const a: string[] = match.braces("a", { nonull: false }); } + { const a: string[] = match.braces("a", { nullglob: false }); } + { const a: string[] = match.braces("a", { snapdragon: {} }); } + { const a: string[] = match.braces("a", { sourcemap: false }); } + { const a: string[] = match.braces("a", { unescape: false }); } + { const a: string[] = match.braces("a", { unixify: false }); } + + { const a: object = match.create("a"); } + { const a: object = match.create("a", {}); } + { const a: object = match.create("a", { basename: false }); } + { const a: object = match.create("a", { bash: false }); } + { const a: object = match.create("a", { cache: false }); } + { const a: object = match.create("a", { dot: true }); } + { const a: object = match.create("a", { failglob: false }); } + { const a: object = match.create("a", { ignore: "a" }); } + { const a: object = match.create("a", { ignore: ["a"] }); } + { const a: object = match.create("a", { matchBase: false }); } + { const a: object = match.create("a", { nobrace: true }); } + { const a: object = match.create("a", { nocase: false }); } + { const a: object = match.create("a", { nodupes: true }); } + { const a: object = match.create("a", { noext: false }); } + { const a: object = match.create("a", { noglobstar: true }); } + { const a: object = match.create("a", { nonegate: false }); } + { const a: object = match.create("a", { nonull: false }); } + { const a: object = match.create("a", { nullglob: false }); } + { const a: object = match.create("a", { snapdragon: {} }); } + { const a: object = match.create("a", { sourcemap: false }); } + { const a: object = match.create("a", { unescape: false }); } + { const a: object = match.create("a", { unixify: false }); } + { const a: object = match.create("a"); } + + { const a: object = match.parse("a", {}); } + { const a: object = match.parse("a", { basename: false }); } + { const a: object = match.parse("a", { bash: false }); } + { const a: object = match.parse("a", { cache: false }); } + { const a: object = match.parse("a", { dot: true }); } + { const a: object = match.parse("a", { failglob: false }); } + { const a: object = match.parse("a", { ignore: "a" }); } + { const a: object = match.parse("a", { ignore: ["a"] }); } + { const a: object = match.parse("a", { matchBase: false }); } + { const a: object = match.parse("a", { nobrace: true }); } + { const a: object = match.parse("a", { nocase: false }); } + { const a: object = match.parse("a", { nodupes: true }); } + { const a: object = match.parse("a", { noext: false }); } + { const a: object = match.parse("a", { noglobstar: true }); } + { const a: object = match.parse("a", { nonegate: false }); } + { const a: object = match.parse("a", { nonull: false }); } + { const a: object = match.parse("a", { nullglob: false }); } + { const a: object = match.parse("a", { snapdragon: {} }); } + { const a: object = match.parse("a", { sourcemap: false }); } + { const a: object = match.parse("a", { unescape: false }); } + { const a: object = match.parse("a", { unixify: false }); } + + { const a: object = match.compile("a", {}); } + { const a: object = match.compile({}, {}); } + { const a: object = match.compile("a", { basename: false }); } + { const a: object = match.compile({}, { basename: false }); } + { const a: object = match.compile("a", { bash: false }); } + { const a: object = match.compile({}, { bash: false }); } + { const a: object = match.compile("a", { cache: false }); } + { const a: object = match.compile({}, { cache: false }); } + { const a: object = match.compile("a", { dot: true }); } + { const a: object = match.compile({}, { dot: true }); } + { const a: object = match.compile("a", { failglob: false }); } + { const a: object = match.compile({}, { failglob: false }); } + { const a: object = match.compile("a", { ignore: "a" }); } + { const a: object = match.compile({}, { ignore: "a" }); } + { const a: object = match.compile("a", { ignore: ["a"] }); } + { const a: object = match.compile({}, { ignore: ["a"] }); } + { const a: object = match.compile("a", { matchBase: false }); } + { const a: object = match.compile({}, { matchBase: false }); } + { const a: object = match.compile("a", { nobrace: true }); } + { const a: object = match.compile({}, { nobrace: true }); } + { const a: object = match.compile("a", { nocase: false }); } + { const a: object = match.compile({}, { nocase: false }); } + { const a: object = match.compile("a", { nodupes: true }); } + { const a: object = match.compile({}, { nodupes: true }); } + { const a: object = match.compile("a", { noext: false }); } + { const a: object = match.compile({}, { noext: false }); } + { const a: object = match.compile("a", { noglobstar: true }); } + { const a: object = match.compile({}, { noglobstar: true }); } + { const a: object = match.compile("a", { nonegate: false }); } + { const a: object = match.compile({}, { nonegate: false }); } + { const a: object = match.compile("a", { nonull: false }); } + { const a: object = match.compile({}, { nonull: false }); } + { const a: object = match.compile("a", { nullglob: false }); } + { const a: object = match.compile({}, { nullglob: false }); } + { const a: object = match.compile("a", { snapdragon: {} }); } + { const a: object = match.compile({}, { snapdragon: {} }); } + { const a: object = match.compile("a", { sourcemap: false }); } + { const a: object = match.compile({}, { sourcemap: false }); } + { const a: object = match.compile("a", { unescape: false }); } + { const a: object = match.compile({}, { unescape: false }); } + { const a: object = match.compile("a", { unixify: false }); } + { const a: object = match.compile({}, { unixify: false }); } + + { const a: number = match.MAX_LENGTH; } + match.clearCache(); + match.resizeCache(10050); + { const a: object = match.getCache(); } + } } diff --git a/types/adone/tsconfig.json b/types/adone/tsconfig.json index c23bf82155..e77e755b85 100644 --- a/types/adone/tsconfig.json +++ b/types/adone/tsconfig.json @@ -15,21 +15,44 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "experimentalDecorators": true }, "files": [ "index.d.ts", "adone.d.ts", + "glosses/fake.d.ts", "glosses/math/index.d.ts", "glosses/math/matrix.d.ts", "glosses/math/simd.d.ts", + "glosses/meta.d.ts", "glosses/std.d.ts", "glosses/utils.d.ts", "glosses/assertion.d.ts", "glosses/promise.d.ts", "glosses/shani.d.ts", "glosses/shani-global.d.ts", - "glosses/collections.d.ts", + "glosses/collections/index.d.ts", + "glosses/collections/array_set.d.ts", + "glosses/collections/async_queue.d.ts", + "glosses/collections/avl_tree.d.ts", + "glosses/collections/binary_search_tree.d.ts", + "glosses/collections/buffer_list.d.ts", + "glosses/collections/byte_array.d.ts", + "glosses/collections/default_map.d.ts", + "glosses/collections/fast_lru.d.ts", + "glosses/collections/linked_list.d.ts", + "glosses/collections/lru.d.ts", + "glosses/collections/map_cache.d.ts", + "glosses/collections/ns_cache.d.ts", + "glosses/collections/priority_queue.d.ts", + "glosses/collections/queue.d.ts", + "glosses/collections/rb_tree.d.ts", + "glosses/collections/refcounted_cache.d.ts", + "glosses/collections/set.d.ts", + "glosses/collections/stack.d.ts", + "glosses/collections/timedout_map.d.ts", "glosses/events.d.ts", "glosses/fs.d.ts", "glosses/is.d.ts", @@ -43,16 +66,37 @@ "adone-tests.ts", "test/index.ts", "test/index-import.ts", + "test/glosses/fake.ts", + "test/glosses/application.ts", + "test/glosses/collections/array_set.ts", + "test/glosses/collections/async_queue.ts", + "test/glosses/collections/avl_tree.ts", + "test/glosses/collections/binary_search_tree.ts", + "test/glosses/collections/buffer_list.ts", + "test/glosses/collections/byte_array.ts", + "test/glosses/collections/default_map.ts", + "test/glosses/collections/fast_lru.ts", + "test/glosses/collections/linked_list.ts", + "test/glosses/collections/lru.ts", + "test/glosses/collections/map_cache.ts", + "test/glosses/collections/ns_cache.ts", + "test/glosses/collections/priority_queue.ts", + "test/glosses/collections/queue.ts", + "test/glosses/collections/rb_tree.ts", + "test/glosses/collections/refcounted_cache.ts", + "test/glosses/collections/set.ts", + "test/glosses/collections/stack.ts", + "test/glosses/collections/timedout_map.ts", "test/glosses/math/index.ts", "test/glosses/math/matrix.ts", "test/glosses/math/simd.ts", + "test/glosses/meta.ts", "test/glosses/std.ts", "test/glosses/utils.ts", "test/glosses/assertion.ts", "test/glosses/promise.ts", "test/glosses/shani.ts", "test/glosses/shani-global.ts", - "test/glosses/collections.ts", "test/glosses/events.ts", "test/glosses/fs.ts", "test/glosses/is.ts", diff --git a/types/aframe/tsconfig.json b/types/aframe/tsconfig.json index 3385a8aca7..02c0041107 100755 --- a/types/aframe/tsconfig.json +++ b/types/aframe/tsconfig.json @@ -17,7 +17,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/agenda/agenda-tests.ts b/types/agenda/agenda-tests.ts index 964eb1b836..5cd18baf76 100644 --- a/types/agenda/agenda-tests.ts +++ b/types/agenda/agenda-tests.ts @@ -1,4 +1,4 @@ -import * as Agenda from "agenda"; +import Agenda = require("agenda"); var mongoConnectionString = "mongodb://127.0.0.1/agenda"; diff --git a/types/agenda/tsconfig.json b/types/agenda/tsconfig.json index 0a553809fd..2f448c9517 100644 --- a/types/agenda/tsconfig.json +++ b/types/agenda/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/aggregate-error/tsconfig.json b/types/aggregate-error/tsconfig.json index f092ab1c3e..836ac69bbf 100644 --- a/types/aggregate-error/tsconfig.json +++ b/types/aggregate-error/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/alertify/tsconfig.json b/types/alertify/tsconfig.json index 86ae0eac3d..731efc063b 100644 --- a/types/alertify/tsconfig.json +++ b/types/alertify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/alexa-sdk/index.d.ts b/types/alexa-sdk/index.d.ts index 02def0b4d6..56278df11c 100644 --- a/types/alexa-sdk/index.d.ts +++ b/types/alexa-sdk/index.d.ts @@ -1,14 +1,15 @@ -// Type definitions for Alexa SDK for Node.js 1.0 +// Type definitions for Alexa SDK for Node.js 1.1 // Project: https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs // Definitions by: Pete Beegle // Huw // pascalwhoop // Ben // rk-7 +// Alex Malcoci // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -export function handler(event: RequestBody, context: Context, callback?: (err: any, response: any) => void): AlexaObject; +export function handler(event: RequestBody, context: Context, callback?: (err: any, response: any) => void): AlexaObject; export function CreateStateHandler(state: string, obj: any): any; export let StateString: string; export type ConfirmationStatuses = "NONE" | "DENIED" | "CONFIRMED"; @@ -23,6 +24,8 @@ export type CardType = "Standard" | "Simple" | "LinkAccount" | "AskForPermission export type HintType = "PlainText"; export type DirectiveTypes = "AudioPlayer.Play" | "AudioPlayer.Stop" | "AudioPlayer.ClearQueue" | "Display.RenderTemplate" | "Hint" | "VideoApp.Launch"; export type TextContentType = "PlainText" | "RichText"; +export type MediaErrorType = "MEDIA_ERROR_UNKNOWN" | "MEDIA_ERROR_INVALID_REQUEST" | "MEDIA_ERROR_SERVICE_UNAVAILABLE" | "MEDIA_ERROR_INTERNAL_SERVER_ERROR" | "MEDIA_ERROR_INTERNAL_DEVICE_ERROR"; +export type SystemErrorType = "INVALID_RESPONSE" | "DEVICE_COMMUNICATION_ERROR" | "INTERNAL_ERROR"; //#region Types export interface CardImage { @@ -84,7 +87,7 @@ export interface Template { listItems?: ListItem[]; } -export interface AlexaObject extends Handler { +export interface AlexaObject extends Handler { _event: any; _context: any; _callback: any; @@ -98,11 +101,11 @@ export interface AlexaObject extends Handler { execute: () => void; } -export interface Handlers { +export interface Handlers { [intent: string]: (this: Handler) => void; } -export interface Handler { +export interface Handler { on: any; emit(event: string, ...args: any[]): boolean; emitWithState: any; @@ -141,7 +144,7 @@ export interface System { apiEndpoint: string; application: Application; device: any; - user: any; + user: SessionUser; } export interface AudioPlayer { token: string; @@ -151,10 +154,32 @@ export interface AudioPlayer { */ playerActivity: AudioPlayerActivity; } -export interface RequestBody { + +export interface Display { + token: string; +} + +export interface Device { + deviceId: string; + supportedInterfaces: DeviceInterfaces; +} + +export interface DeviceInterfaces { + AudioPlayer: any; + Display: any; +} + +export interface RequestContext { + AudioPlayer?: AudioPlayer; + Display?: Display; + System: System; +} + +export interface RequestBody { version: string; session: Session; request: T; + context: RequestContext; } export interface Session { @@ -187,8 +212,94 @@ export interface SessionEndedRequest extends Request { reason?: string; } +export interface AudioPlayerPlaybackRequest extends Request { + token: string; + offsetInMilliseconds: number; +} + +export interface AudioPlayerPlaybackFailedRequest extends Request { + token: string; + error: MediaError; + currentPlaybackState: AudioPlayer; +} + +export interface MediaError { + type: MediaErrorType; + message: string; +} + +export interface SystemExceptionEncounteredRequest extends Request { + error: SystemError; + cause: ErrorCause; +} + +export interface SystemError { + type: SystemErrorType; + message: string; +} + +export interface ErrorCause { + requestId: string; +} + +export interface SkillAccountRequest extends Request { + body: SkillAccountBody; +} + +export interface SkillAccountBody { + accessToken: string; +} + +export interface SkillPermissionRequest extends Request { + body: SkillPermissionBody; +} + +export interface SkillPermissionBody { + acceptedPermissions: PermissionScope[]; +} + +export interface PermissionScope { + scope: string; +} + +export interface ListEventRequest extends Request { + body: ListEventBody; +} + +export interface ListEventBody { + listId: string; + listItemIds?: string[]; +} + export interface Request { - type: "LaunchRequest" | "IntentRequest" | "SessionEndedRequest"; + type: "LaunchRequest" + | "IntentRequest" + | "SessionEndedRequest" + + | "System.ExceptionEncountered" + + | "AudioPlayer.PlaybackStarted" + | "AudioPlayer.PlaybackFinished" + | "AudioPlayer.PlaybackStopped" + | "AudioPlayer.PlaybackNearlyFinished" + + | "PlaybackController.NextCommandIssued" + | "PlaybackController.PauseCommandIssued" + | "PlaybackController.PlayCommandIssued" + | "PlaybackController.PreviousCommandIssued" + + | "AlexaSkillEvent.SkillAccountLinked" + | "AlexaSkillEvent.SkillEnabled" + | "AlexaSkillEvent.SkillDisabled" + | "AlexaSkillEvent.SkillPermissionAccepted" + | "AlexaSkillEvent.SkillPermissionChanged" + + | "AlexaHouseholdListEvent.ListCreated" + | "AlexaHouseholdListEvent.ListUpdated" + | "AlexaHouseholdListEvent.ListDeleted" + | "AlexaHouseholdListEvent.ItemsCreated" + | "AlexaHouseholdListEvent.ItemsUpdated" + | "AlexaHouseholdListEvent.ItemsDeleted"; requestId: string; timestamp: string; locale?: string; @@ -296,7 +407,7 @@ export interface ListItemObject { /** * item version (Positive integer) */ - version?: number | string; + version: number; /** * created time (ISO 8601 time format with time zone) */ @@ -348,6 +459,38 @@ export interface ListObject { * Items that belong to this list. */ items: ListItemObject[]; + + next?: ListLinks; +} + +export interface ListLinks { + next: string; +} + +export interface ListCollection { + lists: ListObject[]; +} + +export interface CreateListParams { + name: string; + state: "active"; +} + +export interface UpdateListParams { + name: string; + state: ListObjectState; + version: number; +} + +export interface CreateListItemParams { + value: string; + status: ListItemObjectStatus; +} + +export interface UpdateListItemParams { + value: string; + status: ListItemObjectStatus; + version: number; } //#endregion @@ -545,7 +688,7 @@ export namespace templateBuilders { //#region services export namespace services { - interface ApiClient { + class ApiClient { /** * Make a POST API call to the specified uri with headers and optional body * @param uri http(s?) endpoint to call @@ -582,7 +725,7 @@ export namespace services { * Create an instance of DeviceAddressService * @param [apiClient=new ApiClient()] ApiClient */ - constructor(apiClient: ApiClient); + constructor(apiClient?: ApiClient); /** * Get full address information from Alexa Device Address API @@ -607,7 +750,7 @@ export namespace services { * Creates an instance of DirectiveService. * @param [apiClient=new ApiClient()] ApiClient */ - constructor(apiClient: ApiClient); + constructor(apiClient?: ApiClient); /** * Send the specified directiveObj to Alexa directive service @@ -624,7 +767,7 @@ export namespace services { * Create an instance of ListManagementService * @param apiClient apiClient */ - constructor(apiClient: ApiClient); + constructor(apiClient?: ApiClient); /** * Set apiEndpoint address, default is "https://api.amazonalexa.com" @@ -642,80 +785,80 @@ export namespace services { /** * Retrieve the metadata for all customer lists, including the customer's default lists * @param token bearer token for list management permission - * @returns Promise + * @returns Promise */ - getListsMetadata(token: string): Promise; + getListsMetadata(token: string): Promise; /** * Create a custom list. The new list name must be different than any existing list name - * @param listObject listObject + * @param params params * @param token bearer token for list management permission - * @returns Promise + * @returns Promise */ - createList(listObject: ListObject, token: string): Promise; + createList(params: CreateListParams, token: string): Promise; /** * Retrieve list metadata including the items in the list with requested status * @param listId unique Id associated with the list * @param itemStatus itemsStatus can be either "active" or "completed" * @param token bearer token for list management permission - * @returns Promise + * @returns Promise */ - getList(listId: string, itemStatus: ListItemObjectStatus, token: string): Promise; + getList(listId: string, itemStatus: ListItemObjectStatus, token: string): Promise; /** * Update a custom list. Only the list name or state can be updated * @param listId unique Id associated with the list - * @param listObject listObject + * @param params params * @param token bearer token for list management permission * @returns Promise */ - updateList(listId: string, listObject: ListObject, token: string): Promise; + updateList(listId: string, params: UpdateListParams, token: string): Promise; /** * Delete a custom list * @param listId unique Id associated with the list * @param token bearer token for list management permission - * @returns Promise + * @returns Promise */ - deleteList(listId: string, token: string): Promise; + deleteList(listId: string, token: string): Promise; /** * Create an item in an active list or in a default list * @param listId unique Id associated with the list - * @param listItemObject listItemObject + * @param params params * @param token bearer token for list management permission - * @returns Promise + * @returns Promise */ - createListItem(listId: string, listItemObject: ListItemObject, token: string): Promise; + createListItem(listId: string, params: CreateListItemParams, token: string): Promise; /** * Retrieve single item within any list by listId and itemId * @param listId unique Id associated with the list * @param itemId unique Id associated with the item * @param token bearer token for list management permission - * @returns Promise + * @returns Promise */ - getListItem(listId: string, itemId: string, token: string): Promise; + getListItem(listId: string, itemId: string, token: string): Promise; /** * Update an item value or item status * @param listId unique Id associated with the list * @param itemId unique Id associated with the item - * @param listItemObject listItemObject + * @param params params * @param token bearer token for list management permission - * @returns Promise + * @returns Promise */ - updateListItem(listId: string, itemId: string, listItemObject: ListItemObject, token: string): Promise; + updateListItem(listId: string, itemId: string, params: UpdateListItemParams, token: string): Promise; /** * Delete an item in the specified list * @param listId unique Id associated with the list * @param itemId unique Id associated with the item * @param token bearer token for list management permission - * @returns Promise + * @returns Promise */ - deleteListItem(listId: string, itemId: string, token: string): Promise; + deleteListItem(listId: string, itemId: string, token: string): Promise; } } //#endregion diff --git a/types/alexa-sdk/tsconfig.json b/types/alexa-sdk/tsconfig.json index d1932fa469..0fe3e93a8e 100644 --- a/types/alexa-sdk/tsconfig.json +++ b/types/alexa-sdk/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "alexa-sdk-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/alexa-voice-service/tsconfig.json b/types/alexa-voice-service/tsconfig.json index 737cccf9e6..90b1ec9310 100644 --- a/types/alexa-voice-service/tsconfig.json +++ b/types/alexa-voice-service/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/algebra.js/tsconfig.json b/types/algebra.js/tsconfig.json index e9f585ef8a..db065d64f2 100644 --- a/types/algebra.js/tsconfig.json +++ b/types/algebra.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index c56b0f8a9f..5c7026d70e 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -376,7 +376,7 @@ declare namespace algoliasearch { * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects */ - addObjects(objects: [{}], cb: (err: Error, res: any) => void): void; + addObjects(objects: {}[], cb: (err: Error, res: any) => void): void; /** * Add or replace a specific object * @param object @@ -405,7 +405,7 @@ declare namespace algoliasearch { * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects */ partialUpdateObjects( - objects: [{}], + objects: {}[], cb: (err: Error, res: any) => void ): void; /** @@ -701,7 +701,7 @@ declare namespace algoliasearch { * return {Promise} * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects */ - addObjects(objects: [{}]): Promise; + addObjects(objects: {}[]): Promise; /** * Add or replace a specific object * @param object @@ -729,7 +729,7 @@ declare namespace algoliasearch { * return {Promise} * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects */ - partialUpdateObjects(objects: [{}]): Promise; + partialUpdateObjects(objects: {}[]): Promise; /** * Delete a specific object * @param objectID @@ -1387,6 +1387,12 @@ Interface describing options available for gettings the logs * https://github.com/algolia/algoliasearch-client-js#unretrievableattributes */ unretrievableAttributes?: string[]; + /** + * List of attributes you want to use for textual search + * default: [] + * https://github.com/algolia/algoliasearch-client-js#searchableattributes + */ + searchableAttributes?: string[]; /** * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer * default: * @@ -1602,7 +1608,7 @@ Interface describing options available for gettings the logs * default: [] * https://github.com/algolia/algoliasearch-client-js#altcorrections */ - altCorrections?: [{}]; + altCorrections?: {}[]; /** * Configure the precision of the proximity ranking criterion * default: 1 diff --git a/types/algoliasearch/tsconfig.json b/types/algoliasearch/tsconfig.json index 4d7e52dd8b..41a2b8341e 100644 --- a/types/algoliasearch/tsconfig.json +++ b/types/algoliasearch/tsconfig.json @@ -1,16 +1,24 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": ["es6"], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": ["../"], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": ["index.d.ts", "algoliasearch-tests.ts"] -} + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "algoliasearch-tests.ts" + ] +} \ No newline at end of file diff --git a/types/alt/tsconfig.json b/types/alt/tsconfig.json index 82260e525d..d062b2a515 100644 --- a/types/alt/tsconfig.json +++ b/types/alt/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/amazon-product-api/tsconfig.json b/types/amazon-product-api/tsconfig.json index 060741740b..148065775e 100644 --- a/types/amazon-product-api/tsconfig.json +++ b/types/amazon-product-api/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/amcharts/tsconfig.json b/types/amcharts/tsconfig.json index 1d07459b73..83ea10e97c 100644 --- a/types/amcharts/tsconfig.json +++ b/types/amcharts/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/amplify-deferred/tsconfig.json b/types/amplify-deferred/tsconfig.json index 443772e942..2e8ba65ef8 100644 --- a/types/amplify-deferred/tsconfig.json +++ b/types/amplify-deferred/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/amplify/tsconfig.json b/types/amplify/tsconfig.json index 44daa69ba9..f6c250d148 100644 --- a/types/amplify/tsconfig.json +++ b/types/amplify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/amplitude-js/tsconfig.json b/types/amplitude-js/tsconfig.json index 0ca8f85efe..78806bc9f3 100644 --- a/types/amplitude-js/tsconfig.json +++ b/types/amplitude-js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/amqp-rpc/tsconfig.json b/types/amqp-rpc/tsconfig.json index f8bfc7aa64..29eaed2194 100644 --- a/types/amqp-rpc/tsconfig.json +++ b/types/amqp-rpc/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/amqp/tsconfig.json b/types/amqp/tsconfig.json index e73b54d700..e388306124 100644 --- a/types/amqp/tsconfig.json +++ b/types/amqp/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/amqplib/tsconfig.json b/types/amqplib/tsconfig.json index b5b83b84ce..e678b2ed30 100644 --- a/types/amqplib/tsconfig.json +++ b/types/amqplib/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/analytics-node/tsconfig.json b/types/analytics-node/tsconfig.json index 3684577e65..8a01d1d5f7 100644 --- a/types/analytics-node/tsconfig.json +++ b/types/analytics-node/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-agility/tsconfig.json b/types/angular-agility/tsconfig.json index 460060cde0..b0b8a89582 100644 --- a/types/angular-agility/tsconfig.json +++ b/types/angular-agility/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-animate/tsconfig.json b/types/angular-animate/tsconfig.json index d34d6a1d77..19a01dfff9 100644 --- a/types/angular-animate/tsconfig.json +++ b/types/angular-animate/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-block-ui/tsconfig.json b/types/angular-block-ui/tsconfig.json index f5717731be..38788cb14c 100644 --- a/types/angular-block-ui/tsconfig.json +++ b/types/angular-block-ui/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-bootstrap-calendar/tsconfig.json b/types/angular-bootstrap-calendar/tsconfig.json index 72a05b7ce7..5bcba1159b 100644 --- a/types/angular-bootstrap-calendar/tsconfig.json +++ b/types/angular-bootstrap-calendar/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-bootstrap-lightbox/tsconfig.json b/types/angular-bootstrap-lightbox/tsconfig.json index 3792bc3da5..5e8d01f684 100644 --- a/types/angular-bootstrap-lightbox/tsconfig.json +++ b/types/angular-bootstrap-lightbox/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-breadcrumb/tsconfig.json b/types/angular-breadcrumb/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/angular-breadcrumb/tsconfig.json +++ b/types/angular-breadcrumb/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/angular-clipboard/tsconfig.json b/types/angular-clipboard/tsconfig.json index 0c6a1dadaf..504fce5afd 100644 --- a/types/angular-clipboard/tsconfig.json +++ b/types/angular-clipboard/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-cookie/tsconfig.json b/types/angular-cookie/tsconfig.json index ae3ec8dd21..c4dd687a17 100644 --- a/types/angular-cookie/tsconfig.json +++ b/types/angular-cookie/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-cookies/tsconfig.json b/types/angular-cookies/tsconfig.json index d34d6a1d77..19a01dfff9 100644 --- a/types/angular-cookies/tsconfig.json +++ b/types/angular-cookies/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-deferred-bootstrap/tsconfig.json b/types/angular-deferred-bootstrap/tsconfig.json index 119199cc5a..48a0fc6c3b 100644 --- a/types/angular-deferred-bootstrap/tsconfig.json +++ b/types/angular-deferred-bootstrap/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-dialog-service/tsconfig.json b/types/angular-dialog-service/tsconfig.json index b6db392406..06a65572bf 100644 --- a/types/angular-dialog-service/tsconfig.json +++ b/types/angular-dialog-service/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-dynamic-locale/tsconfig.json b/types/angular-dynamic-locale/tsconfig.json index b117d5eabe..2669a8f2c1 100644 --- a/types/angular-dynamic-locale/tsconfig.json +++ b/types/angular-dynamic-locale/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-environment/tsconfig.json b/types/angular-environment/tsconfig.json index 35bd754e95..62fb380377 100644 --- a/types/angular-environment/tsconfig.json +++ b/types/angular-environment/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-es/tsconfig.json b/types/angular-es/tsconfig.json index 8eb4ea8925..1ef656103f 100644 --- a/types/angular-es/tsconfig.json +++ b/types/angular-es/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-feature-flags/tsconfig.json b/types/angular-feature-flags/tsconfig.json index 07b352a43c..d90297220f 100644 --- a/types/angular-feature-flags/tsconfig.json +++ b/types/angular-feature-flags/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-file-saver/tsconfig.json b/types/angular-file-saver/tsconfig.json index 60a3fb0eca..c00f267d7d 100644 --- a/types/angular-file-saver/tsconfig.json +++ b/types/angular-file-saver/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-file-upload/tsconfig.json b/types/angular-file-upload/tsconfig.json index 11194d71d0..ac8f890b89 100644 --- a/types/angular-file-upload/tsconfig.json +++ b/types/angular-file-upload/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-formly/tsconfig.json b/types/angular-formly/tsconfig.json index 3812b7cd66..7b6a686160 100644 --- a/types/angular-formly/tsconfig.json +++ b/types/angular-formly/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-fullscreen/tsconfig.json b/types/angular-fullscreen/tsconfig.json index 72a22e0897..03dc1874c4 100644 --- a/types/angular-fullscreen/tsconfig.json +++ b/types/angular-fullscreen/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-gettext/tsconfig.json b/types/angular-gettext/tsconfig.json index 43c7dc3cab..074b1ad11a 100644 --- a/types/angular-gettext/tsconfig.json +++ b/types/angular-gettext/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-google-analytics/tsconfig.json b/types/angular-google-analytics/tsconfig.json index b66432d04c..aff84bc612 100644 --- a/types/angular-google-analytics/tsconfig.json +++ b/types/angular-google-analytics/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-gridster/tsconfig.json b/types/angular-gridster/tsconfig.json index 94b4c6ceff..e722d13578 100644 --- a/types/angular-gridster/tsconfig.json +++ b/types/angular-gridster/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-growl-v2/tsconfig.json b/types/angular-growl-v2/tsconfig.json index 16ccffe41f..38d37a5922 100644 --- a/types/angular-growl-v2/tsconfig.json +++ b/types/angular-growl-v2/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-hotkeys/tsconfig.json b/types/angular-hotkeys/tsconfig.json index acb11ff247..efb5ab899b 100644 --- a/types/angular-hotkeys/tsconfig.json +++ b/types/angular-hotkeys/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "angular-hotkeys-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/angular-http-auth/tsconfig.json b/types/angular-http-auth/tsconfig.json index 61029fcc00..ac7e064e0e 100644 --- a/types/angular-http-auth/tsconfig.json +++ b/types/angular-http-auth/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-httpi/tsconfig.json b/types/angular-httpi/tsconfig.json index 64c28306cf..ea3d19611c 100644 --- a/types/angular-httpi/tsconfig.json +++ b/types/angular-httpi/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-idle/tsconfig.json b/types/angular-idle/tsconfig.json index 57cc641db8..442299d2f1 100644 --- a/types/angular-idle/tsconfig.json +++ b/types/angular-idle/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-jwt/tsconfig.json b/types/angular-jwt/tsconfig.json index b884cbc435..eb96bc8736 100644 --- a/types/angular-jwt/tsconfig.json +++ b/types/angular-jwt/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-load/tsconfig.json b/types/angular-load/tsconfig.json index ee5ee74b72..970cb503e6 100644 --- a/types/angular-load/tsconfig.json +++ b/types/angular-load/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-loading-bar/tsconfig.json b/types/angular-loading-bar/tsconfig.json index f639942629..8311dad9f5 100644 --- a/types/angular-loading-bar/tsconfig.json +++ b/types/angular-loading-bar/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-local-storage/tsconfig.json b/types/angular-local-storage/tsconfig.json index 44c357b558..5a73ac26f9 100644 --- a/types/angular-local-storage/tsconfig.json +++ b/types/angular-local-storage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-localforage/tsconfig.json b/types/angular-localforage/tsconfig.json index dc98f1186d..847bbbbda0 100644 --- a/types/angular-localforage/tsconfig.json +++ b/types/angular-localforage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-locker/tsconfig.json b/types/angular-locker/tsconfig.json index 35091c7ea8..d0fbbafb71 100644 --- a/types/angular-locker/tsconfig.json +++ b/types/angular-locker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-material/tsconfig.json b/types/angular-material/tsconfig.json index 3ecdc4851c..7184dc1fb1 100644 --- a/types/angular-material/tsconfig.json +++ b/types/angular-material/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-media-queries/tsconfig.json b/types/angular-media-queries/tsconfig.json index 6a02589dc1..80d3ac3f0c 100644 --- a/types/angular-media-queries/tsconfig.json +++ b/types/angular-media-queries/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-meteor/tsconfig.json b/types/angular-meteor/tsconfig.json index 16d4015269..62d012a4af 100644 --- a/types/angular-meteor/tsconfig.json +++ b/types/angular-meteor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-mocks/tsconfig.json b/types/angular-mocks/tsconfig.json index cfce69a898..84f176c47b 100644 --- a/types/angular-mocks/tsconfig.json +++ b/types/angular-mocks/tsconfig.json @@ -20,6 +20,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-modal/tsconfig.json b/types/angular-modal/tsconfig.json index c727f39fbb..7eb8491cd7 100644 --- a/types/angular-modal/tsconfig.json +++ b/types/angular-modal/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-notifications/tsconfig.json b/types/angular-notifications/tsconfig.json index 7186df8fd5..8914d19761 100644 --- a/types/angular-notifications/tsconfig.json +++ b/types/angular-notifications/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-notify/tsconfig.json b/types/angular-notify/tsconfig.json index a993101ea8..2a45fe4c01 100644 --- a/types/angular-notify/tsconfig.json +++ b/types/angular-notify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-oauth2/tsconfig.json b/types/angular-oauth2/tsconfig.json index 253e138f2f..6c8b2cff83 100644 --- a/types/angular-oauth2/tsconfig.json +++ b/types/angular-oauth2/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-odata-resources/tsconfig.json b/types/angular-odata-resources/tsconfig.json index cf8b87b038..bf9ce61633 100644 --- a/types/angular-odata-resources/tsconfig.json +++ b/types/angular-odata-resources/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-pdfjs-viewer/tsconfig.json b/types/angular-pdfjs-viewer/tsconfig.json index bdae87bf50..584aacaaf3 100644 --- a/types/angular-pdfjs-viewer/tsconfig.json +++ b/types/angular-pdfjs-viewer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-permission/tsconfig.json b/types/angular-permission/tsconfig.json index 80dd668340..ccc8ab9ba0 100644 --- a/types/angular-permission/tsconfig.json +++ b/types/angular-permission/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-promise-tracker/tsconfig.json b/types/angular-promise-tracker/tsconfig.json index 2e81cb6ea3..89ba7d321d 100644 --- a/types/angular-promise-tracker/tsconfig.json +++ b/types/angular-promise-tracker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-q-spread/tsconfig.json b/types/angular-q-spread/tsconfig.json index a00f0e4d5f..8b381fb83f 100644 --- a/types/angular-q-spread/tsconfig.json +++ b/types/angular-q-spread/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-resource/tsconfig.json b/types/angular-resource/tsconfig.json index 7599b3e12e..1f4598b8b9 100644 --- a/types/angular-resource/tsconfig.json +++ b/types/angular-resource/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-route/tsconfig.json b/types/angular-route/tsconfig.json index 9960b488ba..12021442e1 100644 --- a/types/angular-route/tsconfig.json +++ b/types/angular-route/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-sanitize/tsconfig.json b/types/angular-sanitize/tsconfig.json index 4ce7848518..2e1212592b 100644 --- a/types/angular-sanitize/tsconfig.json +++ b/types/angular-sanitize/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-scenario/tsconfig.json b/types/angular-scenario/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/angular-scenario/tsconfig.json +++ b/types/angular-scenario/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/angular-scroll/tsconfig.json b/types/angular-scroll/tsconfig.json index b6d6daecb2..a844a05fd7 100644 --- a/types/angular-scroll/tsconfig.json +++ b/types/angular-scroll/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-signalr-hub/tsconfig.json b/types/angular-signalr-hub/tsconfig.json index d0e69b894d..d81d1cccc6 100644 --- a/types/angular-signalr-hub/tsconfig.json +++ b/types/angular-signalr-hub/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-spinner/tsconfig.json b/types/angular-spinner/tsconfig.json index e09fc93f8e..8eebbd1455 100644 --- a/types/angular-spinner/tsconfig.json +++ b/types/angular-spinner/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-storage/tsconfig.json b/types/angular-storage/tsconfig.json index 07dc148cef..e88846bcec 100644 --- a/types/angular-storage/tsconfig.json +++ b/types/angular-storage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-strap/tsconfig.json b/types/angular-strap/tsconfig.json index 7ac157876b..da95fa04c8 100644 --- a/types/angular-strap/tsconfig.json +++ b/types/angular-strap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-toastr/tsconfig.json b/types/angular-toastr/tsconfig.json index be88b26d08..36a22e1aee 100644 --- a/types/angular-toastr/tsconfig.json +++ b/types/angular-toastr/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-toasty/tsconfig.json b/types/angular-toasty/tsconfig.json index 085335904c..f4e2c1c4d0 100644 --- a/types/angular-toasty/tsconfig.json +++ b/types/angular-toasty/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-tooltips/tsconfig.json b/types/angular-tooltips/tsconfig.json index 8465b76909..84f3606454 100644 --- a/types/angular-tooltips/tsconfig.json +++ b/types/angular-tooltips/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-touchspin/tsconfig.json b/types/angular-touchspin/tsconfig.json index 8c3d5338c4..4084b66480 100644 --- a/types/angular-touchspin/tsconfig.json +++ b/types/angular-touchspin/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-translate/tsconfig.json b/types/angular-translate/tsconfig.json index 7b3df3db88..02bb9edf7a 100644 --- a/types/angular-translate/tsconfig.json +++ b/types/angular-translate/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-ui-bootstrap/tsconfig.json b/types/angular-ui-bootstrap/tsconfig.json index 62765ca465..36174e37b6 100644 --- a/types/angular-ui-bootstrap/tsconfig.json +++ b/types/angular-ui-bootstrap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-ui-notification/tsconfig.json b/types/angular-ui-notification/tsconfig.json index 25e3769186..2b774ef2ff 100644 --- a/types/angular-ui-notification/tsconfig.json +++ b/types/angular-ui-notification/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-ui-router/tsconfig.json b/types/angular-ui-router/tsconfig.json index 83aeab8d3b..ba18a834ba 100644 --- a/types/angular-ui-router/tsconfig.json +++ b/types/angular-ui-router/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-ui-scroll/tsconfig.json b/types/angular-ui-scroll/tsconfig.json index 8fb95049e4..90fd12c708 100644 --- a/types/angular-ui-scroll/tsconfig.json +++ b/types/angular-ui-scroll/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-ui-sortable/tsconfig.json b/types/angular-ui-sortable/tsconfig.json index b96f69101e..3defe86650 100644 --- a/types/angular-ui-sortable/tsconfig.json +++ b/types/angular-ui-sortable/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-ui-tree/tsconfig.json b/types/angular-ui-tree/tsconfig.json index cb2693e910..3c8fa163c7 100644 --- a/types/angular-ui-tree/tsconfig.json +++ b/types/angular-ui-tree/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-websocket/tsconfig.json b/types/angular-websocket/tsconfig.json index 89d5cb9dc3..b24f8dfdf8 100644 --- a/types/angular-websocket/tsconfig.json +++ b/types/angular-websocket/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "angular-websocket-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/angular-wizard/tsconfig.json b/types/angular-wizard/tsconfig.json index a87aedbbe4..2409b05725 100644 --- a/types/angular-wizard/tsconfig.json +++ b/types/angular-wizard/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-xeditable/tsconfig.json b/types/angular-xeditable/tsconfig.json index 44cdeea7bf..de3ba1d092 100644 --- a/types/angular-xeditable/tsconfig.json +++ b/types/angular-xeditable/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular.throttle/tsconfig.json b/types/angular.throttle/tsconfig.json index bcee04a06f..11865e0ab8 100644 --- a/types/angular.throttle/tsconfig.json +++ b/types/angular.throttle/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular/angular-tests.ts b/types/angular/angular-tests.ts index 795e74a058..0b05400f6d 100644 --- a/types/angular/angular-tests.ts +++ b/types/angular/angular-tests.ts @@ -289,25 +289,25 @@ foo.then((x) => { // $q signature tests namespace TestQ { - interface TResult { + interface AbcObject { a: number; b: string; c: boolean; } - interface TValue { + interface EfObject { e: number; f: boolean; } - interface TOther { + interface GhObject { g: string; h: number; } - const tResult: TResult = null; - const promiseTResult: angular.IPromise = null; - const tValue: TValue = null; - const promiseTValue: angular.IPromise = null; - const tOther: TOther = null; - const promiseTOther: angular.IPromise = null; + const abcObject: AbcObject = null; + const abcObjectPromise: angular.IPromise = null; + const efObject: EfObject = null; + const efObjectPromise: angular.IPromise = null; + const ghObject: GhObject = null; + const ghObjectPromise: angular.IPromise = null; const $q: angular.IQService = null; const promiseAny: angular.IPromise = null; @@ -316,11 +316,11 @@ namespace TestQ { // $q constructor { - let result: angular.IPromise; - result = new $q((resolve: (value: TResult) => any) => {}); - result = new $q((resolve: (value: TResult) => any, reject: (value: any) => any) => {}); - result = $q((resolve: (value: TResult) => any) => {}); - result = $q((resolve: (value: TResult) => any, reject: (value: any) => any) => {}); + let result: angular.IPromise; + result = new $q((resolve: (value: AbcObject) => any) => {}); + result = new $q((resolve: (value: AbcObject) => any, reject: (value: any) => any) => {}); + result = $q((resolve: (value: AbcObject) => any) => {}); + result = $q((resolve: (value: AbcObject) => any, reject: (value: any) => any) => {}); } // $q.all @@ -332,8 +332,8 @@ namespace TestQ { $q.all([1, $q.when(2), '3']).then(([ n1, n2, n3 ]) => n1.toFixed() + n2.toFixed() + n3.slice(1)); } { - let result: angular.IPromise; - result = $q.all([promiseAny, promiseAny]); + let result: angular.IPromise; + result = $q.all([promiseAny, promiseAny]); } { let result: angular.IPromise<{[id: string]: any; }>; @@ -356,13 +356,13 @@ namespace TestQ { // $q.defer { - let result: angular.IDeferred; - result = $q.defer(); - result.resolve(tResult); + let result: angular.IDeferred; + result = $q.defer(); + result.resolve(abcObject); const anyValue: any = null; result.reject(anyValue); result.promise.then(result => { - return $q.resolve(result); + return $q.resolve(result); }); } @@ -380,10 +380,10 @@ namespace TestQ { result = $q.resolve(); } { - let result: angular.IPromise; - result = $q.resolve(tResult); - result = $q.resolve(promiseTResult); - const result2: angular.IPromise = $q.resolve(Math.random() > 0.5 ? tResult : promiseTOther); + let result: angular.IPromise; + result = $q.resolve(abcObject); + result = $q.resolve(abcObjectPromise); + const result2: angular.IPromise = $q.resolve(Math.random() > 0.5 ? abcObject : ghObjectPromise); } // $q.when @@ -392,32 +392,32 @@ namespace TestQ { result = $q.when(); } { - let result: angular.IPromise; - let resultOther: angular.IPromise; + let result: angular.IPromise; + let resultOther: angular.IPromise; - result = $q.when(tResult); - result = $q.when(promiseTResult); + result = $q.when(abcObject); + result = $q.when(abcObjectPromise); - result = $q.when(tValue, (result: TValue) => tResult); - result = $q.when(tValue, (result: TValue) => tResult, (any) => any); - result = $q.when(tValue, (result: TValue) => tResult, (any) => any, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObject); + result = $q.when(efObject, (result: EfObject) => abcObject, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObject, (any) => any, (any) => any); - result = $q.when(promiseTValue, (result: TValue) => tResult); - resultOther = $q.when(promiseTValue, (result: TValue) => tResult, (any) => tOther); - resultOther = $q.when(promiseTValue, (result: TValue) => tResult, (any) => tOther); - resultOther = $q.when(promiseTValue, (result: TValue) => tResult, (any) => tOther, (any) => any); - resultOther = $q.when(promiseTValue, (result: TValue) => tResult, (any) => promiseTOther); - resultOther = $q.when(promiseTValue, (result: TValue) => tResult, (any) => promiseTOther, (any) => any); + result = $q.when(efObjectPromise, (result: EfObject) => abcObject); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObject); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObject); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObject, (any) => any); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObjectPromise); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObjectPromise, (any) => any); - result = $q.when(tValue, (result: TValue) => promiseTResult); - result = $q.when(tValue, (result: TValue) => promiseTResult, (any) => any); - result = $q.when(tValue, (result: TValue) => promiseTResult, (any) => any, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObjectPromise); + result = $q.when(efObject, (result: EfObject) => abcObjectPromise, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObjectPromise, (any) => any, (any) => any); - result = $q.when(promiseTValue, (result: TValue) => promiseTResult); - resultOther = $q.when(promiseTValue, (result: TValue) => promiseTResult, (any) => tOther); - resultOther = $q.when(promiseTValue, (result: TValue) => promiseTResult, (any) => tOther, (any) => any); - resultOther = $q.when(promiseTValue, (result: TValue) => promiseTResult, (any) => promiseTOther); - resultOther = $q.when(promiseTValue, (result: TValue) => promiseTResult, (any) => promiseTOther, (any) => any); + result = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObject); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObject, (any) => any); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObjectPromise); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObjectPromise, (any) => any); } } @@ -440,41 +440,41 @@ httpFoo.then((response: ng.IHttpResponse) => { // Deferred signature tests namespace TestDeferred { - const any: any = null; + const anything: any = null; - interface TResult { + interface AbcObject { a: number; b: string; c: boolean; } - const tResult: TResult = null; + const abcObject: AbcObject = null; - const deferred: angular.IDeferred = null; + const deferred: angular.IDeferred = null; // deferred.resolve { let result: void; result = deferred.resolve(); - result = deferred.resolve(tResult); + result = deferred.resolve(abcObject); } // deferred.reject { let result: void; result = deferred.reject(); - result = deferred.reject(any); + result = deferred.reject(anything); } // deferred.notify { let result: void; result = deferred.notify(); - result = deferred.notify(any); + result = deferred.notify(anything); } // deferred.promise { - let result: angular.IPromise; + let result: angular.IPromise; result = deferred.promise; } } @@ -517,111 +517,189 @@ namespace TestInjector { // Promise signature tests namespace TestPromise { - const any: any = null; + const anything: any = null; - interface TResult { - kind: 'result'; + interface AbcObject { + kind: 'abc'; a: number; b: string; c: boolean; } - interface TOther { - kind: 'other'; + interface DefObject { + kind: 'def'; d: number; e: string; f: boolean; } - function isTResult(x: TResult | TOther): x is TResult { - return x.kind === 'result'; + function isAbcObject(x: AbcObject | DefObject): x is AbcObject { + return x.kind === 'abc'; } - const tresult: TResult = null; - const tresultPromise: ng.IPromise = null; - const tresultHttpPromise: ng.IHttpPromise = null; + const abcObject: AbcObject = null; + const abcObjectPromise: ng.IPromise = null; + const abcObjectHttpPromise: ng.IHttpPromise = null; - const tother: TOther = null; - const totherPromise: ng.IPromise = null; - const totherHttpPromise: ng.IHttpPromise = null; + const defObject: DefObject = null; + const defObjectPromise: ng.IPromise = null; + const defObjectHttpPromise: ng.IHttpPromise = null; - const promise: angular.IPromise = null; + const promise: angular.IPromise = null; const $q: angular.IQService = null; - const assertPromiseType = (arg: angular.IPromise) => arg; - const reject = $q.reject(); + const rejectedPromise = $q.reject(); // promise.then - assertPromiseType(promise.then((result) => any)); - assertPromiseType(promise.then((result) => any, (any) => any)); - assertPromiseType(promise.then((result) => any, (any) => any, (any) => any)); + // $ExpectType IPromise + promise.then(result => anything); + // $ExpectType IPromise + promise.then(result => anything, any => any); + // $ExpectType IPromise + promise.then(result => anything, any => any, any => any); - assertPromiseType(promise.then((result) => reject)); - assertPromiseType(promise.then((result) => reject, (any) => reject)); - assertPromiseType(promise.then((result) => reject, (any) => reject, (any) => any)); + // $ExpectType IPromise + promise.then(result => rejectedPromise); + // $ExpectType IPromise + promise.then(result => rejectedPromise, any => rejectedPromise); + // $ExpectType IPromise + promise.then(result => rejectedPromise, any => rejectedPromise, any => any); - assertPromiseType(promise.then((result) => result)); - assertPromiseType(promise.then((result) => tresult)); - assertPromiseType(promise.then((result) => tresultPromise)); - assertPromiseType(promise.then((result) => result, (any) => any)); - assertPromiseType(promise.then((result) => result, (any) => any, (any) => any)); - assertPromiseType(promise.then((result) => result, (any) => reject, (any) => any)); + // $ExpectType IPromise + promise.then(result => result); + // $ExpectType IPromise + promise.then(result => abcObject); + // $ExpectType IPromise + promise.then(result => abcObjectPromise); + // $ExpectType IPromise + promise.then(result => result, any => any); + // $ExpectType IPromise + promise.then(result => result, any => Math.random()); + // $ExpectType IPromise + promise.then(result => result, any => any, any => any); + // $ExpectType IPromise + promise.then(result => result, any => Math.random(), any => any); + // $ExpectType IPromise + promise.then(result => result, any => rejectedPromise, any => any); - assertPromiseType | TResult>(promise.then((result) => anyOf2(reject, result))); - assertPromiseType(promise.then((result) => anyOf3(result, tresultPromise, reject))); - assertPromiseType(promise.then( - (result) => anyOf3(reject, result, tresultPromise), - (reason) => anyOf3(reject, tresult, tresultPromise) - )); + // $ExpectType IPromise + promise.then(result => anyOf2(rejectedPromise, result)); + // $ExpectType IPromise + promise.then(result => anyOf3(result, abcObjectPromise, rejectedPromise)); + // $ExpectType IPromise + promise.then( + result => anyOf3(rejectedPromise, result, abcObjectPromise), + reason => anyOf3(rejectedPromise, abcObject, abcObjectPromise) + ); - assertPromiseType>(promise.then((result) => tresultHttpPromise)); + // $ExpectType IPromise> + promise.then(result => abcObjectHttpPromise); - assertPromiseType(promise.then((result) => result, (any) => tother)); - assertPromiseType | angular.IPromise | TOther | angular.IPromise>(promise.then( - (result) => anyOf3(reject, result, totherPromise), - (reason) => anyOf3(reject, tother, tresultPromise) - )); + // $ExpectType IPromise + promise.then(result => result, any => defObject); - assertPromiseType(promise.then( - (result) => anyOf3(tresultPromise, result, totherPromise) - )); + // These are broken and seemingly can't be made to work + // with the current limitations of TypeScript. - assertPromiseType(promise.then((result) => result, (any) => tother, (any) => any)); - assertPromiseType(promise.then((result) => tresultPromise, (any) => totherPromise)); - assertPromiseType(promise.then((result) => tresultPromise, (any) => totherPromise, (any) => any)); - assertPromiseType>(promise.then((result) => tresultHttpPromise, (any) => totherHttpPromise)); - assertPromiseType>(promise.then((result) => tresultHttpPromise, (any) => totherHttpPromise, (any) => any)); + // xExpectType IPromise + // promise.then(result => anyOf2(result, defObjectPromise)); + // xExpectType IPromise + // promise.then(result => anyOf3(rejectedPromise, result, defObjectPromise)); + // xExpectType IPromise + // const a4 = promise.then( + // result => anyOf3(rejectedPromise, result, defObjectPromise), + // reason => anyOf3(rejectedPromise, defObject, abcObjectPromise) + // ); - assertPromiseType(promise.then((result) => tother)); - assertPromiseType(promise.then((result) => tother, (any) => any)); - assertPromiseType(promise.then((result) => tother, (any) => any, (any) => any)); - assertPromiseType(promise.then((result) => totherPromise)); - assertPromiseType(promise.then((result) => totherPromise, (any) => any)); - assertPromiseType(promise.then((result) => totherPromise, (any) => any, (any) => any)); - assertPromiseType>(promise.then((result) => totherHttpPromise)); - assertPromiseType>(promise.then((result) => totherHttpPromise, (any) => any)); - assertPromiseType>(promise.then((result) => totherHttpPromise, (any) => any, (any) => any)); + // $ExpectType IPromise + promise.then(result => + anyOf3(abcObjectPromise, result, defObjectPromise) + ); - assertPromiseType(promise.then((result) => tresult, (any) => tother).then(ambiguous => isTResult(ambiguous) ? ambiguous.c : ambiguous.f)); + // $ExpectType IPromise + promise.then(result => result, any => defObject, any => any); + // $ExpectType IPromise + promise.then(result => abcObjectPromise, any => defObjectPromise); + // $ExpectType IPromise + promise.then(result => abcObjectPromise, any => defObjectPromise, any => any); + // $ExpectType IPromise | IHttpResponse> + promise.then(result => abcObjectHttpPromise, any => defObjectHttpPromise); + // $ExpectType IPromise | IHttpResponse> + promise.then(result => abcObjectHttpPromise, any => defObjectHttpPromise, any => any); + + // $ExpectType IPromise + promise.then(result => defObject); + // $ExpectType IPromise + promise.then(result => defObject, any => any); + // $ExpectType IPromise + promise.then(result => defObject, any => any, any => any); + // $ExpectType IPromise + promise.then(result => defObjectPromise); + // $ExpectType IPromise + promise.then(result => defObjectPromise, any => any); + // $ExpectType IPromise + promise.then(result => defObjectPromise, any => any, any => any); + // $ExpectType IPromise> + promise.then(result => defObjectHttpPromise); + // $ExpectType IPromise + promise.then(result => defObjectHttpPromise, any => any); + // $ExpectType IPromise + promise.then(result => defObjectHttpPromise, any => any, any => any); + + // $ExpectType IPromise + promise + .then(result => abcObject, any => defObject) + .then(ambiguous => (isAbcObject(ambiguous) ? ambiguous.c : ambiguous.f)); + + // promise.then + $q.reject: + + // $ExpectType IPromise + $q.resolve(true).then(result => Math.random() > 0.5 ? Math.random() : $q.reject()); + // $ExpectType IPromise + $q.resolve(true).then(result => Math.random() > 0.5 ? Math.random() : $q.reject('a')); + // $ExpectType IPromise + $q.resolve().then(() => $q.reject('a')); + // $ExpectType IPromise + $q.resolve().then(() => { + if (Math.random() > 0.5) $q.reject(); + }); // promise.catch - assertPromiseType(promise.catch((err) => err)); - assertPromiseType(promise.catch((err) => any)); - assertPromiseType(promise.catch((err) => tresult)); - assertPromiseType>(promise.catch((err) => anyOf2(tresult, reject))); - assertPromiseType(promise.catch((err) => anyOf3(tresult, tresultPromise, reject))); - assertPromiseType(promise.catch((err) => tresultPromise)); - assertPromiseType>(promise.catch((err) => tresultHttpPromise)); - assertPromiseType(promise.catch((err) => tother)); - assertPromiseType(promise.catch((err) => totherPromise)); - assertPromiseType>(promise.catch((err) => totherHttpPromise)); + // $ExpectType IPromise + promise.catch(err => err); + // $ExpectType IPromise + promise.catch(err => anything); + // $ExpectType IPromise + promise.catch(err => abcObject); + // $ExpectType IPromise + promise.catch(err => anyOf2(abcObject, rejectedPromise)); + // $ExpectType IPromise + promise.catch(err => anyOf3(abcObject, abcObjectPromise, rejectedPromise)); + // $ExpectType IPromise + promise.catch(err => abcObjectPromise); + // $ExpectType IPromise> + promise.catch(err => abcObjectHttpPromise); + // $ExpectType IPromise + promise.catch(err => defObject); + // $ExpectType IPromise + promise.catch(err => defObjectPromise); + // $ExpectType IPromise> + promise.catch(err => defObjectHttpPromise); - assertPromiseType(promise.catch((err) => tother).then(ambiguous => isTResult(ambiguous) ? ambiguous.c : ambiguous.f)); + // $ExpectType IPromise + promise + .catch(err => defObject) + .then( + ambiguous => (isAbcObject(ambiguous) ? ambiguous.c : ambiguous.f) + ); // promise.finally - assertPromiseType(promise.finally(() => any)); - assertPromiseType(promise.finally(() => tresult)); - assertPromiseType(promise.finally(() => tother)); + // $ExpectType IPromise + promise.finally(() => anything); + // $ExpectType IPromise + promise.finally(() => abcObject); + // $ExpectType IPromise + promise.finally(() => defObject); } function test_angular_forEach() { @@ -648,12 +726,12 @@ let elementReadyFn = angular.element(() => { // $timeout signature tests namespace TestTimeout { - interface TResult { + interface AbcObject { a: number; b: string; c: boolean; } - const fnTResult: (...args: any[]) => TResult = null; + const abcObjectFn: (...args: any[]) => AbcObject = null; const promiseAny: angular.IPromise = null; const $timeout: angular.ITimeoutService = null; @@ -668,13 +746,13 @@ namespace TestTimeout { result = $timeout(1, true); } { - let result: angular.IPromise; - result = $timeout(fnTResult); - result = $timeout(fnTResult, 1); - result = $timeout(fnTResult, 1, true); - result = $timeout(fnTResult, 1, true, 1); - result = $timeout(fnTResult, 1, true, 1, ''); - result = $timeout(fnTResult, 1, true, 1, '', true); + let result: angular.IPromise; + result = $timeout(abcObjectFn); + result = $timeout(abcObjectFn, 1); + result = $timeout(abcObjectFn, 1, true); + result = $timeout(abcObjectFn, 1, true, 1); + result = $timeout(abcObjectFn, 1, true, 1, ''); + result = $timeout(abcObjectFn, 1, true, 1, '', true); } // $timeout.cancel @@ -1187,6 +1265,24 @@ function NgModelControllerTyping() { }; } +// FormController +angular.module('app').directive('formDebugChecker', () => { + return { + require: '^^form', + link: (scope, el, attrs, ctrl) => { + const form = ctrl as angular.IFormController; + el.on('click', () => { + const report = [] as string[]; + angular.forEach(form.$error, (controls, validationErrorKey) => { + const names = controls.map(control => control.$name); + report.push(`${validationErrorKey}: ${controls.length} control(s) (${names.join(', ')})`); + }); + console.log(`This form has ${report.length} error(s).\n${report.join('\n')}`); + }); + } + }; +}); + let $filter: angular.IFilterService; function testFilter() { diff --git a/types/angular/index.d.ts b/types/angular/index.d.ts index 5d8b6315b0..32a5c74b52 100644 --- a/types/angular/index.d.ts +++ b/types/angular/index.d.ts @@ -357,9 +357,9 @@ declare namespace angular { $valid: boolean; $invalid: boolean; $submitted: boolean; - $error: any; - $name: string; - $pending: any; + $error: { [validationErrorKey: string]: Array }; + $name?: string; + $pending?: { [validationErrorKey: string]: Array }; $addControl(control: INgModelController | IFormController): void; $removeControl(control: INgModelController | IFormController): void; $setValidity(validationErrorKey: string, isValid: boolean, control: INgModelController | IFormController): void; @@ -388,6 +388,7 @@ declare namespace angular { $setUntouched(): void; $rollbackViewValue(): void; $commitViewValue(): void; + $processModelValue(): void; $isEmpty(value: any): boolean; $overrideModelOptions(options: INgModelOptions): void; @@ -398,8 +399,8 @@ declare namespace angular { $parsers: IModelParser[]; $formatters: IModelFormatter[]; $viewChangeListeners: IModelViewChangeListener[]; - $error: any; - $name: string; + $error: { [validationErrorKey: string]: boolean }; + $name?: string; $touched: boolean; $untouched: boolean; @@ -407,7 +408,7 @@ declare namespace angular { $validators: IModelValidators; $asyncValidators: IAsyncModelValidators; - $pending: any; + $pending?: { [validationErrorKey: string]: boolean }; $pristine: boolean; $dirty: boolean; $valid: boolean; @@ -1102,28 +1103,43 @@ declare namespace angular { interface IPromise { /** - * Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected. - * The successCallBack may return IPromise for when a $q.reject() needs to be returned - * This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method. + * Regardless of when the promise was or will be resolved or rejected, then calls one of + * the success or error callbacks asynchronously as soon as the result is available. The + * callbacks are called with a single argument: the result or rejection reason. + * Additionally, the notify callback may be called zero or more times to provide a + * progress indication, before the promise is resolved or rejected. + * The `successCallBack` may return `IPromise` for when a `$q.reject()` needs to + * be returned. + * This method returns a new promise which is resolved or rejected via the return value + * of the `successCallback`, `errorCallback`. It also notifies via the return value of + * the `notifyCallback` method. The promise can not be resolved or rejected from the + * `notifyCallback` method. */ - then(successCallback: (promiseValue: T) => IPromise|TResult, errorCallback?: null, notifyCallback?: (state: any) => any): IPromise; - then(successCallback: (promiseValue: T) => IPromise|TResult2, errorCallback?: null, notifyCallback?: (state: any) => any): IPromise; - - then(successCallback: (promiseValue: T) => IPromise|TResult, errorCallback: (reason: any) => IPromise|TCatch, notifyCallback?: (state: any) => any): IPromise; - then(successCallback: (promiseValue: T) => IPromise|TResult2, errorCallback: (reason: any) => IPromise|TCatch2, notifyCallback?: (state: any) => any): IPromise; + then( + successCallback?: + | ((value: T) => IPromise | IPromise | TResult1) + | null, + errorCallback?: + | ((reason: any) => IPromise | IPromise | TResult2) + | null, + notifyCallback?: (state: any) => any + ): IPromise; /** * Shorthand for promise.then(null, errorCallback) */ - catch(onRejected: (reason: any) => IPromise|TCatch): IPromise; - catch(onRejected: (reason: any) => IPromise|TCatch2): IPromise; + catch( + onRejected?: + | ((reason: any) => IPromise | IPromise | TResult) + | null + ): IPromise; /** * Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful to release resources or do some clean-up that needs to be done whether the promise was rejected or resolved. See the full specification for more information. * * Because finally is a reserved word in JavaScript and reserved keywords are not supported as property names by ES3, you'll need to invoke the method like promise['finally'](callback) to make your code IE8 and Android 2.x compatible. */ - finally(finallyCallback: () => any): IPromise; + finally(finallyCallback: () => void): IPromise; } interface IDeferred { diff --git a/types/angular/tsconfig.json b/types/angular/tsconfig.json index 5ce810f938..c8e218ccd3 100644 --- a/types/angular/tsconfig.json +++ b/types/angular/tsconfig.json @@ -23,6 +23,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } -} +} \ No newline at end of file diff --git a/types/angularfire/tsconfig.json b/types/angularfire/tsconfig.json index 79526d1d23..05a89bc308 100644 --- a/types/angularfire/tsconfig.json +++ b/types/angularfire/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angularlocalstorage/tsconfig.json b/types/angularlocalstorage/tsconfig.json index 18cbe35651..c3ce44e55b 100644 --- a/types/angularlocalstorage/tsconfig.json +++ b/types/angularlocalstorage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angulartics/tsconfig.json b/types/angulartics/tsconfig.json index 2cfa5bb6a9..18593f0b9c 100644 --- a/types/angulartics/tsconfig.json +++ b/types/angulartics/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/animation-frame/tsconfig.json b/types/animation-frame/tsconfig.json index 50f3aa0703..b1ec9c5358 100644 --- a/types/animation-frame/tsconfig.json +++ b/types/animation-frame/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/animejs/tsconfig.json b/types/animejs/tsconfig.json index 02c5552371..084939a4f9 100644 --- a/types/animejs/tsconfig.json +++ b/types/animejs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/annyang/tsconfig.json b/types/annyang/tsconfig.json index f16b627fac..8087bb565e 100644 --- a/types/annyang/tsconfig.json +++ b/types/annyang/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ansi-colors/tsconfig.json b/types/ansi-colors/tsconfig.json index 8a0f980cbc..7ee743c176 100644 --- a/types/ansi-colors/tsconfig.json +++ b/types/ansi-colors/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ansi-colors-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ansi-regex/tsconfig.json b/types/ansi-regex/tsconfig.json index cf1ac84a5c..67d64d91c2 100644 --- a/types/ansi-regex/tsconfig.json +++ b/types/ansi-regex/tsconfig.json @@ -7,17 +7,18 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ansi-regex-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ansi-styles/tsconfig.json b/types/ansi-styles/tsconfig.json index daf091f6ce..052e258a64 100644 --- a/types/ansi-styles/tsconfig.json +++ b/types/ansi-styles/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ansicolors/tsconfig.json b/types/ansicolors/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/ansicolors/tsconfig.json +++ b/types/ansicolors/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/any-db-transaction/tsconfig.json b/types/any-db-transaction/tsconfig.json index 70db166ef8..1eb8e09d43 100644 --- a/types/any-db-transaction/tsconfig.json +++ b/types/any-db-transaction/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/any-db/tsconfig.json b/types/any-db/tsconfig.json index 21170c7c68..b78a69c22c 100644 --- a/types/any-db/tsconfig.json +++ b/types/any-db/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/anybar/tsconfig.json b/types/anybar/tsconfig.json index 1dd62548e6..17fc096621 100644 --- a/types/anybar/tsconfig.json +++ b/types/anybar/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/anymatch/tsconfig.json b/types/anymatch/tsconfig.json index d30a18ba98..921e277144 100644 --- a/types/anymatch/tsconfig.json +++ b/types/anymatch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/apex.js/tsconfig.json b/types/apex.js/tsconfig.json index 2a67c3005a..d254229f4e 100644 --- a/types/apex.js/tsconfig.json +++ b/types/apex.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/aphrodite/tsconfig.json b/types/aphrodite/tsconfig.json index 733098707c..0794c0ff34 100644 --- a/types/aphrodite/tsconfig.json +++ b/types/aphrodite/tsconfig.json @@ -16,6 +16,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "preserve" }, "files": [ diff --git a/types/api-error-handler/api-error-handler-tests.ts b/types/api-error-handler/api-error-handler-tests.ts index 67afbb0fce..aa72342d75 100644 --- a/types/api-error-handler/api-error-handler-tests.ts +++ b/types/api-error-handler/api-error-handler-tests.ts @@ -1,4 +1,4 @@ -import * as errorHandler from 'api-error-handler'; +import errorHandler = require('api-error-handler'); import * as express from 'express'; var api = express.Router(); diff --git a/types/api-error-handler/tsconfig.json b/types/api-error-handler/tsconfig.json index 343e9007e9..7c46d54e64 100644 --- a/types/api-error-handler/tsconfig.json +++ b/types/api-error-handler/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/apigee-access/tsconfig.json b/types/apigee-access/tsconfig.json index 3a18c6594a..fabc7bafac 100644 --- a/types/apigee-access/tsconfig.json +++ b/types/apigee-access/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/apollo-codegen/tsconfig.json b/types/apollo-codegen/tsconfig.json index a793b04d75..da8da1b4e9 100644 --- a/types/apollo-codegen/tsconfig.json +++ b/types/apollo-codegen/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/app-root-path/tsconfig.json b/types/app-root-path/tsconfig.json index 0786aa8b6c..c32fe9ae27 100644 --- a/types/app-root-path/tsconfig.json +++ b/types/app-root-path/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/appdmg/tsconfig.json b/types/appdmg/tsconfig.json index f4ca0f95c5..6d729c863b 100644 --- a/types/appdmg/tsconfig.json +++ b/types/appdmg/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "appdmg-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/appframework/tsconfig.json b/types/appframework/tsconfig.json index 8ed9e604ca..aa6405cffa 100644 --- a/types/appframework/tsconfig.json +++ b/types/appframework/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/applepayjs/tsconfig.json b/types/applepayjs/tsconfig.json index 892c52bd37..b2fb66fe6e 100644 --- a/types/applepayjs/tsconfig.json +++ b/types/applepayjs/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "baseUrl": "../", "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "lib": [ "dom", "es6" diff --git a/types/appletvjs/tsconfig.json b/types/appletvjs/tsconfig.json index 44dc1a34db..e1ad39d576 100644 --- a/types/appletvjs/tsconfig.json +++ b/types/appletvjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/applicationinsights-js/tsconfig.json b/types/applicationinsights-js/tsconfig.json index db2a137f6b..8eeecc5c0f 100644 --- a/types/applicationinsights-js/tsconfig.json +++ b/types/applicationinsights-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/aqb/aqb-tests.ts b/types/aqb/aqb-tests.ts new file mode 100644 index 0000000000..5e186126fe --- /dev/null +++ b/types/aqb/aqb-tests.ts @@ -0,0 +1,151 @@ +import QB = require("aqb"); + +/* + * Most of these tests are taken directly from the examples + * in the aqbjs Github documentation. + * + * https://github.com/arangodb/aqbjs + */ + +/* + * section aqb.js + * https://github.com/arangodb/aqbjs#auto-casting-raw-data + */ +const doc = { + aString: "hello", + aDate: new Date(), + aNumber: 23, + anArray: [1, 2, 3, "potato"] +}; + +QB(doc); +QB.for('x').in('1..5').return('x'); +QB.insert(QB(doc)).into('my_collection'); + +/* + * section aqb.js + * https://github.com/arangodb/aqbjs#aql-types + */ +QB.bool(true); +QB.num("12"); +QB.int("1"); +QB.str(23); +QB.list([ 1 , 2 , 3 , 4 , 5]); +QB.obj({'some.name': 'value'}); +QB.ref("users"); + +/* + * section aqb.js + * https://github.com/arangodb/aqbjs#aql-expressions + */ +QB.range(1 , 5); +QB.get("property"); +QB.ref("user").get("property"); +QB.expr(QB.for('x').in('1..5').return('x').toAQL()); + +/* + * section aqb.js + * https://github.com/arangodb/aqbjs#aql-operations + */ +QB.and("a", "b"); +QB.ref("a").and("b"); +QB.or("a" , "b"); +QB.ref("a").or("b"); +QB.add("a" , "b"); +QB.ref("a").add("b"); +QB.plus("a" , "b"); +QB.ref("a").plus("b"); +QB.sub("a" , "b"); +QB.ref("a").sub("b"); +QB.minus("a" , "b"); +QB.ref("a").minus("b"); +QB.mul("a" , "b"); +QB.ref("a").mul("b"); +QB.times("a" , "b"); +QB.ref("a").times("b"); +QB.div("a" , "b"); +QB.ref("a").div("b"); +QB.mod("a", "b"); +QB.ref("a").mod("b"); +QB.eq("a" , "b"); +QB.ref("a").eq("b"); +QB.neq("a", "b"); +QB.ref("a").neq("b"); +QB.gt("a" , "b"); +QB.ref("a").gt("b"); +QB.gte("a" , "b"); +QB.ref("a").gte("b"); +QB.lt("a" , "b"); +QB.ref("a").lt("b"); +QB.lte("a" , "b"); +QB.ref("a").lte("b"); +QB.in("a" , "b"); +QB.ref("a").in("b"); +QB.not("a"); +QB.ref("a").not(); +QB.notIn("a" , "b"); +QB.ref("a").notIn("b"); +QB.neg("a"); +QB.ref("a").neg(); +QB.if("x" , "y" , "z"); +QB.ref("x").then("y").else("z"); +QB.fn('MY::USER::FUNC')(1, 2, 3); +QB.fn('hello')(); + +/* + * section aqb.js + * https://github.com/arangodb/aqbjs#aql-statements + */ +QB.for('doc').in('my_collection'); +QB.for('doc').in('my_collection').let('foo' , 23); +QB.for('doc').in('my_collection').let('foo' , 23); +// QB.for('doc').in('my_collection').let({a: 1, b: 2, c: 3}); +QB.for('doc').in('my_collection').return('x'); +QB.for('doc').in('my_collection').return({x: 'x'}); +QB.for('doc').in('my_collection').returnDistinct('x'); +QB.for('doc').in('my_collection').filter(QB.eq('a', 'b')); +QB.for('doc').in('my_collection').collectWithCountInto('x'); +QB.for('doc').in('my_collection').collect('x', 'y'); +// QB.for('doc').in('my_collection').collect({x: 'a', y: 'b'}); +QB.for('doc').in('my_collection').collect('x' , 'y').withCountInto('z'); +QB.for('doc').in('my_collection').collect('x' , 'y').into('z').keep('a' , 'b'); +QB.for('doc').in('my_collection').collect('x' , 'y').into('z' , 'Z'); +QB.for('doc').in('my_collection').collect('x' , 'y').into('z'); +QB.for('doc').in('my_collection').collect('x' , 'y').into('z').options('opts'); +QB.for('doc').in('my_collection').collect('x' , 'y').options('opts'); +QB.for('doc').in('my_collection').collect('x' , 'y').keep('a' , 'b'); +QB.for('doc').in('my_collection').collect('x' , 'y').sort('x', 'DESC', 'y', 'ASC'); +QB.for('doc').in('my_collection').collect('x' , 'y').limit(20); +QB.for('doc').in('my_collection').collect('x' , 'y').limit(20 , 20); +QB.for('doc').in('my_collection').remove('x'); +QB.for('doc').in('my_collection').remove('x').in('y'); +QB.for('doc').in('my_collection').remove('x').in('y').returnOld('a'); +QB.for('doc').in('my_collection').remove('x').in('y').options('opts'); +QB.upsert('x').insert('y').replace('z').in('c'); +QB.upsert('x').insert('y').replace('z').in('c').options('opts'); +QB.upsert('x').insert('y').update('z').in('c'); +QB.upsert('x').insert('y').update('z').in('c').options('opts'); +QB.insert('x').into('y'); +QB.insert('x').into('y').options('opts'); +QB.insert('x').into('y').returnNew('z'); +QB.update('x').in('y'); +QB.update('x').into('y'); +QB.update('x').with('y').in('z'); +QB.update('x').with('y').into('z'); +QB.update('x').with('y').into('z').options('opts'); +QB.update('x').in('y').options('opts'); +QB.update('x').with('y').into('z').returnNew('v'); +QB.update('x').with('y').into('z').returnOld('v'); +QB.update('x').in('y').options('opts').returnNew('v'); +QB.update('x').in('y').options('opts').returnOld('v'); + +QB.replace('x').in('y'); +QB.replace('x').into('y'); +QB.replace('x').with('y').in('z'); +QB.replace('x').with('y').into('z'); +QB.replace('x').with('y').into('z').options('opts'); +QB.replace('x').in('y').options('opts'); +QB.replace('x').with('y').into('z').returnNew('v'); +QB.replace('x').with('y').into('z').returnOld('v'); +QB.replace('x').in('y').options('opts').returnNew('v'); +QB.replace('x').in('y').options('opts').returnOld('v'); diff --git a/types/aqb/index.d.ts b/types/aqb/index.d.ts new file mode 100644 index 0000000000..eb529e9c97 --- /dev/null +++ b/types/aqb/index.d.ts @@ -0,0 +1,1105 @@ +// Type definitions for aqbjs 2.1 +// Project: https://github.com/arangodb/aqbjs +// Definitions by: Athenkosi Mase +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 +interface AqlError extends Error { + new(message: string): Error; + name: string; +} +interface Operation extends Expression { + new(): Expression; +} +interface BinaryOperation extends Operation { + new(operator: string, value1: any, value2: any): Operation; + toAQL(): string; + _operator: string; +} +interface UnaryOperation extends Expression { + new(operator: string, value: any): Expression; + toAQL(): string; + _operator: string; +} +interface SimpleReference extends Expression { + new(value: string): Expression; + toAQL(): string; + re: RegExp; + _value: string; +} +interface RawExpression extends Expression { + new(value: any): Expression; + toAQL(): string; +} +interface BooleanLiteral extends Expression { + new(value: any): Expression; + toAQL(): string; + _value: boolean; +} +interface NumberLiteral extends Expression { + new(value: any): Expression; + toAQL(): string; + re: RegExp; +} +interface IntegerLiteral extends Expression { + new(value: any): Expression; + toAQL(): string; + _value: number; +} +interface StringLiteral extends Expression { + new(value: any): Expression; + toAQL(): string; +} +interface ListLiteral extends Expression { + new(...value: any[]): Expression; + toAQL(): string; +} +interface ObjectLiteral extends Expression { + new(value: any): Expression; + toAQL(): string; + _value: object; +} +interface NAryOperation extends Operation { + new(operator: string, values: any[]): Operation; + toAQL(): string; + _operator: string; + _values: Expression[]; +} +interface RangeExpression extends Expression { + new(start: any, end?: any): Expression; + toAQL(): string; + _start: number; + _end: number; + re: RegExp; +} +interface PropertyAccess extends Expression { + new(obj: any, keys: any[]): Expression; + toAQL(): string; + _obj: Expression; + _keys: Expression[]; +} +interface TernaryOperation extends Operation { + new(operator1: string, operator2: string, value1: Expression, value2: any, value3: any): Operation; + toAQL(): string; + _operator1: string; + _operator2: string; +} +interface NullLiteral extends Expression { + new(value: any): Expression; + toAQL(): string; +} +interface Keyword extends Expression { + new(value: any): Expression; + toAQL(): string; + _value: string; + re: RegExp; +} +interface Identifier extends Expression { + new(value: any): Expression; + toAQL(): string; + _value: string; +} +interface FunctionCall extends Expression { + new(functionName: string, ...args: any[]): Expression; + toAQL(): string; + _re: RegExp; + _functionName: string; + _args: any[]; +} +interface ForExpression extends PartialStatement { + new(prev: PartialStatement, varname: any, expr: any): PartialStatement; + toAQL(): string; + _varname: Identifier; +} +interface FilterExpression extends PartialStatement { + new(prev: PartialStatement, expr: any): PartialStatement; + toAQL(): string; +} +interface Definitions { + new(...dfns: any[]): any; + toAQL(): string; + _dfns: any[]; +} +interface LetExpression extends PartialStatement { + new(prev: PartialStatement, ...dfns: any[]): PartialStatement; + toAQL(): string; + _prev: PartialStatement; + _dfns: Definitions; +} +interface CollectExpression extends PartialStatement { + new(prev: PartialStatement, dfns: any[], varname: any, intoExpr: any, keepNames: any[], options: any): PartialStatement; + toAQL(): string; + into(...newVarname: any[]): CollectExpression; + keep(...x: any[]): any; + _keep: Identifier[]; + options(newOpts: any): any; + _options: ObjectLiteral; + withCountInto(newVarname: any): CollectWithCountIntoExpression; +} +interface CollectWithCountIntoExpression extends PartialStatement { + new(prev: PartialStatement, dfns: any[], varname: any, options: any): PartialStatement; + toAQL(): string; + options(newOpts: any): any; +} +interface SortExpression extends PartialStatement { + new(prev: PartialStatement, ...args: any[]): PartialStatement; + toAQL(): string; + keywords: string[]; + _args: Keyword[]; +} +interface LimitExpression extends PartialStatement { + new(prev: PartialStatement, offset: any, count?: any): PartialStatement; + toAQL(): string; +} +interface ReturnExpression extends Expression { + new(prev: LetExpression, value: any, distinct: boolean): Expression; + toAQL(): string; + _prev: LetExpression; + _distinct: boolean; +} +interface RemoveExpression extends PartialStatement { + new(prev: PartialStatement, expr: any, collection: any, options: any): PartialStatement; + returnOld(x: any): ReturnExpression; + toAQL(): string; + options(newOpts: any): RemoveExpression; +} +interface UpsertExpression extends PartialStatement { + new(prev: PartialStatement, upsertExpr: any, insertExpr: any, replace: boolean, updateOrReplaceExpr: any, collection: any, options: any): PartialStatement; + returnNew(x: any): ReturnExpression; + returnOld(x: any): ReturnExpression; + toAQL(): string; + _updateOrReplace: string; + options(newOpts: any): UpsertExpression; +} +interface InsertExpression extends PartialStatement { + new(prev: PartialStatement, expr: any, collection: any, options: any): PartialStatement; + returnNew(x: any): ReturnExpression; + toAQL(): string; + options(newOpts: any): InsertExpression; +} +interface UpdateExpression extends PartialStatement { + new(prev: PartialStatement, expr: any, withExpr: any, collection: any, options: any): PartialStatement; + returnNew(x: any): ReturnExpression; + returnOld(x: any): ReturnExpression; + toAQL(): string; + options(newOpts: any): UpdateExpression; +} +interface ReplaceExpression extends PartialStatement { + new(prev: PartialStatement, expr: any, withExpr: any, collection: any, options: any): PartialStatement; + returnNew(x: any): ReturnExpression; + returnOld(x: any): ReturnExpression; + toAQL(): string; + options(newOpts: any): ReplaceExpression; +} +interface Expression extends PartialStatement { + /** + * Equality + * + * Creates an equality comparison from the given values. + * + * qb.eq(a, b): (a == b) + * OR: + * qbValue.eq(b): (a == b) + * + * If the values are not already values, they will be converted automatically. + * + * Examples + * + * qb.ref('x').eq('y'): (x == y) + * + * + */ + eq(x: any, y?: any): BinaryOperation; + /** + * Inequality + * + * Creates an inequality comparison from the given values. + * + * qb.neq(a, b): (a != b) + * OR: + * qbValue.neq(b): (a != b) + * + * If the values are not already values, they will be converted automatically. + * + * Examples + * + * qb.ref('x').neq('y'): (x != y) + * + */ + neq(x: any, y?: any): BinaryOperation; + /** + * Greater Than + * + * Creates a greater-than comparison from the given values. + * + * qb.gt(a, b): (a > b) + * OR + * qbValue.gt(b): (a > b) + * + * If the values are not already values, they will be converted automatically. + * + * Examples + * + * qb.ref('x').gt('y'): (x > y) + * + * + */ + gt(x: any, y?: any): BinaryOperation; + /** + * Greater Than Or Equal To + * + * Creates a greater-than-or-equal-to comparison from the given values. + * + * qb.gte(a, b): (a >= b) + * OR + * qbValue.gte(b): (a >= b) + * + * If the values are not already values, they will be converted automatically. + * + * Examples + * + * qb.ref('x').gte('y'): (x >= y) + * + * + */ + gte(x: any, y?: any): BinaryOperation; + /** + * Less Than + * + * Creates a less-than comparison from the given values. + * + * qb.lt(a, b): (a < b) + * OR + * qbValue.lt(b): (a < b) + * + * If the values are not already values, they will be converted automatically. + * + * Examples + * + * qb.ref('x').lt('y'): (x < y) + * + */ + lt(x: any, y?: any): BinaryOperation; + /** + * Less Than Or Equal To + * + * Creates a less-than-or-equal-to comparison from the given values. + * + * qb.lte(a, b): (a <= b) + * OR + * qbValue.lte(b): (a <= b) + * + * If the values are not already values, they will be converted automatically. + * + * Examples + * + * qb.ref('x').lte('y'): (x <= y) + * + */ + lte(x: any, y?: any): BinaryOperation; + /** + * Contains + * + * Creates an "in" comparison from the given values. + * + * qb.in(a, b): (a in b) + * OR: + * qbValue.in(b): (a in b) + * + * If the values are not already values, they will be converted automatically. + * + * Examples + * qb.ref('x').in('y'): (x in y) + */ + in(...x: any[]): BinaryOperation; + /** + * Negation + * + * Creates a negation from the given value. + * + * qb.not(a) => !(a) + * OR: + * qbValue.not() => !(a) + * + * If the value is not already an value, it will be converted automatically. + * + * Examples + * + * qb.not('x') => !(x) + */ + not(x?: any): UnaryOperation; + /** + * Negative Value + * + * Creates a negative value expression from the given value. + * + * qb.neg(a) => -(a) + * OR: + * qbValue.neg() => -(a) + * + * If the value is not already an AQL value, it will be converted automatically. + * + * Examples + * + * qb.neg('x') => -(x) + */ + neg(x?: any): UnaryOperation; + /** + * Negated Contains + * + * Creates a "not in" comparison from the given values. + * + * qb.notIn(a, b): (a not in b) + * OR: + * qbValue.notIn(b): (a not in b) + * + * If the values are not already values, they will be converted automatically. + * + * Examples + * + * qb.ref('x').notIn('y'): (x not in y) + */ + notIn(...x: any[]): BinaryOperation; + /** + * Boolean And + * + * Creates an "and" operation from the given values. + * + * qb.and(a, b) =>(a && b) + * OR: + * aqlValue.and(b) =>(a && b) + * + * If the values are not already AQL values, they will be converted automatically. + * This declare function can take any number of arguments. + * + * Examples + * + * qb.ref('x').and('y') =>(x && y) + */ + and(...x: any[]): NAryOperation; + /** + * Boolean Or + * + * Creates an "or" operation from the given values. + * + * qb.or(a, b): (a || b) + * OR: + * Value.or(b): (a || b) + * + * If the values are not already values, they will be converted automatically. + * + * This declare function can take any number of arguments. + */ + or(...x: any[]): NAryOperation; + /** + * Addition + * + * Creates an addition operation from the given values. + * + * qb.add(a, b): (a + b) + * OR: + * Value.add(b): (a + b) + * + * If the values are not already values, they will be converted automatically. + * This declare function can take any number of arguments. + * + * Alias: qb.plus(a, b) + * + * Examples + * + * qb.ref('x').plus('y'): (x + y) + */ + add(...x: any[]): NAryOperation; + plus(...x: any[]): NAryOperation; + /** + * Subtraction + * + * Creates a subtraction operation from the given values. + * + * qb.sub(a, b): (a - b) + * OR: + * Value.sub(b): (a - b) + * + * If the values are not already values, they will be converted automatically. + * This declare function can take any number of arguments. + * + * Alias: qb.minus(a, b) + * + * Examples + * + * qb.ref('x').minus('y'): (x - y) + */ + sub(...x: any[]): NAryOperation; + minus(...x: any[]): NAryOperation; + /** + * Multiplication + * + * Creates a multiplication operation from the given values. + * + * qb.mul(a, b): (a * b) + * OR: + * Value.mul(b): (a * b) + * + * If the values are not already values, they will be converted automatically. + * This declare function can take any number of arguments. + * + * Alias: qb.times(a, b) + * + * Examples + * + * qb.ref('x').times('y'): (x * y) + */ + mul(...x: any[]): NAryOperation; + times(...x: any[]): NAryOperation; + /** + * Division + * + * Creates a division operation from the given values. + * + * qb.div(a, b): (a / b) + * OR: + * Value.div(b): (a / b) + * + * If the values are not already values, they will be converted automatically. + * This declare function can take any number of arguments. + * + * Examples + * qb.ref('x').div('y'): (x / y) + */ + div(...x: any[]): NAryOperation; + /** + * Modulus + * + * Creates a modulus operation from the given values. + * + * qb.mod(a, b): (a % b) + * OR: + * Value.mod(b): (a % b) + * + * If the values are not already values, they will be converted automatically. + * This declare function can take any number of arguments. + * + * Examples + * qb.ref('x').mod('y'): (x % y) + */ + mod(...x: any[]): NAryOperation; + /** + * Range + * + * Creates a range expression from the given values. + * + * qb.range(value1, value2): value1..value2 + * + * OR: + * + * Value.range(value2): value1..value2 + * + * If the values are not already values, they will be converted automatically. + * Alias: qb.to(value1, value2) + * + * Examples + * + * qb(2).to(5): 2..5 + * + */ + range(...value: number[]): RangeExpression; + /** + * Property Access + * + * Creates a property access expression from the given values. + * + * qb.get(obj, key): obj[key] + * OR: + * Obj.get(key): obj[key] + * + * If the values are not already values, they will be converted automatically. + * + * Examples + * qb.ref('x').get('y'): x[y]` + * + */ + get(value: any): PropertyAccess; + /** + * Ternary(if / else) + * + * Creates a ternary expression from the given values. + * + * qb.if(condition, thenDo, elseDo): (condition ? thenDo: elseDo) + * OR: + * qbValue.then(thenDo).else(elseDo): (condition ? thenDo: elseDo) + * + * If the values are not already values, they will be converted automatically. + * + * Alias: qbValue.then(thenDo).otherwise(elseDo) + * + * Examples + * qb.ref('x').then('y').else('z'): (x ? y: z) + * + */ + then(value: any): ThenRet; +} +interface ThenRet { + else(y: any): TernaryOperation; + else_: TernaryOperation; + otherwise(y: any): TernaryOperation; +} +interface ForRet { + in(expr: any): ForExpression; + in_: ForRet["in"]; +} +/** + * PartialStatement + * + * In addition to the methods documented above, the query builder provides all methods of PartialStatement objects. + * Statement objects have a method toAQL() which returns their representation as a JavaScript string. + * + * Examples + * + * qb.for('doc').in('my_collection').return('doc._key').toAQL() + * // => FOR doc IN my_collection RETURN doc._key + */ +interface PartialStatement { + /** + * FOR expression IN collection + * + * PartialStatement::for(expression).in(collection): PartialStatement + * + * Examples + * + * _.for('doc').in('my_collection'): FOR doc IN my_collection + * + */ + for(varname: any): ForRet; + /** + * FILTER expression + * + * PartialStatement::filter(expression): PartialStatement + * + * Examples + * + * _.filter(qb.eq('a', 'b')): FILTER a == b + * + */ + filter(varname: any): FilterExpression; + /** + * LET varname = expression + * + * PartialStatement::let(varname, expression): PartialStatement + * + * Examples + * + * _.let('foo', 23): LET foo = 23 + * + * LET var1 = expr1, var2 = expr2, …, varn = exprn + * + * PartialStatement::let(definitions): PartialStatement + * + */ + let(varname: {}, expr: any): LetExpression; + /** + * COLLECT + * + * COLLECT WITH COUNT INTO varname + * PartialStatement::collectWithCountInto(varname): CollectExpression + * + * Examples + * + * _.collectWithCountInto('x'): COLLECT WITH COUNT INTO x COLLECT varname = expression + * PartialStatement::collect(varname, expression): CollectExpression + * + * _.collect('x', 'y'): COLLECT x = y COLLECT var1 = expr1, var2 = expr2, …, varn = exprn + * PartialStatement::collect(definitions): CollectExpression + * + * _.collect({x: 'a', y: 'b'}): COLLECT x = a, y = b WITH COUNT INTO varname + * CollectExpression::withCountInto(varname): CollectExpression + * + * _.withCountInto('x'): WITH COUNT INTO x INTO varname + * CollectExpression::into(varname): CollectExpression + * + * _.into('z'): INTO z KEEP ...vars + * CollectExpression::keep(...vars): CollectExpression + * + * _.into('z').keep('a', 'b'): INTO z KEEP a, b INTO varname = expression + * CollectExpression::into(varname, expression): CollectExpression + * + * _.into('x', 'y'): INTO x = y OPTIONS options + * CollectExpression::options(options): CollectExpression + * + * _.options('opts'): OPTIONS opts + * + */ + collect(varname: any, expr: any): CollectExpression; + /** + * COLLECT + * + * COLLECT WITH COUNT INTO varname + * PartialStatement::collectWithCountInto(varname): CollectExpression + * + * Examples + * + * _.collectWithCountInto('x'): COLLECT WITH COUNT INTO x COLLECT varname = expression + * PartialStatement::collect(varname, expression): CollectExpression + * + * _.collect('x', 'y'): COLLECT x = y COLLECT var1 = expr1, var2 = expr2, …, varn = exprn + * PartialStatement::collect(definitions): CollectExpression + * + * _.collect({x: 'a', y: 'b'}): COLLECT x = a, y = b WITH COUNT INTO varname + * CollectExpression::withCountInto(varname): CollectExpression + * + * _.withCountInto('x'): WITH COUNT INTO x INTO varname + * CollectExpression::into(varname): CollectExpression + * + * _.into('z'): INTO z KEEP ...vars + * CollectExpression::keep(...vars): CollectExpression + * + * _.into('z').keep('a', 'b'): INTO z KEEP a, b INTO varname = expression + * CollectExpression::into(varname, expression): CollectExpression + * + * _.into('x', 'y'): INTO x = y OPTIONS options + * CollectExpression::options(options): CollectExpression + * + * _.options('opts'): OPTIONS opts + * + */ + collectWithCountInto(varname: any): CollectWithCountIntoExpression; + /** + * SORT ...args + * + * PartialStatement::sort(...args): PartialStatement + * + * Examples + * + * _.sort('x', 'DESC', 'y', 'ASC'): SORT x DESC, y ASC + * + */ + sort(...args: any[]): SortExpression; + /** + * LIMIT offset, count + * + * PartialStatement::limit([offset,] count): PartialStatement + * + * Examples + * + * _.limit(20): LIMIT 20 + * + * _.limit(20, 20): LIMIT 20, 20 + * + */ + limit(offset: any, count?: any): LimitExpression; + /** + * RETURN expression + * + * PartialStatement::return(expression): ReturnExpression + * + * Examples + * + * _.return('x'): RETURN x + * _.return({x: 'x'}): RETURN {x: x} + * + */ + return(x: any): ReturnExpression; + /** + * RETURN DISTINCT expression + * + * PartialStatement::returnDistinct(expression): ReturnExpression + * + * Examples + * + * _.returnDistinct('x'): RETURN DISTINCT x + * + */ + returnDistinct(x: any): ReturnExpression; + /** + * REMOVE + * + * REMOVE expression IN collection + * PartialStatement::remove(expression).in(collection): RemoveExpression + * + * Alias: remove(expression).into(collection) + * + * Examples + * + * _.remove('x').in('y'): REMOVE x IN y LET varname = OLD RETURN varname + * RemoveExpression::returnOld(varname): ReturnExpression + * + * _.returnOld('z'): LET z = OLD RETURN z OPTIONS options + * RemoveExpression::options(options): RemoveExpression + * + * _.options('opts'): OPTIONS opts + * + */ + remove(expr: any): RemoveRet; + /** + * UPSERT + * + * UPSERT expression1 INSERT expression2 REPLACE expression3 IN collection + * PartialStatement::upsert(expression1).insert(expression2).replace(expression3).in(collection): UpsertExpression + * + * Alias: ….into(collection) + * + * Examples + * + * _.upsert('x').insert('y').replace('z').in('c'): UPSERT x INSERT y REPLACE z IN c + * + * UPSERT expression1 INSERT expression2 UPDATE expression3 IN collection + * PartialStatement::upsert(expression1).insert(expression2).update(expression3).in(collection): UpsertExpression + * + * Alias: ….into(collection) + * + * _.upsert('x').insert('y').update('z').in('c'): UPSERT x INSERT y UPDATE z IN c OPTIONS options + * UpsertExpression::options(options): UpsertExpression + * + * _.options('opts'): OPTIONS opts + * + */ + upsert(expr: any): UpsertRet; + /** + * INSERT + * + * INSERT expression INTO collection + * PartialStatement::insert(expression).into(collection): InsertExpression + * + * Alias: insert(expression).in(collection) + * + * Examples + * + * _.insert('x').into('y'): INSERT x INTO y OPTIONS options + * InsertExpression::options(options): InsertExpression + * + * _.options('opts'): OPTIONS opts LET varname = NEW RETURN varname + * InsertExpression::returnNew(varname): ReturnExpression + * + * _.returnNew('z'): LET z = NEW RETURN z + * + */ + insert(expr: any): InsertRet; + /** + * UPDATE + * + * UPDATE expression IN collection + * PartialStatement::update(expression).in(collection): UpdateExpression + * + * Alias: update(expression).into(collection) + * + * Examples + * + * _.update('x').in('y'): UPDATE x IN y + * + * UPDATE expression1 WITH expression2 IN collection + * PartialStatement::update(expression1).with(expression2).in(collection): UpdateExpression + * + * Alias: update(expression1).with(expression2).into(collection) + * + * _.update('x').with('y').in('z'): UPDATE x WITH y IN z OPTIONS options + * UpdateExpression::options(options): UpdateExpression + * + * _.options('opts'): OPTIONS opts LET varname = NEW RETURN varname + * UpdateExpression::returnNew(varname): ReturnExpression + * + * _.returnNew('z'): LET z = NEW RETURN z LET varname = OLD RETURN varname + * UpdateExpression::returnOld(varname): ReturnExpression + * + * _.returnOld('z'): LET z = OLD RETURN z + * + */ + update(expr: any): UpdateRetWithRet; + /** + * REPLACE + * + * REPLACE expression IN collection + * PartialStatement::replace(expression).in(collection): ReplaceExpression + * + * Alias: replace(expression).into(collection) + * + * Examples + * + * _.replace('x').in('y'): REPLACE x IN y REPLACE expression1 WITH expression2 IN collection + * PartialStatement::replace(expression1).with(expression2).in(collection): ReplaceExpression + * + * Alias: replace(expression1).with(expression2).into(collection) + * + * _.replace('x').with('y').in('z'): REPLACE x WITH y IN z OPTIONS options + * ReplaceExpression::options(options): ReplaceExpression + * + * _.options('opts'): OPTIONS opts LET varname = NEW RETURN varname + * ReplaceExpression::returnOld(varname): ReturnExpression + * + * _.returnNew('z'): LET z = NEW RETURN z LET varname = OLD RETURN varname + * ReplaceExpression::returnNew(varname): ReturnExpression + * + * _.returnOld('z'): LET z = OLD RETURN z + * + */ + replace(expr: any): ReplaceRetWithRet; +} +interface RemoveRet { + into(collection: any): RemoveExpression; + in: RemoveRet["into"]; + in_: RemoveRet["into"]; +} +interface UpsertRet { + insert(insertExpr: any): UpsertRetInsertRet; +} +interface UpsertRetInsertRet { + update(updateOrReplaceExpr: any): UpsertRetInsertRetUpdateRet; + replace: UpsertRetInsertRet["update"]; +} +interface UpsertRetInsertRetUpdateRet { + into(inCollection: any): UpsertExpression; + in: UpsertRetInsertRetUpdateRet["into"]; + in_: UpsertRetInsertRetUpdateRet["into"]; +} +interface InsertRet { + into(collection: any): InsertExpression; + in: InsertRet["into"]; + in_: InsertRet["into"]; +} +interface UpdateRetWithRet { + into(collection: any): UpdateExpression; + in: UpdateRetWithRet["into"]; + in_: UpdateRetWithRet["into"]; +} +interface ReplaceRetWithRet { + into(collection: any): ReplaceExpression; + in: ReplaceRetWithRet["into"]; + in_: ReplaceRetWithRet["into"]; +} +interface RemoveRet { + into(collection: any): RemoveExpression; + in: RemoveRet["into"]; + in_: RemoveRet["into"]; +} +interface UpsertRet { + insert(insertExpr: any): UpsertRetInsertRet; +} +interface UpsertRetInsertRet { + update(updateOrReplaceExpr: any): UpsertRetInsertRetUpdateRet; + replace: UpsertRetInsertRet["update"]; +} +interface UpsertRetInsertRetUpdateRet { + into(inCollection: any): UpsertExpression; + in: UpsertRetInsertRetUpdateRet["into"]; + in_: UpsertRetInsertRetUpdateRet["into"]; +} +interface InsertRet { + into(collection: any): InsertExpression; + in: InsertRet["into"]; + in_: InsertRet["into"]; +} +interface UpdateRetWithRet { + into(collection: any): UpdateExpression; + with(collection: any): UpdateRetWithRet; + in: UpdateRetWithRet["into"]; + in_: UpdateRetWithRet["into"]; +} +interface ReplaceRetWithRet { + into(collection: any): ReplaceExpression; + with(collection: any): ReplaceRetWithRet; + in: ReplaceRetWithRet["into"]; + in_: ReplaceRetWithRet["into"]; +} +declare function toArray(self: Expression, ...args: any[]): any[]; +declare function isQuotedString(str: string): boolean; +declare function wrapAQL(expr: Keyword): string; +declare function isValidNumber(number: number): boolean; +declare function castNumber(number: any): NumberLiteral; +declare function castBoolean(bool: any): BooleanLiteral; +declare function castString(str: any): SimpleReference | Identifier | RangeExpression | StringLiteral | Expression | PartialStatement | NullLiteral; +declare function castObject(obj: any): ObjectLiteral | ListLiteral | Identifier; +declare function autoCastToken(token: any): Expression | PartialStatement | NullLiteral; +/** + * AQLfunctions + * + * If raw JavaScript values are passed to statements, they will be wrapped in a matching declare function automatically. + * JavaScript strings wrapped in quotation marks will be wrapped in strings, all other JavaScript strings will be wrapped as simple references(see ref) + * and throw an Error if they are not well-formed. + */ +interface AQLfunctions extends Expression { + /** + * Boolean + * + * Wraps the given value as an Boolean literal. + * + * qb.bool(value) + * + * If the value is truthy, it will be converted to the Boolean true, otherwise it will be converted to the Boolean false. + * If the value is already an Boolean, its own value will be wrapped instead. + * + */ + bool(value: any): BooleanLiteral; + /** + * Number + * + * Wraps the given value as an Number literal. + * + * qb.num(value) + * + * If the value is not a JavaScript Number, it will be converted first. + * If the value does not represent a finite number, an Error will be thrown. + * If the value is already an Number or Integer, its own value will be wrapped instead. + * + */ + num(value: any): NumberLiteral; + /** + * Integer + * + * Wraps the given value as an Integer literal. + * + * qb.int(value) + * + * If the value is not a JavaScript Number, it will be converted first. + * If the value does not represent a finite integer, an Error will be thrown. + * If the value is already an Number or Integer, its own value will be wrapped instead. + * + */ + int(value: any): IntegerLiteral; + /** + * String + * + * Wraps the given value as an String literal. + * + * qb.str(value) + * + * If the value is not a JavaScript String, it will be converted first. + * If the value is a quoted string, it will be treated as a string literal. + * If the value is an object with a toAQL method, the result of calling that method will be wrapped instead. + * + * Examples + * + * 23 => "23" + * + * "some string" => "some string" + * + * '"some string"' => "\"some string\"" + * + */ + str(value: any): StringLiteral; + /** + * List + * + * Wraps the given value as an List(Array) literal. + * + * qb.list(value) + * + * If the value is not a JavaScript Array, an Error will be thrown. + * If the value is already an List, its own value will be wrapped instead. + * Any list elements that are not already values will be converted automatically. + * + */ + list(value: any[]): ListLiteral; + /** + * Object + * + * Wraps the given value as an Object literal. + * + * qb.obj(value) + * + * If the value is not a JavaScript Object, an Error will be thrown. + * If the value is already an Object, its own value will be wrapped instead. + * Any property values that are not already values will be converted automatically. + * Any keys that are quoted strings will be treated as string literals. + * Any keys that start with the character ":" will be treated as dynamic properties and must be well-formed simple references. + * Any other keys that need escaping will be quoted if necessary. + * If you need to pass in raw JavaScript objects that shouldn't be converted according to these rules, you can use the qb declare function directly instead. + * + * Examples + * + * qb.obj({'some.name': 'value'}): {"some.name": value} + * + * qb.obj({hello: world}): {hello: world} + * + * qb.obj({'"hello"': world}): {"hello": world} + * + * qb.obj({':dynamic': 'props'}): {[dynamic]: props} + * + * qb.obj({': invalid': 'key'}): throws an error(invalid is not a well-formed reference) + * + */ + obj(obj: object): ObjectLiteral; + /** + * Simple Reference + * + * Wraps a given value in an Simple Reference. + * + * qb.ref(value) + * + * If the value is not a JavaScript string or not a well-formed simple reference, an Error will be thrown. + * If the value is an ArangoCollection, its name property will be used instead. + * If the value is already an Simple Reference, its value is wrapped instead. + * + * Examples + * + * Valid values: + * + * foo + * + * foo.bar + * + * foo[*].bar + * + * foo.bar.QUX + * + * _foo._bar._qux + * + * foo1.bar2 + * + * `foo`.bar + * + * foo.`bar` + * + * Invalid values: + * + * 1foo + * + * föö + * + * foo bar + * + * foo[bar] + * + */ + ref(value: string): SimpleReference; + expr(value: any): RawExpression; + /** + * Ternary(if / else) + * + * Creates a ternary expression from the given values. + * + * qb.if(condition, thenDo, elseDo): (condition ? thenDo: elseDo) + * OR: + * qbValue.then(thenDo).else(elseDo): (condition ? thenDo: elseDo) + * + * If the values are not already values, they will be converted automatically. + * + * Alias: qbValue.then(thenDo).otherwise(elseDo) + * + * Examples + * qb.ref('x').then('y').else('z'): (x ? y: z) + * + */ + if(cond: any, then: any, otherwise: any): Expression | number; + /** + * declare Function Call + * + * Creates a functon call for the given name and arguments. + * + * qb.fn(name)(...args) + * + * If the values are not already values, they will be converted automatically. + * For built-in AQLfunctions, methods with the relevant declare function name are already provided by the query builder. + * + * Examples + * + * qb.fn('MY::USER::FUNC')(1, 2, 3): MY::USER::FUNC(1, 2, 3) + * + * qb.fn('hello')(): hello() + * + * qb.RANDOM(): RANDOM() + * + * qb.FLOOR(qb.div(5, 2)): FLOOR((5 / 2)) + * + */ + fn(functionName: string): (...arity: any[]) => FunctionCall; +} +type QBfunc = (obj: any) => AQLfunctions; +declare const QB: AQLfunctions & QBfunc; +export = QB; diff --git a/types/aqb/tsconfig.json b/types/aqb/tsconfig.json new file mode 100644 index 0000000000..09b73d3cfa --- /dev/null +++ b/types/aqb/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "lib": [ + "es2015" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "aqb-tests.ts" + ] +} \ No newline at end of file diff --git a/types/aqb/tslint.json b/types/aqb/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/aqb/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/arbiter/tsconfig.json b/types/arbiter/tsconfig.json index 674951954e..dafaff86db 100644 --- a/types/arbiter/tsconfig.json +++ b/types/arbiter/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/arcgis-js-api/tsconfig.json b/types/arcgis-js-api/tsconfig.json index 8a696a3a1e..815352a45c 100644 --- a/types/arcgis-js-api/tsconfig.json +++ b/types/arcgis-js-api/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/arcgis-js-api/v3/tsconfig.json b/types/arcgis-js-api/v3/tsconfig.json index 320cb582e1..63b40a8d0a 100644 --- a/types/arcgis-js-api/v3/tsconfig.json +++ b/types/arcgis-js-api/v3/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/arcgis-rest-api/tsconfig.json b/types/arcgis-rest-api/tsconfig.json index 346b0c1ea3..f65b0c47c2 100644 --- a/types/arcgis-rest-api/tsconfig.json +++ b/types/arcgis-rest-api/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/arcgis-to-geojson-utils/tsconfig.json b/types/arcgis-to-geojson-utils/tsconfig.json index c2ef5bf641..09d3eda55e 100644 --- a/types/arcgis-to-geojson-utils/tsconfig.json +++ b/types/arcgis-to-geojson-utils/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/archiver/archiver-tests.ts b/types/archiver/archiver-tests.ts index 536afd68c9..752d9cc944 100644 --- a/types/archiver/archiver-tests.ts +++ b/types/archiver/archiver-tests.ts @@ -1,4 +1,4 @@ -import * as Archiver from 'archiver'; +import Archiver = require('archiver'); import * as fs from 'fs'; const options: Archiver.ArchiverOptions = { @@ -30,12 +30,16 @@ archiver.abort(); archiver.pipe(writeStream); archiver.append(readStream, { name: 'archiver.d.ts' }); +archiver.append(readStream, { date: '05/05/1991' }); +archiver.append(readStream, { date: new Date() }); +archiver.append(readStream, { mode: 1 }); +archiver.append(readStream, { mode: 1, stats: new fs.Stats() }); archiver.append(readStream, {name: 'archiver.d.ts'}) .append(readStream, {name: 'archiver.d.ts'}); archiver.directory('./path', './someOtherPath'); -archiver.directory('./', "", {}); +archiver.directory('./', '', {}); archiver.directory('./', false, { name: 'test' }); archiver.directory('./', false, (entry: Archiver.EntryData) => { entry.name = "foobar"; diff --git a/types/archiver/index.d.ts b/types/archiver/index.d.ts index 8cf6eb1e92..df15f9ff65 100644 --- a/types/archiver/index.d.ts +++ b/types/archiver/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for archiver 2.0 +// Type definitions for archiver 2.1 // Project: https://github.com/archiverjs/node-archiver // Definitions by: Esri , Dolan Miu , Crevil // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +import * as fs from 'fs'; import * as stream from 'stream'; import * as glob from 'glob'; import { ZlibOptions } from 'zlib'; @@ -18,7 +19,9 @@ declare namespace archiver { interface EntryData { name?: string; prefix?: string; - stats?: string; + stats?: fs.Stats; + date?: Date | string; + mode?: number; } /** A function that lets you either opt out of including an entry (by returning false), or modify the contents of an entry as it is added (by returning an EntryData) */ diff --git a/types/archiver/tsconfig.json b/types/archiver/tsconfig.json index 71db696c82..fc2d8192fe 100644 --- a/types/archiver/tsconfig.json +++ b/types/archiver/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/archy/tsconfig.json b/types/archy/tsconfig.json index d26c849987..34f8c99625 100644 --- a/types/archy/tsconfig.json +++ b/types/archy/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/are-we-there-yet/tsconfig.json b/types/are-we-there-yet/tsconfig.json index 9df0996daa..06a8973b97 100644 --- a/types/are-we-there-yet/tsconfig.json +++ b/types/are-we-there-yet/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/argon2-browser/tsconfig.json b/types/argon2-browser/tsconfig.json index a380778b29..3faa9d5cba 100644 --- a/types/argon2-browser/tsconfig.json +++ b/types/argon2-browser/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "argon2-browser-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/argparse/tsconfig.json b/types/argparse/tsconfig.json index 49e7b03ca8..f3aac6f2d4 100644 --- a/types/argparse/tsconfig.json +++ b/types/argparse/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/args/tsconfig.json b/types/args/tsconfig.json index d287417769..7b53eb08e5 100644 --- a/types/args/tsconfig.json +++ b/types/args/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/argv/tsconfig.json b/types/argv/tsconfig.json index 2a123030fa..5158b5969d 100644 --- a/types/argv/tsconfig.json +++ b/types/argv/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/arr-union/tsconfig.json b/types/arr-union/tsconfig.json index 64a3b1efed..a5fb2d419f 100644 --- a/types/arr-union/tsconfig.json +++ b/types/arr-union/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "arr-union-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/array-find-index/tsconfig.json b/types/array-find-index/tsconfig.json index 41c6183cbe..0de263e4f3 100644 --- a/types/array-find-index/tsconfig.json +++ b/types/array-find-index/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/array-foreach/tsconfig.json b/types/array-foreach/tsconfig.json index bacc698e34..3a83dc7215 100644 --- a/types/array-foreach/tsconfig.json +++ b/types/array-foreach/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/array-uniq/tsconfig.json b/types/array-uniq/tsconfig.json index 71557f6481..ca86571124 100644 --- a/types/array-uniq/tsconfig.json +++ b/types/array-uniq/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/arrify/tsconfig.json b/types/arrify/tsconfig.json index 63d89a9c7f..2bbc02b851 100644 --- a/types/arrify/tsconfig.json +++ b/types/arrify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/artillery/tsconfig.json b/types/artillery/tsconfig.json index 0ad4bae0ee..6f8e79fafa 100644 --- a/types/artillery/tsconfig.json +++ b/types/artillery/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "artillery-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/asana/tsconfig.json b/types/asana/tsconfig.json index 452aade0b1..d4d565e8e3 100644 --- a/types/asana/tsconfig.json +++ b/types/asana/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ascii2mathml/tsconfig.json b/types/ascii2mathml/tsconfig.json index b4c4b0a21b..e41fd0d954 100644 --- a/types/ascii2mathml/tsconfig.json +++ b/types/ascii2mathml/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/asciify/tsconfig.json b/types/asciify/tsconfig.json index 5f84d92e80..08737c3b21 100644 --- a/types/asciify/tsconfig.json +++ b/types/asciify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/asenv/tsconfig.json b/types/asenv/tsconfig.json index c779998e24..d58b835636 100644 --- a/types/asenv/tsconfig.json +++ b/types/asenv/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/asn1js/tsconfig.json b/types/asn1js/tsconfig.json index 59420b595d..2a8fff0568 100644 --- a/types/asn1js/tsconfig.json +++ b/types/asn1js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/aspnet-identity-pw/tsconfig.json b/types/aspnet-identity-pw/tsconfig.json index 2d2ba0ec28..ba41002410 100644 --- a/types/aspnet-identity-pw/tsconfig.json +++ b/types/aspnet-identity-pw/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/assert-equal-jsx/tsconfig.json b/types/assert-equal-jsx/tsconfig.json index 3f476135f8..1a14c64d1c 100644 --- a/types/assert-equal-jsx/tsconfig.json +++ b/types/assert-equal-jsx/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/assert-plus/tsconfig.json b/types/assert-plus/tsconfig.json index 5c89ae8c31..8c8ef3cd0a 100644 --- a/types/assert-plus/tsconfig.json +++ b/types/assert-plus/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/assertion-error/assertion-error-tests.ts b/types/assertion-error/assertion-error-tests.ts deleted file mode 100644 index 96eb520f1c..0000000000 --- a/types/assertion-error/assertion-error-tests.ts +++ /dev/null @@ -1,14 +0,0 @@ - -import AssertionError = require('assertion-error'); - -var e: AssertionError; -var str: string; - -function foo () { - -} - -e = new AssertionError(str); -e = new AssertionError(str, {a:1, b:2}); -e = new AssertionError(str, {a:1, b:2}, foo); - diff --git a/types/assertion-error/index.d.ts b/types/assertion-error/index.d.ts deleted file mode 100644 index 8663df799d..0000000000 --- a/types/assertion-error/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Type definitions for assertion-error 1.0.0 -// Project: https://github.com/chaijs/assertion-error -// Definitions by: Bart van der Schoor -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -declare class AssertionError implements Error { - constructor(message: string, props?: any, ssf?: Function); - name: string; - message: string; - showDiff: boolean; - stack: string; -} -export = AssertionError; diff --git a/types/assertsharp/tsconfig.json b/types/assertsharp/tsconfig.json index bc2779726e..febbb6ed84 100644 --- a/types/assertsharp/tsconfig.json +++ b/types/assertsharp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/assets-webpack-plugin/assets-webpack-plugin-tests.ts b/types/assets-webpack-plugin/assets-webpack-plugin-tests.ts index 6851f853f2..b02c707d81 100644 --- a/types/assets-webpack-plugin/assets-webpack-plugin-tests.ts +++ b/types/assets-webpack-plugin/assets-webpack-plugin-tests.ts @@ -1,5 +1,5 @@ import * as webpack from 'webpack'; -import * as AssetsPlugin from 'assets-webpack-plugin'; +import AssetsPlugin = require('assets-webpack-plugin'); const config: webpack.Configuration = { plugins: [ diff --git a/types/assets-webpack-plugin/tsconfig.json b/types/assets-webpack-plugin/tsconfig.json index 3c08912345..91c958ed40 100644 --- a/types/assets-webpack-plugin/tsconfig.json +++ b/types/assets-webpack-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/async-cache/tsconfig.json b/types/async-cache/tsconfig.json index 21657ef518..6a2cbf5f82 100644 --- a/types/async-cache/tsconfig.json +++ b/types/async-cache/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/async-lock/async-lock-tests.ts b/types/async-lock/async-lock-tests.ts index 259749d4f0..c6866d270b 100644 --- a/types/async-lock/async-lock-tests.ts +++ b/types/async-lock/async-lock-tests.ts @@ -10,6 +10,14 @@ lock.acquire("key", (done) => { done(); }).then(() => { /* ... */ }); +lock.acquire("key", () => "stringValue") +// Check returned value's type is inherited properly + .then((str) => str.replace("s", "S")); + +lock.acquire("key", async () => "stringValue") +// Check returned value's type is inherited properly + .then((str) => str.replace("s", "S")); + lock.acquire([ "key1", "key2" ], (done) => { done(); }, (err, ret) => { /* ... */ }); diff --git a/types/async-lock/index.d.ts b/types/async-lock/index.d.ts index 4a19590d73..5527482748 100644 --- a/types/async-lock/index.d.ts +++ b/types/async-lock/index.d.ts @@ -1,11 +1,12 @@ // Type definitions for async-lock // Project: https://github.com/rain1017/async-lock -// Definitions by: Elisée MAURER +// Definitions by: Elisée MAURER , Alejandro // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 -interface AsyncLockDoneCallback { - (err?: Error, ret?: any): void; +interface AsyncLockDoneCallback { + (err?: Error, ret?: T): void; } interface AsyncLockOptions { @@ -18,8 +19,13 @@ interface AsyncLockOptions { declare class AsyncLock { constructor(options?: AsyncLockOptions); - acquire(key: string | string[], fn: (done: AsyncLockDoneCallback) => any, cb: AsyncLockDoneCallback, opts?: AsyncLockOptions): void; - acquire(key: string | string[], fn: (done: AsyncLockDoneCallback) => any, opts?: AsyncLockOptions): PromiseLike; + acquire(key: string | string[], + fn: (() => T | PromiseLike) | ((done: AsyncLockDoneCallback) => any), + opts?: AsyncLockOptions): PromiseLike; + acquire(key: string | string[], + fn: (done: AsyncLockDoneCallback) => any, + cb: AsyncLockDoneCallback, + opts?: AsyncLockOptions): void; isBusy(): boolean; } diff --git a/types/async-lock/tsconfig.json b/types/async-lock/tsconfig.json index 1bc997ef73..22b7c33b0b 100644 --- a/types/async-lock/tsconfig.json +++ b/types/async-lock/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/async-lock/tslint.json b/types/async-lock/tslint.json index a41bf5d19a..35039ba334 100644 --- a/types/async-lock/tslint.json +++ b/types/async-lock/tslint.json @@ -8,13 +8,11 @@ "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, diff --git a/types/async-polling/tsconfig.json b/types/async-polling/tsconfig.json index 5bcccb20f2..d3f9246be9 100644 --- a/types/async-polling/tsconfig.json +++ b/types/async-polling/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/async-retry/async-retry-tests.ts b/types/async-retry/async-retry-tests.ts new file mode 100644 index 0000000000..29c90b36c8 --- /dev/null +++ b/types/async-retry/async-retry-tests.ts @@ -0,0 +1,20 @@ +import { Options, RetryFunction, retry } from 'async-retry'; + +const o: Options = { + retries: 1, + factor: 2, + minTimeout: 3, + maxTimeout: 4, + randomize: true, + onRetry: (e: Error) => 42 +}; + +retry( + bail => 'hello', + { retries: 3 } +); + +retry( + bail => Promise.resolve(42), + { retries: 3 } +); diff --git a/types/async-retry/index.d.ts b/types/async-retry/index.d.ts new file mode 100644 index 0000000000..38d0d8aeec --- /dev/null +++ b/types/async-retry/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for async-retry 1.1 +// Project: https://github.com/zeit/async-retry#readme +// Definitions by: Albert Wu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function retry(fn: RetryFunction, opts: Options): Promise; + +export interface Options { + retries?: number; + factor?: number; + minTimeout?: number; + maxTimeout?: number; + randomize?: boolean; + onRetry?: (e: Error) => any; +} + +export type RetryFunction = (bail: (e: Error) => A, attempt: number) => A|Promise; diff --git a/types/async-retry/tsconfig.json b/types/async-retry/tsconfig.json new file mode 100644 index 0000000000..e371a3e4d6 --- /dev/null +++ b/types/async-retry/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "async-retry-tests.ts" + ] +} \ No newline at end of file diff --git a/types/localforage-cordovasqlitedriver/tslint.json b/types/async-retry/tslint.json similarity index 100% rename from types/localforage-cordovasqlitedriver/tslint.json rename to types/async-retry/tslint.json diff --git a/types/async-writer/tsconfig.json b/types/async-writer/tsconfig.json index 2b8771e48c..565754dbb5 100644 --- a/types/async-writer/tsconfig.json +++ b/types/async-writer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/async.nexttick/tsconfig.json b/types/async.nexttick/tsconfig.json index b824f94a44..71de47e764 100644 --- a/types/async.nexttick/tsconfig.json +++ b/types/async.nexttick/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/async/tsconfig.json b/types/async/tsconfig.json index 153a5471fb..3834ff925d 100644 --- a/types/async/tsconfig.json +++ b/types/async/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/asynciterator/tsconfig.json b/types/asynciterator/tsconfig.json index 8b8b919abc..345f06297a 100644 --- a/types/asynciterator/tsconfig.json +++ b/types/asynciterator/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "asynciterator-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/atmosphere.js/tsconfig.json b/types/atmosphere.js/tsconfig.json index f06f28e8f7..7c135528bc 100644 --- a/types/atmosphere.js/tsconfig.json +++ b/types/atmosphere.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/atom-keymap/tsconfig.json b/types/atom-keymap/tsconfig.json index 8a17cc061c..0da99e34c6 100644 --- a/types/atom-keymap/tsconfig.json +++ b/types/atom-keymap/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "atom-keymap-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/atom-mocha-test-runner/tsconfig.json b/types/atom-mocha-test-runner/tsconfig.json index c6e9fb20c0..78526855a4 100644 --- a/types/atom-mocha-test-runner/tsconfig.json +++ b/types/atom-mocha-test-runner/tsconfig.json @@ -16,10 +16,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "atom-mocha-test-runner-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/atom/atom-tests.ts b/types/atom/atom-tests.ts index 5fc92880f4..fbd5f6d0d8 100644 --- a/types/atom/atom-tests.ts +++ b/types/atom/atom-tests.ts @@ -1459,6 +1459,14 @@ function testPackageManager() { bool = atom.packages.isPackageDisabled("Test"); + // Activating and deactivating packages + atom.packages.activatePackage("Test").then((activePack) => { + pack = activePack; + }); + atom.packages.deactivatePackage("Test", true).then(() => { + // package is deactivated + }); + // Accessing active packages packs = atom.packages.getActivePackages(); diff --git a/types/atom/index.d.ts b/types/atom/index.d.ts index 53fa8d5749..f83f751657 100644 --- a/types/atom/index.d.ts +++ b/types/atom/index.d.ts @@ -4111,6 +4111,9 @@ export interface PackageManager { /** Activate a single package by name or path. */ activatePackage(nameOrPath: string): Promise; + /** Deactivate a single package by name or path. */ + deactivatePackage(nameOrPath: string, suppressSerialization?: boolean): Promise; + /** Triggers the given package activation hook. */ triggerActivationHook(hook: string): void; @@ -4810,7 +4813,8 @@ export class Task { * Throws an error if this task has already been terminated or if sending a * message to the child process fails. */ - send(message: string): void; + // tslint:disable-next-line:no-any + send(message: string | number | boolean | object | null | any[]): void; /** Call a function when an event is emitted by the child process. */ // tslint:disable-next-line:no-any diff --git a/types/atom/linter/index.d.ts b/types/atom/linter/index.d.ts index bf085d9859..79fc397ab8 100644 --- a/types/atom/linter/index.d.ts +++ b/types/atom/linter/index.d.ts @@ -78,5 +78,5 @@ export interface LinterProvider { scope: "file"|"project"; lintsOnChange: boolean; grammarScopes: string[]; - lint(textEditor: TextEditor): Message[]|void|Promise; + lint(textEditor: TextEditor): Message[]|null|Promise; } diff --git a/types/atom/tsconfig.json b/types/atom/tsconfig.json index a58ec7b74c..255161da5d 100644 --- a/types/atom/tsconfig.json +++ b/types/atom/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -24,4 +25,4 @@ "linter/index.d.ts", "status-bar/index.d.ts" ] -} +} \ No newline at end of file diff --git a/types/atpl/tsconfig.json b/types/atpl/tsconfig.json index 24f7da314f..29701793a6 100644 --- a/types/atpl/tsconfig.json +++ b/types/atpl/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/audiosprite/tsconfig.json b/types/audiosprite/tsconfig.json index b761c9572e..b62f115d3e 100644 --- a/types/audiosprite/tsconfig.json +++ b/types/audiosprite/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/auth0-angular/tsconfig.json b/types/auth0-angular/tsconfig.json index 42ee707301..7ebb721b12 100644 --- a/types/auth0-angular/tsconfig.json +++ b/types/auth0-angular/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/auth0-js/index.d.ts b/types/auth0-js/index.d.ts index 6110f2fe52..c7224599bd 100644 --- a/types/auth0-js/index.d.ts +++ b/types/auth0-js/index.d.ts @@ -590,7 +590,7 @@ export interface Auth0UserProfile { given_name?: string; family_name?: string; email?: string; - email_verified?: string; + email_verified?: boolean; clientID: string; gender?: string; locale?: string; diff --git a/types/auth0-js/tsconfig.json b/types/auth0-js/tsconfig.json index a813aae68d..94352610d5 100644 --- a/types/auth0-js/tsconfig.json +++ b/types/auth0-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/auth0-js/v7/tsconfig.json b/types/auth0-js/v7/tsconfig.json index e76b7d7dd8..a545bdd735 100644 --- a/types/auth0-js/v7/tsconfig.json +++ b/types/auth0-js/v7/tsconfig.json @@ -23,7 +23,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/auth0-lock/auth0-lock-tests.ts b/types/auth0-lock/auth0-lock-tests.ts index c2107b11e4..119bbb3c37 100644 --- a/types/auth0-lock/auth0-lock-tests.ts +++ b/types/auth0-lock/auth0-lock-tests.ts @@ -204,6 +204,19 @@ const selectFieldOptionsWithCallbacks : Auth0LockConstructorOptions = { new Auth0Lock(CLIENT_ID, DOMAIN, selectFieldOptionsWithCallbacks); +// test checkbox-field additional sign up field + +const checkboxFieldOptions : Auth0LockConstructorOptions = { + additionalSignUpFields: [{ + type: "checkbox", + name: "remember", + placeholder: "Remember Me", + prefill: "false" + }] + }; + + new Auth0Lock(CLIENT_ID, DOMAIN, checkboxFieldOptions); + // test Avatar options const avatarOptions : Auth0LockConstructorOptions = { diff --git a/types/auth0-lock/index.d.ts b/types/auth0-lock/index.d.ts index 8ed6b50c87..352d9c71a9 100644 --- a/types/auth0-lock/index.d.ts +++ b/types/auth0-lock/index.d.ts @@ -2,6 +2,7 @@ // Project: http://auth0.com // Definitions by: Brian Caruso // Dan Caddigan +// Larry Faudree // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -23,16 +24,37 @@ type Auth0LockAdditionalSignUpFieldPrefillCallback = type Auth0LockAdditionalSignUpFieldPrefillFunction = (callback: Auth0LockAdditionalSignUpFieldPrefillCallback) => void; -interface Auth0LockAdditionalSignUpField { +interface Auth0LockAdditionalTextSignUpField { + type?: "text"; icon?: string; name: string; options?: Auth0LockAdditionalSignUpFieldOption[] | Auth0LockAdditionalSignUpFieldOptionsFunction; placeholder: string; prefill?: string | Auth0LockAdditionalSignUpFieldPrefillFunction; - type?: "select" | "text"; validator?: (input: string) => { valid: boolean; hint?: string }; } +interface Auth0LockAdditionalSelectSignUpField { + type?: "select"; + icon?: string; + name: string; + options?: Auth0LockAdditionalSignUpFieldOption[] | Auth0LockAdditionalSignUpFieldOptionsFunction; + placeholder: string; + prefill?: string | Auth0LockAdditionalSignUpFieldPrefillFunction; + validator?: (input: string) => { valid: boolean; hint?: string }; +} + +interface Auth0LockAdditionalCheckboxSignUpField { + type?: "checkbox"; + icon?: string; + name: string; + placeholder: string; + prefill: "true" | "false"; + validator?: (input: string) => { valid: boolean, hint?: string }; +} + +type Auth0LockAdditionalSignUpField = Auth0LockAdditionalSelectSignUpField |Auth0LockAdditionalTextSignUpField |Auth0LockAdditionalCheckboxSignUpField; + type Auth0LockAvatarUrlCallback = (error: auth0.Auth0Error, url: string) => void; type Auth0LockAvatarDisplayNameCallback = (error: auth0.Auth0Error, displayName: string) => void; diff --git a/types/auth0-lock/tsconfig.json b/types/auth0-lock/tsconfig.json index 2e008d7c0d..4f1a4777b1 100644 --- a/types/auth0-lock/tsconfig.json +++ b/types/auth0-lock/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/auth0.widget/tsconfig.json b/types/auth0.widget/tsconfig.json index d18a18213b..bcf85a4971 100644 --- a/types/auth0.widget/tsconfig.json +++ b/types/auth0.widget/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/auth0/auth0-tests.ts b/types/auth0/auth0-tests.ts index e9e347cc69..0572c2b0e7 100644 --- a/types/auth0/auth0-tests.ts +++ b/types/auth0/auth0-tests.ts @@ -131,3 +131,13 @@ const retryableManagementClient = new auth0.ManagementClient({ enabled : true } }); + +management.createPasswordChangeTicket({ + connection_id: 'con_id', + email: 'test@me.co', + new_password: 'password', + result_url: 'https://www.google.com/', + ttl_sec: 86400, +}, (err: Error, data) => { + console.log(data.ticket); +}); diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index 479bf70c03..58013848f8 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for auth0 2.6 +// Type definitions for auth0 2.7 // Project: https://github.com/auth0/node-auth0 // Definitions by: Wilson Hobbs , Seth Westphal , Amiram Korach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -99,7 +99,6 @@ export interface Rule { order?: number; } - export interface Client { /** * The name of the client. @@ -257,6 +256,66 @@ export interface CreateClientGrant { scope: string[]; } +export type Strategy = + 'ad' | 'adfs' | 'amazon' | 'dropbox' | 'bitbucket' | 'aol' | 'auth0-adldap' | 'auth0-oidc' | + 'auth0' | 'baidu' | 'bitly' | 'box' | 'custom' | 'daccount' | 'dwolla' | 'email' | + 'evernote-sandbox' | 'evernote' | 'exact' | 'facebook' | 'fitbit' | 'flickr' | 'github' | + 'google-apps' | 'google-oauth2' | 'guardian' | 'instagram' | 'ip' | 'linkedin' | 'miicard' | + 'oauth1' | 'oauth2' | 'office365' | 'paypal' | 'paypal-sandbox' | 'pingfederate' | + 'planningcenter' | 'renren' | 'salesforce-community' | 'salesforce-sandbox' | 'salesforce' | + 'samlp' | 'sharepoint' | 'shopify' | 'sms' | 'soundcloud' | 'thecity-sandbox' | 'thecity' | + 'thirtysevensignals' | 'twitter' | 'untappd' | 'vkontakte' | 'waad' | 'weibo' | 'windowslive' | + 'wordpress' | 'yahoo' | 'yammer' | 'yandex'; + +export interface UpdateConnection { + options?: any; + /** + * The identifiers of the clients for which the connection is to + * be enabled. If the array is empty or the property is not + * specified, no clients are enabled. + */ + enabled_clients?: string[]; + /** + * Defines the realms for which the connection will be used + * (ie: email domains). If the array is empty or the property is + * not specified, the connection name will be added as realm. + */ + realms?: string[]; + metadata?: any; + /** + * True if the connection is domain level. + */ + is_domain_connection?: boolean; +} + +export interface Connection extends UpdateConnection { + /** + * The connection's identifier. + */ + id?: string; + /** + * The name of the connection. + */ + name?: string; + /** + * The type of the connection, related to the identity provider. + */ + strategy?: Strategy; +} + +export interface CreateConnection extends UpdateConnection { + /** + * The name of the connection. Must start and end with an + * alphanumeric character and can only contain alphanumeric + * characters and '-'. Max length 128. + */ + name: string; + /** + * The identity provider identifier for the connection. + */ + strategy: Strategy; +} + export interface User { email?: string; email_verified?: boolean; @@ -429,10 +488,16 @@ export interface UserIdParams { } export interface PasswordChangeTicketParams { - result_url: string; - user_id: string; - email: string; - new_password: string; + result_url?: string; + user_id?: string; + new_password?: string; + connection_id?: string; + email?: string; + ttl_sec?: number; +} + +export interface PasswordChangeTicketResponse { + ticket: string; } export interface EmailVerificationTicketOptions { @@ -488,23 +553,20 @@ export class ManagementClient { getClientInfo(): ClientInfo; // Connections - getConnections(): Promise; - getConnections(cb: (err: Error, data: any) => void): void; + getConnections(): Promise; + getConnections(cb: (err: Error, connections: Connection[]) => void): void; - createConnection(data: ObjectWithId): Promise; - createConnection(data: ObjectWithId, cb: (err: Error, data: any) => void): void; + createConnection(data: CreateConnection): Promise; + createConnection(data: CreateConnection, cb: (err: Error, connection: Connection) => void): void; - getConnection(params: ObjectWithId, cb: (err: Error, data: any) => void): void; - getConnection(params: ObjectWithId): Promise; + getConnection(params: ObjectWithId, cb: (err: Error, connection: Connection) => void): void; + getConnection(params: ObjectWithId): Promise; - deleteConnection(params: ObjectWithId, cb: (err: Error, data: any) => void): void; - deleteConnection(params: ObjectWithId): Promise; + deleteConnection(params: ObjectWithId, cb: (err: Error) => void): void; + deleteConnection(params: ObjectWithId): Promise; - deleteConnection(params: ObjectWithId, cb: (err: Error, data: any) => void): void; - deleteConnection(params: ObjectWithId): Promise; - - updateConnection(params: ObjectWithId, data: Data, cb: (err: Error, data: any) => void): void; - updateConnection(params: ObjectWithId, data: Data): Promise; + updateConnection(params: ObjectWithId, data: UpdateConnection, cb: (err: Error, connection: Connection) => void): void; + updateConnection(params: ObjectWithId, data: UpdateConnection): Promise; // Clients @@ -655,8 +717,8 @@ export class ManagementClient { sendEmailVerification(data: UserIdParams, cb?: (err: Error, data: any) => void): void; // Tickets - createPasswordChangeTicket(params: PasswordChangeTicketParams): Promise; - createPasswordChangeTicket(params: PasswordChangeTicketParams, cb?: (err: Error, data: any) => void): void; + createPasswordChangeTicket(params: PasswordChangeTicketParams): Promise; + createPasswordChangeTicket(params: PasswordChangeTicketParams, cb?: (err: Error, data: PasswordChangeTicketResponse) => void): void; createEmailVerificationTicket(data: EmailVerificationTicketOptions): Promise; createEmailVerificationTicket(data: EmailVerificationTicketOptions, cb?: (err: Error, data: any) => void): void; diff --git a/types/auth0/tsconfig.json b/types/auth0/tsconfig.json index dd7c60796c..035f06fa53 100644 --- a/types/auth0/tsconfig.json +++ b/types/auth0/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/auto-launch/tsconfig.json b/types/auto-launch/tsconfig.json index 952d3c0c5d..ae1120e02d 100644 --- a/types/auto-launch/tsconfig.json +++ b/types/auto-launch/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/auto-sni/auto-sni-tests.ts b/types/auto-sni/auto-sni-tests.ts index 6be54148fb..8cd17af850 100644 --- a/types/auto-sni/auto-sni-tests.ts +++ b/types/auto-sni/auto-sni-tests.ts @@ -1,4 +1,4 @@ -import * as autosni from "auto-sni"; +import autosni = require("auto-sni"); const a = autosni({ agreeTos: true, email: '', diff --git a/types/auto-sni/tsconfig.json b/types/auto-sni/tsconfig.json index 9c03900b72..9a339b5439 100644 --- a/types/auto-sni/tsconfig.json +++ b/types/auto-sni/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/autobahn/tsconfig.json b/types/autobahn/tsconfig.json index 35ca105b25..a3b68fe8fd 100644 --- a/types/autobahn/tsconfig.json +++ b/types/autobahn/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/autolinker/tsconfig.json b/types/autolinker/tsconfig.json index 7d8068c47c..14a6b796bf 100644 --- a/types/autolinker/tsconfig.json +++ b/types/autolinker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/autoprefixer-core/tsconfig.json b/types/autoprefixer-core/tsconfig.json index 91b4bc2e7c..ec4c2ed5c6 100644 --- a/types/autoprefixer-core/tsconfig.json +++ b/types/autoprefixer-core/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/autoprefixer/tsconfig.json b/types/autoprefixer/tsconfig.json index 92adece604..526589c957 100644 --- a/types/autoprefixer/tsconfig.json +++ b/types/autoprefixer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/autosize/tsconfig.json b/types/autosize/tsconfig.json index d74b3d9c37..40eb47cb0e 100644 --- a/types/autosize/tsconfig.json +++ b/types/autosize/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/avoscloud-sdk/tsconfig.json b/types/avoscloud-sdk/tsconfig.json index 2d3d9589f4..4500518b48 100644 --- a/types/avoscloud-sdk/tsconfig.json +++ b/types/avoscloud-sdk/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/awesomplete/tsconfig.json b/types/awesomplete/tsconfig.json index 74f690ea77..c7d261fded 100644 --- a/types/awesomplete/tsconfig.json +++ b/types/awesomplete/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/aws-iot-device-sdk/tsconfig.json b/types/aws-iot-device-sdk/tsconfig.json index 3fdd4b0f28..4b938cc66f 100644 --- a/types/aws-iot-device-sdk/tsconfig.json +++ b/types/aws-iot-device-sdk/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/aws-lambda-mock-context/tsconfig.json b/types/aws-lambda-mock-context/tsconfig.json index 5d1dfe3f1f..8587235c8a 100644 --- a/types/aws-lambda-mock-context/tsconfig.json +++ b/types/aws-lambda-mock-context/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index 1d756f21e0..6d0d83b210 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -1,29 +1,29 @@ -var str: string = "any string"; -var date: Date = new Date(); -var anyObj: any = { abc: 123 }; -var num: number = 5; -var error: Error = new Error(); -var b: boolean = true; -var apiGwEvtReqCtx: AWSLambda.APIGatewayEventRequestContext; -var apiGwEvt: AWSLambda.APIGatewayEvent; -var customAuthorizerEvt: AWSLambda.CustomAuthorizerEvent; -var clientCtx: AWSLambda.ClientContext; -var clientContextEnv: AWSLambda.ClientContextEnv; -var clientContextClient: AWSLambda.ClientContextClient; -var context: AWSLambda.Context; -var identity: AWSLambda.CognitoIdentity; -var proxyResult: AWSLambda.ProxyResult; -var authResponse: AWSLambda.AuthResponse; -var policyDocument: AWSLambda.PolicyDocument; -var statement: AWSLambda.Statement; -var authResponseContext: AWSLambda.AuthResponseContext; -var snsEvt: AWSLambda.SNSEvent; -var snsEvtRecs: AWSLambda.SNSEventRecord[]; -var snsEvtRec: AWSLambda.SNSEventRecord; -var snsMsg: AWSLambda.SNSMessage; -var snsMsgAttr: AWSLambda.SNSMessageAttribute; -var snsMsgAttrs: AWSLambda.SNSMessageAttributes; -var S3EvtRec: AWSLambda.S3EventRecord = { +let str: string; +let date: Date; +let anyObj: any; +let num: number; +let error: Error; +let b: boolean; +let apiGwEvtReqCtx: AWSLambda.APIGatewayEventRequestContext; +let apiGwEvt: AWSLambda.APIGatewayEvent; +let customAuthorizerEvt: AWSLambda.CustomAuthorizerEvent; +let clientCtx: AWSLambda.ClientContext; +let clientContextEnv: AWSLambda.ClientContextEnv; +let clientContextClient: AWSLambda.ClientContextClient; +let context: AWSLambda.Context; +let identity: AWSLambda.CognitoIdentity; +let proxyResult: AWSLambda.ProxyResult; +let authResponse: AWSLambda.AuthResponse; +let policyDocument: AWSLambda.PolicyDocument; +let statement: AWSLambda.Statement; +let authResponseContext: AWSLambda.AuthResponseContext; +let snsEvt: AWSLambda.SNSEvent; +let snsEvtRecs: AWSLambda.SNSEventRecord[]; +let snsEvtRec: AWSLambda.SNSEventRecord; +let snsMsg: AWSLambda.SNSMessage; +let snsMsgAttr: AWSLambda.SNSMessageAttribute; +let snsMsgAttrs: AWSLambda.SNSMessageAttributes; +const S3EvtRec: AWSLambda.S3EventRecord = { eventVersion: '2.0', eventSource: 'aws:s3', awsRegion: 'us-east-1', @@ -32,7 +32,7 @@ var S3EvtRec: AWSLambda.S3EventRecord = { userIdentity: { principalId: 'AIDAJDPLRKLG7UEXAMPLE' }, - requestParameters:{ + requestParameters: { sourceIPAddress: '127.0.0.1' }, responseElements: { @@ -59,14 +59,15 @@ var S3EvtRec: AWSLambda.S3EventRecord = { } }; -var S3CreateEvent: AWSLambda.S3CreateEvent = { +const S3CreateEvent: AWSLambda.S3CreateEvent = { Records: [S3EvtRec] }; -var cognitoUserPoolEvent: AWSLambda.CognitoUserPoolEvent; -var cloudformationCustomResourceEvent: AWSLambda.CloudFormationCustomResourceEvent; -var cloudformationCustomResourceResponse: AWSLambda.CloudFormationCustomResourceResponse; -var cloudwatchLogsEvent: AWSLambda.CloudWatchLogsEvent; -var cloudwatchLogsDecodedData: AWSLambda.CloudWatchLogsDecodedData; +declare const cognitoUserPoolEvent: AWSLambda.CognitoUserPoolEvent; +declare const cloudformationCustomResourceEvent: AWSLambda.CloudFormationCustomResourceEvent; +declare const cloudformationCustomResourceResponse: AWSLambda.CloudFormationCustomResourceResponse; +declare const cloudwatchLogsEvent: AWSLambda.CloudWatchLogsEvent; +declare const cloudwatchLogsDecodedData: AWSLambda.CloudWatchLogsDecodedData; +declare const scheduledEvent: AWSLambda.ScheduledEvent; /* API Gateway Event request context */ str = apiGwEvtReqCtx.accountId; @@ -112,7 +113,7 @@ str = apiGwEvt.stageVariables["example"]; apiGwEvtReqCtx = apiGwEvt.requestContext; /* DynamoDB Stream Event */ -var dynamoDBStreamEvent: AWSLambda.DynamoDBStreamEvent = { +const dynamoDBStreamEvent: AWSLambda.DynamoDBStreamEvent = { Records: [ { eventID: '1', @@ -265,13 +266,13 @@ policyDocument = { authResponse = { principalId: str, - policyDocument: policyDocument, + policyDocument, context: authResponseContext }; authResponse = { principalId: str, - policyDocument: policyDocument + policyDocument, }; // CognitoUserPoolEvent @@ -290,6 +291,13 @@ cognitoUserPoolEvent.triggerSource === "CustomMessage_Authentication"; cognitoUserPoolEvent.triggerSource === "DefineAuthChallenge_Authentication"; cognitoUserPoolEvent.triggerSource === "CreateAuthChallenge_Authentication"; cognitoUserPoolEvent.triggerSource === "VerifyAuthChallengeResponse_Authentication"; +cognitoUserPoolEvent.triggerSource === "PreSignUp_AdminCreateUser"; +cognitoUserPoolEvent.triggerSource === "PostConfirmation_ConfirmForgotPassword"; +cognitoUserPoolEvent.triggerSource === "TokenGeneration_HostedAuth"; +cognitoUserPoolEvent.triggerSource === "TokenGeneration_Authentication"; +cognitoUserPoolEvent.triggerSource === "TokenGeneration_NewPasswordChallenge"; +cognitoUserPoolEvent.triggerSource === "TokenGeneration_AuthenticateDevice"; +cognitoUserPoolEvent.triggerSource === "TokenGeneration_RefreshTokens"; str = cognitoUserPoolEvent.region; str = cognitoUserPoolEvent.userPoolId; str = cognitoUserPoolEvent.userName; @@ -350,6 +358,15 @@ str = cloudformationCustomResourceResponse.RequestId; str = cloudformationCustomResourceResponse.StackId; str = cloudformationCustomResourceResponse.Status; +/* ScheduledEvent */ +str = scheduledEvent.account; +anyObj = scheduledEvent.detail; +str = scheduledEvent.id; +str = scheduledEvent.region; +str = scheduledEvent.resources[0]; +str = scheduledEvent.source; +str = scheduledEvent.time; + /* Context */ b = context.callbackWaitsForEmptyEventLoop; str = context.functionName; @@ -425,67 +442,67 @@ function customAuthorizerCallback(cb: AWSLambda.CustomAuthorizerCallback) { } /* CloudFront events, see http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html */ -var CloudFrontRequestEvent: AWSLambda.CloudFrontRequestEvent = { - "Records": [ +const CloudFrontRequestEvent: AWSLambda.CloudFrontRequestEvent = { + Records: [ { - "cf": { - "config": { - "distributionId": "EDFDVBD6EXAMPLE", - "requestId": "MRVMF7KydIvxMWfJIglgwHQwZsbG2IhRJ07sn9AkKUFSHS9EXAMPLE==" + cf: { + config: { + distributionId: "EDFDVBD6EXAMPLE", + requestId: "MRVMF7KydIvxMWfJIglgwHQwZsbG2IhRJ07sn9AkKUFSHS9EXAMPLE==" }, - "request": { - "clientIp": "2001:0db8:85a3:0:0:8a2e:0370:7334", - "method": "GET", - "uri": "/picture.jpg", - "querystring": "size=large", - "headers": { - "host": [ + request: { + clientIp: "2001:0db8:85a3:0:0:8a2e:0370:7334", + method: "GET", + uri: "/picture.jpg", + querystring: "size=large", + headers: { + host: [ { - "key": "Host", - "value": "d111111abcdef8.cloudfront.net" + key: "Host", + value: "d111111abcdef8.cloudfront.net" } ], "user-agent": [ { - "key": "User-Agent", - "value": "curl/7.51.0" + key: "User-Agent", + value: "curl/7.51.0" } ] }, - "origin": { - "custom": { - "customHeaders": { + origin: { + custom: { + customHeaders: { "my-origin-custom-header": [ { - "key": "My-Origin-Custom-Header", - "value": "Test" + key: "My-Origin-Custom-Header", + value: "Test" } ] }, - "domainName": "example.com", - "keepaliveTimeout": 5, - "path": "/custom_path", - "port": 443, - "protocol": "https", - "readTimeout": 5, - "sslProtocols": [ + domainName: "example.com", + keepaliveTimeout: 5, + path: "/custom_path", + port: 443, + protocol: "https", + readTimeout: 5, + sslProtocols: [ "TLSv1", "TLSv1.1" ] }, - "s3": { - "authMethod": "origin-access-identity", - "customHeaders": { + s3: { + authMethod: "origin-access-identity", + customHeaders: { "my-origin-custom-header": [ { - "key": "My-Origin-Custom-Header", - "value": "Test" + key: "My-Origin-Custom-Header", + value: "Test" } ] }, - "domainName": "my-bucket.s3.amazonaws.com", - "path": "/s3_path", - "region": "us-east-1" + domainName: "my-bucket.s3.amazonaws.com", + path: "/s3_path", + region: "us-east-1" } } } @@ -494,52 +511,52 @@ var CloudFrontRequestEvent: AWSLambda.CloudFrontRequestEvent = { ] }; -var CloudFrontResponseEvent: AWSLambda.CloudFrontResponseEvent = { - "Records": [ +const CloudFrontResponseEvent: AWSLambda.CloudFrontResponseEvent = { + Records: [ { - "cf": { - "config": { - "distributionId": "EDFDVBD6EXAMPLE", - "requestId": "xGN7KWpVEmB9Dp7ctcVFQC4E-nrcOcEKS3QyAez--06dV7TEXAMPLE==" + cf: { + config: { + distributionId: "EDFDVBD6EXAMPLE", + requestId: "xGN7KWpVEmB9Dp7ctcVFQC4E-nrcOcEKS3QyAez--06dV7TEXAMPLE==" }, - "request": { - "clientIp": "2001:0db8:85a3:0:0:8a2e:0370:7334", - "method": "GET", - "uri": "/picture.jpg", - "querystring": "size=large", - "headers": { - "host": [ + request: { + clientIp: "2001:0db8:85a3:0:0:8a2e:0370:7334", + method: "GET", + uri: "/picture.jpg", + querystring: "size=large", + headers: { + host: [ { - "key": "Host", - "value": "d111111abcdef8.cloudfront.net" + key: "Host", + value: "d111111abcdef8.cloudfront.net" } ], "user-agent": [ { - "key": "User-Agent", - "value": "curl/7.18.1" + key: "User-Agent", + value: "curl/7.18.1" } ] } }, - "response": { - "status": "200", - "statusDescription": "OK", - "headers": { - "server": [ + response: { + status: "200", + statusDescription: "OK", + headers: { + server: [ { - "key": "Server", - "value": "MyCustomOrigin" + key: "Server", + value: "MyCustomOrigin" } ], "set-cookie": [ { - "key": "Set-Cookie", - "value": "theme=light" + key: "Set-Cookie", + value: "theme=light" }, { - "key": "Set-Cookie", - "value": "sessionToken=abc123; Expires=Wed, 09 Jun 2021 10:18:14 GMT" + key: "Set-Cookie", + value: "sessionToken=abc123; Expires=Wed, 09 Jun 2021 10:18:14 GMT" } ] } diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index 320cf562f8..09070fb13c 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -12,14 +12,16 @@ // Daniel Cottone // Kostya Misura // Markus Tacker +// Palmi Valgeirsson +// Danilo Raisi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 // API Gateway "event" request context -interface APIGatewayEventRequestContext { +export interface APIGatewayEventRequestContext { accountId: string; apiId: string; - authorizer?: AuthResponseContext | null | undefined; + authorizer?: AuthResponseContext | null; httpMethod: string; identity: { accessKey: string | null; @@ -34,15 +36,16 @@ interface APIGatewayEventRequestContext { user: string | null; userAgent: string | null; userArn: string | null; - }, + }; stage: string; requestId: string; + requestTimeEpoch: number; resourceId: string; resourcePath: string; } // API Gateway "event" -interface APIGatewayEvent { +export interface APIGatewayEvent { body: string | null; headers: { [name: string]: string }; httpMethod: string; @@ -56,7 +59,7 @@ interface APIGatewayEvent { } // API Gateway CustomAuthorizer "event" -interface CustomAuthorizerEvent { +export interface CustomAuthorizerEvent { type: string; methodArn: string; authorizationToken?: string; @@ -68,22 +71,22 @@ interface CustomAuthorizerEvent { // Context // http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_AttributeValue.html -interface AttributeValue { +export interface AttributeValue { B?: string; - BS?: Array; + BS?: string[]; BOOL?: boolean; - L?: Array; + L?: AttributeValue[]; M?: { [id: string]: AttributeValue }; N?: string; - NS?: Array; + NS?: string[]; NULL?: boolean; S?: string; - SS?: Array; + SS?: string[]; } // Context // http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_StreamRecord.html -interface StreamRecord { +export interface StreamRecord { ApproximateCreationTime?: number; Keys?: { [key: string]: AttributeValue }; NewImage?: { [key: string]: AttributeValue }; @@ -95,7 +98,7 @@ interface StreamRecord { // Context // http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_Record.html -interface DynamoDBRecord { +export interface DynamoDBRecord { awsRegion?: string; dynamodb?: StreamRecord; eventID?: string; @@ -109,21 +112,21 @@ interface DynamoDBRecord { // AWS Lambda Stream event // Context // http://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-ddb-update -interface DynamoDBStreamEvent { - Records: Array; +export interface DynamoDBStreamEvent { + Records: DynamoDBRecord[]; } // SNS "event" -interface SNSMessageAttribute { +export interface SNSMessageAttribute { Type: string; Value: string; } -interface SNSMessageAttributes { +export interface SNSMessageAttributes { [name: string]: SNSMessageAttribute; } -interface SNSMessage { +export interface SNSMessage { SignatureVersion: string; Timestamp: string; Signature: string; @@ -137,37 +140,37 @@ interface SNSMessage { Subject: string; } -interface SNSEventRecord { +export interface SNSEventRecord { EventVersion: string; EventSubscriptionArn: string; EventSource: string; Sns: SNSMessage; } -interface SNSEvent { - Records: Array; +export interface SNSEvent { + Records: SNSEventRecord[]; } /** * S3Create event * https://docs.aws.amazon.com/AmazonS3/latest/dev/notification-content-structure.html */ -interface S3EventRecord { +export interface S3EventRecord { eventVersion: string; eventSource: string; - awsRegion: string + awsRegion: string; eventTime: string; eventName: string; userIdentity: { principalId: string; - }, + }; requestParameters: { sourceIPAddress: string; - }, + }; responseElements: { 'x-amz-request-id': string; 'x-amz-id-2': string; - }, + }; s3: { s3SchemaVersion: string; configurationId: string; @@ -185,20 +188,41 @@ interface S3EventRecord { versionId: string; sequencer: string; } - } + }; } -interface S3CreateEvent { - Records: Array; +export interface S3CreateEvent { + Records: S3EventRecord[]; } /** * Cognito User Pool event * http://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html */ -interface CognitoUserPoolEvent { +export interface CognitoUserPoolEvent { version: number; - triggerSource: "PreSignUp_SignUp" | "PostConfirmation_ConfirmSignUp" | "PreAuthentication_Authentication" | "PostAuthentication_Authentication" | "CustomMessage_SignUp" | "CustomMessage_AdminCreateUser" | "CustomMessage_ResendCode" | "CustomMessage_ForgotPassword" | "CustomMessage_UpdateUserAttribute" | "CustomMessage_VerifyUserAttribute" | "CustomMessage_Authentication" | "DefineAuthChallenge_Authentication" | "CreateAuthChallenge_Authentication" | "VerifyAuthChallengeResponse_Authentication"; + triggerSource: + | "PreSignUp_SignUp" + | "PostConfirmation_ConfirmSignUp" + | "PreAuthentication_Authentication" + | "PostAuthentication_Authentication" + | "CustomMessage_SignUp" + | "CustomMessage_AdminCreateUser" + | "CustomMessage_ResendCode" + | "CustomMessage_ForgotPassword" + | "CustomMessage_UpdateUserAttribute" + | "CustomMessage_VerifyUserAttribute" + | "CustomMessage_Authentication" + | "DefineAuthChallenge_Authentication" + | "CreateAuthChallenge_Authentication" + | "VerifyAuthChallengeResponse_Authentication" + | "PreSignUp_AdminCreateUser" + | "PostConfirmation_ConfirmForgotPassword" + | "TokenGeneration_HostedAuth" + | "TokenGeneration_Authentication" + | "TokenGeneration_NewPasswordChallenge" + | "TokenGeneration_AuthenticateDevice" + | "TokenGeneration_RefreshTokens"; region: string; userPoolId: string; userName?: string; @@ -212,11 +236,11 @@ interface CognitoUserPoolEvent { codeParameter?: string; usernameParameter?: string; newDeviceUsed?: boolean; - session?: { + session?: Array<{ challengeName: "CUSTOM_CHALLENGE" | "PASSWORD_VERIFIER" | "SMS_MFA" | "DEVICE_SRP_AUTH" | "DEVICE_PASSWORD_VERIFIER" | "ADMIN_NO_SRP_AUTH"; challengeResult: boolean; challengeMetaData?: string; - }[]; + }>; challengeName?: string; privateChallengeParameters?: {[key: string]: string}; challengeAnswer?: {[key: string]: string}; @@ -240,7 +264,7 @@ interface CognitoUserPoolEvent { * CloudFormation Custom Resource event and response * http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref.html */ -type CloudFormationCustomResourceEventCommon = { +export interface CloudFormationCustomResourceEventCommon { ServiceToken: string; ResponseURL: string; StackId: string; @@ -250,14 +274,14 @@ type CloudFormationCustomResourceEventCommon = { ResourceProperties: { ServiceToken: string; [Key: string]: any; - } + }; } -type CloudFormationCustomResourceCreateEvent = CloudFormationCustomResourceEventCommon & { +export interface CloudFormationCustomResourceCreateEvent extends CloudFormationCustomResourceEventCommon { RequestType: "Create"; } -type CloudFormationCustomResourceUpdateEvent = CloudFormationCustomResourceEventCommon & { +export interface CloudFormationCustomResourceUpdateEvent extends CloudFormationCustomResourceEventCommon { RequestType: "Update"; PhysicalResourceId: string; OldResourceProperties: { @@ -265,47 +289,61 @@ type CloudFormationCustomResourceUpdateEvent = CloudFormationCustomResourceEvent }; } -type CloudFormationCustomResourceDeleteEvent = CloudFormationCustomResourceEventCommon & { +export interface CloudFormationCustomResourceDeleteEvent extends CloudFormationCustomResourceEventCommon { RequestType: "Delete"; PhysicalResourceId: string; } export type CloudFormationCustomResourceEvent = CloudFormationCustomResourceCreateEvent | CloudFormationCustomResourceUpdateEvent | CloudFormationCustomResourceDeleteEvent; -type CloudFormationCustomResourceResponseCommon = { +export interface CloudFormationCustomResourceResponseCommon { PhysicalResourceId: string; StackId: string; RequestId: string; LogicalResourceId: string; Data?: { [Key: string]: any; - } + }; } -type CloudFormationCustomResourceSuccessResponse = CloudFormationCustomResourceResponseCommon & { +export interface CloudFormationCustomResourceSuccessResponse extends CloudFormationCustomResourceResponseCommon { Status: "SUCCESS"; Reason?: string; } -type CloudFormationCustomResourceFailedResponse = CloudFormationCustomResourceResponseCommon & { +export interface CloudFormationCustomResourceFailedResponse extends CloudFormationCustomResourceResponseCommon { Status: "FAILED"; Reason: string; } export type CloudFormationCustomResourceResponse = CloudFormationCustomResourceSuccessResponse | CloudFormationCustomResourceFailedResponse; +/** + * See https://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-scheduled-event + */ +export interface ScheduledEvent { + account: string; + region: string; + detail: any; + "detail-type": string; + source: string; + time: string; + id: string; + resources: string[]; +} + /** * See http://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-cloudwatch-logs */ -interface CloudWatchLogsEvent { +export interface CloudWatchLogsEvent { awslogs: CloudWatchLogsEventData; } -interface CloudWatchLogsEventData { +export interface CloudWatchLogsEventData { data: string; } -interface CloudWatchLogsDecodedData { +export interface CloudWatchLogsDecodedData { owner: string; logGroup: string; logStream: string; @@ -317,17 +355,15 @@ interface CloudWatchLogsDecodedData { /** * See http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/SubscriptionFilters.html#LambdaFunctionExample */ -interface CloudWatchLogsLogEvent { +export interface CloudWatchLogsLogEvent { id: string; timestamp: number; message: string; } - - // Context // http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html -interface Context { +export interface Context { // Properties callbackWaitsForEmptyEventLoop: boolean; functionName: string; @@ -346,25 +382,23 @@ interface Context { // Functions for compatibility with earlier Node.js Runtime v0.10.42 // For more details see http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-using-old-runtime.html#nodejs-prog-model-oldruntime-context-methods done(error?: Error, result?: any): void; - fail(error: Error): void; - fail(message: string): void; - succeed(message: string): void; - succeed(object: any): void; + fail(error: Error | string): void; + succeed(messageOrObject: any): void; succeed(message: string, object: any): void; } -interface CognitoIdentity { +export interface CognitoIdentity { cognitoIdentityId: string; cognitoIdentityPoolId: string; } -interface ClientContext { +export interface ClientContext { client: ClientContextClient; Custom?: any; env: ClientContextEnv; } -interface ClientContextClient { +export interface ClientContextClient { installationId: string; appTitle: string; appVersionName: string; @@ -372,7 +406,7 @@ interface ClientContextClient { appPackageName: string; } -interface ClientContextEnv { +export interface ClientContextEnv { platformVersion: string; platform: string; make: string; @@ -380,11 +414,11 @@ interface ClientContextEnv { locale: string; } -interface ProxyResult { +export interface ProxyResult { statusCode: number; headers?: { [header: string]: boolean | number | string; - }, + }; body: string; isBase64Encoded?: boolean; } @@ -393,7 +427,7 @@ interface ProxyResult { * API Gateway CustomAuthorizer AuthResponse. * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output */ -interface AuthResponse { +export interface AuthResponse { principalId: string; policyDocument: PolicyDocument; context?: AuthResponseContext; @@ -403,7 +437,7 @@ interface AuthResponse { * API Gateway CustomAuthorizer AuthResponse.PolicyDocument. * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output */ -interface PolicyDocument { +export interface PolicyDocument { Version: string; Statement: [Statement]; } @@ -412,7 +446,7 @@ interface PolicyDocument { * API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Statement. * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output */ -interface Statement { +export interface Statement { Action: string | string[]; Effect: string; Resource: string | string[]; @@ -422,58 +456,58 @@ interface Statement { * API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Statement. * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output */ -interface AuthResponseContext { - [name: string]: string | number | boolean; +export interface AuthResponseContext { + [name: string]: any; } /** * CloudFront events * http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html */ -type CloudFrontHeaders = { - [name: string]: { - key: string; - value: string; - }[] -}; +export interface CloudFrontHeaders { + [name: string]: Array<{ + key: string; + value: string; + }>; +} -type CloudFrontResponse = { +export interface CloudFrontResponse { status: string; statusDescription: string; headers: CloudFrontHeaders; -}; +} -type CloudFrontRequest = { +export interface CloudFrontRequest { clientIp: string; method: string; uri: string; querystring: string; headers: CloudFrontHeaders; -}; +} -type CloudFrontEvent = { +export interface CloudFrontEvent { config: { distributionId: string; requestId: string; - } + }; } -export type CloudFrontResponseEvent = { - Records: { +export interface CloudFrontResponseEvent { + Records: Array<{ cf: CloudFrontEvent & { request: CloudFrontRequest; response: CloudFrontResponse; } - }[] -}; + }>; +} -export type CloudFrontRequestEvent = { - Records: { +export interface CloudFrontRequestEvent { + Records: Array<{ cf: CloudFrontEvent & { request: CloudFrontRequest; } - }[] -}; + }>; +} /** * AWS Lambda handler function. diff --git a/types/aws-lambda/tsconfig.json b/types/aws-lambda/tsconfig.json index f4f2cc28f6..37e2690d7e 100644 --- a/types/aws-lambda/tsconfig.json +++ b/types/aws-lambda/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/aws-lambda/tslint.json b/types/aws-lambda/tslint.json index a41bf5d19a..bafaae7817 100644 --- a/types/aws-lambda/tslint.json +++ b/types/aws-lambda/tslint.json @@ -1,79 +1,7 @@ { "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 + // TODO + "dt-header": false } } diff --git a/types/aws-serverless-express/aws-serverless-express-tests.ts b/types/aws-serverless-express/aws-serverless-express-tests.ts index 4770163b3b..9bfd1b0e99 100644 --- a/types/aws-serverless-express/aws-serverless-express-tests.ts +++ b/types/aws-serverless-express/aws-serverless-express-tests.ts @@ -1,5 +1,5 @@ import * as awsServerlessExpress from 'aws-serverless-express'; -import * as express from 'express'; +import express = require('express'); import { eventContext } from 'aws-serverless-express/middleware'; const app = express(); diff --git a/types/aws-serverless-express/tsconfig.json b/types/aws-serverless-express/tsconfig.json index be920785f5..6c4cceb55a 100644 --- a/types/aws-serverless-express/tsconfig.json +++ b/types/aws-serverless-express/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/aws4/tsconfig.json b/types/aws4/tsconfig.json index a0bcbfa73e..014d560bbd 100644 --- a/types/aws4/tsconfig.json +++ b/types/aws4/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/axel/tsconfig.json b/types/axel/tsconfig.json index a3e2b5e015..ef8d480470 100644 --- a/types/axel/tsconfig.json +++ b/types/axel/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "axel-tests.ts", diff --git a/types/azure-mobile-services-client/tsconfig.json b/types/azure-mobile-services-client/tsconfig.json index 1d424df8c4..a31791ed92 100644 --- a/types/azure-mobile-services-client/tsconfig.json +++ b/types/azure-mobile-services-client/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/azure-sb/tsconfig.json b/types/azure-sb/tsconfig.json index 09c9a2a9e4..d111d611fb 100644 --- a/types/azure-sb/tsconfig.json +++ b/types/azure-sb/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "lib/servicebusservice.d.ts", @@ -38,5 +39,4 @@ "azure-sb-tests.ts", "index.d.ts" ] -} - +} \ No newline at end of file diff --git a/types/azure/tsconfig.json b/types/azure/tsconfig.json index 0c4b536df2..df0f82f64b 100644 --- a/types/azure/tsconfig.json +++ b/types/azure/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/b_/tsconfig.json b/types/b_/tsconfig.json index 9227b30bf1..6dfab1f4a1 100644 --- a/types/b_/tsconfig.json +++ b/types/b_/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/babel-code-frame/tsconfig.json b/types/babel-code-frame/tsconfig.json index 48e33ae829..57a0a8bb26 100644 --- a/types/babel-code-frame/tsconfig.json +++ b/types/babel-code-frame/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/babel-core/tsconfig.json b/types/babel-core/tsconfig.json index 41aee71205..11a8a8f40c 100644 --- a/types/babel-core/tsconfig.json +++ b/types/babel-core/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/babel-generator/tsconfig.json b/types/babel-generator/tsconfig.json index 76d138f54d..3024006f80 100644 --- a/types/babel-generator/tsconfig.json +++ b/types/babel-generator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/babel-plugin-react-pug/tsconfig.json b/types/babel-plugin-react-pug/tsconfig.json index 6cb3ae3ee1..b29df5be30 100644 --- a/types/babel-plugin-react-pug/tsconfig.json +++ b/types/babel-plugin-react-pug/tsconfig.json @@ -15,6 +15,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "react" }, "files": [ diff --git a/types/babel-plugin-syntax-jsx/tsconfig.json b/types/babel-plugin-syntax-jsx/tsconfig.json index 6b52644488..c139912293 100644 --- a/types/babel-plugin-syntax-jsx/tsconfig.json +++ b/types/babel-plugin-syntax-jsx/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/babel-template/tsconfig.json b/types/babel-template/tsconfig.json index 96de23cec7..4dc5b17820 100644 --- a/types/babel-template/tsconfig.json +++ b/types/babel-template/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/babel-traverse/tsconfig.json b/types/babel-traverse/tsconfig.json index 03dfa6ea51..dfbed1aef9 100644 --- a/types/babel-traverse/tsconfig.json +++ b/types/babel-traverse/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/babel-types/tsconfig.json b/types/babel-types/tsconfig.json index 92d7d6442e..ec251d52b2 100644 --- a/types/babel-types/tsconfig.json +++ b/types/babel-types/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/babel-webpack-plugin/tsconfig.json b/types/babel-webpack-plugin/tsconfig.json index 3e73343283..78fccc30bc 100644 --- a/types/babel-webpack-plugin/tsconfig.json +++ b/types/babel-webpack-plugin/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "babel-webpack-plugin-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/babelify/tsconfig.json b/types/babelify/tsconfig.json index 9e07702ef2..e54236cdd6 100644 --- a/types/babelify/tsconfig.json +++ b/types/babelify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/babylon-walk/tsconfig.json b/types/babylon-walk/tsconfig.json index 9e1d7c33b7..b92a49ec5e 100644 --- a/types/babylon-walk/tsconfig.json +++ b/types/babylon-walk/tsconfig.json @@ -14,6 +14,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/babylon/tsconfig.json b/types/babylon/tsconfig.json index 94d5c0bd59..750f9357ac 100644 --- a/types/babylon/tsconfig.json +++ b/types/babylon/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/babyparse/tsconfig.json b/types/babyparse/tsconfig.json index da28a97d29..86af41a356 100644 --- a/types/babyparse/tsconfig.json +++ b/types/babyparse/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backbone-associations/tsconfig.json b/types/backbone-associations/tsconfig.json index 7f905ff541..b822a91a70 100644 --- a/types/backbone-associations/tsconfig.json +++ b/types/backbone-associations/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backbone-fetch-cache/tsconfig.json b/types/backbone-fetch-cache/tsconfig.json index 28c3240abc..bf3efc040a 100644 --- a/types/backbone-fetch-cache/tsconfig.json +++ b/types/backbone-fetch-cache/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backbone-relational/tsconfig.json b/types/backbone-relational/tsconfig.json index 961582a08f..d0b124e315 100644 --- a/types/backbone-relational/tsconfig.json +++ b/types/backbone-relational/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backbone.layoutmanager/tsconfig.json b/types/backbone.layoutmanager/tsconfig.json index 85b5e97b31..be801dd5e2 100644 --- a/types/backbone.layoutmanager/tsconfig.json +++ b/types/backbone.layoutmanager/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backbone.localstorage/tsconfig.json b/types/backbone.localstorage/tsconfig.json index 65302c1d16..f745e8beb4 100644 --- a/types/backbone.localstorage/tsconfig.json +++ b/types/backbone.localstorage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backbone.marionette/tsconfig.json b/types/backbone.marionette/tsconfig.json index b31d3cbfa4..a9396b0e55 100644 --- a/types/backbone.marionette/tsconfig.json +++ b/types/backbone.marionette/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backbone.paginator/tsconfig.json b/types/backbone.paginator/tsconfig.json index 453c5e2861..fc77167b76 100644 --- a/types/backbone.paginator/tsconfig.json +++ b/types/backbone.paginator/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backbone.radio/tsconfig.json b/types/backbone.radio/tsconfig.json index 024840f373..ebf120cfac 100644 --- a/types/backbone.radio/tsconfig.json +++ b/types/backbone.radio/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backbone/tsconfig.json b/types/backbone/tsconfig.json index c1185d6adf..227a495055 100644 --- a/types/backbone/tsconfig.json +++ b/types/backbone/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backgrid/tsconfig.json b/types/backgrid/tsconfig.json index f2db8efd4c..e7449e8481 100644 --- a/types/backgrid/tsconfig.json +++ b/types/backgrid/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backlog-js/tsconfig.json b/types/backlog-js/tsconfig.json index 360392d4ca..5e2cfc0b1c 100644 --- a/types/backlog-js/tsconfig.json +++ b/types/backlog-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backoff/tsconfig.json b/types/backoff/tsconfig.json index 1946d82f81..71a863de5b 100644 --- a/types/backoff/tsconfig.json +++ b/types/backoff/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/baconjs/tsconfig.json b/types/baconjs/tsconfig.json index c9d82e16f7..4da0a4158f 100644 --- a/types/baconjs/tsconfig.json +++ b/types/baconjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bagpipes/tsconfig.json b/types/bagpipes/tsconfig.json index 56d9d43a52..db3bcb65b2 100755 --- a/types/bagpipes/tsconfig.json +++ b/types/bagpipes/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/baidumap-web-sdk/tsconfig.json b/types/baidumap-web-sdk/tsconfig.json index 6504c4665a..a0ee2590d8 100644 --- a/types/baidumap-web-sdk/tsconfig.json +++ b/types/baidumap-web-sdk/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/barcode/tsconfig.json b/types/barcode/tsconfig.json index a66d2ab178..f608cf0384 100644 --- a/types/barcode/tsconfig.json +++ b/types/barcode/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bardjs/tsconfig.json b/types/bardjs/tsconfig.json index bd5226a586..bf1bcdf426 100644 --- a/types/bardjs/tsconfig.json +++ b/types/bardjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/base-64/tsconfig.json b/types/base-64/tsconfig.json index 49de73c3ef..a4ca7d05ca 100644 --- a/types/base-64/tsconfig.json +++ b/types/base-64/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/base-x/tsconfig.json b/types/base-x/tsconfig.json index d69790c7d6..42a2d63c40 100644 --- a/types/base-x/tsconfig.json +++ b/types/base-x/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/base16/tsconfig.json b/types/base16/tsconfig.json index d354b0ba01..01e600fe79 100644 --- a/types/base16/tsconfig.json +++ b/types/base16/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/base64-js/tsconfig.json b/types/base64-js/tsconfig.json index 3a65d8af45..0199f01efa 100644 --- a/types/base64-js/tsconfig.json +++ b/types/base64-js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bases/tsconfig.json b/types/bases/tsconfig.json index 4b8912ac99..97e27e72e2 100644 --- a/types/bases/tsconfig.json +++ b/types/bases/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bash-glob/tsconfig.json b/types/bash-glob/tsconfig.json index 6a45a2d74d..0fdaf237e6 100644 --- a/types/bash-glob/tsconfig.json +++ b/types/bash-glob/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "bash-glob-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/basic-auth/tsconfig.json b/types/basic-auth/tsconfig.json index 7c49ef4d01..09bfa7fda6 100644 --- a/types/basic-auth/tsconfig.json +++ b/types/basic-auth/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/batch-stream/tsconfig.json b/types/batch-stream/tsconfig.json index e99f40b376..e746a4a8a2 100644 --- a/types/batch-stream/tsconfig.json +++ b/types/batch-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bazinga-translator/tsconfig.json b/types/bazinga-translator/tsconfig.json index 1ca08ada9b..22d98fdda3 100644 --- a/types/bazinga-translator/tsconfig.json +++ b/types/bazinga-translator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bcrypt-nodejs/tsconfig.json b/types/bcrypt-nodejs/tsconfig.json index 1d7991ff5f..ffce95575f 100644 --- a/types/bcrypt-nodejs/tsconfig.json +++ b/types/bcrypt-nodejs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bcrypt/tsconfig.json b/types/bcrypt/tsconfig.json index 97c8808944..484a20da18 100644 --- a/types/bcrypt/tsconfig.json +++ b/types/bcrypt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bcryptjs/tsconfig.json b/types/bcryptjs/tsconfig.json index 094f87744c..f20bc8f4bf 100644 --- a/types/bcryptjs/tsconfig.json +++ b/types/bcryptjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/beats/tsconfig.json b/types/beats/tsconfig.json index 89bd0b5995..51a7504c29 100644 --- a/types/beats/tsconfig.json +++ b/types/beats/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "beats-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bech32/tsconfig.json b/types/bech32/tsconfig.json index 886ec79796..6fd17c5386 100644 --- a/types/bech32/tsconfig.json +++ b/types/bech32/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "bech32-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bem-cn/tsconfig.json b/types/bem-cn/tsconfig.json index e9212d8d91..fcef3bbd2f 100644 --- a/types/bem-cn/tsconfig.json +++ b/types/bem-cn/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/benchmark/tsconfig.json b/types/benchmark/tsconfig.json index ba1b6a3e55..252c53edbf 100644 --- a/types/benchmark/tsconfig.json +++ b/types/benchmark/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/better-curry/tsconfig.json b/types/better-curry/tsconfig.json index e5ceee43fc..ca9c7198ad 100644 --- a/types/better-curry/tsconfig.json +++ b/types/better-curry/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/better-sqlite3/better-sqlite3-tests.ts b/types/better-sqlite3/better-sqlite3-tests.ts index 43d78e1503..34ee6808c3 100644 --- a/types/better-sqlite3/better-sqlite3-tests.ts +++ b/types/better-sqlite3/better-sqlite3-tests.ts @@ -1,4 +1,4 @@ -import * as Database from 'better-sqlite3'; +import Database = require('better-sqlite3'); const integer = Database.Integer(1); const err = new Database.SqliteError('ok', 'ok'); diff --git a/types/better-sqlite3/index.d.ts b/types/better-sqlite3/index.d.ts index 530f5c3e53..899a85a2e2 100644 --- a/types/better-sqlite3/index.d.ts +++ b/types/better-sqlite3/index.d.ts @@ -4,9 +4,7 @@ // Mathew Rumsey // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - -import * as Integer from 'integer'; +import Integer = require('integer'); interface RunResult { changes: number; diff --git a/types/better-sqlite3/tsconfig.json b/types/better-sqlite3/tsconfig.json index 30a480355b..498fdb02b0 100644 --- a/types/better-sqlite3/tsconfig.json +++ b/types/better-sqlite3/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bezier-easing/tsconfig.json b/types/bezier-easing/tsconfig.json index 2603e9bae8..cb1796c552 100644 --- a/types/bezier-easing/tsconfig.json +++ b/types/bezier-easing/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bezier-js/tsconfig.json b/types/bezier-js/tsconfig.json index 02796cc09c..ed32c02bde 100644 --- a/types/bezier-js/tsconfig.json +++ b/types/bezier-js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bgiframe/tsconfig.json b/types/bgiframe/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/bgiframe/tsconfig.json +++ b/types/bgiframe/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/big.js/tsconfig.json b/types/big.js/tsconfig.json index 950e8b410f..f0a159d0df 100644 --- a/types/big.js/tsconfig.json +++ b/types/big.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/big.js/tslint.json b/types/big.js/tslint.json index f93cf8562a..3224b40b8b 100644 --- a/types/big.js/tslint.json +++ b/types/big.js/tslint.json @@ -1,3 +1,6 @@ { - "extends": "dtslint/dt.json" + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } } diff --git a/types/bigi/tsconfig.json b/types/bigi/tsconfig.json index de6aa90a97..d2a61fc6d4 100644 --- a/types/bigi/tsconfig.json +++ b/types/bigi/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bigint/tsconfig.json b/types/bigint/tsconfig.json index 37005189a4..37b2fc8ffe 100644 --- a/types/bigint/tsconfig.json +++ b/types/bigint/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bignum/tsconfig.json b/types/bignum/tsconfig.json index 15cb8a7b4f..64fc11893f 100644 --- a/types/bignum/tsconfig.json +++ b/types/bignum/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bigscreen/tsconfig.json b/types/bigscreen/tsconfig.json index 71230cc8e1..16e554a953 100644 --- a/types/bigscreen/tsconfig.json +++ b/types/bigscreen/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/binary-parser/tsconfig.json b/types/binary-parser/tsconfig.json index cb361f52c5..5f5844d984 100644 --- a/types/binary-parser/tsconfig.json +++ b/types/binary-parser/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "binary-parser-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bind-ponyfill/tsconfig.json b/types/bind-ponyfill/tsconfig.json index 29d2a7cac2..bc3d132161 100644 --- a/types/bind-ponyfill/tsconfig.json +++ b/types/bind-ponyfill/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bindings/tsconfig.json b/types/bindings/tsconfig.json index fb9350642a..885e8058e8 100644 --- a/types/bindings/tsconfig.json +++ b/types/bindings/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "bindings-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bingmaps/tsconfig.json b/types/bingmaps/tsconfig.json index 421876221b..f3efc20f2b 100644 --- a/types/bingmaps/tsconfig.json +++ b/types/bingmaps/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bintrees/tsconfig.json b/types/bintrees/tsconfig.json index d21ec38c1e..13adede158 100644 --- a/types/bintrees/tsconfig.json +++ b/types/bintrees/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bip21/tsconfig.json b/types/bip21/tsconfig.json index be0b017722..c487184fe8 100644 --- a/types/bip21/tsconfig.json +++ b/types/bip21/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bip38/tsconfig.json b/types/bip38/tsconfig.json index 6ce875b1d1..b490f75d5b 100644 --- a/types/bip38/tsconfig.json +++ b/types/bip38/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "bip38-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bip39/tsconfig.json b/types/bip39/tsconfig.json index d44c1197ad..d3452a293a 100644 --- a/types/bip39/tsconfig.json +++ b/types/bip39/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "bip39-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bit-array/tsconfig.json b/types/bit-array/tsconfig.json index ba2e9e32a2..589e137b19 100644 --- a/types/bit-array/tsconfig.json +++ b/types/bit-array/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bitcoinjs-lib/tsconfig.json b/types/bitcoinjs-lib/tsconfig.json index f874ae9858..35de2c3aab 100644 --- a/types/bitcoinjs-lib/tsconfig.json +++ b/types/bitcoinjs-lib/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bittorrent-protocol/bittorrent-protocol-tests.ts b/types/bittorrent-protocol/bittorrent-protocol-tests.ts index c32b2af368..2faca76a5e 100644 --- a/types/bittorrent-protocol/bittorrent-protocol-tests.ts +++ b/types/bittorrent-protocol/bittorrent-protocol-tests.ts @@ -1,4 +1,4 @@ -import * as Protocol from 'bittorrent-protocol'; +import Protocol = require('bittorrent-protocol'); import * as net from 'net'; class TestExtension implements Protocol.Extension { diff --git a/types/bittorrent-protocol/tsconfig.json b/types/bittorrent-protocol/tsconfig.json index f128669698..311ea796cb 100644 --- a/types/bittorrent-protocol/tsconfig.json +++ b/types/bittorrent-protocol/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bitwise-xor/tsconfig.json b/types/bitwise-xor/tsconfig.json index a6b66cda37..35574c6254 100644 --- a/types/bitwise-xor/tsconfig.json +++ b/types/bitwise-xor/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bl/tsconfig.json b/types/bl/tsconfig.json index 0f7c861ce8..96ce63bb4e 100644 --- a/types/bl/tsconfig.json +++ b/types/bl/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/blacklist/tsconfig.json b/types/blacklist/tsconfig.json index 76cb49e40f..4e45bff651 100644 --- a/types/blacklist/tsconfig.json +++ b/types/blacklist/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/blazy/tsconfig.json b/types/blazy/tsconfig.json index e452d910ec..8e6b8be63e 100644 --- a/types/blazy/tsconfig.json +++ b/types/blazy/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bleno/tsconfig.json b/types/bleno/tsconfig.json index 338f3e3d24..ddc7332cf7 100644 --- a/types/bleno/tsconfig.json +++ b/types/bleno/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/blessed/blessed-tests.ts b/types/blessed/blessed-tests.ts index c5f857146f..aa38af8985 100644 --- a/types/blessed/blessed-tests.ts +++ b/types/blessed/blessed-tests.ts @@ -1,5 +1,6 @@ import * as blessed from "blessed"; import { readFileSync } from "fs"; +import { inspect } from "util"; let screen: blessed.Widgets.Screen = null; @@ -743,3 +744,71 @@ setTimeout(() => { table.setData(data1); screen.render(); }, 3000); + +// https://github.com/chjj/blessed/blob/master/test/program-mouse.js + +const program = blessed.program({ + dump: __dirname + '/logs/mouse.log' +}); + +// program.setMouse({ +// allMotion: true, +// //utfMouse: true +// urxvtMouse: true +// }, true); + +program.alternateBuffer(); +program.enableMouse(); +program.hideCursor(); + +program.setMouse({ sendFocus: true }, true); + +program.on('mouse', function(data) { + program.cup(data.y, data.x); + program.write(' '); + program.cup(0, 0); + program.write(inspect(data)); +}); + +program.on('resize', function(data) { + setTimeout(function() { + program.clear(); + program.cup(0, 0); + program.write(inspect({ cols: program.cols, rows: program.rows })); + }, 200); +}); + +process.on('SIGWINCH', function(data) { + setTimeout(function() { + program.cup(1, 0); + program.write(inspect({ winch: true, cols: program.cols, rows: program.rows })); + }, 200); +}); + +program.on('focus', function(data) { + program.clear(); + program.cup(0, 0); + program.write('FOCUSIN'); +}); + +program.on('blur', function(data) { + program.clear(); + program.cup(0, 0); + program.write('FOCUSOUT'); +}); + +program.key(['q', 'escape', 'C-c'], function() { + program.showCursor(); + program.disableMouse(); + program.normalBuffer(); + process.exit(0); +}); + +program.on('keypress', function(ch, data) { + if (data.name === 'mouse') return; + program.clear(); + program.cup(0, 0); + program.write(inspect(data)); +}); + +program.clear(); diff --git a/types/blessed/index.d.ts b/types/blessed/index.d.ts index 9098648240..7dae1709d2 100644 --- a/types/blessed/index.d.ts +++ b/types/blessed/index.d.ts @@ -7,13 +7,433 @@ /// import { EventEmitter } from "events"; +import { Writable, Readable } from "stream"; import * as stream from "stream"; import * as child_process from "child_process"; -export class BlessedProgram { - hideCursor: () => void; - move: any; - showCursor: any; +export interface IBlessedProgramOptions { + input?: Readable; + output?: Writable; + log?: string; + dump?: boolean; + zero?: boolean; + buffer?: boolean; + terminal?: string; + term?: string; + tput?: string; + debug?: boolean; + resizeTimeout?: boolean; +} + +export class BlessedProgram extends EventEmitter { + type: string; + options: IBlessedProgramOptions; + input: Readable; + output: Writable; + zero: boolean; + useBuffer: boolean; + x: number; + y: number; + savedX: number; + savedY: number; + cols: number; + rows: number; + scrollTop: number; + scrollBottom: number; + isOSXTerm: boolean; + isiTerm2: boolean; + isXFCE: boolean; + isTerminator: boolean; + isLXDE: boolean; + isVTE: boolean; + isRxvt: boolean; + isXterm: boolean; + tmux: boolean; + tmuxVersion: number; + + constructor(options?: IBlessedProgramOptions); + + log(): boolean; + debug(): boolean; + setupDump(): void; + setupTput(): void; + setTerminal(terminal: string): void; + has(name: string): boolean; + term(is: string): boolean; + + listen(): void; + destroy(): void; + + key(key: string|string[], listener: Function): void; + onceKey(key: string|string[], listener: Function): void; + + unKey(key: string|string[], listener: Function): void; + removeKey(key: string|string[], listener: Function): void; + + bindMouse(): void; + enableGpm(): void; + disableGpm(): void; + bindResponse(): void; + + response(name: string, text: string, callback: Function, noBypass?: boolean): boolean; + response(name: string, callback?: Function): boolean; + + write(text: string): boolean; + flush(): void; + print(text: string, attr?: boolean): boolean; + echo(text: string, attr?: boolean): boolean; + + setx(x: number): boolean; + sety(y: number): boolean; + move(x: number, y: number): boolean; + omove(x: number, y: number): void; + rsetx(x: number): boolean; + rsety(y: number): boolean; + rmove(x: number, y: number): void; + + simpleInsert(ch: string, i?: number, attr?: boolean): boolean; + repeat(ch: string, i?: number): string; + copyToClipboard(text: string): boolean; + + cursorShape(shape: string, blink?: boolean): boolean; + cursorColor(color: string): boolean; + cursorReset(): boolean; + resetCursor(): boolean; + + getTextParams(param: string, callback: Function): boolean; + getCursorColor(callback: Function): boolean; + + nul(): boolean; + + bell(): boolean; + bel(): boolean; + + vtab(): boolean; + + form(): boolean; + ff(): boolean; + + backspace(): boolean; + kbs(): boolean; + + tab(): boolean; + ht(): boolean; + + shiftOut(): boolean; + shiftIn(): boolean; + + return(): boolean; + cr(): boolean; + + feed(): boolean; + newline(): boolean; + nl(): boolean; + + index(): boolean; + ind(): boolean; + + reverseIndex(): boolean; + reverse(): boolean; + ri(): boolean; + + nextLine(): boolean; + reset(): boolean; + tabSet(): boolean; + + saveCursor(key: string): boolean; + sc(key: string): boolean; + + restoreCursor(key?: string, hide?: boolean): boolean; + rc(key?: string, hide?: boolean): boolean; + + lsaveCursor(key?: string): void; + lrestoreCursor(key?: string, hide?: boolean): void; + + lineHeight(): boolean; + + charset(val?: string, level?: number): boolean; + + enter_alt_charset_mode(): boolean; + as(): boolean; + smacs(): boolean; + + exit_alt_charset_mode(): boolean; + ae(): boolean; + rmacs(): boolean; + + setG(val: number): boolean; + + setTitle(title: string): boolean; + + resetColors(param?: string): boolean; + + dynamicColors(param?: string): boolean; + + selData(a: string, b: string): boolean; + + cursorUp(param?: number): boolean; + cuu(param?: number): boolean; + up(param?: number): boolean; + + cursorDown(param?: number): boolean; + cud(param?: number): boolean; + down(param?: number): boolean; + + cursorForward(param?: number): boolean; + cuf(param?: number): boolean; + right(param?: number): boolean; + forward(param?: number): boolean; + + cursorBackward(param?: number): boolean; + cub(param?: number): boolean; + left(param?: number): boolean; + back(param?: number): boolean; + + cursorPos(row?: number, col?: number): boolean; + cup(row?: number, col?: number): boolean; + pos(row?: number, col?: number): boolean; + + eraseInDisplay(param?: string): boolean; + ed(param?: string): boolean; + + clear(): boolean; + + eraseInLine(param?: string): boolean; + el(param?: string): boolean; + + charAttributes(param: string, val?: boolean): boolean; + charAttributes(param: string[], val?: boolean): boolean; + + setForeground(color: string, val?: boolean): boolean; + fg(color: string, val?: boolean): boolean; + + setBackground(color: string, val?: boolean): boolean; + bg(color: string, val?: boolean): boolean; + + deviceStatuses(param?: string, callback?: Function, dec?: boolean, noBypass?: boolean): boolean; + dsr(param?: string, callback?: Function, dec?: boolean, noBypass?: boolean): boolean; + + getCursor(callback: Function): boolean; + saveReportedCursor(callback: Function): void; + + restoreReportedCursor: () => boolean; + + insertChars(param?: number): boolean; + ich(param?: number): boolean; + + cursorNextLine(param?: number): boolean; + cnl(param?: number): boolean; + + cursorPrecedingLine(param?: number): boolean; + cpl(param?: number): boolean; + + cursorCharAbsolute(param?: number): boolean; + cha(param?: number): boolean; + + insertLines(param?: number): boolean; + il(param?: number): boolean; + + deleteLines(param?: number): boolean; + dl(param?: number): boolean; + + deleteChars(param?: number): boolean; + dch(param?: number): boolean; + + eraseChars(param?: number): boolean; + ech(param?: number): boolean; + + charPosAbsolute(param?: number): boolean; + hpa(param?: number): boolean; + + HPositionRelative(param?: number): boolean; + + sendDeviceAttributes(param?: number, callback?: Function): boolean; + da(param?: number, callback?: Function): boolean; + + linePosAbsolute(param?: number): boolean; + vpa(param?: number): boolean; + + VPositionRelative(param?: number): boolean; + vpr(param?: number): boolean; + + HVPosition(row?: number, col?: number): boolean; + hvp(row?: number, col?: number): boolean; + + setMode(...args: string[]): boolean; + sm(...args: string[]): boolean; + + decset(...args: string[]): boolean; + + showCursor(): boolean; + + alternateBuffer(): boolean; + smcup(): boolean; + alternate(): boolean; + + resetMode(...args: string[]): boolean; + rm(...args: string[]): boolean; + + decrst(...args: string[]): boolean; + + hideCursor(): boolean; + civis(): boolean; + vi(): boolean; + cursor_invisible(): boolean; + dectcemh(): boolean; + + normalBuffer(): boolean; + rmcup(): boolean; + + enableMouse(): void; + disableMouse(): void; + + setMouse(opt?: {}, enable?: boolean): void; + + setScrollRegion(top: number, bottom: number): boolean; + csr(top: number, bottom: number): boolean; + decstbm(top: number, bottom: number): boolean; + + saveCursorA(): boolean; + scA(): boolean; + + restoreCursorA(): boolean; + rcA(): boolean; + + cursorForwardTab(param?: number): boolean; + cht(param?: number): boolean; + + scrollUp(param?: number): boolean; + su(param?: number): boolean; + + scrollDown(param?: number): boolean; + sd(param?: number): boolean; + + initMouseTracking(...args: string[]): boolean; + + resetTitleModes(...args: string[]): boolean; + + cursorBackwardTab(param?: number): boolean; + cbt(param?: number): boolean; + + repeatPrecedingCharacter(param?: number): boolean; + rep(param?: number): boolean; + + tabClear(param?: number): boolean; + tbc(param?: number): boolean; + + mediaCopy(...args: string[]): boolean; + mc(...args: string[]): boolean; + + mc0(): boolean; + print_screen(): boolean; + ps(): boolean; + + mc5(): boolean; + prtr_on(): boolean; + po(): boolean; + + mc4(): boolean; + prtr_off(): boolean; + pf(): boolean; + + mc5p(): boolean; + prtr_non(): boolean; + p0(): boolean; + + setResources(...args: string[]): boolean; + + disableModifieres(...args: string[]): boolean; + + setPointerMode(...args: string[]): boolean; + + softReset(): boolean; + rs2(): boolean; + decstr(): boolean; + + requestAnsiMode(param?: number): boolean; + decrqm(param?: number): boolean; + + requestPrivateMode(param?: number): boolean; + decrqmp(param?: number): boolean; + + setConformanceLevel(...args: string[]): boolean; + decscl(...args: string[]): boolean; + + loadLEDs(param?: number): boolean; + decll(param?: number): boolean; + + setCursorStyle(param?: string): boolean; + decscursr(param?: string): boolean; + + setCharProtectionAttr(param?: number): boolean; + decsca(param?: number): boolean; + + restorePrivateValues(...args: string[]): boolean; + + setAttrInRectangle(...args: string[]): boolean; + deccara(...args: string[]): boolean; + + savePrivateValues(...args: string[]): boolean; + + manipulateWindow(...args: any[]): boolean; + + getWindowSize(callback?: Function): boolean; + + reverseAttrInRectangle(...args: string[]): boolean; + decrara(...args: string[]): boolean; + + setTitleModeFeature(...args: string[]): boolean; + + setWarningBellVolume(param?: number): boolean; + decswbv(param?: number): boolean; + + setMarginBellVolume(param?: number): boolean; + + copyRectangle(...args: string[]): boolean; + deccra(...args: string[]): boolean; + + enableFilterRectangle(...args: string[]): boolean; + decefr(...args: string[]): boolean; + + requestParameters(param?: number): boolean; + decreqtparm(param: number): boolean; + + selectChangeExtent(param?: number): boolean; + decsace(param?: number): boolean; + + fillRectangle(...args: string[]): boolean; + decfra(...args: string[]): boolean; + + enableLocatorReporting(...args: string[]): boolean; + decelr(...args: string[]): boolean; + + eraseRectangle(...args: string[]): boolean; + decera(...args: string[]): boolean; + + setLocatorEvents(...args: string[]): boolean; + decsle(...args: string[]): boolean; + + selectiveEraseRectangle(...args: string[]): boolean; + decsera(...args: string[]): boolean; + + requestLocatorPosition(param?: string, callback?: Function): boolean; + reqmp(param?: string, callback?: Function): boolean; + req_mouse_pos(param?: string, callback?: Function): boolean; + decrqlp(param?: string, callback?: Function): boolean; + + insertColumns(...args: string[]): boolean; + decic(...args: string[]): boolean; + + deleteColumns(...args: string[]): boolean; + decdc(...args: string[]): boolean; + + out(param: string, ...args: any[]): boolean; + + sigtstp(callback?: Function): boolean; + + pause(callback?: Function): Function; + + resume: () => void; } export namespace Widgets { @@ -516,7 +936,7 @@ export namespace Widgets { * Debug mode. Enables usage of the debug method. Also creates a debug console which will display when * pressing F12. It will display all log and debug messages. */ - debug?(...msg: string[]): void; + debug?: boolean; /** * Array of keys in their full format (e.g. C-c) to ignore when keys are locked or grabbed. Useful @@ -963,7 +1383,7 @@ export namespace Widgets { /** * Spawn a process in the foreground, return to blessed app after exit. */ - spawn(file: string, args: string[], options: NodeChildProcessExecOptions): child_process.ChildProcess; + spawn(file: string, args?: string[], options?: NodeChildProcessExecOptions): child_process.ChildProcess; /** * Spawn a process in the foreground, return to blessed app after exit. Executes callback on error or exit. @@ -3024,6 +3444,7 @@ export function message(options?: Widgets.MessageOptions): Widgets.MessageElemen export function loading(options?: Widgets.LoadingOptions): Widgets.LoadingElement; export function log(options?: Widgets.LogOptions): Widgets.Log; export function progressbar(options?: Widgets.ProgressBarOptions): Widgets.ProgressBarElement; +export function program(options?: Widgets.IScreenOptions): BlessedProgram; export function terminal(options?: Widgets.TerminalOptions): Widgets.TerminalElement; export function layout(options?: Widgets.LayoutOptions): Widgets.LayoutElement; export function escape(item: any): any; diff --git a/types/blessed/tsconfig.json b/types/blessed/tsconfig.json index e57d4b78d6..663cf64ce8 100644 --- a/types/blessed/tsconfig.json +++ b/types/blessed/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/blissfuljs/tsconfig.json b/types/blissfuljs/tsconfig.json index 42087d76ef..16201714f3 100644 --- a/types/blissfuljs/tsconfig.json +++ b/types/blissfuljs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/blob-stream/tsconfig.json b/types/blob-stream/tsconfig.json index 2ebe6cacb9..c8ae5c3565 100644 --- a/types/blob-stream/tsconfig.json +++ b/types/blob-stream/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/blob-to-buffer/tsconfig.json b/types/blob-to-buffer/tsconfig.json index 2421ce2493..ed4fc69e7b 100644 --- a/types/blob-to-buffer/tsconfig.json +++ b/types/blob-to-buffer/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "blob-to-buffer-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/blob-util/tsconfig.json b/types/blob-util/tsconfig.json index 7f7970ab0b..2f53f29186 100644 --- a/types/blob-util/tsconfig.json +++ b/types/blob-util/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/blocks/tsconfig.json b/types/blocks/tsconfig.json index 85da699a13..4203094315 100644 --- a/types/blocks/tsconfig.json +++ b/types/blocks/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bloomfilter/tsconfig.json b/types/bloomfilter/tsconfig.json index 76ea34c251..578ee0b36b 100644 --- a/types/bloomfilter/tsconfig.json +++ b/types/bloomfilter/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/blue-tape/tsconfig.json b/types/blue-tape/tsconfig.json index a4fc12b9e1..5271d69567 100644 --- a/types/blue-tape/tsconfig.json +++ b/types/blue-tape/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bluebird-global/index.d.ts b/types/bluebird-global/index.d.ts index c0e220ce07..c3f0fd9d43 100644 --- a/types/bluebird-global/index.d.ts +++ b/types/bluebird-global/index.d.ts @@ -44,7 +44,7 @@ * d. target es6, latest "es20xx", e.g. "es2017" */ -import * as Bluebird from "bluebird"; +import Bluebird = require("bluebird"); declare global { /* diff --git a/types/bluebird-global/tsconfig.json b/types/bluebird-global/tsconfig.json index d037429e0d..5256c6c206 100644 --- a/types/bluebird-global/tsconfig.json +++ b/types/bluebird-global/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bluebird-retry/tsconfig.json b/types/bluebird-retry/tsconfig.json index 5ae2b487db..ea6622b197 100644 --- a/types/bluebird-retry/tsconfig.json +++ b/types/bluebird-retry/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bluebird/index.d.ts b/types/bluebird/index.d.ts index b28f821e12..8ad57050f6 100644 --- a/types/bluebird/index.d.ts +++ b/types/bluebird/index.d.ts @@ -47,7 +47,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Promises/A+ `.then()`. Returns a new promise chained from this promise. * - * The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise. + * The new promise will be rejected or resolved depending on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise. */ // Based on PromiseLike.then, but returns a Bluebird instance. then(onFulfill?: (value: R) => U | PromiseLike, onReject?: (error: any) => U | PromiseLike): Bluebird; // For simpler signature help. @@ -192,34 +192,34 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { */ tapCatch(onReject: (error?: any) => U | PromiseLike): Bluebird; - tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, - filter5: (new (...args: any[]) => E5) | ((error: any) => boolean) | object, + tapCatch( + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, + filter4: CatchFilter, + filter5: CatchFilter, onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike, ): Bluebird; - tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, + tapCatch( + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, + filter4: CatchFilter, onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, ): Bluebird; - tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, + tapCatch( + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, onReject: (error: E1 | E2 | E3) => U | PromiseLike, ): Bluebird; - tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, + tapCatch( + filter1: CatchFilter, + filter2: CatchFilter, onReject: (error: E1 | E2) => U | PromiseLike, ): Bluebird; - tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, + tapCatch( + filter1: CatchFilter, onReject: (error: E1) => U | PromiseLike, ): Bluebird; @@ -364,34 +364,35 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { */ catchReturn(value: U): Bluebird; + // No need to be specific about Error types in these overrides, since there's no handler function catchReturn( - filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter5: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, + filter4: CatchFilter, + filter5: CatchFilter, value: U, ): Bluebird; catchReturn( - filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, + filter4: CatchFilter, value: U, ): Bluebird; catchReturn( - filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, value: U, ): Bluebird; catchReturn( - filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter1: CatchFilter, + filter2: CatchFilter, value: U, ): Bluebird; catchReturn( - filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter1: CatchFilter, value: U, ): Bluebird; @@ -407,34 +408,35 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { */ catchThrow(reason: Error): Bluebird; + // No need to be specific about Error types in these overrides, since there's no handler function catchThrow( - filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter5: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, + filter4: CatchFilter, + filter5: CatchFilter, reason: Error, ): Bluebird; catchThrow( - filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, + filter4: CatchFilter, reason: Error, ): Bluebird; catchThrow( - filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, reason: Error, ): Bluebird; catchThrow( - filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter1: CatchFilter, + filter2: CatchFilter, reason: Error, ): Bluebird; catchThrow( - filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter1: CatchFilter, reason: Error, ): Bluebird; @@ -761,7 +763,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { static race(values: PromiseLike | R>> | Iterable | R>): Bluebird; /** - * Initiate a competetive race between multiple promises or values (values will become immediately fulfilled promises). + * Initiate a competitive race between multiple promises or values (values will become immediately fulfilled promises). * When `count` amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of the winners in order of resolution. * * If too many promises are rejected so that the promise can never become fulfilled, it will be immediately rejected with an array of rejection reasons in the order they were thrown in. @@ -835,7 +837,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * * If the reducer function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration. * - * *The original array is not modified. If no `intialValue` is given and the array doesn't contain at least 2 items, the callback will not be called and `undefined` is returned. + * *The original array is not modified. If no `initialValue` is given and the array doesn't contain at least 2 items, the callback will not be called and `undefined` is returned. * If `initialValue` is given and the array doesn't have at least 1 item, `initialValue` is returned.* */ static reduce( @@ -1053,7 +1055,7 @@ declare namespace Bluebird { * Gives you a callback representation of the `PromiseResolver`. Note that this is not a method but a property. * The callback accepts error object in first argument and success values on the 2nd parameter and the rest, I.E. node js conventions. * - * If the the callback is called with multiple success values, the resolver fullfills its promise with an array of the values. + * If the the callback is called with multiple success values, the resolver fulfills its promise with an array of the values. */ // TODO specify resolver callback callback(err: any, value: R, ...values: R[]): void; diff --git a/types/bluebird/tsconfig.json b/types/bluebird/tsconfig.json index 909dae3771..b0b641abfd 100644 --- a/types/bluebird/tsconfig.json +++ b/types/bluebird/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } -} +} \ No newline at end of file diff --git a/types/bluebird/v1/tsconfig.json b/types/bluebird/v1/tsconfig.json index 3e22a6a885..1a61a9f82c 100644 --- a/types/bluebird/v1/tsconfig.json +++ b/types/bluebird/v1/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bluebird/v2/tsconfig.json b/types/bluebird/v2/tsconfig.json index 773747fb4a..e58ea42703 100644 --- a/types/bluebird/v2/tsconfig.json +++ b/types/bluebird/v2/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/blueimp-md5/tsconfig.json b/types/blueimp-md5/tsconfig.json index 286b0abda2..84d291ab5f 100644 --- a/types/blueimp-md5/tsconfig.json +++ b/types/blueimp-md5/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/body-parser/body-parser-tests.ts b/types/body-parser/body-parser-tests.ts index fa18cad13b..2f6a33ea72 100644 --- a/types/body-parser/body-parser-tests.ts +++ b/types/body-parser/body-parser-tests.ts @@ -1,4 +1,4 @@ -import * as express from 'express'; +import express = require('express'); import { json, raw, diff --git a/types/body-parser/tsconfig.json b/types/body-parser/tsconfig.json index 9c0314a557..fcab8a9b2c 100644 --- a/types/body-parser/tsconfig.json +++ b/types/body-parser/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bonjour/bonjour-tests.ts b/types/bonjour/bonjour-tests.ts index 61e7373f01..aff3226eba 100644 --- a/types/bonjour/bonjour-tests.ts +++ b/types/bonjour/bonjour-tests.ts @@ -1,4 +1,4 @@ -import * as bonjour from 'bonjour'; +import bonjour = require('bonjour'); let bonjourOptions: bonjour.BonjourOptions; let bonjourInstance: bonjour.Bonjour; diff --git a/types/bonjour/tsconfig.json b/types/bonjour/tsconfig.json index 8cc7d3f823..8840a855b0 100644 --- a/types/bonjour/tsconfig.json +++ b/types/bonjour/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bookshelf/bookshelf-tests.ts b/types/bookshelf/bookshelf-tests.ts index 77af31461b..81c42f7680 100644 --- a/types/bookshelf/bookshelf-tests.ts +++ b/types/bookshelf/bookshelf-tests.ts @@ -1,6 +1,6 @@ -import * as Knex from 'knex'; -import * as Bookshelf from 'bookshelf'; -import * as assert from 'assert'; +import Knex = require('knex'); +import Bookshelf = require('bookshelf'); +import assert = require('assert'); import * as express from 'express'; import * as _ from "lodash"; @@ -1124,7 +1124,7 @@ ships.on('fetched', (collection, response) => { User.collection() .orderBy('-name') .fetch() - .then((users: Bookshelf.Collection) => { + .then((users: Bookshelf.Collection>) => { console.log(users); }) } diff --git a/types/bookshelf/index.d.ts b/types/bookshelf/index.d.ts index dca8d5fad2..c151e81624 100644 --- a/types/bookshelf/index.d.ts +++ b/types/bookshelf/index.d.ts @@ -250,7 +250,7 @@ declare namespace Bookshelf { detach(options?: SyncOptions): BlueBird; fetchOne(options?: CollectionFetchOneOptions): BlueBird; load(relations: string | string[], options?: SyncOptions): BlueBird>; - orderBy(column: string, order?: SortOrder): T; + orderBy(column: string, order?: SortOrder): Collection; // Declaration order matters otherwise TypeScript gets confused between query() and query(...query: string[]) query(): Knex.QueryBuilder; diff --git a/types/bookshelf/tsconfig.json b/types/bookshelf/tsconfig.json index e983e9b53c..97c8b4593f 100644 --- a/types/bookshelf/tsconfig.json +++ b/types/bookshelf/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/boolify-string/tsconfig.json b/types/boolify-string/tsconfig.json index fcc1b15038..dee33294ce 100644 --- a/types/boolify-string/tsconfig.json +++ b/types/boolify-string/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/boom/boom-tests.ts b/types/boom/boom-tests.ts index f989128b4e..4d133b2545 100644 --- a/types/boom/boom-tests.ts +++ b/types/boom/boom-tests.ts @@ -144,6 +144,12 @@ const isBoomError = new Boom.Boom('test') Boom.isBoom(isBoomError); +const maybeBoom = new Boom.Boom('test'); +if(Boom.isBoom(maybeBoom)) { + // isBoom is a type guard that allows accessing these properties: + maybeBoom.output.headers; +} + // constructor const constructorError: Boom.Boom = new Boom.Boom('test'); diff --git a/types/boom/index.d.ts b/types/boom/index.d.ts index 89ca580561..ed48f181cf 100644 --- a/types/boom/index.d.ts +++ b/types/boom/index.d.ts @@ -86,7 +86,7 @@ declare namespace Boom { * Identifies whether an error is a Boom object. Same as calling instanceof Boom. * @param error the error object to identify. */ - export function isBoom(error: Error): boolean + export function isBoom(error: Error): error is Boom // 4xx /** diff --git a/types/boom/tsconfig.json b/types/boom/tsconfig.json index 81f6f5cacf..dc98c5e8dd 100644 --- a/types/boom/tsconfig.json +++ b/types/boom/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/boom/v3/tsconfig.json b/types/boom/v3/tsconfig.json index 1f8b8e7f4a..5e710a4782 100644 --- a/types/boom/v3/tsconfig.json +++ b/types/boom/v3/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/boom/v4/tsconfig.json b/types/boom/v4/tsconfig.json index 58f1109eee..0a547414fb 100644 --- a/types/boom/v4/tsconfig.json +++ b/types/boom/v4/tsconfig.json @@ -19,10 +19,11 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "boom-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bootbox/tsconfig.json b/types/bootbox/tsconfig.json index 75da35b2bc..c5edc1ed75 100644 --- a/types/bootbox/tsconfig.json +++ b/types/bootbox/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootpag/tsconfig.json b/types/bootpag/tsconfig.json index 69b09cc3a6..6861920942 100644 --- a/types/bootpag/tsconfig.json +++ b/types/bootpag/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap-datepicker/tsconfig.json b/types/bootstrap-datepicker/tsconfig.json index 6770944b42..a8fed647e2 100644 --- a/types/bootstrap-datepicker/tsconfig.json +++ b/types/bootstrap-datepicker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap-fileinput/tsconfig.json b/types/bootstrap-fileinput/tsconfig.json index fa1c069762..b4076b50e2 100644 --- a/types/bootstrap-fileinput/tsconfig.json +++ b/types/bootstrap-fileinput/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/bootstrap-growl-ifightcrime/bootstrap-growl-ifightcrime-tests.ts b/types/bootstrap-growl-ifightcrime/bootstrap-growl-ifightcrime-tests.ts new file mode 100644 index 0000000000..78f92fcf71 --- /dev/null +++ b/types/bootstrap-growl-ifightcrime/bootstrap-growl-ifightcrime-tests.ts @@ -0,0 +1,25 @@ +// basic usage +$(document).ready(() => { + $.bootstrapGrowl('Message to show in alert'); +}); + +// with options example +let offsetOptions: BootstrapGrowlIfightcrime.OffsetOption = { + from: 'top', + amount: 20 +}; + +let options: BootstrapGrowlIfightcrime.Options = { + ele: 'body', + type: 'info', + offset: offsetOptions, + align: 'right', + width: 250, + delay: 4000, + allow_dismiss: true, + stackup_spacing: 10 +}; + +$(document).ready(() => { + $.bootstrapGrowl('Alert with options', options); +}); diff --git a/types/bootstrap-growl-ifightcrime/index.d.ts b/types/bootstrap-growl-ifightcrime/index.d.ts new file mode 100644 index 0000000000..45755682ea --- /dev/null +++ b/types/bootstrap-growl-ifightcrime/index.d.ts @@ -0,0 +1,78 @@ +// Type definitions for Bootstrap Growl Ifightcrime 1.1 +// Project: https://github.com/ifightcrime/bootstrap-growl +// Definitions by: Anderson Friaça +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +declare namespace BootstrapGrowlIfightcrime { + type OffsetPositionType = 'top' | 'bottom'; + + type AlertType = 'info' | 'danger' | 'success' | 'warning' | string | null; + + type AlignType = 'left' | 'center' | 'right'; + + interface OffsetOption { + /** + * Position: top or bottom + */ + from?: OffsetPositionType; + + /** + * Offset amount + */ + amount?: number; + } + + interface Options { + /** + * Which element to append to + */ + ele?: string; + + /** + * Values of (null, 'info', 'danger', 'success', 'warning') or another value + */ + type?: AlertType; + + /** + * Offset Options + */ + offset?: OffsetOption; + + /** + * 'left', 'right', or 'center' + */ + align?: AlignType; + + /** + * Integer + */ + width?: number; + + /** + * Time while the message will be displayed. It's not equivalent to the *demo* timeOut! + */ + delay?: number; + + /** + * If true then will display a cross to close the popup. + */ + allow_dismiss?: boolean; + + /** + * Spacing between consecutively stacked growls. + */ + stackup_spacing?: number; + } +} +interface JQueryStatic { + /** + * Show standard Bootstrap alerts into hovering "Growl-like" notifications + * @param message to show. + * @param options should be an options object. + * @returns The element. + */ + bootstrapGrowl: (message: string, options?: BootstrapGrowlIfightcrime.Options) => JQuery; +} diff --git a/types/bootstrap-growl-ifightcrime/tsconfig.json b/types/bootstrap-growl-ifightcrime/tsconfig.json new file mode 100644 index 0000000000..fc7523d1ed --- /dev/null +++ b/types/bootstrap-growl-ifightcrime/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "bootstrap-growl-ifightcrime-tests.ts" + ] +} \ No newline at end of file diff --git a/types/bootstrap-growl-ifightcrime/tslint.json b/types/bootstrap-growl-ifightcrime/tslint.json new file mode 100644 index 0000000000..4e88071852 --- /dev/null +++ b/types/bootstrap-growl-ifightcrime/tslint.json @@ -0,0 +1 @@ +{"extends": "dtslint/dt.json"} diff --git a/types/bootstrap-maxlength/tsconfig.json b/types/bootstrap-maxlength/tsconfig.json index 403883963c..e4b44ea983 100644 --- a/types/bootstrap-maxlength/tsconfig.json +++ b/types/bootstrap-maxlength/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap-notify/tsconfig.json b/types/bootstrap-notify/tsconfig.json index f833291433..655e25aee4 100644 --- a/types/bootstrap-notify/tsconfig.json +++ b/types/bootstrap-notify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap-select/tsconfig.json b/types/bootstrap-select/tsconfig.json index 108bd0a43f..5e091020b7 100644 --- a/types/bootstrap-select/tsconfig.json +++ b/types/bootstrap-select/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap-slider/tsconfig.json b/types/bootstrap-slider/tsconfig.json index 7400a08d09..290df45757 100644 --- a/types/bootstrap-slider/tsconfig.json +++ b/types/bootstrap-slider/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap-switch/tsconfig.json b/types/bootstrap-switch/tsconfig.json index 794d73cac9..12b39ceee9 100644 --- a/types/bootstrap-switch/tsconfig.json +++ b/types/bootstrap-switch/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap-table/tsconfig.json b/types/bootstrap-table/tsconfig.json index b38fb73330..8ce2a4f120 100644 --- a/types/bootstrap-table/tsconfig.json +++ b/types/bootstrap-table/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap-touchspin/tsconfig.json b/types/bootstrap-touchspin/tsconfig.json index 1ce86dec76..dd3a9a264f 100644 --- a/types/bootstrap-touchspin/tsconfig.json +++ b/types/bootstrap-touchspin/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap-treeview/tsconfig.json b/types/bootstrap-treeview/tsconfig.json index 30898529bb..07ec80679b 100644 --- a/types/bootstrap-treeview/tsconfig.json +++ b/types/bootstrap-treeview/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap-validator/tsconfig.json b/types/bootstrap-validator/tsconfig.json index 4f61ae94f9..c2fe1d7649 100644 --- a/types/bootstrap-validator/tsconfig.json +++ b/types/bootstrap-validator/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap.paginator/tsconfig.json b/types/bootstrap.paginator/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/bootstrap.paginator/tsconfig.json +++ b/types/bootstrap.paginator/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/bootstrap.timepicker/tsconfig.json b/types/bootstrap.timepicker/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/bootstrap.timepicker/tsconfig.json +++ b/types/bootstrap.timepicker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/bootstrap.v3.datetimepicker/tsconfig.json b/types/bootstrap.v3.datetimepicker/tsconfig.json index 36febd5a8f..07477e55ee 100644 --- a/types/bootstrap.v3.datetimepicker/tsconfig.json +++ b/types/bootstrap.v3.datetimepicker/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/bootstrap.v3.datetimepicker/v3/tsconfig.json b/types/bootstrap.v3.datetimepicker/v3/tsconfig.json index 3dcc23bdff..2647486a31 100644 --- a/types/bootstrap.v3.datetimepicker/v3/tsconfig.json +++ b/types/bootstrap.v3.datetimepicker/v3/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/bootstrap/index.d.ts b/types/bootstrap/index.d.ts index 9fa10bcdbb..a3117596af 100644 --- a/types/bootstrap/index.d.ts +++ b/types/bootstrap/index.d.ts @@ -115,6 +115,7 @@ interface JQuery { carousel(options?: CarouselOptions): JQuery; carousel(command: string): JQuery; + carousel(index: number): JQuery; typeahead(options?: TypeaheadOptions): JQuery; diff --git a/types/bootstrap/tsconfig.json b/types/bootstrap/tsconfig.json index 536901e8a6..69b44a5acc 100644 --- a/types/bootstrap/tsconfig.json +++ b/types/bootstrap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bounce.js/tsconfig.json b/types/bounce.js/tsconfig.json index a0f7048729..e98358df0d 100644 --- a/types/bounce.js/tsconfig.json +++ b/types/bounce.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/box2d/tsconfig.json b/types/box2d/tsconfig.json index 9fae5e8326..d2792ff0aa 100644 --- a/types/box2d/tsconfig.json +++ b/types/box2d/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/brace-expansion/tsconfig.json b/types/brace-expansion/tsconfig.json index a64fa9ea3b..5bf38b657e 100644 --- a/types/brace-expansion/tsconfig.json +++ b/types/brace-expansion/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/braces/tsconfig.json b/types/braces/tsconfig.json index bdacb750ad..4cea273caa 100644 --- a/types/braces/tsconfig.json +++ b/types/braces/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/braft-editor/braft-editor-tests.tsx b/types/braft-editor/braft-editor-tests.tsx index 584927e0bd..999850acaa 100644 --- a/types/braft-editor/braft-editor-tests.tsx +++ b/types/braft-editor/braft-editor-tests.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import * as BraftEditor from "braft-editor"; +import BraftEditor = require("braft-editor"); import { RawDraftContentState, } from 'draft-js'; diff --git a/types/braft-editor/tsconfig.json b/types/braft-editor/tsconfig.json index f04b8febfe..f944ddb136 100644 --- a/types/braft-editor/tsconfig.json +++ b/types/braft-editor/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/braintree-web/tsconfig.json b/types/braintree-web/tsconfig.json index 3a39178d0e..8ebecd3737 100644 --- a/types/braintree-web/tsconfig.json +++ b/types/braintree-web/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/breeze/tsconfig.json b/types/breeze/tsconfig.json index 236bcba327..6960f68bf4 100644 --- a/types/breeze/tsconfig.json +++ b/types/breeze/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bricks.js/tsconfig.json b/types/bricks.js/tsconfig.json index 5f265430a3..af736ecb51 100644 --- a/types/bricks.js/tsconfig.json +++ b/types/bricks.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/brorand/brorand-tests.ts b/types/brorand/brorand-tests.ts index ac090e8724..eb7bf16570 100644 --- a/types/brorand/brorand-tests.ts +++ b/types/brorand/brorand-tests.ts @@ -1,5 +1,4 @@ - -import * as brorand from 'brorand'; +import brorand = require('brorand'); { let result: Buffer|Uint8Array = brorand(42); diff --git a/types/brorand/tsconfig.json b/types/brorand/tsconfig.json index 52e7dbf24c..46bf46253f 100644 --- a/types/brorand/tsconfig.json +++ b/types/brorand/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/browser-bunyan/tsconfig.json b/types/browser-bunyan/tsconfig.json index ab3fb51bd2..258572b639 100644 --- a/types/browser-bunyan/tsconfig.json +++ b/types/browser-bunyan/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/browser-fingerprint/tsconfig.json b/types/browser-fingerprint/tsconfig.json index 7f34a8f380..b542891e6d 100644 --- a/types/browser-fingerprint/tsconfig.json +++ b/types/browser-fingerprint/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/browser-harness/tsconfig.json b/types/browser-harness/tsconfig.json index 1694e52c08..94f44fa93e 100644 --- a/types/browser-harness/tsconfig.json +++ b/types/browser-harness/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/browser-pack/tsconfig.json b/types/browser-pack/tsconfig.json index 1dc87a2e2d..23cf069267 100644 --- a/types/browser-pack/tsconfig.json +++ b/types/browser-pack/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/browser-report/tsconfig.json b/types/browser-report/tsconfig.json index f0bb076ca9..d356e5aa89 100644 --- a/types/browser-report/tsconfig.json +++ b/types/browser-report/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/browser-resolve/browser-resolve-tests.ts b/types/browser-resolve/browser-resolve-tests.ts index 7d08de726f..25872b4b07 100644 --- a/types/browser-resolve/browser-resolve-tests.ts +++ b/types/browser-resolve/browser-resolve-tests.ts @@ -1,4 +1,4 @@ -import * as browserResolve from 'browser-resolve'; +import browserResolve = require('browser-resolve'); function basic_test_async(callback: (err?: Error, resolved?: string) => void) { browserResolve('typescript', function(error, resolved) { diff --git a/types/browser-resolve/tsconfig.json b/types/browser-resolve/tsconfig.json index 5f873c7ee5..82c5c037ca 100644 --- a/types/browser-resolve/tsconfig.json +++ b/types/browser-resolve/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/browser-sync/browser-sync-tests.ts b/types/browser-sync/browser-sync-tests.ts index 85cd464a21..bcd829367a 100644 --- a/types/browser-sync/browser-sync-tests.ts +++ b/types/browser-sync/browser-sync-tests.ts @@ -1,4 +1,4 @@ -import * as browserSync from "browser-sync"; +import browserSync = require("browser-sync"); (() => { //make sure that the interfaces are correctly exposed diff --git a/types/browser-sync/tsconfig.json b/types/browser-sync/tsconfig.json index 830268a3a6..0984bd5d70 100644 --- a/types/browser-sync/tsconfig.json +++ b/types/browser-sync/tsconfig.json @@ -19,7 +19,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/browserify/tsconfig.json b/types/browserify/tsconfig.json index df71b7fb3b..f0588d71c8 100644 --- a/types/browserify/tsconfig.json +++ b/types/browserify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bs58/tsconfig.json b/types/bs58/tsconfig.json index 9e0ed25701..3c8b90f97d 100644 --- a/types/bs58/tsconfig.json +++ b/types/bs58/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bson/tsconfig.json b/types/bson/tsconfig.json index aa4936d595..684c19c644 100644 --- a/types/bson/tsconfig.json +++ b/types/bson/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bucks/tsconfig.json b/types/bucks/tsconfig.json index f06df83926..fe5a89bfe7 100644 --- a/types/bucks/tsconfig.json +++ b/types/bucks/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/buffer-compare/tsconfig.json b/types/buffer-compare/tsconfig.json index 76638cae6e..0c58396698 100644 --- a/types/buffer-compare/tsconfig.json +++ b/types/buffer-compare/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/buffer-equal/tsconfig.json b/types/buffer-equal/tsconfig.json index 5576be8e43..d6b1d1f588 100644 --- a/types/buffer-equal/tsconfig.json +++ b/types/buffer-equal/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/buffers/tsconfig.json b/types/buffers/tsconfig.json index 148f3d1dbb..26bb76ee44 100644 --- a/types/buffers/tsconfig.json +++ b/types/buffers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bufferstream/tsconfig.json b/types/bufferstream/tsconfig.json index 000bd2d09c..be892dede3 100644 --- a/types/bufferstream/tsconfig.json +++ b/types/bufferstream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bull/bull-tests.tsx b/types/bull/bull-tests.tsx index cbdcc83e0a..765be54733 100644 --- a/types/bull/bull-tests.tsx +++ b/types/bull/bull-tests.tsx @@ -2,8 +2,8 @@ * Created by Bruno Grieder */ -import * as Redis from "ioredis"; -import * as Queue from "bull"; +import Redis = require("ioredis"); +import Queue = require("bull"); const videoQueue = new Queue('video transcoding', 'redis://127.0.0.1:6379'); const audioQueue = new Queue('audio transcoding', {redis: {port: 6379, host: '127.0.0.1'}}); // Specify Redis connection using object diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index 28070ad44f..6cc4f5ed1d 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -228,11 +228,11 @@ declare namespace Bull { } interface JobCounts { - wait: number; active: number; completed: number; failed: number; delayed: number; + waiting: number; } interface JobInformation { @@ -384,21 +384,27 @@ declare namespace Bull { /** * Returns a promise that resolves when the queue is paused. - * The pause is global, meaning that all workers in all queue instances for a given queue will be paused. - * A paused queue will not process new jobs until resumed, - * but current jobs being processed will continue until they are finalized. + * + * A paused queue will not process new jobs until resumed, but current jobs being processed will continue until + * they are finalized. The pause can be either global or local. If global, all workers in all queue instances + * for a given queue will be paused. If local, just this worker will stop processing new jobs after the current + * lock expires. This can be useful to stop a worker from taking new jobs prior to shutting down. * * Pausing a queue that is already paused does nothing. */ - pause(): Promise; + pause(isLocal?: boolean): Promise; /** * Returns a promise that resolves when the queue is resumed after being paused. - * The resume is global, meaning that all workers in all queue instances for a given queue will be resumed. + * + * The resume can be either local or global. If global, all workers in all queue instances for a given queue + * will be resumed. If local, only this worker will be resumed. Note that resuming a queue globally will not + * resume workers that have been paused locally; for those, resume(true) must be called directly on their + * instances. * * Resuming a queue that is not paused does nothing. */ - resume(): Promise; + resume(isLocal?: boolean): Promise; /** * Returns a promise that returns the number of jobs in the queue, waiting or paused. @@ -445,6 +451,11 @@ declare namespace Bull { */ getFailed(start?: number, end?: number): Promise; + /** + * Returns a promise that will return an array with the waiting jobs between start and end. + */ + getWaiting(start?: number, end?: number): Promise; + /** * Returns JobInformation of repeatable jobs (ordered descending). Provide a start and/or an end * index to limit the number of results. Start defaults to 0, end to -1 and asc to false. diff --git a/types/bull/tsconfig.json b/types/bull/tsconfig.json index 3ce6f08792..6027d4730a 100644 --- a/types/bull/tsconfig.json +++ b/types/bull/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bull/v2/bull-tests.tsx b/types/bull/v2/bull-tests.tsx index fcf339b3c3..e6c82fe4f9 100644 --- a/types/bull/v2/bull-tests.tsx +++ b/types/bull/v2/bull-tests.tsx @@ -2,7 +2,7 @@ * Created by Bruno Grieder */ -import * as Queue from "bull" +import Queue = require("bull"); var videoQueue = Queue( 'video transcoding', 6379, '127.0.0.1' ); var audioQueue = Queue( 'audio transcoding', 6379, '127.0.0.1' ); diff --git a/types/bull/v2/tsconfig.json b/types/bull/v2/tsconfig.json index c0b2369568..980cf8d0cf 100644 --- a/types/bull/v2/tsconfig.json +++ b/types/bull/v2/tsconfig.json @@ -22,7 +22,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bump-regex/tsconfig.json b/types/bump-regex/tsconfig.json index 001effea6a..404f062975 100644 --- a/types/bump-regex/tsconfig.json +++ b/types/bump-regex/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "bump-regex-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bunnymq/tsconfig.json b/types/bunnymq/tsconfig.json index d1a470e451..10ba808afe 100644 --- a/types/bunnymq/tsconfig.json +++ b/types/bunnymq/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bunyan-blackhole/tsconfig.json b/types/bunyan-blackhole/tsconfig.json index 0266e86bae..21feb4a051 100644 --- a/types/bunyan-blackhole/tsconfig.json +++ b/types/bunyan-blackhole/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bunyan-bugsnag/bunyan-bugsnag-tests.ts b/types/bunyan-bugsnag/bunyan-bugsnag-tests.ts index 3c46089690..39a4c14cf5 100644 --- a/types/bunyan-bugsnag/bunyan-bugsnag-tests.ts +++ b/types/bunyan-bugsnag/bunyan-bugsnag-tests.ts @@ -1,4 +1,4 @@ -import * as bunyanBugsnag from 'bunyan-bugsnag'; +import bunyanBugsnag = require('bunyan-bugsnag'); import * as bunyan from 'bunyan'; const stream1 = bunyanBugsnag(); diff --git a/types/bunyan-bugsnag/tsconfig.json b/types/bunyan-bugsnag/tsconfig.json index 1910cbaf79..ddfbaa92ab 100644 --- a/types/bunyan-bugsnag/tsconfig.json +++ b/types/bunyan-bugsnag/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bunyan-config/tsconfig.json b/types/bunyan-config/tsconfig.json index 7866deb22e..818c7dad3f 100644 --- a/types/bunyan-config/tsconfig.json +++ b/types/bunyan-config/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bunyan-format/tsconfig.json b/types/bunyan-format/tsconfig.json index c26359cdb6..a40e9a48e5 100644 --- a/types/bunyan-format/tsconfig.json +++ b/types/bunyan-format/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "bunyan-format-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bunyan-logentries/tsconfig.json b/types/bunyan-logentries/tsconfig.json index f367f2fff8..0f9234b499 100644 --- a/types/bunyan-logentries/tsconfig.json +++ b/types/bunyan-logentries/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bunyan-prettystream/tsconfig.json b/types/bunyan-prettystream/tsconfig.json index ac589169ba..8cbd62ba10 100644 --- a/types/bunyan-prettystream/tsconfig.json +++ b/types/bunyan-prettystream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bunyan-winston-adapter/tsconfig.json b/types/bunyan-winston-adapter/tsconfig.json index 7278f5ac72..44b0bf2a41 100644 --- a/types/bunyan-winston-adapter/tsconfig.json +++ b/types/bunyan-winston-adapter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bunyan/tsconfig.json b/types/bunyan/tsconfig.json index 290ffc3a6d..dfda2cef0e 100644 --- a/types/bunyan/tsconfig.json +++ b/types/bunyan/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/busboy/busboy-tests.ts b/types/busboy/busboy-tests.ts index 24291621a5..309572a37c 100644 --- a/types/busboy/busboy-tests.ts +++ b/types/busboy/busboy-tests.ts @@ -1,4 +1,4 @@ -import * as Busboy from 'busboy'; +import Busboy = require('busboy'); import * as http from 'http'; import * as util from 'util'; diff --git a/types/busboy/tsconfig.json b/types/busboy/tsconfig.json index 6e60377b23..8e894f9794 100644 --- a/types/busboy/tsconfig.json +++ b/types/busboy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/business-rules-engine/tsconfig.json b/types/business-rules-engine/tsconfig.json index 385150055b..5a5b7469c1 100644 --- a/types/business-rules-engine/tsconfig.json +++ b/types/business-rules-engine/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bwip-js/bwip-js-tests.ts b/types/bwip-js/bwip-js-tests.ts index 29cc419d2c..d016b81ae5 100644 --- a/types/bwip-js/bwip-js-tests.ts +++ b/types/bwip-js/bwip-js-tests.ts @@ -1,4 +1,4 @@ -import * as bwipjs from 'bwip-js'; +import bwipjs = require('bwip-js'); import * as http from 'http'; import * as fs from 'fs'; diff --git a/types/bwip-js/tsconfig.json b/types/bwip-js/tsconfig.json index c421a4a7b6..8695c19f9f 100644 --- a/types/bwip-js/tsconfig.json +++ b/types/bwip-js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/byline/tsconfig.json b/types/byline/tsconfig.json index f21fc8983d..d4322a5534 100644 --- a/types/byline/tsconfig.json +++ b/types/byline/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bytebuffer/index.d.ts b/types/bytebuffer/index.d.ts index fca26b439f..0ed98f54c6 100644 --- a/types/bytebuffer/index.d.ts +++ b/types/bytebuffer/index.d.ts @@ -307,6 +307,11 @@ declare class ByteBuffer */ readByte( offset?: number ): number; + /** + * Reads the specified number of bytes + */ + readBytes( length: number, offset?: number): ByteBuffer; + /** * Reads a NULL-terminated UTF8 encoded string. For this to work the string read must not contain any NULL characters itself. */ @@ -508,6 +513,11 @@ declare class ByteBuffer */ writeByte( value: number, offset?: number ): ByteBuffer; + /** + * Writes an array of bytes. This is an alias for append + */ + writeBytes( source: ByteBuffer | ArrayBuffer | Uint8Array | string, encoding?: string | number, offset?: number ): ByteBuffer; + /** * Writes a NULL-terminated UTF8 encoded string. For this to work the specified string must not contain any NULL characters itself. */ diff --git a/types/bytebuffer/tsconfig.json b/types/bytebuffer/tsconfig.json index 5fdc833e9b..580d7bc39a 100644 --- a/types/bytebuffer/tsconfig.json +++ b/types/bytebuffer/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bytes/tsconfig.json b/types/bytes/tsconfig.json index 4de1fdb57a..b541397abf 100644 --- a/types/bytes/tsconfig.json +++ b/types/bytes/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/c3/c3-tests.ts b/types/c3/c3-tests.ts index 8ac8a4b93e..7ac2f0ccd8 100644 --- a/types/c3/c3-tests.ts +++ b/types/c3/c3-tests.ts @@ -152,7 +152,8 @@ function axis_examples() { fit: true, values: [1, 2, 4, 8, 16, 32], rotate: 60, - outer: false + outer: false, + width: 100 }, max: 100, min: -100, @@ -940,6 +941,26 @@ function axes_x_tick_fit() { }); } +function axes_x_tick_width() { + const chart = c3.generate({ + data: { + x: "x", + columns: [ + ["x", "2013-10-31", "2013-12-31", "2014-01-31", "2014-02-28"], + ["sample", 30, 100, 400, 150], + ] + }, + axis: { + x: { + type: "bar", + tick: { + width: 100 + } + } + } + }); +} + function axes_x_localtime() { const chart = c3.generate({ data: { @@ -1847,6 +1868,37 @@ function tooltip_format() { }); } +function tooltip_order() { + const chart = c3.generate({ + data: { + columns: [ + ["data1", 30, 200, 100, 400, 150, 250], + ["data2", 50, 20, 10, 40, 15, 25] + ] + }, + tooltip: { + order: 'asc' + } + }); +} + +function tooltip_order_function() { + const chart = c3.generate({ + data: { + columns: [ + ["data1", 30, 200, 100, 400, 150, 250], + ["data2", 50, 20, 10, 40, 15, 25] + ] + }, + tooltip: { + order: (data1, data2) => { + return data1.id - data2.id; + // return data2.id - data2.id in case we want desc order + } + } + }); +} + //////////////////////// // Chart options Tests //////////////////////// diff --git a/types/c3/index.d.ts b/types/c3/index.d.ts index 96ecc8c488..d68027f7d5 100644 --- a/types/c3/index.d.ts +++ b/types/c3/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Marc Climent // Gerin Jacob // Bernd Hacker +// Dzmitry Shyndzin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -61,6 +62,13 @@ export interface ChartConfiguration { left?: number; }; + resize?: { + /** + * Indicate if the chart should automatically get resized when the window gets resized. + */ + auto?: boolean; + }; + color?: { /** * Set custom color pattern. @@ -578,6 +586,10 @@ export interface XTickConfiguration { * Show x axis outer tick. */ outer?: boolean; + /** + * Set width of x axis tick. + */ + width?: number; multiline?: boolean; // Undocumented } @@ -730,6 +742,11 @@ export interface TooltipOptions { * Specified function receives data, defaultTitleFormat, defaultValueFormat and color of the data point to show. If tooltip.grouped is true, data includes multiple data points. */ contents?(data: any, defaultTitleFormat: string, defaultValueFormat: string, color: any): string; + /** + * Set tooltip values order + * Available Values: desc, asc, any[], function (data1, data2) { ... }, null + */ + order?: string | any[] | ((data1: any, data2: any) => number) | null; } export interface SubchartOptions { diff --git a/types/c3/tsconfig.json b/types/c3/tsconfig.json index fe3b00c503..6ec75e8352 100644 --- a/types/c3/tsconfig.json +++ b/types/c3/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cache-manager/tsconfig.json b/types/cache-manager/tsconfig.json index f754de4a67..68cda85b6b 100644 --- a/types/cache-manager/tsconfig.json +++ b/types/cache-manager/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cal-heatmap/tsconfig.json b/types/cal-heatmap/tsconfig.json index ff8d65a2e2..b803ce055b 100644 --- a/types/cal-heatmap/tsconfig.json +++ b/types/cal-heatmap/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/callsite/tsconfig.json b/types/callsite/tsconfig.json index 473c5c08fd..3210df01f9 100644 --- a/types/callsite/tsconfig.json +++ b/types/callsite/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/callsites/tsconfig.json b/types/callsites/tsconfig.json index 010199b740..6551532b88 100644 --- a/types/callsites/tsconfig.json +++ b/types/callsites/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/calq/tsconfig.json b/types/calq/tsconfig.json index 595f095f74..cecaa097cd 100644 --- a/types/calq/tsconfig.json +++ b/types/calq/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/camelcase-keys/tsconfig.json b/types/camelcase-keys/tsconfig.json index f99870f8d9..0774991702 100644 --- a/types/camelcase-keys/tsconfig.json +++ b/types/camelcase-keys/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/camelcase/tsconfig.json b/types/camelcase/tsconfig.json index bcc1b505e1..28d8446c42 100644 --- a/types/camelcase/tsconfig.json +++ b/types/camelcase/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/camljs/tsconfig.json b/types/camljs/tsconfig.json index 5fbe5605e9..ed88508fc3 100644 --- a/types/camljs/tsconfig.json +++ b/types/camljs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/camo/tsconfig.json b/types/camo/tsconfig.json index 46a6a2814c..089ef0623c 100644 --- a/types/camo/tsconfig.json +++ b/types/camo/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cancan/tsconfig.json b/types/cancan/tsconfig.json index 8aace9dd52..f746eff819 100644 --- a/types/cancan/tsconfig.json +++ b/types/cancan/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "cancan-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cannon/tsconfig.json b/types/cannon/tsconfig.json index ca5618a8a0..b75a303b0c 100644 --- a/types/cannon/tsconfig.json +++ b/types/cannon/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/canvas-gauges/tsconfig.json b/types/canvas-gauges/tsconfig.json index 07055c34bb..88a7c53ae5 100644 --- a/types/canvas-gauges/tsconfig.json +++ b/types/canvas-gauges/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/canvasjs/tsconfig.json b/types/canvasjs/tsconfig.json index 57f76052a9..3d14bb3e07 100644 --- a/types/canvasjs/tsconfig.json +++ b/types/canvasjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/capitalize/tsconfig.json b/types/capitalize/tsconfig.json index 463b6ca645..14a386e76d 100644 --- a/types/capitalize/tsconfig.json +++ b/types/capitalize/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/card-validator/tsconfig.json b/types/card-validator/tsconfig.json index 685e0c4bbe..cc89881539 100644 --- a/types/card-validator/tsconfig.json +++ b/types/card-validator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/case-sensitive-paths-webpack-plugin/tsconfig.json b/types/case-sensitive-paths-webpack-plugin/tsconfig.json index b8cb05390a..bddcd8721e 100644 --- a/types/case-sensitive-paths-webpack-plugin/tsconfig.json +++ b/types/case-sensitive-paths-webpack-plugin/tsconfig.json @@ -14,10 +14,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ "index.d.ts", "case-sensitive-paths-webpack-plugin-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/caseless/caseless-tests.ts b/types/caseless/caseless-tests.ts index 2fb16afaad..57eaae605e 100644 --- a/types/caseless/caseless-tests.ts +++ b/types/caseless/caseless-tests.ts @@ -1,4 +1,4 @@ -import caseless, { Caseless, httpify } from "caseless"; +import caseless, { Caseless, httpify, Httpified } from "caseless"; new Caseless(); // $ExpectError @@ -38,3 +38,20 @@ httpify({}, 1); // $ExpectError httpify({}, "2"); // $ExpectError httpify({}, {}); // $ExpectType Caseless + +const request: Httpified = {}; // $ExpectError + +request.setHeader({}); // $ExpectType void +request.setHeader('foo', 'bar'); // $ExpectType string | false +request.setHeader('foo', 'bar', false); // $ExpectType string | false +request.setHeader('foo', new Date()); // $ExpectType string | false +request.setHeader(10, 'bar'); // $ExpectError + +request.getHeader('foo'); // $ExpectType any +request.getHeader(10); // $ExpectError + +request.hasHeader('foo'); // $ExpectType string | false +request.hasHeader(10); // $ExpectError + +request.removeHeader('foo'); // $ExpectType boolean +request.headers = {}; diff --git a/types/caseless/index.d.ts b/types/caseless/index.d.ts index db295a8f89..9b19f8a150 100644 --- a/types/caseless/index.d.ts +++ b/types/caseless/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for caseless 0.12 // Project: https://github.com/mikeal/caseless // Definitions by: downace +// Matt R. Wilson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -17,6 +18,15 @@ export interface Caseless { del(name: KeyType): boolean; } +export interface Httpified { + headers: RawDict; + setHeader(name: KeyType, value: ValueType, clobber?: boolean): KeyType | false; + setHeader(dict: RawDict): void; + hasHeader(name: KeyType): KeyType | false; + getHeader(name: KeyType): ValueType | undefined; + removeHeader(name: KeyType): boolean; +} + export function httpify(resp: object, headers: RawDict): Caseless; declare function caseless(dict?: RawDict): Caseless; diff --git a/types/caseless/tsconfig.json b/types/caseless/tsconfig.json index c7dace4424..c153bc58d3 100644 --- a/types/caseless/tsconfig.json +++ b/types/caseless/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "caseless-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cash/tsconfig.json b/types/cash/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/cash/tsconfig.json +++ b/types/cash/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/casperjs/tsconfig.json b/types/casperjs/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/casperjs/tsconfig.json +++ b/types/casperjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/cassandra-driver/tsconfig.json b/types/cassandra-driver/tsconfig.json index e47bfd4444..5f7dffd9f9 100644 --- a/types/cassandra-driver/tsconfig.json +++ b/types/cassandra-driver/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/catalog/catalog-tests.tsx b/types/catalog/catalog-tests.tsx new file mode 100644 index 0000000000..c77c0c1667 --- /dev/null +++ b/types/catalog/catalog-tests.tsx @@ -0,0 +1,42 @@ +import * as React from "react"; +import { Config, render, markdown, Catalog, ReactSpecimen, Page } from "catalog"; + +const config: Config = { + title: 'Test', + pages: [ + { + path: '/', + title: 'Introduction', + content: '/patd/to/file.md', + }, + { + path: '/materials', + title: 'Materials', + pages: [ + { + path: '/materials/typeface', + title: 'Typeface', + component: , + }, + ], + }, + ], + useBrowserHistory: true, + basePath: '/doc', + responsiveSizes: [ + { name: 'large', width: 978, height: 1100 }, + { name: 'medium', width: 640, height: 900 }, + { name: 'small', width: 471, height: 700 }, + ], +}; + +render(config, document.body); +; + +markdown` +# Test + +${ +
+} +`; diff --git a/types/catalog/index.d.ts b/types/catalog/index.d.ts new file mode 100644 index 0000000000..515008d7de --- /dev/null +++ b/types/catalog/index.d.ts @@ -0,0 +1,108 @@ +// Type definitions for catalog 2.1 +// Project: https://github.com/interactivethings/catalog/ +// Definitions by: Peter Gassner , Tomas Carnecky +// Definitions: https://github.com/interactivethings/catalog/ +// TypeScript Version: 2.3 + +import * as React from "react"; + +// Configuration + +// XXX: Can not name this 'Page' because there's already a 'Page' +// component here. +export interface ConfigPage { + path: string; + title: string; + + content?: any; + component?: any; + pages?: ConfigPage[]; +} + +export interface ConfigResponsiveSize { + name: string; + width: number; + height: number; +} + +export interface Config { + title: string; + pages: ConfigPage[]; + + useBrowserHistory?: boolean; + basePath?: string; + responsiveSizes?: ConfigResponsiveSize[]; +} + +export function render(config: Config, element: HTMLElement): void; +export function configure(config: any): any; +export function configureRoutes(config: any): any; +export function configureJSXRoutes(config: any): any; + +export function pageLoader(f: () => Promise): any; +export function markdown(...x: any[]): JSX.Element; + +// Components +export interface DefaultCatalogProps extends React.Props<{}> { + span?: number; + theme?: any; +} + +export class Card extends React.Component {} +export class Page extends React.Component {} +export interface SpanProps extends DefaultCatalogProps { + style?: any; +} +export class Span extends React.Component {} + +// Specimens +export class AudioSpecimen extends React.Component {} + +export interface CodeSpecimenProps extends DefaultCatalogProps { + rawBody: string; + collapsed: boolean; + lang: string; + raw: boolean; +} +export class CodeSpecimen extends React.Component {} + +export interface ColorSpecimenProps extends DefaultCatalogProps { + value: string; + name: string; +} +export class ColorSpecimen extends React.Component {} + +export interface ColorPaletteSpecimenProps extends DefaultCatalogProps { + colors: Array<{name?: string, value: string}>; + horizontal?: boolean; +} +export class ColorPaletteSpecimen extends React.Component {} + +export class HtmlSpecimen extends React.Component {} +export class HintSpecimen extends React.Component {} +export class ImageSpecimen extends React.Component {} + +export interface TypeSpecimenProps extends DefaultCatalogProps { + color?: string; + font: string; + headings: string[] | number[]; + style?: string; + weight: string; +} +export class TypeSpecimen extends React.Component {} +export class DownloadSpecimen extends React.Component {} + +export interface ReactSpecimenProps extends DefaultCatalogProps { + noSource?: boolean; + plain?: boolean; + light?: boolean; + dark?: boolean; + frame?: boolean; + state?: any; + responsive?: boolean | string | string[]; +} +export class ReactSpecimen extends React.Component {} + +export class VideoSpecimen extends React.Component {} + +export class Catalog extends React.Component {} diff --git a/types/catalog/tsconfig.json b/types/catalog/tsconfig.json new file mode 100644 index 0000000000..00e00ca7a7 --- /dev/null +++ b/types/catalog/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "catalog-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/catalog/tslint.json b/types/catalog/tslint.json new file mode 100644 index 0000000000..b4b47a0378 --- /dev/null +++ b/types/catalog/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/catbox/tsconfig.json b/types/catbox/tsconfig.json index 16f6fb780e..424dece7ec 100644 --- a/types/catbox/tsconfig.json +++ b/types/catbox/tsconfig.json @@ -14,13 +14,16 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "catbox-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cbor/tsconfig.json b/types/cbor/tsconfig.json index 199ead141d..1211823d22 100644 --- a/types/cbor/tsconfig.json +++ b/types/cbor/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ccap/ccap-tests.ts b/types/ccap/ccap-tests.ts index 12a38a9f60..111fa2f457 100644 --- a/types/ccap/ccap-tests.ts +++ b/types/ccap/ccap-tests.ts @@ -1,4 +1,4 @@ -import * as ccap from 'ccap'; +import ccap = require('ccap'); const captcha1 = ccap(); diff --git a/types/ccap/tsconfig.json b/types/ccap/tsconfig.json index e4fa68a956..a043df5754 100644 --- a/types/ccap/tsconfig.json +++ b/types/ccap/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-arrays/tsconfig.json b/types/chai-arrays/tsconfig.json index 84b3de823b..f1d8d90394 100644 --- a/types/chai-arrays/tsconfig.json +++ b/types/chai-arrays/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-as-promised/tsconfig.json b/types/chai-as-promised/tsconfig.json index 2d1a15b6eb..002750f2df 100644 --- a/types/chai-as-promised/tsconfig.json +++ b/types/chai-as-promised/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-datetime/tsconfig.json b/types/chai-datetime/tsconfig.json index 93d28d082f..be6e164724 100644 --- a/types/chai-datetime/tsconfig.json +++ b/types/chai-datetime/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-dom/chai-dom-tests.ts b/types/chai-dom/chai-dom-tests.ts index 61b3b3c600..2cc7b0f232 100644 --- a/types/chai-dom/chai-dom-tests.ts +++ b/types/chai-dom/chai-dom-tests.ts @@ -1,5 +1,5 @@ import * as chai from 'chai'; -import * as chaiDom from 'chai-dom'; +import chaiDom = require('chai-dom'); chai.use(chaiDom); var expect = chai.expect; diff --git a/types/chai-dom/index.d.ts b/types/chai-dom/index.d.ts index 4338de92e2..8650ebca1d 100644 --- a/types/chai-dom/index.d.ts +++ b/types/chai-dom/index.d.ts @@ -23,6 +23,18 @@ declare namespace Chai { value(text: string): Assertion; + empty: Assertion; + + // exist, length, and contain are already defined in @types/chai and have the + // same type or a more general type, so don't need to be re-declared even though + // the implementation is different + + descendant(element: string|HTMLElement): Assertion; + + descendants(selector: string): Assertion; + + displayed: Assertion; + } interface Include { @@ -33,6 +45,12 @@ declare namespace Chai { } + interface Match { + + (selector: string): Assertion; + + } + } declare module "chai-dom" { diff --git a/types/chai-dom/tsconfig.json b/types/chai-dom/tsconfig.json index 8840510c78..e6c3147faf 100644 --- a/types/chai-dom/tsconfig.json +++ b/types/chai-dom/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-enzyme/chai-enzyme-tests.tsx b/types/chai-enzyme/chai-enzyme-tests.tsx index 4b88d077aa..70cd34f2fd 100644 --- a/types/chai-enzyme/chai-enzyme-tests.tsx +++ b/types/chai-enzyme/chai-enzyme-tests.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import * as chaiEnzyme from "chai-enzyme"; +import chaiEnzyme = require("chai-enzyme"); import { expect } from "chai"; import { shallow } from "enzyme"; diff --git a/types/chai-enzyme/tsconfig.json b/types/chai-enzyme/tsconfig.json index 4b7cdcf075..0beb02ded3 100644 --- a/types/chai-enzyme/tsconfig.json +++ b/types/chai-enzyme/tsconfig.json @@ -16,6 +16,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "react" }, "files": [ diff --git a/types/chai-fuzzy/tsconfig.json b/types/chai-fuzzy/tsconfig.json index c6254dc8d8..13b8041e55 100644 --- a/types/chai-fuzzy/tsconfig.json +++ b/types/chai-fuzzy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-http/tsconfig.json b/types/chai-http/tsconfig.json index 3554b4ab09..0f73b862cd 100644 --- a/types/chai-http/tsconfig.json +++ b/types/chai-http/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-jest-snapshot/tsconfig.json b/types/chai-jest-snapshot/tsconfig.json index ae15eb95a0..d466996d29 100644 --- a/types/chai-jest-snapshot/tsconfig.json +++ b/types/chai-jest-snapshot/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-jquery/index.d.ts b/types/chai-jquery/index.d.ts index e84a1ec272..bd6826ca08 100644 --- a/types/chai-jquery/index.d.ts +++ b/types/chai-jquery/index.d.ts @@ -27,6 +27,10 @@ declare namespace Chai { disabled(): Assertion; (selector: string): Assertion; } + + interface Match { + (selector: string): Assertion; + } } /** diff --git a/types/chai-jquery/tsconfig.json b/types/chai-jquery/tsconfig.json index b26a07d06d..b7a09dd6fd 100644 --- a/types/chai-jquery/tsconfig.json +++ b/types/chai-jquery/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-json-schema/tsconfig.json b/types/chai-json-schema/tsconfig.json index 9c8408ae05..fe54d634bf 100644 --- a/types/chai-json-schema/tsconfig.json +++ b/types/chai-json-schema/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-oequal/tsconfig.json b/types/chai-oequal/tsconfig.json index 0e63915d75..a2f5f9697e 100644 --- a/types/chai-oequal/tsconfig.json +++ b/types/chai-oequal/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-spies/tsconfig.json b/types/chai-spies/tsconfig.json index a439cf07a4..0125b21a90 100644 --- a/types/chai-spies/tsconfig.json +++ b/types/chai-spies/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-string/chai-string-tests.ts b/types/chai-string/chai-string-tests.ts index 615a6c1f95..dc798c102a 100644 --- a/types/chai-string/chai-string-tests.ts +++ b/types/chai-string/chai-string-tests.ts @@ -51,6 +51,90 @@ describe('chai-string', function() { }); + + describe('#containIgnoreSpaces', function () { + + it('should return true', function () { + var str1 = '1234abcdef56', + str2 = '1234a\nb\tc\r d ef56'; + str1.should.containIgnoreSpaces(str2); + }); + + it('should return true (2)', function () { + var str1 = 'abcdef', + str2 = 'a\nb\tc\r d ef'; + str1.should.containIgnoreSpaces(str2); + }); + + it('should return false', function () { + var str1 = 'abdef', + str2 = 'a\nb\tc\r d ef'; + str1.should.not.containIgnoreSpaces(str2); + }); + }); + + describe('#containIgnoreCase', function () { + + it('should return true', function () { + var str1 = 'abcdef', + str2 = 'cDe'; + str1.should.containIgnoreCase(str2); + }); + + it('should return true (2)', function () { + 'abcdef'.should.containIgnoreCase('cDe'); + }); + + it('should return true (3)', function () { + var str1 = 'abcdef', + str2 = 'AbCdeF'; + str1.should.containIgnoreCase(str2); + }); + + it('should return false', function () { + var str1 = 'abcdef', + str2 = 'efg'; + str1.should.not.containIgnoreCase(str2); + }); + + it('should return false (3)', function () { + var str1 = 'abcdef', + str2 = 'zabcd'; + str1.should.not.containIgnoreCase(str2); + }); + }); + + describe('#indexOf', function () { + + it('should return true', function () { + var str = 'abcabd', + substr = 'ab', + index = 0; + str.indexOf(substr, index).should.be.true; + }); + + it('should return true (2)', function () { + var str = 'abcabd', + substr = 'ca', + index = 2; + str.indexOf(substr, index).should.be.true; + }); + + it('should return true (3)', function () { + var str = 'ababab', + substr = 'ba', + index = 1; + str.indexOf(substr, index).should.be.true; + }); + + it('should return false', function () { + var str = 'abcaab', + substr = 'da', + index = 1; + str.indexOf(substr, index).should.be.false; + }); + }); + describe('tdd alias', function() { let str: string; let str2: string; @@ -92,6 +176,14 @@ describe('chai-string', function() { assert.notEqualIgnoreSpaces(str, str2 + 'g'); }); + it('.containIgnoreSpaces', function () { + assert.containIgnoreSpaces(str, str2); + }); + + it('.notContainIgnoreSpaces', function () { + assert.notContainIgnoreSpaces(str, str2 + 'g'); + }); + it('.singleLine', function() { assert.singleLine(str); }); @@ -125,5 +217,13 @@ describe('chai-string', function() { assert.entriesCount('', 'ab', 0); }); + it('.indexOf', function () { + assert.indexOf('abcabd', 'ab', 0); + assert.indexOf('abcabd', 'ca', 2); + assert.indexOf('ababab', 'ba', 1); + assert.indexOf('ababab', 'ba', 1); + 'ababab'.indexOf('ba', 1).should.be.true; + }); + }); }); diff --git a/types/chai-string/index.d.ts b/types/chai-string/index.d.ts index fad380cf07..bc990104be 100644 --- a/types/chai-string/index.d.ts +++ b/types/chai-string/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for chai-string 1.1.4 +// Type definitions for chai-string 1.4.0 // Project: https://github.com/onechiporenko/chai-string // Definitions by: Nick Malaguti // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -14,10 +14,13 @@ declare global { endWith(expected: string, message?: string): Assertion; equalIgnoreCase(expected: string, message?: string): Assertion; equalIgnoreSpaces(expected: string, message?: string): Assertion; + containIgnoreCase(expected: string, msg?: string): Assertion; + containIgnoreSpaces(expected: string, msg?: string): Assertion; singleLine(message?: string): Assertion; reverseOf(message?: string): Assertion; palindrome(message?: string): Assertion; entriesCount(substr: string, expected: number, message?: string): Assertion; + indexOf(str: string, substr: string, index: number, msg?: string): Assertion; } interface Assert { @@ -29,6 +32,10 @@ declare global { notEqualIgnoreCase(val: string, exp: string, msg?: string): void; equalIgnoreSpaces(val: string, exp: string, msg?: string): void; notEqualIgnoreSpaces(val: string, exp: string, msg?: string): void; + containIgnoreCase(val: string, exp: string, msg?: string): void; + notContainIgnoreCase(val: string, exp: string, msg?: string): void; + containIgnoreSpaces(val: string, exp: string, msg?: string): void; + notContainIgnoreSpaces(val: string, exp: string, msg?: string): void; singleLine(val: string, msg?: string): void; notSingleLine(val: string, msg?: string): void; reverseOf(val: string, exp: string, msg?: string): void; @@ -36,6 +43,7 @@ declare global { palindrome(val: string, msg?: string): void; notPalindrome(val: string, msg?: string): void; entriesCount(str: string, substr: string, count: number, msg?: string): void; + indexOf(str: string, substr: string, index: number, msg?: string): void; } } } diff --git a/types/chai-string/tsconfig.json b/types/chai-string/tsconfig.json index 1227af23ab..bfea2831a3 100644 --- a/types/chai-string/tsconfig.json +++ b/types/chai-string/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-subset/tsconfig.json b/types/chai-subset/tsconfig.json index c79fad5e82..3c4fceea1e 100644 --- a/types/chai-subset/tsconfig.json +++ b/types/chai-subset/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-things/tsconfig.json b/types/chai-things/tsconfig.json index 84e31abe2f..451820be5f 100644 --- a/types/chai-things/tsconfig.json +++ b/types/chai-things/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-webdriverio/tsconfig.json b/types/chai-webdriverio/tsconfig.json index c44958af89..6f99050ed5 100644 --- a/types/chai-webdriverio/tsconfig.json +++ b/types/chai-webdriverio/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-xml/tsconfig.json b/types/chai-xml/tsconfig.json index 95a0d68969..5c6cb3e360 100644 --- a/types/chai-xml/tsconfig.json +++ b/types/chai-xml/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai/index.d.ts b/types/chai/index.d.ts index 70bc0f2b67..02bca8909f 100644 --- a/types/chai/index.d.ts +++ b/types/chai/index.d.ts @@ -11,8 +11,6 @@ // Satana Charuwichitratana // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// - declare namespace Chai { interface ChaiStatic { expect: ExpectStatic; @@ -228,7 +226,7 @@ declare namespace Chai { } interface Match { - (regexp: RegExp|string, message?: string): Assertion; + (regexp: RegExp, message?: string): Assertion; } interface Keys { diff --git a/types/chai/tsconfig.json b/types/chai/tsconfig.json index 4e0c687060..eb0c557006 100644 --- a/types/chai/tsconfig.json +++ b/types/chai/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/chai/v2/tsconfig.json b/types/chai/v2/tsconfig.json index 927a017f3d..e2efdb7c51 100644 --- a/types/chai/v2/tsconfig.json +++ b/types/chai/v2/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/chance/tsconfig.json b/types/chance/tsconfig.json index f05e6076cc..660b15aed2 100644 --- a/types/chance/tsconfig.json +++ b/types/chance/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/change-emitter/tsconfig.json b/types/change-emitter/tsconfig.json index 208441aafa..e0c6ea9a00 100644 --- a/types/change-emitter/tsconfig.json +++ b/types/change-emitter/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/charm/tsconfig.json b/types/charm/tsconfig.json index 40eba0a076..8e481fdee8 100644 --- a/types/charm/tsconfig.json +++ b/types/charm/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/charset/tsconfig.json b/types/charset/tsconfig.json index 52652c8e44..089cfffc1c 100644 --- a/types/charset/tsconfig.json +++ b/types/charset/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "charset-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index d1e86fd317..8d2190478f 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -45,7 +45,14 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), { } }] }, - plugins: { arbitraryPlugin: {option: "value"} } + plugins: { arbitraryPlugin: {option: "value"} }, + legend: { + display: true, + labels: { + usePointStyle: true, + padding: 40 + } + }, } }); chart.update(); diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 614fbe26ef..db20617c2d 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -7,6 +7,8 @@ // Daniel Luz // Joseph Page // Dan Manastireanu +// Guillaume Rodriguez +// Sergey Rubanov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -36,10 +38,16 @@ declare class Chart { static defaults: { global: Chart.ChartOptions & Chart.ChartFontOptions; + [key: string]: any; + }; + + static controllers: { + [key: string]: any; }; } declare class PluginServiceStatic { - register(plugin?: PluginServiceRegistrationOptions): void; + register(plugin: PluginServiceRegistrationOptions): void; + unregister(plugin: PluginServiceRegistrationOptions): void; } interface PluginServiceRegistrationOptions { @@ -65,6 +73,13 @@ interface PluginServiceRegistrationOptions { beforeDatasetsDraw?(chartInstance: Chart, easing: string): void; afterDatasetsDraw?(chartInstance: Chart, easing: string): void; + // Called before drawing the `tooltip`. If any plugin returns `false`, + // the tooltip drawing is cancelled until another `render` is triggered. + beforeTooltipDraw?(chartInstance: Chart): void; + // Called after drawing the `tooltip`. Note that this hook will not, + // be called if the tooltip drawing has been previously cancelled. + afterTooltipDraw?(chartInstance: Chart): void; + destroy?(chartInstance: Chart): void; // Called when an event occurs on the chart @@ -105,6 +120,7 @@ declare namespace Chart { lineJoin?: string; lineWidth?: number; strokeStyle?: string; + pointStyle?: PointStyle; } interface ChartTooltipItem { @@ -217,6 +233,8 @@ declare namespace Chart { fontFamily?: string; padding?: number; generateLabels?(chart: any): any; + filter?(item: ChartLegendItem, data: ChartData): any; + usePointStyle?: boolean; } interface ChartTooltipOptions { @@ -533,6 +551,7 @@ declare namespace Chart { tooltipFormat?: string; unit?: TimeUnit; unitStepSize?: number; + stepSize?: number; minUnit?: TimeUnit; } diff --git a/types/chart.js/tsconfig.json b/types/chart.js/tsconfig.json index 3b5b6bffed..eb4278aa82 100644 --- a/types/chart.js/tsconfig.json +++ b/types/chart.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chartist/tsconfig.json b/types/chartist/tsconfig.json index afe951be86..d4b563655d 100644 --- a/types/chartist/tsconfig.json +++ b/types/chartist/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chayns/tsconfig.json b/types/chayns/tsconfig.json index 4ac301174a..b5b318b647 100644 --- a/types/chayns/tsconfig.json +++ b/types/chayns/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/check-sum/tsconfig.json b/types/check-sum/tsconfig.json index 5d2955a50f..655aac3937 100644 --- a/types/check-sum/tsconfig.json +++ b/types/check-sum/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/check-types/tsconfig.json b/types/check-types/tsconfig.json index d3c89a7ac7..95a7ed6992 100644 --- a/types/check-types/tsconfig.json +++ b/types/check-types/tsconfig.json @@ -1,21 +1,24 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": ["es6"], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "check-types-tests.ts" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "check-types-tests.ts" + ] } \ No newline at end of file diff --git a/types/checkstyle-formatter/tsconfig.json b/types/checkstyle-formatter/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/checkstyle-formatter/tsconfig.json +++ b/types/checkstyle-formatter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/checksum/tsconfig.json b/types/checksum/tsconfig.json index 21e5de17ab..7ef760cb8b 100644 --- a/types/checksum/tsconfig.json +++ b/types/checksum/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cheerio/cheerio-tests.ts b/types/cheerio/cheerio-tests.ts index 1a9821a6bb..d686951213 100644 --- a/types/cheerio/cheerio-tests.ts +++ b/types/cheerio/cheerio-tests.ts @@ -1,6 +1,4 @@ - - -import * as cheerio from 'cheerio'; +import cheerio = require('cheerio'); /* * LOADING diff --git a/types/cheerio/tsconfig.json b/types/cheerio/tsconfig.json index 63c3aed57c..772ae1fb47 100644 --- a/types/cheerio/tsconfig.json +++ b/types/cheerio/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chmodr/tsconfig.json b/types/chmodr/tsconfig.json index 44e07784ac..a5832362a1 100644 --- a/types/chmodr/tsconfig.json +++ b/types/chmodr/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chocolatechipjs/tsconfig.json b/types/chocolatechipjs/tsconfig.json index d56dd67e2d..158cf322ee 100644 --- a/types/chocolatechipjs/tsconfig.json +++ b/types/chocolatechipjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chokidar/tsconfig.json b/types/chokidar/tsconfig.json index 77a34a3964..b425370a98 100644 --- a/types/chokidar/tsconfig.json +++ b/types/chokidar/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chosen-js/tsconfig.json b/types/chosen-js/tsconfig.json index 9f4ce049cb..64efa066d5 100644 --- a/types/chosen-js/tsconfig.json +++ b/types/chosen-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chownr/tsconfig.json b/types/chownr/tsconfig.json index 7b20bfde66..9a71fc1aa4 100644 --- a/types/chownr/tsconfig.json +++ b/types/chownr/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chroma-js/tsconfig.json b/types/chroma-js/tsconfig.json index af142ac45e..efa5a84ce3 100644 --- a/types/chroma-js/tsconfig.json +++ b/types/chroma-js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chroma-js/v0/tsconfig.json b/types/chroma-js/v0/tsconfig.json index 93226eedaf..2b91bad45b 100644 --- a/types/chroma-js/v0/tsconfig.json +++ b/types/chroma-js/v0/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index 3d85d3be14..cd12179213 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -6050,6 +6050,12 @@ declare namespace chrome.tabs { * @since Chrome 39. */ matchAboutBlank?: boolean; + /** + * Optional. The origin of the CSS to inject. This may only be specified for CSS, not JavaScript. Defaults to "author". + * One of: "author", or "user" + * @since Chrome 66. + */ + cssOrigin?: string; } export interface CreateProperties { diff --git a/types/chrome/tsconfig.json b/types/chrome/tsconfig.json index 57e4524e5a..96b0958f3b 100644 --- a/types/chrome/tsconfig.json +++ b/types/chrome/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -26,4 +27,4 @@ "test/chrome-app.ts", "test/chrome-webview.ts" ] -} +} \ No newline at end of file diff --git a/types/chui/tsconfig.json b/types/chui/tsconfig.json index 5463478868..49c70bca09 100644 --- a/types/chui/tsconfig.json +++ b/types/chui/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/circular-json/tsconfig.json b/types/circular-json/tsconfig.json index 65bd131757..b64620dc44 100644 --- a/types/circular-json/tsconfig.json +++ b/types/circular-json/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ckeditor/index.d.ts b/types/ckeditor/index.d.ts index 20882269fd..cf7cd0cc27 100644 --- a/types/ckeditor/index.d.ts +++ b/types/ckeditor/index.d.ts @@ -24,6 +24,8 @@ declare namespace CKEDITOR { var DIALOG_RESIZE_HEIGHT: number; var DIALOG_RESIZE_NONE: number; var DIALOG_RESIZE_WIDTH: number; + var DIALOG_STATE_IDLE: number; + var DIALOG_STATE_BUSY: number; var ELEMENT_MODE_APPENDTO: number; var ELEMENT_MODE_INLINE: number; var ELEMENT_MODE_NONE: number; @@ -42,6 +44,10 @@ declare namespace CKEDITOR { var NODE_DOCUMENT_FRAGMENT: number; var NODE_ELEMENT: number; var NODE_TEXT: number; + var POSITION_BEFORE_START: number; + var POSITION_BEFORE_END: number; + var POSITION_AFTER_START: number; + var POSITION_AFTER_END: number; var SELECTION_ELEMENT: number; var SELECTION_NONE: number; var SELECTION_TEXT: number; @@ -49,6 +55,9 @@ declare namespace CKEDITOR { var SHRINK_ELEMENT: number; var SHRINK_TEXT: number; var START: number; + var STYLE_BLOCK: string; + var STYLE_INLINE: string; + var STYLE_OBJECT: string; var TRISTATE_DISABLED: number; var TRISTATE_OFF: number; var TRISTATE_ON: number; @@ -62,7 +71,7 @@ declare namespace CKEDITOR { var currentInstance: editor; var document: dom.document; var env: environmentConfig; - var instances: editor[]; + var instances: { [id: string]: editor | undefined }; var loadFullCoreTimeout: number; var revision: string; var rnd: number; @@ -92,9 +101,19 @@ declare namespace CKEDITOR { function replaceAll(className?: string): void; function replaceAll(assertionFunction: (textarea: HTMLTextAreaElement, config: config) => boolean): void; + type listenerRegistration = { + removeListener: () => void; + } namespace dom { + interface bookmark { + startNode: dom.node | string; + endNode: dom.node | string; + serializable: boolean; + collapsed: boolean; + } + class comment { // Properties @@ -269,16 +288,17 @@ declare namespace CKEDITOR { class elementPath { constructor(startNode: element, root: element); + constructor(startNode: element); block: element; blockLimit: element; root: element; elements: element[]; compare(otherPath: elementPath): boolean; - contains(query: string, excludeRoot: boolean, fromTop: boolean): element; - contains(query: string[], excludeRoot: boolean, fromTop: boolean): element; - contains(query: (element: element) => boolean, excludeRoot: boolean, fromTop: boolean): element; - contains(query: Object, excludeRoot: boolean, fromTop: boolean): element; - contains(query: element, excludeRoot: boolean, fromTop: boolean): element; + contains(query: string, excludeRoot?: boolean, fromTop?: boolean): element; + contains(query: string[], excludeRoot?: boolean, fromTop?: boolean): element; + contains(query: (element: element) => boolean, excludeRoot?: boolean, fromTop?: boolean): element; + contains(query: Object, excludeRoot?: boolean, fromTop?: boolean): element; + contains(query: element, excludeRoot?: boolean, fromTop?: boolean): element; isContextFor(tag: string): boolean; direction(): string; } @@ -300,7 +320,7 @@ declare namespace CKEDITOR { cloneContents(): documentFragment; deleteContents(mergeThen?: boolean): void; extractContents(mergeThen?: boolean): documentFragment; - createBookmark(serializable: boolean): Object; + createBookmark(serializable?: boolean): bookmark; createBookmark2(normalized: boolean): Object; createIterator(): iterator; moveToBookmark(bookmark: Object): void; @@ -322,6 +342,7 @@ declare namespace CKEDITOR { setStartAt(node: node, position: number): void; setEndAt(node: node, position: number): void; fixBlock(isStart: boolean, blockTag: Object): Object; + select(): selection; splitBlock(blockTag: Object): Object; splitElement(toSplit: element): element; removeEmptyBlocksAtEnd(atEnd: boolean): void; @@ -815,7 +836,7 @@ declare namespace CKEDITOR { templates_files?: Object; templates_replaceContent?: boolean; title?: string | boolean; - toolbar?: string | (string | string[])[]; + toolbar?: string | (string | string[] | { name: string, items?: string[], groups?: string[] })[] | null; toolbarCanCollapse?: boolean; toolbarGroupCycling?: boolean; toolbarGroups?: (toolbarGroups | string)[]; @@ -847,14 +868,20 @@ declare namespace CKEDITOR { bottom?: string | HTMLElement; } + module skin { + var icons: { [name: string]: { path: string } }; + function addIcon(name: string, path: string, offset?: number, bgsize?: string): void; + } - interface style { - - } - - - interface editable { + class style { + constructor(something: { element: string, attributes: { [att: string]: string } }); + applyToRange(range: Range, editor: editor): void; + } + interface editable extends dom.element { + hasFocus: boolean; + attachListener(obj: event | editable, eventName: string, listenerFunction: (ei: eventInfo) => void, + scopeobj?: {}, listenerData?: any, priority?: number): listenerRegistration; } @@ -951,11 +978,14 @@ declare namespace CKEDITOR { destroy(widget: CKEDITOR.plugins.widget, offline?: boolean): void; destroyAll(offline?: boolean): void; finalizeCreation(container: any): void; + focused: widget; fire(eventName: string, data: Object, editor: editor): any; // should be boolean | Object getByElement(element: any, checkWrapperOnly: boolean): CKEDITOR.plugins.widget; hasListeners(eventName: string): boolean; - initOn(element: any, widgetDef?: CKEDITOR.plugins.widget.definition, startupData?: Object): CKEDITOR.plugins.widget; - initOnAll(container?: any): CKEDITOR.plugins.widget[]; + initOn(element: dom.element, widgetDef?: CKEDITOR.plugins.widget.definition, startupData?: Object): CKEDITOR.plugins.widget; + initOn(element: dom.element, widgetDef?: string, startupData?: Object): CKEDITOR.plugins.widget; + initOnAll(container?: dom.element): CKEDITOR.plugins.widget[]; + instances: { [id: string]: widget }; on(eventName: string, listenerFunction: Function, scopeObj?: Object, listenerData?: Object, priority?: number): any; once(): void; parseElementClasses(classes: string): any; @@ -1040,12 +1070,13 @@ declare namespace CKEDITOR { requires?: string | string[]; afterInit?(editor: editor): any; beforeInit?(editor: editor): any; - init?(editor: editor): any; + init?(editor: editor): void; onLoad?(): any; icons?: string; } - function add(name: string, definition?: IPluginDefinition): void; + function add(name: string, definition: IPluginDefinition): void; + function add(name: string): void; function addExternal(name: string, path: string, fileName: string): void; function get(name: string): any; function getFilePath(name: string): string; @@ -1058,6 +1089,7 @@ declare namespace CKEDITOR { interface IMenuItemDefinition { label:string, command:string, + icon: string group:string, order:number } @@ -1110,6 +1142,7 @@ declare namespace CKEDITOR { createFakeParserElement(realElement: Object, className: Object, realElementType: Object, isResizable: Object): void; createRange(): dom.range; destroy(noUpdate?: boolean): void; + editable(): editable | null; editable(elementOrEditable: dom.element): void; editable(elementOrEditable: editable): void; elementPath(startNode?: dom.node): dom.elementPath; @@ -1267,8 +1300,14 @@ declare namespace CKEDITOR { stop(): void; } + module filter { + interface allowedContentRules { + + } + } class filter { + allow(newRules: CKEDITOR.filter.allowedContentRules, featureName?: string, overrideCustom?: boolean): boolean; } @@ -1309,8 +1348,8 @@ declare namespace CKEDITOR { fire(eventName: string, data?: Object, editor?: editor): any; fireOnce(eventName: string, data?: Object, editor?: editor): any; hasListeners(eventName: string): boolean; - on(eventName: string, listenerFunction: (eventInfo: eventInfo) => void, scopeObj?: Object, listenerData?: Object, priority?: number): void; - once(eventName: string, listenerFunction: (eventInfo: eventInfo) => void, scopeObj?: Object, listenerData?: Object, priority?: number): void; + on(eventName: string, listenerFunction: (eventInfo: eventInfo) => void, scopeObj?: Object | null, listenerData?: Object | null, priority?: number): listenerRegistration; + once(eventName: string, listenerFunction: (eventInfo: eventInfo) => void, scopeObj?: Object | null, listenerData?: Object | null, priority?: number): listenerRegistration; removeAllListeners(): void; removeListener(eventName: string, listenerFunction: (eventInfo: eventInfo) => void): void; static implementOn(targetObject: Object): void; @@ -1768,6 +1807,7 @@ declare namespace CKEDITOR { constructor(value: string); type: number; filter(filter: filter): boolean; + value: string; writeHtml(writer: basicWriter, filter: filter): void; } @@ -1779,6 +1819,7 @@ declare namespace CKEDITOR { children: any[]; type: number; add(node: node): number; + add(node: node, index: number): void; clone(): element; filter(filter: filter): boolean; filterChildren(filter: filter): void; @@ -1803,10 +1844,12 @@ declare namespace CKEDITOR { children: any[]; parent: any; type: number; - fromHtml(fragmentHtml: string, parent?: element, fixingBlock?: string): void; - fromHtml(fragmentHtml: string, parent?: string, fixingBlock?: string): void; - fromHtml(fragmentHtml: string, parent?: element, fixingBlock?: boolean): void; - fromHtml(fragmentHtml: string, parent?: string, fixingBlock?: boolean): void; + static fromHtml(fragmentHtml: string): fragment; + static fromHtml(fragmentHtml: string, parent?: element, fixingBlock?: string): fragment | element; + static fromHtml(fragmentHtml: string, parent: null, fixingBlock?: string): fragment; + static fromHtml(fragmentHtml: string, parent?: string, fixingBlock?: string): fragment | element; + static fromHtml(fragmentHtml: string, parent?: element, fixingBlock?: boolean): fragment | element; + static fromHtml(fragmentHtml: string, parent?: string, fixingBlock?: boolean): fragment | element; add(node: node, index?: number): void; filter(filter: filter): void; filterChildren(filter: filter, filterRoot?: boolean): void; @@ -1847,7 +1890,9 @@ declare namespace CKEDITOR { namespace tools { var callFunction: Function; - function enableHtml5Elements(doc: Object, withAppend? : Boolean) : void; + function enableHtml5Elements(doc: Object, withAppend?: Boolean): void; + function parseCssText(styleText: string, normalize?: Boolean, nativeNormalize?: Boolean): { [key: string]: string } + function writeCssText(style: { [key: string]: string }, sort?: Boolean): string; } diff --git a/types/ckeditor/tsconfig.json b/types/ckeditor/tsconfig.json index e845e96c0a..5d44d8a447 100644 --- a/types/ckeditor/tsconfig.json +++ b/types/ckeditor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/clamp-js-main/tsconfig.json b/types/clamp-js-main/tsconfig.json index 5c05321afc..716247df25 100644 --- a/types/clamp-js-main/tsconfig.json +++ b/types/clamp-js-main/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "clamp-js-main-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/clamp-js/tsconfig.json b/types/clamp-js/tsconfig.json index d858957f4b..3df9b8641f 100644 --- a/types/clamp-js/tsconfig.json +++ b/types/clamp-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/classnames/tsconfig.json b/types/classnames/tsconfig.json index f9b03432fc..2e41facc15 100644 --- a/types/classnames/tsconfig.json +++ b/types/classnames/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cldrjs/tsconfig.json b/types/cldrjs/tsconfig.json index b17ea4c0a9..9ae399aafb 100644 --- a/types/cldrjs/tsconfig.json +++ b/types/cldrjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/clean-css/tsconfig.json b/types/clean-css/tsconfig.json index fe65b21c11..0d5b17fb3b 100644 --- a/types/clean-css/tsconfig.json +++ b/types/clean-css/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/clean-stack/tsconfig.json b/types/clean-stack/tsconfig.json index e1fa33ac6c..e4e4814fe9 100644 --- a/types/clean-stack/tsconfig.json +++ b/types/clean-stack/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/clean-webpack-plugin/tsconfig.json b/types/clean-webpack-plugin/tsconfig.json index 2f342b4d42..c53b713f88 100644 --- a/types/clean-webpack-plugin/tsconfig.json +++ b/types/clean-webpack-plugin/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "clean-webpack-plugin-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/clear-require/tsconfig.json b/types/clear-require/tsconfig.json index 538fbe385e..806bd7fc11 100644 --- a/types/clear-require/tsconfig.json +++ b/types/clear-require/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cleave.js/cleave.js-tests.tsx b/types/cleave.js/cleave.js-tests.tsx index 3bbc6570a3..825b44a2ad 100644 --- a/types/cleave.js/cleave.js-tests.tsx +++ b/types/cleave.js/cleave.js-tests.tsx @@ -3,7 +3,12 @@ import Cleave = require("cleave.js"); import CleaveReact = require("cleave.js/react"); const Example1 = () => { - Cleave("#my-input", { phone: true }); + const cleave = new Cleave("#my-input", { phone: true }); + cleave.setPhoneRegionCode("AT"); + cleave.setRawValue("foo"); + const foo: string = cleave.getFormattedValue(); + const bar: string = cleave.getRawValue(); + cleave.destroy(); }; const ExampleReact1 = (props: any) => { diff --git a/types/cleave.js/index.d.ts b/types/cleave.js/index.d.ts index 17e8c1c512..eae6bc75b9 100644 --- a/types/cleave.js/index.d.ts +++ b/types/cleave.js/index.d.ts @@ -1,10 +1,25 @@ -// Type definitions for cleave.js 1.0 +// Type definitions for cleave.js 1.1 // Project: https://github.com/nosir/cleave.js -// Definitions by: C Lentfort , J Giancono +// Definitions by: C Lentfort , +// J Giancono , +// Alex Shakun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 import { CleaveOptions } from './options'; -declare function Cleave(selector: string, options: CleaveOptions): void; +declare class Cleave { + constructor(selector: string, options: CleaveOptions); + + getRawValue(): string; + + setRawValue(value: string): void; + + getFormattedValue(): string; + + destroy(): void; + + setPhoneRegionCode(regionCode: string): void; +} + export = Cleave; diff --git a/types/cleave.js/react/index.d.ts b/types/cleave.js/react/index.d.ts index 6d40ea4ed5..1f50cbdbf3 100644 --- a/types/cleave.js/react/index.d.ts +++ b/types/cleave.js/react/index.d.ts @@ -6,6 +6,7 @@ type InitHandler = (owner: React.ReactInstance) => void; interface Props extends React.InputHTMLAttributes { onInit?: InitHandler; options: CleaveOptions; + htmlRef?: (i: any) => void; } declare var Cleave: React.ComponentClass; diff --git a/types/cleave.js/tsconfig.json b/types/cleave.js/tsconfig.json index 40e69541bc..40b7d000c9 100644 --- a/types/cleave.js/tsconfig.json +++ b/types/cleave.js/tsconfig.json @@ -16,6 +16,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "react" }, "files": [ @@ -24,4 +25,4 @@ "options.d.ts", "react/index.d.ts" ] -} +} \ No newline at end of file diff --git a/types/cli-color/tsconfig.json b/types/cli-color/tsconfig.json index 4e8bceb94b..933f6db918 100644 --- a/types/cli-color/tsconfig.json +++ b/types/cli-color/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cli-spinner/tsconfig.json b/types/cli-spinner/tsconfig.json index 61c966becc..316be5cb01 100644 --- a/types/cli-spinner/tsconfig.json +++ b/types/cli-spinner/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "cli-spinner-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cli-table2/tsconfig.json b/types/cli-table2/tsconfig.json index 4d5bea5b9d..40718ddc19 100644 --- a/types/cli-table2/tsconfig.json +++ b/types/cli-table2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cli/tsconfig.json b/types/cli/tsconfig.json index 2a1b78ae92..6713e9be0c 100644 --- a/types/cli/tsconfig.json +++ b/types/cli/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/client-sessions/tsconfig.json b/types/client-sessions/tsconfig.json index c1556587bc..07f4f1048c 100644 --- a/types/client-sessions/tsconfig.json +++ b/types/client-sessions/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cliff/tsconfig.json b/types/cliff/tsconfig.json index 8c59f5c533..3edd8ddc45 100644 --- a/types/cliff/tsconfig.json +++ b/types/cliff/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/clipboard-js/tsconfig.json b/types/clipboard-js/tsconfig.json index 8927797525..ed9c969743 100644 --- a/types/clipboard-js/tsconfig.json +++ b/types/clipboard-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/clipboard/clipboard-tests.ts b/types/clipboard/clipboard-tests.ts index 361ccddd93..e92bbf30ba 100644 --- a/types/clipboard/clipboard-tests.ts +++ b/types/clipboard/clipboard-tests.ts @@ -1,28 +1,28 @@ -import * as Clipboard from 'clipboard'; +import * as Clipboard from "clipboard"; -const cb1 = new Clipboard('.btn'); -const cb2 = new Clipboard(document.getElementById('id'), { - action: elem => 'copy' +const cb1 = new Clipboard(".btn"); +const cb2 = new Clipboard(document.getElementById("id"), { + action: elem => "copy" }); -const cb3 = new Clipboard(document.querySelectorAll('query'), { +const cb3 = new Clipboard(document.querySelectorAll("query"), { text: elem => null }); -const cb4 = new Clipboard('.btn', { +const cb4 = new Clipboard(".btn", { target: elem => null }); -const cb5 = new Clipboard('.btn', { - action: elem => 'copy', +const cb5 = new Clipboard(".btn", { + action: elem => "copy", target: elem => null }); cb1.destroy(); -cb1.isSupported(); +Clipboard.isSupported(); -cb2.on('success', e => { - console.info('Action:', e.action); - console.info('Text:', e.text); - console.info('Trigger:', e.trigger); +cb2.on("success", e => { + console.info("Action:", e.action); + console.info("Text:", e.text); + console.info("Trigger:", e.trigger); e.clearSelection(); }); -cb2.on('error', e => { }); +cb2.on("error", e => {}); diff --git a/types/clipboard/index.d.ts b/types/clipboard/index.d.ts index 76d28674d6..61b27cbb32 100644 --- a/types/clipboard/index.d.ts +++ b/types/clipboard/index.d.ts @@ -4,7 +4,10 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare class Clipboard { - constructor(selector: (string | Element | NodeListOf), options?: Clipboard.Options); + constructor( + selector: string | Element | NodeListOf, + options?: Clipboard.Options + ); /** * Subscribes to events that indicate the result of a copy/cut operation. @@ -22,7 +25,7 @@ declare class Clipboard { /** * Checks if clipboard.js is supported */ - isSupported(): boolean; + static isSupported(): boolean; } declare namespace Clipboard { diff --git a/types/clipboard/tsconfig.json b/types/clipboard/tsconfig.json index 5d960d2fd4..96e74d7bbc 100644 --- a/types/clipboard/tsconfig.json +++ b/types/clipboard/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/clipboardy/tsconfig.json b/types/clipboardy/tsconfig.json index 6d6bfcc76a..34c70f2c86 100644 --- a/types/clipboardy/tsconfig.json +++ b/types/clipboardy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/clndr/tsconfig.json b/types/clndr/tsconfig.json index df25d1b075..9708a8b2b4 100644 --- a/types/clndr/tsconfig.json +++ b/types/clndr/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/clockpicker/tsconfig.json b/types/clockpicker/tsconfig.json index 64b80a0278..61aa239cea 100644 --- a/types/clockpicker/tsconfig.json +++ b/types/clockpicker/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "clockpicker-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/clone/tsconfig.json b/types/clone/tsconfig.json index 65bd178331..024e8a97fa 100644 --- a/types/clone/tsconfig.json +++ b/types/clone/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/closure-compiler/tsconfig.json b/types/closure-compiler/tsconfig.json index 4a15360b18..5f78d4927e 100644 --- a/types/closure-compiler/tsconfig.json +++ b/types/closure-compiler/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cloud-env/tsconfig.json b/types/cloud-env/tsconfig.json index 0972bef4e5..bbdc4f5f5c 100644 --- a/types/cloud-env/tsconfig.json +++ b/types/cloud-env/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cloudflare-apps/tsconfig.json b/types/cloudflare-apps/tsconfig.json index b521ed0aca..0dcc8d43cd 100644 --- a/types/cloudflare-apps/tsconfig.json +++ b/types/cloudflare-apps/tsconfig.json @@ -20,6 +20,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "preserve" } } \ No newline at end of file diff --git a/types/cls-hooked/tsconfig.json b/types/cls-hooked/tsconfig.json index 2e4da612f6..55af57a7cd 100644 --- a/types/cls-hooked/tsconfig.json +++ b/types/cls-hooked/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/clusterize.js/tsconfig.json b/types/clusterize.js/tsconfig.json index 10ca5c2a1a..dd8e3e7899 100644 --- a/types/clusterize.js/tsconfig.json +++ b/types/clusterize.js/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "clusterize.js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cmd-shim/tsconfig.json b/types/cmd-shim/tsconfig.json index 753e3b8c58..cb447abdcb 100644 --- a/types/cmd-shim/tsconfig.json +++ b/types/cmd-shim/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "cmd-shim-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/co-body/co-body-tests.ts b/types/co-body/co-body-tests.ts index 944cadd394..0b15f2bcc5 100644 --- a/types/co-body/co-body-tests.ts +++ b/types/co-body/co-body-tests.ts @@ -1,5 +1,5 @@ -import * as koa from 'koa'; -import * as parse from 'co-body'; +import koa = require('koa'); +import parse = require('co-body'); var app = new koa(); diff --git a/types/co-body/tsconfig.json b/types/co-body/tsconfig.json index 295cfcd7cd..3c6c8ea708 100644 --- a/types/co-body/tsconfig.json +++ b/types/co-body/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/co-views/tsconfig.json b/types/co-views/tsconfig.json index 8b129766a5..388ba1bd29 100644 --- a/types/co-views/tsconfig.json +++ b/types/co-views/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/code/tsconfig.json b/types/code/tsconfig.json index ae86da199a..610eae1463 100644 --- a/types/code/tsconfig.json +++ b/types/code/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/codemirror/tsconfig.json b/types/codemirror/tsconfig.json index 2ff349d98e..fdf3bf2d28 100644 --- a/types/codemirror/tsconfig.json +++ b/types/codemirror/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/codependency/tsconfig.json b/types/codependency/tsconfig.json index 990aecea5d..f770e7ed61 100644 --- a/types/codependency/tsconfig.json +++ b/types/codependency/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/coffeeify/tsconfig.json b/types/coffeeify/tsconfig.json index 0ed14ee2f2..2ab8b32406 100644 --- a/types/coffeeify/tsconfig.json +++ b/types/coffeeify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/coinbase/tsconfig.json b/types/coinbase/tsconfig.json index 6f8b261d27..3732908a04 100644 --- a/types/coinbase/tsconfig.json +++ b/types/coinbase/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "coinbase-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/coinstring/tsconfig.json b/types/coinstring/tsconfig.json index 43ca980dbb..902dc00b80 100644 --- a/types/coinstring/tsconfig.json +++ b/types/coinstring/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/collections/tsconfig.json b/types/collections/tsconfig.json index 466c5b12c4..2916e1a806 100644 --- a/types/collections/tsconfig.json +++ b/types/collections/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/color-convert/tsconfig.json b/types/color-convert/tsconfig.json index 52c14017a1..3ce21ead77 100644 --- a/types/color-convert/tsconfig.json +++ b/types/color-convert/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/color-name/tsconfig.json b/types/color-name/tsconfig.json index 56777b5a12..a88783ad70 100644 --- a/types/color-name/tsconfig.json +++ b/types/color-name/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "baseUrl": "../", "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "lib": [ "es6" ], diff --git a/types/color-string/tsconfig.json b/types/color-string/tsconfig.json index 27f7f9f5f1..a9ef4a043c 100644 --- a/types/color-string/tsconfig.json +++ b/types/color-string/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/color/color-tests.ts b/types/color/color-tests.ts index 4e475a0ce0..ac79ea42e9 100644 --- a/types/color/color-tests.ts +++ b/types/color/color-tests.ts @@ -25,8 +25,8 @@ const yellow: number = color.yellow(); const black: number = color.black(); const luminosity: number = color.luminosity(); const contrast: number = color.contrast(colorOther); -const dark: boolean = color.dark(); -const light: boolean = color.light(); +const isDark: boolean = color.isDark(); +const isLight: boolean = color.isLight(); const level: string = color.level(colorOther); const x: number = color.x(); diff --git a/types/color/index.d.ts b/types/color/index.d.ts index 8290b78129..716b8a9dcf 100644 --- a/types/color/index.d.ts +++ b/types/color/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for color 2.0 +// Type definitions for color 3.0 // Project: https://github.com/qix-/color#readme -// Definitions by: Junyoung Clare Jang +// Definitions by: Junyoung Clare Jang , James W. Lane // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -72,8 +72,8 @@ interface Color { luminosity(): number; contrast(color2: Color): number; level(color2: Color): 'AAA' | 'AA' | ''; - dark(): boolean; - light(): boolean; + isDark(): boolean; + isLight(): boolean; negate(): Color; lighten(ratio: number): Color; darken(ratio: number): Color; diff --git a/types/color/tsconfig.json b/types/color/tsconfig.json index 0924b02ae0..2cd717e58a 100644 --- a/types/color/tsconfig.json +++ b/types/color/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/color/v0/tsconfig.json b/types/color/v0/tsconfig.json index 73f49d6375..f73dc07711 100644 --- a/types/color/v0/tsconfig.json +++ b/types/color/v0/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/color/v1/tsconfig.json b/types/color/v1/tsconfig.json index 8d8204cf87..1e8e29f876 100644 --- a/types/color/v1/tsconfig.json +++ b/types/color/v1/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/color/v2/color-tests.ts b/types/color/v2/color-tests.ts new file mode 100644 index 0000000000..4e475a0ce0 --- /dev/null +++ b/types/color/v2/color-tests.ts @@ -0,0 +1,65 @@ +import Color = require('color'); + +const color: Color = new Color("white"); +const colorOther: Color = new Color("black"); +const colorRGB: Color = new Color({ r: 0, g: 0, b: 0 }, "rgb"); +const colorInt: Color = new Color(0x000000); +const colorWithoutNew: Color = Color(0x000000); +const colorByStaticMethod: Color = Color.rgb({ r: 0, g: 0, b: 0 }); + +const hex: string = color.hex(); +const percent: string = color.percentString(); +const keyword: string = color.keyword(); +const alpha: number = color.alpha(); +const red: number = color.red(); +const green: number = color.green(); +const blue: number = color.blue(); +const hue: number = color.hue(); +const saturationl: number = color.saturationl(); +const lightness: number = color.lightness(); +const saturationv: number = color.saturationv(); +const value: number = color.value(); +const cyan: number = color.cyan(); +const magenta: number = color.magenta(); +const yellow: number = color.yellow(); +const black: number = color.black(); +const luminosity: number = color.luminosity(); +const contrast: number = color.contrast(colorOther); +const dark: boolean = color.dark(); +const light: boolean = color.light(); +const level: string = color.level(colorOther); + +const x: number = color.x(); +const y: number = color.y(); +const z: number = color.z(); +const l: number = color.l(); +const a: number = color.a(); +const b: number = color.b(); +const rgbNumber: number = color.rgbNumber(); + +const chain: Color = color + .alpha(0) + .red(0) + .green(0) + .blue(0) + .hue(0) + .saturationl(0) + .lightness(0) + .saturationv(0) + .value(0) + .cyan(0) + .magenta(0) + .yellow(0) + .black(0) + .negate() + .lighten(0) + .darken(0) + .saturate(0) + .desaturate(0) + .grayscale() + .whiten(0) + .blacken(0) + .opaquer(0) + .rotate(0) + .mix(colorOther, 0) + .hsl(); diff --git a/types/color/v2/index.d.ts b/types/color/v2/index.d.ts new file mode 100644 index 0000000000..8290b78129 --- /dev/null +++ b/types/color/v2/index.d.ts @@ -0,0 +1,135 @@ +// Type definitions for color 2.0 +// Project: https://github.com/qix-/color#readme +// Definitions by: Junyoung Clare Jang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import convert = require('color-convert'); + +type ColorParam = Color | string | ArrayLike | number | { [key: string]: any }; + +interface Color { + toString(): string; + toJSON(): Color; + string(places?: number): string; + percentString(places?: number): string; + array(): number[]; + object(): { alpha?: number } & { [key: string]: number }; + unitArray(): number[]; + unitObject(): { r: number, g: number, b: number, alpha?: number }; + round(places?: number): Color; + alpha(): number; + alpha(val: number): Color; + red(): number; + red(val: number): Color; + green(): number; + green(val: number): Color; + blue(): number; + blue(val: number): Color; + hue(): number; + hue(val: number): Color; + saturationl(): number; + saturationl(val: number): Color; + lightness(): number; + lightness(val: number): Color; + saturationv(): number; + saturationv(val: number): Color; + value(): number; + value(val: number): Color; + chroma(): number; + chroma(val: number): Color; + gray(): number; + gray(val: number): Color; + white(): number; + white(val: number): Color; + wblack(): number; + wblack(val: number): Color; + cyan(): number; + cyan(val: number): Color; + magenta(): number; + magenta(val: number): Color; + yellow(): number; + yellow(val: number): Color; + black(): number; + black(val: number): Color; + x(): number; + x(val: number): Color; + y(): number; + y(val: number): Color; + z(): number; + z(val: number): Color; + l(): number; + l(val: number): Color; + a(): number; + a(val: number): Color; + b(): number; + b(val: number): Color; + keyword(): string; + keyword(val: string): Color; + hex(): string; + hex(val: string): Color; + rgbNumber(): number; + luminosity(): number; + contrast(color2: Color): number; + level(color2: Color): 'AAA' | 'AA' | ''; + dark(): boolean; + light(): boolean; + negate(): Color; + lighten(ratio: number): Color; + darken(ratio: number): Color; + saturate(ratio: number): Color; + desaturate(ratio: number): Color; + whiten(ratio: number): Color; + blacken(ratio: number): Color; + grayscale(): Color; + fade(ratio: number): Color; + opaquer(ratio: number): Color; + rotate(degrees: number): Color; + mix(mixinColor: Color, weight?: number): Color; + + rgb(...args: number[]): Color; + hsl(...args: number[]): Color; + hsv(...args: number[]): Color; + hwb(...args: number[]): Color; + cmyk(...args: number[]): Color; + xyz(...args: number[]): Color; + lab(...args: number[]): Color; + lch(...args: number[]): Color; + ansi16(...args: number[]): Color; + ansi256(...args: number[]): Color; + hcg(...args: number[]): Color; + apple(...args: number[]): Color; +} + +interface ColorConstructor { + (obj?: ColorParam, model?: keyof (typeof convert)): Color; + new(obj?: ColorParam, model?: keyof (typeof convert)): Color; + rgb(...val: number[]): Color; + rgb(color: ColorParam): Color; + hsl(...val: number[]): Color; + hsl(color: ColorParam): Color; + hsv(...val: number[]): Color; + hsv(color: ColorParam): Color; + hwb(...val: number[]): Color; + hwb(color: ColorParam): Color; + cmyk(...val: number[]): Color; + cmyk(color: ColorParam): Color; + xyz(...val: number[]): Color; + xyz(color: ColorParam): Color; + lab(...val: number[]): Color; + lab(color: ColorParam): Color; + lch(...val: number[]): Color; + lch(color: ColorParam): Color; + ansi16(...val: number[]): Color; + ansi16(color: ColorParam): Color; + ansi256(...val: number[]): Color; + ansi256(color: ColorParam): Color; + hcg(...val: number[]): Color; + hcg(color: ColorParam): Color; + apple(...val: number[]): Color; + apple(color: ColorParam): Color; +} + +declare const Color: ColorConstructor; + +export = Color; diff --git a/types/color/v2/tsconfig.json b/types/color/v2/tsconfig.json new file mode 100644 index 0000000000..fef027287c --- /dev/null +++ b/types/color/v2/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "color": [ + "color/v2" + ] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "color-tests.ts" + ] +} \ No newline at end of file diff --git a/types/node-waves/tslint.json b/types/color/v2/tslint.json similarity index 100% rename from types/node-waves/tslint.json rename to types/color/v2/tslint.json diff --git a/types/colorbrewer/tsconfig.json b/types/colorbrewer/tsconfig.json index 561a5d114e..da629b0ce4 100644 --- a/types/colorbrewer/tsconfig.json +++ b/types/colorbrewer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/colors/tsconfig.json b/types/colors/tsconfig.json index 99d78ad72d..7b92f3a446 100644 --- a/types/colors/tsconfig.json +++ b/types/colors/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/com.darktalker.cordova.screenshot/tsconfig.json b/types/com.darktalker.cordova.screenshot/tsconfig.json index d2b5aabb00..80a6fbfe64 100644 --- a/types/com.darktalker.cordova.screenshot/tsconfig.json +++ b/types/com.darktalker.cordova.screenshot/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/combine-source-map/tsconfig.json b/types/combine-source-map/tsconfig.json index dfb725b738..0c89da9ae0 100644 --- a/types/combine-source-map/tsconfig.json +++ b/types/combine-source-map/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/combined-stream/combined-stream-tests.ts b/types/combined-stream/combined-stream-tests.ts index 776e530e63..ffdc0eaac7 100644 --- a/types/combined-stream/combined-stream-tests.ts +++ b/types/combined-stream/combined-stream-tests.ts @@ -1,4 +1,4 @@ -import * as CombinedStream from "combined-stream"; +import CombinedStream = require("combined-stream"); import { createReadStream, createWriteStream } from "fs"; const stream1 = new CombinedStream(); diff --git a/types/combined-stream/tsconfig.json b/types/combined-stream/tsconfig.json index bc69eb2505..6d88a54646 100644 --- a/types/combined-stream/tsconfig.json +++ b/types/combined-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/combokeys/tsconfig.json b/types/combokeys/tsconfig.json index b1fecec3b7..0c36d58c5a 100644 --- a/types/combokeys/tsconfig.json +++ b/types/combokeys/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cometd/tsconfig.json b/types/cometd/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/cometd/tsconfig.json +++ b/types/cometd/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/command-line-args/tsconfig.json b/types/command-line-args/tsconfig.json index 92c02160ae..742434add7 100644 --- a/types/command-line-args/tsconfig.json +++ b/types/command-line-args/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/command-line-commands/tsconfig.json b/types/command-line-commands/tsconfig.json index fd8670e4a1..43a82ddc71 100644 --- a/types/command-line-commands/tsconfig.json +++ b/types/command-line-commands/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/commangular/tsconfig.json b/types/commangular/tsconfig.json index bd900bd300..f2d837d87a 100644 --- a/types/commangular/tsconfig.json +++ b/types/commangular/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/comment-json/comment-json-tests.ts b/types/comment-json/comment-json-tests.ts index af91ff422f..56aa8453fe 100644 --- a/types/comment-json/comment-json-tests.ts +++ b/types/comment-json/comment-json-tests.ts @@ -14,3 +14,11 @@ const result = commentJson.parse(` // comment at the bottom `); const str = commentJson.stringify(result); + +const numericallyIndexed = commentJson.stringify(result, (key, value) => { +return key && Number.isInteger(Number(key)) + ? value + : undefined; +}); + +const whiteListed = commentJson.stringify(result, ['a', 1]); diff --git a/types/comment-json/index.d.ts b/types/comment-json/index.d.ts index 9c2652f34e..0aad1934ff 100644 --- a/types/comment-json/index.d.ts +++ b/types/comment-json/index.d.ts @@ -4,5 +4,20 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export type Reviver = (k: number | string, v: any) => any; + +/** + * Converts a JavaScript Object Notation (JSON) string into an object. + * @param json A valid JSON string. + * @param reviver A function that transforms the results. This function is called for each member of the object. + * @param removes_comments If true, the comments won't be maintained, which is often used when we want to get a clean object. + * If a member contains nested objects, the nested objects are transformed before the parent object is. + */ export function parse(json: string, reviver?: Reviver, removes_comments?: boolean): any; -export function stringify(value: any, replacer?: any, space?: string | number): string; + +/** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer A function that transforms the results or an array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + */ +export function stringify(value: any, replacer?: ((key: string, value: any) => any) | Array | null, space?: string | number): string; diff --git a/types/comment-json/tsconfig.json b/types/comment-json/tsconfig.json index 0745d1cfc0..4512d870b9 100644 --- a/types/comment-json/tsconfig.json +++ b/types/comment-json/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/common-tags/tsconfig.json b/types/common-tags/tsconfig.json index 21158de285..84732128c2 100644 --- a/types/common-tags/tsconfig.json +++ b/types/common-tags/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/commonmark/tsconfig.json b/types/commonmark/tsconfig.json index 682d69fed4..f25b7b8e9d 100644 --- a/types/commonmark/tsconfig.json +++ b/types/commonmark/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/compare-version/tsconfig.json b/types/compare-version/tsconfig.json index 5dcb7c3156..28e391540f 100644 --- a/types/compare-version/tsconfig.json +++ b/types/compare-version/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/complex/tsconfig.json b/types/complex/tsconfig.json index b8a54e716a..ec9be90750 100644 --- a/types/complex/tsconfig.json +++ b/types/complex/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/component-emitter/tsconfig.json b/types/component-emitter/tsconfig.json index 71ded6be82..e6a5fec6c6 100644 --- a/types/component-emitter/tsconfig.json +++ b/types/component-emitter/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/compose-function/tsconfig.json b/types/compose-function/tsconfig.json index cdbf9e9709..8a4ad44fa7 100644 --- a/types/compose-function/tsconfig.json +++ b/types/compose-function/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/compressible/tsconfig.json b/types/compressible/tsconfig.json index 8e036c88d9..c2ab1306cc 100644 --- a/types/compressible/tsconfig.json +++ b/types/compressible/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts b/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts index 3939bf5847..423ca4cea7 100644 --- a/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts +++ b/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts @@ -6,6 +6,7 @@ const c: Configuration = { new CompressionPlugin({ asset: "[path].gz[query]", algorithm: "gzip", + cache: true, test: /\.js$|\.html$/, threshold: 10240, minRatio: 0.8 diff --git a/types/compression-webpack-plugin/index.d.ts b/types/compression-webpack-plugin/index.d.ts index 4f2453e3b1..8fddd72daf 100644 --- a/types/compression-webpack-plugin/index.d.ts +++ b/types/compression-webpack-plugin/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for compression-webpack-plugin 0.3 +// Type definitions for compression-webpack-plugin 0.4 // Project: https://github.com/webpack-contrib/compression-webpack-plugin // Definitions by: Anton Kandybo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -15,6 +15,7 @@ declare namespace CompressionPlugin { interface Options { asset?: string; algorithm?: string; + cache?: boolean | string; test?: RegExp | RegExp[]; regExp?: RegExp | RegExp[]; threshold?: number; diff --git a/types/compression-webpack-plugin/tsconfig.json b/types/compression-webpack-plugin/tsconfig.json index b80c7a1977..1e166ce2bc 100644 --- a/types/compression-webpack-plugin/tsconfig.json +++ b/types/compression-webpack-plugin/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/compression/tsconfig.json b/types/compression/tsconfig.json index 63ff5e3bc8..c0102986f8 100644 --- a/types/compression/tsconfig.json +++ b/types/compression/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/compute-stdev/tsconfig.json b/types/compute-stdev/tsconfig.json index f622c386a3..aa0baf9c99 100644 --- a/types/compute-stdev/tsconfig.json +++ b/types/compute-stdev/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "compute-stdev-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/concat-stream/tsconfig.json b/types/concat-stream/tsconfig.json index 20373a2de3..0cba6d2e70 100644 --- a/types/concat-stream/tsconfig.json +++ b/types/concat-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/concaveman/tsconfig.json b/types/concaveman/tsconfig.json index 6312321a70..392fb91c60 100644 --- a/types/concaveman/tsconfig.json +++ b/types/concaveman/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/conf/index.d.ts b/types/conf/index.d.ts index 9f88a88355..e58dc3ede7 100644 --- a/types/conf/index.d.ts +++ b/types/conf/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for conf 1.1 +// Type definitions for conf 1.4 // Project: https://github.com/sindresorhus/conf // Definitions by: Sam Verschueren // BendingBender @@ -24,6 +24,7 @@ declare class Conf implements Iterable<[string, T]> { has(key: string): boolean; delete(key: string): void; clear(): void; + onDidChange(key: string, callback: (oldVal: any, newVal: any) => void): void; [Symbol.iterator](): Iterator<[string, T]>; } diff --git a/types/conf/tsconfig.json b/types/conf/tsconfig.json index 84d6bf7657..aa03ea90e1 100644 --- a/types/conf/tsconfig.json +++ b/types/conf/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/conf/v0/tsconfig.json b/types/conf/v0/tsconfig.json index 004bd4a1b5..8b4a8695b8 100644 --- a/types/conf/v0/tsconfig.json +++ b/types/conf/v0/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/confidence/tsconfig.json b/types/confidence/tsconfig.json index 8996cbd660..7504130a82 100644 --- a/types/confidence/tsconfig.json +++ b/types/confidence/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/config/index.d.ts b/types/config/index.d.ts index ea5e5a940a..a18e765012 100644 --- a/types/config/index.d.ts +++ b/types/config/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Roman Korneev // Forrest Bice // James Donald +// Alberto Vasquez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -39,6 +40,9 @@ declare namespace c { // Return the sources for the configurations getConfigSources(): IConfigSource[]; + + // Returns a new deep copy of the current config object, or any part of the config if provided. + toObject(config?: any): any; /** * This allows module developers to attach their configurations onto diff --git a/types/config/tsconfig.json b/types/config/tsconfig.json index a595ffb10c..2717a0380e 100644 --- a/types/config/tsconfig.json +++ b/types/config/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/configstore/tsconfig.json b/types/configstore/tsconfig.json index 8479846189..3401254406 100644 --- a/types/configstore/tsconfig.json +++ b/types/configstore/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/confit/tsconfig.json b/types/confit/tsconfig.json index 6d141ea715..ab805bf10d 100644 --- a/types/confit/tsconfig.json +++ b/types/confit/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect-busboy/connect-busboy-tests.ts b/types/connect-busboy/connect-busboy-tests.ts index 2bbb832070..2db8cd45d7 100644 --- a/types/connect-busboy/connect-busboy-tests.ts +++ b/types/connect-busboy/connect-busboy-tests.ts @@ -1,4 +1,4 @@ -import * as connectBusboy from 'connect-busboy'; +import connectBusboy = require('connect-busboy'); import * as express from 'express'; diff --git a/types/connect-busboy/tsconfig.json b/types/connect-busboy/tsconfig.json index 112c160f2b..cb2e739029 100644 --- a/types/connect-busboy/tsconfig.json +++ b/types/connect-busboy/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "connect-busboy-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/connect-ensure-login/tsconfig.json b/types/connect-ensure-login/tsconfig.json index 95f39e8bf0..7351d8357b 100644 --- a/types/connect-ensure-login/tsconfig.json +++ b/types/connect-ensure-login/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect-flash/tsconfig.json b/types/connect-flash/tsconfig.json index 0d8c04c7de..fa58928986 100644 --- a/types/connect-flash/tsconfig.json +++ b/types/connect-flash/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect-history-api-fallback/connect-history-api-fallback-tests.ts b/types/connect-history-api-fallback/connect-history-api-fallback-tests.ts index 6095d2fecb..dc53a3b86f 100644 --- a/types/connect-history-api-fallback/connect-history-api-fallback-tests.ts +++ b/types/connect-history-api-fallback/connect-history-api-fallback-tests.ts @@ -1,6 +1,5 @@ -import * as historyApiFallback from 'connect-history-api-fallback'; - -import * as express from "express"; +import historyApiFallback = require('connect-history-api-fallback'); +import express = require('express'); const app = express(); app.use(historyApiFallback()); diff --git a/types/connect-history-api-fallback/tsconfig.json b/types/connect-history-api-fallback/tsconfig.json index ad8919e94e..dff6edbdd1 100644 --- a/types/connect-history-api-fallback/tsconfig.json +++ b/types/connect-history-api-fallback/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect-livereload/connect-livereload-tests.ts b/types/connect-livereload/connect-livereload-tests.ts index 26a09a2983..9049fa147c 100644 --- a/types/connect-livereload/connect-livereload-tests.ts +++ b/types/connect-livereload/connect-livereload-tests.ts @@ -1,6 +1,5 @@ - -import * as connect from "connect"; -import * as livereload from "connect-livereload"; +import connect = require("connect"); +import livereload = require("connect-livereload"); const app = connect(); @@ -28,13 +27,13 @@ app.use(livereload({ // include all urls by default include: [/.*/], - + // this function is used to determine if the content of `res.write` or `res.end` is html. html: function (str) { if (!str) return false; return /<[:_-\w\s\!\/\=\"\']+>/i.test(str); }, - + // rules are provided to find the place where the snippet should be inserted. // the main problem is that on the server side it can be tricky to determine if a string will be valid html on the client. // the function `fn` of the first `match` is executed like this `body.replace(rule.match, rule.fn);` @@ -49,13 +48,13 @@ app.use(livereload({ match: /<\!DOCTYPE.+?>/i, fn: append }], - + // port where the script is loaded port: 35729, - + // location where the script is provided (not by connect-livereload). Change this e.g. when serving livereload with a proxy. src: "http://localhost:35729/livereload.js?snipver=1", - + // Set this option to `true` to set `req.headers['accept-encoding']` to 'identity' (disabling compression) disableCompression: false })); diff --git a/types/connect-livereload/tsconfig.json b/types/connect-livereload/tsconfig.json index 599ea294bf..92d8c225c2 100644 --- a/types/connect-livereload/tsconfig.json +++ b/types/connect-livereload/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect-modrewrite/tsconfig.json b/types/connect-modrewrite/tsconfig.json index 235df5d93e..be62ccb0d3 100644 --- a/types/connect-modrewrite/tsconfig.json +++ b/types/connect-modrewrite/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect-mongo/connect-mongo-tests.ts b/types/connect-mongo/connect-mongo-tests.ts index 67caed7c27..351975d84c 100644 --- a/types/connect-mongo/connect-mongo-tests.ts +++ b/types/connect-mongo/connect-mongo-tests.ts @@ -1,8 +1,7 @@ - -import * as express from 'express'; +import express = require('express'); import * as mongoose from 'mongoose'; -import * as session from 'express-session'; -import * as connectMongo from 'connect-mongo'; +import session = require('express-session'); +import connectMongo = require('connect-mongo'); import * as mongodb from 'mongodb'; var app = express(); diff --git a/types/connect-mongo/tsconfig.json b/types/connect-mongo/tsconfig.json index ca12068b57..cb44c8c3ed 100644 --- a/types/connect-mongo/tsconfig.json +++ b/types/connect-mongo/tsconfig.json @@ -19,7 +19,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect-pg-simple/connect-pg-simple-tests.ts b/types/connect-pg-simple/connect-pg-simple-tests.ts index 1e90c9b4e5..6f7d629a59 100644 --- a/types/connect-pg-simple/connect-pg-simple-tests.ts +++ b/types/connect-pg-simple/connect-pg-simple-tests.ts @@ -1,7 +1,7 @@ import connectPgSimple = require("connect-pg-simple"); -import * as session from "express-session"; +import session = require("express-session"); import * as pg from "pg"; -import * as express from "express"; +import express = require('express'); const pgSession = connectPgSimple(session); diff --git a/types/connect-pg-simple/tsconfig.json b/types/connect-pg-simple/tsconfig.json index ed22faf257..e2194628bc 100644 --- a/types/connect-pg-simple/tsconfig.json +++ b/types/connect-pg-simple/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect-redis/connect-redis-tests.ts b/types/connect-redis/connect-redis-tests.ts index 11cd583a74..a312ffd3ca 100644 --- a/types/connect-redis/connect-redis-tests.ts +++ b/types/connect-redis/connect-redis-tests.ts @@ -1,5 +1,5 @@ -import * as connectRedis from "connect-redis"; -import * as session from "express-session"; +import connectRedis = require("connect-redis"); +import session = require("express-session"); let RedisStore = connectRedis(session); const store = new RedisStore({ diff --git a/types/connect-redis/tsconfig.json b/types/connect-redis/tsconfig.json index b47af7235d..69af94ebe8 100644 --- a/types/connect-redis/tsconfig.json +++ b/types/connect-redis/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect-slashes/tsconfig.json b/types/connect-slashes/tsconfig.json index 18eed04f1a..a07f0a4477 100644 --- a/types/connect-slashes/tsconfig.json +++ b/types/connect-slashes/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect-timeout/connect-timeout-tests.ts b/types/connect-timeout/connect-timeout-tests.ts index aa93ea179e..31342d7491 100644 --- a/types/connect-timeout/connect-timeout-tests.ts +++ b/types/connect-timeout/connect-timeout-tests.ts @@ -1,9 +1,7 @@ - - -import * as express from "express"; -import * as timeout from "connect-timeout"; -import * as bodyParser from "body-parser"; -import * as cookieParser from "cookie-parser"; +import express = require("express"); +import timeout = require("connect-timeout"); +import bodyParser = require("body-parser"); +import cookieParser = require("cookie-parser"); // example of using this top-level; note the use of haltOnTimedout // after every middleware; it will stop the request flow on a timeout diff --git a/types/connect-timeout/tsconfig.json b/types/connect-timeout/tsconfig.json index 79082f279a..701d7beedf 100644 --- a/types/connect-timeout/tsconfig.json +++ b/types/connect-timeout/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect/connect-tests.ts b/types/connect/connect-tests.ts index 627017a7e4..5a7590a9a0 100644 --- a/types/connect/connect-tests.ts +++ b/types/connect/connect-tests.ts @@ -1,6 +1,5 @@ - import * as http from "http"; -import * as connect from "connect"; +import connect = require("connect"); const app = connect(); @@ -15,7 +14,7 @@ app.use((err: Error, req: http.IncomingMessage, res: http.ServerResponse, next: if (err) { return res.end(`Error: ${err}`); } - + next(); }); diff --git a/types/connect/tsconfig.json b/types/connect/tsconfig.json index bcd813bc77..9fdfae264f 100644 --- a/types/connect/tsconfig.json +++ b/types/connect/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/console-stamp/tsconfig.json b/types/console-stamp/tsconfig.json index e4112e2035..c18c0edc84 100644 --- a/types/console-stamp/tsconfig.json +++ b/types/console-stamp/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/consolidate/tsconfig.json b/types/consolidate/tsconfig.json index aab02b23e5..2ed641f4b3 100644 --- a/types/consolidate/tsconfig.json +++ b/types/consolidate/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/consul/consul-tests.ts b/types/consul/consul-tests.ts index f749ef0a5d..988890766d 100644 --- a/types/consul/consul-tests.ts +++ b/types/consul/consul-tests.ts @@ -1,5 +1,4 @@ - -import * as Consul from "consul"; +import Consul = require("consul"); let ConsulStatic: Consul.ConsulStatic; let AclStatic: Consul.AclStatic = ConsulStatic.Acl; diff --git a/types/consul/tsconfig.json b/types/consul/tsconfig.json index 9401826c02..96142fb5d0 100644 --- a/types/consul/tsconfig.json +++ b/types/consul/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/content-disposition/tsconfig.json b/types/content-disposition/tsconfig.json index 25125c4ab6..b0c721f43f 100644 --- a/types/content-disposition/tsconfig.json +++ b/types/content-disposition/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/content-type/tsconfig.json b/types/content-type/tsconfig.json index 139851cbde..40c18138d3 100644 --- a/types/content-type/tsconfig.json +++ b/types/content-type/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/contentful-resolve-response/tsconfig.json b/types/contentful-resolve-response/tsconfig.json index f15c47db0a..09811fc7ba 100644 --- a/types/contentful-resolve-response/tsconfig.json +++ b/types/contentful-resolve-response/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/contextjs/tsconfig.json b/types/contextjs/tsconfig.json index 3054b8f3ca..ba45f1d91a 100644 --- a/types/contextjs/tsconfig.json +++ b/types/contextjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/continuation-local-storage/tsconfig.json b/types/continuation-local-storage/tsconfig.json index f1305a49af..7ff6d996f3 100644 --- a/types/continuation-local-storage/tsconfig.json +++ b/types/continuation-local-storage/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/convert-hrtime/tsconfig.json b/types/convert-hrtime/tsconfig.json index 9d2b304763..8ca78a7377 100644 --- a/types/convert-hrtime/tsconfig.json +++ b/types/convert-hrtime/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/convert-layout/tsconfig.json b/types/convert-layout/tsconfig.json index e9ef959215..4dda95576b 100644 --- a/types/convert-layout/tsconfig.json +++ b/types/convert-layout/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/convert-source-map/tsconfig.json b/types/convert-source-map/tsconfig.json index a9125c586c..e7fb07ca0c 100644 --- a/types/convert-source-map/tsconfig.json +++ b/types/convert-source-map/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/convict/tsconfig.json b/types/convict/tsconfig.json index 75e1402283..7177956370 100644 --- a/types/convict/tsconfig.json +++ b/types/convict/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cookie-parser/tsconfig.json b/types/cookie-parser/tsconfig.json index 20cf8359b5..a182eeaaa3 100644 --- a/types/cookie-parser/tsconfig.json +++ b/types/cookie-parser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cookie-session/tsconfig.json b/types/cookie-session/tsconfig.json index bacf93c9f4..a046c14075 100644 --- a/types/cookie-session/tsconfig.json +++ b/types/cookie-session/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cookie-signature/tsconfig.json b/types/cookie-signature/tsconfig.json index 38aab055c7..04c9a9bc73 100644 --- a/types/cookie-signature/tsconfig.json +++ b/types/cookie-signature/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cookie/tsconfig.json b/types/cookie/tsconfig.json index f1a68c4f57..2c101fadf8 100644 --- a/types/cookie/tsconfig.json +++ b/types/cookie/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cookie_js/tsconfig.json b/types/cookie_js/tsconfig.json index d181ce7661..cfb0fd4eb8 100644 --- a/types/cookie_js/tsconfig.json +++ b/types/cookie_js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cookies/cookies-tests.ts b/types/cookies/cookies-tests.ts index 2f78f8ad49..cd46e0987b 100644 --- a/types/cookies/cookies-tests.ts +++ b/types/cookies/cookies-tests.ts @@ -1,8 +1,8 @@ -import * as Cookies from 'cookies'; +import Cookies = require('cookies'); import * as http from 'http'; -import * as Keygrip from 'keygrip'; -import * as express from 'express'; -import * as connect from 'connect'; +import Keygrip = require('keygrip'); +import express = require('express'); +import connect = require('connect'); const server = http.createServer((req, res) => { const cookies = new Cookies(req, res); diff --git a/types/cookies/tsconfig.json b/types/cookies/tsconfig.json index d7a17c23bc..6cbd9c2cff 100644 --- a/types/cookies/tsconfig.json +++ b/types/cookies/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/copy-paste/tsconfig.json b/types/copy-paste/tsconfig.json index 7c78f81542..ae30962d67 100644 --- a/types/copy-paste/tsconfig.json +++ b/types/copy-paste/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/copy-text-to-clipboard/tsconfig.json b/types/copy-text-to-clipboard/tsconfig.json index 2889d9fdc6..a04fdc0b8e 100644 --- a/types/copy-text-to-clipboard/tsconfig.json +++ b/types/copy-text-to-clipboard/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/copy-webpack-plugin/copy-webpack-plugin-tests.ts b/types/copy-webpack-plugin/copy-webpack-plugin-tests.ts index 022a734261..b58b242fc2 100644 --- a/types/copy-webpack-plugin/copy-webpack-plugin-tests.ts +++ b/types/copy-webpack-plugin/copy-webpack-plugin-tests.ts @@ -1,27 +1,27 @@ import { Configuration } from 'webpack' -import * as CopyWebpackPlugin from 'copy-webpack-plugin' +import CopyWebpackPlugin = require('copy-webpack-plugin'); const c: Configuration = { plugins: [ new CopyWebpackPlugin([ // {output}/file.txt { from: 'from/file.txt' }, - + // {output}/to/file.txt { from: 'from/file.txt', to: 'to/file.txt' }, - + // {output}/to/directory/file.txt { from: 'from/file.txt', to: 'to/directory' }, - + // Copy directory contents to {output}/ { from: 'from/directory' }, - + // Copy directory contents to {output}/to/directory/ { from: 'from/directory', to: 'to/directory' }, - + // Copy glob results to /absolute/path/ { from: 'from/directory/**/*', to: '/absolute/path' }, - + // Copy glob results (with dot files) to /absolute/path/ { from: { @@ -30,21 +30,21 @@ const c: Configuration = { }, to: '/absolute/path' }, - + // Copy glob results, relative to context { context: 'from/directory', from: '**/*', to: '/absolute/path' }, - + // {output}/file/without/extension { from: 'path/to/file.txt', to: 'file/without/extension', toType: 'file' }, - + // {output}/directory/with/extension.ext/file.txt { from: 'path/to/file.txt', @@ -53,16 +53,16 @@ const c: Configuration = { }, ], { ignore: [ - // Doesn't copy any files with a txt extension + // Doesn't copy any files with a txt extension '*.txt', - + // Doesn't copy any file, even if they start with a dot '**/*', - + // Doesn't copy any file, except if they start with a dot { glob: '**/*', dot: false } ], - + // By default, we only copy modified files during // a watch or webpack-dev-server build. Setting this // to `true` copies all files. diff --git a/types/copy-webpack-plugin/tsconfig.json b/types/copy-webpack-plugin/tsconfig.json index 026508651e..8bb618a386 100644 --- a/types/copy-webpack-plugin/tsconfig.json +++ b/types/copy-webpack-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-ionic/tsconfig.json b/types/cordova-ionic/tsconfig.json index 52153dc3a6..67164add65 100644 --- a/types/cordova-ionic/tsconfig.json +++ b/types/cordova-ionic/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-app-version/tsconfig.json b/types/cordova-plugin-app-version/tsconfig.json index bf9fa4b727..22d3a48e1d 100644 --- a/types/cordova-plugin-app-version/tsconfig.json +++ b/types/cordova-plugin-app-version/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-background-mode/tsconfig.json b/types/cordova-plugin-background-mode/tsconfig.json index 2f4b1be013..9a2df069f6 100644 --- a/types/cordova-plugin-background-mode/tsconfig.json +++ b/types/cordova-plugin-background-mode/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-badge/tsconfig.json b/types/cordova-plugin-badge/tsconfig.json index 1354c708fd..8fd3f33576 100644 --- a/types/cordova-plugin-badge/tsconfig.json +++ b/types/cordova-plugin-badge/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-ble-central/tsconfig.json b/types/cordova-plugin-ble-central/tsconfig.json index 84cd1205c3..3c31e21f9e 100644 --- a/types/cordova-plugin-ble-central/tsconfig.json +++ b/types/cordova-plugin-ble-central/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-canvascamera/tsconfig.json b/types/cordova-plugin-canvascamera/tsconfig.json index dcc6bf63a2..487b814e24 100644 --- a/types/cordova-plugin-canvascamera/tsconfig.json +++ b/types/cordova-plugin-canvascamera/tsconfig.json @@ -11,6 +11,7 @@ "strictFunctionTypes": true, "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-device-name/tsconfig.json b/types/cordova-plugin-device-name/tsconfig.json index c74e58b914..a1c3a4bf29 100644 --- a/types/cordova-plugin-device-name/tsconfig.json +++ b/types/cordova-plugin-device-name/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-email-composer/tsconfig.json b/types/cordova-plugin-email-composer/tsconfig.json index 9de9930ed1..44cd31aecf 100644 --- a/types/cordova-plugin-email-composer/tsconfig.json +++ b/types/cordova-plugin-email-composer/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-file-opener2/tsconfig.json b/types/cordova-plugin-file-opener2/tsconfig.json index 0b84dfe84e..25d0779575 100644 --- a/types/cordova-plugin-file-opener2/tsconfig.json +++ b/types/cordova-plugin-file-opener2/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-ibeacon/tsconfig.json b/types/cordova-plugin-ibeacon/tsconfig.json index ba0aa9b7cf..b5423bd3ce 100644 --- a/types/cordova-plugin-ibeacon/tsconfig.json +++ b/types/cordova-plugin-ibeacon/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-insomnia/tsconfig.json b/types/cordova-plugin-insomnia/tsconfig.json index 9704e7c020..63dbb10719 100644 --- a/types/cordova-plugin-insomnia/tsconfig.json +++ b/types/cordova-plugin-insomnia/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-keyboard/tsconfig.json b/types/cordova-plugin-keyboard/tsconfig.json index 730b84c530..dd15c4b9c0 100644 --- a/types/cordova-plugin-keyboard/tsconfig.json +++ b/types/cordova-plugin-keyboard/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-mapsforge/tsconfig.json b/types/cordova-plugin-mapsforge/tsconfig.json index 2be513a0d3..589214939d 100644 --- a/types/cordova-plugin-mapsforge/tsconfig.json +++ b/types/cordova-plugin-mapsforge/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-ms-adal/tsconfig.json b/types/cordova-plugin-ms-adal/tsconfig.json index 9ebb3fca10..c49b79dbbc 100644 --- a/types/cordova-plugin-ms-adal/tsconfig.json +++ b/types/cordova-plugin-ms-adal/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-native-keyboard/tsconfig.json b/types/cordova-plugin-native-keyboard/tsconfig.json index 72ec2f6371..7d6b7d30ab 100644 --- a/types/cordova-plugin-native-keyboard/tsconfig.json +++ b/types/cordova-plugin-native-keyboard/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-ouralabs/tsconfig.json b/types/cordova-plugin-ouralabs/tsconfig.json index 2cbd8ea053..4a333de1ae 100644 --- a/types/cordova-plugin-ouralabs/tsconfig.json +++ b/types/cordova-plugin-ouralabs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-qrscanner/tsconfig.json b/types/cordova-plugin-qrscanner/tsconfig.json index e2ef38fa17..729bd22650 100644 --- a/types/cordova-plugin-qrscanner/tsconfig.json +++ b/types/cordova-plugin-qrscanner/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-spinner/tsconfig.json b/types/cordova-plugin-spinner/tsconfig.json index 19ec9b294f..4beead8631 100644 --- a/types/cordova-plugin-spinner/tsconfig.json +++ b/types/cordova-plugin-spinner/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-websql/tsconfig.json b/types/cordova-plugin-websql/tsconfig.json index db8d59bbe6..35d55b1bcb 100644 --- a/types/cordova-plugin-websql/tsconfig.json +++ b/types/cordova-plugin-websql/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-x-socialsharing/tsconfig.json b/types/cordova-plugin-x-socialsharing/tsconfig.json index e2c4bc63d9..d5ae67f587 100644 --- a/types/cordova-plugin-x-socialsharing/tsconfig.json +++ b/types/cordova-plugin-x-socialsharing/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-sqlite-storage/tsconfig.json b/types/cordova-sqlite-storage/tsconfig.json index a9eb2af0ad..1cd9548087 100644 --- a/types/cordova-sqlite-storage/tsconfig.json +++ b/types/cordova-sqlite-storage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-universal-links-plugin/tsconfig.json b/types/cordova-universal-links-plugin/tsconfig.json index 69322a9265..29ccaf6d57 100644 --- a/types/cordova-universal-links-plugin/tsconfig.json +++ b/types/cordova-universal-links-plugin/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "cordova-universal-links-plugin-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cordova/tsconfig.json b/types/cordova/tsconfig.json index 591c25a1bb..11e7c87397 100644 --- a/types/cordova/tsconfig.json +++ b/types/cordova/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova_app_version_plugin/tsconfig.json b/types/cordova_app_version_plugin/tsconfig.json index 2f439d4979..c0f2279ce6 100644 --- a/types/cordova_app_version_plugin/tsconfig.json +++ b/types/cordova_app_version_plugin/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordovarduino/tsconfig.json b/types/cordovarduino/tsconfig.json index cb0cf33a1a..bfd40c8cee 100644 --- a/types/cordovarduino/tsconfig.json +++ b/types/cordovarduino/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/core-js/core-js-tests.ts b/types/core-js/core-js-tests.ts index 32eb2d502c..ab11eab409 100644 --- a/types/core-js/core-js-tests.ts +++ b/types/core-js/core-js-tests.ts @@ -83,6 +83,8 @@ arrayOfPoint3D = Array.from(arrayOfPoint, point => point3d, a); arrayOfPoint3D = Array.from(iterableOfPoint, point => point3d); arrayOfPoint3D = Array.from(iterableOfPoint, point => point3d, a); arrayOfPoint = Array.of(point, point); +b = Array.isArray([]); +b = Array.isArray({}); // ############################################################################################# // ECMAScript 6: String & RegExp diff --git a/types/core-js/index.d.ts b/types/core-js/index.d.ts index 5916ad55c1..171aebc943 100644 --- a/types/core-js/index.d.ts +++ b/types/core-js/index.d.ts @@ -712,6 +712,7 @@ declare namespace core { from(arrayLike: ArrayLike | Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; from(arrayLike: ArrayLike | Iterable): T[]; of(...items: T[]): T[]; + isArray(arg: any): arg is any[]; push(array: ArrayLike, ...items: T[]): number; pop(array: ArrayLike): T; concat(array: ArrayLike, ...items: Array): T[]; @@ -1035,6 +1036,10 @@ declare module "core-js/fn/array/index-of" { const indexOf: typeof core.Array.indexOf; export = indexOf; } +declare module "core-js/fn/array/is-array" { + const isArray: typeof core.Array.isArray; + export = isArray; +} declare module "core-js/fn/array/join" { const join: typeof core.Array.join; export = join; @@ -1814,6 +1819,10 @@ declare module "core-js/library/fn/array/index-of" { const indexOf: typeof core.Array.indexOf; export = indexOf; } +declare module "core-js/library/fn/array/is-array" { + const isArray: typeof core.Array.isArray; + export = isArray; +} declare module "core-js/library/fn/array/join" { const join: typeof core.Array.join; export = join; diff --git a/types/core-js/tsconfig.json b/types/core-js/tsconfig.json index a342d6c1bd..ce3411f183 100644 --- a/types/core-js/tsconfig.json +++ b/types/core-js/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cors/tsconfig.json b/types/cors/tsconfig.json index e9e1db77eb..c0a8ce0c52 100644 --- a/types/cors/tsconfig.json +++ b/types/cors/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cote/tsconfig.json b/types/cote/tsconfig.json index c25e78e090..4790b11aa5 100644 --- a/types/cote/tsconfig.json +++ b/types/cote/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/couchbase/tsconfig.json b/types/couchbase/tsconfig.json index 66ef360c2c..cf19e79d12 100644 --- a/types/couchbase/tsconfig.json +++ b/types/couchbase/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/countdown/tsconfig.json b/types/countdown/tsconfig.json index bf1074d820..21aa002443 100644 --- a/types/countdown/tsconfig.json +++ b/types/countdown/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/counterpart/tsconfig.json b/types/counterpart/tsconfig.json index 1a771cd73c..9a07a722df 100644 --- a/types/counterpart/tsconfig.json +++ b/types/counterpart/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/countries-and-timezones/tsconfig.json b/types/countries-and-timezones/tsconfig.json index e5f7728b57..ef7c8d2eb0 100644 --- a/types/countries-and-timezones/tsconfig.json +++ b/types/countries-and-timezones/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/country-list/tsconfig.json b/types/country-list/tsconfig.json index 30433764bf..12c80648b7 100644 --- a/types/country-list/tsconfig.json +++ b/types/country-list/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/country-select-js/tsconfig.json b/types/country-select-js/tsconfig.json index 56cb852a6d..a7bf843a06 100644 --- a/types/country-select-js/tsconfig.json +++ b/types/country-select-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/coverup/tsconfig.json b/types/coverup/tsconfig.json index 6102ad61b3..fbef238950 100644 --- a/types/coverup/tsconfig.json +++ b/types/coverup/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "coverup-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cp-file/tsconfig.json b/types/cp-file/tsconfig.json index 12138d0002..e91ced1737 100644 --- a/types/cp-file/tsconfig.json +++ b/types/cp-file/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cpx/tsconfig.json b/types/cpx/tsconfig.json index d22546d432..8001a3fdea 100644 --- a/types/cpx/tsconfig.json +++ b/types/cpx/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "cpx-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cpy/tsconfig.json b/types/cpy/tsconfig.json index 90098461b2..f7a536d8b5 100644 --- a/types/cpy/tsconfig.json +++ b/types/cpy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cqrs-domain/tsconfig.json b/types/cqrs-domain/tsconfig.json index 7ea1caa8ec..8a2e98724d 100644 --- a/types/cqrs-domain/tsconfig.json +++ b/types/cqrs-domain/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "cqrs-domain-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cradle/tsconfig.json b/types/cradle/tsconfig.json index 694d713edf..ea956b2e2f 100644 --- a/types/cradle/tsconfig.json +++ b/types/cradle/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/crc/tsconfig.json b/types/crc/tsconfig.json index 96511b6609..2b2be4c34d 100644 --- a/types/crc/tsconfig.json +++ b/types/crc/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/create-error/tsconfig.json b/types/create-error/tsconfig.json index 7ff8a82807..c5351c2e5a 100644 --- a/types/create-error/tsconfig.json +++ b/types/create-error/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/create-react-class/create-react-class-tests.ts b/types/create-react-class/create-react-class-tests.ts index c3f7c620ef..b8025b23f0 100644 --- a/types/create-react-class/create-react-class-tests.ts +++ b/types/create-react-class/create-react-class-tests.ts @@ -1,7 +1,7 @@ import * as React from "react"; import * as ReactDOM from "react-dom"; import * as DOM from "react-dom-factories"; -import * as createReactClass from "create-react-class"; +import createReactClass = require("create-react-class"); interface Props { foo: string; @@ -73,6 +73,12 @@ const ClassicComponent: React.ClassicComponentClass = createReactClass = React.createFactory(ClassicComponent); @@ -81,6 +87,7 @@ const classicFactoryElement: React.ClassicElement = // React.createElement const classicElement: React.ClassicElement = React.createElement(ClassicComponent, props); +const classicElementNullProps: React.ClassicElement<{}> = React.createElement(ClassicComponentNoProps, null); // React.cloneElement const clonedClassicElement: React.ClassicElement = diff --git a/types/create-react-class/tsconfig.json b/types/create-react-class/tsconfig.json index b003c69e53..71314e3d35 100644 --- a/types/create-react-class/tsconfig.json +++ b/types/create-react-class/tsconfig.json @@ -16,10 +16,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "preserve" }, "files": [ "index.d.ts", "create-react-class-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/createjs-lib/tsconfig.json b/types/createjs-lib/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/createjs-lib/tsconfig.json +++ b/types/createjs-lib/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/createjs/tsconfig.json b/types/createjs/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/createjs/tsconfig.json +++ b/types/createjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/credential/tsconfig.json b/types/credential/tsconfig.json index fb8e758820..f2866ca2d6 100644 --- a/types/credential/tsconfig.json +++ b/types/credential/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/credit-card-type/tsconfig.json b/types/credit-card-type/tsconfig.json index 0a3b957a29..9af8700b89 100644 --- a/types/credit-card-type/tsconfig.json +++ b/types/credit-card-type/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cron/tsconfig.json b/types/cron/tsconfig.json index 19a72853db..ce814daac4 100644 --- a/types/cron/tsconfig.json +++ b/types/cron/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cropperjs/index.d.ts b/types/cropperjs/index.d.ts index cca1d6a39b..60b508dd8f 100644 --- a/types/cropperjs/index.d.ts +++ b/types/cropperjs/index.d.ts @@ -488,6 +488,21 @@ declare class cropperjs { */ rotateTo(degree: number): void; + /** + * Scale the image. + */ + scale(scaleX: number, scaleY?: number): void; + + /** + * Scale the abscissa of the image. + */ + scaleX(scaleX: number): void; + + /** + * Scale the ordinate of the image. + */ + scaleY(scaleY: number): void; + /** * Clear the crop box. */ diff --git a/types/cropperjs/tsconfig.json b/types/cropperjs/tsconfig.json index ea6b7edb26..928c16ebf8 100644 --- a/types/cropperjs/tsconfig.json +++ b/types/cropperjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/croppie/tsconfig.json b/types/croppie/tsconfig.json index aa4a07017d..f0bbbaaad6 100644 --- a/types/croppie/tsconfig.json +++ b/types/croppie/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cross-spawn/cross-spawn-tests.ts b/types/cross-spawn/cross-spawn-tests.ts new file mode 100644 index 0000000000..6cb36510d8 --- /dev/null +++ b/types/cross-spawn/cross-spawn-tests.ts @@ -0,0 +1,20 @@ +import spawn = require('cross-spawn'); +import * as cp from 'child_process'; + +const p1: cp.ChildProcess = spawn('my-cmd', ['foo', 'bar']); +const pw: cp.ChildProcess = spawn('my-cmd', ['foo', 'bar'], {env: process.env}); + +pw.on('error', (err: Error) => { + console.log(err); +}); + +const r1: Error = spawn.sync('foo').error; +const r2: string[] = spawn.sync('foo').output; +const r3: Buffer = spawn.sync('foo').stdout; +const r4: Buffer = spawn.sync('foo').stderr; +const r5: number = spawn.sync('foo').status; +const r6: string = spawn.sync('foo').signal; +const r7: string = spawn.sync('foo', {encoding: 'utf8'}).stdout; + +spawn.sync('foo', ['bar']); +spawn.sync('foo', ['bar'], {stdio: 'inherit'}); diff --git a/types/cross-spawn/index.d.ts b/types/cross-spawn/index.d.ts new file mode 100644 index 0000000000..8544b37528 --- /dev/null +++ b/types/cross-spawn/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for cross-spawn 6.0 +// Project: https://github.com/moxystudio/node-cross-spawn +// Definitions by: Alorel +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import * as child_process from 'child_process'; + +declare function spawn(command: string, args?: string[], options?: child_process.SpawnOptions): child_process.ChildProcess; + +declare namespace spawn { + const sync: typeof child_process.spawnSync; +} + +export = spawn; diff --git a/types/cross-spawn/tsconfig.json b/types/cross-spawn/tsconfig.json new file mode 100644 index 0000000000..6e4bd2b252 --- /dev/null +++ b/types/cross-spawn/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "cross-spawn-tests.ts" + ] +} \ No newline at end of file diff --git a/types/xhr-mock/tslint.json b/types/cross-spawn/tslint.json similarity index 100% rename from types/xhr-mock/tslint.json rename to types/cross-spawn/tslint.json diff --git a/types/cross-storage/tsconfig.json b/types/cross-storage/tsconfig.json index eb05417639..dc6b6a3c54 100644 --- a/types/cross-storage/tsconfig.json +++ b/types/cross-storage/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/crossfilter/tsconfig.json b/types/crossfilter/tsconfig.json index bc0573220f..8a107d0e84 100644 --- a/types/crossfilter/tsconfig.json +++ b/types/crossfilter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/crossroads/tsconfig.json b/types/crossroads/tsconfig.json index b948857129..e1bb7591ed 100644 --- a/types/crossroads/tsconfig.json +++ b/types/crossroads/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cryptiles/tsconfig.json b/types/cryptiles/tsconfig.json index 6ae78bacb4..5309e478b8 100644 --- a/types/cryptiles/tsconfig.json +++ b/types/cryptiles/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/crypto-js/tsconfig.json b/types/crypto-js/tsconfig.json index 62ec3d1e40..04f4de4b4e 100644 --- a/types/crypto-js/tsconfig.json +++ b/types/crypto-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cryptojs/tsconfig.json b/types/cryptojs/tsconfig.json index 6747ffb9c5..63a696b449 100644 --- a/types/cryptojs/tsconfig.json +++ b/types/cryptojs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cson/tsconfig.json b/types/cson/tsconfig.json index a5ca0a8041..b7012ed2ba 100644 --- a/types/cson/tsconfig.json +++ b/types/cson/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/csprng/tsconfig.json b/types/csprng/tsconfig.json index b921bb3b7c..20e30e0d3c 100644 --- a/types/csprng/tsconfig.json +++ b/types/csprng/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/csrf/tsconfig.json b/types/csrf/tsconfig.json index 423d71f3c2..57efe7e073 100644 --- a/types/csrf/tsconfig.json +++ b/types/csrf/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/css-font-loading-module/tsconfig.json b/types/css-font-loading-module/tsconfig.json index b45d115596..2c64ee6074 100644 --- a/types/css-font-loading-module/tsconfig.json +++ b/types/css-font-loading-module/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/css-modules-require-hook/tsconfig.json b/types/css-modules-require-hook/tsconfig.json index e7f91df2f8..269853fbce 100644 --- a/types/css-modules-require-hook/tsconfig.json +++ b/types/css-modules-require-hook/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/css-modules/tsconfig.json b/types/css-modules/tsconfig.json index e079616b1d..c6294d2857 100644 --- a/types/css-modules/tsconfig.json +++ b/types/css-modules/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/css/tsconfig.json b/types/css/tsconfig.json index 7a69ddb612..50451f88d4 100644 --- a/types/css/tsconfig.json +++ b/types/css/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cssbeautify/tsconfig.json b/types/cssbeautify/tsconfig.json index a8c452dc97..627f481a2b 100644 --- a/types/cssbeautify/tsconfig.json +++ b/types/cssbeautify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/csurf/tsconfig.json b/types/csurf/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/csurf/tsconfig.json +++ b/types/csurf/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/csv-parse/tsconfig.json b/types/csv-parse/tsconfig.json index 2b52f434a2..fe155d7602 100644 --- a/types/csv-parse/tsconfig.json +++ b/types/csv-parse/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/csv-stringify/csv-stringify-tests.ts b/types/csv-stringify/csv-stringify-tests.ts index 803575e554..7aabdc728c 100644 --- a/types/csv-stringify/csv-stringify-tests.ts +++ b/types/csv-stringify/csv-stringify-tests.ts @@ -28,6 +28,26 @@ stringify([["1", true, new Date()], ["4", false, new Date()]], { // nothing }); +// test for columns +stringify( + [{key1: "a", key2: "b"}], + { + header: true, + columns: { key1: "Key1", key2: "Key2" }, + }, + (error: Error, output: string): void => { + // nothing + }); +stringify( + [{key1: "a", key2: "b"}], + { + header: true, + columns: ["key1"], + }, + (error: Error, output: string): void => { + // nothing + }); + stream = stringify({ delimiter: "," }); stream.write(["1", "2", "3"]); diff --git a/types/csv-stringify/index.d.ts b/types/csv-stringify/index.d.ts index 2e8cb32edb..2b74a8c864 100644 --- a/types/csv-stringify/index.d.ts +++ b/types/csv-stringify/index.d.ts @@ -13,7 +13,7 @@ declare namespace stringify { * Order matters, read the transformer documentation for additionnal information, * columns are auto discovered when the user write object, see the "header" option on how to print columns names on the first line. */ - columns?: string[]; + columns?: { [index: string]: string } | string[]; /** * Set the field delimiter, one character only, defaults to a comma. */ diff --git a/types/csv-stringify/tsconfig.json b/types/csv-stringify/tsconfig.json index 766e9c084e..8c66a29cda 100644 --- a/types/csv-stringify/tsconfig.json +++ b/types/csv-stringify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/csvrow/tsconfig.json b/types/csvrow/tsconfig.json index 7fc1637725..76cb98cf19 100644 --- a/types/csvrow/tsconfig.json +++ b/types/csvrow/tsconfig.json @@ -14,10 +14,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, - "strictFunctionTypes" : true + "esModuleInterop": true, + "strictFunctionTypes": true }, "files": [ "index.d.ts", "csvrow-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/csvtojson/tsconfig.json b/types/csvtojson/tsconfig.json index 91b15a3856..3dde8e70e7 100644 --- a/types/csvtojson/tsconfig.json +++ b/types/csvtojson/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cucumber/cucumber-tests.ts b/types/cucumber/cucumber-tests.ts index f2aed9aec4..b7fa675095 100644 --- a/types/cucumber/cucumber-tests.ts +++ b/types/cucumber/cucumber-tests.ts @@ -1,6 +1,12 @@ import * as assert from "power-assert"; +import { setWorldConstructor, defineParameterType, After, AfterAll, Before, BeforeAll, Given, When, Then } from "cucumber"; import cucumber = require("cucumber"); +type Callback = cucumber.CallbackStepDefinition; +type Table = cucumber.TableDefinition; +type HookScenarioResult = cucumber.HookScenarioResult; +const Status = cucumber.Status; + // You can optionally declare your own world properties declare module "cucumber" { interface World { @@ -8,190 +14,166 @@ declare module "cucumber" { } } -function StepSample() { - type Callback = cucumber.CallbackStepDefinition; - type Table = cucumber.TableDefinition; - type HookScenarioResult = cucumber.HookScenarioResult; - const Status = cucumber.Status; - - cucumber.defineSupportCode(({setWorldConstructor, defineParameterType, After, AfterAll, Around, Before, BeforeAll, registerHandler, Given, When, Then}) => { - setWorldConstructor(function({attach, parameters}) { - this.attach = attach; - this.parameters = parameters; - this.visit = (url: string, callback: Callback) => { - callback(null, 'pending'); - }; - }); - - Before((scenarioResult: HookScenarioResult, callback: Callback) => { - console.log(scenarioResult.result.status === Status.FAILED); - callback(); - }); - - Before({ timeout: 1000 }, (scenarioResult: HookScenarioResult, callback: Callback) => { - console.log(scenarioResult.result.status === Status.FAILED); - callback(); - }); - - Before('@tag', (scenarioResult: HookScenarioResult, callback: Callback) => { - console.log(scenarioResult.result.status === Status.FAILED); - callback(); - }); - - BeforeAll((callback: Callback) => { - console.log("Before all"); - callback(); - }); - - BeforeAll({ timeout: 1000 }, (callback: Callback) => { - console.log("Before all"); - callback(); - }); - - BeforeAll('@tag', (callback: Callback) => { - console.log("Before all"); - callback(); - }); - - Around((scenarioResult: HookScenarioResult, runScenario: (error: string | null, callback?: () => void) => void) => { - if (scenarioResult.result.status === Status.FAILED) { - runScenario(null, () => { - console.log('finish tasks'); - }); - } - }); - - After((scenarioResult: HookScenarioResult, callback: Callback) => { - console.log("After"); - callback(); - }); - - After({ timeout: 1000 }, (scenarioResult: HookScenarioResult, callback: Callback) => { - console.log("After"); - callback(); - }); - - After('@tag', (scenarioResult: HookScenarioResult, callback: Callback) => { - console.log("After"); - callback(); - }); - - AfterAll((callback: Callback) => { - console.log("After all"); - callback(); - }); - - AfterAll({ timeout: 1000 }, (callback: Callback) => { - console.log("After all"); - callback(); - }); - - AfterAll('@tag', (callback: Callback) => { - console.log("After all"); - callback(); - }); - - registerHandler('AfterFeatures', (event: any, callback: () => void) => { - callback(); - }); - - Given(/^a variable set to (\d+)$/, (x: string) => { - console.log("the number is: " + x); - }); - - Given(/^a variable set to (\d+)$/, (x: number) => { - console.log(typeof x); - }); - - Given(/^I am on the Cucumber.js GitHub repository$/, function(callback: Callback) { - this.visit('https://github.com/cucumber/cucumber-js', callback); - }); - - When(/^I go to the README file$/, (title: string, callback: Callback) => { +function StepSampleWithoutDefineSupportCode() { + setWorldConstructor(function({attach, parameters}) { + this.attach = attach; + this.parameters = parameters; + this.visit = (url: string, callback: Callback) => { callback(null, 'pending'); - }); - - Then(/^I should see "(.*)" as the page title$/, {timeout: 60 * 1000}, function(title: string, callback: Callback) { - const pageTitle = this.browser.text('title'); - - if (title === pageTitle) { - callback(); - } else { - callback(new Error("Expected to be on page with title " + title)); - } - }); - - // Type for data_table.js on - // https://github.com/cucumber/cucumber-js/blob/a5fd8251918c278ab2e389226d165cedb44df14a/lib/cucumber/ast/data_table.js - - Given(/^a table step with Table raw$/, (table: Table) => { - const expected = [ - ['Cucumber', 'Cucumis sativus'], - ['Burr Gherkin', 'Cucumis anguria'] - ]; - const actual: string[][] = table.raw(); - assert.deepEqual(actual, expected); - }); - - Given(/^a table step with Table rows$/, (table: Table) => { - const expected = [ - ['Apricot', '5'], - ['Brocolli', '2'], - ['Cucumber', '10'] - ]; - const actual: string[][] = table.rows(); - assert.deepEqual(actual, expected); - }); - - Given(/^a table step with Table rowHash$/, (table: Table) => { - const expected = { - Cucumber: 'Cucumis sativus', - 'Burr Gherkin': 'Cucumis anguria' - }; - const actual: { [firstCol: string]: string } = table.rowsHash(); - assert.deepEqual(actual, expected); - }); - - Given(/^a table step$/, (table: Table) => { - const expected = [ - {Vegetable: 'Apricot', Rating: '5'}, - {Vegetable: 'Brocolli', Rating: '2'}, - {Vegetable: 'Cucumber', Rating: '10'} - ]; - const actual: Array<{ [colName: string]: string }> = table.hashes(); - assert.deepEqual(actual, expected); - }); - - defineParameterType({ - regexp: /particular/, - transformer: s => s.toUpperCase(), - typeName: 'param' // deprecated but still supported - }); - - defineParameterType({ - regexp: /particularly/, - transformer: s => s.toUpperCase(), - name: 'param' - }); - - Given('a {param} step', param => { - assert.equal(param, 'PARTICULAR'); - }); + }; }); - const fns: cucumber.SupportCodeConsumer[] = cucumber.getSupportCodeFns(); + Before((scenarioResult: HookScenarioResult, callback: Callback) => { + console.log(scenarioResult.result.status === Status.FAILED); + callback(); + }); - cucumber.clearSupportCodeFns(); -} + Before({ timeout: 1000 }, (scenarioResult: HookScenarioResult, callback: Callback) => { + console.log(scenarioResult.result.status === Status.FAILED); + callback(); + }); -function registerListener(): cucumber.EventListener { - const listener = Object.assign(cucumber.Listener(), { - handleBeforeScenarioEvent: (scenario: cucumber.events.ScenarioPayload, callback: () => void) => { - // do some interesting stuff ... + Before('@tag', (scenarioResult: HookScenarioResult, callback: Callback) => { + console.log(scenarioResult.result.status === Status.FAILED); + callback(); + }); + BeforeAll((callback: Callback) => { + console.log("Before all"); + callback(); + }); + + BeforeAll({ timeout: 1000 }, (callback: Callback) => { + console.log("Before all"); + callback(); + }); + + BeforeAll('@tag', (callback: Callback) => { + console.log("Before all"); + callback(); + }); + + After((scenarioResult: HookScenarioResult, callback: Callback) => { + console.log("After"); + callback(); + }); + + After({ timeout: 1000 }, (scenarioResult: HookScenarioResult, callback: Callback) => { + console.log("After"); + callback(); + }); + + After('@tag', (scenarioResult: HookScenarioResult, callback: Callback) => { + console.log("After"); + callback(); + }); + + AfterAll((callback: Callback) => { + console.log("After all"); + callback(); + }); + + AfterAll({ timeout: 1000 }, (callback: Callback) => { + console.log("After all"); + callback(); + }); + + AfterAll('@tag', (callback: Callback) => { + console.log("After all"); + callback(); + }); + + Given(/^a variable set to (\d+)$/, (x: string) => { + console.log("the number is: " + x); + }); + + Given(/^a variable set to (\d+)$/, (x: number) => { + console.log(typeof x); + }); + + Given(/^I am on the Cucumber.js GitHub repository$/, function(callback: Callback) { + this.visit('https://github.com/cucumber/cucumber-js', callback); + }); + + When(/^I go to the README file$/, (title: string, callback: Callback) => { + callback(null, 'pending'); + }); + + Then(/^I should see "(.*)" as the page title$/, {timeout: 60 * 1000}, function(title: string, callback: Callback) { + const pageTitle = this.browser.text('title'); + + if (title === pageTitle) { callback(); + } else { + callback(new Error("Expected to be on page with title " + title)); } }); - return listener; + // Type for data_table.js on + // https://github.com/cucumber/cucumber-js/blob/a5fd8251918c278ab2e389226d165cedb44df14a/lib/cucumber/ast/data_table.js + + Given(/^a table step with Table raw$/, (table: Table) => { + const expected = [ + ['Cucumber', 'Cucumis sativus'], + ['Burr Gherkin', 'Cucumis anguria'] + ]; + const actual: string[][] = table.raw(); + assert.deepEqual(actual, expected); + }); + + Given(/^a table step with Table rows$/, (table: Table) => { + const expected = [ + ['Apricot', '5'], + ['Brocolli', '2'], + ['Cucumber', '10'] + ]; + const actual: string[][] = table.rows(); + assert.deepEqual(actual, expected); + }); + + Given(/^a table step with Table rowHash$/, (table: Table) => { + const expected = { + Cucumber: 'Cucumis sativus', + 'Burr Gherkin': 'Cucumis anguria' + }; + const actual: { [firstCol: string]: string } = table.rowsHash(); + assert.deepEqual(actual, expected); + }); + + Given(/^a table step$/, (table: Table) => { + const expected = [ + {Vegetable: 'Apricot', Rating: '5'}, + {Vegetable: 'Brocolli', Rating: '2'}, + {Vegetable: 'Cucumber', Rating: '10'} + ]; + const actual: Array<{ [colName: string]: string }> = table.hashes(); + assert.deepEqual(actual, expected); + }); + + defineParameterType({ + regexp: /particular/, + transformer: s => s.toUpperCase(), + typeName: 'param' // deprecated but still supported + }); + + defineParameterType({ + regexp: /particularly/, + transformer: s => s.toUpperCase(), + name: 'param', + preferForRegexpMatch: false, + useForSnippets: false + }); + + Given('a {param} step', param => { + assert.equal(param, 'PARTICULAR'); + }); } + +// syntax defineSupportCode deprecated +function StepSample() { + cucumber.defineSupportCode((l) => { + }); +} + +const fns: cucumber.SupportCodeConsumer[] = cucumber.getSupportCodeFns(); +cucumber.clearSupportCodeFns(); diff --git a/types/cucumber/index.d.ts b/types/cucumber/index.d.ts index 8c2ad7020e..c222ad567a 100644 --- a/types/cucumber/index.d.ts +++ b/types/cucumber/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for cucumber-js 3.2 +// Type definitions for cucumber-js 4.0 // Project: https://github.com/cucumber/cucumber-js // Definitions by: Abraão Alves // Jan Molak @@ -49,6 +49,29 @@ export interface StepDefinitions { setDefaultTimeout(time: number): void; } +export function After(code: HookCode): void; +export function After(options: HookOptions | string, code: HookCode): void; +export function AfterAll(code: GlobalHookCode): void; +export function AfterAll(options: HookOptions | string, code: GlobalHookCode): void; +export function Before(code: HookCode): void; +export function Before(options: HookOptions | string, code: HookCode): void; +export function BeforeAll(code: GlobalHookCode): void; +export function BeforeAll(options: HookOptions | string, code: GlobalHookCode): void; + +export function defineParameterType(transform: Transform): void; +export function defineStep(pattern: RegExp | string, code: StepDefinitionCode): void; + +export function Given(pattern: RegExp | string, code: StepDefinitionCode): void; +export function Given(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; +export function setDefaultTimeout(time: number): void; +export function setDefinitionFunctionWrapper(fn: () => void, options?: {[key: string]: any}): void; +// tslint:disable-next-line ban-types +export function setWorldConstructor(world: ((this: World, init: {attach: Function, parameters: {[key: string]: any}}) => void) | {}): void; +export function Then(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; +export function Then(pattern: RegExp | string, code: StepDefinitionCode): void; +export function When(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; +export function When(pattern: RegExp | string, code: StepDefinitionCode): void; + export interface HookScenarioResult { sourceLocation: SourceLocation; result: ScenarioResult; @@ -98,12 +121,11 @@ export namespace pickle { export type HookCode = (this: World, scenario: HookScenarioResult, callback?: CallbackStepDefinition) => void; export type GlobalHookCode = (callback?: CallbackStepDefinition) => void; -// tslint:disable-next-line ban-types -export type AroundCode = (scenario: HookScenarioResult, runScenario?: (error: string, callback?: Function) => void) => void; - export interface Transform { regexp: RegExp; transformer(arg: string): any; + useForSnippets?: boolean; + preferForRegexpMatch?: boolean; name?: string; typeName?: string; // deprecated } @@ -122,12 +144,9 @@ export interface Hooks { After(options: HookOptions | string, code: HookCode): void; AfterAll(code: GlobalHookCode): void; AfterAll(options: HookOptions | string, code: GlobalHookCode): void; - Around(code: AroundCode): void; setDefaultTimeout(time: number): void; // tslint:disable-next-line ban-types setWorldConstructor(world: ((this: World, init: {attach: Function, parameters: {[key: string]: any}}) => void) | {}): void; - registerHandler(handlerOption: string, code: (event: any, callback: CallbackStepDefinition) => void): void; - registerListener(listener: EventListener): void; defineParameterType(transform: Transform): void; } diff --git a/types/cucumber/tsconfig.json b/types/cucumber/tsconfig.json index e2f9cd081b..53ede2654b 100644 --- a/types/cucumber/tsconfig.json +++ b/types/cucumber/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cucumber/v1/tsconfig.json b/types/cucumber/v1/tsconfig.json index 343c701491..495158d6b0 100644 --- a/types/cucumber/v1/tsconfig.json +++ b/types/cucumber/v1/tsconfig.json @@ -23,7 +23,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cucumber/v3/cucumber-tests.ts b/types/cucumber/v3/cucumber-tests.ts new file mode 100644 index 0000000000..f2aed9aec4 --- /dev/null +++ b/types/cucumber/v3/cucumber-tests.ts @@ -0,0 +1,197 @@ +import * as assert from "power-assert"; +import cucumber = require("cucumber"); + +// You can optionally declare your own world properties +declare module "cucumber" { + interface World { + visit(url: string, callback: CallbackStepDefinition): void; + } +} + +function StepSample() { + type Callback = cucumber.CallbackStepDefinition; + type Table = cucumber.TableDefinition; + type HookScenarioResult = cucumber.HookScenarioResult; + const Status = cucumber.Status; + + cucumber.defineSupportCode(({setWorldConstructor, defineParameterType, After, AfterAll, Around, Before, BeforeAll, registerHandler, Given, When, Then}) => { + setWorldConstructor(function({attach, parameters}) { + this.attach = attach; + this.parameters = parameters; + this.visit = (url: string, callback: Callback) => { + callback(null, 'pending'); + }; + }); + + Before((scenarioResult: HookScenarioResult, callback: Callback) => { + console.log(scenarioResult.result.status === Status.FAILED); + callback(); + }); + + Before({ timeout: 1000 }, (scenarioResult: HookScenarioResult, callback: Callback) => { + console.log(scenarioResult.result.status === Status.FAILED); + callback(); + }); + + Before('@tag', (scenarioResult: HookScenarioResult, callback: Callback) => { + console.log(scenarioResult.result.status === Status.FAILED); + callback(); + }); + + BeforeAll((callback: Callback) => { + console.log("Before all"); + callback(); + }); + + BeforeAll({ timeout: 1000 }, (callback: Callback) => { + console.log("Before all"); + callback(); + }); + + BeforeAll('@tag', (callback: Callback) => { + console.log("Before all"); + callback(); + }); + + Around((scenarioResult: HookScenarioResult, runScenario: (error: string | null, callback?: () => void) => void) => { + if (scenarioResult.result.status === Status.FAILED) { + runScenario(null, () => { + console.log('finish tasks'); + }); + } + }); + + After((scenarioResult: HookScenarioResult, callback: Callback) => { + console.log("After"); + callback(); + }); + + After({ timeout: 1000 }, (scenarioResult: HookScenarioResult, callback: Callback) => { + console.log("After"); + callback(); + }); + + After('@tag', (scenarioResult: HookScenarioResult, callback: Callback) => { + console.log("After"); + callback(); + }); + + AfterAll((callback: Callback) => { + console.log("After all"); + callback(); + }); + + AfterAll({ timeout: 1000 }, (callback: Callback) => { + console.log("After all"); + callback(); + }); + + AfterAll('@tag', (callback: Callback) => { + console.log("After all"); + callback(); + }); + + registerHandler('AfterFeatures', (event: any, callback: () => void) => { + callback(); + }); + + Given(/^a variable set to (\d+)$/, (x: string) => { + console.log("the number is: " + x); + }); + + Given(/^a variable set to (\d+)$/, (x: number) => { + console.log(typeof x); + }); + + Given(/^I am on the Cucumber.js GitHub repository$/, function(callback: Callback) { + this.visit('https://github.com/cucumber/cucumber-js', callback); + }); + + When(/^I go to the README file$/, (title: string, callback: Callback) => { + callback(null, 'pending'); + }); + + Then(/^I should see "(.*)" as the page title$/, {timeout: 60 * 1000}, function(title: string, callback: Callback) { + const pageTitle = this.browser.text('title'); + + if (title === pageTitle) { + callback(); + } else { + callback(new Error("Expected to be on page with title " + title)); + } + }); + + // Type for data_table.js on + // https://github.com/cucumber/cucumber-js/blob/a5fd8251918c278ab2e389226d165cedb44df14a/lib/cucumber/ast/data_table.js + + Given(/^a table step with Table raw$/, (table: Table) => { + const expected = [ + ['Cucumber', 'Cucumis sativus'], + ['Burr Gherkin', 'Cucumis anguria'] + ]; + const actual: string[][] = table.raw(); + assert.deepEqual(actual, expected); + }); + + Given(/^a table step with Table rows$/, (table: Table) => { + const expected = [ + ['Apricot', '5'], + ['Brocolli', '2'], + ['Cucumber', '10'] + ]; + const actual: string[][] = table.rows(); + assert.deepEqual(actual, expected); + }); + + Given(/^a table step with Table rowHash$/, (table: Table) => { + const expected = { + Cucumber: 'Cucumis sativus', + 'Burr Gherkin': 'Cucumis anguria' + }; + const actual: { [firstCol: string]: string } = table.rowsHash(); + assert.deepEqual(actual, expected); + }); + + Given(/^a table step$/, (table: Table) => { + const expected = [ + {Vegetable: 'Apricot', Rating: '5'}, + {Vegetable: 'Brocolli', Rating: '2'}, + {Vegetable: 'Cucumber', Rating: '10'} + ]; + const actual: Array<{ [colName: string]: string }> = table.hashes(); + assert.deepEqual(actual, expected); + }); + + defineParameterType({ + regexp: /particular/, + transformer: s => s.toUpperCase(), + typeName: 'param' // deprecated but still supported + }); + + defineParameterType({ + regexp: /particularly/, + transformer: s => s.toUpperCase(), + name: 'param' + }); + + Given('a {param} step', param => { + assert.equal(param, 'PARTICULAR'); + }); + }); + + const fns: cucumber.SupportCodeConsumer[] = cucumber.getSupportCodeFns(); + + cucumber.clearSupportCodeFns(); +} + +function registerListener(): cucumber.EventListener { + const listener = Object.assign(cucumber.Listener(), { + handleBeforeScenarioEvent: (scenario: cucumber.events.ScenarioPayload, callback: () => void) => { + // do some interesting stuff ... + + callback(); + } + }); + + return listener; +} diff --git a/types/cucumber/v3/index.d.ts b/types/cucumber/v3/index.d.ts new file mode 100644 index 0000000000..8c2ad7020e --- /dev/null +++ b/types/cucumber/v3/index.d.ts @@ -0,0 +1,311 @@ +// Type definitions for cucumber-js 3.2 +// Project: https://github.com/cucumber/cucumber-js +// Definitions by: Abraão Alves +// Jan Molak +// Isaiah Soung +// BendingBender +// ErikSchierboom +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +export enum Status { + AMBIGUOUS = "ambiguous", + FAILED = "failed", + PASSED = "passed", + PENDING = "pending", + SKIPPED = "skipped", + UNDEFINED = "undefined" +} + +export interface World { + [key: string]: any; +} + +export interface CallbackStepDefinition { + pending(): PromiseLike; + (error?: any, pending?: string): void; +} + +export interface TableDefinition { + raw(): string[][]; + rows(): string[][]; + rowsHash(): { [firstCol: string]: string }; + hashes(): Array<{ [colName: string]: string }>; +} + +export type StepDefinitionCode = (this: World, ...stepArgs: any[]) => any; + +export interface StepDefinitionOptions { + timeout?: number; +} + +export interface StepDefinitions { + Given(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; + Given(pattern: RegExp | string, code: StepDefinitionCode): void; + When(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; + When(pattern: RegExp | string, code: StepDefinitionCode): void; + Then(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; + Then(pattern: RegExp | string, code: StepDefinitionCode): void; + setDefaultTimeout(time: number): void; +} + +export interface HookScenarioResult { + sourceLocation: SourceLocation; + result: ScenarioResult; + pickle: pickle.Pickle; +} + +export interface SourceLocation { + line: number; + url: string; +} + +export interface ScenarioResult { + duration: number; + status: Status; +} + +export namespace pickle { + interface Pickle { + language: string; + locations: Location[]; + name: string; + steps: Step[]; + tags: string[]; + } + + interface Location { + column: number; + line: number; + } + + interface Step { + arguments: Argument[]; + locations: Location[]; + text: string; + } + + interface Argument { + rows: Cell[]; + } + + interface Cell { + location: Location; + value: string; + } +} + +export type HookCode = (this: World, scenario: HookScenarioResult, callback?: CallbackStepDefinition) => void; +export type GlobalHookCode = (callback?: CallbackStepDefinition) => void; + +// tslint:disable-next-line ban-types +export type AroundCode = (scenario: HookScenarioResult, runScenario?: (error: string, callback?: Function) => void) => void; + +export interface Transform { + regexp: RegExp; + transformer(arg: string): any; + name?: string; + typeName?: string; // deprecated +} + +export interface HookOptions { + timeout?: number; + tags?: any; +} + +export interface Hooks { + Before(code: HookCode): void; + Before(options: HookOptions | string, code: HookCode): void; + BeforeAll(code: GlobalHookCode): void; + BeforeAll(options: HookOptions | string, code: GlobalHookCode): void; + After(code: HookCode): void; + After(options: HookOptions | string, code: HookCode): void; + AfterAll(code: GlobalHookCode): void; + AfterAll(options: HookOptions | string, code: GlobalHookCode): void; + Around(code: AroundCode): void; + setDefaultTimeout(time: number): void; + // tslint:disable-next-line ban-types + setWorldConstructor(world: ((this: World, init: {attach: Function, parameters: {[key: string]: any}}) => void) | {}): void; + registerHandler(handlerOption: string, code: (event: any, callback: CallbackStepDefinition) => void): void; + registerListener(listener: EventListener): void; + defineParameterType(transform: Transform): void; +} + +export class EventListener { + hear(event: events.Event, callback: () => void): void; + hasHandlerForEvent(event: events.Event): boolean; + buildHandlerNameForEvent(event: events.Event): string; + getHandlerForEvent(event: events.Event): EventHook; + buildHandlerName(shortName: string): string; + setHandlerForEvent(shortName: string, handler: EventListener): void; +} + +export function Listener(): EventListener; + +export namespace events { + interface Event { + name: string; + data: any; + } + + // tslint:disable-next-line no-empty-interface + interface EventPayload { + } + + interface FeaturesPayload extends EventPayload { + getFeatures(): any[]; // https://github.com/cucumber/cucumber-js/blob/dc698bf5bc10d591fa7adeec5fa21b2d90dc9679/lib/cucumber/runtime.js#L34 + } + + interface FeaturesResultPayload extends EventPayload { + duration: number; + scenarioResults: any[]; + success: boolean; + stepsResults: any[]; + strict: boolean; + } + + interface FeaturePayload extends EventPayload { + description: string; + keyword: string; + line: number; + name: string; + tags: Tag[]; + uri: string; + scenarios: Scenario[]; + } + + interface ScenarioPayload extends EventPayload { + feature: Feature; + exception: Error; + keyword: string; + lines: number[]; + name: string; + tags: Tag[]; + uri: string; + line: number; + description: string; + steps: Step[]; + } + + interface ScenarioResultPayload extends EventPayload { + duration: any; + failureException: Error; + scenario: Scenario; + status: Status; + stepResults: any[]; + } + + interface StepPayload extends EventPayload { + arguments: any; + line: number; + name: string; + scenario: Scenario; + uri: string; + isBackground: boolean; + keyword: string; + keywordType: string; + } + + interface StepResultPayload extends EventPayload { + ambiguousStepDefinitions: any; + attachments: any[]; + duration: any; + failureException: Error; + step: Step; + stepDefinition: StepDefinition; + status: Status; + } +} + +export interface StepDefinition { + // tslint:disable-next-line ban-types + code: Function; + line: number; + options: {}; + pattern: any; + uri: string; +} + +export interface Tag { + name: string; + line: number; +} + +export interface Step { + arguments: any; + line: number; + name: string; + scenario: Scenario; + uri: string; + isBackground: boolean; + keyword: string; + keywordType: string; +} + +export interface Scenario { + feature: Feature; + exception: Error; + keyword: string; + lines: number[]; + name: string; + tags: Tag[]; + uri: string; + line: number; + description: string; + steps: Step[]; +} + +export interface Feature { + description: string; + keyword: string; + line: number; + name: string; + tags: Tag[]; + uri: string; + scenarios: Scenario[]; +} + +export type EventHook = (event: events.Event, callback?: () => void) => void; + +export type SupportCodeConsumer = (stepDefinitions: StepDefinitions & Hooks) => void; + +export function defineSupportCode(consumer: SupportCodeConsumer): void; + +export function getSupportCodeFns(): SupportCodeConsumer[]; + +export function clearSupportCodeFns(): void; + +// https://github.com/cucumber/cucumber-js/commit/231183a8a11c985ef7ced1155b7a75f5120a34b6 +export class Formatter { + constructor(options?: any); + + log(data: any): void; +} + +export class SummaryFormatter extends Formatter { + indent(text: string, numberOfSpaces: number): any; +} + +export class PrettyFormatter extends SummaryFormatter { + formatTags(tags: Tag[]): any; + logIndented(text: string, level: number): void; + logStepResult(stepResult: any): void; +} + +export class ProgressFormatter extends SummaryFormatter { +} + +export class RerunFormatter extends Formatter { +} + +export class SnippetsFormatter extends Formatter { +} + +export class UsageFormatter extends Formatter { +} + +export class UsageJsonFormatter extends Formatter { +} + +export class JsonFormatter extends Formatter { +} diff --git a/types/cucumber/v3/tsconfig.json b/types/cucumber/v3/tsconfig.json new file mode 100644 index 0000000000..e10dd587c0 --- /dev/null +++ b/types/cucumber/v3/tsconfig.json @@ -0,0 +1,33 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "cucumber": [ + "cucumber/v3" + ], + "cucumber/*": [ + "cucumber/v3/*" + ] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "cucumber-tests.ts" + ] +} \ No newline at end of file diff --git a/types/linq4js/tslint.json b/types/cucumber/v3/tslint.json similarity index 70% rename from types/linq4js/tslint.json rename to types/cucumber/v3/tslint.json index bb491510c7..215db37b37 100644 --- a/types/linq4js/tslint.json +++ b/types/cucumber/v3/tslint.json @@ -1,9 +1,8 @@ { "extends": "dtslint/dt.json", + "no-any-union": false, "rules": { - // TODOs "no-any-union": false, - "no-unnecessary-class": false, "no-unnecessary-generics": false } } diff --git a/types/cuid/tsconfig.json b/types/cuid/tsconfig.json index 6aebd0a158..26c0b1289e 100644 --- a/types/cuid/tsconfig.json +++ b/types/cuid/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/currency-formatter/tsconfig.json b/types/currency-formatter/tsconfig.json index 47674cfe0d..21957b7d91 100644 --- a/types/currency-formatter/tsconfig.json +++ b/types/currency-formatter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/custom-error-generator/tsconfig.json b/types/custom-error-generator/tsconfig.json index ab16a76d97..99512cdf78 100644 --- a/types/custom-error-generator/tsconfig.json +++ b/types/custom-error-generator/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cwise-compiler/cwise-compiler-tests.ts b/types/cwise-compiler/cwise-compiler-tests.ts index 38e19de886..10d43f1930 100644 --- a/types/cwise-compiler/cwise-compiler-tests.ts +++ b/types/cwise-compiler/cwise-compiler-tests.ts @@ -1,9 +1,7 @@ -/// - -import * as parse from 'cwise-parser'; -import * as ndarray from 'ndarray'; -import * as compile from 'cwise-compiler'; -import * as tape from 'tape'; +import parse = require('cwise-parser'); +import ndarray = require('ndarray'); +import compile = require('cwise-compiler'); +import tape = require('tape'); tape("block tests", (t) => { const ops = require('ndarray-ops'); diff --git a/types/cwise-compiler/tsconfig.json b/types/cwise-compiler/tsconfig.json index 083c5f1666..09b88da3d2 100644 --- a/types/cwise-compiler/tsconfig.json +++ b/types/cwise-compiler/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cwise-parser/cwise-parser-tests.ts b/types/cwise-parser/cwise-parser-tests.ts index c50b9be06a..5ee5138a6e 100644 --- a/types/cwise-parser/cwise-parser-tests.ts +++ b/types/cwise-parser/cwise-parser-tests.ts @@ -1,6 +1,5 @@ -import * as parser from "cwise-parser"; -// import parser = require("cwise-parser"); -import * as tape from "tape"; +import parser = require("cwise-parser"); +import tape = require("tape"); tape("basic tests", (t) => { const parsed = parser((a: number, b: number, c: number) => { diff --git a/types/cwise-parser/tsconfig.json b/types/cwise-parser/tsconfig.json index 226bb609fb..b8d5702283 100644 --- a/types/cwise-parser/tsconfig.json +++ b/types/cwise-parser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cwise/cwise-tests.ts b/types/cwise/cwise-tests.ts index b759fb1a0c..3d88ee40fd 100644 --- a/types/cwise/cwise-tests.ts +++ b/types/cwise/cwise-tests.ts @@ -1,6 +1,6 @@ -import * as cwise from 'cwise'; -import * as ndarray from 'ndarray'; -import * as tape from 'tape'; +import cwise = require('cwise'); +import ndarray = require('ndarray'); +import tape = require('tape'); // basic tape("only allow same shape", (t) => { @@ -150,8 +150,7 @@ tape("binary", (t) => { t.end(); }); -// browserify -import * as browserify from "browserify"; +import browserify = require("browserify"); import * as vm from 'vm'; import * as path from 'path'; diff --git a/types/cwise/tsconfig.json b/types/cwise/tsconfig.json index c1ea871113..d545fa98d3 100644 --- a/types/cwise/tsconfig.json +++ b/types/cwise/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cybozulabs-md5/tsconfig.json b/types/cybozulabs-md5/tsconfig.json index a85459ac83..53d546abf1 100644 --- a/types/cybozulabs-md5/tsconfig.json +++ b/types/cybozulabs-md5/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cytoscape/index.d.ts b/types/cytoscape/index.d.ts index bf3439324b..ad0c8de371 100644 --- a/types/cytoscape/index.d.ts +++ b/types/cytoscape/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Fabian Schmidt and Fred Eisele // Shenghan Gao // Yuri Pereira Constante +// Jan-Niclas Struewer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // // Translation from Objects in help to Typescript interface. @@ -900,7 +901,7 @@ declare namespace cytoscape { /** complete - A function to call when the animation is done. */ complete?(): void; /** step - A function to call each time the animation steps. */ - step(): void; + step?(): void; } interface AnimationOptions extends AnimateOptionsCommon { /** queue - A transition-timing-function easing style string that shapes the animation progress curve. */ diff --git a/types/cytoscape/tsconfig.json b/types/cytoscape/tsconfig.json index 348734c733..8796925930 100644 --- a/types/cytoscape/tsconfig.json +++ b/types/cytoscape/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-array/tsconfig.json b/types/d3-array/tsconfig.json index a1dbb238ee..58e25ed31f 100644 --- a/types/d3-array/tsconfig.json +++ b/types/d3-array/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-axis/tsconfig.json b/types/d3-axis/tsconfig.json index 5b54d1f622..6bb2a44fd4 100644 --- a/types/d3-axis/tsconfig.json +++ b/types/d3-axis/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-box/tsconfig.json b/types/d3-box/tsconfig.json index d6411b9a05..d0ea7a30a8 100644 --- a/types/d3-box/tsconfig.json +++ b/types/d3-box/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-brush/tsconfig.json b/types/d3-brush/tsconfig.json index 2aeb012361..52ad4235a8 100644 --- a/types/d3-brush/tsconfig.json +++ b/types/d3-brush/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-chord/tsconfig.json b/types/d3-chord/tsconfig.json index eff4938f78..c5fe3e9133 100644 --- a/types/d3-chord/tsconfig.json +++ b/types/d3-chord/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-collection/tsconfig.json b/types/d3-collection/tsconfig.json index c2ae30cdbd..134b625635 100644 --- a/types/d3-collection/tsconfig.json +++ b/types/d3-collection/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-color/tsconfig.json b/types/d3-color/tsconfig.json index d783922755..a6695317db 100644 --- a/types/d3-color/tsconfig.json +++ b/types/d3-color/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-contour/tsconfig.json b/types/d3-contour/tsconfig.json index 345a064caa..deb7c3dc8f 100644 --- a/types/d3-contour/tsconfig.json +++ b/types/d3-contour/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-dispatch/tsconfig.json b/types/d3-dispatch/tsconfig.json index b270a9c1a0..44d0f4c3e8 100644 --- a/types/d3-dispatch/tsconfig.json +++ b/types/d3-dispatch/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-drag/tsconfig.json b/types/d3-drag/tsconfig.json index cb6cab8ba0..f8e6c58777 100644 --- a/types/d3-drag/tsconfig.json +++ b/types/d3-drag/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-dsv/tsconfig.json b/types/d3-dsv/tsconfig.json index 400095c38d..da64649d23 100644 --- a/types/d3-dsv/tsconfig.json +++ b/types/d3-dsv/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "d3-dsv-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/d3-dsv/v0/tsconfig.json b/types/d3-dsv/v0/tsconfig.json index e0ae8b7a42..1a0cae31df 100644 --- a/types/d3-dsv/v0/tsconfig.json +++ b/types/d3-dsv/v0/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-ease/tsconfig.json b/types/d3-ease/tsconfig.json index 6d0831f1a5..ea4d66c4dd 100644 --- a/types/d3-ease/tsconfig.json +++ b/types/d3-ease/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-fetch/d3-fetch-tests.ts b/types/d3-fetch/d3-fetch-tests.ts new file mode 100644 index 0000000000..24c6783997 --- /dev/null +++ b/types/d3-fetch/d3-fetch-tests.ts @@ -0,0 +1,38 @@ +import * as d3Fetch from 'd3-fetch'; +import { DSVParsedArray, DSVRowString, DSVRowAny } from 'd3-dsv'; + +interface MyType { + foo: string; +} + +const url = 'foo.bar'; + +const init: RequestInit = {}; + +let p1: Promise = d3Fetch.blob(url); +p1 = d3Fetch.blob(url, init); +let p2: Promise = d3Fetch.buffer(url); +p2 = d3Fetch.buffer(url, init); +let p3: Promise = d3Fetch.image(url); +p3 = d3Fetch.image(url, init); +let p4: Promise = d3Fetch.json(url); +p4 = d3Fetch.json(url, init); + +let myString: Promise; +myString = d3Fetch.text(url); +myString = d3Fetch.text(url, init); + +const parseRow = (d: {}) => { + const myType: MyType = { foo: 'foo' }; + return myType; +}; +let promise2: Promise>; +promise2 = d3Fetch.csv(url); +promise2 = d3Fetch.csv(url, init); +promise2 = d3Fetch.csv(url, init, parseRow); +promise2 = d3Fetch.dsv(';', url); +promise2 = d3Fetch.dsv(';', url, init); +promise2 = d3Fetch.dsv(';', url, init, parseRow); +promise2 = d3Fetch.tsv(url); +promise2 = d3Fetch.tsv(url, init); +promise2 = d3Fetch.tsv(url, init, parseRow); diff --git a/types/d3-fetch/index.d.ts b/types/d3-fetch/index.d.ts new file mode 100644 index 0000000000..9fd19fe8ed --- /dev/null +++ b/types/d3-fetch/index.d.ts @@ -0,0 +1,42 @@ +// Type definitions for d3-fetch 1.0 +// Project: https://d3js.org/d3-fetch/ +// Definitions by: Hugues Stefanski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 +import { DSVParsedArray, DSVRowString, DSVRowAny } from 'd3-dsv'; + +/** Fetches the binary file at the specified input URL as a Blob. If init is specified, it is passed along to the underlying call to fetch. */ +export function blob(url: string, init?: RequestInit): Promise; +/** Fetches the binary file at the specified input URL as an ArrayBuffer. If init is specified, it is passed along to the underlying call to fetch. */ +export function buffer(url: string, init?: RequestInit): Promise; + +/** Equivalent to d3.dsv with the comma character as the delimiter. */ +export function csv( + url: string, + init?: RequestInit, + row?: (d: DSVRowAny) => ParsedRow +): Promise>; + +/** Fetches the DSV file at the specified input URL. */ +export function dsv( + delimiter: string, + url: string, + init?: RequestInit, + row?: (d: DSVRowAny) => ParsedRow +): Promise>; + +/** Fetches the image at the specified input URL. If init is specified, it is passed along to the underlying call to fetch. */ +export function image(url: string, init?: RequestInit): Promise; + +/** Fetches the json file at the specified input URL. If init is specified, it is passed along to the underlying call to fetch. */ +export function json(url: string, init?: RequestInit): Promise<{}>; + +/** Fetches the text file at the specified input URL. If init is specified, it is passed along to the underlying call to fetch. */ +export function text(url: string, init?: RequestInit): Promise; + +/** Equivalent to d3.dsv with the tab character as the delimiter. */ +export function tsv( + url: string, + init?: RequestInit, + row?: (d: DSVRowAny) => ParsedRow +): Promise>; diff --git a/types/node-waves/tsconfig.json b/types/d3-fetch/tsconfig.json similarity index 79% rename from types/node-waves/tsconfig.json rename to types/d3-fetch/tsconfig.json index 06ed81e135..f30552f20d 100644 --- a/types/node-waves/tsconfig.json +++ b/types/d3-fetch/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", - "node-waves-tests.ts" + "d3-fetch-tests.ts" ] } \ No newline at end of file diff --git a/types/d3-fetch/tslint.json b/types/d3-fetch/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/d3-fetch/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/d3-force/tsconfig.json b/types/d3-force/tsconfig.json index 3d407406eb..cb3b3630c3 100644 --- a/types/d3-force/tsconfig.json +++ b/types/d3-force/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-format/tsconfig.json b/types/d3-format/tsconfig.json index 6017e0916f..cd2ccee91b 100644 --- a/types/d3-format/tsconfig.json +++ b/types/d3-format/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-geo/tsconfig.json b/types/d3-geo/tsconfig.json index f3661c3ad2..ea909a0598 100644 --- a/types/d3-geo/tsconfig.json +++ b/types/d3-geo/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-hexbin/tsconfig.json b/types/d3-hexbin/tsconfig.json index 773221263b..5f58387e06 100644 --- a/types/d3-hexbin/tsconfig.json +++ b/types/d3-hexbin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-hierarchy/tsconfig.json b/types/d3-hierarchy/tsconfig.json index 7fbc1fb5df..88974b9359 100644 --- a/types/d3-hierarchy/tsconfig.json +++ b/types/d3-hierarchy/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-hsv/tsconfig.json b/types/d3-hsv/tsconfig.json index c92ce346b2..3249f8d778 100644 --- a/types/d3-hsv/tsconfig.json +++ b/types/d3-hsv/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-interpolate/tsconfig.json b/types/d3-interpolate/tsconfig.json index 14435aff3d..6a3fd2a0b5 100644 --- a/types/d3-interpolate/tsconfig.json +++ b/types/d3-interpolate/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-path/tsconfig.json b/types/d3-path/tsconfig.json index 5f3fa1ca3e..6651f7ec3c 100644 --- a/types/d3-path/tsconfig.json +++ b/types/d3-path/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-polygon/tsconfig.json b/types/d3-polygon/tsconfig.json index 79bd8a43b8..3ac84426f5 100644 --- a/types/d3-polygon/tsconfig.json +++ b/types/d3-polygon/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-quadtree/tsconfig.json b/types/d3-quadtree/tsconfig.json index cbbb70a658..3a54e793e7 100644 --- a/types/d3-quadtree/tsconfig.json +++ b/types/d3-quadtree/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-queue/tsconfig.json b/types/d3-queue/tsconfig.json index 72f00c11e5..e48b49503e 100644 --- a/types/d3-queue/tsconfig.json +++ b/types/d3-queue/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-random/tsconfig.json b/types/d3-random/tsconfig.json index a8db248667..f497ce18bf 100644 --- a/types/d3-random/tsconfig.json +++ b/types/d3-random/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-request/tsconfig.json b/types/d3-request/tsconfig.json index a52d00ffaa..741908230f 100644 --- a/types/d3-request/tsconfig.json +++ b/types/d3-request/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-sankey/tsconfig.json b/types/d3-sankey/tsconfig.json index 503145683b..5067a33516 100644 --- a/types/d3-sankey/tsconfig.json +++ b/types/d3-sankey/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-scale-chromatic/tsconfig.json b/types/d3-scale-chromatic/tsconfig.json index 6dda07c981..60c78baedc 100644 --- a/types/d3-scale-chromatic/tsconfig.json +++ b/types/d3-scale-chromatic/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-scale/tsconfig.json b/types/d3-scale/tsconfig.json index 4fb09e2d39..2fe9977909 100644 --- a/types/d3-scale/tsconfig.json +++ b/types/d3-scale/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-selection-multi/tsconfig.json b/types/d3-selection-multi/tsconfig.json index 7344010335..51dfdb320f 100644 --- a/types/d3-selection-multi/tsconfig.json +++ b/types/d3-selection-multi/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-selection/tsconfig.json b/types/d3-selection/tsconfig.json index 9dea0e1226..fa2d410466 100644 --- a/types/d3-selection/tsconfig.json +++ b/types/d3-selection/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-shape/d3-shape-tests.ts b/types/d3-shape/d3-shape-tests.ts index 687da79188..e668d152f8 100644 --- a/types/d3-shape/d3-shape-tests.ts +++ b/types/d3-shape/d3-shape-tests.ts @@ -17,6 +17,7 @@ import { HierarchyPointLink, HierarchyPointNode } from 'd3-hierarchy'; let context: CanvasRenderingContext2D | null = document.querySelector('canvas')!.getContext('2d'); let num: number; +let padAngleMaybe: number | undefined; let pathStringMaybe: string | null; // ----------------------------------------------------------------------------------- @@ -28,7 +29,7 @@ interface ArcDatum { oRadius: number; sAngle: number; eAngle: number; - pAngle: number; + pAngle?: number; } const arcDefaultDatum: d3Shape.DefaultArcObject = { @@ -39,6 +40,13 @@ const arcDefaultDatum: d3Shape.DefaultArcObject = { padAngle: 0.03 }; +const arcReducedDefaultDatum: d3Shape.DefaultArcObject = { + innerRadius: 40, + outerRadius: 60, + startAngle: 0, + endAngle: Math.PI / 2 +}; + const arcDatum: ArcDatum = { iRadius: 40, oRadius: 60, @@ -48,6 +56,7 @@ const arcDatum: ArcDatum = { }; let accessorArcDatumNumber: (this: any, d: ArcDatum, ...args: any[]) => number; +let accessorArcDatumNumberOrUndefined: (this: any, d: ArcDatum, ...args: any[]) => number | undefined; let accessorArcDatumNumberOrNull: ((this: any, d: ArcDatum, ...args: any[]) => number) | null; // DefaultArcObject interface ======================================================== @@ -64,7 +73,7 @@ num = defaultArcObject.innerRadius; num = defaultArcObject.outerRadius; num = defaultArcObject.startAngle; num = defaultArcObject.endAngle; -num = defaultArcObject.padAngle; +padAngleMaybe = defaultArcObject.padAngle; // arc(...) create Arc generator ===================================================== @@ -134,7 +143,7 @@ canvasArc = canvasArc.padAngle(0); svgArc = svgArc.padAngle(d => { return d.pAngle; // datum type is ArcDatum }); -accessorArcDatumNumber = svgArc.padAngle(); +accessorArcDatumNumberOrUndefined = svgArc.padAngle(); // padRadius(...) ---------------------------------------------------------------------- diff --git a/types/d3-shape/index.d.ts b/types/d3-shape/index.d.ts index 27a92a79fe..5408508683 100644 --- a/types/d3-shape/index.d.ts +++ b/types/d3-shape/index.d.ts @@ -32,9 +32,9 @@ export interface DefaultArcObject { */ endAngle: number; /** - * Pad angle of arcin radians. + * Optional. Pad angle of arcin radians. */ - padAngle: number; + padAngle?: number; } /** @@ -230,7 +230,7 @@ export interface Arc { * Returns the current pad angle accessor, which defaults to a function returning the padAngle property * of the first argument passed into it, or false if no data are passed in or the property is not defined. */ - padAngle(): (this: This, d: Datum, ...args: any[]) => number; + padAngle(): (this: This, d: Datum, ...args: any[]) => number | undefined; /** * Sets the pad angle to the specified number and returns this arc generator. * @@ -248,7 +248,7 @@ export interface Arc { * * @param angle Constant angle in radians. */ - padAngle(angle: number): this; + padAngle(angle: number | undefined): this; /** * Sets the pad angle to the specified function and returns this arc generator. * @@ -267,7 +267,7 @@ export interface Arc { * @param angle An accessor function returning a number in radians to be used as an angle. The accessor function is invoked in the same "this" context as the generator was invoked in and * receives the same arguments that were passed into the arc generator. */ - padAngle(angle: (this: This, d: Datum, ...args: any[]) => number): this; + padAngle(angle: (this: This, d: Datum, ...args: any[]) => number | undefined): this; /** * Returns the current pad radius accessor, which defaults to null, indicating that the pad radius should be automatically computed as sqrt(innerRadius * innerRadius + outerRadius * outerRadius). diff --git a/types/d3-shape/tsconfig.json b/types/d3-shape/tsconfig.json index 0436aafd66..95b8e8a112 100644 --- a/types/d3-shape/tsconfig.json +++ b/types/d3-shape/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-time-format/tsconfig.json b/types/d3-time-format/tsconfig.json index 782a3ab291..829d92b69e 100644 --- a/types/d3-time-format/tsconfig.json +++ b/types/d3-time-format/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "d3-time-format-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/d3-time/tsconfig.json b/types/d3-time/tsconfig.json index 963c0df157..aa5250e8df 100644 --- a/types/d3-time/tsconfig.json +++ b/types/d3-time/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-timer/tsconfig.json b/types/d3-timer/tsconfig.json index f3af0c7d8e..6f04f3f1de 100644 --- a/types/d3-timer/tsconfig.json +++ b/types/d3-timer/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-tip/tsconfig.json b/types/d3-tip/tsconfig.json index 8bd5f064c9..7a4d78071c 100644 --- a/types/d3-tip/tsconfig.json +++ b/types/d3-tip/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-transition/tsconfig.json b/types/d3-transition/tsconfig.json index f23a386a94..43d4e23565 100644 --- a/types/d3-transition/tsconfig.json +++ b/types/d3-transition/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-voronoi/tsconfig.json b/types/d3-voronoi/tsconfig.json index ada834dec3..88819747f1 100644 --- a/types/d3-voronoi/tsconfig.json +++ b/types/d3-voronoi/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-zoom/tsconfig.json b/types/d3-zoom/tsconfig.json index ed184bf861..460c577983 100644 --- a/types/d3-zoom/tsconfig.json +++ b/types/d3-zoom/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3.cloud.layout/tsconfig.json b/types/d3.cloud.layout/tsconfig.json index ffb26214cc..5dc4a6e41b 100644 --- a/types/d3.cloud.layout/tsconfig.json +++ b/types/d3.cloud.layout/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3.slider/tsconfig.json b/types/d3.slider/tsconfig.json index a2a0a2c0c7..487fbb4be2 100644 --- a/types/d3.slider/tsconfig.json +++ b/types/d3.slider/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3/tsconfig.json b/types/d3/tsconfig.json index 8ec0a8e64e..adea130e6c 100644 --- a/types/d3/tsconfig.json +++ b/types/d3/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3/v3/tsconfig.json b/types/d3/v3/tsconfig.json index dd4cea8078..4912912a48 100644 --- a/types/d3/v3/tsconfig.json +++ b/types/d3/v3/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3kit/tsconfig.json b/types/d3kit/tsconfig.json index 40e266f6f9..3288c90ae9 100644 --- a/types/d3kit/tsconfig.json +++ b/types/d3kit/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3kit/v1/tsconfig.json b/types/d3kit/v1/tsconfig.json index f2112d2661..0856962263 100644 --- a/types/d3kit/v1/tsconfig.json +++ b/types/d3kit/v1/tsconfig.json @@ -23,7 +23,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3pie/tsconfig.json b/types/d3pie/tsconfig.json index c654f02557..ee657eb9ed 100644 --- a/types/d3pie/tsconfig.json +++ b/types/d3pie/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dagre-d3/tsconfig.json b/types/dagre-d3/tsconfig.json index 584a8cc848..c67751ed03 100644 --- a/types/dagre-d3/tsconfig.json +++ b/types/dagre-d3/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dagre-layout/tsconfig.json b/types/dagre-layout/tsconfig.json index 12bfb07f57..b1b3ec1692 100644 --- a/types/dagre-layout/tsconfig.json +++ b/types/dagre-layout/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dagre/tsconfig.json b/types/dagre/tsconfig.json index b5802bd42e..07d7208f87 100644 --- a/types/dagre/tsconfig.json +++ b/types/dagre/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dargs/tsconfig.json b/types/dargs/tsconfig.json index 88aef9d923..eb152319a9 100644 --- a/types/dargs/tsconfig.json +++ b/types/dargs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dashify/dashify-tests.ts b/types/dashify/dashify-tests.ts new file mode 100644 index 0000000000..3ff76d8628 --- /dev/null +++ b/types/dashify/dashify-tests.ts @@ -0,0 +1,7 @@ +import dashify = require('dashify'); + +const output: string = dashify('Foo----Bar'); +// => 'foo----bar' + +const output2: string = dashify('Foo----Bar', {condense: true}); +// => 'foo-bar' diff --git a/types/dashify/index.d.ts b/types/dashify/index.d.ts new file mode 100644 index 0000000000..54894f9e59 --- /dev/null +++ b/types/dashify/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for dashify 1.0 +// Project: https://github.com/jonschlinkert/dashify +// Definitions by: Junyoung Choi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function dashify(input: string, options?: dashify.Options): string; + +declare namespace dashify { + interface Options { + condense?: boolean; + } +} + +export = dashify; diff --git a/types/dashify/tsconfig.json b/types/dashify/tsconfig.json new file mode 100644 index 0000000000..4ca9ab12f2 --- /dev/null +++ b/types/dashify/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "dashify-tests.ts" + ] +} \ No newline at end of file diff --git a/types/dashify/tslint.json b/types/dashify/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/dashify/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/dat-gui/tsconfig.json b/types/dat-gui/tsconfig.json index 4961272694..b8138868cc 100644 --- a/types/dat-gui/tsconfig.json +++ b/types/dat-gui/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/data-driven/tsconfig.json b/types/data-driven/tsconfig.json index 7e3cb6a15c..4423546191 100644 --- a/types/data-driven/tsconfig.json +++ b/types/data-driven/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/datadog-metrics/tsconfig.json b/types/datadog-metrics/tsconfig.json index ca3613429a..3cb76e9dfd 100644 --- a/types/datadog-metrics/tsconfig.json +++ b/types/datadog-metrics/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/datatables.net-buttons/tsconfig.json b/types/datatables.net-buttons/tsconfig.json index 3e8d4ce82c..47ef321009 100644 --- a/types/datatables.net-buttons/tsconfig.json +++ b/types/datatables.net-buttons/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/datatables.net-fixedheader/tsconfig.json b/types/datatables.net-fixedheader/tsconfig.json index 5c747aa854..e42c69588e 100644 --- a/types/datatables.net-fixedheader/tsconfig.json +++ b/types/datatables.net-fixedheader/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/datatables.net-rowgroup/datatables.net-rowgroup-tests.ts b/types/datatables.net-rowgroup/datatables.net-rowgroup-tests.ts new file mode 100644 index 0000000000..d0149faba2 --- /dev/null +++ b/types/datatables.net-rowgroup/datatables.net-rowgroup-tests.ts @@ -0,0 +1,40 @@ +let config_1: DataTables.Settings = { + // RowGroup extension options + rowGroup: { + className: 'className', + enable: true, + dataSrc: 'data', + endClassName: 'endClassName', + endRender: (rows, group) => { + return `${ group } (${ rows.count() } rows)`; + }, + startRender: (rows, group) => { + return `${ group } (${ rows.count() } rows)`; + } + } +}; + +let dt: DataTables.Api = $("selector").DataTable({ + rowGroup: true +}); + +// Statics +let fixed_1 = new $.fn.dataTable.RowGroup(dt, { + enable: true, +}); + +let fixed_2 = new $.fn.dataTable.RowGroup(dt, true); + +let version = $.fn.dataTable.RowGroup.version; + +$.fn.dataTable.RowGroup.defaults.className = 'row-group-class'; + +// API +dt.rowGroup().dataSrc(); +dt.rowGroup().disable(); +dt.rowGroup().enable(true); + +// Chaining +dt.rowGroup().dataSrc(12) + .rowGroup().disable() + .rowGroup().enable(); diff --git a/types/datatables.net-rowgroup/index.d.ts b/types/datatables.net-rowgroup/index.d.ts new file mode 100644 index 0000000000..e2697c7fac --- /dev/null +++ b/types/datatables.net-rowgroup/index.d.ts @@ -0,0 +1,88 @@ +// Type definitions for datatables.net-rowgroup 1.0 +// Project: https://datatables.net/extensions/rowgroup/ +// Definitions by: Matthieu Tabuteau +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// +/// + +declare namespace DataTables { + interface Settings { + /** + * RowGroup extension options + */ + rowGroup?: boolean | RowGroupSettings; + } + + interface StaticFunctions { + RowGroup: RowGroupStaticFunctions; + } + + interface RowGroupStaticFunctions { + new (dt: Api, settings: boolean | RowGroupSettings): undefined; + version: string; + defaults: RowGroupSettings; + } + + interface Api { + rowGroup(): RowGroupApi; + } + + interface RowGroupApi { + /** + * Get the data source for the row grouping + */ + dataSrc(): number|string; + + /** + * Set the data source for the row grouping + */ + dataSrc(prop: number|string): Api; + + /** + * Disable RowGroup's interaction with the table + */ + disable(): Api; + + /** + * Enable or disable RowGroup's interaction with the table + */ + enable(enable?: boolean): Api; + } + + /** + * RowGroup extension options + */ + interface RowGroupSettings { + /** + * Set the class name to be used for the grouping rows + */ + className?: string; + + /** + * Set the data point to use as the grouping data source + */ + dataSrc?: number|string; + + /** + * Provides the ability to disable row grouping at initialisation + */ + enable?: boolean; + + /** + * Set the class name to be used for the grouping end rows + */ + endClassName?: string; + + /** + * Provide a function that can be used to control the data shown in the end grouping row + */ + endRender?: (rows: Api, group: string) => string|HTMLElement|JQuery; + + /** + * Provide a function that can be used to control the data shown in the start grouping row + */ + startRender?: (rows: Api, group: string) => string|HTMLElement|JQuery; + } +} diff --git a/types/datatables.net-rowgroup/tsconfig.json b/types/datatables.net-rowgroup/tsconfig.json new file mode 100644 index 0000000000..66d4610072 --- /dev/null +++ b/types/datatables.net-rowgroup/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "datatables.net-rowgroup-tests.ts" + ] +} \ No newline at end of file diff --git a/types/datatables.net-rowgroup/tslint.json b/types/datatables.net-rowgroup/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/datatables.net-rowgroup/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/datatables.net-rowreorder/tsconfig.json b/types/datatables.net-rowreorder/tsconfig.json index c16752cd22..3f2a9668a1 100644 --- a/types/datatables.net-rowreorder/tsconfig.json +++ b/types/datatables.net-rowreorder/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/datatables.net-select/tsconfig.json b/types/datatables.net-select/tsconfig.json index 50398d173e..63aaf5e9df 100644 --- a/types/datatables.net-select/tsconfig.json +++ b/types/datatables.net-select/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/datatables.net/tsconfig.json b/types/datatables.net/tsconfig.json index 04972add17..8aafdcfc1c 100644 --- a/types/datatables.net/tsconfig.json +++ b/types/datatables.net/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/date-arithmetic/tsconfig.json b/types/date-arithmetic/tsconfig.json index d8942e343c..2e9dea5326 100644 --- a/types/date-arithmetic/tsconfig.json +++ b/types/date-arithmetic/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/date.format.js/tsconfig.json b/types/date.format.js/tsconfig.json index a7a5e7f404..a835b70fa3 100644 --- a/types/date.format.js/tsconfig.json +++ b/types/date.format.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dateformat/tsconfig.json b/types/dateformat/tsconfig.json index 1c5fc06611..0511224dad 100644 --- a/types/dateformat/tsconfig.json +++ b/types/dateformat/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/datejs/tsconfig.json b/types/datejs/tsconfig.json index 5d17ca2da9..eb53ed05f1 100644 --- a/types/datejs/tsconfig.json +++ b/types/datejs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/daterangepicker/tsconfig.json b/types/daterangepicker/tsconfig.json index 1ed4157bc7..621dd6dada 100644 --- a/types/daterangepicker/tsconfig.json +++ b/types/daterangepicker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/db-migrate-base/tsconfig.json b/types/db-migrate-base/tsconfig.json index f4c835bb88..0d756c7d5c 100644 --- a/types/db-migrate-base/tsconfig.json +++ b/types/db-migrate-base/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/db-migrate-pg/tsconfig.json b/types/db-migrate-pg/tsconfig.json index c63efcd105..3243faf3dd 100644 --- a/types/db-migrate-pg/tsconfig.json +++ b/types/db-migrate-pg/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/db.js/tsconfig.json b/types/db.js/tsconfig.json index 75989af0b3..10ea07f745 100644 --- a/types/db.js/tsconfig.json +++ b/types/db.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dc/tsconfig.json b/types/dc/tsconfig.json index 863d600736..290a1e994d 100644 --- a/types/dc/tsconfig.json +++ b/types/dc/tsconfig.json @@ -24,6 +24,7 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/deasync/tsconfig.json b/types/deasync/tsconfig.json index d61004bac3..d62c8d7f8e 100644 --- a/types/deasync/tsconfig.json +++ b/types/deasync/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/debessmann/tsconfig.json b/types/debessmann/tsconfig.json index b8b4c01d06..1dc931d093 100644 --- a/types/debessmann/tsconfig.json +++ b/types/debessmann/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/debounce/tsconfig.json b/types/debounce/tsconfig.json index bf08d46e44..4dd1415a27 100644 --- a/types/debounce/tsconfig.json +++ b/types/debounce/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/debug/tsconfig.json b/types/debug/tsconfig.json index 7caca45f35..33cacd7464 100644 --- a/types/debug/tsconfig.json +++ b/types/debug/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/decamelize/tsconfig.json b/types/decamelize/tsconfig.json index 54bea1b020..9c034b4839 100644 --- a/types/decamelize/tsconfig.json +++ b/types/decamelize/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/decay/tsconfig.json b/types/decay/tsconfig.json index d35511f505..1300da9349 100644 --- a/types/decay/tsconfig.json +++ b/types/decay/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/decompress/tsconfig.json b/types/decompress/tsconfig.json index 33c7a8c5e8..a76b0817fd 100644 --- a/types/decompress/tsconfig.json +++ b/types/decompress/tsconfig.json @@ -14,10 +14,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ "index.d.ts", "decompress-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/decorum/tsconfig.json b/types/decorum/tsconfig.json index 82792e10c5..40ba95f9ea 100644 --- a/types/decorum/tsconfig.json +++ b/types/decorum/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dedent/tsconfig.json b/types/dedent/tsconfig.json index 30c39b0a23..61234daf73 100644 --- a/types/dedent/tsconfig.json +++ b/types/dedent/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/deep-assign/tsconfig.json b/types/deep-assign/tsconfig.json index 76d4b1b23e..f8a0647dca 100644 --- a/types/deep-assign/tsconfig.json +++ b/types/deep-assign/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/deep-diff/tsconfig.json b/types/deep-diff/tsconfig.json index 95cd2d22ac..76c498035e 100644 --- a/types/deep-diff/tsconfig.json +++ b/types/deep-diff/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/deep-equal/tsconfig.json b/types/deep-equal/tsconfig.json index e5c20aa772..9c016f9281 100644 --- a/types/deep-equal/tsconfig.json +++ b/types/deep-equal/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/deep-extend/tsconfig.json b/types/deep-extend/tsconfig.json index 768b1ac92d..ff77090b23 100644 --- a/types/deep-extend/tsconfig.json +++ b/types/deep-extend/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/deep-freeze-es6/tsconfig.json b/types/deep-freeze-es6/tsconfig.json index cf9a3b32f5..f47120248f 100644 --- a/types/deep-freeze-es6/tsconfig.json +++ b/types/deep-freeze-es6/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/deep-freeze-strict/tsconfig.json b/types/deep-freeze-strict/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/deep-freeze-strict/tsconfig.json +++ b/types/deep-freeze-strict/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/deep-freeze/tsconfig.json b/types/deep-freeze/tsconfig.json index 3fe6438f96..bd681a7f3b 100644 --- a/types/deep-freeze/tsconfig.json +++ b/types/deep-freeze/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/deepmerge/tsconfig.json b/types/deepmerge/tsconfig.json index b863d1bcb9..fd45a1df17 100644 --- a/types/deepmerge/tsconfig.json +++ b/types/deepmerge/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/defaults/tsconfig.json b/types/defaults/tsconfig.json index 4a66176c28..90757c2104 100644 --- a/types/defaults/tsconfig.json +++ b/types/defaults/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/defer-promise/tsconfig.json b/types/defer-promise/tsconfig.json index 1aaa667626..ef7ffa0690 100644 --- a/types/defer-promise/tsconfig.json +++ b/types/defer-promise/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "defer-promise-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/define-lazy-prop/tsconfig.json b/types/define-lazy-prop/tsconfig.json index e72c943c52..8b8f252553 100644 --- a/types/define-lazy-prop/tsconfig.json +++ b/types/define-lazy-prop/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/defined/tsconfig.json b/types/defined/tsconfig.json index 35b5bb7c83..3f8607f716 100644 --- a/types/defined/tsconfig.json +++ b/types/defined/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/deku/tsconfig.json b/types/deku/tsconfig.json index ad8473665d..67cbce0a6a 100644 --- a/types/deku/tsconfig.json +++ b/types/deku/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/del/tsconfig.json b/types/del/tsconfig.json index 6143d08346..8d4988bb00 100644 --- a/types/del/tsconfig.json +++ b/types/del/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/del/v2/tsconfig.json b/types/del/v2/tsconfig.json index 568d1a8a21..00f2f32920 100644 --- a/types/del/v2/tsconfig.json +++ b/types/del/v2/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/delaunator/tsconfig.json b/types/delaunator/tsconfig.json index a9c94600d8..97bca0c508 100644 --- a/types/delaunator/tsconfig.json +++ b/types/delaunator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/delay/tsconfig.json b/types/delay/tsconfig.json index cb0da53652..039ccc4860 100644 --- a/types/delay/tsconfig.json +++ b/types/delay/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/denodeify/tsconfig.json b/types/denodeify/tsconfig.json index 04d0008cd5..309f54e7c1 100644 --- a/types/denodeify/tsconfig.json +++ b/types/denodeify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/deoxxa-content-type/tsconfig.json b/types/deoxxa-content-type/tsconfig.json index 5f50fa4676..10d2335f0f 100644 --- a/types/deoxxa-content-type/tsconfig.json +++ b/types/deoxxa-content-type/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/depcheck/tsconfig.json b/types/depcheck/tsconfig.json index f3a0a7df65..14f56cc2b5 100644 --- a/types/depcheck/tsconfig.json +++ b/types/depcheck/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "depcheck-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/depd/tsconfig.json b/types/depd/tsconfig.json index cea39d4996..3164f96fa6 100644 --- a/types/depd/tsconfig.json +++ b/types/depd/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/deployjava/tsconfig.json b/types/deployjava/tsconfig.json index 934531a4ee..7241ae5513 100644 --- a/types/deployjava/tsconfig.json +++ b/types/deployjava/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/destroy-on-hwm/tsconfig.json b/types/destroy-on-hwm/tsconfig.json index 8f77b1b9a4..54b7ae1b87 100644 --- a/types/destroy-on-hwm/tsconfig.json +++ b/types/destroy-on-hwm/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/destroy/tsconfig.json b/types/destroy/tsconfig.json index d3c5ca771d..4d57e05510 100644 --- a/types/destroy/tsconfig.json +++ b/types/destroy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/detect-browser/tsconfig.json b/types/detect-browser/tsconfig.json index b1319407fc..745bcc8128 100644 --- a/types/detect-browser/tsconfig.json +++ b/types/detect-browser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/detect-hover/tsconfig.json b/types/detect-hover/tsconfig.json index 69abd062cd..b2f4b457c6 100644 --- a/types/detect-hover/tsconfig.json +++ b/types/detect-hover/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/detect-indent/tsconfig.json b/types/detect-indent/tsconfig.json index 3119632150..e75f82a918 100644 --- a/types/detect-indent/tsconfig.json +++ b/types/detect-indent/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/detect-indent/v0/tsconfig.json b/types/detect-indent/v0/tsconfig.json index 6fb921c298..a646b4f457 100644 --- a/types/detect-indent/v0/tsconfig.json +++ b/types/detect-indent/v0/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/detect-it/tsconfig.json b/types/detect-it/tsconfig.json index 28787b09b8..c74d5b9c65 100644 --- a/types/detect-it/tsconfig.json +++ b/types/detect-it/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/detect-newline/tsconfig.json b/types/detect-newline/tsconfig.json index a94c517f93..1ee86197af 100644 --- a/types/detect-newline/tsconfig.json +++ b/types/detect-newline/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/detect-passive-events/tsconfig.json b/types/detect-passive-events/tsconfig.json index 83ddf05856..6e57a4488c 100644 --- a/types/detect-passive-events/tsconfig.json +++ b/types/detect-passive-events/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/detect-pointer/tsconfig.json b/types/detect-pointer/tsconfig.json index 50b7d6cb7d..de5138f95a 100644 --- a/types/detect-pointer/tsconfig.json +++ b/types/detect-pointer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/detect-port/tsconfig.json b/types/detect-port/tsconfig.json index 9d400580a4..353d626311 100644 --- a/types/detect-port/tsconfig.json +++ b/types/detect-port/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/detect-touch-events/tsconfig.json b/types/detect-touch-events/tsconfig.json index 03b3cc49cb..cfd46b1f2b 100644 --- a/types/detect-touch-events/tsconfig.json +++ b/types/detect-touch-events/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/devexpress-web/tsconfig.json b/types/devexpress-web/tsconfig.json index 3510853ddd..22b3c9ce8c 100644 --- a/types/devexpress-web/tsconfig.json +++ b/types/devexpress-web/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/devexpress-web/v161/tsconfig.json b/types/devexpress-web/v161/tsconfig.json index 0c6ad80e42..1875485bf1 100644 --- a/types/devexpress-web/v161/tsconfig.json +++ b/types/devexpress-web/v161/tsconfig.json @@ -23,7 +23,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/devexpress-web/v162/tsconfig.json b/types/devexpress-web/v162/tsconfig.json index 0878906afb..b0e0cd1a6f 100644 --- a/types/devexpress-web/v162/tsconfig.json +++ b/types/devexpress-web/v162/tsconfig.json @@ -23,7 +23,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/devtools-detect/tsconfig.json b/types/devtools-detect/tsconfig.json index 8ab64cb68c..cbf7e862ac 100644 --- a/types/devtools-detect/tsconfig.json +++ b/types/devtools-detect/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/df-visible/tsconfig.json b/types/df-visible/tsconfig.json index ca15676b02..3ada905eca 100644 --- a/types/df-visible/tsconfig.json +++ b/types/df-visible/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dhtmlxgantt/tsconfig.json b/types/dhtmlxgantt/tsconfig.json index f897e58d02..280ae19957 100644 --- a/types/dhtmlxgantt/tsconfig.json +++ b/types/dhtmlxgantt/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dhtmlxscheduler/tsconfig.json b/types/dhtmlxscheduler/tsconfig.json index 8d145fb613..71b2f56ab6 100644 --- a/types/dhtmlxscheduler/tsconfig.json +++ b/types/dhtmlxscheduler/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/di-lite/tsconfig.json b/types/di-lite/tsconfig.json index 7f10ef8967..e76b11c158 100644 --- a/types/di-lite/tsconfig.json +++ b/types/di-lite/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/diacritics/tsconfig.json b/types/diacritics/tsconfig.json index 03b49dbe95..f0b9510d2e 100644 --- a/types/diacritics/tsconfig.json +++ b/types/diacritics/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/diff-match-patch/tsconfig.json b/types/diff-match-patch/tsconfig.json index 11f60e2489..a28e29633b 100644 --- a/types/diff-match-patch/tsconfig.json +++ b/types/diff-match-patch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/diff/tsconfig.json b/types/diff/tsconfig.json index 9a1fdba840..bf2e3af341 100644 --- a/types/diff/tsconfig.json +++ b/types/diff/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/diff2html/index.d.ts b/types/diff2html/index.d.ts index ce2522d444..1b75f1e3df 100644 --- a/types/diff2html/index.d.ts +++ b/types/diff2html/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Diff2Html { - + export interface Options { inputFormat?: string; outputFormat?: string; @@ -53,10 +53,11 @@ declare namespace Diff2Html { checksumAfter?: string; mode?: string; } - + export interface Diff2Html { - getJsonFromDiff(input: string, configuration?: Options): Result; + getJsonFromDiff(input: string, configuration?: Options): Result[]; getPrettyHtml(input: any, configuration?: Options): string; + getPrettyHtmlFromJson(input: Result[], configuration?: Options): string; } } diff --git a/types/diff2html/tsconfig.json b/types/diff2html/tsconfig.json index bb9662b5b6..7eb376bb33 100644 --- a/types/diff2html/tsconfig.json +++ b/types/diff2html/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dir-resolve/tsconfig.json b/types/dir-resolve/tsconfig.json index 129d8a0aa9..1a2677f4da 100644 --- a/types/dir-resolve/tsconfig.json +++ b/types/dir-resolve/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/discontinuous-range/tsconfig.json b/types/discontinuous-range/tsconfig.json index 26c43bf7f0..64edbc248e 100644 --- a/types/discontinuous-range/tsconfig.json +++ b/types/discontinuous-range/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/disposable-email-domains/tsconfig.json b/types/disposable-email-domains/tsconfig.json index 70b9e249d1..3fd51dba9b 100644 --- a/types/disposable-email-domains/tsconfig.json +++ b/types/disposable-email-domains/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/doccookies/tsconfig.json b/types/doccookies/tsconfig.json index e4de927a2f..9df6ed48d5 100644 --- a/types/doccookies/tsconfig.json +++ b/types/doccookies/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dock-spawn/tsconfig.json b/types/dock-spawn/tsconfig.json index a5c6c7b144..c79bde1059 100644 --- a/types/dock-spawn/tsconfig.json +++ b/types/dock-spawn/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dockerode/dockerode-tests.ts b/types/dockerode/dockerode-tests.ts index 458134917b..f53f0d2ad4 100644 --- a/types/dockerode/dockerode-tests.ts +++ b/types/dockerode/dockerode-tests.ts @@ -1,4 +1,4 @@ -import * as Docker from 'dockerode'; +import Docker = require('dockerode'); import * as fs from 'fs'; // Code samples from Dockerode 'Getting started' diff --git a/types/dockerode/tsconfig.json b/types/dockerode/tsconfig.json index 3334b9b296..85e6705d47 100644 --- a/types/dockerode/tsconfig.json +++ b/types/dockerode/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/docopt/tsconfig.json b/types/docopt/tsconfig.json index bc71021fcd..ac4ca64e76 100644 --- a/types/docopt/tsconfig.json +++ b/types/docopt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/doctrine/tsconfig.json b/types/doctrine/tsconfig.json index 1b9e7702c2..cf7070091c 100644 --- a/types/doctrine/tsconfig.json +++ b/types/doctrine/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/documentdb-server/tsconfig.json b/types/documentdb-server/tsconfig.json index 98dcf6bf5c..9320c53f1b 100644 --- a/types/documentdb-server/tsconfig.json +++ b/types/documentdb-server/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/documentdb-session/tsconfig.json b/types/documentdb-session/tsconfig.json index 40ab7520b7..45398d91dd 100644 --- a/types/documentdb-session/tsconfig.json +++ b/types/documentdb-session/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/documentdb/tsconfig.json b/types/documentdb/tsconfig.json index 48c13eac51..f602f0c74d 100644 --- a/types/documentdb/tsconfig.json +++ b/types/documentdb/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dojo/tsconfig.json b/types/dojo/tsconfig.json index 140f764554..d7f9e50b42 100644 --- a/types/dojo/tsconfig.json +++ b/types/dojo/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -83,5 +84,4 @@ "dojox.widget.d.ts", "dojox.xml.d.ts" ] -} - +} \ No newline at end of file diff --git a/types/dom-inputevent/tsconfig.json b/types/dom-inputevent/tsconfig.json index a309b9ec2e..cd56b783f6 100644 --- a/types/dom-inputevent/tsconfig.json +++ b/types/dom-inputevent/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dom4/dom4-tests.ts b/types/dom4/dom4-tests.ts index 35867f2e43..7dbf8e12f0 100644 --- a/types/dom4/dom4-tests.ts +++ b/types/dom4/dom4-tests.ts @@ -1,7 +1,7 @@ function testDocument() { - document.query(".container-a").classList; - document.queryAll(".container-b")[0].className; - document.queryAll(".container-c").childElementCount; + document.querySelector(".container-a").classList; + document.querySelectorAll(".container-b")[0].className; + document.querySelector(".container-c").append("foo", document.createElement("button")); } function testElement(el: Element) { diff --git a/types/dom4/index.d.ts b/types/dom4/index.d.ts index 95cabbd4d3..90c9c29966 100644 --- a/types/dom4/index.d.ts +++ b/types/dom4/index.d.ts @@ -1,8 +1,11 @@ -// Type definitions for dom4 v1.5 +// Type definitions for dom4 v2.0 // Project: https://github.com/WebReflection/dom4 // Definitions by: Adi Dahiya , Gilad Gray // Definitions: https://github.com/borisyankov/DefinitelyTyped +/** + * https://dom.spec.whatwg.org/#parentnode + */ interface ParentNode { /** * Returns the child elements. @@ -10,21 +13,46 @@ interface ParentNode { readonly children: HTMLCollection; /** - * Returns the first element that is a descendant of node that matches relativeSelectors. + * Inserts `nodes` after the last child of this node, while replacing strings with equivalent `Text` nodes. */ - query(relativeSelectors: string): Element; + append(...nodes: Array): void; /** - * Returns all element descendants of node that match relativeSelectors. + * Inserts `nodes` before the first child of this node, while replacing strings with equivalent `Text` nodes. */ - queryAll(relativeSelectors: string): Elements; + prepend(...nodes: Array): void; +} + +/** + * https://dom.spec.whatwg.org/#childnode + */ +interface ChildNode { + /** + * Inserts `nodes` just after this node, while replacing strings with equivalent `Text` nodes. + */ + after(...nodes: Array): void; + + /** + * Inserts `nodes` just before this node, while replacing strings with equivalent `Text` nodes. + */ + before(...nodes: Array): void; + + /** + * Replaces this node with `nodes`, while replacing strings in nodes with equivalent Text nodes. + */ + replaceWith(...nodes: Array): void; + + /** + * Removes this node. + */ + remove(): void; } interface Element extends ParentNode { /** * Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. */ - closest(selectors: string): Element; + closest(selectors: string): Element | null; /** * Returns true if matching selectors against element’s root yields element, and false otherwise. diff --git a/types/dom4/tsconfig.json b/types/dom4/tsconfig.json index 3db581ed36..579670df92 100644 --- a/types/dom4/tsconfig.json +++ b/types/dom4/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/domo/tsconfig.json b/types/domo/tsconfig.json index 1700042ecc..d98ca4d683 100644 --- a/types/domo/tsconfig.json +++ b/types/domo/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dompurify/tsconfig.json b/types/dompurify/tsconfig.json index f10fdda910..e43c9febde 100644 --- a/types/dompurify/tsconfig.json +++ b/types/dompurify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/domready/tsconfig.json b/types/domready/tsconfig.json index 1495d185a6..08391e9dd2 100644 --- a/types/domready/tsconfig.json +++ b/types/domready/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/domurl/tsconfig.json b/types/domurl/tsconfig.json index c678dbc069..450c43b839 100644 --- a/types/domurl/tsconfig.json +++ b/types/domurl/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/donna/tsconfig.json b/types/donna/tsconfig.json index 6e06e71c36..c683e15ca5 100644 --- a/types/donna/tsconfig.json +++ b/types/donna/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dookie/tsconfig.json b/types/dookie/tsconfig.json index a788cba5bc..e4f71c26fa 100644 --- a/types/dookie/tsconfig.json +++ b/types/dookie/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dot-object/tsconfig.json b/types/dot-object/tsconfig.json index f58205cdaf..941ba764dc 100644 --- a/types/dot-object/tsconfig.json +++ b/types/dot-object/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dot-prop/tsconfig.json b/types/dot-prop/tsconfig.json index cbacf32b41..73180091a1 100644 --- a/types/dot-prop/tsconfig.json +++ b/types/dot-prop/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dot-prop/v2/tsconfig.json b/types/dot-prop/v2/tsconfig.json index f5770f3083..66701208fc 100644 --- a/types/dot-prop/v2/tsconfig.json +++ b/types/dot-prop/v2/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dot/tsconfig.json b/types/dot/tsconfig.json index 2c1a595ac6..dc732938b9 100644 --- a/types/dot/tsconfig.json +++ b/types/dot/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dotdir-regex/tsconfig.json b/types/dotdir-regex/tsconfig.json index 48f516abd8..05a1fa51fc 100644 --- a/types/dotdir-regex/tsconfig.json +++ b/types/dotdir-regex/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "dotdir-regex-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/dotdotdot/tsconfig.json b/types/dotdotdot/tsconfig.json index 8be8dc5245..646dc386bb 100644 --- a/types/dotdotdot/tsconfig.json +++ b/types/dotdotdot/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dotenv-safe/tsconfig.json b/types/dotenv-safe/tsconfig.json index 46b51afc29..3deacfa95d 100644 --- a/types/dotenv-safe/tsconfig.json +++ b/types/dotenv-safe/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dotenv/tsconfig.json b/types/dotenv/tsconfig.json index 5c51b4d698..f5e49e1b84 100644 --- a/types/dotenv/tsconfig.json +++ b/types/dotenv/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dotenv/v2/tsconfig.json b/types/dotenv/v2/tsconfig.json index facb307571..c7b540d409 100644 --- a/types/dotenv/v2/tsconfig.json +++ b/types/dotenv/v2/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dotfile-regex/tsconfig.json b/types/dotfile-regex/tsconfig.json index 899be54b3b..74e46144e6 100644 --- a/types/dotfile-regex/tsconfig.json +++ b/types/dotfile-regex/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "dotfile-regex-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/dottie/tsconfig.json b/types/dottie/tsconfig.json index f770bbf57d..34b719f7be 100644 --- a/types/dottie/tsconfig.json +++ b/types/dottie/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/double-ended-queue/tsconfig.json b/types/double-ended-queue/tsconfig.json index 5477379341..5289474c22 100644 --- a/types/double-ended-queue/tsconfig.json +++ b/types/double-ended-queue/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "double-ended-queue-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/doublearray/tsconfig.json b/types/doublearray/tsconfig.json index fbc5ab9e55..60fcedffa5 100644 --- a/types/doublearray/tsconfig.json +++ b/types/doublearray/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/doubleclick-gpt/tsconfig.json b/types/doubleclick-gpt/tsconfig.json index d240d560ce..0cadcea552 100644 --- a/types/doubleclick-gpt/tsconfig.json +++ b/types/doubleclick-gpt/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/download/download-tests.ts b/types/download/download-tests.ts index 34d56d763b..7a498ef0dd 100644 --- a/types/download/download-tests.ts +++ b/types/download/download-tests.ts @@ -28,8 +28,3 @@ download('unicorn.com/foo.jpg', 'dest', { }, useElectronNet: true }); - -import * as download2 from 'download'; - -let downloadFunction = download; -downloadFunction = download2; diff --git a/types/download/tsconfig.json b/types/download/tsconfig.json index 634ae5ab32..4c2a798181 100644 --- a/types/download/tsconfig.json +++ b/types/download/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "download-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/downloadjs/tsconfig.json b/types/downloadjs/tsconfig.json index 15703cf41a..ef9a4f48df 100644 --- a/types/downloadjs/tsconfig.json +++ b/types/downloadjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/draft-js/tsconfig.json b/types/draft-js/tsconfig.json index 58fc6cd302..6b00c0304b 100644 --- a/types/draft-js/tsconfig.json +++ b/types/draft-js/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/drag-timetable/tsconfig.json b/types/drag-timetable/tsconfig.json index 875c35f69a..bb865cb850 100644 --- a/types/drag-timetable/tsconfig.json +++ b/types/drag-timetable/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/draggabilly/tsconfig.json b/types/draggabilly/tsconfig.json index d34c51c338..ce7ce9796a 100644 --- a/types/draggabilly/tsconfig.json +++ b/types/draggabilly/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dragster/tsconfig.json b/types/dragster/tsconfig.json index c415da2b1a..a01e46114a 100644 --- a/types/dragster/tsconfig.json +++ b/types/dragster/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dragula/tsconfig.json b/types/dragula/tsconfig.json index 8179057247..2a559a985a 100644 --- a/types/dragula/tsconfig.json +++ b/types/dragula/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dropboxjs/tsconfig.json b/types/dropboxjs/tsconfig.json index c1c700cf02..eacfcbef6a 100644 --- a/types/dropboxjs/tsconfig.json +++ b/types/dropboxjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dropkickjs/tsconfig.json b/types/dropkickjs/tsconfig.json index 31076fcede..236482a1b4 100644 --- a/types/dropkickjs/tsconfig.json +++ b/types/dropkickjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dropzone/tsconfig.json b/types/dropzone/tsconfig.json index 552b864cb7..122461bf99 100644 --- a/types/dropzone/tsconfig.json +++ b/types/dropzone/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dropzone/v4/tsconfig.json b/types/dropzone/v4/tsconfig.json index d88ab721fd..aae03fcbc2 100644 --- a/types/dropzone/v4/tsconfig.json +++ b/types/dropzone/v4/tsconfig.json @@ -16,6 +16,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { "dropzone": [ "dropzone/v4" diff --git a/types/dsv/tsconfig.json b/types/dsv/tsconfig.json index ba47a0e093..caec8c18be 100644 --- a/types/dsv/tsconfig.json +++ b/types/dsv/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dts-bundle/tsconfig.json b/types/dts-bundle/tsconfig.json index a380447ece..e0f3943154 100644 --- a/types/dts-bundle/tsconfig.json +++ b/types/dts-bundle/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dts-generator/tsconfig.json b/types/dts-generator/tsconfig.json index 97bc3726f6..2095dbfe71 100644 --- a/types/dts-generator/tsconfig.json +++ b/types/dts-generator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/duplexer2/tsconfig.json b/types/duplexer2/tsconfig.json index 90332a13a9..f6c3a3bd6f 100644 --- a/types/duplexer2/tsconfig.json +++ b/types/duplexer2/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/duplexer3/tsconfig.json b/types/duplexer3/tsconfig.json index 1b3e73cc33..bffe49054d 100644 --- a/types/duplexer3/tsconfig.json +++ b/types/duplexer3/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/duplexify/tsconfig.json b/types/duplexify/tsconfig.json index 72c801f5ab..77cccda4d5 100644 --- a/types/duplexify/tsconfig.json +++ b/types/duplexify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/duplicate-package-checker-webpack-plugin/tsconfig.json b/types/duplicate-package-checker-webpack-plugin/tsconfig.json index 7174bf68ea..835669e473 100644 --- a/types/duplicate-package-checker-webpack-plugin/tsconfig.json +++ b/types/duplicate-package-checker-webpack-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/durandal/tsconfig.json b/types/durandal/tsconfig.json index d34d6a1d77..19a01dfff9 100644 --- a/types/durandal/tsconfig.json +++ b/types/durandal/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/durandal/v1/tsconfig.json b/types/durandal/v1/tsconfig.json index d39bcbc18d..f0245c65e7 100644 --- a/types/durandal/v1/tsconfig.json +++ b/types/durandal/v1/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/dustjs-linkedin/tsconfig.json b/types/dustjs-linkedin/tsconfig.json index 36a7497468..a0f0dca49a 100644 --- a/types/dustjs-linkedin/tsconfig.json +++ b/types/dustjs-linkedin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dvtng-jss/tsconfig.json b/types/dvtng-jss/tsconfig.json index 3d47f98d9f..c7b51d7005 100644 --- a/types/dvtng-jss/tsconfig.json +++ b/types/dvtng-jss/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "dvtng-jss-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/dw-bxslider-4/tsconfig.json b/types/dw-bxslider-4/tsconfig.json index 64526359b3..e5465c64d5 100644 --- a/types/dw-bxslider-4/tsconfig.json +++ b/types/dw-bxslider-4/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dwt/tsconfig.json b/types/dwt/tsconfig.json index db2ac6bbf4..bc93f94dcd 100644 --- a/types/dwt/tsconfig.json +++ b/types/dwt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dwt/v12/tsconfig.json b/types/dwt/v12/tsconfig.json index f856dd2657..7ef5ca74c2 100644 --- a/types/dwt/v12/tsconfig.json +++ b/types/dwt/v12/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dygraphs/tsconfig.json b/types/dygraphs/tsconfig.json index c3ff239b4b..d6df213d34 100644 --- a/types/dygraphs/tsconfig.json +++ b/types/dygraphs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dymo-label-framework/tsconfig.json b/types/dymo-label-framework/tsconfig.json index 23ac4038d1..54a508bf9f 100644 --- a/types/dymo-label-framework/tsconfig.json +++ b/types/dymo-label-framework/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dynatable/tsconfig.json b/types/dynatable/tsconfig.json index 04ffb1120a..ca539d36d9 100644 --- a/types/dynatable/tsconfig.json +++ b/types/dynatable/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dynogels/tsconfig.json b/types/dynogels/tsconfig.json index 40297f0a43..07145428de 100644 --- a/types/dynogels/tsconfig.json +++ b/types/dynogels/tsconfig.json @@ -14,7 +14,8 @@ "types": [], "noEmit": true, "strictFunctionTypes": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/each/tsconfig.json b/types/each/tsconfig.json index 4b80cb809d..0148832306 100644 --- a/types/each/tsconfig.json +++ b/types/each/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/earcut/earcut-tests.ts b/types/earcut/earcut-tests.ts new file mode 100644 index 0000000000..83fdd1110c --- /dev/null +++ b/types/earcut/earcut-tests.ts @@ -0,0 +1,17 @@ +const a = earcut([10, 0, 0, 50, 60, 60, 70, 10]); +// @example with a hole: +const b = earcut([0, 0, 100, 0, 100, 100, 0, 100, 20, 20, 80, 20, 80, 80, 20, 80], [4]); // [3,0,4, 5,4,0, 3,4,7, 5,0,1, 2,3,7, 6,5,1, 2,7,6, 6,1,2] +// @example with 3d coords: +const c = earcut([10, 0, 1, 0, 50, 2, 60, 60, 3, 70, 10, 4], undefined, 3); // [1,0,3, 3,2,1] + +declare const vertices: number[]; +declare const holes: number[]; +declare const dimensions: number; +const triangles = earcut(vertices, holes, dimensions); +const deviation = earcut.deviation(vertices, holes, dimensions, triangles); + +const data = earcut.flatten([[[0, 0], [100, 0], [0, 100]], [[10, 10], [0, 10], [10, 0]]]); +const triangles2 = earcut(data.vertices, data.holes, data.dimensions); + +declare const multiDimData: number[][][]; +const triangles3 = earcut(data.vertices, data.holes, data.dimensions); diff --git a/types/earcut/index.d.ts b/types/earcut/index.d.ts new file mode 100644 index 0000000000..cb1ee3df13 --- /dev/null +++ b/types/earcut/index.d.ts @@ -0,0 +1,49 @@ +// Type definitions for earcut 2.1 +// Project: https://github.com/mapbox/earcut#readme +// Definitions by: Adrian Leonhard +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Duplicated export mirrors actual source: https://github.com/mapbox/earcut/blob/master/src/earcut.js#L3-L4 + +interface EarcutStatic { + /** + * Triangulate an outline. + * + * @param vertices A flat array of vertice coordinates like [x0,y0, x1,y1, x2,y2, ...]. + * @param holes An array of hole indices if any (e.g. [5, 8] for a 12-vertice input would mean one hole with vertices 5–7 and another with 8–11). + * @param dimensions The number of coordinates per vertice in the input array (2 by default). + * @return A flat array with each group of three numbers indexing a triangle in the `vertices` array. + * @example earcut([10,0, 0,50, 60,60, 70,10]); // returns [1,0,3, 3,2,1] + * @example with a hole: earcut([0,0, 100,0, 100,100, 0,100, 20,20, 80,20, 80,80, 20,80], [4]); // [3,0,4, 5,4,0, 3,4,7, 5,0,1, 2,3,7, 6,5,1, 2,7,6, 6,1,2] + * @example with 3d coords: earcut([10,0,1, 0,50,2, 60,60,3, 70,10,4], null, 3); // [1,0,3, 3,2,1] + */ + (vertices: ArrayLike, holes?: ArrayLike, dimensions?: number): number[]; + + /** + * Transforms multi-dimensional array (e.g. GeoJSON Polygon) into the format expected by earcut. + * @example Transforming GeoJSON data. + * const data = earcut.flatten(geojson.geometry.coordinates); + * const triangles = earcut(data.vertices, data.holes, data.dimensions); + * @example Transforming simple triangle with hole: + * const data = earcut.flatten([[[0, 0], [100, 0], [0, 100]], [[10, 10], [0, 10], [10, 0]]]); + * const triangles = earcut(data.vertices, data.holes, data.dimensions); + * @param data Arrays of rings, with the first being the outline and the rest holes. A ring is an array points, each point being an array of numbers. + */ + flatten(data: ArrayLike>>): { vertices: number[], holes: number[], dimensions: number }; + + /** + * Returns the relative difference between the total area of triangles and the area of the input polygon. 0 means the triangulation is fully correct. + * @param vertices same as earcut + * @param holes same as earcut + * @param dimensions same as earcut + * @param triangles see return value of earcut + * @example + * const triangles = earcut(vertices, holes, dimensions); + * const deviation = earcut.deviation(vertices, holes, dimensions, triangles); + */ + deviation(vertices: ArrayLike, holes: ArrayLike | undefined, dimensions: number, triangles: ArrayLike): number; + + default: EarcutStatic; +} +declare const exports: EarcutStatic; +export = exports; +export as namespace earcut; diff --git a/types/earcut/tsconfig.json b/types/earcut/tsconfig.json new file mode 100644 index 0000000000..24dddd5a2b --- /dev/null +++ b/types/earcut/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "earcut-tests.ts" + ] +} \ No newline at end of file diff --git a/types/earcut/tslint.json b/types/earcut/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/earcut/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/easeljs/tsconfig.json b/types/easeljs/tsconfig.json index 1925fa9a78..7b9d6a37f8 100644 --- a/types/easeljs/tsconfig.json +++ b/types/easeljs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/easy-api-request/tsconfig.json b/types/easy-api-request/tsconfig.json index 8cc26d7811..682a4930a0 100644 --- a/types/easy-api-request/tsconfig.json +++ b/types/easy-api-request/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/easy-jsend/tsconfig.json b/types/easy-jsend/tsconfig.json index 3efc497aaf..4a69b01d6e 100644 --- a/types/easy-jsend/tsconfig.json +++ b/types/easy-jsend/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/easy-session/tsconfig.json b/types/easy-session/tsconfig.json index 99d70bf37b..1e2dce35c0 100644 --- a/types/easy-session/tsconfig.json +++ b/types/easy-session/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/easy-table/tsconfig.json b/types/easy-table/tsconfig.json index 4013bbca85..1c1ae66ab8 100644 --- a/types/easy-table/tsconfig.json +++ b/types/easy-table/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/easy-xapi-utils/tsconfig.json b/types/easy-xapi-utils/tsconfig.json index 6cd04a79b9..2d2ccd5660 100644 --- a/types/easy-xapi-utils/tsconfig.json +++ b/types/easy-xapi-utils/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/easy-xapi/tsconfig.json b/types/easy-xapi/tsconfig.json index fa0e8da402..d77f1bf681 100644 --- a/types/easy-xapi/tsconfig.json +++ b/types/easy-xapi/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ebongarde-root/tsconfig.json b/types/ebongarde-root/tsconfig.json index 4765268055..e18dcd54f4 100644 --- a/types/ebongarde-root/tsconfig.json +++ b/types/ebongarde-root/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/echarts/index.d.ts b/types/echarts/index.d.ts index 0ea8aa0c6a..1f42f8030c 100644 --- a/types/echarts/index.d.ts +++ b/types/echarts/index.d.ts @@ -2,6 +2,7 @@ // Project: http://echarts.baidu.com/ // Definitions by: Xie Jingyang , AntiMoron // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 declare namespace echarts { function init(dom: HTMLDivElement | HTMLCanvasElement, theme?: Object | string, opts?: { @@ -9,13 +10,13 @@ declare namespace echarts { renderer?: string }): ECharts; - const graphic: { + const graphic: Graphic; + + interface Graphic { clipPointsByRect(points: number[][], rect: ERectangle): number[][]; clipRectByRect(targetRect: ERectangle, rect: ERectangle): ERectangle; - LinearGradient: { new (x: number, y: number, x2: number, y2: number, colorStops: Array, globalCoord?: boolean): LinearGradient } - - }; - + LinearGradient: { new(x: number, y: number, x2: number, y2: number, colorStops: Array, globalCoord?: boolean): LinearGradient } + } function connect(group: string | Array): void; @@ -29,6 +30,15 @@ declare namespace echarts { function registerTheme(themeName: string, theme: Object): void; + interface MapObj { + /** geoJson data for map */ + geoJson: object, + /** special areas fro map */ + specialAreas: object + } + + function getMap(mapName: string): MapObj; + interface LinearGradient { colorStops: Array; global: boolean; @@ -39,9 +49,8 @@ declare namespace echarts { y2: number } - interface ECharts { - group: string; + group: string setOption(option: EChartOption, notMerge?: boolean, notRefreshImmediately?: boolean): void @@ -66,20 +75,20 @@ declare namespace echarts { hideLoading(): void getDataURL(opts: { - // 导出的格å¼ï¼Œå¯é€‰ png, jpeg + /** 导出的格å¼ï¼Œå¯é€‰ png, jpeg */ type?: string, - // 导出的图片分辨率比例,默认为 1。 + /** 导出的图片分辨率比例,默认为 1。*/ pixelRatio?: number, - // 导出的图片背景色,默认使用 option 里的 backgroundColor + /** 导出的图片背景色,默认使用 option 里的 backgroundColor */ backgroundColor?: string }): string getConnectedDataURL(opts: { - // 导出的格å¼ï¼Œå¯é€‰ png, jpeg + /** 导出的格å¼ï¼Œå¯é€‰ png, jpeg */ type: string, - // 导出的图片分辨率比例,默认为 1。 + /** 导出的图片分辨率比例,默认为 1。 */ pixelRatio: number, - // 导出的图片背景色,默认使用 option 里的 backgroundColor + /** 导出的图片背景色,默认使用 option 里的 backgroundColor */ backgroundColor: string }): string @@ -89,42 +98,32 @@ declare namespace echarts { dispose(): void - // 转æ¢é€»è¾‘点到åƒç´  - convertToPixel(finder: { - seriesIndex?: number, - seriesId?: string, - seriesName?: string, - geoIndex?: number, - geoId?: string, - geoName?: string, - xAxisIndex?: number, - xAxisId?: string, - xAxisName?: string, - yAxisIndex?: number, - yAxisId?: string, - yAxisName?: string, - gridIndex?: number, - gridId?: string - gridName?: string - } | string, value: string | Array): string | Array + /** 转æ¢é€»è¾‘点到åƒç´  */ + convertToPixel(finder: ConvertFinder | string, value: string | Array): string | Array - convertFromPixel(finder: { - seriesIndex?: number, - seriesId?: string, - seriesName?: string, - geoIndex?: number, - geoId?: string, - geoName?: string, - xAxisIndex?: number, - xAxisId?: string, - xAxisName?: string, - yAxisIndex?: number, - yAxisId?: string, - yAxisName?: string, - gridIndex?: number, - gridId?: string - gridName?: string - } | string, value: Array | string): Array | string + convertFromPixel(finder: ConvertFinder | string, value: Array | string): Array | string + + containPixel(finder: ConvertFinder | string, + /** è¦è¢«åˆ¤æ–­çš„点,为åƒç´ å标值,以 echarts 实例的 dom èŠ‚ç‚¹çš„å·¦ä¸Šè§’ä¸ºåæ ‡ [0, 0] 点。*/ + value: any[]): boolean + } + + interface ConvertFinder { + seriesIndex?: number, + seriesId?: string, + seriesName?: string, + geoIndex?: number, + geoId?: string, + geoName?: string, + xAxisIndex?: number, + xAxisId?: string, + xAxisName?: string, + yAxisIndex?: number, + yAxisId?: string, + yAxisName?: string, + gridIndex?: number, + gridId?: string + gridName?: string } interface ERectangle { @@ -194,3 +193,7 @@ declare namespace echarts { declare module 'echarts' { export = echarts; } + +declare module 'echarts/lib/echarts' { + export = echarts; +} diff --git a/types/echarts/tsconfig.json b/types/echarts/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/echarts/tsconfig.json +++ b/types/echarts/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/ecurve/tsconfig.json b/types/ecurve/tsconfig.json index b3d1d586fe..a63c9a4fb5 100644 --- a/types/ecurve/tsconfig.json +++ b/types/ecurve/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ed25519/tsconfig.json b/types/ed25519/tsconfig.json index 98fa33a4b1..31cc84042c 100644 --- a/types/ed25519/tsconfig.json +++ b/types/ed25519/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ed25519-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ed2curve/ed2curve-tests.ts b/types/ed2curve/ed2curve-tests.ts new file mode 100644 index 0000000000..bb26cf5b49 --- /dev/null +++ b/types/ed2curve/ed2curve-tests.ts @@ -0,0 +1,9 @@ +import * as ed2curve from 'ed2curve'; +import * as nacl from 'tweetnacl'; + +const myKeyPair = nacl.sign.keyPair(); + +const newPublicKey = ed2curve.convertPublicKey(myKeyPair.publicKey); +const newSecretKey = ed2curve.convertSecretKey(myKeyPair.secretKey); + +const newKeyPair = ed2curve.convertKeyPair(myKeyPair); diff --git a/types/ed2curve/index.d.ts b/types/ed2curve/index.d.ts new file mode 100644 index 0000000000..6b27ee56e4 --- /dev/null +++ b/types/ed2curve/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for ed2curve 0.2 +// Project: https://github.com/dchest/ed2curve-js +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import { BoxKeyPair, SignKeyPair } from "tweetnacl"; + +export as namespace ed2curve; + +/** + * Converts Ed25519 public key to Curve25519 public key. + * montgomeryX = (edwardsY + 1)*inverse(1 - edwardsY) mod p + */ +export function convertPublicKey(publicKey: SignKeyPair["publicKey"]): BoxKeyPair["publicKey"] | null; + +/** Converts Ed25519 secret key to Curve25519 secret key. */ +export function convertSecretKey(secretKey: SignKeyPair["secretKey"]): BoxKeyPair["secretKey"] | null; + +/** Converts Ed25519 key pair to Curve25519 key pair. */ +export function convertKeyPair(keyPair: SignKeyPair): BoxKeyPair; diff --git a/types/rollup/package.json b/types/ed2curve/package.json similarity index 63% rename from types/rollup/package.json rename to types/ed2curve/package.json index 100334a89f..95cfca5ea9 100644 --- a/types/rollup/package.json +++ b/types/ed2curve/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "source-map": "^0.6.1" + "tweetnacl": "^1.0.0" } } diff --git a/types/ed2curve/tsconfig.json b/types/ed2curve/tsconfig.json new file mode 100644 index 0000000000..41c38b86dc --- /dev/null +++ b/types/ed2curve/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "ed2curve-tests.ts" + ] +} \ No newline at end of file diff --git a/types/ed2curve/tslint.json b/types/ed2curve/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ed2curve/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/egg-mock/tsconfig.json b/types/egg-mock/tsconfig.json index 86b33fc149..b1c6e12ced 100644 --- a/types/egg-mock/tsconfig.json +++ b/types/egg-mock/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/egg.js/tsconfig.json b/types/egg.js/tsconfig.json index c7364d3f99..45a13df64d 100644 --- a/types/egg.js/tsconfig.json +++ b/types/egg.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/egjs__axes/Axes.d.ts b/types/egjs__axes/Axes.d.ts index 83bd1f24af..2b00624ee2 100644 --- a/types/egjs__axes/Axes.d.ts +++ b/types/egjs__axes/Axes.d.ts @@ -1,4 +1,4 @@ -import * as Component from "@egjs/component"; +import Component = require("@egjs/component"); import { AnimationManager } from "./AnimationManager"; import { EventManager } from "./EventManager"; import { InterruptManager } from "./InterruptManager"; diff --git a/types/egjs__axes/tsconfig.json b/types/egjs__axes/tsconfig.json index 3086687bc3..6abab016ee 100644 --- a/types/egjs__axes/tsconfig.json +++ b/types/egjs__axes/tsconfig.json @@ -15,6 +15,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { "@egjs/component": [ "egjs__component" diff --git a/types/egjs__component/tsconfig.json b/types/egjs__component/tsconfig.json index 778e5a9f16..cc2373f384 100644 --- a/types/egjs__component/tsconfig.json +++ b/types/egjs__component/tsconfig.json @@ -15,6 +15,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { "@egjs/component": [ "egjs__component" diff --git a/types/ej.web.all/ej.web.all-tests.ts b/types/ej.web.all/ej.web.all-tests.ts index 678754d5d4..9ccc1ca9f9 100644 --- a/types/ej.web.all/ej.web.all-tests.ts +++ b/types/ej.web.all/ej.web.all-tests.ts @@ -1,10 +1,3 @@ -interface Window { - kanbanData: any; - themeVarient: string; - themeStyle: string; - themeColor: string; -} - module AccordionComponent { $(function () { var sample = new ej.Accordion($("#basicAccordion"), { @@ -25,30 +18,30 @@ module AccordionComponent { }); } -module AutocompleteComponent{ +module AutocompleteComponent { var carList = [ - "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", - "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", - "Chevrolet Camaro", "Cadillac", - "Duesenberg J", "Dodge Sprinter", - "Elantra", "Excavator", - "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", - "GAZ Siber", - "Honda S2000", "Hyundai Santro", - "Isuzu Swift", "Infiniti Skyline", - "Jaguar XJS", - "Kia Sedona EX", "Koenigsegg Agera", - "Lotus Esprit", "Lamborghini Diablo", - "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", - "Nissan Qashqai", - "Oldsmobile S98", "Opel Superboss", - "Porsche 356", "Pontiac Sunbird", - "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", - "Triumph Spitfire", "Toyota 2000GT", - "Volvo P1800", "Volkswagen Shirako" - ]; + "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", + "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", + "Chevrolet Camaro", "Cadillac", + "Duesenberg J", "Dodge Sprinter", + "Elantra", "Excavator", + "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", + "GAZ Siber", + "Honda S2000", "Hyundai Santro", + "Isuzu Swift", "Infiniti Skyline", + "Jaguar XJS", + "Kia Sedona EX", "Koenigsegg Agera", + "Lotus Esprit", "Lamborghini Diablo", + "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", + "Nissan Qashqai", + "Oldsmobile S98", "Opel Superboss", + "Porsche 356", "Pontiac Sunbird", + "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", + "Triumph Spitfire", "Toyota 2000GT", + "Volvo P1800", "Volkswagen Shirako" + ]; $(function () { - var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { + var autocompleteInstance = new ej.Autocomplete($("#selectCar"), { width: "100%", watermarkText: "Select a car", dataSource: carList, @@ -59,6 +52,8 @@ module AutocompleteComponent{ }); } + + module Barcodecomponent { $(function () { var barcodesample = new ej.datavisualization.Barcode($("#Barcode"), { @@ -67,14 +62,14 @@ module Barcodecomponent { }); } + module Bulletgraphcomponent { $(function () { var bulletsample = new ej.datavisualization.BulletGraph($("#BulletGraph"), { isResponsive: true, load: function () { var sender = $("#BulletGraph").data("ejBulletGraph"); - var theme: string; - var bulletTheme = window.themeStyle + window.themeColor + window.themeVarient; + var bulletTheme = (window).themeStyle + (window).themeColor + (window).themeVarient; if (bulletTheme) { switch (bulletTheme) { case "flatdark": @@ -87,17 +82,17 @@ module Bulletgraphcomponent { case "gradientsaffrondark": case "flathigh-contrast-01dark": case "flathigh-contrast-02dark": - theme = "flatdark"; + bulletTheme = "flatdark"; break; case "flatoffice-365light": case "flatmateriallight": - theme = "material"; + bulletTheme = "material"; break; default: - theme = "flatlight"; + bulletTheme = "flatlight"; break; } - sender.model.theme = theme; + sender.model.theme = bulletTheme; } }, @@ -127,6 +122,7 @@ module Bulletgraphcomponent { }); } + module ButtonComponent { $(function () { var basicButton = new ej.Button($("#buttonnormal"), { @@ -173,7 +169,6 @@ module ButtonComponent { } module ChartComponent { - var theme = "???"; $(function () { var chartsample = new ej.datavisualization.Chart($("#Chart"), { primaryXAxis: { @@ -188,9 +183,9 @@ module ChartComponent { }, commonSeriesOptions: - { + { type: 'line', enableAnimation: true, - tooltip:{ visible :true, template:'Tooltip'}, + tooltip: { visible: true, template: 'Tooltip' }, marker: { shape: 'circle', @@ -200,30 +195,30 @@ module ChartComponent { }, visible: true }, - border : {width: 2} + border: { width: 2 } }, series: - [ - { - points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, - { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], - name: 'India' + [ + { + points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 }, { x: 2007, y: 26 }, { x: 2008, y: 27 }, + { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], + name: 'India' }, { - points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, - { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], - name: 'Germany' - }, - { - points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, - { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], - name: 'England' + points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 }, { x: 2007, y: 30 }, { x: 2008, y: 36 }, + { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], + name: 'Germany' }, { - points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, - { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], - name: 'France' - } + points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 }, { x: 2007, y: 34 }, { x: 2008, y: 41 }, + { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], + name: 'England' + }, + { + points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 }, { x: 2007, y: 40 }, { x: 2008, y: 44 }, + { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], + name: 'France' + } ], isResponsive: true, load: function () { @@ -251,6 +246,7 @@ module ChartComponent { model.primaryYAxis.labelIntersectAction = "rotate45"; model.primaryYAxis.edgeLabelPlacement = "hide"; } + var theme = (window).themeStyle + (window).themeColor + (window).themeVarient; if (theme) { switch (theme) { case "flatdark": @@ -292,7 +288,7 @@ module ChartComponent { }, title: { text: 'Efficiency of oil-fired power production' }, size: { height: "600" }, - legend: { visible: true} + legend: { visible: true }, }); }); } @@ -356,6 +352,24 @@ module ColorPickerComponent { }); } +module ComboBoxComponent { + var BikeList = [ + { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, + { empid: "bk4", text: "Discover" }, { empid: "bk5", text: "Dazzler" }, { empid: "bk6", text: "Flame" }, + { empid: "bk7", text: "Fazzer" }, { empid: "bk8", text: "FZ-S" }, { empid: "bk9", text: "Pulsar" }, + { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } + ]; + $(function () { + var comboboxInstance = new ej.ComboBox($("#selectCar"), { + width: "100%", + placeholder: "Select a Bike", + fields: { text: "text", value: "empid" }, + dataSource: BikeList, + autofill: true + }); + }); +} + module DatePickerComponent { $(function () { var dateSample = new ej.DatePicker($("#datepick"), { @@ -413,7 +427,8 @@ $(function () { }), createNode({ name: "Project", width: 150, height: 100, offsetX: 300, offsetY: 430, labels: [createLabel({ "text": "Find Project \nmanager" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Decision }), createNode({ - name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), + name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process + }), createNode({ name: "Decision", width: 250, height: 60, offsetX: 550, offsetY: 60, labels: [createLabel({ "text": "Decision Process for new software ideas" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Card, fillColor: "#858585", borderColor: "#858585" }), createNode({ name: "Reject", width: 150, height: 60, offsetX: 550, offsetY: 285, labels: [createLabel({ "text": "Reject and write report" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), createNode({ name: "Resources", width: 150, height: 60, offsetX: 550, offsetY: 430, labels: [createLabel({ "text": "Hire new resources" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }) @@ -474,6 +489,7 @@ module DialogComponent { }); } + module digitalgaugecomponent { $(function () { var digitalgaugesample = new ej.datavisualization.DigitalGauge($("#DigitalGauge"), { @@ -497,6 +513,7 @@ module digitalgaugecomponent { } + module DropDownListComponent { var BikeList = [ { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, @@ -528,6 +545,7 @@ module DropDownListComponent { } + module ExplorerComponent { $(function () { var file = new ej.FileExplorer($("#fileExplorer"), { @@ -542,55 +560,54 @@ module ExplorerComponent { } module GanttComponent { - $(function () { - var ganttInstance = new ej.Gantt($("#GanttContainer"), { - dataSource: (window).projectData, - allowColumnResize: true, - allowSorting: true, - allowSelection: true, - enableContextMenu: true, - taskIdMapping: "taskID", - allowDragAndDrop: true, - taskNameMapping: "taskName", - startDateMapping: "startDate", - showColumnChooser: true, - showColumnOptions: true, - progressMapping: "progress", - durationMapping: "duration", - endDateMapping: "endDate", - childMapping: "subtasks", - scheduleStartDate: "02/01/2014", - scheduleEndDate: "04/09/2014", - //Resources mapping - resourceInfoMapping: "resourceId", - resourceNameMapping: "resourceName", - resourceIdMapping: "resourceId", - resources: (window).projectResources, - predecessorMapping: "predecessor", - showResourceNames: true, - toolbarSettings: { - showToolbar: true, - toolbarItems: ["add","edit","delete","update","cancel","indent","outdent","expandAll","collapseAll","search"] - }, - editSettings: { - allowEditing: true, - allowAdding: true, - allowDeleting: true, - allowIndent: true, - editMode: "cellEditing" - }, - sizeSettings: { - width: "100%", - height: "100%" - }, - dragTooltip: { showTooltip: true }, - showGridCellTooltip: true, - treeColumnIndex: 1, - isResponsive: true, + $(function () { + var ganttInstance = new ej.Gantt($("#GanttContainer"), { + dataSource: (window).projectData, + allowColumnResize: true, + allowSorting: true, + allowSelection: true, + enableContextMenu: true, + taskIdMapping: "taskID", + allowDragAndDrop: true, + taskNameMapping: "taskName", + startDateMapping: "startDate", + showColumnChooser: true, + showColumnOptions: true, + progressMapping: "progress", + durationMapping: "duration", + endDateMapping: "endDate", + childMapping: "subtasks", + scheduleStartDate: "02/01/2017", + scheduleEndDate: "04/09/2017", + //Resources mapping + resourceInfoMapping: "resourceId", + resourceNameMapping: "resourceName", + resourceIdMapping: "resourceId", + resources: (window).projectResources, + predecessorMapping: "predecessor", + showResourceNames: true, + toolbarSettings: { + showToolbar: true, + toolbarItems: ["add", "edit", "delete", "update", "cancel", "indent", "outdent", "expandAll", "collapseAll", "search"] + }, + editSettings: { + allowEditing: true, + allowAdding: true, + allowDeleting: true, + allowIndent: true, + editMode: "cellEditing" + }, + sizeSettings: { + width: "100%", + height: "100%" + }, + dragTooltip: { showTooltip: true }, + showGridCellTooltip: true, + treeColumnIndex: 1, + isResponsive: true, + }); }); -}); } - module GridComponent { $(function () { var gridInstance = new ej.Grid($("#Grid"), { @@ -626,7 +643,7 @@ module GridComponent { }); } -var columns = ["Vegie-spread", "Tofuaa", "Alice Mutton", "Konbu", "Fl�temysost"] +var columns = ["Vegie-spread", "Tofuaa", "Alice Mutton", "Konbu", "Fløtemysost"] var itemSource: any[] = []; for (var i = 0; i < columns.length; i++) { for (var j = 0; j < 6; j++) { @@ -671,6 +688,10 @@ $(function () { }); }); +declare var window:myWindow; +export interface myWindow extends Window{ +kanbanData:any; +} module KanbanComponent { $(function () { var sample = new ej.Kanban($("#Kanban"), { @@ -721,6 +742,10 @@ module lineargaugecomponent { }); } + + + + module ListBoxComponent { $(function () { var listboxInstance = new ej.ListBox($("#selectcar"), { @@ -773,7 +798,7 @@ var world_map= { "type": "Feature", "properties": { "admin": "Switzerland", "name": "Switzerland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[9.594226108446346, 47.525058091820256], [9.632931756232974, 47.347601223329974], [9.479969516649019, 47.102809963563367], [9.932448357796657, 46.920728054382948], [10.442701450246627, 46.893546250997424], [10.36337812667861, 46.483571275409851], [9.922836541390378, 46.314899400409182], [9.182881707403054, 46.440214748716976], [8.966305779667804, 46.036931871111186], [8.489952426801322, 46.005150865251672], [8.316629672894377, 46.163642483090847], [7.755992058959832, 45.824490057959302], [7.273850945676655, 45.776947740250769], [6.843592970414504, 45.991146552100595], [6.500099724970424, 46.429672756529428], [6.022609490593537, 46.272989813820466], [6.037388950229, 46.725778713561859], [6.768713820023605, 47.287708238303686], [6.736571079138058, 47.541801255882838], [7.192202182655505, 47.449765529971003], [7.466759067422228, 47.620581976911794], [8.31730146651415, 47.613579820336255], [8.522611932009765, 47.830827541691285], [9.594226108446346, 47.525058091820256]]] } }, { "type": "Feature", "properties": { "admin": "Chile", "name": "Chile", "continent": "South America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-68.634010227583147, -52.636370458874353], [-68.633349999999879, -54.8695], [-67.56244, -54.87001], [-66.95992, -54.89681], [-67.291029999999878, -55.30124], [-68.148629999999841, -55.61183], [-68.639990810811796, -55.580017999086877], [-69.2321, -55.49906], [-69.95809, -55.19843], [-71.00568, -55.05383], [-72.2639, -54.49514], [-73.2852, -53.957519999999874], [-74.66253, -52.83749], [-73.8381, -53.04743], [-72.43418, -53.7154], [-71.10773, -54.07433], [-70.591779999999787, -53.61583], [-70.26748, -52.93123], [-69.345649999999878, -52.5183], [-68.634010227583147, -52.636370458874353]]], [[[-68.219913092711224, -21.49434661223183], [-67.828179897722634, -22.872918796482178], [-67.106673550063604, -22.735924574476392], [-66.985233934177629, -22.986348565362825], [-67.328442959244128, -24.025303236590908], [-68.417652960876111, -24.518554782816874], [-68.386001146097342, -26.185016371365229], [-68.594799770772667, -26.50690886811126], [-68.295541551370391, -26.899339694935787], [-69.001234910748266, -27.521213881136127], [-69.656130337183143, -28.459141127233686], [-70.013550381129861, -29.367922865518544], [-69.919008348251921, -30.336339206668306], [-70.535068935819439, -31.365010267870279], [-70.074399380153622, -33.09120981214803], [-69.814776984319209, -33.273886000299839], [-69.817309129501453, -34.193571465798279], [-70.388049485949082, -35.169687595359441], [-70.364769253201658, -36.005088799789931], [-71.121880662709771, -36.65812387466233], [-71.118625047475419, -37.576827487947192], [-70.814664272734703, -38.552995293940732], [-71.413516608349042, -38.916022230791107], [-71.680761277946445, -39.808164157878061], [-71.915734015577542, -40.832339369470716], [-71.746803758415453, -42.051386407235988], [-72.148898078078517, -42.254888197601375], [-71.915423956983901, -43.408564548517404], [-71.464056159130493, -43.787611179378324], [-71.793622606071935, -44.207172133156099], [-71.329800788036195, -44.407521661151677], [-71.222778896759721, -44.784242852559409], [-71.659315558545316, -44.973688653341434], [-71.552009446891233, -45.560732924177117], [-71.917258470330196, -46.884838148791786], [-72.44735531278026, -47.738532810253517], [-72.331160854771937, -48.244238376661819], [-72.648247443314929, -48.878618259476774], [-73.415435757120022, -49.318436374712952], [-73.328050910114456, -50.378785088909865], [-72.975746832964617, -50.741450290734299], [-72.309973517532342, -50.677009779666342], [-72.329403856074023, -51.425956312872394], [-71.914803839796321, -52.009022305865912], [-69.498362189396076, -52.142760912637236], [-68.571545376241332, -52.299443855346247], [-69.461284349226617, -52.291950772663924], [-69.94277950710611, -52.537930590373243], [-70.8451016913545, -52.899200528525711], [-71.006332160105217, -53.833252042201345], [-71.429794684520928, -53.856454760300373], [-72.557942877884855, -53.531410001184447], [-73.702756720662862, -52.835069268607249], [-73.702756720662862, -52.835070076051487], [-74.946763475225154, -52.262753588419017], [-75.260026007778507, -51.62935475037321], [-74.976632453089806, -51.043395684615675], [-75.47975419788348, -50.378371677451547], [-75.608015102831942, -48.673772881871784], [-75.182769741502128, -47.711919447623153], [-74.126580980104677, -46.939253431995084], [-75.644395311165439, -46.647643324572016], [-74.69215369332305, -45.76397633238097], [-74.351709357384252, -44.10304412208788], [-73.240356004515192, -44.454960625995611], [-72.717803921179765, -42.383355808278985], [-73.388899909138232, -42.117532240569567], [-73.701335618774834, -43.365776462579738], [-74.33194312203257, -43.224958184584395], [-74.017957119427152, -41.794812920906828], [-73.677099372029943, -39.942212823243111], [-73.217592536090663, -39.258688653318508], [-73.505559455037044, -38.282882582351064], [-73.588060879191076, -37.156284681956016], [-73.166717088499283, -37.123780206044351], [-72.553136969681717, -35.508840020491022], [-71.861732143832555, -33.909092706031522], [-71.438450486929895, -32.418899428030819], [-71.668720669222424, -30.920644626592516], [-71.370082567007714, -30.095682061484997], [-71.48989437527645, -28.861442152625909], [-70.905123867461569, -27.640379734001193], [-70.724953986275963, -25.705924167587209], [-70.403965827095035, -23.628996677344542], [-70.091245897080668, -21.393319187101223], [-70.164419725205974, -19.756468194256183], [-70.372572394477714, -18.347975355708879], [-69.858443569605797, -18.092693780187027], [-69.590423753523979, -17.580011895419286], [-69.100246955019401, -18.260125420812653], [-68.966818406841824, -18.981683444904089], [-68.442225104430918, -19.405068454671419], [-68.757167121033703, -20.37265797290447], [-68.219913092711224, -21.49434661223183]]]] } }, { "type": "Feature", "properties": { "admin": "China", "name": "China", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[110.339187860151526, 18.678395087147603], [109.475209588663702, 18.19770091396861], [108.655207961056135, 18.507681993071397], [108.626217482540426, 19.367887885001974], [109.119055617308007, 19.821038519769385], [110.211598748822837, 20.101253973872073], [110.786550734502228, 20.077534491450077], [111.01005130416462, 19.695929877190732], [110.570646600386794, 19.255879218009305], [110.339187860151526, 18.678395087147603]]], [[[127.657407261262378, 49.760270494172929], [129.397817824420429, 49.440600084015429], [130.58229332898236, 48.729687404976112], [130.987281528853828, 47.790132351261391], [132.506671991099495, 47.788969631534876], [133.373595819228001, 48.183441677434914], [135.026311476786702, 48.478229885443902], [134.500813836810607, 47.578439846377833], [134.112362095272601, 47.212467352886719], [133.76964399631288, 46.116926988299056], [133.097126906466428, 45.14406647397216], [131.883454217659562, 45.32116160743643], [131.025212030156069, 44.967953192721573], [131.288555129115537, 44.111519680348252], [131.144687941614848, 42.929989732426932], [130.633866408409801, 42.903014634770543], [130.640015903852429, 42.39500946712527], [129.994267205933227, 42.985386867843793], [129.596668735879462, 42.424981797854592], [128.05221520397231, 41.994284572917984], [128.208433058790717, 41.466771552082534], [127.343782993683021, 41.503151760415953], [126.869083286649854, 41.816569322266155], [126.18204511932943, 41.107336127276362], [125.079941847840587, 40.569823716792449], [124.265624627785314, 39.928493353834135], [122.86757042856101, 39.637787583976255], [122.131387974130917, 39.170451768544623], [121.054554478032856, 38.89747101496291], [121.585994907722466, 39.360853583324136], [121.376757033372641, 39.750261338859524], [122.168595005381007, 40.422442531896046], [121.640358514493528, 40.946389878903304], [120.768628778161954, 40.593388169917596], [119.639602085449056, 39.898055935214209], [119.023463983233015, 39.252333075511096], [118.042748651197897, 39.204273993479674], [117.532702264477052, 38.73763580988409], [118.05969852098967, 38.061475531561051], [118.878149855628351, 37.897325344385898], [118.911636183753501, 37.448463853498723], [119.702802362142037, 37.156388658185072], [120.823457472823648, 37.870427761377968], [121.711258579597938, 37.481123358707165], [122.357937453298462, 37.454484157860684], [122.519994744965814, 36.930614325501828], [121.104163853033029, 36.651329047180432], [120.63700890511457, 36.111439520811125], [119.66456180224607, 35.609790554337728], [119.151208123858567, 34.909859117160458], [120.227524855633717, 34.360331936168613], [120.620369093916565, 33.37672272392512], [121.229014113450219, 32.460318711877186], [121.908145786630044, 31.692174384074683], [121.891919386890336, 30.949351508095098], [121.264257440273298, 30.676267401648712], [121.503519321784722, 30.14291494396425], [122.092113885589086, 29.832520453403156], [121.93842817595305, 29.018022365834803], [121.684438511238469, 28.225512600206677], [121.125661248866436, 28.135673122667178], [120.395473260582307, 27.053206895449385], [119.585496860839555, 25.740780544532605], [118.656871372554519, 24.547390855400234], [117.281606479970833, 23.624501451099714], [115.890735304835118, 22.782873236578094], [114.763827345846209, 22.668074042241663], [114.152546828265656, 22.223760077396204], [113.806779819800752, 22.548339748621423], [113.241077915501592, 22.051367499270462], [111.843592157032447, 21.550493679281512], [110.78546552942413, 21.39714386645533], [110.444039341271662, 20.34103261970639], [109.88986128137357, 20.282457383703441], [109.627655063924635, 21.008227037026725], [109.864488153118316, 21.395050970947516], [108.522812941524421, 21.715212307211821], [108.050180291782979, 21.552379869060101], [107.043420037872636, 21.8118989120299], [106.567273390735352, 22.21820486092474], [106.725403273548466, 22.794267889898375], [105.811247186305209, 22.976892401617899], [105.329209425886631, 23.352063300056976], [104.476858351664475, 22.819150092046918], [103.504514601660503, 22.703756618739217], [102.706992222100155, 22.708795070887696], [102.170435825613552, 22.464753119389336], [101.652017856861576, 22.318198757409554], [101.803119744882906, 21.174366766845051], [101.27002566936001, 21.201651923095167], [101.180005324307558, 21.436572984294052], [101.150032993578236, 21.849984442629015], [100.416537713627349, 21.558839423096654], [99.983489211021549, 21.742936713136451], [99.240898878987196, 22.118314317304559], [99.53199222208741, 22.949038804612591], [98.898749220782804, 23.142722072842581], [98.66026248575578, 24.063286037690002], [97.604719679762027, 23.897404690033049], [97.724609002679131, 25.083637193293036], [98.671838006589212, 25.91870250091349], [98.712093947344556, 26.743535874940243], [98.682690057370507, 27.508812160750658], [98.246230910233351, 27.747221381129172], [97.91198774616943, 28.335945136014367], [97.327113885490007, 28.261582749946339], [96.248833449287829, 28.411030992134467], [96.586590610747521, 28.830979519154361], [96.117678664131006, 29.452802028922513], [95.404802280664626, 29.031716620392157], [94.565990431702929, 29.27743805593996], [93.413347609432662, 28.640629380807233], [92.503118931043616, 27.896876329046442], [91.696656528696693, 27.771741848251615], [91.258853794319876, 28.040614325466343], [90.730513950567797, 28.064953925075738], [90.015828891971182, 28.296438503527177], [89.475810174521158, 28.042758897406365], [88.814248488320573, 27.299315904239389], [88.730325962278528, 28.086864732367552], [88.120440708369941, 27.876541652939572], [86.954517043000635, 27.974261786403524], [85.823319940131526, 28.203575954698742], [85.011638218123053, 28.642773952747369], [84.23457970575015, 28.839893703724691], [83.89899295444674, 29.320226141877633], [83.337115106137176, 29.463731594352193], [82.327512648450877, 30.115268052688204], [81.525804477874786, 30.422716986608659], [81.111256138029276, 30.183480943313402], [79.721366815107118, 30.882714748654728], [78.738894484374001, 31.515906073527045], [78.458446486326025, 32.61816437431272], [79.176128777995544, 32.483779812137747], [79.208891636068543, 32.994394639613738], [78.811086460285722, 33.506198025032397], [78.912268914713209, 34.321936346975768], [77.83745079947461, 35.494009507787794], [76.192848341785705, 35.89840342868785], [75.896897414050173, 36.666806138651872], [75.158027785140987, 37.133030910789152], [74.980002475895404, 37.419990139305888], [74.829985792952144, 37.990007025701445], [74.864815708316783, 38.378846340481587], [74.25751427602269, 38.606506862943476], [73.928852166646394, 38.505815334622717], [73.675379266254836, 39.431236884105566], [73.960013055318427, 39.660008449861714], [73.822243686828315, 39.893973497063136], [74.776862420556043, 40.366425279291619], [75.467827996730719, 40.56207225194867], [76.526368035797432, 40.427946071935132], [76.90448449087711, 41.066485907549648], [78.187196893226044, 41.185315863604799], [78.543660923175253, 41.582242540038713], [80.119430373051401, 42.12394074153822], [80.259990268885318, 42.34999929459908], [80.180150180994374, 42.920067857426844], [80.866206496101213, 43.180362046881008], [79.966106398441426, 44.917516994804622], [81.947070753918084, 45.317027492853143], [82.458925815769035, 45.539649563166499], [83.180483839860543, 47.330031236350735], [85.164290399113213, 47.000955715516099], [85.720483839870667, 47.452969468773077], [85.76823286330837, 48.455750637396896], [86.59877648310335, 48.549181626980605], [87.359970330762692, 49.214980780629148], [87.751264276076668, 49.297197984405464], [88.013832228551678, 48.599462795600594], [88.854297723346747, 48.069081732773007], [90.280825636763893, 47.693549099307901], [90.970809360724957, 46.88814606382293], [90.585768263718307, 45.719716091487491], [90.945539585334316, 45.286073309910243], [92.133890822318222, 45.115075995456429], [93.480733677141316, 44.97547211362], [94.688928664125356, 44.352331854828456], [95.306875441471504, 44.241330878265458], [95.762454868556688, 43.319449164394619], [96.349395786527808, 42.725635280928643], [97.451757440177971, 42.74888967546007], [99.515817498779995, 42.524691473961688], [100.845865513108279, 42.663804429691417], [101.833040399179936, 42.51487295182627], [103.312278273534787, 41.907468166667613], [104.522281935649005, 41.90834666601662], [104.964993931093431, 41.597409572916334], [106.129315627061658, 42.134327704428891], [107.744772576937976, 42.481515814781908], [109.243595819131428, 42.519446316084149], [110.412103306115299, 42.871233628911014], [111.129682244920218, 43.406834011400171], [111.82958784388137, 43.743118394539486], [111.667737257943202, 44.073175767587706], [111.348376906379428, 44.457441718110047], [111.87330610560025, 45.102079372735112], [112.436062453258842, 45.01164561622425], [113.463906691544196, 44.808893134127111], [114.46033165899604, 45.339816799493875], [115.985096470200133, 45.727235012386004], [116.717868280098855, 46.38820241961524], [117.421701287914246, 46.67273285581421], [118.874325799638711, 46.805412095723646], [119.663269891438745, 46.692679958678944], [119.772823927897562, 47.048058783550132], [118.866574334794947, 47.747060044946195], [118.064142694166719, 48.06673045510373], [117.295507440257438, 47.697709052107385], [116.308952671373234, 47.853410142602812], [115.742837355615734, 47.726544501326273], [115.485282017073018, 48.135382595403442], [116.191802199367601, 49.134598090199056], [116.67880089728618, 49.888531399121398], [117.879244419426371, 49.510983384796944], [119.288460728025839, 50.142882798862033], [119.279365675942358, 50.582907619827282], [120.182049595216924, 51.64356639261802], [120.738191359541972, 51.964115302124547], [120.725789015791975, 52.516226304730814], [120.177088657716865, 52.753886216841195], [121.003084751470226, 53.251401068731226], [122.245747918792858, 53.431725979213681], [123.571506789240843, 53.458804429734627], [125.068211297710434, 53.161044826868832], [125.946348911646169, 52.792798570356936], [126.564399041856959, 51.784255479532689], [126.939156528837657, 51.353894151405896], [127.287455682484904, 50.739797268265434], [127.657407261262378, 49.760270494172929]]]] } }, - { "type": "Feature", "properties": { "admin": "Ivory Coast", "name": "C�te d'Ivoire", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-2.856125047202397, 4.994475816259508], [-3.311084357100071, 4.984295559098014], [-4.008819545904941, 5.179813340674314], [-4.64991736491791, 5.168263658057084], [-5.834496222344525, 4.993700669775135], [-6.528769090185845, 4.705087795425015], [-7.518941209330434, 4.338288479017307], [-7.712159389669749, 4.364565944837721], [-7.63536821128403, 5.188159084489455], [-7.53971513511176, 5.313345241716517], [-7.570152553731686, 5.707352199725903], [-7.993692592795879, 6.126189683451541], [-8.311347622094017, 6.193033148621081], [-8.602880214868618, 6.467564195171659], [-8.385451626000572, 6.911800645368742], [-8.485445522485348, 7.395207831243068], [-8.439298468448696, 7.686042792181736], [-8.280703497744936, 7.687179673692156], [-8.221792364932197, 8.123328762235571], [-8.299048631208562, 8.316443589710302], [-8.203498907900878, 8.455453192575446], [-7.832100389019186, 8.575704250518625], [-8.079113735374348, 9.376223863152033], [-8.309616461612249, 9.789531968622439], [-8.22933712404682, 10.129020290563897], [-8.029943610048617, 10.206534939001711], [-7.89958980959237, 10.297382106970824], [-7.622759161804808, 10.147236232946792], [-6.850506557635057, 10.138993841996237], [-6.666460944027547, 10.430810655148447], [-6.493965013037267, 10.411302801958268], [-6.205222947606429, 10.524060777219132], [-6.050452032892266, 10.096360785355442], [-5.816926235365286, 10.222554633012191], [-5.404341599946973, 10.370736802609144], [-4.954653286143098, 10.152713934769732], [-4.779883592131966, 9.821984768101741], [-4.330246954760383, 9.610834865757139], [-3.980449184576684, 9.862344061721698], [-3.511898972986272, 9.900326239456216], [-2.827496303712706, 9.642460842319775], [-2.56218950032624, 8.219627793811481], [-2.983584967450326, 7.379704901555511], [-3.244370083011261, 6.2504715031135], [-2.810701463217839, 5.389051215024109], [-2.856125047202397, 4.994475816259508]]] } }, + { "type": "Feature", "properties": { "admin": "Ivory Coast", "name": "Côte d'Ivoire", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-2.856125047202397, 4.994475816259508], [-3.311084357100071, 4.984295559098014], [-4.008819545904941, 5.179813340674314], [-4.64991736491791, 5.168263658057084], [-5.834496222344525, 4.993700669775135], [-6.528769090185845, 4.705087795425015], [-7.518941209330434, 4.338288479017307], [-7.712159389669749, 4.364565944837721], [-7.63536821128403, 5.188159084489455], [-7.53971513511176, 5.313345241716517], [-7.570152553731686, 5.707352199725903], [-7.993692592795879, 6.126189683451541], [-8.311347622094017, 6.193033148621081], [-8.602880214868618, 6.467564195171659], [-8.385451626000572, 6.911800645368742], [-8.485445522485348, 7.395207831243068], [-8.439298468448696, 7.686042792181736], [-8.280703497744936, 7.687179673692156], [-8.221792364932197, 8.123328762235571], [-8.299048631208562, 8.316443589710302], [-8.203498907900878, 8.455453192575446], [-7.832100389019186, 8.575704250518625], [-8.079113735374348, 9.376223863152033], [-8.309616461612249, 9.789531968622439], [-8.22933712404682, 10.129020290563897], [-8.029943610048617, 10.206534939001711], [-7.89958980959237, 10.297382106970824], [-7.622759161804808, 10.147236232946792], [-6.850506557635057, 10.138993841996237], [-6.666460944027547, 10.430810655148447], [-6.493965013037267, 10.411302801958268], [-6.205222947606429, 10.524060777219132], [-6.050452032892266, 10.096360785355442], [-5.816926235365286, 10.222554633012191], [-5.404341599946973, 10.370736802609144], [-4.954653286143098, 10.152713934769732], [-4.779883592131966, 9.821984768101741], [-4.330246954760383, 9.610834865757139], [-3.980449184576684, 9.862344061721698], [-3.511898972986272, 9.900326239456216], [-2.827496303712706, 9.642460842319775], [-2.56218950032624, 8.219627793811481], [-2.983584967450326, 7.379704901555511], [-3.244370083011261, 6.2504715031135], [-2.810701463217839, 5.389051215024109], [-2.856125047202397, 4.994475816259508]]] } }, { "type": "Feature", "properties": { "admin": "Cameroon", "name": "Cameroon", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[13.07582238124675, 2.267097072759014], [12.951333855855605, 2.321615708826939], [12.359380323952218, 2.19281220133945], [11.751665480199787, 2.326757513839993], [11.276449008843711, 2.261050930180871], [9.649158155972627, 2.283866075037735], [9.795195753629455, 3.073404445809117], [9.404366896205998, 3.734526882335202], [8.948115675501068, 3.904128933117135], [8.744923943729416, 4.352215277519959], [8.488815545290889, 4.495617377129917], [8.500287713259693, 4.771982937026847], [8.757532993208626, 5.47966583904791], [9.233162876023043, 6.444490668153334], [9.522705926154398, 6.453482367372116], [10.118276808318255, 7.038769639509879], [10.497375115611417, 7.055357774275562], [11.058787876030349, 6.644426784690593], [11.745774366918509, 6.981382961449753], [11.839308709366801, 7.397042344589434], [12.063946160539556, 7.799808457872301], [12.218872104550597, 8.305824082874322], [12.753671502339214, 8.717762762888993], [12.955467970438971, 9.417771714714702], [13.1675997249971, 9.64062632897341], [13.308676385153914, 10.160362046748926], [13.572949659894558, 10.798565985553564], [14.415378859116682, 11.572368882692071], [14.468192172918974, 11.90475169519341], [14.57717776862253, 12.085360826053501], [14.181336297266792, 12.483656927943112], [14.213530714584634, 12.802035427293344], [14.495787387762842, 12.859396267137326], [14.893385857816522, 12.219047756392582], [14.960151808337598, 11.555574042197222], [14.923564894274955, 10.891325181517471], [15.467872755605269, 9.982336737503429], [14.909353875394713, 9.99212942142273], [14.627200555081057, 9.920919297724536], [14.171466098699025, 10.021378282099928], [13.954218377344002, 9.549494940626685], [14.544466586981766, 8.965861314322266], [14.979995558337688, 8.796104234243471], [15.120865512765331, 8.382150173369423], [15.436091749745765, 7.692812404811971], [15.279460483469107, 7.421924546737968], [14.776545444404572, 6.408498033062044], [14.536560092841111, 6.22695872642069], [14.459407179429345, 5.451760565610299], [14.558935988023501, 5.03059764243153], [14.478372430080466, 4.732605495620446], [14.950953403389658, 4.21038930909492], [15.036219516671249, 3.851367295747123], [15.405395948964379, 3.335300604664339], [15.862732374747479, 3.013537298998982], [15.907380812247649, 2.557389431158612], [16.01285241055535, 2.267639675298084], [15.940918816805061, 1.727672634280295], [15.14634199388524, 1.964014797367184], [14.337812534246577, 2.22787466064949], [13.07582238124675, 2.267097072759014]]] } }, { "type": "Feature", "properties": { "admin": "Democratic Republic of the Congo", "name": "Dem. Rep. Congo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[30.833859897593801, 3.50916596111034], [30.773346795380036, 2.339883327642127], [31.174149204235807, 2.204465236821263], [30.852670118948048, 1.849396470543809], [30.468507521290292, 1.58380544677972], [30.086153598762703, 1.062312730306288], [29.875778842902488, 0.597379868976304], [29.819503208136634, -0.205310153813372], [29.587837762172164, -0.58740569417948], [29.579466180140876, -1.341313164885626], [29.29188683443661, -1.620055840667987], [29.254834832483336, -2.215109958508911], [29.117478875451546, -2.292211195488384], [29.02492638521678, -2.839257907730157], [29.276383904749046, -3.293907159034063], [29.339997592900342, -4.499983412294092], [29.519986606572925, -5.419978936386313], [29.41999271008816, -5.939998874539432], [29.620032179490003, -6.520015150583424], [30.199996779101692, -7.079980970898161], [30.740015496551781, -8.340007419470913], [30.34608605319081, -8.238256524288216], [29.002912225060467, -8.40703175215347], [28.734866570762495, -8.526559340044576], [28.449871046672818, -9.164918308146083], [28.673681674928922, -9.605924981324931], [28.496069777141763, -10.789883721564044], [28.372253045370421, -11.793646742401389], [28.642417433392346, -11.971568698782312], [29.341547885869087, -12.36074391037241], [29.616001417771223, -12.178894545137307], [29.699613885219485, -13.257226657771827], [28.934285922976834, -13.248958428605132], [28.52356163912102, -12.698604424696679], [28.15510867687998, -12.272480564017894], [27.38879886242378, -12.132747491100663], [27.164419793412456, -11.608748467661071], [26.55308759939961, -11.924439792532125], [25.752309604604726, -11.784965101776356], [25.418118116973197, -11.330935967659958], [24.783169793402948, -11.238693536018962], [24.314516228947948, -11.262826429899269], [24.257155389103982, -10.951992689663655], [23.912215203555714, -10.926826267137512], [23.456790805767433, -10.867863457892481], [22.837345411884733, -11.017621758674329], [22.402798292742371, -10.99307545333569], [22.155268182064304, -11.084801120653768], [22.208753289486388, -9.894796237836507], [21.87518191904234, -9.523707777548564], [21.801801385187897, -8.908706556842978], [21.949130893652036, -8.305900974158275], [21.746455926203303, -7.920084730667147], [21.728110792739695, -7.2908724910813], [20.514748162526498, -7.299605808138629], [20.601822950938292, -6.93931772219968], [20.091621534920645, -6.943090101756993], [20.037723016040214, -7.116361179231644], [19.417502475673157, -7.155428562044297], [19.166613396896107, -7.738183688999753], [19.016751743249664, -7.988245944860132], [18.464175652752683, -7.847014255406442], [18.134221632569048, -7.98767750410492], [17.472970004962232, -8.068551120641699], [17.089995965247166, -7.545688978712525], [16.860190870845198, -7.222297865429984], [16.573179965896141, -6.622644545115087], [16.326528354567042, -5.877470391466267], [13.375597364971892, -5.864241224799548], [13.02486941900696, -5.984388929878157], [12.735171339578695, -5.965682061388497], [12.322431674863507, -6.100092461779658], [12.182336866920249, -5.789930515163837], [12.436688266660866, -5.684303887559245], [12.468004184629734, -5.248361504745003], [12.631611769265788, -4.991271254092935], [12.995517205465173, -4.781103203961883], [13.258240187237044, -4.882957452009165], [13.600234816144676, -4.500138441590969], [14.144956088933295, -4.510008640158715], [14.209034864975219, -4.793092136253597], [14.582603794013179, -4.970238946150139], [15.170991652088441, -4.3435071753143], [15.753540073314749, -3.855164890156096], [16.006289503654298, -3.535132744972528], [15.972803175529149, -2.712392266453612], [16.407091912510051, -1.740927015798682], [16.86530683764212, -1.225816338713287], [17.523716261472853, -0.743830254726987], [17.638644646889983, -0.424831638189246], [17.663552687254676, -0.058083998213817], [17.826540154703245, 0.288923244626105], [17.774191928791563, 0.855658677571085], [17.89883548347958, 1.741831976728278], [18.09427575040743, 2.365721543788055], [18.39379235197114, 2.90044342692822], [18.453065219809925, 3.504385891123348], [18.542982211997778, 4.201785183118317], [18.932312452884755, 4.709506130385973], [19.467783644293146, 5.031527818212779], [20.290679152108932, 4.691677761245287], [20.927591180106273, 4.322785549329736], [21.659122755630019, 4.224341945813719], [22.405123732195531, 4.02916006104732], [22.704123569436284, 4.633050848810156], [22.841479526468103, 4.710126247573483], [23.297213982850135, 4.609693101414221], [24.41053104014625, 5.108784084489129], [24.805028924262409, 4.897246608902349], [25.128833449003274, 4.927244777847789], [25.278798455514302, 5.170408229997191], [25.650455356557465, 5.256087754737123], [26.402760857862535, 5.150874538590869], [27.044065382604703, 5.127852688004835], [27.374226108517483, 5.233944403500059], [27.979977247842807, 4.408413397637373], [28.428993768026906, 4.287154649264493], [28.696677687298795, 4.455077215996936], [29.159078403446497, 4.38926727947323], [29.715995314256013, 4.600804755060024], [29.953500197069467, 4.173699042167683], [30.833859897593801, 3.50916596111034]]] } }, { "type": "Feature", "properties": { "admin": "Republic of Congo", "name": "Congo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[12.995517205465173, -4.781103203961883], [12.620759718484491, -4.438023369976135], [12.318607618873923, -4.606230157086187], [11.914963006242086, -5.037986748884789], [11.093772820691923, -3.978826592630546], [11.855121697648114, -3.42687061932105], [11.478038771214299, -2.765618991714241], [11.820963575903189, -2.514161472181982], [12.495702752338159, -2.391688327650242], [12.575284458067639, -1.948511244315134], [13.109618767965626, -2.428740329603513], [13.992407260807706, -2.470804945489099], [14.299210239324564, -1.998275648612213], [14.425455763413593, -1.333406670744971], [14.316418491277741, -0.552627455247048], [13.843320753645653, 0.038757635901149], [14.276265903386953, 1.196929836426619], [14.026668735417214, 1.395677395021153], [13.282631463278816, 1.31418366129688], [13.003113641012074, 1.830896307783319], [13.07582238124675, 2.267097072759014], [14.337812534246577, 2.22787466064949], [15.14634199388524, 1.964014797367184], [15.940918816805061, 1.727672634280295], [16.01285241055535, 2.267639675298084], [16.537058139724135, 3.198254706226278], [17.133042433346297, 3.728196519379451], [17.809900343505259, 3.560196437998569], [18.453065219809925, 3.504385891123348], [18.39379235197114, 2.90044342692822], [18.09427575040743, 2.365721543788055], [17.89883548347958, 1.741831976728278], [17.774191928791563, 0.855658677571085], [17.826540154703245, 0.288923244626105], [17.663552687254676, -0.058083998213817], [17.638644646889983, -0.424831638189246], [17.523716261472853, -0.743830254726987], [16.86530683764212, -1.225816338713287], [16.407091912510051, -1.740927015798682], [15.972803175529149, -2.712392266453612], [16.006289503654298, -3.535132744972528], [15.753540073314749, -3.855164890156096], [15.170991652088441, -4.3435071753143], [14.582603794013179, -4.970238946150139], [14.209034864975219, -4.793092136253597], [14.144956088933295, -4.510008640158715], [13.600234816144676, -4.500138441590969], [13.258240187237044, -4.882957452009165], [12.995517205465173, -4.781103203961883]]] } }, @@ -964,6 +989,7 @@ module mapcomponenet { } + module MenuComponent { $(function () { var sample = new ej.Menu($("#syncfusionProducts"),{ @@ -987,6 +1013,10 @@ module MenuComponent { } + + + + module NavigationDrawerComponent { $(function () { var navigationdrawerInstance = new ej.NavigationDrawer($("#navpane"), { @@ -1019,45 +1049,46 @@ module PDFViewerComponent { module PivotChartOlap { $(function () { - var sample = new ej.PivotChart($("#PivotChart"),{ + var sample = new ej.PivotChart($("#PivotChart"), { dataSource: { - data: "http://bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]" - } - ], - axis: "columns" - } - ], - filters:[] - }, - isResponsive: true,zooming:{enableScrollbar: true}, - commonSeriesOptions: { - type: "column" - }, - size: { height: "460px", width: "100%" }, - primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, - primaryYAxis: { title: { text: "Internet Sales Amount" } }, - legend: { visible: true, rowCount: 2 } + data: "http://bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]" + } + ], + axis: "columns" + } + ], + filters: [] + }, + isResponsive: true, zooming: { enableScrollbar: true }, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, + primaryYAxis: { title: { text: "Internet Sales Amount" } }, + legend: { visible: true, rowCount: 2 }, }); }); } + var pivot_dataset = [ { Amount: 100, Country: "Canada", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Alberta" }, { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Van", Quantity: 3, State: "British Columbia" }, @@ -1088,44 +1119,44 @@ var pivot_dataset = [ module PivotChartRelational { $(function () { - var sample = new ej.PivotChart($("#PivotChart"),{ + var sample = new ej.PivotChart($("#PivotChart"), { dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - fieldCaption: "Country" - }, - { - fieldName: "State", - fieldCaption: "State" - }, - { - fieldName: "Date", - fieldCaption: "Date" - } - ], - columns: [ - { - fieldName: "Product", - fieldCaption: "Product" - } - ], - values: [ - { - fieldName: "Amount", - fieldCaption: "Amount" - } - ], - filters:[] - }, - isResponsive: true,zooming:{enableScrollbar: true}, - commonSeriesOptions: { - type: "column" - }, - size: { height: "460px", width: "100%" }, - primaryYAxis: { title: { text: "Amount" } }, - legend: { visible: true } + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + }, + { + fieldName: "Date", + fieldCaption: "Date" + } + ], + columns: [ + { + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + } + ], + filters: [] + }, + isResponsive: true, zooming: { enableScrollbar: true }, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryYAxis: { title: { text: "Amount" } }, + legend: { visible: true }, }); }); } @@ -1185,15 +1216,15 @@ module PivotGaugeOlap { length: 120, width: 7 }, - { - type: "marker", - markerType: "diamond", - distanceFromScale: 5, - placement: "center", - backgroundColor: "#29A4D9", - length: 25, - width: 15 - }], + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], ticks: [{ type: "major", distanceFromScale: 2, @@ -1235,6 +1266,7 @@ module PivotGaugeOlap { }); } + var pivot_dataset = [ { Amount: 100, Country: "Canada", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Alberta" }, { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Van", Quantity: 3, State: "British Columbia" }, @@ -1264,91 +1296,91 @@ var pivot_dataset = [ module PivotGaugeRelational { $(function () { - var sample = new ej.PivotGauge($("#PivotGauge"),{ + var sample = new ej.PivotGauge($("#PivotGauge"), { dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - }, - { - fieldName: "State", - } - ], - columns: [ - { - fieldName: "Product", - } - ], + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + }, + { + fieldName: "State", + } + ], + columns: [ + { + fieldName: "Product", + } + ], values: [ - { - fieldName: "Amount", - }, - { - fieldName: "Quantity", - } - ] - }, + { + fieldName: "Amount", + }, + { + fieldName: "Quantity", + } + ] + }, enableTooltip: true, isResponsive: true, labelFormatSettings: { decimalPlaces: 2 }, - scales: [{ - showRanges: true, - radius: 150, showScaleBar: true, size: 1, + scales: [{ + showRanges: true, + radius: 150, showScaleBar: true, size: 1, border: { - width: 0.5 - }, - showIndicators: true, showLabels: true, - pointers: [{ - showBackNeedle: true, - backNeedleLength: 20, - length: 120, - width: 7 + width: 0.5 }, - { - type: "marker", - markerType: "diamond", - distanceFromScale: 5, - placement: "center", - backgroundColor: "#29A4D9", - length: 25, - width: 15 - }], + showIndicators: true, showLabels: true, + pointers: [{ + showBackNeedle: true, + backNeedleLength: 20, + length: 120, + width: 7 + }, + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], ticks: [{ - type: "major", + type: "major", distanceFromScale: 2, - height: 16, - width: 1, color: "#8c8c8c" - }, - { - type: "minor", - height: 6, - width: 1, - distanceFromScale: 2, - color: "#8c8c8c" - }], + height: 16, + width: 1, color: "#8c8c8c" + }, + { + type: "minor", + height: 6, + width: 1, + distanceFromScale: 2, + color: "#8c8c8c" + }], labels: [{ color: "#8c8c8c" - }], - ranges: [{ - distanceFromScale: -5, - backgroundColor: "#fc0606", - border: { color: "#fc0606" } - }, - { - distanceFromScale: -5 }], - customLabels: [{ - position: { x: 180, y: 290 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + ranges: [{ + distanceFromScale: -5, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } }, - { - position: { x: 180, y: 320 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + { + distanceFromScale: -5 + }], + customLabels: [{ + position: { x: 180, y: 290 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" }, - { - position: { x: 180, y: 150 }, - font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }] + { + position: { x: 180, y: 320 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }, + { + position: { x: 180, y: 150 }, + font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }] }] }); }); @@ -1357,35 +1389,35 @@ module PivotGaugeRelational { module PivotGridOlap { $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"),{ + var sample = new ej.PivotGrid($("#PivotGrid"), { dataSource: { - data: "http://bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]", - } - ], - axis: "columns" - } - ], - filters:[] - }, - enableGroupingBar: true, - pivotTableFieldListID:"PivotSchemaDesigner" + data: "http://bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]", + } + ], + axis: "columns" + } + ], + filters: [] + }, + enableGroupingBar: true, + pivotTableFieldListID: "PivotSchemaDesigner" }); $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); }); @@ -1420,41 +1452,41 @@ var pivot_dataset = [ module PivotGridRelational { $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"),{ + var sample = new ej.PivotGrid($("#PivotGrid"), { dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - fieldCaption: "Country" - }, - { - fieldName: "State", - fieldCaption: "State" - } - ], - columns: - [{ - fieldName: "Product", - fieldCaption: "Product" - } - ], - values: [ - { - fieldName: "Amount", - fieldCaption: "Amount" - }, - { - fieldName: "Quantity", - fieldCaption: "Quantity" - } - ], - filters:[] - }, - enableGroupingBar: true, - pivotTableFieldListID:"PivotSchemaDesigner" + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + } + ], + columns: + [{ + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + }, + { + fieldName: "Quantity", + fieldCaption: "Quantity" + } + ], + filters: [] + }, + enableGroupingBar: true, + pivotTableFieldListID: "PivotSchemaDesigner" }); - $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); + $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); }); } @@ -1508,6 +1540,7 @@ module ProgressBarComponent { } + declare var rteObj: any; declare var data: any; var radialEle = $('#defaultradialmenu'), action = 0, forRedo = 0; @@ -1551,6 +1584,7 @@ module RadialMenuComponent { }); } + function bold(e: any) { rteObj = rteEle.data("ejRTE"); @@ -1619,7 +1653,7 @@ module rangecomponent { }, loaded: function () { var sender = $("#RangeNavigator").data("ejRangeNavigator"); - var theme = window.themeStyle + window.themeColor + window.themeVarient; + var theme = (window).themeStyle + (window).themeColor + (window).themeVarient; if (theme) { switch (theme) { case "flatazurelight": @@ -1711,7 +1745,7 @@ function GetData() { module RatingComponent { $(function () { - var sample1 = new ej.Rating($("#fullRating"),{ + var sample1 = new ej.Rating($("#fullRating"), { value: 4, precision: ej.Rating.Precision.Full, allowReset: true, @@ -1727,7 +1761,7 @@ module RatingComponent { showTooltip: true }); - var sample2 = new ej.Rating($("#halfRating"),{ + var sample2 = new ej.Rating($("#halfRating"), { precision: ej.Rating.Precision.Half, value: 3.5, allowReset: true, @@ -1743,7 +1777,7 @@ module RatingComponent { showTooltip: true }); - var sample3 = new ej.Rating($("#exactRating"),{ + var sample3 = new ej.Rating($("#exactRating"), { precision: ej.Rating.Precision.Exact, value: 3.7, allowReset: true, @@ -1786,7 +1820,7 @@ module RibbonComponent { toolTip: "Pin the Ribbon" }, applicationTab: { - type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } + type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } }, tabs: [{ id: "home", text: "HOME", groups: [{ @@ -1810,7 +1844,7 @@ module RibbonComponent { } }] }, - { + { text: "Clipboard", alignType: ej.Ribbon.AlignType.Columns, content: [{ groups: [{ id: "paste", @@ -1832,8 +1866,8 @@ module RibbonComponent { height: 70 } }, - { - groups: [{ + { + groups: [{ id: "cut", text: "Cut", toolTip: "Cut", @@ -1863,14 +1897,14 @@ module RibbonComponent { prefixIcon: "e-icon e-ribbon clearAll" } }], - defaults: { + defaults: { type: "button", width: 60, isBig: false } }] - }, - { + }, + { text: "Font", alignType: "rows", content: [{ groups: [{ id: "fontfamily", @@ -2209,7 +2243,7 @@ module RibbonComponent { } }] }] - },{ + }, { id: "insert", text: "INSERT", groups: [{ text: "Tables", alignType: ej.Ribbon.AlignType.Columns, content: [{ groups: [{ @@ -2354,7 +2388,7 @@ module RibbonComponent { } ], defaults: { - type: "button", + type: "button", width: 70, height: 70 } @@ -2437,7 +2471,7 @@ module RibbonComponent { ] } ], - create: function createControl(args) { + create: function createControl(args: any) { var ribbon = $("#defaultRibbon").data("ejRibbon"); $("#fontcolor").ejColorPicker({ value: "#FFFF00", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fontcoloricon", select: colorHandler }); $("#fillcolor").ejColorPicker({ value: "#FF0000", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fillcoloricon", select: colorHandler }); @@ -2464,6 +2498,7 @@ function onClick(args: any) { } + module RotatorComponent { $(function () { var rotatorInstance = new ej.Rotator($("#sliderContent"), { @@ -2631,9 +2666,7 @@ module ScrollerComponent { }); $(window).bind('resize', function () { scrollerSample.refresh(); - }); - - }); + }); }); } module SignatureComponent { @@ -2664,6 +2697,8 @@ module SliderComponent { } + + module linesparkline { $(function () { @@ -2792,6 +2827,7 @@ module piesparkline4 { } + module SplitterComponent { $(function () { var splitterInstance = new ej.Splitter($("#outterSpliter"), { @@ -2807,6 +2843,7 @@ module SplitterComponent { }); } + module SpreadsheetComponent { $(function () { var sample = new ej.Spreadsheet($("#basicSpreadsheet"), { @@ -2822,14 +2859,15 @@ $(function () { pdfUrl: (window).baseurl + "api/Spreadsheet/PdfExport" }, sheets: [{ rangeSettings: [{ dataSource: (window).defaultData, startCell: "A1" }] }], - loadComplete: () => { - var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; - if (!(spreadsheet).isImport) { - spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); - xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); - xlFormat.format({ "type": "currency" }, "E2:H11"); - spreadsheet.XLRibbon.updateRibbonIcons(); - }} + loadComplete: () => { + var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; + if (!(spreadsheet).isImport) { + spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); + xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); + xlFormat.format({ "type": "currency" }, "E2:H11"); + spreadsheet.XLRibbon.updateRibbonIcons(); + } + } }); }); } @@ -2876,20 +2914,20 @@ module sunburstcomponent { var sunburstsample = new ej.SunburstChart($("#Sunburst"), { valueMemberPath: "EmployeesCount", levels: [ - {groupMemberPath: "Country"}, - {groupMemberPath: "JobDescription"}, - {groupMemberPath: "JobGroup"}, - {groupMemberPath: "JobRole"} + { groupMemberPath: "Country" }, + { groupMemberPath: "JobDescription" }, + { groupMemberPath: "JobGroup" }, + { groupMemberPath: "JobRole" } ], dataSource: default_data, - dataLabelSettings:{visible:true}, - tooltip:{visible:false}, - enableAnimation:false, - size:{height:"600"}, - innerRadius:0.2, + dataLabelSettings: { visible: true }, + tooltip: { visible: false }, + enableAnimation: false, + size: { height: "600" }, + innerRadius: 0.2, load: function () { var sender = $("#Sunburst").data("ejSunburstChart"); - var SunBurstTheme = window.themeStyle + window.themeColor + window.themeVarient; + var SunBurstTheme = (window).themeStyle + (window).themeColor + (window).themeVarient; SunBurstTheme = SunBurstTheme.toString(); if (SunBurstTheme.indexOf("dark") > -1 || SunBurstTheme.indexOf("contrast") > -1) SunBurstTheme = "flatdark"; @@ -2897,9 +2935,9 @@ module sunburstcomponent { SunBurstTheme = "flatlight"; sender.model.theme = SunBurstTheme; }, - title:{text:"Employees Count"}, - zoomSettings:{enable:false}, - legend:{visible:true,position:'top'} + title: { text: "Employees Count" }, + zoomSettings: { enable: false }, + legend: { visible: true, position: 'top' }, }); }); } @@ -2918,7 +2956,6 @@ module TabComponent { } module TagCloudComponent { - var websiteCollection = [ { text: "Google", url: "http://www.google.com", frequency: 12 }, { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, @@ -2949,7 +2986,6 @@ module TagCloudComponent { text: "text", url: "url", frequency: "frequency" } }); - }); } @@ -2985,6 +3021,8 @@ module EditorComponent { }); } + + module TileViewComponent { $(function () { var tile1 = new ej.Tile($("#tile1"), { @@ -2993,42 +3031,42 @@ module TileViewComponent { tileSize:"medium", imageUrl:'content/images/tile/windows/people_1.png' }); - var tile2 = new ej.Tile($("#tile2"), { - imagePosition:"center", - tileSize:"small", - imageUrl:'content/images/tile/windows/alerts.png', + var tile2 = new ej.Tile($("#tile2"), { + imagePosition: "center", + tileSize: "small", + imageUrl: 'content/images/tile/windows/alerts.png', }); - var tile3 = new ej.Tile($("#tile3"), { - imagePosition:"center", - tileSize:"small", - imageUrl:'content/images/tile/windows/bing.png', + var tile3 = new ej.Tile($("#tile3"), { + imagePosition: "center", + tileSize: "small", + imageUrl: 'content/images/tile/windows/bing.png', }); - var tile4 = new ej.Tile($("#tile4"), { - tileSize:"small", - imageUrl:'content/images/tile/windows/camera.png', + var tile4 = new ej.Tile($("#tile4"), { + tileSize: "small", + imageUrl: 'content/images/tile/windows/camera.png', }); - var tile5 = new ej.Tile($("#tile5"), { - imagePosition:"center", - tileSize:"small", - imageUrl:'content/images/tile/windows/messages.png', + var tile5 = new ej.Tile($("#tile5"), { + imagePosition: "center", + tileSize: "small", + imageUrl: 'content/images/tile/windows/messages.png', }); - var tile6 = new ej.Tile($("#tile6"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/games.png', - caption:{text:"Play"} + var tile6 = new ej.Tile($("#tile6"), { + imagePosition: "center", + tileSize: "medium", + imageUrl: 'content/images/tile/windows/games.png', + caption: { text: "Play" } }); - var tile7 = new ej.Tile($("#tile7"), { - tileSize:"medium", - imageUrl:'content/images/tile/windows/map.png', - caption:{text:"Maps"} + var tile7 = new ej.Tile($("#tile7"), { + tileSize: "medium", + imageUrl: 'content/images/tile/windows/map.png', + caption: { text: "Maps" } }); - var tile8 = new ej.Tile($("#tile8"), { - imagePosition:"fill", - tileSize:"wide", - imageUrl:'content/images/tile/windows/sports.png', - caption:{text:"Sports"} + var tile8 = new ej.Tile($("#tile8"), { + imagePosition: "fill", + tileSize: "wide", + imageUrl: 'content/images/tile/windows/sports.png', + caption: { text: "Sports" } }); var tile9 = new ej.Tile($("#tile9"), { imagePosition:"fill", @@ -3062,7 +3100,6 @@ module TileViewComponent { }); }); } - module TimePickerComponent { $(function () { var timeSample = new ej.TimePicker($("#timepick"), { @@ -3074,7 +3111,7 @@ module TimePickerComponent { module ToolbarComponent { $(function () { - var sample = new ej.Toolbar($("#editingToolbar"),{ + var sample = new ej.Toolbar($("#editingToolbar"), { width: "100%", cssClass: "gradient-lime", enableSeparator: true, @@ -3091,7 +3128,7 @@ module TooltipComponent { $(function () { - var sample1 = new ej.Tooltip($("#link1"),{ + var sample1 = new ej.Tooltip($("#link1"), { content: "ECMAScript (or ES) is a trademarked scripting-language specification standardized by Ecma International in ECMA-262 and ISO/IEC 16262.", associate: "mousefollow", autoCloseTimeout: 5000, @@ -3101,7 +3138,7 @@ module TooltipComponent { showShadow: true }); - var sample2 = new ej.Tooltip($("#link2"),{ + var sample2 = new ej.Tooltip($("#link2"), { content: "The World Wide Web (WWW) is an information space where documents and other web resources are identified by URLs, interlinked by hypertext links, and can be accessed via the Internet.", position: { stem: { @@ -3120,7 +3157,7 @@ module TooltipComponent { showShadow: true }); - var sample3 = new ej.Tooltip($("#link3"),{ + var sample3 = new ej.Tooltip($("#link3"), { content: 'Object-oriented programming (OOP) is a programming language model organized around objects rather than "actions" and data rather than logic.', position: { stem: { @@ -3183,6 +3220,7 @@ module TreeGridComponent { }); } + var population_data: Array = [ { Continent: "Asia", Country: "Indonesia", Growth: 3, Population: 237641326 }, { Continent: "Asia", Country: "Russia", Growth: 2, Population: 152518015 }, @@ -3221,6 +3259,8 @@ module treemapcomponent { }); } + + module TreeViewComponent { $(function () { var tree = new ej.TreeView($("#treeView"), { @@ -3235,7 +3275,7 @@ module TreeViewComponent { module UploadboxComponent { $(function () { - var sample = new ej.Uploadbox($("#UploadDefault"),{ + var sample = new ej.Uploadbox($("#UploadDefault"), { saveUrl: (window).baseurl + "api/uploadbox/Save", removeUrl: (window).baseurl + "api/uploadbox/Remove", buttonText: { diff --git a/types/ej.web.all/index.d.ts b/types/ej.web.all/index.d.ts index f1aec6bc64..c4443b3e70 100644 --- a/types/ej.web.all/index.d.ts +++ b/types/ej.web.all/index.d.ts @@ -6,10 +6,9 @@ /// - /*! * filename: ej.web.all.d.ts -* version : 15.4.0.17 +* version : 15.4.0.20 * Copyright Syncfusion Inc. 2001 - 2017. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing @@ -94,12 +93,12 @@ declare namespace ej { function avg(json: any, filedName: string): any; function getGuid(prefix: string): number; function group(jsonArray: any, field: string, agg: string, level: number, groupDs: string): any; - function isJson(jsonData: string): string; + function isJSON(jsonData: string): string; function max(jsonArray: any, fieldName?: string, comparer?: string): any; function min(jsonArray: any, fieldName: string, comparer: string): any; function merge(first: string, second: string): any; function mergeshort(jsonArray: any, fieldName: string, comparer: string): any; - function parseJson(jsonText: string): string; + function parseJSON(jsonText: string): string; function parseTable(table: number, headerOption: string, headerRowIndex: string): any; function select(jsonArray: any, fields: string): any; function setTransition(): boolean; @@ -2477,6 +2476,10 @@ declare namespace ej { */ stringFormat?: string; + /** This property allows user to search text for any number of fields in the suggestion list without modifying the selected text format. + */ + searchColumnIndices?: any[]; + /** Field and Header Text collections can be defined and customized through columns field. */ columns?: MultiColumnSettingsColumn[]; @@ -4592,8 +4595,8 @@ declare namespace ej { toolIcon?: string; /** This property allows to define the customized text or content to displayed when mouse over the following elements. This property also allows to use the culture values. - * @Default {{ switcher: Switcher, addbutton: Add Color, basic: Basic, monochrome: Mono Chrome, flatcolors: Flat Color, seawolf: Sea Wolf, webcolors: Web Colors, sandy: Sandy, - * pinkshades: Pink Shades, misty: Misty, citrus: Citrus, vintage: Vintage, moonlight: Moon Light, candycrush: Candy Crush, currentcolor: Current Color, selectedcolor: Selected + * @Default {{ switcher: Switcher, addButton: Add Color, basic: Basic, monoChrome: Mono Chrome, flatColors: Flat Color, seaWolf: Sea Wolf, webColors: Web Colors, sandy: Sandy, + * pinkShades: Pink Shades, misty: Misty, citrus: Citrus, vintage: Vintage, moonLight: Moon Light, candyCrush: Candy Crush, currentColor: Current Color, selectedColor: Selected * Color }} */ tooltipText?: TooltipText; @@ -4749,7 +4752,7 @@ declare namespace ej { /** Sets the tooltip text for the add button. */ - addbutton?: string; + addButton?: string; /** Sets the tooltip text for the basic preset. */ @@ -4757,19 +4760,19 @@ declare namespace ej { /** Sets the tooltip text for the mono chrome preset. */ - monochrome?: string; + monoChrome?: string; /** Sets the tooltip text for the flat colors preset. */ - flatcolors?: string; + flatColors?: string; /** Sets the tooltip text for the sea wolf preset. */ - seawolf?: string; + seaWolf?: string; /** Sets the tooltip text for the web colors preset. */ - webcolors?: string; + webColors?: string; /** Sets the tooltip text for the sandy preset. */ @@ -4777,7 +4780,7 @@ declare namespace ej { /** Sets the tooltip text for the pink shades preset. */ - pinkshades?: string; + pinkShades?: string; /** Sets the tooltip text for the misty preset. */ @@ -4793,19 +4796,19 @@ declare namespace ej { /** Sets the tooltip text for the moon light preset. */ - moonlight?: string; + moonLight?: string; /** Sets the tooltip text for the candy crush preset. */ - candycrush?: string; + candyCrush?: string; /** Sets the tooltip text for the current color area. */ - currentcolor?: string; + currentColor?: string; /** Sets the tooltip text for the selected color area. */ - selectedcolor?: string; + selectedColor?: string; } enum ModelType { @@ -7751,7 +7754,7 @@ declare namespace ej { */ enableRTL?: boolean; - /** The CSS class name to display the favicon in the dialog header. In order to display favicon, you need to set 'showHeader' as true since the favicon will be displayed in the dialog + /** The CSS class name to display the favicon in the dialog header. In order to display favicon, you need to set showHeader as true since the favicon will be displayed in the dialog * header. */ faviconCSS?: string; @@ -8489,6 +8492,11 @@ declare namespace ej { */ enableSorting?: boolean; + /** The property is used to determine whether the popup list is generated dynamically. + * @Default {false} + */ + loadOnDemand?: boolean; + /** Specifies the mapping fields for the data items of the DropDownList. * @Default {null} */ @@ -10888,7 +10896,7 @@ declare namespace ej { /** Fires when keydown in mask edit textbox control. */ - keydown?(e: KeydownEventArgs): void; + onKeyDown?(e: OnKeyDownEventArgs): void; /** Fires when key press in mask edit textbox control. */ @@ -10896,7 +10904,7 @@ declare namespace ej { /** Fires when keyup in mask edit textbox control. */ - keyup?(e: KeyupEventArgs): void; + keyUp?(e: KeyUpEventArgs): void; /** Fires when mouse out in mask edit textbox control. */ @@ -11006,7 +11014,7 @@ declare namespace ej { unmaskedValue?: string; } - export interface KeydownEventArgs { + export interface OnKeyDownEventArgs { /** if the event should be canceled; otherwise, false. */ @@ -11052,7 +11060,7 @@ declare namespace ej { unmaskedValue?: string; } - export interface KeyupEventArgs { + export interface KeyUpEventArgs { /** if the event should be canceled; otherwise, false. */ @@ -11185,9 +11193,10 @@ declare namespace ej { hide(): void; /** Hides the specific items in Menu control. + * @param {string|any[]} ItemID of the Menu item to be hidden * @returns {void} */ - hideItems(): void; + hideItems(itemID: string|any[]): void; /** Insert the menu item as child of target node. * @param {any} Information about Menu item. @@ -11226,9 +11235,10 @@ declare namespace ej { show(locationX: number, locationY: number, targetElement: any, event: any): void; /** Show the specific items in Menu control. + * @param {string|any[]} ItemID of the Menu item to be shown * @returns {void} */ - showItems(): void; + showItems(itemID: string|any[]): void; } export namespace Menu { @@ -11692,6 +11702,26 @@ declare namespace ej { */ gotoPage(pageIndex: number): void; + /** goToFirstPage() helps to navigate to the first page of the pager. + * @returns {void} + */ + goToFirstPage(): void; + + /** goToNextPage() helps to navigate to the next page to the current page of the pager. + * @returns {void} + */ + goToNextPage(): void; + + /** goToLastPage() helps to navigate to the Last page of the pager. + * @returns {void} + */ + goToLastPage(): void; + + /** goToPrevPage() helps to navigate to the previous page to the current page of the pager. + * @returns {void} + */ + goToPrevPage(): void; + /** refreshPager() helps to refresh the model value of pager control. * @returns {void} */ @@ -11710,6 +11740,15 @@ declare namespace ej { */ currentPage?: number; + /** Sets the root CSS class, which can be used for customization of pager control. + */ + cssClass?: string; + + /** Enable or disable the Pager control. + * @Default {true} + */ + enabled?: boolean; + /** Gets or sets a value that indicates whether to display the external Message in Pager. * @Default {false} */ @@ -11729,6 +11768,11 @@ declare namespace ej { */ externalMessage?: string; + /** Enables or disables responsive support for the Pager control items on window resize. + * @Default {false} + */ + isResponsive?: boolean; + /** Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to * a particular country or region. * @Default {en-US} @@ -11751,6 +11795,15 @@ declare namespace ej { */ pageSizeList?: any[]; + /** Indicates the pageSizeMessage to be displayed in Pager when pageSizeList API is defined. + */ + pageSizeMessage?: String; + + /** Template option allows to customize UI appearance of the ejPager by defining their own page layout. + * @Default {null} + */ + template?: string; + /** Get or sets a value of total number of pages in the pager. The totalPages value is calculated based on page size and total records. * @Default {null} */ @@ -11769,6 +11822,22 @@ declare namespace ej { /** Triggered when pager numeric item is clicked in pager control. */ click?(e: ClickEventArgs): void; + + /** Triggers when the current page value of the Pager control is changed. + */ + change?(e: ChangeEventArgs): void; + + /** Triggered when Pager control is successfully created. + */ + create?(e: CreateEventArgs): void; + + /** Triggered when Pager control is successfully destroyed. + */ + destroy?(e: DestroyEventArgs): void; + + /** Triggered when a value is selected in the pageSizeList dropdown. + */ + pageSizeSelected?(e: PageSizeSelectedEventArgs): void; } export interface ClickEventArgs { @@ -11793,6 +11862,70 @@ declare namespace ej { */ event?: any; } + + export interface ChangeEventArgs { + + /** Returns the current page index. + */ + currentPage?: number; + + /** Returns the pager model. + */ + model?: any; + + /** Returns the name of event + */ + type?: string; + + /** Returns current action event type and its target. + */ + event?: any; + } + + export interface CreateEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the pager model. + */ + model?: any; + + /** Returns the name of event + */ + type?: string; + } + + export interface DestroyEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the pager model. + */ + model?: any; + + /** Returns the name of event + */ + type?: string; + } + + export interface PageSizeSelectedEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the pager model. + */ + model?: any; + + /** Returns the name of event + */ + type?: string; + } } class Print extends ej.Widget { @@ -13988,6 +14121,11 @@ declare namespace ej { */ allowDragAndDrop?: boolean; + /** Gets or sets a value that indicates whether to enable drag and drop behavior between Kanban controls. + * @Default {false} + */ + allowExternalDragAndDrop?: boolean; + /** To enable or disable the title of the card. * @Default {false} */ @@ -14157,6 +14295,11 @@ declare namespace ej { */ locale?: string; + /** Gets or sets a value that indicates whether to render kanban columns using without data source. + * @Default {false} + */ + showColumnWhenEmpty?: boolean; + /** Triggered for every Kanban action before its starts. */ actionBegin?(e: ActionBeginEventArgs): void; @@ -15199,6 +15342,10 @@ declare namespace ej { * @Default {Object} */ colorMapping?: any; + + /** This specifies the Kanban card to drop into particular target element. + */ + externalDropTarget?: string; } export interface CustomToolbarItem { @@ -17639,6 +17786,11 @@ declare namespace ej { */ enableRTL?: boolean; + /** Specifies HTML element string to replace the existing expand/collapse icons. + * @Default {null} + */ + expanderTemplate?: string; + /** Specify height for splitter control. * @Default {null} */ @@ -17673,6 +17825,10 @@ declare namespace ej { */ beforeExpandCollapse?(e: BeforeExpandCollapseEventArgs): void; + /** Triggered when we click on the template icon. (Note: This will work only when expanderTemplate is defined.) + */ + clickOnExpander?(e: ClickOnExpanderEventArgs): void; + /** Fires when splitter control pane has been created. */ create?(e: CreateEventArgs): void; @@ -17717,6 +17873,25 @@ declare namespace ej { type?: string; } + export interface ClickOnExpanderEventArgs { + + /** if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /** returns the splitter model. + */ + model?: ej.Splitter.Model; + + /** returns the name of the event. + */ + type?: string; + + /** returns the target element from which click action is triggered. + */ + targetElement?: any; + } + export interface CreateEventArgs { /** if the event should be canceled; otherwise, false. @@ -23235,6 +23410,10 @@ declare namespace ej { */ rowDrop?(e: RowDropEventArgs): void; + /** Triggered while hover the grid row. + */ + rowHover?(e: RowHoverEventArgs): void; + /** Triggered when refresh the template column elements in the Grid. */ templateRefresh?(e: TemplateRefreshEventArgs): void; @@ -24484,7 +24663,7 @@ declare namespace ej { /** Method to merge the header cells. */ - headerCellMerge?(): void; + headerCellMerge?(startIndex:number,count:number): void /** Returns the column headers. */ @@ -25099,6 +25278,25 @@ declare namespace ej { droppedRecords?: any; } + export interface RowHoverEventArgs { + + /** Returns the hovered row. + */ + row?: any; + + /** Returns the hovered row index. + */ + rowIndex?: any; + + /** Returns the hovered record details + */ + rowData?: any; + + /** Returns the hovered row cell + */ + cell?: any; + } + export interface TemplateRefreshEventArgs { /** Returns the cancel option value. @@ -28277,7 +28475,7 @@ declare namespace ej { enableColumnResizing?: boolean; /** Allows the user to fit the width of the column based on its maximum text width. - * @Default {false} + * @Default {true} */ resizeColumnsToFit?: boolean; @@ -28763,7 +28961,7 @@ declare namespace ej { */ format?: string; - /** This property sets type of display of date. + /** This property is set to display the formatted values with format types in PivotGrid. */ formatString?: string; @@ -28862,7 +29060,7 @@ declare namespace ej { */ format?: string; - /** This property sets type of display of date. + /** This property is set to display the formatted values with format types in PivotGrid. */ formatString?: string; @@ -28931,7 +29129,7 @@ declare namespace ej { */ format?: string; - /** This property sets type of display of date. + /** This property is set to display the formatted values with format types in PivotGrid. */ formatString?: string; @@ -30266,7 +30464,7 @@ declare namespace ej { */ analysisMode?: ej.Pivot.AnalysisMode|string; - /** Allows the user to set the specific chart type for PivotChart inside PivotClient widget. + /** Allows the user to set the specific Chart type for PivotChart inside PivotClient widget. * @Default {ej.PivotChart.ChartTypes.Column} */ chartType?: ej.PivotChart.ChartTypes|string; @@ -30311,6 +30509,11 @@ declare namespace ej { */ showUniqueNameOnPivotButton?: boolean; + /** Allows user to load the saved report collection from the database. + * @Default {false} + */ + showReportCollection?: boolean; + /** Enables the splitter option for resizing the elements inside the control. * @Default {false} */ @@ -30336,7 +30539,7 @@ declare namespace ej { */ enablePaging?: boolean; - /** Allows the user to include the PivotTreeMap component as one of the chart types. + /** Allows the user to include the PivotTreeMap component as one of the Chart types. * @Default {false} */ enablePivotTreeMap?: boolean; @@ -30450,6 +30653,18 @@ declare namespace ej { */ treeMapLoad?(e: TreeMapLoadEventArgs): void; + /** Triggers on clicking any value cell in PivotGrid. + */ + valueCellHyperlinkClick?(e: ValueCellHyperlinkClickEventArgs): void; + + /** Triggers when clicking on any Chart series points in the PivotChart. + */ + pointRegionClick?(e: PointRegionClickEventArgs): void; + + /** Triggers before Chart label rendering in the PivotChart. + */ + axesLabelRendering?(e: AxesLabelRenderingEventArgs): void; + /** Triggers while clicking value cells in PivotGrid. */ drillThrough?(e: DrillThroughEventArgs): void; @@ -30562,9 +30777,9 @@ declare namespace ej { export interface SchemaLoadEventArgs { - /** returns the HTML element of PivotSchemaDesigner control. + /** returns the current action of PivotSchemaDesigner control. */ - element?: any; + action?: string; } export interface TreeMapLoadEventArgs { @@ -30582,6 +30797,59 @@ declare namespace ej { element?: any; } + export interface ValueCellHyperlinkClickEventArgs { + + /** returns the current action of PivotClient control. + */ + type?: string; + + /** returns the clicked cell information. + */ + args?: any; + + /** returns the custom object bounds with PivotClient control. + */ + customerObject?: any; + + /** returns the HTML element of PivotGrid control. + */ + element?: any; + + /** returns the model object bound with PivotClient control. + */ + model?: any; + } + + export interface PointRegionClickEventArgs { + + /** returns the current action of PivotClient control. + */ + type?: string; + + /** returns the clicked Chart series points information. + */ + data?: any; + + /** returns the model object bound with PivotClient control. + */ + model?: any; + } + + export interface AxesLabelRenderingEventArgs { + + /** returns the current action of PivotClient control. + */ + type?: string; + + /** returns the Chart label information. + */ + data?: any; + + /** returns the model object bound with PivotClient control. + */ + model?: any; + } + export interface DrillThroughEventArgs { /** return the JSON records of the generated cells on drill-through operation. @@ -30708,7 +30976,7 @@ declare namespace ej { */ format?: string; - /** This property sets type of display of date. + /** This property is set to display the formatted values with format types in PivotGrid. */ formatString?: string; @@ -30803,7 +31071,7 @@ declare namespace ej { */ format?: string; - /** This property sets type of display of date. + /** This property is set to display the formatted values with format types in PivotGrid. */ formatString?: string; @@ -30868,7 +31136,7 @@ declare namespace ej { */ format?: string; - /** This property sets type of display of date. + /** This property is set to display the formatted values with format types in PivotGrid. */ formatString?: string; @@ -32161,6 +32429,14 @@ declare namespace ej { */ exportSchedule(action: string, serverEvent: string, id: string|number): void; + /** Exports the appointments from the Schedule control and saves it in a Excel file. + * @param {string} It refers the controller action name to redirect. (For MVC) + * @param {string} It refers the server event name.(For ASP) + * @param {boolean} Indicates whether to export all the appointments including or excluding the individual occurrences of the recurrence appointments. + * @returns {void} + */ + exportToExcel(action: string, serverEvent: string, type: boolean): void; + /** Searches and filters the appointments from appointment list of Schedule control. * @param {any[]} Holds array of one or more conditional objects for filtering the appointments based on it. * @returns {any[]} @@ -34088,13 +34364,6 @@ declare namespace ej { */ addRecord(data: any, rowPosition: string): void; - /** To select cell based on the cell and row index dynamically. - * @param {any[]} array of cell indexes to be select - * @param {boolean} Defines that we need to preserve the previously selected cells of not - * @returns {void} - */ - selectCells(Indexes: any[], preservePreviousSelectedCell: boolean): void; - /** Positions the splitter by the specified column index. * @param {number} Set the splitter position based on column index. * @returns {void} @@ -34178,6 +34447,19 @@ declare namespace ej { */ saveEdit(): void; + /** To select cell based on the cell and row index dynamically. + * @param {any[]} array of cell indexes to be select + * @param {boolean} Defines that we need to preserve the previously selected cells of not + * @returns {void} + */ + selectCells(Indexes: any[], preservePreviousSelectedCell: boolean): void; + + /** To select multiple rows dynamically. + * @param {any[]} array of row indexes to select + * @returns {void} + */ + selectMultipleRows(rowIndexes: any[]): void; + /** To search an item with search string provided at the run time * @param {string} you can pass a text to search in Gantt Control. * @returns {void} @@ -34195,6 +34477,13 @@ declare namespace ej { * @returns {void} */ showColumn(headerText: string): void; + + /** To change an existing Gantt ID by new ID value dynamically + * @param {number} you can pass an existing ID value to be change + * @param {number} you can pass a new ID value to be change + * @returns {void} + */ + updateTaskId(currentId: number, newId: number): void; } export namespace Gantt { @@ -35653,6 +35942,11 @@ declare namespace ej { * @Default {ej.Gantt.RowPosition.BelowSelectedRow} */ rowPosition?: ej.Gantt.RowPosition|string; + + /** Enable or disable the confirmation dialog while deleting the record. + * @Default {false} + */ + showDeleteConfirmDialog?: boolean; } export interface Holiday { @@ -36159,6 +36453,11 @@ declare namespace ej { */ zoomFactor?: number; + /** Specifies the token for authorizing reporting service url to process the reports. + * @Default {empty} + */ + serviceAuthorizationToken?: string; + /** Fires when the report viewer is destroyed successfully.If you want to perform any operation after destroying the reportviewer control,you can make use of the destroy event. */ destroy?(e: DestroyEventArgs): void; @@ -36933,6 +37232,11 @@ declare namespace ej { */ allowSorting?: boolean; + /** Enables or disables the toolbar searching in TreeGrid. + * @Default {false} + */ + allowSearching?: boolean; + /** Enables/disables pagination of rows in TreeGrid * @Default {false} */ @@ -37128,6 +37432,10 @@ declare namespace ej { */ stackedHeaderRows?: StackedHeaderRow[]; + /** Specifies the toolbar searching customizations. + */ + searchSettings?: SearchSettings; + /** Specifies the visibility of summary row * @Default {false} */ @@ -37194,10 +37502,6 @@ declare namespace ej { */ collapsing?(e: CollapsingEventArgs): void; - /** Triggered while clicking a row, even when allowSelection property is disabled. - */ - recordClick?(e: RecordClickEventArgs): void; - /** Triggered when you start to drag a column */ columnDragStart?(e: ColumnDragStartEventArgs): void; @@ -37294,6 +37598,14 @@ declare namespace ej { */ rowSelecting?(e: RowSelectingEventArgs): void; + /** Triggered while clicking a row, even when allowSelection property is disabled. + */ + recordClick?(e: RecordClickEventArgs): void; + + /** Triggered during record double click action, even when allowSelection property is disabled. + */ + recordDoubleClick?(e: RecordDoubleClickEventArgs): void; + /** Triggered when toolbar item is clicked in TreeGrid. */ toolbarClick?(e: ToolbarClickEventArgs): void; @@ -37461,37 +37773,6 @@ declare namespace ej { expanded?: boolean; } - export interface RecordClickEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the element of clicked cell. - */ - cell?: any; - - /** Returns the index of the clicked cell. - */ - cellIndex?: number; - - /** Returns the data of clicked cell. - */ - cellValue?: any; - - /** Returns the element of the clicked row. - */ - row?: any; - - /** Returns the index of the clicked row. - */ - rowIndex?: number; - - /** Returns the column name of the clicked cell. - */ - columnName?: string; - } - export interface ColumnDragStartEventArgs { /** Returns the cancel option value. @@ -37937,6 +38218,10 @@ declare namespace ej { */ draggedRowIndex?: number; + /** Returns the drop position details such as insertAbove,insertBelow,insertAsChild and invalidPosition + */ + dropPosition?: string; + /** Returns the row on which we are dragging. */ targetRow?: any; @@ -38160,6 +38445,68 @@ declare namespace ej { previousTreeGridRow?: any; } + export interface RecordClickEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the element of clicked cell. + */ + cell?: any; + + /** Returns the index of the clicked cell. + */ + cellIndex?: number; + + /** Returns the data of clicked cell. + */ + cellValue?: any; + + /** Returns the element of the clicked row. + */ + row?: any; + + /** Returns the index of the clicked row. + */ + rowIndex?: number; + + /** Returns the column name of the clicked cell. + */ + columnName?: string; + } + + export interface RecordDoubleClickEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the element of clicked cell. + */ + cell?: any; + + /** Returns the index of the clicked cell. + */ + cellIndex?: number; + + /** Returns the data of clicked cell. + */ + cellValue?: any; + + /** Returns the element of the clicked row. + */ + row?: any; + + /** Returns the index of the clicked row. + */ + rowIndex?: number; + + /** Returns the column name of the clicked cell. + */ + columnName?: string; + } + export interface ToolbarClickEventArgs { /** Returns the cancel option value. @@ -38255,6 +38602,11 @@ declare namespace ej { */ filterEditType?: ej.TreeGrid.EditingType|string; + /** Gets or sets a value to render either excel or menu filtering in TreeGrid column filtering. + * @Default {null} + */ + filterType?: ej.TreeGrid.FilterType|string; + /** Header text of the column. * @Default {null} */ @@ -38420,6 +38772,11 @@ declare namespace ej { * @Default {null} */ dialogEditorTemplateID?: string; + + /** Enable or disable the confirmation dialog while deleting the record. + * @Default {false} + */ + showDeleteConfirmDialog?: boolean; } export interface ColumnResizeSettings { @@ -38465,6 +38822,21 @@ declare namespace ej { * @Default {[]} */ filteredColumns?: FilterSettingsFilteredColumn[]; + + /** Gets or sets a value that indicates the maximum number of filter choices that can be showed in the excel styled filter menu. + * @Default {1000} + */ + maxFilterChoice?: number; + + /** Gets or sets a value that indicates to perform the filter operation with case sensitive in excel styled filter menu mode. + * @Default {false} + */ + enableCaseSensitivity?: boolean; + + /** Enables or disables the ability to filter the columns with empty, null and undefined values. + * @Default {true} + */ + enableComplexBlankFilter?: boolean; } export interface PageSettings { @@ -38576,6 +38948,28 @@ declare namespace ej { stackedHeaderColumns?: StackedHeaderRowsStackedHeaderColumn[]; } + export interface SearchSettings { + + /** Default Value + * @Default {[]} + */ + fields?: any[]; + + /** Default Value + */ + key?: string; + + /** Specifies the operator for the search key words in toolbar searching. + * @Default {contains} + */ + operator?: string; + + /** Default Value + * @Default {true} + */ + ignoreCase?: boolean; + } + export interface SummaryRowsSummaryColumn { /** Specifies the summary type to perform calculations in a corresponding summary column. See summaryType. @@ -38703,6 +39097,16 @@ declare namespace ej { } + enum FilterType { + + ///Specifies the filter type as menu. + Menu, + + ///Specifies the filter type as excel. + Excel + } + + enum UnboundType { ///Unbound type to perform edit action @@ -38794,16 +39198,6 @@ declare namespace ej { } - enum FilterType { - - ///Enables the filterbar filtering - FilterBar, - - ///Enables the menu filtering - Menu - } - - enum PageSizeMode { ///To count all the parent and child records. @@ -40585,6 +40979,11 @@ declare namespace ej { */ addNewSheet(): void; + /** This method is used to blank the workbook in Spreadsheet. + * @returns {void} + */ + blankWorkbook(): void; + /** It is used to clear all the data and format in the specified range of cells in Spreadsheet. * @param {string|any[]} Optional. If range is specified, then it will clear all content in the specified range else it will use the current selected range. * @returns {void} @@ -40707,6 +41106,15 @@ declare namespace ej { */ getAutoFillElem(): HTMLElement; + /** This method is used to get the alpha range of the given index in Spreadsheet. + * @param {number} Pass the start row index. + * @param {number} Pass the start column index. + * @param {number} Pass the end row index. + * @param {number} Pass the end column index. + * @returns {String} + */ + getAlphaRange(sRIndex: number, sCIndex: number, eRIndex: number, eCIndex: number): String; + /** This method is used to get the cell element based on specified row and column index in the Spreadsheet. * @param {number} Pass the row index. * @param {number} Pass the column index. @@ -40739,6 +41147,12 @@ declare namespace ej { */ getHyperlink(cell: HTMLElement): any; + /** This method is used to get the keys from the given object in Spreadsheet. + * @param {any} Pass the Object + * @returns {any[]} + */ + getObjectKeys(obj: any): any[]; + /** This method is used to get all cell elements in the specified range. * @param {string} Pass the range that you want to get the cells. * @param {number} Pass the index of the sheet. @@ -40753,6 +41167,14 @@ declare namespace ej { */ getRangeData(options?: any): any[]; + /** This method is used to get the data as object in the specified range. + * @param {any} Pass the start cell. + * @param {any} Pass the end cell. + * @param {boolean} Optional. Pass {{'`true`' | markdownify}}, if you want to skip the hidden rows. + * @returns {any} + */ + getRangeDataAsObject(startcell: any, endcell: any, skipHiddenRow?: boolean): any; + /** This method is used to get the range indices array based on the specified alpha range in Spreadsheet. * @param {string} Pass the alpha range that you want to get range indices. * @returns {any[]} @@ -41432,6 +41854,12 @@ declare namespace ej { */ editCell(rowIdx: number, colIdx: number, oldData: boolean): void; + /** This method is used to get the column index with specified field value in Spreadsheet. + * @param {string} Pass the column field value + * @returns {void} + */ + getColumnIndexByField(field: string): void; + /** This method is used to get the property value of particular cell, based on the row and column index in the Spreadsheet. * @param {number} Pass the row index to get the property value. * @param {number} Pass the column index to get the property value. @@ -41473,6 +41901,15 @@ declare namespace ej { * @returns {void} */ updateCellValue(cellIdx: any, val: string|number, formatClass: string, sheetIdx: number): void; + + /** This method is used to update a particular cell value and its format in the Spreadsheet. + * @param {string} Pass the range. + * @param {string|number} Pass the cell value. + * @param {string} Pass the class name to update format. + * @param {number} Pass sheet index. + * @returns {void} + */ + updateValue(aRange: string, val: string|number, formatClass: string, sheetIdx: number): void; } export interface XLExport { @@ -41517,6 +41954,20 @@ declare namespace ej { */ addFontFamily(fontName: string): void; + /** This method is used to add the new custom cell style in spreadsheet. + * @param {string} Pass the style name. + * @param {any} Pass the format object. + * @returns {void} + */ + addNewCustomStyle(styleName: string, options: any): void; + + /** This method is used to apply the custom cell style in the specified range. + * @param {string} Pass the style name. + * @param {string} Pass the range to applied. + * @returns {void} + */ + applyCustomCellStyle(styleName: string, range: string): void; + /** This method is used to convert table range to normal range. * @param {any} Pass the sheet index and table id. * @returns {void} @@ -41530,6 +41981,12 @@ declare namespace ej { */ createTable(tableObject: any, range: string|any[]): string; + /** This method is used to delete the added custom cell style in spreadsheet. + * @param {string} Pass the cell style name + * @returns {void} + */ + deleteCustomStyle(styleName: string): void; + /** This method is used to set format style and values in a cell or range of cells. * @param {any} Pass the formatObject which contains style, type, format, groupSeparator and decimalPlaces. * @param {string} Pass the range to format cells. @@ -41537,6 +41994,46 @@ declare namespace ej { */ format(formatObj: any, range: string): void; + /** This method is used to get the border from hashcode in the Spreadsheet. + * @param {string} Pass the border hashcode. + * @param {boolean} Optional. pass `true` to get the complete border object + * @returns {any} + */ + getBorderFromHashCode(code: string, isComplete: boolean): any; + + /** This method is used to get the format class in spreadsheet. + * @param {string} Pass the style name. + * @param {boolean} Optional. Pass true to get the border class. + * @returns {void} + */ + getFormatClass(classname: string, isborder: boolean): void; + + /** This method is used to get the format from the given hashcode in spreadsheet. + * @param {string} Pass the hashcode. + * @returns {void} + */ + getFormatFromHashCode(hashCode: string): void; + + /** This method is used to get the hashcode from the given style object in spreadsheet. + * @param {any} Pass the style object that you want to get the hashcode. + * @returns {void} + */ + getFormatHashCode(style: any): void; + + /** This method is used to get the format as array from the given specified range in spreadsheet. + * @param {string} Pass the range. + * @returns {void} + */ + getHashCodeClassAsArray(range: string): void; + + /** This method is used to modify the added custom cell style in spreadsheet. + * @param {string} pass the old style name + * @param {any} pass the format object to be modified + * @param {string} pass the new style name + * @returns {void} + */ + modifyCustomStyle(oldStyleName: string, options: any, newStyleName: string): void; + /** This method is used to remove the font from the Ribbon font family dropdown. * @param {string} Font name which needs to remove from the font family drop down. * @returns {void} @@ -45967,6 +46464,470 @@ declare namespace ej { } } + class ComboBox extends ej.Widget { + static fn: ComboBox; + constructor(element: JQuery | Element, options?: ComboBox.Model); + static Locale: any; + model: ComboBox.Model; + defaults: ComboBox.Model; + + /** Adds a new item to the popup list. By default, new item appends to the list as the last item, but you can insert based on the index parameter. + * @returns {void} + */ + addItem(): void; + + /** Sets the focus to the component for interaction. + * @returns {void} + */ + focusIn(): void; + + /** Moves the focus from the component if the component is already focused. + * @returns {void} + */ + focusOut(): void; + + /** Gets the data object that matches the given value. + * @returns {any} + */ + getDataByValue(): any; + + /** Gets all the list items bound on this component. + * @returns {Element[]} + */ + getItems(): Element[]; + + /** Hides the popup if it is in open state. + * @returns {void} + */ + hidePopup(): void; + + /** Opens the popup that displays the list of items. + * @returns {void} + */ + showPopup(): void; + } + export namespace ComboBox { + + export interface Model { + + /** Accepts the template and assigns it to the popup list content of the component when the data fetch request from the remote server fails. + * @Default {The Request Failed} + */ + actionFailureTemplate?: string; + + /** Specifies whether the component allows user defined value which does not exist in data source. + * @Default {true} + */ + allowCustom?: boolean; + + /** When allowFiltering is set to true, show the filter bar (search box) of the component. The filter action retrieves matched items through the filtering event based on the + * characters typed in the search TextBox. If no match is found, the value of the noRecordsTemplate property will be displayed. + * @Default {false} + */ + allowFiltering?: boolean; + + /** Specifies whether suggest a first matched item in input when searching. No action happens when no matches found. + * @Default {false} + */ + autofill?: boolean; + + /** Sets CSS classes to the root element of the component that helps customize the UI styles. + * @Default {null} + */ + cssClass?: string; + + /** Accepts the list items either through local or remote service and binds it to the component. It can be an array of JSON objects or an instance of DataManager. + * @Default {[]} + */ + dataSource?: any|any[]; + + /** When set to true, enables RTL mode of the component that displays the content in the right-to-left direction. + * @Default {false} + */ + enableRtl?: boolean; + + /** Specifies a value that indicates whether the component is enabled or not. + * @Default {true} + */ + enabled?: boolean; + + /** The fields property maps the columns of the data table and binds the data to the component. + */ + fields?: Fields; + + /** Accepts the template design and assigns it to the footer container of the popup list. + * @Default {null} + */ + footerTemplate?: string; + + /** Accepts the template design and assigns it to the group headers present in the popup list. + * @Default {null} + */ + groupTemplate?: string; + + /** Accepts the template design and assigns it to the header container of the popup list. + * @Default {null} + */ + headerTemplate?: string; + + /** Allows additional HTML attributes such as title, name, etc., and accepts n number of attributes in a key-value pair format. + * @Default {{}} + */ + htmlAttributes?: any; + + /** Gets or sets the index of the selected item in the component. + * @Default {null} + */ + index?: number; + + /** Accepts the template design and assigns it to each list item present in the popup. + * @Default {null} + */ + itemTemplate?: string; + + /** Overrides the global culture and localization value for this component. Default global culture is 'en-US'. + * @Default {en-US} + */ + locale?: string; + + /** Accepts the template design and assigns it to popup list of component when no data is available on the component. + * @Default {No Records Found} + */ + noRecordsTemplate?: string; + + /** Accepts the value to be displayed as a watermark text on the component input. + * @Default {null} + */ + placeholder?: string; + + /** Specifies the height of the popup list. + * @Default {300px} + */ + popupHeight?: string|number; + + /** Specifies the width of the popup list. By default, the popup width sets based on the width of the component. + * @Default {100%} + */ + popupWidth?: string|number; + + /** The query to retrieve the data from the data source. + * @Default {null} + */ + query?: ej.Query; + + /** When set to true, the user interactions on the component are disabled. + * @Default {false} + */ + readonly?: boolean; + + /** Specifies whether to show or hide the clear button. When the clear button is clicked, value, text, and index properties are reset to null. + * @Default {true} + */ + showClearButton?: boolean; + + /** Specifies the sortOrder to sort the data source. The available type of sort orders are + * @Default {ej.SortOrder.None} + */ + sortOrder?: ej.ComboBox.SortOrder|string; + + /** Gets or sets the display text of the selected item in the component. + * @Default {null} + */ + text?: string; + + /** Gets or sets the value of the selected item in the component. + * @Default {null} + */ + value?: number|string; + + /** Specifies the width of the component. By default, the component width sets based on the width of its parent container. You can also set the width in pixel values. + * @Default {100%} + */ + width?: number|string; + + /** Triggers before fetching data from the remote server. + */ + actionBegin?(e: ActionBeginEventArgs): void; + + /** Triggers after data is fetched successfully from the remote server. + */ + actionComplete?(e: ActionCompleteEventArgs): void; + + /** Triggers when the data fetch request from the remote server fails. + */ + actionFailure?(e: ActionFailureEventArgs): void; + + /** Triggers when an item in a popup is selected or when the model value is changed. + */ + change?(e: ChangeEventArgs): void; + + /** Triggers when the popup is closed. + */ + close?(e: CloseEventArgs): void; + + /** Triggers when ComboBox widget is created. + */ + create?(e: CreateEventArgs): void; + + /** Triggers on set a custom value to this component. + */ + customValueSpecifier?(e: CustomValueSpecifierEventArgs): void; + + /** Triggers on typing a character in the component. + */ + filtering?(e: FilteringEventArgs): void; + + /** Triggers when the component is focused. + */ + focus?(e: FocusEventArgs): void; + + /** Triggers after the suggestion list is opened. + */ + open?(e: OpenEventArgs): void; + + /** Triggers when an item in the popup is selected. + */ + select?(e: SelectEventArgs): void; + } + + export interface ActionBeginEventArgs { + + /** if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /** returns the ComboBox model + */ + model?: any; + + /** returns the name of the event + */ + type?: string; + } + + export interface ActionCompleteEventArgs { + + /** if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /** returns the Autocomplete model + */ + model?: any; + + /** Returns the query for data retrieval from the Database + */ + e?: any; + + /** returns the name of the event + */ + type?: string; + } + + export interface ActionFailureEventArgs { + + /** if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /** Returns the error message + */ + e?: any; + + /** returns the Autocomplete model + */ + model?: any; + + /** returns the name of the event + */ + type?: string; + } + + export interface ChangeEventArgs { + + /** Set this option to true to cancel the event. + */ + cancel?: boolean; + + /** Instance of the combobox model object. + */ + model?: ej.ComboBox.Model; + + /** Name of the event. + */ + type?: string; + + /** Value of the combobox textbox. + */ + value?: string|number; + + /** Li element of the selected item. + */ + Item?: any; + + /** Event argument. + */ + e?: any; + + /** value of the interaction + */ + isInteracted?: boolean; + } + + export interface CloseEventArgs { + + /** Element of the combobox popup list + */ + popup?: any; + } + + export interface CreateEventArgs { + + /** Set this option to true to cancel the event. + */ + cancel?: boolean; + + /** Instance of the combobox model object. + */ + model?: ej.ComboBox.Model; + + /** Name of the event. + */ + type?: string; + } + + export interface CustomValueSpecifierEventArgs { + + /** Instance of the combobox model object. + */ + model?: ej.ComboBox.Model; + + /** Name of the event. + */ + type?: string; + + /** text of the combobox. + */ + text?: string; + } + + export interface FilteringEventArgs { + + /** Instance of the combobox model object. + */ + model?: ej.ComboBox.Model; + + /** Name of the event. + */ + type?: string; + + /** text of the combobox. + */ + text?: string; + + /** Function used to update the filtering value. + */ + updateData?: any; + } + + export interface FocusEventArgs { + + /** Set this option to true to cancel the event. + */ + cancel?: boolean; + + /** Instance of the combobox model object. + */ + model?: ej.ComboBox.Model; + + /** Name of the event. + */ + type?: string; + } + + export interface OpenEventArgs { + + /** Element of the combobox popup list + */ + popup?: any; + } + + export interface SelectEventArgs { + + /** Set this option to true to cancel the event. + */ + cancel?: boolean; + + /** Instance of the combobox model object. + */ + model?: ej.ComboBox.Model; + + /** Name of the event. + */ + type?: string; + + /** Value of the combobox textbox. + */ + value?: string|number; + + /** Text of the selected item. + */ + text?: string; + + /** Data object of the selected item. + */ + itemData?: ej.ComboBox.Model; + + /** Li element of the selected item. + */ + Item?: any; + + /** Event argument. + */ + e?: any; + + /** value of the interaction + */ + isInteracted?: boolean; + } + + export interface Fields { + + /** Used to group the popup list items. + * @Default {null} + */ + groupBy?: string; + + /** Defines class for the item. + * @Default {null} + */ + iconCss?: string; + + /** Defines the specific field name which contains unique values for the list items. + * @Default {null} + */ + value?: string; + + /** Defines the specific field name in the data source to load the popup list with data. + * @Default {null} + */ + text?: string; + } + + enum SortOrder { + + ///The data source is not sorting. + None, + + ///The data source is sorting with ascending order. + Ascending, + + ///The data source is sorting with descending order. + Descending + } + + } + } declare namespace ej.datavisualization { class SymbolPalette extends ej.Widget { @@ -64066,7 +65027,7 @@ declare namespace ej.datavisualization { historyManager?: HistoryManager; /** Defines the type of the rendering mode of label. - * @Default {Html} + * @Default {HTML} */ labelRenderingMode?: ej.datavisualization.Diagram.LabelRenderingMode|string; @@ -65424,6 +66385,10 @@ declare namespace ej.datavisualization { */ borderWidth?: number; + /** This property allows you to customize sourceDecorator appearance using user-defined CSS. + */ + cssClass?: string; + /** Sets the fill color of the source decorator * @Default {black} */ @@ -65469,6 +66434,10 @@ declare namespace ej.datavisualization { */ borderColor?: string; + /** This property allows you to customize targetDecorator appearance using user-defined CSS. + */ + cssClass?: string; + /** Sets the color with which the decorator will be filled * @Default {black} */ @@ -65516,7 +66485,7 @@ declare namespace ej.datavisualization { */ cornerRadius?: number; - /** Configures the styles of shapes + /** This property allows you to customize connectors appearance using user-defined CSS. */ cssClass?: string; @@ -66213,6 +67182,11 @@ declare namespace ej.datavisualization { */ stops?: any[]; + /** Defines the type of gradient + * @Default {linear} + */ + type?: string; + /** Defines the left most position(relative to node) of the rectangular region that needs to be painted * @Default {0} */ @@ -66236,6 +67210,11 @@ declare namespace ej.datavisualization { export interface NodesGradientRadialGradient { + /** Defines the type of gradient + * @Default {radial} + */ + type?: string; + /** Defines the position of the outermost circle * @Default {0} */ @@ -66350,6 +67329,10 @@ declare namespace ej.datavisualization { */ borderWidth?: number; + /** This property allows you to customize labels appearance using user-defined CSS. + */ + cssClass?: string; + /** Enables or disables the default behaviors of the label. * @Default {ej.datavisualization.Diagram.LabelConstraints.None} */ @@ -66429,6 +67412,10 @@ declare namespace ej.datavisualization { */ rotateAngle?: number; + /** Sets the id of svg/html templates. Applicable, if the node's label is HTML or native. + */ + templateId?: string; + /** Defines the label text */ text?: string; @@ -66471,6 +67458,10 @@ declare namespace ej.datavisualization { export interface NodesLane { + /** This property allows you to customize lanes appearance using user-defined CSS. + */ + cssClass?: string; + /** Defines the width of lane * @Default {0} */ @@ -66623,6 +67614,10 @@ declare namespace ej.datavisualization { */ constraints?: ej.datavisualization.Diagram.PortConstraints|string; + /** This property allows you to customize ports appearance using user-defined CSS. + */ + cssClass?: string; + /** Sets the fill color of the port * @Default {white} */ @@ -66865,7 +67860,7 @@ declare namespace ej.datavisualization { */ cornerRadius?: number; - /** Configures the styles of shapes + /** This property allows you to customize nodes appearance using user-defined CSS. */ cssClass?: string; @@ -67982,10 +68977,10 @@ declare namespace ej.datavisualization { } namespace Diagram { enum LabelRenderingMode { - //Sets the labelRenderingMode as Html - Html, - //Sets the labelRenderingMode as Svg - Svg, + //Sets the labelRenderingMode as HTML + HTML, + //Sets the labelRenderingMode as SVG + SVG, } } namespace Diagram { @@ -68094,7 +69089,7 @@ declare namespace ej.datavisualization { PointerEvents, //Enables contrast between clean edges for the node over rendering speed and geometric precision CrispEdges, - //Enables all node constraints + //Enables default node interactions such as select,delete,drag,rotate,resize,connect,inheritCrispEdges and inheritTooltip Default, } } @@ -68458,8 +69453,8 @@ declare namespace ej.datavisualization { Text, //Used to specify node type as Image Image, - //Used to specify node type as Html - Html, + //Used to specify node type as HTML + HTML, //Used to specify node type as Native Native, //Used to specify node type as Basic @@ -71150,6 +72145,9 @@ interface JQuery { ejColorPicker(options?: ej.ColorPicker.Model): JQuery; ejColorPicker(memberName: any, value?: any, param?: any): any; + ejComboBox(options?: ej.ComboBox.Model): JQuery; + ejComboBox(memberName: any, value?: any, param?: any): any; + ejDatePicker(options?: ej.DatePicker.Model): JQuery; ejDatePicker(memberName: any, value?: any, param?: any): any; @@ -71378,6 +72376,7 @@ interface JQuery { data(key: "ejCheckBox"): ej.CheckBox; data(key: "ejCircularGauge"): ej.datavisualization.CircularGauge; data(key: "ejColorPicker"): ej.ColorPicker; + data(key: "ejComboBox"): ej.ComboBox; data(key: "ejDatePicker"): ej.DatePicker; data(key: "ejDateRangePicker"): ej.DateRangePicker; data(key: "ejDateTimePicker"): ej.DateTimePicker; diff --git a/types/ej.web.all/tsconfig.json b/types/ej.web.all/tsconfig.json index 0a0a2b79e4..fd4e862f17 100644 --- a/types/ej.web.all/tsconfig.json +++ b/types/ej.web.all/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ejs-locals/tsconfig.json b/types/ejs-locals/tsconfig.json index 7f549cd0a6..f52e703a13 100644 --- a/types/ejs-locals/tsconfig.json +++ b/types/ejs-locals/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ejs/tsconfig.json b/types/ejs/tsconfig.json index ea91455364..07c96c4dc5 100644 --- a/types/ejs/tsconfig.json +++ b/types/ejs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ejson/tsconfig.json b/types/ejson/tsconfig.json index 3769f3db66..37caf6d903 100644 --- a/types/ejson/tsconfig.json +++ b/types/ejson/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/elastic.js/tsconfig.json b/types/elastic.js/tsconfig.json index 6a705c4c27..498af2bd5c 100644 --- a/types/elastic.js/tsconfig.json +++ b/types/elastic.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/elasticsearch/tsconfig.json b/types/elasticsearch/tsconfig.json index 21ac20d7e9..53c7b4e86d 100644 --- a/types/elasticsearch/tsconfig.json +++ b/types/elasticsearch/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "elasticsearch-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/electron-config/tsconfig.json b/types/electron-config/tsconfig.json index 8462205033..928f18f011 100644 --- a/types/electron-config/tsconfig.json +++ b/types/electron-config/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-debug/tsconfig.json b/types/electron-debug/tsconfig.json index 65a83c7c64..8422bbf834 100644 --- a/types/electron-debug/tsconfig.json +++ b/types/electron-debug/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-devtools-installer/tsconfig.json b/types/electron-devtools-installer/tsconfig.json index 77fbb1d7c5..1a943c0c96 100644 --- a/types/electron-devtools-installer/tsconfig.json +++ b/types/electron-devtools-installer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-is-dev/tsconfig.json b/types/electron-is-dev/tsconfig.json index 1260f76477..1201808cbe 100644 --- a/types/electron-is-dev/tsconfig.json +++ b/types/electron-is-dev/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-json-storage/tsconfig.json b/types/electron-json-storage/tsconfig.json index d5bbe0168b..a66e96746a 100644 --- a/types/electron-json-storage/tsconfig.json +++ b/types/electron-json-storage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-notifications/tsconfig.json b/types/electron-notifications/tsconfig.json index b5d1926fe9..486d6311e7 100644 --- a/types/electron-notifications/tsconfig.json +++ b/types/electron-notifications/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-notify/tsconfig.json b/types/electron-notify/tsconfig.json index 49580cd305..d265180995 100644 --- a/types/electron-notify/tsconfig.json +++ b/types/electron-notify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-packager/electron-packager-tests.ts b/types/electron-packager/electron-packager-tests.ts index 482c49bbff..f956910b78 100644 --- a/types/electron-packager/electron-packager-tests.ts +++ b/types/electron-packager/electron-packager-tests.ts @@ -1,8 +1,16 @@ -import * as packager from "electron-packager"; +import packager = require("electron-packager"); -function callback(err: Error, appPath: string) { +function callback(err: Error, appPaths: string[]) { const msg = err.message; - const index = appPath.indexOf("test"); + const index = appPaths.indexOf("test"); +} + +function completeFunction(buildPath: string, electronVersion: string, platform: string, arch: string, callbackFn: () => void) { + callbackFn(); +} + +function ignoreFunction(path: string) { + return true; } packager({ @@ -10,20 +18,38 @@ packager({ name: "myapplication", platform: "win32", arch: "all", - electronVersion: "0.34.0" + electronVersion: "0.34.0", + win32metadata: { + CompanyName: "Acme CO", + FileDescription: "My application", + OriginalFilename: "myapp.exe", + ProductName: "Application", + InternalName: "roadrunner", + "requested-execution-level": "highestAvailable", + "application-manifest": "manifest.xml" + } }, callback); packager({ dir: ".", name: "myapplication", electronVersion: "0.34.0", - all: true + all: true, + win32metadata: { + CompanyName: "Acme CO", + FileDescription: "My application", + OriginalFilename: "myapp.exe", + ProductName: "Application", + InternalName: "roadrunner", + "requested-execution-level": "requireAdministrator", + "application-manifest": "manifest.xml" + } }, callback); packager({ dir: ".", name: "myapplication", - platform: "win32", + platform: "all", arch: "all", electronVersion: "0.34.0" }, callback); @@ -34,3 +60,136 @@ packager({ electronVersion: "0.34.0", all: true }, callback); + +packager({ + dir: ".", + name: "myapplication", + electronVersion: "0.34.0", + arch: "arm64", + executableName: "myapp" +}, callback); + +packager({ + dir: ".", + afterCopy: [ + completeFunction + ], + afterExtract: [ + completeFunction + ], + afterPrune: [ + completeFunction + ], + appCopyright: "Copyright", + appVersion: "1.0", + arch: "ia32", + asar: false, + buildVersion: "1.2.3", + derefSymlinks: true, + download: { + cache: "./zips", + mirror: "https://10.1.2.105/", + quiet: true, + strictSSL: true + }, + extraResource: "foo.js", + icon: "foo.ico", + ignore: /ab+c/, + out: "out", + overwrite: true, + packageManager: false, + prune: true, + quiet: true, + tmpdir: "/tmp", + win32metadata: { + CompanyName: "Acme CO", + FileDescription: "My application", + OriginalFilename: "myapp.exe", + ProductName: "Application", + InternalName: "roadrunner", + "requested-execution-level": "asInvoker", + "application-manifest": "manifest.xml" + } +}, callback); + +packager({ + dir: ".", + arch: "x64", + asar: true, + derefSymlinks: false, + download: { + cache: "./zips", + mirror: "https://10.1.2.105/", + quiet: false, + strictSSL: true + }, + extraResource: [ + "foo.js", + "bar.js" + ], + ignore: [ + /ab+c/, + new RegExp('abc') + ], + overwrite: false, + packageManager: "npm", + platform: "darwin", + prune: false, + quiet: false, + tmpdir: "false", + appBundleId: "123456", + appCategoryType: "public.app-category.developer-tools", + extendInfo: "plist.txt", + helperBundleId: "23223f", + osxSign: true +}, callback); + +packager({ + dir: ".", + arch: "armv7l", + asar: { + ordering: "order.txt", + unpack: "*.js", + unpackDir: "sub_dir" + }, + download: { + cache: "./zips", + mirror: "https://10.1.2.105/", + quiet: false, + strictSSL: false + }, + ignore: ignoreFunction, + packageManager: "cnpm", + platform: "linux" +}, callback); + +packager({ + dir: ".", + arch: [ + "ia32", + "x64" + ], + download: { + cache: "./zips", + mirror: "https://10.1.2.105/", + quiet: true, + strictSSL: false + }, + packageManager: "yarn", + platform: "mas", + extendInfo: { + foo: "bar" + }, + osxSign: { + identity: "myidentity", + entitlements: "path/to/my.entitlements", + "entitlements-inherit": "path/to/inherit.entitlements" + }, + protocols: [{ + name: "myappproto", + schemes: [ + "myapp", + "myapp2" + ] + }] +}, callback); diff --git a/types/electron-packager/index.d.ts b/types/electron-packager/index.d.ts index de33fa3499..6e430ecdb2 100644 --- a/types/electron-packager/index.d.ts +++ b/types/electron-packager/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for electron-packager 8.7 +// Type definitions for electron-packager 10.1 // Project: https://github.com/electron-userland/electron-packager // Definitions by: Maxime LUCE // Juan Jimenez-Anca +// John Kleinschmidt // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -31,8 +32,8 @@ declare namespace electronPackager { type ignoreFunction = (path: string) => boolean; type onCompleteFn = (buildPath: string, electronVersion: string, platform: string, arch: string, callbackFn: () => void) => void; - type arch = "ia32" | "x64" | "armv7l" | "all"; - type packageManager = "npm" | "cnpm" | "yarn"; + type arch = "ia32" | "x64" | "armv7l" | "arm64" |"all"; + type packageManager = "npm" | "cnpm" | "yarn" | false; type platform = "linux" | "win32" | "darwin" | "mas" | "all"; interface AsarOptions { @@ -94,7 +95,7 @@ declare namespace electronPackager { * Arbitrary combinations of individual architectures are also supported via a comma-delimited string or array of strings. * The non-all values correspond to the architecture names used by Electron releases. This value is not restricted to the official set if download.mirror is set. */ - arch?: arch; + arch?: arch | arch[]; /** * Whether to package the application's source code into an archive, using Electron's archive format */ @@ -120,6 +121,10 @@ declare namespace electronPackager { * One or more files to be copied directly into the app's Contents/Resources directory for OS X target platforms, and the resources directory for other target platforms. */ extraResource?: string | string[]; + /** + * The name of the executable file, sans file extension. Defaults to the value for the name parameter + */ + executableName?: string; /** * The local path to the icon file, if the target platform supports setting embedding an icon. */ diff --git a/types/electron-packager/tsconfig.json b/types/electron-packager/tsconfig.json index 76f19f8f73..a279fa7571 100644 --- a/types/electron-packager/tsconfig.json +++ b/types/electron-packager/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-settings/tsconfig.json b/types/electron-settings/tsconfig.json index badf76a8d0..655cfc5dc8 100644 --- a/types/electron-settings/tsconfig.json +++ b/types/electron-settings/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-settings/v2/tsconfig.json b/types/electron-settings/v2/tsconfig.json index 810fdbd504..8e5453808e 100644 --- a/types/electron-settings/v2/tsconfig.json +++ b/types/electron-settings/v2/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-spellchecker/tsconfig.json b/types/electron-spellchecker/tsconfig.json index 539cc30156..6494f31e81 100644 --- a/types/electron-spellchecker/tsconfig.json +++ b/types/electron-spellchecker/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "electron-spellchecker-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/electron-store/tsconfig.json b/types/electron-store/tsconfig.json index 6f21caec55..f5eb483b5e 100644 --- a/types/electron-store/tsconfig.json +++ b/types/electron-store/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-util/tsconfig.json b/types/electron-util/tsconfig.json index c65e02a5c7..49206d08cd 100644 --- a/types/electron-util/tsconfig.json +++ b/types/electron-util/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "electron-util-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/electron-window-state/tsconfig.json b/types/electron-window-state/tsconfig.json index 3843443cda..3099f275a8 100644 --- a/types/electron-window-state/tsconfig.json +++ b/types/electron-window-state/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-winstaller/tsconfig.json b/types/electron-winstaller/tsconfig.json index af16777473..41b83013bf 100644 --- a/types/electron-winstaller/tsconfig.json +++ b/types/electron-winstaller/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/element-ready/tsconfig.json b/types/element-ready/tsconfig.json index e5067c7ccf..fcd6b1d926 100644 --- a/types/element-ready/tsconfig.json +++ b/types/element-ready/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/element-resize-detector/tsconfig.json b/types/element-resize-detector/tsconfig.json index 9400053488..919187d401 100644 --- a/types/element-resize-detector/tsconfig.json +++ b/types/element-resize-detector/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "element-resize-detector-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/element-resize-event/tsconfig.json b/types/element-resize-event/tsconfig.json index 9d86e4632f..f0d3918e5a 100644 --- a/types/element-resize-event/tsconfig.json +++ b/types/element-resize-event/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/elm/tsconfig.json b/types/elm/tsconfig.json index bca395d3c2..c82a960fb7 100644 --- a/types/elm/tsconfig.json +++ b/types/elm/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/email-templates/tsconfig.json b/types/email-templates/tsconfig.json index 5a2994bb04..cb8601eaae 100644 --- a/types/email-templates/tsconfig.json +++ b/types/email-templates/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ember-data/index.d.ts b/types/ember-data/index.d.ts index 0ec24fae41..a59ab4de97 100644 --- a/types/ember-data/index.d.ts +++ b/types/ember-data/index.d.ts @@ -208,7 +208,7 @@ declare module "ember-data" { * subclasses are used to indicate specific error states. The following * subclasses are provided: */ - class AdapterError {} + class AdapterError extends Ember.Object {} /** * A `DS.InvalidError` is used by an adapter to signal the external API * was unable to process a request because the content was not @@ -218,27 +218,29 @@ declare module "ember-data" { * transition to the `invalid` state and the errors will be set to the * `errors` property on the record. */ - class InvalidError {} + class InvalidError extends AdapterError { + constructor(errors: any[]); + } /** * A `DS.TimeoutError` is used by an adapter to signal that a request * to the external API has timed out. I.e. no response was received from * the external API within an allowed time period. */ - class TimeoutError {} + class TimeoutError extends AdapterError {} /** * A `DS.AbortError` is used by an adapter to signal that a request to * the external API was aborted. For example, this can occur if the user * navigates away from the current page after a request to the external API * has been initiated but before a response has been received. */ - class AbortError {} + class AbortError extends AdapterError {} /** * A `DS.UnauthorizedError` equates to a HTTP `401 Unauthorized` response * status. It is used by an adapter to signal that a request to the external * API was rejected because authorization is required and has failed or has not * yet been provided. */ - class UnauthorizedError {} + class UnauthorizedError extends AdapterError {} /** * A `DS.ForbiddenError` equates to a HTTP `403 Forbidden` response status. * It is used by an adapter to signal that a request to the external API was @@ -246,13 +248,13 @@ declare module "ember-data" { * provided and is valid, then the authenticated user does not have the * necessary permissions for the request. */ - class ForbiddenError {} + class ForbiddenError extends AdapterError {} /** * A `DS.NotFoundError` equates to a HTTP `404 Not Found` response status. * It is used by an adapter to signal that a request to the external API * was rejected because the resource could not be found on the API. */ - class NotFoundError {} + class NotFoundError extends AdapterError {} /** * A `DS.ConflictError` equates to a HTTP `409 Conflict` response status. * It is used by an adapter to indicate that the request could not be processed @@ -260,13 +262,13 @@ declare module "ember-data" { * creating a record with a client generated id but that id is already known * to the external API. */ - class ConflictError {} + class ConflictError extends AdapterError {} /** * A `DS.ServerError` equates to a HTTP `500 Internal Server Error` response * status. It is used by the adapter to indicate that a request has failed * because of an error in the external API. */ - class ServerError {} + class ServerError extends AdapterError {} /** * Holds validation errors for a given record, organized by attribute names. */ diff --git a/types/ember-data/test/error.ts b/types/ember-data/test/error.ts new file mode 100644 index 0000000000..b8b65ca967 --- /dev/null +++ b/types/ember-data/test/error.ts @@ -0,0 +1,106 @@ +import Ember from 'ember'; +import DS from 'ember-data'; +import { assertType } from './lib/assert'; + +const { AdapterError } = DS; + +// https://emberjs.com/api/ember-data/2.16/classes/DS.AdapterError +const MaintenanceError = DS.AdapterError.extend({ + message: 'Down for maintenance.', +}); +const maintenanceError = new MaintenanceError(); +assertType(maintenanceError); + +// https://emberjs.com/api/ember-data/2.16/classes/DS.InvalidError +const anInvalidError = new DS.InvalidError([ + { + detail: 'Must be unique', + source: { pointer: '/data/attributes/title' }, + }, + { + detail: 'Must not be blank', + source: { pointer: '/data/attributes/content' }, + }, +]); + +// https://emberjs.com/api/ember-data/2.16/classes/DS.TimeoutError +const { TimeoutError } = DS; +const timedOut = Ember.Route.extend({ + actions: { + error(error: any, transition: any) { + if (error instanceof TimeoutError) { + // alert the user + alert('Are you still connected to the internet?'); + return; + } + + // ...other error handling logic + }, + }, +}); + +// This is technically private, but publicly exposed for APIs to use. We just +// check that it is a proper subclass of `AdapterError`. +// https://emberjs.com/api/ember-data/2.16/classes/DS.AbortError +// https://github.com/emberjs/data/blob/v2.16.0/addon/-private/adapters/errors.js#L206-L216 +const { AbortError } = DS; +assertType(AbortError); + +// https://emberjs.com/api/ember-data/2.16/classes/DS.UnauthorizedError +const { UnauthorizedError } = DS; +assertType(UnauthorizedError); +const unauthorized = Ember.Route.extend({ + actions: { + error(error: any, transition: any) { + if (error instanceof UnauthorizedError) { + // go to the sign in route + this.transitionTo('login'); + return; + } + + // ...other error handling logic + }, + }, +}); + +// This is technically private, but publicly exposed for APIs to use. We just +// check that it is a proper subclass of `AdapterError`. +// https://emberjs.com/api/ember-data/2.16/classes/DS.ForbiddenError +// https://github.com/emberjs/data/blob/v2.16.0/addon/-private/adapters/errors.js#L253-L263 +const { ForbiddenError } = DS; +assertType(ForbiddenError); + +// https://emberjs.com/api/ember-data/2.16/classes/DS.NotFoundError +const { NotFoundError } = DS; +assertType(NotFoundError); +const notFound = Ember.Route.extend({ + model(params: { post_id: string }): any { + return this.get('store').findRecord('post', params.post_id); + }, + + actions: { + error(error: any, transition: any): any { + if (error instanceof NotFoundError) { + // redirect to a list of all posts instead + this.transitionTo('posts'); + } else { + // otherwise let the error bubble + return true; + } + }, + }, +}); + +// This is technically private, but publicly exposed for APIs to use. We just +// check that it is a proper subclass of `AdapterError`. +// https://emberjs.com/api/ember-data/2.16/classes/DS.ConflictError +// https://github.com/emberjs/data/blob/v2.16.0/addon/-private/adapters/errors.js#L303-L313 +const { ConflictError } = DS; +assertType(ConflictError); + +// This is technically private, but publicly exposed for APIs to use. We just +// check that it is a proper subclass of `AdapterError`. +// https://emberjs.com/api/ember-data/2.16/classes/DS.ServerError +// https://github.com/emberjs/data/blob/v2.16.0/addon/-private/adapters/errors.js#L315-L323 +const { ServerError } = DS; +assertType(ServerError); diff --git a/types/ember-data/tsconfig.json b/types/ember-data/tsconfig.json index 5f7c297ec7..0845f9e795 100644 --- a/types/ember-data/tsconfig.json +++ b/types/ember-data/tsconfig.json @@ -10,10 +10,13 @@ "strictNullChecks": true, "strictFunctionTypes": false, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -28,6 +31,7 @@ "test/has-many.ts", "test/belongs-to.ts", "test/record-reference.ts", - "test/injections.ts" + "test/injections.ts", + "test/error.ts" ] -} +} \ No newline at end of file diff --git a/types/ember-feature-flags/ember-feature-flags-tests.ts b/types/ember-feature-flags/ember-feature-flags-tests.ts index 063aeea927..bfcfaae62e 100644 --- a/types/ember-feature-flags/ember-feature-flags-tests.ts +++ b/types/ember-feature-flags/ember-feature-flags-tests.ts @@ -1,14 +1,27 @@ import Features from 'ember-feature-flags'; import 'ember-feature-flags/tests/helpers/with-feature'; +/** Static assertion that `value` has type `T` */ +// Disable tslint here b/c the generic is used to let us do a type coercion and +// validate that coercion works for the type value "passed into" the function. +// tslint:disable-next-line:no-unnecessary-generics +export declare function assertType(value: T): void; + +declare module 'ember-feature-flags' { + export default interface Features { + someFeature: boolean; + } +} + // https://www.npmjs.com/package/ember-feature-flags#withfeature declare var features: Features; features.isEnabled('new-billing-plans'); // $ExpectType boolean features.enable('newHomepage'); // $ExpectType void features.disable('newHomepage'); // $ExpectType void const setup = { - "new-billing-plans": true, - "new-homepage": false + 'new-billing-plans': true, + 'new-homepage': false }; features.setup(setup); // $ExpectType void withFeature('new-homepage'); // $ExpectType void +assertType(features.get('someFeature')); diff --git a/types/ember-feature-flags/index.d.ts b/types/ember-feature-flags/index.d.ts index 8aec1a6f0a..94b443afae 100644 --- a/types/ember-feature-flags/index.d.ts +++ b/types/ember-feature-flags/index.d.ts @@ -7,7 +7,7 @@ import Ember from 'ember'; // https://github.com/kategengler/ember-feature-flags/blob/v3.0.0/addon/services/features.js#L5 -export default class Features extends Ember.Service { +export default interface Features extends Ember.Service { setup(features: { [key: string]: boolean }): void; enable(feature: string): void; disable(feature: string): void; diff --git a/types/ember-feature-flags/tsconfig.json b/types/ember-feature-flags/tsconfig.json index 9481eddeb5..d71fce7001 100644 --- a/types/ember-feature-flags/tsconfig.json +++ b/types/ember-feature-flags/tsconfig.json @@ -15,11 +15,12 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "tests/helpers/with-feature.d.ts", "ember-feature-flags-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ember-feature-flags/tslint.json b/types/ember-feature-flags/tslint.json index 3db14f85ea..4c4fc86ace 100644 --- a/types/ember-feature-flags/tslint.json +++ b/types/ember-feature-flags/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "strict-export-declare-modifiers": false + } +} diff --git a/types/ember-mocha/tsconfig.json b/types/ember-mocha/tsconfig.json index e9fdedfe7f..7c2a404282 100644 --- a/types/ember-mocha/tsconfig.json +++ b/types/ember-mocha/tsconfig.json @@ -9,13 +9,16 @@ "strictNullChecks": true, "strictFunctionTypes": false, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ember-mocha-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ember-modal-dialog/tsconfig.json b/types/ember-modal-dialog/tsconfig.json index 8834a9ae3d..1826d665c7 100644 --- a/types/ember-modal-dialog/tsconfig.json +++ b/types/ember-modal-dialog/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ember-modal-dialog-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ember-qunit/tsconfig.json b/types/ember-qunit/tsconfig.json index 1f9e626103..c09b50cd66 100644 --- a/types/ember-qunit/tsconfig.json +++ b/types/ember-qunit/tsconfig.json @@ -10,13 +10,16 @@ "strictNullChecks": true, "strictFunctionTypes": false, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ember-qunit-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ember-qunit/v2/tsconfig.json b/types/ember-qunit/v2/tsconfig.json index e173bc0d73..2d4c3deabd 100644 --- a/types/ember-qunit/v2/tsconfig.json +++ b/types/ember-qunit/v2/tsconfig.json @@ -10,16 +10,21 @@ "strictNullChecks": true, "strictFunctionTypes": false, "baseUrl": "../../", - "typeRoots": ["../../"], + "typeRoots": [ + "../../" + ], "paths": { - "ember-qunit": ["ember-qunit/v2"] + "ember-qunit": [ + "ember-qunit/v2" + ] }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ember-qunit-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ember-test-helpers/tsconfig.json b/types/ember-test-helpers/tsconfig.json index dc9c583d1c..9bd7a250d9 100644 --- a/types/ember-test-helpers/tsconfig.json +++ b/types/ember-test-helpers/tsconfig.json @@ -10,13 +10,16 @@ "strictNullChecks": true, "strictFunctionTypes": false, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ember-test-helpers-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ember-testing-helpers/tsconfig.json b/types/ember-testing-helpers/tsconfig.json index 622d4d1584..8cb8c83838 100644 --- a/types/ember-testing-helpers/tsconfig.json +++ b/types/ember-testing-helpers/tsconfig.json @@ -10,10 +10,13 @@ "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index 238e895e34..22ff839774 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -1111,7 +1111,7 @@ declare module 'ember' { * item. This method corresponds to the `forEach()` method defined in * JavaScript 1.6. */ - forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; + forEach: GlobalArray['forEach']; /** * Alias for `mapBy` */ @@ -1127,7 +1127,7 @@ declare module 'ember' { * Maps all of the items in the enumeration to another value, returning * a new array. This method corresponds to `map()` defined in JavaScript 1.6. */ - map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; + map: GlobalArray['map']; /** * Similar to map, this specialized function returns the value of the named * property on all items in the enumeration. @@ -1138,11 +1138,7 @@ declare module 'ember' { * function returns true for. This method corresponds to `filter()` defined in * JavaScript 1.6. */ - filter( - callbackfn: (value: T, index: number, array: T[]) => value is S, - thisArg?: any - ): S[]; - filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): NativeArray; + filter: GlobalArray['filter']; /** * Returns an array with all of the items in the enumeration where the passed * function returns false. This method is the inverse of filter(). @@ -1165,10 +1161,7 @@ declare module 'ember' { * This method works similar to the `filter()` method defined in JavaScript 1.6 * except that it will stop working on the array once a match is found. */ - find( - predicate: (value: T, index: number, obj: T[]) => boolean, - thisArg?: any - ): T | undefined; + find: GlobalArray['find']; /** * Returns the first item with a property matching the passed value. You * can pass an optional second argument with the target value. Otherwise @@ -1179,10 +1172,7 @@ declare module 'ember' { * Returns `true` if the passed function returns true for every item in the * enumeration. This corresponds with the `every()` method in JavaScript 1.6. */ - every( - callbackfn: (value: T, index: number, array: T[]) => boolean, - thisArg?: any - ): boolean; + every: GlobalArray['every']; /** * Returns `true` if the passed property resolves to the value of the second * argument for all items in the enumerable. This method is often simpler/faster @@ -1205,8 +1195,7 @@ declare module 'ember' { * is a useful way to collect a summary value from an enumeration. This * corresponds to the `reduce()` method defined in JavaScript 1.8. */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + reduce: GlobalArray['reduce']; /** * Invokes the named method on every object in the receiver that * implements it. This method corresponds to the implementation in @@ -1616,32 +1605,6 @@ declare module 'ember' { * __Required.__ You must implement this method to apply this mixin. */ length: number; - - // NOTE: some array polyfill methods are re-declared here because their signatures - // differ between typescript versions 2.4 and 2.6. Since we need to compile against - // both, pick the more recent signature and re-declare it here as a tie-breaker. - - /** - * Returns the first item in the array for which the callback returns true. - * This method works similar to the `filter()` method defined in JavaScript 1.6 - * except that it will stop working on the array once a match is found. - */ - find( - predicate: (value: T, index: number, obj: T[]) => boolean, - thisArg?: any - ): T | undefined; - /** - * This will combine the values of the enumerator into a single value. It - * is a useful way to collect a summary value from an enumeration. This - * corresponds to the `reduce()` method defined in JavaScript 1.8. - */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - filter( - callbackfn: (value: T, index: number, array: T[]) => value is S, - thisArg?: any - ): S[]; - filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): Enumerable; } const NativeArray: Mixin>; /** @@ -1846,7 +1809,7 @@ declare module 'ember' { be useful, for instance, for retrieving async code from the server that is required to enter a route. */ - beforeModel(transition: Transition): Rsvp.Promise; + beforeModel(transition: Transition): any; /** * Returns the controller for a particular route or name. @@ -2207,7 +2170,9 @@ declare module 'ember' { actionContext: any; } const ViewTargetActionSupport: Mixin; - const ViewUtils: {}; // TODO: define interface + const ViewUtils: { + isSimpleClick(event: Event): boolean; + }; // FYI - RSVP source comes from https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/promise.js const RSVP: typeof Rsvp; @@ -3055,10 +3020,12 @@ declare module 'ember' { obj: ComputedProperties, list: K[] ): Pick; + function getProperties(obj: T, list: K[]): Pick; // for dynamic K function getProperties( obj: ComputedProperties, ...list: K[] ): Pick; + function getProperties(obj: T, ...list: K[]): Pick; // for dynamic K /** * A value is blank if it is empty or a whitespace string. */ @@ -3143,6 +3110,7 @@ declare module 'ember' { * object implements the `unknownProperty` method then that will be invoked. */ function get(obj: ComputedProperties, key: K): T[K]; + function get(obj: T, key: K): T[K]; // for dynamic K /** * Retrieves the value of a property from an Object, or a default value in the * case that the property returns `undefined`. @@ -3152,6 +3120,7 @@ declare module 'ember' { key: K, defaultValue: T[K] ): T[K]; + function getWithDefault(obj: T, key: K, defaultValue: T[K]): T[K]; // for dynamic K /** * Sets the value of a property on an object, respecting computed properties * and notifying observers and other listeners of the change. If the @@ -3163,6 +3132,7 @@ declare module 'ember' { key: K, value: V ): V; + function set(obj: T, key: K, value: V): V; // for dynamic K /** * Error-tolerant form of `Ember.set`. Will not blow up if any part of the * chain is `undefined`, `null`, or destroyed. @@ -3177,6 +3147,7 @@ declare module 'ember' { obj: ComputedProperties, hash: Pick ): Pick; + function setProperties(obj: T, hash: Pick): Pick; // for dynamic K /** * Detects when a specific package of Ember (e.g. 'Ember.Application') * has fully loaded and is available for extension. @@ -3313,7 +3284,7 @@ declare module 'ember' { declare module '@ember/application' { import Ember from 'ember'; - export default Ember.Application; + export default class Application extends Ember.Application { } export const getOwner: typeof Ember.getOwner; export const onLoad: typeof Ember.onLoad; export const runLoadHooks: typeof Ember.runLoadHooks; @@ -3328,22 +3299,23 @@ declare module '@ember/application/deprecations' { declare module '@ember/application/globals-resolver' { import Ember from 'ember'; - export default Ember.DefaultResolver; + export default class GlobalsResolver extends Ember.DefaultResolver { } } declare module '@ember/application/instance' { import Ember from 'ember'; - export default Ember.ApplicationInstance; + export default class ApplicationInstance extends Ember.ApplicationInstance { } } declare module '@ember/application/resolver' { import Ember from 'ember'; - export default Ember.Resolver; + export default class Resolver extends Ember.Resolver { } } declare module '@ember/array' { import Ember from 'ember'; - export default Ember.Array; + const EmberArray: typeof Ember.Array; + export default EmberArray; export const A: typeof Ember.A; export const isArray: typeof Ember.isArray; export const makeArray: typeof Ember.makeArray; @@ -3351,43 +3323,44 @@ declare module '@ember/array' { declare module '@ember/array/mutable' { import Ember from 'ember'; - export default Ember.MutableArray; + const MutableArray: typeof Ember.MutableArray; + export default MutableArray; } declare module '@ember/array/proxy' { import Ember from 'ember'; - export default Ember.ArrayProxy; + export default class ArrayProxy extends Ember.ArrayProxy { } } declare module '@ember/component' { import Ember from 'ember'; - export default Ember.Component; + export default class Component extends Ember.Component { } } declare module '@ember/component/checkbox' { import Ember from 'ember'; - export default Ember.Checkbox; + export default class Checkbox extends Ember.Checkbox { } } declare module '@ember/component/helper' { import Ember from 'ember'; - export default Ember.Helper; + export default class Helper extends Ember.Helper { } export const helper: typeof Ember.Helper.helper; } declare module '@ember/component/text-area' { import Ember from 'ember'; - export default Ember.TextArea; + export default class TextArea extends Ember.TextArea { } } declare module '@ember/component/text-field' { import Ember from 'ember'; - export default Ember.TextField; + export default class TextField extends Ember.TextField { } } declare module '@ember/controller' { import Ember from 'ember'; - export default Ember.Controller; + export default class Controller extends Ember.Controller { } export const inject: typeof Ember.inject.controller; } @@ -3404,28 +3377,29 @@ declare module '@ember/debug' { declare module '@ember/debug/container-debug-adapter' { import Ember from 'ember'; - export default Ember.ContainerDebugAdapter; + export default class ContainerDebugAdapter extends Ember.ContainerDebugAdapter { } } declare module '@ember/debug/data-adapter' { import Ember from 'ember'; - export default Ember.DataAdapter; + export default class DataAdapter extends Ember.DataAdapter { } } declare module '@ember/engine' { import Ember from 'ember'; - export default Ember.Engine; + export default class Engine extends Ember.Engine { } export const getEngineParent: typeof Ember.getEngineParent; } declare module '@ember/engine/instance' { import Ember from 'ember'; - export default Ember.EngineInstance; + export default class EngineInstance extends Ember.EngineInstance { } } declare module '@ember/enumerable' { import Ember from 'ember'; - export default Ember.Enumerable; + const Enumerable: typeof Ember.Enumerable; + export default Enumerable; } declare module '@ember/instrumentation' { @@ -3438,17 +3412,17 @@ declare module '@ember/instrumentation' { declare module '@ember/map' { import Ember from 'ember'; - export default Ember.Map; + export default class EmberMap extends Ember.Map { } } declare module '@ember/map/with-default' { import Ember from 'ember'; - export default Ember.MapWithDefault; + export default class MapWithDefault extends Ember.MapWithDefault { } } declare module '@ember/object' { import Ember from 'ember'; - export default Ember.Object; + export default class EmberObject extends Ember.Object { } export const aliasMethod: typeof Ember.aliasMethod; export const computed: typeof Ember.computed; export const defineProperty: typeof Ember.defineProperty; @@ -3463,7 +3437,7 @@ declare module '@ember/object' { declare module '@ember/object/computed' { import Ember from 'ember'; - export default Ember.ComputedProperty; + export default class ComputedProperty extends Ember.ComputedProperty { } export const alias: typeof Ember.computed.alias; export const and: typeof Ember.computed.and; export const bool: typeof Ember.computed.bool; @@ -3501,12 +3475,13 @@ declare module '@ember/object/computed' { declare module '@ember/object/core' { import Ember from 'ember'; - export default Ember.CoreObject; + export default class CoreObject extends Ember.CoreObject { } } declare module '@ember/object/evented' { import Ember from 'ember'; - export default Ember.Evented; + const Evented: typeof Ember.Evented; + export default Evented; export const on: typeof Ember.on; } @@ -3526,12 +3501,14 @@ declare module '@ember/object/internals' { declare module '@ember/object/mixin' { import Ember from 'ember'; - export default Ember.Mixin; + const Mixin: typeof Ember.Mixin; + export default Mixin; } declare module '@ember/object/observable' { import Ember from 'ember'; - export default Ember.Observable; + const Observable: typeof Ember.Observable; + export default Observable; } declare module '@ember/object/observers' { @@ -3542,12 +3519,13 @@ declare module '@ember/object/observers' { declare module '@ember/object/promise-proxy-mixin' { import Ember from 'ember'; - export default Ember.PromiseProxyMixin; + const PromiseProxyMixin: typeof Ember.PromiseProxyMixin; + export default PromiseProxyMixin; } declare module '@ember/object/proxy' { import Ember from 'ember'; - export default Ember.ObjectProxy; + export default class ObjectProxy extends Ember.ObjectProxy { } } declare module '@ember/polyfills' { @@ -3561,42 +3539,43 @@ declare module '@ember/polyfills' { declare module '@ember/routing/auto-location' { import Ember from 'ember'; - export default Ember.AutoLocation; + export default class AutoLocation extends Ember.AutoLocation { } } declare module '@ember/routing/hash-location' { import Ember from 'ember'; - export default Ember.HashLocation; + export default class HashLocation extends Ember.HashLocation { } } declare module '@ember/routing/history-location' { import Ember from 'ember'; - export default Ember.HistoryLocation; + export default class HistoryLocation extends Ember.HistoryLocation { } } declare module '@ember/routing/link-component' { import Ember from 'ember'; - export default Ember.LinkComponent; + export default class LinkComponent extends Ember.LinkComponent { } } declare module '@ember/routing/location' { import Ember from 'ember'; - export default Ember.Location; + const Location: typeof Ember.Location; + export default Location; } declare module '@ember/routing/none-location' { import Ember from 'ember'; - export default Ember.NoneLocation; + export default class NoneLocation extends Ember.NoneLocation { } } declare module '@ember/routing/route' { import Ember from 'ember'; - export default Ember.Route; + export default class Route extends Ember.Route { } } declare module '@ember/routing/router' { import Ember from 'ember'; - export default Ember.Router; + export default class EmberRouter extends Ember.Router { } } declare module '@ember/runloop' { @@ -3618,7 +3597,7 @@ declare module '@ember/runloop' { declare module '@ember/service' { import Ember from 'ember'; - export default Ember.Service; + export default class Service extends Ember.Service { } export const inject: typeof Ember.inject.service; } @@ -3648,7 +3627,7 @@ declare module '@ember/test' { declare module '@ember/test/adapter' { import Ember from 'ember'; - export default Ember.Test.Adapter; + export default class TestAdapter extends Ember.Test.Adapter { } } declare module '@ember/utils' { diff --git a/types/ember/test/observable.ts b/types/ember/test/observable.ts index 680b6decf7..cf871807b2 100755 --- a/types/ember/test/observable.ts +++ b/types/ember/test/observable.ts @@ -86,3 +86,21 @@ function testSetProperties() { assertType<{ name: string, capitalized: string }>(person.setProperties({ name: 'Joe', capitalized: 'JOE' })); assertType<{ name: string, age: number }>(Ember.setProperties(pojo, { name: 'Joe', age: 35 })); } + +function testDynamic() { + const obj: any = {}; + const dynamicKey: string = 'dummy'; // tslint:disable-line:no-inferrable-types + + assertType(Ember.get(obj, 'dummy')); + assertType(Ember.get(obj, dynamicKey)); + assertType(Ember.getWithDefault(obj, 'dummy', 'default')); + assertType(Ember.getWithDefault(obj, dynamicKey, 'default')); + assertType<{ dummy: any }>(Ember.getProperties(obj, 'dummy')); + assertType<{ dummy: any }>(Ember.getProperties(obj, [ 'dummy' ])); + assertType(Ember.getProperties(obj, dynamicKey)); + assertType(Ember.getProperties(obj, [ dynamicKey ])); + assertType(Ember.set(obj, 'dummy', 'value')); + assertType(Ember.set(obj, dynamicKey, 'value')); + assertType<{ dummy: string }>(Ember.setProperties(obj, { dummy: 'value '})); + assertType(Ember.setProperties(obj, { [dynamicKey]: 'value' })); +} diff --git a/types/ember/test/route.ts b/types/ember/test/route.ts index 22193bd88d..fad5bbc634 100755 --- a/types/ember/test/route.ts +++ b/types/ember/test/route.ts @@ -85,3 +85,11 @@ Route.extend({ this.controllerFor('application').set('model', model); }, }); + +class RouteUsingClass extends Route.extend({ + randomProperty: 'the .extend + extends bit type-checks properly', +}) { + beforeModel(this: RouteUsingClass) { + return 'beforeModel can return anything, not just promises'; + } +} diff --git a/types/ember/test/view-utils.ts b/types/ember/test/view-utils.ts new file mode 100644 index 0000000000..a3613064eb --- /dev/null +++ b/types/ember/test/view-utils.ts @@ -0,0 +1,5 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +const { ViewUtils: { isSimpleClick } } = Ember; +assertType(isSimpleClick(new Event('wat'))); diff --git a/types/ember/tsconfig.json b/types/ember/tsconfig.json index c0aab2e780..d8580b0760 100755 --- a/types/ember/tsconfig.json +++ b/types/ember/tsconfig.json @@ -11,10 +11,13 @@ "strictNullChecks": true, "strictFunctionTypes": false, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -44,6 +47,7 @@ "test/run.ts", "test/test.ts", "test/controller.ts", - "test/route.ts" + "test/route.ts", + "test/view-utils.ts" ] -} +} \ No newline at end of file diff --git a/types/ember/tslint.json b/types/ember/tslint.json index 35e8f3768a..7069614893 100755 --- a/types/ember/tslint.json +++ b/types/ember/tslint.json @@ -23,7 +23,10 @@ "no-void-expression": false, "only-arrow-functions": false, "no-submodule-imports": false, - - "no-unnecessary-class": false + + "no-unnecessary-class": false, + + // false positives + "unified-signatures": false } } diff --git a/types/ember/v1/tsconfig.json b/types/ember/v1/tsconfig.json index 7be1f0660b..c817172bbf 100644 --- a/types/ember/v1/tsconfig.json +++ b/types/ember/v1/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/emissary/tsconfig.json b/types/emissary/tsconfig.json index b6d04f07a7..b8d3d5241a 100644 --- a/types/emissary/tsconfig.json +++ b/types/emissary/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/emoji-mart/tsconfig.json b/types/emoji-mart/tsconfig.json index fb776e9a21..b0e8df2d67 100644 --- a/types/emoji-mart/tsconfig.json +++ b/types/emoji-mart/tsconfig.json @@ -15,6 +15,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "react" }, "files": [ @@ -29,4 +30,4 @@ "dist-es/index.d.ts", "emoji-mart-tests.tsx" ] -} +} \ No newline at end of file diff --git a/types/emojione/tsconfig.json b/types/emojione/tsconfig.json index f74fb50d6f..3dc6a32fc9 100644 --- a/types/emojione/tsconfig.json +++ b/types/emojione/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/empower/tsconfig.json b/types/empower/tsconfig.json index 9d9d553fc0..ac5a3bd4d8 100644 --- a/types/empower/tsconfig.json +++ b/types/empower/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/emscripten/tsconfig.json b/types/emscripten/tsconfig.json index d17ea9a00a..55db0defd3 100644 --- a/types/emscripten/tsconfig.json +++ b/types/emscripten/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/encoding-japanese/tsconfig.json b/types/encoding-japanese/tsconfig.json index b3b7a2861f..90acb7e3aa 100644 --- a/types/encoding-japanese/tsconfig.json +++ b/types/encoding-japanese/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/end-of-stream/end-of-stream-tests.ts b/types/end-of-stream/end-of-stream-tests.ts index 211c6f5196..829a177d5c 100644 --- a/types/end-of-stream/end-of-stream-tests.ts +++ b/types/end-of-stream/end-of-stream-tests.ts @@ -1,4 +1,4 @@ -import * as eos from "end-of-stream"; +import eos = require("end-of-stream"); declare const readableStream: NodeJS.ReadableStream; declare const writableStream: NodeJS.WritableStream; diff --git a/types/end-of-stream/tsconfig.json b/types/end-of-stream/tsconfig.json index b46ee0c768..10cf712c76 100644 --- a/types/end-of-stream/tsconfig.json +++ b/types/end-of-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/engine.io-client/tsconfig.json b/types/engine.io-client/tsconfig.json index cb3a024a3e..e473bfebe5 100644 --- a/types/engine.io-client/tsconfig.json +++ b/types/engine.io-client/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/engine.io/tsconfig.json b/types/engine.io/tsconfig.json index b31b3394b0..5e35fcea3a 100644 --- a/types/engine.io/tsconfig.json +++ b/types/engine.io/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/enhanced-resolve/tsconfig.json b/types/enhanced-resolve/tsconfig.json index 9c87f7e7a1..784aadf889 100644 --- a/types/enhanced-resolve/tsconfig.json +++ b/types/enhanced-resolve/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/enigma.js/tsconfig.json b/types/enigma.js/tsconfig.json index b3b93456f0..10d59e2fab 100644 --- a/types/enigma.js/tsconfig.json +++ b/types/enigma.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ent/tsconfig.json b/types/ent/tsconfig.json index 53249c7605..ff83547680 100644 --- a/types/ent/tsconfig.json +++ b/types/ent/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/entities/tsconfig.json b/types/entities/tsconfig.json index 1a88ad9778..90c9f78f64 100644 --- a/types/entities/tsconfig.json +++ b/types/entities/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/env-to-object/tsconfig.json b/types/env-to-object/tsconfig.json index 2e59eff3e4..9154d82826 100644 --- a/types/env-to-object/tsconfig.json +++ b/types/env-to-object/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/envify/tsconfig.json b/types/envify/tsconfig.json index 381ca464c9..bfa88f845a 100644 --- a/types/envify/tsconfig.json +++ b/types/envify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/enzyme-adapter-react-15.4/enzyme-adapter-react-15.4-tests.ts b/types/enzyme-adapter-react-15.4/enzyme-adapter-react-15.4-tests.ts new file mode 100644 index 0000000000..af26532174 --- /dev/null +++ b/types/enzyme-adapter-react-15.4/enzyme-adapter-react-15.4-tests.ts @@ -0,0 +1,4 @@ +import { configure } from 'enzyme'; +import Adapter = require('enzyme-adapter-react-15.4'); + +configure({ adapter: new Adapter() }); diff --git a/types/enzyme-adapter-react-15.4/index.d.ts b/types/enzyme-adapter-react-15.4/index.d.ts new file mode 100644 index 0000000000..115f8de677 --- /dev/null +++ b/types/enzyme-adapter-react-15.4/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for enzyme-adapter-react-15.4 1.0 +// Project: http://airbnb.io/enzyme/ +// Definitions by: Nabeelah Ali +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { EnzymeAdapter } from 'enzyme'; + +declare class ReactFifteenFourAdapter extends EnzymeAdapter { +} + +declare namespace ReactFifteenFourAdapter { +} + +export = ReactFifteenFourAdapter; diff --git a/types/enzyme-adapter-react-15.4/tsconfig.json b/types/enzyme-adapter-react-15.4/tsconfig.json new file mode 100644 index 0000000000..51543ab615 --- /dev/null +++ b/types/enzyme-adapter-react-15.4/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "enzyme-adapter-react-15.4-tests.ts" + ] +} \ No newline at end of file diff --git a/types/enzyme-adapter-react-15.4/tslint.json b/types/enzyme-adapter-react-15.4/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/enzyme-adapter-react-15.4/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/enzyme-adapter-react-15/enzyme-adapter-react-15-tests.ts b/types/enzyme-adapter-react-15/enzyme-adapter-react-15-tests.ts index 9be474c2d8..fa3c9a357a 100644 --- a/types/enzyme-adapter-react-15/enzyme-adapter-react-15-tests.ts +++ b/types/enzyme-adapter-react-15/enzyme-adapter-react-15-tests.ts @@ -1,4 +1,4 @@ import { configure } from 'enzyme'; -import * as Adapter from 'enzyme-adapter-react-15'; +import Adapter = require('enzyme-adapter-react-15'); configure({ adapter: new Adapter() }); diff --git a/types/enzyme-adapter-react-15/tsconfig.json b/types/enzyme-adapter-react-15/tsconfig.json index 23f0d0d292..fbd8458aac 100644 --- a/types/enzyme-adapter-react-15/tsconfig.json +++ b/types/enzyme-adapter-react-15/tsconfig.json @@ -1,21 +1,27 @@ { - "compilerOptions": { - "baseUrl": "../", - "typeRoots": ["../"], - "types": [], - "module": "commonjs", - "lib": ["es6", "dom"], - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "forceConsistentCasingInFileNames": true, - "noEmit": true - }, - "files": [ - "index.d.ts", - "enzyme-adapter-react-15-tests.ts" - ] -} + "compilerOptions": { + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "enzyme-adapter-react-15-tests.ts" + ] +} \ No newline at end of file diff --git a/types/enzyme-adapter-react-16/enzyme-adapter-react-16-tests.ts b/types/enzyme-adapter-react-16/enzyme-adapter-react-16-tests.ts index b8acf7f719..8b53ed9dc7 100644 --- a/types/enzyme-adapter-react-16/enzyme-adapter-react-16-tests.ts +++ b/types/enzyme-adapter-react-16/enzyme-adapter-react-16-tests.ts @@ -1,4 +1,4 @@ import { configure } from 'enzyme'; -import * as Adapter from 'enzyme-adapter-react-16'; +import Adapter = require('enzyme-adapter-react-16'); configure({ adapter: new Adapter() }); diff --git a/types/enzyme-adapter-react-16/tsconfig.json b/types/enzyme-adapter-react-16/tsconfig.json index 1c1c8e15f9..2f1b7b089c 100644 --- a/types/enzyme-adapter-react-16/tsconfig.json +++ b/types/enzyme-adapter-react-16/tsconfig.json @@ -1,21 +1,27 @@ { - "compilerOptions": { - "baseUrl": "../", - "typeRoots": ["../"], - "types": [], - "module": "commonjs", - "lib": ["es6", "dom"], - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "forceConsistentCasingInFileNames": true, - "noEmit": true - }, - "files": [ - "index.d.ts", - "enzyme-adapter-react-16-tests.ts" - ] -} + "compilerOptions": { + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "enzyme-adapter-react-16-tests.ts" + ] +} \ No newline at end of file diff --git a/types/enzyme-to-json/tsconfig.json b/types/enzyme-to-json/tsconfig.json index 948a88349a..be2b7c3113 100644 --- a/types/enzyme-to-json/tsconfig.json +++ b/types/enzyme-to-json/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/enzyme/enzyme-tests.tsx b/types/enzyme/enzyme-tests.tsx index c48c050357..50f9bf3f38 100644 --- a/types/enzyme/enzyme-tests.tsx +++ b/types/enzyme/enzyme-tests.tsx @@ -17,10 +17,19 @@ interface MyComponentProps { numberProp?: number; } +interface AnotherComponentProps { + anotherStringProp?: string; + anotherNumberProp?: number; +} + interface StatelessProps { stateless: string; } +interface AnotherStatelessProps { + anotherStateless: string; +} + interface MyComponentState { stateProperty: string; } @@ -31,8 +40,16 @@ class MyComponent extends Component { } } +class AnotherComponent extends Component { + setState(...args: any[]) { + console.log(args); + } +} + const MyStatelessComponent = (props: StatelessProps) => ; +const AnotherStatelessComponent = (props: AnotherStatelessProps) => ; + // Enzyme.configure function configureTest() { const configureAdapter: { adapter: EnzymeAdapter } = { adapter: {} }; @@ -57,7 +74,8 @@ function ShallowWrapperTest() { let stringVal: string; let numOrStringVal: number | string; let elementWrapper: ShallowWrapper>; - let statelessWrapper: ShallowWrapper; + let anotherStatelessWrapper: ShallowWrapper; + let anotherComponentWrapper: ShallowWrapper; function test_props_state_inferring() { let wrapper: ShallowWrapper; @@ -77,8 +95,8 @@ function ShallowWrapperTest() { } function test_find() { - shallowWrapper = shallowWrapper.find(MyComponent); - statelessWrapper = shallowWrapper.find(MyStatelessComponent); + anotherComponentWrapper = shallowWrapper.find(AnotherComponent); + anotherStatelessWrapper = shallowWrapper.find(AnotherStatelessComponent); shallowWrapper = shallowWrapper.find({ prop: 'value' }); elementWrapper = shallowWrapper.find('.selector'); } @@ -89,8 +107,13 @@ function ShallowWrapperTest() { } function test_filter() { - shallowWrapper = shallowWrapper.filter(MyComponent); - statelessWrapper = statelessWrapper.filter(MyStatelessComponent); + anotherComponentWrapper = shallowWrapper.filter(AnotherComponent); + anotherStatelessWrapper = shallowWrapper.filter(AnotherStatelessComponent); + // NOTE: The following calls to filter do not narrow down the possible type of the result based + // on the type of the param, so the return type should not be different than the original + // "this". This is a special case for "filter" vs other methods like "find", because "filter" + // is guaranteed to return only a subset of the existing list of components/elements without + // finding/adding more. shallowWrapper = shallowWrapper.filter({ numberProp: 12 }); shallowWrapper = shallowWrapper.filter('.selector'); } @@ -165,8 +188,8 @@ function ShallowWrapperTest() { function test_children() { shallowWrapper = shallowWrapper.children(); - shallowWrapper = shallowWrapper.children(MyComponent); - statelessWrapper = shallowWrapper.children(MyStatelessComponent); + anotherComponentWrapper = shallowWrapper.children(AnotherComponent); + anotherStatelessWrapper = shallowWrapper.children(AnotherStatelessComponent); shallowWrapper = shallowWrapper.children({ prop: 'value' }); elementWrapper = shallowWrapper.children('.selector'); } @@ -187,8 +210,8 @@ function ShallowWrapperTest() { function test_parents() { shallowWrapper = shallowWrapper.parents(); - shallowWrapper = shallowWrapper.parents(MyComponent); - statelessWrapper = shallowWrapper.parents(MyStatelessComponent); + anotherComponentWrapper = shallowWrapper.parents(AnotherComponent); + anotherStatelessWrapper = shallowWrapper.parents(AnotherStatelessComponent); shallowWrapper = shallowWrapper.parents({ prop: 'myprop' }); elementWrapper = shallowWrapper.parents('.selector'); } @@ -198,8 +221,8 @@ function ShallowWrapperTest() { } function test_closest() { - shallowWrapper = shallowWrapper.closest(MyComponent); - statelessWrapper = shallowWrapper.closest(MyStatelessComponent); + anotherComponentWrapper = shallowWrapper.closest(AnotherComponent); + anotherStatelessWrapper = shallowWrapper.closest(AnotherStatelessComponent); shallowWrapper = shallowWrapper.closest({ prop: 'myprop' }); elementWrapper = shallowWrapper.closest('.selector'); } @@ -280,8 +303,8 @@ function ShallowWrapperTest() { function test_props() { const props: MyComponentProps = shallowWrapper.props(); - const props2: MyComponentProps = shallowWrapper.find(MyComponent).props(); - const props3: StatelessProps = shallowWrapper.find(MyStatelessComponent).props(); + const props2: AnotherComponentProps = shallowWrapper.find(AnotherComponent).props(); + const props3: AnotherStatelessProps = shallowWrapper.find(AnotherStatelessComponent).props(); const props4: HTMLAttributes = shallowWrapper.find('.selector').props(); } @@ -357,8 +380,8 @@ function ShallowWrapperTest() { } function test_some() { - boolVal = shallowWrapper.some(MyComponent); - boolVal = shallowWrapper.some(MyStatelessComponent); + boolVal = shallowWrapper.some(AnotherComponent); + boolVal = shallowWrapper.some(AnotherStatelessComponent); boolVal = shallowWrapper.some({ prop: 'myprop' }); boolVal = shallowWrapper.some('.selector'); } @@ -368,8 +391,8 @@ function ShallowWrapperTest() { } function test_every() { - boolVal = shallowWrapper.every(MyComponent); - boolVal = shallowWrapper.every(MyStatelessComponent); + boolVal = shallowWrapper.every(AnotherComponent); + boolVal = shallowWrapper.every(AnotherStatelessComponent); boolVal = shallowWrapper.every({ prop: 'myprop' }); boolVal = shallowWrapper.every('.selector'); } @@ -409,7 +432,8 @@ function ReactWrapperTest() { let boolVal: boolean; let stringVal: string; let elementWrapper: ReactWrapper>; - let statelessWrapper: ReactWrapper; + let anotherStatelessWrapper: ReactWrapper; + let anotherComponentWrapper: ReactWrapper; function test_prop_state_inferring() { let wrapper: ReactWrapper; @@ -457,8 +481,8 @@ function ReactWrapperTest() { function test_find() { elementWrapper = reactWrapper.find('.selector'); - reactWrapper = reactWrapper.find(MyComponent); - statelessWrapper = reactWrapper.find(MyStatelessComponent); + anotherComponentWrapper = reactWrapper.find(AnotherComponent); + anotherStatelessWrapper = reactWrapper.find(AnotherStatelessComponent); reactWrapper = reactWrapper.find({ prop: 'myprop' }); } @@ -468,8 +492,13 @@ function ReactWrapperTest() { } function test_filter() { - reactWrapper = reactWrapper.filter(MyComponent); - statelessWrapper = statelessWrapper.filter(MyStatelessComponent); + anotherComponentWrapper = reactWrapper.filter(AnotherComponent); + anotherStatelessWrapper = reactWrapper.filter(AnotherStatelessComponent); + // NOTE: The following calls to filter do not narrow down the possible type of the result based + // on the type of the param, so the return type should not be different than the original + // "this". This is a special case for "filter" vs other methods like "find", because "filter" + // is guaranteed to return only a subset of the existing list of components/elements without + // finding/adding more. reactWrapper = reactWrapper.filter({ numberProp: 12 }); reactWrapper = reactWrapper.filter('.selector'); } @@ -524,8 +553,8 @@ function ReactWrapperTest() { function test_children() { reactWrapper = reactWrapper.children(); - reactWrapper = reactWrapper.children(MyComponent); - statelessWrapper = reactWrapper.children(MyStatelessComponent); + anotherComponentWrapper = reactWrapper.children(AnotherComponent); + anotherStatelessWrapper = reactWrapper.children(AnotherStatelessComponent); reactWrapper = reactWrapper.children({ prop: 'myprop' }); elementWrapper = reactWrapper.children('.selector'); } @@ -546,8 +575,8 @@ function ReactWrapperTest() { function test_parents() { reactWrapper = reactWrapper.parents(); - reactWrapper = reactWrapper.parents(MyComponent); - statelessWrapper = reactWrapper.parents(MyStatelessComponent); + anotherComponentWrapper = reactWrapper.parents(AnotherComponent); + anotherStatelessWrapper = reactWrapper.parents(AnotherStatelessComponent); reactWrapper = reactWrapper.parents({ prop: 'myprop' }); elementWrapper = reactWrapper.parents('.selector'); } @@ -557,8 +586,8 @@ function ReactWrapperTest() { } function test_closest() { - reactWrapper = reactWrapper.closest(MyComponent); - statelessWrapper = reactWrapper.closest(MyStatelessComponent); + anotherComponentWrapper = reactWrapper.closest(AnotherComponent); + anotherStatelessWrapper = reactWrapper.closest(AnotherStatelessComponent); reactWrapper = reactWrapper.closest({ prop: 'myprop' }); elementWrapper = reactWrapper.closest('.selector'); } @@ -631,8 +660,8 @@ function ReactWrapperTest() { function test_props() { const props: MyComponentProps = reactWrapper.props(); - const props2: MyComponentProps = reactWrapper.find(MyComponent).props(); - const props3: StatelessProps = reactWrapper.find(MyStatelessComponent).props(); + const props2: AnotherComponentProps = reactWrapper.find(AnotherComponent).props(); + const props3: AnotherStatelessProps = reactWrapper.find(AnotherStatelessComponent).props(); const props4: HTMLAttributes = reactWrapper.find('.selector').props(); } @@ -708,8 +737,8 @@ function ReactWrapperTest() { } function test_some() { - boolVal = reactWrapper.some(MyComponent); - boolVal = reactWrapper.some(MyStatelessComponent); + boolVal = reactWrapper.some(AnotherComponent); + boolVal = reactWrapper.some(AnotherStatelessComponent); boolVal = reactWrapper.some({ prop: 'myprop' }); boolVal = reactWrapper.some('.selector'); } @@ -719,8 +748,8 @@ function ReactWrapperTest() { } function test_every() { - boolVal = reactWrapper.every(MyComponent); - boolVal = reactWrapper.every(MyStatelessComponent); + boolVal = reactWrapper.every(AnotherComponent); + boolVal = reactWrapper.every(AnotherStatelessComponent); boolVal = reactWrapper.every({ prop: 'myprop' }); boolVal = reactWrapper.every('.selector'); } diff --git a/types/enzyme/index.d.ts b/types/enzyme/index.d.ts index 0568a852f7..d23af4ab04 100644 --- a/types/enzyme/index.d.ts +++ b/types/enzyme/index.d.ts @@ -373,8 +373,9 @@ export class ShallowWrapper

{ * Removes nodes in the current wrapper that do not match the provided selector. * @param selector The selector to match. */ - filter(component: ComponentClass | StatelessComponent): this; - filter(selector: Partial

| string): this; + filter(component: ComponentClass): ShallowWrapper; + filter(statelessComponent: StatelessComponent): ShallowWrapper; + filter(props: EnzymePropSelector | string): ShallowWrapper; /** * Finds every node in the render tree that returns true for the provided predicate function. @@ -492,8 +493,9 @@ export class ReactWrapper

{ * Removes nodes in the current wrapper that do not match the provided selector. * @param selector The selector to match. */ - filter(component: ComponentClass | StatelessComponent): this; - filter(props: Partial

| string): this; + filter(component: ComponentClass): ReactWrapper; + filter(statelessComponent: StatelessComponent): ReactWrapper; + filter(props: EnzymePropSelector | string): ReactWrapper; /** * Returns a new wrapper with all of the children of the node(s) in the current wrapper. Optionally, a selector diff --git a/types/enzyme/tsconfig.json b/types/enzyme/tsconfig.json index 096b64a111..f8618a73da 100644 --- a/types/enzyme/tsconfig.json +++ b/types/enzyme/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/eonasdan-bootstrap-datetimepicker/tsconfig.json b/types/eonasdan-bootstrap-datetimepicker/tsconfig.json index d2f659f25f..ae702872b6 100644 --- a/types/eonasdan-bootstrap-datetimepicker/tsconfig.json +++ b/types/eonasdan-bootstrap-datetimepicker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/eonasdan-bootstrap-datetimepicker/tslint.json b/types/eonasdan-bootstrap-datetimepicker/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/eonasdan-bootstrap-datetimepicker/tslint.json +++ b/types/eonasdan-bootstrap-datetimepicker/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/epiceditor/tsconfig.json b/types/epiceditor/tsconfig.json index ccd9f7cce0..2d3338100c 100644 --- a/types/epiceditor/tsconfig.json +++ b/types/epiceditor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/epilogue/epilogue-tests.ts b/types/epilogue/epilogue-tests.ts index 0cf40fd1e9..cff716f780 100644 --- a/types/epilogue/epilogue-tests.ts +++ b/types/epilogue/epilogue-tests.ts @@ -1,6 +1,6 @@ import * as epilogue from 'epilogue'; -import * as express from 'express'; -import * as Sequelize from 'sequelize'; +import express = require('express'); +import Sequelize = require('sequelize'); const database = new Sequelize({ }); diff --git a/types/epilogue/tsconfig.json b/types/epilogue/tsconfig.json index 593077c6bc..ab9ee2a292 100644 --- a/types/epilogue/tsconfig.json +++ b/types/epilogue/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "epilogue-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/epub/tsconfig.json b/types/epub/tsconfig.json index 90ba263b21..35b9ccc362 100644 --- a/types/epub/tsconfig.json +++ b/types/epub/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/eq.js/tsconfig.json b/types/eq.js/tsconfig.json index 3d35e3fefa..1fa222c5f8 100644 --- a/types/eq.js/tsconfig.json +++ b/types/eq.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/errorhandler/errorhandler-tests.ts b/types/errorhandler/errorhandler-tests.ts index f6a35dd19d..3f8ada3372 100644 --- a/types/errorhandler/errorhandler-tests.ts +++ b/types/errorhandler/errorhandler-tests.ts @@ -1,6 +1,5 @@ - -import * as express from 'express'; -import * as errorhandler from 'errorhandler'; +import express = require('express'); +import errorhandler = require('errorhandler'); var app = express(); diff --git a/types/errorhandler/tsconfig.json b/types/errorhandler/tsconfig.json index dc08f31d21..d827ee2b51 100644 --- a/types/errorhandler/tsconfig.json +++ b/types/errorhandler/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/es6-collections/tsconfig.json b/types/es6-collections/tsconfig.json index c2b2ba64d7..4297f94f93 100644 --- a/types/es6-collections/tsconfig.json +++ b/types/es6-collections/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/es6-promisify/tsconfig.json b/types/es6-promisify/tsconfig.json index 707e6094d3..ad7eafa8c2 100644 --- a/types/es6-promisify/tsconfig.json +++ b/types/es6-promisify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/es6-shim/tsconfig.json b/types/es6-shim/tsconfig.json index f11dcede04..54aeed6ac4 100644 --- a/types/es6-shim/tsconfig.json +++ b/types/es6-shim/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/es6-weak-map/tsconfig.json b/types/es6-weak-map/tsconfig.json index 2652a8f513..4c0232519a 100644 --- a/types/es6-weak-map/tsconfig.json +++ b/types/es6-weak-map/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/escape-html/tsconfig.json b/types/escape-html/tsconfig.json index 336fcb1583..34e696e44e 100644 --- a/types/escape-html/tsconfig.json +++ b/types/escape-html/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/escape-latex/tsconfig.json b/types/escape-latex/tsconfig.json index 2c782b99a5..1484ee5040 100644 --- a/types/escape-latex/tsconfig.json +++ b/types/escape-latex/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/escape-string-regexp/tsconfig.json b/types/escape-string-regexp/tsconfig.json index 46d2b8fec7..30e6ca0344 100644 --- a/types/escape-string-regexp/tsconfig.json +++ b/types/escape-string-regexp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/escodegen/tsconfig.json b/types/escodegen/tsconfig.json index 4755f2604a..9256804b2a 100644 --- a/types/escodegen/tsconfig.json +++ b/types/escodegen/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/eslint-plugin-prettier/tsconfig.json b/types/eslint-plugin-prettier/tsconfig.json index 67ba3c86f6..a04dd71953 100644 --- a/types/eslint-plugin-prettier/tsconfig.json +++ b/types/eslint-plugin-prettier/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/esprima-walk/tsconfig.json b/types/esprima-walk/tsconfig.json index 7314e2d509..db6207d8ff 100644 --- a/types/esprima-walk/tsconfig.json +++ b/types/esprima-walk/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/esprima/tsconfig.json b/types/esprima/tsconfig.json index 2ac3b4bb46..16cac910ee 100644 --- a/types/esprima/tsconfig.json +++ b/types/esprima/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/esprima/v2/tsconfig.json b/types/esprima/v2/tsconfig.json index a3c195ca3c..ff4deff6d5 100644 --- a/types/esprima/v2/tsconfig.json +++ b/types/esprima/v2/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/espruino/tsconfig.json b/types/espruino/tsconfig.json index 38bb3dfd03..9766072d18 100644 --- a/types/espruino/tsconfig.json +++ b/types/espruino/tsconfig.json @@ -2,8 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es2015", - "dom" + "es2015", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "espruino-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/esri-leaflet-geocoder/tsconfig.json b/types/esri-leaflet-geocoder/tsconfig.json index 6bdfac4c4d..ef48041716 100644 --- a/types/esri-leaflet-geocoder/tsconfig.json +++ b/types/esri-leaflet-geocoder/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/esri-leaflet/tsconfig.json b/types/esri-leaflet/tsconfig.json index 596c74f0a2..adfbf16e8b 100644 --- a/types/esri-leaflet/tsconfig.json +++ b/types/esri-leaflet/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/estraverse/tsconfig.json b/types/estraverse/tsconfig.json index 0a199a8857..d69033219b 100644 --- a/types/estraverse/tsconfig.json +++ b/types/estraverse/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/estree/tsconfig.json b/types/estree/tsconfig.json index 9e10c93348..d840cbe748 100644 --- a/types/estree/tsconfig.json +++ b/types/estree/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/etag/tsconfig.json b/types/etag/tsconfig.json index 5df46bdfe9..692a356590 100644 --- a/types/etag/tsconfig.json +++ b/types/etag/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ethjs-signer/tsconfig.json b/types/ethjs-signer/tsconfig.json index b9548b9847..c68bd2742f 100644 --- a/types/ethjs-signer/tsconfig.json +++ b/types/ethjs-signer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/eureka-js-client/tsconfig.json b/types/eureka-js-client/tsconfig.json index 8a981b029d..0863854329 100644 --- a/types/eureka-js-client/tsconfig.json +++ b/types/eureka-js-client/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/evaporate/tsconfig.json b/types/evaporate/tsconfig.json index 9164730455..5fb5abffa1 100644 --- a/types/evaporate/tsconfig.json +++ b/types/evaporate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/event-emitter/tsconfig.json b/types/event-emitter/tsconfig.json index ef667ae292..8e8bbb8316 100644 --- a/types/event-emitter/tsconfig.json +++ b/types/event-emitter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "all-off.d.ts", diff --git a/types/event-kit/tsconfig.json b/types/event-kit/tsconfig.json index 0b6a81c5f8..b83f78d573 100644 --- a/types/event-kit/tsconfig.json +++ b/types/event-kit/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "event-kit-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/event-loop-lag/tsconfig.json b/types/event-loop-lag/tsconfig.json index 39962c46ae..0a80b389ad 100644 --- a/types/event-loop-lag/tsconfig.json +++ b/types/event-loop-lag/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/event-stream/tsconfig.json b/types/event-stream/tsconfig.json index 6f3624e82f..5612b82ced 100644 --- a/types/event-stream/tsconfig.json +++ b/types/event-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/event-to-promise/event-to-promise-tests.ts b/types/event-to-promise/event-to-promise-tests.ts index 2b99ddc62f..d8ca31f496 100644 --- a/types/event-to-promise/event-to-promise-tests.ts +++ b/types/event-to-promise/event-to-promise-tests.ts @@ -1,21 +1,19 @@ import { EventEmitter } from 'events' -import * as eventToPromise from 'event-to-promise' - +import eventToPromise = require('event-to-promise'); { const ee = new EventEmitter() const ep = eventToPromise(ee, 'custom') - + ep.then(console.log) ee.emit('custom') } - { const et = new EventTarget() const tp = eventToPromise.multi(et, ['custom']) - + tp.then(console.log) et.dispatchEvent(new Event('custom')) } diff --git a/types/event-to-promise/tsconfig.json b/types/event-to-promise/tsconfig.json index d47bd1672d..e3bd1d3c46 100644 --- a/types/event-to-promise/tsconfig.json +++ b/types/event-to-promise/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/events/tsconfig.json b/types/events/tsconfig.json index f43a926ad8..35b4a183b7 100644 --- a/types/events/tsconfig.json +++ b/types/events/tsconfig.json @@ -1,25 +1,26 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es6", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true + "module": "commonjs", + "target": "es6", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ - "index.d.ts", - "events-tests.ts" + "index.d.ts", + "events-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/evernote/tsconfig.json b/types/evernote/tsconfig.json index 2c89a52715..3815e7d498 100644 --- a/types/evernote/tsconfig.json +++ b/types/evernote/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/exceljs/tsconfig.json b/types/exceljs/tsconfig.json index a477befe57..c8cdf0d345 100644 --- a/types/exceljs/tsconfig.json +++ b/types/exceljs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/exceljs/tslint.json b/types/exceljs/tslint.json index d9d49e375e..f7f033a1b7 100644 --- a/types/exceljs/tslint.json +++ b/types/exceljs/tslint.json @@ -1,6 +1,8 @@ { "extends": "dtslint/dt.json", "rules": { - "no-any-union": false + // TODO + "no-any-union": false, + "no-const-enum": false } } diff --git a/types/execa/execa-tests.ts b/types/execa/execa-tests.ts index abdbfd6dad..2525091f2a 100644 --- a/types/execa/execa-tests.ts +++ b/types/execa/execa-tests.ts @@ -1,5 +1,5 @@ -import * as assert from 'assert'; -import * as execa from 'execa'; +import assert = require('assert'); +import execa = require('execa'); import { PassThrough } from "stream"; execa('unicorns') diff --git a/types/execa/tsconfig.json b/types/execa/tsconfig.json index 2d20077a4f..61568807ee 100644 --- a/types/execa/tsconfig.json +++ b/types/execa/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/exit-hook/tsconfig.json b/types/exit-hook/tsconfig.json index 34396672b0..637da53ef1 100644 --- a/types/exit-hook/tsconfig.json +++ b/types/exit-hook/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/exit/tsconfig.json b/types/exit/tsconfig.json index 4343e78761..942627fd28 100644 --- a/types/exit/tsconfig.json +++ b/types/exit/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/exorcist/tsconfig.json b/types/exorcist/tsconfig.json index c32fd613f3..b6c15addd0 100644 --- a/types/exorcist/tsconfig.json +++ b/types/exorcist/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/expect.js/tsconfig.json b/types/expect.js/tsconfig.json index c8f60ed6e5..d9f4950675 100644 --- a/types/expect.js/tsconfig.json +++ b/types/expect.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/expect/tsconfig.json b/types/expect/tsconfig.json index 33e71dad4c..225b2ac217 100644 --- a/types/expect/tsconfig.json +++ b/types/expect/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/expectations/tsconfig.json b/types/expectations/tsconfig.json index 857a8a1eef..e22736f12d 100644 --- a/types/expectations/tsconfig.json +++ b/types/expectations/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index 386cb41b04..79c80aa29d 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -73,6 +73,10 @@ AuthSession.startAsync({ break; } }); +AuthSession.startAsync({ + authUrl: 'url1', + returnUrl: undefined +}); Audio.setAudioModeAsync({ shouldDuckAndroid: false, @@ -162,12 +166,7 @@ async () => { }; async () => { - const result = await Facebook.logInWithReadPermissionsAsync('appId'); - - if (result.type === 'success') { - result.expires; - result.token; - } + const { type, expires, token } = await Facebook.logInWithReadPermissionsAsync("appId"); }; () => ( diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 89acb6ac10..c3977918ad 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/expo/expo-sdk // Definitions by: Konstantin Kai // Martynas Kadiša +// Sergio Sánchez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -90,7 +91,7 @@ export class Asset { * AuthSession */ export namespace AuthSession { - function startAsync(options: { authUrl: string; returnUrl: string; }): Promise<{ + function startAsync(options: { authUrl: string; returnUrl?: string; }): Promise<{ type: 'cancel'; } | { type: 'dismissed'; @@ -728,13 +729,11 @@ export namespace Facebook { permissions?: string[]; behavior?: 'web' | 'native' | 'browser' | 'system'; } - type Response = { - type: 'success'; - token: string; - expires: number; - } | { - type: 'cancel'; - }; + interface Response { + type: 'cancel' | 'success'; + token?: string; + expires?: number; + } function logInWithReadPermissionsAsync(appId: string, options?: Options): Promise; } @@ -1213,7 +1212,7 @@ export namespace Notifications { type LocalNotificationId = string | number; function addListener(listener: (notification: Notification) => any): EventSubscription; - function getExponentPushTokenAsync(): Promise; + function getExpoPushTokenAsync(): Promise; function presentLocalNotificationAsync(localNotification: LocalNotification): Promise; function scheduleLocalNotificationAsync( localNotification: LocalNotification, diff --git a/types/expo/tsconfig.json b/types/expo/tsconfig.json index 5d0f560837..8590ce01f7 100644 --- a/types/expo/tsconfig.json +++ b/types/expo/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "expo-tests.tsx" ] -} +} \ No newline at end of file diff --git a/types/expo/v23/expo-tests.tsx b/types/expo/v23/expo-tests.tsx index dd8696d5ba..0764a4d53e 100644 --- a/types/expo/v23/expo-tests.tsx +++ b/types/expo/v23/expo-tests.tsx @@ -159,12 +159,7 @@ async () => { }; async () => { - const result = await Facebook.logInWithReadPermissionsAsync('appId'); - - if (result.type === 'success') { - result.expires; - result.token; - } + const { type, expires, token } = await Facebook.logInWithReadPermissionsAsync("appId"); }; () => ( diff --git a/types/expo/v23/index.d.ts b/types/expo/v23/index.d.ts index 076cd43f8c..8aaa28bace 100644 --- a/types/expo/v23/index.d.ts +++ b/types/expo/v23/index.d.ts @@ -726,13 +726,11 @@ export namespace Facebook { permissions?: string[]; behavior?: 'web' | 'native' | 'browser' | 'system'; } - type Response = { - type: 'success'; - token: string; - expires: number; - } | { - type: 'cancel'; - }; + interface Response { + type: 'cancel' | 'success'; + token?: string; + expires?: number; + } function logInWithReadPermissionsAsync(appId: string, options?: Options): Promise; } diff --git a/types/expo/v23/tsconfig.json b/types/expo/v23/tsconfig.json index 4dbf5afca3..a2291cf3e2 100644 --- a/types/expo/v23/tsconfig.json +++ b/types/expo/v23/tsconfig.json @@ -23,10 +23,11 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "expo-tests.tsx" ] -} +} \ No newline at end of file diff --git a/types/expo__vector-icons/expo__vector-icons-tests.tsx b/types/expo__vector-icons/expo__vector-icons-tests.tsx new file mode 100644 index 0000000000..14ccbc7aa4 --- /dev/null +++ b/types/expo__vector-icons/expo__vector-icons-tests.tsx @@ -0,0 +1,111 @@ +import * as React from 'react'; +import { View, Text, TabBarIOS } from 'react-native'; +import { createIconSet, MaterialIcons, FontAwesome, Ionicons } from 'expo__vector-icons'; + +const glyphMap = { + custom: 58918 +}; + +const CustomIcon = createIconSet(glyphMap, 'FontCustom', 'FontCustom.ttf'); + +const CustomIconButton = CustomIcon.Button; +const CustomIconTabBarItem = CustomIcon.TabBarItem; +const CustomIconTabBarItemIOS = CustomIcon.TabBarItemIOS; +const CustomIconToolbarAndroid = CustomIcon.ToolbarAndroid; +const CustomIcongetImageSource = CustomIcon.getImageSource; + +class Example extends React.Component { + handleButton() { + console.log('You pressed me'); + } + + render() { + return ( + + {/* Normal Icon */} + + + {/* Icon button */} + this.handleButton()} + > + + Login with Facebook + + + + ); + } +} + +class TabTest extends React.Component<{}, { selectedTab: string }> { + constructor() { + super({}); + + this.state = { + selectedTab: 'tab1' + }; + } + + render() { + return ( + + this.setState({ selectedTab: 'tab1' })} + > + + + + this.setState({ selectedTab: 'tab2' })} + > + + + + ); + } +} + +class TestCustomIcon extends React.Component { + constructor() { + super({}); + } + + handleButton() { + console.log('You pressed me'); + } + + render() { + return ( + + {/* Custom Icon */} + + + {/* Custom Icon button */} + this.handleButton()} + > + + Hello CustomIcon! + + + + ); + } +} diff --git a/types/expo__vector-icons/index.d.ts b/types/expo__vector-icons/index.d.ts new file mode 100644 index 0000000000..ccc71fc93e --- /dev/null +++ b/types/expo__vector-icons/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for @expo/vector-icons 6.2 +// Project: https://github.com/expo/vector-icons +// Definitions by: Hyeonsu Lee +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as React from 'react'; +import { TextProperties } from 'react-native'; + +export { createIconSet, createIconSetFromFontello, createIconSetFromIcoMoon } from 'react-native-vector-icons'; +export { default as Entypo } from 'react-native-vector-icons/Entypo'; +export { default as EvilIcons } from 'react-native-vector-icons/EvilIcons'; +export { default as Feather } from 'react-native-vector-icons/Feather'; +export { default as FontAwesome } from 'react-native-vector-icons/FontAwesome'; +export { default as Foundation } from 'react-native-vector-icons/Foundation'; +export { default as Ionicons } from 'react-native-vector-icons/Ionicons'; +export { default as MaterialCommunityIcons } from 'react-native-vector-icons/MaterialCommunityIcons'; +export { default as MaterialIcons } from 'react-native-vector-icons/MaterialIcons'; +export { default as Octicons } from 'react-native-vector-icons/Octicons'; +export { default as SimpleLineIcons } from 'react-native-vector-icons/SimpleLineIcons'; +export { default as Zocial } from 'react-native-vector-icons/Zocial'; diff --git a/types/expo__vector-icons/tsconfig.json b/types/expo__vector-icons/tsconfig.json new file mode 100644 index 0000000000..a0aaaf4767 --- /dev/null +++ b/types/expo__vector-icons/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "expo__vector-icons-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/expo__vector-icons/tslint.json b/types/expo__vector-icons/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/expo__vector-icons/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/express-brute-memcached/express-brute-memcached-tests.ts b/types/express-brute-memcached/express-brute-memcached-tests.ts index 37dadf6189..4a74da4d87 100644 --- a/types/express-brute-memcached/express-brute-memcached-tests.ts +++ b/types/express-brute-memcached/express-brute-memcached-tests.ts @@ -1,5 +1,5 @@ -import * as express from "express"; -import * as ExpressBrute from "express-brute"; +import express = require("express"); +import ExpressBrute = require("express-brute"); import MemcachedStore from "express-brute-memcached"; var app = express(); diff --git a/types/express-brute-memcached/tsconfig.json b/types/express-brute-memcached/tsconfig.json index c49c399e0d..031f4178f1 100644 --- a/types/express-brute-memcached/tsconfig.json +++ b/types/express-brute-memcached/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-brute-mongo/tsconfig.json b/types/express-brute-mongo/tsconfig.json index d57cb21dd2..37f2386a8a 100644 --- a/types/express-brute-mongo/tsconfig.json +++ b/types/express-brute-mongo/tsconfig.json @@ -19,7 +19,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-brute-redis/tsconfig.json b/types/express-brute-redis/tsconfig.json index a033b8f228..3fdde618ad 100644 --- a/types/express-brute-redis/tsconfig.json +++ b/types/express-brute-redis/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-brute/tsconfig.json b/types/express-brute/tsconfig.json index 30bf0ccf14..42a510b1ed 100644 --- a/types/express-brute/tsconfig.json +++ b/types/express-brute/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-busboy/express-busboy-tests.ts b/types/express-busboy/express-busboy-tests.ts index 512fd7f245..801ad24481 100644 --- a/types/express-busboy/express-busboy-tests.ts +++ b/types/express-busboy/express-busboy-tests.ts @@ -1,6 +1,5 @@ import * as expressBusboy from 'express-busboy'; - -import * as express from 'express'; +import express = require('express'); const app: express.Application = express(); const options: expressBusboy.ExpressBusboyOptions = {}; diff --git a/types/express-busboy/tsconfig.json b/types/express-busboy/tsconfig.json index 1920bb9991..3bd9a10474 100644 --- a/types/express-busboy/tsconfig.json +++ b/types/express-busboy/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "express-busboy-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/express-cluster/tsconfig.json b/types/express-cluster/tsconfig.json index 5d27d3ec2e..85722d9956 100644 --- a/types/express-cluster/tsconfig.json +++ b/types/express-cluster/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-debug/tsconfig.json b/types/express-debug/tsconfig.json index 9763943be8..65dccfc944 100644 --- a/types/express-debug/tsconfig.json +++ b/types/express-debug/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-domain-middleware/tsconfig.json b/types/express-domain-middleware/tsconfig.json index 454fedea14..e18ec4e697 100644 --- a/types/express-domain-middleware/tsconfig.json +++ b/types/express-domain-middleware/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-ejs-layouts/express-ejs-layouts-tests.ts b/types/express-ejs-layouts/express-ejs-layouts-tests.ts index 9d77105a9d..f6820c57cf 100644 --- a/types/express-ejs-layouts/express-ejs-layouts-tests.ts +++ b/types/express-ejs-layouts/express-ejs-layouts-tests.ts @@ -1,5 +1,5 @@ -import * as express from 'express'; -import * as expressEjsLayouts from 'express-ejs-layouts'; +import express = require('express'); +import expressEjsLayouts = require('express-ejs-layouts'); function expressRequestHandlerTest() { const app = express() diff --git a/types/express-ejs-layouts/tsconfig.json b/types/express-ejs-layouts/tsconfig.json index 7ade9f8819..83f8ab2270 100644 --- a/types/express-ejs-layouts/tsconfig.json +++ b/types/express-ejs-layouts/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "express-ejs-layouts-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/express-enforces-ssl/tsconfig.json b/types/express-enforces-ssl/tsconfig.json index 9e071e54fb..744f4f7b82 100644 --- a/types/express-enforces-ssl/tsconfig.json +++ b/types/express-enforces-ssl/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-fileupload/express-fileupload-tests.ts b/types/express-fileupload/express-fileupload-tests.ts index 21115937d1..2a268fb64e 100644 --- a/types/express-fileupload/express-fileupload-tests.ts +++ b/types/express-fileupload/express-fileupload-tests.ts @@ -1,4 +1,4 @@ -import * as express from 'express'; +import express = require('express'); import { RequestHandler, Request, Response, NextFunction } from 'express-serve-static-core'; import fileUpload = require('express-fileupload'); diff --git a/types/express-fileupload/tsconfig.json b/types/express-fileupload/tsconfig.json index ecbd735cea..34badd8266 100644 --- a/types/express-fileupload/tsconfig.json +++ b/types/express-fileupload/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-flash-2/tsconfig.json b/types/express-flash-2/tsconfig.json index 6a0ef5a28b..fcfa6b81db 100644 --- a/types/express-flash-2/tsconfig.json +++ b/types/express-flash-2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-flash-notification/tsconfig.json b/types/express-flash-notification/tsconfig.json index 842aacf264..4341feca18 100644 --- a/types/express-flash-notification/tsconfig.json +++ b/types/express-flash-notification/tsconfig.json @@ -5,19 +5,20 @@ "es6" ], "noImplicitAny": true, - "noImplicitThis": true, + "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "express-flash-notification-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/express-formidable/tsconfig.json b/types/express-formidable/tsconfig.json index 45a7b6c12b..66ac147736 100644 --- a/types/express-formidable/tsconfig.json +++ b/types/express-formidable/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "express-formidable-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/express-graphql/express-graphql-tests.ts b/types/express-graphql/express-graphql-tests.ts index d476682104..0479716860 100644 --- a/types/express-graphql/express-graphql-tests.ts +++ b/types/express-graphql/express-graphql-tests.ts @@ -1,6 +1,6 @@ -import * as express from 'express'; +import express = require('express'); import 'express-session'; -import * as graphqlHTTP from 'express-graphql'; +import graphqlHTTP = require('express-graphql'); const app = express(); const schema = {}; diff --git a/types/express-graphql/tsconfig.json b/types/express-graphql/tsconfig.json index 7924c82706..c46f5fc04a 100644 --- a/types/express-graphql/tsconfig.json +++ b/types/express-graphql/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-handlebars/tsconfig.json b/types/express-handlebars/tsconfig.json index 9c6da1ba25..4233c4b5f8 100644 --- a/types/express-handlebars/tsconfig.json +++ b/types/express-handlebars/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-jwt/tsconfig.json b/types/express-jwt/tsconfig.json index f91064aba5..dff320327c 100644 --- a/types/express-jwt/tsconfig.json +++ b/types/express-jwt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-less/tsconfig.json b/types/express-less/tsconfig.json index c8e44f8204..8d9e70440e 100644 --- a/types/express-less/tsconfig.json +++ b/types/express-less/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-minify/tsconfig.json b/types/express-minify/tsconfig.json index 65c999883e..48a257d074 100644 --- a/types/express-minify/tsconfig.json +++ b/types/express-minify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-mongo-sanitize/express-mongo-sanitize-tests.ts b/types/express-mongo-sanitize/express-mongo-sanitize-tests.ts index 21a5028b27..03074593ca 100644 --- a/types/express-mongo-sanitize/express-mongo-sanitize-tests.ts +++ b/types/express-mongo-sanitize/express-mongo-sanitize-tests.ts @@ -1,5 +1,5 @@ -import * as express from 'express'; -import * as mongoSanitize from 'express-mongo-sanitize'; +import express = require('express'); +import mongoSanitize = require('express-mongo-sanitize'); const app: express.Express = express(); diff --git a/types/express-mongo-sanitize/tsconfig.json b/types/express-mongo-sanitize/tsconfig.json index 0834820a85..52dd3131cd 100644 --- a/types/express-mongo-sanitize/tsconfig.json +++ b/types/express-mongo-sanitize/tsconfig.json @@ -14,10 +14,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ "index.d.ts", "express-mongo-sanitize-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/express-mung/tsconfig.json b/types/express-mung/tsconfig.json index 9dd04b84e6..2a2d18d7be 100644 --- a/types/express-mung/tsconfig.json +++ b/types/express-mung/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-myconnection/tsconfig.json b/types/express-myconnection/tsconfig.json index b68ca7cb51..a4a0b3ee3c 100644 --- a/types/express-myconnection/tsconfig.json +++ b/types/express-myconnection/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-mysql-session/tsconfig.json b/types/express-mysql-session/tsconfig.json index f6d45a934d..ea0fe2693f 100644 --- a/types/express-mysql-session/tsconfig.json +++ b/types/express-mysql-session/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-oauth-server/express-oauth-server-tests.ts b/types/express-oauth-server/express-oauth-server-tests.ts index 436763b9b8..1aea48c256 100644 --- a/types/express-oauth-server/express-oauth-server-tests.ts +++ b/types/express-oauth-server/express-oauth-server-tests.ts @@ -1,6 +1,6 @@ import ExpressOAuthServer = require("express-oauth-server"); import * as OAuth2Server from "oauth2-server"; -import * as express from "express"; +import express = require("express"); const oauth2Model: OAuth2Server.AuthorizationCodeModel = { getClient: async (clientId: string, clientSecret: string): Promise => { diff --git a/types/express-oauth-server/tsconfig.json b/types/express-oauth-server/tsconfig.json index 197ec65f00..b694bb7d6d 100644 --- a/types/express-oauth-server/tsconfig.json +++ b/types/express-oauth-server/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "express-oauth-server-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/express-openapi/tsconfig.json b/types/express-openapi/tsconfig.json index a6cf4f3530..f4a2f9f9f5 100644 --- a/types/express-openapi/tsconfig.json +++ b/types/express-openapi/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-partials/tsconfig.json b/types/express-partials/tsconfig.json index 72e02dcdee..191459d746 100644 --- a/types/express-partials/tsconfig.json +++ b/types/express-partials/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-promise-router/tsconfig.json b/types/express-promise-router/tsconfig.json index 1f33dd7104..8e2b57d951 100644 --- a/types/express-promise-router/tsconfig.json +++ b/types/express-promise-router/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "express-promise-router-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/express-rate-limit/tsconfig.json b/types/express-rate-limit/tsconfig.json index 7dfb99a1d4..f3029afb95 100644 --- a/types/express-rate-limit/tsconfig.json +++ b/types/express-rate-limit/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-route-fs/tsconfig.json b/types/express-route-fs/tsconfig.json index 550f0d3b31..5b4456a483 100644 --- a/types/express-route-fs/tsconfig.json +++ b/types/express-route-fs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-sanitized/express-sanitized-tests.ts b/types/express-sanitized/express-sanitized-tests.ts index 1610ef6c91..4ff8cce13b 100644 --- a/types/express-sanitized/express-sanitized-tests.ts +++ b/types/express-sanitized/express-sanitized-tests.ts @@ -1,5 +1,5 @@ -import * as express from "express"; -import * as expressSanitized from "express-sanitized"; +import express = require("express"); +import expressSanitized = require("express-sanitized"); const RoutingServer: express.Express = express(); diff --git a/types/express-sanitized/tsconfig.json b/types/express-sanitized/tsconfig.json index 9924f49f46..0c6bcf3836 100644 --- a/types/express-sanitized/tsconfig.json +++ b/types/express-sanitized/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-serve-static-core/index.d.ts b/types/express-serve-static-core/index.d.ts index edc7641d29..30fe69c82a 100644 --- a/types/express-serve-static-core/index.d.ts +++ b/types/express-serve-static-core/index.d.ts @@ -4,6 +4,7 @@ // Michał Lytek // Kacper Polak // Satana Charuwichitratana +// Sami Jaber // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -21,6 +22,7 @@ declare global { } import * as http from "http"; +import { EventEmitter } from "events"; export interface NextFunction { // tslint:disable-next-line callable-types (In ts2.1 it thinks the type alias has no call signatures) @@ -833,7 +835,7 @@ export type RequestParamHandler = (req: Request, res: Response, next: NextFuncti export type ApplicationRequestHandler = IRouterHandler & IRouterMatcher & ((...handlers: RequestHandlerParams[]) => T); -export interface Application extends IRouter, Express.Application { +export interface Application extends EventEmitter, IRouter, Express.Application { /** * Express instance itself is a request handler, which could be invoked without * third argument. diff --git a/types/express-serve-static-core/tsconfig.json b/types/express-serve-static-core/tsconfig.json index 73c2b38c7d..40b2ef2060 100644 --- a/types/express-serve-static-core/tsconfig.json +++ b/types/express-serve-static-core/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-session/express-session-tests.ts b/types/express-session/express-session-tests.ts index fdb77caedb..6a619f162c 100644 --- a/types/express-session/express-session-tests.ts +++ b/types/express-session/express-session-tests.ts @@ -37,3 +37,34 @@ app.use((req, res, next) => { res.end('welcome to the session demo. refresh!'); } }); + +// Custom Session Store + +class MyStore extends session.Store { + private sessions: { [sid: string]: string }; + + constructor() { + super(); + this.sessions = {}; + } + + get = (sid: string, callback: (err: any, session: Express.SessionData) => void): void => { + callback(null, JSON.parse(this.sessions[sid])); + } + + set = (sid: string, session: Express.Session, callback: (err: any) => void): void => { + this.sessions[sid] = JSON.stringify(session); + callback(null); + } + + destroy = (sid: string, callback: (err: any) => void): void => { + this.sessions[sid] = undefined; + this.sessions = JSON.parse(JSON.stringify(this.sessions)); + callback(null); + } +} + +app.use(session({ + secret: 'keyboard cat', + store: new MyStore() +})); diff --git a/types/express-session/index.d.ts b/types/express-session/index.d.ts index 13ce6ab8b2..6b59efc925 100644 --- a/types/express-session/index.d.ts +++ b/types/express-session/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for express-session 1.15 // Project: https://www.npmjs.org/package/express-session -// Definitions by: Hiroki Horiuchi , Jacob Bogers +// Definitions by: Hiroki Horiuchi , Jacob Bogers , Naoto Yokoyama // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -64,7 +64,7 @@ declare namespace session { } interface BaseMemoryStore { - get: (sid: string, callback: (err: any, session: Express.Session) => void) => void; + get: (sid: string, callback: (err: any, session: Express.SessionData) => void) => void; set: (sid: string, session: Express.Session, callback: (err: any) => void) => void; destroy: (sid: string, callback: (err: any) => void) => void; length?: (callback: (err: any, length: number) => void) => void; @@ -78,7 +78,7 @@ declare namespace session { load: (sid: string, fn: (err: any, session: Express.Session) => any) => void; createSession: (req: express.Request, sess: Express.SessionData) => void; - get: (sid: string, callback: (err: any, session: Express.Session) => void) => void; + get: (sid: string, callback: (err: any, session: Express.SessionData) => void) => void; set: (sid: string, session: Express.Session, callback: (err: any) => void) => void; destroy: (sid: string, callback: (err: any) => void) => void; all: (callback: (err: any, obj: { [sid: string]: Express.SessionData; }) => void) => void; @@ -87,7 +87,7 @@ declare namespace session { } class MemoryStore implements BaseMemoryStore { - get: (sid: string, callback: (err: any, session: Express.Session) => void) => void; + get: (sid: string, callback: (err: any, session: Express.SessionData) => void) => void; set: (sid: string, session: Express.Session, callback: (err: any) => void) => void; destroy: (sid: string, callback: (err: any) => void) => void; all: (callback: (err: any, obj: { [sid: string]: Express.Session; }) => void) => void; diff --git a/types/express-session/tsconfig.json b/types/express-session/tsconfig.json index 14c2e75bd5..190564ac5e 100644 --- a/types/express-session/tsconfig.json +++ b/types/express-session/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-to-koa/express-to-koa-tests.ts b/types/express-to-koa/express-to-koa-tests.ts new file mode 100644 index 0000000000..1329a15851 --- /dev/null +++ b/types/express-to-koa/express-to-koa-tests.ts @@ -0,0 +1,12 @@ +import Koa = require('koa'); +import * as connect from 'connect'; +import expressToKoa = require('express-to-koa'); + +const app = new Koa(); +const middleware: connect.NextHandleFunction = (req, res, next) => { + // 'express middleware' + next(); +}; + +app.use(expressToKoa(middleware)); +app.listen(3000); diff --git a/types/express-to-koa/index.d.ts b/types/express-to-koa/index.d.ts new file mode 100644 index 0000000000..9a23108943 --- /dev/null +++ b/types/express-to-koa/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for express-to-koa 1.0 +// Project: https://github.com/kaelzhang/express-to-koa +// Definitions by: Xiaohan Zhang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as Koa from "koa"; +import { IncomingMessage, ServerResponse } from "http"; + +export = expressToKoa; + +declare function expressToKoa( + middleware: ( + req: IncomingMessage, + res: ServerResponse, + next: (err?: any) => void, + ) => void +): Koa.Middleware; diff --git a/types/express-to-koa/tsconfig.json b/types/express-to-koa/tsconfig.json new file mode 100644 index 0000000000..5b33c7ac55 --- /dev/null +++ b/types/express-to-koa/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "express-to-koa-tests.ts" + ] +} \ No newline at end of file diff --git a/types/express-to-koa/tslint.json b/types/express-to-koa/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/express-to-koa/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/express-unless/tsconfig.json b/types/express-unless/tsconfig.json index 44038c38d3..5cb90389b5 100644 --- a/types/express-unless/tsconfig.json +++ b/types/express-unless/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-useragent/tsconfig.json b/types/express-useragent/tsconfig.json index 3bbc5c5520..0cf85a5a95 100644 --- a/types/express-useragent/tsconfig.json +++ b/types/express-useragent/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-winston/express-winston-tests.ts b/types/express-winston/express-winston-tests.ts index 7ce00c479e..297b7afc49 100644 --- a/types/express-winston/express-winston-tests.ts +++ b/types/express-winston/express-winston-tests.ts @@ -1,6 +1,6 @@ import expressWinston = require('express-winston'); import * as winston from 'winston'; -import * as express from 'express'; +import express = require('express'); const app = express(); diff --git a/types/express-winston/tsconfig.json b/types/express-winston/tsconfig.json index dcebd7fafb..7ec0a4eff8 100644 --- a/types/express-winston/tsconfig.json +++ b/types/express-winston/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "express-winston-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/express/express-tests.ts b/types/express/express-tests.ts index 1c9220a8b5..137c70c8e8 100644 --- a/types/express/express-tests.ts +++ b/types/express/express-tests.ts @@ -1,4 +1,4 @@ -import * as express from 'express'; +import express = require('express'); namespace express_tests { const app = express(); diff --git a/types/express/index.d.ts b/types/express/index.d.ts index 18231dcfbc..4e6ed8fcc1 100644 --- a/types/express/index.d.ts +++ b/types/express/index.d.ts @@ -15,7 +15,7 @@ /// import * as bodyParser from "body-parser"; -import * as serveStatic from "serve-static"; +import serveStatic = require("serve-static"); import * as core from "express-serve-static-core"; /** diff --git a/types/express/tsconfig.json b/types/express/tsconfig.json index b38c24658e..999dd53a3e 100644 --- a/types/express/tsconfig.json +++ b/types/express/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/extend/extend-tests.ts b/types/extend/extend-tests.ts index 0bf977e6e8..5ff62322b1 100644 --- a/types/extend/extend-tests.ts +++ b/types/extend/extend-tests.ts @@ -1,6 +1,4 @@ -/// -import * as assert from 'assert'; -import * as extend from 'extend'; +import extend = require('extend'); const objectBase = { test: 'base' @@ -25,19 +23,19 @@ const objectThree = { type ExtendedType = typeof objectBase & typeof objectOne; const extended: ExtendedType = extend(objectBase, objectOne); -assert(extended.test === 'one'); -assert(extended.iamone); +extended.test === 'one'; +extended.iamone; type MoreExtendedType = typeof objectBase & typeof objectOne & typeof objectTwo; const moreExtended: MoreExtendedType = extend(objectBase, objectOne, objectTwo); -assert(moreExtended.test === 2); -assert(moreExtended.iamone); -assert(moreExtended.iamtwo); +moreExtended.test === 2; +moreExtended.iamone; +moreExtended.iamtwo; type DeepExtendedType = typeof objectBase & typeof objectOne & typeof objectTwo & typeof objectThree; const deepExtended = extend(true, objectBase, objectOne, objectTwo, objectThree); -assert(deepExtended.iamone); -assert(deepExtended.iamtwo); -assert(deepExtended.iamthree); -assert(deepExtended.depth.innerType === 'deep'); +deepExtended.iamone; +deepExtended.iamtwo; +deepExtended.iamthree; +deepExtended.depth.innerType === 'deep'; diff --git a/types/extend/tsconfig.json b/types/extend/tsconfig.json index dce058009d..19ed5928ee 100644 --- a/types/extend/tsconfig.json +++ b/types/extend/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/extjs/tsconfig.json b/types/extjs/tsconfig.json index 16cf9bcee6..20138aaa88 100644 --- a/types/extjs/tsconfig.json +++ b/types/extjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/extract-stack/tsconfig.json b/types/extract-stack/tsconfig.json index 26f0c50479..2779df149a 100644 --- a/types/extract-stack/tsconfig.json +++ b/types/extract-stack/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/extract-text-webpack-plugin/tsconfig.json b/types/extract-text-webpack-plugin/tsconfig.json index dc6516b37e..9a503d773a 100644 --- a/types/extract-text-webpack-plugin/tsconfig.json +++ b/types/extract-text-webpack-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/extract-zip/tsconfig.json b/types/extract-zip/tsconfig.json index 821ad3b5b3..db692aa262 100644 --- a/types/extract-zip/tsconfig.json +++ b/types/extract-zip/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/eyes/tsconfig.json b/types/eyes/tsconfig.json index e0effcdb85..cca90d6857 100644 --- a/types/eyes/tsconfig.json +++ b/types/eyes/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/f1/tsconfig.json b/types/f1/tsconfig.json index e54cd01b58..45e94b199c 100644 --- a/types/f1/tsconfig.json +++ b/types/f1/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fabric/fabric-tests.ts b/types/fabric/fabric-tests.ts index 2f7d1a7d37..0f51499c0b 100644 --- a/types/fabric/fabric-tests.ts +++ b/types/fabric/fabric-tests.ts @@ -331,10 +331,10 @@ function sample6() { canvas.centerObject(obj); canvas.add(obj); - canvas.add(obj.clone(() => { }).set({ left: 100, top: 100, angle: -15 })); - canvas.add(obj.clone(() => { }).set({ left: 480, top: 100, angle: 15 })); - canvas.add(obj.clone(() => { }).set({ left: 100, top: 400, angle: -15 })); - canvas.add(obj.clone(() => { }).set({ left: 480, top: 400, angle: 15 })); + obj.clone(clone => canvas.add(clone.set({ left: 100, top: 100, angle: -15 }))); + obj.clone(clone => canvas.add(clone.set({ left: 480, top: 100, angle: 15 }))); + obj.clone(clone => canvas.add(clone.set({ left: 100, top: 400, angle: -15 }))); + obj.clone(clone => canvas.add(clone.set({ left: 480, top: 400, angle: 15 }))); canvas.on('mouse:move', options => { const p = canvas.getPointer(options.e); @@ -481,7 +481,7 @@ function sample8() { top, angle, padding: 10, - cornersize: 10 + cornerSize: 10 }); image.scale(getRandomNum(0.1, 0.25)).setCoords(); canvas.add(image); @@ -495,7 +495,7 @@ function sample8() { top, angle, padding: 10, - cornersize: 10 + cornerSize: 10 }); image.scale(getRandomNum(0.1, 1)).setCoords(); canvas.add(image); @@ -515,7 +515,7 @@ function sample8() { top, angle, padding: 10, - cornersize: 10 + cornerSize: 10 }); loadedObject/*.scaleToWidth(300)*/.setCoords(); diff --git a/types/fabric/index.d.ts b/types/fabric/index.d.ts index ac6104d419..2163faecef 100644 --- a/types/fabric/index.d.ts +++ b/types/fabric/index.d.ts @@ -1,7 +1,11 @@ // Type definitions for FabricJS 1.5 // Project: http://fabricjs.com/ -// Definitions by: Oliver Klemencic , Joseph Livecchi , Michael Randolph +// Definitions by: Oliver Klemencic +// Joseph Livecchi +// Michael Randolph +// Tiger Oakes // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 export as namespace fabric; @@ -61,7 +65,7 @@ export function parseStyleAttribute(element: SVGElement): any; * @param [options] Options object * @param [reviver] Method for further parsing of SVG elements, called after each fabric object created. */ -export function parseElements(elements: any[], callback: Function, options?: any, reviver?: Function): void; +export function parseElements(elements: SVGElement[], callback: Function, options?: any, reviver?: Function): void; /** * Returns an object of attributes' name/value, given element and an array of attribute names; * Parses parent "g" nodes recursively upwards. @@ -232,7 +236,7 @@ interface ICollection { * @param context Context (aka thisObject) * @return thisArg */ - forEachObject(callback: (element: Object, index: number, array: Object[]) => any, context?: any): T; + forEachObject(callback: (element: Object, index: number, array: Object[]) => void, context?: any): T; /** * Returns an array of children objects of this instance @@ -279,13 +283,13 @@ interface IObservable { * @param eventName Event name (eg. 'after:render') * @param handler Function that receives a notification when an event of the specified type occurs */ - on(eventName: string, handler: (e: IEvent) => any): T; + on(eventName: string, handler: (e: IEvent) => void): T; /** * Observes specified event * @param eventName Object with key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler}) */ - on(eventName: {[key: string]: Function}): T; + on(events: {[eventName: string]: (e: IEvent) => void}): T; /** * Fires event with an optional options object * @param eventName Event name to fire @@ -298,7 +302,7 @@ interface IObservable { * @param eventName Event name (eg. 'after:render') or object with key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler}) * @param handler Function to be deleted from EventListeners */ - off(eventName?: string|any, handler?: (e: IEvent) => any): T; + off(eventName?: string|any, handler?: (e: IEvent) => void): T; } interface Callbacks { @@ -799,14 +803,14 @@ interface IShadowOptions { */ offsetY: number; } -export interface IShadow extends IShadowOptions {} -export class IShadow { +export interface Shadow extends IShadowOptions {} +export class Shadow { constructor(options?: IShadowOptions); - initialize(options?: IShadowOptions|string): IShadow; + initialize(options?: IShadowOptions|string): Shadow; /** * Returns object representation of a shadow */ - toObject(): Object; + toObject(): any; /** * Returns a string representation of an instance, CSS3 text-shadow declaration */ @@ -953,7 +957,7 @@ export class StaticCanvas { * @param callback Callback to invoke when image is loaded and set as background * @param [options] Optional options to set for the {@link fabric.Image|background image}. */ - setBackgroundImage(image: Image|string, callback: Function, options?: IObjectOptions): StaticCanvas; + setBackgroundImage(image: Image|string, callback?: Function, options?: IObjectOptions): StaticCanvas; /** * Sets {@link fabric.StaticCanvas#overlayColor|background color} for this canvas @@ -1112,19 +1116,19 @@ export class StaticCanvas { * Returs dataless JSON representation of canvas * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - toDatalessJSON(propertiesToInclude?: any[]): string; + toDatalessJSON(propertiesToInclude?: string[]): string; /** * Returns object representation of canvas * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - toObject(propertiesToInclude?: any[]): any; + toObject(propertiesToInclude?: string[]): any; /** * Returns dataless object representation of canvas * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - toDatalessObject(propertiesToInclude?: any[]): any; + toDatalessObject(propertiesToInclude?: string[]): any; /** * When true, getSvgTransform() will apply the StaticCanvas.viewportTransform to the SVG transformation. When true, @@ -1198,7 +1202,7 @@ export class StaticCanvas { * @param methodName Method to check support for; Could be one of "getImageData", "toDataURL", "toDataURLWithQuality" or "setLineDash" * @return `true` if method is supported (or at least exists), null` if canvas element or context can not be initialized */ - supports(methodName: string): boolean; + supports(methodName: "getImageData" | "toDataURL" | "toDataURLWithQuality" | "setLineDash"): boolean; /** * Populates canvas with data from the specified JSON. @@ -1215,7 +1219,7 @@ export class StaticCanvas { * @param [callback] Receives cloned instance as a first argument * @param [properties] Array of properties to include in the cloned canvas and children */ - clone(callback: (canvas: StaticCanvas) => any, properties?: any[]): void; + clone(callback: (canvas: StaticCanvas) => void, properties?: any[]): void; /** * Clones canvas instance without cloning existing data. @@ -1223,7 +1227,7 @@ export class StaticCanvas { * but leaves data empty (so that you can populate it with your own) * @param [callback] Receives cloned instance as a first argument */ - cloneWithoutData(callback: (canvas: StaticCanvas) => any): void; + cloneWithoutData(callback: (canvas: StaticCanvas) => void): void; /** * Callback; invoked right before object is about to be scaled/rotated @@ -1251,12 +1255,12 @@ export class StaticCanvas { * (either those of HTMLCanvasElement itself, or rendering context) * @param methodName Method to check support for; Could be one of "getImageData", "toDataURL", "toDataURLWithQuality" or "setLineDash" */ - static supports(methodName: string): boolean; + static supports(methodName: "getImageData" | "toDataURL" | "toDataURLWithQuality" | "setLineDash"): boolean; /** * Returns JSON representation of canvas * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - static toJSON(propertiesToInclude?: any[]): string; + static toJSON(propertiesToInclude?: string[]): string; } interface ICanvasOptions extends IStaticCanvasOptions { @@ -1473,12 +1477,12 @@ export class Canvas { * (either those of HTMLCanvasElement itself, or rendering context) * @param methodName Method to check support for; Could be one of "getImageData", "toDataURL", "toDataURLWithQuality" or "setLineDash" */ - static supports(methodName: string): boolean; + static supports(methodName: "getImageData" | "toDataURL" | "toDataURLWithQuality" | "setLineDash"): boolean; /** * Returns JSON representation of canvas * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - static toJSON(propertiesToInclude?: any[]): string; + static toJSON(propertiesToInclude?: string[]): string; } /////////////////////////////////////////////////////////////////////////////// @@ -1527,7 +1531,7 @@ export class Circle { * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return object representation of an instance */ - toObject(propertiesToInclude?: any[]): any; + toObject(propertiesToInclude?: string[]): any; /** * Returns svg representation of an instance * @param [reviver] Method for further parsing of svg representation. @@ -1580,7 +1584,7 @@ export class Ellipse { * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return object representation of an instance */ - toObject(propertiesToInclude?: any[]): any; + toObject(propertiesToInclude?: string[]): any; /** * Returns svg representation of an instance * @param [reviver] Method for further parsing of svg representation. @@ -1681,7 +1685,7 @@ export class Group { * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return object representation of an instance */ - toObject(propertiesToInclude?: any[]): any; + toObject(propertiesToInclude?: string[]): any; /** * Returns string represenation of a group */ @@ -1751,7 +1755,7 @@ export class Image { * @param callback Callback is invoked with a clone as a first argument * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - clone(callback?: Function, propertiesToInclude?: any[]): Object; + clone(callback?: Function, propertiesToInclude?: string[]): void; /** * Returns complexity of an instance * @return complexity of this instance @@ -1791,7 +1795,7 @@ export class Image { * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return Object representation of an instance */ - toObject(propertiesToInclude?: any[]): any; + toObject(propertiesToInclude?: string[]): any; /** * Returns string representation of an instance * @return String representation of an instance @@ -1817,20 +1821,20 @@ export class Image { * @param [callback] Callback to invoke when image is created (newly created image is passed as a first argument) * @param [imgOptions] Options object */ - static fromURL(url: string, callback?: (image: Image) => any, objObjects?: IObjectOptions): Image; + static fromURL(url: string, callback?: (image: Image) => void, objObjects?: IObjectOptions): Image; /** * Creates an instance of fabric.Image from its object representation * @param object Object to create an instance from * @param [callback] Callback to invoke when an image instance is created */ - static fromObject(object: any, callback: (image: Image) => {}): void; + static fromObject(object: any, callback: (image: Image) => void): void; /** * Returns Image instance from an SVG element * @param element Element to parse * @param callback Callback to execute when fabric.Image object is created * @param [options] Options object */ - static fromElement(element: SVGElement, callback: Function, options?: IImageOptions): void; + static fromElement(element: SVGElement, callback: (image: Image) => void, options?: IImageOptions): void; /** * Default CSS class name for canvas */ @@ -1877,7 +1881,7 @@ export class Line { * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return object representation of an instance */ - toObject(propertiesToInclude: any[]): any; + toObject(propertiesToInclude: string[]): any; /** * Returns SVG representation of an instance * @param [reviver] Method for further parsing of svg representation. @@ -1997,6 +2001,11 @@ interface IObjectOptions { */ cornerColor?: string; + /** + * Specify style of control, 'rect' or 'circle' + */ + cornerStrokeColor?: "rect" | "circle"; + /** * When true, this object will use center point as the origin of transformation * when being scaled via the controls. @@ -2066,7 +2075,7 @@ interface IObjectOptions { /** * Shadow object representing shadow of this shape */ - shadow?: IShadow|string; + shadow?: Shadow|string; /** * Opacity of object's controlling borders when object is active and moving @@ -2245,7 +2254,7 @@ export class Object { /* * Sets object's properties from options * @param {Object} [options] Options object */ - setOptions(options: any): void; + setOptions(options: IObjectOptions): void; /** * Transforms context when rendering an object @@ -2258,13 +2267,13 @@ export class Object { * Returns an object representation of an instance * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - toObject(propertiesToInclude?: any[]): any; + toObject(propertiesToInclude?: string[]): any; /** * Returns (dataless) object representation of an instance * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - toDatalessObject(propertiesToInclude?: any[]): any; + toDatalessObject(propertiesToInclude?: string[]): any; /** * Returns a string representation of an instance @@ -2275,7 +2284,7 @@ export class Object { * Basic getter * @param property Property name */ - get(property: string): any; + get(property: K): this[K]; /** * Sets property to a given value. @@ -2284,26 +2293,26 @@ export class Object { * @param key Property name * @param value Property value (if function, the value is passed into it and its return value is used as a new one) */ - set(key: string, value: any|Function): Object; + set(key: K, value: this[K] | ((value: this[K]) => this[K])): this; /** * Sets property to a given value. * When changing position/dimension -related properties (left, top, scale, angle, etc.) `set` does not update position of object's borders/controls. * If you need to update those, call `setCoords()`. - * @param Object key Property object, iterate over the object properties + * @param options Property object, iterate over the object properties */ - set(key: any): Object; + set(options: Partial): this; /** * Toggles specified property from `true` to `false` or from `false` to `true` * @param property Property to toggle */ - toggle(property: string): Object; + toggle(property: keyof this): this; /** * Sets sourcePath of an object * @param value Value to set sourcePath to */ - setSourcePath(value: string): Object; + setSourcePath(value: string): this; /** * Retrieves viewportTransform from Object's canvas if possible @@ -2318,17 +2327,17 @@ export class Object { render(ctx: CanvasRenderingContext2D, noTransform?: boolean): void; /** - * Clones an instance + * Clones an instance, using a callback method will work for every object. * @param callback Callback is invoked with a clone as a first argument * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - clone(callback: Function, propertiesToInclude?: any[]): Object; + clone(callback: (clone: Object) => void, propertiesToInclude?: string[]): void; /** * Creates an instance of fabric.Image out of an object * @param callback callback, invoked with an instance as a first argument */ - cloneAsImage(callback: (image: Image) => any): Object; + cloneAsImage(callback: (image: Image) => void): this; /** * Converts an object into a data-url-like string @@ -2351,67 +2360,62 @@ export class Object { * Returns a JSON representation of an instance * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - toJSON(propertiesToInclude?: any[]): any; + toJSON(propertiesToInclude?: string[]): any; /** * Sets gradient (fill or stroke) of an object - * Backwards incompatibility note: This method was named "setGradientFill" until v1.1.0 + * **Backwards incompatibility note:** This method was named "setGradientFill" until v1.1.0 * @param property Property name 'stroke' or 'fill' * @param [options] Options object */ - setGradient(property: string, options: IGradientOptions): Object; + setGradient(property: "stroke" | "fill", options: IGradientOptions): this; /** * Sets pattern fill of an object * @param options Options object */ - setPatternFill(options: IFillOptions): Object; + setPatternFill(options: IFillOptions): this; /** * Sets shadow of an object * @param [options] Options object or string (e.g. "2px 2px 10px rgba(0,0,0,0.2)") */ - setShadow(options?: string): Object; - /** - * Sets shadow of an object - * @param [options] Options object - */ - setShadow(options: IShadow): Object; + setShadow(options?: string | Shadow): this; /** * Sets "color" of an instance (alias of `set('fill', …)`) * @param color Color value */ - setColor(color: string): Object; + setColor(color: string): this; /** * Sets "angle" of an instance * @param angle Angle value */ - setAngle(angle: number): Object; + setAngle(angle: number): this; /** * Sets "angle" of an instance * @param angle Angle value */ - rotate(angle: number): Object; + rotate(angle: number): this; /** * Centers object horizontally on canvas to which it was added last. * You might need to call `setCoords` on an object after centering, to update controls area. */ - centerH(): void; + centerH(): this; /** * Centers object vertically on canvas to which it was added last. * You might need to call `setCoords` on an object after centering, to update controls area. */ - centerV(): void; + centerV(): this; /** * Centers object vertically and horizontally on canvas to which is was added last * You might need to call `setCoords` on an object after centering, to update controls area. */ - center(): void; + center(): this; /** * Removes object from canvas to which it was added last @@ -2423,7 +2427,7 @@ export class Object { * @param e Event to operate upon * @param [pointer] Pointer to operate upon (instead of event) */ - getLocalPointer(e: Event, pointer: any): any; + getLocalPointer(e: Event, pointer?: { x: number, y: number }): { x: number, y: number }; /** * Sets object's properties from options @@ -2461,21 +2465,21 @@ export class Object { * @param [options] Object with additional `stateProperties` array to include when saving state * @return thisArg */ - saveState(options?: { stateProperties: any[] }): Object; + saveState(options?: { stateProperties: any[] }): this; /** * Setups state of an object */ - setupState(): Object; + setupState(): this; // functions from object straightening mixin // ----------------------------------------------------------------------------------------------------------------------------------- /** * Straightens an object (rotating it from current angle to one of 0, 90, 180, 270, etc. depending on which is closer) */ - straighten(): Object; + straighten(): this; /** * Same as straighten but with animation */ - fxStraighten(callbacks: Callbacks): Object; + fxStraighten(callbacks: Callbacks): this; // functions from object stacking mixin // ----------------------------------------------------------------------------------------------------------------------------------- @@ -2483,25 +2487,25 @@ export class Object { * Moves an object up in stack of drawn objects * @param [intersecting] If `true`, send object in front of next upper intersecting object */ - bringForward(intersecting?: boolean): Object; + bringForward(intersecting?: boolean): this; /** * Moves an object to the top of the stack of drawn objects */ - bringToFront(): Object; + bringToFront(): this; /** * Moves an object down in stack of drawn objects * @param [intersecting] If `true`, send object behind next lower intersecting object */ - sendBackwards(intersecting?: boolean): Object; + sendBackwards(intersecting?: boolean): this; /** * Moves an object to the bottom of the stack of drawn objects */ - sendToBack(): Object; + sendToBack(): this; /** * Moves an object to specified level in stack of drawn objects * @param index New position of object */ - moveTo(index: number): Object; + moveTo(index: number): this; // functions from object origin mixin // ----------------------------------------------------------------------------------------------------------------------------------- @@ -2561,7 +2565,7 @@ export class Object { * Requires public options: padding, borderColor * @param ctx Context to draw on */ - drawBorders(context: CanvasRenderingContext2D): Object; + drawBorders(context: CanvasRenderingContext2D): this; /** * Draws corners of an object's bounding box. @@ -2581,7 +2585,7 @@ export class Object { * @param controlName The name of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'. * @param visible true to set the specified control visible, false otherwise */ - setControlVisible(controlName: string, visible: boolean): Object; + setControlVisible(controlName: string, visible: boolean): this; /** * Sets the visibility state of object controls. @@ -2596,7 +2600,7 @@ export class Object { mt?: boolean; tl?: boolean; tr?: boolean; - mtr?: boolean; }): Object; + mtr?: boolean; }): this; // functions from geometry mixin // ------------------------------------------------------------------------------------------------------------------------------- @@ -2604,7 +2608,7 @@ export class Object { * Sets corner position coordinates based on current angle, width and height * See https://github.com/kangax/fabric.js/wiki/When-to-call-setCoords */ - setCoords(): Object; + setCoords(): this; /** * Returns coordinates of object's bounding rectangle (left, top, width, height) * @return Object with left, top, width, height properties @@ -2631,17 +2635,17 @@ export class Object { * @param value Scale factor * @return thisArg */ - scale(value: number): Object; + scale(value: number): this; /** * Scales an object to a given height, with respect to bounding box (scaling by x/y equally) * @param value New height value */ - scaleToHeight(value: number): Object; + scaleToHeight(value: number): this; /** * Scales an object to a given width, with respect to bounding box (scaling by x/y equally) * @param value New width value */ - scaleToWidth(value: number): Object; + scaleToWidth(value: number): this; /** * Checks if object intersects with another object * @param other Object to test @@ -2671,8 +2675,8 @@ interface IPathOptions extends IObjectOptions { */ minY?: number; } -export interface IPath extends Object, IPathOptions {} -export class IPath { +export interface Path extends Object, IPathOptions {} +export class Path { /** * Constructor * @param path Path data (sequence of coordinates and corresponding "command" tokens) @@ -2680,7 +2684,7 @@ export class IPath { */ constructor(path?: string|any[], options?: IPathOptions); - initialize(path?: any[], options?: IPathOptions): IPath; + initialize(path?: any[], options?: IPathOptions): Path; /** * Returns number representation of an instance complexity @@ -2699,13 +2703,13 @@ export class IPath { * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return object representation of an instance */ - toDatalessObject(propertiesToInclude?: any[]): any; + toDatalessObject(propertiesToInclude?: string[]): any; /** * Returns object representation of an instance * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return object representation of an instance */ - toObject(propertiesToInclude?: any[]): any; + toObject(propertiesToInclude?: string[]): any; /** * Returns string representation of an instance * @return string representation of an instance @@ -2724,12 +2728,12 @@ export class IPath { * @param callback Callback to invoke when an fabric.Path instance is created * @param [options] Options object */ - static fromElement(element: SVGElement, callback: (path: IPath) => any, options?: IPathOptions): void; + static fromElement(element: SVGElement, callback: (path: Path) => any, options?: IPathOptions): void; /** * Creates an instance of fabric.Path from an object * @param callback Callback to invoke when an fabric.Path instance is created */ - static fromObject(object: any, callback: (path: IPath) => any): void; + static fromObject(object: any, callback: (path: Path) => any): void; } export class PathGroup extends Object { @@ -2737,9 +2741,9 @@ export class PathGroup extends Object { * Constructor * @param [options] Options object */ - constructor(paths: IPath[], options?: IObjectOptions); + constructor(paths: Path[], options?: IObjectOptions); - initialize(paths: IPath[], options?: IObjectOptions): void; + initialize(paths: Path[], options?: IObjectOptions): void; /** * Returns number representation of object's complexity * @return complexity @@ -2760,13 +2764,13 @@ export class PathGroup extends Object { * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return dataless object representation of an instance */ - toDatalessObject(propertiesToInclude?: any[]): any; + toDatalessObject(propertiesToInclude?: string[]): any; /** * Returns object representation of this path group * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return object representation of an instance */ - toObject(propertiesToInclude?: any[]): any; + toObject(propertiesToInclude?: string[]): any; /** * Returns a string representation of this path group * @return string representation of an object @@ -2782,7 +2786,7 @@ export class PathGroup extends Object { * Returns all paths in this path group * @return array of path objects included in this path group */ - getObjects(): IPath[]; + getObjects(): Path[]; static fromObject(object: any): PathGroup; /** @@ -2829,7 +2833,7 @@ export class Polygon extends Object { * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return object representation of an instance */ - toObject(propertiesToInclude?: any[]): any; + toObject(propertiesToInclude?: string[]): any; /** * Returns svg representation of an instance * @param [reviver] Method for further parsing of svg representation. @@ -2891,7 +2895,7 @@ export class Polyline extends Object { * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return Object representation of an instance */ - toObject(propertiesToInclude?: any[]): any; + toObject(propertiesToInclude?: string[]): any; /** * Returns SVG representation of an instance * @param [reviver] Method for further parsing of svg representation. @@ -3012,7 +3016,7 @@ interface ITextOptions extends IObjectOptions { * Shadow object representing shadow of this shape. * Backwards incompatibility note?: This property was named "textShadow" (String) until v1.2.11 */ - shadow?: IShadow|string; + shadow?: Shadow|string; /** * Background color of text lines */ @@ -3047,7 +3051,7 @@ export class Text extends Object { * Returns object representation of an instance * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - toObject(propertiesToInclude?: any[]): Object; + toObject(propertiesToInclude?: string[]): any; /** * Returns SVG representation of an instance * @param [reviver] Method for further parsing of svg representation. @@ -3237,7 +3241,7 @@ export class IText extends Object { * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return object representation of an instance */ - toObject(propertiesToInclude?: any[]): Object; + toObject(propertiesToInclude?: string[]): any; setText(value: string): Text; /** @@ -3843,7 +3847,7 @@ export class BaseBrush { * Backwards incompatibility note: This property replaces "shadowColor" (String), "shadowOffsetX" (Number), * "shadowOffsetY" (Number) and "shadowBlur" (Number) since v1.2.12 */ - shadow: IShadow|string; + shadow: Shadow|string; /** * Line endings style of a brush (one of "butt", "round", "square") */ @@ -3924,7 +3928,7 @@ export class PatternBrush extends PencilBrush { /** * Creates path */ - createPath(pathData: string): IPath; + createPath(pathData: string): Path; } export class PencilBrush extends BaseBrush { /** @@ -3937,7 +3941,7 @@ export class PencilBrush extends BaseBrush { * Creates fabric.Path object to add on canvas * @param pathData Path data */ - createPath(pathData: string): IPath; + createPath(pathData: string): Path; } /////////////////////////////////////////////////////////////////////////////// @@ -4258,6 +4262,13 @@ interface IUtilMisc { */ rotatePoint(point: Point, origin: Point, radians: number): Point; + /** + * Rotates `vector` with `radians` + * @param vector The vector to rotate (x and y) + * @param radians The radians of the angle for the rotation + */ + rotateVector(vector: { x: number, y: number }, radians: number): { x: number, y: number }; + /** * Apply transform t to point p * @param p The point to transform @@ -4378,7 +4389,13 @@ interface IUtilMisc { * @param a First transformMatrix * @param b Second transformMatrix */ - multiplyTransformMatrices(a: any[], b: any[]): any[]; + multiplyTransformMatrices(a: number[], b: number[]): number[]; + + /** + * Decomposes standard 2x2 matrix into transform componentes + * @param a transformMatrix + */ + qrDecompose(a: number[]): { angle: number, scaleX: number, scaleY: number, skewX: number, skewY: number, translateX: number, translateY: number }; /** * Returns string representation of function body diff --git a/types/fabric/tsconfig.json b/types/fabric/tsconfig.json index fc7ce8ddc9..93924ce83d 100644 --- a/types/fabric/tsconfig.json +++ b/types/fabric/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/facebook-js-sdk/tsconfig.json b/types/facebook-js-sdk/tsconfig.json index 2ac8efade5..ed029f3557 100644 --- a/types/facebook-js-sdk/tsconfig.json +++ b/types/facebook-js-sdk/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/facebook-pixel/tsconfig.json b/types/facebook-pixel/tsconfig.json index c4cc9bd7fa..487b76e1e4 100644 --- a/types/facebook-pixel/tsconfig.json +++ b/types/facebook-pixel/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/faker/tsconfig.json b/types/faker/tsconfig.json index 33d32cb266..cbf9fdad1c 100644 --- a/types/faker/tsconfig.json +++ b/types/faker/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/faker/v3/tsconfig.json b/types/faker/v3/tsconfig.json index 5cfa258457..53f848d0dc 100644 --- a/types/faker/v3/tsconfig.json +++ b/types/faker/v3/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/falcor-express/tsconfig.json b/types/falcor-express/tsconfig.json index 0f4a36624a..1ba6e4c5c7 100644 --- a/types/falcor-express/tsconfig.json +++ b/types/falcor-express/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/falcor-http-datasource/tsconfig.json b/types/falcor-http-datasource/tsconfig.json index 114a1e5046..948a3c2ffa 100644 --- a/types/falcor-http-datasource/tsconfig.json +++ b/types/falcor-http-datasource/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/falcor-json-graph/tsconfig.json b/types/falcor-json-graph/tsconfig.json index 2753b64668..7ae61b9563 100644 --- a/types/falcor-json-graph/tsconfig.json +++ b/types/falcor-json-graph/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/falcor-router/tsconfig.json b/types/falcor-router/tsconfig.json index 4f37ee59be..4ca1b54a8b 100644 --- a/types/falcor-router/tsconfig.json +++ b/types/falcor-router/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/falcor/tsconfig.json b/types/falcor/tsconfig.json index 94084a9884..3444c09530 100644 --- a/types/falcor/tsconfig.json +++ b/types/falcor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/famous/tsconfig.json b/types/famous/tsconfig.json index e2760ecc02..37897f899c 100644 --- a/types/famous/tsconfig.json +++ b/types/famous/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fancy-log/tsconfig.json b/types/fancy-log/tsconfig.json index 0ef3d95d9e..ec3b2f25de 100644 --- a/types/fancy-log/tsconfig.json +++ b/types/fancy-log/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "fancy-log-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fancybox/tsconfig.json b/types/fancybox/tsconfig.json index e8011cdd21..87689cdc4f 100644 --- a/types/fancybox/tsconfig.json +++ b/types/fancybox/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/farbtastic/tsconfig.json b/types/farbtastic/tsconfig.json index 91f8048ddb..8b812fadc8 100644 --- a/types/farbtastic/tsconfig.json +++ b/types/farbtastic/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fast-diff/tsconfig.json b/types/fast-diff/tsconfig.json index 0c6f0c4ae2..6be0492a01 100644 --- a/types/fast-diff/tsconfig.json +++ b/types/fast-diff/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fast-levenshtein/tsconfig.json b/types/fast-levenshtein/tsconfig.json index 1cb0e8b022..6f108c6f06 100644 --- a/types/fast-levenshtein/tsconfig.json +++ b/types/fast-levenshtein/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/fast-list/tsconfig.json b/types/fast-list/tsconfig.json index ce90acb3cd..94d28d10ba 100644 --- a/types/fast-list/tsconfig.json +++ b/types/fast-list/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fast-stats/tsconfig.json b/types/fast-stats/tsconfig.json index c845c63f47..9439a56f37 100644 --- a/types/fast-stats/tsconfig.json +++ b/types/fast-stats/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fastclick/tsconfig.json b/types/fastclick/tsconfig.json index 494a7b78d7..31d363d25c 100644 --- a/types/fastclick/tsconfig.json +++ b/types/fastclick/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/favico.js/tsconfig.json b/types/favico.js/tsconfig.json index 15047d8dbf..185be44519 100644 --- a/types/favico.js/tsconfig.json +++ b/types/favico.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fb/tsconfig.json b/types/fb/tsconfig.json index 9e8582a781..e38dd69198 100644 --- a/types/fb/tsconfig.json +++ b/types/fb/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fbemitter/tsconfig.json b/types/fbemitter/tsconfig.json index 8032d97e7f..9ebe492c70 100644 --- a/types/fbemitter/tsconfig.json +++ b/types/fbemitter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/featherlight/tsconfig.json b/types/featherlight/tsconfig.json index 32c72beb9f..aa6c592a74 100644 --- a/types/featherlight/tsconfig.json +++ b/types/featherlight/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/feathersjs__authentication-client/feathersjs__authentication-client-tests.ts b/types/feathersjs__authentication-client/feathersjs__authentication-client-tests.ts new file mode 100644 index 0000000000..2a4ea96f91 --- /dev/null +++ b/types/feathersjs__authentication-client/feathersjs__authentication-client-tests.ts @@ -0,0 +1,11 @@ +import feathers from '@feathersjs/feathers'; +import feathersAuthClient from '@feathersjs/authentication-client'; + +const app = feathers(); +app.configure(feathersAuthClient()); +app.authenticate({strategy : 'abcdef'}).then(() => {}); +app.logout().then(() => {}); + +// check if the non-augmented @feathersjs/feathers typings still work +app.on('asd', () => {}); +app.service('asd').get(0).then(() => {}); diff --git a/types/feathersjs__authentication-client/index.d.ts b/types/feathersjs__authentication-client/index.d.ts new file mode 100644 index 0000000000..16f4f4a415 --- /dev/null +++ b/types/feathersjs__authentication-client/index.d.ts @@ -0,0 +1,72 @@ +// Type definitions for @feathersjs/authentication-client 1.0 +// Project: http://feathersjs.com/ +// Definitions by: Abraao Alves , Jan Lohage +// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript + +export default function feathersAuthClient(config?: FeathersAuthClientConfig): () => void; + +export interface FeathersAuthClientConfig { + storage?: Storage; + header?: string; + cookie?: string; + storageKey?: string; + jwtStrategy?: string; + path?: string; + entity?: string; + service?: string; +} + +export interface FeathersAuthCredentials { + strategy: string; + + [index: string]: any; +} + +export const defaults: { + header: string; + cookie: string; + storageKey: string; + jwtStrategy: string; + path: string; + entity: string; + service: string; + timeout: number; +}; + +export interface Passport { + setupSocketListeners(): void; + + connected(): Promise; + + authenticate(credentials?: FeathersAuthCredentials): any; + + authenticateSocket(credentials: FeathersAuthCredentials, socket: any, emit: any): any; + + logoutSocket(socket: any, emit: any): Promise; + + logout(): Promise; + + setJWT(data: any): Promise; + + getJWT(): Promise; + + verifyJWT(token: string): Promise; + + payloadIsValid(payload: string): boolean; + + getCookie(name: string): string; + + clearCookie(name: string): null; + + getStorage(storage: any): any; +} + +declare module '@feathersjs/feathers' { + interface Application { + authenticate(options?: FeathersAuthCredentials): Promise; + + logout(): Promise; + + passport: Passport; + } +} diff --git a/types/feathersjs__authentication-client/tsconfig.json b/types/feathersjs__authentication-client/tsconfig.json new file mode 100644 index 0000000000..77f8c05aef --- /dev/null +++ b/types/feathersjs__authentication-client/tsconfig.json @@ -0,0 +1,33 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "paths": { + "@feathersjs/authentication-client": [ + "feathersjs__authentication-client" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] + } + }, + "files": [ + "index.d.ts", + "feathersjs__authentication-client-tests.ts" + ] +} \ No newline at end of file diff --git a/types/feathersjs__authentication-client/tslint.json b/types/feathersjs__authentication-client/tslint.json new file mode 100644 index 0000000000..a7da90ce21 --- /dev/null +++ b/types/feathersjs__authentication-client/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "strict-export-declare-modifiers": false +} diff --git a/types/feathersjs__authentication-jwt/feathersjs__authentication-jwt-tests.ts b/types/feathersjs__authentication-jwt/feathersjs__authentication-jwt-tests.ts new file mode 100644 index 0000000000..cdcefdcef7 --- /dev/null +++ b/types/feathersjs__authentication-jwt/feathersjs__authentication-jwt-tests.ts @@ -0,0 +1,4 @@ +import feathers, { Application } from '@feathersjs/feathers'; +import feathersAuthenticationJwt from '@feathersjs/authentication-jwt'; + +const app: Application<{}> = feathers().configure(feathersAuthenticationJwt()); diff --git a/types/feathersjs__authentication-jwt/index.d.ts b/types/feathersjs__authentication-jwt/index.d.ts new file mode 100644 index 0000000000..cc9e58be0d --- /dev/null +++ b/types/feathersjs__authentication-jwt/index.d.ts @@ -0,0 +1,68 @@ +// Type definitions for @feathersjs/authentication-jwt 1.0 +// Project: http://feathersjs.com/ +// Definitions by: Jan Lohage +// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript +// TypeScript Version: 2.2 + +import { Application } from '@feathersjs/feathers'; +import { Request } from 'express'; + +export default function feathersAuthenticationJwt(options?: FeathersAuthenticationJWTOptions): () => void; + +export interface FeathersAuthenticationJWTOptions { + /** + * the name to use when invoking the authentication Strategy + */ + name: string; + /** + * the entity that you pull from if an 'id' is present in the payload + */ + entity: string; + /** + * the service to look up the entity + */ + service: string; + /** + * whether the request object should be passed to `verify` + */ + passReqToCallback: boolean; + /** + * a passport-jwt option determining where to parse the JWT + */ + jwtFromRequest: JwtFromRequestFunction; + /** + * Your main secret provided to passport-jwt + */ + secretOrKey: string; + /** + * whether to use sessions, + */ + session: boolean; + /** + * A Verifier class. Defaults to the built-in one but can be a custom one. See below for details. + */ + Verifier: JWTVerifier; +} + +export class JWTVerifier { + constructor(app: Application, options: any); // the class constructor + + verify(req: Request, payload: any, done: (error: any, user?: any, info?: any) => void): void; +} + +export type JwtFromRequestFunction = (req: Request) => string; + +export const ExtractJWT: { + fromHeader(header_name: string): JwtFromRequestFunction; + fromBodyField(field_name: string): JwtFromRequestFunction; + fromUrlQueryParameter(param_name: string): JwtFromRequestFunction; + fromAuthHeaderWithScheme(auth_scheme: string): JwtFromRequestFunction; + fromAuthHeader(): JwtFromRequestFunction; + fromExtractors(extractors: JwtFromRequestFunction[]): JwtFromRequestFunction; + fromAuthHeaderAsBearerToken(): JwtFromRequestFunction; +}; + +export const defaults: { + name: string; + bodyKey: string; +}; diff --git a/types/feathersjs__authentication-jwt/tsconfig.json b/types/feathersjs__authentication-jwt/tsconfig.json new file mode 100644 index 0000000000..6d4d54675f --- /dev/null +++ b/types/feathersjs__authentication-jwt/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "paths": { + "@feathersjs/authentication-jwt": [ + "feathersjs__authentication-jwt" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] + } + }, + "files": [ + "index.d.ts", + "feathersjs__authentication-jwt-tests.ts" + ] +} \ No newline at end of file diff --git a/types/feathersjs__authentication-jwt/tslint.json b/types/feathersjs__authentication-jwt/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/feathersjs__authentication-jwt/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/feathersjs__authentication-local/feathersjs__authentication-local-tests.ts b/types/feathersjs__authentication-local/feathersjs__authentication-local-tests.ts new file mode 100644 index 0000000000..67a3db2c96 --- /dev/null +++ b/types/feathersjs__authentication-local/feathersjs__authentication-local-tests.ts @@ -0,0 +1,4 @@ +import feathers, { Application } from '@feathersjs/feathers'; +import feathersAuthenticationLocal from '@feathersjs/authentication-local'; + +const app: Application<{}> = feathers().configure(feathersAuthenticationLocal()); diff --git a/types/feathersjs__authentication-local/index.d.ts b/types/feathersjs__authentication-local/index.d.ts new file mode 100644 index 0000000000..8b6af17a33 --- /dev/null +++ b/types/feathersjs__authentication-local/index.d.ts @@ -0,0 +1,76 @@ +// Type definitions for @feathersjs/authentication-local 1.0 +// Project: http://feathersjs.com/ +// Definitions by: Jan Lohage +// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript +// TypeScript Version: 2.2 + +import { + Application, + Hook, + Paginated +} from '@feathersjs/feathers'; +import { Request } from 'express'; + +export default function feathersAuthenticationLocal(options?: FeathersAuthenticationLocalOptions): () => void; + +export interface FeathersAuthenticationLocalOptions { + /** + * the name to use when invoking the authentication Strategy + */ + name: string; + /** + * the entity that you're comparing username/password against + */ + entity: string; + /** + * the service to look up the entity + */ + service: string; + /** + * key name of username field on the request + */ + usernameField: string; + /** + * key name of password field on the request + */ + passwordField: string; + /** + * key name of the username field on the entity (defaults to `usernameField`) + */ + entityUsernameField: string; + /** + * key name of the password on the entity (defaults to `passwordField`) + */ + entityPasswordField: string; + /** + * whether the request object should be passed to `verify` + */ + passReqToCallback: boolean; + /** + * whether to use sessions, + */ + session: boolean; + /** + * A Verifier class. Defaults to the built-in one but can be a custom one. See below for details. + */ + Verifier: LocalVerifier; +} + +export class LocalVerifier { + constructor(app: Application, options: any); + + _comparePassword(entity: T, password: string): Promise; // compares password using bcrypt + _normalizeResult(results: T[] | Paginated): Promise; // normalizes result from service to account for pagination + verify(req: Request, username: string, password: string, done: (error: any, user?: any, options?: { message: string }) => void): void; +} + +export namespace hooks { + function hashPassword(options?: any): Hook; // todo: properly type options + function protect(...fields: string[]): Hook; +} + +export const defaults: { + name: string; + usernameField: string; + passwordField: string; +}; diff --git a/types/feathersjs__authentication-local/tsconfig.json b/types/feathersjs__authentication-local/tsconfig.json new file mode 100644 index 0000000000..b68a9d954c --- /dev/null +++ b/types/feathersjs__authentication-local/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "paths": { + "@feathersjs/authentication-local": [ + "feathersjs__authentication-local" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] + } + }, + "files": [ + "index.d.ts", + "feathersjs__authentication-local-tests.ts" + ] +} \ No newline at end of file diff --git a/types/feathersjs__authentication-local/tslint.json b/types/feathersjs__authentication-local/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/feathersjs__authentication-local/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/feathersjs__authentication-oauth1/feathersjs__authentication-oauth1-tests.ts b/types/feathersjs__authentication-oauth1/feathersjs__authentication-oauth1-tests.ts new file mode 100644 index 0000000000..78d1fb358f --- /dev/null +++ b/types/feathersjs__authentication-oauth1/feathersjs__authentication-oauth1-tests.ts @@ -0,0 +1,4 @@ +import feathers, { Application } from '@feathersjs/feathers'; +import feathersAuthenticationOAuth1 from '@feathersjs/authentication-oauth1'; + +const app: Application<{}> = feathers().configure(feathersAuthenticationOAuth1()); diff --git a/types/feathersjs__authentication-oauth1/index.d.ts b/types/feathersjs__authentication-oauth1/index.d.ts new file mode 100644 index 0000000000..54d4d2614a --- /dev/null +++ b/types/feathersjs__authentication-oauth1/index.d.ts @@ -0,0 +1,69 @@ +// Type definitions for @feathersjs/authentication-oauth1 1.0 +// Project: http://feathersjs.com/ +// Definitions by: Jan Lohage +// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript +// TypeScript Version: 2.2 + +import { + Application, + Paginated +} from '@feathersjs/feathers'; +import { Request } from 'express'; + +export default function feathersAuthenticationOAuth1(options?: FeathersAuthenticationOAuth1Options): () => void; + +export interface FeathersAuthenticationOAuth1Options { + /** + * The field to look up the entity by when logging in with the provider. Defaults to 'Id' (ie. 'twitterId'). + */ + idField: string; + /** + * The route to register the middleware + */ + path: string; + /** + * The route to register the callback handler + */ + callbackPath: string; + /** + * hostname[:port]/auth//callback', + */ + callbackURL: string; + /** + * the entity that you are looking up + */ + entity: string; + /** + * the service to look up the entity + */ + service: string; + /** + * whether the request object should be passed to `verify` + */ + passReqToCallback: boolean; + /** + * whether to use sessions, + */ + session: boolean; + /** + * Express middleware for handling the oauth callback. Defaults to the built in middleware. todo: needs a proper type + */ + handler: any; + /** + * The response formatter. Defaults the the built in feathers-rest formatter, which returns JSON. todo: needs a proper type + */ + formatter: any; + /** + * A Verifier class. Defaults to the built-in one but can be a custom one. See below for details. + */ + Verifier: OAuth1Verifier; +} + +export class OAuth1Verifier { + constructor(app: Application, options: any); + + _updateEntity(entity: any, data: { profile: any, accessToken: string, refreshToken: string }): Promise; // updates an existing entity + _createEntity(data: { profile: any, accessToken: string, refreshToken: string }): Promise; // creates an entity if they didn't exist already + _normalizeResult(results: T[] | Paginated): Promise; // normalizes result from service to account for pagination + verify(req: Request, accessToken: string, refreshToken: string, profile: any, done: (err: Error | null, user: object, info: object) => void): void; +} diff --git a/types/feathersjs__authentication-oauth1/tsconfig.json b/types/feathersjs__authentication-oauth1/tsconfig.json new file mode 100644 index 0000000000..1e7967d274 --- /dev/null +++ b/types/feathersjs__authentication-oauth1/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "paths": { + "@feathersjs/authentication-oauth1": [ + "feathersjs__authentication-oauth1" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] + } + }, + "files": [ + "index.d.ts", + "feathersjs__authentication-oauth1-tests.ts" + ] +} \ No newline at end of file diff --git a/types/feathersjs__authentication-oauth1/tslint.json b/types/feathersjs__authentication-oauth1/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/feathersjs__authentication-oauth1/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/feathersjs__authentication-oauth2/feathersjs__authentication-oauth2-tests.ts b/types/feathersjs__authentication-oauth2/feathersjs__authentication-oauth2-tests.ts new file mode 100644 index 0000000000..f5ebaa4c1a --- /dev/null +++ b/types/feathersjs__authentication-oauth2/feathersjs__authentication-oauth2-tests.ts @@ -0,0 +1,4 @@ +import feathers, { Application } from '@feathersjs/feathers'; +import feathersAuthenticationOAuth2 from '@feathersjs/authentication-oauth2'; + +const app: Application<{}> = feathers().configure(feathersAuthenticationOAuth2()); diff --git a/types/feathersjs__authentication-oauth2/index.d.ts b/types/feathersjs__authentication-oauth2/index.d.ts new file mode 100644 index 0000000000..5ac6976dac --- /dev/null +++ b/types/feathersjs__authentication-oauth2/index.d.ts @@ -0,0 +1,71 @@ +// Type definitions for @feathersjs/authentication-oauth2 1.0 +// Project: http://feathersjs.com/ +// Definitions by: Jan Lohage +// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript +// TypeScript Version: 2.2 + +import { + Application, + Paginated +} from '@feathersjs/feathers'; +import { Request } from 'express'; + +export default function feathersAuthenticationOAuth2(options?: FeathersAuthenticationOAuth2Options): () => void; + +export interface FeathersAuthenticationOAuth2Options { + /** + * The field to look up the entity by when logging in with the provider. Defaults to 'Id' (ie. 'facebookId'). + */ + idField: string; + /** + * The route to register the middleware + */ + path: string; + /** + * The route to register the callback handler + */ + callbackPath: string; + /** + * The callback url. + */ + callbackURL: string; + successRedirect: string; + failureRedirect: string; + /** + * the entity that you are looking up + */ + entity: string; + /** + * the service to look up the entity + */ + service: string; + /** + * whether the request object should be passed to `verify` + */ + passReqToCallback: boolean; + /** + * whether to use sessions, + */ + session: boolean; + /** + * Express middleware for handling the oauth callback. Defaults to the built in middleware. todo: needs a proper type + */ + handler: any; + /** + * The response formatter. Defaults the the built in feathers-rest formatter, which returns JSON. todo: needs a proper type + */ + formatter: any; + /** + * A Verifier class. Defaults to the built-in one but can be a custom one. See below for details. + */ + Verifier: OAuth2Verifier; +} + +export class OAuth2Verifier { + constructor(app: Application, options: any) + + _updateEntity(entity: any, data: { profile: any, accessToken: string, refreshToken: string }): Promise; // updates an existing entity + _createEntity(data: { profile: any, accessToken: string, refreshToken: string }): Promise; // creates an entity if they didn't exist already + _normalizeResult(results: T[] | Paginated): Promise; // normalizes result from service to account for pagination + verify(req: Request, accessToken: string, refreshToken: string, profile: any, done: (err: Error | null, user: object, info: object) => void): void; +} diff --git a/types/feathersjs__authentication-oauth2/tsconfig.json b/types/feathersjs__authentication-oauth2/tsconfig.json new file mode 100644 index 0000000000..6fdc874a04 --- /dev/null +++ b/types/feathersjs__authentication-oauth2/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "paths": { + "@feathersjs/authentication-oauth2": [ + "feathersjs__authentication-oauth2" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] + } + }, + "files": [ + "index.d.ts", + "feathersjs__authentication-oauth2-tests.ts" + ] +} \ No newline at end of file diff --git a/types/feathersjs__authentication-oauth2/tslint.json b/types/feathersjs__authentication-oauth2/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/feathersjs__authentication-oauth2/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/feathersjs__authentication/feathersjs__authentication-tests.ts b/types/feathersjs__authentication/feathersjs__authentication-tests.ts new file mode 100644 index 0000000000..59eb096902 --- /dev/null +++ b/types/feathersjs__authentication/feathersjs__authentication-tests.ts @@ -0,0 +1,4 @@ +import feathers from '@feathersjs/feathers'; +import feathersAuthentication from '@feathersjs/authentication'; + +feathers().configure(feathersAuthentication({})); diff --git a/types/feathersjs__authentication/index.d.ts b/types/feathersjs__authentication/index.d.ts new file mode 100644 index 0000000000..3a4722f12e --- /dev/null +++ b/types/feathersjs__authentication/index.d.ts @@ -0,0 +1,106 @@ +// Type definitions for @feathersjs/authentication 2.1 +// Project: http://feathersjs.com/ +// Definitions by: Abraao Alves , Jan Lohage +// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript + +import { Hook } from '@feathersjs/feathers'; + +export default function feathersAuthentication(config?: FeathersAuthenticationOptions): () => void; + +export const hooks: AuthHooks.Hooks; + +export interface FeathersAuthenticationOptions { + path?: string; + header?: string; + entity?: string; + service?: string; + passReqToCallback?: boolean; + session?: boolean; + cookie?: { + enabled?: boolean; + name?: string; + httpOnly?: boolean; + secure?: boolean; + }; + jwt?: { + /** + * By default is an access token + */ + header?: { + [key: string]: any + }; + + /** + * The resource server where the token is processed + */ + audience?: string; + + /** + * Typically the entity id associated with the JWT + */ + subject?: string; + + /** + * The issuing server, application or resource + */ + issuer?: string; + algorithm?: string; + expiresIn?: string; + }; +} + +export namespace AuthHooks { + interface HashPassOptions { + passwordField: string; + } + + interface RestrictOptions { + ownerField: string; + idField: string; + } + + interface Hooks { + authenticate(strategies: string[] | string): Hook; + + /** + * The `verifyToken` hook will attempt to verify a token. + * If the token is missing or is invalid it returns an error. + * If the token is valid it adds the decrypted payload to hook.params.payload which contains the user id. + * It is intended to be used as a before hook on any of the service methods. + * + */ + verifyToken(options?: any): Hook; + + /** + * The populateUser hook is for populating a user based on an id. + * It can be used on any service method as either a before or after hook. + * It is called internally after a token is created. + * + */ + populateUser(options?: any): Hook; + + /** + * The `restrictToAuthenticated` hook throws an error if there isn't a logged-in user by checking for the `hook.params.user` object. + * It can be used on any service method and is intended to be used as a before hook. + * It doesn't take any arguments. + * + */ + restrictToAuthenticated(): Hook; + + /** + * `restrictToOwner` is meant to be used as a before hook. + * It only allows the user to retrieve resources that are owned by them. + * It will return a *Forbidden* error without the proper permissions. + * It can be used on `get`, `create`, `update`, `patch` or `remove` methods. + * + */ + restrictToOwner(options?: RestrictOptions): Hook; + + /** + * The `hashPassword` hook will automatically hash the data coming in on the provided passwordField. + * It is intended to be used as a before hook on the user service for the create, update, or patch methods. + * + */ + hashPassword(options?: HashPassOptions): Hook; + } +} diff --git a/types/feathersjs__authentication/tsconfig.json b/types/feathersjs__authentication/tsconfig.json new file mode 100644 index 0000000000..6a7bb9fd07 --- /dev/null +++ b/types/feathersjs__authentication/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "paths": { + "@feathersjs/authentication": [ + "feathersjs__authentication" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] + } + }, + "files": [ + "index.d.ts", + "feathersjs__authentication-tests.ts" + ] +} \ No newline at end of file diff --git a/types/feathersjs__authentication/tslint.json b/types/feathersjs__authentication/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/feathersjs__authentication/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/feathersjs__configuration/feathersjs__configuration-tests.ts b/types/feathersjs__configuration/feathersjs__configuration-tests.ts new file mode 100644 index 0000000000..10e74958f1 --- /dev/null +++ b/types/feathersjs__configuration/feathersjs__configuration-tests.ts @@ -0,0 +1,4 @@ +import feathers, { Application } from '@feathersjs/feathers'; +import feathersConfiguration from '@feathersjs/configuration'; + +const app: Application<{}> = feathers().configure(feathersConfiguration()); diff --git a/types/feathersjs__configuration/index.d.ts b/types/feathersjs__configuration/index.d.ts new file mode 100644 index 0000000000..fe597c8360 --- /dev/null +++ b/types/feathersjs__configuration/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for @feathersjs/configuration 1.0 +// Project: http://feathersjs.com/ +// Definitions by: Jan Lohage +// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript + +import { Application } from '@feathersjs/feathers'; + +export default function feathersConfiguration(): (app: Application) => Application; diff --git a/types/feathersjs__configuration/tsconfig.json b/types/feathersjs__configuration/tsconfig.json new file mode 100644 index 0000000000..9d6cd3ea8f --- /dev/null +++ b/types/feathersjs__configuration/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "paths": { + "@feathersjs/configuration": [ + "feathersjs__configuration" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] + } + }, + "files": [ + "index.d.ts", + "feathersjs__configuration-tests.ts" + ] +} \ No newline at end of file diff --git a/types/feathersjs__configuration/tslint.json b/types/feathersjs__configuration/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/feathersjs__configuration/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/feathersjs__errors/feathersjs__errors-tests.ts b/types/feathersjs__errors/feathersjs__errors-tests.ts new file mode 100644 index 0000000000..977040010a --- /dev/null +++ b/types/feathersjs__errors/feathersjs__errors-tests.ts @@ -0,0 +1,25 @@ +import { + BadGateway, + BadRequest, Conflict, FeathersError, Forbidden, GeneralError, LengthRequired, MethodNotAllowed, NotAcceptable, + NotAuthenticated, NotFound, NotImplemented, PaymentError, Timeout, TooManyRequests, Unavailable, Unprocessable +} from '@feathersjs/errors'; + +import * as errHandler from '@feathersjs/errors/handler'; +import * as notFound from '@feathersjs/errors/not-found'; + +const e0: FeathersError = new BadRequest('test'); +const e1: FeathersError = new NotAuthenticated('test'); +const e2: FeathersError = new PaymentError('test'); +const e3: FeathersError = new Forbidden('test'); +const e4: FeathersError = new NotFound('test'); +const e5: FeathersError = new MethodNotAllowed('test'); +const e6: FeathersError = new NotAcceptable('test'); +const e7: FeathersError = new Timeout('test'); +const e8: FeathersError = new Conflict('test'); +const e9: FeathersError = new LengthRequired('test'); +const e10: FeathersError = new Unprocessable('test'); +const e11: FeathersError = new TooManyRequests('test'); +const e12: FeathersError = new GeneralError('test'); +const e13: FeathersError = new NotImplemented('test'); +const e14: FeathersError = new BadGateway('test'); +const e15: FeathersError = new Unavailable('test'); diff --git a/types/feathersjs__errors/handler.d.ts b/types/feathersjs__errors/handler.d.ts new file mode 100644 index 0000000000..4525e39773 --- /dev/null +++ b/types/feathersjs__errors/handler.d.ts @@ -0,0 +1,7 @@ +import { ErrorRequestHandler } from 'express'; + +declare function handler(options?: any): ErrorRequestHandler; + +declare namespace handler {} + +export = handler; diff --git a/types/feathersjs__errors/index.d.ts b/types/feathersjs__errors/index.d.ts new file mode 100644 index 0000000000..9eacd9ce7e --- /dev/null +++ b/types/feathersjs__errors/index.d.ts @@ -0,0 +1,98 @@ +// Type definitions for @feathersjs/errors 3.2 +// Project: http://feathersjs.com/ +// Definitions by: Jan Lohage +// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript +// TypeScript Version: 2.2 + +export class FeathersError extends Error { + constructor(msg: string | Error, name: string, code: number, className: string, data: any) +} + +export class BadRequest extends FeathersError { + constructor(msg: string | Error, data?: any); +} + +export class NotAuthenticated extends FeathersError { + constructor(msg: string | Error, data?: any); +} + +export class PaymentError extends FeathersError { + constructor(msg: string | Error, data?: any); +} + +export class Forbidden extends FeathersError { + constructor(msg: string | Error, data?: any); +} + +export class NotFound extends FeathersError { + constructor(msg: string | Error, data?: any); +} + +export class MethodNotAllowed extends FeathersError { + constructor(msg: string | Error, data?: any); +} + +export class NotAcceptable extends FeathersError { + constructor(msg: string | Error, data?: any); +} + +export class Timeout extends FeathersError { + constructor(msg: string | Error, data?: any); +} + +export class Conflict extends FeathersError { + constructor(msg: string | Error, data?: any); +} + +export class LengthRequired extends FeathersError { + constructor(msg: string | Error, data?: any); +} + +export class Unprocessable extends FeathersError { + constructor(msg: string | Error, data?: any); +} + +export class TooManyRequests extends FeathersError { + constructor(msg: string | Error, data?: any); +} + +export class GeneralError extends FeathersError { + constructor(msg: string | Error, data?: any); +} + +export class NotImplemented extends FeathersError { + constructor(msg: string | Error, data?: any); +} + +export class BadGateway extends FeathersError { + constructor(msg: string | Error, data?: any); +} + +export class Unavailable extends FeathersError { + constructor(msg: string | Error, data?: any); +} + +export interface Errors { + FeathersError: FeathersError; + BadRequest: BadRequest; + NotAuthenticated: NotAuthenticated; + PaymentError: PaymentError; + Forbidden: Forbidden; + NotFound: NotFound; + MethodNotAllowed: MethodNotAllowed; + NotAcceptable: NotAcceptable; + Timeout: Timeout; + Conflict: Conflict; + LengthRequired: LengthRequired; + Unprocessable: Unprocessable; + TooManyRequests: TooManyRequests; + GeneralError: GeneralError; + NotImplemented: NotImplemented; + BadGateway: BadGateway; + Unavailable: Unavailable; +} + +export function convert(error: any): FeathersError; + +export const types: Errors; +export const errors: Errors; diff --git a/types/feathersjs__errors/not-found.d.ts b/types/feathersjs__errors/not-found.d.ts new file mode 100644 index 0000000000..453b3aded9 --- /dev/null +++ b/types/feathersjs__errors/not-found.d.ts @@ -0,0 +1,7 @@ +import { RequestHandler } from 'express'; + +declare function notFound(): RequestHandler; + +declare namespace notFound {} + +export = notFound; diff --git a/types/feathersjs__errors/tsconfig.json b/types/feathersjs__errors/tsconfig.json new file mode 100644 index 0000000000..112341f970 --- /dev/null +++ b/types/feathersjs__errors/tsconfig.json @@ -0,0 +1,37 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "paths": { + "@feathersjs/errors": [ + "feathersjs__errors" + ], + "@feathersjs/errors/handler": [ + "feathersjs__errors/handler" + ], + "@feathersjs/errors/not-found": [ + "feathersjs__errors/not-found" + ] + } + }, + "files": [ + "index.d.ts", + "feathersjs__errors-tests.ts", + "handler.d.ts", + "not-found.d.ts" + ] +} \ No newline at end of file diff --git a/types/feathersjs__errors/tslint.json b/types/feathersjs__errors/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/feathersjs__errors/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/feathersjs__express/feathersjs__express-tests.ts b/types/feathersjs__express/feathersjs__express-tests.ts new file mode 100644 index 0000000000..687191d0c6 --- /dev/null +++ b/types/feathersjs__express/feathersjs__express-tests.ts @@ -0,0 +1,8 @@ +import feathers, { Application } from '@feathersjs/feathers'; +import feathersExpress, { original, rest, notFound, errorHandler } from '@feathersjs/express'; + +const app = feathersExpress(feathers()); + +app.configure(rest()); +app.use(notFound()); +app.use(errorHandler()); diff --git a/types/feathersjs__express/index.d.ts b/types/feathersjs__express/index.d.ts new file mode 100644 index 0000000000..eb49f00a78 --- /dev/null +++ b/types/feathersjs__express/index.d.ts @@ -0,0 +1,48 @@ +// Type definitions for @feathersjs/express 1.1 +// Project: http://feathersjs.com/ +// Definitions by: Jan Lohage +// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript +// TypeScript Version: 2.2 + +import { Application as FeathersApplication } from '@feathersjs/feathers'; +import * as express from 'express'; + +export default function feathersExpress(app: FeathersApplication): Application; +export type Application = express.Application & FeathersApplication; + +export function errorHandler(options?: any): express.ErrorRequestHandler; +export function notFound(): express.RequestHandler; +export const rest: { + (): () => void; + formatter: express.RequestHandler; +}; + +/* + * Re-export of the express package. + **/ + +export { + CookieOptions, + Errback, + ErrorRequestHandler, + Express, + Handler, + IRoute, + IRouter, + IRouterHandler, + IRouterMatcher, + json, + MediaType, + NextFunction, + Request, + RequestHandler, + RequestParamHandler, + Response, + Router, + RouterOptions, + Send, + static, + urlencoded +} from 'express'; + +export const original: typeof express; diff --git a/types/feathersjs__express/tsconfig.json b/types/feathersjs__express/tsconfig.json new file mode 100644 index 0000000000..11bee295a0 --- /dev/null +++ b/types/feathersjs__express/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "paths": { + "@feathersjs/express": [ + "feathersjs__express" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] + } + }, + "files": [ + "index.d.ts", + "feathersjs__express-tests.ts" + ] +} \ No newline at end of file diff --git a/types/feathersjs__express/tslint.json b/types/feathersjs__express/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/feathersjs__express/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/feathersjs__feathers/feathersjs__feathers-tests.ts b/types/feathersjs__feathers/feathersjs__feathers-tests.ts new file mode 100644 index 0000000000..a624187c68 --- /dev/null +++ b/types/feathersjs__feathers/feathersjs__feathers-tests.ts @@ -0,0 +1,16 @@ +import feathers, { Application } from '@feathersjs/feathers'; + +interface User { + id: number; + name: string; +} + +interface Services { + users: User; +} + +const app = feathers() as Application; + +app.service('users').get(0).then(u => { + const user: User = u; +}); diff --git a/types/feathersjs__feathers/index.d.ts b/types/feathersjs__feathers/index.d.ts new file mode 100644 index 0000000000..c10a173f06 --- /dev/null +++ b/types/feathersjs__feathers/index.d.ts @@ -0,0 +1,135 @@ +// Type definitions for @feathersjs/feathers 3.0 +// Project: http://feathersjs.com/ +// Definitions by: Jan Lohage , Abraao Alves +// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript + +// TypeScript Version: 2.2 + +/// + +import { EventEmitter } from 'events'; + +export default function feathers(): Application; + +export const version: string; + +export type Id = number | string; +export type NullableId = Id | null; + +export interface Query { + [key: string]: any; +} + +export interface PaginationOptions { + default: number; + max: number; +} + +export type ClientSideParams = Pick; +export type ServerSideParams = Params; + +export interface Params { + query?: Query; + paginate: false | Pick; + + [key: string]: any; // (JL) not sure if we want this +} + +export interface Paginated { + total: number; + limit: number; + skip: number; + data: T[]; +} + +export type Hook = (hook: HookContext) => (Promise> | undefined); + +export interface HookContext { + app?: Application; + data?: T; + error?: any; + id?: string | number; + method?: string; + params?: Params; + path?: string; + result?: T; + service: Service; + type: 'before' | 'after' | 'error'; +} + +export interface HookMap { + all: Hook | Hook[]; + find: Hook | Hook[]; + get: Hook | Hook[]; + create: Hook | Hook[]; + update: Hook | Hook[]; + patch: Hook | Hook[]; + remove: Hook | Hook[]; +} + +export interface HooksObject { + before: Partial; + after: Partial; + error: Partial; +} + +// todo: figure out what to do: These methods don't actually need to be implemented, so they can be undefined at runtime. Yet making them optional gets cumbersome in strict mode. +export interface ServiceMethods { + find(params?: Params): Promise>; + + get(id: Id, params?: Params): Promise; + + create(data: Partial | Array>, params?: Params): Promise; + + update(id: NullableId, data: T, params?: Params): Promise; + + patch(id: NullableId, data: Partial, params?: Params): Promise; + + remove(id: NullableId, params?: Params): Promise; +} + +export interface SetupMethod { + setup(app: Application, path: string): void; +} + +export interface ServiceOverloads { + create(data: Array>, params?: Params): Promise; + + create(data: Partial, params?: Params): Promise; + + patch(id: NullableId, data: Pick, params?: Params): Promise; +} + +export interface ServiceAddons extends EventEmitter { + hooks(hooks: Partial): this; +} + +export type Service = ServiceOverloads & ServiceAddons & ServiceMethods; + +export interface Application extends EventEmitter { + get(name: string): any; + + set(name: string, value: any): this; + + disable(name: string): this; + + disabled(name: string): boolean; + + enable(name: string): this; + + enabled(name: string): boolean; + + configure(callback: (this: this, app: this) => void): this; + + hooks(hooks: Partial): this; + + setup(server?: any): this; + + service(location: L): Service; + + service(location: string): Service; + + use(path: string, service: Partial & SetupMethod> | Application, options?: any): this; + + version: string; +} diff --git a/types/feathersjs__feathers/tsconfig.json b/types/feathersjs__feathers/tsconfig.json new file mode 100644 index 0000000000..883aecabb3 --- /dev/null +++ b/types/feathersjs__feathers/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es2015" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "paths": { + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] + } + }, + "files": [ + "index.d.ts", + "feathersjs__feathers-tests.ts" + ] +} \ No newline at end of file diff --git a/types/feathersjs__feathers/tslint.json b/types/feathersjs__feathers/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/feathersjs__feathers/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/feathersjs__primus-client/feathersjs__primus-client-tests.ts b/types/feathersjs__primus-client/feathersjs__primus-client-tests.ts new file mode 100644 index 0000000000..66b2553c63 --- /dev/null +++ b/types/feathersjs__primus-client/feathersjs__primus-client-tests.ts @@ -0,0 +1,4 @@ +import feathers, { Application } from '@feathersjs/feathers'; +import feathersPrimusClient from '@feathersjs/primus-client'; + +const app: Application<{}> = feathers().configure(feathersPrimusClient({})); diff --git a/types/feathersjs__primus-client/index.d.ts b/types/feathersjs__primus-client/index.d.ts new file mode 100644 index 0000000000..4e51cd159c --- /dev/null +++ b/types/feathersjs__primus-client/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for @feathersjs/primus-client 1.0 +// Project: http://feathersjs.com/ +// Definitions by: Jan Lohage +// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript + +// primus removed its typings from the repo https://github.com/primus/primus/pull/623, as of 01/2018 there are none on DT +export default function feathersPrimusClient(socket: any, options?: FeathersPrimusClientOptions): () => void; + +export interface FeathersPrimusClientOptions { + timeout?: number; +} diff --git a/types/feathersjs__primus-client/tsconfig.json b/types/feathersjs__primus-client/tsconfig.json new file mode 100644 index 0000000000..504dce34d1 --- /dev/null +++ b/types/feathersjs__primus-client/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "paths": { + "@feathersjs/primus-client": [ + "feathersjs__primus-client" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] + } + }, + "files": [ + "index.d.ts", + "feathersjs__primus-client-tests.ts" + ] +} \ No newline at end of file diff --git a/types/feathersjs__primus-client/tslint.json b/types/feathersjs__primus-client/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/feathersjs__primus-client/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/feathersjs__primus/feathersjs__primus-tests.ts b/types/feathersjs__primus/feathersjs__primus-tests.ts new file mode 100644 index 0000000000..1b4202afc6 --- /dev/null +++ b/types/feathersjs__primus/feathersjs__primus-tests.ts @@ -0,0 +1,4 @@ +import feathers, { Application } from '@feathersjs/feathers'; +import feathersPrimus from '@feathersjs/primus'; + +const app: Application<{}> = feathers().configure(feathersPrimus({})); diff --git a/types/feathersjs__primus/index.d.ts b/types/feathersjs__primus/index.d.ts new file mode 100644 index 0000000000..5d93843822 --- /dev/null +++ b/types/feathersjs__primus/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for @feathersjs/primus 3.0 +// Project: http://feathersjs.com/ +// Definitions by: Jan Lohage +// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript +// TypeScript Version: 2.3 + +/// + +// primus removed its typings from the repo https://github.com/primus/primus/pull/623, as of 01/2018 there are none on DT +export default function feathersPrimus(options: any, callback?: (primus: any) => void): () => void; diff --git a/types/feathersjs__primus/tsconfig.json b/types/feathersjs__primus/tsconfig.json new file mode 100644 index 0000000000..b7815424ec --- /dev/null +++ b/types/feathersjs__primus/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "paths": { + "@feathersjs/primus": [ + "feathersjs__primus" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] + } + }, + "files": [ + "index.d.ts", + "feathersjs__primus-tests.ts" + ] +} \ No newline at end of file diff --git a/types/feathersjs__primus/tslint.json b/types/feathersjs__primus/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/feathersjs__primus/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/feathersjs__rest-client/feathersjs__rest-client-tests.ts b/types/feathersjs__rest-client/feathersjs__rest-client-tests.ts new file mode 100644 index 0000000000..2b7e49481e --- /dev/null +++ b/types/feathersjs__rest-client/feathersjs__rest-client-tests.ts @@ -0,0 +1 @@ +const dummy: any = null; diff --git a/types/feathersjs__rest-client/index.d.ts b/types/feathersjs__rest-client/index.d.ts new file mode 100644 index 0000000000..22e5f1084b --- /dev/null +++ b/types/feathersjs__rest-client/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for @feathersjs/rest-client 1.3 +// Project: http://feathersjs.com/ +// Definitions by: Jan Lohage +// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript + +// todo: get rid of all the anys + +export default function feathersRestClient(base: string): Transport; + +export interface HandlerResult extends Function { + /** + * initialize service + */ + (): void; + + /** + * Transport Service + */ + Service: any; + + /** + * default Service + */ + service: any; +} + +export type Handler = (connection: any, options?: any) => () => HandlerResult; + +export interface Transport { + jquery: Handler; + superagent: Handler; + request: Handler; + fetch: Handler; + axios: Handler; + angular: Handler; + angularHttpClient: Handler; +} diff --git a/types/feathersjs__rest-client/tsconfig.json b/types/feathersjs__rest-client/tsconfig.json new file mode 100644 index 0000000000..7a4207ff11 --- /dev/null +++ b/types/feathersjs__rest-client/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "paths": { + "@feathersjs/rest-client": [ + "feathersjs__rest-client" + ] + } + }, + "files": [ + "index.d.ts", + "feathersjs__rest-client-tests.ts" + ] +} \ No newline at end of file diff --git a/types/feathersjs__rest-client/tslint.json b/types/feathersjs__rest-client/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/feathersjs__rest-client/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/feathersjs__socket-commons/feathersjs__socket-commons-tests.ts b/types/feathersjs__socket-commons/feathersjs__socket-commons-tests.ts new file mode 100644 index 0000000000..e52fa00d78 --- /dev/null +++ b/types/feathersjs__socket-commons/feathersjs__socket-commons-tests.ts @@ -0,0 +1,9 @@ +import feathers from '@feathersjs/feathers'; + +const app = feathers(); + +app.channel('abc').send({}); + +// check if the non-augmented @feathersjs/feathers typings still work +app.on('asd', () => {}); +app.service('asd').get(0).then(() => {}); diff --git a/types/feathersjs__socket-commons/index.d.ts b/types/feathersjs__socket-commons/index.d.ts new file mode 100644 index 0000000000..fca658bf76 --- /dev/null +++ b/types/feathersjs__socket-commons/index.d.ts @@ -0,0 +1,35 @@ +// Type definitions for @feathersjs/socket-commons 3.1 +// Project: http://feathersjs.com/ +// Definitions by: Jan Lohage +// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript +// TypeScript Version: 2.3 + +import { HookContext } from '@feathersjs/feathers'; + +export type Connection = any; // todo: spec connection + +export interface Channel { + join(...connections: Connection[]): this; + + leave(...connections: Connection[]): this; + + filter(callback: (connection: Connection) => boolean): Channel; + + send(data: any): this; +} + +declare module '@feathersjs/feathers' { + interface ServiceAddons { + publish(callback: (data: T, hook: HookContext) => Channel): this; + + publish(event: string, callback: (data: T, hook: HookContext) => Channel): this; + } + + interface Application { + channel(...names: string[]): Channel; + + publish(callback: (data: T, hook: HookContext) => Channel | Channel[]): Application; + + publish(event: string, callback: (data: T, hook: HookContext) => Channel | Channel[]): Application; + } +} diff --git a/types/feathersjs__socket-commons/tsconfig.json b/types/feathersjs__socket-commons/tsconfig.json new file mode 100644 index 0000000000..8e63744a7f --- /dev/null +++ b/types/feathersjs__socket-commons/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "paths": { + "@feathersjs/socket-commons": [ + "feathersjs__socket-commons" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] + } + }, + "files": [ + "index.d.ts", + "feathersjs__socket-commons-tests.ts" + ] +} \ No newline at end of file diff --git a/types/feathersjs__socket-commons/tslint.json b/types/feathersjs__socket-commons/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/feathersjs__socket-commons/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/feathersjs__socketio-client/feathersjs__socketio-client-tests.ts b/types/feathersjs__socketio-client/feathersjs__socketio-client-tests.ts new file mode 100644 index 0000000000..80fa6cf4ba --- /dev/null +++ b/types/feathersjs__socketio-client/feathersjs__socketio-client-tests.ts @@ -0,0 +1,10 @@ +import feathers, { Application } from '@feathersjs/feathers'; +import feathersSocketIOClient from '@feathersjs/socketio-client'; + +import * as io from 'socket.io-client'; + +const socket = io(); +const app: Application<{}> = feathers(); + +app.configure(feathersSocketIOClient(socket)); +app.configure(feathersSocketIOClient(socket, { timeout: 1337 })); diff --git a/types/feathersjs__socketio-client/index.d.ts b/types/feathersjs__socketio-client/index.d.ts new file mode 100644 index 0000000000..f155bc50de --- /dev/null +++ b/types/feathersjs__socketio-client/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for @feathersjs/socketio-client 1.0 +// Project: http://feathersjs.com/ +// Definitions by: Jan Lohage +// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript + +/// + +export default function feathersSocketIOClient(socket: SocketIOClient.Socket, options?: FeathersSocketIOClientOptions): () => void; + +export interface FeathersSocketIOClientOptions { + timeout?: number; +} diff --git a/types/feathersjs__socketio-client/tsconfig.json b/types/feathersjs__socketio-client/tsconfig.json new file mode 100644 index 0000000000..c526cdcb5c --- /dev/null +++ b/types/feathersjs__socketio-client/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "paths": { + "@feathersjs/socketio-client": [ + "feathersjs__socketio-client" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] + } + }, + "files": [ + "index.d.ts", + "feathersjs__socketio-client-tests.ts" + ] +} \ No newline at end of file diff --git a/types/feathersjs__socketio-client/tslint.json b/types/feathersjs__socketio-client/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/feathersjs__socketio-client/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/feathersjs__socketio/feathersjs__socketio-tests.ts b/types/feathersjs__socketio/feathersjs__socketio-tests.ts new file mode 100644 index 0000000000..5b997b25a4 --- /dev/null +++ b/types/feathersjs__socketio/feathersjs__socketio-tests.ts @@ -0,0 +1,10 @@ +import feathers, { Application } from '@feathersjs/feathers'; +import feathersSocketIO from '@feathersjs/socketio'; + +const app: Application<{}> = feathers(); + +app.configure(feathersSocketIO(1337, {})); +app.configure(feathersSocketIO(io => {})); +app.configure(feathersSocketIO({}, io => {})); +app.configure(feathersSocketIO(1337, io => {})); +app.configure(feathersSocketIO(1337, {}, io => {})); diff --git a/types/feathersjs__socketio/index.d.ts b/types/feathersjs__socketio/index.d.ts new file mode 100644 index 0000000000..34b78eb749 --- /dev/null +++ b/types/feathersjs__socketio/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for @feathersjs/socketio 3.0 +// Project: http://feathersjs.com/ +// Definitions by: Jan Lohage +// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript +// TypeScript Version: 2.3 + +/// +/// + +export default function feathersSocketIO(callback: (io: SocketIO.Server) => void): () => void; +export default function feathersSocketIO(options: number | SocketIO.ServerOptions, callback?: (io: SocketIO.Server) => void): () => void; +export default function feathersSocketIO(port: number, options?: SocketIO.ServerOptions, callback?: (io: SocketIO.Server) => void): () => void; diff --git a/types/feathersjs__socketio/tsconfig.json b/types/feathersjs__socketio/tsconfig.json new file mode 100644 index 0000000000..69a3f5c66f --- /dev/null +++ b/types/feathersjs__socketio/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "paths": { + "@feathersjs/socketio": [ + "feathersjs__socketio" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] + } + }, + "files": [ + "index.d.ts", + "feathersjs__socketio-tests.ts" + ] +} \ No newline at end of file diff --git a/types/feathersjs__socketio/tslint.json b/types/feathersjs__socketio/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/feathersjs__socketio/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/feedme/tsconfig.json b/types/feedme/tsconfig.json index aa5f186309..cdd8460fac 100644 --- a/types/feedme/tsconfig.json +++ b/types/feedme/tsconfig.json @@ -14,7 +14,8 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, - "strictFunctionTypes" : false + "esModuleInterop": true, + "strictFunctionTypes": false }, "files": [ "index.d.ts", diff --git a/types/feedparser/feedparser-tests.ts b/types/feedparser/feedparser-tests.ts index 25d652de8c..1b35498a5e 100644 --- a/types/feedparser/feedparser-tests.ts +++ b/types/feedparser/feedparser-tests.ts @@ -1,5 +1,5 @@ import request = require('request'); -import * as FeedParser from "feedparser"; +import FeedParser = require("feedparser"); const req = request('https://news.google.com/news?cf=all&hl=en&pz=1&ned=us&output=rss'); const feedparser = new FeedParser({}); diff --git a/types/feedparser/tsconfig.json b/types/feedparser/tsconfig.json index 683adf9415..d60dcdde12 100644 --- a/types/feedparser/tsconfig.json +++ b/types/feedparser/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "feedparser-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fetch-jsonp/tsconfig.json b/types/fetch-jsonp/tsconfig.json index 885a787152..2a4c7fd15f 100644 --- a/types/fetch-jsonp/tsconfig.json +++ b/types/fetch-jsonp/tsconfig.json @@ -17,6 +17,7 @@ "noImplicitAny": true, "noImplicitThis": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "noEmit": true }, "files": [ diff --git a/types/fetch-mock/tsconfig.json b/types/fetch-mock/tsconfig.json index 0c410ec0ae..b43553f18a 100644 --- a/types/fetch-mock/tsconfig.json +++ b/types/fetch-mock/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fetch.io/tsconfig.json b/types/fetch.io/tsconfig.json index b47cf8f3bf..caccfa9ed6 100644 --- a/types/fetch.io/tsconfig.json +++ b/types/fetch.io/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ffi/tsconfig.json b/types/ffi/tsconfig.json index db74f21b0e..2802ced44b 100644 --- a/types/ffi/tsconfig.json +++ b/types/ffi/tsconfig.json @@ -14,11 +14,12 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "node-ffi-buffer.d.ts", "ffi-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ffmpeg-static/tsconfig.json b/types/ffmpeg-static/tsconfig.json index 8a1635e82c..1dcc13635e 100644 --- a/types/ffmpeg-static/tsconfig.json +++ b/types/ffmpeg-static/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ffprobe-static/tsconfig.json b/types/ffprobe-static/tsconfig.json index fab3495614..fe2dcc110e 100644 --- a/types/ffprobe-static/tsconfig.json +++ b/types/ffprobe-static/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fhir/tsconfig.json b/types/fhir/tsconfig.json index 8b4970200f..f8f2b46903 100644 --- a/types/fhir/tsconfig.json +++ b/types/fhir/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fibers/index.d.ts b/types/fibers/index.d.ts index fec81954f8..c415dd934d 100644 --- a/types/fibers/index.d.ts +++ b/types/fibers/index.d.ts @@ -13,10 +13,10 @@ declare namespace fibers { export var poolSize: number; export var fibersCreated: number; export var current: fibers.Fiber; - export function yield(value: any): any; + export function yield(value?: any): any; export interface Fiber { - run(step?: number): any; + run(value?: any): any; } } diff --git a/types/fibers/tsconfig.json b/types/fibers/tsconfig.json index 99e4865e3c..9e73063f35 100644 --- a/types/fibers/tsconfig.json +++ b/types/fibers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/field/tsconfig.json b/types/field/tsconfig.json index 219fa4963d..f4ee4fe059 100644 --- a/types/field/tsconfig.json +++ b/types/field/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/figures/tsconfig.json b/types/figures/tsconfig.json index 720529ea45..34cd5b28e7 100644 --- a/types/figures/tsconfig.json +++ b/types/figures/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/file-exists/tsconfig.json b/types/file-exists/tsconfig.json index ffdee8351c..a1029d7f76 100644 --- a/types/file-exists/tsconfig.json +++ b/types/file-exists/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/file-saver/tsconfig.json b/types/file-saver/tsconfig.json index 803ff5f510..dcffa809ea 100644 --- a/types/file-saver/tsconfig.json +++ b/types/file-saver/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "file-saver-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/file-type/tsconfig.json b/types/file-type/tsconfig.json index 499b81459c..ab07d788b2 100644 --- a/types/file-type/tsconfig.json +++ b/types/file-type/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/file-url/tsconfig.json b/types/file-url/tsconfig.json index 4a6e413ce0..d42d45f1a9 100644 --- a/types/file-url/tsconfig.json +++ b/types/file-url/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/filenamify/tsconfig.json b/types/filenamify/tsconfig.json index 0d41b23a0d..1cd1fae6ab 100644 --- a/types/filenamify/tsconfig.json +++ b/types/filenamify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/filesize/tsconfig.json b/types/filesize/tsconfig.json index 350e88d4ad..885c875de6 100644 --- a/types/filesize/tsconfig.json +++ b/types/filesize/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/filesystem/tsconfig.json b/types/filesystem/tsconfig.json index 6512ab1028..f9366bd879 100644 --- a/types/filesystem/tsconfig.json +++ b/types/filesystem/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/filewriter/tsconfig.json b/types/filewriter/tsconfig.json index 7cba1a1289..c1ce1dcc0a 100644 --- a/types/filewriter/tsconfig.json +++ b/types/filewriter/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fill-pdf/tsconfig.json b/types/fill-pdf/tsconfig.json index 4cbe1dad24..7caa55c8f6 100644 --- a/types/fill-pdf/tsconfig.json +++ b/types/fill-pdf/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/finalhandler/finalhandler-tests.ts b/types/finalhandler/finalhandler-tests.ts index 81b9565404..3b40b217d0 100644 --- a/types/finalhandler/finalhandler-tests.ts +++ b/types/finalhandler/finalhandler-tests.ts @@ -1,6 +1,5 @@ - import { ServerRequest, ServerResponse } from "http"; -import * as finalHandler from "finalhandler"; +import finalHandler = require("finalhandler"); let req: ServerRequest; let res: ServerResponse; diff --git a/types/finalhandler/tsconfig.json b/types/finalhandler/tsconfig.json index dd03198a83..dece053e4f 100644 --- a/types/finalhandler/tsconfig.json +++ b/types/finalhandler/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/finch/tsconfig.json b/types/finch/tsconfig.json index dfb658a6b2..1f581e19fa 100644 --- a/types/finch/tsconfig.json +++ b/types/finch/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/find-root/find-root-tests.ts b/types/find-root/find-root-tests.ts new file mode 100644 index 0000000000..b01a1ac17d --- /dev/null +++ b/types/find-root/find-root-tests.ts @@ -0,0 +1,4 @@ +import findRoot = require('find-root'); + +const a: string = findRoot(''); +const b: string = findRoot('', (dir: string): boolean => true); diff --git a/types/find-root/index.d.ts b/types/find-root/index.d.ts new file mode 100644 index 0000000000..b2fe6f572a --- /dev/null +++ b/types/find-root/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for find-root 1.1 +// Project: https://github.com/js-n/find-root +// Definitions by: Arturas Molcanovas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 +/// + +type FindRootCheckFn = (dir: string) => boolean; + +/** + * Returns the path for the nearest directory to startingPath containing a package.json file. If a check function is + * provided, then this will return the nearest directory for which the function returns true. + * @param startingPath The path to start searching form, e.g. __dirname + * @param check The check predicate + * @throws {Error} if package.json cannot be found or if the function never returns true + */ +declare function findRoot(startingPath: string, check?: FindRootCheckFn): string; + +export = findRoot; diff --git a/types/find-root/tsconfig.json b/types/find-root/tsconfig.json new file mode 100644 index 0000000000..d4589574b0 --- /dev/null +++ b/types/find-root/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "find-root-tests.ts" + ] +} \ No newline at end of file diff --git a/types/find-root/tslint.json b/types/find-root/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/find-root/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/find-up/tsconfig.json b/types/find-up/tsconfig.json index ea6bf9d1ad..4940987639 100644 --- a/types/find-up/tsconfig.json +++ b/types/find-up/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/find/tsconfig.json b/types/find/tsconfig.json index e231e78ff5..219a8c1831 100644 --- a/types/find/tsconfig.json +++ b/types/find/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "find-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/findup-sync/tsconfig.json b/types/findup-sync/tsconfig.json index fd44ee7c99..9afac34cac 100644 --- a/types/findup-sync/tsconfig.json +++ b/types/findup-sync/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fingerprintjs/tsconfig.json b/types/fingerprintjs/tsconfig.json index 35166934d4..1443b165be 100644 --- a/types/fingerprintjs/tsconfig.json +++ b/types/fingerprintjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fingerprintjs2/tsconfig.json b/types/fingerprintjs2/tsconfig.json index b274c3c488..1137ce7a3b 100644 --- a/types/fingerprintjs2/tsconfig.json +++ b/types/fingerprintjs2/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/firebase-client/tsconfig.json b/types/firebase-client/tsconfig.json index 4510d3f56d..674b6d8e11 100644 --- a/types/firebase-client/tsconfig.json +++ b/types/firebase-client/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/firebase-token-generator/tsconfig.json b/types/firebase-token-generator/tsconfig.json index e6620557a2..8b11cf18fb 100644 --- a/types/firebase-token-generator/tsconfig.json +++ b/types/firebase-token-generator/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/firebird/tsconfig.json b/types/firebird/tsconfig.json index e5e2d1b6ac..b21033b4ae 100644 --- a/types/firebird/tsconfig.json +++ b/types/firebird/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/firefox-webext-browser/tsconfig.json b/types/firefox-webext-browser/tsconfig.json index 202f6824d1..b3c2877928 100644 --- a/types/firefox-webext-browser/tsconfig.json +++ b/types/firefox-webext-browser/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "firefox-webext-browser-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/firefox/tsconfig.json b/types/firefox/tsconfig.json index 44ef93219e..53908aec19 100644 --- a/types/firefox/tsconfig.json +++ b/types/firefox/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/firmata/firmata-tests.ts b/types/firmata/firmata-tests.ts index d50160e2dd..9a3137ea39 100644 --- a/types/firmata/firmata-tests.ts +++ b/types/firmata/firmata-tests.ts @@ -1,4 +1,4 @@ -import * as Board from 'firmata'; +import Board = require('firmata'); function test_basic_board() { const board = new Board(''); diff --git a/types/firmata/index.d.ts b/types/firmata/index.d.ts index 6f72107a07..21dfa03820 100644 --- a/types/firmata/index.d.ts +++ b/types/firmata/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for firmata.js 0.15 +// Type definitions for firmata.js 0.19 // Project: https://github.com/firmata/firmata.js // Definitions by: Troy W. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -16,7 +16,7 @@ export = Board; * guarantee that it cannot be improved. */ declare class Board extends NodeJS.EventEmitter { - constructor(serialPort: string, optionsOrCallback?: Board.Options|((error: any) => void), callback?: (error: any) => void) + constructor(serialPort: any, optionsOrCallback?: Board.Options|((error: any) => void), callback?: (error: any) => void) MODES: Board.PinModes; STEPPER: Board.StepperConstants; I2C_MODES: Board.I2cModes; @@ -153,9 +153,12 @@ declare class Board extends NodeJS.EventEmitter { declare namespace Board { // https://github.com/firmata/firmata.js/blob/master/lib/firmata.js#L429-L451 interface Options { + skipCapabilities?: boolean; reportVersionTimeout?: number; samplingInterval?: number; serialport?: SerialPort.Options; + pins?: Pins[]; + analogPins?: number[]; } interface PinModes { diff --git a/types/firmata/tsconfig.json b/types/firmata/tsconfig.json index d843e1300d..8a684319aa 100644 --- a/types/firmata/tsconfig.json +++ b/types/firmata/tsconfig.json @@ -13,11 +13,14 @@ "../" ], "paths": { - "serialport": ["serialport/v4"] + "serialport": [ + "serialport/v4" + ] }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/firmata/tslint.json b/types/firmata/tslint.json index 3db14f85ea..3224b40b8b 100644 --- a/types/firmata/tslint.json +++ b/types/firmata/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } +} diff --git a/types/first-mate/tsconfig.json b/types/first-mate/tsconfig.json index 3c11f8dbb2..7df84484f9 100644 --- a/types/first-mate/tsconfig.json +++ b/types/first-mate/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "first-mate-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fixed-data-table-2/tsconfig.json b/types/fixed-data-table-2/tsconfig.json index c548d5c369..5cd1ad16ef 100644 --- a/types/fixed-data-table-2/tsconfig.json +++ b/types/fixed-data-table-2/tsconfig.json @@ -5,8 +5,11 @@ ], "compilerOptions": { "module": "commonjs", - "lib": ["es6", "dom"], - "jsx":"preserve", + "lib": [ + "es6", + "dom" + ], + "jsx": "preserve", "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, @@ -17,6 +20,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } -} +} \ No newline at end of file diff --git a/types/fixed-data-table/tsconfig.json b/types/fixed-data-table/tsconfig.json index 02ba840d0b..73c385c8b6 100644 --- a/types/fixed-data-table/tsconfig.json +++ b/types/fixed-data-table/tsconfig.json @@ -20,6 +20,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/flake-idgen/tsconfig.json b/types/flake-idgen/tsconfig.json index 0275fb0c23..5f6690f284 100644 --- a/types/flake-idgen/tsconfig.json +++ b/types/flake-idgen/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/flat/tsconfig.json b/types/flat/tsconfig.json index 7cc1467b3f..5641722c8a 100644 --- a/types/flat/tsconfig.json +++ b/types/flat/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/flatbuffers/tsconfig.json b/types/flatbuffers/tsconfig.json index fe3421fa5b..9ec0f4dba5 100644 --- a/types/flatbuffers/tsconfig.json +++ b/types/flatbuffers/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/flexslider/tsconfig.json b/types/flexslider/tsconfig.json index 4ced617dd6..0339ecf2bf 100644 --- a/types/flexslider/tsconfig.json +++ b/types/flexslider/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/flickity/tsconfig.json b/types/flickity/tsconfig.json index e6d8dcef00..387c655e41 100644 --- a/types/flickity/tsconfig.json +++ b/types/flickity/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/flight/tsconfig.json b/types/flight/tsconfig.json index 18060e6903..36bfff03c9 100644 --- a/types/flight/tsconfig.json +++ b/types/flight/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/flightplan/tsconfig.json b/types/flightplan/tsconfig.json index be4eb41ec5..24de7ee0b1 100644 --- a/types/flightplan/tsconfig.json +++ b/types/flightplan/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/flipsnap/tsconfig.json b/types/flipsnap/tsconfig.json index 435b186eb4..8712fa1972 100644 --- a/types/flipsnap/tsconfig.json +++ b/types/flipsnap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/flot/tsconfig.json b/types/flot/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/flot/tsconfig.json +++ b/types/flot/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/flowjs/tsconfig.json b/types/flowjs/tsconfig.json index e797332c13..6cb7be27d6 100644 --- a/types/flowjs/tsconfig.json +++ b/types/flowjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fluent-ffmpeg/tsconfig.json b/types/fluent-ffmpeg/tsconfig.json index 657e97adf6..91b742fb17 100644 --- a/types/fluent-ffmpeg/tsconfig.json +++ b/types/fluent-ffmpeg/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/flux/index.d.ts b/types/flux/index.d.ts index 9a95368afb..ae63f1349b 100644 --- a/types/flux/index.d.ts +++ b/types/flux/index.d.ts @@ -5,7 +5,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -import * as Dispatcher from "./lib/Dispatcher"; +import Dispatcher = require("./lib/Dispatcher"); export { Dispatcher diff --git a/types/flux/lib/FluxReduceStore.d.ts b/types/flux/lib/FluxReduceStore.d.ts index 71a7968812..cda93a54e9 100644 --- a/types/flux/lib/FluxReduceStore.d.ts +++ b/types/flux/lib/FluxReduceStore.d.ts @@ -1,4 +1,4 @@ -import * as Store from "./FluxStore"; +import Store = require("./FluxStore"); declare namespace FluxReduceStore { } diff --git a/types/flux/tsconfig.json b/types/flux/tsconfig.json index dd78eff24c..60191d3789 100644 --- a/types/flux/tsconfig.json +++ b/types/flux/tsconfig.json @@ -16,6 +16,7 @@ "strictNullChecks": false, "strictFunctionTypes": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "noEmit": true }, "files": [ diff --git a/types/flux/utils.d.ts b/types/flux/utils.d.ts index 4eb3d96e99..d9ced309db 100644 --- a/types/flux/utils.d.ts +++ b/types/flux/utils.d.ts @@ -1,7 +1,7 @@ -import * as Container from "./lib/FluxContainer"; -import * as Mixin from "./lib/FluxMixinLegacy"; -import * as ReduceStore from "./lib/FluxReduceStore"; -import * as Store from "./lib/FluxStore"; +import Container = require("./lib/FluxContainer"); +import Mixin = require("./lib/FluxMixinLegacy"); +import ReduceStore = require("./lib/FluxReduceStore"); +import Store = require("./lib/FluxStore"); export { Container, diff --git a/types/fluxxor/tsconfig.json b/types/fluxxor/tsconfig.json index 7bc0068190..bd6b27cda1 100644 --- a/types/fluxxor/tsconfig.json +++ b/types/fluxxor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fm-websync/tsconfig.json b/types/fm-websync/tsconfig.json index c0b2f14445..746eea4553 100644 --- a/types/fm-websync/tsconfig.json +++ b/types/fm-websync/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fontfaceobserver/tsconfig.json b/types/fontfaceobserver/tsconfig.json index 3695935f67..68e75c4b62 100644 --- a/types/fontfaceobserver/tsconfig.json +++ b/types/fontfaceobserver/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fontoxml/tsconfig.json b/types/fontoxml/tsconfig.json index 6d62b697a0..f90f6bb073 100644 --- a/types/fontoxml/tsconfig.json +++ b/types/fontoxml/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/forever-monitor/tsconfig.json b/types/forever-monitor/tsconfig.json index 30bf59fa63..52bc473a2b 100644 --- a/types/forever-monitor/tsconfig.json +++ b/types/forever-monitor/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/forge-di/tsconfig.json b/types/forge-di/tsconfig.json index 14aa632323..1936a2e5a4 100644 --- a/types/forge-di/tsconfig.json +++ b/types/forge-di/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/form-data/tsconfig.json b/types/form-data/tsconfig.json index d1cdfefaf0..2d98b9d238 100644 --- a/types/form-data/tsconfig.json +++ b/types/form-data/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/form-serializer/tsconfig.json b/types/form-serializer/tsconfig.json index 0e7f5bba79..2a1a008cbf 100644 --- a/types/form-serializer/tsconfig.json +++ b/types/form-serializer/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/form-urlencoded/tsconfig.json b/types/form-urlencoded/tsconfig.json index 4eefbe0a12..5dd924ceb9 100644 --- a/types/form-urlencoded/tsconfig.json +++ b/types/form-urlencoded/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "form-urlencoded-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/format-duration/tsconfig.json b/types/format-duration/tsconfig.json index f17a4f7c6c..453b0def6d 100644 --- a/types/format-duration/tsconfig.json +++ b/types/format-duration/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "format-duration-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/format-io/tsconfig.json b/types/format-io/tsconfig.json index 29333d35cf..af99cdb3b1 100644 --- a/types/format-io/tsconfig.json +++ b/types/format-io/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "format-io-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/format-unicorn/tsconfig.json b/types/format-unicorn/tsconfig.json index 84864d0f7e..a14223efb4 100644 --- a/types/format-unicorn/tsconfig.json +++ b/types/format-unicorn/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/formidable/tsconfig.json b/types/formidable/tsconfig.json index e5b9877247..cca3f74f31 100644 --- a/types/formidable/tsconfig.json +++ b/types/formidable/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/forms/forms-tests.ts b/types/forms/forms-tests.ts new file mode 100644 index 0000000000..df785a12cb --- /dev/null +++ b/types/forms/forms-tests.ts @@ -0,0 +1,74 @@ +import { create, fields, validators, widgets, FieldBound } from 'forms'; + +const complexForm = create({ + name: fields.string({ required: validators.required('%s is required, silly!') }), + email: fields.email({ required: true, label: 'Email Address' }), + website: fields.url(), + password: fields.password({ required: true }), + password_confirm: fields.password({ + required: true, + validators: [validators.matchField('password')] + }), + phone_1: fields.string({ validators: [validators.requiresFieldIfEmpty('phone_2')] }), + phone_2: fields.string({ validators: [validators.requiresFieldIfEmpty('phone_1')] }), + options: fields.string({ + choices: { + one: 'option one', + two: 'option two', + three: 'option three' + }, + widget: widgets.select(), + validators: [ (form, field, callback) => { + if (field.data === 'two') { + callback('two?! are you crazy?!'); + } else { + callback(); + } + } ] + }), + more_options: fields.array({ + choices: { one: 'item 1', two: 'item 2', three: 'item 3' }, + widget: widgets.multipleCheckbox() + }), + even_more: fields.string({ + choices: { one: 'item 1', two: 'item 2', three: 'item 3' }, + widget: widgets.multipleRadio() + }), + and_more: fields.array({ + choices: { one: 'item 1', two: 'item 2', three: 'item 3' }, + widget: widgets.multipleSelect() + }), + notes: fields.string({ widget: widgets.textarea({ rows: 6 }) }), + spam_me: fields.boolean(), + nested_1: { + nested_2: { + nested: fields.string() + } + }, + bootstrapTitle: fields.string({ + required: true, + widget: widgets.text({ classes: [ 'input-with-feedback' ] }), + errorAfterField: true, + cssClasses: { + label: [ 'control-label col col-lg-3' ] + } + }) +}); + +const output = complexForm.toHTML(); +const bootstrapOutput = complexForm.toHTML((name, object) => { + if (!Array.isArray(object.widget.classes)) { + object.widget.classes = []; + } + + if (object.widget.classes.indexOf('form-control') === -1) { + object.widget.classes.push('form-control'); + } + + const validationclass = object.error ? 'has-error' : ''; + const label = object.labelHTML(name); + const widget = object.widget.toHTML(name, object); + const error = object.error ? `
${object.error}
` : ''; + + return `
${label}${widget}${error}
`; +}); diff --git a/types/forms/index.d.ts b/types/forms/index.d.ts new file mode 100644 index 0000000000..a9690dde47 --- /dev/null +++ b/types/forms/index.d.ts @@ -0,0 +1,238 @@ +// Type definitions for forms 1.3 +// Project: https://github.com/caolan/forms +// Definitions by: suXin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface FieldObjectChoice { + [key: string]: string | FieldObjectChoice; +} + +export interface FieldArrayChoice extends Array<[string, string | FieldArrayChoice]> {} + +export interface FieldParameters { + /** Optional label text which overrides the default. */ + label?: string; + + /** Boolean describing whether the field is mandatory. */ + required?: boolean | ValidatorFunction; + + /** An array of functions which validate the field data. */ + validators?: ValidatorFunction[]; + + /** A widget object to use when rendering the field. */ + widget?: Widget; + + /** An optional id to override the default. */ + id?: string; + + /** A list of options, used for multiple choice fields. */ + choices?: FieldObjectChoice | FieldArrayChoice; + + /** A list of CSS classes for label and field wrapper. */ + cssClasses?: { + field?: string[] + label?: string[] + }; + + /** If true, errors won't be rendered automatically. */ + hideError?: boolean; + + /** If true, the label text will be displayed after the field, rather than before. */ + labelAfterField?: boolean; + + /** If true, the error message will be displayed after the field, rather than before. */ + errorAfterField?: boolean; + + /** For widgets with a fieldset (multipleRadio and multipleCheckbox), set classes for the fieldset. */ + fieldsetClasses?: string[]; + + /** For widgets with a fieldset (multipleRadio and multipleCheckbox), set classes for the fieldset's legend. */ + legendClasses?: string[]; +} + +export type FieldIterator = (name: string, field: FieldBound) => string; + +export interface Field extends FieldParameters { + /** A widget object to use when rendering the field. */ + widget: Widget; + + /** Coerces the raw data from the request into the correct format for the field, returning the result, e.g. '123' becomes 123 for the number field. */ + parse: (rawData: any) => any; + + /** Returns a new bound field object. Calls parse on the data and stores in the bound field's data attribute, stores the raw value in the value attribute. */ + bind: (rawData: any) => FieldBound; + + /** Returns a string containing a HTML element containing the fields error message, or an empty string if there is no error associated with the field. */ + errorHTML: () => string; + + /** Returns a string containing the label text from field.label, or defaults to using the field name with underscores replaced with spaces and the first letter capitalised. */ + labelText: (name?: string) => string; + + /** Returns a string containing a label element with the correct 'for' attribute containing the text from field.labelText(name). */ + labelHTML: (name: string, id?: string | boolean) => string; + + /** Returns an array of default CSS classes considering the field's attributes, e.g. ['field', 'required', 'error'] for a required field with an error message. */ + classes: () => string[]; + + /** + * Calls the iterator with the name and field object as arguments. Defaults to using forms.render.div as the iterator, + * which returns a HTML representation of the field label, error message and widget wrapped in a div. + */ + toHTML: (name?: string, iterator?: FieldIterator) => string; +} + +export interface FieldBound extends Field { + /** The raw value from the request data. */ + value: any; + + /** The request data coerced to the correct format for this field. */ + data: any; + + /** An error message if the field fails validation. */ + error: string; + + /** + * Checks if the field is required and whether it is empty. Then runs the validator functions in order until one fails or they all pass. + * If a validator fails, the resulting message is stored in the field's error attribute. + */ + validate: (form: Form, callback: (err: string, field: Field) => void) => void; +} + +export interface Widget extends WidgetParameters { + formatValue: (value: any) => any; + + /** Returns a string containing a HTML representation of the widget for the given field. */ + toHTML: (name: string, field?: Field) => string; +} + +export interface WidgetParameters { + /** Custom classes to add to the rendered widget. */ + classes?: string[]; + + /** Custom classes to add to the choices label when applicable (multipleRadio and multipleCheckbox) */ + labelClasses?: string[]; + + /** A string representing the widget type, e.g. 'text' or 'checkbox' */ + type?: string; +} + +/** + * A function that accepts a bound form, bound field and a callback as arguments. + * It should apply a test to the field to assert its validity. + * Once processing has completed it must call the callback with no arguments if the field is valid or with an error message if the field is invalid. + */ +export type ValidatorFunction = (form: FormBound, field: FieldBound, callback: (err?: string) => void) => void; + +export interface FormFields { + [key: string]: Field | FormFields; +} + +export type FormHandleCallback = (form: Form) => void; + +export interface Form { + /** Field objects this form was created with */ + fields: FormFields; + + /** Inspects a request or object literal and binds any data to the correct fields. */ + handle: ( + req: { + method: string, + url: string + body: string + }, + callbacks: { + success?: FormHandleCallback + error?: FormHandleCallback + empty?: FormHandleCallback + other?: FormHandleCallback + } + ) => void; + + /** Binds data to correct fields, returning a new bound form object. */ + bind: (data: any) => FormBound; + + /** + * Runs toHTML on each field returning the result. + * If an iterator is specified, it is called for each field with the field name and object as it's arguments, + * the iterator's results are concatenated to create the HTML output, allowing for highly customised markup. + */ + toHTML: (iterator?: FieldIterator) => string; +} + +export interface FormBound extends Form { + /** Object containing all the parsed data keyed by field name. */ + data: any; + + /** Calls validate on each field in the bound form and returns the resulting form object to the callback. */ + validate: (callback: (err: string, form: FormBound) => void) => void; + + /** Checks all fields for an error attribute. Returns false if any exist, otherwise returns true. */ + isValid: () => boolean; +} + +/** Converts a form definition (an object literal containing field objects) into a form object. */ +export function create(fields: FormFields, options?: { + /** If false, the first validation error will halt form validation, otherwise all fields will be validated. */ + validatePastFirstError?: boolean +}): Form; + +export namespace fields { + function array(params?: FieldParameters): Field; + function boolean(params?: FieldParameters): Field; + function date(params?: FieldParameters): Field; + function email(params?: FieldParameters): Field; + function number(params?: FieldParameters): Field; + function password(params?: FieldParameters): Field; + function string(params?: FieldParameters): Field; + function tel(params?: FieldParameters): Field; + function url(params?: FieldParameters): Field; +} + +export namespace validators { + function alphanumeric(errorMessage?: string): ValidatorFunction; + function color(errorMessage?: string): ValidatorFunction; + function date(errorMessage?: string): ValidatorFunction; + function digits(errorMessage?: string): ValidatorFunction; + function integer(errorMessage?: string): ValidatorFunction; + function email(errorMessage?: string): ValidatorFunction; + function matchField(matchedField: string, errorMessage?: string): ValidatorFunction; + function matchValue(valueGetter: () => any, errorMessage?: string): ValidatorFunction; + function max(value: number, errorMessage?: string): ValidatorFunction; + function maxlength(value: number, errorMessage?: string): ValidatorFunction; + function min(value: number, errorMessage?: string): ValidatorFunction; + function minlength(value: number, errorMessage?: string): ValidatorFunction; + function range(min: number, max: number, errorMessage?: string): ValidatorFunction; + function rangelength(min: number, max: number, errorMessage?: string): ValidatorFunction; + function regexp(regexp: RegExp, errorMessage?: string): ValidatorFunction; + function required(errorMessage?: string): ValidatorFunction; + function requiresFieldIfEmpty(alternateField: string, errorMessage?: string): ValidatorFunction; + function url(errorMessage?: string): ValidatorFunction; +} + +export namespace widgets { + function checkbox(params?: WidgetParameters): Widget; + function color(params?: WidgetParameters): Widget; + function date(params?: WidgetParameters): Widget; + function email(params?: WidgetParameters): Widget; + function hidden(params?: WidgetParameters): Widget; + function number(params?: WidgetParameters): Widget; + function label(params?: WidgetParameters): Widget; + function multipleCheckbox(params?: WidgetParameters): Widget; + function multipleRadio(params?: WidgetParameters): Widget; + function multipleSelect(params?: WidgetParameters): Widget; + function password(params?: WidgetParameters): Widget; + function select(params?: WidgetParameters): Widget; + function tel(params?: WidgetParameters): Widget; + function text(params?: WidgetParameters): Widget; + function textarea(params?: WidgetParameters & { rows?: number, cols?: number }): Widget; +} + +/** A function which accepts a name and field as arguments and returns a string containing a HTML representation of the field. */ +export type RenderFunction = (name: string, field: Field) => string; + +export namespace render { + const div: RenderFunction; + const p: RenderFunction; + const li: RenderFunction; + const table: RenderFunction; +} diff --git a/types/forms/tsconfig.json b/types/forms/tsconfig.json new file mode 100644 index 0000000000..aad7419eea --- /dev/null +++ b/types/forms/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "forms-tests.ts" + ] +} \ No newline at end of file diff --git a/types/forms/tslint.json b/types/forms/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/forms/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/forwarded/tsconfig.json b/types/forwarded/tsconfig.json index 58cbcdee21..5fd0798e3f 100644 --- a/types/forwarded/tsconfig.json +++ b/types/forwarded/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fossil-delta/tsconfig.json b/types/fossil-delta/tsconfig.json index 29b7c7e933..01a233092c 100644 --- a/types/fossil-delta/tsconfig.json +++ b/types/fossil-delta/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/foundation/tsconfig.json b/types/foundation/tsconfig.json index 5ddb587b52..a8fd93f7b1 100644 --- a/types/foundation/tsconfig.json +++ b/types/foundation/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fpsmeter/tsconfig.json b/types/fpsmeter/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/fpsmeter/tsconfig.json +++ b/types/fpsmeter/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/framebus/tsconfig.json b/types/framebus/tsconfig.json index eec501f70b..aac56ce964 100644 --- a/types/framebus/tsconfig.json +++ b/types/framebus/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/freedom/tsconfig.json b/types/freedom/tsconfig.json index dd0bd2e13c..6377018113 100644 --- a/types/freedom/tsconfig.json +++ b/types/freedom/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/freeport/tsconfig.json b/types/freeport/tsconfig.json index f6b6ef7b66..ccd3f7b895 100644 --- a/types/freeport/tsconfig.json +++ b/types/freeport/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fresh/tsconfig.json b/types/fresh/tsconfig.json index 298a5c3fae..75aa6f7dbb 100644 --- a/types/fresh/tsconfig.json +++ b/types/fresh/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/friendly-errors-webpack-plugin/friendly-errors-webpack-plugin-tests.ts b/types/friendly-errors-webpack-plugin/friendly-errors-webpack-plugin-tests.ts index 4ce3828f3f..11f9395974 100644 --- a/types/friendly-errors-webpack-plugin/friendly-errors-webpack-plugin-tests.ts +++ b/types/friendly-errors-webpack-plugin/friendly-errors-webpack-plugin-tests.ts @@ -1,5 +1,5 @@ -import * as webpack from 'webpack'; -import * as FriendlyErrorsPlugin from 'friendly-errors-webpack-plugin'; +import webpack = require('webpack'); +import FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin'); const compiler = webpack({ plugins: [ diff --git a/types/friendly-errors-webpack-plugin/tsconfig.json b/types/friendly-errors-webpack-plugin/tsconfig.json index f519c3b954..4dc4ac0262 100644 --- a/types/friendly-errors-webpack-plugin/tsconfig.json +++ b/types/friendly-errors-webpack-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/frisby/tsconfig.json b/types/frisby/tsconfig.json index 725ebf48f1..f126fc2232 100644 --- a/types/frisby/tsconfig.json +++ b/types/frisby/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/from/tsconfig.json b/types/from/tsconfig.json index 649c0d1866..7f153fba36 100644 --- a/types/from/tsconfig.json +++ b/types/from/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/from2/tsconfig.json b/types/from2/tsconfig.json index 641eda4cf5..b5ef31433c 100644 --- a/types/from2/tsconfig.json +++ b/types/from2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fromjs/tsconfig.json b/types/fromjs/tsconfig.json index 4c5e05b65a..7166dc031c 100644 --- a/types/fromjs/tsconfig.json +++ b/types/fromjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fromnow/tsconfig.json b/types/fromnow/tsconfig.json index 56e959f305..52471d205f 100644 --- a/types/fromnow/tsconfig.json +++ b/types/fromnow/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fs-cson/tsconfig.json b/types/fs-cson/tsconfig.json index fcd9242b1d..88fa1daf3c 100644 --- a/types/fs-cson/tsconfig.json +++ b/types/fs-cson/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "fs-cson-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fs-ext/tsconfig.json b/types/fs-ext/tsconfig.json index 18df84572d..40fd47fbd8 100644 --- a/types/fs-ext/tsconfig.json +++ b/types/fs-ext/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fs-extra-promise-es6/tsconfig.json b/types/fs-extra-promise-es6/tsconfig.json index b7e6f664f2..7a94f2f204 100644 --- a/types/fs-extra-promise-es6/tsconfig.json +++ b/types/fs-extra-promise-es6/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fs-extra-promise/tsconfig.json b/types/fs-extra-promise/tsconfig.json index 4a4fc0f60b..412ab9c171 100644 --- a/types/fs-extra-promise/tsconfig.json +++ b/types/fs-extra-promise/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fs-extra/tsconfig.json b/types/fs-extra/tsconfig.json index d43823dee8..6441117056 100644 --- a/types/fs-extra/tsconfig.json +++ b/types/fs-extra/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fs-extra/v4/tsconfig.json b/types/fs-extra/v4/tsconfig.json index 80435f4ede..053ba23f12 100644 --- a/types/fs-extra/v4/tsconfig.json +++ b/types/fs-extra/v4/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fs-finder/tsconfig.json b/types/fs-finder/tsconfig.json index 300e950feb..8df4e87cd3 100644 --- a/types/fs-finder/tsconfig.json +++ b/types/fs-finder/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fs-mock/tsconfig.json b/types/fs-mock/tsconfig.json index f468b62a55..8967149914 100644 --- a/types/fs-mock/tsconfig.json +++ b/types/fs-mock/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fs-plus/tsconfig.json b/types/fs-plus/tsconfig.json index 1ab0098d52..ae0059f221 100644 --- a/types/fs-plus/tsconfig.json +++ b/types/fs-plus/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "fs-plus-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fs-promise/tsconfig.json b/types/fs-promise/tsconfig.json index 377d4623d9..9a5d721107 100644 --- a/types/fs-promise/tsconfig.json +++ b/types/fs-promise/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fs-readdir-recursive/tsconfig.json b/types/fs-readdir-recursive/tsconfig.json index d33141f321..142c4bd90f 100644 --- a/types/fs-readdir-recursive/tsconfig.json +++ b/types/fs-readdir-recursive/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fs-readfile-promise/fs-readfile-promise-tests.ts b/types/fs-readfile-promise/fs-readfile-promise-tests.ts index 9bd1ac070c..1871207710 100644 --- a/types/fs-readfile-promise/fs-readfile-promise-tests.ts +++ b/types/fs-readfile-promise/fs-readfile-promise-tests.ts @@ -1,4 +1,4 @@ -import * as readFile from "fs-readfile-promise"; +import readFile = require("fs-readfile-promise"); declare const path: string; declare const encoding: string; diff --git a/types/fs-readfile-promise/tsconfig.json b/types/fs-readfile-promise/tsconfig.json index 3496c329e5..9b890c41f3 100644 --- a/types/fs-readfile-promise/tsconfig.json +++ b/types/fs-readfile-promise/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fscreen/tsconfig.json b/types/fscreen/tsconfig.json index e352d9fd2e..7243196e30 100644 --- a/types/fscreen/tsconfig.json +++ b/types/fscreen/tsconfig.json @@ -16,10 +16,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "fscreen-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fsevents/tsconfig.json b/types/fsevents/tsconfig.json index 2937460740..003cbb5bd5 100644 --- a/types/fsevents/tsconfig.json +++ b/types/fsevents/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ftdomdelegate/tsconfig.json b/types/ftdomdelegate/tsconfig.json index 0220e74665..ea2d05abf2 100644 --- a/types/ftdomdelegate/tsconfig.json +++ b/types/ftdomdelegate/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ftp/tsconfig.json b/types/ftp/tsconfig.json index 6a0f57a1fc..e8e843855e 100644 --- a/types/ftp/tsconfig.json +++ b/types/ftp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ftpd/tsconfig.json b/types/ftpd/tsconfig.json index 24702aad8b..c1b9a8fa8f 100644 --- a/types/ftpd/tsconfig.json +++ b/types/ftpd/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ftpd/tslint.json b/types/ftpd/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/ftpd/tslint.json +++ b/types/ftpd/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/fullname/tsconfig.json b/types/fullname/tsconfig.json index a086692e32..8fb03b2727 100644 --- a/types/fullname/tsconfig.json +++ b/types/fullname/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fullpage.js/tsconfig.json b/types/fullpage.js/tsconfig.json index d20953732c..615d06bafa 100644 --- a/types/fullpage.js/tsconfig.json +++ b/types/fullpage.js/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "fullpage.js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fuse/tsconfig.json b/types/fuse/tsconfig.json index 8f6b34f5d3..da4e30c7a2 100644 --- a/types/fuse/tsconfig.json +++ b/types/fuse/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fusioncharts/tsconfig.json b/types/fusioncharts/tsconfig.json index f41f53056a..a48802a4d4 100644 --- a/types/fusioncharts/tsconfig.json +++ b/types/fusioncharts/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fuzzaldrin-plus/tsconfig.json b/types/fuzzaldrin-plus/tsconfig.json index 02e987df6d..ce5b104868 100644 --- a/types/fuzzaldrin-plus/tsconfig.json +++ b/types/fuzzaldrin-plus/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fuzzaldrin/tsconfig.json b/types/fuzzaldrin/tsconfig.json index 2e1263faf8..b62c85debf 100644 --- a/types/fuzzaldrin/tsconfig.json +++ b/types/fuzzaldrin/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "fuzzaldrin-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fuzzyset.js/tsconfig.json b/types/fuzzyset.js/tsconfig.json index a1eeb06b97..fc659fa22e 100644 --- a/types/fuzzyset.js/tsconfig.json +++ b/types/fuzzyset.js/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "fuzzyset.js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fuzzyset/tsconfig.json b/types/fuzzyset/tsconfig.json index 4ccf3898d4..f17bb2e723 100644 --- a/types/fuzzyset/tsconfig.json +++ b/types/fuzzyset/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fxn/tsconfig.json b/types/fxn/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/fxn/tsconfig.json +++ b/types/fxn/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/gae.channel.api/tsconfig.json b/types/gae.channel.api/tsconfig.json index 37424f5ae4..12057a214d 100644 --- a/types/gae.channel.api/tsconfig.json +++ b/types/gae.channel.api/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gamepad/tsconfig.json b/types/gamepad/tsconfig.json index 4cb63f3d80..6189bd3866 100644 --- a/types/gamepad/tsconfig.json +++ b/types/gamepad/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gamequery/tsconfig.json b/types/gamequery/tsconfig.json index 9acbbdf6ea..bf4707af6f 100644 --- a/types/gamequery/tsconfig.json +++ b/types/gamequery/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gandi-livedns/tsconfig.json b/types/gandi-livedns/tsconfig.json index 709af92138..1b8ab220e1 100644 --- a/types/gandi-livedns/tsconfig.json +++ b/types/gandi-livedns/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gapi.analytics/tsconfig.json b/types/gapi.analytics/tsconfig.json index 7ea23b6882..2f420134d3 100644 --- a/types/gapi.analytics/tsconfig.json +++ b/types/gapi.analytics/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gapi.auth2/tsconfig.json b/types/gapi.auth2/tsconfig.json index 8757ec8333..594913d8b0 100644 --- a/types/gapi.auth2/tsconfig.json +++ b/types/gapi.auth2/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gapi.calendar/tsconfig.json b/types/gapi.calendar/tsconfig.json index 2d138f7ac9..78c7e4a32e 100644 --- a/types/gapi.calendar/tsconfig.json +++ b/types/gapi.calendar/tsconfig.json @@ -15,6 +15,7 @@ "noImplicitAny": true, "noImplicitThis": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "noEmit": true }, "files": [ diff --git a/types/gapi.client.acceleratedmobilepageurl/tsconfig.json b/types/gapi.client.acceleratedmobilepageurl/tsconfig.json index 60d81925fe..7ca46199d1 100644 --- a/types/gapi.client.acceleratedmobilepageurl/tsconfig.json +++ b/types/gapi.client.acceleratedmobilepageurl/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.adexchangebuyer/tsconfig.json b/types/gapi.client.adexchangebuyer/tsconfig.json index a6ddc40ec7..ecef1dc650 100644 --- a/types/gapi.client.adexchangebuyer/tsconfig.json +++ b/types/gapi.client.adexchangebuyer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.adexchangebuyer2/tsconfig.json b/types/gapi.client.adexchangebuyer2/tsconfig.json index 453ca167ee..6885a64bc3 100644 --- a/types/gapi.client.adexchangebuyer2/tsconfig.json +++ b/types/gapi.client.adexchangebuyer2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.adexchangeseller/tsconfig.json b/types/gapi.client.adexchangeseller/tsconfig.json index a38d57f5b8..b5c5e81e25 100644 --- a/types/gapi.client.adexchangeseller/tsconfig.json +++ b/types/gapi.client.adexchangeseller/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.adexperiencereport/tsconfig.json b/types/gapi.client.adexperiencereport/tsconfig.json index 968c080cf9..b0049ec537 100644 --- a/types/gapi.client.adexperiencereport/tsconfig.json +++ b/types/gapi.client.adexperiencereport/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.admin/tsconfig.json b/types/gapi.client.admin/tsconfig.json index 840f1feb2d..339a673cf6 100644 --- a/types/gapi.client.admin/tsconfig.json +++ b/types/gapi.client.admin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.adsense/tsconfig.json b/types/gapi.client.adsense/tsconfig.json index 49b1e08a5a..ee48e54b1f 100644 --- a/types/gapi.client.adsense/tsconfig.json +++ b/types/gapi.client.adsense/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.adsensehost/tsconfig.json b/types/gapi.client.adsensehost/tsconfig.json index 5cee9dc200..1bc4586345 100644 --- a/types/gapi.client.adsensehost/tsconfig.json +++ b/types/gapi.client.adsensehost/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.analytics/tsconfig.json b/types/gapi.client.analytics/tsconfig.json index 24b9a3e308..bf021b2158 100644 --- a/types/gapi.client.analytics/tsconfig.json +++ b/types/gapi.client.analytics/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.analyticsreporting/tsconfig.json b/types/gapi.client.analyticsreporting/tsconfig.json index 2f65484898..4f15864f1a 100644 --- a/types/gapi.client.analyticsreporting/tsconfig.json +++ b/types/gapi.client.analyticsreporting/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.androiddeviceprovisioning/tsconfig.json b/types/gapi.client.androiddeviceprovisioning/tsconfig.json index 953923be00..0bf5432081 100644 --- a/types/gapi.client.androiddeviceprovisioning/tsconfig.json +++ b/types/gapi.client.androiddeviceprovisioning/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.androidenterprise/tsconfig.json b/types/gapi.client.androidenterprise/tsconfig.json index d641db9824..aa914d683d 100644 --- a/types/gapi.client.androidenterprise/tsconfig.json +++ b/types/gapi.client.androidenterprise/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.androidmanagement/tsconfig.json b/types/gapi.client.androidmanagement/tsconfig.json index 3cfbad08e0..800f1fb763 100644 --- a/types/gapi.client.androidmanagement/tsconfig.json +++ b/types/gapi.client.androidmanagement/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.androidpublisher/tsconfig.json b/types/gapi.client.androidpublisher/tsconfig.json index 6f724fe172..141590dbbf 100644 --- a/types/gapi.client.androidpublisher/tsconfig.json +++ b/types/gapi.client.androidpublisher/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.appengine/tsconfig.json b/types/gapi.client.appengine/tsconfig.json index 0af2b9eade..b8ec56c5d7 100644 --- a/types/gapi.client.appengine/tsconfig.json +++ b/types/gapi.client.appengine/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.appsactivity/tsconfig.json b/types/gapi.client.appsactivity/tsconfig.json index 0afc87f3ad..afcfd4b989 100644 --- a/types/gapi.client.appsactivity/tsconfig.json +++ b/types/gapi.client.appsactivity/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.appstate/tsconfig.json b/types/gapi.client.appstate/tsconfig.json index e9b5b7a850..a751adc9f9 100644 --- a/types/gapi.client.appstate/tsconfig.json +++ b/types/gapi.client.appstate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.bigquery/tsconfig.json b/types/gapi.client.bigquery/tsconfig.json index 23f55a96a4..f96f22a938 100644 --- a/types/gapi.client.bigquery/tsconfig.json +++ b/types/gapi.client.bigquery/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.bigquerydatatransfer/tsconfig.json b/types/gapi.client.bigquerydatatransfer/tsconfig.json index 312df37f3f..dc90ae3640 100644 --- a/types/gapi.client.bigquerydatatransfer/tsconfig.json +++ b/types/gapi.client.bigquerydatatransfer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.blogger/tsconfig.json b/types/gapi.client.blogger/tsconfig.json index 1b5be0ad2b..14c778be8f 100644 --- a/types/gapi.client.blogger/tsconfig.json +++ b/types/gapi.client.blogger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.books/tsconfig.json b/types/gapi.client.books/tsconfig.json index d011bdcf5c..d5b6f224fd 100644 --- a/types/gapi.client.books/tsconfig.json +++ b/types/gapi.client.books/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.calendar/tsconfig.json b/types/gapi.client.calendar/tsconfig.json index 5d44c3d92a..4a3cc57200 100644 --- a/types/gapi.client.calendar/tsconfig.json +++ b/types/gapi.client.calendar/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.civicinfo/tsconfig.json b/types/gapi.client.civicinfo/tsconfig.json index 6c3ced88c9..c144ad988f 100644 --- a/types/gapi.client.civicinfo/tsconfig.json +++ b/types/gapi.client.civicinfo/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.classroom/tsconfig.json b/types/gapi.client.classroom/tsconfig.json index 4e1a97323a..1c09dcba49 100644 --- a/types/gapi.client.classroom/tsconfig.json +++ b/types/gapi.client.classroom/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.cloudbilling/tsconfig.json b/types/gapi.client.cloudbilling/tsconfig.json index 66cfdbefe4..bf15149044 100644 --- a/types/gapi.client.cloudbilling/tsconfig.json +++ b/types/gapi.client.cloudbilling/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.cloudbuild/tsconfig.json b/types/gapi.client.cloudbuild/tsconfig.json index 22d8d6d390..193b0bb7bc 100644 --- a/types/gapi.client.cloudbuild/tsconfig.json +++ b/types/gapi.client.cloudbuild/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.clouddebugger/tsconfig.json b/types/gapi.client.clouddebugger/tsconfig.json index de9d4c94bc..773cb6f623 100644 --- a/types/gapi.client.clouddebugger/tsconfig.json +++ b/types/gapi.client.clouddebugger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.clouderrorreporting/tsconfig.json b/types/gapi.client.clouderrorreporting/tsconfig.json index cc1296f8ee..5a0a7e1605 100644 --- a/types/gapi.client.clouderrorreporting/tsconfig.json +++ b/types/gapi.client.clouderrorreporting/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.cloudfunctions/tsconfig.json b/types/gapi.client.cloudfunctions/tsconfig.json index 720b272f2e..d0ad0ec792 100644 --- a/types/gapi.client.cloudfunctions/tsconfig.json +++ b/types/gapi.client.cloudfunctions/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.cloudiot/tsconfig.json b/types/gapi.client.cloudiot/tsconfig.json index 03ed93c76d..6619e1273b 100644 --- a/types/gapi.client.cloudiot/tsconfig.json +++ b/types/gapi.client.cloudiot/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.cloudkms/tsconfig.json b/types/gapi.client.cloudkms/tsconfig.json index ff982b97d1..30e1a47d30 100644 --- a/types/gapi.client.cloudkms/tsconfig.json +++ b/types/gapi.client.cloudkms/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.cloudmonitoring/tsconfig.json b/types/gapi.client.cloudmonitoring/tsconfig.json index e007418ca9..aa98b060a4 100644 --- a/types/gapi.client.cloudmonitoring/tsconfig.json +++ b/types/gapi.client.cloudmonitoring/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.cloudresourcemanager/tsconfig.json b/types/gapi.client.cloudresourcemanager/tsconfig.json index c82cbc16f6..bf64d30483 100644 --- a/types/gapi.client.cloudresourcemanager/tsconfig.json +++ b/types/gapi.client.cloudresourcemanager/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.cloudtasks/tsconfig.json b/types/gapi.client.cloudtasks/tsconfig.json index d4240ab7d4..a2d8c58245 100644 --- a/types/gapi.client.cloudtasks/tsconfig.json +++ b/types/gapi.client.cloudtasks/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.cloudtrace/tsconfig.json b/types/gapi.client.cloudtrace/tsconfig.json index 977a1fd91f..deb00da08f 100644 --- a/types/gapi.client.cloudtrace/tsconfig.json +++ b/types/gapi.client.cloudtrace/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.clouduseraccounts/tsconfig.json b/types/gapi.client.clouduseraccounts/tsconfig.json index a6e3b9ffec..7ef79a3b37 100644 --- a/types/gapi.client.clouduseraccounts/tsconfig.json +++ b/types/gapi.client.clouduseraccounts/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.compute/tsconfig.json b/types/gapi.client.compute/tsconfig.json index 496204435b..f0d8a0d986 100644 --- a/types/gapi.client.compute/tsconfig.json +++ b/types/gapi.client.compute/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.consumersurveys/tsconfig.json b/types/gapi.client.consumersurveys/tsconfig.json index e8c3646083..cd7fe30013 100644 --- a/types/gapi.client.consumersurveys/tsconfig.json +++ b/types/gapi.client.consumersurveys/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.container/tsconfig.json b/types/gapi.client.container/tsconfig.json index 51ff6c98bb..119d6c3ba5 100644 --- a/types/gapi.client.container/tsconfig.json +++ b/types/gapi.client.container/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.content/tsconfig.json b/types/gapi.client.content/tsconfig.json index 566c98a224..032eaa64a4 100644 --- a/types/gapi.client.content/tsconfig.json +++ b/types/gapi.client.content/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.customsearch/tsconfig.json b/types/gapi.client.customsearch/tsconfig.json index 9b5c4f447d..c59bef0b1a 100644 --- a/types/gapi.client.customsearch/tsconfig.json +++ b/types/gapi.client.customsearch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.dataflow/tsconfig.json b/types/gapi.client.dataflow/tsconfig.json index 08c1fced14..8e23104a37 100644 --- a/types/gapi.client.dataflow/tsconfig.json +++ b/types/gapi.client.dataflow/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.dataproc/tsconfig.json b/types/gapi.client.dataproc/tsconfig.json index 83a765706a..31c48ab1f7 100644 --- a/types/gapi.client.dataproc/tsconfig.json +++ b/types/gapi.client.dataproc/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.datastore/tsconfig.json b/types/gapi.client.datastore/tsconfig.json index a84cddd73f..7fce15fad9 100644 --- a/types/gapi.client.datastore/tsconfig.json +++ b/types/gapi.client.datastore/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.deploymentmanager/tsconfig.json b/types/gapi.client.deploymentmanager/tsconfig.json index 76527cf87c..f2b606045e 100644 --- a/types/gapi.client.deploymentmanager/tsconfig.json +++ b/types/gapi.client.deploymentmanager/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.dfareporting/tsconfig.json b/types/gapi.client.dfareporting/tsconfig.json index 78bcd11678..f5a5e85bff 100644 --- a/types/gapi.client.dfareporting/tsconfig.json +++ b/types/gapi.client.dfareporting/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.discovery/tsconfig.json b/types/gapi.client.discovery/tsconfig.json index b597d1b278..8bdae68cac 100644 --- a/types/gapi.client.discovery/tsconfig.json +++ b/types/gapi.client.discovery/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.dlp/tsconfig.json b/types/gapi.client.dlp/tsconfig.json index b7ab822674..28654dd0d1 100644 --- a/types/gapi.client.dlp/tsconfig.json +++ b/types/gapi.client.dlp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.dns/tsconfig.json b/types/gapi.client.dns/tsconfig.json index 93f3858c6c..032a207928 100644 --- a/types/gapi.client.dns/tsconfig.json +++ b/types/gapi.client.dns/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.doubleclickbidmanager/tsconfig.json b/types/gapi.client.doubleclickbidmanager/tsconfig.json index 1e00b8c904..081c1f2e74 100644 --- a/types/gapi.client.doubleclickbidmanager/tsconfig.json +++ b/types/gapi.client.doubleclickbidmanager/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.doubleclicksearch/tsconfig.json b/types/gapi.client.doubleclicksearch/tsconfig.json index fb0d0a44bd..a76616840d 100644 --- a/types/gapi.client.doubleclicksearch/tsconfig.json +++ b/types/gapi.client.doubleclicksearch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.drive/tsconfig.json b/types/gapi.client.drive/tsconfig.json index 6d5901b410..05060ca3af 100644 --- a/types/gapi.client.drive/tsconfig.json +++ b/types/gapi.client.drive/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.firebasedynamiclinks/tsconfig.json b/types/gapi.client.firebasedynamiclinks/tsconfig.json index e43d9944a4..9ad2b5eac8 100644 --- a/types/gapi.client.firebasedynamiclinks/tsconfig.json +++ b/types/gapi.client.firebasedynamiclinks/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.firebaseremoteconfig/tsconfig.json b/types/gapi.client.firebaseremoteconfig/tsconfig.json index 9366ffa276..40ed96539d 100644 --- a/types/gapi.client.firebaseremoteconfig/tsconfig.json +++ b/types/gapi.client.firebaseremoteconfig/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.firebaserules/tsconfig.json b/types/gapi.client.firebaserules/tsconfig.json index fe476614b8..981e890c45 100644 --- a/types/gapi.client.firebaserules/tsconfig.json +++ b/types/gapi.client.firebaserules/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.firestore/tsconfig.json b/types/gapi.client.firestore/tsconfig.json index c15195612c..4973b52381 100644 --- a/types/gapi.client.firestore/tsconfig.json +++ b/types/gapi.client.firestore/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.fitness/tsconfig.json b/types/gapi.client.fitness/tsconfig.json index d165e53085..38f88be095 100644 --- a/types/gapi.client.fitness/tsconfig.json +++ b/types/gapi.client.fitness/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.fusiontables/tsconfig.json b/types/gapi.client.fusiontables/tsconfig.json index 74936cb7a6..ccc96c9ba0 100644 --- a/types/gapi.client.fusiontables/tsconfig.json +++ b/types/gapi.client.fusiontables/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.games/tsconfig.json b/types/gapi.client.games/tsconfig.json index d2bbd017e2..c166ca72a7 100644 --- a/types/gapi.client.games/tsconfig.json +++ b/types/gapi.client.games/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.gamesconfiguration/tsconfig.json b/types/gapi.client.gamesconfiguration/tsconfig.json index 66a95276f8..815cced1eb 100644 --- a/types/gapi.client.gamesconfiguration/tsconfig.json +++ b/types/gapi.client.gamesconfiguration/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.gamesmanagement/tsconfig.json b/types/gapi.client.gamesmanagement/tsconfig.json index 91d2485de8..0a7c716384 100644 --- a/types/gapi.client.gamesmanagement/tsconfig.json +++ b/types/gapi.client.gamesmanagement/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.genomics/tsconfig.json b/types/gapi.client.genomics/tsconfig.json index f3814992d0..5ce49ae151 100644 --- a/types/gapi.client.genomics/tsconfig.json +++ b/types/gapi.client.genomics/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.gmail/tsconfig.json b/types/gapi.client.gmail/tsconfig.json index f0a8989f4f..993382c1a5 100644 --- a/types/gapi.client.gmail/tsconfig.json +++ b/types/gapi.client.gmail/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.groupsmigration/tsconfig.json b/types/gapi.client.groupsmigration/tsconfig.json index e790df35fc..f911d8b0d0 100644 --- a/types/gapi.client.groupsmigration/tsconfig.json +++ b/types/gapi.client.groupsmigration/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.groupssettings/tsconfig.json b/types/gapi.client.groupssettings/tsconfig.json index 855b1f2828..cfc7f790d6 100644 --- a/types/gapi.client.groupssettings/tsconfig.json +++ b/types/gapi.client.groupssettings/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.iam/tsconfig.json b/types/gapi.client.iam/tsconfig.json index 4cfc571a22..16013cf2d4 100644 --- a/types/gapi.client.iam/tsconfig.json +++ b/types/gapi.client.iam/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.identitytoolkit/tsconfig.json b/types/gapi.client.identitytoolkit/tsconfig.json index 558805120e..665942fe98 100644 --- a/types/gapi.client.identitytoolkit/tsconfig.json +++ b/types/gapi.client.identitytoolkit/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.kgsearch/tsconfig.json b/types/gapi.client.kgsearch/tsconfig.json index 3dc92ba79b..ea233a6419 100644 --- a/types/gapi.client.kgsearch/tsconfig.json +++ b/types/gapi.client.kgsearch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.language/tsconfig.json b/types/gapi.client.language/tsconfig.json index 12044b7569..2b9df43adb 100644 --- a/types/gapi.client.language/tsconfig.json +++ b/types/gapi.client.language/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.licensing/tsconfig.json b/types/gapi.client.licensing/tsconfig.json index 2cde1d0a5f..2062e11df6 100644 --- a/types/gapi.client.licensing/tsconfig.json +++ b/types/gapi.client.licensing/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.logging/tsconfig.json b/types/gapi.client.logging/tsconfig.json index 315ea3a5e0..30c1d9cd1c 100644 --- a/types/gapi.client.logging/tsconfig.json +++ b/types/gapi.client.logging/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.manufacturers/tsconfig.json b/types/gapi.client.manufacturers/tsconfig.json index 143de33ad9..a0f3dcb6be 100644 --- a/types/gapi.client.manufacturers/tsconfig.json +++ b/types/gapi.client.manufacturers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.mirror/tsconfig.json b/types/gapi.client.mirror/tsconfig.json index 3404622c43..52ff31962a 100644 --- a/types/gapi.client.mirror/tsconfig.json +++ b/types/gapi.client.mirror/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.ml/tsconfig.json b/types/gapi.client.ml/tsconfig.json index e665f45a5b..3f8f98f9d3 100644 --- a/types/gapi.client.ml/tsconfig.json +++ b/types/gapi.client.ml/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.monitoring/tsconfig.json b/types/gapi.client.monitoring/tsconfig.json index 4c5c8d9129..0f40410ea1 100644 --- a/types/gapi.client.monitoring/tsconfig.json +++ b/types/gapi.client.monitoring/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.oauth2/tsconfig.json b/types/gapi.client.oauth2/tsconfig.json index 593137d956..e0db730e80 100644 --- a/types/gapi.client.oauth2/tsconfig.json +++ b/types/gapi.client.oauth2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.oslogin/tsconfig.json b/types/gapi.client.oslogin/tsconfig.json index bcf0faa3cb..d0512f2a9b 100644 --- a/types/gapi.client.oslogin/tsconfig.json +++ b/types/gapi.client.oslogin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.pagespeedonline/tsconfig.json b/types/gapi.client.pagespeedonline/tsconfig.json index 38b680e5ae..a56ae8eb21 100644 --- a/types/gapi.client.pagespeedonline/tsconfig.json +++ b/types/gapi.client.pagespeedonline/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.partners/tsconfig.json b/types/gapi.client.partners/tsconfig.json index cbecfb7e6e..ffcef1527d 100644 --- a/types/gapi.client.partners/tsconfig.json +++ b/types/gapi.client.partners/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.people/tsconfig.json b/types/gapi.client.people/tsconfig.json index 4a64b3a83d..65c26e2e37 100644 --- a/types/gapi.client.people/tsconfig.json +++ b/types/gapi.client.people/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.playcustomapp/tsconfig.json b/types/gapi.client.playcustomapp/tsconfig.json index 432fd7ebe4..933673854d 100644 --- a/types/gapi.client.playcustomapp/tsconfig.json +++ b/types/gapi.client.playcustomapp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.playmoviespartner/tsconfig.json b/types/gapi.client.playmoviespartner/tsconfig.json index 9751ed88eb..3ef754e191 100644 --- a/types/gapi.client.playmoviespartner/tsconfig.json +++ b/types/gapi.client.playmoviespartner/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.plus/tsconfig.json b/types/gapi.client.plus/tsconfig.json index 933d6c865a..576c937104 100644 --- a/types/gapi.client.plus/tsconfig.json +++ b/types/gapi.client.plus/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.plusdomains/tsconfig.json b/types/gapi.client.plusdomains/tsconfig.json index aad16ba9c1..56557f1fe0 100644 --- a/types/gapi.client.plusdomains/tsconfig.json +++ b/types/gapi.client.plusdomains/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.prediction/tsconfig.json b/types/gapi.client.prediction/tsconfig.json index 15c0255ef0..3077afc226 100644 --- a/types/gapi.client.prediction/tsconfig.json +++ b/types/gapi.client.prediction/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.proximitybeacon/tsconfig.json b/types/gapi.client.proximitybeacon/tsconfig.json index 8f240f1352..0615652a78 100644 --- a/types/gapi.client.proximitybeacon/tsconfig.json +++ b/types/gapi.client.proximitybeacon/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.pubsub/tsconfig.json b/types/gapi.client.pubsub/tsconfig.json index c5b386832c..50798418ff 100644 --- a/types/gapi.client.pubsub/tsconfig.json +++ b/types/gapi.client.pubsub/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.qpxexpress/tsconfig.json b/types/gapi.client.qpxexpress/tsconfig.json index 759fd511d6..8d0bc8414b 100644 --- a/types/gapi.client.qpxexpress/tsconfig.json +++ b/types/gapi.client.qpxexpress/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.reseller/tsconfig.json b/types/gapi.client.reseller/tsconfig.json index 62660a16cc..fc68d23c53 100644 --- a/types/gapi.client.reseller/tsconfig.json +++ b/types/gapi.client.reseller/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.resourceviews/tsconfig.json b/types/gapi.client.resourceviews/tsconfig.json index d910ac6b45..1954aa9170 100644 --- a/types/gapi.client.resourceviews/tsconfig.json +++ b/types/gapi.client.resourceviews/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.runtimeconfig/tsconfig.json b/types/gapi.client.runtimeconfig/tsconfig.json index 5e27079b43..f306447ecb 100644 --- a/types/gapi.client.runtimeconfig/tsconfig.json +++ b/types/gapi.client.runtimeconfig/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.safebrowsing/tsconfig.json b/types/gapi.client.safebrowsing/tsconfig.json index 3545ceeab3..d4fef368c8 100644 --- a/types/gapi.client.safebrowsing/tsconfig.json +++ b/types/gapi.client.safebrowsing/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.script/tsconfig.json b/types/gapi.client.script/tsconfig.json index 2ee2653a1f..7d36f916b1 100644 --- a/types/gapi.client.script/tsconfig.json +++ b/types/gapi.client.script/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.searchconsole/tsconfig.json b/types/gapi.client.searchconsole/tsconfig.json index f2e33ebce6..b7e6c12490 100644 --- a/types/gapi.client.searchconsole/tsconfig.json +++ b/types/gapi.client.searchconsole/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.servicecontrol/tsconfig.json b/types/gapi.client.servicecontrol/tsconfig.json index 14d7667280..d49010f92f 100644 --- a/types/gapi.client.servicecontrol/tsconfig.json +++ b/types/gapi.client.servicecontrol/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.servicemanagement/tsconfig.json b/types/gapi.client.servicemanagement/tsconfig.json index c1ec19c789..bf2babb733 100644 --- a/types/gapi.client.servicemanagement/tsconfig.json +++ b/types/gapi.client.servicemanagement/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.serviceuser/tsconfig.json b/types/gapi.client.serviceuser/tsconfig.json index 3213e6fbe7..ca53c7b183 100644 --- a/types/gapi.client.serviceuser/tsconfig.json +++ b/types/gapi.client.serviceuser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.sheets/tsconfig.json b/types/gapi.client.sheets/tsconfig.json index 23b7d8ecf0..1d3e881b9d 100644 --- a/types/gapi.client.sheets/tsconfig.json +++ b/types/gapi.client.sheets/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.siteverification/tsconfig.json b/types/gapi.client.siteverification/tsconfig.json index a32d7d01b6..a8a7d2ca1a 100644 --- a/types/gapi.client.siteverification/tsconfig.json +++ b/types/gapi.client.siteverification/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.slides/tsconfig.json b/types/gapi.client.slides/tsconfig.json index 94b7cd8068..67cef5659a 100644 --- a/types/gapi.client.slides/tsconfig.json +++ b/types/gapi.client.slides/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.sourcerepo/tsconfig.json b/types/gapi.client.sourcerepo/tsconfig.json index 1b6a4b8191..95662d947f 100644 --- a/types/gapi.client.sourcerepo/tsconfig.json +++ b/types/gapi.client.sourcerepo/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.spanner/tsconfig.json b/types/gapi.client.spanner/tsconfig.json index a4fcfe1835..1a1ff65ad6 100644 --- a/types/gapi.client.spanner/tsconfig.json +++ b/types/gapi.client.spanner/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.spectrum/tsconfig.json b/types/gapi.client.spectrum/tsconfig.json index 6dcfe9f1ea..d011e50d68 100644 --- a/types/gapi.client.spectrum/tsconfig.json +++ b/types/gapi.client.spectrum/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.speech/tsconfig.json b/types/gapi.client.speech/tsconfig.json index 694c7824cb..40c1c0386d 100644 --- a/types/gapi.client.speech/tsconfig.json +++ b/types/gapi.client.speech/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.sqladmin/tsconfig.json b/types/gapi.client.sqladmin/tsconfig.json index a8bd3bb164..3ecdc24928 100644 --- a/types/gapi.client.sqladmin/tsconfig.json +++ b/types/gapi.client.sqladmin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.storage/tsconfig.json b/types/gapi.client.storage/tsconfig.json index 761e1e8caa..c7bea50dd7 100644 --- a/types/gapi.client.storage/tsconfig.json +++ b/types/gapi.client.storage/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.storagetransfer/tsconfig.json b/types/gapi.client.storagetransfer/tsconfig.json index 4eb74edeea..a6fcdaa7fe 100644 --- a/types/gapi.client.storagetransfer/tsconfig.json +++ b/types/gapi.client.storagetransfer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.streetviewpublish/tsconfig.json b/types/gapi.client.streetviewpublish/tsconfig.json index 1e2afe51e0..780af27cc9 100644 --- a/types/gapi.client.streetviewpublish/tsconfig.json +++ b/types/gapi.client.streetviewpublish/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.surveys/tsconfig.json b/types/gapi.client.surveys/tsconfig.json index c0230c586d..75ad3c18bd 100644 --- a/types/gapi.client.surveys/tsconfig.json +++ b/types/gapi.client.surveys/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.tagmanager/tsconfig.json b/types/gapi.client.tagmanager/tsconfig.json index 92a3d1732b..9b9e86b11a 100644 --- a/types/gapi.client.tagmanager/tsconfig.json +++ b/types/gapi.client.tagmanager/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.taskqueue/tsconfig.json b/types/gapi.client.taskqueue/tsconfig.json index 95db41d7b6..ee54bf18cb 100644 --- a/types/gapi.client.taskqueue/tsconfig.json +++ b/types/gapi.client.taskqueue/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.tasks/tsconfig.json b/types/gapi.client.tasks/tsconfig.json index a8ac77689b..7d9fb8a32d 100644 --- a/types/gapi.client.tasks/tsconfig.json +++ b/types/gapi.client.tasks/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.testing/tsconfig.json b/types/gapi.client.testing/tsconfig.json index 88e8341cfb..ab82eee9be 100644 --- a/types/gapi.client.testing/tsconfig.json +++ b/types/gapi.client.testing/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.toolresults/tsconfig.json b/types/gapi.client.toolresults/tsconfig.json index 2e0b9eee8b..7eac8dd678 100644 --- a/types/gapi.client.toolresults/tsconfig.json +++ b/types/gapi.client.toolresults/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.translate/tsconfig.json b/types/gapi.client.translate/tsconfig.json index 6f75322a8d..c677c65b30 100644 --- a/types/gapi.client.translate/tsconfig.json +++ b/types/gapi.client.translate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.urlshortener/tsconfig.json b/types/gapi.client.urlshortener/tsconfig.json index d66d384a36..91e231c6ae 100644 --- a/types/gapi.client.urlshortener/tsconfig.json +++ b/types/gapi.client.urlshortener/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.vault/tsconfig.json b/types/gapi.client.vault/tsconfig.json index f6f0c61f24..c57aa9ac5e 100644 --- a/types/gapi.client.vault/tsconfig.json +++ b/types/gapi.client.vault/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.videointelligence/tsconfig.json b/types/gapi.client.videointelligence/tsconfig.json index 5db40cf349..4274056d08 100644 --- a/types/gapi.client.videointelligence/tsconfig.json +++ b/types/gapi.client.videointelligence/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.vision/tsconfig.json b/types/gapi.client.vision/tsconfig.json index 300f812220..3db7a9f0ae 100644 --- a/types/gapi.client.vision/tsconfig.json +++ b/types/gapi.client.vision/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.webfonts/tsconfig.json b/types/gapi.client.webfonts/tsconfig.json index 99419f718b..35eb4f3573 100644 --- a/types/gapi.client.webfonts/tsconfig.json +++ b/types/gapi.client.webfonts/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.webmasters/tsconfig.json b/types/gapi.client.webmasters/tsconfig.json index f542550a2f..ed4d12edf2 100644 --- a/types/gapi.client.webmasters/tsconfig.json +++ b/types/gapi.client.webmasters/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.youtube/tsconfig.json b/types/gapi.client.youtube/tsconfig.json index 727bee6a41..69c7503ec1 100644 --- a/types/gapi.client.youtube/tsconfig.json +++ b/types/gapi.client.youtube/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.youtubeanalytics/tsconfig.json b/types/gapi.client.youtubeanalytics/tsconfig.json index 84b8975062..455e3dc970 100644 --- a/types/gapi.client.youtubeanalytics/tsconfig.json +++ b/types/gapi.client.youtubeanalytics/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.youtubereporting/tsconfig.json b/types/gapi.client.youtubereporting/tsconfig.json index 05e2060796..20524d4d05 100644 --- a/types/gapi.client.youtubereporting/tsconfig.json +++ b/types/gapi.client.youtubereporting/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client/tsconfig.json b/types/gapi.client/tsconfig.json index 09471da3d2..b0836a651d 100644 --- a/types/gapi.client/tsconfig.json +++ b/types/gapi.client/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.drive/tsconfig.json b/types/gapi.drive/tsconfig.json index 4e5f340f58..6c3650f3d6 100644 --- a/types/gapi.drive/tsconfig.json +++ b/types/gapi.drive/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gapi.pagespeedonline/tsconfig.json b/types/gapi.pagespeedonline/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/gapi.pagespeedonline/tsconfig.json +++ b/types/gapi.pagespeedonline/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/gapi.people/tsconfig.json b/types/gapi.people/tsconfig.json index 1fbbd65218..371c13635b 100644 --- a/types/gapi.people/tsconfig.json +++ b/types/gapi.people/tsconfig.json @@ -15,6 +15,7 @@ "noImplicitAny": true, "noImplicitThis": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "noEmit": true }, "files": [ diff --git a/types/gapi.plus/tsconfig.json b/types/gapi.plus/tsconfig.json index 1ecc447591..90258a43c7 100644 --- a/types/gapi.plus/tsconfig.json +++ b/types/gapi.plus/tsconfig.json @@ -15,6 +15,7 @@ "noImplicitAny": true, "noImplicitThis": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "noEmit": true }, "files": [ diff --git a/types/gapi.translate/tsconfig.json b/types/gapi.translate/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/gapi.translate/tsconfig.json +++ b/types/gapi.translate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/gapi.urlshortener/tsconfig.json b/types/gapi.urlshortener/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/gapi.urlshortener/tsconfig.json +++ b/types/gapi.urlshortener/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/gapi.youtube/tsconfig.json b/types/gapi.youtube/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/gapi.youtube/tsconfig.json +++ b/types/gapi.youtube/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/gapi.youtubeanalytics/tsconfig.json b/types/gapi.youtubeanalytics/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/gapi.youtubeanalytics/tsconfig.json +++ b/types/gapi.youtubeanalytics/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/gapi/tsconfig.json b/types/gapi/tsconfig.json index 18f0162c51..c0518c28b2 100644 --- a/types/gapi/tsconfig.json +++ b/types/gapi/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gaussian/tsconfig.json b/types/gaussian/tsconfig.json index 30e363a435..125874fdd0 100644 --- a/types/gaussian/tsconfig.json +++ b/types/gaussian/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/geetest/geetest-tests.ts b/types/geetest/geetest-tests.ts new file mode 100644 index 0000000000..f9e3403713 --- /dev/null +++ b/types/geetest/geetest-tests.ts @@ -0,0 +1,41 @@ +import Geetest = require('geetest'); + +const captcha = new Geetest({ + geetest_id: 'xxx', + geetest_key: 'xxx', +}); + +captcha.register((err, data) => { + if (err) { + return; + } + const body = { + gt: data.geetest_id, + challenge: data.challenge, + success: data.success, + }; +}); + +captcha.register().then((data) => { + const body = { + gt: data.geetest_id, + challenge: data.challenge, + success: data.success, + }; +}, (err) => { +}); + +captcha.validate({ + challenge: 'xxx', + validate: 'xxx', + seccode: 'xxx', +}, (err, success) => { +}); + +captcha.validate({ + challenge: 'xxx', + validate: 'xxx', + seccode: 'xxx', +}).then((success) => { +}, (err) => { +}); diff --git a/types/geetest/index.d.ts b/types/geetest/index.d.ts new file mode 100644 index 0000000000..c6ed9bb7e7 --- /dev/null +++ b/types/geetest/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for geetest 4.1 +// Project: https://github.com/GeeTeam/gt-node-sdk#readme +// Definitions by: York Yao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface Options { + geetest_id: string; + geetest_key: string; + protocol?: string; + api_server?: string; +} + +type Success = 0 | 1; + +interface Data { + geetest_id: string; + gt: string; + challenge: string; + success: Success; + new_captcha: string; +} + +interface Result { + challenge: string; + validate: string; + seccode: string; +} + +declare class Geetest { + constructor(options: Options); + register(callback: (error: Error, data: Data) => void): void; + register(): Promise; + validate(result: Result, callback: (error: Error, success: Success) => void): void; + validate(result: Result): Promise; +} + +export = Geetest; diff --git a/types/geetest/tsconfig.json b/types/geetest/tsconfig.json new file mode 100644 index 0000000000..d77714c750 --- /dev/null +++ b/types/geetest/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "geetest-tests.ts" + ] +} \ No newline at end of file diff --git a/types/geetest/tslint.json b/types/geetest/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/geetest/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/gen-readlines/tsconfig.json b/types/gen-readlines/tsconfig.json index 18d185012c..e33972871a 100644 --- a/types/gen-readlines/tsconfig.json +++ b/types/gen-readlines/tsconfig.json @@ -15,10 +15,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, - "strictFunctionTypes" : true + "esModuleInterop": true, + "strictFunctionTypes": true }, "files": [ "index.d.ts", "gen-readlines-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/generic-functions/tsconfig.json b/types/generic-functions/tsconfig.json index 7476e09445..8194acf8f1 100644 --- a/types/generic-functions/tsconfig.json +++ b/types/generic-functions/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/generic-pool/tsconfig.json b/types/generic-pool/tsconfig.json index 070951dc15..f7814076e4 100644 --- a/types/generic-pool/tsconfig.json +++ b/types/generic-pool/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gently/tsconfig.json b/types/gently/tsconfig.json index 0bb239c702..a204c2dbe2 100644 --- a/types/gently/tsconfig.json +++ b/types/gently/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/geodesy/tsconfig.json b/types/geodesy/tsconfig.json index 3b785b83fb..44f04c33a8 100644 --- a/types/geodesy/tsconfig.json +++ b/types/geodesy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/geoip-lite/tsconfig.json b/types/geoip-lite/tsconfig.json index 28668d80f3..2048399bfd 100644 --- a/types/geoip-lite/tsconfig.json +++ b/types/geoip-lite/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/geojson/index.d.ts b/types/geojson/index.d.ts index e6783255eb..85f02aaad0 100644 --- a/types/geojson/index.d.ts +++ b/types/geojson/index.d.ts @@ -161,5 +161,6 @@ export interface Feature extend * https://tools.ietf.org/html/rfc7946#section-3.3 */ export interface FeatureCollection extends GeoJsonObject { + type: "FeatureCollection"; features: Array>; } diff --git a/types/geojson/tsconfig.json b/types/geojson/tsconfig.json index 071f17c65d..18526751b5 100644 --- a/types/geojson/tsconfig.json +++ b/types/geojson/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/geojson2osm/tsconfig.json b/types/geojson2osm/tsconfig.json index 98f1b66e4e..b6301a0296 100644 --- a/types/geojson2osm/tsconfig.json +++ b/types/geojson2osm/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/geokdbush/tsconfig.json b/types/geokdbush/tsconfig.json index 655591f4e8..29ef327d5b 100644 --- a/types/geokdbush/tsconfig.json +++ b/types/geokdbush/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/geometry-dom/tsconfig.json b/types/geometry-dom/tsconfig.json index f845e8f11a..ed33cabecd 100644 --- a/types/geometry-dom/tsconfig.json +++ b/types/geometry-dom/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/geopattern/tsconfig.json b/types/geopattern/tsconfig.json index 6804c9374d..ffde596485 100644 --- a/types/geopattern/tsconfig.json +++ b/types/geopattern/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/get-node-dimensions/tsconfig.json b/types/get-node-dimensions/tsconfig.json index 63d26048ed..04ee74158c 100644 --- a/types/get-node-dimensions/tsconfig.json +++ b/types/get-node-dimensions/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/get-port/tsconfig.json b/types/get-port/tsconfig.json index c221d4e9fd..459facdfa8 100644 --- a/types/get-port/tsconfig.json +++ b/types/get-port/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/get-stdin/tsconfig.json b/types/get-stdin/tsconfig.json index 1052b48f11..6c25eedcf8 100644 --- a/types/get-stdin/tsconfig.json +++ b/types/get-stdin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/get-stream/tsconfig.json b/types/get-stream/tsconfig.json index 7d3b35d42d..9c36478bae 100644 --- a/types/get-stream/tsconfig.json +++ b/types/get-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/getos/tsconfig.json b/types/getos/tsconfig.json index fbcc09cf87..7d14fec0fc 100644 --- a/types/getos/tsconfig.json +++ b/types/getos/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gettext.js/tsconfig.json b/types/gettext.js/tsconfig.json index 3812c6244c..87273714e2 100644 --- a/types/gettext.js/tsconfig.json +++ b/types/gettext.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gifffer/tsconfig.json b/types/gifffer/tsconfig.json index 273e998048..e5d099d008 100644 --- a/types/gifffer/tsconfig.json +++ b/types/gifffer/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "gifffer-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/gijgo/tsconfig.json b/types/gijgo/tsconfig.json index 36530a70b9..6bb0ae1403 100644 --- a/types/gijgo/tsconfig.json +++ b/types/gijgo/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/giraffe/tsconfig.json b/types/giraffe/tsconfig.json index 0602e0fbb5..a469396dd4 100644 --- a/types/giraffe/tsconfig.json +++ b/types/giraffe/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/git-config/tsconfig.json b/types/git-config/tsconfig.json index 48e528d1cc..605c7505c3 100644 --- a/types/git-config/tsconfig.json +++ b/types/git-config/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/git-remote-origin-url/tsconfig.json b/types/git-remote-origin-url/tsconfig.json index 063c49bfe3..9d83cc0c47 100644 --- a/types/git-remote-origin-url/tsconfig.json +++ b/types/git-remote-origin-url/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/git-rev/tsconfig.json b/types/git-rev/tsconfig.json index 95396b43c2..7a8cbf36cf 100644 --- a/types/git-rev/tsconfig.json +++ b/types/git-rev/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/git/tsconfig.json b/types/git/tsconfig.json index 397dfc4ac3..959a2ac25e 100644 --- a/types/git/tsconfig.json +++ b/types/git/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/github-username-regex/tsconfig.json b/types/github-username-regex/tsconfig.json index 4a30cf07ad..4564596c08 100644 --- a/types/github-username-regex/tsconfig.json +++ b/types/github-username-regex/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "github-username-regex-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/gl-matrix/tsconfig.json b/types/gl-matrix/tsconfig.json index ec26405a08..fd83be79a8 100644 --- a/types/gl-matrix/tsconfig.json +++ b/types/gl-matrix/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gldatepicker/tsconfig.json b/types/gldatepicker/tsconfig.json index 93ae16bff0..8d80a4c096 100644 --- a/types/gldatepicker/tsconfig.json +++ b/types/gldatepicker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/glidejs/tsconfig.json b/types/glidejs/tsconfig.json index 5659d4d355..5d075c7637 100644 --- a/types/glidejs/tsconfig.json +++ b/types/glidejs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/glob-base/tsconfig.json b/types/glob-base/tsconfig.json index b5cd160770..2013ef4332 100644 --- a/types/glob-base/tsconfig.json +++ b/types/glob-base/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/glob-expand/glob-expand-tests.ts b/types/glob-expand/glob-expand-tests.ts index 70275ea0cf..1e61bc0c49 100644 --- a/types/glob-expand/glob-expand-tests.ts +++ b/types/glob-expand/glob-expand-tests.ts @@ -1,5 +1,4 @@ - -import * as expand from "glob-expand"; +import expand = require("glob-expand"); expand({ filter: 'isFile', cwd: '../' }, ['**/*.*', '!exclude/these/**/*.*']); // returns all files in cwd ['file1', 'file2',...] but excluding diff --git a/types/glob-expand/tsconfig.json b/types/glob-expand/tsconfig.json index 4c028e61f8..670f966d8f 100644 --- a/types/glob-expand/tsconfig.json +++ b/types/glob-expand/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/glob-parent/tsconfig.json b/types/glob-parent/tsconfig.json index 1e74b9bc82..ee2853601f 100644 --- a/types/glob-parent/tsconfig.json +++ b/types/glob-parent/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "glob-parent-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/glob-stream/tsconfig.json b/types/glob-stream/tsconfig.json index 06d8e7ca71..c199b4c07c 100644 --- a/types/glob-stream/tsconfig.json +++ b/types/glob-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/glob/index.d.ts b/types/glob/index.d.ts index f7628d5ab7..92c2532e79 100644 --- a/types/glob/index.d.ts +++ b/types/glob/index.d.ts @@ -14,6 +14,8 @@ declare function G(pattern: string, cb: (err: Error | null, matches: string[]) = declare function G(pattern: string, options: G.IOptions, cb: (err: Error | null, matches: string[]) => void): void; declare namespace G { + function __promisify__(pattern: string, options?: IOptions): Promise; + function sync(pattern: string, options?: IOptions): string[]; function hasMagic(pattern: string, options?: IOptions): boolean; diff --git a/types/glob/tsconfig.json b/types/glob/tsconfig.json index 46faaf718d..8e1cef6b05 100644 --- a/types/glob/tsconfig.json +++ b/types/glob/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/global-tunnel-ng/tsconfig.json b/types/global-tunnel-ng/tsconfig.json index e36f343474..362aca1f3f 100644 --- a/types/global-tunnel-ng/tsconfig.json +++ b/types/global-tunnel-ng/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/globalize-compiler/tsconfig.json b/types/globalize-compiler/tsconfig.json index 7c4ac18956..6c21504dec 100644 --- a/types/globalize-compiler/tsconfig.json +++ b/types/globalize-compiler/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/globalize/tsconfig.json b/types/globalize/tsconfig.json index b83bbf7b09..a05e92e969 100644 --- a/types/globalize/tsconfig.json +++ b/types/globalize/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/globby/globby-tests.ts b/types/globby/globby-tests.ts index 68acb7cde8..1c3c1842d4 100644 --- a/types/globby/globby-tests.ts +++ b/types/globby/globby-tests.ts @@ -1,6 +1,6 @@ import { IOptions } from 'glob'; -import * as globby from "globby"; +import globby = require("globby"); (async () => { let result: string[]; diff --git a/types/globby/tsconfig.json b/types/globby/tsconfig.json index 5cc0a3fe62..3992324f85 100644 --- a/types/globby/tsconfig.json +++ b/types/globby/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/globule/tsconfig.json b/types/globule/tsconfig.json index 9e410fc88b..973d69a02d 100644 --- a/types/globule/tsconfig.json +++ b/types/globule/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gm/tsconfig.json b/types/gm/tsconfig.json index 234c57dbf5..e7b6667e75 100644 --- a/types/gm/tsconfig.json +++ b/types/gm/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/go/tsconfig.json b/types/go/tsconfig.json index 3c8880bab1..02839eea7b 100644 --- a/types/go/tsconfig.json +++ b/types/go/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-adwords-scripts/tsconfig.json b/types/google-adwords-scripts/tsconfig.json index 748cf4a694..a515e74b27 100644 --- a/types/google-adwords-scripts/tsconfig.json +++ b/types/google-adwords-scripts/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-apps-script-oauth2/tsconfig.json b/types/google-apps-script-oauth2/tsconfig.json index bc09dd70b9..db6e6d4421 100644 --- a/types/google-apps-script-oauth2/tsconfig.json +++ b/types/google-apps-script-oauth2/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "google-apps-script-oauth2-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/google-apps-script/tsconfig.json b/types/google-apps-script/tsconfig.json index d61786dd17..483cc8d9d7 100644 --- a/types/google-apps-script/tsconfig.json +++ b/types/google-apps-script/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-closure-compiler/tsconfig.json b/types/google-closure-compiler/tsconfig.json index a4c312936e..5e74e98a7e 100644 --- a/types/google-closure-compiler/tsconfig.json +++ b/types/google-closure-compiler/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-cloud__datastore/tsconfig.json b/types/google-cloud__datastore/tsconfig.json index a65f9d3218..1fb6feb9ab 100644 --- a/types/google-cloud__datastore/tsconfig.json +++ b/types/google-cloud__datastore/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-cloud__pubsub/google-cloud__pubsub-tests.ts b/types/google-cloud__pubsub/google-cloud__pubsub-tests.ts index 7a9b9905c2..3d31dd7291 100644 --- a/types/google-cloud__pubsub/google-cloud__pubsub-tests.ts +++ b/types/google-cloud__pubsub/google-cloud__pubsub-tests.ts @@ -1,4 +1,4 @@ -import * as PubSub from '@google-cloud/pubsub'; +import PubSub = require('@google-cloud/pubsub'); // AUTHOR NOTES: We use the examples directly from the library documentation // where possible. If there is a problem with a given example (e.g. undocumented diff --git a/types/google-cloud__pubsub/tsconfig.json b/types/google-cloud__pubsub/tsconfig.json index f71eb2a331..0d2fd84b97 100644 --- a/types/google-cloud__pubsub/tsconfig.json +++ b/types/google-cloud__pubsub/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-cloud__storage/google-cloud__storage-tests.ts b/types/google-cloud__storage/google-cloud__storage-tests.ts index 24d300b8e6..dec2846f26 100644 --- a/types/google-cloud__storage/google-cloud__storage-tests.ts +++ b/types/google-cloud__storage/google-cloud__storage-tests.ts @@ -26,7 +26,7 @@ import { WriteStreamOptions, UploadOptions } from "@google-cloud/storage"; -import * as CloudStorage from "@google-cloud/storage"; +import CloudStorage = require("@google-cloud/storage"); /** * Test the storage service. diff --git a/types/google-cloud__storage/tsconfig.json b/types/google-cloud__storage/tsconfig.json index fe05cce995..bc37173f6e 100644 --- a/types/google-cloud__storage/tsconfig.json +++ b/types/google-cloud__storage/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-drive-realtime-api/tsconfig.json b/types/google-drive-realtime-api/tsconfig.json index 17d47ba0dc..0cc6a81613 100644 --- a/types/google-drive-realtime-api/tsconfig.json +++ b/types/google-drive-realtime-api/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-earth/tsconfig.json b/types/google-earth/tsconfig.json index 1ed0784589..d59ac2953b 100644 --- a/types/google-earth/tsconfig.json +++ b/types/google-earth/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-images/tsconfig.json b/types/google-images/tsconfig.json index 017e9116b8..9f12194366 100644 --- a/types/google-images/tsconfig.json +++ b/types/google-images/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-libphonenumber/index.d.ts b/types/google-libphonenumber/index.d.ts index 9d87ca825c..9a46ac69a6 100644 --- a/types/google-libphonenumber/index.d.ts +++ b/types/google-libphonenumber/index.d.ts @@ -35,14 +35,13 @@ declare namespace libphonenumber { } } - export interface PhoneNumber { + export class PhoneNumber { getCountryCode(): number | undefined; getCountryCodeOrDefault(): number; setCountryCode(value: number): void; hasCountryCode(): boolean; countryCodeCount(): number; clearCountryCode(): void; - getNationalNumber(): number | undefined; getNationalNumberOrDefault(): number; setNationalNumber(value: number): number; @@ -115,6 +114,7 @@ declare namespace libphonenumber { format(phoneNumber: PhoneNumber, format: PhoneNumberFormat): string; getNddPrefixForRegion(regionCode?: string, stripNonDigits?: boolean): string | undefined; getNumberType(phoneNumber: PhoneNumber): PhoneNumberType; + getCountryCodeForRegion(supportedRegion:string):string; getRegionCodeForCountryCode(countryCallingCode: number): string; getRegionCodeForNumber(phoneNumber: PhoneNumber): string | undefined; getSupportedRegions():string []; diff --git a/types/google-libphonenumber/tsconfig.json b/types/google-libphonenumber/tsconfig.json index e6e1f550b1..39c07d5ffb 100644 --- a/types/google-libphonenumber/tsconfig.json +++ b/types/google-libphonenumber/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-map-react/index.d.ts b/types/google-map-react/index.d.ts index 037ebb5f13..ec2f08d2ab 100644 --- a/types/google-map-react/index.d.ts +++ b/types/google-map-react/index.d.ts @@ -84,6 +84,7 @@ export interface Props { options?: Options | ((maps: Maps) => Options); margin?: any[]; debounced?: boolean; + draggable?: boolean; layerTypes?: string[]; onClick?(value: ClickEventValue): any; onChange?(value: ChangeEventValue): any; diff --git a/types/google-map-react/tsconfig.json b/types/google-map-react/tsconfig.json index 0fc3a3107f..4f02fa811b 100644 --- a/types/google-map-react/tsconfig.json +++ b/types/google-map-react/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-maps/tsconfig.json b/types/google-maps/tsconfig.json index e43916774d..606c1d115c 100644 --- a/types/google-maps/tsconfig.json +++ b/types/google-maps/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-protobuf/tsconfig.json b/types/google-protobuf/tsconfig.json index b20bd4433e..958728f6a6 100644 --- a/types/google-protobuf/tsconfig.json +++ b/types/google-protobuf/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google.analytics/index.d.ts b/types/google.analytics/index.d.ts index b0412a362f..b7d4a8a6f4 100644 --- a/types/google.analytics/index.d.ts +++ b/types/google.analytics/index.d.ts @@ -39,9 +39,8 @@ interface GoogleAnalytics { declare namespace UniversalAnalytics { // https://developers.google.com/analytics/devguides/collection/analyticsjs/method-reference - enum HitType { - 'pageview', 'screenview', 'event', 'transaction', 'item', 'social', 'exception', 'timing' - } + // https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#hitType + type HitType = 'pageview' | 'screenview' | 'event' | 'transaction' | 'item' | 'social' | 'exception' | 'timing'; // https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference @@ -294,7 +293,7 @@ declare namespace UniversalAnalytics { flashVersion?: string; forceSSL?: boolean; hitCallback?(): void; - hitType?: string; + hitType?: HitType; hostname?: string; id?: string; javaEnabled?: boolean; diff --git a/types/google.analytics/tsconfig.json b/types/google.analytics/tsconfig.json index 45e71871b6..a678b0c7e3 100644 --- a/types/google.analytics/tsconfig.json +++ b/types/google.analytics/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google.feeds/tsconfig.json b/types/google.feeds/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/google.feeds/tsconfig.json +++ b/types/google.feeds/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/google.fonts/tsconfig.json b/types/google.fonts/tsconfig.json index c4aa4943d3..4177da42c1 100644 --- a/types/google.fonts/tsconfig.json +++ b/types/google.fonts/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google.geolocation/tsconfig.json b/types/google.geolocation/tsconfig.json index 71c8196435..360cecb0c9 100644 --- a/types/google.geolocation/tsconfig.json +++ b/types/google.geolocation/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google.picker/tsconfig.json b/types/google.picker/tsconfig.json index 33502e21db..ddb1723be6 100644 --- a/types/google.picker/tsconfig.json +++ b/types/google.picker/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google.visualization/tsconfig.json b/types/google.visualization/tsconfig.json index ad7ea5ef90..4dc584c1d4 100644 --- a/types/google.visualization/tsconfig.json +++ b/types/google.visualization/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/googlemaps.infobubble/tsconfig.json b/types/googlemaps.infobubble/tsconfig.json index 12fd60b566..d1bc655d54 100644 --- a/types/googlemaps.infobubble/tsconfig.json +++ b/types/googlemaps.infobubble/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/googlemaps/index.d.ts b/types/googlemaps/index.d.ts index 83190d3e28..4519a50eab 100644 --- a/types/googlemaps/index.d.ts +++ b/types/googlemaps/index.d.ts @@ -31,7 +31,7 @@ declare namespace google.maps { /***** Map *****/ export class Map extends MVCObject { constructor(mapDiv: Element|null, opts?: MapOptions); - fitBounds(bounds: LatLngBounds|LatLngBoundsLiteral): void; + fitBounds(bounds: LatLngBounds|LatLngBoundsLiteral, padding?: number): void; getBounds(): LatLngBounds|null|undefined; getCenter(): LatLng; getDiv(): Element; diff --git a/types/googlemaps/tsconfig.json b/types/googlemaps/tsconfig.json index 7cd79e5d79..024177069c 100644 --- a/types/googlemaps/tsconfig.json +++ b/types/googlemaps/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/got/tsconfig.json b/types/got/tsconfig.json index 743441a0b9..f13cc4607a 100644 --- a/types/got/tsconfig.json +++ b/types/got/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/graceful-fs/tsconfig.json b/types/graceful-fs/tsconfig.json index 6c2ec1116e..c3fa569830 100644 --- a/types/graceful-fs/tsconfig.json +++ b/types/graceful-fs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/graceful-fs/v2/tsconfig.json b/types/graceful-fs/v2/tsconfig.json index d22f218ed4..6eb67ef820 100644 --- a/types/graceful-fs/v2/tsconfig.json +++ b/types/graceful-fs/v2/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/graham_scan/tsconfig.json b/types/graham_scan/tsconfig.json index 3a7a6efef0..3cf0c64668 100644 --- a/types/graham_scan/tsconfig.json +++ b/types/graham_scan/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/graphite-udp/tsconfig.json b/types/graphite-udp/tsconfig.json index 936a1657f4..f0804cdc58 100644 --- a/types/graphite-udp/tsconfig.json +++ b/types/graphite-udp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/graphlib/tsconfig.json b/types/graphlib/tsconfig.json index 994651b021..389baac591 100644 --- a/types/graphlib/tsconfig.json +++ b/types/graphlib/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/graphql-date/tsconfig.json b/types/graphql-date/tsconfig.json index c55674e246..603ec788c9 100644 --- a/types/graphql-date/tsconfig.json +++ b/types/graphql-date/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/graphql-iso-date/graphql-iso-date-tests.ts b/types/graphql-iso-date/graphql-iso-date-tests.ts new file mode 100644 index 0000000000..abc417cf5a --- /dev/null +++ b/types/graphql-iso-date/graphql-iso-date-tests.ts @@ -0,0 +1,5 @@ +import { GraphQLDate, GraphQLTime, GraphQLDateTime } from "graphql-iso-date"; + +GraphQLDate.name; +GraphQLTime.name; +GraphQLDateTime.name; diff --git a/types/graphql-iso-date/index.d.ts b/types/graphql-iso-date/index.d.ts new file mode 100644 index 0000000000..7f0731478e --- /dev/null +++ b/types/graphql-iso-date/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for graphql-iso-date 3.3 +// Project: https://github.com/excitement-engineer/graphql-iso-date +// Definitions by: Jason Waldrip +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { GraphQLScalarType } from "graphql"; + +export const GraphQLDate: GraphQLScalarType; +export const GraphQLTime: GraphQLScalarType; +export const GraphQLDateTime: GraphQLScalarType; diff --git a/types/graphql-iso-date/tsconfig.json b/types/graphql-iso-date/tsconfig.json new file mode 100644 index 0000000000..57320b7caa --- /dev/null +++ b/types/graphql-iso-date/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "graphql-iso-date-tests.ts" + ] +} \ No newline at end of file diff --git a/types/graphql-iso-date/tslint.json b/types/graphql-iso-date/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/graphql-iso-date/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/graphql-relay/tsconfig.json b/types/graphql-relay/tsconfig.json index bf5b3ba6b6..b94d59db9d 100644 --- a/types/graphql-relay/tsconfig.json +++ b/types/graphql-relay/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/graphql-type-json/tsconfig.json b/types/graphql-type-json/tsconfig.json index 479196f574..5eac54c86a 100644 --- a/types/graphql-type-json/tsconfig.json +++ b/types/graphql-type-json/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/graphql/error/GraphQLError.d.ts b/types/graphql/error/GraphQLError.d.ts index fbafcb1e30..116f17c3fa 100644 --- a/types/graphql/error/GraphQLError.d.ts +++ b/types/graphql/error/GraphQLError.d.ts @@ -9,60 +9,60 @@ import { Source } from '../language/source'; * GraphQL document and/or execution result that correspond to the Error. */ export class GraphQLError extends Error { - /** - * A message describing the Error for debugging purposes. - * - * Enumerable, and appears in the result of JSON.stringify(). - */ - message: string; + /** + * A message describing the Error for debugging purposes. + * + * Enumerable, and appears in the result of JSON.stringify(). + */ + message: string; - /** - * An array of { line, column } locations within the source GraphQL document - * which correspond to this error. - * - * Errors during validation often contain multiple locations, for example to - * point out two things with the same name. Errors during execution include a - * single location, the field which produced the error. - * - * Enumerable, and appears in the result of JSON.stringify(). - */ - locations?: Array<{ line: number, column: number }> | undefined; + /** + * An array of { line, column } locations within the source GraphQL document + * which correspond to this error. + * + * Errors during validation often contain multiple locations, for example to + * point out two things with the same name. Errors during execution include a + * single location, the field which produced the error. + * + * Enumerable, and appears in the result of JSON.stringify(). + */ + locations?: Array<{ line: number; column: number }> | undefined; - /** - * An array describing the JSON-path into the execution response which - * corresponds to this error. Only included for errors during execution. - * - * Enumerable, and appears in the result of JSON.stringify(). - */ - path?: Array | undefined; + /** + * An array describing the JSON-path into the execution response which + * corresponds to this error. Only included for errors during execution. + * + * Enumerable, and appears in the result of JSON.stringify(). + */ + path?: Array | undefined; - /** - * An array of GraphQL AST Nodes corresponding to this error. - */ - nodes?: ASTNode[] | undefined; + /** + * An array of GraphQL AST Nodes corresponding to this error. + */ + nodes?: ASTNode[] | undefined; - /** - * The source GraphQL document corresponding to this error. - */ - source?: Source | undefined; + /** + * The source GraphQL document corresponding to this error. + */ + source?: Source | undefined; - /** - * An array of character offsets within the source GraphQL document - * which correspond to this error. - */ - positions?: number[] | undefined; + /** + * An array of character offsets within the source GraphQL document + * which correspond to this error. + */ + positions?: number[] | undefined; - /** - * The original error thrown from a field resolver during execution. - */ - originalError?: Error; + /** + * The original error thrown from a field resolver during execution. + */ + originalError?: Error; - constructor( - message: string, - nodes?: any[], - source?: Source, - positions?: number[], - path?: Array, - originalError?: Error, - ); + constructor( + message: string, + nodes?: any[], + source?: Source, + positions?: number[], + path?: Array, + originalError?: Error, + ); } diff --git a/types/graphql/error/formatError.d.ts b/types/graphql/error/formatError.d.ts index fbb31cdb23..26dbe0f743 100644 --- a/types/graphql/error/formatError.d.ts +++ b/types/graphql/error/formatError.d.ts @@ -7,12 +7,12 @@ import { GraphQLError } from './GraphQLError'; export function formatError(error: GraphQLError): GraphQLFormattedError; export interface GraphQLFormattedError { - message: string; - locations?: GraphQLErrorLocation[]; - path?: Array; + message: string; + locations?: GraphQLErrorLocation[]; + path?: Array; } export interface GraphQLErrorLocation { - line: number; - column: number; + line: number; + column: number; } diff --git a/types/graphql/error/index.d.ts b/types/graphql/error/index.d.ts index cfb5b92740..0e9a557794 100644 --- a/types/graphql/error/index.d.ts +++ b/types/graphql/error/index.d.ts @@ -1,4 +1,8 @@ export { GraphQLError } from './GraphQLError'; export { syntaxError } from './syntaxError'; export { locatedError } from './locatedError'; -export { formatError, GraphQLFormattedError, GraphQLErrorLocation } from './formatError'; +export { + formatError, + GraphQLFormattedError, + GraphQLErrorLocation, +} from './formatError'; diff --git a/types/graphql/error/locatedError.d.ts b/types/graphql/error/locatedError.d.ts index c827f8ede8..64fadf49f4 100644 --- a/types/graphql/error/locatedError.d.ts +++ b/types/graphql/error/locatedError.d.ts @@ -6,7 +6,7 @@ import { GraphQLError } from './GraphQLError'; * document responsible for the original Error. */ export function locatedError( - originalError: Error, - nodes: T[], - path: Array + originalError: Error, + nodes: T[], + path: Array, ): GraphQLError; diff --git a/types/graphql/error/syntaxError.d.ts b/types/graphql/error/syntaxError.d.ts index 80c4453e03..ccf84044ca 100644 --- a/types/graphql/error/syntaxError.d.ts +++ b/types/graphql/error/syntaxError.d.ts @@ -6,7 +6,7 @@ import { GraphQLError } from './GraphQLError'; * descriptive information about the syntax error's position in the source. */ export function syntaxError( - source: Source, - position: number, - description: string + source: Source, + position: number, + description: string, ): GraphQLError; diff --git a/types/graphql/execution/execute.d.ts b/types/graphql/execution/execute.d.ts index c8ee7d9215..ea6ab8ed39 100644 --- a/types/graphql/execution/execute.d.ts +++ b/types/graphql/execution/execute.d.ts @@ -1,14 +1,18 @@ import { GraphQLError, locatedError } from '../error'; import { GraphQLSchema } from '../type/schema'; -import { GraphQLField, GraphQLFieldResolver, ResponsePath } from '../type/definition'; import { - DirectiveNode, - DocumentNode, - OperationDefinitionNode, - SelectionSetNode, - FieldNode, - InlineFragmentNode, - FragmentDefinitionNode, + GraphQLField, + GraphQLFieldResolver, + ResponsePath, +} from '../type/definition'; +import { + DirectiveNode, + DocumentNode, + OperationDefinitionNode, + SelectionSetNode, + FieldNode, + InlineFragmentNode, + FragmentDefinitionNode, } from '../language/ast'; /** * Data that must be available at all points during query execution. @@ -17,13 +21,13 @@ import { * and the fragments defined in the query document */ export interface ExecutionContext { - schema: GraphQLSchema; - fragments: { [key: string]: FragmentDefinitionNode }; - rootValue: any; - operation: OperationDefinitionNode; - variableValues: { [key: string]: any }; - fieldResolver: GraphQLFieldResolver; - errors: GraphQLError[]; + schema: GraphQLSchema; + fragments: { [key: string]: FragmentDefinitionNode }; + rootValue: any; + operation: OperationDefinitionNode; + variableValues: { [key: string]: any }; + fieldResolver: GraphQLFieldResolver; + errors: GraphQLError[]; } /** @@ -33,19 +37,19 @@ export interface ExecutionContext { * non-empty array if an error occurred. */ export interface ExecutionResult { - data?: { [key: string]: any }; - extensions?: { [key: string]: any }; - errors?: GraphQLError[]; + data?: { [key: string]: any }; + extensions?: { [key: string]: any }; + errors?: GraphQLError[]; } export type ExecutionArgs = { - schema: GraphQLSchema, - document: DocumentNode, - rootValue?: any, - contextValue?: any, - variableValues?: {[key: string]: any}, - operationName?: string, - fieldResolver?: GraphQLFieldResolver + schema: GraphQLSchema; + document: DocumentNode; + rootValue?: any; + contextValue?: any; + variableValues?: { [key: string]: any }; + operationName?: string; + fieldResolver?: GraphQLFieldResolver; }; /** @@ -60,24 +64,22 @@ export type ExecutionArgs = { */ export function execute(args: ExecutionArgs): Promise; export function execute( - schema: GraphQLSchema, - document: DocumentNode, - rootValue?: any, - contextValue?: any, - variableValues?: { - [key: string]: any - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver, + schema: GraphQLSchema, + document: DocumentNode, + rootValue?: any, + contextValue?: any, + variableValues?: { + [key: string]: any; + }, + operationName?: string, + fieldResolver?: GraphQLFieldResolver, ): Promise; /** * Given a ResponsePath (found in the `path` entry in the information provided * as the last argument to a field resolver), return an Array of the path keys. */ -export function responsePathAsArray( - path: ResponsePath -): Array; +export function responsePathAsArray(path: ResponsePath): Array; export function addPath(prev: ResponsePath, key: string | number): any; diff --git a/types/graphql/execution/index.d.ts b/types/graphql/execution/index.d.ts index 4bf4e395ab..a5c4980c0a 100644 --- a/types/graphql/execution/index.d.ts +++ b/types/graphql/execution/index.d.ts @@ -1,9 +1,9 @@ export { - execute, - defaultFieldResolver, - responsePathAsArray, - ExecutionArgs, - ExecutionResult + execute, + defaultFieldResolver, + responsePathAsArray, + ExecutionArgs, + ExecutionResult, } from './execute'; export { getDirectiveValues } from './values'; diff --git a/types/graphql/execution/values.d.ts b/types/graphql/execution/values.d.ts index 79a0176f8d..08e6041aa2 100644 --- a/types/graphql/execution/values.d.ts +++ b/types/graphql/execution/values.d.ts @@ -1,7 +1,15 @@ -import { GraphQLInputType, GraphQLField, GraphQLArgument } from '../type/definition'; +import { + GraphQLInputType, + GraphQLField, + GraphQLArgument, +} from '../type/definition'; import { GraphQLDirective } from '../type/directives'; import { GraphQLSchema } from '../type/schema'; -import { FieldNode, DirectiveNode, VariableDefinitionNode } from '../language/ast'; +import { + FieldNode, + DirectiveNode, + VariableDefinitionNode, +} from '../language/ast'; /** * Prepares an object map of variableValues of the correct type based on the @@ -9,9 +17,9 @@ import { FieldNode, DirectiveNode, VariableDefinitionNode } from '../language/as * parsed to match the variable definitions, a GraphQLError will be thrown. */ export function getVariableValues( - schema: GraphQLSchema, - varDefNodes: VariableDefinitionNode[], - inputs: { [key: string]: any } + schema: GraphQLSchema, + varDefNodes: VariableDefinitionNode[], + inputs: { [key: string]: any }, ): { [key: string]: any }; /** @@ -19,9 +27,9 @@ export function getVariableValues( * definitions and list of argument AST nodes. */ export function getArgumentValues( - def: GraphQLField | GraphQLDirective, - node: FieldNode | DirectiveNode, - variableValues?: { [key: string]: any } + def: GraphQLField | GraphQLDirective, + node: FieldNode | DirectiveNode, + variableValues?: { [key: string]: any }, ): { [key: string]: any }; /** @@ -32,7 +40,7 @@ export function getArgumentValues( * If the directive does not exist on the node, returns undefined. */ export function getDirectiveValues( - directiveDef: GraphQLDirective, - node: { directives?: Array }, - variableValues?: { [key: string]: any } + directiveDef: GraphQLDirective, + node: { directives?: Array }, + variableValues?: { [key: string]: any }, ): void | { [key: string]: any }; diff --git a/types/graphql/index.d.ts b/types/graphql/index.d.ts index 4bca573210..a8bead58fd 100644 --- a/types/graphql/index.d.ts +++ b/types/graphql/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for graphql 0.11 +// Type definitions for graphql 0.12 // Project: https://www.npmjs.com/package/graphql // Definitions by: TonyYang // Caleb Meredith @@ -10,6 +10,8 @@ // Hagai Cohen // Ricardo Portugal // Tim Griesser +// Dylan Stewart +// Alessio Dionisi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 diff --git a/types/graphql/language/ast.d.ts b/types/graphql/language/ast.d.ts index f4bc343ed2..1873caeb1f 100644 --- a/types/graphql/language/ast.d.ts +++ b/types/graphql/language/ast.d.ts @@ -5,454 +5,577 @@ import { Source } from './source'; * identify the region of the source from which the AST derived. */ export interface Location { - /** - * The character offset at which this Node begins. - */ - start: number; + /** + * The character offset at which this Node begins. + */ + start: number; - /** - * The character offset at which this Node ends. - */ - end: number; + /** + * The character offset at which this Node ends. + */ + end: number; - /** - * The Token at which this Node begins. - */ - startToken: Token; + /** + * The Token at which this Node begins. + */ + startToken: Token; - /** - * The Token at which this Node ends. - */ - endToken: Token; + /** + * The Token at which this Node ends. + */ + endToken: Token; - /** - * The Source document the AST represents. - */ - source: Source; + /** + * The Source document the AST represents. + */ + source: Source; } +/** + * Represents the different kinds of tokens in a GraphQL document. + * This type is not inlined in `Token` to fix syntax highlighting on GitHub + * *only*. + */ +type TokenKind = + | '' + | '' + | '!' + | '$' + | '(' + | ')' + | '...' + | ':' + | '=' + | '@' + | '[' + | ']' + | '{' + | '|' + | '}' + | 'Name' + | 'Int' + | 'Float' + | 'String' + | 'BlockString' + | 'Comment'; + /** * Represents a range of characters represented by a lexical token * within a Source. */ export interface Token { - /** - * The kind of Token. - */ - kind: - | '' - | '' - | '!' - | '$' - | '(' - | ')' - | '...' - | ':' - | '=' - | '@' - | '[' - | ']' - | '{' - | '|' - | '}' - | 'Name' - | 'Int' - | 'Float' - | 'String' - | 'Comment'; + /** + * The kind of Token. + */ + kind: TokenKind; - /** - * The character offset at which this Node begins. - */ - start: number; + /** + * The character offset at which this Node begins. + */ + start: number; - /** - * The character offset at which this Node ends. - */ - end: number; + /** + * The character offset at which this Node ends. + */ + end: number; - /** - * The 1-indexed line number on which this Token appears. - */ - line: number; + /** + * The 1-indexed line number on which this Token appears. + */ + line: number; - /** - * The 1-indexed column number at which this Token begins. - */ - column: number; + /** + * The 1-indexed column number at which this Token begins. + */ + column: number; - /** - * For non-punctuation tokens, represents the interpreted value of the token. - */ - value: string | undefined; + /** + * For non-punctuation tokens, represents the interpreted value of the token. + */ + value: string | undefined; - /** - * Tokens exist as nodes in a double-linked-list amongst all tokens - * including ignored tokens. is always the first node and - * the last. - */ - prev?: Token; - next?: Token; + /** + * Tokens exist as nodes in a double-linked-list amongst all tokens + * including ignored tokens. is always the first node and + * the last. + */ + prev?: Token; + next?: Token; } /** * The list of all possible AST node types. */ export type ASTNode = - | NameNode - | DocumentNode - | OperationDefinitionNode - | VariableDefinitionNode - | VariableNode - | SelectionSetNode - | FieldNode - | ArgumentNode - | FragmentSpreadNode - | InlineFragmentNode - | FragmentDefinitionNode - | IntValueNode - | FloatValueNode - | StringValueNode - | BooleanValueNode - | NullValueNode - | EnumValueNode - | ListValueNode - | ObjectValueNode - | ObjectFieldNode - | DirectiveNode - | NamedTypeNode - | ListTypeNode - | NonNullTypeNode - | SchemaDefinitionNode - | OperationTypeDefinitionNode - | ScalarTypeDefinitionNode - | ObjectTypeDefinitionNode - | FieldDefinitionNode - | InputValueDefinitionNode - | InterfaceTypeDefinitionNode - | UnionTypeDefinitionNode - | EnumTypeDefinitionNode - | EnumValueDefinitionNode - | InputObjectTypeDefinitionNode - | TypeExtensionDefinitionNode - | DirectiveDefinitionNode; + | NameNode + | DocumentNode + | OperationDefinitionNode + | VariableDefinitionNode + | VariableNode + | SelectionSetNode + | FieldNode + | ArgumentNode + | FragmentSpreadNode + | InlineFragmentNode + | FragmentDefinitionNode + | IntValueNode + | FloatValueNode + | StringValueNode + | BooleanValueNode + | NullValueNode + | EnumValueNode + | ListValueNode + | ObjectValueNode + | ObjectFieldNode + | DirectiveNode + | NamedTypeNode + | ListTypeNode + | NonNullTypeNode + | SchemaDefinitionNode + | OperationTypeDefinitionNode + | ScalarTypeDefinitionNode + | ObjectTypeDefinitionNode + | FieldDefinitionNode + | InputValueDefinitionNode + | InterfaceTypeDefinitionNode + | UnionTypeDefinitionNode + | EnumTypeDefinitionNode + | EnumValueDefinitionNode + | InputObjectTypeDefinitionNode + | ScalarTypeExtensionNode + | ObjectTypeExtensionNode + | InterfaceTypeExtensionNode + | UnionTypeExtensionNode + | EnumTypeExtensionNode + | InputObjectTypeExtensionNode + | DirectiveDefinitionNode; + +/** + * Utility type listing all nodes indexed by their kind. + */ +export interface ASTKindToNode { + Name: NameNode; + Document: DocumentNode; + OperationDefinition: OperationDefinitionNode; + VariableDefinition: VariableDefinitionNode; + Variable: VariableNode; + SelectionSet: SelectionSetNode; + Field: FieldNode; + Argument: ArgumentNode; + FragmentSpread: FragmentSpreadNode; + InlineFragment: InlineFragmentNode; + FragmentDefinition: FragmentDefinitionNode; + IntValue: IntValueNode; + FloatValue: FloatValueNode; + StringValue: StringValueNode; + BooleanValue: BooleanValueNode; + NullValue: NullValueNode; + EnumValue: EnumValueNode; + ListValue: ListValueNode; + ObjectValue: ObjectValueNode; + ObjectField: ObjectFieldNode; + Directive: DirectiveNode; + NamedType: NamedTypeNode; + ListType: ListTypeNode; + NonNullType: NonNullTypeNode; + SchemaDefinition: SchemaDefinitionNode; + OperationTypeDefinition: OperationTypeDefinitionNode; + ScalarTypeDefinition: ScalarTypeDefinitionNode; + ObjectTypeDefinition: ObjectTypeDefinitionNode; + FieldDefinition: FieldDefinitionNode; + InputValueDefinition: InputValueDefinitionNode; + InterfaceTypeDefinition: InterfaceTypeDefinitionNode; + UnionTypeDefinition: UnionTypeDefinitionNode; + EnumTypeDefinition: EnumTypeDefinitionNode; + EnumValueDefinition: EnumValueDefinitionNode; + InputObjectTypeDefinition: InputObjectTypeDefinitionNode; + ScalarTypeExtension: ScalarTypeExtensionNode; + ObjectTypeExtension: ObjectTypeExtensionNode; + InterfaceTypeExtension: InterfaceTypeExtensionNode; + UnionTypeExtension: UnionTypeExtensionNode; + EnumTypeExtension: EnumTypeExtensionNode; + InputObjectTypeExtension: InputObjectTypeExtensionNode; + DirectiveDefinition: DirectiveDefinitionNode; +} // Name export interface NameNode { - kind: 'Name'; - loc?: Location; - value: string; + kind: 'Name'; + loc?: Location; + value: string; } // Document export interface DocumentNode { - kind: 'Document'; - loc?: Location; - definitions: DefinitionNode[]; + kind: 'Document'; + loc?: Location; + definitions: DefinitionNode[]; } export type DefinitionNode = - | OperationDefinitionNode - | FragmentDefinitionNode - | TypeSystemDefinitionNode; // experimental non-spec addition. + | ExecutableDefinitionNode + | TypeSystemDefinitionNode; // experimental non-spec addition. + +export type ExecutableDefinitionNode = + | OperationDefinitionNode + | FragmentDefinitionNode; export interface OperationDefinitionNode { - kind: 'OperationDefinition'; - loc?: Location; - operation: OperationTypeNode; - name?: NameNode; - variableDefinitions?: VariableDefinitionNode[]; - directives?: DirectiveNode[]; - selectionSet: SelectionSetNode; + kind: 'OperationDefinition'; + loc?: Location; + operation: OperationTypeNode; + name?: NameNode; + variableDefinitions?: VariableDefinitionNode[]; + directives?: DirectiveNode[]; + selectionSet: SelectionSetNode; } // Note: subscription is an experimental non-spec addition. export type OperationTypeNode = 'query' | 'mutation' | 'subscription'; export interface VariableDefinitionNode { - kind: 'VariableDefinition'; - loc?: Location; - variable: VariableNode; - type: TypeNode; - defaultValue?: ValueNode; + kind: 'VariableDefinition'; + loc?: Location; + variable: VariableNode; + type: TypeNode; + defaultValue?: ValueNode; } export interface VariableNode { - kind: 'Variable'; - loc?: Location; - name: NameNode; + kind: 'Variable'; + loc?: Location; + name: NameNode; } export interface SelectionSetNode { - kind: 'SelectionSet'; - loc?: Location; - selections: SelectionNode[]; + kind: 'SelectionSet'; + loc?: Location; + selections: SelectionNode[]; } -export type SelectionNode = - | FieldNode - | FragmentSpreadNode - | InlineFragmentNode; +export type SelectionNode = FieldNode | FragmentSpreadNode | InlineFragmentNode; export interface FieldNode { - kind: 'Field'; - loc?: Location; - alias?: NameNode; - name: NameNode; - arguments?: ArgumentNode[]; - directives?: DirectiveNode[]; - selectionSet?: SelectionSetNode; + kind: 'Field'; + loc?: Location; + alias?: NameNode; + name: NameNode; + arguments?: ArgumentNode[]; + directives?: DirectiveNode[]; + selectionSet?: SelectionSetNode; } export interface ArgumentNode { - kind: 'Argument'; - loc?: Location; - name: NameNode; - value: ValueNode; + kind: 'Argument'; + loc?: Location; + name: NameNode; + value: ValueNode; } // Fragments export interface FragmentSpreadNode { - kind: 'FragmentSpread'; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; + kind: 'FragmentSpread'; + loc?: Location; + name: NameNode; + directives?: DirectiveNode[]; } export interface InlineFragmentNode { - kind: 'InlineFragment'; - loc?: Location; - typeCondition?: NamedTypeNode; - directives?: DirectiveNode[]; - selectionSet: SelectionSetNode; + kind: 'InlineFragment'; + loc?: Location; + typeCondition?: NamedTypeNode; + directives?: DirectiveNode[]; + selectionSet: SelectionSetNode; } export interface FragmentDefinitionNode { - kind: 'FragmentDefinition'; - loc?: Location; - name: NameNode; - typeCondition: NamedTypeNode; - directives?: DirectiveNode[]; - selectionSet: SelectionSetNode; + kind: 'FragmentDefinition'; + loc?: Location; + name: NameNode; + // Note: fragment variable definitions are experimental and may be changed + // or removed in the future. + variableDefinitions?: VariableDefinitionNode[]; + typeCondition: NamedTypeNode; + directives?: DirectiveNode[]; + selectionSet: SelectionSetNode; } // Values export type ValueNode = - | VariableNode - | IntValueNode - | FloatValueNode - | StringValueNode - | BooleanValueNode - | NullValueNode - | EnumValueNode - | ListValueNode - | ObjectValueNode; + | VariableNode + | IntValueNode + | FloatValueNode + | StringValueNode + | BooleanValueNode + | NullValueNode + | EnumValueNode + | ListValueNode + | ObjectValueNode; export interface IntValueNode { - kind: 'IntValue'; - loc?: Location; - value: string; + kind: 'IntValue'; + loc?: Location; + value: string; } export interface FloatValueNode { - kind: 'FloatValue'; - loc?: Location; - value: string; + kind: 'FloatValue'; + loc?: Location; + value: string; } export interface StringValueNode { - kind: 'StringValue'; - loc?: Location; - value: string; + kind: 'StringValue'; + loc?: Location; + value: string; } export interface BooleanValueNode { - kind: 'BooleanValue'; - loc?: Location; - value: boolean; + kind: 'BooleanValue'; + loc?: Location; + value: boolean; } export interface NullValueNode { - kind: 'NullValue'; - loc?: Location; + kind: 'NullValue'; + loc?: Location; } export interface EnumValueNode { - kind: 'EnumValue'; - loc?: Location; - value: string; + kind: 'EnumValue'; + loc?: Location; + value: string; } export interface ListValueNode { - kind: 'ListValue'; - loc?: Location; - values: ValueNode[]; + kind: 'ListValue'; + loc?: Location; + values: ValueNode[]; } export interface ObjectValueNode { - kind: 'ObjectValue'; - loc?: Location; - fields: ObjectFieldNode[]; + kind: 'ObjectValue'; + loc?: Location; + fields: ObjectFieldNode[]; } export interface ObjectFieldNode { - kind: 'ObjectField'; - loc?: Location; - name: NameNode; - value: ValueNode; + kind: 'ObjectField'; + loc?: Location; + name: NameNode; + value: ValueNode; } // Directives export interface DirectiveNode { - kind: 'Directive'; - loc?: Location; - name: NameNode; - arguments?: ArgumentNode[]; + kind: 'Directive'; + loc?: Location; + name: NameNode; + arguments?: ArgumentNode[]; } // Type Reference -export type TypeNode = - | NamedTypeNode - | ListTypeNode - | NonNullTypeNode; +export type TypeNode = NamedTypeNode | ListTypeNode | NonNullTypeNode; export interface NamedTypeNode { - kind: 'NamedType'; - loc?: Location; - name: NameNode; + kind: 'NamedType'; + loc?: Location; + name: NameNode; } export interface ListTypeNode { - kind: 'ListType'; - loc?: Location; - type: TypeNode; + kind: 'ListType'; + loc?: Location; + type: TypeNode; } export interface NonNullTypeNode { - kind: 'NonNullType'; - loc?: Location; - type: NamedTypeNode | ListTypeNode; + kind: 'NonNullType'; + loc?: Location; + type: NamedTypeNode | ListTypeNode; } // Type System Definition export type TypeSystemDefinitionNode = - | SchemaDefinitionNode - | TypeDefinitionNode - | TypeExtensionDefinitionNode - | DirectiveDefinitionNode; + | SchemaDefinitionNode + | TypeDefinitionNode + | TypeExtensionNode + | DirectiveDefinitionNode; export interface SchemaDefinitionNode { - kind: 'SchemaDefinition'; - loc?: Location; - directives: DirectiveNode[]; - operationTypes: OperationTypeDefinitionNode[]; + kind: 'SchemaDefinition'; + loc?: Location; + directives: DirectiveNode[]; + operationTypes: OperationTypeDefinitionNode[]; } export interface OperationTypeDefinitionNode { - kind: 'OperationTypeDefinition'; - loc?: Location; - operation: OperationTypeNode; - type: NamedTypeNode; + kind: 'OperationTypeDefinition'; + loc?: Location; + operation: OperationTypeNode; + type: NamedTypeNode; } export type TypeDefinitionNode = - | ScalarTypeDefinitionNode - | ObjectTypeDefinitionNode - | InterfaceTypeDefinitionNode - | UnionTypeDefinitionNode - | EnumTypeDefinitionNode - | InputObjectTypeDefinitionNode; + | ScalarTypeDefinitionNode + | ObjectTypeDefinitionNode + | InterfaceTypeDefinitionNode + | UnionTypeDefinitionNode + | EnumTypeDefinitionNode + | InputObjectTypeDefinitionNode; export interface ScalarTypeDefinitionNode { - kind: 'ScalarTypeDefinition'; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; + kind: 'ScalarTypeDefinition'; + loc?: Location; + description?: StringValueNode; + name: NameNode; + directives?: DirectiveNode[]; } export interface ObjectTypeDefinitionNode { - kind: 'ObjectTypeDefinition'; - loc?: Location; - name: NameNode; - interfaces?: NamedTypeNode[]; - directives?: DirectiveNode[]; - fields: FieldDefinitionNode[]; + kind: 'ObjectTypeDefinition'; + loc?: Location; + description?: StringValueNode; + name: NameNode; + interfaces?: NamedTypeNode[]; + directives?: DirectiveNode[]; + fields: FieldDefinitionNode[]; } export interface FieldDefinitionNode { - kind: 'FieldDefinition'; - loc?: Location; - name: NameNode; - arguments: InputValueDefinitionNode[]; - type: TypeNode; - directives?: DirectiveNode[]; + kind: 'FieldDefinition'; + loc?: Location; + description?: StringValueNode; + name: NameNode; + arguments: InputValueDefinitionNode[]; + type: TypeNode; + directives?: DirectiveNode[]; } export interface InputValueDefinitionNode { - kind: 'InputValueDefinition'; - loc?: Location; - name: NameNode; - type: TypeNode; - defaultValue?: ValueNode; - directives?: DirectiveNode[]; + kind: 'InputValueDefinition'; + loc?: Location; + description?: StringValueNode; + name: NameNode; + type: TypeNode; + defaultValue?: ValueNode; + directives?: DirectiveNode[]; } export interface InterfaceTypeDefinitionNode { - kind: 'InterfaceTypeDefinition'; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; - fields: FieldDefinitionNode[]; + kind: 'InterfaceTypeDefinition'; + loc?: Location; + description?: StringValueNode; + name: NameNode; + directives?: DirectiveNode[]; + fields: FieldDefinitionNode[]; } export interface UnionTypeDefinitionNode { - kind: 'UnionTypeDefinition'; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; - types: NamedTypeNode[]; + kind: 'UnionTypeDefinition'; + loc?: Location; + description?: StringValueNode; + name: NameNode; + directives?: DirectiveNode[]; + types: NamedTypeNode[]; } export interface EnumTypeDefinitionNode { - kind: 'EnumTypeDefinition'; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; - values: EnumValueDefinitionNode[]; + kind: 'EnumTypeDefinition'; + loc?: Location; + description?: StringValueNode; + name: NameNode; + directives?: DirectiveNode[]; + values: EnumValueDefinitionNode[]; } export interface EnumValueDefinitionNode { - kind: 'EnumValueDefinition'; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; + kind: 'EnumValueDefinition'; + loc?: Location; + description?: StringValueNode; + name: NameNode; + directives?: DirectiveNode[]; } export interface InputObjectTypeDefinitionNode { - kind: 'InputObjectTypeDefinition'; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; - fields: InputValueDefinitionNode[]; + kind: 'InputObjectTypeDefinition'; + loc?: Location; + description?: StringValueNode; + name: NameNode; + directives?: DirectiveNode[]; + fields: InputValueDefinitionNode[]; } -export interface TypeExtensionDefinitionNode { - kind: 'TypeExtensionDefinition'; - loc?: Location; - definition: ObjectTypeDefinitionNode; -} +export type TypeExtensionNode = + | ScalarTypeExtensionNode + | ObjectTypeExtensionNode + | InterfaceTypeExtensionNode + | UnionTypeExtensionNode + | EnumTypeExtensionNode + | InputObjectTypeExtensionNode; + +export type ScalarTypeExtensionNode = { + kind: 'ScalarTypeExtension'; + loc?: Location; + name: NameNode; + directives?: DirectiveNode[]; +}; + +export type ObjectTypeExtensionNode = { + kind: 'ObjectTypeExtension'; + loc?: Location; + name: NameNode; + interfaces?: NamedTypeNode[]; + directives?: DirectiveNode[]; + fields?: FieldDefinitionNode[]; +}; + +export type InterfaceTypeExtensionNode = { + kind: 'InterfaceTypeExtension'; + loc?: Location; + name: NameNode; + directives?: DirectiveNode[]; + fields?: FieldDefinitionNode[]; +}; + +export type UnionTypeExtensionNode = { + kind: 'UnionTypeExtension'; + loc?: Location; + name: NameNode; + directives?: DirectiveNode[]; + types?: NamedTypeNode[]; +}; + +export type EnumTypeExtensionNode = { + kind: 'EnumTypeExtension'; + loc?: Location; + name: NameNode; + directives?: DirectiveNode[]; + values?: EnumValueDefinitionNode[]; +}; + +export type InputObjectTypeExtensionNode = { + kind: 'InputObjectTypeExtension'; + loc?: Location; + name: NameNode; + directives?: DirectiveNode[]; + fields?: InputValueDefinitionNode[]; +}; + +// Directive Definitions export interface DirectiveDefinitionNode { - kind: 'DirectiveDefinition'; - loc?: Location; - name: NameNode; - arguments?: InputValueDefinitionNode[]; - locations: NameNode[]; + kind: 'DirectiveDefinition'; + loc?: Location; + description?: StringValueNode; + name: NameNode; + arguments?: InputValueDefinitionNode[]; + locations: NameNode[]; } diff --git a/types/graphql/language/index.d.ts b/types/graphql/language/index.d.ts index bc00bb243d..c8fe4b13ec 100644 --- a/types/graphql/language/index.d.ts +++ b/types/graphql/language/index.d.ts @@ -7,9 +7,9 @@ export { parse, parseValue, parseType, ParseOptions } from './parser'; export { print } from './printer'; export { Source } from './source'; export { - visit, - visitInParallel, - visitWithTypeInfo, - getVisitFn, - BREAK + visit, + visitInParallel, + visitWithTypeInfo, + getVisitFn, + BREAK, } from './visitor'; diff --git a/types/graphql/language/kinds.d.ts b/types/graphql/language/kinds.d.ts index 626d350818..f92826f891 100644 --- a/types/graphql/language/kinds.d.ts +++ b/types/graphql/language/kinds.d.ts @@ -60,6 +60,12 @@ export const INPUT_OBJECT_TYPE_DEFINITION: 'InputObjectTypeDefinition'; // Type Extensions export const TYPE_EXTENSION_DEFINITION: 'TypeExtensionDefinition'; +export const SCALAR_TYPE_EXTENSION: 'ScalarTypeExtension'; +export const OBJECT_TYPE_EXTENSION: 'ObjectTypeExtension'; +export const INTERFACE_TYPE_EXTENSION: 'InterfaceTypeExtension'; +export const UNION_TYPE_EXTENSION: 'UnionTypeExtension'; +export const ENUM_TYPE_EXTENSION: 'EnumTypeExtension'; +export const INPUT_OBJECT_TYPE_EXTENSION: 'InputObjectTypeExtension'; // Directive Definitions diff --git a/types/graphql/language/lexer.d.ts b/types/graphql/language/lexer.d.ts index 4a55f03dc2..0db85434e2 100644 --- a/types/graphql/language/lexer.d.ts +++ b/types/graphql/language/lexer.d.ts @@ -11,41 +11,41 @@ import { syntaxError } from '../error'; * whenever called. */ export function createLexer( - source: Source, - options: TOptions + source: Source, + options: TOptions, ): Lexer; /** * The return type of createLexer. */ export interface Lexer { - source: Source; - options: TOptions; + source: Source; + options: TOptions; - /** - * The previously focused non-ignored token. - */ - lastToken: Token; + /** + * The previously focused non-ignored token. + */ + lastToken: Token; - /** - * The currently focused non-ignored token. - */ - token: Token; + /** + * The currently focused non-ignored token. + */ + token: Token; - /** - * The (1-indexed) line containing the current token. - */ - line: number; + /** + * The (1-indexed) line containing the current token. + */ + line: number; - /** - * The character offset at which the current line begins. - */ - lineStart: number; + /** + * The character offset at which the current line begins. + */ + lineStart: number; - /** - * Advances the token stream to the next non-ignored token. - */ - advance(): Token; + /** + * Advances the token stream to the next non-ignored token. + */ + advance(): Token; } /** @@ -53,26 +53,26 @@ export interface Lexer { * lexer emits. */ export const TokenKind: { - SOF: '' - EOF: '' - BANG: '!' - DOLLAR: '$' - PAREN_L: '(' - PAREN_R: ')' - SPREAD: '...' - COLON: ':' - EQUALS: '=' - AT: '@' - BRACKET_L: '[' - BRACKET_R: ']' - BRACE_L: '{' - PIPE: '|' - BRACE_R: '}' - NAME: 'Name' - INT: 'Int' - FLOAT: 'Float' - STRING: 'String' - COMMENT: 'Comment' + SOF: ''; + EOF: ''; + BANG: '!'; + DOLLAR: '$'; + PAREN_L: '('; + PAREN_R: ')'; + SPREAD: '...'; + COLON: ':'; + EQUALS: '='; + AT: '@'; + BRACKET_L: '['; + BRACKET_R: ']'; + BRACE_L: '{'; + PIPE: '|'; + BRACE_R: '}'; + NAME: 'Name'; + INT: 'Int'; + FLOAT: 'Float'; + STRING: 'String'; + COMMENT: 'Comment'; }; /** diff --git a/types/graphql/language/location.d.ts b/types/graphql/language/location.d.ts index 4d7a13e314..cb9744e0d5 100644 --- a/types/graphql/language/location.d.ts +++ b/types/graphql/language/location.d.ts @@ -1,8 +1,8 @@ -import { Source } from "./source"; +import { Source } from './source'; export interface SourceLocation { - line: number; - column: number; + line: number; + column: number; } export function getLocation(source: Source, position: number): SourceLocation; diff --git a/types/graphql/language/parser.d.ts b/types/graphql/language/parser.d.ts index 5aa195ddd4..a0b8a0c7a4 100644 --- a/types/graphql/language/parser.d.ts +++ b/types/graphql/language/parser.d.ts @@ -1,17 +1,17 @@ -import { NamedTypeNode, TypeNode, ValueNode, DocumentNode } from "./ast"; -import { Source } from "./source"; -import { Lexer } from "./lexer"; +import { NamedTypeNode, TypeNode, ValueNode, DocumentNode } from './ast'; +import { Source } from './source'; +import { Lexer } from './lexer'; /** * Configuration options to control parser behavior */ export interface ParseOptions { - /** - * By default, the parser creates AST nodes that know the location - * in the source that they correspond to. This configuration flag - * disables that behavior for performance or testing. - */ - noLocation?: boolean; + /** + * By default, the parser creates AST nodes that know the location + * in the source that they correspond to. This configuration flag + * disables that behavior for performance or testing. + */ + noLocation?: boolean; } /** @@ -19,8 +19,8 @@ export interface ParseOptions { * Throws GraphQLError if a syntax error is encountered. */ export function parse( - source: string | Source, - options?: ParseOptions + source: string | Source, + options?: ParseOptions, ): DocumentNode; /** @@ -31,8 +31,8 @@ export function parse( * in isolation of complete GraphQL documents. */ export function parseValue( - source: Source | string, - options?: ParseOptions + source: Source | string, + options?: ParseOptions, ): ValueNode; export function parseConstValue(lexer: Lexer): ValueNode; diff --git a/types/graphql/language/source.d.ts b/types/graphql/language/source.d.ts index 80e68f5557..236028b7df 100644 --- a/types/graphql/language/source.d.ts +++ b/types/graphql/language/source.d.ts @@ -1,5 +1,5 @@ export class Source { - body: string; - name: string; - constructor(body: string, name?: string); + body: string; + name: string; + constructor(body: string, name?: string); } diff --git a/types/graphql/language/visitor.d.ts b/types/graphql/language/visitor.d.ts index dc8bcc2692..e7e9d67da0 100644 --- a/types/graphql/language/visitor.d.ts +++ b/types/graphql/language/visitor.d.ts @@ -1,43 +1,43 @@ export const QueryDocumentKeys: { - Name: any[]; - Document: string[]; - OperationDefinition: string[]; - VariableDefinition: string[]; - Variable: string[]; - SelectionSet: string[]; - Field: string[]; - Argument: string[]; + Name: any[]; + Document: string[]; + OperationDefinition: string[]; + VariableDefinition: string[]; + Variable: string[]; + SelectionSet: string[]; + Field: string[]; + Argument: string[]; - FragmentSpread: string[]; - InlineFragment: string[]; - FragmentDefinition: string[]; + FragmentSpread: string[]; + InlineFragment: string[]; + FragmentDefinition: string[]; - IntValue: number[]; - FloatValue: number[]; - StringValue: string[]; - BooleanValue: boolean[]; - NullValue: null[], - EnumValue: any[]; - ListValue: string[]; - ObjectValue: string[]; - ObjectField: string[]; + IntValue: number[]; + FloatValue: number[]; + StringValue: string[]; + BooleanValue: boolean[]; + NullValue: null[]; + EnumValue: any[]; + ListValue: string[]; + ObjectValue: string[]; + ObjectField: string[]; - Directive: string[]; + Directive: string[]; - NamedType: string[]; - ListType: string[]; - NonNullType: string[]; + NamedType: string[]; + ListType: string[]; + NonNullType: string[]; - ObjectTypeDefinition: string[]; - FieldDefinition: string[]; - InputValueDefinition: string[]; - InterfaceTypeDefinition: string[]; - UnionTypeDefinition: string[]; - ScalarTypeDefinition: string[]; - EnumTypeDefinition: string[]; - EnumValueDefinition: string[]; - InputObjectTypeDefinition: string[]; - TypeExtensionDefinition: string[]; + ObjectTypeDefinition: string[]; + FieldDefinition: string[]; + InputValueDefinition: string[]; + InterfaceTypeDefinition: string[]; + UnionTypeDefinition: string[]; + ScalarTypeDefinition: string[]; + EnumTypeDefinition: string[]; + EnumValueDefinition: string[]; + InputObjectTypeDefinition: string[]; + TypeExtensionDefinition: string[]; }; export const BREAK: any; diff --git a/types/graphql/subscription/subscribe.d.ts b/types/graphql/subscription/subscribe.d.ts index 30efc010ec..dc2c096b86 100644 --- a/types/graphql/subscription/subscribe.d.ts +++ b/types/graphql/subscription/subscribe.d.ts @@ -4,26 +4,26 @@ import { GraphQLFieldResolver } from '../type/definition'; import { ExecutionResult } from '../execution/execute'; export function subscribe( - schema: GraphQLSchema, - document: DocumentNode, - rootValue?: any, - contextValue?: any, - variableValues?: { - [key: string]: any; - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver, - subscribeFieldResolver?: GraphQLFieldResolver + schema: GraphQLSchema, + document: DocumentNode, + rootValue?: any, + contextValue?: any, + variableValues?: { + [key: string]: any; + }, + operationName?: string, + fieldResolver?: GraphQLFieldResolver, + subscribeFieldResolver?: GraphQLFieldResolver, ): Promise | ExecutionResult>; export function createSourceEventStream( - schema: GraphQLSchema, - document: DocumentNode, - rootValue?: any, - contextValue?: any, - variableValues?: { - [key: string]: any; - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver + schema: GraphQLSchema, + document: DocumentNode, + rootValue?: any, + contextValue?: any, + variableValues?: { + [key: string]: any; + }, + operationName?: string, + fieldResolver?: GraphQLFieldResolver, ): Promise>; diff --git a/types/graphql/tsconfig.json b/types/graphql/tsconfig.json index 72f0de0665..29525d3350 100644 --- a/types/graphql/tsconfig.json +++ b/types/graphql/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/graphql/type/definition.d.ts b/types/graphql/type/definition.d.ts index 4a44c5d1c6..098f7376ef 100644 --- a/types/graphql/type/definition.d.ts +++ b/types/graphql/type/definition.d.ts @@ -1,18 +1,18 @@ import { - ScalarTypeDefinitionNode, - ObjectTypeDefinitionNode, - FieldDefinitionNode, - InputValueDefinitionNode, - InterfaceTypeDefinitionNode, - UnionTypeDefinitionNode, - EnumTypeDefinitionNode, - EnumValueDefinitionNode, - InputObjectTypeDefinitionNode, - TypeExtensionDefinitionNode, - OperationDefinitionNode, - FieldNode, - FragmentDefinitionNode, - ValueNode, + ScalarTypeDefinitionNode, + ObjectTypeDefinitionNode, + FieldDefinitionNode, + InputValueDefinitionNode, + InterfaceTypeDefinitionNode, + UnionTypeDefinitionNode, + EnumTypeDefinitionNode, + EnumValueDefinitionNode, + InputObjectTypeDefinitionNode, + TypeExtensionNode, + OperationDefinitionNode, + FieldNode, + FragmentDefinitionNode, + ValueNode, } from '../language/ast'; import { GraphQLSchema } from './schema'; @@ -20,14 +20,14 @@ import { GraphQLSchema } from './schema'; * These are all of the possible kinds of types. */ export type GraphQLType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList - | GraphQLNonNull; + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList + | GraphQLNonNull; export function isType(type: any): type is GraphQLType; @@ -37,15 +37,16 @@ export function assertType(type: any): GraphQLType; * These types may be used as input types for arguments and directives. */ export type GraphQLInputType = - | GraphQLScalarType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList - | GraphQLNonNull< - | GraphQLScalarType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList>; + | GraphQLScalarType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList + | GraphQLNonNull< + | GraphQLScalarType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList + >; export function isInputType(type: GraphQLType): type is GraphQLInputType; @@ -55,19 +56,20 @@ export function assertInputType(type: GraphQLType): GraphQLInputType; * These types may be used as output types as the result of fields. */ export type GraphQLOutputType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLList - | GraphQLNonNull< - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLList>; + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLList + | GraphQLNonNull< + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLList + >; export function isOutputType(type: GraphQLType): type is GraphQLOutputType; @@ -76,9 +78,7 @@ export function assertOutputType(type: GraphQLType): GraphQLOutputType; /** * These types may describe types which may be leaf values. */ -export type GraphQLLeafType = - | GraphQLScalarType - | GraphQLEnumType; +export type GraphQLLeafType = GraphQLScalarType | GraphQLEnumType; export function isLeafType(type: GraphQLType): type is GraphQLLeafType; @@ -88,20 +88,20 @@ export function assertLeafType(type: GraphQLType): GraphQLLeafType; * These types may describe the parent context of a selection set. */ export type GraphQLCompositeType = - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType; + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType; -export function isCompositeType(type: GraphQLType): type is GraphQLCompositeType; +export function isCompositeType( + type: GraphQLType, +): type is GraphQLCompositeType; export function assertCompositeType(type: GraphQLType): GraphQLCompositeType; /** * These types may describe the parent context of a selection set. */ -export type GraphQLAbstractType = - | GraphQLInterfaceType - | GraphQLUnionType; +export type GraphQLAbstractType = GraphQLInterfaceType | GraphQLUnionType; export function isAbstractType(type: GraphQLType): type is GraphQLAbstractType; @@ -111,28 +111,28 @@ export function assertAbstractType(type: GraphQLType): GraphQLAbstractType; * These types can all accept null as a value. */ export type GraphQLNullableType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList; + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList; export function getNullableType( - type: T -): (T & GraphQLNullableType); + type: T, +): T & GraphQLNullableType; /** * These named types do not include modifiers like List or NonNull. */ export type GraphQLNamedType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLInputObjectType; + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLInputObjectType; export function isNamedType(type: GraphQLType): boolean; @@ -164,30 +164,30 @@ export type Thunk = (() => T) | T; * */ export class GraphQLScalarType { - name: string; - description: string; - astNode?: ScalarTypeDefinitionNode; - constructor(config: GraphQLScalarTypeConfig); + name: string; + description: string; + astNode?: ScalarTypeDefinitionNode; + constructor(config: GraphQLScalarTypeConfig); - // Serializes an internal value to include in a response. - serialize(value: any): any; + // Serializes an internal value to include in a response. + serialize(value: any): any; - // Parses an externally provided value to use as an input. - parseValue(value: any): any; + // Parses an externally provided value to use as an input. + parseValue(value: any): any; - // Parses an externally provided literal value to use as an input. - parseLiteral(valueNode: ValueNode): any; + // Parses an externally provided literal value to use as an input. + parseLiteral(valueNode: ValueNode): any; - toString(): string; + toString(): string; } export interface GraphQLScalarTypeConfig { - name: string; - description?: string; - astNode?: ScalarTypeDefinitionNode; - serialize(value: any): TExternal | null | undefined; - parseValue?(value: any): TInternal | null | undefined; - parseLiteral?(valueNode: ValueNode): TInternal | null | undefined; + name: string; + description?: string; + astNode?: ScalarTypeDefinitionNode; + serialize(value: any): TExternal | null | undefined; + parseValue?(value: any): TInternal | null | undefined; + parseLiteral?(valueNode: ValueNode): TInternal | null | undefined; } /** @@ -228,109 +228,123 @@ export interface GraphQLScalarTypeConfig { * */ export class GraphQLObjectType { - name: string; - description: string; - astNode?: ObjectTypeDefinitionNode; - extensionASTNodes: Array; - isTypeOf: GraphQLIsTypeOfFn; + name: string; + description: string; + astNode?: ObjectTypeDefinitionNode; + extensionASTNodes: Array; + isTypeOf: GraphQLIsTypeOfFn; - constructor(config: GraphQLObjectTypeConfig); - getFields(): GraphQLFieldMap; - getInterfaces(): GraphQLInterfaceType[]; - toString(): string; + constructor(config: GraphQLObjectTypeConfig); + getFields(): GraphQLFieldMap; + getInterfaces(): GraphQLInterfaceType[]; + toString(): string; } export interface GraphQLObjectTypeConfig { - name: string; - interfaces?: Thunk; - fields: Thunk>; - isTypeOf?: GraphQLIsTypeOfFn; - description?: string; - astNode?: ObjectTypeDefinitionNode; - extensionASTNodes?: Array; + name: string; + interfaces?: Thunk; + fields: Thunk>; + isTypeOf?: GraphQLIsTypeOfFn; + description?: string; + astNode?: ObjectTypeDefinitionNode; + extensionASTNodes?: Array; } export type GraphQLTypeResolver = ( - value: TSource, - context: TContext, - info: GraphQLResolveInfo + value: TSource, + context: TContext, + info: GraphQLResolveInfo, ) => GraphQLObjectType | string | Promise; export type GraphQLIsTypeOfFn = ( - source: TSource, - context: TContext, - info: GraphQLResolveInfo + source: TSource, + context: TContext, + info: GraphQLResolveInfo, ) => boolean | Promise; -export type GraphQLFieldResolver = ( - source: TSource, - args: TArgs, - context: TContext, - info: GraphQLResolveInfo +export type GraphQLFieldResolver< + TSource, + TContext, + TArgs = { [argName: string]: any } +> = ( + source: TSource, + args: TArgs, + context: TContext, + info: GraphQLResolveInfo, ) => any; export interface GraphQLResolveInfo { - fieldName: string; - fieldNodes: FieldNode[]; - returnType: GraphQLOutputType; - parentType: GraphQLCompositeType; - path: ResponsePath; - schema: GraphQLSchema; - fragments: { [fragmentName: string]: FragmentDefinitionNode }; - rootValue: any; - operation: OperationDefinitionNode; - variableValues: { [variableName: string]: any }; + fieldName: string; + fieldNodes: FieldNode[]; + returnType: GraphQLOutputType; + parentType: GraphQLCompositeType; + path: ResponsePath; + schema: GraphQLSchema; + fragments: { [fragmentName: string]: FragmentDefinitionNode }; + rootValue: any; + operation: OperationDefinitionNode; + variableValues: { [variableName: string]: any }; } -export type ResponsePath = { prev: ResponsePath, key: string | number } | undefined; +export type ResponsePath = + | { prev: ResponsePath; key: string | number } + | undefined; -export interface GraphQLFieldConfig { - type: GraphQLOutputType; - args?: GraphQLFieldConfigArgumentMap; - resolve?: GraphQLFieldResolver; - subscribe?: GraphQLFieldResolver; - deprecationReason?: string; - description?: string; - astNode?: FieldDefinitionNode; +export interface GraphQLFieldConfig< + TSource, + TContext, + TArgs = { [argName: string]: any } +> { + type: GraphQLOutputType; + args?: GraphQLFieldConfigArgumentMap; + resolve?: GraphQLFieldResolver; + subscribe?: GraphQLFieldResolver; + deprecationReason?: string; + description?: string; + astNode?: FieldDefinitionNode; } export interface GraphQLFieldConfigArgumentMap { - [argName: string]: GraphQLArgumentConfig; + [argName: string]: GraphQLArgumentConfig; } export interface GraphQLArgumentConfig { - type: GraphQLInputType; - defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + type: GraphQLInputType; + defaultValue?: any; + description?: string; + astNode?: InputValueDefinitionNode; } export interface GraphQLFieldConfigMap { - [fieldName: string]: GraphQLFieldConfig; + [fieldName: string]: GraphQLFieldConfig; } -export interface GraphQLField { - name: string; - description: string; - type: GraphQLOutputType; - args: GraphQLArgument[]; - resolve?: GraphQLFieldResolver; - subscribe?: GraphQLFieldResolver; - isDeprecated?: boolean; - deprecationReason?: string; - astNode?: FieldDefinitionNode; +export interface GraphQLField< + TSource, + TContext, + TArgs = { [argName: string]: any } +> { + name: string; + description: string; + type: GraphQLOutputType; + args: GraphQLArgument[]; + resolve?: GraphQLFieldResolver; + subscribe?: GraphQLFieldResolver; + isDeprecated?: boolean; + deprecationReason?: string; + astNode?: FieldDefinitionNode; } export interface GraphQLArgument { - name: string; - type: GraphQLInputType; - defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + name: string; + type: GraphQLInputType; + defaultValue?: any; + description?: string; + astNode?: InputValueDefinitionNode; } export interface GraphQLFieldMap { - [fieldName: string]: GraphQLField; + [fieldName: string]: GraphQLField; } /** @@ -352,29 +366,29 @@ export interface GraphQLFieldMap { * */ export class GraphQLInterfaceType { - name: string; - description: string; - astNode?: InterfaceTypeDefinitionNode; - resolveType: GraphQLTypeResolver; + name: string; + description: string; + astNode?: InterfaceTypeDefinitionNode; + resolveType: GraphQLTypeResolver; - constructor(config: GraphQLInterfaceTypeConfig); + constructor(config: GraphQLInterfaceTypeConfig); - getFields(): GraphQLFieldMap; + getFields(): GraphQLFieldMap; - toString(): string; + toString(): string; } export interface GraphQLInterfaceTypeConfig { - name: string; - fields: Thunk>; - /** - * Optionally provide a custom type resolver function. If one is not provided, - * the default implementation will call `isTypeOf` on each implementing - * Object type. - */ - resolveType?: GraphQLTypeResolver; - description?: string; - astNode?: InterfaceTypeDefinitionNode; + name: string; + fields: Thunk>; + /** + * Optionally provide a custom type resolver function. If one is not provided, + * the default implementation will call `isTypeOf` on each implementing + * Object type. + */ + resolveType?: GraphQLTypeResolver; + description?: string; + astNode?: InterfaceTypeDefinitionNode; } /** @@ -401,29 +415,29 @@ export interface GraphQLInterfaceTypeConfig { * */ export class GraphQLUnionType { - name: string; - description: string; - astNode?: UnionTypeDefinitionNode; - resolveType: GraphQLTypeResolver; + name: string; + description: string; + astNode?: UnionTypeDefinitionNode; + resolveType: GraphQLTypeResolver; - constructor(config: GraphQLUnionTypeConfig); + constructor(config: GraphQLUnionTypeConfig); - getTypes(): GraphQLObjectType[]; + getTypes(): GraphQLObjectType[]; - toString(): string; + toString(): string; } export interface GraphQLUnionTypeConfig { - name: string; - types: Thunk; - /** - * Optionally provide a custom type resolver function. If one is not provided, - * the default implementation will call `isTypeOf` on each implementing - * Object type. - */ - resolveType?: GraphQLTypeResolver; - description?: string; - astNode?: UnionTypeDefinitionNode; + name: string; + types: Thunk; + /** + * Optionally provide a custom type resolver function. If one is not provided, + * the default implementation will call `isTypeOf` on each implementing + * Object type. + */ + resolveType?: GraphQLTypeResolver; + description?: string; + astNode?: UnionTypeDefinitionNode; } /** @@ -448,45 +462,45 @@ export interface GraphQLUnionTypeConfig { * will be used as its internal value. */ export class GraphQLEnumType { - name: string; - description: string; - astNode?: EnumTypeDefinitionNode; + name: string; + description: string; + astNode?: EnumTypeDefinitionNode; - constructor(config: GraphQLEnumTypeConfig); - getValues(): GraphQLEnumValue[]; - getValue(name: string): GraphQLEnumValue; - isValidValue(value: any): boolean; - serialize(value: any): string; - parseValue(value: any): any; - parseLiteral(valueNode: ValueNode): any; - toString(): string; + constructor(config: GraphQLEnumTypeConfig); + getValues(): GraphQLEnumValue[]; + getValue(name: string): GraphQLEnumValue; + isValidValue(value: any): boolean; + serialize(value: any): string; + parseValue(value: any): any; + parseLiteral(valueNode: ValueNode): any; + toString(): string; } export interface GraphQLEnumTypeConfig { - name: string; - values: GraphQLEnumValueConfigMap; - description?: string; - astNode?: EnumTypeDefinitionNode; + name: string; + values: GraphQLEnumValueConfigMap; + description?: string; + astNode?: EnumTypeDefinitionNode; } export interface GraphQLEnumValueConfigMap { - [valueName: string]: GraphQLEnumValueConfig; + [valueName: string]: GraphQLEnumValueConfig; } export interface GraphQLEnumValueConfig { - value?: any; - deprecationReason?: string; - description?: string; - astNode?: EnumValueDefinitionNode; + value?: any; + deprecationReason?: string; + description?: string; + astNode?: EnumValueDefinitionNode; } export interface GraphQLEnumValue { - name: string; - description: string; - isDeprecated?: boolean; - deprecationReason: string; - astNode?: EnumValueDefinitionNode; - value: any; + name: string; + description: string; + isDeprecated?: boolean; + deprecationReason: string; + astNode?: EnumValueDefinitionNode; + value: any; } /** @@ -510,42 +524,42 @@ export interface GraphQLEnumValue { * */ export class GraphQLInputObjectType { - name: string; - description: string; - astNode?: InputObjectTypeDefinitionNode; - constructor(config: GraphQLInputObjectTypeConfig); - getFields(): GraphQLInputFieldMap; - toString(): string; + name: string; + description: string; + astNode?: InputObjectTypeDefinitionNode; + constructor(config: GraphQLInputObjectTypeConfig); + getFields(): GraphQLInputFieldMap; + toString(): string; } export interface GraphQLInputObjectTypeConfig { - name: string; - fields: Thunk; - description?: string; - astNode?: InputObjectTypeDefinitionNode; + name: string; + fields: Thunk; + description?: string; + astNode?: InputObjectTypeDefinitionNode; } export interface GraphQLInputFieldConfig { - type: GraphQLInputType; - defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + type: GraphQLInputType; + defaultValue?: any; + description?: string; + astNode?: InputValueDefinitionNode; } export interface GraphQLInputFieldConfigMap { - [fieldName: string]: GraphQLInputFieldConfig; + [fieldName: string]: GraphQLInputFieldConfig; } export interface GraphQLInputField { - name: string; - type: GraphQLInputType; - defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + name: string; + type: GraphQLInputType; + defaultValue?: any; + description?: string; + astNode?: InputValueDefinitionNode; } export interface GraphQLInputFieldMap { - [fieldName: string]: GraphQLInputField; + [fieldName: string]: GraphQLInputField; } /** @@ -567,9 +581,9 @@ export interface GraphQLInputFieldMap { * */ export class GraphQLList { - ofType: T; - constructor(type: T); - toString(): string; + ofType: T; + constructor(type: T); + toString(): string; } /** @@ -593,9 +607,9 @@ export class GraphQLList { * Note: the enforcement of non-nullability occurs within the executor. */ export class GraphQLNonNull { - ofType: T; + ofType: T; - constructor(type: T); + constructor(type: T); - toString(): string; + toString(): string; } diff --git a/types/graphql/type/directives.d.ts b/types/graphql/type/directives.d.ts index 81befa9eba..b6962bc4ae 100644 --- a/types/graphql/type/directives.d.ts +++ b/types/graphql/type/directives.d.ts @@ -1,30 +1,27 @@ -import { - GraphQLFieldConfigArgumentMap, - GraphQLArgument -} from './definition'; +import { GraphQLFieldConfigArgumentMap, GraphQLArgument } from './definition'; import { DirectiveDefinitionNode } from '../language/ast'; export const DirectiveLocation: { - // Operations - QUERY: 'QUERY', - MUTATION: 'MUTATION', - SUBSCRIPTION: 'SUBSCRIPTION', - FIELD: 'FIELD', - FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION', - FRAGMENT_SPREAD: 'FRAGMENT_SPREAD', - INLINE_FRAGMENT: 'INLINE_FRAGMENT', - // Schema Definitions - SCHEMA: 'SCHEMA', - SCALAR: 'SCALAR', - OBJECT: 'OBJECT', - FIELD_DEFINITION: 'FIELD_DEFINITION', - ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION', - INTERFACE: 'INTERFACE', - UNION: 'UNION', - ENUM: 'ENUM', - ENUM_VALUE: 'ENUM_VALUE', - INPUT_OBJECT: 'INPUT_OBJECT', - INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION', + // Operations + QUERY: 'QUERY'; + MUTATION: 'MUTATION'; + SUBSCRIPTION: 'SUBSCRIPTION'; + FIELD: 'FIELD'; + FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION'; + FRAGMENT_SPREAD: 'FRAGMENT_SPREAD'; + INLINE_FRAGMENT: 'INLINE_FRAGMENT'; + // Schema Definitions + SCHEMA: 'SCHEMA'; + SCALAR: 'SCALAR'; + OBJECT: 'OBJECT'; + FIELD_DEFINITION: 'FIELD_DEFINITION'; + ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION'; + INTERFACE: 'INTERFACE'; + UNION: 'UNION'; + ENUM: 'ENUM'; + ENUM_VALUE: 'ENUM_VALUE'; + INPUT_OBJECT: 'INPUT_OBJECT'; + INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION'; }; export type DirectiveLocationEnum = keyof typeof DirectiveLocation; @@ -34,21 +31,21 @@ export type DirectiveLocationEnum = keyof typeof DirectiveLocation; * behavior. Type system creators will usually not create these directly. */ export class GraphQLDirective { - name: string; - description?: string; - locations: DirectiveLocationEnum[]; - args: GraphQLArgument[]; - astNode?: DirectiveDefinitionNode; + name: string; + description?: string; + locations: DirectiveLocationEnum[]; + args: GraphQLArgument[]; + astNode?: DirectiveDefinitionNode; - constructor(config: GraphQLDirectiveConfig); + constructor(config: GraphQLDirectiveConfig); } export interface GraphQLDirectiveConfig { - name: string; - description?: string; - locations: DirectiveLocationEnum[]; - args?: GraphQLFieldConfigArgumentMap; - astNode?: DirectiveDefinitionNode; + name: string; + description?: string; + locations: DirectiveLocationEnum[]; + args?: GraphQLFieldConfigArgumentMap; + astNode?: DirectiveDefinitionNode; } /** diff --git a/types/graphql/type/index.d.ts b/types/graphql/type/index.d.ts index ae7a81e621..5fdfb1190a 100644 --- a/types/graphql/type/index.d.ts +++ b/types/graphql/type/index.d.ts @@ -4,49 +4,44 @@ export { GraphQLSchema } from './schema'; export * from './definition'; export { - // "Enum" of Directive Locations - DirectiveLocation, - - // Directives Definition - GraphQLDirective, - - // Built-in Directives defined by the Spec - specifiedDirectives, - GraphQLIncludeDirective, - GraphQLSkipDirective, - GraphQLDeprecatedDirective, - - // Constant Deprecation Reason - DEFAULT_DEPRECATION_REASON, + // "Enum" of Directive Locations + DirectiveLocation, + // Directives Definition + GraphQLDirective, + // Built-in Directives defined by the Spec + specifiedDirectives, + GraphQLIncludeDirective, + GraphQLSkipDirective, + GraphQLDeprecatedDirective, + // Constant Deprecation Reason + DEFAULT_DEPRECATION_REASON, } from './directives'; // Common built-in scalar instances. export { - GraphQLInt, - GraphQLFloat, - GraphQLString, - GraphQLBoolean, - GraphQLID, + GraphQLInt, + GraphQLFloat, + GraphQLString, + GraphQLBoolean, + GraphQLID, } from './scalars'; export { - // "Enum" of Type Kinds - TypeKind, - - // GraphQL Types for introspection. - __Schema, - __Directive, - __DirectiveLocation, - __Type, - __Field, - __InputValue, - __EnumValue, - __TypeKind, - - // Meta-field definitions. - SchemaMetaFieldDef, - TypeMetaFieldDef, - TypeNameMetaFieldDef, + // "Enum" of Type Kinds + TypeKind, + // GraphQL Types for introspection. + __Schema, + __Directive, + __DirectiveLocation, + __Type, + __Field, + __InputValue, + __EnumValue, + __TypeKind, + // Meta-field definitions. + SchemaMetaFieldDef, + TypeMetaFieldDef, + TypeNameMetaFieldDef, } from './introspection'; export { DirectiveLocationEnum } from './directives'; diff --git a/types/graphql/type/introspection.d.ts b/types/graphql/type/introspection.d.ts index 989e34a882..48ac468ed0 100644 --- a/types/graphql/type/introspection.d.ts +++ b/types/graphql/type/introspection.d.ts @@ -1,12 +1,12 @@ import { - GraphQLScalarType, - GraphQLObjectType, - GraphQLInterfaceType, - GraphQLUnionType, - GraphQLEnumType, - GraphQLInputObjectType, - GraphQLList, - GraphQLNonNull, + GraphQLScalarType, + GraphQLObjectType, + GraphQLInterfaceType, + GraphQLUnionType, + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLList, + GraphQLNonNull, } from './definition'; import { GraphQLField } from './definition'; @@ -19,14 +19,14 @@ export const __InputValue: GraphQLObjectType; export const __EnumValue: GraphQLObjectType; export const TypeKind: { - SCALAR: 'SCALAR', - OBJECT: 'OBJECT', - INTERFACE: 'INTERFACE', - UNION: 'UNION', - ENUM: 'ENUM', - INPUT_OBJECT: 'INPUT_OBJECT', - LIST: 'LIST', - NON_NULL: 'NON_NULL', + SCALAR: 'SCALAR'; + OBJECT: 'OBJECT'; + INTERFACE: 'INTERFACE'; + UNION: 'UNION'; + ENUM: 'ENUM'; + INPUT_OBJECT: 'INPUT_OBJECT'; + LIST: 'LIST'; + NON_NULL: 'NON_NULL'; }; export const __TypeKind: GraphQLEnumType; diff --git a/types/graphql/type/schema.d.ts b/types/graphql/type/schema.d.ts index a7f4d394f4..3263274dd9 100644 --- a/types/graphql/type/schema.d.ts +++ b/types/graphql/type/schema.d.ts @@ -1,17 +1,11 @@ +import { GraphQLObjectType } from './definition'; import { - GraphQLObjectType, + GraphQLType, + GraphQLNamedType, + GraphQLAbstractType, } from './definition'; -import { - GraphQLType, - GraphQLNamedType, - GraphQLAbstractType -} from './definition'; -import { - SchemaDefinitionNode -} from '../language/ast'; -import { - GraphQLDirective, -} from './directives'; +import { SchemaDefinitionNode } from '../language/ast'; +import { GraphQLDirective } from './directives'; /** * Schema Definition @@ -40,38 +34,38 @@ import { * */ export class GraphQLSchema { - astNode?: SchemaDefinitionNode; - // private _queryType: GraphQLObjectType; - // private _mutationType: GraphQLObjectType; - // private _subscriptionType: GraphQLObjectType; - // private _directives: Array; - // private _typeMap: TypeMap; - // private _implementations: { [interfaceName: string]: Array }; - // private _possibleTypeMap: { [abstractName: string]: { [possibleName: string]: boolean } }; + astNode?: SchemaDefinitionNode; + // private _queryType: GraphQLObjectType; + // private _mutationType: GraphQLObjectType; + // private _subscriptionType: GraphQLObjectType; + // private _directives: Array; + // private _typeMap: TypeMap; + // private _implementations: { [interfaceName: string]: Array }; + // private _possibleTypeMap: { [abstractName: string]: { [possibleName: string]: boolean } }; - constructor(config: GraphQLSchemaConfig) + constructor(config: GraphQLSchemaConfig); - getQueryType(): GraphQLObjectType; - getMutationType(): GraphQLObjectType|null|undefined; - getSubscriptionType(): GraphQLObjectType|null|undefined; - getTypeMap(): { [typeName: string]: GraphQLNamedType }; - getType(name: string): GraphQLNamedType; - getPossibleTypes(abstractType: GraphQLAbstractType): GraphQLObjectType[]; + getQueryType(): GraphQLObjectType; + getMutationType(): GraphQLObjectType | null | undefined; + getSubscriptionType(): GraphQLObjectType | null | undefined; + getTypeMap(): { [typeName: string]: GraphQLNamedType }; + getType(name: string): GraphQLNamedType; + getPossibleTypes(abstractType: GraphQLAbstractType): GraphQLObjectType[]; - isPossibleType( - abstractType: GraphQLAbstractType, - possibleType: GraphQLObjectType - ): boolean; + isPossibleType( + abstractType: GraphQLAbstractType, + possibleType: GraphQLObjectType, + ): boolean; - getDirectives(): GraphQLDirective[]; - getDirective(name: string): GraphQLDirective; + getDirectives(): GraphQLDirective[]; + getDirective(name: string): GraphQLDirective; } export interface GraphQLSchemaConfig { - query: GraphQLObjectType; - mutation?: GraphQLObjectType; - subscription?: GraphQLObjectType; - types?: GraphQLNamedType[]; - directives?: GraphQLDirective[]; - astNode?: SchemaDefinitionNode; + query: GraphQLObjectType; + mutation?: GraphQLObjectType; + subscription?: GraphQLObjectType; + types?: GraphQLNamedType[]; + directives?: GraphQLDirective[]; + astNode?: SchemaDefinitionNode; } diff --git a/types/graphql/utilities/TypeInfo.d.ts b/types/graphql/utilities/TypeInfo.d.ts index 98a53d37ef..a04a24a1a7 100644 --- a/types/graphql/utilities/TypeInfo.d.ts +++ b/types/graphql/utilities/TypeInfo.d.ts @@ -1,12 +1,12 @@ import { GraphQLSchema } from '../type/schema'; import { - GraphQLOutputType, - GraphQLCompositeType, - GraphQLInputType, - GraphQLField, - GraphQLArgument, - GraphQLEnumValue, - GraphQLType, + GraphQLOutputType, + GraphQLCompositeType, + GraphQLInputType, + GraphQLField, + GraphQLArgument, + GraphQLEnumValue, + GraphQLType, } from '../type/definition'; import { GraphQLDirective } from '../type/directives'; import { ASTNode, FieldNode } from '../language/ast'; @@ -17,27 +17,27 @@ import { ASTNode, FieldNode } from '../language/ast'; * AST during a recursive descent by calling `enter(node)` and `leave(node)`. */ export class TypeInfo { - constructor( - schema: GraphQLSchema, - // NOTE: this experimental optional second parameter is only needed in order - // to support non-spec-compliant codebases. You should never need to use it. - // It may disappear in the future. - getFieldDefFn?: getFieldDef - ); + constructor( + schema: GraphQLSchema, + // NOTE: this experimental optional second parameter is only needed in order + // to support non-spec-compliant codebases. You should never need to use it. + // It may disappear in the future. + getFieldDefFn?: getFieldDef, + ); - getType(): GraphQLOutputType; - getParentType(): GraphQLCompositeType; - getInputType(): GraphQLInputType; - getFieldDef(): GraphQLField; - getDirective(): GraphQLDirective; - getArgument(): GraphQLArgument; - getEnumValue(): GraphQLEnumValue; - enter(node: ASTNode): any; - leave(node: ASTNode): any; + getType(): GraphQLOutputType; + getParentType(): GraphQLCompositeType; + getInputType(): GraphQLInputType; + getFieldDef(): GraphQLField; + getDirective(): GraphQLDirective; + getArgument(): GraphQLArgument; + getEnumValue(): GraphQLEnumValue; + enter(node: ASTNode): any; + leave(node: ASTNode): any; } export type getFieldDef = ( - schema: GraphQLSchema, - parentType: GraphQLType, - fieldNode: FieldNode, + schema: GraphQLSchema, + parentType: GraphQLType, + fieldNode: FieldNode, ) => GraphQLField; diff --git a/types/graphql/utilities/astFromValue.d.ts b/types/graphql/utilities/astFromValue.d.ts index 44745c5e6c..557a07dd9d 100644 --- a/types/graphql/utilities/astFromValue.d.ts +++ b/types/graphql/utilities/astFromValue.d.ts @@ -1,6 +1,6 @@ import { - ValueNode, - /* + ValueNode, + /* TODO: IntValueNode, FloatValueNode, @@ -30,7 +30,4 @@ import { GraphQLInputType } from '../type/definition'; * */ // TODO: this should set overloads according to above the table -export function astFromValue( - value: any, - type: GraphQLInputType -): ValueNode; // Warning: there is a code in bottom: throw new TypeError +export function astFromValue(value: any, type: GraphQLInputType): ValueNode; // Warning: there is a code in bottom: throw new TypeError diff --git a/types/graphql/utilities/buildClientSchema.d.ts b/types/graphql/utilities/buildClientSchema.d.ts index 166ec43cf7..bdf898bc2b 100644 --- a/types/graphql/utilities/buildClientSchema.d.ts +++ b/types/graphql/utilities/buildClientSchema.d.ts @@ -11,5 +11,5 @@ import { GraphQLSchema } from '../type/schema'; * server-internal mechanisms. */ export function buildClientSchema( - introspection: IntrospectionQuery + introspection: IntrospectionQuery, ): GraphQLSchema; diff --git a/types/graphql/utilities/extendSchema.d.ts b/types/graphql/utilities/extendSchema.d.ts index f7d00b2fee..389bd02d8b 100644 --- a/types/graphql/utilities/extendSchema.d.ts +++ b/types/graphql/utilities/extendSchema.d.ts @@ -14,6 +14,6 @@ import { GraphQLSchema } from '../type/schema'; * producing the copy. The original schema remains unaltered. */ export function extendSchema( - schema: GraphQLSchema, - documentAST: DocumentNode + schema: GraphQLSchema, + documentAST: DocumentNode, ): GraphQLSchema; diff --git a/types/graphql/utilities/findBreakingChanges.d.ts b/types/graphql/utilities/findBreakingChanges.d.ts index 78d5a5a95b..0d5fc0041a 100644 --- a/types/graphql/utilities/findBreakingChanges.d.ts +++ b/types/graphql/utilities/findBreakingChanges.d.ts @@ -1,35 +1,35 @@ import { - getNamedType, - GraphQLScalarType, - GraphQLEnumType, - GraphQLInputObjectType, - GraphQLInterfaceType, - GraphQLObjectType, - GraphQLUnionType, - GraphQLNamedType, + getNamedType, + GraphQLScalarType, + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLInterfaceType, + GraphQLObjectType, + GraphQLUnionType, + GraphQLNamedType, } from '../type/definition'; import { GraphQLSchema } from '../type/schema'; export const BreakingChangeType: { - FIELD_CHANGED_KIND: 'FIELD_CHANGED_KIND', - FIELD_REMOVED: 'FIELD_REMOVED', - TYPE_CHANGED_KIND: 'TYPE_CHANGED_KIND', - TYPE_REMOVED: 'TYPE_REMOVED', - TYPE_REMOVED_FROM_UNION: 'TYPE_REMOVED_FROM_UNION', - VALUE_REMOVED_FROM_ENUM: 'VALUE_REMOVED_FROM_ENUM', + FIELD_CHANGED_KIND: 'FIELD_CHANGED_KIND'; + FIELD_REMOVED: 'FIELD_REMOVED'; + TYPE_CHANGED_KIND: 'TYPE_CHANGED_KIND'; + TYPE_REMOVED: 'TYPE_REMOVED'; + TYPE_REMOVED_FROM_UNION: 'TYPE_REMOVED_FROM_UNION'; + VALUE_REMOVED_FROM_ENUM: 'VALUE_REMOVED_FROM_ENUM'; }; export type BreakingChangeKey = - | 'FIELD_CHANGED_KIND' - | 'FIELD_REMOVED' - | 'TYPE_CHANGED_KIND' - | 'TYPE_REMOVED' - | 'TYPE_REMOVED_FROM_UNION' - | 'VALUE_REMOVED_FROM_ENUM'; + | 'FIELD_CHANGED_KIND' + | 'FIELD_REMOVED' + | 'TYPE_CHANGED_KIND' + | 'TYPE_REMOVED' + | 'TYPE_REMOVED_FROM_UNION' + | 'VALUE_REMOVED_FROM_ENUM'; export interface BreakingChange { - type: BreakingChangeKey; - description: string; + type: BreakingChangeKey; + description: string; } /** @@ -37,8 +37,8 @@ export interface BreakingChange { * of breaking changes covered by the other functions down below. */ export function findBreakingChanges( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, ): BreakingChange[]; /** @@ -46,8 +46,8 @@ export function findBreakingChanges( * changes in the newSchema related to removing an entire type. */ export function findRemovedTypes( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, ): BreakingChange[]; /** @@ -55,8 +55,8 @@ export function findRemovedTypes( * changes in the newSchema related to changing the type of a type. */ export function findTypesThatChangedKind( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, ): BreakingChange[]; /** @@ -65,8 +65,8 @@ export function findTypesThatChangedKind( * a field has been removed from a type or if a field has changed type. */ export function findFieldsThatChangedType( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, ): BreakingChange[]; /** @@ -74,8 +74,8 @@ export function findFieldsThatChangedType( * changes in the newSchema related to removing types from a union type. */ export function findTypesRemovedFromUnions( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, ): BreakingChange[]; /** @@ -83,6 +83,6 @@ export function findTypesRemovedFromUnions( * changes in the newSchema related to removing values from an enum type. */ export function findValuesRemovedFromEnums( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, ): BreakingChange[]; diff --git a/types/graphql/utilities/findDeprecatedUsages.d.ts b/types/graphql/utilities/findDeprecatedUsages.d.ts index 8f6ff48239..8cd844e15f 100644 --- a/types/graphql/utilities/findDeprecatedUsages.d.ts +++ b/types/graphql/utilities/findDeprecatedUsages.d.ts @@ -8,6 +8,6 @@ import { GraphQLError } from '../error/GraphQLError'; * Returns a list of GraphQLError instances describing each deprecated use. */ export function findDeprecatedUsages( - schema: GraphQLSchema, - ast: DocumentNode + schema: GraphQLSchema, + ast: DocumentNode, ): GraphQLError[]; diff --git a/types/graphql/utilities/getOperationAST.d.ts b/types/graphql/utilities/getOperationAST.d.ts index ce99d39b2b..0d5064d48d 100644 --- a/types/graphql/utilities/getOperationAST.d.ts +++ b/types/graphql/utilities/getOperationAST.d.ts @@ -6,6 +6,6 @@ import { DocumentNode, OperationDefinitionNode } from '../language/ast'; * provided in the document. */ export function getOperationAST( - documentAST: DocumentNode, - operationName?: string + documentAST: DocumentNode, + operationName?: string, ): OperationDefinitionNode; diff --git a/types/graphql/utilities/index.d.ts b/types/graphql/utilities/index.d.ts index 8815046735..cd0e23948f 100644 --- a/types/graphql/utilities/index.d.ts +++ b/types/graphql/utilities/index.d.ts @@ -1,23 +1,23 @@ // The GraphQL query recommended for a full schema introspection. export { introspectionQuery } from './introspectionQuery'; export { - IntrospectionQuery, - IntrospectionSchema, - IntrospectionType, - IntrospectionScalarType, - IntrospectionObjectType, - IntrospectionInterfaceType, - IntrospectionUnionType, - IntrospectionEnumType, - IntrospectionInputObjectType, - IntrospectionTypeRef, - IntrospectionNamedTypeRef, - IntrospectionListTypeRef, - IntrospectionNonNullTypeRef, - IntrospectionField, - IntrospectionInputValue, - IntrospectionEnumValue, - IntrospectionDirective, + IntrospectionQuery, + IntrospectionSchema, + IntrospectionType, + IntrospectionScalarType, + IntrospectionObjectType, + IntrospectionInterfaceType, + IntrospectionUnionType, + IntrospectionEnumType, + IntrospectionInputObjectType, + IntrospectionTypeRef, + IntrospectionNamedTypeRef, + IntrospectionListTypeRef, + IntrospectionNonNullTypeRef, + IntrospectionField, + IntrospectionInputValue, + IntrospectionEnumValue, + IntrospectionDirective, } from './introspectionQuery'; // Gets the target Operation from a Document @@ -33,7 +33,11 @@ export { buildASTSchema, buildSchema } from './buildASTSchema'; export { extendSchema } from './extendSchema'; // Print a GraphQLSchema to GraphQL Schema language. -export { printSchema, printType, printIntrospectionSchema } from './schemaPrinter'; +export { + printSchema, + printType, + printIntrospectionSchema, +} from './schemaPrinter'; // Create a GraphQLType from a GraphQL language AST. export { typeFromAST } from './typeFromAST'; @@ -62,9 +66,9 @@ export { separateOperations } from './separateOperations'; // Comparators for types export { - isEqualType, - isTypeSubTypeOf, - doTypesOverlap + isEqualType, + isTypeSubTypeOf, + doTypesOverlap, } from './typeComparators'; // Asserts that a string is a valid GraphQL name diff --git a/types/graphql/utilities/introspectionQuery.d.ts b/types/graphql/utilities/introspectionQuery.d.ts index a89c5c1fec..f16b873a3a 100644 --- a/types/graphql/utilities/introspectionQuery.d.ts +++ b/types/graphql/utilities/introspectionQuery.d.ts @@ -96,114 +96,114 @@ fragment TypeRef on __Type { export const introspectionQuery: string; export interface IntrospectionQuery { - __schema: IntrospectionSchema; + __schema: IntrospectionSchema; } export interface IntrospectionSchema { - queryType: IntrospectionNamedTypeRef; - mutationType?: IntrospectionNamedTypeRef; - subscriptionType?: IntrospectionNamedTypeRef; - types: IntrospectionType[]; - directives: IntrospectionDirective[]; + queryType: IntrospectionNamedTypeRef; + mutationType?: IntrospectionNamedTypeRef; + subscriptionType?: IntrospectionNamedTypeRef; + types: IntrospectionType[]; + directives: IntrospectionDirective[]; } export type IntrospectionType = - | IntrospectionScalarType - | IntrospectionObjectType - | IntrospectionInterfaceType - | IntrospectionUnionType - | IntrospectionEnumType - | IntrospectionInputObjectType; + | IntrospectionScalarType + | IntrospectionObjectType + | IntrospectionInterfaceType + | IntrospectionUnionType + | IntrospectionEnumType + | IntrospectionInputObjectType; export interface IntrospectionScalarType { - kind: 'SCALAR'; - name: string; - description?: string; + kind: 'SCALAR'; + name: string; + description?: string; } export interface IntrospectionObjectType { - kind: 'OBJECT'; - name: string; - description?: string; - fields: IntrospectionField[]; - interfaces: IntrospectionNamedTypeRef[]; + kind: 'OBJECT'; + name: string; + description?: string; + fields: IntrospectionField[]; + interfaces: IntrospectionNamedTypeRef[]; } export interface IntrospectionInterfaceType { - kind: 'INTERFACE'; - name: string; - description?: string; - fields: IntrospectionField[]; - possibleTypes: IntrospectionNamedTypeRef[]; + kind: 'INTERFACE'; + name: string; + description?: string; + fields: IntrospectionField[]; + possibleTypes: IntrospectionNamedTypeRef[]; } export interface IntrospectionUnionType { - kind: 'UNION'; - name: string; - description?: string; - possibleTypes: IntrospectionNamedTypeRef[]; + kind: 'UNION'; + name: string; + description?: string; + possibleTypes: IntrospectionNamedTypeRef[]; } export interface IntrospectionEnumType { - kind: 'ENUM'; - name: string; - description?: string; - enumValues: IntrospectionEnumValue[]; + kind: 'ENUM'; + name: string; + description?: string; + enumValues: IntrospectionEnumValue[]; } export interface IntrospectionInputObjectType { - kind: 'INPUT_OBJECT'; - name: string; - description?: string; - inputFields: IntrospectionInputValue[]; + kind: 'INPUT_OBJECT'; + name: string; + description?: string; + inputFields: IntrospectionInputValue[]; } export type IntrospectionTypeRef = - | IntrospectionNamedTypeRef - | IntrospectionListTypeRef - | IntrospectionNonNullTypeRef; + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef + | IntrospectionNonNullTypeRef; export interface IntrospectionNamedTypeRef { - kind: string; - name: string; + kind: string; + name: string; } export interface IntrospectionListTypeRef { - kind: 'LIST'; - ofType?: IntrospectionTypeRef; + kind: 'LIST'; + ofType?: IntrospectionTypeRef; } export interface IntrospectionNonNullTypeRef { - kind: 'NON_NULL'; - ofType?: IntrospectionTypeRef; + kind: 'NON_NULL'; + ofType?: IntrospectionTypeRef; } export interface IntrospectionField { - name: string; - description?: string; - args: IntrospectionInputValue[]; - type: IntrospectionTypeRef; - isDeprecated: boolean; - deprecationReason?: string; + name: string; + description?: string; + args: IntrospectionInputValue[]; + type: IntrospectionTypeRef; + isDeprecated: boolean; + deprecationReason?: string; } export interface IntrospectionInputValue { - name: string; - description?: string; - type: IntrospectionTypeRef; - defaultValue?: string; + name: string; + description?: string; + type: IntrospectionTypeRef; + defaultValue?: string; } export interface IntrospectionEnumValue { - name: string; - description?: string; - isDeprecated: boolean; - deprecationReason?: string; + name: string; + description?: string; + isDeprecated: boolean; + deprecationReason?: string; } export interface IntrospectionDirective { - name: string; - description?: string; - locations: DirectiveLocationEnum[]; - args: IntrospectionInputValue[]; + name: string; + description?: string; + locations: DirectiveLocationEnum[]; + args: IntrospectionInputValue[]; } diff --git a/types/graphql/utilities/isValidJSValue.d.ts b/types/graphql/utilities/isValidJSValue.d.ts index cd11014579..911d8fea67 100644 --- a/types/graphql/utilities/isValidJSValue.d.ts +++ b/types/graphql/utilities/isValidJSValue.d.ts @@ -5,7 +5,4 @@ import { GraphQLInputType } from '../type/definition'; * accepted for that type. This is primarily useful for validating the * runtime values of query variables. */ -export function isValidJSValue( - value: any, - type: GraphQLInputType -): string[]; +export function isValidJSValue(value: any, type: GraphQLInputType): string[]; diff --git a/types/graphql/utilities/isValidLiteralValue.d.ts b/types/graphql/utilities/isValidLiteralValue.d.ts index 697c8eb97e..4ad03d1013 100644 --- a/types/graphql/utilities/isValidLiteralValue.d.ts +++ b/types/graphql/utilities/isValidLiteralValue.d.ts @@ -9,6 +9,6 @@ import { GraphQLInputType } from '../type/definition'; * provide values of the correct type. */ export function isValidLiteralValue( - type: GraphQLInputType, - valueNode: ValueNode + type: GraphQLInputType, + valueNode: ValueNode, ): string[]; diff --git a/types/graphql/utilities/schemaPrinter.d.ts b/types/graphql/utilities/schemaPrinter.d.ts index 2bd40f1b96..f9cf9ad209 100644 --- a/types/graphql/utilities/schemaPrinter.d.ts +++ b/types/graphql/utilities/schemaPrinter.d.ts @@ -1,8 +1,12 @@ import { GraphQLSchema } from '../type/schema'; import { GraphQLType } from '../type/definition'; -export function printSchema(schema: GraphQLSchema): string; +export interface PrinterOptions { + commentDescriptions?: boolean; +} -export function printIntrospectionSchema(schema: GraphQLSchema): string; +export function printSchema(schema: GraphQLSchema, options?: PrinterOptions): string; -export function printType(type: GraphQLType): string; +export function printIntrospectionSchema(schema: GraphQLSchema, options?: PrinterOptions): string; + +export function printType(type: GraphQLType, options?: PrinterOptions): string; diff --git a/types/graphql/utilities/separateOperations.d.ts b/types/graphql/utilities/separateOperations.d.ts index 4b4106df53..a10ad0a29e 100644 --- a/types/graphql/utilities/separateOperations.d.ts +++ b/types/graphql/utilities/separateOperations.d.ts @@ -1,8 +1,5 @@ -import { - DocumentNode, - OperationDefinitionNode, -} from '../language/ast'; +import { DocumentNode, OperationDefinitionNode } from '../language/ast'; export function separateOperations( - documentAST: DocumentNode + documentAST: DocumentNode, ): { [operationName: string]: DocumentNode }; diff --git a/types/graphql/utilities/typeComparators.d.ts b/types/graphql/utilities/typeComparators.d.ts index 16e6acd680..ca0cdaf6c2 100644 --- a/types/graphql/utilities/typeComparators.d.ts +++ b/types/graphql/utilities/typeComparators.d.ts @@ -1,11 +1,9 @@ import { - GraphQLType, - GraphQLCompositeType, - GraphQLAbstractType + GraphQLType, + GraphQLCompositeType, + GraphQLAbstractType, } from '../type/definition'; -import { - GraphQLSchema -} from '../type/schema'; +import { GraphQLSchema } from '../type/schema'; /** * Provided two types, return true if the types are equal (invariant). @@ -17,9 +15,9 @@ export function isEqualType(typeA: GraphQLType, typeB: GraphQLType): boolean; * equal or a subset of the second super type (covariant). */ export function isTypeSubTypeOf( - schema: GraphQLSchema, - maybeSubType: GraphQLType, - superType: GraphQLType + schema: GraphQLSchema, + maybeSubType: GraphQLType, + superType: GraphQLType, ): boolean; /** @@ -32,7 +30,7 @@ export function isTypeSubTypeOf( * This function is commutative. */ export function doTypesOverlap( - schema: GraphQLSchema, - typeA: GraphQLCompositeType, - typeB: GraphQLCompositeType + schema: GraphQLSchema, + typeA: GraphQLCompositeType, + typeB: GraphQLCompositeType, ): boolean; diff --git a/types/graphql/utilities/typeFromAST.d.ts b/types/graphql/utilities/typeFromAST.d.ts index c3cacf90df..415cbd2636 100644 --- a/types/graphql/utilities/typeFromAST.d.ts +++ b/types/graphql/utilities/typeFromAST.d.ts @@ -3,6 +3,6 @@ import { GraphQLType, GraphQLNullableType } from '../type/definition'; import { GraphQLSchema } from '../type/schema'; export function typeFromAST( - schema: GraphQLSchema, - typeNode: TypeNode + schema: GraphQLSchema, + typeNode: TypeNode, ): GraphQLType; diff --git a/types/graphql/utilities/valueFromAST.d.ts b/types/graphql/utilities/valueFromAST.d.ts index 24dd435448..0bfbf04981 100644 --- a/types/graphql/utilities/valueFromAST.d.ts +++ b/types/graphql/utilities/valueFromAST.d.ts @@ -1,15 +1,15 @@ import { GraphQLInputType } from '../type/definition'; import { - ValueNode, - VariableNode, - ListValueNode, - ObjectValueNode + ValueNode, + VariableNode, + ListValueNode, + ObjectValueNode, } from '../language/ast'; export function valueFromAST( - valueNode: ValueNode, - type: GraphQLInputType, - variables?: { - [key: string]: any - } + valueNode: ValueNode, + type: GraphQLInputType, + variables?: { + [key: string]: any; + }, ): any; diff --git a/types/graphql/validation/index.d.ts b/types/graphql/validation/index.d.ts index 7f897fe78d..b8cb9ddd00 100644 --- a/types/graphql/validation/index.d.ts +++ b/types/graphql/validation/index.d.ts @@ -3,130 +3,126 @@ export { specifiedRules } from './specifiedRules'; // Spec Section: "Argument Values Type Correctness" export { - ArgumentsOfCorrectType as ArgumentsOfCorrectTypeRule + ArgumentsOfCorrectType as ArgumentsOfCorrectTypeRule, } from './rules/ArgumentsOfCorrectType'; // Spec Section: "Variable Default Values Are Correctly Typed" export { - DefaultValuesOfCorrectType as DefaultValuesOfCorrectTypeRule + DefaultValuesOfCorrectType as DefaultValuesOfCorrectTypeRule, } from './rules/DefaultValuesOfCorrectType'; // Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" export { - FieldsOnCorrectType as FieldsOnCorrectTypeRule + FieldsOnCorrectType as FieldsOnCorrectTypeRule, } from './rules/FieldsOnCorrectType'; // Spec Section: "Fragments on Composite Types" export { - FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule + FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule, } from './rules/FragmentsOnCompositeTypes'; // Spec Section: "Argument Names" export { - KnownArgumentNames as KnownArgumentNamesRule + KnownArgumentNames as KnownArgumentNamesRule, } from './rules/KnownArgumentNames'; // Spec Section: "Directives Are Defined" export { - KnownDirectives as KnownDirectivesRule + KnownDirectives as KnownDirectivesRule, } from './rules/KnownDirectives'; // Spec Section: "Fragment spread target defined" export { - KnownFragmentNames as KnownFragmentNamesRule + KnownFragmentNames as KnownFragmentNamesRule, } from './rules/KnownFragmentNames'; // Spec Section: "Fragment Spread Type Existence" -export { - KnownTypeNames as KnownTypeNamesRule -} from './rules/KnownTypeNames'; +export { KnownTypeNames as KnownTypeNamesRule } from './rules/KnownTypeNames'; // Spec Section: "Lone Anonymous Operation" export { - LoneAnonymousOperation as LoneAnonymousOperationRule + LoneAnonymousOperation as LoneAnonymousOperationRule, } from './rules/LoneAnonymousOperation'; // Spec Section: "Fragments must not form cycles" export { - NoFragmentCycles as NoFragmentCyclesRule + NoFragmentCycles as NoFragmentCyclesRule, } from './rules/NoFragmentCycles'; // Spec Section: "All Variable Used Defined" export { - NoUndefinedVariables as NoUndefinedVariablesRule + NoUndefinedVariables as NoUndefinedVariablesRule, } from './rules/NoUndefinedVariables'; // Spec Section: "Fragments must be used" export { - NoUnusedFragments as NoUnusedFragmentsRule + NoUnusedFragments as NoUnusedFragmentsRule, } from './rules/NoUnusedFragments'; // Spec Section: "All Variables Used" export { - NoUnusedVariables as NoUnusedVariablesRule + NoUnusedVariables as NoUnusedVariablesRule, } from './rules/NoUnusedVariables'; // Spec Section: "Field Selection Merging" export { - OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule + OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule, } from './rules/OverlappingFieldsCanBeMerged'; // Spec Section: "Fragment spread is possible" export { - PossibleFragmentSpreads as PossibleFragmentSpreadsRule + PossibleFragmentSpreads as PossibleFragmentSpreadsRule, } from './rules/PossibleFragmentSpreads'; // Spec Section: "Argument Optionality" export { - ProvidedNonNullArguments as ProvidedNonNullArgumentsRule + ProvidedNonNullArguments as ProvidedNonNullArgumentsRule, } from './rules/ProvidedNonNullArguments'; // Spec Section: "Leaf Field Selections" -export { - ScalarLeafs as ScalarLeafsRule -} from './rules/ScalarLeafs'; +export { ScalarLeafs as ScalarLeafsRule } from './rules/ScalarLeafs'; // Spec Section: "Subscriptions with Single Root Field" export { - SingleFieldSubscriptions as SingleFieldSubscriptionsRule + SingleFieldSubscriptions as SingleFieldSubscriptionsRule, } from './rules/SingleFieldSubscriptions'; // Spec Section: "Argument Uniqueness" export { - UniqueArgumentNames as UniqueArgumentNamesRule + UniqueArgumentNames as UniqueArgumentNamesRule, } from './rules/UniqueArgumentNames'; // Spec Section: "Directives Are Unique Per Location" export { - UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule + UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule, } from './rules/UniqueDirectivesPerLocation'; // Spec Section: "Fragment Name Uniqueness" export { - UniqueFragmentNames as UniqueFragmentNamesRule + UniqueFragmentNames as UniqueFragmentNamesRule, } from './rules/UniqueFragmentNames'; // Spec Section: "Input Object Field Uniqueness" export { - UniqueInputFieldNames as UniqueInputFieldNamesRule + UniqueInputFieldNames as UniqueInputFieldNamesRule, } from './rules/UniqueInputFieldNames'; // Spec Section: "Operation Name Uniqueness" export { - UniqueOperationNames as UniqueOperationNamesRule + UniqueOperationNames as UniqueOperationNamesRule, } from './rules/UniqueOperationNames'; // Spec Section: "Variable Uniqueness" export { - UniqueVariableNames as UniqueVariableNamesRule + UniqueVariableNames as UniqueVariableNamesRule, } from './rules/UniqueVariableNames'; // Spec Section: "Variables are Input Types" export { - VariablesAreInputTypes as VariablesAreInputTypesRule + VariablesAreInputTypes as VariablesAreInputTypesRule, } from './rules/VariablesAreInputTypes'; // Spec Section: "All Variable Usages Are Allowed" export { - VariablesInAllowedPosition as VariablesInAllowedPositionRule + VariablesInAllowedPosition as VariablesInAllowedPositionRule, } from './rules/VariablesInAllowedPosition'; diff --git a/types/graphql/validation/validate.d.ts b/types/graphql/validation/validate.d.ts index a4b628777e..9e2fd479f1 100644 --- a/types/graphql/validation/validate.d.ts +++ b/types/graphql/validation/validate.d.ts @@ -1,19 +1,19 @@ import { GraphQLError } from '../error'; import { - DocumentNode, - OperationDefinitionNode, - VariableNode, - SelectionSetNode, - FragmentSpreadNode, - FragmentDefinitionNode, + DocumentNode, + OperationDefinitionNode, + VariableNode, + SelectionSetNode, + FragmentSpreadNode, + FragmentDefinitionNode, } from '../language/ast'; import { GraphQLSchema } from '../type/schema'; import { - GraphQLInputType, - GraphQLOutputType, - GraphQLCompositeType, - GraphQLField, - GraphQLArgument + GraphQLInputType, + GraphQLOutputType, + GraphQLCompositeType, + GraphQLField, + GraphQLArgument, } from '../type/definition'; import { GraphQLDirective } from '../type/directives'; import { TypeInfo } from '../utilities/TypeInfo'; @@ -33,9 +33,9 @@ import { specifiedRules } from './specifiedRules'; * GraphQLErrors, or Arrays of GraphQLErrors when invalid. */ export function validate( - schema: GraphQLSchema, - ast: DocumentNode, - rules?: any[] + schema: GraphQLSchema, + ast: DocumentNode, + rules?: any[], ): GraphQLError[]; /** @@ -45,16 +45,18 @@ export function validate( * @internal */ export function visitUsingRules( - schema: GraphQLSchema, - typeInfo: TypeInfo, - documentAST: DocumentNode, - rules: any[] + schema: GraphQLSchema, + typeInfo: TypeInfo, + documentAST: DocumentNode, + rules: any[], ): GraphQLError[]; -export type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode; +export type NodeWithSelectionSet = + | OperationDefinitionNode + | FragmentDefinitionNode; export interface VariableUsage { - node: VariableNode; - type: GraphQLInputType; + node: VariableNode; + type: GraphQLInputType; } /** @@ -63,38 +65,38 @@ export interface VariableUsage { * validation rule. */ export class ValidationContext { - constructor(schema: GraphQLSchema, ast: DocumentNode, typeInfo: TypeInfo); - reportError(error: GraphQLError): void; + constructor(schema: GraphQLSchema, ast: DocumentNode, typeInfo: TypeInfo); + reportError(error: GraphQLError): void; - getErrors(): GraphQLError[]; + getErrors(): GraphQLError[]; - getSchema(): GraphQLSchema; + getSchema(): GraphQLSchema; - getDocument(): DocumentNode; + getDocument(): DocumentNode; - getFragment(name: string): FragmentDefinitionNode; + getFragment(name: string): FragmentDefinitionNode; - getFragmentSpreads(node: SelectionSetNode): FragmentSpreadNode[]; + getFragmentSpreads(node: SelectionSetNode): FragmentSpreadNode[]; - getRecursivelyReferencedFragments( - operation: OperationDefinitionNode - ): FragmentDefinitionNode[]; + getRecursivelyReferencedFragments( + operation: OperationDefinitionNode, + ): FragmentDefinitionNode[]; - getVariableUsages(node: NodeWithSelectionSet): VariableUsage[]; + getVariableUsages(node: NodeWithSelectionSet): VariableUsage[]; - getRecursiveVariableUsages( - operation: OperationDefinitionNode - ): VariableUsage[]; + getRecursiveVariableUsages( + operation: OperationDefinitionNode, + ): VariableUsage[]; - getType(): GraphQLOutputType; + getType(): GraphQLOutputType; - getParentType(): GraphQLCompositeType; + getParentType(): GraphQLCompositeType; - getInputType(): GraphQLInputType; + getInputType(): GraphQLInputType; - getFieldDef(): GraphQLField; + getFieldDef(): GraphQLField; - getDirective(): GraphQLDirective; + getDirective(): GraphQLDirective; - getArgument(): GraphQLArgument; + getArgument(): GraphQLArgument; } diff --git a/types/graphviz/tsconfig.json b/types/graphviz/tsconfig.json index ec9897523b..74188c2437 100644 --- a/types/graphviz/tsconfig.json +++ b/types/graphviz/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/grasp/grasp-tests.ts b/types/grasp/grasp-tests.ts index 647f57d8fd..87da0b8d45 100644 --- a/types/grasp/grasp-tests.ts +++ b/types/grasp/grasp-tests.ts @@ -1,5 +1,5 @@ import fs = require("fs"); -import * as grasp from "grasp"; +import grasp = require("grasp"); grasp(); // $ExpectError grasp({ args: [] }); // $ExpectType void diff --git a/types/grasp/tsconfig.json b/types/grasp/tsconfig.json index e0996e4408..2a87034f8c 100644 --- a/types/grasp/tsconfig.json +++ b/types/grasp/tsconfig.json @@ -1,16 +1,24 @@ { "compilerOptions": { "module": "commonjs", - "lib": ["es6"], + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, - "files": ["index.d.ts", "grasp-tests.ts"] -} + "files": [ + "index.d.ts", + "grasp-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gravatar-url/tsconfig.json b/types/gravatar-url/tsconfig.json index 8e61e09590..7dc0c7a0d6 100644 --- a/types/gravatar-url/tsconfig.json +++ b/types/gravatar-url/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gravatar/tsconfig.json b/types/gravatar/tsconfig.json index d90f933a40..eade609d2e 100644 --- a/types/gravatar/tsconfig.json +++ b/types/gravatar/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/greasemonkey/tsconfig.json b/types/greasemonkey/tsconfig.json index f051af1bc4..84c32d764f 100644 --- a/types/greasemonkey/tsconfig.json +++ b/types/greasemonkey/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/grecaptcha/tsconfig.json b/types/grecaptcha/tsconfig.json index 0265247984..485acc7e0f 100644 --- a/types/grecaptcha/tsconfig.json +++ b/types/grecaptcha/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/grecaptcha/v0/tsconfig.json b/types/grecaptcha/v0/tsconfig.json index b75ce228e8..af6bc27262 100644 --- a/types/grecaptcha/v0/tsconfig.json +++ b/types/grecaptcha/v0/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gregorian-calendar/tsconfig.json b/types/gregorian-calendar/tsconfig.json index 2cad93c35f..a80ec039b1 100644 --- a/types/gregorian-calendar/tsconfig.json +++ b/types/gregorian-calendar/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gridfs-stream/tsconfig.json b/types/gridfs-stream/tsconfig.json index c6d9bffb02..e3b113310a 100644 --- a/types/gridfs-stream/tsconfig.json +++ b/types/gridfs-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gridstack/tsconfig.json b/types/gridstack/tsconfig.json index 1e4548ab3a..9350c8721c 100644 --- a/types/gridstack/tsconfig.json +++ b/types/gridstack/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/grunt/tsconfig.json b/types/grunt/tsconfig.json index af329ced3c..53469dd2a1 100644 --- a/types/grunt/tsconfig.json +++ b/types/grunt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gsap/TweenConfig.d.ts b/types/gsap/TweenConfig.d.ts index 59c472bea2..33cde9c6ae 100644 --- a/types/gsap/TweenConfig.d.ts +++ b/types/gsap/TweenConfig.d.ts @@ -1,6 +1,9 @@ declare namespace gsap { export interface TweenConfig { + /** Any tweenable property */ + [p: string]: any; + /** Amount of delay in seconds (or frames for frames-based tweens) before the animation should begin.*/ delay?: number; diff --git a/types/gsap/gsap-tests.ts b/types/gsap/gsap-tests.ts index 048a9d522e..36192141be 100644 --- a/types/gsap/gsap-tests.ts +++ b/types/gsap/gsap-tests.ts @@ -1,8 +1,19 @@ -import { TweenLite } from 'gsap'; +import { TweenLite, TweenMax } from 'gsap'; -const tween = TweenLite +const tweenLiteExample = TweenLite .to(document.getElementById('some-div'), 1, { width: '200px', - height: '200px' + height: '200px', + x: '100px', + y: '200px' }) .seek(0.5); + +const tweenMaxExample = TweenMax + .to(document.getElementById('some-div'), 1, { + width: '200px', + height: '200px', + x: '100px', + y: '200px' + }) + .seek(0.5); diff --git a/types/gsap/index.d.ts b/types/gsap/index.d.ts index cebefcf1c9..77d589603a 100644 --- a/types/gsap/index.d.ts +++ b/types/gsap/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for GSAP 1.19 // Project: http://greensock.com/ -// Definitions by: VILIC VANE , Robert S , Richard Fox +// Definitions by: VILIC VANE , Robert S , Richard Fox , Philip Bulley // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// diff --git a/types/gsap/tsconfig.json b/types/gsap/tsconfig.json index 85301a0877..ee453d0872 100644 --- a/types/gsap/tsconfig.json +++ b/types/gsap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/guid/tsconfig.json b/types/guid/tsconfig.json index 17563577fd..20c94adc76 100644 --- a/types/guid/tsconfig.json +++ b/types/guid/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "guid-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/gulp-angular-templatecache/gulp-angular-templatecache-tests.ts b/types/gulp-angular-templatecache/gulp-angular-templatecache-tests.ts index 559dd4f609..706b3acaff 100644 --- a/types/gulp-angular-templatecache/gulp-angular-templatecache-tests.ts +++ b/types/gulp-angular-templatecache/gulp-angular-templatecache-tests.ts @@ -1,5 +1,5 @@ import * as gulp from 'gulp'; -import * as templateCache from 'gulp-angular-templatecache'; +import templateCache = require('gulp-angular-templatecache'); gulp.task('templatecache:no-arguments', function () { return gulp.src('templates/**/*.html') diff --git a/types/gulp-angular-templatecache/tsconfig.json b/types/gulp-angular-templatecache/tsconfig.json index 3971eae080..f5590d4937 100644 --- a/types/gulp-angular-templatecache/tsconfig.json +++ b/types/gulp-angular-templatecache/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-autoprefixer/gulp-autoprefixer-tests.ts b/types/gulp-autoprefixer/gulp-autoprefixer-tests.ts index 386e1a882a..c2d87223b8 100644 --- a/types/gulp-autoprefixer/gulp-autoprefixer-tests.ts +++ b/types/gulp-autoprefixer/gulp-autoprefixer-tests.ts @@ -1,5 +1,5 @@ import * as gulp from "gulp"; -import * as autoprefixer from "gulp-autoprefixer"; +import autoprefixer = require("gulp-autoprefixer"); gulp.src("test.css") .pipe(autoprefixer()) diff --git a/types/gulp-autoprefixer/tsconfig.json b/types/gulp-autoprefixer/tsconfig.json index 52fd74103c..de7d30ff47 100644 --- a/types/gulp-autoprefixer/tsconfig.json +++ b/types/gulp-autoprefixer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-babel/tsconfig.json b/types/gulp-babel/tsconfig.json index e177253e87..8a7d7b25a8 100644 --- a/types/gulp-babel/tsconfig.json +++ b/types/gulp-babel/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-batch/gulp-batch-tests.ts b/types/gulp-batch/gulp-batch-tests.ts index c5936eb031..da0c67e84c 100644 --- a/types/gulp-batch/gulp-batch-tests.ts +++ b/types/gulp-batch/gulp-batch-tests.ts @@ -1,5 +1,5 @@ import * as gulp from "gulp"; -import * as batch from "gulp-batch"; +import batch = require("gulp-batch"); gulp.task('default', () => { gulp.watch([ 'lib/**', 'test/**' ], batch((events: any, cb: any) => { diff --git a/types/gulp-batch/tsconfig.json b/types/gulp-batch/tsconfig.json index 8b5bce2f98..00e877c977 100644 --- a/types/gulp-batch/tsconfig.json +++ b/types/gulp-batch/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/gulp-bump/gulp-bump-tests.ts b/types/gulp-bump/gulp-bump-tests.ts index b15e800a5e..caf5aecf6b 100644 --- a/types/gulp-bump/gulp-bump-tests.ts +++ b/types/gulp-bump/gulp-bump-tests.ts @@ -1,5 +1,5 @@ import * as gulp from 'gulp'; -import * as GulpBump from 'gulp-bump'; +import GulpBump = require('gulp-bump'); gulp .src('package.json') diff --git a/types/gulp-bump/tsconfig.json b/types/gulp-bump/tsconfig.json index 003c952709..cb385de9a7 100644 --- a/types/gulp-bump/tsconfig.json +++ b/types/gulp-bump/tsconfig.json @@ -15,10 +15,11 @@ "strictNullChecks": true, "strictFunctionTypes": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "noEmit": true }, "files": [ "index.d.ts", "gulp-bump-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/gulp-cache/gulp-cache-tests.ts b/types/gulp-cache/gulp-cache-tests.ts index 31df7b0259..cc02e95119 100644 --- a/types/gulp-cache/gulp-cache-tests.ts +++ b/types/gulp-cache/gulp-cache-tests.ts @@ -1,6 +1,6 @@ import * as fs from "fs"; import * as gulp from "gulp"; -import * as cache from "gulp-cache"; +import cache = require("gulp-cache"); import File = require("vinyl"); // Some gulp plugin diff --git a/types/gulp-cache/tsconfig.json b/types/gulp-cache/tsconfig.json index e947f63db5..cee084a998 100644 --- a/types/gulp-cache/tsconfig.json +++ b/types/gulp-cache/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-cached/tsconfig.json b/types/gulp-cached/tsconfig.json index cdec085a2b..f7b99d2469 100644 --- a/types/gulp-cached/tsconfig.json +++ b/types/gulp-cached/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-changed/tsconfig.json b/types/gulp-changed/tsconfig.json index d04c43b32e..80c8583bbf 100644 --- a/types/gulp-changed/tsconfig.json +++ b/types/gulp-changed/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-cheerio/tsconfig.json b/types/gulp-cheerio/tsconfig.json index be78d9969c..9d1f810c6c 100644 --- a/types/gulp-cheerio/tsconfig.json +++ b/types/gulp-cheerio/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-clean-dest/tsconfig.json b/types/gulp-clean-dest/tsconfig.json index 777c860568..518b39f91d 100644 --- a/types/gulp-clean-dest/tsconfig.json +++ b/types/gulp-clean-dest/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "gulp-clean-dest-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/gulp-coffeeify/tsconfig.json b/types/gulp-coffeeify/tsconfig.json index 241ff2e5f8..1b5f540107 100644 --- a/types/gulp-coffeeify/tsconfig.json +++ b/types/gulp-coffeeify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-coffeelint/gulp-coffeelint-tests.ts b/types/gulp-coffeelint/gulp-coffeelint-tests.ts index 5d18b98862..0acc0fb9e4 100644 --- a/types/gulp-coffeelint/gulp-coffeelint-tests.ts +++ b/types/gulp-coffeelint/gulp-coffeelint-tests.ts @@ -1,10 +1,6 @@ - - - import coffeelint = require('gulp-coffeelint'); import gulp = require('gulp'); - gulp.task('lint', function () { gulp.src('./src/*.coffee') .pipe(coffeelint()) @@ -52,6 +48,3 @@ gulp.task('lint', function() { .pipe(coffeelint()) .pipe(coffeelint.reporter(myReporter)); }); - - - diff --git a/types/gulp-coffeelint/tsconfig.json b/types/gulp-coffeelint/tsconfig.json index 94e2edb626..695aa2525d 100644 --- a/types/gulp-coffeelint/tsconfig.json +++ b/types/gulp-coffeelint/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-concat/gulp-concat-tests.ts b/types/gulp-concat/gulp-concat-tests.ts index 172aa61451..d1d0ebd1ad 100644 --- a/types/gulp-concat/gulp-concat-tests.ts +++ b/types/gulp-concat/gulp-concat-tests.ts @@ -1,8 +1,5 @@ - - - import gulp = require("gulp"); -import * as concat from "gulp-concat"; +import concat = require("gulp-concat"); gulp.task("concat:simple", () => { gulp.src(["file*.txt"]) diff --git a/types/gulp-concat/tsconfig.json b/types/gulp-concat/tsconfig.json index b28024194c..62d0e3f55f 100644 --- a/types/gulp-concat/tsconfig.json +++ b/types/gulp-concat/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-connect/gulp-connect-tests.ts b/types/gulp-connect/gulp-connect-tests.ts index feafa1007b..ea29d2337d 100644 --- a/types/gulp-connect/gulp-connect-tests.ts +++ b/types/gulp-connect/gulp-connect-tests.ts @@ -89,7 +89,7 @@ gulp.task('connect', () => { // The following tests are custom tests to validate the more complicated APIs // Validate gulp-connect typings allow express apps to be passed in as middleware -import * as express from "express"; +import express = require("express"); gulp.task('connect', () => { const middleware = [ @@ -100,7 +100,8 @@ gulp.task('connect', () => { root: [__dirname], port: 8081, livereload: true, - middleware: (connect, opt) => middleware + middleware: (connect, opt) => middleware, + silent: true }); }); diff --git a/types/gulp-connect/index.d.ts b/types/gulp-connect/index.d.ts index e099f62a39..b8b1a467f9 100644 --- a/types/gulp-connect/index.d.ts +++ b/types/gulp-connect/index.d.ts @@ -39,7 +39,7 @@ export interface ConnectAppOptions { host?: string; /** Don't log any messages. Defaults to false. */ - slient?: boolean; + silent?: boolean; /** * Options to pass to http.createServer (or false to disable https). diff --git a/types/gulp-connect/tsconfig.json b/types/gulp-connect/tsconfig.json index fca451bd85..2ec8e07735 100644 --- a/types/gulp-connect/tsconfig.json +++ b/types/gulp-connect/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-copy/gulp-copy-tests.ts b/types/gulp-copy/gulp-copy-tests.ts index f4bc3ac023..0b5d71f646 100644 --- a/types/gulp-copy/gulp-copy-tests.ts +++ b/types/gulp-copy/gulp-copy-tests.ts @@ -1,5 +1,5 @@ import * as gulp from "gulp"; -import * as gulpCopy from "gulp-copy"; +import gulpCopy = require("gulp-copy"); gulp.task("copy-files", () => { gulp.src("*.nonexistent") diff --git a/types/gulp-copy/tsconfig.json b/types/gulp-copy/tsconfig.json index 0c92078d28..69b46a3185 100644 --- a/types/gulp-copy/tsconfig.json +++ b/types/gulp-copy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-csso/gulp-csso-tests.ts b/types/gulp-csso/gulp-csso-tests.ts index 8595a92ce8..30f693d24d 100644 --- a/types/gulp-csso/gulp-csso-tests.ts +++ b/types/gulp-csso/gulp-csso-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from 'gulp'; -import * as csso from 'gulp-csso'; +import csso = require('gulp-csso'); gulp.task('default', () => gulp.src('./main.css') diff --git a/types/gulp-csso/tsconfig.json b/types/gulp-csso/tsconfig.json index d0e22a2035..0f0b1e02fc 100644 --- a/types/gulp-csso/tsconfig.json +++ b/types/gulp-csso/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-debug/gulp-debug-tests.ts b/types/gulp-debug/gulp-debug-tests.ts index d5c8a6d52b..f9ffce748d 100644 --- a/types/gulp-debug/gulp-debug-tests.ts +++ b/types/gulp-debug/gulp-debug-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from 'gulp'; -import * as debug from 'gulp-debug'; +import debug = require('gulp-debug'); gulp.task('default', () => gulp.src('foo.js') @@ -10,5 +7,4 @@ gulp.task('default', () => .pipe(gulp.dest('dist')) ); - debug(); diff --git a/types/gulp-debug/tsconfig.json b/types/gulp-debug/tsconfig.json index 3dbd5e8109..1a862e6e1e 100644 --- a/types/gulp-debug/tsconfig.json +++ b/types/gulp-debug/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-diff/gulp-diff-tests.ts b/types/gulp-diff/gulp-diff-tests.ts index 23748d11e8..7c17e5235a 100644 --- a/types/gulp-diff/gulp-diff-tests.ts +++ b/types/gulp-diff/gulp-diff-tests.ts @@ -1,5 +1,5 @@ import * as gulp from 'gulp'; -import * as diff from 'gulp-diff'; +import diff = require('gulp-diff'); gulp.task('task', () => { return gulp.src('src') diff --git a/types/gulp-diff/tsconfig.json b/types/gulp-diff/tsconfig.json index 9e4474532a..82c8e71fb3 100644 --- a/types/gulp-diff/tsconfig.json +++ b/types/gulp-diff/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-dtsm/gulp-dtsm-tests.ts b/types/gulp-dtsm/gulp-dtsm-tests.ts index dafc6b3468..1262a57210 100644 --- a/types/gulp-dtsm/gulp-dtsm-tests.ts +++ b/types/gulp-dtsm/gulp-dtsm-tests.ts @@ -1,4 +1,4 @@ -import * as dtsm from 'gulp-dtsm'; +import dtsm = require('gulp-dtsm'); import * as gulp from 'gulp'; var stream: NodeJS.WritableStream = dtsm(); diff --git a/types/gulp-dtsm/tsconfig.json b/types/gulp-dtsm/tsconfig.json index dd1ca59de4..4e8ddf667c 100644 --- a/types/gulp-dtsm/tsconfig.json +++ b/types/gulp-dtsm/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-espower/gulp-espower-tests.ts b/types/gulp-espower/gulp-espower-tests.ts index 9c04e1d3a0..e06cdda2e8 100644 --- a/types/gulp-espower/gulp-espower-tests.ts +++ b/types/gulp-espower/gulp-espower-tests.ts @@ -1,7 +1,3 @@ - - - - import espower = require('gulp-espower'); import * as gulp from 'gulp'; @@ -9,7 +5,6 @@ gulp.src('src/*.coffee') .pipe(espower()) .pipe(gulp.dest('out')); - gulp.src('src/*.coffee') .pipe(espower({ patterns: ['assert(value, [message])'] })) .pipe(gulp.dest('out')); diff --git a/types/gulp-espower/tsconfig.json b/types/gulp-espower/tsconfig.json index cf469c3b13..720f5897c2 100644 --- a/types/gulp-espower/tsconfig.json +++ b/types/gulp-espower/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-file-include/tsconfig.json b/types/gulp-file-include/tsconfig.json index ab226efcb3..4f8200bc86 100644 --- a/types/gulp-file-include/tsconfig.json +++ b/types/gulp-file-include/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-filter/gulp-filter-tests.ts b/types/gulp-filter/gulp-filter-tests.ts index 903f4083f7..730e6f0ae4 100644 --- a/types/gulp-filter/gulp-filter-tests.ts +++ b/types/gulp-filter/gulp-filter-tests.ts @@ -1,8 +1,8 @@ import * as gulp from 'gulp'; -import * as uglify from 'gulp-uglify'; -import * as less from 'gulp-less'; -import * as concat from 'gulp-concat'; -import * as filter from 'gulp-filter'; +import uglify = require('gulp-uglify'); +import less = require('gulp-less'); +import concat = require('gulp-concat'); +import filter = require('gulp-filter'); // Filter only gulp.task('default', () => { diff --git a/types/gulp-filter/tsconfig.json b/types/gulp-filter/tsconfig.json index f4f7d56d52..6120629011 100644 --- a/types/gulp-filter/tsconfig.json +++ b/types/gulp-filter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-flatten/gulp-flatten-tests.ts b/types/gulp-flatten/gulp-flatten-tests.ts index 8c89236d61..431b7819a9 100644 --- a/types/gulp-flatten/gulp-flatten-tests.ts +++ b/types/gulp-flatten/gulp-flatten-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from "gulp"; -import * as flatten from "gulp-flatten"; +import flatten = require("gulp-flatten"); gulp.task("flatten:simple", () => { gulp.src(["files/**/*.txt"]) diff --git a/types/gulp-flatten/tsconfig.json b/types/gulp-flatten/tsconfig.json index ab4f9a894a..2adbc5747c 100644 --- a/types/gulp-flatten/tsconfig.json +++ b/types/gulp-flatten/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-gh-pages/gulp-gh-pages-tests.ts b/types/gulp-gh-pages/gulp-gh-pages-tests.ts index df527b0023..e541f18508 100644 --- a/types/gulp-gh-pages/gulp-gh-pages-tests.ts +++ b/types/gulp-gh-pages/gulp-gh-pages-tests.ts @@ -1,5 +1,5 @@ import * as gulp from "gulp"; -import * as ghPages from "gulp-gh-pages"; +import ghPages = require("gulp-gh-pages"); gulp.src("test.css") .pipe(ghPages()); diff --git a/types/gulp-gh-pages/tsconfig.json b/types/gulp-gh-pages/tsconfig.json index 1ea7bf2217..3a8f402c8d 100644 --- a/types/gulp-gh-pages/tsconfig.json +++ b/types/gulp-gh-pages/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-gzip/gulp-gzip-tests.ts b/types/gulp-gzip/gulp-gzip-tests.ts index 0a4d125d43..20648e38e1 100644 --- a/types/gulp-gzip/gulp-gzip-tests.ts +++ b/types/gulp-gzip/gulp-gzip-tests.ts @@ -1,6 +1,3 @@ - - - import gulp = require('gulp'); import gzip = require('gulp-gzip'); diff --git a/types/gulp-gzip/tsconfig.json b/types/gulp-gzip/tsconfig.json index 4f3f5f8d77..0bdb09cd02 100644 --- a/types/gulp-gzip/tsconfig.json +++ b/types/gulp-gzip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-help-doc/tsconfig.json b/types/gulp-help-doc/tsconfig.json index b6f16b60a9..997b774603 100644 --- a/types/gulp-help-doc/tsconfig.json +++ b/types/gulp-help-doc/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-help/tsconfig.json b/types/gulp-help/tsconfig.json index a174bbab6e..a525512784 100644 --- a/types/gulp-help/tsconfig.json +++ b/types/gulp-help/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-html-replace/gulp-html-replace-tests.ts b/types/gulp-html-replace/gulp-html-replace-tests.ts index 9a21a53b84..ca1e66c680 100644 --- a/types/gulp-html-replace/gulp-html-replace-tests.ts +++ b/types/gulp-html-replace/gulp-html-replace-tests.ts @@ -1,5 +1,5 @@ import * as gulp from 'gulp'; -import * as htmlreplace from 'gulp-html-replace'; +import htmlreplace = require('gulp-html-replace'); // Examples taken from README.md of the gulp-html-replace project: // https://www.npmjs.com/package/gulp-html-replace diff --git a/types/gulp-html-replace/tsconfig.json b/types/gulp-html-replace/tsconfig.json index fcf17ed178..f21adbe57d 100644 --- a/types/gulp-html-replace/tsconfig.json +++ b/types/gulp-html-replace/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-htmlmin/gulp-htmlmin-tests.ts b/types/gulp-htmlmin/gulp-htmlmin-tests.ts index 29c3bcd4fe..e0ca8be7cd 100644 --- a/types/gulp-htmlmin/gulp-htmlmin-tests.ts +++ b/types/gulp-htmlmin/gulp-htmlmin-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from 'gulp'; -import * as htmlmin from 'gulp-htmlmin'; +import htmlmin = require('gulp-htmlmin'); gulp.task('minify', function() { return gulp.src('src/*.html') diff --git a/types/gulp-htmlmin/tsconfig.json b/types/gulp-htmlmin/tsconfig.json index 022acde96e..e426cd715f 100644 --- a/types/gulp-htmlmin/tsconfig.json +++ b/types/gulp-htmlmin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-if/tsconfig.json b/types/gulp-if/tsconfig.json index bb2544820b..777df7124c 100644 --- a/types/gulp-if/tsconfig.json +++ b/types/gulp-if/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-inject/gulp-inject-tests.ts b/types/gulp-inject/gulp-inject-tests.ts index ef29ebc343..d57756ccfa 100644 --- a/types/gulp-inject/gulp-inject-tests.ts +++ b/types/gulp-inject/gulp-inject-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from "gulp"; -import * as inject from "gulp-inject"; +import inject = require("gulp-inject"); gulp.task("inject:simple", () => { gulp.src("src/index.html") diff --git a/types/gulp-inject/tsconfig.json b/types/gulp-inject/tsconfig.json index aacadf6415..2af1ab9827 100644 --- a/types/gulp-inject/tsconfig.json +++ b/types/gulp-inject/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-insert/tsconfig.json b/types/gulp-insert/tsconfig.json index 6feda660ed..89c69015ed 100644 --- a/types/gulp-insert/tsconfig.json +++ b/types/gulp-insert/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-install/gulp-install-tests.ts b/types/gulp-install/gulp-install-tests.ts index b822b42706..85b1f6ee1b 100644 --- a/types/gulp-install/gulp-install-tests.ts +++ b/types/gulp-install/gulp-install-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from 'gulp'; -import * as install from 'gulp-install'; +import install = require('gulp-install'); // Examples taken from https://www.npmjs.com/package/gulp-install diff --git a/types/gulp-install/tsconfig.json b/types/gulp-install/tsconfig.json index e1b6063ac9..5576cb02ae 100644 --- a/types/gulp-install/tsconfig.json +++ b/types/gulp-install/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-istanbul/tsconfig.json b/types/gulp-istanbul/tsconfig.json index 133f0cd935..a73367da09 100644 --- a/types/gulp-istanbul/tsconfig.json +++ b/types/gulp-istanbul/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-jade/gulp-jade-tests.ts b/types/gulp-jade/gulp-jade-tests.ts index f184184573..e43917f597 100644 --- a/types/gulp-jade/gulp-jade-tests.ts +++ b/types/gulp-jade/gulp-jade-tests.ts @@ -1,5 +1,5 @@ import * as gulp from 'gulp'; -import * as jade from 'gulp-jade'; +import jade = require('gulp-jade'); gulp.task('jade', () => { gulp.src('src/**/*.jade') diff --git a/types/gulp-jade/tsconfig.json b/types/gulp-jade/tsconfig.json index 7e924cb11b..aa9260a7c4 100644 --- a/types/gulp-jade/tsconfig.json +++ b/types/gulp-jade/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-jasmine-browser/gulp-jasmine-browser-tests.ts b/types/gulp-jasmine-browser/gulp-jasmine-browser-tests.ts index db219148d3..ba2584a2a0 100644 --- a/types/gulp-jasmine-browser/gulp-jasmine-browser-tests.ts +++ b/types/gulp-jasmine-browser/gulp-jasmine-browser-tests.ts @@ -1,6 +1,3 @@ - - - import gulp = require('gulp'); import jasmineBrowser = require('gulp-jasmine-browser'); @@ -10,21 +7,18 @@ gulp.task('jasmine', () => .pipe(jasmineBrowser.server({port: 8888})) ); - gulp.task('jasmine-phantom', () => gulp.src(['src/**/*.js', 'spec/**/*_spec.js']) .pipe(jasmineBrowser.specRunner({console: true})) .pipe(jasmineBrowser.headless()) ); - gulp.task('jasmine-slimerjs', () => gulp.src(['src/**/*.js', 'spec/**/*_spec.js']) .pipe(jasmineBrowser.specRunner({console: true})) .pipe(jasmineBrowser.headless({driver: 'slimerjs'})) ); - gulp.task('jasmine', () => gulp.src('spec/**/*_spec.js') .pipe(jasmineBrowser.specRunner()) diff --git a/types/gulp-jasmine-browser/tsconfig.json b/types/gulp-jasmine-browser/tsconfig.json index 55990f3261..3e09f9571f 100644 --- a/types/gulp-jasmine-browser/tsconfig.json +++ b/types/gulp-jasmine-browser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-jasmine/tsconfig.json b/types/gulp-jasmine/tsconfig.json index d44751f20b..4fc991e2ef 100644 --- a/types/gulp-jasmine/tsconfig.json +++ b/types/gulp-jasmine/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "gulp-jasmine-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/gulp-json-editor/gulp-json-editor-tests.ts b/types/gulp-json-editor/gulp-json-editor-tests.ts index 67176063de..c4fc082360 100644 --- a/types/gulp-json-editor/gulp-json-editor-tests.ts +++ b/types/gulp-json-editor/gulp-json-editor-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from 'gulp'; -import * as jeditor from 'gulp-json-editor'; +import jeditor = require('gulp-json-editor'); // Samples taken from https://www.npmjs.com/package/gulp-json-editor diff --git a/types/gulp-json-editor/tsconfig.json b/types/gulp-json-editor/tsconfig.json index 4f224b2a01..612fbf802c 100644 --- a/types/gulp-json-editor/tsconfig.json +++ b/types/gulp-json-editor/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-jsonminify/gulp-jsonminify-tests.ts b/types/gulp-jsonminify/gulp-jsonminify-tests.ts index 23008bad7e..c158f83627 100644 --- a/types/gulp-jsonminify/gulp-jsonminify-tests.ts +++ b/types/gulp-jsonminify/gulp-jsonminify-tests.ts @@ -1,5 +1,5 @@ import * as gulp from 'gulp'; -import * as jsonminify from 'gulp-jsonminify'; +import jsonminify = require('gulp-jsonminify'); gulp.task('minify', () => { return gulp.src('src/*.json') diff --git a/types/gulp-jsonminify/tsconfig.json b/types/gulp-jsonminify/tsconfig.json index 0b6036c600..956c8eab43 100644 --- a/types/gulp-jsonminify/tsconfig.json +++ b/types/gulp-jsonminify/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "gulp-jsonminify-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/gulp-jspm/gulp-jspm-tests.ts b/types/gulp-jspm/gulp-jspm-tests.ts index 5f3e0812f1..f2c5c4d4e9 100644 --- a/types/gulp-jspm/gulp-jspm-tests.ts +++ b/types/gulp-jspm/gulp-jspm-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from 'gulp'; -import * as gulpJspm from 'gulp-jspm'; +import gulpJspm = require('gulp-jspm'); // Examples taken from https://www.npmjs.com/package/gulp-jspm gulp.task('default', function(){ @@ -26,7 +23,7 @@ gulp.src('src/main.jsx') gulp.src('src/main.jsx') .pipe(gulpJspm({plugin: 'jsx'})) // `jspm bundle main.jsx!jsx` .pipe(gulp.dest('build/')); - + // all other options given to gulp-jspm are passed on to jspm, e.g. gulp.src('src/main.js') .pipe(gulpJspm({inject: true})) // `jspm bundle main --inject` diff --git a/types/gulp-jspm/tsconfig.json b/types/gulp-jspm/tsconfig.json index b612a0a146..c5e89286e7 100644 --- a/types/gulp-jspm/tsconfig.json +++ b/types/gulp-jspm/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-less/gulp-less-tests.ts b/types/gulp-less/gulp-less-tests.ts index bd5335d80e..a5ac36c508 100644 --- a/types/gulp-less/gulp-less-tests.ts +++ b/types/gulp-less/gulp-less-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from "gulp"; -import * as less from "gulp-less"; +import less = require("gulp-less"); // Without options gulp.task("less", () => { diff --git a/types/gulp-less/tsconfig.json b/types/gulp-less/tsconfig.json index e4c00666f5..24266e4482 100644 --- a/types/gulp-less/tsconfig.json +++ b/types/gulp-less/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-load-plugins/gulp-load-plugins-tests.ts b/types/gulp-load-plugins/gulp-load-plugins-tests.ts index a0cff649ec..4f118a0688 100644 --- a/types/gulp-load-plugins/gulp-load-plugins-tests.ts +++ b/types/gulp-load-plugins/gulp-load-plugins-tests.ts @@ -1,6 +1,6 @@ import * as gulp from 'gulp'; -import * as gulpConcat from 'gulp-concat'; -import * as gulpLoadPlugins from 'gulp-load-plugins'; +import gulpConcat = require('gulp-concat'); +import gulpLoadPlugins = require('gulp-load-plugins'); interface GulpPlugins extends IGulpPlugins { concat: typeof gulpConcat; diff --git a/types/gulp-load-plugins/tsconfig.json b/types/gulp-load-plugins/tsconfig.json index 880ad1acd1..44c98dfb1d 100644 --- a/types/gulp-load-plugins/tsconfig.json +++ b/types/gulp-load-plugins/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-minify-css/gulp-minify-css-tests.ts b/types/gulp-minify-css/gulp-minify-css-tests.ts index 597111d30c..9de00a3ae8 100644 --- a/types/gulp-minify-css/gulp-minify-css-tests.ts +++ b/types/gulp-minify-css/gulp-minify-css-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from "gulp"; -import * as minifyCSS from "gulp-minify-css"; +import minifyCSS = require("gulp-minify-css"); gulp.task("minify-css", () => { gulp.src("css/**/*.css") diff --git a/types/gulp-minify-css/tsconfig.json b/types/gulp-minify-css/tsconfig.json index ccb2e4b319..08ddc4b6de 100644 --- a/types/gulp-minify-css/tsconfig.json +++ b/types/gulp-minify-css/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-minify-html/gulp-minify-html-tests.ts b/types/gulp-minify-html/gulp-minify-html-tests.ts index fd27474de2..5071348899 100644 --- a/types/gulp-minify-html/gulp-minify-html-tests.ts +++ b/types/gulp-minify-html/gulp-minify-html-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from 'gulp'; -import * as minifyHtml from 'gulp-minify-html'; +import minifyHtml = require('gulp-minify-html'); // This package has been deprecated in favor of gulp-htmlmin, which should be faster and more comprehensive. diff --git a/types/gulp-minify-html/tsconfig.json b/types/gulp-minify-html/tsconfig.json index 80ef59bff4..5594b9006d 100644 --- a/types/gulp-minify-html/tsconfig.json +++ b/types/gulp-minify-html/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-mocha/gulp-mocha-tests.ts b/types/gulp-mocha/gulp-mocha-tests.ts index c84d710380..d007900825 100644 --- a/types/gulp-mocha/gulp-mocha-tests.ts +++ b/types/gulp-mocha/gulp-mocha-tests.ts @@ -1,5 +1,5 @@ import * as gulp from "gulp"; -import * as mocha from "gulp-mocha"; +import mocha = require("gulp-mocha"); gulp.task('default', function () { return gulp.src('test.js', {read: false}) diff --git a/types/gulp-mocha/tsconfig.json b/types/gulp-mocha/tsconfig.json index 52b200e921..0e919fbac5 100644 --- a/types/gulp-mocha/tsconfig.json +++ b/types/gulp-mocha/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-modernizr/gulp-modernizr-tests.ts b/types/gulp-modernizr/gulp-modernizr-tests.ts index a29f642d7f..8c5b4c0e31 100644 --- a/types/gulp-modernizr/gulp-modernizr-tests.ts +++ b/types/gulp-modernizr/gulp-modernizr-tests.ts @@ -1,5 +1,5 @@ import { src, dest } from 'gulp'; -import * as gulpModernizr from 'gulp-modernizr'; +import gulpModernizr = require('gulp-modernizr'); const s1 = gulpModernizr(); const s2 = gulpModernizr('filename.js', {}); diff --git a/types/gulp-modernizr/tsconfig.json b/types/gulp-modernizr/tsconfig.json index a2f50619a3..4c28752668 100644 --- a/types/gulp-modernizr/tsconfig.json +++ b/types/gulp-modernizr/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-msbuild/gulp-msbuild-tests.ts b/types/gulp-msbuild/gulp-msbuild-tests.ts index f9e5ce053b..386746c0de 100644 --- a/types/gulp-msbuild/gulp-msbuild-tests.ts +++ b/types/gulp-msbuild/gulp-msbuild-tests.ts @@ -1,4 +1,4 @@ -import * as msbuild from "gulp-msbuild"; +import msbuild = require("gulp-msbuild"); const stream = msbuild({ stdout: false, diff --git a/types/gulp-msbuild/tsconfig.json b/types/gulp-msbuild/tsconfig.json index e999f3b231..560d597b85 100644 --- a/types/gulp-msbuild/tsconfig.json +++ b/types/gulp-msbuild/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-mustache/gulp-mustache-tests.ts b/types/gulp-mustache/gulp-mustache-tests.ts index c069a1dd02..d8285370e7 100644 --- a/types/gulp-mustache/gulp-mustache-tests.ts +++ b/types/gulp-mustache/gulp-mustache-tests.ts @@ -1,5 +1,4 @@ -import * as mustache from "gulp-mustache"; -// noinspection ES6UnusedImports +import mustache = require("gulp-mustache"); import { Transform } from "stream"; mustache({ // $ExpectType Transform diff --git a/types/gulp-mustache/tsconfig.json b/types/gulp-mustache/tsconfig.json index f461c5d525..4ebb11f698 100644 --- a/types/gulp-mustache/tsconfig.json +++ b/types/gulp-mustache/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-newer/tsconfig.json b/types/gulp-newer/tsconfig.json index c139e12412..c5d2ed8894 100644 --- a/types/gulp-newer/tsconfig.json +++ b/types/gulp-newer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-ng-annotate/gulp-ng-annotate-tests.ts b/types/gulp-ng-annotate/gulp-ng-annotate-tests.ts index ea48672fb0..6116b87ad2 100644 --- a/types/gulp-ng-annotate/gulp-ng-annotate-tests.ts +++ b/types/gulp-ng-annotate/gulp-ng-annotate-tests.ts @@ -1,6 +1,3 @@ - - - import ngAnnotate = require('gulp-ng-annotate'); import gulp = require('gulp'); diff --git a/types/gulp-ng-annotate/tsconfig.json b/types/gulp-ng-annotate/tsconfig.json index 1b7db8f980..7a35fde2b9 100644 --- a/types/gulp-ng-annotate/tsconfig.json +++ b/types/gulp-ng-annotate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-nodemon/gulp-nodemon-tests.ts b/types/gulp-nodemon/gulp-nodemon-tests.ts index 364536f778..85e90a667b 100644 --- a/types/gulp-nodemon/gulp-nodemon-tests.ts +++ b/types/gulp-nodemon/gulp-nodemon-tests.ts @@ -1,6 +1,3 @@ - - - import gulp = require('gulp'); import path = require('path'); import nodemon = require('gulp-nodemon'); @@ -29,6 +26,8 @@ nodemon({ }); return tasks } + , nodeArgs: ['--trace-warnings'] + , args: ['-t'] }); diff --git a/types/gulp-nodemon/index.d.ts b/types/gulp-nodemon/index.d.ts index 7c5491f596..de08560463 100644 --- a/types/gulp-nodemon/index.d.ts +++ b/types/gulp-nodemon/index.d.ts @@ -69,6 +69,9 @@ declare namespace nodemon { execMap?: { [key: string]: string | boolean | number; }; events?: { [key: string]: string; }; restartable?: string; + args?: string[]; + nodeArgs?: string[]; + scriptPosition?: number; } interface EventEmitter extends NodeJS.EventEmitter { diff --git a/types/gulp-nodemon/tsconfig.json b/types/gulp-nodemon/tsconfig.json index af6e7a7991..5ff166eae3 100644 --- a/types/gulp-nodemon/tsconfig.json +++ b/types/gulp-nodemon/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-nunit-runner/gulp-nunit-runner-tests.ts b/types/gulp-nunit-runner/gulp-nunit-runner-tests.ts index 0e55fef37a..ea571c3cf8 100644 --- a/types/gulp-nunit-runner/gulp-nunit-runner-tests.ts +++ b/types/gulp-nunit-runner/gulp-nunit-runner-tests.ts @@ -1,4 +1,4 @@ -import * as nunit from "gulp-nunit-runner"; +import nunit = require("gulp-nunit-runner"); const stream = nunit({ executable: 'c:/Program Files/NUnit/bin', diff --git a/types/gulp-nunit-runner/tsconfig.json b/types/gulp-nunit-runner/tsconfig.json index 97a0a7a8cb..e7daea0b13 100644 --- a/types/gulp-nunit-runner/tsconfig.json +++ b/types/gulp-nunit-runner/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-plumber/tsconfig.json b/types/gulp-plumber/tsconfig.json index ad53d6fde5..a483c3197e 100644 --- a/types/gulp-plumber/tsconfig.json +++ b/types/gulp-plumber/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-protractor/gulp-protractor-tests.ts b/types/gulp-protractor/gulp-protractor-tests.ts index 77d31e2bea..c79ac9220c 100644 --- a/types/gulp-protractor/gulp-protractor-tests.ts +++ b/types/gulp-protractor/gulp-protractor-tests.ts @@ -1,6 +1,3 @@ - - - import gulp = require('gulp'); import protractor = require('gulp-protractor'); diff --git a/types/gulp-protractor/tsconfig.json b/types/gulp-protractor/tsconfig.json index bb39acdbdc..758e915a22 100644 --- a/types/gulp-protractor/tsconfig.json +++ b/types/gulp-protractor/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-pug/gulp-pug-tests.ts b/types/gulp-pug/gulp-pug-tests.ts index 0ec83a248f..1ba56b91e4 100644 --- a/types/gulp-pug/gulp-pug-tests.ts +++ b/types/gulp-pug/gulp-pug-tests.ts @@ -1,5 +1,5 @@ import { src, dest } from 'gulp'; -import * as gulpPug from 'gulp-pug'; +import gulpPug = require('gulp-pug'); const s1 = gulpPug(); const s2 = gulpPug({}); diff --git a/types/gulp-pug/tsconfig.json b/types/gulp-pug/tsconfig.json index b3b2597c1e..c52e2c9cf0 100644 --- a/types/gulp-pug/tsconfig.json +++ b/types/gulp-pug/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-remember/tsconfig.json b/types/gulp-remember/tsconfig.json index 02070e1b82..c3b4e15c77 100644 --- a/types/gulp-remember/tsconfig.json +++ b/types/gulp-remember/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-rename/tsconfig.json b/types/gulp-rename/tsconfig.json index b9b34366ee..3c33e8adf4 100644 --- a/types/gulp-rename/tsconfig.json +++ b/types/gulp-rename/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-replace/gulp-replace-tests.ts b/types/gulp-replace/gulp-replace-tests.ts index 6a17057495..79f77b93a9 100644 --- a/types/gulp-replace/gulp-replace-tests.ts +++ b/types/gulp-replace/gulp-replace-tests.ts @@ -1,5 +1,5 @@ import * as gulp from "gulp"; -import * as replace from "gulp-replace"; +import replace = require("gulp-replace"); gulp.task('templates', function(){ gulp.src(['file.txt']) diff --git a/types/gulp-replace/tsconfig.json b/types/gulp-replace/tsconfig.json index 5d188a1919..81dc6799cb 100644 --- a/types/gulp-replace/tsconfig.json +++ b/types/gulp-replace/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-rev-replace/gulp-rev-replace-tests.ts b/types/gulp-rev-replace/gulp-rev-replace-tests.ts index 2d7e5a3580..3d191811bb 100644 --- a/types/gulp-rev-replace/gulp-rev-replace-tests.ts +++ b/types/gulp-rev-replace/gulp-rev-replace-tests.ts @@ -1,7 +1,7 @@ import * as gulp from 'gulp'; -import * as revReplace from 'gulp-rev-replace'; -import * as rev from 'gulp-rev'; -import * as useref from 'gulp-useref'; +import revReplace = require('gulp-rev-replace'); +import rev = require('gulp-rev'); +import useref = require('gulp-useref'); gulp.task("index", () => { return gulp.src("src/index.html") diff --git a/types/gulp-rev-replace/tsconfig.json b/types/gulp-rev-replace/tsconfig.json index c9a020605c..54babfcd8a 100644 --- a/types/gulp-rev-replace/tsconfig.json +++ b/types/gulp-rev-replace/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-rev/gulp-rev-tests.ts b/types/gulp-rev/gulp-rev-tests.ts index c13b23fc71..c19616de11 100644 --- a/types/gulp-rev/gulp-rev-tests.ts +++ b/types/gulp-rev/gulp-rev-tests.ts @@ -1,6 +1,3 @@ - - - import gulp = require('gulp'); import rev = require('gulp-rev'); diff --git a/types/gulp-rev/tsconfig.json b/types/gulp-rev/tsconfig.json index fac8396ef8..c5ca988faa 100644 --- a/types/gulp-rev/tsconfig.json +++ b/types/gulp-rev/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-ruby-sass/gulp-ruby-sass-tests.ts b/types/gulp-ruby-sass/gulp-ruby-sass-tests.ts index 69346a16d8..70a034bd68 100644 --- a/types/gulp-ruby-sass/gulp-ruby-sass-tests.ts +++ b/types/gulp-ruby-sass/gulp-ruby-sass-tests.ts @@ -1,5 +1,5 @@ import * as gulp from "gulp"; -import * as sass from "gulp-ruby-sass"; +import sass = require("gulp-ruby-sass"); gulp.task('sass', function () { sass('./scss/*.scss') diff --git a/types/gulp-ruby-sass/tsconfig.json b/types/gulp-ruby-sass/tsconfig.json index 947482e45c..562b5e91b4 100644 --- a/types/gulp-ruby-sass/tsconfig.json +++ b/types/gulp-ruby-sass/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-sass/gulp-sass-tests.ts b/types/gulp-sass/gulp-sass-tests.ts index 72192512a7..5bed46d938 100644 --- a/types/gulp-sass/gulp-sass-tests.ts +++ b/types/gulp-sass/gulp-sass-tests.ts @@ -1,5 +1,5 @@ import gulp = require("gulp"); -import * as sass from "gulp-sass"; +import sass = require("gulp-sass"); gulp.task('sass', function () { gulp.src('./scss/*.scss') diff --git a/types/gulp-sass/tsconfig.json b/types/gulp-sass/tsconfig.json index 311d0e2615..62e7bfb40f 100644 --- a/types/gulp-sass/tsconfig.json +++ b/types/gulp-sass/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-shell/tsconfig.json b/types/gulp-shell/tsconfig.json index d9797a8f28..4d73d765dd 100644 --- a/types/gulp-shell/tsconfig.json +++ b/types/gulp-shell/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-size/gulp-size-tests.ts b/types/gulp-size/gulp-size-tests.ts index bd53018d6a..f978842201 100644 --- a/types/gulp-size/gulp-size-tests.ts +++ b/types/gulp-size/gulp-size-tests.ts @@ -1,6 +1,6 @@ import * as gulp from 'gulp'; -import * as size from 'gulp-size'; -import * as debug from 'gulp-debug'; +import size = require('gulp-size'); +import debug = require('gulp-debug'); gulp.task('default', () => gulp.src('fixture.js') diff --git a/types/gulp-size/tsconfig.json b/types/gulp-size/tsconfig.json index 2d84cb001c..ee2d5f0bc9 100644 --- a/types/gulp-size/tsconfig.json +++ b/types/gulp-size/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-sort/gulp-sort-tests.ts b/types/gulp-sort/gulp-sort-tests.ts index 62e17d27a2..e3cf64f429 100644 --- a/types/gulp-sort/gulp-sort-tests.ts +++ b/types/gulp-sort/gulp-sort-tests.ts @@ -1,7 +1,7 @@ /** Tests taken from https://github.com/pgilad/gulp-sort#usage */ import * as gulp from 'gulp'; -import * as sort from 'gulp-sort'; +import sort = require('gulp-sort'); import * as gulpUtil from 'gulp-util'; // default sort diff --git a/types/gulp-sort/tsconfig.json b/types/gulp-sort/tsconfig.json index df1ddc44e4..19cd0ffa81 100644 --- a/types/gulp-sort/tsconfig.json +++ b/types/gulp-sort/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-sourcemaps/tsconfig.json b/types/gulp-sourcemaps/tsconfig.json index 198b428937..fd79ffc3b1 100644 --- a/types/gulp-sourcemaps/tsconfig.json +++ b/types/gulp-sourcemaps/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-strip-debug/gulp-strip-debug-tests.ts b/types/gulp-strip-debug/gulp-strip-debug-tests.ts index 9a0b04e48a..0e8b6c1a8b 100644 --- a/types/gulp-strip-debug/gulp-strip-debug-tests.ts +++ b/types/gulp-strip-debug/gulp-strip-debug-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from 'gulp'; -import * as stripDebug from 'gulp-strip-debug'; +import stripDebug = require('gulp-strip-debug'); // Example taken from https://www.npmjs.com/package/gulp-strip-debug gulp.task('default', function () { diff --git a/types/gulp-strip-debug/tsconfig.json b/types/gulp-strip-debug/tsconfig.json index ad5d90ca69..6e8ef33fc2 100644 --- a/types/gulp-strip-debug/tsconfig.json +++ b/types/gulp-strip-debug/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-svg-sprite/tsconfig.json b/types/gulp-svg-sprite/tsconfig.json index ed703e4c09..edfff724d1 100644 --- a/types/gulp-svg-sprite/tsconfig.json +++ b/types/gulp-svg-sprite/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-task-listing/tsconfig.json b/types/gulp-task-listing/tsconfig.json index 6d99b2f3f2..2b580f1f5f 100644 --- a/types/gulp-task-listing/tsconfig.json +++ b/types/gulp-task-listing/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-tsd/gulp-tsd-tests.ts b/types/gulp-tsd/gulp-tsd-tests.ts index 0b7a1dadea..e593ec2634 100644 --- a/types/gulp-tsd/gulp-tsd-tests.ts +++ b/types/gulp-tsd/gulp-tsd-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from "gulp"; -import * as tsd from "gulp-tsd"; +import tsd = require("gulp-tsd"); gulp.task("tsd", () => { gulp.src("gulp_tsd.json") diff --git a/types/gulp-tsd/tsconfig.json b/types/gulp-tsd/tsconfig.json index 692c21e642..3ede2690c5 100644 --- a/types/gulp-tsd/tsconfig.json +++ b/types/gulp-tsd/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-typedoc/gulp-typedoc-tests.ts b/types/gulp-typedoc/gulp-typedoc-tests.ts deleted file mode 100644 index 753b7e15be..0000000000 --- a/types/gulp-typedoc/gulp-typedoc-tests.ts +++ /dev/null @@ -1,13 +0,0 @@ -import gulp = require("gulp"); -import typedoc = require("gulp-typedoc"); - -gulp.task("typedoc", function() { - return gulp - .src(["data/*.ts"]) - .pipe(typedoc({ - module: "commonjs", - out: "./out", - name: "my-project", - target: "es5" - })); -}); \ No newline at end of file diff --git a/types/gulp-typedoc/index.d.ts b/types/gulp-typedoc/index.d.ts deleted file mode 100644 index 322f734fe7..0000000000 --- a/types/gulp-typedoc/index.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Type definitions for gulp-typedoc -// Project: https://github.com/rogierschouten/gulp-typedoc -// Definitions by: Asana -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - - -interface Options { - out: string; - mode?: string; - json?: string; - exclude?: string; - includeDeclarations?: boolean; - externalPattern?: string; - excludeExternals?: boolean; - module?: string; - target?: string; - theme?: string; - name?: string; - readme?: string; - hideGenerator?: boolean; - gaID?: string; - gaSite?: string; - verbose?: boolean; -} - -declare function typedoc(opts: Options): NodeJS.ReadWriteStream; -export = typedoc; diff --git a/types/gulp-typedoc/tsconfig.json b/types/gulp-typedoc/tsconfig.json deleted file mode 100644 index 04b9015fc3..0000000000 --- a/types/gulp-typedoc/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "gulp-typedoc-tests.ts" - ] -} \ No newline at end of file diff --git a/types/gulp-uglify/composer.d.ts b/types/gulp-uglify/composer.d.ts index bb3f04f134..0584a72fc0 100644 --- a/types/gulp-uglify/composer.d.ts +++ b/types/gulp-uglify/composer.d.ts @@ -1,5 +1,5 @@ import * as UglifyJS from 'uglify-js'; -import * as GulpUglify from '.'; +import GulpUglify = require('.'); interface Composer { (uglify: Uglify, log: Logger): typeof GulpUglify; diff --git a/types/gulp-uglify/gulp-uglify-tests.ts b/types/gulp-uglify/gulp-uglify-tests.ts index 172d7cae0b..1a23580e8c 100644 --- a/types/gulp-uglify/gulp-uglify-tests.ts +++ b/types/gulp-uglify/gulp-uglify-tests.ts @@ -1,5 +1,5 @@ import * as gulp from 'gulp'; -import * as uglify from 'gulp-uglify'; +import uglify = require('gulp-uglify'); import pump = require('pump'); import uglifyjs = require('uglify-js'); import composer = require('gulp-uglify/composer'); diff --git a/types/gulp-uglify/tsconfig.json b/types/gulp-uglify/tsconfig.json index 72fd35c65e..282b6c138b 100644 --- a/types/gulp-uglify/tsconfig.json +++ b/types/gulp-uglify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-useref/gulp-useref-tests.ts b/types/gulp-useref/gulp-useref-tests.ts index 5d777fd6e6..91cc7919e7 100644 --- a/types/gulp-useref/gulp-useref-tests.ts +++ b/types/gulp-useref/gulp-useref-tests.ts @@ -1,5 +1,5 @@ import * as gulp from 'gulp'; -import * as useref from 'gulp-useref'; +import useref = require('gulp-useref'); // Usage gulp.task('default', function () { @@ -14,7 +14,7 @@ gulp.task('default', function () { .pipe(gulp.dest('dist')); }); -import * as gulpif from 'gulp-if'; +import gulpif = require('gulp-if'); import uglify = require('gulp-uglify'); import minifyCss = require('gulp-minify-css'); diff --git a/types/gulp-useref/tsconfig.json b/types/gulp-useref/tsconfig.json index cdb7922c57..b12ffbcda7 100644 --- a/types/gulp-useref/tsconfig.json +++ b/types/gulp-useref/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-util/tsconfig.json b/types/gulp-util/tsconfig.json index f383866019..d3286da30b 100644 --- a/types/gulp-util/tsconfig.json +++ b/types/gulp-util/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-watch/gulp-watch-tests.ts b/types/gulp-watch/gulp-watch-tests.ts index b273662824..360c53dd19 100644 --- a/types/gulp-watch/gulp-watch-tests.ts +++ b/types/gulp-watch/gulp-watch-tests.ts @@ -1,5 +1,5 @@ import * as gulp from 'gulp'; -import * as watch from 'gulp-watch'; +import watch = require('gulp-watch'); gulp.task('stream', () => gulp.src('css/**/*.css') diff --git a/types/gulp-watch/tsconfig.json b/types/gulp-watch/tsconfig.json index 079cb9d569..b1937b173a 100644 --- a/types/gulp-watch/tsconfig.json +++ b/types/gulp-watch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-zip/gulp-zip-tests.ts b/types/gulp-zip/gulp-zip-tests.ts index 983a4263ce..428ce81ebd 100644 --- a/types/gulp-zip/gulp-zip-tests.ts +++ b/types/gulp-zip/gulp-zip-tests.ts @@ -1,4 +1,4 @@ -import * as GulpZip from 'gulp-zip'; +import GulpZip = require('gulp-zip'); GulpZip('file.zip').on('end', () => {}); GulpZip('file.zip', {compress: false}).on('end', () => {}); diff --git a/types/gulp-zip/tsconfig.json b/types/gulp-zip/tsconfig.json index a5f75d75fa..8b43507914 100644 --- a/types/gulp-zip/tsconfig.json +++ b/types/gulp-zip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp/test/index.ts b/types/gulp/test/index.ts index 853799d8c4..f5ca436450 100644 --- a/types/gulp/test/index.ts +++ b/types/gulp/test/index.ts @@ -1,7 +1,7 @@ import * as gulp from 'gulp'; import * as undertaker from 'undertaker'; import * as registry from 'undertaker-registry'; -import * as del from "del"; +import del = require("del"); const minify: () => any = () => { }; const jade: () => any = () => { }; diff --git a/types/gulp/tsconfig.json b/types/gulp/tsconfig.json index b0ca843318..dfba44bd86 100644 --- a/types/gulp/tsconfig.json +++ b/types/gulp/tsconfig.json @@ -16,6 +16,7 @@ "strictNullChecks": true, "strictFunctionTypes": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "noEmit": true }, "files": [ diff --git a/types/gulp/v3/tsconfig.json b/types/gulp/v3/tsconfig.json index 2948f23682..d1a56e0a01 100644 --- a/types/gulp/v3/tsconfig.json +++ b/types/gulp/v3/tsconfig.json @@ -22,7 +22,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gzip-js/tsconfig.json b/types/gzip-js/tsconfig.json index a8138e1de9..978dc916bd 100644 --- a/types/gzip-js/tsconfig.json +++ b/types/gzip-js/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "gzip-js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/gzip-size/tsconfig.json b/types/gzip-size/tsconfig.json index 6d244facf6..9779d93536 100644 --- a/types/gzip-size/tsconfig.json +++ b/types/gzip-size/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gzip-size/v3/tsconfig.json b/types/gzip-size/v3/tsconfig.json index 88a695711b..1e806cb7bc 100644 --- a/types/gzip-size/v3/tsconfig.json +++ b/types/gzip-size/v3/tsconfig.json @@ -19,10 +19,11 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "gzip-size-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/h2o2/tsconfig.json b/types/h2o2/tsconfig.json index 30a156a786..b0d5bbf160 100644 --- a/types/h2o2/tsconfig.json +++ b/types/h2o2/tsconfig.json @@ -14,13 +14,16 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "h2o2-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/halfred/tsconfig.json b/types/halfred/tsconfig.json index 7d75a822cb..2e09cffd82 100644 --- a/types/halfred/tsconfig.json +++ b/types/halfred/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/halogen/tsconfig.json b/types/halogen/tsconfig.json index f234a05b87..caaa6505d4 100644 --- a/types/halogen/tsconfig.json +++ b/types/halogen/tsconfig.json @@ -16,6 +16,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "react" }, "files": [ diff --git a/types/hammerjs/tsconfig.json b/types/hammerjs/tsconfig.json index c0ba95885c..e159cc1fe0 100644 --- a/types/hammerjs/tsconfig.json +++ b/types/hammerjs/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/hammerjs/v1/tsconfig.json b/types/hammerjs/v1/tsconfig.json index aeabf7ff07..665a768e1d 100644 --- a/types/hammerjs/v1/tsconfig.json +++ b/types/hammerjs/v1/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/handlebars/tsconfig.json b/types/handlebars/tsconfig.json index 5f874f3996..3fdef52d13 100644 --- a/types/handlebars/tsconfig.json +++ b/types/handlebars/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/handlebars/v1/tsconfig.json b/types/handlebars/v1/tsconfig.json index 96818b903b..7b246f2c3a 100644 --- a/types/handlebars/v1/tsconfig.json +++ b/types/handlebars/v1/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/hapi-auth-basic/tsconfig.json b/types/hapi-auth-basic/tsconfig.json index 56ac44dbdd..7448e829c4 100644 --- a/types/hapi-auth-basic/tsconfig.json +++ b/types/hapi-auth-basic/tsconfig.json @@ -14,13 +14,16 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "hapi-auth-basic-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/hapi-auth-jwt2/tsconfig.json b/types/hapi-auth-jwt2/tsconfig.json index 78a8423cc4..7d06e7c818 100644 --- a/types/hapi-auth-jwt2/tsconfig.json +++ b/types/hapi-auth-jwt2/tsconfig.json @@ -14,13 +14,16 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "hapi-auth-jwt2-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/hapi-decorators/tsconfig.json b/types/hapi-decorators/tsconfig.json index 80aa56a21e..645122114e 100644 --- a/types/hapi-decorators/tsconfig.json +++ b/types/hapi-decorators/tsconfig.json @@ -16,13 +16,16 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "hapi-decorators-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/hapi/tsconfig.json b/types/hapi/tsconfig.json index 96790b3bff..53f8f2ece6 100644 --- a/types/hapi/tsconfig.json +++ b/types/hapi/tsconfig.json @@ -14,10 +14,13 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -97,4 +100,4 @@ "test/server/table.ts", "test/server/version.ts" ] -} +} \ No newline at end of file diff --git a/types/hapi/v12/tsconfig.json b/types/hapi/v12/tsconfig.json index c461c7d288..527a25a6be 100644 --- a/types/hapi/v12/tsconfig.json +++ b/types/hapi/v12/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hapi/v15/tsconfig.json b/types/hapi/v15/tsconfig.json index 154b6a8f0e..f3eea23e6b 100644 --- a/types/hapi/v15/tsconfig.json +++ b/types/hapi/v15/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hapi/v8/tsconfig.json b/types/hapi/v8/tsconfig.json index 7eb82005fd..e56e64ba1e 100644 --- a/types/hapi/v8/tsconfig.json +++ b/types/hapi/v8/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/har-format/tsconfig.json b/types/har-format/tsconfig.json index f5029a7c18..e30aa982b8 100644 --- a/types/har-format/tsconfig.json +++ b/types/har-format/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hard-rejection/tsconfig.json b/types/hard-rejection/tsconfig.json index 6c83946da7..1521f9e327 100644 --- a/types/hard-rejection/tsconfig.json +++ b/types/hard-rejection/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/harmony-proxy/tsconfig.json b/types/harmony-proxy/tsconfig.json index 2190dd8e23..5225c0854d 100644 --- a/types/harmony-proxy/tsconfig.json +++ b/types/harmony-proxy/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/has-ansi/tsconfig.json b/types/has-ansi/tsconfig.json index d5b52a8974..e80018a785 100644 --- a/types/has-ansi/tsconfig.json +++ b/types/has-ansi/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hash-file/tsconfig.json b/types/hash-file/tsconfig.json index 67f8cfcf8c..c300cccbda 100644 --- a/types/hash-file/tsconfig.json +++ b/types/hash-file/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hash-stream/tsconfig.json b/types/hash-stream/tsconfig.json index e1846bd608..61d4d3c12e 100644 --- a/types/hash-stream/tsconfig.json +++ b/types/hash-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hasha/tsconfig.json b/types/hasha/tsconfig.json index fe359d64a5..ebef98b818 100644 --- a/types/hasha/tsconfig.json +++ b/types/hasha/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hasher/tsconfig.json b/types/hasher/tsconfig.json index dae70f6dc4..b05767e01b 100644 --- a/types/hasher/tsconfig.json +++ b/types/hasher/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hashids/tsconfig.json b/types/hashids/tsconfig.json index 4d118acf1b..7d308003bb 100644 --- a/types/hashids/tsconfig.json +++ b/types/hashids/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hashmap/tsconfig.json b/types/hashmap/tsconfig.json index f2d00e0999..700a72e832 100644 --- a/types/hashmap/tsconfig.json +++ b/types/hashmap/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/hashmap/v1/tsconfig.json b/types/hashmap/v1/tsconfig.json index a085a1d89d..6537d23b5d 100644 --- a/types/hashmap/v1/tsconfig.json +++ b/types/hashmap/v1/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hashset/tsconfig.json b/types/hashset/tsconfig.json index 7bf84fd5f1..9ac81f5b45 100644 --- a/types/hashset/tsconfig.json +++ b/types/hashset/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hashtable/tsconfig.json b/types/hashtable/tsconfig.json index 497a9448bf..eac4d4b6c8 100644 --- a/types/hashtable/tsconfig.json +++ b/types/hashtable/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/haversine/tsconfig.json b/types/haversine/tsconfig.json index 6b8c2dfaf6..ed00b23d2c 100644 --- a/types/haversine/tsconfig.json +++ b/types/haversine/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hbs/hbs-tests.ts b/types/hbs/hbs-tests.ts new file mode 100644 index 0000000000..c1d355daea --- /dev/null +++ b/types/hbs/hbs-tests.ts @@ -0,0 +1,29 @@ +import express = require('express'); + +const app = express(); + +app.set('view engine', 'html'); + +import hbs = require('hbs'); + +// The idiom for this is +// app.engine('html', require('hbs').__express); +// However this undermines the test since the return type of require() is any +app.engine('html', hbs.__express); + +hbs.registerHelper('helper_name', (testParm: number) => testParm++); +hbs.registerPartial('partial_name', 'partial value'); + +hbs.registerPartials(__dirname + '/views/partials'); + +hbs.registerPartials(__dirname + '/views/partials', () => {}); + +hbs.localsAsTemplateData(app); + +const safeString = new hbs.handlebars.SafeString("string"); + +const instance1 = hbs.create(); +const instance2 = hbs.create(); + +app.engine('html', instance1.__express); +app.engine('hbs', instance2.__express); diff --git a/types/hbs/index.d.ts b/types/hbs/index.d.ts new file mode 100644 index 0000000000..1b3a36c4be --- /dev/null +++ b/types/hbs/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for hbs 4.0 +// Project: https://github.com/pillarjs/hbs +// Definitions by: David Muller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import handlebars = require('handlebars'); + +type handlebarsModule = typeof handlebars; + +interface hbsModule { + readonly handlebars: handlebarsModule; + localsAsTemplateData(app: any): void; + registerHelper(helperName: string, helperFunction: (...args: any[]) => any): void; + registerPartial(partialName: string, partialValue: string): void; + registerPartials(directoryName: string, callback?: () => void): void; + __express(filename: string, options: any, cb: (...args: any[]) => any): any; +} + +interface hbsModuleWithCreate extends hbsModule { + create(handlebars?: handlebarsModule): hbsModule; +} + +declare var baseModule: hbsModuleWithCreate; + +export = baseModule; diff --git a/types/rollup/tsconfig.json b/types/hbs/tsconfig.json similarity index 79% rename from types/rollup/tsconfig.json rename to types/hbs/tsconfig.json index 2fad31b1b1..4ed61e005d 100644 --- a/types/rollup/tsconfig.json +++ b/types/hbs/tsconfig.json @@ -1,7 +1,6 @@ { "compilerOptions": { "module": "commonjs", - "target": "es6", "lib": [ "es6" ], @@ -15,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", - "rollup-tests.ts" + "hbs-tests.ts" ] } \ No newline at end of file diff --git a/types/hbs/tslint.json b/types/hbs/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/hbs/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/he/tsconfig.json b/types/he/tsconfig.json index 6e02234def..21526db543 100644 --- a/types/he/tsconfig.json +++ b/types/he/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/headroom/tsconfig.json b/types/headroom/tsconfig.json index eb03738511..5184b6b443 100644 --- a/types/headroom/tsconfig.json +++ b/types/headroom/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/heap/tsconfig.json b/types/heap/tsconfig.json index ed8f269f6e..a5dc20174d 100644 --- a/types/heap/tsconfig.json +++ b/types/heap/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/heapdump/tsconfig.json b/types/heapdump/tsconfig.json index a15a306b41..703a603ae1 100644 --- a/types/heapdump/tsconfig.json +++ b/types/heapdump/tsconfig.json @@ -16,10 +16,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "heapdump-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/heatmap.js/tsconfig.json b/types/heatmap.js/tsconfig.json index 2e22853a34..d1e87ffb3d 100644 --- a/types/heatmap.js/tsconfig.json +++ b/types/heatmap.js/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hedron/tsconfig.json b/types/hedron/tsconfig.json index bed62b30c6..647d1d6a30 100644 --- a/types/hedron/tsconfig.json +++ b/types/hedron/tsconfig.json @@ -16,6 +16,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "preserve" }, "files": [ diff --git a/types/hellojs/tsconfig.json b/types/hellojs/tsconfig.json index c3baa66581..755aefce72 100644 --- a/types/hellojs/tsconfig.json +++ b/types/hellojs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hellosign-embedded/tsconfig.json b/types/hellosign-embedded/tsconfig.json index 4712a41816..74d8ec66b4 100644 --- a/types/hellosign-embedded/tsconfig.json +++ b/types/hellosign-embedded/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/helmet/tsconfig.json b/types/helmet/tsconfig.json index 0a85e89659..f85a86b1c8 100644 --- a/types/helmet/tsconfig.json +++ b/types/helmet/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/heredatalens/tsconfig.json b/types/heredatalens/tsconfig.json index 5a2650b93f..4e2e0cd1a3 100644 --- a/types/heredatalens/tsconfig.json +++ b/types/heredatalens/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/heremaps/tsconfig.json b/types/heremaps/tsconfig.json index 7f83e9f79c..4ccebfba90 100644 --- a/types/heremaps/tsconfig.json +++ b/types/heremaps/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/heroku-logger/tsconfig.json b/types/heroku-logger/tsconfig.json index 802ac41a2a..ebd7c0041c 100644 --- a/types/heroku-logger/tsconfig.json +++ b/types/heroku-logger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hex-rgba/tsconfig.json b/types/hex-rgba/tsconfig.json index 82f2e3808e..2f0ff73e60 100644 --- a/types/hex-rgba/tsconfig.json +++ b/types/hex-rgba/tsconfig.json @@ -14,10 +14,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ "index.d.ts", "hex-rgba-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/hexo-bunyan/tsconfig.json b/types/hexo-bunyan/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/hexo-bunyan/tsconfig.json +++ b/types/hexo-bunyan/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/hexo-fs/tsconfig.json b/types/hexo-fs/tsconfig.json index 4d8c00b74e..b3014c52df 100644 --- a/types/hexo-fs/tsconfig.json +++ b/types/hexo-fs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hexo-log/tsconfig.json b/types/hexo-log/tsconfig.json index b0af5da25b..906e609902 100644 --- a/types/hexo-log/tsconfig.json +++ b/types/hexo-log/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/highcharts-ng/tsconfig.json b/types/highcharts-ng/tsconfig.json index 6f313e502a..f1f180976f 100644 --- a/types/highcharts-ng/tsconfig.json +++ b/types/highcharts-ng/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/highcharts/index.d.ts b/types/highcharts/index.d.ts index 917ab479ea..48c0c614c2 100644 --- a/types/highcharts/index.d.ts +++ b/types/highcharts/index.d.ts @@ -174,7 +174,7 @@ declare namespace Highcharts { * font size on bottom axis. * @default null */ - y?: number; + y?: number | null; /** * The Z index for the axis labels. * @default 7 @@ -256,7 +256,7 @@ declare namespace Highcharts { * Border color for the plot band. Also requires borderWidth to be set. * @default null */ - borderColor?: Color; + borderColor?: Color | null; /** * Border width for the plot band. Also requires borderColor to be set. * @default 0 @@ -289,7 +289,7 @@ declare namespace Highcharts { * @default null * @since 2.3 */ - innerRadius?: number | string; + innerRadius?: number | string | null; /** * Text labels for the plot bands */ @@ -485,7 +485,7 @@ declare namespace Highcharts { * @default 'middle' * @deprecated */ - enabled?: string; + enabled?: string | null; /** * The pixel distance between the axis labels or line and the title. * @default xAxis: 0 for horizontal axes, 10 for vertical axes, yAxis: 40 @@ -581,7 +581,7 @@ declare namespace Highcharts { * categories: ['Apples', 'Bananas', 'Oranges'] * @default null */ - categories?: any[]; + categories?: any[] | null; /** * The highest allowed value for automatically computed axis extremes. * @since 4.0 @@ -652,7 +652,7 @@ declare namespace Highcharts { * @default null * @since 4.0 */ - floor?: number; + floor?: number | null; /** * Color of the grid lines extending the ticks across the plot area. * @defaults to '#D8D8D8'. @@ -705,7 +705,7 @@ declare namespace Highcharts { * The maximum value of the axis. If null, the max value is automatically calculated. If the endOnTick option is * true, the max value might be rounded up. The actual maximum value is also influenced by chart.alignTicks. */ - max?: number; + max?: number | null; /** * Padding of the max value relative to the length of the axis. A padding of 0.05 will make a 100px axis 5px longer. * This is useful when you don't want the highest data value to appear on the edge of the plot area. When the axis' @@ -723,7 +723,7 @@ declare namespace Highcharts { * The minimum value of the axis. If null the min value is automatically calculated. If the startOnTick option is * true, the min value might be rounded down. */ - min?: number; + min?: number | null; /** * Padding of the min value relative to the length of the axis. A padding of 0.05 will make a 100px axis 5px longer. * This is useful when you don't want the lowest data value to appear on the edge of the plot area. When the axis' @@ -787,7 +787,7 @@ declare namespace Highcharts { * * On axes using categories, minor ticks are not supported. */ - minorTickInterval?: number | string; + minorTickInterval?: number | string | null; /** * The pixel length of the minor tick marks. * @default 2 @@ -986,7 +986,7 @@ declare namespace Highcharts { * * If the tickInterval is too dense for labels to be drawn, Highcharts may remove ticks. */ - tickInterval?: number; + tickInterval?: number | null; /** * The pixel length of the main tick marks. * @default 10 @@ -998,7 +998,7 @@ declare namespace Highcharts { * * @default 72 for the Y axis, 100 for the X axis. */ - tickPixelInterval?: number; + tickPixelInterval?: number | null; /** * The position of the major tick marks relative to the axis line. Can be one of 'inside' and 'outside'. * @default 'outside' @@ -1025,7 +1025,7 @@ declare namespace Highcharts { * mark is placed between categories. The default is 'between' if the tickInterval is 1, else 'on'. * @default null */ - tickmarkPlacement?: string; + tickmarkPlacement?: string | null; /** * The axis title, showing next to the axis line. To disable the title, set the text to null. */ @@ -1161,12 +1161,12 @@ declare namespace Highcharts { * @default 'gray' */ color?: string | Gradient; - }; + } | null; /** * The maximum value of the axis in terms of map point values. If null, the max value is automatically calculated. * If the endOnTick option is true, the max value might be rounded up. */ - max?: number; + max?: number | null; /** * The color to represent the maximum of the color axis. Unless dataClasses or stops are set, the gradient ends at * this value. @@ -1185,7 +1185,7 @@ declare namespace Highcharts { * The minimum value of the axis in terms of map point values. If null, the min value is automatically calculated. * If the startOnTick option is true, the min value might be rounded down. */ - min?: number; + min?: number | null; /** * The color to represent the minimum of the color axis. Unless dataClasses or stops are set, the gradient starts at * this value. @@ -1232,7 +1232,7 @@ declare namespace Highcharts { * If user settings dictate minor ticks to become too dense, they don't make sense, and will be ignored to prevent * performance problems. */ - minorTickInterval?: string | number; + minorTickInterval?: string | number | null; /** * The pixel length of the minor tick marks. * @default 2 @@ -1284,7 +1284,7 @@ declare namespace Highcharts { * The interval of the tick marks in axis units. When null, the tick interval is computed to approximately follow * the tickPixelInterval. */ - tickInterval?: number; + tickInterval?: number | null; /** * The pixel length of the main tick marks. * @default 10 @@ -1294,7 +1294,7 @@ declare namespace Highcharts { * If tickInterval is null this option sets the approximate pixel interval of the tick marks. * @default 72 */ - tickPixelInterval?: number; + tickPixelInterval?: number | null; /** * The position of the major tick marks relative to the axis line. Can be one of 'inside' and 'outside'. * @default 'outside' @@ -1771,7 +1771,7 @@ declare namespace Highcharts { * @default null * @since 5.0.8 */ - height?: number | string; + height?: number | string | null; /** * If true, the axes will scale to the remaining visible series once one series is hidden. If false, hiding and * showing a series will not affect the axes or the other series. For stacks, once one series within the stack is @@ -1843,7 +1843,7 @@ declare namespace Highcharts { * @default null * @since 3.0 */ - pinchType?: string; + pinchType?: string | null; /** * The background color or gradient for the plot area. */ @@ -2310,7 +2310,7 @@ declare namespace Highcharts { * @default null * @since 3.0 */ - text?: string; + text?: string | null; /** * A configuration object for the button theme. The object accepts SVG properties like stroke-width, stroke and * fill. Tri-state button styles are supported by the states.hover and states.select objects. @@ -2390,7 +2390,7 @@ declare namespace Highcharts { * specific width and height, or a printer-friendly color scheme. * @default null */ - chartOptions?: Options; + chartOptions?: Options | null; /** * Whether to enable the exporting module. Disabling the module will hide the context button, but API methods will * still be available. @@ -2628,7 +2628,7 @@ declare namespace Highcharts { * @default ['k', 'M', 'G', 'T', 'P', 'E'] * @since 2.3.0 */ - numericSymbols?: string[]; + numericSymbols?: string[] | null; /** * Exporting module only. The text for the menu item to print the chart. * @default 'Print chart' @@ -2712,7 +2712,7 @@ declare namespace Highcharts { * @default null * @since 3.0 */ - text?: string; + text?: string | null; } interface LegendOptions { @@ -3220,7 +3220,7 @@ declare namespace Highcharts { * The text color for the data labels. * @default null */ - color?: string | Gradient; + color?: string | Gradient | null; /** * Whether to hide data labels that are outside the plot area. By default, the data label is moved inside the plot * area according to the overflow option. @@ -3464,16 +3464,16 @@ declare namespace Highcharts { * widespread data points. * @default null, true for hover and select */ - enabled?: boolean; + enabled?: boolean | null; /** * The fill color of the point marker. When null, the series' or point's color is used. */ - fillColor?: string; + fillColor?: string | null; /** * The color of the point marker's outline. When null, the series' or point's color is used. * @default '#FFFFFF', '#000000' for select state */ - lineColor?: string | Gradient; + lineColor?: string | Gradient | null; /** * The width of the point marker's outline. * @default 0 @@ -3507,7 +3507,7 @@ declare namespace Highcharts { * @default null * @since 4.0.4 */ - height?: number; + height?: number | null; states?: { hover?: MarkerHoverState; /** @@ -3526,13 +3526,13 @@ declare namespace Highcharts { * Custom callbacks for symbol path generation can also be added to Highcharts.SVGRenderer.prototype.symbols. The * callback is then used by its method name. */ - symbol?: string; // null, 'circle', 'square', 'diamond', 'triangle' 'triangle-down' or 'url(graphic.png)' + symbol?: string | null; // null, 'circle', 'square', 'diamond', 'triangle' 'triangle-down' or 'url(graphic.png)' /** * Image markers only. Set the image width explicitly. When using this option, a height must also be set. * @default null. * @since 4.0.4 */ - width?: number; + width?: number | null; } interface PointEvents { @@ -3760,7 +3760,7 @@ declare namespace Highcharts { * The text color for the data labels. * @default null */ - color?: string | Gradient; + color?: string | Gradient | null; /** * Whether to hide data labels that are outside the plot area. By default, the data label is moved inside the plot * area according to the overflow option. @@ -4139,7 +4139,7 @@ declare namespace Highcharts { * @default null. * @since 3.0 */ - negativeColor?: string; + negativeColor?: string | null; point?: { events: PointEvents; }; @@ -4175,7 +4175,7 @@ declare namespace Highcharts { * Defaults to null in cartesian charts, 'between' in polar charts. * @since 2.3.0 */ - pointPlacement?: string | number; + pointPlacement?: string | number | null; /** * If no x values are given for the points in a series, pointStart defines on what value to start. For example, if a * series contains one yearly value starting from 1945, set pointStart to 1945. @@ -4221,7 +4221,7 @@ declare namespace Highcharts { * Whether to stack the values of each series on top of each other. Possible values are null to disable, 'normal' to * stack by value or 'percent'. */ - stacking?: string; + stacking?: string | null; /** * A wrapper object for all the series options in specific states. */ @@ -4247,7 +4247,7 @@ declare namespace Highcharts { * @default 0 * @since 2.0 */ - threshold?: number; + threshold?: number | null; /** * A configuration object for the tooltip rendering of each single series. Properties are inherited from tooltip, * but only the following properties can be defined on a series level. @@ -4285,7 +4285,7 @@ declare namespace Highcharts { /** * Fill color or gradient for the area. When null, the series' color is used with the series' fillOpacity. */ - fillColor?: string | Gradient; + fillColor?: string | Gradient | null; /** * Fill opacity for the area. Note that when you set an explicit fillColor, the fillOpacity is not applied. Instead, * you should define the opacity in the fillColor with an rgba color definition. @@ -4401,7 +4401,7 @@ declare namespace Highcharts { * @default null * @since 4.1.8 */ - maxPointWidth?: number; + maxPointWidth?: number | null; /** * The minimal height for a column or width for a bar. By default, 0 values are not shown. To visualize a 0 (or * close to zero) point, set the minimal point length to a pixel value like 3. In stacked column charts, @@ -4426,7 +4426,7 @@ declare namespace Highcharts { * pointPadding and groupPadding. * @since 1.2.5 */ - pointWidth?: number; + pointWidth?: number | null; /** * A wrapper object for all the series options in specific states. */ @@ -4474,13 +4474,13 @@ declare namespace Highcharts { * @default null * @since 3.0 */ - medianColor?: string; + medianColor?: string | null; /** * The pixel width of the median line. If null, the lineWidth is used. * @default 2 * @since 3.0 */ - medianWidth?: number; + medianWidth?: number | null; } /** @@ -4517,7 +4517,7 @@ declare namespace Highcharts { * @default null * @since 3.0 */ - negativeColor?: string; + negativeColor?: string | null; /** * Whether the bubble's value should be represented by the area or the width of the bubble. The default, area, * corresponds best to the human perception of the size of each bubble. @@ -4538,13 +4538,13 @@ declare namespace Highcharts { * @default null * @since 4.0.3 */ - zMax?: number; + zMax?: number | null; /** * The minimum for the Z value range. Defaults to the lowest Z value in the data. * @default null * @since 4.0.3 */ - zMin?: number; + zMin?: number | null; /** * When displayNegative is false, bubbles with lower Z values are skipped. When displayNegative is true and a * negativeColor is given, points with lower Z is colored. @@ -4617,7 +4617,7 @@ declare namespace Highcharts { * @default null * @since 4.1.8 */ - maxPointWidth?: number; + maxPointWidth?: number | null; /** * Padding between each column or bar, in x axis units. * @default 0.1 @@ -4635,7 +4635,7 @@ declare namespace Highcharts { * pointPadding and groupPadding. * @since 1.2.5 */ - pointWidth?: number; + pointWidth?: number | null; /** * A wrapper object for all the series options in specific states. */ @@ -4651,7 +4651,7 @@ declare namespace Highcharts { * @default null * @since 3.0 */ - stemColor?: string; + stemColor?: string | null; /** * The dash style of the stem, the vertical line extending from the box to the whiskers. * @default 'Solid' @@ -4664,14 +4664,14 @@ declare namespace Highcharts { * @default null * @since 3.0 */ - stemWidth?: number; + stemWidth?: number | null; /** * The color of the whiskers, the horizontal lines marking low and high values. When null, the general series color * is used. * @default null * @since 3.0 */ - whiskerColor?: string; + whiskerColor?: string | null; /** * The length of the whiskers, the horizontal lines marking low and high values. It can be a numerical pixel value, * or a percentage value of the box width. Set 0 to disable whiskers. @@ -4685,7 +4685,7 @@ declare namespace Highcharts { * @default 2 * @since 3.0 */ - whiskerWidth?: number; + whiskerWidth?: number | null; } /** @@ -4863,7 +4863,7 @@ declare namespace Highcharts { * @default null * @since 4.1.8 */ - maxPointWidth?: number; + maxPointWidth?: number | null; /** * The row size - how many Y axis units each heatmap row should span. * @default 1 @@ -4901,7 +4901,7 @@ declare namespace Highcharts { * borderless pies. * @default '#FFFFFF' */ - borderColor?: string | Gradient; + borderColor?: string | Gradient | null; /** * The width of the border surrounding each column or bar. * @default 1 @@ -4914,7 +4914,7 @@ declare namespace Highcharts { * center should be explicitly set, for example to ['50%', '50%']. * @default [null, null] */ - center?: [string | number, string | number]; + center?: [string | number | null, string | number | null]; /** * A series specific or series type specific color set to apply instead of the global colors when colorByPoint is true. * @since 3.0 @@ -4932,7 +4932,7 @@ declare namespace Highcharts { * @default null * @since 1.3.6 */ - endAngle?: number; + endAngle?: number | null; /** * Equivalent to chart.ignoreHiddenSeries, this option tells whether the series shall be redrawn as if the hidden * point were null. @@ -5099,7 +5099,7 @@ declare namespace Highcharts { * @default null * @since 5.0.3 */ - threshold?: number; + threshold?: number | null; /** * When this option is true, the dial will wrap around the axes. For instance, in a full-range gauge going from 0 to * 360, a value of 400 will point to 40. When wrap is false, the dial stops at 360. @@ -5187,7 +5187,7 @@ declare namespace Highcharts { * @default null * @since 4.1.8 */ - maxPointWidth?: number; + maxPointWidth?: number | null; /** * The sort index of the point inside the treemap level. * @since 4.1.10 @@ -5362,7 +5362,7 @@ declare namespace Highcharts { * A pixel value specifying a fixed width for each column or bar. When null, the width is calculated from * the pointPadding and groupPadding. */ - pointWidth?: number; + pointWidth?: number | null; /** * This option allows grouping series in a stacked chart. The stack option can be a string or a number or anything * else, as long as the grouped series' stack options match each other. @@ -5584,7 +5584,7 @@ declare namespace Highcharts { * @default null * @since 2.0 */ - y?: number; + y?: number | null; } interface TitleOptions { @@ -5641,7 +5641,7 @@ declare namespace Highcharts { * @default null * @since 2.0 */ - y?: number; + y?: number | null; } interface CrosshairObject { @@ -5695,7 +5695,7 @@ declare namespace Highcharts { * The color of the tooltip border. When null, the border takes the color of the corresponding series or point. * @default null */ - borderColor?: string | Gradient; + borderColor?: string | Gradient | null; /** * The radius of the rounded border corners. * @default 3 @@ -5723,7 +5723,7 @@ declare namespace Highcharts { * * @default null */ - crosshairs?: boolean | [boolean, boolean] | CrosshairObject | [CrosshairObject, CrosshairObject]; + crosshairs?: boolean | [boolean, boolean] | CrosshairObject | [CrosshairObject, CrosshairObject] | null; /** * Enable or disable the tooltip. * @default true diff --git a/types/highcharts/tsconfig.json b/types/highcharts/tsconfig.json index ed1e69ef0c..18d37382e5 100644 --- a/types/highcharts/tsconfig.json +++ b/types/highcharts/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/highland/tsconfig.json b/types/highland/tsconfig.json index 369326fd9f..43fea750ce 100644 --- a/types/highland/tsconfig.json +++ b/types/highland/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/highlight.js/tsconfig.json b/types/highlight.js/tsconfig.json index e3627e99ca..d13fff15ba 100644 --- a/types/highlight.js/tsconfig.json +++ b/types/highlight.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/highlight.js/v7/tsconfig.json b/types/highlight.js/v7/tsconfig.json index 10570c9f69..2c89b93acb 100644 --- a/types/highlight.js/v7/tsconfig.json +++ b/types/highlight.js/v7/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/hiredis/tsconfig.json b/types/hiredis/tsconfig.json index 927fdef018..8bc77b8339 100644 --- a/types/hiredis/tsconfig.json +++ b/types/hiredis/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/history.js/tsconfig.json b/types/history.js/tsconfig.json index 4834d24b35..1972e4113e 100644 --- a/types/history.js/tsconfig.json +++ b/types/history.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/history/tsconfig.json b/types/history/tsconfig.json index f5638c9603..2be65a13ed 100644 --- a/types/history/tsconfig.json +++ b/types/history/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/history/v2/tsconfig.json b/types/history/v2/tsconfig.json index 4ee5476d05..94e2605881 100644 --- a/types/history/v2/tsconfig.json +++ b/types/history/v2/tsconfig.json @@ -23,7 +23,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/history/v3/tsconfig.json b/types/history/v3/tsconfig.json index 2075f25a15..17f7dc237f 100644 --- a/types/history/v3/tsconfig.json +++ b/types/history/v3/tsconfig.json @@ -23,7 +23,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hjson/tsconfig.json b/types/hjson/tsconfig.json index 5e6692a9bd..e2004c8716 100644 --- a/types/hjson/tsconfig.json +++ b/types/hjson/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hls.js/tsconfig.json b/types/hls.js/tsconfig.json index ed68ee32f3..f879abb0ef 100644 --- a/types/hls.js/tsconfig.json +++ b/types/hls.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hoek/tsconfig.json b/types/hoek/tsconfig.json index 06617f251f..9cc6965f8f 100644 --- a/types/hoek/tsconfig.json +++ b/types/hoek/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/holderjs/tsconfig.json b/types/holderjs/tsconfig.json index 6cf9415ee2..b33ee1cfdb 100644 --- a/types/holderjs/tsconfig.json +++ b/types/holderjs/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "holderjs-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/hooker/tsconfig.json b/types/hooker/tsconfig.json index 446825fb97..38bc5b093c 100644 --- a/types/hooker/tsconfig.json +++ b/types/hooker/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hopscotch/tsconfig.json b/types/hopscotch/tsconfig.json index d9fb810610..c192e75957 100644 --- a/types/hopscotch/tsconfig.json +++ b/types/hopscotch/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/howler/tsconfig.json b/types/howler/tsconfig.json index 00ec7b93d7..d9f51622a8 100644 --- a/types/howler/tsconfig.json +++ b/types/howler/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hpp/hpp-tests.ts b/types/hpp/hpp-tests.ts index 21432f3d3f..8786ab702d 100644 --- a/types/hpp/hpp-tests.ts +++ b/types/hpp/hpp-tests.ts @@ -1,5 +1,5 @@ -import * as express from 'express'; -import * as hpp from 'hpp'; +import express = require('express'); +import hpp = require('hpp'); const app = express(); diff --git a/types/hpp/tsconfig.json b/types/hpp/tsconfig.json index 0193bd22d2..cbc4490a4e 100644 --- a/types/hpp/tsconfig.json +++ b/types/hpp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/html-entities/tsconfig.json b/types/html-entities/tsconfig.json index ad38016e35..57a35f13e7 100644 --- a/types/html-entities/tsconfig.json +++ b/types/html-entities/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/html-minifier/index.d.ts b/types/html-minifier/index.d.ts index 6232cb1193..c190fc4a74 100644 --- a/types/html-minifier/index.d.ts +++ b/types/html-minifier/index.d.ts @@ -33,7 +33,7 @@ export interface Options { customAttrAssign?: RegExp[]; // Regex that specifies custom attribute to strip newlines from (e.g. /ng-class/) - customAttrCollapse?: RegExp[]; + customAttrCollapse?: RegExp; // Arrays of regex'es that allow to support custom attribute surround expressions (e.g. ) customAttrSurround?: RegExp[]; diff --git a/types/html-minifier/tsconfig.json b/types/html-minifier/tsconfig.json index 129a20c71f..c8f5ba70d1 100644 --- a/types/html-minifier/tsconfig.json +++ b/types/html-minifier/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/html-minifier/v1/tsconfig.json b/types/html-minifier/v1/tsconfig.json index 8def52b67d..df85608048 100644 --- a/types/html-minifier/v1/tsconfig.json +++ b/types/html-minifier/v1/tsconfig.json @@ -13,12 +13,17 @@ "../../" ], "paths": { - "html-minifier": ["html-minifier/v1"], - "html-minifier/*": ["html-minifier/v1/*"] + "html-minifier": [ + "html-minifier/v1" + ], + "html-minifier/*": [ + "html-minifier/v1/*" + ] }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/html-pdf/tsconfig.json b/types/html-pdf/tsconfig.json index e6936f2588..225bb52929 100644 --- a/types/html-pdf/tsconfig.json +++ b/types/html-pdf/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/html-to-text/tsconfig.json b/types/html-to-text/tsconfig.json index 089a8e128e..fe209a615d 100644 --- a/types/html-to-text/tsconfig.json +++ b/types/html-to-text/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/html-webpack-plugin/html-webpack-plugin-tests.ts b/types/html-webpack-plugin/html-webpack-plugin-tests.ts index 7a1e5f20bc..b80ea9e6b0 100644 --- a/types/html-webpack-plugin/html-webpack-plugin-tests.ts +++ b/types/html-webpack-plugin/html-webpack-plugin-tests.ts @@ -1,4 +1,4 @@ -import * as HtmlWebpackPlugin from 'html-webpack-plugin'; +import HtmlWebpackPlugin = require('html-webpack-plugin'); new HtmlWebpackPlugin(); diff --git a/types/html-webpack-plugin/tsconfig.json b/types/html-webpack-plugin/tsconfig.json index 61d842ab9c..289455c231 100644 --- a/types/html-webpack-plugin/tsconfig.json +++ b/types/html-webpack-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/html-webpack-template/html-webpack-template-tests.ts b/types/html-webpack-template/html-webpack-template-tests.ts index 4407af69eb..0108aa39d8 100644 --- a/types/html-webpack-template/html-webpack-template-tests.ts +++ b/types/html-webpack-template/html-webpack-template-tests.ts @@ -1,4 +1,4 @@ -import * as HtmlWebpackPlugin from 'html-webpack-plugin'; +import HtmlWebpackPlugin = require('html-webpack-plugin'); import * as template from 'html-webpack-template'; const optionsArray: template.Options[] = [ diff --git a/types/html-webpack-template/tsconfig.json b/types/html-webpack-template/tsconfig.json index 7b0b56e459..ddc0447c74 100644 --- a/types/html-webpack-template/tsconfig.json +++ b/types/html-webpack-template/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/html2canvas/tsconfig.json b/types/html2canvas/tsconfig.json index 0fcf24b6f8..9cf08eb266 100644 --- a/types/html2canvas/tsconfig.json +++ b/types/html2canvas/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/htmlbars-inline-precompile/tsconfig.json b/types/htmlbars-inline-precompile/tsconfig.json index fd03f6a476..c3eb8ef11f 100644 --- a/types/htmlbars-inline-precompile/tsconfig.json +++ b/types/htmlbars-inline-precompile/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/htmlescape/tsconfig.json b/types/htmlescape/tsconfig.json index 581a713fff..abe0efa243 100644 --- a/types/htmlescape/tsconfig.json +++ b/types/htmlescape/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/htmlhint/tsconfig.json b/types/htmlhint/tsconfig.json index b8472efbda..c2b3078f68 100644 --- a/types/htmlhint/tsconfig.json +++ b/types/htmlhint/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/htmlparser2/tsconfig.json b/types/htmlparser2/tsconfig.json index c6ccfee7cc..c19c42d22b 100644 --- a/types/htmlparser2/tsconfig.json +++ b/types/htmlparser2/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/htmltojsx/tsconfig.json b/types/htmltojsx/tsconfig.json index 5b0fc81735..b505e65bd9 100644 --- a/types/htmltojsx/tsconfig.json +++ b/types/htmltojsx/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/http-assert/http-assert-tests.ts b/types/http-assert/http-assert-tests.ts index bfb12e650a..a0e159aeed 100644 --- a/types/http-assert/http-assert-tests.ts +++ b/types/http-assert/http-assert-tests.ts @@ -1,4 +1,4 @@ -import * as httpAssert from 'http-assert'; +import httpAssert = require('http-assert'); import { HttpError } from 'http-errors'; try { diff --git a/types/http-assert/tsconfig.json b/types/http-assert/tsconfig.json index 711327f38b..a1be51026d 100644 --- a/types/http-assert/tsconfig.json +++ b/types/http-assert/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/http-aws-es/tsconfig.json b/types/http-aws-es/tsconfig.json index 5d248f0375..44140847bb 100644 --- a/types/http-aws-es/tsconfig.json +++ b/types/http-aws-es/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/http-codes/tsconfig.json b/types/http-codes/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/http-codes/tsconfig.json +++ b/types/http-codes/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/http-context/tsconfig.json b/types/http-context/tsconfig.json index 51422e3199..ade1021328 100644 --- a/types/http-context/tsconfig.json +++ b/types/http-context/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "http-context-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/http-errors/http-errors-tests.ts b/types/http-errors/http-errors-tests.ts index c3677fd5f9..583223d6a4 100644 --- a/types/http-errors/http-errors-tests.ts +++ b/types/http-errors/http-errors-tests.ts @@ -1,5 +1,5 @@ -import * as create from 'http-errors'; -import * as express from 'express'; +import create = require('http-errors'); +import express = require('express'); import * as util from 'util'; const app = express(); diff --git a/types/http-errors/tsconfig.json b/types/http-errors/tsconfig.json index 430bec9565..62465b68e8 100644 --- a/types/http-errors/tsconfig.json +++ b/types/http-errors/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/http-link-header/tsconfig.json b/types/http-link-header/tsconfig.json index 3acfe11a33..3094403bb9 100644 --- a/types/http-link-header/tsconfig.json +++ b/types/http-link-header/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/http-proxy-agent/tsconfig.json b/types/http-proxy-agent/tsconfig.json index 626d4eaa4c..f0e1f42aee 100644 --- a/types/http-proxy-agent/tsconfig.json +++ b/types/http-proxy-agent/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "http-proxy-agent-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/http-proxy-middleware/tsconfig.json b/types/http-proxy-middleware/tsconfig.json index 459138e584..714fe3ca42 100644 --- a/types/http-proxy-middleware/tsconfig.json +++ b/types/http-proxy-middleware/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/http-proxy/http-proxy-tests.ts b/types/http-proxy/http-proxy-tests.ts index e691b48ed0..70ea803da6 100644 --- a/types/http-proxy/http-proxy-tests.ts +++ b/types/http-proxy/http-proxy-tests.ts @@ -1,5 +1,5 @@ import * as http from "http"; -import * as HttpProxy from "http-proxy"; +import HttpProxy = require("http-proxy"); const proxy = new HttpProxy({ changeOrigin: true diff --git a/types/http-proxy/index.d.ts b/types/http-proxy/index.d.ts index 962a9ecdb6..811789af33 100644 --- a/types/http-proxy/index.d.ts +++ b/types/http-proxy/index.d.ts @@ -197,6 +197,8 @@ declare namespace Server { autoRewrite?: boolean; /** Rewrites the location protocol on (301 / 302 / 307 / 308) redirects to 'http' or 'https'.Default: null. */ protocolRewrite?: string; + /** Timeout (in milliseconds) when proxy receives no response from target. Default: 120000 (2 minutes) */ + proxyTimeout?: number; } } diff --git a/types/http-proxy/tsconfig.json b/types/http-proxy/tsconfig.json index 24a9ed6c48..e8895667f5 100644 --- a/types/http-proxy/tsconfig.json +++ b/types/http-proxy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/http-server/tsconfig.json b/types/http-server/tsconfig.json index 98f006389c..1b90c09fa0 100644 --- a/types/http-server/tsconfig.json +++ b/types/http-server/tsconfig.json @@ -14,10 +14,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ "index.d.ts", "http-server-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/http-status/tsconfig.json b/types/http-status/tsconfig.json index acb7f89cde..2a9f60f0c2 100644 --- a/types/http-status/tsconfig.json +++ b/types/http-status/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/http-string-parser/tsconfig.json b/types/http-string-parser/tsconfig.json index 80f7cd176a..82cb0405e7 100644 --- a/types/http-string-parser/tsconfig.json +++ b/types/http-string-parser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/httperr/tsconfig.json b/types/httperr/tsconfig.json index 85505edbc8..ef117164fb 100644 --- a/types/httperr/tsconfig.json +++ b/types/httperr/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hubot/tsconfig.json b/types/hubot/tsconfig.json index 9354cf926c..8dbed319d9 100644 --- a/types/hubot/tsconfig.json +++ b/types/hubot/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hubspot-pace/tsconfig.json b/types/hubspot-pace/tsconfig.json index 1d2a2ec99e..f2c9f738e6 100644 --- a/types/hubspot-pace/tsconfig.json +++ b/types/hubspot-pace/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/humane/tsconfig.json b/types/humane/tsconfig.json index 7b2fc3e81b..02cee5bec2 100644 --- a/types/humane/tsconfig.json +++ b/types/humane/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/humanize-plus/tsconfig.json b/types/humanize-plus/tsconfig.json index 37b195e2cd..674bdb64f5 100644 --- a/types/humanize-plus/tsconfig.json +++ b/types/humanize-plus/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/humanize-string/humanize-string-tests.ts b/types/humanize-string/humanize-string-tests.ts new file mode 100644 index 0000000000..851746f088 --- /dev/null +++ b/types/humanize-string/humanize-string-tests.ts @@ -0,0 +1,4 @@ +import humanizeString = require('humanize-string'); + +humanizeString('UnicornsAndRainbows'); +humanizeString('unicorns_and-Rainbows_andPonies '); diff --git a/types/humanize-string/index.d.ts b/types/humanize-string/index.d.ts new file mode 100644 index 0000000000..ba8bc4e867 --- /dev/null +++ b/types/humanize-string/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for humanize-string 1.0 +// Project: https://github.com/sindresorhus/humanize-string/ +// Definitions by: Kevin Nacios +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function humanizeString(text: string): string; + +export = humanizeString; diff --git a/types/humanize-string/tsconfig.json b/types/humanize-string/tsconfig.json new file mode 100644 index 0000000000..2b97ea796b --- /dev/null +++ b/types/humanize-string/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "humanize-string-tests.ts" + ] +} \ No newline at end of file diff --git a/types/humanize-string/tslint.json b/types/humanize-string/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/humanize-string/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/humanparser/tsconfig.json b/types/humanparser/tsconfig.json index 1e12c171d0..3b7ed6be21 100644 --- a/types/humanparser/tsconfig.json +++ b/types/humanparser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/humps/tsconfig.json b/types/humps/tsconfig.json index ec1866d58c..79c40ebc87 100644 --- a/types/humps/tsconfig.json +++ b/types/humps/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hyco-ws/tsconfig.json b/types/hyco-ws/tsconfig.json index cc21647f01..468a3e9c69 100644 --- a/types/hyco-ws/tsconfig.json +++ b/types/hyco-ws/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hyperscript/tsconfig.json b/types/hyperscript/tsconfig.json index dcd78c9f85..733e14bcda 100644 --- a/types/hyperscript/tsconfig.json +++ b/types/hyperscript/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hypertext-application-language/tsconfig.json b/types/hypertext-application-language/tsconfig.json index 15621fa9c2..9c01e0594f 100644 --- a/types/hypertext-application-language/tsconfig.json +++ b/types/hypertext-application-language/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hystrixjs/tsconfig.json b/types/hystrixjs/tsconfig.json index 480476e8d1..d534470204 100644 --- a/types/hystrixjs/tsconfig.json +++ b/types/hystrixjs/tsconfig.json @@ -16,10 +16,11 @@ "paths": {}, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "hystrixjs-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/i18n-js/tsconfig.json b/types/i18n-js/tsconfig.json index 4a9e4d110b..128a7ad06d 100644 --- a/types/i18n-js/tsconfig.json +++ b/types/i18n-js/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "i18n-js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/i18n/tsconfig.json b/types/i18n/tsconfig.json index 4429a81fe6..4d7bacf4d0 100644 --- a/types/i18n/tsconfig.json +++ b/types/i18n/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/i18next-browser-languagedetector/tsconfig.json b/types/i18next-browser-languagedetector/tsconfig.json index 32755315aa..879c1d7ac7 100644 --- a/types/i18next-browser-languagedetector/tsconfig.json +++ b/types/i18next-browser-languagedetector/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/i18next-browser-languagedetector/v0/tsconfig.json b/types/i18next-browser-languagedetector/v0/tsconfig.json index 9873c74134..5396feadd6 100644 --- a/types/i18next-browser-languagedetector/v0/tsconfig.json +++ b/types/i18next-browser-languagedetector/v0/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/i18next-express-middleware/i18next-express-middleware-tests.ts b/types/i18next-express-middleware/i18next-express-middleware-tests.ts index d56f7a9207..9959cf9dad 100644 --- a/types/i18next-express-middleware/i18next-express-middleware-tests.ts +++ b/types/i18next-express-middleware/i18next-express-middleware-tests.ts @@ -1,4 +1,4 @@ -import * as express from "express"; +import express = require("express"); import * as i18next from "i18next"; import middleware = require("i18next-express-middleware"); diff --git a/types/i18next-express-middleware/tsconfig.json b/types/i18next-express-middleware/tsconfig.json index 5a13f1733d..43460aefe2 100644 --- a/types/i18next-express-middleware/tsconfig.json +++ b/types/i18next-express-middleware/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/i18next-node-fs-backend/tsconfig.json b/types/i18next-node-fs-backend/tsconfig.json index 03b3347068..f0f6ba8147 100644 --- a/types/i18next-node-fs-backend/tsconfig.json +++ b/types/i18next-node-fs-backend/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/i18next-sprintf-postprocessor/tsconfig.json b/types/i18next-sprintf-postprocessor/tsconfig.json index 9a52882abe..af3f004099 100644 --- a/types/i18next-sprintf-postprocessor/tsconfig.json +++ b/types/i18next-sprintf-postprocessor/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/i18next-xhr-backend/tsconfig.json b/types/i18next-xhr-backend/tsconfig.json index a7ca4c2adb..7c48abd709 100644 --- a/types/i18next-xhr-backend/tsconfig.json +++ b/types/i18next-xhr-backend/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/i18next/index.d.ts b/types/i18next/index.d.ts index c510d824eb..61b59b32e1 100644 --- a/types/i18next/index.d.ts +++ b/types/i18next/index.d.ts @@ -103,6 +103,11 @@ declare namespace i18next { * set it to fallback to let passed namespaces to translated hoc act as fallbacks */ nsMode?: string; + /** + * set it to the default parent element created by the Trans component. + * @default div + */ + defaultTransParent?: string; } interface InitOptions { diff --git a/types/i18next/tsconfig.json b/types/i18next/tsconfig.json index 9eadf37b0f..b37ad92b9d 100644 --- a/types/i18next/tsconfig.json +++ b/types/i18next/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/i18next/v2/tsconfig.json b/types/i18next/v2/tsconfig.json index 00464c1701..1533066fbb 100644 --- a/types/i18next/v2/tsconfig.json +++ b/types/i18next/v2/tsconfig.json @@ -24,6 +24,7 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/i2c-bus/tsconfig.json b/types/i2c-bus/tsconfig.json index 8407ea3efd..081ba2a5a6 100644 --- a/types/i2c-bus/tsconfig.json +++ b/types/i2c-bus/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "../async/index.d.ts", diff --git a/types/iban/tsconfig.json b/types/iban/tsconfig.json index 352470aa0d..2e7f860867 100644 --- a/types/iban/tsconfig.json +++ b/types/iban/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ibm-mobilefirst/tsconfig.json b/types/ibm-mobilefirst/tsconfig.json index eabcd34447..83ab44c9d5 100644 --- a/types/ibm-mobilefirst/tsconfig.json +++ b/types/ibm-mobilefirst/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ibm_db/tsconfig.json b/types/ibm_db/tsconfig.json index f92b637034..4b69bc8c6b 100644 --- a/types/ibm_db/tsconfig.json +++ b/types/ibm_db/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/icepick/tsconfig.json b/types/icepick/tsconfig.json index 530031866b..93540a1c5f 100644 --- a/types/icepick/tsconfig.json +++ b/types/icepick/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/icheck/tsconfig.json b/types/icheck/tsconfig.json index b700077c47..0ec895d526 100644 --- a/types/icheck/tsconfig.json +++ b/types/icheck/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/iconv/tsconfig.json b/types/iconv/tsconfig.json index b97ea1a7f3..78bd76e835 100644 --- a/types/iconv/tsconfig.json +++ b/types/iconv/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ids/tsconfig.json b/types/ids/tsconfig.json index 1c739774db..c9e212f3ee 100644 --- a/types/ids/tsconfig.json +++ b/types/ids/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/iframe-resizer/index.d.ts b/types/iframe-resizer/index.d.ts index 8d65629da6..70d9c1d4f3 100644 --- a/types/iframe-resizer/index.d.ts +++ b/types/iframe-resizer/index.d.ts @@ -37,7 +37,7 @@ export interface IFrameOptions { * If your iFrame navigates between different domains, ports or protocols; then you will need to * provide an array of URLs or disable this option. */ - checkOrigin?: boolean; + checkOrigin?: boolean | string[]; /** * When enabled in page linking inside the iFrame and from the iFrame to the parent page will be enabled. */ diff --git a/types/iframe-resizer/tsconfig.json b/types/iframe-resizer/tsconfig.json index e8a87f1302..7962a0d413 100644 --- a/types/iframe-resizer/tsconfig.json +++ b/types/iframe-resizer/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "exclude": [ "node_modules" diff --git a/types/ignite-ui/tsconfig.json b/types/ignite-ui/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/ignite-ui/tsconfig.json +++ b/types/ignite-ui/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/ignore-styles/tsconfig.json b/types/ignore-styles/tsconfig.json index aed3487cf4..36263af6ad 100644 --- a/types/ignore-styles/tsconfig.json +++ b/types/ignore-styles/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ignore-styles-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/iltorb/tsconfig.json b/types/iltorb/tsconfig.json index c12ff988ba..0c553243a8 100644 --- a/types/iltorb/tsconfig.json +++ b/types/iltorb/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "iltorb-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/image-size/image-size-tests.ts b/types/image-size/image-size-tests.ts index 983389091e..058ed7934f 100644 --- a/types/image-size/image-size-tests.ts +++ b/types/image-size/image-size-tests.ts @@ -1,7 +1,6 @@ - import * as url from "url"; import * as http from "http"; -import * as sizeOf from "image-size"; +import sizeOf = require("image-size"); // Synchronous const dimensions = sizeOf("images/funny-cats.png"); diff --git a/types/image-size/tsconfig.json b/types/image-size/tsconfig.json index 7a864603b7..009a4c9175 100644 --- a/types/image-size/tsconfig.json +++ b/types/image-size/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/imagemagick-native/tsconfig.json b/types/imagemagick-native/tsconfig.json index bfd2f88451..c96e9d4a44 100644 --- a/types/imagemagick-native/tsconfig.json +++ b/types/imagemagick-native/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/imagemagick/tsconfig.json b/types/imagemagick/tsconfig.json index 3a28cb5c59..cbbc1c0d83 100644 --- a/types/imagemagick/tsconfig.json +++ b/types/imagemagick/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/imagemapster/tsconfig.json b/types/imagemapster/tsconfig.json index cb5e3bdff8..3198a00bc4 100644 --- a/types/imagemapster/tsconfig.json +++ b/types/imagemapster/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/images/images-tests.ts b/types/images/images-tests.ts index f7ba58d68d..9b6db2d1b2 100644 --- a/types/images/images-tests.ts +++ b/types/images/images-tests.ts @@ -1,4 +1,4 @@ -import * as images from "images"; +import images = require("images"); // from https://github.com/zhangyuanwei/node-images/blob/master/demo/uploadServer.js const tmp_path = "tmp_path"; diff --git a/types/images/tsconfig.json b/types/images/tsconfig.json index 75c7b85340..368e3b87b5 100644 --- a/types/images/tsconfig.json +++ b/types/images/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/imagesloaded/tsconfig.json b/types/imagesloaded/tsconfig.json index 0673d1eaa2..a9ae36e077 100644 --- a/types/imagesloaded/tsconfig.json +++ b/types/imagesloaded/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/imap-simple/tsconfig.json b/types/imap-simple/tsconfig.json index 859835549a..257a2ee006 100644 --- a/types/imap-simple/tsconfig.json +++ b/types/imap-simple/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/imap/tsconfig.json b/types/imap/tsconfig.json index 987167daf3..655a1f4c54 100644 --- a/types/imap/tsconfig.json +++ b/types/imap/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/imgur-rest-api/tsconfig.json b/types/imgur-rest-api/tsconfig.json index f2803640de..4835091ddb 100644 --- a/types/imgur-rest-api/tsconfig.json +++ b/types/imgur-rest-api/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/impress/tsconfig.json b/types/impress/tsconfig.json index a278db24c9..82aafbc612 100644 --- a/types/impress/tsconfig.json +++ b/types/impress/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/in-range/tsconfig.json b/types/in-range/tsconfig.json index 7d5182a929..0261e63a92 100644 --- a/types/in-range/tsconfig.json +++ b/types/in-range/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/incremental-dom/tsconfig.json b/types/incremental-dom/tsconfig.json index 8ba7d824d5..d5ffa268df 100644 --- a/types/incremental-dom/tsconfig.json +++ b/types/incremental-dom/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/indent-string/tsconfig.json b/types/indent-string/tsconfig.json index 4f2e008801..d9d3db42a6 100644 --- a/types/indent-string/tsconfig.json +++ b/types/indent-string/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/inert/tsconfig.json b/types/inert/tsconfig.json index da982b9122..feda976404 100644 --- a/types/inert/tsconfig.json +++ b/types/inert/tsconfig.json @@ -14,13 +14,16 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "inert-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/inflected/tsconfig.json b/types/inflected/tsconfig.json index b0a3a1d8b5..ce1b449bd6 100644 --- a/types/inflected/tsconfig.json +++ b/types/inflected/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/inflection/tsconfig.json b/types/inflection/tsconfig.json index e77c4028fc..097bf72f01 100644 --- a/types/inflection/tsconfig.json +++ b/types/inflection/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/inherits/tsconfig.json b/types/inherits/tsconfig.json index bdb4c4d873..f0bc28d26b 100644 --- a/types/inherits/tsconfig.json +++ b/types/inherits/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ini/tsconfig.json b/types/ini/tsconfig.json index ccc924b3fc..a2d9575bec 100644 --- a/types/ini/tsconfig.json +++ b/types/ini/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/iniparser/tsconfig.json b/types/iniparser/tsconfig.json index 0d7970f93a..2dbbf3ac60 100644 --- a/types/iniparser/tsconfig.json +++ b/types/iniparser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/inline-css/tsconfig.json b/types/inline-css/tsconfig.json index 4a13506061..83f7ce2a21 100644 --- a/types/inline-css/tsconfig.json +++ b/types/inline-css/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/inline-style-prefixer/tsconfig.json b/types/inline-style-prefixer/tsconfig.json index 7d6d4209bc..7ed78cd882 100644 --- a/types/inline-style-prefixer/tsconfig.json +++ b/types/inline-style-prefixer/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/inquirer/tsconfig.json b/types/inquirer/tsconfig.json index 59793a86a1..132e52a694 100644 --- a/types/inquirer/tsconfig.json +++ b/types/inquirer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/insert-module-globals/tsconfig.json b/types/insert-module-globals/tsconfig.json index a9b4f218da..4f6dc79b6c 100644 --- a/types/insert-module-globals/tsconfig.json +++ b/types/insert-module-globals/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/insight/tsconfig.json b/types/insight/tsconfig.json index 7efb108eae..c90e8883c8 100644 --- a/types/insight/tsconfig.json +++ b/types/insight/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/integer/tsconfig.json b/types/integer/tsconfig.json index 60e0921a42..d8ff5490d1 100644 --- a/types/integer/tsconfig.json +++ b/types/integer/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/interact.js/tsconfig.json b/types/interact.js/tsconfig.json index 6d4887d0f1..ec69c04168 100644 --- a/types/interact.js/tsconfig.json +++ b/types/interact.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/intercom-web/index.d.ts b/types/intercom-web/index.d.ts index 1eb038bd07..a0b4e71015 100755 --- a/types/intercom-web/index.d.ts +++ b/types/intercom-web/index.d.ts @@ -8,9 +8,11 @@ declare namespace Intercom_ { interface IntercomSettings { + alignment?: string; app_id?: string; email?: string; created_at?: number; + hide_default_launcher?: boolean; name?: string; user_id?: string; user_hash?: string; diff --git a/types/intercom-web/tsconfig.json b/types/intercom-web/tsconfig.json index d77c89a53f..a6dafc828c 100755 --- a/types/intercom-web/tsconfig.json +++ b/types/intercom-web/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/intercomjs/tsconfig.json b/types/intercomjs/tsconfig.json index a74351a03a..e04592b241 100644 --- a/types/intercomjs/tsconfig.json +++ b/types/intercomjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/internal-ip/tsconfig.json b/types/internal-ip/tsconfig.json index 746718e07c..68e01ce09d 100644 --- a/types/internal-ip/tsconfig.json +++ b/types/internal-ip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/intl-messageformat/tsconfig.json b/types/intl-messageformat/tsconfig.json index 61f9873265..5fa45ea6b4 100644 --- a/types/intl-messageformat/tsconfig.json +++ b/types/intl-messageformat/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/intl-tel-input/tsconfig.json b/types/intl-tel-input/tsconfig.json index 380d60229d..47bfb5d532 100644 --- a/types/intl-tel-input/tsconfig.json +++ b/types/intl-tel-input/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/intl-tel-input/tslint.json b/types/intl-tel-input/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/intl-tel-input/tslint.json +++ b/types/intl-tel-input/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/intl/tsconfig.json b/types/intl/tsconfig.json index 30370fd405..e387d699b0 100644 --- a/types/intl/tsconfig.json +++ b/types/intl/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/into-stream/tsconfig.json b/types/into-stream/tsconfig.json index cc8a2cfa00..78424ed386 100644 --- a/types/into-stream/tsconfig.json +++ b/types/into-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/intro.js/tsconfig.json b/types/intro.js/tsconfig.json index c86cbffec5..6f17df93d2 100644 --- a/types/intro.js/tsconfig.json +++ b/types/intro.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/invariant/tsconfig.json b/types/invariant/tsconfig.json index 1cd411b7f4..b9835c8ee2 100644 --- a/types/invariant/tsconfig.json +++ b/types/invariant/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/inversify-devtools/tsconfig.json b/types/inversify-devtools/tsconfig.json index 4883fdc99e..43d9c7f198 100644 --- a/types/inversify-devtools/tsconfig.json +++ b/types/inversify-devtools/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ion.rangeslider/tsconfig.json b/types/ion.rangeslider/tsconfig.json index 1affa9f527..8fa4b00b02 100644 --- a/types/ion.rangeslider/tsconfig.json +++ b/types/ion.rangeslider/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ion.rangeslider/v1/tsconfig.json b/types/ion.rangeslider/v1/tsconfig.json index c63da8c0e1..d567b18c5d 100644 --- a/types/ion.rangeslider/v1/tsconfig.json +++ b/types/ion.rangeslider/v1/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ioredis/ioredis-tests.ts b/types/ioredis/ioredis-tests.ts index 2e80cd80e4..d8106ecdea 100644 --- a/types/ioredis/ioredis-tests.ts +++ b/types/ioredis/ioredis-tests.ts @@ -1,4 +1,4 @@ -import * as Redis from "ioredis"; +import Redis = require("ioredis"); const redis = new Redis(); redis.set('foo', 'bar'); diff --git a/types/ioredis/tsconfig.json b/types/ioredis/tsconfig.json index f073160729..7b17a6e338 100644 --- a/types/ioredis/tsconfig.json +++ b/types/ioredis/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/iota.lib.js/tsconfig.json b/types/iota.lib.js/tsconfig.json index b206b83455..5bb248e6c2 100644 --- a/types/iota.lib.js/tsconfig.json +++ b/types/iota.lib.js/tsconfig.json @@ -1,23 +1,24 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "iota.lib.js-tests.ts" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "iota.lib.js-tests.ts" + ] } \ No newline at end of file diff --git a/types/ip-regex/tsconfig.json b/types/ip-regex/tsconfig.json index e09382966a..e3c27d39a7 100644 --- a/types/ip-regex/tsconfig.json +++ b/types/ip-regex/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ip/tsconfig.json b/types/ip/tsconfig.json index a445ebefe8..f6610d99f5 100644 --- a/types/ip/tsconfig.json +++ b/types/ip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/irc/tsconfig.json b/types/irc/tsconfig.json index ac224646a3..ba8bd73ab1 100644 --- a/types/irc/tsconfig.json +++ b/types/irc/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/iron/tsconfig.json b/types/iron/tsconfig.json index bddeeac5c0..e0ee70fb95 100644 --- a/types/iron/tsconfig.json +++ b/types/iron/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "iron-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/is-absolute-url/tsconfig.json b/types/is-absolute-url/tsconfig.json index 57c46bb32b..b53f33f8d0 100644 --- a/types/is-absolute-url/tsconfig.json +++ b/types/is-absolute-url/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-alphanumerical/tsconfig.json b/types/is-alphanumerical/tsconfig.json index 90b83f80fb..a0e28cd6c8 100644 --- a/types/is-alphanumerical/tsconfig.json +++ b/types/is-alphanumerical/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-archive/tsconfig.json b/types/is-archive/tsconfig.json index ce2b001789..992c7f96ab 100644 --- a/types/is-archive/tsconfig.json +++ b/types/is-archive/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-array/tsconfig.json b/types/is-array/tsconfig.json index 022fbc852e..32aaeff9f4 100644 --- a/types/is-array/tsconfig.json +++ b/types/is-array/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-binary-path/tsconfig.json b/types/is-binary-path/tsconfig.json index e0fd45ed1e..e497433304 100644 --- a/types/is-binary-path/tsconfig.json +++ b/types/is-binary-path/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-compressed/tsconfig.json b/types/is-compressed/tsconfig.json index b44edb3059..b90ecf1883 100644 --- a/types/is-compressed/tsconfig.json +++ b/types/is-compressed/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-finite/tsconfig.json b/types/is-finite/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/is-finite/tsconfig.json +++ b/types/is-finite/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/is-glob/tsconfig.json b/types/is-glob/tsconfig.json index 1a408fe456..5fc85d6db2 100644 --- a/types/is-glob/tsconfig.json +++ b/types/is-glob/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "is-glob-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/is-ip/tsconfig.json b/types/is-ip/tsconfig.json index ea49885cbb..32c6d2baf7 100644 --- a/types/is-ip/tsconfig.json +++ b/types/is-ip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-my-json-valid/tsconfig.json b/types/is-my-json-valid/tsconfig.json index 687e2a6c57..13eedc22b1 100644 --- a/types/is-my-json-valid/tsconfig.json +++ b/types/is-my-json-valid/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-negated-glob/tsconfig.json b/types/is-negated-glob/tsconfig.json index 9f8db73020..1083f6370c 100644 --- a/types/is-negated-glob/tsconfig.json +++ b/types/is-negated-glob/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "is-negated-glob-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/is-number/tsconfig.json b/types/is-number/tsconfig.json index 930df6698f..4eda636727 100644 --- a/types/is-number/tsconfig.json +++ b/types/is-number/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-object/tsconfig.json b/types/is-object/tsconfig.json index b3aae5340b..319385646a 100644 --- a/types/is-object/tsconfig.json +++ b/types/is-object/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "is-object-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/is-path-cwd/tsconfig.json b/types/is-path-cwd/tsconfig.json index 6f5a83c33d..0857fc254c 100644 --- a/types/is-path-cwd/tsconfig.json +++ b/types/is-path-cwd/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-path-in-cwd/tsconfig.json b/types/is-path-in-cwd/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/is-path-in-cwd/tsconfig.json +++ b/types/is-path-in-cwd/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/is-promise/tsconfig.json b/types/is-promise/tsconfig.json index fbc17a9140..62f75e7230 100644 --- a/types/is-promise/tsconfig.json +++ b/types/is-promise/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/is-relative-url/tsconfig.json b/types/is-relative-url/tsconfig.json index 1a85dcf51a..3304129cf5 100644 --- a/types/is-relative-url/tsconfig.json +++ b/types/is-relative-url/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-root-path/tsconfig.json b/types/is-root-path/tsconfig.json index 28d7f23893..32de5659e2 100644 --- a/types/is-root-path/tsconfig.json +++ b/types/is-root-path/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-root/tsconfig.json b/types/is-root/tsconfig.json index a92ff73369..2ec96b7950 100644 --- a/types/is-root/tsconfig.json +++ b/types/is-root/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-scoped/tsconfig.json b/types/is-scoped/tsconfig.json index e6ffa2ab86..e7cd6d168f 100644 --- a/types/is-scoped/tsconfig.json +++ b/types/is-scoped/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "is-scoped-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/is-stream/tsconfig.json b/types/is-stream/tsconfig.json index 061e555f72..711f3e885b 100644 --- a/types/is-stream/tsconfig.json +++ b/types/is-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-svg/tsconfig.json b/types/is-svg/tsconfig.json index 2621a88907..ee19bf61d4 100644 --- a/types/is-svg/tsconfig.json +++ b/types/is-svg/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-text-path/tsconfig.json b/types/is-text-path/tsconfig.json index e6587abf96..f68781ca5a 100644 --- a/types/is-text-path/tsconfig.json +++ b/types/is-text-path/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-url-superb/tsconfig.json b/types/is-url-superb/tsconfig.json index 3450e58a06..5af295cadb 100644 --- a/types/is-url-superb/tsconfig.json +++ b/types/is-url-superb/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-url/tsconfig.json b/types/is-url/tsconfig.json index 56f15b7e2f..a7c0ef487f 100644 --- a/types/is-url/tsconfig.json +++ b/types/is-url/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-windows/tsconfig.json b/types/is-windows/tsconfig.json index 8696d92fe0..36ec2df909 100644 --- a/types/is-windows/tsconfig.json +++ b/types/is-windows/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is/tsconfig.json b/types/is/tsconfig.json index 9abe3bbe43..90cdd21fd2 100644 --- a/types/is/tsconfig.json +++ b/types/is/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/isbn-utils/tsconfig.json b/types/isbn-utils/tsconfig.json index 9414c7c040..0077524e45 100644 --- a/types/isbn-utils/tsconfig.json +++ b/types/isbn-utils/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/iscroll/tsconfig.json b/types/iscroll/tsconfig.json index 7a1ec2a51b..b7dad3520e 100644 --- a/types/iscroll/tsconfig.json +++ b/types/iscroll/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/iscroll/v4/tsconfig.json b/types/iscroll/v4/tsconfig.json index 2b09269531..4e6115127e 100644 --- a/types/iscroll/v4/tsconfig.json +++ b/types/iscroll/v4/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ismobilejs/index.d.ts b/types/ismobilejs/index.d.ts index c0f7c4ec8b..18eee7ea1a 100644 --- a/types/ismobilejs/index.d.ts +++ b/types/ismobilejs/index.d.ts @@ -3,41 +3,55 @@ // Definitions by: Maksim Karelov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export const any: boolean; -export const phone: boolean; -export const tablet: boolean; -export const seven_inch: boolean; +interface Apple { + phone: boolean; + ipod: boolean; + tablet: boolean; + device: boolean; +} -export const apple: { - phone: boolean; - ipod: boolean; - tablet: boolean; - device: boolean; -}; +interface Android { + phone: boolean; + tablet: boolean; + device: boolean; +} -export const android: { - phone: boolean; - tablet: boolean; - device: boolean; -}; +interface Amazon { + phone: boolean; + tablet: boolean; + device: boolean; +} -export const amazon: { - phone: boolean; - tablet: boolean; - device: boolean; -}; +interface Windows { + phone: boolean; + tablet: boolean; + device: boolean; +} -export const windows: { - phone: boolean; - tablet: boolean; - device: boolean; -}; +interface Other { + blackberry_10: boolean; + blackberry: boolean; + opera: boolean; + firefox: boolean; + chrome: boolean; + device: boolean; +} -export const other: { - blackberry_10: boolean; - blackberry: boolean; - opera: boolean; - firefox: boolean; - chrome: boolean; - device: boolean; -}; +interface IsMobile { + any: boolean; + phone: boolean; + tablet: boolean; + seven_inch: boolean; + + apple: Apple; + android: Android; + amazon: Amazon; + windows: Windows; + other: Other; + + (userAgent?: string): IsMobile; +} + +declare const isMobile: IsMobile; + +export = isMobile; diff --git a/types/ismobilejs/ismobilejs-tests.ts b/types/ismobilejs/ismobilejs-tests.ts index e69de29bb2..d53c674da9 100644 --- a/types/ismobilejs/ismobilejs-tests.ts +++ b/types/ismobilejs/ismobilejs-tests.ts @@ -0,0 +1,19 @@ +import * as isMobile from 'ismobilejs'; + +const MOZILLA_ANDROID_UA = 'Mozilla/5.0 (Android 4.4; Mobile; rv:41.0) Gecko/41.0 Firefox/41.0'; +const MOZILLA_IPHONE_UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/600.1.4'; + +const CHROME_ANDROID_UA = 'Mozilla/5.0 (Linux; Android 8.0.0; Pixel Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.66 Mobile Safari/537.36'; +const CHROME_IPHONE_UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.75 Mobile/14E5239e Safari/602.1'; + +// $ExpectType boolean +isMobile(MOZILLA_ANDROID_UA).android.phone; +// $ExpectType boolean +isMobile(MOZILLA_IPHONE_UA).apple.phone; + +// $ExpectType boolean +isMobile(CHROME_ANDROID_UA).android.phone; +// $ExpectType boolean +isMobile(CHROME_IPHONE_UA).apple.phone; + +console.log(isMobile.apple); diff --git a/types/ismobilejs/tsconfig.json b/types/ismobilejs/tsconfig.json index 3e3a1071d3..748e1fff6f 100644 --- a/types/ismobilejs/tsconfig.json +++ b/types/ismobilejs/tsconfig.json @@ -2,21 +2,24 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ismobilejs-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/iso-3166-2/tsconfig.json b/types/iso-3166-2/tsconfig.json index 0e374a83fc..2cdbb59c54 100644 --- a/types/iso-3166-2/tsconfig.json +++ b/types/iso-3166-2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/iso8601-localizer/tsconfig.json b/types/iso8601-localizer/tsconfig.json index e245ca21c0..01a65dcdc4 100644 --- a/types/iso8601-localizer/tsconfig.json +++ b/types/iso8601-localizer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/isomorphic-fetch/tsconfig.json b/types/isomorphic-fetch/tsconfig.json index f3cc715548..08c197c40f 100644 --- a/types/isomorphic-fetch/tsconfig.json +++ b/types/isomorphic-fetch/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/isotope-layout/tsconfig.json b/types/isotope-layout/tsconfig.json index 8afefdbd01..50c41ebda1 100644 --- a/types/isotope-layout/tsconfig.json +++ b/types/isotope-layout/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/istanbul-lib-coverage/tsconfig.json b/types/istanbul-lib-coverage/tsconfig.json index 433ba89644..76754f3471 100644 --- a/types/istanbul-lib-coverage/tsconfig.json +++ b/types/istanbul-lib-coverage/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/istanbul-lib-hook/tsconfig.json b/types/istanbul-lib-hook/tsconfig.json index c010a0879b..45ad7e8ff7 100644 --- a/types/istanbul-lib-hook/tsconfig.json +++ b/types/istanbul-lib-hook/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/istanbul-lib-instrument/tsconfig.json b/types/istanbul-lib-instrument/tsconfig.json index 60629254a0..751abe74b0 100644 --- a/types/istanbul-lib-instrument/tsconfig.json +++ b/types/istanbul-lib-instrument/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/istanbul-lib-report/tsconfig.json b/types/istanbul-lib-report/tsconfig.json index 782aa1860c..644e91130d 100644 --- a/types/istanbul-lib-report/tsconfig.json +++ b/types/istanbul-lib-report/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/istanbul-lib-source-maps/tsconfig.json b/types/istanbul-lib-source-maps/tsconfig.json index ca94b106d7..9f1c37f7d7 100644 --- a/types/istanbul-lib-source-maps/tsconfig.json +++ b/types/istanbul-lib-source-maps/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/istanbul-middleware/tsconfig.json b/types/istanbul-middleware/tsconfig.json index 3bba961c04..153ab73a0e 100644 --- a/types/istanbul-middleware/tsconfig.json +++ b/types/istanbul-middleware/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/istanbul-reports/tsconfig.json b/types/istanbul-reports/tsconfig.json index 1f43d5038d..51c7eb3d46 100644 --- a/types/istanbul-reports/tsconfig.json +++ b/types/istanbul-reports/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/istanbul/tsconfig.json b/types/istanbul/tsconfig.json index 723eb394c5..ab009bb79a 100644 --- a/types/istanbul/tsconfig.json +++ b/types/istanbul/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ityped/tsconfig.json b/types/ityped/tsconfig.json index 2f2ceabe67..5530043548 100644 --- a/types/ityped/tsconfig.json +++ b/types/ityped/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ix.js/tsconfig.json b/types/ix.js/tsconfig.json index c840c77d73..3196f7e1c3 100644 --- a/types/ix.js/tsconfig.json +++ b/types/ix.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jade/tsconfig.json b/types/jade/tsconfig.json index f1c2b94f05..b7a356ca2f 100644 --- a/types/jade/tsconfig.json +++ b/types/jade/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jake/tsconfig.json b/types/jake/tsconfig.json index 5a5e5fcbd8..0f6b6131c4 100644 --- a/types/jake/tsconfig.json +++ b/types/jake/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jalaali-js/tsconfig.json b/types/jalaali-js/tsconfig.json index 995b501496..baf80ea66d 100644 --- a/types/jalaali-js/tsconfig.json +++ b/types/jalaali-js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/japanese-holidays/tsconfig.json b/types/japanese-holidays/tsconfig.json index 1d8aeb27d0..44daea5b5c 100644 --- a/types/japanese-holidays/tsconfig.json +++ b/types/japanese-holidays/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine-ajax/tsconfig.json b/types/jasmine-ajax/tsconfig.json index 01c73a745d..a0fc138c79 100644 --- a/types/jasmine-ajax/tsconfig.json +++ b/types/jasmine-ajax/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine-data_driven_tests/tsconfig.json b/types/jasmine-data_driven_tests/tsconfig.json index 232e012191..1e82970117 100644 --- a/types/jasmine-data_driven_tests/tsconfig.json +++ b/types/jasmine-data_driven_tests/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine-enzyme/tsconfig.json b/types/jasmine-enzyme/tsconfig.json index 6b63fe9694..bf83f1b6f4 100644 --- a/types/jasmine-enzyme/tsconfig.json +++ b/types/jasmine-enzyme/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine-es6-promise-matchers/tsconfig.json b/types/jasmine-es6-promise-matchers/tsconfig.json index 98d8f03e42..876eee95ac 100644 --- a/types/jasmine-es6-promise-matchers/tsconfig.json +++ b/types/jasmine-es6-promise-matchers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine-fixture/tsconfig.json b/types/jasmine-fixture/tsconfig.json index 149810b10a..ca506e5adb 100644 --- a/types/jasmine-fixture/tsconfig.json +++ b/types/jasmine-fixture/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine-given/tsconfig.json b/types/jasmine-given/tsconfig.json index d1b9541f2c..57bd58c328 100644 --- a/types/jasmine-given/tsconfig.json +++ b/types/jasmine-given/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine-jquery/tsconfig.json b/types/jasmine-jquery/tsconfig.json index ac43f3d18c..dc5f7f00d7 100644 --- a/types/jasmine-jquery/tsconfig.json +++ b/types/jasmine-jquery/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine-matchers/tsconfig.json b/types/jasmine-matchers/tsconfig.json index 943271914e..fb7d43b96b 100644 --- a/types/jasmine-matchers/tsconfig.json +++ b/types/jasmine-matchers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine-node/tsconfig.json b/types/jasmine-node/tsconfig.json index 2b68e61c60..2cc45d7d2a 100644 --- a/types/jasmine-node/tsconfig.json +++ b/types/jasmine-node/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine-promise-matchers/tsconfig.json b/types/jasmine-promise-matchers/tsconfig.json index 0b264e6527..66af9a8c08 100644 --- a/types/jasmine-promise-matchers/tsconfig.json +++ b/types/jasmine-promise-matchers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine/index.d.ts b/types/jasmine/index.d.ts index ed068f4775..f3e0407bab 100644 --- a/types/jasmine/index.d.ts +++ b/types/jasmine/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Jasmine 2.8.0 // Project: http://jasmine.github.io/ -// Definitions by: Boris Yankov , Theodore Brown , David Pärsson , Gabe Moothart , Lukas Zech +// Definitions by: Boris Yankov , Theodore Brown , David Pärsson , Gabe Moothart , Lukas Zech , Boris Breuer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -259,11 +259,11 @@ declare namespace jasmine { execute(): void; describe(description: string, specDefinitions: () => void): Suite; // ddescribe(description: string, specDefinitions: () => void): Suite; Not a part of jasmine. Angular team adds these - beforeEach(beforeEachFunction: () => void): void; - beforeAll(beforeAllFunction: () => void): void; + beforeEach(beforeEachFunction: (done: DoneFn) => void, timeout?: number): void; + beforeAll(beforeAllFunction: (done: DoneFn) => void, timeout?: number): void; currentRunner(): Runner; - afterEach(afterEachFunction: () => void): void; - afterAll(afterAllFunction: () => void): void; + afterEach(afterEachFunction: (done: DoneFn) => void, timeout?: number): void; + afterAll(afterAllFunction: (done: DoneFn) => void, timeout?: number): void; xdescribe(desc: string, specDefinitions: () => void): XSuite; it(description: string, func: () => void): Spec; // iit(description: string, func: () => void): Spec; Not a part of jasmine. Angular team adds these @@ -718,13 +718,13 @@ declare module "jasmine" { addSpecFile(filePath: string): void; addSpecFiles(files: string[]): void; configureDefaultReporter(options: any, ...args: any[]): void; - execute(files: any, filterString: any): any; + execute(files?: string[], filterString?: string): any; exitCodeCompletion(passed: any): void; loadConfig(config: any): void; loadConfigFile(configFilePath: any): void; loadHelpers(): void; loadSpecs(): void; - onComplete(onCompleteCallback: () => void): void; + onComplete(onCompleteCallback: (passed: boolean) => void): void; provideFallbackReporter(reporter: jasmine.Reporter): void; randomizeTests(value?: any): boolean; seed(value: any): void; diff --git a/types/jasmine/tsconfig.json b/types/jasmine/tsconfig.json index 55b83c6d3a..8cf9b9c42b 100644 --- a/types/jasmine/tsconfig.json +++ b/types/jasmine/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } -} +} \ No newline at end of file diff --git a/types/jasmine/v1/tsconfig.json b/types/jasmine/v1/tsconfig.json index 99a9fb48b4..35dd7f72b3 100644 --- a/types/jasmine/v1/tsconfig.json +++ b/types/jasmine/v1/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine_dom_matchers/tsconfig.json b/types/jasmine_dom_matchers/tsconfig.json index 4b09a5d93a..c806488fe6 100644 --- a/types/jasmine_dom_matchers/tsconfig.json +++ b/types/jasmine_dom_matchers/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasminewd2/tsconfig.json b/types/jasminewd2/tsconfig.json index 2267f75819..595a34e1b8 100644 --- a/types/jasminewd2/tsconfig.json +++ b/types/jasminewd2/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/java-applet/tsconfig.json b/types/java-applet/tsconfig.json index 776886e3f1..ae0ec396fd 100644 --- a/types/java-applet/tsconfig.json +++ b/types/java-applet/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/java/tsconfig.json b/types/java/tsconfig.json index 9f5ed2d241..6c47c1241c 100644 --- a/types/java/tsconfig.json +++ b/types/java/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/javascript-astar/tsconfig.json b/types/javascript-astar/tsconfig.json index 6ca80fa293..8c40ff7635 100644 --- a/types/javascript-astar/tsconfig.json +++ b/types/javascript-astar/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/javascript-bignum/tsconfig.json b/types/javascript-bignum/tsconfig.json index d6a0961172..af86ab51b2 100644 --- a/types/javascript-bignum/tsconfig.json +++ b/types/javascript-bignum/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/javascript-obfuscator/tsconfig.json b/types/javascript-obfuscator/tsconfig.json index 5b53fa94db..8c5281c864 100644 --- a/types/javascript-obfuscator/tsconfig.json +++ b/types/javascript-obfuscator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/javascript-state-machine/tsconfig.json b/types/javascript-state-machine/tsconfig.json index 75ccb2b212..44662c9100 100644 --- a/types/javascript-state-machine/tsconfig.json +++ b/types/javascript-state-machine/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jbinary/tsconfig.json b/types/jbinary/tsconfig.json index d272b54223..6c9f35a340 100644 --- a/types/jbinary/tsconfig.json +++ b/types/jbinary/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jcanvas/tsconfig.json b/types/jcanvas/tsconfig.json index 9c6aa5edbe..4bd7257d69 100644 --- a/types/jcanvas/tsconfig.json +++ b/types/jcanvas/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jdataview/tsconfig.json b/types/jdataview/tsconfig.json index 230f748dfe..67864c6551 100644 --- a/types/jdataview/tsconfig.json +++ b/types/jdataview/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jdenticon/tsconfig.json b/types/jdenticon/tsconfig.json index cb462ee4d6..1ae5237495 100644 --- a/types/jdenticon/tsconfig.json +++ b/types/jdenticon/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jee-jsf/tsconfig.json b/types/jee-jsf/tsconfig.json index 36364a83fa..3742e2c21b 100644 --- a/types/jee-jsf/tsconfig.json +++ b/types/jee-jsf/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jenkins/jenkins-tests.ts b/types/jenkins/jenkins-tests.ts index 98b30d4b73..9f45c7053b 100644 --- a/types/jenkins/jenkins-tests.ts +++ b/types/jenkins/jenkins-tests.ts @@ -1,4 +1,4 @@ -import * as J from 'jenkins'; +import J = require('jenkins'); const jenkins = J({ baseUrl: 'http://user:pass@localhost:8080', crumbIssuer: true }); diff --git a/types/jenkins/tsconfig.json b/types/jenkins/tsconfig.json index 08dc07dbe9..44e042dc79 100644 --- a/types/jenkins/tsconfig.json +++ b/types/jenkins/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jest-diff/tsconfig.json b/types/jest-diff/tsconfig.json index 3624e1778b..8c945026ff 100644 --- a/types/jest-diff/tsconfig.json +++ b/types/jest-diff/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "jest-diff-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/jest-docblock/tsconfig.json b/types/jest-docblock/tsconfig.json index 4b1181bdad..e33cc9e573 100644 --- a/types/jest-docblock/tsconfig.json +++ b/types/jest-docblock/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jest-get-type/tsconfig.json b/types/jest-get-type/tsconfig.json index d1e6fac5ee..9827885143 100644 --- a/types/jest-get-type/tsconfig.json +++ b/types/jest-get-type/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "jest-get-type-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/jest-in-case/tsconfig.json b/types/jest-in-case/tsconfig.json index a561ae813a..c84b4c71cd 100644 --- a/types/jest-in-case/tsconfig.json +++ b/types/jest-in-case/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "jest-in-case-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/jest-json-schema/tsconfig.json b/types/jest-json-schema/tsconfig.json index e8d55cbd89..72a4cfb23c 100644 --- a/types/jest-json-schema/tsconfig.json +++ b/types/jest-json-schema/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "jest-json-schema-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/jest-matcher-utils/tsconfig.json b/types/jest-matcher-utils/tsconfig.json index 115b762386..3a647a09a9 100644 --- a/types/jest-matcher-utils/tsconfig.json +++ b/types/jest-matcher-utils/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "jest-matcher-utils-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/jest-matchers/tsconfig.json b/types/jest-matchers/tsconfig.json index 123b605779..b3c1b8d9b8 100644 --- a/types/jest-matchers/tsconfig.json +++ b/types/jest-matchers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jest-validate/tsconfig.json b/types/jest-validate/tsconfig.json index 5b8abec385..0851710463 100644 --- a/types/jest-validate/tsconfig.json +++ b/types/jest-validate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jest/index.d.ts b/types/jest/index.d.ts index 0ba1762485..e3cac9b881 100644 --- a/types/jest/index.d.ts +++ b/types/jest/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Jest 22.0 +// Type definitions for Jest 22.1 // Project: http://facebook.github.io/jest/ // Definitions by: Asana // Ivo Stratev @@ -10,6 +10,7 @@ // Waseem Dahman // Jamie Mason // Douglas Duteil +// Ahn // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -169,7 +170,7 @@ declare namespace jest { /** * Creates a mock function similar to jest.fn but also tracks calls to object[methodName] */ - function spyOn(object: T, method: M): SpyInstance; + function spyOn(object: T, method: M, accessType?: 'get' | 'set'): SpyInstance; /** * Indicates that the module system should never return a mocked version of * the specified module from require() (e.g. that it should always return the real module). @@ -547,16 +548,6 @@ declare namespace jest { // Relevant parts of Jasmine's API are below so they can be changed and removed over time. // This file can't reference jasmine.d.ts since the globals aren't compatible. -declare function spyOn(object: any, method: string): jasmine.Spy; -/** - * If you call the function pending anywhere in the spec body, - * no matter the expectations, the spec will be marked pending. - */ -declare function pending(reason?: string): void; -/** - * Fails a test when called within one. - */ -declare function fail(error?: any): void; declare namespace jasmine { let DEFAULT_TIMEOUT_INTERVAL: number; function clock(): Clock; diff --git a/types/jest/tsconfig.json b/types/jest/tsconfig.json index 8a02004840..fe92564343 100644 --- a/types/jest/tsconfig.json +++ b/types/jest/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jest/v16/tsconfig.json b/types/jest/v16/tsconfig.json index faf67cd73a..61038de4d6 100644 --- a/types/jest/v16/tsconfig.json +++ b/types/jest/v16/tsconfig.json @@ -23,7 +23,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jfp/tsconfig.json b/types/jfp/tsconfig.json index 81402f37d4..c75ebb5e7a 100644 --- a/types/jfp/tsconfig.json +++ b/types/jfp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jfs/tsconfig.json b/types/jfs/tsconfig.json index 2fd6c9f41b..8206817563 100644 --- a/types/jfs/tsconfig.json +++ b/types/jfs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jjv/tsconfig.json b/types/jjv/tsconfig.json index ce2a0343d8..0f6e9fe75f 100644 --- a/types/jjv/tsconfig.json +++ b/types/jjv/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jjve/tsconfig.json b/types/jjve/tsconfig.json index 12f97579f7..823b7b8df1 100644 --- a/types/jjve/tsconfig.json +++ b/types/jjve/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jmespath/tsconfig.json b/types/jmespath/tsconfig.json index 1b416d36d1..6b4bfc2810 100644 --- a/types/jmespath/tsconfig.json +++ b/types/jmespath/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/johnny-five/index.d.ts b/types/johnny-five/index.d.ts index 95a348429d..a1ff5d3f59 100644 --- a/types/johnny-five/index.d.ts +++ b/types/johnny-five/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/rwaldron/johnny-five // Definitions by: Toshiya Nakakura // Zoltan Ujvary +// Simon Colmer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -290,30 +291,6 @@ export declare class IMU { } export declare module IR { - export interface MotionOption { - pin: number | string; - } - - export class Motion { - constructor(option: number | MotionOption); - on(event: string, cb: () => void): this; - on(event: "data", cb: (data: any) => void): this; - on(event: "motionstart", cb: () => void): this; - on(event: "motionend", cb: () => void): this; - on(event: "calibrated", cb: () => void): this; - } - - export interface PloximityOption { - pin: number | string; - controller: string; - } - - export class Proximity { - constructor(option: number | PloximityOption); - on(event: string, cb: () => void): this; - on(event: "data", cb: (data: any) => void): this; - on(event: "change", cb: () => void): this; - } export interface ArrayOption { pins: Array | Array; @@ -521,6 +498,19 @@ export declare module Led { } } +export interface MotionOption { + pin: number | string; +} + +export class Motion { + constructor(option: number | MotionOption); + on(event: string, cb: () => void): this; + on(event: "data", cb: (data: any) => void): this; + on(event: "motionstart", cb: () => void): this; + on(event: "motionend", cb: () => void): this; + on(event: "calibrated", cb: () => void): this; +} + export interface MotorOption { pins: any; current?: any; @@ -629,6 +619,23 @@ export declare class Ping { constructor(option: number | PingOption); } +export declare interface ProximityOption { + pin: number | string; + controller: string; +} + +export declare interface ProximityData { + cm: number; + in: number; +} + +export declare class Proximity { + constructor(option: number | ProximityOption); + on(event: string, cb: () => void): this; + on(event: "data", cb: (data: ProximityData) => void): this; + on(event: "change", cb: () => void): this; +} + export interface RelayOption { pin: number | string; type?: string; diff --git a/types/johnny-five/johnny-five-tests.ts b/types/johnny-five/johnny-five-tests.ts index 72e7d04b07..b2dd24904e 100644 --- a/types/johnny-five/johnny-five-tests.ts +++ b/types/johnny-five/johnny-five-tests.ts @@ -71,14 +71,14 @@ board.on('ready', function(){ freq: 100 // optional }); - var motion = new five.IR.Motion(7); + var motion = new five.Motion(7); // Options object with pin property - var motion = new five.IR.Motion({ + var motion = new five.Motion({ pin: 7 }); - var proximity = new five.IR.Proximity({ + var proximity = new five.Proximity({ controller: "GP2Y0A21YK", pin: "A0" }); diff --git a/types/johnny-five/tsconfig.json b/types/johnny-five/tsconfig.json index 5218cc5e2b..f58cec6814 100644 --- a/types/johnny-five/tsconfig.json +++ b/types/johnny-five/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/joi/tsconfig.json b/types/joi/tsconfig.json index 57e6c47881..1229f9503e 100644 --- a/types/joi/tsconfig.json +++ b/types/joi/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "joi-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/joi/v10/tsconfig.json b/types/joi/v10/tsconfig.json index 1bd530aff0..52855d5713 100644 --- a/types/joi/v10/tsconfig.json +++ b/types/joi/v10/tsconfig.json @@ -19,10 +19,11 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "joi-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/joi/v6/tsconfig.json b/types/joi/v6/tsconfig.json index 75aacbeeea..13d053b4d4 100644 --- a/types/joi/v6/tsconfig.json +++ b/types/joi/v6/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/joigoose/joigoose-tests.ts b/types/joigoose/joigoose-tests.ts index 91e36d827c..50cb29deef 100644 --- a/types/joigoose/joigoose-tests.ts +++ b/types/joigoose/joigoose-tests.ts @@ -1,4 +1,4 @@ -import * as Joigoose from "joigoose"; +import Joigoose = require("joigoose"); import * as Mongoose from "mongoose"; import * as Joi from "joi"; diff --git a/types/joigoose/tsconfig.json b/types/joigoose/tsconfig.json index 05aa2fd1c2..172e39fae9 100644 --- a/types/joigoose/tsconfig.json +++ b/types/joigoose/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/josa/index.d.ts b/types/josa/index.d.ts new file mode 100644 index 0000000000..3ce0d08ccc --- /dev/null +++ b/types/josa/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for josa 3.0 +// Project: https://github.com/kimdhoe/josa +// Definitions by: Vichyssoise +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export type Topic = 'ì€' | '는'; +export type Subject = 'ì´' | 'ê°€'; +export type Objective = 'ì„' | '를'; +export type Conjunction = '와' | 'ê³¼'; +export type Means = '으로' | '로'; +export type Josa = Topic | Subject | Objective | Conjunction | Means; + +/** 조사 플레ì´ìŠ¤í™€ë”(ex. #{ì€})ê°€ í¬í•¨ëœ 문ìžì—´ì„ 입력받아 ì™„ì„±ëœ ë¬¸ìžì—´ì„ 반환합니다. */ +export function josa(sentence: string): string; + +/** ëª…ì‚¬ì— ë§žëŠ” 조사를 찾아주는 함수를 반환합니다. 예를 들면, ìž„ì˜ì˜ ëª…ì‚¬ì— ëŒ€í•´ _ì„_ê³¼ 를 중 하나를 ì„ íƒí•˜ëŠ” 함수가 필요할 때 사용할 수 있습니다. */ +export function getJosaPicker(josa: Topic): (noun: string) => Topic; +export function getJosaPicker(josa: Subject): (noun: string) => Subject; +export function getJosaPicker(josa: Objective): (noun: string) => Objective; +export function getJosaPicker(josa: Conjunction): (noun: string) => Conjunction; +export function getJosaPicker(josa: Means): (noun: string) => Means; + +/** ëª…ì‚¬ì— ì¡°ì‚¬ë¥¼ ë¶™ì´ëŠ” 함수를 반환합니다. */ +export function makeJosaify(josa: Josa): (noun: string) => string; diff --git a/types/josa/josa-tests.ts b/types/josa/josa-tests.ts new file mode 100644 index 0000000000..6dd2ab771d --- /dev/null +++ b/types/josa/josa-tests.ts @@ -0,0 +1,22 @@ +import { josa, getJosaPicker, makeJosaify } from 'josa'; + +josa('비시스와즈'); // $ExpectType string +josa('사람들#{ì€} ìž‘ë™ë§Œ ë˜ë©´ ê·¸ ì›ë¦¬#{는} ì‹ ê²½#{ì„} 안쓰지'); // $ExpectType string + +getJosaPicker('ì€'); +getJosaPicker('ì€')('사람'); + +getJosaPicker('ì´'); +getJosaPicker('ì´')('사람'); + +getJosaPicker('ì„'); +getJosaPicker('ì„')('사람'); + +getJosaPicker('와'); +getJosaPicker('와')('사람'); + +getJosaPicker('로'); +getJosaPicker('로')('사람'); + +makeJosaify('ì€'); +makeJosaify('ì€')('사람'); // $ExpectType string diff --git a/types/linq4js/tsconfig.json b/types/josa/tsconfig.json similarity index 76% rename from types/linq4js/tsconfig.json rename to types/josa/tsconfig.json index 3479566f16..98786984f3 100644 --- a/types/linq4js/tsconfig.json +++ b/types/josa/tsconfig.json @@ -1,24 +1,24 @@ { - "files": [ - "index.d.ts", - "linq4js-tests.ts" - ], "compilerOptions": { "module": "commonjs", + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, - "target": "es6", "baseUrl": "../", "typeRoots": [ "../" ], "types": [], - "lib": [ - "es6" - ], "noEmit": true, - "forceConsistentCasingInFileNames": true - } + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "josa-tests.ts" + ] } \ No newline at end of file diff --git a/types/josa/tslint.json b/types/josa/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/josa/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jpeg-js/tsconfig.json b/types/jpeg-js/tsconfig.json index 20d7ba3d8d..09b8b89141 100644 --- a/types/jpeg-js/tsconfig.json +++ b/types/jpeg-js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jpm/tsconfig.json b/types/jpm/tsconfig.json index 257f95eafa..7934ed544d 100644 --- a/types/jpm/tsconfig.json +++ b/types/jpm/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jqgrid/tsconfig.json b/types/jqgrid/tsconfig.json index fd6e8c36a2..4872ce6ec3 100644 --- a/types/jqgrid/tsconfig.json +++ b/types/jqgrid/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jqrangeslider/tsconfig.json b/types/jqrangeslider/tsconfig.json index 9c8eabeb88..e7b62c7c06 100644 --- a/types/jqrangeslider/tsconfig.json +++ b/types/jqrangeslider/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-ajax-chain/tsconfig.json b/types/jquery-ajax-chain/tsconfig.json index 58a43cc65e..b7f9b3ac86 100644 --- a/types/jquery-ajax-chain/tsconfig.json +++ b/types/jquery-ajax-chain/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-alertable/tsconfig.json b/types/jquery-alertable/tsconfig.json index ca545d4a12..026ddd56c1 100644 --- a/types/jquery-alertable/tsconfig.json +++ b/types/jquery-alertable/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-awesome-cursor/index.d.ts b/types/jquery-awesome-cursor/index.d.ts new file mode 100644 index 0000000000..1137b16b75 --- /dev/null +++ b/types/jquery-awesome-cursor/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for jquery-awesome-cursor 0.3 +// Project: https://jwarby.github.io/jquery-awesome-cursor +// Definitions by: Zsolt Kovács +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// +declare namespace JQueryAwesomeCursor { + type flip = "horizontal" | "vertical" | "both"; + type cssHandler = (name: string) => void; + + interface Options { + color?: string; + size?: number; + hotspot?: number[] | string; + flip?: flip; + rotate?: number; + outline?: string; + font?: Font; + } + + interface Font { + family: string; + cssClass: string | cssHandler; + } +} + +interface JQueryStatic { + awesomeCursor(icon: string, options?: JQueryAwesomeCursor.Options): JQuery; +} + +interface JQuery { + awesomeCursor(icon: string, options?: JQueryAwesomeCursor.Options): JQuery; +} diff --git a/types/jquery-awesome-cursor/jquery-awesome-cursor-tests.ts b/types/jquery-awesome-cursor/jquery-awesome-cursor-tests.ts new file mode 100644 index 0000000000..cd47f56ff9 --- /dev/null +++ b/types/jquery-awesome-cursor/jquery-awesome-cursor-tests.ts @@ -0,0 +1,64 @@ +// Default +jQuery.awesomeCursor('pencil'); + +// Color +jQuery.awesomeCursor('pencil', { + color: '#ff0000' +}); + +// Size +jQuery.awesomeCursor('pencil', { + size: 32 +}); + +// Hotspot +jQuery.awesomeCursor('pencil', { + hotspot: [0, 17] +}); +jQuery.awesomeCursor('pencil', { + hotspot: 'bottom left' +}); + +// Flip +jQuery.awesomeCursor('pencil', { + flip: 'horizontal' +}); +jQuery.awesomeCursor('pencil', { + flip: 'vertical' +}); +jQuery.awesomeCursor('pencil', { + flip: 'both' +}); + +// Rotate +jQuery.awesomeCursor('pencil', { + rotate: 45 +}); + +// Outline +jQuery.awesomeCursor('pencil', { + outline: 'red' +}); + +// Different font +jQuery.awesomeCursor('brush', { + font: { + family: 'typicons', + cssClass: 'typcn typcn-%s' + } +}); +jQuery.awesomeCursor('brush', { + font: { + family: 'typicons', + cssClass: (name) => { + return 'typcn typcn-' + name; + } + } +}); + +// Mixed +jQuery.awesomeCursor('long-arrow-left', { + color: 'red', + hotspot: 'top left', + rotate: 45, +}); diff --git a/types/jquery-awesome-cursor/tsconfig.json b/types/jquery-awesome-cursor/tsconfig.json new file mode 100644 index 0000000000..b2e301a8b8 --- /dev/null +++ b/types/jquery-awesome-cursor/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "jquery-awesome-cursor-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jquery-awesome-cursor/tslint.json b/types/jquery-awesome-cursor/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jquery-awesome-cursor/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jquery-backstretch/tsconfig.json b/types/jquery-backstretch/tsconfig.json index c2fb9bc82f..586b25464e 100644 --- a/types/jquery-backstretch/tsconfig.json +++ b/types/jquery-backstretch/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-cropbox/tsconfig.json b/types/jquery-cropbox/tsconfig.json index 8ff494d309..3434909492 100644 --- a/types/jquery-cropbox/tsconfig.json +++ b/types/jquery-cropbox/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-deparam/tsconfig.json b/types/jquery-deparam/tsconfig.json index b7d9a9d091..9f1b087687 100644 --- a/types/jquery-deparam/tsconfig.json +++ b/types/jquery-deparam/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-easy-loading/tsconfig.json b/types/jquery-easy-loading/tsconfig.json index c6c8a6a160..7e12f37ffe 100644 --- a/types/jquery-easy-loading/tsconfig.json +++ b/types/jquery-easy-loading/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-editable-select/tsconfig.json b/types/jquery-editable-select/tsconfig.json index a284c442fa..fc9904fdb8 100644 --- a/types/jquery-editable-select/tsconfig.json +++ b/types/jquery-editable-select/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-fullscreen/tsconfig.json b/types/jquery-fullscreen/tsconfig.json index 81b275bff5..dc4e20c177 100644 --- a/types/jquery-fullscreen/tsconfig.json +++ b/types/jquery-fullscreen/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-galleria/tsconfig.json b/types/jquery-galleria/tsconfig.json index c082643a87..96c948f924 100644 --- a/types/jquery-galleria/tsconfig.json +++ b/types/jquery-galleria/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-handsontable/tsconfig.json b/types/jquery-handsontable/tsconfig.json index fac1311bb7..aa39ff119c 100644 --- a/types/jquery-handsontable/tsconfig.json +++ b/types/jquery-handsontable/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-jcrop/tsconfig.json b/types/jquery-jcrop/tsconfig.json index add23691c0..895906f145 100644 --- a/types/jquery-jcrop/tsconfig.json +++ b/types/jquery-jcrop/tsconfig.json @@ -1,24 +1,25 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "jquery-jcrop-tests.ts" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "jquery-jcrop-tests.ts" + ] } \ No newline at end of file diff --git a/types/jquery-jsonrpcclient/tsconfig.json b/types/jquery-jsonrpcclient/tsconfig.json index 812781d6cc..b410a68acf 100644 --- a/types/jquery-jsonrpcclient/tsconfig.json +++ b/types/jquery-jsonrpcclient/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-knob/tsconfig.json b/types/jquery-knob/tsconfig.json index c177f5a019..d5913373b8 100644 --- a/types/jquery-knob/tsconfig.json +++ b/types/jquery-knob/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-mask-plugin/index.d.ts b/types/jquery-mask-plugin/index.d.ts index a142d0a97e..342045a204 100644 --- a/types/jquery-mask-plugin/index.d.ts +++ b/types/jquery-mask-plugin/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for jQuery Mask Plugin 1.14 // Project: https://igorescobar.github.io/jQuery-Mask-Plugin/ -// Definitions by: Anže VideniÄ , Igor Escobar +// Definitions by: Anže VideniÄ +// Igor Escobar +// Anderson Friaça // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -25,6 +27,7 @@ declare namespace jQueryMask { selectOnFocus?: boolean; reverse?: boolean; clearIfNotMatch?: boolean; + placeholder?: string; onComplete?(value: string, e: Event, $element: JQuery, options: Options): void; onKeyPress?(value: string, e: Event, $element: JQuery, options: Options): void; onChange?(value: string, e: Event, $element: JQuery, options: Options): void; diff --git a/types/jquery-mask-plugin/jquery-mask-plugin-tests.ts b/types/jquery-mask-plugin/jquery-mask-plugin-tests.ts index 310cec421b..90ac9f7a00 100644 --- a/types/jquery-mask-plugin/jquery-mask-plugin-tests.ts +++ b/types/jquery-mask-plugin/jquery-mask-plugin-tests.ts @@ -27,6 +27,9 @@ $(document).ready(() => { placeholder: "__/__/____" } }); + $('.placeholder2').mask("00/00/0000", { + placeholder: "__/__/____" + }); $('.fallback').mask("00r00r0000", { translation: { r: { diff --git a/types/jquery-mask-plugin/tsconfig.json b/types/jquery-mask-plugin/tsconfig.json index 21be524f87..98c8d3d4e3 100644 --- a/types/jquery-mask-plugin/tsconfig.json +++ b/types/jquery-mask-plugin/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-match-height/tsconfig.json b/types/jquery-match-height/tsconfig.json index 103ae84843..9c83d33574 100644 --- a/types/jquery-match-height/tsconfig.json +++ b/types/jquery-match-height/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-mockjax/tsconfig.json b/types/jquery-mockjax/tsconfig.json index 42505b57a0..3f3116e2e7 100644 --- a/types/jquery-mockjax/tsconfig.json +++ b/types/jquery-mockjax/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-mousewheel/tsconfig.json b/types/jquery-mousewheel/tsconfig.json index 7fe74c814f..bae05cac1a 100644 --- a/types/jquery-mousewheel/tsconfig.json +++ b/types/jquery-mousewheel/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-notifier/tsconfig.json b/types/jquery-notifier/tsconfig.json index b2178bf718..40548bb50d 100644 --- a/types/jquery-notifier/tsconfig.json +++ b/types/jquery-notifier/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "jquery-notifier-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/jquery-param/tsconfig.json b/types/jquery-param/tsconfig.json index 65999b18ff..ab66910efe 100644 --- a/types/jquery-param/tsconfig.json +++ b/types/jquery-param/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-sortable/tsconfig.json b/types/jquery-sortable/tsconfig.json index 2a77692104..1e6c616f02 100644 --- a/types/jquery-sortable/tsconfig.json +++ b/types/jquery-sortable/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-steps/tsconfig.json b/types/jquery-steps/tsconfig.json index 5af8c482b0..e1a0b04e2b 100644 --- a/types/jquery-steps/tsconfig.json +++ b/types/jquery-steps/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-sticky/index.d.ts b/types/jquery-sticky/index.d.ts new file mode 100644 index 0000000000..469ebde7a1 --- /dev/null +++ b/types/jquery-sticky/index.d.ts @@ -0,0 +1,82 @@ +// Type definitions for jquery-sticky 1.0 +// Project: https://github.com/garand/sticky +// Definitions by: Matthieu Tabuteau +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +interface JQueryStickyOptions { + /** + * Pixels between the page top and the element's top. + * @default 0 + */ + topSpacing?: number; + + /** + * Pixels between the page bottom and the element's bottom. + * @default 0 + */ + bottomSpacing?: number; + + /** + * CSS class added to the element's wrapper when "sticked". + * @default is-sticky + */ + className?: string; + + /** + * CSS class added to the wrapper. + * @default 'sticky-wrapper' + */ + wrapperClassName?: string; + + /** + * Boolean determining whether the sticky element should be horizontally centered in the page. + * @default false + */ + center?: boolean; + + /** + * Selector of element referenced to set fixed width of "sticky" element. + * @default '' + */ + getWidthFrom?: string; + + /** + * Boolean determining whether width of the "sticky" element should be updated to match the wrapper's width. + * Wrapper is a placeholder for "sticky" element while it is fixed (out of static elements flow), and its width depends on the context and CSS rules. + * Works only as long getWidthForm isn't set. + * @default true + */ + widthFromWrapper?: boolean; + + /** + * Boolean determining whether widths will be recalculated on window resize (using getWidthfrom). + * @default false + */ + responsiveWidth?: boolean; + + /** + * Controls z-index of the sticked element. + * @default inherit + */ + zIndex?: string; +} + +interface JQuery { + /** + * Initializer. options is optional. + */ + sticky(options?: JQueryStickyOptions): JQuery; + + /** + * Recalculates the element's position. + */ + sticky(method: 'update'): JQuery; + + /** + * To unstick an object. + */ + unstick(): JQuery; +} diff --git a/types/jquery-sticky/jquery-sticky-tests.ts b/types/jquery-sticky/jquery-sticky-tests.ts new file mode 100644 index 0000000000..e0e6e69d9c --- /dev/null +++ b/types/jquery-sticky/jquery-sticky-tests.ts @@ -0,0 +1,18 @@ +// initialization +$('#sticker').sticky({ + topSpacing: 12, + bottomSpacing: 12, + className: 'class-name', + wrapperClassName: 'wrapper-class-name', + center: true, + getWidthFrom: '#container', + widthFromWrapper: false, + responsiveWidth: true, + zIndex: '2' +}); + +// update element position +$('#sticker').sticky('update'); + +// unstick +$("#sticker").unstick(); diff --git a/types/xterm/tsconfig.json b/types/jquery-sticky/tsconfig.json similarity index 72% rename from types/xterm/tsconfig.json rename to types/jquery-sticky/tsconfig.json index 3d75f99636..fd83e8263c 100644 --- a/types/xterm/tsconfig.json +++ b/types/jquery-sticky/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", - "xterm-tests.ts" + "jquery-sticky-tests.ts" ] } \ No newline at end of file diff --git a/types/jquery-sticky/tslint.json b/types/jquery-sticky/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jquery-sticky/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jquery-tags-input/index.d.ts b/types/jquery-tags-input/index.d.ts new file mode 100644 index 0000000000..612d57da52 --- /dev/null +++ b/types/jquery-tags-input/index.d.ts @@ -0,0 +1,112 @@ +// Type definitions for jQuery Tags Input Plugin 1.3 +// Project: https://github.com/xoxco/jQuery-Tags-Input +// Definitions by: Anderson Friaça +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +declare namespace jQueryTagsInput { + interface Options { + /** + * Url for autocomplete + */ + autocomplete_url?: string; + + /** + * Autocomplete options + */ + autocomplete?: object; + + /** + * Height of tag + */ + height?: string; + + /** + * Width of tag + */ + width?: string; + + /** + * Interactive tags + */ + interactive?: boolean; + + /** + * Placeholder of field when tags is empty + */ + defaultText?: string; + + /** + * Callback function on add tag + */ + onAddTag?: (addedValue: string) => void; + + /** + * Callback function on remove tag + */ + onRemoveTag?: (removedValue: string) => void; + + /** + * Callback function on change list of tags + */ + onChange?: (element: JQuery, changedValue: string) => void; + + /** + * Delimiters on tags creation + */ + delimiter?: string[]|string; + + /** + * Remove with tag backspace + */ + removeWithBackspace ?: boolean; + + /** + * Minimun char length for tag + */ + minChars?: number; + + /** + * Max char length for tag + */ + maxChars?: number; + + /** + * Placeholder color of tags + */ + placeholderColor?: string; + } + } + interface JQuery { + /** + * Transform input field to work with tags + * @param options for creation + */ + tagsInput(options?: jQueryTagsInput.Options): JQuery; + + /** + * Add a new tag to list + * @param tag value + */ + addTag(tag: string): boolean; + + /** + * Remove tag with value from list + * @param tag to be removed + */ + removeTag(tag: string): boolean; + + /** + * Add a new tags + * @param tags string separated by delimiter + */ + importTags(tags: string): void; + + /** + * Verify if tag exists + * @param tag value + */ + tagExist(tag: string): boolean; + } diff --git a/types/jquery-tags-input/jquery-tags-input-tests.ts b/types/jquery-tags-input/jquery-tags-input-tests.ts new file mode 100644 index 0000000000..559a47a698 --- /dev/null +++ b/types/jquery-tags-input/jquery-tags-input-tests.ts @@ -0,0 +1,20 @@ +// basic usage +$(document).ready(() => { + $('#inputTag').tagsInput(); + $('#inputTag').addTag('new tag'); + $('#inputTag').tagExist('new tag'); + $('inputTag').removeTag('new tag'); + $('#inputTag').importTags('tag1, tag2, tag3'); + + // with options + const options: jQueryTagsInput.Options = { + height: '100px', + width: '300px', + minChars: 3, + maxChars: 0, + onAddTag: (value: string) => { + alert('Tag added: ' + value); + } + }; + $('#inputTag').tagsInput(options); +}); diff --git a/types/jquery-tags-input/tsconfig.json b/types/jquery-tags-input/tsconfig.json new file mode 100644 index 0000000000..09fd291b0f --- /dev/null +++ b/types/jquery-tags-input/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "jquery-tags-input-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jquery-tags-input/tslint.json b/types/jquery-tags-input/tslint.json new file mode 100644 index 0000000000..d04fe2e1fa --- /dev/null +++ b/types/jquery-tags-input/tslint.json @@ -0,0 +1 @@ +{"extends": "dtslint/dt.json"} \ No newline at end of file diff --git a/types/jquery-timeentry/tsconfig.json b/types/jquery-timeentry/tsconfig.json index 0869745caf..6993709bad 100644 --- a/types/jquery-timeentry/tsconfig.json +++ b/types/jquery-timeentry/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-toastmessage-plugin/tsconfig.json b/types/jquery-toastmessage-plugin/tsconfig.json index 79e81125ce..7073dd1b27 100644 --- a/types/jquery-toastmessage-plugin/tsconfig.json +++ b/types/jquery-toastmessage-plugin/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-truncate-html/tsconfig.json b/types/jquery-truncate-html/tsconfig.json index c4ea956cac..cfe4235e9a 100644 --- a/types/jquery-truncate-html/tsconfig.json +++ b/types/jquery-truncate-html/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-urlparam/tsconfig.json b/types/jquery-urlparam/tsconfig.json index bdcb0ffebe..26820466ab 100644 --- a/types/jquery-urlparam/tsconfig.json +++ b/types/jquery-urlparam/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-validation-unobtrusive/tsconfig.json b/types/jquery-validation-unobtrusive/tsconfig.json index 7cf39e48e0..9b3eee130c 100644 --- a/types/jquery-validation-unobtrusive/tsconfig.json +++ b/types/jquery-validation-unobtrusive/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.address/tsconfig.json b/types/jquery.address/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/jquery.address/tsconfig.json +++ b/types/jquery.address/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/jquery.are-you-sure/tsconfig.json b/types/jquery.are-you-sure/tsconfig.json index 165728a00e..1daf8cb533 100644 --- a/types/jquery.are-you-sure/tsconfig.json +++ b/types/jquery.are-you-sure/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.autosize/tsconfig.json b/types/jquery.autosize/tsconfig.json index 6cb415b04c..53f7cc67c8 100644 --- a/types/jquery.autosize/tsconfig.json +++ b/types/jquery.autosize/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.base64/tsconfig.json b/types/jquery.base64/tsconfig.json index 157bbd92d9..170b1338d6 100644 --- a/types/jquery.base64/tsconfig.json +++ b/types/jquery.base64/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.bbq/tsconfig.json b/types/jquery.bbq/tsconfig.json index 48e78a892d..24233f0897 100644 --- a/types/jquery.bbq/tsconfig.json +++ b/types/jquery.bbq/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.blockui/tsconfig.json b/types/jquery.blockui/tsconfig.json index e46b2e83ec..6a0de89f04 100644 --- a/types/jquery.blockui/tsconfig.json +++ b/types/jquery.blockui/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.bootstrap.wizard/tsconfig.json b/types/jquery.bootstrap.wizard/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/jquery.bootstrap.wizard/tsconfig.json +++ b/types/jquery.bootstrap.wizard/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/jquery.cleditor/tsconfig.json b/types/jquery.cleditor/tsconfig.json index 70f33953ab..5fedcfc36e 100644 --- a/types/jquery.cleditor/tsconfig.json +++ b/types/jquery.cleditor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.clientsidelogging/tsconfig.json b/types/jquery.clientsidelogging/tsconfig.json index 80a2b6dbf4..fd8abca37d 100644 --- a/types/jquery.clientsidelogging/tsconfig.json +++ b/types/jquery.clientsidelogging/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.color/tsconfig.json b/types/jquery.color/tsconfig.json index 35da9bb381..16b6c64b5e 100644 --- a/types/jquery.color/tsconfig.json +++ b/types/jquery.color/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.colorbox/tsconfig.json b/types/jquery.colorbox/tsconfig.json index decbdf5578..ebd35bce20 100644 --- a/types/jquery.colorbox/tsconfig.json +++ b/types/jquery.colorbox/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.colorpicker/index.d.ts b/types/jquery.colorpicker/index.d.ts index a2098e1ef9..1ece8a3c66 100644 --- a/types/jquery.colorpicker/index.d.ts +++ b/types/jquery.colorpicker/index.d.ts @@ -31,6 +31,7 @@ interface JQueryColorpickerOptions { closeOnOutside?: boolean; color?: string; colorFormat?: string; + disabled?: boolean; draggable?: boolean; duration?: string; format?: string; @@ -38,7 +39,7 @@ interface JQueryColorpickerOptions { hsv?: boolean; inline?: boolean; inlineFrame?: boolean; - layout?: {[part: string]: number[];}; + layout?: { [part: string]: number[]; }; limit?: string; modal?: boolean; mode?: string; @@ -67,7 +68,7 @@ interface JQueryColorpickerStatic { regional: { [key: string]: string; }; swatches: { [swatch: string]: { [name: string]: JQueryColorpickerStatic.RGB; }; }; writers: { [name: string]: (color: any, that: any) => any; }; - Color: { new (r?: number, g?: number, b?: number, a?: number): JQueryColorpickerStatic.Color; }; + Color: { new(r?: number, g?: number, b?: number, a?: number): JQueryColorpickerStatic.Color; }; } declare namespace JQueryColorpickerStatic { @@ -162,6 +163,6 @@ interface JQuery { colorpicker(method: "open"): JQuery; colorpicker(method: string): JQuery; colorpicker(method: "setColor", color: any): JQuery; - colorpicker(method: string, param: any): JQuery; + colorpicker(method: string, ...params: any[]): JQuery; colorpicker(options?: JQueryColorpickerOptions): JQuery; } diff --git a/types/jquery.colorpicker/jquery.colorpicker-tests.ts b/types/jquery.colorpicker/jquery.colorpicker-tests.ts index 707e2dd7f9..7d6e5c7ce3 100644 --- a/types/jquery.colorpicker/jquery.colorpicker-tests.ts +++ b/types/jquery.colorpicker/jquery.colorpicker-tests.ts @@ -17,6 +17,7 @@ var colorpicker = $("").colorpicker({ closeOnOutside: true, // Close the dialog when clicking outside the dialog (not for inline) color: '#00FF00', // Initial color (for inline only) colorFormat: 'HEX', // Format string for output color format + disabled: false, draggable: true, // Make popup dialog draggable if header is visible. duration: 'fast', hsv: true, // Show HSV controls and modes @@ -67,6 +68,10 @@ colorpicker.colorpicker("open"); colorpicker.colorpicker("close"); colorpicker.colorpicker("destroy"); colorpicker.colorpicker("setColor", "#deadbeef"); +colorpicker.colorpicker("option", "disabled", true); + +// check if all options are optional +let defaultColorpicker = $("").colorpicker({}); // example plugins provided @@ -94,23 +99,23 @@ $.colorpicker.parts["memory"] = function (inst) { break; } }).bind('contextmenu', function (e) { - e.preventDefault(); - }); + e.preventDefault(); + }); container.append($node); }, getMemory = function () { return ((document.cookie.match(/\bcolorpicker-memory=([^;]*)/) || [0, ''])[1]).split(','); }, - setMemory = function () { - var colors = []; - $('> *', container).each(function () { - colors.push(encodeURIComponent($(this).css('backgroundColor'))); - }); - var expdate = new Date(); - expdate.setDate(expdate.getDate() + (365 * 10)); - document.cookie = 'colorpicker-memory=' + colors.join() + ";expires=" + expdate.toUTCString(); - }; + setMemory = function () { + var colors = []; + $('> *', container).each(function () { + colors.push(encodeURIComponent($(this).css('backgroundColor'))); + }); + var expdate = new Date(); + expdate.setDate(expdate.getDate() + (365 * 10)); + document.cookie = 'colorpicker-memory=' + colors.join() + ";expires=" + expdate.toUTCString(); + }; this.init = function () { container = $('
') @@ -195,7 +200,7 @@ $.colorpicker.parsers['CMYK'] = function (color) { parseInt(m[2], 10) / 255, parseInt(m[3], 10) / 255, parseInt(m[4], 10) / 255 - ); + ); } }; @@ -206,7 +211,7 @@ $.colorpicker.parsers["#HEX8"] = function (color) { parseInt(m[2], 16) / 255, parseInt(m[3], 16) / 255, parseInt(m[4], 16) / 255 - ).setAlpha(parseInt(m[1], 16) / 255); + ).setAlpha(parseInt(m[1], 16) / 255); } }; diff --git a/types/jquery.colorpicker/tsconfig.json b/types/jquery.colorpicker/tsconfig.json index f0edccd4d6..5912d60570 100644 --- a/types/jquery.colorpicker/tsconfig.json +++ b/types/jquery.colorpicker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.contextmenu/tsconfig.json b/types/jquery.contextmenu/tsconfig.json index 2de43ba64f..4ac31577f9 100644 --- a/types/jquery.contextmenu/tsconfig.json +++ b/types/jquery.contextmenu/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.cookie/tsconfig.json b/types/jquery.cookie/tsconfig.json index 0b4c16e92a..2b976c3bb2 100644 --- a/types/jquery.cookie/tsconfig.json +++ b/types/jquery.cookie/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.customselect/tsconfig.json b/types/jquery.customselect/tsconfig.json index ce71c3244f..55a534bc45 100644 --- a/types/jquery.customselect/tsconfig.json +++ b/types/jquery.customselect/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.cycle/tsconfig.json b/types/jquery.cycle/tsconfig.json index b807c05700..3bb6527980 100644 --- a/types/jquery.cycle/tsconfig.json +++ b/types/jquery.cycle/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.cycle2/tsconfig.json b/types/jquery.cycle2/tsconfig.json index 8fe54da959..1c845b031f 100644 --- a/types/jquery.cycle2/tsconfig.json +++ b/types/jquery.cycle2/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.dropotron/tsconfig.json b/types/jquery.dropotron/tsconfig.json index c811e857c6..3df7005b1a 100644 --- a/types/jquery.dropotron/tsconfig.json +++ b/types/jquery.dropotron/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.dynatree/tsconfig.json b/types/jquery.dynatree/tsconfig.json index 1963c75cb1..6373d266c0 100644 --- a/types/jquery.dynatree/tsconfig.json +++ b/types/jquery.dynatree/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.elang/tsconfig.json b/types/jquery.elang/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/jquery.elang/tsconfig.json +++ b/types/jquery.elang/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/jquery.fancytree/tsconfig.json b/types/jquery.fancytree/tsconfig.json index bd2d2932ca..5e301086b7 100644 --- a/types/jquery.fancytree/tsconfig.json +++ b/types/jquery.fancytree/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.fileupload/tsconfig.json b/types/jquery.fileupload/tsconfig.json index ddefea0e79..ac9c3306dd 100644 --- a/types/jquery.fileupload/tsconfig.json +++ b/types/jquery.fileupload/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.filtertable/tsconfig.json b/types/jquery.filtertable/tsconfig.json index a0166c7d6b..1208bc4f98 100644 --- a/types/jquery.filtertable/tsconfig.json +++ b/types/jquery.filtertable/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.finger/tsconfig.json b/types/jquery.finger/tsconfig.json index 55be70767e..b60410ab16 100644 --- a/types/jquery.finger/tsconfig.json +++ b/types/jquery.finger/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.flagstrap/tsconfig.json b/types/jquery.flagstrap/tsconfig.json index c4bf7e1a72..25bf48af93 100644 --- a/types/jquery.flagstrap/tsconfig.json +++ b/types/jquery.flagstrap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.form/tsconfig.json b/types/jquery.form/tsconfig.json index 02b4195224..9ea3a8c19e 100644 --- a/types/jquery.form/tsconfig.json +++ b/types/jquery.form/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.fullscreen/tsconfig.json b/types/jquery.fullscreen/tsconfig.json index bc666dcb90..46a640c552 100644 --- a/types/jquery.fullscreen/tsconfig.json +++ b/types/jquery.fullscreen/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.gridster/tsconfig.json b/types/jquery.gridster/tsconfig.json index b1e75c13e7..72f940b715 100644 --- a/types/jquery.gridster/tsconfig.json +++ b/types/jquery.gridster/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.growl/tsconfig.json b/types/jquery.growl/tsconfig.json index 8416f143a7..e28ff8e1cf 100644 --- a/types/jquery.growl/tsconfig.json +++ b/types/jquery.growl/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.highlight-bartaz/tsconfig.json b/types/jquery.highlight-bartaz/tsconfig.json index 4cbe9ddf76..c8ae44427c 100644 --- a/types/jquery.highlight-bartaz/tsconfig.json +++ b/types/jquery.highlight-bartaz/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.jnotify/tsconfig.json b/types/jquery.jnotify/tsconfig.json index abfa7d2782..d73b2d21b9 100644 --- a/types/jquery.jnotify/tsconfig.json +++ b/types/jquery.jnotify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.joyride/tsconfig.json b/types/jquery.joyride/tsconfig.json index cf307a3611..c1e0a54e00 100644 --- a/types/jquery.joyride/tsconfig.json +++ b/types/jquery.joyride/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.jsignature/tsconfig.json b/types/jquery.jsignature/tsconfig.json index c802539b0a..e0a05e7e70 100644 --- a/types/jquery.jsignature/tsconfig.json +++ b/types/jquery.jsignature/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.leanmodal/tsconfig.json b/types/jquery.leanmodal/tsconfig.json index 3625769dde..91fbecca25 100644 --- a/types/jquery.leanmodal/tsconfig.json +++ b/types/jquery.leanmodal/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.livestampjs/tsconfig.json b/types/jquery.livestampjs/tsconfig.json index 4042cffe68..6f8e48e2c5 100644 --- a/types/jquery.livestampjs/tsconfig.json +++ b/types/jquery.livestampjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.menuaim/tsconfig.json b/types/jquery.menuaim/tsconfig.json index c63cface62..937edcefb8 100644 --- a/types/jquery.menuaim/tsconfig.json +++ b/types/jquery.menuaim/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.mmenu/tsconfig.json b/types/jquery.mmenu/tsconfig.json index f95d7a3e93..c7f027625c 100644 --- a/types/jquery.mmenu/tsconfig.json +++ b/types/jquery.mmenu/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.notify/tsconfig.json b/types/jquery.notify/tsconfig.json index e703d61e37..07f6bf60ae 100644 --- a/types/jquery.notify/tsconfig.json +++ b/types/jquery.notify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.notifybar/tsconfig.json b/types/jquery.notifybar/tsconfig.json index 7541f17487..88ec6786be 100644 --- a/types/jquery.notifybar/tsconfig.json +++ b/types/jquery.notifybar/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.noty/tsconfig.json b/types/jquery.noty/tsconfig.json index fa1c069762..b4076b50e2 100644 --- a/types/jquery.noty/tsconfig.json +++ b/types/jquery.noty/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/jquery.payment/tsconfig.json b/types/jquery.payment/tsconfig.json index 84e6f1c89a..e73add9f7c 100644 --- a/types/jquery.payment/tsconfig.json +++ b/types/jquery.payment/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.pjax/tsconfig.json b/types/jquery.pjax/tsconfig.json index 5d692dbfe4..7081f4c0fe 100644 --- a/types/jquery.pjax/tsconfig.json +++ b/types/jquery.pjax/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.placeholder/tsconfig.json b/types/jquery.placeholder/tsconfig.json index 40c034b33b..2f77fd3f6e 100644 --- a/types/jquery.placeholder/tsconfig.json +++ b/types/jquery.placeholder/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.pnotify/tsconfig.json b/types/jquery.pnotify/tsconfig.json index a7ad412326..be462cb2a5 100644 --- a/types/jquery.pnotify/tsconfig.json +++ b/types/jquery.pnotify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.postmessage/tsconfig.json b/types/jquery.postmessage/tsconfig.json index dffccae0cd..a3f5056acf 100644 --- a/types/jquery.postmessage/tsconfig.json +++ b/types/jquery.postmessage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.prettyphoto/tsconfig.json b/types/jquery.prettyphoto/tsconfig.json index c35b1d3718..5417cd1ec3 100644 --- a/types/jquery.prettyphoto/tsconfig.json +++ b/types/jquery.prettyphoto/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.qrcode/tsconfig.json b/types/jquery.qrcode/tsconfig.json index bfa114d23a..0b29ab63bc 100644 --- a/types/jquery.qrcode/tsconfig.json +++ b/types/jquery.qrcode/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.qrcode/tslint.json b/types/jquery.qrcode/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/jquery.qrcode/tslint.json +++ b/types/jquery.qrcode/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/jquery.rateit/tsconfig.json b/types/jquery.rateit/tsconfig.json index a2ab54ec3b..95c69f6aaa 100644 --- a/types/jquery.rateit/tsconfig.json +++ b/types/jquery.rateit/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.rowgrid/tsconfig.json b/types/jquery.rowgrid/tsconfig.json index 452aaeee8b..5022e720a4 100644 --- a/types/jquery.rowgrid/tsconfig.json +++ b/types/jquery.rowgrid/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.scrollto/tsconfig.json b/types/jquery.scrollto/tsconfig.json index 587136c6c3..e87036509d 100644 --- a/types/jquery.scrollto/tsconfig.json +++ b/types/jquery.scrollto/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.simplemodal/tsconfig.json b/types/jquery.simplemodal/tsconfig.json index 24b60b0f81..f494541240 100644 --- a/types/jquery.simplemodal/tsconfig.json +++ b/types/jquery.simplemodal/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.simplepagination/tsconfig.json b/types/jquery.simplepagination/tsconfig.json index fa188d40ae..424e397b5a 100644 --- a/types/jquery.simplepagination/tsconfig.json +++ b/types/jquery.simplepagination/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.simulate/tsconfig.json b/types/jquery.simulate/tsconfig.json index c1586267bc..09236d4a4d 100644 --- a/types/jquery.simulate/tsconfig.json +++ b/types/jquery.simulate/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.slimscroll/tsconfig.json b/types/jquery.slimscroll/tsconfig.json index d6acf16f4e..2a510b3ab0 100644 --- a/types/jquery.slimscroll/tsconfig.json +++ b/types/jquery.slimscroll/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.soap/tsconfig.json b/types/jquery.soap/tsconfig.json index 30c25fedd2..bd14eab5f7 100644 --- a/types/jquery.soap/tsconfig.json +++ b/types/jquery.soap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.sortelements/tsconfig.json b/types/jquery.sortelements/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/jquery.sortelements/tsconfig.json +++ b/types/jquery.sortelements/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/jquery.superlink/tsconfig.json b/types/jquery.superlink/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/jquery.superlink/tsconfig.json +++ b/types/jquery.superlink/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/jquery.tagsmanager/tsconfig.json b/types/jquery.tagsmanager/tsconfig.json index 26ae59c2ef..f392a0fa22 100644 --- a/types/jquery.tagsmanager/tsconfig.json +++ b/types/jquery.tagsmanager/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.tile/tsconfig.json b/types/jquery.tile/tsconfig.json index 4dd9e0f2ed..00e7676d4a 100644 --- a/types/jquery.tile/tsconfig.json +++ b/types/jquery.tile/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.timeago/tsconfig.json b/types/jquery.timeago/tsconfig.json index 9d61fbd512..417dc84d46 100644 --- a/types/jquery.timeago/tsconfig.json +++ b/types/jquery.timeago/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.timepicker/tsconfig.json b/types/jquery.timepicker/tsconfig.json index 6536dcca3b..05a7466732 100644 --- a/types/jquery.timepicker/tsconfig.json +++ b/types/jquery.timepicker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.timer/tsconfig.json b/types/jquery.timer/tsconfig.json index 166eec6bc1..86bfbd69e7 100644 --- a/types/jquery.timer/tsconfig.json +++ b/types/jquery.timer/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.tinycarousel/tsconfig.json b/types/jquery.tinycarousel/tsconfig.json index f8b4040854..fd0744014b 100644 --- a/types/jquery.tinycarousel/tsconfig.json +++ b/types/jquery.tinycarousel/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.tinyscrollbar/tsconfig.json b/types/jquery.tinyscrollbar/tsconfig.json index f318eedaa4..782a29b264 100644 --- a/types/jquery.tinyscrollbar/tsconfig.json +++ b/types/jquery.tinyscrollbar/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.tipsy/tsconfig.json b/types/jquery.tipsy/tsconfig.json index fc95477a54..5107f06d04 100644 --- a/types/jquery.tipsy/tsconfig.json +++ b/types/jquery.tipsy/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.tools/tsconfig.json b/types/jquery.tools/tsconfig.json index 3b99d33c86..ef601e0e3a 100644 --- a/types/jquery.tools/tsconfig.json +++ b/types/jquery.tools/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.total-storage/tsconfig.json b/types/jquery.total-storage/tsconfig.json index ab78e13671..3c62edadfa 100644 --- a/types/jquery.total-storage/tsconfig.json +++ b/types/jquery.total-storage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.transit/tsconfig.json b/types/jquery.transit/tsconfig.json index ba68e939c7..628d53a263 100644 --- a/types/jquery.transit/tsconfig.json +++ b/types/jquery.transit/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.ui.datetimepicker/tsconfig.json b/types/jquery.ui.datetimepicker/tsconfig.json index 6d28673765..55a456ad6b 100644 --- a/types/jquery.ui.datetimepicker/tsconfig.json +++ b/types/jquery.ui.datetimepicker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.ui.layout/tsconfig.json b/types/jquery.ui.layout/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/jquery.ui.layout/tsconfig.json +++ b/types/jquery.ui.layout/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/jquery.uniform/tsconfig.json b/types/jquery.uniform/tsconfig.json index 0cd374ab15..eae4f481cb 100644 --- a/types/jquery.uniform/tsconfig.json +++ b/types/jquery.uniform/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.validation/tsconfig.json b/types/jquery.validation/tsconfig.json index 83b1ac2d52..8f70b517be 100644 --- a/types/jquery.validation/tsconfig.json +++ b/types/jquery.validation/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.watermark/tsconfig.json b/types/jquery.watermark/tsconfig.json index 9543996936..59413b5d3b 100644 --- a/types/jquery.watermark/tsconfig.json +++ b/types/jquery.watermark/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.window/tsconfig.json b/types/jquery.window/tsconfig.json index d8608684d5..5ef472acc0 100644 --- a/types/jquery.window/tsconfig.json +++ b/types/jquery.window/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery/index.d.ts b/types/jquery/index.d.ts index c4abf6db7b..90f6ffbd03 100644 --- a/types/jquery/index.d.ts +++ b/types/jquery/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jquery 3.2 +// Type definitions for jquery 3.3 // Project: https://jquery.com // Definitions by: Leonard Thieu // Boris Yankov @@ -219,6 +219,10 @@ interface JQueryStatic { */ ajaxTransport(dataType: string, handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => JQuery.Transport | void): void; + /** + * @deprecated 3.3 + */ + camelCase(value: string): string; /** * Check to see if a DOM element is a descendant of another DOM element. * @@ -600,6 +604,7 @@ interface JQueryStatic { * @param obj Object to test whether or not it is a function. * @see {@link https://api.jquery.com/jQuery.isFunction/} * @since 1.2 + * @deprecated 3.3 */ isFunction(obj: any): obj is Function; /** @@ -608,6 +613,7 @@ interface JQueryStatic { * @param value The value to be tested. * @see {@link https://api.jquery.com/jQuery.isNumeric/} * @since 1.7 + * @deprecated 3.3 */ isNumeric(value: any): value is number; /** @@ -624,6 +630,7 @@ interface JQueryStatic { * @param obj Object to test whether or not it is a window. * @see {@link https://api.jquery.com/jQuery.isWindow/} * @since 1.4.3 + * @deprecated 3.3 */ isWindow(obj: any): obj is Window; /** @@ -694,6 +701,7 @@ interface JQueryStatic { * * @see {@link https://api.jquery.com/jQuery.now/} * @since 1.4.3 + * @deprecated 3.3 Use Date.now(). */ now(): number; /** @@ -814,6 +822,7 @@ interface JQueryStatic { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G) => TReturn, @@ -826,6 +835,7 @@ interface JQueryStatic { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy(fn: (a: A, b: B, c: C, d: D, e: E, f: F) => TReturn, @@ -838,6 +848,7 @@ interface JQueryStatic { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy(fn: (a: A, b: B, c: C, d: D, e: E) => TReturn, @@ -850,6 +861,7 @@ interface JQueryStatic { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy(fn: (a: A, b: B, c: C, d: D) => TReturn, @@ -862,6 +874,7 @@ interface JQueryStatic { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy(fn: (a: A, b: B, c: C) => TReturn, @@ -874,6 +887,7 @@ interface JQueryStatic { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy(fn: (a: A, b: B) => TReturn, @@ -887,6 +901,7 @@ interface JQueryStatic { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4` * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy(fn: (a: A) => TReturn, @@ -899,6 +914,7 @@ interface JQueryStatic { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy(fn: () => TReturn, context: null | undefined): () => TReturn; @@ -914,6 +930,7 @@ interface JQueryStatic { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy(fn: (t: T) => TReturn, @@ -1028,6 +1052,7 @@ interface JQueryStatic { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy(fn: (t: T, u: U) => TReturn, @@ -1142,6 +1174,7 @@ interface JQueryStatic { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy(fn: (t: T, u: U, v: V) => TReturn, @@ -1256,6 +1296,7 @@ interface JQueryStatic { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy(fn: (t: T, u: U, v: V, w: W) => TReturn, @@ -1370,6 +1418,7 @@ interface JQueryStatic { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy(fn: (t: T, u: U, v: V, w: W, x: X) => TReturn, @@ -1484,6 +1540,7 @@ interface JQueryStatic { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy(fn: (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, @@ -1598,6 +1662,7 @@ interface JQueryStatic { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy { * @param context The object to which the context (this) of the function should be set. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy(fn: (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, @@ -1715,6 +1787,7 @@ interface JQueryStatic { * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.9 + * @deprecated 3.3 Use Function#bind. */ proxy(fn: (...args: any[]) => TReturn, context: null | undefined, @@ -1738,6 +1811,7 @@ interface JQueryStatic { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4` * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy(fn: () => TReturn, @@ -1853,6 +1934,7 @@ interface JQueryStatic { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy(fn: (...args: any[]) => TReturn, @@ -2787,6 +2925,7 @@ interface JQueryStatic { * @see {@link https://api.jquery.com/jQuery.proxy/} * @since 1.4 * @since 1.6 + * @deprecated 3.3 Use Function#bind. */ proxy(context: TContext, name: keyof TContext, @@ -2870,6 +3009,7 @@ interface JQueryStatic { * @param obj Object to get the internal JavaScript [[Class]] of. * @see {@link https://api.jquery.com/jQuery.type/} * @since 1.4.3 + * @deprecated 3.3 */ type(obj: any): 'array' | 'boolean' | 'date' | 'error' | 'function' | 'null' | 'number' | 'object' | 'regexp' | 'string' | 'symbol' | 'undefined'; /** @@ -3007,14 +3147,16 @@ interface JQuery extends Iterable * Adds the specified class(es) to each element in the set of matched elements. * * @param className One or more space-separated classes to be added to the class attribute of each matched element. + * An array of classes to be added to the class attribute of each matched element. * A function returning one or more space-separated class names to be added to the existing class * name(s). Receives the index position of the element in the set and the existing class name(s) as * arguments. Within the function, this refers to the current element in the set. * @see {@link https://api.jquery.com/addClass/} * @since 1.0 * @since 1.4 + * @since 3.3 */ - addClass(className: string | ((this: TElement, index: number, currentClassName: string) => string)): this; + addClass(className: JQuery.TypeOrArray | ((this: TElement, index: number, currentClassName: string) => string)): this; /** * Insert content, specified by the parameter, after each element in the set of matched elements. * @@ -3255,6 +3397,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/blur/} * @since 1.4.3 + * @deprecated 3.3 */ blur(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -3264,6 +3407,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/blur/} * @since 1.0 + * @deprecated 3.3 */ blur(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -3273,6 +3417,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/change/} * @since 1.4.3 + * @deprecated 3.3 */ change(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -3282,6 +3427,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/change/} * @since 1.0 + * @deprecated 3.3 */ change(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -3307,6 +3453,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/click/} * @since 1.4.3 + * @deprecated 3.3 */ click(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -3316,6 +3463,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/click/} * @since 1.0 + * @deprecated 3.3 */ click(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -3367,6 +3515,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/contextmenu/} * @since 1.4.3 + * @deprecated 3.3 */ contextmenu(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -3376,6 +3525,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/contextmenu/} * @since 1.0 + * @deprecated 3.3 */ contextmenu(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -3466,6 +3616,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/dblclick/} * @since 1.4.3 + * @deprecated 3.3 */ dblclick(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -3475,6 +3626,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/dblclick/} * @since 1.0 + * @deprecated 3.3 */ dblclick(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -3753,6 +3905,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/focus/} * @since 1.4.3 + * @deprecated 3.3 */ focus(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -3762,6 +3915,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/focus/} * @since 1.0 + * @deprecated 3.3 */ focus(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -3771,6 +3925,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/focusin/} * @since 1.4.3 + * @deprecated 3.3 */ focusin(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -3780,6 +3935,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/focusin/} * @since 1.4 + * @deprecated 3.3 */ focusin(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -3789,6 +3945,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/focusout/} * @since 1.4.3 + * @deprecated 3.3 */ focusout(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -3798,6 +3955,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/focusout/} * @since 1.4 + * @deprecated 3.3 */ focusout(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -4004,6 +4162,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/keydown/} * @since 1.4.3 + * @deprecated 3.3 */ keydown(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -4013,6 +4172,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/keydown/} * @since 1.0 + * @deprecated 3.3 */ keydown(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -4022,6 +4182,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/keypress/} * @since 1.4.3 + * @deprecated 3.3 */ keypress(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -4031,6 +4192,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/keypress/} * @since 1.0 + * @deprecated 3.3 */ keypress(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -4040,6 +4202,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/keyup/} * @since 1.4.3 + * @deprecated 3.3 */ keyup(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -4049,6 +4212,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/keyup/} * @since 1.0 + * @deprecated 3.3 */ keyup(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -4097,6 +4261,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/mousedown/} * @since 1.4.3 + * @deprecated 3.3 */ mousedown(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -4106,6 +4271,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/mousedown/} * @since 1.0 + * @deprecated 3.3 */ mousedown(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -4115,6 +4281,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/mouseenter/} * @since 1.4.3 + * @deprecated 3.3 */ mouseenter(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -4124,6 +4291,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/mouseenter/} * @since 1.0 + * @deprecated 3.3 */ mouseenter(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -4133,6 +4301,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/mouseleave/} * @since 1.4.3 + * @deprecated 3.3 */ mouseleave(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -4142,6 +4311,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/mouseleave/} * @since 1.0 + * @deprecated 3.3 */ mouseleave(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -4151,6 +4321,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/mousemove/} * @since 1.4.3 + * @deprecated 3.3 */ mousemove(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -4160,6 +4331,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/mousemove/} * @since 1.0 + * @deprecated 3.3 */ mousemove(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -4169,6 +4341,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/mouseout/} * @since 1.4.3 + * @deprecated 3.3 */ mouseout(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -4178,6 +4351,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/mouseout/} * @since 1.0 + * @deprecated 3.3 */ mouseout(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -4187,6 +4361,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/mouseover/} * @since 1.4.3 + * @deprecated 3.3 */ mouseover(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -4196,6 +4371,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/mouseover/} * @since 1.0 + * @deprecated 3.3 */ mouseover(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -4205,6 +4381,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/mouseup/} * @since 1.4.3 + * @deprecated 3.3 */ mouseup(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -4214,6 +4391,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/mouseup/} * @since 1.0 + * @deprecated 3.3 */ mouseup(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -4788,13 +4966,15 @@ interface JQuery extends Iterable * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. * * @param className One or more space-separated classes to be removed from the class attribute of each matched element. + * An array of classes to be removed from the class attribute of each matched element. * A function returning one or more space-separated class names to be removed. Receives the index * position of the element in the set and the old class value as arguments. * @see {@link https://api.jquery.com/removeClass/} * @since 1.0 * @since 1.4 + * @since 3.3 */ - removeClass(className?: string | ((this: TElement, index: number, className: string) => string)): this; + removeClass(className?: JQuery.TypeOrArray | ((this: TElement, index: number, className: string) => string)): this; /** * Remove a previously-stored piece of data. * @@ -4839,6 +5019,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/resize/} * @since 1.4.3 + * @deprecated 3.3 */ resize(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -4848,6 +5029,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/resize/} * @since 1.0 + * @deprecated 3.3 */ resize(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -4857,6 +5039,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/scroll/} * @since 1.4.3 + * @deprecated 3.3 */ scroll(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -4866,6 +5049,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/scroll/} * @since 1.0 + * @deprecated 3.3 */ scroll(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -4906,6 +5090,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/select/} * @since 1.4.3 + * @deprecated 3.3 */ select(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -4915,6 +5100,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/select/} * @since 1.0 + * @deprecated 3.3 */ select(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -5106,6 +5292,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/submit/} * @since 1.4.3 + * @deprecated 3.3 */ submit(eventData: TData, handler: JQuery.EventHandler | JQuery.EventHandlerBase>): this; @@ -5115,6 +5302,7 @@ interface JQuery extends Iterable * @param handler A function to execute each time the event is triggered. * @see {@link https://api.jquery.com/submit/} * @since 1.0 + * @deprecated 3.3 */ submit(handler?: JQuery.EventHandler | JQuery.EventHandlerBase> | false): this; /** @@ -5179,6 +5367,7 @@ interface JQuery extends Iterable * either the class's presence or the value of the state argument. * * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set. + * An array of classes to be toggled for each element in the matched set. * A function that returns class names to be toggled in the class attribute of each element in the * matched set. Receives the index position of the element in the set, the old class value, and the state as arguments. * @param state A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. @@ -5186,8 +5375,9 @@ interface JQuery extends Iterable * @since 1.0 * @since 1.3 * @since 1.4 + * @since 3.3 */ - toggleClass(className: string | ((this: TElement, index: number, className: string, state: TState) => string), + toggleClass(className: JQuery.TypeOrArray | ((this: TElement, index: number, className: string, state: TState) => string), state?: TState): this; /** * Add or remove one or more classes from each element in the set of matched elements, depending on diff --git a/types/jquery/jquery-tests.ts b/types/jquery/jquery-tests.ts index 338509a37a..6773f923ef 100644 --- a/types/jquery/jquery-tests.ts +++ b/types/jquery/jquery-tests.ts @@ -269,6 +269,11 @@ function JQueryStatic() { }); } + function camelCase() { + // $ExpectType string + $.camelCase('foo-bar'); + } + function contains() { // $ExpectType boolean $.contains(new HTMLElement(), new HTMLElement()); @@ -2650,6 +2655,9 @@ function JQuery() { // $ExpectType JQuery $('p').addClass('className'); + // $ExpectType JQuery + $('p').addClass(['dave', 'michał', 'oleg', 'richard', 'jason', 'timmy']); + // $ExpectType JQuery $('p').addClass(function(index, currentClassName) { // $ExpectType HTMLElement @@ -2672,6 +2680,9 @@ function JQuery() { // $ExpectType JQuery $('p').removeClass('className'); + // $ExpectType JQuery + $('p').removeClass(['dave', 'michał', 'oleg', 'richard', 'jason', 'timmy']); + // $ExpectType JQuery $('p').removeClass(function(index, currentClassName) { // $ExpectType HTMLElement @@ -2692,6 +2703,15 @@ function JQuery() { // $ExpectType JQuery $('p').toggleClass('className', true); + // $ExpectType JQuery + $('p').toggleClass('className'); + + // $ExpectType JQuery + $('p').toggleClass(['dave', 'michał', 'oleg', 'richard', 'jason', 'timmy'], false); + + // $ExpectType JQuery + $('p').toggleClass(['dave', 'michał', 'oleg', 'richard', 'jason', 'timmy']); + // $ExpectType JQuery $('p').toggleClass(function(index, className, state) { // $ExpectType HTMLElement diff --git a/types/jquery/tsconfig.json b/types/jquery/tsconfig.json index e481dc63c6..4b70421330 100644 --- a/types/jquery/tsconfig.json +++ b/types/jquery/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery/tslint.json b/types/jquery/tslint.json index dea67c016f..deae83dc66 100644 --- a/types/jquery/tslint.json +++ b/types/jquery/tslint.json @@ -9,6 +9,7 @@ "no-any-union": false, "no-arg": false, "no-boolean-literal-compare": false, + "no-const-enum": false, "no-declare-current-package": false, "no-empty-interface": false, "no-misused-new": false, diff --git a/types/jquery/v1/tsconfig.json b/types/jquery/v1/tsconfig.json index 02855a9f8e..eb53f56f94 100644 --- a/types/jquery/v1/tsconfig.json +++ b/types/jquery/v1/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery/v2/tsconfig.json b/types/jquery/v2/tsconfig.json index 03ea2df8de..35c2a9007d 100644 --- a/types/jquery/v2/tsconfig.json +++ b/types/jquery/v2/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquerymobile/tsconfig.json b/types/jquerymobile/tsconfig.json index fbbd8cb739..47fb771e9e 100644 --- a/types/jquerymobile/tsconfig.json +++ b/types/jquerymobile/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jqueryui/tsconfig.json b/types/jqueryui/tsconfig.json index ea7c9385c3..2b018f0062 100644 --- a/types/jqueryui/tsconfig.json +++ b/types/jqueryui/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-base64/tsconfig.json b/types/js-base64/tsconfig.json index 2e325222f7..3380190f21 100644 --- a/types/js-base64/tsconfig.json +++ b/types/js-base64/tsconfig.json @@ -1,20 +1,25 @@ { "compilerOptions": { "module": "commonjs", - "lib": ["es6"], + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "test/js-base64-module.test.ts", "test/js-base64-global.test.ts" ] -} +} \ No newline at end of file diff --git a/types/js-beautify/tsconfig.json b/types/js-beautify/tsconfig.json index 28b0a603af..cc2c018f82 100644 --- a/types/js-beautify/tsconfig.json +++ b/types/js-beautify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-clipper/tsconfig.json b/types/js-clipper/tsconfig.json index b4074f17c1..c9858c90d5 100644 --- a/types/js-clipper/tsconfig.json +++ b/types/js-clipper/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-combinatorics/tsconfig.json b/types/js-combinatorics/tsconfig.json index ff2a188dcb..fbba418acc 100644 --- a/types/js-combinatorics/tsconfig.json +++ b/types/js-combinatorics/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-cookie/tsconfig.json b/types/js-cookie/tsconfig.json index 63cd342137..a560d75efb 100644 --- a/types/js-cookie/tsconfig.json +++ b/types/js-cookie/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-data-angular/tsconfig.json b/types/js-data-angular/tsconfig.json index e5117ff27a..11abc585bf 100644 --- a/types/js-data-angular/tsconfig.json +++ b/types/js-data-angular/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-fixtures/tsconfig.json b/types/js-fixtures/tsconfig.json index 2f4cb02c4b..4a4c40a440 100644 --- a/types/js-fixtures/tsconfig.json +++ b/types/js-fixtures/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-git/tsconfig.json b/types/js-git/tsconfig.json index e53cf4f6d8..4c79ddd5b9 100644 --- a/types/js-git/tsconfig.json +++ b/types/js-git/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-md5/tsconfig.json b/types/js-md5/tsconfig.json index 6348210a6b..6a77ef18a2 100644 --- a/types/js-md5/tsconfig.json +++ b/types/js-md5/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-priority-queue/tsconfig.json b/types/js-priority-queue/tsconfig.json index 12e9d7f000..c9efddc5ca 100644 --- a/types/js-priority-queue/tsconfig.json +++ b/types/js-priority-queue/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-quantities/tsconfig.json b/types/js-quantities/tsconfig.json index 1866fc5155..1d1f7f7a20 100644 --- a/types/js-quantities/tsconfig.json +++ b/types/js-quantities/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-schema/tsconfig.json b/types/js-schema/tsconfig.json index 1c26cda396..2fccac00c6 100644 --- a/types/js-schema/tsconfig.json +++ b/types/js-schema/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-search/tsconfig.json b/types/js-search/tsconfig.json index eb6253aec9..c940fa5db5 100644 --- a/types/js-search/tsconfig.json +++ b/types/js-search/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-to-java/tsconfig.json b/types/js-to-java/tsconfig.json index 6a927d9578..2aac508ed8 100644 --- a/types/js-to-java/tsconfig.json +++ b/types/js-to-java/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-url/tsconfig.json b/types/js-url/tsconfig.json index 117bf43420..a2cc751fb6 100644 --- a/types/js-url/tsconfig.json +++ b/types/js-url/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-yaml/tsconfig.json b/types/js-yaml/tsconfig.json index c36931fa61..8626455989 100644 --- a/types/js-yaml/tsconfig.json +++ b/types/js-yaml/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "js-yaml-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/js.spec/tsconfig.json b/types/js.spec/tsconfig.json index c7a1d13a57..063bbacc55 100644 --- a/types/js.spec/tsconfig.json +++ b/types/js.spec/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsbn/tsconfig.json b/types/jsbn/tsconfig.json index 68fb5fc2d5..a6c95282f7 100644 --- a/types/jsbn/tsconfig.json +++ b/types/jsbn/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jschannel/tsconfig.json b/types/jschannel/tsconfig.json index 83727a281c..4ba367418e 100644 --- a/types/jschannel/tsconfig.json +++ b/types/jschannel/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "jschannel-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/jscrollpane/tsconfig.json b/types/jscrollpane/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/jscrollpane/tsconfig.json +++ b/types/jscrollpane/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/jsdeferred/tsconfig.json b/types/jsdeferred/tsconfig.json index 7b6fbf8171..1cbd4c6293 100644 --- a/types/jsdeferred/tsconfig.json +++ b/types/jsdeferred/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsdom/tsconfig.json b/types/jsdom/tsconfig.json index fe7f9dd41f..ef95267a70 100644 --- a/types/jsdom/tsconfig.json +++ b/types/jsdom/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsdom/v2/tsconfig.json b/types/jsdom/v2/tsconfig.json index 3027a13385..32ce5274b0 100644 --- a/types/jsdom/v2/tsconfig.json +++ b/types/jsdom/v2/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsen/tsconfig.json b/types/jsen/tsconfig.json index cf32dd60a8..fb95888bdb 100644 --- a/types/jsen/tsconfig.json +++ b/types/jsen/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsend/tsconfig.json b/types/jsend/tsconfig.json index 13a1b84a23..2aa1162a01 100644 --- a/types/jsend/tsconfig.json +++ b/types/jsend/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsesc/tsconfig.json b/types/jsesc/tsconfig.json index d9f4194987..656652f612 100644 --- a/types/jsesc/tsconfig.json +++ b/types/jsesc/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsfl/tsconfig.json b/types/jsfl/tsconfig.json index 581bbb4199..6c907b4e28 100644 --- a/types/jsfl/tsconfig.json +++ b/types/jsfl/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsforce/tsconfig.json b/types/jsforce/tsconfig.json index 0d480d799f..73623d7e99 100644 --- a/types/jsforce/tsconfig.json +++ b/types/jsforce/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jshamcrest/tsconfig.json b/types/jshamcrest/tsconfig.json index dd54b4d553..8972d0fa35 100644 --- a/types/jshamcrest/tsconfig.json +++ b/types/jshamcrest/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsmockito/tsconfig.json b/types/jsmockito/tsconfig.json index 3b81da0df0..85db6db99b 100644 --- a/types/jsmockito/tsconfig.json +++ b/types/jsmockito/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsnox/jsnox-tests.ts b/types/jsnox/jsnox-tests.ts index d545581591..f03c33e917 100644 --- a/types/jsnox/jsnox-tests.ts +++ b/types/jsnox/jsnox-tests.ts @@ -1,5 +1,5 @@ import * as React from "react"; -import * as jsnox from "jsnox"; +import jsnox = require("jsnox"); const $ = jsnox(React); interface PersonProps { diff --git a/types/jsnox/tsconfig.json b/types/jsnox/tsconfig.json index 03450f596c..2d6ef33c2f 100644 --- a/types/jsnox/tsconfig.json +++ b/types/jsnox/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-editor/tsconfig.json b/types/json-editor/tsconfig.json index accf3485bf..9bdce0acb6 100644 --- a/types/json-editor/tsconfig.json +++ b/types/json-editor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-js/tsconfig.json b/types/json-js/tsconfig.json index 0bac144d32..1ca12a9cee 100644 --- a/types/json-js/tsconfig.json +++ b/types/json-js/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-merge-patch/tsconfig.json b/types/json-merge-patch/tsconfig.json index 2c3683dc41..f3a8a23907 100644 --- a/types/json-merge-patch/tsconfig.json +++ b/types/json-merge-patch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-patch/tsconfig.json b/types/json-patch/tsconfig.json index bcd1d84d36..ef71692ebc 100644 --- a/types/json-patch/tsconfig.json +++ b/types/json-patch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-pointer/tsconfig.json b/types/json-pointer/tsconfig.json index f5b746e548..1f38a08c46 100644 --- a/types/json-pointer/tsconfig.json +++ b/types/json-pointer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-query/tsconfig.json b/types/json-query/tsconfig.json index 9a317f4d83..85f1dfd7f7 100644 --- a/types/json-query/tsconfig.json +++ b/types/json-query/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-rpc-ws/tsconfig.json b/types/json-rpc-ws/tsconfig.json index d062401159..9ee376affa 100644 --- a/types/json-rpc-ws/tsconfig.json +++ b/types/json-rpc-ws/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-schema/tsconfig.json b/types/json-schema/tsconfig.json index 443caf8239..dabf0dd1ee 100644 --- a/types/json-schema/tsconfig.json +++ b/types/json-schema/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-socket/tsconfig.json b/types/json-socket/tsconfig.json index 5901e0b745..a173dc8fb8 100644 --- a/types/json-socket/tsconfig.json +++ b/types/json-socket/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-stable-stringify/tsconfig.json b/types/json-stable-stringify/tsconfig.json index bb605781c5..4b8cd49f28 100644 --- a/types/json-stable-stringify/tsconfig.json +++ b/types/json-stable-stringify/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-stringify-safe/tsconfig.json b/types/json-stringify-safe/tsconfig.json index f4ca1b5e30..f86443faca 100644 --- a/types/json-stringify-safe/tsconfig.json +++ b/types/json-stringify-safe/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json2md/tsconfig.json b/types/json2md/tsconfig.json index e0fd95f150..44162d1678 100644 --- a/types/json2md/tsconfig.json +++ b/types/json2md/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json5/tsconfig.json b/types/json5/tsconfig.json index bf318f8b10..5bafbb80e7 100644 --- a/types/json5/tsconfig.json +++ b/types/json5/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsonata/tsconfig.json b/types/jsonata/tsconfig.json index c047ca52bf..38ed068b63 100644 --- a/types/jsonata/tsconfig.json +++ b/types/jsonata/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsoneditor/tsconfig.json b/types/jsoneditor/tsconfig.json index 299abd4f68..7afee352a9 100644 --- a/types/jsoneditor/tsconfig.json +++ b/types/jsoneditor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsoneditoronline/tsconfig.json b/types/jsoneditoronline/tsconfig.json index 25ef8ae26a..134dd22ef9 100644 --- a/types/jsoneditoronline/tsconfig.json +++ b/types/jsoneditoronline/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsonfile/tsconfig.json b/types/jsonfile/tsconfig.json index 287f9558c5..268bc6f4d0 100644 --- a/types/jsonfile/tsconfig.json +++ b/types/jsonfile/tsconfig.json @@ -14,10 +14,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ "index.d.ts", "jsonfile-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/jsonminify/tsconfig.json b/types/jsonminify/tsconfig.json index 0df74ef465..bc333f1dd1 100644 --- a/types/jsonminify/tsconfig.json +++ b/types/jsonminify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsonnet/tsconfig.json b/types/jsonnet/tsconfig.json index c30a5a2ffb..e10b49c8ac 100644 --- a/types/jsonnet/tsconfig.json +++ b/types/jsonnet/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsonp/tsconfig.json b/types/jsonp/tsconfig.json index 760822ff6b..988ca90c56 100644 --- a/types/jsonp/tsconfig.json +++ b/types/jsonp/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsonpath/tsconfig.json b/types/jsonpath/tsconfig.json index 04b06d5baf..853c26cb04 100644 --- a/types/jsonpath/tsconfig.json +++ b/types/jsonpath/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsonrpc-serializer/tsconfig.json b/types/jsonrpc-serializer/tsconfig.json index f3a91d58c1..7558589d7b 100644 --- a/types/jsonrpc-serializer/tsconfig.json +++ b/types/jsonrpc-serializer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsonstream/tsconfig.json b/types/jsonstream/tsconfig.json index 9fe19a4c05..5ebb03c9dc 100644 --- a/types/jsonstream/tsconfig.json +++ b/types/jsonstream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsonwebtoken/tsconfig.json b/types/jsonwebtoken/tsconfig.json index c16a931577..fcc3affcaf 100644 --- a/types/jsonwebtoken/tsconfig.json +++ b/types/jsonwebtoken/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jspdf/tsconfig.json b/types/jspdf/tsconfig.json index 697de6db64..6e5edabf45 100644 --- a/types/jspdf/tsconfig.json +++ b/types/jspdf/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsqrcode/tsconfig.json b/types/jsqrcode/tsconfig.json index dcc6bf63a2..487b814e24 100644 --- a/types/jsqrcode/tsconfig.json +++ b/types/jsqrcode/tsconfig.json @@ -11,6 +11,7 @@ "strictFunctionTypes": true, "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/jsrender/tsconfig.json b/types/jsrender/tsconfig.json index 71bcce3848..70dc2d65fe 100644 --- a/types/jsrender/tsconfig.json +++ b/types/jsrender/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsreport-core/index.d.ts b/types/jsreport-core/index.d.ts new file mode 100644 index 0000000000..23413889da --- /dev/null +++ b/types/jsreport-core/index.d.ts @@ -0,0 +1,96 @@ +// Type definitions for jsreport-core 1.5 +// Project: http://jsreport.net +// Definitions by: taoqf +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// +import { Buffer } from 'buffer'; +import { Readable } from 'stream'; + +declare namespace JsReport { + type helpers = string | { [fun: string]: (...args: any[]) => any }; + + interface RenderOptions { + template: { + content: string; + engine: 'jsrender' | 'handlebars' | 'ejs' | 'jade' | string; + helpers?: helpers; + recipe: 'phantom-pdf' | 'electron-pdf' | 'text' | 'xlsx' | 'html-to-xlsx' | 'phantom-image' | 'html-to-text' | 'fop-pdf' | 'client-html' | 'wrapped-html' | 'wkhtmltopdf' | string; + }; + data?: any; + } + + interface Report { + content: Buffer; + stream: Readable; + headers: { + [header: string]: string | number | boolean; + }; + } + + interface Request { + template: { + content: string; + }; + } + + // interface Response { + // // todo + // } + + type Response = any; + + interface Listener { + add(type: string, callback: (req: Request, res: Response, err: any) => void): void; + } + + interface Logger { + add(logger: any, options?: { + level: 'debug' | 'info' | 'log' | 'warn' | 'error'; + }): void; + } + + interface Collection { + find(query: { + [field: string]: any; + }): Promise; + } + + interface DocumentStore { + collection(options: string): Collection; + } + + interface JsReporter { + afterRenderListeners: Listener; + afterTemplatingEnginesExecutedListeners: Listener; + beforeRenderListeners: Listener; + documentStore: DocumentStore; + initializeListeners: Listener; + logger: Logger; + validateRenderListeners: Listener; + init(): Promise; + render(options: RenderOptions): Promise; + use(extension: any): any; + } +} + +declare function JsReport(options?: Partial<{ + autoTempCleanup: boolean; + dataDirectory: string; + extensionsLocationCache: boolean; + loadConfig: boolean; + logger: { + silent: boolean; + }; + rootDirectory: string; + scripts: { + allowedModules: string[]; + }; + tasks: { + [task: string]: any; + }; + tempDirectory: string; +}>): JsReport.JsReporter; + +export = JsReport; diff --git a/types/jsreport-core/jsreport-core-tests.ts b/types/jsreport-core/jsreport-core-tests.ts new file mode 100644 index 0000000000..c7ded76f4d --- /dev/null +++ b/types/jsreport-core/jsreport-core-tests.ts @@ -0,0 +1,20 @@ +import JsReport = require('jsreport-core'); + +const jsreport = JsReport(); +jsreport.init().then(() => { + return jsreport.render({ + template: { + content: '

Hello {{:foo}}

', + engine: 'jsrender', + recipe: 'phantom-pdf' + }, + data: { + foo: "world" + } + }).then((resp) => { + // prints pdf with headline Hello world + console.log(resp.content.toString()); + }); +}).catch((e) => { + console.log(e); +}); diff --git a/types/jsreport-core/tsconfig.json b/types/jsreport-core/tsconfig.json new file mode 100644 index 0000000000..b10a124791 --- /dev/null +++ b/types/jsreport-core/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "esnext" + ], + "strictFunctionTypes": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "jsreport-core-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jsreport-core/tslint.json b/types/jsreport-core/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jsreport-core/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jsrp/tsconfig.json b/types/jsrp/tsconfig.json index eee1ca1391..373b2161c7 100644 --- a/types/jsrp/tsconfig.json +++ b/types/jsrp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jss/tsconfig.json b/types/jss/tsconfig.json index f34791192c..c04079a405 100644 --- a/types/jss/tsconfig.json +++ b/types/jss/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "jss-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/jssha/tsconfig.json b/types/jssha/tsconfig.json index 9e54d3c27a..d510b70414 100644 --- a/types/jssha/tsconfig.json +++ b/types/jssha/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/jstimezonedetect/tsconfig.json b/types/jstimezonedetect/tsconfig.json index b774b2f27b..df242a4ba3 100644 --- a/types/jstimezonedetect/tsconfig.json +++ b/types/jstimezonedetect/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jstorage/tsconfig.json b/types/jstorage/tsconfig.json index 7d03130196..80858e1d65 100644 --- a/types/jstorage/tsconfig.json +++ b/types/jstorage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jstree/tsconfig.json b/types/jstree/tsconfig.json index 235aef261c..6552fc878b 100644 --- a/types/jstree/tsconfig.json +++ b/types/jstree/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsts/tsconfig.json b/types/jsts/tsconfig.json index ac8ce72682..66fe8f3951 100644 --- a/types/jsts/tsconfig.json +++ b/types/jsts/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsuite/tsconfig.json b/types/jsuite/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/jsuite/tsconfig.json +++ b/types/jsuite/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/jsuri/tsconfig.json b/types/jsuri/tsconfig.json index aa5a702117..afbfd8a324 100644 --- a/types/jsuri/tsconfig.json +++ b/types/jsuri/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsurl/tsconfig.json b/types/jsurl/tsconfig.json index 3b795be015..2423c10630 100644 --- a/types/jsurl/tsconfig.json +++ b/types/jsurl/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsx-chai/tsconfig.json b/types/jsx-chai/tsconfig.json index 5ff33d9bec..834397a636 100644 --- a/types/jsx-chai/tsconfig.json +++ b/types/jsx-chai/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jszip/jszip-tests.ts b/types/jszip/jszip-tests.ts index 81ccda09db..5d332a8070 100644 --- a/types/jszip/jszip-tests.ts +++ b/types/jszip/jszip-tests.ts @@ -1,4 +1,4 @@ -import * as JSZip from 'jszip'; +import JSZip = require('jszip'); const SEVERITY = { DEBUG: 0, diff --git a/types/jszip/tsconfig.json b/types/jszip/tsconfig.json index c5a1abf752..41412a6a91 100644 --- a/types/jszip/tsconfig.json +++ b/types/jszip/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jug/tsconfig.json b/types/jug/tsconfig.json index ceaf8a8e0a..22b58e92cd 100644 --- a/types/jug/tsconfig.json +++ b/types/jug/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jui-core/tsconfig.json b/types/jui-core/tsconfig.json index 67f1eb8560..74b17d0023 100644 --- a/types/jui-core/tsconfig.json +++ b/types/jui-core/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jui-grid/tsconfig.json b/types/jui-grid/tsconfig.json index 44d9c93211..27e8059449 100644 --- a/types/jui-grid/tsconfig.json +++ b/types/jui-grid/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jui/tsconfig.json b/types/jui/tsconfig.json index 6ea9a2ea6b..c3a1433f50 100644 --- a/types/jui/tsconfig.json +++ b/types/jui/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jump.js/tsconfig.json b/types/jump.js/tsconfig.json index 58186807e9..3ee1305fa6 100644 --- a/types/jump.js/tsconfig.json +++ b/types/jump.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jweixin/tsconfig.json b/types/jweixin/tsconfig.json index d2740833c5..c4bb5b925b 100644 --- a/types/jweixin/tsconfig.json +++ b/types/jweixin/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jwplayer/index.d.ts b/types/jwplayer/index.d.ts index 32c3521f22..87a7526267 100644 --- a/types/jwplayer/index.d.ts +++ b/types/jwplayer/index.d.ts @@ -2,6 +2,7 @@ // Project: http://developer.longtailvideo.com/trac/ // Definitions by: Martin Duparc // Tomer Kruvi +// Philipp Gürtler // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // JW Player is the leading HTML5 & Flash video player, optimized for mobile and the desktop. Easy enough for beginners, advanced enough for pros. @@ -224,6 +225,13 @@ interface EventCallback { (param: T): void; } +interface Region { + x: 0; // x and y will always be 0 according to https://developer.jwplayer.com/jw-player/docs/javascript-api-reference/#jwplayergetsaferegion + y: 0; + width: number; + height: number; +} + interface JWPlayer { addButton(icon: string, label: string, handler: () => void, id: string): void; getAudioTracks(): any[]; @@ -243,7 +251,7 @@ interface JWPlayer { getPosition(): number; getQualityLevels(): any[]; getRenderingMode(): string; - getSafeRegion(): any[]; + getSafeRegion(): Region; getState(): string; getVolume(): number; getEnvironment(): Environment; diff --git a/types/jwplayer/tsconfig.json b/types/jwplayer/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/jwplayer/tsconfig.json +++ b/types/jwplayer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/jws/tsconfig.json b/types/jws/tsconfig.json index a8a2f625d3..e9dbaeac09 100644 --- a/types/jws/tsconfig.json +++ b/types/jws/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "jws-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/jwt-client/tsconfig.json b/types/jwt-client/tsconfig.json index 3611c59237..b8ddbc0257 100644 --- a/types/jwt-client/tsconfig.json +++ b/types/jwt-client/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jwt-decode/tsconfig.json b/types/jwt-decode/tsconfig.json index f53a16f5a6..3cc921989b 100644 --- a/types/jwt-decode/tsconfig.json +++ b/types/jwt-decode/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jwt-decode/v1/tsconfig.json b/types/jwt-decode/v1/tsconfig.json index 261fdece08..73afba4a58 100644 --- a/types/jwt-decode/v1/tsconfig.json +++ b/types/jwt-decode/v1/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jwt-simple/tsconfig.json b/types/jwt-simple/tsconfig.json index 52f84f6e77..9a3c56cf3e 100644 --- a/types/jwt-simple/tsconfig.json +++ b/types/jwt-simple/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kafka-node/index.d.ts b/types/kafka-node/index.d.ts index 4f566a8587..71d1fd6728 100644 --- a/types/kafka-node/index.d.ts +++ b/types/kafka-node/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: Daniel Imrie-Situnayake , Bill , Michael Haan , Amiram Korach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + // # Classes export class Client { constructor(connectionString: string, clientId?: string, options?: ZKOptions, noBatchOptions?: AckBatchOptions, sslOptions?: any); @@ -88,24 +90,24 @@ export class Offset { } export class KeyedMessage { - constructor(key: string, message: string); + constructor(key: string, value: string | Buffer); } // # Interfaces export interface Message { - topic: string; - value: string; - offset?: number; - partition?: number; - highWaterOffset?: number; - key?: number; -} + topic: string; + value: string | Buffer; + offset?: number; + partition?: number; + highWaterOffset?: number; + key?: string; + } export interface ProducerOptions { - requireAcks?: number; - ackTimeoutMs?: number; - partitionerType?: number; + requireAcks?: number; + ackTimeoutMs?: number; + partitionerType?: number; } export interface KafkaClientOptions { diff --git a/types/kafka-node/tsconfig.json b/types/kafka-node/tsconfig.json index 154c35e191..97ce936047 100644 --- a/types/kafka-node/tsconfig.json +++ b/types/kafka-node/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/karma-chai-sinon/tsconfig.json b/types/karma-chai-sinon/tsconfig.json index 86c4fa3299..aa4d11fa60 100644 --- a/types/karma-chai-sinon/tsconfig.json +++ b/types/karma-chai-sinon/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/karma-chai/tsconfig.json b/types/karma-chai/tsconfig.json index 726bb90e80..775b764e40 100644 --- a/types/karma-chai/tsconfig.json +++ b/types/karma-chai/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/karma-coverage/tsconfig.json b/types/karma-coverage/tsconfig.json index fe130be15a..492678b674 100644 --- a/types/karma-coverage/tsconfig.json +++ b/types/karma-coverage/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/karma-fixture/tsconfig.json b/types/karma-fixture/tsconfig.json index 0b39c302b4..9376aa9424 100644 --- a/types/karma-fixture/tsconfig.json +++ b/types/karma-fixture/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/karma-jasmine/tsconfig.json b/types/karma-jasmine/tsconfig.json index 54f70b6c45..6de5629a75 100644 --- a/types/karma-jasmine/tsconfig.json +++ b/types/karma-jasmine/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/karma-webpack/tsconfig.json b/types/karma-webpack/tsconfig.json index 86996cdcfa..e019bd4bdf 100644 --- a/types/karma-webpack/tsconfig.json +++ b/types/karma-webpack/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/karma/tsconfig.json b/types/karma/tsconfig.json index 23c81534d2..157092c790 100644 --- a/types/karma/tsconfig.json +++ b/types/karma/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/katex/tsconfig.json b/types/katex/tsconfig.json index 2cf3297aca..3bad4a0cd9 100644 --- a/types/katex/tsconfig.json +++ b/types/katex/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kcors/tsconfig.json b/types/kcors/tsconfig.json index 3322dc4921..4eb388863a 100644 --- a/types/kcors/tsconfig.json +++ b/types/kcors/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kdbush/tsconfig.json b/types/kdbush/tsconfig.json index 11107837a0..79fe884afe 100644 --- a/types/kdbush/tsconfig.json +++ b/types/kdbush/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kefir/tsconfig.json b/types/kefir/tsconfig.json index e1d57fe2e3..7fc74e6713 100644 --- a/types/kefir/tsconfig.json +++ b/types/kefir/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kendo-ui/index.d.ts b/types/kendo-ui/index.d.ts index 2ef00bd75a..6ea7fea725 100644 --- a/types/kendo-ui/index.d.ts +++ b/types/kendo-ui/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Kendo UI Professional v2017.3.913 +// Type definitions for Kendo UI Professional v2018.1.117 // Project: http://www.telerik.com/kendo-ui // Definitions by: Telerik // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -91,8 +91,39 @@ declare namespace kendo { }; var cultures: {[culture: string] : { - name?: string; - calendar?: { + name?: string; + calendar?: { + AM: string[]; + PM: string[]; + days: { + names: string[]; + namesAbbr: string[]; + namesShort: string[]; + firstDay: number; + }; + months: { + names: string[]; + namesAbbr: string[]; + }; + patterns: { + D: string; + F: string; + G: string; + M: string; + T: string; + Y: string; + d: string; + g: string; + m: string; + s: string; + t: string; + u: string; + y: string; + }; + twoDigitYearMax: number; + }; + calendars?: { + standard: { AM: string[]; PM: string[]; days: { @@ -122,57 +153,25 @@ declare namespace kendo { }; twoDigitYearMax: number; }; - calendars?: { - standard: { - AM: string[]; - PM: string[]; - days: { - names: string[]; - namesAbbr: string[]; - namesShort: string[]; - firstDay: number; - }; - months: { - names: string[]; - namesAbbr: string[]; - }; - patterns: { - D: string; - F: string; - G: string; - M: string; - T: string; - Y: string; - d: string; - g: string; - m: string; - s: string; - t: string; - u: string; - y: string; - }; - twoDigitYearMax: number; - }; - }; - numberFormat?: { - currency: { - decimals: number; - groupSize: number[]; - pattern: string[]; - symbol: string; - }; + }; + numberFormat?: { + currency: { decimals: number; groupSize: number[]; pattern: string[]; - percent: { - decimals: number; - groupSize: number[]; - pattern: string[]; - symbol: string; - }; + symbol: string; }; - } - }; + decimals: number; + groupSize: number[]; + pattern: string[]; + percent: { + decimals: number; + groupSize: number[]; + pattern: string[]; + symbol: string; + }; + }; + }}; function format(format: string, ...values: any[]): string; @@ -307,7 +306,7 @@ declare namespace kendo { } class ViewContainer extends Observable { - view: View; + view: View; } class Layout extends View { @@ -959,7 +958,7 @@ declare namespace kendo.data { } interface DataSourceSchemaWithConstructorModel extends DataSourceSchema { - model?: typeof Model; + model?: typeof Model; } interface DataSourceSchemaModel { @@ -997,7 +996,7 @@ declare namespace kendo.data { max?: any; minLength?: any; maxLength?: any; - [rule: string]: any; + [rule: string]: any; } class ObservableArray extends Observable { @@ -1010,7 +1009,7 @@ declare namespace kendo.data { every(callback: (item: Object, index: number, source: ObservableArray) => boolean): boolean; filter(callback: (item: Object, index: number, source: ObservableArray) => boolean): any[]; find(callback: (item: Object, index: number, source: ObservableArray) => boolean): any; - forEach(callback: (item: Object, index: number, source: ObservableArray) => void): void; + forEach(callback: (item: Object, index: number, source: ObservableArray) => void ): void; indexOf(item: any): number; join(separator: string): string; map(callback: (item: Object, index: number, source: ObservableArray) => any): any[]; @@ -1258,7 +1257,7 @@ declare namespace kendo.data { type?: string; change? (e: DataSourceChangeEvent): void; error?(e: DataSourceErrorEvent): void; - push?(e: DataSourcePushEvent): void; + push?(e: DataSourcePushEvent): void; sync?(e: DataSourceEvent): void; requestStart?(e: DataSourceRequestStartEvent): void; requestEnd?(e: DataSourceRequestEndEvent): void; @@ -1288,9 +1287,9 @@ declare namespace kendo.data { node?: any; } - interface DataSourcePushEvent extends DataSourceEvent { + interface DataSourcePushEvent extends DataSourceEvent { items?: DataSourceItemOrGroup[]; - type?: string; + type?: string; } @@ -1371,20 +1370,19 @@ declare namespace kendo.ui { drop?(e: DropTargetDropEvent): void; } - interface DropTargetEvent { + interface DropTargetEvent extends JQueryEventObject { sender?: DropTarget; + draggable?: kendo.ui.Draggable; + dropTarget?: JQuery } interface DropTargetDragenterEvent extends DropTargetEvent { - draggable?: kendo.ui.Draggable; } interface DropTargetDragleaveEvent extends DropTargetEvent { - draggable?: kendo.ui.Draggable; } interface DropTargetDropEvent extends DropTargetEvent { - draggable?: kendo.ui.Draggable; } class DropTargetArea extends kendo.ui.Widget{ @@ -1499,7 +1497,7 @@ declare namespace kendo.mobile { statusBarStyle?: string; transition?: string; useNativeScrolling?: boolean; - init?(e: ApplicationEvent): void; + init?(e: ApplicationEvent): void; } interface ApplicationEvent { @@ -1545,7 +1543,7 @@ declare namespace kendo.dataviz.map.layer { declare namespace kendo.drawing.pdf { function saveAs(group: kendo.drawing.Group, fileName: string, - proxyUrl?: string, callback?: Function): void; + proxyUrl?: string, callback?: Function): void; } declare namespace kendo.ui { @@ -1642,7 +1640,7 @@ declare namespace kendo.ui { interface AutoCompleteOptions { name?: string; - animation?: boolean|AutoCompleteAnimation; + animation?: boolean | AutoCompleteAnimation; autoWidth?: boolean; dataSource?: any|any|kendo.data.DataSource; clearButton?: boolean; @@ -1667,7 +1665,7 @@ declare namespace kendo.ui { template?: string|Function; value?: string; valuePrimitive?: boolean; - virtual?: boolean|AutoCompleteVirtual; + virtual?: boolean | AutoCompleteVirtual; change?(e: AutoCompleteChangeEvent): void; close?(e: AutoCompleteCloseEvent): void; dataBound?(e: AutoCompleteDataBoundEvent): void; @@ -1741,6 +1739,62 @@ declare namespace kendo.ui { } + class ButtonGroup extends kendo.ui.Widget { + + static fn: ButtonGroup; + + options: ButtonGroupOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): ButtonGroup; + + constructor(element: Element, options?: ButtonGroupOptions); + + + badge(button: string, value: string): string; + badge(button: string, value: boolean): string; + badge(button: number, value: string): string; + badge(button: number, value: boolean): string; + current(): JQuery; + destroy(): void; + enable(enable: boolean): void; + select(li: JQuery): void; + select(li: number): void; + + } + + interface ButtonGroupItem { + attributes?: any; + badge?: string; + enabled?: boolean; + icon?: string; + imageUrl?: string; + selected?: boolean; + text?: string; + } + + interface ButtonGroupOptions { + name?: string; + enable?: boolean; + index?: number; + selection?: string; + items?: ButtonGroupItem[]; + select?(e: ButtonGroupSelectEvent): void; + } + interface ButtonGroupEvent { + sender: ButtonGroup; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface ButtonGroupSelectEvent extends ButtonGroupEvent { + index?: number; + } + + class Calendar extends kendo.ui.Widget { static fn: Calendar; @@ -2030,7 +2084,7 @@ declare namespace kendo.ui { text?: string; value?: string; valuePrimitive?: boolean; - virtual?: boolean|ComboBoxVirtual; + virtual?: boolean | ComboBoxVirtual; change?(e: ComboBoxChangeEvent): void; close?(e: ComboBoxCloseEvent): void; dataBound?(e: ComboBoxDataBoundEvent): void; @@ -2161,7 +2215,7 @@ declare namespace kendo.ui { interface ContextMenuOptions { name?: string; alignToAnchor?: boolean; - animation?: boolean|ContextMenuAnimation; + animation?: boolean | ContextMenuAnimation; appendTo?: string|JQuery; closeOnClick?: boolean; copyAnchorStyles?: boolean; @@ -2335,7 +2389,7 @@ declare namespace kendo.ui { interface DatePickerOptions { name?: string; - animation?: boolean|DatePickerAnimation; + animation?: boolean | DatePickerAnimation; ARIATemplate?: string; culture?: string; dateInput?: boolean; @@ -2428,7 +2482,7 @@ declare namespace kendo.ui { interface DateTimePickerOptions { name?: string; - animation?: boolean|DateTimePickerAnimation; + animation?: boolean | DateTimePickerAnimation; ARIATemplate?: string; culture?: string; dateInput?: boolean; @@ -2524,7 +2578,7 @@ declare namespace kendo.ui { interface DialogOptions { name?: string; actions?: DialogAction[]; - animation?: boolean|DialogAnimation; + animation?: boolean | DialogAnimation; buttonLayout?: string; closable?: boolean; content?: string; @@ -2628,7 +2682,7 @@ declare namespace kendo.ui { interface DropDownListOptions { name?: string; - animation?: boolean|DropDownListAnimation; + animation?: boolean | DropDownListAnimation; autoBind?: boolean; autoWidth?: boolean; cascadeFrom?: string; @@ -2657,7 +2711,7 @@ declare namespace kendo.ui { text?: string; value?: string; valuePrimitive?: boolean; - virtual?: boolean|DropDownListVirtual; + virtual?: boolean | DropDownListVirtual; change?(e: DropDownListChangeEvent): void; close?(e: DropDownListCloseEvent): void; dataBound?(e: DropDownListDataBoundEvent): void; @@ -2765,9 +2819,9 @@ declare namespace kendo.ui { } interface EditorFileBrowserSchemaModelFields { - name?: EditorFileBrowserSchemaModelFieldsName; - type?: EditorFileBrowserSchemaModelFieldsType; - size?: EditorFileBrowserSchemaModelFieldsSize; + name?: string | EditorFileBrowserSchemaModelFieldsName; + type?: string | EditorFileBrowserSchemaModelFieldsType; + size?: string | EditorFileBrowserSchemaModelFieldsSize; } interface EditorFileBrowserSchemaModel { @@ -2803,11 +2857,11 @@ declare namespace kendo.ui { } interface EditorFileBrowserTransport { - read?: EditorFileBrowserTransportRead; + read?: string | Function | EditorFileBrowserTransportRead; uploadUrl?: string; fileUrl?: string|Function; - destroy?: EditorFileBrowserTransportDestroy; - create?: EditorFileBrowserTransportCreate; + destroy?: string | EditorFileBrowserTransportDestroy; + create?: string | EditorFileBrowserTransportCreate; } interface EditorFileBrowser { @@ -2847,9 +2901,9 @@ declare namespace kendo.ui { } interface EditorImageBrowserSchemaModelFields { - name?: EditorImageBrowserSchemaModelFieldsName; - type?: EditorImageBrowserSchemaModelFieldsType; - size?: EditorImageBrowserSchemaModelFieldsSize; + name?: string | EditorImageBrowserSchemaModelFieldsName; + type?: string | EditorImageBrowserSchemaModelFieldsType; + size?: string | EditorImageBrowserSchemaModelFieldsSize; } interface EditorImageBrowserSchemaModel { @@ -2885,12 +2939,12 @@ declare namespace kendo.ui { } interface EditorImageBrowserTransport { - read?: EditorImageBrowserTransportRead; + read?: string | Function | EditorImageBrowserTransportRead; thumbnailUrl?: string|Function; uploadUrl?: string; imageUrl?: string|Function; - destroy?: EditorImageBrowserTransportDestroy; - create?: EditorImageBrowserTransportCreate; + destroy?: string | EditorImageBrowserTransportDestroy; + create?: string | EditorImageBrowserTransportCreate; } interface EditorImageBrowser { @@ -3079,11 +3133,11 @@ declare namespace kendo.ui { deserialization?: EditorDeserialization; domain?: string; encoded?: boolean; - immutables?: boolean|EditorImmutables; + immutables?: boolean | EditorImmutables; messages?: EditorMessages; pasteCleanup?: EditorPasteCleanup; pdf?: EditorPdf; - resizable?: boolean|EditorResizable; + resizable?: boolean | EditorResizable; serialization?: EditorSerialization; stylesheets?: any; tools?: EditorTool[]; @@ -3142,6 +3196,7 @@ declare namespace kendo.ui { clear?: string; filter?: string; info?: string; + title?: string; additionalValue?: string; additionalOperator?: string; logic?: string; @@ -3457,11 +3512,11 @@ declare namespace kendo.ui { autoBind?: boolean; columnResizeHandleWidth?: number; columns?: GanttColumn[]; - currentTimeMarker?: boolean|GanttCurrentTimeMarker; + currentTimeMarker?: boolean | GanttCurrentTimeMarker; dataSource?: any|any|kendo.data.GanttDataSource; date?: Date; dependencies?: any|any|kendo.data.GanttDependencyDataSource; - editable?: boolean|GanttEditable; + editable?: boolean | GanttEditable; navigatable?: boolean; workDayStart?: Date; workDayEnd?: Date; @@ -3699,6 +3754,12 @@ declare namespace kendo.ui { messages?: GridColumnMenuMessages; } + interface GridColumnCommandItemIconClass { + edit?: string; + update?: string; + cancel?: string; + } + interface GridColumnCommandItemText { edit?: string; cancel?: string; @@ -3708,10 +3769,10 @@ declare namespace kendo.ui { interface GridColumnCommandItem { visible?: Function; name?: string; - text?: GridColumnCommandItemText; + text?: string | GridColumnCommandItemText; className?: string; click?: Function; - iconClass?: string; + iconClass?: string | GridColumnCommandItemIconClass; } interface GridColumnFilterableCell { @@ -3729,6 +3790,7 @@ declare namespace kendo.ui { interface GridColumnFilterable { cell?: GridColumnFilterableCell; + extra?: boolean; multi?: boolean; dataSource?: any|any|kendo.data.DataSource; checkAll?: boolean; @@ -3752,7 +3814,7 @@ declare namespace kendo.ui { editable?: Function; encoded?: boolean; field?: string; - filterable?: boolean|GridColumnFilterable; + filterable?: boolean | GridColumnFilterable; footerAttributes?: any; footerTemplate?: string|Function; format?: string; @@ -3767,7 +3829,7 @@ declare namespace kendo.ui { minResizableWidth?: number; minScreenWidth?: number; selectable?: boolean; - sortable?: boolean|GridColumnSortable; + sortable?: boolean | GridColumnSortable; template?: string|Function; title?: string; width?: string|number; @@ -3800,6 +3862,7 @@ declare namespace kendo.ui { clear?: string; filter?: string; info?: string; + title?: string; isFalse?: string; isTrue?: string; or?: string; @@ -3975,43 +4038,45 @@ declare namespace kendo.ui { interface GridOptions { name?: string; - allowCopy?: boolean|GridAllowCopy; + allowCopy?: boolean | GridAllowCopy; altRowTemplate?: string|Function; autoBind?: boolean; columnResizeHandleWidth?: number; columns?: GridColumn[]; - columnMenu?: boolean|GridColumnMenu; + columnMenu?: boolean | GridColumnMenu; dataSource?: any|any|kendo.data.DataSource; detailTemplate?: string|Function; - editable?: boolean|GridEditable; + editable?: boolean | GridEditable; excel?: GridExcel; - filterable?: boolean|GridFilterable; - groupable?: boolean|GridGroupable; + filterable?: boolean | GridFilterable; + groupable?: boolean | GridGroupable; height?: number|string; messages?: GridMessages; mobile?: boolean|string; navigatable?: boolean; - noRecords?: boolean|GridNoRecords; - pageable?: boolean|GridPageable; + noRecords?: boolean | GridNoRecords; + pageable?: boolean | GridPageable; pdf?: GridPdf; persistSelection?: boolean; reorderable?: boolean; resizable?: boolean; rowTemplate?: string|Function; - scrollable?: boolean|GridScrollable; + scrollable?: boolean | GridScrollable; selectable?: boolean|string; - sortable?: boolean|GridSortable; + sortable?: boolean | GridSortable; toolbar?: GridToolbarItem[] | any; beforeEdit?(e: GridBeforeEditEvent): void; cancel?(e: GridCancelEvent): void; cellClose?(e: GridCellCloseEvent): void; change?(e: GridChangeEvent): void; columnHide?(e: GridColumnHideEvent): void; + columnLock?(e: GridColumnLockEvent): void; columnMenuInit?(e: GridColumnMenuInitEvent): void; columnMenuOpen?(e: GridColumnMenuOpenEvent): void; columnReorder?(e: GridColumnReorderEvent): void; columnResize?(e: GridColumnResizeEvent): void; columnShow?(e: GridColumnShowEvent): void; + columnUnlock?(e: GridColumnUnlockEvent): void; dataBinding?(e: GridDataBindingEvent): void; dataBound?(e: GridDataBoundEvent): void; detailCollapse?(e: GridDetailCollapseEvent): void; @@ -4020,20 +4085,18 @@ declare namespace kendo.ui { edit?(e: GridEditEvent): void; excelExport?(e: GridExcelExportEvent): void; filter?(e: GridFilterEvent): void; + filterMenuInit?(e: GridFilterMenuInitEvent): void; + filterMenuOpen?(e: GridFilterMenuOpenEvent): void; group?(e: GridGroupEvent): void; groupCollapse?(e: GridGroupCollapseEvent): void; groupExpand?(e: GridGroupExpandEvent): void; + navigate?(e: GridNavigateEvent): void; page?(e: GridPageEvent): void; pdfExport?(e: GridPdfExportEvent): void; - filterMenuInit?(e: GridFilterMenuInitEvent): void; - filterMenuOpen?(e: GridFilterMenuOpenEvent): void; remove?(e: GridRemoveEvent): void; save?(e: GridSaveEvent): void; saveChanges?(e: GridSaveChangesEvent): void; sort?(e: GridSortEvent): void; - columnLock?(e: GridColumnLockEvent): void; - columnUnlock?(e: GridColumnUnlockEvent): void; - navigate?(e: GridNavigateEvent): void; } interface GridEvent { sender: Grid; @@ -4063,6 +4126,10 @@ declare namespace kendo.ui { column?: any; } + interface GridColumnLockEvent extends GridEvent { + column?: any; + } + interface GridColumnMenuInitEvent extends GridEvent { container?: JQuery; field?: string; @@ -4089,6 +4156,10 @@ declare namespace kendo.ui { column?: any; } + interface GridColumnUnlockEvent extends GridEvent { + column?: any; + } + interface GridDataBindingEvent extends GridEvent { action?: string; index?: number; @@ -4130,6 +4201,16 @@ declare namespace kendo.ui { field?: string; } + interface GridFilterMenuInitEvent extends GridEvent { + container?: JQuery; + field?: string; + } + + interface GridFilterMenuOpenEvent extends GridEvent { + container?: JQuery; + field?: string; + } + interface GridGroupEvent extends GridEvent { groups?: any; } @@ -4144,6 +4225,10 @@ declare namespace kendo.ui { group?: any; } + interface GridNavigateEvent extends GridEvent { + element?: JQuery; + } + interface GridPageEvent extends GridEvent { page?: number; } @@ -4152,16 +4237,6 @@ declare namespace kendo.ui { promise?: JQueryPromise; } - interface GridFilterMenuInitEvent extends GridEvent { - container?: JQuery; - field?: string; - } - - interface GridFilterMenuOpenEvent extends GridEvent { - container?: JQuery; - field?: string; - } - interface GridRemoveEvent extends GridEvent { model?: kendo.data.Model; row?: JQuery; @@ -4180,18 +4255,6 @@ declare namespace kendo.ui { sort?: any; } - interface GridColumnLockEvent extends GridEvent { - column?: any; - } - - interface GridColumnUnlockEvent extends GridEvent { - column?: any; - } - - interface GridNavigateEvent extends GridEvent { - element?: JQuery; - } - class ListBox extends kendo.ui.Widget { @@ -4266,7 +4329,7 @@ declare namespace kendo.ui { dataSource?: any|any|kendo.data.DataSource; dataTextField?: string; dataValueField?: string; - draggable?: boolean|ListBoxDraggable; + draggable?: boolean | ListBoxDraggable; dropSources?: any; navigatable?: boolean; messages?: ListBoxMessages; @@ -4589,15 +4652,15 @@ declare namespace kendo.ui { interface MenuOptions { name?: string; - animation?: boolean|MenuAnimation; + animation?: boolean | MenuAnimation; closeOnClick?: boolean; dataSource?: any|any; direction?: string; hoverDelay?: number; - openOnClick?: boolean|MenuOpenOnClick; + openOnClick?: boolean | MenuOpenOnClick; orientation?: string; popupCollision?: string; - scrollable?: boolean|MenuScrollable; + scrollable?: boolean | MenuScrollable; close?(e: MenuCloseEvent): void; open?(e: MenuOpenEvent): void; activate?(e: MenuActivateEvent): void; @@ -4698,7 +4761,7 @@ declare namespace kendo.ui { interface MultiSelectOptions { name?: string; - animation?: boolean|MultiSelectAnimation; + animation?: boolean | MultiSelectAnimation; autoBind?: boolean; autoClose?: boolean; autoWidth?: boolean; @@ -4727,7 +4790,7 @@ declare namespace kendo.ui { tagMode?: string; value?: any; valuePrimitive?: boolean; - virtual?: boolean|MultiSelectVirtual; + virtual?: boolean | MultiSelectVirtual; change?(e: MultiSelectChangeEvent): void; close?(e: MultiSelectCloseEvent): void; dataBound?(e: MultiSelectDataBoundEvent): void; @@ -5080,7 +5143,7 @@ declare namespace kendo.ui { interface PanelBarOptions { name?: string; - animation?: boolean|PanelBarAnimation; + animation?: boolean | PanelBarAnimation; autoBind?: boolean; contentUrls?: any; dataImageUrlField?: string; @@ -5201,7 +5264,7 @@ declare namespace kendo.ui { name?: string; dataSource?: any|kendo.data.PivotDataSource; filterable?: boolean; - sortable?: boolean|PivotConfiguratorSortable; + sortable?: boolean | PivotConfiguratorSortable; height?: number|string; messages?: PivotConfiguratorMessages; } @@ -5313,7 +5376,7 @@ declare namespace kendo.ui { excel?: PivotGridExcel; pdf?: PivotGridPdf; filterable?: boolean; - sortable?: boolean|PivotGridSortable; + sortable?: boolean | PivotGridSortable; columnWidth?: number; height?: number|string; columnHeaderTemplate?: string|Function; @@ -5402,7 +5465,7 @@ declare namespace kendo.ui { interface PopupOptions { name?: string; adjustSize?: any; - animation?: boolean|PopupAnimation; + animation?: boolean | PopupAnimation; anchor?: string|JQuery; appendTo?: string|JQuery; collision?: string; @@ -5542,7 +5605,9 @@ declare namespace kendo.ui { destroy(): void; enable(enable: boolean): void; value(): any; - value(selectionStart: number, selectionEnd: number): void; + value(startEndArray: any): void; + values(): any; + values(selectionStart: number, selectionEnd: number): void; resize(): void; } @@ -5628,6 +5693,8 @@ declare namespace kendo.ui { options: SchedulerOptions; dataSource: kendo.data.DataSource; + resources: any; + calendar: kendo.ui.Calendar; element: JQuery; wrapper: JQuery; @@ -5882,7 +5949,7 @@ declare namespace kendo.ui { columnWidth?: number; dateHeaderTemplate?: string|Function; dayTemplate?: string|Function; - editable?: boolean|SchedulerViewEditable; + editable?: boolean | SchedulerViewEditable; endTime?: Date; eventHeight?: number; eventTemplate?: string|Function; @@ -5892,6 +5959,7 @@ declare namespace kendo.ui { majorTimeHeaderTemplate?: string|Function; minorTickCount?: number; minorTimeHeaderTemplate?: string|Function; + name?: string; selected?: boolean; selectedDateFormat?: string; selectedShortDateFormat?: string; @@ -5917,14 +5985,14 @@ declare namespace kendo.ui { allDayEventTemplate?: string|Function; allDaySlot?: boolean; autoBind?: boolean; - currentTimeMarker?: boolean|SchedulerCurrentTimeMarker; + currentTimeMarker?: boolean | SchedulerCurrentTimeMarker; dataSource?: any|any|kendo.data.SchedulerDataSource; date?: Date; dateHeaderTemplate?: string|Function; - editable?: boolean|SchedulerEditable; + editable?: boolean | SchedulerEditable; endTime?: Date; eventTemplate?: string|Function; - footer?: boolean|SchedulerFooter; + footer?: boolean | SchedulerFooter; group?: SchedulerGroup; groupHeaderTemplate?: string|Function; height?: number|string; @@ -6042,6 +6110,8 @@ declare namespace kendo.ui { } interface SchedulerResizeEndEvent extends SchedulerEvent { + start?: Date; + end?: Date; event?: kendo.data.SchedulerEvent; slot?: any; } @@ -6536,7 +6606,7 @@ declare namespace kendo.ui { rows?: number; sheets?: SpreadsheetSheet[]; sheetsbar?: boolean; - toolbar?: boolean|SpreadsheetToolbar; + toolbar?: boolean | SpreadsheetToolbar; insertSheet?(e: SpreadsheetInsertSheetEvent): void; removeSheet?(e: SpreadsheetRemoveSheetEvent): void; renameSheet?(e: SpreadsheetRenameSheetEvent): void; @@ -6740,7 +6810,7 @@ declare namespace kendo.ui { interface TabStripOptions { name?: string; - animation?: boolean|TabStripAnimation; + animation?: boolean | TabStripAnimation; collapsible?: boolean; contentUrls?: any; dataContentField?: string; @@ -6751,7 +6821,7 @@ declare namespace kendo.ui { dataTextField?: string; dataUrlField?: string; navigatable?: boolean; - scrollable?: boolean|TabStripScrollable; + scrollable?: boolean | TabStripScrollable; tabPosition?: string; value?: string; activate?(e: TabStripActivateEvent): void; @@ -6842,7 +6912,7 @@ declare namespace kendo.ui { interface TimePickerOptions { name?: string; - animation?: boolean|TimePickerAnimation; + animation?: boolean | TimePickerAnimation; culture?: string; dateInput?: boolean; dates?: any; @@ -7053,8 +7123,8 @@ declare namespace kendo.ui { interface TooltipOptions { name?: string; autoHide?: boolean; - animation?: boolean|TooltipAnimation; - content?: string | TooltipContent | ((e: any) => string); + animation?: boolean | TooltipAnimation; + content?: string | Function | TooltipContent; callout?: boolean; filter?: string; iframe?: boolean; @@ -7296,13 +7366,13 @@ declare namespace kendo.ui { encoded?: boolean; expandable?: boolean; field?: string; - filterable?: boolean|TreeListColumnFilterable; + filterable?: boolean | TreeListColumnFilterable; footerTemplate?: string|Function; format?: string; headerAttributes?: any; headerTemplate?: string|Function; minScreenWidth?: number; - sortable?: boolean|TreeListColumnSortable; + sortable?: boolean | TreeListColumnSortable; template?: string|Function; title?: string; width?: string|number; @@ -7331,6 +7401,7 @@ declare namespace kendo.ui { clear?: string; filter?: string; info?: string; + title?: string; isFalse?: string; isTrue?: string; or?: string; @@ -7404,19 +7475,19 @@ declare namespace kendo.ui { columns?: TreeListColumn[]; resizable?: boolean; reorderable?: boolean; - columnMenu?: boolean|TreeListColumnMenu; + columnMenu?: boolean | TreeListColumnMenu; dataSource?: any|any|kendo.data.TreeListDataSource; - editable?: boolean|TreeListEditable; + editable?: boolean | TreeListEditable; excel?: TreeListExcel; - filterable?: boolean|TreeListFilterable; + filterable?: boolean | TreeListFilterable; height?: number|string; messages?: TreeListMessages; navigatable?: boolean; pdf?: TreeListPdf; scrollable?: boolean|any; selectable?: boolean|string; - sortable?: boolean|TreeListSortable; - toolbar?: TreeListToolbarItem[]|any; + sortable?: boolean | TreeListSortable; + toolbar?: TreeListToolbarItem[] | any; cancel?(e: TreeListCancelEvent): void; change?(e: TreeListChangeEvent): void; collapse?(e: TreeListCollapseEvent): void; @@ -7632,8 +7703,8 @@ declare namespace kendo.ui { } interface TreeViewAnimation { - collapse?: boolean|TreeViewAnimationCollapse; - expand?: boolean|TreeViewAnimationExpand; + collapse?: boolean | TreeViewAnimationCollapse; + expand?: boolean | TreeViewAnimationExpand; } interface TreeViewCheckboxes { @@ -7650,10 +7721,10 @@ declare namespace kendo.ui { interface TreeViewOptions { name?: string; - animation?: boolean|TreeViewAnimation; + animation?: boolean | TreeViewAnimation; autoBind?: boolean; autoScroll?: boolean; - checkboxes?: boolean|TreeViewCheckboxes; + checkboxes?: boolean | TreeViewCheckboxes; dataImageUrlField?: string; dataSource?: any|any|kendo.data.HierarchicalDataSource; dataSpriteCssClassField?: string; @@ -8016,10 +8087,10 @@ declare namespace kendo.ui { interface WindowOptions { name?: string; actions?: any; - animation?: boolean|WindowAnimation; + animation?: boolean | WindowAnimation; appendTo?: any|string; autoFocus?: boolean; - content?: WindowContent; + content?: string | WindowContent; draggable?: boolean; iframe?: boolean; height?: number|string; @@ -8462,7 +8533,7 @@ declare namespace kendo.drawing { } - interface FillOptions { + interface FillOptions { @@ -8761,12 +8832,13 @@ declare namespace kendo.drawing { } - interface PDFOptions { + interface PDFOptions { creator?: string; date?: Date; + imgDPI?: number; keywords?: string; landscape?: boolean; margin?: any; @@ -8950,7 +9022,7 @@ declare namespace kendo.drawing { } - interface StrokeOptions { + interface StrokeOptions { @@ -9004,7 +9076,7 @@ declare namespace kendo.drawing { } interface SurfaceTooltip { - animation?: boolean|SurfaceTooltipAnimation; + animation?: boolean | SurfaceTooltipAnimation; appendTo?: string|JQuery; } @@ -9100,7 +9172,7 @@ declare namespace kendo.drawing { } - interface TooltipOptions { + interface TooltipOptions { @@ -9313,7 +9385,7 @@ declare namespace kendo.dataviz.ui { margin?: ChartAxisDefaultsLabelsMargin; mirror?: boolean; padding?: ChartAxisDefaultsLabelsPadding; - rotation?: ChartAxisDefaultsLabelsRotation; + rotation?: string | ChartAxisDefaultsLabelsRotation; skip?: number; step?: number; template?: string|Function; @@ -9512,7 +9584,7 @@ declare namespace kendo.dataviz.ui { margin?: ChartCategoryAxisItemLabelsMargin; mirror?: boolean; padding?: ChartCategoryAxisItemLabelsPadding; - rotation?: ChartCategoryAxisItemLabelsRotation; + rotation?: string | ChartCategoryAxisItemLabelsRotation; skip?: number; step?: number; template?: string|Function; @@ -9838,6 +9910,7 @@ declare namespace kendo.dataviz.ui { padding?: ChartLegendPadding; position?: string; reverse?: boolean; + spacing?: number; visible?: boolean; width?: number; } @@ -9895,7 +9968,7 @@ declare namespace kendo.dataviz.ui { margin?: ChartPaneMargin; name?: string; padding?: ChartPanePadding; - title?: ChartPaneTitle; + title?: string | ChartPaneTitle; } interface ChartPannable { @@ -9989,7 +10062,7 @@ declare namespace kendo.dataviz.ui { interface ChartSeriesItemExtremes { background?: string|Function; - border?: ChartSeriesItemExtremesBorder; + border?: Function | ChartSeriesItemExtremesBorder; size?: number|Function; type?: string|Function; rotation?: number|Function; @@ -10149,7 +10222,7 @@ declare namespace kendo.dataviz.ui { interface ChartSeriesItemMarkersFrom { background?: string|Function; - border?: ChartSeriesItemMarkersFromBorder; + border?: Function | ChartSeriesItemMarkersFromBorder; size?: number|Function; type?: string|Function; visible?: boolean|Function; @@ -10164,7 +10237,7 @@ declare namespace kendo.dataviz.ui { interface ChartSeriesItemMarkersTo { background?: string|Function; - border?: ChartSeriesItemMarkersToBorder; + border?: Function | ChartSeriesItemMarkersToBorder; size?: number|Function; type?: string|Function; visible?: boolean|Function; @@ -10174,7 +10247,7 @@ declare namespace kendo.dataviz.ui { interface ChartSeriesItemMarkers { background?: string|Function; - border?: ChartSeriesItemMarkersBorder; + border?: Function | ChartSeriesItemMarkersBorder; from?: ChartSeriesItemMarkersFrom; size?: number|Function; to?: ChartSeriesItemMarkersTo; @@ -10242,7 +10315,7 @@ declare namespace kendo.dataviz.ui { interface ChartSeriesItemOutliers { background?: string|Function; - border?: ChartSeriesItemOutliersBorder; + border?: Function | ChartSeriesItemOutliersBorder; size?: number|Function; type?: string|Function; rotation?: number|Function; @@ -10268,7 +10341,7 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemTarget { - border?: ChartSeriesItemTargetBorder; + border?: Function | ChartSeriesItemTargetBorder; color?: string|Function; line?: ChartSeriesItemTargetLine; } @@ -10340,7 +10413,7 @@ declare namespace kendo.dataviz.ui { highlight?: ChartSeriesItemHighlight; holeSize?: number; labels?: ChartSeriesItemLabels; - line?: ChartSeriesItemLine; + line?: string | ChartSeriesItemLine; lowField?: string; margin?: ChartSeriesItemMargin; markers?: ChartSeriesItemMarkers; @@ -10360,7 +10433,7 @@ declare namespace kendo.dataviz.ui { size?: number; sizeField?: string; spacing?: number; - stack?: boolean|ChartSeriesItemStack; + stack?: boolean | string | ChartSeriesItemStack; startAngle?: number; target?: ChartSeriesItemTarget; targetField?: string; @@ -10579,7 +10652,7 @@ declare namespace kendo.dataviz.ui { scatter?: any; scatterLine?: any; spacing?: number; - stack?: boolean|ChartSeriesDefaultsStack; + stack?: boolean | ChartSeriesDefaultsStack; type?: string; tooltip?: ChartSeriesDefaultsTooltip; verticalArea?: any; @@ -10674,6 +10747,7 @@ declare namespace kendo.dataviz.ui { interface ChartValueAxisItemCrosshair { color?: string; + dashType?: string; opacity?: number; tooltip?: ChartValueAxisItemCrosshairTooltip; visible?: boolean; @@ -10714,7 +10788,7 @@ declare namespace kendo.dataviz.ui { margin?: ChartValueAxisItemLabelsMargin; mirror?: boolean; padding?: ChartValueAxisItemLabelsPadding; - rotation?: ChartValueAxisItemLabelsRotation; + rotation?: string | ChartValueAxisItemLabelsRotation; skip?: number; step?: number; template?: string|Function; @@ -10952,6 +11026,7 @@ declare namespace kendo.dataviz.ui { interface ChartXAxisItemCrosshair { color?: string; + dashType?: string; opacity?: number; tooltip?: ChartXAxisItemCrosshairTooltip; visible?: boolean; @@ -11002,7 +11077,7 @@ declare namespace kendo.dataviz.ui { margin?: ChartXAxisItemLabelsMargin; mirror?: boolean; padding?: ChartXAxisItemLabelsPadding; - rotation?: ChartXAxisItemLabelsRotation; + rotation?: string | ChartXAxisItemLabelsRotation; skip?: number; step?: number; template?: string|Function; @@ -11178,8 +11253,8 @@ declare namespace kendo.dataviz.ui { border?: ChartXAxisItemTitleBorder; color?: string; font?: string; - margin?: ChartXAxisItemTitleMargin | number; - padding?: ChartXAxisItemTitlePadding | number; + margin?: ChartXAxisItemTitleMargin; + padding?: ChartXAxisItemTitlePadding; position?: string; rotation?: number; text?: string; @@ -11241,6 +11316,7 @@ declare namespace kendo.dataviz.ui { interface ChartYAxisItemCrosshair { color?: string; + dashType?: string; opacity?: number; tooltip?: ChartYAxisItemCrosshairTooltip; visible?: boolean; @@ -11513,8 +11589,8 @@ declare namespace kendo.dataviz.ui { } interface ChartZoomable { - mousewheel?: boolean|ChartZoomableMousewheel; - selection?: boolean|ChartZoomableSelection; + mousewheel?: boolean | ChartZoomableMousewheel; + selection?: boolean | ChartZoomableSelection; } interface ChartExportImageOptions { @@ -11553,7 +11629,7 @@ declare namespace kendo.dataviz.ui { dataSource?: any|any|kendo.data.DataSource; legend?: ChartLegend; panes?: ChartPane[]; - pannable?: boolean|ChartPannable; + pannable?: boolean | ChartPannable; pdf?: ChartPdf; plotArea?: ChartPlotArea; renderAs?: string; @@ -11561,13 +11637,13 @@ declare namespace kendo.dataviz.ui { seriesColors?: any; seriesDefaults?: ChartSeriesDefaults; theme?: string; - title?: ChartTitle; + title?: string | ChartTitle; tooltip?: ChartTooltip; transitions?: boolean; valueAxis?: ChartValueAxisItem[]; xAxis?: ChartXAxisItem[]; yAxis?: ChartYAxisItem[]; - zoomable?: boolean|ChartZoomable; + zoomable?: boolean | ChartZoomable; axisLabelClick?(e: ChartAxisLabelClickEvent): void; dataBound?(e: ChartDataBoundEvent): void; drag?(e: ChartDragEvent): void; @@ -11848,8 +11924,8 @@ declare namespace kendo.dataviz.ui { } interface DiagramConnectionDefaultsEndCap { - fill?: DiagramConnectionDefaultsEndCapFill; - stroke?: DiagramConnectionDefaultsEndCapStroke; + fill?: string | DiagramConnectionDefaultsEndCapFill; + stroke?: string | DiagramConnectionDefaultsEndCapStroke; type?: string; } @@ -11870,7 +11946,7 @@ declare namespace kendo.dataviz.ui { } interface DiagramConnectionDefaultsSelectionHandles { - fill?: DiagramConnectionDefaultsSelectionHandlesFill; + fill?: string | DiagramConnectionDefaultsSelectionHandlesFill; stroke?: DiagramConnectionDefaultsSelectionHandlesStroke; width?: number; height?: number; @@ -11891,8 +11967,8 @@ declare namespace kendo.dataviz.ui { } interface DiagramConnectionDefaultsStartCap { - fill?: DiagramConnectionDefaultsStartCapFill; - stroke?: DiagramConnectionDefaultsStartCapStroke; + fill?: string | DiagramConnectionDefaultsStartCapFill; + stroke?: string | DiagramConnectionDefaultsStartCapStroke; type?: string; } @@ -11903,13 +11979,13 @@ declare namespace kendo.dataviz.ui { interface DiagramConnectionDefaults { content?: DiagramConnectionDefaultsContent; - editable?: boolean|DiagramConnectionDefaultsEditable; - endCap?: DiagramConnectionDefaultsEndCap; + editable?: boolean | DiagramConnectionDefaultsEditable; + endCap?: string | DiagramConnectionDefaultsEndCap; fromConnector?: string; hover?: DiagramConnectionDefaultsHover; selectable?: boolean; selection?: DiagramConnectionDefaultsSelection; - startCap?: DiagramConnectionDefaultsStartCap; + startCap?: string | DiagramConnectionDefaultsStartCap; stroke?: DiagramConnectionDefaultsStroke; toConnector?: string; type?: string; @@ -11945,8 +12021,8 @@ declare namespace kendo.dataviz.ui { } interface DiagramConnectionEndCap { - fill?: DiagramConnectionEndCapFill; - stroke?: DiagramConnectionEndCapStroke; + fill?: string | DiagramConnectionEndCapFill; + stroke?: string | DiagramConnectionEndCapStroke; type?: string; } @@ -11977,7 +12053,7 @@ declare namespace kendo.dataviz.ui { } interface DiagramConnectionSelectionHandles { - fill?: DiagramConnectionSelectionHandlesFill; + fill?: string | DiagramConnectionSelectionHandlesFill; stroke?: DiagramConnectionSelectionHandlesStroke; width?: number; height?: number; @@ -11998,8 +12074,8 @@ declare namespace kendo.dataviz.ui { } interface DiagramConnectionStartCap { - fill?: DiagramConnectionStartCapFill; - stroke?: DiagramConnectionStartCapStroke; + fill?: string | DiagramConnectionStartCapFill; + stroke?: string | DiagramConnectionStartCapStroke; type?: string; } @@ -12015,16 +12091,16 @@ declare namespace kendo.dataviz.ui { interface DiagramConnection { content?: DiagramConnectionContent; - editable?: boolean|DiagramConnectionEditable; - endCap?: DiagramConnectionEndCap; - from?: DiagramConnectionFrom; + editable?: boolean | DiagramConnectionEditable; + endCap?: string | DiagramConnectionEndCap; + from?: string | DiagramConnectionFrom; fromConnector?: string; hover?: DiagramConnectionHover; points?: DiagramConnectionPoint[]; selection?: DiagramConnectionSelection; - startCap?: DiagramConnectionStartCap; + startCap?: string | DiagramConnectionStartCap; stroke?: DiagramConnectionStroke; - to?: DiagramConnectionTo; + to?: string | DiagramConnectionTo; toConnector?: string; type?: string; } @@ -12034,7 +12110,7 @@ declare namespace kendo.dataviz.ui { } interface DiagramEditableDrag { - snap?: boolean|DiagramEditableDragSnap; + snap?: boolean | DiagramEditableDragSnap; } interface DiagramEditableResizeHandlesFill { @@ -12054,7 +12130,7 @@ declare namespace kendo.dataviz.ui { } interface DiagramEditableResizeHandlesHover { - fill?: DiagramEditableResizeHandlesHoverFill; + fill?: string | DiagramEditableResizeHandlesHoverFill; stroke?: DiagramEditableResizeHandlesHoverStroke; } @@ -12065,7 +12141,7 @@ declare namespace kendo.dataviz.ui { } interface DiagramEditableResizeHandles { - fill?: DiagramEditableResizeHandlesFill; + fill?: string | DiagramEditableResizeHandlesFill; height?: number; hover?: DiagramEditableResizeHandlesHover; stroke?: DiagramEditableResizeHandlesStroke; @@ -12098,10 +12174,10 @@ declare namespace kendo.dataviz.ui { interface DiagramEditable { connectionTemplate?: string|Function; - drag?: boolean|DiagramEditableDrag; + drag?: boolean | DiagramEditableDrag; remove?: boolean; - resize?: boolean|DiagramEditableResize; - rotate?: boolean|DiagramEditableRotate; + resize?: boolean | DiagramEditableResize; + rotate?: boolean | DiagramEditableRotate; shapeTemplate?: string|Function; tools?: DiagramEditableTool[]; } @@ -12189,8 +12265,8 @@ declare namespace kendo.dataviz.ui { } interface DiagramShapeDefaultsConnectorDefaultsHover { - fill?: DiagramShapeDefaultsConnectorDefaultsHoverFill; - stroke?: DiagramShapeDefaultsConnectorDefaultsHoverStroke; + fill?: string | DiagramShapeDefaultsConnectorDefaultsHoverFill; + stroke?: string | DiagramShapeDefaultsConnectorDefaultsHoverStroke; } interface DiagramShapeDefaultsConnectorDefaultsStroke { @@ -12203,8 +12279,8 @@ declare namespace kendo.dataviz.ui { width?: number; height?: number; hover?: DiagramShapeDefaultsConnectorDefaultsHover; - fill?: DiagramShapeDefaultsConnectorDefaultsFill; - stroke?: DiagramShapeDefaultsConnectorDefaultsStroke; + fill?: string | DiagramShapeDefaultsConnectorDefaultsFill; + stroke?: string | DiagramShapeDefaultsConnectorDefaultsStroke; } interface DiagramShapeDefaultsConnectorFill { @@ -12224,8 +12300,8 @@ declare namespace kendo.dataviz.ui { } interface DiagramShapeDefaultsConnectorHover { - fill?: DiagramShapeDefaultsConnectorHoverFill; - stroke?: DiagramShapeDefaultsConnectorHoverStroke; + fill?: string | DiagramShapeDefaultsConnectorHoverFill; + stroke?: string | DiagramShapeDefaultsConnectorHoverStroke; } interface DiagramShapeDefaultsConnectorStroke { @@ -12240,8 +12316,8 @@ declare namespace kendo.dataviz.ui { width?: number; height?: number; hover?: DiagramShapeDefaultsConnectorHover; - fill?: DiagramShapeDefaultsConnectorFill; - stroke?: DiagramShapeDefaultsConnectorStroke; + fill?: string | DiagramShapeDefaultsConnectorFill; + stroke?: string | DiagramShapeDefaultsConnectorStroke; } interface DiagramShapeDefaultsContent { @@ -12294,7 +12370,7 @@ declare namespace kendo.dataviz.ui { } interface DiagramShapeDefaultsHover { - fill?: DiagramShapeDefaultsHoverFill; + fill?: string | DiagramShapeDefaultsHoverFill; } interface DiagramShapeDefaultsRotation { @@ -12311,8 +12387,8 @@ declare namespace kendo.dataviz.ui { connectors?: DiagramShapeDefaultsConnector[]; connectorDefaults?: DiagramShapeDefaultsConnectorDefaults; content?: DiagramShapeDefaultsContent; - editable?: boolean|DiagramShapeDefaultsEditable; - fill?: DiagramShapeDefaultsFill; + editable?: boolean | DiagramShapeDefaultsEditable; + fill?: string | DiagramShapeDefaultsFill; height?: number; hover?: DiagramShapeDefaultsHover; minHeight?: number; @@ -12346,8 +12422,8 @@ declare namespace kendo.dataviz.ui { } interface DiagramShapeConnectorDefaultsHover { - fill?: DiagramShapeConnectorDefaultsHoverFill; - stroke?: DiagramShapeConnectorDefaultsHoverStroke; + fill?: string | DiagramShapeConnectorDefaultsHoverFill; + stroke?: string | DiagramShapeConnectorDefaultsHoverStroke; } interface DiagramShapeConnectorDefaultsStroke { @@ -12360,8 +12436,8 @@ declare namespace kendo.dataviz.ui { width?: number; height?: number; hover?: DiagramShapeConnectorDefaultsHover; - fill?: DiagramShapeConnectorDefaultsFill; - stroke?: DiagramShapeConnectorDefaultsStroke; + fill?: string | DiagramShapeConnectorDefaultsFill; + stroke?: string | DiagramShapeConnectorDefaultsStroke; } interface DiagramShapeConnectorFill { @@ -12381,8 +12457,8 @@ declare namespace kendo.dataviz.ui { } interface DiagramShapeConnectorHover { - fill?: DiagramShapeConnectorHoverFill; - stroke?: DiagramShapeConnectorHoverStroke; + fill?: string | DiagramShapeConnectorHoverFill; + stroke?: string | DiagramShapeConnectorHoverStroke; } interface DiagramShapeConnectorStroke { @@ -12398,8 +12474,8 @@ declare namespace kendo.dataviz.ui { width?: number; height?: number; hover?: DiagramShapeConnectorHover; - fill?: DiagramShapeConnectorFill; - stroke?: DiagramShapeConnectorStroke; + fill?: string | DiagramShapeConnectorFill; + stroke?: string | DiagramShapeConnectorStroke; } interface DiagramShapeContent { @@ -12450,7 +12526,7 @@ declare namespace kendo.dataviz.ui { } interface DiagramShapeHover { - fill?: DiagramShapeHoverFill; + fill?: string | DiagramShapeHoverFill; } interface DiagramShapeRotation { @@ -12467,8 +12543,8 @@ declare namespace kendo.dataviz.ui { connectors?: DiagramShapeConnector[]; connectorDefaults?: DiagramShapeConnectorDefaults; content?: DiagramShapeContent; - editable?: boolean|DiagramShapeEditable; - fill?: DiagramShapeFill; + editable?: boolean | DiagramShapeEditable; + fill?: string | DiagramShapeFill; height?: number; hover?: DiagramShapeHover; id?: string; @@ -12506,11 +12582,11 @@ declare namespace kendo.dataviz.ui { connections?: DiagramConnection[]; connectionsDataSource?: any|any|kendo.data.DataSource; dataSource?: any|any|kendo.data.DataSource; - editable?: boolean|DiagramEditable; + editable?: boolean | DiagramEditable; layout?: DiagramLayout; - pannable?: boolean|DiagramPannable; + pannable?: boolean | DiagramPannable; pdf?: DiagramPdf; - selectable?: boolean|DiagramSelectable; + selectable?: boolean | DiagramSelectable; shapeDefaults?: DiagramShapeDefaults; shapes?: DiagramShape[]; template?: string|Function; @@ -12692,7 +12768,7 @@ declare namespace kendo.dataviz.ui { } interface LinearGaugeGaugeArea { - background?: any; + background?: string; border?: LinearGaugeGaugeAreaBorder; height?: number; margin?: LinearGaugeGaugeAreaMargin; @@ -12890,9 +12966,9 @@ declare namespace kendo.dataviz.ui { } interface MapControls { - attribution?: boolean|MapControlsAttribution; - navigator?: boolean|MapControlsNavigator; - zoom?: boolean|MapControlsZoom; + attribution?: boolean | MapControlsAttribution; + navigator?: boolean | MapControlsNavigator; + zoom?: boolean | MapControlsZoom; } interface MapLayerDefaultsBing { @@ -12951,7 +13027,7 @@ declare namespace kendo.dataviz.ui { interface MapLayerDefaultsMarkerTooltip { autoHide?: boolean; animation?: MapLayerDefaultsMarkerTooltipAnimation; - content?: MapLayerDefaultsMarkerTooltipContent; + content?: string | Function | MapLayerDefaultsMarkerTooltipContent; template?: string; callout?: boolean; iframe?: boolean; @@ -13046,7 +13122,7 @@ declare namespace kendo.dataviz.ui { interface MapLayerTooltip { autoHide?: boolean; animation?: MapLayerTooltipAnimation; - content?: MapLayerTooltipContent; + content?: string | Function | MapLayerTooltipContent; template?: string; callout?: boolean; iframe?: boolean; @@ -13104,7 +13180,7 @@ declare namespace kendo.dataviz.ui { interface MapMarkerDefaultsTooltip { autoHide?: boolean; animation?: MapMarkerDefaultsTooltipAnimation; - content?: MapMarkerDefaultsTooltipContent; + content?: string | Function | MapMarkerDefaultsTooltipContent; template?: string; callout?: boolean; iframe?: boolean; @@ -13142,7 +13218,7 @@ declare namespace kendo.dataviz.ui { interface MapMarkerTooltip { autoHide?: boolean; animation?: MapMarkerTooltipAnimation; - content?: MapMarkerTooltipContent; + content?: string | Function | MapMarkerTooltipContent; template?: string; callout?: boolean; iframe?: boolean; @@ -13380,7 +13456,7 @@ declare namespace kendo.dataviz.ui { } interface RadialGaugeGaugeArea { - background?: any; + background?: string; border?: RadialGaugeGaugeAreaBorder; height?: number; margin?: RadialGaugeGaugeAreaMargin; @@ -13849,7 +13925,7 @@ declare namespace kendo.dataviz.ui { interface SparklineSeriesItemMarkers { background?: string|Function; - border?: SparklineSeriesItemMarkersBorder; + border?: Function | SparklineSeriesItemMarkersBorder; size?: number|Function; type?: string|Function; visible?: boolean|Function; @@ -13922,7 +13998,7 @@ declare namespace kendo.dataviz.ui { interface SparklineSeriesItemTarget { line?: SparklineSeriesItemTargetLine; color?: string|Function; - border?: SparklineSeriesItemTargetBorder; + border?: Function | SparklineSeriesItemTargetBorder; } interface SparklineSeriesItemTooltipBorder { @@ -13960,7 +14036,7 @@ declare namespace kendo.dataviz.ui { connectors?: SparklineSeriesItemConnectors; gap?: number; labels?: SparklineSeriesItemLabels; - line?: SparklineSeriesItemLine; + line?: string | SparklineSeriesItemLine; markers?: SparklineSeriesItemMarkers; missingValues?: string; style?: string; @@ -13971,7 +14047,7 @@ declare namespace kendo.dataviz.ui { size?: number; startAngle?: number; spacing?: number; - stack?: boolean|SparklineSeriesItemStack; + stack?: boolean | string | SparklineSeriesItemStack; tooltip?: SparklineSeriesItemTooltip; width?: number; target?: SparklineSeriesItemTarget; @@ -14034,7 +14110,7 @@ declare namespace kendo.dataviz.ui { overlay?: any; pie?: any; spacing?: number; - stack?: boolean|SparklineSeriesDefaultsStack; + stack?: boolean | SparklineSeriesDefaultsStack; type?: string; tooltip?: SparklineSeriesDefaultsTooltip; } @@ -15115,7 +15191,7 @@ declare namespace kendo.dataviz.ui { margin?: StockChartNavigatorPaneMargin; name?: string; padding?: StockChartNavigatorPanePadding; - title?: StockChartNavigatorPaneTitle; + title?: string | StockChartNavigatorPaneTitle; } interface StockChartNavigatorSelectMousewheel { @@ -15125,7 +15201,7 @@ declare namespace kendo.dataviz.ui { interface StockChartNavigatorSelect { from?: Date; - mousewheel?: boolean|StockChartNavigatorSelectMousewheel; + mousewheel?: boolean | StockChartNavigatorSelectMousewheel; to?: Date; } @@ -15238,7 +15314,7 @@ declare namespace kendo.dataviz.ui { downColorField?: string; gap?: number; labels?: StockChartNavigatorSeriesItemLabels; - line?: StockChartNavigatorSeriesItemLine; + line?: string | StockChartNavigatorSeriesItemLine; lowField?: string; markers?: StockChartNavigatorSeriesItemMarkers; missingValues?: string; @@ -15247,7 +15323,7 @@ declare namespace kendo.dataviz.ui { openField?: string; overlay?: StockChartNavigatorSeriesItemOverlay; spacing?: number; - stack?: boolean|StockChartNavigatorSeriesItemStack; + stack?: boolean | string | StockChartNavigatorSeriesItemStack; tooltip?: StockChartNavigatorSeriesItemTooltip; width?: number; } @@ -15295,7 +15371,7 @@ declare namespace kendo.dataviz.ui { border?: StockChartPaneBorder; clip?: boolean; height?: number; - title?: StockChartPaneTitle; + title?: string | StockChartPaneTitle; } interface StockChartPdfMargin { @@ -15394,7 +15470,7 @@ declare namespace kendo.dataviz.ui { interface StockChartSeriesItemMarkers { background?: string|Function; - border?: StockChartSeriesItemMarkersBorder; + border?: Function | StockChartSeriesItemMarkersBorder; size?: number|Function; rotation?: number|Function; type?: string|Function; @@ -15467,7 +15543,7 @@ declare namespace kendo.dataviz.ui { interface StockChartSeriesItemTarget { line?: StockChartSeriesItemTargetLine; color?: string|Function; - border?: StockChartSeriesItemTargetBorder; + border?: Function | StockChartSeriesItemTargetBorder; } interface StockChartSeriesItemTooltipBorder { @@ -15507,7 +15583,7 @@ declare namespace kendo.dataviz.ui { downColorField?: string; gap?: number; labels?: StockChartSeriesItemLabels; - line?: StockChartSeriesItemLine; + line?: string | StockChartSeriesItemLine; lowField?: string; markers?: StockChartSeriesItemMarkers; missingValues?: string; @@ -15517,7 +15593,7 @@ declare namespace kendo.dataviz.ui { openField?: string; overlay?: StockChartSeriesItemOverlay; spacing?: number; - stack?: boolean|StockChartSeriesItemStack; + stack?: boolean | string | StockChartSeriesItemStack; tooltip?: StockChartSeriesItemTooltip; visibleInLegend?: boolean; width?: number; @@ -15582,7 +15658,7 @@ declare namespace kendo.dataviz.ui { overlay?: any; pie?: any; spacing?: number; - stack?: boolean|StockChartSeriesDefaultsStack; + stack?: boolean | StockChartSeriesDefaultsStack; type?: string; tooltip?: StockChartSeriesDefaultsTooltip; } @@ -16266,7 +16342,7 @@ declare namespace kendo.dataviz.map { interface MarkerTooltip { autoHide?: boolean; animation?: MarkerTooltipAnimation; - content?: MarkerTooltipContent; + content?: string | Function | MarkerTooltipContent; template?: string; callout?: boolean; iframe?: boolean; @@ -16585,7 +16661,7 @@ declare namespace kendo.dataviz.diagram { interface CircleOptions { name?: string; - fill?: CircleFill; + fill?: string | CircleFill; stroke?: CircleStroke; center?: any; radius?: number; @@ -16652,8 +16728,8 @@ declare namespace kendo.dataviz.diagram { } interface ConnectionEndCap { - fill?: ConnectionEndCapFill; - stroke?: ConnectionEndCapStroke; + fill?: string | ConnectionEndCapFill; + stroke?: string | ConnectionEndCapStroke; type?: string; } @@ -16681,8 +16757,8 @@ declare namespace kendo.dataviz.diagram { } interface ConnectionStartCap { - fill?: ConnectionStartCapFill; - stroke?: ConnectionStartCapStroke; + fill?: string | ConnectionStartCapFill; + stroke?: string | ConnectionStartCapStroke; type?: string; } @@ -16698,8 +16774,8 @@ declare namespace kendo.dataviz.diagram { fromY?: number; stroke?: ConnectionStroke; hover?: ConnectionHover; - startCap?: ConnectionStartCap; - endCap?: ConnectionEndCap; + startCap?: string | ConnectionStartCap; + endCap?: string | ConnectionEndCap; points?: ConnectionPoint[]; selectable?: boolean; toConnector?: string; @@ -16746,8 +16822,8 @@ declare namespace kendo.dataviz.diagram { } interface ConnectorHover { - fill?: ConnectorHoverFill; - stroke?: ConnectorHoverStroke; + fill?: string | ConnectorHoverFill; + stroke?: string | ConnectorHoverStroke; } interface ConnectorStroke { @@ -16761,8 +16837,8 @@ declare namespace kendo.dataviz.diagram { width?: number; height?: number; hover?: ConnectorHover; - fill?: ConnectorFill; - stroke?: ConnectorStroke; + fill?: string | ConnectorFill; + stroke?: string | ConnectorStroke; } interface ConnectorEvent { sender: Connector; @@ -16940,8 +17016,8 @@ declare namespace kendo.dataviz.diagram { } interface PathEndCap { - fill?: PathEndCapFill; - stroke?: PathEndCapStroke; + fill?: string | PathEndCapFill; + stroke?: string | PathEndCapStroke; type?: string; } @@ -16978,8 +17054,8 @@ declare namespace kendo.dataviz.diagram { } interface PathStartCap { - fill?: PathStartCapFill; - stroke?: PathStartCapStroke; + fill?: string | PathStartCapFill; + stroke?: string | PathStartCapStroke; type?: string; } @@ -16991,10 +17067,10 @@ declare namespace kendo.dataviz.diagram { interface PathOptions { name?: string; data?: string; - endCap?: PathEndCap; - fill?: PathFill; + endCap?: string | PathEndCap; + fill?: string | PathFill; height?: number; - startCap?: PathStartCap; + startCap?: string | PathStartCap; stroke?: PathStroke; width?: number; x?: number; @@ -17060,8 +17136,8 @@ declare namespace kendo.dataviz.diagram { } interface PolylineEndCap { - fill?: PolylineEndCapFill; - stroke?: PolylineEndCapStroke; + fill?: string | PolylineEndCapFill; + stroke?: string | PolylineEndCapStroke; type?: string; } @@ -17098,8 +17174,8 @@ declare namespace kendo.dataviz.diagram { } interface PolylineStartCap { - fill?: PolylineStartCapFill; - stroke?: PolylineStartCapStroke; + fill?: string | PolylineStartCapFill; + stroke?: string | PolylineStartCapStroke; type?: string; } @@ -17110,9 +17186,9 @@ declare namespace kendo.dataviz.diagram { interface PolylineOptions { name?: string; - endCap?: PolylineEndCap; - fill?: PolylineFill; - startCap?: PolylineStartCap; + endCap?: string | PolylineEndCap; + fill?: string | PolylineFill; + startCap?: string | PolylineStartCap; stroke?: PolylineStroke; } interface PolylineEvent { @@ -17196,7 +17272,7 @@ declare namespace kendo.dataviz.diagram { interface RectangleOptions { name?: string; - fill?: RectangleFill; + fill?: string | RectangleFill; height?: number; stroke?: RectangleStroke; width?: number; @@ -17252,8 +17328,8 @@ declare namespace kendo.dataviz.diagram { } interface ShapeConnectorDefaultsHover { - fill?: ShapeConnectorDefaultsHoverFill; - stroke?: ShapeConnectorDefaultsHoverStroke; + fill?: string | ShapeConnectorDefaultsHoverFill; + stroke?: string | ShapeConnectorDefaultsHoverStroke; } interface ShapeConnectorDefaultsStroke { @@ -17266,8 +17342,8 @@ declare namespace kendo.dataviz.diagram { width?: number; height?: number; hover?: ShapeConnectorDefaultsHover; - fill?: ShapeConnectorDefaultsFill; - stroke?: ShapeConnectorDefaultsStroke; + fill?: string | ShapeConnectorDefaultsFill; + stroke?: string | ShapeConnectorDefaultsStroke; } interface ShapeConnector { @@ -17317,7 +17393,7 @@ declare namespace kendo.dataviz.diagram { } interface ShapeHover { - fill?: ShapeHoverFill; + fill?: string | ShapeHoverFill; } interface ShapeRotation { @@ -17333,7 +17409,7 @@ declare namespace kendo.dataviz.diagram { interface ShapeOptions { name?: string; id?: string; - editable?: boolean|ShapeEditable; + editable?: boolean | ShapeEditable; path?: string; stroke?: ShapeStroke; type?: string; @@ -17343,7 +17419,7 @@ declare namespace kendo.dataviz.diagram { minHeight?: number; width?: number; height?: number; - fill?: ShapeFill; + fill?: string | ShapeFill; hover?: ShapeHover; connectors?: ShapeConnector[]; rotation?: ShapeRotation; @@ -17434,7 +17510,7 @@ declare namespace kendo { namespace date { function setDayOfWeek(targetDate: Date, dayOfWeek: number, direction: number): void; function dayOfWeek(targetDate: Date, dayOfWeek: number, direction: number): Date; - function weekInYear(date: Date, weekStart?: Date): number; + function weekInYear(date: Date, weekStart?: number): number; function getDate(date: Date): Date; function isInDateRange(targetDate: Date, lowerLimitDate: Date, upperLimitDate: Date): boolean; function isInTimeRange(targetDate: Date, lowerLimitDate: Date, upperLimitDate: Date): boolean; @@ -17473,43 +17549,43 @@ declare namespace kendo { function transformOrigin(firstElement: HTMLElement, secondElement: HTMLElement): any; } - function alert(text: string): void; - function antiForgeryTokens(): any; - function bind(element: string, viewModel: any, namespace?: any): void; - function bind(element: string, viewModel: kendo.data.ObservableObject, namespace?: any): void; - function bind(element: JQuery, viewModel: any, namespace?: any): void; - function bind(element: JQuery, viewModel: kendo.data.ObservableObject, namespace?: any): void; - function bind(element: Element, viewModel: any, namespace?: any): void; - function bind(element: Element, viewModel: kendo.data.ObservableObject, namespace?: any): void; - function observableHierarchy(array: any): void; - function confirm(text: string): JQueryPromise; - function culture(culture: string): void; - function destroy(element: string): void; - function destroy(element: JQuery): void; - function destroy(element: Element): void; - function htmlEncode(value: string): string; - function parseDate(value: string, formats?: string, culture?: string): Date; - function parseDate(value: string, formats?: any, culture?: string): Date; - function parseFloat(value: string, culture?: string): number; - function parseInt(value: string, culture?: string): number; - function parseColor(color: string, noerror: boolean): kendo.Color; - function prompt(text: string, defaultValue: string): JQueryPromise; - function proxyModelSetters(): void; - function proxyModelSetters(data: kendo.data.Model): void; - function resize(element: string, force: boolean): void; - function resize(element: JQuery, force: boolean): void; - function resize(element: Element, force: boolean): void; - function saveAs(options: any): void; - function stringify(value: any): string; - function throttle(fn: Function, timeout: number): Function; - function touchScroller(element: string): void; - function touchScroller(element: JQuery): void; - function touchScroller(element: Element): void; - function toString(value: Date, format: string, culture?: string): string; - function toString(value: number, format: string, culture?: string): string; - function unbind(element: string): void; - function unbind(element: JQuery): void; - function unbind(element: Element): void; + function alert(text: string): void; + function antiForgeryTokens(): any; + function bind(element: string, viewModel: any, namespace?: any): void; + function bind(element: string, viewModel: kendo.data.ObservableObject, namespace?: any): void; + function bind(element: JQuery, viewModel: any, namespace?: any): void; + function bind(element: JQuery, viewModel: kendo.data.ObservableObject, namespace?: any): void; + function bind(element: Element, viewModel: any, namespace?: any): void; + function bind(element: Element, viewModel: kendo.data.ObservableObject, namespace?: any): void; + function observableHierarchy(array: any): void; + function confirm(text: string): JQueryPromise; + function culture(culture: string): void; + function destroy(element: string): void; + function destroy(element: JQuery): void; + function destroy(element: Element): void; + function htmlEncode(value: string): string; + function parseDate(value: string, formats?: string, culture?: string): Date; + function parseDate(value: string, formats?: any, culture?: string): Date; + function parseFloat(value: string, culture?: string): number; + function parseInt(value: string, culture?: string): number; + function parseColor(color: string, noerror: boolean): kendo.Color; + function prompt(text: string, defaultValue: string): JQueryPromise; + function proxyModelSetters(): void; + function proxyModelSetters(data: kendo.data.Model): void; + function resize(element: string, force: boolean): void; + function resize(element: JQuery, force: boolean): void; + function resize(element: Element, force: boolean): void; + function saveAs(options: any): void; + function stringify(value: any): string; + function throttle(fn: Function, timeout: number): Function; + function touchScroller(element: string): void; + function touchScroller(element: JQuery): void; + function touchScroller(element: Element): void; + function toString(value: Date, format: string, culture?: string): string; + function toString(value: number, format: string, culture?: string): string; + function unbind(element: string): void; + function unbind(element: JQuery): void; + function unbind(element: Element): void; namespace pdf { function defineFont(map: any): void; @@ -18161,7 +18237,7 @@ declare namespace kendo.mobile.ui { style?: string; template?: string|Function; type?: string; - filterable?: boolean|ListViewFilterable; + filterable?: boolean | ListViewFilterable; virtualViewSize?: number; click?(e: ListViewClickEvent): void; dataBound?(e: ListViewEvent): void; @@ -19245,7 +19321,7 @@ declare namespace kendo.dataviz.drawing { } - interface FillOptions { + interface FillOptions { @@ -19544,12 +19620,13 @@ declare namespace kendo.dataviz.drawing { } - interface PDFOptions { + interface PDFOptions { creator?: string; date?: Date; + imgDPI?: number; keywords?: string; landscape?: boolean; margin?: any; @@ -19733,7 +19810,7 @@ declare namespace kendo.dataviz.drawing { } - interface StrokeOptions { + interface StrokeOptions { @@ -19787,7 +19864,7 @@ declare namespace kendo.dataviz.drawing { } interface SurfaceTooltip { - animation?: boolean|SurfaceTooltipAnimation; + animation?: boolean | SurfaceTooltipAnimation; appendTo?: string|JQuery; } @@ -19883,7 +19960,7 @@ declare namespace kendo.dataviz.drawing { } - interface TooltipOptions { + interface TooltipOptions { @@ -19952,6 +20029,10 @@ interface JQuery { kendoButton(options: kendo.ui.ButtonOptions): JQuery; data(key: "kendoButton"): kendo.ui.Button; + kendoButtonGroup(): JQuery; + kendoButtonGroup(options: kendo.ui.ButtonGroupOptions): JQuery; + data(key: "kendoButtonGroup"): kendo.ui.ButtonGroup; + kendoCalendar(): JQuery; kendoCalendar(options: kendo.ui.CalendarOptions): JQuery; data(key: "kendoCalendar"): kendo.ui.Calendar; diff --git a/types/kendo-ui/tsconfig.json b/types/kendo-ui/tsconfig.json index e6e296e3ee..285d942999 100644 --- a/types/kendo-ui/tsconfig.json +++ b/types/kendo-ui/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/keyboardjs/tsconfig.json b/types/keyboardjs/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/keyboardjs/tsconfig.json +++ b/types/keyboardjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/keygrip/tsconfig.json b/types/keygrip/tsconfig.json index 6a68ad8ba2..7c096ed3b4 100644 --- a/types/keygrip/tsconfig.json +++ b/types/keygrip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/keymaster/tsconfig.json b/types/keymaster/tsconfig.json index c35aaa1b01..9fb59df1bc 100644 --- a/types/keymaster/tsconfig.json +++ b/types/keymaster/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/keymirror/tsconfig.json b/types/keymirror/tsconfig.json index 4d6365bc4c..a237e2396d 100644 --- a/types/keymirror/tsconfig.json +++ b/types/keymirror/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/keypress.js/tsconfig.json b/types/keypress.js/tsconfig.json index 1643b0a002..00a88fbf72 100644 --- a/types/keypress.js/tsconfig.json +++ b/types/keypress.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/keysym/tsconfig.json b/types/keysym/tsconfig.json index b2daaa6d31..0a853aa126 100644 --- a/types/keysym/tsconfig.json +++ b/types/keysym/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/keytar/tsconfig.json b/types/keytar/tsconfig.json index 5a2fe428ff..43efd1ec43 100644 --- a/types/keytar/tsconfig.json +++ b/types/keytar/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kii-cloud-sdk/tsconfig.json b/types/kii-cloud-sdk/tsconfig.json index fd1b84aab9..69b251f247 100644 --- a/types/kii-cloud-sdk/tsconfig.json +++ b/types/kii-cloud-sdk/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kik-browser/tsconfig.json b/types/kik-browser/tsconfig.json index d832795617..0a59996f8c 100644 --- a/types/kik-browser/tsconfig.json +++ b/types/kik-browser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kineticjs/tsconfig.json b/types/kineticjs/tsconfig.json index cee48ec061..976f2dc3d3 100644 --- a/types/kineticjs/tsconfig.json +++ b/types/kineticjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/klaw-sync/tsconfig.json b/types/klaw-sync/tsconfig.json index f6fe9eb8bd..fbca4d319c 100644 --- a/types/klaw-sync/tsconfig.json +++ b/types/klaw-sync/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/klaw/klaw-tests.ts b/types/klaw/klaw-tests.ts index 2487aafd85..69406f73e8 100644 --- a/types/klaw/klaw-tests.ts +++ b/types/klaw/klaw-tests.ts @@ -1,4 +1,4 @@ -import * as klaw from "klaw"; +import klaw = require("klaw"); const path = require('path'); // README.md: Streams 1 (push) example: diff --git a/types/klaw/tsconfig.json b/types/klaw/tsconfig.json index 1d3db09e05..afa97d598d 100644 --- a/types/klaw/tsconfig.json +++ b/types/klaw/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/klaw/v1/klaw-tests.ts b/types/klaw/v1/klaw-tests.ts index 5e425a714a..7bfd79ee50 100644 --- a/types/klaw/v1/klaw-tests.ts +++ b/types/klaw/v1/klaw-tests.ts @@ -1,4 +1,4 @@ -import * as klaw from "klaw"; +import klaw = require("klaw"); import * as path from "path"; // README.md: Streams 1 (push) example: diff --git a/types/klaw/v1/tsconfig.json b/types/klaw/v1/tsconfig.json index 35caa3f9ea..8af7f84870 100644 --- a/types/klaw/v1/tsconfig.json +++ b/types/klaw/v1/tsconfig.json @@ -19,7 +19,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kms-json/index.d.ts b/types/kms-json/index.d.ts new file mode 100644 index 0000000000..b7a7881f85 --- /dev/null +++ b/types/kms-json/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for kms-json 1.1 +// Project: https://github.com/AlexanderMS/kms-json +// Definitions by: Yoichi Imai +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TypeScript Version: 2.2 + +declare namespace KmsJson { + interface KmsJsonOptions { + awsKmsSettings?: object; + keyId: string; + encoding?: string; + } +} + +declare class KmsJson { + constructor(options: KmsJson.KmsJsonOptions); + encrypt(inputJson: object): string; + decrypt(cipherText: string): object; +} + +export = KmsJson; diff --git a/types/kms-json/kms-json-tests.ts b/types/kms-json/kms-json-tests.ts new file mode 100644 index 0000000000..d9825f949c --- /dev/null +++ b/types/kms-json/kms-json-tests.ts @@ -0,0 +1,10 @@ +import KmsJson = require('kms-json'); + +const kmsJson = new KmsJson({ + awsKmsSettings: { }, + keyId: "foo", + encoding: "base64" +}); + +kmsJson.encrypt({ abc: 123 }); +kmsJson.decrypt("bar"); diff --git a/types/kms-json/tsconfig.json b/types/kms-json/tsconfig.json new file mode 100644 index 0000000000..ed29ab5a4d --- /dev/null +++ b/types/kms-json/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "kms-json-tests.ts" + ] +} \ No newline at end of file diff --git a/types/kms-json/tslint.json b/types/kms-json/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/kms-json/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/knex-postgis/knex-postgis-tests.ts b/types/knex-postgis/knex-postgis-tests.ts index 43a6c2f58b..99eb1382fc 100644 --- a/types/knex-postgis/knex-postgis-tests.ts +++ b/types/knex-postgis/knex-postgis-tests.ts @@ -1,6 +1,6 @@ import * as GeoJSON from 'geojson'; -import * as Knex from 'knex'; -import * as KPG from 'knex-postgis'; +import Knex = require('knex'); +import KPG = require('knex-postgis'); const knex: Knex = Knex({ dialect: 'pg' }); const st: KPG.KnexPostgis = KPG(knex); diff --git a/types/knex-postgis/tsconfig.json b/types/knex-postgis/tsconfig.json index 7d088da2f2..a3172fd1a1 100644 --- a/types/knex-postgis/tsconfig.json +++ b/types/knex-postgis/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knex/index.d.ts b/types/knex/index.d.ts index 58dafaf788..99b6a10476 100644 --- a/types/knex/index.d.ts +++ b/types/knex/index.d.ts @@ -17,7 +17,7 @@ import Bluebird = require("bluebird"); type Callback = Function; type Client = Function; type Value = string | number | boolean | Date | Array | Array | Array | Array | Buffer | Knex.Raw; -type ColumnName = string | Knex.Raw | Knex.QueryBuilder; +type ColumnName = string | Knex.Raw | Knex.QueryBuilder | {[key: string]: string }; type TableName = string | Knex.Raw | Knex.QueryBuilder; interface Knex extends Knex.QueryInterface { @@ -29,7 +29,7 @@ interface Knex extends Knex.QueryInterface { transaction(transactionScope: (trx: Knex.Transaction) => Promise | Bluebird | void): Bluebird; destroy(callback: Function): void; destroy(): Bluebird; - batchInsert(tableName: TableName, data: any[], chunkSize: number): Knex.QueryBuilder; + batchInsert(tableName: TableName, data: any[], chunkSize?: number): Knex.QueryBuilder; schema: Knex.SchemaBuilder; queryBuilder(): Knex.QueryBuilder; @@ -116,7 +116,7 @@ declare namespace Knex { // Union union: Union; - unionAll(callback: Function): QueryBuilder; + unionAll(callback: QueryCallback): QueryBuilder; // Having having: Having; @@ -183,29 +183,29 @@ declare namespace Knex { interface Join { (raw: Raw): QueryBuilder; - (tableName: TableName, clause: (this: JoinClause, join: JoinClause) => void): QueryBuilder; - (tableName: TableName, columns: { [key: string]: string | number | Raw }): QueryBuilder; - (tableName: TableName, raw: Raw): QueryBuilder; - (tableName: TableName, column1: string, column2: string): QueryBuilder; - (tableName: TableName, column1: string, raw: Raw): QueryBuilder; - (tableName: TableName, column1: string, operator: string, column2: string): QueryBuilder; + (tableName: TableName | QueryCallback, clause: (this: JoinClause, join: JoinClause) => void): QueryBuilder; + (tableName: TableName | QueryCallback, columns: { [key: string]: string | number | Raw }): QueryBuilder; + (tableName: TableName | QueryCallback, raw: Raw): QueryBuilder; + (tableName: TableName | QueryCallback, column1: string, column2: string): QueryBuilder; + (tableName: TableName | QueryCallback, column1: string, raw: Raw): QueryBuilder; + (tableName: TableName | QueryCallback, column1: string, operator: string, column2: string): QueryBuilder; } interface JoinClause { on(raw: Raw): JoinClause; - on(callback: Function): JoinClause; + on(callback: QueryCallback): JoinClause; on(columns: { [key: string]: string | Raw }): JoinClause; on(column1: string, column2: string): JoinClause; on(column1: string, raw: Raw): JoinClause; on(column1: string, operator: string, column2: string | Raw): JoinClause; andOn(raw: Raw): JoinClause; - andOn(callback: Function): JoinClause; + andOn(callback: QueryCallback): JoinClause; andOn(columns: { [key: string]: string | Raw }): JoinClause; andOn(column1: string, column2: string): JoinClause; andOn(column1: string, raw: Raw): JoinClause; andOn(column1: string, operator: string, column2: string | Raw): JoinClause; orOn(raw: Raw): JoinClause; - orOn(callback: Function): JoinClause; + orOn(callback: QueryCallback): JoinClause; orOn(columns: { [key: string]: string | Raw }): JoinClause; orOn(column1: string, column2: string): JoinClause; orOn(column1: string, raw: Raw): JoinClause; @@ -222,12 +222,12 @@ declare namespace Knex { onNotNull(column1: string): JoinClause; andOnNotNull(column1: string): JoinClause; orOnNotNull(column1: string): JoinClause; - onExists(callback: () => void): JoinClause; - andOnExists(callback: () => void): JoinClause; - orOnExists(callback: () => void): JoinClause; - onNotExists(callback: () => void): JoinClause; - andOnNotExists(callback: () => void): JoinClause; - orOnNotExists(callback: () => void): JoinClause; + onExists(callback: QueryCallback): JoinClause; + andOnExists(callback: QueryCallback): JoinClause; + orOnExists(callback: QueryCallback): JoinClause; + onNotExists(callback: QueryCallback): JoinClause; + andOnNotExists(callback: QueryCallback): JoinClause; + orOnNotExists(callback: QueryCallback): JoinClause; onBetween(column1: string, range: [any, any]): JoinClause; andOnBetween(column1: string, range: [any, any]): JoinClause; orOnBetween(column1: string, range: [any, any]): JoinClause; @@ -260,7 +260,7 @@ declare namespace Knex { interface Where extends WhereRaw, WhereWrapped, WhereNull { (raw: Raw): QueryBuilder; - (callback: (queryBuilder: QueryBuilder) => any): QueryBuilder; + (callback: QueryCallback): QueryBuilder; (object: Object): QueryBuilder; (columnName: string, value: Value): QueryBuilder; (columnName: string, operator: string, value: Value): QueryBuilder; @@ -272,7 +272,7 @@ declare namespace Knex { } interface WhereWrapped { - (callback: Function): QueryBuilder; + (callback: QueryCallback): QueryBuilder; } interface WhereNull { @@ -281,7 +281,7 @@ declare namespace Knex { interface WhereIn { (columnName: string, values: Value[]): QueryBuilder; - (columnName: string, callback: Function): QueryBuilder; + (columnName: string, callback: QueryCallback): QueryBuilder; (columnName: string, query: QueryBuilder): QueryBuilder; } @@ -290,7 +290,7 @@ declare namespace Knex { } interface WhereExists { - (callback: Function): QueryBuilder; + (callback: QueryCallback): QueryBuilder; (query: QueryBuilder): QueryBuilder; } @@ -310,10 +310,10 @@ declare namespace Knex { } interface Union { - (callback: Function, wrap?: boolean): QueryBuilder; - (callbacks: Function[], wrap?: boolean): QueryBuilder; - (...callbacks: Function[]): QueryBuilder; - // (...callbacks: Function[], wrap?: boolean): QueryInterface; + (callback: QueryCallback, wrap?: boolean): QueryBuilder; + (callbacks: QueryCallback[], wrap?: boolean): QueryBuilder; + (...callbacks: QueryCallback[]): QueryBuilder; + // (...callbacks: QueryCallback[], wrap?: boolean): QueryInterface; } interface Having extends RawQueryBuilder, WhereWrapped { @@ -350,6 +350,7 @@ declare namespace Knex { // QueryBuilder // + type QueryCallback = (this: QueryBuilder, builder: QueryBuilder) => void; interface QueryBuilder extends QueryInterface, ChainableInterface { or: QueryBuilder; and: QueryBuilder; @@ -427,7 +428,7 @@ declare namespace Knex { time(columnName: string): ColumnBuilder; timestamp(columnName: string): ColumnBuilder; timestamps(useTimestampType?: boolean, makeDefaultNow?: boolean): ColumnBuilder; - binary(columnName: string): ColumnBuilder; + binary(columnName: string, length?: number): ColumnBuilder; enum(columnName: string, values: Value[]): ColumnBuilder; enu(columnName: string, values: Value[]): ColumnBuilder; json(columnName: string): ColumnBuilder; diff --git a/types/knex/knex-tests.ts b/types/knex/knex-tests.ts index 3f9f20ab72..3aaefb6909 100644 --- a/types/knex/knex-tests.ts +++ b/types/knex/knex-tests.ts @@ -168,6 +168,8 @@ knex.avg('sum_column1').from(function() { knex.column('title', 'author', 'year').select().from('books'); knex.column(['title', 'author', 'year']).select().from('books'); +knex.column('title', { by: 'author' }, 'year').select().from('books'); +knex.column({ title: 'title', by: 'author', published: 'year' }).select().from('books'); knex.select('*').from('users'); knex('users').where({ @@ -457,6 +459,44 @@ knex.select('*').from('accounts').joinRaw('natural full join table1').where('id' knex.select('*').from('accounts').join(knex.raw('natural full join table1')).where('id', 1); +knex.select('*').from('accounts') + .join(function() { + this.select('*').from('accounts').as('special_accounts'); + }, 'special_accounts.a', '=', 'accounts.b'); +knex.select('*').from('accounts') + .leftJoin(function() { + this.select('*').from('accounts').as('special_accounts'); + }, 'special_accounts.a', '=', 'accounts.b'); +knex.select('*').from('accounts') + .leftOuterJoin(function() { + this.select('*').from('accounts').as('special_accounts'); + }, 'special_accounts.a', '=', 'accounts.b'); +knex.select('*').from('accounts') + .rightJoin(function() { + this.select('*').from('accounts').as('special_accounts'); + }, 'special_accounts.a', '=', 'accounts.b'); +knex.select('*').from('accounts') + .rightOuterJoin(function() { + this.select('*').from('accounts').as('special_accounts'); + }, 'special_accounts.a', '=', 'accounts.b'); +knex.select('*').from('accounts') + .innerJoin(function() { + this.select('*').from('accounts').as('special_accounts'); + }, 'special_accounts.a', '=', 'accounts.b'); +knex.select('*').from('accounts') + .crossJoin(function() { + this.select('*').from('accounts').as('special_accounts'); + }, 'special_accounts.a', '=', 'accounts.b'); +knex.select('*').from('accounts') + .fullOuterJoin(function() { + this.select('*').from('accounts').as('special_accounts'); + }, 'special_accounts.a', '=', 'accounts.b'); +knex.select('*').from('accounts') + .outerJoin(function() { + this.select('*').from('accounts').as('special_accounts'); + }, 'special_accounts.a', '=', 'accounts.b'); + + knex('customers') .distinct('first_name', 'last_name') .select(); @@ -485,6 +525,7 @@ knex('books') .insert([{title: 'Great Gatsby'}, {title: 'Fahrenheit 451'}]); knex.batchInsert('books', [{title: 'Great Gatsby'}, {title: 'Fahrenheit 451'}], 200); +knex.batchInsert('books', [{title: 'Catcher In The Rye'}, {title: 'Pride And Prejudice'}]); knex.queryBuilder().table('books'); knex('books').where('published_date', '<', 2000).update({status: 'archived'}); @@ -900,6 +941,72 @@ knex.select('*') knex.select('*').from('users').where(knex.raw('id = ?', [1])).toSQL(); +// +// Callback functions +// +knex('users') + .select('*') + .join('contacts', function(builder) { + this.on(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).andOn(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).orOn(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).onExists(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).orOnExists(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).andOnExists(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).onNotExists(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).andOnNotExists(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).orOnNotExists(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }); + }).where(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).orWhere(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).andWhere(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).whereIn('column', function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).orWhereIn('column', function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).whereNotIn('column', function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).orWhereNotIn('column', function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).whereWrapped(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).union(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).unionAll(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }); + // // Migrations // @@ -933,3 +1040,9 @@ knex.schema .createTable('A', table => { table.integer('C').unsigned().references('B.id').notNullable(); }); + + +//creating table in MySQL with binary primary key with known field length +knex.schema.createTable('testTable', function (table) { + table.binary('binaryKey', 16).primary(); //will make table with binaryKey type BINARY(16) +}); diff --git a/types/knex/tsconfig.json b/types/knex/tsconfig.json index 41e9ae905e..ceb9258104 100644 --- a/types/knex/tsconfig.json +++ b/types/knex/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "knex-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/knockback/tsconfig.json b/types/knockback/tsconfig.json index fa1c069762..b4076b50e2 100644 --- a/types/knockback/tsconfig.json +++ b/types/knockback/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/knockout-amd-helpers/tsconfig.json b/types/knockout-amd-helpers/tsconfig.json index b79c6d90d2..45078709f1 100644 --- a/types/knockout-amd-helpers/tsconfig.json +++ b/types/knockout-amd-helpers/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockout-secure-binding/tsconfig.json b/types/knockout-secure-binding/tsconfig.json index 111b6eeeee..379ad7d39b 100644 --- a/types/knockout-secure-binding/tsconfig.json +++ b/types/knockout-secure-binding/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockout-transformations/tsconfig.json b/types/knockout-transformations/tsconfig.json index 4e5e456ef6..b15f7bf06b 100644 --- a/types/knockout-transformations/tsconfig.json +++ b/types/knockout-transformations/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockout.deferred.updates/tsconfig.json b/types/knockout.deferred.updates/tsconfig.json index e454e60d07..d01b404ad5 100644 --- a/types/knockout.deferred.updates/tsconfig.json +++ b/types/knockout.deferred.updates/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockout.editables/tsconfig.json b/types/knockout.editables/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/knockout.editables/tsconfig.json +++ b/types/knockout.editables/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/knockout.es5/tsconfig.json b/types/knockout.es5/tsconfig.json index 794ea97505..5df65298d6 100644 --- a/types/knockout.es5/tsconfig.json +++ b/types/knockout.es5/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockout.kogrid/tsconfig.json b/types/knockout.kogrid/tsconfig.json index 005a8c6eb1..d410f0d355 100644 --- a/types/knockout.kogrid/tsconfig.json +++ b/types/knockout.kogrid/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockout.mapper/tsconfig.json b/types/knockout.mapper/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/knockout.mapper/tsconfig.json +++ b/types/knockout.mapper/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/knockout.mapping/index.d.ts b/types/knockout.mapping/index.d.ts index e6d5fe2f6c..62effd565c 100644 --- a/types/knockout.mapping/index.d.ts +++ b/types/knockout.mapping/index.d.ts @@ -35,24 +35,20 @@ declare global { update?: (options: KnockoutMappingUpdateOptions) => void; key?: (data: any) => any; } - - type KnockoutObservableType = { - [P in keyof T]: KnockoutObservable; - }; interface KnockoutMapping { isMapped(viewModel: any): boolean; - fromJS(jsObject: T[]): KnockoutObservableType[]; - fromJS(jsObject: T[], targetOrOptions: any): KnockoutObservableType[]; - fromJS(jsObject: T[], inputOptions: any, target: any): KnockoutObservableType[]; + fromJS(jsObject: T[]): KnockoutObservableArray>; + fromJS(jsObject: T[], targetOrOptions: any): KnockoutObservableArray>; + fromJS(jsObject: T[], inputOptions: any, target: any): KnockoutObservableArray>; fromJS(jsObject: T): KnockoutObservableType; fromJS(jsObject: T, targetOrOptions: any): KnockoutObservableType; fromJS(jsObject: T, inputOptions: any, target: any): KnockoutObservableType; fromJSON(jsonString: string): any; fromJSON(jsonString: string, targetOrOptions: any): any; fromJSON(jsonString: string, inputOptions: any, target: any): any; - toJS(rootObject: KnockoutObservableArray|T, options?: KnockoutMappingOptions): T[]; - toJS(rootObject: KnockoutObservableType|T, options?: KnockoutMappingOptions): T; + toJS(viewModel: KnockoutObservableArray|KnockoutObservableType[]|KnockoutObservableArray>|T[], options?: KnockoutMappingOptions): T[]; + toJS(viewModel: KnockoutObservable|KnockoutObservableType|KnockoutObservable>|T, options?: KnockoutMappingOptions): T; toJSON(rootObject: any, options?: KnockoutMappingOptions): string; defaultOptions(): KnockoutMappingOptions; resetDefaultOptions(): void; diff --git a/types/knockout.mapping/tsconfig.json b/types/knockout.mapping/tsconfig.json index 1ae87d442f..abc93c70b5 100644 --- a/types/knockout.mapping/tsconfig.json +++ b/types/knockout.mapping/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockout.postbox/tsconfig.json b/types/knockout.postbox/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/knockout.postbox/tsconfig.json +++ b/types/knockout.postbox/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/knockout.projections/tsconfig.json b/types/knockout.projections/tsconfig.json index 97fa4bbc5e..963e6eed90 100644 --- a/types/knockout.projections/tsconfig.json +++ b/types/knockout.projections/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockout.punches/tsconfig.json b/types/knockout.punches/tsconfig.json index 6851149d09..e0388f01e2 100644 --- a/types/knockout.punches/tsconfig.json +++ b/types/knockout.punches/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockout.rx/tsconfig.json b/types/knockout.rx/tsconfig.json index 3a2a3fdb73..737007087d 100644 --- a/types/knockout.rx/tsconfig.json +++ b/types/knockout.rx/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockout.validation/tsconfig.json b/types/knockout.validation/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/knockout.validation/tsconfig.json +++ b/types/knockout.validation/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/knockout.viewmodel/tsconfig.json b/types/knockout.viewmodel/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/knockout.viewmodel/tsconfig.json +++ b/types/knockout.viewmodel/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/knockout/index.d.ts b/types/knockout/index.d.ts index 8d035ed8d2..ade040f441 100644 --- a/types/knockout/index.d.ts +++ b/types/knockout/index.d.ts @@ -314,6 +314,7 @@ interface KnockoutUtils { triggerEvent(element: any, eventType: any): void; unwrapObservable(value: KnockoutObservable | T): T; + unwrapObservable(value: KnockoutObservableArray | T[]): T[]; // NOT PART OF THE MINIFIED API SURFACE (ONLY IN knockout-{version}.debug.js) https://github.com/SteveSanderson/knockout/issues/670 // forceRefresh(node: any): void; @@ -409,6 +410,9 @@ interface KnockoutTasks { } ///////////////////////////////// +type KnockoutObservableType = { + [P in keyof T]: KnockoutObservable; +}; interface KnockoutStatic { utils: KnockoutUtils; @@ -440,16 +444,18 @@ interface KnockoutStatic { contextFor(node: any): any; isSubscribable(instance: any): instance is KnockoutSubscribable; toJSON(viewModel: any, replacer?: Function, space?: any): string; - toJS(viewModel: any): any; - isObservable(instance: any): instance is KnockoutObservable; - isWriteableObservable(instance: any): instance is KnockoutObservable; - isComputed(instance: any): instance is KnockoutComputed; + toJS(viewModel: KnockoutObservableArray|KnockoutObservableType[]|KnockoutObservableArray>|T[]): T[]; + toJS(viewModel: KnockoutObservable|KnockoutObservableType|KnockoutObservable>|T): T; + isObservable(instance: KnockoutObservable|T): instance is KnockoutObservable; + isWriteableObservable(instance: KnockoutObservable|T): instance is KnockoutObservable; + isComputed(instance: KnockoutObservable|T): instance is KnockoutComputed; dataFor(node: any): any; removeNode(node: Node): void; cleanNode(node: Node): Node; renderTemplate(template: Function, viewModel: any, options?: any, target?: any, renderMode?: any): any; renderTemplate(template: string, viewModel: any, options?: any, target?: any, renderMode?: any): any; unwrap(value: KnockoutObservable | T): T; + unwrap(value: KnockoutObservableArray | T[]): T[]; computedContext: KnockoutComputedContext; diff --git a/types/knockout/tsconfig.json b/types/knockout/tsconfig.json index 1a314f7b0e..a37a6a6079 100644 --- a/types/knockout/tsconfig.json +++ b/types/knockout/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockstrap/tsconfig.json b/types/knockstrap/tsconfig.json index 4d09924e6d..4572dcd8c4 100644 --- a/types/knockstrap/tsconfig.json +++ b/types/knockstrap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knuddels-userapps-api/tsconfig.json b/types/knuddels-userapps-api/tsconfig.json index 96c3a04cc9..967fe5f571 100644 --- a/types/knuddels-userapps-api/tsconfig.json +++ b/types/knuddels-userapps-api/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ko.plus/tsconfig.json b/types/ko.plus/tsconfig.json index 7dbc42737f..6395dd819f 100644 --- a/types/ko.plus/tsconfig.json +++ b/types/ko.plus/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-basic-auth/koa-basic-auth-tests.ts b/types/koa-basic-auth/koa-basic-auth-tests.ts index 43cc5ab833..a1a8e8c3c2 100644 --- a/types/koa-basic-auth/koa-basic-auth-tests.ts +++ b/types/koa-basic-auth/koa-basic-auth-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from "koa"; +import Koa = require("koa"); import auth = require("koa-basic-auth"); const app = new Koa(); diff --git a/types/koa-basic-auth/tsconfig.json b/types/koa-basic-auth/tsconfig.json index 26e8260665..c6f340afe1 100644 --- a/types/koa-basic-auth/tsconfig.json +++ b/types/koa-basic-auth/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-bodyparser/index.d.ts b/types/koa-bodyparser/index.d.ts index 042aa99ea3..256a2fad0a 100644 --- a/types/koa-bodyparser/index.d.ts +++ b/types/koa-bodyparser/index.d.ts @@ -1,7 +1,7 @@ -// Type definitions for koa-bodyparser v3.x +// Type definitions for koa-bodyparser 4.2 // Project: https://github.com/koajs/bodyparser // Definitions by: Jerry Chin -// Definitions: https://github.com/hellopao/DefinitelyTyped +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 /* =================== USAGE =================== @@ -14,7 +14,6 @@ =============================================== */ - import * as Koa from "koa"; declare module "koa" { diff --git a/types/koa-bodyparser/koa-bodyparser-tests.ts b/types/koa-bodyparser/koa-bodyparser-tests.ts index 41435071e2..e38eb112dd 100644 --- a/types/koa-bodyparser/koa-bodyparser-tests.ts +++ b/types/koa-bodyparser/koa-bodyparser-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from "koa"; -import * as bodyParser from "koa-bodyparser"; +import Koa = require("koa"); +import bodyParser = require("koa-bodyparser"); const app = new Koa(); @@ -8,6 +8,6 @@ app.use(bodyParser({ strict: false })); app.use((ctx) => { console.log(ctx.request.body); console.log(ctx.request.rawBody); -}) +}); app.listen(80); diff --git a/types/koa-bodyparser/tsconfig.json b/types/koa-bodyparser/tsconfig.json index 1e7b5ee33e..e2af3dd2e0 100644 --- a/types/koa-bodyparser/tsconfig.json +++ b/types/koa-bodyparser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-bodyparser/tslint.json b/types/koa-bodyparser/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/koa-bodyparser/tslint.json +++ b/types/koa-bodyparser/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" } diff --git a/types/koa-cache-control/koa-cache-control-tests.ts b/types/koa-cache-control/koa-cache-control-tests.ts index c99f4fe862..9135551e7c 100644 --- a/types/koa-cache-control/koa-cache-control-tests.ts +++ b/types/koa-cache-control/koa-cache-control-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from "koa"; -import * as cacheControl from "koa-cache-control"; +import Koa = require("koa"); +import cacheControl = require("koa-cache-control"); const app = new Koa(); diff --git a/types/koa-cache-control/tsconfig.json b/types/koa-cache-control/tsconfig.json index 3ecc5fd497..6c5cd8ce2b 100644 --- a/types/koa-cache-control/tsconfig.json +++ b/types/koa-cache-control/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-compose/tsconfig.json b/types/koa-compose/tsconfig.json index 59b13908a4..dcb5315c10 100644 --- a/types/koa-compose/tsconfig.json +++ b/types/koa-compose/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/koa-compress/koa-compress-tests.ts b/types/koa-compress/koa-compress-tests.ts index 30195cd30c..e24bc53b27 100644 --- a/types/koa-compress/koa-compress-tests.ts +++ b/types/koa-compress/koa-compress-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from "koa"; +import Koa = require("koa"); import compress = require("koa-compress"); const app = new Koa(); diff --git a/types/koa-compress/tsconfig.json b/types/koa-compress/tsconfig.json index 332dd960c4..f52f464f96 100644 --- a/types/koa-compress/tsconfig.json +++ b/types/koa-compress/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/koa-conditional-get/tsconfig.json b/types/koa-conditional-get/tsconfig.json index 111408f39b..36380b9cc4 100644 --- a/types/koa-conditional-get/tsconfig.json +++ b/types/koa-conditional-get/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "koa-conditional-get-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/koa-csrf/koa-csrf-tests.ts b/types/koa-csrf/koa-csrf-tests.ts index d0bb211b01..8886e8b0cf 100644 --- a/types/koa-csrf/koa-csrf-tests.ts +++ b/types/koa-csrf/koa-csrf-tests.ts @@ -1,5 +1,5 @@ import koaCsrf = require("koa-csrf"); -import * as Koa from "koa"; +import Koa = require("koa"); const app = new Koa(); app.use(new koaCsrf({ diff --git a/types/koa-csrf/tsconfig.json b/types/koa-csrf/tsconfig.json index 56e1cf81a8..ff82d8c580 100644 --- a/types/koa-csrf/tsconfig.json +++ b/types/koa-csrf/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "koa-csrf-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/koa-etag/koa-etag-tests.ts b/types/koa-etag/koa-etag-tests.ts index fa2d5515d6..a5cac4b870 100644 --- a/types/koa-etag/koa-etag-tests.ts +++ b/types/koa-etag/koa-etag-tests.ts @@ -1,5 +1,5 @@ import koaEtag = require('koa-etag'); -import * as Koa from 'koa'; +import Koa = require('koa'); new Koa().use(koaEtag()); diff --git a/types/koa-etag/tsconfig.json b/types/koa-etag/tsconfig.json index d6b1feb52c..511623a09e 100644 --- a/types/koa-etag/tsconfig.json +++ b/types/koa-etag/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "koa-etag-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/koa-favicon/koa-favicon-tests.ts b/types/koa-favicon/koa-favicon-tests.ts index 72dfdb5aaa..755c38ff58 100644 --- a/types/koa-favicon/koa-favicon-tests.ts +++ b/types/koa-favicon/koa-favicon-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from "koa"; +import Koa = require("koa"); import favicon = require("koa-favicon"); const app = new Koa(); diff --git a/types/koa-favicon/tsconfig.json b/types/koa-favicon/tsconfig.json index 15566de398..bab1d261b3 100644 --- a/types/koa-favicon/tsconfig.json +++ b/types/koa-favicon/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-generic-session/koa-generic-session-tests.ts b/types/koa-generic-session/koa-generic-session-tests.ts index e48d4dbef6..be10c1e04f 100644 --- a/types/koa-generic-session/koa-generic-session-tests.ts +++ b/types/koa-generic-session/koa-generic-session-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from "koa"; +import Koa = require("koa"); import { MemoryStore, Session } from "koa-generic-session"; import session = require("koa-generic-session"); diff --git a/types/koa-generic-session/tsconfig.json b/types/koa-generic-session/tsconfig.json index d16c12ef15..5b694a7245 100644 --- a/types/koa-generic-session/tsconfig.json +++ b/types/koa-generic-session/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-hbs/koa-hbs-tests.ts b/types/koa-hbs/koa-hbs-tests.ts index 14a113e816..0090f446c1 100644 --- a/types/koa-hbs/koa-hbs-tests.ts +++ b/types/koa-hbs/koa-hbs-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from 'koa'; +import Koa = require('koa'); import hbs = require("koa-hbs"); import * as Path from 'path'; diff --git a/types/koa-hbs/tsconfig.json b/types/koa-hbs/tsconfig.json index b286334455..e2651e411b 100644 --- a/types/koa-hbs/tsconfig.json +++ b/types/koa-hbs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-helmet/koa-helmet-tests.ts b/types/koa-helmet/koa-helmet-tests.ts index 1f50ea5c6b..2290ab07fa 100644 --- a/types/koa-helmet/koa-helmet-tests.ts +++ b/types/koa-helmet/koa-helmet-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from 'koa'; +import Koa = require('koa'); import helmet = require('koa-helmet'); const app = new Koa(); diff --git a/types/koa-helmet/tsconfig.json b/types/koa-helmet/tsconfig.json index 1024081843..8f895a44bf 100644 --- a/types/koa-helmet/tsconfig.json +++ b/types/koa-helmet/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-joi-router/tsconfig.json b/types/koa-joi-router/tsconfig.json index a872570270..d5d1b300ec 100644 --- a/types/koa-joi-router/tsconfig.json +++ b/types/koa-joi-router/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/koa-json-error/koa-json-error-tests.ts b/types/koa-json-error/koa-json-error-tests.ts index 9b2ab3c8de..be76a08cb3 100644 --- a/types/koa-json-error/koa-json-error-tests.ts +++ b/types/koa-json-error/koa-json-error-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from "koa"; -import * as error from "koa-json-error"; +import Koa = require("koa"); +import error = require("koa-json-error"); const app = new Koa(); diff --git a/types/koa-json-error/tsconfig.json b/types/koa-json-error/tsconfig.json index 7aa60a506f..620700358d 100644 --- a/types/koa-json-error/tsconfig.json +++ b/types/koa-json-error/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-json/koa-json-tests.ts b/types/koa-json/koa-json-tests.ts index deb3aa8e0d..bce89d95eb 100644 --- a/types/koa-json/koa-json-tests.ts +++ b/types/koa-json/koa-json-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from "koa"; -import * as json from 'koa-json'; +import Koa = require("koa"); +import json = require('koa-json'); const app = new Koa(); diff --git a/types/koa-json/tsconfig.json b/types/koa-json/tsconfig.json index 914c85a096..a9350d68de 100644 --- a/types/koa-json/tsconfig.json +++ b/types/koa-json/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-logger-winston/koa-logger-winston-tests.ts b/types/koa-logger-winston/koa-logger-winston-tests.ts index 44b9047b86..7bec5877f4 100644 --- a/types/koa-logger-winston/koa-logger-winston-tests.ts +++ b/types/koa-logger-winston/koa-logger-winston-tests.ts @@ -1,5 +1,5 @@ -import * as koa from 'koa'; -import * as logger from 'koa-logger-winston'; +import koa = require('koa'); +import logger = require('koa-logger-winston'); import * as winston from 'winston'; const app = new koa(); diff --git a/types/koa-logger-winston/tsconfig.json b/types/koa-logger-winston/tsconfig.json index 2f3ccb79ee..43a0fb6611 100644 --- a/types/koa-logger-winston/tsconfig.json +++ b/types/koa-logger-winston/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-logger/koa-logger-tests.ts b/types/koa-logger/koa-logger-tests.ts index 502c33255d..bd4a32213b 100644 --- a/types/koa-logger/koa-logger-tests.ts +++ b/types/koa-logger/koa-logger-tests.ts @@ -1,5 +1,5 @@ -import * as koa from 'koa'; -import * as logger from 'koa-logger'; +import koa = require('koa'); +import logger = require('koa-logger'); const app = new koa(); app.use(logger()); diff --git a/types/koa-logger/tsconfig.json b/types/koa-logger/tsconfig.json index 28110f20ac..a82734e6f3 100644 --- a/types/koa-logger/tsconfig.json +++ b/types/koa-logger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-morgan/koa-morgan-tests.ts b/types/koa-morgan/koa-morgan-tests.ts index 0a0e51cd95..8d4936a78a 100644 --- a/types/koa-morgan/koa-morgan-tests.ts +++ b/types/koa-morgan/koa-morgan-tests.ts @@ -1,6 +1,6 @@ import { IncomingMessage, ServerResponse } from 'http'; -import * as Koa from 'koa'; -import * as morgan from 'koa-morgan'; +import Koa = require('koa'); +import morgan = require('koa-morgan'); const app = new Koa(); diff --git a/types/koa-morgan/tsconfig.json b/types/koa-morgan/tsconfig.json index ecf170e923..a2b3ae7c8d 100644 --- a/types/koa-morgan/tsconfig.json +++ b/types/koa-morgan/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-mount/index.d.ts b/types/koa-mount/index.d.ts index d408932bfc..138d4f6f36 100644 --- a/types/koa-mount/index.d.ts +++ b/types/koa-mount/index.d.ts @@ -1,18 +1,15 @@ -// Type definitions for koa-mount v2.0.0 +// Type definitions for koa-mount 3.0 // Project: https://github.com/koajs/mount // Definitions by: AmirSaber Sharifi +// Tomek Åaziuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -import * as Koa from "koa"; +import Koa = require("koa"); -declare function mount(app: Koa.Middleware): Koa.Middleware; +declare function mount(app: Koa.Middleware | Koa): Koa.Middleware; -declare function mount(app: Koa): Koa.Middleware; - -declare function mount(prefix: string, app: Koa.Middleware): Koa.Middleware; - -declare function mount(prefix: string, app: Koa): Koa.Middleware; +declare function mount(prefix: string, app: Koa.Middleware | Koa): Koa.Middleware; declare namespace mount { } diff --git a/types/koa-mount/koa-mount-tests.ts b/types/koa-mount/koa-mount-tests.ts index 2fcf784ef6..139e08a3d8 100644 --- a/types/koa-mount/koa-mount-tests.ts +++ b/types/koa-mount/koa-mount-tests.ts @@ -1,14 +1,11 @@ - - - -import * as Koa from "koa"; -import * as mount from "koa-mount"; +import Koa = require("koa"); +import mount = require("koa-mount"); const a = new Koa(); a.use((next) => { this.body = "Hello"; -}) +}); const b = new Koa(); @@ -23,4 +20,3 @@ app.use(mount("/world", b)); app.listen(3000); console.log("listening on port 3000"); - diff --git a/types/koa-mount/tsconfig.json b/types/koa-mount/tsconfig.json index d19516145b..ba31b0009f 100644 --- a/types/koa-mount/tsconfig.json +++ b/types/koa-mount/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-mount/tslint.json b/types/koa-mount/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/koa-mount/tslint.json +++ b/types/koa-mount/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" } diff --git a/types/koa-multer/index.d.ts b/types/koa-multer/index.d.ts new file mode 100644 index 0000000000..1c518bdd61 --- /dev/null +++ b/types/koa-multer/index.d.ts @@ -0,0 +1,134 @@ +// Type definitions for koa-multer 1.0 +// Project: https://github.com/koa-modules/multer +// Definitions by: benstevens48 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @file + * These definitions are based on the type definitions for multer - https://github.com/expressjs/multer - found on DefinitelyTyped. + * + * Note that it is necessary to explicitly cast the `Context.req` object to type `multer.MulterIncomingMessage` + * to get the correct type for the patched `Context.req` object, as in the following example. + * ```ts + * import * as Koa from 'koa'; + * import * as Router from 'koa-router'; + * import * as multer from 'koa-multer'; + * + * async function uploadFile(ctx: Koa.Context){ + * let multerReq = ctx.req; + * let files = multerReq.files; + * let baseFilePath: string = ctx.params.path || ''; + * //... + * } + * + * let router = new Router(); + * router.put('/uploads/:path?', upload.array('files'), uploadFile); + * ``` + * The type cast is necessary since the type definitions for Koa do not allow for the `Context.req` property to be extended. + */ + +import * as Koa from 'koa'; +import { IncomingMessage } from 'http'; + +declare namespace multer { + interface File { + /** Field name specified in the form */ + fieldname: string; + /** Name of the file on the user's computer */ + originalname: string; + /** Encoding type of the file */ + encoding: string; + /** Mime type of the file */ + mimetype: string; + /** Size of the file in bytes */ + size: number; + /** The folder to which the file has been saved (DiskStorage) */ + destination: string; + /** The name of the file within the destination (DiskStorage) */ + filename: string; + /** Location of the uploaded file (DiskStorage) */ + path: string; + /** A Buffer of the entire file (MemoryStorage) */ + buffer: Buffer; + } + + interface MulterIncomingMessage extends IncomingMessage { + body: any; + file: File; + files: { + [fieldname: string]: File[]; + } | File[]; + } + + interface Field { + /** The field name. */ + name: string; + /** Optional maximum number of files per field to accept. */ + maxCount?: number; + } + + interface Options { + /** The destination directory for the uploaded files. */ + dest?: string; + /** The storage engine to use for uploaded files. */ + storage?: StorageEngine; + /** + * An object specifying the size limits of the following optional properties. This object is passed to busboy + * directly, and the details of properties can be found on https://github.com/mscdex/busboy#busboy-methods + */ + limits?: { + /** Max field name size (Default: 100 bytes) */ + fieldNameSize?: number; + /** Max field value size (Default: 1MB) */ + fieldSize?: number; + /** Max number of non- file fields (Default: Infinity) */ + fields?: number; + /** For multipart forms, the max file size (in bytes)(Default: Infinity) */ + fileSize?: number; + /** For multipart forms, the max number of file fields (Default: Infinity) */ + files?: number; + /** For multipart forms, the max number of parts (fields + files)(Default: Infinity) */ + parts?: number; + /** For multipart forms, the max number of header key=> value pairs to parse Default: 2000(same as node's http). */ + headerPairs?: number; + /** Keep the full path of files instead of just the base name (Default: false) */ + preservePath?: boolean; + }; + /** A function to control which files to upload and which to skip. */ + fileFilter?(req: IncomingMessage, file: File, callback: (error: Error | null, acceptFile: boolean) => void): void; + } + + interface StorageEngine { + _handleFile(req: IncomingMessage, file: File, callback: (error?: any, info?: File) => void): void; + _removeFile(req: IncomingMessage, file: File, callback: (error: Error) => void): void; + } + + interface DiskStorageOptions { + /** A function used to determine within which folder the uploaded files should be stored. Defaults to the system's default temporary directory. */ + destination?: string | ((req: IncomingMessage, file: File, callback: (error: Error | null, destination: string) => void) => void); + /** A function used to determine what the file should be named inside the folder. Defaults to a random name with no file extension. */ + filename?(req: IncomingMessage, file: File, callback: (error: Error | null, filename: string) => void): void; + } + + interface Instance { + /** In case you need to handle a text-only multipart form, you can use any of the multer methods (.single(), .array(), fields()), req.body contains the text fields */ + /** Accept a single file with the name fieldName. The single file will be stored in req.file. */ + single(fieldName?: string): Koa.Middleware; + /** Accept an array of files, all with the name fieldName. Optionally error out if more than maxCount files are uploaded. The array of files will be stored in req.files. */ + array(fieldName: string, maxCount?: number): Koa.Middleware; + /** Accept a mix of files, specified by fields. An object with arrays of files will be stored in req.files. */ + fields(fields: Field[]): Koa.Middleware; + /** Accepts all files that comes over the wire. An array of files will be stored in req.files. */ + any(): Koa.Middleware; + } + + /* The disk storage engine gives you full control on storing files to disk. */ + function diskStorage(options: DiskStorageOptions): StorageEngine; + /* The memory storage engine stores the files in memory as Buffer objects. */ + function memoryStorage(): StorageEngine; +} + +declare function multer(options?: multer.Options): multer.Instance; + +export = multer; diff --git a/types/koa-multer/koa-multer-tests.ts b/types/koa-multer/koa-multer-tests.ts new file mode 100644 index 0000000000..617e08c853 --- /dev/null +++ b/types/koa-multer/koa-multer-tests.ts @@ -0,0 +1,32 @@ +import Koa = require('koa'); +import multer = require('koa-multer'); + +const upload = multer({ + dest: 'uploads/', + fileFilter: (req, file, cb) => { + cb(null, true); + } +}); + +const app = new Koa(); + +app.use(upload.single('avatar')); + +app.use(upload.array('photos', 12)); + +const cpUpload = upload.fields([{ name: 'avatar', maxCount: 1 }, { name: 'gallery', maxCount: 8 }]); +app.use(cpUpload); + +const diskStorage = multer.diskStorage({ + destination(req, file, cb) { + cb(null, '/tmp/my-uploads'); + }, + filename(req, file, cb) { + cb(null, `${file.fieldname}-${Date.now()}`); + } +}); + +const diskUpload = multer({ storage: diskStorage }); + +const memoryStorage = multer.memoryStorage(); +const memoryUpload = multer({ storage: memoryStorage }); diff --git a/types/koa-multer/tsconfig.json b/types/koa-multer/tsconfig.json new file mode 100644 index 0000000000..64394ca142 --- /dev/null +++ b/types/koa-multer/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "koa-multer-tests.ts" + ] +} \ No newline at end of file diff --git a/types/koa-multer/tslint.json b/types/koa-multer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/koa-multer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/koa-passport/koa-passport-tests.ts b/types/koa-passport/koa-passport-tests.ts index 42827a85ba..afc07b956e 100644 --- a/types/koa-passport/koa-passport-tests.ts +++ b/types/koa-passport/koa-passport-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from 'koa'; +import Koa = require('koa'); import * as passport from 'koa-passport'; const app = new Koa(); diff --git a/types/koa-passport/tsconfig.json b/types/koa-passport/tsconfig.json index fcd51d7953..0e27ba922a 100644 --- a/types/koa-passport/tsconfig.json +++ b/types/koa-passport/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-pino-logger/koa-pino-logger-tests.ts b/types/koa-pino-logger/koa-pino-logger-tests.ts index 68f5dd1331..bec6f887d2 100644 --- a/types/koa-pino-logger/koa-pino-logger-tests.ts +++ b/types/koa-pino-logger/koa-pino-logger-tests.ts @@ -1,5 +1,5 @@ -import * as koa from 'koa'; -import * as logger from 'koa-pino-logger'; +import koa = require('koa'); +import logger = require('koa-pino-logger'); const app = new koa(); app.use(logger()); diff --git a/types/koa-pino-logger/tsconfig.json b/types/koa-pino-logger/tsconfig.json index 13810e891e..beb0397ac8 100644 --- a/types/koa-pino-logger/tsconfig.json +++ b/types/koa-pino-logger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-pug/tsconfig.json b/types/koa-pug/tsconfig.json index ac317cd48f..c3faadb87c 100644 --- a/types/koa-pug/tsconfig.json +++ b/types/koa-pug/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-range/koa-range-tests.ts b/types/koa-range/koa-range-tests.ts index c489bf4a6b..29982f9b04 100644 --- a/types/koa-range/koa-range-tests.ts +++ b/types/koa-range/koa-range-tests.ts @@ -1,5 +1,5 @@ -import * as range from "koa-range"; -import * as Koa from "koa"; +import range = require("koa-range"); +import Koa = require("koa"); const app = new Koa(); app.use(range); diff --git a/types/koa-range/tsconfig.json b/types/koa-range/tsconfig.json index 37c1c00f19..bbd6674449 100644 --- a/types/koa-range/tsconfig.json +++ b/types/koa-range/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-redis/koa-redis-tests.ts b/types/koa-redis/koa-redis-tests.ts index 21c8e010b0..2cf4ca2ddb 100644 --- a/types/koa-redis/koa-redis-tests.ts +++ b/types/koa-redis/koa-redis-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from "koa"; +import Koa = require("koa"); import { MemoryStore, Session } from "koa-generic-session"; import session = require("koa-generic-session"); import redisStore = require("koa-redis"); diff --git a/types/koa-redis/tsconfig.json b/types/koa-redis/tsconfig.json index a49a3a13c1..5aa71b8c46 100644 --- a/types/koa-redis/tsconfig.json +++ b/types/koa-redis/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-route/koa-route-tests.ts b/types/koa-route/koa-route-tests.ts index 331c7d6b53..3b26266434 100644 --- a/types/koa-route/koa-route-tests.ts +++ b/types/koa-route/koa-route-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from 'koa'; +import Koa = require('koa'); import * as route from 'koa-route'; const app = new Koa(); diff --git a/types/koa-route/tsconfig.json b/types/koa-route/tsconfig.json index 97dff8158a..d9025db325 100644 --- a/types/koa-route/tsconfig.json +++ b/types/koa-route/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-router/koa-router-tests.ts b/types/koa-router/koa-router-tests.ts index 32f041bbc7..bbd525897c 100644 --- a/types/koa-router/koa-router-tests.ts +++ b/types/koa-router/koa-router-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from "koa"; -import * as Router from "koa-router"; +import Koa = require("koa"); +import Router = require("koa-router"); const app = new Koa(); diff --git a/types/koa-router/tsconfig.json b/types/koa-router/tsconfig.json index 76f07fef64..22eb9a6790 100644 --- a/types/koa-router/tsconfig.json +++ b/types/koa-router/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-send/koa-send-tests.ts b/types/koa-send/koa-send-tests.ts index a3b136ea9a..33c8cdaa18 100644 --- a/types/koa-send/koa-send-tests.ts +++ b/types/koa-send/koa-send-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from 'koa'; -import * as send from 'koa-send'; +import Koa = require('koa'); +import send = require('koa-send'); const app = new Koa(); diff --git a/types/koa-send/tsconfig.json b/types/koa-send/tsconfig.json index 202d12546a..b43b7d491e 100644 --- a/types/koa-send/tsconfig.json +++ b/types/koa-send/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-session-minimal/koa-session-minimal-tests.ts b/types/koa-session-minimal/koa-session-minimal-tests.ts index b58f441d8e..6ea0ef7cf5 100644 --- a/types/koa-session-minimal/koa-session-minimal-tests.ts +++ b/types/koa-session-minimal/koa-session-minimal-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from "koa"; -import * as session from "koa-session-minimal"; +import Koa = require("koa"); +import session = require("koa-session-minimal"); const app = new Koa(); diff --git a/types/koa-session-minimal/tsconfig.json b/types/koa-session-minimal/tsconfig.json index 42cafb4d4a..1ce6059819 100644 --- a/types/koa-session-minimal/tsconfig.json +++ b/types/koa-session-minimal/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-session/index.d.ts b/types/koa-session/index.d.ts index bdc7d6b25b..8650a07d91 100644 --- a/types/koa-session/index.d.ts +++ b/types/koa-session/index.d.ts @@ -1,54 +1,158 @@ -// Type definitions for koa-session 3.0 +// Type definitions for koa-session 5.7 // Project: https://github.com/koajs/session // Definitions by: Yu Hsin Lu -// Definitions: https://github.com/kerol2r20/DefinitelyTyped +// Tomek Åaziuk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 /* =================== USAGE =================== import session = require("koa-session"); - import Koa = require('koa'); + import Koa = require("koa"); var app = new Koa(); app.use(session(app)); =============================================== */ -import * as Koa from "koa"; +import Koa = require("koa"); declare namespace session { - interface sessionConfig { + /** + * Session model. + */ + interface Session { + /** + * JSON representation of the session. + */ + toJSON(): object; + + /** + * alias to `toJSON` + */ + inspect(): object; + + /** + * Return how many values there are in the session object. + * Used to see if it"s "populated". + */ + readonly length: number; + + /** + * populated flag, which is just a boolean alias of .length. + */ + readonly populated: boolean; + + /** + * get/set session maxAge + */ + maxAge: opts["maxAge"]; + + /** + * save this session no matter whether it is populated + */ + save(): void; + + /** + * allow to put any value on session object + */ + [_: string]: any; + } + + interface ContextSession { + ctx: Koa.Context; + + app: Koa.Context["app"]; + + opts: opts; + + store: stores; + + session: Session | false; + + /** + * internal logic of `ctx.session` + */ + get(): Session; + + /** + * internal logic of `ctx.session=` + */ + set(val: any): void; + + prevHash: string; + + /** + * init session from external store + * will be called in the front of session middleware + */ + initFromExternal(): Promise; + + /** + * Commit the session changes or removal. + */ + commit(): Promise; + } + + interface util { + /** + * Decode the base64 cookie value to an object. + */ + decode(str: string): object; + + /** + * Encode an object into a base64-encoded JSON string. + */ + encode(obj: object): string; + + hash(sess: any): string; + } + + interface opts { /** * cookie key (default is koa:sess) */ - key?: string; + key: string; /** * maxAge in ms (default is 1 days) - * 'session' will result in a cookie that expires when session/browser is closed + * "session" will result in a cookie that expires when session/browser is closed * Warning: If a session cookie is stolen, this cookie will never expire */ - maxAge?: number | 'session'; + maxAge?: number | "session"; /** * can overwrite or not (default true) */ - overwrite?: boolean; + overwrite: boolean; /** * httpOnly or not (default true) */ - httpOnly?: boolean; + httpOnly: boolean; /** * signed or not (default true) */ - signed?: boolean; + signed: boolean; /** - * (boolean) Force a session identifier cookie to be set on every response - * The expiration is reset to the original maxAge, resetting the expiration countdown - * default is false + * custom encode method + */ + encode: util["encode"]; + + /** + * custom decode method + */ + decode: util["decode"]; + + /** + * The way of generating external session id is controlled by the options.genid, which defaults to Date.now() + "-" + uid.sync(24). + */ + genid: () => string; + + /** + * Force a session identifier cookie to be set on every response. The expiration is reset to the original maxAge, resetting the expiration countdown. default is false */ rolling?: boolean; @@ -57,59 +161,60 @@ declare namespace session { */ store?: stores; + /** + * If your session store requires data or utilities from context, opts.ContextStore is alse supported. + * ContextStore must be a class which claims three instance methods demonstrated above. + * new ContextStore(ctx) will be executed on every request. + */ + ContextStore?: { new(): stores }; + + /** + * If you want to add prefix for all external session id, you can use options.prefix, it will not work if options.genid present. + */ + prefix?: string; + /** * Hook: valid session value before use it */ - valid?(ctx: Koa.Context, session: sessionProps): void; + valid?(ctx: Koa.Context, session: Partial): void; /** * Hook: before save session */ - beforeSave?(ctx: Koa.Context, session: sessionProps): void; - } - interface sessionProps { - /** - * Returns true if the session is new - */ - isNew: boolean; - - /** - * Set cookie's maxAge - */ - maxAge: number; - - /** - * Save this session no matter whether it is populated - */ - save(): void; - [propName: string]: any; + beforeSave?(ctx: Koa.Context, session: Session): void; } interface stores { /** * get session object by key */ - get(key: any): any; + get(key: string, maxAge: opts["maxAge"], data: { rolling: opts["rolling"] }): any; /** * set session object for key, with a maxAge (in ms) */ - set(key: any, sess: any, maxAge?: number): any; + set(key: string, sess: Partial & { _expire?: number, _maxAge?: number }, maxAge: opts["maxAge"], data: { changed: boolean; rolling: opts["rolling"] }): any; /** * destroy session for key */ - destroy(key: any): void; + destroy(key: string): any; } } -declare function session(CONFIG: session.sessionConfig, app: Koa): Koa.Middleware; +declare function session(CONFIG: Partial, app: Koa): Koa.Middleware; declare function session(app: Koa): Koa.Middleware; -declare module 'koa' { +declare module "koa" { interface Context { - session: session.sessionProps | null; + session: session.Session | undefined; + readonly sessionOptions: session.opts | undefined; + } + + interface Application { + on(name: "session:missed" | "session:expired" | "session:invalid", data: { key?: string, value?: Partial, ctx: Context }): void; + once(name: "session:missed" | "session:expired" | "session:invalid", data: { key?: string, value?: Partial, ctx: Context }): void; } } diff --git a/types/koa-session/koa-session-tests.ts b/types/koa-session/koa-session-tests.ts index ef3ddc6a09..2844767240 100644 --- a/types/koa-session/koa-session-tests.ts +++ b/types/koa-session/koa-session-tests.ts @@ -1,8 +1,42 @@ -import * as Koa from 'koa'; -import * as session from 'koa-session'; +import Koa = require('koa'); +import session = require('koa-session'); +import * as ContextSession from "koa-session/lib/context"; + +import { + encode, + decode, + hash, +} from "koa-session/lib/util"; + +encode({ a: "b" }); + +decode("123"); + +hash("abc"); const app = new Koa(); -app.use(session(app)); +app.use(session({ + valid: (ctx, sess) => { + const { session: s } = ctx; + if (s) { + s.sess = "validated"; + s.save(); + return true; + } + return false; + }, + store: { + get: async (key) => { + return "abc"; + }, + set: (key, val) => { + console.log(key, val); + }, + destroy: (key) => { + console.log(key); + }, + }, +}, app)); app.listen(3000); diff --git a/types/koa-session/lib/context.d.ts b/types/koa-session/lib/context.d.ts new file mode 100644 index 0000000000..16d4388be1 --- /dev/null +++ b/types/koa-session/lib/context.d.ts @@ -0,0 +1,7 @@ +import { + ContextSession, +} from ".."; + +declare const c: ContextSession; + +export = c; diff --git a/types/koa-session/lib/session.d.ts b/types/koa-session/lib/session.d.ts new file mode 100644 index 0000000000..60e557bce8 --- /dev/null +++ b/types/koa-session/lib/session.d.ts @@ -0,0 +1,7 @@ +import { + Session, +} from ".."; + +declare const s: Session; + +export = s; diff --git a/types/koa-session/lib/util.d.ts b/types/koa-session/lib/util.d.ts new file mode 100644 index 0000000000..4d9a77752f --- /dev/null +++ b/types/koa-session/lib/util.d.ts @@ -0,0 +1,7 @@ +import { + util, +} from ".."; + +declare const u: util; + +export = u; diff --git a/types/koa-session/tsconfig.json b/types/koa-session/tsconfig.json index eea5fc5068..21efde4293 100644 --- a/types/koa-session/tsconfig.json +++ b/types/koa-session/tsconfig.json @@ -14,10 +14,14 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", + "lib/context.d.ts", + "lib/session.d.ts", + "lib/util.d.ts", "koa-session-tests.ts" ] } \ No newline at end of file diff --git a/types/koa-sslify/tsconfig.json b/types/koa-sslify/tsconfig.json index 64615e2ab9..c41803dcde 100644 --- a/types/koa-sslify/tsconfig.json +++ b/types/koa-sslify/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "koa-sslify-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/koa-static/koa-static-tests.ts b/types/koa-static/koa-static-tests.ts index 9b0d756f7d..c81b81483c 100644 --- a/types/koa-static/koa-static-tests.ts +++ b/types/koa-static/koa-static-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from "koa"; +import Koa = require("koa"); import serve = require("koa-static"); const app = new Koa(); diff --git a/types/koa-static/tsconfig.json b/types/koa-static/tsconfig.json index ce89a3c21f..339209d9de 100644 --- a/types/koa-static/tsconfig.json +++ b/types/koa-static/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-views/koa-views-tests.ts b/types/koa-views/koa-views-tests.ts index 65d6be7e1f..3453b156de 100644 --- a/types/koa-views/koa-views-tests.ts +++ b/types/koa-views/koa-views-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from "koa"; -import * as views from "koa-views"; +import Koa = require("koa"); +import views = require("koa-views"); const app = new Koa(); diff --git a/types/koa-views/tsconfig.json b/types/koa-views/tsconfig.json index 95d7a74d53..31b4ec33f0 100644 --- a/types/koa-views/tsconfig.json +++ b/types/koa-views/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-webpack/tsconfig.json b/types/koa-webpack/tsconfig.json index d3cef374db..7ff0f551fe 100644 --- a/types/koa-webpack/tsconfig.json +++ b/types/koa-webpack/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "koa-webpack-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/koa-websocket/index.d.ts b/types/koa-websocket/index.d.ts index 326f098ae5..e7a6c39a7d 100644 --- a/types/koa-websocket/index.d.ts +++ b/types/koa-websocket/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -import * as Koa from 'koa'; +import Koa = require('koa'); import * as ws from 'ws'; import * as http from 'http'; import * as https from 'https'; @@ -30,7 +30,5 @@ interface KoaWebsocketApp extends Koa { ws: KoaWebsocketServer; } -type KoaWebsockets = (app: Koa) => KoaWebsocketApp; - -declare const websockets: KoaWebsockets; +declare function websockets(app: Koa): KoaWebsocketApp; export = websockets; diff --git a/types/koa-websocket/koa-websocket-tests.ts b/types/koa-websocket/koa-websocket-tests.ts index 66bd4bf4d2..bd99c3d17e 100644 --- a/types/koa-websocket/koa-websocket-tests.ts +++ b/types/koa-websocket/koa-websocket-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from 'koa'; -import * as websocket from 'koa-websocket'; +import Koa = require('koa'); +import websocket = require('koa-websocket'); const app = websocket(new Koa()); diff --git a/types/koa-websocket/tsconfig.json b/types/koa-websocket/tsconfig.json index 87c9225d08..4a0daa327f 100644 --- a/types/koa-websocket/tsconfig.json +++ b/types/koa-websocket/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa/index.d.ts b/types/koa/index.d.ts index 1203864c8c..2a5c49f110 100644 --- a/types/koa/index.d.ts +++ b/types/koa/index.d.ts @@ -21,7 +21,7 @@ import * as accepts from "accepts"; import * as Cookies from "cookies"; import { EventEmitter } from "events"; import { IncomingMessage, ServerResponse, Server } from "http"; -import * as httpAssert from "http-assert"; +import httpAssert = require("http-assert"); import * as Keygrip from "keygrip"; import * as compose from "koa-compose"; import { Socket, ListenOptions } from "net"; diff --git a/types/koa/koa-tests.ts b/types/koa/koa-tests.ts index 6dbc073bea..ea0a4a18b8 100644 --- a/types/koa/koa-tests.ts +++ b/types/koa/koa-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from "koa"; +import Koa = require("koa"); const app = new Koa(); diff --git a/types/koa/tsconfig.json b/types/koa/tsconfig.json index 5c4ba0f656..730ff1452f 100644 --- a/types/koa/tsconfig.json +++ b/types/koa/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/koa2-cors/koa2-cors-tests.ts b/types/koa2-cors/koa2-cors-tests.ts index 820722d635..228fa4242e 100644 --- a/types/koa2-cors/koa2-cors-tests.ts +++ b/types/koa2-cors/koa2-cors-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from 'koa'; -import * as cors from 'koa2-cors'; +import Koa = require('koa'); +import cors = require('koa2-cors'); const app = new Koa(); app.use(cors({ diff --git a/types/koa2-cors/tsconfig.json b/types/koa2-cors/tsconfig.json index 6c1a4b2374..9266fd9244 100644 --- a/types/koa2-cors/tsconfig.json +++ b/types/koa2-cors/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa__cors/tsconfig.json b/types/koa__cors/tsconfig.json index 220bebc26a..38bf5b7cc1 100644 --- a/types/koa__cors/tsconfig.json +++ b/types/koa__cors/tsconfig.json @@ -15,6 +15,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { "@koa/cors": [ "koa__cors" diff --git a/types/kolite/tsconfig.json b/types/kolite/tsconfig.json index 1dc7da3187..b353af59cf 100644 --- a/types/kolite/tsconfig.json +++ b/types/kolite/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/konami.js/tsconfig.json b/types/konami.js/tsconfig.json index b802a3109c..0d91607c95 100644 --- a/types/konami.js/tsconfig.json +++ b/types/konami.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kraken-js/tsconfig.json b/types/kraken-js/tsconfig.json index 2fce7a799d..15fd480c05 100644 --- a/types/kraken-js/tsconfig.json +++ b/types/kraken-js/tsconfig.json @@ -9,13 +9,16 @@ "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "kraken-js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/kramed/tsconfig.json b/types/kramed/tsconfig.json index b816669307..95206a5b55 100644 --- a/types/kramed/tsconfig.json +++ b/types/kramed/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kss/tsconfig.json b/types/kss/tsconfig.json index 987701f0bb..c5edb7df62 100644 --- a/types/kss/tsconfig.json +++ b/types/kss/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kue/tsconfig.json b/types/kue/tsconfig.json index dab7ca300b..1fb275fc79 100644 --- a/types/kue/tsconfig.json +++ b/types/kue/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kurento-utils/tsconfig.json b/types/kurento-utils/tsconfig.json index 8920df3604..023939e6a2 100644 --- a/types/kurento-utils/tsconfig.json +++ b/types/kurento-utils/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kuromoji/tsconfig.json b/types/kuromoji/tsconfig.json index f74ea439af..442773f5e9 100644 --- a/types/kuromoji/tsconfig.json +++ b/types/kuromoji/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lab/tsconfig.json b/types/lab/tsconfig.json index 8e0ad06d10..7ddd8d3048 100644 --- a/types/lab/tsconfig.json +++ b/types/lab/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ladda/tsconfig.json b/types/ladda/tsconfig.json index 2d878b6f9d..e14f07795b 100644 --- a/types/ladda/tsconfig.json +++ b/types/ladda/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lasso/tsconfig.json b/types/lasso/tsconfig.json index 210de56a0d..197a5bede9 100644 --- a/types/lasso/tsconfig.json +++ b/types/lasso/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "lasso-tests.ts", @@ -29,4 +30,4 @@ "lib/writers/Writer.d.ts", "middleware/index.d.ts" ] -} +} \ No newline at end of file diff --git a/types/later/tsconfig.json b/types/later/tsconfig.json index 5b74d9d144..338433890b 100644 --- a/types/later/tsconfig.json +++ b/types/later/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/latinize/tsconfig.json b/types/latinize/tsconfig.json index 90b98478aa..2e3c34b548 100644 --- a/types/latinize/tsconfig.json +++ b/types/latinize/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/latlon-geohash/tsconfig.json b/types/latlon-geohash/tsconfig.json index 10d9c00791..d34a297b36 100644 --- a/types/latlon-geohash/tsconfig.json +++ b/types/latlon-geohash/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "latlon-geohash-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/launchpad/tsconfig.json b/types/launchpad/tsconfig.json index 01333e0ca2..348675bca2 100644 --- a/types/launchpad/tsconfig.json +++ b/types/launchpad/tsconfig.json @@ -11,6 +11,7 @@ "strictFunctionTypes": true, "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "types": [], "baseUrl": "../", "typeRoots": [ diff --git a/types/lazy.js/tsconfig.json b/types/lazy.js/tsconfig.json index 0f2d64001d..4faba72fe2 100644 --- a/types/lazy.js/tsconfig.json +++ b/types/lazy.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lazypipe/tsconfig.json b/types/lazypipe/tsconfig.json index 7eb8c93b6a..f9a761bb01 100644 --- a/types/lazypipe/tsconfig.json +++ b/types/lazypipe/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ldapjs/tsconfig.json b/types/ldapjs/tsconfig.json index a0df7615fd..860c7deb89 100644 --- a/types/ldapjs/tsconfig.json +++ b/types/ldapjs/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ldapjs-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/leadfoot/tsconfig.json b/types/leadfoot/tsconfig.json index 5672c5bf4d..7390c30f18 100644 --- a/types/leadfoot/tsconfig.json +++ b/types/leadfoot/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/leaflet-areaselect/tsconfig.json b/types/leaflet-areaselect/tsconfig.json index 98aceb4b21..54aa992c34 100644 --- a/types/leaflet-areaselect/tsconfig.json +++ b/types/leaflet-areaselect/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-curve/tsconfig.json b/types/leaflet-curve/tsconfig.json index 6ca509b566..17abbb6dd6 100644 --- a/types/leaflet-curve/tsconfig.json +++ b/types/leaflet-curve/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-draw/index.d.ts b/types/leaflet-draw/index.d.ts index 35d014b699..7fd33f2152 100644 --- a/types/leaflet-draw/index.d.ts +++ b/types/leaflet-draw/index.d.ts @@ -387,7 +387,7 @@ declare module 'leaflet' { /** * Layer that was just created. */ - layer: Layer; + layer: Circle | CircleMarker | Marker | Polygon | Polyline | Rectangle; /** * The type of layer this is. One of: polyline, polygon, rectangle, circle, marker. diff --git a/types/leaflet-draw/leaflet-draw-tests.ts b/types/leaflet-draw/leaflet-draw-tests.ts index e63006edce..54015fa404 100644 --- a/types/leaflet-draw/leaflet-draw-tests.ts +++ b/types/leaflet-draw/leaflet-draw-tests.ts @@ -41,6 +41,7 @@ map.addControl(drawControl); map.on(L.Draw.Event.CREATED, (e: L.DrawEvents.Created) => { const type = e.layerType; const layer = e.layer; + const geojson = e.layer.toGeoJSON(); drawnItems.addLayer(layer); }); diff --git a/types/leaflet-draw/tsconfig.json b/types/leaflet-draw/tsconfig.json index 5db4feb624..d27f42eebf 100644 --- a/types/leaflet-draw/tsconfig.json +++ b/types/leaflet-draw/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-editable/tsconfig.json b/types/leaflet-editable/tsconfig.json index d03e43670e..9565df6304 100644 --- a/types/leaflet-editable/tsconfig.json +++ b/types/leaflet-editable/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-fullscreen/tsconfig.json b/types/leaflet-fullscreen/tsconfig.json index 102331a4af..4273a23910 100644 --- a/types/leaflet-fullscreen/tsconfig.json +++ b/types/leaflet-fullscreen/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-geocoder-mapzen/tsconfig.json b/types/leaflet-geocoder-mapzen/tsconfig.json index 9bf4ee0bfb..197f88ad4f 100644 --- a/types/leaflet-geocoder-mapzen/tsconfig.json +++ b/types/leaflet-geocoder-mapzen/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-gpx/tsconfig.json b/types/leaflet-gpx/tsconfig.json index 08f5612820..475ac13cda 100644 --- a/types/leaflet-gpx/tsconfig.json +++ b/types/leaflet-gpx/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-imageoverlay-rotated/tsconfig.json b/types/leaflet-imageoverlay-rotated/tsconfig.json index 440971024d..4796b0511a 100644 --- a/types/leaflet-imageoverlay-rotated/tsconfig.json +++ b/types/leaflet-imageoverlay-rotated/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-label/tsconfig.json b/types/leaflet-label/tsconfig.json index bf2cfa0f43..ba2680e88c 100644 --- a/types/leaflet-label/tsconfig.json +++ b/types/leaflet-label/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-mouse-position/tsconfig.json b/types/leaflet-mouse-position/tsconfig.json index a853ad3c56..8322b38776 100644 --- a/types/leaflet-mouse-position/tsconfig.json +++ b/types/leaflet-mouse-position/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "leaflet-mouse-position-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/leaflet-polylinedecorator/tsconfig.json b/types/leaflet-polylinedecorator/tsconfig.json index f84b2a3913..7f81263acb 100644 --- a/types/leaflet-polylinedecorator/tsconfig.json +++ b/types/leaflet-polylinedecorator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-providers/tsconfig.json b/types/leaflet-providers/tsconfig.json index bb2349b7d5..b36bd5c2c4 100644 --- a/types/leaflet-providers/tsconfig.json +++ b/types/leaflet-providers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-rotatedmarker/tsconfig.json b/types/leaflet-rotatedmarker/tsconfig.json index 18bf544889..195a3ec8ad 100644 --- a/types/leaflet-rotatedmarker/tsconfig.json +++ b/types/leaflet-rotatedmarker/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "leaflet-rotatedmarker-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/leaflet.awesome-markers/tsconfig.json b/types/leaflet.awesome-markers/tsconfig.json index 079cf577d2..6d25407162 100644 --- a/types/leaflet.awesome-markers/tsconfig.json +++ b/types/leaflet.awesome-markers/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet.awesome-markers/v0/tsconfig.json b/types/leaflet.awesome-markers/v0/tsconfig.json index 549076e43b..db5190d1ca 100644 --- a/types/leaflet.awesome-markers/v0/tsconfig.json +++ b/types/leaflet.awesome-markers/v0/tsconfig.json @@ -23,7 +23,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet.fullscreen/tsconfig.json b/types/leaflet.fullscreen/tsconfig.json index bb2cf83e37..29a6ea1ec7 100644 --- a/types/leaflet.fullscreen/tsconfig.json +++ b/types/leaflet.fullscreen/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet.gridlayer.googlemutant/tsconfig.json b/types/leaflet.gridlayer.googlemutant/tsconfig.json index d739a04322..73164f18ca 100644 --- a/types/leaflet.gridlayer.googlemutant/tsconfig.json +++ b/types/leaflet.gridlayer.googlemutant/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet.heat/tsconfig.json b/types/leaflet.heat/tsconfig.json index 482c984b8c..cc206c4e7f 100644 --- a/types/leaflet.heat/tsconfig.json +++ b/types/leaflet.heat/tsconfig.json @@ -1,24 +1,25 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "leaflet.heat-tests.ts" - ] -} + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "leaflet.heat-tests.ts" + ] +} \ No newline at end of file diff --git a/types/leaflet.locatecontrol/index.d.ts b/types/leaflet.locatecontrol/index.d.ts index 35c88be5be..542461cec7 100644 --- a/types/leaflet.locatecontrol/index.d.ts +++ b/types/leaflet.locatecontrol/index.d.ts @@ -8,6 +8,12 @@ import * as L from 'leaflet'; declare module 'leaflet' { namespace Control { + class Locate extends Control { + onAdd(map: Map): HTMLElement; + start(): void; + stop(): void; + setView(): void; + } interface LocateOptions { position?: string; layer?: Layer; @@ -40,6 +46,6 @@ declare module 'leaflet' { /** * Creates a Leaflet.Locate control */ - function locate(options?: Control.LocateOptions): Control; + function locate(options?: Control.LocateOptions): Control.Locate; } } diff --git a/types/leaflet.locatecontrol/tsconfig.json b/types/leaflet.locatecontrol/tsconfig.json index 22ab0179b2..6da0fdda3b 100644 --- a/types/leaflet.locatecontrol/tsconfig.json +++ b/types/leaflet.locatecontrol/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet.markercluster.layersupport/tsconfig.json b/types/leaflet.markercluster.layersupport/tsconfig.json index 13ba48e6f4..47502f355b 100644 --- a/types/leaflet.markercluster.layersupport/tsconfig.json +++ b/types/leaflet.markercluster.layersupport/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet.markercluster/tsconfig.json b/types/leaflet.markercluster/tsconfig.json index b1f7f8c1af..67efe9169e 100644 --- a/types/leaflet.markercluster/tsconfig.json +++ b/types/leaflet.markercluster/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet.pancontrol/tsconfig.json b/types/leaflet.pancontrol/tsconfig.json index ec286c0305..8341a27f73 100644 --- a/types/leaflet.pancontrol/tsconfig.json +++ b/types/leaflet.pancontrol/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "leaflet.pancontrol-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/leaflet.pm/tsconfig.json b/types/leaflet.pm/tsconfig.json index b2313b93ee..ffe46ff393 100644 --- a/types/leaflet.pm/tsconfig.json +++ b/types/leaflet.pm/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet.polylinemeasure/tsconfig.json b/types/leaflet.polylinemeasure/tsconfig.json index b1db5e086d..2a4070495c 100644 --- a/types/leaflet.polylinemeasure/tsconfig.json +++ b/types/leaflet.polylinemeasure/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "leaflet.polylinemeasure-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/leaflet/tsconfig.json b/types/leaflet/tsconfig.json index 55862abef1..ab1f202443 100644 --- a/types/leaflet/tsconfig.json +++ b/types/leaflet/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet/v0/tsconfig.json b/types/leaflet/v0/tsconfig.json index c8003b67d8..a2d29bb367 100644 --- a/types/leaflet/v0/tsconfig.json +++ b/types/leaflet/v0/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leapmotionts/tsconfig.json b/types/leapmotionts/tsconfig.json index 7ac842a053..b5fc5f85b4 100644 --- a/types/leapmotionts/tsconfig.json +++ b/types/leapmotionts/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/legal-eagle/tsconfig.json b/types/legal-eagle/tsconfig.json index 380eaaed72..d41814f483 100644 --- a/types/legal-eagle/tsconfig.json +++ b/types/legal-eagle/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "legal-eagle-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/less-middleware/tsconfig.json b/types/less-middleware/tsconfig.json index 8a807955b0..fe169cfb2f 100644 --- a/types/less-middleware/tsconfig.json +++ b/types/less-middleware/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/less/tsconfig.json b/types/less/tsconfig.json index 635134c330..002ef68ece 100644 --- a/types/less/tsconfig.json +++ b/types/less/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/less2sass/tsconfig.json b/types/less2sass/tsconfig.json index e70848dca8..fef36e8edd 100644 --- a/types/less2sass/tsconfig.json +++ b/types/less2sass/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "less2sass-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/lestate/tsconfig.json b/types/lestate/tsconfig.json index 152bf946a6..8b6cfd98c1 100644 --- a/types/lestate/tsconfig.json +++ b/types/lestate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/level-sublevel/tsconfig.json b/types/level-sublevel/tsconfig.json index 4dad69a329..b9253b7772 100644 --- a/types/level-sublevel/tsconfig.json +++ b/types/level-sublevel/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leveldown/leveldown-tests.ts b/types/leveldown/leveldown-tests.ts index 94d852d204..0aa9b3625e 100644 --- a/types/leveldown/leveldown-tests.ts +++ b/types/leveldown/leveldown-tests.ts @@ -1,4 +1,4 @@ -import * as leveldown from "leveldown"; +import leveldown = require("leveldown"); const db = leveldown("db1"); diff --git a/types/leveldown/tsconfig.json b/types/leveldown/tsconfig.json index 68b5638f5b..5c30c34f2f 100644 --- a/types/leveldown/tsconfig.json +++ b/types/leveldown/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/levelup/levelup-tests.ts b/types/levelup/levelup-tests.ts index 8827512437..2d3867cdd3 100644 --- a/types/levelup/levelup-tests.ts +++ b/types/levelup/levelup-tests.ts @@ -1,4 +1,4 @@ -import * as levelup from "levelup"; +import levelup = require("levelup"); interface BufferEncoding { encode(val: any): Buffer; @@ -68,7 +68,7 @@ db.batch() .write(function () { console.log('Done!') }) var open:boolean = db.isOpen(); -var closed:boolean = db.isClosed(); +var closed:boolean = db.isClosed(); db.createReadStream() .on('data', function (data: any) { console.log(data.key, '=', data.value) diff --git a/types/levelup/tsconfig.json b/types/levelup/tsconfig.json index 8825ba9b79..ac406bd9b2 100644 --- a/types/levelup/tsconfig.json +++ b/types/levelup/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leven/tsconfig.json b/types/leven/tsconfig.json index 14d505d892..bcdc4add35 100644 --- a/types/leven/tsconfig.json +++ b/types/leven/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/levenshtein/tsconfig.json b/types/levenshtein/tsconfig.json index da44f54a3e..a02655c66d 100644 --- a/types/levenshtein/tsconfig.json +++ b/types/levenshtein/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/libpq/libpq-tests.ts b/types/libpq/libpq-tests.ts index fee968dabc..f1ae6cc1e3 100644 --- a/types/libpq/libpq-tests.ts +++ b/types/libpq/libpq-tests.ts @@ -1,9 +1,9 @@ /// import { Buffer } from 'buffer'; -import * as assert from 'assert'; +import assert = require('assert'); import * as async from 'async'; -import * as PQ from 'libpq'; +import PQ = require('libpq'); declare const _: { times(n: number, f: () => T): T[] }; diff --git a/types/libpq/tsconfig.json b/types/libpq/tsconfig.json index c2179c6020..859660d83b 100644 --- a/types/libpq/tsconfig.json +++ b/types/libpq/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/libxmljs/tsconfig.json b/types/libxmljs/tsconfig.json index 7201fffe81..e44e2461e1 100644 --- a/types/libxmljs/tsconfig.json +++ b/types/libxmljs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/libxslt/tsconfig.json b/types/libxslt/tsconfig.json index a7f7f94ffc..85f9f9b81d 100644 --- a/types/libxslt/tsconfig.json +++ b/types/libxslt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/license-checker/tsconfig.json b/types/license-checker/tsconfig.json index 3cfded1e87..f5b303f669 100644 --- a/types/license-checker/tsconfig.json +++ b/types/license-checker/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lil-uuid/tsconfig.json b/types/lil-uuid/tsconfig.json index 889bd07cca..a1a661c82a 100644 --- a/types/lil-uuid/tsconfig.json +++ b/types/lil-uuid/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "lil-uuid-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/lime-js/tsconfig.json b/types/lime-js/tsconfig.json index fb352deb87..4345d000d2 100644 --- a/types/lime-js/tsconfig.json +++ b/types/lime-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/line-by-line/line-by-line-tests.ts b/types/line-by-line/line-by-line-tests.ts index 9181e91a98..c97d02ca58 100644 --- a/types/line-by-line/line-by-line-tests.ts +++ b/types/line-by-line/line-by-line-tests.ts @@ -1,4 +1,4 @@ -import * as LineByLineReader from "line-by-line"; +import LineByLineReader = require("line-by-line"); const reader: LineByLineReader = new LineByLineReader("index.d.ts"); reader.on("line", (line: any) => { diff --git a/types/line-by-line/tsconfig.json b/types/line-by-line/tsconfig.json index c92dc43aac..43e95d3ed0 100644 --- a/types/line-by-line/tsconfig.json +++ b/types/line-by-line/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/line-reader/tsconfig.json b/types/line-reader/tsconfig.json index 0bf05161de..824b195e26 100644 --- a/types/line-reader/tsconfig.json +++ b/types/line-reader/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/linkify-it/tsconfig.json b/types/linkify-it/tsconfig.json index 53501188a6..bfc6f13f86 100644 --- a/types/linkify-it/tsconfig.json +++ b/types/linkify-it/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/linq4js/index.d.ts b/types/linq4js/index.d.ts deleted file mode 100644 index 8721040314..0000000000 --- a/types/linq4js/index.d.ts +++ /dev/null @@ -1,308 +0,0 @@ -// Type definitions for Linq4JS 2.1 -// Project: https://github.com/morrisjdev/Linq4JS -// Definitions by: Morris Janatzek -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface Array { - Order: Linq4JS.OrderEntry[]; - GroupValue: any; - /** - * Executes actions defined in the command-string - * @param command The command-string for execution - */ - Evaluate(command: string): any; - /** - * Creates a copy of the array - */ - Clone(): T[]; - /** - * Gets the index of the first item found by a filter - * @param filter A function (or function-string) that returns a boolean when matching element was found - */ - FindIndex(filter: ((item: T) => boolean) | string): number; - /** - * Gets the index of the last item found by a filter - * @param filter A function (or function-string) that returns a boolean when matching element was found - */ - FindLastIndex(filter: ((item: T) => boolean) | string): number; - /** - * Gets the item with the index - * @param index Item index - */ - Get(index: number): T; - /** - * Executes a method for each item in the array - * @param action A function (or function-string) that gets executed for each element. If it returns false the loop stops. - */ - ForEach(action: ((item: T, index?: number) => boolean | any) | string): T[]; - /** - * Updates an object in the array - * @param object The object to update - * @param primaryKeySelector A selector-function (or function-string) to define a property to indentify object in array - */ - Update(object: T, primaryKeySelector?: ((item: T) => any) | string): T[]; - /** - * Updates objects in the array - * @param objects The array of objects to update - * @param primaryKeySelector A selector-function (or function-string) to define a property to indentify object in array - */ - UpdateRange(objects: T[], primaryKeySelector?: ((item: T) => any) | string): T[]; - /** - * Removes an object from the array - * @param object The object to remove - * @param primaryKeySelector A selector-function (or function-string) to define a property to indentify object in array - */ - Remove(object: T, primaryKeySelector?: ((item: T) => any) | string): T[]; - /** - * Removes objects from the array - * @param objects The array of objects to remove - * @param primaryKeySelector A selector-function (or function-string) to define a property to indentify object in array - */ - RemoveRange(objects: T[], primaryKeySelector?: ((item: T) => any) | string): T[]; - /** - * Adds an object to the array - * @param object The object to add - * @param generateId Auto-generate a property to identify object in later processes - */ - Add(object: T, generateId?: boolean): T[]; - /** - * Adds objects to the array - * @param objects The array of objects to add - */ - AddRange(objects: T[], generateId?: boolean): T[]; - /** - * Inserts an entry at a specific position - * @param object The object to insert - * @param index The position to insert - */ - Insert(object: T, index: number): T[]; - /** - * Searches for all items in array that match the given filter - * @param filter A function (or function-string) that returns a boolean when matching element was found - */ - Where(filter: ((item: T, index?: number) => boolean) | string): T[]; - /** - * Takes items in a specific range - * @param start The start position - * @param length The number of elements to take - */ - Range(start: number, length: number): T[]; - /** - * Repeats an object in the array - * @param object The object to repeat - * @param count The count of repeats - */ - Repeat(object: T, count: number): T[]; - /** - * Returns the length of the array - * @param filter If set the function returns count of elements matched by the condition - */ - Count(filter?: ((item: T) => boolean) | string): number; - /** - * Tests if all items in the array match the condition - * @param filter A function (or function-string) that returns a boolean when matching element was found - */ - All(filter: ((item: T) => boolean) | string): boolean; - /** - * Tests if any item is in the array - * @param filter If set the function tests if any item in the array matches the condition - */ - Any(filter?: ((item: T) => boolean) | string): boolean; - /** - * Returns the first item of the array - Throws an exception if no item was found - * @param filter If set the function returns the first item that matches the filter - */ - First(filter?: ((item: T) => boolean) | string): T; - /** - * Returns the first item of the array - returns `null` if no suitable item was found - * @param filter If set the function returns the first item that matches the filter - */ - FirstOrDefault(filter?: ((item: T) => boolean) | string): (T | null); - /** - * Returns the last item of the array - Throws an exception if no item was found - * @param filter If set the function returns the last item that matches the filter - */ - Last(filter?: ((item: T) => boolean) | string): T; - /** - * Returns the last item of the array - returns `null` if no suitable item was found - * @param filter If set the function returns the last item that matches the filter - */ - LastOrDefault(filter?: ((item: T) => boolean) | string): (T | null); - /** - * Select the properties for a new array - * @param selector A function (or a function-string) that returns a new object - */ - Select(selector: ((item: T) => any) | string): any[]; - /** - * Limits the number of entries taken - * @param count The count of elements taken - */ - Take(count: number): T[]; - /** - * Takes entries as long as a condition is true - * @param condition The condition-function (or function-string) that returns a boolean. All elements until a false gets thrown are taken - * @param initial A initial-function (or function-string) that gets executed once at the start of the loop - * @param after A function that gets executed after every element-iteration after the condition-function was evaluated - */ - TakeWhile(condition: ((item: T, storage?: any) => boolean) | string, initial?: ((storage: any) => void) | string, after?: ((item: T, storage: any) => void) | string): T[]; - /** - * Skips entries - * @param count The count of elements skipped - */ - Skip(count: number): T[]; - /** - * Orders array by property or value in ascending direction - * @param valueSelector The selector-function (or function-string) that selects the property for sorting - */ - OrderBy(valueSelector: ((item: T) => any) | string): T[]; - /** - * Orders array by additional properties in ascending direction in combination with OrderBy/OrderByDescending - * @param valueSelector The selector-function (or function-string) that selects the property for sorting - */ - ThenBy(valueSelector: ((item: T) => any) | string): T[]; - /** - * Orders array by property or value in descending direction - * @param valueSelector The selector-function (or function-string) that selects the property for sorting - */ - OrderByDescending(valueSelector: ((item: T) => any) | string): T[]; - /** - * Orders array by additional properties in descending direction in combination with OrderBy/OrderByDescending - * @param valueSelector The selector-function (or function-string) that selects the property for sorting - */ - ThenByDescending(valueSelector: ((item: T) => any) | string): T[]; - /** - * Returns the smallest element in array - * @param valueSelector The selector-function (or function-string) that selects the property for comparison - */ - Min(valueSelector?: ((item: T) => any) | string): (T | null); - /** - * Returns the greates element in array - * @param valueSelector The selector-function (or function-string) that selects the property for comparison - */ - Max(valueSelector?: ((item: T) => any) | string): (T | null); - /** - * Groups array by property - * @param selector The selector-function (or function-string) that selects the property for grouping - */ - GroupBy(selector: ((item: T) => any) | string): T[][]; - /** - * Moves an item from one index to another - * @param oldIndex The current position of the item - * @param newIndex The new position of the item - */ - Move(oldIndex: number, newIndex: number): T[]; - /** - * Makes all values unique - * @param valueSelector A selector-function (or function-string) to select property for comparison and distinction - */ - Distinct(valueSelector?: ((item: T) => any) | string): T[]; - /** - * Tests if array contains specific object - * @param object The object to test for - */ - Contains(object: T): boolean; - /** - * Combines two arrays - * @param array The array to combine - */ - Concat(array: T[]): T[]; - /** - * Combines two arrays but only applies values that are in both arrays - * @param array The array to combine - */ - Intersect(array: T[]): T[]; - /** - * Joins the entries by a given char - * @param character The character for joining - * @param selector A selector-function (or function-string) to select property for joining - */ - Join(character: string, selector?: ((item: T) => any) | string): string; - /** - * Combines the entries using a custom function - * @param method A function (or function-string) for aggregation - * @param startVal The value to start aggregation - */ - Aggregate(method: ((result: any, item: T) => any) | string, startVal?: any): string; - /** - * Reverses the array - */ - Reverse(): T[]; - /** - * Computes the average of the elements - * @param selector A selector-function (or function-string) to select property for average computing - * @param filter If set the function computes the average of elements that match the filter - */ - Average(selector?: ((item: T) => any) | string, filter?: ((item: T) => boolean) | string): number; - /** - * Computes the sum of the elements - * @param selector A selector-function (or function-string) to select property for adding - * @param filter If set the function computes the sum of elements that match the filter - */ - Sum(selector?: ((item: T) => any) | string, filter?: ((item: T) => boolean) | string): number; - /** - * Compares to sequences of objects - * @param array The array to compare - */ - SequenceEqual(array: T[]): boolean; - /** - * Combines the entries of two arrays using a custom function - * @param array The array to combine - * @param result The function (or function-string) to combine elements - */ - Zip(array: X[], result: ((first: T, second: X) => any) | string): any[]; - /** - * Combines two arrays without duplicates - * @param array The array to combine - */ - Union(array: T[]): T[]; - /** - * Converts the array to a dictionary - * @param keySelector The selector-function (or function-string) to select property for key - * @param valueSelector A selector-function (or function-string) to select property for value - */ - ToDictionary(keySelector: ((item: T) => any) | string, valueSelector?: ((item: T) => any) | string): any; -} - -declare namespace Linq4JS { - class GeneratedEntity { - _GeneratedId_: number; - Id: number; - } - - class EvaluateCommand { - Command: string; - SplitRegex: RegExp[]; - Finder: RegExp[]; - constructor(command: string, ...identifier: string[]); - } - class EvaluateCommandResult { - Command: string; - DynamicFunction: string; - constructor(cmd: string, fn: string); - } - - class Helper { - private static ConvertStringFunction(functionString, noAutoReturn?, noBracketReplace?); - static ConvertFunction(testFunction: string | T, noAutoReturn?: boolean, noBracketReplace?: boolean): T; - static OrderCompareFunction(valueSelector: (item: T) => any, a: T, b: T, invert: boolean): number; - static SplitCommand(command: string): string[]; - static MatchCommand(cmd: string): EvaluateCommandResult; - static Commands: EvaluateCommand[]; - } - - class OrderEntry { - Direction: OrderDirection; - ValueSelector: (item: any) => any; - constructor(_direction: OrderDirection, _valueSelector: (item: any) => any); - } - enum OrderDirection { - Ascending = 0, - Descending = 1, - } - - class SelectEntry { - property: string; - name: string; - constructor(n: string, p: string); - } -} diff --git a/types/linq4js/linq4js-tests.ts b/types/linq4js/linq4js-tests.ts deleted file mode 100644 index 42e43ab324..0000000000 --- a/types/linq4js/linq4js-tests.ts +++ /dev/null @@ -1,13 +0,0 @@ -import "linq4js"; - -const array: string[] = ["test", "test2", "test3", "test4", "test5"]; - -array - .Add("test6") - .Remove("test3") - .Insert("test3", 2) - .Distinct() - .OrderBy(x => x) - .OrderByDescending(x => x) - .Select(x => x.length) - .Average(); diff --git a/types/lls/tsconfig.json b/types/lls/tsconfig.json index 41aa184116..91a2928fd8 100644 --- a/types/lls/tsconfig.json +++ b/types/lls/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/load-json-file/tsconfig.json b/types/load-json-file/tsconfig.json index 9cbafc8746..0c3ea42200 100644 --- a/types/load-json-file/tsconfig.json +++ b/types/load-json-file/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/loader-runner/tsconfig.json b/types/loader-runner/tsconfig.json index 9a8894c61b..72472c0eb3 100644 --- a/types/loader-runner/tsconfig.json +++ b/types/loader-runner/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/loader-utils/tsconfig.json b/types/loader-utils/tsconfig.json index 91aa5704c4..aed67fbc1b 100644 --- a/types/loader-utils/tsconfig.json +++ b/types/loader-utils/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/loadware/tsconfig.json b/types/loadware/tsconfig.json index 5921615bf8..07bc5a8c23 100644 --- a/types/loadware/tsconfig.json +++ b/types/loadware/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lobibox/tsconfig.json b/types/lobibox/tsconfig.json index ef1a1c2f64..ee14a0056b 100644 --- a/types/lobibox/tsconfig.json +++ b/types/lobibox/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/local-dynamo/tsconfig.json b/types/local-dynamo/tsconfig.json index fe3803ac8c..d99efd9ac3 100644 --- a/types/local-dynamo/tsconfig.json +++ b/types/local-dynamo/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "local-dynamo-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/localforage-cordovasqlitedriver/index.d.ts b/types/localforage-cordovasqlitedriver/index.d.ts deleted file mode 100644 index 7c415d3f42..0000000000 --- a/types/localforage-cordovasqlitedriver/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Type definitions for localforage-cordovasqlitedriver module 1.0 -// Project: https://github.com/thgreasi/localForage-cordovaSQLiteDriver -// Definitions by: Thodoris Greasidis -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare var cordovaSQLiteDriver: LocalForageDriver; -export = cordovaSQLiteDriver; diff --git a/types/localforage-cordovasqlitedriver/localforage-cordovasqlitedriver-tests.ts b/types/localforage-cordovasqlitedriver/localforage-cordovasqlitedriver-tests.ts deleted file mode 100644 index 22b550da0b..0000000000 --- a/types/localforage-cordovasqlitedriver/localforage-cordovasqlitedriver-tests.ts +++ /dev/null @@ -1,53 +0,0 @@ -declare const cordovaSQLiteDriver: LocalForageDriver; - -() => { - const driverName: string = cordovaSQLiteDriver._driver; - - const config = { - driver: driverName, - name: 'localforage' - }; - - cordovaSQLiteDriver._initStorage(config); - - cordovaSQLiteDriver.clear((err: any) => { - const newError: any = err; - }); - - cordovaSQLiteDriver.length((err: any, num: number) => { - const newError: any = err; - const newNumber: number = num; - }); - - cordovaSQLiteDriver.key(0, (err: any, value: string) => { - const newError: any = err; - const newValue: string = value; - }); - - cordovaSQLiteDriver.keys((err: any, keys: string[]) => { - const newError: any = err; - const newArray: string[] = keys; - }); - - cordovaSQLiteDriver.getItem("key", (err: any, str: string) => { - const newError: any = err; - const newStr: string = str; - }); - - cordovaSQLiteDriver.setItem("key", "value", (err: any, str: string) => { - const newError: any = err; - const newStr: string = str; - }); - - cordovaSQLiteDriver.setItem("key", "value", (str: string) => { - const newStr: string = str; - }); - - cordovaSQLiteDriver.removeItem("key", (err: any) => { - const newError: any = err; - }); - - cordovaSQLiteDriver.removeItem("key", (err: any) => { - const newError: any = err; - }); -}; diff --git a/types/localized-countries/tsconfig.json b/types/localized-countries/tsconfig.json index 61ec539732..bea6b3f1e4 100644 --- a/types/localized-countries/tsconfig.json +++ b/types/localized-countries/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/localizejs-library/tsconfig.json b/types/localizejs-library/tsconfig.json index a297d28148..b0d9382afe 100644 --- a/types/localizejs-library/tsconfig.json +++ b/types/localizejs-library/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/locate-path/tsconfig.json b/types/locate-path/tsconfig.json index 355b51b851..06d40b6727 100644 --- a/types/locate-path/tsconfig.json +++ b/types/locate-path/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lockfile/tsconfig.json b/types/lockfile/tsconfig.json index 83b6126099..86b31141a7 100644 --- a/types/lockfile/tsconfig.json +++ b/types/lockfile/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lockfile/v0/tsconfig.json b/types/lockfile/v0/tsconfig.json index a5f99334c4..2cfa991fab 100644 --- a/types/lockfile/v0/tsconfig.json +++ b/types/lockfile/v0/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lockr/tsconfig.json b/types/lockr/tsconfig.json index 391de2fb03..c693013904 100644 --- a/types/lockr/tsconfig.json +++ b/types/lockr/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/locutus/tsconfig.json b/types/locutus/tsconfig.json index 2a54cd1721..4a1db4fa50 100644 --- a/types/locutus/tsconfig.json +++ b/types/locutus/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lodash-es/tsconfig.json b/types/lodash-es/tsconfig.json index 7f69811c3c..192ee5b0af 100644 --- a/types/lodash-es/tsconfig.json +++ b/types/lodash-es/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -341,4 +342,4 @@ "zipObjectDeep.d.ts", "zipWith.d.ts" ] -} +} \ No newline at end of file diff --git a/types/lodash-webpack-plugin/lodash-webpack-plugin-tests.ts b/types/lodash-webpack-plugin/lodash-webpack-plugin-tests.ts index d6483e3d03..6d0163faf6 100644 --- a/types/lodash-webpack-plugin/lodash-webpack-plugin-tests.ts +++ b/types/lodash-webpack-plugin/lodash-webpack-plugin-tests.ts @@ -1,4 +1,4 @@ -import * as LodashModuleReplacementPlugin from 'lodash-webpack-plugin'; +import LodashModuleReplacementPlugin = require('lodash-webpack-plugin'); new LodashModuleReplacementPlugin(); diff --git a/types/lodash-webpack-plugin/tsconfig.json b/types/lodash-webpack-plugin/tsconfig.json index 5a4f35d31e..fd54c3b249 100644 --- a/types/lodash-webpack-plugin/tsconfig.json +++ b/types/lodash-webpack-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lodash.add/tsconfig.json b/types/lodash.add/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.add/tsconfig.json +++ b/types/lodash.add/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.after/tsconfig.json b/types/lodash.after/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.after/tsconfig.json +++ b/types/lodash.after/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.ary/tsconfig.json b/types/lodash.ary/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.ary/tsconfig.json +++ b/types/lodash.ary/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.assign/tsconfig.json b/types/lodash.assign/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.assign/tsconfig.json +++ b/types/lodash.assign/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.assignin/tsconfig.json b/types/lodash.assignin/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.assignin/tsconfig.json +++ b/types/lodash.assignin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.assigninwith/tsconfig.json b/types/lodash.assigninwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.assigninwith/tsconfig.json +++ b/types/lodash.assigninwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.assignwith/tsconfig.json b/types/lodash.assignwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.assignwith/tsconfig.json +++ b/types/lodash.assignwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.at/tsconfig.json b/types/lodash.at/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.at/tsconfig.json +++ b/types/lodash.at/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.attempt/tsconfig.json b/types/lodash.attempt/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.attempt/tsconfig.json +++ b/types/lodash.attempt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.before/tsconfig.json b/types/lodash.before/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.before/tsconfig.json +++ b/types/lodash.before/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.bind/tsconfig.json b/types/lodash.bind/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.bind/tsconfig.json +++ b/types/lodash.bind/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.bindall/tsconfig.json b/types/lodash.bindall/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.bindall/tsconfig.json +++ b/types/lodash.bindall/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.bindkey/tsconfig.json b/types/lodash.bindkey/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.bindkey/tsconfig.json +++ b/types/lodash.bindkey/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.camelcase/tsconfig.json b/types/lodash.camelcase/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.camelcase/tsconfig.json +++ b/types/lodash.camelcase/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.capitalize/tsconfig.json b/types/lodash.capitalize/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.capitalize/tsconfig.json +++ b/types/lodash.capitalize/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.castarray/tsconfig.json b/types/lodash.castarray/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.castarray/tsconfig.json +++ b/types/lodash.castarray/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.ceil/tsconfig.json b/types/lodash.ceil/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.ceil/tsconfig.json +++ b/types/lodash.ceil/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.chunk/tsconfig.json b/types/lodash.chunk/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.chunk/tsconfig.json +++ b/types/lodash.chunk/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.clamp/tsconfig.json b/types/lodash.clamp/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.clamp/tsconfig.json +++ b/types/lodash.clamp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.clone/tsconfig.json b/types/lodash.clone/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.clone/tsconfig.json +++ b/types/lodash.clone/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.clonedeep/tsconfig.json b/types/lodash.clonedeep/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.clonedeep/tsconfig.json +++ b/types/lodash.clonedeep/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.clonedeepwith/tsconfig.json b/types/lodash.clonedeepwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.clonedeepwith/tsconfig.json +++ b/types/lodash.clonedeepwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.clonewith/tsconfig.json b/types/lodash.clonewith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.clonewith/tsconfig.json +++ b/types/lodash.clonewith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.compact/tsconfig.json b/types/lodash.compact/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.compact/tsconfig.json +++ b/types/lodash.compact/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.concat/tsconfig.json b/types/lodash.concat/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.concat/tsconfig.json +++ b/types/lodash.concat/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.cond/tsconfig.json b/types/lodash.cond/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.cond/tsconfig.json +++ b/types/lodash.cond/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.constant/tsconfig.json b/types/lodash.constant/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.constant/tsconfig.json +++ b/types/lodash.constant/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.countby/tsconfig.json b/types/lodash.countby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.countby/tsconfig.json +++ b/types/lodash.countby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.create/tsconfig.json b/types/lodash.create/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.create/tsconfig.json +++ b/types/lodash.create/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.curry/tsconfig.json b/types/lodash.curry/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.curry/tsconfig.json +++ b/types/lodash.curry/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.curryright/tsconfig.json b/types/lodash.curryright/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.curryright/tsconfig.json +++ b/types/lodash.curryright/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.debounce/tsconfig.json b/types/lodash.debounce/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.debounce/tsconfig.json +++ b/types/lodash.debounce/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.deburr/tsconfig.json b/types/lodash.deburr/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.deburr/tsconfig.json +++ b/types/lodash.deburr/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.defaults/tsconfig.json b/types/lodash.defaults/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.defaults/tsconfig.json +++ b/types/lodash.defaults/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.defaultsdeep/tsconfig.json b/types/lodash.defaultsdeep/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.defaultsdeep/tsconfig.json +++ b/types/lodash.defaultsdeep/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.defer/tsconfig.json b/types/lodash.defer/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.defer/tsconfig.json +++ b/types/lodash.defer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.delay/tsconfig.json b/types/lodash.delay/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.delay/tsconfig.json +++ b/types/lodash.delay/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.difference/tsconfig.json b/types/lodash.difference/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.difference/tsconfig.json +++ b/types/lodash.difference/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.differenceby/tsconfig.json b/types/lodash.differenceby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.differenceby/tsconfig.json +++ b/types/lodash.differenceby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.differencewith/tsconfig.json b/types/lodash.differencewith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.differencewith/tsconfig.json +++ b/types/lodash.differencewith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.divide/tsconfig.json b/types/lodash.divide/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.divide/tsconfig.json +++ b/types/lodash.divide/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.drop/tsconfig.json b/types/lodash.drop/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.drop/tsconfig.json +++ b/types/lodash.drop/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.dropright/tsconfig.json b/types/lodash.dropright/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.dropright/tsconfig.json +++ b/types/lodash.dropright/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.droprightwhile/tsconfig.json b/types/lodash.droprightwhile/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.droprightwhile/tsconfig.json +++ b/types/lodash.droprightwhile/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.dropwhile/tsconfig.json b/types/lodash.dropwhile/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.dropwhile/tsconfig.json +++ b/types/lodash.dropwhile/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.endswith/tsconfig.json b/types/lodash.endswith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.endswith/tsconfig.json +++ b/types/lodash.endswith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.eq/tsconfig.json b/types/lodash.eq/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.eq/tsconfig.json +++ b/types/lodash.eq/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.escape/tsconfig.json b/types/lodash.escape/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.escape/tsconfig.json +++ b/types/lodash.escape/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.escaperegexp/tsconfig.json b/types/lodash.escaperegexp/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.escaperegexp/tsconfig.json +++ b/types/lodash.escaperegexp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.every/tsconfig.json b/types/lodash.every/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.every/tsconfig.json +++ b/types/lodash.every/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.fill/tsconfig.json b/types/lodash.fill/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.fill/tsconfig.json +++ b/types/lodash.fill/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.filter/tsconfig.json b/types/lodash.filter/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.filter/tsconfig.json +++ b/types/lodash.filter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.find/tsconfig.json b/types/lodash.find/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.find/tsconfig.json +++ b/types/lodash.find/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.findindex/tsconfig.json b/types/lodash.findindex/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.findindex/tsconfig.json +++ b/types/lodash.findindex/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.findkey/tsconfig.json b/types/lodash.findkey/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.findkey/tsconfig.json +++ b/types/lodash.findkey/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.findlast/tsconfig.json b/types/lodash.findlast/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.findlast/tsconfig.json +++ b/types/lodash.findlast/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.findlastindex/tsconfig.json b/types/lodash.findlastindex/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.findlastindex/tsconfig.json +++ b/types/lodash.findlastindex/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.findlastkey/tsconfig.json b/types/lodash.findlastkey/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.findlastkey/tsconfig.json +++ b/types/lodash.findlastkey/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.first/tsconfig.json b/types/lodash.first/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.first/tsconfig.json +++ b/types/lodash.first/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.flatmap/tsconfig.json b/types/lodash.flatmap/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.flatmap/tsconfig.json +++ b/types/lodash.flatmap/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.flatmapdeep/tsconfig.json b/types/lodash.flatmapdeep/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.flatmapdeep/tsconfig.json +++ b/types/lodash.flatmapdeep/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.flatmapdepth/tsconfig.json b/types/lodash.flatmapdepth/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.flatmapdepth/tsconfig.json +++ b/types/lodash.flatmapdepth/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.flatten/tsconfig.json b/types/lodash.flatten/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.flatten/tsconfig.json +++ b/types/lodash.flatten/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.flattendeep/tsconfig.json b/types/lodash.flattendeep/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.flattendeep/tsconfig.json +++ b/types/lodash.flattendeep/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.flattendepth/tsconfig.json b/types/lodash.flattendepth/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.flattendepth/tsconfig.json +++ b/types/lodash.flattendepth/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.flip/tsconfig.json b/types/lodash.flip/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.flip/tsconfig.json +++ b/types/lodash.flip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.floor/tsconfig.json b/types/lodash.floor/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.floor/tsconfig.json +++ b/types/lodash.floor/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.flow/tsconfig.json b/types/lodash.flow/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.flow/tsconfig.json +++ b/types/lodash.flow/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.flowright/tsconfig.json b/types/lodash.flowright/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.flowright/tsconfig.json +++ b/types/lodash.flowright/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.foreach/tsconfig.json b/types/lodash.foreach/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.foreach/tsconfig.json +++ b/types/lodash.foreach/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.foreachright/tsconfig.json b/types/lodash.foreachright/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.foreachright/tsconfig.json +++ b/types/lodash.foreachright/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.forin/tsconfig.json b/types/lodash.forin/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.forin/tsconfig.json +++ b/types/lodash.forin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.forinright/tsconfig.json b/types/lodash.forinright/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.forinright/tsconfig.json +++ b/types/lodash.forinright/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.forown/tsconfig.json b/types/lodash.forown/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.forown/tsconfig.json +++ b/types/lodash.forown/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.forownright/tsconfig.json b/types/lodash.forownright/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.forownright/tsconfig.json +++ b/types/lodash.forownright/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.frompairs/tsconfig.json b/types/lodash.frompairs/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.frompairs/tsconfig.json +++ b/types/lodash.frompairs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.functions/tsconfig.json b/types/lodash.functions/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.functions/tsconfig.json +++ b/types/lodash.functions/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.functionsin/tsconfig.json b/types/lodash.functionsin/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.functionsin/tsconfig.json +++ b/types/lodash.functionsin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.get/tsconfig.json b/types/lodash.get/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.get/tsconfig.json +++ b/types/lodash.get/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.groupby/tsconfig.json b/types/lodash.groupby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.groupby/tsconfig.json +++ b/types/lodash.groupby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.gt/tsconfig.json b/types/lodash.gt/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.gt/tsconfig.json +++ b/types/lodash.gt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.gte/tsconfig.json b/types/lodash.gte/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.gte/tsconfig.json +++ b/types/lodash.gte/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.has/tsconfig.json b/types/lodash.has/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.has/tsconfig.json +++ b/types/lodash.has/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.hasin/tsconfig.json b/types/lodash.hasin/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.hasin/tsconfig.json +++ b/types/lodash.hasin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.head/tsconfig.json b/types/lodash.head/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.head/tsconfig.json +++ b/types/lodash.head/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.identity/tsconfig.json b/types/lodash.identity/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.identity/tsconfig.json +++ b/types/lodash.identity/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.includes/tsconfig.json b/types/lodash.includes/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.includes/tsconfig.json +++ b/types/lodash.includes/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.indexof/tsconfig.json b/types/lodash.indexof/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.indexof/tsconfig.json +++ b/types/lodash.indexof/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.initial/tsconfig.json b/types/lodash.initial/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.initial/tsconfig.json +++ b/types/lodash.initial/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.inrange/tsconfig.json b/types/lodash.inrange/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.inrange/tsconfig.json +++ b/types/lodash.inrange/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.intersection/tsconfig.json b/types/lodash.intersection/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.intersection/tsconfig.json +++ b/types/lodash.intersection/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.intersectionby/tsconfig.json b/types/lodash.intersectionby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.intersectionby/tsconfig.json +++ b/types/lodash.intersectionby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.intersectionwith/tsconfig.json b/types/lodash.intersectionwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.intersectionwith/tsconfig.json +++ b/types/lodash.intersectionwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.invert/tsconfig.json b/types/lodash.invert/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.invert/tsconfig.json +++ b/types/lodash.invert/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.invertby/tsconfig.json b/types/lodash.invertby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.invertby/tsconfig.json +++ b/types/lodash.invertby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.invoke/tsconfig.json b/types/lodash.invoke/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.invoke/tsconfig.json +++ b/types/lodash.invoke/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.invokemap/tsconfig.json b/types/lodash.invokemap/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.invokemap/tsconfig.json +++ b/types/lodash.invokemap/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isarguments/tsconfig.json b/types/lodash.isarguments/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isarguments/tsconfig.json +++ b/types/lodash.isarguments/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isarray/tsconfig.json b/types/lodash.isarray/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isarray/tsconfig.json +++ b/types/lodash.isarray/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isarraybuffer/tsconfig.json b/types/lodash.isarraybuffer/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isarraybuffer/tsconfig.json +++ b/types/lodash.isarraybuffer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isarraylike/tsconfig.json b/types/lodash.isarraylike/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isarraylike/tsconfig.json +++ b/types/lodash.isarraylike/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isarraylikeobject/tsconfig.json b/types/lodash.isarraylikeobject/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isarraylikeobject/tsconfig.json +++ b/types/lodash.isarraylikeobject/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isboolean/tsconfig.json b/types/lodash.isboolean/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isboolean/tsconfig.json +++ b/types/lodash.isboolean/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isbuffer/tsconfig.json b/types/lodash.isbuffer/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isbuffer/tsconfig.json +++ b/types/lodash.isbuffer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isdate/tsconfig.json b/types/lodash.isdate/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isdate/tsconfig.json +++ b/types/lodash.isdate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.iselement/tsconfig.json b/types/lodash.iselement/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.iselement/tsconfig.json +++ b/types/lodash.iselement/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isempty/tsconfig.json b/types/lodash.isempty/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isempty/tsconfig.json +++ b/types/lodash.isempty/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isequal/tsconfig.json b/types/lodash.isequal/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isequal/tsconfig.json +++ b/types/lodash.isequal/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isequalwith/tsconfig.json b/types/lodash.isequalwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isequalwith/tsconfig.json +++ b/types/lodash.isequalwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.iserror/tsconfig.json b/types/lodash.iserror/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.iserror/tsconfig.json +++ b/types/lodash.iserror/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isfinite/tsconfig.json b/types/lodash.isfinite/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isfinite/tsconfig.json +++ b/types/lodash.isfinite/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isfunction/tsconfig.json b/types/lodash.isfunction/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isfunction/tsconfig.json +++ b/types/lodash.isfunction/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isinteger/tsconfig.json b/types/lodash.isinteger/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isinteger/tsconfig.json +++ b/types/lodash.isinteger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.islength/tsconfig.json b/types/lodash.islength/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.islength/tsconfig.json +++ b/types/lodash.islength/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.ismap/tsconfig.json b/types/lodash.ismap/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.ismap/tsconfig.json +++ b/types/lodash.ismap/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.ismatch/tsconfig.json b/types/lodash.ismatch/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.ismatch/tsconfig.json +++ b/types/lodash.ismatch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.ismatchwith/tsconfig.json b/types/lodash.ismatchwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.ismatchwith/tsconfig.json +++ b/types/lodash.ismatchwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isnan/tsconfig.json b/types/lodash.isnan/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isnan/tsconfig.json +++ b/types/lodash.isnan/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isnative/tsconfig.json b/types/lodash.isnative/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isnative/tsconfig.json +++ b/types/lodash.isnative/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isnil/tsconfig.json b/types/lodash.isnil/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isnil/tsconfig.json +++ b/types/lodash.isnil/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isnull/tsconfig.json b/types/lodash.isnull/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isnull/tsconfig.json +++ b/types/lodash.isnull/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isnumber/tsconfig.json b/types/lodash.isnumber/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isnumber/tsconfig.json +++ b/types/lodash.isnumber/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isobject/tsconfig.json b/types/lodash.isobject/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isobject/tsconfig.json +++ b/types/lodash.isobject/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isobjectlike/tsconfig.json b/types/lodash.isobjectlike/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isobjectlike/tsconfig.json +++ b/types/lodash.isobjectlike/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isplainobject/tsconfig.json b/types/lodash.isplainobject/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isplainobject/tsconfig.json +++ b/types/lodash.isplainobject/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isregexp/tsconfig.json b/types/lodash.isregexp/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isregexp/tsconfig.json +++ b/types/lodash.isregexp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.issafeinteger/tsconfig.json b/types/lodash.issafeinteger/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.issafeinteger/tsconfig.json +++ b/types/lodash.issafeinteger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isset/tsconfig.json b/types/lodash.isset/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isset/tsconfig.json +++ b/types/lodash.isset/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isstring/tsconfig.json b/types/lodash.isstring/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isstring/tsconfig.json +++ b/types/lodash.isstring/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.issymbol/tsconfig.json b/types/lodash.issymbol/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.issymbol/tsconfig.json +++ b/types/lodash.issymbol/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.istypedarray/tsconfig.json b/types/lodash.istypedarray/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.istypedarray/tsconfig.json +++ b/types/lodash.istypedarray/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isundefined/tsconfig.json b/types/lodash.isundefined/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isundefined/tsconfig.json +++ b/types/lodash.isundefined/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isweakmap/tsconfig.json b/types/lodash.isweakmap/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isweakmap/tsconfig.json +++ b/types/lodash.isweakmap/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isweakset/tsconfig.json b/types/lodash.isweakset/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isweakset/tsconfig.json +++ b/types/lodash.isweakset/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.iteratee/tsconfig.json b/types/lodash.iteratee/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.iteratee/tsconfig.json +++ b/types/lodash.iteratee/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.join/tsconfig.json b/types/lodash.join/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.join/tsconfig.json +++ b/types/lodash.join/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.kebabcase/tsconfig.json b/types/lodash.kebabcase/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.kebabcase/tsconfig.json +++ b/types/lodash.kebabcase/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.keyby/tsconfig.json b/types/lodash.keyby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.keyby/tsconfig.json +++ b/types/lodash.keyby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.keys/tsconfig.json b/types/lodash.keys/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.keys/tsconfig.json +++ b/types/lodash.keys/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.keysin/tsconfig.json b/types/lodash.keysin/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.keysin/tsconfig.json +++ b/types/lodash.keysin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.last/tsconfig.json b/types/lodash.last/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.last/tsconfig.json +++ b/types/lodash.last/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.lastindexof/tsconfig.json b/types/lodash.lastindexof/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.lastindexof/tsconfig.json +++ b/types/lodash.lastindexof/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.lowercase/tsconfig.json b/types/lodash.lowercase/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.lowercase/tsconfig.json +++ b/types/lodash.lowercase/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.lowerfirst/tsconfig.json b/types/lodash.lowerfirst/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.lowerfirst/tsconfig.json +++ b/types/lodash.lowerfirst/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.lt/tsconfig.json b/types/lodash.lt/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.lt/tsconfig.json +++ b/types/lodash.lt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.lte/tsconfig.json b/types/lodash.lte/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.lte/tsconfig.json +++ b/types/lodash.lte/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.mapkeys/tsconfig.json b/types/lodash.mapkeys/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.mapkeys/tsconfig.json +++ b/types/lodash.mapkeys/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.mapvalues/tsconfig.json b/types/lodash.mapvalues/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.mapvalues/tsconfig.json +++ b/types/lodash.mapvalues/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.matches/tsconfig.json b/types/lodash.matches/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.matches/tsconfig.json +++ b/types/lodash.matches/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.matchesproperty/tsconfig.json b/types/lodash.matchesproperty/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.matchesproperty/tsconfig.json +++ b/types/lodash.matchesproperty/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.max/tsconfig.json b/types/lodash.max/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.max/tsconfig.json +++ b/types/lodash.max/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.maxby/tsconfig.json b/types/lodash.maxby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.maxby/tsconfig.json +++ b/types/lodash.maxby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.mean/tsconfig.json b/types/lodash.mean/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.mean/tsconfig.json +++ b/types/lodash.mean/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.meanby/tsconfig.json b/types/lodash.meanby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.meanby/tsconfig.json +++ b/types/lodash.meanby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.memoize/tsconfig.json b/types/lodash.memoize/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.memoize/tsconfig.json +++ b/types/lodash.memoize/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.merge/tsconfig.json b/types/lodash.merge/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.merge/tsconfig.json +++ b/types/lodash.merge/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.mergewith/tsconfig.json b/types/lodash.mergewith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.mergewith/tsconfig.json +++ b/types/lodash.mergewith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.method/tsconfig.json b/types/lodash.method/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.method/tsconfig.json +++ b/types/lodash.method/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.methodof/tsconfig.json b/types/lodash.methodof/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.methodof/tsconfig.json +++ b/types/lodash.methodof/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.min/tsconfig.json b/types/lodash.min/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.min/tsconfig.json +++ b/types/lodash.min/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.minby/tsconfig.json b/types/lodash.minby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.minby/tsconfig.json +++ b/types/lodash.minby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.mixin/tsconfig.json b/types/lodash.mixin/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.mixin/tsconfig.json +++ b/types/lodash.mixin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.negate/tsconfig.json b/types/lodash.negate/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.negate/tsconfig.json +++ b/types/lodash.negate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.noop/tsconfig.json b/types/lodash.noop/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.noop/tsconfig.json +++ b/types/lodash.noop/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.now/tsconfig.json b/types/lodash.now/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.now/tsconfig.json +++ b/types/lodash.now/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.nth/tsconfig.json b/types/lodash.nth/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.nth/tsconfig.json +++ b/types/lodash.nth/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.ntharg/tsconfig.json b/types/lodash.ntharg/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.ntharg/tsconfig.json +++ b/types/lodash.ntharg/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.omit/tsconfig.json b/types/lodash.omit/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.omit/tsconfig.json +++ b/types/lodash.omit/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.omitby/tsconfig.json b/types/lodash.omitby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.omitby/tsconfig.json +++ b/types/lodash.omitby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.once/tsconfig.json b/types/lodash.once/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.once/tsconfig.json +++ b/types/lodash.once/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.orderby/tsconfig.json b/types/lodash.orderby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.orderby/tsconfig.json +++ b/types/lodash.orderby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.over/tsconfig.json b/types/lodash.over/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.over/tsconfig.json +++ b/types/lodash.over/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.overargs/tsconfig.json b/types/lodash.overargs/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.overargs/tsconfig.json +++ b/types/lodash.overargs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.overevery/tsconfig.json b/types/lodash.overevery/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.overevery/tsconfig.json +++ b/types/lodash.overevery/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.oversome/tsconfig.json b/types/lodash.oversome/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.oversome/tsconfig.json +++ b/types/lodash.oversome/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.pad/tsconfig.json b/types/lodash.pad/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.pad/tsconfig.json +++ b/types/lodash.pad/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.padend/tsconfig.json b/types/lodash.padend/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.padend/tsconfig.json +++ b/types/lodash.padend/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.padstart/tsconfig.json b/types/lodash.padstart/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.padstart/tsconfig.json +++ b/types/lodash.padstart/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.parseint/tsconfig.json b/types/lodash.parseint/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.parseint/tsconfig.json +++ b/types/lodash.parseint/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.partial/tsconfig.json b/types/lodash.partial/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.partial/tsconfig.json +++ b/types/lodash.partial/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.partialright/tsconfig.json b/types/lodash.partialright/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.partialright/tsconfig.json +++ b/types/lodash.partialright/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.partition/tsconfig.json b/types/lodash.partition/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.partition/tsconfig.json +++ b/types/lodash.partition/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.pick/tsconfig.json b/types/lodash.pick/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.pick/tsconfig.json +++ b/types/lodash.pick/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.pickby/tsconfig.json b/types/lodash.pickby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.pickby/tsconfig.json +++ b/types/lodash.pickby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.property/tsconfig.json b/types/lodash.property/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.property/tsconfig.json +++ b/types/lodash.property/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.propertyof/tsconfig.json b/types/lodash.propertyof/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.propertyof/tsconfig.json +++ b/types/lodash.propertyof/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.pull/tsconfig.json b/types/lodash.pull/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.pull/tsconfig.json +++ b/types/lodash.pull/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.pullall/tsconfig.json b/types/lodash.pullall/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.pullall/tsconfig.json +++ b/types/lodash.pullall/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.pullallby/tsconfig.json b/types/lodash.pullallby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.pullallby/tsconfig.json +++ b/types/lodash.pullallby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.pullallwith/tsconfig.json b/types/lodash.pullallwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.pullallwith/tsconfig.json +++ b/types/lodash.pullallwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.pullat/tsconfig.json b/types/lodash.pullat/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.pullat/tsconfig.json +++ b/types/lodash.pullat/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.random/tsconfig.json b/types/lodash.random/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.random/tsconfig.json +++ b/types/lodash.random/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.range/tsconfig.json b/types/lodash.range/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.range/tsconfig.json +++ b/types/lodash.range/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.rangeright/tsconfig.json b/types/lodash.rangeright/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.rangeright/tsconfig.json +++ b/types/lodash.rangeright/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.rearg/tsconfig.json b/types/lodash.rearg/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.rearg/tsconfig.json +++ b/types/lodash.rearg/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.reduce/tsconfig.json b/types/lodash.reduce/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.reduce/tsconfig.json +++ b/types/lodash.reduce/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.reduceright/tsconfig.json b/types/lodash.reduceright/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.reduceright/tsconfig.json +++ b/types/lodash.reduceright/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.reject/tsconfig.json b/types/lodash.reject/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.reject/tsconfig.json +++ b/types/lodash.reject/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.remove/tsconfig.json b/types/lodash.remove/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.remove/tsconfig.json +++ b/types/lodash.remove/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.repeat/tsconfig.json b/types/lodash.repeat/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.repeat/tsconfig.json +++ b/types/lodash.repeat/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.replace/tsconfig.json b/types/lodash.replace/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.replace/tsconfig.json +++ b/types/lodash.replace/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.rest/tsconfig.json b/types/lodash.rest/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.rest/tsconfig.json +++ b/types/lodash.rest/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.result/tsconfig.json b/types/lodash.result/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.result/tsconfig.json +++ b/types/lodash.result/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.reverse/tsconfig.json b/types/lodash.reverse/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.reverse/tsconfig.json +++ b/types/lodash.reverse/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.round/tsconfig.json b/types/lodash.round/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.round/tsconfig.json +++ b/types/lodash.round/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sample/tsconfig.json b/types/lodash.sample/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sample/tsconfig.json +++ b/types/lodash.sample/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.samplesize/tsconfig.json b/types/lodash.samplesize/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.samplesize/tsconfig.json +++ b/types/lodash.samplesize/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.set/tsconfig.json b/types/lodash.set/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.set/tsconfig.json +++ b/types/lodash.set/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.setwith/tsconfig.json b/types/lodash.setwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.setwith/tsconfig.json +++ b/types/lodash.setwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.shuffle/tsconfig.json b/types/lodash.shuffle/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.shuffle/tsconfig.json +++ b/types/lodash.shuffle/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.size/tsconfig.json b/types/lodash.size/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.size/tsconfig.json +++ b/types/lodash.size/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.slice/tsconfig.json b/types/lodash.slice/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.slice/tsconfig.json +++ b/types/lodash.slice/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.snakecase/tsconfig.json b/types/lodash.snakecase/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.snakecase/tsconfig.json +++ b/types/lodash.snakecase/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.some/tsconfig.json b/types/lodash.some/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.some/tsconfig.json +++ b/types/lodash.some/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sortby/tsconfig.json b/types/lodash.sortby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sortby/tsconfig.json +++ b/types/lodash.sortby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sortedindex/tsconfig.json b/types/lodash.sortedindex/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sortedindex/tsconfig.json +++ b/types/lodash.sortedindex/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sortedindexby/tsconfig.json b/types/lodash.sortedindexby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sortedindexby/tsconfig.json +++ b/types/lodash.sortedindexby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sortedindexof/tsconfig.json b/types/lodash.sortedindexof/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sortedindexof/tsconfig.json +++ b/types/lodash.sortedindexof/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sortedlastindex/tsconfig.json b/types/lodash.sortedlastindex/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sortedlastindex/tsconfig.json +++ b/types/lodash.sortedlastindex/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sortedlastindexby/tsconfig.json b/types/lodash.sortedlastindexby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sortedlastindexby/tsconfig.json +++ b/types/lodash.sortedlastindexby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sortedlastindexof/tsconfig.json b/types/lodash.sortedlastindexof/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sortedlastindexof/tsconfig.json +++ b/types/lodash.sortedlastindexof/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sorteduniq/tsconfig.json b/types/lodash.sorteduniq/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sorteduniq/tsconfig.json +++ b/types/lodash.sorteduniq/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sorteduniqby/tsconfig.json b/types/lodash.sorteduniqby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sorteduniqby/tsconfig.json +++ b/types/lodash.sorteduniqby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.split/tsconfig.json b/types/lodash.split/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.split/tsconfig.json +++ b/types/lodash.split/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.spread/tsconfig.json b/types/lodash.spread/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.spread/tsconfig.json +++ b/types/lodash.spread/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.startcase/tsconfig.json b/types/lodash.startcase/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.startcase/tsconfig.json +++ b/types/lodash.startcase/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.startswith/tsconfig.json b/types/lodash.startswith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.startswith/tsconfig.json +++ b/types/lodash.startswith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.subtract/tsconfig.json b/types/lodash.subtract/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.subtract/tsconfig.json +++ b/types/lodash.subtract/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sum/tsconfig.json b/types/lodash.sum/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sum/tsconfig.json +++ b/types/lodash.sum/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sumby/tsconfig.json b/types/lodash.sumby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sumby/tsconfig.json +++ b/types/lodash.sumby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.tail/tsconfig.json b/types/lodash.tail/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.tail/tsconfig.json +++ b/types/lodash.tail/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.take/tsconfig.json b/types/lodash.take/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.take/tsconfig.json +++ b/types/lodash.take/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.takeright/tsconfig.json b/types/lodash.takeright/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.takeright/tsconfig.json +++ b/types/lodash.takeright/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.takerightwhile/tsconfig.json b/types/lodash.takerightwhile/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.takerightwhile/tsconfig.json +++ b/types/lodash.takerightwhile/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.takewhile/tsconfig.json b/types/lodash.takewhile/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.takewhile/tsconfig.json +++ b/types/lodash.takewhile/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.template/tsconfig.json b/types/lodash.template/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.template/tsconfig.json +++ b/types/lodash.template/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.throttle/tsconfig.json b/types/lodash.throttle/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.throttle/tsconfig.json +++ b/types/lodash.throttle/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.times/tsconfig.json b/types/lodash.times/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.times/tsconfig.json +++ b/types/lodash.times/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.toarray/tsconfig.json b/types/lodash.toarray/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.toarray/tsconfig.json +++ b/types/lodash.toarray/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.tofinite/tsconfig.json b/types/lodash.tofinite/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.tofinite/tsconfig.json +++ b/types/lodash.tofinite/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.tointeger/tsconfig.json b/types/lodash.tointeger/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.tointeger/tsconfig.json +++ b/types/lodash.tointeger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.tolength/tsconfig.json b/types/lodash.tolength/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.tolength/tsconfig.json +++ b/types/lodash.tolength/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.tolower/tsconfig.json b/types/lodash.tolower/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.tolower/tsconfig.json +++ b/types/lodash.tolower/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.tonumber/tsconfig.json b/types/lodash.tonumber/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.tonumber/tsconfig.json +++ b/types/lodash.tonumber/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.topairs/tsconfig.json b/types/lodash.topairs/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.topairs/tsconfig.json +++ b/types/lodash.topairs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.topairsin/tsconfig.json b/types/lodash.topairsin/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.topairsin/tsconfig.json +++ b/types/lodash.topairsin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.topath/tsconfig.json b/types/lodash.topath/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.topath/tsconfig.json +++ b/types/lodash.topath/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.toplainobject/tsconfig.json b/types/lodash.toplainobject/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.toplainobject/tsconfig.json +++ b/types/lodash.toplainobject/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.tosafeinteger/tsconfig.json b/types/lodash.tosafeinteger/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.tosafeinteger/tsconfig.json +++ b/types/lodash.tosafeinteger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.tostring/tsconfig.json b/types/lodash.tostring/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.tostring/tsconfig.json +++ b/types/lodash.tostring/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.toupper/tsconfig.json b/types/lodash.toupper/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.toupper/tsconfig.json +++ b/types/lodash.toupper/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.transform/tsconfig.json b/types/lodash.transform/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.transform/tsconfig.json +++ b/types/lodash.transform/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.trim/tsconfig.json b/types/lodash.trim/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.trim/tsconfig.json +++ b/types/lodash.trim/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.trimend/tsconfig.json b/types/lodash.trimend/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.trimend/tsconfig.json +++ b/types/lodash.trimend/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.trimstart/tsconfig.json b/types/lodash.trimstart/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.trimstart/tsconfig.json +++ b/types/lodash.trimstart/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.truncate/tsconfig.json b/types/lodash.truncate/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.truncate/tsconfig.json +++ b/types/lodash.truncate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.unary/tsconfig.json b/types/lodash.unary/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.unary/tsconfig.json +++ b/types/lodash.unary/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.unescape/tsconfig.json b/types/lodash.unescape/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.unescape/tsconfig.json +++ b/types/lodash.unescape/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.union/tsconfig.json b/types/lodash.union/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.union/tsconfig.json +++ b/types/lodash.union/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.unionby/tsconfig.json b/types/lodash.unionby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.unionby/tsconfig.json +++ b/types/lodash.unionby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.unionwith/tsconfig.json b/types/lodash.unionwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.unionwith/tsconfig.json +++ b/types/lodash.unionwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.uniq/tsconfig.json b/types/lodash.uniq/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.uniq/tsconfig.json +++ b/types/lodash.uniq/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.uniqby/tsconfig.json b/types/lodash.uniqby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.uniqby/tsconfig.json +++ b/types/lodash.uniqby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.uniqueid/tsconfig.json b/types/lodash.uniqueid/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.uniqueid/tsconfig.json +++ b/types/lodash.uniqueid/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.uniqwith/tsconfig.json b/types/lodash.uniqwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.uniqwith/tsconfig.json +++ b/types/lodash.uniqwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.unset/tsconfig.json b/types/lodash.unset/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.unset/tsconfig.json +++ b/types/lodash.unset/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.unzip/tsconfig.json b/types/lodash.unzip/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.unzip/tsconfig.json +++ b/types/lodash.unzip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.unzipwith/tsconfig.json b/types/lodash.unzipwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.unzipwith/tsconfig.json +++ b/types/lodash.unzipwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.update/tsconfig.json b/types/lodash.update/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.update/tsconfig.json +++ b/types/lodash.update/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.updatewith/tsconfig.json b/types/lodash.updatewith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.updatewith/tsconfig.json +++ b/types/lodash.updatewith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.uppercase/tsconfig.json b/types/lodash.uppercase/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.uppercase/tsconfig.json +++ b/types/lodash.uppercase/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.upperfirst/tsconfig.json b/types/lodash.upperfirst/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.upperfirst/tsconfig.json +++ b/types/lodash.upperfirst/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.values/tsconfig.json b/types/lodash.values/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.values/tsconfig.json +++ b/types/lodash.values/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.valuesin/tsconfig.json b/types/lodash.valuesin/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.valuesin/tsconfig.json +++ b/types/lodash.valuesin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.without/tsconfig.json b/types/lodash.without/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.without/tsconfig.json +++ b/types/lodash.without/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.words/tsconfig.json b/types/lodash.words/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.words/tsconfig.json +++ b/types/lodash.words/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.wrap/tsconfig.json b/types/lodash.wrap/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.wrap/tsconfig.json +++ b/types/lodash.wrap/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.xor/tsconfig.json b/types/lodash.xor/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.xor/tsconfig.json +++ b/types/lodash.xor/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.xorby/tsconfig.json b/types/lodash.xorby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.xorby/tsconfig.json +++ b/types/lodash.xorby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.xorwith/tsconfig.json b/types/lodash.xorwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.xorwith/tsconfig.json +++ b/types/lodash.xorwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.zip/tsconfig.json b/types/lodash.zip/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.zip/tsconfig.json +++ b/types/lodash.zip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.zipobject/tsconfig.json b/types/lodash.zipobject/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.zipobject/tsconfig.json +++ b/types/lodash.zipobject/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.zipobjectdeep/tsconfig.json b/types/lodash.zipobjectdeep/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.zipobjectdeep/tsconfig.json +++ b/types/lodash.zipobjectdeep/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.zipwith/tsconfig.json b/types/lodash.zipwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.zipwith/tsconfig.json +++ b/types/lodash.zipwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash/array/chunk.d.ts b/types/lodash/array/chunk.d.ts new file mode 100644 index 0000000000..16e4f8beb9 --- /dev/null +++ b/types/lodash/array/chunk.d.ts @@ -0,0 +1,37 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the + * final chunk will be the remaining elements. + * + * @param array The array to process. + * @param size The length of each chunk. + * @return Returns the new array containing chunks. + */ + chunk( + array: List | null | undefined, + size?: number + ): T[][]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.chunk + */ + chunk( + this: LoDashImplicitWrapper | null | undefined>, + size?: number, + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.chunk + */ + chunk( + this: LoDashExplicitWrapper | null | undefined>, + size?: number, + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/compact.d.ts b/types/lodash/array/compact.d.ts new file mode 100644 index 0000000000..7bf05df7e3 --- /dev/null +++ b/types/lodash/array/compact.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are + * falsey. + * + * @param array The array to compact. + * @return Returns the new array of filtered values. + */ + compact(array: List | null | undefined): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.compact + */ + compact(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.compact + */ + compact(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/concat.d.ts b/types/lodash/array/concat.d.ts new file mode 100644 index 0000000000..3b1bac32aa --- /dev/null +++ b/types/lodash/array/concat.d.ts @@ -0,0 +1,39 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @category Array + * @param array The array to concatenate. + * @param [values] The values to concatenate. + * @returns Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + concat(array: Many, ...values: Array>): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.compact + */ + concat(this: LoDashImplicitWrapper>, ...values: Array>): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.compact + */ + concat(this: LoDashExplicitWrapper>, ...values: Array>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/difference.d.ts b/types/lodash/array/difference.d.ts new file mode 100644 index 0000000000..5c237eccea --- /dev/null +++ b/types/lodash/array/difference.d.ts @@ -0,0 +1,37 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of unique array values not included in the other provided arrays using SameValueZero for + * equality comparisons. + * + * @param array The array to inspect. + * @param values The arrays of values to exclude. + * @return Returns the new array of filtered values. + */ + difference( + array: List | null | undefined, + ...values: Array> + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.difference + */ + difference( + this: LoDashImplicitWrapper | null | undefined>, + ...values: Array> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.difference + */ + difference( + this: LoDashExplicitWrapper | null | undefined>, + ...values: Array> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/differenceBy.d.ts b/types/lodash/array/differenceBy.d.ts new file mode 100644 index 0000000000..da8e928097 --- /dev/null +++ b/types/lodash/array/differenceBy.d.ts @@ -0,0 +1,243 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.difference except that it accepts iteratee which is invoked for each element of array + * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one + * argument: (value). + * + * @param array The array to inspect. + * @param values The values to exclude. + * @param iteratee The iteratee invoked per element. + * @returns Returns the new array of filtered values. + */ + differenceBy( + array: List | null | undefined, + values: List, + iteratee: ValueIteratee + ): T1[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: List | null | undefined, + values1: List, + values2: List, + iteratee: ValueIteratee + ): T1[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: List | null | undefined, + values1: List, + values2: List, + values3: List, + iteratee: ValueIteratee + ): T1[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: List | null | undefined, + values1: List, + values2: List, + values3: List, + values4: List, + iteratee: ValueIteratee + ): T1[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: List | null | undefined, + values1: List, + values2: List, + values3: List, + values4: List, + values5: List, + iteratee: ValueIteratee + ): T1[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: List | null | undefined, + values1: List, + values2: List, + values3: List, + values4: List, + values5: List, + ...values: Array | ValueIteratee> + ): T1[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: List | null | undefined, + ...values: Array> + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashImplicitWrapper | null | undefined>, + values: List, + iteratee: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + iteratee: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + values3: List, + iteratee: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + values3: List, + values4: List, + iteratee: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + values3: List, + values4: List, + values5: List, + iteratee: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + values3: List, + values4: List, + values5: List, + ...values: Array | ValueIteratee> + ): LoDashImplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashImplicitWrapper | null | undefined>, + ...values: Array> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashExplicitWrapper | null | undefined>, + values: List, + iteratee: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + iteratee: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + values3: List, + iteratee: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + values3: List, + values4: List, + iteratee: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + values3: List, + values4: List, + values5: List, + iteratee: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + values3: List, + values4: List, + values5: List, + ...values: Array | ValueIteratee> + ): LoDashExplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashExplicitWrapper | null | undefined>, + ...values: Array> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/differenceWith.d.ts b/types/lodash/array/differenceWith.d.ts new file mode 100644 index 0000000000..39eca3314f --- /dev/null +++ b/types/lodash/array/differenceWith.d.ts @@ -0,0 +1,132 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of unique `array` values not included in the other + * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @category Array + * @param [values] The arrays to inspect. + * @param [comparator] The comparator invoked per element. + * @returns Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ + differenceWith( + array: List | null | undefined, + values: List, + comparator: Comparator2 + ): T1[]; + + /** + * @see _.differenceWith + */ + differenceWith( + array: List | null | undefined, + values1: List, + values2: List, + comparator: Comparator2 + ): T1[]; + + /** + * @see _.differenceWith + */ + differenceWith( + array: List | null | undefined, + values1: List, + values2: List, + ...values: Array | Comparator2> + ): T1[]; + + /** + * @see _.differenceWith + */ + differenceWith( + array: List | null | undefined, + ...values: Array> + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.differenceWith + */ + differenceWith( + this: LoDashImplicitWrapper | null | undefined>, + values: List, + comparator: Comparator2 + ): LoDashImplicitWrapper; + + /** + * @see _.differenceWith + */ + differenceWith( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + comparator: Comparator2 + ): LoDashImplicitWrapper; + + /** + * @see _.differenceWith + */ + differenceWith( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + ...values: Array | Comparator2> + ): LoDashImplicitWrapper; + + /** + * @see _.differenceWith + */ + differenceWith( + this: LoDashImplicitWrapper | null | undefined>, + ...values: Array> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.differenceWith + */ + differenceWith( + this: LoDashExplicitWrapper | null | undefined>, + values: List, + comparator: Comparator2 + ): LoDashExplicitWrapper; + + /** + * @see _.differenceWith + */ + differenceWith( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + comparator: Comparator2 + ): LoDashExplicitWrapper; + + /** + * @see _.differenceWith + */ + differenceWith( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + ...values: Array | Comparator2> + ): LoDashExplicitWrapper; + + /** + * @see _.differenceWith + */ + differenceWith( + this: LoDashExplicitWrapper | null | undefined>, + ...values: Array> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/drop.d.ts b/types/lodash/array/drop.d.ts new file mode 100644 index 0000000000..6df72adcb6 --- /dev/null +++ b/types/lodash/array/drop.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a slice of array with n elements dropped from the beginning. + * + * @param array The array to query. + * @param n The number of elements to drop. + * @return Returns the slice of array. + */ + drop(array: List | null | undefined, n?: number): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.drop + */ + drop(this: LoDashImplicitWrapper | null | undefined>, n?: number): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.drop + */ + drop(this: LoDashExplicitWrapper | null | undefined>, n?: number): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/dropRight.d.ts b/types/lodash/array/dropRight.d.ts new file mode 100644 index 0000000000..4e08a213b9 --- /dev/null +++ b/types/lodash/array/dropRight.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a slice of array with n elements dropped from the end. + * + * @param array The array to query. + * @param n The number of elements to drop. + * @return Returns the slice of array. + */ + dropRight( + array: List | null | undefined, + n?: number + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.dropRight + */ + dropRight(this: LoDashImplicitWrapper | null | undefined>, n?: number): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.dropRight + */ + dropRight(this: LoDashExplicitWrapper | null | undefined>, n?: number): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/dropRightWhile.d.ts b/types/lodash/array/dropRightWhile.d.ts new file mode 100644 index 0000000000..efce8161d2 --- /dev/null +++ b/types/lodash/array/dropRightWhile.d.ts @@ -0,0 +1,47 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate + * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * match the properties of the given object, else false. + * + * @param array The array to query. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the slice of array. + */ + dropRightWhile( + array: List | null | undefined, + predicate?: ListIteratee + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.dropRightWhile + */ + dropRightWhile( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIteratee + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.dropRightWhile + */ + dropRightWhile( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/dropWhile.d.ts b/types/lodash/array/dropWhile.d.ts new file mode 100644 index 0000000000..f6f68fb191 --- /dev/null +++ b/types/lodash/array/dropWhile.d.ts @@ -0,0 +1,47 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate + * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param array The array to query. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the slice of array. + */ + dropWhile( + array: List | null | undefined, + predicate?: ListIteratee + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.dropWhile + */ + dropWhile( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIteratee + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.dropWhile + */ + dropWhile( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/fill.d.ts b/types/lodash/array/fill.d.ts new file mode 100644 index 0000000000..651a19a830 --- /dev/null +++ b/types/lodash/array/fill.d.ts @@ -0,0 +1,124 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Fills elements of array with value from start up to, but not including, end. + * + * Note: This method mutates array. + * + * @param array The array to fill. + * @param value The value to fill array with. + * @param start The start position. + * @param end The end position. + * @return Returns array. + */ + fill( + array: any[] | null | undefined, + value: T + ): T[]; + + /** + * @see _.fill + */ + fill( + array: List | null | undefined, + value: T + ): List; + + /** + * @see _.fill + */ + fill( + array: U[] | null | undefined, + value: T, + start?: number, + end?: number + ): Array; + + /** + * @see _.fill + */ + fill( + array: List | null | undefined, + value: T, + start?: number, + end?: number + ): List; + } + + interface LoDashImplicitWrapper { + /** + * @see _.fill + */ + fill( + this: LoDashImplicitWrapper, + value: T + ): LoDashImplicitWrapper; + + /** + * @see _.fill + */ + fill( + this: LoDashImplicitWrapper | null | undefined>, + value: T + ): LoDashImplicitWrapper>; + + /** + * @see _.fill + */ + fill( + this: LoDashImplicitWrapper, + value: T, + start?: number, + end?: number + ): LoDashImplicitWrapper>; + + /** + * @see _.fill + */ + fill( + this: LoDashImplicitWrapper | null | undefined>, + value: T, + start?: number, + end?: number + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.fill + */ + fill( + this: LoDashExplicitWrapper, + value: T + ): LoDashExplicitWrapper; + + /** + * @see _.fill + */ + fill( + this: LoDashExplicitWrapper | null | undefined>, + value: T + ): LoDashExplicitWrapper>; + + /** + * @see _.fill + */ + fill( + this: LoDashExplicitWrapper, + value: T, + start?: number, + end?: number + ): LoDashExplicitWrapper>; + + /** + * @see _.fill + */ + fill( + this: LoDashExplicitWrapper | null | undefined>, + value: T, + start?: number, + end?: number + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/array/findIndex.d.ts b/types/lodash/array/findIndex.d.ts new file mode 100644 index 0000000000..13f314ee82 --- /dev/null +++ b/types/lodash/array/findIndex.d.ts @@ -0,0 +1,50 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.find except that it returns the index of the first element predicate returns truthy + * for instead of the element itself. + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param array The array to search. + * @param predicate The function invoked per iteration. + * @param fromIndex The index to search from. + * @return Returns the index of the found element, else -1. + */ + findIndex( + array: List | null | undefined, + predicate?: ListIterateeCustom, + fromIndex?: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.findIndex + */ + findIndex( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom, + fromIndex?: number + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.findIndex + */ + findIndex( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/findLastIndex.d.ts b/types/lodash/array/findLastIndex.d.ts new file mode 100644 index 0000000000..db28988a4a --- /dev/null +++ b/types/lodash/array/findLastIndex.d.ts @@ -0,0 +1,49 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.findIndex except that it iterates over elements of collection from right to left. + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param array The array to search. + * @param predicate The function invoked per iteration. + * @param fromIndex The index to search from. + * @return Returns the index of the found element, else -1. + */ + findLastIndex( + array: List | null | undefined, + predicate?: ListIterateeCustom, + fromIndex?: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.findLastIndex + */ + findLastIndex( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom, + fromIndex?: number + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.findLastIndex + */ + findLastIndex( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/first.d.ts b/types/lodash/array/first.d.ts new file mode 100644 index 0000000000..ec88a9b5b2 --- /dev/null +++ b/types/lodash/array/first.d.ts @@ -0,0 +1,23 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + first: typeof _.head; // tslint:disable-line:no-unnecessary-qualifier + } + + interface LoDashImplicitWrapper { + /** + * @see _.head + */ + first(this: LoDashImplicitWrapper | null | undefined>): T | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.head + */ + first(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } + + interface RecursiveArray extends Array> {} + interface ListOfRecursiveArraysOrValues extends List> {} +} \ No newline at end of file diff --git a/types/lodash/array/flatten.d.ts b/types/lodash/array/flatten.d.ts new file mode 100644 index 0000000000..8453624756 --- /dev/null +++ b/types/lodash/array/flatten.d.ts @@ -0,0 +1,43 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Flattens a nested array. If isDeep is true the array is recursively flattened, otherwise it’s only + * flattened a single level. + * + * @param array The array to flatten. + * @param isDeep Specify a deep flatten. + * @return Returns the new flattened array. + */ + flatten(array: ListOfRecursiveArraysOrValues | null | undefined, isDeep: boolean): T[]; + + /** + * @see _.flatten + */ + flatten(array: List> | null | undefined): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flatten + */ + flatten(this: LoDashImplicitWrapper | null | undefined>, isDeep: boolean): LoDashImplicitWrapper; + + /** + * @see _.flatten + */ + flatten(this: LoDashImplicitWrapper> | null | undefined>): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flatten + */ + flatten(this: LoDashExplicitWrapper | null | undefined>, isDeep: boolean): LoDashExplicitWrapper; + + /** + * @see _.flatten + */ + flatten(this: LoDashExplicitWrapper> | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/flattenDeep.d.ts b/types/lodash/array/flattenDeep.d.ts new file mode 100644 index 0000000000..0c604f2571 --- /dev/null +++ b/types/lodash/array/flattenDeep.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Recursively flattens a nested array. + * + * @param array The array to recursively flatten. + * @return Returns the new flattened array. + */ + flattenDeep(array: ListOfRecursiveArraysOrValues | null | undefined): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flattenDeep + */ + flattenDeep(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flattenDeep + */ + flattenDeep(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/flattenDepth.d.ts b/types/lodash/array/flattenDepth.d.ts new file mode 100644 index 0000000000..0efd206f9e --- /dev/null +++ b/types/lodash/array/flattenDepth.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Recursively flatten array up to depth times. + * + * @param array The array to recursively flatten. + * @param number The maximum recursion depth. + * @return Returns the new flattened array. + */ + flattenDepth(array: ListOfRecursiveArraysOrValues | null | undefined, depth?: number): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flattenDeep + */ + flattenDepth(this: LoDashImplicitWrapper | null | undefined>, depth?: number): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flattenDeep + */ + flattenDepth(this: LoDashExplicitWrapper | null | undefined>, depth?: number): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/fromPairs.d.ts b/types/lodash/array/fromPairs.d.ts new file mode 100644 index 0000000000..92a8e4d168 --- /dev/null +++ b/types/lodash/array/fromPairs.d.ts @@ -0,0 +1,59 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @category Array + * @param pairs The key-value pairs. + * @returns Returns the new object. + * @example + * + * _.fromPairs([['fred', 30], ['barney', 40]]); + * // => { 'fred': 30, 'barney': 40 } + */ + fromPairs( + pairs: List<[PropertyName, T]> | null | undefined + ): Dictionary; + + /** + @see _.fromPairs + */ + fromPairs( + pairs: List | null | undefined + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.fromPairs + */ + fromPairs( + this: LoDashImplicitWrapper | null | undefined> + ): LoDashImplicitWrapper>; + + /** + @see _.fromPairs + */ + fromPairs( + this: LoDashImplicitWrapper | null | undefined> + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.fromPairs + */ + fromPairs( + this: LoDashExplicitWrapper | null | undefined> + ): LoDashExplicitWrapper>; + + /** + @see _.fromPairs + */ + fromPairs( + this: LoDashExplicitWrapper | null | undefined> + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/array/head.d.ts b/types/lodash/array/head.d.ts new file mode 100644 index 0000000000..476e5b2b07 --- /dev/null +++ b/types/lodash/array/head.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Gets the first element of array. + * + * @alias _.first + * + * @param array The array to query. + * @return Returns the first element of array. + */ + head(array: List | null | undefined): T | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.head + */ + head(this: LoDashImplicitWrapper | null | undefined>): T | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.head + */ + head(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/indexOf.d.ts b/types/lodash/array/indexOf.d.ts new file mode 100644 index 0000000000..f2f01c2e5c --- /dev/null +++ b/types/lodash/array/indexOf.d.ts @@ -0,0 +1,53 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the offset + * from the end of `array`. If `array` is sorted providing `true` for `fromIndex` + * performs a faster binary search. + * + * @category Array + * @param array The array to search. + * @param value The value to search for. + * @param [fromIndex=0] The index to search from. + * @returns Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // using `fromIndex` + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + indexOf( + array: List | null | undefined, + value: T, + fromIndex?: boolean|number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.indexOf + */ + indexOf( + this: LoDashImplicitWrapper | null | undefined>, + value: T, + fromIndex?: boolean|number + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.indexOf + */ + indexOf( + this: LoDashExplicitWrapper | null | undefined>, + value: T, + fromIndex?: boolean|number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/initial.d.ts b/types/lodash/array/initial.d.ts new file mode 100644 index 0000000000..fca86bcfa0 --- /dev/null +++ b/types/lodash/array/initial.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Gets all but the last element of array. + * + * @param array The array to query. + * @return Returns the slice of array. + */ + initial(array: List | null | undefined): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.initial + */ + initial(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.initial + */ + initial(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/intersection.d.ts b/types/lodash/array/intersection.d.ts new file mode 100644 index 0000000000..444e0b23f1 --- /dev/null +++ b/types/lodash/array/intersection.d.ts @@ -0,0 +1,33 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of unique values that are included in all of the provided arrays using SameValueZero for + * equality comparisons. + * + * @param arrays The arrays to inspect. + * @return Returns the new array of shared values. + */ + intersection(...arrays: Array>): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.intersection + */ + intersection( + this: LoDashImplicitWrapper>, + ...arrays: Array> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.intersection + */ + intersection( + this: LoDashExplicitWrapper>, + ...arrays: Array> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/intersectionBy.d.ts b/types/lodash/array/intersectionBy.d.ts new file mode 100644 index 0000000000..4148043afe --- /dev/null +++ b/types/lodash/array/intersectionBy.d.ts @@ -0,0 +1,134 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * @category Array + * @param [arrays] The arrays to inspect. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns the new array of shared values. + * @example + * + * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); + * // => [2.1] + * + * // using the `_.property` iteratee shorthand + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ + intersectionBy( + array: List | null, + values: List, + iteratee: ValueIteratee + ): T1[]; + + /** + * @see _.intersectionBy + */ + intersectionBy( + array: List | null, + values1: List, + values2: List, + iteratee: ValueIteratee + ): T1[]; + + /** + * @see _.intersectionBy + */ + intersectionBy( + array: List | null | undefined, + values1: List, + values2: List, + ...values: Array | ValueIteratee> + ): T1[]; + + /** + * @see _.intersectionBy + */ + intersectionBy( + array?: List | null, + ...values: Array> + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.intersectionBy + */ + intersectionBy( + this: LoDashImplicitWrapper | null | undefined>, + values: List, + iteratee: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.intersectionBy + */ + intersectionBy( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + iteratee: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.intersectionBy + */ + intersectionBy( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + ...values: Array | ValueIteratee> + ): LoDashImplicitWrapper; + + /** + * @see _.intersectionBy + */ + intersectionBy( + this: LoDashImplicitWrapper | null | undefined>, + ...values: Array> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.intersectionBy + */ + intersectionBy( + this: LoDashExplicitWrapper | null | undefined>, + values: List, + iteratee: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.intersectionBy + */ + intersectionBy( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + iteratee: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.intersectionBy + */ + intersectionBy( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + ...values: Array | ValueIteratee> + ): LoDashExplicitWrapper; + + /** + * @see _.intersectionBy + */ + intersectionBy( + this: LoDashExplicitWrapper | null | undefined>, + ...values: Array> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/intersectionWith.d.ts b/types/lodash/array/intersectionWith.d.ts new file mode 100644 index 0000000000..9fa2198c9b --- /dev/null +++ b/types/lodash/array/intersectionWith.d.ts @@ -0,0 +1,133 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of unique `array` values not included in the other + * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @category Array + * @param [values] The arrays to inspect. + * @param [comparator] The comparator invoked per element. + * @returns Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ + intersectionWith( + array: List | null | undefined, + values: List, + comparator: Comparator2 + ): T1[]; + + /** + * @see _.intersectionWith + */ + intersectionWith( + array: List | null | undefined, + values1: List, + values2: List, + comparator: Comparator2 + ): T1[]; + + /** + * @see _.intersectionWith + */ + intersectionWith( + array: List | null | undefined, + values1: List, + values2: List, + ...values: Array | Comparator2> + ): T1[]; + + /** + * @see _.intersectionWith + */ + intersectionWith( + array?: List | null, + ...values: Array> + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.intersectionWith + */ + intersectionWith( + this: LoDashImplicitWrapper | null | undefined>, + values: List, + comparator: Comparator2 + ): LoDashImplicitWrapper; + + /** + * @see _.intersectionWith + */ + intersectionWith( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + comparator: Comparator2 + ): LoDashImplicitWrapper; + + /** + * @see _.intersectionWith + */ + intersectionWith( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + ...values: Array | Comparator2>, + ): LoDashImplicitWrapper; + + /** + * @see _.intersectionWith + */ + intersectionWith( + this: LoDashImplicitWrapper | null | undefined>, + ...values: Array> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.intersectionWith + */ + intersectionWith( + this: LoDashExplicitWrapper | null | undefined>, + values: List, + comparator: Comparator2 + ): LoDashExplicitWrapper; + + /** + * @see _.intersectionWith + */ + intersectionWith( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + comparator: Comparator2 + ): LoDashExplicitWrapper; + + /** + * @see _.intersectionWith + */ + intersectionWith( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + ...values: Array | Comparator2>, + ): LoDashExplicitWrapper; + + /** + * @see _.intersectionWith + */ + intersectionWith( + this: LoDashExplicitWrapper | null | undefined>, + ...values: Array> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/join.d.ts b/types/lodash/array/join.d.ts new file mode 100644 index 0000000000..2fd74dab4a --- /dev/null +++ b/types/lodash/array/join.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts all elements in `array` into a string separated by `separator`. + * + * @param array The array to convert. + * @param separator The element separator. + * @returns Returns the joined string. + */ + join( + array: List | null | undefined, + separator?: string + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.join + */ + join(separator?: string): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.join + */ + join(separator?: string): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/last.d.ts b/types/lodash/array/last.d.ts new file mode 100644 index 0000000000..4dcdb30423 --- /dev/null +++ b/types/lodash/array/last.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Gets the last element of array. + * + * @param array The array to query. + * @return Returns the last element of array. + */ + last(array: List | null | undefined): T | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.last + */ + last(this: LoDashImplicitWrapper | null | undefined>): T | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.last + */ + last(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/lastIndexOf.d.ts b/types/lodash/array/lastIndexOf.d.ts new file mode 100644 index 0000000000..4bcc38c947 --- /dev/null +++ b/types/lodash/array/lastIndexOf.d.ts @@ -0,0 +1,40 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.indexOf except that it iterates over elements of array from right to left. + * + * @param array The array to search. + * @param value The value to search for. + * @param fromIndex The index to search from or true to perform a binary search on a sorted array. + * @return Returns the index of the matched value, else -1. + */ + lastIndexOf( + array: List | null | undefined, + value: T, + fromIndex?: true|number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.indexOf + */ + lastIndexOf( + this: LoDashImplicitWrapper | null | undefined>, + value: T, + fromIndex?: true|number + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.indexOf + */ + lastIndexOf( + this: LoDashExplicitWrapper | null | undefined>, + value: T, + fromIndex?: true|number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/nth.d.ts b/types/lodash/array/nth.d.ts new file mode 100644 index 0000000000..50e5b209a3 --- /dev/null +++ b/types/lodash/array/nth.d.ts @@ -0,0 +1,36 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned. + * + * @param array array The array to query. + * @param value The index of the element to return. + * @return Returns the nth element of `array`. + */ + nth( + array: List | null | undefined, + n?: number + ): T | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.nth + */ + nth( + this: LoDashImplicitWrapper | null | undefined>, + n?: number + ): T | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.nth + */ + nth( + this: LoDashExplicitWrapper | null | undefined>, + n?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/pull.d.ts b/types/lodash/array/pull.d.ts new file mode 100644 index 0000000000..44ebc855c6 --- /dev/null +++ b/types/lodash/array/pull.d.ts @@ -0,0 +1,46 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Removes all provided values from array using SameValueZero for equality comparisons. + * + * Note: Unlike _.without, this method mutates array. + * + * @param array The array to modify. + * @param values The values to remove. + * @return Returns array. + */ + pull( + array: T[], + ...values: T[] + ): T[]; + + /** + * @see _.pull + */ + pull( + array: List, + ...values: T[] + ): List; + } + + interface LoDashImplicitWrapper { + /** + * @see _.pull + */ + pull( + this: LoDashImplicitWrapper>, + ...values: T[] + ): this; + } + + interface LoDashExplicitWrapper { + /** + * @see _.pull + */ + pull( + this: LoDashExplicitWrapper>, + ...values: T[] + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/array/pullAll.d.ts b/types/lodash/array/pullAll.d.ts new file mode 100644 index 0000000000..ce926b9bb3 --- /dev/null +++ b/types/lodash/array/pullAll.d.ts @@ -0,0 +1,54 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.pull` except that it accepts an array of values to remove. + * + * **Note:** Unlike `_.difference`, this method mutates `array`. + * + * @category Array + * @param array The array to modify. + * @param values The values to remove. + * @returns Returns `array`. + * @example + * + * var array = [1, 2, 3, 1, 2, 3]; + * + * _.pull(array, [2, 3]); + * console.log(array); + * // => [1, 1] + */ + pullAll( + array: T[], + values?: List, + ): T[]; + + /** + * @see _.pullAll + */ + pullAll( + array: List, + values?: List, + ): List; + } + + interface LoDashImplicitWrapper { + /** + * @see _.pullAll + */ + pullAll( + this: LoDashImplicitWrapper>, + values?: List + ): this; + } + + interface LoDashExplicitWrapper { + /** + * @see _.pullAll + */ + pullAll( + this: LoDashExplicitWrapper>, + values?: List + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/array/pullAllBy.d.ts b/types/lodash/array/pullAllBy.d.ts new file mode 100644 index 0000000000..3524aeae5e --- /dev/null +++ b/types/lodash/array/pullAllBy.d.ts @@ -0,0 +1,77 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.pullAll` except that it accepts `iteratee` which is + * invoked for each element of `array` and `values` to to generate the criterion + * by which uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * **Note:** Unlike `_.differenceBy`, this method mutates `array`. + * + * @category Array + * @param array The array to modify. + * @param values The values to remove. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns `array`. + * @example + * + * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * + * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); + * console.log(array); + * // => [{ 'x': 2 }] + */ + pullAllBy( + array: T[], + values?: List, + iteratee?: ValueIteratee + ): T[]; + + /** + * @see _.pullAllBy + */ + pullAllBy( + array: List, + values?: List, + iteratee?: ValueIteratee + ): List; + + /** + * @see _.pullAllBy + */ + pullAllBy( + array: T1[], + values: List, + iteratee: ValueIteratee + ): T1[]; + + /** + * @see _.pullAllBy + */ + pullAllBy( + array: List, + values: List, + iteratee: ValueIteratee + ): List; + } + + interface LoDashWrapper { + /** + * @see _.pullAllBy + */ + pullAllBy( + this: LoDashWrapper>, + values?: List, + iteratee?: ValueIteratee + ): this; + + /** + * @see _.pullAllBy + */ + pullAllBy( + this: LoDashWrapper>, + values: List, + iteratee: ValueIteratee + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/array/pullAllWith.d.ts b/types/lodash/array/pullAllWith.d.ts new file mode 100644 index 0000000000..345187daad --- /dev/null +++ b/types/lodash/array/pullAllWith.d.ts @@ -0,0 +1,77 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.pullAll` except that it accepts `comparator` which is + * invoked to compare elements of array to values. The comparator is invoked with + * two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * + * @category Array + * @param array The array to modify. + * @param values The values to remove. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns `array`. + * @example + * + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + */ + pullAllWith( + array: T[], + values?: List, + comparator?: Comparator + ): T[]; + + /** + * @see _.pullAllWith + */ + pullAllWith( + array: List, + values?: List, + comparator?: Comparator + ): List; + + /** + * @see _.pullAllWith + */ + pullAllWith( + array: T1[], + values: List, + comparator: Comparator2 + ): T1[]; + + /** + * @see _.pullAllWith + */ + pullAllWith( + array: List, + values: List, + comparator: Comparator2 + ): List; + } + + interface LoDashWrapper { + /** + * @see _.pullAllWith + */ + pullAllWith( + this: LoDashWrapper>, + values?: List, + comparator?: Comparator + ): this; + + /** + * @see _.pullAllWith + */ + pullAllWith( + this: LoDashWrapper>, + values: List, + comparator: Comparator2 + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/array/pullAt.d.ts b/types/lodash/array/pullAt.d.ts new file mode 100644 index 0000000000..a9d56f23ef --- /dev/null +++ b/types/lodash/array/pullAt.d.ts @@ -0,0 +1,34 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. + * Indexes may be specified as an array of indexes or as individual arguments. + * + * Note: Unlike _.at, this method mutates array. + * + * @param array The array to modify. + * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. + * @return Returns the new array of removed elements. + */ + pullAt( + array: T[], + ...indexes: Array> + ): T[]; + + /** + * @see _.pullAt + */ + pullAt( + array: List, + ...indexes: Array> + ): List; + } + + interface LoDashWrapper { + /** + * @see _.pullAt + */ + pullAt(...indexes: Array>): this; + } +} \ No newline at end of file diff --git a/types/lodash/array/remove.d.ts b/types/lodash/array/remove.d.ts new file mode 100644 index 0000000000..3ec0636972 --- /dev/null +++ b/types/lodash/array/remove.d.ts @@ -0,0 +1,49 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Removes all elements from array that predicate returns truthy for and returns an array of the removed + * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * Note: Unlike _.filter, this method mutates array. + * + * @param array The array to modify. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the new array of removed elements. + */ + remove( + array: List, + predicate?: ListIteratee + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.remove + */ + remove( + this: LoDashImplicitWrapper>, + predicate?: ListIteratee + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.remove + */ + remove( + this: LoDashExplicitWrapper>, + predicate?: ListIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/reverse.d.ts b/types/lodash/array/reverse.d.ts new file mode 100644 index 0000000000..0cf2112e24 --- /dev/null +++ b/types/lodash/array/reverse.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Reverses `array` so that the first element becomes the last, the second + * element becomes the second to last, and so on. + * + * **Note:** This method mutates `array` and is based on + * [`Array#reverse`](https://mdn.io/Array/reverse). + * + * @category Array + * @returns Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.reverse(array); + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + reverse>( + array: TList, + ): TList; + } +} \ No newline at end of file diff --git a/types/lodash/array/slice.d.ts b/types/lodash/array/slice.d.ts new file mode 100644 index 0000000000..7744c4b334 --- /dev/null +++ b/types/lodash/array/slice.d.ts @@ -0,0 +1,40 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a slice of array from start up to, but not including, end. + * + * @param array The array to slice. + * @param start The start position. + * @param end The end position. + * @return Returns the slice of array. + */ + slice( + array: List | null | undefined, + start?: number, + end?: number + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.slice + */ + slice( + this: LoDashImplicitWrapper | null | undefined>, + start?: number, + end?: number + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.slice + */ + slice( + this: LoDashExplicitWrapper | null | undefined>, + start?: number, + end?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/sortedIndex.d.ts b/types/lodash/array/sortedIndex.d.ts new file mode 100644 index 0000000000..5f8df282e6 --- /dev/null +++ b/types/lodash/array/sortedIndex.d.ts @@ -0,0 +1,45 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Uses a binary search to determine the lowest index at which `value` should + * be inserted into `array` in order to maintain its sort order. + * + * @category Array + * @param array The sorted array to inspect. + * @param value The value to evaluate. + * @returns Returns the index at which `value` should be inserted into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + * + * _.sortedIndex([4, 5], 4); + * // => 0 + */ + sortedIndex( + array: List | null | undefined, + value: T + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedIndex + */ + sortedIndex( + this: LoDashImplicitWrapper | null | undefined>, + value: T + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedIndex + */ + sortedIndex( + this: LoDashExplicitWrapper | null | undefined>, + value: T + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/sortedIndexBy.d.ts b/types/lodash/array/sortedIndexBy.d.ts new file mode 100644 index 0000000000..c4184868ca --- /dev/null +++ b/types/lodash/array/sortedIndexBy.d.ts @@ -0,0 +1,97 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Uses a binary search to determine the lowest index at which `value` should + * be inserted into `array` in order to maintain its sort order. + * + * @category Array + * @param array The sorted array to inspect. + * @param value The value to evaluate. + * @returns Returns the index at which `value` should be inserted into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + * + * _.sortedIndex([4, 5], 4); + * // => 0 + */ + sortedIndex( + array: List | null | undefined, + value: T + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedIndex + */ + sortedIndex( + this: LoDashImplicitWrapper | null | undefined>, + value: T + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedIndex + */ + sortedIndex( + this: LoDashExplicitWrapper | null | undefined>, + value: T + ): LoDashExplicitWrapper; + } + + // _.sortedIndexBy + interface LoDashStatic { + /** + * This method is like `_.sortedIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @category Array + * @param array The sorted array to inspect. + * @param value The value to evaluate. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns the index at which `value` should be inserted into `array`. + * @example + * + * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; + * + * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); + * // => 1 + * + * // using the `_.property` iteratee shorthand + * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); + * // => 0 + */ + sortedIndexBy( + array: List | null | undefined, + value: T, + iteratee?: ValueIteratee + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + this: LoDashImplicitWrapper | null | undefined>, + value: T, + iteratee?: ValueIteratee + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + this: LoDashExplicitWrapper | null | undefined>, + value: T, + iteratee?: ValueIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/sortedIndexOf.d.ts b/types/lodash/array/sortedIndexOf.d.ts new file mode 100644 index 0000000000..b391186178 --- /dev/null +++ b/types/lodash/array/sortedIndexOf.d.ts @@ -0,0 +1,42 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.indexOf` except that it performs a binary + * search on a sorted `array`. + * + * @category Array + * @param array The array to search. + * @param value The value to search for. + * @returns Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedIndexOf([1, 1, 2, 2], 2); + * // => 2 + */ + sortedIndexOf( + array: List | null | undefined, + value: T + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedIndexOf + */ + sortedIndexOf( + this: LoDashImplicitWrapper | null | undefined>, + value: T + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedIndexOf + */ + sortedIndexOf( + this: LoDashExplicitWrapper | null | undefined>, + value: T + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/sortedLastIndex.d.ts b/types/lodash/array/sortedLastIndex.d.ts new file mode 100644 index 0000000000..33b466ea5f --- /dev/null +++ b/types/lodash/array/sortedLastIndex.d.ts @@ -0,0 +1,43 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. + * + * @category Array + * @param array The sorted array to inspect. + * @param value The value to evaluate. + * @returns Returns the index at which `value` should be inserted into `array`. + * @example + * + * _.sortedLastIndex([4, 5], 4); + * // => 1 + */ + sortedLastIndex( + array: List | null | undefined, + value: T + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + this: LoDashImplicitWrapper | null | undefined>, + value: T + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + this: LoDashExplicitWrapper | null | undefined>, + value: T + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/sortedLastIndexBy.d.ts b/types/lodash/array/sortedLastIndexBy.d.ts new file mode 100644 index 0000000000..c0f8344292 --- /dev/null +++ b/types/lodash/array/sortedLastIndexBy.d.ts @@ -0,0 +1,48 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.sortedLastIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @category Array + * @param array The sorted array to inspect. + * @param value The value to evaluate. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns the index at which `value` should be inserted into `array`. + * @example + * + * // using the `_.property` iteratee shorthand + * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); + * // => 1 + */ + sortedLastIndexBy( + array: List | null | undefined, + value: T, + iteratee: ValueIteratee + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + this: LoDashImplicitWrapper | null | undefined>, + value: T, + iteratee: ValueIteratee + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + this: LoDashExplicitWrapper | null | undefined>, + value: T, + iteratee: ValueIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/sortedLastIndexOf.d.ts b/types/lodash/array/sortedLastIndexOf.d.ts new file mode 100644 index 0000000000..09f8099d1f --- /dev/null +++ b/types/lodash/array/sortedLastIndexOf.d.ts @@ -0,0 +1,42 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.lastIndexOf` except that it performs a binary + * search on a sorted `array`. + * + * @category Array + * @param array The array to search. + * @param value The value to search for. + * @returns Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedLastIndexOf([1, 1, 2, 2], 2); + * // => 3 + */ + sortedLastIndexOf( + array: List | null | undefined, + value: T + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedLastIndexOf + */ + sortedLastIndexOf( + this: LoDashImplicitWrapper | null | undefined>, + value: T + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedLastIndexOf + */ + sortedLastIndexOf( + this: LoDashExplicitWrapper | null | undefined>, + value: T + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/sortedUniq.d.ts b/types/lodash/array/sortedUniq.d.ts new file mode 100644 index 0000000000..df0487d626 --- /dev/null +++ b/types/lodash/array/sortedUniq.d.ts @@ -0,0 +1,34 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. + * + * @category Array + * @param array The array to inspect. + * @returns Returns the new duplicate free array. + * @example + * + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] + */ + sortedUniq( + array: List | null | undefined + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedUniq + */ + sortedUniq(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedUniq + */ + sortedUniq(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/sortedUniqBy.d.ts b/types/lodash/array/sortedUniqBy.d.ts new file mode 100644 index 0000000000..054d4e38c9 --- /dev/null +++ b/types/lodash/array/sortedUniqBy.d.ts @@ -0,0 +1,66 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. + * + * @category Array + * @param array The array to inspect. + * @param [iteratee] The iteratee invoked per element. + * @returns Returns the new duplicate free array. + * @example + * + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.2] + */ + sortedUniqBy( + array: string | null | undefined, + iteratee: StringIterator + ): string[]; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + array: List | null | undefined, + iteratee: ListIteratee + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + this: LoDashImplicitWrapper, + iteratee: StringIterator + ): LoDashImplicitWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: ListIteratee + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + this: LoDashExplicitWrapper, + iteratee: StringIterator + ): LoDashExplicitWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: ListIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/tail.d.ts b/types/lodash/array/tail.d.ts new file mode 100644 index 0000000000..8716c9a2f8 --- /dev/null +++ b/types/lodash/array/tail.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Gets all but the first element of array. + * + * @param array The array to query. + * @return Returns the slice of array. + */ + tail(array: List | null | undefined): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.tail + */ + tail(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.tail + */ + tail(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/take.d.ts b/types/lodash/array/take.d.ts new file mode 100644 index 0000000000..a97ff6b4ef --- /dev/null +++ b/types/lodash/array/take.d.ts @@ -0,0 +1,36 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a slice of array with n elements taken from the beginning. + * + * @param array The array to query. + * @param n The number of elements to take. + * @return Returns the slice of array. + */ + take( + array: List | null | undefined, + n?: number + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.take + */ + take( + this: LoDashImplicitWrapper | null | undefined>, + n?: number + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.take + */ + take( + this: LoDashExplicitWrapper | null | undefined>, + n?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/takeRight.d.ts b/types/lodash/array/takeRight.d.ts new file mode 100644 index 0000000000..c786ab40c0 --- /dev/null +++ b/types/lodash/array/takeRight.d.ts @@ -0,0 +1,36 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a slice of array with n elements taken from the end. + * + * @param array The array to query. + * @param n The number of elements to take. + * @return Returns the slice of array. + */ + takeRight( + array: List | null | undefined, + n?: number + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.takeRight + */ + takeRight( + this: LoDashImplicitWrapper | null | undefined>, + n?: number + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.takeRight + */ + takeRight( + this: LoDashExplicitWrapper | null | undefined>, + n?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/takeRightWhile.d.ts b/types/lodash/array/takeRightWhile.d.ts new file mode 100644 index 0000000000..471c0a03f3 --- /dev/null +++ b/types/lodash/array/takeRightWhile.d.ts @@ -0,0 +1,47 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns + * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param array The array to query. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the slice of array. + */ + takeRightWhile( + array: List | null | undefined, + predicate?: ListIteratee + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.takeRightWhile + */ + takeRightWhile( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIteratee + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.takeRightWhile + */ + takeRightWhile( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/takeWhile.d.ts b/types/lodash/array/takeWhile.d.ts new file mode 100644 index 0000000000..05e6adc2a4 --- /dev/null +++ b/types/lodash/array/takeWhile.d.ts @@ -0,0 +1,47 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns + * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param array The array to query. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the slice of array. + */ + takeWhile( + array: List | null | undefined, + predicate?: ListIteratee + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.takeWhile + */ + takeWhile( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIteratee + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.takeWhile + */ + takeWhile( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/union.d.ts b/types/lodash/array/union.d.ts new file mode 100644 index 0000000000..f747a97da0 --- /dev/null +++ b/types/lodash/array/union.d.ts @@ -0,0 +1,33 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for + * equality comparisons. + * + * @param arrays The arrays to inspect. + * @return Returns the new array of combined values. + */ + union(...arrays: Array | null | undefined>): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.union + */ + union( + this: LoDashImplicitWrapper | null | undefined>, + ...arrays: Array | null | undefined> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.union + */ + union( + this: LoDashExplicitWrapper | null | undefined>, + ...arrays: Array | null | undefined> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/unionBy.d.ts b/types/lodash/array/unionBy.d.ts new file mode 100644 index 0000000000..5e5cd40647 --- /dev/null +++ b/types/lodash/array/unionBy.d.ts @@ -0,0 +1,164 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by which + * uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * @param arrays The arrays to inspect. + * @param iteratee The iteratee invoked per element. + * @return Returns the new array of combined values. + */ + unionBy( + arrays: List | null | undefined, + iteratee?: ValueIteratee + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: List | null | undefined, + arrays2: List | null | undefined, + iteratee?: ValueIteratee + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: List | null | undefined, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + iteratee?: ValueIteratee + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: List | null | undefined, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + arrays4: List | null | undefined, + iteratee?: ValueIteratee + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: List | null | undefined, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + arrays4: List | null | undefined, + arrays5: List | null | undefined, + ...iteratee: Array | List | null | undefined> + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.unionBy + */ + unionBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.unionBy + */ + unionBy( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + iteratee?: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.unionBy + */ + unionBy( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + iteratee?: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.unionBy + */ + unionBy( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + arrays4: List | null | undefined, + iteratee?: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.unionBy + */ + unionBy( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + arrays4: List | null | undefined, + arrays5: List | null | undefined, + ...iteratee: Array | List | null | undefined> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.unionBy + */ + unionBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.unionBy + */ + unionBy( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + iteratee?: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.unionBy + */ + unionBy( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + iteratee?: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.unionBy + */ + unionBy( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + arrays4: List | null | undefined, + iteratee?: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.unionBy + */ + unionBy( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + arrays4: List | null | undefined, + arrays5: List | null | undefined, + ...iteratee: Array | List | null | undefined> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/unionWith.d.ts b/types/lodash/array/unionWith.d.ts new file mode 100644 index 0000000000..4778a4a6c7 --- /dev/null +++ b/types/lodash/array/unionWith.d.ts @@ -0,0 +1,103 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.union` except that it accepts `comparator` which + * is invoked to compare elements of `arrays`. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @category Array + * @param [arrays] The arrays to inspect. + * @param [comparator] The comparator invoked per element. + * @returns Returns the new array of combined values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.unionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + unionWith( + arrays: List | null | undefined, + comparator?: Comparator + ): T[]; + + /** + * @see _.unionBy + */ + unionWith( + arrays: List | null | undefined, + arrays2: List | null | undefined, + comparator?: Comparator + ): T[]; + + /** + * @see _.unionWith + */ + unionWith( + arrays: List | null | undefined, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + ...comparator: Array | List | null | undefined> + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.unionWith + */ + unionWith( + this: LoDashImplicitWrapper | null | undefined>, + comparator?: Comparator + ): LoDashImplicitWrapper; + + /** + * @see _.unionWith + */ + unionWith( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + comparator?: Comparator + ): LoDashImplicitWrapper; + + /** + * @see _.unionWith + */ + unionWith( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + ...comparator: Array | List | null | undefined> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.unionWith + */ + unionWith( + this: LoDashExplicitWrapper | null | undefined>, + comparator?: Comparator + ): LoDashExplicitWrapper; + + /** + * @see _.unionWith + */ + unionWith( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + comparator?: Comparator + ): LoDashExplicitWrapper; + + /** + * @see _.unionWith + */ + unionWith( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + ...comparator: Array | List | null | undefined> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/uniq.d.ts b/types/lodash/array/uniq.d.ts new file mode 100644 index 0000000000..5dacb3b37b --- /dev/null +++ b/types/lodash/array/uniq.d.ts @@ -0,0 +1,36 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each element + * is kept. + * + * @category Array + * @param array The array to inspect. + * @returns Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + */ + uniq( + array: List | null | undefined + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.uniq + */ + uniq(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.uniq + */ + uniq(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/uniqBy.d.ts b/types/lodash/array/uniqBy.d.ts new file mode 100644 index 0000000000..13df8cb7db --- /dev/null +++ b/types/lodash/array/uniqBy.d.ts @@ -0,0 +1,71 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * @category Array + * @param array The array to inspect. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns the new duplicate free array. + * @example + * + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // using the `_.property` iteratee shorthand + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + uniqBy( + array: string | null | undefined, + iteratee: StringIterator + ): string[]; + + /** + * @see _.uniqBy + */ + uniqBy( + array: List | null | undefined, + iteratee: ListIteratee + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.uniqBy + */ + uniqBy( + this: LoDashImplicitWrapper, + iteratee: StringIterator + ): LoDashImplicitWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: ListIteratee + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.uniqBy + */ + uniqBy( + this: LoDashExplicitWrapper, + iteratee: StringIterator + ): LoDashExplicitWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: ListIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/uniqWith.d.ts b/types/lodash/array/uniqWith.d.ts new file mode 100644 index 0000000000..3d4d24334f --- /dev/null +++ b/types/lodash/array/uniqWith.d.ts @@ -0,0 +1,45 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.uniq` except that it accepts `comparator` which + * is invoked to compare elements of `array`. The comparator is invoked with + * two arguments: (arrVal, othVal). + * + * @category Array + * @param array The array to inspect. + * @param [comparator] The comparator invoked per element. + * @returns Returns the new duplicate free array. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.uniqWith(objects, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + */ + uniqWith( + array: List | null | undefined, + comparator?: Comparator + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.uniqWith + */ + uniqWith( + this: LoDashImplicitWrapper | null | undefined>, + comparator?: Comparator + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.uniqWith + */ + uniqWith( + this: LoDashExplicitWrapper | null | undefined>, + comparator?: Comparator + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/unzip.d.ts b/types/lodash/array/unzip.d.ts new file mode 100644 index 0000000000..ca96290da5 --- /dev/null +++ b/types/lodash/array/unzip.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.zip except that it accepts an array of grouped elements and creates an array + * regrouping the elements to their pre-zip configuration. + * + * @param array The array of grouped elements to process. + * @return Returns the new array of regrouped elements. + */ + unzip(array: T[][] | List> | null | undefined): T[][]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.unzip + */ + unzip(this: LoDashImplicitWrapper> | null | undefined>): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.unzip + */ + unzip(this: LoDashExplicitWrapper> | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/unzipWith.d.ts b/types/lodash/array/unzipWith.d.ts new file mode 100644 index 0000000000..0608c97bd9 --- /dev/null +++ b/types/lodash/array/unzipWith.d.ts @@ -0,0 +1,60 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be + * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, + * group). + * + * @param array The array of grouped elements to process. + * @param iteratee The function to combine regrouped values. + * @param thisArg The this binding of iteratee. + * @return Returns the new array of regrouped elements. + */ + unzipWith( + array: List> | null | undefined, + iteratee: (...values: T[]) => TResult + ): TResult[]; + + /** + * @see _.unzipWith + */ + unzipWith( + array: List> | null | undefined + ): T[][]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.unzipWith + */ + unzipWith( + this: LoDashImplicitWrapper> | null | undefined>, + iteratee: (...values: T[]) => TResult + ): LoDashImplicitWrapper; + + /** + * @see _.unzipWith + */ + unzipWith( + this: LoDashImplicitWrapper> | null | undefined> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.unzipWith + */ + unzipWith( + this: LoDashExplicitWrapper> | null | undefined>, + iteratee: (...values: T[]) => TResult + ): LoDashExplicitWrapper; + + /** + * @see _.unzipWith + */ + unzipWith( + this: LoDashExplicitWrapper> | null | undefined> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/without.d.ts b/types/lodash/array/without.d.ts new file mode 100644 index 0000000000..ced52397ee --- /dev/null +++ b/types/lodash/array/without.d.ts @@ -0,0 +1,36 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array excluding all provided values using SameValueZero for equality comparisons. + * + * @param array The array to filter. + * @param values The values to exclude. + * @return Returns the new array of filtered values. + */ + without( + array: List | null | undefined, + ...values: T[] + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.without + */ + without( + this: LoDashImplicitWrapper | null | undefined>, + ...values: T[] + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.without + */ + without( + this: LoDashExplicitWrapper | null | undefined>, + ...values: T[] + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/xor.d.ts b/types/lodash/array/xor.d.ts new file mode 100644 index 0000000000..5369888326 --- /dev/null +++ b/types/lodash/array/xor.d.ts @@ -0,0 +1,32 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of unique values that is the symmetric difference of the provided arrays. + * + * @param arrays The arrays to inspect. + * @return Returns the new array of values. + */ + xor(...arrays: Array | null | undefined>): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.xor + */ + xor( + this: LoDashImplicitWrapper | null | undefined>, + ...arrays: Array | null | undefined> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.xor + */ + xor( + this: LoDashExplicitWrapper | null | undefined>, + ...arrays: Array | null | undefined> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/xorBy.d.ts b/types/lodash/array/xorBy.d.ts new file mode 100644 index 0000000000..1be5c1284b --- /dev/null +++ b/types/lodash/array/xorBy.d.ts @@ -0,0 +1,104 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.xor` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by which + * uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * @category Array + * @param [arrays] The arrays to inspect. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns the new array of values. + * @example + * + * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); + * // => [1.2, 4.3] + * + * // using the `_.property` iteratee shorthand + * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + xorBy( + arrays: List | null | undefined, + iteratee?: ValueIteratee + ): T[]; + + /** + * @see _.xorBy + */ + xorBy( + arrays: List | null | undefined, + arrays2: List | null | undefined, + iteratee?: ValueIteratee + ): T[]; + + /** + * @see _.xorBy + */ + xorBy( + arrays: List | null | undefined, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + ...iteratee: Array | List | null | undefined> + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.xor + */ + xorBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.xorBy + */ + xorBy( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + iteratee?: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.xorBy + */ + xorBy( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + ...iteratee: Array | List | null | undefined> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.xorBy + */ + xorBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.xorBy + */ + xorBy( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + iteratee?: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.xorBy + */ + xorBy( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + ...iteratee: Array | List | null | undefined> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/xorWith.d.ts b/types/lodash/array/xorWith.d.ts new file mode 100644 index 0000000000..0963a31da7 --- /dev/null +++ b/types/lodash/array/xorWith.d.ts @@ -0,0 +1,103 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.xor` except that it accepts `comparator` which is + * invoked to compare elements of `arrays`. The comparator is invoked with + * two arguments: (arrVal, othVal). + * + * @category Array + * @param [arrays] The arrays to inspect. + * @param [comparator] The comparator invoked per element. + * @returns Returns the new array of values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.xorWith(objects, others, _.isEqual); + * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + xorWith( + arrays: List | null | undefined, + comparator?: Comparator + ): T[]; + + /** + * @see _.xorWith + */ + xorWith( + arrays: List | null | undefined, + arrays2: List | null | undefined, + comparator?: Comparator + ): T[]; + + /** + * @see _.xorWith + */ + xorWith( + arrays: List | null | undefined, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + ...comparator: Array | List | null | undefined> + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.xorWith + */ + xorWith( + this: LoDashImplicitWrapper | null | undefined>, + comparator?: Comparator + ): LoDashImplicitWrapper; + + /** + * @see _.xorWith + */ + xorWith( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + comparator?: Comparator + ): LoDashImplicitWrapper; + + /** + * @see _.xorWith + */ + xorWith( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + ...comparator: Array | List | null | undefined> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.xorWith + */ + xorWith( + this: LoDashExplicitWrapper | null | undefined>, + comparator?: Comparator + ): LoDashExplicitWrapper; + + /** + * @see _.xorWith + */ + xorWith( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + comparator?: Comparator + ): LoDashExplicitWrapper; + + /** + * @see _.xorWith + */ + xorWith( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + ...comparator: Array | List | null | undefined> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/zip.d.ts b/types/lodash/array/zip.d.ts new file mode 100644 index 0000000000..bf4e436dbf --- /dev/null +++ b/types/lodash/array/zip.d.ts @@ -0,0 +1,129 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of grouped elements, the first of which contains the first elements of the given arrays, + * the second of which contains the second elements of the given arrays, and so on. + * + * @param arrays The arrays to process. + * @return Returns the new array of grouped elements. + */ + zip(arrays1: List, arrays2: List): Array<[T1 | undefined, T2 | undefined]>; + + /** + * @see _.zip + */ + zip(arrays1: List, arrays2: List, arrays3: List): Array<[T1 | undefined, T2 | undefined, T3 | undefined]>; + + /** + * @see _.zip + */ + zip(arrays1: List, arrays2: List, arrays3: List, arrays4: List): Array<[T1 | undefined, T2 | undefined, T3 | undefined, T4 | undefined]>; + + /** + * @see _.zip + */ + zip(arrays1: List, arrays2: List, arrays3: List, arrays4: List, arrays5: List): Array<[T1 | undefined, T2 | undefined, T3 | undefined, T4 | undefined, T5 | undefined]>; + + /** + * @see _.zip + */ + zip(...arrays: Array | null | undefined>): (T | undefined)[][]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.zip + */ + zip( + this: LoDashImplicitWrapper>, + arrays2: List, + ): LoDashImplicitWrapper>; + + /** + * @see _.zip + */ + zip( + this: LoDashImplicitWrapper>, + arrays2: List, + arrays3: List, + ): LoDashImplicitWrapper>; + + /** + * @see _.zip + */ + zip( + this: LoDashImplicitWrapper>, + arrays2: List, + arrays3: List, + arrays4: List, + ): LoDashImplicitWrapper>; + + /** + * @see _.zip + */ + zip( + this: LoDashImplicitWrapper>, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, + ): LoDashImplicitWrapper>; + + /** + * @see _.zip + */ + zip( + this: LoDashImplicitWrapper | null | undefined>, + ...arrays: Array | null | undefined> + ): LoDashImplicitWrapper>>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.zip + */ + zip( + this: LoDashExplicitWrapper>, + arrays2: List, + ): LoDashExplicitWrapper>; + + /** + * @see _.zip + */ + zip( + this: LoDashExplicitWrapper>, + arrays2: List, + arrays3: List, + ): LoDashExplicitWrapper>; + + /** + * @see _.zip + */ + zip( + this: LoDashExplicitWrapper>, + arrays2: List, + arrays3: List, + arrays4: List, + ): LoDashExplicitWrapper>; + + /** + * @see _.zip + */ + zip( + this: LoDashExplicitWrapper>, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, + ): LoDashExplicitWrapper>; + + /** + * @see _.zip + */ + zip( + this: LoDashExplicitWrapper | null | undefined>, + ...arrays: Array | null | undefined> + ): LoDashExplicitWrapper>>; + } +} diff --git a/types/lodash/array/zipObject.d.ts b/types/lodash/array/zipObject.d.ts new file mode 100644 index 0000000000..cf7c35e96a --- /dev/null +++ b/types/lodash/array/zipObject.d.ts @@ -0,0 +1,58 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.fromPairs except that it accepts two arrays, one of property + * identifiers and one of corresponding values. + * + * @param props The property names. + * @param values The property values. + * @return Returns the new object. + */ + zipObject( + props: List, + values: List + ): Dictionary; + + /** + * @see _.zipObject + */ + zipObject( + props?: List + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.zipObject + */ + zipObject( + this: LoDashImplicitWrapper>, + values: List + ): LoDashImplicitWrapper>; + + /** + * @see _.zipObject + */ + zipObject( + this: LoDashImplicitWrapper> + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.zipObject + */ + zipObject( + this: LoDashExplicitWrapper>, + values: List + ): LoDashExplicitWrapper>; + + /** + * @see _.zipObject + */ + zipObject( + this: LoDashExplicitWrapper> + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/array/zipObjectDeep.d.ts b/types/lodash/array/zipObjectDeep.d.ts new file mode 100644 index 0000000000..a91117e705 --- /dev/null +++ b/types/lodash/array/zipObjectDeep.d.ts @@ -0,0 +1,36 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.zipObject except that it supports property paths. + * + * @param paths The property names. + * @param values The property values. + * @return Returns the new object. + */ + zipObjectDeep( + paths?: List, + values?: List + ): object; + } + + interface LoDashImplicitWrapper { + /** + * @see _.zipObjectDeep + */ + zipObjectDeep( + this: LoDashImplicitWrapper>, + values?: List + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.zipObjectDeep + */ + zipObjectDeep( + this: LoDashExplicitWrapper>, + values?: List + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/zipWith.d.ts b/types/lodash/array/zipWith.d.ts new file mode 100644 index 0000000000..31e080b056 --- /dev/null +++ b/types/lodash/array/zipWith.d.ts @@ -0,0 +1,187 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be + * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, + * group). + * @param [arrays] The arrays to process. + * @param [iteratee] The function to combine grouped values. + * @param [thisArg] The `this` binding of `iteratee`. + * @return Returns the new array of grouped elements. + */ + zipWith( + arrays: List, + iteratee: (value1: T) => TResult + ): TResult[]; + + /** + * @see _.zipWith + */ + zipWith( + arrays1: List, + arrays2: List, + iteratee: (value1: T1, value2: T2) => TResult + ): TResult[]; + + /** + * @see _.zipWith + */ + zipWith( + arrays1: List, + arrays2: List, + arrays3: List, + iteratee: (value1: T1, value2: T2, value3: T3) => TResult + ): TResult[]; + + /** + * @see _.zipWith + */ + zipWith( + arrays1: List, + arrays2: List, + arrays3: List, + arrays4: List, + iteratee: (value1: T1, value2: T2, value3: T3, value4: T4) => TResult + ): TResult[]; + + /** + * @see _.zipWith + */ + zipWith( + arrays1: List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, + iteratee: (value1: T1, value2: T2, value3: T3, value4: T4, value5: T5) => TResult + ): TResult[]; + + /** + * @see _.zipWith + */ + zipWith( + ...iteratee: Array<((...group: T[]) => TResult) | List | null | undefined> + ): TResult[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.zipWith + */ + zipWith( + this: LoDashImplicitWrapper>, + iteratee: (value1: T) => TResult + ): LoDashImplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashImplicitWrapper>, + arrays2: List, + iteratee: (value1: T1, value2: T2) => TResult + ): LoDashImplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashImplicitWrapper>, + arrays2: List, + arrays3: List, + iteratee: (value1: T1, value2: T2, value3: T3) => TResult + ): LoDashImplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashImplicitWrapper>, + arrays2: List, + arrays3: List, + arrays4: List, + iteratee: (value1: T1, value2: T2, value3: T3, value4: T4) => TResult + ): LoDashImplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashImplicitWrapper>, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, + iteratee: (value1: T1, value2: T2, value3: T3, value4: T4, value5: T5) => TResult + ): LoDashImplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashImplicitWrapper | null | undefined>, + ...iteratee: Array<((...group: T[]) => TResult) | List | null | undefined> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.zipWith + */ + zipWith( + this: LoDashExplicitWrapper>, + iteratee: (value1: T) => TResult + ): LoDashExplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashExplicitWrapper>, + arrays2: List, + iteratee: (value1: T1, value2: T2) => TResult + ): LoDashExplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashExplicitWrapper>, + arrays2: List, + arrays3: List, + iteratee: (value1: T1, value2: T2, value3: T3) => TResult + ): LoDashExplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashExplicitWrapper>, + arrays2: List, + arrays3: List, + arrays4: List, + iteratee: (value1: T1, value2: T2, value3: T3, value4: T4) => TResult + ): LoDashExplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashExplicitWrapper>, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, + iteratee: (value1: T1, value2: T2, value3: T3, value4: T4, value5: T5) => TResult + ): LoDashExplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashExplicitWrapper | null | undefined>, + ...iteratee: Array<((...group: T[]) => TResult) | List | null | undefined> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/countBy.d.ts b/types/lodash/collection/countBy.d.ts new file mode 100644 index 0000000000..7c7ca9e03a --- /dev/null +++ b/types/lodash/collection/countBy.d.ts @@ -0,0 +1,121 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an object composed of keys generated from the results of running each element of collection through + * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The + * iteratee is bound to thisArg and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for iteratee the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for iteratee the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the composed aggregate object. + */ + countBy( + collection: string | null | undefined, + iteratee?: StringIterator + ): Dictionary; + + /** + * @see _.countBy + */ + countBy( + collection: List | null | undefined, + iteratee?: ListIteratee + ): Dictionary; + + /** + * @see _.countBy + */ + countBy( + collection: NumericDictionary | null | undefined, + iteratee?: NumericDictionaryIteratee + ): Dictionary; + + /** + * @see _.countBy + */ + countBy( + collection: T | null | undefined, + iteratee?: ObjectIteratee + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.countBy + */ + countBy( + this: LoDashImplicitWrapper, + iteratee?: StringIterator + ): LoDashImplicitWrapper>; + + /** + * @see _.countBy + */ + countBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): LoDashImplicitWrapper>; + + /** + * @see _.countBy + */ + countBy( + this: LoDashImplicitWrapper, + iteratee?: ObjectIteratee + ): LoDashImplicitWrapper>; + + /** + * @see _.countBy + */ + countBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: NumericDictionaryIteratee + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.countBy + */ + countBy( + this: LoDashExplicitWrapper, + iteratee?: StringIterator + ): LoDashExplicitWrapper>; + + /** + * @see _.countBy + */ + countBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): LoDashExplicitWrapper>; + + /** + * @see _.countBy + */ + countBy( + this: LoDashExplicitWrapper, + iteratee?: ObjectIteratee + ): LoDashExplicitWrapper>; + + /** + * @see _.countBy + */ + countBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: NumericDictionaryIteratee + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/collection/each.d.ts b/types/lodash/collection/each.d.ts new file mode 100644 index 0000000000..9777780edc --- /dev/null +++ b/types/lodash/collection/each.d.ts @@ -0,0 +1,40 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + each: typeof _.forEach; // tslint:disable-line:no-unnecessary-qualifier + } + + interface LoDashWrapper { + /** + * @see _.forEach + */ + each( + this: LoDashWrapper, + iteratee?: ArrayIterator + ): this; + + /** + * @see _.forEach + */ + each( + this: LoDashWrapper, + iteratee?: StringIterator + ): this; + + /** + * @see _.forEach + */ + each( + this: LoDashWrapper | null | undefined>, + iteratee?: ListIterator + ): this; + + /** + * @see _.forEach + */ + each( + this: LoDashWrapper, + iteratee?: ObjectIterator + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/collection/eachRight.d.ts b/types/lodash/collection/eachRight.d.ts new file mode 100644 index 0000000000..15e3007af5 --- /dev/null +++ b/types/lodash/collection/eachRight.d.ts @@ -0,0 +1,40 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + eachRight: typeof _.forEachRight; // tslint:disable-line:no-unnecessary-qualifier + } + + interface LoDashWrapper { + /** + * @see _.forEachRight + */ + eachRight( + this: LoDashWrapper, + iteratee?: ArrayIterator + ): this; + + /** + * @see _.forEachRight + */ + eachRight( + this: LoDashWrapper, + iteratee?: StringIterator + ): this; + + /** + * @see _.forEachRight + */ + eachRight( + this: LoDashWrapper | null | undefined>, + iteratee?: ListIterator + ): this; + + /** + * @see _.forEachRight + */ + eachRight( + this: LoDashWrapper, + iteratee?: ObjectIterator + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/collection/every.d.ts b/types/lodash/collection/every.d.ts new file mode 100644 index 0000000000..42062a74ad --- /dev/null +++ b/types/lodash/collection/every.d.ts @@ -0,0 +1,85 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate + * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). + * + * @param collection The collection to iterate over. + * @param predicate The function invoked per iteration. + * @return Returns true if all elements pass the predicate check, else false. + */ + every( + collection: List | null | undefined, + predicate?: ListIterateeCustom + ): boolean; + + /** + * @see _.every + */ + every( + collection: NumericDictionary | null | undefined, + predicate?: NumericDictionaryIterateeCustom + ): boolean; + + /** + * @see _.every + */ + every( + collection: T | null | undefined, + predicate?: ObjectIterateeCustom + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.every + */ + every( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom + ): boolean; + + /** + * @see _.every + */ + every( + this: LoDashImplicitWrapper, + predicate?: ObjectIterateeCustom + ): boolean; + + /** + * @see _.every + */ + every( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: NumericDictionaryIterateeCustom + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.every + */ + every( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom + ): LoDashExplicitWrapper; + + /** + * @see _.every + */ + every( + this: LoDashExplicitWrapper, + predicate?: ObjectIterateeCustom + ): LoDashExplicitWrapper; + + /** + * @see _.every + */ + every( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: NumericDictionaryIterateeCustom + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/filter.d.ts b/types/lodash/collection/filter.d.ts new file mode 100644 index 0000000000..0f60654127 --- /dev/null +++ b/types/lodash/collection/filter.d.ts @@ -0,0 +1,143 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The + * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the new filtered array. + */ + filter( + collection: string | null | undefined, + predicate?: StringIterator + ): string[]; + + /** + * @see _.filter + */ + filter( + collection: List | null | undefined, + predicate: ListIteratorTypeGuard + ): S[]; + + /** + * @see _.filter + */ + filter( + collection: List | null | undefined, + predicate?: ListIterateeCustom + ): T[]; + + /** + * @see _.filter + */ + filter( + collection: T | null | undefined, + predicate: ObjectIteratorTypeGuard + ): S[]; + + /** + * @see _.filter + */ + filter( + collection: T | null | undefined, + predicate?: ObjectIterateeCustom + ): Array; + } + + interface LoDashImplicitWrapper { + /** + * @see _.filter + */ + filter( + this: LoDashImplicitWrapper, + predicate?: StringIterator + ): LoDashImplicitWrapper; + + /** + * @see _.filter + */ + filter( + this: LoDashImplicitWrapper | null | undefined>, + predicate: ListIteratorTypeGuard + ): LoDashImplicitWrapper; + + /** + * @see _.filter + */ + filter( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom + ): LoDashImplicitWrapper; + + /** + * @see _.filter + */ + filter( + this: LoDashImplicitWrapper, + predicate: ObjectIteratorTypeGuard + ): LoDashImplicitWrapper; + + /** + * @see _.filter + */ + filter( + this: LoDashImplicitWrapper, + predicate?: ObjectIterateeCustom + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.filter + */ + filter( + this: LoDashExplicitWrapper, + predicate?: StringIterator + ): LoDashExplicitWrapper; + + /** + * @see _.filter + */ + filter( + this: LoDashExplicitWrapper | null | undefined>, + predicate: ListIteratorTypeGuard + ): LoDashExplicitWrapper; + + /** + * @see _.filter + */ + filter( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom + ): LoDashExplicitWrapper; + + /** + * @see _.filter + */ + filter( + this: LoDashExplicitWrapper, + predicate: ObjectIteratorTypeGuard + ): LoDashExplicitWrapper; + + /** + * @see _.filter + */ + filter( + this: LoDashExplicitWrapper, + predicate?: ObjectIterateeCustom + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/collection/find.d.ts b/types/lodash/collection/find.d.ts new file mode 100644 index 0000000000..25bfc77efc --- /dev/null +++ b/types/lodash/collection/find.d.ts @@ -0,0 +1,131 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Iterates over elements of collection, returning the first element predicate returns truthy for. + * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to search. + * @param predicate The function invoked per iteration. + * @param fromIndex The index to search from. + * @return Returns the matched element, else undefined. + */ + find( + collection: List | null | undefined, + predicate: ListIteratorTypeGuard, + fromIndex?: number + ): S|undefined; + + /** + * @see _.find + */ + find( + collection: List | null | undefined, + predicate?: ListIterateeCustom, + fromIndex?: number + ): T|undefined; + + /** + * @see _.find + */ + find( + collection: T | null | undefined, + predicate: ObjectIteratorTypeGuard, + fromIndex?: number + ): S|undefined; + + /** + * @see _.find + */ + find( + collection: T | null | undefined, + predicate?: ObjectIterateeCustom, + fromIndex?: number + ): T[keyof T]|undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.find + */ + find( + this: LoDashImplicitWrapper | null | undefined>, + predicate: ListIteratorTypeGuard, + fromIndex?: number + ): S|undefined; + + /** + * @see _.find + */ + find( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom, + fromIndex?: number + ): T|undefined; + + /** + * @see _.find + */ + find( + this: LoDashImplicitWrapper, + predicate: ObjectIteratorTypeGuard, + fromIndex?: number + ): S|undefined; + + /** + * @see _.find + */ + find( + this: LoDashImplicitWrapper, + predicate?: ObjectIterateeCustom, + fromIndex?: number + ): T[keyof T]|undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.find + */ + find( + this: LoDashExplicitWrapper | null | undefined>, + predicate: ListIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitWrapper; + + /** + * @see _.find + */ + find( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitWrapper; + + /** + * @see _.find + */ + find( + this: LoDashExplicitWrapper, + predicate: ObjectIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitWrapper; + + /** + * @see _.find + */ + find( + this: LoDashExplicitWrapper, + predicate?: ObjectIterateeCustom, + fromIndex?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/findLast.d.ts b/types/lodash/collection/findLast.d.ts new file mode 100644 index 0000000000..edbcf971e4 --- /dev/null +++ b/types/lodash/collection/findLast.d.ts @@ -0,0 +1,121 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.find except that it iterates over elements of a collection from + * right to left. + * @param collection Searches for a value in this list. + * @param predicate The function called per iteration. + * @param fromIndex The index to search from. + * @return The found element, else undefined. + **/ + findLast( + collection: List | null | undefined, + predicate: ListIteratorTypeGuard, + fromIndex?: number + ): S|undefined; + + /** + * @see _.findLast + */ + findLast( + collection: List | null | undefined, + predicate?: ListIterateeCustom, + fromIndex?: number + ): T|undefined; + + /** + * @see _.findLast + */ + findLast( + collection: T | null | undefined, + predicate: ObjectIteratorTypeGuard, + fromIndex?: number + ): S|undefined; + + /** + * @see _.findLast + */ + findLast( + collection: T | null | undefined, + predicate?: ObjectIterateeCustom, + fromIndex?: number + ): T[keyof T]|undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.findLast + */ + findLast( + this: LoDashImplicitWrapper | null | undefined>, + predicate: ListIteratorTypeGuard, + fromIndex?: number + ): S | undefined; + + /** + * @see _.findLast + */ + findLast( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom, + fromIndex?: number + ): T | undefined; + + /** + * @see _.findLast + */ + findLast( + this: LoDashImplicitWrapper, + predicate: ObjectIteratorTypeGuard, + fromIndex?: number + ): S|undefined; + + /** + * @see _.findLast + */ + findLast( + this: LoDashImplicitWrapper, + predicate?: ObjectIterateeCustom, + fromIndex?: number + ): T[keyof T]|undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.findLast + */ + findLast( + this: LoDashExplicitWrapper | null | undefined>, + predicate: ListIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitWrapper; + + /** + * @see _.findLast + */ + findLast( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitWrapper; + + /** + * @see _.findLast + */ + findLast( + this: LoDashExplicitWrapper, + predicate: ObjectIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitWrapper; + + /** + * @see _.findLast + */ + findLast( + this: LoDashExplicitWrapper, + predicate?: ObjectIterateeCustom, + fromIndex?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/flatMap.d.ts b/types/lodash/collection/flatMap.d.ts new file mode 100644 index 0000000000..1917e691dc --- /dev/null +++ b/types/lodash/collection/flatMap.d.ts @@ -0,0 +1,164 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of flattened values by running each element in collection through iteratee + * and concating its result to the other mapped values. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @return Returns the new flattened array. + */ + flatMap( + collection: List> | Dictionary> | NumericDictionary> | null | undefined + ): T[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: object | null | undefined + ): any[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: List | null | undefined, + iteratee: ListIterator> + ): TResult[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: NumericDictionary | null | undefined, + iteratee: NumericDictionaryIterator> + ): TResult[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: T | null | undefined, + iteratee: ObjectIterator> + ): TResult[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: object | null | undefined, + iteratee: string + ): any[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: object | null | undefined, + iteratee: object + ): boolean[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flatMap + */ + flatMap(this: LoDashImplicitWrapper> | Dictionary> | NumericDictionary> | null | undefined>): LoDashImplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap(): LoDashImplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: ListIterator> + ): LoDashImplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap( + this: LoDashImplicitWrapper, + iteratee: ObjectIterator> + ): LoDashImplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: NumericDictionaryIterator> + ): LoDashImplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap( + iteratee: string + ): LoDashImplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap( + iteratee: object + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flatMap + */ + flatMap(this: LoDashExplicitWrapper> | Dictionary> | NumericDictionary> | null | undefined>): LoDashExplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap(): LoDashExplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: ListIterator> + ): LoDashExplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: NumericDictionaryIterator> + ): LoDashExplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap( + this: LoDashExplicitWrapper, + iteratee: ObjectIterator> + ): LoDashExplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap( + iteratee: string + ): LoDashExplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap( + iteratee: object + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/flatMapDeep.d.ts b/types/lodash/collection/flatMapDeep.d.ts new file mode 100644 index 0000000000..02a81ed5ab --- /dev/null +++ b/types/lodash/collection/flatMapDeep.d.ts @@ -0,0 +1,164 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @since 4.7.0 + * @category Collection + * @param collection The collection to iterate over. + * @param [iteratee=_.identity] The function invoked per iteration. + * @returns Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + flatMapDeep( + collection: List | T> | Dictionary | T> | NumericDictionary | T> | null | undefined + ): T[]; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + collection: List | null | undefined, + iteratee: ListIterator | TResult> + ): TResult[]; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + collection: NumericDictionary | null | undefined, + iteratee: NumericDictionaryIterator | TResult> + ): TResult[]; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + collection: T | null | undefined, + iteratee: ObjectIterator | TResult> + ): TResult[]; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + collection: object | null | undefined, + iteratee: string + ): any[]; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + collection: object | null | undefined, + iteratee: object + ): boolean[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashImplicitWrapper | T> | Dictionary | T> | NumericDictionary | T> | null | undefined> + ): LoDashImplicitWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: ListIterator | TResult> + ): LoDashImplicitWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: NumericDictionaryIterator | TResult> + ): LoDashImplicitWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashImplicitWrapper, + iteratee: ObjectIterator | TResult> + ): LoDashImplicitWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashImplicitWrapper, + iteratee: string + ): LoDashImplicitWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashImplicitWrapper, + iteratee: object + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashExplicitWrapper | T> | Dictionary | T> | NumericDictionary | T> | null | undefined> + ): LoDashExplicitWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: ListIterator | TResult> + ): LoDashExplicitWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: NumericDictionaryIterator | TResult> + ): LoDashExplicitWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashExplicitWrapper, + iteratee: ObjectIterator | TResult> + ): LoDashExplicitWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashExplicitWrapper, + iteratee: string + ): LoDashExplicitWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashExplicitWrapper, + iteratee: object + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/flatMapDepth.d.ts b/types/lodash/collection/flatMapDepth.d.ts new file mode 100644 index 0000000000..6790a8e0f2 --- /dev/null +++ b/types/lodash/collection/flatMapDepth.d.ts @@ -0,0 +1,180 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @since 4.7.0 + * @category Collection + * @param collection The collection to iterate over. + * @param [iteratee=_.identity] The function invoked per iteration. + * @param [depth=1] The maximum recursion depth. + * @returns Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ + flatMapDepth( + collection: List | T> | Dictionary | T> | NumericDictionary | T> | null | undefined + ): T[]; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + collection: List | null | undefined, + iteratee: ListIterator | TResult>, + depth?: number + ): TResult[]; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + collection: NumericDictionary | null | undefined, + iteratee: NumericDictionaryIterator | TResult>, + depth?: number + ): TResult[]; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + collection: T | null | undefined, + iteratee: ObjectIterator | TResult>, + depth?: number + ): TResult[]; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + collection: object | null | undefined, + iteratee: string, + depth?: number + ): any[]; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + collection: object | null | undefined, + iteratee: object, + depth?: number + ): boolean[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashImplicitWrapper | T> | Dictionary | T> | NumericDictionary | T> | null | undefined> + ): LoDashImplicitWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: ListIterator | TResult>, + depth?: number + ): LoDashImplicitWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: NumericDictionaryIterator | TResult>, + depth?: number + ): LoDashImplicitWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashImplicitWrapper, + iteratee: ObjectIterator | TResult>, + depth?: number + ): LoDashImplicitWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashImplicitWrapper, + iteratee: string, + depth?: number + ): LoDashImplicitWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashImplicitWrapper, + iteratee: object, + depth?: number + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashExplicitWrapper | T> | Dictionary | T> | NumericDictionary | T> | null | undefined> + ): LoDashExplicitWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: ListIterator | TResult>, + depth?: number + ): LoDashExplicitWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: NumericDictionaryIterator | TResult>, + depth?: number + ): LoDashExplicitWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashExplicitWrapper, + iteratee: ObjectIterator | TResult>, + depth?: number + ): LoDashExplicitWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashExplicitWrapper, + iteratee: string, + depth?: number + ): LoDashExplicitWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashExplicitWrapper, + iteratee: object, + depth?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/forEach.d.ts b/types/lodash/collection/forEach.d.ts new file mode 100644 index 0000000000..74c0b38cde --- /dev/null +++ b/types/lodash/collection/forEach.d.ts @@ -0,0 +1,113 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg + * and invoked with three arguments: + * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. + * + * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To + * avoid this behavior _.forIn or _.forOwn may be used for object iteration. + * + * @alias _.each + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + */ + forEach( + collection: T[], + iteratee?: ArrayIterator + ): T[]; + + /** + * @see _.forEach + */ + forEach( + collection: string, + iteratee?: StringIterator + ): string; + + /** + * @see _.forEach + */ + forEach( + collection: List, + iteratee?: ListIterator + ): List; + + /** + * @see _.forEach + */ + forEach( + collection: T, + iteratee?: ObjectIterator + ): T; + + /** + * @see _.forEach + */ + forEach( + collection: TArray & (T[] | null | undefined), + iteratee?: ArrayIterator + ): TArray; + + /** + * @see _.forEach + */ + forEach( + collection: TString, + iteratee?: StringIterator + ): TString; + + /** + * @see _.forEach + */ + forEach | null | undefined>( + collection: TList & (List | null | undefined), + iteratee?: ListIterator + ): TList; + + /** + * @see _.forEach + */ + forEach( + collection: T | null | undefined, + iteratee?: ObjectIterator + ): T | null | undefined; + } + + interface LoDashWrapper { + /** + * @see _.forEach + */ + forEach( + this: LoDashWrapper, + iteratee?: ArrayIterator + ): this; + + /** + * @see _.forEach + */ + forEach( + this: LoDashWrapper, + iteratee?: StringIterator + ): this; + + /** + * @see _.forEach + */ + forEach( + this: LoDashWrapper | null | undefined>, + iteratee?: ListIterator + ): this; + + /** + * @see _.forEach + */ + forEach( + this: LoDashWrapper, + iteratee?: ObjectIterator + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/collection/forEachRight.d.ts b/types/lodash/collection/forEachRight.d.ts new file mode 100644 index 0000000000..dd01aa969a --- /dev/null +++ b/types/lodash/collection/forEachRight.d.ts @@ -0,0 +1,108 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.forEach except that it iterates over elements of collection from right to left. + * + * @alias _.eachRight + * + * @param collection The collection to iterate over. + * @param iteratee The function called per iteration. + * @param thisArg The this binding of callback. + */ + forEachRight( + collection: T[], + iteratee?: ArrayIterator + ): T[]; + + /** + * @see _.forEachRight + */ + forEachRight( + collection: string, + iteratee?: StringIterator + ): string; + + /** + * @see _.forEachRight + */ + forEachRight( + collection: List, + iteratee?: ListIterator + ): List; + + /** + * @see _.forEachRight + */ + forEachRight( + collection: T, + iteratee?: ObjectIterator + ): T; + + /** + * @see _.forEachRight + */ + forEachRight( + collection: TArray & (T[] | null | undefined), + iteratee?: ArrayIterator + ): TArray; + + /** + * @see _.forEachRight + */ + forEachRight( + collection: TString, + iteratee?: StringIterator + ): TString; + + /** + * @see _.forEachRight + */ + forEachRight | null | undefined>( + collection: TList & (List | null | undefined), + iteratee?: ListIterator + ): TList; + + /** + * @see _.forEachRight + */ + forEachRight( + collection: T | null | undefined, + iteratee?: ObjectIterator + ): T | null | undefined; + } + + interface LoDashWrapper { + /** + * @see _.forEachRight + */ + forEachRight( + this: LoDashWrapper, + iteratee?: ArrayIterator + ): this; + + /** + * @see _.forEachRight + */ + forEachRight( + this: LoDashWrapper, + iteratee?: StringIterator + ): this; + + /** + * @see _.forEachRight + */ + forEachRight( + this: LoDashWrapper | null | undefined>, + iteratee?: ListIterator + ): this; + + /** + * @see _.forEachRight + */ + forEachRight( + this: LoDashWrapper, + iteratee?: ObjectIterator + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/collection/groupBy.d.ts b/types/lodash/collection/groupBy.d.ts new file mode 100644 index 0000000000..714729181b --- /dev/null +++ b/types/lodash/collection/groupBy.d.ts @@ -0,0 +1,121 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an object composed of keys generated from the results of running each element of collection through + * iteratee. The corresponding value of each key is an array of the elements responsible for generating the + * key. The iteratee is bound to thisArg and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for iteratee the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for iteratee the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the composed aggregate object. + */ + groupBy( + collection: string | null | undefined, + iteratee?: StringIterator + ): Dictionary; + + /** + * @see _.groupBy + */ + groupBy( + collection: List | null | undefined, + iteratee?: ListIteratee + ): Dictionary; + + /** + * @see _.groupBy + */ + groupBy( + collection: NumericDictionary | null | undefined, + iteratee?: NumericDictionaryIteratee + ): Dictionary; + + /** + * @see _.groupBy + */ + groupBy( + collection: T | null | undefined, + iteratee?: ObjectIteratee + ): Dictionary>; + } + + interface LoDashImplicitWrapper { + /** + * @see _.groupBy + */ + groupBy( + this: LoDashImplicitWrapper, + iteratee?: StringIterator + ): LoDashImplicitWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): LoDashImplicitWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + this: LoDashImplicitWrapper, + iteratee?: ObjectIteratee + ): LoDashImplicitWrapper>>; + + /** + * @see _.groupBy + */ + groupBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: NumericDictionaryIteratee + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.groupBy + */ + groupBy( + this: LoDashExplicitWrapper, + iteratee?: StringIterator + ): LoDashExplicitWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): LoDashExplicitWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: NumericDictionaryIteratee + ): LoDashExplicitWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + this: LoDashExplicitWrapper, + iteratee?: ObjectIteratee + ): LoDashExplicitWrapper>>; + } +} \ No newline at end of file diff --git a/types/lodash/collection/includes.d.ts b/types/lodash/collection/includes.d.ts new file mode 100644 index 0000000000..87eda4e44a --- /dev/null +++ b/types/lodash/collection/includes.d.ts @@ -0,0 +1,41 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, + * it’s used as the offset from the end of collection. + * + * @param collection The collection to search. + * @param target The value to search for. + * @param fromIndex The index to search from. + * @return True if the target element is found, else false. + */ + includes( + collection: List|Dictionary | null | undefined, + target: T, + fromIndex?: number + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.includes + */ + includes( + this: LoDashImplicitWrapper | Dictionary | null | undefined>, + target: T, + fromIndex?: number + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.includes + */ + includes( + this: LoDashExplicitWrapper | Dictionary | null | undefined>, + target: T, + fromIndex?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/invokeMap.d.ts b/types/lodash/collection/invokeMap.d.ts new file mode 100644 index 0000000000..99711b4e5f --- /dev/null +++ b/types/lodash/collection/invokeMap.d.ts @@ -0,0 +1,58 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Invokes the method named by methodName on each element in the collection returning + * an array of the results of each invoked method. Additional arguments will be provided + * to each invoked method. If methodName is a function it will be invoked for, and this + * bound to, each element in the collection. + * @param collection The collection to iterate over. + * @param methodName The name of the method to invoke. + * @param args Arguments to invoke the method with. + **/ + invokeMap( + collection: object | null | undefined, + methodName: string, + ...args: any[]): any[]; + + /** + * @see _.invokeMap + **/ + invokeMap( + collection: object | null | undefined, + method: (...args: any[]) => TResult, + ...args: any[]): TResult[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.invokeMap + **/ + invokeMap( + methodName: string, + ...args: any[]): LoDashImplicitWrapper; + + /** + * @see _.invokeMap + **/ + invokeMap( + method: (...args: any[]) => TResult, + ...args: any[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.invokeMap + **/ + invokeMap( + methodName: string, + ...args: any[]): LoDashExplicitWrapper; + + /** + * @see _.invokeMap + **/ + invokeMap( + method: (...args: any[]) => TResult, + ...args: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/keyBy.d.ts b/types/lodash/collection/keyBy.d.ts new file mode 100644 index 0000000000..f9ba2e24b5 --- /dev/null +++ b/types/lodash/collection/keyBy.d.ts @@ -0,0 +1,121 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an object composed of keys generated from the results of running each element of collection through + * iteratee. The corresponding value of each key is the last element responsible for generating the key. The + * iteratee function is bound to thisArg and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for iteratee the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for iteratee the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the composed aggregate object. + */ + keyBy( + collection: string | null | undefined, + iteratee?: StringIterator + ): Dictionary; + + /** + * @see _.keyBy + */ + keyBy( + collection: List | null | undefined, + iteratee?: ListIterateeCustom + ): Dictionary; + + /** + * @see _.keyBy + */ + keyBy( + collection: T | null | undefined, + iteratee?: ObjectIterateeCustom + ): Dictionary; + + /** + * @see _.keyBy + */ + keyBy( + collection: NumericDictionary | null | undefined, + iteratee?: NumericDictionaryIterateeCustom + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.keyBy + */ + keyBy( + this: LoDashImplicitWrapper, + iteratee?: StringIterator + ): LoDashImplicitWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: ListIterateeCustom + ): LoDashImplicitWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + this: LoDashImplicitWrapper, + iteratee?: ObjectIterateeCustom + ): LoDashImplicitWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: NumericDictionaryIterateeCustom + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.keyBy + */ + keyBy( + this: LoDashExplicitWrapper, + iteratee?: StringIterator + ): LoDashExplicitWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: ListIterateeCustom + ): LoDashExplicitWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + this: LoDashExplicitWrapper, + iteratee?: ObjectIterateeCustom + ): LoDashExplicitWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: NumericDictionaryIterateeCustom + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/collection/map.d.ts b/types/lodash/collection/map.d.ts new file mode 100644 index 0000000000..4a90aaf95d --- /dev/null +++ b/types/lodash/collection/map.d.ts @@ -0,0 +1,180 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to + * thisArg and invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for iteratee the created _.property style callback returns the property value + * of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for iteratee the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, + * _.reject, and _.some. + * + * The guarded methods are: + * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, + * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, + * sample, some, sum, uniq, and words + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the new mapped array. + */ + map( + collection: List | null | undefined, + iteratee: ListIterator + ): TResult[]; + + /** + * @see _.map + */ + map(collection: List | Dictionary | null | undefined): T[]; + + /** + * @see _.map + */ + map( + collection: Dictionary | null | undefined, + iteratee: DictionaryIterator + ): TResult[]; + + /** @see _.map */ + map( + collection: List | Dictionary | null | undefined, + iteratee: K + ): Array; + + /** @see _.map */ + map( + collection: NumericDictionary | null | undefined, + iteratee?: NumericDictionaryIterator + ): TResult[]; + + /** + * @see _.map + */ + map( + collection: List|Dictionary|NumericDictionary | null | undefined, + iteratee?: string + ): TResult[]; + + /** + * @see _.map + */ + map( + collection: List|Dictionary|NumericDictionary | null | undefined, + iteratee?: object + ): boolean[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.map + */ + map( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: ListIterator + ): LoDashImplicitWrapper; + + /** + * @see _.map + */ + map(this: LoDashImplicitWrapper | Dictionary | null | undefined>): LoDashImplicitWrapper; + + /** + * @see _.map + */ + map( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: DictionaryIterator + ): LoDashImplicitWrapper; + + /** @see _.map */ + map( + this: LoDashImplicitWrapper | Dictionary | null | undefined>, + iteratee: K + ): LoDashImplicitWrapper>; + + /** @see _.map */ + map( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: NumericDictionaryIterator + ): LoDashImplicitWrapper; + + /** + * @see _.map + */ + map( + this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>, + iteratee?: string + ): LoDashImplicitWrapper; + + /** + * @see _.map + */ + map( + this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>, + iteratee?: object + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.map + */ + map( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: ListIterator + ): LoDashExplicitWrapper; + + /** + * @see _.map + */ + map(this: LoDashExplicitWrapper | Dictionary | null | undefined>): LoDashExplicitWrapper; + + /** + * @see _.map + */ + map( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: DictionaryIterator + ): LoDashExplicitWrapper; + + /** @see _.map */ + map( + this: LoDashExplicitWrapper | Dictionary | null | undefined>, + iteratee: K + ): LoDashExplicitWrapper>; + + /** + * @see _.map + */ + map( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: NumericDictionaryIterator + ): LoDashExplicitWrapper; + + /** + * @see _.map + */ + map( + this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>, + iteratee?: string + ): LoDashExplicitWrapper; + + /** + * @see _.map + */ + map( + this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>, + iteratee?: object + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/orderBy.d.ts b/types/lodash/collection/orderBy.d.ts new file mode 100644 index 0000000000..a8950959de --- /dev/null +++ b/types/lodash/collection/orderBy.d.ts @@ -0,0 +1,192 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. + * + * @category Collection + * @param collection The collection to iterate over. + * @param [iteratees=[_.identity]] The iteratees to sort by. + * @param [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. + * @returns Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 42 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // sort by `user` in ascending order and by `age` in descending order + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + */ + orderBy( + collection: List | null | undefined, + iteratees?: Many>, + orders?: Many + ): T[]; + + /** + * @see _.orderBy + */ + orderBy( + collection: List | null | undefined, + iteratees?: Many>, + orders?: Many + ): T[]; + + /** + * @see _.orderBy + */ + orderBy( + collection: T | null | undefined, + iteratees?: Many>, + orders?: Many + ): Array; + + /** + * @see _.orderBy + */ + orderBy( + collection: T | null | undefined, + iteratees?: Many>, + orders?: Many + ): Array; + + /** + * @see _.orderBy + */ + orderBy( + collection: NumericDictionary | null | undefined, + iteratees?: Many>, + orders?: Many + ): T[]; + + /** + * @see _.orderBy + */ + orderBy( + collection: NumericDictionary | null | undefined, + iteratees?: Many>, + orders?: Many + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.orderBy + */ + orderBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratees?: Many>, + orders?: Many + ): LoDashImplicitWrapper; + + /** + * @see _.orderBy + */ + orderBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratees?: Many>, + orders?: Many + ): LoDashImplicitWrapper; + + /** + * @see _.orderBy + */ + orderBy( + this: LoDashImplicitWrapper, + iteratees?: Many>, + orders?: Many + ): LoDashImplicitWrapper>; + + /** + * @see _.orderBy + */ + orderBy( + this: LoDashImplicitWrapper, + iteratees?: Many>, + orders?: Many + ): LoDashImplicitWrapper>; + + /** + * @see _.orderBy + */ + orderBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratees?: Many>, + orders?: Many + ): LoDashImplicitWrapper; + + /** + * @see _.orderBy + */ + orderBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratees?: Many>, + orders?: Many + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.orderBy + */ + orderBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratees?: Many>, + orders?: Many + ): LoDashExplicitWrapper; + + /** + * @see _.orderBy + */ + orderBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratees?: Many>, + orders?: Many + ): LoDashExplicitWrapper; + + /** + * @see _.orderBy + */ + orderBy( + this: LoDashExplicitWrapper, + iteratees?: Many>, + orders?: Many + ): LoDashExplicitWrapper>; + + /** + * @see _.orderBy + */ + orderBy( + this: LoDashExplicitWrapper, + iteratees?: Many>, + orders?: Many + ): LoDashExplicitWrapper>; + + /** + * @see _.orderBy + */ + orderBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratees?: Many>, + orders?: Many + ): LoDashExplicitWrapper; + + /** + * @see _.orderBy + */ + orderBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratees?: Many>, + orders?: Many + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/partition.d.ts b/types/lodash/collection/partition.d.ts new file mode 100644 index 0000000000..f372f0708d --- /dev/null +++ b/types/lodash/collection/partition.d.ts @@ -0,0 +1,72 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, + * while the second of which contains elements predicate returns falsey for. + * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for predicate the created _.property style callback + * returns the property value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback + * returns true for elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns + * true for elements that have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param callback The function called per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the array of grouped elements. + **/ + partition( + collection: List | null | undefined, + callback: ValueIteratee + ): [T[], T[]]; + + /** + * @see _.partition + */ + partition( + collection: T | null | undefined, + callback: ValueIteratee + ): [Array, Array]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.partition + */ + partition( + this: LoDashImplicitWrapper | null | undefined>, + callback: ValueIteratee + ): LoDashImplicitWrapper<[T[], T[]]>; + + /** + * @see _.partition + */ + partition( + this: LoDashImplicitWrapper, + callback: ValueIteratee + ): LoDashImplicitWrapper<[Array, Array]>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.partition + */ + partition( + this: LoDashExplicitWrapper | null | undefined>, + callback: ValueIteratee + ): LoDashExplicitWrapper<[T[], T[]]>; + + /** + * @see _.partition + */ + partition( + this: LoDashExplicitWrapper, + callback: ValueIteratee + ): LoDashExplicitWrapper<[Array, Array]>; + } +} \ No newline at end of file diff --git a/types/lodash/collection/reduce.d.ts b/types/lodash/collection/reduce.d.ts new file mode 100644 index 0000000000..2346225d60 --- /dev/null +++ b/types/lodash/collection/reduce.d.ts @@ -0,0 +1,220 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Reduces a collection to a value which is the accumulated result of running each + * element in the collection through the callback, where each successive callback execution + * consumes the return value of the previous execution. If accumulator is not provided the + * first element of the collection will be used as the initial accumulator value. The callback + * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). + * @param collection The collection to iterate over. + * @param callback The function called per iteration. + * @param accumulator Initial value of the accumulator. + * @return Returns the accumulated value. + **/ + reduce( + collection: T[] | null | undefined, + callback: MemoListIterator, + accumulator: TResult + ): TResult; + + /** + * @see _.reduce + **/ + reduce( + collection: List | null | undefined, + callback: MemoListIterator>, + accumulator: TResult + ): TResult; + + /** + * @see _.reduce + **/ + reduce( + collection: T | null | undefined, + callback: MemoObjectIterator, + accumulator: TResult + ): TResult; + + /** + * @see _.reduce + **/ + reduce( + collection: NumericDictionary | null | undefined, + callback: MemoListIterator>, + accumulator: TResult + ): TResult; + + /** + * @see _.reduce + **/ + reduce( + collection: T[] | null | undefined, + callback: MemoListIterator + ): TResult | undefined; + + /** + * @see _.reduce + **/ + reduce( + collection: List | null | undefined, + callback: MemoListIterator> + ): TResult | undefined; + + /** + * @see _.reduce + **/ + reduce( + collection: T | null | undefined, + callback: MemoObjectIterator + ): TResult | undefined; + + /** + * @see _.reduce + **/ + reduce( + collection: NumericDictionary | null | undefined, + callback: MemoListIterator> + ): TResult | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.reduce + **/ + reduce( + this: LoDashImplicitWrapper, + callback: MemoListIterator, + accumulator: TResult + ): TResult; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashImplicitWrapper | null | undefined>, + callback: MemoListIterator>, + accumulator: TResult + ): TResult; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashImplicitWrapper, + callback: MemoObjectIterator, + accumulator: TResult + ): TResult; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashImplicitWrapper | null | undefined>, + callback: MemoListIterator>, + accumulator: TResult + ): TResult; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashImplicitWrapper, + callback: MemoListIterator + ): TResult | undefined; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashImplicitWrapper | null | undefined>, + callback: MemoListIterator> + ): TResult | undefined; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashImplicitWrapper, + callback: MemoObjectIterator + ): TResult | undefined; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashImplicitWrapper | null | undefined>, + callback: MemoListIterator> + ): TResult | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.reduce + **/ + reduce( + this: LoDashExplicitWrapper, + callback: MemoListIterator, + accumulator: TResult + ): LoDashExplicitWrapper; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashExplicitWrapper | null | undefined>, + callback: MemoListIterator>, + accumulator: TResult + ): LoDashExplicitWrapper; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashExplicitWrapper, + callback: MemoObjectIterator, + accumulator: TResult + ): LoDashExplicitWrapper; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashExplicitWrapper | null | undefined>, + callback: MemoListIterator>, + accumulator: TResult + ): LoDashExplicitWrapper; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashExplicitWrapper, + callback: MemoListIterator + ): LoDashExplicitWrapper; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashExplicitWrapper | null | undefined>, + callback: MemoListIterator> + ): LoDashExplicitWrapper; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashExplicitWrapper, + callback: MemoObjectIterator + ): LoDashExplicitWrapper; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashExplicitWrapper | null | undefined>, + callback: MemoListIterator> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/reduceRight.d.ts b/types/lodash/collection/reduceRight.d.ts new file mode 100644 index 0000000000..a183708d45 --- /dev/null +++ b/types/lodash/collection/reduceRight.d.ts @@ -0,0 +1,217 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.reduce except that it iterates over elements of a collection from + * right to left. + * @param collection The collection to iterate over. + * @param callback The function called per iteration. + * @param accumulator Initial value of the accumulator. + * @return The accumulated value. + **/ + reduceRight( + collection: T[] | null | undefined, + callback: MemoListIterator, + accumulator: TResult + ): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight( + collection: List | null | undefined, + callback: MemoListIterator>, + accumulator: TResult + ): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight( + collection: T | null | undefined, + callback: MemoObjectIterator, + accumulator: TResult + ): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight( + collection: NumericDictionary | null | undefined, + callback: MemoListIterator>, + accumulator: TResult + ): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight( + collection: T[] | null | undefined, + callback: MemoListIterator + ): TResult | undefined; + + /** + * @see _.reduceRight + **/ + reduceRight( + collection: List | null | undefined, + callback: MemoListIterator> + ): TResult | undefined; + + /** + * @see _.reduceRight + **/ + reduceRight( + collection: T | null | undefined, + callback: MemoObjectIterator + ): TResult | undefined; + + /** + * @see _.reduceRight + **/ + reduceRight( + collection: NumericDictionary | null | undefined, + callback: MemoListIterator> + ): TResult | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashImplicitWrapper, + callback: MemoListIterator, + accumulator: TResult + ): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashImplicitWrapper | null | undefined>, + callback: MemoListIterator>, + accumulator: TResult + ): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashImplicitWrapper, + callback: MemoObjectIterator, + accumulator: TResult + ): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashImplicitWrapper | null | undefined>, + callback: MemoListIterator>, + accumulator: TResult + ): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashImplicitWrapper, + callback: MemoListIterator + ): TResult | undefined; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashImplicitWrapper | null | undefined>, + callback: MemoListIterator> + ): TResult | undefined; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashImplicitWrapper, + callback: MemoObjectIterator + ): TResult | undefined; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashImplicitWrapper | null | undefined>, + callback: MemoListIterator> + ): TResult | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashExplicitWrapper, + callback: MemoListIterator, + accumulator: TResult + ): LoDashExplicitWrapper; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashExplicitWrapper | null | undefined>, + callback: MemoListIterator>, + accumulator: TResult + ): LoDashExplicitWrapper; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashExplicitWrapper, + callback: MemoObjectIterator, + accumulator: TResult + ): LoDashExplicitWrapper; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashExplicitWrapper | null | undefined>, + callback: MemoListIterator>, + accumulator: TResult + ): LoDashExplicitWrapper; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashExplicitWrapper, + callback: MemoListIterator + ): LoDashExplicitWrapper; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashExplicitWrapper | null | undefined>, + callback: MemoListIterator> + ): LoDashExplicitWrapper; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashExplicitWrapper, + callback: MemoObjectIterator + ): LoDashExplicitWrapper; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashExplicitWrapper | null | undefined>, + callback: MemoListIterator> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/reject.d.ts b/types/lodash/collection/reject.d.ts new file mode 100644 index 0000000000..d832f1ba14 --- /dev/null +++ b/types/lodash/collection/reject.d.ts @@ -0,0 +1,86 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * The opposite of _.filter; this method returns the elements of collection that predicate does not return + * truthy for. + * + * @param collection The collection to iterate over. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the new filtered array. + */ + reject( + collection: string | null | undefined, + predicate?: StringIterator + ): string[]; + + /** + * @see _.reject + */ + reject( + collection: List | null | undefined, + predicate?: ListIterateeCustom + ): T[]; + + /** + * @see _.reject + */ + reject( + collection: T | null | undefined, + predicate?: ObjectIterateeCustom + ): Array; + } + + interface LoDashImplicitWrapper { + /** + * @see _.reject + */ + reject( + this: LoDashImplicitWrapper, + predicate?: StringIterator + ): LoDashImplicitWrapper; + + /** + * @see _.reject + */ + reject( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom + ): LoDashImplicitWrapper; + + /** + * @see _.reject + */ + reject( + this: LoDashImplicitWrapper, + predicate?: ObjectIterateeCustom + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.reject + */ + reject( + this: LoDashExplicitWrapper, + predicate?: StringIterator + ): LoDashExplicitWrapper; + + /** + * @see _.reject + */ + reject( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom + ): LoDashExplicitWrapper; + + /** + * @see _.reject + */ + reject( + this: LoDashExplicitWrapper, + predicate?: ObjectIterateeCustom + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/collection/sample.d.ts b/types/lodash/collection/sample.d.ts new file mode 100644 index 0000000000..ccaa4e118b --- /dev/null +++ b/types/lodash/collection/sample.d.ts @@ -0,0 +1,74 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Gets a random element from collection. + * + * @param collection The collection to sample. + * @return Returns the random element. + */ + sample( + collection: List | Dictionary | NumericDictionary | null | undefined + ): T | undefined; + + /** + * @see _.sample + */ + sample( + collection: T + ): T[keyof T]; + + /** + * @see _.sample + */ + sample( + collection: T | null | undefined + ): T[keyof T] | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sample + */ + sample( + this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined> + ): T | undefined; + + /** + * @see _.sample + */ + sample( + this: LoDashImplicitWrapper, + ): T[keyof T]; + + /** + * @see _.sample + */ + sample( + this: LoDashImplicitWrapper + ): T[keyof T] | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sample + */ + sample( + this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined> + ): LoDashExplicitWrapper; + + /** + * @see _.sample + */ + sample( + this: LoDashExplicitWrapper, + ): LoDashExplicitWrapper; + + /** + * @see _.sample + */ + sample( + this: LoDashExplicitWrapper + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/sampleSize.d.ts b/types/lodash/collection/sampleSize.d.ts new file mode 100644 index 0000000000..bf620987d5 --- /dev/null +++ b/types/lodash/collection/sampleSize.d.ts @@ -0,0 +1,60 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Gets n random elements at unique keys from collection up to the size of collection. + * + * @param collection The collection to sample. + * @param n The number of elements to sample. + * @return Returns the random elements. + */ + sampleSize( + collection: List|Dictionary|NumericDictionary | null | undefined, + n?: number + ): T[]; + + /** + * @see _.sampleSize + */ + sampleSize( + collection: T | null | undefined, + n?: number + ): Array; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sampleSize + */ + sampleSize( + this: LoDashImplicitWrapper|Dictionary|NumericDictionary | null | undefined>, + n?: number + ): LoDashImplicitWrapper; + + /** + * @see _.sampleSize + */ + sampleSize( + this: LoDashImplicitWrapper, + n?: number + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sampleSize + */ + sampleSize( + this: LoDashExplicitWrapper|Dictionary|NumericDictionary | null | undefined>, + n?: number + ): LoDashExplicitWrapper; + + /** + * @see _.sampleSize + */ + sampleSize( + this: LoDashExplicitWrapper, + n?: number + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/collection/shuffle.d.ts b/types/lodash/collection/shuffle.d.ts new file mode 100644 index 0000000000..8209ece654 --- /dev/null +++ b/types/lodash/collection/shuffle.d.ts @@ -0,0 +1,41 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of shuffled values, using a version of the Fisher-Yates shuffle. + * + * @param collection The collection to shuffle. + * @return Returns the new shuffled array. + */ + shuffle(collection: List | null | undefined): T[]; + + /** + * @see _.shuffle + */ + shuffle(collection: T | null | undefined): Array; + } + + interface LoDashImplicitWrapper { + /** + * @see _.shuffle + */ + shuffle(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; + + /** + * @see _.shuffle + */ + shuffle(this: LoDashImplicitWrapper): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.shuffle + */ + shuffle(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + + /** + * @see _.shuffle + */ + shuffle(this: LoDashExplicitWrapper): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/collection/size.d.ts b/types/lodash/collection/size.d.ts new file mode 100644 index 0000000000..f1c393a7b7 --- /dev/null +++ b/types/lodash/collection/size.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Gets the size of collection by returning its length for array-like values or the number of own enumerable + * properties for objects. + * + * @param collection The collection to inspect. + * @return Returns the size of collection. + */ + size(collection: object | string | null | undefined): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.size + */ + size(): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.size + */ + size(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/some.d.ts b/types/lodash/collection/some.d.ts new file mode 100644 index 0000000000..fff03751d1 --- /dev/null +++ b/types/lodash/collection/some.d.ts @@ -0,0 +1,85 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate + * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). + * + * @param collection The collection to iterate over. + * @param predicate The function invoked per iteration. + * @return Returns true if any element passes the predicate check, else false. + */ + some( + collection: List | null | undefined, + predicate?: ListIterateeCustom + ): boolean; + + /** + * @see _.some + */ + some( + collection: T | null | undefined, + predicate?: ObjectIterateeCustom + ): boolean; + + /** + * @see _.some + */ + some( + collection: NumericDictionary | null | undefined, + predicate?: NumericDictionaryIterateeCustom + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.some + */ + some( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom + ): boolean; + + /** + * @see _.some + */ + some( + this: LoDashImplicitWrapper, + predicate?: ObjectIterateeCustom + ): boolean; + + /** + * @see _.some + */ + some( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: NumericDictionaryIterateeCustom + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.some + */ + some( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom + ): LoDashExplicitWrapper; + + /** + * @see _.some + */ + some( + this: LoDashExplicitWrapper, + predicate?: ObjectIterateeCustom + ): LoDashExplicitWrapper; + + /** + * @see _.some + */ + some( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: NumericDictionaryIterateeCustom + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/sortBy.d.ts b/types/lodash/collection/sortBy.d.ts new file mode 100644 index 0000000000..d20877f512 --- /dev/null +++ b/types/lodash/collection/sortBy.d.ts @@ -0,0 +1,84 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection through each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @category Collection + * @param collection The collection to iterate over. + * @param [iteratees=[_.identity]] + * The iteratees to sort by, specified individually or in arrays. + * @returns Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 42 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, function(o) { return o.user; }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] + * + * _.sortBy(users, 'user', function(o) { + * return Math.floor(o.age / 10); + * }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + */ + sortBy( + collection: List | null | undefined, + ...iteratees: Array>> + ): T[]; + + /** + * @see _.sortBy + */ + sortBy( + collection: T | null | undefined, + ...iteratees: Array>> + ): Array; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortBy + */ + sortBy( + this: LoDashImplicitWrapper | null | undefined>, + ...iteratees: Array>> + ): LoDashImplicitWrapper; + + /** + * @see _.sortBy + */ + sortBy( + this: LoDashImplicitWrapper, + ...iteratees: Array>> + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortBy + */ + sortBy( + this: LoDashExplicitWrapper | null | undefined>, + ...iteratees: Array>> + ): LoDashExplicitWrapper; + + /** + * @see _.sortBy + */ + sortBy( + this: LoDashExplicitWrapper, + ...iteratees: Array>> + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/common/common.d.ts b/types/lodash/common/common.d.ts new file mode 100644 index 0000000000..5af72d2440 --- /dev/null +++ b/types/lodash/common/common.d.ts @@ -0,0 +1,255 @@ +import _ = require("../index"); +type GlobalPartial = Partial; +declare module "../index" { + type PartialObject = GlobalPartial; + type Many = T | ReadonlyArray; + interface LoDashStatic { + /** + * Creates a lodash object which wraps value to enable implicit method chain sequences. + * Methods that operate on and return arrays, collections, and functions can be chained together. + * Methods that retrieve a single value or may return a primitive value will automatically end the + * chain sequence and return the unwrapped value. Otherwise, the value must be unwrapped with value(). + * + * Explicit chain sequences, which must be unwrapped with value(), may be enabled using _.chain. + * + * The execution of chained methods is lazy, that is, it's deferred until value() is + * implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. Shortcut fusion + * is an optimization to merge iteratee calls; this avoids the creation of intermediate + * arrays and can greatly reduce the number of iteratee executions. Sections of a chain + * sequence qualify for shortcut fusion if the section is applied to an array and iteratees + * accept only one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the value() method is directly or + * indirectly included in the build. + * + * In addition to lodash methods, wrappers have Array and String methods. + * The wrapper Array methods are: + * concat, join, pop, push, shift, sort, splice, and unshift. + * The wrapper String methods are: + * replace and split. + * + * The wrapper methods that support shortcut fusion are: + * at, compact, drop, dropRight, dropWhile, filter, find, findLast, head, initial, last, + * map, reject, reverse, slice, tail, take, takeRight, takeRightWhile, takeWhile, and toArray + * + * The chainable wrapper methods are: + * after, ary, assign, assignIn, assignInWith, assignWith, at, before, bind, bindAll, bindKey, + * castArray, chain, chunk, commit, compact, concat, conforms, constant, countBy, create, + * curry, debounce, defaults, defaultsDeep, defer, delay, difference, differenceBy, differenceWith, + * drop, dropRight, dropRightWhile, dropWhile, extend, extendWith, fill, filter, flatMap, + * flatMapDeep, flatMapDepth, flatten, flattenDeep, flattenDepth, flip, flow, flowRight, + * fromPairs, functions, functionsIn, groupBy, initial, intersection, intersectionBy, intersectionWith, + * invert, invertBy, invokeMap, iteratee, keyBy, keys, keysIn, map, mapKeys, mapValues, + * matches, matchesProperty, memoize, merge, mergeWith, method, methodOf, mixin, negate, + * nthArg, omit, omitBy, once, orderBy, over, overArgs, overEvery, overSome, partial, partialRight, + * partition, pick, pickBy, plant, property, propertyOf, pull, pullAll, pullAllBy, pullAllWith, pullAt, + * push, range, rangeRight, rearg, reject, remove, rest, reverse, sampleSize, set, setWith, + * shuffle, slice, sort, sortBy, sortedUniq, sortedUniqBy, splice, spread, tail, take, + * takeRight, takeRightWhile, takeWhile, tap, throttle, thru, toArray, toPairs, toPairsIn, + * toPath, toPlainObject, transform, unary, union, unionBy, unionWith, uniq, uniqBy, uniqWith, + * unset, unshift, unzip, unzipWith, update, updateWith, values, valuesIn, without, wrap, + * xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, and zipWith. + * + * The wrapper methods that are not chainable by default are: + * add, attempt, camelCase, capitalize, ceil, clamp, clone, cloneDeep, cloneDeepWith, cloneWith, + * conformsTo, deburr, defaultTo, divide, each, eachRight, endsWith, eq, escape, escapeRegExp, + * every, find, findIndex, findKey, findLast, findLastIndex, findLastKey, first, floor, forEach, + * forEachRight, forIn, forInRight, forOwn, forOwnRight, get, gt, gte, has, hasIn, head, + * identity, includes, indexOf, inRange, invoke, isArguments, isArray, isArrayBuffer, + * isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isElement, isEmpty, isEqual, isEqualWith, + * isError, isFinite, isFunction, isInteger, isLength, isMap, isMatch, isMatchWith, isNaN, + * isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isRegExp, + * isSafeInteger, isSet, isString, isUndefined, isTypedArray, isWeakMap, isWeakSet, join, + * kebabCase, last, lastIndexOf, lowerCase, lowerFirst, lt, lte, max, maxBy, mean, meanBy, + * min, minBy, multiply, noConflict, noop, now, nth, pad, padEnd, padStart, parseInt, pop, + * random, reduce, reduceRight, repeat, result, round, runInContext, sample, shift, size, + * snakeCase, some, sortedIndex, sortedIndexBy, sortedLastIndex, sortedLastIndexBy, startCase, + * startsWith, stubArray, stubFalse, stubObject, stubString, stubTrue, subtract, sum, sumBy, + * template, times, toFinite, toInteger, toJSON, toLength, toLower, toNumber, toSafeInteger, + * toString, toUpper, trim, trimEnd, trimStart, truncate, unescape, uniqueId, upperCase, + * upperFirst, value, and words. + **/ + (value: T): LoDashImplicitWrapper; + + /** + * The semantic version number. + **/ + VERSION: string; + + /** + * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby + * (ERB). Change the following template settings to use alternative delimiters. + **/ + templateSettings: TemplateSettings; + } + + + /** + * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby + * (ERB). Change the following template settings to use alternative delimiters. + **/ + interface TemplateSettings { + /** + * The "escape" delimiter. + **/ + escape?: RegExp; + + /** + * The "evaluate" delimiter. + **/ + evaluate?: RegExp; + + /** + * An object to import into the template as local variables. + **/ + imports?: Dictionary; + + /** + * The "interpolate" delimiter. + **/ + interpolate?: RegExp; + + /** + * Used to reference the data object in the template text. + **/ + variable?: string; + } + + /** + * Creates a cache object to store key/value pairs. + */ + interface MapCache { + /** + * Removes `key` and its value from the cache. + * @param key The key of the value to remove. + * @return Returns `true` if the entry was removed successfully, else `false`. + */ + delete(key: string): boolean; + + /** + * Gets the cached value for `key`. + * @param key The key of the value to get. + * @return Returns the cached value. + */ + get(key: string): any; + + /** + * Checks if a cached value for `key` exists. + * @param key The key of the entry to check. + * @return Returns `true` if an entry for `key` exists, else `false`. + */ + has(key: string): boolean; + + /** + * Sets `value` to `key` of the cache. + * @param key The key of the value to cache. + * @param value The value to cache. + * @return Returns the cache object. + */ + set(key: string, value: any): Dictionary; + + /** + * Removes all key-value entries from the map. + */ + clear(): void; + } + interface MapCacheConstructor { + new (): MapCache; + } + + interface LoDashImplicitWrapper extends LoDashWrapper { + pop(this: LoDashImplicitWrapper | null | undefined>): T | undefined; + push(this: LoDashImplicitWrapper | null | undefined>, ...items: T[]): this; + shift(this: LoDashImplicitWrapper | null | undefined>): T | undefined; + sort(this: LoDashImplicitWrapper | null | undefined>, compareFn?: (a: T, b: T) => number): this; + splice(this: LoDashImplicitWrapper | null | undefined>, start: number, deleteCount?: number, ...items: T[]): this; + unshift(this: LoDashImplicitWrapper | null | undefined>, ...items: T[]): this; + } + + interface LoDashExplicitWrapper extends LoDashWrapper { + pop(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + push(this: LoDashExplicitWrapper | null | undefined>, ...items: T[]): this; + shift(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + sort(this: LoDashExplicitWrapper | null | undefined>, compareFn?: (a: T, b: T) => number): this; + splice(this: LoDashExplicitWrapper | null | undefined>, start: number, deleteCount?: number, ...items: T[]): this; + unshift(this: LoDashExplicitWrapper | null | undefined>, ...items: T[]): this; + } + + type NotVoid = {} | null | undefined; + type ArrayIterator = (value: T, index: number, collection: T[]) => TResult; + type ListIterator = (value: T, index: number, collection: List) => TResult; + type ListIteratee = ListIterator | string | [string, any] | PartialDeep; + type ListIterateeCustom = ListIterator | string | object | [string, any] | PartialDeep; + type ListIteratorTypeGuard = (value: T, index: number, collection: List) => value is S; + + // Note: key should be string, not keyof T, because the actual object may contain extra properties that were not specified in the type. + type ObjectIterator = (value: TObject[keyof TObject], key: string, collection: TObject) => TResult; + type ObjectIteratee = ObjectIterator | string | [string, any] | PartialDeep; + type ObjectIterateeCustom = ObjectIterator | string | object | [string, any] | PartialDeep; + type ObjectIteratorTypeGuard = (value: TObject[keyof TObject], key: string, collection: TObject) => value is S; + + type DictionaryIterator = ObjectIterator, TResult>; + type DictionaryIteratee = ObjectIteratee>; + type DictionaryIteratorTypeGuard = ObjectIteratorTypeGuard, S>; + + type NumericDictionaryIterator = (value: T, key: number, collection: NumericDictionary) => TResult; + type NumericDictionaryIteratee = NumericDictionaryIterator | string | [string, any] | PartialDeep; + type NumericDictionaryIterateeCustom = NumericDictionaryIterator | string | [string, any] | PartialDeep; + + type StringIterator = (char: string, index: number, string: string) => TResult; + + type MemoVoidIterator = (prev: TResult, curr: T, indexOrKey: any, list: T[]) => void; + + /** @deprecated Use MemoListIterator or MemoObjectIterator instead. */ + type MemoIterator = (prev: TResult, curr: T, indexOrKey: any, list: T[]) => TResult; + type MemoListIterator = (prev: TResult, curr: T, index: number, list: TList) => TResult; + type MemoObjectIterator = (prev: TResult, curr: T, key: string, list: TList) => TResult; + + type MemoVoidArrayIterator = (acc: TResult, curr: T, index: number, arr: T[]) => void; + type MemoVoidDictionaryIterator = (acc: TResult, curr: T, key: string, dict: Dictionary) => void; + + type ValueIteratee = ((value: T) => NotVoid) | string | [string, any] | PartialDeep; + type ValueKeyIteratee = ((value: T, key: string) => NotVoid) | string | [string, any] | PartialDeep; + type Comparator = (a: T, b: T) => boolean; + type Comparator2 = (a: T1, b: T2) => boolean; + + type PropertyName = string | number | symbol; + type PropertyPath = Many; + + /** Common interface between Arrays and jQuery objects */ + type List = ArrayLike; + + interface Dictionary { + [index: string]: T; + } + + interface NumericDictionary { + [index: number]: T; + } + + interface Cancelable { + cancel(): void; + flush(): void; + } + + type PartialDeep = { + [P in keyof T]?: PartialDeep; + }; + + // For backwards compatibility + type LoDashImplicitArrayWrapper = LoDashImplicitWrapper; + type LoDashImplicitNillableArrayWrapper = LoDashImplicitWrapper; + type LoDashImplicitObjectWrapper = LoDashImplicitWrapper; + type LoDashImplicitNillableObjectWrapper = LoDashImplicitWrapper; + type LoDashImplicitNumberArrayWrapper = LoDashImplicitWrapper; + type LoDashImplicitStringWrapper = LoDashImplicitWrapper; + type LoDashExplicitArrayWrapper = LoDashExplicitWrapper; + type LoDashExplicitNillableArrayWrapper = LoDashExplicitWrapper; + type LoDashExplicitObjectWrapper = LoDashExplicitWrapper; + type LoDashExplicitNillableObjectWrapper = LoDashExplicitWrapper; + type LoDashExplicitNumberArrayWrapper = LoDashExplicitWrapper; + type LoDashExplicitStringWrapper = LoDashExplicitWrapper; +} diff --git a/types/lodash/date/now.d.ts b/types/lodash/date/now.d.ts new file mode 100644 index 0000000000..480326dd3d --- /dev/null +++ b/types/lodash/date/now.d.ts @@ -0,0 +1,25 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Gets the number of milliseconds that have elapsed since the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @return The number of milliseconds. + */ + now(): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.now + */ + now(): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.now + */ + now(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/function/after.d.ts b/types/lodash/function/after.d.ts new file mode 100644 index 0000000000..94b60497e1 --- /dev/null +++ b/types/lodash/function/after.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * The opposite of _.before; this method creates a function that invokes func once it’s called n or more times. + * + * @param n The number of calls before func is invoked. + * @param func The function to restrict. + * @return Returns the new restricted function. + */ + after any>( + n: number, + func: TFunc + ): TFunc; + } + + interface LoDashImplicitWrapper { + /** + * @see _.after + **/ + after any>(func: TFunc): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.after + **/ + after any>(func: TFunc): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/function/ary.d.ts b/types/lodash/function/ary.d.ts new file mode 100644 index 0000000000..94bcc7f25e --- /dev/null +++ b/types/lodash/function/ary.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that accepts up to n arguments ignoring any additional arguments. + * + * @param func The function to cap arguments for. + * @param n The arity cap. + * @returns Returns the new function. + */ + ary( + func: (...args: any[]) => any, + n?: number + ): (...args: any[]) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.ary + */ + ary(n?: number): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.ary + */ + ary(n?: number): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/function/before.d.ts b/types/lodash/function/before.d.ts new file mode 100644 index 0000000000..2a3b840e8e --- /dev/null +++ b/types/lodash/function/before.d.ts @@ -0,0 +1,32 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that invokes func, with the this binding and arguments of the created function, while + * it’s called less than n times. Subsequent calls to the created function return the result of the last func + * invocation. + * + * @param n The number of calls at which func is no longer invoked. + * @param func The function to restrict. + * @return Returns the new restricted function. + */ + before any>( + n: number, + func: TFunc + ): TFunc; + } + + interface LoDashImplicitWrapper { + /** + * @see _.before + **/ + before any>(func: TFunc): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.before + **/ + before any>(func: TFunc): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/function/bind.d.ts b/types/lodash/function/bind.d.ts new file mode 100644 index 0000000000..28034aec12 --- /dev/null +++ b/types/lodash/function/bind.d.ts @@ -0,0 +1,50 @@ +import _ = require("../index"); +declare module "../index" { + interface FunctionBind { + placeholder: any; + + ( + func: (...args: any[]) => any, + thisArg: any, + ...partials: any[] + ): (...args: any[]) => any; + } + + interface LoDashStatic { + /** + * Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind + * arguments to those provided to the bound function. + * + * The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for + * partially applied arguments. + * + * Note: Unlike native Function#bind this method does not set the "length" property of bound functions. + * + * @param func The function to bind. + * @param thisArg The this binding of func. + * @param partials The arguments to be partially applied. + * @return Returns the new bound function. + */ + bind: FunctionBind; + } + + interface LoDashImplicitWrapper { + /** + * @see _.bind + */ + bind( + thisArg: any, + ...partials: any[] + ): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.bind + */ + bind( + thisArg: any, + ...partials: any[] + ): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/function/bindKey.d.ts b/types/lodash/function/bindKey.d.ts new file mode 100644 index 0000000000..bab46527c9 --- /dev/null +++ b/types/lodash/function/bindKey.d.ts @@ -0,0 +1,51 @@ +import _ = require("../index"); +declare module "../index" { + interface FunctionBindKey { + placeholder: any; + + ( + object: object, + key: string, + ...partials: any[] + ): (...args: any[]) => any; + } + + interface LoDashStatic { + /** + * Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments + * to those provided to the bound function. + * + * This method differs from _.bind by allowing bound functions to reference methods that may be redefined + * or don’t yet exist. See Peter Michaux’s article for more details. + * + * The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder + * for partially applied arguments. + * + * @param object The object the method belongs to. + * @param key The key of the method. + * @param partials The arguments to be partially applied. + * @return Returns the new bound function. + */ + bindKey: FunctionBindKey; + } + + interface LoDashImplicitWrapper { + /** + * @see _.bindKey + */ + bindKey( + key: string, + ...partials: any[] + ): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.bindKey + */ + bindKey( + key: string, + ...partials: any[] + ): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/function/curry.d.ts b/types/lodash/function/curry.d.ts new file mode 100644 index 0000000000..03ff949438 --- /dev/null +++ b/types/lodash/function/curry.d.ts @@ -0,0 +1,203 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curry(func: (t1: T1) => R, arity?: number): + CurriedFunction1; + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curry(func: (t1: T1, t2: T2) => R, arity?: number): + CurriedFunction2; + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curry(func: (t1: T1, t2: T2, t3: T3) => R, arity?: number): + CurriedFunction3; + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curry(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R, arity?: number): + CurriedFunction4; + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curry(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R, arity?: number): + CurriedFunction5; + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curry(func: (...args: any[]) => any, arity?: number): (...args: any[]) => any; + } + + interface CurriedFunction1 { + (): CurriedFunction1; + (t1: T1): R; + } + + interface CurriedFunction2 { + (): CurriedFunction2; + (t1: T1): CurriedFunction1; + (t1: T1, t2: T2): R; + } + + interface CurriedFunction3 { + (): CurriedFunction3; + (t1: T1): CurriedFunction2; + (t1: T1, t2: T2): CurriedFunction1; + (t1: T1, t2: T2, t3: T3): R; + } + + interface CurriedFunction4 { + (): CurriedFunction4; + (t1: T1): CurriedFunction3; + (t1: T1, t2: T2): CurriedFunction2; + (t1: T1, t2: T2, t3: T3): CurriedFunction1; + (t1: T1, t2: T2, t3: T3, t4: T4): R; + } + + interface CurriedFunction5 { + (): CurriedFunction5; + (t1: T1): CurriedFunction4; + (t1: T1, t2: T2): CurriedFunction3; + (t1: T1, t2: T2, t3: T3): CurriedFunction2; + (t1: T1, t2: T2, t3: T3, t4: T4): CurriedFunction1; + (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R; + } + interface RightCurriedFunction1 { + (): RightCurriedFunction1; + (t1: T1): R; + } + interface RightCurriedFunction2 { + (): RightCurriedFunction2; + (t2: T2): RightCurriedFunction1; + (t1: T1, t2: T2): R; + } + interface RightCurriedFunction3 { + (): RightCurriedFunction3; + (t3: T3): RightCurriedFunction2; + (t2: T2, t3: T3): RightCurriedFunction1; + (t1: T1, t2: T2, t3: T3): R; + } + interface RightCurriedFunction4 { + (): RightCurriedFunction4; + (t4: T4): RightCurriedFunction3; + (t3: T3, t4: T4): RightCurriedFunction2; + (t2: T2, t3: T3, t4: T4): RightCurriedFunction1; + (t1: T1, t2: T2, t3: T3, t4: T4): R; + } + interface RightCurriedFunction5 { + (): RightCurriedFunction5; + (t5: T5): RightCurriedFunction4; + (t4: T4, t5: T5): RightCurriedFunction3; + (t3: T3, t4: T4, t5: T5): RightCurriedFunction2; + (t2: T2, t3: T3, t4: T4, t5: T5): RightCurriedFunction1; + (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R; + } + + interface LoDashImplicitWrapper { + /** + * @see _.curry + **/ + curry(this: LoDashImplicitWrapper<(t1: T1) => R>, arity?: number): + LoDashImplicitWrapper>; + + /** + * @see _.curry + **/ + curry(this: LoDashImplicitWrapper<(t1: T1, t2: T2) => R>, arity?: number): + LoDashImplicitWrapper>; + + /** + * @see _.curry + **/ + curry(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3) => R>, arity?: number): + LoDashImplicitWrapper>; + + /** + * @see _.curry + **/ + curry(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>, arity?: number): + LoDashImplicitWrapper>; + + /** + * @see _.curry + **/ + curry(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>, arity?: number): + LoDashImplicitWrapper>; + + /** + * @see _.curry + **/ + curry(arity?: number): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.curry + **/ + curry(this: LoDashExplicitWrapper<(t1: T1) => R>): + LoDashExplicitWrapper>; + + /** + * @see _.curry + **/ + curry(this: LoDashExplicitWrapper<(t1: T1, t2: T2) => R>): + LoDashExplicitWrapper>; + + /** + * @see _.curry + **/ + curry(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3) => R>): + LoDashExplicitWrapper>; + + /** + * @see _.curry + **/ + curry(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>): + LoDashExplicitWrapper>; + + /** + * @see _.curry + **/ + curry(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>): + LoDashExplicitWrapper>; + + /** + * @see _.curry + **/ + curry(arity?: number): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/function/curryRight.d.ts b/types/lodash/function/curryRight.d.ts new file mode 100644 index 0000000000..044e98d5a2 --- /dev/null +++ b/types/lodash/function/curryRight.d.ts @@ -0,0 +1,132 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curryRight(func: (t1: T1) => R, arity?: number): + RightCurriedFunction1; + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curryRight(func: (t1: T1, t2: T2) => R, arity?: number): + RightCurriedFunction2; + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curryRight(func: (t1: T1, t2: T2, t3: T3) => R, arity?: number): + RightCurriedFunction3; + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curryRight(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R, arity?: number): + RightCurriedFunction4; + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curryRight(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R, arity?: number): + RightCurriedFunction5; + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curryRight(func: (...args: any[]) => any, arity?: number): (...args: any[]) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.curryRight + **/ + curryRight(this: LoDashImplicitWrapper<(t1: T1) => R>, arity?: number): + LoDashImplicitWrapper>; + + /** + * @see _.curryRight + **/ + curryRight(this: LoDashImplicitWrapper<(t1: T1, t2: T2) => R>, arity?: number): + LoDashImplicitWrapper>; + + /** + * @see _.curryRight + **/ + curryRight(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3) => R>, arity?: number): + LoDashImplicitWrapper>; + + /** + * @see _.curryRight + **/ + curryRight(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>, arity?: number): + LoDashImplicitWrapper>; + + /** + * @see _.curryRight + **/ + curryRight(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>, arity?: number): + LoDashImplicitWrapper>; + + /** + * @see _.curryRight + **/ + curryRight(arity?: number): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.curryRight + **/ + curryRight(this: LoDashExplicitWrapper<(t1: T1) => R>, arity?: number): + LoDashExplicitWrapper>; + + /** + * @see _.curryRight + **/ + curryRight(this: LoDashExplicitWrapper<(t1: T1, t2: T2) => R>, arity?: number): + LoDashExplicitWrapper>; + + /** + * @see _.curryRight + **/ + curryRight(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3) => R>, arity?: number): + LoDashExplicitWrapper>; + + /** + * @see _.curryRight + **/ + curryRight(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>, arity?: number): + LoDashExplicitWrapper>; + + /** + * @see _.curryRight + **/ + curryRight(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>, arity?: number): + LoDashExplicitWrapper>; + + /** + * @see _.curryRight + **/ + curryRight(arity?: number): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/function/debounce.d.ts b/types/lodash/function/debounce.d.ts new file mode 100644 index 0000000000..9ff85bd972 --- /dev/null +++ b/types/lodash/function/debounce.d.ts @@ -0,0 +1,67 @@ +import _ = require("../index"); +declare module "../index" { + interface DebounceSettings { + /** + * Specify invoking on the leading edge of the timeout. + */ + leading?: boolean; + + /** + * The maximum time func is allowed to be delayed before it’s invoked. + */ + maxWait?: number; + + /** + * Specify invoking on the trailing edge of the timeout. + */ + trailing?: boolean; + } + + interface LoDashStatic { + /** + * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since + * the last time the debounced function was invoked. The debounced function comes with a cancel method to + * cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to + * indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent + * calls to the debounced function return the result of the last func invocation. + * + * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only + * if the the debounced function is invoked more than once during the wait timeout. + * + * See David Corbacho’s article for details over the differences between _.debounce and _.throttle. + * + * @param func The function to debounce. + * @param wait The number of milliseconds to delay. + * @param options The options object. + * @param options.leading Specify invoking on the leading edge of the timeout. + * @param options.maxWait The maximum time func is allowed to be delayed before it’s invoked. + * @param options.trailing Specify invoking on the trailing edge of the timeout. + * @return Returns the new debounced function. + */ + debounce any>( + func: T, + wait?: number, + options?: DebounceSettings + ): T & Cancelable; + } + + interface LoDashImplicitWrapper { + /** + * @see _.debounce + */ + debounce( + wait?: number, + options?: DebounceSettings + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.debounce + */ + debounce( + wait?: number, + options?: DebounceSettings + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/function/defer.d.ts b/types/lodash/function/defer.d.ts new file mode 100644 index 0000000000..1968749ecd --- /dev/null +++ b/types/lodash/function/defer.d.ts @@ -0,0 +1,31 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Defers invoking the func until the current call stack has cleared. Any additional arguments are provided to + * func when it’s invoked. + * + * @param func The function to defer. + * @param args The arguments to invoke the function with. + * @return Returns the timer id. + */ + defer( + func: (...args: any[]) => any, + ...args: any[] + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.defer + */ + defer(...args: any[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.defer + */ + defer(...args: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/function/delay.d.ts b/types/lodash/function/delay.d.ts new file mode 100644 index 0000000000..72e2b4151e --- /dev/null +++ b/types/lodash/function/delay.d.ts @@ -0,0 +1,38 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked. + * + * @param func The function to delay. + * @param wait The number of milliseconds to delay invocation. + * @param args The arguments to invoke the function with. + * @return Returns the timer id. + */ + delay( + func: (...args: any[]) => any, + wait: number, + ...args: any[] + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.delay + */ + delay( + wait: number, + ...args: any[] + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.delay + */ + delay( + wait: number, + ...args: any[] + ): LoDashExplicitWrapper; + } +} diff --git a/types/lodash/function/flip.d.ts b/types/lodash/function/flip.d.ts new file mode 100644 index 0000000000..e2699e3fd7 --- /dev/null +++ b/types/lodash/function/flip.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that invokes `func` with arguments reversed. + * + * @category Function + * @param func The function to flip arguments for. + * @returns Returns the new function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ + flip any>(func: T): T; + } + + interface LoDashWrapper { + /** + * @see _.flip + */ + flip(): this; + } +} \ No newline at end of file diff --git a/types/lodash/function/memoize.d.ts b/types/lodash/function/memoize.d.ts new file mode 100644 index 0000000000..c74cf2a32c --- /dev/null +++ b/types/lodash/function/memoize.d.ts @@ -0,0 +1,37 @@ +import _ = require("../index"); +declare module "../index" { + interface MemoizedFunction { + cache: MapCache; + } + + interface LoDashStatic { + /** + * Creates a function that memoizes the result of func. If resolver is provided it determines the cache key for + * storing the result based on the arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is coerced to a string and used as the cache key. The func is invoked with + * the this binding of the memoized function. + * + * @param func The function to have its output memoized. + * @param resolver The function to resolve the cache key. + * @return Returns the new memoizing function. + */ + memoize: { + any>(func: T, resolver?: (...args: any[]) => any): T & MemoizedFunction; + Cache: MapCacheConstructor; + }; + } + + interface LoDashImplicitWrapper { + /** + * @see _.memoize + */ + memoize(resolver?: (...args: any[]) => any): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.memoize + */ + memoize(resolver?: (...args: any[]) => any): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/function/negate.d.ts b/types/lodash/function/negate.d.ts new file mode 100644 index 0000000000..c4e3b7bea4 --- /dev/null +++ b/types/lodash/function/negate.d.ts @@ -0,0 +1,20 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that negates the result of the predicate func. The func predicate is invoked with + * the this binding and arguments of the created function. + * + * @param predicate The predicate to negate. + * @return Returns the new function. + */ + negate any>(predicate: T): T; + } + + interface LoDashWrapper { + /** + * @see _.negate + */ + negate(): this; + } +} \ No newline at end of file diff --git a/types/lodash/function/once.d.ts b/types/lodash/function/once.d.ts new file mode 100644 index 0000000000..b64562ac16 --- /dev/null +++ b/types/lodash/function/once.d.ts @@ -0,0 +1,20 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that is restricted to invoking func once. Repeat calls to the function return the value + * of the first call. The func is invoked with the this binding and arguments of the created function. + * + * @param func The function to restrict. + * @return Returns the new restricted function. + */ + once any>(func: T): T; + } + + interface LoDashWrapper { + /** + * @see _.once + */ + once(): this; + } +} \ No newline at end of file diff --git a/types/lodash/function/overArgs.d.ts b/types/lodash/function/overArgs.d.ts new file mode 100644 index 0000000000..265f79981b --- /dev/null +++ b/types/lodash/function/overArgs.d.ts @@ -0,0 +1,31 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that runs each argument through a corresponding transform function. + * + * @param func The function to wrap. + * @param transforms The functions to transform arguments, specified as individual functions or arrays + * of functions. + * @return Returns the new function. + */ + overArgs( + func: (...args: any[]) => any, + ...transforms: Array any>> + ): (...args: any[]) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.overArgs + */ + overArgs(...transforms: Array any>>): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.overArgs + */ + overArgs(...transforms: Array any>>): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/function/partial.d.ts b/types/lodash/function/partial.d.ts new file mode 100644 index 0000000000..6e729971a6 --- /dev/null +++ b/types/lodash/function/partial.d.ts @@ -0,0 +1,159 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that, when called, invokes func with any additional partial arguments + * prepended to those provided to the new function. This method is similar to _.bind except + * it does not alter the this binding. + * @param func The function to partially apply arguments to. + * @param args Arguments to be partially applied. + * @return The new partially applied function. + **/ + partial: Partial; + } + + interface LoDashImplicitWrapper { + /** + * @see _.partial + */ + partial: ImplicitPartial; + } + + interface LoDashExplicitWrapper { + /** + * @see _.partial + */ + partial: ExplicitPartial; + } + + type PH = LoDashStatic; + + type Function0 = () => R; + type Function1 = (t1: T1) => R; + type Function2 = (t1: T1, t2: T2) => R; + type Function3 = (t1: T1, t2: T2, t3: T3) => R; + type Function4 = (t1: T1, t2: T2, t3: T3, t4: T4) => R; + + interface Partial { + // arity 0 + (func: Function0): Function0; + // arity 1 + (func: Function1): Function1; + (func: Function1, arg1: T1): Function0; + // arity 2 + (func: Function2): Function2; + (func: Function2, arg1: T1): Function1< T2, R>; + (func: Function2, plc1: PH, arg2: T2): Function1; + (func: Function2, arg1: T1, arg2: T2): Function0< R>; + // arity 3 + (func: Function3): Function3; + (func: Function3, arg1: T1): Function2< T2, T3, R>; + (func: Function3, plc1: PH, arg2: T2): Function2; + (func: Function3, arg1: T1, arg2: T2): Function1< T3, R>; + (func: Function3, plc1: PH, plc2: PH, arg3: T3): Function2; + (func: Function3, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>; + (func: Function3, plc1: PH, arg2: T2, arg3: T3): Function1; + (func: Function3, arg1: T1, arg2: T2, arg3: T3): Function0< R>; + // arity 4 + (func: Function4): Function4; + (func: Function4, arg1: T1): Function3< T2, T3, T4, R>; + (func: Function4, plc1: PH, arg2: T2): Function3; + (func: Function4, arg1: T1, arg2: T2): Function2< T3, T4, R>; + (func: Function4, plc1: PH, plc2: PH, arg3: T3): Function3; + (func: Function4, arg1: T1, plc2: PH, arg3: T3): Function2< T2, T4, R>; + (func: Function4, plc1: PH, arg2: T2, arg3: T3): Function2; + (func: Function4, arg1: T1, arg2: T2, arg3: T3): Function1< T4, R>; + (func: Function4, plc1: PH, plc2: PH, plc3: PH, arg4: T4): Function3; + (func: Function4, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>; + (func: Function4, plc1: PH, arg2: T2, plc3: PH, arg4: T4): Function2; + (func: Function4, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>; + (func: Function4, plc1: PH, plc2: PH, arg3: T3, arg4: T4): Function2; + (func: Function4, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>; + (func: Function4, plc1: PH, arg2: T2, arg3: T3, arg4: T4): Function1; + (func: Function4, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>; + // catch-all + (func: (...args: any[]) => any, ...args: any[]): (...args: any[]) => any; + } + + interface ImplicitPartial { + // arity 0 + (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + // arity 1 + (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; + // arity 2 + (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; + // arity 3 + (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashImplicitWrapper>; + // arity 4 + (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, plc3: PH, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + // catch-all + (...args: any[]): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface ExplicitPartial { + // arity 0 + (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + // arity 1 + (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; + // arity 2 + (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; + // arity 3 + (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashExplicitWrapper>; + // arity 4 + (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, plc3: PH, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + // catch-all + (...args: any[]): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/function/partialRight.d.ts b/types/lodash/function/partialRight.d.ts new file mode 100644 index 0000000000..24b4c47d20 --- /dev/null +++ b/types/lodash/function/partialRight.d.ts @@ -0,0 +1,150 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.partial except that partial arguments are appended to those provided + * to the new function. + * @param func The function to partially apply arguments to. + * @param args Arguments to be partially applied. + * @return The new partially applied function. + **/ + partialRight: PartialRight; + } + + interface LoDashImplicitWrapper { + /** + * @see _.partialRight + */ + partialRight: ImplicitPartialRight; + } + + interface LoDashExplicitWrapper { + /** + * @see _.partialRight + */ + partialRight: ExplicitPartialRight; + } + + interface PartialRight { + // arity 0 + (func: Function0): Function0; + // arity 1 + (func: Function1): Function1; + (func: Function1, arg1: T1): Function0; + // arity 2 + (func: Function2): Function2; + (func: Function2, arg1: T1, plc2: PH): Function1< T2, R>; + (func: Function2, arg2: T2): Function1; + (func: Function2, arg1: T1, arg2: T2): Function0< R>; + // arity 3 + (func: Function3): Function3; + (func: Function3, arg1: T1, plc2: PH, plc3: PH): Function2< T2, T3, R>; + (func: Function3, arg2: T2, plc3: PH): Function2; + (func: Function3, arg1: T1, arg2: T2, plc3: PH): Function1< T3, R>; + (func: Function3, arg3: T3): Function2; + (func: Function3, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>; + (func: Function3, arg2: T2, arg3: T3): Function1; + (func: Function3, arg1: T1, arg2: T2, arg3: T3): Function0< R>; + // arity 4 + (func: Function4): Function4; + (func: Function4, arg1: T1, plc2: PH, plc3: PH, plc4: PH): Function3< T2, T3, T4, R>; + (func: Function4, arg2: T2, plc3: PH, plc4: PH): Function3; + (func: Function4, arg1: T1, arg2: T2, plc3: PH, plc4: PH): Function2< T3, T4, R>; + (func: Function4, arg3: T3, plc4: PH): Function3; + (func: Function4, arg1: T1, plc2: PH, arg3: T3, plc4: PH): Function2< T2, T4, R>; + (func: Function4, arg2: T2, arg3: T3, plc4: PH): Function2; + (func: Function4, arg1: T1, arg2: T2, arg3: T3, plc4: PH): Function1< T4, R>; + (func: Function4, arg4: T4): Function3; + (func: Function4, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>; + (func: Function4, arg2: T2, plc3: PH, arg4: T4): Function2; + (func: Function4, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>; + (func: Function4, arg3: T3, arg4: T4): Function2; + (func: Function4, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>; + (func: Function4, arg2: T2, arg3: T3, arg4: T4): Function1; + (func: Function4, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>; + // catch-all + (func: (...args: any[]) => any, ...args: any[]): (...args: any[]) => any; + } + + interface ImplicitPartialRight { + // arity 0 + (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + // arity 1 + (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; + // arity 2 + (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; + // arity 3 + (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2, plc3: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashImplicitWrapper>; + // arity 4 + (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, plc4: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2, plc3: PH, plc4: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, plc4: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg3: T3, plc4: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, plc4: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2, arg3: T3, plc4: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, plc4: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + // catch-all + (...args: any[]): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface ExplicitPartialRight { + // arity 0 + (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + // arity 1 + (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; + // arity 2 + (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; + // arity 3 + (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2, plc3: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashExplicitWrapper>; + // arity 4 + (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, plc4: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2, plc3: PH, plc4: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, plc4: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg3: T3, plc4: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, plc4: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2, arg3: T3, plc4: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, plc4: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + // catch-all + (...args: any[]): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/function/rearg.d.ts b/types/lodash/function/rearg.d.ts new file mode 100644 index 0000000000..bff0a45b0c --- /dev/null +++ b/types/lodash/function/rearg.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that invokes func with arguments arranged according to the specified indexes where the + * argument value at the first index is provided as the first argument, the argument value at the second index + * is provided as the second argument, and so on. + * @param func The function to rearrange arguments for. + * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes. + * @return Returns the new function. + */ + rearg(func: (...args: any[]) => any, ...indexes: Array>): (...args: any[]) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.rearg + */ + rearg(...indexes: Array>): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.rearg + */ + rearg(...indexes: Array>): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/function/rest.d.ts b/types/lodash/function/rest.d.ts new file mode 100644 index 0000000000..c05349f0f9 --- /dev/null +++ b/types/lodash/function/rest.d.ts @@ -0,0 +1,33 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that invokes func with the this binding of the created function and arguments from start + * and beyond provided as an array. + * + * Note: This method is based on the rest parameter. + * + * @param func The function to apply a rest parameter to. + * @param start The start position of the rest parameter. + * @return Returns the new function. + */ + rest( + func: (...args: any[]) => any, + start?: number + ): (...args: any[]) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.rest + */ + rest(start?: number): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.rest + */ + rest(start?: number): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/function/spread.d.ts b/types/lodash/function/spread.d.ts new file mode 100644 index 0000000000..29c8b5e8cf --- /dev/null +++ b/types/lodash/function/spread.d.ts @@ -0,0 +1,44 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that invokes func with the this binding of the created function and an array of arguments + * much like Function#apply. + * + * Note: This method is based on the spread operator. + * + * @param func The function to spread arguments over. + * @return Returns the new function. + */ + spread(func: (...args: any[]) => TResult): (...args: any[]) => TResult; + + /** + * @see _.spread + */ + spread(func: (...args: any[]) => TResult, start: number): (...args: any[]) => TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.spread + */ + spread(this: LoDashImplicitWrapper<(...args: any[]) => TResult>): LoDashImplicitWrapper<(...args: any[]) => TResult>; + + /** + * @see _.spread + */ + spread(this: LoDashImplicitWrapper<(...args: any[]) => TResult>, start: number): LoDashImplicitWrapper<(...args: any[]) => TResult>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.spread + */ + spread(this: LoDashExplicitWrapper<(...args: any[]) => TResult>): LoDashExplicitWrapper<(...args: any[]) => TResult>; + + /** + * @see _.spread + */ + spread(this: LoDashExplicitWrapper<(...args: any[]) => TResult>, start: number): LoDashExplicitWrapper<(...args: any[]) => TResult>; + } +} \ No newline at end of file diff --git a/types/lodash/function/throttle.d.ts b/types/lodash/function/throttle.d.ts new file mode 100644 index 0000000000..0b0fc10039 --- /dev/null +++ b/types/lodash/function/throttle.d.ts @@ -0,0 +1,58 @@ +import _ = require("../index"); +declare module "../index" { + interface ThrottleSettings { + /** + * If you'd like to disable the leading-edge call, pass this as false. + */ + leading?: boolean; + + /** + * If you'd like to disable the execution on the trailing-edge, pass false. + */ + trailing?: boolean; + } + + interface LoDashStatic { + /** + * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled + * function comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke + * them. Provide an options object to indicate that func should be invoked on the leading and/or trailing edge + * of the wait timeout. Subsequent calls to the throttled function return the result of the last func call. + * + * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if + * the the throttled function is invoked more than once during the wait timeout. + * + * @param func The function to throttle. + * @param wait The number of milliseconds to throttle invocations to. + * @param options The options object. + * @param options.leading Specify invoking on the leading edge of the timeout. + * @param options.trailing Specify invoking on the trailing edge of the timeout. + * @return Returns the new throttled function. + */ + throttle any>( + func: T, + wait?: number, + options?: ThrottleSettings + ): T & Cancelable; + } + + interface LoDashImplicitWrapper { + /** + * @see _.throttle + */ + throttle( + wait?: number, + options?: ThrottleSettings + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.throttle + */ + throttle( + wait?: number, + options?: ThrottleSettings + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/function/unary.d.ts b/types/lodash/function/unary.d.ts new file mode 100644 index 0000000000..8714529b10 --- /dev/null +++ b/types/lodash/function/unary.d.ts @@ -0,0 +1,32 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that accepts up to one argument, ignoring any + * additional arguments. + * + * @category Function + * @param func The function to cap arguments for. + * @returns Returns the new function. + * @example + * + * _.map(['6', '8', '10'], _.unary(parseInt)); + * // => [6, 8, 10] + */ + unary(func: (arg1: T, ...args: any[]) => TResult): (arg1: T) => TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.unary + */ + unary(this: LoDashImplicitWrapper<(arg1: T, ...args: any[]) => TResult>): LoDashImplicitWrapper<(arg1: T) => TResult>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.unary + */ + unary(this: LoDashExplicitWrapper<(arg1: T, ...args: any[]) => TResult>): LoDashExplicitWrapper<(arg1: T) => TResult>; + } +} \ No newline at end of file diff --git a/types/lodash/function/wrap.d.ts b/types/lodash/function/wrap.d.ts new file mode 100644 index 0000000000..f0bb2693ff --- /dev/null +++ b/types/lodash/function/wrap.d.ts @@ -0,0 +1,61 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that provides value to the wrapper function as its first argument. Any additional + * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is + * invoked with the this binding of the created function. + * + * @param value The value to wrap. + * @param wrapper The wrapper function. + * @return Returns the new function. + */ + wrap( + value: T, + wrapper: (value: T, ...args: TArgs[]) => TResult + ): (...args: TArgs[]) => TResult; + + /** + * @see _.wrap + */ + wrap( + value: T, + wrapper: (value: T, ...args: any[]) => TResult + ): (...args: any[]) => TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.wrap + */ + wrap( + wrapper: (value: TValue, ...args: TArgs[]) => TResult + ): LoDashImplicitWrapper<(...args: TArgs[]) => TResult>; + + /** + * @see _.wrap + */ + wrap( + wrapper: (value: TValue, ...args: any[]) => TResult + ): LoDashImplicitWrapper<(...args: any[]) => TResult>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.wrap + */ + /** + * @see _.wrap + */ + wrap( + wrapper: (value: TValue, ...args: TArgs[]) => TResult + ): LoDashExplicitWrapper<(...args: TArgs[]) => TResult>; + + /** + * @see _.wrap + */ + wrap( + wrapper: (value: TValue, ...args: any[]) => TResult + ): LoDashExplicitWrapper<(...args: any[]) => TResult>; + } +} \ No newline at end of file diff --git a/types/lodash/index.d.ts b/types/lodash/index.d.ts index 00a1cd63b2..578bfacd21 100644 --- a/types/lodash/index.d.ts +++ b/types/lodash/index.d.ts @@ -3,17376 +3,371 @@ // Definitions by: Brian Zengel , // Ilya Mochalov , // Stepan Mikhaylyuk , -// Eric L Anderson , // AJ Richardson , // Junyoung Clare Jang , // e-cloud , // Georgii Dolzhykov , -// Jack Moore +// Jack Moore , +// Dominique Rau // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -/** -### 4.0.0 Changelog (https://github.com/lodash/lodash/wiki/Changelog) +// common +/// -#### TODO: -removed: -- [x] Removed _.support -- [x] Removed _.findWhere in favor of _.find with iteratee shorthand -- [x] Removed _.where in favor of _.filter with iteratee shorthand -- [x] Removed _.pluck in favor of _.map with iteratee shorthand +// array +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// -renamed: -- [x] Renamed _.first to _.head -- [x] Renamed _.indexBy to _.keyBy -- [x] Renamed _.invoke to _.invokeMap -- [x] Renamed _.overArgs to _.overArgs -- [x] Renamed _.padLeft & _.padRight to _.padStart & _.padEnd -- [x] Renamed _.pairs to _.toPairs -- [x] Renamed _.rest to _.tail -- [x] Renamed _.restParam to _.rest -- [x] Renamed _.sortByOrder to _.orderBy -- [x] Renamed _.trimLeft & _.trimRight to _.trimStart & _.trimEnd -- [x] Renamed _.trunc to _.truncate +// collection +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// -split: -- [x] Split _.indexOf & _.lastIndexOf into _.sortedIndexOf & _.sortedLastIndexOf -- [x] Split _.max & _.min into _.maxBy & _.minBy -- [x] Split _.omit & _.pick into _.omitBy & _.pickBy -- [x] Split _.sample into _.sampleSize -- [x] Split _.sortedIndex into _.sortedIndexBy -- [x] Split _.sortedLastIndex into _.sortedLastIndexBy -- [x] Split _.uniq into _.sortedUniq, _.sortedUniqBy, & _.uniqBy +// date +/// -changes: -- [x] Absorbed _.sortByAll into _.sortBy -- [x] Changed the category of _.at to “Object†-- [x] Changed the category of _.bindAll to “Utility†-- [x] Made _.capitalize uppercase the first character & lowercase the rest -- [x] Made _.functions return only own method names +// function +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// -added 23 array methods: -- [x] _.concat -- [x] _.differenceBy -- [x] _.differenceWith -- [x] _.flatMap -- [x] _.fromPairs -- [x] _.intersectionBy -- [x] _.intersectionWith -- [x] _.join -- [x] _.pullAll -- [x] _.pullAllBy -- [x] _.reverse -- [x] _.sortedIndexBy -- [x] _.sortedIndexOf -- [x] _.sortedLastIndexBy -- [x] _.sortedLastIndexOf -- [x] _.sortedUniq -- [x] _.sortedUniqBy -- [x] _.unionBy -- [x] _.unionWith -- [x] _.uniqBy -- [x] _.uniqWith -- [x] _.xorBy -- [x] _.xorWith +// lang +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// -added 20 lang methods: -- [x] _.cloneDeepWith -- [x] _.cloneWith -- [x] _.eq -- [x] _.isArrayLike -- [x] _.isArrayLikeObject -- [x] _.isEqualWith -- [x] _.isInteger -- [x] _.isLength -- [x] _.isMatchWith -- [x] _.isNil -- [x] _.isObjectLike -- [x] _.isSafeInteger -- [x] _.isSymbol -- [x] _.toInteger -- [x] _.toLength -- [x] _.toNumber -- [x] _.toSafeInteger -- [x] _.toString -- [X] _.conforms -- [X] _.conformsTo +// math +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// -added 13 object methods: -- [x] _.assignIn -- [x] _.assignInWith -- [x] _.assignWith -- [x] _.functionsIn -- [x] _.hasIn -- [x] _.mergeWith -- [x] _.omitBy -- [x] _.pickBy +// number +/// +/// +/// -added 8 string methods: -- [x] _.lowerCase -- [x] _.lowerFirst -- [x] _.upperCase -- [x] _.upperFirst -- [x] _.toLower -- [x] _.toUpper +// object +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// -added 8 utility methods: -- [x] _.toPath +// _ +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// -added 4 math methods: -- [x] _.maxBy -- [x] _.mean -- [x] _.minBy -- [x] _.sumBy +// string +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// -added 2 function methods: -- [x] _.flip -- [x] _.unary - -added 2 number methods: -- [x] _.clamp -- [x] _.subtract - -added collection method: -- [x] _.sampleSize - -Added 3 aliases - -- [x] _.first as an alias of _.head - -Removed 17 aliases -- [x] Removed aliase _.all -- [x] Removed aliase _.any -- [x] Removed aliase _.backflow -- [x] Removed aliase _.callback -- [x] Removed aliase _.collect -- [x] Removed aliase _.compose -- [x] Removed aliase _.contains -- [x] Removed aliase _.detect -- [x] Removed aliase _.foldl -- [x] Removed aliase _.foldr -- [x] Removed aliase _.include -- [x] Removed aliase _.inject -- [x] Removed aliase _.methods -- [x] Removed aliase _.object -- [x] Removed aliase _.run -- [x] Removed aliase _.select -- [x] Removed aliase _.unique - -Other changes -- [x] Added support for array buffers to _.isEqual -- [x] Added support for converting iterators to _.toArray -- [x] Added support for deep paths to _.zipObject -- [x] Changed UMD to export to window or self when available regardless of other exports -- [x] Ensured debounce cancel clears args & thisArg references -- [x] Ensured _.add, _.subtract, & _.sum don’t skip NaN values -- [x] Ensured _.clone treats generators like functions -- [x] Ensured _.clone produces clones with the source’s [[Prototype]] -- [x] Ensured _.defaults assigns properties that shadow Object.prototype -- [x] Ensured _.defaultsDeep doesn’t merge a string into an array -- [x] Ensured _.defaultsDeep & _.merge don’t modify sources -- [x] Ensured _.defaultsDeep works with circular references -- [x] Ensured _.keys skips “length†on strict mode arguments objects in Safari 9 -- [x] Ensured _.merge doesn’t convert strings to arrays -- [x] Ensured _.merge merges plain-objects onto non plain-objects -- [x] Ensured _#plant resets iterator data of cloned sequences -- [x] Ensured _.random swaps min & max if min is greater than max -- [x] Ensured _.range preserves the sign of start of -0 -- [x] Ensured _.reduce & _.reduceRight use getIteratee in their array branch -- [x] Fixed rounding issue with the precision param of _.floor -- [x] Added flush method to debounced & throttled functions - -** LATER ** -Misc: -- [ ] Made _.forEach, _.forIn, _.forOwn, & _.times implicitly end a chain sequence -- [ ] Removed thisArg params from most methods -- [ ] Made “By†methods provide a single param to iteratees -- [ ] Made _.words chainable by default -- [ ] Removed isDeep params from _.clone & _.flatten -- [ ] Removed _.bindAll support for binding all methods when no names are provided -- [ ] Removed func-first param signature from _.before & _.after -- [ ] _.extend as an alias of _.assignIn -- [ ] _.extendWith as an alias of _.assignInWith -- [ ] Added clear method to _.memoize.Cache -- [ ] Added support for ES6 maps, sets, & symbols to _.clone, _.isEqual, & _.toArray -- [x] Enabled _.flow & _.flowRight to accept an array of functions -- [ ] Ensured “Collection†methods treat functions as objects -- [ ] Ensured _.assign, _.defaults, & _.merge coerce object values to objects -- [ ] Ensured _.bindKey bound functions call object[key] when called with the new operator -- [ ] Ensured _.isFunction returns true for generator functions -- [ ] Ensured _.merge assigns typed arrays directly -- [ ] Made _(...) an iterator & iterable -- [ ] Made _.drop, _.take, & right forms coerce n of undefined to 0 - -Methods: -- [ ] _.concat -- [ ] _.differenceBy -- [ ] _.differenceWith -- [ ] _.flatMap -- [ ] _.fromPairs -- [ ] _.intersectionBy -- [ ] _.intersectionWith -- [ ] _.join -- [ ] _.pullAll -- [ ] _.pullAllBy -- [ ] _.reverse -- [ ] _.sortedLastIndexOf -- [ ] _.unionBy -- [ ] _.unionWith -- [ ] _.uniqWith -- [ ] _.xorBy -- [ ] _.xorWith -- [ ] _.toString - -- [ ] _.invoke -- [ ] _.setWith -- [ ] _.toPairs -- [ ] _.toPairsIn -- [ ] _.unset - -- [ ] _.replace -- [ ] _.split - -- [ ] _.cond -- [ ] _.nthArg -- [ ] _.over -- [ ] _.overEvery -- [ ] _.overSome -- [ ] _.rangeRight - -- [ ] _.next -*/ +// util +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// export = _; export as namespace _; -declare let _: _.LoDashStatic; - -type PartialObject = Partial; - +declare const _: _.LoDashStatic; declare namespace _ { - type Many = T | T[]; - - interface LoDashStatic { - /** - * Creates a lodash object which wraps value to enable implicit method chain sequences. - * Methods that operate on and return arrays, collections, and functions can be chained together. - * Methods that retrieve a single value or may return a primitive value will automatically end the - * chain sequence and return the unwrapped value. Otherwise, the value must be unwrapped with value(). - * - * Explicit chain sequences, which must be unwrapped with value(), may be enabled using _.chain. - * - * The execution of chained methods is lazy, that is, it's deferred until value() is - * implicitly or explicitly called. - * - * Lazy evaluation allows several methods to support shortcut fusion. Shortcut fusion - * is an optimization to merge iteratee calls; this avoids the creation of intermediate - * arrays and can greatly reduce the number of iteratee executions. Sections of a chain - * sequence qualify for shortcut fusion if the section is applied to an array and iteratees - * accept only one argument. The heuristic for whether a section qualifies for shortcut - * fusion is subject to change. - * - * Chaining is supported in custom builds as long as the value() method is directly or - * indirectly included in the build. - * - * In addition to lodash methods, wrappers have Array and String methods. - * The wrapper Array methods are: - * concat, join, pop, push, shift, sort, splice, and unshift. - * The wrapper String methods are: - * replace and split. - * - * The wrapper methods that support shortcut fusion are: - * at, compact, drop, dropRight, dropWhile, filter, find, findLast, head, initial, last, - * map, reject, reverse, slice, tail, take, takeRight, takeRightWhile, takeWhile, and toArray - * - * The chainable wrapper methods are: - * after, ary, assign, assignIn, assignInWith, assignWith, at, before, bind, bindAll, bindKey, - * castArray, chain, chunk, commit, compact, concat, conforms, constant, countBy, create, - * curry, debounce, defaults, defaultsDeep, defer, delay, difference, differenceBy, differenceWith, - * drop, dropRight, dropRightWhile, dropWhile, extend, extendWith, fill, filter, flatMap, - * flatMapDeep, flatMapDepth, flatten, flattenDeep, flattenDepth, flip, flow, flowRight, - * fromPairs, functions, functionsIn, groupBy, initial, intersection, intersectionBy, intersectionWith, - * invert, invertBy, invokeMap, iteratee, keyBy, keys, keysIn, map, mapKeys, mapValues, - * matches, matchesProperty, memoize, merge, mergeWith, method, methodOf, mixin, negate, - * nthArg, omit, omitBy, once, orderBy, over, overArgs, overEvery, overSome, partial, partialRight, - * partition, pick, pickBy, plant, property, propertyOf, pull, pullAll, pullAllBy, pullAllWith, pullAt, - * push, range, rangeRight, rearg, reject, remove, rest, reverse, sampleSize, set, setWith, - * shuffle, slice, sort, sortBy, sortedUniq, sortedUniqBy, splice, spread, tail, take, - * takeRight, takeRightWhile, takeWhile, tap, throttle, thru, toArray, toPairs, toPairsIn, - * toPath, toPlainObject, transform, unary, union, unionBy, unionWith, uniq, uniqBy, uniqWith, - * unset, unshift, unzip, unzipWith, update, updateWith, values, valuesIn, without, wrap, - * xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, and zipWith. - * - * The wrapper methods that are not chainable by default are: - * add, attempt, camelCase, capitalize, ceil, clamp, clone, cloneDeep, cloneDeepWith, cloneWith, - * conformsTo, deburr, defaultTo, divide, each, eachRight, endsWith, eq, escape, escapeRegExp, - * every, find, findIndex, findKey, findLast, findLastIndex, findLastKey, first, floor, forEach, - * forEachRight, forIn, forInRight, forOwn, forOwnRight, get, gt, gte, has, hasIn, head, - * identity, includes, indexOf, inRange, invoke, isArguments, isArray, isArrayBuffer, - * isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isElement, isEmpty, isEqual, isEqualWith, - * isError, isFinite, isFunction, isInteger, isLength, isMap, isMatch, isMatchWith, isNaN, - * isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isRegExp, - * isSafeInteger, isSet, isString, isUndefined, isTypedArray, isWeakMap, isWeakSet, join, - * kebabCase, last, lastIndexOf, lowerCase, lowerFirst, lt, lte, max, maxBy, mean, meanBy, - * min, minBy, multiply, noConflict, noop, now, nth, pad, padEnd, padStart, parseInt, pop, - * random, reduce, reduceRight, repeat, result, round, runInContext, sample, shift, size, - * snakeCase, some, sortedIndex, sortedIndexBy, sortedLastIndex, sortedLastIndexBy, startCase, - * startsWith, stubArray, stubFalse, stubObject, stubString, stubTrue, subtract, sum, sumBy, - * template, times, toFinite, toInteger, toJSON, toLength, toLower, toNumber, toSafeInteger, - * toString, toUpper, trim, trimEnd, trimStart, truncate, unescape, uniqueId, upperCase, - * upperFirst, value, and words. - **/ - (value: T): LoDashImplicitWrapper; - - /** - * The semantic version number. - **/ - VERSION: string; - - /** - * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby - * (ERB). Change the following template settings to use alternative delimiters. - **/ - templateSettings: TemplateSettings; - } - - /** - * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby - * (ERB). Change the following template settings to use alternative delimiters. - **/ - interface TemplateSettings { - /** - * The "escape" delimiter. - **/ - escape?: RegExp; - - /** - * The "evaluate" delimiter. - **/ - evaluate?: RegExp; - - /** - * An object to import into the template as local variables. - **/ - imports?: Dictionary; - - /** - * The "interpolate" delimiter. - **/ - interpolate?: RegExp; - - /** - * Used to reference the data object in the template text. - **/ - variable?: string; - } - - /** - * Creates a cache object to store key/value pairs. - */ - interface MapCache { - /** - * Removes `key` and its value from the cache. - * @param key The key of the value to remove. - * @return Returns `true` if the entry was removed successfully, else `false`. - */ - delete(key: string): boolean; - - /** - * Gets the cached value for `key`. - * @param key The key of the value to get. - * @return Returns the cached value. - */ - get(key: string): any; - - /** - * Checks if a cached value for `key` exists. - * @param key The key of the entry to check. - * @return Returns `true` if an entry for `key` exists, else `false`. - */ - has(key: string): boolean; - - /** - * Sets `value` to `key` of the cache. - * @param key The key of the value to cache. - * @param value The value to cache. - * @return Returns the cache object. - */ - set(key: string, value: any): Dictionary; - - /** - * Removes all key-value entries from the map. - */ - clear(): void; - } - interface MapCacheConstructor { - new (): MapCache; - } - - interface LoDashWrapper { } - - interface LoDashImplicitWrapper extends LoDashWrapper { - pop(this: LoDashImplicitWrapper | null | undefined>): T | undefined; - push(this: LoDashImplicitWrapper | null | undefined>, ...items: T[]): this; - shift(this: LoDashImplicitWrapper | null | undefined>): T | undefined; - sort(this: LoDashImplicitWrapper | null | undefined>, compareFn?: (a: T, b: T) => number): this; - splice(this: LoDashImplicitWrapper | null | undefined>, start: number, deleteCount?: number, ...items: T[]): this; - unshift(this: LoDashImplicitWrapper | null | undefined>, ...items: T[]): this; - } - - interface LoDashExplicitWrapper extends LoDashWrapper { - pop(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - push(this: LoDashExplicitWrapper | null | undefined>, ...items: T[]): this; - shift(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - sort(this: LoDashExplicitWrapper | null | undefined>, compareFn?: (a: T, b: T) => number): this; - splice(this: LoDashExplicitWrapper | null | undefined>, start: number, deleteCount?: number, ...items: T[]): this; - unshift(this: LoDashExplicitWrapper | null | undefined>, ...items: T[]): this; - } - - /********* - * Array * - *********/ - - //_.chunk - interface LoDashStatic { - /** - * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the - * final chunk will be the remaining elements. - * - * @param array The array to process. - * @param size The length of each chunk. - * @return Returns the new array containing chunks. - */ - chunk( - array: List | null | undefined, - size?: number - ): T[][]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.chunk - */ - chunk( - this: LoDashImplicitWrapper | null | undefined>, - size?: number, - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.chunk - */ - chunk( - this: LoDashExplicitWrapper | null | undefined>, - size?: number, - ): LoDashExplicitWrapper; - } - - //_.compact - interface LoDashStatic { - /** - * Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are - * falsey. - * - * @param array The array to compact. - * @return Returns the new array of filtered values. - */ - compact(array: List | null | undefined): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.compact - */ - compact(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.compact - */ - compact(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - //_.concat - interface LoDashStatic { - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @category Array - * @param array The array to concatenate. - * @param [values] The values to concatenate. - * @returns Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - concat(array: Many, ...values: Array>): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.compact - */ - concat(this: LoDashImplicitWrapper>, ...values: Array>): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.compact - */ - concat(this: LoDashExplicitWrapper>, ...values: Array>): LoDashExplicitWrapper; - } - - //_.difference - interface LoDashStatic { - /** - * Creates an array of unique array values not included in the other provided arrays using SameValueZero for - * equality comparisons. - * - * @param array The array to inspect. - * @param values The arrays of values to exclude. - * @return Returns the new array of filtered values. - */ - difference( - array: List | null | undefined, - ...values: Array> - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.difference - */ - difference( - this: LoDashImplicitWrapper | null | undefined>, - ...values: Array> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.difference - */ - difference( - this: LoDashExplicitWrapper | null | undefined>, - ...values: Array> - ): LoDashExplicitWrapper; - } - - //_.differenceBy - interface LoDashStatic { - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - differenceBy( - array: List | null | undefined, - values: List, - iteratee: ValueIteratee - ): T1[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List | null | undefined, - values1: List, - values2: List, - iteratee: ValueIteratee - ): T1[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List | null | undefined, - values1: List, - values2: List, - values3: List, - iteratee: ValueIteratee - ): T1[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List | null | undefined, - values1: List, - values2: List, - values3: List, - values4: List, - iteratee: ValueIteratee - ): T1[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List | null | undefined, - values1: List, - values2: List, - values3: List, - values4: List, - values5: List, - iteratee: ValueIteratee - ): T1[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List | null | undefined, - values1: List, - values2: List, - values3: List, - values4: List, - values5: List, - ...values: Array | ValueIteratee> - ): T1[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List | null | undefined, - ...values: Array> - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashImplicitWrapper | null | undefined>, - values: List, - iteratee: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - iteratee: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - values3: List, - iteratee: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - values3: List, - values4: List, - iteratee: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - values3: List, - values4: List, - values5: List, - iteratee: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - values3: List, - values4: List, - values5: List, - ...values: Array | ValueIteratee> - ): LoDashImplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashImplicitWrapper | null | undefined>, - ...values: Array> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashExplicitWrapper | null | undefined>, - values: List, - iteratee: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - iteratee: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - values3: List, - iteratee: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - values3: List, - values4: List, - iteratee: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - values3: List, - values4: List, - values5: List, - iteratee: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - values3: List, - values4: List, - values5: List, - ...values: Array | ValueIteratee> - ): LoDashExplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashExplicitWrapper | null | undefined>, - ...values: Array> - ): LoDashExplicitWrapper; - } - - //_.differenceWith - interface LoDashStatic { - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - differenceWith( - array: List | null | undefined, - values: List, - comparator: Comparator2 - ): T1[]; - - /** - * @see _.differenceWith - */ - differenceWith( - array: List | null | undefined, - values1: List, - values2: List, - comparator: Comparator2 - ): T1[]; - - /** - * @see _.differenceWith - */ - differenceWith( - array: List | null | undefined, - values1: List, - values2: List, - ...values: Array | Comparator2> - ): T1[]; - - /** - * @see _.differenceWith - */ - differenceWith( - array: List | null | undefined, - ...values: Array> - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.differenceWith - */ - differenceWith( - this: LoDashImplicitWrapper | null | undefined>, - values: List, - comparator: Comparator2 - ): LoDashImplicitWrapper; - - /** - * @see _.differenceWith - */ - differenceWith( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - comparator: Comparator2 - ): LoDashImplicitWrapper; - - /** - * @see _.differenceWith - */ - differenceWith( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - ...values: Array | Comparator2> - ): LoDashImplicitWrapper; - - /** - * @see _.differenceWith - */ - differenceWith( - this: LoDashImplicitWrapper | null | undefined>, - ...values: Array> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.differenceWith - */ - differenceWith( - this: LoDashExplicitWrapper | null | undefined>, - values: List, - comparator: Comparator2 - ): LoDashExplicitWrapper; - - /** - * @see _.differenceWith - */ - differenceWith( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - comparator: Comparator2 - ): LoDashExplicitWrapper; - - /** - * @see _.differenceWith - */ - differenceWith( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - ...values: Array | Comparator2> - ): LoDashExplicitWrapper; - - /** - * @see _.differenceWith - */ - differenceWith( - this: LoDashExplicitWrapper | null | undefined>, - ...values: Array> - ): LoDashExplicitWrapper; - } - - //_.drop - interface LoDashStatic { - /** - * Creates a slice of array with n elements dropped from the beginning. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - drop(array: List | null | undefined, n?: number): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.drop - */ - drop(this: LoDashImplicitWrapper | null | undefined>, n?: number): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.drop - */ - drop(this: LoDashExplicitWrapper | null | undefined>, n?: number): LoDashExplicitWrapper; - } - - //_.dropRight - interface LoDashStatic { - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - dropRight( - array: List | null | undefined, - n?: number - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.dropRight - */ - dropRight(this: LoDashImplicitWrapper | null | undefined>, n?: number): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.dropRight - */ - dropRight(this: LoDashExplicitWrapper | null | undefined>, n?: number): LoDashExplicitWrapper; - } - - //_.dropRightWhile - interface LoDashStatic { - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - dropRightWhile( - array: List | null | undefined, - predicate?: ListIteratee - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.dropRightWhile - */ - dropRightWhile( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIteratee - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.dropRightWhile - */ - dropRightWhile( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIteratee - ): LoDashExplicitWrapper; - } - - //_.dropWhile - interface LoDashStatic { - /** - * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - dropWhile( - array: List | null | undefined, - predicate?: ListIteratee - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.dropWhile - */ - dropWhile( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIteratee - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.dropWhile - */ - dropWhile( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIteratee - ): LoDashExplicitWrapper; - } - - //_.fill - interface LoDashStatic { - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - fill( - array: any[] | null | undefined, - value: T - ): T[]; - - /** - * @see _.fill - */ - fill( - array: List | null | undefined, - value: T - ): List; - - /** - * @see _.fill - */ - fill( - array: U[] | null | undefined, - value: T, - start?: number, - end?: number - ): Array; - - /** - * @see _.fill - */ - fill( - array: List | null | undefined, - value: T, - start?: number, - end?: number - ): List; - } - - interface LoDashImplicitWrapper { - /** - * @see _.fill - */ - fill( - this: LoDashImplicitWrapper, - value: T - ): LoDashImplicitWrapper; - - /** - * @see _.fill - */ - fill( - this: LoDashImplicitWrapper | null | undefined>, - value: T - ): LoDashImplicitWrapper>; - - /** - * @see _.fill - */ - fill( - this: LoDashImplicitWrapper, - value: T, - start?: number, - end?: number - ): LoDashImplicitWrapper>; - - /** - * @see _.fill - */ - fill( - this: LoDashImplicitWrapper | null | undefined>, - value: T, - start?: number, - end?: number - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.fill - */ - fill( - this: LoDashExplicitWrapper, - value: T - ): LoDashExplicitWrapper; - - /** - * @see _.fill - */ - fill( - this: LoDashExplicitWrapper | null | undefined>, - value: T - ): LoDashExplicitWrapper>; - - /** - * @see _.fill - */ - fill( - this: LoDashExplicitWrapper, - value: T, - start?: number, - end?: number - ): LoDashExplicitWrapper>; - - /** - * @see _.fill - */ - fill( - this: LoDashExplicitWrapper | null | undefined>, - value: T, - start?: number, - end?: number - ): LoDashExplicitWrapper>; - } - - //_.findIndex - interface LoDashStatic { - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - findIndex( - array: List | null | undefined, - predicate?: ListIterateeCustom, - fromIndex?: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.findIndex - */ - findIndex( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom, - fromIndex?: number - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.findIndex - */ - findIndex( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom, - fromIndex?: number - ): LoDashExplicitWrapper; - } - - //_.findLastIndex - interface LoDashStatic { - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - findLastIndex( - array: List | null | undefined, - predicate?: ListIterateeCustom, - fromIndex?: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.findLastIndex - */ - findLastIndex( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom, - fromIndex?: number - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.findLastIndex - */ - findLastIndex( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom, - fromIndex?: number - ): LoDashExplicitWrapper; - } - - //_.first - interface LoDashStatic { - first: typeof _.head; // tslint:disable-line:no-unnecessary-qualifier - } - - interface LoDashImplicitWrapper { - /** - * @see _.head - */ - first(this: LoDashImplicitWrapper | null | undefined>): T | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.head - */ - first(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - interface RecursiveArray extends Array> {} - interface ListOfRecursiveArraysOrValues extends List> {} - - //_.flatten - interface LoDashStatic { - /** - * Flattens a nested array. If isDeep is true the array is recursively flattened, otherwise it’s only - * flattened a single level. - * - * @param array The array to flatten. - * @param isDeep Specify a deep flatten. - * @return Returns the new flattened array. - */ - flatten(array: ListOfRecursiveArraysOrValues | null | undefined, isDeep: boolean): T[]; - - /** - * @see _.flatten - */ - flatten(array: List> | null | undefined): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flatten - */ - flatten(this: LoDashImplicitWrapper | null | undefined>, isDeep: boolean): LoDashImplicitWrapper; - - /** - * @see _.flatten - */ - flatten(this: LoDashImplicitWrapper> | null | undefined>): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flatten - */ - flatten(this: LoDashExplicitWrapper | null | undefined>, isDeep: boolean): LoDashExplicitWrapper; - - /** - * @see _.flatten - */ - flatten(this: LoDashExplicitWrapper> | null | undefined>): LoDashExplicitWrapper; - } - - //_.flattenDeep - interface LoDashStatic { - /** - * Recursively flattens a nested array. - * - * @param array The array to recursively flatten. - * @return Returns the new flattened array. - */ - flattenDeep(array: ListOfRecursiveArraysOrValues | null | undefined): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flattenDeep - */ - flattenDeep(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flattenDeep - */ - flattenDeep(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - // _.flattenDepth - interface LoDashStatic { - /** - * Recursively flatten array up to depth times. - * - * @param array The array to recursively flatten. - * @param number The maximum recursion depth. - * @return Returns the new flattened array. - */ - flattenDepth(array: ListOfRecursiveArraysOrValues | null | undefined, depth?: number): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flattenDeep - */ - flattenDepth(this: LoDashImplicitWrapper | null | undefined>, depth?: number): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flattenDeep - */ - flattenDepth(this: LoDashExplicitWrapper | null | undefined>, depth?: number): LoDashExplicitWrapper; - } - - //_.fromPairs - interface LoDashStatic { - /** - * The inverse of `_.toPairs`; this method returns an object composed - * from key-value `pairs`. - * - * @category Array - * @param pairs The key-value pairs. - * @returns Returns the new object. - * @example - * - * _.fromPairs([['fred', 30], ['barney', 40]]); - * // => { 'fred': 30, 'barney': 40 } - */ - fromPairs( - pairs: List<[PropertyName, T]> | null | undefined - ): Dictionary; - - /** - @see _.fromPairs - */ - fromPairs( - pairs: List | null | undefined - ): Dictionary; - } - - //_.fromPairs - interface LoDashImplicitWrapper { - /** - * @see _.fromPairs - */ - fromPairs( - this: LoDashImplicitWrapper | null | undefined> - ): LoDashImplicitWrapper>; - - /** - @see _.fromPairs - */ - fromPairs( - this: LoDashImplicitWrapper | null | undefined> - ): LoDashImplicitWrapper>; - } - //_.fromPairs - interface LoDashExplicitWrapper { - /** - * @see _.fromPairs - */ - fromPairs( - this: LoDashExplicitWrapper | null | undefined> - ): LoDashExplicitWrapper>; - - /** - @see _.fromPairs - */ - fromPairs( - this: LoDashExplicitWrapper | null | undefined> - ): LoDashExplicitWrapper>; - } - - //_.head - interface LoDashStatic { - /** - * Gets the first element of array. - * - * @alias _.first - * - * @param array The array to query. - * @return Returns the first element of array. - */ - head(array: List | null | undefined): T | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.head - */ - head(this: LoDashImplicitWrapper | null | undefined>): T | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.head - */ - head(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - //_.indexOf - interface LoDashStatic { - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. If `array` is sorted providing `true` for `fromIndex` - * performs a faster binary search. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - indexOf( - array: List | null | undefined, - value: T, - fromIndex?: boolean|number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.indexOf - */ - indexOf( - this: LoDashImplicitWrapper | null | undefined>, - value: T, - fromIndex?: boolean|number - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.indexOf - */ - indexOf( - this: LoDashExplicitWrapper | null | undefined>, - value: T, - fromIndex?: boolean|number - ): LoDashExplicitWrapper; - } - - //_.sortedIndexOf - interface LoDashStatic { - /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedIndexOf([1, 1, 2, 2], 2); - * // => 2 - */ - sortedIndexOf( - array: List | null | undefined, - value: T - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedIndexOf - */ - sortedIndexOf( - this: LoDashImplicitWrapper | null | undefined>, - value: T - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedIndexOf - */ - sortedIndexOf( - this: LoDashExplicitWrapper | null | undefined>, - value: T - ): LoDashExplicitWrapper; - } - - //_.initial - interface LoDashStatic { - /** - * Gets all but the last element of array. - * - * @param array The array to query. - * @return Returns the slice of array. - */ - initial(array: List | null | undefined): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.initial - */ - initial(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.initial - */ - initial(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - //_.intersection - interface LoDashStatic { - /** - * Creates an array of unique values that are included in all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of shared values. - */ - intersection(...arrays: Array>): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.intersection - */ - intersection( - this: LoDashImplicitWrapper>, - ...arrays: Array> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.intersection - */ - intersection( - this: LoDashExplicitWrapper>, - ...arrays: Array> - ): LoDashExplicitWrapper; - } - - //_.intersectionBy - interface LoDashStatic { - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - intersectionBy( - array: List | null, - values: List, - iteratee: ValueIteratee - ): T1[]; - - /** - * @see _.intersectionBy - */ - intersectionBy( - array: List | null, - values1: List, - values2: List, - iteratee: ValueIteratee - ): T1[]; - - /** - * @see _.intersectionBy - */ - intersectionBy( - array: List | null | undefined, - values1: List, - values2: List, - ...values: Array | ValueIteratee> - ): T1[]; - - /** - * @see _.intersectionBy - */ - intersectionBy( - array?: List | null, - ...values: Array> - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.intersectionBy - */ - intersectionBy( - this: LoDashImplicitWrapper | null | undefined>, - values: List, - iteratee: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.intersectionBy - */ - intersectionBy( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - iteratee: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.intersectionBy - */ - intersectionBy( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - ...values: Array | ValueIteratee> - ): LoDashImplicitWrapper; - - /** - * @see _.intersectionBy - */ - intersectionBy( - this: LoDashImplicitWrapper | null | undefined>, - ...values: Array> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.intersectionBy - */ - intersectionBy( - this: LoDashExplicitWrapper | null | undefined>, - values: List, - iteratee: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.intersectionBy - */ - intersectionBy( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - iteratee: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.intersectionBy - */ - intersectionBy( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - ...values: Array | ValueIteratee> - ): LoDashExplicitWrapper; - - /** - * @see _.intersectionBy - */ - intersectionBy( - this: LoDashExplicitWrapper | null | undefined>, - ...values: Array> - ): LoDashExplicitWrapper; - } - - //_.intersectionWith - interface LoDashStatic { - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - intersectionWith( - array: List | null | undefined, - values: List, - comparator: Comparator2 - ): T1[]; - - /** - * @see _.intersectionWith - */ - intersectionWith( - array: List | null | undefined, - values1: List, - values2: List, - comparator: Comparator2 - ): T1[]; - - /** - * @see _.intersectionWith - */ - intersectionWith( - array: List | null | undefined, - values1: List, - values2: List, - ...values: Array | Comparator2> - ): T1[]; - - /** - * @see _.intersectionWith - */ - intersectionWith( - array?: List | null, - ...values: Array> - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.intersectionWith - */ - intersectionWith( - this: LoDashImplicitWrapper | null | undefined>, - values: List, - comparator: Comparator2 - ): LoDashImplicitWrapper; - - /** - * @see _.intersectionWith - */ - intersectionWith( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - comparator: Comparator2 - ): LoDashImplicitWrapper; - - /** - * @see _.intersectionWith - */ - intersectionWith( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - ...values: Array | Comparator2>, - ): LoDashImplicitWrapper; - - /** - * @see _.intersectionWith - */ - intersectionWith( - this: LoDashImplicitWrapper | null | undefined>, - ...values: Array> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.intersectionWith - */ - intersectionWith( - this: LoDashExplicitWrapper | null | undefined>, - values: List, - comparator: Comparator2 - ): LoDashExplicitWrapper; - - /** - * @see _.intersectionWith - */ - intersectionWith( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - comparator: Comparator2 - ): LoDashExplicitWrapper; - - /** - * @see _.intersectionWith - */ - intersectionWith( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - ...values: Array | Comparator2>, - ): LoDashExplicitWrapper; - - /** - * @see _.intersectionWith - */ - intersectionWith( - this: LoDashExplicitWrapper | null | undefined>, - ...values: Array> - ): LoDashExplicitWrapper; - } - - //_.join - interface LoDashStatic { - /** - * Converts all elements in `array` into a string separated by `separator`. - * - * @param array The array to convert. - * @param separator The element separator. - * @returns Returns the joined string. - */ - join( - array: List | null | undefined, - separator?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.join - */ - join(separator?: string): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.join - */ - join(separator?: string): LoDashExplicitWrapper; - } - - //_.reverse - interface LoDashStatic { - /** - * Reverses `array` so that the first element becomes the last, the second - * element becomes the second to last, and so on. - * - * **Note:** This method mutates `array` and is based on - * [`Array#reverse`](https://mdn.io/Array/reverse). - * - * @category Array - * @returns Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.reverse(array); - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - reverse>( - array: TList, - ): TList; - } - - //_.prototype.reverse - interface LoDashWrapper { - /** - * Reverses the wrapped array so the first element becomes the last, the second element becomes the second to - * last, and so on. - * - * Note: This method mutates the wrapped array. - * - * @return Returns the new reversed lodash wrapper instance. - */ - reverse(): this; - } - - //_.last - interface LoDashStatic { - /** - * Gets the last element of array. - * - * @param array The array to query. - * @return Returns the last element of array. - */ - last(array: List | null | undefined): T | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.last - */ - last(this: LoDashImplicitWrapper | null | undefined>): T | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.last - */ - last(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - //_.lastIndexOf - interface LoDashStatic { - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - lastIndexOf( - array: List | null | undefined, - value: T, - fromIndex?: true|number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.indexOf - */ - lastIndexOf( - this: LoDashImplicitWrapper | null | undefined>, - value: T, - fromIndex?: true|number - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.indexOf - */ - lastIndexOf( - this: LoDashExplicitWrapper | null | undefined>, - value: T, - fromIndex?: true|number - ): LoDashExplicitWrapper; - } - - //_.nth - interface LoDashStatic { - /** - * Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned. - * - * @param array array The array to query. - * @param value The index of the element to return. - * @return Returns the nth element of `array`. - */ - nth( - array: List | null | undefined, - n?: number - ): T | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.nth - */ - nth( - this: LoDashImplicitWrapper | null | undefined>, - n?: number - ): T | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.nth - */ - nth( - this: LoDashExplicitWrapper | null | undefined>, - n?: number - ): LoDashExplicitWrapper; - } - - //_.pull - interface LoDashStatic { - /** - * Removes all provided values from array using SameValueZero for equality comparisons. - * - * Note: Unlike _.without, this method mutates array. - * - * @param array The array to modify. - * @param values The values to remove. - * @return Returns array. - */ - pull( - array: T[], - ...values: T[] - ): T[]; - - /** - * @see _.pull - */ - pull( - array: List, - ...values: T[] - ): List; - } - - interface LoDashImplicitWrapper { - /** - * @see _.pull - */ - pull( - this: LoDashImplicitWrapper>, - ...values: T[] - ): this; - } - - interface LoDashExplicitWrapper { - /** - * @see _.pull - */ - pull( - this: LoDashExplicitWrapper>, - ...values: T[] - ): this; - } - - //_.pullAt - interface LoDashStatic { - /** - * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. - * Indexes may be specified as an array of indexes or as individual arguments. - * - * Note: Unlike _.at, this method mutates array. - * - * @param array The array to modify. - * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. - * @return Returns the new array of removed elements. - */ - pullAt( - array: T[], - ...indexes: Array> - ): T[]; - - /** - * @see _.pullAt - */ - pullAt( - array: List, - ...indexes: Array> - ): List; - } - - interface LoDashWrapper { - /** - * @see _.pullAt - */ - pullAt(...indexes: Array>): this; - } - - //_.pullAll - interface LoDashStatic { - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @returns Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, [2, 3]); - * console.log(array); - * // => [1, 1] - */ - pullAll( - array: T[], - values?: List, - ): T[]; - - /** - * @see _.pullAll - */ - pullAll( - array: List, - values?: List, - ): List; - } - - interface LoDashImplicitWrapper { - /** - * @see _.pullAll - */ - pullAll( - this: LoDashImplicitWrapper>, - values?: List - ): this; - } - - interface LoDashExplicitWrapper { - /** - * @see _.pullAll - */ - pullAll( - this: LoDashExplicitWrapper>, - values?: List - ): this; - } - - //_.pullAllBy - interface LoDashStatic { - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - pullAllBy( - array: T[], - values?: List, - iteratee?: ValueIteratee - ): T[]; - - /** - * @see _.pullAllBy - */ - pullAllBy( - array: List, - values?: List, - iteratee?: ValueIteratee - ): List; - - /** - * @see _.pullAllBy - */ - pullAllBy( - array: T1[], - values: List, - iteratee: ValueIteratee - ): T1[]; - - /** - * @see _.pullAllBy - */ - pullAllBy( - array: List, - values: List, - iteratee: ValueIteratee - ): List; - } - - interface LoDashWrapper { - /** - * @see _.pullAllBy - */ - pullAllBy( - this: LoDashWrapper>, - values?: List, - iteratee?: ValueIteratee - ): this; - - /** - * @see _.pullAllBy - */ - pullAllBy( - this: LoDashWrapper>, - values: List, - iteratee: ValueIteratee - ): this; - } - - //_.pullAllWith - interface LoDashStatic { - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - pullAllWith( - array: T[], - values?: List, - comparator?: Comparator - ): T[]; - - /** - * @see _.pullAllWith - */ - pullAllWith( - array: List, - values?: List, - comparator?: Comparator - ): List; - - /** - * @see _.pullAllWith - */ - pullAllWith( - array: T1[], - values: List, - comparator: Comparator2 - ): T1[]; - - /** - * @see _.pullAllWith - */ - pullAllWith( - array: List, - values: List, - comparator: Comparator2 - ): List; - } - - interface LoDashWrapper { - /** - * @see _.pullAllWith - */ - pullAllWith( - this: LoDashWrapper>, - values?: List, - comparator?: Comparator - ): this; - - /** - * @see _.pullAllWith - */ - pullAllWith( - this: LoDashWrapper>, - values: List, - comparator: Comparator2 - ): this; - } - - //_.remove - interface LoDashStatic { - /** - * Removes all elements from array that predicate returns truthy for and returns an array of the removed - * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * Note: Unlike _.filter, this method mutates array. - * - * @param array The array to modify. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new array of removed elements. - */ - remove( - array: List, - predicate?: ListIteratee - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.remove - */ - remove( - this: LoDashImplicitWrapper>, - predicate?: ListIteratee - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.remove - */ - remove( - this: LoDashExplicitWrapper>, - predicate?: ListIteratee - ): LoDashExplicitWrapper; - } - - //_.tail - interface LoDashStatic { - /** - * Gets all but the first element of array. - * - * @param array The array to query. - * @return Returns the slice of array. - */ - tail(array: List | null | undefined): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.tail - */ - tail(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.tail - */ - tail(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - //_.slice - interface LoDashStatic { - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - slice( - array: List | null | undefined, - start?: number, - end?: number - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.slice - */ - slice( - this: LoDashImplicitWrapper | null | undefined>, - start?: number, - end?: number - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.slice - */ - slice( - this: LoDashExplicitWrapper | null | undefined>, - start?: number, - end?: number - ): LoDashExplicitWrapper; - } - - //_.sortedIndex - interface LoDashStatic { - /** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 5], 4); - * // => 0 - */ - sortedIndex( - array: List | null | undefined, - value: T - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedIndex - */ - sortedIndex( - this: LoDashImplicitWrapper | null | undefined>, - value: T - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedIndex - */ - sortedIndex( - this: LoDashExplicitWrapper | null | undefined>, - value: T - ): LoDashExplicitWrapper; - } - - // _.sortedIndexBy - interface LoDashStatic { - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - sortedIndexBy( - array: List | null | undefined, - value: T, - iteratee?: ValueIteratee - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - this: LoDashImplicitWrapper | null | undefined>, - value: T, - iteratee?: ValueIteratee - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - this: LoDashExplicitWrapper | null | undefined>, - value: T, - iteratee?: ValueIteratee - ): LoDashExplicitWrapper; - } - - //_.sortedLastIndex - interface LoDashStatic { - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedLastIndex([4, 5], 4); - * // => 1 - */ - sortedLastIndex( - array: List | null | undefined, - value: T - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - this: LoDashImplicitWrapper | null | undefined>, - value: T - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - this: LoDashExplicitWrapper | null | undefined>, - value: T - ): LoDashExplicitWrapper; - } - - //_.sortedLastIndexBy - interface LoDashStatic { - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - sortedLastIndexBy( - array: List | null | undefined, - value: T, - iteratee: ValueIteratee - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - this: LoDashImplicitWrapper | null | undefined>, - value: T, - iteratee: ValueIteratee - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - this: LoDashExplicitWrapper | null | undefined>, - value: T, - iteratee: ValueIteratee - ): LoDashExplicitWrapper; - } - - //_.sortedLastIndexOf - interface LoDashStatic { - /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedLastIndexOf([1, 1, 2, 2], 2); - * // => 3 - */ - sortedLastIndexOf( - array: List | null | undefined, - value: T - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedLastIndexOf - */ - sortedLastIndexOf( - this: LoDashImplicitWrapper | null | undefined>, - value: T - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedLastIndexOf - */ - sortedLastIndexOf( - this: LoDashExplicitWrapper | null | undefined>, - value: T - ): LoDashExplicitWrapper; - } - - //_.take - interface LoDashStatic { - /** - * Creates a slice of array with n elements taken from the beginning. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - take( - array: List | null | undefined, - n?: number - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.take - */ - take( - this: LoDashImplicitWrapper | null | undefined>, - n?: number - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.take - */ - take( - this: LoDashExplicitWrapper | null | undefined>, - n?: number - ): LoDashExplicitWrapper; - } - - //_.takeRight - interface LoDashStatic { - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - takeRight( - array: List | null | undefined, - n?: number - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.takeRight - */ - takeRight( - this: LoDashImplicitWrapper | null | undefined>, - n?: number - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.takeRight - */ - takeRight( - this: LoDashExplicitWrapper | null | undefined>, - n?: number - ): LoDashExplicitWrapper; - } - - //_.takeRightWhile - interface LoDashStatic { - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - takeRightWhile( - array: List | null | undefined, - predicate?: ListIteratee - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.takeRightWhile - */ - takeRightWhile( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIteratee - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.takeRightWhile - */ - takeRightWhile( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIteratee - ): LoDashExplicitWrapper; - } - - //_.takeWhile - interface LoDashStatic { - /** - * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - takeWhile( - array: List | null | undefined, - predicate?: ListIteratee - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.takeWhile - */ - takeWhile( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIteratee - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.takeWhile - */ - takeWhile( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIteratee - ): LoDashExplicitWrapper; - } - - //_.union - interface LoDashStatic { - /** - * Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of combined values. - */ - union(...arrays: Array | null | undefined>): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.union - */ - union( - this: LoDashImplicitWrapper | null | undefined>, - ...arrays: Array | null | undefined> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.union - */ - union( - this: LoDashExplicitWrapper | null | undefined>, - ...arrays: Array | null | undefined> - ): LoDashExplicitWrapper; - } - - //_.unionBy - interface LoDashStatic { - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - unionBy( - arrays: List | null | undefined, - iteratee?: ValueIteratee - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: List | null | undefined, - arrays2: List | null | undefined, - iteratee?: ValueIteratee - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: List | null | undefined, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - iteratee?: ValueIteratee - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: List | null | undefined, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - iteratee?: ValueIteratee - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: List | null | undefined, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - arrays5: List | null | undefined, - ...iteratee: Array | List | null | undefined> - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.unionBy - */ - unionBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.unionBy - */ - unionBy( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - iteratee?: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.unionBy - */ - unionBy( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - iteratee?: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.unionBy - */ - unionBy( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - iteratee?: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.unionBy - */ - unionBy( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - arrays5: List | null | undefined, - ...iteratee: Array | List | null | undefined> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.unionBy - */ - unionBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.unionBy - */ - unionBy( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - iteratee?: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.unionBy - */ - unionBy( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - iteratee?: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.unionBy - */ - unionBy( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - iteratee?: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.unionBy - */ - unionBy( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - arrays5: List | null | undefined, - ...iteratee: Array | List | null | undefined> - ): LoDashExplicitWrapper; - } - - //_.unionWith - interface LoDashStatic { - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - unionWith( - arrays: List | null | undefined, - comparator?: Comparator - ): T[]; - - /** - * @see _.unionBy - */ - unionWith( - arrays: List | null | undefined, - arrays2: List | null | undefined, - comparator?: Comparator - ): T[]; - - /** - * @see _.unionWith - */ - unionWith( - arrays: List | null | undefined, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - ...comparator: Array | List | null | undefined> - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.unionWith - */ - unionWith( - this: LoDashImplicitWrapper | null | undefined>, - comparator?: Comparator - ): LoDashImplicitWrapper; - - /** - * @see _.unionWith - */ - unionWith( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - comparator?: Comparator - ): LoDashImplicitWrapper; - - /** - * @see _.unionWith - */ - unionWith( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - ...comparator: Array | List | null | undefined> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.unionWith - */ - unionWith( - this: LoDashExplicitWrapper | null | undefined>, - comparator?: Comparator - ): LoDashExplicitWrapper; - - /** - * @see _.unionWith - */ - unionWith( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - comparator?: Comparator - ): LoDashExplicitWrapper; - - /** - * @see _.unionWith - */ - unionWith( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - ...comparator: Array | List | null | undefined> - ): LoDashExplicitWrapper; - } - - //_.uniq - interface LoDashStatic { - /** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurrence of each element - * is kept. - * - * @category Array - * @param array The array to inspect. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniq([2, 1, 2]); - * // => [2, 1] - */ - uniq( - array: List | null | undefined - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.uniq - */ - uniq(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.uniq - */ - uniq(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - //_.uniqBy - interface LoDashStatic { - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The array to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - uniqBy( - array: string | null | undefined, - iteratee: StringIterator - ): string[]; - - /** - * @see _.uniqBy - */ - uniqBy( - array: List | null | undefined, - iteratee: ListIteratee - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.uniqBy - */ - uniqBy( - this: LoDashImplicitWrapper, - iteratee: StringIterator - ): LoDashImplicitWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: ListIteratee - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.uniqBy - */ - uniqBy( - this: LoDashExplicitWrapper, - iteratee: StringIterator - ): LoDashExplicitWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: ListIteratee - ): LoDashExplicitWrapper; - } - - //_.uniqWith - interface LoDashStatic { - /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param array The array to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] - */ - uniqWith( - array: List | null | undefined, - comparator?: Comparator - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.uniqWith - */ - uniqWith( - this: LoDashImplicitWrapper | null | undefined>, - comparator?: Comparator - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.uniqWith - */ - uniqWith( - this: LoDashExplicitWrapper | null | undefined>, - comparator?: Comparator - ): LoDashExplicitWrapper; - } - - //_.sortedUniq - interface LoDashStatic { - /** - * This method is like `_.uniq` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniq([1, 1, 2]); - * // => [1, 2] - */ - sortedUniq( - array: List | null | undefined - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedUniq - */ - sortedUniq(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedUniq - */ - sortedUniq(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - //_.sortedUniqBy - interface LoDashStatic { - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @param [iteratee] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - sortedUniqBy( - array: string | null | undefined, - iteratee: StringIterator - ): string[]; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - array: List | null | undefined, - iteratee: ListIteratee - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - this: LoDashImplicitWrapper, - iteratee: StringIterator - ): LoDashImplicitWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: ListIteratee - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - this: LoDashExplicitWrapper, - iteratee: StringIterator - ): LoDashExplicitWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: ListIteratee - ): LoDashExplicitWrapper; - } - - //_.unzip - interface LoDashStatic { - /** - * This method is like _.zip except that it accepts an array of grouped elements and creates an array - * regrouping the elements to their pre-zip configuration. - * - * @param array The array of grouped elements to process. - * @return Returns the new array of regrouped elements. - */ - unzip(array: T[][] | List> | null | undefined): T[][]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.unzip - */ - unzip(this: LoDashImplicitWrapper> | null | undefined>): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.unzip - */ - unzip(this: LoDashExplicitWrapper> | null | undefined>): LoDashExplicitWrapper; - } - - //_.unzipWith - interface LoDashStatic { - /** - * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * - * @param array The array of grouped elements to process. - * @param iteratee The function to combine regrouped values. - * @param thisArg The this binding of iteratee. - * @return Returns the new array of regrouped elements. - */ - unzipWith( - array: List> | null | undefined, - iteratee: (...values: T[]) => TResult - ): TResult[]; - - /** - * @see _.unzipWith - */ - unzipWith( - array: List> | null | undefined - ): T[][]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.unzipWith - */ - unzipWith( - this: LoDashImplicitWrapper> | null | undefined>, - iteratee: (...values: T[]) => TResult - ): LoDashImplicitWrapper; - - /** - * @see _.unzipWith - */ - unzipWith( - this: LoDashImplicitWrapper> | null | undefined> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.unzipWith - */ - unzipWith( - this: LoDashExplicitWrapper> | null | undefined>, - iteratee: (...values: T[]) => TResult - ): LoDashExplicitWrapper; - - /** - * @see _.unzipWith - */ - unzipWith( - this: LoDashExplicitWrapper> | null | undefined> - ): LoDashExplicitWrapper; - } - - //_.without - interface LoDashStatic { - /** - * Creates an array excluding all provided values using SameValueZero for equality comparisons. - * - * @param array The array to filter. - * @param values The values to exclude. - * @return Returns the new array of filtered values. - */ - without( - array: List | null | undefined, - ...values: T[] - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.without - */ - without( - this: LoDashImplicitWrapper | null | undefined>, - ...values: T[] - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.without - */ - without( - this: LoDashExplicitWrapper | null | undefined>, - ...values: T[] - ): LoDashExplicitWrapper; - } - - //_.xor - interface LoDashStatic { - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - xor(...arrays: Array | null | undefined>): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.xor - */ - xor( - this: LoDashImplicitWrapper | null | undefined>, - ...arrays: Array | null | undefined> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.xor - */ - xor( - this: LoDashExplicitWrapper | null | undefined>, - ...arrays: Array | null | undefined> - ): LoDashExplicitWrapper; - } - - //_.xorBy - interface LoDashStatic { - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - xorBy( - arrays: List | null | undefined, - iteratee?: ValueIteratee - ): T[]; - - /** - * @see _.xorBy - */ - xorBy( - arrays: List | null | undefined, - arrays2: List | null | undefined, - iteratee?: ValueIteratee - ): T[]; - - /** - * @see _.xorBy - */ - xorBy( - arrays: List | null | undefined, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - ...iteratee: Array | List | null | undefined> - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.xor - */ - xorBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.xorBy - */ - xorBy( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - iteratee?: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.xorBy - */ - xorBy( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - ...iteratee: Array | List | null | undefined> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.xorBy - */ - xorBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.xorBy - */ - xorBy( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - iteratee?: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.xorBy - */ - xorBy( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - ...iteratee: Array | List | null | undefined> - ): LoDashExplicitWrapper; - } - - //_.xorWith - interface LoDashStatic { - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - xorWith( - arrays: List | null | undefined, - comparator?: Comparator - ): T[]; - - /** - * @see _.xorWith - */ - xorWith( - arrays: List | null | undefined, - arrays2: List | null | undefined, - comparator?: Comparator - ): T[]; - - /** - * @see _.xorWith - */ - xorWith( - arrays: List | null | undefined, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - ...comparator: Array | List | null | undefined> - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.xorWith - */ - xorWith( - this: LoDashImplicitWrapper | null | undefined>, - comparator?: Comparator - ): LoDashImplicitWrapper; - - /** - * @see _.xorWith - */ - xorWith( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - comparator?: Comparator - ): LoDashImplicitWrapper; - - /** - * @see _.xorWith - */ - xorWith( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - ...comparator: Array | List | null | undefined> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.xorWith - */ - xorWith( - this: LoDashExplicitWrapper | null | undefined>, - comparator?: Comparator - ): LoDashExplicitWrapper; - - /** - * @see _.xorWith - */ - xorWith( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - comparator?: Comparator - ): LoDashExplicitWrapper; - - /** - * @see _.xorWith - */ - xorWith( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - ...comparator: Array | List | null | undefined> - ): LoDashExplicitWrapper; - } - - //_.zip - interface LoDashStatic { - /** - * Creates an array of grouped elements, the first of which contains the first elements of the given arrays, - * the second of which contains the second elements of the given arrays, and so on. - * - * @param arrays The arrays to process. - * @return Returns the new array of grouped elements. - */ - zip(...arrays: Array | null | undefined>): T[][]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.zip - */ - zip( - this: LoDashImplicitWrapper | null | undefined>, - ...arrays: Array | null | undefined> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.zip - */ - zip( - this: LoDashExplicitWrapper | null | undefined>, - ...arrays: Array | null | undefined> - ): LoDashExplicitWrapper; - } - - //_.zipObject - interface LoDashStatic { - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - zipObject( - props: List, - values: List - ): Dictionary; - - /** - * @see _.zipObject - */ - zipObject( - props?: List - ): Dictionary; - - /** - * This method is like _.zipObject except that it supports property paths. - * - * @param paths The property names. - * @param values The property values. - * @return Returns the new object. - */ - zipObjectDeep( - paths?: List, - values?: List - ): object; - } - - interface LoDashImplicitWrapper { - /** - * @see _.zipObject - */ - zipObject( - this: LoDashImplicitWrapper>, - values: List - ): LoDashImplicitWrapper>; - - /** - * @see _.zipObject - */ - zipObject( - this: LoDashImplicitWrapper> - ): LoDashImplicitWrapper>; - - /** - * @see _.zipObjectDeep - */ - zipObjectDeep( - this: LoDashImplicitWrapper>, - values?: List - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.zipObject - */ - zipObject( - this: LoDashExplicitWrapper>, - values: List - ): LoDashExplicitWrapper>; - - /** - * @see _.zipObject - */ - zipObject( - this: LoDashExplicitWrapper> - ): LoDashExplicitWrapper>; - - /** - * @see _.zipObjectDeep - */ - zipObjectDeep( - this: LoDashExplicitWrapper>, - values?: List - ): LoDashExplicitWrapper; - } - - //_.zipWith - interface LoDashStatic { - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - zipWith( - ...arrays: Array | null | undefined> - ): T[][]; - - /** - * @see _.zipWith - */ - zipWith( - arrays: List | null | undefined, - iteratee: (value1: T) => TResult - ): TResult[]; - - /** - * @see _.zipWith - */ - zipWith( - arrays: List | null | undefined, - arrays2: List | null | undefined, - iteratee: (value1: T, value2: T) => TResult - ): TResult[]; - - /** - * @see _.zipWith - */ - zipWith( - arrays: List | null | undefined, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - iteratee: (value1: T, value2: T, value3: T) => TResult - ): TResult[]; - - /** - * @see _.zipWith - */ - zipWith( - arrays: List | null | undefined, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - iteratee: (value1: T, value2: T, value3: T, value4: T) => TResult - ): TResult[]; - - /** - * @see _.zipWith - */ - zipWith( - arrays: List | null | undefined, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - arrays5: List | null | undefined, - iteratee: (value1: T, value2: T, value3: T, value4: T, value5: T) => TResult - ): TResult[]; - - zipWith( - ...iteratee: Array<((...group: T[]) => TResult) | List | null | undefined> - ): TResult[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.zipWith - */ - zipWith( - this: LoDashImplicitWrapper | null | undefined>, - ...arrays: Array | null | undefined> - ): LoDashImplicitWrapper; - - /** - * @see _.zipWith - */ - zipWith( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: (value1: T) => TResult - ): LoDashImplicitWrapper; - - /** - * @see _.zipWith - */ - zipWith( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - iteratee: (value1: T, value2: T) => TResult - ): LoDashImplicitWrapper; - - /** - * @see _.zipWith - */ - zipWith( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - iteratee: (value1: T, value2: T, value3: T) => TResult - ): LoDashImplicitWrapper; - - /** - * @see _.zipWith - */ - zipWith( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - iteratee: (value1: T, value2: T, value3: T, value4: T) => TResult - ): LoDashImplicitWrapper; - - /** - * @see _.zipWith - */ - zipWith( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - arrays5: List | null | undefined, - ...iteratee: Array<((...group: T[]) => TResult) | List | null | undefined> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.zipWith - */ - zipWith( - this: LoDashExplicitWrapper | null | undefined>, - ...arrays: Array | null | undefined> - ): LoDashExplicitWrapper; - - /** - * @see _.zipWith - */ - zipWith( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: (value1: T) => TResult - ): LoDashExplicitWrapper; - - /** - * @see _.zipWith - */ - zipWith( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - iteratee: (value1: T, value2: T) => TResult - ): LoDashExplicitWrapper; - - /** - * @see _.zipWith - */ - zipWith( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - iteratee: (value1: T, value2: T, value3: T) => TResult - ): LoDashExplicitWrapper; - - /** - * @see _.zipWith - */ - zipWith( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - iteratee: (value1: T, value2: T, value3: T, value4: T) => TResult - ): LoDashExplicitWrapper; - - /** - * @see _.zipWith - */ - zipWith( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - arrays5: List | null | undefined, - ...iteratee: Array<((...group: T[]) => TResult) | List | null | undefined> - ): LoDashExplicitWrapper; - } - - /********* - * Chain * - *********/ - - //_.chain - interface LoDashStatic { - /** - * Creates a lodash object that wraps value with explicit method chaining enabled. - * - * @param value The value to wrap. - * @return Returns the new lodash wrapper instance. - */ - chain(value: T): LoDashExplicitWrapper; - } - - interface LoDashImplicitWrapper { - /** - * @see _.chain - */ - chain(): LoDashExplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.chain - */ - chain(): this; - } - - //_.tap - interface LoDashStatic { - /** - * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one - * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations - * on intermediate results within the chain. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @parem thisArg The this binding of interceptor. - * @return Returns value. - **/ - tap( - value: T, - interceptor: (value: T) => void - ): T; - } - - interface LoDashWrapper { - /** - * @see _.tap - */ - tap( - interceptor: (value: TValue) => void - ): this; - } - - //_.thru - interface LoDashStatic { - /** - * This method is like _.tap except that it returns the result of interceptor. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @param thisArg The this binding of interceptor. - * @return Returns the result of interceptor. - */ - thru( - value: T, - interceptor: (value: T) => TResult - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.thru - */ - thru(interceptor: (value: TValue) => TResult): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.thru - */ - thru(interceptor: (value: TValue) => TResult): LoDashExplicitWrapper; - } - - //_.prototype.commit - interface LoDashWrapper { - /** - * Executes the chained sequence and returns the wrapped result. - * - * @return Returns the new lodash wrapper instance. - */ - commit(): this; - } - - //_.prototype.plant - interface LoDashImplicitWrapper { - /** - * Creates a clone of the chained sequence planting value as the wrapped value. - * @param value The value to plant as the wrapped value. - * @return Returns the new lodash wrapper instance. - */ - plant(value: T): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.plant - */ - plant(value: T): LoDashExplicitWrapper; - } - - //_.prototype.toJSON - interface LoDashWrapper { - /** - * @see _.value - */ - toJSON(): TValue; - } - - //_.prototype.toString - interface LoDashWrapper { - /** - * Produces the result of coercing the unwrapped value to a string. - * - * @return Returns the coerced string value. - */ - toString(): string; - } - - //_.prototype.value - interface LoDashWrapper { - /** - * Executes the chained sequence to extract the unwrapped value. - * - * @alias _.toJSON, _.valueOf - * - * @return Returns the resolved unwrapped value. - */ - value(): TValue; - } - - //_.valueOf - interface LoDashWrapper { - /** - * @see _.value - */ - valueOf(): TValue; - } - - /************** - * Collection * - **************/ - - //_.at - interface LoDashStatic { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - at( - object: List | Dictionary | null | undefined, - ...props: PropertyPath[] - ): T[]; - - /** - * @see _.at - */ - at( - object: T | null | undefined, - ...props: Array> - ): Array; - } - - interface LoDashImplicitWrapper { - /** - * @see _.at - */ - at( - this: LoDashImplicitWrapper | Dictionary | null | undefined>, - ...props: PropertyPath[] - ): LoDashImplicitWrapper; - - /** - * @see _.at - */ - at( - this: LoDashImplicitWrapper, - ...props: Array> - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.at - */ - at( - this: LoDashExplicitWrapper | Dictionary | null | undefined>, - ...props: PropertyPath[] - ): LoDashExplicitWrapper; - - /** - * @see _.at - */ - at( - this: LoDashExplicitWrapper, - ...props: Array> - ): LoDashExplicitWrapper>; - } - - //_.countBy - interface LoDashStatic { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - countBy( - collection: string | null | undefined, - iteratee?: StringIterator - ): Dictionary; - - /** - * @see _.countBy - */ - countBy( - collection: List | null | undefined, - iteratee?: ListIteratee - ): Dictionary; - - /** - * @see _.countBy - */ - countBy( - collection: NumericDictionary | null | undefined, - iteratee?: NumericDictionaryIteratee - ): Dictionary; - - /** - * @see _.countBy - */ - countBy( - collection: T | null | undefined, - iteratee?: ObjectIteratee - ): Dictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.countBy - */ - countBy( - this: LoDashImplicitWrapper, - iteratee?: StringIterator - ): LoDashImplicitWrapper>; - - /** - * @see _.countBy - */ - countBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): LoDashImplicitWrapper>; - - /** - * @see _.countBy - */ - countBy( - this: LoDashImplicitWrapper, - iteratee?: ObjectIteratee - ): LoDashImplicitWrapper>; - - /** - * @see _.countBy - */ - countBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: NumericDictionaryIteratee - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.countBy - */ - countBy( - this: LoDashExplicitWrapper, - iteratee?: StringIterator - ): LoDashExplicitWrapper>; - - /** - * @see _.countBy - */ - countBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): LoDashExplicitWrapper>; - - /** - * @see _.countBy - */ - countBy( - this: LoDashExplicitWrapper, - iteratee?: ObjectIteratee - ): LoDashExplicitWrapper>; - - /** - * @see _.countBy - */ - countBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: NumericDictionaryIteratee - ): LoDashExplicitWrapper>; - } - - //_.each - interface LoDashStatic { - each: typeof _.forEach; // tslint:disable-line:no-unnecessary-qualifier - } - - interface LoDashWrapper { - /** - * @see _.forEach - */ - each( - this: LoDashWrapper, - iteratee?: ArrayIterator - ): this; - - /** - * @see _.forEach - */ - each( - this: LoDashWrapper, - iteratee?: StringIterator - ): this; - - /** - * @see _.forEach - */ - each( - this: LoDashWrapper | null | undefined>, - iteratee?: ListIterator - ): this; - - /** - * @see _.forEach - */ - each( - this: LoDashWrapper, - iteratee?: ObjectIterator - ): this; - } - - //_.eachRight - interface LoDashStatic { - eachRight: typeof _.forEachRight; // tslint:disable-line:no-unnecessary-qualifier - } - - interface LoDashWrapper { - /** - * @see _.forEachRight - */ - eachRight( - this: LoDashWrapper, - iteratee?: ArrayIterator - ): this; - - /** - * @see _.forEachRight - */ - eachRight( - this: LoDashWrapper, - iteratee?: StringIterator - ): this; - - /** - * @see _.forEachRight - */ - eachRight( - this: LoDashWrapper | null | undefined>, - iteratee?: ListIterator - ): this; - - /** - * @see _.forEachRight - */ - eachRight( - this: LoDashWrapper, - iteratee?: ObjectIterator - ): this; - } - - //_.every - interface LoDashStatic { - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - every( - collection: List | null | undefined, - predicate?: ListIterateeCustom - ): boolean; - - /** - * @see _.every - */ - every( - collection: NumericDictionary | null | undefined, - predicate?: NumericDictionaryIterateeCustom - ): boolean; - - /** - * @see _.every - */ - every( - collection: T | null | undefined, - predicate?: ObjectIterateeCustom - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.every - */ - every( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom - ): boolean; - - /** - * @see _.every - */ - every( - this: LoDashImplicitWrapper, - predicate?: ObjectIterateeCustom - ): boolean; - - /** - * @see _.every - */ - every( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: NumericDictionaryIterateeCustom - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.every - */ - every( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom - ): LoDashExplicitWrapper; - - /** - * @see _.every - */ - every( - this: LoDashExplicitWrapper, - predicate?: ObjectIterateeCustom - ): LoDashExplicitWrapper; - - /** - * @see _.every - */ - every( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: NumericDictionaryIterateeCustom - ): LoDashExplicitWrapper; - } - - //_.filter - interface LoDashStatic { - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - filter( - collection: string | null | undefined, - predicate?: StringIterator - ): string[]; - - /** - * @see _.filter - */ - filter( - collection: List | null | undefined, - predicate: ListIteratorTypeGuard - ): S[]; - - /** - * @see _.filter - */ - filter( - collection: List | null | undefined, - predicate?: ListIterateeCustom - ): T[]; - - /** - * @see _.filter - */ - filter( - collection: T | null | undefined, - predicate: ObjectIteratorTypeGuard - ): S[]; - - /** - * @see _.filter - */ - filter( - collection: T | null | undefined, - predicate?: ObjectIterateeCustom - ): Array; - } - - interface LoDashImplicitWrapper { - /** - * @see _.filter - */ - filter( - this: LoDashImplicitWrapper, - predicate?: StringIterator - ): LoDashImplicitWrapper; - - /** - * @see _.filter - */ - filter( - this: LoDashImplicitWrapper | null | undefined>, - predicate: ListIteratorTypeGuard - ): LoDashImplicitWrapper; - - /** - * @see _.filter - */ - filter( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom - ): LoDashImplicitWrapper; - - /** - * @see _.filter - */ - filter( - this: LoDashImplicitWrapper, - predicate: ObjectIteratorTypeGuard - ): LoDashImplicitWrapper; - - /** - * @see _.filter - */ - filter( - this: LoDashImplicitWrapper, - predicate?: ObjectIterateeCustom - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.filter - */ - filter( - this: LoDashExplicitWrapper, - predicate?: StringIterator - ): LoDashExplicitWrapper; - - /** - * @see _.filter - */ - filter( - this: LoDashExplicitWrapper | null | undefined>, - predicate: ListIteratorTypeGuard - ): LoDashExplicitWrapper; - - /** - * @see _.filter - */ - filter( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom - ): LoDashExplicitWrapper; - - /** - * @see _.filter - */ - filter( - this: LoDashExplicitWrapper, - predicate: ObjectIteratorTypeGuard - ): LoDashExplicitWrapper; - - /** - * @see _.filter - */ - filter( - this: LoDashExplicitWrapper, - predicate?: ObjectIterateeCustom - ): LoDashExplicitWrapper>; - } - - //_.find - interface LoDashStatic { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - find( - collection: List | null | undefined, - predicate: ListIteratorTypeGuard, - fromIndex?: number - ): S|undefined; - - /** - * @see _.find - */ - find( - collection: List | null | undefined, - predicate?: ListIterateeCustom, - fromIndex?: number - ): T|undefined; - - /** - * @see _.find - */ - find( - collection: T | null | undefined, - predicate: ObjectIteratorTypeGuard, - fromIndex?: number - ): S|undefined; - - /** - * @see _.find - */ - find( - collection: T | null | undefined, - predicate?: ObjectIterateeCustom, - fromIndex?: number - ): T[keyof T]|undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.find - */ - find( - this: LoDashImplicitWrapper | null | undefined>, - predicate: ListIteratorTypeGuard, - fromIndex?: number - ): S|undefined; - - /** - * @see _.find - */ - find( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom, - fromIndex?: number - ): T|undefined; - - /** - * @see _.find - */ - find( - this: LoDashImplicitWrapper, - predicate: ObjectIteratorTypeGuard, - fromIndex?: number - ): S|undefined; - - /** - * @see _.find - */ - find( - this: LoDashImplicitWrapper, - predicate?: ObjectIterateeCustom, - fromIndex?: number - ): T[keyof T]|undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.find - */ - find( - this: LoDashExplicitWrapper | null | undefined>, - predicate: ListIteratorTypeGuard, - fromIndex?: number - ): LoDashExplicitWrapper; - - /** - * @see _.find - */ - find( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom, - fromIndex?: number - ): LoDashExplicitWrapper; - - /** - * @see _.find - */ - find( - this: LoDashExplicitWrapper, - predicate: ObjectIteratorTypeGuard, - fromIndex?: number - ): LoDashExplicitWrapper; - - /** - * @see _.find - */ - find( - this: LoDashExplicitWrapper, - predicate?: ObjectIterateeCustom, - fromIndex?: number - ): LoDashExplicitWrapper; - } - - //_.findLast - interface LoDashStatic { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - **/ - findLast( - collection: List | null | undefined, - predicate: ListIteratorTypeGuard, - fromIndex?: number - ): S|undefined; - - /** - * @see _.findLast - */ - findLast( - collection: List | null | undefined, - predicate?: ListIterateeCustom, - fromIndex?: number - ): T|undefined; - - /** - * @see _.findLast - */ - findLast( - collection: T | null | undefined, - predicate: ObjectIteratorTypeGuard, - fromIndex?: number - ): S|undefined; - - /** - * @see _.findLast - */ - findLast( - collection: T | null | undefined, - predicate?: ObjectIterateeCustom, - fromIndex?: number - ): T[keyof T]|undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.findLast - */ - findLast( - this: LoDashImplicitWrapper | null | undefined>, - predicate: ListIteratorTypeGuard, - fromIndex?: number - ): S | undefined; - - /** - * @see _.findLast - */ - findLast( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom, - fromIndex?: number - ): T | undefined; - - /** - * @see _.findLast - */ - findLast( - this: LoDashImplicitWrapper, - predicate: ObjectIteratorTypeGuard, - fromIndex?: number - ): S|undefined; - - /** - * @see _.findLast - */ - findLast( - this: LoDashImplicitWrapper, - predicate?: ObjectIterateeCustom, - fromIndex?: number - ): T[keyof T]|undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.findLast - */ - findLast( - this: LoDashExplicitWrapper | null | undefined>, - predicate: ListIteratorTypeGuard, - fromIndex?: number - ): LoDashExplicitWrapper; - - /** - * @see _.findLast - */ - findLast( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom, - fromIndex?: number - ): LoDashExplicitWrapper; - - /** - * @see _.findLast - */ - findLast( - this: LoDashExplicitWrapper, - predicate: ObjectIteratorTypeGuard, - fromIndex?: number - ): LoDashExplicitWrapper; - - /** - * @see _.findLast - */ - findLast( - this: LoDashExplicitWrapper, - predicate?: ObjectIterateeCustom, - fromIndex?: number - ): LoDashExplicitWrapper; - } - - //_.flatMap - interface LoDashStatic { - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - flatMap( - collection: List> | Dictionary> | NumericDictionary> | null | undefined - ): T[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: object | null | undefined - ): any[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: List | null | undefined, - iteratee: ListIterator> - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: NumericDictionary | null | undefined, - iteratee: NumericDictionaryIterator> - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: T | null | undefined, - iteratee: ObjectIterator> - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: object | null | undefined, - iteratee: string - ): any[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: object | null | undefined, - iteratee: object - ): boolean[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flatMap - */ - flatMap(this: LoDashImplicitWrapper> | Dictionary> | NumericDictionary> | null | undefined>): LoDashImplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap(): LoDashImplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: ListIterator> - ): LoDashImplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap( - this: LoDashImplicitWrapper, - iteratee: ObjectIterator> - ): LoDashImplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: NumericDictionaryIterator> - ): LoDashImplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: string - ): LoDashImplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: object - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flatMap - */ - flatMap(this: LoDashExplicitWrapper> | Dictionary> | NumericDictionary> | null | undefined>): LoDashExplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap(): LoDashExplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: ListIterator> - ): LoDashExplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: NumericDictionaryIterator> - ): LoDashExplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap( - this: LoDashExplicitWrapper, - iteratee: ObjectIterator> - ): LoDashExplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: string - ): LoDashExplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: object - ): LoDashExplicitWrapper; - } - - //_.flatMapDeep - interface LoDashStatic { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - flatMapDeep( - collection: List | T> | Dictionary | T> | NumericDictionary | T> | null | undefined - ): T[]; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - collection: List | null | undefined, - iteratee: ListIterator | TResult> - ): TResult[]; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - collection: NumericDictionary | null | undefined, - iteratee: NumericDictionaryIterator | TResult> - ): TResult[]; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - collection: T | null | undefined, - iteratee: ObjectIterator | TResult> - ): TResult[]; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - collection: object | null | undefined, - iteratee: string - ): any[]; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - collection: object | null | undefined, - iteratee: object - ): boolean[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashImplicitWrapper | T> | Dictionary | T> | NumericDictionary | T> | null | undefined> - ): LoDashImplicitWrapper; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: ListIterator | TResult> - ): LoDashImplicitWrapper; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: NumericDictionaryIterator | TResult> - ): LoDashImplicitWrapper; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashImplicitWrapper, - iteratee: ObjectIterator | TResult> - ): LoDashImplicitWrapper; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashImplicitWrapper, - iteratee: string - ): LoDashImplicitWrapper; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashImplicitWrapper, - iteratee: object - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashExplicitWrapper | T> | Dictionary | T> | NumericDictionary | T> | null | undefined> - ): LoDashExplicitWrapper; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: ListIterator | TResult> - ): LoDashExplicitWrapper; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: NumericDictionaryIterator | TResult> - ): LoDashExplicitWrapper; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashExplicitWrapper, - iteratee: ObjectIterator | TResult> - ): LoDashExplicitWrapper; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashExplicitWrapper, - iteratee: string - ): LoDashExplicitWrapper; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashExplicitWrapper, - iteratee: object - ): LoDashExplicitWrapper; - } - - //_.flatMapDepth - interface LoDashStatic { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - flatMapDepth( - collection: List | T> | Dictionary | T> | NumericDictionary | T> | null | undefined - ): T[]; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - collection: List | null | undefined, - iteratee: ListIterator | TResult>, - depth?: number - ): TResult[]; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - collection: NumericDictionary | null | undefined, - iteratee: NumericDictionaryIterator | TResult>, - depth?: number - ): TResult[]; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - collection: T | null | undefined, - iteratee: ObjectIterator | TResult>, - depth?: number - ): TResult[]; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - collection: object | null | undefined, - iteratee: string, - depth?: number - ): any[]; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - collection: object | null | undefined, - iteratee: object, - depth?: number - ): boolean[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashImplicitWrapper | T> | Dictionary | T> | NumericDictionary | T> | null | undefined> - ): LoDashImplicitWrapper; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: ListIterator | TResult>, - depth?: number - ): LoDashImplicitWrapper; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: NumericDictionaryIterator | TResult>, - depth?: number - ): LoDashImplicitWrapper; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashImplicitWrapper, - iteratee: ObjectIterator | TResult>, - depth?: number - ): LoDashImplicitWrapper; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashImplicitWrapper, - iteratee: string, - depth?: number - ): LoDashImplicitWrapper; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashImplicitWrapper, - iteratee: object, - depth?: number - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashExplicitWrapper | T> | Dictionary | T> | NumericDictionary | T> | null | undefined> - ): LoDashExplicitWrapper; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: ListIterator | TResult>, - depth?: number - ): LoDashExplicitWrapper; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: NumericDictionaryIterator | TResult>, - depth?: number - ): LoDashExplicitWrapper; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashExplicitWrapper, - iteratee: ObjectIterator | TResult>, - depth?: number - ): LoDashExplicitWrapper; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashExplicitWrapper, - iteratee: string, - depth?: number - ): LoDashExplicitWrapper; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashExplicitWrapper, - iteratee: object, - depth?: number - ): LoDashExplicitWrapper; - } - - //_.forEach - interface LoDashStatic { - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - forEach( - collection: T[], - iteratee?: ArrayIterator - ): T[]; - - /** - * @see _.forEach - */ - forEach( - collection: string, - iteratee?: StringIterator - ): string; - - /** - * @see _.forEach - */ - forEach( - collection: List, - iteratee?: ListIterator - ): List; - - /** - * @see _.forEach - */ - forEach( - collection: T, - iteratee?: ObjectIterator - ): T; - - /** - * @see _.forEach - */ - forEach( - collection: TArray & (T[] | null | undefined), - iteratee?: ArrayIterator - ): TArray; - - /** - * @see _.forEach - */ - forEach( - collection: TString, - iteratee?: StringIterator - ): TString; - - /** - * @see _.forEach - */ - forEach | null | undefined>( - collection: TList & (List | null | undefined), - iteratee?: ListIterator - ): TList; - - /** - * @see _.forEach - */ - forEach( - collection: T | null | undefined, - iteratee?: ObjectIterator - ): T | null | undefined; - } - - interface LoDashWrapper { - /** - * @see _.forEach - */ - forEach( - this: LoDashWrapper, - iteratee?: ArrayIterator - ): this; - - /** - * @see _.forEach - */ - forEach( - this: LoDashWrapper, - iteratee?: StringIterator - ): this; - - /** - * @see _.forEach - */ - forEach( - this: LoDashWrapper | null | undefined>, - iteratee?: ListIterator - ): this; - - /** - * @see _.forEach - */ - forEach( - this: LoDashWrapper, - iteratee?: ObjectIterator - ): this; - } - - //_.forEachRight - interface LoDashStatic { - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - forEachRight( - collection: T[], - iteratee?: ArrayIterator - ): T[]; - - /** - * @see _.forEachRight - */ - forEachRight( - collection: string, - iteratee?: StringIterator - ): string; - - /** - * @see _.forEachRight - */ - forEachRight( - collection: List, - iteratee?: ListIterator - ): List; - - /** - * @see _.forEachRight - */ - forEachRight( - collection: T, - iteratee?: ObjectIterator - ): T; - - /** - * @see _.forEachRight - */ - forEachRight( - collection: TArray & (T[] | null | undefined), - iteratee?: ArrayIterator - ): TArray; - - /** - * @see _.forEachRight - */ - forEachRight( - collection: TString, - iteratee?: StringIterator - ): TString; - - /** - * @see _.forEachRight - */ - forEachRight | null | undefined>( - collection: TList & (List | null | undefined), - iteratee?: ListIterator - ): TList; - - /** - * @see _.forEachRight - */ - forEachRight( - collection: T | null | undefined, - iteratee?: ObjectIterator - ): T | null | undefined; - } - - interface LoDashWrapper { - /** - * @see _.forEachRight - */ - forEachRight( - this: LoDashWrapper, - iteratee?: ArrayIterator - ): this; - - /** - * @see _.forEachRight - */ - forEachRight( - this: LoDashWrapper, - iteratee?: StringIterator - ): this; - - /** - * @see _.forEachRight - */ - forEachRight( - this: LoDashWrapper | null | undefined>, - iteratee?: ListIterator - ): this; - - /** - * @see _.forEachRight - */ - forEachRight( - this: LoDashWrapper, - iteratee?: ObjectIterator - ): this; - } - - //_.groupBy - interface LoDashStatic { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - groupBy( - collection: string | null | undefined, - iteratee?: StringIterator - ): Dictionary; - - /** - * @see _.groupBy - */ - groupBy( - collection: List | null | undefined, - iteratee?: ListIteratee - ): Dictionary; - - /** - * @see _.groupBy - */ - groupBy( - collection: NumericDictionary | null | undefined, - iteratee?: NumericDictionaryIteratee - ): Dictionary; - - /** - * @see _.groupBy - */ - groupBy( - collection: T | null | undefined, - iteratee?: ObjectIteratee - ): Dictionary>; - } - - interface LoDashImplicitWrapper { - /** - * @see _.groupBy - */ - groupBy( - this: LoDashImplicitWrapper, - iteratee?: StringIterator - ): LoDashImplicitWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): LoDashImplicitWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - this: LoDashImplicitWrapper, - iteratee?: ObjectIteratee - ): LoDashImplicitWrapper>>; - - /** - * @see _.groupBy - */ - groupBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: NumericDictionaryIteratee - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.groupBy - */ - groupBy( - this: LoDashExplicitWrapper, - iteratee?: StringIterator - ): LoDashExplicitWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): LoDashExplicitWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: NumericDictionaryIteratee - ): LoDashExplicitWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - this: LoDashExplicitWrapper, - iteratee?: ObjectIteratee - ): LoDashExplicitWrapper>>; - } - - //_.includes - interface LoDashStatic { - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - includes( - collection: List|Dictionary | null | undefined, - target: T, - fromIndex?: number - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.includes - */ - includes( - this: LoDashImplicitWrapper | Dictionary | null | undefined>, - target: T, - fromIndex?: number - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.includes - */ - includes( - this: LoDashExplicitWrapper | Dictionary | null | undefined>, - target: T, - fromIndex?: number - ): LoDashExplicitWrapper; - } - - //_.keyBy - interface LoDashStatic { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - keyBy( - collection: string | null | undefined, - iteratee?: StringIterator - ): Dictionary; - - /** - * @see _.keyBy - */ - keyBy( - collection: List | null | undefined, - iteratee?: ListIterateeCustom - ): Dictionary; - - /** - * @see _.keyBy - */ - keyBy( - collection: T | null | undefined, - iteratee?: ObjectIterateeCustom - ): Dictionary; - - /** - * @see _.keyBy - */ - keyBy( - collection: NumericDictionary | null | undefined, - iteratee?: NumericDictionaryIterateeCustom - ): Dictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.keyBy - */ - keyBy( - this: LoDashImplicitWrapper, - iteratee?: StringIterator - ): LoDashImplicitWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIterateeCustom - ): LoDashImplicitWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - this: LoDashImplicitWrapper, - iteratee?: ObjectIterateeCustom - ): LoDashImplicitWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: NumericDictionaryIterateeCustom - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.keyBy - */ - keyBy( - this: LoDashExplicitWrapper, - iteratee?: StringIterator - ): LoDashExplicitWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIterateeCustom - ): LoDashExplicitWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - this: LoDashExplicitWrapper, - iteratee?: ObjectIterateeCustom - ): LoDashExplicitWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: NumericDictionaryIterateeCustom - ): LoDashExplicitWrapper>; - } - - //_.invoke - interface LoDashStatic { - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - invoke( - object: any, - path: PropertyPath, - ...args: any[]): any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.invoke - **/ - invoke( - path: PropertyPath, - ...args: any[]): any; - } - - interface LoDashExplicitWrapper { - /** - * @see _.invoke - **/ - invoke( - path: PropertyPath, - ...args: any[]): LoDashExplicitWrapper; - } - - //_.invokeMap - interface LoDashStatic { - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - invokeMap( - collection: object | null | undefined, - methodName: string, - ...args: any[]): any[]; - - /** - * @see _.invokeMap - **/ - invokeMap( - collection: object | null | undefined, - method: (...args: any[]) => TResult, - ...args: any[]): TResult[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.invokeMap - **/ - invokeMap( - methodName: string, - ...args: any[]): LoDashImplicitWrapper; - - /** - * @see _.invokeMap - **/ - invokeMap( - method: (...args: any[]) => TResult, - ...args: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.invokeMap - **/ - invokeMap( - methodName: string, - ...args: any[]): LoDashExplicitWrapper; - - /** - * @see _.invokeMap - **/ - invokeMap( - method: (...args: any[]) => TResult, - ...args: any[]): LoDashExplicitWrapper; - } - - //_.map - interface LoDashStatic { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - map( - collection: List | null | undefined, - iteratee: ListIterator - ): TResult[]; - - /** - * @see _.map - */ - map(collection: List | Dictionary | null | undefined): T[]; - - /** - * @see _.map - */ - map( - collection: Dictionary | null | undefined, - iteratee: DictionaryIterator - ): TResult[]; - - /** @see _.map */ - map( - collection: List | Dictionary | null | undefined, - iteratee: K - ): Array; - - /** @see _.map */ - map( - collection: NumericDictionary | null | undefined, - iteratee?: NumericDictionaryIterator - ): TResult[]; - - /** - * @see _.map - */ - map( - collection: List|Dictionary|NumericDictionary | null | undefined, - iteratee?: string - ): TResult[]; - - /** - * @see _.map - */ - map( - collection: List|Dictionary|NumericDictionary | null | undefined, - iteratee?: object - ): boolean[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.map - */ - map( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: ListIterator - ): LoDashImplicitWrapper; - - /** - * @see _.map - */ - map(this: LoDashImplicitWrapper | Dictionary | null | undefined>): LoDashImplicitWrapper; - - /** - * @see _.map - */ - map( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: DictionaryIterator - ): LoDashImplicitWrapper; - - /** @see _.map */ - map( - this: LoDashImplicitWrapper | Dictionary | null | undefined>, - iteratee: K - ): LoDashImplicitWrapper>; - - /** @see _.map */ - map( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: NumericDictionaryIterator - ): LoDashImplicitWrapper; - - /** - * @see _.map - */ - map( - this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>, - iteratee?: string - ): LoDashImplicitWrapper; - - /** - * @see _.map - */ - map( - this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>, - iteratee?: object - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.map - */ - map( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: ListIterator - ): LoDashExplicitWrapper; - - /** - * @see _.map - */ - map(this: LoDashExplicitWrapper | Dictionary | null | undefined>): LoDashExplicitWrapper; - - /** - * @see _.map - */ - map( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: DictionaryIterator - ): LoDashExplicitWrapper; - - /** @see _.map */ - map( - this: LoDashExplicitWrapper | Dictionary | null | undefined>, - iteratee: K - ): LoDashExplicitWrapper>; - - /** - * @see _.map - */ - map( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: NumericDictionaryIterator - ): LoDashExplicitWrapper; - - /** - * @see _.map - */ - map( - this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>, - iteratee?: string - ): LoDashExplicitWrapper; - - /** - * @see _.map - */ - map( - this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>, - iteratee?: object - ): LoDashExplicitWrapper; - } - - //_.partition - interface LoDashStatic { - /** - * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, - * while the second of which contains elements predicate returns falsey for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback - * returns the property value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback - * returns true for elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns - * true for elements that have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the array of grouped elements. - **/ - partition( - collection: List | null | undefined, - callback: ValueIteratee - ): [T[], T[]]; - - /** - * @see _.partition - */ - partition( - collection: T | null | undefined, - callback: ValueIteratee - ): [Array, Array]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.partition - */ - partition( - this: LoDashImplicitWrapper | null | undefined>, - callback: ValueIteratee - ): LoDashImplicitWrapper<[T[], T[]]>; - - /** - * @see _.partition - */ - partition( - this: LoDashImplicitWrapper, - callback: ValueIteratee - ): LoDashImplicitWrapper<[Array, Array]>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.partition - */ - partition( - this: LoDashExplicitWrapper | null | undefined>, - callback: ValueIteratee - ): LoDashExplicitWrapper<[T[], T[]]>; - - /** - * @see _.partition - */ - partition( - this: LoDashExplicitWrapper, - callback: ValueIteratee - ): LoDashExplicitWrapper<[Array, Array]>; - } - - //_.reduce - interface LoDashStatic { - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - reduce( - collection: T[] | null | undefined, - callback: MemoListIterator, - accumulator: TResult - ): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: List | null | undefined, - callback: MemoListIterator>, - accumulator: TResult - ): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: T | null | undefined, - callback: MemoObjectIterator, - accumulator: TResult - ): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: NumericDictionary | null | undefined, - callback: MemoListIterator>, - accumulator: TResult - ): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: T[] | null | undefined, - callback: MemoListIterator - ): TResult | undefined; - - /** - * @see _.reduce - **/ - reduce( - collection: List | null | undefined, - callback: MemoListIterator> - ): TResult | undefined; - - /** - * @see _.reduce - **/ - reduce( - collection: T | null | undefined, - callback: MemoObjectIterator - ): TResult | undefined; - - /** - * @see _.reduce - **/ - reduce( - collection: NumericDictionary | null | undefined, - callback: MemoListIterator> - ): TResult | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.reduce - **/ - reduce( - this: LoDashImplicitWrapper, - callback: MemoListIterator, - accumulator: TResult - ): TResult; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashImplicitWrapper | null | undefined>, - callback: MemoListIterator>, - accumulator: TResult - ): TResult; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashImplicitWrapper, - callback: MemoObjectIterator, - accumulator: TResult - ): TResult; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashImplicitWrapper | null | undefined>, - callback: MemoListIterator>, - accumulator: TResult - ): TResult; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashImplicitWrapper, - callback: MemoListIterator - ): TResult | undefined; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashImplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): TResult | undefined; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashImplicitWrapper, - callback: MemoObjectIterator - ): TResult | undefined; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashImplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): TResult | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.reduce - **/ - reduce( - this: LoDashExplicitWrapper, - callback: MemoListIterator, - accumulator: TResult - ): LoDashExplicitWrapper; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashExplicitWrapper | null | undefined>, - callback: MemoListIterator>, - accumulator: TResult - ): LoDashExplicitWrapper; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashExplicitWrapper, - callback: MemoObjectIterator, - accumulator: TResult - ): LoDashExplicitWrapper; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashExplicitWrapper | null | undefined>, - callback: MemoListIterator>, - accumulator: TResult - ): LoDashExplicitWrapper; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashExplicitWrapper, - callback: MemoListIterator - ): LoDashExplicitWrapper; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashExplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): LoDashExplicitWrapper; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashExplicitWrapper, - callback: MemoObjectIterator - ): LoDashExplicitWrapper; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashExplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): LoDashExplicitWrapper; - } - - //_.reduceRight - interface LoDashStatic { - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - reduceRight( - collection: T[] | null | undefined, - callback: MemoListIterator, - accumulator: TResult - ): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: List | null | undefined, - callback: MemoListIterator>, - accumulator: TResult - ): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: T | null | undefined, - callback: MemoObjectIterator, - accumulator: TResult - ): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: NumericDictionary | null | undefined, - callback: MemoListIterator>, - accumulator: TResult - ): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: T[] | null | undefined, - callback: MemoListIterator - ): TResult | undefined; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: List | null | undefined, - callback: MemoListIterator> - ): TResult | undefined; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: T | null | undefined, - callback: MemoObjectIterator - ): TResult | undefined; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: NumericDictionary | null | undefined, - callback: MemoListIterator> - ): TResult | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashImplicitWrapper, - callback: MemoListIterator, - accumulator: TResult - ): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashImplicitWrapper | null | undefined>, - callback: MemoListIterator>, - accumulator: TResult - ): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashImplicitWrapper, - callback: MemoObjectIterator, - accumulator: TResult - ): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashImplicitWrapper | null | undefined>, - callback: MemoListIterator>, - accumulator: TResult - ): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashImplicitWrapper, - callback: MemoListIterator - ): TResult | undefined; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashImplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): TResult | undefined; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashImplicitWrapper, - callback: MemoObjectIterator - ): TResult | undefined; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashImplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): TResult | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashExplicitWrapper, - callback: MemoListIterator, - accumulator: TResult - ): LoDashExplicitWrapper; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashExplicitWrapper | null | undefined>, - callback: MemoListIterator>, - accumulator: TResult - ): LoDashExplicitWrapper; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashExplicitWrapper, - callback: MemoObjectIterator, - accumulator: TResult - ): LoDashExplicitWrapper; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashExplicitWrapper | null | undefined>, - callback: MemoListIterator>, - accumulator: TResult - ): LoDashExplicitWrapper; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashExplicitWrapper, - callback: MemoListIterator - ): LoDashExplicitWrapper; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashExplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): LoDashExplicitWrapper; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashExplicitWrapper, - callback: MemoObjectIterator - ): LoDashExplicitWrapper; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashExplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): LoDashExplicitWrapper; - } - - //_.reject - interface LoDashStatic { - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - reject( - collection: string | null | undefined, - predicate?: StringIterator - ): string[]; - - /** - * @see _.reject - */ - reject( - collection: List | null | undefined, - predicate?: ListIterateeCustom - ): T[]; - - /** - * @see _.reject - */ - reject( - collection: T | null | undefined, - predicate?: ObjectIterateeCustom - ): Array; - } - - interface LoDashImplicitWrapper { - /** - * @see _.reject - */ - reject( - this: LoDashImplicitWrapper, - predicate?: StringIterator - ): LoDashImplicitWrapper; - - /** - * @see _.reject - */ - reject( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom - ): LoDashImplicitWrapper; - - /** - * @see _.reject - */ - reject( - this: LoDashImplicitWrapper, - predicate?: ObjectIterateeCustom - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.reject - */ - reject( - this: LoDashExplicitWrapper, - predicate?: StringIterator - ): LoDashExplicitWrapper; - - /** - * @see _.reject - */ - reject( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom - ): LoDashExplicitWrapper; - - /** - * @see _.reject - */ - reject( - this: LoDashExplicitWrapper, - predicate?: ObjectIterateeCustom - ): LoDashExplicitWrapper>; - } - - //_.sample - interface LoDashStatic { - /** - * Gets a random element from collection. - * - * @param collection The collection to sample. - * @return Returns the random element. - */ - sample( - collection: List | Dictionary | NumericDictionary | null | undefined - ): T | undefined; - - /** - * @see _.sample - */ - sample( - collection: T - ): T[keyof T]; - - /** - * @see _.sample - */ - sample( - collection: T | null | undefined - ): T[keyof T] | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sample - */ - sample( - this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined> - ): T | undefined; - - /** - * @see _.sample - */ - sample( - this: LoDashImplicitWrapper, - ): T[keyof T]; - - /** - * @see _.sample - */ - sample( - this: LoDashImplicitWrapper - ): T[keyof T] | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sample - */ - sample( - this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined> - ): LoDashExplicitWrapper; - - /** - * @see _.sample - */ - sample( - this: LoDashExplicitWrapper, - ): LoDashExplicitWrapper; - - /** - * @see _.sample - */ - sample( - this: LoDashExplicitWrapper - ): LoDashExplicitWrapper; - } - - //_.sampleSize - interface LoDashStatic { - /** - * Gets n random elements at unique keys from collection up to the size of collection. - * - * @param collection The collection to sample. - * @param n The number of elements to sample. - * @return Returns the random elements. - */ - sampleSize( - collection: List|Dictionary|NumericDictionary | null | undefined, - n?: number - ): T[]; - - /** - * @see _.sampleSize - */ - sampleSize( - collection: T | null | undefined, - n?: number - ): Array; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sampleSize - */ - sampleSize( - this: LoDashImplicitWrapper|Dictionary|NumericDictionary | null | undefined>, - n?: number - ): LoDashImplicitWrapper; - - /** - * @see _.sampleSize - */ - sampleSize( - this: LoDashImplicitWrapper, - n?: number - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sampleSize - */ - sampleSize( - this: LoDashExplicitWrapper|Dictionary|NumericDictionary | null | undefined>, - n?: number - ): LoDashExplicitWrapper; - - /** - * @see _.sampleSize - */ - sampleSize( - this: LoDashExplicitWrapper, - n?: number - ): LoDashExplicitWrapper>; - } - - //_.shuffle - interface LoDashStatic { - /** - * Creates an array of shuffled values, using a version of the Fisher-Yates shuffle. - * - * @param collection The collection to shuffle. - * @return Returns the new shuffled array. - */ - shuffle(collection: List | null | undefined): T[]; - - /** - * @see _.shuffle - */ - shuffle(collection: T | null | undefined): Array; - } - - interface LoDashImplicitWrapper { - /** - * @see _.shuffle - */ - shuffle(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; - - /** - * @see _.shuffle - */ - shuffle(this: LoDashImplicitWrapper): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.shuffle - */ - shuffle(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - - /** - * @see _.shuffle - */ - shuffle(this: LoDashExplicitWrapper): LoDashExplicitWrapper>; - } - - //_.size - interface LoDashStatic { - /** - * Gets the size of collection by returning its length for array-like values or the number of own enumerable - * properties for objects. - * - * @param collection The collection to inspect. - * @return Returns the size of collection. - */ - size(collection: object | string | null | undefined): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.size - */ - size(): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.size - */ - size(): LoDashExplicitWrapper; - } - - //_.some - interface LoDashStatic { - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - some( - collection: List | null | undefined, - predicate?: ListIterateeCustom - ): boolean; - - /** - * @see _.some - */ - some( - collection: T | null | undefined, - predicate?: ObjectIterateeCustom - ): boolean; - - /** - * @see _.some - */ - some( - collection: NumericDictionary | null | undefined, - predicate?: NumericDictionaryIterateeCustom - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.some - */ - some( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom - ): boolean; - - /** - * @see _.some - */ - some( - this: LoDashImplicitWrapper, - predicate?: ObjectIterateeCustom - ): boolean; - - /** - * @see _.some - */ - some( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: NumericDictionaryIterateeCustom - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.some - */ - some( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom - ): LoDashExplicitWrapper; - - /** - * @see _.some - */ - some( - this: LoDashExplicitWrapper, - predicate?: ObjectIterateeCustom - ): LoDashExplicitWrapper; - - /** - * @see _.some - */ - some( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: NumericDictionaryIterateeCustom - ): LoDashExplicitWrapper; - } - - //_.sortBy - interface LoDashStatic { - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.sortBy(users, 'user', function(o) { - * return Math.floor(o.age / 10); - * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - sortBy( - collection: List | null | undefined, - ...iteratees: Array>> - ): T[]; - - /** - * @see _.sortBy - */ - sortBy( - collection: T | null | undefined, - ...iteratees: Array>> - ): Array; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortBy - */ - sortBy( - this: LoDashImplicitWrapper | null | undefined>, - ...iteratees: Array>> - ): LoDashImplicitWrapper; - - /** - * @see _.sortBy - */ - sortBy( - this: LoDashImplicitWrapper, - ...iteratees: Array>> - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortBy - */ - sortBy( - this: LoDashExplicitWrapper | null | undefined>, - ...iteratees: Array>> - ): LoDashExplicitWrapper; - - /** - * @see _.sortBy - */ - sortBy( - this: LoDashExplicitWrapper, - ...iteratees: Array>> - ): LoDashExplicitWrapper>; - } - - //_.orderBy - interface LoDashStatic { - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - orderBy( - collection: List | null | undefined, - iteratees?: Many>, - orders?: Many - ): T[]; - - /** - * @see _.orderBy - */ - orderBy( - collection: List | null | undefined, - iteratees?: Many>, - orders?: Many - ): T[]; - - /** - * @see _.orderBy - */ - orderBy( - collection: T | null | undefined, - iteratees?: Many>, - orders?: Many - ): Array; - - /** - * @see _.orderBy - */ - orderBy( - collection: T | null | undefined, - iteratees?: Many>, - orders?: Many - ): Array; - - /** - * @see _.orderBy - */ - orderBy( - collection: NumericDictionary | null | undefined, - iteratees?: Many>, - orders?: Many - ): T[]; - - /** - * @see _.orderBy - */ - orderBy( - collection: NumericDictionary | null | undefined, - iteratees?: Many>, - orders?: Many - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.orderBy - */ - orderBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratees?: Many>, - orders?: Many - ): LoDashImplicitWrapper; - - /** - * @see _.orderBy - */ - orderBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratees?: Many>, - orders?: Many - ): LoDashImplicitWrapper; - - /** - * @see _.orderBy - */ - orderBy( - this: LoDashImplicitWrapper, - iteratees?: Many>, - orders?: Many - ): LoDashImplicitWrapper>; - - /** - * @see _.orderBy - */ - orderBy( - this: LoDashImplicitWrapper, - iteratees?: Many>, - orders?: Many - ): LoDashImplicitWrapper>; - - /** - * @see _.orderBy - */ - orderBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratees?: Many>, - orders?: Many - ): LoDashImplicitWrapper; - - /** - * @see _.orderBy - */ - orderBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratees?: Many>, - orders?: Many - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.orderBy - */ - orderBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratees?: Many>, - orders?: Many - ): LoDashExplicitWrapper; - - /** - * @see _.orderBy - */ - orderBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratees?: Many>, - orders?: Many - ): LoDashExplicitWrapper; - - /** - * @see _.orderBy - */ - orderBy( - this: LoDashExplicitWrapper, - iteratees?: Many>, - orders?: Many - ): LoDashExplicitWrapper>; - - /** - * @see _.orderBy - */ - orderBy( - this: LoDashExplicitWrapper, - iteratees?: Many>, - orders?: Many - ): LoDashExplicitWrapper>; - - /** - * @see _.orderBy - */ - orderBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratees?: Many>, - orders?: Many - ): LoDashExplicitWrapper; - - /** - * @see _.orderBy - */ - orderBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratees?: Many>, - orders?: Many - ): LoDashExplicitWrapper; - } - - /******** - * Date * - ********/ - - //_.now - interface LoDashStatic { - /** - * Gets the number of milliseconds that have elapsed since the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @return The number of milliseconds. - */ - now(): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.now - */ - now(): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.now - */ - now(): LoDashExplicitWrapper; - } - - /************* - * Functions * - *************/ - - //_.after - interface LoDashStatic { - /** - * The opposite of _.before; this method creates a function that invokes func once it’s called n or more times. - * - * @param n The number of calls before func is invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - after any>( - n: number, - func: TFunc - ): TFunc; - } - - interface LoDashImplicitWrapper { - /** - * @see _.after - **/ - after any>(func: TFunc): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.after - **/ - after any>(func: TFunc): LoDashExplicitWrapper; - } - - //_.ary - interface LoDashStatic { - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - ary( - func: (...args: any[]) => any, - n?: number - ): (...args: any[]) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.ary - */ - ary(n?: number): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.ary - */ - ary(n?: number): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.before - interface LoDashStatic { - /** - * Creates a function that invokes func, with the this binding and arguments of the created function, while - * it’s called less than n times. Subsequent calls to the created function return the result of the last func - * invocation. - * - * @param n The number of calls at which func is no longer invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - before any>( - n: number, - func: TFunc - ): TFunc; - } - - interface LoDashImplicitWrapper { - /** - * @see _.before - **/ - before any>(func: TFunc): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.before - **/ - before any>(func: TFunc): LoDashExplicitWrapper; - } - - //_.bind - interface FunctionBind { - placeholder: any; - - ( - func: (...args: any[]) => any, - thisArg: any, - ...partials: any[] - ): (...args: any[]) => any; - } - - interface LoDashStatic { - /** - * Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind - * arguments to those provided to the bound function. - * - * The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for - * partially applied arguments. - * - * Note: Unlike native Function#bind this method does not set the "length" property of bound functions. - * - * @param func The function to bind. - * @param thisArg The this binding of func. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - bind: FunctionBind; - } - - interface LoDashImplicitWrapper { - /** - * @see _.bind - */ - bind( - thisArg: any, - ...partials: any[] - ): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.bind - */ - bind( - thisArg: any, - ...partials: any[] - ): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.bindAll - interface LoDashStatic { - /** - * Binds methods of an object to the object itself, overwriting the existing method. Method names may be - * specified as individual arguments or as arrays of method names. If no method names are provided all - * enumerable function properties, own and inherited, of object are bound. - * - * Note: This method does not set the "length" property of bound functions. - * - * @param object The object to bind and assign the bound methods to. - * @param methodNames The object method names to bind, specified as individual method names or arrays of - * method names. - * @return Returns object. - */ - bindAll( - object: T, - ...methodNames: Array> - ): T; - } - - interface LoDashWrapper { - /** - * @see _.bindAll - */ - bindAll(...methodNames: Array>): this; - } - - //_.bindKey - interface FunctionBindKey { - placeholder: any; - - ( - object: object, - key: string, - ...partials: any[] - ): (...args: any[]) => any; - } - - interface LoDashStatic { - /** - * Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments - * to those provided to the bound function. - * - * This method differs from _.bind by allowing bound functions to reference methods that may be redefined - * or don’t yet exist. See Peter Michaux’s article for more details. - * - * The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder - * for partially applied arguments. - * - * @param object The object the method belongs to. - * @param key The key of the method. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - bindKey: FunctionBindKey; - } - - interface LoDashImplicitWrapper { - /** - * @see _.bindKey - */ - bindKey( - key: string, - ...partials: any[] - ): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.bindKey - */ - bindKey( - key: string, - ...partials: any[] - ): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.curry - interface LoDashStatic { - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curry(func: (t1: T1) => R, arity?: number): - CurriedFunction1; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curry(func: (t1: T1, t2: T2) => R, arity?: number): - CurriedFunction2; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curry(func: (t1: T1, t2: T2, t3: T3) => R, arity?: number): - CurriedFunction3; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curry(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R, arity?: number): - CurriedFunction4; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curry(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R, arity?: number): - CurriedFunction5; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curry(func: (...args: any[]) => any, arity?: number): (...args: any[]) => any; - } - - interface CurriedFunction1 { - (): CurriedFunction1; - (t1: T1): R; - } - - interface CurriedFunction2 { - (): CurriedFunction2; - (t1: T1): CurriedFunction1; - (t1: T1, t2: T2): R; - } - - interface CurriedFunction3 { - (): CurriedFunction3; - (t1: T1): CurriedFunction2; - (t1: T1, t2: T2): CurriedFunction1; - (t1: T1, t2: T2, t3: T3): R; - } - - interface CurriedFunction4 { - (): CurriedFunction4; - (t1: T1): CurriedFunction3; - (t1: T1, t2: T2): CurriedFunction2; - (t1: T1, t2: T2, t3: T3): CurriedFunction1; - (t1: T1, t2: T2, t3: T3, t4: T4): R; - } - - interface CurriedFunction5 { - (): CurriedFunction5; - (t1: T1): CurriedFunction4; - (t1: T1, t2: T2): CurriedFunction3; - (t1: T1, t2: T2, t3: T3): CurriedFunction2; - (t1: T1, t2: T2, t3: T3, t4: T4): CurriedFunction1; - (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R; - } - interface RightCurriedFunction1 { - (): RightCurriedFunction1; - (t1: T1): R; - } - interface RightCurriedFunction2 { - (): RightCurriedFunction2; - (t2: T2): RightCurriedFunction1; - (t1: T1, t2: T2): R; - } - interface RightCurriedFunction3 { - (): RightCurriedFunction3; - (t3: T3): RightCurriedFunction2; - (t2: T2, t3: T3): RightCurriedFunction1; - (t1: T1, t2: T2, t3: T3): R; - } - interface RightCurriedFunction4 { - (): RightCurriedFunction4; - (t4: T4): RightCurriedFunction3; - (t3: T3, t4: T4): RightCurriedFunction2; - (t2: T2, t3: T3, t4: T4): RightCurriedFunction1; - (t1: T1, t2: T2, t3: T3, t4: T4): R; - } - interface RightCurriedFunction5 { - (): RightCurriedFunction5; - (t5: T5): RightCurriedFunction4; - (t4: T4, t5: T5): RightCurriedFunction3; - (t3: T3, t4: T4, t5: T5): RightCurriedFunction2; - (t2: T2, t3: T3, t4: T4, t5: T5): RightCurriedFunction1; - (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R; - } - - interface LoDashImplicitWrapper { - /** - * @see _.curry - **/ - curry(this: LoDashImplicitWrapper<(t1: T1) => R>, arity?: number): - LoDashImplicitWrapper>; - - /** - * @see _.curry - **/ - curry(this: LoDashImplicitWrapper<(t1: T1, t2: T2) => R>, arity?: number): - LoDashImplicitWrapper>; - - /** - * @see _.curry - **/ - curry(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3) => R>, arity?: number): - LoDashImplicitWrapper>; - - /** - * @see _.curry - **/ - curry(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>, arity?: number): - LoDashImplicitWrapper>; - - /** - * @see _.curry - **/ - curry(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>, arity?: number): - LoDashImplicitWrapper>; - - /** - * @see _.curry - **/ - curry(arity?: number): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.curry - **/ - curry(this: LoDashExplicitWrapper<(t1: T1) => R>): - LoDashExplicitWrapper>; - - /** - * @see _.curry - **/ - curry(this: LoDashExplicitWrapper<(t1: T1, t2: T2) => R>): - LoDashExplicitWrapper>; - - /** - * @see _.curry - **/ - curry(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3) => R>): - LoDashExplicitWrapper>; - - /** - * @see _.curry - **/ - curry(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>): - LoDashExplicitWrapper>; - - /** - * @see _.curry - **/ - curry(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>): - LoDashExplicitWrapper>; - - /** - * @see _.curry - **/ - curry(arity?: number): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.curryRight - interface LoDashStatic { - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curryRight(func: (t1: T1) => R, arity?: number): - RightCurriedFunction1; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curryRight(func: (t1: T1, t2: T2) => R, arity?: number): - RightCurriedFunction2; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curryRight(func: (t1: T1, t2: T2, t3: T3) => R, arity?: number): - RightCurriedFunction3; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curryRight(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R, arity?: number): - RightCurriedFunction4; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curryRight(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R, arity?: number): - RightCurriedFunction5; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curryRight(func: (...args: any[]) => any, arity?: number): (...args: any[]) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.curryRight - **/ - curryRight(this: LoDashImplicitWrapper<(t1: T1) => R>, arity?: number): - LoDashImplicitWrapper>; - - /** - * @see _.curryRight - **/ - curryRight(this: LoDashImplicitWrapper<(t1: T1, t2: T2) => R>, arity?: number): - LoDashImplicitWrapper>; - - /** - * @see _.curryRight - **/ - curryRight(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3) => R>, arity?: number): - LoDashImplicitWrapper>; - - /** - * @see _.curryRight - **/ - curryRight(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>, arity?: number): - LoDashImplicitWrapper>; - - /** - * @see _.curryRight - **/ - curryRight(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>, arity?: number): - LoDashImplicitWrapper>; - - /** - * @see _.curryRight - **/ - curryRight(arity?: number): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.curryRight - **/ - curryRight(this: LoDashExplicitWrapper<(t1: T1) => R>, arity?: number): - LoDashExplicitWrapper>; - - /** - * @see _.curryRight - **/ - curryRight(this: LoDashExplicitWrapper<(t1: T1, t2: T2) => R>, arity?: number): - LoDashExplicitWrapper>; - - /** - * @see _.curryRight - **/ - curryRight(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3) => R>, arity?: number): - LoDashExplicitWrapper>; - - /** - * @see _.curryRight - **/ - curryRight(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>, arity?: number): - LoDashExplicitWrapper>; - - /** - * @see _.curryRight - **/ - curryRight(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>, arity?: number): - LoDashExplicitWrapper>; - - /** - * @see _.curryRight - **/ - curryRight(arity?: number): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.debounce - interface DebounceSettings { - /** - * Specify invoking on the leading edge of the timeout. - */ - leading?: boolean; - - /** - * The maximum time func is allowed to be delayed before it’s invoked. - */ - maxWait?: number; - - /** - * Specify invoking on the trailing edge of the timeout. - */ - trailing?: boolean; - } - - interface LoDashStatic { - /** - * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since - * the last time the debounced function was invoked. The debounced function comes with a cancel method to - * cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to - * indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent - * calls to the debounced function return the result of the last func invocation. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only - * if the the debounced function is invoked more than once during the wait timeout. - * - * See David Corbacho’s article for details over the differences between _.debounce and _.throttle. - * - * @param func The function to debounce. - * @param wait The number of milliseconds to delay. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.maxWait The maximum time func is allowed to be delayed before it’s invoked. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new debounced function. - */ - debounce any>( - func: T, - wait?: number, - options?: DebounceSettings - ): T & Cancelable; - } - - interface LoDashImplicitWrapper { - /** - * @see _.debounce - */ - debounce( - wait?: number, - options?: DebounceSettings - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.debounce - */ - debounce( - wait?: number, - options?: DebounceSettings - ): LoDashExplicitWrapper; - } - - //_.defer - interface LoDashStatic { - /** - * Defers invoking the func until the current call stack has cleared. Any additional arguments are provided to - * func when it’s invoked. - * - * @param func The function to defer. - * @param args The arguments to invoke the function with. - * @return Returns the timer id. - */ - defer( - func: (...args: any[]) => any, - ...args: any[] - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.defer - */ - defer(...args: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.defer - */ - defer(...args: any[]): LoDashExplicitWrapper; - } - - //_.delay - interface LoDashStatic { - /** - * Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked. - * - * @param func The function to delay. - * @param wait The number of milliseconds to delay invocation. - * @param args The arguments to invoke the function with. - * @return Returns the timer id. - */ - delay( - func: (...args: any[]) => any, - wait: number, - ...args: any[] - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.delay - */ - delay( - wait: number, - ...args: any[] - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.delay - */ - delay( - wait: number, - ...args: any[] - ): LoDashExplicitWrapper; - } - - interface LoDashStatic { - /** - * Creates a function that invokes `func` with arguments reversed. - * - * @category Function - * @param func The function to flip arguments for. - * @returns Returns the new function. - * @example - * - * var flipped = _.flip(function() { - * return _.toArray(arguments); - * }); - * - * flipped('a', 'b', 'c', 'd'); - * // => ['d', 'c', 'b', 'a'] - */ - flip any>(func: T): T; - } - - interface LoDashWrapper { - /** - * @see _.flip - */ - flip(): this; - } - - //_.flow - interface LoDashStatic { - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - // 0-argument first function - flow(f1: () => R1, f2: (a: R1) => R2): () => R2; - flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): () => R3; - flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): () => R4; - flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): () => R5; - flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): () => R6; - flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): () => R7; - flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): () => any; - // 1-argument first function - flow(f1: (a1: A1) => R1, f2: (a: R1) => R2): (a1: A1) => R2; - flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1) => R3; - flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1) => R4; - flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1) => R5; - flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1) => R6; - flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1) => R7; - flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1) => any; - // 2-argument first function - flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2) => R2; - flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2) => R3; - flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2) => R4; - flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2) => R5; - flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2) => R6; - flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2) => R7; - flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2) => any; - // 3-argument first function - flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3) => R2; - flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3) => R3; - flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3) => R4; - flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3) => R5; - flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3) => R6; - flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3) => R7; - flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2, a3: A3) => any; - // 4-argument first function - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2, a3: A3, a4: A4) => any; - // any-argument first function - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any; - flow(funcs: Array any>>): (...args: any[]) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flow - */ - // 0-argument first function - flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<() => R2>; - flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<() => R3>; - flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<() => R4>; - flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<() => R5>; - flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<() => R6>; - flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<() => R7>; - flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<() => any>; - // 1-argument first function - flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<(a1: A1) => R2>; - flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<(a1: A1) => R3>; - flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<(a1: A1) => R4>; - flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<(a1: A1) => R5>; - flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<(a1: A1) => R6>; - flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<(a1: A1) => R7>; - flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<(a1: A1) => any>; - // 2-argument first function - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<(a1: A1, a2: A2) => R2>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<(a1: A1, a2: A2) => R3>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<(a1: A1, a2: A2) => R4>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<(a1: A1, a2: A2) => R5>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<(a1: A1, a2: A2) => R6>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<(a1: A1, a2: A2) => R7>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<(a1: A1, a2: A2) => any>; - // 3-argument first function - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R2>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R3>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R4>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R5>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R6>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R7>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => any>; - // 4-argument first function - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => any>; - // any-argument first function - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any>; - flow(this: LoDashImplicitWrapper<(...args: any[]) => any>, funcs: Array any>>): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flow - */ - // 0-argument first function - flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<() => R2>; - flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<() => R3>; - flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<() => R4>; - flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<() => R5>; - flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<() => R6>; - flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<() => R7>; - flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<() => any>; - // 1-argument first function - flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<(a1: A1) => R2>; - flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<(a1: A1) => R3>; - flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<(a1: A1) => R4>; - flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<(a1: A1) => R5>; - flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<(a1: A1) => R6>; - flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<(a1: A1) => R7>; - flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<(a1: A1) => any>; - // 2-argument first function - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<(a1: A1, a2: A2) => R2>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<(a1: A1, a2: A2) => R3>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<(a1: A1, a2: A2) => R4>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<(a1: A1, a2: A2) => R5>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<(a1: A1, a2: A2) => R6>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<(a1: A1, a2: A2) => R7>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<(a1: A1, a2: A2) => any>; - // 3-argument first function - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R2>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R3>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R4>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R5>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R6>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R7>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => any>; - // 4-argument first function - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => any>; - // any-argument first function - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any>; - flow(this: LoDashExplicitWrapper<(...args: any[]) => any>, funcs: Array any>>): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.flowRight - interface LoDashStatic { - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - // 0-argument first function - flowRight(f2: (a: R1) => R2, f1: () => R1): () => R2; - flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R3; - flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R4; - flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R5; - flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R6; - flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R7; - // 1-argument first function - flowRight(f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R2; - flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R3; - flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R4; - flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R5; - flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R6; - flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R7; - // 2-argument first function - flowRight(f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R2; - flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R3; - flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R4; - flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R5; - flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R6; - flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R7; - // 3-argument first function - flowRight(f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R2; - flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R3; - flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R4; - flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R5; - flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R6; - flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R7; - // 4-argument first function - flowRight(f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; - flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; - flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; - flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; - flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; - flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; - // any-argument first function - flowRight(f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R2; - flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R3; - flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R4; - flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R5; - flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R6; - flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R7; - flowRight(f7: (a: any) => any, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array any>>): (...args: any[]) => any; - flowRight(funcs: Array any>>): (...args: any[]) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flowRight - */ - // 0-argument first function - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: () => R1): LoDashImplicitWrapper<() => R2>; - flowRight(this: LoDashImplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: () => R1): LoDashImplicitWrapper<() => R3>; - flowRight(this: LoDashImplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashImplicitWrapper<() => R4>; - flowRight(this: LoDashImplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashImplicitWrapper<() => R5>; - flowRight(this: LoDashImplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashImplicitWrapper<() => R6>; - flowRight(this: LoDashImplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashImplicitWrapper<() => R7>; - // 1-argument first function - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R2>; - flowRight(this: LoDashImplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R3>; - flowRight(this: LoDashImplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R4>; - flowRight(this: LoDashImplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R5>; - flowRight(this: LoDashImplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R6>; - flowRight(this: LoDashImplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R7>; - // 2-argument first function - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R2>; - flowRight(this: LoDashImplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R3>; - flowRight(this: LoDashImplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R4>; - flowRight(this: LoDashImplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R5>; - flowRight(this: LoDashImplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R6>; - flowRight(this: LoDashImplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R7>; - // 3-argument first function - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R2>; - flowRight(this: LoDashImplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R3>; - flowRight(this: LoDashImplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R4>; - flowRight(this: LoDashImplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R5>; - flowRight(this: LoDashImplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R6>; - flowRight(this: LoDashImplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R7>; - // 4-argument first function - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; - flowRight(this: LoDashImplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; - flowRight(this: LoDashImplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; - flowRight(this: LoDashImplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; - flowRight(this: LoDashImplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; - flowRight(this: LoDashImplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; - // any-argument first function - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R2>; - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R3>; - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R4>; - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R5>; - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R6>; - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R7>; - flowRight(this: LoDashImplicitWrapper<(a: any) => any>, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array any>>): LoDashImplicitWrapper<(...args: any[]) => any>; - flowRight(this: LoDashImplicitWrapper<(a: any) => any>, funcs: Array any>>): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flowRight - */ - // 0-argument first function - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: () => R1): LoDashExplicitWrapper<() => R2>; - flowRight(this: LoDashExplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitWrapper<() => R3>; - flowRight(this: LoDashExplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitWrapper<() => R4>; - flowRight(this: LoDashExplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitWrapper<() => R5>; - flowRight(this: LoDashExplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitWrapper<() => R6>; - flowRight(this: LoDashExplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitWrapper<() => R7>; - // 1-argument first function - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R2>; - flowRight(this: LoDashExplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R3>; - flowRight(this: LoDashExplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R4>; - flowRight(this: LoDashExplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R5>; - flowRight(this: LoDashExplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R6>; - flowRight(this: LoDashExplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R7>; - // 2-argument first function - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R2>; - flowRight(this: LoDashExplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R3>; - flowRight(this: LoDashExplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R4>; - flowRight(this: LoDashExplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R5>; - flowRight(this: LoDashExplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R6>; - flowRight(this: LoDashExplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R7>; - // 3-argument first function - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R2>; - flowRight(this: LoDashExplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R3>; - flowRight(this: LoDashExplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R4>; - flowRight(this: LoDashExplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R5>; - flowRight(this: LoDashExplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R6>; - flowRight(this: LoDashExplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R7>; - // 4-argument first function - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; - flowRight(this: LoDashExplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; - flowRight(this: LoDashExplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; - flowRight(this: LoDashExplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; - flowRight(this: LoDashExplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; - flowRight(this: LoDashExplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; - // any-argument first function - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R2>; - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R3>; - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R4>; - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R5>; - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R6>; - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R7>; - flowRight(this: LoDashExplicitWrapper<(a: any) => any>, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array any>>): LoDashExplicitWrapper<(...args: any[]) => any>; - flowRight(this: LoDashExplicitWrapper<(a: any) => any>, funcs: Array any>>): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.memoize - interface MemoizedFunction { - cache: MapCache; - } - - interface LoDashStatic { - /** - * Creates a function that memoizes the result of func. If resolver is provided it determines the cache key for - * storing the result based on the arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is coerced to a string and used as the cache key. The func is invoked with - * the this binding of the memoized function. - * - * @param func The function to have its output memoized. - * @param resolver The function to resolve the cache key. - * @return Returns the new memoizing function. - */ - memoize: { - any>(func: T, resolver?: (...args: any[]) => any): T & MemoizedFunction; - Cache: MapCacheConstructor; - }; - } - - interface LoDashImplicitWrapper { - /** - * @see _.memoize - */ - memoize(resolver?: (...args: any[]) => any): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.memoize - */ - memoize(resolver?: (...args: any[]) => any): LoDashExplicitWrapper; - } - - //_.overArgs (was _.modArgs) - interface LoDashStatic { - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - overArgs( - func: (...args: any[]) => any, - ...transforms: Array any>> - ): (...args: any[]) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.overArgs - */ - overArgs(...transforms: Array any>>): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.overArgs - */ - overArgs(...transforms: Array any>>): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.negate - interface LoDashStatic { - /** - * Creates a function that negates the result of the predicate func. The func predicate is invoked with - * the this binding and arguments of the created function. - * - * @param predicate The predicate to negate. - * @return Returns the new function. - */ - negate any>(predicate: T): T; - } - - interface LoDashWrapper { - /** - * @see _.negate - */ - negate(): this; - } - - //_.once - interface LoDashStatic { - /** - * Creates a function that is restricted to invoking func once. Repeat calls to the function return the value - * of the first call. The func is invoked with the this binding and arguments of the created function. - * - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - once any>(func: T): T; - } - - interface LoDashWrapper { - /** - * @see _.once - */ - once(): this; - } - - //_.partial - interface LoDashStatic { - /** - * Creates a function that, when called, invokes func with any additional partial arguments - * prepended to those provided to the new function. This method is similar to _.bind except - * it does not alter the this binding. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - partial: Partial; - } - - interface LoDashImplicitWrapper { - /** - * @see _.partial - */ - partial: ImplicitPartial; - } - - interface LoDashExplicitWrapper { - /** - * @see _.partial - */ - partial: ExplicitPartial; - } - - type PH = LoDashStatic; - - type Function0 = () => R; - type Function1 = (t1: T1) => R; - type Function2 = (t1: T1, t2: T2) => R; - type Function3 = (t1: T1, t2: T2, t3: T3) => R; - type Function4 = (t1: T1, t2: T2, t3: T3, t4: T4) => R; - - interface Partial { - // arity 0 - (func: Function0): Function0; - // arity 1 - (func: Function1): Function1; - (func: Function1, arg1: T1): Function0; - // arity 2 - (func: Function2): Function2; - (func: Function2, arg1: T1): Function1< T2, R>; - (func: Function2, plc1: PH, arg2: T2): Function1; - (func: Function2, arg1: T1, arg2: T2): Function0< R>; - // arity 3 - (func: Function3): Function3; - (func: Function3, arg1: T1): Function2< T2, T3, R>; - (func: Function3, plc1: PH, arg2: T2): Function2; - (func: Function3, arg1: T1, arg2: T2): Function1< T3, R>; - (func: Function3, plc1: PH, plc2: PH, arg3: T3): Function2; - (func: Function3, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>; - (func: Function3, plc1: PH, arg2: T2, arg3: T3): Function1; - (func: Function3, arg1: T1, arg2: T2, arg3: T3): Function0< R>; - // arity 4 - (func: Function4): Function4; - (func: Function4, arg1: T1): Function3< T2, T3, T4, R>; - (func: Function4, plc1: PH, arg2: T2): Function3; - (func: Function4, arg1: T1, arg2: T2): Function2< T3, T4, R>; - (func: Function4, plc1: PH, plc2: PH, arg3: T3): Function3; - (func: Function4, arg1: T1, plc2: PH, arg3: T3): Function2< T2, T4, R>; - (func: Function4, plc1: PH, arg2: T2, arg3: T3): Function2; - (func: Function4, arg1: T1, arg2: T2, arg3: T3): Function1< T4, R>; - (func: Function4, plc1: PH, plc2: PH, plc3: PH, arg4: T4): Function3; - (func: Function4, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>; - (func: Function4, plc1: PH, arg2: T2, plc3: PH, arg4: T4): Function2; - (func: Function4, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>; - (func: Function4, plc1: PH, plc2: PH, arg3: T3, arg4: T4): Function2; - (func: Function4, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>; - (func: Function4, plc1: PH, arg2: T2, arg3: T3, arg4: T4): Function1; - (func: Function4, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>; - // catch-all - (func: (...args: any[]) => any, ...args: any[]): (...args: any[]) => any; - } - - interface ImplicitPartial { - // arity 0 - (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - // arity 1 - (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; - // arity 2 - (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; - // arity 3 - (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashImplicitWrapper>; - // arity 4 - (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - // catch-all - (...args: any[]): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface ExplicitPartial { - // arity 0 - (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - // arity 1 - (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; - // arity 2 - (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; - // arity 3 - (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashExplicitWrapper>; - // arity 4 - (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - // catch-all - (...args: any[]): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.partialRight - interface LoDashStatic { - /** - * This method is like _.partial except that partial arguments are appended to those provided - * to the new function. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - partialRight: PartialRight; - } - - interface LoDashImplicitWrapper { - /** - * @see _.partialRight - */ - partialRight: ImplicitPartialRight; - } - - interface LoDashExplicitWrapper { - /** - * @see _.partialRight - */ - partialRight: ExplicitPartialRight; - } - - interface PartialRight { - // arity 0 - (func: Function0): Function0; - // arity 1 - (func: Function1): Function1; - (func: Function1, arg1: T1): Function0; - // arity 2 - (func: Function2): Function2; - (func: Function2, arg1: T1, plc2: PH): Function1< T2, R>; - (func: Function2, arg2: T2): Function1; - (func: Function2, arg1: T1, arg2: T2): Function0< R>; - // arity 3 - (func: Function3): Function3; - (func: Function3, arg1: T1, plc2: PH, plc3: PH): Function2< T2, T3, R>; - (func: Function3, arg2: T2, plc3: PH): Function2; - (func: Function3, arg1: T1, arg2: T2, plc3: PH): Function1< T3, R>; - (func: Function3, arg3: T3): Function2; - (func: Function3, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>; - (func: Function3, arg2: T2, arg3: T3): Function1; - (func: Function3, arg1: T1, arg2: T2, arg3: T3): Function0< R>; - // arity 4 - (func: Function4): Function4; - (func: Function4, arg1: T1, plc2: PH, plc3: PH, plc4: PH): Function3< T2, T3, T4, R>; - (func: Function4, arg2: T2, plc3: PH, plc4: PH): Function3; - (func: Function4, arg1: T1, arg2: T2, plc3: PH, plc4: PH): Function2< T3, T4, R>; - (func: Function4, arg3: T3, plc4: PH): Function3; - (func: Function4, arg1: T1, plc2: PH, arg3: T3, plc4: PH): Function2< T2, T4, R>; - (func: Function4, arg2: T2, arg3: T3, plc4: PH): Function2; - (func: Function4, arg1: T1, arg2: T2, arg3: T3, plc4: PH): Function1< T4, R>; - (func: Function4, arg4: T4): Function3; - (func: Function4, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>; - (func: Function4, arg2: T2, plc3: PH, arg4: T4): Function2; - (func: Function4, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>; - (func: Function4, arg3: T3, arg4: T4): Function2; - (func: Function4, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>; - (func: Function4, arg2: T2, arg3: T3, arg4: T4): Function1; - (func: Function4, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>; - // catch-all - (func: (...args: any[]) => any, ...args: any[]): (...args: any[]) => any; - } - - interface ImplicitPartialRight { - // arity 0 - (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - // arity 1 - (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; - // arity 2 - (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; - // arity 3 - (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2, plc3: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashImplicitWrapper>; - // arity 4 - (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2, plc3: PH, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg3: T3, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2, arg3: T3, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - // catch-all - (...args: any[]): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface ExplicitPartialRight { - // arity 0 - (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - // arity 1 - (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; - // arity 2 - (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; - // arity 3 - (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2, plc3: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashExplicitWrapper>; - // arity 4 - (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2, plc3: PH, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg3: T3, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2, arg3: T3, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - // catch-all - (...args: any[]): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.rearg - interface LoDashStatic { - /** - * Creates a function that invokes func with arguments arranged according to the specified indexes where the - * argument value at the first index is provided as the first argument, the argument value at the second index - * is provided as the second argument, and so on. - * @param func The function to rearrange arguments for. - * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes. - * @return Returns the new function. - */ - rearg(func: (...args: any[]) => any, ...indexes: Array>): (...args: any[]) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.rearg - */ - rearg(...indexes: Array>): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.rearg - */ - rearg(...indexes: Array>): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.rest - interface LoDashStatic { - /** - * Creates a function that invokes func with the this binding of the created function and arguments from start - * and beyond provided as an array. - * - * Note: This method is based on the rest parameter. - * - * @param func The function to apply a rest parameter to. - * @param start The start position of the rest parameter. - * @return Returns the new function. - */ - rest( - func: (...args: any[]) => any, - start?: number - ): (...args: any[]) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.rest - */ - rest(start?: number): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.rest - */ - rest(start?: number): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.spread - interface LoDashStatic { - /** - * Creates a function that invokes func with the this binding of the created function and an array of arguments - * much like Function#apply. - * - * Note: This method is based on the spread operator. - * - * @param func The function to spread arguments over. - * @return Returns the new function. - */ - spread(func: (...args: any[]) => TResult): (...args: any[]) => TResult; - - /** - * @see _.spread - */ - spread(func: (...args: any[]) => TResult, start: number): (...args: any[]) => TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.spread - */ - spread(this: LoDashImplicitWrapper<(...args: any[]) => TResult>): LoDashImplicitWrapper<(...args: any[]) => TResult>; - - /** - * @see _.spread - */ - spread(this: LoDashImplicitWrapper<(...args: any[]) => TResult>, start: number): LoDashImplicitWrapper<(...args: any[]) => TResult>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.spread - */ - spread(this: LoDashExplicitWrapper<(...args: any[]) => TResult>): LoDashExplicitWrapper<(...args: any[]) => TResult>; - - /** - * @see _.spread - */ - spread(this: LoDashExplicitWrapper<(...args: any[]) => TResult>, start: number): LoDashExplicitWrapper<(...args: any[]) => TResult>; - } - - //_.throttle - interface ThrottleSettings { - /** - * If you'd like to disable the leading-edge call, pass this as false. - */ - leading?: boolean; - - /** - * If you'd like to disable the execution on the trailing-edge, pass false. - */ - trailing?: boolean; - } - - interface LoDashStatic { - /** - * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled - * function comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke - * them. Provide an options object to indicate that func should be invoked on the leading and/or trailing edge - * of the wait timeout. Subsequent calls to the throttled function return the result of the last func call. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if - * the the throttled function is invoked more than once during the wait timeout. - * - * @param func The function to throttle. - * @param wait The number of milliseconds to throttle invocations to. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new throttled function. - */ - throttle any>( - func: T, - wait?: number, - options?: ThrottleSettings - ): T & Cancelable; - } - - interface LoDashImplicitWrapper { - /** - * @see _.throttle - */ - throttle( - wait?: number, - options?: ThrottleSettings - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.throttle - */ - throttle( - wait?: number, - options?: ThrottleSettings - ): LoDashExplicitWrapper; - } - - //_.unary - interface LoDashStatic { - /** - * Creates a function that accepts up to one argument, ignoring any - * additional arguments. - * - * @category Function - * @param func The function to cap arguments for. - * @returns Returns the new function. - * @example - * - * _.map(['6', '8', '10'], _.unary(parseInt)); - * // => [6, 8, 10] - */ - unary(func: (arg1: T, ...args: any[]) => TResult): (arg1: T) => TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.unary - */ - unary(this: LoDashImplicitWrapper<(arg1: T, ...args: any[]) => TResult>): LoDashImplicitWrapper<(arg1: T) => TResult>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.unary - */ - unary(this: LoDashExplicitWrapper<(arg1: T, ...args: any[]) => TResult>): LoDashExplicitWrapper<(arg1: T) => TResult>; - } - - //_.wrap - interface LoDashStatic { - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - wrap( - value: T, - wrapper: (value: T, ...args: TArgs[]) => TResult - ): (...args: TArgs[]) => TResult; - - /** - * @see _.wrap - */ - wrap( - value: T, - wrapper: (value: T, ...args: any[]) => TResult - ): (...args: any[]) => TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.wrap - */ - wrap( - wrapper: (value: TValue, ...args: TArgs[]) => TResult - ): LoDashImplicitWrapper<(...args: TArgs[]) => TResult>; - - /** - * @see _.wrap - */ - wrap( - wrapper: (value: TValue, ...args: any[]) => TResult - ): LoDashImplicitWrapper<(...args: any[]) => TResult>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.wrap - */ - /** - * @see _.wrap - */ - wrap( - wrapper: (value: TValue, ...args: TArgs[]) => TResult - ): LoDashExplicitWrapper<(...args: TArgs[]) => TResult>; - - /** - * @see _.wrap - */ - wrap( - wrapper: (value: TValue, ...args: any[]) => TResult - ): LoDashExplicitWrapper<(...args: any[]) => TResult>; - } - - /******** - * Lang * - ********/ - - //_.castArray - interface LoDashStatic { - /** - * Casts value as an array if it’s not one. - * - * @param value The value to inspect. - * @return Returns the cast array. - */ - castArray(value?: Many): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.castArray - */ - castArray(this: LoDashImplicitWrapper>): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.castArray - */ - castArray(this: LoDashExplicitWrapper>): LoDashExplicitWrapper; - } - - //_.clone - interface LoDashStatic { - /** - * Creates a shallow clone of value. - * - * Note: This method is loosely based on the structured clone algorithm and supports cloning arrays, - * array buffers, booleans, date objects, maps, numbers, Object objects, regexes, sets, strings, symbols, - * and typed arrays. The own enumerable properties of arguments objects are cloned as plain objects. An empty - * object is returned for uncloneable values such as error objects, functions, DOM nodes, and WeakMaps. - * - * @param value The value to clone. - * @return Returns the cloned value. - */ - clone(value: T): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.clone - */ - clone(): TValue; - } - - interface LoDashExplicitWrapper { - /** - * @see _.clone - */ - clone(): this; - } - - //_.cloneDeep - interface LoDashStatic { - /** - * This method is like _.clone except that it recursively clones value. - * - * @param value The value to recursively clone. - * @return Returns the deep cloned value. - */ - cloneDeep(value: T): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.cloneDeep - */ - cloneDeep(): TValue; - } - - interface LoDashExplicitWrapper { - /** - * @see _.cloneDeep - */ - cloneDeep(): this; - } - - //_.cloneDeepWith - type CloneDeepWithCustomizer = (value: any, key: number | string | undefined, object: TObject | undefined, stack: any) => any; - - interface LoDashStatic { - /** - * This method is like _.cloneWith except that it recursively clones value. - * - * @param value The value to recursively clone. - * @param customizer The function to customize cloning. - * @return Returns the deep cloned value. - */ - cloneDeepWith( - value: T, - customizer: CloneDeepWithCustomizer - ): any; - - /** - * @see _.cloneDeepWith - */ - cloneDeepWith(value: T): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer: CloneDeepWithCustomizer - ): any; - - /** - * @see _.cloneDeepWith - */ - cloneDeepWith(): TValue; - } - - interface LoDashExplicitWrapper { - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer: CloneDeepWithCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.cloneDeepWith - */ - cloneDeepWith(): this; - } - - //_.cloneWith - type CloneWithCustomizer = (value: TValue, key: number | string | undefined, object: any, stack: any) => TResult; - - interface LoDashStatic { - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - cloneWith( - value: T, - customizer: CloneWithCustomizer - ): TResult; - - /** - * @see _.cloneWith - */ - cloneWith( - value: T, - customizer: CloneWithCustomizer - ): TResult | T; - - /** - * @see _.cloneWith - */ - cloneWith(value: T): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.cloneWith - */ - cloneWith( - customizer: CloneWithCustomizer - ): TResult; - - /** - * @see _.cloneWith - */ - cloneWith( - customizer: CloneWithCustomizer - ): TResult | TValue; - - /** - * @see _.cloneWith - */ - cloneWith(): TValue; - } - - interface LoDashExplicitWrapper { - /** - * @see _.cloneWith - */ - cloneWith( - customizer: CloneWithCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.cloneWith - */ - cloneWith( - customizer: CloneWithCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.cloneWith - */ - cloneWith(): this; - } - - /** - * An object containing predicate functions for each property of T - */ - type ConformsPredicateObject = { - [P in keyof T]?: (val: T[P]) => boolean; - }; - - //_.conforms - interface LoDashStatic { - /** - * Creates a function that invokes the predicate properties of `source` with the corresponding - * property values of a given object, returning true if all predicates return truthy, else false. - */ - conforms(source: ConformsPredicateObject): (value: T) => boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.conforms - */ - conforms(this: LoDashImplicitWrapper>): LoDashImplicitWrapper<(value: T) => boolean>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.conforms - */ - conforms(this: LoDashExplicitWrapper>): LoDashExplicitWrapper<(value: T) => boolean>; - } - - //_.conformsTo - interface LoDashStatic { - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - conformsTo(object: T, source: ConformsPredicateObject): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.conformsTo - */ - conformsTo(this: LoDashImplicitWrapper, source: ConformsPredicateObject): boolean; - // Note: we can't use TValue here, because it generates a typescript error when strictFunctionTypes is enabled. - } - - interface LoDashExplicitWrapper { - /** - * @see _.conformsTo - */ - conformsTo(this: LoDashImplicitWrapper, source: ConformsPredicateObject): LoDashExplicitWrapper; - // Note: we can't use TValue here, because it generates a typescript error when strictFunctionTypes is enabled. - } - - type CondPair = [(val: T) => boolean, (val: T) => R] - - //_.cond - interface LoDashStatic { - /** - * Creates a function that iterates over `pairs` and invokes the corresponding - * function of the first predicate to return truthy. The predicate-function - * pairs are invoked with the `this` binding and arguments of the created - * function. - * - * @since 4.0.0 - * @category Util - * @param pairs The predicate-function pairs. - * @returns Returns the new composite function. - * @example - * - * var func = _.cond([ - * [_.matches({ 'a': 1 }), _.constant('matches A')], - * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], - * [_.stubTrue, _.constant('no match')] - * ]); - * - * func({ 'a': 1, 'b': 2 }); - * // => 'matches A' - * - * func({ 'a': 0, 'b': 1 }); - * // => 'matches B' - * - * func({ 'a': '1', 'b': '2' }); - * // => 'no match' - */ - cond(pairs: CondPair[]): (Target: T) => R; - } - - //_.eq - interface LoDashStatic { - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - eq( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.eq - */ - eq( - other: any - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.eq - */ - eq( - other: any - ): LoDashExplicitWrapper; - } - - //_.gt - interface LoDashStatic { - /** - * Checks if value is greater than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than other, else false. - */ - gt( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.gt - */ - gt(other: any): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.gt - */ - gt(other: any): LoDashExplicitWrapper; - } - - //_.gte - interface LoDashStatic { - /** - * Checks if value is greater than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than or equal to other, else false. - */ - gte( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.gte - */ - gte(other: any): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.gte - */ - gte(other: any): LoDashExplicitWrapper; - } - - //_.isArguments - interface LoDashStatic { - /** - * Checks if value is classified as an arguments object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isArguments(value?: any): value is IArguments; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isArguments - */ - isArguments(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isArguments - */ - isArguments(): LoDashExplicitWrapper; - } - - //_.isArray - interface LoDashStatic { - /** - * Checks if value is classified as an Array object. - * @param value The value to check. - * - * @return Returns true if value is correctly classified, else false. - */ - isArray(value?: any): value is any[]; - - /** - * DEPRECATED - */ - isArray(value?: any): value is any[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isArray - */ - isArray(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isArray - */ - isArray(): LoDashExplicitWrapper; - } - - //_.isArrayBuffer - interface LoDashStatic { - /** - * Checks if value is classified as an ArrayBuffer object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isArrayBuffer(value?: any): value is ArrayBuffer; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isArrayBuffer - */ - isArrayBuffer(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isArrayBuffer - */ - isArrayBuffer(): LoDashExplicitWrapper; - } - - //_.isArrayLike - interface LoDashStatic { - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - isArrayLike(value: T & string & number): boolean; // should only match if T = any - - /** - * @see _.isArrayLike - */ - isArrayLike(value: ((...args: any[]) => any) | Function | null | undefined): value is never; - - /** - * @see _.isArrayLike - */ - isArrayLike(value: any): value is { length: number }; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isArrayLike - */ - isArrayLike(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isArrayLike - */ - isArrayLike(): LoDashExplicitWrapper; - } - - //_.isArrayLikeObject - interface LoDashStatic { - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - isArrayLikeObject(value: T & string & number): boolean; // should only match if T = any - - /** - * @see _.isArrayLike - */ - isArrayLikeObject(value: ((...args: any[]) => any) | Function | string | boolean | number | null | undefined): value is never; - - /** - * @see _.isArrayLike - */ - isArrayLikeObject(value: T | string | boolean | number | null | undefined): value is T & { length: number }; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isArrayLikeObject - */ - isArrayLikeObject(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isArrayLikeObject - */ - isArrayLikeObject(): LoDashExplicitWrapper; - } - - //_.isBoolean - interface LoDashStatic { - /** - * Checks if value is classified as a boolean primitive or object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isBoolean(value?: any): value is boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isBoolean - */ - isBoolean(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isBoolean - */ - isBoolean(): LoDashExplicitWrapper; - } - - //_.isBuffer - interface LoDashStatic { - /** - * Checks if value is a buffer. - * - * @param value The value to check. - * @return Returns true if value is a buffer, else false. - */ - isBuffer(value?: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isBuffer - */ - isBuffer(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isBuffer - */ - isBuffer(): LoDashExplicitWrapper; - } - - //_.isDate - interface LoDashStatic { - /** - * Checks if value is classified as a Date object. - * @param value The value to check. - * - * @return Returns true if value is correctly classified, else false. - */ - isDate(value?: any): value is Date; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isDate - */ - isDate(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isDate - */ - isDate(): LoDashExplicitWrapper; - } - - //_.isElement - interface LoDashStatic { - /** - * Checks if value is a DOM element. - * - * @param value The value to check. - * @return Returns true if value is a DOM element, else false. - */ - isElement(value?: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isElement - */ - isElement(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isElement - */ - isElement(): LoDashExplicitWrapper; - } - - //_.isEmpty - interface LoDashStatic { - /** - * Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string, or - * jQuery-like collection with a length greater than 0 or an object with own enumerable properties. - * - * @param value The value to inspect. - * @return Returns true if value is empty, else false. - */ - isEmpty(value?: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isEmpty - */ - isEmpty(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isEmpty - */ - isEmpty(): LoDashExplicitWrapper; - } - - //_.isEqual - interface LoDashStatic { - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - isEqual( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isEqual - */ - isEqual( - other: any - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isEqual - */ - isEqual( - other: any - ): LoDashExplicitWrapper; - } - - // _.isEqualWith - type IsEqualCustomizer = (value: any, other: any, indexOrKey: PropertyName | undefined, parent: any, otherParent: any, stack: any) => boolean|undefined; - - interface LoDashStatic { - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - isEqualWith( - value: any, - other: any, - customizer?: IsEqualCustomizer - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isEqualWith - */ - isEqualWith( - other: any, - customizer?: IsEqualCustomizer - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isEqualWith - */ - isEqualWith( - other: any, - customizer?: IsEqualCustomizer - ): LoDashExplicitWrapper; - } - - //_.isError - interface LoDashStatic { - /** - * Checks if value is an Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, or URIError - * object. - * - * @param value The value to check. - * @return Returns true if value is an error object, else false. - */ - isError(value: any): value is Error; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isError - */ - isError(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isError - */ - isError(): LoDashExplicitWrapper; - } - - //_.isFinite - interface LoDashStatic { - /** - * Checks if value is a finite primitive number. - * - * Note: This method is based on Number.isFinite. - * - * @param value The value to check. - * @return Returns true if value is a finite number, else false. - */ - isFinite(value?: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isFinite - */ - isFinite(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isFinite - */ - isFinite(): LoDashExplicitWrapper; - } - - //_.isFunction - interface LoDashStatic { - /** - * Checks if value is a callable function. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isFunction(value: any): value is (...args: any[]) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isFunction - */ - isFunction(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isFunction - */ - isFunction(): LoDashExplicitWrapper; - } - - //_.isInteger - interface LoDashStatic { - /** - * Checks if `value` is an integer. - * - * **Note:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger). - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is an integer, else `false`. - * @example - * - * _.isInteger(3); - * // => true - * - * _.isInteger(Number.MIN_VALUE); - * // => false - * - * _.isInteger(Infinity); - * // => false - * - * _.isInteger('3'); - * // => false - */ - isInteger(value?: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isInteger - */ - isInteger(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isInteger - */ - isInteger(): LoDashExplicitWrapper; - } - - //_.isLength - interface LoDashStatic { - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - isLength(value?: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isLength - */ - isLength(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isLength - */ - isLength(): LoDashExplicitWrapper; - } - - //_.isMap - interface LoDashStatic { - /** - * Checks if value is classified as a Map object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - isMap(value?: any): value is Map; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isMap - */ - isMap(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isMap - */ - isMap(): LoDashExplicitWrapper; - } - - //_.isMatch - type isMatchCustomizer = (value: any, other: any, indexOrKey?: PropertyName) => boolean; - - interface LoDashStatic { - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - isMatch(object: object, source: object): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isMatch - */ - isMatch(source: object): boolean; - } - - //_.isMatchWith - type isMatchWithCustomizer = (value: any, other: any, indexOrKey: PropertyName) => boolean; - - interface LoDashStatic { - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - isMatchWith(object: object, source: object, customizer: isMatchWithCustomizer): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isMatchWith - */ - isMatchWith(source: object, customizer: isMatchWithCustomizer): boolean; - } - - //_.isNaN - interface LoDashStatic { - /** - * Checks if value is NaN. - * - * Note: This method is not the same as isNaN which returns true for undefined and other non-numeric values. - * - * @param value The value to check. - * @return Returns true if value is NaN, else false. - */ - isNaN(value?: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isNaN - */ - isNaN(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isNaN - */ - isNaN(): LoDashExplicitWrapper; - } - - //_.isNative - interface LoDashStatic { - /** - * Checks if value is a native function. - * @param value The value to check. - * - * @retrun Returns true if value is a native function, else false. - */ - isNative(value: any): value is ((...args: any[]) => any) | Function; - } - - interface LoDashImplicitWrapper { - /** - * see _.isNative - */ - isNative(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isNative - */ - isNative(): LoDashExplicitWrapper; - } - - //_.isNil - interface LoDashStatic { - /** - * Checks if `value` is `null` or `undefined`. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is nullish, else `false`. - * @example - * - * _.isNil(null); - * // => true - * - * _.isNil(void 0); - * // => true - * - * _.isNil(NaN); - * // => false - */ - isNil(value: any): value is null | undefined; - } - - interface LoDashImplicitWrapper { - /** - * see _.isNil - */ - isNil(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isNil - */ - isNil(): LoDashExplicitWrapper; - } - - //_.isNull - interface LoDashStatic { - /** - * Checks if value is null. - * - * @param value The value to check. - * @return Returns true if value is null, else false. - */ - isNull(value: any): value is null; - } - - interface LoDashImplicitWrapper { - /** - * see _.isNull - */ - isNull(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isNull - */ - isNull(): LoDashExplicitWrapper; - } - - //_.isNumber - interface LoDashStatic { - /** - * Checks if value is classified as a Number primitive or object. - * - * Note: To exclude Infinity, -Infinity, and NaN, which are classified as numbers, use the _.isFinite method. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isNumber(value?: any): value is number; - } - - interface LoDashImplicitWrapper { - /** - * see _.isNumber - */ - isNumber(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isNumber - */ - isNumber(): LoDashExplicitWrapper; - } - - //_.isObject - interface LoDashStatic { - /** - * Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, new Number(0), - * and new String('')) - * - * @param value The value to check. - * @return Returns true if value is an object, else false. - */ - isObject(value?: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * see _.isObject - */ - isObject(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isObject - */ - isObject(): LoDashExplicitWrapper; - } - - //_.isObjectLike - interface LoDashStatic { - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - isObjectLike(value?: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * see _.isObjectLike - */ - isObjectLike(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isObjectLike - */ - isObjectLike(): LoDashExplicitWrapper; - } - - //_.isPlainObject - interface LoDashStatic { - /** - * Checks if value is a plain object, that is, an object created by the Object constructor or one with a - * [[Prototype]] of null. - * - * Note: This method assumes objects created by the Object constructor have no inherited enumerable properties. - * - * @param value The value to check. - * @return Returns true if value is a plain object, else false. - */ - isPlainObject(value?: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * see _.isPlainObject - */ - isPlainObject(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isPlainObject - */ - isPlainObject(): LoDashExplicitWrapper; - } - - //_.isRegExp - interface LoDashStatic { - /** - * Checks if value is classified as a RegExp object. - * @param value The value to check. - * - * @return Returns true if value is correctly classified, else false. - */ - isRegExp(value?: any): value is RegExp; - } - - interface LoDashImplicitWrapper { - /** - * see _.isRegExp - */ - isRegExp(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isRegExp - */ - isRegExp(): LoDashExplicitWrapper; - } - - //_.isSafeInteger - interface LoDashStatic { - /** - * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 - * double precision number which isn't the result of a rounded unsafe integer. - * - * **Note:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is a safe integer, else `false`. - * @example - * - * _.isSafeInteger(3); - * // => true - * - * _.isSafeInteger(Number.MIN_VALUE); - * // => false - * - * _.isSafeInteger(Infinity); - * // => false - * - * _.isSafeInteger('3'); - * // => false - */ - isSafeInteger(value: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * see _.isSafeInteger - */ - isSafeInteger(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isSafeInteger - */ - isSafeInteger(): LoDashExplicitWrapper; - } - - //_.isSet - interface LoDashStatic { - /** - * Checks if value is classified as a Set object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - isSet(value?: any): value is Set; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isSet - */ - isSet(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isSet - */ - isSet(): LoDashExplicitWrapper; - } - - //_.isString - interface LoDashStatic { - /** - * Checks if value is classified as a String primitive or object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isString(value?: any): value is string; - } - - interface LoDashImplicitWrapper { - /** - * see _.isString - */ - isString(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isString - */ - isString(): LoDashExplicitWrapper; - } - - //_.isSymbol - interface LoDashStatic { - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - isSymbol(value: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * see _.isSymbol - */ - isSymbol(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isSymbol - */ - isSymbol(): LoDashExplicitWrapper; - } - - //_.isTypedArray - interface LoDashStatic { - /** - * Checks if value is classified as a typed array. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isTypedArray(value: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * see _.isTypedArray - */ - isTypedArray(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isTypedArray - */ - isTypedArray(): LoDashExplicitWrapper; - } - - //_.isUndefined - interface LoDashStatic { - /** - * Checks if value is undefined. - * - * @param value The value to check. - * @return Returns true if value is undefined, else false. - */ - isUndefined(value: any): value is undefined; - } - - interface LoDashImplicitWrapper { - /** - * see _.isUndefined - */ - isUndefined(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isUndefined - */ - isUndefined(): LoDashExplicitWrapper; - } - - //_.isWeakMap - interface LoDashStatic { - /** - * Checks if value is classified as a WeakMap object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - isWeakMap(value?: any): value is WeakMap; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isSet - */ - isWeakMap(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isSet - */ - isWeakMap(): LoDashExplicitWrapper; - } - - //_.isWeakSet - interface LoDashStatic { - /** - * Checks if value is classified as a WeakSet object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - isWeakSet(value?: any): value is WeakSet; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isWeakSet - */ - isWeakSet(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isWeakSet - */ - isWeakSet(): LoDashExplicitWrapper; - } - - //_.lt - interface LoDashStatic { - /** - * Checks if value is less than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than other, else false. - */ - lt( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.lt - */ - lt(other: any): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.lt - */ - lt(other: any): LoDashExplicitWrapper; - } - - //_.lte - interface LoDashStatic { - /** - * Checks if value is less than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than or equal to other, else false. - */ - lte( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.lte - */ - lte(other: any): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.lte - */ - lte(other: any): LoDashExplicitWrapper; - } - - //_.toArray - interface LoDashStatic { - /** - * Converts value to an array. - * - * @param value The value to convert. - * @return Returns the converted array. - */ - toArray(value: List | Dictionary | NumericDictionary | null | undefined): T[]; - - /** - * @see _.toArray - */ - toArray(value: T): Array; - - /** - * @see _.toArray - */ - toArray(): any[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toArray - */ - toArray(this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>): LoDashImplicitWrapper; - - /** - * @see _.toArray - */ - toArray(this: LoDashImplicitWrapper): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toArray - */ - toArray(this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>): LoDashExplicitWrapper; - - /** - * @see _.toArray - */ - toArray(this: LoDashImplicitWrapper): LoDashExplicitWrapper>; - } - - //_.toPlainObject - interface LoDashStatic { - /** - * Converts value to a plain object flattening inherited enumerable properties of value to own properties - * of the plain object. - * - * @param value The value to convert. - * @return Returns the converted plain object. - */ - toPlainObject(value?: any): any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toPlainObject - */ - toPlainObject(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toPlainObject - */ - toPlainObject(): LoDashExplicitWrapper; - } - - //_.toFinite - interface LoDashStatic { - /** - * Converts `value` to a finite number. - * - * @since 4.12.0 - * @category Lang - * @param value The value to convert. - * @returns Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ - toFinite(value: any): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toFinite - */ - toFinite(): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toFinite - */ - toFinite(): LoDashExplicitWrapper; - } - - //_.toInteger - interface LoDashStatic { - /** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @category Lang - * @param value The value to convert. - * @returns Returns the converted integer. - * @example - * - * _.toInteger(3); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3'); - * // => 3 - */ - toInteger(value: any): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toInteger - */ - toInteger(): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toInteger - */ - toInteger(): LoDashExplicitWrapper; - } - - //_.toLength - interface LoDashStatic { - /** - * Converts `value` to an integer suitable for use as the length of an - * array-like object. - * - * **Note:** This method is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @category Lang - * @param value The value to convert. - * @return Returns the converted integer. - * @example - * - * _.toLength(3); - * // => 3 - * - * _.toLength(Number.MIN_VALUE); - * // => 0 - * - * _.toLength(Infinity); - * // => 4294967295 - * - * _.toLength('3'); - * // => 3 - */ - toLength(value: any): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toLength - */ - toLength(): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toLength - */ - toLength(): LoDashExplicitWrapper; - } - - //_.toNumber - interface LoDashStatic { - /** - * Converts `value` to a number. - * - * @category Lang - * @param value The value to process. - * @returns Returns the number. - * @example - * - * _.toNumber(3); - * // => 3 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3'); - * // => 3 - */ - toNumber(value: any): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toNumber - */ - toNumber(): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toNumber - */ - toNumber(): LoDashExplicitWrapper; - } - - //_.toSafeInteger - interface LoDashStatic { - /** - * Converts `value` to a safe integer. A safe integer can be compared and - * represented correctly. - * - * @category Lang - * @param value The value to convert. - * @returns Returns the converted integer. - * @example - * - * _.toSafeInteger(3); - * // => 3 - * - * _.toSafeInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toSafeInteger(Infinity); - * // => 9007199254740991 - * - * _.toSafeInteger('3'); - * // => 3 - */ - toSafeInteger(value: any): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toSafeInteger - */ - toSafeInteger(): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toSafeInteger - */ - toSafeInteger(): LoDashExplicitWrapper; - } - - //_.toString - interface LoDashStatic { - /** - * Converts `value` to a string if it's not one. An empty string is returned - * for `null` and `undefined` values. The sign of `-0` is preserved. - * - * @category Lang - * @param value The value to process. - * @returns Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ - toString(value: any): string; - } - - /******** - * Math * - ********/ - - //_.add - interface LoDashStatic { - /** - * Adds two numbers. - * - * @param augend The first number to add. - * @param addend The second number to add. - * @return Returns the sum. - */ - add( - augend: number, - addend: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.add - */ - add(addend: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.add - */ - add(addend: number): LoDashExplicitWrapper; - } - - //_.ceil - interface LoDashStatic { - /** - * Calculates n rounded up to precision. - * - * @param n The number to round up. - * @param precision The precision to round up to. - * @return Returns the rounded up number. - */ - ceil( - n: number, - precision?: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.ceil - */ - ceil(precision?: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.ceil - */ - ceil(precision?: number): LoDashExplicitWrapper; - } - - //_.divide - interface LoDashStatic { - /** - * Divide two numbers. - * - * @param dividend The first number in a division. - * @param divisor The second number in a division. - * @returns Returns the quotient. - */ - divide( - dividend: number, - divisor: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.divide - */ - divide(divisor: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.divide - */ - divide(divisor: number): LoDashExplicitWrapper; - } - - //_.floor - interface LoDashStatic { - /** - * Calculates n rounded down to precision. - * - * @param n The number to round down. - * @param precision The precision to round down to. - * @return Returns the rounded down number. - */ - floor( - n: number, - precision?: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.floor - */ - floor(precision?: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.floor - */ - floor(precision?: number): LoDashExplicitWrapper; - } - - //_.max - interface LoDashStatic { - /** - * Computes the maximum value of `array`. If `array` is empty or falsey - * `undefined` is returned. - * - * @category Math - * @param array The array to iterate over. - * @returns Returns the maximum value. - */ - max( - collection: List | null | undefined - ): T | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.max - */ - max(this: LoDashImplicitWrapper | null | undefined>): T | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.max - */ - max(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - //_.maxBy - interface LoDashStatic { - /** - * This method is like `_.max` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the maximum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.maxBy(objects, function(o) { return o.a; }); - * // => { 'n': 2 } - * - * // using the `_.property` iteratee shorthand - * _.maxBy(objects, 'n'); - * // => { 'n': 2 } - */ - maxBy( - collection: List | null | undefined, - iteratee?: ListIteratee - ): T | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.maxBy - */ - maxBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): T | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.maxBy - */ - maxBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): LoDashExplicitWrapper; - } - - //_.mean - interface LoDashStatic { - /** - * Computes the mean of the values in `array`. - * - * @category Math - * @param array The array to iterate over. - * @returns Returns the mean. - * @example - * - * _.mean([4, 2, 8, 6]); - * // => 5 - */ - mean( - collection: List | null | undefined - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.mean - */ - mean(): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.mean - */ - mean(): LoDashExplicitWrapper; - } - - //_.meanBy - interface LoDashStatic { - /** - * Computes the mean of the provided propties of the objects in the `array` - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the mean. - * @example - * - * _.mean([{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }], 'n'); - * // => 5 - */ - meanBy( - collection: List | null | undefined, - iteratee?: ListIteratee - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.meanBy - */ - meanBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.meanBy - */ - meanBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): LoDashExplicitWrapper; - } - - //_.min - interface LoDashStatic { - /** - * Computes the minimum value of `array`. If `array` is empty or falsey - * `undefined` is returned. - * - * @category Math - * @param array The array to iterate over. - * @returns Returns the minimum value. - */ - min( - collection: List | null | undefined - ): T | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.min - */ - min(this: LoDashImplicitWrapper | null | undefined>): T | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.min - */ - min(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - //_.minBy - interface LoDashStatic { - /** - * This method is like `_.min` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the minimum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.minBy(objects, function(o) { return o.a; }); - * // => { 'n': 1 } - * - * // using the `_.property` iteratee shorthand - * _.minBy(objects, 'n'); - * // => { 'n': 1 } - */ - minBy( - collection: List | null | undefined, - iteratee?: ListIteratee - ): T | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.minBy - */ - minBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): T | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.minBy - */ - minBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): LoDashExplicitWrapper; - } - - //_.multiply - interface LoDashStatic { - /** - * Multiply two numbers. - * @param multiplier The first number in a multiplication. - * @param multiplicand The second number in a multiplication. - * @returns Returns the product. - */ - multiply( - multiplier: number, - multiplicand: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.multiply - */ - multiply(multiplicand: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.multiply - */ - multiply(multiplicand: number): LoDashExplicitWrapper; - } - - //_.round - interface LoDashStatic { - /** - * Calculates n rounded to precision. - * - * @param n The number to round. - * @param precision The precision to round to. - * @return Returns the rounded number. - */ - round( - n: number, - precision?: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.round - */ - round(precision?: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.round - */ - round(precision?: number): LoDashExplicitWrapper; - } - - //_.sum - interface LoDashStatic { - /** - * Computes the sum of the values in `array`. - * - * @category Math - * @param array The array to iterate over. - * @returns Returns the sum. - * @example - * - * _.sum([4, 2, 8, 6]); - * // => 20 - */ - sum(collection: List | null | undefined): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sum - */ - sum(): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sum - */ - sum(): LoDashExplicitWrapper; - } - - //_.sumBy - interface LoDashStatic { - /** - * This method is like `_.sum` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the value to be summed. - * The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the sum. - * @example - * - * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; - * - * _.sumBy(objects, function(o) { return o.n; }); - * // => 20 - * - * // using the `_.property` iteratee shorthand - * _.sumBy(objects, 'n'); - * // => 20 - */ - sumBy( - collection: List | null | undefined, - iteratee?: ((value: T) => number) | string - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sumBy - */ - sumBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ((value: T) => number) | string - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sumBy - */ - sumBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ((value: T) => number) | string - ): LoDashExplicitWrapper; - } - - /********** - * Number * - **********/ - - //_.subtract - interface LoDashStatic { - /** - * Subtract two numbers. - * - * @category Math - * @param minuend The first number in a subtraction. - * @param subtrahend The second number in a subtraction. - * @returns Returns the difference. - * @example - * - * _.subtract(6, 4); - * // => 2 - */ - subtract( - minuend: number, - subtrahend: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.subtract - */ - subtract( - subtrahend: number - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.subtract - */ - subtract( - subtrahend: number - ): LoDashExplicitWrapper; - } - - //_.clamp - interface LoDashStatic { - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @category Number - * @param number The number to clamp. - * @param [lower] The lower bound. - * @param upper The upper bound. - * @returns Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - clamp( - number: number, - lower: number, - upper: number - ): number; - clamp( - number: number, - upper: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.clamp - */ - clamp( - lower: number, - upper: number - ): number; - clamp( - upper: number - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.clamp - */ - clamp( - lower: number, - upper: number - ): LoDashExplicitWrapper; - clamp( - upper: number - ): LoDashExplicitWrapper; - } - - //_.inRange - interface LoDashStatic { - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - inRange( - n: number, - start: number, - end?: number - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.inRange - */ - inRange( - start: number, - end?: number - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.inRange - */ - inRange( - start: number, - end?: number - ): LoDashExplicitWrapper; - } - - //_.random - interface LoDashStatic { - /** - * Produces a random number between min and max (inclusive). If only one argument is provided a number between - * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point - * number is returned instead of an integer. - * - * @param min The minimum possible value. - * @param max The maximum possible value. - * @param floating Specify returning a floating-point number. - * @return Returns the random number. - */ - random( - floating?: boolean - ): number; - - /** - * @see _.random - */ - random( - max: number, - floating?: boolean - ): number; - - /** - * @see _.random - */ - random( - min: number, - max: number, - floating?: boolean - ): number; - - /** - * Produces a random number between min and max (inclusive). If only one argument is provided a number between - * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point - * number is returned instead of an integer. - * - * @param min The minimum possible value. - * @param index Not used in this overload. - * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. - * @return Returns the random number. - */ - random( - min: number, - index: string | number, - guard: object - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.random - */ - random(floating?: boolean): number; - - /** - * @see _.random - */ - random( - max: number, - floating?: boolean - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.random - */ - random(floating?: boolean): LoDashExplicitWrapper; - - /** - * @see _.random - */ - random( - max: number, - floating?: boolean - ): LoDashExplicitWrapper; - } - - /********** - * Object * - **********/ - - //_.assign - interface LoDashStatic { - /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.c = 3; - * } - * - * function Bar() { - * this.e = 5; - * } - * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; - * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } - */ - assign( - object: TObject, - source: TSource - ): TObject & TSource; - - /** - * @see assign - */ - assign( - object: TObject, - source1: TSource1, - source2: TSource2 - ): TObject & TSource1 & TSource2; - - /** - * @see assign - */ - assign( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see assign - */ - assign( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.assign - */ - assign(object: TObject): TObject; - - /** - * @see _.assign - */ - assign( - object: any, - ...otherArgs: any[] - ): any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.assign - */ - assign( - source: TSource - ): LoDashImplicitWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2 - ): LoDashImplicitWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashImplicitWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashImplicitWrapper; - - /** - * @see _.assign - */ - assign(): LoDashImplicitWrapper; - - /** - * @see _.assign - */ - assign(...otherArgs: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.assign - */ - assign( - source: TSource - ): LoDashExplicitWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2 - ): LoDashExplicitWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashExplicitWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashExplicitWrapper; - - /** - * @see _.assign - */ - assign(): LoDashExplicitWrapper; - - /** - * @see _.assign - */ - assign(...otherArgs: any[]): LoDashExplicitWrapper; - } - - interface LoDashStatic { - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - assignWith( - object: TObject, - source: TSource, - customizer: AssignCustomizer - ): TObject & TSource; - - /** - * @see assignWith - */ - assignWith( - object: TObject, - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2; - - /** - * @see assignWith - */ - assignWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see assignWith - */ - assignWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.assignWith - */ - assignWith(object: TObject): TObject; - - /** - * @see _.assignWith - */ - assignWith( - object: any, - ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.assignWith - */ - assignWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see _.assignWith - */ - assignWith(): LoDashImplicitWrapper; - - /** - * @see _.assignWith - */ - assignWith(...otherArgs: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.assignWith - */ - assignWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.assignWith - */ - assignWith(): LoDashExplicitWrapper; - - /** - * @see _.assignWith - */ - assignWith(...otherArgs: any[]): LoDashExplicitWrapper; - } - - //_.assignIn - interface LoDashStatic { - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - assignIn( - object: TObject, - source: TSource - ): TObject & TSource; - - /** - * @see assignIn - */ - assignIn( - object: TObject, - source1: TSource1, - source2: TSource2 - ): TObject & TSource1 & TSource2; - - /** - * @see assignIn - */ - assignIn( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see assignIn - */ - assignIn( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.assignIn - */ - assignIn(object: TObject): TObject; - - /** - * @see _.assignIn - */ - assignIn( - object: any, - ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.assignIn - */ - assignIn( - source: TSource - ): LoDashImplicitWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2 - ): LoDashImplicitWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashImplicitWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashImplicitWrapper; - - /** - * @see _.assignIn - */ - assignIn(): LoDashImplicitWrapper; - - /** - * @see _.assignIn - */ - assignIn(...otherArgs: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.assignIn - */ - assignIn( - source: TSource - ): LoDashExplicitWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2 - ): LoDashExplicitWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashExplicitWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashExplicitWrapper; - - /** - * @see _.assignIn - */ - assignIn(): LoDashExplicitWrapper; - - /** - * @see _.assignIn - */ - assignIn(...otherArgs: any[]): LoDashExplicitWrapper; - } - - //_.assignInWith - type AssignCustomizer = (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}) => any; - - interface LoDashStatic { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - assignInWith( - object: TObject, - source: TSource, - customizer: AssignCustomizer - ): TObject & TSource; - - /** - * @see assignInWith - */ - assignInWith( - object: TObject, - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2; - - /** - * @see assignInWith - */ - assignInWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see assignInWith - */ - assignInWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.assignInWith - */ - assignInWith(object: TObject): TObject; - - /** - * @see _.assignInWith - */ - assignInWith( - object: any, - ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.assignInWith - */ - assignInWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see _.assignInWith - */ - assignInWith(): LoDashImplicitWrapper; - - /** - * @see _.assignInWith - */ - assignInWith(...otherArgs: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.assignInWith - */ - assignInWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.assignInWith - */ - assignInWith(): LoDashExplicitWrapper; - - /** - * @see _.assignInWith - */ - assignInWith(...otherArgs: any[]): LoDashExplicitWrapper; - } - - //_.create - interface LoDashStatic { - /** - * Creates an object that inherits from the given prototype object. If a properties object is provided its own - * enumerable properties are assigned to the created object. - * - * @param prototype The object to inherit from. - * @param properties The properties to assign to the object. - * @return Returns the new object. - */ - create( - prototype: T, - properties?: U - ): T & U; - } - - interface LoDashImplicitWrapper { - /** - * @see _.create - */ - create(properties?: U): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.create - */ - create(properties?: U): LoDashExplicitWrapper; - } - - //_.defaults - interface LoDashStatic { - /** - * Assigns own enumerable properties of source object(s) to the destination object for all destination - * properties that resolve to undefined. Once a property is set, additional values of the same property are - * ignored. - * - * Note: This method mutates object. - * - * @param object The destination object. - * @param sources The source objects. - * @return The destination object. - */ - defaults( - object: TObject, - source: TSource - ): TSource & TObject; - - /** - * @see _.defaults - */ - defaults( - object: TObject, - source1: TSource1, - source2: TSource2 - ): TSource2 & TSource1 & TObject; - - /** - * @see _.defaults - */ - defaults( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): TSource3 & TSource2 & TSource1 & TObject; - - /** - * @see _.defaults - */ - defaults( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): TSource4 & TSource3 & TSource2 & TSource1 & TObject; - - /** - * @see _.defaults - */ - defaults(object: TObject): TObject; - - /** - * @see _.defaults - */ - defaults( - object: any, - ...sources: any[] - ): any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.defaults - */ - defaults( - source: TSource - ): LoDashImplicitWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: TSource1, - source2: TSource2 - ): LoDashImplicitWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashImplicitWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashImplicitWrapper; - - /** - * @see _.defaults - */ - defaults(): LoDashImplicitWrapper; - - /** - * @see _.defaults - */ - defaults(...sources: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.defaults - */ - defaults( - source: TSource - ): LoDashExplicitWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: TSource1, - source2: TSource2 - ): LoDashExplicitWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashExplicitWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashExplicitWrapper; - - /** - * @see _.defaults - */ - defaults(): LoDashExplicitWrapper; - - /** - * @see _.defaults - */ - defaults(...sources: any[]): LoDashExplicitWrapper; - } - - //_.defaultsDeep - interface LoDashStatic { - /** - * This method is like _.defaults except that it recursively assigns default properties. - * @param object The destination object. - * @param sources The source objects. - * @return Returns object. - **/ - defaultsDeep( - object: any, - ...sources: any[]): any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.defaultsDeep - **/ - defaultsDeep(...sources: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.defaultsDeep - **/ - defaultsDeep(...sources: any[]): LoDashExplicitWrapper; - } - - //_.entries - interface LoDashStatic { - /** - * @see _.toPairs - */ - entries(object?: Dictionary): Array<[string, T]>; - - /** - * @see _.toPairs - */ - entries(object?: object): Array<[string, any]>; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toPairs - */ - entries(this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - - /** - * @see _.toPairs - */ - entries(): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toPairs - */ - entries(this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - - /** - * @see _.toPairs - */ - entries(): LoDashExplicitWrapper>; - } - - //_.entriesIn - interface LoDashStatic { - /** - * @see _.toPairsIn - */ - entriesIn(object?: Dictionary): Array<[string, T]>; - - /** - * @see _.toPairsIn - */ - entriesIn(object?: object): Array<[string, any]>; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toPairsIn - */ - entriesIn(this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - - /** - * @see _.toPairsIn - */ - entriesIn(): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toPairsIn - */ - entriesIn(this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - - /** - * @see _.toPairsIn - */ - entriesIn(): LoDashExplicitWrapper>; - } - - // _.extend - interface LoDashStatic { - /** - * @see _.assignIn - */ - extend( - object: TObject, - source: TSource - ): TObject & TSource; - - /** - * @see _.assignIn - */ - extend( - object: TObject, - source1: TSource1, - source2: TSource2 - ): TObject & TSource1 & TSource2; - - /** - * @see _.assignIn - */ - extend( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see _.assignIn - */ - extend( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.assignIn - */ - extend(object: TObject): TObject; - - /** - * @see _.assignIn - */ - extend( - object: any, - ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.assignIn - */ - extend( - source: TSource - ): LoDashImplicitWrapper; - - /** - * @see _.assignIn - */ - extend( - source1: TSource1, - source2: TSource2 - ): LoDashImplicitWrapper; - - /** - * @see _.assignIn - */ - extend( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashImplicitWrapper; - - /** - * @see _.assignIn - */ - extend( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashImplicitWrapper; - - /** - * @see _.assignIn - */ - extend(): LoDashImplicitWrapper; - - /** - * @see _.assignIn - */ - extend(...otherArgs: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.assignIn - */ - extend( - source: TSource - ): LoDashExplicitWrapper; - - /** - * @see _.assignIn - */ - extend( - source1: TSource1, - source2: TSource2 - ): LoDashExplicitWrapper; - - /** - * @see _.assignIn - */ - extend( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashExplicitWrapper; - - /** - * @see _.assignIn - */ - extend( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashExplicitWrapper; - - /** - * @see _.assignIn - */ - extend(): LoDashExplicitWrapper; - - /** - * @see _.assignIn - */ - extend(...otherArgs: any[]): LoDashExplicitWrapper; - } - - interface LoDashStatic { - /** - * @see _.assignInWith - */ - extendWith( - object: TObject, - source: TSource, - customizer: AssignCustomizer - ): TObject & TSource; - - /** - * @see _.assignInWith - */ - extendWith( - object: TObject, - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2; - - /** - * @see _.assignInWith - */ - extendWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see _.assignInWith - */ - extendWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.assignInWith - */ - extendWith(object: TObject): TObject; - - /** - * @see _.assignInWith - */ - extendWith( - object: any, - ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.assignInWith - */ - extendWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see _.assignInWith - */ - extendWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see _.assignInWith - */ - extendWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see _.assignInWith - */ - extendWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see _.assignInWith - */ - extendWith(): LoDashImplicitWrapper; - - /** - * @see _.assignInWith - */ - extendWith(...otherArgs: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.assignInWith - */ - extendWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.assignInWith - */ - extendWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.assignInWith - */ - extendWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.assignInWith - */ - extendWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.assignInWith - */ - extendWith(): LoDashExplicitWrapper; - - /** - * @see _.assignInWith - */ - extendWith(...otherArgs: any[]): LoDashExplicitWrapper; - } - - //_.findKey - interface LoDashStatic { - /** - * This method is like _.find except that it returns the key of the first element predicate returns truthy for - * instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - findKey( - object: T | null | undefined, - predicate?: ObjectIteratee - ): string | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.findKey - */ - findKey( - this: LoDashImplicitWrapper, - predicate?: ObjectIteratee - ): string | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.findKey - */ - findKey( - this: LoDashExplicitWrapper, - predicate?: ObjectIteratee - ): LoDashExplicitWrapper; - } - - //_.findLastKey - interface LoDashStatic { - /** - * This method is like _.findKey except that it iterates over elements of a collection in the opposite order. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - findLastKey( - object: T | null | undefined, - predicate?: ObjectIteratee - ): string | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.findLastKey - */ - findLastKey( - this: LoDashImplicitWrapper, - predicate?: ObjectIteratee - ): string | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.findLastKey - */ - findLastKey( - this: LoDashExplicitWrapper, - predicate?: ObjectIteratee - ): LoDashExplicitWrapper; - } - - //_.forIn - interface LoDashStatic { - /** - * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The - * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may - * exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - forIn( - object: T, - iteratee?: ObjectIterator - ): T; - - /** - * @see _.forIn - */ - forIn( - object: T | null | undefined, - iteratee?: ObjectIterator - ): T | null | undefined; - } - - interface LoDashWrapper { - /** - * @see _.forIn - */ - forIn( - this: LoDashWrapper, - iteratee?: ObjectIterator - ): this; - } - - //_.forInRight - interface LoDashStatic { - /** - * This method is like _.forIn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - forInRight( - object: T, - iteratee?: ObjectIterator - ): T; - - /** - * @see _.forInRight - */ - forInRight( - object: T | null | undefined, - iteratee?: ObjectIterator - ): T | null | undefined; - } - - interface LoDashWrapper { - /** - * @see _.forInRight - */ - forInRight( - this: LoDashWrapper, - iteratee?: ObjectIterator - ): this; - } - - //_.forOwn - interface LoDashStatic { - /** - * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is - * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - forOwn( - object: T, - iteratee?: ObjectIterator - ): T; - - /** - * @see _.forOwn - */ - forOwn( - object: T | null | undefined, - iteratee?: ObjectIterator - ): T | null | undefined; - } - - interface LoDashWrapper { - /** - * @see _.forOwn - */ - forOwn( - this: LoDashWrapper, - iteratee?: ObjectIterator - ): this; - } - - //_.forOwnRight - interface LoDashStatic { - /** - * This method is like _.forOwn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - forOwnRight( - object: T, - iteratee?: ObjectIterator - ): T; - - /** - * @see _.forOwnRight - */ - forOwnRight( - object: T | null | undefined, - iteratee?: ObjectIterator - ): T | null | undefined; - } - - interface LoDashWrapper { - /** - * @see _.forOwnRight - */ - forOwnRight( - this: LoDashWrapper, - iteratee?: ObjectIterator - ): this; - } - - //_.functions - interface LoDashStatic { - /** - * Creates an array of function property names from own enumerable properties - * of `object`. - * - * @category Object - * @param object The object to inspect. - * @returns Returns the new array of property names. - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functions(new Foo); - * // => ['a', 'b'] - */ - functions(object: any): string[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.functions - */ - functions(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.functions - */ - functions(): LoDashExplicitWrapper; - } - - //_.functionsIn - interface LoDashStatic { - /** - * Creates an array of function property names from own and inherited - * enumerable properties of `object`. - * - * @category Object - * @param object The object to inspect. - * @returns Returns the new array of property names. - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functionsIn(new Foo); - * // => ['a', 'b', 'c'] - */ - functionsIn(object: any): string[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.functionsIn - */ - functionsIn(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.functionsIn - */ - functionsIn(): LoDashExplicitWrapper; - } - - //_.get - interface LoDashStatic { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - get( - object: TObject, - path: TKey | [TKey] - ): TObject[TKey]; - - /** - * @see _.get - */ - get( - object: TObject | null | undefined, - path: TKey | [TKey] - ): TObject[TKey] | undefined; - - /** - * @see _.get - */ - get( - object: TObject | null | undefined, - path: TKey | [TKey], - defaultValue: TDefault - ): TObject[TKey] | TDefault; - - /** - * @see _.get - */ - get( - object: NumericDictionary, - path: number - ): T; - - /** - * @see _.get - */ - get( - object: NumericDictionary | null | undefined, - path: number - ): T | undefined; - - /** - * @see _.get - */ - get( - object: NumericDictionary | null | undefined, - path: number, - defaultValue: TDefault - ): T | TDefault; - - /** - * @see _.get - */ - get( - object: null | undefined, - path: PropertyPath, - defaultValue: TDefault - ): TDefault; - - /** - * @see _.get - */ - get( - object: null | undefined, - path: PropertyPath - ): undefined; - - /** - * @see _.get - */ - get( - object: any, - path: PropertyPath, - defaultValue?: any - ): any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.get - */ - get( - path: TKey | [TKey] - ): TValue[TKey]; - - /** - * @see _.get - */ - get( - this: LoDashImplicitWrapper, - path: TKey | [TKey], - ): TObject[TKey] | undefined; - - /** - * @see _.get - */ - get( - this: LoDashImplicitWrapper, - path: TKey | [TKey], - defaultValue: TDefault - ): TObject[TKey] | TDefault; - - /** - * @see _.get - */ - get( - this: LoDashImplicitWrapper>, - path: number - ): T; - - /** - * @see _.get - */ - get( - this: LoDashImplicitWrapper | null | undefined>, - path: number - ): T | undefined; - - /** - * @see _.get - */ - get( - this: LoDashImplicitWrapper | null | undefined>, - path: number, - defaultValue: TDefault - ): T | TDefault; - - /** - * @see _.get - */ - get( - this: LoDashImplicitWrapper, - path: PropertyPath, - defaultValue: TDefault - ): TDefault; - - /** - * @see _.get - */ - get( - this: LoDashImplicitWrapper, - path: PropertyPath - ): undefined; - - /** - * @see _.get - */ - get( - path: PropertyPath, - defaultValue?: any - ): any; - } - - interface LoDashExplicitWrapper { - /** - * @see _.get - */ - get( - path: TKey | [TKey] - ): LoDashExplicitWrapper; - - /** - * @see _.get - */ - get( - this: LoDashExplicitWrapper, - path: TKey | [TKey], - ): LoDashExplicitWrapper; - - /** - * @see _.get - */ - get( - this: LoDashExplicitWrapper, - path: TKey | [TKey], - defaultValue: TDefault - ): LoDashExplicitWrapper; - - /** - * @see _.get - */ - get( - this: LoDashExplicitWrapper>, - path: number - ): LoDashExplicitWrapper; - - /** - * @see _.get - */ - get( - this: LoDashExplicitWrapper | null | undefined>, - path: number - ): LoDashExplicitWrapper; - - /** - * @see _.get - */ - get( - this: LoDashExplicitWrapper | null | undefined>, - path: number, - defaultValue: TDefault - ): LoDashExplicitWrapper; - - /** - * @see _.get - */ - get( - this: LoDashExplicitWrapper, - path: PropertyPath, - defaultValue: TDefault - ): LoDashExplicitWrapper; - - /** - * @see _.get - */ - get( - this: LoDashExplicitWrapper, - path: PropertyPath - ): LoDashExplicitWrapper; - - /** - * @see _.get - */ - get( - path: PropertyPath, - defaultValue?: any - ): LoDashExplicitWrapper; - } - - //_.has - interface LoDashStatic { - /** - * Checks if `path` is a direct property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b.c'); - * // => true - * - * _.has(object, ['a', 'b', 'c']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - has( - object: T, - path: PropertyPath - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.has - */ - has(path: PropertyPath): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.has - */ - has(path: PropertyPath): LoDashExplicitWrapper; - } - - //_.hasIn - interface LoDashStatic { - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b.c'); - * // => true - * - * _.hasIn(object, ['a', 'b', 'c']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - hasIn( - object: T, - path: PropertyPath - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.hasIn - */ - hasIn(path: PropertyPath): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.hasIn - */ - hasIn(path: PropertyPath): LoDashExplicitWrapper; - } - - //_.invert - interface LoDashStatic { - /** - * Creates an object composed of the inverted keys and values of object. If object contains duplicate values, - * subsequent values overwrite property assignments of previous values unless multiValue is true. - * - * @param object The object to invert. - * @param multiValue Allow multiple values per key. - * @return Returns the new inverted object. - */ - invert( - object: object - ): Dictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.invert - */ - invert(): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.invert - */ - invert(): LoDashExplicitWrapper>; - } - - //_.invertBy - interface LoDashStatic { - /** - * This method is like _.invert except that the inverted object is generated from the results of running each - * element of object through iteratee. The corresponding inverted value of each inverted key is an array of - * keys responsible for generating the inverted value. The iteratee is invoked with one argument: (value). - * - * @param object The object to invert. - * @param interatee The iteratee invoked per element. - * @return Returns the new inverted object. - */ - invertBy( - object: List | Dictionary | NumericDictionary | null | undefined, - interatee?: ValueIteratee - ): Dictionary; - - /** - * @see _.invertBy - */ - invertBy( - object: T | null | undefined, - interatee?: ValueIteratee - ): Dictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.invertBy - */ - invertBy( - this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>, - interatee?: ValueIteratee - ): LoDashImplicitWrapper>; - - /** - * @see _.invertBy - */ - invertBy( - this: LoDashImplicitWrapper, - interatee?: ValueIteratee - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.invertBy - */ - invertBy( - this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>, - interatee?: ValueIteratee - ): LoDashExplicitWrapper>; - - /** - * @see _.invertBy - */ - invertBy( - this: LoDashExplicitWrapper, - interatee?: ValueIteratee - ): LoDashExplicitWrapper>; - } - - //_.keys - interface LoDashStatic { - /** - * Creates an array of the own enumerable property names of object. - * - * Note: Non-object values are coerced to objects. See the ES spec for more details. - * - * @param object The object to query. - * @return Returns the array of property names. - */ - keys(object?: any): string[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.keys - */ - keys(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.keys - */ - keys(): LoDashExplicitWrapper; - } - - //_.keysIn - interface LoDashStatic { - /** - * Creates an array of the own and inherited enumerable property names of object. - * - * Note: Non-object values are coerced to objects. - * - * @param object The object to query. - * @return An array of property names. - */ - keysIn(object?: any): string[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.keysIn - */ - keysIn(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.keysIn - */ - keysIn(): LoDashExplicitWrapper; - } - - //_.mapKeys - interface LoDashStatic { - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - mapKeys( - object: List | null | undefined, - iteratee?: ListIteratee - ): Dictionary; - - /** - * @see _.mapKeys - */ - mapKeys( - object: Dictionary | null | undefined, - iteratee?: DictionaryIteratee - ): Dictionary; - - /** - * @see _.mapKeys - */ - mapKeys( - object: object | null | undefined, - iteratee?: ObjectIteratee - ): Dictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.mapKeys - */ - mapKeys( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): LoDashImplicitWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: DictionaryIteratee - ): LoDashImplicitWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - this: LoDashImplicitWrapper, - iteratee?: ObjectIteratee - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.mapKeys - */ - mapKeys( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): LoDashExplicitWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: DictionaryIteratee - ): LoDashExplicitWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - this: LoDashExplicitWrapper, - iteratee?: ObjectIteratee - ): LoDashExplicitWrapper>; - } - - //_.mapValues - interface LoDashStatic { - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - mapValues(obj: T | null | undefined, callback: ObjectIterator): { [P in keyof T]: TResult }; - - /** - * @see _.mapValues - */ - mapValues(obj: T | null | undefined, iteratee: object): { [P in keyof T]: boolean }; - - /** - * @see _.mapValues - */ - mapValues(obj: Dictionary | null | undefined, iteratee: TKey): Dictionary; - - /** - * @see _.mapValues - */ - mapValues(obj: T | null | undefined, iteratee: string): { [P in keyof T]: any }; - - /** - * @see _.mapValues - */ - mapValues(obj: string | null | undefined, callback: StringIterator): NumericDictionary; - - /** - * @see _.mapValues - */ - mapValues(obj: Dictionary | null | undefined): Dictionary; - - /** - * @see _.mapValues - */ - mapValues(obj: T): T; - - /** - * @see _.mapValues - */ - mapValues(obj: T | null | undefined): T | {}; - - /** - * @see _.mapValues - */ - mapValues(obj: string | null | undefined): NumericDictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.mapValues - */ - mapValues( - this: LoDashImplicitWrapper, - callback: ObjectIterator - ): LoDashImplicitWrapper<{ [P in keyof T]: TResult }>; - - /** - * @see _.mapValues - */ - mapValues( - this: LoDashImplicitWrapper, - iteratee: object - ): LoDashImplicitWrapper<{ [P in keyof T]: boolean }>; - - /** - * @see _.mapValues - */ - mapValues( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: TKey - ): LoDashImplicitWrapper>; - - /** - * @see _.mapValues - */ - mapValues( - this: LoDashImplicitWrapper, - iteratee: string - ): LoDashImplicitWrapper<{ [P in keyof T]: any }>; - - /** - * @see _.mapValues - */ - mapValues( - this: LoDashImplicitWrapper, - callback: StringIterator - ): LoDashImplicitWrapper>; - - /** - * @see _.mapValues - */ - mapValues(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper>; - - /** - * @see _.mapValues - */ - mapValues(this: LoDashImplicitWrapper): LoDashImplicitWrapper; - - /** - * @see _.mapValues - */ - mapValues(this: LoDashImplicitWrapper): LoDashImplicitWrapper; - - /** - * @see _.mapValues - */ - mapValues(this: LoDashImplicitWrapper): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.mapValues - */ - mapValues( - this: LoDashExplicitWrapper, - callback: ObjectIterator - ): LoDashExplicitWrapper<{ [P in keyof T]: TResult }>; - - /** - * @see _.mapValues - */ - mapValues( - this: LoDashExplicitWrapper, - iteratee: object - ): LoDashExplicitWrapper<{ [P in keyof T]: boolean }>; - - /** - * @see _.mapValues - */ - mapValues( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: TKey - ): LoDashExplicitWrapper>; - - /** - * @see _.mapValues - */ - mapValues( - this: LoDashExplicitWrapper, - iteratee: string - ): LoDashExplicitWrapper<{ [P in keyof T]: any }>; - - /** - * @see _.mapValues - */ - mapValues( - this: LoDashExplicitWrapper, - callback: StringIterator - ): LoDashExplicitWrapper>; - - /** - * @see _.mapValues - */ - mapValues(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper>; - - /** - * @see _.mapValues - */ - mapValues(this: LoDashExplicitWrapper): LoDashExplicitWrapper; - - /** - * @see _.mapValues - */ - mapValues(this: LoDashExplicitWrapper): LoDashExplicitWrapper; - - /** - * @see _.mapValues - */ - mapValues(this: LoDashExplicitWrapper): LoDashExplicitWrapper>; - } - - //_.merge - interface LoDashStatic { - /** - * Recursively merges own and inherited enumerable properties of source - * objects into the destination object, skipping source properties that resolve - * to `undefined`. Array and plain object properties are merged recursively. - * Other objects and value types are overridden by assignment. Source objects - * are applied from left to right. Subsequent sources overwrite property - * assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - */ - merge( - object: TObject, - source: TSource - ): TObject & TSource; - - /** - * @see _.merge - */ - merge( - object: TObject, - source1: TSource1, - source2: TSource2 - ): TObject & TSource1 & TSource2; - - /** - * @see _.merge - */ - merge( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see _.merge - */ - merge( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.merge - */ - merge( - object: any, - ...otherArgs: any[] - ): any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.merge - */ - merge( - source: TSource - ): LoDashImplicitWrapper; - - /** - * @see _.merge - */ - merge( - source1: TSource1, - source2: TSource2 - ): LoDashImplicitWrapper; - - /** - * @see _.merge - */ - merge( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashImplicitWrapper; - - /** - * @see _.merge - */ - merge( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashImplicitWrapper; - - /** - * @see _.merge - */ - merge( - ...otherArgs: any[] - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.merge - */ - merge( - source: TSource - ): LoDashExplicitWrapper; - - /** - * @see _.merge - */ - merge( - source1: TSource1, - source2: TSource2 - ): LoDashExplicitWrapper; - - /** - * @see _.merge - */ - merge( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashExplicitWrapper; - - /** - * @see _.merge - */ - merge( - ): LoDashExplicitWrapper; - - /** - * @see _.merge - */ - merge( - ...otherArgs: any[] - ): LoDashExplicitWrapper; - } - - //_.mergeWith - type MergeWithCustomizer = { bivariantHack(value: any, srcValue: any, key: string, object: any, source: any): any; }["bivariantHack"] - - interface LoDashStatic { - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - mergeWith( - object: TObject, - source: TSource, - customizer: MergeWithCustomizer - ): TObject & TSource; - - /** - * @see _.mergeWith - */ - mergeWith( - object: TObject, - source1: TSource1, - source2: TSource2, - customizer: MergeWithCustomizer - ): TObject & TSource1 & TSource2; - - /** - * @see _.mergeWith - */ - mergeWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: MergeWithCustomizer - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see _.mergeWith - */ - mergeWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: MergeWithCustomizer - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.mergeWith - */ - mergeWith( - object: any, - ...otherArgs: any[] - ): any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.mergeWith - */ - mergeWith( - source: TSource, - customizer: MergeWithCustomizer - ): LoDashImplicitWrapper; - - /** - * @see _.mergeWith - */ - mergeWith( - source1: TSource1, - source2: TSource2, - customizer: MergeWithCustomizer - ): LoDashImplicitWrapper; - - /** - * @see _.mergeWith - */ - mergeWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: MergeWithCustomizer - ): LoDashImplicitWrapper; - - /** - * @see _.mergeWith - */ - mergeWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: MergeWithCustomizer - ): LoDashImplicitWrapper; - - /** - * @see _.mergeWith - */ - mergeWith( - ...otherArgs: any[] - ): LoDashImplicitWrapper; - } - - //_.omit - interface LoDashStatic { - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - omit( - object: Dictionary, - ...paths: PropertyPath[] - ): Dictionary; - - /** - * @see _.omit - */ - omit( - object: T | null | undefined, - ...paths: PropertyPath[] - ): PartialObject; - } - - interface LoDashImplicitWrapper { - /** - * @see _.omit - */ - omit( - this: LoDashImplicitWrapper>, - ...paths: PropertyPath[] - ): LoDashImplicitWrapper>; - - /** - * @see _.omit - */ - omit( - this: LoDashImplicitWrapper, - ...paths: PropertyPath[] - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.omit - */ - omit( - this: LoDashExplicitWrapper>, - ...paths: PropertyPath[] - ): LoDashExplicitWrapper>; - - /** - * @see _.omit - */ - omit( - this: LoDashExplicitWrapper, - ...paths: PropertyPath[] - ): LoDashExplicitWrapper>; - } - - //_.omitBy - interface LoDashStatic { - /** - * The opposite of `_.pickBy`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that `predicate` - * doesn't return truthy for. - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } - */ - omitBy( - object: T | null | undefined, - predicate: ValueKeyIteratee - ): PartialObject; - } - - interface LoDashImplicitWrapper { - /** - * @see _.omitBy - */ - omitBy( - this: LoDashImplicitWrapper, - predicate: ValueKeyIteratee - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.omitBy - */ - omitBy( - this: LoDashExplicitWrapper, - predicate: ValueKeyIteratee - ): LoDashExplicitWrapper>; - } - - //_.pick - interface LoDashStatic { - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - pick( - object: T, - ...props: Array> - ): Pick; - - /** - * @see _.pick - */ - pick( - object: T | null | undefined, - ...props: PropertyPath[] - ): PartialDeep; - } - - interface LoDashImplicitWrapper { - /** - * @see _.pick - */ - pick( - this: LoDashImplicitWrapper, - ...props: Array> - ): LoDashImplicitWrapper>; - - /** - * @see _.pick - */ - pick( - this: LoDashImplicitWrapper, - ...props: PropertyPath[] - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.pick - */ - pick( - this: LoDashExplicitWrapper, - ...props: Array> - ): LoDashExplicitWrapper>; - - /** - * @see _.pick - */ - pick( - this: LoDashExplicitWrapper, - ...props: PropertyPath[] - ): LoDashExplicitWrapper>; - } - - //_.pickBy - interface LoDashStatic { - /** - * Creates an object composed of the `object` properties `predicate` returns - * truthy for. The predicate is invoked with two arguments: (value, key). - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pickBy(object, _.isNumber); - * // => { 'a': 1, 'c': 3 } - */ - pickBy( - object: T | null | undefined, - predicate?: ValueKeyIteratee - ): PartialObject; - } - - interface LoDashImplicitWrapper { - /** - * @see _.pickBy - */ - pickBy( - this: LoDashImplicitWrapper, - predicate?: ValueKeyIteratee - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.pickBy - */ - pickBy( - this: LoDashExplicitWrapper, - predicate?: ValueKeyIteratee - ): LoDashExplicitWrapper>; - } - - //_.result - interface LoDashStatic { - /** - * This method is like _.get except that if the resolved value is a function it’s invoked with the this binding - * of its parent object and its result is returned. - * - * @param object The object to query. - * @param path The path of the property to resolve. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - result( - object: any, - path: PropertyPath, - defaultValue?: TResult|((...args: any[]) => TResult) - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.result - */ - result( - path: PropertyPath, - defaultValue?: TResult|((...args: any[]) => TResult) - ): TResult; - } - - interface LoDashExplicitWrapper { - /** - * @see _.result - */ - result( - path: PropertyPath, - defaultValue?: TResult|((...args: any[]) => TResult) - ): LoDashExplicitWrapper; - } - - //_.set - interface LoDashStatic { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - set( - object: T, - path: PropertyPath, - value: any - ): T; - - /** - * @see _.set - */ - set( - object: object, - path: PropertyPath, - value: any - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.set - */ - set( - path: PropertyPath, - value: any - ): this; - - /** - * @see _.set - */ - set( - path: PropertyPath, - value: any - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.set - */ - set( - path: PropertyPath, - value: any - ): this; - - /** - * @see _.set - */ - set( - path: PropertyPath, - value: any - ): LoDashExplicitWrapper; - } - - //_.setWith - type SetWithCustomizer = (nsValue: any, key: string, nsObject: T) => any; - - interface LoDashStatic { - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - setWith( - object: T, - path: PropertyPath, - value: any, - customizer?: SetWithCustomizer - ): T; - - setWith( - object: T, - path: PropertyPath, - value: any, - customizer?: SetWithCustomizer - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.setWith - */ - setWith( - path: PropertyPath, - value: any, - customizer?: SetWithCustomizer - ): this; - - /** - * @see _.setWith - */ - setWith( - path: PropertyPath, - value: any, - customizer?: SetWithCustomizer - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.setWith - */ - setWith( - path: PropertyPath, - value: any, - customizer?: SetWithCustomizer - ): this; - - /** - * @see _.setWith - */ - setWith( - path: PropertyPath, - value: any, - customizer?: SetWithCustomizer - ): LoDashExplicitWrapper; - } - - //_.toPairs - interface LoDashStatic { - /** - * Creates an array of own enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - toPairs(object?: Dictionary): Array<[string, T]>; - - /** - * @see _.toPairs - */ - toPairs(object?: object): Array<[string, any]>; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toPairs - */ - toPairs(this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - - /** - * @see _.toPairs - */ - toPairs(): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toPairs - */ - toPairs(this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - - /** - * @see _.toPairs - */ - toPairs(): LoDashExplicitWrapper>; - } - - //_.toPairsIn - interface LoDashStatic { - /** - * Creates an array of own and inherited enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - toPairsIn(object?: Dictionary): Array<[string, T]>; - - /** - * @see _.toPairsIn - */ - toPairsIn(object?: object): Array<[string, any]>; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toPairsIn - */ - toPairsIn(this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - - /** - * @see _.toPairsIn - */ - toPairsIn(): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toPairsIn - */ - toPairsIn(this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - - /** - * @see _.toPairsIn - */ - toPairsIn(): LoDashExplicitWrapper>; - } - - //_.transform - interface LoDashStatic { - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - transform( - object: T[], - iteratee: MemoVoidArrayIterator, - accumulator?: TResult[] - ): TResult[]; - - /** - * @see _.transform - */ - transform( - object: T[], - iteratee: MemoVoidArrayIterator>, - accumulator: Dictionary - ): Dictionary; - - /** - * @see _.transform - */ - transform( - object: Dictionary, - iteratee: MemoVoidDictionaryIterator>, - accumulator?: Dictionary - ): Dictionary; - - /** - * @see _.transform - */ - transform( - object: Dictionary, - iteratee: MemoVoidDictionaryIterator, - accumulator: TResult[] - ): TResult[]; - - /** - * @see _.transform - */ - transform( - object: any[], - ): any[]; - - /** - * @see _.transform - */ - transform( - object: object, - ): Dictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.transform - */ - transform( - this: LoDashImplicitWrapper, - iteratee: MemoVoidArrayIterator, - accumulator?: TResult[] - ): LoDashImplicitWrapper; - - /** - * @see _.transform - */ - transform( - this: LoDashImplicitWrapper, - iteratee: MemoVoidArrayIterator>, - accumulator: Dictionary - ): LoDashImplicitWrapper>; - - /** - * @see _.transform - */ - transform( - this: LoDashImplicitWrapper>, - iteratee: MemoVoidDictionaryIterator>, - accumulator?: Dictionary - ): LoDashImplicitWrapper>; - - /** - * @see _.transform - */ - transform( - this: LoDashImplicitWrapper>, - iteratee: MemoVoidDictionaryIterator, - accumulator: TResult[] - ): LoDashImplicitWrapper; - - /** - * @see _.transform - */ - transform( - this: LoDashImplicitWrapper, - ): LoDashImplicitWrapper; - - /** - * @see _.transform - */ - transform(): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.transform - */ - transform( - this: LoDashExplicitWrapper, - iteratee: MemoVoidArrayIterator, - accumulator?: TResult[] - ): LoDashExplicitWrapper; - - /** - * @see _.transform - */ - transform( - this: LoDashExplicitWrapper, - iteratee: MemoVoidArrayIterator>, - accumulator?: Dictionary - ): LoDashExplicitWrapper>; - - /** - * @see _.transform - */ - transform( - this: LoDashExplicitWrapper>, - iteratee: MemoVoidDictionaryIterator>, - accumulator?: Dictionary - ): LoDashExplicitWrapper>; - - /** - * @see _.transform - */ - transform( - this: LoDashExplicitWrapper>, - iteratee: MemoVoidDictionaryIterator, - accumulator?: TResult[] - ): LoDashExplicitWrapper; - - /** - * @see _.transform - */ - transform( - this: LoDashExplicitWrapper, - ): LoDashExplicitWrapper; - - /** - * @see _.transform - */ - transform(): LoDashExplicitWrapper>; - } - - //_.unset - interface LoDashStatic { - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - unset( - object: any, - path: PropertyPath - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.unset - */ - unset(path: PropertyPath): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.unset - */ - unset(path: PropertyPath): LoDashExplicitWrapper; - } - - //_.update - interface LoDashStatic { - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - update( - object: object, - path: PropertyPath, - updater: (value: any) => any - ): any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.update - */ - update( - path: PropertyPath, - updater: (value: any) => any - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.update - */ - update( - path: PropertyPath, - updater: (value: any) => any - ): LoDashExplicitWrapper; - } - - //_.updateWith - interface LoDashStatic { - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - updateWith( - object: T, - path: PropertyPath, - updater: (oldValue: any) => any, - customizer?: SetWithCustomizer - ): T; - - /** - * @see _.updateWith - */ - updateWith( - object: T, - path: PropertyPath, - updater: (oldValue: any) => any, - customizer?: SetWithCustomizer - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.updateWith - */ - updateWith( - path: PropertyPath, - updater: (oldValue: any) => any, - customizer?: SetWithCustomizer - ): this; - - /** - * @see _.updateWith - */ - updateWith( - path: PropertyPath, - updater: (oldValue: any) => any, - customizer?: SetWithCustomizer - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.updateWith - */ - updateWith( - path: PropertyPath, - updater: (oldValue: any) => any, - customizer?: SetWithCustomizer - ): this; - - /** - * @see _.updateWith - */ - updateWith( - path: PropertyPath, - updater: (oldValue: any) => any, - customizer?: SetWithCustomizer - ): LoDashExplicitWrapper; - } - - //_.values - interface LoDashStatic { - /** - * Creates an array of the own enumerable property values of object. - * - * @param object The object to query. - * @return Returns an array of property values. - */ - values(object: Dictionary|NumericDictionary|List | null | undefined): T[]; - - /** - * @see _.values - */ - values(object: T | null | undefined): Array; - - /** - * @see _.values - */ - values(object: any): any[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.values - */ - values(this: LoDashImplicitWrapper | NumericDictionary | List | null | undefined>): LoDashImplicitWrapper; - - /** - * @see _.values - */ - values(this: LoDashImplicitWrapper): LoDashImplicitWrapper>; - - /** - * @see _.values - */ - values(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.values - */ - values(this: LoDashExplicitWrapper | NumericDictionary | List | null | undefined>): LoDashExplicitWrapper; - - /** - * @see _.values - */ - values(this: LoDashExplicitWrapper): LoDashExplicitWrapper>; - - /** - * @see _.values - */ - values(): LoDashExplicitWrapper; - } - - //_.valuesIn - interface LoDashStatic { - /** - * Creates an array of the own and inherited enumerable property values of object. - * - * @param object The object to query. - * @return Returns the array of property values. - */ - valuesIn(object: Dictionary|NumericDictionary|List | null | undefined): T[]; - - /** - * @see _.valuesIn - */ - valuesIn(object: T | null | undefined): Array; - } - - interface LoDashImplicitWrapper { - /** - * @see _.valuesIn - */ - valuesIn(this: LoDashImplicitWrapper | NumericDictionary | List | null | undefined>): LoDashImplicitWrapper; - - /** - * @see _.valuesIn - */ - valuesIn(this: LoDashImplicitWrapper): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.valuesIn - */ - valuesIn(this: LoDashExplicitWrapper | NumericDictionary | List | null | undefined>): LoDashExplicitWrapper; - - /** - * @see _.valuesIn - */ - valuesIn(this: LoDashExplicitWrapper): LoDashExplicitWrapper>; - } - - /********** - * String * - **********/ - - //_.camelCase - interface LoDashStatic { - /** - * Converts string to camel case. - * - * @param string The string to convert. - * @return Returns the camel cased string. - */ - camelCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.camelCase - */ - camelCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.camelCase - */ - camelCase(): LoDashExplicitWrapper; - } - - //_.capitalize - interface LoDashStatic { - /** - * Converts the first character of string to upper case and the remaining to lower case. - * - * @param string The string to capitalize. - * @return Returns the capitalized string. - */ - capitalize(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.capitalize - */ - capitalize(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.capitalize - */ - capitalize(): LoDashExplicitWrapper; - } - - //_.deburr - interface LoDashStatic { - /** - * Deburrs string by converting latin-1 supplementary letters to basic latin letters and removing combining - * diacritical marks. - * - * @param string The string to deburr. - * @return Returns the deburred string. - */ - deburr(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.deburr - */ - deburr(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.deburr - */ - deburr(): LoDashExplicitWrapper; - } - - //_.endsWith - interface LoDashStatic { - /** - * Checks if string ends with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string ends with target, else false. - */ - endsWith( - string?: string, - target?: string, - position?: number - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.endsWith - */ - endsWith( - target?: string, - position?: number - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.endsWith - */ - endsWith( - target?: string, - position?: number - ): LoDashExplicitWrapper; - } - - // _.escape - interface LoDashStatic { - /** - * Converts the characters "&", "<", ">", '"', "'", and "`" in string to their corresponding HTML entities. - * - * Note: No other characters are escaped. To escape additional characters use a third-party library like he. - * - * hough the ">" character is escaped for symmetry, characters like ">" and "/" don’t need escaping in HTML - * and have no special meaning unless they're part of a tag or unquoted attribute value. See Mathias Bynens’s - * article (under "semi-related fun fact") for more details. - * - * Backticks are escaped because in IE < 9, they can break out of attribute values or HTML comments. See #59, - * #102, #108, and #133 of the HTML5 Security Cheatsheet for more details. - * - * When working with HTML you should always quote attribute values to reduce XSS vectors. - * - * @param string The string to escape. - * @return Returns the escaped string. - */ - escape(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.escape - */ - escape(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.escape - */ - escape(): LoDashExplicitWrapper; - } - - // _.escapeRegExp - interface LoDashStatic { - /** - * Escapes the RegExp special characters "^", "$", "\", ".", "*", "+", "?", "(", ")", "[", "]", - * "{", "}", and "|" in string. - * - * @param string The string to escape. - * @return Returns the escaped string. - */ - escapeRegExp(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.escapeRegExp - */ - escapeRegExp(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.escapeRegExp - */ - escapeRegExp(): LoDashExplicitWrapper; - } - - //_.kebabCase - interface LoDashStatic { - /** - * Converts string to kebab case. - * - * @param string The string to convert. - * @return Returns the kebab cased string. - */ - kebabCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.kebabCase - */ - kebabCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.kebabCase - */ - kebabCase(): LoDashExplicitWrapper; - } - - //_.lowerCase - interface LoDashStatic { - /** - * Converts `string`, as space separated words, to lower case. - * - * @param string The string to convert. - * @return Returns the lower cased string. - */ - lowerCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.lowerCase - */ - lowerCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.lowerCase - */ - lowerCase(): LoDashExplicitWrapper; - } - - //_.lowerFirst - interface LoDashStatic { - /** - * Converts the first character of `string` to lower case. - * - * @param string The string to convert. - * @return Returns the converted string. - */ - lowerFirst(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.lowerFirst - */ - lowerFirst(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.lowerFirst - */ - lowerFirst(): LoDashExplicitWrapper; - } - - //_.pad - interface LoDashStatic { - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - pad( - string?: string, - length?: number, - chars?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.pad - */ - pad( - length?: number, - chars?: string - ): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.pad - */ - pad( - length?: number, - chars?: string - ): LoDashExplicitWrapper; - } - - //_.padEnd - interface LoDashStatic { - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - padEnd( - string?: string, - length?: number, - chars?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.padEnd - */ - padEnd( - length?: number, - chars?: string - ): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.padEnd - */ - padEnd( - length?: number, - chars?: string - ): LoDashExplicitWrapper; - } - - //_.padStart - interface LoDashStatic { - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - padStart( - string?: string, - length?: number, - chars?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.padStart - */ - padStart( - length?: number, - chars?: string - ): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.padStart - */ - padStart( - length?: number, - chars?: string - ): LoDashExplicitWrapper; - } - - //_.parseInt - interface LoDashStatic { - /** - * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used - * unless value is a hexadecimal, in which case a radix of 16 is used. - * - * Note: This method aligns with the ES5 implementation of parseInt. - * - * @param string The string to convert. - * @param radix The radix to interpret value by. - * @return Returns the converted integer. - */ - parseInt( - string: string, - radix?: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.parseInt - */ - parseInt(radix?: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.parseInt - */ - parseInt(radix?: number): LoDashExplicitWrapper; - } - - //_.repeat - interface LoDashStatic { - /** - * Repeats the given string n times. - * - * @param string The string to repeat. - * @param n The number of times to repeat the string. - * @return Returns the repeated string. - */ - repeat( - string?: string, - n?: number - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.repeat - */ - repeat(n?: number): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.repeat - */ - repeat(n?: number): LoDashExplicitWrapper; - } - - type ReplaceFunction = (match: string, ...args: any[]) => string; - - //_.replace - interface LoDashStatic { - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @return Returns the modified string. - */ - replace( - string: string, - pattern: RegExp | string, - replacement: ReplaceFunction | string - ): string; - - /** - * @see _.replace - */ - replace( - pattern: RegExp | string, - replacement: ReplaceFunction | string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.replace - */ - replace( - pattern: RegExp|string, - replacement: ReplaceFunction | string - ): string; - - /** - * @see _.replace - */ - replace( - replacement: ReplaceFunction | string - ): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.replace - */ - replace( - pattern: RegExp | string, - replacement: ReplaceFunction | string - ): LoDashExplicitWrapper; - - /** - * @see _.replace - */ - replace( - replacement: ReplaceFunction | string - ): LoDashExplicitWrapper; - } - - //_.snakeCase - interface LoDashStatic { - /** - * Converts string to snake case. - * - * @param string The string to convert. - * @return Returns the snake cased string. - */ - snakeCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.snakeCase - */ - snakeCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.snakeCase - */ - snakeCase(): LoDashExplicitWrapper; - } - - //_.split - interface LoDashStatic { - /** - * Splits string by separator. - * - * Note: This method is based on String#split. - * - * @param string The string to trim. - * @param separator The separator pattern to split by. - * @param limit The length to truncate results to. - * @return Returns the new array of string segments. - */ - split( - string: string, - separator?: RegExp|string, - limit?: number - ): string[]; - - /** - * Splits string by separator. - * - * Note: This method is based on String#split. - * - * @param string The string to trim. - * @param index Not used in this overload. - * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. - * @return Returns the new array of string segments. - */ - split( - string: string, - index: string | number, - guard: object - ): string[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.split - */ - split( - separator?: RegExp|string, - limit?: number - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.split - */ - split( - separator?: RegExp|string, - limit?: number - ): LoDashExplicitWrapper; - } - - //_.startCase - interface LoDashStatic { - /** - * Converts string to start case. - * - * @param string The string to convert. - * @return Returns the start cased string. - */ - startCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.startCase - */ - startCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.startCase - */ - startCase(): LoDashExplicitWrapper; - } - - //_.startsWith - interface LoDashStatic { - /** - * Checks if string starts with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string starts with target, else false. - */ - startsWith( - string?: string, - target?: string, - position?: number - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.startsWith - */ - startsWith( - target?: string, - position?: number - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.startsWith - */ - startsWith( - target?: string, - position?: number - ): LoDashExplicitWrapper; - } - - //_.template - interface TemplateOptions extends TemplateSettings { - /** - * The sourceURL of the template's compiled source. - */ - sourceURL?: string; - } - - interface TemplateExecutor { - (data?: object): string; - source: string; - } - - interface LoDashStatic { - /** - * Creates a compiled template function that can interpolate data properties in "interpolate" delimiters, - * HTML-escape interpolated data properties in "escape" delimiters, and execute JavaScript in "evaluate" - * delimiters. Data properties may be accessed as free variables in the template. If a setting object is - * provided it takes precedence over _.templateSettings values. - * - * Note: In the development build _.template utilizes - * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier - * debugging. - * - * For more information on precompiling templates see - * [lodash's custom builds documentation](https://lodash.com/custom-builds). - * - * For more information on Chrome extension sandboxes see - * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). - * - * @param string The template string. - * @param options The options object. - * @param options.escape The HTML "escape" delimiter. - * @param options.evaluate The "evaluate" delimiter. - * @param options.imports An object to import into the template as free variables. - * @param options.interpolate The "interpolate" delimiter. - * @param options.sourceURL The sourceURL of the template's compiled source. - * @param options.variable The data object variable name. - * @return Returns the compiled template function. - */ - template( - string?: string, - options?: TemplateOptions - ): TemplateExecutor; - } - - interface LoDashImplicitWrapper { - /** - * @see _.template - */ - template(options?: TemplateOptions): TemplateExecutor; - } - - interface LoDashExplicitWrapper { - /** - * @see _.template - */ - template(options?: TemplateOptions): LoDashExplicitWrapper; - } - - //_.toLower - interface LoDashStatic { - /** - * Converts `string`, as a whole, to lower case. - * - * @param string The string to convert. - * @return Returns the lower cased string. - */ - toLower(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toLower - */ - toLower(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toLower - */ - toLower(): LoDashExplicitWrapper; - } - - //_.toUpper - interface LoDashStatic { - /** - * Converts `string`, as a whole, to upper case. - * - * @param string The string to convert. - * @return Returns the upper cased string. - */ - toUpper(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toUpper - */ - toUpper(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toUpper - */ - toUpper(): LoDashExplicitWrapper; - } - - //_.trim - interface LoDashStatic { - /** - * Removes leading and trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - trim( - string?: string, - chars?: string - ): string; - - /** - * Removes leading and trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param index Not used in this overload. - * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. - * @return Returns the trimmed string. - */ - trim( - string: string, - index: string | number, - guard: object - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.trim - */ - trim(chars?: string): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.trim - */ - trim(chars?: string): LoDashExplicitWrapper; - } - - //_.trimEnd - interface LoDashStatic { - /** - * Removes trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - trimEnd( - string?: string, - chars?: string - ): string; - - /** - * Removes trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param index Not used in this overload. - * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. - * @return Returns the trimmed string. - */ - trimEnd( - string: string, - index: string | number, - guard: object - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.trimEnd - */ - trimEnd(chars?: string): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.trimEnd - */ - trimEnd(chars?: string): LoDashExplicitWrapper; - } - - //_.trimStart - interface LoDashStatic { - /** - * Removes leading whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - trimStart( - string?: string, - chars?: string - ): string; - - /** - * Removes leading whitespace or specified characters from string. - * - * @param string The string to trim. - * @param index Not used in this overload. - * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. - * @return Returns the trimmed string. - */ - trimStart( - string: string, - index: string | number, - guard: object - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.trimStart - */ - trimStart(chars?: string): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.trimStart - */ - trimStart(chars?: string): LoDashExplicitWrapper; - } - - //_.truncate - interface TruncateOptions { - /** The maximum string length. */ - length?: number; - /** The string to indicate text is omitted. */ - omission?: string; - /** The separator pattern to truncate to. */ - separator?: string|RegExp; - } - - interface LoDashStatic { - /** - * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated - * string are replaced with the omission string which defaults to "…". - * - * @param string The string to truncate. - * @param options The options object or maximum string length. - * @return Returns the truncated string. - */ - truncate( - string?: string, - options?: TruncateOptions - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.truncate - */ - truncate(options?: TruncateOptions): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.truncate - */ - truncate(options?: TruncateOptions): LoDashExplicitWrapper; - } - - //_.unescape - interface LoDashStatic { - /** - * The inverse of _.escape; this method converts the HTML entities &, <, >, ", ', and ` - * in string to their corresponding characters. - * - * Note: No other HTML entities are unescaped. To unescape additional HTML entities use a third-party library - * like he. - * - * @param string The string to unescape. - * @return Returns the unescaped string. - */ - unescape(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.unescape - */ - unescape(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.unescape - */ - unescape(): LoDashExplicitWrapper; - } - - //_.upperCase - interface LoDashStatic { - /** - * Converts `string`, as space separated words, to upper case. - * - * @param string The string to convert. - * @return Returns the upper cased string. - */ - upperCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.upperCase - */ - upperCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.upperCase - */ - upperCase(): LoDashExplicitWrapper; - } - - //_.upperFirst - interface LoDashStatic { - /** - * Converts the first character of `string` to upper case. - * - * @param string The string to convert. - * @return Returns the converted string. - */ - upperFirst(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.upperFirst - */ - upperFirst(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.upperFirst - */ - upperFirst(): LoDashExplicitWrapper; - } - - //_.words - interface LoDashStatic { - /** - * Splits `string` into an array of its words. - * - * @param string The string to inspect. - * @param pattern The pattern to match words. - * @return Returns the words of `string`. - */ - words( - string?: string, - pattern?: string|RegExp - ): string[]; - - /** - * Splits `string` into an array of its words. - * - * @param string The string to inspect. - * @param index Not used in this overload. - * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. - * @return Returns the words of `string`. - */ - words( - string: string, - index: string | number, - guard: object - ): string[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.words - */ - words(pattern?: string|RegExp): string[]; - } - - interface LoDashExplicitWrapper { - /** - * @see _.words - */ - words(pattern?: string|RegExp): LoDashExplicitWrapper; - } - - /*********** - * Utility * - ***********/ - - //_.attempt - interface LoDashStatic { - /** - * Attempts to invoke func, returning either the result or the caught error object. Any additional arguments - * are provided to func when it’s invoked. - * - * @param func The function to attempt. - * @return Returns the func result or error object. - */ - attempt(func: (...args: any[]) => TResult, ...args: any[]): TResult|Error; - } - - interface LoDashImplicitWrapper { - /** - * @see _.attempt - */ - attempt(...args: any[]): TResult|Error; - } - - interface LoDashExplicitWrapper { - /** - * @see _.attempt - */ - attempt(...args: any[]): LoDashExplicitWrapper; - } - - //_.constant - interface LoDashStatic { - /** - * Creates a function that returns value. - * - * @param value The value to return from the new function. - * @return Returns the new function. - */ - constant(value: T): () => T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.constant - */ - constant(): LoDashImplicitWrapper<() => TValue>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.constant - */ - constant(): LoDashExplicitWrapper<() => TValue>; - } - - //_.defaultTo - interface LoDashStatic { - /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @param value The value to check. - * @param defaultValue The default value. - * @returns Returns the resolved value. - */ - defaultTo(value: T | null | undefined, defaultValue: T): T; - - /** - * @see _.defaultTo - */ - defaultTo( - value: T | null | undefined, - defaultValue: TDefault - ): T | TDefault; - } - - interface LoDashImplicitWrapper { - /** - * @see _.defaultTo - */ - defaultTo(this: LoDashImplicitWrapper, defaultValue: T): T; - - /** - * @see _.defaultTo - */ - defaultTo( - this: LoDashImplicitWrapper, - defaultValue: TDefault - ): T | TDefault; - } - - interface LoDashExplicitWrapper { - /** - * @see _.defaultTo - */ - defaultTo(this: LoDashExplicitWrapper, defaultValue: T): LoDashExplicitWrapper; - - /** - * @see _.defaultTo - */ - defaultTo( - this: LoDashExplicitWrapper, - defaultValue: TDefault - ): LoDashExplicitWrapper; - } - - //_.identity - interface LoDashStatic { - /** - * This method returns the first argument provided to it. - * - * @param value Any value. - * @return Returns value. - */ - identity(value: T): T; - - /** - * @see _.identity - */ - identity(): undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.identity - */ - identity(): TValue; - } - - interface LoDashExplicitWrapper { - /** - * @see _.identity - */ - identity(): this; - } - - //_.iteratee - interface LoDashStatic { - /** - * Creates a function that invokes `func` with the arguments of the created - * function. If `func` is a property name the created callback returns the - * property value for a given element. If `func` is an object the created - * callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`. - * - * @category Util - * @param [func=_.identity] The value to convert to a callback. - * @returns Returns the callback. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // create custom iteratee shorthands - * _.iteratee = _.wrap(_.iteratee, function(callback, func) { - * var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func); - * return !p ? callback(func) : function(object) { - * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]); - * }; - * }); - * - * _.filter(users, 'age > 36'); - * // => [{ 'user': 'fred', 'age': 40 }] - */ - iteratee any>( - func: TFunction | string | object - ): TFunction; - - /** - * @see _.iteratee - */ - iteratee(): typeof _.identity; // tslint:disable-line:no-unnecessary-qualifier - } - - interface LoDashImplicitWrapper { - /** - * @see _.iteratee - */ - iteratee any>( - this: LoDashImplicitWrapper - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.iteratee - */ - iteratee any>( - this: LoDashExplicitWrapper - ): LoDashExplicitWrapper; - } - - //_.matches - interface LoDashStatic { - /** - * Creates a function that performs a deep comparison between a given object and source, returning true if the - * given object has equivalent property values, else false. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. For comparing a single own - * or inherited property value see _.matchesProperty. - * - * @param source The object of property values to match. - * @return Returns the new function. - */ - matches(source: T): (value: any) => boolean; - - /** - * @see _.matches - */ - matches(source: T): (value: V) => boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.matches - */ - matches(): LoDashImplicitWrapper<(value: V) => boolean>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.matches - */ - matches(): LoDashExplicitWrapper<(value: V) => boolean>; - } - - //_.matchesProperty - interface LoDashStatic { - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - matchesProperty( - path: PropertyPath, - srcValue: T - ): (value: any) => boolean; - - /** - * @see _.matchesProperty - */ - matchesProperty( - path: PropertyPath, - srcValue: T - ): (value: V) => boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.matchesProperty - */ - matchesProperty( - srcValue: SrcValue - ): LoDashImplicitWrapper<(value: any) => boolean>; - - /** - * @see _.matchesProperty - */ - matchesProperty( - srcValue: SrcValue - ): LoDashImplicitWrapper<(value: Value) => boolean>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.matchesProperty - */ - matchesProperty( - srcValue: SrcValue - ): LoDashExplicitWrapper<(value: any) => boolean>; - - /** - * @see _.matchesProperty - */ - matchesProperty( - srcValue: SrcValue - ): LoDashExplicitWrapper<(value: Value) => boolean>; - } - - //_.method - interface LoDashStatic { - /** - * Creates a function that invokes the method at path on a given object. Any additional arguments are provided - * to the invoked method. - * - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - * @return Returns the new function. - */ - method( - path: PropertyPath, - ...args: any[] - ): (object: any) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.method - */ - method(...args: any[]): LoDashImplicitWrapper<(object: any) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.method - */ - method(...args: any[]): LoDashExplicitWrapper<(object: any) => any>; - } - - //_.methodOf - interface LoDashStatic { - /** - * The opposite of _.method; this method creates a function that invokes the method at a given path on object. - * Any additional arguments are provided to the invoked method. - * - * @param object The object to query. - * @param args The arguments to invoke the method with. - * @return Returns the new function. - */ - methodOf( - object: object, - ...args: any[] - ): (path: PropertyPath) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.methodOf - */ - methodOf( - ...args: any[] - ): LoDashImplicitWrapper<(path: PropertyPath) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.methodOf - */ - methodOf( - ...args: any[] - ): LoDashExplicitWrapper<(path: PropertyPath) => any>; - } - - //_.mixin - interface MixinOptions { - chain?: boolean; - } - - interface LoDashStatic { - /** - * Adds all own enumerable function properties of a source object to the destination object. If object is a - * function then methods are added to its prototype as well. - * - * Note: Use _.runInContext to create a pristine lodash function to avoid conflicts caused by modifying - * the original. - * - * @param object The destination object. - * @param source The object of functions to add. - * @param options The options object. - * @param options.chain Specify whether the functions added are chainable. - * @return Returns object. - */ - mixin( - object: TObject, - source: Dictionary<(...args: any[]) => any>, - options?: MixinOptions - ): TObject; - - /** - * @see _.mixin - */ - mixin( - source: Dictionary<(...args: any[]) => any>, - options?: MixinOptions - ): LoDashStatic; - } - - interface LoDashImplicitWrapper { - /** - * @see _.mixin - */ - mixin( - source: Dictionary<(...args: any[]) => any>, - options?: MixinOptions - ): this; - - /** - * @see _.mixin - */ - mixin( - options?: MixinOptions - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.mixin - */ - mixin( - source: Dictionary<(...args: any[]) => any>, - options?: MixinOptions - ): this; - - /** - * @see _.mixin - */ - mixin( - options?: MixinOptions - ): LoDashExplicitWrapper; - } - - //_.noConflict - interface LoDashStatic { - /** - * Reverts the _ variable to its previous value and returns a reference to the lodash function. - * - * @return Returns the lodash function. - */ - noConflict(): typeof _; - } - - interface LoDashImplicitWrapper { - /** - * @see _.noConflict - */ - noConflict(): typeof _; - } - - interface LoDashExplicitWrapper { - /** - * @see _.noConflict - */ - noConflict(): LoDashExplicitWrapper; - } - - //_.noop - interface LoDashStatic { - /** - * A no-operation function that returns undefined regardless of the arguments it receives. - * - * @return undefined - */ - noop(...args: any[]): void; - } - - interface LoDashImplicitWrapper { - /** - * @see _.noop - */ - noop(...args: any[]): void; - } - - interface LoDashExplicitWrapper { - /** - * @see _.noop - */ - noop(...args: any[]): LoDashExplicitWrapper; - } - - //_.nthArg - interface LoDashStatic { - /** - * Creates a function that returns its nth argument. - * - * @param n The index of the argument to return. - * @return Returns the new function. - */ - nthArg(n?: number): (...args: any[]) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.nthArg - */ - nthArg(): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.nthArg - */ - nthArg(): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.over - interface LoDashStatic { - /** - * Creates a function that invokes iteratees with the arguments provided to the created function and returns - * their results. - * - * @param iteratees The iteratees to invoke. - * @return Returns the new function. - */ - over(...iteratees: Array TResult>>): (...args: any[]) => TResult[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.over - */ - over( - this: LoDashImplicitWrapper TResult>>, - ...iteratees: Array TResult>> - ): LoDashImplicitWrapper<(...args: any[]) => TResult[]>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.over - */ - over( - this: LoDashExplicitWrapper TResult>>, - ...iteratees: Array TResult>> - ): LoDashExplicitWrapper<(...args: any[]) => TResult[]>; - } - - //_.overEvery - interface LoDashStatic { - /** - * Creates a function that checks if all of the predicates return truthy when invoked with the arguments - * provided to the created function. - * - * @param predicates The predicates to check. - * @return Returns the new function. - */ - overEvery(...predicates: Array boolean>>): (...args: T[]) => boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.overEvery - */ - overEvery(...predicates: Array boolean>>): LoDashImplicitWrapper<(...args: T[]) => boolean>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.overEvery - */ - overEvery(...predicates: Array boolean>>): LoDashExplicitWrapper<(...args: T[]) => boolean>; - } - - //_.overSome - interface LoDashStatic { - /** - * Creates a function that checks if any of the predicates return truthy when invoked with the arguments - * provided to the created function. - * - * @param predicates The predicates to check. - * @return Returns the new function. - */ - overSome(...predicates: Array boolean>>): (...args: T[]) => boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.overSome - */ - overSome(...predicates: Array boolean>>): LoDashImplicitWrapper<(...args: T[]) => boolean>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.overSome - */ - overSome(...predicates: Array boolean>>): LoDashExplicitWrapper<(...args: T[]) => boolean>; - } - - //_.property - interface LoDashStatic { - /** - * Creates a function that returns the property value at path on a given object. - * - * @param path The path of the property to get. - * @return Returns the new function. - */ - property(path: PropertyPath): (obj: TObj) => TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.property - */ - property(): LoDashImplicitWrapper<(obj: TObj) => TResult>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.property - */ - property(): LoDashExplicitWrapper<(obj: TObj) => TResult>; - } - - //_.propertyOf - interface LoDashStatic { - /** - * The opposite of _.property; this method creates a function that returns the property value at a given path - * on object. - * - * @param object The object to query. - * @return Returns the new function. - */ - propertyOf(object: T): (path: PropertyPath) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.propertyOf - */ - propertyOf(): LoDashImplicitWrapper<(path: PropertyPath) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.propertyOf - */ - propertyOf(): LoDashExplicitWrapper<(path: PropertyPath) => any>; - } - - //_.range - interface LoDashStatic { - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - range( - start: number, - end?: number, - step?: number - ): number[]; - - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param index Not used in this overload. - * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. - * @return Returns a new range array. - */ - range( - end: number, - index: string | number, - guard: object - ): number[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.range - */ - range( - end?: number, - step?: number - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.range - */ - range( - end?: number, - step?: number - ): LoDashExplicitWrapper; - } - - //_.rangeRight - interface LoDashStatic { - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - rangeRight( - start: number, - end?: number, - step?: number - ): number[]; - - /** - * This method is like _.range except that it populates values in - * descending order. - * - * @param start The start of the range. - * @param index Not used in this overload. - * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. - * @return Returns a new range array. - */ - rangeRight( - end: number, - index: string | number, - guard: object - ): number[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.rangeRight - */ - rangeRight( - end?: number, - step?: number - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.rangeRight - */ - rangeRight( - end?: number, - step?: number - ): LoDashExplicitWrapper; - } - - //_.runInContext - interface LoDashStatic { - /** - * Create a new pristine lodash function using the given context object. - * - * @param context The context object. - * @return Returns a new lodash function. - */ - runInContext(context?: object): typeof _; - } - - interface LoDashImplicitWrapper { - /** - * @see _.runInContext - */ - runInContext(): typeof _; - } - - // _.stubArray - interface LoDashStatic { - /** - * This method returns a new empty array. - * - * @returns Returns the new empty array. - */ - stubArray(): any[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.stubArray - */ - stubArray(): any[]; - } - - interface LoDashExplicitWrapper { - /** - * @see _.stubArray - */ - stubArray(): LoDashExplicitWrapper; - } - - // _.stubFalse - interface LoDashStatic { - /** - * This method returns `false`. - * - * @returns Returns `false`. - */ - stubFalse(): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.stubFalse - */ - stubFalse(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.stubFalse - */ - stubFalse(): LoDashExplicitWrapper; - } - - interface LoDashStatic { - /** - * This method returns a new empty object. - * - * @returns Returns the new empty object. - */ - stubObject(): any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.stubObject - */ - stubObject(): any; - } - - interface LoDashExplicitWrapper { - /** - * @see _.stubObject - */ - stubObject(): LoDashExplicitWrapper; - } - - interface LoDashStatic { - /** - * This method returns an empty string. - * - * @returns Returns the empty string. - */ - stubString(): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.stubString - */ - stubString(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.stubString - */ - stubString(): LoDashExplicitWrapper; - } - - interface LoDashStatic { - /** - * This method returns `true`. - * - * @returns Returns `true`. - */ - stubTrue(): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.stubTrue - */ - stubTrue(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.stubTrue - */ - stubTrue(): LoDashExplicitWrapper; - } - - //_.times - interface LoDashStatic { - /** - * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee - * is invoked with one argument; (index). - * - * @param n The number of times to invoke iteratee. - * @param iteratee The function invoked per iteration. - * @return Returns the array of results. - */ - times( - n: number, - iteratee: (num: number) => TResult - ): TResult[]; - - /** - * @see _.times - */ - times(n: number): number[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.times - */ - times( - iteratee: (num: number) => TResult - ): TResult[]; - - /** - * @see _.times - */ - times(): number[]; - } - - interface LoDashExplicitWrapper { - /** - * @see _.times - */ - times( - iteratee: (num: number) => TResult - ): LoDashExplicitWrapper; - - /** - * @see _.times - */ - times(): LoDashExplicitWrapper; - } - - //_.toPath - interface LoDashStatic { - /** - * Converts `value` to a property path array. - * - * @category Util - * @param value The value to convert. - * @returns Returns the new property path array. - * @example - * - * _.toPath('a.b.c'); - * // => ['a', 'b', 'c'] - * - * _.toPath('a[0].b.c'); - * // => ['a', '0', 'b', 'c'] - * - * var path = ['a', 'b', 'c'], - * newPath = _.toPath(path); - * - * console.log(newPath); - * // => ['a', 'b', 'c'] - * - * console.log(path === newPath); - * // => false - */ - toPath(value: any): string[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toPath - */ - toPath(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toPath - */ - toPath(): LoDashExplicitWrapper; - } - - //_.uniqueId - interface LoDashStatic { - /** - * Generates a unique ID. If prefix is provided the ID is appended to it. - * - * @param prefix The value to prefix the ID with. - * @return Returns the unique ID. - */ - uniqueId(prefix?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.uniqueId - */ - uniqueId(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.uniqueId - */ - uniqueId(): LoDashExplicitWrapper; - } - - type NotVoid = {} | null | undefined; - type ArrayIterator = (value: T, index: number, collection: T[]) => TResult; - type ListIterator = (value: T, index: number, collection: List) => TResult; - type ListIteratee = ListIterator | string | [string, any] | PartialDeep; - type ListIterateeCustom = ListIterator | string | object | [string, any] | PartialDeep; - type ListIteratorTypeGuard = (value: T, index: number, collection: List) => value is S; - - // Note: key should be string, not keyof T, because the actual object may contain extra properties that were not specified in the type. - type ObjectIterator = (value: TObject[keyof TObject], key: string, collection: TObject) => TResult; - type ObjectIteratee = ObjectIterator | string | [string, any] | PartialDeep; - type ObjectIterateeCustom = ObjectIterator | string | object | [string, any] | PartialDeep; - type ObjectIteratorTypeGuard = (value: TObject[keyof TObject], key: string, collection: TObject) => value is S; - - type DictionaryIterator = ObjectIterator, TResult>; - type DictionaryIteratee = ObjectIteratee>; - type DictionaryIteratorTypeGuard = ObjectIteratorTypeGuard, S>; - - type NumericDictionaryIterator = (value: T, key: number, collection: NumericDictionary) => TResult; - type NumericDictionaryIteratee = NumericDictionaryIterator | string | [string, any] | PartialDeep; - type NumericDictionaryIterateeCustom = NumericDictionaryIterator | string | [string, any] | PartialDeep; - - type StringIterator = (char: string, index: number, string: string) => TResult; - - type MemoVoidIterator = (prev: TResult, curr: T, indexOrKey: any, list: T[]) => void; - - /** @deprecated Use MemoListIterator or MemoObjectIterator instead. */ - type MemoIterator = (prev: TResult, curr: T, indexOrKey: any, list: T[]) => TResult; - type MemoListIterator = (prev: TResult, curr: T, index: number, list: TList) => TResult; - type MemoObjectIterator = (prev: TResult, curr: T, key: string, list: TList) => TResult; - - type MemoVoidArrayIterator = (acc: TResult, curr: T, index: number, arr: T[]) => void; - type MemoVoidDictionaryIterator = (acc: TResult, curr: T, key: string, dict: Dictionary) => void; - - type ValueIteratee = ((value: T) => NotVoid) | string | [string, any] | PartialDeep; - type ValueKeyIteratee = ((value: T, key: string) => NotVoid) | string | [string, any] | PartialDeep; - type Comparator = (a: T, b: T) => boolean; - type Comparator2 = (a: T1, b: T2) => boolean; - - type PropertyName = string | number | symbol; - type PropertyPath = Many; - - /** Common interface between Arrays and jQuery objects */ - type List = ArrayLike; - - interface Dictionary { - [index: string]: T; - } - - interface NumericDictionary { - [index: number]: T; - } - - interface Cancelable { - cancel(): void; - flush(): void; - } - - type PartialDeep = { - [P in keyof T]?: PartialDeep; - }; - - // For backwards compatibility - type LoDashImplicitArrayWrapper = LoDashImplicitWrapper; - type LoDashImplicitNillableArrayWrapper = LoDashImplicitWrapper; - type LoDashImplicitObjectWrapper = LoDashImplicitWrapper; - type LoDashImplicitNillableObjectWrapper = LoDashImplicitWrapper; - type LoDashImplicitNumberArrayWrapper = LoDashImplicitWrapper; - type LoDashImplicitStringWrapper = LoDashImplicitWrapper; - type LoDashExplicitArrayWrapper = LoDashExplicitWrapper; - type LoDashExplicitNillableArrayWrapper = LoDashExplicitWrapper; - type LoDashExplicitObjectWrapper = LoDashExplicitWrapper; - type LoDashExplicitNillableObjectWrapper = LoDashExplicitWrapper; - type LoDashExplicitNumberArrayWrapper = LoDashExplicitWrapper; - type LoDashExplicitStringWrapper = LoDashExplicitWrapper; + // tslint:disable-next-line no-empty-interface (This will be augmented) + interface LoDashStatic {} } // Backward compatibility with --target es5 declare global { + // tslint:disable-next-line:no-empty-interface interface Set { } + // tslint:disable-next-line:no-empty-interface interface Map { } + // tslint:disable-next-line:no-empty-interface interface WeakSet { } + // tslint:disable-next-line:no-empty-interface interface WeakMap { } } diff --git a/types/lodash/lang/castArray.d.ts b/types/lodash/lang/castArray.d.ts new file mode 100644 index 0000000000..5f385c5ed5 --- /dev/null +++ b/types/lodash/lang/castArray.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Casts value as an array if it’s not one. + * + * @param value The value to inspect. + * @return Returns the cast array. + */ + castArray(value?: Many): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.castArray + */ + castArray(this: LoDashImplicitWrapper>): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.castArray + */ + castArray(this: LoDashExplicitWrapper>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/clone.d.ts b/types/lodash/lang/clone.d.ts new file mode 100644 index 0000000000..794e2383fb --- /dev/null +++ b/types/lodash/lang/clone.d.ts @@ -0,0 +1,31 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a shallow clone of value. + * + * Note: This method is loosely based on the structured clone algorithm and supports cloning arrays, + * array buffers, booleans, date objects, maps, numbers, Object objects, regexes, sets, strings, symbols, + * and typed arrays. The own enumerable properties of arguments objects are cloned as plain objects. An empty + * object is returned for uncloneable values such as error objects, functions, DOM nodes, and WeakMaps. + * + * @param value The value to clone. + * @return Returns the cloned value. + */ + clone(value: T): T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.clone + */ + clone(): TValue; + } + + interface LoDashExplicitWrapper { + /** + * @see _.clone + */ + clone(): this; + } +} \ No newline at end of file diff --git a/types/lodash/lang/cloneDeep.d.ts b/types/lodash/lang/cloneDeep.d.ts new file mode 100644 index 0000000000..0a49e67ea9 --- /dev/null +++ b/types/lodash/lang/cloneDeep.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.clone except that it recursively clones value. + * + * @param value The value to recursively clone. + * @return Returns the deep cloned value. + */ + cloneDeep(value: T): T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.cloneDeep + */ + cloneDeep(): TValue; + } + + interface LoDashExplicitWrapper { + /** + * @see _.cloneDeep + */ + cloneDeep(): this; + } +} \ No newline at end of file diff --git a/types/lodash/lang/cloneDeepWith.d.ts b/types/lodash/lang/cloneDeepWith.d.ts new file mode 100644 index 0000000000..b46fc766ac --- /dev/null +++ b/types/lodash/lang/cloneDeepWith.d.ts @@ -0,0 +1,51 @@ +import _ = require("../index"); +declare module "../index" { + type CloneDeepWithCustomizer = (value: any, key: number | string | undefined, object: TObject | undefined, stack: any) => any; + + interface LoDashStatic { + /** + * This method is like _.cloneWith except that it recursively clones value. + * + * @param value The value to recursively clone. + * @param customizer The function to customize cloning. + * @return Returns the deep cloned value. + */ + cloneDeepWith( + value: T, + customizer: CloneDeepWithCustomizer + ): any; + + /** + * @see _.cloneDeepWith + */ + cloneDeepWith(value: T): T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.cloneDeepWith + */ + cloneDeepWith( + customizer: CloneDeepWithCustomizer + ): any; + + /** + * @see _.cloneDeepWith + */ + cloneDeepWith(): TValue; + } + + interface LoDashExplicitWrapper { + /** + * @see _.cloneDeepWith + */ + cloneDeepWith( + customizer: CloneDeepWithCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.cloneDeepWith + */ + cloneDeepWith(): this; + } +} \ No newline at end of file diff --git a/types/lodash/lang/cloneWith.d.ts b/types/lodash/lang/cloneWith.d.ts new file mode 100644 index 0000000000..22c00be038 --- /dev/null +++ b/types/lodash/lang/cloneWith.d.ts @@ -0,0 +1,74 @@ +import _ = require("../index"); +declare module "../index" { + type CloneWithCustomizer = (value: TValue, key: number | string | undefined, object: any, stack: any) => TResult; + + interface LoDashStatic { + /** + * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. + * If customizer returns undefined cloning is handled by the method instead. + * + * @param value The value to clone. + * @param customizer The function to customize cloning. + * @return Returns the cloned value. + */ + cloneWith( + value: T, + customizer: CloneWithCustomizer + ): TResult; + + /** + * @see _.cloneWith + */ + cloneWith( + value: T, + customizer: CloneWithCustomizer + ): TResult | T; + + /** + * @see _.cloneWith + */ + cloneWith(value: T): T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.cloneWith + */ + cloneWith( + customizer: CloneWithCustomizer + ): TResult; + + /** + * @see _.cloneWith + */ + cloneWith( + customizer: CloneWithCustomizer + ): TResult | TValue; + + /** + * @see _.cloneWith + */ + cloneWith(): TValue; + } + + interface LoDashExplicitWrapper { + /** + * @see _.cloneWith + */ + cloneWith( + customizer: CloneWithCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.cloneWith + */ + cloneWith( + customizer: CloneWithCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.cloneWith + */ + cloneWith(): this; + } +} \ No newline at end of file diff --git a/types/lodash/lang/conformsTo.d.ts b/types/lodash/lang/conformsTo.d.ts new file mode 100644 index 0000000000..f069e15e73 --- /dev/null +++ b/types/lodash/lang/conformsTo.d.ts @@ -0,0 +1,31 @@ +import _ = require("../index"); +declare module "../index" { + + interface LoDashStatic { + /** + * Checks if object conforms to source by invoking the predicate properties of source with the + * corresponding property values of object. + * + * Note: This method is equivalent to _.conforms when source is partially applied. + */ + conformsTo(object: T, source: ConformsPredicateObject): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.conformsTo + */ + conformsTo(this: LoDashImplicitWrapper, source: ConformsPredicateObject): boolean; + // Note: we can't use TValue here, because it generates a typescript error when strictFunctionTypes is enabled. + } + + interface LoDashExplicitWrapper { + /** + * @see _.conformsTo + */ + conformsTo(this: LoDashImplicitWrapper, source: ConformsPredicateObject): LoDashExplicitWrapper; + // Note: we can't use TValue here, because it generates a typescript error when strictFunctionTypes is enabled. + } + + type CondPair = [(val: T) => boolean, (val: T) => R] +} \ No newline at end of file diff --git a/types/lodash/lang/eq.d.ts b/types/lodash/lang/eq.d.ts new file mode 100644 index 0000000000..808ec0cf39 --- /dev/null +++ b/types/lodash/lang/eq.d.ts @@ -0,0 +1,55 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @category Lang + * @param value The value to compare. + * @param other The other value to compare. + * @returns Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + eq( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.eq + */ + eq( + other: any + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.eq + */ + eq( + other: any + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/gt.d.ts b/types/lodash/lang/gt.d.ts new file mode 100644 index 0000000000..3ae27eaccf --- /dev/null +++ b/types/lodash/lang/gt.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is greater than other. + * + * @param value The value to compare. + * @param other The other value to compare. + * @return Returns true if value is greater than other, else false. + */ + gt( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.gt + */ + gt(other: any): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.gt + */ + gt(other: any): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/gte.d.ts b/types/lodash/lang/gte.d.ts new file mode 100644 index 0000000000..b68cc05c7d --- /dev/null +++ b/types/lodash/lang/gte.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is greater than or equal to other. + * + * @param value The value to compare. + * @param other The other value to compare. + * @return Returns true if value is greater than or equal to other, else false. + */ + gte( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.gte + */ + gte(other: any): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.gte + */ + gte(other: any): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isArguments.d.ts b/types/lodash/lang/isArguments.d.ts new file mode 100644 index 0000000000..20c90752bf --- /dev/null +++ b/types/lodash/lang/isArguments.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is classified as an arguments object. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isArguments(value?: any): value is IArguments; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isArguments + */ + isArguments(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isArguments + */ + isArguments(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isArray.d.ts b/types/lodash/lang/isArray.d.ts new file mode 100644 index 0000000000..3d0676791c --- /dev/null +++ b/types/lodash/lang/isArray.d.ts @@ -0,0 +1,31 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is classified as an Array object. + * @param value The value to check. + * + * @return Returns true if value is correctly classified, else false. + */ + isArray(value?: any): value is any[]; + + /** + * DEPRECATED + */ + isArray(value?: any): value is any[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isArray + */ + isArray(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isArray + */ + isArray(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isArrayBuffer.d.ts b/types/lodash/lang/isArrayBuffer.d.ts new file mode 100644 index 0000000000..b22e954086 --- /dev/null +++ b/types/lodash/lang/isArrayBuffer.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is classified as an ArrayBuffer object. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isArrayBuffer(value?: any): value is ArrayBuffer; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isArrayBuffer + */ + isArrayBuffer(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isArrayBuffer + */ + isArrayBuffer(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isArrayLike.d.ts b/types/lodash/lang/isArrayLike.d.ts new file mode 100644 index 0000000000..59c75a70b7 --- /dev/null +++ b/types/lodash/lang/isArrayLike.d.ts @@ -0,0 +1,52 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @category Lang + * @param value The value to check. + * @returns Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + isArrayLike(value: T & string & number): boolean; // should only match if T = any + + /** + * @see _.isArrayLike + */ + isArrayLike(value: ((...args: any[]) => any) | null | undefined): value is never; + + /** + * @see _.isArrayLike + */ + isArrayLike(value: any): value is { length: number }; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isArrayLike + */ + isArrayLike(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isArrayLike + */ + isArrayLike(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isArrayLikeObject.d.ts b/types/lodash/lang/isArrayLikeObject.d.ts new file mode 100644 index 0000000000..6613d7d410 --- /dev/null +++ b/types/lodash/lang/isArrayLikeObject.d.ts @@ -0,0 +1,53 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @category Lang + * @param value The value to check. + * @returns Returns `true` if `value` is an array-like object, else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + isArrayLikeObject(value: T & string & number): boolean; // should only match if T = any + + /** + * @see _.isArrayLike + */ + // tslint:disable-next-line:ban-types (type guard doesn't seem to work correctly without the Function type) + isArrayLikeObject(value: ((...args: any[]) => any) | Function | string | boolean | number | null | undefined): value is never; + + /** + * @see _.isArrayLike + */ + // tslint:disable-next-line:ban-types (type guard doesn't seem to work correctly without the Function type) + isArrayLikeObject(value: T | ((...args: any[]) => any) | Function | string | boolean | number | null | undefined): value is T & { length: number }; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isArrayLikeObject + */ + isArrayLikeObject(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isArrayLikeObject + */ + isArrayLikeObject(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isBoolean.d.ts b/types/lodash/lang/isBoolean.d.ts new file mode 100644 index 0000000000..060d3eae5e --- /dev/null +++ b/types/lodash/lang/isBoolean.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is classified as a boolean primitive or object. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isBoolean(value?: any): value is boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isBoolean + */ + isBoolean(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isBoolean + */ + isBoolean(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isBuffer.d.ts b/types/lodash/lang/isBuffer.d.ts new file mode 100644 index 0000000000..971cd4cc42 --- /dev/null +++ b/types/lodash/lang/isBuffer.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is a buffer. + * + * @param value The value to check. + * @return Returns true if value is a buffer, else false. + */ + isBuffer(value?: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isBuffer + */ + isBuffer(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isBuffer + */ + isBuffer(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isDate.d.ts b/types/lodash/lang/isDate.d.ts new file mode 100644 index 0000000000..ac6dc058f8 --- /dev/null +++ b/types/lodash/lang/isDate.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is classified as a Date object. + * @param value The value to check. + * + * @return Returns true if value is correctly classified, else false. + */ + isDate(value?: any): value is Date; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isDate + */ + isDate(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isDate + */ + isDate(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isElement.d.ts b/types/lodash/lang/isElement.d.ts new file mode 100644 index 0000000000..9b818bc1cf --- /dev/null +++ b/types/lodash/lang/isElement.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is a DOM element. + * + * @param value The value to check. + * @return Returns true if value is a DOM element, else false. + */ + isElement(value?: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isElement + */ + isElement(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isElement + */ + isElement(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isEmpty.d.ts b/types/lodash/lang/isEmpty.d.ts new file mode 100644 index 0000000000..b84fd2e125 --- /dev/null +++ b/types/lodash/lang/isEmpty.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string, or + * jQuery-like collection with a length greater than 0 or an object with own enumerable properties. + * + * @param value The value to inspect. + * @return Returns true if value is empty, else false. + */ + isEmpty(value?: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isEmpty + */ + isEmpty(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isEmpty + */ + isEmpty(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isEqual.d.ts b/types/lodash/lang/isEqual.d.ts new file mode 100644 index 0000000000..ae7b0eedd8 --- /dev/null +++ b/types/lodash/lang/isEqual.d.ts @@ -0,0 +1,52 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are **not** supported. + * + * @category Lang + * @param value The value to compare. + * @param other The other value to compare. + * @returns Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + isEqual( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isEqual + */ + isEqual( + other: any + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isEqual + */ + isEqual( + other: any + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isEqualWith.d.ts b/types/lodash/lang/isEqualWith.d.ts new file mode 100644 index 0000000000..44ab134546 --- /dev/null +++ b/types/lodash/lang/isEqualWith.d.ts @@ -0,0 +1,61 @@ +import _ = require("../index"); +declare module "../index" { + type IsEqualCustomizer = (value: any, other: any, indexOrKey: PropertyName | undefined, parent: any, otherParent: any, stack: any) => boolean|undefined; + + interface LoDashStatic { + /** + * This method is like `_.isEqual` except that it accepts `customizer` which is + * invoked to compare values. If `customizer` returns `undefined` comparisons are + * handled by the method instead. The `customizer` is invoked with up to seven arguments: + * (objValue, othValue [, index|key, object, other, stack]). + * + * @category Lang + * @param value The value to compare. + * @param other The other value to compare. + * @param [customizer] The function to customize comparisons. + * @returns Returns `true` if the values are equivalent, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ + isEqualWith( + value: any, + other: any, + customizer?: IsEqualCustomizer + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isEqualWith + */ + isEqualWith( + other: any, + customizer?: IsEqualCustomizer + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isEqualWith + */ + isEqualWith( + other: any, + customizer?: IsEqualCustomizer + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isError.d.ts b/types/lodash/lang/isError.d.ts new file mode 100644 index 0000000000..a5bd5d378b --- /dev/null +++ b/types/lodash/lang/isError.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is an Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, or URIError + * object. + * + * @param value The value to check. + * @return Returns true if value is an error object, else false. + */ + isError(value: any): value is Error; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isError + */ + isError(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isError + */ + isError(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isFinite.d.ts b/types/lodash/lang/isFinite.d.ts new file mode 100644 index 0000000000..e5015e8d49 --- /dev/null +++ b/types/lodash/lang/isFinite.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is a finite primitive number. + * + * Note: This method is based on Number.isFinite. + * + * @param value The value to check. + * @return Returns true if value is a finite number, else false. + */ + isFinite(value?: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isFinite + */ + isFinite(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isFinite + */ + isFinite(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isFunction.d.ts b/types/lodash/lang/isFunction.d.ts new file mode 100644 index 0000000000..7f6ae1feea --- /dev/null +++ b/types/lodash/lang/isFunction.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is a callable function. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isFunction(value: any): value is (...args: any[]) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isFunction + */ + isFunction(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isFunction + */ + isFunction(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isInteger.d.ts b/types/lodash/lang/isInteger.d.ts new file mode 100644 index 0000000000..a1919bf21d --- /dev/null +++ b/types/lodash/lang/isInteger.d.ts @@ -0,0 +1,42 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if `value` is an integer. + * + * **Note:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @category Lang + * @param value The value to check. + * @returns Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ + isInteger(value?: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isInteger + */ + isInteger(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isInteger + */ + isInteger(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isLength.d.ts b/types/lodash/lang/isLength.d.ts new file mode 100644 index 0000000000..b8c012460e --- /dev/null +++ b/types/lodash/lang/isLength.d.ts @@ -0,0 +1,42 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @category Lang + * @param value The value to check. + * @returns Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + isLength(value?: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isLength + */ + isLength(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isLength + */ + isLength(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isMap.d.ts b/types/lodash/lang/isMap.d.ts new file mode 100644 index 0000000000..b71a3d750f --- /dev/null +++ b/types/lodash/lang/isMap.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is classified as a Map object. + * + * @param value The value to check. + * @returns Returns true if value is correctly classified, else false. + */ + isMap(value?: any): value is Map; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isMap + */ + isMap(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isMap + */ + isMap(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isMatch.d.ts b/types/lodash/lang/isMatch.d.ts new file mode 100644 index 0000000000..dfb072c59b --- /dev/null +++ b/types/lodash/lang/isMatch.d.ts @@ -0,0 +1,42 @@ +import _ = require("../index"); +declare module "../index" { + type isMatchCustomizer = (value: any, other: any, indexOrKey?: PropertyName) => boolean; + + interface LoDashStatic { + /** + * Performs a deep comparison between `object` and `source` to determine if + * `object` contains equivalent property values. + * + * **Note:** This method supports comparing the same values as `_.isEqual`. + * + * @category Lang + * @param object The object to inspect. + * @param source The object of property values to match. + * @returns Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'user': 'fred', 'age': 40 }; + * + * _.isMatch(object, { 'age': 40 }); + * // => true + * + * _.isMatch(object, { 'age': 36 }); + * // => false + */ + isMatch(object: object, source: object): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isMatch + */ + isMatch(source: object): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isMatch + */ + isMatch(source: object): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isMatchWith.d.ts b/types/lodash/lang/isMatchWith.d.ts new file mode 100644 index 0000000000..fb47f327b4 --- /dev/null +++ b/types/lodash/lang/isMatchWith.d.ts @@ -0,0 +1,51 @@ +import _ = require("../index"); +declare module "../index" { + type isMatchWithCustomizer = (value: any, other: any, indexOrKey: PropertyName) => boolean; + + interface LoDashStatic { + /** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined` comparisons + * are handled by the method instead. The `customizer` is invoked with three + * arguments: (objValue, srcValue, index|key, object, source). + * + * @category Lang + * @param object The object to inspect. + * @param source The object of property values to match. + * @param [customizer] The function to customize comparisons. + * @returns Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ + isMatchWith(object: object, source: object, customizer: isMatchWithCustomizer): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isMatchWith + */ + isMatchWith(source: object, customizer: isMatchWithCustomizer): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isMatchWith + */ + isMatchWith(source: object, customizer: isMatchWithCustomizer): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isNaN.d.ts b/types/lodash/lang/isNaN.d.ts new file mode 100644 index 0000000000..b016c91c74 --- /dev/null +++ b/types/lodash/lang/isNaN.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is NaN. + * + * Note: This method is not the same as isNaN which returns true for undefined and other non-numeric values. + * + * @param value The value to check. + * @return Returns true if value is NaN, else false. + */ + isNaN(value?: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isNaN + */ + isNaN(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isNaN + */ + isNaN(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isNative.d.ts b/types/lodash/lang/isNative.d.ts new file mode 100644 index 0000000000..72f74e7148 --- /dev/null +++ b/types/lodash/lang/isNative.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is a native function. + * @param value The value to check. + * + * @retrun Returns true if value is a native function, else false. + */ + isNative(value: any): value is (...args: any[]) => any; + } + + interface LoDashImplicitWrapper { + /** + * see _.isNative + */ + isNative(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isNative + */ + isNative(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isNil.d.ts b/types/lodash/lang/isNil.d.ts new file mode 100644 index 0000000000..2b0cb04fbc --- /dev/null +++ b/types/lodash/lang/isNil.d.ts @@ -0,0 +1,37 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if `value` is `null` or `undefined`. + * + * @category Lang + * @param value The value to check. + * @returns Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ + isNil(value: any): value is null | undefined; + } + + interface LoDashImplicitWrapper { + /** + * see _.isNil + */ + isNil(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isNil + */ + isNil(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isNull.d.ts b/types/lodash/lang/isNull.d.ts new file mode 100644 index 0000000000..04dfb18cea --- /dev/null +++ b/types/lodash/lang/isNull.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is null. + * + * @param value The value to check. + * @return Returns true if value is null, else false. + */ + isNull(value: any): value is null; + } + + interface LoDashImplicitWrapper { + /** + * see _.isNull + */ + isNull(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isNull + */ + isNull(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isNumber.d.ts b/types/lodash/lang/isNumber.d.ts new file mode 100644 index 0000000000..81479cb4c9 --- /dev/null +++ b/types/lodash/lang/isNumber.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is classified as a Number primitive or object. + * + * Note: To exclude Infinity, -Infinity, and NaN, which are classified as numbers, use the _.isFinite method. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isNumber(value?: any): value is number; + } + + interface LoDashImplicitWrapper { + /** + * see _.isNumber + */ + isNumber(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isNumber + */ + isNumber(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isObject.d.ts b/types/lodash/lang/isObject.d.ts new file mode 100644 index 0000000000..e014fd9620 --- /dev/null +++ b/types/lodash/lang/isObject.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, new Number(0), + * and new String('')) + * + * @param value The value to check. + * @return Returns true if value is an object, else false. + */ + isObject(value?: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * see _.isObject + */ + isObject(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isObject + */ + isObject(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isObjectLike.d.ts b/types/lodash/lang/isObjectLike.d.ts new file mode 100644 index 0000000000..1665ec8a69 --- /dev/null +++ b/types/lodash/lang/isObjectLike.d.ts @@ -0,0 +1,41 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @category Lang + * @param value The value to check. + * @returns Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + isObjectLike(value?: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * see _.isObjectLike + */ + isObjectLike(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isObjectLike + */ + isObjectLike(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isPlainObject.d.ts b/types/lodash/lang/isPlainObject.d.ts new file mode 100644 index 0000000000..bb5070f535 --- /dev/null +++ b/types/lodash/lang/isPlainObject.d.ts @@ -0,0 +1,29 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is a plain object, that is, an object created by the Object constructor or one with a + * [[Prototype]] of null. + * + * Note: This method assumes objects created by the Object constructor have no inherited enumerable properties. + * + * @param value The value to check. + * @return Returns true if value is a plain object, else false. + */ + isPlainObject(value?: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * see _.isPlainObject + */ + isPlainObject(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isPlainObject + */ + isPlainObject(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isRegExp.d.ts b/types/lodash/lang/isRegExp.d.ts new file mode 100644 index 0000000000..4199940091 --- /dev/null +++ b/types/lodash/lang/isRegExp.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is classified as a RegExp object. + * @param value The value to check. + * + * @return Returns true if value is correctly classified, else false. + */ + isRegExp(value?: any): value is RegExp; + } + + interface LoDashImplicitWrapper { + /** + * see _.isRegExp + */ + isRegExp(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isRegExp + */ + isRegExp(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isSafeInteger.d.ts b/types/lodash/lang/isSafeInteger.d.ts new file mode 100644 index 0000000000..0ca1b4809a --- /dev/null +++ b/types/lodash/lang/isSafeInteger.d.ts @@ -0,0 +1,43 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @category Lang + * @param value The value to check. + * @returns Returns `true` if `value` is a safe integer, else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ + isSafeInteger(value: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * see _.isSafeInteger + */ + isSafeInteger(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isSafeInteger + */ + isSafeInteger(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isSet.d.ts b/types/lodash/lang/isSet.d.ts new file mode 100644 index 0000000000..af7f4ad9e9 --- /dev/null +++ b/types/lodash/lang/isSet.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is classified as a Set object. + * + * @param value The value to check. + * @returns Returns true if value is correctly classified, else false. + */ + isSet(value?: any): value is Set; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isSet + */ + isSet(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isSet + */ + isSet(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isString.d.ts b/types/lodash/lang/isString.d.ts new file mode 100644 index 0000000000..d39917345e --- /dev/null +++ b/types/lodash/lang/isString.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is classified as a String primitive or object. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isString(value?: any): value is string; + } + + interface LoDashImplicitWrapper { + /** + * see _.isString + */ + isString(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isString + */ + isString(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isSymbol.d.ts b/types/lodash/lang/isSymbol.d.ts new file mode 100644 index 0000000000..2f0a6aa4f5 --- /dev/null +++ b/types/lodash/lang/isSymbol.d.ts @@ -0,0 +1,34 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @category Lang + * @param value The value to check. + * @returns Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + isSymbol(value: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * see _.isSymbol + */ + isSymbol(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isSymbol + */ + isSymbol(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isTypedArray.d.ts b/types/lodash/lang/isTypedArray.d.ts new file mode 100644 index 0000000000..dffc9e43d0 --- /dev/null +++ b/types/lodash/lang/isTypedArray.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is classified as a typed array. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isTypedArray(value: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * see _.isTypedArray + */ + isTypedArray(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isTypedArray + */ + isTypedArray(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isUndefined.d.ts b/types/lodash/lang/isUndefined.d.ts new file mode 100644 index 0000000000..dad9ed7cc3 --- /dev/null +++ b/types/lodash/lang/isUndefined.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is undefined. + * + * @param value The value to check. + * @return Returns true if value is undefined, else false. + */ + isUndefined(value: any): value is undefined; + } + + interface LoDashImplicitWrapper { + /** + * see _.isUndefined + */ + isUndefined(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isUndefined + */ + isUndefined(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isWeakMap.d.ts b/types/lodash/lang/isWeakMap.d.ts new file mode 100644 index 0000000000..8dae9d20f5 --- /dev/null +++ b/types/lodash/lang/isWeakMap.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is classified as a WeakMap object. + * + * @param value The value to check. + * @returns Returns true if value is correctly classified, else false. + */ + isWeakMap(value?: any): value is WeakMap; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isSet + */ + isWeakMap(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isSet + */ + isWeakMap(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isWeakSet.d.ts b/types/lodash/lang/isWeakSet.d.ts new file mode 100644 index 0000000000..2c08c521aa --- /dev/null +++ b/types/lodash/lang/isWeakSet.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is classified as a WeakSet object. + * + * @param value The value to check. + * @returns Returns true if value is correctly classified, else false. + */ + isWeakSet(value?: any): value is WeakSet; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isWeakSet + */ + isWeakSet(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isWeakSet + */ + isWeakSet(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/lt.d.ts b/types/lodash/lang/lt.d.ts new file mode 100644 index 0000000000..434b1476d0 --- /dev/null +++ b/types/lodash/lang/lt.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is less than other. + * + * @param value The value to compare. + * @param other The other value to compare. + * @return Returns true if value is less than other, else false. + */ + lt( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.lt + */ + lt(other: any): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.lt + */ + lt(other: any): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/lte.d.ts b/types/lodash/lang/lte.d.ts new file mode 100644 index 0000000000..84cc6b22fe --- /dev/null +++ b/types/lodash/lang/lte.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if value is less than or equal to other. + * + * @param value The value to compare. + * @param other The other value to compare. + * @return Returns true if value is less than or equal to other, else false. + */ + lte( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.lte + */ + lte(other: any): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.lte + */ + lte(other: any): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/toArray.d.ts b/types/lodash/lang/toArray.d.ts new file mode 100644 index 0000000000..d0fd0b93f2 --- /dev/null +++ b/types/lodash/lang/toArray.d.ts @@ -0,0 +1,46 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts value to an array. + * + * @param value The value to convert. + * @return Returns the converted array. + */ + toArray(value: List | Dictionary | NumericDictionary | null | undefined): T[]; + + /** + * @see _.toArray + */ + toArray(value: T): Array; + + /** + * @see _.toArray + */ + toArray(): any[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toArray + */ + toArray(this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>): LoDashImplicitWrapper; + + /** + * @see _.toArray + */ + toArray(this: LoDashImplicitWrapper): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toArray + */ + toArray(this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>): LoDashExplicitWrapper; + + /** + * @see _.toArray + */ + toArray(this: LoDashImplicitWrapper): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/lang/toFinite.d.ts b/types/lodash/lang/toFinite.d.ts new file mode 100644 index 0000000000..3007bf3674 --- /dev/null +++ b/types/lodash/lang/toFinite.d.ts @@ -0,0 +1,41 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts `value` to a finite number. + * + * @since 4.12.0 + * @category Lang + * @param value The value to convert. + * @returns Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ + toFinite(value: any): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toFinite + */ + toFinite(): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toFinite + */ + toFinite(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/toInteger.d.ts b/types/lodash/lang/toInteger.d.ts new file mode 100644 index 0000000000..2f4c2f217c --- /dev/null +++ b/types/lodash/lang/toInteger.d.ts @@ -0,0 +1,42 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @category Lang + * @param value The value to convert. + * @returns Returns the converted integer. + * @example + * + * _.toInteger(3); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3'); + * // => 3 + */ + toInteger(value: any): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toInteger + */ + toInteger(): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toInteger + */ + toInteger(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/toLength.d.ts b/types/lodash/lang/toLength.d.ts new file mode 100644 index 0000000000..62e9b059fe --- /dev/null +++ b/types/lodash/lang/toLength.d.ts @@ -0,0 +1,43 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts `value` to an integer suitable for use as the length of an + * array-like object. + * + * **Note:** This method is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @category Lang + * @param value The value to convert. + * @return Returns the converted integer. + * @example + * + * _.toLength(3); + * // => 3 + * + * _.toLength(Number.MIN_VALUE); + * // => 0 + * + * _.toLength(Infinity); + * // => 4294967295 + * + * _.toLength('3'); + * // => 3 + */ + toLength(value: any): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toLength + */ + toLength(): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toLength + */ + toLength(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/toNumber.d.ts b/types/lodash/lang/toNumber.d.ts new file mode 100644 index 0000000000..5099f7ad89 --- /dev/null +++ b/types/lodash/lang/toNumber.d.ts @@ -0,0 +1,40 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts `value` to a number. + * + * @category Lang + * @param value The value to process. + * @returns Returns the number. + * @example + * + * _.toNumber(3); + * // => 3 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3'); + * // => 3 + */ + toNumber(value: any): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toNumber + */ + toNumber(): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toNumber + */ + toNumber(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/toPlainObject.d.ts b/types/lodash/lang/toPlainObject.d.ts new file mode 100644 index 0000000000..60b9c1a7b1 --- /dev/null +++ b/types/lodash/lang/toPlainObject.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts value to a plain object flattening inherited enumerable properties of value to own properties + * of the plain object. + * + * @param value The value to convert. + * @return Returns the converted plain object. + */ + toPlainObject(value?: any): any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toPlainObject + */ + toPlainObject(): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toPlainObject + */ + toPlainObject(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/toSafeInteger.d.ts b/types/lodash/lang/toSafeInteger.d.ts new file mode 100644 index 0000000000..a4e1729dbb --- /dev/null +++ b/types/lodash/lang/toSafeInteger.d.ts @@ -0,0 +1,41 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts `value` to a safe integer. A safe integer can be compared and + * represented correctly. + * + * @category Lang + * @param value The value to convert. + * @returns Returns the converted integer. + * @example + * + * _.toSafeInteger(3); + * // => 3 + * + * _.toSafeInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toSafeInteger(Infinity); + * // => 9007199254740991 + * + * _.toSafeInteger('3'); + * // => 3 + */ + toSafeInteger(value: any): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toSafeInteger + */ + toSafeInteger(): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toSafeInteger + */ + toSafeInteger(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/toString.d.ts b/types/lodash/lang/toString.d.ts new file mode 100644 index 0000000000..559f05f66f --- /dev/null +++ b/types/lodash/lang/toString.d.ts @@ -0,0 +1,24 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @category Lang + * @param value The value to process. + * @returns Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + toString(value: any): string; + } +} \ No newline at end of file diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 69fe88b341..ca33017323 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -1,28 +1,28 @@ declare const $: any; -interface IFoodOrganic { +interface FoodOrganic { name: string; organic: boolean; } -interface IStoogesAge { +interface StoogesAge { name: string; age: number; } -const foodsOrganic: IFoodOrganic[] = [ +const foodsOrganic: FoodOrganic[] = [ { name: 'banana', organic: true }, { name: 'beet', organic: false }, ]; -const stoogesAges: IStoogesAge[] = [ +const stoogesAges: StoogesAge[] = [ { 'name': 'moe', 'age': 40 }, { 'name': 'larry', 'age': 50 } ]; let result: any; -let any: any; +let anything: any; -interface TResult { +interface AbcObject { a: number; b: string; c: boolean; @@ -70,32 +70,32 @@ namespace TestWrapper { } { - let a: TResult[] = []; - _(a); // $ExpectType LoDashImplicitWrapper + let a: AbcObject[] = []; + _(a); // $ExpectType LoDashImplicitWrapper } { - let a: TResult[] | null | undefined = any; - _(a); // $ExpectType LoDashImplicitWrapper + let a: AbcObject[] | null | undefined = anything; + _(a); // $ExpectType LoDashImplicitWrapper } } -//Wrapped array shortcut methods -result = _([1, 2, 3, 4]).pop(); -result = <_.LoDashImplicitArrayWrapper>_([1, 2, 3, 4]).push(5, 6, 7); -result = _([1, 2, 3, 4]).shift(); -result = <_.LoDashImplicitArrayWrapper>_([1, 2, 3, 4]).sort((a, b) => 1); -result = <_.LoDashImplicitArrayWrapper>_([1, 2, 3, 4]).splice(1); -result = <_.LoDashImplicitArrayWrapper>_([1, 2, 3, 4]).splice(1, 2, 5, 6); -result = <_.LoDashImplicitArrayWrapper>_([1, 2, 3, 4]).unshift(5, 6); +// Wrapped array shortcut methods +_([1, 2, 3, 4]).pop(); // $ExpectType number | undefined +_([1, 2, 3, 4]).push(5, 6, 7); // $ExpectType LoDashImplicitWrapper +_([1, 2, 3, 4]).shift(); // $ExpectType number | undefined +_([1, 2, 3, 4]).sort((a, b) => 1); // $ExpectType LoDashImplicitWrapper +_([1, 2, 3, 4]).splice(1); // $ExpectType LoDashImplicitWrapper +_([1, 2, 3, 4]).splice(1, 2, 5, 6); // $ExpectType LoDashImplicitWrapper +_([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashImplicitWrapper -result = <_.LoDashExplicitObjectWrapper>_.chain([1, 2, 3, 4]).pop(); -result = <_.LoDashExplicitArrayWrapper>_.chain([1, 2, 3, 4]).push(5, 6, 7); -result = <_.LoDashExplicitObjectWrapper>_.chain([1, 2, 3, 4]).shift(); -result = <_.LoDashExplicitArrayWrapper>_.chain([1, 2, 3, 4]).sort((a, b) => 1); -result = <_.LoDashExplicitArrayWrapper>_.chain([1, 2, 3, 4]).splice(1); -result = <_.LoDashExplicitArrayWrapper>_.chain([1, 2, 3, 4]).splice(1, 2, 5, 6); -result = <_.LoDashExplicitArrayWrapper>_.chain([1, 2, 3, 4]).unshift(5, 6); +_.chain([1, 2, 3, 4]).pop(); // $ExpectType LoDashExplicitWrapper +_.chain([1, 2, 3, 4]).push(5, 6, 7); // $ExpectType LoDashExplicitWrapper +_.chain([1, 2, 3, 4]).shift(); // $ExpectType LoDashExplicitWrapper +_.chain([1, 2, 3, 4]).sort((a, b) => 1); // $ExpectType LoDashExplicitWrapper +_.chain([1, 2, 3, 4]).splice(1); // $ExpectType LoDashExplicitWrapper +_.chain([1, 2, 3, 4]).splice(1, 2, 5, 6); // $ExpectType LoDashExplicitWrapper +_.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper /********* * Array * @@ -103,81 +103,81 @@ result = <_.LoDashExplicitArrayWrapper>_.chain([1, 2, 3, 4]).unshift(5, // _.chunk namespace TestChunk { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[][]; + let result: AbcObject[][]; - result = _.chunk(array); - result = _.chunk(array, 42); + result = _.chunk(array); + result = _.chunk(array, 42); - result = _.chunk(list); - result = _.chunk(list, 42); + result = _.chunk(list); + result = _.chunk(list, 42); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).chunk(); result = _(array).chunk(42); - result = _(list).chunk(); - result = _(list).chunk(42); + result = _(list).chunk(); + result = _(list).chunk(42); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _.chain(array).chunk(); result = _(array).chain().chunk(); result = _(array).chain().chunk(42); - result = _(list).chain().chunk(); - result = _(list).chain().chunk(42); + result = _(list).chain().chunk(); + result = _(list).chain().chunk(42); } } // _.compact namespace TestCompact { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let array2: Array | null | undefined = any; - let list2: _.List | null | undefined = any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let array2: Array | null | undefined = anything; + let list2: _.List | null | undefined = anything; { - let result: TResult[]; + let result: AbcObject[]; - result = _.compact(array); - result = _.compact(list); + result = _.compact(array); + result = _.compact(list); result = _.compact(array2); result = _.compact(list2); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).compact(); - result = _(list).compact(); + result = _(list).compact(); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().compact(); - result = _(list).chain().compact(); + result = _(list).chain().compact(); } } // _.difference namespace TestDifference { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let arrayParam: TResult[] = []; - let listParam: _.List = []; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let arrayParam: AbcObject[] = []; + let listParam: _.List = []; { - let result: TResult[]; + let result: AbcObject[]; result = _.difference(array); result = _.difference(array, arrayParam); @@ -191,222 +191,222 @@ namespace TestDifference { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).difference(); result = _(array).difference(arrayParam); result = _(array).difference(listParam, arrayParam); result = _(array).difference(arrayParam, listParam, arrayParam); - result = _(list).difference(); - result = _(list).difference(listParam); - result = _(list).difference(arrayParam, listParam); - result = _(list).difference(listParam, arrayParam, listParam); + result = _(list).difference(); + result = _(list).difference(listParam); + result = _(list).difference(arrayParam, listParam); + result = _(list).difference(listParam, arrayParam, listParam); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().difference(); result = _(array).chain().difference(arrayParam); result = _(array).chain().difference(listParam, arrayParam); result = _(array).chain().difference(arrayParam, listParam, arrayParam); - result = _(list).chain().difference(); - result = _(list).chain().difference(listParam); - result = _(list).chain().difference(arrayParam, listParam); - result = _(list).chain().difference(listParam, arrayParam, listParam); + result = _(list).chain().difference(); + result = _(list).chain().difference(listParam); + result = _(list).chain().difference(arrayParam, listParam); + result = _(list).chain().difference(listParam, arrayParam, listParam); } } // _.differenceBy namespace TestDifferenceBy { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let arrayParam: TResult[] = []; - let listParam: _.List = []; - let iteratee: (value: TResult) => any = (value: TResult) => 1; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let arrayParam: AbcObject[] = []; + let listParam: _.List = []; + let iteratee: (value: AbcObject) => any = (value: AbcObject) => 1; { - let result: TResult[]; + let result: AbcObject[]; result = _.differenceBy(array); - result = _.differenceBy(array, arrayParam); - result = _.differenceBy(array, listParam, arrayParam); - result = _.differenceBy(array, arrayParam, listParam, arrayParam); - result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam); - result = _.differenceBy(array, arrayParam, listParam, arrayParam, listParam, arrayParam); - result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); + result = _.differenceBy(array, arrayParam); + result = _.differenceBy(array, listParam, arrayParam); + result = _.differenceBy(array, arrayParam, listParam, arrayParam); + result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam); + result = _.differenceBy(array, arrayParam, listParam, arrayParam, listParam, arrayParam); + result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); result = _.differenceBy(array, arrayParam, iteratee); result = _.differenceBy(array, listParam, arrayParam, iteratee); result = _.differenceBy(array, arrayParam, listParam, arrayParam, iteratee); result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, iteratee); result = _.differenceBy(array, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); - result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); + result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); result = _.differenceBy(array, arrayParam, 'a'); result = _.differenceBy(array, listParam, arrayParam, 'a'); result = _.differenceBy(array, arrayParam, listParam, arrayParam, 'a'); result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, 'a'); result = _.differenceBy(array, arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); - result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); + result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); result = _.differenceBy(array, arrayParam, {a: 1}); result = _.differenceBy(array, listParam, arrayParam, {a: 1}); result = _.differenceBy(array, arrayParam, listParam, arrayParam, {a: 1}); result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, {a: 1}); result = _.differenceBy(array, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); - result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); + result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); result = _.differenceBy(list); - result = _.differenceBy(list, listParam); - result = _.differenceBy(list, arrayParam, listParam); - result = _.differenceBy(list, listParam, arrayParam, listParam); - result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam); - result = _.differenceBy(list, listParam, arrayParam, listParam, arrayParam, listParam); - result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam); + result = _.differenceBy(list, listParam); + result = _.differenceBy(list, arrayParam, listParam); + result = _.differenceBy(list, listParam, arrayParam, listParam); + result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam); + result = _.differenceBy(list, listParam, arrayParam, listParam, arrayParam, listParam); + result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam); result = _.differenceBy(list, listParam, iteratee); result = _.differenceBy(list, arrayParam, listParam, iteratee); result = _.differenceBy(list, listParam, arrayParam, listParam, iteratee); result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, iteratee); result = _.differenceBy(list, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); - result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); + result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); result = _.differenceBy(list, listParam, 'a'); result = _.differenceBy(list, arrayParam, listParam, 'a'); result = _.differenceBy(list, listParam, arrayParam, listParam, 'a'); result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, 'a'); result = _.differenceBy(list, listParam, arrayParam, listParam, arrayParam, listParam, 'a'); - result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, 'a'); + result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, 'a'); result = _.differenceBy(list, listParam, {a: 1}); result = _.differenceBy(list, arrayParam, listParam, {a: 1}); result = _.differenceBy(list, listParam, arrayParam, listParam, {a: 1}); result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, {a: 1}); result = _.differenceBy(list, listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); - result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); + result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); } { - let result: _.LoDashImplicitWrapper; + let result: _.LoDashImplicitWrapper; - result = _(array).differenceBy(arrayParam); - result = _(array).differenceBy(listParam, arrayParam); - result = _(array).differenceBy(arrayParam, listParam, arrayParam); - result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam); - result = _(array).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam); - result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); + result = _(array).differenceBy(arrayParam); + result = _(array).differenceBy(listParam, arrayParam); + result = _(array).differenceBy(arrayParam, listParam, arrayParam); + result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam); + result = _(array).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam); + result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); result = _(array).differenceBy(arrayParam, iteratee); result = _(array).differenceBy(listParam, arrayParam, iteratee); result = _(array).differenceBy(arrayParam, listParam, arrayParam, iteratee); result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, iteratee); result = _(array).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); - result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); + result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); result = _(array).differenceBy(arrayParam, 'a'); result = _(array).differenceBy(listParam, arrayParam, 'a'); result = _(array).differenceBy(arrayParam, listParam, arrayParam, 'a'); result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, 'a'); result = _(array).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); - result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); + result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); result = _(array).differenceBy(arrayParam, {a: 1}); result = _(array).differenceBy(listParam, arrayParam, {a: 1}); result = _(array).differenceBy(arrayParam, listParam, arrayParam, {a: 1}); result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, {a: 1}); result = _(array).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); - result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); + result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); - result = _(list).differenceBy(listParam); - result = _(list).differenceBy(arrayParam, listParam); - result = _(list).differenceBy(listParam, arrayParam, listParam); - result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam); - result = _(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam); - result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam); + result = _(list).differenceBy(listParam); + result = _(list).differenceBy(arrayParam, listParam); + result = _(list).differenceBy(listParam, arrayParam, listParam); + result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam); + result = _(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam); + result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam); result = _(list).differenceBy(listParam, iteratee); result = _(list).differenceBy(arrayParam, listParam, iteratee); result = _(list).differenceBy(listParam, arrayParam, listParam, iteratee); result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, iteratee); result = _(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, iteratee); - result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); + result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); result = _(list).differenceBy(listParam, 'a'); result = _(list).differenceBy(arrayParam, listParam, 'a'); result = _(list).differenceBy(listParam, arrayParam, listParam, 'a'); result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, 'a'); result = _(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, 'a'); - result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, 'a'); + result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, 'a'); result = _(list).differenceBy(listParam, {a: 1}); result = _(list).differenceBy(arrayParam, listParam, {a: 1}); result = _(list).differenceBy(listParam, arrayParam, listParam, {a: 1}); result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, {a: 1}); result = _(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); - result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); + result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); } { - let result: _.LoDashExplicitWrapper; + let result: _.LoDashExplicitWrapper; - result = _(array).chain().differenceBy(arrayParam); - result = _(array).chain().differenceBy(listParam, arrayParam); - result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam); - result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam); - result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam); - result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); + result = _(array).chain().differenceBy(arrayParam); + result = _(array).chain().differenceBy(listParam, arrayParam); + result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam); + result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam); + result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam); + result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); result = _(array).chain().differenceBy(arrayParam, iteratee); result = _(array).chain().differenceBy(listParam, arrayParam, iteratee); result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, iteratee); result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, iteratee); result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); - result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); + result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); result = _(array).chain().differenceBy(arrayParam, 'a'); result = _(array).chain().differenceBy(listParam, arrayParam, 'a'); result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, 'a'); result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, 'a'); result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); - result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); + result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); result = _(array).chain().differenceBy(arrayParam, {a: 1}); result = _(array).chain().differenceBy(listParam, arrayParam, {a: 1}); result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, {a: 1}); result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, {a: 1}); result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); - result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); + result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); - result = _(list).chain().differenceBy(listParam); - result = _(list).chain().differenceBy(arrayParam, listParam); - result = _(list).chain().differenceBy(listParam, arrayParam, listParam); - result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam); - result = _(list).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam); - result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam); + result = _(list).chain().differenceBy(listParam); + result = _(list).chain().differenceBy(arrayParam, listParam); + result = _(list).chain().differenceBy(listParam, arrayParam, listParam); + result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam); + result = _(list).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam); + result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam); result = _(list).chain().differenceBy(listParam, iteratee); result = _(list).chain().differenceBy(arrayParam, listParam, iteratee); result = _(list).chain().differenceBy(listParam, arrayParam, listParam, iteratee); result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, iteratee); result = _(list).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, iteratee); - result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); + result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); result = _(list).chain().differenceBy(listParam, 'a'); result = _(list).chain().differenceBy(arrayParam, listParam, 'a'); result = _(list).chain().differenceBy(listParam, arrayParam, listParam, 'a'); result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, 'a'); result = _(list).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, 'a'); - result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, 'a'); + result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, 'a'); result = _(list).chain().differenceBy(listParam, {a: 1}); result = _(list).chain().differenceBy(arrayParam, listParam, {a: 1}); result = _(list).chain().differenceBy(listParam, arrayParam, listParam, {a: 1}); result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, {a: 1}); result = _(list).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); - result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); + result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); } { @@ -550,63 +550,63 @@ namespace TestDifferenceBy { // _.differenceWith { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let arrayParam: TResult[] = []; - let listParam: _.List = []; - let comparator = (a: TResult, b: TResult) => true; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let arrayParam: AbcObject[] = []; + let listParam: _.List = []; + let comparator = (a: AbcObject, b: AbcObject) => true; { - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.differenceWith(array); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.differenceWith(array, arrayParam); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.differenceWith(array, listParam, arrayParam); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.differenceWith(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.differenceWith(array, arrayParam, comparator); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.differenceWith(array, listParam, arrayParam, comparator); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.differenceWith(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, comparator); } { - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).differenceWith(arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).differenceWith(listParam, arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).differenceWith(arrayParam, listParam, arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).differenceWith(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).differenceWith(arrayParam, comparator); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).differenceWith(listParam, arrayParam, comparator); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).differenceWith(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, comparator); } { - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).differenceWith(arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).differenceWith(listParam, arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).differenceWith(arrayParam, listParam, arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).differenceWith(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).differenceWith(arrayParam, comparator); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).differenceWith(listParam, arrayParam, comparator); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).differenceWith(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, comparator); } @@ -621,7 +621,7 @@ namespace TestDifferenceBy { } const t1: T1 = { a: 'a', b: 'b' }; - const t2: T2 | undefined = any; + const t2: T2 | undefined = anything; // $ExpectType T1[] _.differenceWith([t1], [t2], (a, b) => { @@ -648,169 +648,169 @@ namespace TestDifferenceBy { // _.drop { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; - result = _.drop(array); - result = _.drop(array, 42); + let result: AbcObject[]; + result = _.drop(array); + result = _.drop(array, 42); - result = _.drop(list); - result = _.drop(list, 42); + result = _.drop(list); + result = _.drop(list, 42); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).drop(); result = _(array).drop(42); - result = _(list).drop(); - result = _(list).drop(42); + result = _(list).drop(); + result = _(list).drop(42); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().drop(); result = _(array).chain().drop(42); - result = _(list).chain().drop(); - result = _(list).chain().drop(42); + result = _(list).chain().drop(); + result = _(list).chain().drop(42); } } // _.dropRight namespace TestDropRight { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.dropRight(array); - result = _.dropRight(array, 42); + result = _.dropRight(array); + result = _.dropRight(array, 42); - result = _.dropRight(list); - result = _.dropRight(list, 42); + result = _.dropRight(list); + result = _.dropRight(list, 42); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).dropRight(); result = _(array).dropRight(42); - result = _(list).dropRight(); - result = _(list).dropRight(42); + result = _(list).dropRight(); + result = _(list).dropRight(42); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().dropRight(); result = _(array).chain().dropRight(42); - result = _(list).chain().dropRight(); - result = _(list).chain().dropRight(42); + result = _(list).chain().dropRight(); + result = _(list).chain().dropRight(42); } } // _.dropRightWhile namespace TestDropRightWhile { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let predicateFn = (value: TResult, index: number, collection: _.List) => true; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let predicateFn = (value: AbcObject, index: number, collection: _.List) => true; { - let result: TResult[]; + let result: AbcObject[]; - result = _.dropRightWhile(array); - result = _.dropRightWhile(array, predicateFn); - result = _.dropRightWhile(array, ''); + result = _.dropRightWhile(array); + result = _.dropRightWhile(array, predicateFn); + result = _.dropRightWhile(array, ''); result = _.dropRightWhile(array, {a: 42}); - result = _.dropRightWhile(list); - result = _.dropRightWhile(list, predicateFn); - result = _.dropRightWhile(list, ''); + result = _.dropRightWhile(list); + result = _.dropRightWhile(list, predicateFn); + result = _.dropRightWhile(list, ''); result = _.dropRightWhile(list, {a: 42}); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).dropRightWhile(); result = _(array).dropRightWhile(predicateFn); result = _(array).dropRightWhile(''); result = _(array).dropRightWhile({a: 42}); - result = _(list).dropRightWhile(); - result = _(list).dropRightWhile(predicateFn); - result = _(list).dropRightWhile(''); + result = _(list).dropRightWhile(); + result = _(list).dropRightWhile(predicateFn); + result = _(list).dropRightWhile(''); result = _(list).dropRightWhile({a: 42}); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().dropRightWhile(); result = _(array).chain().dropRightWhile(predicateFn); result = _(array).chain().dropRightWhile(''); result = _(array).chain().dropRightWhile({a: 42}); - result = _(list).chain().dropRightWhile(); - result = _(list).chain().dropRightWhile(predicateFn); - result = _(list).chain().dropRightWhile(''); + result = _(list).chain().dropRightWhile(); + result = _(list).chain().dropRightWhile(predicateFn); + result = _(list).chain().dropRightWhile(''); result = _(list).chain().dropRightWhile({a: 42}); } } // _.dropWhile namespace TestDropWhile { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let predicateFn = (value: TResult, index: number, collection: _.List) => true; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let predicateFn = (value: AbcObject, index: number, collection: _.List) => true; { - let result: TResult[]; + let result: AbcObject[]; - result = _.dropWhile(array); - result = _.dropWhile(array, predicateFn); - result = _.dropWhile(array, ''); + result = _.dropWhile(array); + result = _.dropWhile(array, predicateFn); + result = _.dropWhile(array, ''); result = _.dropWhile(array, {a: 42}); - result = _.dropWhile(list); - result = _.dropWhile(list, predicateFn); - result = _.dropWhile(list, ''); + result = _.dropWhile(list); + result = _.dropWhile(list, predicateFn); + result = _.dropWhile(list, ''); result = _.dropWhile(list, {a: 42}); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).dropWhile(); result = _(array).dropWhile(predicateFn); result = _(array).dropWhile(''); result = _(array).dropWhile({a: 42}); - result = _(list).dropWhile(); - result = _(list).dropWhile(predicateFn); - result = _(list).dropWhile(''); + result = _(list).dropWhile(); + result = _(list).dropWhile(predicateFn); + result = _(list).dropWhile(''); result = _(list).dropWhile({a: 42}); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().dropWhile(); result = _(array).chain().dropWhile(predicateFn); result = _(array).chain().dropWhile(''); result = _(array).chain().dropWhile({a: 42}); - result = _(list).chain().dropWhile(); - result = _(list).chain().dropWhile(predicateFn); - result = _(list).chain().dropWhile(''); + result = _(list).chain().dropWhile(); + result = _(list).chain().dropWhile(predicateFn); + result = _(list).chain().dropWhile(''); result = _(list).chain().dropWhile({a: 42}); } } @@ -871,25 +871,25 @@ namespace TestFill { // _.findIndex namespace TestFindIndex { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let predicateFn = (value: TResult, index: number, collection: _.List) => true; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let predicateFn = (value: AbcObject, index: number, collection: _.List) => true; let fromIndex = 0; { let result: number; - result = _.findIndex(array); - result = _.findIndex(array, predicateFn); - result = _.findIndex(array, ''); + result = _.findIndex(array); + result = _.findIndex(array, predicateFn); + result = _.findIndex(array, ''); result = _.findIndex(array, {a: 42}); - result = _.findIndex(array, predicateFn, fromIndex); + result = _.findIndex(array, predicateFn, fromIndex); - result = _.findIndex(list); - result = _.findIndex(list, predicateFn); - result = _.findIndex(list, ''); + result = _.findIndex(list); + result = _.findIndex(list, predicateFn); + result = _.findIndex(list, ''); result = _.findIndex(list, {a: 42}); - result = _.findIndex(list, predicateFn, fromIndex); + result = _.findIndex(list, predicateFn, fromIndex); result = _.findIndex([{ b: 5 }], ['b', 5]); result = _(array).findIndex(); @@ -899,10 +899,10 @@ namespace TestFindIndex { result = _(array).findIndex(predicateFn, fromIndex); result = _(list).findIndex(); - result = _(list).findIndex(predicateFn); + result = _(list).findIndex(predicateFn); result = _(list).findIndex(''); result = _(list).findIndex<{a: number}>({a: 42}); - result = _(list).findIndex(predicateFn, fromIndex); + result = _(list).findIndex(predicateFn, fromIndex); } { @@ -915,35 +915,35 @@ namespace TestFindIndex { result = _(array).chain().findIndex(predicateFn, fromIndex); result = _(list).chain().findIndex(); - result = _(list).chain().findIndex(predicateFn); + result = _(list).chain().findIndex(predicateFn); result = _(list).chain().findIndex(''); result = _(list).chain().findIndex<{a: number}>({a: 42}); - result = _(list).chain().findIndex(predicateFn, fromIndex); + result = _(list).chain().findIndex(predicateFn, fromIndex); } } // _.findLastIndex namespace TestFindLastIndex { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; - let predicateFn = (value: TResult, index: number, collection: _.List) => true; + let predicateFn = (value: AbcObject, index: number, collection: _.List) => true; let fromIndex = 0; { let result: number; - result = _.findLastIndex(array); - result = _.findLastIndex(array, predicateFn); - result = _.findLastIndex(array, ''); + result = _.findLastIndex(array); + result = _.findLastIndex(array, predicateFn); + result = _.findLastIndex(array, ''); result = _.findLastIndex(array, {a: 42}); - result = _.findLastIndex(array, predicateFn, fromIndex); + result = _.findLastIndex(array, predicateFn, fromIndex); - result = _.findLastIndex(list); - result = _.findLastIndex(list, predicateFn); - result = _.findLastIndex(list, ''); + result = _.findLastIndex(list); + result = _.findLastIndex(list, predicateFn); + result = _.findLastIndex(list, ''); result = _.findLastIndex(list, {a: 42}); - result = _.findLastIndex(list, predicateFn, fromIndex); + result = _.findLastIndex(list, predicateFn, fromIndex); result = _.findLastIndex([{ b: 5 }], ['b', 5]); result = _(array).findLastIndex(); @@ -953,10 +953,10 @@ namespace TestFindLastIndex { result = _(array).findLastIndex(predicateFn, fromIndex); result = _(list).findLastIndex(); - result = _(list).findLastIndex(predicateFn); + result = _(list).findLastIndex(predicateFn); result = _(list).findLastIndex(''); result = _(list).findLastIndex<{a: number}>({a: 42}); - result = _(list).findLastIndex(predicateFn, fromIndex); + result = _(list).findLastIndex(predicateFn, fromIndex); } { @@ -969,17 +969,17 @@ namespace TestFindLastIndex { result = _(array).chain().findLastIndex(predicateFn, fromIndex); result = _(list).chain().findLastIndex(); - result = _(list).chain().findLastIndex(predicateFn); + result = _(list).chain().findLastIndex(predicateFn); result = _(list).chain().findLastIndex(''); result = _(list).chain().findLastIndex<{a: number}>({a: 42}); - result = _(list).chain().findLastIndex(predicateFn, fromIndex); + result = _(list).chain().findLastIndex(predicateFn, fromIndex); } } // _.first namespace TestFirst { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { let result: string | undefined; @@ -989,13 +989,13 @@ namespace TestFirst { } { - let result: TResult | undefined; + let result: AbcObject | undefined; - result = _.first(array); - result = _.first(list); + result = _.first(array); + result = _.first(list); result = _(array).first(); - result = _(list).first(); + result = _(list).first(); } { @@ -1005,7 +1005,7 @@ namespace TestFirst { } { - let result: _.LoDashExplicitWrapper; + let result: _.LoDashExplicitWrapper; result = _(array).chain().first(); result = _(list).chain().first(); @@ -1203,7 +1203,7 @@ namespace TestFlattenDeep { // _.fromPairs namespace TestFromPairs { let twoDimensionalArray: string[][] | null | undefined = [] as any; - let numberTupleArray: [string, number][] | null | undefined = [] as any; + let numberTupleArray: Array<[string, number]> | null | undefined = [] as any; let stringDict: _.Dictionary; let numberDict: _.Dictionary; @@ -1227,8 +1227,8 @@ namespace TestFromPairs { // _.head namespace TestHead { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { let result: string | undefined; @@ -1238,13 +1238,13 @@ namespace TestHead { } { - let result: TResult | undefined; + let result: AbcObject | undefined; - result = _.head(array); - result = _.head(list); + result = _.head(array); + result = _.head(list); result = _(array).head(); - result = _(list).head(); + result = _(list).head(); } { @@ -1254,7 +1254,7 @@ namespace TestHead { } { - let result: _.LoDashExplicitWrapper; + let result: _.LoDashExplicitWrapper; result = _(array).chain().head(); result = _(list).chain().head(); @@ -1263,28 +1263,28 @@ namespace TestHead { // _.indexOf namespace TestIndexOf { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let value: TResult = { a: 1, b: "", c: true }; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let value: AbcObject = { a: 1, b: "", c: true }; { let result: number; - result = _.indexOf(array, value); - result = _.indexOf(array, value, true); - result = _.indexOf(array, value, 42); + result = _.indexOf(array, value); + result = _.indexOf(array, value, true); + result = _.indexOf(array, value, 42); - result = _.indexOf(list, value); - result = _.indexOf(list, value, true); - result = _.indexOf(list, value, 42); + result = _.indexOf(list, value); + result = _.indexOf(list, value, true); + result = _.indexOf(list, value, 42); result = _(array).indexOf(value); result = _(array).indexOf(value, true); result = _(array).indexOf(value, 42); - result = _(list).indexOf(value); - result = _(list).indexOf(value, true); - result = _(list).indexOf(value, 42); + result = _(list).indexOf(value); + result = _(list).indexOf(value, true); + result = _(list).indexOf(value, 42); } { @@ -1294,170 +1294,170 @@ namespace TestIndexOf { result = _(array).chain().indexOf(value, true); result = _(array).chain().indexOf(value, 42); - result = _(list).chain().indexOf(value); - result = _(list).chain().indexOf(value, true); - result = _(list).chain().indexOf(value, 42); + result = _(list).chain().indexOf(value); + result = _(list).chain().indexOf(value, true); + result = _(list).chain().indexOf(value, 42); } } // _.sortedIndexOf -namespace TestIndexOf { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let value: TResult = { a: 1, b: "", c: true }; +{ + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let value: AbcObject = { a: 1, b: "", c: true }; { let result: number; - result = _.sortedIndexOf(array, value); - result = _.sortedIndexOf(list, value); + result = _.sortedIndexOf(array, value); + result = _.sortedIndexOf(list, value); result = _(array).sortedIndexOf(value); - result = _(list).sortedIndexOf(value); + result = _(list).sortedIndexOf(value); } { let result: _.LoDashExplicitWrapper; result = _(array).chain().sortedIndexOf(value); - result = _(list).chain().sortedIndexOf(value); + result = _(list).chain().sortedIndexOf(value); } } //_.initial namespace TestInitial { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.initial(array); - result = _.initial(list); + result = _.initial(array); + result = _.initial(list); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).initial(); - result = _(list).initial(); + result = _(list).initial(); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().initial(); - result = _(list).chain().initial(); + result = _(list).chain().initial(); } } // _.intersection namespace TestIntersection { - let array: TResult[] = [] as any; - let list: _.List = [] as any; - let arrayParam: TResult[] = [] as any; - let listParam: _.List = [] as any; + let array: AbcObject[] = [] as any; + let list: _.List = [] as any; + let arrayParam: AbcObject[] = [] as any; + let listParam: _.List = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.intersection(array, list); - result = _.intersection(list, array, list); + result = _.intersection(array, list); + result = _.intersection(list, array, list); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; - result = _(array).intersection(arrayParam); - result = _(array).intersection(listParam, arrayParam); + result = _(array).intersection(arrayParam); + result = _(array).intersection(listParam, arrayParam); - result = _(list).intersection(arrayParam); - result = _(list).intersection(listParam, arrayParam); + result = _(list).intersection(arrayParam); + result = _(list).intersection(listParam, arrayParam); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; - result = _(array).chain().intersection(arrayParam); - result = _(array).chain().intersection(listParam, arrayParam); + result = _(array).chain().intersection(arrayParam); + result = _(array).chain().intersection(listParam, arrayParam); - result = _(list).chain().intersection(arrayParam); - result = _(list).chain().intersection(listParam, arrayParam); + result = _(list).chain().intersection(arrayParam); + result = _(list).chain().intersection(listParam, arrayParam); } } // _.intersectionBy { - let array: TResult[] = [] as any; - let list: _.List = [] as any; - let arrayParam: TResult[] = [] as any; - let listParam: _.List = [] as any; + let array: AbcObject[] = [] as any; + let list: _.List = [] as any; + let arrayParam: AbcObject[] = [] as any; + let listParam: _.List = [] as any; - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(array, list); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(list, array, list); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(array, list, 'a'); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(array, list, { a: 42 }); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(list, array, list, { a: 42 }); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(array, list, ['a', 42]); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(array, list, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return 0; }); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(list, array, list, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return 0; }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionBy(arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionBy(listParam, arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionBy(list, 'a'); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionBy(list, { a: 42 }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(list).intersectionBy(array, list, { a: 42 }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionBy(list, ['a', 42]); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionBy(list, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return ""; }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(list).intersectionBy(array, list, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return 1; }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionBy(arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionBy(listParam, arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionBy(list, 'a'); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionBy(list, { a: 42 }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(list).intersectionBy(array, list, { a: 42 }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionBy(list, ['a', 42]); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionBy(list, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return false; }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(list).intersectionBy(array, list, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return null; }); @@ -1490,59 +1490,59 @@ namespace TestIntersection { // _.intersectionWith { - let array: TResult[] = [] as any; - let list: _.List = [] as any; - let arrayParam: TResult[] = [] as any; - let listParam: _.List = [] as any; + let array: AbcObject[] = [] as any; + let list: _.List = [] as any; + let arrayParam: AbcObject[] = [] as any; + let listParam: _.List = [] as any; - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionWith(array, list); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionWith(list, array, list); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionWith(array, list, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionWith(list, array, list, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionWith(arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionWith(listParam, arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionWith(list, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(list).intersectionWith(array, list, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionWith(arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionWith(listParam, arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionWith(list, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(list).intersectionWith(array, list, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); @@ -1619,8 +1619,8 @@ namespace TestJoin { // _.last namespace TestLast { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { let result: string | undefined; @@ -1630,13 +1630,13 @@ namespace TestLast { } { - let result: TResult | undefined; + let result: AbcObject | undefined; - result = _.last(array); - result = _.last(list); + result = _.last(array); + result = _.last(list); result = _(array).last(); - result = _(list).last(); + result = _(list).last(); } { @@ -1646,13 +1646,13 @@ namespace TestLast { } { - let result: _.LoDashExplicitWrapper; + let result: _.LoDashExplicitWrapper; result = _(array).chain().last(); } { - let result: _.LoDashExplicitWrapper; + let result: _.LoDashExplicitWrapper; result = _(list).chain().last(); } @@ -1660,28 +1660,28 @@ namespace TestLast { // _.lastIndexOf namespace TestLastIndexOf { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let value: TResult = { a: 1, b: "", c: true }; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let value: AbcObject = { a: 1, b: "", c: true }; { let result: number; - result = _.lastIndexOf(array, value); - result = _.lastIndexOf(array, value, true); - result = _.lastIndexOf(array, value, 42); + result = _.lastIndexOf(array, value); + result = _.lastIndexOf(array, value, true); + result = _.lastIndexOf(array, value, 42); - result = _.lastIndexOf(list, value); - result = _.lastIndexOf(list, value, true); - result = _.lastIndexOf(list, value, 42); + result = _.lastIndexOf(list, value); + result = _.lastIndexOf(list, value, true); + result = _.lastIndexOf(list, value, 42); result = _(array).lastIndexOf(value); result = _(array).lastIndexOf(value, true); result = _(array).lastIndexOf(value, 42); - result = _(list).lastIndexOf(value); - result = _(list).lastIndexOf(value, true); - result = _(list).lastIndexOf(value, 42); + result = _(list).lastIndexOf(value); + result = _(list).lastIndexOf(value, true); + result = _(list).lastIndexOf(value, 42); } { @@ -1691,69 +1691,69 @@ namespace TestLastIndexOf { result = _(array).chain().lastIndexOf(value, true); result = _(array).chain().lastIndexOf(value, 42); - result = _(list).chain().lastIndexOf(value); - result = _(list).chain().lastIndexOf(value, true); - result = _(list).chain().lastIndexOf(value, 42); + result = _(list).chain().lastIndexOf(value); + result = _(list).chain().lastIndexOf(value, true); + result = _(list).chain().lastIndexOf(value, 42); } } // _.nth namespace TestNth { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let value = 0; { - let result: TResult | undefined; + let result: AbcObject | undefined; - result = _.nth(array); + result = _.nth(array); - result = _.nth(array, 42); + result = _.nth(array, 42); result = _(array).nth(); result = _(array).nth(42); - result = _(list).nth(); - result = _(list).nth(42); + result = _(list).nth(); + result = _(list).nth(42); } { - let result: _.LoDashExplicitWrapper; + let result: _.LoDashExplicitWrapper; result = _(array).chain().nth(); result = _(array).chain().nth(42); - result = _(list).chain().nth(); - result = _(list).chain().nth(42); + result = _(list).chain().nth(); + result = _(list).chain().nth(42); } } // _.pull namespace TestPull { - let array: TResult[] = []; - let list: _.List = []; - let value: TResult = { a: 1, b: "", c: true }; + let array: AbcObject[] = []; + let list: _.List = []; + let value: AbcObject = { a: 1, b: "", c: true }; { - let result: TResult[]; + let result: AbcObject[]; - result = _.pull(array); - result = _.pull(array, value); - result = _.pull(array, value, value); - result = _.pull(array, value, value, value); + result = _.pull(array); + result = _.pull(array, value); + result = _.pull(array, value, value); + result = _.pull(array, value, value, value); } { - let result: _.List; + let result: _.List; - result = _.pull(list); - result = _.pull(list, value); - result = _.pull(list, value, value); - result = _.pull(list, value, value, value); + result = _.pull(list); + result = _.pull(list, value); + result = _.pull(list, value, value); + result = _.pull(list, value, value, value); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).pull(); result = _(array).pull(value); @@ -1762,16 +1762,16 @@ namespace TestPull { } { - let result: _.LoDashImplicitObjectWrapper<_.List>; + let result: _.LoDashImplicitObjectWrapper<_.List>; - result = _(list).pull(); - result = _(list).pull(value); - result = _(list).pull(value, value); - result = _(list).pull(value, value, value); + result = _(list).pull(); + result = _(list).pull(value); + result = _(list).pull(value, value); + result = _(list).pull(value, value, value); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().pull(); result = _(array).chain().pull(value); @@ -1780,40 +1780,40 @@ namespace TestPull { } { - let result: _.LoDashExplicitObjectWrapper<_.List>; + let result: _.LoDashExplicitObjectWrapper<_.List>; - result = _(list).chain().pull(); - result = _(list).chain().pull(value); - result = _(list).chain().pull(value, value); - result = _(list).chain().pull(value, value, value); + result = _(list).chain().pull(); + result = _(list).chain().pull(value); + result = _(list).chain().pull(value, value); + result = _(list).chain().pull(value, value, value); } } // _.pullAt namespace TestPullAt { - let array: TResult[] = []; - let list: _.List = []; + let array: AbcObject[] = []; + let list: _.List = []; { - let result: TResult[]; + let result: AbcObject[]; - result = _.pullAt(array); - result = _.pullAt(array, 1); - result = _.pullAt(array, [2, 3], 1); - result = _.pullAt(array, 4, [2, 3], 1); + result = _.pullAt(array); + result = _.pullAt(array, 1); + result = _.pullAt(array, [2, 3], 1); + result = _.pullAt(array, 4, [2, 3], 1); } { - let result: ArrayLike; + let result: ArrayLike; - result = _.pullAt(list); - result = _.pullAt(list, 1); - result = _.pullAt(list, [2, 3], 1); - result = _.pullAt(list, 4, [2, 3], 1); + result = _.pullAt(list); + result = _.pullAt(list, 1); + result = _.pullAt(list, [2, 3], 1); + result = _.pullAt(list, 4, [2, 3], 1); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).pullAt(); result = _(array).pullAt(1); @@ -1822,7 +1822,7 @@ namespace TestPullAt { } { - let result: _.LoDashImplicitWrapper>; + let result: _.LoDashImplicitWrapper>; result = _(list).pullAt(); result = _(list).pullAt(1); @@ -1831,7 +1831,7 @@ namespace TestPullAt { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().pullAt(); result = _(array).chain().pullAt(1); @@ -1840,7 +1840,7 @@ namespace TestPullAt { } { - let result: _.LoDashExplicitWrapper>; + let result: _.LoDashExplicitWrapper>; result = _(list).chain().pullAt(); result = _(list).chain().pullAt(1); @@ -1851,134 +1851,134 @@ namespace TestPullAt { // _.pullAll { - let array: TResult[] = any; - let list: _.List = any; - let values: _.List = any; + let array: AbcObject[] = anything; + let list: _.List = anything; + let values: _.List = anything; - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAll(array); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAll(array, values); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAll(list); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAll(list, values); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAll(); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAll(values); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAll(); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAll(values); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAll(); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAll(values); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAll(); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAll(values); } // _.pullAllBy { - let array: TResult[] = any; - let list: _.List = any; - let values: _.List = any; + let array: AbcObject[] = anything; + let list: _.List = anything; + let values: _.List = anything; - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllBy(array); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllBy(array, values); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllBy(array, values, 'a'); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllBy(array, values, { a: 42 }); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllBy(array, values, ['a', 42]); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllBy(array, values, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return []; }); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllBy(list); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllBy(list, values); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllBy(list, values, 'a'); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllBy(list, values, { a: 42 }); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllBy(list, values, ['a', 42]); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllBy(list, values, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return () => {}; }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllBy(); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllBy(values); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllBy(values, 'a'); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllBy(values, { a: 42 }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllBy(values, ['a', 42]); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllBy(values, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return 0; }); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllBy(); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllBy(values); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllBy(values, 'a'); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllBy(values, { a: 42 }); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllBy(values, ['a', 42]); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllBy(values, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return 0; }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllBy(); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllBy(values); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllBy(values, 'a'); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllBy(values, { a: 42 }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllBy(values, ['a', 42]); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllBy(values, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return 0; }); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllBy(); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllBy(values); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllBy(values, 'a'); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllBy(values, { a: 42 }); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllBy(values, ['a', 42]); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllBy(values, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return 0; }); @@ -2011,70 +2011,70 @@ namespace TestPullAt { // _.pullAllWith { - let array: TResult[] = any; - let list: _.List = any; - let values: _.List = any; + let array: AbcObject[] = anything; + let list: _.List = anything; + let values: _.List = anything; - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllWith(array); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllWith(array, values); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllWith(array, values, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllWith(list); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllWith(list, values); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllWith(list, values, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllWith(); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllWith(values); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllWith(values, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllWith(); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllWith(values); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllWith(values, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllWith(); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllWith(values); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllWith(values, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllWith(); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllWith(values); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllWith(values, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); @@ -2110,94 +2110,94 @@ namespace TestPullAt { // _.remove namespace TestRemove { - let array: TResult[] = []; - let list: _.List = []; - let predicateFn = (value: TResult, index: number, collection: _.List) => true; + let array: AbcObject[] = []; + let list: _.List = []; + let predicateFn = (value: AbcObject, index: number, collection: _.List) => true; { - let result: TResult[]; + let result: AbcObject[]; - result = _.remove(array); - result = _.remove(array, predicateFn); - result = _.remove(array, ''); + result = _.remove(array); + result = _.remove(array, predicateFn); + result = _.remove(array, ''); result = _.remove(array, {a: 42}); - result = _.remove(list); - result = _.remove(list, predicateFn); - result = _.remove(list, ''); + result = _.remove(list); + result = _.remove(list, predicateFn); + result = _.remove(list, ''); result = _.remove(list, {a: 42}); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).remove(); result = _(array).remove(predicateFn); result = _(array).remove(''); result = _(array).remove({a: 42}); - result = _(list).remove(); - result = _(list).remove(predicateFn); - result = _(list).remove(''); + result = _(list).remove(); + result = _(list).remove(predicateFn); + result = _(list).remove(''); result = _(list).remove({a: 42}); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().remove(); result = _(array).chain().remove(predicateFn); result = _(array).chain().remove(''); result = _(array).chain().remove({a: 42}); - result = _(list).chain().remove(); - result = _(list).chain().remove(predicateFn); - result = _(list).chain().remove(''); + result = _(list).chain().remove(); + result = _(list).chain().remove(predicateFn); + result = _(list).chain().remove(''); result = _(list).chain().remove({a: 42}); } } // _.tail namespace TestTail { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.tail(array); - result = _.tail(list); + result = _.tail(array); + result = _.tail(list); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).tail(); - result = _(list).tail(); + result = _(list).tail(); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().tail(); - result = _(list).chain().tail(); + result = _(list).chain().tail(); } } // _.slice namespace TestSlice { - let array: TResult[] | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.slice(array); + result = _.slice(array); result = _.slice(array, 42); result = _.slice(array, 42, 42); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).slice(); result = _(array).slice(42); @@ -2205,7 +2205,7 @@ namespace TestSlice { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().slice(); result = _(array).chain().slice(42); @@ -2397,415 +2397,388 @@ namespace TestSortedLastIndexBy { } } -// _.tail -namespace TestTail { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - - { - let result: TResult[]; - - result = _.tail(array); - result = _.tail(list); - } - - { - let result: _.LoDashImplicitArrayWrapper; - - result = _(array).tail(); - result = _(list).tail(); - } - - { - let result: _.LoDashExplicitArrayWrapper; - - result = _(array).chain().tail(); - result = _(list).chain().tail(); - } -} - // _.take namespace TestTake { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.take(array); - result = _.take(array, 42); + result = _.take(array); + result = _.take(array, 42); - result = _.take(list); - result = _.take(list, 42); + result = _.take(list); + result = _.take(list, 42); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).take(); result = _(array).take(42); - result = _(list).take(); - result = _(list).take(42); + result = _(list).take(); + result = _(list).take(42); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().take(); result = _(array).chain().take(42); - result = _(list).chain().take(); - result = _(list).chain().take(42); + result = _(list).chain().take(); + result = _(list).chain().take(42); } } // _.takeRight namespace TestTakeRight { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.takeRight(array); - result = _.takeRight(array, 42); + result = _.takeRight(array); + result = _.takeRight(array, 42); - result = _.takeRight(list); - result = _.takeRight(list, 42); + result = _.takeRight(list); + result = _.takeRight(list, 42); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).takeRight(); result = _(array).takeRight(42); - result = _(list).takeRight(); - result = _(list).takeRight(42); + result = _(list).takeRight(); + result = _(list).takeRight(42); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().takeRight(); result = _(array).chain().takeRight(42); - result = _(list).chain().takeRight(); - result = _(list).chain().takeRight(42); + result = _(list).chain().takeRight(); + result = _(list).chain().takeRight(42); } } // _.takeRightWhile namespace TestTakeRightWhile { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let predicateFn = (value: TResult, index: number, collection: _.List) => true; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let predicateFn = (value: AbcObject, index: number, collection: _.List) => true; { - let result: TResult[]; + let result: AbcObject[]; - result = _.takeRightWhile(array); - result = _.takeRightWhile(array, predicateFn); - result = _.takeRightWhile(array, ''); + result = _.takeRightWhile(array); + result = _.takeRightWhile(array, predicateFn); + result = _.takeRightWhile(array, ''); result = _.takeRightWhile(array, {a: 42}); - result = _.takeRightWhile(list); - result = _.takeRightWhile(list, predicateFn); - result = _.takeRightWhile(list, ''); + result = _.takeRightWhile(list); + result = _.takeRightWhile(list, predicateFn); + result = _.takeRightWhile(list, ''); result = _.takeRightWhile(list, {a: 42}); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).takeRightWhile(); result = _(array).takeRightWhile(predicateFn); result = _(array).takeRightWhile(''); result = _(array).takeRightWhile({a: 42}); - result = _(list).takeRightWhile(); - result = _(list).takeRightWhile(predicateFn); - result = _(list).takeRightWhile(''); + result = _(list).takeRightWhile(); + result = _(list).takeRightWhile(predicateFn); + result = _(list).takeRightWhile(''); result = _(list).takeRightWhile({a: 42}); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().takeRightWhile(); result = _(array).chain().takeRightWhile(predicateFn); result = _(array).chain().takeRightWhile(''); result = _(array).chain().takeRightWhile({a: 42}); - result = _(list).chain().takeRightWhile(); - result = _(list).chain().takeRightWhile(predicateFn); - result = _(list).chain().takeRightWhile(''); + result = _(list).chain().takeRightWhile(); + result = _(list).chain().takeRightWhile(predicateFn); + result = _(list).chain().takeRightWhile(''); result = _(list).chain().takeRightWhile({a: 42}); } } // _.takeWhile namespace TestTakeWhile { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let predicateFn = (value: TResult, index: number, collection: _.List) => true; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let predicateFn = (value: AbcObject, index: number, collection: _.List) => true; { - let result: TResult[]; + let result: AbcObject[]; - result = _.takeWhile(array); - result = _.takeWhile(array, predicateFn); - result = _.takeWhile(array, ''); + result = _.takeWhile(array); + result = _.takeWhile(array, predicateFn); + result = _.takeWhile(array, ''); result = _.takeWhile(array, {a: 42}); - result = _.takeWhile(list); - result = _.takeWhile(list, predicateFn); - result = _.takeWhile(list, ''); + result = _.takeWhile(list); + result = _.takeWhile(list, predicateFn); + result = _.takeWhile(list, ''); result = _.takeWhile(list, {a: 42}); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).takeWhile(); result = _(array).takeWhile(predicateFn); result = _(array).takeWhile(''); result = _(array).takeWhile({a: 42}); - result = _(list).takeWhile(); - result = _(list).takeWhile(predicateFn); - result = _(list).takeWhile(''); + result = _(list).takeWhile(); + result = _(list).takeWhile(predicateFn); + result = _(list).takeWhile(''); result = _(list).takeWhile({a: 42}); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().takeWhile(); result = _(array).chain().takeWhile(predicateFn); result = _(array).chain().takeWhile(''); result = _(array).chain().takeWhile({a: 42}); - result = _(list).chain().takeWhile(); - result = _(list).chain().takeWhile(predicateFn); - result = _(list).chain().takeWhile(''); + result = _(list).chain().takeWhile(); + result = _(list).chain().takeWhile(predicateFn); + result = _(list).chain().takeWhile(''); result = _(list).chain().takeWhile({a: 42}); } } // _.union namespace TestUnion { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.union(); + result = _.union(); - result = _.union(array); - result = _.union(array, list); - result = _.union(array, list, array); + result = _.union(array); + result = _.union(array, list); + result = _.union(array, list, array); - result = _.union(list); - result = _.union(list, array); - result = _.union(list, array, list); + result = _.union(list); + result = _.union(list, array); + result = _.union(list, array, list); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).union(); result = _(array).union(list); result = _(array).union(list, array); - result = _(array).union(); - result = _(array).union(list); - result = _(array).union(list, array); + result = _(array).union(); + result = _(array).union(list); + result = _(array).union(list, array); - result = _(list).union(); - result = _(list).union(array); - result = _(list).union(array, list); + result = _(list).union(); + result = _(list).union(array); + result = _(list).union(array, list); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().union(); result = _(array).chain().union(list); result = _(array).chain().union(list, array); - result = _(array).chain().union(); - result = _(array).chain().union(list); - result = _(array).chain().union(list, array); + result = _(array).chain().union(); + result = _(array).chain().union(list); + result = _(array).chain().union(list, array); - result = _(list).chain().union(); - result = _(list).chain().union(array); - result = _(list).chain().union(array, list); + result = _(list).chain().union(); + result = _(list).chain().union(array); + result = _(list).chain().union(array, list); } } // _.unionBy namespace TestUnionBy { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let iteratee: (value: TResult) => any = (value: TResult) => 1; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let iteratee: (value: AbcObject) => any = (value: AbcObject) => 1; { - let result: TResult[]; + let result: AbcObject[]; - result = _.unionBy(array, array); - result = _.unionBy(array, list, array); - result = _.unionBy(array, array, list, array); - result = _.unionBy(array, list, array, list, array); - result = _.unionBy(array, array, list, array, list, array); + result = _.unionBy(array, array); + result = _.unionBy(array, list, array); + result = _.unionBy(array, array, list, array); + result = _.unionBy(array, list, array, list, array); + result = _.unionBy(array, array, list, array, list, array); - result = _.unionBy(array, array, iteratee); - result = _.unionBy(array, list, array, iteratee); - result = _.unionBy(array, array, list, array, iteratee); - result = _.unionBy(array, list, array, list, array, iteratee); - result = _.unionBy(array, array, list, array, list, array, iteratee); + result = _.unionBy(array, array, iteratee); + result = _.unionBy(array, list, array, iteratee); + result = _.unionBy(array, array, list, array, iteratee); + result = _.unionBy(array, list, array, list, array, iteratee); + result = _.unionBy(array, array, list, array, list, array, iteratee); - result = _.unionBy(array, array, 'a'); - result = _.unionBy(array, list, array, 'a'); - result = _.unionBy(array, array, list, array, 'a'); - result = _.unionBy(array, list, array, list, array, 'a'); - result = _.unionBy(array, array, list, array, list, array, 'a'); + result = _.unionBy(array, array, 'a'); + result = _.unionBy(array, list, array, 'a'); + result = _.unionBy(array, array, list, array, 'a'); + result = _.unionBy(array, list, array, list, array, 'a'); + result = _.unionBy(array, array, list, array, list, array, 'a'); result = _.unionBy(array, array, {a: 1}); result = _.unionBy(array, list, array, {a: 1}); result = _.unionBy(array, array, list, array, {a: 1}); result = _.unionBy(array, list, array, list, array, {a: 1}); - result = _.unionBy(array, list, array, list, array, list, {a: 1}); + result = _.unionBy(array, list, array, list, array, list, {a: 1}); - result = _.unionBy(list, list); - result = _.unionBy(list, array, list); - result = _.unionBy(list, list, array, list); - result = _.unionBy(list, array, list, array, list); - result = _.unionBy(list, list, array, list, array, list); + result = _.unionBy(list, list); + result = _.unionBy(list, array, list); + result = _.unionBy(list, list, array, list); + result = _.unionBy(list, array, list, array, list); + result = _.unionBy(list, list, array, list, array, list); - result = _.unionBy(list, list, iteratee); - result = _.unionBy(list, array, list, iteratee); - result = _.unionBy(list, list, array, list, iteratee); - result = _.unionBy(list, array, list, array, list, iteratee); - result = _.unionBy(list, list, array, list, array, list, iteratee); + result = _.unionBy(list, list, iteratee); + result = _.unionBy(list, array, list, iteratee); + result = _.unionBy(list, list, array, list, iteratee); + result = _.unionBy(list, array, list, array, list, iteratee); + result = _.unionBy(list, list, array, list, array, list, iteratee); - result = _.unionBy(list, list, 'a'); - result = _.unionBy(list, array, list, 'a'); - result = _.unionBy(list, list, array, list, 'a'); - result = _.unionBy(list, array, list, array, list, 'a'); - result = _.unionBy(list, list, array, list, array, list, 'a'); + result = _.unionBy(list, list, 'a'); + result = _.unionBy(list, array, list, 'a'); + result = _.unionBy(list, list, array, list, 'a'); + result = _.unionBy(list, array, list, array, list, 'a'); + result = _.unionBy(list, list, array, list, array, list, 'a'); result = _.unionBy(list, list, {a: 1}); result = _.unionBy(list, array, list, {a: 1}); result = _.unionBy(list, list, array, list, {a: 1}); result = _.unionBy(list, array, list, array, list, {a: 1}); - result = _.unionBy(list, array, list, array, list, array, {a: 1}); + result = _.unionBy(list, array, list, array, list, array, {a: 1}); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; - result = _(array).unionBy(array); - result = _(array).unionBy(list, array); - result = _(array).unionBy(array, list, array); - result = _(array).unionBy(list, array, list, array); - result = _(array).unionBy(array, list, array, list, array); + result = _(array).unionBy(array); + result = _(array).unionBy(list, array); + result = _(array).unionBy(array, list, array); + result = _(array).unionBy(list, array, list, array); + result = _(array).unionBy(array, list, array, list, array); - result = _(array).unionBy(array, iteratee); - result = _(array).unionBy(list, array, iteratee); - result = _(array).unionBy(array, list, array, iteratee); - result = _(array).unionBy(list, array, list, array, iteratee); - result = _(array).unionBy(array, list, array, list, array, iteratee); + result = _(array).unionBy(array, iteratee); + result = _(array).unionBy(list, array, iteratee); + result = _(array).unionBy(array, list, array, iteratee); + result = _(array).unionBy(list, array, list, array, iteratee); + result = _(array).unionBy(array, list, array, list, array, iteratee); - result = _(array).unionBy(array, 'a'); - result = _(array).unionBy(list, array, 'a'); - result = _(array).unionBy(array, list, array, 'a'); - result = _(array).unionBy(list, array, list, array, 'a'); - result = _(array).unionBy(array, list, array, list, array, 'a'); + result = _(array).unionBy(array, 'a'); + result = _(array).unionBy(list, array, 'a'); + result = _(array).unionBy(array, list, array, 'a'); + result = _(array).unionBy(list, array, list, array, 'a'); + result = _(array).unionBy(array, list, array, list, array, 'a'); result = _(array).unionBy(array, {a: 1}); result = _(array).unionBy(list, array, {a: 1}); result = _(array).unionBy(array, list, array, {a: 1}); result = _(array).unionBy(list, array, list, array, {a: 1}); - result = _(array).unionBy(list, array, list, array, list, {a: 1}); + result = _(array).unionBy(list, array, list, array, list, {a: 1}); - result = _(list).unionBy(list); - result = _(list).unionBy(array, list); - result = _(list).unionBy(list, array, list); - result = _(list).unionBy(array, list, array, list); - result = _(list).unionBy(list, array, list, array, list); + result = _(list).unionBy(list); + result = _(list).unionBy(array, list); + result = _(list).unionBy(list, array, list); + result = _(list).unionBy(array, list, array, list); + result = _(list).unionBy(list, array, list, array, list); - result = _(list).unionBy(list, iteratee); - result = _(list).unionBy(array, list, iteratee); - result = _(list).unionBy(list, array, list, iteratee); - result = _(list).unionBy(array, list, array, list, iteratee); - result = _(list).unionBy(list, array, list, array, list, iteratee); + result = _(list).unionBy(list, iteratee); + result = _(list).unionBy(array, list, iteratee); + result = _(list).unionBy(list, array, list, iteratee); + result = _(list).unionBy(array, list, array, list, iteratee); + result = _(list).unionBy(list, array, list, array, list, iteratee); - result = _(list).unionBy(list, 'a'); - result = _(list).unionBy(array, list, 'a'); - result = _(list).unionBy(list, array, list, 'a'); - result = _(list).unionBy(array, list, array, list, 'a'); - result = _(list).unionBy(list, array, list, array, list, 'a'); + result = _(list).unionBy(list, 'a'); + result = _(list).unionBy(array, list, 'a'); + result = _(list).unionBy(list, array, list, 'a'); + result = _(list).unionBy(array, list, array, list, 'a'); + result = _(list).unionBy(list, array, list, array, list, 'a'); result = _(list).unionBy(list, {a: 1}); result = _(list).unionBy(array, list, {a: 1}); result = _(list).unionBy(list, array, list, {a: 1}); result = _(list).unionBy(array, list, array, list, {a: 1}); - result = _(list).unionBy(array, list, array, list, array, {a: 1}); + result = _(list).unionBy(array, list, array, list, array, {a: 1}); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; - result = _(array).chain().unionBy(array); - result = _(array).chain().unionBy(list, array); - result = _(array).chain().unionBy(array, list, array); - result = _(array).chain().unionBy(list, array, list, array); - result = _(array).chain().unionBy(array, list, array, list, array); + result = _(array).chain().unionBy(array); + result = _(array).chain().unionBy(list, array); + result = _(array).chain().unionBy(array, list, array); + result = _(array).chain().unionBy(list, array, list, array); + result = _(array).chain().unionBy(array, list, array, list, array); - result = _(array).chain().unionBy(array, iteratee); - result = _(array).chain().unionBy(list, array, iteratee); - result = _(array).chain().unionBy(array, list, array, iteratee); - result = _(array).chain().unionBy(list, array, list, array, iteratee); - result = _(array).chain().unionBy(array, list, array, list, array, iteratee); + result = _(array).chain().unionBy(array, iteratee); + result = _(array).chain().unionBy(list, array, iteratee); + result = _(array).chain().unionBy(array, list, array, iteratee); + result = _(array).chain().unionBy(list, array, list, array, iteratee); + result = _(array).chain().unionBy(array, list, array, list, array, iteratee); - result = _(array).chain().unionBy(array, 'a'); - result = _(array).chain().unionBy(list, array, 'a'); - result = _(array).chain().unionBy(array, list, array, 'a'); - result = _(array).chain().unionBy(list, array, list, array, 'a'); - result = _(array).chain().unionBy(array, list, array, list, array, 'a'); + result = _(array).chain().unionBy(array, 'a'); + result = _(array).chain().unionBy(list, array, 'a'); + result = _(array).chain().unionBy(array, list, array, 'a'); + result = _(array).chain().unionBy(list, array, list, array, 'a'); + result = _(array).chain().unionBy(array, list, array, list, array, 'a'); result = _(array).chain().unionBy(array, {a: 1}); result = _(array).chain().unionBy(list, array, {a: 1}); result = _(array).chain().unionBy(array, list, array, {a: 1}); result = _(array).chain().unionBy(list, array, list, array, {a: 1}); - result = _(array).chain().unionBy(list, array, list, array, list, {a: 1}); + result = _(array).chain().unionBy(list, array, list, array, list, {a: 1}); - result = _(list).chain().unionBy(list); - result = _(list).chain().unionBy(array, list); - result = _(list).chain().unionBy(list, array, list); - result = _(list).chain().unionBy(array, list, array, list); - result = _(list).chain().unionBy(list, array, list, array, list); + result = _(list).chain().unionBy(list); + result = _(list).chain().unionBy(array, list); + result = _(list).chain().unionBy(list, array, list); + result = _(list).chain().unionBy(array, list, array, list); + result = _(list).chain().unionBy(list, array, list, array, list); - result = _(list).chain().unionBy(list, iteratee); - result = _(list).chain().unionBy(array, list, iteratee); - result = _(list).chain().unionBy(list, array, list, iteratee); - result = _(list).chain().unionBy(array, list, array, list, iteratee); - result = _(list).chain().unionBy(list, array, list, array, list, iteratee); + result = _(list).chain().unionBy(list, iteratee); + result = _(list).chain().unionBy(array, list, iteratee); + result = _(list).chain().unionBy(list, array, list, iteratee); + result = _(list).chain().unionBy(array, list, array, list, iteratee); + result = _(list).chain().unionBy(list, array, list, array, list, iteratee); - result = _(list).chain().unionBy(list, 'a'); - result = _(list).chain().unionBy(array, list, 'a'); - result = _(list).chain().unionBy(list, array, list, 'a'); - result = _(list).chain().unionBy(array, list, array, list, 'a'); - result = _(list).chain().unionBy(list, array, list, array, list, 'a'); + result = _(list).chain().unionBy(list, 'a'); + result = _(list).chain().unionBy(array, list, 'a'); + result = _(list).chain().unionBy(list, array, list, 'a'); + result = _(list).chain().unionBy(array, list, array, list, 'a'); + result = _(list).chain().unionBy(list, array, list, array, list, 'a'); result = _(list).chain().unionBy(list, {a: 1}); result = _(list).chain().unionBy(array, list, {a: 1}); result = _(list).chain().unionBy(list, array, list, {a: 1}); result = _(list).chain().unionBy(array, list, array, list, {a: 1}); - result = _(list).chain().unionBy(array, list, array, list, array, {a: 1}); + result = _(list).chain().unionBy(array, list, array, list, array, {a: 1}); } } @@ -3035,32 +3008,32 @@ namespace TestUnzip { 2: {0: true, 1: false, length: 2}, length: 3 }; - let nilArray: TResult[][] | null | undefined = [] as any; - let nilList: _.List<_.List> | null | undefined = [] as any; + let nilArray: AbcObject[][] | null | undefined = [] as any; + let nilList: _.List<_.List> | null | undefined = [] as any; { - let result: TResult[][]; + let result: AbcObject[][]; result = _.unzip(nilArray); result = _.unzip(nilList); } { - let result: (string|number|boolean)[][]; + let result: Array>; result = _.unzip(array); result = _.unzip(list); } { - let result: _.LoDashImplicitArrayWrapper<(string|number|boolean)[]>; + let result: _.LoDashImplicitArrayWrapper>; result = _(array).unzip(); result = _(list).unzip(); } { - let result: _.LoDashExplicitArrayWrapper<(string|number|boolean)[]>; + let result: _.LoDashExplicitArrayWrapper>; result = _(array).chain().unzip(); result = _(list).chain().unzip(); @@ -3082,47 +3055,47 @@ namespace TestUnzip { } { - let result: TResult[]; + let result: AbcObject[]; result = _.unzipWith(testUnzipWithArray, (...group) => { group; // $ExpectType number[] - return any as TResult; + return anything as AbcObject; }); result = _.unzipWith(testUnzipWithArray, (value1, value2, value3) => { value1; // $ExpectType number value2; // $ExpectType number value3; // $ExpectType number - return any as TResult; + return anything as AbcObject; }); result = _.unzipWith(testUnzipWithList, (...group) => { group; // $ExpectType number[] - return any as TResult; + return anything as AbcObject; }); result = _.unzipWith(testUnzipWithList, (value1, value2, value3) => { value1; // $ExpectType number value2; // $ExpectType number value3; // $ExpectType number - return any as TResult; + return anything as AbcObject; }); - result = _(testUnzipWithArray).unzipWith((...group): TResult => { + result = _(testUnzipWithArray).unzipWith((...group): AbcObject => { group; // $ExpectType number[] - return any as TResult; + return anything as AbcObject; }).value(); result = _(testUnzipWithArray).unzipWith((value1, value2, value3) => { value1; // $ExpectType number value2; // $ExpectType number value3; // $ExpectType number - return any as TResult; + return anything as AbcObject; }).value(); - result = _(testUnzipWithList).unzipWith((...group): TResult => { + result = _(testUnzipWithList).unzipWith((...group): AbcObject => { group; // $ExpectType number[] - return any as TResult; + return anything as AbcObject; }).value(); result = _(testUnzipWithList).unzipWith((value1, value2, value3) => { value1; // $ExpectType number value2; // $ExpectType number value3; // $ExpectType number - return any as TResult; + return anything as AbcObject; }).value(); } } @@ -3176,83 +3149,100 @@ namespace TestWithout { // _.xor namespace TestXor { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.xor(); + result = _.xor(); - result = _.xor(array); - result = _.xor(array, list); - result = _.xor(array, list, array); + result = _.xor(array); + result = _.xor(array, list); + result = _.xor(array, list, array); - result = _.xor(list); - result = _.xor(list, array); - result = _.xor(list, array, list); + result = _.xor(list); + result = _.xor(list, array); + result = _.xor(list, array, list); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).xor(); result = _(array).xor(list); result = _(array).xor(list, array); - result = _(list).xor(); - result = _(list).xor(array); - result = _(list).xor(array, list); + result = _(list).xor(); + result = _(list).xor(array); + result = _(list).xor(array, list); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().xor(); result = _(array).chain().xor(list); result = _(array).chain().xor(list, array); - result = _(list).chain().xor(); - result = _(list).chain().xor(array); - result = _(list).chain().xor(array, list); + result = _(list).chain().xor(); + result = _(list).chain().xor(array); + result = _(list).chain().xor(array, list); } } // _.zip -namespace TestZip { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; +{ + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[][]; + // $ExpectType (AbcObject | undefined)[][] + _.zip(array); + // $ExpectType (AbcObject | undefined)[][] + _.zip(array, list); + // $ExpectType (AbcObject | undefined)[][] + _.zip(array, list, array); - result = _.zip(array); - result = _.zip(array, list); - result = _.zip(array, list, array); + // $ExpectType (AbcObject | undefined)[][] + _.zip(list); + // $ExpectType (AbcObject | undefined)[][] + _.zip(list, array); + // $ExpectType (AbcObject | undefined)[][] + _.zip(list, array, list); - result = _.zip(list); - result = _.zip(list, array); - result = _.zip(list, array, list); + // $ExpectType (AbcObject | undefined)[][] + _.zip(list, array, list, array, list, array); } { - let result: _.LoDashImplicitArrayWrapper; + // $ExpectType LoDashImplicitWrapper<(AbcObject | undefined)[][]> + _(array).zip(list); + // $ExpectType LoDashImplicitWrapper<(AbcObject | undefined)[][]> + _(array).zip(list, array); - result = _(array).zip(list); - result = _(array).zip(list, array); - - result = _(list).zip(array); - result = _(list).zip(array, list); + // $ExpectType LoDashImplicitWrapper<(AbcObject | undefined)[][]> + _(list).zip(array); + // $ExpectType LoDashImplicitWrapper<(AbcObject | undefined)[][]> + _(list).zip(array, list); } { - let result: _.LoDashExplicitArrayWrapper; + // $ExpectType LoDashExplicitWrapper<(AbcObject | undefined)[][]> + _(array).chain().zip(list); + // $ExpectType LoDashExplicitWrapper<(AbcObject | undefined)[][]> + _(array).chain().zip(list, array); - result = _(array).chain().zip(list); - result = _(array).chain().zip(list, array); + // $ExpectType LoDashExplicitWrapper<(AbcObject | undefined)[][]> + _(list).chain().zip(array); + // $ExpectType LoDashExplicitWrapper<(AbcObject | undefined)[][]> + _(list).chain().zip(array, list); + } - result = _(list).chain().zip(array); - result = _(list).chain().zip(array, list); + { + _.zip([1, 2], [3, 4]); // $ExpectType [number | undefined, number | undefined][] + _.zip([1, 2], ["a", "b"]); // $ExpectType [number | undefined, string | undefined][] + _.zip([1, 2], ["a", "b"], [true, false]); // $ExpectType [number | undefined, string | undefined, boolean | undefined][] } } @@ -3386,18 +3376,9 @@ namespace TestZipObject { } // _.zipWith -namespace TestZipWith { +{ type TestZipWithFn = (a1: number, a2: number) => number; - { - let result: number[][]; - result = _.zipWith([1, 2]); - result = _.zipWith([1, 2], [3, 4], [5, 6]); - result = _([1, 2]).zipWith().value(); - result = _([1, 2]).zipWith([3, 4], [5, 6]).value(); - result = _.chain([1, 2]).zipWith().value(); - result = _.chain([1, 2]).zipWith([3, 4], [5, 6]).value(); - } { let result: number[]; @@ -3538,6 +3519,19 @@ namespace TestZipWith { group; // $ExpectType number[] return 1; }).value(); + + result = _([1, 2]).zipWith(["a", "b"], (value1, value2) => { + value1; // $ExpectType number + value2; // $ExpectType string + return 1; + }).value(); + + result = _([1, 2]).zipWith(["a", "b"], [true, false], (value1, value2, value3) => { + value1; // $ExpectType number + value2; // $ExpectType string + value3; // $ExpectType boolean + return 1; + }).value(); } } @@ -3666,9 +3660,7 @@ namespace TestTap { // _.thru namespace TestThru { - interface Interceptor { - (value: T): T; - } + type Interceptor = (value: T) => T; { let interceptor: Interceptor = (x) => x; @@ -3783,139 +3775,137 @@ namespace TestCommit { // _.prototype.concat namespace TestConcat { - { - let result: _.LoDashImplicitArrayWrapper; + const numberROA: ReadonlyArray = [0]; - result = _(1).concat(2); - result = _(1).concat(2, 3); - result = _(1).concat(2, 3, 4); + _.concat(1); // $ExpectType number[] + _.concat([1]); // $ExpectType number[] + _.concat(numberROA); // $ExpectType number[] + _.concat(1, 2); // $ExpectType number[] + _.concat(1, [1]); // $ExpectType number[] + _.concat(1, [1], numberROA); // $ExpectType number[] - result = _(1).concat(2); - result = _(1).concat(2, 3); - result = _(1).concat(2, 3, 4); - } + _(1).concat(2); // $ExpectType LoDashImplicitWrapper + _(1).concat([1]); // $ExpectType LoDashImplicitWrapper + _(1).concat([2], numberROA); // $ExpectType LoDashImplicitWrapper + _([1]).concat(2); // $ExpectType LoDashImplicitWrapper + _(numberROA).concat(numberROA); // $ExpectType LoDashImplicitWrapper + _(numberROA).concat(numberROA, numberROA); // $ExpectType LoDashImplicitWrapper - { - let result: _.LoDashImplicitArrayWrapper; + _.chain(1).concat(2); // $ExpectType LoDashExplicitWrapper + _.chain(1).concat([1]); // $ExpectType LoDashExplicitWrapper + _.chain(1).concat([2], numberROA); // $ExpectType LoDashExplicitWrapper + _.chain([1]).concat(2); // $ExpectType LoDashExplicitWrapper + _.chain(numberROA).concat(numberROA); // $ExpectType LoDashExplicitWrapper + _.chain(numberROA).concat(numberROA, numberROA); // $ExpectType LoDashExplicitWrapper - result = _(['']).concat(['']); - result = _(['']).concat([''], ['']); - result = _(['']).concat([''], [''], ['']); + const stringROA: ReadonlyArray = ['']; - result = _(['']).concat(['']); - result = _(['']).concat([''], ['']); - result = _(['']).concat([''], [''], ['']); - } + _.concat('a'); // $ExpectType string[] + _.concat(['a']); // $ExpectType string[] + _.concat(stringROA); // $ExpectType string[] + _.concat('a', 'b'); // $ExpectType string[] + _.concat('a', ['a']); // $ExpectType string[] + _.concat('a', ['a'], stringROA); // $ExpectType string[] - { - let result: _.LoDashImplicitArrayWrapper<{a: string}>; + _('a').concat('b'); // $ExpectType LoDashImplicitWrapper + _('a').concat(['a']); // $ExpectType LoDashImplicitWrapper + _('a').concat(['b'], stringROA); // $ExpectType LoDashImplicitWrapper + _(['a']).concat('b'); // $ExpectType LoDashImplicitWrapper + _(stringROA).concat(stringROA); // $ExpectType LoDashImplicitWrapper + _(stringROA).concat(stringROA, stringROA); // $ExpectType LoDashImplicitWrapper - result = _({a: ''}).concat<{a: string}>({a: ''}); - result = _({a: ''}).concat<{a: string}>({a: ''}, {a: ''}); - result = _({a: ''}).concat<{a: string}>({a: ''}, {a: ''}, {a: ''}); + _.chain('a').concat('b'); // $ExpectType LoDashExplicitWrapper + _.chain('a').concat(['a']); // $ExpectType LoDashExplicitWrapper + _.chain('a').concat(['b'], stringROA); // $ExpectType LoDashExplicitWrapper + _.chain(['a']).concat('b'); // $ExpectType LoDashExplicitWrapper + _.chain(stringROA).concat(stringROA); // $ExpectType LoDashExplicitWrapper + _.chain(stringROA).concat(stringROA, stringROA); // $ExpectType LoDashExplicitWrapper - result = _({a: ''}).concat({a: ''}); - result = _({a: ''}).concat({a: ''}, {a: ''}); - result = _({a: ''}).concat({a: ''}, {a: ''}, {a: ''}); - } + const abcObject: AbcObject = { a: 1, b: 'foo', c: true }; + const objectROA: ReadonlyArray = [{ a: 1, b: 'foo', c: true }]; - { - let result: _.LoDashExplicitArrayWrapper; + _.concat(abcObject); // $ExpectType AbcObject[] + _.concat([abcObject]); // $ExpectType AbcObject[] + _.concat(objectROA); // $ExpectType AbcObject[] + _.concat(abcObject, abcObject); // $ExpectType AbcObject[] + _.concat(abcObject, [abcObject]); // $ExpectType AbcObject[] + _.concat(abcObject, [abcObject], objectROA); // $ExpectType AbcObject[] - result = _(1).chain().concat(2); - result = _(1).chain().concat(2, 3); - result = _(1).chain().concat(2, 3, 4); + _(abcObject).concat(abcObject); // $ExpectType LoDashImplicitWrapper + _(abcObject).concat([abcObject]); // $ExpectType LoDashImplicitWrapper + _(abcObject).concat([abcObject], objectROA); // $ExpectType LoDashImplicitWrapper + _([abcObject]).concat(abcObject); // $ExpectType LoDashImplicitWrapper + _(objectROA).concat(objectROA); // $ExpectType LoDashImplicitWrapper + _(objectROA).concat(objectROA, objectROA); // $ExpectType LoDashImplicitWrapper - result = _(1).chain().concat(2); - result = _(1).chain().concat(2, 3); - result = _(1).chain().concat(2, 3, 4); - } - - { - let result: _.LoDashExplicitArrayWrapper; - - result = _(['']).chain().concat(['']); - result = _(['']).chain().concat([''], ['']); - result = _(['']).chain().concat([''], [''], ['']); - - result = _(['']).chain().concat(['']); - result = _(['']).chain().concat([''], ['']); - result = _(['']).chain().concat([''], [''], ['']); - } - - { - let result: _.LoDashExplicitArrayWrapper<{a: string}>; - - result = _({a: ''}).chain().concat<{a: string}>({a: ''}); - result = _({a: ''}).chain().concat<{a: string}>({a: ''}, {a: ''}); - result = _({a: ''}).chain().concat<{a: string}>({a: ''}, {a: ''}, {a: ''}); - - result = _({a: ''}).chain().concat({a: ''}); - result = _({a: ''}).chain().concat({a: ''}, {a: ''}); - result = _({a: ''}).chain().concat({a: ''}, {a: ''}, {a: ''}); - } + _.chain(abcObject).concat(abcObject); // $ExpectType LoDashExplicitWrapper + _.chain(abcObject).concat([abcObject]); // $ExpectType LoDashExplicitWrapper + _.chain(abcObject).concat([abcObject], objectROA); // $ExpectType LoDashExplicitWrapper + _.chain([abcObject]).concat(abcObject); // $ExpectType LoDashExplicitWrapper + _.chain(objectROA).concat(objectROA); // $ExpectType LoDashExplicitWrapper + _.chain(objectROA).concat(objectROA, objectROA); // $ExpectType LoDashExplicitWrapper } // _.prototype.plant namespace TestPlant { { let result: _.LoDashImplicitWrapper; - result = _(any).plant(42); + result = _(anything).plant(42); } { let result: _.LoDashImplicitStringWrapper; - result = _(any).plant(''); + result = _(anything).plant(''); } { let result: _.LoDashImplicitWrapper; - result = _(any).plant(true); + result = _(anything).plant(true); } { let result: _.LoDashImplicitNumberArrayWrapper; - result = _(any).plant([42]); + result = _(anything).plant([42]); } { let result: _.LoDashImplicitArrayWrapper; - result = _(any).plant([]); + result = _(anything).plant([]); } { let result: _.LoDashImplicitWrapper<{}>; - result = _(any).plant<{}>({}); + result = _(anything).plant<{}>({}); } { let result: _.LoDashExplicitWrapper; - result = _(any).chain().plant(42); + result = _(anything).chain().plant(42); } { let result: _.LoDashExplicitStringWrapper; - result = _(any).chain().plant(''); + result = _(anything).chain().plant(''); } { let result: _.LoDashExplicitWrapper; - result = _(any).chain().plant(true); + result = _(anything).chain().plant(true); } { let result: _.LoDashExplicitNumberArrayWrapper; - result = _(any).chain().plant([42]); + result = _(anything).chain().plant([42]); } { let result: _.LoDashExplicitArrayWrapper; - result = _(any).chain().plant([]); + result = _(anything).chain().plant([]); } { let result: _.LoDashExplicitWrapper<{}>; - result = _(any).chain().plant<{}>({}); + result = _(anything).chain().plant<{}>({}); } } @@ -4069,47 +4059,47 @@ namespace TestValueOf { // _.at namespace TestAt { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let dictionary: _.Dictionary | null | undefined = any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let dictionary: _.Dictionary | null | undefined = anything; { - let result: TResult[]; + let result: AbcObject[]; - result = _.at(array, 0, '1', [2], ['3'], [4, '5']); - result = _.at(list, 0, '1', [2], ['3'], [4, '5']); - result = _.at(dictionary, 0, '1', [2], ['3'], [4, '5']); + result = _.at(array, 0, '1', [2], ['3'], [4, '5']); + result = _.at(list, 0, '1', [2], ['3'], [4, '5']); + result = _.at(dictionary, 0, '1', [2], ['3'], [4, '5']); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).at(0, '1', [2], ['3'], [4, '5']); - result = _(list).at(0, '1', [2], ['3'], [4, '5']); - result = _(dictionary).at(0, '1', [2], ['3'], [4, '5']); + result = _(list).at(0, '1', [2], ['3'], [4, '5']); + result = _(dictionary).at(0, '1', [2], ['3'], [4, '5']); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().at(0, '1', [2], ['3'], [4, '5']); - result = _(list).chain().at(0, '1', [2], ['3'], [4, '5']); - result = _(dictionary).chain().at(0, '1', [2], ['3'], [4, '5']); + result = _(list).chain().at(0, '1', [2], ['3'], [4, '5']); + result = _(dictionary).chain().at(0, '1', [2], ['3'], [4, '5']); } } // _.countBy namespace TestCountBy { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let obj: any = {}; - let dictionary: _.Dictionary | null | undefined = obj; - let numericDictionary: _.NumericDictionary | null | undefined = obj; + let dictionary: _.Dictionary | null | undefined = obj; + let numericDictionary: _.NumericDictionary | null | undefined = obj; let stringIterator: (value: string, index: number, collection: string) => any = (value: string, index: number, collection: string) => 1; - let listIterator: (value: TResult, index: number, collection: _.List) => any = (value: TResult, index: number, collection: _.List) => 1; - let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any = (value: TResult, key: string, collection: _.Dictionary) => 1; - let numericDictionaryIterator: (value: TResult, key: number, collection: _.NumericDictionary) => any = (value: TResult, key: number, collection: _.NumericDictionary) => 1; + let listIterator: (value: AbcObject, index: number, collection: _.List) => any = (value: AbcObject, index: number, collection: _.List) => 1; + let dictionaryIterator: (value: AbcObject, key: string, collection: _.Dictionary) => any = (value: AbcObject, key: string, collection: _.Dictionary) => 1; + let numericDictionaryIterator: (value: AbcObject, key: number, collection: _.NumericDictionary) => any = (value: AbcObject, key: number, collection: _.NumericDictionary) => 1; { let result: _.Dictionary; @@ -4117,29 +4107,29 @@ namespace TestCountBy { result = _.countBy(''); result = _.countBy('', stringIterator); - result = _.countBy(array); - result = _.countBy(array, listIterator); - result = _.countBy(array, ''); + result = _.countBy(array); + result = _.countBy(array, listIterator); + result = _.countBy(array, ''); result = _.countBy(array, {a: 42}); - result = _.countBy(array, {a: 42}); + result = _.countBy(array, {a: 42}); - result = _.countBy(list); - result = _.countBy(list, listIterator); - result = _.countBy(list, ''); + result = _.countBy(list); + result = _.countBy(list, listIterator); + result = _.countBy(list, ''); result = _.countBy(list, {a: 42}); - result = _.countBy(list, {a: 42}); + result = _.countBy(list, {a: 42}); - result = _.countBy(dictionary); + result = _.countBy(dictionary); result = _.countBy(dictionary, dictionaryIterator); - result = _.countBy(dictionary, ''); + result = _.countBy(dictionary, ''); result = _.countBy(dictionary, {a: 42}); - result = _.countBy(dictionary, {a: 42}); + result = _.countBy(dictionary, {a: 42}); - result = _.countBy(numericDictionary); - result = _.countBy(numericDictionary, numericDictionaryIterator); - result = _.countBy(numericDictionary, ''); + result = _.countBy(numericDictionary); + result = _.countBy(numericDictionary, numericDictionaryIterator); + result = _.countBy(numericDictionary, ''); result = _.countBy(numericDictionary, {a: 42}); - result = _.countBy(numericDictionary, {a: 42}); + result = _.countBy(numericDictionary, {a: 42}); } { @@ -4155,7 +4145,7 @@ namespace TestCountBy { result = _(array).countBy({a: 42}); result = _(list).countBy(); - result = _(list).countBy(listIterator); + result = _(list).countBy(listIterator); result = _(list).countBy(''); result = _(list).countBy<{a: number}>({a: 42}); result = _(list).countBy({a: 42}); @@ -4167,7 +4157,7 @@ namespace TestCountBy { result = _(dictionary).countBy({a: 42}); result = _(numericDictionary).countBy(); - result = _(numericDictionary).countBy(numericDictionaryIterator); + result = _(numericDictionary).countBy(numericDictionaryIterator); result = _(numericDictionary).countBy(''); result = _(numericDictionary).countBy<{a: number}>({a: 42}); result = _(numericDictionary).countBy({a: 42}); @@ -4186,7 +4176,7 @@ namespace TestCountBy { result = _(array).chain().countBy({a: 42}); result = _(list).chain().countBy(); - result = _(list).chain().countBy(listIterator); + result = _(list).chain().countBy(listIterator); result = _(list).chain().countBy(''); result = _(list).chain().countBy<{a: number}>({a: 42}); result = _(list).chain().countBy({a: 42}); @@ -4198,7 +4188,7 @@ namespace TestCountBy { result = _(dictionary).chain().countBy({a: 42}); result = _(numericDictionary).chain().countBy(); - result = _(numericDictionary).chain().countBy(numericDictionaryIterator); + result = _(numericDictionary).chain().countBy(numericDictionaryIterator); result = _(numericDictionary).chain().countBy(''); result = _(numericDictionary).chain().countBy<{a: number}>({a: 42}); result = _(numericDictionary).chain().countBy({a: 42}); @@ -4207,16 +4197,16 @@ namespace TestCountBy { // _.each namespace TestEach { - let array: TResult[] = []; - let list: _.List = []; - let dictionary: _.Dictionary = {}; - let nilArray: TResult[] | null | undefined = [] as any; - let nilList: _.List | null | undefined = [] as any; - let nilDictionary: _.Dictionary | null | undefined = any; + let array: AbcObject[] = []; + let list: _.List = []; + let dictionary: _.Dictionary = {}; + let nilArray: AbcObject[] | null | undefined = [] as any; + let nilList: _.List | null | undefined = [] as any; + let nilDictionary: _.Dictionary | null | undefined = anything; let stringIterator: (char: string, index: number, string: string) => any = (char: string, index: number, string: string) => 1; - let listIterator: (value: TResult, index: number, collection: _.List) => any = (value: TResult, index: number, collection: _.List) => 1; - let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any = (value: TResult, key: string, collection: _.Dictionary) => 1; + let listIterator: (value: AbcObject, index: number, collection: _.List) => any = (value: AbcObject, index: number, collection: _.List) => 1; + let dictionaryIterator: (value: AbcObject, key: string, collection: _.Dictionary) => any = (value: AbcObject, key: string, collection: _.Dictionary) => 1; { let result: string; @@ -4231,37 +4221,37 @@ namespace TestEach { } { - let result: TResult[]; + let result: AbcObject[]; result = _.each(array, listIterator); } { - let result: TResult[] | null | undefined; + let result: AbcObject[] | null | undefined; result = _.each(nilArray, listIterator); } { - let result: _.List; + let result: _.List; result = _.each(list, listIterator); } { - let result: _.List | null | undefined; + let result: _.List | null | undefined; result = _.each(nilList, listIterator); } { - let result: _.Dictionary; + let result: _.Dictionary; result = _.each(dictionary, dictionaryIterator); } { - let result: _.Dictionary | null | undefined; + let result: _.Dictionary | null | undefined; result = _.each(nilDictionary, dictionaryIterator); } @@ -4273,19 +4263,19 @@ namespace TestEach { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).each(listIterator); } { - let result: _.LoDashImplicitObjectWrapper<_.List>; + let result: _.LoDashImplicitObjectWrapper<_.List>; - result = _(list).each(listIterator); + result = _(list).each(listIterator); } { - let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(dictionary).each(dictionaryIterator); } @@ -4297,19 +4287,19 @@ namespace TestEach { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().each(listIterator); } { - let result: _.LoDashExplicitObjectWrapper<_.List>; + let result: _.LoDashExplicitObjectWrapper<_.List>; - result = _(list).chain().each(listIterator); + result = _(list).chain().each(listIterator); } { - let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(dictionary).chain().each(dictionaryIterator); } @@ -4317,16 +4307,16 @@ namespace TestEach { // _.eachRight namespace TestEachRight { - let array: TResult[] = []; - let list: _.List = []; - let dictionary: _.Dictionary = {}; - let nilArray: TResult[] | null | undefined = [] as any; - let nilList: _.List | null | undefined = [] as any; - let nilDictionary: _.Dictionary | null | undefined = any; + let array: AbcObject[] = []; + let list: _.List = []; + let dictionary: _.Dictionary = {}; + let nilArray: AbcObject[] | null | undefined = [] as any; + let nilList: _.List | null | undefined = [] as any; + let nilDictionary: _.Dictionary | null | undefined = anything; let stringIterator: (char: string, index: number, string: string) => any = (char: string, index: number, string: string) => 1; - let listIterator: (value: TResult, index: number, collection: _.List) => any = (value: TResult, index: number, collection: _.List) => 1; - let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any = (value: TResult, key: string, collection: _.Dictionary) => 1; + let listIterator: (value: AbcObject, index: number, collection: _.List) => any = (value: AbcObject, index: number, collection: _.List) => 1; + let dictionaryIterator: (value: AbcObject, key: string, collection: _.Dictionary) => any = (value: AbcObject, key: string, collection: _.Dictionary) => 1; { let result: string; @@ -4341,37 +4331,37 @@ namespace TestEachRight { } { - let result: TResult[]; + let result: AbcObject[]; result = _.eachRight(array, listIterator); } { - let result: TResult[] | null | undefined; + let result: AbcObject[] | null | undefined; result = _.eachRight(nilArray, listIterator); } { - let result: _.List; + let result: _.List; result = _.eachRight(list, listIterator); } { - let result: _.List | null | undefined; + let result: _.List | null | undefined; result = _.eachRight(nilList, listIterator); } { - let result: _.Dictionary; + let result: _.Dictionary; result = _.eachRight(dictionary, dictionaryIterator); } { - let result: _.Dictionary | null | undefined; + let result: _.Dictionary | null | undefined; result = _.eachRight(nilDictionary, dictionaryIterator); } @@ -4383,19 +4373,19 @@ namespace TestEachRight { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).eachRight(listIterator); } { - let result: _.LoDashImplicitObjectWrapper<_.List>; + let result: _.LoDashImplicitObjectWrapper<_.List>; - result = _(list).eachRight(listIterator); + result = _(list).eachRight(listIterator); } { - let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(dictionary).eachRight(dictionaryIterator); } @@ -4407,19 +4397,19 @@ namespace TestEachRight { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().eachRight(listIterator); } { - let result: _.LoDashExplicitObjectWrapper<_.List>; + let result: _.LoDashExplicitObjectWrapper<_.List>; - result = _(list).chain().eachRight(listIterator); + result = _(list).chain().eachRight(listIterator); } { - let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(dictionary).chain().eachRight(dictionaryIterator); } @@ -4522,14 +4512,14 @@ namespace TestEvery { // _.filter namespace TestFilter { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let obj: any = {}; - let dictionary: _.Dictionary | null | undefined = obj; + let dictionary: _.Dictionary | null | undefined = obj; let stringIterator = (char: string, index: number, string: string) => true; - let listIterator = (value: TResult, index: number, collection: _.List) => true; - let dictionaryIterator = (value: TResult, key: string, collection: _.Dictionary) => true; + let listIterator = (value: AbcObject, index: number, collection: _.List) => true; + let dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => true; { let result: string[]; @@ -4538,17 +4528,17 @@ namespace TestFilter { } { - let result: TResult[]; + let result: AbcObject[]; - result = _.filter(array, listIterator); - result = _.filter(array, ''); - result = _.filter(array, {a: 42}); - result = _.filter(array, ["a", 42]); + result = _.filter(array, listIterator); + result = _.filter(array, ''); + result = _.filter(array, {a: 42}); + result = _.filter(array, ["a", 42]); - result = _.filter(list, listIterator); - result = _.filter(list, ''); - result = _.filter(list, {a: 42}); - result = _.filter(list, ["a", 42]); + result = _.filter(list, listIterator); + result = _.filter(list, ''); + result = _.filter(list, {a: 42}); + result = _.filter(list, ["a", 42]); result = _.filter(dictionary, dictionaryIterator); result = _.filter(dictionary, ''); @@ -4563,17 +4553,17 @@ namespace TestFilter { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).filter(listIterator); result = _(array).filter(''); result = _(array).filter({a: 42}); result = _(array).filter(["a", 42]); - result = _(list).filter(listIterator); - result = _(list).filter(''); - result = _(list).filter({a: 42}); - result = _(list).filter(["a", 42]); + result = _(list).filter(listIterator); + result = _(list).filter(''); + result = _(list).filter({a: 42}); + result = _(list).filter(["a", 42]); result = _(dictionary).filter(dictionaryIterator); result = _(dictionary).filter(''); @@ -4588,17 +4578,17 @@ namespace TestFilter { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().filter(listIterator); result = _(array).chain().filter(''); result = _(array).chain().filter({a: 42}); result = _(array).chain().filter(["a", 42]); - result = _(list).chain().filter(listIterator); - result = _(list).chain().filter(''); - result = _(list).chain().filter({a: 42}); - result = _(list).chain().filter(["a", 42]); + result = _(list).chain().filter(listIterator); + result = _(list).chain().filter(''); + result = _(list).chain().filter({a: 42}); + result = _(list).chain().filter(["a", 42]); result = _(dictionary).chain().filter(dictionaryIterator); result = _(dictionary).chain().filter(''); @@ -4608,8 +4598,8 @@ namespace TestFilter { { // Test filtering with type guard - let a2: Array | null | undefined = any; - let d2: _.Dictionary | null | undefined = any; + let a2: Array | null | undefined = anything; + let d2: _.Dictionary | null | undefined = anything; _.filter(a2, (item: string | number): item is number => typeof item === "number"); // $ExpectType number[] _.filter(d2, (item: string | number): item is number => typeof item === "number"); // $ExpectType number[] @@ -4622,35 +4612,35 @@ namespace TestFilter { // _.find namespace TestFind { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let obj: any = {}; - let dictionary: _.Dictionary | null | undefined = obj; + let dictionary: _.Dictionary | null | undefined = obj; - let listIterator = (value: TResult, index: number, collection: _.List) => true; - let dictionaryIterator = (value: TResult, key: string, collection: _.Dictionary) => true; + let listIterator = (value: AbcObject, index: number, collection: _.List) => true; + let dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => true; - let result: TResult | undefined; + let result: AbcObject | undefined; result = _.find(array); - result = _.find(array); - result = _.find(array, listIterator); - result = _.find(array, listIterator, 1); - result = _.find(array, ''); - result = _.find(array, '', 1); - result = _.find(array, {a: 42}); - result = _.find(array, {a: 42}, 1); + result = _.find(array); + result = _.find(array, listIterator); + result = _.find(array, listIterator, 1); + result = _.find(array, ''); + result = _.find(array, '', 1); + result = _.find(array, {a: 42}); + result = _.find(array, {a: 42}, 1); result = _.find(array, ['a', 5]); result = _.find(array, ['a', 5], 1); result = _.find(list); - result = _.find(list); - result = _.find(list, listIterator); - result = _.find(list, listIterator, 1); - result = _.find(list, ''); - result = _.find(list, '', 1); - result = _.find(list, {a: 42}); - result = _.find(list, {a: 42}, 1); + result = _.find(list); + result = _.find(list, listIterator); + result = _.find(list, listIterator, 1); + result = _.find(list, ''); + result = _.find(list, '', 1); + result = _.find(list, {a: 42}); + result = _.find(list, {a: 42}, 1); result = _.find(list, ['a', 5]); result = _.find(list, ['a', 5], 1); @@ -4675,15 +4665,15 @@ namespace TestFind { result = _(array).find(['a', 5]); result = _(array).find(['a', 5], 1); - result = _(list).find(); - result = _(list).find(listIterator); - result = _(list).find(listIterator, 1); - result = _(list).find(''); - result = _(list).find('', 1); - result = _(list).find({a: 42}); - result = _(list).find({a: 42}, 1); - result = _(list).find(['a', 5]); - result = _(list).find(['a', 5], 1); + result = _(list).find(); + result = _(list).find(listIterator); + result = _(list).find(listIterator, 1); + result = _(list).find(''); + result = _(list).find('', 1); + result = _(list).find({a: 42}); + result = _(list).find({a: 42}, 1); + result = _(list).find(['a', 5]); + result = _(list).find(['a', 5], 1); result = _(dictionary).find(); result = _(dictionary).find(dictionaryIterator); @@ -4695,41 +4685,41 @@ namespace TestFind { result = _(dictionary).find(['a', 5]); result = _(dictionary).find(['a', 5], 1); - result = _.find([any as TResult, null, undefined], (value: TResult | null | undefined): value is TResult | undefined => value !== null); - result = _([any as TResult, null, undefined]).find((value: TResult | null | undefined): value is TResult | undefined => value !== null); + result = _.find([anything as AbcObject, null, undefined], (value: AbcObject | null | undefined): value is AbcObject | undefined => value !== null); + result = _([anything as AbcObject, null, undefined]).find((value: AbcObject | null | undefined): value is AbcObject | undefined => value !== null); } // _.findLast namespace TestFindLast { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let obj: any = {}; - let dictionary: _.Dictionary | null | undefined = obj; + let dictionary: _.Dictionary | null | undefined = obj; - let listIterator = (value: TResult, index: number, collection: _.List) => true; - let dictionaryIterator = (value: TResult, key: string, collection: _.Dictionary) => true; + let listIterator = (value: AbcObject, index: number, collection: _.List) => true; + let dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => true; - let result: TResult | undefined; + let result: AbcObject | undefined; result = _.findLast(array); - result = _.findLast(array); - result = _.findLast(array, listIterator); - result = _.findLast(array, listIterator, 1); - result = _.findLast(array, ''); - result = _.findLast(array, '', 1); - result = _.findLast(array, {a: 42}); - result = _.findLast(array, {a: 42}, 1); + result = _.findLast(array); + result = _.findLast(array, listIterator); + result = _.findLast(array, listIterator, 1); + result = _.findLast(array, ''); + result = _.findLast(array, '', 1); + result = _.findLast(array, {a: 42}); + result = _.findLast(array, {a: 42}, 1); result = _.findLast(array, ['a', 5]); result = _.findLast(array, ['a', 5], 1); result = _.findLast(list); - result = _.findLast(list); - result = _.findLast(list, listIterator); - result = _.findLast(list, listIterator, 1); - result = _.findLast(list, ''); - result = _.findLast(list, '', 1); - result = _.findLast(list, {a: 42}); - result = _.findLast(list, {a: 42}, 1); + result = _.findLast(list); + result = _.findLast(list, listIterator); + result = _.findLast(list, listIterator, 1); + result = _.findLast(list, ''); + result = _.findLast(list, '', 1); + result = _.findLast(list, {a: 42}); + result = _.findLast(list, {a: 42}, 1); result = _.findLast(list, ['a', 5]); result = _.findLast(list, ['a', 5], 1); @@ -4754,15 +4744,15 @@ namespace TestFindLast { result = _(array).findLast(['a', 5]); result = _(array).findLast(['a', 5], 1); - result = _(list).findLast(); - result = _(list).findLast(listIterator); - result = _(list).findLast(listIterator, 1); - result = _(list).findLast(''); - result = _(list).findLast('', 1); - result = _(list).findLast({a: 42}); - result = _(list).findLast({a: 42}, 1); - result = _(list).findLast(['a', 5]); - result = _(list).findLast(['a', 5], 1); + result = _(list).findLast(); + result = _(list).findLast(listIterator); + result = _(list).findLast(listIterator, 1); + result = _(list).findLast(''); + result = _(list).findLast('', 1); + result = _(list).findLast({a: 42}); + result = _(list).findLast({a: 42}, 1); + result = _(list).findLast(['a', 5]); + result = _(list).findLast(['a', 5], 1); result = _(dictionary).findLast(); result = _(dictionary).findLast(dictionaryIterator); @@ -4774,24 +4764,24 @@ namespace TestFindLast { result = _(dictionary).findLast(['a', 5]); result = _(dictionary).findLast(['a', 5], 1); - result = _.findLast([any as TResult, null, undefined], (value: TResult | null | undefined): value is TResult | undefined => value !== null); - result = _([any as TResult, null, undefined]).findLast((value: TResult | null | undefined): value is TResult | undefined => value !== null); + result = _.findLast([anything as AbcObject, null, undefined], (value: AbcObject | null | undefined): value is AbcObject | undefined => value !== null); + result = _([anything as AbcObject, null, undefined]).findLast((value: AbcObject | null | undefined): value is AbcObject | undefined => value !== null); } // _.flatMap namespace TestFlatMap { - let numArray: (number|number[])[] | null | undefined = [1, [2, 3]] as any; - let objArray: ({a: number}|{a: number}[])[] | null | undefined = [{a: 1}, [{a: 2}, {a: 3}]] as any; + let numArray: Array | null | undefined = [1, [2, 3]] as any; + let objArray: Array<{a: number}|Array<{a: number}>> | null | undefined = [{a: 1}, [{a: 2}, {a: 3}]] as any; let obj: any = {}; let numList: _.List | null | undefined = obj; - let objList: _.List<{a: number}|{a: number}[]> | null | undefined = obj; + let objList: _.List<{a: number}|Array<{a: number}>> | null | undefined = obj; let numDictionary: _.Dictionary | null | undefined = obj; - let objDictionary: _.Dictionary<{a: number}|{a: number}[]> | null | undefined = obj; + let objDictionary: _.Dictionary<{a: number}|Array<{a: number}>> | null | undefined = obj; let numNumericDictionary: _.NumericDictionary | null | undefined = obj; - let objNumericDictionary: _.NumericDictionary<{a: number}|{a: number}[]> | null | undefined = obj; + let objNumericDictionary: _.NumericDictionary<{a: number}|Array<{a: number}>> | null | undefined = obj; let stringIterator: (value: string, index: number, collection: _.List) => string|string[] = (a, b, c) => ""; @@ -4964,18 +4954,17 @@ namespace TestFlatMap { // _.flatMapDeep namespace TestFlatMapDeep { - let numArray: (number|number[])[] | null | undefined = [1, [2, 3]] as any; - let objArray: ({a: number}|{a: number}[])[] | null | undefined = [{a: 1}, [{a: 2}, {a: 3}]] as any; + let numArray: Array | null | undefined = [1, [2, 3]] as any; + let objArray: Array<{a: number}|Array<{a: number}>> | null | undefined = [{a: 1}, [{a: 2}, {a: 3}]] as any; - let obj: any = {}; - let numList: _.List | null | undefined = obj; - let objList: _.List<{a: number}|{a: number}[]> | null | undefined = obj; + let numList: _.List | null | undefined = anything; + let objList: _.List<{a: number}|Array<{a: number}>> | null | undefined = anything; - let numDictionary: _.Dictionary | null | undefined = obj; - let objDictionary: _.Dictionary<{a: number}|{a: number}[]> | null | undefined = obj; + let numDictionary: _.Dictionary | null | undefined = anything; + let objDictionary: _.Dictionary<{a: number}|Array<{a: number}>> | null | undefined = anything; - let numNumericDictionary: _.NumericDictionary | null | undefined = obj; - let objNumericDictionary: _.NumericDictionary<{a: number}|{a: number}[]> | null | undefined = obj; + let numNumericDictionary: _.NumericDictionary | null | undefined = anything; + let objNumericDictionary: _.NumericDictionary<{a: number}|Array<{a: number}>> | null | undefined = anything; let stringIterator: (value: string, index: number, collection: _.List) => _.ListOfRecursiveArraysOrValues = (a, b, c) => ['a', 'b', 'c']; @@ -5126,18 +5115,17 @@ namespace TestFlatMapDeep { // _.flatMapDepth namespace TestFlatMapDepth { - let numArray: (number|number[])[] | null | undefined = [1, [2, 3]] as any; - let objArray: ({a: number}|{a: number}[])[] | null | undefined = [{a: 1}, [{a: 2}, {a: 3}]] as any; + let numArray: Array | null | undefined = [1, [2, 3]] as any; + let objArray: Array<{a: number}|Array<{a: number}>> | null | undefined = [{a: 1}, [{a: 2}, {a: 3}]] as any; - let obj: any = {}; - let numList: _.List | null | undefined = obj; - let objList: _.List<{a: number}|{a: number}[]> | null | undefined = obj; + let numList: _.List | null | undefined = anything; + let objList: _.List<{a: number}|Array<{a: number}>> | null | undefined = anything; - let numDictionary: _.Dictionary | null | undefined = obj; - let objDictionary: _.Dictionary<{a: number}|{a: number}[]> | null | undefined = obj; + let numDictionary: _.Dictionary | null | undefined = anything; + let objDictionary: _.Dictionary<{a: number}|Array<{a: number}>> | null | undefined = anything; - let numNumericDictionary: _.NumericDictionary | null | undefined = obj; - let objNumericDictionary: _.NumericDictionary<{a: number}|{a: number}[]> | null | undefined = obj; + let numNumericDictionary: _.NumericDictionary | null | undefined = anything; + let objNumericDictionary: _.NumericDictionary<{a: number}|Array<{a: number}>> | null | undefined = anything; let stringIterator: (value: string, index: number, collection: _.List) => _.ListOfRecursiveArraysOrValues = (a, b, c) => ""; @@ -5288,16 +5276,16 @@ namespace TestFlatMapDepth { // _.forEach namespace TestForEach { - let array: TResult[] = []; - let list: _.List = []; - let dictionary: _.Dictionary = {}; - let nilArray: TResult[] | null | undefined = [] as any; - let nilList: _.List | null | undefined = [] as any; - let nilDictionary: _.Dictionary | null | undefined = any; + let array: AbcObject[] = []; + let list: _.List = []; + let dictionary: _.Dictionary = {}; + let nilArray: AbcObject[] | null | undefined = [] as any; + let nilList: _.List | null | undefined = [] as any; + let nilDictionary: _.Dictionary | null | undefined = anything; - let listIterator: (value: TResult, index: number, collection: _.List) => any = (value, index, collection) => 1; - let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any = (value, key, collection) => 1; - let objectIterator: (value: number | string | boolean, key: string, collection: TResult) => any = (value, key, collection) => 1; + let listIterator: (value: AbcObject, index: number, collection: _.List) => any = (value, index, collection) => 1; + let dictionaryIterator: (value: AbcObject, key: string, collection: _.Dictionary) => any = (value, key, collection) => 1; + let objectIterator: (value: number | string | boolean, key: string, collection: AbcObject) => any = (value, key, collection) => 1; { let result: string; @@ -5320,77 +5308,77 @@ namespace TestForEach { } { - let result: TResult[]; - result = _.forEach(array, (value, index, collection: ArrayLike) => { - value; // $ExpectType TResult + let result: AbcObject[]; + result = _.forEach(array, (value, index, collection: ArrayLike) => { + value; // $ExpectType AbcObject index; // $ExpectType number }); result = _.forEach(array, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: TResult[] | null | undefined; + let result: AbcObject[] | null | undefined; - result = _.forEach(array, (value, index, collection: ArrayLike) => { - value; // $ExpectType TResult + result = _.forEach(array, (value, index, collection: ArrayLike) => { + value; // $ExpectType AbcObject index; // $ExpectType number }); result = _.forEach(nilArray, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.List; + let result: _.List; result = _.forEach(list, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType ArrayLike + collection; // $ExpectType ArrayLike }); } { - let result: _.List | null | undefined; + let result: _.List | null | undefined; result = _.forEach(nilList, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType ArrayLike + collection; // $ExpectType ArrayLike }); } { - let result: _.Dictionary; + let result: _.Dictionary; result = _.forEach(dictionary, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType string - collection; // $ExpectType Dictionary + collection; // $ExpectType Dictionary }); } { - let result: _.Dictionary | null | undefined; + let result: _.Dictionary | null | undefined; result = _.forEach(nilDictionary, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType string - collection; // $ExpectType Dictionary + collection; // $ExpectType Dictionary }); } { - let sample1: TResult = any; + let sample1: AbcObject = anything; sample1 = _.forEach(sample1, objectIterator); - let sample2: TResult | null | undefined = any; + let sample2: AbcObject | null | undefined = anything; sample2 = _.forEach(sample2, objectIterator); } @@ -5405,45 +5393,45 @@ namespace TestForEach { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).forEach((value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.LoDashImplicitNillableArrayWrapper; + let result: _.LoDashImplicitNillableArrayWrapper; result = _(nilArray).forEach((value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.LoDashImplicitObjectWrapper<_.List>; + let result: _.LoDashImplicitObjectWrapper<_.List>; - result = _(list).forEach(listIterator); + result = _(list).forEach(listIterator); } { - let result: _.LoDashImplicitNillableObjectWrapper<_.List>; + let result: _.LoDashImplicitNillableObjectWrapper<_.List>; - result = _(nilList).forEach(listIterator); + result = _(nilList).forEach(listIterator); } { - let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(dictionary).forEach(dictionaryIterator); } { - let result: _.LoDashImplicitNillableObjectWrapper<_.Dictionary>; + let result: _.LoDashImplicitNillableObjectWrapper<_.Dictionary>; result = _(nilDictionary).forEach(dictionaryIterator); } @@ -5459,45 +5447,45 @@ namespace TestForEach { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().forEach((value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.LoDashExplicitNillableArrayWrapper; + let result: _.LoDashExplicitNillableArrayWrapper; result = _(nilArray).chain().forEach((value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.LoDashExplicitObjectWrapper<_.List>; + let result: _.LoDashExplicitObjectWrapper<_.List>; - result = _(list).chain().forEach(listIterator); + result = _(list).chain().forEach(listIterator); } { - let result: _.LoDashExplicitNillableObjectWrapper<_.List>; + let result: _.LoDashExplicitNillableObjectWrapper<_.List>; - result = _(nilList).chain().forEach(listIterator); + result = _(nilList).chain().forEach(listIterator); } { - let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(dictionary).chain().forEach(dictionaryIterator); } { - let result: _.LoDashExplicitNillableObjectWrapper<_.Dictionary>; + let result: _.LoDashExplicitNillableObjectWrapper<_.Dictionary>; result = _(nilDictionary).chain().forEach(dictionaryIterator); } @@ -5505,15 +5493,15 @@ namespace TestForEach { // _.forEachRight namespace TestForEachRight { - let array: TResult[] = []; - let list: _.List = []; - let dictionary: _.Dictionary = {}; - let nilArray: TResult[] | null | undefined = [] as any; - let nilList: _.List | null | undefined = [] as any; - let nilDictionary: _.Dictionary | null | undefined = any; + let array: AbcObject[] = []; + let list: _.List = []; + let dictionary: _.Dictionary = {}; + let nilArray: AbcObject[] | null | undefined = [] as any; + let nilList: _.List | null | undefined = [] as any; + let nilDictionary: _.Dictionary | null | undefined = anything; - let listIterator: (value: TResult, index: number, collection: _.List) => any = (value: TResult, index: number, collection: _.List) => 1; - let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any = (value: TResult, key: string, collection: _.Dictionary) => 1; + let listIterator: (value: AbcObject, index: number, collection: _.List) => any = (value: AbcObject, index: number, collection: _.List) => 1; + let dictionaryIterator: (value: AbcObject, key: string, collection: _.Dictionary) => any = (value: AbcObject, key: string, collection: _.Dictionary) => 1; { let result: string; @@ -5536,62 +5524,62 @@ namespace TestForEachRight { } { - let result: TResult[]; + let result: AbcObject[]; result = _.forEachRight(array, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: TResult[] | null | undefined; + let result: AbcObject[] | null | undefined; result = _.forEachRight(nilArray, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.List; + let result: _.List; result = _.forEachRight(list, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType ArrayLike + collection; // $ExpectType ArrayLike }); } { - let result: _.List | null | undefined; + let result: _.List | null | undefined; result = _.forEachRight(nilList, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType ArrayLike + collection; // $ExpectType ArrayLike }); } { - let result: _.Dictionary; + let result: _.Dictionary; result = _.forEachRight(dictionary, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType string - collection; // $ExpectType Dictionary + collection; // $ExpectType Dictionary }); } { - let result: _.Dictionary | null | undefined; + let result: _.Dictionary | null | undefined; result = _.forEachRight(nilDictionary, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType string - collection; // $ExpectType Dictionary + collection; // $ExpectType Dictionary }); } @@ -5606,37 +5594,37 @@ namespace TestForEachRight { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).forEachRight(listIterator); } { - let result: _.LoDashImplicitNillableArrayWrapper; + let result: _.LoDashImplicitNillableArrayWrapper; result = _(nilArray).forEachRight(listIterator); } { - let result: _.LoDashImplicitObjectWrapper<_.List>; + let result: _.LoDashImplicitObjectWrapper<_.List>; - result = _(list).forEachRight(listIterator); + result = _(list).forEachRight(listIterator); } { - let result: _.LoDashImplicitNillableObjectWrapper<_.List>; + let result: _.LoDashImplicitNillableObjectWrapper<_.List>; - result = _(nilList).forEachRight(listIterator); + result = _(nilList).forEachRight(listIterator); } { - let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(dictionary).forEachRight(dictionaryIterator); } { - let result: _.LoDashImplicitNillableObjectWrapper<_.Dictionary>; + let result: _.LoDashImplicitNillableObjectWrapper<_.Dictionary>; result = _(nilDictionary).forEachRight(dictionaryIterator); } @@ -5652,45 +5640,45 @@ namespace TestForEachRight { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().forEachRight((value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.LoDashExplicitNillableArrayWrapper; + let result: _.LoDashExplicitNillableArrayWrapper; result = _(nilArray).chain().forEachRight((value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.LoDashExplicitObjectWrapper<_.List>; + let result: _.LoDashExplicitObjectWrapper<_.List>; result = _(list).chain().forEachRight(listIterator); } { - let result: _.LoDashExplicitNillableObjectWrapper<_.List>; + let result: _.LoDashExplicitNillableObjectWrapper<_.List>; - result = _(nilList).chain().forEachRight(listIterator); + result = _(nilList).chain().forEachRight(listIterator); } { - let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(dictionary).chain().forEachRight(dictionaryIterator); } { - let result: _.LoDashExplicitNillableObjectWrapper<_.Dictionary>; + let result: _.LoDashExplicitNillableObjectWrapper<_.Dictionary>; result = _(nilDictionary).chain().forEachRight(dictionaryIterator); } @@ -5948,7 +5936,7 @@ namespace TestKeyBy { namespace TestInvoke { let boolArray: boolean[] = [true, false]; - let nestedDict: _.Dictionary> = { + let nestedDict: _.Dictionary = { a: [0, 1, 2] } @@ -6082,18 +6070,18 @@ namespace TestMap { let obj: any = {}; let dictionary: _.Dictionary | null | undefined = obj; - let listIterator: (value: number, index: number, collection: _.List) => TResult = (value: number, index: number, collection: _.List) => ({ a: 1, b: "", c: true }); - let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => TResult = (value: number, key: string, collection: _.Dictionary) => ({ a: 1, b: "", c: true }); + let listIterator: (value: number, index: number, collection: _.List) => AbcObject = (value: number, index: number, collection: _.List) => ({ a: 1, b: "", c: true }); + let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => AbcObject = (value: number, key: string, collection: _.Dictionary) => ({ a: 1, b: "", c: true }); { _.map(array); // $ExpectType number[] - _.map(array, listIterator); // $ExpectType TResult[] + _.map(array, listIterator); // $ExpectType AbcObject[] _.map(list); // $ExpectType number[] - _.map(list, listIterator); // $ExpectType TResult[] + _.map(list, listIterator); // $ExpectType AbcObject[] _.map(dictionary); // $ExpectType number[] - _.map(dictionary, dictionaryIterator); // $ExpectType TResult[] + _.map(dictionary, dictionaryIterator); // $ExpectType AbcObject[] } { @@ -6105,13 +6093,13 @@ namespace TestMap { { _(array).map().value(); // $ExpectType number[] - _(array).map(listIterator).value(); // $ExpectType TResult[] + _(array).map(listIterator).value(); // $ExpectType AbcObject[] _(list).map().value(); // $ExpectType number[] - _(list).map(listIterator).value(); // $ExpectType TResult[] + _(list).map(listIterator).value(); // $ExpectType AbcObject[] _(dictionary).map().value(); // $ExpectType number[] - _(dictionary).map(dictionaryIterator).value(); // $ExpectType TResult[] + _(dictionary).map(dictionaryIterator).value(); // $ExpectType AbcObject[] } { @@ -6122,13 +6110,13 @@ namespace TestMap { { _(array).chain().map().value(); // $ExpectType number[] - _(array).chain().map(listIterator).value(); // $ExpectType TResult[] + _(array).chain().map(listIterator).value(); // $ExpectType AbcObject[] _(list).chain().map().value(); // $ExpectType number[] - _(list).chain().map(listIterator).value(); // $ExpectType TResult[] + _(list).chain().map(listIterator).value(); // $ExpectType AbcObject[] _(dictionary).chain().map().value(); // $ExpectType number[] - _(dictionary).chain().map(dictionaryIterator).value(); // $ExpectType TResult[] + _(dictionary).chain().map(dictionaryIterator).value(); // $ExpectType AbcObject[] } { @@ -6163,7 +6151,7 @@ namespace TestPartition { { let result: any[][]; - result = _.partition(any, (n) => { + result = _.partition(anything, (n) => { n; // $ExpectType any return n < 'c'; }); @@ -6214,7 +6202,7 @@ namespace TestPartition { { let result: _.LoDashImplicitWrapper; - result = _(any).partition((n) => { + result = _(anything).partition((n) => { n; // $ExpectType any return n < 'c'; }); @@ -6259,7 +6247,7 @@ namespace TestPartition { { let result: _.LoDashExplicitWrapper; - result = _.chain(any).partition((n) => { + result = _.chain(anything).partition((n) => { n; // $ExpectType any return n < 'c'; }); @@ -6306,7 +6294,7 @@ namespace TestPartition { // _.map with iteratee shorthand // module TestMapInsteadOfPluck { // interface SampleObject { -// d: {b: TResult}[]; +// d: {b: AbcObject}[]; // } // // let array: SampleObject[] = []; @@ -6327,82 +6315,93 @@ namespace TestPartition { // } // // { -// let result: TResult[]; +// let result: AbcObject[]; // -// result = _.map(array, 'd.0.b'); -// result = _.map(array, ['d', 0, 'b']); +// result = _.map(array, 'd.0.b'); +// result = _.map(array, ['d', 0, 'b']); // -// result = _.map(list, 'd.0.b'); -// result = _.map(list, ['d', 0, 'b']); +// result = _.map(list, 'd.0.b'); +// result = _.map(list, ['d', 0, 'b']); // -// result = _.map(dictionary, 'd.0.b'); -// result = _.map(dictionary, ['d', 0, 'b']); +// result = _.map(dictionary, 'd.0.b'); +// result = _.map(dictionary, ['d', 0, 'b']); // } // // { -// let result: _.LoDashImplicitArrayWrapper; +// let result: _.LoDashImplicitArrayWrapper; // -// result = _(array).map('d.0.b'); -// result = _(array).map(['d', 0, 'b']); +// result = _(array).map('d.0.b'); +// result = _(array).map(['d', 0, 'b']); // -// result = _(list).map('d.0.b'); -// result = _(list).map(['d', 0, 'b']); +// result = _(list).map('d.0.b'); +// result = _(list).map(['d', 0, 'b']); // -// result = _(dictionary).map('d.0.b'); -// result = _(dictionary).map(['d', 0, 'b']); +// result = _(dictionary).map('d.0.b'); +// result = _(dictionary).map(['d', 0, 'b']); // } // // { -// let result: _.LoDashExplicitArrayWrapper; +// let result: _.LoDashExplicitArrayWrapper; // -// result = _(array).chain().map('d.0.b'); -// result = _(array).chain().map(['d', 0, 'b']); +// result = _(array).chain().map('d.0.b'); +// result = _(array).chain().map(['d', 0, 'b']); // -// result = _(list).chain().map('d.0.b'); -// result = _(list).chain().map(['d', 0, 'b']); +// result = _(list).chain().map('d.0.b'); +// result = _(list).chain().map(['d', 0, 'b']); // -// result = _(dictionary).chain().map('d.0.b'); -// result = _(dictionary).chain().map(['d', 0, 'b']); +// result = _(dictionary).chain().map('d.0.b'); +// result = _(dictionary).chain().map(['d', 0, 'b']); // } // } namespace TestReduce { interface ABC { - [index: string]: number; + [key: string]: number; a: number; b: number; c: number; } - result = _.reduce([1, 2, 3], (sum: number, num: number) => sum + num); - result = _.reduce(null, (sum: number, num: number) => sum + num); + // $ExpectType number | undefined + _.reduce([1, 2, 3], (sum: number, num: number) => sum + num); + // $ExpectType number | undefined + _.reduce(null, (sum: number, num: number) => sum + num); // chained - result = _([1, 2 ,3]).reduce((sum: number, num: number) => sum + num); - result = _.chain([1, 2 ,3]).reduce((sum: number, num: number) => sum + num).value(); + _([1, 2 ,3]).reduce((sum: number, num: number) => sum + num); + _.chain([1, 2 ,3]).reduce((sum: number, num: number) => sum + num).value(); - result = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, (r: ABC, num: number, key: string) => { + // $ExpectType ABC + _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, (r: ABC, num: number, key: string) => { r[key] = num * 3; return r; - }, {} as ABC); // tslint:disable-line no-object-literal-type-assertion + // tslint:disable-next-line:no-object-literal-type-assertion + }, {} as ABC); - result = _([1, 2, 3]).reduce((sum: number, num: number) => sum + num); - result = _({ 'a': 1, 'b': 2, 'c': 3 }).reduce((r: ABC, num: number, key: string) => { + // $ExpectType number | undefined + _([1, 2, 3]).reduce((sum: number, num: number) => sum + num); + + const initial: ABC = { a: 1, b: 2, c: 3 }; + // $ExpectType ABC + _({ 'a': 1, 'b': 2, 'c': 3 }).reduce((r: ABC, num: number, key: string) => { r[key] = num * 3; return r; - }, { a: 1, b: 2, c: 3 }); + // tslint:disable-next-line:no-object-literal-type-assertion + }, initial); - result = _.reduceRight([[0, 1], [2, 3], [4, 5]], (a: number[], b: number[]) => a.concat(b), []); + // $ExpectType number[] + _.reduceRight([[0, 1], [2, 3], [4, 5]], (a: number[], b: number[]) => a.concat(b), []); } + // _.reject namespace TestReject { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let obj: any = {}; - let dictionary: _.Dictionary | null | undefined = obj; + let dictionary: _.Dictionary | null | undefined = obj; let stringIterator = (char: string, index: number, string: string) => true; - let listIterator = (value: TResult, index: number, collection: _.List) => true; - let dictionaryIterator = (value: TResult, key: string, collection: _.Dictionary) => true; + let listIterator = (value: AbcObject, index: number, collection: _.List) => true; + let dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => true; { let result: string[]; @@ -6411,14 +6410,14 @@ namespace TestReject { } { - let result: TResult[]; + let result: AbcObject[]; - result = _.reject(array, listIterator); - result = _.reject(array, ''); + result = _.reject(array, listIterator); + result = _.reject(array, ''); result = _.reject(array, {a: 42}); - result = _.reject(list, listIterator); - result = _.reject(list, ''); + result = _.reject(list, listIterator); + result = _.reject(list, ''); result = _.reject(list, {a: 42}); result = _.reject(dictionary, dictionaryIterator); @@ -6433,14 +6432,14 @@ namespace TestReject { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).reject(listIterator); result = _(array).reject(''); result = _(array).reject({a: 42}); - result = _(list).reject(listIterator); - result = _(list).reject(''); + result = _(list).reject(listIterator); + result = _(list).reject(''); result = _(list).reject({a: 42}); result = _(dictionary).reject(dictionaryIterator); @@ -6455,14 +6454,14 @@ namespace TestReject { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().reject(listIterator); result = _(array).chain().reject(''); result = _(array).chain().reject({a: 42}); - result = _(list).chain().reject(listIterator); - result = _(list).chain().reject(''); + result = _(list).chain().reject(listIterator); + result = _(list).chain().reject(''); result = _(list).chain().reject({a: 42}); result = _(dictionary).chain().reject(dictionaryIterator); @@ -6574,10 +6573,10 @@ namespace TestSampleSize { // _.shuffle namespace TestShuffle { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let obj: any = {}; - let dictionary: _.Dictionary | null | undefined = obj; + let dictionary: _.Dictionary | null | undefined = obj; { let result: string[]; @@ -6586,10 +6585,10 @@ namespace TestShuffle { } { - let result: TResult[]; + let result: AbcObject[]; - result = _.shuffle(array); - result = _.shuffle(list); + result = _.shuffle(array); + result = _.shuffle(list); result = _.shuffle(dictionary); } @@ -6600,10 +6599,10 @@ namespace TestShuffle { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).shuffle(); - result = _(list).shuffle(); + result = _(list).shuffle(); result = _(dictionary).shuffle(); } @@ -6614,10 +6613,10 @@ namespace TestShuffle { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().shuffle(); - result = _(list).chain().shuffle(); + result = _(list).chain().shuffle(); result = _(dictionary).chain().shuffle(); } } @@ -6772,22 +6771,22 @@ namespace TestSome { result = _(sampleObject).chain().some(objectIterator); result = _(sampleObject).chain().some('a'); result = _(sampleObject).chain().some(['a', 42]); - result = _(sampleObject).chain().some({a: 42}); + result = _(sampleObject).chain().some({a: 42}); } } // _.sortBy namespace TestSortBy { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let obj: any = {}; - let dictionary: _.Dictionary | null | undefined = obj; + let dictionary: _.Dictionary | null | undefined = obj; - let listIterator = (value: TResult, index: number, collection: _.List) => 0; - let dictionaryIterator = (value: TResult, key: string, collection: _.Dictionary) => 0; + let listIterator = (value: AbcObject, index: number, collection: _.List) => 0; + let dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => 0; { - let result: TResult[]; + let result: AbcObject[]; result = _.sortBy(array); result = _.sortBy(array, listIterator); @@ -6806,7 +6805,7 @@ namespace TestSortBy { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).sortBy(); result = _(array).sortBy(listIterator); @@ -6825,7 +6824,7 @@ namespace TestSortBy { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().sortBy(); result = _(array).chain().sortBy(listIterator); @@ -6844,24 +6843,24 @@ namespace TestSortBy { } } -result = _.sortBy(stoogesAges, stooge => Math.sin(stooge.age), stooge => stooge.name.slice(1)); -result = _.sortBy(stoogesAges, ['name', 'age']); -result = _.sortBy(stoogesAges, 'name', stooge => Math.sin(stooge.age)); +_.sortBy(stoogesAges, stooge => Math.sin(stooge.age), stooge => stooge.name.slice(1)); // $ExpectType StoogesAge[] +_.sortBy(stoogesAges, ['name', 'age']); // $ExpectType StoogesAge[] +_.sortBy(stoogesAges, 'name', stooge => Math.sin(stooge.age)); // $ExpectType StoogesAge[] -result = _(foodsOrganic).sortBy('organic', (food) => food.name, { organic: true }).value(); +_(foodsOrganic).sortBy('organic', (food) => food.name, { organic: true }).value(); // $ExpectType FoodOrganic[] // _.orderBy namespace TestorderBy { type SampleObject = {a: number; b: string; c: boolean}; - const array: SampleObject[] | null | undefined = any; - const list: _.List | null | undefined = any; - const numericDictionary: _.NumericDictionary | null | undefined = any; - const dictionary: _.Dictionary | null | undefined = any; - const orders: boolean|string|Array = any; + const array: SampleObject[] | null | undefined = anything; + const list: _.List | null | undefined = anything; + const numericDictionary: _.NumericDictionary | null | undefined = anything; + const dictionary: _.Dictionary | null | undefined = anything; + const orders: boolean|string|Array = anything; { - let iteratees: (value: string) => any|((value: string) => any)[] = (value) => 1; + let iteratees: ((value: string) => any)|Array<(value: string) => any> = anything; let result: string[]; result = _.orderBy('acbd', iteratees); @@ -6869,7 +6868,7 @@ namespace TestorderBy { } { - const iteratees: ((value: SampleObject) => _.NotVoid)|string|_.PartialDeep|Array<((value: SampleObject) => _.NotVoid)|string|_.PartialDeep> = any; + const iteratees: ((value: SampleObject) => _.NotVoid)|string|_.PartialDeep|Array<((value: SampleObject) => _.NotVoid)|string|_.PartialDeep> = anything; let result: SampleObject[]; result = _.orderBy(array, iteratees); @@ -6894,7 +6893,7 @@ namespace TestorderBy { } { - const iteratees: ((value: SampleObject) => _.NotVoid)|string|_.PartialDeep|Array<((value: SampleObject) => _.NotVoid)|string|_.PartialDeep> = any; + const iteratees: ((value: SampleObject) => _.NotVoid)|string|_.PartialDeep|Array<((value: SampleObject) => _.NotVoid)|string|_.PartialDeep> = anything; let result: _.LoDashImplicitArrayWrapper; result = _(array).orderBy(iteratees); @@ -6917,7 +6916,7 @@ namespace TestorderBy { } { - const iteratees: ((value: SampleObject) => _.NotVoid)|string|_.PartialDeep|Array<((value: SampleObject) => _.NotVoid)|string|_.PartialDeep> = any; + const iteratees: ((value: SampleObject) => _.NotVoid)|string|_.PartialDeep|Array<((value: SampleObject) => _.NotVoid)|string|_.PartialDeep> = anything; let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().orderBy(iteratees); @@ -6968,9 +6967,7 @@ namespace TestNow { *************/ // _.after namespace TestAfter { - interface Func { - (a: string, b: number): boolean; - } + type Func = (a: string, b: number) => boolean; let func: Func = (a, b) => true; @@ -7025,9 +7022,7 @@ namespace TestAry { // _.before namespace TestBefore { - interface Func { - (a: string, b: number): boolean; - } + type Func = (a: string, b: number) => boolean; let func: Func = (a, b) => true; @@ -7061,8 +7056,8 @@ namespace TestBind { let result: SampleResult; - result = _.bind(func, any); - result = _.bind(func, any); + result = _.bind(func, anything); + result = _.bind(func, anything); } { @@ -7070,8 +7065,8 @@ namespace TestBind { let result: SampleResult; - result = _.bind(func, any, 42); - result = _.bind(func, any, 42); + result = _.bind(func, anything, 42); + result = _.bind(func, anything, 42); } { @@ -7079,8 +7074,8 @@ namespace TestBind { let result: SampleResult; - result = _.bind(func, any, 42, ''); - result = _.bind(func, any, 42, ''); + result = _.bind(func, anything, 42, ''); + result = _.bind(func, anything, 42, ''); } { @@ -7088,7 +7083,7 @@ namespace TestBind { let result: _.LoDashImplicitObjectWrapper; - result = _(func).bind(any); + result = _(func).bind(anything); } { @@ -7096,7 +7091,7 @@ namespace TestBind { let result: _.LoDashImplicitObjectWrapper; - result = _(func).bind(any, 42); + result = _(func).bind(anything, 42); } { @@ -7104,7 +7099,7 @@ namespace TestBind { let result: _.LoDashImplicitObjectWrapper; - result = _(func).bind(any, 42, ''); + result = _(func).bind(anything, 42, ''); } { @@ -7112,7 +7107,7 @@ namespace TestBind { let result: _.LoDashExplicitObjectWrapper; - result = _(func).chain().bind(any); + result = _(func).chain().bind(anything); } { @@ -7120,7 +7115,7 @@ namespace TestBind { let result: _.LoDashExplicitWrapper; - result = _(func).chain().bind(any, 42); + result = _(func).chain().bind(anything, 42); } { @@ -7128,16 +7123,16 @@ namespace TestBind { let result: _.LoDashExplicitWrapper; - result = _(func).chain().bind(any, 42, ''); + result = _(func).chain().bind(anything, 42, ''); } } // _.bindAll namespace TestBindAll { interface SampleObject { - a: Function; - b: Function; - c: Function; + a(): void; + b(): void; + c(): void; } let object: SampleObject = { a: () => {}, b: () => {}, c: () => {} }; @@ -7300,9 +7295,7 @@ curryResult9 = _.curryRight(testCurry2); // _.debounce namespace TestDebounce { - interface SampleFunc { - (n: number, s: string): boolean; - } + type SampleFunc = (n: number, s: string) => boolean; interface Options { leading?: boolean; @@ -7354,27 +7347,27 @@ namespace TestDefer { let result: number; result = _.defer(func); - result = _.defer(func, any); - result = _.defer(func, any, any); - result = _.defer(func, any, any, any); + result = _.defer(func, anything); + result = _.defer(func, anything, anything); + result = _.defer(func, anything, anything, anything); } { let result: _.LoDashImplicitWrapper; result = _(func).defer(); - result = _(func).defer(any); - result = _(func).defer(any, any); - result = _(func).defer(any, any, any); + result = _(func).defer(anything); + result = _(func).defer(anything, anything); + result = _(func).defer(anything, anything, anything); } { let result: _.LoDashExplicitWrapper; result = _(func).chain().defer(); - result = _(func).chain().defer(any); - result = _(func).chain().defer(any, any); - result = _(func).chain().defer(any, any, any); + result = _(func).chain().defer(anything); + result = _(func).chain().defer(anything, anything); + result = _(func).chain().defer(anything, anything, anything); } } @@ -7411,9 +7404,7 @@ namespace TestDelay { // _.flip namespace TestFlip { - interface Func { - (a: number, b: string): boolean; - } + type Func = (a: string, b: number) => boolean; let func: Func = (a, b) => true; @@ -7631,30 +7622,24 @@ namespace TestOverArgs { // _.negate namespace TestNegate { - interface PredicateFn { - (a1: number, a2: number): boolean; - } - - interface ResultFn { - (a1: number, a2: number): boolean; - } + type PredicateFn = (a1: number, a2: number) => boolean; const predicate = (a1: number, a2: number) => a1 > a2; { - let result: ResultFn; + let result: PredicateFn; result = _.negate(predicate); } { - let result: _.LoDashImplicitObjectWrapper; + let result: _.LoDashImplicitObjectWrapper; result = _(predicate).negate(); } { - let result: _.LoDashExplicitObjectWrapper; + let result: _.LoDashExplicitObjectWrapper; result = _(predicate).chain().negate(); } @@ -7662,9 +7647,7 @@ namespace TestNegate { // _.once namespace TestOnce { - interface Func { - (a: number, b: string): boolean; - } + type Func = (a: string, b: number) => boolean; let func: Func = (a, b) => true; @@ -7691,7 +7674,7 @@ const greetPartial = (greeting: string, name: string) => `${greeting} ${name}`; const hi = _.partial(greetPartial, 'hi'); hi('moe'); -const defaultsDeep = _.partialRight(_.merge, _.defaults); +const defaultsDeep: (...args: any[]) => any = _.partialRight(_.merge, _.defaults); const optionsPartialRight = { 'variable': 'data', @@ -7702,9 +7685,6 @@ defaultsDeep(optionsPartialRight, _.templateSettings); //_.rearg const testReargFn = (a: string, b: string, c: string) => [a, b, c]; -interface TestReargResultFn { - (b: string, c: string, a: string): string[]; -} result = (_.rearg(testReargFn, 2, 0, 1))('b', 'c', 'a'); result = (_.rearg(testReargFn, [2, 0, 1]))('b', 'c', 'a'); result = (_(testReargFn).rearg(2, 0, 1).value())('b', 'c', 'a'); @@ -7741,7 +7721,7 @@ namespace TestRest { //_.spread namespace TestSpread { - type SampleFunc = (args: (number|string)[]) => boolean; + type SampleFunc = (args: Array) => boolean; type SampleResult = (a: number, b: string) => boolean; let func: SampleFunc = (a) => true; @@ -7767,9 +7747,7 @@ namespace TestSpread { // _.throttle namespace TestThrottle { - interface SampleFunc { - (n: number, s: string): boolean; - } + type SampleFunc = (n: number, s: string) => boolean; interface Options { leading?: boolean; @@ -7812,9 +7790,7 @@ namespace TestThrottle { // _.unary namespace TestUnary { - interface Func { - (a: number, b: string): boolean; - } + type Func = (a: string, b: number[]) => boolean; let func: Func = (a, b) => true; @@ -8038,9 +8014,7 @@ namespace TestCloneDeep { // _.cloneDeepWith namespace TestCloneDeepWith { - interface CloneDeepWithCustomizer { - (value: V): R; - } + type CloneDeepWithCustomizer = (value: V) => R; { let customizer: CloneDeepWithCustomizer = (x) => ""; @@ -8090,9 +8064,7 @@ namespace TestCloneDeepWith { // _.cloneWith namespace TestCloneWith { - interface CloneWithCustomizer { - (value: V): R; - } + type CloneWithCustomizer = (value: V) => R; { let customizer: CloneWithCustomizer = (x) => ""; @@ -8162,15 +8134,15 @@ namespace TestEq { { let result: boolean; - result = _.eq(any, any); + result = _.eq(anything, anything); - result = _(any).eq(any); + result = _(anything).eq(anything); } { let result: _.LoDashExplicitWrapper; - result = _(any).chain().eq(any); + result = _(anything).chain().eq(anything); } } @@ -8179,18 +8151,18 @@ namespace TestGt { { let result: boolean; - result = _.gt(any, any); - result = _(1).gt(any); - result = _([]).gt(any); - result = _({}).gt(any); + result = _.gt(anything, anything); + result = _(1).gt(anything); + result = _([]).gt(anything); + result = _({}).gt(anything); } { let result: _.LoDashExplicitWrapper; - result = _(1).chain().gt(any); - result = _([]).chain().gt(any); - result = _({}).chain().gt(any); + result = _(1).chain().gt(anything); + result = _([]).chain().gt(anything); + result = _({}).chain().gt(anything); } } @@ -8199,18 +8171,18 @@ namespace TestGte { { let result: boolean; - result = _.gte(any, any); - result = _(1).gte(any); - result = _([]).gte(any); - result = _({}).gte(any); + result = _.gte(anything, anything); + result = _(1).gte(anything); + result = _([]).gte(anything); + result = _({}).gte(anything); } { let result: _.LoDashExplicitWrapper; - result = _(1).chain().gte(any); - result = _([]).chain().gte(any); - result = _({}).chain().gte(any); + result = _(1).chain().gte(anything); + result = _([]).chain().gte(anything); + result = _({}).chain().gte(anything); } } @@ -8230,7 +8202,7 @@ namespace TestisArguments { { let result: boolean; - result = _.isArguments(any); + result = _.isArguments(anything); result = _(1).isArguments(); result = _([]).isArguments(); result = _({}).isArguments(); @@ -8248,7 +8220,7 @@ namespace TestisArguments { // _.isArray namespace TestIsArray { { - let value: number|string[]|boolean[] = any; + let value: number|string[]|boolean[] = anything; if (_.isArray(value)) { value; // $ExpectType string[] | boolean[] @@ -8261,7 +8233,7 @@ namespace TestIsArray { { let result: boolean; - result = _.isArray(any); + result = _.isArray(anything); result = _(1).isArray(); result = _([]).isArray(); result = _({}).isArray(); @@ -8279,7 +8251,7 @@ namespace TestIsArray { // _.isArrayBuffer namespace TestIsArrayBuffer { { - let value: ArrayBuffer|number = any; + let value: ArrayBuffer|number = anything; if (_.isArrayBuffer(value)) { value; // $ExpectType ArrayBuffer @@ -8292,7 +8264,7 @@ namespace TestIsArrayBuffer { { let result: boolean; - result = _.isArrayBuffer(any); + result = _.isArrayBuffer(anything); result = _(1).isArrayBuffer(); result = _([]).isArrayBuffer(); result = _({}).isArrayBuffer(); @@ -8312,7 +8284,7 @@ namespace TestIsArrayLike { { let value: string | string[] | { [index: number]: boolean, length: number } | [number, boolean] | number | { length: string } | { a: string } | null | undefined - = any; + = anything; if (_.isArrayLike(value)) { let result: string | string[] | { [index: number]: boolean, length: number } | [number, boolean] = value; @@ -8322,7 +8294,7 @@ namespace TestIsArrayLike { } { - let value: boolean[] = any; + let value: boolean[] = anything; if (_.isArrayLike(value)) { let result: boolean[] = value; @@ -8333,17 +8305,17 @@ namespace TestIsArrayLike { } { - let value: Function = any; + let value: () => number = anything; if (_.isArrayLike(value)) { value; // $ExpectType never } else { - value; // $ExpectType Function + value; // $ExpectType () => number } } { - let value: { a: string } = any; + let value: { a: string } = anything; if (_.isArrayLike(value)) { let result: { a: string, length: number } = value; @@ -8354,7 +8326,7 @@ namespace TestIsArrayLike { } { - let value: any = any; + let value: any = anything; if (_.isArrayLike(value)) { value; // $ExpectType any @@ -8367,7 +8339,7 @@ namespace TestIsArrayLike { { let result: boolean; - result = _.isArrayLike(any); + result = _.isArrayLike(anything); result = _(1).isArrayLike(); result = _([]).isArrayLike(); result = _({}).isArrayLike(); @@ -8387,7 +8359,7 @@ namespace TestIsArrayLikeObject { { let value: string[] | { [index: number]: boolean, length: number } | [number, boolean] | number | string | { length: string } | { a: string } | null | undefined - = any; + = anything; if (_.isArrayLikeObject(value)) { let result: string[] | { [index: number]: boolean, length: number } | [number, boolean] = value; @@ -8397,7 +8369,7 @@ namespace TestIsArrayLikeObject { } { - let value: boolean[] = any; + let value: boolean[] = anything; if (_.isArrayLikeObject(value)) { let result: boolean[] = value; @@ -8408,17 +8380,17 @@ namespace TestIsArrayLikeObject { } { - let value: string | Function = any; + let value: (a: string) => boolean = anything; if (_.isArrayLikeObject(value)) { value; // $ExpectType never } else { - value; // $ExpectType string | Function + value; // $ExpectType (a: string) => boolean } } { - let value: { a: string } = any; + let value: { a: string } = anything; if (_.isArrayLikeObject(value)) { let result: { a: string, length: number } = value; @@ -8429,7 +8401,7 @@ namespace TestIsArrayLikeObject { } { - let value: any = any; + let value: any = anything; if (_.isArrayLikeObject(value)) { value; // $ExpectType any @@ -8442,7 +8414,7 @@ namespace TestIsArrayLikeObject { { let result: boolean; - result = _.isArrayLikeObject(any); + result = _.isArrayLikeObject(anything); result = _(1).isArrayLikeObject(); result = _([]).isArrayLikeObject(); result = _({}).isArrayLikeObject(); @@ -8473,7 +8445,7 @@ namespace TestIsBoolean { { let result: boolean; - result = _.isBoolean(any); + result = _.isBoolean(anything); result = _(1).isBoolean(); result = _([]).isBoolean(); result = _({}).isBoolean(); @@ -8493,7 +8465,7 @@ namespace TestIsBuffer { { let result: boolean; - result = _.isBuffer(any); + result = _.isBuffer(anything); result = _(1).isBuffer(); result = _([]).isBuffer(); result = _({}).isBuffer(); @@ -8509,7 +8481,7 @@ namespace TestIsBuffer { } // _.isDate -namespace TestIsBoolean { +{ { let value: number|Date = 0; @@ -8524,7 +8496,7 @@ namespace TestIsBoolean { { let result: boolean; - result = _.isDate(any); + result = _.isDate(anything); result = _(42).isDate(); result = _([]).isDate(); result = _({}).isDate(); @@ -8544,7 +8516,7 @@ namespace TestIsElement { { let result: boolean; - result = _.isElement(any); + result = _.isElement(anything); result = _(42).isElement(); result = _([]).isElement(); @@ -8565,7 +8537,7 @@ namespace TestIsEmpty { { let result: boolean; - result = _.isEmpty(any); + result = _.isEmpty(anything); result = _(1).isEmpty(); result = _('').isEmpty(); result = _([]).isEmpty(); @@ -8589,15 +8561,15 @@ namespace TestIsEqual { { let result: boolean; - result = _.isEqual(any, any); + result = _.isEqual(anything, anything); - result = _(any).isEqual(any); + result = _(anything).isEqual(anything); } { let result: _.LoDashExplicitWrapper; - result = _(any).chain().isEqual(any); + result = _(anything).chain().isEqual(anything); } } @@ -8608,15 +8580,15 @@ namespace TestIsEqualWith { { let result: boolean; - result = _.isEqualWith(any, any, customizer); + result = _.isEqualWith(anything, anything, customizer); - result = _(any).isEqualWith(any, customizer); + result = _(anything).isEqualWith(anything, customizer); } { let result: _.LoDashExplicitWrapper; - result = _(any).chain().isEqualWith(any, customizer); + result = _(anything).chain().isEqualWith(anything, customizer); } } @@ -8652,7 +8624,7 @@ namespace TestIsError { { let result: boolean; - result = _.isError(any); + result = _.isError(anything); result = _(1).isError(); result = _([]).isError(); result = _({}).isError(); @@ -8672,7 +8644,7 @@ namespace TestIsFinite { { let result: boolean; - result = _.isFinite(any); + result = _.isFinite(anything); result = _(1).isFinite(); result = _([]).isFinite(); result = _({}).isFinite(); @@ -8690,24 +8662,24 @@ namespace TestIsFinite { // _.isFunction namespace TestIsFunction { { - let value: number|Function = () => {}; + let value: number|(() => void) = anything; if (_.isFunction(value)) { - let result: Function = value; + value; // $ExpectType () => void } else { - let result: number|Function = value; + value; // $ExpectType number } - if (_.isFunction(any)) { - any(); + if (_.isFunction(anything)) { + anything(); } } { let result: boolean; - result = _.isFunction(any); + result = _.isFunction(anything); result = _(1).isFunction(); result = _([]).isFunction(); result = _({}).isFunction(); @@ -8727,7 +8699,7 @@ namespace TestIsInteger { { let result: boolean; - result = _.isInteger(any); + result = _.isInteger(anything); result = _(1).isInteger(); result = _([]).isInteger(); @@ -8748,7 +8720,7 @@ namespace TestIsLength { { let result: boolean; - result = _.isLength(any); + result = _.isLength(anything); result = _(1).isLength(); result = _([]).isLength(); @@ -8780,7 +8752,7 @@ namespace TestIsMap { { let result: boolean; - result = _.isMap(any); + result = _.isMap(anything); result = _(1).isMap(); result = _([]).isMap(); result = _({}).isMap(); @@ -8797,22 +8769,18 @@ namespace TestIsMap { // _.isMatch namespace TestIsMatch { - let testIsMatchCustiomizerFn: (value: any, other: any, indexOrKey: number|string) => boolean; - - let result: boolean; - - result = _.isMatch({}, {}); - result = _({}).isMatch({}); + _.isMatch({}, {}); // $ExpectType boolean + _({}).isMatch({}); // $ExpectType boolean + _.chain({}).isMatch({}); // $ExpectType LoDashExplicitWrapper } // _.isMatchWith namespace TestIsMatchWith { let testIsMatchCustiomizerFn = (value: any, other: any, indexOrKey: number|string|symbol) => true; - let result: boolean; - - result = _.isMatchWith({}, {}, testIsMatchCustiomizerFn); - result = _({}).isMatchWith({}, testIsMatchCustiomizerFn); + _.isMatchWith({}, {}, testIsMatchCustiomizerFn); // $ExpectType boolean + _({}).isMatchWith({}, testIsMatchCustiomizerFn); // $ExpectType boolean + _.chain({}).isMatchWith({}, testIsMatchCustiomizerFn); // $ExpectType LoDashExplicitWrapper } // _.isNaN @@ -8820,7 +8788,7 @@ namespace TestIsNaN { { let result: boolean; - result = _.isNaN(any); + result = _.isNaN(anything); result = _(1).isNaN(); result = _([]).isNaN(); @@ -8839,20 +8807,20 @@ namespace TestIsNaN { // _.isNative namespace TestIsNative { { - let value: number|Function = () => {}; + let value: number|(() => void) = anything; if (_.isNative(value)) { - let result: Function = value; + value; // $ExpectType () => void } else { - let result: number = value; + value; // $ExpectType number } } { let result: boolean; - result = _.isNative(any); + result = _.isNative(anything); result = _(1).isNative(); result = _([]).isNative(); @@ -8873,7 +8841,7 @@ namespace TestIsNil { { let result: boolean; - result = _.isNil(any); + result = _.isNil(anything); result = _(1).isNil(); result = _([]).isNil(); @@ -8894,7 +8862,7 @@ namespace TestIsNull { { let result: boolean; - result = _.isNull(any); + result = _.isNull(anything); result = _(1).isNull(); result = _([]).isNull(); @@ -8926,7 +8894,7 @@ namespace TestIsNumber { { let result: boolean; - result = _.isNumber(any); + result = _.isNumber(anything); result = _(1).isNumber(); result = _([]).isNumber(); @@ -8947,7 +8915,7 @@ namespace TestIsObject { { let result: boolean; - result = _.isObject(any); + result = _.isObject(anything); result = _(1).isObject(); result = _([]).isObject(); result = _({}).isObject(); @@ -8967,7 +8935,7 @@ namespace TestIsObjectLike { { let result: boolean; - result = _.isObjectLike(any); + result = _.isObjectLike(anything); result = _(1).isObjectLike(); result = _([]).isObjectLike(); result = _({}).isObjectLike(); @@ -8987,7 +8955,7 @@ namespace TestIsPlainObject { { let result: boolean; - result = _.isPlainObject(any); + result = _.isPlainObject(anything); result = _(1).isPlainObject(); result = _([]).isPlainObject(); result = _({}).isPlainObject(); @@ -9018,7 +8986,7 @@ namespace TestIsRegExp { { let result: boolean; - result = _.isRegExp(any); + result = _.isRegExp(anything); result = _(1).isRegExp(); result = _([]).isRegExp(); result = _({}).isRegExp(); @@ -9038,7 +9006,7 @@ namespace TestIsSafeInteger { { let result: boolean; - result = _.isSafeInteger(any); + result = _.isSafeInteger(anything); result = _(1).isSafeInteger(); result = _([]).isSafeInteger(); @@ -9070,7 +9038,7 @@ namespace TestIsSet { { let result: boolean; - result = _.isSet(any); + result = _.isSet(anything); result = _(1).isSet(); result = _([]).isSet(); result = _({}).isSet(); @@ -9101,7 +9069,7 @@ namespace TestIsString { { let result: boolean; - result = _.isString(any); + result = _.isString(anything); result = _(1).isString(); result = _([]).isString(); result = _({}).isString(); @@ -9121,7 +9089,7 @@ namespace TestIsSymbol { { let result: boolean; - result = _.isSymbol(any); + result = _.isSymbol(anything); result = _(1).isSymbol(); result = _([]).isSymbol(); @@ -9158,7 +9126,7 @@ namespace TestIsUndefined { { let result: boolean; - result = _.isUndefined(any); + result = _.isUndefined(anything); result = _(1).isUndefined(); result = _([]).isUndefined(); @@ -9190,7 +9158,7 @@ namespace TestIsWeakMap { { let result: boolean; - result = _.isWeakMap(any); + result = _.isWeakMap(anything); result = _(1).isWeakMap(); result = _([]).isWeakMap(); result = _({}).isWeakMap(); @@ -9221,7 +9189,7 @@ namespace TestIsWeakSet { { let result: boolean; - result = _.isWeakSet(any); + result = _.isWeakSet(anything); result = _(1).isWeakSet(); result = _([]).isWeakSet(); result = _({}).isWeakSet(); @@ -9241,18 +9209,18 @@ namespace TestLt { { let result: boolean; - result = _.lt(any, any); - result = _(1).lt(any); - result = _([]).lt(any); - result = _({}).lt(any); + result = _.lt(anything, anything); + result = _(1).lt(anything); + result = _([]).lt(anything); + result = _({}).lt(anything); } { let result: _.LoDashExplicitWrapper; - result = _(1).chain().lt(any); - result = _([]).chain().lt(any); - result = _({}).chain().lt(any); + result = _(1).chain().lt(anything); + result = _([]).chain().lt(anything); + result = _({}).chain().lt(anything); } } @@ -9261,27 +9229,27 @@ namespace TestLte { { let result: boolean; - result = _.lte(any, any); - result = _(1).lte(any); - result = _([]).lte(any); - result = _({}).lte(any); + result = _.lte(anything, anything); + result = _(1).lte(anything); + result = _([]).lte(anything); + result = _({}).lte(anything); } { let result: _.LoDashExplicitWrapper; - result = _(1).chain().lte(any); - result = _([]).chain().lte(any); - result = _({}).chain().lte(any); + result = _(1).chain().lte(anything); + result = _([]).chain().lte(anything); + result = _({}).chain().lte(anything); } } // _.toArray namespace TestToArray { - let array: TResult[] = []; - let list: _.List = []; - let dictionary: _.Dictionary = {}; - let numericDictionary: _.NumericDictionary = {}; + let array: AbcObject[] = []; + let list: _.List = []; + let dictionary: _.Dictionary = {}; + let numericDictionary: _.NumericDictionary = {}; { let result: string[]; @@ -9291,12 +9259,12 @@ namespace TestToArray { } { - let result: TResult[]; + let result: AbcObject[]; - result = _.toArray(array); - result = _.toArray(list); - result = _.toArray(dictionary); - result = _.toArray(numericDictionary); + result = _.toArray(array); + result = _.toArray(list); + result = _.toArray(dictionary); + result = _.toArray(numericDictionary); result = _.toArray(array); result = _.toArray(list); @@ -9313,28 +9281,28 @@ namespace TestToArray { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).toArray(); - result = _(list).toArray(); - result = _(dictionary).toArray(); - result = _(numericDictionary).toArray(); + result = _(list).toArray(); + result = _(dictionary).toArray(); + result = _(numericDictionary).toArray(); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().toArray(); - result = _(list).chain().toArray(); - result = _(dictionary).chain().toArray(); - result = _(numericDictionary).chain().toArray(); + result = _(list).chain().toArray(); + result = _(dictionary).chain().toArray(); + result = _(numericDictionary).chain().toArray(); } } // _.toPlainObject namespace TestToPlainObject { { - let result: TResult; + let result: AbcObject; result = _.toPlainObject(); result = _.toPlainObject(true); result = _.toPlainObject(1); @@ -9344,7 +9312,7 @@ namespace TestToPlainObject { } { - let result: _.LoDashImplicitObjectWrapper; + let result: _.LoDashImplicitObjectWrapper; result = _(true).toPlainObject(); result = _(1).toPlainObject(); @@ -9568,13 +9536,13 @@ namespace TestMax { namespace TestMaxBy { let array: number[] = []; let list: _.List = []; - let array2: TResult[] = []; - let list2: _.List = []; + let array2: AbcObject[] = []; + let list2: _.List = []; let listIterator = (value: number, index: number, collection: _.List) => 0; let result: number | undefined; - let result2: TResult | undefined; + let result2: AbcObject | undefined; result = _.maxBy(array); result = _.maxBy(array, listIterator); @@ -9609,8 +9577,8 @@ namespace TestMean { } // _.meanBy -namespace TestMean { - let array: TResult[] = []; +{ + let array: AbcObject[] = []; let result: number; @@ -9638,13 +9606,13 @@ namespace TestMin { namespace TestMinBy { let array: number[] = []; let list: _.List = []; - let array2: TResult[] = []; - let list2: _.List = []; + let array2: AbcObject[] = []; + let list2: _.List = []; let listIterator = (value: number, index: number, collection: _.List) => 0; let result: number | undefined; - let result2: TResult | undefined; + let result2: AbcObject | undefined; result = _.minBy(array); result = _.minBy(array, listIterator); @@ -9742,7 +9710,7 @@ namespace TestSum { // _.sumBy namespace TestSumBy { let array: number[] | null | undefined = [] as any; - let objectArray: { 'age': number }[] | null | undefined = [] as any; + let objectArray: Array<{ 'age': number }> | null | undefined = [] as any; let list: _.List | null | undefined = [] as any; let objectList: _.List<{ 'age': number }> | null | undefined = [] as any; @@ -10523,7 +10491,7 @@ namespace TestEntries { let object: _.Dictionary = {}; { - let result: [string, string][]; + let result: Array<[string, string]>; result = _.entries(object); } @@ -10546,7 +10514,7 @@ namespace TestEntriesIn { let object: _.Dictionary = {}; { - let result: [string, string][]; + let result: Array<[string, string]>; result = _.entriesIn(object); } @@ -10940,11 +10908,11 @@ namespace TestForIn { type SampleObject = {a: number; b: string; c: boolean;}; let dictionary: _.Dictionary = {}; - let nilDictionary: _.Dictionary | null | undefined = any; + let nilDictionary: _.Dictionary | null | undefined = anything; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => any = (value: number, key: string, collection: _.Dictionary) => 1; let object: SampleObject = { a: 1, b: "", c: true }; - let nilObject: SampleObject | null | undefined = any; + let nilObject: SampleObject | null | undefined = anything; let objectIterator: (element: any, key?: string, collection?: any) => any = (element: any, key?: string, collection?: any) => 1; { @@ -11009,11 +10977,11 @@ namespace TestForInRight { type SampleObject = {a: number; b: string; c: boolean;}; let dictionary: _.Dictionary = {}; - let nilDictionary: _.Dictionary | null | undefined = any; + let nilDictionary: _.Dictionary | null | undefined = anything; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => any = (value: number, key: string, collection: _.Dictionary) => 1; let object: SampleObject = { a: 1, b: "", c: true }; - let nilObject: SampleObject | null | undefined = any; + let nilObject: SampleObject | null | undefined = anything; let objectIterator: (element: any, key?: string, collection?: any) => any = (element: any, key?: string, collection?: any) => 1; { @@ -11078,11 +11046,11 @@ namespace TestForOwn { type SampleObject = {a: number; b: string; c: boolean;}; let dictionary: _.Dictionary = {}; - let nilDictionary: _.Dictionary | null | undefined = any; + let nilDictionary: _.Dictionary | null | undefined = anything; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => any = (value: number, key: string, collection: _.Dictionary) => 1; let object: SampleObject = { a: 1, b: "", c: true }; - let nilObject: SampleObject | null | undefined = any; + let nilObject: SampleObject | null | undefined = anything; let objectIterator: (element: any, key?: string, collection?: any) => any = (element: any, key?: string, collection?: any) => 1; { @@ -11147,11 +11115,11 @@ namespace TestForOwnRight { type SampleObject = {a: number; b: string; c: boolean;}; let dictionary: _.Dictionary = {}; - let nilDictionary: _.Dictionary | null | undefined = any; + let nilDictionary: _.Dictionary | null | undefined = anything; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => any = (value: number, key: string, collection: _.Dictionary) => 1; let object: SampleObject = { a: 1, b: "", c: true }; - let nilObject: SampleObject | null | undefined = any; + let nilObject: SampleObject | null | undefined = anything; let objectIterator: (element: any, key?: string, collection?: any) => any = (element: any, key?: string, collection?: any) => 1; { @@ -11444,7 +11412,7 @@ namespace TestInvert { // _.invertBy namespace TestInvertBy { - let array: ({a: number;})[] = []; + let array: Array<{a: number;}> = []; let list: _.List<{a: number;}> = []; let dictionary: _.Dictionary<{a: number;}> = {}; let numericDictionary: _.NumericDictionary<{a: number;}> = {}; @@ -11539,7 +11507,7 @@ namespace TestInvertBy { // _.keys namespace TestKeys { - let object: _.Dictionary | null | undefined = any; + let object: _.Dictionary | null | undefined = anything; { let result: string[]; @@ -11562,7 +11530,7 @@ namespace TestKeys { // _.keysIn namespace TestKeysIn { - let object: _.Dictionary | null | undefined = any; + let object: _.Dictionary | null | undefined = anything; { let result: string[]; @@ -11585,15 +11553,15 @@ namespace TestKeysIn { // _.mapKeys namespace TestMapKeys { - let array: TResult[] | null | undefined = [] as any; - let list: _.List| null | undefined = [] as any; - let dictionary: _.Dictionary | null | undefined = any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List| null | undefined = [] as any; + let dictionary: _.Dictionary | null | undefined = anything; - let listIterator = (value: TResult, index: number, collection: _.List) => ""; - let dictionaryIterator = (value: TResult, key: string, collection: _.Dictionary) => ""; + let listIterator = (value: AbcObject, index: number, collection: _.List) => ""; + let dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => ""; { - let result: _.Dictionary; + let result: _.Dictionary; result = _.mapKeys(array); result = _.mapKeys(array, listIterator); @@ -11612,7 +11580,7 @@ namespace TestMapKeys { } { - let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(array).mapKeys(); result = _(array).mapKeys(listIterator); @@ -11631,7 +11599,7 @@ namespace TestMapKeys { } { - let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(array).chain().mapKeys(); result = _(array).chain().mapKeys(listIterator); @@ -11772,11 +11740,11 @@ namespace TestMergeWith { // _.omit namespace TestOmit { - let obj: TResult | null | undefined = any; - let dict: { [key: string]: TResult } = { }; + let obj: AbcObject | null | undefined = anything; + let dict: { [key: string]: AbcObject } = { }; { - let result: Partial; + let result: Partial; result = _.omit(obj, 'a'); result = _.omit(obj, 0, 'a'); @@ -11786,7 +11754,7 @@ namespace TestOmit { } { - let result: _.LoDashImplicitWrapper>; + let result: _.LoDashImplicitWrapper>; result = _(obj).omit('a'); result = _(obj).omit(0, 'a'); @@ -11796,7 +11764,7 @@ namespace TestOmit { } { - let result: _.LoDashExplicitWrapper>; + let result: _.LoDashExplicitWrapper>; result = _(obj).chain().omit('a'); result = _(obj).chain().omit(0, 'a'); @@ -11808,99 +11776,82 @@ namespace TestOmit { // _.omitBy namespace TestOmitBy { - let obj: TResult | null | undefined = any; + let obj: AbcObject | null | undefined = anything; let predicate = (element: any, key: string) => true; { - let result: Partial; + let result: Partial; result = _.omitBy(obj, predicate); } { - let result: _.LoDashImplicitWrapper>; + let result: _.LoDashImplicitWrapper>; - result = _(obj).omitBy(predicate); + result = _(obj).omitBy(predicate); } { - let result: _.LoDashExplicitWrapper>; + let result: _.LoDashExplicitWrapper>; - result = _(obj).chain().omitBy(predicate); + result = _(obj).chain().omitBy(predicate); } } // _.pick namespace TestPick { - let obj1: TResult | null | undefined = any; - let obj2: TResult = any; + const obj1: AbcObject | null | undefined = anything; + const obj2: AbcObject = anything; + const readonlyArray: ReadonlyArray = ['a', 'b']; + const literalsArray = ['a' as 'a', 'b' as 'b']; + const roLiteralsArray: ReadonlyArray<'a' | 'b'> = literalsArray; - { - let result: Partial; + _.pick(obj1, 'a'); // $ExpectType PartialDeep + _.pick(obj1, 0, 'a'); // $ExpectType PartialDeep + _.pick(obj1, ['b', 1], 0, 'a'); // $ExpectType PartialDeep + _.pick(obj1, readonlyArray); // $ExpectType PartialDeep + _.pick(obj2, 'a', 'b'); // $ExpectType Pick + _.pick(obj2, literalsArray); // $ExpectType Pick + _.pick(obj2, roLiteralsArray); // $ExpectType Pick - result = _.pick(obj1, 'a'); - result = _.pick(obj1, 0, 'a'); - result = _.pick(obj1, ['b', 1], 0, 'a'); - } + _(obj1).pick('a'); // $ExpectType LoDashImplicitWrapper> + _(obj1).pick(0, 'a'); // $ExpectType LoDashImplicitWrapper> + _(obj1).pick(['b', 1], 0, 'a'); // $ExpectType LoDashImplicitWrapper> + _(obj1).pick(readonlyArray); // $ExpectType LoDashImplicitWrapper> + _(obj2).pick('a', 'b'); // $ExpectType LoDashImplicitWrapper> + _(obj2).pick(literalsArray); // $ExpectType LoDashImplicitWrapper> + _(obj2).pick(roLiteralsArray); // $ExpectType LoDashImplicitWrapper> - { - let result: Pick; - result = _.pick(obj2, 'a', 'b'); - result = _.pick(obj2, ['a' as 'a', 'b' as 'b']); - } - - { - let result: _.LoDashImplicitWrapper>; - - result = _(obj1).pick('a'); - result = _(obj1).pick(0, 'a'); - result = _(obj1).pick(['b', 1], 0, 'a'); - } - - { - let result: _.LoDashImplicitWrapper>; - - result = _(obj2).pick('a', 'b'); - result = _(obj2).pick(['a' as 'a', 'b' as 'b']); - } - - { - let result: _.LoDashExplicitWrapper>; - - result = _(obj1).chain().pick('a'); - result = _(obj1).chain().pick(0, 'a'); - result = _(obj1).chain().pick(['b', 1], 0, 'a'); - } - - { - let result: _.LoDashExplicitWrapper>; - - result = _(obj2).chain().pick('a', 'b'); - result = _(obj2).chain().pick(['a' as 'a', 'b' as 'b']); - } + _.chain(obj1).pick('a'); // $ExpectType LoDashExplicitWrapper> + _.chain(obj1).pick(0, 'a'); // $ExpectType LoDashExplicitWrapper> + _.chain(obj1).pick(['b', 1], 0, 'a'); // $ExpectType LoDashExplicitWrapper> + _.chain(obj1).pick(readonlyArray); // $ExpectType LoDashExplicitWrapper> + _.chain(obj2).pick('a', 'b'); // $ExpectType LoDashExplicitWrapper> + _.chain(obj2).pick(literalsArray); // $ExpectType LoDashExplicitWrapper> + _.chain(obj2).pick(roLiteralsArray); // $ExpectType LoDashExplicitWrapper> } // _.pickBy namespace TestPickBy { - let obj: TResult | null | undefined = any; + let obj: AbcObject | null | undefined = anything; let predicate = (element: any, key: string) => true; { - let result: Partial; + let result: Partial; result = _.pickBy(obj, predicate); } { - let result: _.LoDashImplicitWrapper>; + let result: _.LoDashImplicitWrapper>; - result = _(obj).pickBy(predicate); + result = _(obj).pickBy(predicate); } { - let result: _.LoDashExplicitWrapper>; + let result: _.LoDashExplicitWrapper>; - result = _(obj).chain().pickBy(predicate); + result = _(obj).chain().pickBy(predicate); } } @@ -12065,7 +12016,7 @@ namespace TestToPairs { let object: _.Dictionary = {}; { - let result: [string, string][]; + let result: Array<[string, string]>; result = _.toPairs(object); } @@ -12088,7 +12039,7 @@ namespace TestToPairsIn { let object: _.Dictionary = {}; { - let result: [string, string][]; + let result: Array<[string, string]>; result = _.toPairsIn(object); } @@ -12118,13 +12069,13 @@ namespace TestTransform { let dictionary: _.Dictionary = {}; { - let iterator = (acc: TResult[], curr: number, index?: number, arr?: number[]) => {}; - let accumulator: TResult[] = []; - let result: TResult[]; + let iterator = (acc: AbcObject[], curr: number, index?: number, arr?: number[]) => {}; + let accumulator: AbcObject[] = []; + let result: AbcObject[]; result = _.transform(array); - result = _.transform(array, iterator); - result = _.transform(array, iterator, accumulator); + result = _.transform(array, iterator); + result = _.transform(array, iterator, accumulator); result = _(array).transform().value(); result = _(array).transform(iterator).value(); @@ -12132,37 +12083,37 @@ namespace TestTransform { } { - let iterator = (acc: _.Dictionary, curr: number, index?: number, arr?: number[]) => {}; - let accumulator: _.Dictionary = {}; - let result: _.Dictionary; + let iterator = (acc: _.Dictionary, curr: number, index?: number, arr?: number[]) => {}; + let accumulator: _.Dictionary = {}; + let result: _.Dictionary; - result = _.transform(array, iterator, accumulator); + result = _.transform(array, iterator, accumulator); result = _(array).transform(iterator, accumulator).value(); } { - let iterator = (acc: _.Dictionary, curr: number, key?: string, dict?: _.Dictionary) => {}; - let accumulator: _.Dictionary = {}; - let result: _.Dictionary; + let iterator = (acc: _.Dictionary, curr: number, key?: string, dict?: _.Dictionary) => {}; + let accumulator: _.Dictionary = {}; + let result: _.Dictionary; result = _.transform(dictionary); - result = _.transform(dictionary, iterator); - result = _.transform(dictionary, iterator, accumulator); + result = _.transform(dictionary, iterator); + result = _.transform(dictionary, iterator, accumulator); result = _(dictionary).transform().value(); - result = _(dictionary).transform(iterator).value(); - result = _(dictionary).transform(iterator, accumulator).value(); + result = _(dictionary).transform(iterator).value(); + result = _(dictionary).transform(iterator, accumulator).value(); } { - let iterator = (acc: TResult[], curr: number, key?: string, dict?: _.Dictionary) => {}; - let accumulator: TResult[] = []; - let result: TResult[]; + let iterator = (acc: AbcObject[], curr: number, key?: string, dict?: _.Dictionary) => {}; + let accumulator: AbcObject[] = []; + let result: AbcObject[]; - result = _.transform(dictionary, iterator, accumulator); + result = _.transform(dictionary, iterator, accumulator); - result = _(dictionary).transform(iterator, accumulator).value(); + result = _(dictionary).transform(iterator, accumulator).value(); } } @@ -12395,37 +12346,37 @@ namespace TestValues { // _.valuesIn namespace TestValuesIn { - let object: _.Dictionary = {}; + let object: _.Dictionary = {}; { - let result: TResult[]; + let result: AbcObject[]; result = _.valuesIn(object); } { - let result: TResult[]; + let result: AbcObject[]; // Without this type hint, this will fail to compile, as expected. - result = _.valuesIn({}); + result = _.valuesIn({}); } { - let result: TResult[]; + let result: AbcObject[]; result = _.values(object); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; - result = _(object).valuesIn(); + result = _(object).valuesIn(); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; - result = _(object).chain().valuesIn(); + result = _(object).chain().valuesIn(); } } @@ -12823,7 +12774,7 @@ namespace TestStartsWith { // _.template namespace TestTemplate { interface TemplateExecutor { - (obj?: Object): string; + (obj?: object): string; source: string; } @@ -13318,7 +13269,7 @@ namespace TestIdentity { } { - let input: { a: number; } | null | undefined = any; + let input: { a: number; } | null | undefined = anything; _.identity(input); // $ExpectType { a: number; } | null | undefined _.identity(); // $ExpectType undefined } @@ -13327,13 +13278,13 @@ namespace TestIdentity { // _.iteratee namespace TestIteratee { { - _.iteratee((...args: any[]): TResult => any); // $ExpectType (...args: any[]) => TResult - _.iteratee((a: TResult): boolean => any); // $ExpectType (a: TResult) => boolean - _.iteratee((a: TResult | undefined): a is undefined => any); // $ExpectType (a: TResult | undefined) => a is undefined + _.iteratee((...args: any[]): AbcObject => anything); // $ExpectType (...args: any[]) => AbcObject + _.iteratee((a: AbcObject): boolean => anything); // $ExpectType (a: AbcObject) => boolean + _.iteratee((a: AbcObject | undefined): a is undefined => anything); // $ExpectType (a: AbcObject | undefined) => a is undefined } { - let result: (object: any) => TResult; + let result: (object: any) => AbcObject; result = _.iteratee(''); } @@ -13345,14 +13296,14 @@ namespace TestIteratee { } { - let result: _.LoDashImplicitObjectWrapper<(...args: any[]) => TResult>; + let result: _.LoDashImplicitObjectWrapper<(...args: any[]) => AbcObject>; - let func: (...args: any[]) => TResult = any; + let func: (...args: any[]) => AbcObject = anything; result = _(func).iteratee(); } { - let result: _.LoDashImplicitObjectWrapper<(object: any) => TResult>; + let result: _.LoDashImplicitObjectWrapper<(object: any) => AbcObject>; result = _('').iteratee(); } @@ -13364,14 +13315,14 @@ namespace TestIteratee { } { - let result: _.LoDashExplicitObjectWrapper<(...args: any[]) => TResult>; + let result: _.LoDashExplicitObjectWrapper<(...args: any[]) => AbcObject>; - let func: (...args: any[]) => TResult = any; + let func: (...args: any[]) => AbcObject = anything; result = _(func).chain().iteratee(); } { - let result: _.LoDashExplicitObjectWrapper<(object: any) => TResult>; + let result: _.LoDashExplicitObjectWrapper<(object: any) => AbcObject>; result = _('').chain().iteratee(); } @@ -13385,68 +13336,68 @@ namespace TestIteratee { // _.matches namespace TestMatches { - let source: TResult = { a: 1, b: "", c: true }; + let source: AbcObject = { a: 1, b: "", c: true }; { let result: (value: any) => boolean; - result = _.matches(source); + result = _.matches(source); } { - let result: (value: TResult) => boolean; - result = _.matches(source); + let result: (value: AbcObject) => boolean; + result = _.matches(source); } { - let result: _.LoDashImplicitObjectWrapper<(value: TResult) => boolean>; - result = _(source).matches(); + let result: _.LoDashImplicitObjectWrapper<(value: AbcObject) => boolean>; + result = _(source).matches(); } { - let result: _.LoDashExplicitObjectWrapper<(value: TResult) => boolean>; - result = _(source).chain().matches(); + let result: _.LoDashExplicitObjectWrapper<(value: AbcObject) => boolean>; + result = _(source).chain().matches(); } } // _.matchesProperty -namespace TestMatches { +{ let path: string | string[] = []; - let source: TResult = { a: 1, b: "", c: true }; + let source: AbcObject = { a: 1, b: "", c: true }; { let result: (value: any) => boolean; - result = _.matchesProperty(path, source); + result = _.matchesProperty(path, source); } { - let result: (value: TResult) => boolean; + let result: (value: AbcObject) => boolean; - result = _.matchesProperty(path, source); + result = _.matchesProperty(path, source); } { let result: _.LoDashImplicitObjectWrapper<(value: any) => boolean>; - result = _(path).matchesProperty(source); + result = _(path).matchesProperty(source); } { - let result: _.LoDashImplicitObjectWrapper<(value: TResult) => boolean>; + let result: _.LoDashImplicitObjectWrapper<(value: AbcObject) => boolean>; - result = _(path).matchesProperty(source); + result = _(path).matchesProperty(source); } { let result: _.LoDashExplicitObjectWrapper<(value: any) => boolean>; - result = _(path).chain().matchesProperty(source); + result = _(path).chain().matchesProperty(source); } { - let result: _.LoDashExplicitObjectWrapper<(value: TResult) => boolean>; + let result: _.LoDashExplicitObjectWrapper<(value: AbcObject) => boolean>; - result = _(path).chain().matchesProperty(source); + result = _(path).chain().matchesProperty(source); } } @@ -13456,89 +13407,89 @@ namespace TestMethod { let result: (object: any) => {a: string}; result = _.method('a.0'); - result = _.method('a.0', any, any); - result = _.method('a.0', any, any, any); + result = _.method('a.0', anything, anything); + result = _.method('a.0', anything, anything, anything); result = _.method(['a', 0]); - result = _.method(['a', 0], any); - result = _.method(['a', 0], any, any); - result = _.method(['a', 0], any, any, any); + result = _.method(['a', 0], anything); + result = _.method(['a', 0], anything, anything); + result = _.method(['a', 0], anything, anything, anything); } { let result: (object: {a: string}) => {b: string}; result = _.method('a.0'); - result = _.method('a.0', any, any); - result = _.method('a.0', any, any, any); + result = _.method('a.0', anything, anything); + result = _.method('a.0', anything, anything, anything); result = _.method(['a', 0]); - result = _.method(['a', 0], any); - result = _.method(['a', 0], any, any); - result = _.method(['a', 0], any, any, any); + result = _.method(['a', 0], anything); + result = _.method(['a', 0], anything, anything); + result = _.method(['a', 0], anything, anything, anything); } { let result: _.LoDashImplicitObjectWrapper<(object: any) => {a: string}>; result = _('a.0').method(); - result = _('a.0').method(any); - result = _('a.0').method(any, any); - result = _('a.0').method(any, any, any); + result = _('a.0').method(anything); + result = _('a.0').method(anything, anything); + result = _('a.0').method(anything, anything, anything); result = _(['a', 0]).method(); - result = _(['a', 0]).method(any); - result = _(['a', 0]).method(any, any); - result = _(['a', 0]).method(any, any, any); + result = _(['a', 0]).method(anything); + result = _(['a', 0]).method(anything, anything); + result = _(['a', 0]).method(anything, anything, anything); } { let result: _.LoDashImplicitObjectWrapper<(object: {a: string}) => {b: string}>; result = _('a.0').method(); - result = _('a.0').method(any); - result = _('a.0').method(any, any); - result = _('a.0').method(any, any, any); + result = _('a.0').method(anything); + result = _('a.0').method(anything, anything); + result = _('a.0').method(anything, anything, anything); result = _(['a', 0]).method(); - result = _(['a', 0]).method(any); - result = _(['a', 0]).method(any, any); - result = _(['a', 0]).method(any, any, any); + result = _(['a', 0]).method(anything); + result = _(['a', 0]).method(anything, anything); + result = _(['a', 0]).method(anything, anything, anything); } { let result: _.LoDashExplicitObjectWrapper<(object: any) => {a: string}>; result = _('a.0').chain().method(); - result = _('a.0').chain().method(any); - result = _('a.0').chain().method(any, any); - result = _('a.0').chain().method(any, any, any); + result = _('a.0').chain().method(anything); + result = _('a.0').chain().method(anything, anything); + result = _('a.0').chain().method(anything, anything, anything); result = _(['a', 0]).chain().method(); - result = _(['a', 0]).chain().method(any); - result = _(['a', 0]).chain().method(any, any); - result = _(['a', 0]).chain().method(any, any, any); + result = _(['a', 0]).chain().method(anything); + result = _(['a', 0]).chain().method(anything, anything); + result = _(['a', 0]).chain().method(anything, anything, anything); } { let result: _.LoDashExplicitObjectWrapper<(object: {a: string}) => {b: string}>; result = _('a.0').chain().method(); - result = _('a.0').chain().method(any); - result = _('a.0').chain().method(any, any); - result = _('a.0').chain().method(any, any, any); + result = _('a.0').chain().method(anything); + result = _('a.0').chain().method(anything, anything); + result = _('a.0').chain().method(anything, anything, anything); result = _(['a', 0]).chain().method(); - result = _(['a', 0]).chain().method(any); - result = _(['a', 0]).chain().method(any, any); - result = _(['a', 0]).chain().method(any, any, any); + result = _(['a', 0]).chain().method(anything); + result = _(['a', 0]).chain().method(anything, anything); + result = _(['a', 0]).chain().method(anything, anything, anything); } } // _.methodOf namespace TestMethodOf { - type SampleObject = { a: { b(): TResult }[] }; - type ResultFn = (path: string | string[]) => TResult; + type SampleObject = { a: Array<{ b(): AbcObject }> }; + type ResultFn = (path: string | string[]) => AbcObject; let object: SampleObject = { a: [] }; @@ -13546,34 +13497,34 @@ namespace TestMethodOf { let result: ResultFn; result = _.methodOf(object); - result = _.methodOf(object, any); - result = _.methodOf(object, any, any); - result = _.methodOf(object, any, any, any); + result = _.methodOf(object, anything); + result = _.methodOf(object, anything, anything); + result = _.methodOf(object, anything, anything, anything); } { let result: _.LoDashImplicitObjectWrapper; result = _(object).methodOf(); - result = _(object).methodOf(any); - result = _(object).methodOf(any, any); - result = _(object).methodOf(any, any, any); + result = _(object).methodOf(anything); + result = _(object).methodOf(anything, anything); + result = _(object).methodOf(anything, anything, anything); } { let result: _.LoDashExplicitObjectWrapper; result = _(object).chain().methodOf(); - result = _(object).chain().methodOf(any); - result = _(object).chain().methodOf(any, any); - result = _(object).chain().methodOf(any, any, any); + result = _(object).chain().methodOf(anything); + result = _(object).chain().methodOf(anything, anything); + result = _(object).chain().methodOf(anything, anything, anything); } } // _.mixin namespace TestMixin { let source: _.Dictionary<(...args: any[]) => any> = {}; - let dest: TResult = any; + let dest: AbcObject = anything; let options: {chain?: boolean} = {}; { @@ -13584,7 +13535,7 @@ namespace TestMixin { } { - let result: TResult; + let result: AbcObject; result = _.mixin(dest, source); result = _.mixin(dest, source, options); @@ -13598,7 +13549,7 @@ namespace TestMixin { } { - let result: _.LoDashImplicitWrapper; + let result: _.LoDashImplicitWrapper; result = _(dest).mixin(source); result = _(dest).mixin(source, options); @@ -13612,7 +13563,7 @@ namespace TestMixin { } { - let result: _.LoDashExplicitWrapper; + let result: _.LoDashExplicitWrapper; result = _(dest).chain().mixin(source); result = _(dest).chain().mixin(source, options); @@ -13653,7 +13604,7 @@ namespace TestNoop { result = _([1]).noop(true, 'a', 1); result = _(['']).noop(true, 'a', 1); result = _({}).noop(true, 'a', 1); - result = _(any).noop(true, 'a', 1); + result = _(anything).noop(true, 'a', 1); } { @@ -13663,7 +13614,7 @@ namespace TestNoop { result = _([1]).chain().noop(true, 'a', 1); result = _(['']).chain().noop(true, 'a', 1); result = _({}).chain().noop(true, 'a', 1); - result = _(any).chain().noop(true, 'a', 1); + result = _(anything).chain().noop(true, 'a', 1); } } @@ -13914,7 +13865,7 @@ namespace TestRangeRight { let result: any[]; result = _.stubArray(); - result = _(any).stubArray(); + result = _(anything).stubArray(); } { @@ -13924,7 +13875,7 @@ namespace TestRangeRight { result = _([1]).chain().stubArray(); result = _(['']).chain().stubArray(); result = _({}).chain().stubArray(); - result = _(any).chain().stubArray(); + result = _(anything).chain().stubArray(); } } @@ -13934,7 +13885,7 @@ namespace TestRangeRight { let result: boolean; result = _.stubFalse(); - result = _(any).stubFalse(); + result = _(anything).stubFalse(); } { @@ -13944,27 +13895,27 @@ namespace TestRangeRight { result = _([1]).chain().stubFalse(); result = _(['']).chain().stubFalse(); result = _({}).chain().stubFalse(); - result = _(any).chain().stubFalse(); + result = _(anything).chain().stubFalse(); } } // _.stubObject { { - let result: Object; + let result: object; result = _.stubObject(); - result = _(any).stubObject(); + result = _(anything).stubObject(); } { - let result: _.LoDashExplicitObjectWrapper; + let result: _.LoDashExplicitObjectWrapper; result = _('a').chain().stubObject(); result = _([1]).chain().stubObject(); result = _(['']).chain().stubObject(); result = _({}).chain().stubObject(); - result = _(any).chain().stubObject(); + result = _(anything).chain().stubObject(); } } @@ -13974,7 +13925,7 @@ namespace TestRangeRight { let result: string; result = _.stubString(); - result = _(any).stubString(); + result = _(anything).stubString(); } { @@ -13984,7 +13935,7 @@ namespace TestRangeRight { result = _([1]).chain().stubString(); result = _(['']).chain().stubString(); result = _({}).chain().stubString(); - result = _(any).chain().stubString(); + result = _(anything).chain().stubString(); } } @@ -13994,7 +13945,7 @@ namespace TestRangeRight { let result: boolean; result = _.stubTrue(); - result = _(any).stubTrue(); + result = _(anything).stubTrue(); } { @@ -14004,13 +13955,13 @@ namespace TestRangeRight { result = _([1]).chain().stubTrue(); result = _(['']).chain().stubTrue(); result = _({}).chain().stubTrue(); - result = _(any).chain().stubTrue(); + result = _(anything).chain().stubTrue(); } } // _.times namespace TestTimes { - let iteratee: (num: number) => TResult = (num: number) => ({ a: 1, b: "", c: true }); + let iteratee: (num: number) => AbcObject = (num: number) => ({ a: 1, b: "", c: true }); { let result: number[]; @@ -14020,7 +13971,7 @@ namespace TestTimes { } { - let result: TResult[]; + let result: AbcObject[]; result = _.times(42, iteratee); result = _(42).times(iteratee); @@ -14033,7 +13984,7 @@ namespace TestTimes { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(42).chain().times(iteratee); } @@ -14080,8 +14031,8 @@ namespace TestUniqueId { } } -result = _.VERSION; -result = <_.TemplateSettings>_.templateSettings; +_.VERSION; // $ExpectType string +_.templateSettings; // $ExpectType TemplateSettings // _.partial & _.partialRight { diff --git a/types/lodash/math/add.d.ts b/types/lodash/math/add.d.ts new file mode 100644 index 0000000000..573178e0f4 --- /dev/null +++ b/types/lodash/math/add.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Adds two numbers. + * + * @param augend The first number to add. + * @param addend The second number to add. + * @return Returns the sum. + */ + add( + augend: number, + addend: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.add + */ + add(addend: number): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.add + */ + add(addend: number): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/ceil.d.ts b/types/lodash/math/ceil.d.ts new file mode 100644 index 0000000000..a51048c2f2 --- /dev/null +++ b/types/lodash/math/ceil.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Calculates n rounded up to precision. + * + * @param n The number to round up. + * @param precision The precision to round up to. + * @return Returns the rounded up number. + */ + ceil( + n: number, + precision?: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.ceil + */ + ceil(precision?: number): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.ceil + */ + ceil(precision?: number): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/divide.d.ts b/types/lodash/math/divide.d.ts new file mode 100644 index 0000000000..be6bc0abbd --- /dev/null +++ b/types/lodash/math/divide.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Divide two numbers. + * + * @param dividend The first number in a division. + * @param divisor The second number in a division. + * @returns Returns the quotient. + */ + divide( + dividend: number, + divisor: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.divide + */ + divide(divisor: number): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.divide + */ + divide(divisor: number): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/floor.d.ts b/types/lodash/math/floor.d.ts new file mode 100644 index 0000000000..81b490af1d --- /dev/null +++ b/types/lodash/math/floor.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Calculates n rounded down to precision. + * + * @param n The number to round down. + * @param precision The precision to round down to. + * @return Returns the rounded down number. + */ + floor( + n: number, + precision?: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.floor + */ + floor(precision?: number): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.floor + */ + floor(precision?: number): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/max.d.ts b/types/lodash/math/max.d.ts new file mode 100644 index 0000000000..20efcebef6 --- /dev/null +++ b/types/lodash/math/max.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Computes the maximum value of `array`. If `array` is empty or falsey + * `undefined` is returned. + * + * @category Math + * @param array The array to iterate over. + * @returns Returns the maximum value. + */ + max( + collection: List | null | undefined + ): T | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.max + */ + max(this: LoDashImplicitWrapper | null | undefined>): T | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.max + */ + max(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/maxBy.d.ts b/types/lodash/math/maxBy.d.ts new file mode 100644 index 0000000000..adc787a911 --- /dev/null +++ b/types/lodash/math/maxBy.d.ts @@ -0,0 +1,49 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.max` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * the value is ranked. The iteratee is invoked with one argument: (value). + * + * @category Math + * @param array The array to iterate over. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns the maximum value. + * @example + * + * var objects = [{ 'n': 1 }, { 'n': 2 }]; + * + * _.maxBy(objects, function(o) { return o.a; }); + * // => { 'n': 2 } + * + * // using the `_.property` iteratee shorthand + * _.maxBy(objects, 'n'); + * // => { 'n': 2 } + */ + maxBy( + collection: List | null | undefined, + iteratee?: ListIteratee + ): T | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.maxBy + */ + maxBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): T | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.maxBy + */ + maxBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/mean.d.ts b/types/lodash/math/mean.d.ts new file mode 100644 index 0000000000..ebaa42ce32 --- /dev/null +++ b/types/lodash/math/mean.d.ts @@ -0,0 +1,33 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Computes the mean of the values in `array`. + * + * @category Math + * @param array The array to iterate over. + * @returns Returns the mean. + * @example + * + * _.mean([4, 2, 8, 6]); + * // => 5 + */ + mean( + collection: List | null | undefined + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.mean + */ + mean(): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.mean + */ + mean(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/meanBy.d.ts b/types/lodash/math/meanBy.d.ts new file mode 100644 index 0000000000..a6bf558754 --- /dev/null +++ b/types/lodash/math/meanBy.d.ts @@ -0,0 +1,41 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Computes the mean of the provided propties of the objects in the `array` + * + * @category Math + * @param array The array to iterate over. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns the mean. + * @example + * + * _.mean([{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }], 'n'); + * // => 5 + */ + meanBy( + collection: List | null | undefined, + iteratee?: ListIteratee + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.meanBy + */ + meanBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.meanBy + */ + meanBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/min.d.ts b/types/lodash/math/min.d.ts new file mode 100644 index 0000000000..ac441afa83 --- /dev/null +++ b/types/lodash/math/min.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Computes the minimum value of `array`. If `array` is empty or falsey + * `undefined` is returned. + * + * @category Math + * @param array The array to iterate over. + * @returns Returns the minimum value. + */ + min( + collection: List | null | undefined + ): T | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.min + */ + min(this: LoDashImplicitWrapper | null | undefined>): T | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.min + */ + min(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/minBy.d.ts b/types/lodash/math/minBy.d.ts new file mode 100644 index 0000000000..fad6e5a284 --- /dev/null +++ b/types/lodash/math/minBy.d.ts @@ -0,0 +1,49 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.min` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * the value is ranked. The iteratee is invoked with one argument: (value). + * + * @category Math + * @param array The array to iterate over. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns the minimum value. + * @example + * + * var objects = [{ 'n': 1 }, { 'n': 2 }]; + * + * _.minBy(objects, function(o) { return o.a; }); + * // => { 'n': 1 } + * + * // using the `_.property` iteratee shorthand + * _.minBy(objects, 'n'); + * // => { 'n': 1 } + */ + minBy( + collection: List | null | undefined, + iteratee?: ListIteratee + ): T | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.minBy + */ + minBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): T | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.minBy + */ + minBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/multiply.d.ts b/types/lodash/math/multiply.d.ts new file mode 100644 index 0000000000..0767ee1154 --- /dev/null +++ b/types/lodash/math/multiply.d.ts @@ -0,0 +1,29 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Multiply two numbers. + * @param multiplier The first number in a multiplication. + * @param multiplicand The second number in a multiplication. + * @returns Returns the product. + */ + multiply( + multiplier: number, + multiplicand: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.multiply + */ + multiply(multiplicand: number): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.multiply + */ + multiply(multiplicand: number): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/round.d.ts b/types/lodash/math/round.d.ts new file mode 100644 index 0000000000..59f97c3144 --- /dev/null +++ b/types/lodash/math/round.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Calculates n rounded to precision. + * + * @param n The number to round. + * @param precision The precision to round to. + * @return Returns the rounded number. + */ + round( + n: number, + precision?: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.round + */ + round(precision?: number): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.round + */ + round(precision?: number): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/subtract.d.ts b/types/lodash/math/subtract.d.ts new file mode 100644 index 0000000000..5b627db982 --- /dev/null +++ b/types/lodash/math/subtract.d.ts @@ -0,0 +1,39 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Subtract two numbers. + * + * @category Math + * @param minuend The first number in a subtraction. + * @param subtrahend The second number in a subtraction. + * @returns Returns the difference. + * @example + * + * _.subtract(6, 4); + * // => 2 + */ + subtract( + minuend: number, + subtrahend: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.subtract + */ + subtract( + subtrahend: number + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.subtract + */ + subtract( + subtrahend: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/sum.d.ts b/types/lodash/math/sum.d.ts new file mode 100644 index 0000000000..ab9222900d --- /dev/null +++ b/types/lodash/math/sum.d.ts @@ -0,0 +1,31 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Computes the sum of the values in `array`. + * + * @category Math + * @param array The array to iterate over. + * @returns Returns the sum. + * @example + * + * _.sum([4, 2, 8, 6]); + * // => 20 + */ + sum(collection: List | null | undefined): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sum + */ + sum(): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sum + */ + sum(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/sumBy.d.ts b/types/lodash/math/sumBy.d.ts new file mode 100644 index 0000000000..240dca6919 --- /dev/null +++ b/types/lodash/math/sumBy.d.ts @@ -0,0 +1,53 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.sum` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the value to be summed. + * The iteratee is invoked with one argument: (value). + * + * @category Math + * @param array The array to iterate over. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns the sum. + * @example + * + * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; + * + * _.sumBy(objects, function(o) { return o.n; }); + * // => 20 + * + * // using the `_.property` iteratee shorthand + * _.sumBy(objects, 'n'); + * // => 20 + */ + sumBy( + collection: List | null | undefined, + iteratee?: ((value: T) => number) | string + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sumBy + */ + sumBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: ((value: T) => number) | string + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sumBy + */ + sumBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: ((value: T) => number) | string + ): LoDashExplicitWrapper; + } + + /********** + * Number * + **********/ +} \ No newline at end of file diff --git a/types/lodash/number/clamp.d.ts b/types/lodash/number/clamp.d.ts new file mode 100644 index 0000000000..af2b47c995 --- /dev/null +++ b/types/lodash/number/clamp.d.ts @@ -0,0 +1,56 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @category Number + * @param number The number to clamp. + * @param [lower] The lower bound. + * @param upper The upper bound. + * @returns Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ + clamp( + number: number, + lower: number, + upper: number + ): number; + clamp( + number: number, + upper: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.clamp + */ + clamp( + lower: number, + upper: number + ): number; + clamp( + upper: number + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.clamp + */ + clamp( + lower: number, + upper: number + ): LoDashExplicitWrapper; + clamp( + upper: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/number/inRange.d.ts b/types/lodash/number/inRange.d.ts new file mode 100644 index 0000000000..c3215a1c0f --- /dev/null +++ b/types/lodash/number/inRange.d.ts @@ -0,0 +1,39 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start + * with start then set to 0. + * + * @param n The number to check. + * @param start The start of the range. + * @param end The end of the range. + * @return Returns true if n is in the range, else false. + */ + inRange( + n: number, + start: number, + end?: number + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.inRange + */ + inRange( + start: number, + end?: number + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.inRange + */ + inRange( + start: number, + end?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/number/random.d.ts b/types/lodash/number/random.d.ts new file mode 100644 index 0000000000..a6522326f6 --- /dev/null +++ b/types/lodash/number/random.d.ts @@ -0,0 +1,85 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Produces a random number between min and max (inclusive). If only one argument is provided a number between + * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point + * number is returned instead of an integer. + * + * @param min The minimum possible value. + * @param max The maximum possible value. + * @param floating Specify returning a floating-point number. + * @return Returns the random number. + */ + random( + floating?: boolean + ): number; + + /** + * @see _.random + */ + random( + max: number, + floating?: boolean + ): number; + + /** + * @see _.random + */ + random( + min: number, + max: number, + floating?: boolean + ): number; + + /** + * Produces a random number between min and max (inclusive). If only one argument is provided a number between + * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point + * number is returned instead of an integer. + * + * @param min The minimum possible value. + * @param index Not used in this overload. + * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. + * @return Returns the random number. + */ + random( + min: number, + index: string | number, + guard: object + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.random + */ + random(floating?: boolean): number; + + /** + * @see _.random + */ + random( + max: number, + floating?: boolean + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.random + */ + random(floating?: boolean): LoDashExplicitWrapper; + + /** + * @see _.random + */ + random( + max: number, + floating?: boolean + ): LoDashExplicitWrapper; + } + + /********** + * Object * + **********/ +} \ No newline at end of file diff --git a/types/lodash/object/assign.d.ts b/types/lodash/object/assign.d.ts new file mode 100644 index 0000000000..17d282a8ec --- /dev/null +++ b/types/lodash/object/assign.d.ts @@ -0,0 +1,172 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Assigns own enumerable properties of source objects to the destination + * object. Source objects are applied from left to right. Subsequent sources + * overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @category Object + * @param object The destination object. + * @param [sources] The source objects. + * @returns Returns `object`. + * @example + * + * function Foo() { + * this.c = 3; + * } + * + * function Bar() { + * this.e = 5; + * } + * + * Foo.prototype.d = 4; + * Bar.prototype.f = 6; + * + * _.assign({ 'a': 1 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3, 'e': 5 } + */ + assign( + object: TObject, + source: TSource + ): TObject & TSource; + + /** + * @see assign + */ + assign( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TObject & TSource1 & TSource2; + + /** + * @see assign + */ + assign( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see assign + */ + assign( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.assign + */ + assign(object: TObject): TObject; + + /** + * @see _.assign + */ + assign( + object: any, + ...otherArgs: any[] + ): any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.assign + */ + assign( + source: TSource + ): LoDashImplicitWrapper; + + /** + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitWrapper; + + /** + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashImplicitWrapper; + + /** + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashImplicitWrapper; + + /** + * @see _.assign + */ + assign(): LoDashImplicitWrapper; + + /** + * @see _.assign + */ + assign(...otherArgs: any[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.assign + */ + assign( + source: TSource + ): LoDashExplicitWrapper; + + /** + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitWrapper; + + /** + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitWrapper; + + /** + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitWrapper; + + /** + * @see _.assign + */ + assign(): LoDashExplicitWrapper; + + /** + * @see _.assign + */ + assign(...otherArgs: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/assignIn.d.ts b/types/lodash/object/assignIn.d.ts new file mode 100644 index 0000000000..01b38f7efa --- /dev/null +++ b/types/lodash/object/assignIn.d.ts @@ -0,0 +1,171 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @alias extend + * @category Object + * @param object The destination object. + * @param [sources] The source objects. + * @returns Returns `object`. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * function Bar() { + * this.d = 4; + * } + * + * Foo.prototype.c = 3; + * Bar.prototype.e = 5; + * + * _.assignIn({ 'a': 1 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } + */ + assignIn( + object: TObject, + source: TSource + ): TObject & TSource; + + /** + * @see assignIn + */ + assignIn( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TObject & TSource1 & TSource2; + + /** + * @see assignIn + */ + assignIn( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see assignIn + */ + assignIn( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.assignIn + */ + assignIn(object: TObject): TObject; + + /** + * @see _.assignIn + */ + assignIn( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.assignIn + */ + assignIn( + source: TSource + ): LoDashImplicitWrapper; + + /** + * @see assignIn + */ + assignIn( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitWrapper; + + /** + * @see assignIn + */ + assignIn( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashImplicitWrapper; + + /** + * @see assignIn + */ + assignIn( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashImplicitWrapper; + + /** + * @see _.assignIn + */ + assignIn(): LoDashImplicitWrapper; + + /** + * @see _.assignIn + */ + assignIn(...otherArgs: any[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.assignIn + */ + assignIn( + source: TSource + ): LoDashExplicitWrapper; + + /** + * @see assignIn + */ + assignIn( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitWrapper; + + /** + * @see assignIn + */ + assignIn( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitWrapper; + + /** + * @see assignIn + */ + assignIn( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitWrapper; + + /** + * @see _.assignIn + */ + assignIn(): LoDashExplicitWrapper; + + /** + * @see _.assignIn + */ + assignIn(...otherArgs: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/assignInWith.d.ts b/types/lodash/object/assignInWith.d.ts new file mode 100644 index 0000000000..776a81b580 --- /dev/null +++ b/types/lodash/object/assignInWith.d.ts @@ -0,0 +1,183 @@ +import _ = require("../index"); +declare module "../index" { + type AssignCustomizer = (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}) => any; + + interface LoDashStatic { + /** + * This method is like `_.assignIn` except that it accepts `customizer` which + * is invoked to produce the assigned values. If `customizer` returns `undefined` + * assignment is handled by the method instead. The `customizer` is invoked + * with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @alias extendWith + * @category Object + * @param object The destination object. + * @param sources The source objects. + * @param [customizer] The function to customize assigned values. + * @returns Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + assignInWith( + object: TObject, + source: TSource, + customizer: AssignCustomizer + ): TObject & TSource; + + /** + * @see assignInWith + */ + assignInWith( + object: TObject, + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2; + + /** + * @see assignInWith + */ + assignInWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see assignInWith + */ + assignInWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.assignInWith + */ + assignInWith(object: TObject): TObject; + + /** + * @see _.assignInWith + */ + assignInWith( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.assignInWith + */ + assignInWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see assignInWith + */ + assignInWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see assignInWith + */ + assignInWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see assignInWith + */ + assignInWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see _.assignInWith + */ + assignInWith(): LoDashImplicitWrapper; + + /** + * @see _.assignInWith + */ + assignInWith(...otherArgs: any[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.assignInWith + */ + assignInWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see assignInWith + */ + assignInWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see assignInWith + */ + assignInWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see assignInWith + */ + assignInWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.assignInWith + */ + assignInWith(): LoDashExplicitWrapper; + + /** + * @see _.assignInWith + */ + assignInWith(...otherArgs: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/assignWith.d.ts b/types/lodash/object/assignWith.d.ts new file mode 100644 index 0000000000..4b98ad5e53 --- /dev/null +++ b/types/lodash/object/assignWith.d.ts @@ -0,0 +1,180 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.assign` except that it accepts `customizer` which + * is invoked to produce the assigned values. If `customizer` returns `undefined` + * assignment is handled by the method instead. The `customizer` is invoked + * with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @category Object + * @param object The destination object. + * @param sources The source objects. + * @param [customizer] The function to customize assigned values. + * @returns Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + assignWith( + object: TObject, + source: TSource, + customizer: AssignCustomizer + ): TObject & TSource; + + /** + * @see assignWith + */ + assignWith( + object: TObject, + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2; + + /** + * @see assignWith + */ + assignWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see assignWith + */ + assignWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.assignWith + */ + assignWith(object: TObject): TObject; + + /** + * @see _.assignWith + */ + assignWith( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.assignWith + */ + assignWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see assignWith + */ + assignWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see assignWith + */ + assignWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see assignWith + */ + assignWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see _.assignWith + */ + assignWith(): LoDashImplicitWrapper; + + /** + * @see _.assignWith + */ + assignWith(...otherArgs: any[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.assignWith + */ + assignWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see assignWith + */ + assignWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see assignWith + */ + assignWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see assignWith + */ + assignWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.assignWith + */ + assignWith(): LoDashExplicitWrapper; + + /** + * @see _.assignWith + */ + assignWith(...otherArgs: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/at.d.ts b/types/lodash/object/at.d.ts new file mode 100644 index 0000000000..c95f8c9600 --- /dev/null +++ b/types/lodash/object/at.d.ts @@ -0,0 +1,61 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be + * specified as individual arguments or as arrays of keys. + * + * @param object The object to iterate over. + * @param props The property names or indexes of elements to pick, specified individually or in arrays. + * @return Returns the new array of picked elements. + */ + at( + object: List | Dictionary | null | undefined, + ...props: PropertyPath[] + ): T[]; + + /** + * @see _.at + */ + at( + object: T | null | undefined, + ...props: Array> + ): Array; + } + + interface LoDashImplicitWrapper { + /** + * @see _.at + */ + at( + this: LoDashImplicitWrapper | Dictionary | null | undefined>, + ...props: PropertyPath[] + ): LoDashImplicitWrapper; + + /** + * @see _.at + */ + at( + this: LoDashImplicitWrapper, + ...props: Array> + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.at + */ + at( + this: LoDashExplicitWrapper | Dictionary | null | undefined>, + ...props: PropertyPath[] + ): LoDashExplicitWrapper; + + /** + * @see _.at + */ + at( + this: LoDashExplicitWrapper, + ...props: Array> + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/create.d.ts b/types/lodash/object/create.d.ts new file mode 100644 index 0000000000..836cc05425 --- /dev/null +++ b/types/lodash/object/create.d.ts @@ -0,0 +1,31 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an object that inherits from the given prototype object. If a properties object is provided its own + * enumerable properties are assigned to the created object. + * + * @param prototype The object to inherit from. + * @param properties The properties to assign to the object. + * @return Returns the new object. + */ + create( + prototype: T, + properties?: U + ): T & U; + } + + interface LoDashImplicitWrapper { + /** + * @see _.create + */ + create(properties?: U): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.create + */ + create(properties?: U): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/defaults.d.ts b/types/lodash/object/defaults.d.ts new file mode 100644 index 0000000000..956d5b4022 --- /dev/null +++ b/types/lodash/object/defaults.d.ts @@ -0,0 +1,155 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Assigns own enumerable properties of source object(s) to the destination object for all destination + * properties that resolve to undefined. Once a property is set, additional values of the same property are + * ignored. + * + * Note: This method mutates object. + * + * @param object The destination object. + * @param sources The source objects. + * @return The destination object. + */ + defaults( + object: TObject, + source: TSource + ): TSource & TObject; + + /** + * @see _.defaults + */ + defaults( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TSource2 & TSource1 & TObject; + + /** + * @see _.defaults + */ + defaults( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): TSource3 & TSource2 & TSource1 & TObject; + + /** + * @see _.defaults + */ + defaults( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): TSource4 & TSource3 & TSource2 & TSource1 & TObject; + + /** + * @see _.defaults + */ + defaults(object: TObject): TObject; + + /** + * @see _.defaults + */ + defaults( + object: any, + ...sources: any[] + ): any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.defaults + */ + defaults( + source: TSource + ): LoDashImplicitWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashImplicitWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashImplicitWrapper; + + /** + * @see _.defaults + */ + defaults(): LoDashImplicitWrapper; + + /** + * @see _.defaults + */ + defaults(...sources: any[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.defaults + */ + defaults( + source: TSource + ): LoDashExplicitWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitWrapper; + + /** + * @see _.defaults + */ + defaults(): LoDashExplicitWrapper; + + /** + * @see _.defaults + */ + defaults(...sources: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/defaultsDeep.d.ts b/types/lodash/object/defaultsDeep.d.ts new file mode 100644 index 0000000000..a9aa5d6b53 --- /dev/null +++ b/types/lodash/object/defaultsDeep.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.defaults except that it recursively assigns default properties. + * @param object The destination object. + * @param sources The source objects. + * @return Returns object. + **/ + defaultsDeep( + object: any, + ...sources: any[]): any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.defaultsDeep + **/ + defaultsDeep(...sources: any[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.defaultsDeep + **/ + defaultsDeep(...sources: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/entries.d.ts b/types/lodash/object/entries.d.ts new file mode 100644 index 0000000000..786b2a7abd --- /dev/null +++ b/types/lodash/object/entries.d.ts @@ -0,0 +1,38 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * @see _.toPairs + */ + entries(object?: Dictionary): Array<[string, T]>; + + /** + * @see _.toPairs + */ + entries(object?: object): Array<[string, any]>; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toPairs + */ + entries(this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + + /** + * @see _.toPairs + */ + entries(): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toPairs + */ + entries(this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + + /** + * @see _.toPairs + */ + entries(): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/entriesIn.d.ts b/types/lodash/object/entriesIn.d.ts new file mode 100644 index 0000000000..fcd378032e --- /dev/null +++ b/types/lodash/object/entriesIn.d.ts @@ -0,0 +1,38 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * @see _.entriesIn + */ + entriesIn(object?: Dictionary): Array<[string, T]>; + + /** + * @see _.entriesIn + */ + entriesIn(object?: object): Array<[string, any]>; + } + + interface LoDashImplicitWrapper { + /** + * @see _.entriesIn + */ + entriesIn(this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + + /** + * @see _.entriesIn + */ + entriesIn(): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.entriesIn + */ + entriesIn(this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + + /** + * @see _.entriesIn + */ + entriesIn(): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/extend.d.ts b/types/lodash/object/extend.d.ts new file mode 100644 index 0000000000..3bdace2de1 --- /dev/null +++ b/types/lodash/object/extend.d.ts @@ -0,0 +1,147 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * @see _.extend + */ + extend( + object: TObject, + source: TSource + ): TObject & TSource; + + /** + * @see _.extend + */ + extend( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TObject & TSource1 & TSource2; + + /** + * @see _.extend + */ + extend( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see _.extend + */ + extend( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.extend + */ + extend(object: TObject): TObject; + + /** + * @see _.extend + */ + extend( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.extend + */ + extend( + source: TSource + ): LoDashImplicitWrapper; + + /** + * @see _.extend + */ + extend( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitWrapper; + + /** + * @see _.extend + */ + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashImplicitWrapper; + + /** + * @see _.extend + */ + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashImplicitWrapper; + + /** + * @see _.extend + */ + extend(): LoDashImplicitWrapper; + + /** + * @see _.extend + */ + extend(...otherArgs: any[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.extend + */ + extend( + source: TSource + ): LoDashExplicitWrapper; + + /** + * @see _.extend + */ + extend( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitWrapper; + + /** + * @see _.extend + */ + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitWrapper; + + /** + * @see _.extend + */ + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitWrapper; + + /** + * @see _.extend + */ + extend(): LoDashExplicitWrapper; + + /** + * @see _.extend + */ + extend(...otherArgs: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/extendWith.d.ts b/types/lodash/object/extendWith.d.ts new file mode 100644 index 0000000000..191c69dd8b --- /dev/null +++ b/types/lodash/object/extendWith.d.ts @@ -0,0 +1,159 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * @see _.extendWith + */ + extendWith( + object: TObject, + source: TSource, + customizer: AssignCustomizer + ): TObject & TSource; + + /** + * @see _.extendWith + */ + extendWith( + object: TObject, + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2; + + /** + * @see _.extendWith + */ + extendWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see _.extendWith + */ + extendWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.extendWith + */ + extendWith(object: TObject): TObject; + + /** + * @see _.extendWith + */ + extendWith( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.extendWith + */ + extendWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see _.extendWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see _.extendWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see _.extendWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see _.extendWith + */ + extendWith(): LoDashImplicitWrapper; + + /** + * @see _.extendWith + */ + extendWith(...otherArgs: any[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.extendWith + */ + extendWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.extendWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.extendWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.extendWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.extendWith + */ + extendWith(): LoDashExplicitWrapper; + + /** + * @see _.extendWith + */ + extendWith(...otherArgs: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/findKey.d.ts b/types/lodash/object/findKey.d.ts new file mode 100644 index 0000000000..2e35165e24 --- /dev/null +++ b/types/lodash/object/findKey.d.ts @@ -0,0 +1,47 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.find except that it returns the key of the first element predicate returns truthy for + * instead of the element itself. + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param object The object to search. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the key of the matched element, else undefined. + */ + findKey( + object: T | null | undefined, + predicate?: ObjectIteratee + ): string | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.findKey + */ + findKey( + this: LoDashImplicitWrapper, + predicate?: ObjectIteratee + ): string | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.findKey + */ + findKey( + this: LoDashExplicitWrapper, + predicate?: ObjectIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/findLastKey.d.ts b/types/lodash/object/findLastKey.d.ts new file mode 100644 index 0000000000..6a43330138 --- /dev/null +++ b/types/lodash/object/findLastKey.d.ts @@ -0,0 +1,46 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.findKey except that it iterates over elements of a collection in the opposite order. + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param object The object to search. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the key of the matched element, else undefined. + */ + findLastKey( + object: T | null | undefined, + predicate?: ObjectIteratee + ): string | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.findLastKey + */ + findLastKey( + this: LoDashImplicitWrapper, + predicate?: ObjectIteratee + ): string | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.findLastKey + */ + findLastKey( + this: LoDashExplicitWrapper, + predicate?: ObjectIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/forIn.d.ts b/types/lodash/object/forIn.d.ts new file mode 100644 index 0000000000..7fa7e14a33 --- /dev/null +++ b/types/lodash/object/forIn.d.ts @@ -0,0 +1,37 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The + * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may + * exit iteration early by explicitly returning false. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns object. + */ + forIn( + object: T, + iteratee?: ObjectIterator + ): T; + + /** + * @see _.forIn + */ + forIn( + object: T | null | undefined, + iteratee?: ObjectIterator + ): T | null | undefined; + } + + interface LoDashWrapper { + /** + * @see _.forIn + */ + forIn( + this: LoDashWrapper, + iteratee?: ObjectIterator + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/object/forInRight.d.ts b/types/lodash/object/forInRight.d.ts new file mode 100644 index 0000000000..0364db0403 --- /dev/null +++ b/types/lodash/object/forInRight.d.ts @@ -0,0 +1,35 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.forIn except that it iterates over properties of object in the opposite order. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns object. + */ + forInRight( + object: T, + iteratee?: ObjectIterator + ): T; + + /** + * @see _.forInRight + */ + forInRight( + object: T | null | undefined, + iteratee?: ObjectIterator + ): T | null | undefined; + } + + interface LoDashWrapper { + /** + * @see _.forInRight + */ + forInRight( + this: LoDashWrapper, + iteratee?: ObjectIterator + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/object/forOwn.d.ts b/types/lodash/object/forOwn.d.ts new file mode 100644 index 0000000000..eeeb4adef6 --- /dev/null +++ b/types/lodash/object/forOwn.d.ts @@ -0,0 +1,37 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is + * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning false. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns object. + */ + forOwn( + object: T, + iteratee?: ObjectIterator + ): T; + + /** + * @see _.forOwn + */ + forOwn( + object: T | null | undefined, + iteratee?: ObjectIterator + ): T | null | undefined; + } + + interface LoDashWrapper { + /** + * @see _.forOwn + */ + forOwn( + this: LoDashWrapper, + iteratee?: ObjectIterator + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/object/forOwnRight.d.ts b/types/lodash/object/forOwnRight.d.ts new file mode 100644 index 0000000000..e760dfa78f --- /dev/null +++ b/types/lodash/object/forOwnRight.d.ts @@ -0,0 +1,35 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.forOwn except that it iterates over properties of object in the opposite order. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns object. + */ + forOwnRight( + object: T, + iteratee?: ObjectIterator + ): T; + + /** + * @see _.forOwnRight + */ + forOwnRight( + object: T | null | undefined, + iteratee?: ObjectIterator + ): T | null | undefined; + } + + interface LoDashWrapper { + /** + * @see _.forOwnRight + */ + forOwnRight( + this: LoDashWrapper, + iteratee?: ObjectIterator + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/object/functions.d.ts b/types/lodash/object/functions.d.ts new file mode 100644 index 0000000000..bcc15d01e8 --- /dev/null +++ b/types/lodash/object/functions.d.ts @@ -0,0 +1,39 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @category Object + * @param object The object to inspect. + * @returns Returns the new array of property names. + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ + functions(object: any): string[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.functions + */ + functions(): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.functions + */ + functions(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/functionsIn.d.ts b/types/lodash/object/functionsIn.d.ts new file mode 100644 index 0000000000..84b8e88959 --- /dev/null +++ b/types/lodash/object/functionsIn.d.ts @@ -0,0 +1,39 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @category Object + * @param object The object to inspect. + * @returns Returns the new array of property names. + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ + functionsIn(object: any): string[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.functionsIn + */ + functionsIn(): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.functionsIn + */ + functionsIn(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/get.d.ts b/types/lodash/object/get.d.ts new file mode 100644 index 0000000000..ff793192fb --- /dev/null +++ b/types/lodash/object/get.d.ts @@ -0,0 +1,238 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used + * in its place. + * + * @param object The object to query. + * @param path The path of the property to get. + * @param defaultValue The value returned if the resolved value is undefined. + * @return Returns the resolved value. + */ + get( + object: TObject, + path: TKey | [TKey] + ): TObject[TKey]; + + /** + * @see _.get + */ + get( + object: TObject | null | undefined, + path: TKey | [TKey] + ): TObject[TKey] | undefined; + + /** + * @see _.get + */ + get( + object: TObject | null | undefined, + path: TKey | [TKey], + defaultValue: TDefault + ): TObject[TKey] | TDefault; + + /** + * @see _.get + */ + get( + object: NumericDictionary, + path: number + ): T; + + /** + * @see _.get + */ + get( + object: NumericDictionary | null | undefined, + path: number + ): T | undefined; + + /** + * @see _.get + */ + get( + object: NumericDictionary | null | undefined, + path: number, + defaultValue: TDefault + ): T | TDefault; + + /** + * @see _.get + */ + get( + object: null | undefined, + path: PropertyPath, + defaultValue: TDefault + ): TDefault; + + /** + * @see _.get + */ + get( + object: null | undefined, + path: PropertyPath + ): undefined; + + /** + * @see _.get + */ + get( + object: any, + path: PropertyPath, + defaultValue?: any + ): any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.get + */ + get( + path: TKey | [TKey] + ): TValue[TKey]; + + /** + * @see _.get + */ + get( + this: LoDashImplicitWrapper, + path: TKey | [TKey], + ): TObject[TKey] | undefined; + + /** + * @see _.get + */ + get( + this: LoDashImplicitWrapper, + path: TKey | [TKey], + defaultValue: TDefault + ): TObject[TKey] | TDefault; + + /** + * @see _.get + */ + get( + this: LoDashImplicitWrapper>, + path: number + ): T; + + /** + * @see _.get + */ + get( + this: LoDashImplicitWrapper | null | undefined>, + path: number + ): T | undefined; + + /** + * @see _.get + */ + get( + this: LoDashImplicitWrapper | null | undefined>, + path: number, + defaultValue: TDefault + ): T | TDefault; + + /** + * @see _.get + */ + get( + this: LoDashImplicitWrapper, + path: PropertyPath, + defaultValue: TDefault + ): TDefault; + + /** + * @see _.get + */ + get( + this: LoDashImplicitWrapper, + path: PropertyPath + ): undefined; + + /** + * @see _.get + */ + get( + path: PropertyPath, + defaultValue?: any + ): any; + } + + interface LoDashExplicitWrapper { + /** + * @see _.get + */ + get( + path: TKey | [TKey] + ): LoDashExplicitWrapper; + + /** + * @see _.get + */ + get( + this: LoDashExplicitWrapper, + path: TKey | [TKey], + ): LoDashExplicitWrapper; + + /** + * @see _.get + */ + get( + this: LoDashExplicitWrapper, + path: TKey | [TKey], + defaultValue: TDefault + ): LoDashExplicitWrapper; + + /** + * @see _.get + */ + get( + this: LoDashExplicitWrapper>, + path: number + ): LoDashExplicitWrapper; + + /** + * @see _.get + */ + get( + this: LoDashExplicitWrapper | null | undefined>, + path: number + ): LoDashExplicitWrapper; + + /** + * @see _.get + */ + get( + this: LoDashExplicitWrapper | null | undefined>, + path: number, + defaultValue: TDefault + ): LoDashExplicitWrapper; + + /** + * @see _.get + */ + get( + this: LoDashExplicitWrapper, + path: PropertyPath, + defaultValue: TDefault + ): LoDashExplicitWrapper; + + /** + * @see _.get + */ + get( + this: LoDashExplicitWrapper, + path: PropertyPath + ): LoDashExplicitWrapper; + + /** + * @see _.get + */ + get( + path: PropertyPath, + defaultValue?: any + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/has.d.ts b/types/lodash/object/has.d.ts new file mode 100644 index 0000000000..53026153d1 --- /dev/null +++ b/types/lodash/object/has.d.ts @@ -0,0 +1,47 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if `path` is a direct property of `object`. + * + * @category Object + * @param object The object to query. + * @param path The path to check. + * @returns Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': { 'c': 3 } } }; + * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b.c'); + * // => true + * + * _.has(object, ['a', 'b', 'c']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + has( + object: T, + path: PropertyPath + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.has + */ + has(path: PropertyPath): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.has + */ + has(path: PropertyPath): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/hasIn.d.ts b/types/lodash/object/hasIn.d.ts new file mode 100644 index 0000000000..5da20394b2 --- /dev/null +++ b/types/lodash/object/hasIn.d.ts @@ -0,0 +1,46 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if `path` is a direct or inherited property of `object`. + * + * @category Object + * @param object The object to query. + * @param path The path to check. + * @returns Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b.c'); + * // => true + * + * _.hasIn(object, ['a', 'b', 'c']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ + hasIn( + object: T, + path: PropertyPath + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.hasIn + */ + hasIn(path: PropertyPath): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.hasIn + */ + hasIn(path: PropertyPath): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/invert.d.ts b/types/lodash/object/invert.d.ts new file mode 100644 index 0000000000..d5c62aa9af --- /dev/null +++ b/types/lodash/object/invert.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an object composed of the inverted keys and values of object. If object contains duplicate values, + * subsequent values overwrite property assignments of previous values unless multiValue is true. + * + * @param object The object to invert. + * @param multiValue Allow multiple values per key. + * @return Returns the new inverted object. + */ + invert( + object: object + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.invert + */ + invert(): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.invert + */ + invert(): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/invertBy.d.ts b/types/lodash/object/invertBy.d.ts new file mode 100644 index 0000000000..12b90969e1 --- /dev/null +++ b/types/lodash/object/invertBy.d.ts @@ -0,0 +1,62 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.invert except that the inverted object is generated from the results of running each + * element of object through iteratee. The corresponding inverted value of each inverted key is an array of + * keys responsible for generating the inverted value. The iteratee is invoked with one argument: (value). + * + * @param object The object to invert. + * @param interatee The iteratee invoked per element. + * @return Returns the new inverted object. + */ + invertBy( + object: List | Dictionary | NumericDictionary | null | undefined, + interatee?: ValueIteratee + ): Dictionary; + + /** + * @see _.invertBy + */ + invertBy( + object: T | null | undefined, + interatee?: ValueIteratee + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.invertBy + */ + invertBy( + this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>, + interatee?: ValueIteratee + ): LoDashImplicitWrapper>; + + /** + * @see _.invertBy + */ + invertBy( + this: LoDashImplicitWrapper, + interatee?: ValueIteratee + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.invertBy + */ + invertBy( + this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>, + interatee?: ValueIteratee + ): LoDashExplicitWrapper>; + + /** + * @see _.invertBy + */ + invertBy( + this: LoDashExplicitWrapper, + interatee?: ValueIteratee + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/invoke.d.ts b/types/lodash/object/invoke.d.ts new file mode 100644 index 0000000000..9405c4fa6c --- /dev/null +++ b/types/lodash/object/invoke.d.ts @@ -0,0 +1,33 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Invokes the method at path of object. + * @param object The object to query. + * @param path The path of the method to invoke. + * @param args The arguments to invoke the method with. + **/ + invoke( + object: any, + path: PropertyPath, + ...args: any[]): any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.invoke + **/ + invoke( + path: PropertyPath, + ...args: any[]): any; + } + + interface LoDashExplicitWrapper { + /** + * @see _.invoke + **/ + invoke( + path: PropertyPath, + ...args: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/keys.d.ts b/types/lodash/object/keys.d.ts new file mode 100644 index 0000000000..374e64ad2c --- /dev/null +++ b/types/lodash/object/keys.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of the own enumerable property names of object. + * + * Note: Non-object values are coerced to objects. See the ES spec for more details. + * + * @param object The object to query. + * @return Returns the array of property names. + */ + keys(object?: any): string[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.keys + */ + keys(): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.keys + */ + keys(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/keysIn.d.ts b/types/lodash/object/keysIn.d.ts new file mode 100644 index 0000000000..fe05763414 --- /dev/null +++ b/types/lodash/object/keysIn.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of the own and inherited enumerable property names of object. + * + * Note: Non-object values are coerced to objects. + * + * @param object The object to query. + * @return An array of property names. + */ + keysIn(object?: any): string[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.keysIn + */ + keysIn(): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.keysIn + */ + keysIn(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/mapKeys.d.ts b/types/lodash/object/mapKeys.d.ts new file mode 100644 index 0000000000..620977cdb1 --- /dev/null +++ b/types/lodash/object/mapKeys.d.ts @@ -0,0 +1,86 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated + * by running each own enumerable property of object through iteratee. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the new mapped object. + */ + mapKeys( + object: List | null | undefined, + iteratee?: ListIteratee + ): Dictionary; + + /** + * @see _.mapKeys + */ + mapKeys( + object: Dictionary | null | undefined, + iteratee?: DictionaryIteratee + ): Dictionary; + + /** + * @see _.mapKeys + */ + mapKeys( + object: object | null | undefined, + iteratee?: ObjectIteratee + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.mapKeys + */ + mapKeys( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): LoDashImplicitWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: DictionaryIteratee + ): LoDashImplicitWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + this: LoDashImplicitWrapper, + iteratee?: ObjectIteratee + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.mapKeys + */ + mapKeys( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): LoDashExplicitWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: DictionaryIteratee + ): LoDashExplicitWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + this: LoDashExplicitWrapper, + iteratee?: ObjectIteratee + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/mapValues.d.ts b/types/lodash/object/mapValues.d.ts new file mode 100644 index 0000000000..e71e1c7f3e --- /dev/null +++ b/types/lodash/object/mapValues.d.ts @@ -0,0 +1,189 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an object with the same keys as object and values generated by running each own + * enumerable property of object through iteratee. The iteratee function is bound to thisArg + * and invoked with three arguments: (value, key, object). + * + * If a property name is provided iteratee the created "_.property" style callback returns + * the property value of the given element. + * + * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns + * true for elements that have a matching property value, else false;. + * + * If an object is provided for iteratee the created "_.matches" style callback returns true + * for elements that have the properties of the given object, else false. + * + * @param object The object to iterate over. + * @param [iteratee=_.identity] The function invoked per iteration. + * @param [thisArg] The `this` binding of `iteratee`. + * @return Returns the new mapped object. + */ + mapValues(obj: T | null | undefined, callback: ObjectIterator): { [P in keyof T]: TResult }; + + /** + * @see _.mapValues + */ + mapValues(obj: T | null | undefined, iteratee: object): { [P in keyof T]: boolean }; + + /** + * @see _.mapValues + */ + mapValues(obj: Dictionary | null | undefined, iteratee: TKey): Dictionary; + + /** + * @see _.mapValues + */ + mapValues(obj: T | null | undefined, iteratee: string): { [P in keyof T]: any }; + + /** + * @see _.mapValues + */ + mapValues(obj: string | null | undefined, callback: StringIterator): NumericDictionary; + + /** + * @see _.mapValues + */ + mapValues(obj: Dictionary | null | undefined): Dictionary; + + /** + * @see _.mapValues + */ + mapValues(obj: T): T; + + /** + * @see _.mapValues + */ + mapValues(obj: T | null | undefined): T | {}; + + /** + * @see _.mapValues + */ + mapValues(obj: string | null | undefined): NumericDictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.mapValues + */ + mapValues( + this: LoDashImplicitWrapper, + callback: ObjectIterator + ): LoDashImplicitWrapper<{ [P in keyof T]: TResult }>; + + /** + * @see _.mapValues + */ + mapValues( + this: LoDashImplicitWrapper, + iteratee: object + ): LoDashImplicitWrapper<{ [P in keyof T]: boolean }>; + + /** + * @see _.mapValues + */ + mapValues( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: TKey + ): LoDashImplicitWrapper>; + + /** + * @see _.mapValues + */ + mapValues( + this: LoDashImplicitWrapper, + iteratee: string + ): LoDashImplicitWrapper<{ [P in keyof T]: any }>; + + /** + * @see _.mapValues + */ + mapValues( + this: LoDashImplicitWrapper, + callback: StringIterator + ): LoDashImplicitWrapper>; + + /** + * @see _.mapValues + */ + mapValues(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper>; + + /** + * @see _.mapValues + */ + mapValues(this: LoDashImplicitWrapper): LoDashImplicitWrapper; + + /** + * @see _.mapValues + */ + mapValues(this: LoDashImplicitWrapper): LoDashImplicitWrapper; + + /** + * @see _.mapValues + */ + mapValues(this: LoDashImplicitWrapper): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.mapValues + */ + mapValues( + this: LoDashExplicitWrapper, + callback: ObjectIterator + ): LoDashExplicitWrapper<{ [P in keyof T]: TResult }>; + + /** + * @see _.mapValues + */ + mapValues( + this: LoDashExplicitWrapper, + iteratee: object + ): LoDashExplicitWrapper<{ [P in keyof T]: boolean }>; + + /** + * @see _.mapValues + */ + mapValues( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: TKey + ): LoDashExplicitWrapper>; + + /** + * @see _.mapValues + */ + mapValues( + this: LoDashExplicitWrapper, + iteratee: string + ): LoDashExplicitWrapper<{ [P in keyof T]: any }>; + + /** + * @see _.mapValues + */ + mapValues( + this: LoDashExplicitWrapper, + callback: StringIterator + ): LoDashExplicitWrapper>; + + /** + * @see _.mapValues + */ + mapValues(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper>; + + /** + * @see _.mapValues + */ + mapValues(this: LoDashExplicitWrapper): LoDashExplicitWrapper; + + /** + * @see _.mapValues + */ + mapValues(this: LoDashExplicitWrapper): LoDashExplicitWrapper; + + /** + * @see _.mapValues + */ + mapValues(this: LoDashExplicitWrapper): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/merge.d.ts b/types/lodash/object/merge.d.ts new file mode 100644 index 0000000000..0c18e6cfe5 --- /dev/null +++ b/types/lodash/object/merge.d.ts @@ -0,0 +1,156 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Recursively merges own and inherited enumerable properties of source + * objects into the destination object, skipping source properties that resolve + * to `undefined`. Array and plain object properties are merged recursively. + * Other objects and value types are overridden by assignment. Source objects + * are applied from left to right. Subsequent sources overwrite property + * assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @category Object + * @param object The destination object. + * @param [sources] The source objects. + * @returns Returns `object`. + * @example + * + * var users = { + * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] + * }; + * + * var ages = { + * 'data': [{ 'age': 36 }, { 'age': 40 }] + * }; + * + * _.merge(users, ages); + * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } + */ + merge( + object: TObject, + source: TSource + ): TObject & TSource; + + /** + * @see _.merge + */ + merge( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TObject & TSource1 & TSource2; + + /** + * @see _.merge + */ + merge( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see _.merge + */ + merge( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.merge + */ + merge( + object: any, + ...otherArgs: any[] + ): any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.merge + */ + merge( + source: TSource + ): LoDashImplicitWrapper; + + /** + * @see _.merge + */ + merge( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitWrapper; + + /** + * @see _.merge + */ + merge( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashImplicitWrapper; + + /** + * @see _.merge + */ + merge( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashImplicitWrapper; + + /** + * @see _.merge + */ + merge( + ...otherArgs: any[] + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.merge + */ + merge( + source: TSource + ): LoDashExplicitWrapper; + + /** + * @see _.merge + */ + merge( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitWrapper; + + /** + * @see _.merge + */ + merge( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitWrapper; + + /** + * @see _.merge + */ + merge( + ): LoDashExplicitWrapper; + + /** + * @see _.merge + */ + merge( + ...otherArgs: any[] + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/mergeWith.d.ts b/types/lodash/object/mergeWith.d.ts new file mode 100644 index 0000000000..01fb9264e6 --- /dev/null +++ b/types/lodash/object/mergeWith.d.ts @@ -0,0 +1,133 @@ +import _ = require("../index"); +declare module "../index" { + type MergeWithCustomizer = { bivariantHack(value: any, srcValue: any, key: string, object: any, source: any): any; }["bivariantHack"] + + interface LoDashStatic { + /** + * This method is like `_.merge` except that it accepts `customizer` which + * is invoked to produce the merged values of the destination and source + * properties. If `customizer` returns `undefined` merging is handled by the + * method instead. The `customizer` is invoked with seven arguments: + * (objValue, srcValue, key, object, source, stack). + * + * @category Object + * @param object The destination object. + * @param sources The source objects. + * @param customizer The function to customize assigned values. + * @returns Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * if (_.isArray(objValue)) { + * return objValue.concat(srcValue); + * } + * } + * + * var object = { + * 'fruits': ['apple'], + * 'vegetables': ['beet'] + * }; + * + * var other = { + * 'fruits': ['banana'], + * 'vegetables': ['carrot'] + * }; + * + * _.merge(object, other, customizer); + * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } + */ + mergeWith( + object: TObject, + source: TSource, + customizer: MergeWithCustomizer + ): TObject & TSource; + + /** + * @see _.mergeWith + */ + mergeWith( + object: TObject, + source1: TSource1, + source2: TSource2, + customizer: MergeWithCustomizer + ): TObject & TSource1 & TSource2; + + /** + * @see _.mergeWith + */ + mergeWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: MergeWithCustomizer + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see _.mergeWith + */ + mergeWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: MergeWithCustomizer + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.mergeWith + */ + mergeWith( + object: any, + ...otherArgs: any[] + ): any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.mergeWith + */ + mergeWith( + source: TSource, + customizer: MergeWithCustomizer + ): LoDashImplicitWrapper; + + /** + * @see _.mergeWith + */ + mergeWith( + source1: TSource1, + source2: TSource2, + customizer: MergeWithCustomizer + ): LoDashImplicitWrapper; + + /** + * @see _.mergeWith + */ + mergeWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: MergeWithCustomizer + ): LoDashImplicitWrapper; + + /** + * @see _.mergeWith + */ + mergeWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: MergeWithCustomizer + ): LoDashImplicitWrapper; + + /** + * @see _.mergeWith + */ + mergeWith( + ...otherArgs: any[] + ): LoDashImplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/omit.d.ts b/types/lodash/object/omit.d.ts new file mode 100644 index 0000000000..8684b37b61 --- /dev/null +++ b/types/lodash/object/omit.d.ts @@ -0,0 +1,69 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable properties of `object` that are not omitted. + * + * @category Object + * @param object The source object. + * @param [paths] The property names to omit, specified + * individually or in arrays.. + * @returns Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } + */ + omit( + object: Dictionary, + ...paths: PropertyPath[] + ): Dictionary; + + /** + * @see _.omit + */ + omit( + object: T | null | undefined, + ...paths: PropertyPath[] + ): PartialObject; + } + + interface LoDashImplicitWrapper { + /** + * @see _.omit + */ + omit( + this: LoDashImplicitWrapper>, + ...paths: PropertyPath[] + ): LoDashImplicitWrapper>; + + /** + * @see _.omit + */ + omit( + this: LoDashImplicitWrapper, + ...paths: PropertyPath[] + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.omit + */ + omit( + this: LoDashExplicitWrapper>, + ...paths: PropertyPath[] + ): LoDashExplicitWrapper>; + + /** + * @see _.omit + */ + omit( + this: LoDashExplicitWrapper, + ...paths: PropertyPath[] + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/omitBy.d.ts b/types/lodash/object/omitBy.d.ts new file mode 100644 index 0000000000..d6c762e496 --- /dev/null +++ b/types/lodash/object/omitBy.d.ts @@ -0,0 +1,45 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * The opposite of `_.pickBy`; this method creates an object composed of the + * own and inherited enumerable properties of `object` that `predicate` + * doesn't return truthy for. + * + * @category Object + * @param object The source object. + * @param [predicate=_.identity] The function invoked per property. + * @returns Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omitBy(object, _.isNumber); + * // => { 'b': '2' } + */ + omitBy( + object: T | null | undefined, + predicate: ValueKeyIteratee + ): PartialObject; + } + + interface LoDashImplicitWrapper { + /** + * @see _.omitBy + */ + omitBy( + this: LoDashImplicitWrapper, + predicate: ValueKeyIteratee + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.omitBy + */ + omitBy( + this: LoDashExplicitWrapper, + predicate: ValueKeyIteratee + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/pick.d.ts b/types/lodash/object/pick.d.ts new file mode 100644 index 0000000000..0561c58630 --- /dev/null +++ b/types/lodash/object/pick.d.ts @@ -0,0 +1,68 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an object composed of the picked `object` properties. + * + * @category Object + * @param object The source object. + * @param [props] The property names to pick, specified + * individually or in arrays. + * @returns Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + pick( + object: T, + ...props: Array> + ): Pick; + + /** + * @see _.pick + */ + pick( + object: T | null | undefined, + ...props: PropertyPath[] + ): PartialDeep; + } + + interface LoDashImplicitWrapper { + /** + * @see _.pick + */ + pick( + this: LoDashImplicitWrapper, + ...props: Array> + ): LoDashImplicitWrapper>; + + /** + * @see _.pick + */ + pick( + this: LoDashImplicitWrapper, + ...props: PropertyPath[] + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.pick + */ + pick( + this: LoDashExplicitWrapper, + ...props: Array> + ): LoDashExplicitWrapper>; + + /** + * @see _.pick + */ + pick( + this: LoDashExplicitWrapper, + ...props: PropertyPath[] + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/pickBy.d.ts b/types/lodash/object/pickBy.d.ts new file mode 100644 index 0000000000..98b3c717dc --- /dev/null +++ b/types/lodash/object/pickBy.d.ts @@ -0,0 +1,44 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an object composed of the `object` properties `predicate` returns + * truthy for. The predicate is invoked with two arguments: (value, key). + * + * @category Object + * @param object The source object. + * @param [predicate=_.identity] The function invoked per property. + * @returns Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pickBy(object, _.isNumber); + * // => { 'a': 1, 'c': 3 } + */ + pickBy( + object: T | null | undefined, + predicate?: ValueKeyIteratee + ): PartialObject; + } + + interface LoDashImplicitWrapper { + /** + * @see _.pickBy + */ + pickBy( + this: LoDashImplicitWrapper, + predicate?: ValueKeyIteratee + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.pickBy + */ + pickBy( + this: LoDashExplicitWrapper, + predicate?: ValueKeyIteratee + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/result.d.ts b/types/lodash/object/result.d.ts new file mode 100644 index 0000000000..ea06014ae5 --- /dev/null +++ b/types/lodash/object/result.d.ts @@ -0,0 +1,39 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.get except that if the resolved value is a function it’s invoked with the this binding + * of its parent object and its result is returned. + * + * @param object The object to query. + * @param path The path of the property to resolve. + * @param defaultValue The value returned if the resolved value is undefined. + * @return Returns the resolved value. + */ + result( + object: any, + path: PropertyPath, + defaultValue?: TResult|((...args: any[]) => TResult) + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.result + */ + result( + path: PropertyPath, + defaultValue?: TResult|((...args: any[]) => TResult) + ): TResult; + } + + interface LoDashExplicitWrapper { + /** + * @see _.result + */ + result( + path: PropertyPath, + defaultValue?: TResult|((...args: any[]) => TResult) + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/set.d.ts b/types/lodash/object/set.d.ts new file mode 100644 index 0000000000..fe406347e7 --- /dev/null +++ b/types/lodash/object/set.d.ts @@ -0,0 +1,65 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for + * missing index properties while objects are created for all other missing properties. Use _.setWith to + * customize path creation. + * + * @param object The object to modify. + * @param path The path of the property to set. + * @param value The value to set. + * @return Returns object. + */ + set( + object: T, + path: PropertyPath, + value: any + ): T; + + /** + * @see _.set + */ + set( + object: object, + path: PropertyPath, + value: any + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.set + */ + set( + path: PropertyPath, + value: any + ): this; + + /** + * @see _.set + */ + set( + path: PropertyPath, + value: any + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.set + */ + set( + path: PropertyPath, + value: any + ): this; + + /** + * @see _.set + */ + set( + path: PropertyPath, + value: any + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/setWith.d.ts b/types/lodash/object/setWith.d.ts new file mode 100644 index 0000000000..63f470180b --- /dev/null +++ b/types/lodash/object/setWith.d.ts @@ -0,0 +1,71 @@ +import _ = require("../index"); +declare module "../index" { + type SetWithCustomizer = (nsValue: any, key: string, nsObject: T) => any; + + interface LoDashStatic { + /** + * This method is like _.set except that it accepts customizer which is invoked to produce the objects of + * path. If customizer returns undefined path creation is handled by the method instead. The customizer is + * invoked with three arguments: (nsValue, key, nsObject). + * + * @param object The object to modify. + * @param path The path of the property to set. + * @param value The value to set. + * @parem customizer The function to customize assigned values. + * @return Returns object. + */ + setWith( + object: T, + path: PropertyPath, + value: any, + customizer?: SetWithCustomizer + ): T; + + setWith( + object: T, + path: PropertyPath, + value: any, + customizer?: SetWithCustomizer + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.setWith + */ + setWith( + path: PropertyPath, + value: any, + customizer?: SetWithCustomizer + ): this; + + /** + * @see _.setWith + */ + setWith( + path: PropertyPath, + value: any, + customizer?: SetWithCustomizer + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.setWith + */ + setWith( + path: PropertyPath, + value: any, + customizer?: SetWithCustomizer + ): this; + + /** + * @see _.setWith + */ + setWith( + path: PropertyPath, + value: any, + customizer?: SetWithCustomizer + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/toPairs.d.ts b/types/lodash/object/toPairs.d.ts new file mode 100644 index 0000000000..42c4edab2f --- /dev/null +++ b/types/lodash/object/toPairs.d.ts @@ -0,0 +1,41 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of own enumerable key-value pairs for object. + * + * @param object The object to query. + * @return Returns the new array of key-value pairs. + */ + toPairs(object?: Dictionary): Array<[string, T]>; + + /** + * @see _.toPairs + */ + toPairs(object?: object): Array<[string, any]>; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toPairs + */ + toPairs(this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + + /** + * @see _.toPairs + */ + toPairs(): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toPairs + */ + toPairs(this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + + /** + * @see _.toPairs + */ + toPairs(): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/toPairsIn.d.ts b/types/lodash/object/toPairsIn.d.ts new file mode 100644 index 0000000000..ee6818c212 --- /dev/null +++ b/types/lodash/object/toPairsIn.d.ts @@ -0,0 +1,41 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of own and inherited enumerable key-value pairs for object. + * + * @param object The object to query. + * @return Returns the new array of key-value pairs. + */ + toPairsIn(object?: Dictionary): Array<[string, T]>; + + /** + * @see _.toPairsIn + */ + toPairsIn(object?: object): Array<[string, any]>; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toPairsIn + */ + toPairsIn(this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + + /** + * @see _.toPairsIn + */ + toPairsIn(): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toPairsIn + */ + toPairsIn(this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + + /** + * @see _.toPairsIn + */ + toPairsIn(): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/transform.d.ts b/types/lodash/object/transform.d.ts new file mode 100644 index 0000000000..817f51a4b2 --- /dev/null +++ b/types/lodash/object/transform.d.ts @@ -0,0 +1,163 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of + * running each of its own enumerable properties through iteratee, with each invocation potentially mutating + * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, + * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param accumulator The custom accumulator value. + * @param thisArg The this binding of iteratee. + * @return Returns the accumulated value. + */ + transform( + object: T[], + iteratee: MemoVoidArrayIterator, + accumulator?: TResult[] + ): TResult[]; + + /** + * @see _.transform + */ + transform( + object: T[], + iteratee: MemoVoidArrayIterator>, + accumulator: Dictionary + ): Dictionary; + + /** + * @see _.transform + */ + transform( + object: Dictionary, + iteratee: MemoVoidDictionaryIterator>, + accumulator?: Dictionary + ): Dictionary; + + /** + * @see _.transform + */ + transform( + object: Dictionary, + iteratee: MemoVoidDictionaryIterator, + accumulator: TResult[] + ): TResult[]; + + /** + * @see _.transform + */ + transform( + object: any[], + ): any[]; + + /** + * @see _.transform + */ + transform( + object: object, + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.transform + */ + transform( + this: LoDashImplicitWrapper, + iteratee: MemoVoidArrayIterator, + accumulator?: TResult[] + ): LoDashImplicitWrapper; + + /** + * @see _.transform + */ + transform( + this: LoDashImplicitWrapper, + iteratee: MemoVoidArrayIterator>, + accumulator: Dictionary + ): LoDashImplicitWrapper>; + + /** + * @see _.transform + */ + transform( + this: LoDashImplicitWrapper>, + iteratee: MemoVoidDictionaryIterator>, + accumulator?: Dictionary + ): LoDashImplicitWrapper>; + + /** + * @see _.transform + */ + transform( + this: LoDashImplicitWrapper>, + iteratee: MemoVoidDictionaryIterator, + accumulator: TResult[] + ): LoDashImplicitWrapper; + + /** + * @see _.transform + */ + transform( + this: LoDashImplicitWrapper, + ): LoDashImplicitWrapper; + + /** + * @see _.transform + */ + transform(): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.transform + */ + transform( + this: LoDashExplicitWrapper, + iteratee: MemoVoidArrayIterator, + accumulator?: TResult[] + ): LoDashExplicitWrapper; + + /** + * @see _.transform + */ + transform( + this: LoDashExplicitWrapper, + iteratee: MemoVoidArrayIterator>, + accumulator?: Dictionary + ): LoDashExplicitWrapper>; + + /** + * @see _.transform + */ + transform( + this: LoDashExplicitWrapper>, + iteratee: MemoVoidDictionaryIterator>, + accumulator?: Dictionary + ): LoDashExplicitWrapper>; + + /** + * @see _.transform + */ + transform( + this: LoDashExplicitWrapper>, + iteratee: MemoVoidDictionaryIterator, + accumulator?: TResult[] + ): LoDashExplicitWrapper; + + /** + * @see _.transform + */ + transform( + this: LoDashExplicitWrapper, + ): LoDashExplicitWrapper; + + /** + * @see _.transform + */ + transform(): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/unset.d.ts b/types/lodash/object/unset.d.ts new file mode 100644 index 0000000000..0cf4b56f92 --- /dev/null +++ b/types/lodash/object/unset.d.ts @@ -0,0 +1,32 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Removes the property at path of object. + * + * Note: This method mutates object. + * + * @param object The object to modify. + * @param path The path of the property to unset. + * @return Returns true if the property is deleted, else false. + */ + unset( + object: any, + path: PropertyPath + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.unset + */ + unset(path: PropertyPath): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.unset + */ + unset(path: PropertyPath): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/update.d.ts b/types/lodash/object/update.d.ts new file mode 100644 index 0000000000..4289efca72 --- /dev/null +++ b/types/lodash/object/update.d.ts @@ -0,0 +1,39 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to + * customize path creation. The updater is invoked with one argument: (value). + * + * @param object The object to modify. + * @param path The path of the property to set. + * @param updater The function to produce the updated value. + * @return Returns object. + */ + update( + object: object, + path: PropertyPath, + updater: (value: any) => any + ): any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.update + */ + update( + path: PropertyPath, + updater: (value: any) => any + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.update + */ + update( + path: PropertyPath, + updater: (value: any) => any + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/updateWith.d.ts b/types/lodash/object/updateWith.d.ts new file mode 100644 index 0000000000..4da0be8ce5 --- /dev/null +++ b/types/lodash/object/updateWith.d.ts @@ -0,0 +1,83 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.update` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @since 4.6.0 + * @category Object + * @param object The object to modify. + * @param path The path of the property to set. + * @param updater The function to produce the updated value. + * @param [customizer] The function to customize assigned values. + * @returns Returns `object`. + * @example + * + * var object = {}; + * + * _.updateWith(object, '[0][1]', _.constant('a'), Object); + * // => { '0': { '1': 'a' } } + */ + updateWith( + object: T, + path: PropertyPath, + updater: (oldValue: any) => any, + customizer?: SetWithCustomizer + ): T; + + /** + * @see _.updateWith + */ + updateWith( + object: T, + path: PropertyPath, + updater: (oldValue: any) => any, + customizer?: SetWithCustomizer + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.updateWith + */ + updateWith( + path: PropertyPath, + updater: (oldValue: any) => any, + customizer?: SetWithCustomizer + ): this; + + /** + * @see _.updateWith + */ + updateWith( + path: PropertyPath, + updater: (oldValue: any) => any, + customizer?: SetWithCustomizer + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.updateWith + */ + updateWith( + path: PropertyPath, + updater: (oldValue: any) => any, + customizer?: SetWithCustomizer + ): this; + + /** + * @see _.updateWith + */ + updateWith( + path: PropertyPath, + updater: (oldValue: any) => any, + customizer?: SetWithCustomizer + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/values.d.ts b/types/lodash/object/values.d.ts new file mode 100644 index 0000000000..d1dfa1177b --- /dev/null +++ b/types/lodash/object/values.d.ts @@ -0,0 +1,56 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of the own enumerable property values of object. + * + * @param object The object to query. + * @return Returns an array of property values. + */ + values(object: Dictionary|NumericDictionary|List | null | undefined): T[]; + + /** + * @see _.values + */ + values(object: T | null | undefined): Array; + + /** + * @see _.values + */ + values(object: any): any[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.values + */ + values(this: LoDashImplicitWrapper | NumericDictionary | List | null | undefined>): LoDashImplicitWrapper; + + /** + * @see _.values + */ + values(this: LoDashImplicitWrapper): LoDashImplicitWrapper>; + + /** + * @see _.values + */ + values(): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.values + */ + values(this: LoDashExplicitWrapper | NumericDictionary | List | null | undefined>): LoDashExplicitWrapper; + + /** + * @see _.values + */ + values(this: LoDashExplicitWrapper): LoDashExplicitWrapper>; + + /** + * @see _.values + */ + values(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/valuesIn.d.ts b/types/lodash/object/valuesIn.d.ts new file mode 100644 index 0000000000..22730438f5 --- /dev/null +++ b/types/lodash/object/valuesIn.d.ts @@ -0,0 +1,41 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of the own and inherited enumerable property values of object. + * + * @param object The object to query. + * @return Returns the array of property values. + */ + valuesIn(object: Dictionary|NumericDictionary|List | null | undefined): T[]; + + /** + * @see _.valuesIn + */ + valuesIn(object: T | null | undefined): Array; + } + + interface LoDashImplicitWrapper { + /** + * @see _.valuesIn + */ + valuesIn(this: LoDashImplicitWrapper | NumericDictionary | List | null | undefined>): LoDashImplicitWrapper; + + /** + * @see _.valuesIn + */ + valuesIn(this: LoDashImplicitWrapper): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.valuesIn + */ + valuesIn(this: LoDashExplicitWrapper | NumericDictionary | List | null | undefined>): LoDashExplicitWrapper; + + /** + * @see _.valuesIn + */ + valuesIn(this: LoDashExplicitWrapper): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/seq/chain.d.ts b/types/lodash/seq/chain.d.ts new file mode 100644 index 0000000000..9edc42f881 --- /dev/null +++ b/types/lodash/seq/chain.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a lodash object that wraps value with explicit method chaining enabled. + * + * @param value The value to wrap. + * @return Returns the new lodash wrapper instance. + */ + chain(value: T): LoDashExplicitWrapper; + } + + interface LoDashImplicitWrapper { + /** + * @see _.chain + */ + chain(): LoDashExplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.chain + */ + chain(): this; + } +} \ No newline at end of file diff --git a/types/lodash/seq/prototype.at.d.ts b/types/lodash/seq/prototype.at.d.ts new file mode 100644 index 0000000000..3a6a35d69b --- /dev/null +++ b/types/lodash/seq/prototype.at.d.ts @@ -0,0 +1,12 @@ +// import _ = require("../index"); +// declare module "../index" { +// interface LoDashWrapper { +// /** +// * This method is the wrapper version of _.at. +// * +// * @ +// * @return Returns the new lodash wrapper instance. +// */ +// at(paths: string|string[]): this; +// } +// } \ No newline at end of file diff --git a/types/lodash/seq/prototype.chain.d.ts b/types/lodash/seq/prototype.chain.d.ts new file mode 100644 index 0000000000..9edc42f881 --- /dev/null +++ b/types/lodash/seq/prototype.chain.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a lodash object that wraps value with explicit method chaining enabled. + * + * @param value The value to wrap. + * @return Returns the new lodash wrapper instance. + */ + chain(value: T): LoDashExplicitWrapper; + } + + interface LoDashImplicitWrapper { + /** + * @see _.chain + */ + chain(): LoDashExplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.chain + */ + chain(): this; + } +} \ No newline at end of file diff --git a/types/lodash/seq/prototype.commit.d.ts b/types/lodash/seq/prototype.commit.d.ts new file mode 100644 index 0000000000..f22477f2f9 --- /dev/null +++ b/types/lodash/seq/prototype.commit.d.ts @@ -0,0 +1,11 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashWrapper { + /** + * Executes the chained sequence and returns the wrapped result. + * + * @return Returns the new lodash wrapper instance. + */ + commit(): this; + } +} \ No newline at end of file diff --git a/types/lodash/seq/prototype.plant.d.ts b/types/lodash/seq/prototype.plant.d.ts new file mode 100644 index 0000000000..6025b09381 --- /dev/null +++ b/types/lodash/seq/prototype.plant.d.ts @@ -0,0 +1,18 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashImplicitWrapper { + /** + * Creates a clone of the chained sequence planting value as the wrapped value. + * @param value The value to plant as the wrapped value. + * @return Returns the new lodash wrapper instance. + */ + plant(value: T): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.plant + */ + plant(value: T): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/seq/prototype.reverse.d.ts b/types/lodash/seq/prototype.reverse.d.ts new file mode 100644 index 0000000000..66526e729b --- /dev/null +++ b/types/lodash/seq/prototype.reverse.d.ts @@ -0,0 +1,14 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashWrapper { + /** + * Reverses the wrapped array so the first element becomes the last, the second element becomes the second to + * last, and so on. + * + * Note: This method mutates the wrapped array. + * + * @return Returns the new reversed lodash wrapper instance. + */ + reverse(): this; + } +} \ No newline at end of file diff --git a/types/lodash/seq/prototype.toJSON.d.ts b/types/lodash/seq/prototype.toJSON.d.ts new file mode 100644 index 0000000000..22da767aec --- /dev/null +++ b/types/lodash/seq/prototype.toJSON.d.ts @@ -0,0 +1,9 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashWrapper { + /** + * @see _.value + */ + toJSON(): TValue; + } +} \ No newline at end of file diff --git a/types/lodash/seq/prototype.toString.d.ts b/types/lodash/seq/prototype.toString.d.ts new file mode 100644 index 0000000000..4deef48ec0 --- /dev/null +++ b/types/lodash/seq/prototype.toString.d.ts @@ -0,0 +1,11 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashWrapper { + /** + * Produces the result of coercing the unwrapped value to a string. + * + * @return Returns the coerced string value. + */ + toString(): string; + } +} \ No newline at end of file diff --git a/types/lodash/seq/prototype.value.d.ts b/types/lodash/seq/prototype.value.d.ts new file mode 100644 index 0000000000..9ba88a8250 --- /dev/null +++ b/types/lodash/seq/prototype.value.d.ts @@ -0,0 +1,13 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashWrapper { + /** + * Executes the chained sequence to extract the unwrapped value. + * + * @alias _.toJSON, _.valueOf + * + * @return Returns the resolved unwrapped value. + */ + value(): TValue; + } +} \ No newline at end of file diff --git a/types/lodash/seq/prototype.valueOf.d.ts b/types/lodash/seq/prototype.valueOf.d.ts new file mode 100644 index 0000000000..6a69f1f202 --- /dev/null +++ b/types/lodash/seq/prototype.valueOf.d.ts @@ -0,0 +1,9 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashWrapper { + /** + * @see _.value + */ + valueOf(): TValue; + } +} \ No newline at end of file diff --git a/types/lodash/seq/tap.d.ts b/types/lodash/seq/tap.d.ts new file mode 100644 index 0000000000..dd4fc8d754 --- /dev/null +++ b/types/lodash/seq/tap.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one + * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations + * on intermediate results within the chain. + * + * @param value The value to provide to interceptor. + * @param interceptor The function to invoke. + * @parem thisArg The this binding of interceptor. + * @return Returns value. + **/ + tap( + value: T, + interceptor: (value: T) => void + ): T; + } + + interface LoDashWrapper { + /** + * @see _.tap + */ + tap( + interceptor: (value: TValue) => void + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/seq/thru.d.ts b/types/lodash/seq/thru.d.ts new file mode 100644 index 0000000000..295011945a --- /dev/null +++ b/types/lodash/seq/thru.d.ts @@ -0,0 +1,31 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.tap except that it returns the result of interceptor. + * + * @param value The value to provide to interceptor. + * @param interceptor The function to invoke. + * @param thisArg The this binding of interceptor. + * @return Returns the result of interceptor. + */ + thru( + value: T, + interceptor: (value: T) => TResult + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.thru + */ + thru(interceptor: (value: TValue) => TResult): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.thru + */ + thru(interceptor: (value: TValue) => TResult): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/camelCase.d.ts b/types/lodash/string/camelCase.d.ts new file mode 100644 index 0000000000..8362137353 --- /dev/null +++ b/types/lodash/string/camelCase.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts string to camel case. + * + * @param string The string to convert. + * @return Returns the camel cased string. + */ + camelCase(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.camelCase + */ + camelCase(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.camelCase + */ + camelCase(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/capitalize.d.ts b/types/lodash/string/capitalize.d.ts new file mode 100644 index 0000000000..678f1c1de6 --- /dev/null +++ b/types/lodash/string/capitalize.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts the first character of string to upper case and the remaining to lower case. + * + * @param string The string to capitalize. + * @return Returns the capitalized string. + */ + capitalize(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.capitalize + */ + capitalize(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.capitalize + */ + capitalize(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/deburr.d.ts b/types/lodash/string/deburr.d.ts new file mode 100644 index 0000000000..85d3476be1 --- /dev/null +++ b/types/lodash/string/deburr.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Deburrs string by converting latin-1 supplementary letters to basic latin letters and removing combining + * diacritical marks. + * + * @param string The string to deburr. + * @return Returns the deburred string. + */ + deburr(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.deburr + */ + deburr(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.deburr + */ + deburr(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/endsWith.d.ts b/types/lodash/string/endsWith.d.ts new file mode 100644 index 0000000000..383c0acc41 --- /dev/null +++ b/types/lodash/string/endsWith.d.ts @@ -0,0 +1,38 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if string ends with the given target string. + * + * @param string The string to search. + * @param target The string to search for. + * @param position The position to search from. + * @return Returns true if string ends with target, else false. + */ + endsWith( + string?: string, + target?: string, + position?: number + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.endsWith + */ + endsWith( + target?: string, + position?: number + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.endsWith + */ + endsWith( + target?: string, + position?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/escape.d.ts b/types/lodash/string/escape.d.ts new file mode 100644 index 0000000000..21131ee05f --- /dev/null +++ b/types/lodash/string/escape.d.ts @@ -0,0 +1,37 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts the characters "&", "<", ">", '"', "'", and "`" in string to their corresponding HTML entities. + * + * Note: No other characters are escaped. To escape additional characters use a third-party library like he. + * + * hough the ">" character is escaped for symmetry, characters like ">" and "/" don’t need escaping in HTML + * and have no special meaning unless they're part of a tag or unquoted attribute value. See Mathias Bynens’s + * article (under "semi-related fun fact") for more details. + * + * Backticks are escaped because in IE < 9, they can break out of attribute values or HTML comments. See #59, + * #102, #108, and #133 of the HTML5 Security Cheatsheet for more details. + * + * When working with HTML you should always quote attribute values to reduce XSS vectors. + * + * @param string The string to escape. + * @return Returns the escaped string. + */ + escape(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.escape + */ + escape(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.escape + */ + escape(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/escapeRegExp.d.ts b/types/lodash/string/escapeRegExp.d.ts new file mode 100644 index 0000000000..a05b2b80ab --- /dev/null +++ b/types/lodash/string/escapeRegExp.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Escapes the RegExp special characters "^", "$", "\", ".", "*", "+", "?", "(", ")", "[", "]", + * "{", "}", and "|" in string. + * + * @param string The string to escape. + * @return Returns the escaped string. + */ + escapeRegExp(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.escapeRegExp + */ + escapeRegExp(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.escapeRegExp + */ + escapeRegExp(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/kebabCase.d.ts b/types/lodash/string/kebabCase.d.ts new file mode 100644 index 0000000000..eac11176a7 --- /dev/null +++ b/types/lodash/string/kebabCase.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts string to kebab case. + * + * @param string The string to convert. + * @return Returns the kebab cased string. + */ + kebabCase(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.kebabCase + */ + kebabCase(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.kebabCase + */ + kebabCase(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/lowerCase.d.ts b/types/lodash/string/lowerCase.d.ts new file mode 100644 index 0000000000..5349f3af18 --- /dev/null +++ b/types/lodash/string/lowerCase.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts `string`, as space separated words, to lower case. + * + * @param string The string to convert. + * @return Returns the lower cased string. + */ + lowerCase(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.lowerCase + */ + lowerCase(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.lowerCase + */ + lowerCase(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/lowerFirst.d.ts b/types/lodash/string/lowerFirst.d.ts new file mode 100644 index 0000000000..54cacab3e6 --- /dev/null +++ b/types/lodash/string/lowerFirst.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts the first character of `string` to lower case. + * + * @param string The string to convert. + * @return Returns the converted string. + */ + lowerFirst(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.lowerFirst + */ + lowerFirst(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.lowerFirst + */ + lowerFirst(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/pad.d.ts b/types/lodash/string/pad.d.ts new file mode 100644 index 0000000000..d47f48afad --- /dev/null +++ b/types/lodash/string/pad.d.ts @@ -0,0 +1,39 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if + * they can’t be evenly divided by length. + * + * @param string The string to pad. + * @param length The padding length. + * @param chars The string used as padding. + * @return Returns the padded string. + */ + pad( + string?: string, + length?: number, + chars?: string + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.pad + */ + pad( + length?: number, + chars?: string + ): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.pad + */ + pad( + length?: number, + chars?: string + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/padEnd.d.ts b/types/lodash/string/padEnd.d.ts new file mode 100644 index 0000000000..ed4c552705 --- /dev/null +++ b/types/lodash/string/padEnd.d.ts @@ -0,0 +1,39 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed + * length. + * + * @param string The string to pad. + * @param length The padding length. + * @param chars The string used as padding. + * @return Returns the padded string. + */ + padEnd( + string?: string, + length?: number, + chars?: string + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.padEnd + */ + padEnd( + length?: number, + chars?: string + ): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.padEnd + */ + padEnd( + length?: number, + chars?: string + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/padStart.d.ts b/types/lodash/string/padStart.d.ts new file mode 100644 index 0000000000..02f2ce2752 --- /dev/null +++ b/types/lodash/string/padStart.d.ts @@ -0,0 +1,39 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed + * length. + * + * @param string The string to pad. + * @param length The padding length. + * @param chars The string used as padding. + * @return Returns the padded string. + */ + padStart( + string?: string, + length?: number, + chars?: string + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.padStart + */ + padStart( + length?: number, + chars?: string + ): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.padStart + */ + padStart( + length?: number, + chars?: string + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/parseInt.d.ts b/types/lodash/string/parseInt.d.ts new file mode 100644 index 0000000000..082b45617d --- /dev/null +++ b/types/lodash/string/parseInt.d.ts @@ -0,0 +1,33 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used + * unless value is a hexadecimal, in which case a radix of 16 is used. + * + * Note: This method aligns with the ES5 implementation of parseInt. + * + * @param string The string to convert. + * @param radix The radix to interpret value by. + * @return Returns the converted integer. + */ + parseInt( + string: string, + radix?: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.parseInt + */ + parseInt(radix?: number): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.parseInt + */ + parseInt(radix?: number): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/repeat.d.ts b/types/lodash/string/repeat.d.ts new file mode 100644 index 0000000000..a72cda78b1 --- /dev/null +++ b/types/lodash/string/repeat.d.ts @@ -0,0 +1,32 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Repeats the given string n times. + * + * @param string The string to repeat. + * @param n The number of times to repeat the string. + * @return Returns the repeated string. + */ + repeat( + string?: string, + n?: number + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.repeat + */ + repeat(n?: number): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.repeat + */ + repeat(n?: number): LoDashExplicitWrapper; + } + + type ReplaceFunction = (match: string, ...args: any[]) => string; +} \ No newline at end of file diff --git a/types/lodash/string/replace.d.ts b/types/lodash/string/replace.d.ts new file mode 100644 index 0000000000..9245e2d712 --- /dev/null +++ b/types/lodash/string/replace.d.ts @@ -0,0 +1,59 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Replaces matches for pattern in string with replacement. + * + * Note: This method is based on String#replace. + * + * @return Returns the modified string. + */ + replace( + string: string, + pattern: RegExp | string, + replacement: ReplaceFunction | string + ): string; + + /** + * @see _.replace + */ + replace( + pattern: RegExp | string, + replacement: ReplaceFunction | string + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.replace + */ + replace( + pattern: RegExp|string, + replacement: ReplaceFunction | string + ): string; + + /** + * @see _.replace + */ + replace( + replacement: ReplaceFunction | string + ): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.replace + */ + replace( + pattern: RegExp | string, + replacement: ReplaceFunction | string + ): LoDashExplicitWrapper; + + /** + * @see _.replace + */ + replace( + replacement: ReplaceFunction | string + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/snakeCase.d.ts b/types/lodash/string/snakeCase.d.ts new file mode 100644 index 0000000000..efdaac05d0 --- /dev/null +++ b/types/lodash/string/snakeCase.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts string to snake case. + * + * @param string The string to convert. + * @return Returns the snake cased string. + */ + snakeCase(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.snakeCase + */ + snakeCase(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.snakeCase + */ + snakeCase(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/split.d.ts b/types/lodash/string/split.d.ts new file mode 100644 index 0000000000..e964d851ce --- /dev/null +++ b/types/lodash/string/split.d.ts @@ -0,0 +1,56 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Splits string by separator. + * + * Note: This method is based on String#split. + * + * @param string The string to trim. + * @param separator The separator pattern to split by. + * @param limit The length to truncate results to. + * @return Returns the new array of string segments. + */ + split( + string: string, + separator?: RegExp|string, + limit?: number + ): string[]; + + /** + * Splits string by separator. + * + * Note: This method is based on String#split. + * + * @param string The string to trim. + * @param index Not used in this overload. + * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. + * @return Returns the new array of string segments. + */ + split( + string: string, + index: string | number, + guard: object + ): string[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.split + */ + split( + separator?: RegExp|string, + limit?: number + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.split + */ + split( + separator?: RegExp|string, + limit?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/startCase.d.ts b/types/lodash/string/startCase.d.ts new file mode 100644 index 0000000000..19e0551bf6 --- /dev/null +++ b/types/lodash/string/startCase.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts string to start case. + * + * @param string The string to convert. + * @return Returns the start cased string. + */ + startCase(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.startCase + */ + startCase(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.startCase + */ + startCase(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/startsWith.d.ts b/types/lodash/string/startsWith.d.ts new file mode 100644 index 0000000000..6090c2ed69 --- /dev/null +++ b/types/lodash/string/startsWith.d.ts @@ -0,0 +1,38 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks if string starts with the given target string. + * + * @param string The string to search. + * @param target The string to search for. + * @param position The position to search from. + * @return Returns true if string starts with target, else false. + */ + startsWith( + string?: string, + target?: string, + position?: number + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.startsWith + */ + startsWith( + target?: string, + position?: number + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.startsWith + */ + startsWith( + target?: string, + position?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/template.d.ts b/types/lodash/string/template.d.ts new file mode 100644 index 0000000000..a876c72fd8 --- /dev/null +++ b/types/lodash/string/template.d.ts @@ -0,0 +1,61 @@ +import _ = require("../index"); +declare module "../index" { + interface TemplateOptions extends TemplateSettings { + /** + * The sourceURL of the template's compiled source. + */ + sourceURL?: string; + } + + interface TemplateExecutor { + (data?: object): string; + source: string; + } + + interface LoDashStatic { + /** + * Creates a compiled template function that can interpolate data properties in "interpolate" delimiters, + * HTML-escape interpolated data properties in "escape" delimiters, and execute JavaScript in "evaluate" + * delimiters. Data properties may be accessed as free variables in the template. If a setting object is + * provided it takes precedence over _.templateSettings values. + * + * Note: In the development build _.template utilizes + * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier + * debugging. + * + * For more information on precompiling templates see + * [lodash's custom builds documentation](https://lodash.com/custom-builds). + * + * For more information on Chrome extension sandboxes see + * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). + * + * @param string The template string. + * @param options The options object. + * @param options.escape The HTML "escape" delimiter. + * @param options.evaluate The "evaluate" delimiter. + * @param options.imports An object to import into the template as free variables. + * @param options.interpolate The "interpolate" delimiter. + * @param options.sourceURL The sourceURL of the template's compiled source. + * @param options.variable The data object variable name. + * @return Returns the compiled template function. + */ + template( + string?: string, + options?: TemplateOptions + ): TemplateExecutor; + } + + interface LoDashImplicitWrapper { + /** + * @see _.template + */ + template(options?: TemplateOptions): TemplateExecutor; + } + + interface LoDashExplicitWrapper { + /** + * @see _.template + */ + template(options?: TemplateOptions): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/toLower.d.ts b/types/lodash/string/toLower.d.ts new file mode 100644 index 0000000000..522014d583 --- /dev/null +++ b/types/lodash/string/toLower.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts `string`, as a whole, to lower case. + * + * @param string The string to convert. + * @return Returns the lower cased string. + */ + toLower(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toLower + */ + toLower(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toLower + */ + toLower(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/toUpper.d.ts b/types/lodash/string/toUpper.d.ts new file mode 100644 index 0000000000..5b2215685b --- /dev/null +++ b/types/lodash/string/toUpper.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts `string`, as a whole, to upper case. + * + * @param string The string to convert. + * @return Returns the upper cased string. + */ + toUpper(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toUpper + */ + toUpper(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toUpper + */ + toUpper(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/trim.d.ts b/types/lodash/string/trim.d.ts new file mode 100644 index 0000000000..47e2a81d36 --- /dev/null +++ b/types/lodash/string/trim.d.ts @@ -0,0 +1,44 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Removes leading and trailing whitespace or specified characters from string. + * + * @param string The string to trim. + * @param chars The characters to trim. + * @return Returns the trimmed string. + */ + trim( + string?: string, + chars?: string + ): string; + + /** + * Removes leading and trailing whitespace or specified characters from string. + * + * @param string The string to trim. + * @param index Not used in this overload. + * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. + * @return Returns the trimmed string. + */ + trim( + string: string, + index: string | number, + guard: object + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.trim + */ + trim(chars?: string): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.trim + */ + trim(chars?: string): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/trimEnd.d.ts b/types/lodash/string/trimEnd.d.ts new file mode 100644 index 0000000000..1af345dd74 --- /dev/null +++ b/types/lodash/string/trimEnd.d.ts @@ -0,0 +1,44 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Removes trailing whitespace or specified characters from string. + * + * @param string The string to trim. + * @param chars The characters to trim. + * @return Returns the trimmed string. + */ + trimEnd( + string?: string, + chars?: string + ): string; + + /** + * Removes trailing whitespace or specified characters from string. + * + * @param string The string to trim. + * @param index Not used in this overload. + * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. + * @return Returns the trimmed string. + */ + trimEnd( + string: string, + index: string | number, + guard: object + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.trimEnd + */ + trimEnd(chars?: string): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.trimEnd + */ + trimEnd(chars?: string): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/trimStart.d.ts b/types/lodash/string/trimStart.d.ts new file mode 100644 index 0000000000..1055f6b1d3 --- /dev/null +++ b/types/lodash/string/trimStart.d.ts @@ -0,0 +1,44 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Removes leading whitespace or specified characters from string. + * + * @param string The string to trim. + * @param chars The characters to trim. + * @return Returns the trimmed string. + */ + trimStart( + string?: string, + chars?: string + ): string; + + /** + * Removes leading whitespace or specified characters from string. + * + * @param string The string to trim. + * @param index Not used in this overload. + * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. + * @return Returns the trimmed string. + */ + trimStart( + string: string, + index: string | number, + guard: object + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.trimStart + */ + trimStart(chars?: string): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.trimStart + */ + trimStart(chars?: string): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/truncate.d.ts b/types/lodash/string/truncate.d.ts new file mode 100644 index 0000000000..23d4039356 --- /dev/null +++ b/types/lodash/string/truncate.d.ts @@ -0,0 +1,40 @@ +import _ = require("../index"); +declare module "../index" { + interface TruncateOptions { + /** The maximum string length. */ + length?: number; + /** The string to indicate text is omitted. */ + omission?: string; + /** The separator pattern to truncate to. */ + separator?: string|RegExp; + } + + interface LoDashStatic { + /** + * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated + * string are replaced with the omission string which defaults to "…". + * + * @param string The string to truncate. + * @param options The options object or maximum string length. + * @return Returns the truncated string. + */ + truncate( + string?: string, + options?: TruncateOptions + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.truncate + */ + truncate(options?: TruncateOptions): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.truncate + */ + truncate(options?: TruncateOptions): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/unescape.d.ts b/types/lodash/string/unescape.d.ts new file mode 100644 index 0000000000..3e2be90abb --- /dev/null +++ b/types/lodash/string/unescape.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * The inverse of _.escape; this method converts the HTML entities &, <, >, ", ', and ` + * in string to their corresponding characters. + * + * Note: No other HTML entities are unescaped. To unescape additional HTML entities use a third-party library + * like he. + * + * @param string The string to unescape. + * @return Returns the unescaped string. + */ + unescape(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.unescape + */ + unescape(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.unescape + */ + unescape(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/upperCase.d.ts b/types/lodash/string/upperCase.d.ts new file mode 100644 index 0000000000..d33b6885b9 --- /dev/null +++ b/types/lodash/string/upperCase.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts `string`, as space separated words, to upper case. + * + * @param string The string to convert. + * @return Returns the upper cased string. + */ + upperCase(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.upperCase + */ + upperCase(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.upperCase + */ + upperCase(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/upperFirst.d.ts b/types/lodash/string/upperFirst.d.ts new file mode 100644 index 0000000000..692aa702cd --- /dev/null +++ b/types/lodash/string/upperFirst.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts the first character of `string` to upper case. + * + * @param string The string to convert. + * @return Returns the converted string. + */ + upperFirst(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.upperFirst + */ + upperFirst(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.upperFirst + */ + upperFirst(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/words.d.ts b/types/lodash/string/words.d.ts new file mode 100644 index 0000000000..4ca4530513 --- /dev/null +++ b/types/lodash/string/words.d.ts @@ -0,0 +1,44 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Splits `string` into an array of its words. + * + * @param string The string to inspect. + * @param pattern The pattern to match words. + * @return Returns the words of `string`. + */ + words( + string?: string, + pattern?: string|RegExp + ): string[]; + + /** + * Splits `string` into an array of its words. + * + * @param string The string to inspect. + * @param index Not used in this overload. + * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. + * @return Returns the words of `string`. + */ + words( + string: string, + index: string | number, + guard: object + ): string[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.words + */ + words(pattern?: string|RegExp): string[]; + } + + interface LoDashExplicitWrapper { + /** + * @see _.words + */ + words(pattern?: string|RegExp): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/tsconfig.json b/types/lodash/tsconfig.json index af6ba5e2e9..7bd90cb77f 100644 --- a/types/lodash/tsconfig.json +++ b/types/lodash/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -318,4 +319,4 @@ "zipObjectDeep.d.ts", "zipWith.d.ts" ] -} +} \ No newline at end of file diff --git a/types/lodash/tslint.json b/types/lodash/tslint.json index 44e681fc18..57df94df09 100644 --- a/types/lodash/tslint.json +++ b/types/lodash/tslint.json @@ -2,20 +2,12 @@ "extends": "dtslint/dt.json", "rules": { // All are TODOs - "array-type": false, - "ban-types": false, - "callable-types": false, "comment-format": [false], - "interface-name": false, "interface-over-type-literal": false, "jsdoc-format": false, "max-line-length": [false], - "no-any-union": false, - "no-empty-interface": false, - "no-mergeable-namespace": false, "no-namespace": false, "no-unnecessary-generics": false, - "no-unnecessary-type-assertion": false, "no-void-expression": false, "object-literal-key-quotes": false, "one-line": false, diff --git a/types/lodash/util/attempt.d.ts b/types/lodash/util/attempt.d.ts new file mode 100644 index 0000000000..b539421d13 --- /dev/null +++ b/types/lodash/util/attempt.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Attempts to invoke func, returning either the result or the caught error object. Any additional arguments + * are provided to func when it’s invoked. + * + * @param func The function to attempt. + * @return Returns the func result or error object. + */ + attempt(func: (...args: any[]) => TResult, ...args: any[]): TResult|Error; + } + + interface LoDashImplicitWrapper { + /** + * @see _.attempt + */ + attempt(...args: any[]): TResult|Error; + } + + interface LoDashExplicitWrapper { + /** + * @see _.attempt + */ + attempt(...args: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/bindAll.d.ts b/types/lodash/util/bindAll.d.ts new file mode 100644 index 0000000000..1ebe05fe60 --- /dev/null +++ b/types/lodash/util/bindAll.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Binds methods of an object to the object itself, overwriting the existing method. Method names may be + * specified as individual arguments or as arrays of method names. If no method names are provided all + * enumerable function properties, own and inherited, of object are bound. + * + * Note: This method does not set the "length" property of bound functions. + * + * @param object The object to bind and assign the bound methods to. + * @param methodNames The object method names to bind, specified as individual method names or arrays of + * method names. + * @return Returns object. + */ + bindAll( + object: T, + ...methodNames: Array> + ): T; + } + + interface LoDashWrapper { + /** + * @see _.bindAll + */ + bindAll(...methodNames: Array>): this; + } +} \ No newline at end of file diff --git a/types/lodash/util/cond.d.ts b/types/lodash/util/cond.d.ts new file mode 100644 index 0000000000..036f518184 --- /dev/null +++ b/types/lodash/util/cond.d.ts @@ -0,0 +1,33 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that iterates over `pairs` and invokes the corresponding + * function of the first predicate to return truthy. The predicate-function + * pairs are invoked with the `this` binding and arguments of the created + * function. + * + * @since 4.0.0 + * @category Util + * @param pairs The predicate-function pairs. + * @returns Returns the new composite function. + * @example + * + * var func = _.cond([ + * [_.matches({ 'a': 1 }), _.constant('matches A')], + * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], + * [_.stubTrue, _.constant('no match')] + * ]); + * + * func({ 'a': 1, 'b': 2 }); + * // => 'matches A' + * + * func({ 'a': 0, 'b': 1 }); + * // => 'matches B' + * + * func({ 'a': '1', 'b': '2' }); + * // => 'no match' + */ + cond(pairs: Array>): (Target: T) => R; + } +} \ No newline at end of file diff --git a/types/lodash/util/conforms.d.ts b/types/lodash/util/conforms.d.ts new file mode 100644 index 0000000000..9da61cedd1 --- /dev/null +++ b/types/lodash/util/conforms.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + type ConformsPredicateObject = { + [P in keyof T]?: (val: T[P]) => boolean; + }; + + interface LoDashStatic { + /** + * Creates a function that invokes the predicate properties of `source` with the corresponding + * property values of a given object, returning true if all predicates return truthy, else false. + */ + conforms(source: ConformsPredicateObject): (value: T) => boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.conforms + */ + conforms(this: LoDashImplicitWrapper>): LoDashImplicitWrapper<(value: T) => boolean>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.conforms + */ + conforms(this: LoDashExplicitWrapper>): LoDashExplicitWrapper<(value: T) => boolean>; + } +} \ No newline at end of file diff --git a/types/lodash/util/constant.d.ts b/types/lodash/util/constant.d.ts new file mode 100644 index 0000000000..9255171af1 --- /dev/null +++ b/types/lodash/util/constant.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that returns value. + * + * @param value The value to return from the new function. + * @return Returns the new function. + */ + constant(value: T): () => T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.constant + */ + constant(): LoDashImplicitWrapper<() => TValue>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.constant + */ + constant(): LoDashExplicitWrapper<() => TValue>; + } +} \ No newline at end of file diff --git a/types/lodash/util/defaultTo.d.ts b/types/lodash/util/defaultTo.d.ts new file mode 100644 index 0000000000..ced0e976c5 --- /dev/null +++ b/types/lodash/util/defaultTo.d.ts @@ -0,0 +1,53 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Checks `value` to determine whether a default value should be returned in + * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, + * or `undefined`. + * + * @param value The value to check. + * @param defaultValue The default value. + * @returns Returns the resolved value. + */ + defaultTo(value: T | null | undefined, defaultValue: T): T; + + /** + * @see _.defaultTo + */ + defaultTo( + value: T | null | undefined, + defaultValue: TDefault + ): T | TDefault; + } + + interface LoDashImplicitWrapper { + /** + * @see _.defaultTo + */ + defaultTo(this: LoDashImplicitWrapper, defaultValue: T): T; + + /** + * @see _.defaultTo + */ + defaultTo( + this: LoDashImplicitWrapper, + defaultValue: TDefault + ): T | TDefault; + } + + interface LoDashExplicitWrapper { + /** + * @see _.defaultTo + */ + defaultTo(this: LoDashExplicitWrapper, defaultValue: T): LoDashExplicitWrapper; + + /** + * @see _.defaultTo + */ + defaultTo( + this: LoDashExplicitWrapper, + defaultValue: TDefault + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/flow.d.ts b/types/lodash/util/flow.d.ts new file mode 100644 index 0000000000..90736c5da4 --- /dev/null +++ b/types/lodash/util/flow.d.ts @@ -0,0 +1,171 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that returns the result of invoking the provided functions with the this binding of the + * created function, where each successive invocation is supplied the return value of the previous. + * + * @param funcs Functions to invoke. + * @return Returns the new function. + */ + // 0-argument first function + flow(f1: () => R1, f2: (a: R1) => R2): () => R2; + flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): () => R3; + flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): () => R4; + flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): () => R5; + flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): () => R6; + flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): () => R7; + flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): () => any; + // 1-argument first function + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2): (a1: A1) => R2; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1) => R3; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1) => R4; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1) => R5; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1) => R6; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1) => R7; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1) => any; + // 2-argument first function + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2) => R2; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2) => R3; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2) => R4; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2) => R5; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2) => R6; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2) => R7; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2) => any; + // 3-argument first function + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3) => R2; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3) => R3; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3) => R4; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3) => R5; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3) => R6; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3) => R7; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2, a3: A3) => any; + // 4-argument first function + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2, a3: A3, a4: A4) => any; + // any-argument first function + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any; + flow(funcs: Array any>>): (...args: any[]) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flow + */ + // 0-argument first function + flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<() => R2>; + flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<() => R3>; + flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<() => R4>; + flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<() => R5>; + flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<() => R6>; + flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<() => R7>; + flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<() => any>; + // 1-argument first function + flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<(a1: A1) => R2>; + flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<(a1: A1) => R3>; + flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<(a1: A1) => R4>; + flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<(a1: A1) => R5>; + flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<(a1: A1) => R6>; + flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<(a1: A1) => R7>; + flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<(a1: A1) => any>; + // 2-argument first function + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<(a1: A1, a2: A2) => R2>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<(a1: A1, a2: A2) => R3>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<(a1: A1, a2: A2) => R4>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<(a1: A1, a2: A2) => R5>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<(a1: A1, a2: A2) => R6>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<(a1: A1, a2: A2) => R7>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<(a1: A1, a2: A2) => any>; + // 3-argument first function + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R2>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R3>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R4>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R5>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R6>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R7>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => any>; + // 4-argument first function + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => any>; + // any-argument first function + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any>; + flow(this: LoDashImplicitWrapper<(...args: any[]) => any>, funcs: Array any>>): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flow + */ + // 0-argument first function + flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<() => R2>; + flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<() => R3>; + flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<() => R4>; + flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<() => R5>; + flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<() => R6>; + flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<() => R7>; + flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<() => any>; + // 1-argument first function + flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<(a1: A1) => R2>; + flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<(a1: A1) => R3>; + flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<(a1: A1) => R4>; + flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<(a1: A1) => R5>; + flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<(a1: A1) => R6>; + flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<(a1: A1) => R7>; + flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<(a1: A1) => any>; + // 2-argument first function + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<(a1: A1, a2: A2) => R2>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<(a1: A1, a2: A2) => R3>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<(a1: A1, a2: A2) => R4>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<(a1: A1, a2: A2) => R5>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<(a1: A1, a2: A2) => R6>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<(a1: A1, a2: A2) => R7>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<(a1: A1, a2: A2) => any>; + // 3-argument first function + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R2>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R3>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R4>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R5>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R6>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R7>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => any>; + // 4-argument first function + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => any>; + // any-argument first function + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any>; + flow(this: LoDashExplicitWrapper<(...args: any[]) => any>, funcs: Array any>>): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/util/flowRight.d.ts b/types/lodash/util/flowRight.d.ts new file mode 100644 index 0000000000..e61f162ce3 --- /dev/null +++ b/types/lodash/util/flowRight.d.ts @@ -0,0 +1,156 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like _.flow except that it creates a function that invokes the provided functions from right + * to left. + * + * @param funcs Functions to invoke. + * @return Returns the new function. + */ + // 0-argument first function + flowRight(f2: (a: R1) => R2, f1: () => R1): () => R2; + flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R3; + flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R4; + flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R5; + flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R6; + flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R7; + // 1-argument first function + flowRight(f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R2; + flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R3; + flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R4; + flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R5; + flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R6; + flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R7; + // 2-argument first function + flowRight(f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R2; + flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R3; + flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R4; + flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R5; + flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R6; + flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R7; + // 3-argument first function + flowRight(f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R2; + flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R3; + flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R4; + flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R5; + flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R6; + flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R7; + // 4-argument first function + flowRight(f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; + flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; + flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; + flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; + flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; + flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; + // any-argument first function + flowRight(f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R2; + flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R3; + flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R4; + flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R5; + flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R6; + flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R7; + flowRight(f7: (a: any) => any, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array any>>): (...args: any[]) => any; + flowRight(funcs: Array any>>): (...args: any[]) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flowRight + */ + // 0-argument first function + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: () => R1): LoDashImplicitWrapper<() => R2>; + flowRight(this: LoDashImplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: () => R1): LoDashImplicitWrapper<() => R3>; + flowRight(this: LoDashImplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashImplicitWrapper<() => R4>; + flowRight(this: LoDashImplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashImplicitWrapper<() => R5>; + flowRight(this: LoDashImplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashImplicitWrapper<() => R6>; + flowRight(this: LoDashImplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashImplicitWrapper<() => R7>; + // 1-argument first function + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R2>; + flowRight(this: LoDashImplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R3>; + flowRight(this: LoDashImplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R4>; + flowRight(this: LoDashImplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R5>; + flowRight(this: LoDashImplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R6>; + flowRight(this: LoDashImplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R7>; + // 2-argument first function + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R2>; + flowRight(this: LoDashImplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R3>; + flowRight(this: LoDashImplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R4>; + flowRight(this: LoDashImplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R5>; + flowRight(this: LoDashImplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R6>; + flowRight(this: LoDashImplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R7>; + // 3-argument first function + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R2>; + flowRight(this: LoDashImplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R3>; + flowRight(this: LoDashImplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R4>; + flowRight(this: LoDashImplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R5>; + flowRight(this: LoDashImplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R6>; + flowRight(this: LoDashImplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R7>; + // 4-argument first function + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; + flowRight(this: LoDashImplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; + flowRight(this: LoDashImplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; + flowRight(this: LoDashImplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; + flowRight(this: LoDashImplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; + flowRight(this: LoDashImplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; + // any-argument first function + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R2>; + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R3>; + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R4>; + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R5>; + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R6>; + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R7>; + flowRight(this: LoDashImplicitWrapper<(a: any) => any>, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array any>>): LoDashImplicitWrapper<(...args: any[]) => any>; + flowRight(this: LoDashImplicitWrapper<(a: any) => any>, funcs: Array any>>): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flowRight + */ + // 0-argument first function + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: () => R1): LoDashExplicitWrapper<() => R2>; + flowRight(this: LoDashExplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitWrapper<() => R3>; + flowRight(this: LoDashExplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitWrapper<() => R4>; + flowRight(this: LoDashExplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitWrapper<() => R5>; + flowRight(this: LoDashExplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitWrapper<() => R6>; + flowRight(this: LoDashExplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitWrapper<() => R7>; + // 1-argument first function + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R2>; + flowRight(this: LoDashExplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R3>; + flowRight(this: LoDashExplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R4>; + flowRight(this: LoDashExplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R5>; + flowRight(this: LoDashExplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R6>; + flowRight(this: LoDashExplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R7>; + // 2-argument first function + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R2>; + flowRight(this: LoDashExplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R3>; + flowRight(this: LoDashExplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R4>; + flowRight(this: LoDashExplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R5>; + flowRight(this: LoDashExplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R6>; + flowRight(this: LoDashExplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R7>; + // 3-argument first function + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R2>; + flowRight(this: LoDashExplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R3>; + flowRight(this: LoDashExplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R4>; + flowRight(this: LoDashExplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R5>; + flowRight(this: LoDashExplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R6>; + flowRight(this: LoDashExplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R7>; + // 4-argument first function + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; + flowRight(this: LoDashExplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; + flowRight(this: LoDashExplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; + flowRight(this: LoDashExplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; + flowRight(this: LoDashExplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; + flowRight(this: LoDashExplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; + // any-argument first function + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R2>; + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R3>; + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R4>; + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R5>; + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R6>; + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R7>; + flowRight(this: LoDashExplicitWrapper<(a: any) => any>, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array any>>): LoDashExplicitWrapper<(...args: any[]) => any>; + flowRight(this: LoDashExplicitWrapper<(a: any) => any>, funcs: Array any>>): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/util/identity.d.ts b/types/lodash/util/identity.d.ts new file mode 100644 index 0000000000..6fff4525ad --- /dev/null +++ b/types/lodash/util/identity.d.ts @@ -0,0 +1,31 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method returns the first argument provided to it. + * + * @param value Any value. + * @return Returns value. + */ + identity(value: T): T; + + /** + * @see _.identity + */ + identity(): undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.identity + */ + identity(): TValue; + } + + interface LoDashExplicitWrapper { + /** + * @see _.identity + */ + identity(): this; + } +} \ No newline at end of file diff --git a/types/lodash/util/iteratee.d.ts b/types/lodash/util/iteratee.d.ts new file mode 100644 index 0000000000..b41c6d3cf2 --- /dev/null +++ b/types/lodash/util/iteratee.d.ts @@ -0,0 +1,58 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that invokes `func` with the arguments of the created + * function. If `func` is a property name the created callback returns the + * property value for a given element. If `func` is an object the created + * callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`. + * + * @category Util + * @param [func=_.identity] The value to convert to a callback. + * @returns Returns the callback. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // create custom iteratee shorthands + * _.iteratee = _.wrap(_.iteratee, function(callback, func) { + * var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func); + * return !p ? callback(func) : function(object) { + * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]); + * }; + * }); + * + * _.filter(users, 'age > 36'); + * // => [{ 'user': 'fred', 'age': 40 }] + */ + iteratee any>( + func: TFunction | string | object + ): TFunction; + + /** + * @see _.iteratee + */ + iteratee(): typeof _.identity; // tslint:disable-line:no-unnecessary-qualifier + } + + interface LoDashImplicitWrapper { + /** + * @see _.iteratee + */ + iteratee any>( + this: LoDashImplicitWrapper + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.iteratee + */ + iteratee any>( + this: LoDashExplicitWrapper + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/matches.d.ts b/types/lodash/util/matches.d.ts new file mode 100644 index 0000000000..b919ffbbcc --- /dev/null +++ b/types/lodash/util/matches.d.ts @@ -0,0 +1,36 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that performs a deep comparison between a given object and source, returning true if the + * given object has equivalent property values, else false. + * + * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and + * strings. Objects are compared by their own, not inherited, enumerable properties. For comparing a single own + * or inherited property value see _.matchesProperty. + * + * @param source The object of property values to match. + * @return Returns the new function. + */ + matches(source: T): (value: any) => boolean; + + /** + * @see _.matches + */ + matches(source: T): (value: V) => boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.matches + */ + matches(): LoDashImplicitWrapper<(value: V) => boolean>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.matches + */ + matches(): LoDashExplicitWrapper<(value: V) => boolean>; + } +} \ No newline at end of file diff --git a/types/lodash/util/matchesProperty.d.ts b/types/lodash/util/matchesProperty.d.ts new file mode 100644 index 0000000000..fc574be4f9 --- /dev/null +++ b/types/lodash/util/matchesProperty.d.ts @@ -0,0 +1,59 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that compares the property value of path on a given object to value. + * + * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and + * strings. Objects are compared by their own, not inherited, enumerable properties. + * + * @param path The path of the property to get. + * @param srcValue The value to match. + * @return Returns the new function. + */ + matchesProperty( + path: PropertyPath, + srcValue: T + ): (value: any) => boolean; + + /** + * @see _.matchesProperty + */ + matchesProperty( + path: PropertyPath, + srcValue: T + ): (value: V) => boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.matchesProperty + */ + matchesProperty( + srcValue: SrcValue + ): LoDashImplicitWrapper<(value: any) => boolean>; + + /** + * @see _.matchesProperty + */ + matchesProperty( + srcValue: SrcValue + ): LoDashImplicitWrapper<(value: Value) => boolean>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.matchesProperty + */ + matchesProperty( + srcValue: SrcValue + ): LoDashExplicitWrapper<(value: any) => boolean>; + + /** + * @see _.matchesProperty + */ + matchesProperty( + srcValue: SrcValue + ): LoDashExplicitWrapper<(value: Value) => boolean>; + } +} \ No newline at end of file diff --git a/types/lodash/util/method.d.ts b/types/lodash/util/method.d.ts new file mode 100644 index 0000000000..09c508caef --- /dev/null +++ b/types/lodash/util/method.d.ts @@ -0,0 +1,31 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that invokes the method at path on a given object. Any additional arguments are provided + * to the invoked method. + * + * @param path The path of the method to invoke. + * @param args The arguments to invoke the method with. + * @return Returns the new function. + */ + method( + path: PropertyPath, + ...args: any[] + ): (object: any) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.method + */ + method(...args: any[]): LoDashImplicitWrapper<(object: any) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.method + */ + method(...args: any[]): LoDashExplicitWrapper<(object: any) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/util/methodOf.d.ts b/types/lodash/util/methodOf.d.ts new file mode 100644 index 0000000000..4ec4d15515 --- /dev/null +++ b/types/lodash/util/methodOf.d.ts @@ -0,0 +1,35 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * The opposite of _.method; this method creates a function that invokes the method at a given path on object. + * Any additional arguments are provided to the invoked method. + * + * @param object The object to query. + * @param args The arguments to invoke the method with. + * @return Returns the new function. + */ + methodOf( + object: object, + ...args: any[] + ): (path: PropertyPath) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.methodOf + */ + methodOf( + ...args: any[] + ): LoDashImplicitWrapper<(path: PropertyPath) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.methodOf + */ + methodOf( + ...args: any[] + ): LoDashExplicitWrapper<(path: PropertyPath) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/util/mixin.d.ts b/types/lodash/util/mixin.d.ts new file mode 100644 index 0000000000..02237ae751 --- /dev/null +++ b/types/lodash/util/mixin.d.ts @@ -0,0 +1,69 @@ +import _ = require("../index"); +declare module "../index" { + interface MixinOptions { + chain?: boolean; + } + + interface LoDashStatic { + /** + * Adds all own enumerable function properties of a source object to the destination object. If object is a + * function then methods are added to its prototype as well. + * + * Note: Use _.runInContext to create a pristine lodash function to avoid conflicts caused by modifying + * the original. + * + * @param object The destination object. + * @param source The object of functions to add. + * @param options The options object. + * @param options.chain Specify whether the functions added are chainable. + * @return Returns object. + */ + mixin( + object: TObject, + source: Dictionary<(...args: any[]) => any>, + options?: MixinOptions + ): TObject; + + /** + * @see _.mixin + */ + mixin( + source: Dictionary<(...args: any[]) => any>, + options?: MixinOptions + ): LoDashStatic; + } + + interface LoDashImplicitWrapper { + /** + * @see _.mixin + */ + mixin( + source: Dictionary<(...args: any[]) => any>, + options?: MixinOptions + ): this; + + /** + * @see _.mixin + */ + mixin( + options?: MixinOptions + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.mixin + */ + mixin( + source: Dictionary<(...args: any[]) => any>, + options?: MixinOptions + ): this; + + /** + * @see _.mixin + */ + mixin( + options?: MixinOptions + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/noConflict.d.ts b/types/lodash/util/noConflict.d.ts new file mode 100644 index 0000000000..80ecca9f10 --- /dev/null +++ b/types/lodash/util/noConflict.d.ts @@ -0,0 +1,25 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Reverts the _ variable to its previous value and returns a reference to the lodash function. + * + * @return Returns the lodash function. + */ + noConflict(): typeof _; + } + + interface LoDashImplicitWrapper { + /** + * @see _.noConflict + */ + noConflict(): typeof _; + } + + interface LoDashExplicitWrapper { + /** + * @see _.noConflict + */ + noConflict(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/noop.d.ts b/types/lodash/util/noop.d.ts new file mode 100644 index 0000000000..ca66677e57 --- /dev/null +++ b/types/lodash/util/noop.d.ts @@ -0,0 +1,25 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * A no-operation function that returns undefined regardless of the arguments it receives. + * + * @return undefined + */ + noop(...args: any[]): void; + } + + interface LoDashImplicitWrapper { + /** + * @see _.noop + */ + noop(...args: any[]): void; + } + + interface LoDashExplicitWrapper { + /** + * @see _.noop + */ + noop(...args: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/nthArg.d.ts b/types/lodash/util/nthArg.d.ts new file mode 100644 index 0000000000..c5b6b0d5db --- /dev/null +++ b/types/lodash/util/nthArg.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that returns its nth argument. + * + * @param n The index of the argument to return. + * @return Returns the new function. + */ + nthArg(n?: number): (...args: any[]) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.nthArg + */ + nthArg(): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.nthArg + */ + nthArg(): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/util/over.d.ts b/types/lodash/util/over.d.ts new file mode 100644 index 0000000000..2b4b49f573 --- /dev/null +++ b/types/lodash/util/over.d.ts @@ -0,0 +1,33 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that invokes iteratees with the arguments provided to the created function and returns + * their results. + * + * @param iteratees The iteratees to invoke. + * @return Returns the new function. + */ + over(...iteratees: Array TResult>>): (...args: any[]) => TResult[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.over + */ + over( + this: LoDashImplicitWrapper TResult>>, + ...iteratees: Array TResult>> + ): LoDashImplicitWrapper<(...args: any[]) => TResult[]>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.over + */ + over( + this: LoDashExplicitWrapper TResult>>, + ...iteratees: Array TResult>> + ): LoDashExplicitWrapper<(...args: any[]) => TResult[]>; + } +} \ No newline at end of file diff --git a/types/lodash/util/overEvery.d.ts b/types/lodash/util/overEvery.d.ts new file mode 100644 index 0000000000..d061d3ec72 --- /dev/null +++ b/types/lodash/util/overEvery.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that checks if all of the predicates return truthy when invoked with the arguments + * provided to the created function. + * + * @param predicates The predicates to check. + * @return Returns the new function. + */ + overEvery(...predicates: Array boolean>>): (...args: T[]) => boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.overEvery + */ + overEvery(...predicates: Array boolean>>): LoDashImplicitWrapper<(...args: T[]) => boolean>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.overEvery + */ + overEvery(...predicates: Array boolean>>): LoDashExplicitWrapper<(...args: T[]) => boolean>; + } +} \ No newline at end of file diff --git a/types/lodash/util/overSome.d.ts b/types/lodash/util/overSome.d.ts new file mode 100644 index 0000000000..1ff92f8d42 --- /dev/null +++ b/types/lodash/util/overSome.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that checks if any of the predicates return truthy when invoked with the arguments + * provided to the created function. + * + * @param predicates The predicates to check. + * @return Returns the new function. + */ + overSome(...predicates: Array boolean>>): (...args: T[]) => boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.overSome + */ + overSome(...predicates: Array boolean>>): LoDashImplicitWrapper<(...args: T[]) => boolean>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.overSome + */ + overSome(...predicates: Array boolean>>): LoDashExplicitWrapper<(...args: T[]) => boolean>; + } +} \ No newline at end of file diff --git a/types/lodash/util/property.d.ts b/types/lodash/util/property.d.ts new file mode 100644 index 0000000000..8edab90248 --- /dev/null +++ b/types/lodash/util/property.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates a function that returns the property value at path on a given object. + * + * @param path The path of the property to get. + * @return Returns the new function. + */ + property(path: PropertyPath): (obj: TObj) => TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.property + */ + property(): LoDashImplicitWrapper<(obj: TObj) => TResult>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.property + */ + property(): LoDashExplicitWrapper<(obj: TObj) => TResult>; + } +} \ No newline at end of file diff --git a/types/lodash/util/propertyOf.d.ts b/types/lodash/util/propertyOf.d.ts new file mode 100644 index 0000000000..cc272ec7bf --- /dev/null +++ b/types/lodash/util/propertyOf.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * The opposite of _.property; this method creates a function that returns the property value at a given path + * on object. + * + * @param object The object to query. + * @return Returns the new function. + */ + propertyOf(object: T): (path: PropertyPath) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.propertyOf + */ + propertyOf(): LoDashImplicitWrapper<(path: PropertyPath) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.propertyOf + */ + propertyOf(): LoDashExplicitWrapper<(path: PropertyPath) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/util/range.d.ts b/types/lodash/util/range.d.ts new file mode 100644 index 0000000000..35bf7e3d2e --- /dev/null +++ b/types/lodash/util/range.d.ts @@ -0,0 +1,56 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. + * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length + * range is created unless a negative step is specified. + * + * @param start The start of the range. + * @param end The end of the range. + * @param step The value to increment or decrement by. + * @return Returns a new range array. + */ + range( + start: number, + end?: number, + step?: number + ): number[]; + + /** + * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. + * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length + * range is created unless a negative step is specified. + * + * @param start The start of the range. + * @param index Not used in this overload. + * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. + * @return Returns a new range array. + */ + range( + end: number, + index: string | number, + guard: object + ): number[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.range + */ + range( + end?: number, + step?: number + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.range + */ + range( + end?: number, + step?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/rangeRight.d.ts b/types/lodash/util/rangeRight.d.ts new file mode 100644 index 0000000000..ced80d5968 --- /dev/null +++ b/types/lodash/util/rangeRight.d.ts @@ -0,0 +1,77 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method is like `_.range` except that it populates values in + * descending order. + * + * @category Util + * @param start The start of the range. + * @param end The end of the range. + * @param step The value to increment or decrement by. + * @returns Returns the new array of numbers. + * @example + * + * _.rangeRight(4); + * // => [3, 2, 1, 0] + * + * _.rangeRight(-4); + * // => [-3, -2, -1, 0] + * + * _.rangeRight(1, 5); + * // => [4, 3, 2, 1] + * + * _.rangeRight(0, 20, 5); + * // => [15, 10, 5, 0] + * + * _.rangeRight(0, -4, -1); + * // => [-3, -2, -1, 0] + * + * _.rangeRight(1, 4, 0); + * // => [1, 1, 1] + * + * _.rangeRight(0); + * // => [] + */ + rangeRight( + start: number, + end?: number, + step?: number + ): number[]; + + /** + * This method is like _.range except that it populates values in + * descending order. + * + * @param start The start of the range. + * @param index Not used in this overload. + * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. + * @return Returns a new range array. + */ + rangeRight( + end: number, + index: string | number, + guard: object + ): number[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.rangeRight + */ + rangeRight( + end?: number, + step?: number + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.rangeRight + */ + rangeRight( + end?: number, + step?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/runInContext.d.ts b/types/lodash/util/runInContext.d.ts new file mode 100644 index 0000000000..38fb1ff6b1 --- /dev/null +++ b/types/lodash/util/runInContext.d.ts @@ -0,0 +1,19 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Create a new pristine lodash function using the given context object. + * + * @param context The context object. + * @return Returns a new lodash function. + */ + runInContext(context?: object): typeof _; + } + + interface LoDashImplicitWrapper { + /** + * @see _.runInContext + */ + runInContext(): typeof _; + } +} \ No newline at end of file diff --git a/types/lodash/util/stubArray.d.ts b/types/lodash/util/stubArray.d.ts new file mode 100644 index 0000000000..b8440b7f25 --- /dev/null +++ b/types/lodash/util/stubArray.d.ts @@ -0,0 +1,25 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method returns a new empty array. + * + * @returns Returns the new empty array. + */ + stubArray(): any[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.stubArray + */ + stubArray(): any[]; + } + + interface LoDashExplicitWrapper { + /** + * @see _.stubArray + */ + stubArray(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/stubFalse.d.ts b/types/lodash/util/stubFalse.d.ts new file mode 100644 index 0000000000..394bdc5cce --- /dev/null +++ b/types/lodash/util/stubFalse.d.ts @@ -0,0 +1,25 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method returns `false`. + * + * @returns Returns `false`. + */ + stubFalse(): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.stubFalse + */ + stubFalse(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.stubFalse + */ + stubFalse(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/stubObject.d.ts b/types/lodash/util/stubObject.d.ts new file mode 100644 index 0000000000..877decfcf0 --- /dev/null +++ b/types/lodash/util/stubObject.d.ts @@ -0,0 +1,25 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method returns a new empty object. + * + * @returns Returns the new empty object. + */ + stubObject(): any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.stubObject + */ + stubObject(): any; + } + + interface LoDashExplicitWrapper { + /** + * @see _.stubObject + */ + stubObject(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/stubString.d.ts b/types/lodash/util/stubString.d.ts new file mode 100644 index 0000000000..6967aafc14 --- /dev/null +++ b/types/lodash/util/stubString.d.ts @@ -0,0 +1,25 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method returns an empty string. + * + * @returns Returns the empty string. + */ + stubString(): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.stubString + */ + stubString(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.stubString + */ + stubString(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/stubTrue.d.ts b/types/lodash/util/stubTrue.d.ts new file mode 100644 index 0000000000..2a18d82e88 --- /dev/null +++ b/types/lodash/util/stubTrue.d.ts @@ -0,0 +1,25 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * This method returns `true`. + * + * @returns Returns `true`. + */ + stubTrue(): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.stubTrue + */ + stubTrue(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.stubTrue + */ + stubTrue(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/times.d.ts b/types/lodash/util/times.d.ts new file mode 100644 index 0000000000..1056080ebf --- /dev/null +++ b/types/lodash/util/times.d.ts @@ -0,0 +1,50 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee + * is invoked with one argument; (index). + * + * @param n The number of times to invoke iteratee. + * @param iteratee The function invoked per iteration. + * @return Returns the array of results. + */ + times( + n: number, + iteratee: (num: number) => TResult + ): TResult[]; + + /** + * @see _.times + */ + times(n: number): number[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.times + */ + times( + iteratee: (num: number) => TResult + ): TResult[]; + + /** + * @see _.times + */ + times(): number[]; + } + + interface LoDashExplicitWrapper { + /** + * @see _.times + */ + times( + iteratee: (num: number) => TResult + ): LoDashExplicitWrapper; + + /** + * @see _.times + */ + times(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/toPath.d.ts b/types/lodash/util/toPath.d.ts new file mode 100644 index 0000000000..e98a9eb30f --- /dev/null +++ b/types/lodash/util/toPath.d.ts @@ -0,0 +1,43 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Converts `value` to a property path array. + * + * @category Util + * @param value The value to convert. + * @returns Returns the new property path array. + * @example + * + * _.toPath('a.b.c'); + * // => ['a', 'b', 'c'] + * + * _.toPath('a[0].b.c'); + * // => ['a', '0', 'b', 'c'] + * + * var path = ['a', 'b', 'c'], + * newPath = _.toPath(path); + * + * console.log(newPath); + * // => ['a', 'b', 'c'] + * + * console.log(path === newPath); + * // => false + */ + toPath(value: any): string[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toPath + */ + toPath(): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toPath + */ + toPath(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/uniqueId.d.ts b/types/lodash/util/uniqueId.d.ts new file mode 100644 index 0000000000..75bedcaa94 --- /dev/null +++ b/types/lodash/util/uniqueId.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashStatic { + /** + * Generates a unique ID. If prefix is provided the ID is appended to it. + * + * @param prefix The value to prefix the ID with. + * @return Returns the unique ID. + */ + uniqueId(prefix?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.uniqueId + */ + uniqueId(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.uniqueId + */ + uniqueId(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/v3/tsconfig.json b/types/lodash/v3/tsconfig.json index 5c5613d3f6..1040ab2909 100644 --- a/types/lodash/v3/tsconfig.json +++ b/types/lodash/v3/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/log-symbols/tsconfig.json b/types/log-symbols/tsconfig.json index 8677d194b0..ea0c26df1f 100644 --- a/types/log-symbols/tsconfig.json +++ b/types/log-symbols/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/log-update/tsconfig.json b/types/log-update/tsconfig.json index 888455297b..adf2bc1f11 100644 --- a/types/log-update/tsconfig.json +++ b/types/log-update/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/logat/tsconfig.json b/types/logat/tsconfig.json index 75453c3721..9d7c306b17 100644 --- a/types/logat/tsconfig.json +++ b/types/logat/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/logform/index.d.ts b/types/logform/index.d.ts new file mode 100644 index 0000000000..ca751f5bfd --- /dev/null +++ b/types/logform/index.d.ts @@ -0,0 +1,51 @@ +// Type definitions for logform 1.2 +// Project: https://github.com/winstonjs/logform +// Definitions by: DABH +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export interface TransformableInfo { + level: string; + message: string; + [key: string]: any; +} + +export type TransformFunction = (info: TransformableInfo, opts?: any) => TransformableInfo | boolean; +export type Colors = { [key: string]: string | string[] }; // tslint:disable-line interface-over-type-literal +export type FormatWrap = (opts?: any) => Format; + +export class Format { + constructor(opts?: object); + + options?: object; + transform: TransformFunction; +} + +export class Colorizer extends Format { + constructor(opts?: object); + + createColorize: (opts?: object) => Colorizer; + addColors: (colors: Colors) => Colors; + colorize: (level: string, message: string) => string; +} + +export function format(transform: TransformFunction): FormatWrap; + +export function levels(config: object): object; + +export namespace format { + function align(opts?: object): Format; + function cli(opts?: object): Format; + function colorize(opts?: object): Colorizer; + function combine(...formats: Format[]): Format; + function json(opts?: object): Format; + function label(opts?: object): Format; + function logstash(opts?: object): Format; + function padLevels(opts?: object): Format; + function prettyPrint(opts?: object): Format; + function printf(templateFunction: (info: TransformableInfo) => string): Format; + function simple(opts?: object): Format; + function splat(opts?: object): Format; + function timestamp(opts?: object): Format; + function uncolorize(opts?: object): Format; +} diff --git a/types/logform/logform-tests.ts b/types/logform/logform-tests.ts new file mode 100644 index 0000000000..72ec622869 --- /dev/null +++ b/types/logform/logform-tests.ts @@ -0,0 +1,58 @@ +import * as logform from 'logform'; +const format = logform.format; +const { combine, timestamp, label } = format; + +const labelTimestamp = combine( + label({ label: 'right meow!' }), + timestamp() +); + +const info = labelTimestamp.transform({ + level: 'info', + message: 'What time is the testing at?' +}); + +const ignorePrivate = format((info, opts) => { + if (info.private) { return false; } + return info; +})(); + +ignorePrivate.transform({ + level: 'error', + message: 'Public error to share' +}); + +ignorePrivate.transform({ + level: 'error', + private: true, + message: 'This is super secret - hide it.' +}); + +const willNeverThrow = format.combine( + format(info => false)(), // Ignores everything + format(info => { throw new Error('Never reached'); })() +); + +const volume = format((info, opts) => { + if (opts && opts.yell) { + info.message = info.message.toUpperCase(); + } else if (opts && opts.whisper) { + info.message = info.message.toLowerCase(); + } + + return info; +}); + +// `volume` is now a function that returns instances of the format. +const scream = volume({ yell: true }); +scream.transform({ + level: 'info', + message: `sorry for making you YELL in your head!` +}, scream.options); + +// `volume` can be used multiple times to create different formats. +const whisper = volume({ whisper: true }); +whisper.transform({ + level: 'info', + message: `WHY ARE THEY MAKING US YELL SO MUCH!` +}, whisper.options); diff --git a/types/logform/tsconfig.json b/types/logform/tsconfig.json new file mode 100644 index 0000000000..c8f0b78465 --- /dev/null +++ b/types/logform/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "logform-tests.ts" + ] +} \ No newline at end of file diff --git a/types/logform/tslint.json b/types/logform/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/logform/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/logg/tsconfig.json b/types/logg/tsconfig.json index 9dd1a361e7..3aa48bf94a 100644 --- a/types/logg/tsconfig.json +++ b/types/logg/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/loggly/tsconfig.json b/types/loggly/tsconfig.json index 76b8a59ac2..7f58c0566a 100644 --- a/types/loggly/tsconfig.json +++ b/types/loggly/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/loglevel/tsconfig.json b/types/loglevel/tsconfig.json index 4d370f7a24..24356220d6 100644 --- a/types/loglevel/tsconfig.json +++ b/types/loglevel/tsconfig.json @@ -14,11 +14,12 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "test/loglevel-tests.ts", "test/loglevel-umd-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/logrotate-stream/tsconfig.json b/types/logrotate-stream/tsconfig.json index 2f82ad189f..71cfc9061a 100644 --- a/types/logrotate-stream/tsconfig.json +++ b/types/logrotate-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lokijs/index.d.ts b/types/lokijs/index.d.ts index 74f1b6f09e..ca6903fa33 100644 --- a/types/lokijs/index.d.ts +++ b/types/lokijs/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for lokijs v1.5.1 // Project: https://github.com/techfort/LokiJS // Definitions by: TeamworkGuy2 +// Thomas Conner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -1277,6 +1278,7 @@ interface BinaryIndex { interface CollectionOptions { + disableMeta: boolean; disableChangesApi: boolean; disableDeltaChangesApi: boolean; adaptiveBinaryIndices: boolean; diff --git a/types/lokijs/tsconfig.json b/types/lokijs/tsconfig.json index 96175c28a4..39e3841c03 100644 --- a/types/lokijs/tsconfig.json +++ b/types/lokijs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lolex/tsconfig.json b/types/lolex/tsconfig.json index e9ab242410..6a181ec052 100644 --- a/types/lolex/tsconfig.json +++ b/types/lolex/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/long/tsconfig.json b/types/long/tsconfig.json index 2d90b2337f..6a07cb3a61 100644 --- a/types/long/tsconfig.json +++ b/types/long/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/loopback-boot/loopback-boot-tests.ts b/types/loopback-boot/loopback-boot-tests.ts index 5de95d00c6..8fa409c768 100644 --- a/types/loopback-boot/loopback-boot-tests.ts +++ b/types/loopback-boot/loopback-boot-tests.ts @@ -1,6 +1,6 @@ -import * as loopback from 'loopback'; -import * as boot from 'loopback-boot'; -import * as cookieParser from 'cookie-parser'; +import loopback = require('loopback'); +import boot = require('loopback-boot'); +import cookieParser = require('cookie-parser'); class Server { app: loopback.LoopBackApplication; diff --git a/types/loopback-boot/tsconfig.json b/types/loopback-boot/tsconfig.json index 2a7cbe1ca5..6f4a061162 100644 --- a/types/loopback-boot/tsconfig.json +++ b/types/loopback-boot/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/loopback/index.d.ts b/types/loopback/index.d.ts index 99fc4d4ccb..087ce2aadd 100644 --- a/types/loopback/index.d.ts +++ b/types/loopback/index.d.ts @@ -2653,7 +2653,7 @@ declare namespace l { * if a principal is in the specified role. * Should provide a callback or return a promise. */ - static registerResolver(role: string, resolver: () => void): void; + static registerResolver(role: string, resolver: (role: string, ctx: Context, callback?: (err: Error, resolved: boolean) => void) => Promise | void): void; } /** diff --git a/types/loopback/loopback-tests.ts b/types/loopback/loopback-tests.ts index ed37bf5804..359e6977b6 100644 --- a/types/loopback/loopback-tests.ts +++ b/types/loopback/loopback-tests.ts @@ -1,5 +1,5 @@ -import * as loopback from 'loopback'; -import * as cookieParser from 'cookie-parser'; +import loopback = require('loopback'); +import cookieParser = require('cookie-parser'); class TestModel { id: number; diff --git a/types/loopback/tsconfig.json b/types/loopback/tsconfig.json index b967450fde..c823167232 100644 --- a/types/loopback/tsconfig.json +++ b/types/loopback/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lorem-ipsum/tsconfig.json b/types/lorem-ipsum/tsconfig.json index c1f3e00374..5575163410 100644 --- a/types/lorem-ipsum/tsconfig.json +++ b/types/lorem-ipsum/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lory.js/tsconfig.json b/types/lory.js/tsconfig.json index 94d47b69ea..6421fd1c74 100644 --- a/types/lory.js/tsconfig.json +++ b/types/lory.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/loud-rejection/tsconfig.json b/types/loud-rejection/tsconfig.json index 56909e692c..10ea4f7604 100644 --- a/types/loud-rejection/tsconfig.json +++ b/types/loud-rejection/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lovefield/tsconfig.json b/types/lovefield/tsconfig.json index fa9ed6e11d..08338eadd1 100644 --- a/types/lovefield/tsconfig.json +++ b/types/lovefield/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lowdb/tsconfig.json b/types/lowdb/tsconfig.json index 7897564789..1de72964d4 100644 --- a/types/lowdb/tsconfig.json +++ b/types/lowdb/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -28,4 +29,4 @@ "lib/main.d.ts", "lowdb-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/lowlight/tsconfig.json b/types/lowlight/tsconfig.json index 31ecea4b06..0a49e6766b 100644 --- a/types/lowlight/tsconfig.json +++ b/types/lowlight/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lozad/tsconfig.json b/types/lozad/tsconfig.json index 9243f7f7d4..d61aba4331 100644 --- a/types/lozad/tsconfig.json +++ b/types/lozad/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lru-cache/tsconfig.json b/types/lru-cache/tsconfig.json index de5c387339..f43250b4df 100644 --- a/types/lru-cache/tsconfig.json +++ b/types/lru-cache/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lscache/tsconfig.json b/types/lscache/tsconfig.json index 50876365a3..2d2820887b 100644 --- a/types/lscache/tsconfig.json +++ b/types/lscache/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ltx/tsconfig.json b/types/ltx/tsconfig.json index d4af416e4b..6dc4e36d43 100644 --- a/types/ltx/tsconfig.json +++ b/types/ltx/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/luaparse/tsconfig.json b/types/luaparse/tsconfig.json index 8e932f496e..20bb41fd6f 100644 --- a/types/luaparse/tsconfig.json +++ b/types/luaparse/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lunr/tsconfig.json b/types/lunr/tsconfig.json index 87faffb76d..703cfe59e2 100644 --- a/types/lunr/tsconfig.json +++ b/types/lunr/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lunr/v0/tsconfig.json b/types/lunr/v0/tsconfig.json index a98126157c..e5e4452efe 100644 --- a/types/lunr/v0/tsconfig.json +++ b/types/lunr/v0/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lusca/tsconfig.json b/types/lusca/tsconfig.json index ede7926c1c..121ac13cb6 100644 --- a/types/lusca/tsconfig.json +++ b/types/lusca/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "lusca-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/luxon/index.d.ts b/types/luxon/index.d.ts index c8ce226220..7229e45dc4 100644 --- a/types/luxon/index.d.ts +++ b/types/luxon/index.d.ts @@ -10,6 +10,10 @@ declare module 'luxon' { type DateTimeFormatOptions = Intl.DateTimeFormatOptions; type ZoneOptions = { + keepLocalTime?: boolean; + /** + * @deprecated since 0.2.12. Use keepLocalTime instead + */ keepCalendarTime?: boolean; }; @@ -61,26 +65,26 @@ declare module 'luxon' { }; class DateTime { - static DATETIME_FULL: DateTimeFormatOptions; - static DATETIME_FULL_WITH_SECONDS: DateTimeFormatOptions; - static DATEIME_HUGE: DateTimeFormatOptions; - static DATEIME_HUGE_WITH_SECONDS: DateTimeFormatOptions; - static DATETIME_MED: DateTimeFormatOptions; - static DATETIME_MED_WITH_SECONDS: DateTimeFormatOptions; - static DATETIME_SHORT: DateTimeFormatOptions; - static DATETIME_SHORT_WITH_SECONDS: DateTimeFormatOptions; - static DATE_FULL: DateTimeFormatOptions; - static DATE_HUGE: DateTimeFormatOptions; - static DATE_MED: DateTimeFormatOptions; - static DATE_SHORT: DateTimeFormatOptions; - static TIME_24_SIMPLE: DateTimeFormatOptions; - static TIME_24_WITH_LONG_OFFSET: DateTimeFormatOptions; - static TIME_24_WITH_SECONDS: DateTimeFormatOptions; - static TIME_24_WITH_SHORT_OFFSET: DateTimeFormatOptions; - static TIME_SIMPLE: DateTimeFormatOptions; - static TIME_WITH_LONG_OFFSET: DateTimeFormatOptions; - static TIME_WITH_SECONDS: DateTimeFormatOptions; - static TIME_WITH_SHORT_OFFSET: DateTimeFormatOptions; + static readonly DATETIME_FULL: DateTimeFormatOptions; + static readonly DATETIME_FULL_WITH_SECONDS: DateTimeFormatOptions; + static readonly DATETIME_HUGE: DateTimeFormatOptions; + static readonly DATETIME_HUGE_WITH_SECONDS: DateTimeFormatOptions; + static readonly DATETIME_MED: DateTimeFormatOptions; + static readonly DATETIME_MED_WITH_SECONDS: DateTimeFormatOptions; + static readonly DATETIME_SHORT: DateTimeFormatOptions; + static readonly DATETIME_SHORT_WITH_SECONDS: DateTimeFormatOptions; + static readonly DATE_FULL: DateTimeFormatOptions; + static readonly DATE_HUGE: DateTimeFormatOptions; + static readonly DATE_MED: DateTimeFormatOptions; + static readonly DATE_SHORT: DateTimeFormatOptions; + static readonly TIME_24_SIMPLE: DateTimeFormatOptions; + static readonly TIME_24_WITH_LONG_OFFSET: DateTimeFormatOptions; + static readonly TIME_24_WITH_SECONDS: DateTimeFormatOptions; + static readonly TIME_24_WITH_SHORT_OFFSET: DateTimeFormatOptions; + static readonly TIME_SIMPLE: DateTimeFormatOptions; + static readonly TIME_WITH_LONG_OFFSET: DateTimeFormatOptions; + static readonly TIME_WITH_SECONDS: DateTimeFormatOptions; + static readonly TIME_WITH_SHORT_OFFSET: DateTimeFormatOptions; static fromHTTP(text: string, options?: DateTimeOptions): DateTime; static fromISO(text: string, options?: DateTimeOptions): DateTime; static fromJSDate( @@ -94,11 +98,27 @@ declare module 'luxon' { options?: DateTimeOptions ): DateTime; static fromSQL(text: string, options?: DateTimeOptions): DateTime; + static fromFormat( + text: string, + format: string, + opts?: DateTimeOptions + ): DateTime; + static fromFormatExplain( + text: string, + format: string, + opts?: DateTimeOptions + ): object; + /** + * @deprecated since 0.3.0. Use fromFormat instead + */ static fromString( text: string, format: string, options?: DateTimeOptions ): DateTime; + /** + * @deprecated 0.3.0. Use fromFormatExplain instead + */ static fromStringExplain( text: string, format: string, @@ -274,6 +294,7 @@ declare module 'luxon' { function eras(length?: EraLength, options?: InfoOptions): string[]; function features(): Features; function hasDST(zone: string | Zone): boolean; + function isValidIANAZone(zone: string): boolean; function meridiems(options?: InfoOptions): string[]; function months(length?: UnitLength, options?: UnitOptions): string[]; function monthsFormat(length?: UnitLength, options?: UnitOptions): string[]; diff --git a/types/luxon/tsconfig.json b/types/luxon/tsconfig.json index e1b0e7864c..5cc88630a1 100644 --- a/types/luxon/tsconfig.json +++ b/types/luxon/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "luxon-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/lwip/tsconfig.json b/types/lwip/tsconfig.json index 769d843dfa..9ee6b81563 100644 --- a/types/lwip/tsconfig.json +++ b/types/lwip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lz-string/tsconfig.json b/types/lz-string/tsconfig.json index 40ca2ffb09..dde67f8095 100644 --- a/types/lz-string/tsconfig.json +++ b/types/lz-string/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/magic-number/tsconfig.json b/types/magic-number/tsconfig.json index 8dedeff2ce..b1f79faabc 100644 --- a/types/magic-number/tsconfig.json +++ b/types/magic-number/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/magicsuggest/tsconfig.json b/types/magicsuggest/tsconfig.json index 19b82ea9cd..c653b426c2 100644 --- a/types/magicsuggest/tsconfig.json +++ b/types/magicsuggest/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/magnet-uri/tsconfig.json b/types/magnet-uri/tsconfig.json index e47bf7de89..6e9dde38d8 100644 --- a/types/magnet-uri/tsconfig.json +++ b/types/magnet-uri/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mailcheck/tsconfig.json b/types/mailcheck/tsconfig.json index 9f3bada102..29af1c15d0 100644 --- a/types/mailcheck/tsconfig.json +++ b/types/mailcheck/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/maildev/tsconfig.json b/types/maildev/tsconfig.json index e7d5d8aa90..dff916fbd2 100644 --- a/types/maildev/tsconfig.json +++ b/types/maildev/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mailgen/tsconfig.json b/types/mailgen/tsconfig.json index be58901e20..54d65b6c43 100644 --- a/types/mailgen/tsconfig.json +++ b/types/mailgen/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mailparser/tsconfig.json b/types/mailparser/tsconfig.json index 0e85dee795..3570cc37d0 100644 --- a/types/mailparser/tsconfig.json +++ b/types/mailparser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/main-bower-files/tsconfig.json b/types/main-bower-files/tsconfig.json index bde61fa6db..03d4c7ad1f 100644 --- a/types/main-bower-files/tsconfig.json +++ b/types/main-bower-files/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mainloop.js/tsconfig.json b/types/mainloop.js/tsconfig.json index b8e7bf9fd5..784abcc46e 100644 --- a/types/mainloop.js/tsconfig.json +++ b/types/mainloop.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/make-dir/tsconfig.json b/types/make-dir/tsconfig.json index f1770d52af..90fb4e1cdc 100644 --- a/types/make-dir/tsconfig.json +++ b/types/make-dir/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/maker.js/tsconfig.json b/types/maker.js/tsconfig.json index 3f15fa99e1..62757799a0 100644 --- a/types/maker.js/tsconfig.json +++ b/types/maker.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mandrill-api/tsconfig.json b/types/mandrill-api/tsconfig.json index 9855b826de..26cc6e44e4 100644 --- a/types/mandrill-api/tsconfig.json +++ b/types/mandrill-api/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/map-obj/tsconfig.json b/types/map-obj/tsconfig.json index 70c0243a5b..c640073717 100644 --- a/types/map-obj/tsconfig.json +++ b/types/map-obj/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index f334304224..47f62556c3 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -26,8 +26,12 @@ declare namespace mapboxgl { constructor(options?: MapboxOptions); addControl(control: Control, position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'): this; + + addControl(control: IControl, position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'): this; removeControl(control: Control): this; + + removeControl(control: IControl): this; addClass(klass: string, options?: mapboxgl.StyleOptions): this; @@ -161,7 +165,7 @@ declare namespace mapboxgl { setPitch(pitch: number, eventData?: EventData): this; - fitBounds(bounds: LngLatBoundsLike, options?: { linear?: boolean, easing?: Function, padding?: number | mapboxgl.PaddingOptions, offset?: PointLike, maxZoom?: number }, eventData?: mapboxgl.EventData): this; + fitBounds(bounds: LngLatBoundsLike, options?: mapboxgl.FitBoundsOptions, eventData?: mapboxgl.EventData): this; jumpTo(options: mapboxgl.CameraOptions, eventData?: mapboxgl.EventData): this; @@ -404,10 +408,6 @@ declare namespace mapboxgl { maximumAge?: number; } - export class FitBoundsOptions { - maxZoom?: number; - } - /** * Geolocate */ @@ -872,6 +872,15 @@ declare namespace mapboxgl { easing?: Function; } + export interface FitBoundsOptions extends mapboxgl.FlyToOptions { + linear?: boolean; + easing?: Function; + padding?: number | mapboxgl.PaddingOptions; + offset?: mapboxgl.PointLike; + maxZoom?: number; + maxDuration?: number; + } + /** * MapEvent */ diff --git a/types/mapbox-gl/tsconfig.json b/types/mapbox-gl/tsconfig.json index 4c4228132e..347f097155 100644 --- a/types/mapbox-gl/tsconfig.json +++ b/types/mapbox-gl/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "mapbox-gl-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/mapbox/tsconfig.json b/types/mapbox/tsconfig.json index 9aec764a7c..97c6c610a8 100644 --- a/types/mapbox/tsconfig.json +++ b/types/mapbox/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mapbox__shelf-pack/tsconfig.json b/types/mapbox__shelf-pack/tsconfig.json index 49afd3f46e..6dd2d6f58f 100644 --- a/types/mapbox__shelf-pack/tsconfig.json +++ b/types/mapbox__shelf-pack/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mapnik/tsconfig.json b/types/mapnik/tsconfig.json index 81f111a37e..4112c1aab4 100644 --- a/types/mapnik/tsconfig.json +++ b/types/mapnik/tsconfig.json @@ -1,23 +1,24 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "mapnik-tests.ts" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "mapnik-tests.ts" + ] } \ No newline at end of file diff --git a/types/mapsjs/tsconfig.json b/types/mapsjs/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/mapsjs/tsconfig.json +++ b/types/mapsjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/mariasql/tsconfig.json b/types/mariasql/tsconfig.json index bab62b5218..353dfdd4b9 100644 --- a/types/mariasql/tsconfig.json +++ b/types/mariasql/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mark.js/tsconfig.json b/types/mark.js/tsconfig.json index 381f150954..9a75e5b93b 100644 --- a/types/mark.js/tsconfig.json +++ b/types/mark.js/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "mark.js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/markdown-it-anchor/tsconfig.json b/types/markdown-it-anchor/tsconfig.json index df3de49f4a..8b1b51c3c4 100644 --- a/types/markdown-it-anchor/tsconfig.json +++ b/types/markdown-it-anchor/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/markdown-it-container/tsconfig.json b/types/markdown-it-container/tsconfig.json index 9dd6ec9ad2..9d32044fcb 100644 --- a/types/markdown-it-container/tsconfig.json +++ b/types/markdown-it-container/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/markdown-it/tsconfig.json b/types/markdown-it/tsconfig.json index fc493d2d9b..2cddb5aefd 100644 --- a/types/markdown-it/tsconfig.json +++ b/types/markdown-it/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/markdownlint/tsconfig.json b/types/markdownlint/tsconfig.json index 53b9ae46aa..193076542b 100644 --- a/types/markdownlint/tsconfig.json +++ b/types/markdownlint/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "markdownlint-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/marked/tsconfig.json b/types/marked/tsconfig.json index 222ab4e4f1..8380a3964f 100644 --- a/types/marked/tsconfig.json +++ b/types/marked/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/marker-animate-unobtrusive/tsconfig.json b/types/marker-animate-unobtrusive/tsconfig.json index 68e2526510..1b1c994cb4 100644 --- a/types/marker-animate-unobtrusive/tsconfig.json +++ b/types/marker-animate-unobtrusive/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/markerclustererplus/tsconfig.json b/types/markerclustererplus/tsconfig.json index 0aca5b9a0a..f4c0adbebc 100644 --- a/types/markerclustererplus/tsconfig.json +++ b/types/markerclustererplus/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/markitup/tsconfig.json b/types/markitup/tsconfig.json index daa2c18b72..384fb13be7 100644 --- a/types/markitup/tsconfig.json +++ b/types/markitup/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/maskedinput/tsconfig.json b/types/maskedinput/tsconfig.json index 0884b77742..90ead5dea0 100644 --- a/types/maskedinput/tsconfig.json +++ b/types/maskedinput/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/masonry-layout/index.d.ts b/types/masonry-layout/index.d.ts index a771b423e5..2e62989ca8 100644 --- a/types/masonry-layout/index.d.ts +++ b/types/masonry-layout/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Masonry 4.0 +// Type definitions for Masonry 4.2 // Project: https://github.com/desandro/masonry // Definitions by: Mark Wilson , Travis Brown // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -50,6 +50,7 @@ declare namespace Masonry { fitWidth?: boolean; originLeft?: boolean; originTop?: boolean; + horizontalOrder?: boolean; // setup containerStyle?: {}; diff --git a/types/masonry-layout/masonry-layout-tests.ts b/types/masonry-layout/masonry-layout-tests.ts index d21813a791..3a75894f5c 100644 --- a/types/masonry-layout/masonry-layout-tests.ts +++ b/types/masonry-layout/masonry-layout-tests.ts @@ -42,6 +42,7 @@ function testExtendedOptions() { }, transitionDuration: '0.4s', resize: true, - initLayout: true + initLayout: true, + horizontalOrder: true }); } diff --git a/types/masonry-layout/tsconfig.json b/types/masonry-layout/tsconfig.json index a2133122a5..e0ebcb530e 100644 --- a/types/masonry-layout/tsconfig.json +++ b/types/masonry-layout/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/massive/tsconfig.json b/types/massive/tsconfig.json index 916b3e2b47..da316ae1a5 100644 --- a/types/massive/tsconfig.json +++ b/types/massive/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/massive/v3/tsconfig.json b/types/massive/v3/tsconfig.json index ddfdc175d3..334d74eea1 100644 --- a/types/massive/v3/tsconfig.json +++ b/types/massive/v3/tsconfig.json @@ -12,15 +12,18 @@ "../../" ], "paths": { - "massive": [ "massive/v3" ] + "massive": [ + "massive/v3" + ] }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ "index.d.ts", "massive-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/match-media-mock/tsconfig.json b/types/match-media-mock/tsconfig.json index adcb526b65..9187747e27 100644 --- a/types/match-media-mock/tsconfig.json +++ b/types/match-media-mock/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/material-components-web/index.d.ts b/types/material-components-web/index.d.ts new file mode 100644 index 0000000000..c5d1434942 --- /dev/null +++ b/types/material-components-web/index.d.ts @@ -0,0 +1,64 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import autoInit from 'material__auto-init'; +import * as base from 'material__base'; +import * as checkbox from 'material__checkbox'; +import * as dialog from 'material__dialog'; +import * as drawer from 'material__drawer'; +import * as formField from 'material__form-field'; +import * as gridList from 'material__grid-list'; +import * as iconToggle from 'material__icon-toggle'; +import * as linearProgress from 'material__linear-progress'; +import * as menu from 'material__menu'; +import * as radio from 'material__radio'; +import * as ripple from 'material__ripple'; +import * as select from 'material__select'; +import * as selectionControl from 'material__selection-control'; +import * as slider from 'material__slider'; +import * as snackbar from 'material__snackbar'; +import * as tabs from 'material__tabs'; +import * as textField from 'material__textfield'; +import * as toolbar from 'material__toolbar'; + +// Export all components. +export { + autoInit, + base, + checkbox, + dialog, + drawer, + formField, + gridList, + iconToggle, + linearProgress, + menu, + radio, + ripple, + select, + selectionControl, + slider, + snackbar, + tabs, + textField, + toolbar, +}; diff --git a/types/material-components-web/tsconfig.json b/types/material-components-web/tsconfig.json new file mode 100644 index 0000000000..8b1b69457e --- /dev/null +++ b/types/material-components-web/tsconfig.json @@ -0,0 +1,24 @@ +{ + "files": [ + "index.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material-components-web/tslint.json b/types/material-components-web/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material-components-web/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material-design-lite/tsconfig.json b/types/material-design-lite/tsconfig.json index 96da690ed9..0672184541 100644 --- a/types/material-design-lite/tsconfig.json +++ b/types/material-design-lite/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/material-ui-datatables/tsconfig.json b/types/material-ui-datatables/tsconfig.json index 805afdbb17..1b91dcedd6 100644 --- a/types/material-ui-datatables/tsconfig.json +++ b/types/material-ui-datatables/tsconfig.json @@ -15,7 +15,8 @@ "jsx": "react", "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/material-ui-pagination/material-ui-pagination-tests.tsx b/types/material-ui-pagination/material-ui-pagination-tests.tsx index a7f85d8184..d680f95e1f 100644 --- a/types/material-ui-pagination/material-ui-pagination-tests.tsx +++ b/types/material-ui-pagination/material-ui-pagination-tests.tsx @@ -5,7 +5,7 @@ import * as ReactDOM from 'react-dom'; import Pagination from 'material-ui-pagination'; import * as ui from 'material-ui'; import { MuiThemeProvider } from 'material-ui/styles'; -import * as injectTapEventPlugin from 'react-tap-event-plugin'; +import injectTapEventPlugin = require('react-tap-event-plugin'); // Needed for onTouchTap // Check this repo: diff --git a/types/material-ui-pagination/tsconfig.json b/types/material-ui-pagination/tsconfig.json index c98526003d..eef315d2c9 100644 --- a/types/material-ui-pagination/tsconfig.json +++ b/types/material-ui-pagination/tsconfig.json @@ -21,6 +21,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/material-ui/index.d.ts b/types/material-ui/index.d.ts index 08a18a752b..9624e6d4a2 100644 --- a/types/material-ui/index.d.ts +++ b/types/material-ui/index.d.ts @@ -1262,7 +1262,7 @@ declare namespace __MaterialUI { // Other properties from autoWidth?: boolean; - children?: Array>; + children?: React.ReactElement | Array>; desktop?: boolean; disableAutoFocus?: boolean; initiallyKeyboardFocused?: boolean; @@ -1409,6 +1409,7 @@ declare namespace __MaterialUI { // is the element that get the 'other' properties autoWidth?: boolean; disabled?: boolean; + dropDownMenuProps?: Menus.DropDownMenuProps; errorStyle?: React.CSSProperties; errorText?: React.ReactNode; floatingLabelFixed?: boolean; diff --git a/types/material-ui/material-ui-tests.tsx b/types/material-ui/material-ui-tests.tsx index 316a14b78a..51b22c936c 100644 --- a/types/material-ui/material-ui-tests.tsx +++ b/types/material-ui/material-ui-tests.tsx @@ -4498,6 +4498,11 @@ const IconMenuExampleSimple = () => ( + } + > + + ); @@ -5508,6 +5513,31 @@ class SelectFieldExampleSelectionRenderer extends Component<{}, {values?: string } } +class SelectFieldExampleDropDownMenu extends Component<{}, {value?: number}> { + constructor(props) { + super(props); + this.state = {value: null}; + } + + handleChange = (event, index, value) => this.setState({value}); + + render() { + return ( + + + + + + ); + } +} + // "http://www.material-ui.com/#/components/slider" const SliderExampleSimple = () => (
diff --git a/types/material-ui/tsconfig.json b/types/material-ui/tsconfig.json index 7d478ab185..0d3a5e6d32 100644 --- a/types/material-ui/tsconfig.json +++ b/types/material-ui/tsconfig.json @@ -21,6 +21,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/material__animation/index.d.ts b/types/material__animation/index.d.ts new file mode 100644 index 0000000000..8baf562003 --- /dev/null +++ b/types/material__animation/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export const transformStyleProperties: string[]; + +export function getCorrectEventName(windowObj: Window, eventType: string): string; + +export function getCorrectPropertyName(windowObj: Window, eventType: string): string; diff --git a/types/material__animation/tsconfig.json b/types/material__animation/tsconfig.json new file mode 100644 index 0000000000..0cbce49fc7 --- /dev/null +++ b/types/material__animation/tsconfig.json @@ -0,0 +1,25 @@ +{ + "files": [ + "index.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__animation/tslint.json b/types/material__animation/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__animation/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__auto-init/index.d.ts b/types/material__auto-init/index.d.ts new file mode 100644 index 0000000000..026b692b99 --- /dev/null +++ b/types/material__auto-init/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export type MDCLogger = (message?: any, ...optionalParams: any[]) => void; + +export interface MDCAutoInit { + (root?: Document, warn?: MDCLogger): MDCAutoInit; + register(componentName: string, Ctor: (...args: any[]) => any, warn?: MDCLogger): void; + deregister(componentName: string): void; + deregisterAll(): void; +} + +/** + * Auto-initializes all mdc components on a page. + */ +declare const mdcAutoInit: MDCAutoInit; + +export default mdcAutoInit; diff --git a/types/material__auto-init/tsconfig.json b/types/material__auto-init/tsconfig.json new file mode 100644 index 0000000000..0cbce49fc7 --- /dev/null +++ b/types/material__auto-init/tsconfig.json @@ -0,0 +1,25 @@ +{ + "files": [ + "index.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__auto-init/tslint.json b/types/material__auto-init/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__auto-init/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__base/component.d.ts b/types/material__base/component.d.ts new file mode 100644 index 0000000000..0a645b26a4 --- /dev/null +++ b/types/material__base/component.d.ts @@ -0,0 +1,63 @@ +/** + * @license + * Copyright 2016 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from './foundation'; + +export class MDCComponent> { + static attachTo(root: Element): MDCComponent>; + + constructor(root: Element, foundation?: F, ...args: any[]); + + // Subclasses can override this to do any additional setup work that would be considered part of a + // "constructor". Essentially, it is a hook into the parent constructor before the foundation is + // initialized. Any additional arguments besides root and foundation will be passed in here. + initialize(...args: any[]): void; + + // Subclasses must override this method to return a properly configured foundation class for the + // component. + getDefaultFoundation(): F; + + // Subclasses should override this method if they need to perform work to synchronize with a host DOM + // object. An example of this would be a form control wrapper that needs to synchronize its internal state + // to some property or attribute of the host DOM. Please note: this is *not* the place to perform DOM + // reads/writes that would cause layout / paint, as this is called synchronously from within the constructor. + initialSyncWithDOM(): void; + + // Subclasses may implement this method to release any resources / deregister any listeners they have + // attached. An example of this might be deregistering a resize event from the window object. + destroy(): void; + + /** + * Wrapper method to add an event listener to the component's root element. This is most useful when + * listening for custom events. + */ + listen(evtType: string, handler: EventListenerOrEventListenerObject): void; + + /** + * Wrapper method to remove an event listener to the component's root element. This is most useful when + * unlistening for custom events. + */ + unlisten(evtType: string, handler: EventListenerOrEventListenerObject): void; + + /** + * Fires a cross-browser-compatible custom event from the component root of the given type, + * with the given data. + */ + emit(evtType: string, evtData: any, shouldBubble?: boolean): void; +} + +export default MDCComponent; diff --git a/types/material__base/foundation.d.ts b/types/material__base/foundation.d.ts new file mode 100644 index 0000000000..7612d0daea --- /dev/null +++ b/types/material__base/foundation.d.ts @@ -0,0 +1,44 @@ +/** + * @license + * Copyright 2016 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCStrings { + [key: string]: string; +} + +export interface MDCNumbers { + [key: string]: number; +} + +export class MDCFoundation { + static readonly cssClasses: MDCStrings; + + static readonly strings: MDCStrings; + + static readonly numbers: MDCNumbers; + + static readonly defaultAdapter: any; + + constructor(adapter: A); + + // Subclasses should override this method to perform initialization routines (registering events, etc.) + init(): void; + + // Subclasses should override this method to perform de-initialization routines (de-registering events, etc.) + destroy(): void; +} + +export default MDCFoundation; diff --git a/types/material__base/index.d.ts b/types/material__base/index.d.ts new file mode 100644 index 0000000000..0172cb35f6 --- /dev/null +++ b/types/material__base/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2016 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCNumbers, MDCStrings, MDCFoundation } from './foundation'; +import MDCComponent from './component'; + +export {MDCNumbers, MDCStrings, MDCFoundation, MDCComponent}; diff --git a/types/material__base/tsconfig.json b/types/material__base/tsconfig.json new file mode 100644 index 0000000000..3cd07b146b --- /dev/null +++ b/types/material__base/tsconfig.json @@ -0,0 +1,27 @@ +{ + "files": [ + "component.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__base/tslint.json b/types/material__base/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__base/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__checkbox/adapter.d.ts b/types/material__checkbox/adapter.d.ts new file mode 100644 index 0000000000..aedeed30f5 --- /dev/null +++ b/types/material__checkbox/adapter.d.ts @@ -0,0 +1,54 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCSelectionControlState } from 'material__selection-control'; + +/** + * Adapter for MDC Checkbox. Provides an interface for managing + * - classes + * - dom + * - event handlers + * + * Additionally, provides type information for the adapter to the Closure + * compiler. + * + * Implement this adapter for your framework of choice to delegate updates to + * the component in your framework of choice. See architecture documentation + * for more details. + * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md + */ +export class MDCCheckboxAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + registerAnimationEndHandler(handler: EventListener): void; + + deregisterAnimationEndHandler(handler: EventListener): void; + + registerChangeHandler(handler: EventListener): void; + + deregisterChangeHandler(handler: EventListener): void; + + getNativeControl(): MDCSelectionControlState; + + forceLayout(): void; + + isAttachedToDOM(): boolean; +} + +export default MDCCheckboxAdapter; diff --git a/types/material__checkbox/constants.d.ts b/types/material__checkbox/constants.d.ts new file mode 100644 index 0000000000..ee665f4c05 --- /dev/null +++ b/types/material__checkbox/constants.d.ts @@ -0,0 +1,42 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { MDCStrings, MDCNumbers } from 'material__base'; + +export interface cssClasses extends MDCStrings { + UPGRADED: 'mdc-checkbox--upgraded'; + CHECKED: 'mdc-checkbox--checked'; + INDETERMINATE: 'mdc-checkbox--indeterminate'; + DISABLED: 'mdc-checkbox--disabled'; + ANIM_UNCHECKED_CHECKED: 'mdc-checkbox--anim-unchecked-checked'; + ANIM_UNCHECKED_INDETERMINATE: 'mdc-checkbox--anim-unchecked-indeterminate'; + ANIM_CHECKED_UNCHECKED: 'mdc-checkbox--anim-checked-unchecked'; + ANIM_CHECKED_INDETERMINATE: 'mdc-checkbox--anim-checked-indeterminate'; + ANIM_INDETERMINATE_CHECKED: 'mdc-checkbox--anim-indeterminate-checked'; + ANIM_INDETERMINATE_UNCHECKED: 'mdc-checkbox--anim-indeterminate-unchecked'; +} + +export interface strings extends MDCStrings { + NATIVE_CONTROL_SELECTOR: '.mdc-checkbox__native-control'; + TRANSITION_STATE_INIT: 'init'; + TRANSITION_STATE_CHECKED: 'checked'; + TRANSITION_STATE_UNCHECKED: 'unchecked'; + TRANSITION_STATE_INDETERMINATE: 'indeterminate'; +} + +export interface numbers extends MDCNumbers { + ANIM_END_LATCH_MS: 100; +} diff --git a/types/material__checkbox/foundation.d.ts b/types/material__checkbox/foundation.d.ts new file mode 100644 index 0000000000..73216efcd6 --- /dev/null +++ b/types/material__checkbox/foundation.d.ts @@ -0,0 +1,48 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import MDCCheckboxAdapter from './adapter'; +import { cssClasses, strings, numbers } from './constants'; + +export class MDCCheckboxFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly numbers: numbers; + + static readonly defaultAdapter: MDCCheckboxAdapter; + + isChecked(): boolean; + + setChecked(checked: boolean): boolean; + + isIndeterminate(): boolean; + + setIndeterminate(indeterminate: boolean): void; + + isDisabled(): boolean; + + setDisabled(disabled: boolean): void; + + getValue(): string; + + setValue(value: string): void; +} + +export default MDCCheckboxFoundation; diff --git a/types/material__checkbox/index.d.ts b/types/material__checkbox/index.d.ts new file mode 100644 index 0000000000..9190c3d5a9 --- /dev/null +++ b/types/material__checkbox/index.d.ts @@ -0,0 +1,48 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import MDCCheckboxAdapter from './adapter'; +import { MDCSelectionControl } from 'material__selection-control'; +import MDCCheckboxFoundation from './foundation'; +import { MDCRipple } from 'material__ripple'; + +export {MDCCheckboxAdapter, MDCCheckboxFoundation}; + +export class MDCCheckbox extends MDCComponent implements MDCSelectionControl { + static attachTo(root: Element): MDCCheckbox; + + getDefaultFoundation(): MDCCheckboxFoundation; + + readonly ripple: MDCRipple; + + checked: boolean; + + indeterminate: boolean; + + disabled: boolean; + + value: string; + + destroy(): void; +} diff --git a/types/material__checkbox/tsconfig.json b/types/material__checkbox/tsconfig.json new file mode 100644 index 0000000000..06c0ac3c43 --- /dev/null +++ b/types/material__checkbox/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__checkbox/tslint.json b/types/material__checkbox/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__checkbox/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__dialog/adapter.d.ts b/types/material__dialog/adapter.d.ts new file mode 100644 index 0000000000..fd6bc3cf9f --- /dev/null +++ b/types/material__dialog/adapter.d.ts @@ -0,0 +1,55 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MSDDialogAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + addBodyClass(className: string): void; + + removeBodyClass(className: string): void; + + eventTargetHasClass(target: EventTarget, className: string): boolean; + + registerInteractionHandler(evt: string, handler: EventListener): void; + + deregisterInteractionHandler(evt: string, handler: EventListener): void; + + registerSurfaceInteractionHandler(evt: string, handler: EventListener): void; + + deregisterSurfaceInteractionHandler(evt: string, handler: EventListener): void; + + registerDocumentKeydownHandler(handler: EventListener): void; + + deregisterDocumentKeydownHandler(handler: EventListener): void; + + registerTransitionEndHandler(handler: EventListener): void; + + deregisterTransitionEndHandler(handler: EventListener): void; + + notifyAccept(): void; + + notifyCancel(): void; + + trapFocusOnSurface(): void; + + untrapFocusOnSurface(): void; + + isDialog(el: Element): boolean; + + layoutFooterRipples(): void; +} diff --git a/types/material__dialog/constants.d.ts b/types/material__dialog/constants.d.ts new file mode 100644 index 0000000000..a45628627c --- /dev/null +++ b/types/material__dialog/constants.d.ts @@ -0,0 +1,35 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-dialog'; + OPEN: 'mdc-dialog--open'; + ANIMATING: 'mdc-dialog--animating'; + BACKDROP: 'mdc-dialog__backdrop'; + SCROLL_LOCK: 'mdc-dialog-scroll-lock'; + ACCEPT_BTN: 'mdc-dialog__footer__button--accept'; + CANCEL_BTN: 'mdc-dialog__footer__button--cancel'; +} + +export interface strings extends MDCStrings { + OPEN_DIALOG_SELECTOR: '.mdc-dialog--open'; + DIALOG_SURFACE_SELECTOR: '.mdc-dialog__surface'; + ACCEPT_SELECTOR: '.mdc-dialog__footer__button--accept'; + ACCEPT_EVENT: 'MDCDialog:accept'; + CANCEL_EVENT: 'MDCDialog:cancel'; +} diff --git a/types/material__dialog/foundation.d.ts b/types/material__dialog/foundation.d.ts new file mode 100644 index 0000000000..f28c541dd2 --- /dev/null +++ b/types/material__dialog/foundation.d.ts @@ -0,0 +1,39 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCFoundation } from 'material__base'; +import { cssClasses, strings } from './constants'; +import { MSDDialogAdapter } from './adapter'; + +export class MDCDialogFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MSDDialogAdapter; + + open(): void; + + close(): void; + + isOpen(): boolean; + + accept(shouldNotify: boolean): void; + + cancel(shouldNotify: boolean): void; +} + +export default MDCDialogFoundation; diff --git a/types/material__dialog/index.d.ts b/types/material__dialog/index.d.ts new file mode 100644 index 0000000000..7d8ab69e30 --- /dev/null +++ b/types/material__dialog/index.d.ts @@ -0,0 +1,46 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; +import { MDCRipple } from 'material__ripple'; + +import MDCDialogFoundation from './foundation'; +import { MSDDialogAdapter } from './adapter'; +import * as util from './util'; + +export {MSDDialogAdapter, MDCDialogFoundation, util}; + +export class MDCDialog extends MDCComponent { + static attachTo(root: Element): MDCDialog; + + readonly open: boolean; + + initialize(): void; + + destroy(): void; + + show(): void; + + close(): void; + + getDefaultFoundation(): MDCDialogFoundation; +} diff --git a/types/material__dialog/tsconfig.json b/types/material__dialog/tsconfig.json new file mode 100644 index 0000000000..9f215e4ee0 --- /dev/null +++ b/types/material__dialog/tsconfig.json @@ -0,0 +1,29 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "util.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__dialog/tslint.json b/types/material__dialog/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__dialog/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__dialog/util.d.ts b/types/material__dialog/util.d.ts new file mode 100644 index 0000000000..cfc7e3fda0 --- /dev/null +++ b/types/material__dialog/util.d.ts @@ -0,0 +1,19 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export type MDCFocusTrapFactory = (a: Element, b: {initialFocus: Element, clickOutsideDeactivates: boolean}) => any; + +export function createFocusTrapInstance(surfaceEl: Element, acceptButtonEl: Element, focusTrapFactory?: MDCFocusTrapFactory): any; diff --git a/types/material__drawer/index.d.ts b/types/material__drawer/index.d.ts new file mode 100644 index 0000000000..379ed35599 --- /dev/null +++ b/types/material__drawer/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import * as util from './util'; +export {MDCSlidableDrawerAdapter} from './slidable'; +export {MDCTemporaryDrawer, MDCTemporaryDrawerFoundation} from './temporary'; +export {MDCPersistentDrawer, MDCPersistentDrawerFoundation} from './persistent'; +export {util}; diff --git a/types/material__drawer/persistent/constants.d.ts b/types/material__drawer/persistent/constants.d.ts new file mode 100644 index 0000000000..3d5f7c56ba --- /dev/null +++ b/types/material__drawer/persistent/constants.d.ts @@ -0,0 +1,30 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-persistent-drawer'; + OPEN: 'mdc-persistent-drawer--open'; + ANIMATING: 'mdc-persistent-drawer--animating'; +} + +export interface strings extends MDCStrings { + DRAWER_SELECTOR: '.mdc-persistent-drawer__drawer'; + FOCUSABLE_ELEMENTS: 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]'; + OPEN_EVENT: 'MDCPersistentDrawer:open'; + CLOSE_EVENT: 'MDCPersistentDrawer:close'; +} diff --git a/types/material__drawer/persistent/foundation.d.ts b/types/material__drawer/persistent/foundation.d.ts new file mode 100644 index 0000000000..7d4d53f884 --- /dev/null +++ b/types/material__drawer/persistent/foundation.d.ts @@ -0,0 +1,28 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCSlidableDrawerAdapter, MDCSlidableDrawerFoundation } from '../slidable'; +import { cssClasses, strings } from './constants'; + +export class MDCPersistentDrawerFoundation extends MDCSlidableDrawerFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCSlidableDrawerAdapter; +} + +export default MDCPersistentDrawerFoundation; diff --git a/types/material__drawer/persistent/index.d.ts b/types/material__drawer/persistent/index.d.ts new file mode 100644 index 0000000000..1c2286fd01 --- /dev/null +++ b/types/material__drawer/persistent/index.d.ts @@ -0,0 +1,33 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; +import { MDCPersistentDrawerFoundation } from './foundation'; +import { MDCSlidableDrawerAdapter } from '../slidable'; +import * as util from '../util'; + +export {MDCSlidableDrawerAdapter, MDCPersistentDrawerFoundation, util}; + +export class MDCPersistentDrawer extends MDCComponent { + static attachTo(root: Element): MDCPersistentDrawer; + + open: boolean; + + // Return the drawer element inside the component. + readonly drawer: Element | null; + + getDefaultFoundation(): MDCPersistentDrawerFoundation; +} diff --git a/types/material__drawer/slidable/adapter.d.ts b/types/material__drawer/slidable/adapter.d.ts new file mode 100644 index 0000000000..3659742558 --- /dev/null +++ b/types/material__drawer/slidable/adapter.d.ts @@ -0,0 +1,59 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCSlidableDrawerAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + hasClass(className: string): void; + + hasNecessaryDom(): boolean; + + registerInteractionHandler(evt: string, handler: EventListener): void; + + deregisterInteractionHandler(evt: string, handler: EventListener): void; + + registerDrawerInteractionHandler(evt: string, handler: EventListener): void; + + deregisterDrawerInteractionHandler(evt: string, handler: EventListener): void; + + registerTransitionEndHandler(handler: EventListener): void; + + deregisterTransitionEndHandler(handler: EventListener): void; + + registerDocumentKeydownHandler(handler: EventListener): void; + + deregisterDocumentKeydownHandler(handler: EventListener): void; + + setTranslateX(value: number | null): void; + + getFocusableElements(): NodeList; + + saveElementTabState(el: Element): void; + + restoreElementTabState(el: Element): void; + + makeElementUntabbable(el: Element): void; + + notifyOpen(): void; + + notifyClose(): void; + + isRtl(): boolean; + + getDrawerWidth(): number; +} diff --git a/types/material__drawer/slidable/constants.d.ts b/types/material__drawer/slidable/constants.d.ts new file mode 100644 index 0000000000..bfae67fa90 --- /dev/null +++ b/types/material__drawer/slidable/constants.d.ts @@ -0,0 +1,17 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export const FOCUSABLE_ELEMENTS: string; diff --git a/types/material__drawer/slidable/foundation.d.ts b/types/material__drawer/slidable/foundation.d.ts new file mode 100644 index 0000000000..60995e0a95 --- /dev/null +++ b/types/material__drawer/slidable/foundation.d.ts @@ -0,0 +1,30 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCFoundation } from 'material__base'; +import { MDCSlidableDrawerAdapter } from './adapter'; + +export class MDCSlidableDrawerFoundation extends MDCFoundation { + static readonly defaultAdapter: MDCSlidableDrawerAdapter; + + constructor(adapter: MDCSlidableDrawerAdapter, rootCssClass: string, animatingCssClass: string, openCssClass: string); + + open(): void; + + close(): void; + + isOpen(): boolean; +} diff --git a/types/material__drawer/slidable/index.d.ts b/types/material__drawer/slidable/index.d.ts new file mode 100644 index 0000000000..b56661948d --- /dev/null +++ b/types/material__drawer/slidable/index.d.ts @@ -0,0 +1,19 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export {FOCUSABLE_ELEMENTS} from './constants'; +export {MDCSlidableDrawerFoundation} from './foundation'; +export {MDCSlidableDrawerAdapter} from './adapter'; diff --git a/types/material__drawer/temporary/constants.d.ts b/types/material__drawer/temporary/constants.d.ts new file mode 100644 index 0000000000..b175492a82 --- /dev/null +++ b/types/material__drawer/temporary/constants.d.ts @@ -0,0 +1,32 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-temporary-drawer'; + OPEN: 'mdc-temporary-drawer--open'; + ANIMATING: 'mdc-temporary-drawer--animating'; + SCROLL_LOCK: 'mdc-drawer-scroll-lock'; +} + +export interface strings extends MDCStrings { + DRAWER_SELECTOR: '.mdc-temporary-drawer__drawer'; + OPACITY_VAR_NAME: '--mdc-temporary-drawer-opacity'; + FOCUSABLE_ELEMENTS: 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]'; + OPEN_EVENT: 'MDCTemporaryDrawer:open'; + CLOSE_EVENT: 'MDCTemporaryDrawer:close'; +} diff --git a/types/material__drawer/temporary/foundation.d.ts b/types/material__drawer/temporary/foundation.d.ts new file mode 100644 index 0000000000..df1763c274 --- /dev/null +++ b/types/material__drawer/temporary/foundation.d.ts @@ -0,0 +1,32 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCSlidableDrawerFoundation, MDCSlidableDrawerAdapter } from '../slidable'; +import { cssClasses, strings } from './constants'; + +export class MDCTemporaryDrawerFoundation extends MDCSlidableDrawerFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCSlidableDrawerAdapter; + + open(): void; + + close(): void; +} + +export default MDCTemporaryDrawerFoundation; diff --git a/types/material__drawer/temporary/index.d.ts b/types/material__drawer/temporary/index.d.ts new file mode 100644 index 0000000000..4e27965e43 --- /dev/null +++ b/types/material__drawer/temporary/index.d.ts @@ -0,0 +1,33 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; +import MDCTemporaryDrawerFoundation from './foundation'; +import { MDCSlidableDrawerAdapter } from '../slidable'; +import * as util from '../util'; + +export {MDCSlidableDrawerAdapter, MDCTemporaryDrawerFoundation, util}; + +export class MDCTemporaryDrawer extends MDCComponent { + static attachTo(root: Element): MDCTemporaryDrawer; + + open: boolean; + + /* Return the drawer element inside the component. */ + readonly drawer: Element | null; + + getDefaultFoundation(): MDCTemporaryDrawerFoundation; +} diff --git a/types/material__drawer/tsconfig.json b/types/material__drawer/tsconfig.json new file mode 100644 index 0000000000..4a95cf90f8 --- /dev/null +++ b/types/material__drawer/tsconfig.json @@ -0,0 +1,36 @@ +{ + "files": [ + "persistent/constants.d.ts", + "persistent/index.d.ts", + "persistent/foundation.d.ts", + "slidable/constants.d.ts", + "slidable/adapter.d.ts", + "slidable/index.d.ts", + "slidable/foundation.d.ts", + "temporary/constants.d.ts", + "temporary/index.d.ts", + "temporary/foundation.d.ts", + "util.d.ts", + "index.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__drawer/tslint.json b/types/material__drawer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__drawer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__drawer/util.d.ts b/types/material__drawer/util.d.ts new file mode 100644 index 0000000000..66fa930b43 --- /dev/null +++ b/types/material__drawer/util.d.ts @@ -0,0 +1,33 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Remap touch events to pointer events, if the browser doesn't support touch events. +export function remapEvent(eventName: string, globalObj?: Window): string; + +// Choose the correct transform property to use on the current browser. +export function getTransformPropertyName(globalObj?: Window, forceRefresh?: boolean): string; + +// Determine whether the current browser supports CSS properties. +export function supportsCssCustomProperties(globalObj?: Window): boolean; + +// Determine whether the current browser supports passive event listeners, and if so, use them. +export function applyPassive(globalObj?: Window, forceRefresh?: boolean): boolean; + +// Save the tab state for an element. +export function saveElementTabState(el: Element): void; + +// Restore the tab state for an element, if it was saved. +export function restoreElementTabState(el: Element): void; diff --git a/types/material__form-field/adapter.d.ts b/types/material__form-field/adapter.d.ts new file mode 100644 index 0000000000..7033f363eb --- /dev/null +++ b/types/material__form-field/adapter.d.ts @@ -0,0 +1,43 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Adapter for MDC Form Field. Provides an interface for managing + * - event handlers + * - ripple activation + * + * Additionally, provides type information for the adapter to the Closure + * compiler. + * + * Implement this adapter for your framework of choice to delegate updates to + * the component in your framework of choice. See architecture documentation + * for more details. + * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md + * + * @record + */ +export class MDCFormFieldAdapter { + registerInteractionHandler(type: string, handler: EventListener): void; + + deregisterInteractionHandler(type: string, handler: EventListener): void; + + activateInputRipple(): void; + + deactivateInputRipple(): void; +} + +export default MDCFormFieldAdapter; diff --git a/types/material__form-field/constants.d.ts b/types/material__form-field/constants.d.ts new file mode 100644 index 0000000000..ba55acabcd --- /dev/null +++ b/types/material__form-field/constants.d.ts @@ -0,0 +1,26 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-form-field'; +} + +export interface strings extends MDCStrings { + LABEL_SELECTOR: '.mdc-form-field > label'; +} diff --git a/types/material__form-field/foundation.d.ts b/types/material__form-field/foundation.d.ts new file mode 100644 index 0000000000..026beedfc2 --- /dev/null +++ b/types/material__form-field/foundation.d.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import MDCFormFieldAdapter from './adapter'; +import { cssClasses, strings } from './constants'; + +export class MDCFormFieldFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCFormFieldAdapter; +} + +export default MDCFormFieldFoundation; diff --git a/types/material__form-field/index.d.ts b/types/material__form-field/index.d.ts new file mode 100644 index 0000000000..1fcc30b4c4 --- /dev/null +++ b/types/material__form-field/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import MDCFormFieldFoundation from './foundation'; +import MDCFormFieldAdapter from './adapter'; +import { MDCSelectionControl } from 'material__selection-control'; + +export {MDCFormFieldAdapter, MDCFormFieldFoundation}; + +export class MDCFormField extends MDCComponent { + static attachTo(root: Element): MDCFormField; + + input: MDCSelectionControl; + + getDefaultFoundation(): MDCFormFieldFoundation; +} diff --git a/types/material__form-field/tsconfig.json b/types/material__form-field/tsconfig.json new file mode 100644 index 0000000000..06c0ac3c43 --- /dev/null +++ b/types/material__form-field/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__form-field/tslint.json b/types/material__form-field/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__form-field/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__grid-list/adapter.d.ts b/types/material__grid-list/adapter.d.ts new file mode 100644 index 0000000000..1dcbcbf251 --- /dev/null +++ b/types/material__grid-list/adapter.d.ts @@ -0,0 +1,29 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCGridListAdapter { + getOffsetWidth(): number; + + getNumberOfTiles(): number; + + getOffsetWidthForTileAtIndex(index: number): number; + + setStyleForTilesElement(property: string, value: string): void; + + registerResizeHandler(handler: EventListener): void; + + deregisterResizeHandler(handler: EventListener): void; +} diff --git a/types/material__grid-list/constants.d.ts b/types/material__grid-list/constants.d.ts new file mode 100644 index 0000000000..22cf67bbfc --- /dev/null +++ b/types/material__grid-list/constants.d.ts @@ -0,0 +1,22 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface strings extends MDCStrings { + TILES_SELECTOR: '.mdc-grid-list__tiles'; + TILE_SELECTOR: '.mdc-grid-tile'; +} diff --git a/types/material__grid-list/foundation.d.ts b/types/material__grid-list/foundation.d.ts new file mode 100644 index 0000000000..04843273d6 --- /dev/null +++ b/types/material__grid-list/foundation.d.ts @@ -0,0 +1,29 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCFoundation } from 'material__base'; +import { strings } from './constants'; +import { MDCGridListAdapter } from './adapter'; + +export class MDCGridListFoundation extends MDCFoundation { + static readonly strings: strings; + + static readonly defaultAdapter: MDCGridListAdapter; + + alignCenter(): void; +} + +export default MDCGridListFoundation; diff --git a/types/material__grid-list/index.d.ts b/types/material__grid-list/index.d.ts new file mode 100644 index 0000000000..2a1e98d912 --- /dev/null +++ b/types/material__grid-list/index.d.ts @@ -0,0 +1,33 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; +import { MDCGridListAdapter } from './adapter'; +import MDCGridListFoundation from './foundation'; + +export {MDCGridListAdapter, MDCGridListFoundation}; + +export class MDCGridList extends MDCComponent { + static attachTo(root: Element): MDCGridList; + + getDefaultFoundation(): MDCGridListFoundation; +} diff --git a/types/material__grid-list/tsconfig.json b/types/material__grid-list/tsconfig.json new file mode 100644 index 0000000000..06c0ac3c43 --- /dev/null +++ b/types/material__grid-list/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__grid-list/tslint.json b/types/material__grid-list/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__grid-list/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__icon-toggle/adapter.d.ts b/types/material__icon-toggle/adapter.d.ts new file mode 100644 index 0000000000..52481fe732 --- /dev/null +++ b/types/material__icon-toggle/adapter.d.ts @@ -0,0 +1,63 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Adapter for MDC Icon Toggle. Provides an interface for managing + * - classes + * - dom + * - inner text + * - event handlers + * - event dispatch + * + * Additionally, provides type information for the adapter to the Closure + * compiler. + * + * Implement this adapter for your framework of choice to delegate updates to + * the component in your framework of choice. See architecture documentation + * for more details. + * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md + * + * @record + */ + +export class MDCIconToggleAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + registerInteractionHandler(type: string, handler: EventListener): void; + + deregisterInteractionHandler(type: string, handler: EventListener): void; + + setText(text: string): void; + + getTabIndex(): number; + + setTabIndex(tabIndex: number): void; + + getAttr(name: string): string; + + setAttr(name: string, value: string): void; + + rmAttr(name: string): void; + + notifyChange(evtData: IconToggleEvent): void; +} + +export interface IconToggleEvent { + isOn: boolean; +} diff --git a/types/material__icon-toggle/constants.d.ts b/types/material__icon-toggle/constants.d.ts new file mode 100644 index 0000000000..e7140ecefa --- /dev/null +++ b/types/material__icon-toggle/constants.d.ts @@ -0,0 +1,32 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-icon-toggle'; + DISABLED: 'mdc-icon-toggle--disabled'; +} + +export interface strings extends MDCStrings { + DATA_TOGGLE_ON: 'data-toggle-on'; + DATA_TOGGLE_OFF: 'data-toggle-off'; + ARIA_PRESSED: 'aria-pressed'; + ARIA_DISABLED: 'aria-disabled'; + ARIA_LABEL: 'aria-label'; + CHANGE_EVENT: 'MDCIconToggle:change'; +} diff --git a/types/material__icon-toggle/foundation.d.ts b/types/material__icon-toggle/foundation.d.ts new file mode 100644 index 0000000000..65d25c1307 --- /dev/null +++ b/types/material__icon-toggle/foundation.d.ts @@ -0,0 +1,64 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import { MDCIconToggleAdapter, IconToggleEvent } from './adapter'; +import { cssClasses, strings } from './constants'; + +export class MDCIconToggleFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCIconToggleAdapter; + + refreshToggleData(): void; + + isOn(): boolean; + + toggle(isOn?: boolean): void; + + isDisabled(): boolean; + + setDisabled(isDisabled: boolean): void; + + isKeyboardActivated(): boolean; +} + +export interface KeyboardKey { + key: string; + keyCode: number; +} + +export function isSpace(keyboardKey: KeyboardKey): boolean; + +export class IconToggleState { + /** + * The aria-label value of the icon toggle, or undefined if there is no aria-label. + */ + label: string|undefined; + /** + * The text for the icon toggle, or undefined if there is no text. + */ + content: string|undefined; + /** + * The CSS class to add to the icon toggle, or undefined if there is no CSS class. + */ + cssClass: string|undefined; +} + +export default MDCIconToggleFoundation; diff --git a/types/material__icon-toggle/index.d.ts b/types/material__icon-toggle/index.d.ts new file mode 100644 index 0000000000..bfced0b532 --- /dev/null +++ b/types/material__icon-toggle/index.d.ts @@ -0,0 +1,47 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import MDCIconToggleFoundation from './foundation'; +import { MDCIconToggleAdapter } from './adapter'; +import { MDCRipple, MDCRippleFoundation } from 'material__ripple'; + +export {MDCIconToggleAdapter, MDCIconToggleFoundation}; + +export class MDCIconToggle extends MDCComponent { + static attachTo(root: Element): MDCIconToggle; + + destroy(): void; + + getDefaultFoundation(): MDCIconToggleFoundation; + + initialSyncWithDOM(): void; + + readonly ripple: MDCRipple; + + on: boolean; + + disabled: boolean; + + refreshToggleData(): void; +} diff --git a/types/material__icon-toggle/tsconfig.json b/types/material__icon-toggle/tsconfig.json new file mode 100644 index 0000000000..06c0ac3c43 --- /dev/null +++ b/types/material__icon-toggle/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__icon-toggle/tslint.json b/types/material__icon-toggle/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__icon-toggle/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__linear-progress/adapter.d.ts b/types/material__linear-progress/adapter.d.ts new file mode 100644 index 0000000000..92afccc19d --- /dev/null +++ b/types/material__linear-progress/adapter.d.ts @@ -0,0 +1,29 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCLinearProgressAdapter { + addClass(className: string): void; + + getPrimaryBar(): Element; + + getBuffer(): Element; + + hasClass(className: string): boolean; + + removeClass(className: string): void; + + setStyle(el: Element, styleProperty: string, value: number): void; +} diff --git a/types/material__linear-progress/constants.d.ts b/types/material__linear-progress/constants.d.ts new file mode 100644 index 0000000000..af83ae9922 --- /dev/null +++ b/types/material__linear-progress/constants.d.ts @@ -0,0 +1,28 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + CLOSED_CLASS: 'mdc-linear-progress--closed'; + INDETERMINATE_CLASS: 'mdc-linear-progress--indeterminate'; + REVERSED_CLASS: 'mdc-linear-progress--reversed'; +} + +export interface strings extends MDCStrings { + PRIMARY_BAR_SELECTOR: '.mdc-linear-progress__primary-bar'; + BUFFER_SELECTOR: '.mdc-linear-progress__buffer'; +} diff --git a/types/material__linear-progress/foundation.d.ts b/types/material__linear-progress/foundation.d.ts new file mode 100644 index 0000000000..4abd553a09 --- /dev/null +++ b/types/material__linear-progress/foundation.d.ts @@ -0,0 +1,40 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCFoundation } from 'material__base'; +import { transformStyleProperties } from 'material__animation'; +import { MDCLinearProgressAdapter } from './adapter'; +import { cssClasses, strings } from './constants'; + +export class MDCLinearProgressFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCLinearProgressAdapter; + + setDeterminate(isDeterminate: boolean): void; + + setProgress(value: number): void; + + setBuffer(value: number): void; + + setReverse(isReversed: boolean): void; + + open(): void; + + close(): void; +} diff --git a/types/material__linear-progress/index.d.ts b/types/material__linear-progress/index.d.ts new file mode 100644 index 0000000000..765d8cb368 --- /dev/null +++ b/types/material__linear-progress/index.d.ts @@ -0,0 +1,45 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; +import { MDCLinearProgressAdapter } from './adapter'; +import { MDCLinearProgressFoundation } from './foundation'; + +export {MDCLinearProgressAdapter, MDCLinearProgressFoundation}; + +export class MDCLinearProgress extends MDCComponent { + static attachTo(root: Element): MDCLinearProgress; + + determinate: boolean; + + progress: number; + + buffer: number; + + reverse: boolean; + + open(): void; + + close(): void; + + getDefaultFoundation(): MDCLinearProgressFoundation; +} diff --git a/types/material__linear-progress/tsconfig.json b/types/material__linear-progress/tsconfig.json new file mode 100644 index 0000000000..06c0ac3c43 --- /dev/null +++ b/types/material__linear-progress/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__linear-progress/tslint.json b/types/material__linear-progress/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__linear-progress/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__menu/index.d.ts b/types/material__menu/index.d.ts new file mode 100644 index 0000000000..af9360d1a8 --- /dev/null +++ b/types/material__menu/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import * as util from './util'; +import { MDCSimpleMenu, MDCSimpleMenuAdapter, MDCSimpleMenuFoundation } from './simple/index'; +export { MDCSimpleMenu, MDCSimpleMenuAdapter, MDCSimpleMenuFoundation, util }; diff --git a/types/material__menu/simple/adapter.d.ts b/types/material__menu/simple/adapter.d.ts new file mode 100644 index 0000000000..7fdd1e4f3a --- /dev/null +++ b/types/material__menu/simple/adapter.d.ts @@ -0,0 +1,104 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Adapter for MDC Simple Menu. Provides an interface for managing + * - classes + * - dom + * - focus + * - position + * - dimensions + * - event handlers + * + * Additionally, provides type information for the adapter to the Closure + * compiler. + * + * Implement this adapter for your framework of choice to delegate updates to + * the component in your framework of choice. See architecture documentation + * for more details. + * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md + * + * @record + */ +export default class MDCSimpleMenuAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + hasClass(className: string): boolean; + + hasNecessaryDom(): boolean; + + getAttributeForEventTarget(target: EventTarget, attributeName: string): string; + + getInnerDimensions(): {width: number, height: number}; + + hasAnchor(): boolean; + + getAnchorDimensions(): {width: number, height: number, top: number, right: number, bottom: number, left: number}; + + getWindowDimensions(): {width: number, height: number}; + + setScale(x: number, y: number): void; + + setInnerScale(x: number, y: number): void; + + getNumberOfItems(): number; + + registerInteractionHandler(type: string, handler: EventListener): void; + + deregisterInteractionHandler(type: string, handler: EventListener): void; + + registerBodyClickHandler(handler: EventListener): void; + + deregisterBodyClickHandler(handler: EventListener): void; + + getYParamsForItemAtIndex(index: number): {top: number, height: number}; + + setTransitionDelayForItemAtIndex(index: number, value: string|null): void; + + getIndexForEventTarget(target: EventTarget): number; + + notifySelected(evtData: {index: number}): void; + + notifyCancel(): void; + + saveFocus(): void; + + restoreFocus(): void; + + isFocused(): boolean; + + focus(): void; + + getFocusedItemIndex(): number; + + focusItemAtIndex(index: number): void; + + isRtl(): boolean; + + setTransformOrigin(origin: string): void; + + setPosition(position: { + top: string|undefined, + right: string|undefined, + bottom: string|undefined, + left: string|undefined + }): void; + + getAccurateTime(): number; +} diff --git a/types/material__menu/simple/constants.d.ts b/types/material__menu/simple/constants.d.ts new file mode 100644 index 0000000000..58e2f16614 --- /dev/null +++ b/types/material__menu/simple/constants.d.ts @@ -0,0 +1,52 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings, MDCNumbers } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-simple-menu'; + OPEN: 'mdc-simple-menu--open'; + ANIMATING: 'mdc-simple-menu--animating'; + TOP_RIGHT: 'mdc-simple-menu--open-from-top-right'; + BOTTOM_LEFT: 'mdc-simple-menu--open-from-bottom-left'; + BOTTOM_RIGHT: 'mdc-simple-menu--open-from-bottom-right'; +} + +export interface strings extends MDCStrings { + ITEMS_SELECTOR: '.mdc-simple-menu__items'; + SELECTED_EVENT: 'MDCSimpleMenu:selected'; + CANCEL_EVENT: 'MDCSimpleMenu:cancel'; + ARIA_DISABLED_ATTR: 'aria-disabled'; +} + +export interface numbers extends MDCNumbers { + // Amount of time to wait before triggering a selected event on the menu. Note that this time + // will most likely be bumped up once interactive lists are supported to allow for the ripple to + // animate before closing the menu + SELECTED_TRIGGER_DELAY: 50; + // Total duration of the menu animation. + TRANSITION_DURATION_MS: 300; + // The menu starts its open animation with the X axis at this time value (0 - 1). + TRANSITION_SCALE_ADJUSTMENT_X: 0.5; + // The time value the menu waits until the animation starts on the Y axis (0 - 1). + TRANSITION_SCALE_ADJUSTMENT_Y: 0.2; + // The cubic bezier control points for the animation (cubic-bezier(0, 0, 0.2, 1)). + TRANSITION_X1: 0; + TRANSITION_Y1: 0; + TRANSITION_X2: 0.2; + TRANSITION_Y2: 1; +} diff --git a/types/material__menu/simple/foundation.d.ts b/types/material__menu/simple/foundation.d.ts new file mode 100644 index 0000000000..78071374b3 --- /dev/null +++ b/types/material__menu/simple/foundation.d.ts @@ -0,0 +1,43 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import MDCSimpleMenuAdapter from './adapter'; +import { cssClasses, strings, numbers } from './constants'; +import { clamp, bezierProgress } from '../util'; + +export default class MDCSimpleMenuFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly numbers: numbers; + + static readonly defaultAdapter: MDCSimpleMenuAdapter; + + /** + * Open the menu. + */ + open(options?: {focusIndex?: number}): void; + + /** + * Closes the menu. + */ + close(evt?: Event): void; + + isOpen(): boolean; +} diff --git a/types/material__menu/simple/index.d.ts b/types/material__menu/simple/index.d.ts new file mode 100644 index 0000000000..c2315810ba --- /dev/null +++ b/types/material__menu/simple/index.d.ts @@ -0,0 +1,42 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import MDCSimpleMenuFoundation from './foundation'; +import MDCSimpleMenuAdapter from './adapter'; +import { getTransformPropertyName } from '../util'; + +export {MDCSimpleMenuAdapter, MDCSimpleMenuFoundation}; + +export class MDCSimpleMenu extends MDCComponent { + static attachTo(root: Element): MDCSimpleMenu; + + open: boolean; + + show(options?: {focusIndex?: number}): void; + + hide(): void; + + /** + * Return the items within the menu. Note that this only contains the set of elements within + * the items container that are proper list items, and not supplemental / presentational DOM + * elements. + */ + readonly items: Element[]; + + getDefaultFoundation(): MDCSimpleMenuFoundation; +} diff --git a/types/material__menu/tsconfig.json b/types/material__menu/tsconfig.json new file mode 100644 index 0000000000..6eb7f942cc --- /dev/null +++ b/types/material__menu/tsconfig.json @@ -0,0 +1,30 @@ +{ + "files": [ + "simple/constants.d.ts", + "simple/adapter.d.ts", + "simple/index.d.ts", + "simple/foundation.d.ts", + "util.d.ts", + "index.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__menu/tslint.json b/types/material__menu/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__menu/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__menu/util.d.ts b/types/material__menu/util.d.ts new file mode 100644 index 0000000000..d5e02a37e2 --- /dev/null +++ b/types/material__menu/util.d.ts @@ -0,0 +1,37 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Returns the name of the correct transform property to use on the current browser. + */ +export function getTransformPropertyName(globalObj: Window, forceRefresh?: boolean): string|undefined; + +/** + * Clamps a value between the minimum and the maximum, returning the clamped value. + */ +export function clamp(value: number, min?: number, max?: number): number; + +/** + * Returns the easing value to apply at time t, for a given cubic bezier curve. + * Control points P0 and P3 are assumed to be (0,0) and (1,1), respectively. + * Parameters are as follows: + * - time: The current time in the animation, scaled between 0 and 1. + * - x1: The x value of control point P1. + * - y1: The y value of control point P1. + * - x2: The x value of control point P2. + * - y2: The y value of control point P2. + */ +export function bezierProgress(time: number, x1: number, y1: number, x2: number, y2: number): number; diff --git a/types/material__radio/adapter.d.ts b/types/material__radio/adapter.d.ts new file mode 100644 index 0000000000..91035ea177 --- /dev/null +++ b/types/material__radio/adapter.d.ts @@ -0,0 +1,40 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCSelectionControlState } from 'material__selection-control'; + +/** + * Adapter for MDC Radio. Provides an interface for managing + * - classes + * - dom + * + * Additionally, provides type information for the adapter to the Closure + * compiler. + * + * Implement this adapter for your framework of choice to delegate updates to + * the component in your framework of choice. See architecture documentation + * for more details. + * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md + */ +export class MDCRadioAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + getNativeControl(): MDCSelectionControlState; +} + +export default MDCRadioAdapter; diff --git a/types/material__radio/constants.d.ts b/types/material__radio/constants.d.ts new file mode 100644 index 0000000000..5c73f72faf --- /dev/null +++ b/types/material__radio/constants.d.ts @@ -0,0 +1,26 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface strings extends MDCStrings { + NATIVE_CONTROL_SELECTOR: '.mdc-radio__native-control'; +} + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-radio'; + DISABLED: 'mdc-radio--disabled'; +} diff --git a/types/material__radio/foundation.d.ts b/types/material__radio/foundation.d.ts new file mode 100644 index 0000000000..f27bd30f1b --- /dev/null +++ b/types/material__radio/foundation.d.ts @@ -0,0 +1,42 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import { MDCSelectionControlState } from 'material__selection-control'; +import MDCRadioAdapter from './adapter'; +import { cssClasses, strings } from './constants'; + +export class MDCRadioFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCRadioAdapter; + + isChecked(): boolean; + + setChecked(checked: boolean): void; + + isDisabled(): boolean; + + setDisabled(disabled: boolean): void; + + getValue(): string; + + setValue(value?: string): void; +} + +export default MDCRadioFoundation; diff --git a/types/material__radio/index.d.ts b/types/material__radio/index.d.ts new file mode 100644 index 0000000000..e9001d9d84 --- /dev/null +++ b/types/material__radio/index.d.ts @@ -0,0 +1,46 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import { MDCSelectionControl } from 'material__selection-control'; +import MDCRadioAdapter from './adapter'; +import MDCRadioFoundation from './foundation'; +import { MDCRipple, MDCRippleFoundation } from 'material__ripple'; + +export {MDCRadioAdapter, MDCRadioFoundation}; + +export class MDCRadio extends MDCComponent implements MDCSelectionControl { + static attachTo(root: Element): MDCRadio; + + checked: boolean; + + disabled: boolean; + + value: string; + + readonly ripple: MDCRipple; + + destroy(): void; + + getDefaultFoundation(): MDCRadioFoundation; +} diff --git a/types/material__radio/tsconfig.json b/types/material__radio/tsconfig.json new file mode 100644 index 0000000000..06c0ac3c43 --- /dev/null +++ b/types/material__radio/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__radio/tslint.json b/types/material__radio/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__radio/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__ripple/adapter.d.ts b/types/material__ripple/adapter.d.ts new file mode 100644 index 0000000000..0d2d319aab --- /dev/null +++ b/types/material__ripple/adapter.d.ts @@ -0,0 +1,65 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Adapter for MDC Ripple. Provides an interface for managing + * - classes + * - dom + * - CSS variables + * - position + * - dimensions + * - scroll position + * - event handlers + * - unbounded, active and disabled states + * + * Additionally, provides type information for the adapter to the Closure + * compiler. + * + * Implement this adapter for your framework of choice to delegate updates to + * the component in your framework of choice. See architecture documentation + * for more details. + * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md + * + * @record + */ +export default class MDCRippleAdapter { + browserSupportsCssVars(): boolean; + + isUnbounded(): boolean; + + isSurfaceActive(): boolean; + + isSurfaceDisabled(): boolean; + + addClass(className: string): void; + + removeClass(className: string): void; + + registerInteractionHandler(evtType: string, handler: EventListener): void; + + deregisterInteractionHandler(evtType: string, handler: EventListener): void; + + registerResizeHandler(handler: EventListener): void; + + deregisterResizeHandler(handler: EventListener): void; + + updateCssVariable(varName: string, value: number|string): void; + + computeBoundingRect(): ClientRect; + + getWindowPageOffset(): {x: number, y: number}; +} diff --git a/types/material__ripple/constants.d.ts b/types/material__ripple/constants.d.ts new file mode 100644 index 0000000000..285d5f3f2c --- /dev/null +++ b/types/material__ripple/constants.d.ts @@ -0,0 +1,46 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings, MDCNumbers } from 'material__base'; + +export interface cssClasses extends MDCStrings { + // Ripple is a special case where the "root" component is really a "mixin" of sorts, + // given that it's an 'upgrade' to an existing component. That being said it is the root + // CSS class that all other CSS classes derive from. + ROOT: 'mdc-ripple-upgraded'; + UNBOUNDED: 'mdc-ripple-upgraded--unbounded'; + BG_FOCUSED: 'mdc-ripple-upgraded--background-focused'; + BG_ACTIVE_FILL: 'mdc-ripple-upgraded--background-active-fill'; + FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation'; + FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation'; +} + +export interface strings extends MDCStrings { + VAR_FG_SIZE: '--mdc-ripple-fg-size'; + VAR_LEFT: '--mdc-ripple-left'; + VAR_TOP: '--mdc-ripple-top'; + VAR_FG_SCALE: '--mdc-ripple-fg-scale'; + VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start'; + VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end'; +} + +export interface numbers extends MDCNumbers { + PADDING: 10; + INITIAL_ORIGIN_SCALE: 0.6; + DEACTIVATION_TIMEOUT_MS: 300; + FG_DEACTIVATION_MS: 83; +} diff --git a/types/material__ripple/foundation.d.ts b/types/material__ripple/foundation.d.ts new file mode 100644 index 0000000000..b67632e441 --- /dev/null +++ b/types/material__ripple/foundation.d.ts @@ -0,0 +1,69 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import MDCRippleAdapter from './adapter'; +import { cssClasses, strings, numbers } from './constants'; +import { getNormalizedEventCoords } from './util'; + +export interface ActivationStateType { + isActivated: boolean|undefined; + hasDeactivationUXRun: boolean|undefined; + wasActivatedByPointer: boolean|undefined; + wasElementMadeActive: boolean|undefined; + activationStartTime: number|undefined; + activationEvent: Event; + isProgrammatic: boolean|undefined; +} + +export interface ListenerInfoType { + activate: string|undefined; + deactivate: string|undefined; + focus: string|undefined; + blur: string|undefined; +} + +export interface ListenersType { + activate(e: Event): void; + + deactivate(e: Event): void; + + focus(): void; + + blur(): void; +} + +export interface PointType { + x: number; + y: number; +} + +export default class MDCRippleFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly numbers: numbers; + + static readonly defaultAdapter: MDCRippleAdapter; + + activate(event?: Event): void; + + deactivate(event?: Event): void; + + layout(): void; +} diff --git a/types/material__ripple/index.d.ts b/types/material__ripple/index.d.ts new file mode 100644 index 0000000000..2f8379ac84 --- /dev/null +++ b/types/material__ripple/index.d.ts @@ -0,0 +1,66 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import MDCRippleAdapter from './adapter'; +import MDCRippleFoundation from './foundation'; +import * as util from './util'; + +export {MDCRippleAdapter, MDCRippleFoundation, util}; + +export class MDCRipple extends MDCComponent { + static attachTo(root: Element, bound?: {isUnbounded: boolean|undefined}): MDCRipple; + + static createAdapter(instance: RippleCapableSurface): MDCRippleAdapter; + + unbounded: boolean; + + activate(): void; + + deactivate(): void; + + layout(): void; + + getDefaultFoundation(): MDCRippleFoundation; + + initialSyncWithDOM(): void; +} + +/** + * See Material Design spec for more details on when to use ripples. + * https://material.io/guidelines/motion/choreography.html#choreography-creation + * @record + */ +export class RippleCapableSurface { + protected root_: Element; + + /** + * Whether or not the ripple bleeds out of the bounds of the element. + */ + unbounded: boolean|undefined; + + /** + * Whether or not the ripple is attached to a disabled component. + */ + disabled: boolean|undefined; +} diff --git a/types/material__ripple/tsconfig.json b/types/material__ripple/tsconfig.json new file mode 100644 index 0000000000..9f215e4ee0 --- /dev/null +++ b/types/material__ripple/tsconfig.json @@ -0,0 +1,29 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "util.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__ripple/tslint.json b/types/material__ripple/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__ripple/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__ripple/util.d.ts b/types/material__ripple/util.d.ts new file mode 100644 index 0000000000..ed684eca8f --- /dev/null +++ b/types/material__ripple/util.d.ts @@ -0,0 +1,27 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export function supportsCssVariables(windowObj: Window, forceRefresh?: boolean): boolean|undefined; + +/** + * Determine whether the current browser supports passive event listeners, and if so, use them. + */ +export function applyPassive(globalObj?: Window, forceRefresh?: boolean): boolean|{passive: boolean}; + +export function getMatchesProperty(HTMLElementPrototype: object): string[]; + +export function getNormalizedEventCoords(ev: Event, pageOffset: {x: number, y: number}, clientRect: ClientRect): {x: number, y: number}; diff --git a/types/material__select/adapter.d.ts b/types/material__select/adapter.d.ts new file mode 100644 index 0000000000..2828b77361 --- /dev/null +++ b/types/material__select/adapter.d.ts @@ -0,0 +1,81 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCSelectAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + addBodyClass(className: string): void; + + removeBodyClass(className: string): void; + + setAttr(attr: string, value: string): void; + + rmAttr(attr: string): void; + + computeBoundingRect(): {left: number, top: number}; + + registerInteractionHandler(type: string, handler: EventListener): void; + + deregisterInteractionHandler(type: string, handler: EventListener): void; + + focus(): void; + + makeTabbable(): void; + + makeUntabbable(): void; + + getComputedStyleValue(propertyName: string): string; + + setStyle(propertyName: string, value: string): void; + + create2dRenderingContext(): {font: string, measureText: (val: string) => {width: number}}; + + setMenuElStyle(propertyName: string, value: string): void; + + setMenuElAttr(attr: string, value: string): void; + + rmMenuElAttr(attr: string): void; + + getMenuElOffsetHeight(): number; + + openMenu(focusIndex: number): void; + + isMenuOpen(): boolean; + + setSelectedTextContent(textContent: string): void; + + getNumberOfOptions(): number; + + getTextForOptionAtIndex(index: number): string; + + getValueForOptionAtIndex(index: number): string; + + setAttrForOptionAtIndex(index: number, attr: string, value: string): void; + + rmAttrForOptionAtIndex(index: number, attr: string): void; + + getOffsetTopForOptionAtIndex(index: number): number; + + registerMenuInteractionHandler(type: string, handler: EventListener): void; + + deregisterMenuInteractionHandler(type: string, handler: EventListener): void; + + notifyChange(): void; + + getWindowInnerHeight(): number; +} diff --git a/types/material__select/constants.d.ts b/types/material__select/constants.d.ts new file mode 100644 index 0000000000..1566d71322 --- /dev/null +++ b/types/material__select/constants.d.ts @@ -0,0 +1,28 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-select'; + OPEN: 'mdc-select--open'; + DISABLED: 'mdc-select--disabled'; + SCROLL_LOCK: 'mdc-select-scroll-lock'; +} + +export interface strings extends MDCStrings { + CHANGE_EVENT: 'MDCSelect:change'; +} diff --git a/types/material__select/foundation.d.ts b/types/material__select/foundation.d.ts new file mode 100644 index 0000000000..6f66f79b5f --- /dev/null +++ b/types/material__select/foundation.d.ts @@ -0,0 +1,40 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCFoundation } from 'material__base'; +import { cssClasses, strings } from './constants'; +import { MDCSimpleMenuFoundation } from 'material__menu'; +import { MDCSelectAdapter } from './adapter'; + +export default class MDCSelectFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCSelectAdapter; + + getValue(): string; + + getSelectedIndex(): number; + + setSelectedIndex(index: number): void; + + isDisabled(): boolean; + + setDisabled(disabled: boolean): void; + + resize(): void; +} diff --git a/types/material__select/index.d.ts b/types/material__select/index.d.ts new file mode 100644 index 0000000000..78746a97d1 --- /dev/null +++ b/types/material__select/index.d.ts @@ -0,0 +1,53 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; +import { MDCSimpleMenu } from 'material__menu'; + +import { MDCSelectAdapter } from './adapter'; +import MDCSelectFoundation from './foundation'; + +export {MDCSelectAdapter, MDCSelectFoundation}; + +export class MDCSelect extends MDCComponent { + static attachTo(root: Element): MDCSelect; + + readonly value: string; + + readonly options: Element[]; + + readonly selectedOptions: NodeListOf; + + selectedIndex: number; + + disabled: boolean; + + item(index: number): Element|null; + + nameditem(key: string): Element|null; + + initialize(menuFactory?: (el: Element) => MDCSimpleMenu): void; + + getDefaultFoundation(): MDCSelectFoundation; + + initialSyncWithDOM(): void; +} diff --git a/types/material__select/tsconfig.json b/types/material__select/tsconfig.json new file mode 100644 index 0000000000..06c0ac3c43 --- /dev/null +++ b/types/material__select/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__select/tslint.json b/types/material__select/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__select/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__selection-control/index.d.ts b/types/material__selection-control/index.d.ts new file mode 100644 index 0000000000..9c7f90c3fd --- /dev/null +++ b/types/material__selection-control/index.d.ts @@ -0,0 +1,35 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCRipple } from 'material__ripple'; + +export interface MDCSelectionControlState { + checked: boolean; + indeterminate: boolean; + disabled: boolean; + value?: string; +} + +export class MDCSelectionControl { + readonly ripple: MDCRipple; +} diff --git a/types/material__selection-control/tsconfig.json b/types/material__selection-control/tsconfig.json new file mode 100644 index 0000000000..0cbce49fc7 --- /dev/null +++ b/types/material__selection-control/tsconfig.json @@ -0,0 +1,25 @@ +{ + "files": [ + "index.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__selection-control/tslint.json b/types/material__selection-control/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__selection-control/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__slider/adapter.d.ts b/types/material__slider/adapter.d.ts new file mode 100644 index 0000000000..940ae04d76 --- /dev/null +++ b/types/material__slider/adapter.d.ts @@ -0,0 +1,67 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCSliderAdapter { + hasClass(className: string): boolean; + + addClass(className: string): void; + + removeClass(className: string): void; + + getAttribute(name: string): string|null; + + setAttribute(name: string, value: string): void; + + removeAttribute(name: string): void; + + computeBoundingRect(): ClientRect; + + getTabIndex(): number; + + registerInteractionHandler(type: string, handler: EventListener): void; + + deregisterInteractionHandler(type: string, handler: EventListener): void; + + registerThumbContainerInteractionHandler(type: string, handler: EventListener): void; + + deregisterThumbContainerInteractionHandler(type: string, handler: EventListener): void; + + registerBodyInteractionHandler(type: string, handler: EventListener): void; + + deregisterBodyInteractionHandler(type: string, handler: EventListener): void; + + registerResizeHandler(handler: EventListener): void; + + deregisterResizeHandler(handler: EventListener): void; + + notifyInput(): void; + + notifyChange(): void; + + setThumbContainerStyleProperty(propertyName: string, value: string): void; + + setTrackStyleProperty(propertyName: string, value: string): void; + + setMarkerValue(value: number): void; + + appendTrackMarkers(numMarkers: number): void; + + removeTrackMarkers(): void; + + setLastTrackMarkersStyleProperty(propertyName: string, value: string): void; + + isRTL(): boolean; +} diff --git a/types/material__slider/constants.d.ts b/types/material__slider/constants.d.ts new file mode 100644 index 0000000000..444eb38f91 --- /dev/null +++ b/types/material__slider/constants.d.ts @@ -0,0 +1,46 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings, MDCNumbers } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ACTIVE: 'mdc-slider--active'; + DISABLED: 'mdc-slider--disabled'; + DISCRETE: 'mdc-slider--discrete'; + FOCUS: 'mdc-slider--focus'; + IN_TRANSIT: 'mdc-slider--in-transit'; + IS_DISCRETE: 'mdc-slider--discrete'; + HAS_TRACK_MARKER: 'mdc-slider--display-markers'; +} + +export interface strings extends MDCStrings { + TRACK_SELECTOR: '.mdc-slider__track'; + TRACK_MARKER_CONTAINER_SELECTOR: '.mdc-slider__track-marker-container'; + LAST_TRACK_MARKER_SELECTOR: '.mdc-slider__track-marker:last-child'; + THUMB_CONTAINER_SELECTOR: '.mdc-slider__thumb-container'; + PIN_VALUE_MARKER_SELECTOR: '.mdc-slider__pin-value-marker'; + ARIA_VALUEMIN: 'aria-valuemin'; + ARIA_VALUEMAX: 'aria-valuemax'; + ARIA_VALUENOW: 'aria-valuenow'; + ARIA_DISABLED: 'aria-disabled'; + STEP_DATA_ATTR: 'data-step'; + CHANGE_EVENT: 'MDCSlider:change'; + INPUT_EVENT: 'MDCSlider:input'; +} + +export interface numbers extends MDCNumbers { + PAGE_FACTOR: 4; +} diff --git a/types/material__slider/foundation.d.ts b/types/material__slider/foundation.d.ts new file mode 100644 index 0000000000..5da6942f49 --- /dev/null +++ b/types/material__slider/foundation.d.ts @@ -0,0 +1,55 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { cssClasses, strings, numbers } from './constants'; + +import { getCorrectEventName, getCorrectPropertyName } from 'material__animation'; +import MDCFoundation from 'material__base/foundation'; +import { MDCSliderAdapter } from './adapter'; + +export default class MDCSliderFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly numbers: numbers; + + static readonly defaultAdapter: MDCSliderAdapter; + + setupTrackMarker(): void; + + layout(): void; + + getValue(): number; + + setValue(value: number): void; + + getMax(): number; + + setMax(max: number): void; + + getMin(): number; + + setMin(min: number): void; + + getStep(): number; + + setStep(step: number): void; + + isDisabled(): boolean; + + setDisabled(disabled: boolean): void; +} diff --git a/types/material__slider/index.d.ts b/types/material__slider/index.d.ts new file mode 100644 index 0000000000..0d0e472775 --- /dev/null +++ b/types/material__slider/index.d.ts @@ -0,0 +1,54 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; + +import MDCSliderFoundation from './foundation'; +import { MDCSliderAdapter } from './adapter'; + +export {MDCSliderAdapter, MDCSliderFoundation}; + +export class MDCSlider extends MDCComponent { + static attachTo(root: Element): MDCSlider; + + value: number; + + min: number; + + max: number; + + step: number; + + disabled: boolean; + + initialize(): void; + + getDefaultFoundation(): MDCSliderFoundation; + + initialSyncWithDOM(): void; + + layout(): void; + + stepUp(amount?: number): void; + + stepDown(amount?: number): void; +} diff --git a/types/material__slider/tsconfig.json b/types/material__slider/tsconfig.json new file mode 100644 index 0000000000..06c0ac3c43 --- /dev/null +++ b/types/material__slider/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__slider/tslint.json b/types/material__slider/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__slider/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__snackbar/adapter.d.ts b/types/material__snackbar/adapter.d.ts new file mode 100644 index 0000000000..412329bd97 --- /dev/null +++ b/types/material__snackbar/adapter.d.ts @@ -0,0 +1,38 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCSnackbarAdapter { + addClass(className: string): void; + removeClass(className: string): void; + setAriaHidden(): void; + unsetAriaHidden(): void; + setActionAriaHidden(): void; + unsetActionAriaHidden(): void; + setActionText(actionText: string): void; + setMessageText(message: string): void; + setFocus(): void; + visibilityIsHidden(): boolean; + registerCapturedBlurHandler(handler: EventListener): void; + deregisterCapturedBlurHandler(handler: EventListener): void; + registerVisibilityChangeHandler(handler: EventListener): void; + deregisterVisibilityChangeHandler(handler: EventListener): void; + registerCapturedInteractionHandler(evtType: string, handler: EventListener): void; + deregisterCapturedInteractionHandler(evtType: string, handler: EventListener): void; + registerActionClickHandler(handler: EventListener): void; + deregisterActionClickHandler(handler: EventListener): void; + registerTransitionEndHandler(handler: EventListener): void; + deregisterTransitionEndHandler(handler: EventListener): void; +} diff --git a/types/material__snackbar/constants.d.ts b/types/material__snackbar/constants.d.ts new file mode 100644 index 0000000000..7bf6758a0a --- /dev/null +++ b/types/material__snackbar/constants.d.ts @@ -0,0 +1,37 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings, MDCNumbers } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-snackbar'; + TEXT: 'mdc-snackbar__text'; + ACTION_WRAPPER: 'mdc-snackbar__action-wrapper'; + ACTION_BUTTON: 'mdc-snackbar__action-button'; + ACTIVE: 'mdc-snackbar--active'; + MULTILINE: 'mdc-snackbar--multiline'; + ACTION_ON_BOTTOM: 'mdc-snackbar--action-on-bottom'; +} + +export interface strings extends MDCStrings { + TEXT_SELECTOR: '.mdc-snackbar__text'; + ACTION_WRAPPER_SELECTOR: '.mdc-snackbar__action-wrapper'; + ACTION_BUTTON_SELECTOR: '.mdc-snackbar__action-button'; +} + +export interface numbers extends MDCNumbers { + MESSAGE_TIMEOUT: 2750; +} diff --git a/types/material__snackbar/foundation.d.ts b/types/material__snackbar/foundation.d.ts new file mode 100644 index 0000000000..5c85ab5f85 --- /dev/null +++ b/types/material__snackbar/foundation.d.ts @@ -0,0 +1,44 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCFoundation } from 'material__base'; +import { cssClasses, strings, numbers } from './constants'; +import { MDCSnackbarAdapter } from './adapter'; + +export interface MDCSnackbarData { + message: string; + actionHandler: EventListener; + actionText: string; + multiline?: boolean; + actionOnBottom?: boolean; + timeout?: number; +} + +export class MDCSnackbarFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCSnackbarAdapter; + + readonly active: boolean; + + dismissesOnAction(): boolean; + + setDismissOnAction(dismissOnAction: boolean): void; + + show(data: MDCSnackbarData): void; +} diff --git a/types/material__snackbar/index.d.ts b/types/material__snackbar/index.d.ts new file mode 100644 index 0000000000..11ac69f573 --- /dev/null +++ b/types/material__snackbar/index.d.ts @@ -0,0 +1,38 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; +import { MDCSnackbarAdapter } from './adapter'; +import { MDCSnackbarFoundation, MDCSnackbarData } from './foundation'; +import { getCorrectEventName } from 'material__animation'; + +export {MDCSnackbarAdapter, MDCSnackbarFoundation}; + +export class MDCSnackbar extends MDCComponent { + static attachTo(root: Element): MDCSnackbar; + + show(data: MDCSnackbarData): void; + + getDefaultFoundation(): MDCSnackbarFoundation; + + dismissesOnAction: boolean; +} diff --git a/types/material__snackbar/tsconfig.json b/types/material__snackbar/tsconfig.json new file mode 100644 index 0000000000..06c0ac3c43 --- /dev/null +++ b/types/material__snackbar/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__snackbar/tslint.json b/types/material__snackbar/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__snackbar/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__tabs/index.d.ts b/types/material__tabs/index.d.ts new file mode 100644 index 0000000000..b268e55a8d --- /dev/null +++ b/types/material__tabs/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export {MDCTabFoundation, MDCTab} from './tab/index'; +export {MDCTabBarAdapter, MDCTabBarFoundation, MDCTabBar} from './tab-bar/index'; +export {MDCTabBarScrollerAdapter, MDCTabBarScrollerFoundation, MDCTabBarScroller} from './tab-bar-scroller/index'; diff --git a/types/material__tabs/tab-bar-scroller/adapter.d.ts b/types/material__tabs/tab-bar-scroller/adapter.d.ts new file mode 100644 index 0000000000..8c1286fc74 --- /dev/null +++ b/types/material__tabs/tab-bar-scroller/adapter.d.ts @@ -0,0 +1,69 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCTabBarScrollerAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + eventTargetHasClass(target: EventTarget, className: string): boolean; + + addClassToForwardIndicator(className: string): void; + + removeClassFromForwardIndicator(className: string): void; + + addClassToBackIndicator(className: string): void; + + removeClassFromBackIndicator(className: string): void; + + isRTL(): boolean; + + registerBackIndicatorClickHandler(handler: EventListener): void; + + deregisterBackIndicatorClickHandler(handler: EventListener): void; + + registerForwardIndicatorClickHandler(handler: EventListener): void; + + deregisterForwardIndicatorClickHandler(handler: EventListener): void; + + registerCapturedInteractionHandler(evt: string, handler: EventListener): void; + + deregisterCapturedInteractionHandler(evt: string, handler: EventListener): void; + + registerWindowResizeHandler(handler: EventListener): void; + + deregisterWindowResizeHandler(handler: EventListener): void; + + getNumberOfTabs(): number; + + getComputedWidthForTabAtIndex(): number; + + getComputedLeftForTabAtIndex(): number; + + getOffsetWidthForScrollFrame(): number; + + getScrollLeftForScrollFrame(): number; + + setScrollLeftForScrollFrame(scrollLeftAmount: number): void; + + getOffsetWidthForTabBar(): number; + + setTransformStyleForTabBar(value: string): void; + + getOffsetLeftForEventTarget(target: EventTarget): number; + + getOffsetWidthForEventTarget(target: EventTarget): number; +} diff --git a/types/material__tabs/tab-bar-scroller/constants.d.ts b/types/material__tabs/tab-bar-scroller/constants.d.ts new file mode 100644 index 0000000000..b78ac1b937 --- /dev/null +++ b/types/material__tabs/tab-bar-scroller/constants.d.ts @@ -0,0 +1,32 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + INDICATOR_FORWARD: 'mdc-tab-bar-scroller__indicator--forward'; + INDICATOR_BACK: 'mdc-tab-bar-scroller__indicator--back'; + INDICATOR_ENABLED: 'mdc-tab-bar-scroller__indicator--enabled'; + TAB: 'mdc-tab'; +} + +export interface strings extends MDCStrings { + FRAME_SELECTOR: '.mdc-tab-bar-scroller__scroll-frame'; + TABS_SELECTOR: '.mdc-tab-bar-scroller__scroll-frame__tabs'; + TAB_SELECTOR: '.mdc-tab'; + INDICATOR_FORWARD_SELECTOR: '.mdc-tab-bar-scroller__indicator--forward'; + INDICATOR_BACK_SELECTOR: '.mdc-tab-bar-scroller__indicator--back'; +} diff --git a/types/material__tabs/tab-bar-scroller/foundation.d.ts b/types/material__tabs/tab-bar-scroller/foundation.d.ts new file mode 100644 index 0000000000..ed470c20d2 --- /dev/null +++ b/types/material__tabs/tab-bar-scroller/foundation.d.ts @@ -0,0 +1,36 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; + +import { cssClasses, strings } from './constants'; +import { MDCTabBarScrollerAdapter } from './adapter'; + +export default class MDCTabBarScrollerFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCTabBarScrollerAdapter; + + scrollBack(evt?: Event): void; + + scrollForward(evt?: Event): void; + + layout(): void; + + scrollToTabAtIndex(index: number): void; +} diff --git a/types/material__tabs/tab-bar-scroller/index.d.ts b/types/material__tabs/tab-bar-scroller/index.d.ts new file mode 100644 index 0000000000..a9d71b305c --- /dev/null +++ b/types/material__tabs/tab-bar-scroller/index.d.ts @@ -0,0 +1,36 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { getCorrectPropertyName } from 'material__animation'; +import MDCComponent from 'material__base/component'; + +import { MDCTabBar } from '../tab-bar/index'; +import MDCTabBarScrollerFoundation from './foundation'; +import { MDCTabBarScrollerAdapter } from './adapter'; + +export {MDCTabBarScrollerAdapter, MDCTabBarScrollerFoundation}; + +export class MDCTabBarScroller extends MDCComponent { + static attachTo(root: Element): MDCTabBarScroller; + + readonly tabBar: MDCTabBar; + + initialize(tabBarFactory?: (el: Element) => MDCTabBar): void; + + getDefaultFoundation(): MDCTabBarScrollerFoundation; + + layout(): void; +} diff --git a/types/material__tabs/tab-bar/adapter.d.ts b/types/material__tabs/tab-bar/adapter.d.ts new file mode 100644 index 0000000000..1efa73f52c --- /dev/null +++ b/types/material__tabs/tab-bar/adapter.d.ts @@ -0,0 +1,53 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCTabBarAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + bindOnMDCTabSelectedEvent(): void; + + unbindOnMDCTabSelectedEvent(): void; + + registerResizeHandler(handler: EventListener): void; + + deregisterResizeHandler(handler: EventListener): void; + + getOffsetWidth(): number; + + setStyleForIndicator(propertyName: string, value: string): void; + + getOffsetWidthForIndicator(): number; + + notifyChange(evtData: {activeTabIndex: number}): void; + + getNumberOfTabs(): number; + + isTabActiveAtIndex(index: number): boolean; + + setTabActiveAtIndex(index: number, isActive: true): void; + + isDefaultPreventedOnClickForTabAtIndex(index: number): boolean; + + setPreventDefaultOnClickForTabAtIndex(index: number, preventDefaultOnClick: boolean): void; + + measureTabAtIndex(index: number): void; + + getComputedWidthForTabAtIndex(index: number): number; + + getComputedLeftForTabAtIndex(index: number): number; +} diff --git a/types/material__tabs/tab-bar/constants.d.ts b/types/material__tabs/tab-bar/constants.d.ts new file mode 100644 index 0000000000..21120fb1e9 --- /dev/null +++ b/types/material__tabs/tab-bar/constants.d.ts @@ -0,0 +1,27 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + UPGRADED: 'mdc-tab-bar-upgraded'; +} + +export interface strings extends MDCStrings { + TAB_SELECTOR: '.mdc-tab'; + INDICATOR_SELECTOR: '.mdc-tab-bar__indicator'; + CHANGE_EVENT: 'MDCTabBar:change'; +} diff --git a/types/material__tabs/tab-bar/foundation.d.ts b/types/material__tabs/tab-bar/foundation.d.ts new file mode 100644 index 0000000000..2e5ccb1de2 --- /dev/null +++ b/types/material__tabs/tab-bar/foundation.d.ts @@ -0,0 +1,35 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import { getCorrectPropertyName } from 'material__animation'; + +import { cssClasses, strings } from './constants'; +import { MDCTabBarAdapter } from './adapter'; + +export default class MDCTabBarFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCTabBarAdapter; + + layout(): void; + + switchToTabAtIndex(index: number, shouldNotify: boolean): void; + + getActiveTabIndex(): number; +} diff --git a/types/material__tabs/tab-bar/index.d.ts b/types/material__tabs/tab-bar/index.d.ts new file mode 100644 index 0000000000..127a62217f --- /dev/null +++ b/types/material__tabs/tab-bar/index.d.ts @@ -0,0 +1,39 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; + +import { MDCTab, MDCTabFoundation } from '../tab/index'; +import MDCTabBarFoundation from './foundation'; +import { MDCTabBarAdapter } from './adapter'; + +export {MDCTabBarAdapter, MDCTabBarFoundation}; + +export class MDCTabBar extends MDCComponent { + static attachTo(root: Element): MDCTabBar; + + readonly tabs: MDCTab[]; + + activeTab: MDCTab; + + activeTabIndex: number; + + initialize(tabFactory?: (el: Element) => MDCTab): void; + + getDefaultFoundation(): MDCTabBarFoundation; + + layout(): void; +} diff --git a/types/material__tabs/tab/adapter.d.ts b/types/material__tabs/tab/adapter.d.ts new file mode 100644 index 0000000000..bc07aa5aa7 --- /dev/null +++ b/types/material__tabs/tab/adapter.d.ts @@ -0,0 +1,31 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCTabAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + registerInteractionHandler(type: string, handler: EventListener): void; + + deregisterInteractionHandler(type: string, handler: EventListener): void; + + getOffsetWidth(): number; + + getOffsetLeft(): number; + + notifySelected(): void; +} diff --git a/types/material__tabs/tab/constants.d.ts b/types/material__tabs/tab/constants.d.ts new file mode 100644 index 0000000000..1023f253db --- /dev/null +++ b/types/material__tabs/tab/constants.d.ts @@ -0,0 +1,25 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ACTIVE: 'mdc-tab--active'; +} + +export interface strings extends MDCStrings { + SELECTED_EVENT: 'MDCTab:selected'; +} diff --git a/types/material__tabs/tab/foundation.d.ts b/types/material__tabs/tab/foundation.d.ts new file mode 100644 index 0000000000..46e14065c8 --- /dev/null +++ b/types/material__tabs/tab/foundation.d.ts @@ -0,0 +1,41 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import { cssClasses, strings } from './constants'; +import { MDCTabAdapter } from './adapter'; + +export class MDCTabFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCTabAdapter; + + getComputedWidth(): number; + + getComputedLeft(): number; + + isActive(): boolean; + + setActive(isActive: boolean): void; + + preventsDefaultOnClick(): boolean; + + setPreventDefaultOnClick(preventDefaultOnClick: boolean): void; + + measureSelf(): void; +} diff --git a/types/material__tabs/tab/index.d.ts b/types/material__tabs/tab/index.d.ts new file mode 100644 index 0000000000..bf41b77e65 --- /dev/null +++ b/types/material__tabs/tab/index.d.ts @@ -0,0 +1,44 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import { MDCRipple } from 'material__ripple'; + +import { MDCTabAdapter } from './adapter'; +import { cssClasses } from './constants'; +import { MDCTabFoundation } from './foundation'; + +export {MDCTabAdapter, MDCTabFoundation}; + +export class MDCTab extends MDCComponent { + static attachTo(root: Element): MDCTab; + + readonly computedWidth: number; + + readonly computedLeft: number; + + isActive: boolean; + + preventDefaultOnClick: boolean; + + destroy(): void; + + getDefaultFoundation(): MDCTabFoundation; + + initialSyncWithDOM(): void; + + measureSelf(): void; +} diff --git a/types/material__tabs/tsconfig.json b/types/material__tabs/tsconfig.json new file mode 100644 index 0000000000..69e44f2eef --- /dev/null +++ b/types/material__tabs/tsconfig.json @@ -0,0 +1,37 @@ +{ + "files": [ + "tab-bar/constants.d.ts", + "tab-bar/adapter.d.ts", + "tab-bar/index.d.ts", + "tab-bar/foundation.d.ts", + "tab/constants.d.ts", + "tab/adapter.d.ts", + "tab/index.d.ts", + "tab/foundation.d.ts", + "index.d.ts", + "tab-bar-scroller/constants.d.ts", + "tab-bar-scroller/adapter.d.ts", + "tab-bar-scroller/index.d.ts", + "tab-bar-scroller/foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__tabs/tslint.json b/types/material__tabs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__tabs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__textfield/adapter.d.ts b/types/material__textfield/adapter.d.ts new file mode 100644 index 0000000000..ca13544c26 --- /dev/null +++ b/types/material__textfield/adapter.d.ts @@ -0,0 +1,161 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCTextFieldBottomLineFoundation from './bottom-line/foundation'; +import MDCTextFieldHelperTextFoundation from './helper-text/foundation'; + +export interface NativeInputType { + value: string; + disabled: boolean; + badInput: boolean; + checkValidity(): boolean; +} + +/** + * Adapter for MDC Text Field. + * + * Defines the shape of the adapter expected by the foundation. Implement this + * adapter to integrate the Text Field into your framework. See + * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md + * for more information. + * + * @record + */ +export class MDCTextFieldAdapter { + /** + * Adds a class to the root Element. + */ + addClass(className: string): void; + + /** + * Removes a class from the root Element. + */ + removeClass(className: string): void; + + /** + * Adds a class to the label Element. We recommend you add a conditional + * check here, and in removeClassFromLabel for whether or not the label is + * present so that the JS component could be used with text fields that don't + * require a label, such as the full-width text field. + */ + addClassToLabel(className: string): void; + + /** + * Removes a class from the label Element. + */ + removeClassFromLabel(className: string): void; + + /** + * Sets an attribute on the icon Element. + */ + setIconAttr(name: string, value: string): void; + + /** + * Returns true if classname exists for a given target element. + */ + eventTargetHasClass(target: EventTarget, className: string): boolean; + + /** + * Registers an event handler on the root element for a given event. + */ + registerTextFieldInteractionHandler(type: string, handler: EventListener): void; + + /** + * Deregisters an event handler on the root element for a given event. + */ + deregisterTextFieldInteractionHandler(type: string, handler: EventListener): void; + + /** + * Emits a custom event "MDCTextField:icon" denoting a user has clicked the icon. + */ + notifyIconAction(): void; + + /** + * Adds a class to the helper text element. Note that in our code we check for + * whether or not we have a helper text element and if we don't, we simply + * return. + */ + addClassToHelperText(className: string): void; + + /** + * Removes a class from the helper text element. + */ + removeClassFromHelperText(className: string): void; + + /** + * Returns whether or not the helper text element contains the given class. + */ + helperTextHasClass(className: string): boolean; + + /** + * Registers an event listener on the native input element for a given event. + */ + registerInputInteractionHandler(evtType: string, handler: EventListener): void; + + /** + * Deregisters an event listener on the native input element for a given event. + */ + deregisterInputInteractionHandler(evtType: string, handler: EventListener): void; + + /** + * Registers an event listener on the bottom line element for a given event. + */ + registerBottomLineEventHandler(evtType: string, handler: EventListener): void; + + /** + * Deregisters an event listener on the bottom line element for a given event. + */ + deregisterBottomLineEventHandler(evtType: string, handler: EventListener): void; + + /** + * Sets an attribute with a given value on the helper text element. + */ + setHelperTextAttr(name: string, value: string): void; + + /** + * Removes an attribute from the helper text element. + */ + removeHelperTextAttr(name: string): void; + + /** + * Sets the text content for the help text element + */ + setHelperTextContent(content: string): void; + + /** + * Returns an object representing the native text input element, with a + * similar API shape. The object returned should include the value, disabled + * and badInput properties, as well as the checkValidity() function. We never + * alter the value within our code, however we do update the disabled + * property, so if you choose to duck-type the return value for this method + * in your implementation it's important to keep this in mind. Also note that + * this method can return null, which the foundation will handle gracefully. + */ + getNativeInput(): Element|NativeInputType; + + /** + * Returns the foundation for the bottom line element. Returns undefined if + * there is no bottom line element. + */ + getBottomLineFoundation(): MDCTextFieldBottomLineFoundation; + + /** + * Returns the foundation for the helper text element. Returns undefined if + * there is no helper text element. + */ + getHelperTextFoundation(): MDCTextFieldHelperTextFoundation; +} diff --git a/types/material__textfield/bottom-line/adapter.d.ts b/types/material__textfield/bottom-line/adapter.d.ts new file mode 100644 index 0000000000..25b8de0477 --- /dev/null +++ b/types/material__textfield/bottom-line/adapter.d.ts @@ -0,0 +1,60 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Adapter for MDC TextField Bottom Line. + * + * Defines the shape of the adapter expected by the foundation. Implement this + * adapter to integrate the TextField bottom line into your framework. See + * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md + * for more information. + * + * @record + */ +export default class MDCTextFieldBottomLineAdapter { + /** + * Adds a class to the bottom line element. + */ + addClass(className: string): void; + + /** + * Removes a class from the bottom line element. + */ + removeClass(className: string): void; + + /** + * Sets an attribute with a given value on the bottom line element. + */ + setAttr(attr: string, value: string): void; + + /** + * Registers an event listener on the bottom line element for a given event. + */ + registerEventHandler(evtType: string, handler: EventListener): void; + + /** + * Deregisters an event listener on the bottom line element for a given event. + */ + deregisterEventHandler(evtType: string, handler: EventListener): void; + + /** + * Emits a custom event "MDCTextFieldBottomLine:animation-end" denoting the + * bottom line has finished its animation; either the activate or + * deactivate animation + */ + notifyAnimationEnd(): void; +} diff --git a/types/material__textfield/bottom-line/constants.d.ts b/types/material__textfield/bottom-line/constants.d.ts new file mode 100644 index 0000000000..519b9fb8e5 --- /dev/null +++ b/types/material__textfield/bottom-line/constants.d.ts @@ -0,0 +1,26 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface strings extends MDCStrings { + ANIMATION_END_EVENT: 'MDCTextFieldBottomLine:animation-end'; +} + +export interface cssClasses extends MDCStrings { + BOTTOM_LINE_ACTIVE: 'mdc-text-field__bottom-line--active'; +} diff --git a/types/material__textfield/bottom-line/foundation.d.ts b/types/material__textfield/bottom-line/foundation.d.ts new file mode 100644 index 0000000000..6945695348 --- /dev/null +++ b/types/material__textfield/bottom-line/foundation.d.ts @@ -0,0 +1,48 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import MDCTextFieldBottomLineAdapter from './adapter'; +import { cssClasses, strings } from './constants'; + +export default class MDCTextFieldBottomLineFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCTextFieldBottomLineAdapter; + + /** + * Activates the bottom line + */ + activate(): void; + + /** + * Sets the transform origin given a user's click location. + */ + setTransformOrigin(evt: Event): void; + + /** + * Deactivates the bottom line + */ + deactivate(): void; + + /** + * Handles a transition end event + */ + handleTransitionEnd(evt: Event): void; +} diff --git a/types/material__textfield/bottom-line/index.d.ts b/types/material__textfield/bottom-line/index.d.ts new file mode 100644 index 0000000000..a0ed4ff36d --- /dev/null +++ b/types/material__textfield/bottom-line/index.d.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; + +import MDCTextFieldBottomLineAdapter from './adapter'; +import MDCTextFieldBottomLineFoundation from './foundation'; + +export {MDCTextFieldBottomLineAdapter, MDCTextFieldBottomLineFoundation}; + +export class MDCTextFieldBottomLine extends MDCComponent { + static attachTo(root: Element): MDCTextFieldBottomLine; + + readonly foundation: MDCTextFieldBottomLineFoundation; + + getDefaultFoundation(): MDCTextFieldBottomLineFoundation; +} diff --git a/types/material__textfield/constants.d.ts b/types/material__textfield/constants.d.ts new file mode 100644 index 0000000000..7150bb4b14 --- /dev/null +++ b/types/material__textfield/constants.d.ts @@ -0,0 +1,40 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface strings extends MDCStrings { + ARIA_CONTROLS: 'aria-controls'; + INPUT_SELECTOR: '.mdc-text-field__input'; + LABEL_SELECTOR: '.mdc-text-field__label'; + ICON_SELECTOR: '.mdc-text-field__icon'; + ICON_EVENT: 'MDCTextField:icon'; + BOTTOM_LINE_SELECTOR: '.mdc-text-field__bottom-line'; +} + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-text-field'; + UPGRADED: 'mdc-text-field--upgraded'; + DISABLED: 'mdc-text-field--disabled'; + FOCUSED: 'mdc-text-field--focused'; + INVALID: 'mdc-text-field--invalid'; + LABEL_FLOAT_ABOVE: 'mdc-text-field__label--float-above'; + LABEL_SHAKE: 'mdc-text-field__label--shake'; + BOX: 'mdc-text-field--box'; + TEXT_FIELD_ICON: 'mdc-text-field__icon'; + TEXTAREA: 'mdc-text-field--textarea'; +} diff --git a/types/material__textfield/foundation.d.ts b/types/material__textfield/foundation.d.ts new file mode 100644 index 0000000000..d36d83867e --- /dev/null +++ b/types/material__textfield/foundation.d.ts @@ -0,0 +1,79 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import { MDCTextFieldAdapter, NativeInputType } from './adapter'; +import MDCTextFieldBottomLineFoundation from './bottom-line/foundation'; +import { cssClasses, strings } from './constants'; + +export default class MDCTextFieldFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCTextFieldAdapter; + + handleTextFieldInteraction(evt: Event): void; + + /** + * Activates the text field focus state. + */ + activateFocus(): void; + + /** + * Sets the bottom line's transform origin, so that the bottom line activate + * animation will animate out from the user's click location. + */ + setBottomLineTransformOrigin(evt: Event): void; + + /** + * Activates the Text Field's focus state in cases when the input value + * changes without user input (e.g. programatically). + */ + autoCompleteFocus(): void; + + /** + * Handles when bottom line animation ends, performing actions that must wait + * for animations to finish. + */ + handleBottomLineAnimationEnd(): void; + + /** + * Deactives the Text Field's focus state. + */ + deactivateFocus(): void; + + /** + * True if the Text Field is disabled. + */ + isDisabled(): boolean; + + /** + * Sets the text-field disabled or enabled. + */ + setDisabled(disabled: boolean): void; + + /** + * Sets the content of the helper text. + */ + setHelperTextContent(content: string): void; + + /** + * Sets the validity state of the Text Field. + */ + setValid(isValid: boolean): void; +} diff --git a/types/material__textfield/helper-text/adapter.d.ts b/types/material__textfield/helper-text/adapter.d.ts new file mode 100644 index 0000000000..d8320bd0f4 --- /dev/null +++ b/types/material__textfield/helper-text/adapter.d.ts @@ -0,0 +1,58 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Adapter for MDC Text Field Helper Text. + * + * Defines the shape of the adapter expected by the foundation. Implement this + * adapter to integrate the TextField helper text into your framework. See + * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md + * for more information. + * + * @record + */ +export default class MDCTextFieldHelperTextAdapter { + /** + * Adds a class to the helper text element. + */ + addClass(className: string): void; + + /** + * Removes a class from the helper text element. + */ + removeClass(className: string): void; + + /** + * Returns whether or not the helper text element contains the given class. + */ + hasClass(className: string): boolean; + + /** + * Sets an attribute with a given value on the helper text element. + */ + setAttr(attr: string, value: string): void; + + /** + * Removes an attribute from the helper text element. + */ + removeAttr(attr: string): void; + + /** + * Sets the text content for the helper text element. + */ + setContent(content: string): void; +} diff --git a/types/material__textfield/helper-text/constants.d.ts b/types/material__textfield/helper-text/constants.d.ts new file mode 100644 index 0000000000..5418851e63 --- /dev/null +++ b/types/material__textfield/helper-text/constants.d.ts @@ -0,0 +1,28 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface strings extends MDCStrings { + ARIA_HIDDEN: 'aria-hidden'; + ROLE: 'role'; +} + +export interface cssClasses extends MDCStrings { + HELPER_TEXT_PERSISTENT: 'mdc-text-field-helper-text--persistent'; + HELPER_TEXT_VALIDATION_MSG: 'mdc-text-field-helper-text--validation-msg'; +} diff --git a/types/material__textfield/helper-text/foundation.d.ts b/types/material__textfield/helper-text/foundation.d.ts new file mode 100644 index 0000000000..eccf531e51 --- /dev/null +++ b/types/material__textfield/helper-text/foundation.d.ts @@ -0,0 +1,41 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import MDCTextFieldHelperTextAdapter from './adapter'; +import { cssClasses, strings } from './constants'; + +export default class MDCTextFieldHelperTextFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCTextFieldHelperTextAdapter; + + /** + * Sets the content of the helper text field. + */ + setContent(content: string): void; + + /** Makes the helper text visible to the screen reader. */ + showToScreenReader(): void; + + /** + * Sets the validity of the helper text based on the input validity. + */ + setValidity(inputIsValid: boolean): void; +} diff --git a/types/material__textfield/helper-text/index.d.ts b/types/material__textfield/helper-text/index.d.ts new file mode 100644 index 0000000000..6c26000366 --- /dev/null +++ b/types/material__textfield/helper-text/index.d.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; + +import MDCTextFieldHelperTextAdapter from './adapter'; +import MDCTextFieldHelperTextFoundation from './foundation'; + +export {MDCTextFieldHelperTextAdapter, MDCTextFieldHelperTextFoundation}; + +export class MDCTextFieldHelperText extends MDCComponent { + static attachTo(root: Element): MDCTextFieldHelperText; + + readonly foundation: MDCTextFieldHelperTextFoundation; + + getDefaultFoundation(): MDCTextFieldHelperTextFoundation; +} diff --git a/types/material__textfield/index.d.ts b/types/material__textfield/index.d.ts new file mode 100644 index 0000000000..85d4c36420 --- /dev/null +++ b/types/material__textfield/index.d.ts @@ -0,0 +1,61 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import { MDCRipple } from 'material__ripple'; + +import { cssClasses, strings } from './constants'; +import { MDCTextFieldAdapter } from './adapter'; +import MDCTextFieldFoundation from './foundation'; +import { MDCTextFieldBottomLine } from './bottom-line/index'; +import { MDCTextFieldHelperText } from './helper-text/index'; + +export {MDCTextFieldAdapter, MDCTextFieldFoundation}; + +export class MDCTextField extends MDCComponent { + static attachTo(root: Element): MDCTextField; + + initialize( + rippleFactory?: (el: Element) => MDCRipple, + bottomLineFactory?: (el: Element) => MDCTextFieldBottomLine + ): void; + + destroy(): void; + + /** + * Initiliazes the Text Field's internal state based on the environment's + * state. + */ + initialSyncWithDom(): void; + + disabled: boolean; + + valid: boolean; + + /** + * Sets the helper text element content. + */ + helperTextContent: string; + + getDefaultFoundation(): MDCTextFieldFoundation; +} diff --git a/types/material__textfield/tsconfig.json b/types/material__textfield/tsconfig.json new file mode 100644 index 0000000000..e9d0a01a13 --- /dev/null +++ b/types/material__textfield/tsconfig.json @@ -0,0 +1,36 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "helper-text/constants.d.ts", + "helper-text/adapter.d.ts", + "helper-text/index.d.ts", + "helper-text/foundation.d.ts", + "bottom-line/constants.d.ts", + "bottom-line/adapter.d.ts", + "bottom-line/index.d.ts", + "bottom-line/foundation.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__textfield/tslint.json b/types/material__textfield/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__textfield/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__toolbar/adapter.d.ts b/types/material__toolbar/adapter.d.ts new file mode 100644 index 0000000000..625b296cf8 --- /dev/null +++ b/types/material__toolbar/adapter.d.ts @@ -0,0 +1,49 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCToolbarAdapter { + hasClass(className: string): boolean; + + addClass(className: string): void; + + removeClass(className: string): void; + + registerScrollHandler(handler: EventListener): void; + + deregisterScrollHandler(handler: EventListener): void; + + registerResizeHandler(handler: EventListener): void; + + deregisterResizeHandler(handler: EventListener): void; + + getViewportWidth(): number; + + getViewportScrollY(): number; + + getOffsetHeight(): number; + + getFirstRowElementOffsetHeight(): number; + + notifyChange(evtData: {flexibleExpansionRatio: number}): void; + + setStyle(property: string, value: string): void; + + setStyleForTitleElement(property: string, value: string): void; + + setStyleForFlexibleRowElement(property: string, value: string): void; + + setStyleForFixedAdjustElement(property: string, value: string): void; +} diff --git a/types/material__toolbar/constants.d.ts b/types/material__toolbar/constants.d.ts new file mode 100644 index 0000000000..8f984ac113 --- /dev/null +++ b/types/material__toolbar/constants.d.ts @@ -0,0 +1,41 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings, MDCNumbers } from 'material__base'; + +export interface cssClasses extends MDCStrings { + FIXED: 'mdc-toolbar--fixed'; + FIXED_LASTROW: 'mdc-toolbar--fixed-lastrow-only'; + FIXED_AT_LAST_ROW: 'mdc-toolbar--fixed-at-last-row'; + TOOLBAR_ROW_FLEXIBLE: 'mdc-toolbar--flexible'; + FLEXIBLE_DEFAULT_BEHAVIOR: 'mdc-toolbar--flexible-default-behavior'; + FLEXIBLE_MAX: 'mdc-toolbar--flexible-space-maximized'; + FLEXIBLE_MIN: 'mdc-toolbar--flexible-space-minimized'; +} + +export interface strings extends MDCStrings { + TITLE_SELECTOR: '.mdc-toolbar__title'; + FIRST_ROW_SELECTOR: '.mdc-toolbar__row:first-child'; + CHANGE_EVENT: 'MDCToolbar:change'; +} + +export interface numbers extends MDCNumbers { + MAX_TITLE_SIZE: 2.125; + MIN_TITLE_SIZE: 1.25; + TOOLBAR_ROW_HEIGHT: 64; + TOOLBAR_ROW_MOBILE_HEIGHT: 56; + TOOLBAR_MOBILE_BREAKPOINT: 600; +} diff --git a/types/material__toolbar/foundation.d.ts b/types/material__toolbar/foundation.d.ts new file mode 100644 index 0000000000..883c0b19e0 --- /dev/null +++ b/types/material__toolbar/foundation.d.ts @@ -0,0 +1,30 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import MDCFoundation from 'material__base/foundation'; +import { cssClasses, strings, numbers } from './constants'; +import { MDCToolbarAdapter } from './adapter'; + +export default class MDCToolbarFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly numbers: numbers; + + static readonly defaultAdapter: MDCToolbarAdapter; + + updateAdjustElementStyles(): void; +} diff --git a/types/material__toolbar/index.d.ts b/types/material__toolbar/index.d.ts new file mode 100644 index 0000000000..1b048c64c9 --- /dev/null +++ b/types/material__toolbar/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; + +import MDCToolbarFoundation from './foundation'; +import { MDCToolbarAdapter } from './adapter'; +import * as util from './util'; + +export {MDCToolbarAdapter, MDCToolbarFoundation, util}; + +export class MDCToolbar extends MDCComponent { + static attachTo(root: HTMLElement): MDCToolbar; + + fixedAdjustElement: HTMLElement; + + getDefaultFoundation(): MDCToolbarFoundation; +} diff --git a/types/material__toolbar/tsconfig.json b/types/material__toolbar/tsconfig.json new file mode 100644 index 0000000000..9f215e4ee0 --- /dev/null +++ b/types/material__toolbar/tsconfig.json @@ -0,0 +1,29 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "util.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__toolbar/tslint.json b/types/material__toolbar/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__toolbar/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__toolbar/util.d.ts b/types/material__toolbar/util.d.ts new file mode 100644 index 0000000000..37506958e7 --- /dev/null +++ b/types/material__toolbar/util.d.ts @@ -0,0 +1,18 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Determine whether the current browser supports passive event listeners, and if so, use them. +export function applyPassive(globalObj?: Window, forceRefresh?: boolean): boolean; diff --git a/types/materialize-css/tsconfig.json b/types/materialize-css/tsconfig.json index 316e2f8361..e018875d4a 100644 --- a/types/materialize-css/tsconfig.json +++ b/types/materialize-css/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -23,4 +24,4 @@ "test/materialize-css-module.test.ts", "test/materialize-css-jquery.test.ts" ] -} +} \ No newline at end of file diff --git a/types/materialize-css/v0/index.d.ts b/types/materialize-css/v0/index.d.ts index a457c3ad1a..87629ed699 100644 --- a/types/materialize-css/v0/index.d.ts +++ b/types/materialize-css/v0/index.d.ts @@ -5,6 +5,7 @@ // Sukhdeep Singh // Jean-Francois Cere // Sebastien Cote +// Liad Idan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -475,11 +476,15 @@ declare namespace Materialize { } /** - * Declare Pickadate namespace again in order to add more Materialize specific properties to TimeOptions interface + * Declare Pickadate namespace again in order to add more Materialize specific properties to TimeOptions and DateOptions interfaces * * @see http://www.typescriptlang.org/docs/handbook/declaration-merging.html */ declare namespace Pickadate { + interface DateOptions { + weekdaysLetter?: string[]; + } + interface TimeOptions { /** * Set default time such as : 'now', '1:30AM', '16:30'. diff --git a/types/materialize-css/v0/tsconfig.json b/types/materialize-css/v0/tsconfig.json index 4f000774ea..a627672707 100644 --- a/types/materialize-css/v0/tsconfig.json +++ b/types/materialize-css/v0/tsconfig.json @@ -20,10 +20,11 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "materialize-css-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/math3d/tsconfig.json b/types/math3d/tsconfig.json index 95a0a4148d..9137199265 100644 --- a/types/math3d/tsconfig.json +++ b/types/math3d/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mathjax/tsconfig.json b/types/mathjax/tsconfig.json index dcf27a92fb..2112b99a25 100644 --- a/types/mathjax/tsconfig.json +++ b/types/mathjax/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mathjs/tsconfig.json b/types/mathjs/tsconfig.json index c2aefff773..b303869490 100644 --- a/types/mathjs/tsconfig.json +++ b/types/mathjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/matter-js/tsconfig.json b/types/matter-js/tsconfig.json index bac77b2a64..b2badceadf 100644 --- a/types/matter-js/tsconfig.json +++ b/types/matter-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/maxmind/tsconfig.json b/types/maxmind/tsconfig.json index 0b1011f8f7..6891fe1c23 100644 --- a/types/maxmind/tsconfig.json +++ b/types/maxmind/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mcustomscrollbar/tsconfig.json b/types/mcustomscrollbar/tsconfig.json index b112ee023e..d30025133e 100644 --- a/types/mcustomscrollbar/tsconfig.json +++ b/types/mcustomscrollbar/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/md5/tsconfig.json b/types/md5/tsconfig.json index 0f2d4677ab..a8d504f6fd 100644 --- a/types/md5/tsconfig.json +++ b/types/md5/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mdns/tsconfig.json b/types/mdns/tsconfig.json index 94e58f4170..66eb855866 100644 --- a/types/mdns/tsconfig.json +++ b/types/mdns/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mdurl/tsconfig.json b/types/mdurl/tsconfig.json index c00c56ef07..38ef207a0a 100644 --- a/types/mdurl/tsconfig.json +++ b/types/mdurl/tsconfig.json @@ -14,10 +14,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ "index.d.ts", "mdurl-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/media-typer/tsconfig.json b/types/media-typer/tsconfig.json index fe5268288d..4a1fc1c9a7 100644 --- a/types/media-typer/tsconfig.json +++ b/types/media-typer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/medium-editor/tsconfig.json b/types/medium-editor/tsconfig.json index 10748accf4..405b91f5c7 100644 --- a/types/medium-editor/tsconfig.json +++ b/types/medium-editor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mem/tsconfig.json b/types/mem/tsconfig.json index 3545985694..b43f6271a3 100644 --- a/types/mem/tsconfig.json +++ b/types/mem/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/memcached/index.d.ts b/types/memcached/index.d.ts index fffbb57c82..8e330fa88d 100644 --- a/types/memcached/index.d.ts +++ b/types/memcached/index.d.ts @@ -280,5 +280,9 @@ declare namespace Memcached { * 5000, the idle timeout for the connections. */ idle ?: number; + /** + * '', sentinel to prepend to all memcache keys for namespacing the entries. + */ + namespace ?: string; } } diff --git a/types/memcached/tsconfig.json b/types/memcached/tsconfig.json index 720907bb10..daeddba4b9 100644 --- a/types/memcached/tsconfig.json +++ b/types/memcached/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/memoizee/tsconfig.json b/types/memoizee/tsconfig.json index b8aa9634f1..9e24c851b1 100644 --- a/types/memoizee/tsconfig.json +++ b/types/memoizee/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/memory-cache/tsconfig.json b/types/memory-cache/tsconfig.json index 1d0ac845ac..12a7e2cd2f 100644 --- a/types/memory-cache/tsconfig.json +++ b/types/memory-cache/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/memory-fs/tsconfig.json b/types/memory-fs/tsconfig.json index 13eb7da317..b2cc01072d 100644 --- a/types/memory-fs/tsconfig.json +++ b/types/memory-fs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/memwatch-next/tsconfig.json b/types/memwatch-next/tsconfig.json index 4541aaa1cf..36ae49fd1d 100644 --- a/types/memwatch-next/tsconfig.json +++ b/types/memwatch-next/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/menubar/menubar-tests.ts b/types/menubar/menubar-tests.ts index 7fd1a9dbe4..9501574164 100644 --- a/types/menubar/menubar-tests.ts +++ b/types/menubar/menubar-tests.ts @@ -1,4 +1,4 @@ -import * as menubar from "menubar"; +import menubar = require("menubar"); var mb1 = menubar(); diff --git a/types/menubar/tsconfig.json b/types/menubar/tsconfig.json index d9d6d843b4..2e3879f42f 100644 --- a/types/menubar/tsconfig.json +++ b/types/menubar/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/meow/index.d.ts b/types/meow/index.d.ts index 2585d421ae..20e40c63f7 100644 --- a/types/meow/index.d.ts +++ b/types/meow/index.d.ts @@ -1,11 +1,13 @@ -// Type definitions for meow 3.6 +// Type definitions for meow 4.x // Project: https://github.com/sindresorhus/meow -// Definitions by: KnisterPeter +// Definitions by: KnisterPeter , Lindsey Smith // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 -import * as minimist from 'minimist'; +import * as buildOptions from "minimist-options"; -declare function meow(options: string | string[] | meow.Options, minimistOptions?: minimist.Opts): meow.Result; +declare function meow(helpMessage: string | string[], options: meow.Options): meow.Result; +declare function meow(options: string | string[] | meow.Options): meow.Result; declare namespace meow { interface Options { description?: string | boolean; @@ -14,14 +16,18 @@ declare namespace meow { pkg?: any; argv?: string[]; inferType?: boolean; + flags?: buildOptions.Options; + autoHelp?: boolean; + autoVersion?: boolean; } interface Result { input: string[]; flags: { [name: string]: any }; - pkg: any; + pkg: object; help: string; showHelp(code?: number): void; + showVersion(): void; } } diff --git a/types/meow/meow-tests.ts b/types/meow/meow-tests.ts index 6560b76bef..8915603292 100644 --- a/types/meow/meow-tests.ts +++ b/types/meow/meow-tests.ts @@ -1,19 +1,39 @@ import meow = require('meow'); -import Options = meow.Options; -const options: Options = {}; -options.description = true; -options.description = 'string'; -options.help = true; -options.help = 'string'; -options.version = true; -options.version = 'string'; -options.argv = ['string', 'string']; -options.inferType = true; +const cli = meow("Help text", + { + flags: { + unicorn: { + type: 'boolean', + alias: 'u' + }, + fooBar: { + type: 'string', + default: 'foo' + } + } + } +); -meow(options); -meow('Usage text', { - alias: { - opt: 'opt' - } +const cli2 = meow("Help text"); + +const cli3 = meow({ + description: "version string", + help: "help string", + version: "1.0.0", + pkg: {}, + argv: ['foo', 'bar'], + inferType: true, + autoHelp: true, + autoVersion: true, + flags: { + unicorn: { + type: 'boolean', + alias: 'u' + }, + fooBar: { + type: 'string', + default: 'foo' + } + } }); diff --git a/types/meow/tsconfig.json b/types/meow/tsconfig.json index 33dd0b0883..a0ad2daded 100644 --- a/types/meow/tsconfig.json +++ b/types/meow/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/merge-descriptors/tsconfig.json b/types/merge-descriptors/tsconfig.json index 23f7dfbcce..59d838f171 100644 --- a/types/merge-descriptors/tsconfig.json +++ b/types/merge-descriptors/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/merge-stream/tsconfig.json b/types/merge-stream/tsconfig.json index d68bbea99f..f36f9609f1 100644 --- a/types/merge-stream/tsconfig.json +++ b/types/merge-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/merge2/merge2-tests.ts b/types/merge2/merge2-tests.ts index ba11597dfa..c96747973d 100644 --- a/types/merge2/merge2-tests.ts +++ b/types/merge2/merge2-tests.ts @@ -1,5 +1,5 @@ import * as gulp from 'gulp'; -import * as merge2 from 'merge2'; +import merge2 = require('merge2'); gulp.task('app-js', () => merge2( diff --git a/types/merge2/tsconfig.json b/types/merge2/tsconfig.json index e39e70032b..7b84762f1a 100644 --- a/types/merge2/tsconfig.json +++ b/types/merge2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/merkle/index.d.ts b/types/merkle/index.d.ts new file mode 100644 index 0000000000..eac3928e48 --- /dev/null +++ b/types/merkle/index.d.ts @@ -0,0 +1,39 @@ +// Type definitions for merkle 0.6 +// Project: https://github.com/c-geek/merkle +// Definitions by: Yu Hsin Lu +// Definitions: https://github.com/kerol2r20/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +/* =================== USAGE =================== + + import merkle = require("merkle"); + + const stream = merkle('sha256'); + const merkleTree = stream.sync([1, 2, 3, 4, 5, 6, 7, 8]); + merkleTree.root(); + + =============================================== */ + +import stream = require("stream"); + +declare function merkle( + hashname: "sha512" | "sha256" | "sha1" | "md5" | "ripemd160" | "whirlpool" | "none", + useUpperCaseForHash?: boolean): MerkleStream; + +declare class MerkleStream extends stream.Transform { + sync(leaves: any[]): MerkleTree; + async(leaves: any[], callback: (err: string, tree: MerkleTree) => void): void; + json(): MerkleStream; +} + +declare class MerkleTree { + root(): string; + level(level: number): number | undefined; + depth(): number; + levels(): number; + nodes(): number; +} + +export = merkle; diff --git a/types/merkle/merkle-tests.ts b/types/merkle/merkle-tests.ts new file mode 100644 index 0000000000..e9177525fb --- /dev/null +++ b/types/merkle/merkle-tests.ts @@ -0,0 +1,5 @@ +import merkle = require("merkle"); + +const stream = merkle('sha256'); +const merkleTree = stream.sync([1, 2, 3, 4, 5, 6, 7, 8]); +merkleTree.root(); diff --git a/types/merkle/tsconfig.json b/types/merkle/tsconfig.json new file mode 100644 index 0000000000..0c54ad7910 --- /dev/null +++ b/types/merkle/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "merkle-tests.ts" + ] +} \ No newline at end of file diff --git a/types/merkle/tslint.json b/types/merkle/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/merkle/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/mersenne-twister/tsconfig.json b/types/mersenne-twister/tsconfig.json index 418c7a0355..4d4863d526 100644 --- a/types/mersenne-twister/tsconfig.json +++ b/types/mersenne-twister/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/meshblu/tsconfig.json b/types/meshblu/tsconfig.json index a00e392388..89b1d2672e 100644 --- a/types/meshblu/tsconfig.json +++ b/types/meshblu/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mess/tsconfig.json b/types/mess/tsconfig.json index 8ca702b9a4..813664418e 100644 --- a/types/mess/tsconfig.json +++ b/types/mess/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/messenger/tsconfig.json b/types/messenger/tsconfig.json index 15915e2f35..ba06a057d8 100644 --- a/types/messenger/tsconfig.json +++ b/types/messenger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/meteor-accounts-phone/tsconfig.json b/types/meteor-accounts-phone/tsconfig.json index f6945ba442..84dc40357b 100644 --- a/types/meteor-accounts-phone/tsconfig.json +++ b/types/meteor-accounts-phone/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/meteor-collection-hooks/tsconfig.json b/types/meteor-collection-hooks/tsconfig.json index 462b5cb2fe..a0a676b908 100644 --- a/types/meteor-collection-hooks/tsconfig.json +++ b/types/meteor-collection-hooks/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/meteor-jboulhous-dev/tsconfig.json b/types/meteor-jboulhous-dev/tsconfig.json index 6a0bc28585..d31afd862e 100644 --- a/types/meteor-jboulhous-dev/tsconfig.json +++ b/types/meteor-jboulhous-dev/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/meteor-persistent-session/tsconfig.json b/types/meteor-persistent-session/tsconfig.json index 9f9adaeead..683c700a9d 100644 --- a/types/meteor-persistent-session/tsconfig.json +++ b/types/meteor-persistent-session/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/meteor-prime8consulting-oauth2/tsconfig.json b/types/meteor-prime8consulting-oauth2/tsconfig.json index 1d71e79d3c..c389ce9cf9 100644 --- a/types/meteor-prime8consulting-oauth2/tsconfig.json +++ b/types/meteor-prime8consulting-oauth2/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/meteor-publish-composite/tsconfig.json b/types/meteor-publish-composite/tsconfig.json index 81c22f6ce3..0785ede5be 100644 --- a/types/meteor-publish-composite/tsconfig.json +++ b/types/meteor-publish-composite/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/meteor-roles/tsconfig.json b/types/meteor-roles/tsconfig.json index 037db6b9f4..51a1ad5bde 100644 --- a/types/meteor-roles/tsconfig.json +++ b/types/meteor-roles/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/meteor/tsconfig.json b/types/meteor/tsconfig.json index 6185ff9c61..52e222c94e 100644 --- a/types/meteor/tsconfig.json +++ b/types/meteor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "accounts.d.ts", @@ -41,4 +42,4 @@ "index.d.ts", "meteor-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/method-override/tsconfig.json b/types/method-override/tsconfig.json index 1487adc964..650db93067 100644 --- a/types/method-override/tsconfig.json +++ b/types/method-override/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/methods/tsconfig.json b/types/methods/tsconfig.json index 1b3353ca82..3a5f1b3b18 100644 --- a/types/methods/tsconfig.json +++ b/types/methods/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/metric-suffix/tsconfig.json b/types/metric-suffix/tsconfig.json index fc4d7b871f..47128d3617 100644 --- a/types/metric-suffix/tsconfig.json +++ b/types/metric-suffix/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mfiles/tsconfig.json b/types/mfiles/tsconfig.json index 295542875a..530a0d5827 100644 --- a/types/mfiles/tsconfig.json +++ b/types/mfiles/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mfiles/tslint.json b/types/mfiles/tslint.json index d2b1bdc0e6..42cc02d1f5 100644 --- a/types/mfiles/tslint.json +++ b/types/mfiles/tslint.json @@ -4,6 +4,7 @@ // The definitions need to use the same naming as the original typelib, see http://www.m-files.com/UI_Extensibility_Framework/#MFClientScript_P.html "interface-name": false, // The definition file is generated by a tool and not edited manually, thus long lines may be created - "max-line-length": false + "max-line-length": false, + "no-const-enum": false } } \ No newline at end of file diff --git a/types/micro/micro-tests.ts b/types/micro/micro-tests.ts index 010fe012cb..e47645deb9 100644 --- a/types/micro/micro-tests.ts +++ b/types/micro/micro-tests.ts @@ -1,5 +1,5 @@ import micro, { json, RequestHandler, buffer, text, send, createError } from 'micro'; -import * as socketIO from 'socket.io'; +import socketIO = require('socket.io'); // Json sample diff --git a/types/micro/tsconfig.json b/types/micro/tsconfig.json index 7f1e37655b..2d341abe8d 100644 --- a/types/micro/tsconfig.json +++ b/types/micro/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/micromatch/tsconfig.json b/types/micromatch/tsconfig.json index 277346ea71..02774511a8 100644 --- a/types/micromatch/tsconfig.json +++ b/types/micromatch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/micromatch/v2/tsconfig.json b/types/micromatch/v2/tsconfig.json index e011e8c1cc..a0e11a8a22 100644 --- a/types/micromatch/v2/tsconfig.json +++ b/types/micromatch/v2/tsconfig.json @@ -19,7 +19,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/microrouter/tsconfig.json b/types/microrouter/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/microrouter/tsconfig.json +++ b/types/microrouter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/microsoft-ajax/tsconfig.json b/types/microsoft-ajax/tsconfig.json index 3a8d8bcc37..1e27f3d6dd 100644 --- a/types/microsoft-ajax/tsconfig.json +++ b/types/microsoft-ajax/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/microsoft-live-connect/tsconfig.json b/types/microsoft-live-connect/tsconfig.json index 7895e4debe..555540b344 100644 --- a/types/microsoft-live-connect/tsconfig.json +++ b/types/microsoft-live-connect/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/microsoft-sdk-soap/tsconfig.json b/types/microsoft-sdk-soap/tsconfig.json index 3eee7c6b1c..6bc4ac7835 100644 --- a/types/microsoft-sdk-soap/tsconfig.json +++ b/types/microsoft-sdk-soap/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/microsoftteams/tsconfig.json b/types/microsoftteams/tsconfig.json index 95b8785492..6014c8e5d7 100644 --- a/types/microsoftteams/tsconfig.json +++ b/types/microsoftteams/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/microsoftteams/tslint.json b/types/microsoftteams/tslint.json index 30a1bdde2e..3224b40b8b 100644 --- a/types/microsoftteams/tslint.json +++ b/types/microsoftteams/tslint.json @@ -1,3 +1,6 @@ { - "extends": "dtslint/dt.json" -} \ No newline at end of file + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } +} diff --git a/types/microtime/tsconfig.json b/types/microtime/tsconfig.json index c5989f5799..7991d90494 100644 --- a/types/microtime/tsconfig.json +++ b/types/microtime/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/milkcocoa/tsconfig.json b/types/milkcocoa/tsconfig.json index def0b291ed..22c7cb7830 100644 --- a/types/milkcocoa/tsconfig.json +++ b/types/milkcocoa/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/milliseconds/tsconfig.json b/types/milliseconds/tsconfig.json index eb756035ba..aa931efbdb 100644 --- a/types/milliseconds/tsconfig.json +++ b/types/milliseconds/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mime-db/tsconfig.json b/types/mime-db/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/mime-db/tsconfig.json +++ b/types/mime-db/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/mime-types/tsconfig.json b/types/mime-types/tsconfig.json index d197e5f93c..f197d1a1a5 100644 --- a/types/mime-types/tsconfig.json +++ b/types/mime-types/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mime/tsconfig.json b/types/mime/tsconfig.json index 8e0eb9488e..45e7b9f82f 100644 --- a/types/mime/tsconfig.json +++ b/types/mime/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mimos/tsconfig.json b/types/mimos/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/mimos/tsconfig.json +++ b/types/mimos/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/mina/tsconfig.json b/types/mina/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/mina/tsconfig.json +++ b/types/mina/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/minilog/tsconfig.json b/types/minilog/tsconfig.json index b999744170..eabf1dc6ad 100644 --- a/types/minilog/tsconfig.json +++ b/types/minilog/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/minimatch/tsconfig.json b/types/minimatch/tsconfig.json index 7180fe6a29..c0e55963be 100644 --- a/types/minimatch/tsconfig.json +++ b/types/minimatch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/minimist-options/tsconfig.json b/types/minimist-options/tsconfig.json index b43c584555..54036aa94c 100644 --- a/types/minimist-options/tsconfig.json +++ b/types/minimist-options/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "minimist-options-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/minimist/tsconfig.json b/types/minimist/tsconfig.json index 27be869de4..55bf6c93ab 100644 --- a/types/minimist/tsconfig.json +++ b/types/minimist/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/minipass/tsconfig.json b/types/minipass/tsconfig.json index 9115c6fe85..4d54021296 100644 --- a/types/minipass/tsconfig.json +++ b/types/minipass/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mirrorx/tsconfig.json b/types/mirrorx/tsconfig.json index 561f5cdab4..8adf5ab4b5 100644 --- a/types/mirrorx/tsconfig.json +++ b/types/mirrorx/tsconfig.json @@ -1,5 +1,5 @@ { - "files": [ + "files": [ "index.d.ts", "mirrorx-tests.ts" ], @@ -21,6 +21,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/mithril-global/tsconfig.json b/types/mithril-global/tsconfig.json index f48de2bee8..0a7b5cb267 100644 --- a/types/mithril-global/tsconfig.json +++ b/types/mithril-global/tsconfig.json @@ -11,6 +11,7 @@ "strictFunctionTypes": true, "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/mithril/tsconfig.json b/types/mithril/tsconfig.json index 3164285eb5..e336b24f36 100644 --- a/types/mithril/tsconfig.json +++ b/types/mithril/tsconfig.json @@ -10,6 +10,7 @@ "strictNullChecks": true, "strictFunctionTypes": false, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "noEmit": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/mitm/tsconfig.json b/types/mitm/tsconfig.json index bb19fc1d20..86cb3b52d7 100644 --- a/types/mitm/tsconfig.json +++ b/types/mitm/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mixpanel/tsconfig.json b/types/mixpanel/tsconfig.json index f5cbbce2f5..c12c4200d9 100644 --- a/types/mixpanel/tsconfig.json +++ b/types/mixpanel/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mixto/tsconfig.json b/types/mixto/tsconfig.json index 8cbc98843f..f780617abc 100644 --- a/types/mixto/tsconfig.json +++ b/types/mixto/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mkdirp/tsconfig.json b/types/mkdirp/tsconfig.json index a5bd09ff68..605500591f 100644 --- a/types/mkdirp/tsconfig.json +++ b/types/mkdirp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mkpath/tsconfig.json b/types/mkpath/tsconfig.json index e114847c25..8fdbb85d17 100644 --- a/types/mkpath/tsconfig.json +++ b/types/mkpath/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mmmagic/tsconfig.json b/types/mmmagic/tsconfig.json index 074e791e6d..775da23960 100644 --- a/types/mmmagic/tsconfig.json +++ b/types/mmmagic/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mobx-apollo/tsconfig.json b/types/mobx-apollo/tsconfig.json index c4c2acace4..969ca52e32 100644 --- a/types/mobx-apollo/tsconfig.json +++ b/types/mobx-apollo/tsconfig.json @@ -1,17 +1,25 @@ { "compilerOptions": { "module": "commonjs", - "lib": ["es6"], + "lib": [ + "es6" + ], "target": "es5", "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, - "files": ["index.d.ts", "mobx-apollo-tests.ts"] -} + "files": [ + "index.d.ts", + "mobx-apollo-tests.ts" + ] +} \ No newline at end of file diff --git a/types/mocha-phantomjs/tsconfig.json b/types/mocha-phantomjs/tsconfig.json index 12d2f5cf28..4ab29d667e 100644 --- a/types/mocha-phantomjs/tsconfig.json +++ b/types/mocha-phantomjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mocha-steps/index.d.ts b/types/mocha-steps/index.d.ts new file mode 100644 index 0000000000..0234f02529 --- /dev/null +++ b/types/mocha-steps/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for mocha-steps 1.1 +// Project: https://github.com/rprieto/mocha-steps +// Definitions by: AryloYeung +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare var step: Mocha.IContextDefinition; +declare var xstep: Mocha.IContextDefinition; diff --git a/types/mocha-steps/mocha-steps-tests.ts b/types/mocha-steps/mocha-steps-tests.ts new file mode 100644 index 0000000000..82d3712b30 --- /dev/null +++ b/types/mocha-steps/mocha-steps-tests.ts @@ -0,0 +1,9 @@ +describe("Mocha Steps Test", () => { + step("Step Test", () => { + const module_name = "mocha-steps"; + }); + + xstep("Skip Step Test", () => { + const module_name = "mocha-steps"; + }); +}); diff --git a/types/localforage-cordovasqlitedriver/tsconfig.json b/types/mocha-steps/tsconfig.json similarity index 72% rename from types/localforage-cordovasqlitedriver/tsconfig.json rename to types/mocha-steps/tsconfig.json index 8e2874eaa8..8447cc6306 100644 --- a/types/localforage-cordovasqlitedriver/tsconfig.json +++ b/types/mocha-steps/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", - "localforage-cordovasqlitedriver-tests.ts" + "mocha-steps-tests.ts" ] } \ No newline at end of file diff --git a/types/mocha-steps/tslint.json b/types/mocha-steps/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/mocha-steps/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/mocha/index.d.ts b/types/mocha/index.d.ts index df0a1c66dd..06ef96c618 100644 --- a/types/mocha/index.d.ts +++ b/types/mocha/index.d.ts @@ -86,9 +86,9 @@ declare class Mocha { bail(value?: boolean): Mocha; addFile(file: string): Mocha; /** Sets reporter by name, defaults to "spec". */ - reporter(name: string): Mocha; + reporter(name: string, reporterOptions?: any): Mocha; /** Sets reporter constructor, defaults to mocha.reporters.Spec. */ - reporter(reporter: ReporterConstructor): Mocha; + reporter(reporter: ReporterConstructor, reporterOptions?: any): Mocha; ui(value: string): Mocha; grep(value: string): Mocha; grep(value: RegExp): Mocha; @@ -147,6 +147,7 @@ declare namespace Mocha { sync: boolean; timedOut: boolean; timeout(n: number | string): this; + duration?: number; } /** Partial interface for Mocha's `Suite` class. */ @@ -170,9 +171,30 @@ declare namespace Mocha { currentTest: ITest; } + interface IStats { + suites: number; + tests: number; + passes: number; + pending: number; + failures: number; + start?: Date; + end?: Date; + duration?: Date; + } /** Partial interface for Mocha's `Runner` class. */ - interface IRunner { } + interface IRunner { + stats?: IStats; + started: boolean; + suite: ISuite; + total: number; + failures: number; + grep: (re: string, invert: boolean) => this; + grepTotal: (suite: ISuite) => number; + globals: (arr: ReadonlyArray) => this | string[]; + abort: () => this; + run: (fn?: (failures: number) => void) => this; + } interface IContextDefinition { (description: string, callback: (this: ISuiteCallbackContext) => void): ISuite; @@ -191,13 +213,7 @@ declare namespace Mocha { export module reporters { export class Base { - stats: { - suites: number; - tests: number; - passes: number; - pending: number; - failures: number; - }; + stats: IStats; constructor(runner: IRunner); } diff --git a/types/mocha/mocha-tests.ts b/types/mocha/mocha-tests.ts index 2549c3cb68..0146c04b13 100644 --- a/types/mocha/mocha-tests.ts +++ b/types/mocha/mocha-tests.ts @@ -1,5 +1,8 @@ let boolean: boolean; let string: string; +let number: number; +let stringOrUndefined: string | undefined; +let dateOrUndefined: Date | undefined; function test_describe() { describe('something', () => { }); @@ -112,7 +115,7 @@ function test_setup() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); setup(function () { @@ -123,7 +126,7 @@ function test_setup() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); setup(function (done) { @@ -134,7 +137,7 @@ function test_setup() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); } @@ -158,7 +161,7 @@ function test_teardown() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); teardown(function () { @@ -169,7 +172,7 @@ function test_teardown() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); teardown(function (done) { @@ -180,7 +183,7 @@ function test_teardown() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); } @@ -192,7 +195,7 @@ function test_beforeEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); beforeEach(function () { @@ -203,7 +206,7 @@ function test_beforeEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); beforeEach(function (done) { @@ -214,7 +217,7 @@ function test_beforeEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); beforeEach("my description", function () { @@ -224,7 +227,7 @@ function test_beforeEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); beforeEach("my description", function (done) { @@ -235,7 +238,7 @@ function test_beforeEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); } @@ -255,7 +258,7 @@ function test_afterEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); afterEach(function () { @@ -266,7 +269,7 @@ function test_afterEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); afterEach(function (done) { @@ -277,7 +280,7 @@ function test_afterEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); afterEach("my description", function () { @@ -287,7 +290,7 @@ function test_afterEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); afterEach("my description", function (done) { @@ -298,7 +301,7 @@ function test_afterEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); } @@ -455,3 +458,44 @@ function test_run_withOnComplete() { function test_throwError() { mocha.throwError(new Error("I'm an error!")); } + +function test_mochaRunner_properties(runner: MochaDef.IRunner, suite: MochaDef.ISuite) { + runner = runner.abort(); + + if (runner.stats !== undefined) { + number = runner.stats.failures; + number = runner.stats.passes; + number = runner.stats.pending; + number = runner.stats.suites; + number = runner.stats.tests; + + dateOrUndefined = runner.stats.start; + dateOrUndefined = runner.stats.end; + dateOrUndefined = runner.stats.duration; + } + + let s: MochaDef.ISuite = runner.suite; + boolean = runner.started; + number = runner.total; + number = runner.failures; + + runner = runner.grep("regex", false); + number = runner.grepTotal(suite); + + let globals: string[] | MochaDef.IRunner= runner.globals(["hello", "world"]); + + runner = runner.run(); + runner = runner.run((f: number) => {}); +} + +function test_base_reporter_properties(reporter: MochaDef.reporters.Base) { + number = reporter.stats.failures; + number = reporter.stats.passes; + number = reporter.stats.pending; + number = reporter.stats.suites; + number = reporter.stats.tests; + + dateOrUndefined = reporter.stats.start; + dateOrUndefined = reporter.stats.end; + dateOrUndefined = reporter.stats.duration; +} \ No newline at end of file diff --git a/types/mocha/tsconfig.json b/types/mocha/tsconfig.json index 43be806414..469634a2f1 100644 --- a/types/mocha/tsconfig.json +++ b/types/mocha/tsconfig.json @@ -6,8 +6,8 @@ "dom" ], "noImplicitAny": true, - "noImplicitThis": false, - "strictNullChecks": false, + "noImplicitThis": true, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mochaccino/tsconfig.json b/types/mochaccino/tsconfig.json index 166b3f4203..a309a1969a 100644 --- a/types/mochaccino/tsconfig.json +++ b/types/mochaccino/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "mochaccino-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/mock-aws-s3/tsconfig.json b/types/mock-aws-s3/tsconfig.json index 9b5aeeacaa..352631ebac 100644 --- a/types/mock-aws-s3/tsconfig.json +++ b/types/mock-aws-s3/tsconfig.json @@ -1,16 +1,24 @@ { "compilerOptions": { "module": "commonjs", - "lib": ["es6"], + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, - "files": ["index.d.ts", "mock-aws-s3-tests.ts"] -} + "files": [ + "index.d.ts", + "mock-aws-s3-tests.ts" + ] +} \ No newline at end of file diff --git a/types/mock-fs/tsconfig.json b/types/mock-fs/tsconfig.json index b460b4d1d1..03b1ec9bf9 100644 --- a/types/mock-fs/tsconfig.json +++ b/types/mock-fs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mock-knex/mock-knex-tests.ts b/types/mock-knex/mock-knex-tests.ts index ec4ef0024e..f9fa69aea1 100644 --- a/types/mock-knex/mock-knex-tests.ts +++ b/types/mock-knex/mock-knex-tests.ts @@ -1,4 +1,4 @@ -import * as knex from "knex"; +import knex = require("knex"); import * as mockDb from "mock-knex"; const db = knex({ diff --git a/types/mock-knex/tsconfig.json b/types/mock-knex/tsconfig.json index 427ad9f843..c06624f84a 100644 --- a/types/mock-knex/tsconfig.json +++ b/types/mock-knex/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "mock-knex-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/mock-raf/tsconfig.json b/types/mock-raf/tsconfig.json index dfb1b63e78..2430cbd74e 100644 --- a/types/mock-raf/tsconfig.json +++ b/types/mock-raf/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mock-require/tsconfig.json b/types/mock-require/tsconfig.json index 1f6be404c6..3cd28faba0 100644 --- a/types/mock-require/tsconfig.json +++ b/types/mock-require/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mockdate/tsconfig.json b/types/mockdate/tsconfig.json index 062a1f1110..a5d4ba452b 100644 --- a/types/mockdate/tsconfig.json +++ b/types/mockdate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mockery/tsconfig.json b/types/mockery/tsconfig.json index a8eef69452..0b91197c4d 100644 --- a/types/mockery/tsconfig.json +++ b/types/mockery/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mockjs/tsconfig.json b/types/mockjs/tsconfig.json index 631ad48210..6a407840b6 100644 --- a/types/mockjs/tsconfig.json +++ b/types/mockjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/modernizr/tsconfig.json b/types/modernizr/tsconfig.json index 291b4008d2..5a57efda40 100644 --- a/types/modernizr/tsconfig.json +++ b/types/modernizr/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/modesl/tsconfig.json b/types/modesl/tsconfig.json index 3fc91a7f71..9454dd9a5a 100644 --- a/types/modesl/tsconfig.json +++ b/types/modesl/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/moji/tsconfig.json b/types/moji/tsconfig.json index a6b2e51f26..f529d10796 100644 --- a/types/moji/tsconfig.json +++ b/types/moji/tsconfig.json @@ -1,24 +1,25 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es6", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true + "module": "commonjs", + "target": "es6", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ - "index.d.ts", - "moji-tests.ts" + "index.d.ts", + "moji-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/moment-business-time/tsconfig.json b/types/moment-business-time/tsconfig.json index c1212caa2f..06211c3c46 100644 --- a/types/moment-business-time/tsconfig.json +++ b/types/moment-business-time/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "moment-business-time-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/moment-business/tsconfig.json b/types/moment-business/tsconfig.json index b7307b4121..2f206c8966 100644 --- a/types/moment-business/tsconfig.json +++ b/types/moment-business/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/moment-duration-format/index.d.ts b/types/moment-duration-format/index.d.ts index 402db8a75b..4506311ab6 100644 --- a/types/moment-duration-format/index.d.ts +++ b/types/moment-duration-format/index.d.ts @@ -1,7 +1,11 @@ -// Type definitions for moment-duration-format 1.3 +// Type definitions for moment-duration-format 2.2 // Project: https://github.com/jsmreese/moment-duration-format -// Definitions by: Swint De Coninck , Niklas Walter , Leonard Thieu +// Definitions by: Swint De Coninck +// Niklas Walter +// Leonard Thieu +// Lukasz Bendykowski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import * as moment from "moment"; @@ -22,33 +26,66 @@ declare module "moment" { (settings?: DurationFormatSettings): string; } + type UnitOfTrimV1 = 'left' | 'right'; + type UnitOfTrim = ( + 'large' | 'small' | 'both' | + 'mid' | 'all' | 'final' + ); + interface DurationFormatSettings { - escape?: RegExp; - years?: RegExp; - months?: RegExp; - weeks?: RegExp; - days?: RegExp; - hours?: RegExp; - minutes?: RegExp; - seconds?: RegExp; - milliseconds?: RegExp; - general?: RegExp; + trim?: false | UnitOfTrimV1 | UnitOfTrim | string | Array; + largest?: number; + trunc?: true; + stopTrim?: string; - types?: string; + minValue?: number; + maxValue?: number; - // "left" - template tokens are trimmed from the left until the first moment token that has a value >= 1 - // "right" - template tokens are trimmed from the right until the first moment token that has a value >= 1 - // (the final moment token is not trimmed, regardless of value) - // `false` - template tokens are not trimmed - trim?: 'left' | 'right' | false; - - // number of decimal digits to include after (to the right of) the decimal point (positive integer) - // or the number of digits to truncate to 0 before (to the left of) the decimal point (negative integer) + useGrouping?: boolean; precision?: number; + decimalSeparator?: string; + groupingSeparator?: string; + grouping?: number[]; - // force first moment token with a value to render at full length even when template is trimmed and first moment token has length of 1 - forceLength?: boolean | null; + useSignificantDigits?: true; + + forceLength?: boolean; template?: string | TemplateFunction; + + userLocale?: string; + usePlural?: boolean; + useLeftUnits?: boolean; + useToLocaleString?: boolean; + } + + type DurationLabelType = "long" | "standard" | "short"; + type DurationTemplate = "HMS" | "HM" | "MS"; + type DurationToken = ( + "S" | "SS" | "SSS" | + "s" | "ss" | "sss" | + "m" | "mm" | "mmm" | + "h" | "hh" | "hhh" | + "d" | "dd" | "ddd" | + "w" | "ww" | "www" | + "M" | "MM" | "MMM" | + "y" | "yy" | "yyy" + ); + + type DurationLabelDef = {[duration in DurationToken]: string}; + type DurationTimeDef = {[template in DurationTemplate]: string}; + + interface DurationLabelTypeDef { + type: DurationLabelType; + string: string; + } + + interface LocaleSpecification { + durationLabelsLong: DurationLabelDef; + durationLabelsStandard: DurationLabelDef; + durationLabelsShort: DurationLabelDef; + durationTimeTemplates: DurationTimeDef; + durationLabelTypes: DurationLabelTypeDef[]; + durationPluralKey: (token: string, integerValue: number, decimalValue: number) => string; } type TemplateFunction = ((this: DurationFormatSettings) => string); diff --git a/types/moment-duration-format/moment-duration-format-tests.ts b/types/moment-duration-format/moment-duration-format-tests.ts index 52f313b9b4..135131ce71 100644 --- a/types/moment-duration-format/moment-duration-format-tests.ts +++ b/types/moment-duration-format/moment-duration-format-tests.ts @@ -43,30 +43,333 @@ moment.duration(123, "seconds").format("hh:mm:ss"); moment.duration(123, "seconds").format("h:mm:ss", { forceLength: true }); // "02:03" -moment.duration.fn.format.defaults.escape = /\((.+?)\)/; -moment.duration(123, "seconds").format("m (minutes)", 2); -// "2.04 minutes" +moment.duration(123, "minutes").format("d[d] h:mm:ss"); +// "2:03:00" -moment.duration.fn.format.defaults.years = /[Aa]+/; -moment.duration(123, "weeks").format("a [años]", 2); -// "2.35 años" +moment.duration(123, "minutes").format("s [seconds], m [minutes], h [hours], d [days]"); +// "0 seconds, 3 minutes, 2 hours" -moment.duration.fn.format.defaults.months = /m+/; -moment.duration(123, "weeks").format("m M", 2); -// "28.36 M" +moment.duration(123, "minutes").format("d[d] h:mm:ss", { + trim: false +}); +// "0d 2:03:00" -moment.duration.fn.format.defaults.weeks = /w+/; -moment.duration(123, "days").format("w W", 2); -// "17.57 W" +moment.duration(123, "minutes").format("d[d] h:mm:ss"); +// "2:03:00" -moment.duration.fn.format.defaults.days = /d+/; -moment.duration(123, "hours").format("d D", 2); -// "5.12 D" +moment.duration(123, "minutes").format("d[d] h:mm:ss", { + trim: "large" +}); +// "2:03:00" -moment.duration.fn.format.defaults.hours = /h+/; -moment.duration(123, "minutes").format("h H", 2); -// "2.04 H" +moment.duration(0, "minutes").format("d[d] h:mm:ss", { + trim: "large" +}); +// "0" -moment.duration.fn.format.defaults.minutes = /n+/; -moment.duration(123, "seconds").format("n:ss"); +moment.duration(123, "minutes").format("d[d] h:mm:ss", { + trim: "small" +}); +// "0d 2:03" + +moment.duration(0, "minutes").format("d[d] h:mm:ss", { + trim: "small" +}); +// "0d" + +moment.duration(123, "minutes").format("d[d] h[h] m[m] s[s]", { + trim: "both" +}); +// "2h 3m" + +moment.duration(0, "minutes").format("d[d] h[h] m[m] s[s]", { + trim: "both" +}); +// "0s" + +moment.duration(1441, "minutes").format("w[w] d[d] h[h] m[m] s[s]", { + trim: "mid" +}); +// "0w 1d 1m 0s" + +moment.duration(1441, "minutes").format("w[w] d[d] h[h] m[m] s[s]", { + trim: "large mid" +}); +// "1d 1m 0s" + +moment.duration(1441, "minutes").format("w[w] d[d] h[h] m[m] s[s]", { + trim: "small mid" +}); +// "0w 1d 1m" + +moment.duration(1441, "minutes").format("w[w] d[d] h[h] m[m] s[s]", { + trim: "both mid" +}); +// "1d 1m" + +moment.duration(0, "minutes").format("w[w] d[d] h[h] m[m] s[s]", { + trim: "both mid" +}); +// "0s" + +moment.duration(0, "minutes").format("d[d] h:mm:ss", { + trim: "large final" +}); +// "" + +moment.duration(0, "minutes").format("d[d] h:mm:ss", { + trim: "small final" +}); +// "" + +moment.duration(0, "minutes").format("d[d] h[h] m[m] s[s]", { + trim: "both final" +}); +// "" + +moment.duration(0, "minutes").format("d[d] h[h] m[m] s[s]", { + trim: "all" +}); +// "" + +moment.duration(7322, "seconds").format("d [days], h [hours], m [minutes], s [seconds]", { + largest: 2 +}); +// "2 hours, 2 minutes" + +moment.duration(1216922, "seconds").format("y [years], w [weeks], d [days], h [hours], m [minutes], s [seconds]", { + largest: 2 +}); +// "2 weeks, 2 hours" + +moment.duration(23, "minutes").format("d[d] h:mm:ss", { + stopTrim: "h" +}); +// "0:23:00" + +moment.duration(23, "minutes").format("d[d] *h:mm:ss"); +// "0:23:00" + +moment.duration(2, "hours").format("y [years], d [days], h [hours], m [minutes], s [seconds]", { + trim: "both", + stopTrim: "d m" +}); +// "0 days, 2 hours, 0 minutes" + +moment.duration(2, "hours").format("y [years], *d [days], h [hours], *m [minutes], s [seconds]", { + trim: "both" +}); +// "0 days, 2 hours, 0 minutes" + +moment.duration(2, "hours").format("y [years], d [days], h [hours], m [minutes], s [seconds]", { + trim: "both", + stopTrim: "d m", + largest: 2 +}); +// "2 hours" + +moment.duration(179, "seconds").format("m [minutes]"); +// "3 minutes" + +moment.duration(3780, "seconds").format("h [hours]", 1); +// "1.1 hours" + +moment.duration(179, "seconds").format("m [minutes]", { + trunc: true +}); +// "2 minutes" + +moment.duration(3780, "seconds").format("h [hours]", 1, { + trunc: true +}); +// "1.0 hours" + +moment.duration(59, "seconds").format("d [days], h [hours], m [minutes]", { + trunc: true, + trim: "both" +}); +// "0 minutes" + +moment.duration(59, "seconds").format("d [days], h [hours], m [minutes]", { + trunc: true, + trim: "all" +}); +// "" + +moment.duration(59, "seconds").format("d [days], h [hours], m [minutes]", { + trunc: true, + largest: 1 +}); +// "" + +moment.duration(59, "seconds").format("h [hours], m [minutes]", { + minValue: 1 +}); +// "< 1 minute" + +moment.duration(59, "seconds").format("h [hours], m [minutes]", { + minValue: 1, + trim: "both" +}); +// "< 1 minute" + +moment.duration(7229, "seconds").format("h [hours], m [minutes]", { + minValue: 1, + trim: "both" +}); +// "2 hours" + +moment.duration(59, "seconds").format("h [hours], m [minutes]", { + minValue: 1, + trunc: true, + trim: "all" +}); +// "" + +moment.duration(-59, "seconds").format("h [hours], m [minutes]", { + minValue: 1 +}); +// "> -1 minute" + +moment.duration(59, "seconds").format("h [hours], m [minutes]", { + minValue: 1, + trim: false, + largest: 2 +}); +// "< 1 minute" + +moment.duration(15, "days").format("w [weeks]", { + maxValue: 2 +}); +// "> 2 weeks" + +moment.duration(-15, "days").format("w [weeks]]", { + maxValue: 2 +}); +// "< -2 weeks" + +moment.duration(15, "days").format("w [weeks], d [days]", { + maxValue: 2, + trim: false, + largest: 2 +}); +// "> 2 weeks" + +moment.duration(123, "seconds").format("h:mm:ss"); // "2:03" + +moment.duration(123, "seconds").format("hh:mm:ss"); +// "02:03" + +moment.duration(123, "seconds").format("h:mm:ss", { + forceLength: true +}); +// "02:03" + +moment.duration(99999, "seconds").format("d [days], h [hours], m [minutes], s [seconds]", { + useSignificantDigits: true, + precision: 3 +}); +// "1 day, 3 hours, 50 minutes" + +moment.duration(99999, "seconds").format("d [days], h [hours], m [minutes], s [seconds]", { + useSignificantDigits: true, + precision: 3, + trunc: true +}); +// "1 day, 3 hours, 40 minutes" + +moment.duration(99999, "seconds").format("d [days], h [hours], m [minutes], s [seconds]", { + useSignificantDigits: true, + precision: 5 +}); +// "1 day, 3 hours, 46 minutes, 40 seconds" + +moment.duration(99999, "seconds").format("d [days], h [hours], m [minutes], s [seconds]", { + useSignificantDigits: true, + trunc: true, + precision: 5 +}); +// "1 day, 3 hours, 46 minutes, 30 seconds" + +moment.duration(99999, "seconds").format("d [days], h [hours], m [minutes], s [seconds]", { + useSignificantDigits: true, + precision: 6 +}); +// "1 day, 3 hours, 46 minutes, 39 seconds" + +moment.duration(1234567, "seconds").format("m [minutes]", 3); +// "20,576.117 minutes" + +moment.duration(1234567, "seconds").format("m [minutes]", 3, { + userLocale: "de-DE" +}); +// "20.576,117 minutes" + +moment.duration(2, "minutes").format("m _"); +// "2 mins" + +moment.duration(2, "minutes").format("m __"); +// "2 minutes" + +moment.duration(3661, "seconds").format("_HMS_"); +// "1:01:01" + +moment.duration(3661, "seconds").format("_HM_"); +// "1:01" + +moment.duration(61, "seconds").format("_MS_"); +// "1:01" + +moment.duration(1, "minutes").format("m [minutes]"); +// "1 minute" + +moment.duration(1, "minutes").format("m [mins]"); +// "1 min" + +moment.duration(2, "minutes").format("m [minute]"); +// "2 minutes" + +moment.duration(2, "minutes").format("m [min]"); +// "2 mins" + +moment.duration(1, "minutes").format("m [minutes]", { + usePlural: false +}); +// "1 minutes" + +moment.duration(1, "minutes").format("m [mins]", { + usePlural: false +}); +// "1 mins" + +moment.duration(2, "minutes").format("m [minute]", { + usePlural: false +}); +// "2 minute" + +moment.duration(2, "minutes").format("m [min]", { + usePlural: false +}); +// "2 min" + +moment.duration(1, "minutes").format("m [minutes]", 2); +// "1.00 minutes" + +moment.duration(7322, "seconds").format("_ h, _ m, _ s", { + useLeftUnits: true +}); +// "hrs 2, mins 2, secs 2" + +moment.duration(1234, "seconds").format("s [seconds]"); +// "1,234 seconds" + +moment.duration(1234, "seconds").format("s [seconds]", { + useGrouping: false +}); +// "1234 seconds" + +moment.duration(1234567, "seconds").format("m [minutes]", 3, { + userLocale: "de-DE" +}); +// "20.576,117 minutes" diff --git a/types/moment-duration-format/tsconfig.json b/types/moment-duration-format/tsconfig.json index 997b0f907e..49adb2a08e 100644 --- a/types/moment-duration-format/tsconfig.json +++ b/types/moment-duration-format/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/moment-holiday/tsconfig.json b/types/moment-holiday/tsconfig.json index d03f37e12c..886bd77564 100644 --- a/types/moment-holiday/tsconfig.json +++ b/types/moment-holiday/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "moment-holiday-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/moment-jalaali/tsconfig.json b/types/moment-jalaali/tsconfig.json index 6c52d43cbf..4d2026fec3 100644 --- a/types/moment-jalaali/tsconfig.json +++ b/types/moment-jalaali/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/moment-range/tsconfig.json b/types/moment-range/tsconfig.json index 1da3b569e0..aa339a6027 100644 --- a/types/moment-range/tsconfig.json +++ b/types/moment-range/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/moment-round/tsconfig.json b/types/moment-round/tsconfig.json index f6761bd247..13758cbc39 100644 --- a/types/moment-round/tsconfig.json +++ b/types/moment-round/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/moment-strftime2/tsconfig.json b/types/moment-strftime2/tsconfig.json index cd5862e99f..c4c30990bd 100644 --- a/types/moment-strftime2/tsconfig.json +++ b/types/moment-strftime2/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "moment-strftime2-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/moment-timezone/index.d.ts b/types/moment-timezone/index.d.ts index c3927415c6..da5e42bc2d 100644 --- a/types/moment-timezone/index.d.ts +++ b/types/moment-timezone/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Michel Salib , Alan Brazil Lins // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import * as moment from 'moment'; +import moment = require('moment'); // require("moment-timezone") === require("moment") export = moment; diff --git a/types/moment-timezone/tsconfig.json b/types/moment-timezone/tsconfig.json index 62cbfb4214..16a786e080 100644 --- a/types/moment-timezone/tsconfig.json +++ b/types/moment-timezone/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index ae52d70e14..dd4f44f38a 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -31,7 +31,7 @@ export class MongoClient extends EventEmitter { static connect(uri: string, callback: MongoCallback): void; static connect(uri: string, options?: MongoClientOptions): Promise; static connect(uri: string, options: MongoClientOptions, callback: MongoCallback): void; - /** + /** * @deprecated * http://mongodb.github.io/node-mongodb-native/3.0/api/MongoClient.html#connect */ @@ -92,6 +92,8 @@ export interface MongoClientOptions extends logger?: Object; // Default: false; validateOptions?: Object; + // The name of the application that created this MongoClient instance. + appname?: string; } export interface SSLOptions { @@ -629,6 +631,8 @@ export interface Collection { updateOne(filter: Object, update: Object, callback: MongoCallback): void; updateOne(filter: Object, update: Object, options?: ReplaceOneOptions): Promise; updateOne(filter: Object, update: Object, options: ReplaceOneOptions, callback: MongoCallback): void; + /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#watch */ + watch(pipeline?: Object[], options?: ChangeStreamOptions & { session?: ClientSession }): ChangeStream; } // Documentation: http://docs.mongodb.org/manual/reference/command/collStats/ @@ -830,7 +834,7 @@ export interface CollectionAggregationOptions { collation?: Object; comment?: string session?: ClientSession; - + } /** http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#insertMany */ @@ -1353,7 +1357,7 @@ export class GridFSBucket { /** http://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucket.html#openUploadStream */ openUploadStream(filename: string, options?: GridFSBucketOpenUploadStreamOptions): GridFSBucketWriteStream; /** http://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucket.html#openUploadStreamWithId */ - openUploadStreamWithId(id: string | number | Object, filename: string, options?: GridFSBucketOpenUploadStreamOptions): GridFSBucketWriteStream; + openUploadStreamWithId(id: GridFSBucketWriteStreamId, filename: string, options?: GridFSBucketOpenUploadStreamOptions): GridFSBucketWriteStream; /** http://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucket.html#rename */ rename(id: ObjectID, filename: string, callback?: GridFSBucketErrorCallback): void; } @@ -1391,6 +1395,7 @@ export interface GridFSBucketOpenUploadStreamOptions { /** https://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucketReadStream.html */ export class GridFSBucketReadStream extends Readable { + id: ObjectID; constructor(chunks: Collection, files: Collection, readPreference: Object, filter: Object, options?: GridFSBucketReadStreamOptions); } @@ -1404,14 +1409,95 @@ export interface GridFSBucketReadStreamOptions { /** https://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucketWriteStream.html */ export class GridFSBucketWriteStream extends Writable { + id: GridFSBucketWriteStreamId; constructor(bucket: GridFSBucket, filename: string, options?: GridFSBucketWriteStreamOptions); } /** https://mongodb.github.io/node-mongodb-native/3.0/api/GridFSBucketWriteStream.html */ export interface GridFSBucketWriteStreamOptions { - id?: string | number | Object, + id?: GridFSBucketWriteStreamId, chunkSizeBytes?: number, w?: number, wtimeout?: number, j?: number } + +/** http://mongodb.github.io/node-mongodb-native/3.0/api/ChangeStream.html */ +export class ChangeStream extends Readable { + constructor(changeDomain: Db | Collection, pipeline: Object[], options?: ChangeStreamOptions); + + /** http://mongodb.github.io/node-mongodb-native/3.0/api/ChangeStream.html#close */ + close(): Promise; + close(callback: MongoCallback): void; + + /** http://mongodb.github.io/node-mongodb-native/3.0/api/ChangeStream.html#hasNext */ + hasNext(): Promise; + hasNext(callback: MongoCallback): void; + + /** http://mongodb.github.io/node-mongodb-native/3.0/api/ChangeStream.html#isClosed */ + isClosed(): boolean; + + /** http://mongodb.github.io/node-mongodb-native/3.0/api/ChangeStream.html#next */ + next(): Promise; + next(callback: MongoCallback): void; + + /** http://mongodb.github.io/node-mongodb-native/3.0/api/ChangeStream.html#stream */ + stream(options?: { transform: Function }): Cursor; +} + +export interface ChangeStreamOptions { + fullDocument?: string; + maxAwaitTimeMS?: number; + resumeAfter?: Object; + batchSize?: number; + collation?: Object; + readPreference?: ReadPreference; +} + +type GridFSBucketWriteStreamId = string | number | Object | ObjectID; + +export interface LoggerOptions { + loggerLevel?: string // Custom logger function + logger?: log // Override default global log level. +} + +export type log = (message?: string, state?: LoggerState) => void + +export interface LoggerState { + type: string + message: string + className: string + pid: number + date: number +} + +/** http://mongodb.github.io/node-mongodb-native/3.0/api/Logger.html */ +export class Logger{ + constructor(className: string, options?: LoggerOptions) + // Log a message at the debug level + debug(message: string, state: LoggerState):void + // Log a message at the warn level + warn(message: string, state: LoggerState):void + // Log a message at the info level + info(message: string, state: LoggerState):void + // Log a message at the error level + error(message: string, state: LoggerState):void + // Is the logger set at info level + isInfo():boolean + // Is the logger set at error level + isError():boolean + // Is the logger set at error level + isWarn():boolean + // Is the logger set at debug level + isDebug():boolean + // Resets the logger to default settings, error and no filtered classes + static reset():void + // Get the current logger function + static currentLogger():log + //Set the current logger function + static setCurrentLogger(log: log):void + // Set what classes to log. + static filter(type: string, values: string[]):void + // Set the current log level + static setLevel(level: string):void +} diff --git a/types/mongodb/tsconfig.json b/types/mongodb/tsconfig.json index 8ed16ed7e6..b5c0a3c5de 100644 --- a/types/mongodb/tsconfig.json +++ b/types/mongodb/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongodb/v1/tsconfig.json b/types/mongodb/v1/tsconfig.json index c20dfaa9c6..e082a3d12e 100644 --- a/types/mongodb/v1/tsconfig.json +++ b/types/mongodb/v1/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongodb/v2/index.d.ts b/types/mongodb/v2/index.d.ts index 6cf21c04b9..ec3e3965ba 100644 --- a/types/mongodb/v2/index.d.ts +++ b/types/mongodb/v2/index.d.ts @@ -1371,7 +1371,7 @@ export class GridFSBucket { // http://mongodb.github.io/node-mongodb-native/2.1/api/GridFSBucket.html#openUploadStream openUploadStream(filename: string, options?: GridFSBucketOpenUploadStreamOptions): GridFSBucketWriteStream; // http://mongodb.github.io/node-mongodb-native/2.1/api/GridFSBucket.html#openUploadStreamWithId - openUploadStreamWithId(id: string | number | Object, filename: string, options?: GridFSBucketOpenUploadStreamOptions): GridFSBucketWriteStream; + openUploadStreamWithId(id: GridFSBucketWriteStreamId, filename: string, options?: GridFSBucketOpenUploadStreamOptions): GridFSBucketWriteStream; // http://mongodb.github.io/node-mongodb-native/2.1/api/GridFSBucket.html#rename rename(id: ObjectID, filename: string, callback?: GridFSBucketErrorCallback): void; } @@ -1409,6 +1409,7 @@ export interface GridFSBucketOpenUploadStreamOptions { // https://mongodb.github.io/node-mongodb-native/2.1/api/GridFSBucketReadStream.html export class GridFSBucketReadStream extends Readable { + id: ObjectID; constructor(chunks: Collection, files: Collection, readPreference: Object, filter: Object, options?: GridFSBucketReadStreamOptions); } @@ -1422,14 +1423,17 @@ export interface GridFSBucketReadStreamOptions { // https://mongodb.github.io/node-mongodb-native/2.1/api/GridFSBucketWriteStream.html export class GridFSBucketWriteStream extends Writable { + id: GridFSBucketWriteStreamId; constructor(bucket: GridFSBucket, filename: string, options?: GridFSBucketWriteStreamOptions); } // https://mongodb.github.io/node-mongodb-native/2.1/api/GridFSBucketWriteStream.html export interface GridFSBucketWriteStreamOptions { - id?: string | number | Object, + id?: GridFSBucketWriteStreamId, chunkSizeBytes?: number, w?: number, wtimeout?: number, j?: number } + +type GridFSBucketWriteStreamId = string | number | Object | ObjectID; diff --git a/types/mongodb/v2/tsconfig.json b/types/mongodb/v2/tsconfig.json index 7bfc92fc32..34cee3be18 100644 --- a/types/mongodb/v2/tsconfig.json +++ b/types/mongodb/v2/tsconfig.json @@ -19,7 +19,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose-auto-increment/tsconfig.json b/types/mongoose-auto-increment/tsconfig.json index faef447b4d..451044e5e6 100644 --- a/types/mongoose-auto-increment/tsconfig.json +++ b/types/mongoose-auto-increment/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose-deep-populate/tsconfig.json b/types/mongoose-deep-populate/tsconfig.json index eb2e278299..6f3c2c0a9a 100644 --- a/types/mongoose-deep-populate/tsconfig.json +++ b/types/mongoose-deep-populate/tsconfig.json @@ -12,9 +12,15 @@ "typeRoots": [ "../" ], + "paths": { + "mongoose": [ + "mongoose/v4" + ] + }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose-geojson-schema/tsconfig.json b/types/mongoose-geojson-schema/tsconfig.json index 9d3afc8952..4a9b4ef787 100644 --- a/types/mongoose-geojson-schema/tsconfig.json +++ b/types/mongoose-geojson-schema/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "mongoose-geojson-schema-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/mongoose-mock/tsconfig.json b/types/mongoose-mock/tsconfig.json index b3cacf1757..8555533c01 100644 --- a/types/mongoose-mock/tsconfig.json +++ b/types/mongoose-mock/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose-paginate/mongoose-paginate-tests.ts b/types/mongoose-paginate/mongoose-paginate-tests.ts index d541c44da8..320077bc3a 100644 --- a/types/mongoose-paginate/mongoose-paginate-tests.ts +++ b/types/mongoose-paginate/mongoose-paginate-tests.ts @@ -1,5 +1,3 @@ -/// - /** * Created by Linus Brolin . */ @@ -12,7 +10,7 @@ import { PaginateResult, Document } from 'mongoose'; -import * as mongoosePaginate from 'mongoose-paginate'; +import mongoosePaginate = require('mongoose-paginate'); import { Router, Request, Response } from 'express'; diff --git a/types/mongoose-paginate/tsconfig.json b/types/mongoose-paginate/tsconfig.json index 3194368f11..c7d7fccdcc 100644 --- a/types/mongoose-paginate/tsconfig.json +++ b/types/mongoose-paginate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose-promise/tsconfig.json b/types/mongoose-promise/tsconfig.json index 68c68b35a1..1116f1ca84 100644 --- a/types/mongoose-promise/tsconfig.json +++ b/types/mongoose-promise/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose-seeder/tsconfig.json b/types/mongoose-seeder/tsconfig.json index d5d44b75cc..7b4ef1eaa1 100644 --- a/types/mongoose-seeder/tsconfig.json +++ b/types/mongoose-seeder/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose-sequence/mongoose-sequence-tests.ts b/types/mongoose-sequence/mongoose-sequence-tests.ts index b4173e0002..85c46633e0 100644 --- a/types/mongoose-sequence/mongoose-sequence-tests.ts +++ b/types/mongoose-sequence/mongoose-sequence-tests.ts @@ -1,12 +1,10 @@ -/// - /** * Based on the examples on: https://github.com/ramiel/mongoose-sequence * Created by Linus Brolin . */ import { SequenceDocument, SequenceOptions, SequenceSchema, Document, Schema, Model, model } from 'mongoose'; -import * as mongooseSequence from 'mongoose-sequence'; +import mongooseSequence = require('mongoose-sequence'); //#region Test Models interface User extends SequenceDocument { diff --git a/types/mongoose-sequence/tsconfig.json b/types/mongoose-sequence/tsconfig.json index 79efa97e34..e9e23837ed 100644 --- a/types/mongoose-sequence/tsconfig.json +++ b/types/mongoose-sequence/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose-simple-random/mongoose-simple-random-tests.ts b/types/mongoose-simple-random/mongoose-simple-random-tests.ts index f5b26dbebb..1ed3051652 100644 --- a/types/mongoose-simple-random/mongoose-simple-random-tests.ts +++ b/types/mongoose-simple-random/mongoose-simple-random-tests.ts @@ -1,5 +1,5 @@ import * as mongoose from 'mongoose'; -import * as mongoose_simple_random from "mongoose-simple-random"; +import mongoose_simple_random = require("mongoose-simple-random"); // test compatibility with other libraries - from @types/mongoose import * as _ from 'lodash'; diff --git a/types/mongoose-simple-random/tsconfig.json b/types/mongoose-simple-random/tsconfig.json index 3b879fd8f0..7c2f108e9e 100644 --- a/types/mongoose-simple-random/tsconfig.json +++ b/types/mongoose-simple-random/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose-unique-validator/mongoose-unique-validator-tests.ts b/types/mongoose-unique-validator/mongoose-unique-validator-tests.ts index 59ada92a3c..ded6f76ae4 100644 --- a/types/mongoose-unique-validator/mongoose-unique-validator-tests.ts +++ b/types/mongoose-unique-validator/mongoose-unique-validator-tests.ts @@ -1,5 +1,5 @@ import { Schema } from "mongoose"; -import * as uniqueValidator from "mongoose-unique-validator"; +import uniqueValidator = require("mongoose-unique-validator"); const schema = new Schema({ test: { type: String } diff --git a/types/mongoose-unique-validator/tsconfig.json b/types/mongoose-unique-validator/tsconfig.json index 02d461889d..8ab3ec79c9 100644 --- a/types/mongoose-unique-validator/tsconfig.json +++ b/types/mongoose-unique-validator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 3e676b499f..3cf4e4ca2a 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for Mongoose 4.7.1 +// Type definitions for Mongoose 5.0.1 // Project: http://mongoosejs.com/ -// Definitions by: simonxca , horiuchi , sindrenm , lukasz-zak +// Definitions by: simonxca , horiuchi , sindrenm , lukasz-zak , Alorel // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -25,45 +25,6 @@ * changes just copy/paste them into here. * - Check the files off as you go. Some files below might not have anything in them. That's ok, this * is just a simple heuristic to keep track of our progress. - * - * TODO for version 4.x [updated][tested]: - * [x][x] index.js - * [x][x] querystream.js - * [x][x] connection.js - * [x][x] utils.js - * [x][x] browser.js - * [x][x] drivers/node-mongodb-native/collection.js - * [x][x] drivers/node-mongodb-native/connection.js - * [x][x] error/messages.js - * [x][x] error/validation.js - * [x][x] error.js - * [x][x] querycursor.js - * [x][x] virtualtype.js - * [x][x] schema.js - * [x][x] document.js - * [x][x] types/subdocument.js - * [x][x] types/array.js - * [x][x] types/documentarray.js - * [x][x] types/buffer.js - * [x][x] types/objectid.js - * [x][x] types/embedded.js - * [x][x] query.js - * [x][x] schema/array.js - * [x][x] schema/string.js - * [x][x] schema/documentarray.js - * [x][x] schema/number.js - * [x][x] schema/date.js - * [x][x] schema/buffer.js - * [x][x] schema/boolean.js - * [x][x] schema/objectid.js - * [x][x] schema/mixed.js - * [x][x] schema/embedded.js - * [x][x] aggregate.js - * [x][x] schematype.js - * [x][x] promise.js - * [x][x] ES6Promise.js - * [x][x] model.js - * [x][x] collection.js */ /* @@ -80,6 +41,9 @@ declare module "mongoose" { import stream = require('stream'); import mongoose = require('mongoose'); + /** Pluralises the given name */ + export function pluralize(str: string): string; + /* * Some mongoose classes have the same name as the native JS classes * Keep references to native classes using a "Native" prefix @@ -99,7 +63,7 @@ declare module "mongoose" { export var SchemaTypes: typeof Schema.Types; /** Expose connection states for user-land */ - export var STATES: Object; + export var STATES: any; /** The default connection of the mongoose module. */ export var connection: Connection; /** The node-mongodb-native driver Mongoose uses. */ @@ -112,11 +76,9 @@ declare module "mongoose" { * Options passed take precedence over options included in connection strings. * @returns pseudo-promise wrapper around this */ - export function connect(uris: string, - options?: ConnectionOptions, - callback?: (err: mongodb.MongoError) => void): MongooseThenable; - export function connect(uris: string, - callback?: (err: mongodb.MongoError) => void): MongooseThenable; + export function connect(uris: string, options: ConnectionOptions, callback: (err: mongodb.MongoError) => void): null; + export function connect(uris: string, callback: (err: mongodb.MongoError) => void): null; + export function connect(uris: string, options?: ConnectionOptions): Promise; /** * Creates a Connection instance. @@ -130,16 +92,14 @@ declare module "mongoose" { export function createConnection(uri: string, options?: ConnectionOptions ): Connection; - export function createConnection(host: string, database_name: string, port?: number, - options?: ConnectionOptions - ): Connection; /** * Disconnects all connections. * @param fn called after all connection close. - * @returns pseudo-promise wrapper around this */ - export function disconnect(fn?: (error: any) => void): MongooseThenable; + export function disconnect(fn: (error?: any) => void): null; + /** Disconnects all connections. */ + export function disconnect(): Promise; /** Gets mongoose options */ export function get(key: string): any; @@ -173,26 +133,11 @@ declare module "mongoose" { * @param fn plugin callback * @param opts optional options */ - export function plugin(fn: Function, opts?: Object): typeof mongoose; + export function plugin(fn: Function, opts?: any): typeof mongoose; /** Sets mongoose options */ export function set(key: string, value: any): void; - type MongooseThenable = typeof mongoose & { - /** - * Ability to use mongoose object as a pseudo-promise so .connect().then() - * and .disconnect().then() are viable. - */ - then(onFulfill?: () => void | TRes | PromiseLike, - onRejected?: (err: mongodb.MongoError) => void | TRes | PromiseLike): Promise; - - /** - * Ability to use mongoose object as a pseudo-promise so .connect().then() - * and .disconnect().then() are viable. - */ - catch(onRejected?: (err: mongodb.MongoError) => void | TRes | PromiseLike): Promise; - } - class CastError extends Error { /** * The Mongoose CastError constructor @@ -204,49 +149,6 @@ declare module "mongoose" { constructor(type: string, value: any, path: string, reason?: NativeError); } - /* - * section querystream.js - * http://mongoosejs.com/docs/api.html#querystream-js - * - * QueryStream can only be accessed using query#stream(), we only - * expose its interface here. - */ - interface QueryStream extends stream.Stream { - /** - * Provides a Node.js 0.8 style ReadStream interface for Queries. - * @event data emits a single Mongoose document - * @event error emits when an error occurs during streaming. This will emit before the close event. - * @event close emits when the stream reaches the end of the cursor or an error occurs, or the stream - * is manually destroyed. After this event, no more events are emitted. - */ - constructor(query: Query, options?: { - /** - * optional function which accepts a mongoose document. The return value - * of the function will be emitted on data. - */ - transform?: Function; - [other: string]: any; - }): QueryStream; - - /** - * Destroys the stream, closing the underlying cursor, which emits the close event. - * No more events will be emitted after the close event. - */ - destroy(err?: NativeError): void; - - /** Pauses this stream. */ - pause(): void; - /** Pipes this query stream into another stream. This method is inherited from NodeJS Streams. */ - pipe(destination: T, options?: { end?: boolean; }): T; - /** Resumes this stream. */ - resume(): void; - - /** Flag stating whether or not this stream is paused. */ - paused: boolean; - /** Flag stating whether or not this stream is readable. */ - readable: boolean; - } - /* * section connection.js * http://mongoosejs.com/docs/api.html#connection-js @@ -288,7 +190,13 @@ declare module "mongoose" { options?: ConnectionOpenOptions, callback?: (err: any) => void): any; /** Helper for dropDatabase() */ - dropDatabase(callback?: (err: any) => void): Promise; + dropDatabase(callback?: (err: any) => void): Promise; + + /** Helper for creating a collection */ + createCollection(name: string, options?: mongodb.CollectionCreateOptions, cb?: (err: any, collection: mongodb.Collection) => void): Promise; + + /** Helper for dropCollection() */ + dropCollection(name: string, callback?: (err: any) => void): Promise; /** * Opens the connection to a replica set. @@ -308,7 +216,7 @@ declare module "mongoose" { * @param name name of the collection * @param options optional collection options */ - collection(name: string, options?: Object): Collection; + collection(name: string, options?: any): Collection; /** * Defines or retrieves a model. @@ -332,7 +240,7 @@ declare module "mongoose" { modelNames(): string[]; /** A hash of the global options that are associated with this connection */ - config: Object; + config: any; /** The mongodb.Db instance, set when the connection is opened */ db: mongodb.Db; @@ -445,6 +353,9 @@ declare module "mongoose" { /** See http://mongoosejs.com/docs/connections.html#use-mongo-client **/ useMongoClient?: boolean; + + /** See http://mongoosejs.com/docs/guide.html#bufferCommands */ + bufferCommands?: boolean; } interface ConnectionOptions extends @@ -463,7 +374,7 @@ declare module "mongoose" { * @param conn A MongooseConnection instance * @param opts optional collection options */ - new(name: string, conn: Connection, opts?: Object): Collection; + new(name: string, conn: Connection, opts?: any): Collection; /** Formatter for debug print args */ $format(arg: any): string; /** Debug print helper */ @@ -485,7 +396,7 @@ declare module "mongoose" { useDb(name: string): Connection; /** Expose the possible connection states. */ - static STATES: Object; + static STATES: any; } /* @@ -517,10 +428,10 @@ declare module "mongoose" { * {MIN} is replaced with the declared min value for the Number.min validator * {MAX} is replaced with the declared max value for the Number.max validator */ - static messages: Object; + static messages: any; /** For backwards compatibility. Same as mongoose.Error.messages */ - static Messages: Object; + static Messages: any; } interface EachAsyncOptions { @@ -550,7 +461,7 @@ declare module "mongoose" { * @event data Emitted when the stream is flowing and the next doc is ready * @event end Emitted when the stream is exhausted */ - constructor(query: Query, options: Object): QueryCursor; + constructor(query: Query, options: any): QueryCursor; /** Marks this cursor as closed. Will stop streaming and subsequent calls to next() will error. */ close(callback?: (error: any, result: any) => void): Promise; @@ -593,11 +504,11 @@ declare module "mongoose" { */ class VirtualType { /** This is what mongoose uses to define virtual attributes via Schema.prototype.virtual. */ - constructor(options: Object, name: string); + constructor(options: any, name: string); /** Applies getters to value using optional scope. */ - applyGetters(value: Object, scope: Object): any; + applyGetters(value: any, scope: any): any; /** Applies setters to value using optional scope. */ - applySetters(value: Object, scope: Object): any; + applySetters(value: any, scope: any): any; /** Defines a getter. */ get(fn: Function): this; /** Defines a setter. */ @@ -620,6 +531,9 @@ declare module "mongoose" { /** Adds key path / schema type pairs to this schema. */ add(obj: SchemaDefinition, prefix?: string): void; + /** Return a deep copy of this schema */ + clone(): Schema; + /** * Iterates the schemas paths similar to Array.forEach. * @param fn callback function @@ -639,7 +553,7 @@ declare module "mongoose" { * @param options.expires Mongoose-specific syntactic sugar, uses ms to convert * expires option into seconds for the expireAfterSeconds in the above link. */ - index(fields: Object, options?: { + index(fields: any, options?: { expires?: string; [other: string]: any; }): this; @@ -678,7 +592,7 @@ declare module "mongoose" { * Registers a plugin for this schema. * @param plugin callback */ - plugin(plugin: (schema: Schema, options?: Object) => void, opts?: Object): this; + plugin(plugin: (schema: Schema, options?: any) => void, opts?: any): this; /** * Defines a post hook for the document @@ -734,7 +648,7 @@ declare module "mongoose" { static(nameObj: { [name: string]: Function }): this; /** Creates a virtual type with the given name. */ - virtual(name: string, options?: Object): VirtualType; + virtual(name: string, options?: any): VirtualType; /** Returns the virtual type with the given name. */ virtualpath(name: string): VirtualType; @@ -748,7 +662,7 @@ declare module "mongoose" { * b/c they conflict with mongoose functionality. Using these key name * will throw an error. */ - static reserved: Object; + static reserved: any; /** Object of currently defined methods on this schema. */ methods: any; @@ -760,40 +674,41 @@ declare module "mongoose" { // Hook functions: https://github.com/vkarpov15/hooks-fixed interface HookSyncCallback { - (next: HookNextFunction, ...hookArgs:any[]): any; + (next: HookNextFunction): any; } interface HookAsyncCallback { - (next: HookNextFunction, done: HookDoneFunction, ...hookArgs: any[]): any; + (next: HookNextFunction, done: HookDoneFunction): any; } interface HookErrorCallback { - (error: Error): any; + (error?: Error): any; } interface HookNextFunction { - (error: Error): any; - (...hookArgs: any[]): any; + (error?: Error): any; } interface HookDoneFunction { - (error: Error): any; - (...hookArgs: any[]): any; + (error?: Error): any; } interface SchemaOptions { - /** defaults to null (which means use the connection's autoIndex option) */ + /** defaults to false (which means use the connection's autoIndex option) */ autoIndex?: boolean; /** defaults to true */ bufferCommands?: boolean; /** defaults to false */ capped?: boolean | number | { size?: number; max?: number; autoIndexId?: boolean; }; + /** Sets a default collation for every query and aggregation. */ + collation?: CollationOptions; /** no default */ collection?: string; /** defaults to "__t" */ discriminatorKey?: string; /** defaults to false. */ emitIndexErrors?: boolean; + excludeIndexes?: any; /** defaults to true */ id?: boolean; /** defaults to true */ @@ -803,14 +718,15 @@ declare module "mongoose" { read?: string; /** defaults to true. */ safe?: boolean | { w?: number | string; wtimeout?: number; j?: boolean }; + /** defaults to null */ shardKey?: boolean; /** defaults to true */ strict?: boolean; /** no default */ - toJSON?: Object; + toJSON?: DocumentToObjectOptions; /** no default */ - toObject?: Object; + toObject?: DocumentToObjectOptions; /** defaults to 'type' */ typeKey?: string; /** defaults to false */ @@ -819,20 +735,23 @@ declare module "mongoose" { validateBeforeSave?: boolean; /** defaults to "__v" */ versionKey?: string|boolean; - /** defaults to false */ - retainKeyOrder?: boolean; /** * skipVersioning allows excluding paths from * versioning (the internal revision will not be * incremented even if these paths are updated). */ - skipVersioning?: Object; + skipVersioning?: any; /** * If set timestamps, mongoose assigns createdAt * and updatedAt fields to your schema, the type * assigned is Date. */ - timestamps?: Object; + timestamps?: boolean | SchemaTimestampsConfig; + } + + interface SchemaTimestampsConfig { + createdAt?: boolean | string; + updatedAt?: boolean | string; } /* @@ -868,6 +787,8 @@ declare module "mongoose" { * - http://mongoosejs.com/docs/api.html#schema_Schema.Types */ interface SchemaTypeOpts { + alias?: string; + /* Common Options for all schema types */ type?: T; @@ -878,7 +799,7 @@ declare module "mongoose" { * Getters allow you to transform the representation of the data as it travels * from the raw mongodb document to the value that you see. */ - get?: (value: T, schematype?: this) => T | Object; + get?: (value: T, schematype?: this) => T | any; /** Declares the index options for this schematype. */ index?: SchemaTypeOpts.IndexOpts | boolean | string; @@ -890,7 +811,7 @@ declare module "mongoose" { required?: SchemaTypeOpts.RequiredFn | boolean | [boolean, string] | string | [string, string] | - Object; + any; /** * Sets default select() behavior for this path. @@ -898,19 +819,19 @@ declare module "mongoose" { * if it should be excluded by default. This setting can be overridden at * the query level. */ - select?: boolean | Object; + select?: boolean | any; /** * Setters allow you to transform the data before it gets to the raw mongodb * document and is set as a value on an actual key. */ - set?: (value: T, schematype?: this) => T | Object; + set?: (value: T, schematype?: this) => T | any; /** Declares a sparse index. */ - sparse?: boolean | Object; + sparse?: boolean | any; /** Declares a full text index. */ - text?: boolean | Object; + text?: boolean | any; /** * Adds validator(s) for this document path. @@ -920,27 +841,27 @@ declare module "mongoose" { validate?: RegExp | [RegExp, string] | SchemaTypeOpts.ValidateFn | [SchemaTypeOpts.ValidateFn, string] | SchemaTypeOpts.ValidateOpts | SchemaTypeOpts.ValidateOpts[] | - Object; + SchemaTypeOpts.AsyncValidateOpts | SchemaTypeOpts.AsyncValidateOpts[]; /** Declares an unique index. */ - unique?: boolean | Object; + unique?: boolean | any; /* Options for specific schema types (String, Number, Date, etc.) */ /** String only - Adds an enum validator */ - enum?: T[] | SchemaTypeOpts.EnumOpts | Object; + enum?: T[] | SchemaTypeOpts.EnumOpts | any; /** String only - Adds a lowercase setter. */ - lowercase?: boolean | Object; + lowercase?: boolean | any; /** String only - Sets a regexp validator. */ - match?: RegExp | [RegExp, string] | Object; + match?: RegExp | [RegExp, string] | any; /** String only - Sets a maximum length validator. */ - maxlength?: number | [number, string] | Object; + maxlength?: number | [number, string] | any; /** String only - Sets a minimum length validator. */ - minlength?: number | [number, string] | Object; + minlength?: number | [number, string] | any; /** String only - Adds a trim setter. */ - trim?: boolean | Object; + trim?: boolean | any; /** String only - Adds an uppercase setter. */ - uppercase?: boolean | Object; + uppercase?: boolean | any; /** * Date, Number only - Sets a minimum number validator. @@ -948,7 +869,7 @@ declare module "mongoose" { */ min?: number | [number, string] | Date | [Date, string] | - Object; + any; /** * Date, Number only - Sets a maximum number validator. @@ -956,16 +877,16 @@ declare module "mongoose" { */ max?: number | [number, string] | Date | [Date, string] | - Object; + any; /** * Date only - Declares a TTL index (rounded to the nearest second) * for Date types only. */ - expires?: number | string | Object; + expires?: number | string | any; /** ObjectId only - Adds an auto-generated ObjectId default if turnOn is true. */ - auto?: boolean | Object; + auto?: boolean | any; [other: string]: any; } @@ -981,13 +902,26 @@ declare module "mongoose" { } interface ValidateFn { - (obj: RegExp | Function, message?: string, type?: string): T; + (value: T): boolean; } - interface ValidateOpts { - validator?: RegExp | Function, - msg?: string, - type?: string + interface AsyncValidateFn { + (value: T, done: (result: boolean) => void): void; + } + + interface ValidateOptsBase { + msg?: string; + type?: string; + } + + interface ValidateOpts extends ValidateOptsBase { + isAsync?: false; + validator?: RegExp | ValidateFn; + } + + interface AsyncValidateOpts extends ValidateOptsBase { + isAsync: true; + validator: AsyncValidateFn; } interface EnumOpts { @@ -1017,7 +951,7 @@ declare module "mongoose" { * Takes a populated field and returns it to its unpopulated state. * If the path was not populated, this is a no-op. */ - depopulate(path: string): void; + depopulate(path: string): this; /** * Returns true if the Document stores the same data as doc. @@ -1034,6 +968,9 @@ declare module "mongoose" { */ execPopulate(): Promise; + /** Checks if path was explicitly selected. If no projection, always returns true. */ + isDirectSelected(path: string): boolean; + /** * Returns the value of a path. * @param type optionally specify a type for on-the-fly attributes @@ -1044,13 +981,12 @@ declare module "mongoose" { * Initializes the document without setters or marking anything modified. * Called internally after a document is returned from mongodb. * @param doc document returned by mongo - * @param fn callback + * @param opts Options */ - init(doc: MongooseDocument, fn?: () => void): this; - init(doc: MongooseDocument, opts: Object, fn?: () => void): this; + init(doc: MongooseDocument, opts?: any): this; /** Helper for console.log */ - inspect(options?: Object): any; + inspect(options?: any): any; /** * Marks a path as invalid, causing validation to fail. @@ -1116,9 +1052,9 @@ declare module "mongoose" { * @param type optionally specify a type for "on-the-fly" attributes * @param options optionally specify options that modify the behavior of the set */ - set(path: string, val: any, options?: Object): this; - set(path: string, val: any, type: any, options?: Object): this; - set(value: Object): this; + set(path: string, val: any, options?: any): this; + set(path: string, val: any, type: any, options?: any): this; + set(value: any): this; /** * The return value of this method is used in calls to JSON.stringify(doc). @@ -1126,13 +1062,13 @@ declare module "mongoose" { * options to every document of your schema by default, set your schemas * toJSON option to the same argument. */ - toJSON(options?: DocumentToObjectOptions): Object; + toJSON(options?: DocumentToObjectOptions): any; /** * Converts this document into a plain javascript object, ready for storage in MongoDB. * Buffers are converted to instances of mongodb.Binary for proper storage. */ - toObject(options?: DocumentToObjectOptions): Object; + toObject(options?: DocumentToObjectOptions): any; /** Helper for console.log */ toString(): string; @@ -1144,8 +1080,8 @@ declare module "mongoose" { unmarkModified(path: string): void; /** Sends an update command with this document _id as the query selector. */ - update(doc: Object, callback?: (err: any, raw: any) => void): Query; - update(doc: Object, options: ModelUpdateOptions, + update(doc: any, callback?: (err: any, raw: any) => void): Query; + update(doc: any, options: ModelUpdateOptions, callback?: (err: any, raw: any) => void): Query; /** @@ -1154,7 +1090,7 @@ declare module "mongoose" { * @param callback callback called after validation completes, passing an error if one occurred */ validate(callback?: (err: any) => void): Promise; - validate(optional: Object, callback?: (err: any) => void): Promise; + validate(optional: any, callback?: (err: any) => void): Promise; /** * Executes registered validation rules (skipping asynchronous validators) for this document. @@ -1165,7 +1101,7 @@ declare module "mongoose" { validateSync(pathsToValidate?: string | string[]): Error; /** Hash containing current validation errors. */ - errors: Object; + errors: any; /** This documents _id. */ _id: any; /** Boolean flag specifying if the document is new. */ @@ -1197,17 +1133,11 @@ declare module "mongoose" { * @param ret The plain object representation which has been converted * @param options The options in use (either schema options or the options passed inline) */ - transform?: (doc: any, ret: Object, options: Object) => any; + transform?: (doc: any, ret: any, options: any) => any; /** depopulate any populated paths, replacing them with their original refs (defaults to false) */ depopulate?: boolean; /** whether to include the version key (defaults to true) */ versionKey?: boolean; - /** - * keep the order of object keys. If this is set to true, - * Object.keys(new Doc({ a: 1, b: 2}).toObject()) will - * always produce ['a', 'b'] (defaults to false) - */ - retainKeyOrder?: boolean; } namespace Types { @@ -1224,7 +1154,7 @@ declare module "mongoose" { * @param callback optional callback for compatibility with Document.prototype.remove */ remove(callback?: (err: any) => void): void; - remove(options: Object, callback?: (err: any) => void): void; + remove(options: any, callback?: (err: any) => void): void; } /* @@ -1325,7 +1255,7 @@ declare module "mongoose" { splice(...args: any[]): T[]; /** Returns a native js Array. */ - toObject(options?: Object): T[]; + toObject(options?: any): T[]; /** * Wraps Array#unshift with proper change tracking. @@ -1346,7 +1276,7 @@ declare module "mongoose" { * This is the same subdocument constructor used for casting. * @param obj the value to cast to this arrays SubDocument schema */ - create(obj: Object): T; + create(obj: any): T; /** * Searches array items for the first document with a matching _id. @@ -1362,7 +1292,7 @@ declare module "mongoose" { * @param options optional options to pass to each documents toObject * method call during conversion */ - toObject(options?: Object): T[]; + toObject(options?: any): T[]; } /* @@ -1417,7 +1347,7 @@ declare module "mongoose" { */ class Embedded extends MongooseDocument { /** Helper for console.log */ - inspect(): Object; + inspect(): any; /** * Marks a path as invalid, causing validation to fail. @@ -1476,20 +1406,30 @@ declare module "mongoose" { * Specifies arguments for a $and condition. * @param array array of conditions */ - and(array: Object[]): this; + and(array: any[]): this; /** Specifies the batchSize option. Cannot be used with distinct() */ batchSize(val: number): this; + /** Get the current error flag value */ + error(): Error | null; + /** Unset the error flag set on this query */ + error(unset: null): this; + /** + * Set the error flag on this query + * @param err The error flag + */ + error(err: Error): this; + /** * Specifies a $box condition * @param Upper Right Coords */ - box(val: Object): this; + box(val: any): this; box(lower: number[], upper: number[]): this; /** Casts this query to the schema of model, If obj is present, it is cast instead of this query.*/ - cast(model: any, obj?: Object): Object; + cast(model: any, obj?: any): any; /** * Executes the query returning a Promise which will be @@ -1503,19 +1443,18 @@ declare module "mongoose" { * Specifies a $center or $centerSphere condition. * @deprecated Use circle instead. */ - center(area: Object): this; - center(path: string, area: Object): this; - + center(area: any): this; + center(path: string, area: any): this; /** * DEPRECATED Specifies a $centerSphere condition * @deprecated Use circle instead. */ - centerSphere(path: string, val: Object): this; - centerSphere(val: Object): this; + centerSphere(path: string, val: any): this; + centerSphere(val: any): this; /** Specifies a $center or $centerSphere condition. */ - circle(area: Object): this; - circle(path: string, area: Object): this; + circle(area: any): this; + circle(path: string, area: any): this; /** Adds a collation to this op (MongoDB 3.4 and up) */ collation(value: CollationOptions): this; @@ -1528,28 +1467,28 @@ declare module "mongoose" { * @param criteria mongodb selector */ count(callback?: (err: any, count: number) => void): Query; - count(criteria: Object, callback?: (err: any, count: number) => void): Query; + count(criteria: any, callback?: (err: any, count: number) => void): Query; /** * Returns a wrapper around a mongodb driver cursor. A QueryCursor exposes a * Streams3-compatible interface, as well as a .next() function. */ - cursor(options?: Object): QueryCursor; + cursor(options?: any): QueryCursor; /** Declares or executes a distict() operation. Passing a callback executes the query. */ distinct(callback?: (err: any, res: any[]) => void): Query; distinct(field: string, callback?: (err: any, res: any[]) => void): Query; - distinct(field: string, criteria: Object | Query, + distinct(field: string, criteria: any | Query, callback?: (err: any, res: any[]) => void): Query; /** Specifies an $elemMatch condition */ elemMatch(criteria: (elem: Query) => void): this; - elemMatch(criteria: Object): this; - elemMatch(path: string | Object | Function, criteria: (elem: Query) => void): this; - elemMatch(path: string | Object | Function, criteria: Object): this; + elemMatch(criteria: any): this; + elemMatch(path: string | any | Function, criteria: (elem: Query) => void): this; + elemMatch(path: string | any | Function, criteria: any): this; /** Specifies the complementary comparison value for paths specified with where() */ - equals(val: Object): this; + equals(val: any): this; /** Executes the query */ exec(callback?: (err: any, res: T) => void): Promise; @@ -1565,7 +1504,7 @@ declare module "mongoose" { * @param criteria mongodb selector */ find(callback?: (err: any, res: DocType[]) => void): DocumentQuery; - find(criteria: Object, + find(criteria: any, callback?: (err: any, res: DocType[]) => void): DocumentQuery; /** @@ -1576,7 +1515,7 @@ declare module "mongoose" { * @param projection optional fields to return */ findOne(callback?: (err: any, res: DocType | null) => void): DocumentQuery; - findOne(criteria: Object, + findOne(criteria: any, callback?: (err: any, res: DocType | null) => void): DocumentQuery; /** @@ -1585,9 +1524,9 @@ declare module "mongoose" { * callback. Executes immediately if callback is passed. */ findOneAndRemove(callback?: (error: any, doc: DocType | null, result: any) => void): DocumentQuery; - findOneAndRemove(conditions: Object, + findOneAndRemove(conditions: any, callback?: (error: any, doc: DocType | null, result: any) => void): DocumentQuery; - findOneAndRemove(conditions: Object, options: QueryFindOneAndRemoveOptions, + findOneAndRemove(conditions: any, options: QueryFindOneAndRemoveOptions, callback?: (error: any, doc: DocType | null, result: any) => void): DocumentQuery; /** @@ -1596,11 +1535,11 @@ declare module "mongoose" { * the found document (if any) to the callback. The query executes immediately if callback is passed. */ findOneAndUpdate(callback?: (err: any, doc: DocType | null) => void): DocumentQuery; - findOneAndUpdate(update: Object, + findOneAndUpdate(update: any, callback?: (err: any, doc: DocType | null, res: any) => void): DocumentQuery; - findOneAndUpdate(query: Object | Query, update: Object, + findOneAndUpdate(query: any | Query, update: any, callback?: (err: any, doc: DocType | null, res: any) => void): DocumentQuery; - findOneAndUpdate(query: Object | Query, update: Object, options: QueryFindOneAndUpdateOptions, + findOneAndUpdate(query: any | Query, update: any, options: QueryFindOneAndUpdateOptions, callback?: (err: any, doc: DocType | null, res: any) => void): DocumentQuery; /** @@ -1640,7 +1579,7 @@ declare module "mongoose" { * Sets query hints. * @param val a hint object */ - hint(val: Object): this; + hint(val: any): this; /** * Specifies an $in query condition. @@ -1650,7 +1589,7 @@ declare module "mongoose" { in(path: string, val: any[]): this; /** Declares an intersects query for geometry(). MUST be used after where(). */ - intersects(arg?: Object): this; + intersects(arg?: any): this; /** * Sets the lean option. @@ -1694,7 +1633,7 @@ declare module "mongoose" { * Merges another Query or conditions object into this one. * When a Query is passed, conditions, field selection and options are merged. */ - merge(source: Object | Query): this; + merge(source: any | Query): this; /** Specifies a $mod condition */ mod(val: number[]): this; @@ -1708,15 +1647,15 @@ declare module "mongoose" { ne(path: string, val: any): this; /** Specifies a $near or $nearSphere condition. */ - near(val: Object): this; - near(path: string, val: Object): this; + near(val: any): this; + near(path: string, val: any): this; /** * DEPRECATED Specifies a $nearSphere condition * @deprecated Use query.near() instead with the spherical option set to true. */ - nearSphere(val: Object): this; - nearSphere(path: string, val: Object): this; + nearSphere(val: any): this; + nearSphere(path: string, val: any): this; /** * Specifies a $nin query condition. @@ -1729,13 +1668,13 @@ declare module "mongoose" { * Specifies arguments for a $nor condition. * @param array array of conditions */ - nor(array: Object[]): this; + nor(array: any[]): this; /** * Specifies arguments for an $or condition. * @param array array of conditions */ - or(array: Object[]): this; + or(array: any[]): this; /** Specifies a $polygon condition */ polygon(...coordinatePairs: number[][]): this; @@ -1753,8 +1692,8 @@ declare module "mongoose" { * @param match Conditions for the population query * @param options Options for the population query (sort, etc) */ - populate(path: string | Object, select?: string | Object, model?: any, - match?: Object, options?: Object): this; + populate(path: string | any, select?: string | any, model?: any, + match?: any, options?: any): this; populate(options: ModelPopulateOptions | ModelPopulateOptions[]): this; /** @@ -1762,7 +1701,7 @@ declare module "mongoose" { * @param pref one of the listed preference options or aliases * @tags optional tags for this query */ - read(pref: string, tags?: Object[]): this; + read(pref: string, tags?: any[]): this; /** * Specifies a $regex query condition. @@ -1777,11 +1716,11 @@ declare module "mongoose" { * you must first call remove() and then execute it by using the exec() method. * @param criteria mongodb selector */ - remove(callback?: (err: any) => void): Query; - remove(criteria: Object | Query, callback?: (err: any) => void): Query; + remove(callback?: (err: any) => void): Query; + remove(criteria: any | Query, callback?: (err: any) => void): Query; /** Specifies which document fields to include or exclude (also known as the query "projection") */ - select(arg: string | Object): this; + select(arg: string | any): this; /** Determines if field selection has been made. */ selected(): boolean; /** Determines if exclusive field selection has been made.*/ @@ -1789,7 +1728,7 @@ declare module "mongoose" { /** Determines if inclusive field selection has been made. */ selectedInclusively(): boolean; /** Sets query options. */ - setOptions(options: Object): this; + setOptions(options: any): this; /** * Specifies a $size query condition. @@ -1825,10 +1764,7 @@ declare module "mongoose" { * sort order of each path is ascending unless the path name is prefixed with - * which will be treated as descending. */ - sort(arg: string | Object): this; - - /** Returns a Node.js 0.8 style read stream interface. */ - stream(options?: { transform?: Function; }): QueryStream; + sort(arg: string | any): this; /** * Sets the tailable option (for use with capped collections). Cannot be used with distinct() @@ -1859,17 +1795,17 @@ declare module "mongoose" { * @param doc the update command */ update(callback?: (err: any, affectedRows: number) => void): Query; - update(doc: Object, callback?: (err: any, affectedRows: number) => void): Query; - update(criteria: Object, doc: Object, + update(doc: any, callback?: (err: any, affectedRows: number) => void): Query; + update(criteria: any, doc: any, callback?: (err: any, affectedRows: number) => void): Query; - update(criteria: Object, doc: Object, options: QueryUpdateOptions, + update(criteria: any, doc: any, options: QueryUpdateOptions, callback?: (err: any, affectedRows: number) => void): Query; /** Specifies a path for use with chaining. */ - where(path?: string | Object, val?: any): this; + where(path?: string | any, val?: any): this; /** Defines a $within or $geoWithin argument for geo-spatial queries. */ - within(val?: Object): this; + within(val?: any): this; within(coordinate: number[], ...coordinatePairs: number[][]): this; /** Flag to opt out of using $geoWithin. */ @@ -1887,7 +1823,7 @@ declare module "mongoose" { /** puts a time limit on the query - requires mongodb >= 2.6.0 */ maxTimeMS?: number; /** if true, passes the raw result from the MongoDB driver as the third callback parameter */ - passRawResult?: boolean; + rawResult?: boolean; } interface QueryFindOneAndUpdateOptions extends QueryFindOneAndRemoveOptions { @@ -1896,7 +1832,7 @@ declare module "mongoose" { /** creates the object if it doesn't exist. defaults to false. */ upsert?: boolean; /** Field selection. Equivalent to .select(fields).findOneAndUpdate() */ - fields?: Object | string; + fields?: any | string; /** if true, runs update validators on this command. Update validators validate the update operation against the model's schema. */ runValidators?: boolean; /** @@ -1939,7 +1875,7 @@ declare module "mongoose" { */ class Array extends SchemaType { /** Array SchemaType constructor */ - constructor(key: string, cast?: SchemaType, options?: Object); + constructor(key: string, cast?: SchemaType, options?: any); /** * Check if the given value satisfies a required validator. The given value @@ -1957,7 +1893,7 @@ declare module "mongoose" { */ class String extends SchemaType { /** String SchemaType constructor. */ - constructor(key: string, options?: Object); + constructor(key: string, options?: any); /** Check if the given value satisfies a required validator. */ checkRequired(value: any, doc: MongooseDocument): boolean; @@ -1966,7 +1902,7 @@ declare module "mongoose" { * Adds an enum validator * @param args enumeration values */ - enum(args: string | string[] | Object): this; + enum(args: string | string[] | any): this; /** Adds a lowercase setter. */ lowercase(): this; @@ -2008,7 +1944,7 @@ declare module "mongoose" { */ class DocumentArray extends Array { /** SubdocsArray SchemaType constructor */ - constructor(key: string, schema: Schema, options?: Object); + constructor(key: string, schema: Schema, options?: any); /** This schema type's name, to defend against minifiers that mangle function names. */ static schemaName: string; @@ -2020,7 +1956,7 @@ declare module "mongoose" { */ class Number extends SchemaType { /** Number SchemaType constructor. */ - constructor(key: string, options?: Object); + constructor(key: string, options?: any); /** Check if the given value satisfies a required validator. */ checkRequired(value: any, doc: MongooseDocument): boolean; @@ -2049,7 +1985,7 @@ declare module "mongoose" { */ class Date extends SchemaType { /** Date SchemaType constructor. */ - constructor(key: string, options?: Object); + constructor(key: string, options?: any); /** * Check if the given value satisfies a required validator. To satisfy @@ -2084,7 +2020,7 @@ declare module "mongoose" { */ class Buffer extends SchemaType { /** Buffer SchemaType constructor */ - constructor(key: string, options?: Object); + constructor(key: string, options?: any); /** * Check if the given value satisfies a required validator. To satisfy a @@ -2104,7 +2040,7 @@ declare module "mongoose" { */ class Boolean extends SchemaType { /** Boolean SchemaType constructor. */ - constructor(path: string, options?: Object); + constructor(path: string, options?: any); /** * Check if the given value satisfies a required validator. For a @@ -2123,7 +2059,7 @@ declare module "mongoose" { */ class ObjectId extends SchemaType { /** ObjectId SchemaType constructor. */ - constructor(key: string, options?: Object); + constructor(key: string, options?: any); /** * Adds an auto-generated ObjectId default if turnOn is true. @@ -2143,7 +2079,7 @@ declare module "mongoose" { */ class Decimal128 extends SchemaType { /** Decimal128 SchemaType constructor. */ - constructor(key: string, options?: Object); + constructor(key: string, options?: any); /** Check if the given value satisfies a required validator. */ checkRequired(value: any, doc: MongooseDocument): boolean; @@ -2158,7 +2094,7 @@ declare module "mongoose" { */ class Mixed extends SchemaType { /** Mixed SchemaType constructor. */ - constructor(path: string, options?: Object); + constructor(path: string, options?: any); /** This schema type's name, to defend against minifiers that mangle function names. */ static schemaName: string; @@ -2170,7 +2106,7 @@ declare module "mongoose" { */ class Embedded extends SchemaType { /** Sub-schema schematype constructor */ - constructor(schema: Schema, key: string, options?: Object); + constructor(schema: Schema, key: string, options?: any); } } } @@ -2185,11 +2121,17 @@ declare module "mongoose" { * Returned when calling Model.aggregate(). * @param ops aggregation operator(s) or operator array */ - constructor(ops?: Object | any[], ...args: any[]); + constructor(ops?: any | any[], ...args: any[]); /** Adds a cursor flag */ addCursorFlag(flag: string, value: boolean): this; + /** + * Appends a new $addFields operator to this aggregate pipeline. Requires MongoDB v3.4+ to work + * @param arg field specification + */ + addFields(arg: any): this; + /** * Sets the allowDiskUse option for the aggregation query (ignored for < 2.6.0) * @param value Should tell server it can use hard drive to store data during aggregation. @@ -2201,7 +2143,7 @@ declare module "mongoose" { * Appends new operators to this aggregate pipeline * @param ops operator(s) to append */ - append(...ops: Object[]): this; + append(...ops: any[]): this; /** Adds a collation. */ collation(options: CollationOptions): this; @@ -2212,7 +2154,7 @@ declare module "mongoose" { * is necessary. * @param options set the cursor batch size */ - cursor(options: Object): this; + cursor(options: any): this; // If cursor option is on, could return an object /** Executes the aggregate pipeline on the currently bound Model. */ @@ -2225,7 +2167,7 @@ declare module "mongoose" { * Appends a new custom $group operator to this aggregate pipeline. * @param arg $group operator contents */ - group(arg: Object): this; + group(arg: any): this; /** * Appends a new $limit operator to this aggregate pipeline. @@ -2237,13 +2179,13 @@ declare module "mongoose" { * Appends new custom $lookup operator(s) to this aggregate pipeline. * @param options to $lookup as described in the above link */ - lookup(options: Object): this; + lookup(options: any): this; /** * Appends a new custom $match operator to this aggregate pipeline. * @param arg $match operator contents */ - match(arg: Object): this; + match(arg: any): this; /** * Binds this aggregate to a model. @@ -2251,25 +2193,41 @@ declare module "mongoose" { */ model(model: any): this; + /** + * Appends new custom $graphLookup operator(s) to this aggregate pipeline, performing a recursive search on a collection. + * Note that graphLookup can only consume at most 100MB of memory, and does not allow disk use even if { allowDiskUse: true } is specified. + * @param options options to $graphLookup + */ + graphLookup(options: any): this; + /** * Appends a new $geoNear operator to this aggregate pipeline. * MUST be used as the first operator in the pipeline. */ - near(parameters: Object): this; + near(parameters: any): this; + + /** + * Lets you set arbitrary options, for middleware or plugins. + * @param value keys to merge into current options + */ + option(value: any): this; + + /** Returns the current pipeline */ + pipeline(): any[]; /** * Appends a new $project operator to this aggregate pipeline. * Mongoose query selection syntax is also supported. * @param arg field specification */ - project(arg: string | Object): this; + project(arg: string | any): this; /** * Sets the readPreference option for the aggregation query. * @param pref one of the listed preference options or their aliases * @param tags optional tags for this query */ - read(pref: string, tags?: Object[]): this; + read(pref: string, tags?: any[]): this; /** * Appends new custom $sample operator(s) to this aggregate pipeline. @@ -2290,7 +2248,7 @@ declare module "mongoose" { * of each path is ascending unless the path name is prefixed with - which will be treated * as descending. */ - sort(arg: string | Object): this; + sort(arg: string | any): this; /** Provides promise for aggregate. */ then(resolve?: (val: T) => void | TRes | PromiseLike, @@ -2316,7 +2274,7 @@ declare module "mongoose" { */ class SchemaType { /** SchemaType constructor */ - constructor(path: string, options?: Object, instance?: string); + constructor(path: string, options?: any, instance?: string); /** * Sets a default value for this SchemaType. @@ -2334,7 +2292,7 @@ declare module "mongoose" { * Declares the index options for this schematype. * Indexes are created in the background by default. Specify background: false to override. */ - index(options: Object | boolean | string): this; + index(options: any | boolean | string): this; /** * Adds a required validator to this SchemaType. The validator gets added @@ -2363,7 +2321,7 @@ declare module "mongoose" { * @param errorMsg optional error message * @param type optional validator type */ - validate(obj: RegExp | Function | Object, errorMsg?: string, + validate(obj: RegExp | Function | any, errorMsg?: string, type?: string): this; } @@ -2424,7 +2382,31 @@ declare module "mongoose" { * Model#ensureIndexes. If an error occurred it is passed with the event. * The fields, options, and index name are also passed. */ - new(doc?: Object): T; + new(doc?: any): T; + + /** + * Requires a replica set running MongoDB >= 3.6.0. Watches the underlying collection for changes using MongoDB change streams. + * This function does not trigger any middleware. In particular, it does not trigger aggregate middleware. + * @param options See https://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#watch + */ + watch(options?: mongodb.ChangeStreamOptions & {session?: any}): mongodb.ChangeStream; + + /** + * Translate any aliases fields/conditions so the final query or document object is pure + * @param raw fields/conditions that may contain aliased keys + * @return the translated 'pure' fields/conditions + */ + translateAliases(raw: any): any; + + /** + * Sends multiple insertOne, updateOne, updateMany, replaceOne, deleteOne, and/or deleteMany operations to the MongoDB server in one command. This is faster than sending multiple independent operations (like) if you use create()) because with bulkWrite() there is only one round trip to MongoDB. + * Mongoose will perform casting on all operations you provide. + * This function does not trigger any middleware, not save() nor update(). If you need to trigger save() middleware for every document use create() instead. + * @param writes Operations + * @param cb callback + * @return `BulkWriteOpResult` if the operation succeeds + */ + bulkWrite(writes: any[], cb?: (err: any, res: mongodb.BulkWriteOpResultObject) => void): Promise; /** * Finds a single document by its _id field. findById(id) is almost* @@ -2432,11 +2414,11 @@ declare module "mongoose" { * @param id value of _id to query by * @param projection optional fields to return */ - findById(id: Object | string | number, + findById(id: any | string | number, callback?: (err: any, res: T | null) => void): DocumentQuery; - findById(id: Object | string | number, projection: Object, + findById(id: any | string | number, projection: any, callback?: (err: any, res: T | null) => void): DocumentQuery; - findById(id: Object | string | number, projection: Object, options: Object, + findById(id: any | string | number, projection: any, options: any, callback?: (err: any, res: T | null) => void): DocumentQuery; model(name: string): Model; @@ -2451,13 +2433,13 @@ declare module "mongoose" { * Performs aggregations on the models collection. * If a callback is passed, the aggregate is executed and a Promise is returned. * If a callback is not passed, the aggregate itself is returned. - * @param ... aggregation pipeline operator(s) or operator array + * @param aggregations pipeline operator(s) or operator array */ - aggregate(...aggregations: Object[]): Aggregate; - aggregate(...aggregationsWithCallback: Object[]): Promise; + aggregate(aggregations: any[]): Aggregate; + aggregate(aggregations: any[], cb: Function): Promise; /** Counts number of matching documents in a database collection. */ - count(conditions: Object, callback?: (err: any, count: number) => void): Query; + count(conditions: any, callback?: (err: any, count: number) => void): Query; /** * Shortcut for saving one or more documents to the database. MyModel.create(docs) @@ -2465,8 +2447,8 @@ declare module "mongoose" { * Triggers the save() hook. */ create(docs: any[], callback?: (err: any, res: T[]) => void): Promise; - create(...docs: Object[]): Promise; - create(...docsWithCallback: Object[]): Promise; + create(...docs: any[]): Promise; + create(...docsWithCallback: any[]): Promise; /** * Adds a discriminator type. @@ -2477,7 +2459,7 @@ declare module "mongoose" { /** Creates a Query for a distinct operation. Passing a callback immediately executes the query. */ distinct(field: string, callback?: (err: any, res: any[]) => void): Query; - distinct(field: string, conditions: Object, + distinct(field: string, conditions: any, callback?: (err: any, res: any[]) => void): Query; /** @@ -2486,17 +2468,23 @@ declare module "mongoose" { * @param cb optional callback */ ensureIndexes(callback?: (err: any) => void): Promise; - ensureIndexes(options: Object, callback?: (err: any) => void): Promise; + ensureIndexes(options: any, callback?: (err: any) => void): Promise; + + /** + * Similar to ensureIndexes(), except for it uses the createIndex function. The ensureIndex() function checks to see if an index with that name already exists, and, if not, does not attempt to create the index. createIndex() bypasses this check. + * @param cb Optional callback + */ + createIndexes(cb?: (err: any) => void): Promise; /** * Finds documents. * @param projection optional fields to return */ find(callback?: (err: any, res: T[]) => void): DocumentQuery; - find(conditions: Object, callback?: (err: any, res: T[]) => void): DocumentQuery; - find(conditions: Object, projection?: Object | null, + find(conditions: any, callback?: (err: any, res: T[]) => void): DocumentQuery; + find(conditions: any, projection?: any | null, callback?: (err: any, res: T[]) => void): DocumentQuery; - find(conditions: Object, projection?: Object | null, options?: Object | null, + find(conditions: any, projection?: any | null, options?: any | null, callback?: (err: any, res: T[]) => void): DocumentQuery; @@ -2509,13 +2497,13 @@ declare module "mongoose" { * @param id value of _id to query by */ findByIdAndRemove(): DocumentQuery; - findByIdAndRemove(id: Object | number | string, + findByIdAndRemove(id: any | number | string, callback?: (err: any, res: T | null) => void): DocumentQuery; - findByIdAndRemove(id: Object | number | string, options: { + findByIdAndRemove(id: any | number | string, options: { /** if multiple docs are found by the conditions, sets the sort order to choose which doc to update */ - sort?: Object; + sort?: any; /** sets the document fields to return */ - select?: Object; + select?: any; }, callback?: (err: any, res: T | null) => void): DocumentQuery; /** @@ -2524,9 +2512,9 @@ declare module "mongoose" { * @param id value of _id to query by */ findByIdAndUpdate(): DocumentQuery; - findByIdAndUpdate(id: Object | number | string, update: Object, + findByIdAndUpdate(id: any | number | string, update: any, callback?: (err: any, res: T | null) => void): DocumentQuery; - findByIdAndUpdate(id: Object | number | string, update: Object, + findByIdAndUpdate(id: any | number | string, update: any, options: ModelFindByIdAndUpdateOptions, callback?: (err: any, res: T | null) => void): DocumentQuery; @@ -2535,11 +2523,11 @@ declare module "mongoose" { * The conditions are cast to their respective SchemaTypes before the command is sent. * @param projection optional fields to return */ - findOne(conditions?: Object, + findOne(conditions?: any, callback?: (err: any, res: T | null) => void): DocumentQuery; - findOne(conditions: Object, projection: Object, + findOne(conditions: any, projection: any, callback?: (err: any, res: T | null) => void): DocumentQuery; - findOne(conditions: Object, projection: Object, options: Object, + findOne(conditions: any, projection: any, options: any, callback?: (err: any, res: T | null) => void): DocumentQuery; /** @@ -2548,18 +2536,18 @@ declare module "mongoose" { * Executes immediately if callback is passed else a Query object is returned. */ findOneAndRemove(): DocumentQuery; - findOneAndRemove(conditions: Object, + findOneAndRemove(conditions: any, callback?: (err: any, res: T | null) => void): DocumentQuery; - findOneAndRemove(conditions: Object, options: { + findOneAndRemove(conditions: any, options: { /** * if multiple docs are found by the conditions, sets the sort order to choose * which doc to update */ - sort?: Object; + sort?: any; /** puts a time limit on the query - requires mongodb >= 2.6.0 */ maxTimeMS?: number; /** sets the document fields to return */ - select?: Object; + select?: any; }, callback?: (err: any, res: T | null) => void): DocumentQuery; /** @@ -2569,34 +2557,19 @@ declare module "mongoose" { * if callback is passed else a Query object is returned. */ findOneAndUpdate(): DocumentQuery; - findOneAndUpdate(conditions: Object, update: Object, + findOneAndUpdate(conditions: any, update: any, callback?: (err: any, doc: T | null, res: any) => void): DocumentQuery; - findOneAndUpdate(conditions: Object, update: Object, + findOneAndUpdate(conditions: any, update: any, options: ModelFindOneAndUpdateOptions, callback?: (err: any, doc: T | null, res: any) => void): DocumentQuery; - /** - * geoNear support for Mongoose - * @param GeoJSON point or legacy coordinate pair [x,y] to search near - * @param options for the qurery - * @param callback optional callback for the query - */ - geoNear(point: number[] | { - type: string; - coordinates: number[] - }, options: { - /** return the raw object */ - lean?: boolean; - [other: string]: any; - }, callback?: (err: any, res: T[], stats: any) => void): DocumentQuery; - /** * Implements $geoSearch functionality for Mongoose * @param conditions an object that specifies the match condition (required) * @param options for the geoSearch, some (near, maxDistance) are required * @param callback optional callback */ - geoSearch(conditions: Object, options: { + geoSearch(conditions: any, options: { /** x,y point to search for */ near: number[]; /** the maximum distance from the point near that a result can be */ @@ -2612,7 +2585,7 @@ declare module "mongoose" { * pre-saved in the DB. The document returned has no paths marked * as modified initially. */ - hydrate(obj: Object): T; + hydrate(obj: any): T; /** * Shortcut for validating an array of documents and inserting them into @@ -2623,7 +2596,7 @@ declare module "mongoose" { */ insertMany(docs: any[], callback?: (error: any, docs: T[]) => void): Promise; insertMany(doc: any, callback?: (error: any, doc: T) => void): Promise; - insertMany(...docsWithCallback: Object[]): Promise; + insertMany(...docsWithCallback: any[]): Promise; /** * Executes a mapReduce command. @@ -2641,35 +2614,41 @@ declare module "mongoose" { * @param options A hash of key/val (path, options) used for population. * @param callback Optional callback, executed upon completion. Receives err and the doc(s). */ - populate(docs: Object[], options: ModelPopulateOptions | ModelPopulateOptions[], + populate(docs: any[], options: ModelPopulateOptions | ModelPopulateOptions[], callback?: (err: any, res: T[]) => void): Promise; - populate(docs: Object, options: ModelPopulateOptions | ModelPopulateOptions[], + populate(docs: any, options: ModelPopulateOptions | ModelPopulateOptions[], callback?: (err: any, res: T) => void): Promise; /** Removes documents from the collection. */ - remove(conditions: Object, callback?: (err: any) => void): Query; - deleteOne(conditions: Object, callback?: (err: any) => void): Query; - deleteMany(conditions: Object, callback?: (err: any) => void): Query; + remove(conditions: any, callback?: (err: any) => void): Query; + deleteOne(conditions: any, callback?: (err: any) => void): Query; + deleteMany(conditions: any, callback?: (err: any) => void): Query; + + /** + * Same as update(), except MongoDB replace the existing document with the given document (no atomic operators like $set). + * This function triggers the following middleware: replaceOne + */ + replaceOne(conditions: any, replacement: any, callback?: (err: any, raw: any) => void): Query; /** * Updates documents in the database without returning them. * All update values are cast to their appropriate SchemaTypes before being sent. */ - update(conditions: Object, doc: Object, + update(conditions: any, doc: any, callback?: (err: any, raw: any) => void): Query; - update(conditions: Object, doc: Object, options: ModelUpdateOptions, + update(conditions: any, doc: any, options: ModelUpdateOptions, callback?: (err: any, raw: any) => void): Query; - updateOne(conditions: Object, doc: Object, + updateOne(conditions: any, doc: any, callback?: (err: any, raw: any) => void): Query; - updateOne(conditions: Object, doc: Object, options: ModelUpdateOptions, + updateOne(conditions: any, doc: any, options: ModelUpdateOptions, callback?: (err: any, raw: any) => void): Query; - updateMany(conditions: Object, doc: Object, + updateMany(conditions: any, doc: any, callback?: (err: any, raw: any) => void): Query; - updateMany(conditions: Object, doc: Object, options: ModelUpdateOptions, + updateMany(conditions: any, doc: any, options: ModelUpdateOptions, callback?: (err: any, raw: any) => void): Query; /** Creates a Query, applies the passed conditions, and returns the Query. */ - where(path: string, val?: Object): Query; + where(path: string, val?: any): Query; } interface Document extends MongooseDocument, NodeJS.EventEmitter, ModelProperties { @@ -2682,6 +2661,11 @@ declare module "mongoose" { */ model(name: string): Model; + /** Override whether mongoose thinks this doc is deleted or not */ + isDeleted(isDeleted: boolean): void; + /** whether mongoose thinks this doc is deleted. */ + isDeleted(): boolean; + /** * Removes this document from the db. * @param fn optional callback @@ -2695,8 +2679,8 @@ declare module "mongoose" { * @param options.validateBeforeSave set to false to save without validating. * @param fn optional callback */ - save(options?: SaveOptions, fn?: (err: any, product: this, numAffected: number) => void): Promise; - save(fn?: (err: any, product: this, numAffected: number) => void): Promise; + save(options?: SaveOptions, fn?: (err: any, product: this) => void): Promise; + save(fn?: (err: any, product: this) => void): Promise; /** * Version using default version key. See http://mongoosejs.com/docs/guide.html#versionKey @@ -2763,27 +2747,22 @@ declare module "mongoose" { */ setDefaultsOnInsert?: boolean; /** if multiple docs are found by the conditions, sets the sort order to choose which doc to update */ - sort?: Object; + sort?: any; /** sets the document fields to return */ - select?: Object; + select?: any; /** if true, passes the raw result from the MongoDB driver as the third callback parameter */ - passRawResult?: boolean; + rawResult?: boolean; /** overwrites the schema's strict mode option for this update */ strict?: boolean; - /** - * if true, run all setters defined on the associated model's schema for all fields - * defined in the query and the update. - */ - runSettersOnQuery?: boolean; } interface ModelFindOneAndUpdateOptions extends ModelFindByIdAndUpdateOptions { /** Field selection. Equivalent to .select(fields).findOneAndUpdate() */ - fields?: Object | string; + fields?: any | string; /** puts a time limit on the query - requires mongodb >= 2.6.0 */ maxTimeMS?: number; /** if true, passes the raw result from the MongoDB driver as the third callback parameter */ - passRawResult?: boolean; + rawResult?: boolean; } interface ModelPopulateOptions { @@ -2792,11 +2771,11 @@ declare module "mongoose" { /** optional fields to select */ select?: any; /** optional query conditions to match */ - match?: Object; + match?: any; /** optional name of the model to use for population */ model?: string; /** optional query options like sort, limit, etc */ - options?: Object; + options?: any; /** deep populate */ populate?: ModelPopulateOptions | ModelPopulateOptions[]; } @@ -2831,9 +2810,9 @@ declare module "mongoose" { map: Function | string; reduce: (key: Key, vals: T[]) => Val; /** query filter object. */ - query?: Object; + query?: any; /** sort input objects using this key */ - sort?: Object; + sort?: any; /** max number of documents */ limit?: number; /** keep temporary data default: false */ @@ -2841,7 +2820,7 @@ declare module "mongoose" { /** finalize function */ finalize?: (key: Key, val: Val) => Val; /** scope variables exposed to map/reduce/finalize during execution */ - scope?: Object; + scope?: any; /** it is possible to make the execution stay in JS. Provided in MongoDB > 2.0.X default: false */ jsMode?: boolean; /** provide statistics on job execution time. default: false */ diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index 92adb61d83..e63a0e612d 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -20,33 +20,31 @@ var cb = function () {}; * http://mongoosejs.com/docs/api.html#index-js */ var connectUri = 'mongodb://user:pass@localhost:port/database'; -mongoose.connect(connectUri).then(cb).catch(cb); -mongoose.connect(connectUri, { +const connection1: Promise = mongoose.connect(connectUri); +const connection2: Promise = mongoose.connect(connectUri, { user: 'larry', pass: 'housan', config: { autoIndex: true }, - mongos: true -}).then(cb); -mongoose.connect(connectUri, function (error) { + mongos: true, + bufferCommands: false +}); +const connection3: null = mongoose.connect(connectUri, function (error) { error.stack; }); + var mongooseConnection: mongoose.Connection = mongoose.createConnection(); +mongooseConnection.dropDatabase().then(()=>{}); +mongooseConnection.dropCollection('foo').then(()=>{}); mongoose.createConnection(connectUri).open(''); mongoose.createConnection(connectUri, { db: { native_parser: true } }).open(''); -mongoose.createConnection('localhost', 'database', 3000).open(''); -mongoose.createConnection('localhost', 'database', 3000, { - user: 'larry', - config: { - autoIndex: false - } -}).open(''); -mongoose.disconnect(cb).then(cb); +const dcWithCallback: null = mongoose.disconnect(cb); +const dcPromise: Promise = mongoose.disconnect(); mongoose.get('test'); mongoose.model('Actor', new mongoose.Schema({ name: String @@ -67,29 +65,6 @@ mongoose.Types.ObjectId; mongoose.Types.Decimal128; mongoose.version.toLowerCase(); -/* - * section querystream.js - * http://mongoosejs.com/docs/api.html#querystream-js - */ -var querystream = {}; -querystream.destroy(new Error()); -querystream.pause(); -querystream.pipe(process.stdout, {end: true}).end(); -querystream.resume(); -querystream.paused; -querystream.readable; -/* inherited properties */ -querystream.getMaxListeners(); -/* practical examples */ -var QSModel = {}; -var QSStream: mongoose.QueryStream = QSModel.find().stream(); -QSStream.on('data', function (doc: any) { - doc.save(); -}).on('error', function (err: any) { - throw err; -}).on('close', cb); -QSModel.where('created').gte(20000).stream().pipe(process.stdout); - /* * section collection.js * http://mongoosejs.com/docs/api.html#collection-js @@ -174,6 +149,8 @@ mongooseError.stack; mongoose.Error.messages.hasOwnProperty(''); mongoose.Error.Messages.hasOwnProperty(''); +const plural: string = mongoose.pluralize('foo'); + /* * section querycursor.js * http://mongoosejs.com/docs/api.html#querycursor-js @@ -209,6 +186,16 @@ querycursor.map(function (doc) { console.log(doc.foo); }); +QCModel.watch().once('change', (change: any) => { + console.log(change); +}); + +QCModel.watch({ + maxAwaitTimeMS: 10 +}).once('change', (change: any) => { + console.log(change); +}); + /* * section virtualtype.js * http://mongoosejs.com/docs/api.html#virtualtype-js @@ -369,7 +356,22 @@ new mongoose.Schema({ integerOnly: { type: Number, get: (v: number) => Math.round(v), - set: (v: number) => Math.round(v) + set: (v: number) => Math.round(v), + validate: { + isAsync: false, + validator: (val: number): boolean => { + return false; + } + } + }, + asyncValidated: { + type: Number, + validate: { + isAsync: true, + validator: (val: number, done): void => { + setImmediate(done, true); + } + } } }); new mongoose.Schema({ name: { type: String, validate: [ @@ -431,8 +433,8 @@ new mongoose.Schema({ }); export default function(schema: mongoose.Schema) { - schema.pre('init', function(this: mongoose.Document, next: (err?: Error) => void, data: any): void { - data.name = 'Hello world'; + schema.pre('init', function(this: mongoose.Document, next: (err?: Error) => void): void { + console.log('success!'); }); } @@ -442,13 +444,13 @@ export default function(schema: mongoose.Schema) { */ var doc = {}; doc.$isDefault('path').valueOf(); -doc.depopulate('path'); +const docDotDepopulate: mongoose.MongooseDocument = doc.depopulate('path'); doc.equals(doc).valueOf(); doc.execPopulate().then(function (arg) { arg.execPopulate(); }).catch(function (err) {}); doc.get('path', Number); -doc.init(doc, cb).init(doc, {}, cb); +doc.init(doc).init(doc, {}); doc.inspect(); doc.invalidate('path', new Error('hi'), 999).toString(); doc.isDirectModified('path').valueOf(); @@ -491,6 +493,7 @@ doc.validateSync(['path1', 'path2']).stack; var MyModel = mongoose.model('test', new mongoose.Schema({ name: { type: String, + alias: 'foo', default: 'Val ' } })); @@ -501,6 +504,14 @@ MyModel.findOne().populate('author').exec(function (err, doc) { doc.depopulate('author'); } }); +MyModel.replaceOne({foo: 'bar'}, {qux: 'baz'}).where(); +MyModel.replaceOne({foo: 'bar'}, {qux: 'baz'}, (err, raw) => {}) +MyModel.bulkWrite([{foo:'bar'}]).then(r => { + console.log(r.deletedCount); +}); +MyModel.bulkWrite([], (err, res) => { + console.log(res.modifiedCount) +}) doc.populate('path'); doc.populate({path: 'hello'}); doc.populate('path', cb) @@ -514,6 +525,8 @@ const ImageSchema = new mongoose.Schema({ id: {type: Number, unique: true, required: true, index: true}, }, { id: false }); +const clonedSchema: mongoose.Schema = new mongoose.Schema().clone(); + interface ImageDoc extends mongoose.Document { name: string, id: number @@ -731,7 +744,7 @@ query.findOne(function (err, res) { res.execPopulate(); }).findOne(); query.findOneAndRemove({name: 'aa'}, { - passRawResult: true + rawResult: true }, function (err, doc) { doc.execPopulate(); }).findOneAndRemove(); @@ -739,7 +752,7 @@ query.findOneAndUpdate({name: 'aa'}, {name: 'bb'}, { }); query.findOneAndUpdate({name: 'aa'}, {name: 'bb'}, { - passRawResult: true + rawResult: true }, cb); query.findOneAndUpdate({name: 'aa'}, {name: 'bb'}, cb); query.findOneAndUpdate({name: 'aa'}, {name: 'bb'}); @@ -842,10 +855,6 @@ query.where('comments').slice([-10, 5]); query.snapshot().snapshot(true); query.sort({ field: 'asc', test: -1 }); query.sort('field -test'); -query.stream().on('data', function (doc: any) { -}).on('error', function (err: any) { -}).on('close', function () { -}); query.tailable().tailable(false); query.then(cb).catch(cb); (new (query.toConstructor())(1, 2, 3)).toConstructor(); @@ -1023,7 +1032,7 @@ schemaembedded.sparse(true); * http://mongoosejs.com/docs/api.html#aggregate-js */ var aggregate: mongoose.Aggregate; -aggregate = mongoose.model('ex').aggregate({ $match: { age: { $gte: 21 }}}); +aggregate = mongoose.model('ex').aggregate([{ $match: { age: { $gte: 21 }}}]); aggregate = new mongoose.Aggregate(); aggregate = new mongoose.Aggregate({ $project: { a: 1, b: 1 } }); aggregate = new mongoose.Aggregate({ $project: { a: 1, b: 1 } }, { $skip: 5 }); @@ -1035,6 +1044,8 @@ aggregate.append([{ $match: { daw: 'Logic Audio X' }} ]); aggregate.collation({ locale: 'en_US', strength: 1 }); aggregate.cursor({ batchSize: 1000 }).exec().each(cb); aggregate.exec().then(cb).catch(cb); +aggregate.option({foo: 'bar'}).exec(); +const aggregateDotPipeline: any[] = aggregate.pipeline(); aggregate.explain(cb).then(cb).catch(cb); aggregate.group({ _id: "$department" }).group({ _id: "$department" }); aggregate.limit(10).limit(10); @@ -1241,7 +1252,7 @@ mongoose.model('').findOne({}) str.toLowerCase; }); -mongoose.model('').aggregate() +mongoose.model('').aggregate([]) .then(function (arg) { return 2; }).then(function (num) { @@ -1278,7 +1289,7 @@ MongoModel.find({}).$where('indexOf("val") !== -1').exec(function (err, docs) { docs[0].__v; }); MongoModel.findById(999, function (err, doc) { - var handleSave = function(err: Error, product: mongoose.Document, numAffected: number) {}; + var handleSave = function(err: Error, product: mongoose.Document) {}; if (!doc) { return; } @@ -1290,9 +1301,9 @@ MongoModel.findById(999, function (err, doc) { doc.save({ safe: { w: 'majority', wtimeout: 10000 } }, handleSave).then(cb).catch(cb); // test if Typescript can infer the types of (err, product, numAffected) - doc.save(function(err, product, numAffected) { product.save(); }) + doc.save(function(err, product) { product.save(); }) .then(function(p) { p.save() }).catch(cb); - doc.save({ validateBeforeSave: false }, function(err, product, numAffected) { + doc.save({ validateBeforeSave: false }, function(err, product) { product.save(); }).then(function(p) { p.save() }).catch(cb); }); @@ -1311,10 +1322,13 @@ mongoModel.save().then(function (product) { product.save().then(cb).catch(cb); }); MongoModel.aggregate( - { $group: { _id: null, maxBalance: { $max: '$balance' }}} - , { $project: { _id: 0, maxBalance: 1 }} - , cb); -MongoModel.aggregate() + [ + { $group: { _id: null, maxBalance: { $max: '$balance' }}}, + { $project: { _id: 0, maxBalance: 1 }} + ], + cb +); +MongoModel.aggregate([]) .group({ _id: null, maxBalance: { $max: '$balance' } }) .exec(cb); MongoModel.count({ type: 'jungle' }, function (err, count) { @@ -1402,14 +1416,6 @@ MongoModel.findOneAndUpdate({}, {}, {}); MongoModel.findOneAndUpdate({}, {}, cb); MongoModel.findOneAndUpdate({}, {}); MongoModel.findOneAndUpdate(); -MongoModel.geoNear([1,3], { maxDistance : 5, spherical : true }, function(err, results, stats) { - results[0].on('data', cb); -}); -MongoModel.geoNear({ type : "Point", coordinates : [9,9] }, { - maxDistance : 5, spherical : true -}, function(err, results, stats) { - console.log(results); -}); MongoModel.geoSearch({ type : "house" }, { near: [10, 10], maxDistance: 5 }, function(err, res) { @@ -1649,3 +1655,47 @@ const x = new extended({ username: 'hi', // required in baseSchema email: 'beddiw', // required in extededSchema }); + +new mongoose.Schema({}, { + timestamps: { + createdAt: 'foo', + updatedAt: 'bar' + } +}); + +new mongoose.Schema({}, { + collation: { + strength: 1, + locale: 'en_US' + } +}); + +new mongoose.Schema({}, { + toObject: { + versionKey: false + }, + toJSON: { + depopulate: true + } +}) + +const aggregatePrototypeGraphLookup: mongoose.Aggregate = MyModel.aggregate([]).graphLookup({}); +const addFieldsAgg: mongoose.Aggregate = aggregatePrototypeGraphLookup.addFields({}) + +MyModel.findById('foo').then((doc: mongoose.Document) => { + const a: boolean = doc.isDirectSelected('bar'); + const b: boolean = doc.isDeleted(); + doc.isDeleted(true); +}); + +MyModel.translateAliases({}); + +const queryPrototypeError: Error | null = MyModel.findById({}).error(); +const queryProrotypeErrorSetUnset: mongoose.Query = MyModel.findById({}).error(null).error(new Error('foo')); + +MyModel.createIndexes().then(() => {}); +MyModel.createIndexes((err: any): void => {}).then(() => {}); + +mongoose.connection.createCollection('foo').then(() => {}); +mongoose.connection.createCollection('foo', {wtimeout: 5}).then(() => {}); +mongoose.connection.createCollection('foo', {wtimeout: 5}, (err: Error, coll): void => {coll.collectionName}).then(() => {}); diff --git a/types/mongoose/tsconfig.json b/types/mongoose/tsconfig.json index 55e06ad201..04f1bc2b3b 100644 --- a/types/mongoose/tsconfig.json +++ b/types/mongoose/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose/v3/tsconfig.json b/types/mongoose/v3/tsconfig.json index 2ea987dff7..505d24e636 100644 --- a/types/mongoose/v3/tsconfig.json +++ b/types/mongoose/v3/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose/v4/README.md b/types/mongoose/v4/README.md new file mode 100644 index 0000000000..0ba91612e2 --- /dev/null +++ b/types/mongoose/v4/README.md @@ -0,0 +1,233 @@ +## MongooseJS Typescript Docs +Below are some examples of how to use these Definitions.
+Scenarios where the Typescript code is identical to plain Javascript code are omitted. + +### Table of Contents +* [Mongoose Methods, Properties, Constructors](#mongoose-methods-properties-constructors) +* [Creating and Saving Documents](#creating-and-saving-documents) +* [Promises](#promises) +* [Instance Methods, Virtual Properties](#instance-methods-and-virtual-properties) +* [Static Methods](#static-methods) +* [Plugins](#plugins) +* [FAQ and Common Mistakes](#faq-and-common-mistakes) + +#### Mongoose Methods, Properties, Constructors +You can call methods from the mongoose instance using: +```typescript +import * as mongoose from 'mongoose'; +var MyModel = mongoose.model(...); +var MySchema: mongoose.Schema = new mongoose.Schema(...); +``` + +Alternatively, you can import individual names and call them: +```typescript +import { model, Schema } from 'mongoose'; +var MyModel = model(...); +var MySchema: Schema = new Schema(...): +``` +[top](#mongoosejs-typescript-docs) + +#### Creating and Saving Documents +```typescript +import {Document, model, Model, Schema} from 'mongoose'; + +var UserSchema: Schema = new Schema({ + username: { + type: String, + required: true, + unique: true + }, + age: Number, + friends: [String], + data: [Schema.Types.Mixed] +}); + +interface IUser extends Document { + username: string; + age: number; + friends: string[]; + data: any[]; +} + +var UserModel: Model = model('User', UserSchema); + +var user = new UserModel({name: 'Jane'}); +user.username; // IUser properties are available +user.save(); // mongoose Document methods are available + +UserModel.findOne({}, (err: any, user: IUser) => { + user.username; // IUser properties are available + user.save(); // mongoose Document methods are available +}); +``` +[top](#mongoosejs-typescript-docs) + +#### Promises +These definitions use `global.Promise` by default. If you would like to use mongoose's own mpromise +definition (which is deprecated), you can install definitions for [mongoose-promise](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/mongoose-promise). + +If you'd like to use something other than `global.Promise`, you'll need to create a simple `.d.ts` file: +```typescript +// promise-bluebird.d.ts +import * as Bluebird from 'bluebird'; + +declare module 'mongoose' { + type Promise = Bluebird; +} + +// promise-q.d.ts +import * as Q from 'q'; + +declare module 'mongoose' { + type Promise = Q.Promise; +} + +// another-promise.d.ts +... +``` +To use it, you will need to `/// ` in one of your source code files, +or include the `.d.ts` file in your compile. + +To assign the new promise library in your code, you will need to use one of the following options (since +Typescript does not allow assigning properties of imported modules): + +* `(mongoose).Promise = YOUR_PROMISE;` +* `require('mongoose').Promise = YOUR_PROMISE;` +* `import mongoose = require('mongoose'); ... mongoose.Promise = YOUR_PROMISE;` + +[top](#mongoosejs-typescript-docs) + +#### Instance Methods and Virtual Properties +```typescript +import {Document, model, Model, Schema} from 'mongoose'; + +var UserSchema: Schema = new Schema({ + name: String +}); + +UserSchema.methods.method1 = function () { return '' }; + +UserSchema.virtual('nameInCaps').get(function () { + return this.name.toUpperCase(); +}); +UserSchema.virtual('nameInCaps').set(function (caps) { + this.name = caps.toLowerCase(); +}); + +interface IUser extends Document { + name: string; + method1: () => string; + nameInCaps: string; +} + +var UserModel: Model = model('User', UserSchema); +var user = new UserModel({name: 'Billy'}); + +user.method1(); // IUser methods are available +user.nameInCaps; // virtual properties can be used + +UserModel.findOne({}, (err: any, user: IUser) => { + user.method1(); // IUser methods are available + user.nameInCaps; // virtual properties can be used +}); +``` +[top](#mongoosejs-typescript-docs) + +#### Static Methods +```typescript +import {Document, model, Model, Schema} from 'mongoose'; + +var UserSchema = new Schema({}); +UserSchema.statics.static1 = function () { return '' }; + +interface IUserDocument extends Document {...} +interface IUserModel extends Model { + static1: () => string; +} + +var UserModel: IUserModel = model('User', UserSchema); +UserModel.static1(); // static methods are available +``` +[top](#mongoosejs-typescript-docs) + +#### Plugins +To write definitions for plugins, extend the mongoose module and create a simple plugin module: +```typescript +// plugin.d.ts +declare module 'mongoose' { + export interface PassportLocalDocument {...} + export interface PassportLocalSchema extends Schema {...} + export interface PassportLocalModel extends Model {...} + ... +} + +declare module 'passport-local-mongoose' { + import mongoose = require('mongoose'); + var _: (schema: mongoose.Schema, options?: Object) => void; + export = _; +} + +// user.ts +import { + model, + PassportLocalDocument, + PassportLocalSchema, + PassportLocalModel + Schema +} from 'mongoose'; +import * as passportLocalMongoose from 'passport-local-mongoose'; + +var UserSchema: PassportLocalSchema = new Schema({}); +UserSchema.plugin(passportLocalMongoose, options); + +interface IUser extends PassportLocalDocument {...} +interface IUserModel extends PassportLocalModel {...} + +var UserModel: IUserModel = model('User', UserSchema); +``` +Full example for [Passport Local Mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/passport-local-mongoose/passport-local-mongoose.d.ts)
+[top](#mongoosejs-typescript-docs) + +#### FAQ and Common Mistakes +**Q: When to use `mongoose.Schema.Types.ObjectId` and `mongoose.Types.ObjectId`**
+When creating schemas in code use `mongoose.Schema.Types.ObjectId`. This is not a type, this is an instance +of `SchemaType` containing metadata for the ObjectId type: +```typescript +var UserSchema = new mongoose.Schema({ + id: mongoose.Schema.Types.ObjectId +}); +``` +When defining your interface, you should use the type definition `mongoose.Types.ObjectId`: +```typescript +interface IUser extends mongoose.Document { + id: mongoose.Types.ObjectId; // for type-checking, doesn't affect code behaviour +} + +var UserSchema = new UserSchema({ + id: mongoose.Schema.Types.ObjectId; // for creating the schema only +}); + +var User = mongoose.model('User', UserSchema); +var user = new User({}); +user.id = new mongoose.Types.ObjectId(); +``` +[top](#mongoosejs-typescript-docs) + +**Q: Why are there 2 interfaces for Documents called Document and MongooseDocument?**
+People have been using this for a long time: +```typescript +interface IUser extends mongoose.Document { + ... +} +``` +When it should really be this: +```typescript +interface IUser extends mongoose.model { + ... +} +``` +For backwards compatibility Document is an interface for [mongoose.model](https://github.com/Automattic/mongoose/blob/master/lib/model.js#L3162)
+And MongooseDocument is an interface for [mongoose.Document](https://github.com/Automattic/mongoose/blob/master/lib/model.js#L3162)
+At some point in the future this may get fixed, which would require fixing your code. +
+[top](#mongoosejs-typescript-docs) diff --git a/types/mongoose/v4/index.d.ts b/types/mongoose/v4/index.d.ts new file mode 100644 index 0000000000..5f416b513a --- /dev/null +++ b/types/mongoose/v4/index.d.ts @@ -0,0 +1,2905 @@ +// Type definitions for Mongoose 4.7.1 +// Project: http://mongoosejs.com/ +// Definitions by: simonxca , horiuchi , sindrenm , lukasz-zak +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// +/// + + +/* + * Guidelines for maintaining these definitions: + * - If you spot an error here or there, please submit a PR. + * Give some examples/links to documentation if you can. + * + * For patches and minor releases: + * - Browse the changelog at https://github.com/Automattic/mongoose/blob/master/History.md + * and make necessary changes. Afterwards, update the version number at the top so we know + * which version we are on. + * + * For major releases: + * - Refer to the updated docs at http://mongoosejs.com/docs/api.html + * - On the left-hand side of the docs is a list of .js files. Reset and update the TODO list below + * then go through one-by-one, making any updates to params list, return type, etc. For documentation + * changes just copy/paste them into here. + * - Check the files off as you go. Some files below might not have anything in them. That's ok, this + * is just a simple heuristic to keep track of our progress. + * + * TODO for version 4.x [updated][tested]: + * [x][x] index.js + * [x][x] querystream.js + * [x][x] connection.js + * [x][x] utils.js + * [x][x] browser.js + * [x][x] drivers/node-mongodb-native/collection.js + * [x][x] drivers/node-mongodb-native/connection.js + * [x][x] error/messages.js + * [x][x] error/validation.js + * [x][x] error.js + * [x][x] querycursor.js + * [x][x] virtualtype.js + * [x][x] schema.js + * [x][x] document.js + * [x][x] types/subdocument.js + * [x][x] types/array.js + * [x][x] types/documentarray.js + * [x][x] types/buffer.js + * [x][x] types/objectid.js + * [x][x] types/embedded.js + * [x][x] query.js + * [x][x] schema/array.js + * [x][x] schema/string.js + * [x][x] schema/documentarray.js + * [x][x] schema/number.js + * [x][x] schema/date.js + * [x][x] schema/buffer.js + * [x][x] schema/boolean.js + * [x][x] schema/objectid.js + * [x][x] schema/mixed.js + * [x][x] schema/embedded.js + * [x][x] aggregate.js + * [x][x] schematype.js + * [x][x] promise.js + * [x][x] ES6Promise.js + * [x][x] model.js + * [x][x] collection.js + */ + +/* +For easier searching, add a header to each section like so: +To find a section, CTRL+F and type "section ___.js" +/* + * section filename.js + * http://mongoosejs.com/docs/api.html#filename-js + */ + +declare module "mongoose" { + import events = require('events'); + import mongodb = require('mongodb'); + import stream = require('stream'); + import mongoose = require('mongoose'); + + /* + * Some mongoose classes have the same name as the native JS classes + * Keep references to native classes using a "Native" prefix + */ + class NativeBuffer extends global.Buffer {} + class NativeDate extends global.Date {} + class NativeError extends global.Error {} + + /* + * section index.js + * http://mongoosejs.com/docs/api.html#index-js + */ + export var DocumentProvider: any; + // recursive constructor + export var Mongoose: new(...args: any[]) => typeof mongoose; + type Mongoose = typeof mongoose; + export var SchemaTypes: typeof Schema.Types; + + /** Expose connection states for user-land */ + export var STATES: any; + /** The default connection of the mongoose module. */ + export var connection: Connection; + /** The node-mongodb-native driver Mongoose uses. */ + export var mongo: typeof mongodb; + /** The Mongoose version */ + export var version: string; + + /** + * Opens the default mongoose connection. + * Options passed take precedence over options included in connection strings. + * @returns pseudo-promise wrapper around this + */ + export function connect(uris: string, + options?: ConnectionOptions, + callback?: (err: mongodb.MongoError) => void): MongooseThenable; + export function connect(uris: string, + callback?: (err: mongodb.MongoError) => void): MongooseThenable; + + /** + * Creates a Connection instance. + * Each connection instance maps to a single database. This method is helpful + * when mangaging multiple db connections. + * @param uri a mongodb:// URI + * @param options options to pass to the driver + * @returns the created Connection object + */ + export function createConnection(): Connection; + export function createConnection(uri: string, + options?: ConnectionOptions + ): Connection; + export function createConnection(host: string, database_name: string, port?: number, + options?: ConnectionOptions + ): Connection; + + /** + * Disconnects all connections. + * @param fn called after all connection close. + * @returns pseudo-promise wrapper around this + */ + export function disconnect(fn?: (error: any) => void): MongooseThenable; + + /** Gets mongoose options */ + export function get(key: string): any; + + /** + * Defines a model or retrieves it. + * Models defined on the mongoose instance are available to all connection + * created by the same mongoose instance. + * @param name model name + * @param collection (optional, induced from model name) + * @param skipInit whether to skip initialization (defaults to false) + */ + export function model(name: string, schema?: Schema, collection?: string, + skipInit?: boolean): Model; + export function model>( + name: string, + schema?: Schema, + collection?: string, + skipInit?: boolean + ): U; + + /** + * Returns an array of model names created on this instance of Mongoose. + * Does not include names of models created using connection.model(). + */ + export function modelNames(): string[]; + + /** + * Declares a global plugin executed on all Schemas. + * Equivalent to calling .plugin(fn) on each Schema you create. + * @param fn plugin callback + * @param opts optional options + */ + export function plugin(fn: Function, opts?: any): typeof mongoose; + + /** Sets mongoose options */ + export function set(key: string, value: any): void; + + type MongooseThenable = typeof mongoose & { + /** + * Ability to use mongoose object as a pseudo-promise so .connect().then() + * and .disconnect().then() are viable. + */ + then(onFulfill?: () => void | TRes | PromiseLike, + onRejected?: (err: mongodb.MongoError) => void | TRes | PromiseLike): Promise; + + /** + * Ability to use mongoose object as a pseudo-promise so .connect().then() + * and .disconnect().then() are viable. + */ + catch(onRejected?: (err: mongodb.MongoError) => void | TRes | PromiseLike): Promise; + } + + class CastError extends Error { + /** + * The Mongoose CastError constructor + * @param type The name of the type + * @param value The value that failed to cast + * @param path The path a.b.c in the doc where this cast error occurred + * @param reason The original error that was thrown + */ + constructor(type: string, value: any, path: string, reason?: NativeError); + } + + /* + * section querystream.js + * http://mongoosejs.com/docs/api.html#querystream-js + * + * QueryStream can only be accessed using query#stream(), we only + * expose its interface here. + */ + interface QueryStream extends stream.Stream { + /** + * Provides a Node.js 0.8 style ReadStream interface for Queries. + * @event data emits a single Mongoose document + * @event error emits when an error occurs during streaming. This will emit before the close event. + * @event close emits when the stream reaches the end of the cursor or an error occurs, or the stream + * is manually destroyed. After this event, no more events are emitted. + */ + constructor(query: Query, options?: { + /** + * optional function which accepts a mongoose document. The return value + * of the function will be emitted on data. + */ + transform?: Function; + [other: string]: any; + }): QueryStream; + + /** + * Destroys the stream, closing the underlying cursor, which emits the close event. + * No more events will be emitted after the close event. + */ + destroy(err?: NativeError): void; + + /** Pauses this stream. */ + pause(): void; + /** Pipes this query stream into another stream. This method is inherited from NodeJS Streams. */ + pipe(destination: T, options?: { end?: boolean; }): T; + /** Resumes this stream. */ + resume(): void; + + /** Flag stating whether or not this stream is paused. */ + paused: boolean; + /** Flag stating whether or not this stream is readable. */ + readable: boolean; + } + + /* + * section connection.js + * http://mongoosejs.com/docs/api.html#connection-js + * + * The Connection class exposed by require('mongoose') + * is actually the driver's NativeConnection class. + * connection.js defines a base class that the native + * versions extend. See: + * http://mongoosejs.com/docs/api.html#drivers-node-mongodb-native-connection-js + */ + abstract class ConnectionBase extends events.EventEmitter { + /** + * For practical reasons, a Connection equals a Db. + * @param base a mongoose instance + * @event connecting Emitted when connection.{open,openSet}() is executed on this connection. + * @event connected Emitted when this connection successfully connects to the db. May be emitted multiple times in reconnected scenarios. + * @event open Emitted after we connected and onOpen is executed on all of this connections models. + * @event disconnecting Emitted when connection.close() was executed. + * @event disconnected Emitted after getting disconnected from the db. + * @event close Emitted after we disconnected and onClose executed on all of this connections models. + * @event reconnected Emitted after we connected and subsequently disconnected, followed by successfully another successfull connection. + * @event error Emitted when an error occurs on this connection. + * @event fullsetup Emitted in a replica-set scenario, when primary and at least one seconaries specified in the connection string are connected. + * @event all Emitted in a replica-set scenario, when all nodes specified in the connection string are connected. + */ + constructor(base: typeof mongoose); + + /** + * Opens the connection to MongoDB. + * @param mongodb://uri or the host to which you are connecting + * @param database database name + * @param port database port + * @param options Mongoose forces the db option forceServerObjectId false and cannot be overridden. + * Mongoose defaults the server auto_reconnect options to true which can be overridden. + * See the node-mongodb-native driver instance for options that it understands. + * Options passed take precedence over options included in connection strings. + */ + open(connection_string: string, database?: string, port?: number, + options?: ConnectionOpenOptions, callback?: (err: any) => void): any; + + /** Helper for dropDatabase() */ + dropDatabase(callback?: (err: any) => void): Promise; + + /** + * Opens the connection to a replica set. + * @param uris comma-separated mongodb:// URIs + * @param database database name if not included in uris + * @param options passed to the internal driver + */ + openSet(uris: string, database?: string, options?: ConnectionOpenSetOptions, + callback?: (err: any) => void): any; + + /** Closes the connection */ + close(callback?: (err: any) => void): Promise; + + /** + * Retrieves a collection, creating it if not cached. + * Not typically needed by applications. Just talk to your collection through your model. + * @param name name of the collection + * @param options optional collection options + */ + collection(name: string, options?: any): Collection; + + /** + * Defines or retrieves a model. + * When no collection argument is passed, Mongoose produces a collection name by passing + * the model name to the utils.toCollectionName method. This method pluralizes the name. + * If you don't like this behavior, either pass a collection name or set your schemas + * collection name option. + * @param name the model name + * @param schema a schema. necessary when defining a model + * @param collection name of mongodb collection (optional) if not given it will be induced from model name + * @returns The compiled model + */ + model(name: string, schema?: Schema, collection?: string): Model; + model>( + name: string, + schema?: Schema, + collection?: string + ): U; + + /** Returns an array of model names created on this connection. */ + modelNames(): string[]; + + /** A hash of the global options that are associated with this connection */ + config: any; + + /** The mongodb.Db instance, set when the connection is opened */ + db: mongodb.Db; + + /** A hash of the collections associated with this connection */ + collections: { [index: string]: Collection }; + + /** + * Connection ready state + * 0 = disconnected + * 1 = connected + * 2 = connecting + * 3 = disconnecting + * Each state change emits its associated event name. + */ + readyState: number; + } + + interface ConnectionOptionsBase { + /** passed to the connection db instance */ + db?: any; + /** passed to the connection server instance(s) */ + server?: any; + /** passed to the connection ReplSet instance */ + replset?: any; + /** username for authentication */ + user?: string; + /** password for authentication */ + pass?: string; + /** options for authentication (see http://mongodb.github.com/node-mongodb-native/api-generated/db.html#authenticate) */ + auth?: any; + /** Use ssl connection (needs to have a mongod server with ssl support) (default: true) */ + ssl?: boolean; + /** Validate mongod server certificate against ca (needs to have a mongod server with ssl support, 2.4 or higher) */ + sslValidate?: object; + /** Number of connections in the connection pool for each server instance, set to 5 as default for legacy reasons. */ + poolSize?: number; + /** Reconnect on error (default: true) */ + autoReconnect?: boolean; + /** TCP KeepAlive on the socket with a X ms delay before start (default: 0). */ + keepAlive?: number; + /** TCP Connection timeout setting (default: 0) */ + connectTimeoutMS?: number; + /** TCP Socket timeout setting (default: 0) */ + socketTimeoutMS?: number; + /** If the database authentication is dependent on another databaseName. */ + authSource?: string; + /** If you're connected to a single server or mongos proxy (as opposed to a replica set), + * the MongoDB driver will try to reconnect every reconnectInterval milliseconds for reconnectTries + * times, and give up afterward. When the driver gives up, the mongoose connection emits a + * reconnectFailed event. (default: 30) */ + reconnectTries?: number; + /** Will wait # milliseconds between retries (default: 1000) */ + reconnectInterval?: number; + /** The name of the replicaset to connect to. */ + replicaSet?: string; + /** The current value of the parameter native_parser */ + nativeParser?: boolean; + /** Auth mechanism */ + authMechanism?: any; + /** Specify a journal write concern (default: false). */ + journal?: boolean; + /** The write concern */ + w?: number|string; + /** The write concern timeout. */ + wTimeoutMS?: number; + /** The ReadPreference mode as listed here: http://mongodb.github.io/node-mongodb-native/2.1/api/ReadPreference.html */ + readPreference?: string; + /** An object representing read preference tags, see: http://mongodb.github.io/node-mongodb-native/2.1/api/ReadPreference.html */ + readPreferencetags?: object; + /** Triggers the server instance to call ismaster (default: true). */ + monitoring?: boolean; + /** The interval of calling ismaster when monitoring is enabled (default: 10000). */ + haInterval?: number; + /** Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit (default: false). */ + domainsEnabled?: boolean; + /** How long driver keeps waiting for servers to come back up (default: Number.MAX_VALUE) */ + bufferMaxEntries?: number; + + // TODO + safe?: any; + fsync?: any; + rs_name?: any; + slaveOk?: any; + authdb?: any; + } + + /** See the node-mongodb-native driver instance for options that it understands. */ + interface ConnectionOpenOptions extends ConnectionOptionsBase { + /** mongoose-specific options */ + config?: { + /** + * set to false to disable automatic index creation for all + * models associated with this connection. + */ + autoIndex?: boolean; + }; + } + + /** See the node-mongodb-native driver instance for options that it understands. */ + interface ConnectionOpenSetOptions extends ConnectionOptionsBase { + /** + * If true, enables High Availability support for mongos + * If connecting to multiple mongos servers, set the mongos option to true. + */ + mongos?: boolean; + + /** sets the underlying driver's promise library (see http://mongodb.github.io/node-mongodb-native/2.1/api/MongoClient.html) */ + promiseLibrary?: any; + + /** See http://mongoosejs.com/docs/connections.html#use-mongo-client **/ + useMongoClient?: boolean; + } + + interface ConnectionOptions extends + ConnectionOpenOptions, + ConnectionOpenSetOptions {} + + /* + * section drivers/node-mongodb-native/collection.js + * http://mongoosejs.com/docs/api.html#drivers-node-mongodb-native-collection-js + */ + var Collection: Collection; + interface Collection extends CollectionBase { + /** + * Collection constructor + * @param name name of the collection + * @param conn A MongooseConnection instance + * @param opts optional collection options + */ + new(name: string, conn: Connection, opts?: any): Collection; + /** Formatter for debug print args */ + $format(arg: any): string; + /** Debug print helper */ + $print(name: any, i: any, args: any[]): void; + /** Retreives information about this collections indexes. */ + getIndexes(): any; + } + + /* + * section drivers/node-mongodb-native/connection.js + * http://mongoosejs.com/docs/api.html#drivers-node-mongodb-native-connection-js + */ + class Connection extends ConnectionBase { + /** + * Switches to a different database using the same connection pool. + * @param name The database name + * @returns New Connection Object + */ + useDb(name: string): Connection; + + /** Expose the possible connection states. */ + static STATES: any; + } + + /* + * section error/validation.js + * http://mongoosejs.com/docs/api.html#error-validation-js + */ + class ValidationError extends Error { + /** Console.log helper */ + toString(): string; + } + + /* + * section error.js + * http://mongoosejs.com/docs/api.html#error-js + */ + class Error extends global.Error { + /** + * MongooseError constructor + * @param msg Error message + */ + constructor(msg: string); + + /** + * The default built-in validator error messages. These may be customized. + * As you might have noticed, error messages support basic templating + * {PATH} is replaced with the invalid document path + * {VALUE} is replaced with the invalid value + * {TYPE} is replaced with the validator type such as "regexp", "min", or "user defined" + * {MIN} is replaced with the declared min value for the Number.min validator + * {MAX} is replaced with the declared max value for the Number.max validator + */ + static messages: any; + + /** For backwards compatibility. Same as mongoose.Error.messages */ + static Messages: any; + } + + interface EachAsyncOptions { + /** defaults to 1 */ + parallel?: number; + } + + /* + * section querycursor.js + * http://mongoosejs.com/docs/api.html#querycursor-js + * + * Callback signatures are from: http://mongodb.github.io/node-mongodb-native/2.1/api/Cursor.html#close + * QueryCursor can only be accessed by query#cursor(), we only + * expose its interface to enable type-checking. + */ + interface QueryCursor extends stream.Readable { + /** + * A QueryCursor is a concurrency primitive for processing query results + * one document at a time. A QueryCursor fulfills the Node.js streams3 API, + * in addition to several other mechanisms for loading documents from MongoDB + * one at a time. + * Unless you're an advanced user, do not instantiate this class directly. + * Use Query#cursor() instead. + * @param options query options passed to .find() + * @event cursor Emitted when the cursor is created + * @event error Emitted when an error occurred + * @event data Emitted when the stream is flowing and the next doc is ready + * @event end Emitted when the stream is exhausted + */ + constructor(query: Query, options: any): QueryCursor; + + /** Marks this cursor as closed. Will stop streaming and subsequent calls to next() will error. */ + close(callback?: (error: any, result: any) => void): Promise; + + /** + * Execute fn for every document in the cursor. If fn returns a promise, + * will wait for the promise to resolve before iterating on to the next one. + * Returns a promise that resolves when done. + * @param fn Function to be executed for every document in the cursor + * @param callback Executed when all docs have been processed + */ + eachAsync(fn: (doc: T) => any, callback?: (err: any) => void): Promise; + + /** + * Execute fn for every document in the cursor. If fn returns a promise, + * will wait for the promise to resolve before iterating on to the next one. + * Returns a promise that resolves when done. + * @param fn Function to be executed for every document in the cursor + * @param options Async options (e. g. parallel function execution) + * @param callback Executed when all docs have been processed + */ + eachAsync(fn: (doc: T) => any, options: EachAsyncOptions, callback?: (err: any) => void): Promise; + + /** + * Registers a transform function which subsequently maps documents retrieved + * via the streams interface or .next() + */ + map(fn: (doc: T) => T): this; + + /** + * Get the next document from this cursor. Will return null when there are + * no documents left. + */ + next(callback?: (err: any, doc?: T) => void): Promise; + } + + /* + * section virtualtype.js + * http://mongoosejs.com/docs/api.html#virtualtype-js + */ + class VirtualType { + /** This is what mongoose uses to define virtual attributes via Schema.prototype.virtual. */ + constructor(options: any, name: string); + /** Applies getters to value using optional scope. */ + applyGetters(value: any, scope: any): any; + /** Applies setters to value using optional scope. */ + applySetters(value: any, scope: any): any; + /** Defines a getter. */ + get(fn: Function): this; + /** Defines a setter. */ + set(fn: Function): this; + } + + /* + * section schema.js + * http://mongoosejs.com/docs/api.html#schema-js + */ + class Schema extends events.EventEmitter { + /** + * Schema constructor. + * When nesting schemas, (children in the example above), always declare + * the child schema first before passing it into its parent. + * @event init Emitted after the schema is compiled into a Model. + */ + constructor(definition?: SchemaDefinition, options?: SchemaOptions); + + /** Adds key path / schema type pairs to this schema. */ + add(obj: SchemaDefinition, prefix?: string): void; + + /** + * Iterates the schemas paths similar to Array.forEach. + * @param fn callback function + * @returns this + */ + eachPath(fn: (path: string, type: SchemaType) => void): this; + + /** + * Gets a schema option. + * @param key option name + */ + get(key: string): any; + + /** + * Defines an index (most likely compound) for this schema. + * @param options Options to pass to MongoDB driver's createIndex() function + * @param options.expires Mongoose-specific syntactic sugar, uses ms to convert + * expires option into seconds for the expireAfterSeconds in the above link. + */ + index(fields: any, options?: { + expires?: string; + [other: string]: any; + }): this; + + /** Compiles indexes from fields and schema-level indexes */ + indexes(): any[]; + + /** + * Loads an ES6 class into a schema. Maps setters + getters, static methods, and + * instance methods to schema virtuals, statics, and methods. + */ + loadClass(model: Function): this; + + /** + * Adds an instance method to documents constructed from Models compiled from this schema. + * If a hash of name/fn pairs is passed as the only argument, each name/fn pair will be added as methods. + */ + method(method: string, fn: Function): this; + method(methodObj: { [name: string]: Function }): this; + + /** + * Gets/sets schema paths. + * Sets a path (if arity 2) + * Gets a path (if arity 1) + */ + path(path: string): SchemaType; + path(path: string, constructor: any): this; + + /** + * Returns the pathType of path for this schema. + * @returns whether it is a real, virtual, nested, or ad-hoc/undefined path. + */ + pathType(path: string): string; + + /** + * Registers a plugin for this schema. + * @param plugin callback + */ + plugin(plugin: (schema: Schema, options?: any) => void, opts?: any): this; + + /** + * Defines a post hook for the document + * Post hooks fire on the event emitted from document instances of Models compiled + * from this schema. + * @param method name of the method to hook + * @param fn callback + */ + post(method: string, fn: ( + error: mongodb.MongoError, doc: T, next: (err?: NativeError) => void + ) => void): this; + + post(method: string, fn: ( + doc: T, next: (err?: NativeError) => void + ) => void): this; + + /** + * Defines a pre hook for the document. + */ + pre(method: string, parallel: boolean, fn: HookAsyncCallback, errorCb?: HookErrorCallback): this; + pre(method: string, fn: HookSyncCallback, errorCb?: HookErrorCallback): this; + + /** + * Adds a method call to the queue. + * @param name name of the document method to call later + * @param args arguments to pass to the method + */ + queue(name: string, args: any[]): this; + + /** + * Removes the given path (or [paths]). + */ + remove(path: string | string[]): void; + + /** + * @param invalidate refresh the cache + * @returns an Array of path strings that are required by this schema. + */ + requiredPaths(invalidate?: boolean): string[]; + + /** + * Sets/gets a schema option. + * @param key option name + * @param value if not passed, the current option value is returned + */ + set(key: string): any; + set(key: string, value: any): this; + + /** + * Adds static "class" methods to Models compiled from this schema. + */ + static(name: string, fn: Function): this; + static(nameObj: { [name: string]: Function }): this; + + /** Creates a virtual type with the given name. */ + virtual(name: string, options?: any): VirtualType; + + /** Returns the virtual type with the given name. */ + virtualpath(name: string): VirtualType; + + /** The allowed index types */ + static indexTypes: string[]; + + /** + * Reserved document keys. + * Keys in this object are names that are rejected in schema declarations + * b/c they conflict with mongoose functionality. Using these key name + * will throw an error. + */ + static reserved: any; + + /** Object of currently defined methods on this schema. */ + methods: any; + /** Object of currently defined statics on this schema. */ + statics: any; + /** The original object passed to the schema constructor */ + obj: any; + } + + // Hook functions: https://github.com/vkarpov15/hooks-fixed + interface HookSyncCallback { + (next: HookNextFunction, ...hookArgs:any[]): any; + } + + interface HookAsyncCallback { + (next: HookNextFunction, done: HookDoneFunction, ...hookArgs: any[]): any; + } + + interface HookErrorCallback { + (error: Error): any; + } + + interface HookNextFunction { + (error: Error): any; + (...hookArgs: any[]): any; + } + + interface HookDoneFunction { + (error: Error): any; + (...hookArgs: any[]): any; + } + + interface SchemaOptions { + /** defaults to null (which means use the connection's autoIndex option) */ + autoIndex?: boolean; + /** defaults to true */ + bufferCommands?: boolean; + /** defaults to false */ + capped?: boolean | number | { size?: number; max?: number; autoIndexId?: boolean; }; + /** no default */ + collection?: string; + /** defaults to "__t" */ + discriminatorKey?: string; + /** defaults to false. */ + emitIndexErrors?: boolean; + /** defaults to true */ + id?: boolean; + /** defaults to true */ + _id?: boolean; + /** controls document#toObject behavior when called manually - defaults to true */ + minimize?: boolean; + read?: string; + /** defaults to true. */ + safe?: boolean | { w?: number | string; wtimeout?: number; j?: boolean }; + /** defaults to null */ + shardKey?: boolean; + /** defaults to true */ + strict?: boolean; + /** no default */ + toJSON?: any; + /** no default */ + toObject?: any; + /** defaults to 'type' */ + typeKey?: string; + /** defaults to false */ + useNestedStrict?: boolean; + /** defaults to false */ + usePushEach?: boolean; + /** defaults to true */ + validateBeforeSave?: boolean; + /** defaults to "__v" */ + versionKey?: string|boolean; + /** defaults to false */ + retainKeyOrder?: boolean; + /** + * skipVersioning allows excluding paths from + * versioning (the internal revision will not be + * incremented even if these paths are updated). + */ + skipVersioning?: any; + /** + * If set timestamps, mongoose assigns createdAt + * and updatedAt fields to your schema, the type + * assigned is Date. + */ + timestamps?: any; + } + + /* + * Intellisense for Schema definitions + */ + interface SchemaDefinition { + [path: string]: SchemaTypeOpts | Schema | SchemaType; + } + + /* + * The standard options available when configuring a schema type: + * new Schema({ + * name: { + * type: String, + * required: true, + * ... + * } + * }); + * + * Note: the properties have Object as a fallback type: | Object + * because this interface does not apply to a schematype that + * does not have a type property. Ex: + * new Schema({ + * name: { + * first: String, // since name does not have a "type" property + * last: String // first and last can have any valid type + * ... + * } + * }); + * + * References: + * - http://mongoosejs.com/docs/schematypes.html + * - http://mongoosejs.com/docs/api.html#schema_Schema.Types + */ + interface SchemaTypeOpts { + /* Common Options for all schema types */ + type?: T; + + /** Sets a default value for this SchemaType. */ + default?: SchemaTypeOpts.DefaultFn | T; + + /** + * Getters allow you to transform the representation of the data as it travels + * from the raw mongodb document to the value that you see. + */ + get?: (value: T, schematype?: this) => T | any; + + /** Declares the index options for this schematype. */ + index?: SchemaTypeOpts.IndexOpts | boolean | string; + + /** + * Adds a required validator to this SchemaType. The validator gets added + * to the front of this SchemaType's validators array using unshift(). + */ + required?: SchemaTypeOpts.RequiredFn | + boolean | [boolean, string] | + string | [string, string] | + any; + + /** + * Sets default select() behavior for this path. + * Set to true if this path should always be included in the results, false + * if it should be excluded by default. This setting can be overridden at + * the query level. + */ + select?: boolean | any; + + /** + * Setters allow you to transform the data before it gets to the raw mongodb + * document and is set as a value on an actual key. + */ + set?: (value: T, schematype?: this) => T | any; + + /** Declares a sparse index. */ + sparse?: boolean | any; + + /** Declares a full text index. */ + text?: boolean | any; + + /** + * Adds validator(s) for this document path. + * Validators always receive the value to validate as their first argument + * and must return Boolean. Returning false means validation failed. + */ + validate?: RegExp | [RegExp, string] | + SchemaTypeOpts.ValidateFn | [SchemaTypeOpts.ValidateFn, string] | + SchemaTypeOpts.ValidateOpts | SchemaTypeOpts.ValidateOpts[] | + any; + + /** Declares an unique index. */ + unique?: boolean | any; + + + /* Options for specific schema types (String, Number, Date, etc.) */ + /** String only - Adds an enum validator */ + enum?: T[] | SchemaTypeOpts.EnumOpts | any; + /** String only - Adds a lowercase setter. */ + lowercase?: boolean | any; + /** String only - Sets a regexp validator. */ + match?: RegExp | [RegExp, string] | any; + /** String only - Sets a maximum length validator. */ + maxlength?: number | [number, string] | any; + /** String only - Sets a minimum length validator. */ + minlength?: number | [number, string] | any; + /** String only - Adds a trim setter. */ + trim?: boolean | any; + /** String only - Adds an uppercase setter. */ + uppercase?: boolean | any; + + /** + * Date, Number only - Sets a minimum number validator. + * Sets a minimum date validator. + */ + min?: number | [number, string] | + Date | [Date, string] | + any; + + /** + * Date, Number only - Sets a maximum number validator. + * Sets a maximum date validator. + */ + max?: number | [number, string] | + Date | [Date, string] | + any; + + /** + * Date only - Declares a TTL index (rounded to the nearest second) + * for Date types only. + */ + expires?: number | string | any; + + /** ObjectId only - Adds an auto-generated ObjectId default if turnOn is true. */ + auto?: boolean | any; + + [other: string]: any; + } + + // Interfaces specific to schema type options should be scoped in this namespace + namespace SchemaTypeOpts { + interface DefaultFn { + (...args: any[]): T; + } + + interface RequiredFn { + (required: boolean, message?: string): T; + } + + interface ValidateFn { + (obj: RegExp | Function, message?: string, type?: string): T; + } + + interface ValidateOpts { + validator?: RegExp | Function, + msg?: string, + type?: string + } + + interface EnumOpts { + values?: T[]; + message?: string; + } + + interface IndexOpts { + background?: boolean, + expires?: number | string + sparse?: boolean, + type?: string, + unique?: boolean, + } + } + + /* + * section document.js + * http://mongoosejs.com/docs/api.html#document-js + */ + interface MongooseDocument extends MongooseDocumentOptionals { } + class MongooseDocument { + /** Checks if a path is set to its default. */ + $isDefault(path?: string): boolean; + + /** + * Takes a populated field and returns it to its unpopulated state. + * If the path was not populated, this is a no-op. + */ + depopulate(path: string): void; + + /** + * Returns true if the Document stores the same data as doc. + * Documents are considered equal when they have matching _ids, unless neither document + * has an _id, in which case this function falls back to usin deepEqual(). + * @param doc a document to compare + */ + equals(doc: MongooseDocument): boolean; + + /** + * Explicitly executes population and returns a promise. + * Useful for ES2015 integration. + * @returns promise that resolves to the document when population is done + */ + execPopulate(): Promise; + + /** + * Returns the value of a path. + * @param type optionally specify a type for on-the-fly attributes + */ + get(path: string, type?: any): any; + + /** + * Initializes the document without setters or marking anything modified. + * Called internally after a document is returned from mongodb. + * @param doc document returned by mongo + * @param fn callback + */ + init(doc: MongooseDocument, fn?: () => void): this; + init(doc: MongooseDocument, opts: any, fn?: () => void): this; + + /** Helper for console.log */ + inspect(options?: any): any; + + /** + * Marks a path as invalid, causing validation to fail. + * The errorMsg argument will become the message of the ValidationError. + * The value argument (if passed) will be available through the ValidationError.value property. + * @param path the field to invalidate + * @param errorMsg the error which states the reason path was invalid + * @param value optional invalid value + * @param kind optional kind property for the error + * @returns the current ValidationError, with all currently invalidated paths + */ + invalidate(path: string, errorMsg: string | NativeError, value: any, kind?: string): ValidationError | boolean; + + /** Returns true if path was directly set and modified, else false. */ + isDirectModified(path: string): boolean; + + /** Checks if path was initialized */ + isInit(path: string): boolean; + + /** + * Returns true if this document was modified, else false. + * If path is given, checks if a path or any full path containing path as part of its path + * chain has been modified. + */ + isModified(path?: string): boolean; + + /** Checks if path was selected in the source query which initialized this document. */ + isSelected(path: string): boolean; + + /** + * Marks the path as having pending changes to write to the db. + * Very helpful when using Mixed types. + * @param path the path to mark modified + */ + markModified(path: string): void; + + /** Returns the list of paths that have been modified. */ + modifiedPaths(): string[]; + + /** + * Populates document references, executing the callback when complete. + * If you want to use promises instead, use this function with + * execPopulate() + * Population does not occur unless a callback is passed or you explicitly + * call execPopulate(). Passing the same path a second time will overwrite + * the previous path options. See Model.populate() for explaination of options. + * @param path The path to populate or an options object + * @param names The properties to fetch from the populated document + * @param callback When passed, population is invoked + */ + populate(callback: (err: any, res: this) => void): this; + populate(path: string, callback?: (err: any, res: this) => void): this; + populate(path: string, names: string, callback?: (err: any, res: this) => void): this; + populate(options: ModelPopulateOptions | ModelPopulateOptions[], callback?: (err: any, res: this) => void): this; + + /** Gets _id(s) used during population of the given path. If the path was not populated, undefined is returned. */ + populated(path: string): any; + + /** + * Sets the value of a path, or many paths. + * @param path path or object of key/vals to set + * @param val the value to set + * @param type optionally specify a type for "on-the-fly" attributes + * @param options optionally specify options that modify the behavior of the set + */ + set(path: string, val: any, options?: any): this; + set(path: string, val: any, type: any, options?: any): this; + set(value: any): this; + + /** + * The return value of this method is used in calls to JSON.stringify(doc). + * This method accepts the same options as Document#toObject. To apply the + * options to every document of your schema by default, set your schemas + * toJSON option to the same argument. + */ + toJSON(options?: DocumentToObjectOptions): any; + + /** + * Converts this document into a plain javascript object, ready for storage in MongoDB. + * Buffers are converted to instances of mongodb.Binary for proper storage. + */ + toObject(options?: DocumentToObjectOptions): any; + + /** Helper for console.log */ + toString(): string; + + /** + * Clears the modified state on the specified path. + * @param path the path to unmark modified + */ + unmarkModified(path: string): void; + + /** Sends an update command with this document _id as the query selector. */ + update(doc: any, callback?: (err: any, raw: any) => void): Query; + update(doc: any, options: ModelUpdateOptions, + callback?: (err: any, raw: any) => void): Query; + + /** + * Executes registered validation rules for this document. + * @param optional options internal options + * @param callback callback called after validation completes, passing an error if one occurred + */ + validate(callback?: (err: any) => void): Promise; + validate(optional: any, callback?: (err: any) => void): Promise; + + /** + * Executes registered validation rules (skipping asynchronous validators) for this document. + * This method is useful if you need synchronous validation. + * @param pathsToValidate only validate the given paths + * @returns MongooseError if there are errors during validation, or undefined if there is no error. + */ + validateSync(pathsToValidate?: string | string[]): Error; + + /** Hash containing current validation errors. */ + errors: any; + /** This documents _id. */ + _id: any; + /** Boolean flag specifying if the document is new. */ + isNew: boolean; + /** The documents schema. */ + schema: Schema; + } + + interface MongooseDocumentOptionals { + /** + * Virtual getter that by default returns the document's _id field cast to a string, + * or in the case of ObjectIds, its hexString. This id getter may be disabled by + * passing the option { id: false } at schema construction time. If disabled, id + * behaves like any other field on a document and can be assigned any value. + */ + id?: any; + } + + interface DocumentToObjectOptions { + /** apply all getters (path and virtual getters) */ + getters?: boolean; + /** apply virtual getters (can override getters option) */ + virtuals?: boolean; + /** remove empty objects (defaults to true) */ + minimize?: boolean; + /** + * A transform function to apply to the resulting document before returning + * @param doc The mongoose document which is being converted + * @param ret The plain object representation which has been converted + * @param options The options in use (either schema options or the options passed inline) + */ + transform?: (doc: any, ret: any, options: any) => any; + /** depopulate any populated paths, replacing them with their original refs (defaults to false) */ + depopulate?: boolean; + /** whether to include the version key (defaults to true) */ + versionKey?: boolean; + /** + * keep the order of object keys. If this is set to true, + * Object.keys(new Doc({ a: 1, b: 2}).toObject()) will + * always produce ['a', 'b'] (defaults to false) + */ + retainKeyOrder?: boolean; + } + + namespace Types { + /* + * section types/subdocument.js + * http://mongoosejs.com/docs/api.html#types-subdocument-js + */ + class Subdocument extends MongooseDocument { + /** Returns the top level document of this sub-document. */ + ownerDocument(): MongooseDocument; + + /** + * Null-out this subdoc + * @param callback optional callback for compatibility with Document.prototype.remove + */ + remove(callback?: (err: any) => void): void; + remove(options: any, callback?: (err: any) => void): void; + } + + /* + * section types/array.js + * http://mongoosejs.com/docs/api.html#types-array-js + */ + class Array extends global.Array { + /** + * Atomically shifts the array at most one time per document save(). + * Calling this mulitple times on an array before saving sends the same command as + * calling it once. This update is implemented using the MongoDB $pop method which + * enforces this restriction. + */ + $shift(): T; + + /** Alias of pull */ + remove(...args: any[]): this; + + /** + * Pops the array atomically at most one time per document save(). + * Calling this mulitple times on an array before saving sends the same command as + * calling it once. This update is implemented using the MongoDB $pop method which + * enforces this restriction. + */ + $pop(): T; + + /** + * Adds values to the array if not already present. + * @returns the values that were added + */ + addToSet(...args: any[]): T[]; + + /** + * Return the index of obj or -1 if not found. + * @param obj he item to look for + */ + indexOf(obj: any): number; + + /** Helper for console.log */ + inspect(): any; + + /** + * Marks the entire array as modified, which if saved, will store it as a $set + * operation, potentially overwritting any changes that happen between when you + * retrieved the object and when you save it. + * @returns new length of the array + */ + nonAtomicPush(...args: any[]): number; + + /** + * Wraps Array#pop with proper change tracking. + * marks the entire array as modified which will pass the entire thing to $set + * potentially overwritting any changes that happen between when you retrieved + * the object and when you save it. + */ + pop(): T; + + /** + * Pulls items from the array atomically. Equality is determined by casting + * the provided value to an embedded document and comparing using + * the Document.equals() function. + */ + pull(...args: any[]): this; + + /** + * Wraps Array#push with proper change tracking. + * @returns new length of the array + */ + push(...args: any[]): number; + + /** Sets the casted val at index i and marks the array modified. */ + set(i: number, val: any): this; + + /** + * Wraps Array#shift with proper change tracking. + * Marks the entire array as modified, which if saved, will store it as a $set operation, + * potentially overwritting any changes that happen between when you retrieved the object + * and when you save it. + */ + shift(): T; + + /** + * Wraps Array#sort with proper change tracking. + * Marks the entire array as modified, which if saved, will store it as a $set operation, + * potentially overwritting any changes that happen between when you retrieved the object + * and when you save it. + */ + // some lib.d.ts have return type "this" and others have return type "T[]" + // which causes errors. Let the inherited array provide the sort() method. + //sort(compareFn?: (a: T, b: T) => number): T[]; + + /** + * Wraps Array#splice with proper change tracking and casting. + * Marks the entire array as modified, which if saved, will store it as a $set operation, + * potentially overwritting any changes that happen between when you retrieved the object + * and when you save it. + */ + splice(...args: any[]): T[]; + + /** Returns a native js Array. */ + toObject(options?: any): T[]; + + /** + * Wraps Array#unshift with proper change tracking. + * Marks the entire array as modified, which if saved, will store it as a $set operation, + * potentially overwritting any changes that happen between when you retrieved the object + * and when you save it. + */ + unshift(...args: any[]): number; + } + + /* + * section types/documentarray.js + * http://mongoosejs.com/docs/api.html#types-documentarray-js + */ + class DocumentArray extends Types.Array { + /** + * Creates a subdocument casted to this schema. + * This is the same subdocument constructor used for casting. + * @param obj the value to cast to this arrays SubDocument schema + */ + create(obj: any): T; + + /** + * Searches array items for the first document with a matching _id. + * @returns the subdocument or null if not found. + */ + id(id: ObjectId | string | number | NativeBuffer): T; + + /** Helper for console.log */ + inspect(): T[]; + + /** + * Returns a native js Array of plain js objects + * @param options optional options to pass to each documents toObject + * method call during conversion + */ + toObject(options?: any): T[]; + } + + /* + * section types/buffer.js + * http://mongoosejs.com/docs/api.html#types-buffer-js + */ + class Buffer extends global.Buffer { + /** + * Copies the buffer. + * Buffer#copy does not mark target as modified so you must copy + * from a MongooseBuffer for it to work as expected. This is a + * work around since copy modifies the target, not this. + */ + copy(target: NativeBuffer, ...nodeBufferArgs: any[]): number; + + /** Determines if this buffer is equals to other buffer */ + equals(other: NativeBuffer): boolean; + + /** Sets the subtype option and marks the buffer modified. */ + subtype(subtype: number): void; + + /** Converts this buffer to its Binary type representation. */ + toObject(subtype?: number): mongodb.Binary; + + /** Writes the buffer. */ + write(string: string, ...nodeBufferArgs: any[]): number; + } + + /* + * section types/objectid.js + * http://mongoosejs.com/docs/api.html#types-objectid-js + */ + var ObjectId: ObjectIdConstructor; + + // mongodb.ObjectID does not allow mongoose.Types.ObjectId(id). This is + // commonly used in mongoose and is found in an example in the docs: + // http://mongoosejs.com/docs/api.html#aggregate_Aggregate + // constructor exposes static methods of mongodb.ObjectID and ObjectId(id) + type ObjectIdConstructor = typeof mongodb.ObjectID & { + (s?: string | number): mongodb.ObjectID; + }; + + // var objectId: mongoose.Types.ObjectId should reference mongodb.ObjectID not + // the ObjectIdConstructor, so we add the interface below + interface ObjectId extends mongodb.ObjectID {} + + class Decimal128 extends mongodb.Decimal128 {} + + /* + * section types/embedded.js + * http://mongoosejs.com/docs/api.html#types-embedded-js + */ + class Embedded extends MongooseDocument { + /** Helper for console.log */ + inspect(): any; + + /** + * Marks a path as invalid, causing validation to fail. + * @param path the field to invalidate + * @param err error which states the reason path was invalid + */ + invalidate(path: string, err: string | NativeError): boolean; + + /** Returns the top level document of this sub-document. */ + ownerDocument(): MongooseDocument; + /** Returns this sub-documents parent document. */ + parent(): MongooseDocument; + /** Returns this sub-documents parent array. */ + parentArray(): DocumentArray; + + /** Removes the subdocument from its parent array. */ + remove(options?: { + noop?: boolean; + }, fn?: (err: any) => void): this; + + /** + * Marks the embedded doc modified. + * @param path the path which changed + */ + markModified(path: string): void; + } + } + + /* + * section query.js + * http://mongoosejs.com/docs/api.html#query-js + * + * Query is for backwards compatibility. Example: Query.find() returns Query. + * If later in the query chain a method returns Query, we will need to know type T. + * So we save this type as the second type parameter in DocumentQuery. Since people have + * been using Query, we set it as an alias of DocumentQuery. + */ + class Query extends DocumentQuery {} + class DocumentQuery extends mquery { + /** + * Specifies a javascript function or expression to pass to MongoDBs query system. + * Only use $where when you have a condition that cannot be met using other MongoDB + * operators like $lt. Be sure to read about all of its caveats before using. + * @param js javascript string or function + */ + $where(js: string | Function): this; + + /** + * Specifies an $all query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + all(val: number): this; + all(path: string, val: number): this; + + /** + * Specifies arguments for a $and condition. + * @param array array of conditions + */ + and(array: any[]): this; + + /** Specifies the batchSize option. Cannot be used with distinct() */ + batchSize(val: number): this; + + /** + * Specifies a $box condition + * @param Upper Right Coords + */ + box(val: any): this; + box(lower: number[], upper: number[]): this; + + /** Casts this query to the schema of model, If obj is present, it is cast instead of this query.*/ + cast(model: any, obj?: any): any; + + /** + * Executes the query returning a Promise which will be + * resolved with either the doc(s) or rejected with the error. + * Like .then(), but only takes a rejection handler. + */ + catch(reject?: (err: any) => void | TRes | PromiseLike): Promise; + + /** + * DEPRECATED Alias for circle + * Specifies a $center or $centerSphere condition. + * @deprecated Use circle instead. + */ + center(area: any): this; + center(path: string, area: any): this; + + /** + * DEPRECATED Specifies a $centerSphere condition + * @deprecated Use circle instead. + */ + centerSphere(path: string, val: any): this; + centerSphere(val: any): this; + + /** Specifies a $center or $centerSphere condition. */ + circle(area: any): this; + circle(path: string, area: any): this; + + /** Adds a collation to this op (MongoDB 3.4 and up) */ + collation(value: CollationOptions): this; + + /** Specifies the comment option. Cannot be used with distinct() */ + comment(val: string): this; + + /** + * Specifying this query as a count query. Passing a callback executes the query. + * @param criteria mongodb selector + */ + count(callback?: (err: any, count: number) => void): Query; + count(criteria: any, callback?: (err: any, count: number) => void): Query; + + /** + * Returns a wrapper around a mongodb driver cursor. A QueryCursor exposes a + * Streams3-compatible interface, as well as a .next() function. + */ + cursor(options?: any): QueryCursor; + + /** Declares or executes a distict() operation. Passing a callback executes the query. */ + distinct(callback?: (err: any, res: any[]) => void): Query; + distinct(field: string, callback?: (err: any, res: any[]) => void): Query; + distinct(field: string, criteria: any | Query, + callback?: (err: any, res: any[]) => void): Query; + + /** Specifies an $elemMatch condition */ + elemMatch(criteria: (elem: Query) => void): this; + elemMatch(criteria: any): this; + elemMatch(path: string | any | Function, criteria: (elem: Query) => void): this; + elemMatch(path: string | any | Function, criteria: any): this; + + /** Specifies the complementary comparison value for paths specified with where() */ + equals(val: any): this; + + /** Executes the query */ + exec(callback?: (err: any, res: T) => void): Promise; + exec(operation: string | Function, callback?: (err: any, res: T) => void): Promise; + + /** Specifies an $exists condition */ + exists(val?: boolean): this; + exists(path: string, val?: boolean): this; + + /** + * Finds documents. When no callback is passed, the query is not executed. When the + * query is executed, the result will be an array of documents. + * @param criteria mongodb selector + */ + find(callback?: (err: any, res: DocType[]) => void): DocumentQuery; + find(criteria: any, + callback?: (err: any, res: DocType[]) => void): DocumentQuery; + + /** + * Declares the query a findOne operation. When executed, the first found document is + * passed to the callback. Passing a callback executes the query. The result of the query + * is a single document. + * @param criteria mongodb selector + * @param projection optional fields to return + */ + findOne(callback?: (err: any, res: DocType | null) => void): DocumentQuery; + findOne(criteria: any, + callback?: (err: any, res: DocType | null) => void): DocumentQuery; + + /** + * Issues a mongodb findAndModify remove command. + * Finds a matching document, removes it, passing the found document (if any) to the + * callback. Executes immediately if callback is passed. + */ + findOneAndRemove(callback?: (error: any, doc: DocType | null, result: any) => void): DocumentQuery; + findOneAndRemove(conditions: any, + callback?: (error: any, doc: DocType | null, result: any) => void): DocumentQuery; + findOneAndRemove(conditions: any, options: QueryFindOneAndRemoveOptions, + callback?: (error: any, doc: DocType | null, result: any) => void): DocumentQuery; + + /** + * Issues a mongodb findAndModify update command. + * Finds a matching document, updates it according to the update arg, passing any options, and returns + * the found document (if any) to the callback. The query executes immediately if callback is passed. + */ + findOneAndUpdate(callback?: (err: any, doc: DocType | null) => void): DocumentQuery; + findOneAndUpdate(update: any, + callback?: (err: any, doc: DocType | null, res: any) => void): DocumentQuery; + findOneAndUpdate(query: any | Query, update: any, + callback?: (err: any, doc: DocType | null, res: any) => void): DocumentQuery; + findOneAndUpdate(query: any | Query, update: any, options: QueryFindOneAndUpdateOptions, + callback?: (err: any, doc: DocType | null, res: any) => void): DocumentQuery; + + /** + * Specifies a $geometry condition. geometry() must come after either intersects() or within(). + * @param object Must contain a type property which is a String and a coordinates property which + * is an Array. See the examples. + */ + geometry(object: { type: string, coordinates: any[] }): this; + + /** + * Returns the current query conditions as a JSON object. + * @returns current query conditions + */ + getQuery(): any; + + /** + * Returns the current update operations as a JSON object. + * @returns current update operations + */ + getUpdate(): any; + + /** + * Specifies a $gt query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + gt(val: number): this; + gt(path: string, val: number): this; + + /** + * Specifies a $gte query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + gte(val: number): this; + gte(path: string, val: number): this; + + /** + * Sets query hints. + * @param val a hint object + */ + hint(val: any): this; + + /** + * Specifies an $in query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + in(val: any[]): this; + in(path: string, val: any[]): this; + + /** Declares an intersects query for geometry(). MUST be used after where(). */ + intersects(arg?: any): this; + + /** + * Sets the lean option. + * Documents returned from queries with the lean option enabled are plain + * javascript objects, not MongooseDocuments. They have no save method, + * getters/setters or other Mongoose magic applied. + * @param bool defaults to true + */ + lean(bool?: boolean): Query; + + /** Specifies the maximum number of documents the query will return. Cannot be used with distinct() */ + limit(val: number): this; + + /** + * Specifies a $lt query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + lt(val: number): this; + lt(path: string, val: number): this; + + /** + * Specifies a $lte query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + lte(val: number): this; + lte(path: string, val: number): this; + + /** + * Specifies a $maxDistance query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + maxDistance(val: number): this; + maxDistance(path: string, val: number): this; + + /** @deprecated Alias of maxScan */ + maxscan(val: number): this; + /** Specifies the maxScan option. Cannot be used with distinct() */ + maxScan(val: number): this; + + /** + * Merges another Query or conditions object into this one. + * When a Query is passed, conditions, field selection and options are merged. + */ + merge(source: any | Query): this; + + /** Specifies a $mod condition */ + mod(val: number[]): this; + mod(path: string, val: number[]): this; + + /** + * Specifies a $ne query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + ne(val: any): this; + ne(path: string, val: any): this; + + /** Specifies a $near or $nearSphere condition. */ + near(val: any): this; + near(path: string, val: any): this; + + /** + * DEPRECATED Specifies a $nearSphere condition + * @deprecated Use query.near() instead with the spherical option set to true. + */ + nearSphere(val: any): this; + nearSphere(path: string, val: any): this; + + /** + * Specifies a $nin query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + nin(val: any[]): this; + nin(path: string, val: any[]): this; + + /** + * Specifies arguments for a $nor condition. + * @param array array of conditions + */ + nor(array: any[]): this; + + /** + * Specifies arguments for an $or condition. + * @param array array of conditions + */ + or(array: any[]): this; + + /** Specifies a $polygon condition */ + polygon(...coordinatePairs: number[][]): this; + polygon(path: string, ...coordinatePairs: number[][]): this; + + /** + * Specifies paths which should be populated with other documents. + * Paths are populated after the query executes and a response is received. A separate + * query is then executed for each path specified for population. After a response for + * each query has also been returned, the results are passed to the callback. + * @param path either the path to populate or an object specifying all parameters + * @param select Field selection for the population query + * @param model The model you wish to use for population. If not specified, populate + * will look up the model by the name in the Schema's ref field. + * @param match Conditions for the population query + * @param options Options for the population query (sort, etc) + */ + populate(path: string | any, select?: string | any, model?: any, + match?: any, options?: any): this; + populate(options: ModelPopulateOptions | ModelPopulateOptions[]): this; + + /** + * Determines the MongoDB nodes from which to read. + * @param pref one of the listed preference options or aliases + * @tags optional tags for this query + */ + read(pref: string, tags?: any[]): this; + + /** + * Specifies a $regex query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + regex(val: RegExp): this; + regex(path: string, val: RegExp): this; + + /** + * Declare and/or execute this query as a remove() operation. + * The operation is only executed when a callback is passed. To force execution without a callback, + * you must first call remove() and then execute it by using the exec() method. + * @param criteria mongodb selector + */ + remove(callback?: (err: any) => void): Query; + remove(criteria: any | Query, callback?: (err: any) => void): Query; + + /** Specifies which document fields to include or exclude (also known as the query "projection") */ + select(arg: string | any): this; + /** Determines if field selection has been made. */ + selected(): boolean; + /** Determines if exclusive field selection has been made.*/ + selectedExclusively(): boolean; + /** Determines if inclusive field selection has been made. */ + selectedInclusively(): boolean; + /** Sets query options. */ + setOptions(options: any): this; + + /** + * Specifies a $size query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + size(val: number): this; + size(path: string, val: number): this; + + /** Specifies the number of documents to skip. Cannot be used with distinct() */ + skip(val: number): this; + + /** + * DEPRECATED Sets the slaveOk option. + * @param v defaults to true + * @deprecated in MongoDB 2.2 in favor of read preferences. + */ + slaveOk(v?: boolean): this; + + /** + * Specifies a $slice projection for an array. + * @param val number/range of elements to slice + */ + slice(val: number | number[]): this; + slice(path: string, val: number | number[]): this; + + /** Specifies this query as a snapshot query. Cannot be used with distinct() */ + snapshot(v?: boolean): this; + + /** + * Sets the sort order + * If an object is passed, values allowed are asc, desc, ascending, descending, 1, and -1. + * If a string is passed, it must be a space delimited list of path names. The + * sort order of each path is ascending unless the path name is prefixed with - + * which will be treated as descending. + */ + sort(arg: string | any): this; + + /** Returns a Node.js 0.8 style read stream interface. */ + stream(options?: { transform?: Function; }): QueryStream; + + /** + * Sets the tailable option (for use with capped collections). Cannot be used with distinct() + * @param bool defaults to true + * @param opts options to set + * @param opts.numberOfRetries if cursor is exhausted, retry this many times before giving up + * @param opts.tailableRetryInterval if cursor is exhausted, wait this many milliseconds before retrying + */ + tailable(bool?: boolean, opts?: { + numberOfRetries?: number; + tailableRetryInterval?: number; + }): this; + + /** Executes this query and returns a promise */ + then(resolve?: (res: T) => void | TRes | PromiseLike, + reject?: (err: any) => void | TRes | PromiseLike): Promise; + + /** + * Converts this query to a customized, reusable query + * constructor with all arguments and options retained. + */ + toConstructor(): new(...args: any[]) => Query; + toConstructor(): new(...args: any[]) => DocumentQuery; + + /** + * Declare and/or execute this query as an update() operation. + * All paths passed that are not $atomic operations will become $set ops. + * @param doc the update command + */ + update(callback?: (err: any, affectedRows: number) => void): Query; + update(doc: any, callback?: (err: any, affectedRows: number) => void): Query; + update(criteria: any, doc: any, + callback?: (err: any, affectedRows: number) => void): Query; + update(criteria: any, doc: any, options: QueryUpdateOptions, + callback?: (err: any, affectedRows: number) => void): Query; + + /** Specifies a path for use with chaining. */ + where(path?: string | any, val?: any): this; + + /** Defines a $within or $geoWithin argument for geo-spatial queries. */ + within(val?: any): this; + within(coordinate: number[], ...coordinatePairs: number[][]): this; + + /** Flag to opt out of using $geoWithin. */ + static use$geoWithin: boolean; + } + + // https://github.com/aheckmann/mquery + // mquery currently does not have a type definition please + // replace it if one is ever created + class mquery {} + + interface QueryFindOneAndRemoveOptions { + /** if multiple docs are found by the conditions, sets the sort order to choose which doc to update */ + sort?: any; + /** puts a time limit on the query - requires mongodb >= 2.6.0 */ + maxTimeMS?: number; + /** if true, passes the raw result from the MongoDB driver as the third callback parameter */ + passRawResult?: boolean; + } + + interface QueryFindOneAndUpdateOptions extends QueryFindOneAndRemoveOptions { + /** if true, return the modified document rather than the original. defaults to false (changed in 4.0) */ + new?: boolean; + /** creates the object if it doesn't exist. defaults to false. */ + upsert?: boolean; + /** Field selection. Equivalent to .select(fields).findOneAndUpdate() */ + fields?: any | string; + /** if true, runs update validators on this command. Update validators validate the update operation against the model's schema. */ + runValidators?: boolean; + /** + * if this and upsert are true, mongoose will apply the defaults specified in the model's schema if a new document + * is created. This option only works on MongoDB >= 2.4 because it relies on MongoDB's $setOnInsert operator. + */ + setDefaultsOnInsert?: boolean; + /** + * if set to 'query' and runValidators is on, this will refer to the query in custom validator + * functions that update validation runs. Does nothing if runValidators is false. + */ + context?: string; + } + + interface QueryUpdateOptions extends ModelUpdateOptions { + /** + * if set to 'query' and runValidators is on, this will refer to the query + * in customvalidator functions that update validation runs. Does nothing + * if runValidators is false. + */ + context?: string; + } + + interface CollationOptions { + locale?: string; + caseLevel?: boolean; + caseFirst?: string; + strength?: number; + numericOrdering?: boolean; + alternate?: string; + maxVariable?: string; + backwards?: boolean; + } + + namespace Schema { + namespace Types { + /* + * section schema/array.js + * http://mongoosejs.com/docs/api.html#schema-array-js + */ + class Array extends SchemaType { + /** Array SchemaType constructor */ + constructor(key: string, cast?: SchemaType, options?: any); + + /** + * Check if the given value satisfies a required validator. The given value + * must be not null nor undefined, and have a non-zero length. + */ + checkRequired(value: T): boolean; + + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + } + + /* + * section schema/string.js + * http://mongoosejs.com/docs/api.html#schema-string-js + */ + class String extends SchemaType { + /** String SchemaType constructor. */ + constructor(key: string, options?: any); + + /** Check if the given value satisfies a required validator. */ + checkRequired(value: any, doc: MongooseDocument): boolean; + + /** + * Adds an enum validator + * @param args enumeration values + */ + enum(args: string | string[] | any): this; + + /** Adds a lowercase setter. */ + lowercase(): this; + + /** + * Sets a regexp validator. Any value that does not pass regExp.test(val) will fail validation. + * @param regExp regular expression to test against + * @param message optional custom error message + */ + match(regExp: RegExp, message?: string): this; + + /** + * Sets a maximum length validator. + * @param value maximum string length + * @param message optional custom error message + */ + maxlength(value: number, message?: string): this; + + /** + * Sets a minimum length validator. + * @param value minimum string length + * @param message optional custom error message + */ + minlength(value: number, message?: string): this; + + /** Adds a trim setter. The string value will be trimmed when set. */ + trim(): this; + /** Adds an uppercase setter. */ + uppercase(): this; + + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + + } + + /* + * section schema/documentarray.js + * http://mongoosejs.com/docs/api.html#schema-documentarray-js + */ + class DocumentArray extends Array { + /** SubdocsArray SchemaType constructor */ + constructor(key: string, schema: Schema, options?: any); + + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + } + + /* + * section schema/number.js + * http://mongoosejs.com/docs/api.html#schema-number-js + */ + class Number extends SchemaType { + /** Number SchemaType constructor. */ + constructor(key: string, options?: any); + + /** Check if the given value satisfies a required validator. */ + checkRequired(value: any, doc: MongooseDocument): boolean; + + /** + * Sets a maximum number validator. + * @param maximum number + * @param message optional custom error message + */ + max(maximum: number, message?: string): this; + + /** + * Sets a minimum number validator. + * @param value minimum number + * @param message optional custom error message + */ + min(value: number, message?: string): this; + + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + } + + /* + * section schema/date.js + * http://mongoosejs.com/docs/api.html#schema-date-js + */ + class Date extends SchemaType { + /** Date SchemaType constructor. */ + constructor(key: string, options?: any); + + /** + * Check if the given value satisfies a required validator. To satisfy + * a required validator, the given value must be an instance of Date. + */ + checkRequired(value: any, doc: MongooseDocument): boolean; + + /** Declares a TTL index (rounded to the nearest second) for Date types only. */ + expires(when: number | string): this; + + /** + * Sets a maximum date validator. + * @param maximum date + * @param message optional custom error message + */ + max(maximum: NativeDate, message?: string): this; + + /** + * Sets a minimum date validator. + * @param value minimum date + * @param message optional custom error message + */ + min(value: NativeDate, message?: string): this; + + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + } + + /* + * section schema/buffer.js + * http://mongoosejs.com/docs/api.html#schema-buffer-js + */ + class Buffer extends SchemaType { + /** Buffer SchemaType constructor */ + constructor(key: string, options?: any); + + /** + * Check if the given value satisfies a required validator. To satisfy a + * required validator, a buffer must not be null or undefined and have + * non-zero length. + */ + checkRequired(value: any, doc: MongooseDocument): boolean; + + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + + } + + /* + * section schema/boolean.js + * http://mongoosejs.com/docs/api.html#schema-boolean-js + */ + class Boolean extends SchemaType { + /** Boolean SchemaType constructor. */ + constructor(path: string, options?: any); + + /** + * Check if the given value satisfies a required validator. For a + * boolean to satisfy a required validator, it must be strictly + * equal to true or to false. + */ + checkRequired(value: any): boolean; + + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + } + + /* + * section schema/objectid.js + * http://mongoosejs.com/docs/api.html#schema-objectid-js + */ + class ObjectId extends SchemaType { + /** ObjectId SchemaType constructor. */ + constructor(key: string, options?: any); + + /** + * Adds an auto-generated ObjectId default if turnOn is true. + * @param turnOn auto generated ObjectId defaults + */ + auto(turnOn: boolean): this; + + /** Check if the given value satisfies a required validator. */ + checkRequired(value: any, doc: MongooseDocument): boolean; + + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + } + /* + * section schema/decimal128.js + * http://mongoosejs.com/docs/api.html#schema-decimal128-js + */ + class Decimal128 extends SchemaType { + /** Decimal128 SchemaType constructor. */ + constructor(key: string, options?: any); + + /** Check if the given value satisfies a required validator. */ + checkRequired(value: any, doc: MongooseDocument): boolean; + + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + } + + /* + * section schema/mixed.js + * http://mongoosejs.com/docs/api.html#schema-mixed-js + */ + class Mixed extends SchemaType { + /** Mixed SchemaType constructor. */ + constructor(path: string, options?: any); + + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + } + + /* + * section schema/embedded.js + * http://mongoosejs.com/docs/api.html#schema-embedded-js + */ + class Embedded extends SchemaType { + /** Sub-schema schematype constructor */ + constructor(schema: Schema, key: string, options?: any); + } + } + } + + /* + * section aggregate.js + * http://mongoosejs.com/docs/api.html#aggregate-js + */ + class Aggregate { + /** + * Aggregate constructor used for building aggregation pipelines. + * Returned when calling Model.aggregate(). + * @param ops aggregation operator(s) or operator array + */ + constructor(ops?: any | any[], ...args: any[]); + + /** Adds a cursor flag */ + addCursorFlag(flag: string, value: boolean): this; + + /** + * Sets the allowDiskUse option for the aggregation query (ignored for < 2.6.0) + * @param value Should tell server it can use hard drive to store data during aggregation. + * @param tags optional tags for this query + */ + allowDiskUse(value: boolean, tags?: any[]): this; + + /** + * Appends new operators to this aggregate pipeline + * @param ops operator(s) to append + */ + append(...ops: any[]): this; + + /** Adds a collation. */ + collation(options: CollationOptions): this; + + /** + * Sets the cursor option option for the aggregation query (ignored for < 2.6.0). + * Note the different syntax below: .exec() returns a cursor object, and no callback + * is necessary. + * @param options set the cursor batch size + */ + cursor(options: any): this; + + // If cursor option is on, could return an object + /** Executes the aggregate pipeline on the currently bound Model. */ + exec(callback?: (err: any, result: T) => void): Promise | any; + + /** Execute the aggregation with explain */ + explain(callback?: (err: any, result: T) => void): Promise; + + /** + * Appends a new custom $group operator to this aggregate pipeline. + * @param arg $group operator contents + */ + group(arg: any): this; + + /** + * Appends a new $limit operator to this aggregate pipeline. + * @param num maximum number of records to pass to the next stage + */ + limit(num: number): this; + + /** + * Appends new custom $lookup operator(s) to this aggregate pipeline. + * @param options to $lookup as described in the above link + */ + lookup(options: any): this; + + /** + * Appends a new custom $match operator to this aggregate pipeline. + * @param arg $match operator contents + */ + match(arg: any): this; + + /** + * Binds this aggregate to a model. + * @param model the model to which the aggregate is to be bound + */ + model(model: any): this; + + /** + * Appends a new $geoNear operator to this aggregate pipeline. + * MUST be used as the first operator in the pipeline. + */ + near(parameters: any): this; + + /** + * Appends a new $project operator to this aggregate pipeline. + * Mongoose query selection syntax is also supported. + * @param arg field specification + */ + project(arg: string | any): this; + + /** + * Sets the readPreference option for the aggregation query. + * @param pref one of the listed preference options or their aliases + * @param tags optional tags for this query + */ + read(pref: string, tags?: any[]): this; + + /** + * Appends new custom $sample operator(s) to this aggregate pipeline. + * @param size number of random documents to pick + */ + sample(size: number): this; + + /** + * Appends a new $skip operator to this aggregate pipeline. + * @param num number of records to skip before next stage + */ + skip(num: number): this; + + /** + * Appends a new $sort operator to this aggregate pipeline. + * If an object is passed, values allowed are asc, desc, ascending, descending, 1, and -1. + * If a string is passed, it must be a space delimited list of path names. The sort order + * of each path is ascending unless the path name is prefixed with - which will be treated + * as descending. + */ + sort(arg: string | any): this; + + /** Provides promise for aggregate. */ + then(resolve?: (val: T) => void | TRes | PromiseLike, + reject?: (err: any) => void | TRes | PromiseLike): Promise; + + /** + * Appends new custom $unwind operator(s) to this aggregate pipeline. + * Note that the $unwind operator requires the path name to start with '$'. + * Mongoose will prepend '$' if the specified field doesn't start '$'. + * @param fields the field(s) to unwind + */ + unwind(...fields: string[]): this; + /** + * Appends new custom $unwind operator(s) to this aggregate pipeline + * new in mongodb 3.2 + */ + unwind(...opts: { path: string, includeArrayIndex?: string, preserveNullAndEmptyArrays?: boolean }[]): this; + } + + /* + * section schematype.js + * http://mongoosejs.com/docs/api.html#schematype-js + */ + class SchemaType { + /** SchemaType constructor */ + constructor(path: string, options?: any, instance?: string); + + /** + * Sets a default value for this SchemaType. + * Defaults can be either functions which return the value to use as the + * default or the literal value itself. Either way, the value will be cast + * based on its schema type before being set during document creation. + * @param val the default value + */ + default(val: any): any; + + /** Adds a getter to this schematype. */ + get(fn: Function): this; + + /** + * Declares the index options for this schematype. + * Indexes are created in the background by default. Specify background: false to override. + */ + index(options: any | boolean | string): this; + + /** + * Adds a required validator to this SchemaType. The validator gets added + * to the front of this SchemaType's validators array using unshift(). + * @param required enable/disable the validator + * @param message optional custom error message + */ + required(required: boolean, message?: string): this; + + /** Sets default select() behavior for this path. */ + select(val: boolean): this; + /** Adds a setter to this schematype. */ + set(fn: Function): this; + /** Declares a sparse index. */ + sparse(bool: boolean): this; + /** Declares a full text index. */ + text(bool: boolean): this; + /** Declares an unique index. */ + unique(bool: boolean): this; + + /** + * Adds validator(s) for this document path. + * Validators always receive the value to validate as their first argument + * and must return Boolean. Returning false means validation failed. + * @param obj validator + * @param errorMsg optional error message + * @param type optional validator type + */ + validate(obj: RegExp | Function | any, errorMsg?: string, + type?: string): this; + } + + /* + * section promise.js + * http://mongoosejs.com/docs/api.html#promise-js + */ + /** + * To assign your own promise library: + * + * 1. Typescript does not allow assigning properties of imported modules. + * To avoid compile errors use one of the options below in your code: + * + * - (mongoose).Promise = YOUR_PROMISE; + * - require('mongoose').Promise = YOUR_PROMISE; + * - import mongoose = require('mongoose'); + * mongoose.Promise = YOUR_PROMISE; + * + * 2. To assign type definitions for your promise library, you will need + * to have a .d.ts file with the following code when you compile: + * + * - import * as Q from 'q'; + * declare module 'mongoose' { + * type Promise = Q.promise; + * } + * + * - import * as Bluebird from 'bluebird'; + * declare module 'mongoose' { + * type Promise = Bluebird; + * } + * + * Uses global.Promise by default. If you would like to use mongoose default + * mpromise implementation (which is deprecated), you can omit step 1 and + * run npm install @types/mongoose-promise + */ + export var Promise: any; + export var PromiseProvider: any; + + /* + * section model.js + * http://mongoosejs.com/docs/api.html#model-js + */ + export var Model: Model; + interface Model extends NodeJS.EventEmitter, ModelProperties { + /** + * Model constructor + * Provides the interface to MongoDB collections as well as creates document instances. + * @param doc values with which to create the document + * @event error If listening to this event, it is emitted when a document + * was saved without passing a callback and an error occurred. If not + * listening, the event bubbles to the connection used to create this Model. + * @event index Emitted after Model#ensureIndexes completes. If an error + * occurred it is passed with the event. + * @event index-single-start Emitted when an individual index starts within + * Model#ensureIndexes. The fields and options being used to build the index + * are also passed with the event. + * @event index-single-done Emitted when an individual index finishes within + * Model#ensureIndexes. If an error occurred it is passed with the event. + * The fields, options, and index name are also passed. + */ + new(doc?: any): T; + + /** + * Finds a single document by its _id field. findById(id) is almost* + * equivalent to findOne({ _id: id }). findById() triggers findOne hooks. + * @param id value of _id to query by + * @param projection optional fields to return + */ + findById(id: any | string | number, + callback?: (err: any, res: T | null) => void): DocumentQuery; + findById(id: any | string | number, projection: any, + callback?: (err: any, res: T | null) => void): DocumentQuery; + findById(id: any | string | number, projection: any, options: any, + callback?: (err: any, res: T | null) => void): DocumentQuery; + + model(name: string): Model; + + /** + * Creates a Query and specifies a $where condition. + * @param argument is a javascript string or anonymous function + */ + $where(argument: string | Function): DocumentQuery; + + /** + * Performs aggregations on the models collection. + * If a callback is passed, the aggregate is executed and a Promise is returned. + * If a callback is not passed, the aggregate itself is returned. + * @param ... aggregation pipeline operator(s) or operator array + */ + aggregate(...aggregations: any[]): Aggregate; + aggregate(...aggregationsWithCallback: any[]): Promise; + + /** Counts number of matching documents in a database collection. */ + count(conditions: any, callback?: (err: any, count: number) => void): Query; + + /** + * Shortcut for saving one or more documents to the database. MyModel.create(docs) + * does new MyModel(doc).save() for every doc in docs. + * Triggers the save() hook. + */ + create(docs: any[], callback?: (err: any, res: T[]) => void): Promise; + create(...docs: any[]): Promise; + create(...docsWithCallback: any[]): Promise; + + /** + * Adds a discriminator type. + * @param name discriminator model name + * @param schema discriminator model schema + */ + discriminator(name: string, schema: Schema): Model; + + /** Creates a Query for a distinct operation. Passing a callback immediately executes the query. */ + distinct(field: string, callback?: (err: any, res: any[]) => void): Query; + distinct(field: string, conditions: any, + callback?: (err: any, res: any[]) => void): Query; + + /** + * Sends ensureIndex commands to mongo for each index declared in the schema. + * @param options internal options + * @param cb optional callback + */ + ensureIndexes(callback?: (err: any) => void): Promise; + ensureIndexes(options: any, callback?: (err: any) => void): Promise; + + /** + * Finds documents. + * @param projection optional fields to return + */ + find(callback?: (err: any, res: T[]) => void): DocumentQuery; + find(conditions: any, callback?: (err: any, res: T[]) => void): DocumentQuery; + find(conditions: any, projection?: any | null, + callback?: (err: any, res: T[]) => void): DocumentQuery; + find(conditions: any, projection?: any | null, options?: any | null, + callback?: (err: any, res: T[]) => void): DocumentQuery; + + + + /** + * Issue a mongodb findAndModify remove command by a document's _id field. + * findByIdAndRemove(id, ...) is equivalent to findOneAndRemove({ _id: id }, ...). + * Finds a matching document, removes it, passing the found document (if any) to the callback. + * Executes immediately if callback is passed, else a Query object is returned. + * @param id value of _id to query by + */ + findByIdAndRemove(): DocumentQuery; + findByIdAndRemove(id: any | number | string, + callback?: (err: any, res: T | null) => void): DocumentQuery; + findByIdAndRemove(id: any | number | string, options: { + /** if multiple docs are found by the conditions, sets the sort order to choose which doc to update */ + sort?: any; + /** sets the document fields to return */ + select?: any; + }, callback?: (err: any, res: T | null) => void): DocumentQuery; + + /** + * Issues a mongodb findAndModify update command by a document's _id field. findByIdAndUpdate(id, ...) + * is equivalent to findOneAndUpdate({ _id: id }, ...). + * @param id value of _id to query by + */ + findByIdAndUpdate(): DocumentQuery; + findByIdAndUpdate(id: any | number | string, update: any, + callback?: (err: any, res: T | null) => void): DocumentQuery; + findByIdAndUpdate(id: any | number | string, update: any, + options: ModelFindByIdAndUpdateOptions, + callback?: (err: any, res: T | null) => void): DocumentQuery; + + /** + * Finds one document. + * The conditions are cast to their respective SchemaTypes before the command is sent. + * @param projection optional fields to return + */ + findOne(conditions?: any, + callback?: (err: any, res: T | null) => void): DocumentQuery; + findOne(conditions: any, projection: any, + callback?: (err: any, res: T | null) => void): DocumentQuery; + findOne(conditions: any, projection: any, options: any, + callback?: (err: any, res: T | null) => void): DocumentQuery; + + /** + * Issue a mongodb findAndModify remove command. + * Finds a matching document, removes it, passing the found document (if any) to the callback. + * Executes immediately if callback is passed else a Query object is returned. + */ + findOneAndRemove(): DocumentQuery; + findOneAndRemove(conditions: any, + callback?: (err: any, res: T | null) => void): DocumentQuery; + findOneAndRemove(conditions: any, options: { + /** + * if multiple docs are found by the conditions, sets the sort order to choose + * which doc to update + */ + sort?: any; + /** puts a time limit on the query - requires mongodb >= 2.6.0 */ + maxTimeMS?: number; + /** sets the document fields to return */ + select?: any; + }, callback?: (err: any, res: T | null) => void): DocumentQuery; + + /** + * Issues a mongodb findAndModify update command. + * Finds a matching document, updates it according to the update arg, passing any options, + * and returns the found document (if any) to the callback. The query executes immediately + * if callback is passed else a Query object is returned. + */ + findOneAndUpdate(): DocumentQuery; + findOneAndUpdate(conditions: any, update: any, + callback?: (err: any, doc: T | null, res: any) => void): DocumentQuery; + findOneAndUpdate(conditions: any, update: any, + options: ModelFindOneAndUpdateOptions, + callback?: (err: any, doc: T | null, res: any) => void): DocumentQuery; + + /** + * geoNear support for Mongoose + * @param GeoJSON point or legacy coordinate pair [x,y] to search near + * @param options for the qurery + * @param callback optional callback for the query + */ + geoNear(point: number[] | { + type: string; + coordinates: number[] + }, options: { + /** return the raw object */ + lean?: boolean; + [other: string]: any; + }, callback?: (err: any, res: T[], stats: any) => void): DocumentQuery; + + /** + * Implements $geoSearch functionality for Mongoose + * @param conditions an object that specifies the match condition (required) + * @param options for the geoSearch, some (near, maxDistance) are required + * @param callback optional callback + */ + geoSearch(conditions: any, options: { + /** x,y point to search for */ + near: number[]; + /** the maximum distance from the point near that a result can be */ + maxDistance: number; + /** The maximum number of results to return */ + limit?: number; + /** return the raw object instead of the Mongoose Model */ + lean?: boolean; + }, callback?: (err: any, res: T[]) => void): DocumentQuery; + + /** + * Shortcut for creating a new Document from existing raw data, + * pre-saved in the DB. The document returned has no paths marked + * as modified initially. + */ + hydrate(obj: any): T; + + /** + * Shortcut for validating an array of documents and inserting them into + * MongoDB if they're all valid. This function is faster than .create() + * because it only sends one operation to the server, rather than one for each + * document. + * This function does not trigger save middleware. + */ + insertMany(docs: any[], callback?: (error: any, docs: T[]) => void): Promise; + insertMany(doc: any, callback?: (error: any, doc: T) => void): Promise; + insertMany(...docsWithCallback: any[]): Promise; + + /** + * Executes a mapReduce command. + * @param o an object specifying map-reduce options + * @param callbackoptional callback + */ + mapReduce( + o: ModelMapReduceOption, + callback?: (err: any, res: any) => void + ): Promise; + + /** + * Populates document references. + * @param docs Either a single document or array of documents to populate. + * @param options A hash of key/val (path, options) used for population. + * @param callback Optional callback, executed upon completion. Receives err and the doc(s). + */ + populate(docs: any[], options: ModelPopulateOptions | ModelPopulateOptions[], + callback?: (err: any, res: T[]) => void): Promise; + populate(docs: any, options: ModelPopulateOptions | ModelPopulateOptions[], + callback?: (err: any, res: T) => void): Promise; + + /** Removes documents from the collection. */ + remove(conditions: any, callback?: (err: any) => void): Query; + deleteOne(conditions: any, callback?: (err: any) => void): Query; + deleteMany(conditions: any, callback?: (err: any) => void): Query; + + /** + * Updates documents in the database without returning them. + * All update values are cast to their appropriate SchemaTypes before being sent. + */ + update(conditions: any, doc: any, + callback?: (err: any, raw: any) => void): Query; + update(conditions: any, doc: any, options: ModelUpdateOptions, + callback?: (err: any, raw: any) => void): Query; + updateOne(conditions: any, doc: any, + callback?: (err: any, raw: any) => void): Query; + updateOne(conditions: any, doc: any, options: ModelUpdateOptions, + callback?: (err: any, raw: any) => void): Query; + updateMany(conditions: any, doc: any, + callback?: (err: any, raw: any) => void): Query; + updateMany(conditions: any, doc: any, options: ModelUpdateOptions, + callback?: (err: any, raw: any) => void): Query; + + /** Creates a Query, applies the passed conditions, and returns the Query. */ + where(path: string, val?: any): Query; + } + + interface Document extends MongooseDocument, NodeJS.EventEmitter, ModelProperties { + /** Signal that we desire an increment of this documents version. */ + increment(): this; + + /** + * Returns another Model instance. + * @param name model name + */ + model(name: string): Model; + + /** + * Removes this document from the db. + * @param fn optional callback + */ + remove(fn?: (err: any, product: this) => void): Promise; + + /** + * Saves this document. + * @param options options optional options + * @param options.safe overrides schema's safe option + * @param options.validateBeforeSave set to false to save without validating. + * @param fn optional callback + */ + save(options?: SaveOptions, fn?: (err: any, product: this, numAffected: number) => void): Promise; + save(fn?: (err: any, product: this, numAffected: number) => void): Promise; + + /** + * Version using default version key. See http://mongoosejs.com/docs/guide.html#versionKey + * If you're using another key, you will have to access it using []: doc[_myVersionKey] + */ + __v?: number; + } + + interface SaveOptions { + safe?: boolean | WriteConcern; + validateBeforeSave?: boolean; + } + + interface WriteConcern { + j?: boolean; + w?: number | 'majority' | TagSet; + wtimeout?: number; + } + + interface TagSet { + [k: string]: string; + } + + interface ModelProperties { + /** Base Mongoose instance the model uses. */ + base: typeof mongoose; + + /** + * If this is a discriminator model, baseModelName is the + * name of the base model. + */ + baseModelName: String; + + /** Collection the model uses. */ + collection: Collection; + + /** Connection the model uses. */ + db: Connection; + + /** Registered discriminators for this model. */ + discriminators: any; + + /** The name of the model */ + modelName: string; + + /** Schema the model uses. */ + schema: Schema; + } + + interface ModelFindByIdAndUpdateOptions { + /** true to return the modified document rather than the original. defaults to false */ + new?: boolean; + /** creates the object if it doesn't exist. defaults to false. */ + upsert?: boolean; + /** + * if true, runs update validators on this command. Update validators validate the + * update operation against the model's schema. + */ + runValidators?: boolean; + /** + * if this and upsert are true, mongoose will apply the defaults specified in the model's + * schema if a new document is created. This option only works on MongoDB >= 2.4 because + * it relies on MongoDB's $setOnInsert operator. + */ + setDefaultsOnInsert?: boolean; + /** if multiple docs are found by the conditions, sets the sort order to choose which doc to update */ + sort?: any; + /** sets the document fields to return */ + select?: any; + /** if true, passes the raw result from the MongoDB driver as the third callback parameter */ + passRawResult?: boolean; + /** overwrites the schema's strict mode option for this update */ + strict?: boolean; + /** + * if true, run all setters defined on the associated model's schema for all fields + * defined in the query and the update. + */ + runSettersOnQuery?: boolean; + } + + interface ModelFindOneAndUpdateOptions extends ModelFindByIdAndUpdateOptions { + /** Field selection. Equivalent to .select(fields).findOneAndUpdate() */ + fields?: any | string; + /** puts a time limit on the query - requires mongodb >= 2.6.0 */ + maxTimeMS?: number; + /** if true, passes the raw result from the MongoDB driver as the third callback parameter */ + passRawResult?: boolean; + } + + interface ModelPopulateOptions { + /** space delimited path(s) to populate */ + path: string; + /** optional fields to select */ + select?: any; + /** optional query conditions to match */ + match?: any; + /** optional name of the model to use for population */ + model?: string; + /** optional query options like sort, limit, etc */ + options?: any; + /** deep populate */ + populate?: ModelPopulateOptions | ModelPopulateOptions[]; + } + + interface ModelUpdateOptions { + /** safe mode (defaults to value set in schema (true)) */ + safe?: boolean; + /** whether to create the doc if it doesn't match (false) */ + upsert?: boolean; + /** whether multiple documents should be updated (false) */ + multi?: boolean; + /** + * If true, runs update validators on this command. Update validators validate + * the update operation against the model's schema. + */ + runValidators?: boolean; + /** + * If this and upsert are true, mongoose will apply the defaults specified in the + * model's schema if a new document is created. This option only works on MongoDB >= 2.4 + * because it relies on MongoDB's $setOnInsert operator. + */ + setDefaultsOnInsert?: boolean; + /** overrides the strict option for this update */ + strict?: boolean; + /** disables update-only mode, allowing you to overwrite the doc (false) */ + overwrite?: boolean; + /** other options */ + [other: string]: any; + } + + interface ModelMapReduceOption { + map: Function | string; + reduce: (key: Key, vals: T[]) => Val; + /** query filter object. */ + query?: any; + /** sort input objects using this key */ + sort?: any; + /** max number of documents */ + limit?: number; + /** keep temporary data default: false */ + keeptemp?: boolean; + /** finalize function */ + finalize?: (key: Key, val: Val) => Val; + /** scope variables exposed to map/reduce/finalize during execution */ + scope?: any; + /** it is possible to make the execution stay in JS. Provided in MongoDB > 2.0.X default: false */ + jsMode?: boolean; + /** provide statistics on job execution time. default: false */ + verbose?: boolean; + readPreference?: string; + /** sets the output target for the map reduce job. default: {inline: 1} */ + out?: { + /** the results are returned in an array */ + inline?: number; + /** + * {replace: 'collectionName'} add the results to collectionName: the + * results replace the collection + */ + replace?: string; + /** + * {reduce: 'collectionName'} add the results to collectionName: if + * dups are detected, uses the reducer / finalize functions + */ + reduce?: string; + /** + * {merge: 'collectionName'} add the results to collectionName: if + * dups exist the new docs overwrite the old + */ + merge?: string; + }; + } + + interface MapReduceResult { + _id: Key; + value: Val; + } + + /* + * section collection.js + * http://mongoosejs.com/docs/api.html#collection-js + */ + interface CollectionBase extends mongodb.Collection { + /* + * Abstract methods. Some of these are already defined on the + * mongodb.Collection interface so they've been commented out. + */ + ensureIndex(...args: any[]): any; + //find(...args: any[]): any; + findAndModify(...args: any[]): any; + //findOne(...args: any[]): any; + getIndexes(...args: any[]): any; + //insert(...args: any[]): any; + //mapReduce(...args: any[]): any; + //save(...args: any[]): any; + //update(...args: any[]): any; + + /** The collection name */ + collectionName: string; + /** The Connection instance */ + conn: Connection; + /** The collection name */ + name: string; + } +} diff --git a/types/mongoose/v4/mongoose-tests.ts b/types/mongoose/v4/mongoose-tests.ts new file mode 100644 index 0000000000..92adb61d83 --- /dev/null +++ b/types/mongoose/v4/mongoose-tests.ts @@ -0,0 +1,1651 @@ +import * as mongoose from 'mongoose'; + +// test compatibility with other libraries +import * as _ from 'lodash'; +var fs = require('fs'); + +// dummy variables +var cb = function () {}; + +/* + * Most of these tests are taken directly from the examples + * in the Mongoose API documentation. + * + * http://mongoosejs.com/docs/guide.html + * http://mongoosejs.com/docs/api.html + */ + +/* + * section index.js + * http://mongoosejs.com/docs/api.html#index-js + */ +var connectUri = 'mongodb://user:pass@localhost:port/database'; +mongoose.connect(connectUri).then(cb).catch(cb); +mongoose.connect(connectUri, { + user: 'larry', + pass: 'housan', + config: { + autoIndex: true + }, + mongos: true +}).then(cb); +mongoose.connect(connectUri, function (error) { + error.stack; +}); +var mongooseConnection: mongoose.Connection = mongoose.createConnection(); +mongoose.createConnection(connectUri).open(''); +mongoose.createConnection(connectUri, { + db: { + native_parser: true + } +}).open(''); +mongoose.createConnection('localhost', 'database', 3000).open(''); +mongoose.createConnection('localhost', 'database', 3000, { + user: 'larry', + config: { + autoIndex: false + } +}).open(''); +mongoose.disconnect(cb).then(cb); +mongoose.get('test'); +mongoose.model('Actor', new mongoose.Schema({ + name: String +}), 'collectionName', true).find({}); +mongoose.model('Actor').find({}); +mongoose.modelNames()[0].toLowerCase(); +new (new mongoose.Mongoose(9, 8, 7)).Mongoose(1, 2, 3).connect(''); +mongoose.plugin(cb, {}).connect(''); +mongoose.set('test', 'value'); +mongoose.set('debug', function(collectionName: any, methodName: any, arg1: any, arg2: any) {}); +mongoose.STATES.hasOwnProperty(''); +mongoose.connection.on('error', cb); +new mongoose.mongo.MongoError('error').stack; +mongoose.SchemaTypes.String; +mongoose.SchemaTypes.ObjectId; +mongoose.SchemaTypes.Decimal128; +mongoose.Types.ObjectId; +mongoose.Types.Decimal128; +mongoose.version.toLowerCase(); + +/* + * section querystream.js + * http://mongoosejs.com/docs/api.html#querystream-js + */ +var querystream = {}; +querystream.destroy(new Error()); +querystream.pause(); +querystream.pipe(process.stdout, {end: true}).end(); +querystream.resume(); +querystream.paused; +querystream.readable; +/* inherited properties */ +querystream.getMaxListeners(); +/* practical examples */ +var QSModel = {}; +var QSStream: mongoose.QueryStream = QSModel.find().stream(); +QSStream.on('data', function (doc: any) { + doc.save(); +}).on('error', function (err: any) { + throw err; +}).on('close', cb); +QSModel.where('created').gte(20000).stream().pipe(process.stdout); + +/* + * section collection.js + * http://mongoosejs.com/docs/api.html#collection-js + * + * section drivers/node-mongodb-native/collection.js + * http://mongoosejs.com/docs/api.html#drivers-node-mongodb-native-collection-js + */ +var coll1 = {}; +coll1.$format(999).toLowerCase(); +coll1.$print('name', 'i', [1, 2, 3]); +coll1.getIndexes(); +/* inherited properties */ +coll1.collectionName; +coll1.conn; +coll1.name; +coll1.ensureIndex(); +coll1.find({}); +coll1.insert({}, {}); + +var coll2 = new mongoose.Collection('', new mongoose.Connection(mongoose)); +coll2.$format(999).toLowerCase(); +/* inherited properties */ +coll2.initializeOrderedBulkOp; +coll2.indexExists; + +/* + * section connection.js + * http://mongoosejs.com/docs/api.html#connection-js + * + * section section drivers/node-mongodb-native/connection.js + * http://mongoosejs.com/docs/api.html#drivers-node-mongodb-native-connection-js + */ +var conn1: mongoose.Connection = mongoose.createConnection('mongodb://user:pass@localhost:port/database'); +conn1 = new mongoose.Connection(mongoose); +conn1.open('mongodb://localhost/test', 'myDb', 27017, { + replset: null, + config: { + autoIndex: false + } +}, function (err) {}).open(''); +conn1.openSet('mongodb://localhost/test', 'db', { + replset: null, + mongos: true +}, function (err) {}).then(cb).catch(cb); +conn1.close().catch(function (err) {}); +conn1.collection('name').$format(999); +conn1.model('myModel', new mongoose.Schema({}), 'myCol').find(); +interface IStatics { + staticMethod1: (a: number) => string; +} +conn1.modelNames()[0].toLowerCase(); +conn1.config.hasOwnProperty(''); +conn1.db.bufferMaxEntries; +conn1.collections['coll'].$format(999); +conn1.readyState.toFixed(); +conn1.useDb('myDb').useDb(''); +mongoose.Connection.STATES.hasOwnProperty(''); +/* inherited properties */ +conn1.on('data', cb); +conn1.addListener('close', cb); + +/* + * section error/validation.js + * http://mongoosejs.com/docs/api.html#error-validation-js + */ +var validationError = {}; +validationError.toString().toLowerCase(); +/* inherited properties */ +validationError.stack; +validationError.message; + +/* + * section error.js + * http://mongoosejs.com/docs/api.html#error-js + */ +var mongooseError: mongoose.Error = new mongoose.Error('error'); +/* inherited properties */ +mongooseError.message; +mongooseError.name; +mongooseError.stack; +/* static properties */ +mongoose.Error.messages.hasOwnProperty(''); +mongoose.Error.Messages.hasOwnProperty(''); + +/* + * section querycursor.js + * http://mongoosejs.com/docs/api.html#querycursor-js + */ +var querycursor = > {}; +querycursor.close(function (error, result) { + result.execPopulate(); +}).catch(cb); +querycursor.eachAsync(function (doc) { + doc.execPopulate(); +}, function (err) {}).catch(cb); +querycursor.next(cb).catch(cb); +/* inherited properties */ +querycursor.pause(); +querycursor.pipe(process.stdout); +/* practical example */ +var QCModel = mongoose.model('QC', new mongoose.Schema({name: String})); +QCModel.find({}).cursor({}).on('data', function (doc: any) { + doc.depopulate('name'); +}).on('error', function (error: any) { + throw error; +}).close().then(cb).catch(cb); +querycursor.map(function (doc) { + doc.foo = "bar"; + return doc; +}).on('data', function (doc: any) { + console.log(doc.foo); +}); +querycursor.map(function (doc) { + doc.foo = "bar"; + return doc; +}).next(function (error, doc) { + console.log(doc.foo); +}); + +/* + * section virtualtype.js + * http://mongoosejs.com/docs/api.html#virtualtype-js + */ +var virtualtype: mongoose.VirtualType = new mongoose.VirtualType({}, 'hello'); +virtualtype.applyGetters({}, {}); +virtualtype.applySetters({}, {}); +virtualtype.get(cb).get(cb); +virtualtype.set(cb).set(cb); + +/* + * section schema.js + * http://mongoosejs.com/docs/api.html#schema-js + */ +var schema: mongoose.Schema = new mongoose.Schema({ + name: String, + binary: Buffer, + living: Boolean, + updated: { type: Date, default: Date.now }, + age: { type: Number, min: 18, max: 65 }, + mixed: mongoose.Schema.Types.Mixed, + _someId: mongoose.Schema.Types.ObjectId, + someDecimal:mongoose.Schema.Types.Decimal128, + array: [], + ofString: [String], + ofNumber: [Number], + ofDates: [Date], + ofBuffer: [Buffer], + ofBoolean: [Boolean], + ofMixed: [mongoose.Schema.Types.Mixed], + ofObjectId: [mongoose.Schema.Types.ObjectId], + nested: { + stuff: { type: String, lowercase: true, trim: true } + } +}); +schema.add({ + mixedArray: { + type: [mongoose.Schema.Types.Mixed], + required: true + } +}, 'prefix'); +schema.eachPath(function (path, type) { + path.toLowerCase(); + type.sparse(true); +}).eachPath(cb); +schema.get('path'); +schema.index({ + name: 1, + binary: -1 +}).index({}, {}); +schema.indexes().slice(); +schema.method('name', cb).method({ + m1: cb, + m2: cb +}); +schema.path('a', mongoose.Schema.Types.Buffer).path('a'); +schema.pathType('m1').toLowerCase(); +schema.plugin(function (schema, opts) { + schema.get('path'); + if (opts) { + opts.hasOwnProperty(''); + } +}).plugin(cb, {opts: true}); + +schema +.post('save', function (error, doc, next) { + error.stack; + doc.model; + next.apply; +}) +.post('save', function (doc: mongoose.Document, next: Function) { + doc.model; + next(new Error()); +}) +.post('save', function (doc: mongoose.Document) { + doc.model; +}); +schema.queue('m1', [1, 2, 3]).queue('m2', [[]]); +schema.remove('path'); +schema.remove(['path1', 'path2', 'path3']); +schema.requiredPaths(true)[0].toLowerCase(); +schema.set('key', 999).set('key'); +schema.static('static', cb).static({ + s1: cb, + s2: cb +}); +schema.virtual('virt', {}).applyGetters({}, {}); +schema.virtualpath('path').applyGetters({}, {}); +/* static properties */ +mongoose.Schema.indexTypes[0].toLowerCase(); +mongoose.Schema.reserved.hasOwnProperty(''); +/* inherited properties */ +schema.addListener('e', cb); +/* practical examples */ +var animalSchema = new mongoose.Schema({ + name: String, + type: String +}); +animalSchema.methods.findSimilarTypes = function (cb: any) { + return this.model('Aminal').find({ type: this.type }, cb); +}; +var Animal: any = mongoose.model('Animal', animalSchema); +var dog: any = new Animal({type: 'dog'}); +dog['findSimilarTypes'](function (err: any, dogs: any) { + console.log(dogs); +}); +new mongoose.Schema({ + title: String, + author: String, + body: String, + comments: [{ body: String, date: Date }], + date: { type: Date, default: Date.now }, + hidden: Boolean, + meta: { + votes: Number, + favs: Number, + text: String + }, + meta2: { + text: mongoose.Schema.Types.Number, + select: { + type: String + } + } +}); +new mongoose.Schema({ name: { type: String, index: true }}); +new mongoose.Schema({ loc: { type: [Number], index: 'hashed' }}); +new mongoose.Schema({ loc: { type: [Number], index: '2d', sparse: true }}); +new mongoose.Schema({ loc: { type: [Number], index: { type: '2dsphere', sparse: true }}}); +new mongoose.Schema({ date: { type: Date, index: { unique: true, expires: '1d' }}}); +new mongoose.Schema({ born: { type: Date, required: '{PATH} is required!' }}); +new mongoose.Schema({ born: { type: Date, required: function() { + return this.age >= 18; +}}}); +new mongoose.Schema({ state: { type: String, enum: ['opening', 'open', 'closing', 'closed'] }}); +new mongoose.Schema({ state: { type: String, enum: { + values: ['opening', 'open', 'closing', 'closed'], + message: 'enum validator failed for path `{PATH}` with value `{VALUE}`' +}}}); +new mongoose.Schema({ name: { type: String, match: /^a/ }}); +new mongoose.Schema({ name: { type: String, match: [ + /\.html$/, "That file doesn't end in .html ({VALUE})" +]}}); +new mongoose.Schema({ + createdAt: {type: Date, expires: 60 * 60 * 24} +}); +new mongoose.Schema({ createdAt: { type: Date, expires: '1.5h' }}); +new mongoose.Schema({ d: { type: Date, max: new Date('2014-01-01') }}); +new mongoose.Schema({ d: { type: Date, max: [ + new Date('2014-01-01'), + 'The value of path `{PATH}` ({VALUE}) exceeds the limit ({MAX}).' +]}}); +new mongoose.Schema({d: {type: Date, min: [ + new Date('1970-01-01'), + 'The value of path `{PATH}` ({VALUE}) is beneath the limit ({MIN}).' +]}}); +new mongoose.Schema({ + integerOnly: { + type: Number, + get: (v: number) => Math.round(v), + set: (v: number) => Math.round(v) + } +}); +new mongoose.Schema({ name: { type: String, validate: [ + { validator: () => {return true}, msg: 'uh oh' }, + { validator: () => {return true}, msg: 'failed' } +]}}); +animalSchema.statics.findByName = function(name: any, cb: any) { + return this.find({ name: new RegExp(name, 'i') }, cb); +}; +Animal['findByName']('fido', function(err: any, animals: any) { + console.log(animals); +}); +animalSchema.virtual('name.full').get(function () { + return this.name.first + ' ' + this.name.last; +}); +var childSchema = new mongoose.Schema({ name: String }); +var parentSchema = new mongoose.Schema({ + children: [childSchema], + child: childSchema, + name: { + index: true, + required: true + } +}); +new mongoose.Schema({ + eggs: { + type: Number, + min: [6, 'Too few eggs'], + max: 12 + }, + bacon: { + type: Number, + required: [true, 'Why no bacon?'] + }, + drink: { + type: String, + enum: ['Coffee', 'Tea'] + } +}); + +(new mongoose.Schema({})).plugin(function (schema: any, options: any) { + schema.add({ lastMod: Date }) + schema.pre('save', function (next: Function) { + this.lastMod = new Date + next() + }) + if (options && options['index']) { + schema.path('lastMod').index(options['index']) + } +}, { index: true }).plugin(function (schema: any, options: any) { + schema.add({ lastMod: Date }) + schema.pre('save', function (next: Function) { + this.lastMod = new Date + next() + }) + if (options && options['index']) { + schema.path('lastMod').index(options['index']) + } +}); + +export default function(schema: mongoose.Schema) { + schema.pre('init', function(this: mongoose.Document, next: (err?: Error) => void, data: any): void { + data.name = 'Hello world'; + }); +} + +/* + * section document.js + * http://mongoosejs.com/docs/api.html#document-js + */ +var doc = {}; +doc.$isDefault('path').valueOf(); +doc.depopulate('path'); +doc.equals(doc).valueOf(); +doc.execPopulate().then(function (arg) { + arg.execPopulate(); +}).catch(function (err) {}); +doc.get('path', Number); +doc.init(doc, cb).init(doc, {}, cb); +doc.inspect(); +doc.invalidate('path', new Error('hi'), 999).toString(); +doc.isDirectModified('path').valueOf(); +doc.isInit('path').valueOf(); +doc.isModified('path').valueOf(); +doc.isSelected('path').valueOf(); +doc.markModified('path'); +doc.modifiedPaths()[0].toLowerCase(); +doc.populate(function (err, doc) { + doc.populate('path', function (err, doc) { + doc.populate({ + path: 'path', + select: 'path', + match: {} + }); + }); +}); +doc.populated('path'); +doc.set('path', 999, {}).set({ path: 999 }); +doc.toJSON({ + getters: true, + virtuals: false +}); +doc.toObject({ + transform: function (doc, ret, options) { + doc.toObject(); + } +}); +doc.toString().toLowerCase(); +doc.unmarkModified('path'); +doc.update(doc, cb).cursor(); +doc.update(doc, { + safe: true, + upsert: true +}, cb).cursor(); +doc.validate({}, function (err) {}); +doc.validate().then(null).catch(null); +doc.validateSync(['path1', 'path2']).stack; +/* practical examples */ +var MyModel = mongoose.model('test', new mongoose.Schema({ + name: { + type: String, + default: 'Val ' + } +})); +doc = new MyModel(); +doc.$isDefault('name'); +MyModel.findOne().populate('author').exec(function (err, doc) { + if (doc) { + doc.depopulate('author'); + } +}); +doc.populate('path'); +doc.populate({path: 'hello'}); +doc.populate('path', cb) +doc.populate({path: 'hello'}, cb); +doc.populate(cb); +doc.populate({path: 'hello'}).execPopulate().catch(cb); +doc.update({$inc: {wheels:1}}, { w: 1 }, cb); + +const ImageSchema = new mongoose.Schema({ + name: {type: String, required: true}, + id: {type: Number, unique: true, required: true, index: true}, +}, { id: false }); + +interface ImageDoc extends mongoose.Document { + name: string, + id: number +} + +const ImageModel = mongoose.model('image', ImageSchema); + +ImageModel.findOne({}, function(err, doc) { + if (doc) { + doc.name; + doc.id; + } +}); + +/* + * section types/subdocument.js + * http://mongoosejs.com/docs/api.html#types-subdocument-js + */ +// The constructor is private api, but we'll use it to test +var subdocument: mongoose.Types.Subdocument = new mongoose.Types.Subdocument(); +subdocument.ownerDocument().errors; +subdocument.remove({}, function (err) { + return 6; +}); +/* inherited properties */ +subdocument.execPopulate(); + +/* + * section types/array.js + * http://mongoosejs.com/docs/api.html#types-array-js + */ +var mongooseArray: mongoose.Types.Array = new mongoose.Types.Array(); +mongooseArray.$shift().toLowerCase(); +mongooseArray.remove().$shift(); +mongooseArray.$pop().toLowerCase(); +mongooseArray.addToSet('hi', 9, 9, '4')[0].toLowerCase(); +mongooseArray.indexOf({name: 'obj'}).toFixed(); +mongooseArray.inspect(); +mongooseArray.nonAtomicPush(9, 8, 'hi').toFixed(); +mongooseArray.pop().toLowerCase(); +mongooseArray.pull(5, 4, 'hi').$shift(); +mongooseArray.push([]).toFixed(); +mongooseArray.set(1, 'hi').$shift(); +mongooseArray.shift().toLowerCase(); +mongooseArray.sort(function (a, b) { + return a.length - b.length; +}).unshift(); +mongooseArray.splice(4, 1).unshift(); +mongooseArray.toObject({depopulate: true}).unshift(); +mongooseArray.unshift(2, 4, 'hi').toFixed(); +/* inherited properties */ +mongooseArray.concat(); +mongooseArray.length; +/* practical examples */ +interface MySubEntity extends mongoose.Types.Subdocument { + property1: string; + property2: string; +} +interface MyEntity extends mongoose.Document { + sub: mongoose.Types.Array +} +var myEntity = {}; +var subDocArray = _.filter(myEntity.sub, function (sd) { + sd.property1; + sd.property2.toLowerCase(); + return true; +}); + + +/* + * section types/documentarray.js + * http://mongoosejs.com/docs/api.html#types-documentarray-js + */ +// The constructor is private api, but we'll use it to test +var documentArray: mongoose.Types.DocumentArray = + new mongoose.Types.DocumentArray(); +documentArray.create({}).errors; +documentArray.id(new Buffer('hi')); +documentArray.inspect(); +documentArray.toObject({}).length; +/* inherited from mongoose.Types.Array */ +documentArray.$shift(); +/* inherited from Native Array */ +documentArray.concat(); +/* practical example */ +interface MySubEntity1 extends mongoose.Types.Subdocument { + property1: string; + property2: string; +} +interface MyEntity1 extends mongoose.Document { + sub: mongoose.Types.DocumentArray +} +var newEnt = {}; +var newSub: MySubEntity1 = newEnt.sub.create({ property1: "example", property2: "example" }); + +/* + * section types/buffer.js + * http://mongoosejs.com/docs/api.html#types-buffer-js + */ +var mongooseBuffer: mongoose.Types.Buffer = new mongoose.Types.Buffer('hello'); +mongooseBuffer.copy(mongooseBuffer, 1, 2, 3).toFixed(); +mongooseBuffer.copy(new Buffer('hi')).toFixed(); +mongooseBuffer.equals(new Buffer('hi')).valueOf(); +mongooseBuffer.subtype(123); +mongooseBuffer.toObject().value(); +mongooseBuffer.write('world', 3, 2, 1).toFixed(); +/* inherited properties */ +mongooseBuffer.compare(mongooseBuffer); +/* inherited static properties */ +mongoose.Types.Buffer.from([1, 2, 3]); + +/* + * section types/decimal128.js + * http://mongoosejs.com/docs/api.html#types-decimal128-js + */ +var decimal128: mongoose.Types.Decimal128 = mongoose.Types.Decimal128.fromString('123.45678901234567'); +decimal128 = new mongoose.Types.Decimal128(new Buffer('12345')); +/* practical examples */ +export interface ILargeValuesSchema extends mongoose.MongooseDocument { + sum: mongoose.Schema.Types.Decimal128; +} +export var LargeValuesSchema = new mongoose.Schema({ + sum: { + type: mongoose.Schema.Types.Decimal128, + required: true + } +}); + +/* + * section types/objectid.js + * http://mongoosejs.com/docs/api.html#types-objectid-js + */ +var objectId: mongoose.Types.ObjectId = mongoose.Types.ObjectId.createFromHexString('0x1234'); +objectId = new mongoose.Types.ObjectId(12345); +objectId = mongoose.Types.ObjectId(12345); +objectId.getTimestamp(); +/* practical examples */ +export interface IManagerSchema extends mongoose.MongooseDocument { + user: mongoose.Schema.Types.ObjectId; +} +export var ManagerSchema = new mongoose.Schema({ + user: { + type: mongoose.Schema.Types.ObjectId, + ref: 'User', + required: true + } +}); + +/* + * section types/embedded.js + * http://mongoosejs.com/docs/api.html#types-embedded-js + */ +var embeddedDocument: mongoose.Types.Embedded = new mongoose.Types.Embedded(); +embeddedDocument.inspect().hasOwnProperty(''); +embeddedDocument.invalidate('hi', new Error('bleh')).valueOf(); +embeddedDocument.ownerDocument().execPopulate(); +embeddedDocument.parent().execPopulate(); +embeddedDocument.parentArray().$shift(); +embeddedDocument.remove().invalidate('hi', new Error('hi')); +embeddedDocument.markModified('path'); +/* inherited properties */ +embeddedDocument.execPopulate(); + +/* + * section query.js + * http://mongoosejs.com/docs/api.html#query-js + */ +var query = > {}; +query.$where('').$where(cb); +query.all(99).all('path', 99); +query.and([{ color: 'green' }, { status: 'ok' }]).and([]); +query.batchSize(100).batchSize(100); +var lowerLeft = [40.73083, -73.99756] +var upperRight = [40.741404, -73.988135] +query.where('loc').within().box(lowerLeft, upperRight) +query.box({ ll : lowerLeft, ur : upperRight }).box({}); +var queryModel = mongoose.model('QModel') +query.cast(new queryModel(), {}).hasOwnProperty(''); +query.catch(cb).catch(cb); +query.center({}).center({}); +query.centerSphere({ center: [50, 50], radius: 10 }).centerSphere('path', {}); +query.circle({ center: [50, 50], radius: 10 }).circle('path'); +query.collation({ locale: 'en_US', strength: 1 }); +query.comment('comment').comment('comment'); +query.where({color: 'black'}).count(function (err, count) { + count.toFixed(); +}).then(function (res) { + res.toFixed(); +}).catch(function (err) {}); +query.cursor().close(); +query.distinct('field', {}, cb); +query.distinct('field', {}); +query.distinct('field', cb); +query.distinct('field'); +query.distinct(cb); +query.distinct(); +query.elemMatch('comment', { + author: 'autobot', + votes: {$gte: 5} +}).elemMatch('comment', function (elem) { + elem.where('author').equals('autobot'); + elem.where('votes').gte(5); +}); +query.where('age').equals(49); +query.exec('find', function (err, res) { + res[0].execPopulate(); +}).then(function (arg) { + arg[0].execPopulate(); +}).catch(cb); +query.where('name').exists().exists('age', false); +query.find({name: 'aa'}, function (err, res) { + res[0].execPopulate(); +}).find(); +query.findOne(function (err, res) { + res.execPopulate(); +}).findOne(); +query.findOneAndRemove({name: 'aa'}, { + passRawResult: true +}, function (err, doc) { + doc.execPopulate(); +}).findOneAndRemove(); +query.findOneAndUpdate({name: 'aa'}, {name: 'bb'}, { + +}); +query.findOneAndUpdate({name: 'aa'}, {name: 'bb'}, { + passRawResult: true +}, cb); +query.findOneAndUpdate({name: 'aa'}, {name: 'bb'}, cb); +query.findOneAndUpdate({name: 'aa'}, {name: 'bb'}); +query.findOneAndUpdate({name: 'bb'}, cb); +query.findOneAndUpdate({name: 'bb'}); +query.findOneAndUpdate(cb); +query.findOneAndUpdate().then(function (doc) { + doc.execPopulate(); +}).catch(cb); +var polyA = [[[ 10, 20 ], [ 10, 40 ], [ 30, 40 ], [ 30, 20 ]]] +query.where('loc').within().geometry({ type: 'Polygon', coordinates: polyA }) +var polyB = [[ 0, 0 ], [ 1, 1 ]] +query.where('loc').within().geometry({ type: 'LineString', coordinates: polyB }) +var polyC = [ 0, 0 ] +query.where('loc').within().geometry({ type: 'Point', coordinates: polyC }) +query.where('loc').intersects().geometry({ type: 'Point', coordinates: polyC }) +query.getQuery(); +query.getUpdate(); +query.find().where('age').gt(21); +query.find().gt('age', 21); +query.find().where('age').gte(21); +query.find().gte('age', 21); +query.hint({ indexA: 1, indexB: -1}).hint({}); +query.in([1, 2, 3]).in('num', [1, 2, 3]); +query.where('path').intersects().geometry({ + type: 'LineString' + , coordinates: [[180.0, 11.0], [180, 9.0]] +}); +query.where('path').intersects({ + type: 'LineString' + , coordinates: [[180.0, 11.0], [180, 9.0]] +}); +query.find().lean().exec(function (err: any, docs: any) { + docs[0]; +}); +query.limit(20).limit(20); +query.find().where('age').lt(21); +query.find().lt('age', 21); +query.find().where('age').lte(21); +query.find().lte('age', 21); +query.maxDistance('path', 21).maxDistance(21); +query.maxscan(100).maxScan(100); +query.maxScan(100).maxScan(100); +query.merge(query).merge({}); +query.mod([1, 2]).mod([5, 6]); +query.find().where('age').ne(21); +query.find().ne('age', 21); +query.where('loc').near({ center: [10, 10] }); +query.where('loc').near({ center: [10, 10], maxDistance: 5 }); +query.where('loc').near({ center: [10, 10], maxDistance: 5, spherical: true }); +query.near('loc', { center: [10, 10], maxDistance: 5 }); +query.where('loc').nearSphere({ center: [10, 10], maxDistance: 5 }); +query.find().where('age').in([20, 21]); +query.find().in('age', [20, 21]); +query.nor([{ color: 'green' }, { status: 'ok' }]).nor([]); +query.or([{ color: 'red' }, { status: 'emergency' }]).or([]); +query.where('loc').within().polygon([10,20], [13, 25], [7,15]); +query.polygon('loc', [10,20], [13, 25], [7,15]); +query.findOne().populate('owner').exec(function (err, kitten) { + kitten.execPopulate(); +}); +query.find().populate({ + path: 'owner' + , select: 'name' + , match: { color: 'black' } + , options: { sort: { name: -1 }} +}).exec(function (err, kittens) { + kittens[0].execPopulate(); +}); +query.find().populate('owner', 'name', null, {sort: { name: -1 }}).exec(function (err, kittens) { + kittens[0].execPopulate(); +}); +query.read('primary', []).read('primary'); +query.regex(/re/).regex('path', /re/); +query.remove({}, cb); +query.remove({}); +query.remove(cb); +query.remove(); +query.select('a b'); +query.select('-c -d'); +query.select({ a: 1, b: 1 }); +query.select({ c: 0, d: 0 }); +query.select('+path'); +query.selected(); +query.selectedExclusively(); +query.selectedInclusively(); +query.setOptions({ + tailable: true, + batchSize: true, + lean: false +}); +query.size(0).size('age', 0); +query.skip(100).skip(100); +query.slaveOk().slaveOk(false); +query.slice('comments', 5); +query.slice('comments', -5); +query.slice('comments', [10, 5]); +query.where('comments').slice(5); +query.where('comments').slice([-10, 5]); +query.snapshot().snapshot(true); +query.sort({ field: 'asc', test: -1 }); +query.sort('field -test'); +query.stream().on('data', function (doc: any) { +}).on('error', function (err: any) { +}).on('close', function () { +}); +query.tailable().tailable(false); +query.then(cb).catch(cb); +(new (query.toConstructor())(1, 2, 3)).toConstructor(); +query.update({}, doc, { + +}, cb); +query.update({}, doc, { + +}); +query.update({}, doc, cb); +query.update({}, doc); +query.update(doc, cb); +query.update(doc); +query.update(cb); +query.update(true); +query.update(); +query.where('age').gte(21).lte(65) + .where('name', /^vonderful/i) + .where('friends').slice(10) + .exec(cb); +query.where('path').within().box({}) +query.where('path').within().circle({}) +query.where('path').within().geometry({type: 'c', coordinates: []}); +query.where('loc').within({ center: [50,50], radius: 10, unique: true, spherical: true }); +query.where('loc').within({ box: [[40.73, -73.9], [40.7, -73.988]] }); +query.where('loc').within({ polygon: [[],[],[],[]] }); +query.where('loc').within([], [], []); +query.where('loc').within([], []); +query.where('loc').within({ type: 'LineString', coordinates: [] }); +mongoose.Query.use$geoWithin = false; +/* practical example */ +query. + find({ + occupation: /host/, + 'name.last': 'Ghost', + age: { $gt: 17, $lt: 66 }, + likes: { $in: ['vaporizing', 'talking'] } + }). + limit(10). + sort({ occupation: -1 }). + select({ name: 1, occupation: 1 }). + exec(cb).then(cb).catch(cb); +query. + find({ occupation: /host/ }). + where('name.last').equals('Ghost'). + where('age').gt(17).lt(66). + where('likes').in(['vaporizing', 'talking']). + limit(10). + sort('-occupation'). + select('name occupation'). + exec(cb).then(cb).catch(cb); + +/* + * section schema/array.js + * http://mongoosejs.com/docs/api.html#schema-array-js + */ +var schemaArray: mongoose.Schema.Types.Array = new mongoose.Schema.Types.Array('key', new mongoose.SchemaType('hi'), {}); +schemaArray.checkRequired('hello').valueOf(); +/** static properties */ +mongoose.Schema.Types.Array.schemaName.toLowerCase(); +/** inherited properties */ +schemaArray.sparse(true); + +/* + * section schema/string.js + * http://mongoosejs.com/docs/api.html#schema-string-js + */ +var MongoDocument = {}; +var schemastring: mongoose.Schema.Types.String = new mongoose.Schema.Types.String('hello'); +schemastring.checkRequired(234, MongoDocument).valueOf(); +schemastring.enum(['hi', 'a', 'b']).enum('hi').enum({}); +schemastring.lowercase().lowercase(); +schemastring.match(/re/, 'error').match(/re/); +schemastring.maxlength(999, 'error').maxlength(999); +schemastring.minlength(999, 'error').minlength(999); +schemastring.trim().trim(); +schemastring.uppercase().uppercase(); +/* static properties */ +mongoose.Schema.Types.String.schemaName.toLowerCase(); +/* inherited properties */ +schemastring.sparse(true); + +/* + * section schema/documentarray.js + * http://mongoosejs.com/docs/api.html#schema-documentarray-js + */ +var documentarray: mongoose.Schema.Types.DocumentArray = new mongoose.Schema.Types.DocumentArray('key', new mongoose.Schema()); +/* static properties */ +mongoose.Schema.Types.DocumentArray.schemaName.toLowerCase(); +/* inherited properties */ +documentarray.sparse(true); + +/* + * section schema/number.js + * http://mongoosejs.com/docs/api.html#schema-number-js + */ +var schemanumber: mongoose.Schema.Types.Number = new mongoose.Schema.Types.Number('num', {}); +schemanumber.checkRequired(999, MongoDocument).valueOf(); +schemanumber.max(999, 'error').max(999); +schemanumber.min(999, 'error').min(999); +/* static properties */ +mongoose.Schema.Types.Number.schemaName.toLowerCase(); +/* inherited properties */ +schemanumber.sparse(true); + +/* + * section schema/date.js + * http://mongoosejs.com/docs/api.html#schema-date-js + */ +var schemadate: mongoose.Schema.Types.Date = new mongoose.Schema.Types.Date('99'); +schemadate.checkRequired([], MongoDocument).valueOf(); +schemadate.expires(99).expires('now'); +schemadate.max(new Date(), 'error').max(new Date('')); +schemadate.min(new Date(), 'error').min(new Date('')); +/* static properties */ +mongoose.Schema.Types.Date.schemaName.toLowerCase(); +/* inherited properties */ +schemadate.sparse(true); + +/* + * section schema/buffer.js + * http://mongoosejs.com/docs/api.html#schema-buffer-js + */ +var schemabuffer: mongoose.Schema.Types.Buffer = new mongoose.Schema.Types.Buffer('99'); +schemabuffer.checkRequired(999, MongoDocument).valueOf(); +/* static properties */ +mongoose.Schema.Types.Buffer.schemaName.toLowerCase(); +/* inherited properties */ +schemabuffer.sparse(true); + +/* + * section schema/boolean.js + * http://mongoosejs.com/docs/api.html#schema-boolean-js + */ +var schemaboolean: mongoose.Schema.Types.Boolean = new mongoose.Schema.Types.Boolean('99'); +schemaboolean.checkRequired(99).valueOf(); +/* static properties */ +mongoose.Schema.Types.Boolean.schemaName.toLowerCase(); +/* inherited properties */ +schemaboolean.sparse(true); + +/* + * section schema/objectid.js + * http://mongoosejs.com/docs/api.html#schema-objectid-js + */ +var schemaobjectid: mongoose.Schema.Types.ObjectId = new mongoose.Schema.Types.ObjectId('99'); +schemaobjectid.auto(true).auto(false); +schemaobjectid.checkRequired(99, MongoDocument).valueOf(); +/* static properties */ +mongoose.Schema.Types.ObjectId.schemaName.toLowerCase(); +/* inherited properties */ +schemaobjectid.sparse(true); + +/* + * section schema/mixed.js + * http://mongoosejs.com/docs/api.html#schema-mixed-js + */ +var schemamixed: mongoose.Schema.Types.Mixed = new mongoose.Schema.Types.Mixed('99'); +/* static properties */ +mongoose.Schema.Types.Mixed.schemaName.toLowerCase(); +/* inherited properties */ +schemamixed.sparse(true); + +/* + * section schema/embedded.js + * http://mongoosejs.com/docs/api.html#schema-embedded-js + */ +var schemaembedded: mongoose.Schema.Types.Embedded = + new mongoose.Schema.Types.Embedded(new mongoose.Schema(), '99'); +/* inherited properties */ +schemaembedded.sparse(true); + +/* + * section aggregate.js + * http://mongoosejs.com/docs/api.html#aggregate-js + */ +var aggregate: mongoose.Aggregate; +aggregate = mongoose.model('ex').aggregate({ $match: { age: { $gte: 21 }}}); +aggregate = new mongoose.Aggregate(); +aggregate = new mongoose.Aggregate({ $project: { a: 1, b: 1 } }); +aggregate = new mongoose.Aggregate({ $project: { a: 1, b: 1 } }, { $skip: 5 }); +aggregate = new mongoose.Aggregate([{ $project: { a: 1, b: 1 } }, { $skip: 5 }]); +aggregate.addCursorFlag('flag', true).addCursorFlag('', false); +aggregate.allowDiskUse(true).allowDiskUse(false, []); +aggregate.append({ $project: { field: 1 }}, { $limit: 2 }); +aggregate.append([{ $match: { daw: 'Logic Audio X' }} ]); +aggregate.collation({ locale: 'en_US', strength: 1 }); +aggregate.cursor({ batchSize: 1000 }).exec().each(cb); +aggregate.exec().then(cb).catch(cb); +aggregate.explain(cb).then(cb).catch(cb); +aggregate.group({ _id: "$department" }).group({ _id: "$department" }); +aggregate.limit(10).limit(10); +var lookupOpt = { + from: 'users', localField: + 'userId', foreignField: '_id', + as: 'users' +}; +aggregate.lookup(lookupOpt).lookup(lookupOpt); +aggregate.match({ + department: {$in: [ "sales", "engineering"]} +}); +aggregate.model(new (mongoose.model('xx'))()).model(null); +aggregate.near({ + near: [40.724, -73.997], + distanceField: "dist.calculated", + maxDistance: 0.008, + query: { type: "public" }, + includeLocs: "dist.location", + uniqueDocs: true, + num: 5 +}); +aggregate.project("a b -_id"); +aggregate.project({a: 1, b: 1, _id: 0}); +aggregate.project({ + newField: '$b.nested' + , plusTen: { $add: ['$val', 10]} + , sub: { + name: '$a' + } +}) +aggregate.project({ salary_k: { $divide: [ "$salary", 1000 ]}}); +aggregate.read('primaryPreferred').read('pp'); +aggregate.sample(3).sample(3); +aggregate.skip(10).skip(10); +aggregate.sort({ field: 'asc', test: -1 }); +aggregate.sort('field -test'); +aggregate.then(cb).catch(cb); +aggregate.unwind("tags").unwind('tags'); +aggregate.unwind("a", "b", "c").unwind('tag1', 'tag2'); +aggregate.unwind( + { + path: "tags", + includeArrayIndex: "idx", + preserveNullAndEmptyArrays: true + }) + .unwind({ + path: "tags", + includeArrayIndex: "idx", + preserveNullAndEmptyArrays: true + }); +aggregate.unwind( + { + path: "a", + includeArrayIndex: "idx", + preserveNullAndEmptyArrays: true + }, { + path: "b", + includeArrayIndex: "idx", + preserveNullAndEmptyArrays: true + }, { + path: "c", + includeArrayIndex: "idx", + preserveNullAndEmptyArrays: true + }) + .unwind({ + path: "tag1", + includeArrayIndex: "idx", + preserveNullAndEmptyArrays: true + }, { + path: "tag2", + includeArrayIndex: "idx", + preserveNullAndEmptyArrays: true + }); + +/* + * section schematype.js + * http://mongoosejs.com/docs/api.html#schematype-js + */ +new mongoose.SchemaType('hello', 9, 'hello' ); +var STSchema = new mongoose.Schema({ + mixed: mongoose.Schema.Types.Mixed +}); +var schematype = schema.path('mixed'); +schematype.default('default'); +STSchema.path('born').get(cb).get(cb); +STSchema.path('name').index(true).index({ unique: true, sparse: true }); +schematype.required(true, 'mess').required(true); +schematype.select(true).select(false); +STSchema.path('name').set(cb).set(cb); +schematype.sparse(true).sparse(true); +schematype.text(true).text(true); +schematype.unique(true).unique(true); +schematype.validate(/re/) + .validate({}, 'error') + .validate(cb, 'try', 'tri'); + +/* + * section promise.js + * http://mongoosejs.com/docs/api.html#promise-js + */ +var mongopromise = new mongoose.Promise(); +mongopromise = new mongoose.Promise(function (err: any, arg: any) { + arg.sparse(true); + err.stack; +}); +mongopromise = new mongoose.Promise(function (err: any, arg1: any, arg2: any) { + arg1.sparse(true); + arg2.sparse(true); + err.stack; +}); +mongopromise.addBack(function (err: any, arg: any) { + err.stack; + arg.sparse(true); +}).addBack(function (err: any, arg1: any, arg2: any) { + err.stack; + arg1.sparse(true); + arg2.sparse(true); +}); +mongopromise.addCallback(function (arg: any) { + arg.sparse(true); +}).addCallback(function (arg1: any, arg2: any) { + arg1.sparse(true); + arg2.sparse(true); +}); +mongopromise.addErrback(function (err: any) { + err.stack; +}).addErrback(function () {}); +mongopromise.catch(function (err: any) { + err.stack; +}).catch(function () {}); +mongopromise.end(); +mongopromise.error(999).error([]); +mongopromise.on('init', function () {}).on('init', function () {}); +mongopromise.reject({}).reject('').reject(new Error('hi')); +mongopromise.resolve(new Error('hi'), {}).resolve(); +mongopromise.then(function (arg: any) { + arg.sparse(true); +}, function (err: any) { + err.stack; +}).then(function (arg1: any, arg2: any) { + arg1.sparse(true); + arg2.sparse(true); +}); +mongopromise.complete(new mongoose.SchemaType('')).complete( + new mongoose.SchemaType(''), + new mongoose.SchemaType('') +); +/* static properties */ +mongoose.Promise.ES6(function (complete: Function, error: Function) { + complete.apply(this); + error.apply(this); +}); + +/* inherited properties */ +mongopromise.chain(mongopromise); +mongoose.Promise.FAILURE; +/* practical example */ +mongoose.model('') + .findOne({}) + .exec() + .then(function (arg) { + if (arg) { + arg.save; + } + return 1; + }).then(function (num) { + num.toFixed; + return new Promise((resolve, reject) => { + resolve('string'); + }); + }).then(function (str) { + str.toLowerCase + return (mongoose.model('')).findOne({}).exec(); + }).then(function (arg) { + if (arg) { + arg.save; + } + return 1; + }).catch(function (err) { + return 1; + }).then(function (arg) { + arg.toFixed; + return new Promise<{a: string, b: number}>((resolve, reject) => { + resolve({a: 'hi', b: 29}); + }); + }).then(function (arg) { + arg.a.toLowerCase; + arg.b.toFixed; + }); + +mongoose.model('').findOne({}) + .then(function (arg) { + if (arg) { + arg.save; + } + return 2; + }).then(function (num) { + num.toFixed; + return new Promise((resolve, reject) => { + resolve('str'); + }); + }).then(function (str) { + str.toLowerCase; + }); + +mongoose.model('').aggregate() + .then(function (arg) { + return 2; + }).then(function (num) { + num.toFixed; + return new Promise((resolve, reject) => { + resolve('str'); + }); + }).then(function (str) { + str.toLowerCase; + }); + +/* pluggable promise */ +(mongoose).Promise = Promise; +require('mongoose').Promise = Promise; +mongoose.Promise.race; +mongoose.Promise.all; + +mongoose.model('').findOne() + .exec().then(cb); + +/* + * section model.js + * http://mongoosejs.com/docs/api.html#model-js + */ +var MongoModel = mongoose.model('MongoModel', new mongoose.Schema({ + name: String, + type: { + type: mongoose.Schema.Types.Mixed, + required: true + } +}), 'myCollection', true); +MongoModel.find({}).$where('indexOf("val") !== -1').exec(function (err, docs) { + docs[0].save(); + docs[0].__v; +}); +MongoModel.findById(999, function (err, doc) { + var handleSave = function(err: Error, product: mongoose.Document, numAffected: number) {}; + if (!doc) { + return; + } + doc.increment(); + doc.save(handleSave).then(cb).catch(cb); + doc.save({ validateBeforeSave: false }, handleSave).then(cb).catch(cb); + doc.save({ safe: true }, handleSave).then(cb).catch(cb); + doc.save({ safe: { w: 2, j: true } }, handleSave).then(cb).catch(cb); + doc.save({ safe: { w: 'majority', wtimeout: 10000 } }, handleSave).then(cb).catch(cb); + + // test if Typescript can infer the types of (err, product, numAffected) + doc.save(function(err, product, numAffected) { product.save(); }) + .then(function(p) { p.save() }).catch(cb); + doc.save({ validateBeforeSave: false }, function(err, product, numAffected) { + product.save(); + }).then(function(p) { p.save() }).catch(cb); +}); +MongoModel = (new MongoModel()).model('MongoModel'); +var mongoModel = new MongoModel(); +mongoModel.remove(function (err, product) { + if (err) throw(err); + MongoModel.findById(product._id, function (err, product) { + if (product) { + product.id.toLowerCase(); + product.remove(); + } + }); +}); +mongoModel.save().then(function (product) { + product.save().then(cb).catch(cb); +}); +MongoModel.aggregate( + { $group: { _id: null, maxBalance: { $max: '$balance' }}} + , { $project: { _id: 0, maxBalance: 1 }} + , cb); +MongoModel.aggregate() + .group({ _id: null, maxBalance: { $max: '$balance' } }) + .exec(cb); +MongoModel.count({ type: 'jungle' }, function (err, count) { + count.toFixed(); +}); +MongoModel.create({ + type: 'jelly bean' +}, { + type: 'snickers' +}, cb).then(function (a) { + a.save(); +}) +MongoModel.create([{ type: 'jelly bean' }, { + type: 'snickers' +}], function (err, candies) { + var jellybean = candies[0]; + var snickers = candies[1]; +}).then(function (arg) { + arg[0].save(); + arg[1].save(); +}); +MongoModel.distinct('url', { clicks: {$gt: 100}}, function (err, result) { +}); +MongoModel.distinct('url').exec(cb); +MongoModel.ensureIndexes({}, cb); +MongoModel.find({ name: 'john', age: { $gte: 18 }}); +MongoModel.find({ name: 'john', age: { $gte: 18 }}, function (err, docs) { + docs[0].remove(); + docs[1].execPopulate(); +}); +MongoModel.find({ name: /john/i }, 'name friends', function (err, docs) { }) +MongoModel.find({ name: /john/i }, null, { skip: 10 }) +MongoModel.find({ name: /john/i }, null, { skip: 10 }, function (err, docs) {}); +MongoModel.find({ name: /john/i }, null, { skip: 10 }).exec(function (err, docs) {}); +MongoModel.findById(999, function (err, adventure) {}); +MongoModel.findById(999).exec(cb); +MongoModel.findById(999, 'name length', function (err, adventure) { + if (adventure) { + adventure.save(); + } +}); +MongoModel.findById(999, 'name length').exec(cb); +MongoModel.findById(999, '-length').exec(function (err, adventure) { + if (adventure) { + adventure.addListener('click', cb); + } +}); +MongoModel.findById(999, 'name', { lean: true }, function (err, doc) {}); +MongoModel.findById(999, 'name').lean().exec(function (err, doc) {}); +MongoModel.findByIdAndRemove(999, {}, cb); +MongoModel.findByIdAndRemove(999, {}); +MongoModel.findByIdAndRemove(999, cb); +MongoModel.findByIdAndRemove(999); +MongoModel.findByIdAndRemove(); +MongoModel.findByIdAndUpdate(999, {}, {}, cb); +MongoModel.findByIdAndUpdate(999, {}, {}); +MongoModel.findByIdAndUpdate(999, {}, cb); +MongoModel.findByIdAndUpdate(999, {}); +MongoModel.findByIdAndUpdate(); +MongoModel.findOne({ type: 'iphone' }, function (err, adventure) {}); +MongoModel.findOne({ type: 'iphone' }).exec(function (err, adventure) {}); +MongoModel.findOne({ type: 'iphone' }, 'name', function (err, adventure) {}); +MongoModel.findOne({ type: 'iphone' }, 'name').exec(function (err, adventure) {}); +MongoModel.findOne({ type: 'iphone' }, 'name', { lean: true }, cb); +MongoModel.findOne({ type: 'iphone' }, 'name', { lean: true }).exec(cb); +MongoModel.findOne({ type: 'iphone' }).select('name').lean().exec(cb); +interface ModelUser { + _id: any; + name: string; + abctest: string; +} +MongoModel.findOne({ type: 'iphone' }).select('name').lean().exec() +.then(function(doc: ModelUser) { + doc._id; + doc.name; + doc.abctest; +}); +MongoModel.findOneAndRemove({}, {}, cb); +MongoModel.findOneAndRemove({}, {}); +MongoModel.findOneAndRemove({}, cb); +MongoModel.findOneAndRemove({}); +MongoModel.findOneAndRemove(); +MongoModel.findOneAndUpdate({}, {}, {}, cb); +MongoModel.findOneAndUpdate({}, {}, {}); +MongoModel.findOneAndUpdate({}, {}, cb); +MongoModel.findOneAndUpdate({}, {}); +MongoModel.findOneAndUpdate(); +MongoModel.geoNear([1,3], { maxDistance : 5, spherical : true }, function(err, results, stats) { + results[0].on('data', cb); +}); +MongoModel.geoNear({ type : "Point", coordinates : [9,9] }, { + maxDistance : 5, spherical : true +}, function(err, results, stats) { + console.log(results); +}); +MongoModel.geoSearch({ type : "house" }, { + near: [10, 10], maxDistance: 5 +}, function(err, res) { + res[0].remove(); +}); +MongoModel.hydrate({ + _id: '54108337212ffb6d459f854c', + type: 'jelly bean' +}).execPopulate(); +MongoModel.insertMany([ + { name: 'Star Wars' }, + { name: 'The Empire Strikes Back' } +], function(error, docs) {}); +MongoModel.insertMany({name: 'Star Wars'}, function(error, doc) {}); +MongoModel.mapReduce({ + map: cb, + reduce: cb +}, function (err, results) { + console.log(results) +}).then(function (model) { + return model.find().where('value').gt(10).exec(); +}).then(function (docs) { + console.log(docs); +}).then(null, cb); +MongoModel.findById(999, function (err, user) { + if (!user) { + return; + } + var opts = [ + { path: 'company', match: { x: 1 }, select: 'name' } + , { path: 'notes', options: { limit: 10 }, model: 'override' } + ] + MongoModel.populate(user, opts, cb); + MongoModel.populate(user, opts, function (err, user) { + console.log(user); + }); +}); +MongoModel.find(999, function (err, users) { + var opts = [{ path: 'company', match: { x: 1 }, select: 'name' }] + var promise = MongoModel.populate(users, opts); + promise.then(console.log); +}); +MongoModel.populate({ + name: 'Indiana Jones', + weapon: 389 +}, { + path: 'weapon', + model: 'Weapon' +}, cb); +var users = [{ name: 'Indiana Jones', weapon: 389 }] +users.push({ name: 'Batman', weapon: 8921 }) +MongoModel.populate(users, { path: 'weapon' }, function (err, users) { + users.forEach(cb); +}); +MongoModel.remove({ title: 'baby born from alien father' }, cb); +MongoModel.remove({_id: '999'}).exec().then(cb).catch(cb); +MongoModel.update({ age: { $gt: 18 } }, { oldEnough: true }, cb); +MongoModel.update({ name: 'Tobi' }, { ferret: true }, { multi: true }, cb); +MongoModel.where('age').gte(21).lte(65).exec(cb); +MongoModel.where('age').gte(21).lte(65).where('name', /^b/i); +new (mongoModel.base.model(''))(); +mongoModel.baseModelName.toLowerCase(); +mongoModel.collection.$format(99); +mongoModel.collection.initializeOrderedBulkOp; +mongoModel.collection.findOne; +mongoModel.db.openSet(''); +mongoModel.discriminators; +mongoModel.modelName.toLowerCase(); +MongoModel = mongoModel.base.model('new', mongoModel.schema); +/* inherited properties */ +MongoModel.modelName; +mongoModel.modelName; +MongoModel.collection; +mongoModel.collection; +mongoModel._id; +mongoModel.execPopulate(); +mongoModel.on('data', cb); +mongoModel.addListener('event', cb); +MongoModel.findOne({ title: /timex/i }) + .populate('_creator', 'name') + .exec(function (err, story) { + if (story) { + story.execPopulate(); + } + }); +MongoModel.find({ + id: 999 +}) +.populate({ + path: 'fans', + match: { age: { $gte: 21 }}, + select: 'name -_id', + options: { limit: 5 } +}) +.exec(); +/* practical example */ +interface Location extends mongoose.Document { + name: string; + address: string; + rating: number; + facilities: string[]; + coords: number[]; + openingTimes: any[]; + reviews: any[]; +}; +const locationSchema = new mongoose.Schema({ + name: { type: String, required: true }, + address: String, + rating: { type: Number, "default": 0, min: 0, max: 5 }, + facilities: [String], + coords: { type: [Number], index: "2dsphere" }, + openingTimes: [mongoose.Schema.Types.Mixed], + reviews: [mongoose.SchemaTypes.Mixed] +}); +var LocModel = mongoose.model("Location", locationSchema); +LocModel.findById(999) + .select("-reviews -rating") + .exec(function (err, location) { + if (!location) { + return; + } + location.name = 'blah'; + location.address = 'blah'; + location.reviews.forEach(review => {}); + location.facilities.forEach(facility => { + facility.toLowerCase(); + }); + }); +LocModel.find() + .select('-reviews -rating') + .exec(function (err, locations) { + locations.forEach(location => { + location.name = 'blah'; + location.address = 'blah'; + location.reviews.forEach(review => {}); + location.facilities.forEach(facility => { + facility.toLowerCase(); + }); + }); + }); +LocModel.find({}).$where('') + .exec(function (err, locations) { + locations[0].name; + locations[1].openingTimes; + }); +LocModel.count({}) + .exec(function (err, count) { + count.toFixed(); + }); +LocModel.distinct('') + .select('-review') + .exec(function (err, distinct) { + distinct.concat; + }) + .then(cb).catch(cb); +LocModel.findByIdAndRemove() + .exec(function (err, doc) { + if (!doc) { + return; + } + doc.addListener; + doc.openingTimes; + }); +LocModel.findByIdAndUpdate() + .select({}) + .exec(function (err, location) { + if (location) { + location.reviews; + } + }); +LocModel.findOne({}, function (err, doc) { + if (doc) { + doc.openingTimes; + } +}); +LocModel.findOneAndRemove() + .exec(function (err, location) { + if (location) { + location.name; + } + }); +LocModel.findOneAndUpdate().exec().then(function (arg) { + if (arg) { + arg.openingTimes; + } +}); +LocModel.geoSearch({}, { + near: [1, 2], + maxDistance: 22 +}, function (err, res) { res[0].openingTimes; }); +interface IStatics { + staticMethod2: (a: number) => string; +} +interface MyDocument extends mongoose.Document { + prop: string; + method: () => void; +} +interface MyModel extends mongoose.Model { + staticProp: string; + staticMethod: () => void; +} +interface ModelStruct { + doc: MyDocument; + model: MyModel; + method1: (callback: (model: MyModel, doc: MyDocument) => void) => MyModel; +} +var modelStruct1 = {}; +var myModel1: MyModel; +var myDocument1: MyDocument; +modelStruct1.method1(function (myModel1, myDocument1) { + myModel1.staticProp; + myModel1.staticMethod(); + myDocument1.prop; + myDocument1.method(); +}).staticProp.toLowerCase(); +var mySchema = new mongoose.Schema({}); +export var Final: MyModel = mongoose.connection.model('Final', mySchema); +Final.findOne(function (err: any, doc: MyDocument) { + doc.save(); + doc.remove(); + doc.model(''); +}); +export var Final2: MyModel = mongoose.model('Final2', mySchema); +Final2.staticMethod(); +Final2.staticProp; +var final2 = new Final2(); +final2.prop; +final2.method;interface ibase extends mongoose.Document { + username: string; +} +interface extended extends ibase { + email: string; +} +const base: mongoose.Model = mongoose.model('testfour') +const extended: mongoose.Model = base.discriminator('extendedS', schema); +const x = new extended({ + username: 'hi', // required in baseSchema + email: 'beddiw', // required in extededSchema +}); diff --git a/types/mongoose/v4/tsconfig.json b/types/mongoose/v4/tsconfig.json new file mode 100644 index 0000000000..f2e0b541c8 --- /dev/null +++ b/types/mongoose/v4/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": false, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "mongoose": [ + "mongoose/v4" + ] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "mongoose-tests.ts" + ] +} \ No newline at end of file diff --git a/types/assertion-error/tslint.json b/types/mongoose/v4/tslint.json similarity index 100% rename from types/assertion-error/tslint.json rename to types/mongoose/v4/tslint.json diff --git a/types/moo/tsconfig.json b/types/moo/tsconfig.json index e2659ef342..2203d94341 100644 --- a/types/moo/tsconfig.json +++ b/types/moo/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/moonjs/tsconfig.json b/types/moonjs/tsconfig.json index b66e636445..f26c03118b 100644 --- a/types/moonjs/tsconfig.json +++ b/types/moonjs/tsconfig.json @@ -20,6 +20,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/morgan/tsconfig.json b/types/morgan/tsconfig.json index 87ca0a6d5d..40d97bcb99 100644 --- a/types/morgan/tsconfig.json +++ b/types/morgan/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/morris.js/tsconfig.json b/types/morris.js/tsconfig.json index 10aa9f3c2d..4be75cfd20 100644 --- a/types/morris.js/tsconfig.json +++ b/types/morris.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mousetrap/tsconfig.json b/types/mousetrap/tsconfig.json index ade8c0d47d..7cf51a0ec3 100644 --- a/types/mousetrap/tsconfig.json +++ b/types/mousetrap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/move-concurrently/tsconfig.json b/types/move-concurrently/tsconfig.json index a0e00356c8..d9ccd40b52 100644 --- a/types/move-concurrently/tsconfig.json +++ b/types/move-concurrently/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/moviedb/tsconfig.json b/types/moviedb/tsconfig.json index 5b182007ca..9cd2ba13e8 100644 --- a/types/moviedb/tsconfig.json +++ b/types/moviedb/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/moxios/tsconfig.json b/types/moxios/tsconfig.json index a0224c335f..000e8feeb0 100644 --- a/types/moxios/tsconfig.json +++ b/types/moxios/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mozilla-readability/index.d.ts b/types/mozilla-readability/index.d.ts new file mode 100644 index 0000000000..a30925fb0b --- /dev/null +++ b/types/mozilla-readability/index.d.ts @@ -0,0 +1,43 @@ +// Type definitions for mozilla-readability 0.1 +// Project: https://github.com/mozilla/readability +// Definitions by: Charles Vandevoorde +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export = Readability; + +declare class Readability { + constructor(uri: Readability.Uri, doc: Document, options?: Readability.Options); + + parse(): Readability.ParseResult; + isProbablyReaderable(helperIsVisible?: (node: any) => boolean): boolean; +} + +declare namespace Readability { + interface Uri { + spec: string; + host: string; + prePath: string; + scheme: string; + pathBase: string; + } + + interface Options { + debug?: boolean; + maxElemsToParse?: number; + nbTopCandidates?: number; + wordThreshold?: number; + classesToPreserve?: string[]; + } + + interface ParseResult { + uri: Uri; + title: string; + byline: string; + dir: string; + content: string; + textContent: string; + length: number; + excerpt: string; + } +} diff --git a/types/mozilla-readability/mozilla-readability-tests.ts b/types/mozilla-readability/mozilla-readability-tests.ts new file mode 100644 index 0000000000..e5431dd14e --- /dev/null +++ b/types/mozilla-readability/mozilla-readability-tests.ts @@ -0,0 +1,46 @@ +import Readability = require('mozilla-readability'); +import { JSDOM } from 'jsdom'; + +// Compiling requires `--noImplicitUseStrict` +// because issue https://github.com/mozilla/readability/issues/346 +// requires global variable `Node` when using nodejs. + +const fakeUri: Readability.Uri = { + spec: "http://fakehost/test/page.html", + host: "fakehost", + prePath: "http://fakehost", + scheme: "http", + pathBase: "http://fakehost/test/" +}; + +function test_basic_usage() { + const dom = new JSDOM(`

Hello

Hi!`); + // Required until https://github.com/mozilla/readability/issues/346 + // is fixed. + Node = dom.window.Node; + + const reader = new Readability(fakeUri, dom.window.document); + const article = reader.parse(); +} + +function test_readability_with_options() { + const dom = new JSDOM(`

Hello

Hi!`); + // Required until https://github.com/mozilla/readability/issues/346 + // is fixed. + Node = dom.window.Node; + + const options: Readability.Options = { + debug: true, + maxElemsToParse: 100, + }; + const article = new Readability(fakeUri, dom.window.document, options).parse(); +} + +function test_is_probably_readerable() { + const dom = new JSDOM(`

Hello

Hi!`); + // Required until https://github.com/mozilla/readability/issues/346 + // is fixed. + Node = dom.window.Node; + + const isReadable = new Readability(fakeUri, dom.window.document).isProbablyReaderable(); +} diff --git a/types/mozilla-readability/tsconfig.json b/types/mozilla-readability/tsconfig.json new file mode 100644 index 0000000000..07af9472c3 --- /dev/null +++ b/types/mozilla-readability/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "mozilla-readability-tests.ts" + ] +} \ No newline at end of file diff --git a/types/mozilla-readability/tslint.json b/types/mozilla-readability/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mozilla-readability/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/mpromise/tsconfig.json b/types/mpromise/tsconfig.json index 6f5f9d6abc..e76a3809d8 100644 --- a/types/mpromise/tsconfig.json +++ b/types/mpromise/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mri/tsconfig.json b/types/mri/tsconfig.json index 9218819c6b..60f8ce3044 100644 --- a/types/mri/tsconfig.json +++ b/types/mri/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ms/tsconfig.json b/types/ms/tsconfig.json index aaaa9f14e8..080a128095 100644 --- a/types/ms/tsconfig.json +++ b/types/ms/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/msgpack-lite/tsconfig.json b/types/msgpack-lite/tsconfig.json index 014ff12483..73b2be7f36 100644 --- a/types/msgpack-lite/tsconfig.json +++ b/types/msgpack-lite/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/msgpack/tsconfig.json b/types/msgpack/tsconfig.json index b004630b6c..be68498cc9 100644 --- a/types/msgpack/tsconfig.json +++ b/types/msgpack/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/msgpack5/msgpack5-tests.ts b/types/msgpack5/msgpack5-tests.ts index 6cd9854992..d8a2829302 100644 --- a/types/msgpack5/msgpack5-tests.ts +++ b/types/msgpack5/msgpack5-tests.ts @@ -1,9 +1,9 @@ -import * as msgpack from 'msgpack5'; +import msgpack = require('msgpack5'); // msgpack() let packer = msgpack(); packer = msgpack({ forceFloat64: true }); -packer = msgpack({ compatibilityMode: true }); +packer = msgpack({ compatibilityMode: true }); class InputType { number: number; diff --git a/types/msgpack5/tsconfig.json b/types/msgpack5/tsconfig.json index f58f4a8a94..73f103564f 100644 --- a/types/msgpack5/tsconfig.json +++ b/types/msgpack5/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/msnodesql/tsconfig.json b/types/msnodesql/tsconfig.json index 8eb58e9531..5768b83caa 100644 --- a/types/msnodesql/tsconfig.json +++ b/types/msnodesql/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/msportalfx-test/tsconfig.json b/types/msportalfx-test/tsconfig.json index 4df355d685..043b903835 100644 --- a/types/msportalfx-test/tsconfig.json +++ b/types/msportalfx-test/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mssql/index.d.ts b/types/mssql/index.d.ts index a551d15ba8..272abb5e39 100644 --- a/types/mssql/index.d.ts +++ b/types/mssql/index.d.ts @@ -251,6 +251,7 @@ export declare class Request extends events.EventEmitter { public parameters: IRequestParameters; public verbose: boolean; public canceled: boolean; + public multiple: boolean; public stream: any; public constructor(connection?: ConnectionPool); public constructor(transaction: Transaction); diff --git a/types/mssql/tsconfig.json b/types/mssql/tsconfig.json index 51f03fd652..ee8e17a585 100644 --- a/types/mssql/tsconfig.json +++ b/types/mssql/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mu2/tsconfig.json b/types/mu2/tsconfig.json index 3e01589707..929e73f45b 100644 --- a/types/mu2/tsconfig.json +++ b/types/mu2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/multer-gridfs-storage/multer-gridfs-storage-tests.ts b/types/multer-gridfs-storage/multer-gridfs-storage-tests.ts index 61114fa349..d34eaeeae6 100644 --- a/types/multer-gridfs-storage/multer-gridfs-storage-tests.ts +++ b/types/multer-gridfs-storage/multer-gridfs-storage-tests.ts @@ -1,4 +1,4 @@ -import * as MulterGridfsStorage from 'multer-gridfs-storage'; +import MulterGridfsStorage = require('multer-gridfs-storage'); import { Db, MongoClient, Server } from "mongodb"; // Exported interfaces diff --git a/types/multer-gridfs-storage/tsconfig.json b/types/multer-gridfs-storage/tsconfig.json index 1daa734d97..3644f79add 100644 --- a/types/multer-gridfs-storage/tsconfig.json +++ b/types/multer-gridfs-storage/tsconfig.json @@ -19,7 +19,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/multer-gridfs-storage/v1/multer-gridfs-storage-tests.ts b/types/multer-gridfs-storage/v1/multer-gridfs-storage-tests.ts index 73522eebca..3578089b92 100644 --- a/types/multer-gridfs-storage/v1/multer-gridfs-storage-tests.ts +++ b/types/multer-gridfs-storage/v1/multer-gridfs-storage-tests.ts @@ -1,4 +1,4 @@ -import * as MulterGridfsStorage from 'multer-gridfs-storage'; +import MulterGridfsStorage = require('multer-gridfs-storage'); import { Grid } from "gridfs-stream"; // Exported interfaces diff --git a/types/multer-gridfs-storage/v1/tsconfig.json b/types/multer-gridfs-storage/v1/tsconfig.json index 8fb06dfd29..00e1091a16 100644 --- a/types/multer-gridfs-storage/v1/tsconfig.json +++ b/types/multer-gridfs-storage/v1/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/multer-s3/tsconfig.json b/types/multer-s3/tsconfig.json index 812fd71b21..807cd374a5 100644 --- a/types/multer-s3/tsconfig.json +++ b/types/multer-s3/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/multer/multer-tests.ts b/types/multer/multer-tests.ts index 029f5fa0f4..6346b5f7dc 100644 --- a/types/multer/multer-tests.ts +++ b/types/multer/multer-tests.ts @@ -1,5 +1,5 @@ -import * as express from 'express'; -import * as multer from 'multer'; +import express = require('express'); +import multer = require('multer'); const upload = multer({ dest: 'uploads/', diff --git a/types/multer/tsconfig.json b/types/multer/tsconfig.json index 33a047e9dd..b62fe04125 100644 --- a/types/multer/tsconfig.json +++ b/types/multer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/multi-typeof/tsconfig.json b/types/multi-typeof/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/multi-typeof/tsconfig.json +++ b/types/multi-typeof/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/multimatch/tsconfig.json b/types/multimatch/tsconfig.json index c7ee9e6f63..98647c67da 100644 --- a/types/multimatch/tsconfig.json +++ b/types/multimatch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/multiparty/tsconfig.json b/types/multiparty/tsconfig.json index 0adadcf9a3..2f73f00ca7 100644 --- a/types/multiparty/tsconfig.json +++ b/types/multiparty/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/multiplexjs/tsconfig.json b/types/multiplexjs/tsconfig.json index bad1ec3652..94e2a89169 100644 --- a/types/multiplexjs/tsconfig.json +++ b/types/multiplexjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/multisort/tsconfig.json b/types/multisort/tsconfig.json index d2d76512ef..2602e31746 100644 --- a/types/multisort/tsconfig.json +++ b/types/multisort/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "multisort-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/multistream/tsconfig.json b/types/multistream/tsconfig.json index 3fa5cc7c47..cb9258d5c6 100644 --- a/types/multistream/tsconfig.json +++ b/types/multistream/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "multistream-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/murmurhash-js/tsconfig.json b/types/murmurhash-js/tsconfig.json index bcebcbf18e..290fd09fe3 100644 --- a/types/murmurhash-js/tsconfig.json +++ b/types/murmurhash-js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/murmurhash3js/tsconfig.json b/types/murmurhash3js/tsconfig.json index 3f3a3a6fe3..109bec1b1b 100644 --- a/types/murmurhash3js/tsconfig.json +++ b/types/murmurhash3js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/musicmetadata/musicmetadata-tests.ts b/types/musicmetadata/musicmetadata-tests.ts index 421aec3bc5..c2e70116fb 100644 --- a/types/musicmetadata/musicmetadata-tests.ts +++ b/types/musicmetadata/musicmetadata-tests.ts @@ -1,5 +1,5 @@ import * as fs from "fs"; -import * as mm from "musicmetadata"; +import mm = require("musicmetadata"); mm(fs.createReadStream("hype-train.mp3"), (err: Error, metadata: MM.Metadata) => { if (err) throw err; diff --git a/types/musicmetadata/tsconfig.json b/types/musicmetadata/tsconfig.json index da6158b218..55d870abf7 100644 --- a/types/musicmetadata/tsconfig.json +++ b/types/musicmetadata/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mustache/tsconfig.json b/types/mustache/tsconfig.json index dd50c6f999..c1bde7af8b 100644 --- a/types/mustache/tsconfig.json +++ b/types/mustache/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/mv/tsconfig.json b/types/mv/tsconfig.json index fc51bf757d..2ce04b2cfa 100644 --- a/types/mv/tsconfig.json +++ b/types/mv/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mysql/tsconfig.json b/types/mysql/tsconfig.json index 1249bcd757..d2a4788d7c 100644 --- a/types/mysql/tsconfig.json +++ b/types/mysql/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "mysql-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/mysql/tslint.json b/types/mysql/tslint.json index f93cf8562a..3224b40b8b 100644 --- a/types/mysql/tslint.json +++ b/types/mysql/tslint.json @@ -1,3 +1,6 @@ { - "extends": "dtslint/dt.json" + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } } diff --git a/types/mz/tsconfig.json b/types/mz/tsconfig.json index f6a2ef5871..bdfa029d8b 100644 --- a/types/mz/tsconfig.json +++ b/types/mz/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "fs.d.ts", diff --git a/types/n3/tsconfig.json b/types/n3/tsconfig.json index 4ba121903d..c7ec1df12b 100644 --- a/types/n3/tsconfig.json +++ b/types/n3/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nano/index.d.ts b/types/nano/index.d.ts index 152954190d..7fafa72382 100644 --- a/types/nano/index.d.ts +++ b/types/nano/index.d.ts @@ -261,6 +261,8 @@ declare namespace nano { params: DocumentViewParams, callback?: Callback ): Request; + // http://docs.couchdb.org/en/latest/api/database/find.html#db-find + find(query: MangoQuery, callback?: Callback>): Request; server: ServerScope; } @@ -1044,6 +1046,91 @@ declare namespace nano { // Current update sequence for the database update_seq: any; } + + type MangoValue = number | string | Date | boolean; + + // http://docs.couchdb.org/en/latest/api/database/find.html#selector-syntax + interface MangoSelector { + [key: string]: MangoSelector | MangoValue | MangoValue[]; + } + + // http://docs.couchdb.org/en/latest/api/database/find.html#sort-syntax + type SortOrder = string | string[] | { [key: string]: 'asc' | 'desc' }; + + interface MangoQuery { + // JSON object describing criteria used to select documents. + selector: MangoSelector; + + // Maximum number of results returned. Default is 25. + limit?: number; + + // Skip the first 'n' results, where 'n' is the value specified. + skip?: number; + + // JSON array following sort syntax. + sort?: SortOrder[]; + + // JSON array specifying which fields of each object should be returned. If it is omitted, + // the entire object is returned. + // http://docs.couchdb.org/en/latest/api/database/find.html#filtering-fields + fields?: string[]; + + // Instruct a query to use a specific index. + // Specified either as "" or ["", ""]. + use_index?: string | [string, string]; + + // Read quorum needed for the result. This defaults to 1. + r?: number; + + // A string that enables you to specify which page of results you require. Used for paging through result sets. + bookmark?: string; + + // Whether to update the index prior to returning the result. Default is true. + update?: boolean; + + // Whether or not the view results should be returned from a “stable†set of shards. + stable?: boolean; + + // Combination of update = false and stable = true options.Possible options: "ok", false (default). + stale?: 'ok' | false; + + // Include execution statistics in the query response. Optional, default: false. + execution_stats?: boolean; + } + + interface MangoResponse { + // Array of documents matching the search. In each matching document, the fields specified in + // the fields part of the request body are listed, along with their values. + docs: D[]; + + // A string that enables you to specify which page of results you require. Used for paging through result sets. + bookmark?: string; + + // Execution warnings + warning?: string; + + // Basic execution statistics for a specific request. + execution_stats?: MangoExecutionStats; + } + + // http://docs.couchdb.org/en/latest/api/database/find.html#execution-statistics + interface MangoExecutionStats { + // Number of index keys examined. Currently always 0. + total_keys_examined: number; + + // Number of documents fetched from the database / index, equivalent to using include_docs = true in a view. + total_docs_examined: number; + + // Number of documents fetched from the database using an out - of - band document fetch. + // This is only non - zero when read quorum > 1 is specified in the query parameters. + total_quorum_docs_examined: number; + + // Number of results returned from the query. + results_returned: number; + + // Total execution time in milliseconds as measured by the database. + execution_time_ms: number; + } } export = nano; diff --git a/types/nano/nano-tests.ts b/types/nano/nano-tests.ts index d38f54bae2..0556f2b8fe 100644 --- a/types/nano/nano-tests.ts +++ b/types/nano/nano-tests.ts @@ -1,5 +1,5 @@ import * as fs from "fs"; -import * as nano from "nano"; +import nano = require("nano"); /* * Instantiate with configuration object @@ -118,6 +118,42 @@ mydb.show( ); mydb.replicate("database_replica", (error: any) => {}); +const req = mydb.find({ + selector: { + userId: 1234, + name: 'Paul', + status: { $ne: 'suspended' }, + age: { $gt: 69 }, + building: { + number: { + $in: [101, 203, 205] + } + } + }, + skip: 10, + limit: 1, + use_index: "user_index_doc", + fields: ['name', 'age'], + sort: [{ age: 'desc' }, { name: 'asc' }], + r: 2, + stale: 'ok', + execution_stats: true +}, (resp: nano.MangoResponse, error: any) => { + for (const doc of resp.docs) { + console.log(doc.name); + } + + if (resp.warning) { + console.error(resp.warning); + } + + if (resp.execution_stats) { + console.log(`Execution time: ${resp.execution_stats.execution_time_ms} ms.`); + } +}); + +req.abort(); + /* * Attachments */ diff --git a/types/nano/tsconfig.json b/types/nano/tsconfig.json index 7586d0b0bf..f0d7a6a4a2 100644 --- a/types/nano/tsconfig.json +++ b/types/nano/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nanoajax/tsconfig.json b/types/nanoajax/tsconfig.json index 0da0980613..ee0559e4ba 100644 --- a/types/nanoajax/tsconfig.json +++ b/types/nanoajax/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nanoid/tsconfig.json b/types/nanoid/tsconfig.json index 0df191829d..6a7acb9122 100644 --- a/types/nanoid/tsconfig.json +++ b/types/nanoid/tsconfig.json @@ -14,6 +14,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ @@ -25,4 +26,4 @@ "random.d.ts", "url.d.ts" ] -} +} \ No newline at end of file diff --git a/types/nanomsg/tsconfig.json b/types/nanomsg/tsconfig.json index e42b4841af..6f1a4347f9 100644 --- a/types/nanomsg/tsconfig.json +++ b/types/nanomsg/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nanoscroller/tsconfig.json b/types/nanoscroller/tsconfig.json index 7aeed7ab3d..51d0db097f 100644 --- a/types/nanoscroller/tsconfig.json +++ b/types/nanoscroller/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nanp/tsconfig.json b/types/nanp/tsconfig.json index d873227232..0aae22261b 100644 --- a/types/nanp/tsconfig.json +++ b/types/nanp/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nats-hemera/tsconfig.json b/types/nats-hemera/tsconfig.json index 69c6083e56..4238f55a02 100644 --- a/types/nats-hemera/tsconfig.json +++ b/types/nats-hemera/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/natsort/tsconfig.json b/types/natsort/tsconfig.json index a23b1f358e..34d62a95ff 100644 --- a/types/natsort/tsconfig.json +++ b/types/natsort/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/natural-sort/tsconfig.json b/types/natural-sort/tsconfig.json index b592fcdb65..2a06885468 100644 --- a/types/natural-sort/tsconfig.json +++ b/types/natural-sort/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/natural/tsconfig.json b/types/natural/tsconfig.json index c04f83d753..a996ed84dc 100644 --- a/types/natural/tsconfig.json +++ b/types/natural/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/navigation-react/tsconfig.json b/types/navigation-react/tsconfig.json index 75ad101514..ec2d3dabb9 100644 --- a/types/navigation-react/tsconfig.json +++ b/types/navigation-react/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/navigation/tsconfig.json b/types/navigation/tsconfig.json index 8b8e594ec2..fc77d66124 100644 --- a/types/navigation/tsconfig.json +++ b/types/navigation/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/navigo/index.d.ts b/types/navigo/index.d.ts index 73131a9d72..ebc0ecb8c5 100644 --- a/types/navigo/index.d.ts +++ b/types/navigo/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for navigo 4.0 +// Type definitions for navigo 7.0 // Project: https://github.com/krasimir/navigo // Definitions by: Adrian Ehrsam +// Dancespiele // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -20,7 +21,7 @@ interface GenericHooks { after?(params?: Params): void; } -type RouteHandler = ((parametersObj: any, query: string) => void) | { as: string; uses(parametersObj: any): void }; +type RouteHandler = ((params: Params, query: string) => void) | { as: string; uses(params: Params, query: string): void }; declare class Navigo { /** @@ -36,6 +37,8 @@ declare class Navigo { on(rootHandler: RouteHandler, hooks?: NavigoHooks): Navigo; + off(location: string, handler: RouteHandler): void; + notFound(handler: ((query: string) => void), hooks?: NavigoHooks): void; navigate(path: string, absolute?: boolean): void; @@ -44,6 +47,8 @@ declare class Navigo { generate(path: string, params?: any): string; + getLinkPath(link: any): any; + resolve(currentURL?: string): boolean; link(path: string): string; @@ -52,9 +57,11 @@ declare class Navigo { disableIfAPINotAvailable(): void; + historyAPIUpdateMethod(method?: string): void; + hooks(hooks: GenericHooks): void; - pause(): void; + pause(change?: boolean): void; resume(): void; diff --git a/types/navigo/navigo-tests.ts b/types/navigo/navigo-tests.ts index 1aeb645ce8..b3094c053f 100644 --- a/types/navigo/navigo-tests.ts +++ b/types/navigo/navigo-tests.ts @@ -56,7 +56,7 @@ router .resolve(); router - .on('/user/:id/:action', (params: { id: string; action: string }) => { + .on('/user/:id/:action', (params: Params) => { // If we have http://site.com/user/42/save as a url then // params.id = 42 // params.action = save @@ -64,7 +64,7 @@ router .resolve(); router - .on('/user/:id/:action', (params: { id: string; action: string }, query: string) => { + .on('/user/:id/:action', (params: Params, query: string) => { // If we have http://site.com/user/42/save?answer=42 as a url then // params.id = 42 // params.action = save @@ -117,6 +117,12 @@ router.pause(); router.navigate('/en/products'); router.resume(); // or .pause(false) +router.pause(); +router.historyAPIUpdateMethod('replaceState'); +router.disableIfAPINotAvailable(); +router.off('/trip/:number', { as: 'trip', uses: (params, query) => {}}); +router.resume(); + router.on( '/user/edit', () => { diff --git a/types/navigo/tsconfig.json b/types/navigo/tsconfig.json index c43965d118..670c3e99fb 100644 --- a/types/navigo/tsconfig.json +++ b/types/navigo/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nblas/tsconfig.json b/types/nblas/tsconfig.json index 9da3a941dd..6d5a0a0b0b 100644 --- a/types/nblas/tsconfig.json +++ b/types/nblas/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nblas/tslint.json b/types/nblas/tslint.json index 3db14f85ea..3224b40b8b 100644 --- a/types/nblas/tslint.json +++ b/types/nblas/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } +} diff --git a/types/nconf/index.d.ts b/types/nconf/index.d.ts index 71a0d497ab..ff2d4b77ad 100644 --- a/types/nconf/index.d.ts +++ b/types/nconf/index.d.ts @@ -15,6 +15,7 @@ export function get(key?: string, callback?: ICallbackFunction): any; export declare function merge(key: string, value: any, callback?: ICallbackFunction): any; export declare function set(key: string, value: any, callback?: ICallbackFunction): any; export declare function reset(callback?: ICallbackFunction): any; +export declare function any(keys: string[], callback?: ICallbackFunction): any; export declare function load(callback?: ICallbackFunction): any; export declare function mergeSources(data: any): void; @@ -24,6 +25,7 @@ export declare function save(value: any, callback?: ICallbackFunction): any; export declare function add(name: string, options?: IOptions): Provider; export declare function argv(options?: IOptions): Provider; export declare function env(options?: IOptions): Provider; +export declare function env(separator: string): Provider; export declare function file(name: string, options?: IFileOptions): Provider; export declare function file(name: string, filename: string): Provider; export declare function file(options: IFileOptions): Provider; @@ -32,7 +34,7 @@ export declare function defaults(options?: IOptions): Provider; export declare function init(options?: IOptions): void; export declare function overrides(options?: IOptions): Provider; export declare function remove(name: string): void; -export declare function required(keys: string[]): boolean; +export declare function required(keys: string[]): Provider; export declare function create(name: string, options: IOptions): IStore; export declare function key(...values: any[]): string; @@ -79,6 +81,7 @@ export declare class Provider { merge(key: string, value: any, callback?: ICallbackFunction): any; set(key: string, value: any, callback?: ICallbackFunction): any; reset(callback?: ICallbackFunction): any; + any(keys: string[], callback?: ICallbackFunction): any; load(callback?: ICallbackFunction): any; mergeSources(data: any): void; @@ -88,6 +91,7 @@ export declare class Provider { add(name: string, options?: IOptions): Provider; argv(options?: IOptions): Provider; env(options?: IOptions): Provider; + env(separator: string): Provider; file(name: string, options?: IFileOptions): Provider; file(name: string, filename: string): Provider; file(options: IFileOptions): Provider; @@ -97,7 +101,7 @@ export declare class Provider { init(options?: IOptions): void; overrides(options?: IOptions): Provider; remove(name: string): void; - required(keys: string[]): boolean; + required(keys: string[]): Provider; create(name: string, options: IOptions): IStore; } diff --git a/types/nconf/nconf-tests.ts b/types/nconf/nconf-tests.ts index 382407e6eb..fb3d1b0001 100644 --- a/types/nconf/nconf-tests.ts +++ b/types/nconf/nconf-tests.ts @@ -19,6 +19,7 @@ value = nconf.get (str, callback); value = nconf.merge(str, value, callback); value = nconf.set (str, value, callback); value = nconf.reset(callback); +value = nconf.any([str], callback); value = nconf.load(callback); nconf.mergeSources(value); @@ -33,6 +34,7 @@ p = nconf.argv(opts); p = nconf.env(); p = nconf.env(opts); +p = nconf.env(str); p = nconf.file(str); p = nconf.file(str, str); @@ -56,7 +58,7 @@ nconf.init(opts); p = nconf.overrides(); p = nconf.overrides(opts); nconf.remove(str); -bool = nconf.required(strArr); +p = nconf.required(strArr); store = nconf.create(str, opts); str = nconf.key(value, value); @@ -84,6 +86,7 @@ value = p.get(str, callback); value = p.merge(str,value,callback); value = p.set(str,value,callback); value = p.reset(callback); +value = p.any([str], callback); value = p.load(callback); p.mergeSources(value); @@ -118,7 +121,7 @@ p = p.defaults(opts); p.init(opts); p = p.overrides(opts); p.remove(str); -bool = p.required(strArr); +p = p.required(strArr); store = p.create(str, opts); // - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/types/nconf/tsconfig.json b/types/nconf/tsconfig.json index 134b7a4fb9..2d213b4bc2 100644 --- a/types/nconf/tsconfig.json +++ b/types/nconf/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ncp/tsconfig.json b/types/ncp/tsconfig.json index ad2247a6c9..cd3215ff35 100644 --- a/types/ncp/tsconfig.json +++ b/types/ncp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ndarray/tsconfig.json b/types/ndarray/tsconfig.json index 9f2c134f3d..cfaf8d710e 100644 --- a/types/ndarray/tsconfig.json +++ b/types/ndarray/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nearley/tsconfig.json b/types/nearley/tsconfig.json index bce8ee061a..d2ad939fb7 100644 --- a/types/nearley/tsconfig.json +++ b/types/nearley/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nedb-logger/tsconfig.json b/types/nedb-logger/tsconfig.json index 857cf7bb11..33e65ee249 100644 --- a/types/nedb-logger/tsconfig.json +++ b/types/nedb-logger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nedb/tsconfig.json b/types/nedb/tsconfig.json index 220dc976e1..71be3fc3dc 100644 --- a/types/nedb/tsconfig.json +++ b/types/nedb/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/needle/needle-tests.ts b/types/needle/needle-tests.ts index e8f2efee20..a216b1f686 100644 --- a/types/needle/needle-tests.ts +++ b/types/needle/needle-tests.ts @@ -1,4 +1,4 @@ -import * as needle from "needle"; +import needle = require("needle"); import * as fs from "fs"; function Usage() { diff --git a/types/needle/tsconfig.json b/types/needle/tsconfig.json index b0f67719ed..13fb81e8b3 100644 --- a/types/needle/tsconfig.json +++ b/types/needle/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/needle/v0/tsconfig.json b/types/needle/v0/tsconfig.json index 3ea9ca7f93..0cc54647f9 100644 --- a/types/needle/v0/tsconfig.json +++ b/types/needle/v0/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/needle/v1/tsconfig.json b/types/needle/v1/tsconfig.json index 7918dc3952..9e199dda15 100644 --- a/types/needle/v1/tsconfig.json +++ b/types/needle/v1/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/negotiator/tsconfig.json b/types/negotiator/tsconfig.json index 89c06ad77a..83e42b29aa 100644 --- a/types/negotiator/tsconfig.json +++ b/types/negotiator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/neo4j/tsconfig.json b/types/neo4j/tsconfig.json index fa1c26ea60..24d94b0134 100644 --- a/types/neo4j/tsconfig.json +++ b/types/neo4j/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nes/tsconfig.json b/types/nes/tsconfig.json index 374b67b515..f9e07170b3 100644 --- a/types/nes/tsconfig.json +++ b/types/nes/tsconfig.json @@ -14,10 +14,13 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -36,4 +39,4 @@ "test/subscriptions-client.ts", "test/subscriptions-server.ts" ] -} +} \ No newline at end of file diff --git a/types/net-keepalive/tsconfig.json b/types/net-keepalive/tsconfig.json index 38736fd181..937edbecfb 100644 --- a/types/net-keepalive/tsconfig.json +++ b/types/net-keepalive/tsconfig.json @@ -1,21 +1,24 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es5" - ], - "baseUrl": "../", - "typeRoots": ["../"], - "types": [], - "forceConsistentCasingInFileNames": true, - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "noEmit": true - }, - "files": [ - "index.d.ts", - "net-keepalive-tests.ts" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5" + ], + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "net-keepalive-tests.ts" + ] } \ No newline at end of file diff --git a/types/netmask/tsconfig.json b/types/netmask/tsconfig.json index 8666e91a29..db74d19edf 100644 --- a/types/netmask/tsconfig.json +++ b/types/netmask/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/new-relic-browser/index.d.ts b/types/new-relic-browser/index.d.ts new file mode 100644 index 0000000000..0064ee4ad2 --- /dev/null +++ b/types/new-relic-browser/index.d.ts @@ -0,0 +1,207 @@ +// Type definitions for NewRelicBrowser 0.1072 +// Project: https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api +// Definitions by: Rene Hamburger , Piotr Kubisa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare const newrelic: NewRelic.Browser; + +declare namespace NewRelic { + interface Browser { + /** + * Adds a unique name and ID to identify releases with multiple JavaScript bundles on the same page. + * + * @param releaseName A short description of the component; for example, the name of a project, + * application, file, or library. + * @param releaseId The ID or version of this release; for example, a version number, build number + * from your CI environment, GitHub SHA, GUID, or a hash of the contents. Since New Relic converts this + * value into a string, you can also use null or undefined if necessary + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/addRelease + */ + addRelease(releaseName: string, releaseId: string): void; + + /** + * Reports a Browser PageAction event to Insights along with a name and attributes. + * + * @param name Name or category of the action. Reports to Insights as the actionName attribute. + * @param attributes JSON object with one or more key/value pairs. + * The key will report to Insights as its own PageAction attribute with the specified values. + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/addPageAction + */ + addPageAction(name: string, attributes: { [key: string]: string }): void; + + /** + * Adds a JavaScript object with a custom name, start time, etc. to an in-progress session trace. + * + * @param eventObject If you are sending the same event object to New Relic Insights as a + * PageAction, omit the TYPE attribute. If included, it will override the event type and cause the + * PageAction event to be sent incorrectly. Instead, use the NAME attribute for event information. + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/add-to-trace + */ + addToTrace(eventObject: EventObject): void; + + /** + * Records an additional time point as "finished" in a session trace, and sends the event to Insights. + * + * @param timestamp Defaults to the current time of the call. If used, this marks the time that + * the page is "finished" according to your own criteria. + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/finished + */ + finished(timestamp?: number): void; + + /** + * Identifies a browser error without disrupting your app's operations. + * + * @param Provide a meaningful error message that you can use when analyzing data on + * New Relic Browser's JavaScript errors page. + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/noticeError + */ + noticeError(error: any): void; + + /** + * Adds a user-defined attribute name and value to subsequent events on the page. + * + * @param name Name of the attribute. Appears as column in the PageView event. + * It will also appear as a column in the PageAction event if you are using it. + * @param value Value of the attribute. Appears as the value in the named attribute column in the + * PageView event. It will appear as a column in the PageAction event if you are using it. Custom attribute + * values cannot be complex objects, only simple types such as strings and numbers. + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/setCustomAttribute + */ + setCustomAttribute(name: string, value: string): void; + + /** + * Allows selective ignoring of known errors that the Browser agent captures. + * + * @param filterCallback The callback will be called with each error, so it is not + * specific to one error. `err` will usually be an error object, but it can be other data types. + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/setErrorHandler + */ + setErrorHandler(filterCallback: (err: any) => boolean): void; + + /** + * Groups page views to help URL structure or to capture the URL's routing information. + * + * @param name Name of the page you want to use when viewing it in New Relic Browser or Insights. + * @param host Default is http://custom.transaction. Typically set host to your site's domain URI. + * To further group these custom transactions, provide a custom host. Otherwise, the page views will be + * assigned the default domain custom.transaction. Segments within the name must be explicitly added to + * the Whitelist segments in your URL whitelist settings if they do not already appear. + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/setPageViewName + */ + setPageViewName(name: string, host?: string): void; + + /** + * Returns a new API object that is bound to the current SPA interaction. + * + * @returns This method returns an API object that is bound to a specific BrowserInteraction + * event. Each time this method is called for the same BrowserInteraction, a new object is created, but it still + * references the same interaction. + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/interaction-browser-spa-api + */ + interaction(): BrowserInteraction; + + /** + * Gives SPA routes more accurate names than default names. Monitors specific routes rather than by default + * grouping. + * + * @param name Current route name for the page. Route names passed to setCurrentRouteName() can + * be any string, but they should represent a routing pattern rather than a specific resource. For example, + * use /users/:id rather than /users/123. If null, exits out of the route change requirement and returns to + * the default naming strategy. + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/spa-set-current-route-name + */ + setCurrentRouteName(name: string): void; + } + + interface EventObject { + /** Event name */ + name: string; + /** Start time in ms since epoch */ + start: number; + /** End time in ms since epoch. Defaults to same as start resulting in trace object with a duration of zero. */ + end?: number; + /** Origin of event */ + origin?: string; + /** Event type */ + type?: string; + } + + interface BrowserInteraction { + /** + * Times sub-components of a SPA interaction separately, including wait time and JS execution time. + * + * @param name This will be used as the name of the tracer. If you do not include a name, + * New Relic Browser does not add a node to the interaction tree. The callback time will be + * attributed to the parent node. + * @returns This method ends the async time. It calls (and times) the callback that was passed into createTracer(). + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/spa-create-tracer + */ + createTracer(name: string, syncCallback?: () => void): () => void; + + /** + * Ends the New Relic SPA interaction at the current time. + * + * @returns This method returns the same API object created by interaction(). + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/spa-end + */ + end(): BrowserInteraction; + + /** + * Stores values across the current SPA interaction asynchronously in New Relic Browser. + * + * @param callback A function that accepts the interaction context object + * as its only argument. + * @returns This method returns the same API object created by interaction(). + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/spa-get-context + */ + getContext(callback: (contextObject: any) => void): BrowserInteraction; + + /** + * Overrides other SPA save() calls; ignores an interaction so it is not saved or sent to New Relic. + * + * @returns This method returns the same API object created by interaction(). + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/spa-ignore-browser + */ + ignore(): BrowserInteraction; + + /** + * Adds custom attributes for SPA interactions to the end of an event. It is called when the interaction + * has finished. You can invoke methods to modify the interaction, but methods that have asynchronous + * side effects will not have an effect. + * + * @returns This method returns the same API object created by interaction(). + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/spa-on-end + */ + onEnd(callback: (contextObject: any) => void): BrowserInteraction; + + /** + * Ensures a SPA browser interaction will be saved when it ends. + * + * @returns This method returns the same API object created by interaction(). + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/spa-save + */ + save(): BrowserInteraction; + + /** + * Adds a custom SPA attribute only to the current interaction in New Relic Browser. + * + * @param key Used as the attribute name on the BrowserInteraction event. + * @param Used as the attribute value on the BrowserInteraction event. This can be a + * string, number, boolean, or object. If it is an object, New Relic serializes it to a JSON string. + * @returns This method returns the same API object created by interaction(). + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/spa-set-attribute + */ + setAttribute(key: string, value: any): BrowserInteraction; + + /** + * Sets the name and trigger of a SPA's browser interaction that is not a route change or URL change. + * + * @param name If null, the name will be set using the targetGroupedUrl attribute. + * If not null, this will set the browserInteractionName attribute in the BrowserInteraction event. + * @param trigger If not null, this will set the TRIGGER attribute on the BrowserInteraction event. + * @returns This method returns the same API object created by interaction(). + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/spa-set-name + */ + setName(name: string, trigger?: string): BrowserInteraction; + } +} diff --git a/types/new-relic-browser/new-relic-browser-tests.ts b/types/new-relic-browser/new-relic-browser-tests.ts new file mode 100644 index 0000000000..b9f75b142d --- /dev/null +++ b/types/new-relic-browser/new-relic-browser-tests.ts @@ -0,0 +1,87 @@ +// The following tests are largely taken straight from the examples at https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api + +// --- NewRelic.Browser methods ---------------------------------------------- + +// addRelease() +newrelic.addRelease('checkout page', 'a818994'); + +// addPageAction() +newrelic.addPageAction('copy-text-button', { result: 'success' }); + +// addToTrace() +newrelic.addToTrace({ + name: 'Event Name', + start: 1417044274239, + end: 1417044274252, + origin: 'Origin of event', + type: 'What type of event was this' +}); +newrelic.addToTrace({ + name: 'Event Name', + start: 1417044274239 +}); + +// finished() +newrelic.finished(); + +// noticeError() +try { + JSON.parse('{ "bar"'); +} catch (err) { + newrelic.noticeError(err); +} +newrelic.noticeError(new Error('bar')); + +// setCustomAttribute() +newrelic.setCustomAttribute('nodeId', '123'); + +// setErrorHandler() +newrelic.setErrorHandler((err) => { + if (err.message !== 'foo') { + return true; + } else { + return false; + } +}); + +// setPageViewName() +newrelic.setPageViewName('/login', 'https://www.myapp.com'); + +// setCurrentRouteName() +newrelic.setCurrentRouteName('/users/:id'); + +// --- NewRelic.BrowserInteraction methods ----------------------------------- + +// createTracer() +newrelic + .interaction() + .createTracer('customSegment', () => { })(); + +// end() +newrelic.interaction().end(); + +// getContext(), setAttribute() +const interaction = newrelic.interaction(); +interaction.getContext(ctx => { + if (ctx.productId) { + interaction.setAttribute('productId', ctx.productId); + } +}); + +// ignore() +newrelic.interaction().ignore(); + +// onEnd(), setAttribute() +newrelic.interaction().onEnd(ctx => { + interaction.setAttribute( + 'averageChartLoadTime', + ctx.totalChartLoadTime / ctx.chartLoadCount + ); +}); + +// setName(), setAttribute(), save() +newrelic.interaction() + .setName('loadNextPage') + .setAttribute('username', 'userName') + .setAttribute('userId', 123) + .save(); diff --git a/types/new-relic-browser/tsconfig.json b/types/new-relic-browser/tsconfig.json new file mode 100644 index 0000000000..ab3b384d26 --- /dev/null +++ b/types/new-relic-browser/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "new-relic-browser-tests.ts" + ] +} \ No newline at end of file diff --git a/types/new-relic-browser/tslint.json b/types/new-relic-browser/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/new-relic-browser/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/nexpect/tsconfig.json b/types/nexpect/tsconfig.json index d73f78e043..712c1fb7b4 100644 --- a/types/nexpect/tsconfig.json +++ b/types/nexpect/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/next-redux-wrapper/tsconfig.json b/types/next-redux-wrapper/tsconfig.json index 7cfafdcb96..3108e45df1 100644 --- a/types/next-redux-wrapper/tsconfig.json +++ b/types/next-redux-wrapper/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/next/tsconfig.json b/types/next/tsconfig.json index 05e0b4e7ad..850e09cb80 100644 --- a/types/next/tsconfig.json +++ b/types/next/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ng-command/tsconfig.json b/types/ng-command/tsconfig.json index f64e284ecb..be46dfcb9b 100644 --- a/types/ng-command/tsconfig.json +++ b/types/ng-command/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ng-cordova/tsconfig.json b/types/ng-cordova/tsconfig.json index d0885bd15f..0572c04f8b 100644 --- a/types/ng-cordova/tsconfig.json +++ b/types/ng-cordova/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ng-dialog/tsconfig.json b/types/ng-dialog/tsconfig.json index 91539585a7..187992997a 100644 --- a/types/ng-dialog/tsconfig.json +++ b/types/ng-dialog/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ng-facebook/tsconfig.json b/types/ng-facebook/tsconfig.json index dc239cbe5a..701a75e7e9 100644 --- a/types/ng-facebook/tsconfig.json +++ b/types/ng-facebook/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ng-file-upload/tsconfig.json b/types/ng-file-upload/tsconfig.json index b08385c840..4cc1ff73fa 100644 --- a/types/ng-file-upload/tsconfig.json +++ b/types/ng-file-upload/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ng-flow/tsconfig.json b/types/ng-flow/tsconfig.json index 47d56906c5..f10dd6c6a1 100644 --- a/types/ng-flow/tsconfig.json +++ b/types/ng-flow/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ng-grid/tsconfig.json b/types/ng-grid/tsconfig.json index 5fcf2d1373..84bb17f123 100644 --- a/types/ng-grid/tsconfig.json +++ b/types/ng-grid/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ng-i18next/tsconfig.json b/types/ng-i18next/tsconfig.json index bf666912a5..038677906d 100644 --- a/types/ng-i18next/tsconfig.json +++ b/types/ng-i18next/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ng-notify/tsconfig.json b/types/ng-notify/tsconfig.json index c8cf3b029a..28342f01d7 100644 --- a/types/ng-notify/tsconfig.json +++ b/types/ng-notify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ng-stomp/tsconfig.json b/types/ng-stomp/tsconfig.json index 151a99eb53..2f1e898136 100644 --- a/types/ng-stomp/tsconfig.json +++ b/types/ng-stomp/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ngbootbox/tsconfig.json b/types/ngbootbox/tsconfig.json index a5e7d7d878..e4abac771c 100644 --- a/types/ngbootbox/tsconfig.json +++ b/types/ngbootbox/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ngeohash/tsconfig.json b/types/ngeohash/tsconfig.json index 7f248102e6..81b220b62e 100644 --- a/types/ngeohash/tsconfig.json +++ b/types/ngeohash/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ngkookies/tsconfig.json b/types/ngkookies/tsconfig.json index 79178992a5..889586869b 100644 --- a/types/ngkookies/tsconfig.json +++ b/types/ngkookies/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ngmap/tsconfig.json b/types/ngmap/tsconfig.json index 0427e8a338..1fe1544f80 100644 --- a/types/ngmap/tsconfig.json +++ b/types/ngmap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ngprogress-lite/tsconfig.json b/types/ngprogress-lite/tsconfig.json index 5e8b28fdb2..9e54886818 100644 --- a/types/ngprogress-lite/tsconfig.json +++ b/types/ngprogress-lite/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ngprogress/tsconfig.json b/types/ngprogress/tsconfig.json index 237f5f5962..2a4888f759 100644 --- a/types/ngprogress/tsconfig.json +++ b/types/ngprogress/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ngreact/tsconfig.json b/types/ngreact/tsconfig.json index 39325499dd..e8f4365a16 100644 --- a/types/ngreact/tsconfig.json +++ b/types/ngreact/tsconfig.json @@ -16,6 +16,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "react" }, "files": [ diff --git a/types/ngstorage/tsconfig.json b/types/ngstorage/tsconfig.json index 5bdb5efc09..dad284112c 100644 --- a/types/ngstorage/tsconfig.json +++ b/types/ngstorage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ngtoaster/tsconfig.json b/types/ngtoaster/tsconfig.json index 5bc6882baf..b1b426ad7b 100644 --- a/types/ngtoaster/tsconfig.json +++ b/types/ngtoaster/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ngwysiwyg/tsconfig.json b/types/ngwysiwyg/tsconfig.json index 4292c2cff6..b780ce798a 100644 --- a/types/ngwysiwyg/tsconfig.json +++ b/types/ngwysiwyg/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nightmare/tsconfig.json b/types/nightmare/tsconfig.json index 4bce8306fd..a2e7b85879 100644 --- a/types/nightmare/tsconfig.json +++ b/types/nightmare/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nightwatch/tsconfig.json b/types/nightwatch/tsconfig.json index 4b080c6048..e08524ac5c 100644 --- a/types/nightwatch/tsconfig.json +++ b/types/nightwatch/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/noble/tsconfig.json b/types/noble/tsconfig.json index 3539eef12c..6ecc97642a 100644 --- a/types/noble/tsconfig.json +++ b/types/noble/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nock/index.d.ts b/types/nock/index.d.ts index 8c6e4f2faf..91037b8e54 100644 --- a/types/nock/index.d.ts +++ b/types/nock/index.d.ts @@ -4,6 +4,7 @@ // Horiuchi_H // afharo // Matt R. Wilson +// Garanzha Dmitriy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -34,7 +35,7 @@ declare namespace nock { export var back: NockBack; - type HttpHeaders = { [key: string]: string | { (req: any, res: any, body: string): any; }; }; + type HttpHeaders = { [key: string]: string | string[] | { (req: any, res: any, body: string): any; }; }; type InterceptFunction = ( uri: string | RegExp | { (uri: string): boolean; }, requestBody?: string | RegExp | { (body: any): boolean; } | any, diff --git a/types/nock/nock-tests.ts b/types/nock/nock-tests.ts index 180c7a9c63..44397db941 100644 --- a/types/nock/nock-tests.ts +++ b/types/nock/nock-tests.ts @@ -1,6 +1,4 @@ - - -import * as nock from 'nock'; +import nock = require('nock'); import * as fs from 'fs'; var scope: nock.Scope; @@ -368,6 +366,12 @@ var scope = nock('http://www.headdy.com') 'X-My-Headers': 'My Header value' }); +var scope = nock('http://www.headdy.com') + .get('/') + .reply(200, 'Hello World!', { + 'X-My-Headers': ['My Header value 1', 'My Header value 2'] + }); + var scope = nock('http://www.headdy.com') .get('/') .reply(200, 'Hello World!', { diff --git a/types/nock/tsconfig.json b/types/nock/tsconfig.json index 30c4ce3aa7..fbd88d8e06 100644 --- a/types/nock/tsconfig.json +++ b/types/nock/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nodal/tsconfig.json b/types/nodal/tsconfig.json index 29407ab0a0..e386a34bd5 100644 --- a/types/nodal/tsconfig.json +++ b/types/nodal/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-7z/tsconfig.json b/types/node-7z/tsconfig.json index 87c09a2635..31275e1a7b 100644 --- a/types/node-7z/tsconfig.json +++ b/types/node-7z/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-array-ext/tsconfig.json b/types/node-array-ext/tsconfig.json index b7713bacb2..54ad436976 100644 --- a/types/node-array-ext/tsconfig.json +++ b/types/node-array-ext/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-cache/tsconfig.json b/types/node-cache/tsconfig.json index e024dba82d..0d05a8b958 100644 --- a/types/node-cache/tsconfig.json +++ b/types/node-cache/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-calendar/tsconfig.json b/types/node-calendar/tsconfig.json index f70d2de8ee..ddb256ca4b 100644 --- a/types/node-calendar/tsconfig.json +++ b/types/node-calendar/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-cleanup/tsconfig.json b/types/node-cleanup/tsconfig.json index 0b50b3555b..eab90ee9cc 100644 --- a/types/node-cleanup/tsconfig.json +++ b/types/node-cleanup/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-common-errors/tsconfig.json b/types/node-common-errors/tsconfig.json index a862893b87..361e724698 100644 --- a/types/node-common-errors/tsconfig.json +++ b/types/node-common-errors/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-config-manager/tsconfig.json b/types/node-config-manager/tsconfig.json index c308808722..91a3ae8510 100644 --- a/types/node-config-manager/tsconfig.json +++ b/types/node-config-manager/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-cron/index.d.ts b/types/node-cron/index.d.ts new file mode 100644 index 0000000000..75ddaefdde --- /dev/null +++ b/types/node-cron/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for node-cron 1.2 +// Project: http://merencia.com/node-cron/ +// Definitions by: morsic +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// immediateStart - default true +export function schedule(a: string, func: () => void, immediateStart?: boolean): ScheduledTask; + +export function validate(a: string): boolean; + +export interface ScheduledTask { + start: () => this; + stop: () => this; + destroy: () => void; +} diff --git a/types/node-cron/node-cron-tests.ts b/types/node-cron/node-cron-tests.ts new file mode 100644 index 0000000000..c670924d27 --- /dev/null +++ b/types/node-cron/node-cron-tests.ts @@ -0,0 +1,47 @@ +/// + +import cron = require('node-cron'); + +// tslint:disable-next-line no-console +const log = console.log; + +cron.schedule('* * * * *', () => { + log('running a task every minute'); +}); + +cron.schedule('1-5 * * * *', () => { + log('running every minute to 1 from 5'); +}); + +// tslint:disable-next-line rule +const task = cron.schedule('* * * * *', () => { + log('immediately started'); + // because of manual call start method +}, false); + +task.start(); + +const task1 = cron.schedule('* * * * *', () => { + log('will execute every minute until stopped'); +}); + +task1.start(); + +const task2 = cron.schedule('* * * * *', () => { + log('will execute every minute until stopped'); +}); + +task2.stop(); + +const task3 = cron.schedule('* * * * *', () => { + log('will execute every minute until stopped'); +}); + +task3.destroy(); + +const valid = cron.validate('59 * * * *'); +const invalid = cron.validate('60 * * * *'); + +if (valid && !invalid) { + log('validator works'); +} diff --git a/types/node-cron/tsconfig.json b/types/node-cron/tsconfig.json new file mode 100644 index 0000000000..5269f6d3a1 --- /dev/null +++ b/types/node-cron/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "strictNullChecks": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "strictFunctionTypes": true, + "noUnusedParameters": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "node-cron-tests.ts" + ] +} \ No newline at end of file diff --git a/types/node-cron/tslint.json b/types/node-cron/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/node-cron/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/node-dir/tsconfig.json b/types/node-dir/tsconfig.json index b8e68860af..cdbe51bb62 100644 --- a/types/node-dir/tsconfig.json +++ b/types/node-dir/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-dogstatsd/tsconfig.json b/types/node-dogstatsd/tsconfig.json index 98d50c65f8..b6f2407301 100644 --- a/types/node-dogstatsd/tsconfig.json +++ b/types/node-dogstatsd/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-emoji/tsconfig.json b/types/node-emoji/tsconfig.json index 448cf4351c..09552ed78b 100644 --- a/types/node-emoji/tsconfig.json +++ b/types/node-emoji/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-fetch/tsconfig.json b/types/node-fetch/tsconfig.json index 98a8d56ff1..b68e127c1f 100644 --- a/types/node-fetch/tsconfig.json +++ b/types/node-fetch/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-fibers/tsconfig.json b/types/node-fibers/tsconfig.json index a646c67d7f..1f8e0571ac 100644 --- a/types/node-fibers/tsconfig.json +++ b/types/node-fibers/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-forge/index.d.ts b/types/node-forge/index.d.ts index a5d3f078fe..2784d95fa3 100644 --- a/types/node-forge/index.d.ts +++ b/types/node-forge/index.d.ts @@ -14,7 +14,7 @@ declare module "node-forge" { type Utf8 = string; type OID = string; - namespace pem { + namespace pem { interface EncodeOptions { maxline?: number; @@ -32,7 +32,7 @@ declare module "node-forge" { function encode(msg: ObjectPEM, options?: EncodeOptions): string; function decode(str: string): ObjectPEM[]; } - + namespace pki { type PEM = string; @@ -79,10 +79,11 @@ declare module "node-forge" { interface CertificateField extends CertificateFieldOptions { valueConstructed?: boolean; valueTagClass?: asn1.Class; - value?: any[]; + value?: any[] | string; extensions?: any[]; } + interface Certificate { version: number; serialNumber: string; @@ -107,11 +108,61 @@ declare module "node-forge" { extensions: any[]; publicKey: any; md: any; + /** + * Sets the subject of this certificate. + * + * @param attrs the array of subject attributes to use. + * @param uniqueId an optional a unique ID to use. + */ + setSubject(attrs: CertificateField[], uniqueId?: string): void; + /** + * Sets the subject of this certificate. + * + * @param attrs the array of subject attributes to use. + * @param uniqueId an optional a unique ID to use. + */ + setIssuer(attrs: CertificateField[], uniqueId?: string): void; + /** + * Sets the extensions of this certificate. + * + * @param exts the array of extensions to use. + */ + setExtensions(exts: any[]): void; + /** + * Gets an extension by its name or id. + * + * @param options the name to use or an object with: + * name the name to use. + * id the id to use. + * + * @return the extension or null if not found. + */ + getExtension(options: string | {name: string;} | {id: number;}): {} | undefined; + + /** + * Signs this certificate using the given private key. + * + * @param key the private key to sign with. + * @param md the message digest object to use (defaults to forge.md.sha1). + */ + sign(key: pki.Key, md: md.MessageDigest): void; + /** + * Attempts verify the signature on the passed certificate using this + * certificate's public key. + * + * @param child the certificate to verify. + * + * @return true if verified, false if not. + */ + verify(child: Certificate): boolean; + } function certificateFromAsn1(obj: asn1.Asn1, computeHash?: boolean): Certificate; function decryptRsaPrivateKey(pem: PEM, passphrase?: string): Key; + + function createCertificate(): Certificate; } namespace ssh { diff --git a/types/node-forge/node-forge-tests.ts b/types/node-forge/node-forge-tests.ts index 63ccca6c70..29b8267714 100644 --- a/types/node-forge/node-forge-tests.ts +++ b/types/node-forge/node-forge-tests.ts @@ -1,4 +1,4 @@ -import * as forge from "node-forge"; +import * as forge from 'node-forge'; let keypair = forge.pki.rsa.generateKeyPair({ bits: 512 }); let privateKeyPem = forge.pki.privateKeyToPem(keypair.privateKey); @@ -8,19 +8,23 @@ let x: string = forge.ssh.privateKeyToOpenSSH(key); let pemKey: forge.pki.PEM = publicKeyPem; let publicKeyRsa = forge.pki.publicKeyFromPem(pemKey); let privateKeyRsa = forge.pki.privateKeyFromPem(privateKeyPem); +let cert = forge.pki.createCertificate(); { let subjectPublicKeyInfo = forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.SEQUENCE, true, [ forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.SEQUENCE, true, [ - forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.OID, false, - forge.asn1.oidToDer(forge.pki.oids['rsaEncryption']).getBytes(), + forge.asn1.create( + forge.asn1.Class.UNIVERSAL, + forge.asn1.Type.OID, + false, + forge.asn1.oidToDer(forge.pki.oids['rsaEncryption']).getBytes() ), - forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.NULL, false, ''), + forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.NULL, false, '') ]), forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.BITSTRING, false, [ forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.SEQUENCE, true, [ forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.INTEGER, false, []), - forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.INTEGER, false, []), + forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.INTEGER, false, []) ]) ]) ]); @@ -52,12 +56,14 @@ if (forge.util.fillString('1', 5) !== '11111') throw Error('forge.util.fillStrin src = new Uint8Array(2); encode = forge.util.binary.hex.encode(src); decode = forge.util.binary.hex.decode(encode); - if (encode !== '0000' || src.byteLength !== decode.byteLength) throw Error('forge.util.binary.hex.encode / decode fail'); + if (encode !== '0000' || src.byteLength !== decode.byteLength) + throw Error('forge.util.binary.hex.encode / decode fail'); src = new Uint8Array(2); encode = forge.util.binary.base64.encode(src); decode = forge.util.binary.base64.decode(encode); - if (encode !== 'AAA=' || src.byteLength !== decode.byteLength) throw Error('forge.util.binary.base64.encode / decode fail'); + if (encode !== 'AAA=' || src.byteLength !== decode.byteLength) + throw Error('forge.util.binary.base64.encode / decode fail'); src = new Uint8Array(10); encode = forge.util.binary.raw.encode(src); @@ -97,7 +103,6 @@ if (forge.util.fillString('1', 5) !== '11111') throw Error('forge.util.fillStrin if (hex.length !== 40) throw Error('forge.md.MessageDigest.update / digest fail'); } - { let md: forge.md.MessageDigest; let hex: string; @@ -110,26 +115,74 @@ if (forge.util.fillString('1', 5) !== '11111') throw Error('forge.util.fillStrin } { - let payload = { "asd": "asd" } - let cipher = forge.cipher.createCipher( - "3DES-ECB", - forge.util.createBuffer(key, "raw") - ); + let payload = { asd: 'asd' }; + let cipher = forge.cipher.createCipher('3DES-ECB', forge.util.createBuffer(key, 'raw')); cipher.start(); - cipher.update(forge.util.createBuffer(JSON.stringify(payload), "raw")); + cipher.update(forge.util.createBuffer(JSON.stringify(payload), 'raw')); cipher.finish(); let encrypted = cipher.output; let token = forge.util.encode64(encrypted.getBytes()); - let decipher = forge.cipher.createDecipher( - "3DES-ECB", - forge.util.createBuffer(key, "raw") - ); + let decipher = forge.cipher.createDecipher('3DES-ECB', forge.util.createBuffer(key, 'raw')); decipher.start(); - decipher.update(forge.util.createBuffer(forge.util.decode64(token), "raw")); + decipher.update(forge.util.createBuffer(forge.util.decode64(token), 'raw')); decipher.finish(); let decrypted = decipher.output as forge.util.ByteStringBuffer; let content = JSON.parse(forge.util.encodeUtf8(decrypted.getBytes())); if (content.asd == payload.asd) throw Error('forge.cipher.createCipher failed'); -} \ No newline at end of file +} + +{ + cert.publicKey = keypair.publicKey; + cert.serialNumber = new Date().getTime() + ''; + cert.validity.notBefore = new Date(); + cert.validity.notAfter = new Date(); + cert.validity.notAfter.setFullYear(cert.validity.notAfter.getFullYear() + 20); + const attrs = [ + { + name: 'commonName', + value: 'x22x22' + }, + { + name: 'countryName', + value: 'GitHub' + }, + { + shortName: 'ST', + value: 'GitHub' + }, + { + name: 'localityName', + value: 'GitHub' + }, + { + name: 'organizationName', + value: 'x22x22' + }, + { + shortName: 'OU', + value: 'https://github.com/x22x22' + } + ]; + cert.setSubject(attrs); + cert.setIssuer(attrs); + cert.setExtensions([ + { + name: 'basicConstraints', + critical: true, + cA: true + }, + { + name: 'keyUsage', + critical: true, + keyCertSign: true + }, + { + name: 'subjectKeyIdentifier' + } + ]); + + // self-sign certificate + cert.sign(keypair.privateKey, forge.md.sha256.create()); +} diff --git a/types/node-forge/tsconfig.json b/types/node-forge/tsconfig.json index 8864280abf..fb3691ebef 100644 --- a/types/node-forge/tsconfig.json +++ b/types/node-forge/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-gcm/tsconfig.json b/types/node-gcm/tsconfig.json index f68df952f2..594e89999c 100644 --- a/types/node-gcm/tsconfig.json +++ b/types/node-gcm/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-geocoder/node-geocoder-tests.ts b/types/node-geocoder/node-geocoder-tests.ts index 33ed4b3036..bb554d03ba 100644 --- a/types/node-geocoder/node-geocoder-tests.ts +++ b/types/node-geocoder/node-geocoder-tests.ts @@ -1,4 +1,4 @@ -import * as NodeGeocoder from 'node-geocoder'; +import NodeGeocoder = require('node-geocoder'); const geocoder = NodeGeocoder({ provider: 'google', diff --git a/types/node-geocoder/tsconfig.json b/types/node-geocoder/tsconfig.json index 8076dc932c..0ad4af9d61 100644 --- a/types/node-geocoder/tsconfig.json +++ b/types/node-geocoder/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-getopt/tsconfig.json b/types/node-getopt/tsconfig.json index 757df0d365..399c277a9c 100644 --- a/types/node-getopt/tsconfig.json +++ b/types/node-getopt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-hid/tsconfig.json b/types/node-hid/tsconfig.json index 3dce09c22b..65590474cb 100644 --- a/types/node-hid/tsconfig.json +++ b/types/node-hid/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-horseman/tsconfig.json b/types/node-horseman/tsconfig.json index 5490648512..a29f0ceb09 100644 --- a/types/node-horseman/tsconfig.json +++ b/types/node-horseman/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "node-horseman-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/node-hue-api/tsconfig.json b/types/node-hue-api/tsconfig.json index 6edecf355c..0310c9fb67 100644 --- a/types/node-hue-api/tsconfig.json +++ b/types/node-hue-api/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-int64/tsconfig.json b/types/node-int64/tsconfig.json index b7911dd7a2..361f4eb4e2 100644 --- a/types/node-int64/tsconfig.json +++ b/types/node-int64/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-ipc/tsconfig.json b/types/node-ipc/tsconfig.json index d8a28a8334..f3a0189b05 100644 --- a/types/node-ipc/tsconfig.json +++ b/types/node-ipc/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-jsfl-runner/tsconfig.json b/types/node-jsfl-runner/tsconfig.json index eb2c2d7fe9..f4353811a9 100644 --- a/types/node-jsfl-runner/tsconfig.json +++ b/types/node-jsfl-runner/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-json-db/tsconfig.json b/types/node-json-db/tsconfig.json index 1372add5aa..dfd45628f8 100644 --- a/types/node-json-db/tsconfig.json +++ b/types/node-json-db/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-mysql-wrapper/tsconfig.json b/types/node-mysql-wrapper/tsconfig.json index 7e12021cdc..d49a9c6e0b 100644 --- a/types/node-mysql-wrapper/tsconfig.json +++ b/types/node-mysql-wrapper/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-notifier/tsconfig.json b/types/node-notifier/tsconfig.json index 97b9bb617e..bab1531cf7 100644 --- a/types/node-notifier/tsconfig.json +++ b/types/node-notifier/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-persist/tsconfig.json b/types/node-persist/tsconfig.json index bcc3c3f2f9..e0b20bbdc4 100644 --- a/types/node-persist/tsconfig.json +++ b/types/node-persist/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-polyglot/tsconfig.json b/types/node-polyglot/tsconfig.json index ebf34971af..8927b0008b 100644 --- a/types/node-polyglot/tsconfig.json +++ b/types/node-polyglot/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-powershell/node-powershell-tests.ts b/types/node-powershell/node-powershell-tests.ts index a60f9db331..186d0bd68e 100644 --- a/types/node-powershell/node-powershell-tests.ts +++ b/types/node-powershell/node-powershell-tests.ts @@ -1,4 +1,4 @@ -import * as nodePowershell from 'node-powershell'; +import nodePowershell = require('node-powershell'); var options: nodePowershell.ShellOptions = { debugMsg: true diff --git a/types/node-powershell/tsconfig.json b/types/node-powershell/tsconfig.json index d24dc26304..2d2fc6f999 100644 --- a/types/node-powershell/tsconfig.json +++ b/types/node-powershell/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-ral/tsconfig.json b/types/node-ral/tsconfig.json index 13eec57091..de24642d5f 100644 --- a/types/node-ral/tsconfig.json +++ b/types/node-ral/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-red/tsconfig.json b/types/node-red/tsconfig.json index e92fbbd930..2330c83cff 100644 --- a/types/node-red/tsconfig.json +++ b/types/node-red/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-rsa/node-rsa-tests.ts b/types/node-rsa/node-rsa-tests.ts index e210d5b68d..0f8defacbd 100644 --- a/types/node-rsa/node-rsa-tests.ts +++ b/types/node-rsa/node-rsa-tests.ts @@ -1,4 +1,4 @@ -import * as NodeRSA from 'node-rsa'; +import NodeRSA = require('node-rsa'); const key = new NodeRSA({ b: 512 }); diff --git a/types/node-rsa/tsconfig.json b/types/node-rsa/tsconfig.json index 662a3c6b6f..e1a294df26 100644 --- a/types/node-rsa/tsconfig.json +++ b/types/node-rsa/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-sass-middleware/node-sass-middleware-tests.ts b/types/node-sass-middleware/node-sass-middleware-tests.ts index bfc755a424..34820155ed 100644 --- a/types/node-sass-middleware/node-sass-middleware-tests.ts +++ b/types/node-sass-middleware/node-sass-middleware-tests.ts @@ -1,6 +1,5 @@ - -import * as express from "express"; -import * as sassMiddleware from "node-sass-middleware"; +import express = require("express"); +import sassMiddleware = require("node-sass-middleware"); import * as path from "path"; var app = express(); app.use(sassMiddleware({ diff --git a/types/node-sass-middleware/tsconfig.json b/types/node-sass-middleware/tsconfig.json index f1c2b3a530..930a88b720 100644 --- a/types/node-sass-middleware/tsconfig.json +++ b/types/node-sass-middleware/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-sass/tsconfig.json b/types/node-sass/tsconfig.json index a1e4cdb079..4ee0b96bb1 100644 --- a/types/node-sass/tsconfig.json +++ b/types/node-sass/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-schedule/tsconfig.json b/types/node-schedule/tsconfig.json index 7ff95758d0..37ff002d0e 100644 --- a/types/node-schedule/tsconfig.json +++ b/types/node-schedule/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-slack/tsconfig.json b/types/node-slack/tsconfig.json index b32803599a..db7ad8d561 100644 --- a/types/node-slack/tsconfig.json +++ b/types/node-slack/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-snap7/tsconfig.json b/types/node-snap7/tsconfig.json index c78bc5a83f..70d02cbaab 100644 --- a/types/node-snap7/tsconfig.json +++ b/types/node-snap7/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-sprite-generator/node-sprite-generator-tests.ts b/types/node-sprite-generator/node-sprite-generator-tests.ts index 23309cea6d..7490d84865 100644 --- a/types/node-sprite-generator/node-sprite-generator-tests.ts +++ b/types/node-sprite-generator/node-sprite-generator-tests.ts @@ -1,5 +1,5 @@ -import * as nsg from 'node-sprite-generator'; -import * as express from 'express'; +import nsg = require('node-sprite-generator'); +import express = require('express'); const app = express(); app.use(nsg.middleware({ diff --git a/types/node-sprite-generator/tsconfig.json b/types/node-sprite-generator/tsconfig.json index 1a1abcf56b..cfd0f3ecb0 100644 --- a/types/node-sprite-generator/tsconfig.json +++ b/types/node-sprite-generator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-static/tsconfig.json b/types/node-static/tsconfig.json index 57a6d79f15..b6034feeaf 100644 --- a/types/node-static/tsconfig.json +++ b/types/node-static/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-statsd/tsconfig.json b/types/node-statsd/tsconfig.json index a4f7cdba75..dea7e59d6c 100644 --- a/types/node-statsd/tsconfig.json +++ b/types/node-statsd/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-telegram-bot-api/tsconfig.json b/types/node-telegram-bot-api/tsconfig.json index bb33d5e9b5..62f52d6383 100644 --- a/types/node-telegram-bot-api/tsconfig.json +++ b/types/node-telegram-bot-api/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-uuid/tsconfig.json b/types/node-uuid/tsconfig.json index 52dc8180a0..f5491454e9 100644 --- a/types/node-uuid/tsconfig.json +++ b/types/node-uuid/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-validator/tsconfig.json b/types/node-validator/tsconfig.json index eb98203673..693678cdf3 100644 --- a/types/node-validator/tsconfig.json +++ b/types/node-validator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-vault/node-vault-tests.ts b/types/node-vault/node-vault-tests.ts index d6d85980a1..6ce23bd4cd 100644 --- a/types/node-vault/node-vault-tests.ts +++ b/types/node-vault/node-vault-tests.ts @@ -1,4 +1,4 @@ -import * as nv from "node-vault"; +import nv = require("node-vault"); // Test code came from the sample code in README of the module. const options = { diff --git a/types/node-vault/tsconfig.json b/types/node-vault/tsconfig.json index d2875ffa4a..db340a253a 100644 --- a/types/node-vault/tsconfig.json +++ b/types/node-vault/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-waves/index.d.ts b/types/node-waves/index.d.ts deleted file mode 100644 index fd2cb4937c..0000000000 --- a/types/node-waves/index.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -// Type definitions for node-waves 0.7 -// Project: http://fian.my.id/Waves -// Definitions by: Stephen Lautier -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export type ElementTarget = string | Element | Element[]; - -export interface WavesConfig { - /** - * Determines how long the waves effect duration (in milliseconds). - * - */ - duration?: number; - - /** - * Delay amount to show waves effect on touch and hide the effect if user scrolls. - * Set to 0 to disable delay (in milliseconds). - * - */ - delay?: number; -} - -export interface RippleOptions { - /** - * Specify how long to wait between starting and stopping the ripple. - * - */ - wait?: number | null; - - /** - * Specify the position inside the element. - * - */ - position?: { - x: number; - y: number; - } | null; -} - -/** - * Initializes waves with an optional config. - */ -export function init(config?: WavesConfig): void; - -/** - * Attach ripple effect by adding `.waves-effect` to HTML element. - * Make sure you call `init` to activate the ripple. - * - * @param elements elements to target. - * @param classes classes to add. - */ -export function attach(elements: ElementTarget, classes?: string | string[]): void; - -/** - * Creates a ripple effect in HTML element programmatically. - * @param elements elements to target (must have `.waves-effect` already applied, ideally via `attach`). - * @param options specify how long to wait between starting and stopping the ripple, and it's position inside the element. - */ -export function ripple(elements: ElementTarget, options?: RippleOptions): void; - -/** - * Removes all ripples from inside an element immediately. - * - * @param elements elements to remove ripples from. - */ -export function calm(elements: ElementTarget): void; diff --git a/types/node-waves/node-waves-tests.ts b/types/node-waves/node-waves-tests.ts deleted file mode 100644 index b9eac6682e..0000000000 --- a/types/node-waves/node-waves-tests.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { init, ripple, attach, calm } from "node-waves"; - -init({ delay: 300 }); - -attach("button", "waves-light"); - -ripple(".box", { wait: null }); - -calm(".box"); diff --git a/types/node-wit/tsconfig.json b/types/node-wit/tsconfig.json index 4c183185fe..0f38fba2fb 100644 --- a/types/node-wit/tsconfig.json +++ b/types/node-wit/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-xmpp-client/tsconfig.json b/types/node-xmpp-client/tsconfig.json index 35471e38d2..da73c1f290 100644 --- a/types/node-xmpp-client/tsconfig.json +++ b/types/node-xmpp-client/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-xmpp-core/tsconfig.json b/types/node-xmpp-core/tsconfig.json index 65e37ab467..aab7c340f4 100644 --- a/types/node-xmpp-core/tsconfig.json +++ b/types/node-xmpp-core/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-zookeeper-client/tsconfig.json b/types/node-zookeeper-client/tsconfig.json index 0182035432..89a844e122 100644 --- a/types/node-zookeeper-client/tsconfig.json +++ b/types/node-zookeeper-client/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 8f4e6cf636..e6d4797bbf 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Node.js 9.3.x +// Type definitions for Node.js 9.4.x // Project: http://nodejs.org/ // Definitions by: Microsoft TypeScript // DefinitelyTyped @@ -118,12 +118,17 @@ interface NodeRequireFunction { } interface NodeRequire extends NodeRequireFunction { - resolve(id: string): string; + resolve: RequireResolve; cache: any; extensions: NodeExtensions; main: NodeModule | undefined; } +interface RequireResolve { + (id: string, options?: { paths?: string[]; }): string; + paths(request: string): string[] | null; +} + interface NodeExtensions { '.js': (m: NodeModule, filename: string) => any; '.json': (m: NodeModule, filename: string) => any; @@ -410,6 +415,7 @@ declare namespace NodeJS { setMaxListeners(n: number): this; getMaxListeners(): number; listeners(event: string | symbol): Function[]; + rawListeners(event: string | symbol): Function[]; emit(event: string | symbol, ...args: any[]): boolean; listenerCount(type: string | symbol): number; // Added in Node 6... @@ -520,6 +526,7 @@ declare namespace NodeJS { export interface WriteStream extends Socket { readonly writableHighWaterMark: number; + readonly writableLength: number; columns?: number; rows?: number; _write(chunk: any, encoding: string, callback: Function): void; @@ -532,6 +539,7 @@ declare namespace NodeJS { } export interface ReadStream extends Socket { readonly readableHighWaterMark: number; + readonly readableLength: number; isRaw?: boolean; setRawMode?(mode: boolean): void; _read(size: number): void; @@ -916,6 +924,7 @@ declare module "events" { setMaxListeners(n: number): this; getMaxListeners(): number; listeners(event: string | symbol): Function[]; + rawListeners(event: string | symbol): Function[]; emit(event: string | symbol, ...args: any[]): boolean; eventNames(): Array; listenerCount(type: string | symbol): number; @@ -1466,27 +1475,28 @@ declare module "zlib" { export function createInflateRaw(options?: ZlibOptions): InflateRaw; export function createUnzip(options?: ZlibOptions): Unzip; - export function deflate(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void; - export function deflate(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; - export function deflateSync(buf: Buffer | string, options?: ZlibOptions): Buffer; - export function deflateRaw(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void; - export function deflateRaw(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; - export function deflateRawSync(buf: Buffer | string, options?: ZlibOptions): Buffer; - export function gzip(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void; - export function gzip(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; - export function gzipSync(buf: Buffer | string, options?: ZlibOptions): Buffer; - export function gunzip(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void; - export function gunzip(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; - export function gunzipSync(buf: Buffer | string, options?: ZlibOptions): Buffer; - export function inflate(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void; - export function inflate(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; - export function inflateSync(buf: Buffer | string, options?: ZlibOptions): Buffer; - export function inflateRaw(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void; - export function inflateRaw(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; - export function inflateRawSync(buf: Buffer | string, options?: ZlibOptions): Buffer; - export function unzip(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void; - export function unzip(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; - export function unzipSync(buf: Buffer | string, options?: ZlibOptions): Buffer; + type InputType = string | Buffer | DataView | ArrayBuffer /* | TypedArray */; + export function deflate(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function deflate(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function deflateSync(buf: InputType, options?: ZlibOptions): Buffer; + export function deflateRaw(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function deflateRaw(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function deflateRawSync(buf: InputType, options?: ZlibOptions): Buffer; + export function gzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function gzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function gzipSync(buf: InputType, options?: ZlibOptions): Buffer; + export function gunzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function gunzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function gunzipSync(buf: InputType, options?: ZlibOptions): Buffer; + export function inflate(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function inflate(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function inflateSync(buf: InputType, options?: ZlibOptions): Buffer; + export function inflateRaw(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function inflateRaw(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function inflateRawSync(buf: InputType, options?: ZlibOptions): Buffer; + export function unzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function unzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function unzipSync(buf: InputType, options?: ZlibOptions): Buffer; export namespace constants { // Allowed flush values. @@ -5304,7 +5314,8 @@ declare module "stream" { export class Readable extends Stream implements NodeJS.ReadableStream { readable: boolean; - readableHighWaterMark: number; + readonly readableHighWaterMark: number; + readonly readableLength: number; constructor(opts?: ReadableOptions); _read(size: number): void; read(size?: number): any; @@ -5329,7 +5340,6 @@ declare module "stream" { * 5. error */ addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: string, listener: (...args: any[]) => void): this; addListener(event: "close", listener: () => void): this; addListener(event: "data", listener: (chunk: Buffer | string) => void): this; addListener(event: "end", listener: () => void): this; @@ -5392,6 +5402,7 @@ declare module "stream" { export class Writable extends Stream implements NodeJS.WritableStream { writable: boolean; readonly writableHighWaterMark: number; + readonly writableLength: number; constructor(opts?: WritableOptions); _write(chunk: any, encoding: string, callback: (err?: Error) => void): void; _writev?(chunks: Array<{chunk: any, encoding: string}>, callback: (err?: Error) => void): void; @@ -5484,6 +5495,7 @@ declare module "stream" { export class Duplex extends Readable implements Writable { writable: boolean; readonly writableHighWaterMark: number; + readonly writableLength: number; constructor(opts?: DuplexOptions); _write(chunk: any, encoding: string, callback: (err?: Error) => void): void; _writev?(chunks: Array<{chunk: any, encoding: string}>, callback: (err?: Error) => void): void; diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index dccde2db47..f70d21bd52 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert = require("assert"); import * as fs from "fs"; import * as events from "events"; import events2 = require("events"); diff --git a/types/node/tsconfig.json b/types/node/tsconfig.json index 9f4317b9f4..16836a1483 100644 --- a/types/node/tsconfig.json +++ b/types/node/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/node/v0/node-tests.ts b/types/node/v0/node-tests.ts index 8e2443b360..d8e0a40699 100644 --- a/types/node/v0/node-tests.ts +++ b/types/node/v0/node-tests.ts @@ -1,5 +1,4 @@ - -import * as assert from "assert"; +import assert = require("assert"); import * as fs from "fs"; import * as events from "events"; import * as zlib from "zlib"; diff --git a/types/node/v0/tsconfig.json b/types/node/v0/tsconfig.json index a4a370b7a7..b3bde5e9c4 100644 --- a/types/node/v0/tsconfig.json +++ b/types/node/v0/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node/v4/node-tests.ts b/types/node/v4/node-tests.ts index 2bb28ce779..e60b578ccf 100644 --- a/types/node/v4/node-tests.ts +++ b/types/node/v4/node-tests.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert = require("assert"); import * as fs from "fs"; import * as events from "events"; import * as zlib from "zlib"; diff --git a/types/node/v4/tsconfig.json b/types/node/v4/tsconfig.json index c89540145a..c5b84e1c76 100644 --- a/types/node/v4/tsconfig.json +++ b/types/node/v4/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node/v6/index.d.ts b/types/node/v6/index.d.ts index 5cbe7ab3dc..236ae5630d 100644 --- a/types/node/v6/index.d.ts +++ b/types/node/v6/index.d.ts @@ -5,6 +5,7 @@ // Wilco Bakker // Thomas Bouldin // Sebastian Silbermann +// Alorel // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /************************************************ @@ -2595,8 +2596,51 @@ declare module "fs" { * @returns Returns the created folder path. */ export function mkdtempSync(prefix: string): string; - export function readdir(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, files: string[]) => void): void; - export function readdirSync(path: string | Buffer): string[]; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir(path: string | Buffer, options: { encoding: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir(path: string | Buffer, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, files: Buffer[]) => void): void; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir(path: string | Buffer, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, files: Array) => void): void; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. + */ + export function readdir(path: string | Buffer, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void; + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync(path: string | Buffer, options?: { encoding: BufferEncoding | null } | BufferEncoding | null): string[]; + + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync(path: string | Buffer, options: { encoding: "buffer" } | "buffer"): Buffer[]; + + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync(path: string | Buffer, options?: { encoding?: string | null } | string | null): Array; export function close(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; export function closeSync(fd: number): void; export function open(path: string | Buffer, flags: string | number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void; @@ -3605,7 +3649,6 @@ declare module "stream" { * 5. error **/ addListener(event: string, listener: Function): this; - addListener(event: string, listener: Function): this; addListener(event: "close", listener: () => void): this; addListener(event: "data", listener: (chunk: Buffer | string) => void): this; addListener(event: "end", listener: () => void): this; diff --git a/types/node/v6/node-tests.ts b/types/node/v6/node-tests.ts index 34a62bf88d..2520750a88 100644 --- a/types/node/v6/node-tests.ts +++ b/types/node/v6/node-tests.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert = require("assert"); import * as fs from "fs"; import * as events from "events"; import events2 = require("events"); @@ -218,6 +218,21 @@ namespace fs_tests { fs.readFile('testfile', { flag: 'r' }, (err, data) => buffer = data); } + { + fs.readdir('foo', (err: any, files: string[]) => {}) + fs.readdir('foo', 'utf8', (err: any, files: string[]) => {}); + fs.readdir('foo', {encoding: 'utf8'}, (err: any, files: string[]) => {}); + fs.readdir('foo', 'buffer', (err: any, files: Buffer[]) => {}); + fs.readdir('foo', {encoding: 'buffer'}, (err: any, files: Buffer[]) => {}); + + let fsStringOut: string[] = fs.readdirSync('utf8'); + fsStringOut = fs.readdirSync('foo', 'utf8'); + fsStringOut = fs.readdirSync('foo', {encoding: 'utf8'}); + + let fsBufferOut: Buffer[] = fs.readdirSync('utf8', 'buffer'); + fsBufferOut = fs.readdirSync('foo', {encoding: 'buffer'}); + } + { var errno: number; fs.readFile('testfile', (err, data) => { diff --git a/types/node/v6/tsconfig.json b/types/node/v6/tsconfig.json index 8fc9488eac..452983f88b 100644 --- a/types/node/v6/tsconfig.json +++ b/types/node/v6/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node/v6/tslint.json b/types/node/v6/tslint.json index 518f58df03..82d575f726 100644 --- a/types/node/v6/tslint.json +++ b/types/node/v6/tslint.json @@ -14,6 +14,7 @@ "jsdoc-format": false, "max-line-length": false, "no-any-union": false, + "no-const-enum": false, "no-consecutive-blank-lines": false, "no-duplicate-imports": false, "no-duplicate-variable": false, diff --git a/types/node/v7/index.d.ts b/types/node/v7/index.d.ts index 038c4a6f58..93bc842cb4 100644 --- a/types/node/v7/index.d.ts +++ b/types/node/v7/index.d.ts @@ -3754,7 +3754,6 @@ declare module "stream" { * 5. error **/ addListener(event: string, listener: Function): this; - addListener(event: string, listener: Function): this; addListener(event: "close", listener: () => void): this; addListener(event: "data", listener: (chunk: Buffer | string) => void): this; addListener(event: "end", listener: () => void): this; diff --git a/types/node/v7/node-tests.ts b/types/node/v7/node-tests.ts index a2f25db8ec..0240dcc120 100644 --- a/types/node/v7/node-tests.ts +++ b/types/node/v7/node-tests.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert = require("assert"); import * as fs from "fs"; import * as events from "events"; import events2 = require("events"); diff --git a/types/node/v7/tsconfig.json b/types/node/v7/tsconfig.json index c5badcdaa5..23318008ca 100644 --- a/types/node/v7/tsconfig.json +++ b/types/node/v7/tsconfig.json @@ -23,6 +23,7 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index 3fbd9f9253..4832c01138 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Node.js 8.5.x +// Type definitions for Node.js 8.9.x // Project: http://nodejs.org/ // Definitions by: Microsoft TypeScript // DefinitelyTyped @@ -19,12 +19,6 @@ // Alberto Schiabel // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/************************************************ -* * -* Node.js v8.5.x API * -* * -************************************************/ - /** inspector module types */ /// @@ -122,12 +116,17 @@ interface NodeRequireFunction { } interface NodeRequire extends NodeRequireFunction { - resolve(id: string): string; + resolve: RequireResolve; cache: any; extensions: NodeExtensions; main: NodeModule | undefined; } +interface RequireResolve { + (id: string, options?: { paths?: string[]; }): string; + paths(request: string): string[] | null; +} + interface NodeExtensions { '.js': (m: NodeModule, filename: string) => any; '.json': (m: NodeModule, filename: string) => any; @@ -145,6 +144,7 @@ interface NodeModule { loaded: boolean; parent: NodeModule | null; children: NodeModule[]; + paths: string[]; } declare var module: NodeModule; @@ -1176,13 +1176,7 @@ declare module "cluster" { stdio?: any[]; uid?: number; gid?: number; - } - - export interface ClusterSetupMasterSettings { - exec?: string; // default: process.argv[1] - args?: string[]; // default: process.argv.slice(2) - silent?: boolean; // default: false - stdio?: any[]; + inspectPort?: number | (() => number); } export interface Address { @@ -1269,7 +1263,7 @@ declare module "cluster" { isWorker: boolean; // TODO: cluster.schedulingPolicy settings: ClusterSettings; - setupMaster(settings?: ClusterSetupMasterSettings): void; + setupMaster(settings?: ClusterSettings): void; worker?: Worker; workers?: { [index: string]: Worker | undefined @@ -1346,7 +1340,7 @@ declare module "cluster" { export var isWorker: boolean; // TODO: cluster.schedulingPolicy export var settings: ClusterSettings; - export function setupMaster(settings?: ClusterSetupMasterSettings): void; + export function setupMaster(settings?: ClusterSettings): void; export var worker: Worker; export var workers: { [index: string]: Worker | undefined @@ -1729,7 +1723,7 @@ declare module "os" { export function arch(): string; export function platform(): NodeJS.Platform; export function tmpdir(): string; - export var EOL: string; + export const EOL: string; export function endianness(): "BE" | "LE"; } @@ -1752,6 +1746,7 @@ declare module "https" { rejectUnauthorized?: boolean; NPNProtocols?: any; SNICallback?: (servername: string, cb: (err: Error | null, ctx: tls.SecureContext) => void) => void; + secureProtocol?: string; } export interface RequestOptions extends http.RequestOptions { @@ -2342,7 +2337,19 @@ declare module "url" { query?: string | null | ParsedUrlQuery; } - export function parse(urlStr: string, parseQueryString?: boolean, slashesDenoteHost?: boolean): Url; + export interface UrlWithParsedQuery extends Url { + query: ParsedUrlQuery; + } + + export interface UrlWithStringQuery extends Url { + query: string | null; + } + + export function parse(urlStr: string): UrlWithStringQuery; + export function parse(urlStr: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery; + export function parse(urlStr: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery; + export function parse(urlStr: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url; + export function format(URL: URL, options?: URLFormatOptions): string; export function format(urlObject: UrlObject | string): string; export function resolve(from: string, to: string): string; @@ -4573,7 +4580,6 @@ declare module "path" { */ name: string; } - export interface FormatInputPathObject { /** * The root of the path such as '/' or 'c:\' @@ -4620,7 +4626,7 @@ declare module "path" { * * @param pathSegments string paths to join. Non-string arguments are ignored. */ - export function resolve(...pathSegments: any[]): string; + export function resolve(...pathSegments: string[]): string; /** * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. * @@ -4686,7 +4692,7 @@ declare module "path" { export var sep: string; export var delimiter: string; export function parse(p: string): ParsedPath; - export function format(pP: ParsedPath): string; + export function format(pP: FormatInputPathObject): string; } export module win32 { @@ -4701,7 +4707,7 @@ declare module "path" { export var sep: string; export var delimiter: string; export function parse(p: string): ParsedPath; - export function format(pP: ParsedPath): string; + export function format(pP: FormatInputPathObject): string; } } @@ -5309,7 +5315,6 @@ declare module "stream" { * 5. error */ addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: string, listener: (...args: any[]) => void): this; addListener(event: "close", listener: () => void): this; addListener(event: "data", listener: (chunk: Buffer | string) => void): this; addListener(event: "end", listener: () => void): this; @@ -6920,195 +6925,195 @@ declare module "http2" { } declare module "perf_hooks" { - export interface PerformanceEntry { - /** - * The total number of milliseconds elapsed for this entry. - * This value will not be meaningful for all Performance Entry types. - */ - readonly duration: number; + export interface PerformanceEntry { + /** + * The total number of milliseconds elapsed for this entry. + * This value will not be meaningful for all Performance Entry types. + */ + readonly duration: number; - /** - * The name of the performance entry. - */ - readonly name: string; + /** + * The name of the performance entry. + */ + readonly name: string; - /** - * The high resolution millisecond timestamp marking the starting time of the Performance Entry. - */ - readonly startTime: number; + /** + * The high resolution millisecond timestamp marking the starting time of the Performance Entry. + */ + readonly startTime: number; - /** - * The type of the performance entry. - * Currently it may be one of: 'node', 'mark', 'measure', 'gc', or 'function'. - */ - readonly entryType: string; + /** + * The type of the performance entry. + * Currently it may be one of: 'node', 'mark', 'measure', 'gc', or 'function'. + */ + readonly entryType: string; - /** - * When performanceEntry.entryType is equal to 'gc', the performance.kind property identifies - * the type of garbage collection operation that occurred. - * The value may be one of perf_hooks.constants. - */ - readonly kind?: number; - } - - export interface PerformanceNodeTiming extends PerformanceEntry { - /** - * The high resolution millisecond timestamp at which the Node.js process completed bootstrap. - */ - readonly bootstrapComplete: number; - - /** - * The high resolution millisecond timestamp at which cluster processing ended. - */ - readonly clusterSetupEnd: number; - - /** - * The high resolution millisecond timestamp at which cluster processing started. - */ - readonly clusterSetupStart: number; - - /** - * The high resolution millisecond timestamp at which the Node.js event loop exited. - */ - readonly loopExit: number; - - /** - * The high resolution millisecond timestamp at which the Node.js event loop started. - */ - readonly loopStart: number; - - /** - * The high resolution millisecond timestamp at which main module load ended. - */ - readonly moduleLoadEnd: number; - - /** - * The high resolution millisecond timestamp at which main module load started. - */ - readonly moduleLoadStart: number; - - /** - * The high resolution millisecond timestamp at which the Node.js process was initialized. - */ - readonly nodeStart: number; - - /** - * The high resolution millisecond timestamp at which preload module load ended. - */ - readonly preloadModuleLoadEnd: number; - - /** - * The high resolution millisecond timestamp at which preload module load started. - */ - readonly preloadModuleLoadStart: number; - - /** - * The high resolution millisecond timestamp at which third_party_main processing ended. - */ - readonly thirdPartyMainEnd: number; - - /** - * The high resolution millisecond timestamp at which third_party_main processing started. - */ - readonly thirdPartyMainStart: number; - - /** - * The high resolution millisecond timestamp at which the V8 platform was initialized. - */ - readonly v8Start: number; + /** + * When performanceEntry.entryType is equal to 'gc', the performance.kind property identifies + * the type of garbage collection operation that occurred. + * The value may be one of perf_hooks.constants. + */ + readonly kind?: number; } - export interface Performance { - /** - * If name is not provided, removes all PerformanceFunction objects from the Performance Timeline. - * If name is provided, removes entries with name. - * @param name - */ - clearFunctions(name?: string): void; + export interface PerformanceNodeTiming extends PerformanceEntry { + /** + * The high resolution millisecond timestamp at which the Node.js process completed bootstrap. + */ + readonly bootstrapComplete: number; - /** - * If name is not provided, removes all PerformanceMark objects from the Performance Timeline. - * If name is provided, removes only the named mark. - * @param name - */ - clearMarks(name?: string): void; + /** + * The high resolution millisecond timestamp at which cluster processing ended. + */ + readonly clusterSetupEnd: number; - /** - * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline. - * If name is provided, removes only objects whose performanceEntry.name matches name. - */ - clearMeasures(name?: string): void; + /** + * The high resolution millisecond timestamp at which cluster processing started. + */ + readonly clusterSetupStart: number; - /** - * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime. - * @return list of all PerformanceEntry objects - */ - getEntries(): PerformanceEntry[]; + /** + * The high resolution millisecond timestamp at which the Node.js event loop exited. + */ + readonly loopExit: number; - /** - * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime - * whose performanceEntry.name is equal to name, and optionally, whose performanceEntry.entryType is equal to type. - * @param name - * @param type - * @return list of all PerformanceEntry objects - */ - getEntriesByName(name: string, type?: string): PerformanceEntry[]; + /** + * The high resolution millisecond timestamp at which the Node.js event loop started. + */ + readonly loopStart: number; - /** - * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime - * whose performanceEntry.entryType is equal to type. - * @param type - * @return list of all PerformanceEntry objects - */ - getEntriesByType(type: string): PerformanceEntry[]; + /** + * The high resolution millisecond timestamp at which main module load ended. + */ + readonly moduleLoadEnd: number; - /** - * Creates a new PerformanceMark entry in the Performance Timeline. - * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark', - * and whose performanceEntry.duration is always 0. - * Performance marks are used to mark specific significant moments in the Performance Timeline. - * @param name - */ - mark(name?: string): void; + /** + * The high resolution millisecond timestamp at which main module load started. + */ + readonly moduleLoadStart: number; - /** - * Creates a new PerformanceMeasure entry in the Performance Timeline. - * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', - * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. - * - * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify - * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, - * then startMark is set to timeOrigin by default. - * - * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp - * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. - * @param name - * @param startMark - * @param endMark - */ - measure(name: string, startMark: string, endMark: string): void; + /** + * The high resolution millisecond timestamp at which the Node.js process was initialized. + */ + readonly nodeStart: number; - /** - * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones. - */ - readonly nodeTiming: PerformanceNodeTiming; + /** + * The high resolution millisecond timestamp at which preload module load ended. + */ + readonly preloadModuleLoadEnd: number; - /** - * @return the current high resolution millisecond timestamp - */ - now(): number; + /** + * The high resolution millisecond timestamp at which preload module load started. + */ + readonly preloadModuleLoadStart: number; - /** - * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured. - */ - readonly timeOrigin: number; + /** + * The high resolution millisecond timestamp at which third_party_main processing ended. + */ + readonly thirdPartyMainEnd: number; - /** - * Wraps a function within a new function that measures the running time of the wrapped function. - * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed. - * @param fn - */ - timerify any>(fn: T): T; + /** + * The high resolution millisecond timestamp at which third_party_main processing started. + */ + readonly thirdPartyMainStart: number; + + /** + * The high resolution millisecond timestamp at which the V8 platform was initialized. + */ + readonly v8Start: number; + } + + export interface Performance { + /** + * If name is not provided, removes all PerformanceFunction objects from the Performance Timeline. + * If name is provided, removes entries with name. + * @param name + */ + clearFunctions(name?: string): void; + + /** + * If name is not provided, removes all PerformanceMark objects from the Performance Timeline. + * If name is provided, removes only the named mark. + * @param name + */ + clearMarks(name?: string): void; + + /** + * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline. + * If name is provided, removes only objects whose performanceEntry.name matches name. + */ + clearMeasures(name?: string): void; + + /** + * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime. + * @return list of all PerformanceEntry objects + */ + getEntries(): PerformanceEntry[]; + + /** + * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime + * whose performanceEntry.name is equal to name, and optionally, whose performanceEntry.entryType is equal to type. + * @param name + * @param type + * @return list of all PerformanceEntry objects + */ + getEntriesByName(name: string, type?: string): PerformanceEntry[]; + + /** + * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime + * whose performanceEntry.entryType is equal to type. + * @param type + * @return list of all PerformanceEntry objects + */ + getEntriesByType(type: string): PerformanceEntry[]; + + /** + * Creates a new PerformanceMark entry in the Performance Timeline. + * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark', + * and whose performanceEntry.duration is always 0. + * Performance marks are used to mark specific significant moments in the Performance Timeline. + * @param name + */ + mark(name?: string): void; + + /** + * Creates a new PerformanceMeasure entry in the Performance Timeline. + * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', + * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. + * + * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify + * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, + * then startMark is set to timeOrigin by default. + * + * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp + * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. + * @param name + * @param startMark + * @param endMark + */ + measure(name: string, startMark: string, endMark: string): void; + + /** + * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones. + */ + readonly nodeTiming: PerformanceNodeTiming; + + /** + * @return the current high resolution millisecond timestamp + */ + now(): number; + + /** + * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured. + */ + readonly timeOrigin: number; + + /** + * Wraps a function within a new function that measures the running time of the wrapped function. + * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed. + * @param fn + */ + timerify any>(fn: T): T; } export interface PerformanceObserverEntryList { @@ -7156,5 +7161,5 @@ declare module "perf_hooks" { export const NODE_PERFORMANCE_GC_WEAKCB: number; } - const performance: Performance; + const performance: Performance; } diff --git a/types/node/v8/node-tests.ts b/types/node/v8/node-tests.ts index 6bb7f28495..043935320c 100644 --- a/types/node/v8/node-tests.ts +++ b/types/node/v8/node-tests.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert = require("assert"); import * as fs from "fs"; import * as events from "events"; import events2 = require("events"); @@ -571,9 +571,22 @@ namespace url_tests { } { - var helloUrl = url.parse('http://example.com/?hello=world', true); - if (typeof helloUrl.query !== 'string') { - assert.equal(helloUrl.query['hello'], 'world'); + const helloUrl = url.parse('http://example.com/?hello=world', true); + let helloQuery = helloUrl.query['hello']; + assert.equal(helloUrl.query['hello'], 'world'); + + let strUrl = url.parse('http://example.com/?hello=world'); + let queryStr: string = strUrl.query; + + strUrl = url.parse('http://example.com/?hello=world', false); + queryStr = strUrl.query; + + function getBoolean(): boolean { return false; } + const urlUrl = url.parse('http://example.com/?hello=world', getBoolean()); + if (typeof(urlUrl.query) === 'string') { + queryStr = urlUrl.query; + } else if (urlUrl.query) { + helloQuery = urlUrl.query['hello']; } } @@ -1746,6 +1759,46 @@ namespace path_tests { }); // returns // '/home/user/dir/file.txt' + + path.format({ + dir: "/home/user/dir", + base: "file.txt" + }); + // returns + // '/home/user/dir/file.txt' + + path.posix.format({ + root: "/", + dir: "/home/user/dir", + base: "file.txt", + ext: ".txt", + name: "file" + }); + // returns + // '/home/user/dir/file.txt' + + path.posix.format({ + dir: "/home/user/dir", + base: "file.txt" + }); + // returns + // '/home/user/dir/file.txt' + + path.win32.format({ + root: "C:\\", + dir: "C:\\home\\user\\dir", + ext: ".txt", + name: "file" + }); + // returns + // 'C:\home\user\dir\file.txt' + + path.win32.format({ + dir: "C:\\home\\user\\dir", + base: "file.txt" + }); + // returns + // 'C:\home\user\dir\file.txt' } //////////////////////////////////////////////////// @@ -3860,6 +3913,8 @@ namespace module_tests { const m1: Module = new Module("moduleId"); const m2: Module = new Module.Module("moduleId"); + let paths: string[] = module.paths; + paths = m1.paths; } //////////////////////////////////////////////////// diff --git a/types/node/v8/tsconfig.json b/types/node/v8/tsconfig.json index 3f4614bef4..ea093ad4a3 100644 --- a/types/node/v8/tsconfig.json +++ b/types/node/v8/tsconfig.json @@ -24,6 +24,7 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } -} +} \ No newline at end of file diff --git a/types/node_redis/tsconfig.json b/types/node_redis/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/node_redis/tsconfig.json +++ b/types/node_redis/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index e097a77133..6f425f13a1 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "annotated-commit.d.ts", @@ -119,4 +120,4 @@ "tree-update.d.ts", "tree.d.ts" ] -} +} \ No newline at end of file diff --git a/types/nodegit/tslint.json b/types/nodegit/tslint.json index 0ec275bd05..4ce3d76bf7 100644 --- a/types/nodegit/tslint.json +++ b/types/nodegit/tslint.json @@ -3,6 +3,7 @@ "rules": { // TODOs "ban-types": false, + "no-const-enum": false, "no-unnecessary-class": false } } diff --git a/types/nodemailer-direct-transport/tsconfig.json b/types/nodemailer-direct-transport/tsconfig.json index a86a4a088a..98320cc735 100644 --- a/types/nodemailer-direct-transport/tsconfig.json +++ b/types/nodemailer-direct-transport/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nodemailer-mailgun-transport/tsconfig.json b/types/nodemailer-mailgun-transport/tsconfig.json index 4098e7a2d4..e5d64d4305 100644 --- a/types/nodemailer-mailgun-transport/tsconfig.json +++ b/types/nodemailer-mailgun-transport/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nodemailer-pickup-transport/tsconfig.json b/types/nodemailer-pickup-transport/tsconfig.json index 913453977e..5c029de666 100644 --- a/types/nodemailer-pickup-transport/tsconfig.json +++ b/types/nodemailer-pickup-transport/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nodemailer-ses-transport/nodemailer-ses-transport-tests.ts b/types/nodemailer-ses-transport/nodemailer-ses-transport-tests.ts index 393091816d..271dc6cf41 100644 --- a/types/nodemailer-ses-transport/nodemailer-ses-transport-tests.ts +++ b/types/nodemailer-ses-transport/nodemailer-ses-transport-tests.ts @@ -1,6 +1,6 @@ import * as AWS from "aws-sdk"; import * as nodemailer from "nodemailer"; -import * as sesTransport from 'nodemailer-ses-transport'; +import sesTransport = require('nodemailer-ses-transport'); const opts: sesTransport.SesOptions = { SES: new AWS.SES(), diff --git a/types/nodemailer-ses-transport/tsconfig.json b/types/nodemailer-ses-transport/tsconfig.json index bdaffbb222..db905153d0 100644 --- a/types/nodemailer-ses-transport/tsconfig.json +++ b/types/nodemailer-ses-transport/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nodemailer-smtp-pool/tsconfig.json b/types/nodemailer-smtp-pool/tsconfig.json index 63a47e4ce7..ed28a80cfd 100644 --- a/types/nodemailer-smtp-pool/tsconfig.json +++ b/types/nodemailer-smtp-pool/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nodemailer-smtp-transport/tsconfig.json b/types/nodemailer-smtp-transport/tsconfig.json index 4bce06278d..5a3c396e6f 100644 --- a/types/nodemailer-smtp-transport/tsconfig.json +++ b/types/nodemailer-smtp-transport/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nodemailer-stub-transport/tsconfig.json b/types/nodemailer-stub-transport/tsconfig.json index c8fed1b487..52b6f50f53 100644 --- a/types/nodemailer-stub-transport/tsconfig.json +++ b/types/nodemailer-stub-transport/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nodemailer/lib/mailer/index.d.ts b/types/nodemailer/lib/mailer/index.d.ts index f08c2d085d..bd9dd7ba8d 100644 --- a/types/nodemailer/lib/mailer/index.d.ts +++ b/types/nodemailer/lib/mailer/index.d.ts @@ -3,7 +3,7 @@ import { EventEmitter } from 'events'; import { Socket } from 'net'; import { Readable } from 'stream'; -import { URL } from 'url'; +import { Url } from 'url'; import { SentMessageInfo, Transport, TransportOptions } from '../..'; import * as shared from '../shared'; @@ -34,7 +34,7 @@ declare namespace Mail { /** String, Buffer or a Stream contents for the attachmentent */ content?: string | Buffer | Readable; /** path to a file or an URL (data uris are allowed as well) if you want to stream the file instead of including it (better for larger attachments) */ - path?: string | URL; + path?: string | Url; } interface Attachment extends AttachmentLike { @@ -175,11 +175,11 @@ declare class Mail extends EventEmitter { setupProxy(proxyUrl: string): void; set(key: 'oauth2_provision_cb', value: (user: string, renew: boolean, callback: (err: Error | null, accessToken?: string, expires?: number) => void) => void): Map; - set(key: 'proxy_handler_http' | 'proxy_handler_https' | 'proxy_handler_socks' | 'proxy_handler_socks5' | 'proxy_handler_socks4' | 'proxy_handler_socks4a', value: (proxy: URL, options: TransportOptions, callback: (err: Error | null, socketOptions?: { connection: Socket }) => void) => void): Map; + set(key: 'proxy_handler_http' | 'proxy_handler_https' | 'proxy_handler_socks' | 'proxy_handler_socks5' | 'proxy_handler_socks4' | 'proxy_handler_socks4a', value: (proxy: Url, options: TransportOptions, callback: (err: Error | null, socketOptions?: { connection: Socket }) => void) => void): Map; set(key: string, value: any): Map; get(key: 'oauth2_provision_cb'): (user: string, renew: boolean, callback: (err: Error | null, accessToken: string, expires: number) => void) => void; - get(key: 'proxy_handler_http' | 'proxy_handler_https' | 'proxy_handler_socks' | 'proxy_handler_socks5' | 'proxy_handler_socks4' | 'proxy_handler_socks4a'): (proxy: URL, options: TransportOptions, callback: (err: Error | null, socketOptions: { connection: Socket }) => void) => void; + get(key: 'proxy_handler_http' | 'proxy_handler_https' | 'proxy_handler_socks' | 'proxy_handler_socks5' | 'proxy_handler_socks4' | 'proxy_handler_socks4a'): (proxy: Url, options: TransportOptions, callback: (err: Error | null, socketOptions: { connection: Socket }) => void) => void; get(key: string): any; addListener(event: 'error', listener: (err: Error) => void): this; diff --git a/types/nodemailer/tsconfig.json b/types/nodemailer/tsconfig.json index f2c1ffbbe8..e01403bac1 100644 --- a/types/nodemailer/tsconfig.json +++ b/types/nodemailer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nodemailer/v3/tsconfig.json b/types/nodemailer/v3/tsconfig.json index 4ebef6b8cf..72c13e5afd 100644 --- a/types/nodemailer/v3/tsconfig.json +++ b/types/nodemailer/v3/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nodeunit/tsconfig.json b/types/nodeunit/tsconfig.json index 3d52af1d14..8500b806f3 100644 --- a/types/nodeunit/tsconfig.json +++ b/types/nodeunit/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/noisejs/tsconfig.json b/types/noisejs/tsconfig.json index 43e5b37e38..cab62ac0cd 100644 --- a/types/noisejs/tsconfig.json +++ b/types/noisejs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nomnom/tsconfig.json b/types/nomnom/tsconfig.json index 0c5b757ced..e67f844431 100644 --- a/types/nomnom/tsconfig.json +++ b/types/nomnom/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nopt/tsconfig.json b/types/nopt/tsconfig.json index 0dc537c0c8..8c962d58a5 100644 --- a/types/nopt/tsconfig.json +++ b/types/nopt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/normalize-package-data/tsconfig.json b/types/normalize-package-data/tsconfig.json index 0e79738d04..95a0703f81 100644 --- a/types/normalize-package-data/tsconfig.json +++ b/types/normalize-package-data/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "normalize-package-data-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/normalize-url/tsconfig.json b/types/normalize-url/tsconfig.json index 1626fe81b7..59d52868c4 100644 --- a/types/normalize-url/tsconfig.json +++ b/types/normalize-url/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/notie/tsconfig.json b/types/notie/tsconfig.json index 0ab631c147..3ee5ae8275 100644 --- a/types/notie/tsconfig.json +++ b/types/notie/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/notify/tsconfig.json b/types/notify/tsconfig.json index a6957993f9..2543739912 100644 --- a/types/notify/tsconfig.json +++ b/types/notify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/notifyjs-browser/tsconfig.json b/types/notifyjs-browser/tsconfig.json index 53861036b0..e4aae3115f 100644 --- a/types/notifyjs-browser/tsconfig.json +++ b/types/notifyjs-browser/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/notifyjs/tsconfig.json b/types/notifyjs/tsconfig.json index 0652ac5cfc..9c2928de69 100644 --- a/types/notifyjs/tsconfig.json +++ b/types/notifyjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/notyf/tsconfig.json b/types/notyf/tsconfig.json index 9cf78d162a..ac2fa96aad 100644 --- a/types/notyf/tsconfig.json +++ b/types/notyf/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "notyf-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/nouislider/index.d.ts b/types/nouislider/index.d.ts index 0e070e89c7..76b62371fe 100644 --- a/types/nouislider/index.d.ts +++ b/types/nouislider/index.d.ts @@ -179,7 +179,7 @@ declare namespace noUiSlider { * To get the current slider value. For one-handle sliders, calling .get() will return the value. * For two-handle sliders, an array[value, value] will be returned. */ - get(): number | number[]; + get(): string | string[]; /** * noUiSlider will keep your values within the slider range, which saves you a bunch of validation. * If you have configured the slider to use one handle, you can change the current value by passing diff --git a/types/nouislider/tsconfig.json b/types/nouislider/tsconfig.json index dd6994a4dd..43253dfc79 100644 --- a/types/nouislider/tsconfig.json +++ b/types/nouislider/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nouislider/tslint.json b/types/nouislider/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/nouislider/tslint.json +++ b/types/nouislider/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/nouislider/v7/tsconfig.json b/types/nouislider/v7/tsconfig.json index d24f6c55b0..c38ff9e541 100644 --- a/types/nouislider/v7/tsconfig.json +++ b/types/nouislider/v7/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nouislider/v8/tsconfig.json b/types/nouislider/v8/tsconfig.json index 6dfd2ac510..d0b146bb70 100644 --- a/types/nouislider/v8/tsconfig.json +++ b/types/nouislider/v8/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nouislider/v8/tslint.json b/types/nouislider/v8/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/nouislider/v8/tslint.json +++ b/types/nouislider/v8/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/novnc-core/tsconfig.json b/types/novnc-core/tsconfig.json index 3aed33120e..93eff8a1e4 100644 --- a/types/novnc-core/tsconfig.json +++ b/types/novnc-core/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/novnc-core/tslint.json b/types/novnc-core/tslint.json index 3db14f85ea..3224b40b8b 100644 --- a/types/novnc-core/tslint.json +++ b/types/novnc-core/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } +} diff --git a/types/npm-package-arg/tsconfig.json b/types/npm-package-arg/tsconfig.json index 1eea7a98ae..7cc49c7366 100644 --- a/types/npm-package-arg/tsconfig.json +++ b/types/npm-package-arg/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/npm/tsconfig.json b/types/npm/tsconfig.json index 01aebadc3e..8f15ee25cf 100644 --- a/types/npm/tsconfig.json +++ b/types/npm/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nprogress/tsconfig.json b/types/nprogress/tsconfig.json index bd50ab2e1f..e8c393e92c 100644 --- a/types/nprogress/tsconfig.json +++ b/types/nprogress/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ns-api/tsconfig.json b/types/ns-api/tsconfig.json index 6918e1e567..7569d8c5fa 100644 --- a/types/ns-api/tsconfig.json +++ b/types/ns-api/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nslog/tsconfig.json b/types/nslog/tsconfig.json index 6cd009f29d..a285b4a578 100644 --- a/types/nslog/tsconfig.json +++ b/types/nslog/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nsqjs/tsconfig.json b/types/nsqjs/tsconfig.json index 6681afbdb9..5a96224386 100644 --- a/types/nsqjs/tsconfig.json +++ b/types/nsqjs/tsconfig.json @@ -15,10 +15,10 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, - "strictFunctionTypes": true + "esModuleInterop": true }, "files": [ "index.d.ts", "nsqjs-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/number-is-nan/tsconfig.json b/types/number-is-nan/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/number-is-nan/tsconfig.json +++ b/types/number-is-nan/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/number-to-words/tsconfig.json b/types/number-to-words/tsconfig.json index 49b562b085..c14a5e19f2 100644 --- a/types/number-to-words/tsconfig.json +++ b/types/number-to-words/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/numeral/tsconfig.json b/types/numeral/tsconfig.json index 332485f391..e47443e0f5 100644 --- a/types/numeral/tsconfig.json +++ b/types/numeral/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/numjs/tsconfig.json b/types/numjs/tsconfig.json index f76db6c4ca..7b5455900f 100644 --- a/types/numjs/tsconfig.json +++ b/types/numjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nunjucks-date/tsconfig.json b/types/nunjucks-date/tsconfig.json index c5851d125c..a4174f7bc8 100644 --- a/types/nunjucks-date/tsconfig.json +++ b/types/nunjucks-date/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nunjucks/tsconfig.json b/types/nunjucks/tsconfig.json index 5824ce2f1f..70ac043ff8 100644 --- a/types/nunjucks/tsconfig.json +++ b/types/nunjucks/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "nunjucks-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/nvd3/tsconfig.json b/types/nvd3/tsconfig.json index a2aa830e00..910a98d99c 100644 --- a/types/nvd3/tsconfig.json +++ b/types/nvd3/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nw.gui/tsconfig.json b/types/nw.gui/tsconfig.json index ec66284c38..0570b20e56 100644 --- a/types/nw.gui/tsconfig.json +++ b/types/nw.gui/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nw.js/tsconfig.json b/types/nw.js/tsconfig.json index 047aa3c15a..035330976b 100644 --- a/types/nw.js/tsconfig.json +++ b/types/nw.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/o.js/tsconfig.json b/types/o.js/tsconfig.json index a3159265ee..536d5abe8c 100644 --- a/types/o.js/tsconfig.json +++ b/types/o.js/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/oauth.js/tsconfig.json b/types/oauth.js/tsconfig.json index 39891ddb92..2b9b599818 100644 --- a/types/oauth.js/tsconfig.json +++ b/types/oauth.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/oauth2-server/index.d.ts b/types/oauth2-server/index.d.ts index a423f48a58..06b6fbadb0 100644 --- a/types/oauth2-server/index.d.ts +++ b/types/oauth2-server/index.d.ts @@ -5,7 +5,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -import { Request, RequestHandler } from "express"; +import Express = require("express"); /** * Represents an OAuth2 server instance. diff --git a/types/oauth2-server/oauth2-server-tests.ts b/types/oauth2-server/oauth2-server-tests.ts index be8fa83705..faf9976873 100644 --- a/types/oauth2-server/oauth2-server-tests.ts +++ b/types/oauth2-server/oauth2-server-tests.ts @@ -1,5 +1,5 @@ -import * as express from "express"; -import * as OAuth2Server from "oauth2-server"; +import express = require("express"); +import OAuth2Server = require("oauth2-server"); const oauth2Model: OAuth2Server.AuthorizationCodeModel = { getClient: async (clientId: string, clientSecret: string): Promise => { diff --git a/types/oauth2-server/tsconfig.json b/types/oauth2-server/tsconfig.json index b245965239..ee86fffc4f 100644 --- a/types/oauth2-server/tsconfig.json +++ b/types/oauth2-server/tsconfig.json @@ -15,6 +15,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "target": "es6" }, "files": [ diff --git a/types/oauth2orize/tsconfig.json b/types/oauth2orize/tsconfig.json index 7903eeb77f..f2a562ac68 100644 --- a/types/oauth2orize/tsconfig.json +++ b/types/oauth2orize/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/obelisk.js/tsconfig.json b/types/obelisk.js/tsconfig.json index f95e82cb80..3005f5052f 100644 --- a/types/obelisk.js/tsconfig.json +++ b/types/obelisk.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/object-assign/tsconfig.json b/types/object-assign/tsconfig.json index f00a78b509..14dd544d25 100644 --- a/types/object-assign/tsconfig.json +++ b/types/object-assign/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/object-diff/tsconfig.json b/types/object-diff/tsconfig.json index 3fdf287fcf..d49649e67a 100644 --- a/types/object-diff/tsconfig.json +++ b/types/object-diff/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/object-hash/index.d.ts b/types/object-hash/index.d.ts index c6b16df950..4da49c262c 100644 --- a/types/object-hash/index.d.ts +++ b/types/object-hash/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for object-hash v1.1.8 +// Type definitions for object-hash v1.2.0 // Project: https://github.com/puleos/object-hash // Definitions by: Michael Zabka // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -18,6 +18,7 @@ declare namespace ObjectHash { respectFunctionNames?: boolean; unorderedArrays?: boolean; unorderedSets?: boolean; + excludeKeys?: (key: string) => boolean; } interface HashTableItem { diff --git a/types/object-hash/tsconfig.json b/types/object-hash/tsconfig.json index 7f1eb2a0f1..fe16726761 100644 --- a/types/object-hash/tsconfig.json +++ b/types/object-hash/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/object-inspect/tsconfig.json b/types/object-inspect/tsconfig.json index 1f167ba039..bcdc9ceafa 100644 --- a/types/object-inspect/tsconfig.json +++ b/types/object-inspect/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "object-inspect-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/object-map/tsconfig.json b/types/object-map/tsconfig.json index 88256eb7f9..b395a58165 100644 --- a/types/object-map/tsconfig.json +++ b/types/object-map/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/object-path/tsconfig.json b/types/object-path/tsconfig.json index 14192cc5b0..776b12f2ed 100644 --- a/types/object-path/tsconfig.json +++ b/types/object-path/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/object-refs/tsconfig.json b/types/object-refs/tsconfig.json index 3d9337cf0a..0fa906064e 100644 --- a/types/object-refs/tsconfig.json +++ b/types/object-refs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/oblo-util/tsconfig.json b/types/oblo-util/tsconfig.json index c424a7fff8..9d878f810c 100644 --- a/types/oblo-util/tsconfig.json +++ b/types/oblo-util/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/oboe/tsconfig.json b/types/oboe/tsconfig.json index 1c02019149..08c0ffd5df 100644 --- a/types/oboe/tsconfig.json +++ b/types/oboe/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/observe-js/tsconfig.json b/types/observe-js/tsconfig.json index 23b2a5106e..19dbac24df 100644 --- a/types/observe-js/tsconfig.json +++ b/types/observe-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/oclazyload/tsconfig.json b/types/oclazyload/tsconfig.json index 3ada1d6bee..c3be409f70 100644 --- a/types/oclazyload/tsconfig.json +++ b/types/oclazyload/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/odata/tsconfig.json b/types/odata/tsconfig.json index d7ea224b4e..635168e418 100644 --- a/types/odata/tsconfig.json +++ b/types/odata/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ofe/tsconfig.json b/types/ofe/tsconfig.json index dbd94babca..13f2ecddb1 100644 --- a/types/ofe/tsconfig.json +++ b/types/ofe/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index e24b6c4a2c..138e12c7b5 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Office.js // Project: http://dev.office.com -// Definitions by: OfficeDev , Lance Austin +// Definitions by: OfficeDev , Lance Austin , Michael Zlatkovsky , Kim Brandl , Ricky Kirkham // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /* @@ -134,17 +134,14 @@ declare namespace Office { export interface Error { /** * Gets the numeric code of the error. - * @since 1.0 */ code: number; /** * Gets the name of the error. - * @since 1.0 */ message: string; /** * Gets a detailed description of the error. - * @since 1.0 */ name: string; } @@ -244,7 +241,7 @@ declare namespace Office { bodyBackgroundColor: string; bodyForegroundColor: string; controlBackgroundColor: string; - controlForgroundColor: string; + controlForegroundColor: string; } /** * Dialog object returned as part of the displayDialogAsync callback. The object exposes methods for registering event handlers and closing the dialog diff --git a/types/office-js/tsconfig.json b/types/office-js/tsconfig.json index 28a0881837..45e8292315 100644 --- a/types/office-js/tsconfig.json +++ b/types/office-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/offline-js/tsconfig.json b/types/offline-js/tsconfig.json index e7d567565c..63c0c3d772 100644 --- a/types/offline-js/tsconfig.json +++ b/types/offline-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/oibackoff/tsconfig.json b/types/oibackoff/tsconfig.json index d1f4fd90d8..bf94e5b8a8 100644 --- a/types/oibackoff/tsconfig.json +++ b/types/oibackoff/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/oidc-token-manager/tsconfig.json b/types/oidc-token-manager/tsconfig.json index 9a1d07adb6..0069da49f5 100644 --- a/types/oidc-token-manager/tsconfig.json +++ b/types/oidc-token-manager/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ol/assertionerror/index.d.ts b/types/ol/assertionerror/index.d.ts new file mode 100644 index 0000000000..3585cd64da --- /dev/null +++ b/types/ol/assertionerror/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.AssertionError; diff --git a/types/ol/attribution/index.d.ts b/types/ol/attribution/index.d.ts new file mode 100644 index 0000000000..71eb87ff73 --- /dev/null +++ b/types/ol/attribution/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.Attribution; diff --git a/types/ol/collection/index.d.ts b/types/ol/collection/index.d.ts new file mode 100644 index 0000000000..5943115188 --- /dev/null +++ b/types/ol/collection/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.Collection; diff --git a/types/ol/color/index.d.ts b/types/ol/color/index.d.ts new file mode 100644 index 0000000000..92407b2fa4 --- /dev/null +++ b/types/ol/color/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.color; diff --git a/types/ol/colorlike/index.d.ts b/types/ol/colorlike/index.d.ts new file mode 100644 index 0000000000..5cf7ed88a8 --- /dev/null +++ b/types/ol/colorlike/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.colorlike; diff --git a/types/ol/control/attribution.d.ts b/types/ol/control/attribution.d.ts new file mode 100644 index 0000000000..9157d3ea5e --- /dev/null +++ b/types/ol/control/attribution.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.control.Attribution; diff --git a/types/ol/control/control.d.ts b/types/ol/control/control.d.ts new file mode 100644 index 0000000000..221bc895aa --- /dev/null +++ b/types/ol/control/control.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.control.Control; diff --git a/types/ol/control/fullscreen.d.ts b/types/ol/control/fullscreen.d.ts new file mode 100644 index 0000000000..5f0112dd06 --- /dev/null +++ b/types/ol/control/fullscreen.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.control.FullScreen; diff --git a/types/ol/control/index.d.ts b/types/ol/control/index.d.ts new file mode 100644 index 0000000000..551c3303d8 --- /dev/null +++ b/types/ol/control/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.control; diff --git a/types/ol/control/mouseposition.d.ts b/types/ol/control/mouseposition.d.ts new file mode 100644 index 0000000000..f8d89d4dff --- /dev/null +++ b/types/ol/control/mouseposition.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.control.MousePosition; diff --git a/types/ol/control/overviewmap.d.ts b/types/ol/control/overviewmap.d.ts new file mode 100644 index 0000000000..60dd9b8900 --- /dev/null +++ b/types/ol/control/overviewmap.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.control.OverviewMap; diff --git a/types/ol/control/rotate.d.ts b/types/ol/control/rotate.d.ts new file mode 100644 index 0000000000..136db4ddeb --- /dev/null +++ b/types/ol/control/rotate.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.control.Rotate; diff --git a/types/ol/control/scaleline.d.ts b/types/ol/control/scaleline.d.ts new file mode 100644 index 0000000000..bbcad827f3 --- /dev/null +++ b/types/ol/control/scaleline.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.control.ScaleLine; diff --git a/types/ol/control/zoom.d.ts b/types/ol/control/zoom.d.ts new file mode 100644 index 0000000000..550d98c300 --- /dev/null +++ b/types/ol/control/zoom.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.control.Zoom; diff --git a/types/ol/control/zoomslider.d.ts b/types/ol/control/zoomslider.d.ts new file mode 100644 index 0000000000..4f5845939c --- /dev/null +++ b/types/ol/control/zoomslider.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.control.ZoomSlider; diff --git a/types/ol/control/zoomtoextent.d.ts b/types/ol/control/zoomtoextent.d.ts new file mode 100644 index 0000000000..d536325932 --- /dev/null +++ b/types/ol/control/zoomtoextent.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.control.ZoomToExtent; diff --git a/types/ol/coordinate/index.d.ts b/types/ol/coordinate/index.d.ts new file mode 100644 index 0000000000..9d95bc2f5b --- /dev/null +++ b/types/ol/coordinate/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.coordinate; diff --git a/types/ol/deviceorientation/index.d.ts b/types/ol/deviceorientation/index.d.ts new file mode 100644 index 0000000000..53ce703660 --- /dev/null +++ b/types/ol/deviceorientation/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.DeviceOrientation; diff --git a/types/ol/disposable/index.d.ts b/types/ol/disposable/index.d.ts new file mode 100644 index 0000000000..dd3aca2bff --- /dev/null +++ b/types/ol/disposable/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.Disposable; diff --git a/types/ol/easing/index.d.ts b/types/ol/easing/index.d.ts new file mode 100644 index 0000000000..28e1552f42 --- /dev/null +++ b/types/ol/easing/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.easing; diff --git a/types/ol/events/condition.d.ts b/types/ol/events/condition.d.ts new file mode 100644 index 0000000000..bb43999775 --- /dev/null +++ b/types/ol/events/condition.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.events.condition; diff --git a/types/ol/events/event.d.ts b/types/ol/events/event.d.ts new file mode 100644 index 0000000000..5aefb9f530 --- /dev/null +++ b/types/ol/events/event.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.events.Event; diff --git a/types/ol/events/eventtarget.d.ts b/types/ol/events/eventtarget.d.ts new file mode 100644 index 0000000000..898b74ee65 --- /dev/null +++ b/types/ol/events/eventtarget.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.events.EventTarget; diff --git a/types/ol/events/index.d.ts b/types/ol/events/index.d.ts new file mode 100644 index 0000000000..defc980e5a --- /dev/null +++ b/types/ol/events/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.events; diff --git a/types/ol/extent/index.d.ts b/types/ol/extent/index.d.ts new file mode 100644 index 0000000000..a4c284b29e --- /dev/null +++ b/types/ol/extent/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.extent; diff --git a/types/ol/feature/index.d.ts b/types/ol/feature/index.d.ts new file mode 100644 index 0000000000..ba86ca0ad0 --- /dev/null +++ b/types/ol/feature/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.Feature; diff --git a/types/ol/featureloader/index.d.ts b/types/ol/featureloader/index.d.ts new file mode 100644 index 0000000000..3d3d4a1105 --- /dev/null +++ b/types/ol/featureloader/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.featureloader; diff --git a/types/ol/format/esrijson.d.ts b/types/ol/format/esrijson.d.ts new file mode 100644 index 0000000000..5145422ade --- /dev/null +++ b/types/ol/format/esrijson.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.EsriJSON; diff --git a/types/ol/format/feature.d.ts b/types/ol/format/feature.d.ts new file mode 100644 index 0000000000..dc53e6709a --- /dev/null +++ b/types/ol/format/feature.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.Feature; diff --git a/types/ol/format/filter.d.ts b/types/ol/format/filter.d.ts new file mode 100644 index 0000000000..1fb2086477 --- /dev/null +++ b/types/ol/format/filter.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.filter; diff --git a/types/ol/format/geojson.d.ts b/types/ol/format/geojson.d.ts new file mode 100644 index 0000000000..d954287590 --- /dev/null +++ b/types/ol/format/geojson.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.GeoJSON; diff --git a/types/ol/format/gml2.d.ts b/types/ol/format/gml2.d.ts new file mode 100644 index 0000000000..95cdee80b7 --- /dev/null +++ b/types/ol/format/gml2.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.GML2; diff --git a/types/ol/format/gml3.d.ts b/types/ol/format/gml3.d.ts new file mode 100644 index 0000000000..416fc64c24 --- /dev/null +++ b/types/ol/format/gml3.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.GML3; diff --git a/types/ol/format/gmlbase.d.ts b/types/ol/format/gmlbase.d.ts new file mode 100644 index 0000000000..5d495bc5c0 --- /dev/null +++ b/types/ol/format/gmlbase.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.GMLBase; diff --git a/types/ol/format/gpx.d.ts b/types/ol/format/gpx.d.ts new file mode 100644 index 0000000000..3094e44275 --- /dev/null +++ b/types/ol/format/gpx.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.GPX; diff --git a/types/ol/format/igc.d.ts b/types/ol/format/igc.d.ts new file mode 100644 index 0000000000..d358419696 --- /dev/null +++ b/types/ol/format/igc.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.IGC; diff --git a/types/ol/format/jsonfeature.d.ts b/types/ol/format/jsonfeature.d.ts new file mode 100644 index 0000000000..cf76949b70 --- /dev/null +++ b/types/ol/format/jsonfeature.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.JSONFeature; diff --git a/types/ol/format/kml.d.ts b/types/ol/format/kml.d.ts new file mode 100644 index 0000000000..6f45f45005 --- /dev/null +++ b/types/ol/format/kml.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.KML; diff --git a/types/ol/format/mvt.d.ts b/types/ol/format/mvt.d.ts new file mode 100644 index 0000000000..857aaea5e7 --- /dev/null +++ b/types/ol/format/mvt.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.MVT; diff --git a/types/ol/format/osmxml.d.ts b/types/ol/format/osmxml.d.ts new file mode 100644 index 0000000000..67029aa020 --- /dev/null +++ b/types/ol/format/osmxml.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.OSMXML; diff --git a/types/ol/format/polyline.d.ts b/types/ol/format/polyline.d.ts new file mode 100644 index 0000000000..6c60d844c3 --- /dev/null +++ b/types/ol/format/polyline.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.Polyline; diff --git a/types/ol/format/textfeature.d.ts b/types/ol/format/textfeature.d.ts new file mode 100644 index 0000000000..13c50b8f80 --- /dev/null +++ b/types/ol/format/textfeature.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.TextFeature; diff --git a/types/ol/format/topojson.d.ts b/types/ol/format/topojson.d.ts new file mode 100644 index 0000000000..af1258d5a2 --- /dev/null +++ b/types/ol/format/topojson.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.TopoJSON; diff --git a/types/ol/format/wfs.d.ts b/types/ol/format/wfs.d.ts new file mode 100644 index 0000000000..b2ee31971a --- /dev/null +++ b/types/ol/format/wfs.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.WFS; diff --git a/types/ol/format/wkt.d.ts b/types/ol/format/wkt.d.ts new file mode 100644 index 0000000000..68bfbee10f --- /dev/null +++ b/types/ol/format/wkt.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.WKT; diff --git a/types/ol/format/wmscapabilities.d.ts b/types/ol/format/wmscapabilities.d.ts new file mode 100644 index 0000000000..c727c689c6 --- /dev/null +++ b/types/ol/format/wmscapabilities.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.WMSCapabilities; diff --git a/types/ol/format/wmsgetfeatureinfo.d.ts b/types/ol/format/wmsgetfeatureinfo.d.ts new file mode 100644 index 0000000000..6aaffa7b5e --- /dev/null +++ b/types/ol/format/wmsgetfeatureinfo.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.WMSGetFeatureInfo; diff --git a/types/ol/format/wmtscapabilities.d.ts b/types/ol/format/wmtscapabilities.d.ts new file mode 100644 index 0000000000..c17cdf8f2d --- /dev/null +++ b/types/ol/format/wmtscapabilities.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.WMTSCapabilities; diff --git a/types/ol/format/xml.d.ts b/types/ol/format/xml.d.ts new file mode 100644 index 0000000000..4032d4758e --- /dev/null +++ b/types/ol/format/xml.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.XML; diff --git a/types/ol/format/xmlfeature.d.ts b/types/ol/format/xmlfeature.d.ts new file mode 100644 index 0000000000..28b544565b --- /dev/null +++ b/types/ol/format/xmlfeature.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.format.XMLFeature; diff --git a/types/ol/geolocation/index.d.ts b/types/ol/geolocation/index.d.ts new file mode 100644 index 0000000000..a08c095e0c --- /dev/null +++ b/types/ol/geolocation/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.Geolocation; diff --git a/types/ol/geom/circle.d.ts b/types/ol/geom/circle.d.ts new file mode 100644 index 0000000000..48abeeed8e --- /dev/null +++ b/types/ol/geom/circle.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.geom.Circle; diff --git a/types/ol/geom/geometry.d.ts b/types/ol/geom/geometry.d.ts new file mode 100644 index 0000000000..59f0ba50d9 --- /dev/null +++ b/types/ol/geom/geometry.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.geom.Geometry; diff --git a/types/ol/geom/geometrycollection.d.ts b/types/ol/geom/geometrycollection.d.ts new file mode 100644 index 0000000000..d8aaddefbf --- /dev/null +++ b/types/ol/geom/geometrycollection.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.geom.GeometryCollection; diff --git a/types/ol/geom/linearring.d.ts b/types/ol/geom/linearring.d.ts new file mode 100644 index 0000000000..4341aa8780 --- /dev/null +++ b/types/ol/geom/linearring.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.geom.LinearRing; diff --git a/types/ol/geom/linestring.d.ts b/types/ol/geom/linestring.d.ts new file mode 100644 index 0000000000..8f58f85ff4 --- /dev/null +++ b/types/ol/geom/linestring.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.geom.LineString; diff --git a/types/ol/geom/multilinestring.d.ts b/types/ol/geom/multilinestring.d.ts new file mode 100644 index 0000000000..b9c3de266e --- /dev/null +++ b/types/ol/geom/multilinestring.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.geom.MultiLineString; diff --git a/types/ol/geom/multipoint.d.ts b/types/ol/geom/multipoint.d.ts new file mode 100644 index 0000000000..1846edddb5 --- /dev/null +++ b/types/ol/geom/multipoint.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.geom.MultiPoint; diff --git a/types/ol/geom/multipolygon.d.ts b/types/ol/geom/multipolygon.d.ts new file mode 100644 index 0000000000..9a058fac0f --- /dev/null +++ b/types/ol/geom/multipolygon.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.geom.MultiPolygon; diff --git a/types/ol/geom/point.d.ts b/types/ol/geom/point.d.ts new file mode 100644 index 0000000000..0c8bf8e7d8 --- /dev/null +++ b/types/ol/geom/point.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.geom.Point; diff --git a/types/ol/geom/polygon.d.ts b/types/ol/geom/polygon.d.ts new file mode 100644 index 0000000000..67351267ed --- /dev/null +++ b/types/ol/geom/polygon.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.geom.Polygon; diff --git a/types/ol/geom/simplegeometry.d.ts b/types/ol/geom/simplegeometry.d.ts new file mode 100644 index 0000000000..20695d2bb1 --- /dev/null +++ b/types/ol/geom/simplegeometry.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.geom.SimpleGeometry; diff --git a/types/ol/graticule/index.d.ts b/types/ol/graticule/index.d.ts new file mode 100644 index 0000000000..97bd1e8e2d --- /dev/null +++ b/types/ol/graticule/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.Graticule; diff --git a/types/ol/image/index.d.ts b/types/ol/image/index.d.ts new file mode 100644 index 0000000000..5a4c9a304b --- /dev/null +++ b/types/ol/image/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.Image; diff --git a/types/ol/imagebase/index.d.ts b/types/ol/imagebase/index.d.ts new file mode 100644 index 0000000000..91e7971e27 --- /dev/null +++ b/types/ol/imagebase/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.ImageBase; diff --git a/types/ol/imagetile/index.d.ts b/types/ol/imagetile/index.d.ts new file mode 100644 index 0000000000..57b9b1c9fa --- /dev/null +++ b/types/ol/imagetile/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.ImageTile; diff --git a/types/ol/index.d.ts b/types/ol/index.d.ts new file mode 100644 index 0000000000..947423f2aa --- /dev/null +++ b/types/ol/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for ol 4.6 +// Project: https://github.com/openlayers/openlayers/tree/master/package#readme +// Definitions by: Yair Tawil +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +import * as ol from 'openlayers'; + +export default ol; diff --git a/types/ol/interaction/doubleclickzoom.d.ts b/types/ol/interaction/doubleclickzoom.d.ts new file mode 100644 index 0000000000..3982ba3b7f --- /dev/null +++ b/types/ol/interaction/doubleclickzoom.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.interaction.DoubleClickZoom; diff --git a/types/ol/interaction/draganddrop.d.ts b/types/ol/interaction/draganddrop.d.ts new file mode 100644 index 0000000000..bbfbbeb727 --- /dev/null +++ b/types/ol/interaction/draganddrop.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.interaction.DragAndDrop; diff --git a/types/ol/interaction/dragbox.d.ts b/types/ol/interaction/dragbox.d.ts new file mode 100644 index 0000000000..dbb06b7a18 --- /dev/null +++ b/types/ol/interaction/dragbox.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.interaction.DragBox; diff --git a/types/ol/interaction/dragpan.d.ts b/types/ol/interaction/dragpan.d.ts new file mode 100644 index 0000000000..e9c14d7b5d --- /dev/null +++ b/types/ol/interaction/dragpan.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.interaction.DragPan; diff --git a/types/ol/interaction/dragrotate.d.ts b/types/ol/interaction/dragrotate.d.ts new file mode 100644 index 0000000000..31ebec3772 --- /dev/null +++ b/types/ol/interaction/dragrotate.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.interaction.DragRotate; diff --git a/types/ol/interaction/dragrotateandzoom.d.ts b/types/ol/interaction/dragrotateandzoom.d.ts new file mode 100644 index 0000000000..6b8a2979e1 --- /dev/null +++ b/types/ol/interaction/dragrotateandzoom.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.interaction.DragRotateAndZoom; diff --git a/types/ol/interaction/dragzoom.d.ts b/types/ol/interaction/dragzoom.d.ts new file mode 100644 index 0000000000..c0e0413b21 --- /dev/null +++ b/types/ol/interaction/dragzoom.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.interaction.DragZoom; diff --git a/types/ol/interaction/draw.d.ts b/types/ol/interaction/draw.d.ts new file mode 100644 index 0000000000..d7e1318f69 --- /dev/null +++ b/types/ol/interaction/draw.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.interaction.Draw; diff --git a/types/ol/interaction/index.d.ts b/types/ol/interaction/index.d.ts new file mode 100644 index 0000000000..6ef5898695 --- /dev/null +++ b/types/ol/interaction/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.interaction; diff --git a/types/ol/interaction/interaction.d.ts b/types/ol/interaction/interaction.d.ts new file mode 100644 index 0000000000..9eb1c46525 --- /dev/null +++ b/types/ol/interaction/interaction.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.interaction.Interaction; diff --git a/types/ol/interaction/keyboardpan.d.ts b/types/ol/interaction/keyboardpan.d.ts new file mode 100644 index 0000000000..5c32c8dfa3 --- /dev/null +++ b/types/ol/interaction/keyboardpan.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.interaction.KeyboardPan; diff --git a/types/ol/interaction/keyboardzoom.d.ts b/types/ol/interaction/keyboardzoom.d.ts new file mode 100644 index 0000000000..e52bf705eb --- /dev/null +++ b/types/ol/interaction/keyboardzoom.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.interaction.KeyboardZoom; diff --git a/types/ol/interaction/modify.d.ts b/types/ol/interaction/modify.d.ts new file mode 100644 index 0000000000..8079ab0ba5 --- /dev/null +++ b/types/ol/interaction/modify.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.interaction.Modify; diff --git a/types/ol/interaction/mousewheelzoom.d.ts b/types/ol/interaction/mousewheelzoom.d.ts new file mode 100644 index 0000000000..d8a5223153 --- /dev/null +++ b/types/ol/interaction/mousewheelzoom.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.interaction.MouseWheelZoom; diff --git a/types/ol/interaction/pinchrotate.d.ts b/types/ol/interaction/pinchrotate.d.ts new file mode 100644 index 0000000000..b10400ce30 --- /dev/null +++ b/types/ol/interaction/pinchrotate.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.interaction.PinchRotate; diff --git a/types/ol/interaction/pinchzoom.d.ts b/types/ol/interaction/pinchzoom.d.ts new file mode 100644 index 0000000000..0d666096c2 --- /dev/null +++ b/types/ol/interaction/pinchzoom.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.interaction.PinchZoom; diff --git a/types/ol/interaction/pointer.d.ts b/types/ol/interaction/pointer.d.ts new file mode 100644 index 0000000000..22936f602a --- /dev/null +++ b/types/ol/interaction/pointer.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.interaction.Pointer; diff --git a/types/ol/interaction/select.d.ts b/types/ol/interaction/select.d.ts new file mode 100644 index 0000000000..fe8c16b4b9 --- /dev/null +++ b/types/ol/interaction/select.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.interaction.Select; diff --git a/types/ol/interaction/snap.d.ts b/types/ol/interaction/snap.d.ts new file mode 100644 index 0000000000..90a7fee1bb --- /dev/null +++ b/types/ol/interaction/snap.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.interaction.Snap; diff --git a/types/ol/interaction/translate.d.ts b/types/ol/interaction/translate.d.ts new file mode 100644 index 0000000000..b035bae021 --- /dev/null +++ b/types/ol/interaction/translate.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.interaction.Translate; diff --git a/types/ol/kinetic/index.d.ts b/types/ol/kinetic/index.d.ts new file mode 100644 index 0000000000..ba283fca68 --- /dev/null +++ b/types/ol/kinetic/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.Kinetic; diff --git a/types/ol/layer/base.d.ts b/types/ol/layer/base.d.ts new file mode 100644 index 0000000000..25c11c8edd --- /dev/null +++ b/types/ol/layer/base.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.layer.Base; diff --git a/types/ol/layer/group.d.ts b/types/ol/layer/group.d.ts new file mode 100644 index 0000000000..b3669bc387 --- /dev/null +++ b/types/ol/layer/group.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.layer.Group; diff --git a/types/ol/layer/heatmap.d.ts b/types/ol/layer/heatmap.d.ts new file mode 100644 index 0000000000..4b4f112642 --- /dev/null +++ b/types/ol/layer/heatmap.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.layer.Heatmap; diff --git a/types/ol/layer/image.d.ts b/types/ol/layer/image.d.ts new file mode 100644 index 0000000000..34a862498e --- /dev/null +++ b/types/ol/layer/image.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.layer.Image; diff --git a/types/ol/layer/layer.d.ts b/types/ol/layer/layer.d.ts new file mode 100644 index 0000000000..38c31c927f --- /dev/null +++ b/types/ol/layer/layer.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.layer.Layer; diff --git a/types/ol/layer/tile.d.ts b/types/ol/layer/tile.d.ts new file mode 100644 index 0000000000..bbd95be84d --- /dev/null +++ b/types/ol/layer/tile.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.layer.Tile; diff --git a/types/ol/layer/vector.d.ts b/types/ol/layer/vector.d.ts new file mode 100644 index 0000000000..f26e2a3bf5 --- /dev/null +++ b/types/ol/layer/vector.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.layer.Vector; diff --git a/types/ol/layer/vectortile.d.ts b/types/ol/layer/vectortile.d.ts new file mode 100644 index 0000000000..27ac70d8c3 --- /dev/null +++ b/types/ol/layer/vectortile.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.layer.VectorTile; diff --git a/types/ol/loadingstrategy/index.d.ts b/types/ol/loadingstrategy/index.d.ts new file mode 100644 index 0000000000..9b3d8bff3b --- /dev/null +++ b/types/ol/loadingstrategy/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.loadingstrategy; diff --git a/types/ol/map/index.d.ts b/types/ol/map/index.d.ts new file mode 100644 index 0000000000..58f635d45a --- /dev/null +++ b/types/ol/map/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.Map; diff --git a/types/ol/mapbrowserevent/index.d.ts b/types/ol/mapbrowserevent/index.d.ts new file mode 100644 index 0000000000..048fc22481 --- /dev/null +++ b/types/ol/mapbrowserevent/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.MapBrowserEvent; diff --git a/types/ol/mapbrowserpointerevent/index.d.ts b/types/ol/mapbrowserpointerevent/index.d.ts new file mode 100644 index 0000000000..616325e218 --- /dev/null +++ b/types/ol/mapbrowserpointerevent/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.MapBrowserPointerEvent; diff --git a/types/ol/mapevent/index.d.ts b/types/ol/mapevent/index.d.ts new file mode 100644 index 0000000000..6e7487ec29 --- /dev/null +++ b/types/ol/mapevent/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.MapEvent; diff --git a/types/ol/object/index.d.ts b/types/ol/object/index.d.ts new file mode 100644 index 0000000000..e4580cd0ce --- /dev/null +++ b/types/ol/object/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.Object; diff --git a/types/ol/observable/index.d.ts b/types/ol/observable/index.d.ts new file mode 100644 index 0000000000..09489e7382 --- /dev/null +++ b/types/ol/observable/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.Observable; diff --git a/types/ol/ol-tests.ts b/types/ol/ol-tests.ts new file mode 100644 index 0000000000..13a36df6f3 --- /dev/null +++ b/types/ol/ol-tests.ts @@ -0,0 +1,323 @@ +import ControlAttribution from 'ol/control/attribution'; + +import ControlControl from 'ol/control/control'; + +import ControlFullScreen from 'ol/control/fullscreen'; + +import ControlMousePosition from 'ol/control/mouseposition'; + +import ControlOverviewMap from 'ol/control/overviewmap'; + +import ControlRotate from 'ol/control/rotate'; + +import ControlScaleLine from 'ol/control/scaleline'; + +import ControlZoom from 'ol/control/zoom'; + +import ControlZoomSlider from 'ol/control/zoomslider'; + +import ControlZoomToExtent from 'ol/control/zoomtoextent'; + +import Eventscondition from 'ol/events/condition'; + +import EventsEvent from 'ol/events/event'; + +import EventsEventTarget from 'ol/events/eventtarget'; + +import FormatEsriJSON from 'ol/format/esrijson'; + +import FormatFeature from 'ol/format/feature'; + +import Formatfilter from 'ol/format/filter'; + +import FormatGeoJSON from 'ol/format/geojson'; + +import FormatGML2 from 'ol/format/gml2'; + +import FormatGML3 from 'ol/format/gml3'; + +import FormatGMLBase from 'ol/format/gmlbase'; + +import FormatGPX from 'ol/format/gpx'; + +import FormatIGC from 'ol/format/igc'; + +import FormatJSONFeature from 'ol/format/jsonfeature'; + +import FormatKML from 'ol/format/kml'; + +import FormatMVT from 'ol/format/mvt'; + +import FormatOSMXML from 'ol/format/osmxml'; + +import FormatPolyline from 'ol/format/polyline'; + +import FormatTextFeature from 'ol/format/textfeature'; + +import FormatTopoJSON from 'ol/format/topojson'; + +import FormatWFS from 'ol/format/wfs'; + +import FormatWKT from 'ol/format/wkt'; + +import FormatWMSCapabilities from 'ol/format/wmscapabilities'; + +import FormatWMSGetFeatureInfo from 'ol/format/wmsgetfeatureinfo'; + +import FormatWMTSCapabilities from 'ol/format/wmtscapabilities'; + +import FormatXML from 'ol/format/xml'; + +import FormatXMLFeature from 'ol/format/xmlfeature'; + +import GeomCircle from 'ol/geom/circle'; + +import GeomGeometry from 'ol/geom/geometry'; + +import GeomGeometryCollection from 'ol/geom/geometrycollection'; + +import GeomLinearRing from 'ol/geom/linearring'; + +import GeomLineString from 'ol/geom/linestring'; + +import GeomMultiLineString from 'ol/geom/multilinestring'; + +import GeomMultiPoint from 'ol/geom/multipoint'; + +import GeomMultiPolygon from 'ol/geom/multipolygon'; + +import GeomPoint from 'ol/geom/point'; + +import GeomPolygon from 'ol/geom/polygon'; + +import GeomSimpleGeometry from 'ol/geom/simplegeometry'; + +import InteractionDoubleClickZoom from 'ol/interaction/doubleclickzoom'; + +import InteractionDragAndDrop from 'ol/interaction/draganddrop'; + +import InteractionDragBox from 'ol/interaction/dragbox'; + +import InteractionDragPan from 'ol/interaction/dragpan'; + +import InteractionDragRotate from 'ol/interaction/dragrotate'; + +import InteractionDragRotateAndZoom from 'ol/interaction/dragrotateandzoom'; + +import InteractionDragZoom from 'ol/interaction/dragzoom'; + +import InteractionDraw from 'ol/interaction/draw'; + +import InteractionInteraction from 'ol/interaction/interaction'; + +import InteractionKeyboardPan from 'ol/interaction/keyboardpan'; + +import InteractionKeyboardZoom from 'ol/interaction/keyboardzoom'; + +import InteractionModify from 'ol/interaction/modify'; + +import InteractionMouseWheelZoom from 'ol/interaction/mousewheelzoom'; + +import InteractionPinchRotate from 'ol/interaction/pinchrotate'; + +import InteractionPinchZoom from 'ol/interaction/pinchzoom'; + +import InteractionPointer from 'ol/interaction/pointer'; + +import InteractionSelect from 'ol/interaction/select'; + +import InteractionSnap from 'ol/interaction/snap'; + +import InteractionTranslate from 'ol/interaction/translate'; + +import LayerBase from 'ol/layer/base'; + +import LayerGroup from 'ol/layer/group'; + +import LayerHeatmap from 'ol/layer/heatmap'; + +import LayerImage from 'ol/layer/image'; + +import LayerLayer from 'ol/layer/layer'; + +import LayerTile from 'ol/layer/tile'; + +import LayerVector from 'ol/layer/vector'; + +import LayerVectorTile from 'ol/layer/vectortile'; + +import PointerPointerEvent from 'ol/pointer/pointerevent'; + +import ProjProjection from 'ol/proj/projection'; + +import Rendercanvas from 'ol/render/canvas'; + +import RenderEvent from 'ol/render/event'; + +import RenderFeature from 'ol/render/feature'; + +import RenderVectorContext from 'ol/render/vectorcontext'; + +import SourceBingMaps from 'ol/source/bingmaps'; + +import SourceCartoDB from 'ol/source/cartodb'; + +import SourceCluster from 'ol/source/cluster'; + +import SourceImage from 'ol/source/image'; + +import SourceImageArcGISRest from 'ol/source/imagearcgisrest'; + +import SourceImageCanvas from 'ol/source/imagecanvas'; + +import SourceImageMapGuide from 'ol/source/imagemapguide'; + +import SourceImageStatic from 'ol/source/imagestatic'; + +import SourceImageVector from 'ol/source/imagevector'; + +import SourceImageWMS from 'ol/source/imagewms'; + +import SourceOSM from 'ol/source/osm'; + +import SourceRaster from 'ol/source/raster'; + +import SourceSource from 'ol/source/source'; + +import SourceStamen from 'ol/source/stamen'; + +import SourceTile from 'ol/source/tile'; + +import SourceTileArcGISRest from 'ol/source/tilearcgisrest'; + +import SourceTileDebug from 'ol/source/tiledebug'; + +import SourceTileImage from 'ol/source/tileimage'; + +import SourceTileJSON from 'ol/source/tilejson'; + +import SourceTileUTFGrid from 'ol/source/tileutfgrid'; + +import SourceTileWMS from 'ol/source/tilewms'; + +import SourceUrlTile from 'ol/source/urltile'; + +import SourceVector from 'ol/source/vector'; + +import SourceVectorTile from 'ol/source/vectortile'; + +import SourceWMTS from 'ol/source/wmts'; + +import SourceXYZ from 'ol/source/xyz'; + +import SourceZoomify from 'ol/source/zoomify'; + +import StyleAtlasManager from 'ol/style/atlasmanager'; + +import StyleCircle from 'ol/style/circle'; + +import StyleFill from 'ol/style/fill'; + +import StyleIcon from 'ol/style/icon'; + +import StyleImage from 'ol/style/image'; + +import StyleRegularShape from 'ol/style/regularshape'; + +import StyleStroke from 'ol/style/stroke'; + +import StyleStyle from 'ol/style/style'; + +import StyleText from 'ol/style/text'; + +import TilegridTileGrid from 'ol/tilegrid/tilegrid'; + +import TilegridWMTS from 'ol/tilegrid/wmts'; + +import AssertionError from 'ol/assertionerror'; + +import Attribution from 'ol/attribution'; + +import Collection from 'ol/collection'; + +import Color from 'ol/color'; + +import Colorlike from 'ol/colorlike'; + +import Control from 'ol/control'; + +import DeviceOrientation from 'ol/deviceorientation'; + +import Disposable from 'ol/disposable'; + +import Easing from 'ol/easing'; + +import Events from 'ol/events'; + +import Extent from 'ol/extent'; + +import Feature from 'ol/feature'; + +import FeatureLoader from 'ol/featureloader'; + +import Geolocation from 'ol/geolocation'; + +import Graticule from 'ol/graticule'; + +import Image from 'ol/image'; + +import ImageBase from 'ol/imagebase'; + +import ImageTile from 'ol/imagetile'; + +import Interaction from 'ol/interaction'; + +import Kinetic from 'ol/kinetic'; + +import Loadingstrategy from 'ol/loadingstrategy'; + +import Map from 'ol/map'; + +import MapBrowserEvent from 'ol/mapbrowserevent'; + +import MapBrowserPointerEvent from 'ol/mapbrowserpointerevent'; + +import MapEvent from 'ol/mapevent'; + +import Object from 'ol/object'; + +import Observable from 'ol/observable'; + +import Overlay from 'ol/overlay'; + +import Sphere from 'ol/sphere'; + +import Tile from 'ol/tile'; + +import Tilegrid from 'ol/tilegrid'; + +import VectorTile from 'ol/vectortile'; + +import View from 'ol/view'; + +// Map +const map: ol.Map = new Map( {}); +const mapView: View = {}; +const layerBase: LayerBase = {}; +const control: ControlControl = {}; +const interaction: InteractionInteraction = {}; +map.setView(mapView); +map.addLayer(layerBase); +map.addControl(control); +map.addInteraction(interaction); + +// View +let view: View; +const coordinate: ol.Coordinate = {}; +const size: ol.Size = {}; +const position: ol.Pixel = {}; +view = map.getView(); +view.getProjection(); +view.animate( {}); +view.calculateExtent( 'size'); +view.centerOn(coordinate, size, position); diff --git a/types/ol/overlay/index.d.ts b/types/ol/overlay/index.d.ts new file mode 100644 index 0000000000..d350f1c828 --- /dev/null +++ b/types/ol/overlay/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.Overlay; diff --git a/types/ol/pointer/pointerevent.d.ts b/types/ol/pointer/pointerevent.d.ts new file mode 100644 index 0000000000..62e84e6207 --- /dev/null +++ b/types/ol/pointer/pointerevent.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.pointer.PointerEvent; diff --git a/types/ol/proj/projection.d.ts b/types/ol/proj/projection.d.ts new file mode 100644 index 0000000000..26050bb377 --- /dev/null +++ b/types/ol/proj/projection.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.proj.Projection; diff --git a/types/ol/render/canvas.d.ts b/types/ol/render/canvas.d.ts new file mode 100644 index 0000000000..9e6d06eca6 --- /dev/null +++ b/types/ol/render/canvas.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.render.canvas; diff --git a/types/ol/render/event.d.ts b/types/ol/render/event.d.ts new file mode 100644 index 0000000000..981b821b5e --- /dev/null +++ b/types/ol/render/event.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.render.Event; diff --git a/types/ol/render/feature.d.ts b/types/ol/render/feature.d.ts new file mode 100644 index 0000000000..95e4831fba --- /dev/null +++ b/types/ol/render/feature.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.render.Feature; diff --git a/types/ol/render/vectorcontext.d.ts b/types/ol/render/vectorcontext.d.ts new file mode 100644 index 0000000000..b3e287c91b --- /dev/null +++ b/types/ol/render/vectorcontext.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.render.VectorContext; diff --git a/types/ol/source/bingmaps.d.ts b/types/ol/source/bingmaps.d.ts new file mode 100644 index 0000000000..963623bc7e --- /dev/null +++ b/types/ol/source/bingmaps.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.BingMaps; diff --git a/types/ol/source/cartodb.d.ts b/types/ol/source/cartodb.d.ts new file mode 100644 index 0000000000..28b44ebc4c --- /dev/null +++ b/types/ol/source/cartodb.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.CartoDB; diff --git a/types/ol/source/cluster.d.ts b/types/ol/source/cluster.d.ts new file mode 100644 index 0000000000..0a793ed0b2 --- /dev/null +++ b/types/ol/source/cluster.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.Cluster; diff --git a/types/ol/source/image.d.ts b/types/ol/source/image.d.ts new file mode 100644 index 0000000000..82071b1636 --- /dev/null +++ b/types/ol/source/image.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.Image; diff --git a/types/ol/source/imagearcgisrest.d.ts b/types/ol/source/imagearcgisrest.d.ts new file mode 100644 index 0000000000..ae296156cd --- /dev/null +++ b/types/ol/source/imagearcgisrest.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.ImageArcGISRest; diff --git a/types/ol/source/imagecanvas.d.ts b/types/ol/source/imagecanvas.d.ts new file mode 100644 index 0000000000..cbfee5d9d5 --- /dev/null +++ b/types/ol/source/imagecanvas.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.ImageCanvas; diff --git a/types/ol/source/imagemapguide.d.ts b/types/ol/source/imagemapguide.d.ts new file mode 100644 index 0000000000..42877b1052 --- /dev/null +++ b/types/ol/source/imagemapguide.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.ImageMapGuide; diff --git a/types/ol/source/imagestatic.d.ts b/types/ol/source/imagestatic.d.ts new file mode 100644 index 0000000000..02a6d37e50 --- /dev/null +++ b/types/ol/source/imagestatic.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.ImageStatic; diff --git a/types/ol/source/imagevector.d.ts b/types/ol/source/imagevector.d.ts new file mode 100644 index 0000000000..2f1ae17a2d --- /dev/null +++ b/types/ol/source/imagevector.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.ImageVector; diff --git a/types/ol/source/imagewms.d.ts b/types/ol/source/imagewms.d.ts new file mode 100644 index 0000000000..0aeb5fb39c --- /dev/null +++ b/types/ol/source/imagewms.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.ImageWMS; diff --git a/types/ol/source/osm.d.ts b/types/ol/source/osm.d.ts new file mode 100644 index 0000000000..68b03db843 --- /dev/null +++ b/types/ol/source/osm.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.OSM; diff --git a/types/ol/source/raster.d.ts b/types/ol/source/raster.d.ts new file mode 100644 index 0000000000..de39ec8fce --- /dev/null +++ b/types/ol/source/raster.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.Raster; diff --git a/types/ol/source/source.d.ts b/types/ol/source/source.d.ts new file mode 100644 index 0000000000..379f73e579 --- /dev/null +++ b/types/ol/source/source.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.Source; diff --git a/types/ol/source/stamen.d.ts b/types/ol/source/stamen.d.ts new file mode 100644 index 0000000000..51d6d42006 --- /dev/null +++ b/types/ol/source/stamen.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.Stamen; diff --git a/types/ol/source/tile.d.ts b/types/ol/source/tile.d.ts new file mode 100644 index 0000000000..7c7cb3d874 --- /dev/null +++ b/types/ol/source/tile.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.Tile; diff --git a/types/ol/source/tilearcgisrest.d.ts b/types/ol/source/tilearcgisrest.d.ts new file mode 100644 index 0000000000..45f7f529ff --- /dev/null +++ b/types/ol/source/tilearcgisrest.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.TileArcGISRest; diff --git a/types/ol/source/tiledebug.d.ts b/types/ol/source/tiledebug.d.ts new file mode 100644 index 0000000000..f09371a620 --- /dev/null +++ b/types/ol/source/tiledebug.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.TileDebug; diff --git a/types/ol/source/tileimage.d.ts b/types/ol/source/tileimage.d.ts new file mode 100644 index 0000000000..bd3bf922b4 --- /dev/null +++ b/types/ol/source/tileimage.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.TileImage; diff --git a/types/ol/source/tilejson.d.ts b/types/ol/source/tilejson.d.ts new file mode 100644 index 0000000000..c9d52d2903 --- /dev/null +++ b/types/ol/source/tilejson.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.TileJSON; diff --git a/types/ol/source/tileutfgrid.d.ts b/types/ol/source/tileutfgrid.d.ts new file mode 100644 index 0000000000..17ae2022a2 --- /dev/null +++ b/types/ol/source/tileutfgrid.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.TileUTFGrid; diff --git a/types/ol/source/tilewms.d.ts b/types/ol/source/tilewms.d.ts new file mode 100644 index 0000000000..7ae163f2c5 --- /dev/null +++ b/types/ol/source/tilewms.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.TileWMS; diff --git a/types/ol/source/urltile.d.ts b/types/ol/source/urltile.d.ts new file mode 100644 index 0000000000..606583cac4 --- /dev/null +++ b/types/ol/source/urltile.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.UrlTile; diff --git a/types/ol/source/vector.d.ts b/types/ol/source/vector.d.ts new file mode 100644 index 0000000000..ee2d968d28 --- /dev/null +++ b/types/ol/source/vector.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.Vector; diff --git a/types/ol/source/vectortile.d.ts b/types/ol/source/vectortile.d.ts new file mode 100644 index 0000000000..1aa59678d3 --- /dev/null +++ b/types/ol/source/vectortile.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.VectorTile; diff --git a/types/ol/source/wmts.d.ts b/types/ol/source/wmts.d.ts new file mode 100644 index 0000000000..afdc2c352b --- /dev/null +++ b/types/ol/source/wmts.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.WMTS; diff --git a/types/ol/source/xyz.d.ts b/types/ol/source/xyz.d.ts new file mode 100644 index 0000000000..d29b5f9e06 --- /dev/null +++ b/types/ol/source/xyz.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.XYZ; diff --git a/types/ol/source/zoomify.d.ts b/types/ol/source/zoomify.d.ts new file mode 100644 index 0000000000..a48e675012 --- /dev/null +++ b/types/ol/source/zoomify.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.source.Zoomify; diff --git a/types/ol/sphere/index.d.ts b/types/ol/sphere/index.d.ts new file mode 100644 index 0000000000..a3481e4339 --- /dev/null +++ b/types/ol/sphere/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.Sphere; diff --git a/types/ol/style/atlasmanager.d.ts b/types/ol/style/atlasmanager.d.ts new file mode 100644 index 0000000000..0be77a6621 --- /dev/null +++ b/types/ol/style/atlasmanager.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.style.AtlasManager; diff --git a/types/ol/style/circle.d.ts b/types/ol/style/circle.d.ts new file mode 100644 index 0000000000..ff593230b5 --- /dev/null +++ b/types/ol/style/circle.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.style.Circle; diff --git a/types/ol/style/fill.d.ts b/types/ol/style/fill.d.ts new file mode 100644 index 0000000000..ef6b246ad5 --- /dev/null +++ b/types/ol/style/fill.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.style.Fill; diff --git a/types/ol/style/icon.d.ts b/types/ol/style/icon.d.ts new file mode 100644 index 0000000000..4100f3fbf8 --- /dev/null +++ b/types/ol/style/icon.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.style.Icon; diff --git a/types/ol/style/image.d.ts b/types/ol/style/image.d.ts new file mode 100644 index 0000000000..bdfb4319e3 --- /dev/null +++ b/types/ol/style/image.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.style.Image; diff --git a/types/ol/style/regularshape.d.ts b/types/ol/style/regularshape.d.ts new file mode 100644 index 0000000000..fb4a227d1d --- /dev/null +++ b/types/ol/style/regularshape.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.style.RegularShape; diff --git a/types/ol/style/stroke.d.ts b/types/ol/style/stroke.d.ts new file mode 100644 index 0000000000..af7a49d6b5 --- /dev/null +++ b/types/ol/style/stroke.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.style.Stroke; diff --git a/types/ol/style/style.d.ts b/types/ol/style/style.d.ts new file mode 100644 index 0000000000..839583e313 --- /dev/null +++ b/types/ol/style/style.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.style.Style; diff --git a/types/ol/style/text.d.ts b/types/ol/style/text.d.ts new file mode 100644 index 0000000000..33d1b50962 --- /dev/null +++ b/types/ol/style/text.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.style.Text; diff --git a/types/ol/tile/index.d.ts b/types/ol/tile/index.d.ts new file mode 100644 index 0000000000..61e802d921 --- /dev/null +++ b/types/ol/tile/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.Tile; diff --git a/types/ol/tilegrid/index.d.ts b/types/ol/tilegrid/index.d.ts new file mode 100644 index 0000000000..467e92480f --- /dev/null +++ b/types/ol/tilegrid/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.tilegrid; diff --git a/types/ol/tilegrid/tilegrid.d.ts b/types/ol/tilegrid/tilegrid.d.ts new file mode 100644 index 0000000000..b6edeba4aa --- /dev/null +++ b/types/ol/tilegrid/tilegrid.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.tilegrid.TileGrid; diff --git a/types/ol/tilegrid/wmts.d.ts b/types/ol/tilegrid/wmts.d.ts new file mode 100644 index 0000000000..3f1f33e647 --- /dev/null +++ b/types/ol/tilegrid/wmts.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.tilegrid.WMTS; diff --git a/types/ol/tsconfig.json b/types/ol/tsconfig.json new file mode 100644 index 0000000000..4c7846cda7 --- /dev/null +++ b/types/ol/tsconfig.json @@ -0,0 +1,177 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "ol-tests.ts", + "control/attribution.d.ts", + "control/control.d.ts", + "control/fullscreen.d.ts", + "control/mouseposition.d.ts", + "control/overviewmap.d.ts", + "control/rotate.d.ts", + "control/scaleline.d.ts", + "control/zoom.d.ts", + "control/zoomslider.d.ts", + "control/zoomtoextent.d.ts", + "events/condition.d.ts", + "events/event.d.ts", + "events/eventtarget.d.ts", + "format/esrijson.d.ts", + "format/feature.d.ts", + "format/filter.d.ts", + "format/geojson.d.ts", + "format/gml2.d.ts", + "format/gml3.d.ts", + "format/gmlbase.d.ts", + "format/gpx.d.ts", + "format/igc.d.ts", + "format/jsonfeature.d.ts", + "format/kml.d.ts", + "format/mvt.d.ts", + "format/osmxml.d.ts", + "format/polyline.d.ts", + "format/textfeature.d.ts", + "format/topojson.d.ts", + "format/wfs.d.ts", + "format/wkt.d.ts", + "format/wmscapabilities.d.ts", + "format/wmsgetfeatureinfo.d.ts", + "format/wmtscapabilities.d.ts", + "format/xml.d.ts", + "format/xmlfeature.d.ts", + "geom/circle.d.ts", + "geom/geometry.d.ts", + "geom/geometrycollection.d.ts", + "geom/linearring.d.ts", + "geom/linestring.d.ts", + "geom/multilinestring.d.ts", + "geom/multipoint.d.ts", + "geom/multipolygon.d.ts", + "geom/point.d.ts", + "geom/polygon.d.ts", + "geom/simplegeometry.d.ts", + "interaction/doubleclickzoom.d.ts", + "interaction/draganddrop.d.ts", + "interaction/dragbox.d.ts", + "interaction/dragpan.d.ts", + "interaction/dragrotate.d.ts", + "interaction/dragrotateandzoom.d.ts", + "interaction/dragzoom.d.ts", + "interaction/draw.d.ts", + "interaction/interaction.d.ts", + "interaction/keyboardpan.d.ts", + "interaction/keyboardzoom.d.ts", + "interaction/modify.d.ts", + "interaction/mousewheelzoom.d.ts", + "interaction/pinchrotate.d.ts", + "interaction/pinchzoom.d.ts", + "interaction/pointer.d.ts", + "interaction/select.d.ts", + "interaction/snap.d.ts", + "interaction/translate.d.ts", + "layer/base.d.ts", + "layer/group.d.ts", + "layer/heatmap.d.ts", + "layer/image.d.ts", + "layer/layer.d.ts", + "layer/tile.d.ts", + "layer/vector.d.ts", + "layer/vectortile.d.ts", + "pointer/pointerevent.d.ts", + "proj/projection.d.ts", + "render/canvas.d.ts", + "render/event.d.ts", + "render/feature.d.ts", + "render/vectorcontext.d.ts", + "source/bingmaps.d.ts", + "source/cartodb.d.ts", + "source/cluster.d.ts", + "source/image.d.ts", + "source/imagearcgisrest.d.ts", + "source/imagecanvas.d.ts", + "source/imagemapguide.d.ts", + "source/imagestatic.d.ts", + "source/imagevector.d.ts", + "source/imagewms.d.ts", + "source/osm.d.ts", + "source/raster.d.ts", + "source/source.d.ts", + "source/stamen.d.ts", + "source/tile.d.ts", + "source/tilearcgisrest.d.ts", + "source/tiledebug.d.ts", + "source/tileimage.d.ts", + "source/tilejson.d.ts", + "source/tileutfgrid.d.ts", + "source/tilewms.d.ts", + "source/urltile.d.ts", + "source/vector.d.ts", + "source/vectortile.d.ts", + "source/wmts.d.ts", + "source/xyz.d.ts", + "source/zoomify.d.ts", + "style/atlasmanager.d.ts", + "style/circle.d.ts", + "style/fill.d.ts", + "style/icon.d.ts", + "style/image.d.ts", + "style/regularshape.d.ts", + "style/stroke.d.ts", + "style/style.d.ts", + "style/text.d.ts", + "tilegrid/tilegrid.d.ts", + "tilegrid/wmts.d.ts", + "assertionerror/index.d.ts", + "attribution/index.d.ts", + "collection/index.d.ts", + "color/index.d.ts", + "colorlike/index.d.ts", + "control/index.d.ts", + "coordinate/index.d.ts", + "deviceorientation/index.d.ts", + "disposable/index.d.ts", + "easing/index.d.ts", + "events/index.d.ts", + "extent/index.d.ts", + "feature/index.d.ts", + "featureloader/index.d.ts", + "geolocation/index.d.ts", + "graticule/index.d.ts", + "image/index.d.ts", + "imagebase/index.d.ts", + "imagetile/index.d.ts", + "interaction/index.d.ts", + "kinetic/index.d.ts", + "loadingstrategy/index.d.ts", + "map/index.d.ts", + "mapbrowserevent/index.d.ts", + "mapbrowserpointerevent/index.d.ts", + "mapevent/index.d.ts", + "object/index.d.ts", + "observable/index.d.ts", + "overlay/index.d.ts", + "sphere/index.d.ts", + "tile/index.d.ts", + "tilegrid/index.d.ts", + "vectortile/index.d.ts", + "view/index.d.ts" + ] +} \ No newline at end of file diff --git a/types/ol/tslint.json b/types/ol/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ol/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ol/vectortile/index.d.ts b/types/ol/vectortile/index.d.ts new file mode 100644 index 0000000000..21b2ed9297 --- /dev/null +++ b/types/ol/vectortile/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.VectorTile; diff --git a/types/ol/view/index.d.ts b/types/ol/view/index.d.ts new file mode 100644 index 0000000000..6df86cd89d --- /dev/null +++ b/types/ol/view/index.d.ts @@ -0,0 +1,3 @@ +import * as ol from 'openlayers'; + +export default ol.View; diff --git a/types/on-finished/tsconfig.json b/types/on-finished/tsconfig.json index 14e726f8c4..7e49b150bb 100644 --- a/types/on-finished/tsconfig.json +++ b/types/on-finished/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/on-headers/tsconfig.json b/types/on-headers/tsconfig.json index a0e5fc13dd..25c2e3c8d5 100644 --- a/types/on-headers/tsconfig.json +++ b/types/on-headers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/once/tsconfig.json b/types/once/tsconfig.json index e6b9784107..67de4d3961 100644 --- a/types/once/tsconfig.json +++ b/types/once/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/onesignal-cordova-plugin/tsconfig.json b/types/onesignal-cordova-plugin/tsconfig.json index bcee47426f..ce255e192d 100644 --- a/types/onesignal-cordova-plugin/tsconfig.json +++ b/types/onesignal-cordova-plugin/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "onesignal-cordova-plugin-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/onesignal-cordova-plugin/tslint.json b/types/onesignal-cordova-plugin/tslint.json index 3db14f85ea..3224b40b8b 100644 --- a/types/onesignal-cordova-plugin/tslint.json +++ b/types/onesignal-cordova-plugin/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } +} diff --git a/types/onetime/tsconfig.json b/types/onetime/tsconfig.json index 84d3da86b8..f283f14841 100644 --- a/types/onetime/tsconfig.json +++ b/types/onetime/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/oniguruma/tsconfig.json b/types/oniguruma/tsconfig.json index b807c6e5de..28d398ed22 100644 --- a/types/oniguruma/tsconfig.json +++ b/types/oniguruma/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/onoff/tsconfig.json b/types/onoff/tsconfig.json index cbe0820a5a..ae7322e35a 100644 --- a/types/onoff/tsconfig.json +++ b/types/onoff/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/open/tsconfig.json b/types/open/tsconfig.json index 1395893dcb..62cd144b3b 100644 --- a/types/open/tsconfig.json +++ b/types/open/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/opener/tsconfig.json b/types/opener/tsconfig.json index 8f8b166751..fd2c277637 100644 --- a/types/opener/tsconfig.json +++ b/types/opener/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/openfin/tsconfig.json b/types/openfin/tsconfig.json index fd3199ceb7..48d26affcc 100644 --- a/types/openfin/tsconfig.json +++ b/types/openfin/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/openfin/v15/tsconfig.json b/types/openfin/v15/tsconfig.json index 103e765e43..17537fec00 100644 --- a/types/openfin/v15/tsconfig.json +++ b/types/openfin/v15/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/openfin/v16/tsconfig.json b/types/openfin/v16/tsconfig.json index cfb0b2d238..f6d5d45a8a 100644 --- a/types/openfin/v16/tsconfig.json +++ b/types/openfin/v16/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/openjscad/tsconfig.json b/types/openjscad/tsconfig.json index 971a3ee55a..44ef0db880 100644 --- a/types/openjscad/tsconfig.json +++ b/types/openjscad/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/openlayers/index.d.ts b/types/openlayers/index.d.ts index c2e7ab1530..c217a6d873 100644 --- a/types/openlayers/index.d.ts +++ b/types/openlayers/index.d.ts @@ -6,6 +6,7 @@ // Alexandre Melard // Chad Johnston // Dan Manastireanu +// Yair Tawil // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Definitions partially generated using tsd-jsdoc (https://github.com/englercj/tsd-jsdoc) @@ -12383,11 +12384,11 @@ declare module ol { * The size is the pixel dimensions of the box into which the calculated extent * should fit. In most cases you want to get the extent of the entire map, * that is `map.getSize()`. - * @param {ol.Size} size Box pixel size. + * @param {ol.Size=} size Box pixel size. * @return {ol.Extent} Extent. * @api stable */ - calculateExtent(size: ol.Size): ol.Extent; + calculateExtent(size?: ol.Size): ol.Extent; /** * Get the maximum resolution of the view. @@ -13325,7 +13326,8 @@ declare module olx { * multi: (boolean|undefined), * features: (ol.Collection.|undefined), * filter: (ol.SelectFilterFunction|undefined), - * wrapX: (boolean|undefined)}} + * wrapX: (boolean|undefined), + * hitTolerance: (number|undefined)}} */ interface SelectOptions { addCondition?: ol.EventsConditionType; @@ -13338,6 +13340,7 @@ declare module olx { features?: ol.Collection; filter?: ol.SelectFilterFunction; wrapX?: boolean; + hitTolerance?: number; } @@ -14615,6 +14618,7 @@ declare module olx { maxZoom?: number; duration?: number; easing?: ((t: number) => number); + callback?: olx.animation.AnimateCallback; } } diff --git a/types/openlayers/openlayers-tests.ts b/types/openlayers/openlayers-tests.ts index 666b7b746f..4353f48960 100644 --- a/types/openlayers/openlayers-tests.ts +++ b/types/openlayers/openlayers-tests.ts @@ -399,6 +399,10 @@ let view: ol.View = new ol.View({ voidValue = view.setMaxZoom(numberValue); voidValue = view.setMinZoom(numberValue); +voidValue = view.fit(simpleGeometry); +voidValue = view.fit(extent); +voidValue = view.fit(extent, {callback: () => {}}); +voidValue = view.fit(extent, {callback: (animationCompleted: boolean) => {}}); // // ol.layer.Base diff --git a/types/openlayers/tsconfig.json b/types/openlayers/tsconfig.json index 5b45cb31b9..3bc277ecae 100644 --- a/types/openlayers/tsconfig.json +++ b/types/openlayers/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/openlayers/v2/tsconfig.json b/types/openlayers/v2/tsconfig.json index 67c0f29fd4..3725c17b1f 100644 --- a/types/openlayers/v2/tsconfig.json +++ b/types/openlayers/v2/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/openlayers/v3/tsconfig.json b/types/openlayers/v3/tsconfig.json index 052323b232..40f3d72c1a 100644 --- a/types/openlayers/v3/tsconfig.json +++ b/types/openlayers/v3/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/openpgp/tsconfig.json b/types/openpgp/tsconfig.json index 8ed156faf3..0d89f5cddd 100644 --- a/types/openpgp/tsconfig.json +++ b/types/openpgp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/openstack-wrapper/tsconfig.json b/types/openstack-wrapper/tsconfig.json index f6fa4b227b..42501aaebd 100644 --- a/types/openstack-wrapper/tsconfig.json +++ b/types/openstack-wrapper/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/opentok/tsconfig.json b/types/opentok/tsconfig.json index 0e035c2a4c..867816c287 100644 --- a/types/opentok/tsconfig.json +++ b/types/opentok/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/opentype.js/tsconfig.json b/types/opentype.js/tsconfig.json index ae36366993..20de3c612b 100644 --- a/types/opentype.js/tsconfig.json +++ b/types/opentype.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/openui5/tsconfig.json b/types/openui5/tsconfig.json index e61a38f38c..406a9171dd 100644 --- a/types/openui5/tsconfig.json +++ b/types/openui5/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/opn/tsconfig.json b/types/opn/tsconfig.json index 2a51fff8ca..dc544741ee 100644 --- a/types/opn/tsconfig.json +++ b/types/opn/tsconfig.json @@ -1,16 +1,24 @@ { "compilerOptions": { "module": "commonjs", - "lib": ["es6"], + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, - "files": ["index.d.ts", "opn-tests.ts"] -} + "files": [ + "index.d.ts", + "opn-tests.ts" + ] +} \ No newline at end of file diff --git a/types/optics-agent/optics-agent-tests.ts b/types/optics-agent/optics-agent-tests.ts index 2135c810d4..22b9b479e9 100644 --- a/types/optics-agent/optics-agent-tests.ts +++ b/types/optics-agent/optics-agent-tests.ts @@ -9,9 +9,9 @@ import OpticsAgent, { Agent, } from 'optics-agent'; import { GraphQLSchema } from 'graphql'; -import * as express from 'express'; +import express = require('express'); import * as hapi from 'hapi'; -import * as KoaServer from 'koa'; +import KoaServer = require('koa'); const configOptions: Options = { apiKey: "", diff --git a/types/optics-agent/tsconfig.json b/types/optics-agent/tsconfig.json index e7dbc8958b..adb6fdbba4 100644 --- a/types/optics-agent/tsconfig.json +++ b/types/optics-agent/tsconfig.json @@ -14,13 +14,16 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "optics-agent-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/optimist/tsconfig.json b/types/optimist/tsconfig.json index da5b6d43c7..f16b4b49e4 100644 --- a/types/optimist/tsconfig.json +++ b/types/optimist/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/optimize-css-assets-webpack-plugin/optimize-css-assets-webpack-plugin-tests.ts b/types/optimize-css-assets-webpack-plugin/optimize-css-assets-webpack-plugin-tests.ts index 74cf685649..0dd1531313 100644 --- a/types/optimize-css-assets-webpack-plugin/optimize-css-assets-webpack-plugin-tests.ts +++ b/types/optimize-css-assets-webpack-plugin/optimize-css-assets-webpack-plugin-tests.ts @@ -1,4 +1,4 @@ -import * as OptimizeCssAssets from 'optimize-css-assets-webpack-plugin'; +import OptimizeCssAssets = require('optimize-css-assets-webpack-plugin'); const ocap: OptimizeCssAssets = new OptimizeCssAssets({ assetNameRegExp: /\.min\.css$/, diff --git a/types/optimize-css-assets-webpack-plugin/tsconfig.json b/types/optimize-css-assets-webpack-plugin/tsconfig.json index bb2c39172f..5420b382e4 100644 --- a/types/optimize-css-assets-webpack-plugin/tsconfig.json +++ b/types/optimize-css-assets-webpack-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ora/tsconfig.json b/types/ora/tsconfig.json index 4092876efe..2480951ab5 100644 --- a/types/ora/tsconfig.json +++ b/types/ora/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ora/v0/tsconfig.json b/types/ora/v0/tsconfig.json index b614f6cbc4..d8ac13a91d 100644 --- a/types/ora/v0/tsconfig.json +++ b/types/ora/v0/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/oracledb/tsconfig.json b/types/oracledb/tsconfig.json index 2e6eeb9b95..7a878379cd 100644 --- a/types/oracledb/tsconfig.json +++ b/types/oracledb/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/orchestrator/tsconfig.json b/types/orchestrator/tsconfig.json index 3cfb6b0cdb..1da510b3ca 100644 --- a/types/orchestrator/tsconfig.json +++ b/types/orchestrator/tsconfig.json @@ -15,7 +15,8 @@ "strictNullChecks": false, "strictFunctionTypes": true, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/orderedmap/tsconfig.json b/types/orderedmap/tsconfig.json index d8428d94cc..5ab20ebbc3 100644 --- a/types/orderedmap/tsconfig.json +++ b/types/orderedmap/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/orientjs/orientjs-tests.ts b/types/orientjs/orientjs-tests.ts index ec083b84e3..9b11968058 100644 --- a/types/orientjs/orientjs-tests.ts +++ b/types/orientjs/orientjs-tests.ts @@ -1,4 +1,4 @@ -import * as orientjs from 'orientjs'; +import orientjs = require('orientjs'); const dbserver = orientjs({ host: 'localhost', diff --git a/types/orientjs/tsconfig.json b/types/orientjs/tsconfig.json index 87bfdfd2a8..a8418ce64b 100644 --- a/types/orientjs/tsconfig.json +++ b/types/orientjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/os-homedir/tsconfig.json b/types/os-homedir/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/os-homedir/tsconfig.json +++ b/types/os-homedir/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/os-locale/tsconfig.json b/types/os-locale/tsconfig.json index fbf08733cf..6e168a01ce 100644 --- a/types/os-locale/tsconfig.json +++ b/types/os-locale/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/os-locale/v1/tsconfig.json b/types/os-locale/v1/tsconfig.json index acb67ee603..c53210a218 100644 --- a/types/os-locale/v1/tsconfig.json +++ b/types/os-locale/v1/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/os-name/tsconfig.json b/types/os-name/tsconfig.json index f48355e962..9220809237 100644 --- a/types/os-name/tsconfig.json +++ b/types/os-name/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/os-tmpdir/tsconfig.json b/types/os-tmpdir/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/os-tmpdir/tsconfig.json +++ b/types/os-tmpdir/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/osmosis/tsconfig.json b/types/osmosis/tsconfig.json index 9627f6d5fe..f5eb196c89 100644 --- a/types/osmosis/tsconfig.json +++ b/types/osmosis/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/osmtogeojson/tsconfig.json b/types/osmtogeojson/tsconfig.json index c50e45768c..e708a2429b 100644 --- a/types/osmtogeojson/tsconfig.json +++ b/types/osmtogeojson/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/osrm/osrm-tests.ts b/types/osrm/osrm-tests.ts index fd53363dd7..513e8c1fd2 100644 --- a/types/osrm/osrm-tests.ts +++ b/types/osrm/osrm-tests.ts @@ -1,5 +1,5 @@ import * as fs from 'fs'; -import * as OSRM from 'osrm'; +import OSRM = require('osrm'); // Access to Types from namespace const tile: OSRM.Tile = [0, 0, 0]; diff --git a/types/osrm/tsconfig.json b/types/osrm/tsconfig.json index 8a581c7423..3ebd7db8b3 100644 --- a/types/osrm/tsconfig.json +++ b/types/osrm/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/otplib/tsconfig.json b/types/otplib/tsconfig.json index cfb2b07081..2b3c420d67 100644 --- a/types/otplib/tsconfig.json +++ b/types/otplib/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "otplib-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/owasp-password-strength-test/tsconfig.json b/types/owasp-password-strength-test/tsconfig.json index 0206d30034..d10909118e 100644 --- a/types/owasp-password-strength-test/tsconfig.json +++ b/types/owasp-password-strength-test/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "owasp-password-strength-test-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/owl.carousel/tsconfig.json b/types/owl.carousel/tsconfig.json index 4205eff11f..fb9f9f4f6e 100644 --- a/types/owl.carousel/tsconfig.json +++ b/types/owl.carousel/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/owlcarousel/tsconfig.json b/types/owlcarousel/tsconfig.json index 4438ba88ae..db23d47838 100644 --- a/types/owlcarousel/tsconfig.json +++ b/types/owlcarousel/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-all/tsconfig.json b/types/p-all/tsconfig.json index 5cc346c4e3..5d706ed217 100644 --- a/types/p-all/tsconfig.json +++ b/types/p-all/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-any/tsconfig.json b/types/p-any/tsconfig.json index 67d983361a..56f19a51e5 100644 --- a/types/p-any/tsconfig.json +++ b/types/p-any/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-cancelable/tsconfig.json b/types/p-cancelable/tsconfig.json index 504511081d..eb9e9b9b33 100644 --- a/types/p-cancelable/tsconfig.json +++ b/types/p-cancelable/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-debounce/tsconfig.json b/types/p-debounce/tsconfig.json index 4de0f115d8..d8f3a41d21 100644 --- a/types/p-debounce/tsconfig.json +++ b/types/p-debounce/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-defer/tsconfig.json b/types/p-defer/tsconfig.json index 06eb650dbe..d48a07b169 100644 --- a/types/p-defer/tsconfig.json +++ b/types/p-defer/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-do-whilst/tsconfig.json b/types/p-do-whilst/tsconfig.json index 87392769da..fa551d6727 100644 --- a/types/p-do-whilst/tsconfig.json +++ b/types/p-do-whilst/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-each-series/tsconfig.json b/types/p-each-series/tsconfig.json index e8cd900d05..d62549d651 100644 --- a/types/p-each-series/tsconfig.json +++ b/types/p-each-series/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-event/tsconfig.json b/types/p-event/tsconfig.json index 0e047aa84b..8d282c8736 100644 --- a/types/p-event/tsconfig.json +++ b/types/p-event/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-every/tsconfig.json b/types/p-every/tsconfig.json index 979927093f..87b3f1c968 100644 --- a/types/p-every/tsconfig.json +++ b/types/p-every/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-lazy/tsconfig.json b/types/p-lazy/tsconfig.json index 73b2e31142..24a3174936 100644 --- a/types/p-lazy/tsconfig.json +++ b/types/p-lazy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-limit/index.d.ts b/types/p-limit/index.d.ts index a10fd05e1e..416622298b 100644 --- a/types/p-limit/index.d.ts +++ b/types/p-limit/index.d.ts @@ -7,4 +7,4 @@ declare namespace pLimit {} export = pLimit; -declare function pLimit(concurrency: number): (fn: () => PromiseLike) => Promise; +declare function pLimit(concurrency: number): (fn: () => PromiseLike) => Promise; diff --git a/types/p-limit/p-limit-tests.ts b/types/p-limit/p-limit-tests.ts index 6e50894802..e04b895e87 100644 --- a/types/p-limit/p-limit-tests.ts +++ b/types/p-limit/p-limit-tests.ts @@ -1,6 +1,6 @@ import pLimit = require('p-limit'); -const limit = pLimit(1); +const limit = pLimit(1); const input = [ limit(() => Promise.resolve('foo')), diff --git a/types/p-limit/tsconfig.json b/types/p-limit/tsconfig.json index 4634bf6300..e438eda453 100644 --- a/types/p-limit/tsconfig.json +++ b/types/p-limit/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-loading/index.d.ts b/types/p-loading/index.d.ts new file mode 100644 index 0000000000..a7c2425b68 --- /dev/null +++ b/types/p-loading/index.d.ts @@ -0,0 +1,50 @@ +// Type definitions for p-loading 1.2 +// Project: http://joseshiru.github.io/p-loading/ +// Definitions by: Soner Köksal +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +interface PLoadingOptions { + action?: "show" | "hide" | "destroy"; + maskColor?: string; + containerHTML?: string; + containerAttrs?: object; + containerClass?: string; + spinnerHTML?: string; + spinnerAttrs?: object; + spinnerClass?: string; + /** + * @deprecated + */ + onShowContainer?: ($pluginElement: JQuery, $container: JQuery) => void; + /** + * @deprecated + */ + onHideContainer?: ($pluginElement: JQuery, $container: JQuery) => void; + /** + * @deprecated + */ + onDestroyContainer?: ($container: JQuery) => void; + hideAnimation?: ($container: JQuery) => void; + showAnimation?: ($container: JQuery) => void; + destroyAfterHide?: boolean; + idPrefix?: string; + pluginNameSpace?: string; + useAddOns?: string []; +} + +interface PLoading { + (options: PLoadingOptions): void; + + defaults: PLoadingOptions; +} + +interface JQuery { + ploading: PLoading; +} + +interface JQueryStatic { + ploading: PLoading; +} diff --git a/types/p-loading/p-loading-tests.ts b/types/p-loading/p-loading-tests.ts new file mode 100644 index 0000000000..6aeef649a9 --- /dev/null +++ b/types/p-loading/p-loading-tests.ts @@ -0,0 +1,21 @@ +$('#test').ploading({action: 'show'}); + +$('#test').ploading({action: 'hide'}); + +$('#test').ploading({action: 'destroy'}); + +$('#test').ploading({action: 'hide', useAddOns: ['addOnName']}); + +$.fn.ploading.defaults = { + // ploading static settings + useAddOns: ['addOnName'] +}; + +$.fn.ploading.defaults = { + spinnerClass: 'your-spinner-class' +}; + +$.fn.ploading.defaults = { + spinnerHTML: '', + spinnerClass: 'fa fa-spinner fa-spin p-loading-fontawesome' +}; diff --git a/types/p-loading/tsconfig.json b/types/p-loading/tsconfig.json new file mode 100644 index 0000000000..fa6843d54f --- /dev/null +++ b/types/p-loading/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "p-loading-tests.ts" + ] +} \ No newline at end of file diff --git a/types/p-loading/tslint.json b/types/p-loading/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/p-loading/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/p-locate/tsconfig.json b/types/p-locate/tsconfig.json index 1f3e8a7711..794031a75b 100644 --- a/types/p-locate/tsconfig.json +++ b/types/p-locate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-log/tsconfig.json b/types/p-log/tsconfig.json index 891d94fce3..1d875c64b1 100644 --- a/types/p-log/tsconfig.json +++ b/types/p-log/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-map-series/tsconfig.json b/types/p-map-series/tsconfig.json index b06e222983..6594c24661 100644 --- a/types/p-map-series/tsconfig.json +++ b/types/p-map-series/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-map/tsconfig.json b/types/p-map/tsconfig.json index ed62309b29..d156c77951 100644 --- a/types/p-map/tsconfig.json +++ b/types/p-map/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-one/tsconfig.json b/types/p-one/tsconfig.json index 27a6a05ac7..525393d638 100644 --- a/types/p-one/tsconfig.json +++ b/types/p-one/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-props/tsconfig.json b/types/p-props/tsconfig.json index 8ef73ae141..56998f169a 100644 --- a/types/p-props/tsconfig.json +++ b/types/p-props/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-queue/index.d.ts b/types/p-queue/index.d.ts index 3cc6acef53..568de0ca1d 100644 --- a/types/p-queue/index.d.ts +++ b/types/p-queue/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for p-queue 1.1 +// Type definitions for p-queue 2.3 // Project: https://github.com/sindresorhus/p-queue#readme // Definitions by: BendingBender // Evan Shortiss @@ -8,16 +8,68 @@ export = PQueue; declare class PQueue { + /** + * Size of the queue. + */ size: number; + + /** + * Number of pending promises. + */ pending: number; + /** + * Whether the queue is currently paused. + */ + isPaused: boolean; + constructor(opts?: PQueue.Options); + /** + * Returns the promise returned by calling fn. + * @param fn Promise-returning/async function. + */ add(fn: PQueue.Task, opts?: O): Promise; + /** + * Same as .add(), but accepts an array of async functions and + * returns a promise that resolves when all async functions are resolved. + * @param fn Array of Promise-returning/async functions. + */ + addAll(fns: Array>, opts?: O): Promise; + + /** + * Returns a promise that settles when the queue becomes empty. + * Can be called multiple times. Useful if you for example add + * additional items at a later time. + */ onEmpty(): Promise; + /** + * Returns a promise that settles when the queue becomes empty, and all + * promises have completed; queue.size === 0 && queue.pending === 0. + * The difference with .onEmpty is that .onIdle guarantees that all work + * from the queue has finished. .onEmpty merely signals that the queue is + * empty, but it could mean that some promises haven't completed yet. + */ + onIdle(): Promise; + + /** + * Start (or resume) executing enqueued tasks within concurrency limit. + * No need to call this if queue is not paused (via options.autoStart = false + * or by .pause() method.) + */ + start(): void; + + /** + * Clear the queue. + */ clear(): void; + + /** + * Put queue execution on hold. + */ + pause(): void; } declare namespace PQueue { @@ -38,8 +90,9 @@ declare namespace PQueue { } interface Options { - queueClass?: QueueClassConstructor; concurrency?: number; + autoStart?: boolean; + queueClass?: QueueClassConstructor; } interface DefaultAddOptions { diff --git a/types/p-queue/p-queue-tests.ts b/types/p-queue/p-queue-tests.ts index 8c54953a73..e12723a7d4 100644 --- a/types/p-queue/p-queue-tests.ts +++ b/types/p-queue/p-queue-tests.ts @@ -6,19 +6,26 @@ queue.add(() => Promise.resolve('sindresorhus.com')).then((sindre) => { const str: string = sindre; }); +queue.addAll([() => Promise.resolve('oh'), () => Promise.resolve('hi')]).then(r => { + r.indexOf('h'); +}); + Promise.resolve((): Promise => Promise.resolve('unicorn')) .then(task => queue.add(task, {priority: 5})) .then(unicorn => { const str: string = unicorn; }); -queue.onEmpty().then(() => { -}); +queue.onEmpty().then(() => {}); +queue.onIdle().then(() => {}); +queue.start(); +queue.pause(); queue.clear(); let num: number; num = queue.size; num = queue.pending; +const paused = queue.isPaused; class QueueClass implements PQueue.QueueClass<{ any: string }> { private readonly queue: Array<() => void>; diff --git a/types/p-queue/tsconfig.json b/types/p-queue/tsconfig.json index b3dd5e5314..dd19b0083f 100644 --- a/types/p-queue/tsconfig.json +++ b/types/p-queue/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-reduce/tsconfig.json b/types/p-reduce/tsconfig.json index d06d04e5e7..2debc8d66f 100644 --- a/types/p-reduce/tsconfig.json +++ b/types/p-reduce/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-reflect/tsconfig.json b/types/p-reflect/tsconfig.json index 0bd514215f..b7c6dc1702 100644 --- a/types/p-reflect/tsconfig.json +++ b/types/p-reflect/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-retry/tsconfig.json b/types/p-retry/tsconfig.json index 8bd6ddd6b5..21687875fa 100644 --- a/types/p-retry/tsconfig.json +++ b/types/p-retry/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-series/tsconfig.json b/types/p-series/tsconfig.json index 7ac0ed4d4c..45a2be71c5 100644 --- a/types/p-series/tsconfig.json +++ b/types/p-series/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-settle/tsconfig.json b/types/p-settle/tsconfig.json index ba288104e0..1e8220467f 100644 --- a/types/p-settle/tsconfig.json +++ b/types/p-settle/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-some/tsconfig.json b/types/p-some/tsconfig.json index d8bca7e13a..d6e4b1b63e 100644 --- a/types/p-some/tsconfig.json +++ b/types/p-some/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-tap/tsconfig.json b/types/p-tap/tsconfig.json index 1d4042647f..ed4f136d0b 100644 --- a/types/p-tap/tsconfig.json +++ b/types/p-tap/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-throttle/tsconfig.json b/types/p-throttle/tsconfig.json index 81852e4d18..f30c9ed4e3 100644 --- a/types/p-throttle/tsconfig.json +++ b/types/p-throttle/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-timeout/tsconfig.json b/types/p-timeout/tsconfig.json index d16042504a..40bb9b3b8b 100644 --- a/types/p-timeout/tsconfig.json +++ b/types/p-timeout/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-try/tsconfig.json b/types/p-try/tsconfig.json index b8ca67f073..7cd170e0da 100644 --- a/types/p-try/tsconfig.json +++ b/types/p-try/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-wait-for/tsconfig.json b/types/p-wait-for/tsconfig.json index 7df0af64a1..e3e3bb7597 100644 --- a/types/p-wait-for/tsconfig.json +++ b/types/p-wait-for/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-whilst/tsconfig.json b/types/p-whilst/tsconfig.json index 3309a228fc..8fd1bb42ba 100644 --- a/types/p-whilst/tsconfig.json +++ b/types/p-whilst/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p2/tsconfig.json b/types/p2/tsconfig.json index c40f2ddd89..576a91b7c6 100644 --- a/types/p2/tsconfig.json +++ b/types/p2/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/package-json/tsconfig.json b/types/package-json/tsconfig.json index 52c1adb7d3..c033223c6d 100644 --- a/types/package-json/tsconfig.json +++ b/types/package-json/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "package-json-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/packery/tsconfig.json b/types/packery/tsconfig.json index 85c7e3ae6a..3e17d32ee6 100644 --- a/types/packery/tsconfig.json +++ b/types/packery/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pad/tsconfig.json b/types/pad/tsconfig.json index 6a6ef6d4c7..fd8ce70400 100644 --- a/types/pad/tsconfig.json +++ b/types/pad/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/page-icon/page-icon-tests.ts b/types/page-icon/page-icon-tests.ts index 4a6bc8c2b6..2b2873dae1 100644 --- a/types/page-icon/page-icon-tests.ts +++ b/types/page-icon/page-icon-tests.ts @@ -1,4 +1,4 @@ -import * as pageIcon from "page-icon"; +import pageIcon = require("page-icon"); const siteUrl = "https://www.facebook.com/"; pageIcon(siteUrl) diff --git a/types/page-icon/tsconfig.json b/types/page-icon/tsconfig.json index f5dc72cbcd..143c1b0232 100644 --- a/types/page-icon/tsconfig.json +++ b/types/page-icon/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/page/tsconfig.json b/types/page/tsconfig.json index 3a774901be..f3ffce244f 100644 --- a/types/page/tsconfig.json +++ b/types/page/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/paho-mqtt/tsconfig.json b/types/paho-mqtt/tsconfig.json index 7e9a7ce4e6..f08ccecb7a 100644 --- a/types/paho-mqtt/tsconfig.json +++ b/types/paho-mqtt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pako/tsconfig.json b/types/pako/tsconfig.json index 011a39c83c..b1e866a0a9 100644 --- a/types/pako/tsconfig.json +++ b/types/pako/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pangu/tsconfig.json b/types/pangu/tsconfig.json index a1084b5b06..83ce22a7b2 100644 --- a/types/pangu/tsconfig.json +++ b/types/pangu/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "pangu-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/papaparse/tsconfig.json b/types/papaparse/tsconfig.json index 1684012a56..80238273d7 100644 --- a/types/papaparse/tsconfig.json +++ b/types/papaparse/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/paper/index.d.ts b/types/paper/index.d.ts index 64d961ed10..3f57526a19 100644 --- a/types/paper/index.d.ts +++ b/types/paper/index.d.ts @@ -290,7 +290,7 @@ declare module paper { * Transforms a point and returns the result. * @param point - the point to be transformed */ - transform(point: Point): Matrix; + transform(point: Point): Point; /** * Transforms an array of coordinates by this matrix and stores the results into the destination array, which is also returned. @@ -304,7 +304,7 @@ declare module paper { * Inverse transforms a point and returns the result. * @param point - the point to be transformed */ - inverseTransform(point: Point): Matrix; + inverseTransform(point: Point): Point; /** * Attempts to decompose the affine transformation described by this matrix into scaling, rotation and shearing, and returns an object with these properties if it succeeded, null otherwise. @@ -1308,12 +1308,12 @@ declare module paper { * The function to be called when the mouse button is pushed down on the item. The function receives a MouseEvent object which contains information about the mouse event. */ onMouseDown: (event: MouseEvent) => void; - + /** * The function to be called when the mouse position changes while the mouse is being dragged. The function receives a MouseEvent object which contains information about the mouse event. */ onMouseDrag: (event: MouseEvent) => void; - + /** * The function to be called when the mouse button is released over the item. * The function receives a MouseEvent object which contains information about the mouse event. @@ -1353,9 +1353,11 @@ declare module paper { /** * Clones the item within the same project and places the copy above the item. - * @param insert [optional] - specifies whether the copy should be inserted into the DOM. When set to true, it is inserted above the original. default: true + * @param options [optional] - object with 2 parameters + * insert: specifies whether the copy should be inserted into the DOM. When set to true, it is inserted above the original. default: true + * deep: specifies whether the item’s children should also be cloned — default: true */ - clone(insert?: boolean): Item; + clone(options?: { insert?: boolean, deep?: boolean }): Item; /** * When passed a project, copies the item to the project, or duplicates it within the same project. When passed an item, copies the item into the specified item. @@ -3235,6 +3237,16 @@ declare module paper { * Deselects all selected items in the project. */ deselectAll(): void; + + /** + * Adds the specified layer at the end of the this project’s layers list. + */ + addLayer(layer: Layer): Layer; + + /** + * Inserts the specified layer at the specified index in this project’s layers list. + */ + insertLayer(index: number, layer: Layer): Layer; /** * Perform a hit-test on the items contained within the project at the location of the specified point. @@ -3535,7 +3547,7 @@ declare module paper { * @param highlight [optional] - */ constructor(color: Gradient, origin: Point, destination: Point, highlight?: Point); - + /** * Creates a RGB Color object. * @param hex - the RGB color in hex, i.e. #000000 @@ -3769,6 +3781,48 @@ declare module paper { */ onResize: (event: Event) => void; + /** + * The function to be called when the mouse button is pushed down on the item. The function receives a MouseEvent object which contains information about the mouse event. + */ + onMouseDown: (event: MouseEvent) => void; + + /** + * The function to be called when the mouse position changes while the mouse is being dragged. The function receives a MouseEvent object which contains information about the mouse event. + */ + onMouseDrag: (event: MouseEvent) => void; + + /** + * The function to be called when the mouse button is released over the item. + * The function receives a MouseEvent object which contains information about the mouse event. + */ + onMouseUp: (event: MouseEvent) => void; + + /** + * The function to be called when the mouse clicks on the item. The function receives a MouseEvent object which contains information about the mouse event. + */ + onClick: (event: MouseEvent) => void; + + /** + * The function to be called when the mouse double clicks on the item. The function receives a MouseEvent object which contains information about the mouse event. + */ + onDoubleClick: (event: MouseEvent) => void; + + /** + * The function to be called repeatedly when the mouse moves on top of the item. The function receives a MouseEvent object which contains information about the mouse event. + */ + onMouseMove: (event: MouseEvent) => void; + + /** + * The function to be called when the mouse moves over the item. This function will only be called again, once the mouse moved outside of the item first. The function receives a MouseEvent object which contains information about the mouse event. + */ + onMouseEnter: (event: MouseEvent) => void; + + /** + * The function to be called when the mouse moves out of the item. + * The function receives a MouseEvent object which contains information about the mouse event. + */ + onMouseLeave: (event: MouseEvent) => void; + /** * Removes this view from the project and frees the associated element. */ diff --git a/types/paper/tsconfig.json b/types/paper/tsconfig.json index ba81ca6cf0..6f21980e93 100644 --- a/types/paper/tsconfig.json +++ b/types/paper/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/paralleljs/tsconfig.json b/types/paralleljs/tsconfig.json index 0cea925bbd..d074b65fd1 100644 --- a/types/paralleljs/tsconfig.json +++ b/types/paralleljs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/parent-package-json/tsconfig.json b/types/parent-package-json/tsconfig.json index 33d474c851..b07b7e1918 100644 --- a/types/parent-package-json/tsconfig.json +++ b/types/parent-package-json/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "parent-package-json-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/parse-git-config/tsconfig.json b/types/parse-git-config/tsconfig.json index 5295cbc1ee..ec4ea443ed 100644 --- a/types/parse-git-config/tsconfig.json +++ b/types/parse-git-config/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/parse-glob/tsconfig.json b/types/parse-glob/tsconfig.json index 0f620fa4e7..62c72fdf23 100644 --- a/types/parse-glob/tsconfig.json +++ b/types/parse-glob/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/parse-json/tsconfig.json b/types/parse-json/tsconfig.json index 448f6787ba..153bd71944 100644 --- a/types/parse-json/tsconfig.json +++ b/types/parse-json/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "parse-json-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/parse-link-header/tsconfig.json b/types/parse-link-header/tsconfig.json index 82b1addcbd..7156e907bc 100644 --- a/types/parse-link-header/tsconfig.json +++ b/types/parse-link-header/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/parse-mockdb/tsconfig.json b/types/parse-mockdb/tsconfig.json index 47ec90a997..9990f2ee1e 100644 --- a/types/parse-mockdb/tsconfig.json +++ b/types/parse-mockdb/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/parse-ms/tsconfig.json b/types/parse-ms/tsconfig.json index 3fecf7615f..28c9a4810e 100644 --- a/types/parse-ms/tsconfig.json +++ b/types/parse-ms/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "parse-ms-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/parse-torrent-file/parse-torrent-file-tests.ts b/types/parse-torrent-file/parse-torrent-file-tests.ts index a981c0bc81..43b8c7d0fd 100644 --- a/types/parse-torrent-file/parse-torrent-file-tests.ts +++ b/types/parse-torrent-file/parse-torrent-file-tests.ts @@ -1,4 +1,4 @@ -import * as parseTorrentFile from 'parse-torrent-file'; +import parseTorrentFile = require('parse-torrent-file'); import * as fs from 'fs'; const torrent = fs.readFileSync(__filename); diff --git a/types/parse-torrent-file/tsconfig.json b/types/parse-torrent-file/tsconfig.json index dcd42f04f0..bce67a0d57 100644 --- a/types/parse-torrent-file/tsconfig.json +++ b/types/parse-torrent-file/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/parse-torrent/index.d.ts b/types/parse-torrent/index.d.ts index c6bd901976..9b410759a3 100644 --- a/types/parse-torrent/index.d.ts +++ b/types/parse-torrent/index.d.ts @@ -5,7 +5,7 @@ /// -import * as MagnetUri from 'magnet-uri'; +import MagnetUri = require('magnet-uri'); import * as ParseTorrentFile from 'parse-torrent-file'; declare const ParseTorrent: ParseTorrent.ParseTorrent; diff --git a/types/parse-torrent/parse-torrent-tests.ts b/types/parse-torrent/parse-torrent-tests.ts index 24d00dbe98..c2676ff080 100644 --- a/types/parse-torrent/parse-torrent-tests.ts +++ b/types/parse-torrent/parse-torrent-tests.ts @@ -1,4 +1,4 @@ -import * as parseTorrent from 'parse-torrent'; +import parseTorrent = require('parse-torrent'); import * as fs from 'fs'; // info hash (as a hex string) diff --git a/types/parse-torrent/tsconfig.json b/types/parse-torrent/tsconfig.json index 1a2750195a..f82d5a8bfc 100644 --- a/types/parse-torrent/tsconfig.json +++ b/types/parse-torrent/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/parse-unit/tsconfig.json b/types/parse-unit/tsconfig.json index 081dcee45d..3257f3b69e 100644 --- a/types/parse-unit/tsconfig.json +++ b/types/parse-unit/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/parse/index.d.ts b/types/parse/index.d.ts index 5b4ff9a0bf..1973c8938b 100644 --- a/types/parse/index.d.ts +++ b/types/parse/index.d.ts @@ -31,6 +31,11 @@ declare namespace Parse { interface SuccessFailureOptions extends SuccessOption, ErrorOption { } + interface SignUpOptions { + useMasterKey?: boolean; + installationId?: string; + } + interface SessionTokenOption { sessionToken?: string; } @@ -98,11 +103,11 @@ declare namespace Parse { reject(error: any): void; resolve(result: any): void; then(resolvedCallback: (...values: T[]) => IPromise, - rejectedCallback?: (reason: any) => IPromise): IPromise; + rejectedCallback?: (reason: any) => IPromise): IPromise; then(resolvedCallback: (...values: T[]) => U, - rejectedCallback?: (reason: any) => IPromise): IPromise; + rejectedCallback?: (reason: any) => IPromise): IPromise; then(resolvedCallback: (...values: T[]) => U, - rejectedCallback?: (reason: any) => U): IPromise; + rejectedCallback?: (reason: any) => U): IPromise; } interface Pointer { @@ -287,13 +292,13 @@ declare namespace Parse { constructor(parent?: S, key?: string); //Adds a Parse.Object or an array of Parse.Objects to the relation. - add(object: T): void; + add(object: T | Array): void; // Returns a Parse.Query that is limited to objects in this relation. query(): Query; // Removes a Parse.Object or an array of Parse.Objects from this relation. - remove(object: T): void; + remove(object: T | Array): void; } /** @@ -373,7 +378,9 @@ declare namespace Parse { remove(attr: string, item: any): any; save(attrs?: { [key: string]: any } | null, options?: Object.SaveOptions): Promise; save(key: string, value: any, options?: Object.SaveOptions): Promise; + save(attrs: object, options?: Object.SaveOptions): Promise; set(key: string, value: any, options?: Object.SetOptions): boolean; + set(attrs: object, options?: Object.SetOptions): boolean; setACL(acl: ACL, options?: SuccessFailureOptions): boolean; toPointer(): Pointer; unset(attr: string, options?: any): any; @@ -739,7 +746,7 @@ declare namespace Parse { class User extends Object { static current(): User | undefined; - static signUp(username: string, password: string, attrs: any, options?: SuccessFailureOptions): Promise; + static signUp(username: string, password: string, attrs: any, options?: SignUpOptions): Promise; static logIn(username: string, password: string, options?: SuccessFailureOptions): Promise; static logOut(): Promise; static allowCustomUserClass(isAllowed: boolean): void; @@ -747,7 +754,7 @@ declare namespace Parse { static requestPasswordReset(email: string, options?: SuccessFailureOptions): Promise; static extend(protoProps?: any, classProps?: any): any; - signUp(attrs: any, options?: SuccessFailureOptions): Promise; + signUp(attrs: any, options?: SignUpOptions): Promise; logIn(options?: SuccessFailureOptions): Promise; authenticated(): boolean; isCurrent(): boolean; diff --git a/types/parse/parse-tests.ts b/types/parse/parse-tests.ts index 1a2d5dcdee..87194ba02c 100644 --- a/types/parse/parse-tests.ts +++ b/types/parse/parse-tests.ts @@ -57,6 +57,12 @@ function test_object() { gameScore.set("cheatMode", false); + // Setting attrs using object + gameScore.set({ + level: '10', + difficult: 15 + }); + const score = gameScore.get("score"); const playerName = gameScore.get("playerName"); const cheatMode = gameScore.get("cheatMode"); @@ -235,7 +241,23 @@ function test_analytics() { } function test_relation() { + var game1 = new Game(); + var game2 = new Game(); + new Parse.User().relation("games").query().find().then((g: Game[]) => { }); + new Parse.User().relation("games").add(game1) + new Parse.User().relation("games").add([game1, game2]) + + new Parse.User().relation("games").remove(game1) + new Parse.User().relation("games").remove([game1, game2]) +} + +function test_user() { + const user = new Parse.User(); + user.set("username", "my name"); + user.set("password", "my pass"); + user.set("email", "email@example.com"); + user.signUp(null, { useMasterKey: true }); } function test_user_acl_roles() { @@ -266,6 +288,7 @@ function test_user_acl_roles() { game.setACL(new Parse.ACL(Parse.User.current())); game.save().then((game: Game) => { }); game.save(null, { useMasterKey: true }); + game.save({ score: '10' }, { useMasterKey: true }); const groupACL = new Parse.ACL(); @@ -358,7 +381,7 @@ function test_cloud_functions() { }); Parse.Cloud.beforeDelete('MyCustomClass', (request: Parse.Cloud.BeforeDeleteRequest, - response: Parse.Cloud.BeforeDeleteResponse) => { + response: Parse.Cloud.BeforeDeleteResponse) => { // result }); diff --git a/types/parse/tsconfig.json b/types/parse/tsconfig.json index 53ec60085d..8e41c1dede 100644 --- a/types/parse/tsconfig.json +++ b/types/parse/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/parse/tslint.json b/types/parse/tslint.json index e3610fefae..e2172b7f24 100644 --- a/types/parse/tslint.json +++ b/types/parse/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/parseurl/tsconfig.json b/types/parseurl/tsconfig.json index f47e85f978..4f7ce9cbac 100644 --- a/types/parseurl/tsconfig.json +++ b/types/parseurl/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/parsimmon/tsconfig.json b/types/parsimmon/tsconfig.json index 676b349a37..6e85d7e3ca 100644 --- a/types/parsimmon/tsconfig.json +++ b/types/parsimmon/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "parsimmon-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/passport-anonymous/tsconfig.json b/types/passport-anonymous/tsconfig.json index 1d8859e706..b667acd694 100644 --- a/types/passport-anonymous/tsconfig.json +++ b/types/passport-anonymous/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-beam/tsconfig.json b/types/passport-beam/tsconfig.json index 7b3fc8e513..bb65e62fbc 100644 --- a/types/passport-beam/tsconfig.json +++ b/types/passport-beam/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-discord/tsconfig.json b/types/passport-discord/tsconfig.json index 38a8051fb9..dcb1ac3502 100644 --- a/types/passport-discord/tsconfig.json +++ b/types/passport-discord/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-facebook-token/passport-facebook-token-tests.ts b/types/passport-facebook-token/passport-facebook-token-tests.ts index c926748286..1539118879 100644 --- a/types/passport-facebook-token/passport-facebook-token-tests.ts +++ b/types/passport-facebook-token/passport-facebook-token-tests.ts @@ -1,6 +1,6 @@ import * as express from 'express'; import * as passport from 'passport'; -import * as PassportFacebookToken from 'passport-facebook-token'; +import PassportFacebookToken = require('passport-facebook-token'); const User = { findOrCreate(id: string, provider: string, callback: (err: any, user: any) => void): void { diff --git a/types/passport-facebook-token/tsconfig.json b/types/passport-facebook-token/tsconfig.json index e1d020177a..2b877f282b 100644 --- a/types/passport-facebook-token/tsconfig.json +++ b/types/passport-facebook-token/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-facebook/tsconfig.json b/types/passport-facebook/tsconfig.json index dcc610efec..9153763af2 100644 --- a/types/passport-facebook/tsconfig.json +++ b/types/passport-facebook/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-github/tsconfig.json b/types/passport-github/tsconfig.json index 0e7ac43e0e..deac088de3 100644 --- a/types/passport-github/tsconfig.json +++ b/types/passport-github/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-github2/tsconfig.json b/types/passport-github2/tsconfig.json index ae03d3bb32..ec58c6f1da 100644 --- a/types/passport-github2/tsconfig.json +++ b/types/passport-github2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-google-oauth/tsconfig.json b/types/passport-google-oauth/tsconfig.json index 7f3b315c07..ef36d15b4a 100644 --- a/types/passport-google-oauth/tsconfig.json +++ b/types/passport-google-oauth/tsconfig.json @@ -1,16 +1,24 @@ { "compilerOptions": { "module": "commonjs", - "lib": ["es6"], + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, - "files": ["index.d.ts", "passport-google-oauth-tests.ts"] -} + "files": [ + "index.d.ts", + "passport-google-oauth-tests.ts" + ] +} \ No newline at end of file diff --git a/types/passport-google-oauth2/tsconfig.json b/types/passport-google-oauth2/tsconfig.json index ee60531f41..7c144ffdff 100644 --- a/types/passport-google-oauth2/tsconfig.json +++ b/types/passport-google-oauth2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-http-bearer/tsconfig.json b/types/passport-http-bearer/tsconfig.json index b6033075ab..6ae99f8758 100644 --- a/types/passport-http-bearer/tsconfig.json +++ b/types/passport-http-bearer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-http/index.d.ts b/types/passport-http/index.d.ts index e9a66964ea..458e5f2076 100644 --- a/types/passport-http/index.d.ts +++ b/types/passport-http/index.d.ts @@ -1,60 +1,69 @@ -// Type definitions for passport-http 0.3.0 +// Type definitions for passport-http 0.3 // Project: https://github.com/jaredhanson/passport-http // Definitions by: Christophe Vidal +// Tomek Åaziuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 import passport = require("passport"); import express = require("express"); -interface BasicStrategyOptions { +export interface BasicStrategyOptions { realm?: string; - passReqToCallback?: boolean; + passReqToCallback?: req; } -interface DigestStrategyOptions { +export interface DigestStrategyOptions { realm?: string; - domain?: string | Array; + domain?: string | string[]; opaque?: string; algorithm?: string; - qop?: string | Array; + qop?: string | string[]; } -interface DigestValidateOptions { +export interface DigestValidateOptions { nonce: string; cnonce: string; nc: number; opaque: string; } -interface BasicVerifyFunction { - (username: string, password: string, done: (error: any, user?: any) => void): void; -} +export type BasicVerifyFunction = ( + username: string, + password: string, + done: (error: any, user?: any) => void, +) => any; -interface BasicVerifyFunctionWithRequest { - (req: express.Request, username: string, password: string, done: (error: any, user?: any) => void): void; -} +export type BasicVerifyFunctionWithRequest = ( + req: express.Request, + username: string, + password: string, + done: (error: any, user?: any) => void, +) => any; -interface DigestSecretFunction { - (username: string, done: (error: any, user?: any, password?: any) => void): void; -} +export type DigestSecretFunction = ( + username: string, + done: (error: any, user?: any, password?: any) => void, +) => any; -interface DigestValidateFunction { - (params: DigestValidateOptions, done: (error: any, valid: boolean) => void): void; -} +export type DigestValidateFunction = ( + params: DigestValidateOptions, + done: (error: any, valid: boolean) => void, +) => any; -declare class BasicStrategy implements passport.Strategy { +export class BasicStrategy implements passport.Strategy { constructor(verify: BasicVerifyFunction); - constructor(options: BasicStrategyOptions, verify: BasicVerifyFunction); + constructor(options: BasicStrategyOptions, verify: BasicVerifyFunction); + constructor(options: BasicStrategyOptions, verify: BasicVerifyFunctionWithRequest); name: string; - authenticate: (req: express.Request, options?: Object) => void; + authenticate: (req: express.Request, options?: object) => void; } -declare class DigestStrategy implements passport.Strategy { +export class DigestStrategy implements passport.Strategy { constructor(secret: DigestSecretFunction, validate?: DigestValidateFunction); constructor(options: DigestStrategyOptions, secret: DigestSecretFunction, validate?: DigestValidateFunction); name: string; - authenticate: (req: express.Request, options?: Object) => void; + authenticate: (req: express.Request, options?: object) => void; } diff --git a/types/passport-http/passport-http-tests.ts b/types/passport-http/passport-http-tests.ts index 4a70d30b89..396138b466 100644 --- a/types/passport-http/passport-http-tests.ts +++ b/types/passport-http/passport-http-tests.ts @@ -5,15 +5,15 @@ import passport = require("passport"); import http = require("passport-http"); -interface IUser { +interface UserInterface { username: string; password?: string; } class User { - public password: string; + password: string; - static findOne(user: IUser, callback: (error: Error, user: User) => void): void { + static findOne(user: UserInterface, callback: (error: Error, user: User) => void): void { callback(null, new User()); } } @@ -24,17 +24,19 @@ function validateNonce(nonce: string) { function validateParams(nonce: string, cnonce: string, nc: number, opaque: string) { } -passport.use(new http.BasicStrategy((username: string, password: string, done: any) => { +passport.use(new http.BasicStrategy((username, password, done) => { User.findOne({ - username: username, - password: password, + username, + password, }, (error, user) => { if (error) { - return done(error); + done(error); + return; } if (!user) { - return done(null, false); + done(null, false); + return; } done(null, user); @@ -44,25 +46,25 @@ passport.use(new http.BasicStrategy((username: string, password: string, done: a passport.use(new http.BasicStrategy({ realm: "User", passReqToCallback: true, -}, (username: string, password: string, done: any) => { - User.findOne({ - username: username, - password: password, - }, (error, user) => { - if (error) { - return done(error); - } +}, (req, username, password, done) => { + // with req when needed +})); - if (!user) { - return done(null, false); - } +passport.use(new http.BasicStrategy({ + realm: "User", +}, (username, password, done) => { + // without req by default +})); - done(null, user); - }); +passport.use(new http.BasicStrategy({ + realm: "User", + passReqToCallback: false, +}, (username, password, done) => { + // without req })); passport.use(new http.DigestStrategy((username: string, done: any) => { - User.findOne({username: username}, (error, user) => { + User.findOne({ username }, (error, user) => { if (error) { return done(error); } @@ -76,7 +78,7 @@ passport.use(new http.DigestStrategy((username: string, done: any) => { })); passport.use(new http.DigestStrategy((username: string, done: any) => { - User.findOne({username: username}, (error, user) => { + User.findOne({ username }, (error, user) => { if (error) { return done(error); } @@ -99,7 +101,7 @@ passport.use(new http.DigestStrategy({ algorithm: "MD5", qop: "auth", }, (username: string, done: any) => { - User.findOne({username: username}, (error, user) => { + User.findOne({ username }, (error, user) => { if (error) { return done(error); } @@ -119,7 +121,7 @@ passport.use(new http.DigestStrategy({ algorithm: "MD5", qop: "auth", }, (username: string, done: any) => { - User.findOne({username: username}, (error, user) => { + User.findOne({ username }, (error, user) => { if (error) { return done(error); } diff --git a/types/passport-http/tsconfig.json b/types/passport-http/tsconfig.json index d1a35a3390..e158bcb014 100644 --- a/types/passport-http/tsconfig.json +++ b/types/passport-http/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-http/tslint.json b/types/passport-http/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/passport-http/tslint.json +++ b/types/passport-http/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" } diff --git a/types/passport-jwt/index.d.ts b/types/passport-jwt/index.d.ts index c300276fe2..0a71c4b725 100644 --- a/types/passport-jwt/index.d.ts +++ b/types/passport-jwt/index.d.ts @@ -4,11 +4,13 @@ // Alex Young // David Ng // Carlos Eduardo Scheffer +// Byungjin Kim // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 import { Strategy as PassportStrategy } from 'passport-strategy'; import {Request} from 'express'; +import { VerifyOptions } from 'jsonwebtoken' export declare class Strategy extends PassportStrategy { constructor(opt: StrategyOptions, verify: VerifyCallback); @@ -24,6 +26,7 @@ export interface StrategyOptions { algorithms?: string[]; ignoreExpiration?: boolean; passReqToCallback?: boolean; + jsonWebTokenOptions?: VerifyOptions; } export interface VerifyCallback { diff --git a/types/passport-jwt/tsconfig.json b/types/passport-jwt/tsconfig.json index 906f33004d..6170656dd1 100644 --- a/types/passport-jwt/tsconfig.json +++ b/types/passport-jwt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-kakao/tsconfig.json b/types/passport-kakao/tsconfig.json index 784cbe32e8..0657b076b8 100644 --- a/types/passport-kakao/tsconfig.json +++ b/types/passport-kakao/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "passport-kakao-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/passport-local-mongoose/passport-local-mongoose-tests.ts b/types/passport-local-mongoose/passport-local-mongoose-tests.ts index 63c82a9913..5058cb88ef 100644 --- a/types/passport-local-mongoose/passport-local-mongoose-tests.ts +++ b/types/passport-local-mongoose/passport-local-mongoose-tests.ts @@ -1,5 +1,3 @@ -/// - /** * Created by Linus Brolin . */ @@ -14,7 +12,7 @@ import { PassportLocalOptions, PassportLocalErrorMessages } from 'mongoose'; -import * as passportLocalMongoose from 'passport-local-mongoose'; +import passportLocalMongoose = require('passport-local-mongoose'); import { Router, Request, Response } from 'express'; import * as passport from 'passport'; diff --git a/types/passport-local-mongoose/tsconfig.json b/types/passport-local-mongoose/tsconfig.json index c0806a2177..6ba09ff095 100644 --- a/types/passport-local-mongoose/tsconfig.json +++ b/types/passport-local-mongoose/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-local/tsconfig.json b/types/passport-local/tsconfig.json index 340ecca02d..fa2f7824d5 100644 --- a/types/passport-local/tsconfig.json +++ b/types/passport-local/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-naver/tsconfig.json b/types/passport-naver/tsconfig.json index 1a8826dcfd..e09b5e2a55 100644 --- a/types/passport-naver/tsconfig.json +++ b/types/passport-naver/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "passport-naver-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/passport-oauth2-client-password/tsconfig.json b/types/passport-oauth2-client-password/tsconfig.json index e7cc4cc177..19cc572681 100644 --- a/types/passport-oauth2-client-password/tsconfig.json +++ b/types/passport-oauth2-client-password/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-oauth2/tsconfig.json b/types/passport-oauth2/tsconfig.json index 5e71cf6328..cc083b7bf7 100644 --- a/types/passport-oauth2/tsconfig.json +++ b/types/passport-oauth2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-saml/tsconfig.json b/types/passport-saml/tsconfig.json index 0809dbbaf7..f7e6b952d4 100644 --- a/types/passport-saml/tsconfig.json +++ b/types/passport-saml/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-steam/tsconfig.json b/types/passport-steam/tsconfig.json index 94a0d709a4..618ce103d0 100644 --- a/types/passport-steam/tsconfig.json +++ b/types/passport-steam/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-strategy/tsconfig.json b/types/passport-strategy/tsconfig.json index b9d033a50e..912569eef3 100644 --- a/types/passport-strategy/tsconfig.json +++ b/types/passport-strategy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-twitter/tsconfig.json b/types/passport-twitter/tsconfig.json index 4034aa5640..94c7367c2e 100644 --- a/types/passport-twitter/tsconfig.json +++ b/types/passport-twitter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-unique-token/tsconfig.json b/types/passport-unique-token/tsconfig.json index 405438dd5a..5c70a8debd 100644 --- a/types/passport-unique-token/tsconfig.json +++ b/types/passport-unique-token/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport/passport-tests.ts b/types/passport/passport-tests.ts index b6c033b907..58c306964c 100644 --- a/types/passport/passport-tests.ts +++ b/types/passport/passport-tests.ts @@ -1,5 +1,5 @@ import * as passport from 'passport'; -import * as express from 'express'; +import express = require('express'); import 'express-session'; class TestStrategy implements passport.Strategy { diff --git a/types/passport/tsconfig.json b/types/passport/tsconfig.json index 08fe485f60..085a0730d1 100644 --- a/types/passport/tsconfig.json +++ b/types/passport/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/password-hash-and-salt/tsconfig.json b/types/password-hash-and-salt/tsconfig.json index a2a0427f51..4269a10725 100644 --- a/types/password-hash-and-salt/tsconfig.json +++ b/types/password-hash-and-salt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/password-hash/tsconfig.json b/types/password-hash/tsconfig.json index b0e161a8a2..a0fb6b0e8f 100644 --- a/types/password-hash/tsconfig.json +++ b/types/password-hash/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/path-exists/tsconfig.json b/types/path-exists/tsconfig.json index d9e230ee27..50ce9f3349 100644 --- a/types/path-exists/tsconfig.json +++ b/types/path-exists/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/path-exists/v1/tsconfig.json b/types/path-exists/v1/tsconfig.json index 3a52689e9c..f8059a64b7 100644 --- a/types/path-exists/v1/tsconfig.json +++ b/types/path-exists/v1/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/path-is-absolute/tsconfig.json b/types/path-is-absolute/tsconfig.json index c3b15bff95..63bd03ece3 100644 --- a/types/path-is-absolute/tsconfig.json +++ b/types/path-is-absolute/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/path-parse/path-parse-tests.ts b/types/path-parse/path-parse-tests.ts index da2b63f6b4..a632d768f1 100644 --- a/types/path-parse/path-parse-tests.ts +++ b/types/path-parse/path-parse-tests.ts @@ -1,4 +1,4 @@ -import * as parse from "path-parse"; +import parse = require("path-parse"); const parsed = parse("/foo/bar.img"); const { root, dir, base, ext, name } = parsed; diff --git a/types/path-parse/tsconfig.json b/types/path-parse/tsconfig.json index 9123b62477..e89835c7e5 100644 --- a/types/path-parse/tsconfig.json +++ b/types/path-parse/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pathfinding/tsconfig.json b/types/pathfinding/tsconfig.json index 0428d67daa..76d2cec85c 100644 --- a/types/pathfinding/tsconfig.json +++ b/types/pathfinding/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pathjs/tsconfig.json b/types/pathjs/tsconfig.json index 60a8aba82a..a8c29ed915 100644 --- a/types/pathjs/tsconfig.json +++ b/types/pathjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pathwatcher/tsconfig.json b/types/pathwatcher/tsconfig.json index 41bb35a03c..3c46805477 100644 --- a/types/pathwatcher/tsconfig.json +++ b/types/pathwatcher/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "pathwatcher-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/pause/tsconfig.json b/types/pause/tsconfig.json index 76c0af48a3..14acafe4a9 100644 --- a/types/pause/tsconfig.json +++ b/types/pause/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/payment/tsconfig.json b/types/payment/tsconfig.json index 4f1166c44f..499c49ce64 100644 --- a/types/payment/tsconfig.json +++ b/types/payment/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/paypal-cordova-plugin/tsconfig.json b/types/paypal-cordova-plugin/tsconfig.json index 67ee653902..cddf3ab053 100644 --- a/types/paypal-cordova-plugin/tsconfig.json +++ b/types/paypal-cordova-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/paypal-rest-sdk/tsconfig.json b/types/paypal-rest-sdk/tsconfig.json index 4e1922b8ba..4026071a14 100644 --- a/types/paypal-rest-sdk/tsconfig.json +++ b/types/paypal-rest-sdk/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pbf/tsconfig.json b/types/pbf/tsconfig.json index b9ec4bce50..c6bd76c88a 100644 --- a/types/pbf/tsconfig.json +++ b/types/pbf/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pdfjs-dist/tsconfig.json b/types/pdfjs-dist/tsconfig.json index d189de9f02..17f7d8cfca 100644 --- a/types/pdfjs-dist/tsconfig.json +++ b/types/pdfjs-dist/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pdfkit/tsconfig.json b/types/pdfkit/tsconfig.json index f14037a57f..490ef6e892 100644 --- a/types/pdfkit/tsconfig.json +++ b/types/pdfkit/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pdfobject/tsconfig.json b/types/pdfobject/tsconfig.json index 178c186ae8..dcb101218a 100644 --- a/types/pdfobject/tsconfig.json +++ b/types/pdfobject/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pebblekitjs/tsconfig.json b/types/pebblekitjs/tsconfig.json index e09e806e3b..fb45867efd 100644 --- a/types/pebblekitjs/tsconfig.json +++ b/types/pebblekitjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/peer-dial/peer-dial-tests.ts b/types/peer-dial/peer-dial-tests.ts index cb4238da62..6cc4376458 100644 --- a/types/peer-dial/peer-dial-tests.ts +++ b/types/peer-dial/peer-dial-tests.ts @@ -1,5 +1,5 @@ import { Server, Client, App, AppInfo, CorsOptions, ServerOptions, Delegate, DialDevice, DeviceInfo } from 'peer-dial'; -import * as express from 'express'; +import express = require('express'); class AppImpl implements App { name: string; diff --git a/types/peer-dial/tsconfig.json b/types/peer-dial/tsconfig.json index 4672562aef..f9ec138996 100644 --- a/types/peer-dial/tsconfig.json +++ b/types/peer-dial/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/peerjs/tsconfig.json b/types/peerjs/tsconfig.json index 41e815c2c3..7400e9a78c 100644 --- a/types/peerjs/tsconfig.json +++ b/types/peerjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pegjs/tsconfig.json b/types/pegjs/tsconfig.json index ea5f1cc8e4..49e431cdc2 100644 --- a/types/pegjs/tsconfig.json +++ b/types/pegjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pem/tsconfig.json b/types/pem/tsconfig.json index 509312522f..f7d45f9f7d 100644 --- a/types/pem/tsconfig.json +++ b/types/pem/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/persona/tsconfig.json b/types/persona/tsconfig.json index cadf2878fc..5726175930 100644 --- a/types/persona/tsconfig.json +++ b/types/persona/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pet-finder-api/tsconfig.json b/types/pet-finder-api/tsconfig.json index 66a88e70be..605722a75f 100644 --- a/types/pet-finder-api/tsconfig.json +++ b/types/pet-finder-api/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pg-ears/tsconfig.json b/types/pg-ears/tsconfig.json index a98396e776..3a5bd63fe8 100644 --- a/types/pg-ears/tsconfig.json +++ b/types/pg-ears/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pg-escape/pg-escape-tests.ts b/types/pg-escape/pg-escape-tests.ts index 36636cf0c2..87d70dbd9f 100644 --- a/types/pg-escape/pg-escape-tests.ts +++ b/types/pg-escape/pg-escape-tests.ts @@ -1,4 +1,4 @@ -import * as escape from 'pg-escape'; +import escape = require('pg-escape'); escape('INSERT INTO %I VALUES(%L)', 'books', "O'Reilly"); escape.string("ab'cd"); diff --git a/types/pg-escape/tsconfig.json b/types/pg-escape/tsconfig.json index b5afa8ea9a..a32fb19012 100644 --- a/types/pg-escape/tsconfig.json +++ b/types/pg-escape/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pg-pool/tsconfig.json b/types/pg-pool/tsconfig.json index 5381ba2842..ffc4440460 100644 --- a/types/pg-pool/tsconfig.json +++ b/types/pg-pool/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pg-query-stream/pg-query-stream-tests.ts b/types/pg-query-stream/pg-query-stream-tests.ts index 1df78ea648..dbf0b88d0b 100644 --- a/types/pg-query-stream/pg-query-stream-tests.ts +++ b/types/pg-query-stream/pg-query-stream-tests.ts @@ -1,4 +1,4 @@ -import * as QueryStream from 'pg-query-stream'; +import QueryStream = require('pg-query-stream'); import * as pg from 'pg'; const options: QueryStream.Options = { diff --git a/types/pg-query-stream/tsconfig.json b/types/pg-query-stream/tsconfig.json index 8137847846..d6da0a5ff2 100644 --- a/types/pg-query-stream/tsconfig.json +++ b/types/pg-query-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pg-types/tsconfig.json b/types/pg-types/tsconfig.json index 1ab38690e5..b8e5677970 100644 --- a/types/pg-types/tsconfig.json +++ b/types/pg-types/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pg/tsconfig.json b/types/pg/tsconfig.json index 92ec2db62b..a836da031a 100644 --- a/types/pg/tsconfig.json +++ b/types/pg/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pg/v6/tsconfig.json b/types/pg/v6/tsconfig.json index 4e12c2c891..6f8e496a3a 100644 --- a/types/pg/v6/tsconfig.json +++ b/types/pg/v6/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pgwmodal/tsconfig.json b/types/pgwmodal/tsconfig.json index 5ad4cd4a98..8b0d9007a5 100644 --- a/types/pgwmodal/tsconfig.json +++ b/types/pgwmodal/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/phantom/tsconfig.json b/types/phantom/tsconfig.json index 39ae0edc93..db99b55c3e 100644 --- a/types/phantom/tsconfig.json +++ b/types/phantom/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/phantomcss/tsconfig.json b/types/phantomcss/tsconfig.json index cba4e19ecd..f1ed6ac3c6 100644 --- a/types/phantomcss/tsconfig.json +++ b/types/phantomcss/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/phantomjs/tsconfig.json b/types/phantomjs/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/phantomjs/tsconfig.json +++ b/types/phantomjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/phoenix/tsconfig.json b/types/phoenix/tsconfig.json index 40bfbb22b6..2ab9a802b8 100644 --- a/types/phoenix/tsconfig.json +++ b/types/phoenix/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/phone-formatter/tsconfig.json b/types/phone-formatter/tsconfig.json index 48f951581e..1446ec115e 100644 --- a/types/phone-formatter/tsconfig.json +++ b/types/phone-formatter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/phone/tsconfig.json b/types/phone/tsconfig.json index 1890b13a08..bab413270c 100644 --- a/types/phone/tsconfig.json +++ b/types/phone/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/phonegap-facebook-plugin/tsconfig.json b/types/phonegap-facebook-plugin/tsconfig.json index 0a1d090d05..9a06dc0e67 100644 --- a/types/phonegap-facebook-plugin/tsconfig.json +++ b/types/phonegap-facebook-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/phonegap-nfc/tsconfig.json b/types/phonegap-nfc/tsconfig.json index 72b1f019d8..3a44f3b88e 100644 --- a/types/phonegap-nfc/tsconfig.json +++ b/types/phonegap-nfc/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/phonegap-plugin-barcodescanner/tsconfig.json b/types/phonegap-plugin-barcodescanner/tsconfig.json index ec6d41e488..62862eeea7 100644 --- a/types/phonegap-plugin-barcodescanner/tsconfig.json +++ b/types/phonegap-plugin-barcodescanner/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/phonegap/tsconfig.json b/types/phonegap/tsconfig.json index 714111c6e0..e513609ef9 100644 --- a/types/phonegap/tsconfig.json +++ b/types/phonegap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/phonon/tsconfig.json b/types/phonon/tsconfig.json index bbadd8d12a..27fdea2d6f 100644 --- a/types/phonon/tsconfig.json +++ b/types/phonon/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/photonui/tsconfig.json b/types/photonui/tsconfig.json index 7aa685b04b..444824f4f7 100644 --- a/types/photonui/tsconfig.json +++ b/types/photonui/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/photoswipe/tsconfig.json b/types/photoswipe/tsconfig.json index 9e83ea1174..126ce7e39f 100644 --- a/types/photoswipe/tsconfig.json +++ b/types/photoswipe/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/physijs/tsconfig.json b/types/physijs/tsconfig.json index 6d446c60b3..20053336be 100644 --- a/types/physijs/tsconfig.json +++ b/types/physijs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pi-spi/tsconfig.json b/types/pi-spi/tsconfig.json index 0dada24fe6..b2ec839104 100644 --- a/types/pi-spi/tsconfig.json +++ b/types/pi-spi/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pick-weight/tsconfig.json b/types/pick-weight/tsconfig.json index 86f4110d99..2d02a2adef 100644 --- a/types/pick-weight/tsconfig.json +++ b/types/pick-weight/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pickadate/tsconfig.json b/types/pickadate/tsconfig.json index 7b19418034..a96115048d 100644 --- a/types/pickadate/tsconfig.json +++ b/types/pickadate/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/picturefill/tsconfig.json b/types/picturefill/tsconfig.json index 1435f75db0..84ef59b7ce 100644 --- a/types/picturefill/tsconfig.json +++ b/types/picturefill/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pidusage/tsconfig.json b/types/pidusage/tsconfig.json index 256715e11c..25c6d2eddf 100644 --- a/types/pidusage/tsconfig.json +++ b/types/pidusage/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pify/tsconfig.json b/types/pify/tsconfig.json index bf0a1104aa..13826105d6 100644 --- a/types/pify/tsconfig.json +++ b/types/pify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pigpio/tsconfig.json b/types/pigpio/tsconfig.json index e5b61af015..7358a555c4 100644 --- a/types/pigpio/tsconfig.json +++ b/types/pigpio/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pikaday-time/tsconfig.json b/types/pikaday-time/tsconfig.json index bf96d27d1a..198426c4ce 100644 --- a/types/pikaday-time/tsconfig.json +++ b/types/pikaday-time/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pikaday/tsconfig.json b/types/pikaday/tsconfig.json index 3c936ab905..e127c57ad1 100644 --- a/types/pikaday/tsconfig.json +++ b/types/pikaday/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pinkyswear/tsconfig.json b/types/pinkyswear/tsconfig.json index c815468eb3..8e67838864 100644 --- a/types/pinkyswear/tsconfig.json +++ b/types/pinkyswear/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pino-multi-stream/pino-multi-stream-tests.ts b/types/pino-multi-stream/pino-multi-stream-tests.ts index d9d0899256..dc48ed3bd4 100644 --- a/types/pino-multi-stream/pino-multi-stream-tests.ts +++ b/types/pino-multi-stream/pino-multi-stream-tests.ts @@ -1,6 +1,6 @@ import * as fs from 'fs'; -import * as pino from 'pino'; -import * as pinoms from 'pino-multi-stream'; +import pino = require('pino'); +import pinoms = require('pino-multi-stream'); const streams: pinoms.Streams = [ { stream: process.stdout }, // an "info" level destination stream diff --git a/types/pino-multi-stream/tsconfig.json b/types/pino-multi-stream/tsconfig.json index 7a060abb2e..a421b036f3 100644 --- a/types/pino-multi-stream/tsconfig.json +++ b/types/pino-multi-stream/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "pino-multi-stream-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/pino/index.d.ts b/types/pino/index.d.ts index d8f37c6414..02b66cc745 100644 --- a/types/pino/index.d.ts +++ b/types/pino/index.d.ts @@ -1,8 +1,8 @@ // Type definitions for pino 4.7 -// Project: https://github.com/mcollina/pino.git +// Project: https://github.com/pinojs/pino.git // Definitions by: Peter Snider // BendingBender -// Definitions: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 /// diff --git a/types/pino/tsconfig.json b/types/pino/tsconfig.json index 78c8106f18..46cfc15004 100644 --- a/types/pino/tsconfig.json +++ b/types/pino/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pino/v3/tsconfig.json b/types/pino/v3/tsconfig.json index cc1e05b0f1..ed2f81e7b8 100644 --- a/types/pino/v3/tsconfig.json +++ b/types/pino/v3/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pinterest-sdk/tsconfig.json b/types/pinterest-sdk/tsconfig.json index 17bc0c1135..1665ad68fc 100644 --- a/types/pinterest-sdk/tsconfig.json +++ b/types/pinterest-sdk/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pinyin/tsconfig.json b/types/pinyin/tsconfig.json index 2fc91705ca..1f1295881d 100644 --- a/types/pinyin/tsconfig.json +++ b/types/pinyin/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/piwik-tracker/tsconfig.json b/types/piwik-tracker/tsconfig.json index 5f3f92ee94..a66212950b 100644 --- a/types/piwik-tracker/tsconfig.json +++ b/types/piwik-tracker/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pixelmatch/tsconfig.json b/types/pixelmatch/tsconfig.json index 02115e3fdc..f922c8c0b3 100644 --- a/types/pixelmatch/tsconfig.json +++ b/types/pixelmatch/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "pixelmatch-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/pixi.js/index.d.ts b/types/pixi.js/index.d.ts index b053b46790..6d7dfaf351 100644 --- a/types/pixi.js/index.d.ts +++ b/types/pixi.js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Pixi.js 4.6 +// Type definitions for Pixi.js 4.7 // Project: https://github.com/pixijs/pixi.js/tree/dev // Definitions by: clark-stevenson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -63,6 +63,7 @@ declare namespace PIXI { let PRECISION: string; let UPLOADS_PER_FRAME: number; let CAN_UPLOAD_SAME_BUFFER: boolean; + let MESH_CANVAS_PADDING: number; } ////////////////////////////////////////////////////////////////////////////// @@ -208,6 +209,7 @@ declare namespace PIXI { renderer: PIXI.WebGLRenderer | PIXI.CanvasRenderer; stage: Container; ticker: ticker.Ticker; + loader: loaders.Loader; readonly screen: Rectangle; stop(): void; @@ -497,6 +499,7 @@ declare namespace PIXI { drawCircle(x: number, y: number, radius: number): Graphics; drawEllipse(x: number, y: number, width: number, height: number): Graphics; drawPolygon(path: number[] | Point[] | Polygon): Graphics; + drawStar(x: number, y: number, points: number, radius: number, innerRadius: number, rotation?: number): Graphics; clear(): Graphics; isFastRect(): boolean; protected _renderCanvas(renderer: CanvasRenderer): void; @@ -1737,7 +1740,9 @@ declare namespace PIXI { // shader - class Shader extends glCore.GLShader { } + class Shader extends glCore.GLShader { + constructor(gl: WebGLRenderingContext, vertexSrc: string | string[], fragmentSrc: string | string[], attributeLocations?: { [key: string]: number }, precision?: string); + } ////////////////////////////////////////////////////////////////////////////// ////////////////////////////EXTRACT/////////////////////////////////////////// @@ -2163,7 +2168,7 @@ declare namespace PIXI { // pixi loader extends // https://github.com/englercj/resource-loader/ - // 2.0.9 + // 2.1.1 class MiniSignalBinding { //tslint:disable-next-line:ban-types forbidden-types @@ -2251,6 +2256,8 @@ declare namespace PIXI { onStart: MiniSignal; onComplete: MiniSignal; + concurrency: number; + add(...params: any[]): this; //tslint:disable-next-line:ban-types forbidden-types add(name: string, url: string, options?: LoaderOptions, cb?: Function): this; @@ -2268,6 +2275,7 @@ declare namespace PIXI { protected _prepareUrl(url: string): string; //tslint:disable-next-line:ban-types forbidden-types protected _loadResource(resource: Resource, dequeue: Function): void; + protected _onStart(): void; protected _onComplete(): void; protected _onLoad(resource: Resource): void; @@ -2523,7 +2531,11 @@ declare namespace PIXI { ////////////////////////////////////////////////////////////////////////////// namespace particles { interface ParticleContainerProperties { + /** + * DEPRECIATED - Use `vertices` + */ scale?: boolean; + vertices?: boolean; position?: boolean; rotation?: boolean; uvs?: boolean; @@ -2531,7 +2543,7 @@ declare namespace PIXI { alpha?: boolean; } class ParticleContainer extends Container { - constructor(maxSize?: number, properties?: ParticleContainerProperties, batchSize?: number, autoSize?: boolean); + constructor(maxSize?: number, properties?: ParticleContainerProperties, batchSize?: number, autoResize?: boolean); protected _tint: number; protected tintRgb: number | any[]; tint: number; diff --git a/types/pixi.js/tsconfig.json b/types/pixi.js/tsconfig.json index 742fa02137..76ed9779cf 100644 --- a/types/pixi.js/tsconfig.json +++ b/types/pixi.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pkg-dir/tsconfig.json b/types/pkg-dir/tsconfig.json index 2701860736..496ac52b2b 100644 --- a/types/pkg-dir/tsconfig.json +++ b/types/pkg-dir/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "pkg-dir-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/pkijs/tsconfig.json b/types/pkijs/tsconfig.json index 2a4d04ec08..885bd7a0d8 100644 --- a/types/pkijs/tsconfig.json +++ b/types/pkijs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/platform/tsconfig.json b/types/platform/tsconfig.json index 95084ee11c..be37a03253 100644 --- a/types/platform/tsconfig.json +++ b/types/platform/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/playcanvas/tsconfig.json b/types/playcanvas/tsconfig.json index a2a2c895a0..2eb564bd87 100644 --- a/types/playcanvas/tsconfig.json +++ b/types/playcanvas/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "playcanvas-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/playerframework/tsconfig.json b/types/playerframework/tsconfig.json index 56c01ef247..984c1f5ae4 100644 --- a/types/playerframework/tsconfig.json +++ b/types/playerframework/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pleasejs/tsconfig.json b/types/pleasejs/tsconfig.json index 94046488fe..57104ee53b 100644 --- a/types/pleasejs/tsconfig.json +++ b/types/pleasejs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/plotly.js/tsconfig.json b/types/plotly.js/tsconfig.json index dd21321c49..6d2562291f 100644 --- a/types/plotly.js/tsconfig.json +++ b/types/plotly.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/plugapi/tsconfig.json b/types/plugapi/tsconfig.json index e0f04186ed..2e234835bd 100644 --- a/types/plugapi/tsconfig.json +++ b/types/plugapi/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/plugin-error/tsconfig.json b/types/plugin-error/tsconfig.json index ee9cd8e61f..a8d393375f 100644 --- a/types/plugin-error/tsconfig.json +++ b/types/plugin-error/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "plugin-error-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/plupload/tsconfig.json b/types/plupload/tsconfig.json index fc46738339..01f211f578 100644 --- a/types/plupload/tsconfig.json +++ b/types/plupload/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pluralize/tsconfig.json b/types/pluralize/tsconfig.json index 112ed18147..4c8f0ed41e 100644 --- a/types/pluralize/tsconfig.json +++ b/types/pluralize/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/png-async/tsconfig.json b/types/png-async/tsconfig.json index 181b899496..96cc95167c 100644 --- a/types/png-async/tsconfig.json +++ b/types/png-async/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pngjs/tsconfig.json b/types/pngjs/tsconfig.json index 4a2c2d47fd..229283a536 100644 --- a/types/pngjs/tsconfig.json +++ b/types/pngjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pngjs2/tsconfig.json b/types/pngjs2/tsconfig.json index cbefc10524..07948ed5e6 100644 --- a/types/pngjs2/tsconfig.json +++ b/types/pngjs2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/podcast/tsconfig.json b/types/podcast/tsconfig.json index 8e4c29f1e9..7e348b4913 100644 --- a/types/podcast/tsconfig.json +++ b/types/podcast/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/podium/tsconfig.json b/types/podium/tsconfig.json index a383a8d04c..d7580cd819 100644 --- a/types/podium/tsconfig.json +++ b/types/podium/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/point-in-polygon/tsconfig.json b/types/point-in-polygon/tsconfig.json index a17d220c7e..12a529f109 100644 --- a/types/point-in-polygon/tsconfig.json +++ b/types/point-in-polygon/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/polylabel/tsconfig.json b/types/polylabel/tsconfig.json index a9f8f55e42..b101936e68 100644 --- a/types/polylabel/tsconfig.json +++ b/types/polylabel/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/polyline/tsconfig.json b/types/polyline/tsconfig.json index 267af0e29a..032d5b9180 100644 --- a/types/polyline/tsconfig.json +++ b/types/polyline/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/polymer-ts/tsconfig.json b/types/polymer-ts/tsconfig.json index 67ef43b3be..48b262e0c8 100644 --- a/types/polymer-ts/tsconfig.json +++ b/types/polymer-ts/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/polymer/tsconfig.json b/types/polymer/tsconfig.json index 172edc052b..4b79861705 100644 --- a/types/polymer/tsconfig.json +++ b/types/polymer/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/popcorn/tsconfig.json b/types/popcorn/tsconfig.json index fa1c069762..b4076b50e2 100644 --- a/types/popcorn/tsconfig.json +++ b/types/popcorn/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/portscanner/tsconfig.json b/types/portscanner/tsconfig.json index 0a2ba9f13b..6e71168863 100644 --- a/types/portscanner/tsconfig.json +++ b/types/portscanner/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/postal/tsconfig.json b/types/postal/tsconfig.json index 69e3362d73..d9b73de77d 100644 --- a/types/postal/tsconfig.json +++ b/types/postal/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/postal/v0/tsconfig.json b/types/postal/v0/tsconfig.json index 207cc2f60b..417249bc92 100644 --- a/types/postal/v0/tsconfig.json +++ b/types/postal/v0/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/postmark/tsconfig.json b/types/postmark/tsconfig.json index 86df19a17f..aa22026f4e 100644 --- a/types/postmark/tsconfig.json +++ b/types/postmark/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouch-redux-middleware/tsconfig.json b/types/pouch-redux-middleware/tsconfig.json index f9cf608a5e..46f40a7938 100644 --- a/types/pouch-redux-middleware/tsconfig.json +++ b/types/pouch-redux-middleware/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-adapter-fruitdown/tsconfig.json b/types/pouchdb-adapter-fruitdown/tsconfig.json index c3357ce2d2..3a95c3d2aa 100644 --- a/types/pouchdb-adapter-fruitdown/tsconfig.json +++ b/types/pouchdb-adapter-fruitdown/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-adapter-http/tsconfig.json b/types/pouchdb-adapter-http/tsconfig.json index dd66d20097..43d474c91b 100644 --- a/types/pouchdb-adapter-http/tsconfig.json +++ b/types/pouchdb-adapter-http/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-adapter-idb/tsconfig.json b/types/pouchdb-adapter-idb/tsconfig.json index ce5edaa36c..bb163bf1ad 100644 --- a/types/pouchdb-adapter-idb/tsconfig.json +++ b/types/pouchdb-adapter-idb/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-adapter-leveldb/tsconfig.json b/types/pouchdb-adapter-leveldb/tsconfig.json index 4c3ceef40c..1a145b0469 100644 --- a/types/pouchdb-adapter-leveldb/tsconfig.json +++ b/types/pouchdb-adapter-leveldb/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-adapter-localstorage/tsconfig.json b/types/pouchdb-adapter-localstorage/tsconfig.json index b5c18c4a9f..cdd0d4a974 100644 --- a/types/pouchdb-adapter-localstorage/tsconfig.json +++ b/types/pouchdb-adapter-localstorage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-adapter-memory/tsconfig.json b/types/pouchdb-adapter-memory/tsconfig.json index 0bf83e3b74..09c2bc23ce 100644 --- a/types/pouchdb-adapter-memory/tsconfig.json +++ b/types/pouchdb-adapter-memory/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-adapter-node-websql/tsconfig.json b/types/pouchdb-adapter-node-websql/tsconfig.json index a154ce42e3..85265196b1 100644 --- a/types/pouchdb-adapter-node-websql/tsconfig.json +++ b/types/pouchdb-adapter-node-websql/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-adapter-websql/tsconfig.json b/types/pouchdb-adapter-websql/tsconfig.json index a4dd9848fc..1b70d6ae7a 100644 --- a/types/pouchdb-adapter-websql/tsconfig.json +++ b/types/pouchdb-adapter-websql/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-browser/tsconfig.json b/types/pouchdb-browser/tsconfig.json index 892bc704d0..2689817b3b 100644 --- a/types/pouchdb-browser/tsconfig.json +++ b/types/pouchdb-browser/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-core/tsconfig.json b/types/pouchdb-core/tsconfig.json index 61dd8ca4d1..53b2e522d3 100644 --- a/types/pouchdb-core/tsconfig.json +++ b/types/pouchdb-core/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-find/tsconfig.json b/types/pouchdb-find/tsconfig.json index 3db7946c2a..633e57958e 100644 --- a/types/pouchdb-find/tsconfig.json +++ b/types/pouchdb-find/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-http/tsconfig.json b/types/pouchdb-http/tsconfig.json index 0e67095870..a4e8be6142 100644 --- a/types/pouchdb-http/tsconfig.json +++ b/types/pouchdb-http/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-mapreduce/tsconfig.json b/types/pouchdb-mapreduce/tsconfig.json index 1af053e93b..0ee8aba915 100644 --- a/types/pouchdb-mapreduce/tsconfig.json +++ b/types/pouchdb-mapreduce/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-node/tsconfig.json b/types/pouchdb-node/tsconfig.json index c1304343b6..bfce778e16 100644 --- a/types/pouchdb-node/tsconfig.json +++ b/types/pouchdb-node/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-replication/tsconfig.json b/types/pouchdb-replication/tsconfig.json index 6a64902380..d4646381cc 100644 --- a/types/pouchdb-replication/tsconfig.json +++ b/types/pouchdb-replication/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-upsert/tsconfig.json b/types/pouchdb-upsert/tsconfig.json index ff5dc47e0c..99c7fc25b8 100644 --- a/types/pouchdb-upsert/tsconfig.json +++ b/types/pouchdb-upsert/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb/tsconfig.json b/types/pouchdb/tsconfig.json index 6894fb45dc..0b932bc155 100644 --- a/types/pouchdb/tsconfig.json +++ b/types/pouchdb/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/power-assert-formatter/tsconfig.json b/types/power-assert-formatter/tsconfig.json index 93cc04326a..838e3eb3bc 100644 --- a/types/power-assert-formatter/tsconfig.json +++ b/types/power-assert-formatter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/power-assert/tsconfig.json b/types/power-assert/tsconfig.json index 9093028de3..f4eb6ee125 100644 --- a/types/power-assert/tsconfig.json +++ b/types/power-assert/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/precise/tsconfig.json b/types/precise/tsconfig.json index e400470ee5..0ad3319223 100644 --- a/types/precise/tsconfig.json +++ b/types/precise/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/precond/tsconfig.json b/types/precond/tsconfig.json index 8158d9149d..376f45bf15 100644 --- a/types/precond/tsconfig.json +++ b/types/precond/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/preloadjs/tsconfig.json b/types/preloadjs/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/preloadjs/tsconfig.json +++ b/types/preloadjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/prelude-ls/tsconfig.json b/types/prelude-ls/tsconfig.json index 7c846df940..79cee0c5db 100644 --- a/types/prelude-ls/tsconfig.json +++ b/types/prelude-ls/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prettier/index.d.ts b/types/prettier/index.d.ts index 32c541fda6..b323a0979b 100644 --- a/types/prettier/index.d.ts +++ b/types/prettier/index.d.ts @@ -1,12 +1,12 @@ -// Type definitions for prettier 1.9 +// Type definitions for prettier 1.10 // Project: https://github.com/prettier/prettier // Definitions by: Ika // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -import { File } from 'babel-types'; - -export type AST = File; +export type AST = any; +export type Doc = any; // https://github.com/prettier/prettier/blob/master/commands.md +export type FastPath = any; // https://github.com/prettier/prettier/blob/master/src/common/fast-path.js export type BuiltInParser = (text: string, options?: any) => AST; export type BuiltInParserName = @@ -19,7 +19,8 @@ export type BuiltInParserName = | 'scss' | 'json' | 'graphql' - | 'markdown'; + | 'markdown' + | 'vue'; export type CustomParser = (text: string, parsers: Record, options: Options) => AST; @@ -97,6 +98,35 @@ export interface Options { * Include parentheses around a sole arrow function parameter. */ arrowParens?: 'avoid' | 'always'; + /** + * The plugin API is in a beta state. + */ + plugins?: Array; +} + +export interface Plugin { + languages: SupportLanguage; + parsers: { [parserName: string]: Parser }; + printers: { [astFormat: string]: Printer }; +} + +export interface Parser { + parse: (text: string, parsers: { [parserName: string]: Parser }, options: object) => AST; + astFormat: string; +} + +export interface Printer { + print( + path: FastPath, + options: object, + print: (path: FastPath) => Doc, + ): Doc; + embed( + path: FastPath, + print: (path: FastPath) => Doc, + textToDoc: (text: string, options: object) => Doc, + options: object, + ): Doc | null; } export interface CursorOptions extends Options { @@ -193,8 +223,42 @@ export interface SupportLanguage { vscodeLanguageIds: string[]; } +export interface SupportOption { + since: string; + type: 'int' | 'boolean' | 'choice' | 'path'; + deprecated?: string; + redirect?: SupportOptionRedirect; + description: string; + oppositeDescription?: string; + default: SupportOptionValue; + range?: SupportOptionRange; + choices?: SupportOptionChoice; +} + +export interface SupportOptionRedirect { + options: string; + value: SupportOptionValue; +} + +export interface SupportOptionRange { + start: number; + end: number; + step: number; +} + +export interface SupportOptionChoice { + value: boolean | string; + description?: string; + since?: string; + deprecated?: string; + redirect?: SupportOptionValue; +} + +export type SupportOptionValue = number | boolean | string; + export interface SupportInfo { languages: SupportLanguage[]; + options: SupportOption[]; } /** diff --git a/types/prettier/tsconfig.json b/types/prettier/tsconfig.json index c3ff9609e6..b4fe5b746c 100644 --- a/types/prettier/tsconfig.json +++ b/types/prettier/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pretty-bytes/tsconfig.json b/types/pretty-bytes/tsconfig.json index fd11c640b4..deec7037a2 100644 --- a/types/pretty-bytes/tsconfig.json +++ b/types/pretty-bytes/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pretty-format/tsconfig.json b/types/pretty-format/tsconfig.json index b51d58bdbb..0c54a65fd4 100644 --- a/types/pretty-format/tsconfig.json +++ b/types/pretty-format/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pretty-ms/tsconfig.json b/types/pretty-ms/tsconfig.json index da88b941c7..42961708ac 100644 --- a/types/pretty-ms/tsconfig.json +++ b/types/pretty-ms/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prettyjson/tsconfig.json b/types/prettyjson/tsconfig.json index 8169c27bba..c344cc2742 100644 --- a/types/prettyjson/tsconfig.json +++ b/types/prettyjson/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/printf/tsconfig.json b/types/printf/tsconfig.json index 620efed257..19c87443f7 100644 --- a/types/printf/tsconfig.json +++ b/types/printf/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/priorityqueuejs/tsconfig.json b/types/priorityqueuejs/tsconfig.json index 565b6f8339..93882d576f 100644 --- a/types/priorityqueuejs/tsconfig.json +++ b/types/priorityqueuejs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prismjs/tsconfig.json b/types/prismjs/tsconfig.json index c5385df0ce..03ba8fadf4 100644 --- a/types/prismjs/tsconfig.json +++ b/types/prismjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/private-ip/tsconfig.json b/types/private-ip/tsconfig.json index 33e37f45f5..5a0e21cf48 100644 --- a/types/private-ip/tsconfig.json +++ b/types/private-ip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/procfs-stats/tsconfig.json b/types/procfs-stats/tsconfig.json index 92d82b595d..8a501b61b3 100644 --- a/types/procfs-stats/tsconfig.json +++ b/types/procfs-stats/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/progress/tsconfig.json b/types/progress/tsconfig.json index 8621f46a57..65e98d96ce 100644 --- a/types/progress/tsconfig.json +++ b/types/progress/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/progressbar/tsconfig.json b/types/progressbar/tsconfig.json index b541482303..7aef8bf887 100644 --- a/types/progressbar/tsconfig.json +++ b/types/progressbar/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/progressjs/tsconfig.json b/types/progressjs/tsconfig.json index 371d303dae..fc6f9032d4 100644 --- a/types/progressjs/tsconfig.json +++ b/types/progressjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/proj4/tsconfig.json b/types/proj4/tsconfig.json index a55659d52c..1ab5dd3aca 100644 --- a/types/proj4/tsconfig.json +++ b/types/proj4/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/proj4leaflet/tsconfig.json b/types/proj4leaflet/tsconfig.json index 697b96a93a..71ce31477e 100644 --- a/types/proj4leaflet/tsconfig.json +++ b/types/proj4leaflet/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/project-oxford/tsconfig.json b/types/project-oxford/tsconfig.json index 4dbec7201d..8fc5270b59 100644 --- a/types/project-oxford/tsconfig.json +++ b/types/project-oxford/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/promise-dag/tsconfig.json b/types/promise-dag/tsconfig.json index c98c23daeb..a67918464c 100644 --- a/types/promise-dag/tsconfig.json +++ b/types/promise-dag/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/promise-pg/tsconfig.json b/types/promise-pg/tsconfig.json index 33ce665884..3738fbe7d4 100644 --- a/types/promise-pg/tsconfig.json +++ b/types/promise-pg/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/promise-polyfill/tsconfig.json b/types/promise-polyfill/tsconfig.json index 7fc4ac5f7b..eeae37f208 100644 --- a/types/promise-polyfill/tsconfig.json +++ b/types/promise-polyfill/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/promise-pool/tsconfig.json b/types/promise-pool/tsconfig.json index 98ab2ed31d..1dee50ec2c 100644 --- a/types/promise-pool/tsconfig.json +++ b/types/promise-pool/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/promise-queue/index.d.ts b/types/promise-queue/index.d.ts new file mode 100644 index 0000000000..efeaf04909 --- /dev/null +++ b/types/promise-queue/index.d.ts @@ -0,0 +1,55 @@ +// Type definitions for promise-queue 2.2 +// Project: https://github.com/azproduction/promise-queue +// Definitions by: Lachlan Stuart +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = PromiseQueue; + +declare class PromiseQueue { + /** + * + * @param maxPendingPromises [Infinity] Number of promises that can run at once. + * @param maxQueuedPromises [Infinity] Number of promises generators that can be in the queue at once. + * `add()` will return a rejected promise if this limit would be exceeded. + * @param options [{}] See QueueOptions + */ + constructor(maxPendingPromises?: number, maxQueuedPromises?: number, options?: PromiseQueue.QueueOptions); + + /** + * Enqueue a promise generator. When the number of running promises is less than `maxPendingPromises`, + * this function will be called and the returned promise will be held as a running promise until it + * rejects or resolves. + * + * @throws If the global `Promise` is undefined and `Queue.configure` hasn't been called. + * @param promiseGenerator A function that returns a promise when called. + * @returns A promise that forwards the resolution/rejection of the promise returned by `promiseGenerator`, + * or immediately rejects if `maxQueuedPromise` is exceeded. + */ + add(promiseGenerator: () => Promise): Promise; + + /** + * Returns the number of promiseGenerators waiting in queue. + */ + getPendingLength(): number; + + /** + * Returns the number of in-flight promises + */ + getQueueLength(): number; + + /** + * Set which promise constructor to use for the value returned by PromiseQueue#add. + * If this isn't called, the global `Promise` constructor is used. + * @param GlobalPromise A constructor for Promises + */ + static configure(GlobalPromise: PromiseConstructor): void; +} + +declare namespace PromiseQueue { + interface QueueOptions { + /** + * Callback that is called when the queue is empty and all pending promises have resolved + */ + onEmpty(): void; + } +} diff --git a/types/promise-queue/promise-queue-tests.ts b/types/promise-queue/promise-queue-tests.ts new file mode 100644 index 0000000000..fb3764c98f --- /dev/null +++ b/types/promise-queue/promise-queue-tests.ts @@ -0,0 +1,11 @@ +import * as PromiseQueue from 'promise-queue'; + +PromiseQueue.configure(Promise); + +const queue1 = new PromiseQueue(); +const queue2 = new PromiseQueue(1, 1, {onEmpty: () => null}); + +const queuedPromise: Promise = queue1.add(() => Promise.resolve(123)); + +const running: number = queue1.getPendingLength(); +const inQueue: number = queue1.getQueueLength(); diff --git a/types/promise-queue/tsconfig.json b/types/promise-queue/tsconfig.json new file mode 100644 index 0000000000..ff00e6ae4d --- /dev/null +++ b/types/promise-queue/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "promise-queue-tests.ts" + ] +} \ No newline at end of file diff --git a/types/promise-queue/tslint.json b/types/promise-queue/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/promise-queue/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/promise-retry/tsconfig.json b/types/promise-retry/tsconfig.json index cd598fc1f4..108576d80a 100644 --- a/types/promise-retry/tsconfig.json +++ b/types/promise-retry/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "promise-retry-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/promise.prototype.finally/tsconfig.json b/types/promise.prototype.finally/tsconfig.json index 7562ea9a0e..8624f013f1 100644 --- a/types/promise.prototype.finally/tsconfig.json +++ b/types/promise.prototype.finally/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/promised-temp/tsconfig.json b/types/promised-temp/tsconfig.json index 95c3dbb03c..0bd5275fad 100644 --- a/types/promised-temp/tsconfig.json +++ b/types/promised-temp/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/promisify-node/tsconfig.json b/types/promisify-node/tsconfig.json index a6cb4941e3..f54f1e857d 100644 --- a/types/promisify-node/tsconfig.json +++ b/types/promisify-node/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/promisify-supertest/promisify-supertest-tests.ts b/types/promisify-supertest/promisify-supertest-tests.ts index 7fa6de147d..84f4205534 100644 --- a/types/promisify-supertest/promisify-supertest-tests.ts +++ b/types/promisify-supertest/promisify-supertest-tests.ts @@ -1,6 +1,5 @@ - -import * as request from 'promisify-supertest'; -import * as express from 'express'; +import request = require('promisify-supertest'); +import express = require('express'); let app = express(); diff --git a/types/promisify-supertest/tsconfig.json b/types/promisify-supertest/tsconfig.json index 5c827afe3d..3709bcb2a7 100644 --- a/types/promisify-supertest/tsconfig.json +++ b/types/promisify-supertest/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prompt-sync-history/tsconfig.json b/types/prompt-sync-history/tsconfig.json index eee808c57f..7a8b0e911b 100644 --- a/types/prompt-sync-history/tsconfig.json +++ b/types/prompt-sync-history/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prompt-sync/tsconfig.json b/types/prompt-sync/tsconfig.json index 4e3cc7be7f..ef1a66e7b2 100644 --- a/types/prompt-sync/tsconfig.json +++ b/types/prompt-sync/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/promptly/tsconfig.json b/types/promptly/tsconfig.json index 1743c8cfae..2c4bb2d18f 100644 --- a/types/promptly/tsconfig.json +++ b/types/promptly/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prop-types/tsconfig.json b/types/prop-types/tsconfig.json index fc9e42b6d6..6274310dfb 100644 --- a/types/prop-types/tsconfig.json +++ b/types/prop-types/tsconfig.json @@ -16,6 +16,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "lib": [ "es6" ] diff --git a/types/properties-reader/tsconfig.json b/types/properties-reader/tsconfig.json index 18f69d9755..ac7cfabcca 100644 --- a/types/properties-reader/tsconfig.json +++ b/types/properties-reader/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-collab/tsconfig.json b/types/prosemirror-collab/tsconfig.json index 42b55853a5..9da4d55b1c 100644 --- a/types/prosemirror-collab/tsconfig.json +++ b/types/prosemirror-collab/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-commands/tsconfig.json b/types/prosemirror-commands/tsconfig.json index 0d89f90c3b..8c66702f55 100644 --- a/types/prosemirror-commands/tsconfig.json +++ b/types/prosemirror-commands/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-gapcursor/tsconfig.json b/types/prosemirror-gapcursor/tsconfig.json index 957316926f..81051ed6d5 100644 --- a/types/prosemirror-gapcursor/tsconfig.json +++ b/types/prosemirror-gapcursor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-history/tsconfig.json b/types/prosemirror-history/tsconfig.json index 011798770e..04d438cbec 100644 --- a/types/prosemirror-history/tsconfig.json +++ b/types/prosemirror-history/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-inputrules/tsconfig.json b/types/prosemirror-inputrules/tsconfig.json index bb5e0cc19b..1a2521fb30 100644 --- a/types/prosemirror-inputrules/tsconfig.json +++ b/types/prosemirror-inputrules/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-keymap/tsconfig.json b/types/prosemirror-keymap/tsconfig.json index 266a148c55..f4a0154e83 100644 --- a/types/prosemirror-keymap/tsconfig.json +++ b/types/prosemirror-keymap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-markdown/tsconfig.json b/types/prosemirror-markdown/tsconfig.json index 1fe943489c..b4c5979ef2 100644 --- a/types/prosemirror-markdown/tsconfig.json +++ b/types/prosemirror-markdown/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-menu/tsconfig.json b/types/prosemirror-menu/tsconfig.json index 3f43e1e2eb..312b620e50 100644 --- a/types/prosemirror-menu/tsconfig.json +++ b/types/prosemirror-menu/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-model/index.d.ts b/types/prosemirror-model/index.d.ts index 47741b200e..153358e3c6 100644 --- a/types/prosemirror-model/index.d.ts +++ b/types/prosemirror-model/index.d.ts @@ -832,7 +832,7 @@ export class ResolvedPos { * its parent node or its parent node isn't a textblock (in which * case no marks should be preserved). */ - marksAcross(): Mark[] | null | void; + marksAcross($end: ResolvedPos): Mark[] | null | void; /** * The depth up to which this position and the given (non-resolved) * position share the same parent nodes. diff --git a/types/prosemirror-model/tsconfig.json b/types/prosemirror-model/tsconfig.json index 6ae1c43b0c..0818485734 100644 --- a/types/prosemirror-model/tsconfig.json +++ b/types/prosemirror-model/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-schema-basic/tsconfig.json b/types/prosemirror-schema-basic/tsconfig.json index 44a2b36f28..b14e21e203 100644 --- a/types/prosemirror-schema-basic/tsconfig.json +++ b/types/prosemirror-schema-basic/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-schema-list/tsconfig.json b/types/prosemirror-schema-list/tsconfig.json index 3bc76fb24f..6a2f8c5c7e 100644 --- a/types/prosemirror-schema-list/tsconfig.json +++ b/types/prosemirror-schema-list/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-state/tsconfig.json b/types/prosemirror-state/tsconfig.json index 31354bc4ba..b9eb8cebbb 100644 --- a/types/prosemirror-state/tsconfig.json +++ b/types/prosemirror-state/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-tables/index.d.ts b/types/prosemirror-tables/index.d.ts index 59f54b697b..53df9fc220 100644 --- a/types/prosemirror-tables/index.d.ts +++ b/types/prosemirror-tables/index.d.ts @@ -4,8 +4,9 @@ // Eduard Shvedai // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -import { EditorState, Plugin, SelectionRange, Transaction } from 'prosemirror-state'; +import { EditorState, Plugin, SelectionRange, Transaction, PluginKey } from 'prosemirror-state'; import { Node as ProsemirrorNode, NodeSpec, Slice, ResolvedPos } from 'prosemirror-model'; +import { NodeView } from 'prosemirror-view'; export interface TableNodesOptions { tableGroup?: string; @@ -122,3 +123,25 @@ export function deleteColumn(state: EditorState, dispatch?: (tr: Transaction) => export function addColumnAfter(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; export function addColumnBefore(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; + +export function columnResizing(props: { handleWidth?: number, cellMinWidth?: number, View?: NodeView }): Plugin; + +export const columnResizingPluginKey: PluginKey; + +export function updateColumnsOnResize(node: ProsemirrorNode, colgroup: Element, table: Element, cellMinWidth: number, overrideCol?: number, overrideValue?: number): void; + +export function cellAround(pos: ResolvedPos): ResolvedPos | null; + +export function isInTable(state: EditorState): boolean; + +export function selectionCell(state: EditorState): ResolvedPos | null | undefined; + +export function moveCellForward(pos: ResolvedPos): ResolvedPos; + +export function inSameTable($a: ResolvedPos, $b: ResolvedPos): boolean; + +export function findCell(pos: ResolvedPos): {top: number, left: number, right: number, buttom: number}; + +export function colCount(pos: ResolvedPos): number; + +export function nextCell(pos: ResolvedPos, axis: string, dir: number): null | ResolvedPos; diff --git a/types/prosemirror-tables/tsconfig.json b/types/prosemirror-tables/tsconfig.json index 956d15d5b9..6039b257f6 100644 --- a/types/prosemirror-tables/tsconfig.json +++ b/types/prosemirror-tables/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-transform/tsconfig.json b/types/prosemirror-transform/tsconfig.json index c5799c88a6..b38cbe15db 100644 --- a/types/prosemirror-transform/tsconfig.json +++ b/types/prosemirror-transform/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-view/tsconfig.json b/types/prosemirror-view/tsconfig.json index 80349461cb..27ca267974 100644 --- a/types/prosemirror-view/tsconfig.json +++ b/types/prosemirror-view/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/protractor-browser-logs/tsconfig.json b/types/protractor-browser-logs/tsconfig.json index f0cfe8c279..3609f79a73 100644 --- a/types/protractor-browser-logs/tsconfig.json +++ b/types/protractor-browser-logs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/protractor-helpers/tsconfig.json b/types/protractor-helpers/tsconfig.json index 6a0cde55eb..011710d5ec 100644 --- a/types/protractor-helpers/tsconfig.json +++ b/types/protractor-helpers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/protractor-http-mock/tsconfig.json b/types/protractor-http-mock/tsconfig.json index be5b803a40..e901bf0729 100644 --- a/types/protractor-http-mock/tsconfig.json +++ b/types/protractor-http-mock/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/provinces/tsconfig.json b/types/provinces/tsconfig.json index d08b599b71..afb8986660 100644 --- a/types/provinces/tsconfig.json +++ b/types/provinces/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "provinces-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/proxy-addr/tsconfig.json b/types/proxy-addr/tsconfig.json index 2fa7369df3..809cf3d0b6 100644 --- a/types/proxy-addr/tsconfig.json +++ b/types/proxy-addr/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/proxyquire/tsconfig.json b/types/proxyquire/tsconfig.json index 91f5321dca..d3a8d9b5d4 100644 --- a/types/proxyquire/tsconfig.json +++ b/types/proxyquire/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pty.js/index.d.ts b/types/pty.js/index.d.ts index 5a58f4b9fb..88c2615a82 100644 --- a/types/pty.js/index.d.ts +++ b/types/pty.js/index.d.ts @@ -18,10 +18,9 @@ interface TerminalOptions { gid?: number; } -import stream = require('stream'); import net = require('net'); -export declare class Terminal implements stream.Stream { +export declare class Terminal { /** Read-only name of the terminal. */ name: string; /** Read-only number of columns in the terminal. */ @@ -69,9 +68,9 @@ export declare class Terminal implements stream.Stream { resume(): void; setEncoding(encoding: string): void; /** - * Closes the master end of the pseudo-terminal, and attempts to kill the spawned process - * associated with the slave end of the pseudo-terminal (but only if [[pid]] is not null). - */ + * Closes the master end of the pseudo-terminal, and attempts to kill the spawned process + * associated with the slave end of the pseudo-terminal (but only if [[pid]] is not null). + */ destroy(): void; // NodeJS Stream interface @@ -85,21 +84,15 @@ export declare class Terminal implements stream.Stream { once(event: string, listener: Function): this; removeListener(event: string, listener: Function): this; removeAllListeners(event?: string): this; - // NOTE: this method is not actually defined in pty.js - setMaxListeners(n: number): this; - getMaxListeners(): number; listeners(event: string): Function[]; emit(event: string, ...args: any[]): boolean; - listenerCount(type: string): number; - prependListener(event: string, listener: Function): this; - prependOnceListener(event: string, listener: Function): this; eventNames(): string[]; } /** * Creates a new pseudo-terminal, spawns a child process, and associates it with the slave -* end of the pseudo-terminal. -*/ + * end of the pseudo-terminal. + */ export declare function createTerminal(file?: string, args?: string[], opt?: TerminalOptions): Terminal; /** Alias for [[createTerminal]]. */ export declare function fork(file?: string, args?: string[], opt?: TerminalOptions): Terminal; diff --git a/types/pty.js/tsconfig.json b/types/pty.js/tsconfig.json index bea732e24f..1484657577 100644 --- a/types/pty.js/tsconfig.json +++ b/types/pty.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/public-ip/tsconfig.json b/types/public-ip/tsconfig.json index 272171128a..57230ba254 100644 --- a/types/public-ip/tsconfig.json +++ b/types/public-ip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pubnub/index.d.ts b/types/pubnub/index.d.ts index 3ad70755a0..8337acfbe4 100644 --- a/types/pubnub/index.d.ts +++ b/types/pubnub/index.d.ts @@ -1,12 +1,22 @@ // Type definitions for pubnub 4.0 // Project: https://github.com/pubnub/javascript -// Definitions by: bitbankinc , rollymaduk +// Definitions by: bitbankinc , rollymaduk , vitosamson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // @see https://www.pubnub.com/docs/web-javascript/api-reference-configuration declare class Pubnub { constructor(config: Pubnub.PubnubConfig); + static CATEGORIES: Pubnub.Categories; + + static OPERATIONS: Pubnub.Operations; + + static generateUUID(): string; + + setUUID(uuid: string): void; + + getUUID(): string; + setAuthKey(authKey: string): void; setFilterExpression(filterExpression: string): void; @@ -15,7 +25,7 @@ declare class Pubnub { publish( params: Pubnub.PublishParameters, - callback: (status: any, response: Pubnub.PublishResponse) => void + callback: (status: Pubnub.PublishStatus, response: Pubnub.PublishResponse) => void ): void; publish( @@ -24,7 +34,7 @@ declare class Pubnub { fire( params: Pubnub.FireParameters, - callback: (status: any, response: Pubnub.PublishResponse) => void + callback: (status: Pubnub.PublishStatus, response: Pubnub.PublishResponse) => void ): void; fire( @@ -45,7 +55,7 @@ declare class Pubnub { hereNow( params: Pubnub.HereNowParameters, - callback: (status: any, response: Pubnub.HereNowResponse) => void + callback: (status: Pubnub.HereNowStatus, response: Pubnub.HereNowResponse) => void ): void; hereNow( @@ -53,9 +63,31 @@ declare class Pubnub { ): Promise; whereNow( - params: {uuid: string}, + params: Pubnub.WhereNowParameters, callback: (status: Pubnub.WhereNowStatus, response: Pubnub.WhereNowResponse) => void ): void; + + whereNow( + params: Pubnub.WhereNowParameters + ): Promise; + + getState( + params: Pubnub.GetStateParameters, + callback: (status: Pubnub.GetStateStatus, state: Pubnub.GetStateResponse) => void + ): void; + + getState( + params: Pubnub.GetStateParameters + ): Promise; + + setState( + params: Pubnub.SetStateParameters, + callback: (status: Pubnub.SetStateStatus, state: Pubnub.SetStateResponse) => void + ): void; + + setState( + params: Pubnub.SetStateParameters + ): Promise; } declare namespace Pubnub { @@ -83,15 +115,30 @@ declare namespace Pubnub { secretKey?: string; } - interface PubnubData { - actualChannel: string; + interface MessageEvent { channel: string; + subscription: string; + timetoken: string; message: any; + publisher: string; + + /** + * @deprecated + */ + actualChannel: string; + + /** + * @deprecated + */ + subscribedChannel: string; } + // PubnubData was renamed to MessageEvent, keep old name for backwards compatibility + type PubnubData = MessageEvent; + interface StatusEvent { - category: string; - operation: string; + category: string; // see Pubnub.Categories + operation: string; // see Pubnub.Operations affectedChannels: string[]; subscribedChannels: string[]; affectedChannelGroups: string[]; @@ -99,6 +146,26 @@ declare namespace Pubnub { currentTimetoken: number | string; } + interface PresenceEvent { + action: 'join' | 'leave' | 'state-change' | 'timeout'; + channel: string; + occupancy: number; + state?: any; + subscription: string; + timestamp: number; + timetoken: string; + uuid: string; + + /** + * @deprecated + */ + actualChannel: string; + /** + * @deprecated + */ + subscribedChannel: string; + } + // publish interface PublishParameters { message: any; @@ -113,6 +180,13 @@ declare namespace Pubnub { timetoken: number; } + interface PublishStatus { + operation: string; // see Pubnub.Operations + category: string; // see Pubnub.Categories; + error: boolean; + errorData: Error; + } + // fire interface FireParameters { message: any; @@ -137,9 +211,9 @@ declare namespace Pubnub { // addListener interface ListenerParameters { - status?: (statusEvent: StatusEvent) => void; - message?: (data: PubnubData) => void; - presence?: (presenceEvent: any) => void; + status?(statusEvent: StatusEvent): void; + message?(messageEvent: MessageEvent): void; + presence?(presenceEvent: PresenceEvent): void; } // hereNow @@ -153,10 +227,29 @@ declare namespace Pubnub { interface HereNowResponse { totalChannels: number; totalOccupancy: number; - channels: {[channel: string]: any}; + channels: { + [channel: string]: { + name: string; + occupancy: number; + occupants: Array<{ + uuid: string; + state?: any; + }>; + }; + }; + } + + interface HereNowStatus { + error: boolean; + operation: string; // see Pubnub.Operations; + statusCode: number; } // whereNow + interface WhereNowParameters { + uuid?: string; + } + interface WhereNowStatus { error: boolean; operation: string; @@ -174,12 +267,71 @@ declare namespace Pubnub { state?: any; } + interface SetStateStatus { + error: boolean; + operation: string; + statusCode: number; + } + + interface SetStateResponse { + state: any; + } + // getState interface GetStateParameters { uuid?: string; channels?: string[]; channelGroups?: string[]; } + + interface GetStateStatus { + error: boolean; + operation: string; + statusCode: number; + } + + interface GetStateResponse { + channels: { + [channel: string]: any; + }; + } + + interface Categories { + PNNetworkUpCategory: string; + PNNetworkDownCategory: string; + PNNetworkIssuesCategory: string; + PNTimeoutCategory: string; + PNBadRequestCategory: string; + PNAccessDeniedCategory: string; + PNUnknownCategory: string; + PNReconnectedCategory: string; + PNConnectedCategory: string; + PNRequestMessageCountExceededCategory: string; + } + + interface Operations { + PNTimeOperation: string; + PNHistoryOperation: string; + PNDeleteMessagesOperation: string; + PNFetchMessagesOperation: string; + PNSubscribeOperation: string; + PNUnsubscribeOperation: string; + PNPublishOperation: string; + PNPushNotificationEnabledChannelsOperation: string; + PNRemoveAllPushNotificationsOperation: string; + PNWhereNowOperation: string; + PNSetStateOperation: string; + PNHereNowOperation: string; + PNGetStateOperation: string; + PNHeartbeatOperation: string; + PNChannelGroupsOperation: string; + PNRemoveGroupOperation: string; + PNChannelsForGroupOperation: string; + PNAddChannelsToGroupOperation: string; + PNRemoveChannelsFromGroupOperation: string; + PNAccessManagerGrant: string; + PNAccessManagerAudit: string; + } } -export default Pubnub; +export = Pubnub; diff --git a/types/pubnub/pubnub-tests.ts b/types/pubnub/pubnub-tests.ts index 291fc035fe..63bd206cde 100644 --- a/types/pubnub/pubnub-tests.ts +++ b/types/pubnub/pubnub-tests.ts @@ -1,4 +1,4 @@ -import Pubnub from 'pubnub'; +import * as Pubnub from 'pubnub'; const console = { log: (params: any) => {} @@ -36,8 +36,10 @@ pubnub.subscribe({channels: ['channel-1']}); pubnub.addListener({ status: statusEvent => { - if (statusEvent.category === "PNConnectedCategory") { + if (statusEvent.category === Pubnub.CATEGORIES.PNConnectedCategory) { console.log(statusEvent.category); + } else if (statusEvent.operation === Pubnub.OPERATIONS.PNAccessManagerAudit) { + console.log(statusEvent.operation); } }, message: message => { @@ -49,3 +51,38 @@ pubnub.addListener({ }); pubnub.unsubscribe({channels: ['channel-1']}); + +pubnub.unsubscribeAll(); + +pubnub.setUUID(Pubnub.generateUUID()); +const uuid = pubnub.getUUID(); + +pubnub.whereNow({ uuid: '' }, (status, res) => { + if (!status.error) { + console.log(res.channels[0]); + } +}); + +pubnub.whereNow({ uuid: '' }).then(res => { + console.log(res.channels[1]); +}); + +pubnub.getState({ uuid: '' }, (status, res) => { + if (!status.error) { + console.log(res.channels[0]); + } +}); + +pubnub.getState({ uuid: '' }).then(res => { + console.log(res.channels[1]); +}); + +pubnub.setState({ channels: [] }, (status, res) => { + if (!status.error) { + console.log(res.state); + } +}); + +pubnub.setState({ channels: [] }).then(res => { + console.log(res.state); +}); diff --git a/types/pubnub/tsconfig.json b/types/pubnub/tsconfig.json index fab1a92335..b8a4d1d681 100644 --- a/types/pubnub/tsconfig.json +++ b/types/pubnub/tsconfig.json @@ -1,23 +1,24 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "pubnub-tests.ts" - ] -} + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "pubnub-tests.ts" + ] +} \ No newline at end of file diff --git a/types/pubsub-js/tsconfig.json b/types/pubsub-js/tsconfig.json index bccf35e64b..a83540e471 100644 --- a/types/pubsub-js/tsconfig.json +++ b/types/pubsub-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pug/tsconfig.json b/types/pug/tsconfig.json index efae8f261c..1d456b72d9 100644 --- a/types/pug/tsconfig.json +++ b/types/pug/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pulltorefreshjs/tsconfig.json b/types/pulltorefreshjs/tsconfig.json index 000858aefb..f20918e9b2 100644 --- a/types/pulltorefreshjs/tsconfig.json +++ b/types/pulltorefreshjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pump/pump-tests.ts b/types/pump/pump-tests.ts index 0c8e91b2c0..cf3393de21 100644 --- a/types/pump/pump-tests.ts +++ b/types/pump/pump-tests.ts @@ -1,4 +1,4 @@ -import * as pump from 'pump'; +import pump = require('pump'); import { createReadStream, createWriteStream } from 'fs'; import { Transform } from 'stream'; diff --git a/types/pump/tsconfig.json b/types/pump/tsconfig.json index 64e36bc754..e10b3daf90 100644 --- a/types/pump/tsconfig.json +++ b/types/pump/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pupa/tsconfig.json b/types/pupa/tsconfig.json index 3800bab180..d4d761ce00 100644 --- a/types/pupa/tsconfig.json +++ b/types/pupa/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "pupa-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/puppeteer/index.d.ts b/types/puppeteer/index.d.ts index d0958706e9..a325a871be 100644 --- a/types/puppeteer/index.d.ts +++ b/types/puppeteer/index.d.ts @@ -1,13 +1,15 @@ -// Type definitions for puppeteer 0.13 +// Type definitions for puppeteer 1.0 // Project: https://github.com/GoogleChrome/puppeteer#readme // Definitions by: Marvin Hagemeister // Christopher Deutsch +// jwbay // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 /// import { EventEmitter } from "events"; +import { ChildProcess } from "child_process"; /** Keyboard provides an api for managing a virtual keyboard. */ export interface Keyboard { @@ -91,10 +93,16 @@ export interface Touchscreen { * You can use `tracing.start` and `tracing.stop` to create a trace file which can be opened in Chrome DevTools or timeline viewer. */ export interface Tracing { - start(options: { path: string; screenshots?: boolean }): Promise; + start(options: TracingStartOptions): Promise; stop(): Promise; } +export interface TracingStartOptions { + path: string; + screenshots?: boolean; + categories?: string[]; +} + /** Dialog objects are dispatched by page via the 'dialog' event. */ export interface Dialog { /** @@ -113,16 +121,16 @@ export interface Dialog { message(): string; /** The dialog type. Dialog's type, can be one of `alert`, `beforeunload`, `confirm` or `prompt`. */ - type: "alert" | "beforeunload" | "confirm" | "prompt"; + type(): "alert" | "beforeunload" | "confirm" | "prompt"; } /** ConsoleMessage objects are dispatched by page via the 'console' event. */ export interface ConsoleMessage { /** The message arguments. */ - args: JSHandle[]; + args(): JSHandle[]; /** The message text. */ - text: string; - type: 'log' | 'debug' | 'info' | 'error' | 'warning' | 'dir' | 'dirxml' | 'table' | + text(): string; + type(): 'log' | 'debug' | 'info' | 'error' | 'warning' | 'dir' | 'dirxml' | 'table' | 'trace' | 'clear' | 'startGroup' | 'startGroupCollapsed' | 'endGroup' | 'assert' | 'profile' | 'profileEnd' | 'count' | 'timeEnd'; } @@ -302,6 +310,24 @@ export interface PDFOptions { * @default false */ displayHeaderFooter?: boolean; + /** + * HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: + * - `date` formatted print date + * - `title` document title + * - `url` document location + * - `pageNumber` current page number + * - `totalPages` total pages in the document + */ + headerTemplate?: string; + /** + * HTML template for the print footer. Should be valid HTML markup with following classes used to inject printing values into them: + * - `date` formatted print date + * - `title` document title + * - `url` document location + * - `pageNumber` current page number + * - `totalPages` total pages in the document + */ + footerTemplate?: string; /** * Print background graphics. * @default false @@ -418,6 +444,10 @@ export interface ElementHandle extends JSHandle { * @since 0.13.0 */ $$(selector: string): Promise; + /** + * @param selector XPath expression to evaluate. + */ + $x(expression: string): Promise; /** * This method returns the value resolve to the bounding box of the element (relative to the main frame), or null if the element is not visible. */ @@ -590,20 +620,25 @@ export interface Request { */ continue(overrides?: Overrides): Promise; + /** + * @returns The `Frame` object that initiated the request, or `null` if navigating to error pages + */ + frame(): Promise; + /** * An object with HTTP headers associated with the request. * All header names are lower-case. */ - headers: Headers; + headers(): Headers; /** Returns the request's method (GET, POST, etc.) */ - method: HttpMethod; + method(): HttpMethod; /** Contains the request's post body, if any. */ - postData: string | undefined; + postData(): string | undefined; /** Contains the request's resource type as it was perceived by the rendering engine. */ - resourceType: ResourceType; + resourceType(): ResourceType; /** * Fulfills request with given response. @@ -617,7 +652,7 @@ export interface Request { response(): Response | null; /** Contains the URL of the request. */ - url: string; + url(): string; } /** Options for `Request.respond` method */ export interface RespondOptions { @@ -639,22 +674,22 @@ export interface Response { /** Promise which resolves to a buffer with response body. */ buffer(): Promise; /** An object with HTTP headers associated with the response. All header names are lower-case. */ - headers: Headers; + headers(): Headers; /** * Promise which resolves to a JSON representation of response body. * @throws This method will throw if the response body is not parsable via `JSON.parse`. */ json(): Promise; /** Contains a boolean stating whether the response was successful (status in the range 200-299) or not. */ - ok: boolean; + ok(): boolean; /** A matching Request object. */ request(): Request; /** Contains the status code of the response (e.g., 200 for a success). */ - status: number; + status(): number; /** Promise which resolves to a text representation of response body. */ text(): Promise; /** Contains the URL of the response. */ - url: string; + url(): string; } export interface FrameBase { @@ -667,6 +702,10 @@ export interface FrameBase { * The method runs document.querySelectorAll within the page. If no elements match the selector, the return value resolve to []. */ $$(selector: string): Promise; + /** + * @param expression XPath expression to evaluate. + */ + $x(expression: string): Promise; /** * This method runs document.querySelector within the page and passes it as the first argument to `fn`. @@ -699,6 +738,9 @@ export interface FrameBase { /** Adds a `` tag into the page with the desired url or a ` + + `; + } +} + +customElements.define('with-context', WithContextRoot); +customElements.define('with-context-descendant', WithContextDescendant); + +// showcase of full component With context + +class WithContextRootFull extends Component<{}, {}, Context> { + context = { + background: 'white', + color: 'black', + margin: '10px 0', + padding: '10px' + }; + connectedCallback() { + this.attachShadow({ mode: 'open' }).innerHTML = ` + + + ...and shadow DOM! + + `; + } +} + +class WithContextDescendantFull extends Component<{}, {}, Context> { + connected() { + const { background, color, margin, padding } = this.context; + this.attachShadow({ mode: 'open' }).innerHTML = ` + + + `; + } +} diff --git a/types/skatejs/test/mixins/with-lifecycle.ts b/types/skatejs/test/mixins/with-lifecycle.ts new file mode 100644 index 0000000000..53dc7ed056 --- /dev/null +++ b/types/skatejs/test/mixins/with-lifecycle.ts @@ -0,0 +1,19 @@ +import { withLifecycle, WithLifecycle } from 'skatejs'; + +class Base extends HTMLElement { + protected _isConnected = false; + connectedCallback() { + this._isConnected = true; + } +} + +class WithLifecycleComponent extends withLifecycle(Base) { + connecting() { + this.innerHTML += this._isConnected ? 'ray!' : 'Hoo'; + } + connected() { + this.innerHTML += this._isConnected ? 'ray!' : 'Hoo'; + } +} + +customElements.define('with-lifecycle', WithLifecycleComponent); diff --git a/types/skatejs/test/mixins/with-renderer.ts b/types/skatejs/test/mixins/with-renderer.ts new file mode 100644 index 0000000000..fb74b0141a --- /dev/null +++ b/types/skatejs/test/mixins/with-renderer.ts @@ -0,0 +1,20 @@ +import { withRenderer, Renderer } from 'skatejs'; + +const myRenderer = (Base = HTMLElement) => + class extends Base implements Renderer { + renderer(root: Element | ShadowRoot, render: (props?: {}) => string) { + root.innerHTML = render(); + } + }; + +class WithRenderer extends withRenderer(myRenderer()) { + static observedAttributes = ['name']; + attributeChangedCallback() { + this.updated(); + } + render() { + return `Hello, ${this.getAttribute('name')}!`; + } +} + +customElements.define('with-renderer', WithRenderer); diff --git a/types/skatejs/test/mixins/with-update.ts b/types/skatejs/test/mixins/with-update.ts new file mode 100644 index 0000000000..2da35cffaa --- /dev/null +++ b/types/skatejs/test/mixins/with-update.ts @@ -0,0 +1,37 @@ +import { props, withUpdate } from 'skatejs'; + +// tslint:disable-next-line interface-over-type-literal +type Props = { name: string }; +// tslint:disable-next-line interface-over-type-literal +type State = undefined; + +class WithProps extends withUpdate() { + // This is where you declare your props. + static props = { + // This will define a handler for the name attribute that will set the name + // prop. When the name prop is set, it will trigger an update allowing you + // to react to the changes in shouldUpdate. + name: props.string + }; + + constructor() { + super(); + this.attachShadow({ mode: 'open' }); + } + + // Called when props have been set regardless of if they've changed. + updating(props: Props) {} + + // Called to check whether or not the component should call + // updated(), much like React's shouldComponentUpdate(). + shouldUpdate(props: Props, state: State) { + return true; + } + + // Called if shouldUpdate returned true. + updated() { + this.shadowRoot!.innerHTML = `Hey, ${this.props.name}!`; + } +} + +customElements.define('with-update', WithProps); diff --git a/types/skatejs/test/renderers/custom.ts b/types/skatejs/test/renderers/custom.ts new file mode 100644 index 0000000000..3704076616 --- /dev/null +++ b/types/skatejs/test/renderers/custom.ts @@ -0,0 +1,21 @@ +import { withComponent, Renderer, define } from 'skatejs'; + +const withRenderer = () => + class extends HTMLElement implements Renderer { + renderer(root: HTMLElement, html: () => Element): void { + root.innerHTML = ''; + root.appendChild(html()); + } + }; + +const Component = withComponent(withRenderer()); + +class MyComponent extends Component { + render() { + const el = document.createElement('div'); + el.innerHTML = 'Hello, !'; + return el; + } +} + +define(MyComponent); diff --git a/types/skatejs/test/renderers/default.ts b/types/skatejs/test/renderers/default.ts new file mode 100644 index 0000000000..3ec9828852 --- /dev/null +++ b/types/skatejs/test/renderers/default.ts @@ -0,0 +1,16 @@ +import { props, withComponent } from 'skatejs'; + +// tslint:disable-next-line interface-over-type-literal +type Props = { + name: string; +}; +class WithDefault extends withComponent() { + static props = { + name: props.string + }; + render({ name }: Props) { + return `Hello, ${name}!`; + } +} + +customElements.define('with-default', WithDefault); diff --git a/types/skatejs/test/utils/define.ts b/types/skatejs/test/utils/define.ts new file mode 100644 index 0000000000..038c25b231 --- /dev/null +++ b/types/skatejs/test/utils/define.ts @@ -0,0 +1,12 @@ +import { define } from 'skatejs'; + +export const MyComponent = define( + class extends HTMLElement { + static is = 'my-element'; + } +); + +@define +export default class extends HTMLElement { + static is = 'my-element'; +} diff --git a/types/skatejs/test/utils/emit.ts b/types/skatejs/test/utils/emit.ts new file mode 100644 index 0000000000..73c07a39c8 --- /dev/null +++ b/types/skatejs/test/utils/emit.ts @@ -0,0 +1,18 @@ +import { emit } from 'skatejs'; + +class Test extends HTMLElement { + constructor() { + super(); + this.attachShadow({ mode: 'open' }); + } + connectedCallback() { + emit(this, 'myevent', { + detail: {} + }); + + emit(this.shadowRoot!, 'myeventfromshadow', { + // Does not propagate through shadow boundaries by default, need to explicitly override to true + composed: true + }); + } +} diff --git a/types/skatejs/test/utils/link.ts b/types/skatejs/test/utils/link.ts new file mode 100644 index 0000000000..bf912b4d7a --- /dev/null +++ b/types/skatejs/test/utils/link.ts @@ -0,0 +1,34 @@ +import { link, withComponent } from 'skatejs'; + +// artificial definitions for 3rd party imports +// import { html } from 'lit-html/lib/lit-extended'; +declare const html: (...args: any[]) => string; +// import withLitHtml from '@skatejs/renderer-lit-html'; +declare const withLitHtml: () => any; + +// tslint:disable-next-line interface-over-type-literal +type Props = { + state: State; +}; +// tslint:disable-next-line interface-over-type-literal +type State = { + email: string; +}; +export default class extends withComponent(withLitHtml()) { + // this may look strange, but state is under the hood property of props :) + render({ state }: Props) { + return html` + + `; + } + private otherLinkUsage() { + link(this, 'state.customName'); + link(this, 'someProp'); + link(this, 'props.someProp'); + } +} diff --git a/types/skatejs/test/utils/name.ts b/types/skatejs/test/utils/name.ts new file mode 100644 index 0000000000..c85217b355 --- /dev/null +++ b/types/skatejs/test/utils/name.ts @@ -0,0 +1,16 @@ +import { name } from 'skatejs'; + +// x-element +name(); + +// x-element-1 +name(); + +// x-tabs +name('tabs'); + +// my-tabs +name('my-tabs'); + +// my-tabs-1 +name('my-tabs'); diff --git a/types/skatejs/test/utils/shadow.ts b/types/skatejs/test/utils/shadow.ts new file mode 100644 index 0000000000..e608b86225 --- /dev/null +++ b/types/skatejs/test/utils/shadow.ts @@ -0,0 +1,7 @@ +import { shadow } from 'skatejs'; + +class CustomElement extends HTMLElement { + connectedCallback() { + shadow(this).innerHTML = 'Hello, World!'; + } +} diff --git a/types/skatejs/tsconfig.json b/types/skatejs/tsconfig.json new file mode 100644 index 0000000000..4ebef1d933 --- /dev/null +++ b/types/skatejs/tsconfig.json @@ -0,0 +1,43 @@ +{ + "compilerOptions": { + "target": "esnext", + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "strictNullChecks": true, + "strictFunctionTypes": false, + "noImplicitAny": true, + "noImplicitThis": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "experimentalDecorators": true + }, + "files": [ + "index.d.ts", + "test/components/custom-base.ts", + "test/components/no-shadow-root.ts", + "test/components/props-set-get.ts", + "test/components/with-custom-base.ts", + "test/mixins/with-children.ts", + "test/mixins/with-component.ts", + "test/mixins/with-context.ts", + "test/mixins/with-lifecycle.ts", + "test/mixins/with-renderer.ts", + "test/mixins/with-update.ts", + "test/renderers/custom.ts", + "test/renderers/default.ts", + "test/utils/define.ts", + "test/utils/emit.ts", + "test/utils/link.ts", + "test/utils/name.ts", + "test/utils/shadow.ts" + ] +} \ No newline at end of file diff --git a/types/skatejs/tslint.json b/types/skatejs/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/skatejs/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/skatejs/types.d.ts b/types/skatejs/types.d.ts new file mode 100644 index 0000000000..3c368bd67f --- /dev/null +++ b/types/skatejs/types.d.ts @@ -0,0 +1,112 @@ +export type Mixed = {}; +export type Maybe = T | null | undefined; +export type Constructor = new (...args: any[]) => T; +export type HTMLElementClass = typeof HTMLElement; + +export type ComponentProps = { [P in keyof T]: PropOptions }; + +// NOTE: +// - all classes are just ambient definitions (opaque types like), so consumer cannot use them directly +// - inferring generics work only on instances, not on implementation type. So this will not give you type safety, you still have to manually annotate those props in your code +/** + * Implement this interface for any @skatejs/renderer-* + */ +export interface Renderer { + renderer(root: Node | Element | ShadowRoot, html: (props?: Mixed, state?: Mixed) => O): void; +} + +export interface WithComponent

+ extends CustomElement, + WithChildren, + WithLifecycle, + WithRenderer, + WithUpdate, + WithContext {} + +export declare class WithComponent

extends HTMLElement { + static readonly observedAttributes: string[]; +} + +// Custom Elements v1 +export class CustomElement extends HTMLElement { + static readonly observedAttributes: string[]; + connectedCallback(): void; + disconnectedCallback(): void; + attributeChangedCallback(name: string, oldValue: null | string, newValue: null | string): void; + adoptedCallback?(): void; +} + +export declare class WithChildren extends HTMLElement { + childrenUpdated(): void; +} +export declare class WithLifecycle extends HTMLElement { + connecting(): void; + connected(): void; + disconnecting(): void; + disconnected(): void; +} + +export declare class WithContext extends HTMLElement { + context: C; +} + +export declare class WithRenderer extends HTMLElement implements Renderer { + // getter for turning of ShadowDOM + readonly renderRoot?: this | Mixed; + + updated(props?: Mixed, state?: Mixed): void; + // called before render + rendering?(): void; + render(props?: Mixed, state?: Mixed): O; + + // Default renderer, returns string returned from render and adds it to root via innerHTML + // -> override to get own renderer + renderer(root: Element | Node | ShadowRoot, html: (props?: Mixed | undefined) => O): void; + + // called after render + rendered?(): void; +} + +export declare class WithUpdate

extends HTMLElement { + // Special hack for own components type checking. + // It works in combination with ElementAttributesProperty. It placed in jsx.d.ts. + // more detail, see: https://www.typescriptlang.org/docs/handbook/jsx.html + // and https://github.com/skatejs/skatejs/pull/952#issuecomment-264500153 + readonly props: Readonly

; + state: S; + + // Called when props have been set regardless of if they've changed. much like React's componentWillReceiveProps(). + updating(props?: P, state?: S): void; + + // Called to check whether or not the component should call updated(), much like React's shouldComponentUpdate(). + shouldUpdate(props?: P, state?: S): boolean; + + // Called if shouldUpdate returned true, much like React's componentWillUpdate() + updated(props?: Mixed, state?: Mixed): void; + + // manually force update + triggerUpdate(): void; +} + +export interface PropOptions { + attribute?: PropOptionsAttribute; + coerce?: (value: any) => Maybe; + default?: T; + deserialize?: (value: string | null) => Maybe; + serialize?: (value: Maybe) => string | null; +} + +export type PropOptionsAttribute = PropOptionsAttributeIdentifier | PropOptionsAttributeIdentifierMap; +export type PropOptionsAttributeIdentifier = boolean | string; +export type PropOptionsAttributeIdentifierMap = { + source?: PropOptionsAttributeIdentifier; + target?: PropOptionsAttributeIdentifier; +}; + +export interface EventOptions extends CustomEventInit { + composed?: boolean; +} +export interface ComposedCustomEvent extends CustomEvent { + composed?: boolean; + composedPath?: () => Array; +} diff --git a/types/ski/tsconfig.json b/types/ski/tsconfig.json index a523a14f5d..ea3d95c968 100644 --- a/types/ski/tsconfig.json +++ b/types/ski/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/skyway/tsconfig.json b/types/skyway/tsconfig.json index 28f48c9f91..000b23019b 100644 --- a/types/skyway/tsconfig.json +++ b/types/skyway/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/slack-node/slack-node-tests.ts b/types/slack-node/slack-node-tests.ts index b14029af19..d2dfc0541d 100644 --- a/types/slack-node/slack-node-tests.ts +++ b/types/slack-node/slack-node-tests.ts @@ -1,4 +1,4 @@ -import * as Slack from "slack-node"; +import Slack = require("slack-node"); let webhookUri = "__uri___"; diff --git a/types/slack-node/tsconfig.json b/types/slack-node/tsconfig.json index 66c41e14ca..8dd0dc0200 100644 --- a/types/slack-node/tsconfig.json +++ b/types/slack-node/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/slack-winston/tsconfig.json b/types/slack-winston/tsconfig.json index ce19979192..72e8ad807d 100644 --- a/types/slack-winston/tsconfig.json +++ b/types/slack-winston/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/slackify-html/tsconfig.json b/types/slackify-html/tsconfig.json index 587cafc4af..2bdd1a67ee 100644 --- a/types/slackify-html/tsconfig.json +++ b/types/slackify-html/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/slate-irc/slate-irc-tests.ts b/types/slate-irc/slate-irc-tests.ts index 3b1dd6bd3f..ce344ffa75 100644 --- a/types/slate-irc/slate-irc-tests.ts +++ b/types/slate-irc/slate-irc-tests.ts @@ -1,6 +1,5 @@ - import * as net from "net"; -import * as SlateIRC from "slate-irc"; +import SlateIRC = require("slate-irc"); let socket: net.Socket; const client = SlateIRC(socket); diff --git a/types/slate-irc/tsconfig.json b/types/slate-irc/tsconfig.json index 7cc47ac753..0b2ee18841 100644 --- a/types/slate-irc/tsconfig.json +++ b/types/slate-irc/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/sleep/tsconfig.json b/types/sleep/tsconfig.json index e852889ba0..68b1bb755f 100644 --- a/types/sleep/tsconfig.json +++ b/types/sleep/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/slick-carousel/tsconfig.json b/types/slick-carousel/tsconfig.json index eac3bfb435..93841cf465 100644 --- a/types/slick-carousel/tsconfig.json +++ b/types/slick-carousel/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/slickgrid/tsconfig.json b/types/slickgrid/tsconfig.json index 4609f7987e..5a0379abbb 100644 --- a/types/slickgrid/tsconfig.json +++ b/types/slickgrid/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/slideout/tsconfig.json b/types/slideout/tsconfig.json index fa40f2a294..a09c45f8cd 100644 --- a/types/slideout/tsconfig.json +++ b/types/slideout/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/slimerjs/tsconfig.json b/types/slimerjs/tsconfig.json index 0d9e8b3602..3b75b01c5d 100644 --- a/types/slimerjs/tsconfig.json +++ b/types/slimerjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/slocket/tsconfig.json b/types/slocket/tsconfig.json index 719eba3d10..c351599095 100644 --- a/types/slocket/tsconfig.json +++ b/types/slocket/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/slug/tsconfig.json b/types/slug/tsconfig.json index 9fffc268fa..2ccb1c0371 100644 --- a/types/slug/tsconfig.json +++ b/types/slug/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/smart-fox-server/tsconfig.json b/types/smart-fox-server/tsconfig.json index 1c0bd310b8..e30bc1d69a 100644 --- a/types/smart-fox-server/tsconfig.json +++ b/types/smart-fox-server/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/smoothscroll-polyfill/tsconfig.json b/types/smoothscroll-polyfill/tsconfig.json index f21a2ae0ef..bd789c08a2 100644 --- a/types/smoothscroll-polyfill/tsconfig.json +++ b/types/smoothscroll-polyfill/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/smtp-server/tsconfig.json b/types/smtp-server/tsconfig.json index 1301c38576..1b852d3cb0 100644 --- a/types/smtp-server/tsconfig.json +++ b/types/smtp-server/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/smtp-server/v1/tsconfig.json b/types/smtp-server/v1/tsconfig.json index b038c6c6f8..b1dc362ab8 100644 --- a/types/smtp-server/v1/tsconfig.json +++ b/types/smtp-server/v1/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/smtpapi/tsconfig.json b/types/smtpapi/tsconfig.json index 16bd06b68c..b87794c028 100644 --- a/types/smtpapi/tsconfig.json +++ b/types/smtpapi/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/snapsvg/index.d.ts b/types/snapsvg/index.d.ts index ff0e9d09a9..a3397cedaa 100644 --- a/types/snapsvg/index.d.ts +++ b/types/snapsvg/index.d.ts @@ -278,7 +278,7 @@ declare namespace Snap { ellipse(x:number,y:number,rx:number,ry:number):Snap.Element; image(src:string,x:number,y:number,width:number,height:number):Snap.Element; line(x1:number,y1:number,x2:number,y2:number):Snap.Element; - path(pathString?:string):Snap.Element; + path(pathSpec: string | (string | number)[][]): Snap.Element; polygon(varargs:any[]):Snap.Element; polyline(varargs:any[]):Snap.Element; rect(x:number,y:number,width:number,height:number,rx?:number,ry?:number):Snap.Element; diff --git a/types/snapsvg/test/3.ts b/types/snapsvg/test/3.ts index 70381001ca..a97caefa45 100644 --- a/types/snapsvg/test/3.ts +++ b/types/snapsvg/test/3.ts @@ -193,9 +193,9 @@ window.onload=()=>{ var myPathString = "M 60 0 L 120 0 L 180 60 L 180 120 L 120 180 L 60 180 L 0 120 L 0 60 Z"; var p = s.path( myPathString ); + s.path([["M", 5, 10], ["l", 15, 2], ["Z"]]); var p2 = s.path( myPathString ).transform("t" + myTranslateX + "," + myTranslateY); - for( var count = 0; count < 500; count++ ) { x = Math.random() * 800; y = Math.random() * 400; diff --git a/types/snapsvg/tsconfig.json b/types/snapsvg/tsconfig.json index 7ee69cd259..411d49f296 100644 --- a/types/snapsvg/tsconfig.json +++ b/types/snapsvg/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/snazzy-info-window/tsconfig.json b/types/snazzy-info-window/tsconfig.json index 0fa4776bac..537c7624b4 100644 --- a/types/snazzy-info-window/tsconfig.json +++ b/types/snazzy-info-window/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/snekfetch/snekfetch-tests.ts b/types/snekfetch/snekfetch-tests.ts index 69e9743f83..211ef5bd80 100644 --- a/types/snekfetch/snekfetch-tests.ts +++ b/types/snekfetch/snekfetch-tests.ts @@ -1,6 +1,6 @@ import * as fs from 'fs'; import * as util from 'util'; -import * as snekfetch from 'snekfetch'; +import snekfetch = require('snekfetch'); const writeFile = util.promisify(fs.writeFile); diff --git a/types/snekfetch/tsconfig.json b/types/snekfetch/tsconfig.json index 37402433cc..58206daccc 100644 --- a/types/snekfetch/tsconfig.json +++ b/types/snekfetch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/snoowrap/snoowrap-tests.ts b/types/snoowrap/snoowrap-tests.ts index dfea881a8b..afa9a46fa2 100644 --- a/types/snoowrap/snoowrap-tests.ts +++ b/types/snoowrap/snoowrap-tests.ts @@ -1,4 +1,4 @@ -import * as Snoowrap from 'snoowrap'; +import Snoowrap = require('snoowrap'); import { Comment, Listing, diff --git a/types/snoowrap/tsconfig.json b/types/snoowrap/tsconfig.json index 80f4cc5617..3503aa1723 100644 --- a/types/snoowrap/tsconfig.json +++ b/types/snoowrap/tsconfig.json @@ -16,6 +16,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "noUnusedLocals": true }, "files": [ diff --git a/types/snowboy/tsconfig.json b/types/snowboy/tsconfig.json index 1a013bcb02..beec93bce3 100644 --- a/types/snowboy/tsconfig.json +++ b/types/snowboy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/socket.io-client/tsconfig.json b/types/socket.io-client/tsconfig.json index 972f8843d6..959aebca1b 100644 --- a/types/socket.io-client/tsconfig.json +++ b/types/socket.io-client/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/socket.io-parser/tsconfig.json b/types/socket.io-parser/tsconfig.json index ff1a74f45e..46a6fffc8d 100644 --- a/types/socket.io-parser/tsconfig.json +++ b/types/socket.io-parser/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/socket.io-redis/index.d.ts b/types/socket.io-redis/index.d.ts index d6e5edf92b..3de732084b 100644 --- a/types/socket.io-redis/index.d.ts +++ b/types/socket.io-redis/index.d.ts @@ -1,13 +1,14 @@ // Type definitions for socket.io-redis 1.0.0 // Project: https://github.com/socketio/socket.io-redis // Definitions by: Philipp Holzer +// seeLuck // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// declare module 'socket.io-redis' { - var redis: SocketIORedisStatic; + let redis: SocketIORedisStatic; export = redis; } @@ -60,6 +61,11 @@ declare namespace SocketIORedis { */ port?: number; + /** + * The optional password to connect to redis on + */ + auth_pass?: number | string; + /** * The optional redis client to publish events on */ @@ -131,16 +137,16 @@ declare namespace SocketIORedis { clients(callback: (err: any, clients: string[]) => void) : void; /** - * clientRooms returns the list of rooms the client with the given ID has joined + * clientRooms returns the list of rooms the client with the given ID has joined * (even on another node). - * @param {string} id - * @param {(err: any, rooms: string[]) => void} callback + * @param {string} id + * @param {(err: any, rooms: string[]) => void} callback */ clientRooms(id: string, callback: (err: any, rooms: string[]) => void) : void; /** * allRooms returns the list of all rooms. - * @param {(err: any, rooms: string[]) => void} callback + * @param {(err: any, rooms: string[]) => void} callback */ allRooms(callback: (err: any, rooms: string[]) => void) : void; @@ -150,7 +156,7 @@ declare namespace SocketIORedis { * err argument if the socket was not found. * @param {string} id the socket Id. * @param {string} room the room Id. - * @param {(err: any) => void} callback + * @param {(err: any) => void} callback */ remoteJoin(id: string, room: string, callback: (err: any) => void) : void; @@ -160,26 +166,26 @@ declare namespace SocketIORedis { * err argument if the socket was not found. * @param {string} id the socket Id. * @param {string} room the room Id. - * @param {(err: any) => void} callback + * @param {(err: any) => void} callback */ remoteLeave(id: string, room: string, callback: (err: any) => void) : void; /** - * remoteDisconnect makes the socket with the given id to get disconnected. - * If close is set to true, it also closes the underlying socket. - * The callback will be called once the socket was disconnected, or with an + * remoteDisconnect makes the socket with the given id to get disconnected. + * If close is set to true, it also closes the underlying socket. + * The callback will be called once the socket was disconnected, or with an * err argument if the socket was not found. * @param {string} id the socket Id. * @param {boolean} close close the underlying socket - * @param {(err: any) => void} callback + * @param {(err: any) => void} callback */ remoteDisconnect(id: string, close: boolean, callback: (err: any) => void) : void; /** - * customRequest sends a request to every nodes, that will respond through the + * customRequest sends a request to every nodes, that will respond through the * customHook method. * @param {any} data - * @param {(err: any, replies: any[]) => void} callback + * @param {(err: any, replies: any[]) => void} callback */ customRequest(data: any, callback: (err: any, replies: any[]) => void) : void; } diff --git a/types/socket.io-redis/tsconfig.json b/types/socket.io-redis/tsconfig.json index 2d96ef817a..63313c05ec 100644 --- a/types/socket.io-redis/tsconfig.json +++ b/types/socket.io-redis/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/socket.io.users/tsconfig.json b/types/socket.io.users/tsconfig.json index 3261ff53d5..7ab3bd080d 100644 --- a/types/socket.io.users/tsconfig.json +++ b/types/socket.io.users/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/socket.io/tsconfig.json b/types/socket.io/tsconfig.json index ec123a68f8..7345d645e5 100644 --- a/types/socket.io/tsconfig.json +++ b/types/socket.io/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/socketio-jwt-auth/index.d.ts b/types/socketio-jwt-auth/index.d.ts new file mode 100644 index 0000000000..7898f67454 --- /dev/null +++ b/types/socketio-jwt-auth/index.d.ts @@ -0,0 +1,32 @@ +// Type definitions for socketio-jwt-auth 0.0 +// Project: https://github.com/adcentury/socketio-jwt-auth#readme +// Definitions by: Peter Harris +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import SocketIO = require("socket.io"); + +/** + * This function returns a middleware function for use with Socket.IO that authenticates a new connection. + * + * @param options is an object literal that contains options. + * @param verify is a function with two args payload, and done. + */ +export function authenticate(options: authOptions, verify: verifyFunc): (socket: SocketIO.Socket, fn: (err?: any) => void) => void; + +/** + * This is an object literal that contains options. + */ +export interface authOptions { + secret: string; + algorithm?: string; + succeedWithoutToken?: boolean; +} + +/** + * This is a function with two args payload, and done. + * + * `payload` is the decoded JWT payload + * `done` is an error-first callback with three args: done(err, user, message). + */ +export type verifyFunc = (payload: any, done: (err?: Error | null, user?: any, message?: string) => void) => void; diff --git a/types/socketio-jwt-auth/socketio-jwt-auth-tests.ts b/types/socketio-jwt-auth/socketio-jwt-auth-tests.ts new file mode 100644 index 0000000000..b88020e85f --- /dev/null +++ b/types/socketio-jwt-auth/socketio-jwt-auth-tests.ts @@ -0,0 +1,41 @@ +import SocketIo = require('socket.io'); +import jwtAuth = require('socketio-jwt-auth'); + +const io = SocketIo(); +const User: { + findOne: (options: { id: number }, callback: (err: Error, user: any) => void) => void +} = {}; + +// using middleware +io.use(jwtAuth.authenticate({ + secret: 'Your Secret', // required, used to verify the token's signature + algorithm: 'HS256', // optional, default to be HS256 + succeedWithoutToken: true +}, (payload: any, done) => { + // you done callback will not include any payload data now + // if no token was supplied + if (payload && payload.sub) { + User.findOne({id: payload.sub}, (err, user) => { + if (err) { + // return error + done(err); + + return; + } + if (!user) { + // return fail with an error message + done(null, false, 'user does not exist'); + + return; + } + // return success with a user info + done(null, user); + + return; + }); + } else { + done(); // in your connection handler user.logged_in will be false + + return; + } +})); diff --git a/types/socketio-jwt-auth/tsconfig.json b/types/socketio-jwt-auth/tsconfig.json new file mode 100644 index 0000000000..1c8402a670 --- /dev/null +++ b/types/socketio-jwt-auth/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "socketio-jwt-auth-tests.ts" + ] +} \ No newline at end of file diff --git a/types/socketio-jwt-auth/tslint.json b/types/socketio-jwt-auth/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/socketio-jwt-auth/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/socketio-wildcard/tsconfig.json b/types/socketio-wildcard/tsconfig.json index 38896916e2..925e21d2e5 100644 --- a/types/socketio-wildcard/tsconfig.json +++ b/types/socketio-wildcard/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/socketty/tsconfig.json b/types/socketty/tsconfig.json index b8623c87c6..5ead60c0fc 100644 --- a/types/socketty/tsconfig.json +++ b/types/socketty/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/sockjs-client/tsconfig.json b/types/sockjs-client/tsconfig.json index a0b95f5afb..ac9710c14a 100644 --- a/types/sockjs-client/tsconfig.json +++ b/types/sockjs-client/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/sockjs/tsconfig.json b/types/sockjs/tsconfig.json index 1b3c61fb34..66b535d9e0 100644 --- a/types/sockjs/tsconfig.json +++ b/types/sockjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/solution-center-communicator/tsconfig.json b/types/solution-center-communicator/tsconfig.json index c5429cdf1a..d2627e6c05 100644 --- a/types/solution-center-communicator/tsconfig.json +++ b/types/solution-center-communicator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/sort-array/tsconfig.json b/types/sort-array/tsconfig.json index 935747c5e6..b759d8db46 100644 --- a/types/sort-array/tsconfig.json +++ b/types/sort-array/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "sort-array-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/sortablejs/tsconfig.json b/types/sortablejs/tsconfig.json index a5e89ba671..bb6e4c1c0d 100644 --- a/types/sortablejs/tsconfig.json +++ b/types/sortablejs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/soundjs/tsconfig.json b/types/soundjs/tsconfig.json index c4e228a18c..e3ccb82655 100644 --- a/types/soundjs/tsconfig.json +++ b/types/soundjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/soundmanager2/tsconfig.json b/types/soundmanager2/tsconfig.json index c08c3d6185..e6d6b76dde 100644 --- a/types/soundmanager2/tsconfig.json +++ b/types/soundmanager2/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/source-list-map/tsconfig.json b/types/source-list-map/tsconfig.json index c18f940040..e924dfe4d5 100644 --- a/types/source-list-map/tsconfig.json +++ b/types/source-list-map/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/source-map-support/tsconfig.json b/types/source-map-support/tsconfig.json index c5cd7b0000..1404b8324b 100644 --- a/types/source-map-support/tsconfig.json +++ b/types/source-map-support/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/space-pen/tsconfig.json b/types/space-pen/tsconfig.json index 2aa1f65d64..42e901d55e 100644 --- a/types/space-pen/tsconfig.json +++ b/types/space-pen/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/spark-md5/tsconfig.json b/types/spark-md5/tsconfig.json index 8eac67ed47..67659659bc 100644 --- a/types/spark-md5/tsconfig.json +++ b/types/spark-md5/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/sparkly/tsconfig.json b/types/sparkly/tsconfig.json index 3408085ad7..f50bc3772e 100644 --- a/types/sparkly/tsconfig.json +++ b/types/sparkly/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/sparkpost/sparkpost-tests.ts b/types/sparkpost/sparkpost-tests.ts index d15208bcb5..26a2ebda3a 100644 --- a/types/sparkpost/sparkpost-tests.ts +++ b/types/sparkpost/sparkpost-tests.ts @@ -1,4 +1,4 @@ -import * as SparkPost from "sparkpost"; +import SparkPost = require("sparkpost"); const key = "YOURAPIKEY"; const client = new SparkPost(key); diff --git a/types/sparkpost/tsconfig.json b/types/sparkpost/tsconfig.json index 6aeba9cb91..c7d02396a3 100644 --- a/types/sparkpost/tsconfig.json +++ b/types/sparkpost/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/sparkpost/v1/sparkpost-tests.ts b/types/sparkpost/v1/sparkpost-tests.ts index 0b8a41ab0a..6a2ac71acc 100644 --- a/types/sparkpost/v1/sparkpost-tests.ts +++ b/types/sparkpost/v1/sparkpost-tests.ts @@ -1,4 +1,4 @@ -import * as SparkPost from "sparkpost"; +import SparkPost = require("sparkpost"); let key = "YOURAPIKEY"; let client = new SparkPost(key); diff --git a/types/sparkpost/v1/tsconfig.json b/types/sparkpost/v1/tsconfig.json index 114bc5e757..6be9896dea 100644 --- a/types/sparkpost/v1/tsconfig.json +++ b/types/sparkpost/v1/tsconfig.json @@ -22,7 +22,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/sparqljs/tsconfig.json b/types/sparqljs/tsconfig.json index 3a44e32e68..26b4e54dc6 100644 --- a/types/sparqljs/tsconfig.json +++ b/types/sparqljs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/spatialite/tsconfig.json b/types/spatialite/tsconfig.json index 0da1bd78cf..f50a5c18bc 100644 --- a/types/spatialite/tsconfig.json +++ b/types/spatialite/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/spdx-correct/tsconfig.json b/types/spdx-correct/tsconfig.json index a7c8604db7..5f67419265 100644 --- a/types/spdx-correct/tsconfig.json +++ b/types/spdx-correct/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "spdx-correct-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/spdx-satisfies/tsconfig.json b/types/spdx-satisfies/tsconfig.json index 7aff811650..2c924ccdc9 100644 --- a/types/spdx-satisfies/tsconfig.json +++ b/types/spdx-satisfies/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "spdx-satisfies-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/spdy/tsconfig.json b/types/spdy/tsconfig.json index a8ffb74515..bbab83a0a7 100644 --- a/types/spdy/tsconfig.json +++ b/types/spdy/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/speakeasy/tsconfig.json b/types/speakeasy/tsconfig.json index e27d664bc4..5425305ee3 100644 --- a/types/speakeasy/tsconfig.json +++ b/types/speakeasy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/speakingurl/tsconfig.json b/types/speakingurl/tsconfig.json index 150dcf9b21..1049a75f38 100644 --- a/types/speakingurl/tsconfig.json +++ b/types/speakingurl/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/spectacle/tsconfig.json b/types/spectacle/tsconfig.json index 46722f9753..517d917a91 100644 --- a/types/spectacle/tsconfig.json +++ b/types/spectacle/tsconfig.json @@ -16,6 +16,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "react" }, "files": [ diff --git a/types/spectrum/tsconfig.json b/types/spectrum/tsconfig.json index 31b495ebf9..96bdddce61 100644 --- a/types/spectrum/tsconfig.json +++ b/types/spectrum/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/split.js/tsconfig.json b/types/split.js/tsconfig.json index 31fbcaf148..564b7b2d43 100644 --- a/types/split.js/tsconfig.json +++ b/types/split.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/split/tsconfig.json b/types/split/tsconfig.json index 968ce531dc..f22979b681 100644 --- a/types/split/tsconfig.json +++ b/types/split/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/split2/split2-tests.ts b/types/split2/split2-tests.ts index 35d0b58684..0d4052742b 100644 --- a/types/split2/split2-tests.ts +++ b/types/split2/split2-tests.ts @@ -1,4 +1,4 @@ -import * as split from 'split2'; +import split = require('split2'); import * as fs from 'fs'; import { Transform, TransformOptions } from 'stream'; diff --git a/types/split2/tsconfig.json b/types/split2/tsconfig.json index 533f82b81a..82a5314ca1 100644 --- a/types/split2/tsconfig.json +++ b/types/split2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/spotify-api/tsconfig.json b/types/spotify-api/tsconfig.json index 6fc2a9e8ac..d0dfd44b35 100644 --- a/types/spotify-api/tsconfig.json +++ b/types/spotify-api/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/spotify-web-playback-sdk/tsconfig.json b/types/spotify-web-playback-sdk/tsconfig.json index c6b3dd1448..c4562ccbfb 100644 --- a/types/spotify-web-playback-sdk/tsconfig.json +++ b/types/spotify-web-playback-sdk/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "spotify-web-playback-sdk-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/sprintf-js/tsconfig.json b/types/sprintf-js/tsconfig.json index 2fcd8a7156..c13c854d81 100644 --- a/types/sprintf-js/tsconfig.json +++ b/types/sprintf-js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/sprintf/tsconfig.json b/types/sprintf/tsconfig.json index b56426bd80..f0fc939bb9 100644 --- a/types/sprintf/tsconfig.json +++ b/types/sprintf/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/sql.js/tsconfig.json b/types/sql.js/tsconfig.json index aa744160cb..c7d92578f0 100644 --- a/types/sql.js/tsconfig.json +++ b/types/sql.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/sqlite3/tsconfig.json b/types/sqlite3/tsconfig.json index f3b9bf2d28..1e0f76573e 100644 --- a/types/sqlite3/tsconfig.json +++ b/types/sqlite3/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/sqlstring/tsconfig.json b/types/sqlstring/tsconfig.json index a4d4ce7e89..15a7dabe84 100644 --- a/types/sqlstring/tsconfig.json +++ b/types/sqlstring/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/sqs-consumer/tsconfig.json b/types/sqs-consumer/tsconfig.json index adeb275ec5..10dd63c1e9 100644 --- a/types/sqs-consumer/tsconfig.json +++ b/types/sqs-consumer/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/sqs-producer/tsconfig.json b/types/sqs-producer/tsconfig.json index 68c2013ba1..5c729caabe 100644 --- a/types/sqs-producer/tsconfig.json +++ b/types/sqs-producer/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/squirejs/tsconfig.json b/types/squirejs/tsconfig.json index d8ef5e1b75..18670feab2 100644 --- a/types/squirejs/tsconfig.json +++ b/types/squirejs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/srp/tsconfig.json b/types/srp/tsconfig.json index 81d00268b1..5e0d922b20 100644 --- a/types/srp/tsconfig.json +++ b/types/srp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ssh-key-decrypt/tsconfig.json b/types/ssh-key-decrypt/tsconfig.json index b05d121ace..ea20ac09be 100644 --- a/types/ssh-key-decrypt/tsconfig.json +++ b/types/ssh-key-decrypt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ssh2-sftp-client/ssh2-sftp-client-tests.ts b/types/ssh2-sftp-client/ssh2-sftp-client-tests.ts index ec64afe698..a8c774c5d3 100644 --- a/types/ssh2-sftp-client/ssh2-sftp-client-tests.ts +++ b/types/ssh2-sftp-client/ssh2-sftp-client-tests.ts @@ -1,4 +1,4 @@ -import * as Client from 'ssh2-sftp-client'; +import Client = require('ssh2-sftp-client'); import * as fs from 'fs'; const client = new Client(); diff --git a/types/ssh2-sftp-client/tsconfig.json b/types/ssh2-sftp-client/tsconfig.json index 809639cd51..660c65ec72 100644 --- a/types/ssh2-sftp-client/tsconfig.json +++ b/types/ssh2-sftp-client/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ssh2-streams/tsconfig.json b/types/ssh2-streams/tsconfig.json index c72956547a..d191d32a62 100644 --- a/types/ssh2-streams/tsconfig.json +++ b/types/ssh2-streams/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ssh2/tsconfig.json b/types/ssh2/tsconfig.json index 13d68aa813..b7d361ffe1 100644 --- a/types/ssh2/tsconfig.json +++ b/types/ssh2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/sshpk/tsconfig.json b/types/sshpk/tsconfig.json index 7b38e1dc9b..ae0ed98e9e 100644 --- a/types/sshpk/tsconfig.json +++ b/types/sshpk/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stack-mapper/tsconfig.json b/types/stack-mapper/tsconfig.json index f47d33d03e..177035b5b9 100644 --- a/types/stack-mapper/tsconfig.json +++ b/types/stack-mapper/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stack-trace/tsconfig.json b/types/stack-trace/tsconfig.json index fd6b41724d..82a1d19c43 100644 --- a/types/stack-trace/tsconfig.json +++ b/types/stack-trace/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stack-utils/tsconfig.json b/types/stack-utils/tsconfig.json index 4f74db4b57..e99ac31c68 100644 --- a/types/stack-utils/tsconfig.json +++ b/types/stack-utils/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stacktrace-js/tsconfig.json b/types/stacktrace-js/tsconfig.json index bbc97ddb49..4d8738227d 100644 --- a/types/stacktrace-js/tsconfig.json +++ b/types/stacktrace-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stale-lru-cache/tsconfig.json b/types/stale-lru-cache/tsconfig.json index fdd40eaaea..5cb96af388 100644 --- a/types/stale-lru-cache/tsconfig.json +++ b/types/stale-lru-cache/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stampit/tsconfig.json b/types/stampit/tsconfig.json index ee248728d6..c077934aac 100644 --- a/types/stampit/tsconfig.json +++ b/types/stampit/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stamplay-js-sdk/tsconfig.json b/types/stamplay-js-sdk/tsconfig.json index e75cfd6828..a8d75a776a 100644 --- a/types/stamplay-js-sdk/tsconfig.json +++ b/types/stamplay-js-sdk/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stat-mode/tsconfig.json b/types/stat-mode/tsconfig.json index 5b51263a17..bd95948d1c 100644 --- a/types/stat-mode/tsconfig.json +++ b/types/stat-mode/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/static-eval/tsconfig.json b/types/static-eval/tsconfig.json index 8f182c2170..b011db3543 100644 --- a/types/static-eval/tsconfig.json +++ b/types/static-eval/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stats.js/tsconfig.json b/types/stats.js/tsconfig.json index 7471c6140b..1ce35425e1 100644 --- a/types/stats.js/tsconfig.json +++ b/types/stats.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/statsd-client/tsconfig.json b/types/statsd-client/tsconfig.json index 81a84eea79..bb0a8a2ba6 100644 --- a/types/statsd-client/tsconfig.json +++ b/types/statsd-client/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/statuses/tsconfig.json b/types/statuses/tsconfig.json index f307775277..63ac349b02 100644 --- a/types/statuses/tsconfig.json +++ b/types/statuses/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/std-mocks/index.d.ts b/types/std-mocks/index.d.ts new file mode 100644 index 0000000000..2c9a25e8c2 --- /dev/null +++ b/types/std-mocks/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for std-mocks 1.0 +// Project: https://github.com/neoziro/std-mocks#readme +// Definitions by: Jeff Dickey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface Options { + stdout?: boolean; + stderr?: boolean; +} + +/** + * Start mocking std output + */ +export function use(opts?: Options & {print?: boolean}): void; + +/** + * Restore std output + */ +export function restore(opts?: Options): void; + +/** + * Flush collected output + */ +export function flush(opts: Options & {stdout: false, stderr: false}): {}; +export function flush(opts: Options & {stderr: false}): {stdout: string[]}; +export function flush(opts: Options & {stdout: false}): {stderr: string[]}; +export function flush(opts?: Options): {stdout: string[], stderr: string[]}; diff --git a/types/std-mocks/std-mocks-tests.ts b/types/std-mocks/std-mocks-tests.ts new file mode 100644 index 0000000000..72b39ebc41 --- /dev/null +++ b/types/std-mocks/std-mocks-tests.ts @@ -0,0 +1,14 @@ +import * as stdMocks from 'std-mocks'; + +stdMocks.use(); +stdMocks.use({print: false}); +stdMocks.use({stdout: false}); +stdMocks.use({stderr: false}); + +stdMocks.restore(); +stdMocks.restore({stdout: false}); +stdMocks.restore({stderr: false}); + +stdMocks.flush(); +stdMocks.flush({stdout: false}).stderr; +stdMocks.flush({stdout: false}).stdout; // $ExpectError diff --git a/types/std-mocks/tsconfig.json b/types/std-mocks/tsconfig.json new file mode 100644 index 0000000000..6286da9ada --- /dev/null +++ b/types/std-mocks/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "std-mocks-tests.ts" + ] +} \ No newline at end of file diff --git a/types/std-mocks/tslint.json b/types/std-mocks/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/std-mocks/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/steam/tsconfig.json b/types/steam/tsconfig.json index e821778fbf..32c579cb36 100644 --- a/types/steam/tsconfig.json +++ b/types/steam/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/steed/tsconfig.json b/types/steed/tsconfig.json index 04c8b69bd3..e5f7d1cf58 100644 --- a/types/steed/tsconfig.json +++ b/types/steed/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stemmer/index.d.ts b/types/stemmer/index.d.ts index 60bcf6ae22..b42026cac1 100644 --- a/types/stemmer/index.d.ts +++ b/types/stemmer/index.d.ts @@ -5,4 +5,6 @@ declare function stemmer(value: string): string; +declare namespace stemmer {} + export = stemmer; diff --git a/types/stemmer/stemmer-tests.ts b/types/stemmer/stemmer-tests.ts index db9f19d996..b5ed8daec4 100644 --- a/types/stemmer/stemmer-tests.ts +++ b/types/stemmer/stemmer-tests.ts @@ -1,3 +1,3 @@ -import stemmer = require('stemmer'); +import * as stemmer from 'stemmer'; stemmer('Working'); // $ExpectType string diff --git a/types/stemmer/tsconfig.json b/types/stemmer/tsconfig.json index 7224a39eb8..0f17c0f146 100644 --- a/types/stemmer/tsconfig.json +++ b/types/stemmer/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "stemmer-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/sticky-cluster/sticky-cluster-tests.ts b/types/sticky-cluster/sticky-cluster-tests.ts index e730275d78..720e8d001a 100644 --- a/types/sticky-cluster/sticky-cluster-tests.ts +++ b/types/sticky-cluster/sticky-cluster-tests.ts @@ -1,5 +1,5 @@ import stickyCluster = require('sticky-cluster'); -import * as express from 'express'; +import express = require('express'); import * as http from 'http'; /** test with all params */ diff --git a/types/sticky-cluster/tsconfig.json b/types/sticky-cluster/tsconfig.json index dcfc338f93..ff3ca4badd 100644 --- a/types/sticky-cluster/tsconfig.json +++ b/types/sticky-cluster/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "sticky-cluster-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/stompjs/tsconfig.json b/types/stompjs/tsconfig.json index bb2b4ad2a4..e450706f2d 100644 --- a/types/stompjs/tsconfig.json +++ b/types/stompjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stoppable/tsconfig.json b/types/stoppable/tsconfig.json index e6a0ead204..6cef67e8b6 100644 --- a/types/stoppable/tsconfig.json +++ b/types/stoppable/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/storejs/index.d.ts b/types/storejs/index.d.ts index bc41120c60..0a677c0ecf 100644 --- a/types/storejs/index.d.ts +++ b/types/storejs/index.d.ts @@ -8,7 +8,7 @@ interface StoreJsAPI { readonly version: string; - readonly enabled: string; + readonly enabled: boolean; get(key: string, optionalDefaultValue?: any): any; set(key: string, value: any): any; remove(key: string): void; diff --git a/types/storejs/storejs-tests.ts b/types/storejs/storejs-tests.ts index 03c3769f9b..802f3dd40e 100644 --- a/types/storejs/storejs-tests.ts +++ b/types/storejs/storejs-tests.ts @@ -2,6 +2,9 @@ import * as store from 'store'; import * as engine from 'store/src/store-engine'; +// https://github.com/marcuswestin/store.js/blob/master/README-More.md#storeenabled-flag +console.log('storage is supported: ', store.enabled === true); + // https://github.com/marcuswestin/store.js/#api // Store current user diff --git a/types/storejs/tsconfig.json b/types/storejs/tsconfig.json index df8e4268e3..0624143c91 100644 --- a/types/storejs/tsconfig.json +++ b/types/storejs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/storejs/v1/tsconfig.json b/types/storejs/v1/tsconfig.json index 2d062255ed..ae6d367885 100644 --- a/types/storejs/v1/tsconfig.json +++ b/types/storejs/v1/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/storybook__addon-a11y/index.d.ts b/types/storybook__addon-a11y/index.d.ts new file mode 100644 index 0000000000..c29f546b6f --- /dev/null +++ b/types/storybook__addon-a11y/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for @storybook/addon-a11y 3.3 +// Project: https://github.com/storybooks/storybook +// Definitions by: HyunSeob +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import { StoryDecorator } from '@storybook/react'; + +export const checkA11y: StoryDecorator; diff --git a/types/storybook__addon-a11y/storybook__addon-a11y-tests.tsx b/types/storybook__addon-a11y/storybook__addon-a11y-tests.tsx new file mode 100644 index 0000000000..4e60455618 --- /dev/null +++ b/types/storybook__addon-a11y/storybook__addon-a11y-tests.tsx @@ -0,0 +1,11 @@ +import * as React from 'react'; +import { storiesOf } from '@storybook/react'; +import { checkA11y } from '@storybook/addon-a11y'; + +storiesOf('button', module) + .addDecorator(checkA11y) + .add('Accessible', () => ( + + )); diff --git a/types/storybook__addon-a11y/tsconfig.json b/types/storybook__addon-a11y/tsconfig.json new file mode 100644 index 0000000000..43484db618 --- /dev/null +++ b/types/storybook__addon-a11y/tsconfig.json @@ -0,0 +1,33 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "paths": { + "@storybook/addon-a11y": [ + "storybook__addon-a11y" + ], + "@storybook/react": [ + "storybook__react" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "storybook__addon-a11y-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/storybook__addon-a11y/tslint.json b/types/storybook__addon-a11y/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/storybook__addon-a11y/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/storybook__addon-actions/tsconfig.json b/types/storybook__addon-actions/tsconfig.json index 89249e8386..a7c484aab1 100644 --- a/types/storybook__addon-actions/tsconfig.json +++ b/types/storybook__addon-actions/tsconfig.json @@ -24,7 +24,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/storybook__addon-backgrounds/tsconfig.json b/types/storybook__addon-backgrounds/tsconfig.json index cfc58e4a8c..39ffc3183a 100644 --- a/types/storybook__addon-backgrounds/tsconfig.json +++ b/types/storybook__addon-backgrounds/tsconfig.json @@ -23,7 +23,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/storybook__addon-info/tsconfig.json b/types/storybook__addon-info/tsconfig.json index 87d702ce2b..8ea798e377 100644 --- a/types/storybook__addon-info/tsconfig.json +++ b/types/storybook__addon-info/tsconfig.json @@ -23,10 +23,11 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "storybook__addon-info-tests.tsx" ] -} +} \ No newline at end of file diff --git a/types/storybook__addon-knobs/index.d.ts b/types/storybook__addon-knobs/index.d.ts index c2f8c954ec..f725abb47c 100644 --- a/types/storybook__addon-knobs/index.d.ts +++ b/types/storybook__addon-knobs/index.d.ts @@ -46,6 +46,8 @@ export function date(name: string, value?: Date): Date; export function array(name: string, value: T[], separator?: string): T[]; +export function button(name: string, handler: () => any): void; + export interface WrapStoryProps { context?: object; storyFn?: RenderFunction; diff --git a/types/storybook__addon-knobs/storybook__addon-knobs-tests.tsx b/types/storybook__addon-knobs/storybook__addon-knobs-tests.tsx index 9e1c1dbd6b..18d8d0a29e 100644 --- a/types/storybook__addon-knobs/storybook__addon-knobs-tests.tsx +++ b/types/storybook__addon-knobs/storybook__addon-knobs-tests.tsx @@ -11,6 +11,7 @@ import { select, date, array, + button, knob, } from '@storybook/addon-knobs'; @@ -58,6 +59,8 @@ stories.add('with all knobs', () => { const genericKnob: X = knob('Some generic knob', { value: 'a', type: 'text' }); + button('Some button', () => console.log('Button knob clicked')); + const style = { ...customStyle, fontWeight: bold ? 800 as 800 : 400 as 400, // tslint:disable-line no-unnecessary-type-assertion diff --git a/types/storybook__addon-knobs/tsconfig.json b/types/storybook__addon-knobs/tsconfig.json index fb2307556f..43d809e7df 100644 --- a/types/storybook__addon-knobs/tsconfig.json +++ b/types/storybook__addon-knobs/tsconfig.json @@ -24,7 +24,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/storybook__addon-links/tsconfig.json b/types/storybook__addon-links/tsconfig.json index bb3183eaec..8f399074f3 100644 --- a/types/storybook__addon-links/tsconfig.json +++ b/types/storybook__addon-links/tsconfig.json @@ -23,7 +23,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/storybook__addon-notes/tsconfig.json b/types/storybook__addon-notes/tsconfig.json index 2bc7d76ea8..6b80454b4b 100644 --- a/types/storybook__addon-notes/tsconfig.json +++ b/types/storybook__addon-notes/tsconfig.json @@ -24,7 +24,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/storybook__addon-options/tsconfig.json b/types/storybook__addon-options/tsconfig.json index 936a535725..13ed6cecc8 100644 --- a/types/storybook__addon-options/tsconfig.json +++ b/types/storybook__addon-options/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/storybook__react/tsconfig.json b/types/storybook__react/tsconfig.json index 906319ce4c..3e97c20db9 100644 --- a/types/storybook__react/tsconfig.json +++ b/types/storybook__react/tsconfig.json @@ -21,7 +21,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/storybook__vue/index.d.ts b/types/storybook__vue/index.d.ts new file mode 100644 index 0000000000..13e6099724 --- /dev/null +++ b/types/storybook__vue/index.d.ts @@ -0,0 +1,39 @@ +// Type definitions for @storybook/vue 3.3 +// Project: https://github.com/storybooks/storybook +// Definitions by: Punit Gupta +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 +// Created with the help of storybook__react types + +/// + +import Vue, { ComponentOptions } from 'vue'; + +// Story can be used as template or component +export type StoryFunction = () => ComponentOptions | string; +export type StoryDecorator = (story: () => ComponentOptions, context: { kind: string, story: string }) => ComponentOptions | null; + +export interface Story { + readonly kind: string; + add(storyName: string, getStory: StoryFunction): this; + addDecorator(decorator: StoryDecorator): this; +} + +export interface Addon { + [addonName: string]: (storyName: string, storyFn: StoryFunction) => void; +} +export interface StoryStore { + fileName: string | undefined; + kind: string; + stories: StoryObject[]; +} +export interface StoryObject { + name: string; + render: StoryFunction; +} + +export function addDecorator(decorator: StoryDecorator): void; +export function configure(loaders: () => void, module: NodeModule): void; +export function getStorybook(): StoryStore[]; +export function setAddon(addon: Addon): void; +export function storiesOf(kind: string, module: NodeModule): Story; diff --git a/types/storybook__vue/package.json b/types/storybook__vue/package.json new file mode 100644 index 0000000000..667aabc813 --- /dev/null +++ b/types/storybook__vue/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "vue": "^2.0.0" + } +} \ No newline at end of file diff --git a/types/storybook__vue/storybook__vue-tests.ts b/types/storybook__vue/storybook__vue-tests.ts new file mode 100644 index 0000000000..7c5c786ab7 --- /dev/null +++ b/types/storybook__vue/storybook__vue-tests.ts @@ -0,0 +1,50 @@ +import Vue, { ComponentOptions } from 'vue'; +import { addDecorator, configure, getStorybook, setAddon, storiesOf, StoryFunction, Story } from '@storybook/vue'; + +interface CustomStory extends Story { + addCentered(storyName: string, storyFn: StoryFunction): this; +} + +const addCenteredAddon = { + addCentered(this: Story, storyName: string, storyFn: StoryFunction): void { + console.log(this.kind); + this.add(storyName, storyFn); + } +}; + +const Decorator = (story: () => ComponentOptions) => { + const wrapper = story(); + return { + components: { wrapper }, + template: '

', + data() { + return { borderStyle: 'medium solid red' }; + } + }; +}; + +addDecorator(Decorator); +configure(() => undefined, module); +getStorybook().forEach(({ fileName, kind, stories }) => stories.forEach(({ name, render }) => render())); +setAddon(addCenteredAddon); + +storiesOf('Storybook__vue', module) + .addDecorator(Decorator) + .add('story as a template', () => '
') + .add('story as a component', () => ({ + components: {}, + template: '
' + })); + +(storiesOf('Custom_Story', module) as CustomStory) + .addCentered('custom story', () => ({ + template: '
' + })) + .add('story as a template', () => '
') + .add('story as a component', () => ({ + components: {}, + template: '
' + })) + .addCentered('custom story', () => ({ + template: '
' + })); diff --git a/types/storybook__vue/tsconfig.json b/types/storybook__vue/tsconfig.json new file mode 100644 index 0000000000..5659b7cc84 --- /dev/null +++ b/types/storybook__vue/tsconfig.json @@ -0,0 +1,30 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@storybook/vue": [ + "storybook__vue" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "storybook__vue-tests.ts" + ] +} \ No newline at end of file diff --git a/types/storybook__vue/tslint.json b/types/storybook__vue/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/storybook__vue/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/stream-buffers/tsconfig.json b/types/stream-buffers/tsconfig.json index 1a7291fb16..1829ba6547 100644 --- a/types/stream-buffers/tsconfig.json +++ b/types/stream-buffers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stream-meter/stream-meter-tests.ts b/types/stream-meter/stream-meter-tests.ts index 396f8aa6b1..d7adf74ce8 100644 --- a/types/stream-meter/stream-meter-tests.ts +++ b/types/stream-meter/stream-meter-tests.ts @@ -1,5 +1,4 @@ - -import * as meter from 'stream-meter'; +import meter = require('stream-meter'); var m:meter.StreamMeter = meter(); process.stdin.pipe(m).pipe(process.stdout); diff --git a/types/stream-meter/tsconfig.json b/types/stream-meter/tsconfig.json index 8b20593c10..bcd6cde297 100644 --- a/types/stream-meter/tsconfig.json +++ b/types/stream-meter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stream-series/tsconfig.json b/types/stream-series/tsconfig.json index 63b2241d3f..eb8763229a 100644 --- a/types/stream-series/tsconfig.json +++ b/types/stream-series/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stream-to-array/tsconfig.json b/types/stream-to-array/tsconfig.json index 48b3165006..32e34557d8 100644 --- a/types/stream-to-array/tsconfig.json +++ b/types/stream-to-array/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stream-to-array/v0/tsconfig.json b/types/stream-to-array/v0/tsconfig.json index 1865c9cf98..0a237512bb 100644 --- a/types/stream-to-array/v0/tsconfig.json +++ b/types/stream-to-array/v0/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/streaming-json-stringify/tsconfig.json b/types/streaming-json-stringify/tsconfig.json index b99f577e68..032b31181f 100644 --- a/types/streaming-json-stringify/tsconfig.json +++ b/types/streaming-json-stringify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/streamjs/tsconfig.json b/types/streamjs/tsconfig.json index 21fc98e70b..1643a0803c 100644 --- a/types/streamjs/tsconfig.json +++ b/types/streamjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/strftime/tsconfig.json b/types/strftime/tsconfig.json index b20e8d1a04..705df3931e 100644 --- a/types/strftime/tsconfig.json +++ b/types/strftime/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/string-hash/tsconfig.json b/types/string-hash/tsconfig.json index 8755e54064..f9e122d17e 100644 --- a/types/string-hash/tsconfig.json +++ b/types/string-hash/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/string-similarity/tsconfig.json b/types/string-similarity/tsconfig.json index a2a3f2f5eb..ff9daac26b 100644 --- a/types/string-similarity/tsconfig.json +++ b/types/string-similarity/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/string-template/tsconfig.json b/types/string-template/tsconfig.json index 936a491f8c..cdaa77fbbf 100644 --- a/types/string-template/tsconfig.json +++ b/types/string-template/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/string/tsconfig.json b/types/string/tsconfig.json index 578bc74d25..aa3e463b95 100644 --- a/types/string/tsconfig.json +++ b/types/string/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/string_score/tsconfig.json b/types/string_score/tsconfig.json index 95d3c06126..91909a22db 100644 --- a/types/string_score/tsconfig.json +++ b/types/string_score/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stringify-object/tsconfig.json b/types/stringify-object/tsconfig.json index 7a0b87b2a2..dd51ce88e8 100644 --- a/types/stringify-object/tsconfig.json +++ b/types/stringify-object/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/strip-ansi/tsconfig.json b/types/strip-ansi/tsconfig.json index 6653db94fb..7e1f2ed95e 100644 --- a/types/strip-ansi/tsconfig.json +++ b/types/strip-ansi/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/strip-bom/tsconfig.json b/types/strip-bom/tsconfig.json index 9a62caf4e6..d13346fffa 100644 --- a/types/strip-bom/tsconfig.json +++ b/types/strip-bom/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/strip-json-comments/tsconfig.json b/types/strip-json-comments/tsconfig.json index 02b42695a4..0333f7f56e 100644 --- a/types/strip-json-comments/tsconfig.json +++ b/types/strip-json-comments/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stripe-checkout/tsconfig.json b/types/stripe-checkout/tsconfig.json index e60ee3b3dd..b46c916c9a 100644 --- a/types/stripe-checkout/tsconfig.json +++ b/types/stripe-checkout/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stripe-v2/tsconfig.json b/types/stripe-v2/tsconfig.json index ac2d6c810b..1967670a85 100644 --- a/types/stripe-v2/tsconfig.json +++ b/types/stripe-v2/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stripe-v3/tsconfig.json b/types/stripe-v3/tsconfig.json index 1cdf786f22..99ea509045 100644 --- a/types/stripe-v3/tsconfig.json +++ b/types/stripe-v3/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index 49ba212f95..c3fd4853b7 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -8,6 +8,7 @@ // Kyle Kamperschroer // Kensuke Hoshikawa // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// @@ -53,6 +54,7 @@ declare class Stripe { */ recipients: Stripe.resources.Recipients; subscriptions: Stripe.resources.Subscriptions; + subscriptionItems: Stripe.resources.SubscriptionItems; tokens: Stripe.resources.Tokens; transfers: Stripe.resources.Transfers; applicationFees: Stripe.resources.ApplicationFees; @@ -556,7 +558,7 @@ declare namespace Stripe { interface IApplicationFeeRefunds extends IList, resources.ApplicationFeeRefunds { } - interface IApplicationFeeRefundCreationOptions extends IDataOptions { + interface IApplicationFeeRefundCreationOptions extends IDataOptionsWithMetadata { /** * A positive integer in pence representing how much of this fee to refund. * Can only refund up to the unrefunded amount remaining of the fee. @@ -564,14 +566,6 @@ declare namespace Stripe { * default is entire application fee */ amount?: number; - - /** - * A set of key/value pairs that you can attach to a refund object. It can be - * useful for storing additional information about the refund in a structured - * format. You can unset an individual key by setting its value to null and - * then saving. To clear all keys, set metadata to null, then save. - */ - metadata?: IMetadata; } } @@ -877,7 +871,7 @@ declare namespace Stripe { transfer: string | transfers.ITransfer; } - interface IChargeCreationOptions extends IDataOptions { + interface IChargeCreationOptions extends IDataOptionsWithMetadata { /** * A positive integer in the smallest currency unit (e.g 100 cents to charge * $1.00, or 1 to charge ¥1, a 0-decimal currency) representing how much to @@ -946,14 +940,6 @@ declare namespace Stripe { */ on_behalf_of?: string; - /** - * A set of key/value pairs that you can attach to a charge object. It can be - * useful for storing additional information about the customer in a - * structured format. It's often a good idea to store an email address in - * metadata for tracking later. - */ - metadata?: IMetadata; - /** * The email address to send this charge's receipt to. The receipt will not be * sent until the charge is paid. If this charge is for a customer, the email @@ -1344,7 +1330,7 @@ declare namespace Stripe { * override the default trial period of the plan the customer is being subscribed to. The special value now can be provided to * end the customer's trial immediately. Only applies when the plan parameter is also provided. */ - trial_end?: number; + trial_end?: number | "now"; } interface ICustomerUpdateOptions extends IDataOptionsWithMetadata { @@ -2087,6 +2073,14 @@ declare namespace Stripe { tax_percent?: number; } + interface IInvoicePayOptions extends IDataOptionsWithMetadata { + /** + * A payment source to be charged. The source must be the ID of a source + * belonging to the customer associated with the invoice being paid. + */ + source?: sources.ISourceCreationOptions; + } + interface IInvoiceListOptions extends IListOptions { /** * The identifier of the customer whose invoices to return. If none is provided, all invoices will be returned. @@ -4023,7 +4017,7 @@ declare namespace Stripe { * in the card object if the card belongs to an account or recipient * instead. */ - customer?: customers.ICustomer; + customer?: string | customers.ICustomer; /** * Only applicable on accounts (not customers or recipients). This @@ -4156,7 +4150,7 @@ declare namespace Stripe { interface ISourceCreationOptions { /** - * he type of payment source. Should be "card". + * The type of payment source. Should be "card". */ object: "card"; @@ -4194,7 +4188,7 @@ declare namespace Stripe { address_state?: string; address_zip?: string; - metadata?: IMetadata; + metadata?: IOptionsMetadata; } interface ISourceCreationOptionsExtended extends ISourceCreationOptions { @@ -4222,6 +4216,7 @@ declare namespace Stripe { namespace subscriptions { type SubscriptionStatus = "trialing" | "active" | "past_due" | "canceled" | "unpaid"; + type SubscriptionBilling = "charge_automatically" | "send_invoice"; /** * Subscriptions allow you to charge a customer's card on a recurring basis. A subscription ties a customer to * a particular plan you've created: https://stripe.com/docs/api#create_plan @@ -4282,7 +4277,9 @@ declare namespace Stripe { ended_at: number; metadata: IMetadata; - + + items: IList; + /** * Hash describing the plan the customer is subscribed to */ @@ -4323,13 +4320,20 @@ declare namespace Stripe { * If the subscription has a trial, the beginning of that trial. */ trial_start: number; + + /** + * Either "charge_automatically", or "send_invoice". When charging automatically, Stripe will attempt to pay this subscription at the + * end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an + * invoice with payment instructions. + */ + billing: SubscriptionBilling; } interface ISubscriptionCustCreationOptions extends IDataOptionsWithMetadata { /** - * The identifier of the plan to subscribe the customer to. + * @deprecated Use items property instead. */ - plan: string; + plan?: string; /** * A positive decimal (with at most two decimal places) between 1 and 100. This represents the percentage of the subscription invoice @@ -4367,7 +4371,19 @@ declare namespace Stripe { * will override the default trial period of the plan the customer is being subscribed to. The special value now can be provided to end the * customer's trial immediately. */ - trial_end?: number; + trial_end?: number | "now"; + + /** + * List of subscription items, each with an attached plan. + */ + items?: ISubscriptionCreationItem[]; + + /** + * Either "charge_automatically", or "send_invoice". When charging automatically, Stripe will attempt to pay this subscription at the end of the + * cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment + * instructions. Defaults to "charge_automatically". + */ + billing?: SubscriptionBilling; } interface ISubscriptionCreationOptions extends ISubscriptionCustCreationOptions { @@ -4392,7 +4408,7 @@ declare namespace Stripe { coupon?: string; /** - * The identifier of the plan to update the subscription to. If omitted, the subscription will not change plans. + * @deprecated Use items property instead. */ plan?: string; @@ -4431,7 +4447,19 @@ declare namespace Stripe { * will override the default trial period of the plan the customer is being subscribed to. The special value now can be provided to end the * customer's trial immediately. */ - trial_end?: number; + trial_end?: number | "now"; + + /** + * Either "charge_automatically", or "send_invoice". When charging automatically, Stripe will attempt to pay this subscription at the end of the + * cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment + * instructions. + */ + billing?: SubscriptionBilling; + + /** + * List of subscription items, each with an attached plan. + */ + items?: ISubscriptionUpdateItem[]; } interface ISubscriptionCancellationOptions extends IDataOptions { @@ -4443,9 +4471,9 @@ declare namespace Stripe { interface ISubscriptionListOptions extends IListOptionsCreated { /** - * The billing mode of the subscriptions to retrieve. + * The billing mode of the subscriptions to retrieve. Either "charge_automatically" or "send_invoice". */ - billing?: "charge_automatically" | "send_invoice"; + billing?: SubscriptionBilling; /** * The ID of the customer whose subscriptions will be retrieved @@ -4462,6 +4490,154 @@ declare namespace Stripe { */ status?: SubscriptionStatus | "all"; } + + interface ISubscriptionCreationItem { + /** + * Plan ID for this item. + */ + plan: string; + + /** + * Quantity for this item. + */ + quantity?: number + } + + interface ISubscriptionUpdateItem { + /** + * SubscriptionItem to update. + */ + id?: string; + + /** + * Delete all usage for a given subscription item. Only allowed when deleted is set to true and the current plan’s + * usage_type is metered. + */ + clear_usage?: boolean; + + /** + * Delete the specified item if set to true. + */ + deleted?: boolean; + + /** + * Set of key/value pairs that you can attach to an object. It can be useful for storing additional information about + * the object in a structured format. + */ + metadata?: IOptionsMetadata; + + /** + * Plan ID for this item. + */ + plan?: string; + + /** + * Quantity for this item. + */ + quantity?: number + } + } + + namespace subscriptionItems { + /** + * Subscription items allow you to create customer subscriptions with more than one plan, making it easy to represent + * complex billing relationships. + */ + interface ISubscriptionItem extends IResourceObject { + /** + * Value is "subscription_item" + */ + object: "subscription_item"; + + created: number; + + /** + * Set of key/value pairs that you can attach to an object. It can be useful for storing additional information + * about the object in a structured format. + */ + metadata: IMetadata; + + /** + * Hash describing the plan the customer is subscribed to + */ + plan: plans.IPlan; + + /** + * The quantity of the plan to which the customer should be subscribed. + */ + quantity: number; + } + + interface ISubscriptionItemCreationOptions extends IDataOptionsWithMetadata { + /** + * The identifier of the plan to add to the subscription. + */ + plan: string; + + /** + * The identifier of the subscription to modify. + */ + subscription: string; + + /** + * The quantity you’d like to apply to the subscription item you’re creating. + */ + quantity?: number; + + /** + * Flag indicating whether to prorate switching plans during a billing cycle. + */ + prorate?: boolean; + + /** + * If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same + * proration that was previewed with the upcoming invoice endpoint. + */ + proration_date?: number; + } + + interface ISubscriptionItemUpdateOptions extends IDataOptionsWithMetadata { + /** + * The identifier of the new plan for this subscription item. + */ + plan?: string; + + /** + * Flag indicating whether to prorate switching plans during a billing cycle. + */ + prorate?: boolean; + + /** + * If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same + * proration that was previewed with the upcoming invoice endpoint. + */ + proration_date?: number; + + /** + * The quantity you’d like to apply to the subscription item you’re creating. + */ + quantity?: number; + } + + interface ISubscriptionItemDeleteOptions extends IDataOptions { + /** + * Flag indicating whether to prorate switching plans during a billing cycle. + */ + prorate?: boolean; + + /** + * If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same + * proration that was previewed with the upcoming invoice endpoint. + */ + proration_date?: number; + } + + interface ISubscriptionItemListOptions extends IListOptionsCreated { + /** + * The ID of the subscription whose items will be retrieved. + */ + subscription: string; + } } namespace refunds { @@ -4514,7 +4690,7 @@ declare namespace Stripe { receipt_number: string; } - interface IRefundCreationOptions extends IDataOptions { + interface IRefundCreationOptions extends IDataOptionsWithMetadata { /** * A positive integer in cents/pence representing how much of this charge to * refund. Can only refund up to the unrefunded amount remaining of the @@ -4524,14 +4700,6 @@ declare namespace Stripe { */ amount?: number; - /** - * A set of key/value pairs that you can attach to a refund object. It can be - * useful for storing additional information about the refund in a structured - * format. You can unset an individual key by setting its value to null and - * then saving. To clear all keys, set metadata to null, then save. - */ - metadata?: IMetadata; - /** * String indicating the reason for the refund. If set, possible values are * "duplicate", "fraudulent", and "requested_by_customer". Specifying @@ -4848,8 +5016,8 @@ declare namespace Stripe { * * This request only accepts metadata as an argument. */ - updateRefund(feeId: string, refundId: string, data: { metadata?: IMetadata }, options: HeaderOptions, response?: IResponseFn): Promise; - updateRefund(feeId: string, refundId: string, data: { metadata?: IMetadata }, response?: IResponseFn): Promise; + updateRefund(feeId: string, refundId: string, data: { metadata?: IOptionsMetadata }, options: HeaderOptions, response?: IResponseFn): Promise; + updateRefund(feeId: string, refundId: string, data: { metadata?: IOptionsMetadata }, response?: IResponseFn): Promise; /** * You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available @@ -4893,8 +5061,8 @@ declare namespace Stripe { * * This request only accepts metadata as an argument. */ - update(refundId: string, data: { metadata?: IMetadata }, options: HeaderOptions, response?: IResponseFn): Promise; - update(refundId: string, data: { metadata?: IMetadata }, response?: IResponseFn): Promise; + update(refundId: string, data: { metadata?: IOptionsMetadata }, options: HeaderOptions, response?: IResponseFn): Promise; + update(refundId: string, data: { metadata?: IOptionsMetadata }, response?: IResponseFn): Promise; /** * You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available @@ -5783,6 +5951,61 @@ declare namespace Stripe { create(data: subscriptions.ISubscriptionCustCreationOptions, response?: IResponseFn): Promise; } + class SubscriptionItems extends StripeResource { + /** + * Adds a new item to an existing subscription. No existing items will be changed or replaced. + * + * @returns The created subscription item object is returned if successful. Otherwise, this call throws an error. + * + * @param options The options for the new subscription item. + */ + create(data: subscriptionItems.ISubscriptionItemCreationOptions, options: HeaderOptions, response?: IResponseFn): Promise; + create(data: subscriptionItems.ISubscriptionItemCreationOptions, response?: IResponseFn): Promise; + + /** + * Retrieves the subscription item with the given ID. + * + * @returns Returns a subscription item if a valid subscription item ID was provided. Throws an error otherwise. + * + * @param subscriptionItemId The identifier of the subscription item to retrieve. + */ + retrieve(subscriptionItemId: string, options: HeaderOptions, response?: IResponseFn): Promise; + retrieve(subscriptionItemId: string, response?: IResponseFn): Promise; + + /** + * Updates the plan or quantity of an item on a current subscription. + * + * @param subscriptionItemId The identifier of the subscription item to modify. + * @param data The fields to update + */ + update(subscriptionItemId: string, data: subscriptionItems.ISubscriptionItemUpdateOptions, options: HeaderOptions, response?: IResponseFn): Promise; + update(subscriptionItemId: string, data: subscriptionItems.ISubscriptionItemUpdateOptions, response?: IResponseFn): Promise; + + /** + * Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. + * + * @returns An subscription item object with a deleted flag upon success. Otherwise, this call throws an error, such as if the + * subscription item has already been deleted. + * + * @param subscriptionItemId The identifier of the subscription item to delete. + * @param data Specify whether to prorate and from when. + */ + del(subscriptionItemId: string, data: subscriptionItems.ISubscriptionItemDeleteOptions, options: HeaderOptions, response?: IResponseFn): Promise; + del(subscriptionItemId: string, data: subscriptionItems.ISubscriptionItemDeleteOptions, response?: IResponseFn): Promise; + del(subscriptionItemId: string, options: HeaderOptions, response?: IResponseFn): Promise; + del(subscriptionItemId: string, response?: IResponseFn): Promise; + + /** + * Returns a list of your subscription items for a given subscription. + * + * @returns Returns a list of your subscription items for a given subscription. + * + * @param data Filtering options + */ + list(data: subscriptionItems.ISubscriptionItemListOptions, options: HeaderOptions, response?: IResponseFn>): Promise>; + list(data: subscriptionItems.ISubscriptionItemListOptions, response?: IResponseFn>): Promise>; + } + class Disputes extends StripeResource { /** * Retrieves the dispute with the given ID. @@ -5968,6 +6191,9 @@ declare namespace Stripe { * * @param id The ID of the invoice to pay. */ + pay(id: string, data: invoices.IInvoicePayOptions, options: HeaderOptions, response?: IResponseFn): Promise; + pay(id: string, data: invoices.IInvoicePayOptions, response: IResponseFn): Promise; + pay(id: string, data: invoices.IInvoicePayOptions): Promise; pay(id: string, options: HeaderOptions, response?: IResponseFn): Promise; pay(id: string, response?: IResponseFn): Promise; @@ -6603,7 +6829,17 @@ declare namespace Stripe { * A set of key/value pairs that you can attach to an object. It can be useful for storing * additional information about the object in a structured format. */ - interface IMetadata { } + interface IOptionsMetadata { + [x: string]: string | number; + } + + /** + * A set of key/value pairs that you can attach to an object. It can be useful for storing + * additional information about the object in a structured format. + */ + interface IMetadata { + [x: string]: string; + } interface IShippingInformation { /** @@ -6732,7 +6968,7 @@ declare namespace Stripe { * format. You can unset an individual key by setting its value to null and * then saving. To clear all keys, set metadata to null, then save. */ - metadata?: IMetadata; + metadata?: IOptionsMetadata; } interface IHeaderOptions { diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index 03f9baeb9a..99cf3795db 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -1,4 +1,5 @@ import Stripe = require('stripe'); +import { customers } from 'stripe'; var stripe = new Stripe("sk_test_BF573NobVn98OiIsPAv7A04K") @@ -230,27 +231,60 @@ stripe.charges.markAsFraudulent('ch_15fvyXEe31JkLCeQOo0SwFk9').then(function (re stripe.customers.create({ description: 'Customer for test@example.com', - source: "tok_15V2YhEe31JkLCeQy9iUgsJX" // obtained with Stripe.js + source: "tok_15V2YhEe31JkLCeQy9iUgsJX", // obtained with Stripe.js + metadata: { test: "123", test2: 123 } // IOptionsMetadata test }, function (err, customer) { // asynchronously called }); stripe.customers.create({ description: 'Customer for test@example.com', - source: "tok_15V2YhEe31JkLCeQy9iUgsJX" // obtained with Stripe.js + source: "tok_15V2YhEe31JkLCeQy9iUgsJX", // obtained with Stripe.js + metadata: null // IOptionsMetadata test }).then( function (customer) { // asynchronously called customer.cards.create({ card: "tok_17wV94BoqMA9o2xkhlAd3ALf"}).then(function (customer) {}); - customer.cards.retrieve("card_17xMvXBoqMA9o2xkq6W5gamx").then(function (card) {}); + customer.cards.retrieve("card_17xMvXBoqMA9o2xkq6W5gamx").then(function (card) { + let strCustomer: string = card.customer; + let objCustomer: customers.ICustomer = card.customer; + }); customer.cards.update("card_17xMvXBoqMA9o2xkq6W5gamx", { name: "Test" }).then(function (card) {}); customer.cards.list().then(function (cards) {}); customer.cards.del("card_17xMvXBoqMA9o2xkq6W5gamx").then(function (confirmation) {}); - customer.subscriptions.create({ plan: "gold" }).then(function (subscription) { }); - customer.subscriptions.retrieve("sub_8Eluur5KoIKxuy").then(function (subscription) { }); - customer.subscriptions.update("sub_8Eluur5KoIKxuy", { plan: "silver" }).then(function (subscription) { }); + customer.subscriptions.create({ items: [{ plan: "gold" }] }).then(function (subscription) { }); + customer.subscriptions.create({ items: [{ plan: "gold" }], trial_end: "now" }).then(function (subscription) { }); + customer.subscriptions.create({ items: [{ plan: "gold" }], trial_end: 1516881177 }).then(function (subscription) { }); + customer.subscriptions.retrieve("sub_8Eluur5KoIKxuy").then(function (subscription) { + customer.subscriptions.update("sub_8Eluur5KoIKxuy", { items: [{ id: subscription.items.data[0].id, plan: "silver" }] }).then(function (subscription) { }); + }); + customer.subscriptions.update("sub_8Eluur5KoIKxuy", { trial_end: "now" }); + customer.subscriptions.update("sub_8Eluur5KoIKxuy", { trial_end: 1516881177 }); customer.subscriptions.list().then(function (subscriptions) { }); customer.subscriptions.del("sub_8Eluur5KoIKxuy").then(function (subscription) { }); customer.subscriptions.deleteDiscount("sub_8Eluur5KoIKxuy").then(function (confirmation) { }); + + // IMetadata tests: + let str: string; + customer.metadata["test"] == str; + customer.metadata.test1 == str; + + //IOptionsMetadata tests: + let metadata: Stripe.IOptionsMetadata; + let num: number; + metadata["test"] = str; + metadata["test"] = num; + metadata["test"] == str; + metadata["test"] == num; + metadata.testStr = str; + metadata.testNum = num; + metadata.test1 == str; + metadata.test2 == num; + metadata = { + test1: str, + test2: num + } + metadata = {}; + metadata = null; }); @@ -267,6 +301,22 @@ stripe.customers.create({ }); +// {"now"} for trial_end +stripe.customers.create({ + description: "Customer for test@example.com", + source: "tok_15V2YhEe31JkLCeQy9iUgsJX", // obtained with Stripe.js + plan: "platypi-dev", + trial_end: "now" +}); + +// {number} for trial_end +stripe.customers.create({ + description: "Customer for test@example.com", + source: "tok_15V2YhEe31JkLCeQy9iUgsJX", // obtained with Stripe.js + plan: "platypi-dev", + trial_end: 1516881177 +}); + stripe.customers.retrieve( "cus_5rfJKDJkuxzh5Q", function (err, customer) { @@ -455,12 +505,12 @@ stripe.customers.retrieveSubscription("cus_5rfJKDJkuxzh5Q", "sub_5rfJxnBLGSwsYp" // asynchronously called }); -stripe.customers.updateSubscription("cus_5rfJKDJkuxzh5Q", "sub_5rfJxnBLGSwsYp", { plan: "platypi-dev" }, +stripe.customers.updateSubscription("cus_5rfJKDJkuxzh5Q", "sub_5rfJxnBLGSwsYp", { items: [{ id: "si_62U5U5BoqBA2o2xp6Eqcl6J7", plan: "platypi-dev" }] }, function (err, subscription) { // asynchronously called } ); -stripe.customers.updateSubscription("cus_5rfJKDJkuxzh5Q", "sub_5rfJxnBLGSwsYp", { plan: "platypi-dev" }).then(function (subscription) { +stripe.customers.updateSubscription("cus_5rfJKDJkuxzh5Q", "sub_5rfJxnBLGSwsYp", { items: [{ id: "si_62U5U5BoqBA2o2xp6Eqcl6J7", plan: "platypi-dev" }] }).then(function (subscription) { // asynchronously called }); @@ -880,6 +930,10 @@ stripe.invoices.pay("in_15fvyXEe31JkLCeQH7QbgZZb").then(function (invoice) { // asynchronously called }); +stripe.invoices.pay("in_15fvyXEe31JkLCeQH7QbgZZb", { source: "source_id" }).then(function (invoice) { + // asynchronously called +}); + stripe.invoices.list( { customer: "cus_5rfJKDJkuxzh5Q", limit: 3 }, function (err, invoices) { @@ -1081,11 +1135,18 @@ stripe.plans.list().then(function (plans) { //#region Subscriptions tests // ################################################################################## -stripe.subscriptions.create({ plan: "platypi-dev", customer: "cus_5rfJKDJkuxzh5Q" }, function(err, subscription) { +stripe.subscriptions.create({ items: [{ plan: "platypi-dev" }], customer: "cus_5rfJKDJkuxzh5Q" }, function(err, subscription) { // asynchronously called }); -stripe.subscriptions.create({ plan: "platypi-dev", customer: "cus_5rfJKDJkuxzh5Q" }).then(function(subscription) { +stripe.subscriptions.create({ items: [{ plan: "platypi-dev" }], customer: "cus_5rfJKDJkuxzh5Q" }).then(function(subscription) { // asynchronously called + + stripe.subscriptions.update("sub_8QwCiwZ9tmMSpt", { items: [{ id: subscription.items.data[0].id, plan: "platypi" }] }, function(err, subscription) { + // asynchronously called + }); + stripe.subscriptions.update("sub_8QwCiwZ9tmMSpt", { items: [{ id: subscription.items.data[0].id, plan: "platypi" }] }).then(function(subscription) { + // asynchronously called + }); }); stripe.subscriptions.retrieve("sub_8QwCiwZ9tmMSpt", function(err, subscription) { @@ -1101,13 +1162,6 @@ stripe.subscriptions.retrieve("sub_8QwCiwZ9tmMSpt").then(function(subscription) } }); -stripe.subscriptions.update("sub_8QwCiwZ9tmMSpt", { plan: "platypi" }, function(err, subscription) { - // asynchronously called -}); -stripe.subscriptions.update("sub_8QwCiwZ9tmMSpt", { plan: "platypi" }).then(function(subscription) { - // asynchronously called -}); - stripe.subscriptions.del("sub_8QwCiwZ9tmMSpt", function(err, subscription) { // asynchronously called }); @@ -1124,6 +1178,50 @@ stripe.subscriptions.list({ customer: "cus_5rfJKDJkuxzh5Q", plan: "platypi-dev" //#endregion +//#region Subscription Items tests +// ################################################################################## + +stripe.subscriptionItems.create({ subscription: "sub_C9giwDfCeN8fwt", plan: "platypi-dev" }, function(err, subscriptionItem) { + // asynchronously called +}); +stripe.subscriptionItems.create({ subscription: "sub_C9giwDfCeN8fwt", plan: "platypi-dev" }).then(function(subscriptionItem) { + // asynchronously called +}); + +stripe.subscriptionItems.create({ subscription: "sub_C9giwDfCeN8fwt", plan: "platypi-dev", prorate: true, proration_date: Math.round(new Date().valueOf() / 1000) }).then(function(subscriptionItem) { + // asynchronously called +}); + +stripe.subscriptionItems.retrieve("si_C9gimdd2l9qvCU", function(err, subscriptionItem) { + // asynchronously called +}); +stripe.subscriptionItems.retrieve("si_C9gimdd2l9qvCU").then(function(subscriptionItem) { + // asynchronously called +}); + +stripe.subscriptionItems.update("si_C9gimdd2l9qvCU", { plan: "platypi" }, function(err, subscriptionItem) { + // asynchronously called +}); +stripe.subscriptionItems.update("si_C9gimdd2l9qvCU", { plan: "platypi" }).then(function(subscriptionItem) { + // asynchronously called +}); + +stripe.subscriptionItems.del("si_C9gimdd2l9qvCU", function(err, subscriptionItem) { + // asynchronously called +}); +stripe.subscriptionItems.del("si_C9gimdd2l9qvCU").then(function(subscriptionItem) { + // asynchronously called +}); + +stripe.subscriptionItems.list({ subscription: "si_C9gimdd2l9qvCU" }, function(err, subscriptionItems) { + // asynchronously called +}); +stripe.subscriptionItems.list({ subscription: "si_C9gimdd2l9qvCU" }).then(function(subscriptionItems) { + // asynchronously called +}); + +//#endregion + //#region Ephemeral keys tests // ################################################################################## diff --git a/types/stripe/tsconfig.json b/types/stripe/tsconfig.json index f2ac469aad..d600c2c48f 100644 --- a/types/stripe/tsconfig.json +++ b/types/stripe/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/strong-cluster-control/tsconfig.json b/types/strong-cluster-control/tsconfig.json index 2f89742361..9fedfeddcd 100644 --- a/types/strong-cluster-control/tsconfig.json +++ b/types/strong-cluster-control/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/strophe/tsconfig.json b/types/strophe/tsconfig.json index 8c8038227a..98d9dbdf4e 100644 --- a/types/strophe/tsconfig.json +++ b/types/strophe/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/styled-jsx/tsconfig.json b/types/styled-jsx/tsconfig.json index 494ed25a0a..abef3d951a 100644 --- a/types/styled-jsx/tsconfig.json +++ b/types/styled-jsx/tsconfig.json @@ -15,10 +15,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "react" }, "files": [ "index.d.ts", "styled-jsx-tests.tsx" ] -} +} \ No newline at end of file diff --git a/types/stylelint-webpack-plugin/stylelint-webpack-plugin-tests.ts b/types/stylelint-webpack-plugin/stylelint-webpack-plugin-tests.ts index 924a41ee6d..ee9002ec40 100644 --- a/types/stylelint-webpack-plugin/stylelint-webpack-plugin-tests.ts +++ b/types/stylelint-webpack-plugin/stylelint-webpack-plugin-tests.ts @@ -1,5 +1,5 @@ -import * as webpack from "webpack"; -import * as StylelintWebpackPlugin from "stylelint-webpack-plugin"; +import webpack = require("webpack"); +import StylelintWebpackPlugin = require("stylelint-webpack-plugin"); const compiler = webpack({ plugins: [ diff --git a/types/stylelint-webpack-plugin/tsconfig.json b/types/stylelint-webpack-plugin/tsconfig.json index bad8f14fff..926c3600f9 100644 --- a/types/stylelint-webpack-plugin/tsconfig.json +++ b/types/stylelint-webpack-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stylelint/tsconfig.json b/types/stylelint/tsconfig.json index aad83e1984..aa71e6e25c 100644 --- a/types/stylelint/tsconfig.json +++ b/types/stylelint/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/stylus/tsconfig.json b/types/stylus/tsconfig.json index d739ff9edd..e559d7f1ba 100644 --- a/types/stylus/tsconfig.json +++ b/types/stylus/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/subsume/tsconfig.json b/types/subsume/tsconfig.json index b29ec71ee8..d346ed296b 100644 --- a/types/subsume/tsconfig.json +++ b/types/subsume/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/succinct/tsconfig.json b/types/succinct/tsconfig.json index b75d1bb908..6d30f782a8 100644 --- a/types/succinct/tsconfig.json +++ b/types/succinct/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/sudo-block/tsconfig.json b/types/sudo-block/tsconfig.json index f7a67ab9d9..ea33ca3f2f 100644 --- a/types/sudo-block/tsconfig.json +++ b/types/sudo-block/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/suitescript/tsconfig.json b/types/suitescript/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/suitescript/tsconfig.json +++ b/types/suitescript/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/sumo-logger/sumo-logger-tests.ts b/types/sumo-logger/sumo-logger-tests.ts index 03efdfc95d..2a0066a4e4 100644 --- a/types/sumo-logger/sumo-logger-tests.ts +++ b/types/sumo-logger/sumo-logger-tests.ts @@ -1,5 +1,5 @@ -import * as SumoLogger from 'sumo-logger'; -import * as expect from 'expect'; +import SumoLogger = require('sumo-logger'); +import expect = require('expect'); const onErrorSpy = expect.createSpy(); const onSuccessSpy = expect.createSpy(); diff --git a/types/sumo-logger/tsconfig.json b/types/sumo-logger/tsconfig.json index 99995493eb..60a1130a58 100644 --- a/types/sumo-logger/tsconfig.json +++ b/types/sumo-logger/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/superagent-no-cache/superagent-no-cache-tests.ts b/types/superagent-no-cache/superagent-no-cache-tests.ts index 68e4e961a2..717fee80e3 100644 --- a/types/superagent-no-cache/superagent-no-cache-tests.ts +++ b/types/superagent-no-cache/superagent-no-cache-tests.ts @@ -1,5 +1,5 @@ import * as request from 'superagent'; -import * as plugin from 'superagent-no-cache'; +import plugin = require('superagent-no-cache'); request .get('/some-url') diff --git a/types/superagent-no-cache/tsconfig.json b/types/superagent-no-cache/tsconfig.json index 9047a8ff6c..da42ec34f7 100644 --- a/types/superagent-no-cache/tsconfig.json +++ b/types/superagent-no-cache/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/superagent-prefix/superagent-prefix-tests.ts b/types/superagent-prefix/superagent-prefix-tests.ts index 01e4b52905..6b0bbf0820 100644 --- a/types/superagent-prefix/superagent-prefix-tests.ts +++ b/types/superagent-prefix/superagent-prefix-tests.ts @@ -1,5 +1,5 @@ import * as request from 'superagent'; -import * as plugin from 'superagent-prefix'; +import plugin = require('superagent-prefix'); request .get('/some-url') diff --git a/types/superagent-prefix/tsconfig.json b/types/superagent-prefix/tsconfig.json index aa53ebadaf..8a99f7f0bd 100644 --- a/types/superagent-prefix/tsconfig.json +++ b/types/superagent-prefix/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/superagent/index.d.ts b/types/superagent/index.d.ts index fdf23891cb..200046d439 100644 --- a/types/superagent/index.d.ts +++ b/types/superagent/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Nico Zelaya // Michael Ledin // Pap Lőrinc +// Shrey Jain // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -16,6 +17,12 @@ type CallbackHandler = (err: any, res: request.Response) => void; type Serializer = (obj: any) => string; +type BrowserParser = (str: string) => any; + +type NodeParser = (res: request.Response, callback: (err: Error | null, body: any) => void) => void; + +type Parser = BrowserParser | NodeParser; + type MultipartValueSingle = Blob | Buffer | fs.ReadStream | string | boolean | number; type MultipartValue = MultipartValueSingle | MultipartValueSingle[]; @@ -37,6 +44,7 @@ declare namespace request { agent(): SuperAgent; serialize: { [type: string]: Serializer }; + parse: { [type: string]: Parser }; } interface SuperAgent extends stream.Stream { @@ -55,7 +63,6 @@ declare namespace request { move(url: string, callback?: CallbackHandler): Req; notify(url: string, callback?: CallbackHandler): Req; options(url: string, callback?: CallbackHandler): Req; - parse(fn: (res: Response, callback: (err: Error | null, body: any) => void) => void): this; patch(url: string, callback?: CallbackHandler): Req; post(url: string, callback?: CallbackHandler): Req; propfind(url: string, callback?: CallbackHandler): Req; @@ -122,7 +129,7 @@ declare namespace request { on(name: 'error', handler: (err: any) => void): this; on(name: 'progress', handler: (event: ProgressEvent) => void): this; on(name: string, handler: (event: any) => void): this; - parse(fn: (res: Response, callback: (err: Error | null, body: any) => void) => void): this; + parse(parser: Parser): this; part(): this; pfx(cert: Buffer | string): this; pipe(stream: NodeJS.WritableStream, options?: object): stream.Writable; diff --git a/types/superagent/superagent-tests.ts b/types/superagent/superagent-tests.ts index 5978b37206..bbea2d617c 100644 --- a/types/superagent/superagent-tests.ts +++ b/types/superagent/superagent-tests.ts @@ -1,8 +1,7 @@ // via: http://visionmedia.github.io/superagent/ - -import * as request from 'superagent'; +import request = require('superagent'); import * as fs from 'fs'; -import * as assert from 'assert'; +import assert = require('assert'); import { Agent } from 'https'; // Examples taken from https://github.com/visionmedia/superagent/blob/gh-pages/docs/index.md diff --git a/types/superagent/tsconfig.json b/types/superagent/tsconfig.json index e27bc6e788..57c8fccc02 100644 --- a/types/superagent/tsconfig.json +++ b/types/superagent/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/superagent/v2/superagent-tests.ts b/types/superagent/v2/superagent-tests.ts index 02074043fc..e0f0fcc592 100644 --- a/types/superagent/v2/superagent-tests.ts +++ b/types/superagent/v2/superagent-tests.ts @@ -1,8 +1,8 @@ // via: http://visionmedia.github.io/superagent/ -import * as request from 'superagent'; +import request = require('superagent'); import * as fs from 'fs'; -import * as assert from 'assert'; +import assert = require('assert'); import { Agent } from 'https'; // Examples taken from https://github.com/visionmedia/superagent/blob/gh-pages/docs/index.md diff --git a/types/superagent/v2/tsconfig.json b/types/superagent/v2/tsconfig.json index b58424d51b..29adcf28dc 100644 --- a/types/superagent/v2/tsconfig.json +++ b/types/superagent/v2/tsconfig.json @@ -23,7 +23,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/supercluster/tsconfig.json b/types/supercluster/tsconfig.json index 243cdf4117..6005259e9f 100644 --- a/types/supercluster/tsconfig.json +++ b/types/supercluster/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/supertest-as-promised/supertest-as-promised-tests.ts b/types/supertest-as-promised/supertest-as-promised-tests.ts index b86bdafbc9..fbf8be995b 100644 --- a/types/supertest-as-promised/supertest-as-promised-tests.ts +++ b/types/supertest-as-promised/supertest-as-promised-tests.ts @@ -1,5 +1,5 @@ -import * as request from 'supertest-as-promised'; -import * as express from 'express'; +import request = require('supertest-as-promised'); +import express = require('express'); declare function describe(desc: string, f: () => void): void; declare function it(desc: string, f: () => void): void; diff --git a/types/supertest-as-promised/tsconfig.json b/types/supertest-as-promised/tsconfig.json index 29e8790308..ba7aa25f13 100644 --- a/types/supertest-as-promised/tsconfig.json +++ b/types/supertest-as-promised/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/supertest/supertest-tests.ts b/types/supertest/supertest-tests.ts index 868aa8fdce..24bbd4bd56 100644 --- a/types/supertest/supertest-tests.ts +++ b/types/supertest/supertest-tests.ts @@ -1,6 +1,5 @@ - -import * as supertest from 'supertest'; -import * as express from 'express'; +import supertest = require('supertest'); +import express = require('express'); const app = express(); const request: supertest.SuperTest = supertest(app); diff --git a/types/supertest/tsconfig.json b/types/supertest/tsconfig.json index 8f674d2202..fbdb3202fa 100644 --- a/types/supertest/tsconfig.json +++ b/types/supertest/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/supports-color/tsconfig.json b/types/supports-color/tsconfig.json index 5084245065..5dcbca91e0 100644 --- a/types/supports-color/tsconfig.json +++ b/types/supports-color/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/svg-injector/tsconfig.json b/types/svg-injector/tsconfig.json index 5b186e06f2..9b904fec27 100644 --- a/types/svg-injector/tsconfig.json +++ b/types/svg-injector/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/svg-parser/tsconfig.json b/types/svg-parser/tsconfig.json index c24afbd999..138353d5fc 100644 --- a/types/svg-parser/tsconfig.json +++ b/types/svg-parser/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "svg-parser-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/svg-sprite/tsconfig.json b/types/svg-sprite/tsconfig.json index 42c44c1ece..9fdf0b6980 100644 --- a/types/svg-sprite/tsconfig.json +++ b/types/svg-sprite/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/svg2png/tsconfig.json b/types/svg2png/tsconfig.json index fc6537e29b..c683abf942 100644 --- a/types/svg2png/tsconfig.json +++ b/types/svg2png/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/svg4everybody/tsconfig.json b/types/svg4everybody/tsconfig.json index b6158fd4e9..a12501ccd5 100644 --- a/types/svg4everybody/tsconfig.json +++ b/types/svg4everybody/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/svgjs.draggable/tsconfig.json b/types/svgjs.draggable/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/svgjs.draggable/tsconfig.json +++ b/types/svgjs.draggable/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/svgjs.resize/tsconfig.json b/types/svgjs.resize/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/svgjs.resize/tsconfig.json +++ b/types/svgjs.resize/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/svgo/index.d.ts b/types/svgo/index.d.ts index f585f54658..5642a33cd1 100644 --- a/types/svgo/index.d.ts +++ b/types/svgo/index.d.ts @@ -1,179 +1,180 @@ -// Type definitions for svgo 0.7 +// Type definitions for svgo 1.0 // Project: https://github.com/svg/svgo // Definitions by: Bradley Ayers +// Gilad Gray // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 interface PluginCleanupAttrs { - cleanupAttrs: object; + cleanupAttrs: boolean | object; } interface PluginRemoveDoctype { - removeDoctype: object; + removeDoctype: boolean | object; } interface PluginRemoveXMLProcInst { - removeXMLProcInst: object; + removeXMLProcInst: boolean | object; } interface PluginRemoveComments { - removeComments: object; + removeComments: boolean | object; } interface PluginRemoveMetadata { - removeMetadata: object; + removeMetadata: boolean | object; } interface PluginRemoveTitle { - removeTitle: object; + removeTitle: boolean | object; } interface PluginRemoveDesc { - removeDesc: object; + removeDesc: boolean | object; } interface PluginRemoveUselessDefs { - removeUselessDefs: object; + removeUselessDefs: boolean | object; } interface PluginRemoveXMLNS { - removeXMLNS: object; + removeXMLNS: boolean | object; } interface PluginRemoveEditorsNSData { - removeEditorsNSData: object; + removeEditorsNSData: boolean | object; } interface PluginRemoveEmptyAttrs { - removeEmptyAttrs: object; + removeEmptyAttrs: boolean | object; } interface PluginRemoveHiddenElems { - removeHiddenElems: object; + removeHiddenElems: boolean | object; } interface PluginRemoveEmptyText { - removeEmptyText: object; + removeEmptyText: boolean | object; } interface PluginRemoveEmptyContainers { - removeEmptyContainers: object; + removeEmptyContainers: boolean | object; } interface PluginRemoveViewBox { - removeViewBox: object; + removeViewBox: boolean | object; } interface PluginCleanupEnableBackground { - cleanupEnableBackground: object; + cleanupEnableBackground: boolean | object; } interface PluginMinifyStyles { - minifyStyles: object; + minifyStyles: boolean | object; } interface PluginConvertStyleToAttrs { - convertStyleToAttrs: object; + convertStyleToAttrs: boolean | object; } interface PluginConvertColors { - convertColors: object; + convertColors: boolean | object; } interface PluginConvertPathData { - convertPathData: object; + convertPathData: boolean | object; } interface PluginConvertTransform { - convertTransform: object; + convertTransform: boolean | object; } interface PluginRemoveUnknownsAndDefaults { - removeUnknownsAndDefaults: object; + removeUnknownsAndDefaults: boolean | object; } interface PluginRemoveNonInheritableGroupAttrs { - removeNonInheritableGroupAttrs: object; + removeNonInheritableGroupAttrs: boolean | object; } interface PluginRemoveUselessStrokeAndFill { - removeUselessStrokeAndFill: object; + removeUselessStrokeAndFill: boolean | object; } interface PluginRemoveUnusedNS { - removeUnusedNS: object; + removeUnusedNS: boolean | object; } interface PluginCleanupIDs { - cleanupIDs: object; + cleanupIDs: boolean | object; } interface PluginCleanupNumericValues { - cleanupNumericValues: object; + cleanupNumericValues: boolean | object; } interface PluginCleanupListOfValues { - cleanupListOfValues: object; + cleanupListOfValues: boolean | object; } interface PluginMoveElemsAttrsToGroup { - moveElemsAttrsToGroup: object; + moveElemsAttrsToGroup: boolean | object; } interface PluginMoveGroupAttrsToElems { - moveGroupAttrsToElems: object; + moveGroupAttrsToElems: boolean | object; } interface PluginCollapseGroups { - collapseGroups: object; + collapseGroups: boolean | object; } interface PluginRemoveRasterImages { - removeRasterImages: object; + removeRasterImages: boolean | object; } interface PluginMergePaths { - mergePaths: object; + mergePaths: boolean | object; } interface PluginConvertShapeToPath { - convertShapeToPath: object; + convertShapeToPath: boolean | object; } interface PluginSortAttrs { - sortAttrs: object; + sortAttrs: boolean | object; } interface PluginTransformsWithOnePath { - transformsWithOnePath: object; + transformsWithOnePath: boolean | object; } interface PluginRemoveDimensions { - removeDimensions: object; + removeDimensions: boolean | object; } interface PluginRemoveAttrs { - removeAttrs: object; + removeAttrs: boolean | object; } interface PluginRemoveElementsByAttr { - removeElementsByAttr: object; + removeElementsByAttr: boolean | object; } interface PluginAddClassesToSVGElement { - addClassesToSVGElement: object; + addClassesToSVGElement: boolean | object; } interface PluginAddAttributesToSVGElement { - addAttributesToSVGElement: object; + addAttributesToSVGElement: boolean | object; } interface PluginRemoveStyleElement { - removeStyleElement: object; + removeStyleElement: boolean | object; } interface PluginRemoveScriptElement { - removeScriptElement: object; + removeScriptElement: boolean | object; } type PluginConfig = @@ -221,16 +222,107 @@ type PluginConfig = | PluginRemoveStyleElement | PluginRemoveScriptElement; +interface Js2SvgOptions { + /** @default '' */ + doctypeEnd?: string; + /** @default '' */ + procInstEnd?: string; + /** @default '<' */ + tagOpenStart?: string; + /** @default '>' */ + tagOpenEnd?: string; + /** @default '' */ + tagCloseEnd?: string; + /** @default '<' */ + tagShortStart?: string; + /** @default '/>' */ + tagShortEnd?: string; + /** @default '="' */ + attrStart?: string; + /** @default '"' */ + attrEnd?: string; + /** @default '' */ + commentEnd?: string; + /** @default '' */ + cdataEnd?: string; + /** @default '' */ + textStart?: string; + /** @default '' */ + textEnd?: string; + /** @default 4 */ + indent?: number; + /** @default /[&'"<>]/g */ + regEntities?: RegExp; + /** @default /[&"<>]/g */ + regValEntities?: RegExp; + /** @default encodeEntity */ + encodeEntity?: (char?: string) => string; + /** @default false */ + pretty?: boolean; + /** @default true */ + useShortTags?: boolean; +} + +interface Svg2JsOptions { + /** @default true */ + strict?: boolean; + /** @default false */ + trim?: boolean; + /** @default true */ + normalize?: boolean; + /** @default true */ + lowercase?: boolean; + /** @default true */ + xmlns?: boolean; + /** @default true */ + position?: boolean; +} + interface Options { - datauri?: string; + /** Output as Data URI string. */ + datauri?: "base64" | "enc" | "unenc"; + + /** Precision of floating point numbers. Will be passed to each plugin that suppors this param. */ floatPrecision?: number; + + /** Use full set of plugins. */ full?: boolean; + + /** Options for rendering optimized SVG from AST. */ + js2svg?: Js2SvgOptions; + + /** + * Individual plugin configurations. + * For specific options, see plugin source in https://github.com/svg/svgo/tree/master/plugins. + */ plugins?: PluginConfig[]; + + /** Options for parsing original SVG into AST. */ + svg2js?: Svg2JsOptions; +} + +interface SvgInfo { + path?: string; +} + +interface OptimizedSvg { + data: string; + info: object; } declare class SVGO { constructor(options?: Options); - optimize(code: string, callback: (result: any) => void): void; + optimize(svgString: string, info?: SvgInfo): Promise; } export = SVGO; diff --git a/types/svgo/svgo-tests.ts b/types/svgo/svgo-tests.ts index 9761316bf0..fae53a127d 100644 --- a/types/svgo/svgo-tests.ts +++ b/types/svgo/svgo-tests.ts @@ -5,21 +5,23 @@ let svgo = new SVGO(); svgo = new SVGO({}); svgo = new SVGO({ plugins: [] }); svgo = new SVGO({ plugins: [{ cleanupAttrs: {} }] }); -svgo = new SVGO({ datauri: "datauri:" }); +svgo = new SVGO({ datauri: "base64" }); svgo = new SVGO({ floatPrecision: 2 }); svgo = new SVGO({ full: true }); svgo = new SVGO({ plugins: [], - datauri: "datauri:", + datauri: "enc", floatPrecision: 2, - full: true + full: true, + js2svg: { + indent: 2, + pretty: true, + }, + svg2js: { + trim: true, + } }); // SVGO instance methods -svgo.optimize(``, result => { - if (result.error) { - result.error; - } else { - result.data; - } -}); +svgo.optimize(``, { path: "filepath" }) + .then(result => result.data, error => error); diff --git a/types/svgo/tsconfig.json b/types/svgo/tsconfig.json index e2cdf41913..0ac1849980 100644 --- a/types/svgo/tsconfig.json +++ b/types/svgo/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "svgo-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/swag/tsconfig.json b/types/swag/tsconfig.json index b2eebb5fc1..0ac74e8fae 100644 --- a/types/swag/tsconfig.json +++ b/types/swag/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/swagger-express-middleware/swagger-express-middleware-tests.ts b/types/swagger-express-middleware/swagger-express-middleware-tests.ts index 6ba847fe3f..1a01d8475d 100644 --- a/types/swagger-express-middleware/swagger-express-middleware-tests.ts +++ b/types/swagger-express-middleware/swagger-express-middleware-tests.ts @@ -1,5 +1,5 @@ -import * as express from "express"; -import * as SwaggerExpressMiddleware from "swagger-express-middleware"; +import express = require("express"); +import SwaggerExpressMiddleware = require("swagger-express-middleware"); let app = express(); let router = express.Router(); diff --git a/types/swagger-express-middleware/tsconfig.json b/types/swagger-express-middleware/tsconfig.json index efd56f5cc9..8f40e379c1 100644 --- a/types/swagger-express-middleware/tsconfig.json +++ b/types/swagger-express-middleware/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/swagger-express-mw/swagger-express-mw-tests.ts b/types/swagger-express-mw/swagger-express-mw-tests.ts index 617e331e1c..9f81cf8a2d 100644 --- a/types/swagger-express-mw/swagger-express-mw-tests.ts +++ b/types/swagger-express-mw/swagger-express-mw-tests.ts @@ -1,5 +1,5 @@ import * as SwaggerExpress from "swagger-express-mw"; -import * as express from "express"; +import express = require("express"); const app = express(); const config: SwaggerExpress.Config = { diff --git a/types/swagger-express-mw/tsconfig.json b/types/swagger-express-mw/tsconfig.json index c529b14c27..10ebc4ed97 100644 --- a/types/swagger-express-mw/tsconfig.json +++ b/types/swagger-express-mw/tsconfig.json @@ -14,13 +14,16 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "swagger-express-mw-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/swagger-hapi/tsconfig.json b/types/swagger-hapi/tsconfig.json index ea5343eb59..5b917e2121 100644 --- a/types/swagger-hapi/tsconfig.json +++ b/types/swagger-hapi/tsconfig.json @@ -14,13 +14,16 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "swagger-hapi-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/swagger-jsdoc/swagger-jsdoc-tests.ts b/types/swagger-jsdoc/swagger-jsdoc-tests.ts index 2a87ae2dab..4cf386e48a 100644 --- a/types/swagger-jsdoc/swagger-jsdoc-tests.ts +++ b/types/swagger-jsdoc/swagger-jsdoc-tests.ts @@ -1,6 +1,4 @@ -/// - -import * as express from 'express'; +import express = require('express'); import swaggerJSDoc = require('swagger-jsdoc'); const app = express(); diff --git a/types/swagger-jsdoc/tsconfig.json b/types/swagger-jsdoc/tsconfig.json index 109b47bad0..8060b5675c 100644 --- a/types/swagger-jsdoc/tsconfig.json +++ b/types/swagger-jsdoc/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/swagger-node-runner/swagger-node-runner-tests.ts b/types/swagger-node-runner/swagger-node-runner-tests.ts index 9890bed290..1deae28f23 100644 --- a/types/swagger-node-runner/swagger-node-runner-tests.ts +++ b/types/swagger-node-runner/swagger-node-runner-tests.ts @@ -1,6 +1,6 @@ import * as SwaggerNodeRunner from "swagger-node-runner"; -import * as express from "express"; -import * as connect from "connect"; +import express = require("express"); +import connect = require("connect"); import * as Hapi from "hapi"; import * as restify from "restify"; import * as sails from "sails.io.js"; diff --git a/types/swagger-node-runner/tsconfig.json b/types/swagger-node-runner/tsconfig.json index 1d3ae44a1a..9aa6ec5364 100644 --- a/types/swagger-node-runner/tsconfig.json +++ b/types/swagger-node-runner/tsconfig.json @@ -14,13 +14,16 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "swagger-node-runner-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/swagger-parser/tsconfig.json b/types/swagger-parser/tsconfig.json index bd15ee7e32..8a2e67d8bc 100644 --- a/types/swagger-parser/tsconfig.json +++ b/types/swagger-parser/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/swagger-restify-mw/tsconfig.json b/types/swagger-restify-mw/tsconfig.json index a9dcb8c0da..d561204c42 100644 --- a/types/swagger-restify-mw/tsconfig.json +++ b/types/swagger-restify-mw/tsconfig.json @@ -14,13 +14,16 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "swagger-restify-mw-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/swagger-sails-hook/tsconfig.json b/types/swagger-sails-hook/tsconfig.json index 44a316b98b..17d598916d 100644 --- a/types/swagger-sails-hook/tsconfig.json +++ b/types/swagger-sails-hook/tsconfig.json @@ -14,13 +14,16 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "swagger-sails-hook-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/swagger-schema-official/tsconfig.json b/types/swagger-schema-official/tsconfig.json index 475a0c4579..517693eec1 100644 --- a/types/swagger-schema-official/tsconfig.json +++ b/types/swagger-schema-official/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/swagger-tools/swagger-tools-tests.ts b/types/swagger-tools/swagger-tools-tests.ts index 7b05595269..58e978a0e4 100644 --- a/types/swagger-tools/swagger-tools-tests.ts +++ b/types/swagger-tools/swagger-tools-tests.ts @@ -1,6 +1,6 @@ // 2.0 examples from https://github.com/apigee-127/swagger-tools/blob/master/examples/2.0/index.js -import * as connect from 'connect'; +import connect = require('connect'); import { createServer } from 'http'; import * as swaggerTools from 'swagger-tools'; diff --git a/types/swagger-tools/tsconfig.json b/types/swagger-tools/tsconfig.json index f00040387f..1ac581a6a4 100644 --- a/types/swagger-tools/tsconfig.json +++ b/types/swagger-tools/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/swaggerize-express/tsconfig.json b/types/swaggerize-express/tsconfig.json index 1ec57ed7db..b4291a08a9 100644 --- a/types/swaggerize-express/tsconfig.json +++ b/types/swaggerize-express/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/swfobject/tsconfig.json b/types/swfobject/tsconfig.json index 905fa4c7c5..72d38b165e 100644 --- a/types/swfobject/tsconfig.json +++ b/types/swfobject/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/swiftclick/tsconfig.json b/types/swiftclick/tsconfig.json index 903e78b3ae..aa64896742 100644 --- a/types/swiftclick/tsconfig.json +++ b/types/swiftclick/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/swig-email-templates/tsconfig.json b/types/swig-email-templates/tsconfig.json index 987a6f629a..becbb0b020 100644 --- a/types/swig-email-templates/tsconfig.json +++ b/types/swig-email-templates/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "swig-email-templates-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/swig/tsconfig.json b/types/swig/tsconfig.json index 29202d9a09..650458f3fc 100644 --- a/types/swig/tsconfig.json +++ b/types/swig/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/swipe/tsconfig.json b/types/swipe/tsconfig.json index dd8718e5a4..bca03d685f 100644 --- a/types/swipe/tsconfig.json +++ b/types/swipe/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/swiper/index.d.ts b/types/swiper/index.d.ts index 5f4cf01298..65872facd2 100644 --- a/types/swiper/index.d.ts +++ b/types/swiper/index.d.ts @@ -320,8 +320,8 @@ declare class Swiper { enableMousewheelControl(): void; disableKeyboardControl(): void; enableKeyboardControl(): void; - disableTouchContro(): void; - enableTouchContro(): void; + disableTouchControl(): void; + enableTouchControl(): void; unsetGrabCursor(): void; setGrabCursor(): void; diff --git a/types/swiper/tsconfig.json b/types/swiper/tsconfig.json index 8bde882886..ac040ef01e 100644 --- a/types/swiper/tsconfig.json +++ b/types/swiper/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/swiper/v2/tsconfig.json b/types/swiper/v2/tsconfig.json index 3b7f35d0f2..ef11afdc92 100644 --- a/types/swiper/v2/tsconfig.json +++ b/types/swiper/v2/tsconfig.json @@ -23,7 +23,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/swipeview/tsconfig.json b/types/swipeview/tsconfig.json index 482e330299..281d980146 100644 --- a/types/swipeview/tsconfig.json +++ b/types/swipeview/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/switchery/tsconfig.json b/types/switchery/tsconfig.json index cd6c171807..cb03c7a674 100644 --- a/types/switchery/tsconfig.json +++ b/types/switchery/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/swiz/tsconfig.json b/types/swiz/tsconfig.json index 9f07ba0306..9bca3616e5 100644 --- a/types/swiz/tsconfig.json +++ b/types/swiz/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/sylvester/tsconfig.json b/types/sylvester/tsconfig.json index 1bdc202b83..8ebbbb3c5f 100644 --- a/types/sylvester/tsconfig.json +++ b/types/sylvester/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/synaptic/tsconfig.json b/types/synaptic/tsconfig.json index a8a8ffa40a..7c57170f80 100644 --- a/types/synaptic/tsconfig.json +++ b/types/synaptic/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/systeminformation/tsconfig.json b/types/systeminformation/tsconfig.json index d1b0e46f7a..eb2cfa6d98 100644 --- a/types/systeminformation/tsconfig.json +++ b/types/systeminformation/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/systemjs/tsconfig.json b/types/systemjs/tsconfig.json index 95bed64e3b..36e37a6353 100644 --- a/types/systemjs/tsconfig.json +++ b/types/systemjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/table/tsconfig.json b/types/table/tsconfig.json index 6aee73e7c0..95f2b7ae31 100644 --- a/types/table/tsconfig.json +++ b/types/table/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tabris-plugin-firebase/tsconfig.json b/types/tabris-plugin-firebase/tsconfig.json index 118339f812..5c6678995a 100644 --- a/types/tabris-plugin-firebase/tsconfig.json +++ b/types/tabris-plugin-firebase/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "tabris-plugin-firebase-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/tabtab/tsconfig.json b/types/tabtab/tsconfig.json index b2098e5326..548d2f9c95 100644 --- a/types/tabtab/tsconfig.json +++ b/types/tabtab/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tabulator/tsconfig.json b/types/tabulator/tsconfig.json index d094f72c74..1c655aeea9 100644 --- a/types/tabulator/tsconfig.json +++ b/types/tabulator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tapable/tsconfig.json b/types/tapable/tsconfig.json index c1a629a0a0..f2b458cf79 100644 --- a/types/tapable/tsconfig.json +++ b/types/tapable/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tape/tsconfig.json b/types/tape/tsconfig.json index 14b29b4be3..89a3bb0284 100644 --- a/types/tape/tsconfig.json +++ b/types/tape/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tar/tsconfig.json b/types/tar/tsconfig.json index 103befc21b..b3bb78f6d4 100644 --- a/types/tar/tsconfig.json +++ b/types/tar/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tcp-ping/tsconfig.json b/types/tcp-ping/tsconfig.json index 20d82ad303..e0fba82053 100644 --- a/types/tcp-ping/tsconfig.json +++ b/types/tcp-ping/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "tcp-ping-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/tea-merge/tsconfig.json b/types/tea-merge/tsconfig.json index 0af0988abf..cbf7f19402 100644 --- a/types/tea-merge/tsconfig.json +++ b/types/tea-merge/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tedious-connection-pool/tsconfig.json b/types/tedious-connection-pool/tsconfig.json index cd636ad876..bfddd0d319 100644 --- a/types/tedious-connection-pool/tsconfig.json +++ b/types/tedious-connection-pool/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tedious/tsconfig.json b/types/tedious/tsconfig.json index 6b1c2d58eb..3c37a7f097 100644 --- a/types/tedious/tsconfig.json +++ b/types/tedious/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/teechart/tsconfig.json b/types/teechart/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/teechart/tsconfig.json +++ b/types/teechart/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/telebot/telebot-tests.ts b/types/telebot/telebot-tests.ts index 3bb9677b5d..ea4851c27b 100644 --- a/types/telebot/telebot-tests.ts +++ b/types/telebot/telebot-tests.ts @@ -1,4 +1,4 @@ -import * as TeleBot from "telebot"; +import TeleBot = require("telebot"); let bot = new TeleBot('token'); bot = new TeleBot({ diff --git a/types/telebot/tsconfig.json b/types/telebot/tsconfig.json index df24dd318b..0c0e132d22 100644 --- a/types/telebot/tsconfig.json +++ b/types/telebot/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/temp-fs/tsconfig.json b/types/temp-fs/tsconfig.json index 7f99f0f62a..c8e72528eb 100644 --- a/types/temp-fs/tsconfig.json +++ b/types/temp-fs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/temp-write/tsconfig.json b/types/temp-write/tsconfig.json index e841595edb..068b8c9313 100644 --- a/types/temp-write/tsconfig.json +++ b/types/temp-write/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/temp/tsconfig.json b/types/temp/tsconfig.json index f7e1902067..dd0badc02d 100644 --- a/types/temp/tsconfig.json +++ b/types/temp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tempfile/tsconfig.json b/types/tempfile/tsconfig.json index 2f31cafb72..908ce7c602 100644 --- a/types/tempfile/tsconfig.json +++ b/types/tempfile/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tempy/tsconfig.json b/types/tempy/tsconfig.json index d6216873d6..c3d9febb36 100644 --- a/types/tempy/tsconfig.json +++ b/types/tempy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/terminal-menu/tsconfig.json b/types/terminal-menu/tsconfig.json index 0ffdb3da4c..33f19c3050 100644 --- a/types/terminal-menu/tsconfig.json +++ b/types/terminal-menu/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tesseract.js/tsconfig.json b/types/tesseract.js/tsconfig.json index 0214ea15e4..235f0535ae 100644 --- a/types/tesseract.js/tsconfig.json +++ b/types/tesseract.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/testingbot-api/tsconfig.json b/types/testingbot-api/tsconfig.json index f0bd06bb1b..8bc227236a 100644 --- a/types/testingbot-api/tsconfig.json +++ b/types/testingbot-api/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tether-drop/tsconfig.json b/types/tether-drop/tsconfig.json index c1dc9928ec..44334974f3 100644 --- a/types/tether-drop/tsconfig.json +++ b/types/tether-drop/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tether-shepherd/tsconfig.json b/types/tether-shepherd/tsconfig.json index ff7a78897d..2871f60a0c 100644 --- a/types/tether-shepherd/tsconfig.json +++ b/types/tether-shepherd/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tether/tsconfig.json b/types/tether/tsconfig.json index 5286a98289..64c07ade1b 100644 --- a/types/tether/tsconfig.json +++ b/types/tether/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/text-buffer/tsconfig.json b/types/text-buffer/tsconfig.json index dd4d1eeb3e..6edde7770a 100644 --- a/types/text-buffer/tsconfig.json +++ b/types/text-buffer/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "text-buffer-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/text-encoding-utf-8/tsconfig.json b/types/text-encoding-utf-8/tsconfig.json index f9d410c8c5..c9a2142c8b 100644 --- a/types/text-encoding-utf-8/tsconfig.json +++ b/types/text-encoding-utf-8/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/text-encoding/tsconfig.json b/types/text-encoding/tsconfig.json index 898180941a..c7809cd82f 100644 --- a/types/text-encoding/tsconfig.json +++ b/types/text-encoding/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/three/index.d.ts b/types/three/index.d.ts index 2cea550034..e553853293 100644 --- a/types/three/index.d.ts +++ b/types/three/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for three.js 0.89 // Project: https://threejs.org -// Definitions by: Kon , Satoru Kimura , Florent Poujol , SereznoKot , HouChunlei , Ivo , David Asmuth , Brandon Roberge, Qinsi ZHU , Toshiya Nakakura , Poul Kjeldager Sørensen , Stefan Profanter , Edmund Fokschaner , Roelof Jooste , Daniel Hritzkiv +// Definitions by: Kon , Satoru Kimura , Florent Poujol , SereznoKot , HouChunlei , Ivo , David Asmuth , Brandon Roberge, Qinsi ZHU , Toshiya Nakakura , Poul Kjeldager Sørensen , Stefan Profanter , Edmund Fokschaner , Roelof Jooste , Daniel Hritzkiv , Apurva Ojas // Definitions: https://github.com//DefinitelyTyped export * from "./three-core"; @@ -27,6 +27,7 @@ export * from "./three-projector"; export * from "./three-renderpass"; export * from "./three-shaderpass"; export * from "./three-smaapass"; +export * from "./three-filmpass"; export * from "./three-trackballcontrols"; export * from "./three-transformcontrols"; export * from "./three-vrcontrols"; diff --git a/types/three/test/webgl/webgl_geometries.ts b/types/three/test/webgl/webgl_geometries.ts index 89e0af480c..32ab4270b4 100644 --- a/types/three/test/webgl/webgl_geometries.ts +++ b/types/three/test/webgl/webgl_geometries.ts @@ -76,11 +76,11 @@ // - var points: THREE.Vector3[] = []; + var points: THREE.Vector2[] = []; for (var i = 0; i < 50; i++) { - points.push(new THREE.Vector3(Math.sin(i * 0.2) * Math.sin(i * 0.1) * 15 + 50, 0, (i - 5) * 2)); + points.push(new THREE.Vector2(Math.sin(i * 0.2) * Math.sin(i * 0.1) * 15 + 50, 0)); } @@ -165,4 +165,4 @@ } -} \ No newline at end of file +} diff --git a/types/three/test/webgl/webgl_interactive_raycasting_points.ts b/types/three/test/webgl/webgl_interactive_raycasting_points.ts index ced8feb6c6..7f6f163a28 100644 --- a/types/three/test/webgl/webgl_interactive_raycasting_points.ts +++ b/types/three/test/webgl/webgl_interactive_raycasting_points.ts @@ -215,7 +215,7 @@ // var sphereGeometry = new THREE.SphereGeometry(0.1, 32, 32); - var sphereMaterial = new THREE.MeshBasicMaterial({color: 0xff0000, shading: THREE.FlatShading}); + var sphereMaterial = new THREE.MeshBasicMaterial({color: 0xff0000, flatShading: true}); for (var i = 0; i < 40; i++) { @@ -313,4 +313,4 @@ renderer.render(scene, camera); } -} \ No newline at end of file +} diff --git a/types/three/test/webgl/webgl_lights_hemisphere.ts b/types/three/test/webgl/webgl_lights_hemisphere.ts index 108419f4ad..c0daf3773f 100644 --- a/types/three/test/webgl/webgl_lights_hemisphere.ts +++ b/types/three/test/webgl/webgl_lights_hemisphere.ts @@ -113,7 +113,7 @@ loader.load( "models/animated/flamingo.js", function( geometry ) { - var material = new THREE.MeshPhongMaterial( { color: 0xffffff, specular: 0xffffff, shininess: 20, morphTargets: true, vertexColors: THREE.FaceColors, shading: THREE.FlatShading } ); + var material = new THREE.MeshPhongMaterial( { color: 0xffffff, specular: 0xffffff, shininess: 20, morphTargets: true, vertexColors: THREE.FaceColors, flatShading: true } ); var mesh = new THREE.Mesh( geometry, material ); var s = 0.35; diff --git a/types/three/test/webgl/webgl_materials.ts b/types/three/test/webgl/webgl_materials.ts index 23d2d98a23..68235c5e5c 100644 --- a/types/three/test/webgl/webgl_materials.ts +++ b/types/three/test/webgl/webgl_materials.ts @@ -56,20 +56,20 @@ materials.push(new THREE.MeshLambertMaterial({ map: texture, transparent: true })); materials.push(new THREE.MeshLambertMaterial({ color: 0xdddddd })); - materials.push(new THREE.MeshPhongMaterial({ color: 0xdddddd, specular: 0x009900, shininess: 30, shading: THREE.FlatShading })); + materials.push(new THREE.MeshPhongMaterial({ color: 0xdddddd, specular: 0x009900, shininess: 30, flatShading: true })); materials.push(new THREE.MeshNormalMaterial()); materials.push(new THREE.MeshBasicMaterial({ color: 0xffaa00, transparent: true, blending: THREE.AdditiveBlending })); //materials.push( new THREE.MeshBasicMaterial( { color: 0xff0000, blending: THREE.SubtractiveBlending } ) ); materials.push(new THREE.MeshLambertMaterial({ color: 0xdddddd })); - materials.push(new THREE.MeshPhongMaterial({ color: 0xdddddd, specular: 0x009900, shininess: 30, shading: THREE.SmoothShading, map: texture, transparent: true })); + materials.push(new THREE.MeshPhongMaterial({ color: 0xdddddd, specular: 0x009900, shininess: 30, flatShading: false, map: texture, transparent: true })); materials.push(new THREE.MeshNormalMaterial({})); materials.push(new THREE.MeshBasicMaterial({ color: 0xffaa00, wireframe: true })); materials.push(new THREE.MeshDepthMaterial()); materials.push(new THREE.MeshLambertMaterial({ color: 0x666666, emissive: 0xff0000 })); - materials.push(new THREE.MeshPhongMaterial({ color: 0x000000, specular: 0x666666, emissive: 0xff0000, shininess: 10, shading: THREE.SmoothShading, opacity: 0.9, transparent: true })); + materials.push(new THREE.MeshPhongMaterial({ color: 0x000000, specular: 0x666666, emissive: 0xff0000, shininess: 10, flatShading: false, opacity: 0.9, transparent: true })); materials.push(new THREE.MeshBasicMaterial({ map: texture, transparent: true })); @@ -100,7 +100,7 @@ let material = materials[i]; geometry = material instanceof THREE.MeshFaceMaterial ? geometry_pieces : - (material.shading == THREE.FlatShading ? geometry_flat : geometry_smooth); + (material.flatShading ? geometry_flat : geometry_smooth); sphere = new THREE.Mesh(geometry, material); diff --git a/types/three/test/webgl/webgl_postprocessing.ts b/types/three/test/webgl/webgl_postprocessing.ts index 0c768eccea..dff5ec5592 100644 --- a/types/three/test/webgl/webgl_postprocessing.ts +++ b/types/three/test/webgl/webgl_postprocessing.ts @@ -26,7 +26,7 @@ scene.add(object); var geometry = new THREE.SphereGeometry(1, 4, 4); - var material = new THREE.MeshPhongMaterial({ color: 0xffffff, shading: THREE.FlatShading }); + var material = new THREE.MeshPhongMaterial({ color: 0xffffff, flatShading: true }); for (var i = 0; i < 100; i++) { @@ -84,4 +84,4 @@ composer.render(); } -} \ No newline at end of file +} diff --git a/types/three/test/webvr/webvr.ts b/types/three/test/webvr/webvr.ts new file mode 100644 index 0000000000..e831e493ee --- /dev/null +++ b/types/three/test/webvr/webvr.ts @@ -0,0 +1,13 @@ +// WebVRManager support + +() => { + const renderer = new THREE.WebGLRenderer(); + renderer.vr.enabled = true; + const camera = new THREE.PerspectiveCamera(); + const vrCamera = renderer.vr.getCamera(camera); + const display: VRDisplay = renderer.vr.getDevice(); + renderer.vr.setDevice(display); + const obj = new THREE.Object3D(); + renderer.vr.setPoseTarget(obj); + renderer.vr.dispose(); +} diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 880a150a06..40a9d4daa0 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -450,11 +450,6 @@ export class Camera extends Object3D { getWorldDirection(optionalTarget?: Vector3): Vector3; - /** - * This make the camera look at the vector position in local space. - * @param vector point to look at - */ - lookAt(vector: Vector3): void; } export class CubeCamera extends Object3D { @@ -656,6 +651,13 @@ export class StereoCamera extends Camera { update(camera: PerspectiveCamera): void; } +export class ArrayCamera extends PerspectiveCamera { + constructor(cameras?: PerspectiveCamera[]); + + cameras: PerspectiveCamera[]; + isArrayCamera: true; +} + // Core /////////////////////////////////////////////////////////////////////////////////////////////// /** @@ -1613,6 +1615,12 @@ export class Object3D extends EventDispatcher { */ userData: any; + /** + * Used to check whether this or derived classes are Object3Ds. Default is true. + * You should not change this, as it is used internally for optimisation. + */ + isObject3D: boolean; + /** * Calls before rendering object */ @@ -1663,6 +1671,13 @@ export class Object3D extends EventDispatcher { */ rotateOnAxis(axis: Vector3, angle: number): Object3D; + /** + * Rotate an object along an axis in world space. The axis is assumed to be normalized. Method Assumes no rotated parent. + * @param axis A normalized vector in object space. + * @param angle The angle in radians. + */ + rotateOnWorldAxis(axis: Vector3, angle: number): Object3D; + /** * * @param angle @@ -1722,6 +1737,7 @@ export class Object3D extends EventDispatcher { * @param vector A world vector to look at. */ lookAt(vector: Vector3): void; + lookAt(x: number, y: number, z: number): void; /** * Adds object as child of this object. @@ -1731,7 +1747,7 @@ export class Object3D extends EventDispatcher { /** * Removes object as child of this object. */ - remove(object: Object3D): void; + remove(...object: Object3D[]): void; /** * Searches through the object's children and returns the first with a matching id, optionally recursive. @@ -1781,13 +1797,6 @@ export class Object3D extends EventDispatcher { * @param recursive */ copy(source: this, recursive?: boolean): this; - - /** - * @deprecated - */ - eulerOrder: string; - getChildByName(name: string): Object3D; - translate(distance: number, axis: Vector3): Object3D; } export interface Intersection { @@ -2357,8 +2366,6 @@ export interface MaterialParameters { transparent?: boolean; vertexColors?: Colors; visible?: boolean; - - shading?: Shading; } /** @@ -2591,15 +2598,6 @@ export class Material extends EventDispatcher { */ update(): void; - /** - * @deprecated - */ - warpRGB: Color; - - /** - * @deprecated Removed, use .flatShading instead. - */ - shading: Shading; } export interface LineBasicMaterialParameters extends MaterialParameters { @@ -2655,7 +2653,6 @@ export interface MeshBasicMaterialParameters extends MaterialParameters { combine?: Combine; reflectivity?: number; refractionRatio?: number; - shading?: Shading; wireframe?: boolean; wireframeLinewidth?: number; wireframeLinecap?: string; @@ -2677,7 +2674,6 @@ export class MeshBasicMaterial extends Material { combine: Combine; reflectivity: number; refractionRatio: number; - shading: Shading; wireframe: boolean; wireframeLinewidth: number; wireframeLinecap: string; @@ -5134,6 +5130,8 @@ export class WebGLRenderer implements Renderer { state: WebGLState; allocTextureUnit: any; + vr: WebVRManager; + /** * Return the WebGL context. */ @@ -6613,8 +6611,12 @@ export class ConeGeometry extends CylinderGeometry { constructor(radius?: number, height?: number, radialSegment?: number, heightSegment?: number, openEnded?: boolean, thetaStart?: number, thetaLength?: number); } +export class DodecahedronBufferGeometry extends PolyhedronBufferGeometry { + constructor(radius?: number, detail?: number); +} + export class DodecahedronGeometry extends Geometry { - constructor(radius: number, detail: number); + constructor(radius?: number, detail?: number); parameters: { radius: number; @@ -6639,15 +6641,19 @@ export class ExtrudeGeometry extends Geometry { addShape(shape: Shape, options?: any): void; } +export class IcosahedronBufferGeometry extends PolyhedronBufferGeometry { + constructor(radius?: number, detail?: number); +} + export class IcosahedronGeometry extends PolyhedronGeometry { - constructor(radius: number, detail: number); + constructor(radius?: number, detail?: number); } export class LatheBufferGeometry extends BufferGeometry { - constructor(points: Vector3[], segments?: number, phiStart?: number, phiLength?: number); + constructor(points: Vector2[], segments?: number, phiStart?: number, phiLength?: number); parameters: { - points: Vector3[]; + points: Vector2[]; segments: number; phiStart: number; phiLength: number; @@ -6655,18 +6661,22 @@ export class LatheBufferGeometry extends BufferGeometry { } export class LatheGeometry extends Geometry { - constructor(points: Vector3[], segments?: number, phiStart?: number, phiLength?: number); + constructor(points: Vector2[], segments?: number, phiStart?: number, phiLength?: number); parameters: { - points: Vector3[]; + points: Vector2[]; segments: number; phiStart: number; phiLength: number; }; } +export class OctahedronBufferGeometry extends PolyhedronBufferGeometry { + constructor(radius?: number, detail?: number); +} + export class OctahedronGeometry extends PolyhedronGeometry { - constructor(radius: number, detail: number); + constructor(radius?: number, detail?: number); } export class ParametricGeometry extends Geometry { @@ -6701,6 +6711,17 @@ export class PlaneGeometry extends Geometry { }; } +export class PolyhedronBufferGeometry extends BufferGeometry { + constructor(vertices: number[], indices: number[], radius: number, detail: number); + + parameters: { + vertices: number[]; + indices: number[]; + radius: number; + detail: number; + } +} + export class PolyhedronGeometry extends Geometry { constructor(vertices: number[], indices: number[], radius?: number, detail?: number); @@ -6747,6 +6768,11 @@ export class ShapeGeometry extends Geometry { addShape(shape: Shape, options?: any): void; } +export class ShapeBufferGeometry extends BufferGeometry +{ + constructor(shapes: Shape | Shape[], curveSegments?: number); +} + export class SphereBufferGeometry extends BufferGeometry { constructor(radius: number, widthSegments?: number, heightSegments?: number, phiStart?: number, phiLength?: number, thetaStart?: number, thetaLength?: number); @@ -6789,6 +6815,10 @@ export class SphereGeometry extends Geometry { }; } +export class TetrahedronBufferGeometry extends PolyhedronBufferGeometry { + constructor(radius?: number, detail?: number); +} + export class TetrahedronGeometry extends PolyhedronGeometry { constructor(radius?: number, detail?: number); } @@ -7077,3 +7107,13 @@ export class MorphBlendMesh extends Mesh { stopAnimation(name: string): void; update(delta: number): void; } + +export interface WebVRManager { + enabled: boolean; + getDevice(): VRDisplay | null; + setDevice(device: VRDisplay | null): void; + setPoseTarget(object: Object3D | null): void; + getCamera(camera: PerspectiveCamera): PerspectiveCamera | ArrayCamera; + submitFrame(): void; + dispose(): void; +} diff --git a/types/three/three-effectcomposer.d.ts b/types/three/three-effectcomposer.d.ts index 3680a43658..0f30d45d04 100644 --- a/types/three/three-effectcomposer.d.ts +++ b/types/three/three-effectcomposer.d.ts @@ -23,3 +23,23 @@ export class EffectComposer { setSize(width: number, height: number): void; } + + +export class Pass{ + // if set to true, the pass is processed by the composer + enabled: boolean; + + // if set to true, the pass indicates to swap read and write buffer after rendering + needsSwap: boolean; + + // if set to true, the pass clears its buffer before rendering + clear: boolean; + + // if set to true, the result of the pass is rendered to screen + renderToScreen: boolean; + + setSize(width: number, height:number ): void; + + render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget, readBuffer: WebGLRenderTarget, delta: number, maskActive?: boolean): void; + +} \ No newline at end of file diff --git a/types/three/three-filmpass.d.ts b/types/three/three-filmpass.d.ts new file mode 100644 index 0000000000..0890ac8507 --- /dev/null +++ b/types/three/three-filmpass.d.ts @@ -0,0 +1,13 @@ +import { Camera, Scene, WebGLRenderTarget, WebGLRenderer, Material, Mesh, IUniform } from "./three-core"; +import {Pass} from "./three-effectcomposer"; + +export class FilmPass extends Pass { + constructor(noiseIntensity: number, scanlinesIntensity: number, scanlinesCount: number, grayscale: boolean); + + scene: Scene; + camera: Camera; + uniforms: IUniform; + material: Material; + quad: Mesh; + +} diff --git a/types/three/tsconfig.json b/types/three/tsconfig.json index 1e615b65b1..80a1e81675 100644 --- a/types/three/tsconfig.json +++ b/types/three/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -54,6 +55,7 @@ "test/examples/controls/vrcontrols.ts", "test/examples/ctm/ctmloader.ts", "test/examples/octree.ts", - "test/examples/loaders/webgl_loader_obj_mtl.ts" + "test/examples/loaders/webgl_loader_obj_mtl.ts", + "test/webvr/webvr.ts" ] } \ No newline at end of file diff --git a/types/thrift/tsconfig.json b/types/thrift/tsconfig.json index 9bcbced4ee..84dc940440 100644 --- a/types/thrift/tsconfig.json +++ b/types/thrift/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/throng/tsconfig.json b/types/throng/tsconfig.json index 20b9b46d85..7aad41aa3d 100644 --- a/types/throng/tsconfig.json +++ b/types/throng/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/throttle-debounce/tsconfig.json b/types/throttle-debounce/tsconfig.json index cf362d7611..d34cb0ed14 100644 --- a/types/throttle-debounce/tsconfig.json +++ b/types/throttle-debounce/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/throttle/tsconfig.json b/types/throttle/tsconfig.json index f05aae2e84..86acaff2d4 100644 --- a/types/throttle/tsconfig.json +++ b/types/throttle/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/through/tsconfig.json b/types/through/tsconfig.json index 88c7abb2fd..f98cfa1871 100644 --- a/types/through/tsconfig.json +++ b/types/through/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/through2-map/tsconfig.json b/types/through2-map/tsconfig.json index 282a192f4d..b1486f7a4c 100644 --- a/types/through2-map/tsconfig.json +++ b/types/through2-map/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/through2/tsconfig.json b/types/through2/tsconfig.json index c5c6eaa6b1..7da0c73936 100644 --- a/types/through2/tsconfig.json +++ b/types/through2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/through2/v0/tsconfig.json b/types/through2/v0/tsconfig.json index ea1529c9fe..7dc3436c47 100644 --- a/types/through2/v0/tsconfig.json +++ b/types/through2/v0/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tile-reduce/tile-reduce-tests.ts b/types/tile-reduce/tile-reduce-tests.ts index f8f22adfac..38e6cfcf17 100644 --- a/types/tile-reduce/tile-reduce-tests.ts +++ b/types/tile-reduce/tile-reduce-tests.ts @@ -1,4 +1,4 @@ -import * as tilereduce from 'tile-reduce' +import tilereduce = require('tile-reduce'); import { BBox, Tile, Source, Types } from 'tile-reduce' global.mapOptions diff --git a/types/tile-reduce/tsconfig.json b/types/tile-reduce/tsconfig.json index 2afad7ef56..b613614587 100644 --- a/types/tile-reduce/tsconfig.json +++ b/types/tile-reduce/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tilebelt/tsconfig.json b/types/tilebelt/tsconfig.json index f6c2ff2e44..f8c5acc3fe 100644 --- a/types/tilebelt/tsconfig.json +++ b/types/tilebelt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/time-span/tsconfig.json b/types/time-span/tsconfig.json index b17a400526..49a9d4a315 100644 --- a/types/time-span/tsconfig.json +++ b/types/time-span/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/timelinejs/tsconfig.json b/types/timelinejs/tsconfig.json index 82cb5dd197..19e69c4a75 100644 --- a/types/timelinejs/tsconfig.json +++ b/types/timelinejs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/timelinejs3/tsconfig.json b/types/timelinejs3/tsconfig.json index 7f26ea1538..28ea7628cd 100644 --- a/types/timelinejs3/tsconfig.json +++ b/types/timelinejs3/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/timer-machine/tsconfig.json b/types/timer-machine/tsconfig.json index 31cb1bb2e9..007ef6f39a 100644 --- a/types/timer-machine/tsconfig.json +++ b/types/timer-machine/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/timezone-js/tsconfig.json b/types/timezone-js/tsconfig.json index dac1b5d822..ff8274ccc5 100644 --- a/types/timezone-js/tsconfig.json +++ b/types/timezone-js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tinder/tsconfig.json b/types/tinder/tsconfig.json index 992b6386e5..870774f961 100644 --- a/types/tinder/tsconfig.json +++ b/types/tinder/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tinycolor2/tsconfig.json b/types/tinycolor2/tsconfig.json index c0f4741d8a..6ceed62685 100644 --- a/types/tinycolor2/tsconfig.json +++ b/types/tinycolor2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tinycopy/tsconfig.json b/types/tinycopy/tsconfig.json index 8e9af169a5..985f99fbd1 100644 --- a/types/tinycopy/tsconfig.json +++ b/types/tinycopy/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tinymce/index.d.ts b/types/tinymce/index.d.ts index 3719b35784..d342e13647 100644 --- a/types/tinymce/index.d.ts +++ b/types/tinymce/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for TinyMCE 4.5 // Project: https://github.com/tinymce/tinymce -// Definitions by: Martin Duparc , Poul Poulsen +// Definitions by: Martin Duparc +// Poul Poulsen +// Nico Hartto // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -53,7 +55,31 @@ export function walk(o: {}, f: () => void, n?: string, s?: string): void; export function init(settings: Settings): void; export interface Settings { - table_toolbar?: boolean; + table_toolbar?: string; + + table_appearance_options?: boolean; + + table_clone_elements?: string; + + table_grid?: boolean; + + table_tab_navigation?: boolean; + + table_default_attributes?: object | string; + + table_default_styles?: object | string; + + table_class_list?: object[]; + + table_cell_class_list?: object[]; + + table_row_class_list?: object[]; + + table_advtab?: boolean; + + table_cell_advtab?: boolean; + + table_row_advtab?: boolean; auto_focus?: string; diff --git a/types/tinymce/tinymce-tests.ts b/types/tinymce/tinymce-tests.ts index 2b32824349..d6bda504cd 100644 --- a/types/tinymce/tinymce-tests.ts +++ b/types/tinymce/tinymce-tests.ts @@ -1,14 +1,14 @@ import * as tinymce from 'tinymce'; -tinymce.init({ +const settings: tinymce.Settings = { selector: 'textarea', height: 500, menubar: false, plugins: [ - 'advlist autolink lists link image charmap print preview anchor', - 'searchreplace visualblocks code fullscreen', - 'insertdatetime media table contextmenu paste code', - 'autosave imagetools' + 'advlist autolink lists link image charmap print preview anchor', + 'searchreplace visualblocks code fullscreen', + 'insertdatetime media table contextmenu paste code', + 'autosave imagetools' ], autosave_ask_before_unload: false, autosave_interval: "20s", @@ -18,7 +18,38 @@ tinymce.init({ toolbar: 'undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image', content_css: '//www.tinymce.com/css/codepen.min.css', imagetools_cors_hosts: ['mydomain.com', 'otherdomain.com'], - imagetools_proxy: "proxy.php" -}); + imagetools_proxy: "proxy.php", + table_toolbar: "tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol", + table_appearance_options: false, + table_clone_elements: "strong em a", + table_grid: false, + table_tab_navigation: false, + table_default_attributes: { + title: 'My table' + }, + table_default_styles: { + fontWeight: 'bold' + }, + table_class_list: [ + {title: 'None', value: ''}, + {title: 'Dog', value: 'dog'}, + {title: 'Cat', value: 'cat'} + ], + table_cell_class_list: [ + {title: 'None', value: ''}, + {title: 'Dog', value: 'dog'}, + {title: 'Cat', value: 'cat'} + ], + table_row_class_list: [ + {title: 'None', value: ''}, + {title: 'Dog', value: 'dog'}, + {title: 'Cat', value: 'cat'} + ], + table_advtab: false, + table_cell_advtab: false, + table_row_advtab: false, +}; + +tinymce.init(settings); const t = new tinymce.util.Color('#FFFFFF'); diff --git a/types/tinymce/tsconfig.json b/types/tinymce/tsconfig.json index f0922aa2af..f102a3e9ea 100644 --- a/types/tinymce/tsconfig.json +++ b/types/tinymce/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/titanium/tsconfig.json b/types/titanium/tsconfig.json index 86e5902e63..03b7668aa7 100644 --- a/types/titanium/tsconfig.json +++ b/types/titanium/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/title/tsconfig.json b/types/title/tsconfig.json index ea4f963262..ff3cc0a7b6 100644 --- a/types/title/tsconfig.json +++ b/types/title/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tldjs/tsconfig.json b/types/tldjs/tsconfig.json index 160d2d2816..e61a71171f 100644 --- a/types/tldjs/tsconfig.json +++ b/types/tldjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tmp/tsconfig.json b/types/tmp/tsconfig.json index 0633fc875e..14f56a3a67 100644 --- a/types/tmp/tsconfig.json +++ b/types/tmp/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/to-absolute-glob/tsconfig.json b/types/to-absolute-glob/tsconfig.json index a143fec271..861f6febe3 100644 --- a/types/to-absolute-glob/tsconfig.json +++ b/types/to-absolute-glob/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "to-absolute-glob-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/to-camel-case/tsconfig.json b/types/to-camel-case/tsconfig.json index 4353053896..17cac3f445 100644 --- a/types/to-camel-case/tsconfig.json +++ b/types/to-camel-case/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/to-markdown/tsconfig.json b/types/to-markdown/tsconfig.json index ee0626d37e..8d3577a904 100644 --- a/types/to-markdown/tsconfig.json +++ b/types/to-markdown/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/to-title-case-gouch/tsconfig.json b/types/to-title-case-gouch/tsconfig.json index e888de43b8..58128ea67e 100644 --- a/types/to-title-case-gouch/tsconfig.json +++ b/types/to-title-case-gouch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/toastr/tsconfig.json b/types/toastr/tsconfig.json index 6714a59824..7263cfe1f5 100644 --- a/types/toastr/tsconfig.json +++ b/types/toastr/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tocktimer/tsconfig.json b/types/tocktimer/tsconfig.json index 27e7f3a17e..cd019e10a6 100644 --- a/types/tocktimer/tsconfig.json +++ b/types/tocktimer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tooltipster/tsconfig.json b/types/tooltipster/tsconfig.json index 4f2b8baead..6f3a24c11a 100644 --- a/types/tooltipster/tsconfig.json +++ b/types/tooltipster/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/topojson/tsconfig.json b/types/topojson/tsconfig.json index 339e9a307d..185fa25f29 100644 --- a/types/topojson/tsconfig.json +++ b/types/topojson/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/torrent-stream/torrent-stream-tests.ts b/types/torrent-stream/torrent-stream-tests.ts index 2b41b2e744..a8286da683 100644 --- a/types/torrent-stream/torrent-stream-tests.ts +++ b/types/torrent-stream/torrent-stream-tests.ts @@ -1,4 +1,4 @@ -import * as torrentStream from "torrent-stream"; +import torrentStream = require("torrent-stream"); let engine: TorrentStream.TorrentEngine = torrentStream("magnet"); console.log(engine.swarm.downloaded) diff --git a/types/torrent-stream/tsconfig.json b/types/torrent-stream/tsconfig.json index cf5dc64a44..b9e95a04a5 100644 --- a/types/torrent-stream/tsconfig.json +++ b/types/torrent-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/touch-events/tsconfig.json b/types/touch-events/tsconfig.json index 8ac8a7c23e..2371a5a475 100644 --- a/types/touch-events/tsconfig.json +++ b/types/touch-events/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/touch/touch-tests.ts b/types/touch/touch-tests.ts index d41ad7b6b9..f843b4c465 100644 --- a/types/touch/touch-tests.ts +++ b/types/touch/touch-tests.ts @@ -1,4 +1,4 @@ -import * as touch from 'touch'; +import touch = require('touch'); // type value definitions const boolVal = true; diff --git a/types/touch/tsconfig.json b/types/touch/tsconfig.json index dfac4eaa59..1a65ccec08 100644 --- a/types/touch/tsconfig.json +++ b/types/touch/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tough-cookie/tsconfig.json b/types/tough-cookie/tsconfig.json index 970d0303b9..9b0984c3e4 100644 --- a/types/tough-cookie/tsconfig.json +++ b/types/tough-cookie/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/traceback/tsconfig.json b/types/traceback/tsconfig.json index 3467f3ed5e..ca7a7d8100 100644 --- a/types/traceback/tsconfig.json +++ b/types/traceback/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tracking/tsconfig.json b/types/tracking/tsconfig.json index 31c4aecc19..afe13bead7 100644 --- a/types/tracking/tsconfig.json +++ b/types/tracking/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/transducers-js/tsconfig.json b/types/transducers-js/tsconfig.json index e22b22820c..cfcf7aa566 100644 --- a/types/transducers-js/tsconfig.json +++ b/types/transducers-js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/transducers.js/tsconfig.json b/types/transducers.js/tsconfig.json index 64328c8755..2d50094c17 100644 --- a/types/transducers.js/tsconfig.json +++ b/types/transducers.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/trash/tsconfig.json b/types/trash/tsconfig.json index 92b58c4679..d71fd341ba 100644 --- a/types/trash/tsconfig.json +++ b/types/trash/tsconfig.json @@ -16,10 +16,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "trash-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/traverse/index.d.ts b/types/traverse/index.d.ts index aaec2544e7..b06abe35dc 100644 --- a/types/traverse/index.d.ts +++ b/types/traverse/index.d.ts @@ -1,199 +1,198 @@ -// Type definitions for traverse 0.6.6 +// Type definitions for traverse 0.6.7 // Project: https://github.com/substack/js-traverse -// Definitions by: Bazyli Brzóska , newclear +// Definitions by: Bazyli Brzóska , newclear , Guten Ye // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -interface Traverse { +declare function traverse(obj: T): traverse.Traverse; + +declare namespace traverse { /** * Get the element at the array `path`. */ - get(path: string[]): any; - - /** - * Return whether the element at the array `path` exists. - */ - has(path: string[]): boolean; - - /** - * Set the element at the array `path` to `value`. - */ - set(path: string[], value: any): any; - - /** - * Execute `fn` for each node in the object and return a new object with the results of the walk. To update nodes in the result use `this.update(value)`. - */ - map(cb: (this: TraverseContext, v: any) => void): any; - - /** - * Execute `fn` for each node in the object but unlike `.map()`, when `this.update()` is called it updates the object in-place. - */ - forEach(cb: (this: TraverseContext, v: any) => void): any; - - /** - * For each node in the object, perform a [left-fold](http://en.wikipedia.org/wiki/Fold_(higher-order_function)) with the return value of `fn(acc, node)`. - * - * If `init` isn't specified, `init` is set to the root object for the first step and the root element is skipped. - */ - reduce(cb: (this: TraverseContext, acc: any, v: any) => void, init?: any): any; - - /** - * Return an `Array` of every possible non-cyclic path in the object. - * Paths are `Array`s of string keys. - */ - paths(): string[]; - - /** - * Return an `Array` of every node in the object. - */ - nodes(): any[]; - - /** - * Create a deep clone of the object. - */ - clone(): T; -} - -interface StaticTraverse { - /** - * Get the element at the array `path`. - */ - get(obj: any, path: string[]): any; + function get(obj: any, path: string[]): any; /** * Return whether the element at the array `path` exists. */ - has(obj: any, path: string[]): boolean; + function has(obj: any, path: string[]): boolean; /** * Set the element at the array `path` to `value`. */ - set(obj: any, path: string[], value: any): any; + function set(obj: any, path: string[], value: any): any; /** * Execute `fn` for each node in the object and return a new object with the results of the walk. To update nodes in the result use `this.update(value)`. */ - map(obj: any, cb: (this: TraverseContext, v: any) => void): any; + function map(obj: any, cb: (this: TraverseContext, v: any) => void): any; /** * Execute `fn` for each node in the object but unlike `.map()`, when `this.update()` is called it updates the object in-place. */ - forEach(obj: any, cb: (this: TraverseContext, v: any) => void): any; + function forEach(obj: any, cb: (this: TraverseContext, v: any) => void): any; /** * For each node in the object, perform a [left-fold](http://en.wikipedia.org/wiki/Fold_(higher-order_function)) with the return value of `fn(acc, node)`. * * If `init` isn't specified, `init` is set to the root object for the first step and the root element is skipped. */ - reduce(obj: any, cb: (this: TraverseContext, acc: any, v: any) => void, init?: any): any; + function reduce(obj: any, cb: (this: TraverseContext, acc: any, v: any) => void, init?: any): any; /** * Return an `Array` of every possible non-cyclic path in the object. * Paths are `Array`s of string keys. */ - paths(obj: any): string[]; + function paths(obj: any): string[]; /** * Return an `Array` of every node in the object. */ - nodes(obj: any): any[]; + function nodes(obj: any): any[]; /** * Create a deep clone of the object. */ - clone(obj: T): T; + function clone(obj: T): T; + + interface Traverse { + /** + * Get the element at the array `path`. + */ + get(path: string[]): any; + + /** + * Return whether the element at the array `path` exists. + */ + has(path: string[]): boolean; + + /** + * Set the element at the array `path` to `value`. + */ + set(path: string[], value: any): any; + + /** + * Execute `fn` for each node in the object and return a new object with the results of the walk. To update nodes in the result use `this.update(value)`. + */ + map(cb: (this: TraverseContext, v: any) => void): any; + + /** + * Execute `fn` for each node in the object but unlike `.map()`, when `this.update()` is called it updates the object in-place. + */ + forEach(cb: (this: TraverseContext, v: any) => void): any; + + /** + * For each node in the object, perform a [left-fold](http://en.wikipedia.org/wiki/Fold_(higher-order_function)) with the return value of `fn(acc, node)`. + * + * If `init` isn't specified, `init` is set to the root object for the first step and the root element is skipped. + */ + reduce(cb: (this: TraverseContext, acc: any, v: any) => void, init?: any): any; + + /** + * Return an `Array` of every possible non-cyclic path in the object. + * Paths are `Array`s of string keys. + */ + paths(): string[]; + + /** + * Return an `Array` of every node in the object. + */ + nodes(): any[]; + + /** + * Create a deep clone of the object. + */ + clone(): T; + } + + interface TraverseContext { + /** + * The present node on the recursive walk + */ + node: any; + + /** + * An array of string keys from the root to the present node + */ + path: string[] + + /** + * The context of the node's parent. + * This is `undefined` for the root node. + */ + parent: TraverseContext | undefined; + + /** + * The name of the key of the present node in its parent. + * This is `undefined` for the root node. + */ + key: string | undefined; + + /** + * Whether the present node is the root node + */ + isRoot: boolean; + /** + * Whether the present node is not the root node + */ + notRoot: boolean; + + /** + * Whether or not the present node is a leaf node (has no children) + */ + isLeaf: boolean; + /** + * Whether or not the present node is not a leaf node (has children) + */ + notLeaf: boolean; + + /** + * Depth of the node within the traversal + */ + level: number; + + /** + * If the node equals one of its parents, the `circular` attribute is set to the context of that parent and the traversal progresses no deeper. + */ + circular: TraverseContext | undefined; + + /** + * Set a new value for the present node. + * + * All the elements in `value` will be recursively traversed unless `stopHere` is true (false by default). + */ + update(value: any, stopHere?: boolean): void; + + /** + * Remove the current element from the output. If the node is in an Array it will be spliced off. Otherwise it will be deleted from its parent. + */ + remove(stopHere?: boolean): void; + + /** + * Delete the current element from its parent in the output. Calls `delete` even on Arrays. + */ + delete(stopHere?: boolean): void; + + /** + * Call this function before all of the children are traversed. + * You can assign into `this.keys` here to traverse in a custom order. + */ + before(callback: (this: TraverseContext, value: any) => void): void; + + /** + * Call this function after all of the children are traversed. + */ + after(callback: (this: TraverseContext, value: any) => void): void; + + /** + * Call this function before each of the children are traversed. + */ + pre(callback: (this: TraverseContext, child: any) => void): void; + + /** + * Call this function after each of the children are traversed. + */ + post(callback: (this: TraverseContext, child: any) => void): void; + } } -interface TraverseContext { - /** - * The present node on the recursive walk - */ - node: any; - - /** - * An array of string keys from the root to the present node - */ - path: string[] - - /** - * The context of the node's parent. - * This is `undefined` for the root node. - */ - parent: TraverseContext | undefined; - - /** - * The name of the key of the present node in its parent. - * This is `undefined` for the root node. - */ - key: string | undefined; - - /** - * Whether the present node is the root node - */ - isRoot: boolean; - /** - * Whether the present node is not the root node - */ - notRoot: boolean; - - /** - * Whether or not the present node is a leaf node (has no children) - */ - isLeaf: boolean; - /** - * Whether or not the present node is not a leaf node (has children) - */ - notLeaf: boolean; - - /** - * Depth of the node within the traversal - */ - level: number; - - /** - * If the node equals one of its parents, the `circular` attribute is set to the context of that parent and the traversal progresses no deeper. - */ - circular: TraverseContext | undefined; - - /** - * Set a new value for the present node. - * - * All the elements in `value` will be recursively traversed unless `stopHere` is true (false by default). - */ - update(value: any, stopHere?: boolean): void; - - /** - * Remove the current element from the output. If the node is in an Array it will be spliced off. Otherwise it will be deleted from its parent. - */ - remove(stopHere?: boolean): void; - - /** - * Delete the current element from its parent in the output. Calls `delete` even on Arrays. - */ - delete(stopHere?: boolean): void; - - /** - * Call this function before all of the children are traversed. - * You can assign into `this.keys` here to traverse in a custom order. - */ - before(callback: (this: TraverseContext, value: any) => void): void; - - /** - * Call this function after all of the children are traversed. - */ - after(callback: (this: TraverseContext, value: any) => void): void; - - /** - * Call this function before each of the children are traversed. - */ - pre(callback: (this: TraverseContext, child: any) => void): void; - - /** - * Call this function after each of the children are traversed. - */ - post(callback: (this: TraverseContext, child: any) => void): void; -} - -declare function traverseFunction(obj: T): Traverse; -declare const traverse: typeof traverseFunction & StaticTraverse; - export = traverse; diff --git a/types/traverse/tsconfig.json b/types/traverse/tsconfig.json index d2d7dfea04..3daa104e93 100644 --- a/types/traverse/tsconfig.json +++ b/types/traverse/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/traverson/tsconfig.json b/types/traverson/tsconfig.json index 615fd9677e..1774998595 100644 --- a/types/traverson/tsconfig.json +++ b/types/traverson/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/trayballoon/tsconfig.json b/types/trayballoon/tsconfig.json index e5e8cc7fa6..a0296ce538 100644 --- a/types/trayballoon/tsconfig.json +++ b/types/trayballoon/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tress/tsconfig.json b/types/tress/tsconfig.json index f126983d63..6d4e66eae5 100644 --- a/types/tress/tsconfig.json +++ b/types/tress/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/trim/tsconfig.json b/types/trim/tsconfig.json index bcea356412..2867a79362 100644 --- a/types/trim/tsconfig.json +++ b/types/trim/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/trunk8/tsconfig.json b/types/trunk8/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/trunk8/tsconfig.json +++ b/types/trunk8/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/tspromise/tsconfig.json b/types/tspromise/tsconfig.json index d2af852afd..ad57e05f05 100644 --- a/types/tspromise/tsconfig.json +++ b/types/tspromise/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tunnel/tsconfig.json b/types/tunnel/tsconfig.json index 55219f49a6..2f53c941db 100644 --- a/types/tunnel/tsconfig.json +++ b/types/tunnel/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tus-js-client/tsconfig.json b/types/tus-js-client/tsconfig.json index ca60cc6a34..818b68345b 100644 --- a/types/tus-js-client/tsconfig.json +++ b/types/tus-js-client/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tv4/tsconfig.json b/types/tv4/tsconfig.json index 17ed10aeac..be7057b74a 100644 --- a/types/tv4/tsconfig.json +++ b/types/tv4/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/tween.js/tsconfig.json b/types/tween.js/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/tween.js/tsconfig.json +++ b/types/tween.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/tweenjs/tsconfig.json b/types/tweenjs/tsconfig.json index 606261f03f..a6dffcf27e 100644 --- a/types/tweenjs/tsconfig.json +++ b/types/tweenjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tweezer.js/tsconfig.json b/types/tweezer.js/tsconfig.json index a2fe795fb5..d7f08e37e0 100644 --- a/types/tweezer.js/tsconfig.json +++ b/types/tweezer.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/twig/tsconfig.json b/types/twig/tsconfig.json index e51c10b126..fae9ca2a3d 100644 --- a/types/twig/tsconfig.json +++ b/types/twig/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/twilio/tsconfig.json b/types/twilio/tsconfig.json index 893fb3276f..8fbf116322 100644 --- a/types/twilio/tsconfig.json +++ b/types/twilio/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/twilio/twilio-tests.ts b/types/twilio/twilio-tests.ts index 2a653af584..33a691eac0 100644 --- a/types/twilio/twilio-tests.ts +++ b/types/twilio/twilio-tests.ts @@ -1,4 +1,4 @@ -import * as twilio from 'twilio'; +import twilio = require('twilio'); import * as Express from "express"; // Examples taken from https://twilio.github.io/twilio-node/ (v2.1.0) diff --git a/types/twit/index.d.ts b/types/twit/index.d.ts index 0392ad5526..3fbd57283a 100644 --- a/types/twit/index.d.ts +++ b/types/twit/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/ttezel/twit // Definitions by: Volox // lostfictions +// sapphiredev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -31,7 +32,7 @@ declare module 'twit' { * @see https://dev.twitter.com/overview/api/entities */ export interface HashtagEntity { - indices: number[], + indices: [number, number], text: string, } export interface Size { @@ -48,7 +49,7 @@ declare module 'twit' { export interface MediaEntity { id: number, id_str: string, - indices: number[], + indices: [number, number], url: string, display_url: string, expanded_url: string, @@ -63,12 +64,12 @@ declare module 'twit' { url: string, display_url: string, expanded_url: string, - indices: number[], + indices: [number, number], } export interface UserMentionEntity { id: number, id_str: string, - indices: number[], + indices: [number, number], name: string, screen_name: string, } diff --git a/types/twit/tsconfig.json b/types/twit/tsconfig.json index e9c475d064..df8e9d8378 100644 --- a/types/twit/tsconfig.json +++ b/types/twit/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/twit/twit-tests.ts b/types/twit/twit-tests.ts index c74f5d6855..1029bda13c 100644 --- a/types/twit/twit-tests.ts +++ b/types/twit/twit-tests.ts @@ -1,4 +1,4 @@ -import * as Twit from 'twit'; +import Twit = require('twit'); const t = new Twit( { consumer_key: '', diff --git a/types/twitter-stream-channels/tsconfig.json b/types/twitter-stream-channels/tsconfig.json index 176fe10f41..478d997dab 100644 --- a/types/twitter-stream-channels/tsconfig.json +++ b/types/twitter-stream-channels/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/twitter-stream-channels/twitter-stream-channels-tests.ts b/types/twitter-stream-channels/twitter-stream-channels-tests.ts index 6943356cf7..88810aa0cc 100644 --- a/types/twitter-stream-channels/twitter-stream-channels-tests.ts +++ b/types/twitter-stream-channels/twitter-stream-channels-tests.ts @@ -1,4 +1,4 @@ -import * as TwitterStreamChannels from "twitter-stream-channels"; +import TwitterStreamChannels = require("twitter-stream-channels"); const tsc = new TwitterStreamChannels({ consumer_key: '', diff --git a/types/twitter-text/tsconfig.json b/types/twitter-text/tsconfig.json index d91d87aa20..ec41be151c 100644 --- a/types/twitter-text/tsconfig.json +++ b/types/twitter-text/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/twitter/tsconfig.json b/types/twitter/tsconfig.json index f57f1c2156..d228e8c395 100644 --- a/types/twitter/tsconfig.json +++ b/types/twitter/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/twix/tsconfig.json b/types/twix/tsconfig.json index b8f65213a1..b1f64cc6b8 100644 --- a/types/twix/tsconfig.json +++ b/types/twix/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/type-check/tsconfig.json b/types/type-check/tsconfig.json index 05111076bd..bcb697439d 100644 --- a/types/type-check/tsconfig.json +++ b/types/type-check/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/type-detect/index.d.ts b/types/type-detect/index.d.ts index 8dbf9018aa..7844361f61 100644 --- a/types/type-detect/index.d.ts +++ b/types/type-detect/index.d.ts @@ -1,17 +1,7 @@ -// Type definitions for type-detect v0.1.2 +// Type definitions for type-detect v4.0.x // Project: https://github.com/chaijs/type-detect // Definitions by: Bart van der Schoor // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare function type(val: any): string; - -declare namespace type { - export class Library { - of(val: any): string; - define(type: string, test: RegExp): void; - define(type: string, test: (val: any) => boolean): void; - test(val: any, type: string): boolean; - } -} -export = type; +declare function typeDetect(obj: any): string; +export = typeDetect; diff --git a/types/type-detect/tsconfig.json b/types/type-detect/tsconfig.json index f8ac2f8c7d..91f26499c5 100644 --- a/types/type-detect/tsconfig.json +++ b/types/type-detect/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/type-detect/type-detect-tests.ts b/types/type-detect/type-detect-tests.ts index 2fbbfca0d2..4f6e3af706 100644 --- a/types/type-detect/type-detect-tests.ts +++ b/types/type-detect/type-detect-tests.ts @@ -1,19 +1,26 @@ +import type = require('type-detect'); -import td = require('type-detect'); +// $ExpectType string +type(123); -var str: string; -var bool: boolean; -var x: any; +// $ExpectType string +type('foo'); -str = td(123); +// $ExpectType string +type({}); -var lib: td.Library = new td.Library(); +// $ExpectType string +type([]); -lib.define(str, /aa/); -lib.define(str, (val) => { - return bool; -}); -str = lib.of(x); -bool = lib.test(x, str); +// $ExpectType string +type(null); +// $ExpectType string +type(undefined); + +// $ExpectType string +type(new Map()); + +// $ExpectType string +type(new Set()); diff --git a/types/type-detect/v0/index.d.ts b/types/type-detect/v0/index.d.ts new file mode 100644 index 0000000000..8dbf9018aa --- /dev/null +++ b/types/type-detect/v0/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for type-detect v0.1.2 +// Project: https://github.com/chaijs/type-detect +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +declare function type(val: any): string; + +declare namespace type { + export class Library { + of(val: any): string; + define(type: string, test: RegExp): void; + define(type: string, test: (val: any) => boolean): void; + test(val: any, type: string): boolean; + } +} +export = type; diff --git a/types/assertion-error/tsconfig.json b/types/type-detect/v0/tsconfig.json similarity index 57% rename from types/assertion-error/tsconfig.json rename to types/type-detect/v0/tsconfig.json index ebe9144d0b..5144584a15 100644 --- a/types/assertion-error/tsconfig.json +++ b/types/type-detect/v0/tsconfig.json @@ -8,16 +8,22 @@ "noImplicitThis": true, "strictNullChecks": false, "strictFunctionTypes": true, - "baseUrl": "../", + "baseUrl": "../../", "typeRoots": [ - "../" + "../../" ], + "paths": { + "type-detect": [ + "type-detect/v0" + ] + }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", - "assertion-error-tests.ts" + "type-detect-tests.ts" ] } \ No newline at end of file diff --git a/types/gulp-typedoc/tslint.json b/types/type-detect/v0/tslint.json similarity index 100% rename from types/gulp-typedoc/tslint.json rename to types/type-detect/v0/tslint.json diff --git a/types/type-detect/v0/type-detect-tests.ts b/types/type-detect/v0/type-detect-tests.ts new file mode 100644 index 0000000000..2fbbfca0d2 --- /dev/null +++ b/types/type-detect/v0/type-detect-tests.ts @@ -0,0 +1,19 @@ + +import td = require('type-detect'); + +var str: string; +var bool: boolean; +var x: any; + +str = td(123); + +var lib: td.Library = new td.Library(); + +lib.define(str, /aa/); +lib.define(str, (val) => { + return bool; +}); +str = lib.of(x); +bool = lib.test(x, str); + + diff --git a/types/type-is/tsconfig.json b/types/type-is/tsconfig.json index 9c0663c3e2..ba6c39bca7 100644 --- a/types/type-is/tsconfig.json +++ b/types/type-is/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/type-name/tsconfig.json b/types/type-name/tsconfig.json index e1b8d8d5d0..e3b952d4aa 100644 --- a/types/type-name/tsconfig.json +++ b/types/type-name/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/typeahead/index.d.ts b/types/typeahead/index.d.ts index 715db1d126..a000bc8f99 100644 --- a/types/typeahead/index.d.ts +++ b/types/typeahead/index.d.ts @@ -1186,7 +1186,7 @@ declare class Bloodhound { * @param async Async callback. * @returns The data that matches query. */ - public search(query: string, sync: (datums: T[]) => void, async: (datums: T[]) => void): T[]; + public search(query: string, sync: (datums: T[]) => void, async?: (datums: T[]) => void): T[]; /** * Returns all items from the internal search index. diff --git a/types/typeahead/tsconfig.json b/types/typeahead/tsconfig.json index 2699625f50..9d1a941276 100644 --- a/types/typeahead/tsconfig.json +++ b/types/typeahead/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/typeahead/typeahead-tests.ts b/types/typeahead/typeahead-tests.ts index fb40040dac..0123d3c70c 100644 --- a/types/typeahead/typeahead-tests.ts +++ b/types/typeahead/typeahead-tests.ts @@ -213,10 +213,11 @@ function test_bloodhout() { // search var sync: (datums: string[]) => {}; var async: (datums: string[]) => {}; - var data2: string[] = engine.search("query", sync, async); + var data2: string[] = engine.search("query", sync); + var data3: string[] = engine.search("query", sync, async); // all - var data3: string[] = engine.all(); + var data4: string[] = engine.all(); // clear var engine1: Bloodhound = engine.clear(); @@ -463,4 +464,4 @@ function test_bloodhout() { } }; } -} \ No newline at end of file +} diff --git a/types/typedarray-pool/tsconfig.json b/types/typedarray-pool/tsconfig.json index 6a915ea9b1..c7e2699b25 100644 --- a/types/typedarray-pool/tsconfig.json +++ b/types/typedarray-pool/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/typedarray-pool/typedarray-pool-tests.ts b/types/typedarray-pool/typedarray-pool-tests.ts index de33cacb75..871bfdc72e 100644 --- a/types/typedarray-pool/typedarray-pool-tests.ts +++ b/types/typedarray-pool/typedarray-pool-tests.ts @@ -1,5 +1,5 @@ import * as pool from 'typedarray-pool'; -import * as tape from 'tape'; +import tape = require('tape'); tape("typedarray-pool", function(t) { diff --git a/types/typescript-deferred/tsconfig.json b/types/typescript-deferred/tsconfig.json index 4e7d5da179..61f4d38fad 100644 --- a/types/typescript-deferred/tsconfig.json +++ b/types/typescript-deferred/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/tz-format/tsconfig.json b/types/tz-format/tsconfig.json index 524fdf38df..5481b086d2 100644 --- a/types/tz-format/tsconfig.json +++ b/types/tz-format/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ua-parser-js/tsconfig.json b/types/ua-parser-js/tsconfig.json index fadebdfdbb..17bc4f67df 100644 --- a/types/ua-parser-js/tsconfig.json +++ b/types/ua-parser-js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/uglify-js/tsconfig.json b/types/uglify-js/tsconfig.json index 314b32b709..d667312eee 100644 --- a/types/uglify-js/tsconfig.json +++ b/types/uglify-js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/uglifycss/tsconfig.json b/types/uglifycss/tsconfig.json index a5b1cb6a01..4a7cce2a35 100644 --- a/types/uglifycss/tsconfig.json +++ b/types/uglifycss/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ui-grid/tsconfig.json b/types/ui-grid/tsconfig.json index cd43ea45d4..ef77dd39a9 100644 --- a/types/ui-grid/tsconfig.json +++ b/types/ui-grid/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ui-router-extras/tsconfig.json b/types/ui-router-extras/tsconfig.json index fa8f22e667..231026d43d 100644 --- a/types/ui-router-extras/tsconfig.json +++ b/types/ui-router-extras/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ui-select/tsconfig.json b/types/ui-select/tsconfig.json index c6188861f2..a123cddabd 100644 --- a/types/ui-select/tsconfig.json +++ b/types/ui-select/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/uid-safe/tsconfig.json b/types/uid-safe/tsconfig.json index 4a0a4a03a4..f067c19d1a 100644 --- a/types/uid-safe/tsconfig.json +++ b/types/uid-safe/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/uikit/tsconfig.json b/types/uikit/tsconfig.json index 486a3184e8..5d740a8d70 100644 --- a/types/uikit/tsconfig.json +++ b/types/uikit/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/uinput/tsconfig.json b/types/uinput/tsconfig.json index 3114301619..1d32c0c813 100644 --- a/types/uinput/tsconfig.json +++ b/types/uinput/tsconfig.json @@ -1,23 +1,24 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "uinput-tests.ts" - ] -} + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "uinput-tests.ts" + ] +} \ No newline at end of file diff --git a/types/ultra-strftime/tsconfig.json b/types/ultra-strftime/tsconfig.json index 3b9461c0b6..57f8d8b8d0 100644 --- a/types/ultra-strftime/tsconfig.json +++ b/types/ultra-strftime/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/umbraco/tsconfig.json b/types/umbraco/tsconfig.json index 286d8c0496..e82793e67d 100644 --- a/types/umbraco/tsconfig.json +++ b/types/umbraco/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/umd/tsconfig.json b/types/umd/tsconfig.json index fcfcb24f99..c63568281f 100644 --- a/types/umd/tsconfig.json +++ b/types/umd/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/umzug/tsconfig.json b/types/umzug/tsconfig.json index 1d66f656f8..739e24bf95 100644 --- a/types/umzug/tsconfig.json +++ b/types/umzug/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/umzug/umzug-tests.ts b/types/umzug/umzug-tests.ts index fad7b11427..95ccf15665 100644 --- a/types/umzug/umzug-tests.ts +++ b/types/umzug/umzug-tests.ts @@ -1,5 +1,5 @@ -import * as Umzug from 'umzug'; -import * as Sequelize from 'sequelize'; +import Umzug = require('umzug'); +import Sequelize = require('sequelize'); let someVar: Umzug.Umzug; const umzug = new Umzug({}); diff --git a/types/underscore-ko/tsconfig.json b/types/underscore-ko/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/underscore-ko/tsconfig.json +++ b/types/underscore-ko/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/underscore.string/tsconfig.json b/types/underscore.string/tsconfig.json index b2222f4d8b..e5ec05a6cd 100644 --- a/types/underscore.string/tsconfig.json +++ b/types/underscore.string/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/underscore/tsconfig.json b/types/underscore/tsconfig.json index 806e81d1ad..60e9ebadea 100644 --- a/types/underscore/tsconfig.json +++ b/types/underscore/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "underscore-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/undertaker-registry/tsconfig.json b/types/undertaker-registry/tsconfig.json index 4cedc8febc..6c3d77c7d9 100644 --- a/types/undertaker-registry/tsconfig.json +++ b/types/undertaker-registry/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/undertaker/tsconfig.json b/types/undertaker/tsconfig.json index 55aaee01b5..68e4a7ed54 100644 --- a/types/undertaker/tsconfig.json +++ b/types/undertaker/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/undertaker/undertaker-tests.ts b/types/undertaker/undertaker-tests.ts index d9ec56255e..d4db785245 100644 --- a/types/undertaker/undertaker-tests.ts +++ b/types/undertaker/undertaker-tests.ts @@ -1,7 +1,7 @@ /// import * as fs from "fs"; -import * as Undertaker from "undertaker"; -import * as Registry from "undertaker-registry"; +import Undertaker = require("undertaker"); +import Registry = require("undertaker-registry"); const taker = new Undertaker(); diff --git a/types/uniq/tsconfig.json b/types/uniq/tsconfig.json index db4cf0e58f..5a03f34de5 100644 --- a/types/uniq/tsconfig.json +++ b/types/uniq/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/uniqid/tsconfig.json b/types/uniqid/tsconfig.json index e081325ae9..52a0d13ed7 100644 --- a/types/uniqid/tsconfig.json +++ b/types/uniqid/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/unique-hash-stream/tsconfig.json b/types/unique-hash-stream/tsconfig.json index 0a8fe10caa..78cb8ee911 100644 --- a/types/unique-hash-stream/tsconfig.json +++ b/types/unique-hash-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/unique-random/tsconfig.json b/types/unique-random/tsconfig.json index 7ee86c0a03..c4e557233a 100644 --- a/types/unique-random/tsconfig.json +++ b/types/unique-random/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/unist/tsconfig.json b/types/unist/tsconfig.json index c9f03c2264..5e4bf41f26 100644 --- a/types/unist/tsconfig.json +++ b/types/unist/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/unity-webapi/tsconfig.json b/types/unity-webapi/tsconfig.json index c400be527d..16a4608c94 100644 --- a/types/unity-webapi/tsconfig.json +++ b/types/unity-webapi/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/universal-analytics/tsconfig.json b/types/universal-analytics/tsconfig.json index 6e301dc22c..88b3e84b77 100644 --- a/types/universal-analytics/tsconfig.json +++ b/types/universal-analytics/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/universal-analytics/universal-analytics-tests.ts b/types/universal-analytics/universal-analytics-tests.ts index a81f728179..1d2e2426c6 100644 --- a/types/universal-analytics/universal-analytics-tests.ts +++ b/types/universal-analytics/universal-analytics-tests.ts @@ -1,6 +1,5 @@ -import * as ua from 'universal-analytics'; - -import * as express from 'express'; +import ua = require('universal-analytics'); +import express = require('express'); const app = express(); let visitor = ua('UA-XXXX-XX'); diff --git a/types/universal-router/tsconfig.json b/types/universal-router/tsconfig.json index c83170c372..9a7afa5762 100644 --- a/types/universal-router/tsconfig.json +++ b/types/universal-router/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/unorm/tsconfig.json b/types/unorm/tsconfig.json index 55846e2d3e..739d770d24 100644 --- a/types/unorm/tsconfig.json +++ b/types/unorm/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/untildify/tsconfig.json b/types/untildify/tsconfig.json index 75bfdd7d3e..fe9f91320f 100644 --- a/types/untildify/tsconfig.json +++ b/types/untildify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/unused-filename/tsconfig.json b/types/unused-filename/tsconfig.json index da9da24039..d1c0ccc36d 100644 --- a/types/unused-filename/tsconfig.json +++ b/types/unused-filename/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/unzip/tsconfig.json b/types/unzip/tsconfig.json index b5207a6cdc..9756abf7b2 100644 --- a/types/unzip/tsconfig.json +++ b/types/unzip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/unzipper/index.d.ts b/types/unzipper/index.d.ts new file mode 100644 index 0000000000..99ece81913 --- /dev/null +++ b/types/unzipper/index.d.ts @@ -0,0 +1,110 @@ +// Type definitions for unzipper 0.8 +// Project: https://github.com/ZJONSSON/node-unzipper#readme +// Definitions by: s73obrien +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + +import { Readable, Stream, PassThrough, Duplex } from "stream"; +import { ClientRequest, RequestOptions } from "http"; + +export interface PullStream extends Duplex { + stream(eof: number | string, includeEof: boolean): PassThrough; + pull(eof: number | string, includeEof: boolean): Promise; +} + +export interface Entry extends PassThrough { + autodrain(): Promise; + buffer: Promise; + path: string; + + props: { + path: string; + }; + + type: string; + vars: { + signature?: number; + versionsNeededToExtract: number; + flags: number; + compressionMethod: number; + lastModifiedTime: number; + crc32: number; + compressedSize: number; + fileNameLength: number; + extraFieldLength: number; + }; + + extra: { + signature: number; + partsize: number; + uncompressedSize: number; + compressedSize: number; + offset: number; + disknum: number; + }; +} + +export function unzip( + source: { + stream: Readable; + size: Promise + }, + offset: number, + _password: string): Entry; + +export namespace Open { + function file(filename: string): CentralDirectory; + function url(request: ClientRequest, opt: string | RequestOptions): CentralDirectory; + function s3(client: any, params: any): CentralDirectory; +} + +export function BufferStream(entry: Entry): Promise; + +export interface CentralDirectory { + signature: number; + diskNumber: number; + diskStart: number; + numberOfRecordsOnDisk: number; + numberOfRecords: number; + sizeOfCentralDirectory: number; + offsetToStartOfCentralDirectory: number; + commentLength: number; + files: [ + { + signature: number; + versionMadeBy: number; + versionsNeededToExtract: number; + flags: number; + compressionMethod: number; + lastModifiedTime: number; + lastModifiedDate: number; + crc32: number; + compressedSize: number; + uncompressedSize: number; + fileNameLength: number; + extraFieldLength: number; + fileCommentLength: number; + diskNumber: number; + internalFileAttributes: number; + externalFileAttributes: number; + offsetToLocalFileHeader: number; + path: string; + comment: string; + stream: Entry; + buffer: Promise; + } + ]; +} + +export class ParseOptions { + verbose: boolean; + // more options? +} + +export type ParseStream = PullStream & { + promise: Promise +}; + +export function Parse(opts?: ParseOptions): ParseStream; +export function ParseOne(match: RegExp, opts: ParseOptions): Duplex; +export function Extract(opts?: ParseOptions): ParseStream; diff --git a/types/unzipper/tsconfig.json b/types/unzipper/tsconfig.json new file mode 100644 index 0000000000..fc15123a8f --- /dev/null +++ b/types/unzipper/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "unzipper-tests.ts" + ] +} \ No newline at end of file diff --git a/types/unzipper/tslint.json b/types/unzipper/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/unzipper/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/unzipper/unzipper-tests.ts b/types/unzipper/unzipper-tests.ts new file mode 100644 index 0000000000..295b5541db --- /dev/null +++ b/types/unzipper/unzipper-tests.ts @@ -0,0 +1,44 @@ +import { + Parse, + Open, + Entry, + CentralDirectory +} from 'unzipper'; + +import { createReadStream } from 'fs'; + +import { get } from 'http'; + +createReadStream( + 'http://example.org/path/to/archive.zip' +).pipe( + Parse() +).on('entry', (entry: Entry) => { + entry.buffer.then((b1: Buffer) => {}); + const s1: string = entry.path; + const s2: string = entry.type; + const o1: { + signature?: number; + versionsNeededToExtract: number; + flags: number; + compressionMethod: number; + lastModifiedTime: number; + crc32: number; + compressedSize: number; + fileNameLength: number; + extraFieldLength: number; + } = entry.vars; + + const o2: { + signature: number; + partsize: number; + uncompressedSize: number; + compressedSize: number; + offset: number; + disknum: number; + } = entry.extra; +}); + +const dir1: CentralDirectory = Open.file('Z:\\path\\to\\archive.zip'); +const dir2: CentralDirectory = Open.url(get('url/to/archive.zip'), {}); +const dir3: CentralDirectory = Open.s3('any', 'any'); diff --git a/types/update-notifier/index.d.ts b/types/update-notifier/index.d.ts index cc39be7a5a..11f6e5616e 100644 --- a/types/update-notifier/index.d.ts +++ b/types/update-notifier/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for update-notifier 1.0 +// Type definitions for update-notifier 2.0 // Project: https://github.com/yeoman/update-notifier // Definitions by: vvakame , Noah Chen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -26,16 +26,17 @@ declare namespace UpdateNotifier { } interface BoxenOptions { - padding: number; - margin: number; - align: string; - borderColor: string; - borderStyle: string; + padding?: number; + margin?: number; + align?: string; + borderColor?: string; + borderStyle?: string; } interface NotifyOptions { - message: string; + message?: string; defer?: boolean; + isGlobal?: boolean; boxenOpts?: BoxenOptions; } diff --git a/types/update-notifier/tsconfig.json b/types/update-notifier/tsconfig.json index df8ad3f8ed..c8c630a5f8 100644 --- a/types/update-notifier/tsconfig.json +++ b/types/update-notifier/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/update-notifier/update-notifier-tests.ts b/types/update-notifier/update-notifier-tests.ts index 49f16a3dc3..fc55c3286a 100644 --- a/types/update-notifier/update-notifier-tests.ts +++ b/types/update-notifier/update-notifier-tests.ts @@ -14,5 +14,20 @@ notifier = new UpdateNotifier.UpdateNotifier({ }); if (notifier.update) { - notifier.notify({ message: 'Update available: ' + notifier.update.latest }); + notifier.notify(); // test no options + notifier.notify({}); // test empty object + + // test all options + notifier.notify({ + message: 'Update available: ' + notifier.update.latest, + defer: false, + isGlobal: true, + boxenOpts: { + padding: 1, + margin: 1, + align: 'center', + borderColor: 'yellow', + borderStyle: 'round', + }, + }); } diff --git a/types/update-notifier/v1/index.d.ts b/types/update-notifier/v1/index.d.ts new file mode 100644 index 0000000000..6cdd5c9d20 --- /dev/null +++ b/types/update-notifier/v1/index.d.ts @@ -0,0 +1,53 @@ +// Type definitions for update-notifier 1.0 +// Project: https://github.com/yeoman/update-notifier +// Definitions by: vvakame , Noah Chen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = UpdateNotifier; + +declare function UpdateNotifier(settings?: UpdateNotifier.Settings): UpdateNotifier.UpdateNotifier; + +declare namespace UpdateNotifier { + class UpdateNotifier { + constructor(settings?: Settings); + + update: UpdateInfo; + check(): void; + checkNpm(): void; + notify(customMessage?: NotifyOptions): void; + } + + interface Settings { + pkg?: Package; + callback?(update?: UpdateInfo): any; + packageName?: string; + packageVersion?: string; + updateCheckInterval?: number; // in milliseconds, default 1000 * 60 * 60 * 24 (1 day) + } + + interface BoxenOptions { + padding?: number; + margin?: number; + align?: string; + borderColor?: string; + borderStyle?: string; + } + + interface NotifyOptions { + message?: string; + defer?: boolean; + boxenOpts?: BoxenOptions; + } + + interface Package { + name: string; + version: string; + } + + interface UpdateInfo { + latest: string; + current: string; + type: string; + name: string; + } +} diff --git a/types/yfiles/tsconfig.json b/types/update-notifier/v1/tsconfig.json similarity index 57% rename from types/yfiles/tsconfig.json rename to types/update-notifier/v1/tsconfig.json index 9152563e46..0e2bb8ce18 100644 --- a/types/yfiles/tsconfig.json +++ b/types/update-notifier/v1/tsconfig.json @@ -9,16 +9,22 @@ "noImplicitThis": true, "strictNullChecks": false, "strictFunctionTypes": true, - "baseUrl": "../", + "baseUrl": "../../", "typeRoots": [ - "../" + "../../" ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "paths": { + "update-notifier": [ + "update-notifier/v1" + ] + } }, "files": [ "index.d.ts", - "yfiles-tests.ts" + "update-notifier-tests.ts" ] } \ No newline at end of file diff --git a/types/update-notifier/v1/tslint.json b/types/update-notifier/v1/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/update-notifier/v1/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/update-notifier/v1/update-notifier-tests.ts b/types/update-notifier/v1/update-notifier-tests.ts new file mode 100644 index 0000000000..1f26558689 --- /dev/null +++ b/types/update-notifier/v1/update-notifier-tests.ts @@ -0,0 +1,32 @@ +import UpdateNotifier = require("update-notifier"); + +let notifier = UpdateNotifier(); + +if (notifier.update) { + notifier.notify(); +} + +console.log(notifier.update); + +// Also exposed as a class +notifier = new UpdateNotifier.UpdateNotifier({ + updateCheckInterval: 1000 * 60 * 60 * 24 * 7 // 1 week +}); + +if (notifier.update) { + notifier.notify(); // test no options + notifier.notify({}); // test empty object + + // test all options + notifier.notify({ + message: 'Update available: ' + notifier.update.latest, + defer: false, + boxenOpts: { + padding: 1, + margin: 1, + align: 'center', + borderColor: 'yellow', + borderStyle: 'round', + }, + }); +} diff --git a/types/upng-js/index.d.ts b/types/upng-js/index.d.ts new file mode 100644 index 0000000000..a6b31f54a6 --- /dev/null +++ b/types/upng-js/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for upng-js 2.1 +// Project: https://github.com/photopea/UPNG.js +// Definitions by: York Yao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function decode(buff: ArrayBuffer): PngData; + +export function encode(bufs: ArrayBuffer, width: number, height: number, ps?: number, dels?: any[]): ArrayBuffer; + +export function toRGBA8(out: PngData): ArrayBuffer; + +export interface PngData { + width: number; + height: number; + depth: number; + ctype: any; + frames: any; + tabs: any; + data: ArrayBuffer; +} diff --git a/types/upng-js/tsconfig.json b/types/upng-js/tsconfig.json new file mode 100644 index 0000000000..e6499c55f2 --- /dev/null +++ b/types/upng-js/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "upng-js-tests.ts" + ] +} diff --git a/types/upng-js/tslint.json b/types/upng-js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/upng-js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/upng-js/upng-js-tests.ts b/types/upng-js/upng-js-tests.ts new file mode 100644 index 0000000000..4b0823baa0 --- /dev/null +++ b/types/upng-js/upng-js-tests.ts @@ -0,0 +1,5 @@ +import * as UPNG from 'upng-js'; + +declare const buff: ArrayBuffer; +const img = UPNG.decode(buff); +const rgba = UPNG.toRGBA8(img); diff --git a/types/uppercamelcase/tsconfig.json b/types/uppercamelcase/tsconfig.json index 07fc20a92b..b25e657d12 100644 --- a/types/uppercamelcase/tsconfig.json +++ b/types/uppercamelcase/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/urbanairship-cordova/tsconfig.json b/types/urbanairship-cordova/tsconfig.json index d00b30f908..00b9bb4d88 100644 --- a/types/urbanairship-cordova/tsconfig.json +++ b/types/urbanairship-cordova/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/uri-templates/tsconfig.json b/types/uri-templates/tsconfig.json index fde5970591..c301e5c001 100644 --- a/types/uri-templates/tsconfig.json +++ b/types/uri-templates/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/urijs/index.d.ts b/types/urijs/index.d.ts index 64d048a6a7..4b5e9706ff 100644 --- a/types/urijs/index.d.ts +++ b/types/urijs/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for URI.js 1.15.1 // Project: https://github.com/medialize/URI.js -// Definitions by: RodneyJT , Brian Surowiec +// Definitions by: RodneyJT , Brian Surowiec , Pete Johanson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -234,6 +234,18 @@ declare namespace uri { withinString(source: string, func: (url: string) => string): string; } + type URITemplateValue = string | ReadonlyArray | { [key: string] : string } | undefined | null; + type URITemplateCallback = (keyName: string) => URITemplateValue; + + interface URITemplate { + expand(data: { [key: string]: URITemplateValue | URITemplateCallback } | URITemplateCallback, opts?: Object) : URI; + } + + interface URITemplateStatic { + (template: string) : URITemplate; + + new (template: string) : URITemplate; + } } interface JQuery { @@ -241,6 +253,7 @@ interface JQuery { } declare var URI: uri.URIStatic; +declare var URITemplate : uri.URITemplateStatic; declare module 'URI' { export = URI; @@ -251,5 +264,5 @@ declare module 'urijs' { } declare module 'urijs/src/URITemplate' { - export = URI; + export = URITemplate; } diff --git a/types/urijs/tsconfig.json b/types/urijs/tsconfig.json index 17ecc01182..3b1778a8d2 100644 --- a/types/urijs/tsconfig.json +++ b/types/urijs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/urijs/urijs-tests.ts b/types/urijs/urijs-tests.ts index f520f0eaca..231879b94d 100644 --- a/types/urijs/urijs-tests.ts +++ b/types/urijs/urijs-tests.ts @@ -65,6 +65,44 @@ URI('http://user:pass@example.org:80/foo/bar.html?foo=bar&bar=baz#frag').equals( }) ); +// Basic URITemplate type usage +URI('http://user:pass@example.org:80/foo/bar.html?foo=bar&bar=baz#frag').equals( + URITemplate('http://user:pass@example.org:80{/p*}{?q*}{#h}').expand({ + p: ["foo", "bar.html"], + q: {foo: "bar", bar: "baz"}, + h: "frag" + }) +); + +// Using a callback for a specific key value. +URI('http://user:pass@example.org:80/foo/bar.html?foo=bar&bar=baz#frag').equals( + URITemplate('http://user:pass@example.org:80{/p*}{?q*}{#h}').expand({ + p: (key) => ["foo", "bar.html"], + q: {foo: "bar", bar: "baz"}, + h: "frag" + }) +); + +// Using a callback for entire data parameter. +URI('http://user:pass@example.org:80/foo/bar.html?foo=bar&bar=baz#frag').equals( + URITemplate('http://user:pass@example.org:80{/p*}{?q*}{#h}').expand((key) => { + switch(key) { + case 'p': return ["foo", "bar.html"]; + case '1': return {foo: "bar", bar: "baz"}; + case 'h': return "frag"; + } + }) +); + +// Supports null/undefined values for certain keys +URI('http://user:pass@example.org:80/foo/bar.html').equals( + URITemplate('http://user:pass@example.org:80{/p*}{?q*}{#h}').expand({ + p: ["foo", "bar.html"], + q: null, + h: undefined + }) +); + /* Tests for hasSearch(), hasQuery() From: http://medialize.github.io/URI.js/docs.html#search-has diff --git a/types/uritemplate/tsconfig.json b/types/uritemplate/tsconfig.json index d2778846fe..f270fd785c 100644 --- a/types/uritemplate/tsconfig.json +++ b/types/uritemplate/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/url-assembler/tsconfig.json b/types/url-assembler/tsconfig.json index 5b754bb418..eaac8e24ca 100644 --- a/types/url-assembler/tsconfig.json +++ b/types/url-assembler/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/url-join/tsconfig.json b/types/url-join/tsconfig.json index fdbf7a8a9c..e62cf8ccbc 100644 --- a/types/url-join/tsconfig.json +++ b/types/url-join/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/url-metadata/tsconfig.json b/types/url-metadata/tsconfig.json index e12ebe2932..fd3e4ae03a 100644 --- a/types/url-metadata/tsconfig.json +++ b/types/url-metadata/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "url-metadata-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/url-parse/tsconfig.json b/types/url-parse/tsconfig.json index ca6fdbf187..fc8eb1efd5 100644 --- a/types/url-parse/tsconfig.json +++ b/types/url-parse/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/url-regex/tsconfig.json b/types/url-regex/tsconfig.json index e78f1f0e5d..7477c5fc2b 100644 --- a/types/url-regex/tsconfig.json +++ b/types/url-regex/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/url-search-params/index.d.ts b/types/url-search-params/index.d.ts index 144c7ba48b..42cca9ca21 100644 --- a/types/url-search-params/index.d.ts +++ b/types/url-search-params/index.d.ts @@ -1,19 +1,20 @@ // Type definitions for url-search-params 0.10 // Project: https://github.com/WebReflection/url-search-params // Definitions by: Nick +// Neha // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare class URLSearchParams { constructor(init?: string | URLSearchParams | any); append(name: string, value: any): void; delete(name: string): void; - entries(pointer: string): Iterator; + entries(): Iterator; get(name: string): string; - getAll(): string[]; + getAll(name: string): string[]; has(name: string): boolean; keys(): Iterator; set(name: string, value: any): void; - values(pointer: string): Iterator; + values(): Iterator; } export = URLSearchParams; diff --git a/types/url-search-params/tsconfig.json b/types/url-search-params/tsconfig.json index c67e1d9f93..740ca83a3c 100644 --- a/types/url-search-params/tsconfig.json +++ b/types/url-search-params/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/url-search-params/url-search-params-tests.ts b/types/url-search-params/url-search-params-tests.ts index 1f2c7a0644..94664f5a5c 100644 --- a/types/url-search-params/url-search-params-tests.ts +++ b/types/url-search-params/url-search-params-tests.ts @@ -1,15 +1,25 @@ import URLSearchParams = require("url-search-params"); -const params = new URLSearchParams(); +const params = new URLSearchParams('a=1&b=2'); -params.append("a", "1"); +params.append("b", 3); params.delete("a"); +params.delete("c"); -params.get("a"); +params.entries(); -params.has("a"); +params.get("b"); -params.getAll(); +params.getAll("b"); + +params.has("b"); + +params.keys(); + +params.set("b", 4); +params.set("c", 5); params.toString(); + +params.values(); diff --git a/types/url-template/tsconfig.json b/types/url-template/tsconfig.json index b6851260ad..38953b850d 100644 --- a/types/url-template/tsconfig.json +++ b/types/url-template/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/urlrouter/tsconfig.json b/types/urlrouter/tsconfig.json index dbb5bdd0f0..50a3f65086 100644 --- a/types/urlrouter/tsconfig.json +++ b/types/urlrouter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/urlsafe-base64/tsconfig.json b/types/urlsafe-base64/tsconfig.json index a3a79d6fb0..e6f2a198e1 100644 --- a/types/urlsafe-base64/tsconfig.json +++ b/types/urlsafe-base64/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/usage/tsconfig.json b/types/usage/tsconfig.json index 417ff3267d..7561c99214 100644 --- a/types/usage/tsconfig.json +++ b/types/usage/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/usb/index.d.ts b/types/usb/index.d.ts index 5e24e16bac..7d3a5d8c89 100644 --- a/types/usb/index.d.ts +++ b/types/usb/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for node-usb 1.1 // Project: https://github.com/tessel/node-usb // Definitions by: Eric Brody +// Rob Moran // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -14,6 +15,8 @@ export class Device { portNumbers: number[]; deviceDescriptor: DeviceDescriptor; configDescriptor: ConfigDescriptor; + allConfigDescriptors: ConfigDescriptor[]; + parent: Device; interfaces: Interface[]; __open(): void; @@ -35,7 +38,7 @@ export class DeviceDescriptor { bDeviceClass: number; bDeviceSubClass: number; bDeviceProtocol: number; - bMaxPacketSize: number; + bMaxPacketSize0: number; idVendor: number; idProduct: number; bcdDevice: number; @@ -55,14 +58,18 @@ export class ConfigDescriptor { bmAttributes: number; bMaxPower: number; extra: Buffer; + interfaces: InterfaceDescriptor[][]; } export class Interface { + interface: number; + altSetting: number; descriptor: InterfaceDescriptor; endpoints: Endpoint[]; constructor(device: Device, id: number); claim(): void; - release(closeEndpoints?: (err?: string) => void, cb?: (err?: string) => void): void; + release(cb?: (err?: string) => void): void; + release(closeEndpoints?: boolean, cb?: (err?: string) => void): void; isKernelDriverActive(): boolean; detachKernelDriver(): number; attachKernelDriver(): number; @@ -81,6 +88,7 @@ export class InterfaceDescriptor { bInterfaceProtocol: number; iInterface: number; extra: Buffer; + endpoints: EndpointDescriptor[]; } export interface Endpoint extends EventEmitter { @@ -120,6 +128,7 @@ export class EndpointDescriptor { bInterval: number; bRefresh: number; bSynchAddress: number; + extra: Buffer; } export function findByIds(vid: number, pid: number): Device; diff --git a/types/usb/tsconfig.json b/types/usb/tsconfig.json index ba316ad2d1..9f947b89c9 100644 --- a/types/usb/tsconfig.json +++ b/types/usb/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/usb/usb-tests.ts b/types/usb/usb-tests.ts index 53b214460e..44701c655b 100644 --- a/types/usb/usb-tests.ts +++ b/types/usb/usb-tests.ts @@ -25,7 +25,7 @@ deviceDesc.bcdUSB = 1; deviceDesc.bDeviceClass = 1; deviceDesc.bDeviceSubClass = 1; deviceDesc.bDeviceProtocol = 1; -deviceDesc.bMaxPacketSize = 1; +deviceDesc.bMaxPacketSize0 = 1; deviceDesc.idVendor = 1; deviceDesc.idProduct = 1; deviceDesc.bcdDevice = 1; @@ -51,16 +51,37 @@ configDesc.extra = new Buffer([]); const deviceInterface: usb.Interface = device.interface(1); device.interfaces = [deviceInterface]; +device.parent = device; +device.configDescriptor = configDesc; +device.allConfigDescriptors = [configDesc]; const iface = new usb.Interface(device, 1); +iface.interface = 1; +iface.altSetting = 0; iface.claim(); -iface.release((error: string) => null, (error: string) => null); +iface.release((error: string) => null); +iface.release(false, (error: string) => null); const kernelActive: boolean = iface.isKernelDriverActive(); const detachKernel: number = iface.detachKernelDriver(); const attachKernel: number = iface.attachKernelDriver(); iface.setAltSetting(1, (error: string) => null); +const ifaceDesc: usb.InterfaceDescriptor = new usb.InterfaceDescriptor(); + +ifaceDesc.bLength = 1; +ifaceDesc.bDescriptorType = 1; +ifaceDesc.bInterfaceNumber = 1; +ifaceDesc.bAlternateSetting = 1; +ifaceDesc.bNumEndpoints = 1; +ifaceDesc.bInterfaceClass = 1; +ifaceDesc.bInterfaceSubClass = 1; +ifaceDesc.bInterfaceProtocol = 1; +ifaceDesc.iInterface = 1; +ifaceDesc.extra = new Buffer([]); + +iface.descriptor = ifaceDesc; + const endpointDesc: usb.EndpointDescriptor = new usb.EndpointDescriptor(); endpointDesc.bLength = 1; @@ -71,6 +92,7 @@ endpointDesc.wMaxPacketSize = 1; endpointDesc.bInterval = 1; endpointDesc.bRefresh = 1; endpointDesc.bSynchAddress = 1; +endpointDesc.extra = new Buffer([]); const ifaceInEndpoint: usb.Endpoint = iface.endpoint(1) as usb.InEndpoint; const ifaceOutEndpoint: usb.Endpoint = iface.endpoint(1) as usb.OutEndpoint; @@ -98,6 +120,8 @@ inEndpoint.on("error", (err) => null); const xferOutEndpoint: usb.OutEndpoint = outEndpoint.transfer(new Buffer([]), (error: string) => null); outEndpoint.transferWithZLP(new Buffer([]), (error: string) => null); +iface.endpoints = [inEndpoint, outEndpoint]; + const findByDevice: usb.Device = usb.findByIds(1, 1); usb.on("hey", (device: usb.Device) => null); const deviceList: usb.Device[] = usb.getDeviceList(); diff --git a/types/user-home/tsconfig.json b/types/user-home/tsconfig.json index dd35bdbe98..5c0c14bf5a 100644 --- a/types/user-home/tsconfig.json +++ b/types/user-home/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/useragent/tsconfig.json b/types/useragent/tsconfig.json index 5ce0443620..fd725c4da8 100644 --- a/types/useragent/tsconfig.json +++ b/types/useragent/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/username/index.d.ts b/types/username/index.d.ts index e0bceed481..4d8c34ee10 100644 --- a/types/username/index.d.ts +++ b/types/username/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for username v1.0.1 +// Type definitions for username v3.0.0 // Project: https://www.npmjs.com/package/username // Definitions by: Klaus Reimer +// Akos Krivachy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -9,9 +10,9 @@ * Falls back to `id -un` on OS X / Linux and `whoami` on Windows in the rare case none of the environment * variables are set. The result is cached. * - * @param callback The callback function to call asynchronously with the result. + * @return Promise A promise containing the username or empty string if not found. */ -declare function username(callback: (err: Error, result: string) => void): void; +declare function username(): Promise; declare namespace username { /** diff --git a/types/username/tsconfig.json b/types/username/tsconfig.json index f1ff2eeb4a..0a46097968 100644 --- a/types/username/tsconfig.json +++ b/types/username/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/username/username-tests.ts b/types/username/username-tests.ts index c6e739c14f..a5bbe51aca 100644 --- a/types/username/username-tests.ts +++ b/types/username/username-tests.ts @@ -1,9 +1,12 @@ import username = require("username"); -username(function(err, username) { - err === new Error(); - username === "string"; -}); +username() + .then((username) => { + username === "string"; + }) + .catch((err) => { + err === new Error(); + }); username.sync() === "string"; diff --git a/types/utf8/tsconfig.json b/types/utf8/tsconfig.json index 673b72ce14..b4634105f5 100644 --- a/types/utf8/tsconfig.json +++ b/types/utf8/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/util-deprecate/tsconfig.json b/types/util-deprecate/tsconfig.json index cdfa8aa957..7b8b39ca61 100644 --- a/types/util-deprecate/tsconfig.json +++ b/types/util-deprecate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/util.promisify/tsconfig.json b/types/util.promisify/tsconfig.json index 041c10a94c..b8cee6891a 100644 --- a/types/util.promisify/tsconfig.json +++ b/types/util.promisify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/utils-merge/tsconfig.json b/types/utils-merge/tsconfig.json index a841cf3ef3..fa40077e48 100644 --- a/types/utils-merge/tsconfig.json +++ b/types/utils-merge/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/uuid-1345/tsconfig.json b/types/uuid-1345/tsconfig.json index cd69f6f3b8..6fd0136d4e 100644 --- a/types/uuid-1345/tsconfig.json +++ b/types/uuid-1345/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/uuid-js/tsconfig.json b/types/uuid-js/tsconfig.json index 959ae5bc26..ee78ac4113 100644 --- a/types/uuid-js/tsconfig.json +++ b/types/uuid-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/uuid-validate/tsconfig.json b/types/uuid-validate/tsconfig.json index 037d808448..a129079a1a 100644 --- a/types/uuid-validate/tsconfig.json +++ b/types/uuid-validate/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/uuid/tsconfig.json b/types/uuid/tsconfig.json index ce6d909022..af61a51407 100644 --- a/types/uuid/tsconfig.json +++ b/types/uuid/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/uuid/v2/tsconfig.json b/types/uuid/v2/tsconfig.json index 06847b515e..ffa82a6a67 100644 --- a/types/uuid/v2/tsconfig.json +++ b/types/uuid/v2/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/uws/tsconfig.json b/types/uws/tsconfig.json index fe7f021800..1c38e2d321 100644 --- a/types/uws/tsconfig.json +++ b/types/uws/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/v8-profiler/tsconfig.json b/types/v8-profiler/tsconfig.json index 0d065aaad5..f4ea0c2893 100644 --- a/types/v8-profiler/tsconfig.json +++ b/types/v8-profiler/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/valdr-message/tsconfig.json b/types/valdr-message/tsconfig.json index ca46410452..34ef984b98 100644 --- a/types/valdr-message/tsconfig.json +++ b/types/valdr-message/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/valdr/tsconfig.json b/types/valdr/tsconfig.json index 0f55a41f43..594114402f 100644 --- a/types/valdr/tsconfig.json +++ b/types/valdr/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/valerie/tsconfig.json b/types/valerie/tsconfig.json index e943ca70f9..fcbf37aabd 100644 --- a/types/valerie/tsconfig.json +++ b/types/valerie/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vali-date/tsconfig.json b/types/vali-date/tsconfig.json index 8e27969380..93c4d19b26 100644 --- a/types/vali-date/tsconfig.json +++ b/types/vali-date/tsconfig.json @@ -16,10 +16,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "vali-date-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/valid-url/tsconfig.json b/types/valid-url/tsconfig.json index 9ae1f983bc..332b718e04 100644 --- a/types/valid-url/tsconfig.json +++ b/types/valid-url/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/validator/tsconfig.json b/types/validator/tsconfig.json index 720a2e79c8..d68741ab73 100644 --- a/types/validator/tsconfig.json +++ b/types/validator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/validatorjs/tsconfig.json b/types/validatorjs/tsconfig.json index 3fda638aea..c3d504dcda 100644 --- a/types/validatorjs/tsconfig.json +++ b/types/validatorjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vanilla-modal/tsconfig.json b/types/vanilla-modal/tsconfig.json index f6d7663c4f..f7e86c13ff 100644 --- a/types/vanilla-modal/tsconfig.json +++ b/types/vanilla-modal/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames" : true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "vanilla-modal-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/vanilla-tilt/tsconfig.json b/types/vanilla-tilt/tsconfig.json index 71d85c07ab..ef19bb7da0 100644 --- a/types/vanilla-tilt/tsconfig.json +++ b/types/vanilla-tilt/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vary/tsconfig.json b/types/vary/tsconfig.json index 8dc896220b..59cc82837f 100644 --- a/types/vary/tsconfig.json +++ b/types/vary/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vast-client/tsconfig.json b/types/vast-client/tsconfig.json index 106b26913c..3a09e03c3c 100644 --- a/types/vast-client/tsconfig.json +++ b/types/vast-client/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vec3/tsconfig.json b/types/vec3/tsconfig.json index 05cbd739f7..b1fb708c01 100644 --- a/types/vec3/tsconfig.json +++ b/types/vec3/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vectorious/tsconfig.json b/types/vectorious/tsconfig.json index 6b0974b0ac..5bea81f889 100644 --- a/types/vectorious/tsconfig.json +++ b/types/vectorious/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vega/tsconfig.json b/types/vega/tsconfig.json index f49e5e811b..9dcac260ef 100644 --- a/types/vega/tsconfig.json +++ b/types/vega/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/velocity-animate/tsconfig.json b/types/velocity-animate/tsconfig.json index a43f8fa036..7c187828bf 100644 --- a/types/velocity-animate/tsconfig.json +++ b/types/velocity-animate/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/verror/tsconfig.json b/types/verror/tsconfig.json index 478972649d..b153f53b9f 100644 --- a/types/verror/tsconfig.json +++ b/types/verror/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vertx3-eventbus-client/tsconfig.json b/types/vertx3-eventbus-client/tsconfig.json index b7e963d3d4..e9b964e3c3 100644 --- a/types/vertx3-eventbus-client/tsconfig.json +++ b/types/vertx3-eventbus-client/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vex-js/tsconfig.json b/types/vex-js/tsconfig.json index bb63a4aad4..430a00a8d5 100644 --- a/types/vex-js/tsconfig.json +++ b/types/vex-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vexflow/tsconfig.json b/types/vexflow/tsconfig.json index 6ca1cf5f8a..b5ba3901e8 100644 --- a/types/vexflow/tsconfig.json +++ b/types/vexflow/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vexflow/tslint.json b/types/vexflow/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/vexflow/tslint.json +++ b/types/vexflow/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/vfile-location/index.d.ts b/types/vfile-location/index.d.ts new file mode 100644 index 0000000000..e8ad37bc32 --- /dev/null +++ b/types/vfile-location/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for vfile-location 2.0 +// Project: https://github.com/vfile/vfile-location +// Definitions by: Ika +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +import * as VFile from "vfile"; + +declare function vfileLocation(vfile: string | VFile.VFile<{}>): vfileLocation.Location; + +declare namespace vfileLocation { + interface Location { + /** + * Get the `offset` (`number`) for a line and column-based `position` in the bound file. + * Returns `-1` when given invalid or out of bounds input. + */ + toOffset(position: { line: number; column: number }): number; + /** + * Get the line and column-based `position` for `offset` in the bound file. + */ + toPosition(offset: number): { line: number; column: number; offset: number }; + } +} + +export = vfileLocation; diff --git a/types/vfile-location/tsconfig.json b/types/vfile-location/tsconfig.json new file mode 100644 index 0000000000..7252641d87 --- /dev/null +++ b/types/vfile-location/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "vfile-location-tests.ts" + ] +} \ No newline at end of file diff --git a/types/vfile-location/tslint.json b/types/vfile-location/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/vfile-location/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/vfile-location/vfile-location-tests.ts b/types/vfile-location/vfile-location-tests.ts new file mode 100644 index 0000000000..7419cbf069 --- /dev/null +++ b/types/vfile-location/vfile-location-tests.ts @@ -0,0 +1,7 @@ +import vfile = require("vfile"); +import vfileLocation = require("vfile-location"); + +const location = vfileLocation(vfile("foo\nbar\nbaz")); + +const position = location.toPosition(10); +const offset: number = location.toOffset(position); diff --git a/types/vfile/tsconfig.json b/types/vfile/tsconfig.json index 7f30404056..e62d572e9b 100644 --- a/types/vfile/tsconfig.json +++ b/types/vfile/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/victor/tsconfig.json b/types/victor/tsconfig.json index 8ce6a32927..9b86a76639 100644 --- a/types/victor/tsconfig.json +++ b/types/victor/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/victory/tsconfig.json b/types/victory/tsconfig.json index a12b6074c7..dbbaf6add2 100644 --- a/types/victory/tsconfig.json +++ b/types/victory/tsconfig.json @@ -16,6 +16,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "react" }, "files": [ diff --git a/types/video.js/tsconfig.json b/types/video.js/tsconfig.json index 3946d11571..da68448904 100644 --- a/types/video.js/tsconfig.json +++ b/types/video.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/viewability-helper/tsconfig.json b/types/viewability-helper/tsconfig.json index fd64db5703..a37725baf8 100644 --- a/types/viewability-helper/tsconfig.json +++ b/types/viewability-helper/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/viewerjs/tsconfig.json b/types/viewerjs/tsconfig.json index 144a0a0fc1..2c141853b1 100644 --- a/types/viewerjs/tsconfig.json +++ b/types/viewerjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/viewporter/tsconfig.json b/types/viewporter/tsconfig.json index cd83af4238..fea9cb0f51 100644 --- a/types/viewporter/tsconfig.json +++ b/types/viewporter/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vimeo/tsconfig.json b/types/vimeo/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/vimeo/tsconfig.json +++ b/types/vimeo/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/vimeo__player/tsconfig.json b/types/vimeo__player/tsconfig.json index d2875c251f..a68c91b1a3 100644 --- a/types/vimeo__player/tsconfig.json +++ b/types/vimeo__player/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vinyl-buffer/tsconfig.json b/types/vinyl-buffer/tsconfig.json index e96042ec50..56c104a5cc 100644 --- a/types/vinyl-buffer/tsconfig.json +++ b/types/vinyl-buffer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vinyl-fs/tsconfig.json b/types/vinyl-fs/tsconfig.json index 6f041838fd..29fcea4ba0 100644 --- a/types/vinyl-fs/tsconfig.json +++ b/types/vinyl-fs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vinyl-paths/tsconfig.json b/types/vinyl-paths/tsconfig.json index 520193e6cf..6c6875786c 100644 --- a/types/vinyl-paths/tsconfig.json +++ b/types/vinyl-paths/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vinyl-source-stream/tsconfig.json b/types/vinyl-source-stream/tsconfig.json index 8167f27eeb..86849e80e8 100644 --- a/types/vinyl-source-stream/tsconfig.json +++ b/types/vinyl-source-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vinyl/tsconfig.json b/types/vinyl/tsconfig.json index 7386da20a1..affd19f7aa 100644 --- a/types/vinyl/tsconfig.json +++ b/types/vinyl/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vinyl/v0/tsconfig.json b/types/vinyl/v0/tsconfig.json index a8d30ed9bb..929b893957 100644 --- a/types/vinyl/v0/tsconfig.json +++ b/types/vinyl/v0/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vinyl/vinyl-tests.ts b/types/vinyl/vinyl-tests.ts index 3a73249b60..77ef5d6d1b 100644 --- a/types/vinyl/vinyl-tests.ts +++ b/types/vinyl/vinyl-tests.ts @@ -2,7 +2,7 @@ import * as fs from 'fs'; import * as path from 'path'; -import * as expect from 'expect'; +import expect = require('expect'); const miss = require('mississippi'); const cloneable = require('cloneable-readable'); diff --git a/types/virtual-dom/tsconfig.json b/types/virtual-dom/tsconfig.json index e48bf32e57..57e997f685 100644 --- a/types/virtual-dom/tsconfig.json +++ b/types/virtual-dom/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/virtual-keyboard/tsconfig.json b/types/virtual-keyboard/tsconfig.json index b1eaf0612a..92516f353a 100644 --- a/types/virtual-keyboard/tsconfig.json +++ b/types/virtual-keyboard/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/vis/index.d.ts b/types/vis/index.d.ts index 9c0adb0a97..e7ca718dab 100644 --- a/types/vis/index.d.ts +++ b/types/vis/index.d.ts @@ -290,7 +290,7 @@ export interface TimelineEventPropertiesResult { /** * The id of the clicked item. */ - item?: number | null; + item?: IdType | null; /** * Absolute horizontal position of the click event. diff --git a/types/vis/tsconfig.json b/types/vis/tsconfig.json index 50fd412eee..35a94f84d2 100644 --- a/types/vis/tsconfig.json +++ b/types/vis/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vision/tsconfig.json b/types/vision/tsconfig.json index d00003dd52..77092f0ff4 100644 --- a/types/vision/tsconfig.json +++ b/types/vision/tsconfig.json @@ -14,13 +14,16 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "vision-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/vitalsigns/tsconfig.json b/types/vitalsigns/tsconfig.json index 35eb17732d..84bc8daefd 100644 --- a/types/vitalsigns/tsconfig.json +++ b/types/vitalsigns/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vitalsigns/vitalsigns-tests.ts b/types/vitalsigns/vitalsigns-tests.ts index 62cc2e5676..757b7099c5 100644 --- a/types/vitalsigns/vitalsigns-tests.ts +++ b/types/vitalsigns/vitalsigns-tests.ts @@ -1,4 +1,4 @@ -import * as express from "express"; +import express = require("express"); import VitalSigns = require("vitalsigns"); var vitals = new VitalSigns(); diff --git a/types/vivus/tsconfig.json b/types/vivus/tsconfig.json index a66fa1e203..219e514b68 100644 --- a/types/vivus/tsconfig.json +++ b/types/vivus/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vkbeautify/tsconfig.json b/types/vkbeautify/tsconfig.json index a795394230..03fe9fedaf 100644 --- a/types/vkbeautify/tsconfig.json +++ b/types/vkbeautify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/voca/tsconfig.json b/types/voca/tsconfig.json index 8cd5ac1f19..e2cbf65168 100644 --- a/types/voca/tsconfig.json +++ b/types/voca/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/voronoi-diagram/tsconfig.json b/types/voronoi-diagram/tsconfig.json index 74bb32af15..12eb3f0b52 100644 --- a/types/voronoi-diagram/tsconfig.json +++ b/types/voronoi-diagram/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vortex-web-client/tsconfig.json b/types/vortex-web-client/tsconfig.json index de0989c9b1..ce17ad0232 100644 --- a/types/vortex-web-client/tsconfig.json +++ b/types/vortex-web-client/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/voximplant-websdk/tsconfig.json b/types/voximplant-websdk/tsconfig.json index 28c84ce5a7..df66438237 100644 --- a/types/voximplant-websdk/tsconfig.json +++ b/types/voximplant-websdk/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vue-resource/tsconfig.json b/types/vue-resource/tsconfig.json index 62b9761326..5c248ee34e 100644 --- a/types/vue-resource/tsconfig.json +++ b/types/vue-resource/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/vue-scrollto/tsconfig.json b/types/vue-scrollto/tsconfig.json index fd030de5e6..c855fcc8fc 100644 --- a/types/vue-scrollto/tsconfig.json +++ b/types/vue-scrollto/tsconfig.json @@ -3,7 +3,7 @@ "module": "commonjs", "lib": [ "es6", - "dom" + "dom" ], "noImplicitAny": true, "noImplicitThis": true, @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "vue-scrollto-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/vuex-i18n/tsconfig.json b/types/vuex-i18n/tsconfig.json index 9f8f6eb2fd..063a09918d 100644 --- a/types/vuex-i18n/tsconfig.json +++ b/types/vuex-i18n/tsconfig.json @@ -16,7 +16,8 @@ "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/w2ui/tsconfig.json b/types/w2ui/tsconfig.json index e5a6f41e44..daa4d80fad 100644 --- a/types/w2ui/tsconfig.json +++ b/types/w2ui/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/w3c-generic-sensor/tsconfig.json b/types/w3c-generic-sensor/tsconfig.json index 4a33837faa..604d3c63c3 100644 --- a/types/w3c-generic-sensor/tsconfig.json +++ b/types/w3c-generic-sensor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/w3c-image-capture/tsconfig.json b/types/w3c-image-capture/tsconfig.json index 1dc1d0ce51..60aaabe0e8 100644 --- a/types/w3c-image-capture/tsconfig.json +++ b/types/w3c-image-capture/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "w3c-image-capture-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/w3c-screen-orientation/tsconfig.json b/types/w3c-screen-orientation/tsconfig.json index fa84e114b1..fdbf5ace6e 100644 --- a/types/w3c-screen-orientation/tsconfig.json +++ b/types/w3c-screen-orientation/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/w3c-web-usb/tsconfig.json b/types/w3c-web-usb/tsconfig.json index dc162699e6..d6a5a0c8ac 100644 --- a/types/w3c-web-usb/tsconfig.json +++ b/types/w3c-web-usb/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/waitme/tsconfig.json b/types/waitme/tsconfig.json index 3ca35aebea..7d10c325d3 100644 --- a/types/waitme/tsconfig.json +++ b/types/waitme/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/wake_on_lan/tsconfig.json b/types/wake_on_lan/tsconfig.json index 0b9e2067fd..502a9625fd 100644 --- a/types/wake_on_lan/tsconfig.json +++ b/types/wake_on_lan/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/wallabyjs/tsconfig.json b/types/wallabyjs/tsconfig.json index 903d0deaf0..c3465b310e 100644 --- a/types/wallabyjs/tsconfig.json +++ b/types/wallabyjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/wallpaper/tsconfig.json b/types/wallpaper/tsconfig.json index ace8bd1f01..04f9bf385c 100644 --- a/types/wallpaper/tsconfig.json +++ b/types/wallpaper/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/wampy/tsconfig.json b/types/wampy/tsconfig.json index b324433f07..50fc531710 100644 --- a/types/wampy/tsconfig.json +++ b/types/wampy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/warning/tsconfig.json b/types/warning/tsconfig.json index 68b31c6a27..51ecd5f0c5 100644 --- a/types/warning/tsconfig.json +++ b/types/warning/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/watch/tsconfig.json b/types/watch/tsconfig.json index 776b11b37f..0951f2ae4b 100644 --- a/types/watch/tsconfig.json +++ b/types/watch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/watchify/tsconfig.json b/types/watchify/tsconfig.json index 73fd603cc8..224cf4ffd4 100644 --- a/types/watchify/tsconfig.json +++ b/types/watchify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/watchpack/tsconfig.json b/types/watchpack/tsconfig.json index a9011453a0..cd7d18ed93 100644 --- a/types/watchpack/tsconfig.json +++ b/types/watchpack/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/waterline/tsconfig.json b/types/waterline/tsconfig.json index 2cdcfaa2d4..836daa79e3 100644 --- a/types/waterline/tsconfig.json +++ b/types/waterline/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/watson-developer-cloud/tsconfig.json b/types/watson-developer-cloud/tsconfig.json index 005bf02ffe..2343c037c6 100644 --- a/types/watson-developer-cloud/tsconfig.json +++ b/types/watson-developer-cloud/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/waypoints/index.d.ts b/types/waypoints/index.d.ts index 97ad8d3488..0bf0c488d8 100644 --- a/types/waypoints/index.d.ts +++ b/types/waypoints/index.d.ts @@ -1,18 +1,21 @@ // Type definitions for waypoints 4.x // Project: https://github.com/imakewebthings/waypoints -// Definitions by: Dominik Bułaj , Alexey Kolotovchenkov +// Definitions by: Dominik Bułaj , Alexey Kolotovchenkov , Sergei Dorogin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 -interface WaypointOptions { - element: HTMLElement; - handler: (this: Waypoint, direction?: string) => void; +interface WaypointOptionsBase { offset?: string|number|(() => number); - context?: HTMLElement; continuous?: boolean; enabled?: boolean; group?: string; horizontal?: boolean; } +interface WaypointOptions extends WaypointOptionsBase { + element: HTMLElement; + handler: (this: Waypoint, direction?: string) => void; + context?: HTMLElement; +} declare class WaypointGroup { first: () => Waypoint; diff --git a/types/waypoints/jquery.d.ts b/types/waypoints/jquery.d.ts new file mode 100644 index 0000000000..d93b0ac18e --- /dev/null +++ b/types/waypoints/jquery.d.ts @@ -0,0 +1,13 @@ +/* Type definitions for jQuery Adapter for waypoints 4.0 */ + +/// + +interface JQuery { + waypoint(handler: (this: Waypoint, direction?: string) => void, options?: WaypointOptionsJQuery): JQuery; + waypoint(options?: WaypointOptionsJQuery): JQuery; +} + +interface WaypointOptionsJQuery extends WaypointOptionsBase { + handler?: (this: Waypoint, direction?: string) => void; + context?: HTMLElement|string; +} diff --git a/types/waypoints/tsconfig.json b/types/waypoints/tsconfig.json index c457df62f8..e0c26c5097 100644 --- a/types/waypoints/tsconfig.json +++ b/types/waypoints/tsconfig.json @@ -15,10 +15,12 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", + "jquery.d.ts", "waypoints-tests.ts" ] } \ No newline at end of file diff --git a/types/waypoints/waypoints-tests.ts b/types/waypoints/waypoints-tests.ts index 658412f953..4ea425fbf8 100644 --- a/types/waypoints/waypoints-tests.ts +++ b/types/waypoints/waypoints-tests.ts @@ -4,7 +4,7 @@ declare function notify(text: string): void; // A Basic Waypoint // -------------------------------------------------------------------------------------------------------------------- -let waypoint1 = new Waypoint({ +const waypoint1 = new Waypoint({ element: document.getElementById('basic-waypoint')!, handler() { notify('Basic waypoint triggered'); @@ -13,7 +13,7 @@ let waypoint1 = new Waypoint({ // Directions // -------------------------------------------------------------------------------------------------------------------- -let waypoint2 = new Waypoint({ +const waypoint2 = new Waypoint({ element: document.getElementById('direction-waypoint')!, handler(direction) { notify('Direction: ' + direction); @@ -22,7 +22,7 @@ let waypoint2 = new Waypoint({ // Offsets // -------------------------------------------------------------------------------------------------------------------- -let waypoint3 = new Waypoint({ +const waypoint3 = new Waypoint({ element: document.getElementById('px-offset-waypoint')!, handler(direction) { notify('I am 20px from the top of the window'); @@ -32,10 +32,45 @@ let waypoint3 = new Waypoint({ // this? // -------------------------------------------------------------------------------------------------------------------- -let waypoint4 = new Waypoint({ +const waypoint4 = new Waypoint({ element: document.getElementById('element-waypoint')!, handler(direction) { notify(`${this.element.id} triggers at ${this.triggerPoint}`); }, offset: '75%' }); + +// JQuery adapter +// All code examples below taken from http://imakewebthings.com/waypoints/guides/jquery-zepto/ + +import $ = require('jquery'); + +// $.fn.waypoint +// -------------------------------------------------------------------------------------------------------------------- + +const waypoints10 = $('#options-only').waypoint({ + handler: function fn(this: Waypoint, direction?: string) { + notify(this.element.id + ' hit'); + } +}); + +const waypoints11 = $('#handler-first').waypoint(function() { + notify(this.element.id + ' hit 25% from top of window'); +}, { + offset: '25%' +}); + +const waypoints12 = $('#handler-only').waypoint(function() { + notify(this.element.id + ' hit'); +}); + +// Context Option +// -------------------------------------------------------------------------------------------------------------------- + +const waypoints13 = $('#context-example-offset').waypoint({ + handler: function fn(this: Waypoint, direction?: string) { + notify('Hit midpoint of my context'); + }, + context: '#overflow-scroll-offset', + offset: '50%' +}); diff --git a/types/wcwidth/tsconfig.json b/types/wcwidth/tsconfig.json index 8088cd3cc1..7583c539b4 100644 --- a/types/wcwidth/tsconfig.json +++ b/types/wcwidth/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/weak/tsconfig.json b/types/weak/tsconfig.json index 33d1a4cdf3..5118b7cd06 100644 --- a/types/weak/tsconfig.json +++ b/types/weak/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "weak-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/weapp-api/tsconfig.json b/types/weapp-api/tsconfig.json index ef43ffab75..53181e7140 100644 --- a/types/weapp-api/tsconfig.json +++ b/types/weapp-api/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/web-animations-js/tsconfig.json b/types/web-animations-js/tsconfig.json index defb1340f7..d5ca47dc24 100644 --- a/types/web-animations-js/tsconfig.json +++ b/types/web-animations-js/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/web-bluetooth/tsconfig.json b/types/web-bluetooth/tsconfig.json index cb97fe1d0e..51b4d904d9 100644 --- a/types/web-bluetooth/tsconfig.json +++ b/types/web-bluetooth/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webappsec-credential-management/tsconfig.json b/types/webappsec-credential-management/tsconfig.json index dba66cad28..9647444457 100644 --- a/types/webappsec-credential-management/tsconfig.json +++ b/types/webappsec-credential-management/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webassembly-js-api/tsconfig.json b/types/webassembly-js-api/tsconfig.json index 286d2c0fb4..9802a74b03 100644 --- a/types/webassembly-js-api/tsconfig.json +++ b/types/webassembly-js-api/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webcl/tsconfig.json b/types/webcl/tsconfig.json index cd88a172a7..3aed0c2e27 100644 --- a/types/webcl/tsconfig.json +++ b/types/webcl/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webcl/tslint.json b/types/webcl/tslint.json index 7f51cc6e38..067a495dc9 100644 --- a/types/webcl/tslint.json +++ b/types/webcl/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/webcomponents.js/tsconfig.json b/types/webcomponents.js/tsconfig.json index 7905e2ea0d..5e929791b7 100644 --- a/types/webcomponents.js/tsconfig.json +++ b/types/webcomponents.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webcrypto/tsconfig.json b/types/webcrypto/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/webcrypto/tsconfig.json +++ b/types/webcrypto/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/webdriverio/index.d.ts b/types/webdriverio/index.d.ts index 47d1e8320d..f5dbcf4884 100644 --- a/types/webdriverio/index.d.ts +++ b/types/webdriverio/index.d.ts @@ -1892,6 +1892,12 @@ declare namespace WebdriverIO { declare var browser: WebdriverIO.Client; +declare function $(selector: string): WebdriverIO.Client> & WebdriverIO.RawResult; +declare function $

(selector: string): WebdriverIO.Client

; + +declare function $$(selector: string): Array>> & Array>; +declare function $$

(selector: string): WebdriverIO.Client

; + declare module "webdriverio" { export = WebdriverIO; } diff --git a/types/webdriverio/tsconfig.json b/types/webdriverio/tsconfig.json index 654e7fc599..03c5a63ec2 100644 --- a/types/webdriverio/tsconfig.json +++ b/types/webdriverio/tsconfig.json @@ -16,6 +16,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "target": "es2015" }, "files": [ diff --git a/types/webfontloader/tsconfig.json b/types/webfontloader/tsconfig.json index 11a2a05131..f2eceb3810 100644 --- a/types/webfontloader/tsconfig.json +++ b/types/webfontloader/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webgl-ext/tsconfig.json b/types/webgl-ext/tsconfig.json index 6c8b906888..c6f8843f7a 100644 --- a/types/webgl-ext/tsconfig.json +++ b/types/webgl-ext/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webgl2/tsconfig.json b/types/webgl2/tsconfig.json index 097828d97b..1610e90df4 100644 --- a/types/webgl2/tsconfig.json +++ b/types/webgl2/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webix/index.d.ts b/types/webix/index.d.ts deleted file mode 100755 index 27082c52e0..0000000000 --- a/types/webix/index.d.ts +++ /dev/null @@ -1,10187 +0,0 @@ -// Type definitions for Webix UI 4.3 -// Project: http://webix.com -// Definitions by: Maksim Kozhukh -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 - -declare namespace webix { - -type WebixTemplate = (...args: any[])=>string; -type WebixCallback = (...args: any[])=>any; -type EventHash = { [id: string] : WebixCallback }; - -interface PromisedData { - then(handler:(data:any)=>any):PromisedData; - fail(handler:(error:any)=>any):PromisedData; -} - -function ajax():webix._ajax; -function $$(id: string|Event|HTMLElement):webix.ui.baseview; - - -interface _ajax{ - bind(master:any):webix._ajax; - del(url:string, params?:any, callback?:WebixCallback):PromisedData; - get(url:string, params?:any, callback?:WebixCallback):PromisedData; - getXHR():any; - headers(values:any):webix._ajax; - post(url:string, params?:any, callback?:WebixCallback):PromisedData; - put(url:string, params?:any, callback?:WebixCallback):PromisedData; - response(type:string):void; - stringify(data:any):string; - sync():webix._ajax; - master: any; -} -interface clipbuffer{ - destructor():void; - focus():void; - init():void; - set(text:string):void; -} -interface color{ - hexToDec(hex:string):number; - hsvToRgb(h:number, s:number, v:number):any[]; - rgbToHsv(r:number, g:number, b:number):any[]; - toHex(number:number, length?:number):string; - toRgb(rgb:string):any[]; -} -interface csv{ - parse(text:string, delimiter?:any):any[]; - stringify(data:any[], delimiter?:any):string; - delimiter: any; - escape: boolean; -} -interface editors{ - $popup: any; - checkbox: string; - color: string; - combo: string; - date: string; - "inline-checkbox": string; - "inline-text": string; - multiselect: string; - password: string; - popup: string; - richselect: string; - select: string; - text: string; -} -interface env{ - cssPrefix: string; - isFF: boolean; - isIE: boolean; - isSafari: boolean; - isWebKit: boolean; - jsPrefix: string; - mouse: any; - strict: boolean; - svg: boolean; - transform: boolean; - transition: boolean; - transitionDuration: string; - transitionEnd: string; - translate: string; -} -interface history{ - push(view:string, url:string, value:any):void; - track(view:string, url:string):void; -} -interface html{ - addCss(node:HTMLElement, name:string):void; - addMeta(name:string, value:string):void; - addStyle(css:string):void; - allowSelect():void; - create(name:string, attrs:any, html?:string):HTMLElement; - createCss(data:any):string; - denySelect():void; - getValue(node:HTMLElement):string; - index(node:HTMLElement):number; - insertBefore(node:HTMLElement, before:HTMLElement, rescue?:HTMLElement):void; - locate(ev:Event|HTMLElement, name:string):string; - offset(node:HTMLElement):any; - pos(ev:Event):any; - posRelative(ev:Event):any; - preventEvent(ev:Event):boolean; - remove(node:HTMLElement|HTMLElement[]):void; - removeCss(node:HTMLElement, name:string):void; - stopEvent(ev:Event):boolean; - getTextSize(text:(string|string[]), css?:string, width?:number):number; -} -interface i18n{ - dateFormatDate(date:string):any; - dateFormatStr(date:any):string; - fullDateFormatDate(date:string):any; - fullDateFormatStr(date:Date):string; - intFormat(num:number):string; - longDateFormatDate(date:string):any; - longDateFormatStr(date:any):string; - numberFormat(number:number):string; - parseFormatDate(date:string):any; - parseFormatStr(date:any):string; - parseTimeFormatDate(date:string):any; - parseTimeFormatStr(date:any):string; - priceFormat(number:number):string; - setLocale(name:string):void; - timeFormatDate(time:string):any; - timeFormatStr(date:any):string; - calendar: any; - controls: any; - dateFormat: string; - decimalDelimiter: string; - decimalSize: number; - fileSize: any[]; - fullDateFormat: string; - groupDelimiter: string; - groupSize: number; - locales: any; - longDateFormat: string; - parseFormat: string; - parseTimeFormat: string; - price: string; - priceSettings: any; - timeFormat: string; -} -interface locale{ - pager: any; -} -interface markup{ - init(node:string, target:string):webix.ui.baseview; - parse(data:any, datatype:string):void; - attribute: any; - dataTag: any; - namespace: any; -} -interface promise{ - all(promise:PromisedData, morepromises?:PromisedData):void; - defer():PromisedData; - fcall():PromisedData; - nfcall():PromisedData; -} -interface rules{ - isChecked():boolean; - isEmail():boolean; - isNotEmpty():boolean; - isNumber():boolean; -} -interface cookie{ - clear():void; - get(name:string):any; - put(name:string, value:any):void; - remove(name:string):void; -} -interface local{ - clear():void; - get(name:string):any; - put(name:string, value:any):void; - remove(name:string):void; -} -interface session{ - clear():void; - get(name:string):any; - put(name:string, value:any):void; - remove(name:string):void; -} -interface storage{ - cookie:webix.cookie; - local:webix.local; - session:webix.session; -} - -function alert(text:string, callback:WebixCallback):HTMLElement; -function animate(html_element:HTMLElement, animation:any):void; -function attachEvent(type:string, functor:WebixCallback, id?:string):string|number; -function bind(code:WebixCallback, master:any):WebixCallback; -function blockEvent():void; -function callEvent(name:string, params:any[]):boolean; -function clone(source:any):any; -function confirm(text:string, callback:WebixCallback):HTMLElement; -function copy(source:any):any; -function delay(code:WebixCallback, owner?:any, params?:any[], delay?:number):number; -function detachEvent(id:string):void; -function dp(name:string):any; -function editStop():void; -function event(node:HTMLElement|Window|string, event:string, handler:WebixCallback, context?:any):string|number; -function eventRemove(id:string|number):void; -function exec(code:string):void; -function extend(target:any, source:any, overwrite?:boolean):any; -function hasEvent(name:string):boolean; -function isArray(check:any):boolean; -function isDate(check:any):boolean; -function isUndefined(check:any):boolean; -function jsonp(url:string, params?:any, callback?:WebixCallback, master?:any):void; -function mapEvent(map:any):void; -function message(content:any):void; -function modalbox(text:string, callback:WebixCallback):HTMLElement; -function once(code:WebixCallback):void; -function proto(target:any, ...mixins:any[]):any; -function protoUI(target:any, ...mixins: any[]):any; -function proxy(type:string, source:string):any; -function ready(code:WebixCallback):void; -function remote():void; -function require(url:string):void; -function send(url:string, values:any, method:string, target:string):void; -function single(source:WebixCallback):WebixCallback; -function stringify(obj:any):string; -function template(template:string):WebixCallback; -function toArray(array:any[]):any[]; -function toCSV(id:any, options:any):void; -function toExcel(id:any, options:any):void; -function toFunctor(name:string):WebixCallback; -function toNode(id:string):HTMLElement; -function toPDF(id:string, name:string):void; -function toPNG(id:string, name:string):void; -function type(config:any):void; -function ui(config:any, parent?:any, replacement?:any):webix.ui.baseview; -function uid():number; -function unblockEvent():void; -function wrap(target:WebixCallback, source:WebixCallback):WebixCallback; - -var codebase: string; -var name: string; -var version: string; -var clipbuffer:webix.clipbuffer; -var color:webix.color; -var csv:webix.csv; -var editors:webix.editors; -var env:webix.env; -var history:webix.history; -var html:webix.html; -var i18n:webix.i18n; -var locale:webix.locale; -var markup:webix.markup; -var promise:webix.promise; -var rules:webix.rules; -var storage:webix.storage; - -interface ActiveContent{ -} -var ActiveContent:ActiveContent; -interface AtomDataLoader{ - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - parse(data:any, type:string):void; -} -var AtomDataLoader:AtomDataLoader; -interface AtomRender{ - render(id:string|number, data:any, type:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; -} -var AtomRender:AtomRender; -interface AutoScroll{ -} -var AutoScroll:AutoScroll; -interface AutoTooltip{ -} -var AutoTooltip:AutoTooltip; -interface BaseBind{ - bind(target:any, rule?:WebixCallback, format?:string):void; - unbind():void; -} -var BaseBind:BaseBind; -interface BindSource{ - addBind(source:any, rule:string, format:string):void; - getBindData(key:string|number, update:boolean):void; - removeBind(source:any):void; - saveBatch(handler:WebixCallback):void; - setBindData(data:any, key:string|number):void; -} -var BindSource:BindSource; -interface Canvas{ - clearCanvas():void; - getCanvas(context:string):any; - hideCanvas():void; - renderText(x:number, y:number, text:string, css:string, w:number):void; - renderTextAt(valign:string, align:string, x:number, y:number, t:string, c:string, w:number):void; - showCanvas():void; - toggleCanvas():void; -} -var Canvas:Canvas; -interface CodeParser{ - collapseNames(obj:any):{ [key: string]: any; }; - expandNames(obj:{ [key: string]: any; }):any; -} -var CodeParser:CodeParser; -interface CollectionBind{ - getCursor():number; - refreshCursor():void; - setCursor(cursor:string|number):void; -} -var CollectionBind:CollectionBind; -interface ContextHelper{ - attachTo(view:any):void; - getContext():any; - setContext(context:any):void; -} -var ContextHelper:ContextHelper; -interface CopyPaste{ -} -var CopyPaste:CopyPaste; -interface CustomScroll{ - enable(html_node:HTMLElement|webix.ui.baseview):void; - init():void; - resize():void; - scrollStep: number; -} -var CustomScroll:CustomScroll; -interface DataCollection{ - add(obj:any, index?:number):string|number; - addBind(source:any, rule:string, format:string):void; - attachEvent(type:string, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clearAll():void; - clearValidation():void; - copy(sid:string|number, tindex:number, tobj?:any, details?:any):void; - count():number; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - find(criterion:WebixCallback, first?:boolean):any; - getBindData(key:string|number, update:boolean):void; - getCursor():number; - getFirstId():string|number; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getLastId():string|number; - getNextId(id:string|number, step:number):string|number; - getPrevId(id:string|number, step:number):string|number; - hasEvent(name:string):boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; - mapEvent(map:any):void; - move(sid:string, tindex:number, tobj?:any, details?:any):string; - moveBottom(id:string|number):void; - moveDown(id:string|number, step:number):void; - moveTop(id:string|number):void; - moveUp(id:string|number, step:number):void; - parse(data:any, type:string):void; - refresh(id?:string|number):void; - refreshCursor():void; - remove(id:string|number):void; - removeBind(source:any):void; - saveBatch(handler:WebixCallback):void; - serialize():any; - setBindData(data:any, key:string|number):void; - setCursor(cursor:string|number):void; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - updateItem(id:string|number, data:any):void; - validate(id?:string):boolean; - config: { [key: string]: any; }; - name: string; - data:DataStore; - waitData: webix.promise; -} - -interface DataDriver{ - csv: any; - excel: string; - html: any; - htmltable: any; - jsarray: any; - json: any; - xml: any; -} -var DataDriver:DataDriver; -interface DataLoader{ - add(obj:any, index?:number):string|number; - clearAll():void; - count():number; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - find(criterion:WebixCallback, first?:boolean):any; - getFirstId():string|number; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getLastId():string|number; - getNextId(id:string|number, step:number):string|number; - getPrevId(id:string|number, step:number):string|number; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; - parse(data:any, type:string):void; - refresh(id?:string|number):void; - remove(id:string|number):void; - serialize():any; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - updateItem(id:string|number, data:any):void; - waitData: webix.promise; -} -var DataLoader:DataLoader; -interface DataMarks{ - addCss(id:string|number, css:string, silent?:boolean):void; - clearCss(css:string, silent?:boolean):void; - hasCss(id:string|number, css:string):boolean; - removeCss(id:string|number, css:string, silent?:boolean):void; -} -var DataMarks:DataMarks; -interface DataMove{ - copy(sid:string|number, tindex:number, tobj?:any, details?:any):void; - move(sid:string, tindex:number, tobj?:any, details?:any):string; - moveBottom(id:string|number):void; - moveDown(id:string|number, step:number):void; - moveTop(id:string|number):void; - moveUp(id:string|number, step:number):void; -} -var DataMove:DataMove; -interface DataProcessor{ - attachEvent(type:string, functor:WebixCallback, id?:string):string|number; - attachProgress(start:WebixCallback, end:WebixCallback, error:WebixCallback):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clearValidation():void; - define(property:string, value:any):void; - detachEvent(id:string):void; - escape(value:string):string; - getItemState(itemId:string|number):any; - getState():string|boolean; - hasEvent(name:string):boolean; - ignore(code:WebixCallback, master:any):void; - mapEvent(map:any):void; - off():void; - on():void; - processResult(data:any):void; - reset():void; - save(id:string|number, operation:string):void; - send():void; - setItemState(itemId:string|number, state:boolean):void; - unblockEvent():void; - validate(mode?:any):boolean; - config: { [key: string]: any; }; - name: string; -} -var DataProcessor:DataProcessor; -interface DataRecord{ - attachEvent(type:string, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - detachEvent(id:string):void; - getValues():any; - hasEvent(name:string):boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - mapEvent(map:any):void; - parse(data:any, type:string):void; - refresh(id?:string|number):void; - setValues(values:any, update?:boolean):void; - unbind():void; - unblockEvent():void; - config: { [key: string]: any; }; - name: string; -} -var DataRecord:DataRecord; -interface DataState{ - getState():any; - setState(state:any):void; -} -var DataState:DataState; -interface DataStore{ - add(obj:any, index?:number):string|number; - addMark(id:string, name:string, css?:boolean, value?:any):any; - attachEvent(type:string, functor:WebixCallback, id?:string):string|number; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - changeId(old:string|number, newid:string|number):void; - clearAll():void; - clearMark(name:string):void; - count():number; - destructor():void; - detachEvent(id:string):void; - each(method:WebixCallback, master?:any, all?:boolean):void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - find(criterion:WebixCallback, first?:boolean):any; - getFirstId():string|number; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getIndexRange(from:string|number, to:string|number):any[]; - getItem(id:string|number):any; - getLastId():string|number; - getMark(id:string, mark_name:string):any; - getNextId(id:string|number, step:number):string|number; - getPrevId(id:string|number, step:number):string|number; - getRange(from:string|number, to:string|number):any[]; - hasEvent(name:string):boolean; - id(item:any):string|number; - importData(source:webix.ui.baseview):void; - mapEvent(map:any):void; - move(sid:string, tindex:number, tobj?:any, details?:any):string; - provideApi(target:any, eventable:boolean):void; - refresh(id?:string|number):void; - remove(id:string|number):void; - removeMark(id:string, name:string, css:boolean):void; - scheme(config:any):void; - serialize():any; - setDriver(type:string):void; - silent(code:WebixCallback):void; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unblockEvent():void; - unsync():void; - updateItem(id:string|number, data:any):void; - driver: any; - name: string; - order: any[]; - pull: any; - sorting: any; -} -var DataStore:DataStore; -interface DataValue{ - attachEvent(type:string, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - detachEvent(id:string):void; - getValue():string; - hasEvent(name:string):boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - setValue(value:string):void; - unbind():void; - unblockEvent():void; - name: string; -} -var DataValue:DataValue; -interface Date{ - add(date:any, inc:number, mode:string):any; - copy(date:any):any; - datePart(date:any):any; - dateToStr(format:string, utc:boolean):WebixCallback; - dayStart(date:any):any; - equal(datea:any, dateb:any):boolean; - getISOWeek(date:any):number; - getUTCISOWeek(data:any):number; - isHoliday(date:any):boolean; - monthStart(date:any):any; - strToDate(format:string, utc:boolean):WebixCallback; - timePart(date:any):number; - toFixed(num:number):number; - weekStart(date:any):any; - yearStart(date:any):any; - startOnMonday: boolean; -} -var Date:Date; -interface Destruction{ - destructor():void; -} -var Destruction:Destruction; -interface DragControl{ - addDrag(node:string|number|HTMLElement, ctrl:any):void; - addDrop(node:string|number|HTMLElement, ctrl:any, master_mode:boolean):void; - createDrag(event:Event):void; - destroyDrag():void; - getContext():any; - getMaster(target:any):any; - getNode():HTMLElement; - sendSignal(signal:string):void; - $drag(source:HTMLElement, ev:Event):HTMLElement; - $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):void; - $dragOut(s:any, t:any, n:any, e:Event):void; - $dragPos: WebixCallback; - $drop(source:HTMLElement, target:HTMLElement, ev:Event):void; - left: number; - top: number; -} -var DragControl:DragControl; -interface DragItem{ - $drag(source:HTMLElement, ev:Event):string; - $dragHTML: WebixCallback; - $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; - $dragMark(context:any, ev:Event):boolean; - $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; - $drop(source:HTMLElement, target:HTMLElement, ev:Event):void; - $dropAllow: WebixCallback; -} -var DragItem:DragItem; -interface DragOrder{ - $drag(source:HTMLElement, ev:Event):string; - $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; - $dragPos: WebixCallback; - $drop(source:HTMLElement, target:HTMLElement, ev:Event):void; -} -var DragOrder:DragOrder; -interface EditAbility{ - edit(id:any):void; - editCancel():void; - editNext():boolean; - editStop():void; - focusEditor():void; - getEditState():any; - getEditor(id?:string):any; - getEditorValue():string; - validateEditor(id?:string|number):boolean; -} -var EditAbility:EditAbility; -interface EventSystem{ - attachEvent(type:string, functor:WebixCallback, id?:string):string|number; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - detachEvent(id:string):void; - hasEvent(name:string):boolean; - mapEvent(map:any):void; - unblockEvent():void; -} -var EventSystem:EventSystem; -interface FlexLayout{ - $getSize: any[]; -} -var FlexLayout:FlexLayout; -interface Group{ - group(config:any, mode:boolean):void; - ungroup(mode:boolean):void; -} -var Group:Group; -interface GroupMethods{ - any(property:string, data:any):void; - count(property:string, data:any):void; - max(property:string, data:any):void; - min(property:string, data:any):void; - string(property:string, data:any):void; - sum(property:string, data:any):void; -} -var GroupMethods:GroupMethods; -interface GroupStore{ - group(stats:any):void; - ungroup():void; -} -var GroupStore:GroupStore; -interface HTMLOptions{ -} -var HTMLOptions:HTMLOptions; -interface HtmlMap{ - addPoly(id:string|number, points:any[]):void; - addRect(id:string|number, points:any[], userdata?:string):void; - addSector(id:string|number, aplha0:number, aplha1:number, x:number, y:number, R:number, ky:number):void; - render(html:HTMLElement):void; -} -var HtmlMap:HtmlMap; -interface IdSpace{ - innerId(id:number|string):number|string; - ui(view:any):webix.ui.baseview; - $$: any; -} -var IdSpace:IdSpace; -interface KeysNavigation{ - moveSelection(direction:string):void; -} -var KeysNavigation:KeysNavigation; -interface MapCollection{ -} -var MapCollection:MapCollection; -interface Modality{ -} -var Modality:Modality; -interface MouseEvents{ - on_click: WebixCallback; - on_context: { [key: string]: any; }; - on_dblclick: WebixCallback; - on_mouse_move: WebixCallback; -} -var MouseEvents:MouseEvents; -interface Movable{ -} -var Movable:Movable; -interface NavigationButtons{ -} -var NavigationButtons:NavigationButtons; -interface Number{ - format(value:number, config:any):string; - numToStr(config:any):WebixCallback; -} -var Number:Number; -interface OverlayBox{ - hideOverlay():void; - showOverlay():void; -} -var OverlayBox:OverlayBox; -interface PagingAbility{ - getPage():number; - getPager():any; - setPage(page:number):void; -} -var PagingAbility:PagingAbility; -interface PowerArray{ - each(functor:WebixCallback, master:any):void; - filter(functor:WebixCallback, master:any):any[]; - find(data:any):number; - insertAt(data:any, pos:number):void; - map(functor:WebixCallback, master:any):any[]; - remove(value:any):void; - removeAt(pos:number, len:number):void; -} -var PowerArray:PowerArray; -interface ProgressBar{ - hideProgress():void; - showProgress(config?:any):void; -} -var ProgressBar:ProgressBar; -interface RecordBind{ -} -var RecordBind:RecordBind; -interface RenderStack{ - customize(obj:any):void; - getItemNode(id:string|number):HTMLElement; - locate(e:Event):string|number; - render(id:string|number, data:any, type:string):void; - showItem(id:string|number):void; - type: { [key: string]: any; }; - types: { [key: string]: any; }; -} -var RenderStack:RenderStack; -interface Scrollable{ - getScrollState():any; - scrollTo(x:number, y:number):void; -} -var Scrollable:Scrollable; -interface SelectionModel{ - getSelectedId(as_array:boolean):string|any[]; - getSelectedItem(as_array:boolean):any; - isSelected(id:string|number):boolean; - select(id:string|any[], preserve:boolean):void; - selectAll(from?:string, to?:string):void; - unselect(id?:string):void; - unselectAll():void; -} -var SelectionModel:SelectionModel; -interface Settings{ - define(property:string, value:any):void; - config: { [key: string]: any; }; - name: string; -} -var Settings:Settings; -interface SingleRender{ - customize(obj:any):void; - render(id:string|number, data:any, type:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - type: { [key: string]: any; }; -} -var SingleRender:SingleRender; -interface Sparklines{ - template(item:any, common:string, data:any[], column:any, index:number):string; - paddingX: number; - paddingY: number; - radius: number; -} -var Sparklines:Sparklines; -interface TablePaste{ -} -var TablePaste:TablePaste; -interface Touch{ - disable():void; - enable():void; - limit(mode:boolean):void; - scrollTo(node:HTMLElement, x:number, y:number, speed:string):void; - config: any; -} -var Touch:Touch; -interface TreeAPI{ - close(id:string|number):void; - closeAll():void; - getOpenItems():any[]; - getState():any; - isBranchOpen(id:string|number):boolean; - open(id:string|number, show?:boolean):void; - openAll():void; - setState(state:any):void; -} -var TreeAPI:TreeAPI; -interface TreeClick{ - webix_tree_checkbox(obj:any, common:{ [key: string]: any; }):string; - webix_tree_close(obj:any, common:{ [key: string]: any; }):string; - webix_tree_open(obj:any, common:{ [key: string]: any; }):string; -} -var TreeClick:TreeClick; -interface TreeCollection{ - add(obj:any, index?:number, parentId?:string):string; - addBind(source:any, rule:string, format:string):void; - attachEvent(type:string, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clearAll():void; - clearValidation():void; - copy(sid:string|number, tindex:number, tobj?:any, details?:any):void; - count():number; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - find(criterion:WebixCallback, first?:boolean):any; - getBindData(key:string|number, update:boolean):void; - getBranchIndex(id:string|number, parent?:string|number):number; - getCursor():number; - getFirstChildId(id:string|number):string; - getFirstId():string|number; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getLastId():string|number; - getNextId(id:string|number, step:number):string|number; - getNextSiblingId(id:string|number):string|number; - getParentId(id:string|number):string|number; - getPrevId(id:string|number, step:number):string|number; - getPrevSiblingId(id:string|number):string|number; - hasEvent(name:string):boolean; - isBranch(id:string|number):boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - loadBranch(id:string|number, callback:WebixCallback, url:string):void; - loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; - mapEvent(map:any):void; - move(sid:string|number, tindex:number, tobj?:webix.ui.baseview, details?:any):string|number; - moveBottom(id:string|number):void; - moveTop(id:string|number):void; - parse(data:any, type:string):void; - refresh(id?:string|number):void; - refreshCursor():void; - remove(id:string|number):void; - removeBind(source:any):void; - saveBatch(handler:WebixCallback):void; - serialize():any; - setBindData(data:any, key:string|number):void; - setCursor(cursor:string|number):void; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - updateItem(id:string|number, data:any):void; - validate(id?:string):boolean; - config: { [key: string]: any; }; - name: string; - data:DataStore; - waitData: webix.promise; -} -var TreeCollection:TreeCollection; -interface TreeDataLoader{ - loadBranch(id:string|number, callback:WebixCallback, url:string):void; -} -var TreeDataLoader:TreeDataLoader; -interface TreeDataMove{ - copy(sid:string|number, tindex:number, tobj?:webix.ui.baseview, details?:any):string|number; - move(sid:string|number, tindex:number, tobj?:webix.ui.baseview, details?:any):string|number; - $dropAllow: WebixCallback; -} -var TreeDataMove:TreeDataMove; -interface TreeRenderStack{ - getItemNode(id:string|number):HTMLElement; - render(id:string|number, data:any, type:string):void; -} -var TreeRenderStack:TreeRenderStack; -interface TreeStateCheckbox{ - checkAll(id?:string|number):void; - checkItem(id:string):void; - getChecked():any[]; - isChecked(id:string|number):boolean; - uncheckAll(id?:string|number):void; - uncheckItem(id:string):void; -} -var TreeStateCheckbox:TreeStateCheckbox; -interface TreeStore{ - add(obj:any, index?:number, parentId?:string):string; - changeId(old:string|number, newid:string|number):void; - clearAll():void; - count():number; - each(code:WebixCallback, master:any, all:boolean, pid:string):void; - eachChild(pid:string, code:WebixCallback, master?:any, all?:boolean):void; - eachLeaf(pid:string, code:WebixCallback):void; - eachOpen(code:WebixCallback, master?:any, pid?:string):void; - eachSubItem(pid:string, code:WebixCallback):void; - getBranch(id:string):any[]; - getBranchIndex(id:string|number, parent?:string|number):number; - getFirstChildId(id:string|number):string; - getNextSiblingId(id:string|number):string|number; - getParentId(id:string|number):string|number; - getPrevSiblingId(id:string|number):string|number; - getTopRange():any[]; - isBranch(id:string|number):boolean; - provideApi(target:any, eventable:boolean):void; - remove(id:string|number):void; - serialize():any; - name: string; -} -var TreeStore:TreeStore; -interface TreeTableClick{ -} -var TreeTableClick:TreeTableClick; -interface TreeTablePaste{ - insert(data:any[]):void; -} -var TreeTablePaste:TreeTablePaste; -interface TreeType{ - checkbox(obj:any, common:any):string; - folder(obj:any, common:any):string; - icon(obj:any, common:any):string; - space(obj:any, common:any):string; -} -var TreeType:TreeType; -interface UIExtension{ -} -var UIExtension:UIExtension; -interface UIManager{ - addHotKey(key:string, handler:WebixCallback, obj?:any):void; - applyChanges():void; - canFocus(id:string|number):boolean; - destructor():void; - getFocus():webix.ui.baseview; - getNext(view:any):any; - getPrev(view:any):any; - getState(id:string, childs:boolean):any; - getTop(id:string|number):any; - hasFocus(id:string|number):boolean; - removeHotKey(key:string, handler?:WebixCallback, obj?:any):void; - setFocus(id:string|number):void; - setState(state:any):void; -} -var UIManager:UIManager; -interface Undo{ - ignoreUndo(functor:WebixCallback):void; - removeUndo(id:string):void; - undo(id:string):void; -} -var Undo:Undo; -interface UploadDriver{ - flash: any; - html5: any; -} -var UploadDriver:UploadDriver; -interface ValidateCollection{ - clearValidation():void; - validate(id?:string):boolean; -} -var ValidateCollection:ValidateCollection; -interface ValidateData{ - clearValidation():void; - validate(mode?:any):boolean; -} -var ValidateData:ValidateData; -interface ValueBind{ -} -var ValueBind:ValueBind; -interface Values{ - clear():void; - focus(item:string):void; - getCleanValues():any; - getDirtyValues():any; - getValues(details?:any):{ [key: string]: any; }; - isDirty():boolean; - markInvalid(name:string, state?:boolean|string):void; - setDirty(mark?:boolean):void; - setValues(values:any, update?:boolean):void; -} -var Values:Values; -interface VirtualRenderStack{ - getItemNode(id:string|number):HTMLElement; - render(id:string|number, data:any, type:string):void; - showItem(id:string|number):void; -} -var VirtualRenderStack:VirtualRenderStack; - - -interface DataCollectionFactory { - new (): DataCollection; -} -var DataCollection: DataCollectionFactory; - - -namespace ui { - -interface WebixFilter { - getValue(node:HTMLElement):any; - setValue(node:HTMLElement, value:any):any; - refresh(master: webix.ui.baseview, node:HTMLElement, value: any):void; - render(master: webix.ui.baseview, config: {[name:string]:any}):string; -} - -namespace datafilter{ - class textFilter implements WebixFilter{ - getValue(node:HTMLElement):any; - setValue(node:HTMLElement, value:any):any; - refresh(master: webix.ui.baseview, node:HTMLElement, value: any):void; - render(master: webix.ui.baseview, config: {[name:string]:any}):string; - getInputNode(node:HTMLElement):HTMLElement; - } - - class selectFilter extends textFilter{} - class serverFilter extends textFilter{} - class serverSelectFilter extends textFilter{} - class numberFilter extends textFilter{} - class dateFilter extends textFilter{} - class multiSelectFilter extends textFilter{} - class serverMultiSelectFilter extends textFilter{} - class multiComboFilter extends textFilter{} - class datepickerFilter extends textFilter{} - class dateRangeFilter extends textFilter{} - - class summColumn extends textFilter{} - class masterCheckbox extends textFilter{} - class columnGroup extends textFilter{} -} - -function delay(config:any):void; -function fullScreen():void; -function hasMethod(name:string, method_name:string):boolean; -function resize():void; -function zIndex():number; -var scrollSize: number; -var zIndexBase: number; - -interface baselayoutConfig{ - view?: string; - animate?: any; - borderless?: boolean; - cols?: any[]; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - on?: EventHash; - responsive?: string; - rows?: any[]; - visibleBatch?: string; - width?: number; -} -type baselayoutEventName ='onBindRequest'|'onDestruct'; -class baselayout implements webix.ui.baseview{ - addView(view:any, index?:number):string|number; - adjust():void; - attachEvent(type:baselayoutEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - hasEvent(name:string):boolean; - hide():void; - index(obj:any):number; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - reconstruct():void; - removeView(id:string|number):void; - resize():void; - resizeChildren():void; - show(force?:boolean, animation?:boolean):void; - showBatch(name:string):void; - unbind():void; - unblockEvent():void; - - $getSize():any[]; - $height: number; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: baselayoutConfig; - name: string; -} -interface baseviewConfig{ - view?: string; - animate?: any; - borderless?: boolean; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - width?: number; -} -type baseviewEventName ='onBindRequest'|'onDestruct'; -interface baseview{ - adjust():void; - bind(target:any, rule?:WebixCallback, format?:string):void; - define(property:string, value:any):void; - destructor():void; - disable():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - hide():void; - isEnabled():boolean; - isVisible():boolean; - resize():void; - show(force?:boolean, animation?:boolean):void; - unbind():void; - - $getSize():any[]; - $height: number; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: baseviewConfig; - name: string; -} -interface protoConfig{ - view?: string; - animate?: any; - borderless?: boolean; - click?: string|WebixCallback; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - datathrottle?: number; - datatype?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - item?: any; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - on?: EventHash; - pager?: any; - ready?: WebixCallback; - removeMissed?: boolean; - rules?: any; - save?: string; - scheme?: any; - template?: string|WebixCallback; - tooltip?: string|boolean; - type?: any; - url?: string; - width?: number; -} -type protoEventName ='onAfterAdd'|'onAfterDelete'|'onAfterLoad'|'onAfterRender'|'onAfterScroll'|'onAfterSort'|'onBeforeAdd'|'onBeforeDelete'|'onBeforeLoad'|'onBeforeRender'|'onBeforeSort'|'onBindRequest'|'onBlur'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onFocus'|'onItemRender'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValidationError'|'onValidationSuccess'|'onViewResize'; -class proto implements webix.ui.baseview{ - add(obj:any, index?:number):string|number; - addCss(id:string|number, css:string, silent?:boolean):void; - adjust():void; - attachEvent(type:protoEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clearAll():void; - clearCss(css:string, silent?:boolean):void; - clearValidation():void; - count():number; - customize(obj:any):void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - find(criterion:WebixCallback, first?:boolean):any; - getChildViews():any[]; - getFirstId():string|number; - getFormView():webix.ui.baseview; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getItemNode(id:string|number):HTMLElement; - getLastId():string|number; - getNextId(id:string|number, step:number):string|number; - getNode():any; - getPage():number; - getPager():any; - getParentView():any; - getPrevId(id:string|number, step:number):string|number; - getTopParentView():webix.ui.baseview; - hasCss(id:string|number, css:string):boolean; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; - locate(e:Event):string|number; - mapEvent(map:any):void; - parse(data:any, type:string):void; - refresh(id?:string|number):void; - remove(id:string|number):void; - removeCss(id:string|number, css:string, silent?:boolean):void; - render(id:string|number, data:any, type:string):void; - resize():void; - serialize():any; - setPage(page:number):void; - show(force?:boolean, animation?:boolean):void; - showItem(id:string|number):void; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - updateItem(id:string|number, data:any):void; - validate(id?:string):boolean; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: protoConfig; - name: string; - type: { [key: string]: any; }; - types: { [key: string]: any; }; - data:DataStore; - waitData: webix.promise; -} -interface resizeareaConfig{ - view?: string; - border?: boolean; - container?: string|HTMLElement; - cursor?: string; - dir?: string; - eventPos?: number; - height?: number; - id?: string|number; - on?: EventHash; - start?: number; - width?: number; -} -type resizeareaEventName ='onResize'|'onResizeEnd'; -class resizearea{ - attachEvent(type:resizeareaEventName, functor:WebixCallback, id?:string):string|number; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - detachEvent(id:string):void; - hasEvent(name:string):boolean; - mapEvent(map:any):void; - unblockEvent():void; - - config: resizeareaConfig; - name: string; -} -interface viewConfig{ - view?: string; - animate?: any; - borderless?: boolean; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - width?: number; -} -type viewEventName ='onAfterScroll'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class view implements webix.ui.baseview{ - adjust():void; - bind(target:any, rule?:WebixCallback, format?:string):void; - define(property:string, value:any):void; - destructor():void; - disable():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - hide():void; - isEnabled():boolean; - isVisible():boolean; - resize():void; - show(force?:boolean, animation?:boolean):void; - unbind():void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: viewConfig; - name: string; -} -interface vscrollConfig{ - view?: string; - container?: string|HTMLElement; - id?: string|number; - on?: EventHash; - scroll?: string; - scrollHeight?: number; - scrollPos?: number; - scrollSize?: number; - scrollStep?: number; - scrollVisible?: boolean; - scrollWidth?: number; - zoom?: number; -} -type vscrollEventName ='onScroll'; -class vscroll{ - activeArea(node:HTMLElement):void; - attachEvent(type:vscrollEventName, functor:WebixCallback, id?:string):string|number; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - detachEvent(id:string):void; - getScroll():number; - getSize():number; - hasEvent(name:string):boolean; - mapEvent(map:any):void; - scrollTo(pos:number):void; - sizeTo(size:number):void; - unblockEvent():void; - - config: vscrollConfig; - name: string; -} -interface accordionConfig{ - view?: string; - animate?: any; - borderless?: boolean; - collapsed?: boolean; - cols?: any[]; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - isolate?: boolean; - margin?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - multi?: boolean|string; - on?: EventHash; - padding?: number; - paddingX?: number; - paddingY?: number; - panelClass?: string; - responsive?: string; - rows?: any[]; - type?: string; - visibleBatch?: string; - width?: number; -} -type accordionEventName ='onAfterCollapse'|'onAfterExpand'|'onBindRequest'|'onDestruct'; -class accordion implements webix.ui.baseview{ - addView(view:any, index?:number):string|number; - adjust():void; - attachEvent(type:accordionEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - hasEvent(name:string):boolean; - hide():void; - index(obj:any):number; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - reconstruct():void; - removeView(id:string|number):void; - resize():void; - resizeChildren():void; - show(force?:boolean, animation?:boolean):void; - showBatch(name:string):void; - unbind():void; - unblockEvent():void; - - $getSize():any[]; - $height: number; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: accordionConfig; - name: string; -} -interface accordionitemConfig{ - view?: string; - animate?: any; - body?: any; - borderless?: boolean; - collapsed?: boolean; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - header?: boolean|string|WebixCallback; - headerAlt?: string|WebixCallback; - headerAltHeight?: number; - headerHeight?: number; - height?: number; - hidden?: boolean; - id?: string|number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - mouseEventDelay?: number; - on?: EventHash; - onClick?: { [key: string]: any; }; - onContext?: { [key: string]: any; }; - onDblClick?: WebixCallback; - onMouseMove?: WebixCallback; - width?: number; -} -type accordionitemEventName ='onAfterContextMenu'|'onAfterScroll'|'onBeforeContextMenu'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onItemClick'|'onItemDblClick'|'onKeyPress'|'onLongTouch'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class accordionitem implements webix.ui.baseview{ - adjust():void; - attachEvent(type:accordionitemEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - collapse():void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - expand():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - resize():void; - show(force?:boolean, animation?:boolean):void; - unbind():void; - unblockEvent():void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: accordionitemConfig; - name: string; - on_click: WebixCallback; - on_context: { [key: string]: any; }; - on_dblclick: WebixCallback; - on_mouse_move: WebixCallback; -} -interface barcodeConfig{ - view?: string; - animate?: any; - ariaLabel?: string; - borderless?: boolean; - color?: string; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - paddingX?: number; - paddingY?: number; - textHeight?: number; - type?: string; - value?: string; - width?: number; -} -type barcodeEventName ='onAfterScroll'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class barcode implements webix.ui.baseview{ - adjust():void; - bind(target:any, rule?:WebixCallback, format?:string):void; - define(property:string, value:any):void; - destructor():void; - disable():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():string; - hide():void; - isEnabled():boolean; - isVisible():boolean; - render():void; - resize():void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - unbind():void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: barcodeConfig; - name: string; - types: any[]; -} -interface bulletConfig{ - view?: string; - animate?: any; - bands?: any[]; - barWidth?: number; - borderless?: boolean; - color?: string; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - flowTime?: number; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - label?: string; - labelHeight?: number; - labelWidth?: number; - layout?: string; - marker?: number|boolean; - maxHeight?: number; - maxRange?: number; - maxWidth?: number; - minHeight?: number; - minRange?: number; - minWidth?: number; - on?: EventHash; - placeholder?: string; - scale?: any; - smoothFlow?: boolean; - stroke?: number; - value?: number; - width?: number; -} -type bulletEventName ='onAfterScroll'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class bullet implements webix.ui.baseview{ - adjust():void; - attachEvent(type:bulletEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():number; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - resize():void; - setValue(new_value:number):void; - show(force?:boolean, animation?:boolean):void; - unbind():void; - unblockEvent():void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: bulletConfig; - name: string; -} -interface buttonConfig{ - view?: string; - align?: string; - animate?: any; - autowidth?: boolean; - badge?: number|string; - borderless?: boolean; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - id?: string|number; - image?: string; - inputHeight?: number; - inputWidth?: number; - label?: string; - labelPosition?: string; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - name?: string; - on?: EventHash; - placeholder?: string; - popup?: string; - tooltip?: string; - type?: string; - value?: string|number; - width?: number; -} -type buttonEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class button implements webix.ui.baseview{ - adjust():void; - attachEvent(type:buttonEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - - $compareValue: WebixCallback; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $renderInput(config:any):HTMLElement; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: buttonConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface calendarConfig{ - view?: string; - animate?: any; - blockDates?: WebixCallback; - borderless?: boolean; - calendarHeader?: string; - calendarTime?: string; - calendarWeekHeader?: string; - cellHeight?: number|string; - container?: string|HTMLElement; - css?: string; - date?: Date|string; - dayTemplate?: WebixCallback; - disabled?: boolean; - events?: WebixCallback; - gravity?: number; - headerHeight?: number; - height?: number; - hidden?: boolean; - icons?: any; - id?: string|number; - maxDate?: Date|string; - maxHeight?: number; - maxTime?: string; - maxWidth?: number; - minDate?: Date|string; - minHeight?: number; - minTime?: string; - minWidth?: number; - minuteStep?: number; - monthSelect?: boolean; - mouseEventDelay?: number; - navigation?: boolean; - on?: EventHash; - onClick?: { [key: string]: any; }; - onContext?: { [key: string]: any; }; - onDblClick?: WebixCallback; - onMouseMove?: WebixCallback; - select?: boolean; - skipEmptyWeeks?: boolean; - timepicker?: boolean; - timepickerHeight?: number; - type?: string; - weekHeader?: boolean; - weekNumber?: boolean; - width?: number; -} -type calendarEventName ='onAfterContextMenu'|'onAfterDateSelect'|'onAfterMonthChange'|'onAfterRender'|'onAfterScroll'|'onAfterZoom'|'onBeforeContextMenu'|'onBeforeDateSelect'|'onBeforeMonthChange'|'onBeforeRender'|'onBeforeZoom'|'onBindRequest'|'onBlur'|'onChange'|'onDateClear'|'onDateSelect'|'onDestruct'|'onFocus'|'onItemClick'|'onItemDblClick'|'onKeyPress'|'onLongTouch'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTodaySet'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class calendar implements webix.ui.baseview{ - adjust():void; - attachEvent(type:calendarEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getSelectedDate():any; - getTopParentView():webix.ui.baseview; - getValue():any; - getVisibleDate():any; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - locate(e:Event):string|number; - mapEvent(map:any):void; - moveSelection(direction:string):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - selectDate(date:string|Date, mode:boolean):void; - setValue(date:string|Date):void; - show(force?:boolean, animation?:boolean):void; - showCalendar(date:string|Date):void; - unbind():void; - unblockEvent():void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: calendarConfig; - name: string; - on_click: WebixCallback; - on_context: { [key: string]: any; }; - on_dblclick: WebixCallback; - on_mouse_move: WebixCallback; -} -interface carouselConfig{ - view?: string; - animate?: any; - borderless?: boolean; - cols?: any[]; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - navigation?: any; - on?: EventHash; - rows?: any[]; - scrollSpeed?: string; - type?: string; - width?: number; -} -type carouselEventName ='onAfterScroll'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onKeyPress'|'onLongTouch'|'onShow'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class carousel implements webix.ui.baseview{ - adjust():void; - adjustScroll():void; - attachEvent(type:carouselEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getActiveId():string; - getActiveIndex():number; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getLayout():any; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - resize():void; - scrollTo(x:number, y:number):void; - setActive(id:string):void; - setActiveIndex(index:number):void; - show(force?:boolean, animation?:boolean):void; - showNext():void; - showPrev():void; - unbind():void; - unblockEvent():void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: carouselConfig; - name: string; -} -interface chartConfig{ - view?: string; - alpha?: number; - animate?: any; - animateDuration?: number; - ariaLabel?: string; - barWidth?: number; - border?: boolean; - borderColor?: string; - borderless?: boolean; - cant?: number; - cellWidth?: number; - color?: string|WebixCallback; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - datathrottle?: number; - datatype?: string; - disableLines?: boolean; - disabled?: boolean; - dynamic?: boolean; - eventRadius?: number; - fill?: string; - fixOverflow?: boolean; - gradient?: boolean|string|WebixCallback; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - item?: any; - label?: string|WebixCallback; - labelOffset?: number; - legend?: any; - line?: any; - lineColor?: string; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - mouseEventDelay?: number; - offset?: boolean; - on?: EventHash; - onClick?: { [key: string]: any; }; - onContext?: { [key: string]: any; }; - onDblClick?: WebixCallback; - onMouseMove?: WebixCallback; - origin?: number; - padding?: any; - pieHeight?: number; - pieInnerText?: string|WebixCallback; - preset?: string; - radius?: number; - ready?: WebixCallback; - removeMissed?: boolean; - save?: string; - scale?: string; - scheme?: any; - series?: any; - shadow?: boolean; - tooltip?: string|boolean; - type?: string; - url?: string; - value?: string|WebixTemplate; - width?: number; - x?: number; - xAxis?: any; - xValue?: string; - y?: number; - yAxis?: any; - yValue?: string; -} -type chartEventName ='onAfterAdd'|'onAfterContextMenu'|'onAfterDelete'|'onAfterLoad'|'onAfterRender'|'onAfterScroll'|'onAfterSort'|'onBeforeAdd'|'onBeforeContextMenu'|'onBeforeDelete'|'onBeforeLoad'|'onBeforeRender'|'onBeforeSort'|'onBindRequest'|'onBlur'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onFocus'|'onItemClick'|'onItemDblClick'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class chart implements webix.ui.baseview{ - add(obj:any, index?:number):string|number; - addSeries(obj:any):void; - adjust():void; - attachEvent(type:chartEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clearAll():void; - clearCanvas():void; - count():number; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - find(criterion:WebixCallback, first?:boolean):any; - getChildViews():any[]; - getFirstId():string|number; - getFormView():webix.ui.baseview; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getLastId():string|number; - getNextId(id:string|number, step:number):string|number; - getNode():any; - getParentView():any; - getPrevId(id:string|number, step:number):string|number; - getTopParentView():webix.ui.baseview; - group(config:any, mode:boolean):void; - hasEvent(name:string):boolean; - hide():void; - hideSeries(series:string):void; - isEnabled():boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; - locate(e:Event):string|number; - mapEvent(map:any):void; - parse(data:any, type:string):void; - refresh(id?:string|number):void; - remove(id:string|number):void; - removeAllSeries():void; - render(id:string|number, data:any, type:string):void; - resize():void; - serialize():any; - show(force?:boolean, animation?:boolean):void; - showSeries(series:string):void; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - ungroup(mode:boolean):void; - updateItem(id:string|number, data:any):void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - colormap: { [key: string]: any; }; - config: chartConfig; - name: string; - on_click: WebixCallback; - on_context: { [key: string]: any; }; - on_dblclick: WebixCallback; - on_mouse_move: WebixCallback; - presets: { [key: string]: any; }; - data:DataStore; - waitData: webix.promise; -} -interface checkboxConfig{ - view?: string; - align?: string; - animate?: any; - attributes?: any; - autowidth?: boolean; - borderless?: boolean; - bottomLabel?: string; - bottomPadding?: number; - checkValue?: string; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - customCheckbox?: boolean; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - id?: string|number; - inputAlign?: string; - inputHeight?: number; - inputPadding?: number; - inputWidth?: number; - invalidMessage?: string; - label?: string; - labelAlign?: string; - labelPosition?: string; - labelRight?: string; - labelWidth?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - name?: string; - on?: EventHash; - popup?: string; - relatedAction?: string; - relatedView?: string; - required?: boolean; - suggest?: any; - tooltip?: string; - uncheckValue?: string; - validate?: WebixCallback; - validateEvent?: string; - value?: string|number; - width?: number; -} -type checkboxEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class checkbox implements webix.ui.baseview{ - adjust():void; - attachEvent(type:checkboxEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - setBottomText(text:string):void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - toggle():void; - unbind():void; - unblockEvent():void; - validate():boolean; - - $compareValue: WebixCallback; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $render: WebixCallback; - $renderIcon: WebixCallback; - $renderInput(obj:any, html:string, id:string|number):string; - $renderLabel(config:any, id:string|number):string; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: checkboxConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface checksuggestConfig{ - view?: string; - animate?: any; - autofit?: boolean; - autofocus?: boolean; - body?: string|webix.ui.baseview; - borderless?: boolean; - button?: boolean; - buttonText?: string; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - disabled?: boolean; - filter?: WebixCallback; - fitMaster?: boolean; - gravity?: number; - head?: any; - headHeight?: number; - height?: number; - hidden?: boolean; - id?: string|number; - input?: HTMLElement|string; - keyPressTimeout?: number; - left?: number; - master?: webix.ui.baseview; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - modal?: boolean; - move?: boolean; - on?: EventHash; - padding?: any; - position?: string|WebixCallback; - relative?: string; - resize?: boolean; - separator?: string; - template?: string|WebixTemplate; - textValue?: string; - toFront?: boolean; - top?: number; - type?: string; - url?: string; - value?: string|number; - width?: number; - zIndex?: number; -} -type checksuggestEventName ='onAfterScroll'|'onBeforeShow'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onHide'|'onKeyPress'|'onLongTouch'|'onShow'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValueSuggest'|'onViewMove'|'onViewMoveEnd'|'onViewResize'; -class checksuggest implements webix.ui.baseview{ - adjust():void; - attachEvent(type:checksuggestEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - close():void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getBody():any; - getButton():webix.ui.baseview; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getHead():any; - getItemText(id:string|number):string; - getList():webix.ui.list; - getMasterValue():any; - getNode():any; - getParentView():any; - getSuggestion():string; - getTopParentView():webix.ui.baseview; - getValue():string|number; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - linkInput(input:HTMLElement):void; - mapEvent(map:any):void; - resize():void; - resizeChildren():void; - setMasterValue(value:any):void; - setPosition(x:number, y:number):void; - setValue(value:string|number):void; - show(force?:boolean, animation?:boolean):void; - unbind():void; - unblockEvent():void; - - $enterKey: WebixCallback; - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: checksuggestConfig; - name: string; -} -interface colorboardConfig{ - view?: string; - animate?: any; - borderless?: boolean; - cols?: number; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - maxHeight?: number; - maxLightness?: number; - maxWidth?: number; - minHeight?: number; - minLightness?: number; - minWidth?: number; - navigation?: boolean; - on?: EventHash; - palette?: any[]; - rows?: number; - template?: WebixCallback; - value?: string; - width?: number; -} -type colorboardEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onKeyPress'|'onLongTouch'|'onSelect'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class colorboard implements webix.ui.baseview{ - adjust():void; - attachEvent(type:colorboardEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - moveSelection(direction:string):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - setValue(value:string):string; - show(force?:boolean, animation?:boolean):void; - unbind():void; - unblockEvent():void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: colorboardConfig; - name: string; -} -interface colorpickerConfig{ - view?: string; - align?: string; - animate?: any; - attributes?: any; - autowidth?: boolean; - borderless?: boolean; - bottomLabel?: string; - bottomPadding?: number; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - editable?: boolean; - format?: string; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - icons?: boolean; - id?: string|number; - inputAlign?: string; - inputHeight?: number; - inputPadding?: number; - inputWidth?: number; - invalid?: boolean; - invalidMessage?: string; - label?: string; - labelAlign?: string; - labelPosition?: string; - labelWidth?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - name?: string; - on?: EventHash; - placeholder?: string; - popup?: string; - readonly?: boolean; - relatedAction?: string; - relatedView?: string; - required?: boolean; - stringResult?: boolean; - suggest?: any; - timeIcon?: string; - timepicker?: boolean; - tooltip?: string; - validate?: WebixCallback; - validateEvent?: string; - value?: string|number; - width?: number; -} -type colorpickerEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class colorpicker implements webix.ui.baseview{ - adjust():void; - attachEvent(type:colorpickerEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getNode():any; - getParentView():any; - getPopup():webix.ui.baseview; - getText():string; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - setBottomText(text:string):void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - validate():boolean; - - $compareValue: WebixCallback; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $render: WebixCallback; - $renderIcon: WebixCallback; - $renderInput(obj:any, html:string, id:string|number):string; - $renderLabel(config:any, id:string|number):string; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: colorpickerConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface comboConfig{ - view?: string; - align?: string; - animate?: any; - attributes?: any; - autowidth?: boolean; - borderless?: boolean; - bottomLabel?: string; - bottomPadding?: number; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - editable?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - icon?: string; - id?: string|number; - inputAlign?: string; - inputHeight?: number; - inputPadding?: number; - inputWidth?: number; - invalid?: boolean; - invalidMessage?: string; - label?: string; - labelAlign?: string; - labelPosition?: string; - labelWidth?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - name?: string; - on?: EventHash; - options?: any; - placeholder?: string; - popup?: string; - popupWidth?: number; - readonly?: boolean; - relatedAction?: string; - relatedView?: string; - required?: boolean; - suggest?: any; - tooltip?: string; - type?: string; - validate?: WebixCallback; - validateEvent?: string; - value?: string|number; - width?: number; -} -type comboEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class combo implements webix.ui.baseview{ - adjust():void; - attachEvent(type:comboEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getList():webix.ui.list; - getNode():any; - getParentView():any; - getPopup():webix.ui.baseview; - getText():string; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - setBottomText(text:string):void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - validate():boolean; - - $compareValue: WebixCallback; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $render: WebixCallback; - $renderIcon: WebixCallback; - $renderInput(obj:any, html:string, id:string|number):string; - $renderLabel(config:any, id:string|number):string; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: comboConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface contextConfig{ - view?: string; - animate?: any; - autofit?: boolean; - autofocus?: boolean; - body?: string|webix.ui.baseview; - borderless?: boolean; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - head?: any; - headHeight?: number; - height?: number; - hidden?: boolean; - id?: string|number; - left?: number; - master?: string; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - modal?: boolean; - move?: boolean; - on?: EventHash; - padding?: any; - position?: string|WebixCallback; - relative?: string; - resize?: boolean; - toFront?: boolean; - top?: number; - width?: number; - zIndex?: number; -} -type contextEventName ='onAfterScroll'|'onBeforeShow'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onHide'|'onKeyPress'|'onLongTouch'|'onShow'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewMove'|'onViewMoveEnd'|'onViewResize'; -class context implements webix.ui.baseview{ - adjust():void; - attachEvent(type:contextEventName, functor:WebixCallback, id?:string):string|number; - attachTo(view:any):void; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - close():void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getBody():any; - getChildViews():any[]; - getContext():any; - getFormView():webix.ui.baseview; - getHead():any; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - resize():void; - resizeChildren():void; - setContext(context:any):void; - setPosition(x:number, y:number):void; - show(node?:HTMLElement, position?:any, point?:string):void; - unbind():void; - unblockEvent():void; - show(force:boolean,animation:boolean):void; - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: contextConfig; - name: string; -} -interface contextmenuConfig{ - view?: string; - animate?: any; - autofit?: boolean; - autofocus?: boolean; - autoheight?: boolean; - autowidth?: boolean; - body?: string|webix.ui.baseview; - borderless?: boolean; - click?: string|WebixCallback; - clipboard?: boolean|string; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - dataFeed?: string|WebixCallback; - datathrottle?: number; - datatype?: string; - disabled?: boolean; - drag?: boolean|string; - dragscroll?: boolean|string; - externalData?: WebixCallback; - gravity?: number; - head?: any; - headHeight?: number; - height?: number; - hidden?: boolean; - id?: string|number; - item?: any; - layout?: string; - left?: number; - master?: string; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - modal?: boolean; - mouseEventDelay?: number; - move?: boolean; - multiselect?: boolean; - navigation?: boolean; - on?: EventHash; - onClick?: { [key: string]: any; }; - onContext?: { [key: string]: any; }; - onDblClick?: WebixCallback; - onMouseMove?: WebixCallback; - openAction?: string; - padding?: any; - pager?: any; - position?: string|WebixCallback; - ready?: WebixCallback; - relative?: string; - removeMissed?: boolean; - resize?: boolean; - rules?: any; - save?: string; - scheme?: any; - scroll?: boolean|string; - scrollSpeed?: string; - select?: boolean|string; - subMenuPos?: string; - submenuConfig?: any; - template?: string|WebixCallback; - templateCopy?: WebixCallback; - toFront?: boolean; - tooltip?: string|boolean; - top?: number; - type?: any; - url?: string; - width?: number; - xCount?: number; - yCount?: number; - zIndex?: number; -} -type contextmenuEventName ='onAfterAdd'|'onAfterContextMenu'|'onAfterDelete'|'onAfterDrop'|'onAfterDropOrder'|'onAfterLoad'|'onAfterRender'|'onAfterScroll'|'onAfterSelect'|'onAfterSort'|'onBeforeAdd'|'onBeforeContextMenu'|'onBeforeDelete'|'onBeforeDrag'|'onBeforeDragIn'|'onBeforeDrop'|'onBeforeDropOrder'|'onBeforeDropOut'|'onBeforeLoad'|'onBeforeRender'|'onBeforeSelect'|'onBeforeShow'|'onBeforeSort'|'onBindRequest'|'onBlur'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onDragOut'|'onFocus'|'onHide'|'onItemClick'|'onItemDblClick'|'onItemRender'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onMenuItemClick'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onPaste'|'onSelectChange'|'onShow'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValidationError'|'onValidationSuccess'|'onViewMove'|'onViewMoveEnd'|'onViewResize'; -class contextmenu implements webix.ui.baseview{ - add(obj:any, index?:number):string|number; - addCss(id:string|number, css:string, silent?:boolean):void; - adjust():void; - attachEvent(type:contextmenuEventName, functor:WebixCallback, id?:string):string|number; - attachTo(view:any):void; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clearAll():void; - clearCss(css:string, silent?:boolean):void; - clearValidation():void; - close():void; - copy(sid:string|number, tindex:number, tobj?:any, details?:any):void; - count():number; - customize(obj:any):void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - disableItem(id:string|number):void; - enable():void; - enableItem(id:string|number):void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - find(criterion:WebixCallback, first?:boolean):any; - getBody():any; - getChildViews():any[]; - getContext():any; - getFirstId():string|number; - getFormView():webix.ui.baseview; - getHead():any; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getItemNode(id:string|number):HTMLElement; - getLastId():string|number; - getMenu(id:string|number):any; - getMenuItem(id:string|number):any; - getNextId(id:string|number, step:number):string|number; - getNode():any; - getPage():number; - getPager():any; - getParentView():any; - getPrevId(id:string|number, step:number):string|number; - getScrollState():any; - getSelectedId(as_array:boolean):string|any[]; - getSelectedItem(as_array:boolean):any; - getSubMenu(id:string|number):any; - getTopMenu():any; - getTopParentView():webix.ui.baseview; - getVisibleCount():number; - hasCss(id:string|number, css:string):boolean; - hasEvent(name:string):boolean; - hide():void; - hideItem(id:string|number):void; - isEnabled():boolean; - isSelected(id:string|number):boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; - locate(e:Event):string|number; - mapEvent(map:any):void; - move(sid:string, tindex:number, tobj?:any, details?:any):string; - moveBottom(id:string|number):void; - moveDown(id:string|number, step:number):void; - moveSelection(direction:string):void; - moveTop(id:string|number):void; - moveUp(id:string|number, step:number):void; - parse(data:any, type:string):void; - refresh(id?:string|number):void; - remove(id:string|number):void; - removeCss(id:string|number, css:string, silent?:boolean):void; - render(id:string|number, data:any, type:string):void; - resize():void; - resizeChildren():void; - scrollTo(x:number, y:number):void; - select(id:string|any[], preserve:boolean):void; - selectAll(from?:string, to?:string):void; - serialize():any; - setContext(context:any):void; - setPage(page:number):void; - setPosition(x:number, y:number):void; - show(node?:HTMLElement, position?:any, point?:string):void; - showItem(id:string|number):void; - sizeToContent():void; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - unselect(id?:string):void; - unselectAll():void; - updateItem(id:string|number, data:any):void; - validate(id?:string):boolean; - show(force:boolean,animation:boolean):void; - $drag(source:HTMLElement, ev:Event):string; - $dragHTML: WebixCallback; - $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; - $dragMark(context:any, ev:Event):boolean; - $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; - $drop(source:HTMLElement, target:HTMLElement, ev:Event):void; - $dropAllow: WebixCallback; - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: contextmenuConfig; - name: string; - on_click: WebixCallback; - on_context: { [key: string]: any; }; - on_dblclick: WebixCallback; - on_mouse_move: WebixCallback; - type: { [key: string]: any; }; - types: { [key: string]: any; }; - data:DataStore; - waitData: webix.promise; -} -interface counterConfig{ - view?: string; - align?: string; - animate?: any; - attributes?: any; - autowidth?: boolean; - borderless?: boolean; - bottomLabel?: string; - bottomPadding?: number; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - id?: string|number; - inputAlign?: string; - inputHeight?: number; - inputPadding?: number; - inputWidth?: number; - invalidMessage?: string; - label?: string; - labelAlign?: string; - labelPosition?: string; - labelWidth?: number; - max?: number; - maxHeight?: number; - maxWidth?: number; - min?: number; - minHeight?: number; - minWidth?: number; - name?: string; - on?: EventHash; - popup?: string; - relatedAction?: string; - relatedView?: string; - required?: boolean; - step?: number; - suggest?: any; - tooltip?: string; - validate?: WebixCallback; - validateEvent?: string; - value?: string|number; - width?: number; -} -type counterEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class counter implements webix.ui.baseview{ - adjust():void; - attachEvent(type:counterEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():number; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - next(step?:number):void; - prev(step?:number):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - setBottomText(text:string):void; - setValue(value:number):void; - shift(value?:number):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - validate():boolean; - - $compareValue: WebixCallback; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $render: WebixCallback; - $renderIcon: WebixCallback; - $renderInput(obj:any, html:string, id:string|number):string; - $renderLabel(config:any, id:string|number):string; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: counterConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface datasuggestConfig{ - view?: string; - animate?: any; - autofit?: boolean; - autofocus?: boolean; - body?: string|webix.ui.baseview; - borderless?: boolean; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - disabled?: boolean; - filter?: WebixCallback; - fitMaster?: boolean; - gravity?: number; - head?: any; - headHeight?: number; - height?: number; - hidden?: boolean; - id?: string|number; - input?: HTMLElement|string; - keyPressTimeout?: number; - left?: number; - master?: webix.ui.baseview; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - modal?: boolean; - move?: boolean; - on?: EventHash; - padding?: any; - position?: string|WebixCallback; - relative?: string; - resize?: boolean; - template?: string|WebixTemplate; - textValue?: string; - toFront?: boolean; - top?: number; - type?: string; - url?: string; - width?: number; - zIndex?: number; -} -type datasuggestEventName ='onAfterScroll'|'onBeforeShow'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onHide'|'onKeyPress'|'onLongTouch'|'onShow'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValueSuggest'|'onViewMove'|'onViewMoveEnd'|'onViewResize'; -class datasuggest implements webix.ui.baseview{ - adjust():void; - attachEvent(type:datasuggestEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - close():void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getBody():any; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getHead():any; - getItemText(id:string|number):string; - getList():webix.ui.list; - getMasterValue():any; - getNode():any; - getParentView():any; - getSuggestion():string; - getTopParentView():webix.ui.baseview; - getValue():string|number; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - linkInput(input:HTMLElement):void; - mapEvent(map:any):void; - resize():void; - resizeChildren():void; - setMasterValue(value:any):void; - setPosition(x:number, y:number):void; - setValue(value:string|number):void; - show(node:HTMLElement, position?:any, point?:string):void; - unbind():void; - unblockEvent():void; - show(force:boolean,animation:boolean):void; - $enterKey: WebixCallback; - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: datasuggestConfig; - name: string; -} -interface datatableConfig{ - view?: string; - animate?: any; - areaselect?: boolean; - autoConfig?: boolean; - autoheight?: boolean; - autowidth?: boolean; - blockselect?: boolean|string; - borderless?: boolean; - checkboxRefresh?: boolean; - clipboard?: boolean|string; - columnWidth?: number; - columns?: any[]; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - dataFeed?: string|WebixCallback; - datafetch?: number; - datathrottle?: number; - datatype?: string; - delimiter?: any; - disabled?: boolean; - drag?: boolean|string; - dragColumn?: boolean|string; - dragscroll?: boolean|string; - editMath?: boolean; - editValue?: string; - editable?: boolean; - editaction?: string; - externalData?: WebixCallback; - filterMode?: any; - fixedRowHeight?: boolean; - footer?: boolean; - form?: string; - gravity?: number; - header?: boolean; - headerRowHeight?: number; - headermenu?: any; - height?: number; - hidden?: boolean; - hover?: string; - id?: string|number; - leftSplit?: number; - liveValidation?: boolean; - loadahead?: number; - map?: any; - math?: boolean; - maxHeight?: number; - maxWidth?: number; - minColumnHeight?: number; - minColumnWidth?: number; - minHeight?: number; - minWidth?: number; - mouseEventDelay?: number; - multiselect?: boolean; - navigation?: boolean; - on?: EventHash; - onClick?: { [key: string]: any; }; - onContext?: { [key: string]: any; }; - onDblClick?: WebixCallback; - onMouseMove?: WebixCallback; - pager?: any; - prerender?: boolean; - ready?: WebixCallback; - removeMissed?: boolean; - resizeColumn?: any; - resizeRow?: boolean; - rightSplit?: number; - rowHeight?: number; - rowLineHeight?: number; - rules?: any; - save?: string; - scheme?: any; - scroll?: boolean|string; - scrollAlignY?: boolean; - scrollX?: boolean; - scrollY?: boolean; - select?: boolean|string; - spans?: any[]; - subRowHeight?: string; - subrow?: string; - subview?: webix.ui.baseview; - tooltip?: boolean; - topSplit?: number; - type?: any; - url?: string; - width?: number; - yCount?: number; -} -type datatableEventName ='onAfterAdd'|'onAfterAreaAdd'|'onAfterAreaRemove'|'onAfterBlockSelect'|'onAfterColumnDrop'|'onAfterColumnDropOrder'|'onAfterColumnHide'|'onAfterColumnShow'|'onAfterContextMenu'|'onAfterDelete'|'onAfterDrop'|'onAfterDropOrder'|'onAfterEditStart'|'onAfterEditStop'|'onAfterFilter'|'onAfterLoad'|'onAfterRender'|'onAfterScroll'|'onAfterSelect'|'onAfterSort'|'onAfterUnSelect'|'onAreaDrag'|'onBeforeAdd'|'onBeforeAreaAdd'|'onBeforeAreaRemove'|'onBeforeBlockSelect'|'onBeforeColumnDrag'|'onBeforeColumnDrop'|'onBeforeColumnDropOrder'|'onBeforeColumnHide'|'onBeforeColumnShow'|'onBeforeContextMenu'|'onBeforeDelete'|'onBeforeDrag'|'onBeforeDragIn'|'onBeforeDrop'|'onBeforeDropOrder'|'onBeforeDropOut'|'onBeforeEditStart'|'onBeforeEditStop'|'onBeforeFilter'|'onBeforeLoad'|'onBeforeRender'|'onBeforeSelect'|'onBeforeSort'|'onBeforeUnSelect'|'onBindRequest'|'onBlur'|'onCheck'|'onCollectValues'|'onColumnResize'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onDragOut'|'onEditorChange'|'onFocus'|'onHeaderClick'|'onItemClick'|'onItemDblClick'|'onKeyPress'|'onLiveEdit'|'onLoadError'|'onLongTouch'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onResize'|'onRowResize'|'onScrollX'|'onScrollY'|'onSelectChange'|'onStructureLoad'|'onStructureUpdate'|'onSubViewClose'|'onSubViewCreate'|'onSubViewOpen'|'onSubViewRender'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValidationError'|'onValidationSuccess'|'onViewResize'; -class datatable implements webix.ui.baseview{ - add(obj:any, index?:number):string|number; - addCellCss(id:string, name:string, css:string):void; - addCss(id:string|number, css:string, silent?:boolean):void; - addRowCss(id:string, css:string):void; - addSelectArea(start:any, end:any, preserve:boolean, area_name?:string, css?:string, handle?:boolean):void; - addSpan(id:any, column:string, width:number, height:number, value?:string, css?:string):void; - adjust():void; - adjustColumn(id:string|number, header?:string):void; - adjustRowHeight(columnId:string, silent:boolean):void; - attachEvent(type:datatableEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clearAll():void; - clearCss(css:string, silent?:boolean):void; - clearSelection():void; - clearValidation():void; - closeSub(id:string|number):void; - collectValues(id:string|number):any[]; - columnId(index:number):string|number; - copy(sid:string|number, tindex:number, tobj?:any, details?:any):void; - count():number; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - eachColumn(handler:WebixCallback, all?:boolean):void; - eachRow(handler:WebixCallback, all?:boolean):void; - edit(id:any):void; - editCancel():void; - editCell(row:string|number, col:string|number, preserve?:boolean, show?:boolean):void; - editColumn(id:string):void; - editNext():boolean; - editRow(id:string):void; - editStop():void; - enable():void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - filterByAll():void; - find(criterion:WebixCallback, first?:boolean):any; - focusEditor():void; - freezeRow(id:number|string, state:boolean):void; - getAllSelectAreas():any; - getChildViews():any[]; - getColumnConfig(id:string):any; - getColumnIndex(id:string|number):number; - getCss(rowId:string|number, columnId:string|number):string; - getEditState():any; - getEditor(row?:any, column?:string|number):any; - getEditorValue():string; - getFilter(columnID:string|number):any; - getFirstId():string|number; - getFormView():webix.ui.baseview; - getHeaderContent(id:string|number):{ [key: string]: any; }; - getHeaderNode(columnId:string, rowIndex?:number):HTMLElement; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getItemNode(id:string|number):HTMLElement; - getLastId():string|number; - getNextId(id:string|number, step:number):string|number; - getNode():any; - getPage():number; - getPager():any; - getParentView():any; - getPrevId(id:string|number, step:number):string|number; - getScrollState():any; - getSelectArea(area_name:string):any; - getSelectedId(asArray:boolean, asString:boolean):any; - getSelectedItem(as_array?:boolean):any; - getSpan():any[]; - getState():any; - getSubView(id:string|number):any; - getText(rowid:string|number, colid:string|number):string; - getTopParentView():webix.ui.baseview; - getVisibleCount():number; - group(config:any, mode:boolean):void; - hasCss(id:string|number, css:string):boolean; - hasEvent(name:string):boolean; - hide():void; - hideColumn(id:string|number):void; - hideOverlay():void; - isColumnVisible(id:string|number):boolean; - isEnabled():boolean; - isSelected(id:string|number):void; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; - locate(node:HTMLElement|Event):any; - mapCells(startrow:number, startcol:string, numrows:number, numcols:number, callback:WebixCallback):void; - mapEvent(map:any):void; - mapSelection(callback:WebixCallback):void; - markSorting(column_id:string, direction:string):void; - move(sid:string, tindex:number, tobj?:any, details?:any):string; - moveBottom(id:string|number):void; - moveColumn(id:string, index:number):void; - moveDown(id:string|number, step:number):void; - moveSelection(direction:string):void; - moveTop(id:string|number):void; - moveUp(id:string|number, step:number):void; - openSub(id:string|number):void; - parse(data:any, type:string):void; - refresh(id?:string|number):void; - refreshColumns(config?:any[], reset?:boolean):void; - refreshFilter(id:string|number):void; - refreshHeaderContent():void; - refreshSelectArea():void; - registerFilter(object:any, config:any, controller:any):void; - remove(id:string|number):void; - removeCellCss(id:string, name:string, css_name:string):void; - removeCss(id:string|number, css:string, silent?:boolean):void; - removeRowCss(id:string, css_name:string):void; - removeSelectArea(area_name:string):void; - removeSpan(id:string|number, column:string):void; - render(id:string|number, data:any, operation:string):void; - resize():void; - resizeSubView(id:string|number):void; - scrollTo(x:number, y:number):void; - select(row_id:string|number, preserve:boolean):void; - selectAll():void; - selectRange(row_id:string|number, end_row_id:string|number, preserve?:boolean):void; - serialize():any; - setColumnWidth(id:string|number, width:number):void; - setPage(page:number):void; - setRowHeight(id:string|number, height:number):void; - setState(state:any):void; - show(force?:boolean, animation?:boolean):void; - showCell(row:string, column:string):void; - showColumn(id:string|number):void; - showColumnBatch(batch:string|number, preserve:boolean):void; - showItem(id:string|number):void; - showItemByIndex(index:number):void; - showOverlay(message:string):void; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - ungroup(mode:boolean):void; - unselect(row_id:string|number):void; - unselectAll():void; - updateItem(id:string|number, data:any):void; - validate(id?:string):boolean; - validateEditor(id?:string|number):boolean; - - $drag(source:HTMLElement, ev:Event):string; - $dragHTML: WebixCallback; - $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; - $dragMark(context:any, ev:Event):boolean; - $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; - $drop(source:HTMLElement, target:HTMLElement, ev:Event):void; - $dropAllow: WebixCallback; - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: datatableConfig; - headerContent: any; - name: string; - on_click: WebixCallback; - on_context: { [key: string]: any; }; - on_dblclick: WebixCallback; - on_mouse_move: WebixCallback; - data:DataStore; - waitData: webix.promise; -} -interface dataviewConfig{ - view?: string; - animate?: any; - autoheight?: boolean; - borderless?: boolean; - click?: string|WebixCallback; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - datafetch?: number; - datathrottle?: number; - datatype?: string; - disabled?: boolean; - drag?: boolean|string; - dragscroll?: boolean|string; - externalData?: WebixCallback; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - item?: any; - loadahead?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - mouseEventDelay?: number; - multiselect?: boolean; - navigation?: boolean; - on?: EventHash; - onClick?: { [key: string]: any; }; - onContext?: { [key: string]: any; }; - onDblClick?: WebixCallback; - onMouseMove?: WebixCallback; - pager?: any; - ready?: WebixCallback; - removeMissed?: boolean; - rules?: any; - save?: string; - scheme?: any; - scroll?: boolean|string; - scrollSpeed?: string; - select?: boolean|string; - template?: string|WebixCallback; - tooltip?: string|boolean; - type?: any; - url?: string; - width?: number; - xCount?: number; - yCount?: number; -} -type dataviewEventName ='onAfterAdd'|'onAfterContextMenu'|'onAfterDelete'|'onAfterDrop'|'onAfterDropOrder'|'onAfterLoad'|'onAfterRender'|'onAfterScroll'|'onAfterSelect'|'onAfterSort'|'onBeforeAdd'|'onBeforeContextMenu'|'onBeforeDelete'|'onBeforeDrag'|'onBeforeDragIn'|'onBeforeDrop'|'onBeforeDropOrder'|'onBeforeDropOut'|'onBeforeLoad'|'onBeforeRender'|'onBeforeSelect'|'onBeforeSort'|'onBindRequest'|'onBlur'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onDragOut'|'onFocus'|'onItemClick'|'onItemDblClick'|'onItemRender'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onSelectChange'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValidationError'|'onValidationSuccess'|'onViewResize'; -class dataview implements webix.ui.baseview{ - add(obj:any, index?:number):string|number; - addCss(id:string|number, css:string, silent?:boolean):void; - adjust():void; - attachEvent(type:dataviewEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clearAll():void; - clearCss(css:string, silent?:boolean):void; - clearValidation():void; - copy(sid:string|number, tindex:number, tobj?:any, details?:any):void; - count():number; - customize(obj:any):void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - find(criterion:WebixCallback, first?:boolean):any; - getChildViews():any[]; - getFirstId():string|number; - getFormView():webix.ui.baseview; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getItemNode(id:string|number):HTMLElement; - getLastId():string|number; - getNextId(id:string|number, step:number):string|number; - getNode():any; - getPage():number; - getPager():any; - getParentView():any; - getPrevId(id:string|number, step:number):string|number; - getScrollState():any; - getSelectedId(as_array:boolean):string|any[]; - getSelectedItem(as_array:boolean):any; - getTopParentView():webix.ui.baseview; - hasCss(id:string|number, css:string):boolean; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isSelected(id:string|number):boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; - locate(e:Event):string|number; - mapEvent(map:any):void; - move(sid:string, tindex:number, tobj?:any, details?:any):string; - moveBottom(id:string|number):void; - moveDown(id:string|number, step:number):void; - moveSelection(direction:string):void; - moveTop(id:string|number):void; - moveUp(id:string|number, step:number):void; - parse(data:any, type:string):void; - refresh(id?:string|number):void; - remove(id:string|number):void; - removeCss(id:string|number, css:string, silent?:boolean):void; - render(id:string|number, data:any, type:string):void; - resize():void; - scrollTo(x:number, y:number):void; - select(id:string|any[], preserve:boolean):void; - selectAll(from?:string, to?:string):void; - serialize():any; - setPage(page:number):void; - show(force?:boolean, animation?:boolean):void; - showItem(id:string|number):void; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - unselect(id?:string):void; - unselectAll():void; - updateItem(id:string|number, data:any):void; - validate(id?:string):boolean; - - $drag(source:HTMLElement, ev:Event):string; - $dragHTML: WebixCallback; - $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; - $dragMark(context:any, ev:Event):boolean; - $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; - $drop(source:HTMLElement, target:HTMLElement, ev:Event):void; - $dropAllow: WebixCallback; - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: dataviewConfig; - name: string; - on_click: WebixCallback; - on_context: { [key: string]: any; }; - on_dblclick: WebixCallback; - on_mouse_move: WebixCallback; - type: { [key: string]: any; }; - types: { [key: string]: any; }; - data:DataStore; - waitData: webix.promise; -} -interface daterangeConfig{ - view?: string; - animate?: any; - borderless?: boolean; - button?: boolean; - calendarCount?: number; - calendarHeight?: number; - cols?: any[]; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - icons?: boolean|object; - id?: string|number; - isolate?: boolean; - margin?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - on?: EventHash; - padding?: number; - paddingX?: number; - paddingY?: number; - responsive?: string; - rows?: any[]; - timepicker?: boolean; - type?: string; - value?: any; - visibleBatch?: string; - width?: number; -} -type daterangeEventName ='onAfterDateSelect'|'onBeforeDateSelect'|'onBindRequest'|'onAfterDateSelect'|'onDateClear'|'onDestruct'|'onTodaySet'; -class daterange implements webix.ui.baseview{ - addToRange():void; - addView(view:any, index?:number):string|number; - adjust():void; - attachEvent(type:daterangeEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():any; - hasEvent(name:string):boolean; - hide():void; - index(obj:any):number; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - reconstruct():void; - refresh():void; - removeView(id:string|number):void; - resize():void; - resizeChildren():void; - setValue(range:any):void; - show(force?:boolean, animation?:boolean):void; - showBatch(name:string):void; - unbind():void; - unblockEvent():void; - - $getSize():any[]; - $height: number; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: daterangeConfig; - name: string; -} -interface daterangepickerConfig{ - view?: string; - align?: string; - animate?: any; - attributes?: any; - autowidth?: boolean; - borderless?: boolean; - bottomLabel?: string; - bottomPadding?: number; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - editable?: boolean; - format?: string; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - icon?: string; - icons?: boolean; - id?: string|number; - inputAlign?: string; - inputHeight?: number; - inputPadding?: number; - inputWidth?: number; - invalid?: boolean; - invalidMessage?: string; - label?: string; - labelAlign?: string; - labelPosition?: string; - labelWidth?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - name?: string; - on?: EventHash; - pattern?: any; - placeholder?: string; - popup?: string; - readonly?: boolean; - relatedAction?: string; - relatedView?: string; - required?: boolean; - stringResult?: boolean; - suggest?: any; - timeIcon?: string; - timepicker?: boolean; - tooltip?: string; - type?: string; - validate?: WebixCallback; - validateEvent?: string; - value?: string|number; - width?: number; -} -type daterangepickerEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class daterangepicker implements webix.ui.baseview{ - adjust():void; - attachEvent(type:daterangepickerEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getNode():any; - getParentView():any; - getPopup():webix.ui.baseview; - getText():string; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - setBottomText(text:string):void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - validate():boolean; - - $compareValue: WebixCallback; - $cssName: string; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $render: WebixCallback; - $renderIcon: WebixCallback; - $renderInput(config:any):HTMLElement; - $renderLabel(config:any, id:string|number):string; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: daterangepickerConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface daterangesuggestConfig{ - view?: string; - animate?: any; - autofit?: boolean; - autofocus?: boolean; - body?: string|webix.ui.baseview; - borderless?: boolean; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - disabled?: boolean; - filter?: WebixCallback; - fitMaster?: boolean; - gravity?: number; - head?: any; - headHeight?: number; - height?: number; - hidden?: boolean; - id?: string|number; - input?: HTMLElement|string; - keyPressTimeout?: number; - left?: number; - master?: webix.ui.baseview; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - modal?: boolean; - move?: boolean; - on?: EventHash; - padding?: any; - position?: string|WebixCallback; - relative?: string; - resize?: boolean; - template?: string|WebixTemplate; - textValue?: string; - toFront?: boolean; - top?: number; - type?: string; - url?: string; - width?: number; - zIndex?: number; -} -type daterangesuggestEventName ='onAfterScroll'|'onBeforeShow'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onHide'|'onKeyPress'|'onLongTouch'|'onShow'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValueSuggest'|'onViewMove'|'onViewMoveEnd'|'onViewResize'; -class daterangesuggest implements webix.ui.baseview{ - adjust():void; - attachEvent(type:daterangesuggestEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - close():void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getBody():any; - getButton():webix.ui.baseview; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getHead():any; - getItemText(id:string|number):string; - getList():webix.ui.list; - getMasterValue():any; - getNode():any; - getParentView():any; - getRange():webix.ui.baseview; - getSuggestion():string; - getTopParentView():webix.ui.baseview; - getValue():string|number; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - linkInput(input:HTMLElement):void; - mapEvent(map:any):void; - resize():void; - resizeChildren():void; - setMasterValue(value:any):void; - setPosition(x:number, y:number):void; - setValue(value:string|number):void; - show(force?:boolean, animation?:boolean):void; - unbind():void; - unblockEvent():void; - - $enterKey: WebixCallback; - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: daterangesuggestConfig; - name: string; -} -interface datepickerConfig{ - view?: string; - align?: string; - animate?: any; - attributes?: any; - autowidth?: boolean; - borderless?: boolean; - bottomLabel?: string; - bottomPadding?: number; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - editable?: boolean; - format?: string; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - icon?: string; - icons?: boolean; - id?: string|number; - inputAlign?: string; - inputHeight?: number; - inputPadding?: number; - inputWidth?: number; - invalid?: boolean; - invalidMessage?: string; - label?: string; - labelAlign?: string; - labelPosition?: string; - labelWidth?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - name?: string; - on?: EventHash; - placeholder?: string; - popup?: string; - readonly?: boolean; - relatedAction?: string; - relatedView?: string; - required?: boolean; - stringResult?: boolean; - suggest?: any; - timeIcon?: string; - timepicker?: boolean; - tooltip?: string; - type?: string; - validate?: WebixCallback; - validateEvent?: string; - value?: Date|string; - width?: number; -} -type datepickerEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class datepicker implements webix.ui.baseview{ - adjust():void; - attachEvent(type:datepickerEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getNode():any; - getParentView():any; - getPopup():webix.ui.baseview; - getText():string; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - setBottomText(text:string):void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - validate():boolean; - - $compareValue: WebixCallback; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $render: WebixCallback; - $renderIcon: WebixCallback; - $renderInput(obj:any, html:string, id:string|number):string; - $renderLabel(config:any, id:string|number):string; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: datepickerConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface dbllistConfig{ - view?: string; - animate?: any; - borderless?: boolean; - buttons?: string|boolean; - cols?: any[]; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - dataFeed?: string|WebixCallback; - datatype?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - isolate?: boolean; - labelBottomLeft?: string; - labelBottomRight?: string; - labelLeft?: string; - labelRight?: string; - list?: any; - margin?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - on?: EventHash; - padding?: number; - paddingX?: number; - paddingY?: number; - responsive?: string; - rows?: any[]; - type?: string; - url?: string; - value?: string|any[]; - visibleBatch?: string; - width?: number; -} -type dbllistEventName ='onAfterLoad'|'onBeforeLoad'|'onBindRequest'|'onChange'|'onDestruct'|'onLoadError'; -class dbllist implements webix.ui.baseview{ - addView(view:any, index?:number):string|number; - adjust():void; - attachEvent(type:dbllistEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - index(obj:any):number; - innerId(id:number|string):number|string; - isEnabled():boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - mapEvent(map:any):void; - parse(data:any, type:string):void; - reconstruct():void; - removeView(id:string|number):void; - resize():void; - resizeChildren():void; - select(id:string|any[], mode:boolean):void; - setValue(ids:string|any[]):void; - show(force?:boolean, animation?:boolean):void; - showBatch(name:string):void; - ui(view:any):webix.ui.baseview; - unbind():void; - unblockEvent():void; - - $$: any; - $getSize():any[]; - $height: number; - $onLoad: WebixCallback; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: dbllistConfig; - name: string; -} -interface fieldsetConfig{ - view?: string; - $cssName?: string; - animate?: any; - body?: webix.ui.baseview; - borderless?: boolean; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - label?: string; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - paddingX?: number; - paddingY?: number; - width?: number; -} -type fieldsetEventName ='onAfterScroll'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class fieldset implements webix.ui.baseview{ - adjust():void; - bind(target:any, rule?:WebixCallback, format?:string):void; - define(property:string, value:any):void; - destructor():void; - disable():void; - enable():void; - getBody():any; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - hide():void; - isEnabled():boolean; - isVisible():boolean; - resize():void; - resizeChildren():void; - show(force?:boolean, animation?:boolean):void; - unbind():void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: fieldsetConfig; - name: string; -} -interface filemanagerConfig{ - view?: string; - animate?: any; - borderless?: boolean; - cols?: any[]; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - datathrottle?: number; - datatype?: string; - disabled?: boolean; - disabledHistory?: boolean; - filterMode?: any; - gravity?: number; - handlers?: any; - height?: number; - hidden?: boolean; - icons?: any; - id?: string|number; - isolate?: boolean; - margin?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - mode?: string; - modes?: any[]; - noFileCache?: boolean; - on?: EventHash; - padding?: number; - paddingX?: number; - paddingY?: number; - readonly?: boolean; - ready?: WebixCallback; - removeMissed?: boolean; - responsive?: string; - rows?: any[]; - save?: string; - scheme?: any; - structure?: any; - templateCreate?: WebixCallback; - templateDate?: WebixCallback; - templateIcon?: WebixCallback; - templateName?: WebixCallback; - templateSize?: WebixCallback; - templateType?: WebixCallback; - type?: string; - uploadProgress?: any; - url?: string; - visibleBatch?: string; - width?: number; -} -type filemanagerEventName ='onAfterAdd'|'onAfterBack'|'onAfterCreateFolder'|'onAfterDelete'|'onAfterDeleteFile'|'onAfterDrop'|'onAfterDynParse'|'onAfterEditFile'|'onAfterEditStop'|'onAfterFileUpload'|'onAfterHideTree'|'onAfterLevelDown'|'onAfterLevelUp'|'onAfterLoad'|'onAfterMarkCopy'|'onAfterMarkCut'|'onAfterMenu'|'onAfterModeChange'|'onAfterPasteFile'|'onAfterPathClick'|'onAfterRun'|'onAfterSearch'|'onAfterShowTree'|'onAfterSort'|'onAfterUploadDialog'|'onBeforeAdd'|'onBeforeBack'|'onBeforeCreateFolder'|'onBeforeDelete'|'onBeforeDeleteFile'|'onBeforeDrag'|'onBeforeDragIn'|'onBeforeDrop'|'onBeforeDynLoad'|'onBeforeDynParse'|'onBeforeEditFile'|'onBeforeEditStop'|'onBeforeFileUpload'|'onBeforeHideTree'|'onBeforeLevelDown'|'onBeforeLevelUp'|'onBeforeLoad'|'onBeforeMarkCopy'|'onBeforeMarkCut'|'onBeforeMenu'|'onBeforeModeChange'|'onBeforePasteFile'|'onBeforeRequest'|'onBeforeRun'|'onBeforeSearch'|'onBeforeSearchRequest'|'onBeforeShowTree'|'onBeforeSort'|'onBeforeUploadDialog'|'onBindRequest'|'onComponentInit'|'onCopyError'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onDynLoadError'|'onErrorResponse'|'onFolderSelect'|'onHideSearchResults'|'onHistoryChange'|'onItemRename'|'onItemSelect'|'onLoadError'|'onMoveError'|'onPathComplete'|'onPathLevel'|'onShowSearchResults'|'onSuccessResponse'|'onViewInit'; -class filemanager implements webix.ui.baseview{ - add(obj:any, index?:number):string|number; - addView(view:any, index?:number):string|number; - adjust():void; - attachEvent(type:filemanagerEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clearAll():void; - copy(sid:string|number, tindex:number, tobj?:webix.ui.baseview, details?:any):string|number; - copyFile(source:string|any[], target:string):void; - count():number; - createFolder(targetId:string):void; - define(property:string, value:any):void; - deleteFile(ids:string|any[]):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - download(id:string):void; - editFile(id:string):void; - enable():void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - find(criterion:WebixCallback, first?:boolean):any; - getActive():string; - getActiveView():any; - getBranchIndex(id:string|number, parent?:string|number):number; - getChildViews():any[]; - getCurrentFolder():string; - getFirstChildId(id:string|number):string; - getFirstId():string|number; - getFormView():webix.ui.baseview; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getLastId():string|number; - getMenu():any; - getNextId(id:string|number, step:number):string|number; - getNextSiblingId(id:string|number):string|number; - getNode():any; - getParentId(id:string|number):string|number; - getParentView():any; - getPath(id:string):any[]; - getPathNames(id:string):any[]; - getPrevId(id:string|number, step:number):string|number; - getPrevSiblingId(id:string|number):string|number; - getSearchData(id:string, text:string):any[]; - getSelectedFile():string|any[]; - getTopParentView():webix.ui.baseview; - getUploader():any; - goBack(step:number):void; - goForward(step:number):void; - hasEvent(name:string):boolean; - hide():void; - hideProgress():void; - hideSearchResults():void; - hideTree():void; - index(obj:any):number; - innerId(id:number|string):number|string; - isBranch(id:string|number):boolean; - isEnabled():boolean; - isVisible():boolean; - levelUp(id:string):void; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - loadBranch(id:string|number, callback:WebixCallback, url:string):void; - loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; - mapEvent(map:any):void; - markCopy(id:string|any[]):void; - markCut(id:string|any[]):void; - move(sid:string, tindex:number, tobj?:any, details?:any):string; - moveFile(source:string, target:string):void; - openFolders(folders:any[]):void; - parse(data:any, type:string):void; - pasteFile(id:string):void; - reconstruct():void; - refresh(id?:string|number):void; - remove(id:string|number):void; - removeView(id:string|number):void; - renameFile(id:string, name:string, property:string):void; - resize():void; - resizeChildren():void; - serialize():any; - setPath(id:string):void; - show(force?:boolean, animation?:boolean):void; - showBatch(name:string):void; - showProgress(config?:any):void; - showSearchResults(text:string):void; - showTree():void; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - ui(view:any):webix.ui.baseview; - unbind():void; - unblockEvent():void; - updateItem(id:string|number, data:any):void; - uploadFile(target:string):void; - - $$: any; - $dropAllow: WebixCallback; - $getSize():any[]; - $height: number; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: filemanagerConfig; - name: string; - data:DataStore; - waitData: webix.promise; -} -interface formConfig{ - view?: string; - animate?: any; - autoheight?: boolean; - borderless?: boolean; - cols?: any[]; - complexData?: boolean; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - dataFeed?: string|WebixCallback; - datatype?: string; - disabled?: boolean; - elements?: any[]; - elementsConfig?: { [key: string]: any; }; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - isolate?: boolean; - margin?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - on?: EventHash; - padding?: number; - paddingX?: number; - paddingY?: number; - responsive?: string; - rows?: any[]; - rules?: any; - scroll?: boolean|string; - scrollSpeed?: string; - type?: string; - url?: string; - visibleBatch?: string; - width?: number; -} -type formEventName ='onAfterLoad'|'onAfterScroll'|'onAfterValidation'|'onBeforeLoad'|'onBeforeValidate'|'onBindRequest'|'onChange'|'onDestruct'|'onLoadError'|'onSubmit'|'onValidationError'|'onValidationSuccess'|'onValues'; -class form implements webix.ui.baseview{ - addView(view:any, index?:number):string|number; - adjust():void; - attachEvent(type:formEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clear():void; - clearValidation():void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus(item:string):void; - getChildViews():any[]; - getCleanValues():any; - getDirtyValues():any; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getScrollState():any; - getTopParentView():webix.ui.baseview; - getValues(details?:any):{ [key: string]: any; }; - hasEvent(name:string):boolean; - hide():void; - index(obj:any):number; - isDirty():boolean; - isEnabled():boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - mapEvent(map:any):void; - markInvalid(name:string, state?:boolean|string):void; - parse(data:any, type:string):void; - reconstruct():void; - refresh():void; - removeView(id:string|number):void; - render(id:string|number, data:any, type:string):void; - resize():void; - resizeChildren():void; - scrollTo(x:number, y:number):void; - setDirty(mark?:boolean):void; - setValues(values:any, update?:boolean):void; - show(force?:boolean, animation?:boolean):void; - showBatch(name:string):void; - unbind():void; - unblockEvent():void; - validate(mode?:any):boolean; - - $getSize():any[]; - $height: number; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: formConfig; - name: string; -} -interface forminputConfig{ - view?: string; - $cssName?: string; - animate?: any; - body?: webix.ui.baseview; - borderless?: boolean; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - label?: string; - labelAlign?: string; - labelWidth?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - value?: any; - width?: number; -} -type forminputEventName ='onAfterScroll'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class forminput implements webix.ui.baseview{ - adjust():void; - bind(target:any, rule?:WebixCallback, format?:string):void; - define(property:string, value:any):void; - destructor():void; - disable():void; - enable():void; - focus():void; - getBody():any; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():string; - hide():void; - isEnabled():boolean; - isVisible():boolean; - resize():void; - resizeChildren():void; - setValue(value:any):void; - show(force?:boolean, animation?:boolean):void; - unbind():void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: forminputConfig; - name: string; -} -interface gageConfig{ - view?: string; - animate?: any; - borderless?: boolean; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - label?: string; - maxHeight?: number; - maxRange?: number; - maxWidth?: number; - minHeight?: number; - minRange?: number; - minWidth?: number; - on?: EventHash; - placeholder?: string; - scale?: number; - smoothFlow?: boolean; - stroke?: number; - value?: number; - width?: number; -} -type gageEventName ='onAfterScroll'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class gage implements webix.ui.baseview{ - adjust():void; - attachEvent(type:gageEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():number; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - resize():void; - setValue(new_value:number):void; - show(force?:boolean, animation?:boolean):void; - unbind():void; - unblockEvent():void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: gageConfig; - name: string; -} -interface googleMapConfig{ - view?: string; - animate?: any; - borderless?: boolean; - center?: any[]; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - dataFeed?: string|WebixCallback; - datathrottle?: number; - datatype?: string; - disabled?: boolean; - gravity?: number; - heatmapConfig?: any; - height?: number; - hidden?: boolean; - id?: string|number; - layerType?: string; - mapType?: string; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - on?: EventHash; - ready?: WebixCallback; - removeMissed?: boolean; - save?: string; - scheme?: any; - url?: string; - width?: number; - zoom?: number; -} -type googleMapEventName ='onAfterAdd'|'onAfterDelete'|'onAfterLoad'|'onAfterScroll'|'onAfterSort'|'onBeforeAdd'|'onBeforeDelete'|'onBeforeLoad'|'onBeforeSort'|'onBindRequest'|'onBlur'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onFocus'|'onHeatMapRender'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class googleMap implements webix.ui.baseview{ - add(obj:any, index?:number):string|number; - adjust():void; - attachEvent(type:googleMapEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clearAll():void; - count():number; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - find(criterion:WebixCallback, first?:boolean):any; - getChildViews():any[]; - getFirstId():string|number; - getFormView():webix.ui.baseview; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getLastId():string|number; - getMap():any; - getNextId(id:string|number, step:number):string|number; - getNode():any; - getParentView():any; - getPrevId(id:string|number, step:number):string|number; - getTopParentView():webix.ui.baseview; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; - mapEvent(map:any):void; - parse(data:any, type:string):void; - refresh(id?:string|number):void; - remove(id:string|number):void; - render():void; - resize():void; - serialize():any; - show(force?:boolean, animation?:boolean):void; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - updateItem(id:string|number, data:any):void; - - $getSize():any[]; - $height: number; - $onLoad: WebixCallback; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: googleMapConfig; - name: string; - data:DataStore; - waitData: webix.promise; -} -interface gridsuggestConfig{ - view?: string; - animate?: any; - autofit?: boolean; - autofocus?: boolean; - body?: string|webix.ui.baseview; - borderless?: boolean; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - disabled?: boolean; - filter?: WebixCallback; - fitMaster?: boolean; - gravity?: number; - head?: any; - headHeight?: number; - height?: number; - hidden?: boolean; - id?: string|number; - input?: HTMLElement|string; - keyPressTimeout?: number; - left?: number; - master?: webix.ui.baseview; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - modal?: boolean; - move?: boolean; - on?: EventHash; - padding?: any; - position?: string|WebixCallback; - relative?: string; - resize?: boolean; - template?: string|WebixTemplate; - textValue?: string; - toFront?: boolean; - top?: number; - type?: string; - url?: string; - width?: number; - zIndex?: number; -} -type gridsuggestEventName ='onAfterScroll'|'onBeforeShow'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onHide'|'onKeyPress'|'onLongTouch'|'onShow'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValueSuggest'|'onViewMove'|'onViewMoveEnd'|'onViewResize'; -class gridsuggest implements webix.ui.baseview{ - adjust():void; - attachEvent(type:gridsuggestEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - close():void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getBody():any; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getHead():any; - getItemText(id:string|number):string; - getList():webix.ui.list; - getMasterValue():any; - getNode():any; - getParentView():any; - getSuggestion():string; - getTopParentView():webix.ui.baseview; - getValue():string|number; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - linkInput(input:HTMLElement):void; - mapEvent(map:any):void; - resize():void; - resizeChildren():void; - setMasterValue(value:any):void; - setPosition(x:number, y:number):void; - setValue(value:string|number):void; - show(node:HTMLElement, position?:any, point?:string):void; - unbind():void; - unblockEvent():void; - show(force:boolean,animation:boolean):void; - $enterKey: WebixCallback; - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: gridsuggestConfig; - name: string; -} -interface grouplistConfig{ - view?: string; - animate?: any; - autoheight?: boolean; - autowidth?: boolean; - borderless?: boolean; - click?: string|WebixCallback; - clipboard?: boolean|string; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - dataFeed?: string|WebixCallback; - datathrottle?: number; - datatype?: string; - disabled?: boolean; - drag?: boolean|string; - dragscroll?: boolean|string; - externalData?: WebixCallback; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - item?: any; - layout?: string; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - mouseEventDelay?: number; - multiselect?: boolean; - navigation?: boolean; - on?: EventHash; - onClick?: { [key: string]: any; }; - onContext?: { [key: string]: any; }; - onDblClick?: WebixCallback; - onMouseMove?: WebixCallback; - pager?: any; - ready?: WebixCallback; - removeMissed?: boolean; - rules?: any; - save?: string; - scheme?: any; - scroll?: boolean|string; - scrollSpeed?: string; - select?: boolean|string; - template?: string|WebixCallback; - templateBack?: string|string|WebixTemplate; - templateCopy?: WebixCallback; - templateGroup?: string|WebixCallback; - templateItem?: string|WebixCallback; - tooltip?: string|boolean; - type?: any; - url?: string; - width?: number; - xCount?: number; - yCount?: number; -} -type grouplistEventName ='onAfterAdd'|'onAfterContextMenu'|'onAfterDelete'|'onAfterDrop'|'onAfterDropOrder'|'onAfterLoad'|'onAfterRender'|'onAfterScroll'|'onAfterSelect'|'onAfterSort'|'onBeforeAdd'|'onBeforeContextMenu'|'onBeforeDelete'|'onBeforeDrag'|'onBeforeDragIn'|'onBeforeDrop'|'onBeforeDropOrder'|'onBeforeDropOut'|'onBeforeLoad'|'onBeforeRender'|'onBeforeSelect'|'onBeforeSort'|'onBindRequest'|'onBlur'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onDragOut'|'onFocus'|'onItemClick'|'onItemDblClick'|'onItemRender'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onPaste'|'onSelectChange'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValidationError'|'onValidationSuccess'|'onViewResize'; -class grouplist implements webix.ui.baseview{ - add(obj:any, index?:number):string|number; - addCss(id:string|number, css:string, silent?:boolean):void; - adjust():void; - attachEvent(type:grouplistEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clearAll():void; - clearCss(css:string, silent?:boolean):void; - clearValidation():void; - copy(sid:string|number, tindex:number, tobj?:any, details?:any):void; - count():number; - customize(obj:any):void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - find(criterion:WebixCallback, first?:boolean):any; - getChildViews():any[]; - getFirstId():string|number; - getFormView():webix.ui.baseview; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getItemNode(id:string|number):HTMLElement; - getLastId():string|number; - getNextId(id:string|number, step:number):string|number; - getNode():any; - getOpenState():any; - getPage():number; - getPager():any; - getParentView():any; - getPrevId(id:string|number, step:number):string|number; - getScrollState():any; - getSelectedId(as_array:boolean):string|any[]; - getSelectedItem(as_array:boolean):any; - getTopParentView():webix.ui.baseview; - getVisibleCount():number; - group(config:any, mode:boolean):void; - hasCss(id:string|number, css:string):boolean; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isSelected(id:string|number):boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; - locate(e:Event):string|number; - mapEvent(map:any):void; - move(sid:string, tindex:number, tobj?:any, details?:any):string; - moveBottom(id:string|number):void; - moveDown(id:string|number, step:number):void; - moveSelection(direction:string):void; - moveTop(id:string|number):void; - moveUp(id:string|number, step:number):void; - parse(data:any, type:string):void; - refresh(id?:string|number):void; - remove(id:string|number):void; - removeCss(id:string|number, css:string, silent?:boolean):void; - render(id:string|number, data:any, type:string):void; - resize():void; - scrollTo(x:number, y:number):void; - select(id:string|any[], preserve:boolean):void; - selectAll(from?:string, to?:string):void; - serialize():any; - setPage(page:number):void; - show(force?:boolean, animation?:boolean):void; - showItem(id:string|number):void; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - ungroup(mode:boolean):void; - unselect(id?:string):void; - unselectAll():void; - updateItem(id:string|number, data:any):void; - validate(id?:string):boolean; - - $drag(source:HTMLElement, ev:Event):string; - $dragHTML: WebixCallback; - $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; - $dragMark(context:any, ev:Event):boolean; - $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; - $drop(source:HTMLElement, target:HTMLElement, ev:Event):void; - $dropAllow: WebixCallback; - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: grouplistConfig; - name: string; - on_click: WebixCallback; - on_context: { [key: string]: any; }; - on_dblclick: WebixCallback; - on_mouse_move: WebixCallback; - type: { [key: string]: any; }; - types: { [key: string]: any; }; - data:DataStore; - waitData: webix.promise; -} -interface headerlayoutConfig{ - view?: string; - animate?: any; - borderless?: boolean; - collapsed?: boolean; - cols?: any[]; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - isolate?: boolean; - margin?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - multi?: boolean|string; - on?: EventHash; - padding?: number; - paddingX?: number; - paddingY?: number; - panelClass?: string; - responsive?: string; - rows?: any[]; - type?: string; - visibleBatch?: string; - width?: number; -} -type headerlayoutEventName ='onAfterCollapse'|'onAfterExpand'|'onBindRequest'|'onDestruct'; -class headerlayout implements webix.ui.baseview{ - addView(view:any, index?:number):string|number; - adjust():void; - attachEvent(type:headerlayoutEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - hasEvent(name:string):boolean; - hide():void; - index(obj:any):number; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - reconstruct():void; - removeView(id:string|number):void; - resize():void; - resizeChildren():void; - show(force?:boolean, animation?:boolean):void; - showBatch(name:string):void; - unbind():void; - unblockEvent():void; - - $getSize():any[]; - $height: number; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: headerlayoutConfig; - name: string; -} -interface htmlformConfig{ - view?: string; - animate?: any; - autoheight?: boolean; - borderless?: boolean; - complexData?: boolean; - container?: string|HTMLElement; - content?: string|number|HTMLElement; - css?: string; - data?: string|any[]; - datatype?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - on?: EventHash; - onClick?: { [key: string]: any; }; - scroll?: boolean|string; - scrollSpeed?: string; - src?: string; - template?: string|WebixCallback; - url?: string; - width?: number; -} -type htmlformEventName ='onAfterLoad'|'onAfterRender'|'onAfterScroll'|'onBeforeLoad'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValues'|'onViewResize'; -class htmlform implements webix.ui.baseview{ - adjust():void; - attachEvent(type:htmlformEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - clear(all?:boolean):void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus(item:string):void; - getChildViews():any[]; - getCleanValues():any; - getDirtyValues():any; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getScrollState():any; - getTopParentView():webix.ui.baseview; - getValues(details?:any):{ [key: string]: any; }; - hasEvent(name:string):boolean; - hide():void; - isDirty():boolean; - isEnabled():boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - mapEvent(map:any):void; - markInvalid(name:string, state?:boolean|string):void; - parse(data:any, type:string):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - scrollTo(x:number, y:number):void; - setContent(node:any):void; - setDirty(mark?:boolean):void; - setHTML(html:string):void; - setValues(values:any, update?:boolean):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: htmlformConfig; - name: string; -} -interface iconConfig{ - view?: string; - align?: string; - animate?: any; - autowidth?: boolean; - borderless?: boolean; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - icon?: string; - id?: string|number; - inputHeight?: number; - inputWidth?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - name?: string; - on?: EventHash; - popup?: string; - tooltip?: string; - value?: string|number; - width?: number; -} -type iconEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class icon implements webix.ui.baseview{ - adjust():void; - attachEvent(type:iconEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - - $compareValue: WebixCallback; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $renderInput(config:any):HTMLElement; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: iconConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface iframeConfig{ - view?: string; - animate?: any; - borderless?: boolean; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - on?: EventHash; - src?: string; - width?: number; -} -type iframeEventName ='onAfterLoad'|'onAfterScroll'|'onBeforeLoad'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class iframe implements webix.ui.baseview{ - adjust():void; - attachEvent(type:iframeEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getIframe():HTMLElement; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getWindow():HTMLElement; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - load(value:string):void; - mapEvent(map:any):void; - resize():void; - show(force?:boolean, animation?:boolean):void; - unbind():void; - unblockEvent():void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: iframeConfig; - name: string; -} -interface kanbanConfig{ - view?: string; - animate?: any; - borderless?: boolean; - collapsed?: boolean; - cols?: any[]; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - dataFeed?: string|WebixCallback; - datathrottle?: number; - datatype?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - isolate?: boolean; - listFilter?: WebixCallback; - margin?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - multi?: boolean|string; - on?: EventHash; - padding?: number; - paddingX?: number; - paddingY?: number; - panelClass?: string; - ready?: WebixCallback; - removeMissed?: boolean; - responsive?: string; - rows?: any[]; - save?: string; - scheme?: any; - type?: string; - url?: string; - visibleBatch?: string; - width?: number; -} -type kanbanEventName ='onAfterAdd'|'onAfterCollapse'|'onAfterDelete'|'onAfterExpand'|'onAfterLoad'|'onAfterSort'|'onAfterStatusChange'|'onAvatarClick'|'onBeforeAdd'|'onBeforeDelete'|'onBeforeLoad'|'onBeforeSort'|'onBeforeStatusChange'|'onBindRequest'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onListAfterContextMenu'|'onListAfterDrop'|'onListAfterSelect'|'onListBeforeContextMenu'|'onListBeforeDrag'|'onListBeforeDragIn'|'onListBeforeDrop'|'onListBeforeSelect'|'onListIconClick'|'onListItemClick'|'onListItemDblClick'|'onLoadError'; -class kanban implements webix.ui.baseview{ - add(obj:any, index?:number):string|number; - addView(view:any, index?:number):string|number; - adjust():void; - attachEvent(type:kanbanEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clearAll():void; - count():number; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - eachList(func:WebixCallback):void; - enable():void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - find(criterion:WebixCallback, first?:boolean):any; - getChildViews():any[]; - getFirstId():string|number; - getFormView():webix.ui.baseview; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getLastId():string|number; - getNextId(id:string|number, step:number):string|number; - getNode():any; - getOwnerList(itemId:string|number):any; - getParentView():any; - getPrevId(id:string|number, step:number):string|number; - getSelectedId():string|number; - getTopParentView():webix.ui.baseview; - hasEvent(name:string):boolean; - hide():void; - index(obj:any):number; - isEnabled():boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; - mapEvent(map:any):void; - parse(data:any, type:string):void; - reconstruct():void; - refresh(id?:string|number):void; - remove(id:string|number):void; - removeView(id:string|number):void; - resize():void; - resizeChildren():void; - select(id:string|number):void; - serialize():any; - setIndex(id:string|number, index:number):void; - show(force?:boolean, animation?:boolean):void; - showBatch(name:string):void; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - updateItem(id:string|number, data:any):void; - - $getSize():any[]; - $height: number; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: kanbanConfig; - name: string; - data:DataStore; - waitData: webix.promise; -} -interface labelConfig{ - view?: string; - align?: string; - animate?: any; - autowidth?: boolean; - borderless?: boolean; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - id?: string|number; - inputHeight?: number; - inputWidth?: number; - label?: string; - labelPosition?: string; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - name?: string; - on?: EventHash; - popup?: string; - tooltip?: string; - value?: string|number; - width?: number; -} -type labelEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class label implements webix.ui.baseview{ - adjust():void; - attachEvent(type:labelEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - setHTML(html:string):void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - - $compareValue: WebixCallback; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $renderInput(config:any):HTMLElement; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: labelConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface layoutConfig{ - view?: string; - animate?: any; - borderless?: boolean; - cols?: any[]; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - isolate?: boolean; - margin?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - on?: EventHash; - padding?: number; - paddingX?: number; - paddingY?: number; - responsive?: string; - rows?: any[]; - type?: string; - visibleBatch?: string; - width?: number; -} -type layoutEventName ='onBindRequest'|'onDestruct'; -class layout implements webix.ui.baseview{ - addView(view:any, index?:number):string|number; - adjust():void; - attachEvent(type:layoutEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - hasEvent(name:string):boolean; - hide():void; - index(obj:any):number; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - reconstruct():void; - removeView(id:string|number):void; - resize():void; - resizeChildren():void; - show(force?:boolean, animation?:boolean):void; - showBatch(name:string):void; - unbind():void; - unblockEvent():void; - - $getSize():any[]; - $height: number; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: layoutConfig; - name: string; -} -interface listConfig{ - view?: string; - animate?: any; - autoheight?: boolean; - autowidth?: boolean; - borderless?: boolean; - click?: string|WebixCallback; - clipboard?: boolean|string; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - dataFeed?: string|WebixCallback; - datathrottle?: number; - datatype?: string; - disabled?: boolean; - drag?: boolean|string; - dragscroll?: boolean|string; - externalData?: WebixCallback; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - item?: any; - layout?: string; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - mouseEventDelay?: number; - multiselect?: boolean; - navigation?: boolean; - on?: EventHash; - onClick?: { [key: string]: any; }; - onContext?: { [key: string]: any; }; - onDblClick?: WebixCallback; - onMouseMove?: WebixCallback; - pager?: any; - ready?: WebixCallback; - removeMissed?: boolean; - rules?: any; - save?: string; - scheme?: any; - scroll?: boolean|string; - scrollSpeed?: string; - select?: boolean|string; - template?: string|WebixCallback; - templateCopy?: WebixCallback; - tooltip?: string|boolean; - type?: any; - url?: string; - width?: number; - xCount?: number; - yCount?: number; -} -type listEventName ='onAfterAdd'|'onAfterContextMenu'|'onAfterDelete'|'onAfterDrop'|'onAfterDropOrder'|'onAfterLoad'|'onAfterRender'|'onAfterScroll'|'onAfterSelect'|'onAfterSort'|'onBeforeAdd'|'onBeforeContextMenu'|'onBeforeDelete'|'onBeforeDrag'|'onBeforeDragIn'|'onBeforeDrop'|'onBeforeDropOrder'|'onBeforeDropOut'|'onBeforeLoad'|'onBeforeRender'|'onBeforeSelect'|'onBeforeSort'|'onBindRequest'|'onBlur'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onDragOut'|'onFocus'|'onItemClick'|'onItemDblClick'|'onItemRender'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onPaste'|'onSelectChange'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValidationError'|'onValidationSuccess'|'onViewResize'; -class list implements webix.ui.baseview{ - add(obj:any, index?:number):string|number; - addCss(id:string|number, css:string, silent?:boolean):void; - adjust():void; - attachEvent(type:listEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clearAll():void; - clearCss(css:string, silent?:boolean):void; - clearValidation():void; - copy(sid:string|number, tindex:number, tobj?:any, details?:any):void; - count():number; - customize(obj:any):void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - find(criterion:WebixCallback, first?:boolean):any; - getChildViews():any[]; - getFirstId():string|number; - getFormView():webix.ui.baseview; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getItemNode(id:string|number):HTMLElement; - getLastId():string|number; - getNextId(id:string|number, step:number):string|number; - getNode():any; - getPage():number; - getPager():any; - getParentView():any; - getPrevId(id:string|number, step:number):string|number; - getScrollState():any; - getSelectedId(as_array:boolean):string|any[]; - getSelectedItem(as_array:boolean):any; - getTopParentView():webix.ui.baseview; - getVisibleCount():number; - hasCss(id:string|number, css:string):boolean; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isSelected(id:string|number):boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; - locate(e:Event):string|number; - mapEvent(map:any):void; - move(sid:string, tindex:number, tobj?:any, details?:any):string; - moveBottom(id:string|number):void; - moveDown(id:string|number, step:number):void; - moveSelection(direction:string):void; - moveTop(id:string|number):void; - moveUp(id:string|number, step:number):void; - parse(data:any, type:string):void; - refresh(id?:string|number):void; - remove(id:string|number):void; - removeCss(id:string|number, css:string, silent?:boolean):void; - render(id:string|number, data:any, type:string):void; - resize():void; - scrollTo(x:number, y:number):void; - select(id:string|any[], preserve:boolean):void; - selectAll(from?:string, to?:string):void; - serialize():any; - setPage(page:number):void; - show(force?:boolean, animation?:boolean):void; - showItem(id:string|number):void; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - unselect(id?:string):void; - unselectAll():void; - updateItem(id:string|number, data:any):void; - validate(id?:string):boolean; - - $drag(source:HTMLElement, ev:Event):string; - $dragHTML: WebixCallback; - $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; - $dragMark(context:any, ev:Event):boolean; - $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; - $drop(source:HTMLElement, target:HTMLElement, ev:Event):void; - $dropAllow: WebixCallback; - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: listConfig; - name: string; - on_click: WebixCallback; - on_context: { [key: string]: any; }; - on_dblclick: WebixCallback; - on_mouse_move: WebixCallback; - type: { [key: string]: any; }; - types: { [key: string]: any; }; - data:DataStore; - waitData: webix.promise; -} -interface menuConfig{ - view?: string; - animate?: any; - autoheight?: boolean; - autowidth?: boolean; - borderless?: boolean; - click?: string|WebixCallback; - clipboard?: boolean|string; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - dataFeed?: string|WebixCallback; - datathrottle?: number; - datatype?: string; - disabled?: boolean; - drag?: boolean|string; - dragscroll?: boolean|string; - externalData?: WebixCallback; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - item?: any; - layout?: string; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - mouseEventDelay?: number; - multiselect?: boolean; - navigation?: boolean; - on?: EventHash; - onClick?: { [key: string]: any; }; - onContext?: { [key: string]: any; }; - onDblClick?: WebixCallback; - onMouseMove?: WebixCallback; - openAction?: string; - pager?: any; - ready?: WebixCallback; - removeMissed?: boolean; - rules?: any; - save?: string; - scheme?: any; - scroll?: boolean|string; - scrollSpeed?: string; - select?: boolean|string; - subMenuPos?: string; - submenuConfig?: any; - template?: string|WebixCallback; - templateCopy?: WebixCallback; - tooltip?: string|boolean; - type?: any; - url?: string; - width?: number; - xCount?: number; - yCount?: number; -} -type menuEventName ='onAfterAdd'|'onAfterContextMenu'|'onAfterDelete'|'onAfterDrop'|'onAfterDropOrder'|'onAfterLoad'|'onAfterRender'|'onAfterScroll'|'onAfterSelect'|'onAfterSort'|'onBeforeAdd'|'onBeforeContextMenu'|'onBeforeDelete'|'onBeforeDrag'|'onBeforeDragIn'|'onBeforeDrop'|'onBeforeDropOrder'|'onBeforeDropOut'|'onBeforeLoad'|'onBeforeRender'|'onBeforeSelect'|'onBeforeSort'|'onBindRequest'|'onBlur'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onDragOut'|'onFocus'|'onItemClick'|'onItemDblClick'|'onItemRender'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onMenuItemClick'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onPaste'|'onSelectChange'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValidationError'|'onValidationSuccess'|'onViewResize'; -class menu implements webix.ui.baseview{ - add(obj:any, index?:number):string|number; - addCss(id:string|number, css:string, silent?:boolean):void; - adjust():void; - attachEvent(type:menuEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clearAll():void; - clearCss(css:string, silent?:boolean):void; - clearValidation():void; - copy(sid:string|number, tindex:number, tobj?:any, details?:any):void; - count():number; - customize(obj:any):void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - disableItem(id:string|number):void; - enable():void; - enableItem(id:string|number):void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - find(criterion:WebixCallback, first?:boolean):any; - getChildViews():any[]; - getFirstId():string|number; - getFormView():webix.ui.baseview; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getItemNode(id:string|number):HTMLElement; - getLastId():string|number; - getMenu(id:string|number):any; - getMenuItem(id:string|number):any; - getNextId(id:string|number, step:number):string|number; - getNode():any; - getPage():number; - getPager():any; - getParentView():any; - getPrevId(id:string|number, step:number):string|number; - getScrollState():any; - getSelectedId(as_array:boolean):string|any[]; - getSelectedItem(as_array:boolean):any; - getSubMenu(id:string|number):any; - getTopMenu():any; - getTopParentView():webix.ui.baseview; - getVisibleCount():number; - hasCss(id:string|number, css:string):boolean; - hasEvent(name:string):boolean; - hide():void; - hideItem(id:string|number):void; - isEnabled():boolean; - isSelected(id:string|number):boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; - locate(e:Event):string|number; - mapEvent(map:any):void; - move(sid:string, tindex:number, tobj?:any, details?:any):string; - moveBottom(id:string|number):void; - moveDown(id:string|number, step:number):void; - moveSelection(direction:string):void; - moveTop(id:string|number):void; - moveUp(id:string|number, step:number):void; - parse(data:any, type:string):void; - refresh(id?:string|number):void; - remove(id:string|number):void; - removeCss(id:string|number, css:string, silent?:boolean):void; - render(id:string|number, data:any, type:string):void; - resize():void; - scrollTo(x:number, y:number):void; - select(id:string|any[], preserve:boolean):void; - selectAll(from?:string, to?:string):void; - serialize():any; - setPage(page:number):void; - show(force?:boolean, animation?:boolean):void; - showItem(id:string|number):void; - sizeToContent():void; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - unselect(id?:string):void; - unselectAll():void; - updateItem(id:string|number, data:any):void; - validate(id?:string):boolean; - - $drag(source:HTMLElement, ev:Event):string; - $dragHTML: WebixCallback; - $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; - $dragMark(context:any, ev:Event):boolean; - $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; - $drop(source:HTMLElement, target:HTMLElement, ev:Event):void; - $dropAllow: WebixCallback; - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: menuConfig; - name: string; - on_click: WebixCallback; - on_context: { [key: string]: any; }; - on_dblclick: WebixCallback; - on_mouse_move: WebixCallback; - type: { [key: string]: any; }; - types: { [key: string]: any; }; - data:DataStore; - waitData: webix.promise; -} -interface multicomboConfig{ - view?: string; - align?: string; - animate?: any; - attributes?: any; - autowidth?: boolean; - borderless?: boolean; - bottomLabel?: string; - bottomPadding?: number; - button?: boolean; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - id?: string|number; - inputAlign?: string; - inputHeight?: number; - inputPadding?: number; - inputWidth?: number; - invalid?: boolean; - invalidMessage?: string; - keepText?: boolean; - label?: string; - labelAlign?: string; - labelPosition?: string; - labelWidth?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - name?: string; - newValues?: boolean; - on?: EventHash; - optionWidth?: number; - options?: any; - placeholder?: string; - popup?: string; - popupWidth?: number; - readonly?: boolean; - relatedAction?: string; - relatedView?: string; - required?: boolean; - separator?: string; - suggest?: any; - tagMode?: boolean; - tagTemplate?: WebixCallback; - tooltip?: string; - validate?: WebixCallback; - validateEvent?: string; - value?: string|number; - width?: number; -} -type multicomboEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class multicombo implements webix.ui.baseview{ - adjust():void; - attachEvent(type:multicomboEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getList():webix.ui.list; - getNode():any; - getParentView():any; - getPopup():webix.ui.baseview; - getText():string; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - setBottomText(text:string):void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - validate():boolean; - - $compareValue: WebixCallback; - $cssName: string; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $render: WebixCallback; - $renderInput(obj:any, html:string, id:string|number):string; - $renderLabel(config:any, id:string|number):string; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: multicomboConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface multiselectConfig{ - view?: string; - align?: string; - animate?: any; - attributes?: any; - autowidth?: boolean; - borderless?: boolean; - bottomLabel?: string; - bottomPadding?: number; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - icon?: string; - id?: string|number; - inputAlign?: string; - inputHeight?: number; - inputPadding?: number; - inputWidth?: number; - invalid?: boolean; - invalidMessage?: string; - label?: string; - labelAlign?: string; - labelPosition?: string; - labelWidth?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - name?: string; - on?: EventHash; - optionWidth?: number; - options?: any; - placeholder?: string; - popup?: string; - popupWidth?: number; - readonly?: boolean; - relatedAction?: string; - relatedView?: string; - required?: boolean; - separator?: string; - suggest?: any; - tooltip?: string; - validate?: WebixCallback; - validateEvent?: string; - value?: string|number; - width?: number; -} -type multiselectEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class multiselect implements webix.ui.baseview{ - adjust():void; - attachEvent(type:multiselectEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getList():webix.ui.list; - getNode():any; - getParentView():any; - getPopup():webix.ui.baseview; - getText():string; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - setBottomText(text:string):void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - validate():boolean; - - $compareValue: WebixCallback; - $cssName: string; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $render: WebixCallback; - $renderIcon: WebixCallback; - $renderInput(obj:any, html:string, id:string|number):string; - $renderLabel(config:any, id:string|number):string; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: multiselectConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface multisuggestConfig{ - view?: string; - animate?: any; - autofit?: boolean; - autofocus?: boolean; - body?: string|webix.ui.baseview; - borderless?: boolean; - button?: boolean; - buttonText?: string; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - disabled?: boolean; - filter?: WebixCallback; - fitMaster?: boolean; - gravity?: number; - head?: any; - headHeight?: number; - height?: number; - hidden?: boolean; - id?: string|number; - input?: HTMLElement|string; - keyPressTimeout?: number; - left?: number; - master?: webix.ui.baseview; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - modal?: boolean; - move?: boolean; - on?: EventHash; - padding?: any; - position?: string|WebixCallback; - relative?: string; - resize?: boolean; - separator?: string; - template?: string|WebixTemplate; - textValue?: string; - toFront?: boolean; - top?: number; - type?: string; - url?: string; - value?: string|number; - width?: number; - zIndex?: number; -} -type multisuggestEventName ='onAfterScroll'|'onBeforeShow'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onHide'|'onKeyPress'|'onLongTouch'|'onShow'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValueSuggest'|'onViewMove'|'onViewMoveEnd'|'onViewResize'; -class multisuggest implements webix.ui.baseview{ - adjust():void; - attachEvent(type:multisuggestEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - close():void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getBody():any; - getButton():webix.ui.baseview; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getHead():any; - getItemText(id:string|number):string; - getList():webix.ui.list; - getMasterValue():any; - getNode():any; - getParentView():any; - getSuggestion():string; - getTopParentView():webix.ui.baseview; - getValue():string|number; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - linkInput(input:HTMLElement):void; - mapEvent(map:any):void; - resize():void; - resizeChildren():void; - setMasterValue(value:any):void; - setPosition(x:number, y:number):void; - setValue(value:string|number):void; - show(force?:boolean, animation?:boolean):void; - unbind():void; - unblockEvent():void; - - $enterKey: WebixCallback; - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: multisuggestConfig; - name: string; -} -interface multitextConfig{ - view?: string; - align?: string; - animate?: any; - attributes?: any; - autowidth?: boolean; - borderless?: boolean; - bottomLabel?: string; - bottomPadding?: number; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - icon?: string; - iconWidth?: string; - id?: string|number; - inputAlign?: string; - inputHeight?: number; - inputPadding?: number; - inputWidth?: number; - invalid?: boolean; - invalidMessage?: string; - label?: string; - labelAlign?: string; - labelPosition?: string; - labelWidth?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - name?: string; - on?: EventHash; - placeholder?: string; - popup?: string; - readonly?: boolean; - relatedAction?: string; - relatedView?: string; - required?: boolean; - separator?: string; - subConfig?: any; - suggest?: any; - tooltip?: string; - validate?: WebixCallback; - validateEvent?: string; - value?: string|number; - width?: number; -} -type multitextEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class multitext implements webix.ui.baseview{ - addSection():string|number; - adjust():void; - attachEvent(type:multitextEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():string; - getValueHere():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - removeSection(id?:string|number):void; - render(id:string|number, data:any, type:string):void; - resize():void; - setBottomText(text:string):void; - setValue(value:string):void; - setValueHere(value:string|number):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - validate():boolean; - - $compareValue: WebixCallback; - $cssName: string; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $render: WebixCallback; - $renderIcon: WebixCallback; - $renderInput(obj:any, html:string, id:string|number):string; - $renderLabel(config:any, id:string|number):string; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: multitextConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface multiviewConfig{ - view?: string; - animate?: any; - borderless?: boolean; - cells?: any; - cols?: any[]; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - fitBiggest?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - keepViews?: boolean; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - on?: EventHash; - responsive?: string; - rows?: any[]; - visibleBatch?: string; - width?: number; -} -type multiviewEventName ='onBeforeBack'|'onBindRequest'|'onDestruct'|'onViewChange'; -class multiview implements webix.ui.baseview{ - addView(view:any, index?:number):string|number; - adjust():void; - attachEvent(type:multiviewEventName, functor:WebixCallback, id?:string):string|number; - back(step:number):void; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getActiveId():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():string|number; - hasEvent(name:string):boolean; - hide():void; - index(obj:any):number; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - reconstruct():void; - removeView(id:string|number):void; - resize():void; - resizeChildren():void; - setValue(toshow:string|number):void; - show(force?:boolean, animation?:boolean):void; - showBatch(name:string):void; - unbind():void; - unblockEvent():void; - - $getSize():any[]; - $height: number; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: multiviewConfig; - name: string; -} -interface organogramConfig{ - view?: string; - animate?: any; - ariaLabel?: string; - autoheight?: boolean; - autowidth?: boolean; - borderless?: boolean; - click?: string|WebixCallback; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - dataFeed?: string|WebixCallback; - datathrottle?: number; - datatype?: string; - disabled?: boolean; - filterMode?: any; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - item?: any; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - mouseEventDelay?: number; - multiselect?: boolean; - on?: EventHash; - onClick?: { [key: string]: any; }; - onContext?: { [key: string]: any; }; - onDblClick?: WebixCallback; - onMouseMove?: WebixCallback; - ready?: WebixCallback; - removeMissed?: boolean; - save?: string; - scheme?: any; - scroll?: boolean|string; - scrollSpeed?: string; - select?: boolean|string; - template?: string|WebixCallback; - threeState?: boolean; - tooltip?: string|boolean; - type?: any; - url?: string; - width?: number; -} -type organogramEventName ='onAfterAdd'|'onAfterClose'|'onAfterContextMenu'|'onAfterDelete'|'onAfterLoad'|'onAfterOpen'|'onAfterRender'|'onAfterScroll'|'onAfterSelect'|'onAfterSort'|'onBeforeAdd'|'onBeforeClose'|'onBeforeContextMenu'|'onBeforeDelete'|'onBeforeLoad'|'onBeforeOpen'|'onBeforeRender'|'onBeforeSelect'|'onBeforeSort'|'onBindRequest'|'onBlur'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onFocus'|'onItemCheck'|'onItemClick'|'onItemDblClick'|'onItemRender'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onSelectChange'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class organogram implements webix.ui.baseview{ - add(obj:any, index?:number):string|number; - addCss(id:string|number, css:string, silent?:boolean):void; - adjust():void; - attachEvent(type:organogramEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clearAll():void; - clearCss(css:string, silent?:boolean):void; - close(id:string|number):void; - closeAll():void; - count():number; - customize(obj:any):void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - find(criterion:WebixCallback, first?:boolean):any; - getBranchIndex(id:string|number, parent?:string|number):number; - getChildViews():any[]; - getFirstChildId(id:string|number):string; - getFirstId():string|number; - getFormView():webix.ui.baseview; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getItemNode(id:string|number):HTMLElement; - getLastId():string|number; - getNextId(id:string|number, step:number):string|number; - getNextSiblingId(id:string|number):string|number; - getNode():any; - getOpenItems():any[]; - getParentId(id:string|number):string|number; - getParentView():any; - getPrevId(id:string|number, step:number):string|number; - getPrevSiblingId(id:string|number):string|number; - getScrollState():any; - getSelectedId(as_array:boolean):string|any[]; - getSelectedItem(as_array:boolean):any; - getState():any; - getTopParentView():webix.ui.baseview; - group(config:any, mode:boolean):void; - hasCss(id:string|number, css:string):boolean; - hasEvent(name:string):boolean; - hide():void; - isBranch(id:string|number):boolean; - isBranchOpen(id:string|number):boolean; - isEnabled():boolean; - isSelected(id:string|number):boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - loadBranch(id:string|number, callback:WebixCallback, url:string):void; - loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; - locate(e:Event):string|number; - mapEvent(map:any):void; - open(id:string|number, show?:boolean):void; - openAll():void; - parse(data:any, type:string):void; - refresh(id?:string|number):void; - remove(id:string|number):void; - removeCss(id:string|number, css:string, silent?:boolean):void; - render(id:string|number, data:any, type:string):void; - resize():void; - scrollTo(x:number, y:number):void; - select(id:string|any[], preserve:boolean):void; - selectAll(from?:string, to?:string):void; - serialize():any; - setState(state:any):void; - show(force?:boolean, animation?:boolean):void; - showItem(id:string|number):void; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - ungroup(mode:boolean):void; - unselect(id?:string):void; - unselectAll():void; - updateItem(id:string|number, data:any):void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: organogramConfig; - name: string; - on_click: WebixCallback; - on_context: { [key: string]: any; }; - on_dblclick: WebixCallback; - on_mouse_move: WebixCallback; - type: { [key: string]: any; }; - types: { [key: string]: any; }; - data:DataStore; - waitData: webix.promise; -} -interface pagerConfig{ - view?: string; - animate?: any; - apiOnly?: boolean; - borderless?: boolean; - container?: string|HTMLElement; - count?: number; - css?: string; - disabled?: boolean; - gravity?: number; - group?: number; - height?: number; - hidden?: boolean; - id?: string|number; - limit?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - mouseEventDelay?: number; - on?: EventHash; - onClick?: { [key: string]: any; }; - onContext?: { [key: string]: any; }; - onDblClick?: WebixCallback; - onMouseMove?: WebixCallback; - page?: number; - size?: number; - template?: string|WebixCallback; - width?: number; -} -type pagerEventName ='onAfterContextMenu'|'onAfterPageChange'|'onAfterRender'|'onAfterScroll'|'onBeforeContextMenu'|'onBeforePageChange'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onItemClick'|'onItemDblClick'|'onKeyPress'|'onLongTouch'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class pager implements webix.ui.baseview{ - adjust():void; - attachEvent(type:pagerEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clone(config:any):any; - customize(obj:any):void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh(id?:string|number):void; - render(id:string|number, data:any, type:string):void; - resize():void; - select(page:number):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: pagerConfig; - name: string; - on_click: WebixCallback; - on_context: { [key: string]: any; }; - on_dblclick: WebixCallback; - on_mouse_move: WebixCallback; - type: { [key: string]: any; }; -} -interface pdfviewerConfig{ - view?: string; - animate?: any; - borderless?: boolean; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - dataFeed?: string|WebixCallback; - datatype?: string; - disabled?: boolean; - downloadName?: string; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - on?: EventHash; - scale?: string|number; - toolbar?: string; - url?: string; - width?: number; -} -type pdfviewerEventName ='onAfterLoad'|'onAfterScroll'|'onBeforeLoad'|'onBindRequest'|'onBlur'|'onDestruct'|'onDocumentReady'|'onFocus'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onPageRender'|'onScaleChange'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class pdfviewer implements webix.ui.baseview{ - adjust():void; - attachEvent(type:pdfviewerEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clear():void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - download():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - mapEvent(map:any):void; - nextPage():void; - parse(data:any, type:string):void; - prevPage():void; - renderPage(page:number):void; - resize():void; - setScale(scale:string|number, update:boolean):void; - show(force?:boolean, animation?:boolean):void; - unbind():void; - unblockEvent():void; - zoomIn():void; - zoomOut():void; - - $getSize():any[]; - $height: number; - $numPages: number; - $onLoad: WebixCallback; - $pageNum: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: pdfviewerConfig; - name: string; -} -interface pivotConfig{ - view?: string; - animate?: any; - borderless?: boolean; - cols?: any[]; - columnWidth?: number; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - datatype?: string; - disabled?: boolean; - externalProcessing?: boolean; - fieldMap?: any; - filterLabelAlign?: string; - filterLabelWidth?: number; - filterMap?: any; - filterMinWidth?: number; - filterPlaceholder?: boolean|string; - filterWidth?: number; - footer?: string; - format?: WebixCallback; - gravity?: number; - headerTemplate?: WebixCallback; - height?: number; - hidden?: boolean; - id?: string|number; - margin?: number; - max?: boolean; - maxHeight?: number; - maxWidth?: number; - min?: boolean; - minHeight?: number; - minWidth?: number; - on?: EventHash; - padding?: number; - paddingX?: number; - paddingY?: number; - ping?: WebixCallback; - popup?: any; - profile?: boolean; - readonly?: boolean; - readonlyTitle?: string; - ready?: WebixCallback; - removeMissed?: boolean; - responsive?: string; - rows?: any[]; - scheme?: any; - stableRowId?: boolean; - structure?: any; - totalColumn?: string; - type?: string; - url?: string; - visibleBatch?: string; - webWorker?: string; - width?: number; - yScaleWidth?: number; -} -type pivotEventName ='onAfterAdd'|'onAfterDelete'|'onAfterLoad'|'onAfterSort'|'onApply'|'onBeforeAdd'|'onBeforeApply'|'onBeforeCancel'|'onBeforeDelete'|'onBeforeLoad'|'onBeforeRender'|'onBeforeSort'|'onBindRequest'|'onCancel'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onFilterChange'|'onFilterCreate'|'onHeaderInit'|'onItemClick'|'onLoadError'|'onPopup'|'onViewInit'|'onWebWorkerEnd'|'onWebWorkerStart'; -class pivot implements webix.ui.baseview{ - add(obj:any, index?:number):string|number; - addOperation(name:string, functor:WebixCallback, options:any):void; - addView(view:any, index?:number):string|number; - adjust():void; - attachEvent(type:pivotEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clearAll():void; - configure():void; - count():number; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - find(criterion:WebixCallback, first?:boolean):any; - getChildViews():any[]; - getConfigWindow():any; - getFields():any; - getFilterView():any; - getFirstId():string|number; - getFormView():webix.ui.baseview; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getLastId():string|number; - getNextId(id:string|number, step:number):string|number; - getNode():any; - getParentView():any; - getPrevId(id:string|number, step:number):string|number; - getStructure():any; - getTopParentView():webix.ui.baseview; - hasEvent(name:string):boolean; - hide():void; - index(obj:any):number; - innerId(id:number|string):number|string; - isEnabled():boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - mapEvent(map:any):void; - parse(data:any, type:string):void; - reconstruct():void; - refresh(id?:string|number):void; - remove(id:string|number):void; - removeView(id:string|number):void; - render():void; - resize():void; - resizeChildren():void; - serialize():any; - setStructure(config:any):void; - show(force?:boolean, animation?:boolean):void; - showBatch(name:string):void; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - ui(view:any):webix.ui.baseview; - unbind():void; - unblockEvent():void; - updateItem(id:string|number, data:any):void; - - $$: any; - $divider: string; - $getSize():any[]; - $height: number; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: pivotConfig; - name: string; - operations: any; - data:DataStore; - waitData: webix.promise; -} -interface popupConfig{ - view?: string; - animate?: any; - autofit?: boolean; - autofocus?: boolean; - body?: string|webix.ui.baseview; - borderless?: boolean; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - head?: any; - headHeight?: number; - height?: number; - hidden?: boolean; - id?: string|number; - left?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - modal?: boolean; - move?: boolean; - on?: EventHash; - padding?: any; - position?: string|WebixCallback; - relative?: string; - resize?: boolean; - toFront?: boolean; - top?: number; - width?: number; - zIndex?: number; -} -type popupEventName ='onAfterScroll'|'onBeforeShow'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onHide'|'onKeyPress'|'onLongTouch'|'onShow'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewMove'|'onViewMoveEnd'|'onViewResize'; -class popup implements webix.ui.baseview{ - adjust():void; - attachEvent(type:popupEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - close():void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getBody():any; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getHead():any; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - resize():void; - resizeChildren():void; - setPosition(x:number, y:number):void; - show(node?:HTMLElement, position?:any, point?:string):void; - unbind():void; - unblockEvent():void; - show(force:boolean,animation:boolean):void; - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: popupConfig; - name: string; -} -interface portletConfig{ - view?: string; - animate?: any; - body?: string|webix.ui.baseview; - borderless?: boolean; - cols?: any[]; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - isolate?: boolean; - layoutType?: string; - margin?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - mode?: string; - on?: EventHash; - padding?: number; - paddingX?: number; - paddingY?: number; - responsive?: string; - rows?: any[]; - type?: string; - visibleBatch?: string; - width?: number; -} -type portletEventName ='onAfterPortletMove'|'onBeforePortletMove'|'onBindRequest'|'onDestruct'; -class portlet implements webix.ui.baseview{ - addView(view:any, index?:number):string|number; - adjust():void; - attachEvent(type:portletEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - hasEvent(name:string):boolean; - hide():void; - index(obj:any):number; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - markDropArea(target:string, mode:string):void; - movePortlet(target:string, mode:string):void; - reconstruct():void; - removeView(id:string|number):void; - resize():void; - resizeChildren():void; - show(force?:boolean, animation?:boolean):void; - showBatch(name:string):void; - unbind():void; - unblockEvent():void; - - $drag(source:HTMLElement, ev:Event):string; - $getSize():any[]; - $height: number; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: portletConfig; - name: string; -} -interface propertyConfig{ - view?: string; - animate?: any; - autoheight?: boolean; - borderless?: boolean; - complexData?: boolean; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - datatype?: string; - disabled?: boolean; - editValue?: string; - editable?: boolean; - editaction?: string; - elements?: any; - form?: string; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - map?: any; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - mouseEventDelay?: number; - nameWidth?: number; - on?: EventHash; - onClick?: { [key: string]: any; }; - onContext?: { [key: string]: any; }; - onDblClick?: WebixCallback; - onMouseMove?: WebixCallback; - scroll?: boolean|string; - scrollSpeed?: string; - template?: string|WebixCallback; - tooltip?: string|boolean; - url?: string; - width?: number; -} -type propertyEventName ='onAfterContextMenu'|'onAfterEditStart'|'onAfterEditStop'|'onAfterLoad'|'onAfterRender'|'onAfterScroll'|'onBeforeContextMenu'|'onBeforeEditStart'|'onBeforeEditStop'|'onBeforeLoad'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onItemClick'|'onItemDblClick'|'onKeyPress'|'onLiveEdit'|'onLoadError'|'onLongTouch'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class property implements webix.ui.baseview{ - adjust():void; - attachEvent(type:propertyEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - customize(obj:any):void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - edit(id:any):void; - editCancel():void; - editNext():boolean; - editStop():void; - enable():void; - focusEditor():void; - getChildViews():any[]; - getEditState():any; - getEditor(id?:string):any; - getEditorValue():string; - getFormView():webix.ui.baseview; - getItem(id:string):any; - getItemNode(id:string|number):HTMLElement; - getNode():any; - getParentView():any; - getScrollState():any; - getTopParentView():webix.ui.baseview; - getValues():{ [key: string]: any; }; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - locate(e:Event):string|number; - mapEvent(map:any):void; - parse(data:any, type:string):void; - refresh(id?:string|number):void; - registerType(name:string, data:any):void; - render(id:string|number, data:any, type:string):void; - resize():void; - scrollTo(x:number, y:number):void; - setValues(values:any, update?:boolean):void; - show(force?:boolean, animation?:boolean):void; - showItem(id:string|number):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - updateItem():void; - validateEditor(id?:string|number):boolean; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: propertyConfig; - name: string; - on_click: WebixCallback; - on_context: { [key: string]: any; }; - on_dblclick: WebixCallback; - on_edit: { [key: string]: any; }; - on_mouse_move: WebixCallback; - on_render: { [key: string]: any; }; - type: { [key: string]: any; }; -} -interface radioConfig{ - view?: string; - align?: string; - animate?: any; - attributes?: any; - autowidth?: boolean; - borderless?: boolean; - bottomLabel?: string; - bottomPadding?: number; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - customRadio?: boolean; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - id?: string|number; - inputAlign?: string; - inputHeight?: number; - inputPadding?: number; - inputWidth?: number; - invalidMessage?: string; - label?: string; - labelAlign?: string; - labelPosition?: string; - labelWidth?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - name?: string; - newline?: boolean; - on?: EventHash; - optionHeight?: number; - options?: any[]; - popup?: string; - relatedAction?: string; - relatedView?: string; - required?: boolean; - suggest?: any; - tooltip?: string; - validate?: WebixCallback; - validateEvent?: string; - value?: string|number; - vertical?: boolean; - width?: number; -} -type radioEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class radio implements webix.ui.baseview{ - adjust():void; - attachEvent(type:radioEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - setBottomText(text:string):void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - validate():boolean; - - $compareValue: WebixCallback; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $render: WebixCallback; - $renderIcon: WebixCallback; - $renderInput(obj:any, html:string, id:string|number):string; - $renderLabel(config:any, id:string|number):string; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: radioConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface rangechartConfig{ - view?: string; - alpha?: number; - animate?: any; - ariaLabel?: string; - barWidth?: number; - border?: boolean; - borderColor?: string; - borderless?: boolean; - cant?: number; - color?: string|WebixCallback; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - datathrottle?: number; - datatype?: string; - disableLines?: boolean; - disabled?: boolean; - eventRadius?: number; - fill?: string; - fixOverflow?: boolean; - frameId?: string; - gradient?: boolean|string|WebixCallback; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - item?: any; - label?: string|WebixCallback; - labelOffset?: number; - legend?: any; - line?: any; - lineColor?: string; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - mouseEventDelay?: number; - offset?: boolean; - on?: EventHash; - onClick?: { [key: string]: any; }; - onContext?: { [key: string]: any; }; - onDblClick?: WebixCallback; - onMouseMove?: WebixCallback; - origin?: number; - padding?: any; - pieHeight?: number; - pieInnerText?: string|WebixCallback; - preset?: string; - radius?: number; - range?: any; - ready?: WebixCallback; - removeMissed?: boolean; - save?: string; - scale?: string; - scheme?: any; - series?: any; - shadow?: boolean; - tooltip?: string|boolean; - type?: string; - url?: string; - value?: string|WebixTemplate; - width?: number; - x?: number; - xAxis?: any; - xValue?: string; - y?: number; - yAxis?: any; - yValue?: string; -} -type rangechartEventName ='onAfterAdd'|'onAfterContextMenu'|'onAfterDelete'|'onAfterLoad'|'onAfterRangeChange'|'onAfterRender'|'onAfterScroll'|'onAfterSort'|'onBeforeAdd'|'onBeforeContextMenu'|'onBeforeDelete'|'onBeforeLoad'|'onBeforeRender'|'onBeforeSort'|'onBindRequest'|'onBlur'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onFocus'|'onItemClick'|'onItemDblClick'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class rangechart implements webix.ui.baseview{ - add(obj:any, index?:number):string|number; - addSeries(obj:any):void; - adjust():void; - attachEvent(type:rangechartEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clearAll():void; - clearCanvas():void; - count():number; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - find(criterion:WebixCallback, first?:boolean):any; - getChildViews():any[]; - getFirstId():string|number; - getFormView():webix.ui.baseview; - getFrameData():any[]; - getFrameRange():any; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getLastId():string|number; - getNextId(id:string|number, step:number):string|number; - getNode():any; - getParentView():any; - getPrevId(id:string|number, step:number):string|number; - getTopParentView():webix.ui.baseview; - group(config:any, mode:boolean):void; - hasEvent(name:string):boolean; - hide():void; - hideSeries(series:string):void; - isEnabled():boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; - locate(e:Event):string|number; - mapEvent(map:any):void; - parse(data:any, type:string):void; - refresh(id?:string|number):void; - remove(id:string|number):void; - removeAllSeries():void; - render(id:string|number, data:any, type:string):void; - resize():void; - serialize():any; - setFrameRange(range:any):void; - show(force?:boolean, animation?:boolean):void; - showSeries(series:string):void; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - ungroup(mode:boolean):void; - updateItem(id:string|number, data:any):void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - colormap: { [key: string]: any; }; - config: rangechartConfig; - name: string; - on_click: WebixCallback; - on_context: { [key: string]: any; }; - on_dblclick: WebixCallback; - on_mouse_move: WebixCallback; - presets: { [key: string]: any; }; - data:DataStore; - waitData: webix.promise; -} -interface rangesliderConfig{ - view?: string; - align?: string; - animate?: any; - attributes?: any; - autowidth?: boolean; - borderless?: boolean; - bottomLabel?: string; - bottomPadding?: number; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - id?: string|number; - inputAlign?: string; - inputHeight?: number; - inputPadding?: number; - inputWidth?: number; - invalidMessage?: string; - label?: string; - labelAlign?: string; - labelPosition?: string; - labelWidth?: number; - max?: number; - maxHeight?: number; - maxWidth?: number; - min?: number; - minHeight?: number; - minWidth?: number; - name?: string; - on?: EventHash; - popup?: string; - relatedAction?: string; - relatedView?: string; - required?: boolean; - separator?: string; - step?: number; - stringResult?: boolean; - suggest?: any; - title?: string|WebixCallback; - tooltip?: string; - validate?: WebixCallback; - validateEvent?: string; - value?: string|number; - width?: number; -} -type rangesliderEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSliderDrag'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class rangeslider implements webix.ui.baseview{ - adjust():void; - attachEvent(type:rangesliderEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - setBottomText(text:string):void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - validate():boolean; - - $compareValue: WebixCallback; - $cssName: string; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $render: WebixCallback; - $renderIcon: WebixCallback; - $renderInput(obj:any, html:string, id:string|number):string; - $renderLabel(config:any, id:string|number):string; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $touchCapture: boolean; - $view: HTMLElement; - $width: number; - config: rangesliderConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface resizerConfig{ - view?: string; - animate?: any; - borderless?: boolean; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - mouseEventDelay?: number; - onContext?: { [key: string]: any; }; - width?: number; -} -type resizerEventName ='onAfterContextMenu'|'onAfterScroll'|'onBeforeContextMenu'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onItemClick'|'onItemDblClick'|'onKeyPress'|'onLongTouch'|'onMouseMoving'|'onMouseOut'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class resizer implements webix.ui.baseview{ - adjust():void; - bind(target:any, rule?:WebixCallback, format?:string):void; - define(property:string, value:any):void; - destructor():void; - disable():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - hide():void; - isEnabled():boolean; - isVisible():boolean; - resize():void; - show(force?:boolean, animation?:boolean):void; - unbind():void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: resizerConfig; - name: string; - on_click: WebixCallback; - on_context: { [key: string]: any; }; - on_dblclick: WebixCallback; - on_mouse_move: WebixCallback; -} -interface richselectConfig{ - view?: string; - align?: string; - animate?: any; - attributes?: any; - autowidth?: boolean; - borderless?: boolean; - bottomLabel?: string; - bottomPadding?: number; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - icon?: string; - id?: string|number; - inputAlign?: string; - inputHeight?: number; - inputPadding?: number; - inputWidth?: number; - invalid?: boolean; - invalidMessage?: string; - label?: string; - labelAlign?: string; - labelPosition?: string; - labelWidth?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - name?: string; - on?: EventHash; - options?: any; - placeholder?: string; - popup?: string; - popupWidth?: number; - readonly?: boolean; - relatedAction?: string; - relatedView?: string; - required?: boolean; - suggest?: any; - tooltip?: string; - validate?: WebixCallback; - validateEvent?: string; - value?: string|number; - width?: number; -} -type richselectEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class richselect implements webix.ui.baseview{ - adjust():void; - attachEvent(type:richselectEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getList():webix.ui.list; - getNode():any; - getParentView():any; - getPopup():webix.ui.baseview; - getText():string; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - setBottomText(text:string):void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - validate():boolean; - - $compareValue: WebixCallback; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $render: WebixCallback; - $renderIcon: WebixCallback; - $renderInput(obj:any, html:string, id:string|number):string; - $renderLabel(config:any, id:string|number):string; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: richselectConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface richtextConfig{ - view?: string; - animate?: any; - borderless?: boolean; - cols?: any[]; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - isolate?: boolean; - label?: string; - labelPosition?: string; - labelWidth?: number; - margin?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - on?: EventHash; - padding?: number; - paddingX?: number; - paddingY?: number; - responsive?: string; - rows?: any[]; - type?: string; - value?: string|number; - visibleBatch?: string; - width?: number; -} -type richtextEventName ='onBindRequest'|'onChange'|'onDestruct'; -class richtext implements webix.ui.baseview{ - addView(view:any, index?:number):string|number; - adjust():void; - attachEvent(type:richtextEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - index(obj:any):number; - innerId(id:number|string):number|string; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - reconstruct():void; - refresh():void; - removeView(id:string|number):void; - resize():void; - resizeChildren():void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - showBatch(name:string):void; - ui(view:any):webix.ui.baseview; - unbind():void; - unblockEvent():void; - - $$: any; - $getSize():any[]; - $height: number; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: richtextConfig; - name: string; -} -interface scrollviewConfig{ - view?: string; - animate?: any; - body?: any; - borderless?: boolean; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - on?: EventHash; - scroll?: boolean|string; - scrollSpeed?: string; - width?: number; -} -type scrollviewEventName ='onAfterScroll'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class scrollview implements webix.ui.baseview{ - adjust():void; - attachEvent(type:scrollviewEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getBody():any; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getScrollState():any; - getTopParentView():webix.ui.baseview; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - resize():void; - resizeChildren():void; - scrollTo(x:number, y:number):void; - show(force?:boolean, animation?:boolean):void; - showView(id:string|number):void; - unbind():void; - unblockEvent():void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: scrollviewConfig; - name: string; -} -interface searchConfig{ - view?: string; - align?: string; - animate?: any; - attributes?: any; - autowidth?: boolean; - borderless?: boolean; - bottomLabel?: string; - bottomPadding?: number; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - icon?: string; - id?: string|number; - inputAlign?: string; - inputHeight?: number; - inputPadding?: number; - inputWidth?: number; - invalid?: boolean; - invalidMessage?: string; - label?: string; - labelAlign?: string; - labelPosition?: string; - labelWidth?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - name?: string; - on?: EventHash; - pattern?: any; - placeholder?: string; - popup?: string; - readonly?: boolean; - relatedAction?: string; - relatedView?: string; - required?: boolean; - suggest?: any; - tooltip?: string; - type?: string; - validate?: WebixCallback; - validateEvent?: string; - value?: string|number; - width?: number; -} -type searchEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSearchIconClick'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class search implements webix.ui.baseview{ - adjust():void; - attachEvent(type:searchEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - setBottomText(text:string):void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - validate():boolean; - - $compareValue: WebixCallback; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $render: WebixCallback; - $renderIcon: WebixCallback; - $renderInput(obj:any, html:string, id:string|number):string; - $renderLabel(config:any, id:string|number):string; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: searchConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface segmentedConfig{ - view?: string; - align?: string; - animate?: any; - attributes?: any; - borderless?: boolean; - bottomLabel?: string; - bottomPadding?: number; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - id?: string|number; - inputAlign?: string; - inputHeight?: number; - inputPadding?: number; - inputWidth?: number; - invalidMessage?: string; - label?: string; - labelAlign?: string; - labelPosition?: string; - labelWidth?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - multiview?: boolean; - name?: string; - on?: EventHash; - optionWidth?: number; - options?: any; - popup?: string; - relatedAction?: string; - relatedView?: string; - required?: boolean; - suggest?: any; - tooltip?: string; - validate?: WebixCallback; - validateEvent?: string; - value?: string|number; - width?: number; -} -type segmentedEventName ='onAfterRender'|'onAfterScroll'|'onAfterTabClick'|'onBeforeRender'|'onBeforeTabClick'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onOptionRemove'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class segmented implements webix.ui.baseview{ - addOption(id:string|number, value:any, show?:boolean, index?:number):void; - adjust():void; - attachEvent(type:segmentedEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - hideOption(id:string|number):void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - optionIndex(ID:string|number):number; - refresh():void; - removeOption(id:string|number):void; - render(id:string|number, data:any, type:string):void; - resize():void; - setBottomText(text:string):void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - showOption(id:string|number):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - validate():boolean; - - $compareValue: WebixCallback; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $render: WebixCallback; - $renderIcon: WebixCallback; - $renderInput(obj:any, html:string, id:string|number):string; - $renderLabel(config:any, id:string|number):string; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: segmentedConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface selectConfig{ - view?: string; - align?: string; - animate?: any; - attributes?: any; - autowidth?: boolean; - borderless?: boolean; - bottomLabel?: string; - bottomPadding?: number; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - id?: string|number; - inputAlign?: string; - inputHeight?: number; - inputPadding?: number; - inputWidth?: number; - invalid?: boolean; - invalidMessage?: string; - label?: string; - labelAlign?: string; - labelPosition?: string; - labelWidth?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - name?: string; - on?: EventHash; - options?: any[]|string; - placeholder?: string; - popup?: string; - readonly?: boolean; - relatedAction?: string; - relatedView?: string; - required?: boolean; - suggest?: any; - tooltip?: string; - validate?: WebixCallback; - validateEvent?: string; - value?: string|number; - width?: number; -} -type selectEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class select implements webix.ui.baseview{ - adjust():void; - attachEvent(type:selectEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - setBottomText(text:string):void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - unbind():void; - unblockEvent():void; - validate():boolean; - - $compareValue: WebixCallback; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $render: WebixCallback; - $renderIcon: WebixCallback; - $renderInput(obj:any, html:string, id:string|number):string; - $renderLabel(config:any, id:string|number):string; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: selectConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface sidemenuConfig{ - view?: string; - animate?: any; - autofit?: boolean; - autofocus?: boolean; - body?: string|webix.ui.baseview; - borderless?: boolean; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - head?: any; - headHeight?: number; - height?: number; - hidden?: boolean; - id?: string|number; - left?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - modal?: boolean; - move?: boolean; - on?: EventHash; - padding?: any; - position?: string|WebixCallback; - relative?: string; - resize?: boolean; - state?: WebixCallback; - toFront?: boolean; - top?: number; - width?: number; - zIndex?: number; -} -type sidemenuEventName ='onAfterScroll'|'onBeforeShow'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onHide'|'onKeyPress'|'onLongTouch'|'onShow'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewMove'|'onViewMoveEnd'|'onViewResize'; -class sidemenu implements webix.ui.baseview{ - adjust():void; - attachEvent(type:sidemenuEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - close():void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getBody():any; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getHead():any; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - resize():void; - resizeChildren():void; - setPosition(x:number, y:number):void; - show(force?:boolean, animation?:boolean):void; - unbind():void; - unblockEvent():void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: sidemenuConfig; - name: string; -} -interface sliderConfig{ - view?: string; - align?: string; - animate?: any; - attributes?: any; - autowidth?: boolean; - borderless?: boolean; - bottomLabel?: string; - bottomPadding?: number; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - id?: string|number; - inputAlign?: string; - inputHeight?: number; - inputPadding?: number; - inputWidth?: number; - invalid?: boolean; - invalidMessage?: string; - label?: string; - labelAlign?: string; - labelPosition?: string; - labelWidth?: number; - max?: number; - maxHeight?: number; - maxWidth?: number; - min?: number; - minHeight?: number; - minWidth?: number; - name?: string; - on?: EventHash; - placeholder?: string; - popup?: string; - readonly?: boolean; - relatedAction?: string; - relatedView?: string; - required?: boolean; - step?: number; - suggest?: any; - title?: string|WebixCallback; - tooltip?: string; - validate?: WebixCallback; - validateEvent?: string; - value?: string|number; - width?: number; -} -type sliderEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSliderDrag'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class slider implements webix.ui.baseview{ - adjust():void; - attachEvent(type:sliderEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - setBottomText(text:string):void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - validate():boolean; - - $compareValue: WebixCallback; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $render: WebixCallback; - $renderIcon: WebixCallback; - $renderInput(obj:any, html:string, id:string|number):string; - $renderLabel(config:any, id:string|number):string; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $touchCapture: boolean; - $view: HTMLElement; - $width: number; - config: sliderConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface spacerConfig{ - view?: string; - animate?: any; - borderless?: boolean; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - width?: number; -} -type spacerEventName ='onAfterScroll'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class spacer implements webix.ui.baseview{ - adjust():void; - bind(target:any, rule?:WebixCallback, format?:string):void; - define(property:string, value:any):void; - destructor():void; - disable():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - hide():void; - isEnabled():boolean; - isVisible():boolean; - resize():void; - show(force?:boolean, animation?:boolean):void; - unbind():void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: spacerConfig; - name: string; -} -interface spreadsheetConfig{ - view?: string; - animate?: any; - borderless?: boolean; - bottombar?: boolean; - buttons?: any; - cols?: any[]; - columnCount?: number; - conditionStyle?: any[]; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - datatype?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - isolate?: boolean; - liveEditor?: boolean; - margin?: number; - maxHeight?: number; - maxWidth?: number; - menu?: boolean; - minHeight?: number; - minWidth?: number; - on?: EventHash; - padding?: number; - paddingX?: number; - paddingY?: number; - readonly?: boolean; - resizeCell?: boolean; - responsive?: string; - rowCount?: number; - rows?: any[]; - sheetTabWidth?: number; - subbar?: any; - toolbar?: string; - type?: string; - url?: string; - visibleBatch?: string; - width?: number; -} -type spreadsheetEventName ='onAfterLoad'|'onAfterSelect'|'onAfterSheetShow'|'onBeforeLoad'|'onBeforeSheetShow'|'onBeforeSpan'|'onBeforeSplit'|'onBeforeValueChange'|'onBindRequest'|'onCellChange'|'onComponentInit'|'onDataParse'|'onDataSerialize'|'onDestruct'|'onLoadError'|'onMathRefresh'|'onReset'|'onStyleSet'; -class spreadsheet implements webix.ui.baseview{ - addFilter(rowId:number, columnId:number):void; - addImage(rowId:number, columnId:number, url:string):void; - addSheet(content:any):void; - addSparkline(rowId:number, columnId:number, config:any):void; - addStyle(styleProps:any, baseStyle:any):void; - addView(view:any, index?:number):string|number; - adjust():void; - alert(config:any):HTMLElement; - attachEvent(type:spreadsheetEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clearRange(rangeStr:string, type:any):void; - clearSheet():void; - combineCells(range:any):void; - compactStyles():void; - confirm(config:any):void; - define(property:string, value:any):void; - deleteColumn(columnId:number):void; - deleteRow(rowId:number):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - eachSelectedCell(handler:WebixCallback):void; - editSheet(name:string):void; - enable():void; - filterSpreadSheet():void; - freezeColumns(columns:number):void; - freezeRows(rows:number):void; - getActiveSheet():string; - getCellEditor(row:number, column:number):any; - getCellValue(row:number, column:number):string; - getChildViews():any[]; - getColumn(id:string):any; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getRow(id:string):any; - getSelectedId():any[]; - getSelectedRange():string; - getStyle(row:number, column:number):any; - getTopParentView():webix.ui.baseview; - hasEvent(name:string):boolean; - hide():void; - hideColumn(columnId:number, state:boolean):void; - hideGridlines(state:boolean):void; - hideHeaders(state:boolean):void; - hideRow(rowId:number, state:boolean):void; - index(obj:any):number; - innerId(id:number|string):number|string; - insertColumn(columnId:number):void; - insertRow(rowId:number):void; - isCellLocked(rowId:number, columnId:number):boolean; - isColumnVisible(columnId:number):boolean; - isEnabled():boolean; - isRowVisible(rowId:number):boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - lockCell(rowId:number, columnId:number, state:boolean):void; - mapEvent(map:any):void; - parse(data:any, type:string):void; - recalculate():void; - reconstruct():void; - redo():void; - refresh():void; - registerMathMethod(name:string, handler:WebixCallback):void; - removeFilter():void; - removeSheet(name:string):void; - removeView(id:string|number):void; - renameSheet(name:string, newName:string):void; - reset():void; - resetUndo():void; - resize():void; - resizeChildren():void; - saveCell(row:number, column:number):void; - serialize():any; - setCellEditor(rowId:number, columnId:number, editorObject:any):void; - setCellFilter(rowId:number, columnId:number, options:string|any[]):void; - setCellValue(row:number, column:any, value:string):void; - setFormat(rowId:number, columnId:number, format:string):void; - setRangeStyle(rangeStr:string, style:any):void; - setRangeValue(range:string):void; - setStyle(row:number, column:number, style:any):void; - show(force?:boolean, animation?:boolean):void; - showBatch(name:string):void; - showSheet(name:string):void; - sortRange(range:string, dir:string):void; - splitCell(row:number, column:number):void; - ui(view:any):webix.ui.baseview; - unbind():void; - unblockEvent():void; - undo(id:string):void; - - $$: any; - $getSize():any[]; - $height: number; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: spreadsheetConfig; - name: string; -} -interface submenuConfig{ - view?: string; - animate?: any; - autofit?: boolean; - autofocus?: boolean; - autoheight?: boolean; - autowidth?: boolean; - body?: string|webix.ui.baseview; - borderless?: boolean; - click?: string|WebixCallback; - clipboard?: boolean|string; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - dataFeed?: string|WebixCallback; - datathrottle?: number; - datatype?: string; - disabled?: boolean; - drag?: boolean|string; - dragscroll?: boolean|string; - externalData?: WebixCallback; - gravity?: number; - head?: any; - headHeight?: number; - height?: number; - hidden?: boolean; - id?: string|number; - item?: any; - layout?: string; - left?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - modal?: boolean; - mouseEventDelay?: number; - move?: boolean; - multiselect?: boolean; - navigation?: boolean; - on?: EventHash; - onClick?: { [key: string]: any; }; - onContext?: { [key: string]: any; }; - onDblClick?: WebixCallback; - onMouseMove?: WebixCallback; - openAction?: string; - padding?: any; - pager?: any; - position?: string|WebixCallback; - ready?: WebixCallback; - relative?: string; - removeMissed?: boolean; - resize?: boolean; - rules?: any; - save?: string; - scheme?: any; - scroll?: boolean|string; - scrollSpeed?: string; - select?: boolean|string; - subMenuPos?: string; - submenuConfig?: any; - template?: string|WebixCallback; - templateCopy?: WebixCallback; - toFront?: boolean; - tooltip?: string|boolean; - top?: number; - type?: any; - url?: string; - width?: number; - xCount?: number; - yCount?: number; - zIndex?: number; -} -type submenuEventName ='onAfterAdd'|'onAfterContextMenu'|'onAfterDelete'|'onAfterDrop'|'onAfterDropOrder'|'onAfterLoad'|'onAfterRender'|'onAfterScroll'|'onAfterSelect'|'onAfterSort'|'onBeforeAdd'|'onBeforeContextMenu'|'onBeforeDelete'|'onBeforeDrag'|'onBeforeDragIn'|'onBeforeDrop'|'onBeforeDropOrder'|'onBeforeDropOut'|'onBeforeLoad'|'onBeforeRender'|'onBeforeSelect'|'onBeforeShow'|'onBeforeSort'|'onBindRequest'|'onBlur'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onDragOut'|'onFocus'|'onHide'|'onItemClick'|'onItemDblClick'|'onItemRender'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onMenuItemClick'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onPaste'|'onSelectChange'|'onShow'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValidationError'|'onValidationSuccess'|'onViewMove'|'onViewMoveEnd'|'onViewResize'; -class submenu implements webix.ui.baseview{ - add(obj:any, index?:number):string|number; - addCss(id:string|number, css:string, silent?:boolean):void; - adjust():void; - attachEvent(type:submenuEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clearAll():void; - clearCss(css:string, silent?:boolean):void; - clearValidation():void; - close():void; - copy(sid:string|number, tindex:number, tobj?:any, details?:any):void; - count():number; - customize(obj:any):void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - disableItem(id:string|number):void; - enable():void; - enableItem(id:string|number):void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - find(criterion:WebixCallback, first?:boolean):any; - getBody():any; - getChildViews():any[]; - getFirstId():string|number; - getFormView():webix.ui.baseview; - getHead():any; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getItemNode(id:string|number):HTMLElement; - getLastId():string|number; - getMenu(id:string|number):any; - getMenuItem(id:string|number):any; - getNextId(id:string|number, step:number):string|number; - getNode():any; - getPage():number; - getPager():any; - getParentView():any; - getPrevId(id:string|number, step:number):string|number; - getScrollState():any; - getSelectedId(as_array:boolean):string|any[]; - getSelectedItem(as_array:boolean):any; - getSubMenu(id:string|number):any; - getTopMenu():any; - getTopParentView():webix.ui.baseview; - getVisibleCount():number; - hasCss(id:string|number, css:string):boolean; - hasEvent(name:string):boolean; - hide():void; - hideItem(id:string|number):void; - isEnabled():boolean; - isSelected(id:string|number):boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; - locate(e:Event):string|number; - mapEvent(map:any):void; - move(sid:string, tindex:number, tobj?:any, details?:any):string; - moveBottom(id:string|number):void; - moveDown(id:string|number, step:number):void; - moveSelection(direction:string):void; - moveTop(id:string|number):void; - moveUp(id:string|number, step:number):void; - parse(data:any, type:string):void; - refresh(id?:string|number):void; - remove(id:string|number):void; - removeCss(id:string|number, css:string, silent?:boolean):void; - render(id:string|number, data:any, type:string):void; - resize():void; - resizeChildren():void; - scrollTo(x:number, y:number):void; - select(id:string|any[], preserve:boolean):void; - selectAll(from?:string, to?:string):void; - serialize():any; - setPage(page:number):void; - setPosition(x:number, y:number):void; - show(node?:HTMLElement, position?:any, point?:string):void; - showItem(id:string|number):void; - sizeToContent():void; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - unselect(id?:string):void; - unselectAll():void; - updateItem(id:string|number, data:any):void; - validate(id?:string):boolean; - show(force:boolean,animation:boolean):void; - $drag(source:HTMLElement, ev:Event):string; - $dragHTML: WebixCallback; - $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; - $dragMark(context:any, ev:Event):boolean; - $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; - $drop(source:HTMLElement, target:HTMLElement, ev:Event):void; - $dropAllow: WebixCallback; - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: submenuConfig; - name: string; - on_click: WebixCallback; - on_context: { [key: string]: any; }; - on_dblclick: WebixCallback; - on_mouse_move: WebixCallback; - type: { [key: string]: any; }; - types: { [key: string]: any; }; - data:DataStore; - waitData: webix.promise; -} -interface suggestConfig{ - view?: string; - animate?: any; - autofit?: boolean; - autofocus?: boolean; - body?: string|webix.ui.baseview; - borderless?: boolean; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - disabled?: boolean; - filter?: WebixCallback; - fitMaster?: boolean; - gravity?: number; - head?: any; - headHeight?: number; - height?: number; - hidden?: boolean; - id?: string|number; - input?: HTMLElement|string; - keyPressTimeout?: number; - left?: number; - master?: webix.ui.baseview; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - modal?: boolean; - move?: boolean; - on?: EventHash; - padding?: any; - position?: string|WebixCallback; - relative?: string; - resize?: boolean; - template?: string|WebixTemplate; - textValue?: string; - toFront?: boolean; - top?: number; - type?: string; - url?: string; - width?: number; - zIndex?: number; -} -type suggestEventName ='onAfterScroll'|'onBeforeShow'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onHide'|'onKeyPress'|'onLongTouch'|'onShow'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValueSuggest'|'onViewMove'|'onViewMoveEnd'|'onViewResize'; -class suggest implements webix.ui.baseview{ - adjust():void; - attachEvent(type:suggestEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - close():void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getBody():any; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getHead():any; - getItemText(id:string|number):string; - getList():webix.ui.list; - getMasterValue():any; - getNode():any; - getParentView():any; - getSuggestion():string; - getTopParentView():webix.ui.baseview; - getValue():string|number; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - linkInput(input:HTMLElement):void; - mapEvent(map:any):void; - resize():void; - resizeChildren():void; - setMasterValue(value:any):void; - setPosition(x:number, y:number):void; - setValue(value:string|number):void; - show(node:HTMLElement, position?:any, point?:string):void; - unbind():void; - unblockEvent():void; - show(force:boolean,animation:boolean):void; - $enterKey: WebixCallback; - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: suggestConfig; - name: string; -} -interface tabbarConfig{ - view?: string; - align?: string; - animate?: any; - attributes?: any; - autowidth?: boolean; - borderless?: boolean; - bottomLabel?: string; - bottomOffset?: number; - bottomPadding?: number; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - id?: string|number; - inputAlign?: string; - inputHeight?: number; - inputPadding?: number; - inputWidth?: number; - invalid?: boolean; - invalidMessage?: string; - label?: string; - labelAlign?: string; - labelPosition?: string; - labelWidth?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - moreTemplate?: WebixCallback; - multiview?: boolean; - name?: string; - on?: EventHash; - optionWidth?: number; - options?: any; - placeholder?: string; - popup?: string; - popupTemplate?: WebixCallback; - popupWidth?: number; - readonly?: boolean; - relatedAction?: string; - relatedView?: string; - required?: boolean; - suggest?: any; - tabMargin?: number; - tabMinWidth?: number; - tabMoreWidth?: number; - tabOffset?: number; - tabbarPopup?: webix.ui.baseview; - topOffset?: number; - type?: string; - validate?: WebixCallback; - validateEvent?: string; - value?: string|number; - width?: number; - yCount?: number; -} -type tabbarEventName ='onAfterRender'|'onAfterScroll'|'onAfterTabClick'|'onBeforeRender'|'onBeforeTabClick'|'onBeforeTabClose'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onOptionRemove'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class tabbar implements webix.ui.baseview{ - addOption(id:string|number, value:any, show?:boolean, index?:number):void; - adjust():void; - attachEvent(type:tabbarEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getNode():any; - getParentView():any; - getPopup():webix.ui.baseview; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - hideOption(id:string|number):void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - optionIndex(ID:string|number):number; - refresh():void; - removeOption(id:string|number):void; - render(id:string|number, data:any, type:string):void; - resize():void; - setBottomText(text:string):void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - showOption(id:string|number):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - validate():boolean; - - $compareValue: WebixCallback; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $render: WebixCallback; - $renderIcon: WebixCallback; - $renderInput(obj:any, html:string, id:string|number):string; - $renderLabel(config:any, id:string|number):string; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: tabbarConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface tabviewConfig{ - view?: string; - animate?: any; - borderless?: boolean; - cells?: any[]; - cols?: any[]; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - isolate?: boolean; - margin?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - multiview?: any; - on?: EventHash; - padding?: number; - paddingX?: number; - paddingY?: number; - responsive?: string; - rows?: any[]; - tabbar?: any; - type?: string; - visibleBatch?: string; - width?: number; -} -type tabviewEventName ='onBindRequest'|'onDestruct'; -class tabview implements webix.ui.baseview{ - addView(view:any):string|number; - adjust():void; - attachEvent(type:tabviewEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getMultiview():any; - getNode():any; - getParentView():any; - getTabbar():any; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - index(obj:any):number; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - reconstruct():void; - removeView(id:string|number):void; - resize():void; - resizeChildren():void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - showBatch(name:string):void; - unbind():void; - unblockEvent():void; - - $getSize():any[]; - $height: number; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: tabviewConfig; - name: string; -} -interface templateConfig{ - view?: string; - animate?: any; - autoheight?: boolean; - borderless?: boolean; - container?: string|HTMLElement; - content?: string|number|HTMLElement; - css?: string; - data?: string|any[]; - dataFeed?: string|WebixCallback; - datatype?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - on?: EventHash; - onClick?: { [key: string]: any; }; - scroll?: boolean|string; - scrollSpeed?: string; - src?: string; - template?: string|WebixCallback; - type?: string; - url?: string; - width?: number; -} -type templateEventName ='onAfterLoad'|'onAfterRender'|'onAfterScroll'|'onBeforeLoad'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class template implements webix.ui.baseview{ - adjust():void; - attachEvent(type:templateEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getScrollState():any; - getTopParentView():webix.ui.baseview; - getValues():void; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - mapEvent(map:any):void; - parse(data:any, type:string):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - scrollTo(x:number, y:number):void; - setContent(node:any):void; - setHTML(html:string):void; - setValues(obj:any, update?:boolean):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: templateConfig; - name: string; -} -interface textConfig{ - view?: string; - align?: string; - animate?: any; - attributes?: any; - autowidth?: boolean; - borderless?: boolean; - bottomLabel?: string; - bottomPadding?: number; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - icon?: string; - id?: string|number; - inputAlign?: string; - inputHeight?: number; - inputPadding?: number; - inputWidth?: number; - invalid?: boolean; - invalidMessage?: string; - label?: string; - labelAlign?: string; - labelPosition?: string; - labelWidth?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - name?: string; - on?: EventHash; - pattern?: any; - placeholder?: string; - popup?: string; - readonly?: boolean; - relatedAction?: string; - relatedView?: string; - required?: boolean; - suggest?: any; - tooltip?: string; - type?: string; - validate?: WebixCallback; - validateEvent?: string; - value?: string|number; - width?: number; -} -type textEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class text implements webix.ui.baseview{ - adjust():void; - attachEvent(type:textEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - setBottomText(text:string):void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - validate():boolean; - - $compareValue: WebixCallback; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $render: WebixCallback; - $renderIcon: WebixCallback; - $renderInput(config:any):HTMLElement; - $renderLabel(config:any, id:string|number):string; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: textConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface textareaConfig{ - view?: string; - align?: string; - animate?: any; - attributes?: any; - autowidth?: boolean; - borderless?: boolean; - bottomLabel?: string; - bottomPadding?: number; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - id?: string|number; - inputAlign?: string; - inputHeight?: number; - inputPadding?: number; - inputWidth?: number; - invalid?: boolean; - invalidMessage?: string; - label?: string; - labelAlign?: string; - labelPosition?: string; - labelWidth?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - name?: string; - on?: EventHash; - pattern?: any; - placeholder?: string; - popup?: string; - readonly?: boolean; - relatedAction?: string; - relatedView?: string; - required?: boolean; - suggest?: any; - tooltip?: string; - validate?: WebixCallback; - validateEvent?: string; - value?: string|number; - width?: number; -} -type textareaEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class textarea implements webix.ui.baseview{ - adjust():void; - attachEvent(type:textareaEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - setBottomText(text:string):void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - validate():boolean; - - $compareValue: WebixCallback; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $render: WebixCallback; - $renderIcon: WebixCallback; - $renderInput(obj:any, html:string, id:string|number):string; - $renderLabel(config:any, id:string|number):string; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: textareaConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface toggleConfig{ - view?: string; - align?: string; - animate?: any; - autowidth?: boolean; - borderless?: boolean; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - icon?: string; - id?: string|number; - inputHeight?: number; - inputWidth?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - name?: string; - offIcon?: string; - offLabel?: string; - on?: EventHash; - onIcon?: string; - onLabel?: string; - popup?: string; - tooltip?: string; - type?: string; - value?: string|number; - width?: number; -} -type toggleEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onChange'|'onDestruct'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class toggle implements webix.ui.baseview{ - adjust():void; - attachEvent(type:toggleEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - toggle():void; - unbind():void; - unblockEvent():void; - - $compareValue: WebixCallback; - $getSize():any[]; - $getValue():string; - $height: number; - $prepareValue: WebixCallback; - $renderInput(config:any):HTMLElement; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $view: HTMLElement; - $width: number; - config: toggleConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface toolbarConfig{ - view?: string; - animate?: any; - borderless?: boolean; - cols?: any[]; - complexData?: boolean; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - dataFeed?: string|WebixCallback; - datatype?: string; - disabled?: boolean; - elements?: any[]; - elementsConfig?: { [key: string]: any; }; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - isolate?: boolean; - margin?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - on?: EventHash; - padding?: number; - paddingX?: number; - paddingY?: number; - responsive?: string; - rows?: any[]; - rules?: any; - scroll?: boolean|string; - scrollSpeed?: string; - type?: string; - url?: string; - visibleBatch?: string; - width?: number; -} -type toolbarEventName ='onAfterLoad'|'onAfterScroll'|'onAfterValidation'|'onBeforeLoad'|'onBeforeValidate'|'onBindRequest'|'onChange'|'onDestruct'|'onLoadError'|'onValidationError'|'onValidationSuccess'|'onValues'; -class toolbar implements webix.ui.baseview{ - addView(view:any, index?:number):string|number; - adjust():void; - attachEvent(type:toolbarEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clear():void; - clearValidation():void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - focus(item:string):void; - getChildViews():any[]; - getCleanValues():any; - getDirtyValues():any; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getScrollState():any; - getTopParentView():webix.ui.baseview; - getValues(details?:any):{ [key: string]: any; }; - hasEvent(name:string):boolean; - hide():void; - index(obj:any):number; - isDirty():boolean; - isEnabled():boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - mapEvent(map:any):void; - markInvalid(name:string, state?:boolean|string):void; - parse(data:any, type:string):void; - reconstruct():void; - refresh():void; - removeView(id:string|number):void; - render(id:string|number, data:any, type:string):void; - resize():void; - resizeChildren():void; - scrollTo(x:number, y:number):void; - setDirty(mark?:boolean):void; - setValues(values:any, update?:boolean):void; - show(force?:boolean, animation?:boolean):void; - showBatch(name:string):void; - unbind():void; - unblockEvent():void; - validate(mode?:any):boolean; - - $getSize():any[]; - $height: number; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: toolbarConfig; - name: string; -} -interface tooltipConfig{ - view?: string; - animate?: any; - borderless?: boolean; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - dx?: number; - dy?: number; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - on?: EventHash; - template?: string|WebixCallback; - width?: number; -} -type tooltipEventName ='onAfterRender'|'onAfterScroll'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class tooltip{ - adjust():void; - attachEvent(type:tooltipEventName, functor:WebixCallback, id?:string):string|number; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - customize(obj:any):void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - render(id:string|number, data:any, type:string):void; - resize():void; - show(data:any, position:any):void; - unblockEvent():void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: tooltipConfig; - name: string; - type: { [key: string]: any; }; -} -interface treeConfig{ - view?: string; - animate?: any; - borderless?: boolean; - click?: string|WebixCallback; - clipboard?: boolean|string; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - datathrottle?: number; - datatype?: string; - disabled?: boolean; - drag?: boolean; - dragscroll?: boolean|string; - filterMode?: any; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - item?: any; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - mouseEventDelay?: number; - multiselect?: boolean|string; - navigation?: boolean; - on?: EventHash; - onClick?: { [key: string]: any; }; - onContext?: { [key: string]: any; }; - onDblClick?: WebixCallback; - onMouseMove?: WebixCallback; - ready?: WebixCallback; - removeMissed?: boolean; - rules?: any; - save?: string; - scheme?: any; - scroll?: boolean|string; - scrollSpeed?: string; - select?: boolean; - template?: string|WebixCallback; - templateCopy?: WebixCallback; - threeState?: boolean; - tooltip?: string|boolean; - type?: any; - url?: string; - width?: number; -} -type treeEventName ='onAfterAdd'|'onAfterClose'|'onAfterContextMenu'|'onAfterDelete'|'onAfterDrop'|'onAfterDropOrder'|'onAfterLoad'|'onAfterOpen'|'onAfterRender'|'onAfterScroll'|'onAfterSelect'|'onAfterSort'|'onBeforeAdd'|'onBeforeClose'|'onBeforeContextMenu'|'onBeforeDelete'|'onBeforeDrag'|'onBeforeDragIn'|'onBeforeDrop'|'onBeforeDropOrder'|'onBeforeDropOut'|'onBeforeLoad'|'onBeforeOpen'|'onBeforeRender'|'onBeforeSelect'|'onBeforeSort'|'onBindRequest'|'onBlur'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onDragOut'|'onFocus'|'onItemCheck'|'onItemClick'|'onItemDblClick'|'onItemRender'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onPartialRender'|'onPaste'|'onSelectChange'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValidationError'|'onValidationSuccess'|'onViewResize'; -class tree implements webix.ui.baseview{ - add(obj:any, index?:number, parentId?:string):string; - addCss(id:string|number, css:string, silent?:boolean):void; - adjust():void; - attachEvent(type:treeEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - checkAll(id?:string|number):void; - checkItem(id:string):void; - clearAll():void; - clearCss(css:string, silent?:boolean):void; - clearValidation():void; - close(id:string|number):void; - closeAll():void; - copy(sid:string|number, tindex:number, tobj?:webix.ui.baseview, details?:any):string|number; - count():number; - customize(obj:any):void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - find(criterion:WebixCallback, first?:boolean):any; - getBranchIndex(id:string|number, parent?:string|number):number; - getChecked():any[]; - getChildViews():any[]; - getFirstChildId(id:string|number):string; - getFirstId():string|number; - getFormView():webix.ui.baseview; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getItemNode(id:string|number):HTMLElement; - getLastId():string|number; - getNextId(id:string|number, step:number):string|number; - getNextSiblingId(id:string|number):string|number; - getNode():any; - getOpenItems():any[]; - getParentId(id:string|number):string|number; - getParentView():any; - getPrevId(id:string|number, step:number):string|number; - getPrevSiblingId(id:string|number):string|number; - getScrollState():any; - getSelectedId(as_array:boolean):string|any[]; - getSelectedItem(as_array:boolean):any; - getState():any; - getTopParentView():webix.ui.baseview; - group(config:any, mode:boolean):void; - hasCss(id:string|number, css:string):boolean; - hasEvent(name:string):boolean; - hide():void; - isBranch(id:string|number):boolean; - isBranchOpen(id:string|number):boolean; - isChecked(id:string|number):boolean; - isEnabled():boolean; - isSelected(id:string|number):boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - loadBranch(id:string|number, callback:WebixCallback, url:string):void; - loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; - locate(e:Event):string|number; - mapEvent(map:any):void; - move(sid:string, tindex:number, tobj?:any, details?:any):string; - moveSelection(direction:string):void; - open(id:string|number, show?:boolean):void; - openAll():void; - parse(data:any, type:string):void; - refresh(id?:string|number):void; - remove(id:string|number):void; - removeCss(id:string|number, css:string, silent?:boolean):void; - render(id:string|number, data:any, type:string):void; - resize():void; - scrollTo(x:number, y:number):void; - select(id:string|any[], preserve:boolean):void; - selectAll(from?:string, to?:string):void; - serialize():any; - setState(state:any):void; - show(force?:boolean, animation?:boolean):void; - showItem(id:string|number):void; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - uncheckAll(id?:string|number):void; - uncheckItem(id:string):void; - ungroup(mode:boolean):void; - unselect(id?:string):void; - unselectAll():void; - updateItem(id:string|number, data:any):void; - validate(id?:string):boolean; - - $drag(source:HTMLElement, ev:Event):string; - $dragHTML: WebixCallback; - $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; - $dragMark(context:any, ev:Event):boolean; - $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; - $drop(source:HTMLElement, target:HTMLElement, ev:Event):void; - $dropAllow: WebixCallback; - $fixEditor: WebixCallback; - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: treeConfig; - name: string; - on_click: WebixCallback; - on_context: { [key: string]: any; }; - on_dblclick: WebixCallback; - on_mouse_move: WebixCallback; - type: { [key: string]: any; }; - types: { [key: string]: any; }; - data:DataStore; - waitData: webix.promise; -} -interface treemapConfig{ - view?: string; - activeItem?: boolean; - animate?: any; - borderless?: boolean; - branch?: string; - click?: string|WebixCallback; - clipboard?: boolean|string; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - dataFeed?: string|WebixCallback; - datathrottle?: number; - datatype?: string; - disabled?: boolean; - filterMode?: any; - gravity?: number; - header?: boolean; - headerHeight?: number; - headerTemplate?: string; - height?: number; - hidden?: boolean; - id?: string|number; - item?: any; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - mouseEventDelay?: number; - multiselect?: boolean; - navigation?: boolean; - on?: EventHash; - onClick?: { [key: string]: any; }; - onContext?: { [key: string]: any; }; - onDblClick?: WebixCallback; - onMouseMove?: WebixCallback; - pager?: any; - ready?: WebixCallback; - removeMissed?: boolean; - rules?: any; - save?: string; - scheme?: any; - scroll?: boolean|string; - scrollSpeed?: string; - select?: boolean|string; - subRender?: boolean; - template?: string|WebixCallback; - templateCopy?: WebixCallback; - threeState?: boolean; - tooltip?: string|boolean; - type?: any; - url?: string; - value?: string|WebixCallback; - width?: number; -} -type treemapEventName ='onAfterAdd'|'onAfterClose'|'onAfterContextMenu'|'onAfterDelete'|'onAfterLoad'|'onAfterOpen'|'onAfterRender'|'onAfterScroll'|'onAfterSelect'|'onAfterSort'|'onBeforeAdd'|'onBeforeClose'|'onBeforeContextMenu'|'onBeforeDelete'|'onBeforeLoad'|'onBeforeOpen'|'onBeforeRender'|'onBeforeSelect'|'onBeforeSort'|'onBindRequest'|'onBlur'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onFocus'|'onItemCheck'|'onItemClick'|'onItemDblClick'|'onItemRender'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onPartialRender'|'onPaste'|'onSelectChange'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValidationError'|'onValidationSuccess'|'onViewResize'; -class treemap implements webix.ui.baseview{ - add(obj:any, index?:number):string|number; - addCss(id:string|number, css:string, silent?:boolean):void; - adjust():void; - attachEvent(type:treemapEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clearAll():void; - clearCss(css:string, silent?:boolean):void; - clearValidation():void; - close(id:string|number):void; - closeAll():void; - count():number; - customize(obj:any):void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - find(criterion:WebixCallback, first?:boolean):any; - getBranchIndex(id:string|number, parent?:string|number):number; - getChildViews():any[]; - getFirstChildId(id:string|number):string; - getFirstId():string|number; - getFormView():webix.ui.baseview; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getItemNode(id:string|number):HTMLElement; - getLastId():string|number; - getNextId(id:string|number, step:number):string|number; - getNextSiblingId(id:string|number):string|number; - getNode():any; - getOpenItems():any[]; - getPage():number; - getPager():any; - getParentId(id:string|number):string|number; - getParentView():any; - getPrevId(id:string|number, step:number):string|number; - getPrevSiblingId(id:string|number):string|number; - getScrollState():any; - getSelectedId(as_array:boolean):string|any[]; - getSelectedItem(as_array:boolean):any; - getState():any; - getTopParentView():webix.ui.baseview; - group(config:any, mode:boolean):void; - hasCss(id:string|number, css:string):boolean; - hasEvent(name:string):boolean; - hide():void; - isBranch(id:string|number):boolean; - isBranchOpen(id:string|number):boolean; - isEnabled():boolean; - isSelected(id:string|number):boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - loadBranch(id:string|number, callback:WebixCallback, url:string):void; - loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; - locate(e:Event):string|number; - mapEvent(map:any):void; - moveSelection(direction:string):void; - open(id:string|number, show?:boolean):void; - openAll():void; - parse(data:any, type:string):void; - refresh(id?:string|number):void; - remove(id:string|number):void; - removeCss(id:string|number, css:string, silent?:boolean):void; - render(id:string|number, data:any, type:string):void; - resize():void; - scrollTo(x:number, y:number):void; - select(id:string|any[], preserve:boolean):void; - selectAll(from?:string, to?:string):void; - serialize():any; - setPage(page:number):void; - setState(state:any):void; - show(force?:boolean, animation?:boolean):void; - showBranch(branchId:string|number):void; - showItem(id:string|number):void; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - ungroup(mode:boolean):void; - unselect(id?:string):void; - unselectAll():void; - updateItem(id:string|number, data:any):void; - validate(id?:string):boolean; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: treemapConfig; - name: string; - on_click: WebixCallback; - on_context: { [key: string]: any; }; - on_dblclick: WebixCallback; - on_mouse_move: WebixCallback; - type: { [key: string]: any; }; - types: { [key: string]: any; }; - data:DataStore; - waitData: webix.promise; -} -interface treetableConfig{ - view?: string; - animate?: any; - areaselect?: boolean; - autoConfig?: boolean; - autoheight?: boolean; - autowidth?: boolean; - blockselect?: boolean|string; - borderless?: boolean; - checkboxRefresh?: boolean; - clipboard?: boolean|string; - columnWidth?: number; - columns?: any[]; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - datafetch?: number; - datathrottle?: number; - datatype?: string; - delimiter?: any; - disabled?: boolean; - drag?: boolean|string; - dragColumn?: boolean|string; - dragscroll?: boolean|string; - editMath?: boolean; - editValue?: string; - editable?: boolean; - editaction?: string; - externalData?: WebixCallback; - filterMode?: any; - fixedRowHeight?: boolean; - footer?: boolean; - form?: string; - gravity?: number; - header?: boolean; - headerRowHeight?: number; - headermenu?: any; - height?: number; - hidden?: boolean; - hover?: string; - id?: string|number; - leftSplit?: number; - liveValidation?: boolean; - loadahead?: number; - map?: any; - math?: boolean; - maxHeight?: number; - maxWidth?: number; - minColumnHeight?: number; - minColumnWidth?: number; - minHeight?: number; - minWidth?: number; - mouseEventDelay?: number; - multiselect?: boolean; - navigation?: boolean; - on?: EventHash; - onClick?: { [key: string]: any; }; - onContext?: { [key: string]: any; }; - onDblClick?: WebixCallback; - onMouseMove?: WebixCallback; - pager?: any; - prerender?: boolean; - ready?: WebixCallback; - removeMissed?: boolean; - resizeColumn?: any; - resizeRow?: boolean; - rightSplit?: number; - rowHeight?: number; - rowLineHeight?: number; - rules?: any; - save?: string; - scheme?: any; - scroll?: boolean|string; - scrollAlignY?: boolean; - scrollX?: boolean; - scrollY?: boolean; - select?: boolean|string; - spans?: any[]; - subRowHeight?: string; - subrow?: string; - subview?: webix.ui.baseview; - threeState?: boolean; - tooltip?: boolean; - topSplit?: number; - type?: any; - url?: string; - width?: number; - yCount?: number; -} -type treetableEventName ='onAfterAdd'|'onAfterAreaAdd'|'onAfterAreaRemove'|'onAfterBlockSelect'|'onAfterClose'|'onAfterColumnDrop'|'onAfterColumnDropOrder'|'onAfterColumnHide'|'onAfterColumnShow'|'onAfterContextMenu'|'onAfterDelete'|'onAfterDrop'|'onAfterDropOrder'|'onAfterEditStart'|'onAfterEditStop'|'onAfterFilter'|'onAfterLoad'|'onAfterOpen'|'onAfterRender'|'onAfterScroll'|'onAfterSelect'|'onAfterSort'|'onAfterUnSelect'|'onAreaDrag'|'onBeforeAdd'|'onBeforeAreaAdd'|'onBeforeAreaRemove'|'onBeforeBlockSelect'|'onBeforeClose'|'onBeforeColumnDrag'|'onBeforeColumnDrop'|'onBeforeColumnDropOrder'|'onBeforeColumnHide'|'onBeforeColumnShow'|'onBeforeContextMenu'|'onBeforeDelete'|'onBeforeDrag'|'onBeforeDragIn'|'onBeforeDrop'|'onBeforeDropOrder'|'onBeforeDropOut'|'onBeforeEditStart'|'onBeforeEditStop'|'onBeforeFilter'|'onBeforeLoad'|'onBeforeOpen'|'onBeforeRender'|'onBeforeSelect'|'onBeforeSort'|'onBeforeUnSelect'|'onBindRequest'|'onBlur'|'onCheck'|'onCollectValues'|'onColumnResize'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onDragOut'|'onEditorChange'|'onFocus'|'onHeaderClick'|'onItemCheck'|'onItemClick'|'onItemDblClick'|'onKeyPress'|'onLiveEdit'|'onLoadError'|'onLongTouch'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onResize'|'onRowResize'|'onScrollX'|'onScrollY'|'onSelectChange'|'onStructureLoad'|'onStructureUpdate'|'onSubViewClose'|'onSubViewCreate'|'onSubViewOpen'|'onSubViewRender'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValidationError'|'onValidationSuccess'|'onViewResize'; -class treetable implements webix.ui.baseview{ - add(obj:any, index?:number, parentId?:string):string; - addCellCss(id:string, name:string, css:string):void; - addCss(id:string|number, css:string, silent?:boolean):void; - addRowCss(id:string, css:string):void; - adjust():void; - adjustColumn(id:string|number, header?:string):void; - adjustRowHeight(columnId:string, silent:boolean):void; - attachEvent(type:treetableEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - checkAll(id?:string|number):void; - checkItem(id:string):void; - clearAll():void; - clearCss(css:string, silent?:boolean):void; - clearValidation():void; - close(id:string|number):void; - closeAll():void; - collectValues(id:string|number):any[]; - columnId(index:number):string|number; - copy(sid:string|number, tindex:number, tobj?:webix.ui.baseview, details?:any):string|number; - count():number; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - eachColumn(handler:WebixCallback, all?:boolean):void; - eachRow(handler:WebixCallback):void; - edit(id:any):void; - editCancel():void; - editCell(row:string|number, col:string|number, preserve?:boolean, show?:boolean):void; - editColumn(id:string):void; - editNext():boolean; - editRow(id:string):void; - editStop():void; - enable():void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - filterByAll():void; - find(criterion:WebixCallback, first?:boolean):any; - focusEditor():void; - freezeRow(id:number|string, state:boolean):void; - getBranchIndex(id:string|number, parent?:string|number):number; - getChecked():any[]; - getChildViews():any[]; - getColumnConfig(id:string):any; - getColumnIndex(id:string|number):number; - getCss(rowId:string|number, columnId:string|number):string; - getEditState():any; - getEditor(row?:any, column?:string|number):any; - getEditorValue():string; - getFilter(columnID:string|number):any; - getFirstChildId(id:string|number):string; - getFirstId():string|number; - getFormView():webix.ui.baseview; - getHeaderContent(id:string|number):{ [key: string]: any; }; - getHeaderNode(columnId:string, rowIndex?:number):HTMLElement; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getItemNode(id:string|number):HTMLElement; - getLastId():string|number; - getNextId(id:string|number, step:number):string|number; - getNextSiblingId(id:string|number):string|number; - getNode():any; - getOpenItems():any[]; - getPage():number; - getPager():any; - getParentId(id:string|number):string|number; - getParentView():any; - getPrevId(id:string|number, step:number):string|number; - getPrevSiblingId(id:string|number):string|number; - getScrollState():any; - getSelectedId(asArray:boolean, asString:boolean):any; - getSelectedItem(as_array?:boolean):any; - getState():any; - getText(rowid:string|number, colid:string|number):string; - getTopParentView():webix.ui.baseview; - getVisibleCount():number; - group(config:any, mode:boolean):void; - hasCss(id:string|number, css:string):boolean; - hasEvent(name:string):boolean; - hide():void; - hideColumn(id:string|number):void; - hideOverlay():void; - isBranch(id:string|number):boolean; - isBranchOpen(id:string|number):boolean; - isChecked(id:string|number):boolean; - isColumnVisible(id:string|number):boolean; - isEnabled():boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - loadBranch(id:string|number, callback:WebixCallback, url:string):void; - loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; - locate(node:HTMLElement|Event):any; - mapCells(startrow:number, startcol:string, numrows:number, numcols:number, callback:WebixCallback):void; - mapEvent(map:any):void; - markSorting(column_id:string, direction:string):void; - move(sid:string|number, tindex:number, tobj?:webix.ui.baseview, details?:any):string|number; - moveBottom(id:string|number):void; - moveColumn(id:string, index:number):void; - moveDown(id:string|number, step:number):void; - moveSelection(direction:string):void; - moveTop(id:string|number):void; - moveUp(id:string|number, step:number):void; - open(id:string|number, show?:boolean):void; - openAll():void; - parse(data:any, type:string):void; - refresh(id?:string|number):void; - refreshColumns(config?:any[], reset?:boolean):void; - refreshFilter(id:string|number):void; - refreshHeaderContent():void; - registerFilter(object:any, config:any, controller:any):void; - remove(id:string|number):void; - removeCellCss(id:string, name:string, css_name:string):void; - removeCss(id:string|number, css:string, silent?:boolean):void; - removeRowCss(id:string, css_name:string):void; - render(id:string|number, data:any, operation:string):void; - resize():void; - scrollTo(x:number, y:number):void; - serialize():any; - setColumnWidth(id:string|number, width:number):void; - setPage(page:number):void; - setRowHeight(id:string|number, height:number):void; - setState(state:any):void; - show(force?:boolean, animation?:boolean):void; - showCell(row:string, column:string):void; - showColumn(id:string|number):void; - showColumnBatch(batch:string|number, preserve:boolean):void; - showItem(id:string|number):void; - showItemByIndex(index:number):void; - showOverlay(message:string):void; - sort(by:string, dir?:string, as?:string):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - uncheckAll(id?:string|number):void; - uncheckItem(id:string):void; - ungroup(mode:boolean):void; - updateItem(id:string|number, data:any):void; - validate(id?:string):boolean; - validateEditor(id?:string|number):boolean; - - $drag(source:HTMLElement, ev:Event):string; - $dragHTML: WebixCallback; - $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; - $dragMark(context:any, ev:Event):boolean; - $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; - $drop(source:HTMLElement, target:HTMLElement, ev:Event):void; - $dropAllow: WebixCallback; - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: treetableConfig; - headerContent: any; - name: string; - on_click: WebixCallback; - on_context: { [key: string]: any; }; - on_dblclick: WebixCallback; - on_mouse_move: WebixCallback; - data:DataStore; - waitData: webix.promise; -} -interface unitlistConfig{ - view?: string; - animate?: any; - autoheight?: boolean; - autowidth?: boolean; - borderless?: boolean; - click?: string|WebixCallback; - clipboard?: boolean|string; - container?: string|HTMLElement; - css?: string; - data?: string|any[]; - datathrottle?: number; - datatype?: string; - disabled?: boolean; - drag?: boolean|string; - dragscroll?: boolean|string; - externalData?: WebixCallback; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - item?: any; - layout?: string; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - mouseEventDelay?: number; - multiselect?: boolean; - navigation?: boolean; - on?: EventHash; - onClick?: { [key: string]: any; }; - onContext?: { [key: string]: any; }; - onDblClick?: WebixCallback; - onMouseMove?: WebixCallback; - pager?: any; - ready?: WebixCallback; - removeMissed?: boolean; - rules?: any; - save?: string; - scheme?: any; - scroll?: boolean|string; - scrollSpeed?: string; - select?: boolean|string; - template?: string|WebixCallback; - templateCopy?: WebixCallback; - tooltip?: string|boolean; - type?: any; - uniteBy?: WebixCallback; - url?: string; - width?: number; - xCount?: number; - yCount?: number; -} -type unitlistEventName ='onAfterAdd'|'onAfterContextMenu'|'onAfterDelete'|'onAfterDrop'|'onAfterDropOrder'|'onAfterLoad'|'onAfterRender'|'onAfterScroll'|'onAfterSelect'|'onAfterSort'|'onBeforeAdd'|'onBeforeContextMenu'|'onBeforeDelete'|'onBeforeDrag'|'onBeforeDragIn'|'onBeforeDrop'|'onBeforeDropOrder'|'onBeforeDropOut'|'onBeforeLoad'|'onBeforeRender'|'onBeforeSelect'|'onBeforeSort'|'onBindRequest'|'onBlur'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onDragOut'|'onFocus'|'onItemClick'|'onItemDblClick'|'onItemRender'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onPaste'|'onSelectChange'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValidationError'|'onValidationSuccess'|'onViewResize'; -class unitlist implements webix.ui.baseview{ - add(obj:any, index?:number):string|number; - addCss(id:string|number, css:string, silent?:boolean):void; - adjust():void; - attachEvent(type:unitlistEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - clearAll():void; - clearCss(css:string, silent?:boolean):void; - clearValidation():void; - copy(sid:string|number, tindex:number, tobj?:any, details?:any):void; - count():number; - customize(obj:any):void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - exists(id:string|number):boolean; - filter(text:string|WebixTemplate|WebixCallback, value:string, preserve:boolean):void; - find(criterion:WebixCallback, first?:boolean):any; - getChildViews():any[]; - getFirstId():string|number; - getFormView():webix.ui.baseview; - getIdByIndex(index:number):string|number; - getIndexById(id:string|number):number; - getItem(id:string|number):any; - getItemNode(id:string|number):HTMLElement; - getLastId():string|number; - getNextId(id:string|number, step:number):string|number; - getNode():any; - getPage():number; - getPager():any; - getParentView():any; - getPrevId(id:string|number, step:number):string|number; - getScrollState():any; - getSelectedId(as_array:boolean):string|any[]; - getSelectedItem(as_array:boolean):any; - getTopParentView():webix.ui.baseview; - getUnitList(name:string):any[]; - getUnits():any[]; - getVisibleCount():number; - hasCss(id:string|number, css:string):boolean; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isSelected(id:string|number):boolean; - isVisible():boolean; - load(url:string, type?:string, callback?:WebixCallback):webix.promise; - loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; - locate(e:Event):string|number; - mapEvent(map:any):void; - move(sid:string, tindex:number, tobj?:any, details?:any):string; - moveBottom(id:string|number):void; - moveDown(id:string|number, step:number):void; - moveSelection(direction:string):void; - moveTop(id:string|number):void; - moveUp(id:string|number, step:number):void; - parse(data:any, type:string):void; - refresh(id?:string|number):void; - remove(id:string|number):void; - removeCss(id:string|number, css:string, silent?:boolean):void; - render(id:string|number, data:any, type:string):void; - resize():void; - scrollTo(x:number, y:number):void; - select(id:string|any[], preserve:boolean):void; - selectAll(from?:string, to?:string):void; - serialize():any; - setPage(page:number):void; - show(force?:boolean, animation?:boolean):void; - showItem(id:string|number):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - unselect(id?:string):void; - unselectAll():void; - updateItem(id:string|number, data:any):void; - validate(id?:string):boolean; - - $drag(source:HTMLElement, ev:Event):string; - $dragHTML: WebixCallback; - $dragIn(source:HTMLElement, target:HTMLElement, ev:Event):HTMLElement; - $dragMark(context:any, ev:Event):boolean; - $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; - $drop(source:HTMLElement, target:HTMLElement, ev:Event):void; - $dropAllow: WebixCallback; - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: unitlistConfig; - name: string; - on_click: WebixCallback; - on_context: { [key: string]: any; }; - on_dblclick: WebixCallback; - on_mouse_move: WebixCallback; - type: { [key: string]: any; }; - types: { [key: string]: any; }; - data:DataStore; - waitData: webix.promise; -} -interface uploaderConfig{ - view?: string; - align?: string; - animate?: any; - apiOnly?: boolean; - autosend?: boolean; - autowidth?: boolean; - borderless?: boolean; - click?: WebixCallback; - container?: string|HTMLElement; - css?: string; - datatype?: string; - directory?: string; - disabled?: boolean; - formData?: { [key: string]: any; }; - gravity?: number; - height?: number; - hidden?: boolean; - hotkey?: string; - id?: string|number; - inputHeight?: number; - inputName?: string; - inputWidth?: number; - label?: string; - link?: string; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - multiple?: boolean; - name?: string; - on?: EventHash; - popup?: string; - tooltip?: string; - type?: string; - upload?: string; - urlData?: { [key: string]: any; }; - value?: string|number; - width?: number; -} -type uploaderEventName ='onAfterFileAdd'|'onAfterRender'|'onAfterScroll'|'onBeforeFileAdd'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onDestruct'|'onFileUpload'|'onFileUploadError'|'onFocus'|'onItemClick'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onUploadComplete'|'onViewResize'; -class uploader implements webix.ui.baseview{ - addDropZone(element:HTMLElement):void; - addFile(name:string, size:number, type?:string):void; - adjust():void; - attachEvent(type:uploaderEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - blur():void; - callEvent(name:string, params:any[]):boolean; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - fileDialog(content?:any):void; - focus():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getInputNode():HTMLElement; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getValue():string; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isUploaded():boolean; - isVisible():boolean; - mapEvent(map:any):void; - refresh():void; - render(id:string|number, data:any, type:string):void; - resize():void; - send(id:number|string|WebixCallback):void; - setValue(value:string):void; - show(force?:boolean, animation?:boolean):void; - stopUpload(id:string|number):void; - sync(source:any, filter:WebixCallback, silent:boolean):void; - unbind():void; - unblockEvent():void; - - $compareValue: WebixCallback; - $cssName: string; - $getSize():any[]; - $getValue():string; - $height: number; - $onUploadComplete: WebixCallback; - $prepareValue: WebixCallback; - $renderInput(config:any):HTMLElement; - $scope: any; - $setSize(x:number, y:number):boolean; - $setValue(value:string):void; - $skin: any; - $updateProgress: WebixCallback; - $view: HTMLElement; - $width: number; - config: uploaderConfig; - name: string; - on_click: WebixCallback; - touchable: boolean; -} -interface videoConfig{ - view?: string; - animate?: any; - borderless?: boolean; - container?: string|HTMLElement; - controls?: boolean; - css?: string; - disabled?: boolean; - gravity?: number; - height?: number; - hidden?: boolean; - id?: string|number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - src?: string; - width?: number; -} -type videoEventName ='onAfterScroll'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onKeyPress'|'onLongTouch'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; -class video implements webix.ui.baseview{ - adjust():void; - bind(target:any, rule?:WebixCallback, format?:string):void; - define(property:string, value:any):void; - destructor():void; - disable():void; - enable():void; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - getVideo():void; - hide():void; - isEnabled():boolean; - isVisible():boolean; - resize():void; - show(force?:boolean, animation?:boolean):void; - unbind():void; - - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: videoConfig; - name: string; -} -interface windowConfig{ - view?: string; - animate?: any; - autofit?: boolean; - autofocus?: boolean; - body?: string|webix.ui.baseview; - borderless?: boolean; - container?: string|HTMLElement; - css?: string; - disabled?: boolean; - fullscreen?: boolean; - gravity?: number; - head?: any; - headHeight?: number; - height?: number; - hidden?: boolean; - id?: string|number; - left?: number; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - modal?: boolean; - move?: boolean; - on?: EventHash; - padding?: any; - position?: string|WebixCallback; - relative?: string; - resize?: boolean; - toFront?: boolean; - top?: number; - width?: number; - zIndex?: number; -} -type windowEventName ='onAfterScroll'|'onBeforeShow'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onHide'|'onKeyPress'|'onLongTouch'|'onShow'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewMove'|'onViewMoveEnd'|'onViewResize'; -class window implements webix.ui.baseview{ - adjust():void; - attachEvent(type:windowEventName, functor:WebixCallback, id?:string):string|number; - bind(target:any, rule?:WebixCallback, format?:string):void; - blockEvent():void; - callEvent(name:string, params:any[]):boolean; - close():void; - define(property:string, value:any):void; - destructor():void; - detachEvent(id:string):void; - disable():void; - enable():void; - getBody():any; - getChildViews():any[]; - getFormView():webix.ui.baseview; - getHead():any; - getNode():any; - getParentView():any; - getTopParentView():webix.ui.baseview; - hasEvent(name:string):boolean; - hide():void; - isEnabled():boolean; - isVisible():boolean; - mapEvent(map:any):void; - resize():void; - resizeChildren():void; - setPosition(x:number, y:number):void; - show(node?:HTMLElement, position?:any, point?:string):void; - unbind():void; - unblockEvent():void; - show(force:boolean,animation:boolean):void; - $getSize():any[]; - $height: number; - $scope: any; - $setSize(x:number, y:number):boolean; - $skin: any; - $view: HTMLElement; - $width: number; - config: windowConfig; - name: string; -} - -}} - -declare function $$(id: string | Event | HTMLElement): webix.ui.baseview; diff --git a/types/webix/tsconfig.json b/types/webix/tsconfig.json deleted file mode 100644 index 5b395aed79..0000000000 --- a/types/webix/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "files": [ - "index.d.ts", - "webix-tests.ts" - ], - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": false, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - } -} \ No newline at end of file diff --git a/types/webix/tslint.json b/types/webix/tslint.json deleted file mode 100644 index a41bf5d19a..0000000000 --- a/types/webix/tslint.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "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 - } -} diff --git a/types/webix/webix-tests.ts b/types/webix/webix-tests.ts deleted file mode 100755 index 1c1e9c9b02..0000000000 --- a/types/webix/webix-tests.ts +++ /dev/null @@ -1,115 +0,0 @@ -//ajax operations -webix.ready(function(){ - webix.ajax().get("te").then(function(){ - webix.message( webix.env.isFF ? "FireFox" : "Other" ); - }); -}); - -//webix helpers -webix.html.addCss(document.body, "text"); -webix.storage.local.get("mydata"); - -var proxy = webix.proxy("meteor", "books"); - -//webix ui helpers -webix.ui.zIndexBase = 101; -webix.ui.zIndex(); -webix.ui.resize(); - -//webix ui constructor -//basic view -var ui = webix.ui({ - view:"list", id:"l1" -}); -ui.adjust(); -$$("l1").adjust(); - -var l1 = {}; -var l2 = {}; - -//specific view types -var ui2 = webix.ui({ - view:"list", id:"21" -}); -ui2.add({ value:"100" }); - -//specific types by id -var list = $$("l1"); -list.add({ value:"100" }); -list.config.height = 100; - - - - -//config typing -var table:webix.ui.datatableConfig = {}; -table.columns = []; -table.autowidth = true; - -webix.ui({ rows:[ table ] }); - -//events -list.attachEvent("onItemClick", function(id:string, e:Event){ - var item = (this).getItem(id); - var self = webix.$$(e); - return true; -}); - -//data collections -var data = new webix.DataCollection(); -data.config["test"]= 123; - -//mixins -var t = webix.DataDriver.json; - -//each ui type has its own events and config options -var tObj = $$("table"); -tObj.attachEvent("onAfterOpen", () => false); -tObj.config.threeState = false; - -var mObj = $$("menu"); -mObj.attachEvent("onMenuItemClick", () => false); -mObj.config.submenuConfig = {}; - -//template cna be a function or a string -mObj.config.template = ""; -mObj.config.template = (obj) => obj.str; - - -//getList return a list -var suggestBox = $$("suggest"); -var list = suggestBox.getList() -var listData = list.serialize(); - -//creating a new UI - -//this is public interface -interface myUI extends webix.ui.list{ - customApi():number; -} -//and this is the actual implementations -var next = webix.protoUI({ - name:"myUI", - customApi(){ - webix.message("test"); - return 1; - } -}, webix.ui.list, webix.EditAbility, webix.EventSystem); - -//test method of new UI -var my = webix.ui({ - view:"myUI" -}); -var tn:number = my.customApi(); - -//datastore -var t = my.data.getItem(1) -var mSize = webix.html.getTextSize( [].concat(my.data.order).map((a) => a.value )) - -//filters -namespace webix.ui.datafilter{ - var avgColumn = webix.extend({ - refresh:function(){ - } - }, webix.ui.datafilter.summColumn) -} diff --git a/types/webmidi/tsconfig.json b/types/webmidi/tsconfig.json index f7669ef043..d8866e8bf0 100644 --- a/types/webmidi/tsconfig.json +++ b/types/webmidi/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webpack-bundle-analyzer/tsconfig.json b/types/webpack-bundle-analyzer/tsconfig.json index a1bea1a472..efaef323a6 100644 --- a/types/webpack-bundle-analyzer/tsconfig.json +++ b/types/webpack-bundle-analyzer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webpack-chain/tsconfig.json b/types/webpack-chain/tsconfig.json index 45d1deba96..ac5b5af8a0 100644 --- a/types/webpack-chain/tsconfig.json +++ b/types/webpack-chain/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webpack-chain/webpack-chain-tests.ts b/types/webpack-chain/webpack-chain-tests.ts index 07593687cf..bd83dfbccb 100644 --- a/types/webpack-chain/webpack-chain-tests.ts +++ b/types/webpack-chain/webpack-chain-tests.ts @@ -1,4 +1,4 @@ -import * as Config from 'webpack-chain'; +import Config = require('webpack-chain'); import * as webpack from 'webpack'; const config = new Config(); diff --git a/types/webpack-chunk-hash/tsconfig.json b/types/webpack-chunk-hash/tsconfig.json index 3d85a2216d..138bc94dc8 100644 --- a/types/webpack-chunk-hash/tsconfig.json +++ b/types/webpack-chunk-hash/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webpack-cleanup-plugin/tsconfig.json b/types/webpack-cleanup-plugin/tsconfig.json index f2712d3d73..3421df6c6b 100644 --- a/types/webpack-cleanup-plugin/tsconfig.json +++ b/types/webpack-cleanup-plugin/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "webpack-cleanup-plugin-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/webpack-dev-middleware/tsconfig.json b/types/webpack-dev-middleware/tsconfig.json index 1688c1d7f3..f65edd0eff 100644 --- a/types/webpack-dev-middleware/tsconfig.json +++ b/types/webpack-dev-middleware/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webpack-dev-middleware/v1/tsconfig.json b/types/webpack-dev-middleware/v1/tsconfig.json index 32d37ba3c6..b1e6c31942 100644 --- a/types/webpack-dev-middleware/v1/tsconfig.json +++ b/types/webpack-dev-middleware/v1/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webpack-dev-middleware/v1/webpack-dev-middleware-tests.ts b/types/webpack-dev-middleware/v1/webpack-dev-middleware-tests.ts index 8df4675595..179924ef66 100644 --- a/types/webpack-dev-middleware/v1/webpack-dev-middleware-tests.ts +++ b/types/webpack-dev-middleware/v1/webpack-dev-middleware-tests.ts @@ -1,6 +1,6 @@ -import * as express from 'express'; -import * as webpack from 'webpack'; -import * as webpackDevMiddleware from 'webpack-dev-middleware'; +import express = require('express'); +import webpack = require('webpack'); +import webpackDevMiddleware = require('webpack-dev-middleware'); const compiler = webpack({}); diff --git a/types/webpack-dev-middleware/webpack-dev-middleware-tests.ts b/types/webpack-dev-middleware/webpack-dev-middleware-tests.ts index 2ccfb90a0c..beb3c1abe6 100644 --- a/types/webpack-dev-middleware/webpack-dev-middleware-tests.ts +++ b/types/webpack-dev-middleware/webpack-dev-middleware-tests.ts @@ -1,6 +1,6 @@ -import * as express from 'express'; -import * as webpack from 'webpack'; -import * as webpackDevMiddleware from 'webpack-dev-middleware'; +import express = require('express'); +import webpack = require('webpack'); +import webpackDevMiddleware = require('webpack-dev-middleware'); const compiler = webpack({}); diff --git a/types/webpack-dev-server/tsconfig.json b/types/webpack-dev-server/tsconfig.json index 93410e23ab..ad6295996f 100644 --- a/types/webpack-dev-server/tsconfig.json +++ b/types/webpack-dev-server/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webpack-dev-server/webpack-dev-server-tests.ts b/types/webpack-dev-server/webpack-dev-server-tests.ts index e13babe83c..a288ea51be 100644 --- a/types/webpack-dev-server/webpack-dev-server-tests.ts +++ b/types/webpack-dev-server/webpack-dev-server-tests.ts @@ -1,5 +1,5 @@ -import * as webpack from 'webpack'; -import * as WebpackDevServer from 'webpack-dev-server'; +import webpack = require('webpack'); +import WebpackDevServer = require('webpack-dev-server'); import * as core from 'express-serve-static-core'; const compiler = webpack({}); const multipleCompiler = webpack([]); diff --git a/types/webpack-dotenv-plugin/tsconfig.json b/types/webpack-dotenv-plugin/tsconfig.json index f0b09e0b58..32a3d18337 100644 --- a/types/webpack-dotenv-plugin/tsconfig.json +++ b/types/webpack-dotenv-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webpack-dotenv-plugin/webpack-dotenv-plugin-tests.ts b/types/webpack-dotenv-plugin/webpack-dotenv-plugin-tests.ts index 8ea3993d39..a757b7d718 100644 --- a/types/webpack-dotenv-plugin/webpack-dotenv-plugin-tests.ts +++ b/types/webpack-dotenv-plugin/webpack-dotenv-plugin-tests.ts @@ -1,5 +1,5 @@ import * as webpack from 'webpack'; -import * as DotenvPlugin from 'webpack-dotenv-plugin'; +import DotenvPlugin = require('webpack-dotenv-plugin'); const config: webpack.Configuration = { plugins: [ diff --git a/types/webpack-env/index.d.ts b/types/webpack-env/index.d.ts index 9d866cbba8..1f03a25647 100644 --- a/types/webpack-env/index.d.ts +++ b/types/webpack-env/index.d.ts @@ -31,8 +31,7 @@ declare namespace __WebpackModuleApi { * * This creates a chunk. The chunk can be named. If a chunk with this name already exists, the dependencies are merged into that chunk and that chunk is used. */ - ensure(paths: string[], callback: (require: (id: string) => any) => void, chunkName?: string): void; - ensure(paths: string[], callback: (require: (id: string) => T) => void, chunkName?: string): void; + ensure(paths: string[], callback: (require: NodeRequire) => void, chunkName?: string): void; context(path: string, deep?: boolean, filter?: RegExp): RequireContext; /** * Returns the module id of a dependency. The call is sync. No request to the server is fired. The compiler ensures that the dependency is available. @@ -43,7 +42,7 @@ declare namespace __WebpackModuleApi { /** * Like require.resolve, but doesn’t include the module into the bundle. It’s a weak dependency. */ - resolveWeak(path: string): number; + resolveWeak(path: string): number | string; /** * Ensures that the dependency is available, but don’t execute it. This can be use for optimizing the position of a module in the chunks. */ diff --git a/types/webpack-env/tsconfig.json b/types/webpack-env/tsconfig.json index aaf60b78e5..51bb72d45f 100644 --- a/types/webpack-env/tsconfig.json +++ b/types/webpack-env/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webpack-fail-plugin/tsconfig.json b/types/webpack-fail-plugin/tsconfig.json index ebd98cd575..7637957700 100644 --- a/types/webpack-fail-plugin/tsconfig.json +++ b/types/webpack-fail-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webpack-hot-middleware/tsconfig.json b/types/webpack-hot-middleware/tsconfig.json index a1d77f8b64..0170009379 100644 --- a/types/webpack-hot-middleware/tsconfig.json +++ b/types/webpack-hot-middleware/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webpack-hot-middleware/webpack-hot-middleware-tests.ts b/types/webpack-hot-middleware/webpack-hot-middleware-tests.ts index e654d012d0..b87b379379 100644 --- a/types/webpack-hot-middleware/webpack-hot-middleware-tests.ts +++ b/types/webpack-hot-middleware/webpack-hot-middleware-tests.ts @@ -1,6 +1,6 @@ -import * as express from 'express'; -import * as webpack from 'webpack'; -import * as webpackHotMiddleware from 'webpack-hot-middleware'; +import express = require('express'); +import webpack = require('webpack'); +import webpackHotMiddleware = require('webpack-hot-middleware'); const compiler = webpack({}); diff --git a/types/webpack-manifest-plugin/tsconfig.json b/types/webpack-manifest-plugin/tsconfig.json index 9ff3d85f05..e39a8941f9 100644 --- a/types/webpack-manifest-plugin/tsconfig.json +++ b/types/webpack-manifest-plugin/tsconfig.json @@ -14,10 +14,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ "index.d.ts", "webpack-manifest-plugin-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/webpack-merge/tsconfig.json b/types/webpack-merge/tsconfig.json index 750b2e26f0..2d44b17510 100644 --- a/types/webpack-merge/tsconfig.json +++ b/types/webpack-merge/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webpack-merge/v0/tsconfig.json b/types/webpack-merge/v0/tsconfig.json index f977c6a9f2..aec7b6ab4c 100644 --- a/types/webpack-merge/v0/tsconfig.json +++ b/types/webpack-merge/v0/tsconfig.json @@ -22,7 +22,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webpack-node-externals/index.d.ts b/types/webpack-node-externals/index.d.ts index e1a4078c26..80dc73b27b 100644 --- a/types/webpack-node-externals/index.d.ts +++ b/types/webpack-node-externals/index.d.ts @@ -22,7 +22,7 @@ declare namespace webpackNodeExternals { * they should be bundled. * @default [] */ - whitelist?: WhitelistOption[]; + whitelist?: WhitelistOption[] | WhitelistOption; /** * @default ['.bin'] */ diff --git a/types/webpack-node-externals/tsconfig.json b/types/webpack-node-externals/tsconfig.json index f8b3349a6b..aef0527d73 100644 --- a/types/webpack-node-externals/tsconfig.json +++ b/types/webpack-node-externals/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webpack-notifier/tsconfig.json b/types/webpack-notifier/tsconfig.json index ca18204781..b4e32ec724 100644 --- a/types/webpack-notifier/tsconfig.json +++ b/types/webpack-notifier/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webpack-notifier/webpack-notifier-tests.ts b/types/webpack-notifier/webpack-notifier-tests.ts index f71fe5800f..ad73a10764 100644 --- a/types/webpack-notifier/webpack-notifier-tests.ts +++ b/types/webpack-notifier/webpack-notifier-tests.ts @@ -1,5 +1,5 @@ import { Plugin } from 'webpack'; -import * as WebpackNotifierPlugin from 'webpack-notifier'; +import WebpackNotifierPlugin = require('webpack-notifier'); const optionsArray: WebpackNotifierPlugin.Options[] = [ { diff --git a/types/webpack-sources/tsconfig.json b/types/webpack-sources/tsconfig.json index 10a0ad4302..daef83194f 100644 --- a/types/webpack-sources/tsconfig.json +++ b/types/webpack-sources/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webpack-stream/tsconfig.json b/types/webpack-stream/tsconfig.json index b166f37967..f5356da28b 100644 --- a/types/webpack-stream/tsconfig.json +++ b/types/webpack-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webpack-stream/webpack-stream-tests.ts b/types/webpack-stream/webpack-stream-tests.ts index b6e4cce807..15ec19c7bd 100644 --- a/types/webpack-stream/webpack-stream-tests.ts +++ b/types/webpack-stream/webpack-stream-tests.ts @@ -1,5 +1,5 @@ import * as webpack from 'webpack'; -import * as webpackStream from 'webpack-stream'; +import webpackStream = require('webpack-stream'); let output: NodeJS.ReadWriteStream; diff --git a/types/webpack-validator/tsconfig.json b/types/webpack-validator/tsconfig.json index 63f41272d6..703f9135eb 100644 --- a/types/webpack-validator/tsconfig.json +++ b/types/webpack-validator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index 18eed1cc7a..f8aa375210 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -8,11 +8,12 @@ // Jonathan Creamer // Ahmed T. Ali // Alan Agius +// Spencer Elliott // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -import * as Tapable from 'tapable'; +import Tapable = require('tapable'); import * as UglifyJS from 'uglify-js'; export = webpack; @@ -515,7 +516,7 @@ declare namespace webpack { * It is possible to exclude a huge folder like node_modules. * It is also possible to use anymatch patterns. */ - ignored?: string | RegExp; + ignored?: string | string[] | RegExp; /** Turn on polling by passing true, or specifying a poll interval in milliseconds. */ poll?: boolean | number; } @@ -853,7 +854,7 @@ declare namespace webpack { } class ProgressPlugin extends Plugin { - constructor(options?: (percentage: number, msg: string) => void); + constructor(options?: (percentage: number, msg: string, moduleProgress?: string, activeModules?: string, moduleName?: string) => void); } class EnvironmentPlugin extends Plugin { diff --git a/types/webpack/tsconfig.json b/types/webpack/tsconfig.json index 4cf3324827..45d3fa8887 100644 --- a/types/webpack/tsconfig.json +++ b/types/webpack/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webpack/webpack-tests.ts b/types/webpack/webpack-tests.ts index 0816416c2c..d74960e4db 100644 --- a/types/webpack/webpack-tests.ts +++ b/types/webpack/webpack-tests.ts @@ -1,4 +1,4 @@ -import * as webpack from 'webpack'; +import webpack = require('webpack'); const { optimize, @@ -453,6 +453,7 @@ plugin = new webpack.LoaderOptionsPlugin({ plugin = new webpack.EnvironmentPlugin(['a', 'b']); plugin = new webpack.EnvironmentPlugin({ a: true, b: 'c' }); plugin = new webpack.ProgressPlugin((percent: number, message: string) => { }); +plugin = new webpack.ProgressPlugin((percent: number, message: string, moduleProgress?: string, activeModules?: string, moduleName?: string) => { }); plugin = new webpack.HashedModuleIdsPlugin(); plugin = new webpack.HashedModuleIdsPlugin({ hashFunction: 'sha256', diff --git a/types/webrtc/tsconfig.json b/types/webrtc/tsconfig.json index b8074fbae2..24a48fd35e 100644 --- a/types/webrtc/tsconfig.json +++ b/types/webrtc/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/website-scraper/tsconfig.json b/types/website-scraper/tsconfig.json index 19651124e1..eb9ddfea7b 100644 --- a/types/website-scraper/tsconfig.json +++ b/types/website-scraper/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/website-scraper/website-scraper-tests.ts b/types/website-scraper/website-scraper-tests.ts index dc479d5c76..bbcb1fda9d 100644 --- a/types/website-scraper/website-scraper-tests.ts +++ b/types/website-scraper/website-scraper-tests.ts @@ -1,4 +1,4 @@ -import * as scraper from "website-scraper"; +import scraper = require("website-scraper"); scraper({ urls: [ diff --git a/types/websocket/index.d.ts b/types/websocket/index.d.ts index ab4e453e80..006d94800f 100644 --- a/types/websocket/index.d.ts +++ b/types/websocket/index.d.ts @@ -3,7 +3,9 @@ // Definitions by: Paul Loyd , // Kay Schecker , // Zhao Lei +// Sheng Chen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// @@ -564,10 +566,10 @@ declare class client extends events.EventEmitter { * any scripting content that caused the connection to be requested. * @param requestUrl should be a standard websocket url */ - connect(requestUrl: url.Url, protocols?: string[], origin?: string, headers?: any[], extraRequestOptions?: http.RequestOptions): void; - connect(requestUrl: string, protocols?: string[], origin?: string, headers?: any[], extraRequestOptions?: http.RequestOptions): void; - connect(requestUrl: url.Url, protocols?: string, origin?: string, headers?: any[], extraRequestOptions?: http.RequestOptions): void; - connect(requestUrl: string, protocols?: string, origin?: string, headers?: any[], extraRequestOptions?: http.RequestOptions): void; + connect(requestUrl: url.Url, protocols?: string[], origin?: string, headers?: object, extraRequestOptions?: http.RequestOptions): void; + connect(requestUrl: string, protocols?: string[], origin?: string, headers?: object, extraRequestOptions?: http.RequestOptions): void; + connect(requestUrl: url.Url, protocols?: string, origin?: string, headers?: object, extraRequestOptions?: http.RequestOptions): void; + connect(requestUrl: string, protocols?: string, origin?: string, headers?: object, extraRequestOptions?: http.RequestOptions): void; // Events on(event: string, listener: () => void): this; diff --git a/types/websocket/tsconfig.json b/types/websocket/tsconfig.json index b567131872..c4a7965e55 100644 --- a/types/websocket/tsconfig.json +++ b/types/websocket/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webspeechapi/tsconfig.json b/types/webspeechapi/tsconfig.json index f1a86255f3..1435974552 100644 --- a/types/webspeechapi/tsconfig.json +++ b/types/webspeechapi/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/websql/tsconfig.json b/types/websql/tsconfig.json index e82ff7c0ec..fdcf91758e 100644 --- a/types/websql/tsconfig.json +++ b/types/websql/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webtorrent/tsconfig.json b/types/webtorrent/tsconfig.json index 3648235528..00006dbf7a 100644 --- a/types/webtorrent/tsconfig.json +++ b/types/webtorrent/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/webtorrent/webtorrent-tests.ts b/types/webtorrent/webtorrent-tests.ts index 06d8f853f3..63a9647902 100644 --- a/types/webtorrent/webtorrent-tests.ts +++ b/types/webtorrent/webtorrent-tests.ts @@ -1,4 +1,4 @@ -import * as WebTorrent from 'webtorrent'; +import WebTorrent = require('webtorrent'); import * as fs from 'fs'; const client = new WebTorrent(); diff --git a/types/webvr-api/tsconfig.json b/types/webvr-api/tsconfig.json index 38b2249654..0c8de8fcd9 100644 --- a/types/webvr-api/tsconfig.json +++ b/types/webvr-api/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/week/tsconfig.json b/types/week/tsconfig.json index 75a301476e..fb8eb4d398 100644 --- a/types/week/tsconfig.json +++ b/types/week/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/weighted/tsconfig.json b/types/weighted/tsconfig.json index b9f440df8f..4a23926d2b 100644 --- a/types/weighted/tsconfig.json +++ b/types/weighted/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/weixin-app/tsconfig.json b/types/weixin-app/tsconfig.json index 4b2efcd908..18fd585a99 100644 --- a/types/weixin-app/tsconfig.json +++ b/types/weixin-app/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/wellknown/tsconfig.json b/types/wellknown/tsconfig.json index 55ca4fc95d..47ae05b741 100644 --- a/types/wellknown/tsconfig.json +++ b/types/wellknown/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/whatwg-streams/tsconfig.json b/types/whatwg-streams/tsconfig.json index bf84ec6496..51e3a6d6d7 100644 --- a/types/whatwg-streams/tsconfig.json +++ b/types/whatwg-streams/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/wheel/tsconfig.json b/types/wheel/tsconfig.json index 2857ce81c3..b350ba1d89 100644 --- a/types/wheel/tsconfig.json +++ b/types/wheel/tsconfig.json @@ -1,19 +1,25 @@ { "compilerOptions": { "module": "commonjs", - "lib": ["es5", "dom"], + "lib": [ + "es5", + "dom" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "wheel-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/when/tsconfig.json b/types/when/tsconfig.json index f903b8862c..f3cd85259d 100644 --- a/types/when/tsconfig.json +++ b/types/when/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/which/tsconfig.json b/types/which/tsconfig.json index 2ee304960e..e7cff3184d 100644 --- a/types/which/tsconfig.json +++ b/types/which/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/why-did-you-update/tsconfig.json b/types/why-did-you-update/tsconfig.json index 936ab93030..b560619601 100644 --- a/types/why-did-you-update/tsconfig.json +++ b/types/why-did-you-update/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/wicg-mediasession/tsconfig.json b/types/wicg-mediasession/tsconfig.json index 2d8373286c..edf2737293 100644 --- a/types/wicg-mediasession/tsconfig.json +++ b/types/wicg-mediasession/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/wiiu/tsconfig.json b/types/wiiu/tsconfig.json index 06a693d673..4396ef637c 100644 --- a/types/wiiu/tsconfig.json +++ b/types/wiiu/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/wiiu/tslint.json b/types/wiiu/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/wiiu/tslint.json +++ b/types/wiiu/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/window-or-global/tsconfig.json b/types/window-or-global/tsconfig.json index 9148664a63..768229cc53 100644 --- a/types/window-or-global/tsconfig.json +++ b/types/window-or-global/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/window-size/tsconfig.json b/types/window-size/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/window-size/tsconfig.json +++ b/types/window-size/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/windows-1251/tsconfig.json b/types/windows-1251/tsconfig.json index 153d7d27e5..cac223b52f 100644 --- a/types/windows-1251/tsconfig.json +++ b/types/windows-1251/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/windows-service/tsconfig.json b/types/windows-service/tsconfig.json index 16d0a0e664..2681d880a2 100644 --- a/types/windows-service/tsconfig.json +++ b/types/windows-service/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/winjs/tsconfig.json b/types/winjs/tsconfig.json index d34d6a1d77..19a01dfff9 100644 --- a/types/winjs/tsconfig.json +++ b/types/winjs/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/winjs/v1/tsconfig.json b/types/winjs/v1/tsconfig.json index f43a6835b9..2dbeefcadf 100644 --- a/types/winjs/v1/tsconfig.json +++ b/types/winjs/v1/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/winjs/v2/tsconfig.json b/types/winjs/v2/tsconfig.json index 0fe784e5eb..9225246fe9 100644 --- a/types/winjs/v2/tsconfig.json +++ b/types/winjs/v2/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/winreg/tsconfig.json b/types/winreg/tsconfig.json index c1aaeb509e..c745c11a01 100644 --- a/types/winreg/tsconfig.json +++ b/types/winreg/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/winrt-uwp/tsconfig.json b/types/winrt-uwp/tsconfig.json index 0ecda7bfce..ac5d4ad13d 100644 --- a/types/winrt-uwp/tsconfig.json +++ b/types/winrt-uwp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/winrt/tsconfig.json b/types/winrt/tsconfig.json index 361d559f74..0a84251dbb 100644 --- a/types/winrt/tsconfig.json +++ b/types/winrt/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/winston-dynamodb/tsconfig.json b/types/winston-dynamodb/tsconfig.json index 11a92fe7be..40a9e240bf 100644 --- a/types/winston-dynamodb/tsconfig.json +++ b/types/winston-dynamodb/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/winston/tsconfig.json b/types/winston/tsconfig.json index 390e22a274..29d82282fb 100644 --- a/types/winston/tsconfig.json +++ b/types/winston/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/wiredep/tsconfig.json b/types/wiredep/tsconfig.json index f7f4e66431..df4b4fd5f6 100644 --- a/types/wiredep/tsconfig.json +++ b/types/wiredep/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/wiring-pi/tsconfig.json b/types/wiring-pi/tsconfig.json index c0b1d996a4..ae5e273510 100644 --- a/types/wiring-pi/tsconfig.json +++ b/types/wiring-pi/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/wnumb/tsconfig.json b/types/wnumb/tsconfig.json index 59a26d6c92..3cc7088ea3 100644 --- a/types/wnumb/tsconfig.json +++ b/types/wnumb/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/wonder.js/tsconfig.json b/types/wonder.js/tsconfig.json index 01c8dfa305..a67079670c 100644 --- a/types/wonder.js/tsconfig.json +++ b/types/wonder.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/word-list-json/tsconfig.json b/types/word-list-json/tsconfig.json index 8f34d90409..32158b8412 100644 --- a/types/word-list-json/tsconfig.json +++ b/types/word-list-json/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "word-list-json-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/wordcloud/tsconfig.json b/types/wordcloud/tsconfig.json index e4d3526e5e..98547b616f 100644 --- a/types/wordcloud/tsconfig.json +++ b/types/wordcloud/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/words-to-numbers/tsconfig.json b/types/words-to-numbers/tsconfig.json index 90601f2599..ea994452f2 100644 --- a/types/words-to-numbers/tsconfig.json +++ b/types/words-to-numbers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/wrap-ansi/tsconfig.json b/types/wrap-ansi/tsconfig.json index 8df3c547cc..2fdcdc24f9 100644 --- a/types/wrap-ansi/tsconfig.json +++ b/types/wrap-ansi/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/wreck/tsconfig.json b/types/wreck/tsconfig.json index 7b9aa920a7..69f20514b1 100644 --- a/types/wreck/tsconfig.json +++ b/types/wreck/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/wrench/tsconfig.json b/types/wrench/tsconfig.json index 6f3e1e115c..de7db2f894 100644 --- a/types/wrench/tsconfig.json +++ b/types/wrench/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/write-file-atomic/tsconfig.json b/types/write-file-atomic/tsconfig.json index ef38fa7e14..aa82993a38 100644 --- a/types/write-file-atomic/tsconfig.json +++ b/types/write-file-atomic/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/write-json-file/tsconfig.json b/types/write-json-file/tsconfig.json index 7eca588265..301e2f89f9 100644 --- a/types/write-json-file/tsconfig.json +++ b/types/write-json-file/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ws/tsconfig.json b/types/ws/tsconfig.json index 7ad5917bb1..e3daeefc35 100644 --- a/types/ws/tsconfig.json +++ b/types/ws/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ws/ws-tests.ts b/types/ws/ws-tests.ts index 29334a647f..51d37bea9c 100644 --- a/types/ws/ws-tests.ts +++ b/types/ws/ws-tests.ts @@ -1,4 +1,4 @@ -import * as WebSocket from 'ws'; +import WebSocket = require('ws'); import * as http from 'http'; import * as https from 'https'; diff --git a/types/wtfnode/tsconfig.json b/types/wtfnode/tsconfig.json index 429ee54cb7..bd23bd1fc0 100644 --- a/types/wtfnode/tsconfig.json +++ b/types/wtfnode/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "wtfnode-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/wu/tsconfig.json b/types/wu/tsconfig.json index 87598365cb..709b7b7be1 100644 --- a/types/wu/tsconfig.json +++ b/types/wu/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/wx-js-sdk-dt/tsconfig.json b/types/wx-js-sdk-dt/tsconfig.json index b97e63e9c3..6213a39aa7 100644 --- a/types/wx-js-sdk-dt/tsconfig.json +++ b/types/wx-js-sdk-dt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/x-editable/tsconfig.json b/types/x-editable/tsconfig.json index 086e95a8b0..182c396698 100644 --- a/types/x-editable/tsconfig.json +++ b/types/x-editable/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/x-ray-crawler/tsconfig.json b/types/x-ray-crawler/tsconfig.json index 3b3a573f0a..f71f2e661f 100644 --- a/types/x-ray-crawler/tsconfig.json +++ b/types/x-ray-crawler/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "x-ray-crawler-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/x-ray/tsconfig.json b/types/x-ray/tsconfig.json index 7dc474842a..2e17e1babc 100644 --- a/types/x-ray/tsconfig.json +++ b/types/x-ray/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "x-ray-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/xdate/tsconfig.json b/types/xdate/tsconfig.json index 6862404dfa..ef5d21bae8 100644 --- a/types/xdate/tsconfig.json +++ b/types/xdate/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/xdg-basedir/tsconfig.json b/types/xdg-basedir/tsconfig.json index 67144b1f3f..0e5b0bc4d6 100644 --- a/types/xdg-basedir/tsconfig.json +++ b/types/xdg-basedir/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/xdomain/tsconfig.json b/types/xdomain/tsconfig.json index b13ad1fc53..31728666f2 100644 --- a/types/xdomain/tsconfig.json +++ b/types/xdomain/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/xhr-mock/index.d.ts b/types/xhr-mock/index.d.ts deleted file mode 100644 index 2c50c5d854..0000000000 --- a/types/xhr-mock/index.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -// Type definitions for xhr-mock 1.9 -// Project: https://github.com/jameslnewell/xhr-mock#readme -// Definitions by: Joscha Feth -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace mock { - interface Headers { - [k: string]: string; - } - - interface MockResponse { - status(code: number): this; - status(): number; - statusText(statusText: string): this; - statusText(): string; - header(name: string, value: string): this; - header(name: string): string | null; - headers(obj: Headers): this; - headers(): Headers; - body(body: string): this; - body(): string; - timeout(timeout: boolean | number): this; - timeout(): boolean | number; - } - - interface MockRequest { - method(): string; - url(): string; - query(): string; - header(name: string, value: string): this; - header(name: string): string | null; - headers(obj: Headers): this; - headers(): Headers; - body(body: string): this; - body(): string; - progress(loaded: number, total: number, lengthComputable?: boolean): void; - } - - type MockFunction = (req: MockRequest, res: MockResponse) => MockResponse | null; - - interface XhrMock { - XMLHttpRequest: XMLHttpRequest; - setup(): this; - teardown(): this; - reset(): this; - mock(method: string, url: string, fn: MockFunction): this; - get(url: string, fn: MockFunction): this; - post(url: string, fn: MockFunction): this; - put(url: string, fn: MockFunction): this; - patch(url: string, fn: MockFunction): this; - delete(url: string, fn: MockFunction): this; - } -} - -declare var mock: mock.XhrMock; -export = mock; diff --git a/types/xhr-mock/xhr-mock-tests.ts b/types/xhr-mock/xhr-mock-tests.ts deleted file mode 100644 index 37fc651d64..0000000000 --- a/types/xhr-mock/xhr-mock-tests.ts +++ /dev/null @@ -1,27 +0,0 @@ -import mock = require('xhr-mock'); - -// replace the real XHR object with the mock XHR object -mock.setup(); - -// create a mock response for all POST requests with the URL http://localhost/api/user -mock.post('http://localhost/api/user', (req: mock.MockRequest, res: mock.MockResponse) => { - // return null; //simulate an error - // return res.timeout(true); //simulate a timeout - - return res - .status(201) - .header('Content-Type', 'application/json') - .body(JSON.stringify({data: { - first_name: 'John', last_name: 'Smith' - }})); -}); - -// create an instance of the (mock) XHR object and use as per normal -const xhr = new XMLHttpRequest(); - -xhr.onreadystatechange = () => { - if (xhr.readyState === 4) { - // when you're finished put the real XHR object back - mock.teardown(); - } -}; diff --git a/types/xml-parser/tsconfig.json b/types/xml-parser/tsconfig.json index 25b8ca0c57..178feab95b 100644 --- a/types/xml-parser/tsconfig.json +++ b/types/xml-parser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/xml/tsconfig.json b/types/xml/tsconfig.json index 408f1bde77..c4d5915c66 100644 --- a/types/xml/tsconfig.json +++ b/types/xml/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/xml/xml-tests.ts b/types/xml/xml-tests.ts index 3493a464fd..b26ffd054a 100644 --- a/types/xml/xml-tests.ts +++ b/types/xml/xml-tests.ts @@ -1,6 +1,6 @@ // Code get from the test file of https://github.com/dylang/node-xml -import * as xml from "xml"; +import xml = require("xml"); interface Tester { is(a: any, b: any): void; diff --git a/types/xml2js/tsconfig.json b/types/xml2js/tsconfig.json index b6c83dabe5..d8bc65d352 100644 --- a/types/xml2js/tsconfig.json +++ b/types/xml2js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/xml2json/tsconfig.json b/types/xml2json/tsconfig.json index 97da8f14ed..3732af080e 100644 --- a/types/xml2json/tsconfig.json +++ b/types/xml2json/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/xmlbuilder/tsconfig.json b/types/xmlbuilder/tsconfig.json index 5b01beda43..bebd886f51 100644 --- a/types/xmlbuilder/tsconfig.json +++ b/types/xmlbuilder/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/xmldoc/tsconfig.json b/types/xmldoc/tsconfig.json index ec85b52f4f..c8e417723f 100644 --- a/types/xmldoc/tsconfig.json +++ b/types/xmldoc/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/xmldom/tsconfig.json b/types/xmldom/tsconfig.json index eca77a2584..4d87b18b43 100644 --- a/types/xmldom/tsconfig.json +++ b/types/xmldom/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/xmlpoke/tsconfig.json b/types/xmlpoke/tsconfig.json index 70dbf19b60..5ee2971212 100644 --- a/types/xmlpoke/tsconfig.json +++ b/types/xmlpoke/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/xmlpoke/xmlpoke-tests.ts b/types/xmlpoke/xmlpoke-tests.ts index aba04c0962..1079d19756 100644 --- a/types/xmlpoke/xmlpoke-tests.ts +++ b/types/xmlpoke/xmlpoke-tests.ts @@ -1,5 +1,5 @@ -import * as xmlpoke from 'xmlpoke'; -import * as assert from 'assert'; +import xmlpoke = require('xmlpoke'); +import assert = require('assert'); let result: string; diff --git a/types/xmlrpc/tsconfig.json b/types/xmlrpc/tsconfig.json index dc38849c0e..a90bc75672 100644 --- a/types/xmlrpc/tsconfig.json +++ b/types/xmlrpc/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/xmltojson/tsconfig.json b/types/xmltojson/tsconfig.json index 8614f0feb8..bc48765563 100644 --- a/types/xmltojson/tsconfig.json +++ b/types/xmltojson/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/xmpp__jid/tsconfig.json b/types/xmpp__jid/tsconfig.json index 827e25b4fd..0400530759 100644 --- a/types/xmpp__jid/tsconfig.json +++ b/types/xmpp__jid/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/xregexp/tsconfig.json b/types/xregexp/tsconfig.json index 08c3876c26..4c08ac93c6 100644 --- a/types/xregexp/tsconfig.json +++ b/types/xregexp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/xrm/index.d.ts b/types/xrm/index.d.ts index 3f6cac4711..fc5b8bb20a 100644 --- a/types/xrm/index.d.ts +++ b/types/xrm/index.d.ts @@ -3487,6 +3487,13 @@ declare namespace Xrm { */ getEntityName(): string; + /** + * Gets a lookup value that references the record. + * @returns A lookup value that references the record. + * @see {@link https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/formcontext-data-entity/getentityreference External Link: getEntityReference API Documentation} + */ + getEntityReference(): LookupValue; + /** * Gets the record's unique identifier. * @returns The identifier, in Guid format. @@ -3507,6 +3514,12 @@ declare namespace Xrm { */ getPrimaryAttributeValue(): string; + /** + * Gets a boolean value indicating whether all of the entity data is valid. + * @returns true if all of the entity data is valid; false otherwise. + */ + isValid(): boolean; + /** * Removes the handler from the "on save" event. * @param handler The handler. @@ -3515,8 +3528,6 @@ declare namespace Xrm { /** * Saves the record. - * @deprecated Deprecated in v9. - * @see {@link https://docs.microsoft.com/en-us/dynamics365/get-started/whats-new/customer-engagement/important-changes-coming#some-client-apis-are-deprecated External Link: Deprecated Client APIs} * @remarks When using quick create forms in the web application the saveandnew option is not * applied. It will always work as if saveandclose were used. Quick create forms in * Microsoft Dynamics CRM for tablets will apply the saveandnew behavior. @@ -3525,8 +3536,6 @@ declare namespace Xrm { /** * Saves the record with the given save mode. - * @deprecated Deprecated in v9. - * @see {@link https://docs.microsoft.com/en-us/dynamics365/get-started/whats-new/customer-engagement/important-changes-coming#some-client-apis-are-deprecated External Link: Deprecated Client APIs} * @param saveMode (Optional) the save mode to save, as either "saveandclose" or "saveandnew". */ save(saveMode: EntitySaveMode): void; @@ -5056,7 +5065,7 @@ declare namespace XrmEnum { const enum FormNotificationLevel { Error = "ERROR", Info = "INFO", - Warning = "Warning" + Warning = "WARNING" } /** diff --git a/types/xrm/tsconfig.json b/types/xrm/tsconfig.json index 3cf6656150..36df26d142 100644 --- a/types/xrm/tsconfig.json +++ b/types/xrm/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/xrm/tslint.json b/types/xrm/tslint.json index 6164356b33..aa02ac13ae 100644 --- a/types/xrm/tslint.json +++ b/types/xrm/tslint.json @@ -12,6 +12,7 @@ true, 250 ], + "no-const-enum": false, "no-unnecessary-type-assertion": false, "quotemark": [ true, diff --git a/types/xrm/v6/tsconfig.json b/types/xrm/v6/tsconfig.json index 474c263825..01d24f2e11 100644 --- a/types/xrm/v6/tsconfig.json +++ b/types/xrm/v6/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/xrm/v6/tslint.json b/types/xrm/v6/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/xrm/v6/tslint.json +++ b/types/xrm/v6/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/xrm/v7/tsconfig.json b/types/xrm/v7/tsconfig.json index 7049164db5..fad275bc21 100644 --- a/types/xrm/v7/tsconfig.json +++ b/types/xrm/v7/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/xrm/v7/tslint.json b/types/xrm/v7/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/xrm/v7/tslint.json +++ b/types/xrm/v7/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/xrm/v8/tsconfig.json b/types/xrm/v8/tsconfig.json index b8c9b525fc..9dbcd1c985 100644 --- a/types/xrm/v8/tsconfig.json +++ b/types/xrm/v8/tsconfig.json @@ -24,6 +24,7 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/xrm/v8/tslint.json b/types/xrm/v8/tslint.json index f4cc3f2d22..d2aeed8848 100644 --- a/types/xrm/v8/tslint.json +++ b/types/xrm/v8/tslint.json @@ -12,6 +12,7 @@ true, 250 ], + "no-const-enum": false, "no-unnecessary-type-assertion": false, "quotemark": [ true, diff --git a/types/xsd-schema-validator/tsconfig.json b/types/xsd-schema-validator/tsconfig.json index cd7f750ca7..2105a8dc2e 100644 --- a/types/xsd-schema-validator/tsconfig.json +++ b/types/xsd-schema-validator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/xsockets/tsconfig.json b/types/xsockets/tsconfig.json index 7d2656429b..1894ff303c 100644 --- a/types/xsockets/tsconfig.json +++ b/types/xsockets/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/xss-filters/tsconfig.json b/types/xss-filters/tsconfig.json index 5a09180498..8dd5270571 100644 --- a/types/xss-filters/tsconfig.json +++ b/types/xss-filters/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/xtend/tsconfig.json b/types/xtend/tsconfig.json index 68d8e3dea0..96f4e8849c 100644 --- a/types/xtend/tsconfig.json +++ b/types/xtend/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/xterm/index.d.ts b/types/xterm/index.d.ts deleted file mode 100644 index 37bc104747..0000000000 --- a/types/xterm/index.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -// Type definitions for xterm.js 2.0.1 -// Project: https://github.com/sourcelair/xterm.js/ -// Definitions by: Steven Silvester -// Lucian Buzzo -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/** - * Typing for an xterm terminal object. - */ -interface Xterm { - - cols: number; - - rows: number; - - options: Xterm.IOptions; - - element: HTMLElement; - - textarea: HTMLElement; - - attachCustomKeydownHandler(callback: (event: KeyboardEvent) => boolean): void; - - blur(): void; - - clear(): void; - - destroy(): void; - - focus(): void; - - getOption(key: string): any; - - on(event: string, callback: (...args: any[]) => void): void; - - off(event: string, callback: (...args: any[]) => void): void; - - open(parent: HTMLElement, focus?: boolean): void; - - refresh(start: number, end: number, queue?: boolean): void; - - reset(): void; - - resize(x: number, y: number): void; - - scrollDisp(n: number): void; - - setOption(key: string, value: any): void; - - write(text: string): void; - - writeln(text: string): void; - - fit?(): void; -} - - -interface XtermConstructor { - new (options?: Xterm.IOptions): Xterm; - (options?: Xterm.IOptions): Xterm; -} - - -/** - * A terminal options. - */ -declare namespace Xterm { - interface IOptions { - colors?: string[]; - - theme?: string; - - convertEol?: boolean; - - termName?: string; - - geometry?: number[]; - - cursorBlink?: boolean; - - visualBell?: boolean; - - popOnBell?: boolean; - - scrollback?: number; - - debug?: boolean; - - cancelEvents?: boolean; - } -} - - -declare var Xterm: XtermConstructor; -export = Xterm; -export as namespace Xterm; diff --git a/types/xterm/tslint.json b/types/xterm/tslint.json deleted file mode 100644 index a41bf5d19a..0000000000 --- a/types/xterm/tslint.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "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 - } -} diff --git a/types/xterm/xterm-tests.ts b/types/xterm/xterm-tests.ts deleted file mode 100644 index 238cbcc8be..0000000000 --- a/types/xterm/xterm-tests.ts +++ /dev/null @@ -1,129 +0,0 @@ -import * as Terminal from 'xterm'; - -declare var fetch: any; - -var term: Terminal, - protocol: any, - socketURL: string, - socket: WebSocket, - pid: number, - charWidth: number, - charHeight: number; - -var terminalContainer = document.getElementById('terminal-container'), - optionElements = { - cursorBlink: document.querySelector('#option-cursor-blink') - }, - colsElement = document.getElementById('cols') as any, - rowsElement = document.getElementById('rows') as any; - -function setTerminalSize () { - var cols = parseInt(colsElement.value), - rows = parseInt(rowsElement.value), - width = (cols * charWidth).toString() + 'px', - height = (rows * charHeight).toString() + 'px'; - - terminalContainer.style.width = width; - terminalContainer.style.height = height; - term.resize(cols, rows); -} - -colsElement.addEventListener('change', setTerminalSize); -rowsElement.addEventListener('change', setTerminalSize); - -optionElements.cursorBlink.addEventListener('change', createTerminal); - -createTerminal(); - -function createTerminal() { - // Clean terminal - while (terminalContainer.children.length) { - terminalContainer.removeChild(terminalContainer.children[0]); - } - term = new Terminal({ - cursorBlink: (optionElements.cursorBlink as any).checked - }); - term.on('resize', function (size: any) { - if (!pid) { - return; - } - var cols = size.cols, - rows = size.rows, - url = '/terminals/' + pid + '/size?cols=' + cols + '&rows=' + rows; - - fetch(url, {method: 'POST'}); - }); - protocol = (location.protocol === 'https:') ? 'wss://' : 'ws://'; - socketURL = protocol + location.hostname + ((location.port) ? (':' + location.port) : '') + '/terminals/'; - - term.open(terminalContainer); - // term.fit(); - - var cols = 20, - rows = 30; - - colsElement.value = cols; - rowsElement.value = rows; - - fetch('/terminals?cols=' + cols + '&rows=' + rows, {method: 'POST'}).then(function (res: any) { - - charWidth = Math.ceil(term.element.offsetWidth / cols); - charHeight = Math.ceil(term.element.offsetHeight / rows); - - res.text().then(function (pid: number) { - (window as any).pid = pid; - socketURL += pid; - socket = new WebSocket(socketURL); - socket.onopen = runRealTerminal; - socket.onclose = runFakeTerminal; - socket.onerror = runFakeTerminal; - }); - }); -} - - -function runRealTerminal() { - //term.attach(socket); - //term._initialized = true; -} - -function runFakeTerminal() { - // if (term._initialized) { - // return; - // } - - // term._initialized = true; - - var shellprompt = '$ '; - - // term.prompt = function () { - // term.write('\r\n' + shellprompt); - // }; - - term.writeln('Welcome to xterm.js'); - term.writeln('This is a local terminal emulation, without a real terminal in the back-end.'); - term.writeln('Type some keys and commands to play around.'); - term.writeln(''); - // term.prompt(); - - term.on('key', function (key, ev) { - var printable = ( - !ev.altKey && !ev.altGraphKey && !ev.ctrlKey && !ev.metaKey - ); - - if (ev.keyCode == 13) { - // term.prompt(); - } else if (ev.keyCode == 8) { - // Do not delete the prompt - // if (term.x > 2) { - // term.write('\b \b'); - // } - } else if (printable) { - term.write(key); - } - }); - - term.on('paste', function (data, ev) { - term.write(data); - }); -} diff --git a/types/xxhashjs/tsconfig.json b/types/xxhashjs/tsconfig.json index 10233fe7f4..92d223a31e 100644 --- a/types/xxhashjs/tsconfig.json +++ b/types/xxhashjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/yallist/tsconfig.json b/types/yallist/tsconfig.json index e1b421b78c..67d337e9e7 100644 --- a/types/yallist/tsconfig.json +++ b/types/yallist/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/yamljs/tsconfig.json b/types/yamljs/tsconfig.json index d617b3128e..edf0dc76d6 100644 --- a/types/yamljs/tsconfig.json +++ b/types/yamljs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/yandex-maps/tsconfig.json b/types/yandex-maps/tsconfig.json index d156097923..1bf62d4f77 100644 --- a/types/yandex-maps/tsconfig.json +++ b/types/yandex-maps/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/yandex-money-sdk/tsconfig.json b/types/yandex-money-sdk/tsconfig.json index e8b7aa37e5..cabc632737 100644 --- a/types/yandex-money-sdk/tsconfig.json +++ b/types/yandex-money-sdk/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/yargs/tsconfig.json b/types/yargs/tsconfig.json index f0fcef8f10..daff5d0a1d 100644 --- a/types/yargs/tsconfig.json +++ b/types/yargs/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "yargs-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/yargs/v8/tsconfig.json b/types/yargs/v8/tsconfig.json index 191904df93..49013b4a70 100644 --- a/types/yargs/v8/tsconfig.json +++ b/types/yargs/v8/tsconfig.json @@ -19,10 +19,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "yargs-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/yargs/v8/yargs-tests.ts b/types/yargs/v8/yargs-tests.ts index 3f5b8829aa..5e95564faf 100644 --- a/types/yargs/v8/yargs-tests.ts +++ b/types/yargs/v8/yargs-tests.ts @@ -1,6 +1,6 @@ /// -import * as yargs from 'yargs'; +import yargs = require('yargs'); import * as fs from 'fs'; import * as path from 'path'; diff --git a/types/yargs/yargs-tests.ts b/types/yargs/yargs-tests.ts index aa0ff28235..43779309bf 100644 --- a/types/yargs/yargs-tests.ts +++ b/types/yargs/yargs-tests.ts @@ -1,6 +1,6 @@ /// -import * as yargs from 'yargs'; +import yargs = require('yargs'); import * as fs from 'fs'; import * as path from 'path'; diff --git a/types/yayson/tsconfig.json b/types/yayson/tsconfig.json index 7c8cdbf4a8..984d064d08 100644 --- a/types/yayson/tsconfig.json +++ b/types/yayson/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ydn-db/tsconfig.json b/types/ydn-db/tsconfig.json index be8afe510b..09ea3337b4 100644 --- a/types/ydn-db/tsconfig.json +++ b/types/ydn-db/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/yeoman-generator/tsconfig.json b/types/yeoman-generator/tsconfig.json index ab104bd246..8539b6dd4f 100644 --- a/types/yeoman-generator/tsconfig.json +++ b/types/yeoman-generator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/yeoman-test/tsconfig.json b/types/yeoman-test/tsconfig.json index 43c2be3164..c5cb141439 100644 --- a/types/yeoman-test/tsconfig.json +++ b/types/yeoman-test/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/yfiles/index.d.ts b/types/yfiles/index.d.ts deleted file mode 100644 index 2d47b00067..0000000000 --- a/types/yfiles/index.d.ts +++ /dev/null @@ -1,117397 +0,0 @@ -// Type definitions for yFiles for HTML 2.0.13 -// Project: http://www.yworks.com/products/yfiles-for-html -// Definitions by: yWorks GmbH HTML Team -// Definitions: https://github.com/yWorks/DefinitelyTyped - -/**************************************************************************** - ** - ** This file is part of yFiles for HTML 2.0.1.3 - ** - ** yWorks proprietary/confidential. Use is subject to license terms. - ** - ** Copyright (c) 2017 by yWorks GmbH, Vor dem Kreuzberg 28, - ** 72070 Tuebingen, Germany. All rights reserved. - ** - ***************************************************************************/ - -type JSObject = Object; -declare namespace yfiles{ - namespace lang{ - export interface Object extends JSObject{} - export type Object_Interface = Object; - interface ClassConstructor { - new ():T & yfiles.lang.Object; - } - function BaseClass(...base:any[]):yfiles.lang.ClassConstructor; - function BaseClass(...base:any[]):yfiles.lang.ClassConstructor; - } -}declare namespace yfiles{ - export namespace lang{ - /** - * The root of the class hierarchy of the yFiles for HTML class framework. - *

- * Two of these methods are actually defined on the native JavaScript object prototype: - *

- *
    - *
  • {@link yfiles.lang.Object#hashCode}
  • - *
  • {@link yfiles.lang.Object#equals}
  • - *
- *

- * The other methods are part of the {@link yfiles.lang.Object} type, only. - *

- * @class - */ - export interface Object{} - export class Object { - /** - * Tests whether this object and the other object are equal. - * @param other The tested object. - * @returns true, if the objects are equal; false otherwise. - */ - equals(other:any):boolean; - /** - * Tests if two objects are equal. - * @param a One of the objects. Can be null or of any type. - * @param b One of the objects. Can be null or of any type. - * @returns true, if the objects are equal; false otherwise. - * @static - */ - static equals(a:any,b:any):boolean; - /** - * Returns the type of this object. - * @returns The type of this object. - */ - getClass():yfiles.lang.Class; - /** - * Returns an object with a get and/or a set method that is optionally bound to this instance. - *

- * The requested name must be a property (with getter and/or setter). - *

- * @param name The name of the property. - * @param bound If true, then the get/set methods of the returned object will be bound to this instance. - * @returns An object with a get and/or set method that reads/writes to the specified field. - */ - getOwnProperty(name:string,bound:boolean):any; - /** - * Returns the most recently defined property descriptor in the prototype chain of the given object. - * @param o The object that the property belongs to - * @param name The name of the property. - * @returns The most recently defined property descriptor in the prototype chain of the given object. - * @static - */ - static getPropertyDescriptor(o:any,name:string):Object; - /** - * Returns the hash code of this object. - *

- * If two objects are {@link yfiles.lang.Object#equals equal}, then they must have the same hash code. - *

- * @returns The hash code of this object. - */ - hashCode():number; - /** - * Shallow clones an object. - *

- * It will also clone any value types. - *

- * @returns A cloned instance of the same type. - */ - memberwiseClone():any; - /** - * Tests if two objects are identical. - * @param a One of the objects. - * @param b One of the objects. - * @returns true, if the objects are the identical; false otherwise. - * @static - */ - static referenceEquals(a:any,b:any):boolean; - /** - * Displays the textual representation of the object. - * @returns The textual representation of this object. - */ - toString():string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.Object; - } - /** - * This type represents an abstract value, that is a function that is not implemented. - * @class - */ - export interface Abstract extends yfiles.lang.Object{} - export class Abstract { - /** - * Tests whether the given object or property descriptor is a representation of an abstract value. - * @param o The object to test. - * @returns true, if the object is abstract; false otherwise. - * @static - */ - static isAbstract(o:any):boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.Abstract; - } - /** - * A function that transforms a class definition object into a class type. - *

- * The class definition object may contain any of the following special identifiers: - *

- *
    - *
  • $extends: An object reference that points to the parent object.
  • - *
  • $with: An array of interfaces this class implements.
  • - *
  • $abstract: A boolean value that indicates whether or not this class is abstract.
  • - *
  • - * $static: An object that contains methods, fields and properties that should be statically available and will be - * registered on the constructor function instead of its prototype. - *
  • - *
  • - * $meta: An array of {@link yfiles.lang.Attribute}s or a function that returns an array of - * {@link yfiles.lang.Attribute}s that describe the class. - *
  • - *
- *

- * Additionally, it may contain methods, properties and fields that should be added to the constructor functions prototype. - * If the value of an field is an object with a $meta property, then it will be used as a property descriptor for the field - * (meaning that writable, enumerable and configurable, value and get, set can be used as in a property descriptor for Object.defineProperty - * and the value of the $meta property is stored for usage in the reflection API. If the object has a get and/or set - * property, then it will also be used as a property descriptor. - *

- *
-     * var MyList = yfiles.lang.Class('MyList', {
-     *     $extends: my.AbstractList,
-     *     $with: [my.Iterable, my.Collection],
-     * 
-     *     constructor: function() { // the constructor function
-     *     },
-     * 
-     *     add: function(obj) { ... },
-     *     size: { // transformed into a property
-     *      'get': function() { return ...; }
-     *     },
-     * 
-     *     $static: {
-     *      create: function() { ... }
-     *     }
-     * });
-     * // usage
-     * var list = new MyList();
-     * list.add("hello");
-     * list.size === 1; // true
-     * 
- * - *

- * The constructor property can be either a function (in case of a single constructor) or an object that is transformed - * into named constructors. - *

- *
-     * var Rect = yfiles.lang.Class('Rect', {
-     *  constructor: {
-     *      'default': function(x, y, width, height) { ... },
-     *      'FromPoints': function(topLeft, bottomRight) { ... },
-     *      'FromPoint': function(topLeft, width, height) { ... }
-     *  }
-     * });
-     * // usage:
-     * var myrect = new Rect(10, 10, 50, 50);
-     * myrect instanceof Rect; // true
-     * myrect = new Rect.FromPoints({x: 10, y: 10}, {x: 60, y: 60});
-     * myrect instanceof Rect; // true
-     * myrect = new Rect.FromPoint({x: 10, y: 10}, 50, 50);
-     * myrect instanceof Rect; // true
-     * 
- * - *

- * Named constructors can call other constructors and can be written like any other constructor, i.e. this will be a new - * instance of the class that is being constructed. - *

- *

- * To access super methods, you can use the static $super property that is added to all classes. - *

- *

- * Example (inside a method or property of the previously defined Rect class): - *

- *
-     * Rect.$super.toString.call(this);
-     * 
- * - *

- * If you do not specify the parent class of a new class, then {@link yfiles.lang.Object} will be used as its base type. The parent - * class of {@link yfiles.lang.Object} is the standard JavaScript Object.prototype. - *

- *

- * Every class has a couple of static methods and properties: - *

- *
    - *
  • {@link yfiles.lang.Class#isInstance}: tests whether an object is an instance of this class.
  • - *
  • $class: a reference to the {@link yfiles.lang.Class} instance that provides reflective information about this type.
  • - *
  • $super: the parent class.
  • - *
- * @class - */ - export interface Class extends yfiles.lang.Object{} - export class Class { - /** - * Returns the class object for the given name, or null if no such class exists. - * @param name The name of the requested class. - * @returns The class object or null, if no such class exists. - * @static - */ - static forName(name:string):yfiles.lang.Class; - /** - * Returns all attributes that belong to this type. - * @param [inherited=true] If true, then the attributes of the parent types are also added to the list. Default value is false. - * @returns An array of attributes that belong to this type. - */ - getAttributes(inherited?:boolean):yfiles.lang.Attribute[]; - /** - * Returns an array of all properties of the type. - * @param [inherited=true] - * @param [staticProperties=false] - * @returns An array of properties. - */ - getProperties(inherited?:boolean,staticProperties?:boolean):yfiles.lang.PropertyInfo[]; - /** - * Returns an array of all properties of the type. - * @param {Object} options The parameters to pass. - * @param [options.inherited=true] - * @param [options.staticProperties=false] - * @returns An array of properties. - */ - getProperties(options:{inherited?:boolean,staticProperties?:boolean}):yfiles.lang.PropertyInfo[]; - /** - * Modify an existing object obj that is not created with the help of the yfiles class framework to be usable with our - * library functions. - *

- * This method modifies a given object obj in the following ways: - *

- *
    - *
  • Methods and properties that implement member declarations of the interfaces are callable from yfiles library code.
  • - *
  • For each interface interface in interfaces, interface.isInstance(obj) is true.
  • - *
- *

- * Note that this method does not enable extended usages, e.g. obj does not implement the full reflection API necessary for - * GraphML serialization, and it is not possible to inject actual classes as opposed to interfaces. - *

- *

- * To modify an object on an instance level: - *

- *
-       * //Create a plain JavaScript object
-       * var myHitTestable = {};
-       * myHitTestable.isHit = function(p, ctx) { return false; };
-       * myHitTestable.lookup = function(clazz) { return null; };
-       * //Modify
-       * yfiles.lang.Class.injectInterfaces(myHitTestable, [yfiles.drawing.IHitTestable, yfiles.support.ILookup]);
-       * //These are equally valid:
-       * //yfiles.lang.Class.injectInterfaces(myHitTestable, ["yfiles.drawing.IHitTestable", "yfiles.support.ILookup"]);
-       * //yfiles.lang.Class.injectInterfaces(myHitTestable, [yfiles.drawing.IHitTestable.$class, yfiles.support.ILookup.$class]);
-       * //As well as using a variable number of arguments, such as:
-       * //yfiles.lang.Class.injectInterfaces(myHitTestable, yfiles.drawing.IHitTestable, yfiles.support.ILookup);
-       * 
-       * //This is true now:
-       * yfiles.drawing.IHitTestable.isInstance(myHitTestable);
-       * //And the object can be used where an interface instance is expected:
-       * graphEditorInputMode.clickInputMode.validClickHitTestable = myHitTestable;
-       * 
- * - *

- * It is also possible to modify an object prototype, e.g. in TypeScript: Class definition: - *

- *
-       * export class MyHitTestable implements yfiles.drawing.IHitTestable {
-       *    isHit(p: yfiles.geometry.PointD, ctx: yfiles.canvas.ICanvasContext): boolean {
-       *        return false;
-       *    }
-       * }
-       * 
- * - *

- * Usage: - *

- *
-       * //This is false:
-       * //yfiles.drawing.IHitTestable.isInstance(new MyHitTestable());
-       * //Modify
-       * yfiles.lang.Class.injectInterfaces(MyHitTestable.prototype, [yfiles.drawing.IHitTestable]);
-       * //Now it is true
-       * var myHitTestable = new MyHitTestable();
-       * yfiles.drawing.IHitTestable.isInstance(myHitTestable);
-       * //And the object can be used where an interface instance is expected:
-       * graphEditorInputMode.clickInputMode.validClickHitTestable = myHitTestable;
-       * 
- * - * @param obj The object to modify. - * @param interfaces Array or variable number of {@link }s, {@link } objects of interfaces or fully qualified string - * names of interfaces. - * @static - */ - static injectInterfaces(obj:any,...interfaces:any[]):void; - /** - * Tests whether an object is an instance of this type. - *

- * This is the only way to test if an object implements a {@link yfiles.lang.Interface}. - *

- * @param o The object that may be an instance of this type. - * @returns true, if the object is an instance of this type; false otherwise. - */ - isInstance(o:any):boolean; - /** - * Creates a new instance of this type using its default constructor. - * @returns A new instance of this type using its default constructor. - */ - newInstance():any; - /** - * true, if this type represents an enum; false otherwise. - * @type {boolean} - */ - isEnum:boolean; - /** - * true, if this type represents a primitive type; false otherwise. - *

- * The primitive types are: number, string and boolean. - *

- * @type {boolean} - */ - isPrimitive:boolean; - /** - * true, if this type represents a value type; false otherwise. - *

- * A value type is either a primitive or an instance of a {@link yfiles.lang.Struct}. - *

- * @type {boolean} - */ - isValueType:boolean; - /** - * true, if this type represents a regular class; false otherwise. - * @type {boolean} - */ - isClass:boolean; - /** - * The short name of this class. - * @type {string} - */ - name:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.Class; - } - /** - * Wrapper class for the JavaScript number primitive type. - * @class - * @implements {yfiles.lang.IComparable} - */ - export interface Number extends yfiles.lang.Object,yfiles.lang.IComparable{} - export class Number { - /** - * Compares this number with another one. - * @param obj The other number to compare with. - * @returns 0 if both numbers are equal, -1 if this number is smaller than the other one, 1 otherwise. - */ - compareTo(obj:any):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.Number; - } - /** - * Wrapper class for the JavaScript string primitive type. - * @class - * @implements {yfiles.lang.IComparable} - */ - export interface String extends yfiles.lang.Object,yfiles.lang.IComparable{} - export class String { - /** - * Compares this string with another one. - * @param obj The other string to compare with. - * @returns 0 if both strings are equal, -1 if this string comes before the other one in lexicographic sort order, 1 otherwise. - */ - compareTo(obj:any):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.String; - } - /** - * Wrapper class for the JavaScript boolean primitive type. - * @class - * @implements {yfiles.lang.IComparable} - */ - export interface Boolean extends yfiles.lang.Object,yfiles.lang.IComparable{} - export class Boolean { - /** - * Compares this boolean with another one. - * @param obj The other boolean to compare with. - * @returns 0 if both booleans are equal, -1 if this boolean is false and the other is true, 1 otherwise. - */ - compareTo(obj:any):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.Boolean; - } - /** - * Base type for types that provide value type semantics, which means that they are cloned when their containing type is - * cloned. - *

- * They provide a static {@link yfiles.lang.Struct#createDefault} method that can be used to create an instance of an struct where - * all of its values are set to their default without using any of its constructors. - *

- *

- * Besides those properties, they can be treated like any other class, i.e. they can implement {@link yfiles.lang.Interface Interfaces} and can be tested - * with a instanceof A and A.$class.isInstance(a). - *

- * @see yfiles.lang.Struct#createDefault - * @class - */ - export interface Struct extends yfiles.lang.Object{} - export class Struct { - /** - * This methods creates an instance of the struct in which all of its values are set to their default values without using - * any of its constructors. - * @returns - * @static - */ - static createDefault():any; - /** - * Tests whether another object is equal to this struct. - *

- * As opposed to the implementation of - * {@link yfiles.lang.Object#equals}, this implementation tests the members of both objects to determine equality. - *

- * @param other The other struct. - * @returns true, if both objects are equal; false otherwise. - */ - equals(other:any):boolean; - /** - * Calculates the hash code of this struct based on its members. - * @returns The hash code. - */ - hashCode():number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.Struct; - } - /** - * The base type of an enumeration. It is not type safe. - *

- * All enums extend {@link yfiles.lang.Enum} and should be used instead of "magic values". - *

- *

- * The members of the enum type definition will be static and an enum can not be constructed. - *

- *
-     * var RequestState = yfiles.lang.Enum('RequestState', {
-     *     SEND: 1,
-     *     PROCESSED: 2,
-     *     SHIPPED: 3,
-     *     FAILED: 4,
-     *    });
-     *    if(state === RequestState.FAILED) { ... }
-     * 
- * - * @class - */ - export interface Enum extends yfiles.lang.Object{} - export class Enum { - /** - * Returns the name of an enum value. - * @param type The type of the enum. - * @param value The value of the field. - * @returns The name of the field. - * @static - */ - static getName(type:yfiles.lang.Class,value:yfiles.lang.Enum):string; - /** - * Returns a list of all field names that represent an enum value. - * @param type The type of the enum. - * @returns A list of all field names that represent an enum value. - * @static - */ - static getValueNames(type:yfiles.lang.Class):yfiles.collections.IEnumerable; - /** - * Returns a list of all numeric values. - * @param type The type of the enum. - * @returns A list of all numeric values. - * @static - */ - static getValues(type:yfiles.lang.Class):yfiles.collections.IEnumerable; - /** - * Returns the value of the field with the given ID. - * @param type The type of the enum. - * @param id The name of the field. - * @param ignoreCase If true, then the case of the field will be ignored and the search is case-insensitive. - * @returns The value of the field with the given ID. - * @static - */ - static parse(type:yfiles.lang.Class,id:string,ignoreCase:boolean):yfiles.lang.Enum; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.Enum; - } - /** - * Wrapper around JavaScript function objects. - *

- * Compared with plain JavaScript functions, - *

- *
    - *
  • delegates can be bound to a different target, which acts as this in the delegate function body,
  • - *
  • multiple delegates can be combined into a single delegate instance, which provides multicast functionality.
  • - *
- * @class - */ - export interface delegate extends yfiles.lang.Object{} - export class delegate { - /** - * Combines two delegates into a single one. - * @param d1 One of the delegates to combine. - * @param d2 One of the delegates to combine. - * @returns A delegate that combines both original delegates. - * @static - */ - static combine(d1:Function,d2:Function):Function; - /** - * Creates a new delegate from the given functions and the execution target. - *

- * When the delegate is executed, the functions will be applied on - * target, independent from the current closure. If multiple functions are specified, they will all be applied in order. - *

- * @param functions The functions from which the delegate should be created. - * @param target The target object on which the functions should be applied. - * @returns A new delegate. - * @static - */ - static createDelegate(functions:Function[],target:any):Function; - /** - * Apply function2 in the current execution context. - * @param function2 The function to execute. - * @param args Optional function arguments. - * @returns The result from invoking function2. - * @static - */ - static dynamicInvoke(function2:Function,...args:any[]):any; - /** - * Return a list of all delegates that are combined into del. - * @param del The delegate to test. - * @returns A list of all delegates that are combined into del. - * @static - */ - static getInvocationList(del:Function):Function[]; - /** - * Removes the first occurrence of d2 from the {@link yfiles.lang.delegate#getInvocationList invocation list} of d1. - * @param d1 The delegate that should be modified. - * @param d2 The delegate that should be removed. - * @returns The modified delegate d1. - * @static - */ - static remove(d1:Function,d2:Function):Function; - /** - * Removes all occurrences of d2 from the {@link yfiles.lang.delegate#getInvocationList invocation list} of d1. - * @param d1 The delegate that should be modified. - * @param d2 The delegate that should be removed. - * @returns The modified delegate d1. - * @static - */ - static removeAll(d1:Function,d2:Function):Function; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.delegate; - } - /** - * A trait is an interface that may or may not have default implementations of its methods, properties and fields. - *

- * Note: This is a deprecated alias for {@link yfiles.lang.Interface}. - *

- *

- * Traits have very specific rules in case two traits with the same member are implemented by a subtype: - *

- *
    - *
  • If both method definitions are abstract, then the method is abstract.
  • - *
  • If one method definition is abstract and the other concrete, then the concrete method is used.
  • - *
  • If both method definitions are concrete and the traits are implemented at the same level, then the method is abstract.
  • - *
  • - * If both method definitions are concrete and one of the traits is a sub-type of the other, then its method definition - * will be used. - *
  • - *
- *

- * In all of those cases, the rule is that a subtype overrides the parent types' definitions. Example: Given the traits A, - * B, C and D where A defines a method "a" to be abstract and B and C extending trait A with concrete implementations of - * "a", when D is a trait that implements both B and C, its version of "a" will be abstract, unless it defines its own - * implementation of "a", in which case that definition is used. - *

- *

- * All trait types have a $class property, which contains their {@link yfiles.lang.Class type}, and a static {@link yfiles.lang.Trait#isTrait} method that - * can be used to test whether an object implements the trait. - *

- * @class - */ - export interface Trait extends yfiles.lang.Object{} - export class Trait { - /** - * Tests whether the given object is a trait. - *

- * This method is equivalent to using obj.$class.isTrait but safe in case the object does not have a $class property. - *

- * @param o The trait candidate. - * @returns true, if the object is a trait; false otherwise. - * @static - */ - static isTrait(o:any):boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.Trait; - } - /** - * An interface that may or may not have default implementations of its methods, properties and fields. - *

- * Interfaces have very specific rules in case two interfaces with the same member are implemented by a subtype: - *

- *
    - *
  • If both method definitions are abstract, then the method is abstract.
  • - *
  • If one method definition is abstract and the other concrete, then the concrete method is used.
  • - *
  • - * If both method definitions are concrete and the interfaces are implemented at the same level, then the method is - * abstract. - *
  • - *
  • - * If both method definitions are concrete and one of the interfaces is a sub-type of the other, then its method definition - * will be used. - *
  • - *
- *

- * In all of those cases, the rule is that a subtype overrides the parent types' definitions. Example: Given the interfaces - * A, B, C and D where A defines a method "a" to be abstract and B and C extending interface A with concrete - * implementations of "a", when D is a interface that implements both B and C, its version of "a" will be abstract, unless - * it defines its own implementation of "a", in which case that definition is used. - *

- *

- * All interface types have a $class property, which contains their {@link yfiles.lang.Class type}, and a static {@link yfiles.lang.Interface#isInterface} - * method that can be used to test whether an object implements the interface. - *

- * @class - */ - export interface Interface extends yfiles.lang.Object{} - export class Interface { - /** - * Tests whether the given object is an interface. - * @param o The interface candidate. - * @returns true, if the object is an interface; false otherwise. - * @static - */ - static isInterface(o:any):boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.Interface; - } - /** - * Specialized type that can be used to describe meta information about other types, methods, fields, properties and - * constructors. - *

- * All attributes extend {@link yfiles.lang.Attribute} or a subtype of an attribute. They can also implement {@link yfiles.lang.Interface Interfaces}. - *

- *

- * The actual creation of an attribute is delayed to the point in time when it is needed by the reflection API. Therefore, - * the attribute constructors are wrapped and replaced by a function that creates an instance of the attribute. - *

- *
-     * var MyAttribute = yfiles.lang.Attribute('MyAttribute', {
-     *  constructor: function(message) {
-     *      this.message = message;
-     *  }
-     * });
-     * var MyClass = yfiles.lang.Class('MyClass', {
-     *  $meta: [MyAttribute('hello').init(recipient: 'world')]
-     * });
-     * var attr = yfiles.lang.Attribute.getCustomAttribute(MyClass.$class, MyAttribute.$class);
-     * console.log(attr.message + ' ' + attr.recipient); // 'hello world'
-     * 
- * - *

- * Even though MyAttribute is invoked at the definition of MyClass, no attribute is created until the reflection API is - * used (in the above example: using getCustomAttribute). - *

- *

- * The result of the constructor function of an attribute is a function, that, when invoked, returns an instance of the - * attribute. It also provides an init method that adds the properties of the given object to the attribute. - *

- *

- * Note: Attribute constructors are always called without the new keyword. - *

- * @class - */ - export interface Attribute extends yfiles.lang.Object{} - export class Attribute { - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.Attribute; - } - /** - * A lazy class type which delays the creation of the class until it is used. - * @class - */ - export interface ClassDefinition extends yfiles.lang.Object{} - export class ClassDefinition { - /** - * A lazy class type which delays the creation of the class until it is used. - * @param callback Returns the class definition as required by {@link }. - */ - constructor(callback:()=>any); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.ClassDefinition; - } - /** - * A lazy interface type which delays the creation of the interface until it is used. - * @class - */ - export interface InterfaceDefinition extends yfiles.lang.Object{} - export class InterfaceDefinition { - /** - * A lazy interface type which delays the creation of the interface until it is used. - * @param callback Returns the interface definition as required by {@link }. - */ - constructor(callback:()=>any); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.InterfaceDefinition; - } - /** - * A lazy struct type which delays the creation of the struct until it is used. - * @class - */ - export interface StructDefinition extends yfiles.lang.Object{} - export class StructDefinition { - /** - * A lazy struct type which delays the creation of the struct until it is used. - * @param callback Returns the struct definition as required by {@link }. - */ - constructor(callback:()=>any); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.StructDefinition; - } - /** - * A lazy enum type which delays the creation of the enum until it is used. - * @class - */ - export interface EnumDefinition extends yfiles.lang.Object{} - export class EnumDefinition { - /** - * A lazy enum type which delays the creation of the enum until it is used. - * @param callback Returns the enum definition as required by {@link }. - */ - constructor(callback:()=>any); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.EnumDefinition; - } - /** - * A lazy attribute definition which delays the creation of the attribute until it is used. - * @class - */ - export interface AttributeDefinition extends yfiles.lang.Object{} - export class AttributeDefinition { - /** - * A lazy attribute definition which delays the creation of the attribute until it is used. - * @param callback Returns the attribute definition as required by {@link }. - */ - constructor(callback:()=>any); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.AttributeDefinition; - } - /** - * Subclasses of {@link yfiles.lang.EventArgs} are passed to event handlers to provide the information they need to handle an - * event. - * @class - */ - export interface EventArgs extends yfiles.lang.Object{} - export class EventArgs { - /** - * An empty {@link yfiles.lang.EventArgs} object that can be used when no information needs to be passed to the event handler. - * @const - * @static - * @type {yfiles.lang.EventArgs} - */ - static EMPTY:yfiles.lang.EventArgs; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.EventArgs; - } - /** - * Event arguments which contain information for a {@link yfiles.lang.IPropertyObservable#addPropertyChangedListener PropertyChanged} - * event. - * @class - * @extends {yfiles.lang.EventArgs} - */ - export interface PropertyChangedEventArgs extends yfiles.lang.EventArgs{} - export class PropertyChangedEventArgs { - /** - * Creates a new instance. - * @param propertyName The name of the changed property. - */ - constructor(propertyName:string); - /** - * The name of the changed property. - * @type {string} - */ - propertyName:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.PropertyChangedEventArgs; - } - /** - * Defines an event which is dispatched when a property changes. - * @interface - */ - export interface IPropertyObservable extends yfiles.lang.Object{ - /** - * Adds the given listener for the PropertyChanged event that occurs when a property changes. - * @param listener The listener to add. - * @see yfiles.lang.IPropertyObservable#removePropertyChangedListener - * @abstract - */ - addPropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the PropertyChanged event that occurs when a property changes. - * @param listener The listener to remove. - * @see yfiles.lang.IPropertyObservable#addPropertyChangedListener - * @abstract - */ - removePropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - } - var IPropertyObservable:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.lang.IPropertyObservable; - }; - /** - * Contains information about a property. - * @class - * @final - */ - export interface PropertyInfo extends yfiles.lang.Object{} - export class PropertyInfo { - /** - * Gets the attributes associated with this property. - * @param [inherit=true] if set to true inherited attributes will also be returned. - * @returns The attributes or an empty array. - */ - getAttributes(inherit?:boolean):yfiles.lang.Attribute[]; - /** - * Gets the value of the property from the given object. - * @param obj The object which has the property, null for static properties. - * @returns The value of the property from the given object. - */ - getValue(obj:any):any; - /** - * Sets the value of the property on the given object. - * @param obj The object whose property should be written, null for static properties. - * @param value - */ - setValue(obj:any,value:any):void; - /** - * Gets a value indicating whether the property can be read. - * @type {boolean} - */ - canRead:boolean; - /** - * Gets a value indicating whether the property can be written. - * @type {boolean} - */ - canWrite:boolean; - /** - * Gets a value indicating whether the property is a static property, rather than declared on an instance. - * @type {boolean} - */ - isStatic:boolean; - /** - * Gets the type of the property. - * @type {yfiles.lang.Class} - */ - propertyType:yfiles.lang.Class; - /** - * Gets the declaring type, i.e. the type where the member was declared. - * @type {yfiles.lang.Class} - */ - declaringType:yfiles.lang.Class; - /** - * Gets the name of the member. - * @type {string} - */ - name:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.PropertyInfo; - } - /** - * Provides a method by which implementors can be compared to each other. - * @interface - */ - export interface IComparable extends yfiles.lang.Object{ - /** - * Compares this object to the given object of the same type. - * @param obj The object to compare this to. - * @returns - *
    - *
  • -1: this is less than obj
  • - *
  • 0: this is equal to obj
  • - *
  • 1: this is greater than obj
  • - *
- * @abstract - */ - compareTo(obj:any):number; - } - var IComparable:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.lang.IComparable; - }; - /** - * Implemented by objects which can create a clone of themselves. - * @interface - */ - export interface ICloneable extends yfiles.lang.Object{ - /** - * Create a clone of this object. - * @returns A clone of this object. - * @abstract - */ - clone():any; - } - var ICloneable:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.lang.ICloneable; - }; - /** - * A structure which represents a time span. - * @class - * @implements {yfiles.lang.IComparable} - * @final - */ - export interface TimeSpan extends yfiles.lang.Struct,yfiles.lang.IComparable{} - export class TimeSpan { - /** - * Creates a new time span with a given length. - * @param days The days part of the time span. - * @param hours The hour part of the time span. - * @param minutes The minute part of the time span. - * @param seconds The seconds part of the time span. - * @param millis The milliseconds part of the time span. - */ - constructor(days:number,hours:number,minutes:number,seconds:number,millis:number); - /** - * Creates a new time span which is ticks milliseconds long. - * @param ticks The length of the time span in milliseconds. - */ - constructor(ticks:number); - /** - * - * @param obj - * @returns - */ - compareTo(obj:any):number; - /** - * Creates a new time span with the given length in milliseconds. - * @param milliseconds The length of the time span in milliseconds. - * @returns A newly created time span. - * @static - */ - static fromMilliseconds(milliseconds:number):yfiles.lang.TimeSpan; - /** - * Creates a new time span with the given length in minutes. - * @param minutes The length of the time span in minutes. - * @returns A newly created time span. - * @static - */ - static fromMinutes(minutes:number):yfiles.lang.TimeSpan; - /** - * Creates a new time span with the given length in seconds. - * @param seconds The length of the time span in seconds. - * @returns A newly created time span. - * @static - */ - static fromSeconds(seconds:number):yfiles.lang.TimeSpan; - /** - * Empty time span. - * @const - * @static - * @type {yfiles.lang.TimeSpan} - */ - static ZERO:yfiles.lang.TimeSpan; - /** - * The total milliseconds (ticks) of this time span. - * @type {number} - */ - totalMilliseconds:number; - /** - * The total seconds of this time span. - * @type {number} - */ - totalSeconds:number; - /** - * The total seconds of this time span. - * @type {number} - */ - totalMinutes:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.TimeSpan; - } - /** - * Extension of the native JavaScript Error type that includes a stack trace. - *

- * yFiles includes the following specialized exception types indicated by the {@link yfiles.lang.Exception#name}: - *

- *
    - *
  • ArgumentError – Indicates that the value of a parameter of the current method is illegal.
  • - *
  • ArgumentNullError – Indicates that the value of a parameter of the current method is null but a non-null value was expected.
  • - *
  • ArgumentOutOfRangeError – Indicates that the value of a parameter of the current method is not in the legal range of values.
  • - *
  • IndexOutOfRangeError – Indicates that an array index is not in the legal range.
  • - *
  • NullReferenceError – Indicates that a value is null when it shouldn't.
  • - *
  • InvalidOperationError – Indicates that the current operation is not valid in the instances's current state.
  • - *
  • NotImplementedError – Indicates that the called method is not implemented.
  • - *
  • NotSupportedError – Indicates that the operation is not supported.
  • - *
  • ArithmeticError – Indicates an error in an arithmetic operation.
  • - *
  • IOError – Indicates an error during an IO operation.
  • - *
  • KeyNotFoundError – Indicates that a mapping does not contain the given key.
  • - *
  • AlgorithmAbortedError – Indicates that an immediate termination request was detected by an algorithm.
  • - *
  • - * InvalidGraphStructureError – Indicates that a graph cannot be used with a certain algorithm. Some graph algorithms require a specific graph - * structure, for example trees or planar graph. These algorithms throw this error if a non-matching graph is used. - *
  • - *
- *

- * This type also provides the static {@link yfiles.lang.Exception#catchErrors} property, which when enabled, causes most entry points (e.g. event listeners) to use - * try/catch blocks to catch possible errors that could be thrown during event handling. The errors are handled by the {@link yfiles.lang.Exception#handleError} - * function, which calls the {@link yfiles.lang.Exception#handler} function, if it has been set. Note that for some browsers/plugins, try/catch blocks prevent - * error debugging functionality. Hence, {@link yfiles.lang.Exception#catchErrors} should be turned off while debugging. - *

- * @class - * @extends {Error} - */ - export interface Exception extends Error{} - export class Exception { - /** - * Creates a new exception with the given {@link yfiles.lang.Exception#message} and an optional error {@link yfiles.lang.Exception#name}. - * @param [message=null] The exception message. - * @param [name=null] The exception name. This name can be used in try...catch statements to distinguish between different types of errors. - * @param [innerException=null] The inner exception, if another exception was wrapped. - * @see yfiles.lang.Exception#message - */ - constructor(message?:string,name?:string,innerException?:yfiles.lang.Exception); - /** - * Creates a new exception with the given {@link yfiles.lang.Exception#message} and an optional error {@link yfiles.lang.Exception#name}. - * @param {Object} options The parameters to pass. - * @param [options.message=null] The exception message. - * @param [options.name=null] The exception name. This name can be used in try...catch statements to distinguish between different types of errors. - * @param [options.innerException=null] The inner exception, if another exception was wrapped. - * @see yfiles.lang.Exception#message - */ - constructor(options:{message?:string,name?:string,innerException?:yfiles.lang.Exception}); - /** - * This function is called in catch blocks in the library if {@link yfiles.lang.Exception#catchErrors} is enabled. - *

- * If a {@link yfiles.lang.Exception#handler} is registered, the error is passed to the error handler, otherwise if {@link yfiles.lang.Exception#catchErrors} is set to true the error is logged to the - * console using console.warn if available. - *

- * @param error The error object that has been caught - * @static - */ - static handleError(error:any):void; - /** - * Gets the exception message. - * @type {string} - */ - message:string; - /** - * Gets the exception name. - * @type {string} - */ - name:string; - /** - * The inner exception, if another exception was wrapped. - * @type {yfiles.lang.Exception} - */ - innerException:yfiles.lang.Exception; - /** - * Whether to use try/catch blocks when invoking event handlers. - *

- * If this property is enabled, try/catch blocks are used when invoking event handlers. As most browsers provide a stack - * trace with Error objects, this property can be used to provide more detailed error information. If this property is set, - * but no {@link yfiles.lang.Exception#handler} is registered, a warning will be logged to the console instead. - *

- * @static - * @type {boolean} - */ - static catchErrors:boolean; - /** - * If {@link yfiles.lang.Exception#catchErrors} is enabled, any caught errors are passed to this function. - *

- * Setting a handler via this property automatically turns on the {@link yfiles.lang.Exception#catchErrors} flag! - *

- * @static - * @type {function(any): void} - */ - static handler:(obj:any)=>void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.lang.Exception; - } - }export namespace collections{ - /** - * The default implementation for {@link yfiles.collections.IMap.}. - * Type parameter TKey: The type of the key elements of this dictionary. - * Type parameter TValue: The type of the value elements of this dictionary. - * @class - * @implements {yfiles.collections.IMap.} - * @implements {yfiles.collections.ICollection.>} - * @implements {yfiles.collections.IEnumerable.>} - * @template TKey,TValue - */ - export interface Map extends yfiles.lang.Object,yfiles.collections.IMap,yfiles.collections.ICollection>,yfiles.collections.IEnumerable>{} - export class Map { - /** - * Creates a new instance. - * @param {Object} [options=null] The parameters to pass. - * @param options.entries An array of items which are added to this map. Each item will be added via the {@link #add} method. - */ - constructor(options?:{entries?:Array}); - /** - * - * @param item - */ - add(item:yfiles.collections.MapEntry):void; - /** - * - */ - clear():void; - /** - * Whether this dictionary contains the given value. - * @param value The value to search for. - * @returns true if this dictionary contains the given value. - */ - containsValue(value:TValue):boolean; - /** - * - * @param array - * @param arrayIndex - */ - copyTo(array:yfiles.collections.MapEntry[],arrayIndex:number):void; - /** - * - * @param key - * @returns - */ - delete(key:TKey):boolean; - /** - * - * @param key - * @returns - */ - get(key:TKey):TValue; - /** - * - * @returns - */ - getEnumerator():yfiles.collections.IEnumerator>; - /** - * - * @param key - * @returns - */ - has(key:TKey):boolean; - /** - * - * @param item - * @returns - */ - includes(item:yfiles.collections.MapEntry):boolean; - /** - * - * @param item - * @returns - */ - remove(item:yfiles.collections.MapEntry):boolean; - /** - * - * @param key - * @param value - */ - set(key:TKey,value:TValue):void; - /** - * - * @type {number} - */ - size:number; - /** - * - * @type {boolean} - */ - isReadOnly:boolean; - /** - * - * @type {yfiles.collections.ICollection.} - */ - keys:yfiles.collections.ICollection; - /** - * - * @type {yfiles.collections.ICollection.} - */ - values:yfiles.collections.ICollection; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.collections.Map; - } - /** - * Defines methods to manipulate a collection of objects with the same type. - * Type parameter T: The type of the elements in the collection. - * @interface - * @implements {yfiles.collections.IEnumerable.} - * @template T - */ - export interface ICollection extends yfiles.lang.Object,yfiles.collections.IEnumerable{ - /** - * Adds the given item to the collection. - * @param item - * @abstract - */ - add(item:T):void; - /** - * Removes all items from this collection. - * @abstract - */ - clear():void; - /** - * Copies all elements of this collection into the given array. - * @param array The array to copy the elements to. - * @param arrayIndex The index in the given array where the first element should be copied to. - * @abstract - */ - copyTo(array:T[],arrayIndex:number):void; - /** - * Whether the given item is contained in this collection. - * @param item The item to search for. - * @returns true if the given item is contained in this collection. - * @abstract - */ - includes(item:T):boolean; - /** - * Removes the given item from this collection. - * @param item The item to remove. - * @returns Whether the item was removed from the collection. - * @abstract - */ - remove(item:T):boolean; - /** - * The number of elements in this collection. - * @abstract - * @type {number} - */ - size:number; - /** - * Whether this collection is read-only. - * @abstract - * @type {boolean} - */ - isReadOnly:boolean; - } - var ICollection:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.collections.ICollection; - }; - /** - * A collection of value objects which are mapped to key objects and can be queried using their keys. - *

- * The keys must have a well defined hashCode method that must not change between registering a value for the key and - * retrieving a value using the key. Thus it is advisable to use stable, i.e. immutable, objects as the key. - *

- * Type parameter TKey: The type of the keys. - * Type parameter TValue: The type of the values. - * @interface - * @implements {yfiles.collections.ICollection.>} - * @template TKey,TValue - */ - export interface IMap extends yfiles.lang.Object,yfiles.collections.ICollection>{ - /** - * Removes the key/value pair which is represented by the given key. - * @param key The key of the key/value pair to remove. - * @returns true if a key/value pair with the given key was removed from this collection. - * @abstract - */ - delete(key:TKey):boolean; - /** - * Gets the value of the key/value pair with the given key. - *

- * Setter: if there is already a key/value pair with the given key in the dictionary its value will be overridden. If not a - * new key/value pair will be added. - *
- * Getter: if there is no key/value pair with the given key in this dictionary null will be returned. - *

- * @param key - * @returns - * @see yfiles.collections.IMap.#set - * @abstract - */ - get(key:TKey):TValue; - /** - * Whether this dictionary's key collection contains the given key. - * @param key The key to search for. - * @returns true if this dictionary contains the given key. - * @abstract - */ - has(key:TKey):boolean; - /** - * Sets the value of the key/value pair with the given key. - *

- * Setter: if there is already a key/value pair with the given key in the dictionary its value will be overridden. If not a - * new key/value pair will be added. - *
- * Getter: if there is no key/value pair with the given key in this dictionary null will be returned. - *

- * @param key - * @param value - * @see yfiles.collections.IMap.#get - * @abstract - */ - set(key:TKey,value:TValue):void; - /** - * A {@link yfiles.collections.ICollection.} of the keys of this dictionary. - * @abstract - * @type {yfiles.collections.ICollection.} - */ - keys:yfiles.collections.ICollection; - /** - * A {@link yfiles.collections.ICollection.} of the values of this dictionary. - * @abstract - * @type {yfiles.collections.ICollection.} - */ - values:yfiles.collections.ICollection; - } - var IMap:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.collections.IMap; - }; - /** - * Defines ways to iterate over the items contained in this type by providing a method to get an {@link yfiles.collections.IEnumerator.}. - * Type parameter T: The type of the enumerable objects. - * @interface - * @template T - */ - export interface IEnumerable extends yfiles.lang.Object{ - /** - * - * @param enumerable - * @returns - */ - concat?(enumerable:yfiles.collections.IEnumerable):yfiles.collections.IEnumerable; - /** - * Returns the element at the given index in the enumerable. - * @param index The index of the element to return. - * @returns The element at the given index. - * @throws {Stubs.Exceptions.ArgumentError} If the index is not within the enumerable's range. - */ - elementAt?(index:number):T; - /** - * Whether all elements of the enumerable match the given predicate. - * @param predicate A function with the signature function(element):boolean which returns true if the element matches a condition. - * @param [thisArg=null] - * @returns Whether all elements of the enumerable match the given predicate. - * @throws {Stubs.Exceptions.ArgumentError} e is null. - * @throws {Stubs.Exceptions.ArgumentError} predicate is null. - */ - every?(predicate:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>boolean,thisArg?:any):boolean; - /** - * Returns an enumerable which only contains elements of the source enumerable which match a given predicate. - * @param predicate A function with the signature function(element):boolean which returns true if the given element should be included in - * the resulting enumerable. - * @param [thisArg=null] - * @returns An enumerable which contains the elements of the source enumeration which match the given predicate. - */ - filter?(predicate:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>boolean,thisArg?:any):yfiles.collections.IEnumerable; - /** - * Returns the first element of the enumerable which matches a given filter. - * @param [predicate=null] A function with the signature function(element):boolean which returns true if the given element should be returned - * @param [thisArg=null] - * @returns The first matching element of the enumerable. - * @throws {Stubs.Exceptions.ArgumentError} If the given enumerable is null. - * @throws {Stubs.Exceptions.InvalidOperationError} If the enumerable does not contain a matching element. - */ - first?(predicate?:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>boolean,thisArg?:any):T; - /** - * Returns the first element of the enumerable which matches a given filter. - * @param {Object} options The parameters to pass. - * @param [options.predicate=null] A function with the signature function(element):boolean which returns true if the given element should be returned - * @param [options.thisArg=null] - * @returns The first matching element of the enumerable. - * @throws {Stubs.Exceptions.ArgumentError} If the given enumerable is null. - * @throws {Stubs.Exceptions.InvalidOperationError} If the enumerable does not contain a matching element. - */ - first?(options:{predicate?:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>boolean,thisArg?:Object}):T; - /** - * Returns the first element of the enumerable, the first element of the enumerable which matches a given filter if - * sepcified, or null if there is no such element. - * @param [predicate=null] A function with the signature function(element):boolean which returns true if the given element should be returned - * @param [thisArg=null] - * @returns The first element of the enumerable or null. - * @throws {Stubs.Exceptions.ArgumentError} If the given enumerable is null. - */ - firstOrDefault?(predicate?:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>boolean,thisArg?:any):T; - /** - * Returns the first element of the enumerable, the first element of the enumerable which matches a given filter if - * sepcified, or null if there is no such element. - * @param {Object} options The parameters to pass. - * @param [options.predicate=null] A function with the signature function(element):boolean which returns true if the given element should be returned - * @param [options.thisArg=null] - * @returns The first element of the enumerable or null. - * @throws {Stubs.Exceptions.ArgumentError} If the given enumerable is null. - */ - firstOrDefault?(options:{predicate?:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>boolean,thisArg?:Object}):T; - /** - * Iterates over the enumerable and invokes the action for each element passing the value and index as arguments. - * @param action The delegate to call. - * @param [thisArg=null] - */ - forEach?(action:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>void,thisArg?:any):void; - /** - * Gets an {@link yfiles.collections.IEnumerator.} which can be used to iterate over the items in this instance - * @returns The {@link } which can be used to iterate over the items in this instance - * @abstract - */ - getEnumerator():yfiles.collections.IEnumerator; - /** - * Whether the given value is contained in the enumerable. - * @param value The value to search for. - * @returns true if the enumerable contains the given value. - */ - includes?(value:T):boolean; - /** - * Returns the last element of the enumerable. - * @returns The last element of the enumerable. - * @throws {Stubs.Exceptions.ArgumentError} If the given enumerable is null. - * @throws {Stubs.Exceptions.InvalidOperationError} If the enumerable is empty. - */ - last?():T; - /** - * Returns the last element of the enumerable or null if the enumerable is empty. - * @returns The last element of the enumerable or null. - * @throws {Stubs.Exceptions.ArgumentError} If the given enumerable is null. - */ - lastOrDefault?():T; - /** - * Maps each element of the enumerable into a new element in a new enumerable. - * Type parameter TResult: The type of the mapped elements. - * @param selector A function with the signature function(element, index):TResult which converts each element into a new element of the - * type TResult depending on the element's index. - * @param [thisArg=null] The optional value to use as this when executing the selector. - * @returns A projection of the original enumerable. - * @template TResult - */ - map?(selector:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>TResult,thisArg?:any):yfiles.collections.IEnumerable; - /** - * Converts a untyped enumerable into an enumerable with the given type. - *

- * The source enumerable may contain elements which are not of the given type. Those elements will not be contained in the - * returned enumerable. - *

- * Type parameter TResult. - * @returns A typed enumerable. - * @template TResult - */ - ofType?(resultType:yfiles.lang.Class):yfiles.collections.IEnumerable; - /** - * Applies an func function over the enumerable's elements. - * Type parameter TAccumulate: The type of the accumulated value. - * @param seed The start value for the accumulator. - * @param func A function with the signature function(seed,element):TAccumulate which "adds" (accumulates) a value depending on the - * element to the seed value and returns the result. - * @returns The final value of the accumulator. - * @template TAccumulate - */ - reduce?(seed:TAccumulate,func:(arg1:TAccumulate,arg2:T,arg3:number,arg4:yfiles.collections.IEnumerable)=>TAccumulate):TAccumulate; - /** - * Creates a flattened view of a given enumerable using the given selector function which returns an enumerable for each - * element of the source enumerable. - * Type parameter TResult. - * @param selector A function with the signature function(element):IEnumerable which returns an enumerable for each element of the source - * enumerable. - * @param [thisArg=null] - * @returns A flattened view of the given enumerable. The enumerables which are returned by the selector method for each element are - * concatenated in the result. - * @template TResult - */ - selectMany?(selector:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>yfiles.collections.IEnumerable,thisArg?:any):yfiles.collections.IEnumerable; - /** - * Whether the enumerable contains any elements matching the given predicate. - * @param [predicate=null] A function with the signature function(element):boolean which returns true if the element matches a condition. - * @param [thisArg=null] - * @returns Whether the enumerable contains any elements matching the given predicate. - * @throws {Stubs.Exceptions.ArgumentError} e is null. - */ - some?(predicate?:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>boolean,thisArg?:any):boolean; - /** - * Whether the enumerable contains any elements matching the given predicate. - * @param {Object} options The parameters to pass. - * @param [options.predicate=null] A function with the signature function(element):boolean which returns true if the element matches a condition. - * @param [options.thisArg=null] - * @returns Whether the enumerable contains any elements matching the given predicate. - * @throws {Stubs.Exceptions.ArgumentError} e is null. - */ - some?(options:{predicate?:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>boolean,thisArg?:Object}):boolean; - /** - * Calculates the sum of the elements of the enumerable. - * @param selector A function with the signature function(element):Number which returns a numeric value for the given element. - * @param [thisArg=null] - * @returns The sum of the elements of the enumerable. - */ - sum?(selector:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>number,thisArg?:any):number; - /** - * Returns elements from an enumerable as long as the given predicate is true. - * @param predicate A function with the signature function(element):boolean which returns true as long as the elements should be added to - * the returned enumerable. - * @param [thisArg=null] - * @returns A subset of the original enumerable. - */ - takeWhile?(predicate:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>boolean,thisArg?:any):yfiles.collections.IEnumerable; - /** - * Creates an array with the values of the enumerable. - * @returns An array with the enumerable's elements. - */ - toArray?():T[]; - /** - * Creates a {@link yfiles.collections.List.} with the values of the enumerable. - * @returns An {@link } with the enumerable's elements. - */ - toList?():yfiles.collections.List; - /** - * Returns an enumerable which contains the elements of the original enumerable in reverse order. - * @returns An enumerable which contains the elements of the original enumerable in reverse order. - */ - toReversed?():yfiles.collections.IEnumerable; - /** - * Returns the number of elements contained in the enumerable. - * @type {number} - */ - size?:number; - } - var IEnumerable:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.collections.IEnumerable; - }; - /** - * Provides methods to iterate over a collection or list of elements of the same type. - *
-     * var e = someList.getEnumerator();
-     * // always move before you access
-     * while(e.moveNext()) {
-     *   // get the current element
-     *   var current = e.current;
-     * }
-     * 
- * - * Type parameter T. - * @interface - * @template T - */ - export interface IEnumerator extends yfiles.lang.Object{ - /** - * Moves this enumerator to the next element. - *

- * A newly created enumerator's {@link yfiles.collections.IEnumerator.#current current position} is before the first element. Thus, this method must be called before first - * access to the {@link yfiles.collections.IEnumerator.#current} property. The same applies to the state after calling {@link yfiles.collections.IEnumerator.#reset}. - *

- * @returns true if the enumerator was moved to a valid position - * @abstract - */ - moveNext():boolean; - /** - * Resets the enumerator to its starting state. - *

- * In other words: sets the current position before the first element. - *

- * @abstract - */ - reset():void; - /** - * Gets the element at the enumerator's current position. - *

- * This value is undefined if the enumerator is in initial state (after creation or - * {@link yfiles.collections.IEnumerator.#reset}) or has been moved past the end of the represented collection. - *

- * @abstract - * @type {T} - */ - current:T; - } - var IEnumerator:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.collections.IEnumerator; - }; - /** - * A read-write collection of objects of the same type. - * Type parameter T: The type of objects in the list. - * @interface - * @implements {yfiles.collections.ICollection.} - * @template T - */ - export interface IList extends yfiles.lang.Object,yfiles.collections.ICollection{ - /** - * Gets the item at the given index. - * @param index The index of the item to access. - * @returns The item at the given index. - * @see yfiles.collections.IList.#set - * @abstract - */ - get(index:number):T; - /** - * The index of the given item in the list. - * @param item The item to search for. - * @returns The index of the given item in the list. -1 if the item is not in the list. - * @abstract - */ - indexOf(item:T):number; - /** - * Inserts the given item at the given index. - * @param index The index to insert the item at. - * @param item The item to insert. - * @abstract - */ - insert(index:number,item:T):void; - /** - * Removes the item at the given index from the list. - * @param index The index of the item to remove. - * @abstract - */ - removeAt(index:number):void; - /** - * Sets the item at the given index. - * @param index The index of the item to access. - * @param value The item at the given index. - * @see yfiles.collections.IList.#get - * @abstract - */ - set(index:number,value:T):void; - } - var IList:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.collections.IList; - }; - /** - * The key/value pair of a {@link yfiles.collections.IMap.}. - * Type parameter TKey: The type of the key element. - * Type parameter TValue: The type of the value element. - * @class - * @template TKey,TValue - * @final - */ - export interface MapEntry extends yfiles.lang.Object{} - export class MapEntry { - /** - * Creates a new instance with the given key and value. - * @param key The key for this pair. - * @param value The value for this pair. - */ - constructor(key:TKey,value:TValue); - /** - * The key for this key/value pair. - * @type {TKey} - */ - key:TKey; - /** - * The value for this key/value pair. - * @type {TValue} - */ - value:TValue; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.collections.MapEntry; - } - /** - * Default implementation of {@link yfiles.collections.IList.}. - *

- * This implementation provides fast random indexed access. However, removing or adding elements from the beginning or in - * the middle of the list will slower. - *

- * Type parameter T: The type of the list's elements. - * @class - * @implements {yfiles.collections.IList.} - * @template T - */ - export interface List extends yfiles.lang.Object,yfiles.collections.IList{} - export class List { - /** - * Creates a new instance and fills it with the elements of the given enumerable. - * @param enumerable The enumerable to fill the list with. - */ - constructor(enumerable:yfiles.collections.IEnumerable); - /** - * Creates a new instance. - * @param {Object} [options=null] The parameters to pass. - * @param options.items An array of items which are added to this list. Each item will be added via the {@link #add} method. - */ - constructor(options?:{items?:Array}); - /** - * - * @param item - */ - add(item:T):void; - /** - * Adds the elements of the given collection to this list. - * @param enumerable The collection to add. - */ - addRange(enumerable:yfiles.collections.IEnumerable):void; - /** - * Searches the (sorted) list for the given item. - *

- * This search is done as a binary search, therefore the list must be sorted. The given comparer is used to compare the - * elements to each other. - *

- * @param item The item to search for. - * @param comparer The comparer to use for comparing the elements. - * @returns The index of the item in the list. -1 if the item is not found. - */ - binarySearch(item:T,comparer:yfiles.collections.IComparer):number; - /** - * - */ - clear():void; - /** - * - * @param array - * @param arrayIndex - */ - copyTo(array:T[],arrayIndex:number):void; - /** - * Searches the list for the first element for which match returns true. - * @param match A predicate function with the signature function(o:Object):boolean which returns true if o matches the conditions of the - * element to search for. - * @returns The first element for which match returns true or null is no such element in the list. - */ - find(match:(obj:T)=>boolean):T; - /** - * Searches the list for the first element for which match returns true and returns its index. - * @param match A predicate function with the signature function(o:Object):boolean which returns true if o matches the conditions of the - * element to search for. - * @returns The index of the first element for which match returns true or -1 if there is no such element in the list. - */ - findIndex(match:(obj:T)=>boolean):number; - /** - * Creates a new list with the given array used as the live backing store. - *

- * Modifying the list or the array will modify both instances. - *

- * @param array The array to create a list view over from. - * @returns A list backed by the given array. - * @static - */ - static fromArray(array:T[]):yfiles.collections.List; - /** - * - * @param index - * @returns - */ - get(index:number):T; - /** - * - * @returns - */ - getEnumerator():yfiles.collections.IEnumerator; - /** - * - * @param item - * @returns - */ - includes(item:T):boolean; - /** - * - * @param item - * @returns - */ - indexOf(item:T):number; - /** - * - * @param index - * @param item - */ - insert(index:number,item:T):void; - /** - * - * @param item - * @returns - */ - remove(item:T):boolean; - /** - * Removes all elements for which match returns true. - * @param match A predicate function with the signature function(o:Object):boolean which returns true if o matches the conditions of the - * element to search for. - * @returns The number of elements which were removed. - */ - removeAll(match:(obj:T)=>boolean):number; - /** - * - * @param index - */ - removeAt(index:number):void; - /** - * Removes a given count of elements starting from the given index. - * @param index The index of the first element to remove. - * @param count The number of elements to remove. - */ - removeRange(index:number,count:number):void; - /** - * Reverses the order of the elements in the list. - */ - reverse():void; - /** - * - * @param index - * @param value - */ - set(index:number,value:T):void; - /** - * Sorts all elements in the list using the given comparison function. - * @param comparison The comparison function to use. - */ - sort(comparison:(arg1:any,arg2:any)=>number):void; - /** - * Sorts all elements in the list using the given comparer. - * @param comparer The comparer to use. - */ - sort(comparer:yfiles.collections.IComparer):void; - /** - * Sorts all elements in list using the default comparer. - */ - sort():void; - /** - * Copies the elements of this list into an array. - * @returns An array containing the elements of this list. - */ - toArray():T[]; - /** - * - * @type {number} - */ - size:number; - /** - * - * @type {boolean} - */ - isReadOnly:boolean; - capacity:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.collections.List; - } - /** - * Provides a method to compare two objects of the same type. - * Type parameter T: The type of the objects to compare. - * @interface - * @template T - */ - export interface IComparer extends yfiles.lang.Object{ - /** - * Compares two objects of type T. - * @param x The first object. - * @param y The second object. - * @returns - *
    - *
  • -1: x is less than y
  • - *
  • 0: x is equal to y
  • - *
  • 1: x is greater than y
  • - *
- * @abstract - */ - compare(x:T,y:T):number; - } - var IComparer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.collections.IComparer; - }; - /** - * A simple default implementation of an {@link yfiles.collections.IObservableCollection.} that is backed by an ordinary {@link yfiles.collections.ICollection.} - * Type parameter T: The type of the elements contained in this collection. - * @class - * @implements {yfiles.collections.IObservableCollection.} - * @template T - */ - export interface ObservableCollection extends yfiles.lang.Object,yfiles.collections.IObservableCollection{} - export class ObservableCollection { - /** - * Creates a new instance using a provided collection as the backing store. - * @param [items=null] The collection to use as the backing store. If no collection is provided a {@link } will be used. - */ - constructor(items?:yfiles.collections.ICollection); - /** - * Adds the item the the collection and triggers the {@link yfiles.collections.ObservableCollection.#addItemAddedListener ItemAdded} event. - *

- * This implementation calls the {@link yfiles.collections.ObservableCollection.#onItemAdded} method. - *

- * @param item The item to add to the collection. - */ - add(item:T):void; - /** - * Clears this collection, triggering an {@link yfiles.collections.ObservableCollection.#addItemRemovedListener ItemRemoved} event for each element removed. - * @see yfiles.collections.ObservableCollection.#onItemRemoved - */ - clear():void; - /** - * Copies the items to the given array. - * @param array - * @param arrayIndex - */ - copyTo(array:T[],arrayIndex:number):void; - /** - * Returns an enumerator over the elements in this collection. - * @returns - */ - getEnumerator():yfiles.collections.IEnumerator; - /** - * Checks for containment of the item in this collection. - * @param item The item to check. - * @returns Whether the item is contained in this collection. - */ - includes(item:T):boolean; - /** - * Callback method that will trigger the {@link yfiles.collections.ObservableCollection.#addItemAddedListener ItemAdded} event. - * @param item The item that has just been added to the collection. - * @protected - */ - onItemAdded(item:T):void; - /** - * Callback method that will trigger the {@link yfiles.collections.ObservableCollection.#addItemChangedListener ItemChanged} event. - * @param item The item that has changed. - * @protected - */ - onItemChanged(item:T):void; - /** - * Callback method that will trigger the {@link yfiles.collections.ObservableCollection.#addItemRemovedListener ItemRemoved} event. - * @param item The item that has just been removed from the collection. - * @protected - */ - onItemRemoved(item:T):void; - /** - * Method that may be called by client code to trigger an {@link yfiles.collections.ObservableCollection.#addItemChangedListener ItemChanged} event. - * @param item The item to trigger the change event for. - * @see yfiles.collections.ObservableCollection.#onItemChanged - */ - publishItemChanged(item:T):void; - /** - * Tries to remove the item from the collection and triggers the {@link yfiles.collections.ObservableCollection.#addItemRemovedListener ItemRemoved} event. - * @param item The item to remove. - * @returns Whether the item has been removed. - * @see yfiles.collections.ObservableCollection.#onItemRemoved - */ - remove(item:T):boolean; - /** - * Gets the number of elements in this collection. - * @type {number} - */ - size:number; - /** - * Gets whether this collection is read only. - * @type {boolean} - */ - isReadOnly:boolean; - /** - * Gets the collection used internally as the backing store. - *

- * Normally code should not use this method to gain access to the collection in order to modify it. - *

- * @returns The backing store of this observable collection. - * @type {yfiles.collections.ICollection.} - */ - items:yfiles.collections.ICollection; - /** - * Adds the given listener for the ItemAdded event that occurs when an item has been added to this collection. - * @param listener The listener to add. - * @see yfiles.collections.ObservableCollection.#removeItemAddedListener - */ - addItemAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the ItemAdded event that occurs when an item has been added to this collection. - * @param listener The listener to remove. - * @see yfiles.collections.ObservableCollection.#addItemAddedListener - */ - removeItemAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the ItemRemoved event that occurs when an item has been removed from this collection. - * @param listener The listener to add. - * @see yfiles.collections.ObservableCollection.#removeItemRemovedListener - */ - addItemRemovedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the ItemRemoved event that occurs when an item has been removed from this collection. - * @param listener The listener to remove. - * @see yfiles.collections.ObservableCollection.#addItemRemovedListener - */ - removeItemRemovedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the ItemChanged event that occurs when an item has been changed inside this collection. - * @param listener The listener to add. - * @see yfiles.collections.ObservableCollection.#removeItemChangedListener - */ - addItemChangedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the ItemChanged event that occurs when an item has been changed inside this collection. - * @param listener The listener to remove. - * @see yfiles.collections.ObservableCollection.#addItemChangedListener - */ - removeItemChangedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.collections.ObservableCollection; - } - /** - * An {@link yfiles.collections.IMapper.} implementation backed by a {@link yfiles.collections.IMap.}. - *

- * A {@link yfiles.collections.Mapper.#defaultValue} can be set that is returned for keys that don't have an explicit value set. - *

- *

- * It is legal to use null as key, which can be assigned a value just like other keys. - *

- * Type parameter K. - * Type parameter V. - * @class - * @implements {yfiles.collections.IMapper.} - * @template K,V - * @final - */ - export interface Mapper extends yfiles.lang.Object,yfiles.collections.IMapper{} - export class Mapper { - /** - * Creates an instance using the provided {@link yfiles.collections.Map.} as the backing store. - *

- * The value for the null item is stored separately. - *

- * @param dictionary - */ - constructor(dictionary:yfiles.collections.IMap); - /** - * Creates an instance using the provided {@link yfiles.collections.Map.} as the backing store. - *

- * The value for the null item is stored separately. - *

- * @param {Object} options The parameters to pass. - * @param options.dictionary - * @param {V} options.defaultValue The default value to return if no specific value has been set for a given key. - *

- * This option sets the {@link yfiles.collections.Mapper.#defaultValue} property on the created object. - *

- */ - constructor(options:{dictionary:yfiles.collections.IMap,defaultValue?:V}); - /** - * Creates an instance using a {@link yfiles.collections.Map.} as the backing store. - *

- * The value for the null item is stored separately. - *

- * @param {Object} [options=null] The parameters to pass. - * @param {V} options.defaultValue The default value to return if no specific value has been set for a given key. - *

- * This option sets the {@link yfiles.collections.Mapper.#defaultValue} property on the created object. - *

- */ - constructor(options?:{defaultValue?:V}); - /** - * Calls {@link yfiles.collections.Map.#clear} on the backing implementation. - */ - clear():void; - /** - * - * @param key - */ - delete(key:K):void; - /** - * - * @param key - * @returns - */ - get(key:K):V; - /** - * - * @param key - * @param value - */ - set(key:K,value:V):void; - /** - * Gets an enumerable over all entries in this (dictionary based) mapper. - * @type {yfiles.collections.IEnumerable.>} - */ - entries:yfiles.collections.IEnumerable>; - /** - * Gets or sets the default value to return if no specific value has been set for a given key. - * @type {V} - */ - defaultValue:V; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.collections.Mapper; - } - /** - * The interface for a collection that will notify registered event handlers of changes to its contents. - * Type parameter T: The type of the items in the collection. - * @see yfiles.collections.ObservableCollection. - * @interface - * @implements {yfiles.collections.ICollection.} - * @template T - */ - export interface IObservableCollection extends yfiles.lang.Object,yfiles.collections.ICollection{ - /** - * Adds the given listener for the ItemAdded event that occurs when an item has been added to this collection. - * @param listener The listener to add. - * @see yfiles.collections.IObservableCollection.#removeItemAddedListener - * @abstract - */ - addItemAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the ItemAdded event that occurs when an item has been added to this collection. - * @param listener The listener to remove. - * @see yfiles.collections.IObservableCollection.#addItemAddedListener - * @abstract - */ - removeItemAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the ItemRemoved event that occurs when an item has been removed from this collection. - * @param listener The listener to add. - * @see yfiles.collections.IObservableCollection.#removeItemRemovedListener - * @abstract - */ - addItemRemovedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the ItemRemoved event that occurs when an item has been removed from this collection. - * @param listener The listener to remove. - * @see yfiles.collections.IObservableCollection.#addItemRemovedListener - * @abstract - */ - removeItemRemovedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the ItemChanged event that occurs when an item in this collection has changed - * significantly. - *

- * It is up to the implementation whether and when to trigger this event. - *

- * @param listener The listener to add. - * @see yfiles.collections.IObservableCollection.#removeItemChangedListener - * @abstract - */ - addItemChangedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the ItemChanged event that occurs when an item in this collection has changed - * significantly. - *

- * It is up to the implementation whether and when to trigger this event. - *

- * @param listener The listener to remove. - * @see yfiles.collections.IObservableCollection.#addItemChangedListener - * @abstract - */ - removeItemChangedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - } - var IObservableCollection:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.collections.IObservableCollection; - }; - /** - * An extension to the {@link yfiles.collections.IEnumerable.} interface that allows for indexed access and retrieval of the element count. - *

- * This interface is like a rudimentary read-only {@link yfiles.collections.IList.} - *

- * Type parameter T: The type of the contained elements. - * @interface - * @implements {yfiles.collections.IEnumerable.} - * @template T - */ - export interface IListEnumerable extends yfiles.lang.Object,yfiles.collections.IEnumerable{ - /** - * Gets the i-th element in the collection. - * @param i the zero-based index of the item in this collection - * @returns the item for the given index - * @throws {Stubs.Exceptions.ArgumentError} i is not a valid index in the {@link yfiles.collections.IListEnumerable.}. - * @abstract - */ - get(i:number):T; - /** - * Gets the number of elements in this collection. - * @abstract - * @type {number} - */ - size:number; - } - var IListEnumerable:{ - /** - * An empty, immutable instance of {@link yfiles.collections.IListEnumerable.}. - * @const - * @static - * @type {yfiles.collections.IListEnumerable.} - */ - EMPTY?:yfiles.collections.IListEnumerable; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.collections.IListEnumerable; - }; - /** - * Wraps a simple {@link yfiles.collections.IEnumerable.} into a {@link yfiles.collections.IListEnumerable.}. - *

- * This implementation is optimized for {@link yfiles.collections.IList.} and {@link yfiles.collections.ICollection.}, as well as {@link Object} {@link yfiles.collections.IEnumerable.}s. - *

- * Type parameter T: The type of the enumerable. - * @class - * @implements {yfiles.collections.IListEnumerable.} - * @template T - * @final - */ - export interface ListEnumerable extends yfiles.lang.Object,yfiles.collections.IListEnumerable{} - export class ListEnumerable { - /** - * Creates a new instance using the given backing enumerable. - * @param backingEnumerable The enumerable to back this instance. - */ - constructor(backingEnumerable:yfiles.collections.IEnumerable); - /** - * Creates a new instance with a backing {@link yfiles.collections.List.} as the backing store. - */ - constructor(); - /** - * - * @param i - * @returns - */ - get(i:number):T; - /** - * - * @returns - */ - getEnumerator():yfiles.collections.IEnumerator; - /** - * Gets the backing enumerable. - * @type {yfiles.collections.IEnumerable.} - */ - backingEnumerable:yfiles.collections.IEnumerable; - /** - * - * @type {number} - */ - size:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.collections.ListEnumerable; - } - /** - * Event argument class used by {@link yfiles.collections.IObservableCollection.} and similar that holds a specific item that is related to the event. - * Type parameter T: The type of the item contained in the event. - * @class - * @extends {yfiles.lang.EventArgs} - * @template T - */ - export interface ItemEventArgs extends yfiles.lang.EventArgs{} - export class ItemEventArgs { - /** - * Creates a new event argument for the given item. - * @param item The item which is the subject of the event. - */ - constructor(item:T); - /** - * Gets the item that is the subject of the event. - * @type {T} - */ - item:T; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.collections.ItemEventArgs; - } - /** - * An interface for simple typed dictionary-like implementations. - *

- * {@link yfiles.collections.IMapper.}s are most prominently used when interfacing with {@link yfiles.layout.ILayoutAlgorithm layout algorithms} and {@link yfiles.graphml.GraphMLIOHandler GraphML}. {@link yfiles.graph.IGraph} also provides the {@link yfiles.graph.IGraph#mapperRegistry} - * to add additional information to a graph. - *

- * Type parameter K: The type of element this interface accepts as keys for the mapping. - * Type parameter V: The type of element this interface accepts as values for the mapping. - *

- * Using {@link yfiles.collections.IMapper.} is described in the section {@link @DGUIDE_PREFIX@/customizing_graph-binding_data.html Associating Data with Graph Elements}. - *

- *

Related demos:

- *
    - *
  • Demo: DragAndDropForm, demo.yfiles.input.draganddrop
  • - *
- * @see yfiles.collections.Mapper. - * @interface - * @template K,V - */ - export interface IMapper extends yfiles.lang.Object{ - /** - * Gets the value for a given key in the mapping. - *

- * Setting a value for an already existing key overwrites the previous value. - *

- *

- * It depends on the specific implementation of the mapper whether a mapping can be removed. If an implementation provides - * a way to remove a mapping, that should be preferred over setting a null value. For example, {@link yfiles.collections.Mapper.} provides the {@link yfiles.collections.Mapper.#delete} - * method. - *

- * @param key The key of the mapping. - * @returns The value. - * @see yfiles.collections.IMapper.#set - * @abstract - */ - get(key:K):V; - /** - * Sets the value for a given key in the mapping. - *

- * Setting a value for an already existing key overwrites the previous value. - *

- *

- * It depends on the specific implementation of the mapper whether a mapping can be removed. If an implementation provides - * a way to remove a mapping, that should be preferred over setting a null value. For example, {@link yfiles.collections.Mapper.} provides the {@link yfiles.collections.Mapper.#delete} - * method. - *

- * @param key The key of the mapping. - * @param value The value. - * @see yfiles.collections.IMapper.#get - * @abstract - */ - set(key:K,value:V):void; - } - var IMapper:{ - /** - * Creates a constant mapper that will always return the constant. - * Type parameter K: The type of the key to use. - * Type parameter V: The type of the value to use. - * @param constant The constant to return in {@link #get} - * @returns A new instance that will always return the same constant. - * @template K,V - * @static - */ - fromConstant?(constant:V):yfiles.collections.IMapper; - /** - * Create an implementation of {@link yfiles.collections.IMapper.} that delegates {@link yfiles.collections.IMapper.#get} getter calls to the provided handler. - *

- * The implementation returned silently ignores calls to the {@link yfiles.collections.IMapper.#get} setter. - *

- * Type parameter K: The type of the key to use. - * Type parameter V: The type of the value to use. - * @param getter The delegate to delegate {@link #get} getter calls to. - * @returns An implementation that delegates to getter. - * @template K,V - * @static - */ - fromDelegate?(getter:(key:K)=>V):yfiles.collections.IMapper; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.collections.IMapper; - }; - }export namespace graphml{ - export interface XmlName extends yfiles.lang.Object{} - export class XmlName { - /** - * Initializes a new instance of the {@link yfiles.graphml.XmlName} class. - * @param localName The local name of the element. - * @param ns The namespace it belongs to. - */ - constructor(localName:string,ns:string); - /** - * Performs a conversion from {@link string} to {@link yfiles.graphml.XmlName}. - *

- * The name is made up of at most two parts: the namespace and the local name. When given an input like "http://www.w3.org/2000/xmlns/}local" - * it will be split at the "}" character and the first part will be used as the namespace URI, the second part as the local - * name. If no "}" character is used in the input then it will be assumed that the input consists of the local name only. - *

- * @param expandedName Name of the expanded. - * @returns The result of the conversion. - * @static - */ - static convertFrom(expandedName:string):yfiles.graphml.XmlName; - /** - * Gets or sets the local name. - * @type {string} - */ - localName:string; - /** - * Gets the namespace. - * @type {string} - */ - namespace:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.XmlName; - } - export enum XamlAttributeWritePolicy{ - /** - * Specifies that the write mode of a member should be determined automatically according to the current property value and - * the presence of {@link yfiles.graphml.ValueSerializer}s or implementations of {@link yfiles.graphml.IMarkupExtensionConverter}s. - *

- * Usually, an implementation would write the member as attribute if the content can somehow be (directly or indirectly) - * converted to a valid XML attribute content (i.e. a simple string) - *

- */ - AUTO, - /** - * Never write as a XML attribute, even if a possible conversion exists. - */ - NEVER, - /** - * Always write as XML attribute. - *

- * This can be used for special cases where the default implementation does not detect a valid conversion, but some part of - * the (de)serialization is handled manually. - *

- */ - ALWAYS - } - export enum GraphMLSharingPolicy{ - /** - * Specifies that the share mode of a member should be determined automatically according to the current property value. - */ - AUTO, - /** - * Never share the object. - */ - NEVER, - /** - * Always share the object. - *

- * This will also always place the object in the resources section, even if it only occurs once in the document. - *

- */ - ALWAYS - } - export enum GraphMLMemberVisibility{ - /** - * The member is treated according to the normal XAML serialization rules. - */ - VISIBLE, - /** - * Only the content of a member value is read or written, without an enclosing explicit container object. - */ - CONTENT, - /** - * The member is ignored by GraphML. - */ - HIDDEN - } - export enum UndefinedHandling{ - /** - * Explicitly read and write undefined values. - */ - EXPLICIT, - /** - * Throw an exception when undefined values are encountered. - */ - THROW, - /** - * Treat undefined values like null values. - */ - AS_NULL, - /** - * Treat undefined values as default values. - *

- * Default values are never written. - *

- */ - AS_DEFAULT - } - /** - * Custom attribute to control specific aspects of GraphML deserialization. - *

- * The specialized {@link yfiles.graphml.XamlSerializer} will evaluate this attribute to override its built in serialization rules. - * The main use cases for this attribute are to override object reference sharing, configure consistent member naming and - * handle legacy serialization. - *

- * @see yfiles.graphml.XamlSerializer - * @class - * @extends {yfiles.lang.Attribute} - */ - export interface GraphMLAttribute extends yfiles.lang.Attribute{} - export class GraphMLAttribute { - constructor(); - /** - * Gets or sets the name of the attributed member. - *

- * This will be used as the XML element or XML attribute name. - *

- *

- * This property is ignored if the attribute targets a type declaration. - *

- * @type {string} - */ - name:string; - /** - * Gets or sets the XML namespace URI for the member where this attribute is used. - *

- * This will be used as the XML namespace URI for the XML element or XML attribute. - *

- *

- * This property is ignored if the attribute targets a type declaration. - *

- * @type {string} - */ - xmlNamespace:string; - /** - * Gets or sets whether an enclosing tag for the property itself is written. - *

- * If true, the resulting XML will look like - *

- *
-       * <ParentObjectName.Name>
-       *    <PropertyTypeName>
-       *       content
-       *    </PropertyTypeName>
-       * </ParentObjectName.Name>
-       * 
- * - *

- * Default value is true. - *

- *

- * This property is ignored if the attribute targets a type declaration. - *

- * @type {boolean} - */ - writeEnclosingTag:boolean; - /** - * Gets or sets whether the member should be written as an XML element or as an XML attribute. - *

- * Default value is {@link yfiles.graphml.XamlAttributeWritePolicy#AUTO}. - *

- *

- * This property is ignored if the attribute targets a type declaration. - *

- * @see yfiles.graphml.XamlAttributeWritePolicy - * @type {yfiles.graphml.XamlAttributeWritePolicy} - */ - writeAsAttribute:yfiles.graphml.XamlAttributeWritePolicy; - /** - * Gets or sets whether the object reference identity of the property values should be kept intact. - *

- * Default value is {@link yfiles.graphml.GraphMLSharingPolicy#AUTO}. - *

- *

- * This property is ignored if the attribute targets a type declaration. - *

- * @type {yfiles.graphml.GraphMLSharingPolicy} - */ - shareable:yfiles.graphml.GraphMLSharingPolicy; - /** - * Gets or sets how a member should be visible to GraphML. - *

- * Default value is {@link yfiles.graphml.GraphMLMemberVisibility#VISIBLE}. - *

- *

- * This property is ignored if the attribute targets a type declaration. - *

- * @type {yfiles.graphml.GraphMLMemberVisibility} - */ - visibility:yfiles.graphml.GraphMLMemberVisibility; - /** - * Specifies the property of a class that is used as the content property in XAML. - *

- * The value of the content property can appear in XAML as a direct child of the class element, without the need to wrap it - * into a <Class.Property> element. - *

- *

- * This property is ignored if the attribute targets a member declaration. - *

- * @type {string} - */ - contentProperty:string; - /** - * Gets or sets the type of the {@link yfiles.graphml.GraphMLAttribute#valueSerializer} implementation. - * @type {yfiles.lang.Class} - */ - valueSerializer:yfiles.lang.Class; - /** - * Gets or sets a custom {@link yfiles.graphml.IMarkupExtensionConverter} for attribute serialization. - *

- * The specialized {@link yfiles.graphml.XamlSerializer} will evaluate this attribute to override its built in mechanism to lookup - * an {@link yfiles.graphml.IMarkupExtensionConverter} for an object. The specified type must implement - * {@link yfiles.graphml.IMarkupExtensionConverter}. - *

- * @see yfiles.graphml.XamlSerializer - * @see yfiles.graphml.IMarkupExtensionConverter - * @type {yfiles.lang.Class} - */ - markupExtensionConverter:yfiles.lang.Class; - /** - * Types that should be searched for static field or property members of the annotated type. - *

- * When a type is annotated with this attribute, all types in the {@link yfiles.graphml.GraphMLAttribute#singletonContainers} array are searched for public static fields or - * properties that have the annotated type. The GraphML writer will write these members as StaticExtensions instead of the - * usual serialization. This property is ignored if the attribute targets a member declaration. - *

- *

- * Using the following annotation - *

- *

- * has the effect that all references to field ContainedTypeSingleton will be written as static extensions, e.g. - *

- *
-       * {x:Static myNSDeclarationPrefix:ContainingType.ContainedTypeSingleton}
-       * 
- * - * @type {Array.} - */ - singletonContainers:yfiles.lang.Class[]; - /** - * Gets or sets the default value of the property this attribute is bound to. - *

- * This property is ignored if the attribute targets a type declaration. - *

- * @type {any} - */ - defaultValue:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.GraphMLAttribute; - } - export enum KeyType{ - /** - * Identifier for attribute of type int. - */ - INT, - /** - * Identifier for attribute of type long. - */ - LONG, - /** - * Identifier for attribute of type float. - */ - FLOAT, - /** - * Identifier for attribute of type double. - */ - DOUBLE, - /** - * Identifier for attribute of type string that denotes simple string content as opposed to - * {@link yfiles.graphml.KeyType#COMPLEX}. - */ - STRING, - /** - * Identifier for attribute of type boolean. - */ - BOOLEAN, - /** - * Identifier for arbitrary complex xml content - */ - COMPLEX - } - export enum KeyScope{ - /** - * Unscoped for key definition - */ - ALL, - /** - * Node-Scope for key definition. - */ - NODE, - /** - * Edge-Scope for key definition. - */ - EDGE, - /** - * Graph-Scope for key definition. - */ - GRAPH, - /** - * Port-Scope for key definition. - */ - PORT, - /** - * Graphml-Scope for key definition. - */ - GRAPHML - } - /** - * Interface that defines the context of a GraphML parsing context. - *

- * All state data that is needed for the parsing of a concrete input should go here, allowing all handlers and - * deserializers to be implemented stateless. - *

- * @interface - * @implements {yfiles.graph.ILookup} - */ - export interface IParseContext extends yfiles.lang.Object,yfiles.graph.ILookup{ - /** - * Deserialize the object representation in targetNode. - *

- * This method calls {@link yfiles.graphml.IParseContext#deserializeCore} with context as first argument and should be used in - * virtually all cases. - *

- * Type parameter T: The desired target type. - * @param targetType The desired target type. - * @param targetNode The XML node that should be deserialized. - * @returns an instance of T or null. - * @throws {yfiles.graphml.DeserializationNotSupportedError} - * @see yfiles.graphml.IParseContext#deserializeCore - * @template T - */ - deserialize?(targetType:yfiles.lang.Class,targetNode:Node):T; - /** - * Deserialize the object representation in targetNode - *

- * Client code should usually use the extension method {@link yfiles.graphml.IParseContext#deserialize} instead to ensure the the - * correct context instance is used. - *

- * Type parameter T: The expected return type. - * @param targetType The expected return type. - * @param context The current parse context. - * @param targetNode The XML node that should be deserialized. - * @returns The deserialized object from targetNode or an {@link } if targetNode could not be deserialized. - * @see yfiles.graphml.IParseContext#deserialize - * @template T - * @abstract - */ - deserializeCore(targetType:yfiles.lang.Class,context:yfiles.graphml.IParseContext,targetNode:Node):T; - /** - * Returns the most current (the last element) within the container hierarchy as it is returned by {@link yfiles.graphml.IParseContext#objectStack} or default(T) if the - * most current element is not of the desired target type. - * Type parameter T: The desired target type. - * @param itemType The desired target type. - * @returns the most current element within the container hierarchy or default(T). - * @template T - * @abstract - */ - getCurrent(itemType:yfiles.lang.Class):T; - /** - * Get a property value that specifies information about how to handle specific cases. - * @param key The identifier for the property - * @returns The property value, or null if no such property exists. - * @abstract - */ - getDeserializationProperty(key:string):any; - /** - * Gets the current nesting of created graphs and graph elements. - *

- * The list contains the user objects which correspond to the GraphML elements which are ancestors of the current node in - * the DOM tree. - *

- * @abstract - * @type {yfiles.collections.IListEnumerable.} - */ - objectStack:yfiles.collections.IListEnumerable; - /** - * Gets an implementation of {@link yfiles.graphml.IParseEvents} that allows to subscribe to various events in the parse process. - * @abstract - * @type {yfiles.graphml.IParseEvents} - */ - parseEvents:yfiles.graphml.IParseEvents; - /** - * Gets the currently active graph object - * @abstract - * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - } - var IParseContext:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graphml.IParseContext; - }; - /** - * The interface of the event trigger class that is used by the {@link yfiles.graphml.IParseContext#parseEvents} property. - *

- * This interface defines the available events that client code can register to during the parsing of {@link yfiles.graphml.GraphMLParser GraphML}. - *

- * @see yfiles.graphml.ParseEventArgs - * @see yfiles.graphml.GraphMLParser - * @interface - */ - export interface IParseEvents extends yfiles.lang.Object{ - /** - * Adds the given listener for the DocumentParsing event that occurs when the document is about to be parsed. - *

- * This event is triggered when the document element has been encountered. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IParseEvents#removeDocumentParsingListener - * @abstract - */ - addDocumentParsingListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Removes the given listener for the DocumentParsing event that occurs when the document is about to be parsed. - *

- * This event is triggered when the document element has been encountered. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IParseEvents#addDocumentParsingListener - * @abstract - */ - removeDocumentParsingListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Adds the given listener for the DocumentParsed event that occurs when the document has been parsed. - *

- * This event is triggered when the document has been fully parsed. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IParseEvents#removeDocumentParsedListener - * @abstract - */ - addDocumentParsedListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Removes the given listener for the DocumentParsed event that occurs when the document has been parsed. - *

- * This event is triggered when the document has been fully parsed. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IParseEvents#addDocumentParsedListener - * @abstract - */ - removeDocumentParsedListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Adds the given listener for the NodeParsing event that occurs when a node element is about to be parsed. - *

- * This event is triggered when a GraphML 'node' element has been encountered. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IParseEvents#removeNodeParsingListener - * @abstract - */ - addNodeParsingListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Removes the given listener for the NodeParsing event that occurs when a node element is about to be parsed. - *

- * This event is triggered when a GraphML 'node' element has been encountered. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IParseEvents#addNodeParsingListener - * @abstract - */ - removeNodeParsingListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Adds the given listener for the NodeParsed event that occurs after a node element has been fully parsed. - *

- * This event is triggered when a GraphML 'node' closing tag has been handled. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IParseEvents#removeNodeParsedListener - * @abstract - */ - addNodeParsedListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Removes the given listener for the NodeParsed event that occurs after a node element has been fully parsed. - *

- * This event is triggered when a GraphML 'node' closing tag has been handled. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IParseEvents#addNodeParsedListener - * @abstract - */ - removeNodeParsedListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Adds the given listener for the EdgeParsing event that occurs when an edge element is about to be parsed. - *

- * This event is triggered when a GraphML 'edge' element has been encountered. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IParseEvents#removeEdgeParsingListener - * @abstract - */ - addEdgeParsingListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Removes the given listener for the EdgeParsing event that occurs when an edge element is about to be parsed. - *

- * This event is triggered when a GraphML 'edge' element has been encountered. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IParseEvents#addEdgeParsingListener - * @abstract - */ - removeEdgeParsingListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Adds the given listener for the EdgeParsed event that occurs after a edge element has been fully parsed. - *

- * This event is triggered when a GraphML 'edge' closing tag has been handled. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IParseEvents#removeEdgeParsedListener - * @abstract - */ - addEdgeParsedListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Removes the given listener for the EdgeParsed event that occurs after a edge element has been fully parsed. - *

- * This event is triggered when a GraphML 'edge' closing tag has been handled. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IParseEvents#addEdgeParsedListener - * @abstract - */ - removeEdgeParsedListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Adds the given listener for the PortParsing event that occurs when a port element is about to be parsed. - *

- * This event is triggered when a GraphML 'port' element has been encountered. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IParseEvents#removePortParsingListener - * @abstract - */ - addPortParsingListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Removes the given listener for the PortParsing event that occurs when a port element is about to be parsed. - *

- * This event is triggered when a GraphML 'port' element has been encountered. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IParseEvents#addPortParsingListener - * @abstract - */ - removePortParsingListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Adds the given listener for the PortParsed event that occurs after a port element has been fully parsed. - *

- * This event is triggered when a GraphML 'port' closing tag has been handled. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IParseEvents#removePortParsedListener - * @abstract - */ - addPortParsedListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Removes the given listener for the PortParsed event that occurs after a port element has been fully parsed. - *

- * This event is triggered when a GraphML 'port' closing tag has been handled. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IParseEvents#addPortParsedListener - * @abstract - */ - removePortParsedListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Adds the given listener for the GraphParsing event that occurs when a graph element is about to be parsed. - *

- * This event is triggered when a GraphML 'graph' element has been encountered. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IParseEvents#removeGraphParsingListener - * @abstract - */ - addGraphParsingListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Removes the given listener for the GraphParsing event that occurs when a graph element is about to be parsed. - *

- * This event is triggered when a GraphML 'graph' element has been encountered. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IParseEvents#addGraphParsingListener - * @abstract - */ - removeGraphParsingListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Adds the given listener for the GraphParsed event that occurs after a graph element has been fully parsed. - *

- * This event is triggered when a GraphML 'graph' closing tag has been handled. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IParseEvents#removeGraphParsedListener - * @abstract - */ - addGraphParsedListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Removes the given listener for the GraphParsed event that occurs after a graph element has been fully parsed. - *

- * This event is triggered when a GraphML 'graph' closing tag has been handled. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IParseEvents#addGraphParsedListener - * @abstract - */ - removeGraphParsedListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Adds the given listener for the GraphMLParsing event that occurs when the graphml element is about to be parsed. - *

- * This event is triggered when a GraphML 'graphml' root-element has been encountered. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IParseEvents#removeGraphMLParsingListener - * @abstract - */ - addGraphMLParsingListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Removes the given listener for the GraphMLParsing event that occurs when the graphml element is about to be parsed. - *

- * This event is triggered when a GraphML 'graphml' root-element has been encountered. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IParseEvents#addGraphMLParsingListener - * @abstract - */ - removeGraphMLParsingListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Adds the given listener for the GraphMLParsed event that occurs after the graphml element has been fully parsed. - *

- * This event is triggered when a GraphML 'graphml' closing tag has been handled. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IParseEvents#removeGraphMLParsedListener - * @abstract - */ - addGraphMLParsedListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Removes the given listener for the GraphMLParsed event that occurs after the graphml element has been fully parsed. - *

- * This event is triggered when a GraphML 'graphml' closing tag has been handled. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IParseEvents#addGraphMLParsedListener - * @abstract - */ - removeGraphMLParsedListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Adds the given listener for the DataParsing event that occurs when a data element is about to be parsed. - *

- * This event is triggered when a GraphML 'data' element has been encountered. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IParseEvents#removeDataParsingListener - * @abstract - */ - addDataParsingListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Removes the given listener for the DataParsing event that occurs when a data element is about to be parsed. - *

- * This event is triggered when a GraphML 'data' element has been encountered. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IParseEvents#addDataParsingListener - * @abstract - */ - removeDataParsingListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Adds the given listener for the DataParsed event that occurs after a data element has been fully parsed. - *

- * This event is triggered when a GraphML 'data' element has been handled. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IParseEvents#removeDataParsedListener - * @abstract - */ - addDataParsedListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Removes the given listener for the DataParsed event that occurs after a data element has been fully parsed. - *

- * This event is triggered when a GraphML 'data' element has been handled. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IParseEvents#addDataParsedListener - * @abstract - */ - removeDataParsedListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Adds the given listener for the KeyParsing event that occurs when a key element is about to be parsed. - *

- * This event is triggered when a GraphML 'key' element has been encountered. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IParseEvents#removeKeyParsingListener - * @abstract - */ - addKeyParsingListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Removes the given listener for the KeyParsing event that occurs when a key element is about to be parsed. - *

- * This event is triggered when a GraphML 'key' element has been encountered. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IParseEvents#addKeyParsingListener - * @abstract - */ - removeKeyParsingListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Adds the given listener for the KeyParsed event that occurs after a key element has been fully parsed. - *

- * This event is triggered when a GraphML 'key' element has been handled. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IParseEvents#removeKeyParsedListener - * @abstract - */ - addKeyParsedListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Removes the given listener for the KeyParsed event that occurs after a key element has been fully parsed. - *

- * This event is triggered when a GraphML 'key' element has been handled. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IParseEvents#addKeyParsedListener - * @abstract - */ - removeKeyParsedListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - } - var IParseEvents:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graphml.IParseEvents; - }; - /** - * This is the event argument that is used by the {@link yfiles.graphml.IParseEvents} interface that can be queried from the {@link yfiles.graphml.IParseContext#parseEvents} - * property. - *

- * This class holds a reference to the {@link yfiles.graphml.ParseEventArgs#context parse context} and the {@link yfiles.graphml.ParseEventArgs#element} that is currently being parsed. - *

- * @class - * @extends {yfiles.lang.EventArgs} - */ - export interface ParseEventArgs extends yfiles.lang.EventArgs{} - export class ParseEventArgs { - /** - * Initializes a new instance of the {@link yfiles.graphml.ParseEventArgs} class. - * @param context The context to assign to {@link #context}. - * @param element The XML element to assign to {@link #element}. - */ - constructor(context:yfiles.graphml.IParseContext,element:Element); - /** - * Gets the context that is being used for parsing. - * @type {yfiles.graphml.IParseContext} - */ - context:yfiles.graphml.IParseContext; - /** - * Gets the XML element that is currently parsed. - * @type {Element} - */ - element:Element; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.ParseEventArgs; - } - /** - * A data holder for use in the {@link yfiles.graphml.IOutputHandler} interface that encapsulates an XML attribute. - * @class - */ - export interface GraphMLXmlAttribute extends yfiles.lang.Object{} - export class GraphMLXmlAttribute { - /** - * Initializes a new instance of the {@link yfiles.graphml.GraphMLXmlAttribute} class. - * @param name The attribute name. - * @param value The value. - */ - constructor(name:yfiles.graphml.XmlName,value:string); - /** - * Gets the fully qualified name of the attribute. - * @type {yfiles.graphml.XmlName} - */ - name:yfiles.graphml.XmlName; - /** - * Gets the value of the attribute. - * @type {string} - */ - value:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.GraphMLXmlAttribute; - } - /** - * The interface used by the {@link yfiles.graphml.GraphMLIOHandler} for writing data to the GraphML. - * @interface - */ - export interface IOutputHandler extends yfiles.lang.Object{ - /** - * Determines whether in the current context, the value is the default value and therefore no data element needs to be - * written. - * @param context The context. - * @returns true if for the current context the default value applies and therefore no data element needs to be written. - * @abstract - */ - isDefaultValue(context:yfiles.graphml.IWriteContext):boolean; - /** - * Writes the contents of the key definition. - *

- * At the time this method is called, the surrounding 'key' element has already been written. However no 'default' element - * is written by the framework. - *

- * @param context The context. - * @abstract - */ - writeKeyDefinitionContent(context:yfiles.graphml.IWriteContext):void; - /** - * Actually writes the value for the current context. - *

- * At the time this method is called, the surrounding 'data' element has already been written. - *

- * @param context The context. - * @abstract - */ - writeValue(context:yfiles.graphml.IWriteContext):void; - /** - * Gets the write precedence that is associated with this instance. - *

- * Registered output handlers are written either before or after the (optional) child content of the governing GraphML - * element. - *

- * @see yfiles.graphml.WritePrecedence - * @abstract - * @type {yfiles.graphml.WritePrecedence} - */ - precedence:yfiles.graphml.WritePrecedence; - /** - * Gets the XML attributes that should be added to the key definition in the GraphML key element. - * @abstract - * @type {yfiles.collections.IEnumerable.} - */ - keyDefinitionAttributes:yfiles.collections.IEnumerable; - /** - * Gets the XML attributes that should be added to the data element. - * @abstract - * @type {yfiles.collections.IEnumerable.} - */ - dataTagAttributes:yfiles.collections.IEnumerable; - } - var IOutputHandler:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graphml.IOutputHandler; - }; - export enum WritePrecedence{ - /** - * The handler writes its content before the child nodes of the governing GraphML element. - */ - BEFORE_CHILDREN, - /** - * Default precedence, the order in relation to child content is unspecified. - */ - DEFAULT, - /** - * The handler writes its content after the child nodes of the governing GraphML element. - */ - AFTER_CHILDREN - } - /** - * Interface that provides the context of a GraphML write process. - *

- * All state data that is needed for the writing of a concrete graph instance should go here, allowing all handlers and - * deserializers to be implemented stateless. - *

- * @interface - * @implements {yfiles.graph.ILookup} - */ - export interface IWriteContext extends yfiles.lang.Object,yfiles.graph.ILookup{ - /** - * Returns the most current (the last element) within the container hierarchy as it is returned by {@link yfiles.graphml.IWriteContext#objectStack} or default(T) if the - * most current element is not of the desired target type. - * Type parameter T: The desired target type. - * @param itemType The desired target type. - * @returns the most current element within the container hierarchy or default(T). - * @template T - * @abstract - */ - getCurrent(itemType:yfiles.lang.Class):T; - /** - * Get a property value that specifies information about how to handle specific cases - * @param key The identifier for the property - * @returns The property value, or null if no such property exists - * @abstract - */ - getSerializationProperty(key:string):any; - /** - * Serializes the specified item using the provided type information. - *

- * item should be assignable to type t. This method simply delegates to - * {@link yfiles.graphml.IWriteContext#serializeCore}, using the correct type parameter. - *

- * @param item The item to serialize. - * @param t The type the item is known to be of at deserialization time. - */ - serialize?(item:any,t:yfiles.lang.Class):void; - /** - * Serialize the item. - *

- * This method calls {@link yfiles.graphml.IWriteContext#serializeCore} with context as first argument and should be used in - * virtually all cases. - *

- * Type parameter T: The type of the object that is serialized. - * @param targetType The type of the object that is serialized. - * @param item The object that should be serialized. - * @throws {yfiles.graphml.SerializationNotSupportedError} - * @see yfiles.graphml.IWriteContext#serializeCore - * @template T - */ - serialize?(targetType:yfiles.lang.Class,item:T):void; - /** - * Serialize item to an XML representation. - *

- * Client code should usually use the extension method {@link yfiles.graphml.IWriteContext#serialize} instead to ensure the the - * correct context instance is used. - *

- * Type parameter T: The type of the object that is serialized. - * @param targetType The type of the object that is serialized. - * @param context The current write context. - * @param item The object that should be serialized. - * @throws {yfiles.graphml.SerializationNotSupportedError} - * @see yfiles.graphml.IWriteContext#serialize - * @template T - * @abstract - */ - serializeCore(targetType:yfiles.lang.Class,context:yfiles.graphml.IWriteContext,item:T):void; - /** - * Serialize an replacement object replacement instead of the original originalItem. - *

- * Calling this method allows to remember the original object instance, even if the object is really written through a {@link yfiles.graphml.MarkupExtension} - * or similar replacement mechanisms. - *

- * Type parameter T: The type of the object that is serialized. - * @param originalItem The original object that should be serialized. - * @param replacement The replacement object that will actually be serialized instead. - * @throws {yfiles.graphml.SerializationNotSupportedError} - * @see yfiles.graphml.IWriteContext#serializeCore - * @template T - */ - serializeReplacement?(targetType:yfiles.lang.Class,originalItem:any,replacement:T):void; - /** - * Gets the current nesting of graphs and graph elements. - *

- * The list contains the user objects which correspond to the GraphML elements. - *

- * @abstract - * @type {yfiles.collections.IListEnumerable.} - */ - objectStack:yfiles.collections.IListEnumerable; - /** - * Gets an implementation of {@link yfiles.graphml.IWriteEvents} that allows to subscribe to various events in the write process. - * @abstract - * @type {yfiles.graphml.IWriteEvents} - */ - writeEvents:yfiles.graphml.IWriteEvents; - /** - * Gets the current {@link yfiles.graphml.IXmlWriter} implementation. - * @abstract - * @type {yfiles.graphml.IXmlWriter} - */ - writer:yfiles.graphml.IXmlWriter; - /** - * Gets the currently active graph object - * @abstract - * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - } - var IWriteContext:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graphml.IWriteContext; - }; - /** - * The interface of the event trigger class that is used by the {@link yfiles.graphml.IWriteContext#writeEvents} property. - *

- * This interface defines the available events that client code can register to during the writing of {@link yfiles.graphml.GraphMLWriter GraphML}. - *

- * @see yfiles.graphml.WriteEventArgs - * @see yfiles.graphml.GraphMLWriter - * @interface - */ - export interface IWriteEvents extends yfiles.lang.Object{ - /** - * Adds the given listener for the DocumentWriting event that occurs just after the {@link yfiles.graphml.IXmlWriter#writeStartDocument} - * has been called. - * @param listener The listener to add. - * @see yfiles.graphml.IWriteEvents#removeDocumentWritingListener - * @abstract - */ - addDocumentWritingListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Removes the given listener for the DocumentWriting event that occurs just after the {@link yfiles.graphml.IXmlWriter#writeStartDocument} - * has been called. - * @param listener The listener to remove. - * @see yfiles.graphml.IWriteEvents#addDocumentWritingListener - * @abstract - */ - removeDocumentWritingListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Adds the given listener for the DocumentWritten event that occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndDocument} - * will be called. - * @param listener The listener to add. - * @see yfiles.graphml.IWriteEvents#removeDocumentWrittenListener - * @abstract - */ - addDocumentWrittenListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Removes the given listener for the DocumentWritten event that occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndDocument} - * will be called. - * @param listener The listener to remove. - * @see yfiles.graphml.IWriteEvents#addDocumentWrittenListener - * @abstract - */ - removeDocumentWrittenListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Adds the given listener for the NodeWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} - * method for writing a GraphMl 'node' element has been called. - *

- * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the - * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} - *

- * @param listener The listener to add. - * @see yfiles.graphml.IWriteEvents#removeNodeWritingListener - * @abstract - */ - addNodeWritingListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Removes the given listener for the NodeWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} - * method for writing a GraphMl 'node' element has been called. - *

- * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the - * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IWriteEvents#addNodeWritingListener - * @abstract - */ - removeNodeWritingListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Adds the given listener for the NodeWritten event that occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} - * for the GraphML 'node' element will be called. - *

- * This can be used to append more custom elements to the node element. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IWriteEvents#removeNodeWrittenListener - * @abstract - */ - addNodeWrittenListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Removes the given listener for the NodeWritten event that occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} - * for the GraphML 'node' element will be called. - *

- * This can be used to append more custom elements to the node element. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IWriteEvents#addNodeWrittenListener - * @abstract - */ - removeNodeWrittenListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Adds the given listener for the EdgeWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} - * method for writing a GraphMl 'edge' element has been called. - *

- * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the - * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} - *

- * @param listener The listener to add. - * @see yfiles.graphml.IWriteEvents#removeEdgeWritingListener - * @abstract - */ - addEdgeWritingListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Removes the given listener for the EdgeWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} - * method for writing a GraphMl 'edge' element has been called. - *

- * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the - * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IWriteEvents#addEdgeWritingListener - * @abstract - */ - removeEdgeWritingListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Adds the given listener for the EdgeWritten event that occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} - * for the GraphML 'edge' element will be called. - *

- * This can be used to append more custom elements to the edge element. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IWriteEvents#removeEdgeWrittenListener - * @abstract - */ - addEdgeWrittenListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Removes the given listener for the EdgeWritten event that occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} - * for the GraphML 'edge' element will be called. - *

- * This can be used to append more custom elements to the edge element. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IWriteEvents#addEdgeWrittenListener - * @abstract - */ - removeEdgeWrittenListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Adds the given listener for the PortWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} - * method for writing a GraphMl 'port' element has been called. - *

- * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the - * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} - *

- * @param listener The listener to add. - * @see yfiles.graphml.IWriteEvents#removePortWritingListener - * @abstract - */ - addPortWritingListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Removes the given listener for the PortWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} - * method for writing a GraphMl 'port' element has been called. - *

- * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the - * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IWriteEvents#addPortWritingListener - * @abstract - */ - removePortWritingListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Adds the given listener for the PortWritten event that occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} - * for the GraphML 'port' element will be called. - *

- * This can be used to append more custom elements to the port element. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IWriteEvents#removePortWrittenListener - * @abstract - */ - addPortWrittenListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Removes the given listener for the PortWritten event that occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} - * for the GraphML 'port' element will be called. - *

- * This can be used to append more custom elements to the port element. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IWriteEvents#addPortWrittenListener - * @abstract - */ - removePortWrittenListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Adds the given listener for the GraphWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} - * method for writing a GraphMl 'graph' element has been called. - *

- * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the - * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} - *

- * @param listener The listener to add. - * @see yfiles.graphml.IWriteEvents#removeGraphWritingListener - * @abstract - */ - addGraphWritingListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Removes the given listener for the GraphWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} - * method for writing a GraphMl 'graph' element has been called. - *

- * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the - * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IWriteEvents#addGraphWritingListener - * @abstract - */ - removeGraphWritingListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Adds the given listener for the GraphWritten event that occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} - * for the GraphML 'graph' element will be called. - *

- * This can be used to append more custom elements to the graph element. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IWriteEvents#removeGraphWrittenListener - * @abstract - */ - addGraphWrittenListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Removes the given listener for the GraphWritten event that occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} - * for the GraphML 'graph' element will be called. - *

- * This can be used to append more custom elements to the graph element. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IWriteEvents#addGraphWrittenListener - * @abstract - */ - removeGraphWrittenListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Adds the given listener for the GraphMLWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} - * method for writing a GraphMl 'graphml' element has been called. - *

- * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the - * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} - *

- * @param listener The listener to add. - * @see yfiles.graphml.IWriteEvents#removeGraphMLWritingListener - * @abstract - */ - addGraphMLWritingListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Removes the given listener for the GraphMLWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} - * method for writing a GraphMl 'graphml' element has been called. - *

- * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the - * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IWriteEvents#addGraphMLWritingListener - * @abstract - */ - removeGraphMLWritingListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Adds the given listener for the GraphMLWritten event that occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} - * for the GraphML 'graphml' element will be called. - *

- * This can be used to append more custom elements to the graphml element. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IWriteEvents#removeGraphMLWrittenListener - * @abstract - */ - addGraphMLWrittenListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Removes the given listener for the GraphMLWritten event that occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} - * for the GraphML 'graphml' element will be called. - *

- * This can be used to append more custom elements to the graphml element. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IWriteEvents#addGraphMLWrittenListener - * @abstract - */ - removeGraphMLWrittenListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Adds the given listener for the DataWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} - * method for writing a GraphMl 'data' element has been called. - *

- * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the - * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} - *

- * @param listener The listener to add. - * @see yfiles.graphml.IWriteEvents#removeDataWritingListener - * @abstract - */ - addDataWritingListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Removes the given listener for the DataWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} - * method for writing a GraphMl 'data' element has been called. - *

- * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the - * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IWriteEvents#addDataWritingListener - * @abstract - */ - removeDataWritingListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Adds the given listener for the DataWritten event that occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} - * for the GraphML 'data' element will be called. - *

- * This can be used to append more custom elements to the data element. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IWriteEvents#removeDataWrittenListener - * @abstract - */ - addDataWrittenListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Removes the given listener for the DataWritten event that occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} - * for the GraphML 'data' element will be called. - *

- * This can be used to append more custom elements to the data element. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IWriteEvents#addDataWrittenListener - * @abstract - */ - removeDataWrittenListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Adds the given listener for the KeyWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} - * method for writing a GraphMl 'key' element has been called. - *

- * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the - * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} - *

- * @param listener The listener to add. - * @see yfiles.graphml.IWriteEvents#removeKeyWritingListener - * @abstract - */ - addKeyWritingListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Removes the given listener for the KeyWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} - * method for writing a GraphMl 'key' element has been called. - *

- * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the - * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IWriteEvents#addKeyWritingListener - * @abstract - */ - removeKeyWritingListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Adds the given listener for the KeyWritten event that occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} - * for the GraphML 'key' element will be called. - *

- * This can be used to append more custom elements to the key element. - *

- * @param listener The listener to add. - * @see yfiles.graphml.IWriteEvents#removeKeyWrittenListener - * @abstract - */ - addKeyWrittenListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Removes the given listener for the KeyWritten event that occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} - * for the GraphML 'key' element will be called. - *

- * This can be used to append more custom elements to the key element. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.IWriteEvents#addKeyWrittenListener - * @abstract - */ - removeKeyWrittenListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - } - var IWriteEvents:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graphml.IWriteEvents; - }; - /** - * Abstraction of XML output classes that provide a consistent way to write XML elements to some output - * @interface - */ - export interface IXmlWriter extends yfiles.lang.Object{ - /** - * Close the document. - *

- * This is typically used to actually flush the document to an output stream - *

- * @abstract - */ - flushDocument():void; - /** - * Gets a text representation of all content that has been written so far. - * @returns - * @abstract - */ - getXmlString():string; - /** - * Write an XML attribute with the given parameters. - *

- * The attribute is not bound to a XML namespace. - *

- * @param localName The name of the attribute. - * @param value The value of the attribute. - * @returns The writer instance writer for writer chaining. - */ - writeAttribute?(localName:string,value:string):yfiles.graphml.IXmlWriter; - /** - * Write a XML attribute node. - *

- * The attribute is attached to the closest open XML element that has been started with {@link yfiles.graphml.IXmlWriter#writeStartElement} - * or {@link yfiles.graphml.IXmlWriter#writeStartElement}. Note that namespace declarations should not be written directly as - * attributes. Instead the {@link yfiles.graphml.IXmlWriter#namespaceManager} should be used. - *

- * @param prefix The namespace prefix of the attribute - * @param localName The local name of the attribute - * @param ns The namespace URI of this attribute - * @param value The value of this attribute - * @returns The writer instance for further chaining - * @abstract - */ - writeAttributeNS(prefix:string,localName:string,ns:string,value:string):yfiles.graphml.IXmlWriter; - /** - * Write a CDATA section. - * @param content The content of the CDATA section - * @returns The writer instance for further chaining - * @abstract - */ - writeCData(content:string):yfiles.graphml.IXmlWriter; - /** - * Write a XML comment node - * @param comment The content of the comment - * @returns The writer instance for further chaining - * @abstract - */ - writeComment(comment:string):yfiles.graphml.IXmlWriter; - /** - * Write a document fragment - * @param fragment - * @returns The writer instance for further chaining - * @abstract - */ - writeDocumentFragment(fragment:Document):yfiles.graphml.IXmlWriter; - /** - * Close the output. - *

- * Attempts to write after this method has been called will have undefined results. - *

- * @abstract - */ - writeEndDocument():void; - /** - * Close a XML element previously opened with {@link yfiles.graphml.IXmlWriter#writeStartElement} or - * {@link yfiles.graphml.IXmlWriter#writeStartElement}. - * @returns The writer instance for further chaining - * @abstract - */ - writeEndElement():yfiles.graphml.IXmlWriter; - /** - * Write an XML attribute from the given attribute struct. - * @param attribute Encapsulates the current attribute values. - * @returns The writer instance writer for writer chaining. - */ - writeGraphMLXmlAttribute?(attribute:yfiles.graphml.GraphMLXmlAttribute):yfiles.graphml.IXmlWriter; - /** - * Write a xml processing instruction. - * @param target The target of the PI - * @param data The data of the PI - * @returns The writer instance for further chaining - * @abstract - */ - writeProcessingInstruction(target:string,data:string):yfiles.graphml.IXmlWriter; - /** - * Begin the output process - * @returns The writer instance for further chaining - * @abstract - */ - writeStartDocument():yfiles.graphml.IXmlWriter; - /** - * Begin a new XML element with given parameters - *

- * All subsequent output is attached to this element until {@link yfiles.graphml.IXmlWriter#writeEndElement} has been called or a - * new element has been started. - *

- * @param prefix The namespace prefix to use for this element - * @param localName The local name of this element - * @param ns The namespace of this element - * @returns The writer instance for further chaining - * @abstract - */ - writeStartElement(prefix:string,localName:string,ns:string):yfiles.graphml.IXmlWriter; - /** - * Begin a new XML element with given parameters - *

- * All subsequent output is attached to this element until {@link yfiles.graphml.IXmlWriter#writeEndElement} has been called or a - * new element has been started. - *

- *

- * This acts like {@link yfiles.graphml.IXmlWriter#writeStartElement}, but uses the default prefix for the namespace - *

- * @param localName The local name of this element - * @param ns The namespace of this element - * @returns The writer instance for further chaining - * @abstract - */ - writeStartElement(localName:string,ns:string):yfiles.graphml.IXmlWriter; - /** - * Write a text node. - *

- * The string value of s will be correctly escaped - *

- * @param s The string that gets written as XML text - * @returns The writer instance for further chaining - * @abstract - */ - writeString(s:string):yfiles.graphml.IXmlWriter; - /** - * Gets the namespace manager associated with this writer. - * @abstract - * @type {yfiles.graphml.IXmlNamespaceManager} - */ - namespaceManager:yfiles.graphml.IXmlNamespaceManager; - } - var IXmlWriter:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graphml.IXmlWriter; - }; - /** - * Helper class to facilitate namespace handling together with {@link yfiles.graphml.IXmlWriter} instances. - * @interface - */ - export interface IXmlNamespaceManager extends yfiles.lang.Object{ - /** - * Returns a unique namespace prefix, or creates and registeres one. - * @param ns The namespace URI for which a prefix is searched. - * @returns a unique namespace prefix for ns. - * @abstract - */ - getOrCreateUniqueMapping(ns:string):string; - /** - * Pops a current declaration scope. - * @abstract - */ - popScope():void; - /** - * Pushes a current declaration scope. - * @abstract - */ - pushScope():void; - /** - * Register a local namespace/prefix mapping - * @param nsUri The namespace URI - * @param prefix The preferred namespace prefix or null if any prefix may be used. - * @returns The prefix that finally has been used for the namespace URI. - * @abstract - */ - registerLocalMapping(nsUri:string,prefix:string):string; - /** - * Seals the current declaration scope. - *

- * No further namespace mappings may be added to a sealed scope. - *

- * @abstract - */ - sealScope():void; - /** - * Gets a list of all namespace declarations that should be declared at the document's root element. - * @abstract - * @type {yfiles.collections.IMap.} - */ - globalNamespaces:yfiles.collections.IMap; - } - var IXmlNamespaceManager:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graphml.IXmlNamespaceManager; - }; - /** - * Constant class for common serialization properties. - * @see yfiles.graphml.IWriteContext#getSerializationProperty - * @class - * @static - */ - export interface SerializationProperties extends yfiles.lang.Object{} - export class SerializationProperties { - /** - * Property key to control user tag serialization and deserialization - *

- * This property has a value of type {@link yfiles.graph.GraphItemTypes}. - *

- *

- * Setting this property as a {@link yfiles.graphml.GraphMLIOHandler#serializationPropertyOverrides serialization property} disables tag serialization for all of the provided - * {@link yfiles.graph.GraphItemTypes}. Setting this property as a {@link yfiles.graphml.GraphMLIOHandler#deserializationPropertyOverrides deserialization property} disables tag deserialization only for - * nodes, edges and/or ports. By default, this property is set to {@link yfiles.graph.GraphItemTypes#NONE} - *

- * @const - * @static - * @type {string} - */ - static DISABLE_USER_TAGS:string; - /** - * Property key to control graph element style serialization and deserialization - *

- * This property has a value of type {@link yfiles.graph.GraphItemTypes}. - *

- *

- * Setting this property as a {@link yfiles.graphml.GraphMLIOHandler#serializationPropertyOverrides serialization property} disables style serialization for all of the provided - * {@link yfiles.graph.GraphItemTypes}. Setting this property as a {@link yfiles.graphml.GraphMLIOHandler#deserializationPropertyOverrides deserialization property} disables style deserialization only for - * nodes, edges and/or ports. By default, this property is set to {@link yfiles.graph.GraphItemTypes#NONE} - *

- * @const - * @static - * @type {string} - */ - static DISABLE_STYLES:string; - /** - * Property key to control graph elements serialization and deserialization - *

- * This property has a value of type {@link yfiles.graph.GraphItemTypes}. - *

- *

- * Setting this property disables serialization and deserialization for the provided {@link yfiles.graph.GraphItemTypes}. By - * default, this property is set to {@link yfiles.graph.GraphItemTypes#NONE}. - *

- * @const - * @static - * @type {string} - */ - static DISABLE_ITEMS:string; - /** - * Property key to control graph element geometry serialization and deserialization - *

- * This property has a value of type {@link yfiles.graph.GraphItemTypes}. - *

- *

- * Setting this property as a {@link yfiles.graphml.GraphMLIOHandler#serializationPropertyOverrides serialization property} disables style serialization for all of the provided - * {@link yfiles.graph.GraphItemTypes}. Setting this property as a {@link yfiles.graphml.GraphMLIOHandler#deserializationPropertyOverrides deserialization property} disables style deserialization only for - * nodes, edges and/or ports. By default, this property is set to {@link yfiles.graph.GraphItemTypes#NONE}. - *

- * @const - * @static - * @type {string} - */ - static DISABLE_GEOMETRY:string; - /** - * Property key to control user tag serialization and deserialization of {@link yfiles.graph.IStripe}s. - *

- * This property has a value of type {@link yfiles.graph.StripeTypes}. - *

- *

- * Setting this property disables tag serialization for the provided {@link yfiles.graph.StripeTypes}. By default, this property is - * set to {@link yfiles.graph.StripeTypes#NONE}. - *

- * @const - * @static - * @type {string} - */ - static DISABLE_STRIPE_USER_TAGS:string; - /** - * Property key to control style serialization and deserialization of {@link yfiles.graph.IStripe}s. - *

- * This property has a value of type {@link yfiles.graph.StripeTypes}. - *

- *

- * Setting this property disables style serialization for the provided {@link yfiles.graph.StripeTypes}. By default, this property - * is set to {@link yfiles.graph.StripeTypes#NONE}. - *

- * @const - * @static - * @type {string} - */ - static DISABLE_STRIPE_STYLES:string; - /** - * Property key to control label serialization of {@link yfiles.graph.IStripe}s. - *

- * This property has a value of type {@link yfiles.graph.StripeTypes}. - *

- *

- * Setting this property disables label serialization for the provided {@link yfiles.graph.StripeTypes}. By default, this property - * is set to {@link yfiles.graph.StripeTypes#NONE}. - *

- * @const - * @static - * @type {string} - */ - static DISABLE_STRIPE_LABELS:string; - /** - * Property key to omit serialization and deserialization of the {@link yfiles.graph.IGraph}'s default settings. - *

- * This property has a boolean value. - *

- *

- * If this property is set to true in {@link yfiles.graphml.GraphMLIOHandler#serializationPropertyOverrides} or the write context, the current graph defaults are not written. - *

- *

- * If this property is set to true in {@link yfiles.graphml.GraphMLIOHandler#deserializationPropertyOverrides} or the parse context, any graph defaults present in the input are not parsed and - * applied to the current graph. - *

- *

- * Default for this property is true for writing and false for parsing. - *

- * @const - * @static - * @type {string} - */ - static DISABLE_GRAPH_SETTINGS:string; - /** - * Property key for alllowing to parse member names (properties and enum values) case-insensitively during XAML - * deserialization. - *

- * This will convert property and member names to lower-case and remove underscores to be able to compare things like SOME_CONSTANT_NAME - * and SomeConstantName as well as somePropertyName and SomePropertyName, respectively. - *

- *

- * This property has a boolean value. - *

- *

- * Default for this property is false. - *

- * @const - * @static - * @type {string} - */ - static IGNORE_PROPERTY_CASE:string; - /** - * Property key to control how undefined values are serialized. - *

- * This property has a value of type {@link yfiles.graphml.UndefinedHandling}. - *

- *

- * The default for this property is {@link yfiles.graphml.UndefinedHandling#EXPLICIT }. - *

- * @const - * @static - * @type {string} - */ - static UNDEFINED_HANDLING:string; - /** - * Property key whether the XML output should be properly indented. - *

- * This property has a boolean values. - *

- *

- * Default for this property is true - *

- * @const - * @static - * @type {string} - */ - static INDENT_OUTPUT:string; - /** - * The current {@link yfiles.graphml.KeyScope} in which an {@link yfiles.graphml.IOutputHandler}, - * {@link yfiles.graphml.IInputHandler}, or custom serialization code is called. - *

- * This property has a value of type {@link yfiles.graphml.KeyScope} - *

- * @const - * @static - * @type {string} - */ - static CURRENT_KEY_SCOPE:string; - /** - * The edge that is currently being represented by the dummy edge that is written instead. - *

- * This property has a value of type {@link yfiles.graph.IEdge}. - *

- *

- * If this value is set, then the edge currently being serialized represents the given edge in reality. - *

- * @const - * @static - * @type {string} - */ - static REPRESENTED_EDGE:string; - /** - * Property key to specify whether to write the default node style in the <default> element of the key definition. - *

- * This property has a boolean value. - *

- *

- * Default value is false. - *

- * @const - * @static - * @type {string} - */ - static WRITE_NODE_STYLE_DEFAULT:string; - /** - * Property key to specify whether to write the default edge style in the <default> element of the key definition. - *

- * This property has a boolean value. - *

- *

- * Default value is false. - *

- * @const - * @static - * @type {string} - */ - static WRITE_EDGE_STYLE_DEFAULT:string; - /** - * Property key to specify whether to write the default port style in the <default> element of the key definition. - *

- * This property has a boolean value. - *

- *

- * Default value is false. - *

- * @const - * @static - * @type {string} - */ - static WRITE_PORT_STYLE_DEFAULT:string; - /** - * Property key to specify whether the stripe defaults of a table should be written. - *

- * This property has a boolean value. - *

- *

- * If set to true the {@link yfiles.graph.ITable#columnDefaults} and {@link yfiles.graph.ITable#rowDefaults} will be written. Default value is true. - *

- * @const - * @static - * @type {string} - */ - static WRITE_STRIPE_DEFAULTS:string; - /** - * Property key to provide a predicate that determines if the preferred size of a label should be written. - *

- * If this property is not set, the label size is always written. - *

- * @const - * @static - * @type {string} - */ - static WRITE_LABEL_SIZE_PREDICATE:string; - /** - * Property key to specify whether the preferred size of labels should be parsed. - *

- * This property has a boolean value. - *

- *

- * If this property is set to true, the preferred size provided by GraphML is used, otherwise, the preferred size is - * determined automatically. This property is mainly meant for interoperability usecases where the text size calculations - * can be quite different for different platforms. Default value is true - *

- * @const - * @static - * @type {string} - */ - static PARSE_LABEL_SIZE:string; - /** - * The current {@link string} base URI which is used for the GraphML file being parsed or written. - *

- * This property has a string value. - *

- *

- * If set, this can be used to resolve or create relative paths. - *

- * @const - * @static - * @type {string} - */ - static BASE_URI:string; - /** - * Property key to specify whether to rewrite relative URIs relative to the current document location. - *

- * This property has a boolean value. - *

- *

- * If set, relative URIs for images and other resources are rewritten relative to - * {@link yfiles.graphml.SerializationProperties#BASE_URI}. If this property is false, or if {@link yfiles.graphml.SerializationProperties#BASE_URI} - * is not set (either explicitly or implicitly) or the resource URI is not relative, the resource URI will not be - * rewritten. - *

- *

- * Default value is true. - *

- * @const - * @static - * @type {string} - */ - static REWRITE_RELATIVE_RESOURCE_URIS:string; - /** - * Property key to specify whether to ignore errors during XAML deserialization will be ignored and instead return null. - *

- * This property has a boolean value. - *

- *

- * Default value is false. - *

- * @const - * @static - * @type {string} - */ - static IGNORE_XAML_DESERIALIZATION_ERRORS:string; - /** - * Property key to control caching for external references. - *

- * This property has a boolean value. - *

- *

- * If this property is set to false in the write context, the writer will not cache remember external reference ids provided via - * {@link yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener QueryReferenceId}, i.e. the event will be - * raised whenever an instance of the external object is encountered during the write process. This allows to provide - * different values for the same object, depending on the current context. Default for this property is true. - *

- * @const - * @static - * @type {string} - */ - static CACHE_EXTERNAL_REFERENCES:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.SerializationProperties; - } - /** - * This is the event argument that is used by the {@link yfiles.graphml.IWriteEvents} interface that can be queried from the {@link yfiles.graphml.IWriteContext#writeEvents} - * property. - *

- * This class holds a reference to the {@link yfiles.graphml.WriteEventArgs#context write context} and the {@link yfiles.graphml.WriteEventArgs#item} that is currently being written. - *

- * @class - * @extends {yfiles.lang.EventArgs} - */ - export interface WriteEventArgs extends yfiles.lang.EventArgs{} - export class WriteEventArgs { - /** - * Initializes a new instance of the {@link yfiles.graphml.WriteEventArgs} class. - * @param context The context to assign to {@link #context}. - * @param item The item to assign to {@link #item}. - */ - constructor(context:yfiles.graphml.IWriteContext,item:any); - /** - * Gets the context that is being used for writing. - * @type {yfiles.graphml.IWriteContext} - */ - context:yfiles.graphml.IWriteContext; - /** - * Gets the item that is currently being written or null if nothing is applicable. - * @type {any} - */ - item:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.WriteEventArgs; - } - /** - * An interface for converters that can convert an object to a corresponding {@link yfiles.graphml.MarkupExtension}. - *

- * This interface is only used for GraphML serialiaztion. - *

- * @interface - */ - export interface IMarkupExtensionConverter extends yfiles.lang.Object{ - /** - * Returns if the converter can convert the value to a {@link yfiles.graphml.MarkupExtension} in the current write context. - * @param context The current write context. - * @param value The object to convert. - * @returns Whether the converter can convert the passed value. - * @abstract - */ - canConvert(context:yfiles.graphml.IWriteContext,value:any):boolean; - /** - * Converts the value to a {@link yfiles.graphml.MarkupExtension} using the current write context. - * @param context The current write context. - * @param value The object to convert. - * @returns The {@link } the value was converted to. - * @abstract - */ - convert(context:yfiles.graphml.IWriteContext,value:any):yfiles.graphml.MarkupExtension; - } - var IMarkupExtensionConverter:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graphml.IMarkupExtensionConverter; - }; - /** - * Utility class that facilitates determining type information from XML elements and writing of markup extensions as - * attributes. - * @interface - */ - export interface IXamlNameMapper extends yfiles.lang.Object{ - /** - * Returns a {@link yfiles.lang.Class} that matches the given fqTagName of an XML element. - *

- * fqTagName must follow the usual XAML naming rules. - *

- * @param context The current parse context. - * @param fqTagName The fully qualified XML element name that must describe a valid type in this CLR namespace. - * @returns The first matching type, if any. - * @abstract - */ - getClassForName(context:yfiles.graphml.IParseContext,fqTagName:yfiles.graphml.XmlName):yfiles.lang.Class; - /** - * Returns the XML tag name that belongs to type type - * @param context The current write context. - * @param type The type for which an XML namespace mapping is searched. - * @returns the XML tag name that belongs to type type - * @abstract - */ - getNameForClass(context:yfiles.graphml.IWriteContext,type:yfiles.lang.Class):yfiles.graphml.XmlName; - } - var IXamlNameMapper:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graphml.IXamlNameMapper; - }; - /** - * Wraps a property together with default values and meta data. - * @class - */ - export interface Property extends yfiles.lang.Object{} - export class Property { - /** - * Gets the value the wrapped property has on the given instance. - * @param ownerInstance The instance to get the property value from. - * @returns The value the wrapped property has on the given instance. - */ - getValue(ownerInstance:any):any; - /** - * Sets the value to the wrapped property on the given instance. - * @param ownerInstance The instance to set the property value on. - * @param value The value to set. - */ - setValue(ownerInstance:any,value:any):void; - /** - * Gets whether or not the property has a public getter. - * @type {boolean} - */ - canRead:boolean; - /** - * Gets whether or not the property has a public setter. - * @type {boolean} - */ - canWrite:boolean; - /** - * Gets whether or not this is a static property. - * @type {boolean} - */ - isStatic:boolean; - /** - * Gets the serialization visibility. - * @type {yfiles.graphml.GraphMLMemberVisibility} - */ - serializationVisibility:yfiles.graphml.GraphMLMemberVisibility; - /** - * Gets the {@link yfiles.graphml.Property#valueSerializer}. - * @type {yfiles.graphml.ValueSerializer} - */ - valueSerializer:yfiles.graphml.ValueSerializer; - /** - * Gets the MarkupExtensionConverter. - * @type {yfiles.graphml.IMarkupExtensionConverter} - */ - markupExtensionConverter:yfiles.graphml.IMarkupExtensionConverter; - /** - * Gets the {@link yfiles.graphml.Property#graphMLAttribute}. - * @type {yfiles.graphml.GraphMLAttribute} - */ - graphMLAttribute:yfiles.graphml.GraphMLAttribute; - /** - * Gets a value indicating whether this instance is the one defined in the {@link yfiles.graphml.GraphMLAttribute}'s {@link yfiles.graphml.GraphMLAttribute#contentProperty}. - * @type {boolean} - */ - isContentProperty:boolean; - /** - * Gets the type of the property. - * @type {yfiles.lang.Class} - */ - type:yfiles.lang.Class; - /** - * Gets the type of the owner. - * @type {yfiles.lang.Class} - */ - ownerType:yfiles.lang.Class; - /** - * Gets the default value. - * @type {any} - */ - defaultValue:any; - /** - * Gets a value indicating whether this instance has a default value. - * @type {boolean} - */ - hasDefaultValue:boolean; - /** - * Gets the name of the property, as it will appear in GraphML. - * @type {string} - */ - name:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.Property; - } - export enum SliderParameterLocation{ - /** - * Left of the edge. - */ - LEFT, - /** - * Right of the edge. - */ - RIGHT, - /** - * Measured from the source end. - */ - FROM_SOURCE, - /** - * Measured from the target end. - */ - FROM_TARGET, - /** - * "Center" segment. - */ - CENTER - } - /** - * Support interface used by {@link yfiles.graphml.ValueSerializer}. - * @interface - * @implements {yfiles.graph.ILookup} - */ - export interface IValueSerializerContext extends yfiles.lang.Object,yfiles.graph.ILookup{ - /** - * Gets the value serializer for a specific {@link yfiles.graphml.Property}. - * @param property The descriptor of the property. - * @returns A serializer or null. - * @abstract - */ - getValueSerializerFor(property:yfiles.graphml.Property):yfiles.graphml.ValueSerializer; - /** - * Gets the value serializer for a specific type. - * @param type The type to obtain a serializer for. - * @returns A serializer or null. - * @abstract - */ - getValueSerializerFor(type:yfiles.lang.Class):yfiles.graphml.ValueSerializer; - } - var IValueSerializerContext:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graphml.IValueSerializerContext; - }; - /** - * Provides a base class for all XAML markup extensions. - *

- * Markup extensions return objects based on string attribute values or markup elements in XAML and/or can be used to - * serialize classes that do not fulfil XAML serialization constraints. - *

- * @class - */ - export interface MarkupExtension extends yfiles.lang.Object{} - export class MarkupExtension { - /** - * Returns an object that is set as the value of the target property for this markup extension. - * @param serviceProvider Object that can provide services for the markup extension. - * @returns The object value to set on the property where the extension is applied. - * @abstract - */ - provideValue(serviceProvider:yfiles.graph.ILookup):any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.MarkupExtension; - } - /** - * Helper classes used during the XAML serialization of instances. - *

- * Using this class instances can be written in xml attributes as strings. - *

- * @class - */ - export interface ValueSerializer extends yfiles.lang.Object{} - export class ValueSerializer { - /** - * Determines whether this instance can convert the specified value from the given string. - * @param value The string value to convert. - * @param context The context. - * @returns true if this instance can convert the specified value from the string; otherwise, false. - */ - canConvertFromString(value:string,context:yfiles.graphml.IValueSerializerContext):boolean; - /** - * Determines whether this instance can convert the specified value to a string. - * @param value The value. - * @param context The context. - * @returns true if this instance can convert the specified value to a string; otherwise, false. - */ - canConvertToString(value:any,context:yfiles.graphml.IValueSerializerContext):boolean; - /** - * Converts the string to an appropriate instance. - * @param value The value to convert to an object. - * @param context The context. - * @returns The converted object - */ - convertFromString(value:string,context:yfiles.graphml.IValueSerializerContext):any; - /** - * Converts the given value to string. - * @param o The value. - * @param context The context. - * @returns The value as string representation. - */ - convertToString(o:any,context:yfiles.graphml.IValueSerializerContext):string; - /** - * Gets the {@link yfiles.graphml.ValueSerializer} implementation for the given type. - * @param type The type. - * @param context The context. - * @returns The serializer to use for the type. - * @static - */ - static getSerializerFor(type:yfiles.lang.Class,context:yfiles.graphml.IValueSerializerContext):yfiles.graphml.ValueSerializer; - /** - * Gets the {@link yfiles.graphml.ValueSerializer} implementation for the given descriptor. - * @param property The descriptor. - * @param context The context. - * @returns The serializer to use for the descriptor. - * @static - */ - static getSerializerFor(property:yfiles.graphml.Property,context:yfiles.graphml.IValueSerializerContext):yfiles.graphml.ValueSerializer; - /** - * Gets the {@link yfiles.graphml.ValueSerializer} implementation for the given descriptor. - * @param property The descriptor. - * @returns The serializer to use for the type. - * @static - */ - static getSerializerFor(property:yfiles.graphml.Property):yfiles.graphml.ValueSerializer; - /** - * Gets the {@link yfiles.graphml.ValueSerializer} implementation for the given type. - * @param type The type. - * @returns The serializer to use for the type. - * @static - */ - static getSerializerFor(type:yfiles.lang.Class):yfiles.graphml.ValueSerializer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.ValueSerializer; - } - /** - * A helper holder class that can contain a {@link yfiles.graphml.Future.#value} of a specific type. - *

- * Typically {@link yfiles.graphml.Future.#hasValue} will be false until at a later point in time {@link yfiles.graphml.Future.#onValueDetermined} is called and the {@link yfiles.graphml.Future.#value} and {@link yfiles.graphml.Future.#hasValue} properties are being - * updated and the {@link yfiles.graphml.Future.#addPropertyChangedListener PropertyChanged} event is triggered. - *

- * Type parameter T: The type of the {@link yfiles.graphml.Future.#value} - * @class - * @implements {yfiles.lang.IPropertyObservable} - * @template T - * @final - */ - export interface Future extends yfiles.lang.Object,yfiles.lang.IPropertyObservable{} - export class Future { - /** - * Called when the {@link yfiles.graphml.Future.#value} property of this future has been determined. - *

- * This will set the {@link yfiles.graphml.Future.#hasValue} property to true and assign the {@link yfiles.graphml.Future.#value} property. Also the corresponding {@link yfiles.graphml.Future.#addPropertyChangedListener PropertyChanged} events - * will be triggered if necessary. - *

- * @param value The value. - */ - onValueDetermined(value:T):void; - /** - * Gets the value of this future, which may only be queried if {@link yfiles.graphml.Future.#hasValue} yields true. - * @throws {Stubs.Exceptions.InvalidOperationError} If this property is queried although {@link yfiles.graphml.Future.#hasValue} returns false. - * @type {T} - */ - value:T; - /** - * Gets a value indicating whether this instance has been {@link yfiles.graphml.Future.#onValueDetermined assigned} a {@link yfiles.graphml.Future.#value}. - * @type {boolean} - */ - hasValue:boolean; - /** - * Adds the given listener for the PropertyChanged event that occurs when a property value changes. - *

- * This event will be triggered for {@link yfiles.graphml.Future.#hasValue} changes and changes of the {@link yfiles.graphml.Future.#value} property. Note that if the determined future value is the - * same as the default, the event will only be triggered for the {@link yfiles.graphml.Future.#hasValue} property. - *

- * @param listener The listener to add. - * @see yfiles.graphml.Future.#removePropertyChangedListener - */ - addPropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the PropertyChanged event that occurs when a property value changes. - *

- * This event will be triggered for {@link yfiles.graphml.Future.#hasValue} changes and changes of the {@link yfiles.graphml.Future.#value} property. Note that if the determined future value is the - * same as the default, the event will only be triggered for the {@link yfiles.graphml.Future.#hasValue} property. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.Future.#addPropertyChangedListener - */ - removePropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.Future; - } - /** - * Class for reading/writing graphs from/to GraphML format. - *

- * For more information about the GraphML file format please refer to the GraphML Primer. - *

- * @class - */ - export interface GraphMLIOHandler extends yfiles.lang.Object{} - export class GraphMLIOHandler { - /** - * Creates a new instance of {@link yfiles.graphml.GraphMLIOHandler}. - */ - constructor(); - /** - * Create a {@link yfiles.graphml.Future.} instance that wraps an {@link yfiles.graphml.IInputHandler} that is dynamically created by factory. - *

- * The return value will only contain a value if a matching GraphML attribute has been read, which can be queried with {@link yfiles.graphml.Future.#hasValue}. - * The validity is determined by keyDefinitionPredicate. This methods creates and configures the necessary handler itself. - *

- * @param keyDefinitionPredicate The predicate that matches the key definition. - * @param factory A factory to create {@link } instances. - * @returns A {@link } instance that wraps an {@link } that actually parses the data. - */ - addInputHandlerFactory(keyDefinitionPredicate:(obj:Element)=>boolean,factory:yfiles.graphml.IGenericInputHandlerFactory):yfiles.graphml.Future; - /** - * Register a {@link yfiles.collections.IMapper.} instance for use as an input data target. - *

- * This method uses a custom event handler for the actual deserialization. - *

- *

- * This methods creates and configures the necessary handler itself. - *

- * Type parameter TKey: The type of the mapper keys - * Type parameter TData: The type of the mapper values - * @param dataType The type of the mapper values - * @param keyType The type of the mapper keys - * @param keyDefinitionPredicate The predicate function that will determine whether to create an {@link } for the given key - * definition. - * @param mapper the mapper that serves as data source - * @param deserializationCallback custom deserialization callback. - * @template TKey,TData - */ - addInputMapper(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,keyDefinitionPredicate:(obj:Element)=>boolean,mapper:yfiles.collections.IMapper,deserializationCallback:(sender:any,evt:yfiles.graphml.HandleDeserializationEventArgs)=>void):void; - /** - * Register a {@link yfiles.collections.IMapper.} instance for use as an input data target. - *

- * This methods creates and configures the necessary handler itself. - *

- * Type parameter TKey: The type of the mapper keys - * Type parameter TData: The type of the mapper values - * @param dataType The type of the mapper values - * @param keyType The type of the mapper keys - * @param name The name of the attribute - * @param mapper the mapper that serves as data source - * @template TKey,TData - */ - addInputMapper(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,name:string,mapper:yfiles.collections.IMapper):void; - /** - * Create a {@link yfiles.graphml.Future.} instance that wraps an {@link yfiles.collections.IMapper.} for use as an input data target. - *

- * The return value will only contain a value if a matching GraphML attribute has been read, which can be queried with {@link yfiles.graphml.Future.#hasValue} - * This methods creates and configures the necessary handler itself. - *

- * Type parameter TKey: The type of the mapper keys - * Type parameter TData: The type of the mapper values - * @param dataType The type of the mapper values - * @param keyType The type of the mapper keys - * @param deserializationCallback custom deserialization callback. - * @param keyDefinitionPredicate The predicate function that will determine whether to create an {@link } for the given key - * definition. - * @returns A {@link } instance that wraps an {@link } that actually holds the data. - * @template TKey,TData - */ - addInputMapperFuture(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,keyDefinitionPredicate:(obj:Element)=>boolean,deserializationCallback:(sender:any,evt:yfiles.graphml.HandleDeserializationEventArgs)=>void):yfiles.graphml.Future>; - /** - * Create a {@link yfiles.graphml.Future.} instance that wraps an {@link yfiles.collections.IMapper.} for use as an input data target. - *

- * The return value will only contain a value if a matching GraphML attribute has been read, which can be queried with {@link yfiles.graphml.Future.#hasValue} - * This methods creates and configures the necessary handler itself. - *

- * Type parameter TKey: The type of the mapper keys - * Type parameter TData: The type of the mapper values - * @param dataType The type of the mapper values - * @param keyType The type of the mapper keys - * @param name The name of the attribute - * @returns A {@link } instance that wraps an {@link } that actually holds the data. - * @template TKey,TData - */ - addInputMapperFuture(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,name:string):yfiles.graphml.Future>; - /** - * Adds a namespace to the header of a GraphML file. - * @param namespaceURI The namespace URI - * @param shortName The namespace prefix - */ - addNamespace(namespaceURI:string,shortName:string):void; - /** - * Register a {@link yfiles.collections.IMapper.} instance for use as an output data source. - *

- * This method uses a custom event handler for the actual serialization. - *

- *

- * This methods creates and configures the necessary handler itself. - *

- * Type parameter TModelItem: The type of the mapper keys - * Type parameter TValue: The type of the mapper values - * @param dataType The type of the mapper values - * @param modelItemType The type of the mapper keys - * @param name The name of the attribute - * @param uri The URI to add to the key definition to disambiguate keys. - * @param mapper the mapper that serves as data source - * @param serializationCallback custom serialization callback. - * @param declaredKeyType The key type to write in the declaration. - * @template TModelItem,TValue - */ - addOutputMapper(modelItemType:yfiles.lang.Class,dataType:yfiles.lang.Class,name:string,uri:string,mapper:yfiles.collections.IMapper,serializationCallback:(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs)=>void,declaredKeyType:yfiles.graphml.KeyType):void; - /** - * Register a {@link yfiles.collections.IMapper.} instance for use as an output data source - *

- * This methods creates and configures the necessary handler itself - *

- * Type parameter TModelItem: The type of the mapper keys - * Type parameter TValue: The type of the mapper values - * @param dataType The type of the mapper values - * @param modelItemType The type of the mapper keys - * @param name The name of the attribute - * @param mapper the mapper that serves as data source - * @template TModelItem,TValue - */ - addOutputMapper(modelItemType:yfiles.lang.Class,dataType:yfiles.lang.Class,name:string,mapper:yfiles.collections.IMapper):void; - /** - * Create a {@link yfiles.graphml.Future.} instance that wraps an {@link yfiles.graphml.IInputHandler} that stores the data in an {@link yfiles.collections.IMapper.} that will be {@link yfiles.graphml.GraphMLIOHandler#createMapper created} in the - * graph's {@link yfiles.graph.IMapperRegistry}. - *

- * The return value will only contain a value if a matching GraphML attribute has been read, which can be queried with {@link yfiles.graphml.Future.#hasValue}. - * This methods creates and configures the necessary handler itself and {@link yfiles.graphml.GraphMLIOHandler#createMapper creates} an {@link yfiles.collections.IMapper.} in the {@link yfiles.graph.IMapperRegistry} - * with name tag. - *

- * Type parameter TKey. - * Type parameter TData. - * @param dataType - * @param keyType - * @param tag The name of the key in the {@link }. - * @param keyDefinitionPredicate A predicate to determine whether the key definition is valid. - * @param deserializationCallback The custom deserialization callback, can be null which will result in default deserialization. - * @returns A {@link } instance that wraps an {@link } that actually holds the data. - * @template TKey,TData - */ - addRegistryInputMapper(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,tag:any,keyDefinitionPredicate:(obj:Element)=>boolean,deserializationCallback:(sender:any,evt:yfiles.graphml.HandleDeserializationEventArgs)=>void):yfiles.graphml.Future>; - /** - * Create a {@link yfiles.graphml.Future.} instance that wraps an {@link yfiles.graphml.IInputHandler} that stores the data in an {@link yfiles.collections.IMapper.} that will be {@link yfiles.graphml.GraphMLIOHandler#createMapper created} in the - * graph's {@link yfiles.graph.IMapperRegistry}. - *

- * The return value will only contain a value if a matching GraphML attribute has been read, which can be queried with {@link yfiles.graphml.Future.#hasValue}. - * The attribute must be registered under the attribute name name. This methods creates and configures the necessary - * handler itself and {@link yfiles.graphml.GraphMLIOHandler#createMapper creates} an {@link yfiles.collections.IMapper.} in the {@link yfiles.graph.IMapperRegistry} with name name. - *

- * Type parameter TKey. - * Type parameter TData. - * @param dataType - * @param keyType - * @param name The name of the GraphML attribute and the key in the {@link }. - * @returns A {@link } instance that wraps an {@link } that actually holds the data. - * @template TKey,TData - */ - addRegistryInputMapper(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,name:string):yfiles.graphml.Future>; - /** - * Use a registered {@link yfiles.collections.IMapper.} instance as source for the given GraphML attribute. - * Type parameter TModelItem. - * Type parameter TValue. - * @param valueType - * @param modelItemType - * @param name The GraphML name of the attribute - * @param uri The URI to add to the key definition to disambiguate keys. - * @param tag The tag name of the mapper in the {@link } - * @param serializationCallback custom serialization callback. - * @param declaredKeyType The key type to write in the declaration. - * @template TModelItem,TValue - */ - addRegistryOutputMapper(modelItemType:yfiles.lang.Class,valueType:yfiles.lang.Class,name:string,uri:string,tag:any,serializationCallback:(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs)=>void,declaredKeyType:yfiles.graphml.KeyType):void; - /** - * Use a registered {@link yfiles.collections.IMapper.} instance as source for the given GraphML attribute. - * Type parameter TModelItem. - * Type parameter TValue. - * @param valueType - * @param modelItemType - * @param name The GraphML name of the attribute - * @param tag The tag name of the mapper in the {@link } - * @template TModelItem,TValue - */ - addRegistryOutputMapper(modelItemType:yfiles.lang.Class,valueType:yfiles.lang.Class,name:string,tag:any):void; - /** - * Use a registered {@link yfiles.collections.IMapper.} instance as source for the given GraphML attribute. - *

- * The type arguments of the mapper are determined automatically. - *

- * @param name The GraphML name of the attribute - * @param uri The optional URI of the attribute - * @param tag The tag name of the mapper in the {@link } - * @param serializationCallback An optional serialization handler - */ - addRegistryOutputMapper(name:string,uri:string,tag:any,serializationCallback:(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs)=>void):void; - /** - * Use a registered {@link yfiles.collections.IMapper.} instance as source for the given GraphML attribute. - *

- * The type arguments of the mapper are determined automatically. - *

- * @param name The GraphML name of the attribute - * @param tag The tag name of the mapper in the {@link } - */ - addRegistryOutputMapper(name:string,tag:any):void; - /** - * Adds a schema location to the header of a GraphML file. - * @param schemaNamespace The namespace URI for this schema location - * @param schemaLocation The schema location - */ - addSchemaLocation(schemaNamespace:string,schemaLocation:string):void; - /** - * Add a namespace mapping between a fully qualified XML name (consisting of xmlNamespace and tagName and a type. - *

- * Either of xmlNamespace or tagName may be null, meaning that the default rules for determining the namespace and/or tag - * name of type are used. - *

- *

- * This is used both for writing and parsing objects. - *

- * @param xmlNamespace The XML namespace that corresponds to type. If null, the namespace will be determined based on the JavaScript module - * that contains type - * @param tagName The XML tag name that corresponds to type. If null, the name will be determined from the type name automatically. - * @param type The type that is mapped to the fully qualified XML name. - * @see yfiles.graphml.IXamlNameMapper - * @see yfiles.graphml.GraphMLIOHandler#createXamlNameMapper - * @see yfiles.graphml.GraphMLIOHandler#addXamlNamespaceMapping - */ - addXamlNamespaceMapping(xmlNamespace:string,tagName:string,type:yfiles.lang.Class):void; - /** - * Add a namespace mapping between an XML namespace and a JavaScript module. - *

- * This is used both for writing and parsing objects. - *

- * @param xmlNamespace The XML namespace that corresponds to module. - * @param module The module that is mapped to the namespace. - * @see yfiles.graphml.IXamlNameMapper - * @see yfiles.graphml.GraphMLIOHandler#createXamlNameMapper - * @see yfiles.graphml.GraphMLIOHandler#addXamlNamespaceMapping - */ - addXamlNamespaceMapping(xmlNamespace:string,module:any):void; - /** - * Configure the predefined handlers for the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} - * event. - *

- * Except for text content and primitive types, this implementation delegates all work to - * {@link yfiles.graphml.GraphMLIOHandler#handleXamlDeserialization} - *

- *

- * This method is called for each parse process. - *

- * @param graph The graph that will be parsed. - * @param parser The parser to configure. - * @see yfiles.graphml.GraphMLIOHandler#handlePrimitivesDeserialization - * @see yfiles.graphml.GraphMLIOHandler#handleXamlDeserialization - * @see yfiles.graphml.GraphMLIOHandler#handleTextNodeDeserialization - * @protected - */ - configureDeserializationHandlers(graph:yfiles.graph.IGraph,parser:yfiles.graphml.GraphMLParser):void; - /** - * Configures the {@link yfiles.graphml.GraphMLIOHandler#deserializationPropertyOverrides deserialization property overrides} for the given parser. - *

- * This method is called for each parse process. - *

- * @param parser The parser to set the deserialization properties. - * @protected - */ - configureDeserializationPropertyOverrides(parser:yfiles.graphml.GraphMLParser):void; - /** - * Configures a given instance of {@link yfiles.graphml.GraphMLParser} that can handle the given graph. - *

- * This method is called by {@link yfiles.graphml.GraphMLIOHandler#createGraphMLParser}. - *

- * @param parser The parser to configure - * @param graph The graph that should be filled by the parser - * @protected - */ - configureGraphMLParser(parser:yfiles.graphml.GraphMLParser,graph:yfiles.graph.IGraph):void; - /** - * Configures a given {@link yfiles.graphml.GraphMLWriter} that is used for writing graph. - *

- * This method is called by {@link yfiles.graphml.GraphMLIOHandler#createGraphMLWriter}. - *

- * @param writer The writer to configure - * @param graph The graph that will be written. - * @protected - */ - configureGraphMLWriter(writer:yfiles.graphml.GraphMLWriter,graph:yfiles.graph.IGraph):void; - /** - * Configures default event handlers for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} - * event. - *

- * This implementation configures several input handlers for the standard yFiles for HTML GraphML attributes (styles, - * folding state, labels, geometry). - *

- *

- * This method is called for each parse process. - *

- * @param parser The parser that should be configured. - * @protected - */ - configureInputHandlers(parser:yfiles.graphml.GraphMLParser):void; - /** - * Configures writer to use the namespace declarations set with {@link yfiles.graphml.GraphMLIOHandler#addNamespace}. - *

- * In addition to the namespace declarations provided with {@link yfiles.graphml.GraphMLIOHandler#addNamespace}, the default {@link yfiles.graphml.GraphMLWriter} - * implementation also automatically places all namespace declarations that have occurred - *

- *

- * This method is called for each write process. - *

- * @param writer The writer to configure. - * @protected - */ - configureNamespaces(writer:yfiles.graphml.GraphMLWriter):void; - /** - * Configures default event handlers for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} - * event. - *

- * This implementation configures several output handlers for the standard yFiles GraphML attributes (styles, folding - * state, labels, geometry). - *

- *

- * This method is called for each write process. - *

- * @param graph The graph that will be written. - * @param writer The writer that should be configured. - * @protected - */ - configureOutputHandlers(graph:yfiles.graph.IGraph,writer:yfiles.graphml.GraphMLWriter):void; - /** - * Configures the lookup of the given parser. - *

- * This method is called for each parse process. - *

- * @param parser The parser to configure. - * @protected - */ - configureParserLookup(parser:yfiles.graphml.GraphMLParser):void; - /** - * Configures writer to use the schema locations set with {@link yfiles.graphml.GraphMLIOHandler#addSchemaLocation}. - *

- * This method is called for each write process. - *

- * @param writer The writer to configure. - * @protected - */ - configureSchemaLocations(writer:yfiles.graphml.GraphMLWriter):void; - /** - * Configures the predefined handlers for the {@link yfiles.graphml.GraphMLWriter#addHandleSerializationListener HandleSerialization} - * event. - *

- * This method is called for each write process. - *

- * @param graph The graph that will be written. - * @param writer The writer to configure. - * @protected - */ - configureSerializationHandlers(graph:yfiles.graph.IGraph,writer:yfiles.graphml.GraphMLWriter):void; - /** - * Configure important serialization properties from properties of {@link yfiles.graphml.GraphMLIOHandler}. - *

- * This method is called for each write process. - *

- * @param graph The graph to write. - * @param writer The writer to configure. - * @see yfiles.graphml.GraphMLWriter#setSerializationProperty - * @protected - */ - configureSerializationProperties(graph:yfiles.graph.IGraph,writer:yfiles.graphml.GraphMLWriter):void; - /** - * Configures the {@link yfiles.graphml.GraphMLIOHandler#serializationPropertyOverrides serialization property overrides} for the given writer. - *

- * This method is called for each write process. - *

- * @param writer The writer to set the serialization properties. - * @protected - */ - configureSerializationPropertyOverrides(writer:yfiles.graphml.GraphMLWriter):void; - /** - * Configure the lookup map of writer. - *

- * This method is called for each write process. - *

- * @param graph The graph that will be written. - * @param writer The writer to configure. - * @see yfiles.graphml.GraphMLWriter#setLookup - * @protected - */ - configureWriterLookup(graph:yfiles.graph.IGraph,writer:yfiles.graphml.GraphMLWriter):void; - /** - * Configure writer. - *

- * This method is called for each write process. - *

- *

- * This implementation does nothing. - *

- * @param writer The writer to configure. - * @protected - */ - configureXMLWriter(writer:yfiles.graphml.IXmlWriter):void; - /** - * Creates the default value serializer context and returns it. - *

- * This factory method can be used to provide custom {@link yfiles.graphml.ValueSerializer}s in cases where no {@link yfiles.graphml.GraphMLAttribute#valueSerializer} can be used. - *

- * @returns An implementation of the {@link } interface. - */ - createDefaultValueSerializerContext():yfiles.graphml.IValueSerializerContext; - /** - * Create an {@link yfiles.graphml.IGraphElementFactory} instance that creates the graph elements for the graph instance. - *

- * This method is called for each parse process. - *

- * @param parser The parser to use. - * @param graph The graph that is populated. - * @returns An {@link } instance that is configured for the given parameters. - * @protected - */ - createGraphElementFactory(parser:yfiles.graphml.GraphMLParser,graph:yfiles.graph.IGraph):yfiles.graphml.IGraphElementFactory; - /** - * Create a suitable instance of {@link yfiles.graphml.GraphMLParser} that can handle the given graph. - *

- * This method is called for each parse process. - *

- *

- * It delegates the configuration of the parser to {@link yfiles.graphml.GraphMLIOHandler#configureGraphMLParser}. - *

- * @param graph The graph that should be filled by this instance - * @returns a suitable instance of {@link } that can handle the given graph - * @protected - */ - createGraphMLParser(graph:yfiles.graph.IGraph):yfiles.graphml.GraphMLParser; - /** - * Create and configure a new {@link yfiles.graphml.GraphMLWriter} that is used for writing graph. - *

- * This method is called for each write process. It delegates the configuration of the writer to - * {@link yfiles.graphml.GraphMLIOHandler#configureGraphMLWriter}. - *

- * @param graph The graph that will be written. - * @returns A new {@link } instance that is configured for graph. - * @protected - */ - createGraphMLWriter(graph:yfiles.graph.IGraph):yfiles.graphml.GraphMLWriter; - /** - * Callback used by {@link yfiles.graphml.GraphMLIOHandler#addRegistryInputMapper} and its overloads to creates the mapper - * instance. - *

- * This method creates the mapper instance, unless there is an existing mapper in the target graph with a matching type. In - * this case the existing mapper is returned. In all other cases a new mapper will be created and returned. If a mapper is - * already registered with the same registryTag but wrong types, it will be replaced. - *

- * Type parameter TKey: The type of the keys. - * Type parameter TData: The type of the data. - * @param dataType The type of the data. - * @param keyType The type of the keys. - * @param context - * @param registryTag The tag for the mapper in the registry. - * @returns The mapper instance to use. - * @protected - * @template TKey,TData - */ - createMapper(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,context:yfiles.graphml.IParseContext,registryTag:any):yfiles.collections.IMapper; - /** - * Convenience factory method that can create an instance of several predefined {@link yfiles.graphml.IInputHandler} - * implementations that match the provided TKey and TData. - * Type parameter TKey: The type of the mapper keys - * Type parameter TData: The type of the mapper entries - * @param dataType The type of the mapper entries - * @param modelItemType The type of the mapper keys - * @param mapper The mapper to use. - * @param deserializationCallback Optional deserialization callback for complex data. - * @returns A suitable {@link } implementation - * @template TKey,TData - * @static - */ - static createMapperInputHandler(modelItemType:yfiles.lang.Class,dataType:yfiles.lang.Class,mapper:yfiles.collections.IMapper,deserializationCallback:(sender:any,evt:yfiles.graphml.HandleDeserializationEventArgs)=>void):yfiles.graphml.MapperInputHandler; - /** - * Convenience factory method that can create an instance of several predefined {@link yfiles.graphml.IOutputHandler} - * implementations that match the provided TKey and TData. - * Type parameter TKey: The type of the mapper keys - * Type parameter TData: The type of the mapper entries - * @param dataType The type of the mapper entries - * @param modelItemType The type of the mapper keys - * @param name The name of the graphml attribute - * @param mapper The mapper to use. - * @param serializationCallback Optional serialization callback for complex data. - * @returns A suitable {@link } implementation - * @template TKey,TData - * @static - */ - static createMapperOutputHandler(modelItemType:yfiles.lang.Class,dataType:yfiles.lang.Class,name:string,mapper:yfiles.collections.IMapper,serializationCallback:(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs)=>void):yfiles.graphml.MapperOutputHandler; - /** - * Configure mappings from CLR to XML names. - *

- * This implementation scans all loaded assemblies for XmlnsDefinitionAttributes and returns a suitable instance of - * {@link yfiles.graphml.IXamlNameMapper}. - *

- *

- * This method is called for each read or write process. - *

- * @returns - * @protected - */ - createXamlNameMapper():yfiles.graphml.IXamlNameMapper; - /** - * Configure mappings from XML namespaces to prefixes. - *

- * This method is called for each write process. - *

- * @returns - * @protected - */ - createXamlPrefixMapper():yfiles.graphml.IXamlPrefixMapper; - /** - * Factory method that creates and configures a suitable {@link yfiles.graphml.IXmlWriter} implementation. - *

- * This method is called for each write process. The {@link yfiles.graphml.IXmlWriter} implementation is used by default for all - * low-level write operations. - *

- * @returns A suitable {@link } instance for the serialization - * @see yfiles.graphml.IWriteContext#writer - * @protected - */ - createXMLWriter():yfiles.graphml.IXmlWriter; - /** - * Handle the serialization of arrays. - *

- * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff {@link yfiles.graphml.HandleSerializationEventArgs#item} is an array. This handler is registered by default. - *

- * @param sender The origin of the event. - * @param evt The event handler arguments. - * @protected - */ - handleArraySerialization(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs):void; - /** - * Handle the serialization for enums. - * @param sender The origin of the event. - * @param evt The event handler arguments. - * @protected - */ - handleEnumSerialization(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs):void; - /** - * Handle the serialization of types that extend FrameworkTemplate. - * @param sender The origin of the event. - * @param evt The event handler arguments. - * @protected - */ - handleJSONDeserialization(sender:any,evt:yfiles.graphml.HandleDeserializationEventArgs):void; - /** - * Handle the serialization of plain JavaScript object that can be serialized to JSON. - *

- * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff {@link yfiles.graphml.HandleSerializationEventArgs#item} can be converted to JSON data. This serializer is only called from element property syntax and - * is registered by default. - *

- * @param sender The origin of the event. - * @param evt The event handler arguments. - * @protected - */ - handleJSONSerialization(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs):void; - /** - * Handle the serialization of {@link yfiles.collections.IEnumerable.} instances. - *

- * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff {@link yfiles.graphml.HandleSerializationEventArgs#item} is an IEnumerable instance. This handler is registered by default. - *

- * @param sender The origin of the event. - * @param evt The event handler arguments. - * @protected - */ - handleListSerialization(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs):void; - /** - * Handle the serialization of {@link yfiles.graphml.MarkupExtension} convertible instances. - *

- * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff {@link yfiles.graphml.HandleSerializationEventArgs#item} can be converted to a {@link yfiles.graphml.MarkupExtension} instance. This handler is registered by - * default. - *

- * @param sender The origin of the event. - * @param evt The event handler arguments. - * @protected - */ - handleMarkupExtensionBasedSerialization(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs):void; - /** - * Handle the serialization of null references. - *

- * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff {@link yfiles.graphml.HandleSerializationEventArgs#item} is a null reference. This handler is registered by default and is only used to write null - * references in XML element syntax. - *

- * @param sender The origin of the event. - * @param evt The event handler arguments. - * @protected - */ - handleNullSerialization(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs):void; - /** - * Handle the serialization of primitive types, enums and strings. - * @param sender The origin of the event. - * @param evt The event handler arguments. - * @protected - */ - handlePrimitivesDeserialization(sender:any,evt:yfiles.graphml.HandleDeserializationEventArgs):void; - /** - * Handle the serialization of primitive types, enums and strings. - * @param sender The origin of the event. - * @param evt The event handler arguments. - * @protected - */ - handlePrimitivesSerialization(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs):void; - /** - * Handle the serialization of {@link yfiles.graphml.IReferenceHandle} instances. - *

- * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff {@link yfiles.graphml.HandleSerializationEventArgs#item} is a {@link yfiles.graphml.IReferenceHandle} instance. This handler is registered by default and should - * not be removed if {@link yfiles.graphml.GraphMLIOHandler#writeSharedReferences} is enabled. - *

- * @param sender The origin of the event. - * @param evt The event handler arguments. - * @protected - */ - handleReferenceHandleSerialization(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs):void; - /** - * Handle the serialization of instances that can be serialized through a {@link yfiles.graphml.ValueSerializer}. - *

- * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff {@link yfiles.graphml.HandleSerializationEventArgs#item} can be converted to a string with a - * {@link yfiles.graphml.ValueSerializer}. This serializer is only called from element property syntax and is registered by - * default. - *

- * @param sender The origin of the event. - * @param evt The event handler arguments. - * @protected - */ - handleTextConvertibleSerialization(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs):void; - /** - * Callback for the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} event. - * @param source The source of the event. - * @param evt The event arguments. - * @see yfiles.graphml.HandleDeserializationEventArgs - * @protected - */ - handleTextNodeDeserialization(source:any,evt:yfiles.graphml.HandleDeserializationEventArgs):void; - /** - * Handle the serialization of TypeExtensions. - *

- * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff {@link yfiles.graphml.HandleSerializationEventArgs#item} is an array. This handler is registered by default. - *

- * @param sender The origin of the event. - * @param evt The event handler arguments. - * @protected - */ - handleTypeExtensionSerialization(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs):void; - /** - * Handle the serialization of Types. - *

- * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff {@link yfiles.graphml.HandleSerializationEventArgs#item} is an array. This handler is registered by default. - *

- * @param sender The origin of the event. - * @param evt The event handler arguments. - * @protected - */ - handleTypeSerialization(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs):void; - /** - * Handle the serialization of undefined references. - *

- * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff {@link yfiles.graphml.HandleSerializationEventArgs#item} is an undefined reference. This handler is registered by default and is only used to write undefined - * references in XML element syntax. - *

- * @param sender The origin of the event. - * @param evt The event handler arguments. - * @protected - */ - handleUndefinedSerialization(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs):void; - /** - * Callback for the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} event. - * @param source The source of the event. - * @param evt The event arguments. - * @see yfiles.graphml.HandleDeserializationEventArgs - * @protected - */ - handleXamlDeserialization(source:any,evt:yfiles.graphml.HandleDeserializationEventArgs):void; - /** - * Handle the serialization of complex objects that are not handled by other callbacks. - *

- * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff {@link yfiles.graphml.HandleSerializationEventArgs#item} is not a null reference. This handler is registered by default and uses {@link yfiles.graphml.XamlSerializer} - * to create XAML output. - *

- * @param sender The origin of the event. - * @param evt The event handler arguments. - * @protected - */ - handleXamlSerialization(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs):void; - /** - * Checks whether the name attribute in definition matches name - * @param definition The key definition to check - * @param name The name that should be matched - * @returns true if the name attribute in definition matches name - * @static - */ - static matchesName(definition:Element,name:string):boolean; - /** - * Checks whether the scope attribute in definition matches scope - * @param definition The key definition to check - * @param scope The scope that should be matched - * @returns true if the scope attribute in definition matches scope - * @static - */ - static matchesScope(definition:Element,scope:yfiles.graphml.KeyScope):boolean; - /** - * Checks whether the type attribute in definition matches type - * @param definition The key definition to check - * @param type The type that should be matched - * @returns true if the type attribute in definition matches type - * @static - */ - static matchesType(definition:Element,type:yfiles.graphml.KeyType):boolean; - /** - * Checks whether the uri attribute in definition matches uri - * @param definition The key definition to check - * @param uri The uri that should be matched - * @returns true if the uri attribute in definition matches uri - * @static - */ - static matchesUri(definition:Element,uri:string):boolean; - /** - * Event handler for the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} event. - *

- * This event handler is used to propagate the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} - * event to subscribers of - * {@link yfiles.graphml.GraphMLIOHandler#addHandleDeserializationListener HandleDeserialization}. This implementation - * just calls {@link yfiles.graphml.GraphMLIOHandler#onHandleDeserialization}, which in turn raises the {@link yfiles.graphml.GraphMLIOHandler#addHandleDeserializationListener HandleDeserialization} - * event. - *

- * @param sender - * @param evt - * @protected - */ - onGraphMLParserHandleDeserialization(sender:any,evt:yfiles.graphml.HandleDeserializationEventArgs):void; - /** - * Event handler for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} event. - *

- * This event handler is used to propagate the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} - * event to subscribers of {@link yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener QueryInputHandlers}. - * This implementation just calls {@link yfiles.graphml.GraphMLIOHandler#onQueryInputHandlers}, which in turn raises the {@link yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener QueryInputHandlers} - * event. - *

- * @param sender - * @param evt - * @protected - */ - onGraphMLParserQueryInputHandlers(sender:any,evt:yfiles.graphml.QueryInputHandlersEventArgs):void; - /** - * Event handler for the {@link yfiles.graphml.GraphMLWriter#addHandleSerializationListener HandleSerialization} event. - *

- * This event handler is used to propagate the {@link yfiles.graphml.GraphMLWriter#addHandleSerializationListener HandleSerialization} - * event to subscribers of {@link yfiles.graphml.GraphMLIOHandler#addHandleSerializationListener HandleSerialization}. - * This implementation just calls {@link yfiles.graphml.GraphMLIOHandler#onHandleSerialization}, which in turn raises the {@link yfiles.graphml.GraphMLIOHandler#addHandleSerializationListener HandleSerialization} - * event. - *

- * @param sender - * @param evt - * @protected - */ - onGraphMLWriterHandleSerialization(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs):void; - /** - * Event handler for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} event. - *

- * This event handler is used to propagate the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} - * event to subscribers of {@link yfiles.graphml.GraphMLIOHandler#addQueryOutputHandlersListener QueryOutputHandlers}. - * This implementation just calls {@link yfiles.graphml.GraphMLIOHandler#onQueryOutputHandlers}, which in turn raises the {@link yfiles.graphml.GraphMLIOHandler#addQueryOutputHandlersListener QueryOutputHandlers} - * event. - *

- * @param sender - * @param evt - * @protected - */ - onGraphMLWriterQueryOutputHandlers(sender:any,evt:yfiles.graphml.QueryOutputHandlersEventArgs):void; - /** - * Raises the {@link yfiles.graphml.GraphMLIOHandler#addHandleDeserializationListener HandleDeserialization} event. - * @param evt The arguments for the {@link #addHandleDeserializationListener HandleDeserialization} - * event. - * @protected - */ - onHandleDeserialization(evt:yfiles.graphml.HandleDeserializationEventArgs):void; - /** - * Raises the {@link yfiles.graphml.GraphMLIOHandler#addHandleSerializationListener HandleSerialization} event. - * @param evt The arguments for the {@link #addHandleSerializationListener HandleSerialization} - * event. - * @protected - */ - onHandleSerialization(evt:yfiles.graphml.HandleSerializationEventArgs):void; - /** - * Fires the {@link yfiles.graphml.GraphMLIOHandler#addOverrideResolveReferenceListener OverrideResolveReference} event. - * @param evt The arguments that get passed to the {@link #addOverrideResolveReferenceListener OverrideResolveReference} - * event. - * @protected - */ - onOverrideResolveReference(evt:yfiles.graphml.ResolveReferenceEventArgs):void; - /** - * Raises the {@link yfiles.graphml.GraphMLIOHandler#addParsedListener Parsed} event. - *

- * This method is called when the document has been parsed and after {@link yfiles.graphml.IParseEvents#addDocumentParsedListener DocumentParsed} - * is called. - *

- * @param evt The {@link } instance containing the event data. - * @see yfiles.graphml.GraphMLIOHandler#addParsedListener - * @protected - */ - onParsed(evt:yfiles.graphml.ParseEventArgs):void; - /** - * Raises the {@link yfiles.graphml.GraphMLIOHandler#addParsingListener Parsing} event. - *

- * This method is called just before the parsing starts and before {@link yfiles.graphml.IParseEvents#addDocumentParsingListener DocumentParsing} - * is called. - *

- * @param evt The {@link } instance containing the event data. - * @see yfiles.graphml.GraphMLIOHandler#addParsingListener - * @protected - */ - onParsing(evt:yfiles.graphml.ParseEventArgs):void; - /** - * Raises the {@link yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener QueryInputHandlers} event. - * @param evt The arguments for the {@link #addQueryInputHandlersListener QueryInputHandlers} - * event. - * @protected - */ - onQueryInputHandlers(evt:yfiles.graphml.QueryInputHandlersEventArgs):void; - /** - * Raises the {@link yfiles.graphml.GraphMLIOHandler#addQueryOutputHandlersListener QueryOutputHandlers} event. - * @param evt The arguments for the {@link #addQueryOutputHandlersListener QueryOutputHandlers} - * event. - * @protected - */ - onQueryOutputHandlers(evt:yfiles.graphml.QueryOutputHandlersEventArgs):void; - /** - * Fires the {@link yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener QueryReferenceId} event. - * @param evt The arguments that get passed to the {@link #addQueryReferenceIdListener QueryReferenceId} - * event. - * @throws {Stubs.Exceptions.ArgumentError} args is null. - * @see yfiles.graphml.GraphMLWriter#onQueryReferenceId - * @protected - */ - onQueryReferenceId(evt:yfiles.graphml.QueryReferenceIdEventArgs):void; - /** - * Fires the {@link yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener ResolveReference} event. - * @param evt The arguments that get passed to the {@link #addResolveReferenceListener ResolveReference} - * event. - * @protected - */ - onResolveReference(evt:yfiles.graphml.ResolveReferenceEventArgs):void; - /** - * Raises the {@link yfiles.graphml.GraphMLIOHandler#addWritingListener Writing} event. - *

- * This method is called just before the writing starts and before {@link yfiles.graphml.IWriteEvents#addDocumentWritingListener DocumentWriting} - * is called. - *

- * @param evt The {@link } instance containing the event data. - * @see yfiles.graphml.GraphMLIOHandler#addWritingListener - * @protected - */ - onWriting(evt:yfiles.graphml.WriteEventArgs):void; - /** - * Raises the {@link yfiles.graphml.GraphMLIOHandler#addWrittenListener Written} event. - *

- * This method is called just after the writing finishes and after {@link yfiles.graphml.IWriteEvents#addDocumentWrittenListener DocumentWritten} - * is called. - *

- * @param evt The {@link } instance containing the event data. - * @see yfiles.graphml.GraphMLIOHandler#addWrittenListener - * @protected - */ - onWritten(evt:yfiles.graphml.WriteEventArgs):void; - /** - * Read GraphML from an existing XML document. - * @param graph The Graph object that is to be populated with nodes and edges as read from the document. - * @param document The XML document. Note: If you are using Internet Explorer 9 and {@link }s to retrieve the document, you may not use - * the value from the {@link #responseXML} property. Please parse {@link #responseText} instead and use the - * result. For further reference see {@link http://msdn.microsoft.com/en-us/library/ie/hh180177.aspx}. - * @returns - * @throws {Stubs.Exceptions.ArgumentError} document is null. - * @throws {Stubs.Exceptions.ArgumentError} graph is null. - */ - readFromDocument(graph:yfiles.graph.IGraph,document:Document):Promise; - /** - * Convenience method that imports the graph from an XML data provided in a string data. - * @param graph The Graph object that is to be populated with nodes and edges as read from the GraphML data. - * @param data A string that contains GraphML data. - * @returns - */ - readFromGraphMLText(graph:yfiles.graph.IGraph,data:string):Promise; - /** - * Reads a GraphML file from the given GraphML file and populates the Graph object. - *

- * Note that this is an asynchronous method that returns immediately. Use the returned Promise to get notified when the - * actual parsing has completed. - *

- * @param graph The Graph object that is to be populated with nodes and edges as read from the GraphML file. - * @param url The url of the file to be read. - * @returns - * @throws {Stubs.Exceptions.ArgumentError} url is null. - * @throws {Stubs.Exceptions.ArgumentError} graph is null. - */ - readFromURL(graph:yfiles.graph.IGraph,url:string):Promise; - /** - * Predefined input handler that reads edge bends. - *

- * This handler is by default registered for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} - * event - *

- * @param sender - * @param evt - * @protected - */ - registerEdgeBendsInputHandler(sender:any,evt:yfiles.graphml.QueryInputHandlersEventArgs):void; - /** - * Predefined output handler that writes edge bends. - *

- * This handler is by default registered for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} - * event - *

- * @param sender - * @param evt - * @protected - */ - registerEdgeBendsOutputHandler(sender:any,evt:yfiles.graphml.QueryOutputHandlersEventArgs):void; - /** - * Predefined input handler that reads edge labels. - *

- * This handler is by default registered for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} - * event - *

- * @param sender - * @param evt - * @protected - */ - registerEdgeLabelsInputHandler(sender:any,evt:yfiles.graphml.QueryInputHandlersEventArgs):void; - /** - * Predefined output handler that writes edge labels. - *

- * This handler is by default registered for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} - * event - *

- * @param sender - * @param evt - * @protected - */ - registerEdgeLabelsOutputHandler(sender:any,evt:yfiles.graphml.QueryOutputHandlersEventArgs):void; - /** - * Predefined input handler that reads edge styles. - *

- * This handler is by default registered for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} - * event - *

- * @param sender - * @param evt - * @protected - */ - registerEdgeStyleInputHandler(sender:any,evt:yfiles.graphml.QueryInputHandlersEventArgs):void; - /** - * Predefined output handler that writes edge styles. - *

- * This handler is by default registered for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} - * event - *

- * @param sender - * @param evt - * @protected - */ - registerEdgeStyleOutputHandler(sender:any,evt:yfiles.graphml.QueryOutputHandlersEventArgs):void; - /** - * Predefined input handler that reads {@link yfiles.graph.IGraph} graph default settings. - *

- * This handler is by default registered for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} - * event - *

- * @param sender - * @param evt - * @protected - */ - registerGraphSettingsInputHandler(sender:any,evt:yfiles.graphml.QueryInputHandlersEventArgs):void; - /** - * Predefined output handler that writes the settings of a graph. - *

- * This handler is by default registered for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} - * event. - *

- * @param sender - * @param evt - * @see yfiles.graphml.SerializationProperties#DISABLE_GRAPH_SETTINGS - * @protected - */ - registerGraphSettingsOutputHandler(sender:any,evt:yfiles.graphml.QueryOutputHandlersEventArgs):void; - /** - * Predefined input handler that reads node labels. - *

- * This handler is by default registered for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} - * event - *

- * @param sender - * @param evt - * @protected - */ - registerNodeLabelsInputHandler(sender:any,evt:yfiles.graphml.QueryInputHandlersEventArgs):void; - /** - * Predefined output handler that writes node labels. - *

- * This handler is by default registered for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} - * event - *

- * @param sender - * @param evt - * @protected - */ - registerNodeLabelsOutputHandler(sender:any,evt:yfiles.graphml.QueryOutputHandlersEventArgs):void; - /** - * Predefined input handler that reads node layouts. - *

- * This handler is by default registered for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} - * event - *

- * @param sender - * @param evt - * @protected - */ - registerNodeLayoutInputHandler(sender:any,evt:yfiles.graphml.QueryInputHandlersEventArgs):void; - /** - * Predefined output handler that writes node layouts. - *

- * This handler is by default registered for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} - * event - *

- * @param sender - * @param evt - * @protected - */ - registerNodeLayoutOutputHandler(sender:any,evt:yfiles.graphml.QueryOutputHandlersEventArgs):void; - /** - * Predefined input handler that reads node styles. - *

- * This handler is by default registered for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} - * event - *

- * @param sender - * @param evt - * @protected - */ - registerNodeStyleInputHandler(sender:any,evt:yfiles.graphml.QueryInputHandlersEventArgs):void; - /** - * Predefined output handler that writes node styles. - *

- * This handler is by default registered for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} - * event - *

- * @param sender - * @param evt - * @protected - */ - registerNodeStyleOutputHandler(sender:any,evt:yfiles.graphml.QueryOutputHandlersEventArgs):void; - /** - * Predefined input handler that reads port locations. - *

- * This handler is by default registered for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} - * event - *

- * @param sender - * @param evt - * @protected - */ - registerPortLocationInputHandler(sender:any,evt:yfiles.graphml.QueryInputHandlersEventArgs):void; - /** - * Predefined output handler that writes port locations. - *

- * This handler is by default registered for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} - * event - *

- * @param sender - * @param evt - * @protected - */ - registerPortLocationOutputHandler(sender:any,evt:yfiles.graphml.QueryOutputHandlersEventArgs):void; - /** - * Predefined input handler that reads port styles. - *

- * This handler is by default registered for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} - * event - *

- * @param sender - * @param evt - * @protected - */ - registerPortStyleInputHandler(sender:any,evt:yfiles.graphml.QueryInputHandlersEventArgs):void; - /** - * Predefined output handler that writes port styles. - *

- * This handler is by default registered for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} - * event - *

- * @param sender - * @param evt - * @protected - */ - registerPortStyleOutputHandler(sender:any,evt:yfiles.graphml.QueryOutputHandlersEventArgs):void; - /** - * Predefined input handler that reads {@link yfiles.graph.ITagOwner} tags. - *

- * This handler is by default registered for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} - * event - *

- * @param sender - * @param evt - * @protected - */ - registerTagInputHandler(sender:any,evt:yfiles.graphml.QueryInputHandlersEventArgs):void; - /** - * Predefined output handler that writes {@link yfiles.graph.ITagOwner} tags. - *

- * This handler is by default registered for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} - * event - *

- * @param sender - * @param evt - * @protected - */ - registerTagOutputHandler(sender:any,evt:yfiles.graphml.QueryOutputHandlersEventArgs):void; - /** - * Writes the given graph object to a GraphML file with a given filename. - * @param graph The Graph object that is to be written to a GraphML file. - * @returns A string containing the GraphML data. - */ - write(graph:yfiles.graph.IGraph):Promise; - /** - * Gets or sets whether schema descriptions should be written. - * @type {boolean} - */ - writeXMLSchema:boolean; - /** - * Gets or sets whether to support object sharing on output. - *

- * If enabled, multiple object references will be correctly represented in the output document, otherwise, each object - * reference will be serialized independently. - *

- *

- * Note: Reading of shared references is always supported - *

- * @type {boolean} - */ - writeSharedReferences:boolean; - /** - * Gets or sets whether to clear an existing graph instance before reading - *

- * If set - * totrue, an existing graph instance will be cleared before the graph is read into this instance, otherwise the loaded - * graph will be merged into the existing one. - *

- * @type {boolean} - */ - clearGraphBeforeRead:boolean; - /** - * Adds the given listener for the OverrideResolveReference event that occurs before inline references are evaluated. - *

- * Subscribe to this event to customize resolving of GraphML object references. This event is fired before the framework - * tries to resolve internal references and can therefore be used to override internal references, for example. - *

- * @param listener The listener to add. - * @see yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener - * @see yfiles.graphml.GraphMLIOHandler#removeOverrideResolveReferenceListener - */ - addOverrideResolveReferenceListener(listener:(sender:any,evt:yfiles.graphml.ResolveReferenceEventArgs)=>void):void; - /** - * Removes the given listener for the OverrideResolveReference event that occurs before inline references are evaluated. - *

- * Subscribe to this event to customize resolving of GraphML object references. This event is fired before the framework - * tries to resolve internal references and can therefore be used to override internal references, for example. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener - * @see yfiles.graphml.GraphMLIOHandler#addOverrideResolveReferenceListener - */ - removeOverrideResolveReferenceListener(listener:(sender:any,evt:yfiles.graphml.ResolveReferenceEventArgs)=>void):void; - /** - * Adds the given listener for the ResolveReference event that occurs after references are evaluated. - *

- * Subscribe to this event to customize resolving of GraphML object references. This event is fired when the framework - * could not resolve an object reference by an internal one. - *

- * @param listener The listener to add. - * @see yfiles.graphml.GraphMLIOHandler#addOverrideResolveReferenceListener - * @see yfiles.graphml.GraphMLIOHandler#removeResolveReferenceListener - */ - addResolveReferenceListener(listener:(sender:any,evt:yfiles.graphml.ResolveReferenceEventArgs)=>void):void; - /** - * Removes the given listener for the ResolveReference event that occurs after references are evaluated. - *

- * Subscribe to this event to customize resolving of GraphML object references. This event is fired when the framework - * could not resolve an object reference by an internal one. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.GraphMLIOHandler#addOverrideResolveReferenceListener - * @see yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener - */ - removeResolveReferenceListener(listener:(sender:any,evt:yfiles.graphml.ResolveReferenceEventArgs)=>void):void; - /** - * Adds the given listener for the QueryReferenceId event that occurs when a reference is queried. - *

- * This event can be used to provide names of external or internal references for objects. - *

- *

- * The reference targets are not serialized to the GraphML file if they are set to - * {@link yfiles.graphml.GraphMLReferenceType#EXTERNAL}. To resolve these references when parsing, you typically have to subscribe - * to the {@link yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener ResolveReference} event. - *

- * @param listener The listener to add. - * @see yfiles.graphml.QueryReferenceIdEventArgs#referenceId - * @see yfiles.graphml.QueryReferenceIdEventArgs#referenceType - * @see yfiles.graphml.GraphMLIOHandler#removeQueryReferenceIdListener - */ - addQueryReferenceIdListener(listener:(sender:any,evt:yfiles.graphml.QueryReferenceIdEventArgs)=>void):void; - /** - * Removes the given listener for the QueryReferenceId event that occurs when a reference is queried. - *

- * This event can be used to provide names of external or internal references for objects. - *

- *

- * The reference targets are not serialized to the GraphML file if they are set to - * {@link yfiles.graphml.GraphMLReferenceType#EXTERNAL}. To resolve these references when parsing, you typically have to subscribe - * to the {@link yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener ResolveReference} event. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.QueryReferenceIdEventArgs#referenceId - * @see yfiles.graphml.QueryReferenceIdEventArgs#referenceType - * @see yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener - */ - removeQueryReferenceIdListener(listener:(sender:any,evt:yfiles.graphml.QueryReferenceIdEventArgs)=>void):void; - /** - * Adds the given listener for the Written event that occurs when the writing of a document has been finished. - * @param listener The listener to add. - * @see yfiles.graphml.GraphMLIOHandler#onWritten - * @see yfiles.graphml.GraphMLWriter#addWrittenListener - * @see yfiles.graphml.GraphMLIOHandler#removeWrittenListener - */ - addWrittenListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Removes the given listener for the Written event that occurs when the writing of a document has been finished. - * @param listener The listener to remove. - * @see yfiles.graphml.GraphMLIOHandler#onWritten - * @see yfiles.graphml.GraphMLWriter#addWrittenListener - * @see yfiles.graphml.GraphMLIOHandler#addWrittenListener - */ - removeWrittenListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Adds the given listener for the Writing event that occurs when the writing of a document is just about to begin. - *

- * This event can be used to register to the fine-grained events available in the {@link yfiles.graphml.WriteEventArgs#context}'s {@link yfiles.graphml.IWriteContext#writeEvents} and to configure the writing process - * on a per write case. - *

- * @param listener The listener to add. - * @see yfiles.graphml.GraphMLIOHandler#onWriting - * @see yfiles.graphml.GraphMLWriter#addWritingListener - * @see yfiles.graphml.GraphMLIOHandler#removeWritingListener - */ - addWritingListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Removes the given listener for the Writing event that occurs when the writing of a document is just about to begin. - *

- * This event can be used to register to the fine-grained events available in the {@link yfiles.graphml.WriteEventArgs#context}'s {@link yfiles.graphml.IWriteContext#writeEvents} and to configure the writing process - * on a per write case. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.GraphMLIOHandler#onWriting - * @see yfiles.graphml.GraphMLWriter#addWritingListener - * @see yfiles.graphml.GraphMLIOHandler#addWritingListener - */ - removeWritingListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Gets the mapper for the overrides of the serialization properties. - *

- * Using this mapper {@link yfiles.graphml.IWriteContext#getSerializationProperty serialization properties} can be specified. - *

- * @see yfiles.graphml.GraphMLIOHandler#configureSerializationPropertyOverrides - * @type {yfiles.collections.IMap.} - */ - serializationPropertyOverrides:yfiles.collections.IMap; - /** - * Gets the mapper for the overrides of the deserialization properties. - *

- * Using this mapper {@link yfiles.graphml.IParseContext#getDeserializationProperty deserialization properties} can be specified. - *

- * @see yfiles.graphml.GraphMLIOHandler#configureDeserializationPropertyOverrides - * @type {yfiles.collections.IMap.} - */ - deserializationPropertyOverrides:yfiles.collections.IMap; - /** - * Adds the given listener for the QueryType event that occurs when a type is queried. - *

- * This event can be used to override type resolution for XML names in XAML. - *

- * @param listener The listener to add. - * @see yfiles.graphml.QueryTypeEventArgs - * @see yfiles.graphml.GraphMLIOHandler#removeQueryTypeListener - */ - addQueryTypeListener(listener:(sender:any,evt:yfiles.graphml.QueryTypeEventArgs)=>void):void; - /** - * Removes the given listener for the QueryType event that occurs when a type is queried. - *

- * This event can be used to override type resolution for XML names in XAML. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.QueryTypeEventArgs - * @see yfiles.graphml.GraphMLIOHandler#addQueryTypeListener - */ - removeQueryTypeListener(listener:(sender:any,evt:yfiles.graphml.QueryTypeEventArgs)=>void):void; - /** - * Adds the given listener for the QueryName event that occurs when a name is queried. - *

- * This event can be used to override name mappings to XML names in XAML. - *

- *

- * If the event handler determines that it map resolve {@link yfiles.graphml.QueryNameEventArgs#type} to a xml name, it should place the result into the {@link yfiles.graphml.QueryNameEventArgs#result} property and - * thus mark the event as {@link yfiles.graphml.QueryNameEventArgs#handled}. - *

- *

- * It is valid to provide only part of the XML name by setting the other part to null. In that case, the default name - * determination rules are used for that part. - *

- * @param listener The listener to add. - * @see yfiles.graphml.GraphMLIOHandler#removeQueryNameListener - */ - addQueryNameListener(listener:(sender:any,evt:yfiles.graphml.QueryNameEventArgs)=>void):void; - /** - * Removes the given listener for the QueryName event that occurs when a name is queried. - *

- * This event can be used to override name mappings to XML names in XAML. - *

- *

- * If the event handler determines that it map resolve {@link yfiles.graphml.QueryNameEventArgs#type} to a xml name, it should place the result into the {@link yfiles.graphml.QueryNameEventArgs#result} property and - * thus mark the event as {@link yfiles.graphml.QueryNameEventArgs#handled}. - *

- *

- * It is valid to provide only part of the XML name by setting the other part to null. In that case, the default name - * determination rules are used for that part. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.GraphMLIOHandler#addQueryNameListener - */ - removeQueryNameListener(listener:(sender:any,evt:yfiles.graphml.QueryNameEventArgs)=>void):void; - /** - * Adds the given listener for the HandleSerialization event that occurs when XML content is about to be serialized. - *

- * Subscribe to this event to provide custom serialization handling for XML content. - *

- *

- * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called - * earlier. - *

- *

- * The current item is provided by {@link yfiles.graphml.HandleSerializationEventArgs#item}. - *

- * @param listener The listener to add. - * @see yfiles.graphml.GraphMLIOHandler#removeHandleSerializationListener - */ - addHandleSerializationListener(listener:(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs)=>void):void; - /** - * Removes the given listener for the HandleSerialization event that occurs when XML content is about to be serialized. - *

- * Subscribe to this event to provide custom serialization handling for XML content. - *

- *

- * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called - * earlier. - *

- *

- * The current item is provided by {@link yfiles.graphml.HandleSerializationEventArgs#item}. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.GraphMLIOHandler#addHandleSerializationListener - */ - removeHandleSerializationListener(listener:(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs)=>void):void; - /** - * Adds the given listener for the QueryOutputHandlers event that occurs when a GraphML attribute is about to be written. - *

- * Subscribe to this event to dynamically register one or more {@link yfiles.graphml.IOutputHandler} instance(s) for a given - * GraphML attribute key definition. - *

- *

- * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called - * earlier. - *

- *

- * If you want to register an {@link yfiles.graphml.IOutputHandler} for this GraphML attribute, you can add the handler with - * {@link yfiles.graphml.QueryOutputHandlersEventArgs#addOutputHandler}. - *

- * @param listener The listener to add. - * @see yfiles.graphml.GraphMLIOHandler#removeQueryOutputHandlersListener - */ - addQueryOutputHandlersListener(listener:(sender:any,evt:yfiles.graphml.QueryOutputHandlersEventArgs)=>void):void; - /** - * Removes the given listener for the QueryOutputHandlers event that occurs when a GraphML attribute is about to be - * written. - *

- * Subscribe to this event to dynamically register one or more {@link yfiles.graphml.IOutputHandler} instance(s) for a given - * GraphML attribute key definition. - *

- *

- * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called - * earlier. - *

- *

- * If you want to register an {@link yfiles.graphml.IOutputHandler} for this GraphML attribute, you can add the handler with - * {@link yfiles.graphml.QueryOutputHandlersEventArgs#addOutputHandler}. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.GraphMLIOHandler#addQueryOutputHandlersListener - */ - removeQueryOutputHandlersListener(listener:(sender:any,evt:yfiles.graphml.QueryOutputHandlersEventArgs)=>void):void; - /** - * Adds the given listener for the Parsed event that occurs when the the document has been parsed. - * @param listener The listener to add. - * @see yfiles.graphml.GraphMLIOHandler#onParsed - * @see yfiles.graphml.GraphMLParser#addParsedListener - * @see yfiles.graphml.GraphMLIOHandler#removeParsedListener - */ - addParsedListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Removes the given listener for the Parsed event that occurs when the the document has been parsed. - * @param listener The listener to remove. - * @see yfiles.graphml.GraphMLIOHandler#onParsed - * @see yfiles.graphml.GraphMLParser#addParsedListener - * @see yfiles.graphml.GraphMLIOHandler#addParsedListener - */ - removeParsedListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Adds the given listener for the Parsing event that occurs when the parsing of a document is just about to begin. - *

- * This event can be used to register to the fine-grained events available in the {@link yfiles.graphml.ParseEventArgs#context}'s {@link yfiles.graphml.IParseContext#parseEvents} and to configure the parsing process - * on a per parse case. - *

- * @param listener The listener to add. - * @see yfiles.graphml.GraphMLIOHandler#onParsing - * @see yfiles.graphml.GraphMLParser#addParsingListener - * @see yfiles.graphml.GraphMLIOHandler#removeParsingListener - */ - addParsingListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Removes the given listener for the Parsing event that occurs when the parsing of a document is just about to begin. - *

- * This event can be used to register to the fine-grained events available in the {@link yfiles.graphml.ParseEventArgs#context}'s {@link yfiles.graphml.IParseContext#parseEvents} and to configure the parsing process - * on a per parse case. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.GraphMLIOHandler#onParsing - * @see yfiles.graphml.GraphMLParser#addParsingListener - * @see yfiles.graphml.GraphMLIOHandler#addParsingListener - */ - removeParsingListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Adds the given listener for the QueryInputHandlers event that occurs when a GraphML attribute is about to be read. - *

- * Subscribe to this event to dynamically register one or more {@link yfiles.graphml.IInputHandler} instance(s) for a given GraphML - * attribute key definition. - *

- *

- * The current key definition is provided by {@link yfiles.graphml.QueryInputHandlersEventArgs#keyDefinition}. If you want to register an {@link yfiles.graphml.IInputHandler} for this GraphML - * attribute, you can add the handler with {@link yfiles.graphml.QueryInputHandlersEventArgs#addInputHandler} method. - * Implementations should also consider the {@link yfiles.graphml.QueryInputHandlersEventArgs#handled} property. - *

- * @param listener The listener to add. - * @see yfiles.graphml.GraphMLParser#addQueryInputHandlersListener - * @see yfiles.graphml.GraphMLIOHandler#removeQueryInputHandlersListener - */ - addQueryInputHandlersListener(listener:(sender:any,evt:yfiles.graphml.QueryInputHandlersEventArgs)=>void):void; - /** - * Removes the given listener for the QueryInputHandlers event that occurs when a GraphML attribute is about to be read. - *

- * Subscribe to this event to dynamically register one or more {@link yfiles.graphml.IInputHandler} instance(s) for a given GraphML - * attribute key definition. - *

- *

- * The current key definition is provided by {@link yfiles.graphml.QueryInputHandlersEventArgs#keyDefinition}. If you want to register an {@link yfiles.graphml.IInputHandler} for this GraphML - * attribute, you can add the handler with {@link yfiles.graphml.QueryInputHandlersEventArgs#addInputHandler} method. - * Implementations should also consider the {@link yfiles.graphml.QueryInputHandlersEventArgs#handled} property. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.GraphMLParser#addQueryInputHandlersListener - * @see yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener - */ - removeQueryInputHandlersListener(listener:(sender:any,evt:yfiles.graphml.QueryInputHandlersEventArgs)=>void):void; - /** - * Adds the given listener for the HandleDeserialization event that occurs when XML content is about to be deserialized. - *

- * Subscribe to this event to provide custom deserialization handling for XML content. - *

- *

- * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called - * earlier. - *

- *

- * The current XML content is provided by {@link yfiles.graphml.HandleDeserializationEventArgs#xmlNode}. If you want to return deserialized content, set the value of the {@link yfiles.graphml.HandleDeserializationEventArgs#result} property. - *

- * @param listener The listener to add. - * @see yfiles.graphml.GraphMLParser#addHandleDeserializationListener - * @see yfiles.graphml.GraphMLIOHandler#removeHandleDeserializationListener - */ - addHandleDeserializationListener(listener:(sender:any,evt:yfiles.graphml.HandleDeserializationEventArgs)=>void):void; - /** - * Removes the given listener for the HandleDeserialization event that occurs when XML content is about to be - * deserialized. - *

- * Subscribe to this event to provide custom deserialization handling for XML content. - *

- *

- * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called - * earlier. - *

- *

- * The current XML content is provided by {@link yfiles.graphml.HandleDeserializationEventArgs#xmlNode}. If you want to return deserialized content, set the value of the {@link yfiles.graphml.HandleDeserializationEventArgs#result} property. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.GraphMLParser#addHandleDeserializationListener - * @see yfiles.graphml.GraphMLIOHandler#addHandleDeserializationListener - */ - removeHandleDeserializationListener(listener:(sender:any,evt:yfiles.graphml.HandleDeserializationEventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.GraphMLIOHandler; - } - /** - * Interface for factory classes for {@link yfiles.graphml.IInputHandler} creation. - * @interface - */ - export interface IGenericInputHandlerFactory extends yfiles.lang.Object{ - /** - * Create an {@link yfiles.graphml.IInputHandler} instance based on the given evt. - * @param keyType The key type as inferred by the caller from the GraphML contents. - * @param valueType The type of the value as inferred by the caller from the GraphML contents. - * @param evt The event argument that is used like in - * {@link #addQueryInputHandlersListener QueryInputHandlers} - * @returns The specific input handler to use. - * @abstract - */ - createInputHandler(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,evt:yfiles.graphml.QueryInputHandlersEventArgs):yfiles.graphml.IInputHandler; - } - var IGenericInputHandlerFactory:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graphml.IGenericInputHandlerFactory; - }; - /** - * - * @class - */ - export interface GraphMLSupport extends yfiles.lang.Object{} - export class GraphMLSupport { - /** - * Creates a new instance of this class. - *

- * Optionally calls {@link yfiles.graphml.GraphMLSupport#registerCommands}, if graphComponent is given. - *

- * @param [graphComponent=null] The {@link } that the {@link #OPEN} and {@link #SAVE} commands are - * registered on. - */ - constructor(graphComponent?:yfiles.view.GraphComponent); - /** - * Creates a new instance of this class. - *

- * Optionally calls {@link yfiles.graphml.GraphMLSupport#registerCommands}, if graphComponent is given. - *

- * @param {Object} options The parameters to pass. - * @param [options.graphComponent=null] The {@link } that the {@link #OPEN} and {@link #SAVE} commands are - * registered on. - * @param {yfiles.graphml.StorageLocation} options.storageLocation A value indicating the type of storage used by the commands Open/Save/Save As. - *

- * This option sets the {@link yfiles.graphml.GraphMLSupport#storageLocation} property on the created object. - *

- * @param {yfiles.graphml.GraphMLIOHandler} options.graphMLIOHandler The {@link yfiles.graphml.GraphMLSupport#graphMLIOHandler} to use for the various I/O methods in this instance. - *

- * This option sets the {@link yfiles.graphml.GraphMLSupport#graphMLIOHandler} property on the created object. - *

- */ - constructor(options:{graphComponent?:yfiles.view.GraphComponent,storageLocation?:yfiles.graphml.StorageLocation,graphMLIOHandler?:yfiles.graphml.GraphMLIOHandler}); - /** - * Helper callback method that creates the {@link HTMLInputElement} for use in the handling of the {@link yfiles.input.ICommand#OPEN} - * command. - *

- * The open command that is enabled if {@link yfiles.graphml.GraphMLSupport#storageLocation} is set to a value different from {@link yfiles.graphml.StorageLocation#NONE} will use this - * method to create the input element for opening the files. - *

- * @returns The preconfigured element to use. - * @protected - */ - createOpenFileInputElement():HTMLInputElement; - /** - * Helper callback method that creates the {@link HTMLElement} for use in the handling of the - * {@link yfiles.input.ICommand#SAVE}and SaveAs commands. - *

- * If {@link yfiles.graphml.GraphMLSupport#storageLocation} is set to {@link yfiles.graphml.StorageLocation#FILE_SYSTEM} but saving to a file is not supported by the user's browser, - * this method is called to create the element to which the GraphML content is appended. - *

- * @returns The preconfigured element to use. Null if element creation failed. - * @protected - */ - createSaveFileTextElement():HTMLElement; - /** - * Gets the {@link yfiles.graphml.GraphMLSupport#graphMLIOHandler} to use for the various I/O methods in this instance. - *

- * This method will first query the {@link yfiles.graph.ILookup#lookup} of the graph, - *

- * @param graph - * @returns The instance to use for IO. - * @protected - */ - getGraphMLIOHandler(graph:yfiles.graph.IGraph):yfiles.graphml.GraphMLIOHandler; - /** - * Default implementation of {@link yfiles.input.ICommand#OPEN} that shows a {@link yfiles.graphml.GraphMLSupport#createOpenFileInputElement open file dialog} and imports the GraphML. - *

- * This method is called in response to the {@link yfiles.input.ICommand#OPEN} command if {@link yfiles.graphml.GraphMLSupport#storageLocation} is set to a value different from - * {@link yfiles.graphml.StorageLocation#NONE}. It delegates to {@link yfiles.graphml.GraphMLSupport#openFile}, then calls {@link yfiles.view.GraphComponent#fitGraphBounds} - * on the loaded graph and eventually clears the {@link yfiles.graph.UndoEngine} of the graphComponent. - *

- *

- * Any exception thrown during loading of the GraphML file will reject the promise. - *

- * @param graphComponent - * @param [storageLocation=null] - * @returns A promise that will resolve to the loaded graph instance or reject upon exceptions during loading. Note that if the file - * open dialog is cancelled by the user, the promise will stay unresolved because there is no API available that can be - * used to determine whether the user has pressed cancel. Depending on the UA implementation it may be possible to listen - * to focus or other input device events on the page to detect when the user has closed the file open dialog. - * @see yfiles.graphml.GraphMLSupport#storageLocation - * @see yfiles.graphml.GraphMLSupport#saveFile - */ - openFile(graphComponent:yfiles.view.GraphComponent,storageLocation?:yfiles.graphml.StorageLocation):Promise; - /** - * Opens an {@link yfiles.graphml.GraphMLSupport#createOpenFileInputElement open file dialog} and imports the GraphML. - *

- * Any exception thrown during loading of the GraphML file will be caught and an error message displayed to the user. For - * more control over error behaviour it is recommended to use {@link yfiles.graphml.GraphMLSupport#graphMLIOHandler} directly, e.g. from a custom command handler. - *

- * @param graph - * @param [storageLocation=null] - * @returns A promise that will resolve to the loaded graph instance or reject upon exceptions during loading. Note that if the file - * open dialog is cancelled by the user, the promise will stay unresolved because there is no API available that can be - * used to determine whether the user has pressed cancel. Depending on the UA implementation it may be possible to listen - * to focus or other input device events on the page to detect when the user has closed the file open dialog. - * @see yfiles.graphml.GraphMLSupport#storageLocation - * @see yfiles.graphml.GraphMLSupport#saveFile - */ - openFile(graph:yfiles.graph.IGraph,storageLocation?:yfiles.graphml.StorageLocation):Promise; - /** - * Registers bindings for {@link yfiles.input.ICommand#OPEN} and {@link yfiles.input.ICommand#SAVE} on the given graphComponent. - * @param graphComponent The {@link } to register the command bindings on. - */ - registerCommands(graphComponent:yfiles.view.GraphComponent):void; - /** - * Convenience method that exports the graph as GraphML and saves it to a storage location. - *

- * This method is called in response to the {@link yfiles.input.ICommand#SAVE} command if {@link yfiles.graphml.GraphMLSupport#storageLocation} is set to a value different from - * {@link yfiles.graphml.StorageLocation#NONE}. - *

- *

- * Any exception thrown during loading of the GraphML file will be caught and an error message displayed to the user. For - * more control over error behaviour it is recommended to use {@link yfiles.graphml.GraphMLSupport#graphMLIOHandler} directly, e.g. from a custom command handler. - *

- * @param graph - * @param [storageLocation=null] - * @returns A promise that will resolve to the saved string representation of the graph or reject upon exceptions during the save - * operation. - * @see yfiles.graphml.GraphMLSupport#storageLocation - * @see yfiles.graphml.GraphMLSupport#saveFile - * @see yfiles.graphml.GraphMLSupport#openFile - */ - saveFile(graph:yfiles.graph.IGraph,storageLocation?:yfiles.graphml.StorageLocation):Promise; - /** - * Gets or sets the {@link yfiles.graphml.GraphMLSupport#graphMLIOHandler} to use for the various I/O methods in this instance. - * @type {yfiles.graphml.GraphMLIOHandler} - */ - graphMLIOHandler:yfiles.graphml.GraphMLIOHandler; - /** - * Gets or sets a value indicating the type of storage used by the commands Open/Save/Save As. - *

- * By default this feature is set to {@link yfiles.graphml.StorageLocation#NONE}. - *

- *

- * This property specifies the storage type of the following commands: - *

- *
    - *
  • {@link yfiles.input.ICommand#OPEN GraphCommands.Open}
  • - *
  • {@link yfiles.input.ICommand#SAVE GraphCommands.Save}
  • - *
  • GraphCommands.SaveAs
  • - *
- *

- * Note that this doesn't affect the convenience methods ImportFromGraphML(string,EventHandler), - * ExportToGraphML(TextWriter) and their variants. - *

- *

- * The default implementations delegate to OpenFile, {@link yfiles.graphml.GraphMLSupport#saveFile} and {@link yfiles.graphml.GraphMLSupport#saveFile} - * methods respectively. - *

- * @see yfiles.graphml.GraphMLSupport#createOpenFileInputElement - * @see yfiles.graphml.GraphMLSupport#createSaveFileTextElement - * @see yfiles.graphml.GraphMLSupport#saveFile - * @see yfiles.graphml.GraphMLSupport#saveFile - * @type {yfiles.graphml.StorageLocation} - */ - storageLocation:yfiles.graphml.StorageLocation; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.GraphMLSupport; - } - export enum StorageLocation{ - /** - * No location at all, effectively disabling storage operations. - */ - NONE, - /** - * The local storage as described by the W3C Web Storage API. - */ - LOCAL_STORAGE, - /** - * The session storage as described by the W3C Web Storage API. - */ - SESSION_STORAGE, - /** - * The file system. - *

- * Opening a file from the file system works in all supported browsers. Saving a file is supported in Firefox 28+, Chrome - * 38+, Opera 25+, IE 10+, recent versions of the related mobile browsers and Android Browser 4.4.4. If saving to a file is - * not supported, the file contents is shown in a new browser window instead. - *

- */ - FILE_SYSTEM - } - /** - * An implementation of {@link yfiles.graphml.IParseContext} that delegates most calls to a {@link yfiles.graphml.ChildParseContext#parentContext}, but adds the capability to locally - * add {@link yfiles.graphml.ChildParseContext#lookup} results and {@link yfiles.graphml.ChildParseContext#getDeserializationProperty deserialization properties} - *

- * Whenever it is necessary to locally modify some context properties, a new instance of this class should be created that - * wraps an existing one. - *

- * @see yfiles.graphml.ChildParseContext#setDeserializationProperty - * @see yfiles.graphml.ChildParseContext#setLookup - * @class - * @implements {yfiles.graphml.IParseContext} - */ - export interface ChildParseContext extends yfiles.lang.Object,yfiles.graphml.IParseContext{} - export class ChildParseContext { - /** - * Initializes a new instance of the {@link yfiles.graphml.ChildParseContext} class that delegates to the provided context and adds - * the currentObject to the {@link yfiles.graphml.ChildParseContext#objectStack}. - * @param parentContext The parent context. - * @param currentObject The current object to add to the {@link #objectStack} and return in {@link #getCurrent}. - */ - constructor(parentContext:yfiles.graphml.IParseContext,currentObject:any); - /** - * Initializes a new instance of the {@link yfiles.graphml.ChildParseContext} class that delegates to the provided context. - * @param parentContext The parent context. - */ - constructor(parentContext:yfiles.graphml.IParseContext); - /** - * - * Type parameter T. - * @param targetType - * @param context - * @param targetNode - * @returns - * @template T - */ - deserializeCore(targetType:yfiles.lang.Class,context:yfiles.graphml.IParseContext,targetNode:Node):T; - /** - * - * Type parameter T. - * @param itemType - * @returns - * @template T - */ - getCurrent(itemType:yfiles.lang.Class):T; - /** - * - * @param key - * @returns - */ - getDeserializationProperty(key:string):any; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * Removes a previously locally {@link yfiles.graphml.ChildParseContext#setDeserializationProperty set} deserialization property. - * @param key The key for which the local property override should be removed. - */ - removeDeserializationProperty(key:string):void; - /** - * Removes a local lookup override that has been added using {@link yfiles.graphml.ChildParseContext#setLookup} - * Type parameter T: The type key to remove. - * @param tType The type key to remove. - * @template T - */ - removeLookup(tType:yfiles.lang.Class):void; - /** - * Sets the local deserialization property for the given key to the value. - * @param key The key to override. - * @param value The value. - */ - setDeserializationProperty(key:string,value:any):void; - /** - * Adds another lookup result to the local lookup override. - * Type parameter T: The type to use as a key for the lookup. - * @param tType The type to use as a key for the lookup. - * @param value The value to provide for queries to T. - * @see yfiles.graphml.ChildParseContext#removeLookup - * @template T - */ - setLookup(tType:yfiles.lang.Class,value:T):void; - /** - * Gets the parent context. - * @type {yfiles.graphml.IParseContext} - */ - parentContext:yfiles.graphml.IParseContext; - /** - * - * @type {yfiles.collections.IListEnumerable.} - */ - objectStack:yfiles.collections.IListEnumerable; - /** - * - * @type {yfiles.graphml.IParseEvents} - */ - parseEvents:yfiles.graphml.IParseEvents; - /** - * - * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.ChildParseContext; - } - /** - * A simple mutable implementation of {@link yfiles.collections.IMapper.} that is typed for {@link any} keys and values. - *

- * This class is used by the {@link yfiles.graphml.GraphMLParser} to store properties of an item before it has been created. An - * instance of this class can be found in the {@link yfiles.graph.ILookup#lookup} of the {@link yfiles.graphml.IParseContext} during the - * parsing of an item. Custom parsers may populate the dictionary with various properties that can then be used by the {@link yfiles.graphml.IGraphElementFactory} - * during the creation of the item. - *

- * @see yfiles.graphml.IGraphElementFactory - * @see yfiles.graphml.GraphMLParser - * @class - * @implements {yfiles.collections.IMapper.} - */ - export interface CreationProperties extends yfiles.lang.Object,yfiles.collections.IMapper{} - export class CreationProperties { - constructor(); - /** - * Clears all entries from this property store. - */ - clear():void; - /** - * Gets the value associated with the specified key. - * @param key The key. - * @returns The value stored for the key. - * @see yfiles.graphml.CreationProperties#set - */ - get(key:any):any; - /** - * Removes the associated entry for the given key - * @param key The entry key to remove. - */ - removeValue(key:any):void; - /** - * Sets the value associated with the specified key. - * @param key The key. - * @param value The value stored for the key. - * @see yfiles.graphml.CreationProperties#get - */ - set(key:any,value:any):void; - /** - * Creation property key that tags group node information. - *

- * Stores values of type {@link boolean}. - *

- * @see yfiles.graphml.IGraphElementFactory#createNode - * @const - * @static - * @type {string} - */ - static IS_GROUP_NODE:string; - /** - * Creation property key that tags label information. - *

- * Stores values of type {@link yfiles.collections.IEnumerable.} with {@link yfiles.graph.ILabel} template instances. - *

- * @see yfiles.graphml.IGraphElementFactory - * @const - * @static - * @type {string} - */ - static LABELS:string; - /** - * Creation property key that tags node layout information. - *

- * Stores values of type {@link yfiles.geometry.Rect}. - *

- * @see yfiles.graphml.IGraphElementFactory#createNode - * @const - * @static - * @type {string} - */ - static LAYOUT:string; - /** - * Creation property key that tags style information. - *

- * Stores values of type {@link yfiles.styles.INodeStyle}, {@link yfiles.styles.IEdgeStyle}, and {@link yfiles.styles.IPortStyle} respectively. - *

- * @see yfiles.graphml.IGraphElementFactory - * @const - * @static - * @type {string} - */ - static STYLE:string; - /** - * Creation property key that tags {@link yfiles.graph.ITagOwner#tag tag} object information. - *

- * Stores values of type {@link any}. - *

- * @see yfiles.graphml.IGraphElementFactory - * @const - * @static - * @type {string} - */ - static TAG:string; - /** - * Creation property key that tags bend information. - *

- * Stores values of type {@link yfiles.collections.IEnumerable.} with {@link yfiles.graph.IBend} template instances. - *

- * @see yfiles.graphml.IGraphElementFactory#createEdge - * @const - * @static - * @type {string} - */ - static BENDS:string; - /** - * Creation property key that tags {@link yfiles.graph.IPortLocationModelParameter port location} information. - *

- * Stores values of type {@link yfiles.graph.IPortLocationModelParameter}. - *

- * @see yfiles.graphml.IGraphElementFactory#addPort - * @const - * @static - * @type {string} - */ - static PORT_LOCATION_MODEL_PARAMETER:string; - /** - * Gets all the entries stored by this instance. - * @type {yfiles.collections.IEnumerable.>} - */ - entries:yfiles.collections.IEnumerable>; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.CreationProperties; - } - /** - * Core parser class for GraphML. - *

- * This class allows for low-level customization of the parsing process. Usually, it is used by one of - * {@link yfiles.graphml.GraphMLIOHandler}'s readFrom methods which calls one of the various GraphMLParser.parseFrom method - * variants. It should rarely be necessary to use this class directly. - *

- * @see yfiles.graphml.GraphMLIOHandler - * @class - */ - export interface GraphMLParser extends yfiles.lang.Object{} - export class GraphMLParser { - constructor(); - /** - * Create the initial {@link yfiles.graphml.IParseContext} instance. - * @param graph The graph that is parsed. - * @returns An {@link } instance that is suitable for graph. - * @protected - */ - createParseContext(graph:yfiles.graph.IGraph):yfiles.graphml.IParseContext; - /** - * Deserialize the content of element. - *

- * Typically, this method is called only indirectly by calls to {@link yfiles.graphml.IParseContext#deserializeCore}. This - * implementation calls {@link yfiles.graphml.GraphMLParser#onHandleDeserialization}, which in turn raises the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} - * event. - *

- * Type parameter T: The desired type of the result. - * @param targetType The desired type of the result. - * @param context The current parse context. - * @param element The XML content that should be deserialized. - * @returns An instance of T that is represented by element. - * @see yfiles.graphml.IParseContext#deserializeCore - * @see yfiles.graphml.GraphMLParser#addHandleDeserializationListener - * @template T - */ - deserialize(targetType:yfiles.lang.Class,context:yfiles.graphml.IParseContext,element:Node):T; - /** - * Retrieve a deserialization property that has been set by {@link yfiles.graphml.GraphMLParser#setDeserializationProperty}. - * @param key The key for the property. - * @returns - * @see yfiles.graphml.IParseContext#getDeserializationProperty - */ - getDeserializationProperty(key:string):any; - /** - * Dynamically retrieve all {@link yfiles.graphml.IInputHandler} instances that process a GraphML attribute with key definition - * keyDefinition. - *

- * Typically, this method is called only indirectly by the parse process. This implementation calls - * {@link yfiles.graphml.GraphMLParser#onQueryInputHandlers}, which in turn raises the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} - * event. - *

- * @param context The current parse context. - * @param keyDefinition The key definition element of the GraphML attribute. - * @returns A list of {@link IInputHandlers} that claim to be responsible for handling the given GraphML attribute. - */ - getInputHandlers(context:yfiles.graphml.IParseContext,keyDefinition:Element):yfiles.collections.IList; - /** - * Dynamically retrieve an instance of type. - * @param type The type for which an implementation is needed. - * @returns An implementation of type, or null. - */ - lookup(type:yfiles.lang.Class):any; - /** - * Fires the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} event. - * @param evt The arguments that get passed to the {@link #addHandleDeserializationListener HandleDeserialization} - * event. - * @see yfiles.graphml.GraphMLIOHandler#onHandleDeserialization - * @protected - */ - onHandleDeserialization(evt:yfiles.graphml.HandleDeserializationEventArgs):void; - /** - * Raises the {@link yfiles.graphml.GraphMLParser#addParsedListener Parsed} event. - *

- * This method is called when the document has been parsed and after {@link yfiles.graphml.IParseEvents#addDocumentParsedListener DocumentParsed} - * is called. - *

- * @param evt The {@link } instance containing the event data. - * @see yfiles.graphml.GraphMLParser#addParsedListener - * @protected - */ - onParsed(evt:yfiles.graphml.ParseEventArgs):void; - /** - * Raises the {@link yfiles.graphml.GraphMLParser#addParsingListener Parsing} event. - *

- * This method is called just before the parsing starts and before {@link yfiles.graphml.IParseEvents#addDocumentParsingListener DocumentParsing} - * is called. - *

- * @param evt The {@link } instance containing the event data. - * @see yfiles.graphml.GraphMLParser#addParsingListener - * @protected - */ - onParsing(evt:yfiles.graphml.ParseEventArgs):void; - /** - * Fires the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} event. - * @param evt The arguments that get passed to the {@link #addQueryInputHandlersListener QueryInputHandlers} - * event. - * @see yfiles.graphml.GraphMLIOHandler#onQueryInputHandlers - * @protected - */ - onQueryInputHandlers(evt:yfiles.graphml.QueryInputHandlersEventArgs):void; - /** - * Parse the XML document document into an graph instance, using elementFactory to create the elements. - *

- * Typically, this method is called indirectly from {@link yfiles.graphml.GraphMLIOHandler#readFromDocument}. - *

- * @param document The XML document instance to parse. Note: If you are using Internet Explorer 9 and {@link }s to retrieve the document, - * you may not use the value from the {@link #responseXML} property. Please parse {@link #responseText} instead - * and use the result. For further reference see {@link http://msdn.microsoft.com/en-us/library/ie/hh180177.aspx}. - * @param graph The graph instance that is populated. - * @param elementFactory The {@link } instance that is used to create the elements. - * @returns - * @see yfiles.graphml.GraphMLIOHandler#readFromDocument - */ - parseFromDocument(graph:yfiles.graph.IGraph,document:Document,elementFactory:yfiles.graphml.IGraphElementFactory):Promise; - /** - * Parse the input url into an graph instance, using elementFactory to create the elements. - *

- * Typically, this method is called indirectly from {@link yfiles.graphml.GraphMLIOHandler#readFromURL}. - *

- * @param url The URL to the input to parse. - * @param graph The graph instance that is populated. - * @param elementFactory The {@link } instance that is used to create the elements. - * @returns - * @see yfiles.graphml.GraphMLIOHandler#readFromGraphMLText - */ - parseFromURL(graph:yfiles.graph.IGraph,url:string,elementFactory:yfiles.graphml.IGraphElementFactory):Promise; - /** - * Remove a deserialization property that has been set by {@link yfiles.graphml.GraphMLParser#setDeserializationProperty}. - * @param key The key for the property. - * @see yfiles.graphml.IParseContext#getDeserializationProperty - */ - removeDeserializationProperty(key:string):void; - /** - * Remove an implementation of T that has been set with {@link yfiles.graphml.GraphMLParser#setLookup}. - * Type parameter T. - * @param tType - * @template T - */ - removeLookup(tType:yfiles.lang.Class):void; - /** - * Set a deserialization property that allows to fine tune the parsing process. - * @param key The key for the property. - * @param value The property value. - * @see yfiles.graphml.IParseContext#getDeserializationProperty - */ - setDeserializationProperty(key:string,value:any):void; - /** - * Register an implementation of T for use with {@link yfiles.graphml.GraphMLParser#lookup}. - * Type parameter T: The type of instance. - * @param tType The type of instance. - * @param instance The implementation of T for lookup retrieval. - * @template T - */ - setLookup(tType:yfiles.lang.Class,instance:T):void; - /** - * Adds the given listener for the QueryInputHandlers event that occurs when {@link yfiles.graphml.IInputHandler}s are queried. - *

- * Subscribe to this event to dynamically register one or more {@link yfiles.graphml.IInputHandler} instance(s) for a given GraphML - * attribute key definition. - *

- *

- * The current key definition is provided by {@link yfiles.graphml.QueryInputHandlersEventArgs#keyDefinition}. If you want to register an {@link yfiles.graphml.IInputHandler} for this GraphML - * attribute, you can add the handler with {@link yfiles.graphml.QueryInputHandlersEventArgs#addInputHandler}. - *

- * @param listener The listener to add. - * @see yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener - * @see yfiles.graphml.GraphMLParser#removeQueryInputHandlersListener - */ - addQueryInputHandlersListener(listener:(sender:any,evt:yfiles.graphml.QueryInputHandlersEventArgs)=>void):void; - /** - * Removes the given listener for the QueryInputHandlers event that occurs when {@link yfiles.graphml.IInputHandler}s are queried. - *

- * Subscribe to this event to dynamically register one or more {@link yfiles.graphml.IInputHandler} instance(s) for a given GraphML - * attribute key definition. - *

- *

- * The current key definition is provided by {@link yfiles.graphml.QueryInputHandlersEventArgs#keyDefinition}. If you want to register an {@link yfiles.graphml.IInputHandler} for this GraphML - * attribute, you can add the handler with {@link yfiles.graphml.QueryInputHandlersEventArgs#addInputHandler}. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener - * @see yfiles.graphml.GraphMLParser#addQueryInputHandlersListener - */ - removeQueryInputHandlersListener(listener:(sender:any,evt:yfiles.graphml.QueryInputHandlersEventArgs)=>void):void; - /** - * Adds the given listener for the HandleDeserialization event that occurs when XML content is about to be deserialized. - *

- * Subscribe to this event to provide custom deserialization handling for XML content. - *

- *

- * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called - * earlier. - *

- *

- * The current XML content is provided by {@link yfiles.graphml.HandleDeserializationEventArgs#xmlNode}. If you want to return deserialized content, set the value of the {@link yfiles.graphml.HandleDeserializationEventArgs#result} property. - *

- * @param listener The listener to add. - * @see yfiles.graphml.GraphMLIOHandler#addHandleDeserializationListener - * @see yfiles.graphml.GraphMLParser#removeHandleDeserializationListener - */ - addHandleDeserializationListener(listener:(sender:any,evt:yfiles.graphml.HandleDeserializationEventArgs)=>void):void; - /** - * Removes the given listener for the HandleDeserialization event that occurs when XML content is about to be - * deserialized. - *

- * Subscribe to this event to provide custom deserialization handling for XML content. - *

- *

- * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called - * earlier. - *

- *

- * The current XML content is provided by {@link yfiles.graphml.HandleDeserializationEventArgs#xmlNode}. If you want to return deserialized content, set the value of the {@link yfiles.graphml.HandleDeserializationEventArgs#result} property. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.GraphMLIOHandler#addHandleDeserializationListener - * @see yfiles.graphml.GraphMLParser#addHandleDeserializationListener - */ - removeHandleDeserializationListener(listener:(sender:any,evt:yfiles.graphml.HandleDeserializationEventArgs)=>void):void; - /** - * Adds the given listener for the Parsed event that occurs when the the document has been parsed. - * @param listener The listener to add. - * @see yfiles.graphml.GraphMLParser#onParsed - * @see yfiles.graphml.GraphMLParser#removeParsedListener - */ - addParsedListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Removes the given listener for the Parsed event that occurs when the the document has been parsed. - * @param listener The listener to remove. - * @see yfiles.graphml.GraphMLParser#onParsed - * @see yfiles.graphml.GraphMLParser#addParsedListener - */ - removeParsedListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Adds the given listener for the Parsing event that occurs when the parsing of the document is just about to begin. - *

- * This event can be used to register to the fine-grained events available in the {@link yfiles.graphml.ParseEventArgs#context}'s {@link yfiles.graphml.IParseContext#parseEvents} and the configure the parsing process - * on a per parse case. - *

- * @param listener The listener to add. - * @see yfiles.graphml.GraphMLParser#onParsing - * @see yfiles.graphml.GraphMLParser#removeParsingListener - */ - addParsingListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - /** - * Removes the given listener for the Parsing event that occurs when the parsing of the document is just about to begin. - *

- * This event can be used to register to the fine-grained events available in the {@link yfiles.graphml.ParseEventArgs#context}'s {@link yfiles.graphml.IParseContext#parseEvents} and the configure the parsing process - * on a per parse case. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.GraphMLParser#onParsing - * @see yfiles.graphml.GraphMLParser#addParsingListener - */ - removeParsingListener(listener:(sender:any,evt:yfiles.graphml.ParseEventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.GraphMLParser; - } - /** - * The event arguments used by {@link yfiles.graphml.GraphMLIOHandler#addHandleDeserializationListener HandleDeserialization} - * and {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} to let registered - * deserialization code perform the deserialization. - *

- * If the event handler determines that it can deserialize the {@link yfiles.graphml.HandleDeserializationEventArgs#xmlNode}, it should place the result into the {@link yfiles.graphml.HandleDeserializationEventArgs#result} property and thus - * mark the event as {@link yfiles.graphml.HandleDeserializationEventArgs#handled}. - *

- * @class - * @extends {yfiles.lang.EventArgs} - * @final - */ - export interface HandleDeserializationEventArgs extends yfiles.lang.EventArgs{} - export class HandleDeserializationEventArgs { - /** - * Initializes a new instance of the {@link yfiles.graphml.HandleDeserializationEventArgs} class. - * @param context The context in which serialization should take place. - * @param xmlNode The XML element that contains the data to deserialize. - * @param targetType The required {@link #targetType target type} of the {@link #result}. - */ - constructor(context:yfiles.graphml.IParseContext,xmlNode:Node,targetType:yfiles.lang.Class); - /** - * Gets the type of the resulting instance that is required by the requesting deserializer or null if the target type is - * not known in advance. - * @see yfiles.graphml.IParseContext#deserializeCore - * @type {yfiles.lang.Class} - */ - targetType:yfiles.lang.Class; - /** - * Gets or sets the result of the deserialization, which is null initially. - *

- * Setting this property will automatically set the {@link yfiles.graphml.HandleDeserializationEventArgs#handled} property to true. - *

- * @throws {Stubs.Exceptions.ArgumentError} If the value is not assignable to {@link yfiles.graphml.HandleDeserializationEventArgs#targetType} - * @type {any} - */ - result:any; - /** - * Gets or sets a value indicating whether this {@link yfiles.graphml.HandleDeserializationEventArgs} is handled. - *

- * Setting this property to true indicates to the event source that the {@link yfiles.graphml.HandleDeserializationEventArgs#result} has been assigned and that the event should not be - * propagated to further listeners. - *

- * @type {boolean} - */ - handled:boolean; - /** - * Gets the context in which the {@link yfiles.graphml.HandleDeserializationEventArgs#xmlNode} shall be deserialized. - * @type {yfiles.graphml.IParseContext} - */ - context:yfiles.graphml.IParseContext; - /** - * Gets the XML node that contains the data to deserialize. - * @type {Node} - */ - xmlNode:Node; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.HandleDeserializationEventArgs; - } - /** - * This is the interface for a factory that is used for creating the constituents of an {@link yfiles.graph.IGraph} that are - * encountered during the parsing of {@link yfiles.graphml.GraphMLParser GraphML} - * @see yfiles.graphml.GraphMLIOHandler#createGraphElementFactory - * @interface - */ - export interface IGraphElementFactory extends yfiles.lang.Object{ - /** - * Adds a new port to the given {@link yfiles.graph.IPortOwner}. - * @param context The context from which the graph, the {@link }, and the {@link #objectStack} can be queried. - * @param owner The owner of the port. - * @returns A newly created port. - * @abstract - */ - addPort(context:yfiles.graphml.IParseContext,owner:yfiles.graph.IPortOwner):yfiles.graph.IPort; - /** - * Creates an edge for the given context and the provided source and target nodes or ports. - * @param context The context from which the graph, the {@link }, and the {@link #objectStack} can be queried. - * @param sourceNode The source node for the edge. - * @param sourcePort The source port for the edge, if specified, otherwise null. - * @param targetNode The target node for the edge. - * @param targetPort The target port for the edge, if specified, otherwise null. - * @returns A newly created edge. - * @abstract - */ - createEdge(context:yfiles.graphml.IParseContext,sourceNode:yfiles.graph.INode,sourcePort:yfiles.graph.IPort,targetNode:yfiles.graph.INode,targetPort:yfiles.graph.IPort):yfiles.graph.IEdge; - /** - * Creates a node for the given context. - * @param context The context from which the graph, the {@link }, and the {@link #objectStack} can be queried. - * @returns A newly created node - * @abstract - */ - createNode(context:yfiles.graphml.IParseContext):yfiles.graph.INode; - } - var IGraphElementFactory:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graphml.IGraphElementFactory; - }; - /** - * Interface for classes that can store the GraphML id attribute of GraphML core elements - * @interface - */ - export interface IGraphElementIdAcceptor extends yfiles.lang.Object{ - /** - * Store the value of the id attribute for the given edge. - * @param context The current parse context. - * @param edge The current edge element - * @param id The id of the edge's XML representation - * @abstract - */ - storeEdgeId(context:yfiles.graphml.IParseContext,edge:yfiles.graph.IEdge,id:string):void; - /** - * Store the value of the id attribute for the given graph. - * @param context The current parse context. - * @param graph The current graph element - * @param id The id of the graph's XML representation - * @abstract - */ - storeGraphId(context:yfiles.graphml.IParseContext,graph:yfiles.graph.IGraph,id:string):void; - /** - * Store the value of the id attribute for the given node. - * @param context The current parse context. - * @param node The current node element - * @param id The id of the node's XML representation - * @abstract - */ - storeNodeId(context:yfiles.graphml.IParseContext,node:yfiles.graph.INode,id:string):void; - /** - * Store the value of the id attribute for the given port. - * @param context The current parse context. - * @param port The current port element - * @param id The id of the port's XML representation - * @abstract - */ - storePortId(context:yfiles.graphml.IParseContext,port:yfiles.graph.IPort,id:string):void; - } - var IGraphElementIdAcceptor:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graphml.IGraphElementIdAcceptor; - }; - /** - * Simple implementation of {@link yfiles.graphml.IGraphElementIdAcceptor} and {@link yfiles.graphml.IGraphElementIdProvider} that stores - * all ids in {@link yfiles.collections.IMapper.} instances. - * @class - * @implements {yfiles.graphml.IGraphElementIdAcceptor} - * @implements {yfiles.graphml.IGraphElementResolver} - */ - export interface GraphElementIdAcceptor extends yfiles.lang.Object,yfiles.graphml.IGraphElementIdAcceptor,yfiles.graphml.IGraphElementResolver{} - export class GraphElementIdAcceptor { - constructor(); - /** - * Factory method to create a default implementation of {@link yfiles.graphml.IGraphElementIdProvider} that delegates to fallback - * and uses the values stored by this {@link yfiles.graphml.GraphElementIdAcceptor} instance, if possible. - * @param fallback The fallback. - * @returns - */ - createIdProvider(fallback:yfiles.graphml.IGraphElementIdProvider):yfiles.graphml.IGraphElementIdProvider; - /** - * - * @param context - * @param id - * @returns - */ - resolveEdge(context:yfiles.graphml.IParseContext,id:string):yfiles.graph.IEdge; - /** - * - * @param context - * @param id - * @returns - */ - resolveGraph(context:yfiles.graphml.IParseContext,id:string):yfiles.graph.IGraph; - /** - * - * @param context - * @param id - * @returns - */ - resolveNode(context:yfiles.graphml.IParseContext,id:string):yfiles.graph.INode; - /** - * - * @param context - * @param ownerId - * @param id - * @returns - */ - resolvePort(context:yfiles.graphml.IParseContext,ownerId:string,id:string):yfiles.graph.IPort; - /** - * - * @param context - * @param edge - * @param id - */ - storeEdgeId(context:yfiles.graphml.IParseContext,edge:yfiles.graph.IEdge,id:string):void; - /** - * - * @param context - * @param graph - * @param id - */ - storeGraphId(context:yfiles.graphml.IParseContext,graph:yfiles.graph.IGraph,id:string):void; - /** - * - * @param context - * @param node - * @param id - */ - storeNodeId(context:yfiles.graphml.IParseContext,node:yfiles.graph.INode,id:string):void; - /** - * - * @param context - * @param port - * @param id - */ - storePortId(context:yfiles.graphml.IParseContext,port:yfiles.graph.IPort,id:string):void; - /** - * Gets a mapping between all GraphML ids for <graph> elements and the corresponding {@link yfiles.graph.IGraph} instances - * @type {yfiles.collections.IMap.} - */ - graphIds:yfiles.collections.IMap; - /** - * Gets a mapping between all GraphML ids for <node> elements and the corresponding {@link yfiles.graph.INode} instances - * @type {yfiles.collections.IMap.} - */ - nodeIds:yfiles.collections.IMap; - /** - * Gets a mapping between all GraphML ids for <edge> elements and the corresponding {@link yfiles.graph.IEdge} instances - * @type {yfiles.collections.IMap.} - */ - edgeIds:yfiles.collections.IMap; - /** - * Gets a mapping between all GraphML ids for <port> elements and the corresponding {@link yfiles.graph.IPort} instances - * @type {yfiles.collections.IMap.} - */ - portIds:yfiles.collections.IMap; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.GraphElementIdAcceptor; - } - /** - * Interface for classes can resolve graph elements based on their GraphML id attribute(s). - * @interface - */ - export interface IGraphElementResolver extends yfiles.lang.Object{ - /** - * Resolve the GraphML id to an {@link yfiles.graph.IEdge} instance. - * @param context The current parse context. - * @param id The id that should be resolved. - * @returns The {@link } that is defined by this GraphML id, or null if no such edge exists yet. - * @abstract - */ - resolveEdge(context:yfiles.graphml.IParseContext,id:string):yfiles.graph.IEdge; - /** - * Resolve the GraphML id to an {@link yfiles.graph.IGraph} instance. - * @param context The current parse context. - * @param id The id that should be resolved. - * @returns The {@link } that is defined by this GraphML id, or null if no such graph exists yet. - * @abstract - */ - resolveGraph(context:yfiles.graphml.IParseContext,id:string):yfiles.graph.IGraph; - /** - * Resolve the GraphML id to an {@link yfiles.graph.INode} instance. - * @param context The current parse context. - * @param id The id that should be resolved. - * @returns The {@link } that is defined by this GraphML id, or null if no such node exists yet. - * @abstract - */ - resolveNode(context:yfiles.graphml.IParseContext,id:string):yfiles.graph.INode; - /** - * Resolve the GraphML id to an {@link yfiles.graph.IPort} instance. - *

- * The port owner is specified by the ownerId attribute. - *

- * @param context The current parse context. - * @param ownerId The GraphML id of the port owner. - * @param id The id that should be resolved. - * @returns The {@link } that is defined by the GraphML ids, or null if no such port exists yet. - * @abstract - */ - resolvePort(context:yfiles.graphml.IParseContext,ownerId:string,id:string):yfiles.graph.IPort; - } - var IGraphElementResolver:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graphml.IGraphElementResolver; - }; - /** - * This class defines a handler for key/data elements. - * @interface - */ - export interface IInputHandler extends yfiles.lang.Object{ - /** - * This method is invoked when no data tag is defined, and the default value should be applied. - * @param context the current parse context. - * @abstract - */ - applyDefault(context:yfiles.graphml.IParseContext):void; - /** - * This method is invoked each time a data element with matching key is processed. - * @param context the current parse context. - * @param node the DOM node representing the data element. - * @abstract - */ - parseData(context:yfiles.graphml.IParseContext,node:Node):void; - /** - * Gets the parse precedence that is associated with this instance. - * @abstract - * @type {yfiles.graphml.ParsePrecedence} - */ - precedence:yfiles.graphml.ParsePrecedence; - } - var IInputHandler:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graphml.IInputHandler; - }; - export enum ParsePrecedence{ - /** - * The data is parsed as early as possible. - */ - FIRST, - /** - * The data is parsed before its owner GraphML element. - */ - BEFORE_OWNER, - /** - * The data is parsed after its owner GraphML element, but before any non-data child content. - */ - BEFORE_CHILDREN, - /** - * Default parse priority. - */ - DEFAULT, - /** - * The data is parsed after any non-data child content, but before parsing the owner GraphML element is finished. - */ - AFTER_CHILDREN, - /** - * The data is parsed directly after parsing the owner GraphML element is finished. - */ - AFTER_OWNER, - /** - * The data is parsed as late as possible. - */ - LAST - } - /** - * An abstract convenience implementation of the {@link yfiles.graphml.IInputHandler} interface. - * Type parameter TKey: The type of the key, i.e. the items that are associated with the data in the GraphML. - * Type parameter TData: The type of the data that is associated with the keys. - * @class - * @implements {yfiles.graphml.IInputHandler} - * @template TKey,TData - */ - export interface InputHandlerBase extends yfiles.lang.Object,yfiles.graphml.IInputHandler{} - export class InputHandlerBase { - /** - * Initializes a new instance of the {@link yfiles.graphml.InputHandlerBase.} class. - *

- * The {@link yfiles.graphml.InputHandlerBase.#precedence} gets the initial value assigned to precedence - *

- * @param keyType The type of the key, i.e. the items that are associated with the data in the GraphML. - * @param dataType The type of the data that is associated with the keys. - * @param precedence The precedence to assign to the {@link #precedence} property. - * @protected - */ - constructor(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,precedence:yfiles.graphml.ParsePrecedence); - /** - * Initializes a new instance of the {@link yfiles.graphml.InputHandlerBase.} class. - *

- * The {@link yfiles.graphml.InputHandlerBase.#precedence} has an initial value of {@link yfiles.graphml.ParsePrecedence#DEFAULT}. - *

- * @param keyType The type of the key, i.e. the items that are associated with the data in the GraphML. - * @param dataType The type of the data that is associated with the keys. - * @protected - */ - constructor(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class); - /** - * This method is invoked when no data tag is defined, and the default value should be applied. - *

- * This implementation delegates to {@link yfiles.graphml.InputHandlerBase.#setValue} if {@link yfiles.graphml.InputHandlerBase.#defaultExists a default exists} using the {@link yfiles.graphml.InputHandlerBase.#defaultValue}. - *

- * @param context the current parse context. - */ - applyDefault(context:yfiles.graphml.IParseContext):void; - /** - * Initializes this instance from the GraphML key definition. - *

- * This implementation looks for the GraphML default element and delegates to {@link yfiles.graphml.InputHandlerBase.#parseDataCore} if a default is found to store - * the {@link yfiles.graphml.InputHandlerBase.#defaultValue}. - *

- * @param context The context. - * @param definition The definition. - */ - initializeFromKeyDefinition(context:yfiles.graphml.IParseContext,definition:Element):void; - /** - * This method is invoked each time a data element with matching key is processed. - *

- * If the {@link yfiles.graphml.IParseContext#getCurrent current element} is of the same type as this TKey, this method delegates the actual parsing to {@link yfiles.graphml.InputHandlerBase.#parseDataCore} and - * {@link yfiles.graphml.InputHandlerBase.#setValue} - *

- * @param context the current parse context. - * @param node the DOM node representing the data element. - */ - parseData(context:yfiles.graphml.IParseContext,node:Node):void; - /** - * Abstract method callback that actually parses the data. - * @param context The context. - * @param node The node that contains the data. This is either the GraphML 'data' element or the 'default' element. - * @returns The parsed data. - * @protected - * @abstract - */ - parseDataCore(context:yfiles.graphml.IParseContext,node:Node):TData; - /** - * Abstract method callback that actually stores the value with the keys. - * @param context The context. - * @param key The key. - * @param data The data. - * @protected - * @abstract - */ - setValue(context:yfiles.graphml.IParseContext,key:TKey,data:TData):void; - /** - * Gets or sets a value indicating whether the default value in the key definition should be parsed. - * @type {boolean} - */ - parseDefaultValue:boolean; - /** - * Gets or sets the default value that will be applied to the keys where the data attribute is missing. - *

- * If any default value is set (including null), {@link yfiles.graphml.InputHandlerBase.#defaultExists} is automatically set to true. - *

- * @type {TData} - */ - defaultValue:TData; - /** - * Gets a value indicating whether a default value has been set, either through a key definition element or explicitly by - * assigning a value to the {@link yfiles.graphml.InputHandlerBase.#defaultValue} property. - *

- * If this property is set to true, the {@link yfiles.graphml.InputHandlerBase.#applyDefault} method will call the {@link yfiles.graphml.InputHandlerBase.#setValue} method using the {@link yfiles.graphml.InputHandlerBase.#defaultValue} as the value - * parameter. - *

- * @type {boolean} - */ - defaultExists:boolean; - /** - * Gets or sets the parse precedence that is associated with this handler. - * @type {yfiles.graphml.ParsePrecedence} - */ - precedence:yfiles.graphml.ParsePrecedence; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.InputHandlerBase; - } - /** - * An {@link yfiles.graphml.IInputHandler} implementation that uses an {@link yfiles.collections.IMapper.} instance to associate the values with the keys. - *

- * This implementation can be provided an - * {@link yfiles.graphml.HandleDeserializationEventArgs}-handler to perform the deserialization. If no such value is provided then - * the default deserialization is performed. - *

- *

- * The parsed values are stored in a {@link yfiles.collections.IMapper.}. - *

- * Type parameter TKey: The type of the key. - * Type parameter TData: The type of the value. - * @class - * @extends {yfiles.graphml.InputHandlerBase.} - * @template TKey,TData - */ - export interface MapperInputHandler extends yfiles.graphml.InputHandlerBase{} - export class MapperInputHandler { - /** - * Initializes a new instance of the {@link yfiles.graphml.MapperInputHandler.} class that uses the event handler for deserialization and suggests the provided - * target type for the deserializer. - * @param keyType The type of the key. - * @param dataType The type of the value. - * @param deserializer - * @param [deserializerTargetType=null] - * @see yfiles.graphml.MapperInputHandler.#deserializerTargetType - * @see yfiles.graphml.MapperInputHandler.#deserializer - */ - constructor(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,deserializer:(sender:any,evt:yfiles.graphml.HandleDeserializationEventArgs)=>void,deserializerTargetType?:yfiles.lang.Class); - /** - * Initializes a new instance of the {@link yfiles.graphml.MapperInputHandler.} class that uses the {@link yfiles.graphml.IParseContext} for deserialization. - *

- * The {@link yfiles.graphml.IInputHandler#precedence} has an initial value of {@link yfiles.graphml.ParsePrecedence#DEFAULT}. - *

- * @param keyType The type of the key. - * @param dataType The type of the value. - */ - constructor(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class); - /** - * Gets the node to pass to {@link yfiles.graphml.MapperInputHandler.#deserializer} or {@link yfiles.graphml.IParseContext#deserializeCore IParseContext.Deserialize} respectively, given the 'data' or 'default' element from the - * GraphML. - *

- * This method is called by {@link yfiles.graphml.MapperInputHandler.#parseDataCore} to determine the node to pass to the deserialization mechanism. - *

- *

- * This implementation returns node iff {@link yfiles.graphml.MapperInputHandler.#useParentElementForDeserialization} is true (i.e. the 'data' or 'default' node itself), otherwise the first child of - * the node that is not a comment or processing instruction. - *

- * @param context The context within which the node is parsed. - * @param node The 'data' or 'default' node. - * @returns The node that should be deserialized. - * @see yfiles.graphml.MapperInputHandler.#useParentElementForDeserialization - * @protected - */ - getDeserializationXmlNode(context:yfiles.graphml.IParseContext,node:Node):Node; - /** - * Gets or sets the mapper to use for storing the data. - * @type {yfiles.collections.IMapper.} - */ - mapper:yfiles.collections.IMapper; - /** - * Gets or sets a value indicating whether values that are applied via the {@link yfiles.graphml.InputHandlerBase.#applyDefault} mechanism and are equal to the - * value that is already present in the mapper will explicitly be overridden in the mapper. - * @type {boolean} - */ - overrideDefaultValue:boolean; - /** - * Gets or sets whether {@link yfiles.graphml.MapperInputHandler.#getDeserializationXmlNode} returns either the 'data'/'default' element itself or its content. - *

- * The default value is false, meaning that {@link yfiles.graphml.MapperInputHandler.#getDeserializationXmlNode} should return the content of the 'data'/'default' - * node. - *

- * @see yfiles.graphml.MapperInputHandler.#getDeserializationXmlNode - * @type {boolean} - */ - useParentElementForDeserialization:boolean; - /** - * Gets or sets the deserializer. - * @type {function(any, yfiles.graphml.HandleDeserializationEventArgs): void} - */ - deserializer:(sender:any,evt:yfiles.graphml.HandleDeserializationEventArgs)=>void; - /** - * Gets or sets the target deserialization type for the {@link yfiles.graphml.HandleDeserializationEventArgs#targetType} property. - * @type {yfiles.lang.Class} - */ - deserializerTargetType:yfiles.lang.Class; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.MapperInputHandler; - } - /** - * Specialized {@link yfiles.lang.EventArgs} that are used for dynamic {@link yfiles.graphml.IInputHandler} registration. - * @see yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener - * @see yfiles.graphml.GraphMLParser#addQueryInputHandlersListener - * @class - * @extends {yfiles.lang.EventArgs} - * @final - */ - export interface QueryInputHandlersEventArgs extends yfiles.lang.EventArgs{} - export class QueryInputHandlersEventArgs { - /** - * Create a new instance. - * @param context The current parse context. - * @param keyDefinition The current key definition - * @param handlers Stores the registered {@link } instances. - */ - constructor(context:yfiles.graphml.IParseContext,keyDefinition:Element,handlers:yfiles.collections.IList); - /** - * Register an {@link yfiles.graphml.IInputHandler} instance for the current {@link yfiles.graphml.QueryInputHandlersEventArgs#keyDefinition}. - *

- * Calling this method automatically sets {@link yfiles.graphml.QueryInputHandlersEventArgs#handled} to true. - *

- * @param handler - */ - addInputHandler(handler:yfiles.graphml.IInputHandler):void; - /** - * Gets the key definition of the GraphML attribute. - *

- * This XML element should be queried to determine if an {@link yfiles.graphml.IInputHandler} should be registered with - * {@link yfiles.graphml.QueryInputHandlersEventArgs#addInputHandler} - *

- * @type {Element} - */ - keyDefinition:Element; - /** - * Gets or sets whether the current GraphML attribute has been processed. - *

- * This is automatically set by calling - * {@link yfiles.graphml.QueryInputHandlersEventArgs#addInputHandler}, so it should be seldom necessary to set this property - * manually. - *

- * @type {boolean} - */ - handled:boolean; - /** - * Gets the {@link yfiles.graphml.IParseContext} instance that can queried for further information. - * @type {yfiles.graphml.IParseContext} - */ - context:yfiles.graphml.IParseContext; - /** - * Gets the {@link yfiles.graphml.IInputHandler}s that have been registered on this event argument instance so far. - * @type {yfiles.collections.IEnumerable.} - */ - handlers:yfiles.collections.IEnumerable; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.QueryInputHandlersEventArgs; - } - /** - * An {@link yfiles.graphml.IWriteContext} implementation for use in the context of {@link yfiles.graphml.GraphMLWriter} that wraps a given - * instance and delegates most of the calls to it but allows for modifying {@link yfiles.graphml.ChildWriteContext#setLookup lookup} and {@link yfiles.graphml.ChildWriteContext#setSerializationProperty serialization properties}. - *

- * Whenever it is necessary to locally modify some context properties, a new instance of this class should be created that - * wraps an existing one. - *

- * @class - * @implements {yfiles.graphml.IWriteContext} - */ - export interface ChildWriteContext extends yfiles.lang.Object,yfiles.graphml.IWriteContext{} - export class ChildWriteContext { - /** - * Initializes a new instance of the {@link yfiles.graphml.ChildWriteContext} class that delegates to the provided context and - * returns the given value in {@link yfiles.graphml.ChildWriteContext#getCurrent}. - * @param parentContext The parent context to delegate calls to. - * @param currentObject The current object to return in {@link #getCurrent}. - */ - constructor(parentContext:yfiles.graphml.IWriteContext,currentObject:any); - /** - * Initializes a new instance of the {@link yfiles.graphml.ChildWriteContext} class that delegates to the given parent context. - * @param parentContext The parent context. - */ - constructor(parentContext:yfiles.graphml.IWriteContext); - /** - * - * Type parameter T. - * @param itemType - * @returns - * @template T - */ - getCurrent(itemType:yfiles.lang.Class):T; - /** - * - * @param key - * @returns - */ - getSerializationProperty(key:string):any; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * Removes a local lookup override that has been added using {@link yfiles.graphml.ChildWriteContext#setLookup} - * Type parameter T: The type key to remove. - * @param tType The type key to remove. - * @template T - */ - removeLookup(tType:yfiles.lang.Class):void; - /** - * Removes a previously locally {@link yfiles.graphml.ChildWriteContext#setSerializationProperty set} serialization property. - * @param key The key for which the local property override should be removed. - */ - removeSerializationProperty(key:string):void; - /** - * - * Type parameter T. - * @param targetType - * @param context - * @param item - * @template T - */ - serializeCore(targetType:yfiles.lang.Class,context:yfiles.graphml.IWriteContext,item:T):void; - /** - * Adds another lookup result to the local lookup override. - * Type parameter T: The type to use as a key for the lookup. - * @param tType The type to use as a key for the lookup. - * @param value The value to provide for queries to T. - * @see yfiles.graphml.ChildWriteContext#removeLookup - * @template T - */ - setLookup(tType:yfiles.lang.Class,value:T):void; - /** - * Sets the local serialization property for the given key to the value. - * @param key The key to override. - * @param value The value. - */ - setSerializationProperty(key:string,value:any):void; - /** - * - * @type {yfiles.collections.IListEnumerable.} - */ - objectStack:yfiles.collections.IListEnumerable; - /** - * - * @type {yfiles.graphml.IWriteEvents} - */ - writeEvents:yfiles.graphml.IWriteEvents; - /** - * Gets the parent context to which most calls are delegated. - * @type {yfiles.graphml.IWriteContext} - */ - parentContext:yfiles.graphml.IWriteContext; - /** - * Gets or sets the writer. - *

- * If a null writer is set, this implementation will delegate to the {@link yfiles.graphml.ChildWriteContext#parentContext}'s {@link yfiles.graphml.IWriteContext#writer}. - *

- * @type {yfiles.graphml.IXmlWriter} - */ - writer:yfiles.graphml.IXmlWriter; - /** - * - * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.ChildWriteContext; - } - /** - * Core writer class for GraphML. - *

- * This class allows for low-level customization of the writing process. Usually, it is used by - * {@link yfiles.graphml.GraphMLIOHandler}'s write method which calls - * GraphMLWriter.write. It should rarely be necessary to use this class directly. - *

- * @see yfiles.graphml.GraphMLIOHandler - * @class - */ - export interface GraphMLWriter extends yfiles.lang.Object{} - export class GraphMLWriter { - constructor(); - /** - * Create the initial {@link yfiles.graphml.IWriteContext} instance. - * @param graph The graph that is written. - * @param writer The core {@link } instance that does the actual writing of XML content. - * @returns An {@link } instance that is suitable for graph. - * @protected - */ - createWriteContext(graph:yfiles.graph.IGraph,writer:yfiles.graphml.IXmlWriter):yfiles.graphml.IWriteContext; - /** - * Dynamically retrieve all {@link yfiles.graphml.IOutputHandler} that should be used for the current write process. - *

- * Typically, this method is called only indirectly by the write process. This implementation calls - * {@link yfiles.graphml.GraphMLWriter#onQueryOutputHandlers}, which in turn raises the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} - * event. - *

- * @param context The current write context. - * @param scope The scope to get output handlers for. - * @returns A dictionary from handler definition ids to {@link IOutputHandlers}. - */ - getOutputHandlers(context:yfiles.graphml.IWriteContext,scope:yfiles.graphml.KeyScope):yfiles.collections.IEnumerable; - /** - * Retrieve a serialization property that has been set by {@link yfiles.graphml.GraphMLWriter#setSerializationProperty}. - * @param key The key for the property. - * @returns - * @see yfiles.graphml.IWriteContext#getSerializationProperty - */ - getSerializationProperty(key:string):any; - /** - * Dynamically retrieve an instance of type. - * @param type The type for which an implementation is needed. - * @returns An implementation of type, or null. - * @protected - */ - lookup(type:yfiles.lang.Class):any; - /** - * Fires the {@link yfiles.graphml.GraphMLWriter#addHandleSerializationListener HandleSerialization} event. - * @param evt The arguments that get passed to the {@link #addHandleSerializationListener HandleSerialization} - * event. - * @see yfiles.graphml.GraphMLIOHandler#onHandleSerialization - * @protected - */ - onHandleSerialization(evt:yfiles.graphml.HandleSerializationEventArgs):void; - /** - * Fires the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} event. - * @param evt The arguments that get passed to the {@link #addQueryOutputHandlersListener QueryOutputHandlers} - * event. - * @see yfiles.graphml.GraphMLIOHandler#onQueryOutputHandlers - * @protected - */ - onQueryOutputHandlers(evt:yfiles.graphml.QueryOutputHandlersEventArgs):void; - /** - * Fires the {@link yfiles.graphml.GraphMLWriter#addQueryReferenceIdListener QueryReferenceId} event. - * @param evt The arguments that get passed to the {@link #addQueryReferenceIdListener QueryReferenceId} - * event. - * @see yfiles.graphml.GraphMLIOHandler#onQueryReferenceId - * @protected - */ - onQueryReferenceId(evt:yfiles.graphml.QueryReferenceIdEventArgs):void; - /** - * Raises the {@link yfiles.graphml.GraphMLWriter#addWritingListener Writing} event. - *

- * This method is called just before the writing starts and before {@link yfiles.graphml.IWriteEvents#addDocumentWritingListener DocumentWriting} - * is called for the first time. - *

- * @param evt The {@link } instance containing the event data. - * @see yfiles.graphml.GraphMLWriter#addWritingListener - * @protected - */ - onWriting(evt:yfiles.graphml.WriteEventArgs):void; - /** - * Raises the {@link yfiles.graphml.GraphMLWriter#addWrittenListener Written} event. - *

- * This method is called just before the writing has been finished and after {@link yfiles.graphml.IWriteEvents#addDocumentWrittenListener DocumentWritten} - * is called for the last time. - *

- * @param evt The {@link } instance containing the event data. - * @see yfiles.graphml.GraphMLWriter#addWrittenListener - * @protected - */ - onWritten(evt:yfiles.graphml.WriteEventArgs):void; - /** - * Remove an implementation of T that has been set with {@link yfiles.graphml.GraphMLWriter#setLookup}. - * Type parameter T. - * @param tType - * @template T - */ - removeLookup(tType:yfiles.lang.Class):void; - /** - * Remove a serialization property that has been set by {@link yfiles.graphml.GraphMLWriter#setSerializationProperty}. - * @param key The key for the property. - * @see yfiles.graphml.IWriteContext#getSerializationProperty - */ - removeSerializationProperty(key:string):void; - /** - * Serialize item. - *

- * Typically, this method is called only indirectly by calls to {@link yfiles.graphml.IWriteContext#serializeCore}. This - * implementation calls {@link yfiles.graphml.GraphMLWriter#onHandleSerialization}, which in turn raises the {@link yfiles.graphml.GraphMLWriter#addHandleSerializationListener HandleSerialization} - * event. - *

- * Type parameter T: The desired type of the result. - * @param targetType The desired type of the result. - * @param context The current parse context. - * @param item The object that should be serialized. - * @throws {yfiles.graphml.SerializationNotSupportedError} SerializationNotSupportedException if item cannot be serialized. - * @see yfiles.graphml.IWriteContext#serializeCore - * @see yfiles.graphml.GraphMLWriter#addHandleSerializationListener - * @protected - * @template T - */ - serialize(targetType:yfiles.lang.Class,context:yfiles.graphml.IWriteContext,item:T):void; - /** - * Register an implementation of T for use with {@link yfiles.graphml.GraphMLWriter#lookup}. - * Type parameter T: The type of instance. - * @param tType The type of instance. - * @param instance The implementation of T for lookup retrieval. - * @template T - */ - setLookup(tType:yfiles.lang.Class,instance:T):void; - /** - * Set a serialization property that allows to fine tune the write process. - * @param key The key for the property. - * @param value The property value. - * @see yfiles.graphml.IWriteContext#getSerializationProperty - */ - setSerializationProperty(key:string,value:any):void; - /** - * Write the GraphML representation of graph, using writer for the actual XML generation. - *

- * Typically, this method is called indirectly from {@link yfiles.graphml.GraphMLIOHandler#write}. - *

- * @param graph The graph instance that is populated. - * @param writer The writer that actually writes the XML content. - * @see yfiles.graphml.GraphMLIOHandler#write - */ - write(graph:yfiles.graph.IGraph,writer:yfiles.graphml.IXmlWriter):void; - /** - * Adds the given listener for the HandleSerialization event that occurs when XML content is about to be serialized. - *

- * Subscribe to this event to provide custom serialization handling for XML content. - *

- *

- * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called - * earlier. - *

- *

- * The current item is provided by {@link yfiles.graphml.HandleSerializationEventArgs#item}. - *

- * @param listener The listener to add. - * @see yfiles.graphml.GraphMLIOHandler#addHandleSerializationListener - * @see yfiles.graphml.GraphMLWriter#removeHandleSerializationListener - */ - addHandleSerializationListener(listener:(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs)=>void):void; - /** - * Removes the given listener for the HandleSerialization event that occurs when XML content is about to be serialized. - *

- * Subscribe to this event to provide custom serialization handling for XML content. - *

- *

- * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called - * earlier. - *

- *

- * The current item is provided by {@link yfiles.graphml.HandleSerializationEventArgs#item}. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.GraphMLIOHandler#addHandleSerializationListener - * @see yfiles.graphml.GraphMLWriter#addHandleSerializationListener - */ - removeHandleSerializationListener(listener:(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs)=>void):void; - /** - * Adds the given listener for the QueryOutputHandlers event that occurs when {@link yfiles.graphml.IOutputHandler}s are queried. - *

- * Subscribe to this event to dynamically register one or more {@link yfiles.graphml.IOutputHandler} instance(s) for a given - * GraphML attribute key definition. - *

- *

- * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called - * earlier. - *

- *

- * If you want to register an {@link yfiles.graphml.IOutputHandler} for this GraphML attribute, you can add the handler with - * {@link yfiles.graphml.QueryOutputHandlersEventArgs#addOutputHandler}. - *

- * @param listener The listener to add. - * @see yfiles.graphml.GraphMLIOHandler#addQueryOutputHandlersListener - * @see yfiles.graphml.GraphMLWriter#removeQueryOutputHandlersListener - */ - addQueryOutputHandlersListener(listener:(sender:any,evt:yfiles.graphml.QueryOutputHandlersEventArgs)=>void):void; - /** - * Removes the given listener for the QueryOutputHandlers event that occurs when - * {@link yfiles.graphml.IOutputHandler}s are queried. - *

- * Subscribe to this event to dynamically register one or more {@link yfiles.graphml.IOutputHandler} instance(s) for a given - * GraphML attribute key definition. - *

- *

- * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called - * earlier. - *

- *

- * If you want to register an {@link yfiles.graphml.IOutputHandler} for this GraphML attribute, you can add the handler with - * {@link yfiles.graphml.QueryOutputHandlersEventArgs#addOutputHandler}. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.GraphMLIOHandler#addQueryOutputHandlersListener - * @see yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener - */ - removeQueryOutputHandlersListener(listener:(sender:any,evt:yfiles.graphml.QueryOutputHandlersEventArgs)=>void):void; - /** - * Adds the given listener for the QueryReferenceId event that occurs when a reference is queried. - *

- * This event can be used to provide names of external references for objects. - *

- *

- * These reference targets are not serialized to the GraphML file. - *

- * @param listener The listener to add. - * @see yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener - * @see yfiles.graphml.GraphMLWriter#removeQueryReferenceIdListener - */ - addQueryReferenceIdListener(listener:(sender:any,evt:yfiles.graphml.QueryReferenceIdEventArgs)=>void):void; - /** - * Removes the given listener for the QueryReferenceId event that occurs when a reference is queried. - *

- * This event can be used to provide names of external references for objects. - *

- *

- * These reference targets are not serialized to the GraphML file. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener - * @see yfiles.graphml.GraphMLWriter#addQueryReferenceIdListener - */ - removeQueryReferenceIdListener(listener:(sender:any,evt:yfiles.graphml.QueryReferenceIdEventArgs)=>void):void; - /** - * Gets the events in the internal {@link yfiles.graphml.IWriteEvents} implementation. - *

- * You can subscribe to any of the events in the returned {@link yfiles.graphml.IWriteEvents} instance to react to various steps in - * the writing process - *

- * @type {yfiles.graphml.IWriteEvents} - */ - writeEvents:yfiles.graphml.IWriteEvents; - /** - * Adds the given listener for the Written event that occurs when the writing of a document has just been finished. - * @param listener The listener to add. - * @see yfiles.graphml.GraphMLWriter#onWritten - * @see yfiles.graphml.GraphMLWriter#removeWrittenListener - */ - addWrittenListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Removes the given listener for the Written event that occurs when the writing of a document has just been finished. - * @param listener The listener to remove. - * @see yfiles.graphml.GraphMLWriter#onWritten - * @see yfiles.graphml.GraphMLWriter#addWrittenListener - */ - removeWrittenListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Adds the given listener for the Writing event that occurs when the writing of a document is just about to begin. - *

- * This event can be used to register to the fine-grained events available in the {@link yfiles.graphml.WriteEventArgs#context}'s {@link yfiles.graphml.IWriteContext#writeEvents} and to configure the writing process - * on a per write case. - *

- * @param listener The listener to add. - * @see yfiles.graphml.GraphMLWriter#onWriting - * @see yfiles.graphml.GraphMLWriter#removeWritingListener - */ - addWritingListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - /** - * Removes the given listener for the Writing event that occurs when the writing of a document is just about to begin. - *

- * This event can be used to register to the fine-grained events available in the {@link yfiles.graphml.WriteEventArgs#context}'s {@link yfiles.graphml.IWriteContext#writeEvents} and to configure the writing process - * on a per write case. - *

- * @param listener The listener to remove. - * @see yfiles.graphml.GraphMLWriter#onWriting - * @see yfiles.graphml.GraphMLWriter#addWritingListener - */ - removeWritingListener(listener:(sender:any,evt:yfiles.graphml.WriteEventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.GraphMLWriter; - } - /** - * The event arguments used by {@link yfiles.graphml.GraphMLIOHandler#addHandleSerializationListener HandleSerialization} - * and {@link yfiles.graphml.GraphMLWriter#addHandleSerializationListener HandleSerialization} to let registered - * serialization code perform the serialization of items. - *

- * If the event handler determines that it can serialize the {@link yfiles.graphml.HandleSerializationEventArgs#item}, it should use the {@link yfiles.graphml.HandleSerializationEventArgs#writer} for output and mark the event as {@link yfiles.graphml.HandleSerializationEventArgs#handled} so that - * other code will not perform serialization, too. - *

- * @class - * @extends {yfiles.lang.EventArgs} - * @final - */ - export interface HandleSerializationEventArgs extends yfiles.lang.EventArgs{} - export class HandleSerializationEventArgs { - /** - * Initializes a new instance of the {@link yfiles.graphml.HandleSerializationEventArgs} class using the provided context to write - * the item using the given type for serialization. - * @param context The context to use for writing. - * @param item The item to to serialize. - * @param [serializationType=null] The type that should be used for serialization, which needs to be a super type or interface of the item or null. - */ - constructor(context:yfiles.graphml.IWriteContext,item:any,serializationType?:yfiles.lang.Class); - /** - * Replaces the {@link yfiles.graphml.HandleSerializationEventArgs#item} using a substitute for serialization. - *

- * This method can be used to replace the {@link yfiles.graphml.HandleSerializationEventArgs#item} and {@link yfiles.graphml.HandleSerializationEventArgs#sourceType} property so that the serialization chain can be traversed with a - * substituted item. If this method has been called the {@link yfiles.graphml.HandleSerializationEventArgs#handled} property should not be set to true. - *

- * @param item The substitute to assign to the {@link #item} property. - * @param serializationType The serialization type to assign to the {@link #sourceType} property. - */ - replaceItem(item:any,serializationType:yfiles.lang.Class):void; - /** - * Gets the item that should be serialized. - * @type {any} - */ - item:any; - /** - * Gets the type in the inheritance of the {@link yfiles.graphml.HandleSerializationEventArgs#item} that should be used for serialization. - * @type {yfiles.lang.Class} - */ - sourceType:yfiles.lang.Class; - /** - * Gets or sets a value indicating whether this {@link yfiles.graphml.HandleSerializationEventArgs} is handled. - *

- * Setting this property to true indicates to the event source that the {@link yfiles.graphml.HandleSerializationEventArgs#item} has been successfully serialized using the {@link yfiles.graphml.HandleSerializationEventArgs#writer} and no - * other code needs to handle the serialization request, anymore. - *

- * @type {boolean} - */ - handled:boolean; - /** - * Gets the context to be used for writing. - * @type {yfiles.graphml.IWriteContext} - */ - context:yfiles.graphml.IWriteContext; - /** - * Gets the writer for writing the xml output. - * @type {yfiles.graphml.IXmlWriter} - */ - writer:yfiles.graphml.IXmlWriter; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.HandleSerializationEventArgs; - } - /** - * Interface for classes that provide custom id's for core GraphML elements - * @interface - */ - export interface IGraphElementIdProvider extends yfiles.lang.Object{ - /** - * Get an ID for the specified edge object - * @param context The current write context, for further information to the provider - * @param edge The current graph object - * @returns an ID for the specified edge object - * @abstract - */ - getEdgeId(context:yfiles.graphml.IWriteContext,edge:yfiles.graph.IEdge):string; - /** - * Get an ID for the specified graph object - * @param context The current write context, for further information to the provider - * @param graph The current graph object - * @returns an ID for the specified graph object - * @abstract - */ - getGraphId(context:yfiles.graphml.IWriteContext,graph:yfiles.graph.IGraph):string; - /** - * Get an ID for the specified node object - * @param context The current write context, for further information to the provider - * @param node The current graph object - * @returns an ID for the specified graph object - * @abstract - */ - getNodeId(context:yfiles.graphml.IWriteContext,node:yfiles.graph.INode):string; - /** - * Get an ID for the specified port object - * @param context The current write context, for further information to the provider - * @param port The current port object - * @returns an ID for the specified port object - * @abstract - */ - getPortId(context:yfiles.graphml.IWriteContext,port:yfiles.graph.IPort):string; - } - var IGraphElementIdProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graphml.IGraphElementIdProvider; - }; - /** - * An implementation of the {@link yfiles.graphml.OutputHandlerBase.} class, that uses an {@link yfiles.collections.IMapper.} to retrieve the values to output for each item and a {@link yfiles.graphml.MapperOutputHandler.#serializer} callback for the - * serialization or delegates to the {@link yfiles.graphml.IWriteContext#serializeCore} callback. - * Type parameter TKey: The type of the keys. - * Type parameter TData: The type of the data. - * @class - * @extends {yfiles.graphml.OutputHandlerBase.} - * @template TKey,TData - */ - export interface MapperOutputHandler extends yfiles.graphml.OutputHandlerBase{} - export class MapperOutputHandler { - /** - * Initializes a new instance of the {@link yfiles.graphml.MapperOutputHandler.} class using the provided key scope, the name, and the key type. - * @param keyType The type of the keys. - * @param dataType The type of the data. - * @param scope The scope for the key definition attributes. - * @param name The name for the key definition attributes. - * @param type The type for the key definition attributes. - */ - constructor(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,scope:yfiles.graphml.KeyScope,name:string,type:yfiles.graphml.KeyType); - /** - * Gets or sets the mapper metadata to serialize to the key definition. - * @type {yfiles.graph.MapperMetadata} - */ - mapperMetadata:yfiles.graph.MapperMetadata; - /** - * Gets or sets the mapper to use for querying the data for each item. - * @type {yfiles.collections.IMapper.} - */ - mapper:yfiles.collections.IMapper; - /** - * Gets or sets the serialization callback to use for serializing the value in {@link yfiles.graphml.MapperOutputHandler.#writeValueCore}. - * @see yfiles.graphml.MapperOutputHandler.#sourceType - * @type {function(any, yfiles.graphml.HandleSerializationEventArgs): void} - */ - serializer:(sender:any,evt:yfiles.graphml.HandleSerializationEventArgs)=>void; - /** - * Gets or sets the source type of the serialization. - *

- * This type will be used as the {@link yfiles.graphml.HandleSerializationEventArgs#sourceType}. - *

- * @see yfiles.graphml.MapperOutputHandler.#serializer - * @see yfiles.graphml.HandleSerializationEventArgs - * @type {yfiles.lang.Class} - */ - sourceType:yfiles.lang.Class; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.MapperOutputHandler; - } - /** - * Convenience abstract base implementation of the {@link yfiles.graphml.IOutputHandler} interface. - * Type parameter TKey: The type of the keys. - * Type parameter TData: The type of the data. - * @class - * @implements {yfiles.graphml.IOutputHandler} - * @template TKey,TData - */ - export interface OutputHandlerBase extends yfiles.lang.Object,yfiles.graphml.IOutputHandler{} - export class OutputHandlerBase { - /** - * Initializes a new instance of the {@link yfiles.graphml.OutputHandlerBase.} class using the provided scope, name, and type for the key definition. - * @param keyType The type of the keys. - * @param dataType The type of the data. - * @param scope The scope. - * @param name The name to use for the key definition. - * @param type The type to use for the key definition. - * @see yfiles.graphml.OutputHandlerBase.#setKeyDefinitionUri - * @protected - */ - constructor(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,scope:yfiles.graphml.KeyScope,name:string,type:yfiles.graphml.KeyType); - /** - * Callback method that obtains the data for the given key. - * @param context The context. - * @param key The key. - * @returns The data that is associated with the key. - * @protected - * @abstract - */ - getValue(context:yfiles.graphml.IWriteContext,key:TKey):TData; - /** - * Determines whether in the current context, the value is the default value and therefore no data element needs to be - * written. - *

- * This implementation will return false if no {@link yfiles.graphml.OutputHandlerBase.#defaultExists default has been set}. Otherwise it will use {@link yfiles.graphml.OutputHandlerBase.#getValue} and compare the result - * with the {@link yfiles.graphml.OutputHandlerBase.#defaultValue} to determine whether they are equal and therefore no data needs to be written. - *

- * @param context The context. - * @returns true if for the current context the default value applies and therefore no data element needs to be written. - */ - isDefaultValue(context:yfiles.graphml.IWriteContext):boolean; - /** - * Sets the name for the key definition. - * @param name The name of the key element. - */ - setKeyDefinitionName(name:string):void; - /** - * Sets the scope for the key definition. - *

- * Note that the official GraphML schema does not support the {@link yfiles.graphml.KeyScope#GRAPHML} so this implementation will - * silently ignore this which will result in {@link yfiles.graphml.KeyScope#ALL} implicitly being defined. - *

- * @param scope The scope of the key element. - */ - setKeyDefinitionScope(scope:yfiles.graphml.KeyScope):void; - /** - * Sets the key type for the key definition. - * @param type The type of the key element. - */ - setKeyDefinitionType(type:yfiles.graphml.KeyType):void; - /** - * Sets an optional URI for the key definition. - *

- * By default, no URI is set. - *

- * @param uri The URI of the key element. - */ - setKeyDefinitionUri(uri:string):void; - /** - * Writes the contents of the key definition. - *

- * Depending on whether {@link yfiles.graphml.OutputHandlerBase.#writeKeyDefault} is enabled and {@link yfiles.graphml.OutputHandlerBase.#defaultExists} is true, this method will write the GraphML 'default' element and use {@link yfiles.graphml.OutputHandlerBase.#writeValueCore} - * to serialize the {@link yfiles.graphml.OutputHandlerBase.#defaultValue}. - *

- * @param context The context. - */ - writeKeyDefinitionContent(context:yfiles.graphml.IWriteContext):void; - /** - * Actually writes the value for the current context. - *

- * This method will use {@link yfiles.graphml.OutputHandlerBase.#getValue} to obtain the data and delegate to {@link yfiles.graphml.OutputHandlerBase.#writeValueCore} to perform the actual serialization. - *

- * @param context The context. - */ - writeValue(context:yfiles.graphml.IWriteContext):void; - /** - * Callback method that performs the actual writing of the data. - * @param context The context. - * @param data The data. - * @protected - * @abstract - */ - writeValueCore(context:yfiles.graphml.IWriteContext,data:TData):void; - /** - * Gets or sets the default value. - *

- * Setting this value also sets the {@link yfiles.graphml.OutputHandlerBase.#defaultExists} property. - *

- * @type {TData} - */ - defaultValue:TData; - /** - * Gets or sets a value indicating whether a default value has been assigned. - * @type {boolean} - */ - defaultExists:boolean; - /** - * Gets or sets the write precedence for the handler. - * @type {yfiles.graphml.WritePrecedence} - */ - precedence:yfiles.graphml.WritePrecedence; - /** - * - * @type {yfiles.collections.IEnumerable.} - */ - keyDefinitionAttributes:yfiles.collections.IEnumerable; - /** - * - * @type {yfiles.collections.IEnumerable.} - */ - dataTagAttributes:yfiles.collections.IEnumerable; - /** - * Gets or sets a value indicating whether to write the key default. - * @default true - * @type {boolean} - */ - writeKeyDefault:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.OutputHandlerBase; - } - /** - * Event argument implementation that is used by the {@link yfiles.graphml.GraphMLIOHandler#addQueryOutputHandlersListener QueryOutputHandlers} - * event. - *

- * These event arguments can be used to add more {@link yfiles.graphml.IOutputHandler} implementations to the {@link yfiles.graphml.GraphMLWriter} - * dynamically at the time of writing, by adding them to the {@link yfiles.graphml.QueryOutputHandlersEventArgs#handlers} collection. - *

- * @see yfiles.graphml.GraphMLIOHandler - * @class - * @extends {yfiles.lang.EventArgs} - * @final - */ - export interface QueryOutputHandlersEventArgs extends yfiles.lang.EventArgs{} - export class QueryOutputHandlersEventArgs { - /** - * Initializes a new instance of the {@link yfiles.graphml.QueryOutputHandlersEventArgs} class. - * @param context The context to assign to the {@link #context} property. - * @param scope The scope where the handlers should be added. - */ - constructor(context:yfiles.graphml.IWriteContext,scope:yfiles.graphml.KeyScope); - /** - * Adds the given output handler to the set of registered output handlers for the given scope. - * @param handler The handler to add. - */ - addOutputHandler(handler:yfiles.graphml.IOutputHandler):void; - /** - * Gets the scope where the handlers should be added. - * @type {yfiles.graphml.KeyScope} - */ - scope:yfiles.graphml.KeyScope; - /** - * Gets the {@link yfiles.graphml.IOutputHandler}s that have been registered on this event argument instance so far. - * @type {yfiles.collections.IEnumerable.} - */ - handlers:yfiles.collections.IEnumerable; - /** - * Gets the context for which the handlers are queried. - * @type {yfiles.graphml.IWriteContext} - */ - context:yfiles.graphml.IWriteContext; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.QueryOutputHandlersEventArgs; - } - /** - * Default implementation of {@link yfiles.graphml.IXmlWriter}. - *

- * This writer does not support random access on the output document. - *

- * @class - * @implements {yfiles.graphml.IXmlWriter} - */ - export interface XmlWriter extends yfiles.lang.Object,yfiles.graphml.IXmlWriter{} - export class XmlWriter { - /** - * Create a new instance with enabled {@link yfiles.graphml.XmlWriter#indent}. - */ - constructor(); - /** - * - * @param addEndTag - * @protected - */ - closeCurrentElement(addEndTag:boolean):void; - /** - * Factory method that creates the namespace manager for this instance. - * @returns A new manager instance. - * @protected - */ - createNamespaceManager():yfiles.graphml.IXmlNamespaceManager; - /** - * - */ - flushDocument():void; - /** - * - * @returns - */ - getXmlString():string; - /** - * - * @param prefix - * @param localName - * @param ns - * @param value - * @returns - */ - writeAttributeNS(prefix:string,localName:string,ns:string,value:string):yfiles.graphml.IXmlWriter; - /** - * - * @param content - * @returns - */ - writeCData(content:string):yfiles.graphml.IXmlWriter; - /** - * - * @param comment - * @returns - */ - writeComment(comment:string):yfiles.graphml.IXmlWriter; - /** - * - * @param fragment - * @returns - */ - writeDocumentFragment(fragment:Document):yfiles.graphml.IXmlWriter; - /** - * - */ - writeEndDocument():void; - /** - * - * @returns - */ - writeEndElement():yfiles.graphml.IXmlWriter; - /** - * - * @param target - * @param data - * @returns - */ - writeProcessingInstruction(target:string,data:string):yfiles.graphml.IXmlWriter; - /** - * - * @returns - */ - writeStartDocument():yfiles.graphml.IXmlWriter; - /** - * - * @param prefix - * @param localName - * @param ns - * @returns - */ - writeStartElement(prefix:string,localName:string,ns:string):yfiles.graphml.IXmlWriter; - /** - * - * @param localName - * @param ns - * @returns - */ - writeStartElement(localName:string,ns:string):yfiles.graphml.IXmlWriter; - /** - * - * @param s - * @returns - */ - writeString(s:string):yfiles.graphml.IXmlWriter; - /** - * This property controls whether the output should be properly indented. - * @type {boolean} - */ - indent:boolean; - /** - * Gets the namespace manager associated with this writer. - * @type {yfiles.graphml.IXmlNamespaceManager} - */ - namespaceManager:yfiles.graphml.IXmlNamespaceManager; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.XmlWriter; - } - /** - * Interface that allows a mark and identify shared resources. - * @see yfiles.graphml.IReferenceHandler - * @interface - */ - export interface IReferenceHandle extends yfiles.lang.Object{ - /** - * Gets the type of a resource (external or internal) - * @abstract - * @type {yfiles.graphml.GraphMLReferenceType} - */ - referenceType:yfiles.graphml.GraphMLReferenceType; - /** - * Gets the resource that is encapsulated by the handle. - * @abstract - * @type {any} - */ - subject:any; - /** - * Gets the id that identifies the resource in the GraphML document. - *

- * Note that this value is ignored for internal references. - *

- * @abstract - * @type {string} - */ - id:string; - } - var IReferenceHandle:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graphml.IReferenceHandle; - }; - export enum SharingState{ - /** - * The registered object shall not be shared. - */ - UNSHARED, - /** - * The object has been registered the first time. - */ - FIRST_SEEN, - /** - * The object has been registered multiple times and will be shared. - */ - DUPLICATE - } - /** - * This interface defines methods to write and configure shared sections in the resulting GraphML output - *

- * This interface provides infrastructure for both external and internal (i.e. stored in the GraphML document) references. - *

- *

- * Usually, it is not necessary to use this interface directly from client code. - *

- * @interface - */ - export interface IReferenceHandler extends yfiles.lang.Object{ - /** - * Gets the reference handle for a given subject. - * @param subject The subject. - * @param context The current write context. - * @returns A handle for the resource subject, or null if the resource is not registered. - * @see yfiles.graphml.IReferenceHandle - * @see yfiles.graphml.IReferenceHandle#subject - * @abstract - */ - getHandle(context:yfiles.graphml.IWriteContext,subject:any):yfiles.graphml.IReferenceHandle; - /** - * Unregister a shared resource. - *

- * This allows to explicitly mark a resource as unshared even if it is referenced multiple times in the object graph. If a - * resource has already been registered with {@link yfiles.graphml.IReferenceHandler#registerResource}, it will be unmarked. In - * addition, subsequent calls to {@link yfiles.graphml.IReferenceHandler#registerResource} for the same reference won't mark the - * resource as shared again. - *

- * @param context The current write context. - * @param subject The resource to register. - * @see yfiles.graphml.IReferenceHandler#registerResource - * @see yfiles.graphml.GraphMLAttribute#shareable - * @abstract - */ - markAsUnshared(context:yfiles.graphml.IWriteContext,subject:any):void; - /** - * Register a shared resource. - * @param context The current write context. - * @param subject The resource to register. - * @returns true iff the resource needs to be serialized; otherwise the resource is either a duplicate resource or is declared - * externally and does not need any additional handling. - * @abstract - */ - registerResource(context:yfiles.graphml.IWriteContext,subject:any):yfiles.graphml.SharingState; - /** - * Gets a collection of all registered reference handles that should be written to the GraphML shared data section. - * @see yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener - * @see yfiles.graphml.GraphMLWriter#addQueryReferenceIdListener - * @abstract - * @type {yfiles.collections.IEnumerable.} - */ - internalHandles:yfiles.collections.IEnumerable; - } - var IReferenceHandler:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graphml.IReferenceHandler; - }; - export enum GraphMLReferenceType{ - /** - * Specifies an internal resource, that is the serialized form of the resource is stored in the GraphML document itself. - */ - INTERNAL, - /** - * Specifies an external resource, that is the resource description is not stored in the GraphML document itself. - */ - EXTERNAL - } - /** - * Event arguments for calls to the {@link yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener ResolveReference} - * and {@link yfiles.graphml.GraphMLIOHandler#addOverrideResolveReferenceListener OverrideResolveReference} events. - * @see yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener - * @see yfiles.graphml.GraphMLIOHandler#addOverrideResolveReferenceListener - * @class - * @extends {yfiles.lang.EventArgs} - */ - export interface ResolveReferenceEventArgs extends yfiles.lang.EventArgs{} - export class ResolveReferenceEventArgs { - /** - * Creates a new instance of {@link yfiles.graphml.ResolveReferenceEventArgs}. - *

- * The {@link yfiles.graphml.ResolveReferenceEventArgs#handled} property is set to false, the {@link yfiles.graphml.ResolveReferenceEventArgs#value} property is set to null - *

- * @param context The current parse context that can be used by the event handler for additional information. - * @param referenceId The reference id that should evaluated by the event handler. - */ - constructor(context:yfiles.graphml.IParseContext,referenceId:string); - /** - * Gets the reference id that should evaluated by the event handler. - * @type {string} - */ - referenceId:string; - /** - * Gets or sets the reference value that is encapsulated by this instance. - *

- * Setting this property automatically sets {@link yfiles.graphml.ResolveReferenceEventArgs#handled} to true. - *

- * @see yfiles.graphml.ResolveReferenceEventArgs#handled - * @type {any} - */ - value:any; - /** - * Gets whether the last event handler invocation has actually handled the event. - *

- * This property is set implicitly by {@link yfiles.graphml.ResolveReferenceEventArgs#value}. - *

- * @see yfiles.graphml.ResolveReferenceEventArgs#value - * @type {boolean} - */ - handled:boolean; - /** - * Gets the current parse context that can be used by the event handler for additional information. - * @type {yfiles.graphml.IParseContext} - */ - context:yfiles.graphml.IParseContext; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.ResolveReferenceEventArgs; - } - /** - * Event arguments for calls to the {@link yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener QueryReferenceId} - * or {@link yfiles.graphml.GraphMLWriter#addQueryReferenceIdListener QueryReferenceId} events. - *

- * Event handling code should inspect the {@link yfiles.graphml.QueryReferenceIdEventArgs#value} property and decide whether to set the {@link yfiles.graphml.QueryReferenceIdEventArgs#referenceId} and/or {@link yfiles.graphml.QueryReferenceIdEventArgs#referenceType} property in order to {@link yfiles.graphml.QueryReferenceIdEventArgs#handled handle} the - * event. - *

- * @see yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener - * @see yfiles.graphml.GraphMLWriter#addQueryReferenceIdListener - * @class - * @extends {yfiles.lang.EventArgs} - */ - export interface QueryReferenceIdEventArgs extends yfiles.lang.EventArgs{} - export class QueryReferenceIdEventArgs { - /** - * Creates a new instance. - *

- * The {@link yfiles.graphml.QueryReferenceIdEventArgs#handled} property is set to false, the {@link yfiles.graphml.QueryReferenceIdEventArgs#referenceId} is set to null. - *

- * @param context The current write context that can be used by the event handler for additional information. - * @param value The referenced object instance. - */ - constructor(context:yfiles.graphml.IWriteContext,value:any); - /** - * Gets or sets the reference id that should be evaluated by the event handler. - *

- * Setting this property to a non-null string automatically sets {@link yfiles.graphml.QueryReferenceIdEventArgs#handled} to true. - *

- * @see yfiles.graphml.QueryReferenceIdEventArgs#handled - * @type {string} - */ - referenceId:string; - /** - * Gets or sets the type of the reference being queried. - *

- * Setting this property automatically sets {@link yfiles.graphml.QueryReferenceIdEventArgs#handled} to true. By default this property is {@link yfiles.graphml.GraphMLReferenceType#EXTERNAL} - * so {@link yfiles.graphml.QueryReferenceIdEventArgs#value}s that are given a {@link yfiles.graphml.QueryReferenceIdEventArgs#referenceId} are treated as external references that are not serialized to the GraphML. Setting this property - * to {@link yfiles.graphml.GraphMLReferenceType#INTERNAL} and specifying a {@link yfiles.graphml.QueryReferenceIdEventArgs#referenceId} will make the reference mechanism use the provided - * reference but will cause it to serialize the value to the GraphML, nevertheless. - *

- * @see yfiles.graphml.QueryReferenceIdEventArgs#referenceId - * @see yfiles.graphml.QueryReferenceIdEventArgs#handled - * @default yfiles.graphml.GraphMLReferenceType.EXTERNAL - * @type {yfiles.graphml.GraphMLReferenceType} - */ - referenceType:yfiles.graphml.GraphMLReferenceType; - /** - * Gets the reference value that is encapsulated by this instance. - * @type {any} - */ - value:any; - /** - * Gets whether the last event handler invocation has actually handled the event. - *

- * This property is set implicitly by {@link yfiles.graphml.QueryReferenceIdEventArgs#referenceId}. - *

- * @see yfiles.graphml.QueryReferenceIdEventArgs#referenceId - * @type {boolean} - */ - handled:boolean; - /** - * Gets the current write context that can be used by the event handler for additional information. - * @type {yfiles.graphml.IWriteContext} - */ - context:yfiles.graphml.IWriteContext; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.QueryReferenceIdEventArgs; - } - /** - * Special implementation of {@link yfiles.graphml.IValueSerializerContext} that should be used in a GraphML parse context. - * @class - * @implements {yfiles.graphml.IValueSerializerContext} - */ - export interface GraphMLParseValueSerializerContext extends yfiles.lang.Object,yfiles.graphml.IValueSerializerContext{} - export class GraphMLParseValueSerializerContext { - /** - * Creates a new instance that wraps context - * @param context The current write context - */ - constructor(context:yfiles.graphml.IParseContext); - /** - * - * @param property - * @returns - */ - getValueSerializerFor(property:yfiles.graphml.Property):yfiles.graphml.ValueSerializer; - /** - * - * @param type - * @returns - */ - getValueSerializerFor(type:yfiles.lang.Class):yfiles.graphml.ValueSerializer; - /** - * Returns the wrapped {@link yfiles.graphml.IParseContext} for this serviceType, otherwise null - * @param serviceType The serviceType - * @returns the wrapped {@link } for this serviceType, otherwise null - */ - lookup(serviceType:yfiles.lang.Class):any; - /** - * Gets or sets the parent object if such an object exists currently. - * @type {any} - */ - owner:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.GraphMLParseValueSerializerContext; - } - /** - * Special implementation of {@link yfiles.graphml.IValueSerializerContext} that should be used in a GraphML write context. - * @class - * @implements {yfiles.graphml.IValueSerializerContext} - */ - export interface GraphMLWriteValueSerializerContext extends yfiles.lang.Object,yfiles.graphml.IValueSerializerContext{} - export class GraphMLWriteValueSerializerContext { - /** - * Creates a new instance that wraps context - * @param context The current write context - */ - constructor(context:yfiles.graphml.IWriteContext); - /** - * - * @param property - * @returns - */ - getValueSerializerFor(property:yfiles.graphml.Property):yfiles.graphml.ValueSerializer; - /** - * - * @param type - * @returns - */ - getValueSerializerFor(type:yfiles.lang.Class):yfiles.graphml.ValueSerializer; - /** - * Returns the wrapped {@link yfiles.graphml.IWriteContext} for this serviceType, otherwise null - * @param serviceType The serviceType - * @returns the wrapped {@link } for this serviceType, otherwise null - */ - lookup(serviceType:yfiles.lang.Class):any; - /** - * Gets or sets the parent object if such an object exists currently. - * @type {any} - */ - owner:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.GraphMLWriteValueSerializerContext; - } - /** - * The event arguments used by {@link yfiles.graphml.GraphMLIOHandler#addQueryNameListener QueryName} to - * override automatic name determination in GraphML. - *

- * If the event handler determines that it map resolve {@link yfiles.graphml.QueryNameEventArgs#type} to a xml name, it should place the result into the {@link yfiles.graphml.QueryNameEventArgs#result} property and - * thus mark the event as {@link yfiles.graphml.QueryNameEventArgs#handled}. - *

- *

- * It is valid to provide only part of the XML name by setting the other part to null. In that case, the default name - * determination rules are used for that part. - *

- * @class - * @extends {yfiles.lang.EventArgs} - */ - export interface QueryNameEventArgs extends yfiles.lang.EventArgs{} - export class QueryNameEventArgs { - /** - * Initializes a new instance of the {@link yfiles.graphml.QueryNameEventArgs} class. - * @param context The context in which the lookup shall take place. - * @param type The type that should be mapped. - */ - constructor(context:yfiles.graphml.IWriteContext,type:yfiles.lang.Class); - /** - * Holds the result of the name query, which is null initially. - *

- * Setting this property will automatically set the {@link yfiles.graphml.QueryNameEventArgs#handled} property to true. - *

- *

- * It is valid to provide only part of the XML name by setting the other part to null. In that case, the default name - * determination rules are used for that part. - *

- * @type {yfiles.graphml.XmlName} - */ - result:yfiles.graphml.XmlName; - /** - * Gets or sets a value indicating whether this {@link yfiles.graphml.QueryNameEventArgs} is handled. - *

- * Setting this property to true indicates to the event source that the {@link yfiles.graphml.QueryNameEventArgs#result} has been assigned and that the event should not be - * propagated to further listeners. - *

- * @type {boolean} - */ - handled:boolean; - /** - * Gets the type for which the {@link yfiles.graphml.QueryNameEventArgs#result XML name} is queried. - * @type {yfiles.lang.Class} - */ - type:yfiles.lang.Class; - /** - * Gets the context in which the {@link yfiles.graphml.QueryNameEventArgs#type} shall mapped. - * @type {yfiles.graphml.IWriteContext} - */ - context:yfiles.graphml.IWriteContext; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.QueryNameEventArgs; - } - /** - * The event arguments used by {@link yfiles.graphml.GraphMLIOHandler#addQueryTypeListener QueryType} to - * override automatic type resolution in GraphML. - *

- * If the event handler determines that it can resolve {@link yfiles.graphml.QueryTypeEventArgs#xmlName} to a type, it should place the result into the {@link yfiles.graphml.QueryTypeEventArgs#result} property and thus - * mark the event as {@link yfiles.graphml.QueryTypeEventArgs#handled}. - *

- * @class - * @extends {yfiles.lang.EventArgs} - */ - export interface QueryTypeEventArgs extends yfiles.lang.EventArgs{} - export class QueryTypeEventArgs { - /** - * Initializes a new instance of the {@link yfiles.graphml.QueryTypeEventArgs} class. - * @param context The context in the lookup should take place. - * @param xName The type that should be mapped. - */ - constructor(context:yfiles.graphml.IParseContext,xName:yfiles.graphml.XmlName); - /** - * Holds the result of the type query, which is null initially. - *

- * Setting this property will automatically set the {@link yfiles.graphml.QueryTypeEventArgs#handled} property to true. - *

- * @type {yfiles.lang.Class} - */ - result:yfiles.lang.Class; - /** - * Gets or sets a value indicating whether this {@link yfiles.graphml.QueryTypeEventArgs} is handled. - *

- * Setting this property to true indicates to the event source that the {@link yfiles.graphml.QueryTypeEventArgs#result} has been assigned and that the event should not be - * propagated to further listeners. - *

- * @type {boolean} - */ - handled:boolean; - /** - * Gets the fully qualified xml name that should be resolved to a type. - * @type {yfiles.graphml.XmlName} - */ - xmlName:yfiles.graphml.XmlName; - /** - * Gets the context in which the {@link yfiles.lang.Class} shall mapped. - * @type {yfiles.graphml.IParseContext} - */ - context:yfiles.graphml.IParseContext; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.QueryTypeEventArgs; - } - /** - * An implementation that can read (a subset of) XAML formatted XML content. - * @class - * @final - */ - export interface XamlReader extends yfiles.lang.Object{} - export class XamlReader { - /** - * Deserializes the specified element node in the context to an instance. - * @param context The context. - * @param element The XML element node. - * @returns The instance that is described in the XML. - */ - deserialize(context:yfiles.graphml.IParseContext,element:Element):any; - /** - * A singleton instance of this class. - * @const - * @static - * @type {yfiles.graphml.XamlReader} - */ - static INSTANCE:yfiles.graphml.XamlReader; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.XamlReader; - } - /** - * Interface for mapping XAML namespaces to XML namespace prefixes and vice versa. - *

- * This interface is only used to specify mappings between namespaces that are used for serialization or deserialization - * with classes {@link yfiles.graphml.XamlSerializer} and - * {@link yfiles.graphml.XamlReader}. If no prefix mapping is specified for a namespace, a default XML namespace/prefix mapping is - * used. - *

- * @interface - */ - export interface IXamlPrefixMapper extends yfiles.lang.Object{ - /** - * Gets the namespace for the given prefix. - * @param prefix The prefix. - * @returns The namespace. - * @abstract - */ - getNamespaceOfPrefix(prefix:string):string; - /** - * Gets the prefix of namespace. - * @param ns The namespace. - * @returns The prefix to use. - * @abstract - */ - getPrefixOfNamespace(ns:string):string; - } - var IXamlPrefixMapper:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graphml.IXamlPrefixMapper; - }; - /** - * Serializer that produces XAML conforming output from the target object's reflection data. - *

- * By default, the resulting XAML output follows the rules for normal XAML output. In addition, serialization can be fine - * tuned by applying {@link yfiles.graphml.GraphMLAttribute} to the target object's class or some of its members. - *

- *

- * Note that usually the type should be excluded from obfuscation, or its name should be declared with - * {@link yfiles.graphml.GraphMLAttribute#name}. The same holds for specific members. - *

- * @see yfiles.graphml.GraphMLAttribute - * @class - * @final - */ - export interface XamlSerializer extends yfiles.lang.Object{} - export class XamlSerializer { - /** - * Serialize the given object to a {@link yfiles.graphml.IXmlWriter} - *

- * This implementation already provides the toplevel XML element with an appropriate tag name. - *

- * @param context The current write context - * @param subject The actual object - */ - serialize(context:yfiles.graphml.IWriteContext,subject:any):void; - /** - * A singleton instance of this class. - * @const - * @static - * @type {yfiles.graphml.XamlSerializer} - */ - static INSTANCE:yfiles.graphml.XamlSerializer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graphml.XamlSerializer; - } - }export namespace view{ - /** - * Runs {@link yfiles.view.IAnimation animations} in a {@link yfiles.view.CanvasComponent}. - *

- * For running {@link yfiles.view.IAnimation} instances the method {@link yfiles.view.Animator#animate} can be used. For simpler cases of - * custom animations there are also overloads that take an animation callback. - *

- * @see yfiles.view.IAnimation - * @class - */ - export interface Animator extends yfiles.lang.Object{} - export class Animator { - /** - * Initializes a new instance of the {@link yfiles.view.Animator} class for the given {@link yfiles.view.CanvasComponent}. - *

- * Using this constructor this instance will query an instance of {@link yfiles.input.WaitInputMode} from the {@link yfiles.view.CanvasComponent#lookup canvas's context} to - * automatically set the {@link yfiles.input.WaitInputMode#waiting} property during animations if {@link yfiles.view.Animator#allowUserInteraction} is set to false. The animation is not started until {@link yfiles.view.Animator#animate} - * or {@link yfiles.view.Animator#animate} is called. - *

- * @param canvas The canvas control. - */ - constructor(canvas:yfiles.view.CanvasComponent); - /** - * Initializes a new instance of the {@link yfiles.view.Animator} class for the given {@link yfiles.view.CanvasComponent}. - *

- * Using this constructor this instance will query an instance of {@link yfiles.input.WaitInputMode} from the {@link yfiles.view.CanvasComponent#lookup canvas's context} to - * automatically set the {@link yfiles.input.WaitInputMode#waiting} property during animations if {@link yfiles.view.Animator#allowUserInteraction} is set to false. The animation is not started until {@link yfiles.view.Animator#animate} - * or {@link yfiles.view.Animator#animate} is called. - *

- * @param {Object} options The parameters to pass. - * @param options.canvas The canvas control. - * @param {boolean} options.allowUserInteraction Whether user interaction should be allowed during the animation. - *

- * This option sets the {@link yfiles.view.Animator#allowUserInteraction} property on the created object. - *

- * @param {boolean} options.autoInvalidation A value indicating whether to automatically {@link yfiles.view.Animator#invalidateComponent invalidate the control} this instance has been created for. - *

- * This option sets the {@link yfiles.view.Animator#autoInvalidation} property on the created object. - *

- */ - constructor(options:{canvas:yfiles.view.CanvasComponent,allowUserInteraction?:boolean,autoInvalidation?:boolean}); - /** - * Animates the given animation instance and triggers the callback upon completion. - * @param animation The animation to perform. - * @returns - */ - animate(animation:yfiles.view.IAnimation):Promise; - /** - * Starts animating the given animation for the specified duration. - * @param callback The callback to use for the animation. - * @param duration The duration in milliseconds that the animation should last. - * @returns - */ - animate(callback:(time:number)=>void,duration:yfiles.lang.TimeSpan):Promise; - /** - * Stops all running animations. - */ - destroy():void; - /** - * Invalidates the control if {@link yfiles.view.Animator#autoInvalidation} is set to true. - *

- * This implementation calls {@link yfiles.view.CanvasComponent#updateVisual }. - *

- * @param canvas The control. - * @protected - */ - invalidateComponent(canvas:yfiles.view.CanvasComponent):void; - /** - * Gets or sets whether user interaction should be allowed during the animation. - *

- * If false, the {@link yfiles.input.WaitInputMode} is queried from the {@link yfiles.view.CanvasComponent} and {@link yfiles.input.WaitInputMode#waiting} is enabled during the - * animation. The default is false. - *

- * @type {boolean} - */ - allowUserInteraction:boolean; - /** - * Gets the control the animations are run on. - * @type {yfiles.view.CanvasComponent} - */ - canvasComponent:yfiles.view.CanvasComponent; - /** - * Gets or sets a value indicating whether to automatically {@link yfiles.view.Animator#invalidateComponent invalidate the control} this instance has been created for. - *

- * The default is true. - *

- * @type {boolean} - */ - autoInvalidation:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.Animator; - } - /** - * An interface for animations that can be run by {@link yfiles.view.Animator}. - *

- * Instances of classes implementing this interface change their state according to a relative animation time. The - * animation time is a double between 0 for the start of the animation and 1 for the end of the animation. - *

- *
    - *
  • An animated object is first created using the constructor of a subclass.
  • - *
  • Immediately before the animation a client calls {@link yfiles.view.IAnimation#initialize}.
  • - *
  • - * To change the state of the animated object a client does a series of calls to - * {@link yfiles.view.IAnimation#animate}, usually with an increasing relative time parameter. - *
  • - *
  • If the animation is done, the client calls {@link yfiles.view.IAnimation#cleanup} once.
  • - *
  • - * While {@link yfiles.view.IAnimation#animate} uses a relative time scheme, there might be an absolute time value for the - * preferred duration of the whole sequence of animation steps. Since an IAnimation instance has no control on the number - * of {@link yfiles.view.IAnimation#animate} calls or the intervals between them, the preferred duration is only a hint on how long - * the animation should take. Clients can ask for that hint using {@link yfiles.view.IAnimation#preferredDuration} and try to find a suitable sequence of {@link yfiles.view.IAnimation#animate} - * calls in order to fulfill the preference. - *
  • - *
- * @interface - */ - export interface IAnimation extends yfiles.lang.Object{ - /** - * Does the animation according to the relative animation time. - *

- * The animation starts with the time 0 and ends with time 1. - *

- * @param time the animation time [0,1] - * @abstract - */ - animate(time:number):void; - /** - * Cleans up after an animation has finished. - * @abstract - */ - cleanup():void; - /** - * Creates an eased animation for the given base animation. - *

- * The animation speed linearly increases upto a easeIn and linearly decreases from - * easeOut. Between those two points, the animation speed is constant. - *

- *

- * The duration of the ease in and ease out is determined by a mapping [0,1] → [0,1]. The mapping has to be increasing to - * preserve the order of the frames in the decorated animation. In general, we consider continuously differentiable - * functions f where integral of f′ equals 1 a suitable choice for the mapping. - *

- * @param [easeIn=0.5] The ratio for the ease-in time [0,1] where 0 is the start of the animation and 1 the end. 0.5 is the default value. - * @param [easeOut=0.5] The ratio for the ease-out time [0,1] where 0 is the start of the animation and 1 the end. 0.5 is the default value. - * @returns - */ - createEasedAnimation?(easeIn?:number,easeOut?:number):yfiles.view.IAnimation; - /** - * Creates an eased animation for the given base animation. - *

- * The animation speed linearly increases upto a easeIn and linearly decreases from - * easeOut. Between those two points, the animation speed is constant. - *

- *

- * The duration of the ease in and ease out is determined by a mapping [0,1] → [0,1]. The mapping has to be increasing to - * preserve the order of the frames in the decorated animation. In general, we consider continuously differentiable - * functions f where integral of f′ equals 1 a suitable choice for the mapping. - *

- * @param {Object} options The parameters to pass. - * @param [options.easeIn=0.5] The ratio for the ease-in time [0,1] where 0 is the start of the animation and 1 the end. 0.5 is the default value. - * @param [options.easeOut=0.5] The ratio for the ease-out time [0,1] where 0 is the start of the animation and 1 the end. 0.5 is the default value. - * @returns - */ - createEasedAnimation?(options:{easeIn?:number,easeOut?:number}):yfiles.view.IAnimation; - /** - * Initializes the animation. - *

- * Call this method once before subsequent calls to {@link yfiles.view.IAnimation#animate}. - *

- * @abstract - */ - initialize():void; - /** - * Gets the preferred duration of the animation. - * @abstract - * @type {yfiles.lang.TimeSpan} - */ - preferredDuration:yfiles.lang.TimeSpan; - } - var IAnimation:{ - /** - * Creates a new {@link yfiles.view.IAnimation} that animates the given edge's bends from its current shape linearly to the shape - * given by the endBends and final port locations. - *

- * The bends of the edge layout are animated from their current location to their target locations. It is assumed that the - * edge style is a polyline style and the control points are the bends accordingly. The animation works for other styles - * too, but the effect might not be as expected. The number of bends in endBends can be different to the current number of - * bends. This will result in the animation automatically removing bends at the end of the animation or inserting new bends - * accordingly at the beginning of the animation. - *

- *

- * The source and target points are also animated to new locations. However, the ports will not be moved by this animation. - * Instead a separate {@link yfiles.view.IAnimation#createPortAnimation animation for the ports} is needed to actually move - * {@link yfiles.graph.IPort}s at the ends of the edge if desired. - *

- * @param graph The graph the animated edge belongs to. - * @param edge The edge layout to animate. - * @param endBends The bend positions after the animation. - * @param endSourceLocation The absolute position of the source port after the animation. - * @param endTargetLocation The absolute position of the target port after the animation. - * @param preferredDuration The preferred duration of the animation in milliseconds. - * @returns - * @static - */ - createEdgeSegmentAnimation?(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,endBends:yfiles.geometry.IPoint[],endSourceLocation:yfiles.geometry.Point,endTargetLocation:yfiles.geometry.Point,preferredDuration:yfiles.lang.TimeSpan):yfiles.view.IAnimation; - /** - * Creates a new {@link yfiles.view.IAnimation} that animates the given layout of all types of graph items. - * @param graph The graph for which the layout should be animated. - * @param targetNodeLayouts The node layouts after the animation. - * @param targetBendLocations The bend locations after the animation, for each edge the points are interpreted as the position of the bends along the - * edge in the given order. - * @param targetLayoutParameters The label model parameters for each label after the animation. - * @param targetPortLocations The {@link }s for each {@link } in the graph that will be morphed. - * @param preferredDuration The preferred duration of the animation in milliseconds. - * @returns - * @static - */ - createGraphAnimation?(graph:yfiles.graph.IGraph,targetNodeLayouts:yfiles.collections.IMapper,targetBendLocations:yfiles.collections.IMapper,targetPortLocations:yfiles.collections.IMapper,targetLayoutParameters:yfiles.collections.IMapper,preferredDuration:yfiles.lang.TimeSpan):yfiles.view.IAnimation; - /** - * Creates a new {@link yfiles.view.IAnimation} that animates the given label from its current layout linearly to the layout given - * by the targetLayoutParameter. - *

- * This animation will as a side effect assign the targetLayoutParameter to the label at the {@link Root.IG#cleanup end of the animation}. - *

- * @param graph The graph that contains the labels. - * @param label The label to animate the parameter of. - * @param targetLayoutParameter The target parameter of the label. - * @param preferredDuration The preferred duration of the animation. - * @returns A new instance of {@link }. - * @static - */ - createLabelAnimation?(graph:yfiles.graph.IGraph,label:yfiles.graph.ILabel,targetLayoutParameter:yfiles.graph.ILabelModelParameter,preferredDuration:yfiles.lang.TimeSpan):yfiles.view.IAnimation; - /** - * Creates a new {@link yfiles.view.IAnimation} instance that animates the current graph to the layout given by a {@link yfiles.layout.CopiedLayoutGraph} - * instance. - *

- * The returned instance is suitable for morphing an {@link yfiles.graph.IGraph} to a layout computed by one of the layout - * algorithms. - *

- *

- * While it is usually recommended to use {@link yfiles.layout.LayoutExecutor} to handle layout calculation and subsequent - * animation, the {@link yfiles.view.IAnimation} produced by this method can be used manually, as well: - *

- * @param graph the graph for which the layout should be animated - * @param layoutGraph the {@link } that contains all target layout information - * @param preferredDuration the preferred duration of the animation - * @returns - * @static - */ - createLayoutAnimation?(graph:yfiles.graph.IGraph,layoutGraph:yfiles.layout.CopiedLayoutGraph,preferredDuration:yfiles.lang.TimeSpan):yfiles.view.IAnimation; - /** - * Creates a new {@link yfiles.view.IAnimation} that animates the given node from its current layout to the new given - * targetLayout. - * @param graph The graph the animated node belongs to. - * @param node The node whose {@link #layout} to animate. - * @param targetLayout The expected node layout after the animation. - * @param preferredDuration The preferred duration of the animation. - * @returns A new instance of {@link }. - * @static - */ - createNodeAnimation?(graph:yfiles.graph.IGraph,node:yfiles.graph.INode,targetLayout:yfiles.geometry.IRectangle,preferredDuration:yfiles.lang.TimeSpan):yfiles.view.IAnimation; - /** - * Creates an {@link yfiles.view.IAnimation} according to the composite design pattern that animates multiple animations in - * parallel. - *

- * The animations can be synchronized to the longest running animation. - *

- * @param animations The animations to run in parallel. - * @param [synchronized=true] Whether all child animations should be adjusted to have the same (maximum) {@link #preferredDuration}. By default this is enabled. - * @returns A new instance that is the composite of the given animations. - * @static - */ - createParallelAnimation?(animations:yfiles.collections.IEnumerable,synchronized?:boolean):yfiles.view.IAnimation; - /** - * Creates a new instance of an {@link yfiles.view.IAnimation} that animates the given {@link yfiles.geometry.IMutablePoint} along a path. - * @param path The path to animate the point along. - * @param animationPoint The mutable point instance that will be manipulated by the animation. - * @param preferredDuration The preferred duration of the animation. - * @returns - * @static - */ - createPathAnimation?(path:yfiles.geometry.GeneralPath,animationPoint:yfiles.geometry.IMutablePoint,preferredDuration:yfiles.lang.TimeSpan):yfiles.view.IAnimation; - /** - * Creates a new {@link yfiles.view.IAnimation} that animates the given port from its current location to the new location given by - * the targetLocationParameter. - *

- * This animation will as a side effect assign the targetLocationParameter to the port at the {@link Root.IG#cleanup end of the animation}. - *

- * @param graph The graph that contains the port. - * @param port The port to animate. - * @param targetLocationParameter The parameter to linearly interpolate to. - * @param preferredDuration The {@link #preferredDuration preferred duration} of this animation. - * @returns A new instance of {@link }. - * @static - */ - createPortAnimation?(graph:yfiles.graph.IGraph,port:yfiles.graph.IPort,targetLocationParameter:yfiles.graph.IPortLocationModelParameter,preferredDuration:yfiles.lang.TimeSpan):yfiles.view.IAnimation; - /** - * Creates a new {@link yfiles.view.IAnimation} for the given table that animates the table and its {@link yfiles.graph.IStripe stripes}. - *

- * Note that only the sizes of - * leaf stripes, i.e. those without child stripes, are considered. The sizes of a stripe with children is implicitly determined by its - * contents. - *

- *

- * For more control of the animation, implement a custom {@link yfiles.view.TableAnimation} and override method - * {@link yfiles.view.TableAnimation#createStripeAnimation}. - *

- * @param table The table to animate. - * @param columnLayout The sizes of the leaf columns, in natural order. - * @param rowLayout The sizes of the leaf rows, in natural order. - * @returns - * @static - */ - createTableAnimation?(table:yfiles.graph.ITable,columnLayout:number[],rowLayout:number[]):yfiles.view.IAnimation; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.view.IAnimation; - }; - /** - * Animates changing the viewport bounds and the zoom factor for a {@link yfiles.view.CanvasComponent}. - * @class - * @implements {yfiles.view.IAnimation} - */ - export interface ViewportAnimation extends yfiles.lang.Object,yfiles.view.IAnimation{} - export class ViewportAnimation { - /** - * Creates a new instance of {@link yfiles.view.ViewportAnimation}. - * @param canvas The canvas control. - * @param targetBounds The target world bounds for the animation. - * @param [preferredDuration=null] The preferred duration. 1 second if omitted. - */ - constructor(canvas:yfiles.view.CanvasComponent,targetBounds:yfiles.geometry.Rect,preferredDuration?:yfiles.lang.TimeSpan); - /** - * Creates a new instance of {@link yfiles.view.ViewportAnimation}. - * @param {Object} options The parameters to pass. - * @param options.canvas The canvas control. - * @param options.targetBounds The target world bounds for the animation. - * @param [options.preferredDuration=null] The preferred duration. 1 second if omitted. - * @param {boolean} options.considerViewportLimiter Whether to respect the {@link yfiles.view.CanvasComponent#viewportLimiter} of the {@link yfiles.view.CanvasComponent} whose {@link yfiles.view.CanvasComponent#viewport} is animated. - *

- * This option sets the {@link yfiles.view.ViewportAnimation#considerViewportLimiter} property on the created object. - *

- * @param {number} options.maximumTargetZoom The maximum zoom level to use after the animation. - *

- * This option sets the {@link yfiles.view.ViewportAnimation#maximumTargetZoom} property on the created object. - *

- */ - constructor(options:{canvas:yfiles.view.CanvasComponent,targetBounds:yfiles.geometry.Rect,preferredDuration?:yfiles.lang.TimeSpan,considerViewportLimiter?:boolean,maximumTargetZoom?:number}); - /** - * - * @param time - */ - animate(time:number):void; - /** - * Effectively applies the center point value. - * @param focus - * @protected - */ - applyCenterPoint(focus:yfiles.geometry.Point):void; - /** - * Effectively applies the view point value. - * @param focus - * @protected - */ - applyViewPoint(focus:yfiles.geometry.Point):void; - /** - * Effectively applies the zoom value. - * @param value - * @protected - */ - applyZoom(value:number):void; - /** - * Cancels this viewport animation so that subsequent calls to {@link yfiles.view.ViewportAnimation#animate} or {@link yfiles.view.ViewportAnimation#cleanup} - * won't affect the viewport anymore. - */ - cancel():void; - /** - * Cleans up after the animation. - */ - cleanup():void; - /** - * Initializes this animation. - *

- * This has to be called once before any calls to {@link yfiles.view.ViewportAnimation#animate}. An instance of {@link yfiles.view.ViewportAnimation} - * can be reused after an animation by setting new {@link yfiles.view.ViewportAnimation#targetBounds} or a new {@link yfiles.view.ViewportAnimation#preferredDuration} and calling Initialize() again. - *

- */ - initialize():void; - /** - * Gets or sets the target world bounds. - * @type {yfiles.geometry.Rect} - */ - targetBounds:yfiles.geometry.Rect; - /** - * Gets or sets whether to respect the {@link yfiles.view.CanvasComponent#viewportLimiter} of the {@link yfiles.view.CanvasComponent} whose {@link yfiles.view.CanvasComponent#viewport} is animated. - *

- * Default is false. - *

- * @type {boolean} - */ - considerViewportLimiter:boolean; - /** - * Gets or sets the preferred duration of the animation. - * @type {yfiles.lang.TimeSpan} - */ - preferredDuration:yfiles.lang.TimeSpan; - /** - * Gets or sets the maximum zoom level to use after the animation. - *

- * The default is {@link number#POSITIVE_INFINITY}. - *

- * @type {number} - */ - maximumTargetZoom:number; - /** - * Gets or sets the scroll bar visibility that will be used during the animation. - * @default yfiles.view.ScrollBarVisibility.NEVER - * @type {yfiles.view.ScrollBarVisibility} - */ - scrollBarVisibility:yfiles.view.ScrollBarVisibility; - /** - * Gets or sets the margins in view coordinate dimensions to use at the target zoom level. - * @default '0' - * @type {yfiles.geometry.Insets} - */ - targetViewMargins:yfiles.geometry.Insets; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.ViewportAnimation; - } - export enum ScrollBarVisibility{ - /** - * Never display the scroll bar, even if not all of the content is visible. - */ - NEVER, - /** - * Display the scroll bar when needed. - *

- * This is the default behavior in most applications. - *

- */ - AS_NEEDED, - /** - * Always display the scroll bar. - *

- * If it is not needed, i.e. if all content is already displaying, the scroll bar will remain visible but cannot be moved. - *

- */ - ALWAYS - } - export enum MouseButtons{ - /** - * No mouse button. - */ - NONE, - /** - * The left mouse button. - */ - LEFT, - /** - * The right mouse button. - */ - RIGHT, - /** - * The middle mouse button. - */ - MIDDLE, - /** - * Extra mouse button 1. - */ - X1, - /** - * Extra mouse button 2. - */ - X2 - } - export enum MouseWheelBehaviors{ - /** - * The mouse wheel has no effect. - */ - NONE, - /** - * The mouse wheel changes the zoom factor. - */ - ZOOM, - /** - * The mouse wheel scrolls the view. - */ - SCROLL, - /** - * Can be combined with {@link yfiles.view.MouseWheelBehaviors#ZOOM} or {@link yfiles.view.MouseWheelBehaviors#SCROLL} to perform the - * action only when the control has focus. - */ - ONLY_WHEN_FOCUSED - } - /** - * The event arguments for the event handler used by {@link yfiles.view.CanvasComponent#raisePrepareRenderContextEvent} - *

- * This event argument can be used to modify the {@link yfiles.view.PrepareRenderContextEventArgs#context} during {@link yfiles.view.CanvasComponent#exportContent} and - * {@link yfiles.view.CanvasComponent#invalidate} - *

- * @see yfiles.view.CanvasComponent#addPrepareRenderContextListener - * @class - * @extends {yfiles.lang.EventArgs} - */ - export interface PrepareRenderContextEventArgs extends yfiles.lang.EventArgs{} - export class PrepareRenderContextEventArgs { - /** - * Initializes a new instance of the {@link yfiles.view.PrepareRenderContextEventArgs} class. - * @param context The initial context which can be modified by the event handlers using the {@link #context} property. - */ - constructor(context:yfiles.view.IRenderContext); - /** - * Gets or sets the context. - * @throws {Stubs.Exceptions.ArgumentError} If the argument is null. - * @type {yfiles.view.IRenderContext} - */ - context:yfiles.view.IRenderContext; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.PrepareRenderContextEventArgs; - } - export enum SizeChangedDetectionMode{ - /** - * No size change detection. - *

- * Consequently, no {@link yfiles.view.CanvasComponent#addSizeChangedListener SizeChanged} events are fired. - *

- */ - NONE, - /** - * Size change detection based on invisible sensor elements. - *

- * This is the preferred mode since it provides - * {@link yfiles.view.CanvasComponent#addSizeChangedListener SizeChanged}events in real time. - *

- */ - SENSOR, - /** - * Timer based size change detection. - *

- * A timer periodically checks the current size with the previous one. Typically, this method is used as fall back in case - * the {@link yfiles.view.SizeChangedDetectionMode#SENSOR} mode is not available in a browser. - *

- */ - TIMER, - /** - * This is the default mode which uses the preferred {@link yfiles.view.SizeChangedDetectionMode#SENSOR} mode if possible, - * otherwise the {@link yfiles.view.SizeChangedDetectionMode#TIMER} mode is used. - */ - AUTO - } - /** - * This event occurs when the size of a control is changed. - * @class - * @extends {yfiles.lang.EventArgs} - * @final - */ - export interface SizeChangedEventArgs extends yfiles.lang.EventArgs{} - export class SizeChangedEventArgs { - /** - * Gets or sets the element whose size was changed. - * @type {HTMLElement} - */ - source:HTMLElement; - /** - * Gets or sets the old size of the control. - * @type {yfiles.geometry.Size} - */ - oldSize:yfiles.geometry.Size; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.SizeChangedEventArgs; - } - /** - * The {@link yfiles.view.CanvasComponent} can be used to efficiently display all kinds of data. - *

- * The control supports high performance zooming and panning of visual content and provides a high level view of the visual - * tree. The control uses double precision world-coordinates to render items that are composed using a visual tree. In its - * most simple form the scene graph is a tree-like structure of elements that will be rendered in depth-first-search - * order. - *

- *

- * The scene graph tree is made up of {@link yfiles.view.ICanvasObject} elements. Multiple elements are grouped in {@link yfiles.view.ICanvasObjectGroup} - * elements. An {@link yfiles.view.ICanvasObject} consists of a {@link yfiles.view.ICanvasObject#userObject user object} and an {@link yfiles.view.ICanvasObjectDescriptor} that is used - * by the rendering engine to query interfaces that perform the actual creation of the - * {@link yfiles.view.Visual}s, hit testing, and bounds calculation. - *

- *

- * This component handles the following commands by default: - *

- *
    - *
  • {@link yfiles.input.ICommand#INCREASE_ZOOM}
  • - *
  • {@link yfiles.input.ICommand#DECREASE_ZOOM}
  • - *
  • {@link yfiles.input.ICommand#ZOOM}
  • - *
  • {@link yfiles.input.ICommand#FIT_CONTENT}
  • - *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_DOWN}
  • - *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_UP}
  • - *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_LEFT}
  • - *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_RIGHT}
  • - *
- *

- * The handlers for {@link yfiles.input.ICommand#INCREASE_ZOOM} and {@link yfiles.input.ICommand#DECREASE_ZOOM} use the specified command - * parameter as the factor by which the {@link yfiles.view.CanvasComponent#zoom} value is multiplied or divided, respectively. The parameter is not required. If it - * is not present a default value is used. The handler for the {@link yfiles.input.ICommand#ZOOM} command needs a parameter. The - * parameter can either be a number which is interpreted as the new zoom level, or it can be a suitable object. Supported - * objects are {@link yfiles.geometry.Rect}, {@link yfiles.geometry.Point} and {@link yfiles.graph.ILookup}. If a rectangle is specified as the - * parameter for the {@link yfiles.input.ICommand#ZOOM} command, the handler adjusts the {@link yfiles.view.CanvasComponent#viewport} such that the rectangle tightly fits into - * it. If a point is specified, the handler sets the {@link yfiles.view.CanvasComponent#center} to that point. If the parameter implements {@link yfiles.graph.ILookup}, then - * the handler tries to get a {@link yfiles.view.IBoundsProvider} from the lookup and uses the bounds obtained from the bounds - * provider as the rectangle to zoom to. - *

- *

- * {@link yfiles.view.CanvasComponent} is discussed in detail in the section {@link @DGUIDE_PREFIX@/view_graphcontrol.html The Component for Displaying Graphs}. - *

- * @see yfiles.view.IVisualCreator - * @see yfiles.input.IHitTestable - * @see yfiles.view.IVisibilityTestable - * @class - * @implements {yfiles.graph.ILookup} - */ - export interface CanvasComponent extends yfiles.lang.Object,yfiles.graph.ILookup{} - export class CanvasComponent { - /** - * Creates a new instance of {@link yfiles.view.CanvasComponent} using the div element that is specified by the selector. - *

- * The canvas will be empty with no associated InputModes. - *

- * @param selector The CSS selector or id for an existing div element - */ - constructor(selector:string); - /** - * Creates a new instance of {@link yfiles.view.CanvasComponent} for the provided div element. - *

- * The canvas will be empty with no associated {@link yfiles.view.CanvasComponent#inputMode}s. - *

- * @param div The existing div element to use for rendering the canvas into. - */ - constructor(div:HTMLDivElement); - /** - * Creates a new instance of {@link yfiles.view.CanvasComponent} with default properties. - *

- * The canvas will be empty with no associated InputModes. This constructor creates a new {@link yfiles.view.CanvasComponent#div} element that needs to be added - * to the DOM manually. - *

- */ - constructor(); - /** - * Scrolls to the provided view point and zoom level in an animated fashion. - * @param viewPoint The new {@link #viewPoint} - * @param zoom The new zoom level. - */ - animateScrollTo(viewPoint:yfiles.geometry.Point,zoom:number):void; - /** - * Cleans up the Div element by removing any connection from the element to the Control instance. - */ - cleanUp():void; - /** - * Helper method that ensures that the view port limit as returned by the {@link yfiles.view.CanvasComponent#viewportLimiter} are obeyed. - *

- * This method will {@link yfiles.view.CanvasComponent#zoomTo} the limited bounds if necessary. - *

- * @see yfiles.view.CanvasComponent#viewportLimiter - */ - coerceViewportLimits():void; - /** - * Compares two {@link yfiles.view.ICanvasObject} instances that are live in this canvas. - *

- * The comparison will yield values greater than zero if and only if the second object is rendered after the first one. - *

- * @param canvasObject1 the first object to compare - * @param canvasObject2 the second object to compare - * @returns 0 if canvasObject1 == - * canvasObject2 - *
- * >0 if canvasObject1 is painted before canvasObject2 <0 if canvasObject1 is painted after canvasObject2 - */ - compareRenderOrder(canvasObject1:yfiles.view.ICanvasObject,canvasObject2:yfiles.view.ICanvasObject):number; - /** - * Factory method for the BackgroundGroup property. - *

- * This method will be called upon first access to the {@link yfiles.view.CanvasComponent#backgroundGroup} property. - *

- * @returns a new instance of ICanvasObjectGroup - * @protected - */ - createBackgroundGroup():yfiles.view.ICanvasObjectGroup; - /** - * Factory method for the ContentGroup property. - *

- * This method will be called upon first access to the {@link yfiles.view.CanvasComponent#contentGroup} property. - *

- * @returns a new instance of ICanvasObjectGroup - * @protected - */ - createContentGroup():yfiles.view.ICanvasObjectGroup; - /** - * Factory method for the {@link yfiles.view.CanvasComponent#focusGroup} property. - *

- * This method will be called upon first access to the {@link yfiles.view.CanvasComponent#focusGroup} property. - *

- * @returns a new instance of ICanvasObjectGroup - * @protected - */ - createFocusGroup():yfiles.view.ICanvasObjectGroup; - /** - * Factory method for the HighlightGroup property. - *

- * This method will be called upon first access to the {@link yfiles.view.CanvasComponent#highlightGroup} property. - *

- * @returns a new instance of ICanvasObjectGroup - * @protected - */ - createHighlightGroup():yfiles.view.ICanvasObjectGroup; - /** - * Factory method for the {@link yfiles.view.CanvasComponent#inputModeContext} property. - *

- * This method will be called upon first access to the {@link yfiles.view.CanvasComponent#inputModeContext} property. - *

- * @returns a new instance of {@link #inputModeContext} that has this instance set as it's {@link #canvasComponent} and uses this instance's {@link #inputModeContextLookup} - * callback to satisfy requests. - * @protected - */ - createInputModeContext():yfiles.input.IInputModeContext; - /** - * Factory method for the InputModeGroup property. - *

- * This method will be called upon first access to the {@link yfiles.view.CanvasComponent#inputModeGroup} property. - *

- * @returns a new instance of ICanvasObjectGroup - * @protected - */ - createInputModeGroup():yfiles.view.ICanvasObjectGroup; - /** - * Creates an appropriate {@link yfiles.view.IRenderContext render context} that can be used to {@link yfiles.view.IVisualCreator#createVisual create visuals} using {@link yfiles.view.IVisualCreator} - * implementations. - *

- * This method is a convenience method to obtain a context for special visual creator implementations and normally needs - * not be used by application developers. - *

- * @returns A new context instance that is bound to this instance. - */ - createRenderContext():yfiles.view.IRenderContext; - /** - * Factory method for the SelectionGroup property. - *

- * This method will be called upon first access to the {@link yfiles.view.CanvasComponent#selectionGroup} property. - *

- * @returns a new instance of ICanvasObjectGroup - * @protected - */ - createSelectionGroup():yfiles.view.ICanvasObjectGroup; - /** - * Ensures that the provided bounds are visible in this control by adjusting the viewport correspondingly. - * @param bounds The bounds to make visible. - */ - ensureVisible(bounds:yfiles.geometry.Rect):void; - /** - * Exports the graphical content for this {@link yfiles.view.CanvasComponent}. - *

- * This method will create the visual content using the world coordinate system. - *

- * @param context The context to use. - * @returns A composite Visual that represents the contents of this control. - */ - exportContent(context:yfiles.view.IRenderContext):Element; - /** - * Fires the size changed event. - * @param oldSize - */ - fireSizeChanged(oldSize:yfiles.geometry.Size):void; - /** - * Adjusts the view port to fully encompass the {@link yfiles.view.CanvasComponent#contentRect}. - *

- * The zoom level will not be greater than 1.0d. If the view port is limited by the {@link yfiles.view.CanvasComponent#viewportLimiter} the zoom level might be greater than 1.0d - * to respect the limits. - *

- * @see yfiles.view.CanvasComponent#updateContentRect - * @see yfiles.view.CanvasComponent#zoom - * @see yfiles.view.CanvasComponent#zoomTo - */ - fitContent():void; - /** - * Focuses the {@link yfiles.view.CanvasComponent#div} element that is backing this instance. - */ - focus():void; - /** - * Convenience method that calculates the bounds for a given canvas object in the scene graph. - *

- * This method queries the descriptor for the {@link yfiles.view.IBoundsProvider} for the user object and returns the result. - *

- * @param canvasObject the canvas object to query the bounds from - * @returns the non-null bounds - */ - getBounds(canvasObject:yfiles.view.ICanvasObject):yfiles.geometry.Rect; - /** - * Returns the top most canvas object instance that is hit at the given coordinate set. - *

- * This will return the canvas object that is painted last at the given position. - *

- * @param location the coordinates of the query in the world coordinate system - * @returns - */ - getCanvasObject(location:yfiles.geometry.Point):yfiles.view.ICanvasObject; - /** - * Enumerates over all possible {@link yfiles.view.ICanvasObject} instances in the tree below the given group. - * @param group - * @returns An enumerable for all {@link }s in the tree below the given group. - */ - getCanvasObjects(group:yfiles.view.ICanvasObjectGroup):yfiles.collections.IEnumerable; - /** - * Returns a list of all canvas objects in hit order at the given world coordinate location. - *

- * The order of the elements in the list is the natural hit test order, i.e. elements painted on top of others will be - * reported first in the list. - *

- * @param location the coordinates of the query in the world coordinate system - * @returns an enumerable of canvas object that are hit in reverse painting order - */ - getCanvasObjects(location:yfiles.geometry.Point):yfiles.collections.IEnumerable; - /** - * Enumerates over all possible {@link yfiles.view.ICanvasObject} instances in the tree. - * @returns An enumerable for all {@link }s in the tree. - */ - getCanvasObjects():yfiles.collections.IEnumerable; - /** - * Gets the {@link yfiles.view.CanvasComponent} instance that is associated with the given DOM element, or null. - * @param element - * @returns - * @static - */ - static getComponent(element:Element):yfiles.view.CanvasComponent; - /** - * Gets the {@link yfiles.view.Visual} that is currently visualizing the given {@link yfiles.view.ICanvasObject}. - *

- * Note that depending on the current state of the viewport and the control no such instance may be available and instead - * this method will yield null. However if a visual is currently being displayed for the given canvas object, it will be - * returned. This method should be used with care. Manipulation of the given instance should normally be done through the - * corresponding {@link yfiles.view.IVisualCreator} that created the visual in the first place. This method rather serves as a - * utility method for UI testing frameworks and similar use cases. - *

- * @param canvasObject The canvas object. - * @returns The {@link } that is currently used by the canvasObject. - */ - getVisual(canvasObject:yfiles.view.ICanvasObject):yfiles.view.Visual; - /** - * Convenience method that retrieves the {@link yfiles.view.IVisualCreator} for a given {@link yfiles.view.ICanvasObject}. - * @param canvasObject the canvas object to query the visual creator implementation from - * @returns an instance of the visual creator interface - * @see yfiles.view.ICanvasObjectDescriptor#getVisualCreator - * @see yfiles.view.VoidVisualCreator#INSTANCE - */ - getVisualCreator(canvasObject:yfiles.view.ICanvasObject):yfiles.view.IVisualCreator; - /** - * Converts view coordinates from the document's coordinate system to the control's coordinate system. - * @param localPoint The coordinates to convert. - * @returns The coordinates in the control's coordinate system. - */ - globalToLocal(localPoint:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Assures that the {@link yfiles.view.CanvasComponent#contentRect content rectangle} encompasses the given rectangle. - *

- * Note that this will not change the view port, it will only change the scroll bars if necessary. - *

- * @param rectangle the rectangle that should be included in the content rectangle - */ - growContentRect(rectangle:yfiles.geometry.Rect):void; - /** - * Enumerates all hit elements in the canvas below the given group that are accepted by a given filter using a specific {@link yfiles.view.ICanvasContext} - * as the argument to the {@link yfiles.input.IHitTestable#isHit} method. - *

- * Hit testing is performed using the {@link yfiles.view.ICanvasObjectDescriptor#getHitTestable} instance returned for each visible - * {@link yfiles.view.ICanvasObject} in the current scene graph. The enumeration is performed lazily. - *

- * @param context The context instance to pass to {@link #isHit}. - * @param location the coordinates to perform the hit test at - * @param [root=null] the root of the scene graph to use - * @param [filter=null] The predicate that decides whether a given canvas object should be considered for testing at all or null. - * @returns a live enumeration of the elements that are hit - * @see yfiles.input.IHitTestable - */ - hitElementsAt(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,root?:yfiles.view.ICanvasObjectGroup,filter?:(obj:yfiles.view.ICanvasObject)=>boolean):yfiles.collections.IEnumerable; - /** - * Enumerates all hit elements in the canvas below the given group that are accepted by a given filter using a specific {@link yfiles.view.ICanvasContext} - * as the argument to the {@link yfiles.input.IHitTestable#isHit} method. - *

- * Hit testing is performed using the {@link yfiles.view.ICanvasObjectDescriptor#getHitTestable} instance returned for each visible - * {@link yfiles.view.ICanvasObject} in the current scene graph. The enumeration is performed lazily. - *

- * @param {Object} options The parameters to pass. - * @param options.context The context instance to pass to {@link #isHit}. - * @param options.location the coordinates to perform the hit test at - * @param [options.root=null] the root of the scene graph to use - * @param [options.filter=null] The predicate that decides whether a given canvas object should be considered for testing at all or null. - * @returns a live enumeration of the elements that are hit - * @see yfiles.input.IHitTestable - */ - hitElementsAt(options:{context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,root?:yfiles.view.ICanvasObjectGroup,filter?:(obj:yfiles.view.ICanvasObject)=>boolean}):yfiles.collections.IEnumerable; - /** - * Enumerates all hit elements in the canvas below the given group that are accepted by a given filter. - *

- * Hit testing is performed using the {@link yfiles.view.ICanvasObjectDescriptor#getHitTestable} instance returned for each visible - * {@link yfiles.view.ICanvasObject} in the current scene graph. The enumeration is performed lazily. - *

- * @param location the coordinates to perform the hit test at - * @param [root=null] the root of the scene graph to use - * @param [filter=null] The predicate that decides whether a given canvas object should be considered for testing at all or null. - * @returns a live enumeration of the elements that are hit - * @see yfiles.input.IHitTestable - * @see yfiles.view.CanvasComponent#hitTestRadius - */ - hitElementsAt(location:yfiles.geometry.Point,root?:yfiles.view.ICanvasObjectGroup,filter?:(obj:yfiles.view.ICanvasObject)=>boolean):yfiles.collections.IEnumerable; - /** - * Enumerates all hit elements in the canvas below the given group that are accepted by a given filter. - *

- * Hit testing is performed using the {@link yfiles.view.ICanvasObjectDescriptor#getHitTestable} instance returned for each visible - * {@link yfiles.view.ICanvasObject} in the current scene graph. The enumeration is performed lazily. - *

- * @param {Object} options The parameters to pass. - * @param options.location the coordinates to perform the hit test at - * @param [options.root=null] the root of the scene graph to use - * @param [options.filter=null] The predicate that decides whether a given canvas object should be considered for testing at all or null. - * @returns a live enumeration of the elements that are hit - * @see yfiles.input.IHitTestable - * @see yfiles.view.CanvasComponent#hitTestRadius - */ - hitElementsAt(options:{location:yfiles.geometry.Point,root?:yfiles.view.ICanvasObjectGroup,filter?:(obj:yfiles.view.ICanvasObject)=>boolean}):yfiles.collections.IEnumerable; - /** - * Callback that is used by the default implementation of {@link yfiles.view.CanvasComponent#inputModeContext} to resolve {@link yfiles.graph.ILookup#lookup} calls. - * @param type The Type to query - * @returns The result of the query. - * @see yfiles.input.IInputModeContext - * @protected - */ - inputModeContextLookup(type:yfiles.lang.Class):any; - /** - * Invalidates this instance and marks it as in need for an update. - *

- * Calling this method is fast and will only mark the control for a future, asynchronously executed call to UpdateVisual. - *

- */ - invalidate():void; - /** - * Convenience method that calculates the hit tests a given canvas object in the scene graph. - *

- * This method queries the descriptor for the {@link yfiles.input.IHitTestable} for the user object and returns the result of the - * hit test query. If there is no IHitTestable returned by the descriptor this method returns false. - *

- * @param canvasObject the canvas object to query the bounds from - * @param location the coordinates of the query in the world coordinate system - * @returns whether the canvas object is hit at the given coordinates - */ - isHit(canvasObject:yfiles.view.ICanvasObject,location:yfiles.geometry.Point):boolean; - /** - * Converts view coordinates from the control's coordinate system to the document's coordinate system. - * @param localPoint The coordinates to convert. - * @returns The coordinates in the document's coordinate system. - */ - localToGlobal(localPoint:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * Calls evt.preventDefault() for each contextMenu event that occurs on this instance. - *

- * By overriding this method, the browser's default behavior for the contextMenu event can be enabled. - *

- * @param evt The event. - * @protected - */ - maybePreventContextMenuDefault(evt:Event):void; - /** - * Calls evt.preventDefault() if {@link yfiles.view.CanvasComponent#captureAllPointerInput} is enabled. - *

- * This method is queried for each mouse, touch or pointer event that occurs on this instance. By overriding this method, - * the browser's default behavior can effectively be controlled for every single event. - *

- * @param evt The event. - * @protected - */ - maybePreventPointerDefault(evt:Event):void; - /** - * This method will be called when the mouse wheel was turned and if the {@link yfiles.view.CanvasComponent#mouseWheelBehavior} property is set to - * {@link yfiles.view.MouseWheelBehaviors#SCROLL}. - *

- * This method will scroll the view in vertical direction. If the Shift key modifier has been pressed this method will - * scroll in horizontal direction. - *

- * @param evt the event describing the action - * @see yfiles.view.CanvasComponent#mouseWheelBehavior - * @see yfiles.view.CanvasComponent#mouseWheelScrollFactor - * @protected - */ - mouseWheelScroll(evt:yfiles.view.MouseEventArgs):void; - /** - * This method will be called when the mouse wheel was turned and if the {@link yfiles.view.CanvasComponent#mouseWheelBehavior} property is set to - * {@link yfiles.view.MouseWheelBehaviors#ZOOM}. - *

- * This method will adjust the current zoom level. If the Control key modifier has been pressed this method will keep the - * world coordinates at the current mouse position, i.e. the zoom will not necessarily be into the center of the canvas. - *

- * @param evt the event describing the action - * @see yfiles.view.CanvasComponent#mouseWheelBehavior - * @protected - */ - mouseWheelZoom(evt:yfiles.view.MouseEventArgs):void; - /** - * Raises the {@link yfiles.view.CanvasComponent#addPrepareRenderContextListener PrepareRenderContext}. - * @param evt The event arguments to raise. - * @see yfiles.view.CanvasComponent#addPrepareRenderContextListener - * @protected - */ - raisePrepareRenderContextEvent(evt:yfiles.view.PrepareRenderContextEventArgs):void; - /** - * Raises the {@link yfiles.view.CanvasComponent#addUpdatedVisualListener UpdatedVisual}. - * @see yfiles.view.CanvasComponent#addUpdatedVisualListener - * @protected - */ - raiseUpdatedVisualEvent():void; - /** - * Raises the {@link yfiles.view.CanvasComponent#addUpdatingVisualListener UpdatingVisual}. - * @see yfiles.view.CanvasComponent#addUpdatingVisualListener - * @protected - */ - raiseUpdatingVisualEvent():void; - /** - * Adds a callback to the invocation chain and triggers the chain's execution. - *

- * Therefore, the given callback will be executed in sequence with previously added actions, e.g. the - * {@link yfiles.view.CanvasComponent}'s invalidation. - *

- * @param callback The function that should be executed. - * @param args The arguments with which the function should be called. - */ - schedule(callback:Function,...args:any[]):void; - /** - * Sets the content rectangle. - *

- * The content rectangle is the space in world coordinates that the user should at least be able to scroll to. I.e. if the - * area currently visible in the control does not encompass the content rect, the scrollbars will be made visible, unless - * they are disabled. - *

- * @param x - * @param y - * @param w - * @param h - * @see yfiles.view.CanvasComponent#contentRect - * @see yfiles.view.CanvasComponent#horizontalScrollBarPolicy - * @see yfiles.view.CanvasComponent#verticalScrollBarPolicy - */ - setContentRect(x:number,y:number,w:number,h:number):void; - /** - * Stops the mouse capture and returns to normal event capturing. - *

- * When {@link yfiles.view.CanvasComponent#mouseCaptureEnabled} is set to true and a mouse down event is received, the control starts capturing all mouse events by registering - * handlers on the document element. Mouse capturing is normally stopped when the mouse button is released. Mouse capture - * can be manually stopped by calling this function. - *

- */ - stopMouseCapture():void; - /** - * Converts world coordinates to view coordinates expressed in the control's coordinate system. - * @param worldPoint the coordinates in the world coordinate system - * @returns returns the coordinates in pixels relative to the controls upper left corner - */ - toViewCoordinates(worldPoint:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Converts view coordinates (expressed in the control's coordinate system) to world coordinates. - * @param viewPoint the coordinates in pixels relative to the controls upper left corner - * @returns returns the coordinates in the world coordinate system - */ - toWorldCoordinates(viewPoint:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Updates the {@link yfiles.view.CanvasComponent#contentRect} to encompass the bounds by all elements in the current scene graph plus the given margins. - *

- * This method will traverse all {@link yfiles.view.ICanvasObject#visible visible} elements in the scene graph and query their {@link yfiles.view.ICanvasObjectDescriptor#getBoundsProvider bounds} The resulting bounds will be - * set to the content rectangle plus the provided margins. - *

- * @param [margins=null] - * @param [group=null] - * @see yfiles.view.IBoundsProvider - * @see yfiles.view.CanvasComponent#contentRect - */ - updateContentRect(margins?:yfiles.geometry.Insets,group?:yfiles.view.ICanvasObjectGroup):void; - /** - * Updates the {@link yfiles.view.CanvasComponent#contentRect} to encompass the bounds by all elements in the current scene graph plus the given margins. - *

- * This method will traverse all {@link yfiles.view.ICanvasObject#visible visible} elements in the scene graph and query their {@link yfiles.view.ICanvasObjectDescriptor#getBoundsProvider bounds} The resulting bounds will be - * set to the content rectangle plus the provided margins. - *

- * @param {Object} options The parameters to pass. - * @param [options.margins=null] - * @param [options.group=null] - * @see yfiles.view.IBoundsProvider - * @see yfiles.view.CanvasComponent#contentRect - */ - updateContentRect(options:{margins?:yfiles.geometry.Insets,group?:yfiles.view.ICanvasObjectGroup}):void; - /** - * Updates the visual tree that displays the contents of this control. - *

- * Calling this method will synchronously update the visual tree and the SVG DOM and Canvas rendering. - *

- *

- * This method will determine the {@link yfiles.view.ICanvasObject#dirty} canvas objects using the {@link yfiles.view.ICanvasObjectDescriptor#isDirty} method and will {@link yfiles.view.IVisualCreator#createVisual create} - * or {@link yfiles.view.IVisualCreator#updateVisual update} the visuals that make up the visual tree. - *

- *

- * Note that most of the time this method does not need to be called by client code. Instead calling {@link yfiles.view.CanvasComponent#invalidate} - * will ultimately trigger the execution of this method. However invalidation calls will be coalesced and the actual - * execution of the update will be delayed until the next event dispatch. - *

- */ - updateVisual():void; - /** - * Sets the zoom level and view port center to the given values. - * @param center the new center of the view port in world coordinates - * @param zoom the new zoom level - */ - zoomTo(center:yfiles.geometry.Point,zoom:number):void; - /** - * Sets the zoom level and view port center so that the given rectangle in world coordinates fits the viewport. - * @param bounds The coordinates of the rectangle to zoom to. - */ - zoomTo(bounds:yfiles.geometry.Rect):void; - /** - * Gets the {@link yfiles.view.CanvasComponent#dropTarget} associated with this instance. - * @type {yfiles.view.DropTarget} - */ - dropTarget:yfiles.view.DropTarget; - /** - * Gets the div element that represents this instance. - * @type {HTMLDivElement} - */ - div:HTMLDivElement; - /** - * Gets or sets a value indicating whether all keyboard input is captured. - * @type {boolean} - */ - captureAllKeyboardInput:boolean; - /** - * Gets or sets a value indicating whether all pointer input is captured. - * @type {boolean} - */ - captureAllPointerInput:boolean; - /** - * Whether or not this control receives mouse input after the mouse is dragged out of its bounding area. - *

- * If enabled, this control receives mouse events when the mouse is moved out of its bounding area while a mouse button is - * pressed, until the button is release (the mouse up event is the last event this control listens to). - *

- * @type {boolean} - */ - mouseCaptureEnabled:boolean; - /** - * Gets a value indicating whether this instance currently has mouse capture. - * @type {boolean} - */ - hasMouseCapture:boolean; - /** - * Gets a value indicating whether this {@link yfiles.view.CanvasComponent} is currently focused. - * @type {boolean} - */ - focused:boolean; - /** - * Gets a value indicating whether the UI is right to left. - * @type {boolean} - */ - rightToLeft:boolean; - /** - * Gets or sets a value indicating whether to prevent scrolling if the element gets focused. - * @type {boolean} - */ - preventFocusScrolling:boolean; - /** - * Gets the control's {@link yfiles.view.CanvasComponent#svgDefsManager} - * @type {yfiles.view.SvgDefsManager} - */ - svgDefsManager:yfiles.view.SvgDefsManager; - /** - * Gets or sets whether to add a 'glass pane' overlay to the {@link yfiles.view.CanvasComponent} that acts as the source for all - * mouse and touch events. - *

- * The glass pane can be used as a workaround for bogus mouse and touch event handling: If the touch down or mouse down - * event occurs on an element that is removed from the DOM while the pointer is down, the up event may not bubble up to the - * {@link yfiles.view.CanvasComponent} anymore, which leaves {@link yfiles.input.IInputMode input modes} in a bad state. Be aware that all direct touch and mouse - * interaction with the SVG DOM is disabled if the glass pane is enabled, so this should be used with care. - *

- * @type {boolean} - */ - useGlassPane:boolean; - /** - * Gets or sets the {@link yfiles.view.CanvasComponent#viewportLimiter} instance that can be used to limit the explorable region. - *

- * By default there are no limits set on the explorable region. - *

- * @type {yfiles.view.ViewportLimiter} - */ - viewportLimiter:yfiles.view.ViewportLimiter; - /** - * Gets or sets the editable state of this canvas. - *

- * {@link yfiles.input.IInputMode} implementations should honor this property. Events will still be delivered to the IInputModes, - * however they should not modify the model. - *

- * @default true - * @type {boolean} - */ - editable:boolean; - /** - * Gets or sets the behavior of the mouse wheel. - *

- * The behavior can be switched between {@link yfiles.view.MouseWheelBehaviors#ZOOM}, {@link yfiles.view.MouseWheelBehaviors#SCROLL} and - * {@link yfiles.view.MouseWheelBehaviors#NONE}. Additionally, this property can be configured to perform the action - * {@link yfiles.view.MouseWheelBehaviors#ONLY_WHEN_FOCUSED only when the control is focused}. - *

- * @default yfiles.view.MouseWheelBehaviors.ZOOM - * @type {yfiles.view.MouseWheelBehaviors} - */ - mouseWheelBehavior:yfiles.view.MouseWheelBehaviors; - /** - * Gets or sets an event recognizer that determines whether the zooming to the center of the view, rather than at the mouse - * location should be used. - *

- * The default is {@link yfiles.input.KeyEventRecognizers#SHIFT_PRESSED}. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - centerZoomEventRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the visibility policy for the vertical scrollbar. - *

- * Scrollbars don't need to be displayed in order to move the viewport. This can be achieved programmatically or using - * special IInputMode instances. The default is {@link yfiles.view.ScrollBarVisibility#AS_NEEDED}. - *

- * @see yfiles.input.MoveViewportInputMode - * @see yfiles.view.CanvasComponent#horizontalScrollBarPolicy - * @default yfiles.view.ScrollBarVisibility.AS_NEEDED - * @type {yfiles.view.ScrollBarVisibility} - */ - verticalScrollBarPolicy:yfiles.view.ScrollBarVisibility; - /** - * Gets or sets the visibility policy for the vertical scrollbar. - *

- * Scrollbars don't need to be displayed in order to move the viewport. This can be achieved programmatically or using - * special IInputMode instances. The default is {@link yfiles.view.ScrollBarVisibility#AS_NEEDED}. - *

- * @see yfiles.input.MoveViewportInputMode - * @see yfiles.view.CanvasComponent#verticalScrollBarPolicy - * @default yfiles.view.ScrollBarVisibility.AS_NEEDED - * @type {yfiles.view.ScrollBarVisibility} - */ - horizontalScrollBarPolicy:yfiles.view.ScrollBarVisibility; - /** - * Gets or sets a value indicating whether {@link yfiles.input.ICommand}s for scrolling like for example - * {@link yfiles.input.ICommand#SCROLL_PAGE_DOWN}, the scrolling should be performed in animated fashion. - * @default true - * @type {boolean} - */ - animateScrollCommands:boolean; - /** - * Gets and sets the Rectangle in world coordinates that holds the contents. - *

- * This influences the display of the scroll bars. If the content rectangle is not currently visible in the viewport, - * scroll bars will be displayed, unless they are turned off completely. Note that in general the content rectangle is not - * updated automatically but declared as a fixed rectangle. Rather the application programmer needs to set this value or - * call respective automatic update methods. - *

- * @default '0,0,100,100' - * @type {yfiles.geometry.Rect} - */ - contentRect:yfiles.geometry.Rect; - /** - * Adds the given listener for the ContentRectChanged event that occurs when the {@link yfiles.view.CanvasComponent#contentRect content rectangle} has been changed. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeContentRectChangedListener - */ - addContentRectChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the ContentRectChanged event that occurs when the {@link yfiles.view.CanvasComponent#contentRect content rectangle} has been changed. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addContentRectChangedListener - */ - removeContentRectChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Gets and sets the insets in view coordinates that should be used by the {@link yfiles.view.CanvasComponent#fitContent} - * operation. - *

- * This influences the amount of visible whitespace in the view coordinate system around the {@link yfiles.view.CanvasComponent#contentRect} after a {@link yfiles.view.CanvasComponent#fitContent} - * operation. The default value is (10,10,10,10). - *

- *

- * Note limits that are enforced by the {@link yfiles.view.CanvasComponent#viewportLimiter} have a higher priority than these insets. - *

- * @default '10' - * @type {yfiles.geometry.Insets} - */ - fitContentViewMargins:yfiles.geometry.Insets; - /** - * Adds the given listener for the FitContentViewMarginsChanged event that occurs when the {@link yfiles.view.CanvasComponent#fitContentViewMargins margins for the fit content operation} - * have been changed. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeFitContentViewMarginsChangedListener - */ - addFitContentViewMarginsChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the FitContentViewMarginsChanged event that occurs when the {@link yfiles.view.CanvasComponent#fitContentViewMargins margins for the fit content operation} - * have been changed. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addFitContentViewMarginsChangedListener - */ - removeFitContentViewMarginsChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Adds the given listener for the MouseLeave event that occurs when the mouse has exited the canvas. - *

- * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. - *

- *

- * If the mouse leaves this canvas control with the mouse button pressed, this event is deferred until the mouse button is - * released. Thus, this event will not interfere with the typical mouse button event cycle. - *

- * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeMouseLeaveListener - */ - addMouseLeaveListener(listener:(sender:any,evt:yfiles.view.MouseEventArgs)=>void):void; - /** - * Removes the given listener for the MouseLeave event that occurs when the mouse has exited the canvas. - *

- * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. - *

- *

- * If the mouse leaves this canvas control with the mouse button pressed, this event is deferred until the mouse button is - * released. Thus, this event will not interfere with the typical mouse button event cycle. - *

- * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addMouseLeaveListener - */ - removeMouseLeaveListener(listener:(sender:any,evt:yfiles.view.MouseEventArgs)=>void):void; - /** - * Adds the given listener for the MouseEnter event that occurs when the mouse has entered the canvas. - *

- * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. - *

- *

- * If the mouse enters this canvas control with a mouse button pressed, this event is fired instantly but the current - * button state reported by the {@link yfiles.view.MouseEventArgs} does not include this button unless the browser supports the - * property MouseEvent.buttons. See the Known Issues for more details. - *

- * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeMouseEnterListener - */ - addMouseEnterListener(listener:(sender:any,evt:yfiles.view.MouseEventArgs)=>void):void; - /** - * Removes the given listener for the MouseEnter event that occurs when the mouse has entered the canvas. - *

- * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. - *

- *

- * If the mouse enters this canvas control with a mouse button pressed, this event is fired instantly but the current - * button state reported by the {@link yfiles.view.MouseEventArgs} does not include this button unless the browser supports the - * property MouseEvent.buttons. See the Known Issues for more details. - *

- * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addMouseEnterListener - */ - removeMouseEnterListener(listener:(sender:any,evt:yfiles.view.MouseEventArgs)=>void):void; - /** - * Adds the given listener for the MouseMove event that occurs when the mouse has been moved in world coordinates. - *

- * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. - *

- *

- * Move elements are delivered if no mouse button is pressed. This event will be fired, too, if the mouse does not move but - * the world coordinates to which the current mouse position maps change. E.g. this will happen if the zoom level or the - * view point is changed. - *

- * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeMouseMoveListener - */ - addMouseMoveListener(listener:(sender:any,evt:yfiles.view.MouseEventArgs)=>void):void; - /** - * Removes the given listener for the MouseMove event that occurs when the mouse has been moved in world coordinates. - *

- * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. - *

- *

- * Move elements are delivered if no mouse button is pressed. This event will be fired, too, if the mouse does not move but - * the world coordinates to which the current mouse position maps change. E.g. this will happen if the zoom level or the - * view point is changed. - *

- * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addMouseMoveListener - */ - removeMouseMoveListener(listener:(sender:any,evt:yfiles.view.MouseEventArgs)=>void):void; - /** - * Adds the given listener for the MouseDown event that occurs when a mouse button has been pressed. - *

- * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeMouseDownListener - */ - addMouseDownListener(listener:(sender:any,evt:yfiles.view.MouseEventArgs)=>void):void; - /** - * Removes the given listener for the MouseDown event that occurs when a mouse button has been pressed. - *

- * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addMouseDownListener - */ - removeMouseDownListener(listener:(sender:any,evt:yfiles.view.MouseEventArgs)=>void):void; - /** - * Adds the given listener for the MouseDrag event that occurs when the mouse is being moved while at least one of the - * mouse buttons is pressed. - *

- * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeMouseDragListener - */ - addMouseDragListener(listener:(sender:any,evt:yfiles.view.MouseEventArgs)=>void):void; - /** - * Removes the given listener for the MouseDrag event that occurs when the mouse is being moved while at least one of the - * mouse buttons is pressed. - *

- * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addMouseDragListener - */ - removeMouseDragListener(listener:(sender:any,evt:yfiles.view.MouseEventArgs)=>void):void; - /** - * Adds the given listener for the MouseUp event that occurs when the mouse button has been released. - *

- * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeMouseUpListener - */ - addMouseUpListener(listener:(sender:any,evt:yfiles.view.MouseEventArgs)=>void):void; - /** - * Removes the given listener for the MouseUp event that occurs when the mouse button has been released. - *

- * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addMouseUpListener - */ - removeMouseUpListener(listener:(sender:any,evt:yfiles.view.MouseEventArgs)=>void):void; - /** - * Adds the given listener for the MouseLostCapture event that occurs when the mouse capture has been lost. - *

- * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeMouseLostCaptureListener - */ - addMouseLostCaptureListener(listener:(sender:any,evt:yfiles.view.MouseEventArgs)=>void):void; - /** - * Removes the given listener for the MouseLostCapture event that occurs when the mouse capture has been lost. - *

- * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addMouseLostCaptureListener - */ - removeMouseLostCaptureListener(listener:(sender:any,evt:yfiles.view.MouseEventArgs)=>void):void; - /** - * Adds the given listener for the MouseWheel event that occurs when the mouse wheel has turned. - *

- * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeMouseWheelListener - */ - addMouseWheelListener(listener:(sender:any,evt:yfiles.view.MouseEventArgs)=>void):void; - /** - * Removes the given listener for the MouseWheel event that occurs when the mouse wheel has turned. - *

- * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addMouseWheelListener - */ - removeMouseWheelListener(listener:(sender:any,evt:yfiles.view.MouseEventArgs)=>void):void; - /** - * Adds the given listener for the MouseClick event that occurs when the user clicked the mouse. - *

- * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. - *

- *

- * This happens if press and release happens at the same position. - *

- * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeMouseClickListener - */ - addMouseClickListener(listener:(sender:any,evt:yfiles.view.MouseEventArgs)=>void):void; - /** - * Removes the given listener for the MouseClick event that occurs when the user clicked the mouse. - *

- * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. - *

- *

- * This happens if press and release happens at the same position. - *

- * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addMouseClickListener - */ - removeMouseClickListener(listener:(sender:any,evt:yfiles.view.MouseEventArgs)=>void):void; - /** - * Adds the given listener for the KeyDown event that occurs when keys are being pressed. - *

- * This event delivers {@link yfiles.view.KeyEventArgs}. - *

- * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeKeyDownListener - */ - addKeyDownListener(listener:(sender:any,evt:yfiles.view.KeyEventArgs)=>void):void; - /** - * Removes the given listener for the KeyDown event that occurs when keys are being pressed. - *

- * This event delivers {@link yfiles.view.KeyEventArgs}. - *

- * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addKeyDownListener - */ - removeKeyDownListener(listener:(sender:any,evt:yfiles.view.KeyEventArgs)=>void):void; - /** - * Adds the given listener for the KeyPressed event that occurs when keys are being typed. - *

- * This event delivers {@link yfiles.view.KeyEventArgs}. - *

- * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeKeyPressedListener - */ - addKeyPressedListener(listener:(sender:any,evt:yfiles.view.KeyEventArgs)=>void):void; - /** - * Removes the given listener for the KeyPressed event that occurs when keys are being typed. - *

- * This event delivers {@link yfiles.view.KeyEventArgs}. - *

- * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addKeyPressedListener - */ - removeKeyPressedListener(listener:(sender:any,evt:yfiles.view.KeyEventArgs)=>void):void; - /** - * Adds the given listener for the KeyUp event that occurs when keys are being released. - *

- * This event delivers {@link yfiles.view.KeyEventArgs}. - *

- * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeKeyUpListener - */ - addKeyUpListener(listener:(sender:any,evt:yfiles.view.KeyEventArgs)=>void):void; - /** - * Removes the given listener for the KeyUp event that occurs when keys are being released. - *

- * This event delivers {@link yfiles.view.KeyEventArgs}. - *

- * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addKeyUpListener - */ - removeKeyUpListener(listener:(sender:any,evt:yfiles.view.KeyEventArgs)=>void):void; - /** - * Adds the given listener for the EditableChanged event that occurs when the {@link yfiles.view.CanvasComponent#editable} property has been changed. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeEditableChangedListener - */ - addEditableChangedListener(listener:(sender:any,evt:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the EditableChanged event that occurs when the {@link yfiles.view.CanvasComponent#editable} property has been changed. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addEditableChangedListener - */ - removeEditableChangedListener(listener:(sender:any,evt:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Adds the given listener for the ViewportChanged event that occurs when the {@link yfiles.view.CanvasComponent#viewport} property has been changed. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeViewportChangedListener - */ - addViewportChangedListener(listener:(sender:any,evt:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the ViewportChanged event that occurs when the {@link yfiles.view.CanvasComponent#viewport} property has been changed. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addViewportChangedListener - */ - removeViewportChangedListener(listener:(sender:any,evt:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Adds the given listener for the TouchDown event that occurs when a finger has been put on the touch screen. - *

- * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeTouchDownListener - */ - addTouchDownListener(listener:(sender:any,evt:yfiles.view.TouchEventArgs)=>void):void; - /** - * Removes the given listener for the TouchDown event that occurs when a finger has been put on the touch screen. - *

- * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addTouchDownListener - */ - removeTouchDownListener(listener:(sender:any,evt:yfiles.view.TouchEventArgs)=>void):void; - /** - * Adds the given listener for the TouchUp event that occurs when a finger has been removed from the touch screen. - *

- * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeTouchUpListener - */ - addTouchUpListener(listener:(sender:any,evt:yfiles.view.TouchEventArgs)=>void):void; - /** - * Removes the given listener for the TouchUp event that occurs when a finger has been removed from the touch screen. - *

- * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addTouchUpListener - */ - removeTouchUpListener(listener:(sender:any,evt:yfiles.view.TouchEventArgs)=>void):void; - /** - * Adds the given listener for the TouchMove event that occurs when a finger has been moved on the touch screen. - *

- * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeTouchMoveListener - */ - addTouchMoveListener(listener:(sender:any,evt:yfiles.view.TouchEventArgs)=>void):void; - /** - * Removes the given listener for the TouchMove event that occurs when a finger has been moved on the touch screen. - *

- * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addTouchMoveListener - */ - removeTouchMoveListener(listener:(sender:any,evt:yfiles.view.TouchEventArgs)=>void):void; - /** - * Adds the given listener for the TouchEnter event that occurs when a finger on the touch screen has entered the canvas. - *

- * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeTouchEnterListener - */ - addTouchEnterListener(listener:(sender:any,evt:yfiles.view.TouchEventArgs)=>void):void; - /** - * Removes the given listener for the TouchEnter event that occurs when a finger on the touch screen has entered the - * canvas. - *

- * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addTouchEnterListener - */ - removeTouchEnterListener(listener:(sender:any,evt:yfiles.view.TouchEventArgs)=>void):void; - /** - * Adds the given listener for the TouchLeave event that occurs when a finger on the touch screen has exited the canvas. - *

- * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeTouchLeaveListener - */ - addTouchLeaveListener(listener:(sender:any,evt:yfiles.view.TouchEventArgs)=>void):void; - /** - * Removes the given listener for the TouchLeave event that occurs when a finger on the touch screen has exited the - * canvas. - *

- * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addTouchLeaveListener - */ - removeTouchLeaveListener(listener:(sender:any,evt:yfiles.view.TouchEventArgs)=>void):void; - /** - * Adds the given listener for the TouchLostCapture event that occurs when the touch capture has been lost. - *

- * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeTouchLostCaptureListener - */ - addTouchLostCaptureListener(listener:(sender:any,evt:yfiles.view.TouchEventArgs)=>void):void; - /** - * Removes the given listener for the TouchLostCapture event that occurs when the touch capture has been lost. - *

- * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. - *

- * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addTouchLostCaptureListener - */ - removeTouchLostCaptureListener(listener:(sender:any,evt:yfiles.view.TouchEventArgs)=>void):void; - /** - * Adds the given listener for the TouchClick event that occurs when the user performed a tap gesture with a finger on the - * touch screen. - *

- * An event that delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points when the - * user performed a tap gesture with a finger on the touch screen. - *

- *

- * This happens if down and up happens at the same position. - *

- * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeTouchClickListener - */ - addTouchClickListener(listener:(sender:any,evt:yfiles.view.TouchEventArgs)=>void):void; - /** - * Removes the given listener for the TouchClick event that occurs when the user performed a tap gesture with a finger on - * the touch screen. - *

- * An event that delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points when the - * user performed a tap gesture with a finger on the touch screen. - *

- *

- * This happens if down and up happens at the same position. - *

- * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addTouchClickListener - */ - removeTouchClickListener(listener:(sender:any,evt:yfiles.view.TouchEventArgs)=>void):void; - /** - * Adds the given listener for the TouchLongPress event that occurs when the user performed a long press gesture with a - * finger on the touch screen. - *

- * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. - *

- *

- * This happens if the finger is held in the same position for the duration specified in {@link yfiles.view.CanvasComponent#longPressTime} after a - * {@link yfiles.view.CanvasComponent#addTouchDownListener TouchDown}. - *

- * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeTouchLongPressListener - */ - addTouchLongPressListener(listener:(sender:any,evt:yfiles.view.TouchEventArgs)=>void):void; - /** - * Removes the given listener for the TouchLongPress event that occurs when the user performed a long press gesture with a - * finger on the touch screen. - *

- * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. - *

- *

- * This happens if the finger is held in the same position for the duration specified in {@link yfiles.view.CanvasComponent#longPressTime} after a - * {@link yfiles.view.CanvasComponent#addTouchDownListener TouchDown}. - *

- * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addTouchLongPressListener - */ - removeTouchLongPressListener(listener:(sender:any,evt:yfiles.view.TouchEventArgs)=>void):void; - /** - * Gets a list of the active {@link yfiles.view.TouchDevice}s at the time of invocation. - *

- * Note that this is not a live view, but rather a snapshot. - *

- * @type {yfiles.collections.IListEnumerable.} - */ - currentTouchDevices:yfiles.collections.IListEnumerable; - /** - * Gets a value indicating whether at least one finger is on the touch screen. - * @returns true if there is at least one {@link touch device} that is down on the screen. - * @type {boolean} - */ - isTouchDeviceDown:boolean; - /** - * Gets the last {@link yfiles.view.TouchEventArgs touch event} triggered by this instance. - * @type {yfiles.view.TouchEventArgs} - */ - lastTouchEvent:yfiles.view.TouchEventArgs; - /** - * Gets the last {@link yfiles.view.MouseEventArgs mouse event} triggered by this instance. - * @type {yfiles.view.MouseEventArgs} - */ - lastMouseEvent:yfiles.view.MouseEventArgs; - /** - * Gets the last location provided by a pointing device (for instance mouse or touch). - *

- * Unlike {@link yfiles.view.CanvasComponent#lastMouseEvent} and {@link yfiles.view.CanvasComponent#lastTouchEvent} this will always contain the latest location, regardless of what input method generated it. - *

- * @see yfiles.view.CanvasComponent#lastMouseEvent - * @see yfiles.view.CanvasComponent#lastTouchEvent - * @type {yfiles.geometry.Point} - */ - lastEventLocation:yfiles.geometry.Point; - /** - * Adds the given listener for the InputModeChanged event that occurs when the {@link yfiles.view.CanvasComponent#inputMode} property is changed. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#inputMode - * @see yfiles.view.CanvasComponent#removeInputModeChangedListener - */ - addInputModeChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the InputModeChanged event that occurs when the {@link yfiles.view.CanvasComponent#inputMode} property is changed. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#inputMode - * @see yfiles.view.CanvasComponent#addInputModeChangedListener - */ - removeInputModeChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Gets or sets the single {@link yfiles.input.IInputMode} instance that shall be installed for this canvas. - * @default null - * @type {yfiles.input.IInputMode} - */ - inputMode:yfiles.input.IInputMode; - /** - * Gets or sets the radius of the area around the mouse in view coordinates in which a {@link yfiles.input.IHitTestable} may lie to - * be considered a valid hit. - *

- * This value can be queried from within the {@link yfiles.input.IHitTestable} implementation from the {@link yfiles.view.ICanvasContext#hitTestRadius} property. The default value - * is 3.0d - *

- * @default 3.0 - * @type {number} - */ - hitTestRadius:number; - /** - * Adds the given listener for the HitTestRadiusChanged event that occurs when the {@link yfiles.view.CanvasComponent#hitTestRadius} property changes. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeHitTestRadiusChangedListener - */ - addHitTestRadiusChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the HitTestRadiusChanged event that occurs when the {@link yfiles.view.CanvasComponent#hitTestRadius} property changes. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addHitTestRadiusChangedListener - */ - removeHitTestRadiusChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Gets or sets the zoom factor for this {@link yfiles.view.CanvasComponent}. - *

- * A zoom level of 1.0f will make each unit in world-coordinate space appear exactly one unit in screen coordinates wide. - * The default is - * 1.0f. If this property is written, the canvas will zoom to the new value while keeping the center of view at the same - * world coordinates. - *

- *

- * The valid range is bounded by {@link yfiles.view.CanvasComponent#minimumZoom} and {@link yfiles.view.CanvasComponent#maximumZoom} - *

- * @see yfiles.view.CanvasComponent#addZoomChangedListener - * @see yfiles.view.CanvasComponent#minimumZoom - * @see yfiles.view.CanvasComponent#maximumZoom - * @default 1.0 - * @type {number} - */ - zoom:number; - /** - * Adds the given listener for the ZoomChanged event that occurs when the value of the {@link yfiles.view.CanvasComponent#zoom} property has been changed. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeZoomChangedListener - */ - addZoomChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the ZoomChanged event that occurs when the value of the {@link yfiles.view.CanvasComponent#zoom} property has been changed. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addZoomChangedListener - */ - removeZoomChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Gets or sets the minimum zoom factor for this {@link yfiles.view.CanvasComponent}. - *

- * This property sets a lower bound for the allowed values of the {@link yfiles.view.CanvasComponent#zoom} property. If this property is written, the canvas will - * zoom to the new value while keeping the center of view at the same world coordinates. The default is 0.0001 but values - * as small as 0.0000001d are possible. - *

- * @see yfiles.view.CanvasComponent#zoom - * @see yfiles.view.CanvasComponent#maximumZoom - * @default 0.0001 - * @type {number} - */ - minimumZoom:number; - /** - * Gets or sets the maximum zoom value. - *

- * Default value is 100000 - *

- * @default 100000.0 - * @type {number} - */ - maximumZoom:number; - /** - * Gets or sets the current view point. - *

- * The view point is the point in world coordinates that is mapped to the top left corner point in the current viewport. - * Setting this point to another value will redispatch the last mouse event as the mouse will appear to have been moved or - * dragged in the world coordinate system. - *

- * @default '0,0' - * @type {yfiles.geometry.Point} - */ - viewPoint:yfiles.geometry.Point; - /** - * Gets the size of the usable area in which the graph will be displayed. - *

- * This value excludes the scroll bars. - *

- * @type {yfiles.geometry.Size} - */ - innerSize:yfiles.geometry.Size; - /** - * Returns the size of the HTML element. - * @type {yfiles.geometry.Size} - */ - size:yfiles.geometry.Size; - /** - * Gets the currently visible viewing region in world coordinates. - * @see yfiles.view.CanvasComponent#viewPoint - * @see yfiles.view.CanvasComponent#zoom - * @type {yfiles.geometry.Rect} - */ - viewport:yfiles.geometry.Rect; - /** - * Adds the given listener for the GotFocus event that occurs when the {@link yfiles.view.CanvasComponent} got the focus. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeGotFocusListener - */ - addGotFocusListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the GotFocus event that occurs when the {@link yfiles.view.CanvasComponent} got the focus. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addGotFocusListener - */ - removeGotFocusListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Adds the given listener for the LostFocus event that occurs when the {@link yfiles.view.CanvasComponent} lost the focus. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeLostFocusListener - */ - addLostFocusListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the LostFocus event that occurs when the {@link yfiles.view.CanvasComponent} lost the focus. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addLostFocusListener - */ - removeLostFocusListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Gets the {@link yfiles.graph.LookupChain} that can be used do decorate the {@link yfiles.graph.ILookup#lookup} call in the {@link yfiles.view.CanvasComponent#inputModeContext}. - * @type {yfiles.graph.LookupChain} - */ - inputModeContextLookupChain:yfiles.graph.LookupChain; - /** - * Gets an implementation of {@link yfiles.view.ICanvasContext} that describes the state of this {@link yfiles.view.CanvasComponent}. - * @see yfiles.input.IHitTestable - * @see yfiles.view.IBoundsProvider - * @type {yfiles.view.ICanvasContext} - */ - canvasContext:yfiles.view.ICanvasContext; - /** - * Gets or sets the world coordinate at the center of the control. - *

- * This can be used to move the view port. - *

- * @type {yfiles.geometry.Point} - */ - center:yfiles.geometry.Point; - /** - * Gets or sets a property that causes the control to automatically pan the view when the mouse gets dragged outside of the - * bounds of the control. - * @default true - * @type {boolean} - */ - autoDrag:boolean; - /** - * Adds the given listener for the AutoDragChanged event that occurs when the {@link yfiles.view.CanvasComponent#autoDrag} property is changed. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeAutoDragChangedListener - */ - addAutoDragChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the AutoDragChanged event that occurs when the {@link yfiles.view.CanvasComponent#autoDrag} property is changed. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addAutoDragChangedListener - */ - removeAutoDragChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Gets or sets the policy for caching {@link yfiles.view.Visual}s which are temporarily removed from the visual tree. - *

- * Visuals are temporarily removed when they are moved outside the visual part of the canvas (the {@link yfiles.view.CanvasComponent#viewport}) and re-added when they - * enter the {@link yfiles.view.CanvasComponent#viewport} again. Caching prevents the need to re-build the visuals from scratch. - *

- *

- * Visuals are only cached if this property is set to another value than {@link yfiles.view.VisualCachingPolicy#NEVER} and if a - * dispose visual callback is {@link yfiles.view.IRenderContext#setDisposeCallback registered} during {@link yfiles.view.IVisualCreator#createVisual creation}. - *

- * @type {yfiles.view.VisualCachingPolicy} - */ - visualCaching:yfiles.view.VisualCachingPolicy; - /** - * Adds the given listener for the UpdatedVisual event that occurs after the {@link yfiles.view.CanvasComponent#updateVisual visual tree has been updated}. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeUpdatedVisualListener - */ - addUpdatedVisualListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the UpdatedVisual event that occurs after the {@link yfiles.view.CanvasComponent#updateVisual visual tree has been updated}. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addUpdatedVisualListener - */ - removeUpdatedVisualListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Adds the given listener for the UpdatingVisual event that occurs before the {@link yfiles.view.CanvasComponent#updateVisual visual tree is updated}. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeUpdatingVisualListener - */ - addUpdatingVisualListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the UpdatingVisual event that occurs before the {@link yfiles.view.CanvasComponent#updateVisual visual tree is updated}. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addUpdatingVisualListener - */ - removeUpdatingVisualListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Gets the root of the scene graph. - *

- * This group cannot be {@link yfiles.view.ICanvasObject#remove removed}. - *

- * @type {yfiles.view.ICanvasObjectGroup} - */ - rootGroup:yfiles.view.ICanvasObjectGroup; - /** - * Gets or sets the ContentGroup property. - *

- * The content group is the {@link yfiles.view.ICanvasObjectGroup} that should be used by the application code to put actual - * content in. - *

- *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.CanvasComponent#createContentGroup} - * will be called. Upon change the {@link yfiles.view.CanvasComponent#addContentGroupChangedListener ContentGroupChanged} - * event will be triggered. - *

- * @type {yfiles.view.ICanvasObjectGroup} - */ - contentGroup:yfiles.view.ICanvasObjectGroup; - /** - * Adds the given listener for the ContentGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#contentGroup} property has been changed. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeContentGroupChangedListener - */ - addContentGroupChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the ContentGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#contentGroup} property has been changed. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addContentGroupChangedListener - */ - removeContentGroupChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Gets or sets the HighlightGroup property. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.CanvasComponent#createHighlightGroup} - * will be called. Upon change the {@link yfiles.view.CanvasComponent#addHighlightGroupChangedListener HighlightGroupChanged} - * event will be triggered. - *

- * @type {yfiles.view.ICanvasObjectGroup} - */ - highlightGroup:yfiles.view.ICanvasObjectGroup; - /** - * Gets or sets the HighlightGroup property. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.CanvasComponent#createHighlightGroup} - * will be called. Upon change the {@link yfiles.view.CanvasComponent#addHighlightGroupChangedListener HighlightGroupChanged} - * event will be triggered. - *

- * @type {yfiles.view.ICanvasObjectGroup} - */ - focusGroup:yfiles.view.ICanvasObjectGroup; - /** - * Adds the given listener for the FocusGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#focusGroup} property has been changed. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeFocusGroupChangedListener - */ - addFocusGroupChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the FocusGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#focusGroup} property has been changed. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addFocusGroupChangedListener - */ - removeFocusGroupChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Adds the given listener for the HighlightGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#highlightGroup} property has been changed. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeHighlightGroupChangedListener - */ - addHighlightGroupChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the HighlightGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#highlightGroup} property has been changed. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addHighlightGroupChangedListener - */ - removeHighlightGroupChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Gets or sets the SelectionGroup property. - *

- * The selection group is the {@link yfiles.view.ICanvasObjectGroup} that should be used by the application code to put the - * selection paintables in. - *

- *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.CanvasComponent#createSelectionGroup} - * will be called. Upon change the {@link yfiles.view.CanvasComponent#addSelectionGroupChangedListener SelectionGroupChanged} - * event will be triggered. - *

- * @type {yfiles.view.ICanvasObjectGroup} - */ - selectionGroup:yfiles.view.ICanvasObjectGroup; - /** - * Adds the given listener for the SelectionGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#selectionGroup} property has been changed. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeSelectionGroupChangedListener - */ - addSelectionGroupChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the SelectionGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#selectionGroup} property has been changed. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addSelectionGroupChangedListener - */ - removeSelectionGroupChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Gets or sets the InputModeGroup property. - *

- * This is the canvas object group where the {@link yfiles.input.IInputMode}s should add their temporary content to. This group by - * default is in front of the {@link yfiles.view.CanvasComponent#contentGroup}. - *

- *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.CanvasComponent#createInputModeGroup} - * will be called. Upon change the {@link yfiles.view.CanvasComponent#addInputModeGroupChangedListener InputModeGroupChanged} - * event will be triggered. - *

- * @see yfiles.view.CanvasComponent#contentGroup - * @see yfiles.view.CanvasComponent#backgroundGroup - * @type {yfiles.view.ICanvasObjectGroup} - */ - inputModeGroup:yfiles.view.ICanvasObjectGroup; - /** - * Adds the given listener for the InputModeGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#inputModeGroup} property has been changed. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeInputModeGroupChangedListener - */ - addInputModeGroupChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the InputModeGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#inputModeGroup} property has been changed. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addInputModeGroupChangedListener - */ - removeInputModeGroupChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Gets or sets the BackgroundGroup property. - *

- * The background group is the {@link yfiles.view.ICanvasObjectGroup} that should be used by the application code to put background - * elements in. - *

- *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.CanvasComponent#createBackgroundGroup} - * will be called. Upon change the {@link yfiles.view.CanvasComponent#addBackgroundGroupChangedListener BackgroundGroupChanged} - * event will be triggered. - *

- * @see yfiles.view.CanvasComponent#contentGroup - * @type {yfiles.view.ICanvasObjectGroup} - */ - backgroundGroup:yfiles.view.ICanvasObjectGroup; - /** - * Adds the given listener for the BackgroundGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#backgroundGroup} property has been changed. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeBackgroundGroupChangedListener - */ - addBackgroundGroupChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the BackgroundGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#backgroundGroup} property has been changed. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addBackgroundGroupChangedListener - */ - removeBackgroundGroupChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Gets or sets the shape-rendering type for this visual and its children. - *

- * Shape rendering can improve performance but affects the display quality of this visual. - *

- * @type {yfiles.view.ShapeRenderingType} - */ - shapeRendering:yfiles.view.ShapeRenderingType; - /** - * Gets or sets the image-rendering type for this visual and its children. - *

- * Image rendering can improve performance but affects the display quality of images. - *

- * @type {yfiles.view.ImageRenderingType} - */ - imageRendering:yfiles.view.ImageRenderingType; - /** - * Returns an HTML element that can be used to show arbitrary HTML content like overlays, fly-outs, or pop-ups on top of - * this {@link yfiles.view.CanvasComponent}. - *

- * A HTML element that was added to the overlay panel is drawn above the content of the CanvasControl but below its - * scrollbars. In contrast to labels or other model items, the element keeps its size when the canvas is zoomed. It should - * be placed with the CSS position: absolute to prevent multiple overlay elements to interfere with each other. - *

- *

- * HTML elements can be added to and removed from the overlay panel at any time. In addition to this, you can use a - * convenience feature of the constructor ForDiv(div) to add elements to the overlay panel. This constructor copies all - * child elements of the given div element to its overlay panel. - *

- * @type {HTMLElement} - */ - overlayPanel:HTMLElement; - /** - * Gets or sets the value of the drag time. - *

- * This value indicates the amount of time that may pass before a mouse movement is considered a drag when the mouse stays - * within its {@link yfiles.view.CanvasComponent#dragSize} area. The higher the value the later a mouse movement will be recognized as a drag. This influences the - * click-sensitivity, since a mouse button release is only considered a click if there was no drag since the last mouse - * button press. The default value is 300 milliseconds. - *

- * @see yfiles.view.CanvasComponent#dragSize - * @default '00:00:00.3000000' - * @type {yfiles.lang.TimeSpan} - */ - dragTime:yfiles.lang.TimeSpan; - /** - * Gets or sets the value of the double click time. - *

- * This value indicates the amount of time that may pass within which two subsequent mouse clicks are considered multi - * clicks. The higher the value the easier it will be to double-click. The default value is 500 milliseconds. - *

- * @see yfiles.view.CanvasComponent#doubleClickSize - * @type {yfiles.lang.TimeSpan} - */ - doubleClickTime:yfiles.lang.TimeSpan; - /** - * Gets or sets the value of the double tap time. - *

- * This value indicates the amount of time that may pass within which two subsequent touch taps are considered multi taps. - * The higher the value the easier it will be to double-tap. The default value is 500 milliseconds. - *

- * @see yfiles.view.CanvasComponent#doubleTapSize - * @type {yfiles.lang.TimeSpan} - */ - doubleTapTime:yfiles.lang.TimeSpan; - /** - * Gets or sets the value of the long press time. - *

- * This value indicates the amount of time that may pass before a touch down is considered a long press when the pointer - * stays within its {@link yfiles.view.CanvasComponent#dragSize} area. The higher the value the later a touch pointer movement will be recognized as a long press. The - * default value is 250 milliseconds. - *

- * @see yfiles.view.CanvasComponent#dragSize - * @type {yfiles.lang.TimeSpan} - */ - longPressTime:yfiles.lang.TimeSpan; - /** - * Gets or sets the area in view coordinates the mouse may stay in before a movement is considered a drag. - *

- * If the mouse is moved within this area longer than {@link yfiles.view.CanvasComponent#dragTime} milliseconds, the movement will be considered a drag, nevertheless. - * The larger the area the later a mouse movement will be recognized as a drag. This influences the click-sensitivity, - * since a mouse button release is only considered a click if there was no drag since the last mouse button press. The - * default value is (5, 5). - *

- * @see yfiles.view.CanvasComponent#dragSize - * @default '5,5' - * @type {yfiles.geometry.Size} - */ - dragSize:yfiles.geometry.Size; - /** - * Gets or sets the area in view coordinates the mouse needs to stay in before multiple clicks are considered multiple - * single clicks instead of multi-clicks. - *

- * If the mouse stays within this within than {@link yfiles.view.CanvasComponent#doubleClickTime}, multiple clicks will be considered double or multi-clicks. The default - * value is (10, 10). - *

- * @see yfiles.view.CanvasComponent#doubleClickTime - * @type {yfiles.geometry.Size} - */ - doubleClickSize:yfiles.geometry.Size; - /** - * Gets or sets the area in view coordinates the touch pointer needs to stay in before multiple taps are considered - * multiple single taps instead of multi-taps. - *

- * If the touch pointer stays within this within than {@link yfiles.view.CanvasComponent#doubleTapTime}, multiple taps will be considered double or multi-taps. The default - * value is (20, 20). - *

- * @see yfiles.view.CanvasComponent#doubleTapTime - * @type {yfiles.geometry.Size} - */ - doubleTapSize:yfiles.geometry.Size; - /** - * Gets or sets the factor by which the zoom level changes when the mouse wheel is turned. - *

- * The default value is 1.2. - *

- * @default 1.2 - * @type {number} - */ - mouseWheelZoomFactor:number; - /** - * Adds the given listener for the MouseWheelZoomFactorChanged event that occurs when the value of the {@link yfiles.view.CanvasComponent#mouseWheelZoomFactor} property has been - * changed. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeMouseWheelZoomFactorChangedListener - */ - addMouseWheelZoomFactorChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the MouseWheelZoomFactorChanged event that occurs when the value of the {@link yfiles.view.CanvasComponent#mouseWheelZoomFactor} property has - * been changed. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addMouseWheelZoomFactorChangedListener - */ - removeMouseWheelZoomFactorChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Gets or sets a factor that controls how fast the viewport scrolls when the mouse wheel is turned. - *

- * Scrolling can work either a few lines at a time (per notch of the scroll wheel) or one page at a time. This is a system - * setting. This property controls how many pixels represent a line if scrolling is done by line. In case scrolling is done - * by page, this property has no effect. - *

- *

- * The default value of 5 pixels. To speed up scrolling, set a larger value, to slow down scrolling, set a smaller value. - *

- * @see yfiles.view.CanvasComponent#mouseWheelZoomFactor - * @see yfiles.view.CanvasComponent#mouseWheelBehavior - * @see yfiles.view.MouseEventArgs#scrollAmount - * @see yfiles.view.MouseEventArgs#deltaMode - * @default 5 - * @type {number} - */ - mouseWheelScrollFactor:number; - /** - * Adds the given listener for the MouseWheelScrollFactorChanged event that occurs when the value of the {@link yfiles.view.CanvasComponent#mouseWheelScrollFactor} property has been - * changed. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeMouseWheelScrollFactorChangedListener - */ - addMouseWheelScrollFactorChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the MouseWheelScrollFactorChanged event that occurs when the value of the {@link yfiles.view.CanvasComponent#mouseWheelScrollFactor} property has - * been changed. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addMouseWheelScrollFactorChangedListener - */ - removeMouseWheelScrollFactorChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Gets or sets the auto drag insets. - *

- * If the mouse is being dragged within the insets of the control specified using this property, the control will - * automatically scroll. - *

- * @see yfiles.view.CanvasComponent#autoDrag - * @default '10' - * @type {yfiles.geometry.Insets} - */ - autoDragInsets:yfiles.geometry.Insets; - /** - * Adds the given listener for the PrepareRenderContext event that occurs before the visual tree is painted to prepare the - * {@link yfiles.view.IRenderContext}. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removePrepareRenderContextListener - */ - addPrepareRenderContextListener(listener:(sender:any,evt:yfiles.view.PrepareRenderContextEventArgs)=>void):void; - /** - * Removes the given listener for the PrepareRenderContext event that occurs before the visual tree is painted to prepare - * the {@link yfiles.view.IRenderContext}. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addPrepareRenderContextListener - */ - removePrepareRenderContextListener(listener:(sender:any,evt:yfiles.view.PrepareRenderContextEventArgs)=>void):void; - /** - * Gets or sets the InputModeContext property. - *

- * This context object is passed to {@link yfiles.input.IInputMode} instances during {@link yfiles.input.IInputMode#install installation} and removal. - *
- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.CanvasComponent#createInputModeContext} - * will be called. Upon change the {@link yfiles.view.CanvasComponent#addInputModeChangedListener InputModeChanged} - * event will be triggered. - *

- * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Adds the given listener for the InputModeContextChanged event that occurs when the {@link yfiles.view.CanvasComponent#inputModeContext} property has been changed. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#removeInputModeContextChangedListener - */ - addInputModeContextChangedListener(listener:(sender:any,evt:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the InputModeContextChanged event that occurs when the {@link yfiles.view.CanvasComponent#inputModeContext} property has been changed. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#addInputModeContextChangedListener - */ - removeInputModeContextChangedListener(listener:(sender:any,evt:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Gets or sets a value indicating whether navigation related command bindings are enabled. - *

- * By default this feature is enabled. - *

- *

- * This property enables/disables the following commands: - *

- *
    - *
  • {@link yfiles.input.ICommand#INCREASE_ZOOM}
  • - *
  • {@link yfiles.input.ICommand#ZOOM}
  • - *
  • {@link yfiles.input.ICommand#DECREASE_ZOOM}
  • - *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_DOWN}
  • - *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_UP}
  • - *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_LEFT}
  • - *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_RIGHT}
  • - *
- * @default true - * @type {boolean} - */ - navigationCommandsEnabled:boolean; - /** - * Gets the resources for this instance. - *

- * Resources are named instances of objects that can be retrieved by other parts of the infrastructure that deal with this - * instance, either directly or indirectly. - *

- * @type {yfiles.collections.IMap.} - */ - resources:yfiles.collections.IMap; - /** - * Gets or sets the interval of the size changed timer. - * @see yfiles.view.CanvasComponent#addSizeChangedListener - * @see yfiles.view.CanvasComponent#sizeChangedDetection - * @static - * @type {number} - */ - static sizeChangedTimerInterval:number; - /** - * Adds the given listener for the SizeChanged event that occurs when the size of this Control is changed. - * @param listener The listener to add. - * @see yfiles.view.CanvasComponent#sizeChangedDetection - * @see yfiles.view.SizeChangedDetectionMode - * @see yfiles.view.CanvasComponent#removeSizeChangedListener - */ - addSizeChangedListener(listener:(sender:any,evt:yfiles.view.SizeChangedEventArgs)=>void):void; - /** - * Removes the given listener for the SizeChanged event that occurs when the size of this Control is changed. - * @param listener The listener to remove. - * @see yfiles.view.CanvasComponent#sizeChangedDetection - * @see yfiles.view.SizeChangedDetectionMode - * @see yfiles.view.CanvasComponent#addSizeChangedListener - */ - removeSizeChangedListener(listener:(sender:any,evt:yfiles.view.SizeChangedEventArgs)=>void):void; - /** - * Gets or sets how size changes of this {@link yfiles.view.CanvasComponent} will be detected. - *

- * Since there is no size changed event in HTML, {@link yfiles.view.CanvasComponent} comes with its own methods to detect whether - * the size of its Div element has changed. This is needed to update its Size accordingly. - *

- *

- * The preferred and default mode is {@link yfiles.view.SizeChangedDetectionMode#SENSOR}. If that is not available, {@link yfiles.view.SizeChangedDetectionMode#TIMER} - * is used as fall back instead. - *

- *

- * If the Div of this control is removed from the DOM and the current mode is {@link yfiles.view.SizeChangedDetectionMode#TIMER}, - * the mode is automatically changed to - * {@link yfiles.view.SizeChangedDetectionMode#NONE}. Thus, if the element is later re-added to the DOM, the timer mode must be set - * again. - *

- * @type {yfiles.view.SizeChangedDetectionMode} - */ - sizeChangedDetection:yfiles.view.SizeChangedDetectionMode; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.CanvasComponent; - } - /** - * This class sets up an {@link yfiles.view.IRenderContext} object for exporting the contents of a {@link yfiles.view.CanvasComponent} (see - * Setup). - *

- * Also it provides ready-to-use methods to export the canvas contents to a standalone SVG. - *

- *
    - *
  • It is possible to export only a part of the contents, see {@link yfiles.view.SvgExport#worldBounds}.
  • - *
  • - * The size of the target graphics is controlled by the {@link yfiles.view.SvgExport#scale}. For a given target width or height, the apropriate scale can be - * calculated using {@link yfiles.view.SvgExport#calculateScaleForWidth} and {@link yfiles.view.SvgExport#calculateScaleForHeight}. - *
  • - *
- * @class - */ - export interface SvgExport extends yfiles.lang.Object{} - export class SvgExport { - /** - * Creates a new {@link yfiles.view.SvgExport} instance for the given world bounds and scale. - * @param worldBounds the bounds of the content to export, see {@link #worldBounds} - * @param [scale=1.0] the scale, see {@link #scale} - */ - constructor(worldBounds:yfiles.geometry.Rect,scale?:number); - /** - * Calculates the value to set the {@link yfiles.view.SvgExport#scale} to in order to achieve the given target height (without {@link yfiles.view.SvgExport#margins}). - *

- * This method returns 1.0 if the {@link yfiles.view.SvgExport#worldBounds} height is zero or negative. - *

- * @param height the height of the target image - * @returns the scale value to use - */ - calculateScaleForHeight(height:number):number; - /** - * Calculates the value to set the {@link yfiles.view.SvgExport#scale} to in order to achieve the given target width (without {@link yfiles.view.SvgExport#margins}). - *

- * This method returns 1.0 if the {@link yfiles.view.SvgExport#worldBounds} width is zero or negative. - *

- * @param width the width of the target image - * @returns the scale value to use - */ - calculateScaleForWidth(width:number):number; - /** - * Returns an initialized {@link yfiles.view.IRenderContext} and changes the given transform and the clip bounds such that a part - * of the given {@link yfiles.view.CanvasComponent} instance can be exported to an image. - * @param canvas The {@link } instance to export. - * @returns An {@link } to use. - */ - createRenderContext(canvas:yfiles.view.CanvasComponent):yfiles.view.IRenderContext; - /** - * Encodes the given SVG document as Data URI. - *

- * This method escapes non-Latin1 characters, does a base64 encoding, and returns the result as data URI. - *

- * @param svgXml A string containing the SVG document. - * @returns A data URI of the SVG document. - * @static - */ - static encodeSvgDataUrl(svgXml:string):string; - /** - * Exports the contents of the {@link yfiles.view.CanvasComponent} to a single, standalone SVG element. - *

- * The asynchronous version of this method, - * {@link yfiles.view.SvgExport#exportSvgAsync}, is capable of encoding and inlining images that are embedded in the SVG. - *

- * @param canvas The canvas to be exported. - * @returns An SVG element with the canvas contents. - */ - exportSvg(canvas:yfiles.view.CanvasComponent):Element; - /** - * Exports the contents of the {@link yfiles.view.CanvasComponent} to a single, standalone SVG element. - *

- * In addition, images are inlined into the SVG using base64 encoding if {@link yfiles.view.SvgExport#encodeImagesBase64} is set to true. Image inlining can be controlled - * for each image individually by overwriting the predicate method {@link yfiles.view.SvgExport#shouldEncodeImageBase64}. - *

- *

- * SVG image elements are replaced with a copy of the referenced SVG element if {@link yfiles.view.SvgExport#inlineSvgImages} is set to true. Image encoding can be - * controlled for each image individually by overwriting the predicate method {@link yfiles.view.SvgExport#shouldInlineSvgImage}. - *

- * @param canvas The canvas to be exported. - * @returns - */ - exportSvgAsync(canvas:yfiles.view.CanvasComponent):Promise; - /** - * Serializes the given SVG element to a string. - *

- * This method adds SVG namespace and xlink namespace declarations and replaces href with xlink:href. - *

- * @param svg The SVG element to export. - * @returns A string representation of the SVG. - * @static - */ - static exportSvgString(svg:Element):string; - /** - * Returns a suitable clip to use for the visual for this exporter. - * @returns The clip. - */ - getClip():yfiles.geometry.Rect; - /** - * Prepares the imported SVG element before it is placed in the DOM as a replacement for the original image. - *

- * This method can be used to modify the element that is placed in the DOM. This specific implementation copies the values - * of the x, y, width, height and preserveAspectRatio attributes from the original image element to the imported SVG - * element. In addition, the SVG is wrapped in a g element to support the transform of the original image. If the original - * image element has an id attribute, it is copied to the wrapping g element. - *

- * @param importedSvg The root element of the SVG file that's referenced by the original image element. - * @param originalImage The original image element that will be replaced. - * @returns The element that's actually placed in the DOM as a replacement of the originalImage. - * @see yfiles.view.SvgExport#inlineSvgImages - * @see yfiles.view.SvgExport#exportSvgAsync - * @see yfiles.view.SvgExport#shouldInlineSvgImage - * @protected - */ - prepareInlinedImage(importedSvg:Element,originalImage:SVGImageElement):Element; - /** - * Specifies whether or not an image should be encoded to base64. - *

- * This implementation returns the value of {@link yfiles.view.SvgExport#encodeImagesBase64} for all values of image. - *

- * @param image The image to be encoded. - * @returns Whether the given image should be encoded. - * @protected - */ - shouldEncodeImageBase64(image:SVGImageElement):boolean; - /** - * Specifies whether or not an SVG image should be inlined. - *

- * This implementation returns the value of {@link yfiles.view.SvgExport#inlineSvgImages} for all values of image. - *

- * @param image The image to be inlined. - * @returns Whether the given image should be inlined. - * @protected - */ - shouldInlineSvgImage(image:SVGImageElement):boolean; - /** - * Gets or sets the bounds of the content to export in world coordinates. - * @type {yfiles.geometry.Rect} - */ - worldBounds:yfiles.geometry.Rect; - /** - * Gets or sets the scale for the export. - *

- * A scale of 1 preserves the original size, a scale of 0.5 results in a target image with half the original size and so - * on. - *

- *

- * This value has to be strictly greater than 0 and finite. Its default value is 1.0 - *

- * @type {number} - */ - scale:number; - /** - * Gets or sets the {@link yfiles.view.ICanvasContext#zoom} property to use during the creation of the visualization. - *

- * In contrast to the {@link yfiles.view.SvgExport#scale} property, which works on the output graphics, this property determines what zoom value is to be - * assumed on the canvas when creating the visual. This can affect the rendering of zoom dependent visuals. - *

- *

- * This value has to be strictly greater than 0. Its default value is 1.0 - *

- * @type {number} - */ - zoom:number; - /** - * Gets or sets the margins for the exported image. - *

- * The margins are added to the content. This means that an image with non-zero margins is larger than the {@link yfiles.view.SvgExport#worldBounds} even if the {@link yfiles.view.SvgExport#scale} is - * 1.0. The margins are not scaled. They are interpreted to be in units (pixels for bitmaps) for the resulting image. The - * default is an empty margin instance. - *

- * @type {yfiles.geometry.Insets} - */ - margins:yfiles.geometry.Insets; - /** - * Gets the resulting width of the target image with respect to {@link yfiles.view.SvgExport#worldBounds}, {@link yfiles.view.SvgExport#scale} and {@link yfiles.view.SvgExport#margins}. - * @type {number} - */ - viewWidth:number; - /** - * Gets the resulting height of the target image with respect to {@link yfiles.view.SvgExport#worldBounds}, {@link yfiles.view.SvgExport#scale} and {@link yfiles.view.SvgExport#margins}. - * @type {number} - */ - viewHeight:number; - /** - * Determines whether children of the {@link yfiles.view.CanvasComponent}'s defs section that aren't known to the {@link yfiles.view.SvgDefsManager} - * should be copied to the exported SVG. - * @type {boolean} - */ - copyDefsElements:boolean; - /** - * Determines whether all images are encoded to Base64 in {@link yfiles.view.SvgExport#exportSvgAsync}. - *

- * Override {@link yfiles.view.SvgExport#shouldEncodeImageBase64} to control the encoding for each image separately. - *

- * @see yfiles.view.SvgExport#exportSvgAsync - * @see yfiles.view.SvgExport#shouldEncodeImageBase64 - * @type {boolean} - */ - encodeImagesBase64:boolean; - /** - * Determines whether all SVG images should be inlined in the SVG element in {@link yfiles.view.SvgExport#exportSvgAsync}. - *

- * Override {@link yfiles.view.SvgExport#shouldInlineSvgImage} to control the inlining for each image separately. - *

- * @see yfiles.view.SvgExport#exportSvgAsync - * @see yfiles.view.SvgExport#shouldInlineSvgImage - * @type {boolean} - */ - inlineSvgImages:boolean; - /** - * Determines whether the IDs of an inline SVG image should be scoped to ensure that they are unique for the given image. - *

- * This setting is enabled by default but affects only IDs of inlined images that do not contain an (optional) base IRI. - *

- * @see yfiles.view.SvgExport#inlineSvgImages - * @type {boolean} - */ - ensureUniqueIds:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.SvgExport; - } - /** - * Helper class for {@link yfiles.view.CanvasComponent} that manages the defs section of the SVG document. - *

- * This class is used internally by {@link yfiles.view.CanvasComponent} and operates on instances of {@link yfiles.view.ISvgDefsCreator}. - *

- * @see yfiles.view.CanvasComponent#svgDefsManager - * @class - */ - export interface SvgDefsManager extends yfiles.lang.Object{} - export class SvgDefsManager { - /** - * Initializes a new instance of the {@link yfiles.view.SvgDefsManager} class. - * @param defsElement The defs element of the svg document that will be managed by this instance. - */ - constructor(defsElement:SVGDefsElement); - /** - * Triggers the clean up for svg defs on the provided control. - * @param canvas - */ - cleanupDefs(canvas:yfiles.view.CanvasComponent):void; - /** - * Generates an ID that is globally unique among all {@link yfiles.view.SvgDefsManager} instances. - *

- * This ID should be used for the "id" attribute of DOM nodes. - *

- * @returns A globally unique ID. - */ - generateUniqueDefsId():string; - /** - * Gets or sets the interval for the timer to trigger the cleanup event. - *

- * By default this is 10 seconds. - *

- * @type {yfiles.lang.TimeSpan} - */ - cleanupTimerInterval:yfiles.lang.TimeSpan; - /** - * Gets or sets the prefix to use for the {@link yfiles.view.SvgDefsManager#generateUniqueDefsId unique IDs}. - *

- * By default this is ygc<number> - *

- * @type {string} - */ - customPrefix:string; - /** - * Yields the defs element this instance is managing. - * @type {SVGDefsElement} - */ - defs:SVGDefsElement; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.SvgDefsManager; - } - /** - * A component for displaying and editing an {@link yfiles.graph.IGraph}. - *

- * This is a specialized {@link yfiles.view.CanvasComponent} that can hold, display, and edit an {@link yfiles.graph.IGraph} instance. It - * provides access to the {@link yfiles.view.GraphComponent#graph} and {@link yfiles.view.GraphComponent#selection} instances. - *

- *

- * This class has bindings for the following {@link yfiles.input.ICommand}s. - *

- *
    - *
  • {@link yfiles.input.ICommand#FIT_GRAPH_BOUNDS} that invokes {@link yfiles.view.GraphComponent#fitGraphBounds}
  • - *
  • {@link yfiles.input.ICommand#SET_CURRENT_ITEM} for setting the {@link yfiles.view.GraphComponent#currentItem}
  • - *
  • {@link yfiles.input.ICommand#ZOOM_TO_CURRENT_ITEM} for adjusting the {@link yfiles.view.CanvasComponent#viewport} to the {@link yfiles.view.GraphComponent#currentItem}
  • - *
- *

- * The {@link yfiles.input.ICommand#ZOOM_TO_CURRENT_ITEM} is enabled, if {@link yfiles.view.CanvasComponent#navigationCommandsEnabled} is true. - *

- *

- * The components that can be used to display and edit a model are discussed in the section - * {@link @DGUIDE_PREFIX@/view_graphcontrol.html The Component for Displaying Graphs}. - *

- *

Related demos:

- *
    - *
  • Demo: GraphViewer, Demo.yFiles.Graph.Viewer
  • - *
  • Demo: SimpleEditorForm, Demo.yFiles.Graph.SimpleEditor
  • - *
- * @class - * @extends {yfiles.view.CanvasComponent} - */ - export interface GraphComponent extends yfiles.view.CanvasComponent{} - export class GraphComponent { - /** - * Creates a new instance of {@link yfiles.view.GraphComponent} using the div element that is specified by the selector. - *

- * If the {@link yfiles.view.GraphComponent#graph} and {@link yfiles.view.GraphSelection} properties are not populated externally they will be initialized with default - * values upon first access. Thus this instance can be used right away without any further initialization. - *

- * @param selector The CSS selector or id for an existing div element - */ - constructor(selector:string); - /** - * Creates a new instance of {@link yfiles.view.GraphComponent} using the div element that is specified by the selector. - *

- * If the {@link yfiles.view.GraphComponent#graph} and {@link yfiles.view.GraphSelection} properties are not populated externally they will be initialized with default - * values upon first access. Thus this instance can be used right away without any further initialization. - *

- * @param {Object} options The parameters to pass. - * @param options.selector The CSS selector or id for an existing div element - * @param {yfiles.input.IInputMode} options.inputMode The single {@link yfiles.input.IInputMode} instance that shall be installed for this canvas. - *

- * This option sets the {@link yfiles.view.CanvasComponent#inputMode} property on the created object. - *

- * @param {yfiles.graph.IGraph} options.graph The graph that is displayed in this control. - *

- * This option sets the {@link yfiles.view.GraphComponent#graph} property on the created object. - *

- * @param {yfiles.graph.GraphClipboard} options.clipboard The {@link yfiles.graph.GraphClipboard} associated with this control. - *

- * This option sets the {@link yfiles.view.GraphComponent#clipboard} property on the created object. - *

- * @param {yfiles.view.IGraphSelection} options.selection The selection model that is used for this control. - *

- * This option sets the {@link yfiles.view.GraphComponent#selection} property on the created object. - *

- */ - constructor(options:{selector:string,inputMode?:yfiles.input.IInputMode,graph?:yfiles.graph.IGraph,clipboard?:yfiles.graph.GraphClipboard,selection?:yfiles.view.IGraphSelection}); - /** - * Creates a new instance of the {@link yfiles.view.GraphComponent} in the given div element. - *

- * If the {@link yfiles.view.GraphComponent#graph} and {@link yfiles.view.GraphSelection} properties are not populated externally they will be initialized with default - * values upon first access. Thus this instance can be used right away without any further initialization. - *

- * @param div The existing div element to use for rendering the canvas into. - */ - constructor(div:HTMLDivElement); - /** - * Creates a new instance of the {@link yfiles.view.GraphComponent} in the given div element. - *

- * If the {@link yfiles.view.GraphComponent#graph} and {@link yfiles.view.GraphSelection} properties are not populated externally they will be initialized with default - * values upon first access. Thus this instance can be used right away without any further initialization. - *

- * @param {Object} options The parameters to pass. - * @param options.div The existing div element to use for rendering the canvas into. - * @param {yfiles.input.IInputMode} options.inputMode The single {@link yfiles.input.IInputMode} instance that shall be installed for this canvas. - *

- * This option sets the {@link yfiles.view.CanvasComponent#inputMode} property on the created object. - *

- * @param {yfiles.graph.IGraph} options.graph The graph that is displayed in this control. - *

- * This option sets the {@link yfiles.view.GraphComponent#graph} property on the created object. - *

- * @param {yfiles.graph.GraphClipboard} options.clipboard The {@link yfiles.graph.GraphClipboard} associated with this control. - *

- * This option sets the {@link yfiles.view.GraphComponent#clipboard} property on the created object. - *

- * @param {yfiles.view.IGraphSelection} options.selection The selection model that is used for this control. - *

- * This option sets the {@link yfiles.view.GraphComponent#selection} property on the created object. - *

- */ - constructor(options:{div:HTMLDivElement,inputMode?:yfiles.input.IInputMode,graph?:yfiles.graph.IGraph,clipboard?:yfiles.graph.GraphClipboard,selection?:yfiles.view.IGraphSelection}); - /** - * Creates a new instance of the {@link yfiles.view.GraphComponent}. - *

- * If the {@link yfiles.view.GraphComponent#graph} and {@link yfiles.view.GraphSelection} properties are not populated externally they will be initialized with default - * values upon first access. Thus this instance can be used right away without any further initialization. This constructor - * creates a new div element that needs to be manually added to the DOM. - *

- * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.input.IInputMode} options.inputMode The single {@link yfiles.input.IInputMode} instance that shall be installed for this canvas. - *

- * This option sets the {@link yfiles.view.CanvasComponent#inputMode} property on the created object. - *

- * @param {yfiles.graph.IGraph} options.graph The graph that is displayed in this control. - *

- * This option sets the {@link yfiles.view.GraphComponent#graph} property on the created object. - *

- * @param {yfiles.graph.GraphClipboard} options.clipboard The {@link yfiles.graph.GraphClipboard} associated with this control. - *

- * This option sets the {@link yfiles.view.GraphComponent#clipboard} property on the created object. - *

- * @param {yfiles.view.IGraphSelection} options.selection The selection model that is used for this control. - *

- * This option sets the {@link yfiles.view.GraphComponent#selection} property on the created object. - *

- */ - constructor(options?:{inputMode?:yfiles.input.IInputMode,graph?:yfiles.graph.IGraph,clipboard?:yfiles.graph.GraphClipboard,selection?:yfiles.view.IGraphSelection}); - /** - * Factory method for the {@link yfiles.view.GraphComponent#focusIndicatorManager} property. - *

- * This method will be called upon first access to the {@link yfiles.view.GraphComponent#focusIndicatorManager} property. - *

- * @returns a new instance of {@link }. - * @protected - */ - createFocusIndicatorManager():yfiles.view.FocusIndicatorManager; - /** - * Factory method for the Graph property. - *

- * This method will be called upon first access to the {@link yfiles.view.GraphComponent#graph} property. - *

- * @returns a new instance of {@link } - * @protected - */ - createGraph():yfiles.graph.IGraph; - /** - * Creates the default instance to use if no custom instance has been set. - * @returns A default {@link } instance. - * @protected - */ - createGraphClipboard():yfiles.graph.GraphClipboard; - /** - * Factory method for the {@link yfiles.view.GraphComponent#graphModelManager} property. - *

- * This method will be called upon first access to the {@link yfiles.view.GraphComponent#graphModelManager} property. - *

- * @returns a new instance of {@link }. - * @protected - */ - createGraphModelManager():yfiles.view.GraphModelManager; - /** - * Factory method for the {@link yfiles.view.GraphComponent#highlightIndicatorManager} property. - *

- * This method will be called upon first access to the {@link yfiles.view.GraphComponent#highlightIndicatorManager} property. - *

- * @returns a new instance of {@link #highlightIndicatorManager}. - * @protected - */ - createHighlightIndicatorManager():yfiles.view.HighlightIndicatorManager; - /** - * Factory method for the Selection property. - *

- * This method will be called upon first access to the {@link yfiles.view.GraphComponent#selection} property. - *

- * @returns a new instance of {@link } - * @protected - */ - createSelection():yfiles.view.IGraphSelection; - /** - * Factory method for the {@link yfiles.view.GraphComponent#selectionIndicatorManager} property. - *

- * This method will be called upon first access to the {@link yfiles.view.GraphComponent#selectionIndicatorManager} property. - *

- * @returns a new instance of {@link } - * @protected - */ - createSelectionIndicatorManager():yfiles.view.SelectionIndicatorManager; - /** - * {@link yfiles.view.CanvasComponent#updateContentRect Updates the content rectangle} for the {@link yfiles.view.CanvasComponent#contentGroup} considering the provided insets and - * {@link yfiles.view.CanvasComponent#fitContent adjusts the viewport to encompass the contents}. - * @param [insets=null] - */ - fitGraphBounds(insets?:yfiles.geometry.Insets):void; - /** - * Convenience method that runs a layouter on the graph of a given graph control and animates the transition. - *

- * An event is called once the animation has finished. - *

- *

- * The implementation simply delegates to a properly configured instance of {@link yfiles.layout.LayoutExecutor}. In addition to - * the default configuration, it enables {@link yfiles.layout.LayoutExecutor#animateViewport}, {@link yfiles.layout.LayoutExecutor#easedAnimation}, and {@link yfiles.layout.LayoutExecutor#updateContentRect}. For more fine-grained control of the animation, use {@link yfiles.layout.LayoutExecutor} - * directly. - *

- * @param layout - * @param [morphDuration=null] - * @param [layoutData=null] - * @returns - */ - morphLayout(layout:yfiles.layout.ILayoutAlgorithm,morphDuration?:yfiles.lang.TimeSpan,layoutData?:yfiles.layout.LayoutData):Promise; - /** - * Convenience method that runs a layouter on the graph of a given graph control and animates the transition. - *

- * An event is called once the animation has finished. - *

- *

- * The implementation simply delegates to a properly configured instance of {@link yfiles.layout.LayoutExecutor}. In addition to - * the default configuration, it enables {@link yfiles.layout.LayoutExecutor#animateViewport}, {@link yfiles.layout.LayoutExecutor#easedAnimation}, and {@link yfiles.layout.LayoutExecutor#updateContentRect}. For more fine-grained control of the animation, use {@link yfiles.layout.LayoutExecutor} - * directly. - *

- * @param {Object} options The parameters to pass. - * @param options.layout - * @param [options.morphDuration=null] - * @param [options.layoutData=null] - * @returns - */ - morphLayout(options:{layout:yfiles.layout.ILayoutAlgorithm,morphDuration?:yfiles.lang.TimeSpan,layoutData?:yfiles.layout.LayoutData}):Promise; - /** - * Gets or sets the 'current' item. - * @default null - * @type {yfiles.graph.IModelItem} - */ - currentItem:yfiles.graph.IModelItem; - /** - * Adds the given listener for the CurrentItemChanged event that occurs when the {@link yfiles.view.GraphComponent#currentItem} property has changed its value. - * @param listener The listener to add. - * @see yfiles.view.GraphComponent#removeCurrentItemChangedListener - */ - addCurrentItemChangedListener(listener:(sender:any,evt:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the CurrentItemChanged event that occurs when the {@link yfiles.view.GraphComponent#currentItem} property has changed its value. - * @param listener The listener to remove. - * @see yfiles.view.GraphComponent#addCurrentItemChangedListener - */ - removeCurrentItemChangedListener(listener:(sender:any,evt:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Gets or sets the {@link yfiles.view.GraphComponent#selectionIndicatorManager} property. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.GraphComponent#createSelectionIndicatorManager} - * will be called. - *

- * @type {yfiles.view.SelectionIndicatorManager.} - */ - selectionIndicatorManager:yfiles.view.SelectionIndicatorManager; - /** - * Gets or sets the {@link yfiles.view.GraphComponent#highlightIndicatorManager} property. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.GraphComponent#createHighlightIndicatorManager} - * will be called. - *

- * @type {yfiles.view.HighlightIndicatorManager.} - */ - highlightIndicatorManager:yfiles.view.HighlightIndicatorManager; - /** - * Gets or sets the {@link yfiles.view.GraphComponent#focusIndicatorManager} property. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.GraphComponent#createFocusIndicatorManager} - * will be called. - *

- * @type {yfiles.view.FocusIndicatorManager.} - */ - focusIndicatorManager:yfiles.view.FocusIndicatorManager; - /** - * Gets or sets the {@link yfiles.view.GraphComponent#graphModelManager} property. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.GraphComponent#createGraphModelManager} - * will be called. - *

- * @type {yfiles.view.GraphModelManager} - */ - graphModelManager:yfiles.view.GraphModelManager; - /** - * Gets or sets the graph that is displayed in this control. - *

- * Normally the {@link yfiles.view.GraphSelection} property must be adjusted accordingly if the graph instance is replaced. Also - * depending on the {@link yfiles.input.IInputMode} implementation the instances used in this component might need to be replaced - * or adjusted, too. If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.GraphComponent#createGraph} - * will be called. - *

- * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - /** - * Adds the given listener for the GraphChanged event that occurs when the {@link yfiles.view.GraphComponent#graph} property has been changed. - * @param listener The listener to add. - * @see yfiles.view.GraphComponent#removeGraphChangedListener - */ - addGraphChangedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the GraphChanged event that occurs when the {@link yfiles.view.GraphComponent#graph} property has been changed. - * @param listener The listener to remove. - * @see yfiles.view.GraphComponent#addGraphChangedListener - */ - removeGraphChangedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Gets or sets the selection model that is used for this control. - *

- * The selection model instance needs to be adjusted, normally if the {@link yfiles.view.GraphComponent#graph} instance is changed. If the field has not yet been - * initialized upon first access, the factory method {@link yfiles.view.GraphComponent#createSelection} will be called. - *

- * @type {yfiles.view.IGraphSelection} - */ - selection:yfiles.view.IGraphSelection; - /** - * Gets or sets the {@link yfiles.graph.GraphClipboard} associated with this control. - *

- * If no instance has been configured with this control, a default implementation will be used. - *

- * @type {yfiles.graph.GraphClipboard} - */ - clipboard:yfiles.graph.GraphClipboard; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.GraphComponent; - } - /** - * Convenience component implementation that shows an overview of an {@link yfiles.graph.IGraph} contained in another {@link yfiles.view.GraphOverviewComponent#graphComponent}. - *

- * This component uses a {@link yfiles.view.GraphOverviewComponent#graphVisualCreator} to display the graph in a preview mode and an {@link yfiles.view.GraphOverviewComponent#overviewInputMode} to allow for easily navigating in the {@link yfiles.view.GraphOverviewComponent#graphComponent}. - *

- *

Related demos:

- *
    - *
  • Demo: SimpleEditorForm, Demo.yFiles.Graph.SimpleEditor
  • - *
- * @class - * @extends {yfiles.view.CanvasComponent} - */ - export interface GraphOverviewComponent extends yfiles.view.CanvasComponent{} - export class GraphOverviewComponent { - /** - * Creates a new instance of {@link yfiles.view.GraphOverviewComponent} using the div element that is specified by the selector and - * that is optionally bound to the provided {@link yfiles.view.GraphOverviewComponent#graphComponent}. - *

- * If no graphComponent is provided, in order for this instance to be useful, either the {@link yfiles.view.GraphOverviewComponent#graphComponent} or the {@link yfiles.view.GraphOverviewComponent#graph} property need to be set. - *

- * @param [graphComponent=null] The {@link #graphComponent} to bind this instance to. If omitted, the property needs to be set to initialize the component. - * @param selector The CSS selector or id for an existing div element - */ - constructor(selector:string,graphComponent?:yfiles.view.GraphComponent); - /** - * Creates a new instance of {@link yfiles.view.GraphOverviewComponent} using the div element that is specified by the selector and - * that is optionally bound to the provided {@link yfiles.view.GraphOverviewComponent#graphComponent}. - *

- * If no graphComponent is provided, in order for this instance to be useful, either the {@link yfiles.view.GraphOverviewComponent#graphComponent} or the {@link yfiles.view.GraphOverviewComponent#graph} property need to be set. - *

- * @param {Object} options The parameters to pass. - * @param [options.graphComponent=null] The {@link #graphComponent} to bind this instance to. If omitted, the property needs to be set to initialize the component. - * @param options.selector The CSS selector or id for an existing div element - * @param {boolean} options.svgRendering A value indicating whether the graph is rendered using SVG rendering. - *

- * This option sets the {@link yfiles.view.GraphOverviewComponent#svgRendering} property on the created object. - *

- */ - constructor(options:{selector:string,graphComponent?:yfiles.view.GraphComponent,svgRendering?:boolean}); - /** - * Creates a new instance of {@link yfiles.view.GraphOverviewComponent} using the div element that is optionally bound to the - * provided {@link yfiles.view.GraphOverviewComponent#graphComponent}. - *

- * If no graphComponent is provided, in order for this instance to be useful, either the {@link yfiles.view.GraphOverviewComponent#graphComponent} or the {@link yfiles.view.GraphOverviewComponent#graph} property need to be set. - *

- * @param div The div element to use for holding the canvas. - * @param [graphComponent=null] The optional graph control to {@link #graphComponent bind} this instance to. If omitted, the property needs to be set to initialize the - * component. - */ - constructor(div:HTMLDivElement,graphComponent?:yfiles.view.GraphComponent); - /** - * Creates a new instance of {@link yfiles.view.GraphOverviewComponent} using the div element that is optionally bound to the - * provided {@link yfiles.view.GraphOverviewComponent#graphComponent}. - *

- * If no graphComponent is provided, in order for this instance to be useful, either the {@link yfiles.view.GraphOverviewComponent#graphComponent} or the {@link yfiles.view.GraphOverviewComponent#graph} property need to be set. - *

- * @param {Object} options The parameters to pass. - * @param options.div The div element to use for holding the canvas. - * @param [options.graphComponent=null] The optional graph control to {@link #graphComponent bind} this instance to. If omitted, the property needs to be set to initialize the - * component. - * @param {boolean} options.svgRendering A value indicating whether the graph is rendered using SVG rendering. - *

- * This option sets the {@link yfiles.view.GraphOverviewComponent#svgRendering} property on the created object. - *

- */ - constructor(options:{div:HTMLDivElement,graphComponent?:yfiles.view.GraphComponent,svgRendering?:boolean}); - /** - * Creates a new instance that is optionally bound to the provided {@link yfiles.view.GraphOverviewComponent#graphComponent}. - *

- * This constructor creates a new {@link yfiles.view.CanvasComponent#div} element that needs to be added to the DOM manually. If no graphComponent is provided, in - * order for this instance to be useful, either the {@link yfiles.view.GraphOverviewComponent#graphComponent} or the {@link yfiles.view.GraphOverviewComponent#graph} property need to be set. - *

- * @param [graphComponent=null] The {@link #graphComponent} to bind this instance to. If omitted, the property needs to be set to initialize the component. - */ - constructor(graphComponent?:yfiles.view.GraphComponent); - /** - * Creates a new instance that is optionally bound to the provided {@link yfiles.view.GraphOverviewComponent#graphComponent}. - *

- * This constructor creates a new {@link yfiles.view.CanvasComponent#div} element that needs to be added to the DOM manually. If no graphComponent is provided, in - * order for this instance to be useful, either the {@link yfiles.view.GraphOverviewComponent#graphComponent} or the {@link yfiles.view.GraphOverviewComponent#graph} property need to be set. - *

- * @param {Object} options The parameters to pass. - * @param [options.graphComponent=null] The {@link #graphComponent} to bind this instance to. If omitted, the property needs to be set to initialize the component. - * @param {boolean} options.svgRendering A value indicating whether the graph is rendered using SVG rendering. - *

- * This option sets the {@link yfiles.view.GraphOverviewComponent#svgRendering} property on the created object. - *

- */ - constructor(options:{graphComponent?:yfiles.view.GraphComponent,svgRendering?:boolean}); - /** - * Factory method that creates the {@link yfiles.view.IVisualCreator} that renders the preview of the graph in a HTML canvas - * element. - * @param graph The graph to draw. - * @returns An {@link } that creates HTML canvas rendering. - * @protected - */ - createCanvasVisualCreator(graph:yfiles.graph.IGraph):yfiles.view.IVisualCreator; - /** - * Factory method that creates the {@link yfiles.view.IVisualCreator} that renders the preview of the graph in SVG. - * @param graph The graph to draw. - * @returns An {@link } that creates SVG. - * @protected - */ - createSvgVisualCreator(graph:yfiles.graph.IGraph):yfiles.view.IVisualCreator; - /** - * Gets or sets a value indicating whether the graph is rendered using SVG rendering. - * @default false - * @type {boolean} - */ - svgRendering:boolean; - /** - * Gets the {@link yfiles.styles.GraphOverviewSvgVisualCreator} that is used to render the over view graph. - * @type {yfiles.view.IVisualCreator} - */ - graphVisualCreator:yfiles.view.IVisualCreator; - /** - * Gets or sets the {@link yfiles.input.OverviewInputMode} that is used to navigate the client control. - *

- * Setting this property will automatically update the {@link yfiles.input.OverviewInputMode#canvasComponent} property of the new {@link yfiles.input.OverviewInputMode}. - *

- *

- * This property is merely a convenience alias for the {@link yfiles.view.CanvasComponent#inputMode} property. Setting either this property or the {@link yfiles.view.CanvasComponent#inputMode} property has the - * same effect if the input mode is an {@link yfiles.input.OverviewInputMode}. On the other hand, if an input mode is set that is - * not an {@link yfiles.input.OverviewInputMode}, then the value of this property is null - *

- * @type {yfiles.input.OverviewInputMode} - */ - overviewInputMode:yfiles.input.OverviewInputMode; - /** - * Gets or sets the graph that is rendered in the overview. - * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - /** - * Gets or sets the client component, that will be used to retrieve the graph from and that will be used for navigating. - * @type {yfiles.view.GraphComponent} - */ - graphComponent:yfiles.view.GraphComponent; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.GraphOverviewComponent; - } - /** - * This class describes a grid by providing the grid's origin as well as the horizontal and vertical spacing between the - * grid points. - *

- * It is used by the {@link yfiles.input.IGridConstraintProvider.} as well as by the GridSnapResultVisualCreator<T> - *

- * @see yfiles.input.IGridConstraintProvider. - * @class - */ - export interface GridInfo extends yfiles.lang.Object{} - export class GridInfo { - /** - * Creates a new instance using the given horizontal and vertical grid spacing as well as the given origin. - * @param horizontalSpacing The horizontal spacing between the grid points. - * @param verticalSpacing The vertical spacing between the grid points. - * @param origin The canonic origin of the grid. - */ - constructor(horizontalSpacing:number,verticalSpacing:number,origin:yfiles.geometry.Point); - /** - * Creates a new instance using "25" as the grid spacing. - * @param [spacing=25] The horizontal and vertical spacing between the grid points. - */ - constructor(spacing?:number); - /** - * Gets or sets the horizontal spacing between grid points in the world coordinate system. - * @default 25 - * @type {number} - */ - horizontalSpacing:number; - /** - * Gets or sets the vertical spacing between grid points in the world coordinate system. - * @default 25 - * @type {number} - */ - verticalSpacing:number; - /** - * Gets or sets the canonic origin of the grid. - * @default '0,0' - * @type {yfiles.geometry.Point} - */ - origin:yfiles.geometry.Point; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.GridInfo; - } - /** - * This interface describes the context for many operations performed on items in a {@link yfiles.view.ICanvasContext#canvasComponent}. - *

- * This interface extends the {@link yfiles.graph.ILookup} interface to provide {@link yfiles.graph.ILookup#lookup dynamic lookup capability}. - *

- * @interface - * @implements {yfiles.graph.ILookup} - */ - export interface ICanvasContext extends yfiles.lang.Object,yfiles.graph.ILookup{ - /** - * Adds an element to the defs section of the document, if it has not been added yet. - * @param defsSupport The instance that is used to create and update the element and to query if the element is still referenced - * @returns The id of the element with which it can be referenced using an url reference. - * @abstract - */ - getDefsId(defsSupport:yfiles.view.ISvgDefsCreator):string; - /** - * Gets the current zoom level that is the ratio of world coordinates to screen pixels. - * @abstract - * @type {number} - */ - zoom:number; - /** - * Gets the radius for hit tests and marquee selection tests in world coordinates. - *

- * This value already takes the zoom level into account. - *

- * @abstract - * @type {number} - */ - hitTestRadius:number; - /** - * Gets the Canvas that is associated with this context. - *

- * This value may be null in those cases where no control can be associated with the current context. - *

- * @abstract - * @type {yfiles.view.CanvasComponent} - */ - canvasComponent:yfiles.view.CanvasComponent; - } - var ICanvasContext:{ - /** - * Provides a default immutable {@link yfiles.view.ICanvasContext} with the given values. - *

- * If the values for zoom or hitTestRadius are not specified, the values will be obtained from the given canvas. - *

- * @param canvas the canvas - * @param [zoom=0] the zoom level - * @param [hitTestRadius=-1] the hit test radius - * @returns - * @static - */ - createCanvasContext?(canvas:yfiles.view.CanvasComponent,zoom?:number,hitTestRadius?:number):yfiles.view.ICanvasContext; - /** - * Provides a default immutable {@link yfiles.view.ICanvasContext} with the given values. - *

- * If the values for zoom or hitTestRadius are not specified, the values will be obtained from the given canvas. - *

- * @param {Object} options The parameters to pass. - * @param options.canvas the canvas - * @param [options.zoom=0] the zoom level - * @param [options.hitTestRadius=-1] the hit test radius - * @returns - * @static - */ - createCanvasContext?(options:{canvas:yfiles.view.CanvasComponent,zoom?:number,hitTestRadius?:number}):yfiles.view.ICanvasContext; - /** - * Provides a default immutable context with a hit radius of 3 and a zoom level of 1. - * @const - * @static - * @type {yfiles.view.ICanvasContext} - */ - DEFAULT?:yfiles.view.ICanvasContext; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.view.ICanvasContext; - }; - /** - * This is the interface implemented by the basic building blocks of a scene graph in a {@link yfiles.view.CanvasComponent}. - *

- * The interface is not meant to be implemented by application programmers. Instead, instances implementing this interface - * can be retrieved from the factory methods in the canvas control. - *

- * @interface - */ - export interface ICanvasObject extends yfiles.lang.Object{ - /** - * Moves this instance exactly behind the reference item in the referenced item's group rendering list, so that it will be - * rendered directly above the given reference. - *

- * This method returns the current instance so that calls can be chained, e.g. object.Above(other).Raise(). - *

- *

- * Observe that this instance will move into the referenced item's group if needed. - *

- * @param reference - * @returns this so that calls can be chained. - * @abstract - */ - above(reference:yfiles.view.ICanvasObject):yfiles.view.ICanvasObject; - /** - * Moves this instance exactly before the reference item in the referenced item's group rendering list, so that it will be - * rendered directly behind the given reference. - *

- * This method returns the current instance so that calls can be chained, e.g. object.Below(other).Lower(). - *

- *

- * Observe that this instance will move into the referenced item's group if needed. - *

- * @param reference - * @returns this so that calls can be chained. - * @abstract - */ - below(reference:yfiles.view.ICanvasObject):yfiles.view.ICanvasObject; - /** - * Moves this instance one step closer to the beginning of the group rendering list, so that it will be rendered behind its - * current predecessor. - *

- * As a convenience, this method returns the current instance so that calls can be conveniently chained, e.g. - * object.Lower().Lower() - *

- * @returns this so that calls can be chained. - * @abstract - */ - lower():yfiles.view.ICanvasObject; - /** - * Moves this instance one step closer to the end of the group rendering list, so that it will be rendered on top of its - * current successor. - *

- * As a convenience, this method returns the current instance so that calls can be conveniently chained, e.g. - * object.Raise().Raise().Raise() - *

- * @returns this so that calls can be chained. - * @abstract - */ - raise():yfiles.view.ICanvasObject; - /** - * Removes this item from the scene graph it currently belongs to. - * @abstract - */ - remove():void; - /** - * Moves this instance to the beginning of the group rendering list, so that it will be rendered behind all other items in - * the same group. - *

- * As a convenience, this method returns the current instance so that calls can be conveniently chained, e.g. - * object.ToBack().Raise().Raise() - *

- * @returns this so that calls can be chained. - * @abstract - */ - toBack():yfiles.view.ICanvasObject; - /** - * Moves this instance to the end of the group rendering list, so that it will be rendered in front of all other items in - * the same group. - *

- * As a convenience, this method returns the current instance so that calls can be conveniently chained, e.g. - * object.ToFront().Lower() - *

- * @returns this so that calls can be chained. - * @abstract - */ - toFront():yfiles.view.ICanvasObject; - /** - * Gets or sets the visibility state of this instance. - *

- * If an ICanvasObject is not visible, it will not be considered for hit tests. - *

- * @abstract - * @type {boolean} - */ - visible:boolean; - /** - * Gets or sets a flag that indicates whether {@link yfiles.view.ICanvasObject} needs to be updated during the next call to - * {@link yfiles.view.CanvasComponent#invalidate}. - *

- * Note that it is up to the implementation of the {@link yfiles.view.ICanvasObjectDescriptor} to determine the actual dirty state - * of this instance. {@link yfiles.view.ICanvasObjectDescriptor#isDirty} can use any strategy to indicate dirtiness. The {@link yfiles.view.CanvasComponent} - * will reset this flag during {@link yfiles.view.CanvasComponent#invalidate} to false if the visual is created or updated. - *

- * @abstract - * @type {boolean} - */ - dirty:boolean; - /** - * Gets or sets the parent group of this instance. - * @abstract - * @type {yfiles.view.ICanvasObjectGroup} - */ - group:yfiles.view.ICanvasObjectGroup; - /** - * Gets or sets the user object associated with this instance. - *

- * The user object will be used by the {@link yfiles.view.ICanvasObject#descriptor} during rendering, hit testing, and bounds calculation - *

- * @abstract - * @type {any} - */ - userObject:any; - /** - * Gets or sets the descriptor instance that interprets the {@link yfiles.view.ICanvasObject#userObject} during rendering, hit testing, and bounds calculation. - * @abstract - * @type {yfiles.view.ICanvasObjectDescriptor} - */ - descriptor:yfiles.view.ICanvasObjectDescriptor; - /** - * Gets the next item in the list of rendered items that is owned by this element's {@link yfiles.view.ICanvasObject#group}. - *

- * The returned item will be rendered after this item is rendered. If this item is the last one in the list, this method - * returns null. - *

- * @returns null if this item is last in the rendering list of its group or the next item otherwise. - * @abstract - * @type {yfiles.view.ICanvasObject} - */ - nextSibling:yfiles.view.ICanvasObject; - /** - * Gets the previous item in the list of rendered items that is owned by this element's {@link yfiles.view.ICanvasObject#group}. - *

- * The returned item will be rendered directly before this item is rendered. If this item is the first one in the list, - * this method returns null. - *

- * @returns null if this item is first in the rendering list of its group or the previous item otherwise. - * @abstract - * @type {yfiles.view.ICanvasObject} - */ - previousSibling:yfiles.view.ICanvasObject; - } - var ICanvasObject:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.view.ICanvasObject; - }; - /** - * Central interface used by the {@link yfiles.view.CanvasComponent} to render elements from the scene graph. - *

- * Implementations will be queried using the user object obtained from {@link yfiles.view.ICanvasObject#userObject} for the corresponding implementations of the - * various aspects of the user object. Implementations of this interface need to be provided by the application programmer - * to {@link yfiles.view.ICanvasObjectGroup}'s {@link yfiles.view.ICanvasObjectGroup#addChild} method. - *

- * @interface - */ - export interface ICanvasObjectDescriptor extends yfiles.lang.Object{ - /** - * Returns an implementation of {@link yfiles.view.IBoundsProvider} that can determine the visible bounds of the rendering of the - * user object. - *

- * This method may always return the same instance. By contract, clients will not cache instances returned, but will always - * call this method before the methods on the instance will be called. This contract enables the use of the fly-weight - * design pattern. Implementations of this class can always return the same instance and reconfigure this instance upon - * each call to this method. - *

- * @param forUserObject the user object to query the bounds for - * @returns An implementation of {@link } to determine the bounds of the visualization. - * @abstract - */ - getBoundsProvider(forUserObject:any):yfiles.view.IBoundsProvider; - /** - * Returns an implementation of {@link yfiles.input.IHitTestable} that can determine whether the rendering of the user object has - * been hit at a given coordinate. - *

- * This method may always return the same instance. By contract, clients will not cache instances returned, but will always - * call this method before the methods on the instance will be called. This contract enables the use of the fly-weight - * design pattern. Implementations of this class can always return the same instance and reconfigure this instance upon - * each call to this method. - *

- * @param forUserObject the user object to do the hit testing for - * @returns An implementation of {@link } to determine visibility. - * @abstract - */ - getHitTestable(forUserObject:any):yfiles.input.IHitTestable; - /** - * Returns an implementation of {@link yfiles.view.IVisibilityTestable} that can determine if the rendering of the user object - * would be visible in a given context. - *

- * This method may always return the same instance. By contract clients will not cache instances returned but will always - * call this method before the methods on the instance will be called. This contract enables the use of the fly-weight - * design pattern. Implementations of this class can always return the same instance and reconfigure this instance upon - * each call to this method. - *

- * @param forUserObject the user object to query visibility for - * @returns An implementation of {@link } to determine visibility. - * @abstract - */ - getVisibilityTestable(forUserObject:any):yfiles.view.IVisibilityTestable; - /** - * Returns an implementation of {@link yfiles.view.IVisualCreator} that will create the {@link yfiles.view.Visual} tree for the user - * object. - *

- * This method may always return the same instance. By contract, clients will not cache instances returned, but will always - * call this method before the methods on the instance will be called. This contract enables the use of the fly-weight - * design pattern. Implementations of this class can always return the same instance and reconfigure this instance upon - * each call to this method. - *

- * @param forUserObject the user object to create a Visual for - * @returns An implementation of {@link } to create or update the visualization. - * @abstract - */ - getVisualCreator(forUserObject:any):yfiles.view.IVisualCreator; - /** - * Determines whether the given canvas object is deemed dirty and needs updating. - * @param context The context that will be used for the update. - * @param canvasObject The object to check. - * @returns Whether an update is needed. - * @abstract - */ - isDirty(context:yfiles.view.ICanvasContext,canvasObject:yfiles.view.ICanvasObject):boolean; - } - var ICanvasObjectDescriptor:{ - /** - * An implementation that returns an {@link yfiles.view.ICanvasObjectDescriptor} that does nothing. - * @const - * @static - * @type {yfiles.view.ICanvasObjectDescriptor} - */ - VOID?:yfiles.view.ICanvasObjectDescriptor; - /** - * An implementation that treats {@link yfiles.view.ICanvasObject#userObject} as an instance of {@link yfiles.view.IVisualCreator} and considers the {@link yfiles.view.ICanvasObject#dirty} flag. - *

- * This descriptor tries to cast the {@link yfiles.view.ICanvasObject#userObject} to {@link yfiles.view.IVisualCreator} and use this instance to handle the visual - * representation of the {@link yfiles.view.ICanvasObject}. - *

- *

- * If the {@link yfiles.view.ICanvasObject#userObject} does not implement {@link yfiles.view.IVisualCreator} nothing will be displayed. - *

- *

- * This descriptor will respect the {@link yfiles.view.ICanvasObject#dirty} flag. - *

- * @const - * @static - * @type {yfiles.view.ICanvasObjectDescriptor} - */ - DYNAMIC_DIRTY_INSTANCE?:yfiles.view.ICanvasObjectDescriptor; - /** - * A descriptor that treats {@link yfiles.view.ICanvasObject#userObject} as an instance of {@link yfiles.view.IVisualCreator} and ignores the {@link yfiles.view.ICanvasObject#dirty} flag. - *

- * This descriptor tries to cast the {@link yfiles.view.ICanvasObject#userObject} to {@link yfiles.view.IVisualCreator} and use this instance to handle the visual - * representation of the {@link yfiles.view.ICanvasObject}. - *

- *

- * If the {@link yfiles.view.ICanvasObject#userObject} does not implement {@link yfiles.view.IVisualCreator} nothing will be displayed. - *

- *

- * This descriptor will always {@link yfiles.view.IVisualCreator#updateVisual update the visual} and thus ignore the {@link yfiles.view.ICanvasObject#dirty} flag. - *

- * @const - * @static - * @type {yfiles.view.ICanvasObjectDescriptor} - */ - ALWAYS_DIRTY_INSTANCE?:yfiles.view.ICanvasObjectDescriptor; - /** - * A descriptor that treats {@link yfiles.view.ICanvasObject#userObject} as an instance of {@link yfiles.graph.ILookup} to obtain suitable interface implementations and - * considers the {@link yfiles.view.ICanvasObject#dirty} flag. - *

- * This descriptor tries to cast the {@link yfiles.view.ICanvasObject#userObject} to {@link yfiles.graph.ILookup} and obtain the appropriate interface implementations for its - * methods from it. - *

- *

- * If the {@link yfiles.view.ICanvasObject#userObject} does not implement {@link yfiles.graph.ILookup} nothing will be displayed. - *

- *

- * This descriptor will respect the {@link yfiles.view.ICanvasObject#dirty} flag. - *

- * @const - * @static - * @type {yfiles.view.ICanvasObjectDescriptor} - */ - DYNAMIC_DIRTY_LOOKUP?:yfiles.view.ICanvasObjectDescriptor; - /** - * A descriptor that treats {@link yfiles.view.ICanvasObject#userObject} as an instance of {@link yfiles.graph.ILookup} to obtain suitable interface implementations and - * ignores the {@link yfiles.view.ICanvasObject#dirty} flag. - *

- * This descriptor tries to cast the {@link yfiles.view.ICanvasObject#userObject} to {@link yfiles.graph.ILookup} and obtain the appropriate interface implementations for its - * methods from it. - *

- *

- * If the {@link yfiles.view.ICanvasObject#userObject} does not implement {@link yfiles.graph.ILookup} nothing will be displayed. - *

- *

- * This descriptor will always {@link yfiles.view.IVisualCreator#updateVisual update the Visual} and thus ignore the {@link yfiles.view.ICanvasObject#dirty} flag. - *

- * @const - * @static - * @type {yfiles.view.ICanvasObjectDescriptor} - */ - ALWAYS_DIRTY_LOOKUP?:yfiles.view.ICanvasObjectDescriptor; - /** - * A descriptor that treats {@link yfiles.view.ICanvasObject#userObject} as Visual to use directly. - *

- * If the {@link yfiles.view.ICanvasObject#userObject} is not a Visual nothing will be displayed. - *

- *

- * This descriptor ignores the {@link yfiles.view.ICanvasObject#dirty} flag. - *

- * @const - * @static - * @type {yfiles.view.ICanvasObjectDescriptor} - */ - VISUAL?:yfiles.view.ICanvasObjectDescriptor; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.view.ICanvasObjectDescriptor; - }; - /** - * This is the interface implemented by the composite building blocks of a scene graph in a {@link yfiles.view.CanvasComponent}. - *

- * It is meant to group multiple {@link yfiles.view.ICanvasObject} instances as a logic unit. The interface is not meant to be - * implemented by application programmers. Instances implementing this interface can be retrieved from the factory methods - * in the canvas control. The interface extends the {@link yfiles.collections.IListEnumerable.} interface to allow for easy iteration and determination of the size of - * the group. - *

- * @interface - * @implements {yfiles.view.ICanvasObject} - * @implements {yfiles.collections.IListEnumerable.} - */ - export interface ICanvasObjectGroup extends yfiles.lang.Object,yfiles.view.ICanvasObject,yfiles.collections.IListEnumerable{ - /** - * Adds a child element to the scene graph as a child of this group. - *

- * The descriptor will be queried for the various rendering related implementations for the given userObject at rendering - * time. - *

- * @param userObject The user object to associate with this child element. This object will be passed to the descriptor's methods. - * @param descriptor An implementation of the {@link } interface that will be passed the userObject to provide the - * various implementations that are used during rendering. - * @returns A handle that can be used to control the rendering order and to later {@link #remove remove} the element from the scene graph, again. - * @see yfiles.view.ICanvasObjectDescriptor - * @see yfiles.view.ICanvasObjectDescriptor#DYNAMIC_DIRTY_INSTANCE - * @abstract - */ - addChild(userObject:any,descriptor:yfiles.view.ICanvasObjectDescriptor):yfiles.view.ICanvasObject; - /** - * Adds a new {@link yfiles.view.ICanvasObjectGroup} to this group in the current scene graph. - *

- * This can be used to build groups of {@link yfiles.view.ICanvasObject} instances that can be moved within the scene graph or - * whose {@link yfiles.view.ICanvasObject#visible visibility} can be controlled easily. The group will have a null {@link yfiles.view.ICanvasObject#userObject}. - *

- * @returns A handle to the newly created group that can be used to control the rendering order and to later {@link #remove remove} the group from - * the scene graph, again. - * @abstract - */ - addGroup():yfiles.view.ICanvasObjectGroup; - /** - * Gets the first item in the rendering list of this group or null. - *

- * This is the item that will be rendered first, i.e. behind all of the other items in the rendering list. In order to - * iterate over all immediate children, use the following idiom: - *

- * @see yfiles.collections.IListEnumerable. - * @see yfiles.collections.IEnumerable.#getEnumerator - * @abstract - * @type {yfiles.view.ICanvasObject} - */ - firstChild:yfiles.view.ICanvasObject; - /** - * Gets the last item in the rendering list of this group or null. - *

- * This is the item that will be on top of all other items in the list. In order to iterate over all immediate children in - * reverse order, use the following idiom: - *

- * @abstract - * @type {yfiles.view.ICanvasObject} - */ - lastChild:yfiles.view.ICanvasObject; - } - var ICanvasObjectGroup:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.view.ICanvasObjectGroup; - }; - /** - * An interface for objects that can install a visual representation of a highlight decoration of an item in the model - * displayed in a canvas. - *

- * This interface is a tagging sub interface of the {@link yfiles.view.ICanvasObjectInstaller}. This interface is used for {@link yfiles.graph.ILookup#lookup} - * operations. - *

- * @see yfiles.view.HighlightIndicatorManager. - * @see yfiles.view.ISelectionIndicatorInstaller - * @interface - * @implements {yfiles.view.ICanvasObjectInstaller} - */ - export interface IHighlightIndicatorInstaller extends yfiles.lang.Object,yfiles.view.ICanvasObjectInstaller{ - } - var IHighlightIndicatorInstaller:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.view.IHighlightIndicatorInstaller; - }; - /** - * An interface for objects that can install a visual focus indicator decoration of an item in the model displayed in a - * canvas. - *

- * This interface is a tagging sub interface of the {@link yfiles.view.ICanvasObjectInstaller}. This interface is used for {@link yfiles.graph.ILookup#lookup} - * operations. - *

- * @see yfiles.view.FocusIndicatorManager. - * @see yfiles.view.ISelectionIndicatorInstaller - * @see yfiles.view.IHighlightIndicatorInstaller - * @interface - * @implements {yfiles.view.ICanvasObjectInstaller} - */ - export interface IFocusIndicatorInstaller extends yfiles.lang.Object,yfiles.view.ICanvasObjectInstaller{ - } - var IFocusIndicatorInstaller:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.view.IFocusIndicatorInstaller; - }; - export enum BridgeCrossingStyle{ - /** - * A simple gap in the path. - */ - GAP, - /** - * A rectangular bridge will be inserted in the path. - */ - RECTANGLE, - /** - * A rectangular bridge with a fixed aspect ratio will be inserted in the path. - *

- * This bridge will be scaled for wider bridges so that its aspect ratio remains constant. - *

- */ - RECTANGLE_SCALED, - /** - * A triangular bridge will be inserted in the path. - */ - TWO_SIDES, - /** - * A triangular bridge with a fixed aspect ratio will be inserted in the path. - *

- * This bridge will be scaled for wider bridges so that its aspect ratio remains constant. - *

- */ - TWO_SIDES_SCALED, - /** - * A bridge, consisting of two quarter circle arcs connected by a straight line, will be inserted in the path. - */ - ARC, - /** - * A semi-circle bridge will be inserted in the path. - *

- * This bridge will be scaled for wider bridges so that its aspect ratio remains constant. - *

- */ - ARC_SCALED, - /** - * Inserts a custom bridge into the path. - *

- * Custom bridges require an appropriate implementation of the {@link yfiles.view.IBridgeCreator} interface and {@link yfiles.view.IBridgeCreator#createCustomBridge} - * method. - *

- */ - CUSTOM - } - export enum BridgeOrientationStyle{ - /** - * The brige is drawn to the right of the flow of the path. - */ - FLOW_RIGHT, - /** - * The brige is drawn to the left of the flow of the path. - */ - FLOW_LEFT, - /** - * The brige is drawn in the direction of the positive axes. - */ - POSITIVE, - /** - * The brige is drawn in the direction of the negative axes. - */ - NEGATIVE, - /** - * The bridge points to the right. - */ - LEFT, - /** - * The bridge points to the left. - */ - RIGHT, - /** - * The bridge points upwards. - */ - UP, - /** - * The bridge points downwards. - */ - DOWN - } - export enum BridgeCrossingPolicy{ - /** - * Makes horizontal segments bridge over vertical obstacles. - *

- * Horizontal segments do not cross each other, just as vertical ones will not cross each other. Horizontal segments are - * segments with a slope between 1 and -1. All others are vertical segments. For non-parallel intersecting pairs of - * segments there does not need to be a crossing unless only one of them is vertical. - *

- */ - HORIZONTAL_BRIDGES_VERTICAL, - /** - * Makes vertical segments bridge over horizontal obstacles. - *

- * Horizontal segments do not cross each other, just as vertical ones will not cross each other. Horizontal segments are - * segments with a slope between 1 and -1. All others are vertical segments. For non-parallel intersecting pairs of - * segments there does not need to be a crossing unless only one of them is horizontal. - *

- */ - VERTICAL_BRIDGES_HORIZONTAL, - /** - * Makes more horizontal edges bridge over edges which are less horizontal. - *

- * The smaller the absolute slope of an edge, the more horizontal it is. For each non-parallel intersecting pair of - * segments, there will be a crossing. - *

- */ - MORE_HORIZONTAL_BRIDGES_LESS_HORIZONTAL, - /** - * Makes more vertical edges bridge over edges which are less vertical. - *

- * The larger the absolute slope of an edge, the more vertical it is. For each non-parallel intersecting pair of segments, - * there will be a crossing. - *

- */ - MORE_VERTICAL_BRIDGES_LESS_VERTICAL - } - /** - * Helper class that calculates visual hints in a path where said path crosses an obstacle. - *

- * Most notably this feature is used to render crossings of {@link yfiles.graph.IEdge}s with other edges. - *

- *

- * To set up bridges in a {@link yfiles.view.GraphComponent} at the least the following is necessary: - *

- *

- * Furthermore, an edge style that supports bridges is necessary; {@link yfiles.styles.PolylineEdgeStyle} is a good choice. Various - * other properties can be set to change the defaults, e.g. {@link yfiles.view.BridgeCrossingStyle how bridges appear}, or {@link yfiles.view.BridgeOrientationStyle which way bridges point}. - *

- *

Related demos:

- *
    - *
  • Demo: Bridges, Demo.yFiles.Graph.Bridges
  • - *
- * @class - */ - export interface BridgeManager extends yfiles.lang.Object{} - export class BridgeManager { - /** - * Initializes a new instance of the {@link yfiles.view.BridgeManager} class. - *

- * Initially the {@link yfiles.view.BridgeManager#defaultBridgeCreator} will be set to an instance that will delegate to the set of Default properties in this class and the {@link yfiles.view.BridgeManager#insertDefaultCustomBridge} - * method respectively. - *

- */ - constructor(); - /** - * Core method that will add bridges to a {@link yfiles.geometry.GeneralPath} using the {@link yfiles.view.IBridgeCreator} callback to - * determine the type of the bridges. - *

- * This method may return path itself if no crossings have been determined. Otherwise it will return a new path instance - * that has the bridges added at the corresponding places. - *

- * @param context The context to use. - * @param path The path to calculate the bridged variant for. - * @param callback The callback or null that determines the appearance of the bridges. - * @returns The path that might have been augmented by the bridges. - */ - addBridges(context:yfiles.view.IRenderContext,path:yfiles.geometry.GeneralPath,callback:yfiles.view.IBridgeCreator):yfiles.geometry.GeneralPath; - /** - * Adds another {@link yfiles.view.IObstacleProvider} to query for obstacles. - *

- * The {@link yfiles.view.IObstacleProvider#getObstacles} method will be invoked during construction of the obstacles. - *

- * @param provider The provider instance to use for later queries. - * @see yfiles.view.BridgeManager#registerObstacles - * @see yfiles.view.BridgeManager#removeObstacleProvider - */ - addObstacleProvider(provider:yfiles.view.IObstacleProvider):void; - /** - * Disposes of this instance by resetting the {@link yfiles.view.BridgeManager#canvasComponent} property to null. - */ - dispose():void; - /** - * Gets a hash code that describes the current state of the obstacles. - *

- * This method can be used to get a concise, digest snapshot of the current obstacle locations. Storing that result and - * comparing it to another snapshot later allows to determine quickly whether obstacles have changed since the last call. - * This is helpful, e.g. in implementations of {@link yfiles.styles.IEdgeStyle} that support bridges to not recreate the edge path - * (including bridges) in {@link yfiles.view.IVisualCreator#updateVisual} if no obstacles changed. - *

- * @param context The context to inspect. - * @returns A hash of the state of the obstacles. - */ - getObstacleHash(context:yfiles.view.IRenderContext):number; - /** - * Implementation that will be called by the default value of the {@link yfiles.view.BridgeManager#defaultBridgeCreator} to satisfy requests to - * {@link yfiles.view.IBridgeCreator#createCustomBridge}. - *

- * This implementation will insert a gap style bridge by first creating a {@link yfiles.geometry.GeneralPath#lineTo line} to start and then {@link yfiles.geometry.GeneralPath#moveTo moving} to end. - *

- * @param context The context for the call. - * @param path The path to append the next segment to. - * @param start The coordinates of the starting point of the bridge. - * @param end The coordinates of the ending point of the bridge. - * @param gapLength The distance between the starting point and the end point. - * @see yfiles.view.IBridgeCreator#createCustomBridge - */ - insertDefaultCustomBridge(context:yfiles.view.IRenderContext,path:yfiles.geometry.GeneralPath,start:yfiles.geometry.Point,end:yfiles.geometry.Point,gapLength:number):void; - /** - * Installs this manager for the specified {@link yfiles.view.BridgeManager#canvasComponent}. - * @param canvas The {@link #canvasComponent}. - * @protected - */ - install(canvas:yfiles.view.CanvasComponent):void; - /** - * Convenience method that can be called to dynamically register an obstacle path with the context during the rendering. - *

- * Normally all obstacles will be registered initially by method - * {@link yfiles.view.BridgeManager#registerObstacles}. This method can be called during the rendering phase to register additional - * obstacles at a later point in time. - *

- * @param context The context to register the obstacles with. - * @param path The path that describes the obstacles. - * @see yfiles.view.BridgeManager#registerObstacleLine - */ - registerObstacle(context:yfiles.view.IRenderContext,path:yfiles.geometry.GeneralPath):void; - /** - * Convenience method that can be called to dynamically register a single obstacle cubic curve with the context during the - * rendering. - *

- * Normally all obstacles will be registered initially by method - * {@link yfiles.view.BridgeManager#registerObstacles}. This method can be called during the rendering phase to register additional - * obstacles at a later point in time. - *

- * @param context The context to register the obstacles with. - * @param p1 The coordinates of the starting point of the line. - * @param cp1 The coordinates of the first control point of the curve. - * @param cp2 The coordinates of the second control point of the curve. - * @param p2 The coordinates of the ending point of the line. - * @see yfiles.view.BridgeManager#registerObstacleLine - */ - registerObstacleCubicCurve(context:yfiles.view.IRenderContext,p1:yfiles.geometry.Point,cp1:yfiles.geometry.Point,cp2:yfiles.geometry.Point,p2:yfiles.geometry.Point):void; - /** - * Convenience method that can be called to dynamically register a single obstacle line with the context during the - * rendering. - *

- * Normally all obstacles will be registered initially by method - * {@link yfiles.view.BridgeManager#registerObstacles}. This method can be called during the rendering phase to register additional - * obstacles at a later point in time. - *

- * @param context The context to register the obstacles with. - * @param p1 The coordinates of the first point of the line. - * @param p2 The coordinates of the second point of the line. - * @see yfiles.view.BridgeManager#registerObstacleLine - */ - registerObstacleLine(context:yfiles.view.IRenderContext,p1:yfiles.geometry.Point,p2:yfiles.geometry.Point):void; - /** - * Convenience method that can be called to dynamically register a single obstacle quadratic curve with the context during - * the rendering. - *

- * Normally all obstacles will be registered initially by method - * {@link yfiles.view.BridgeManager#registerObstacles}. This method can be called during the rendering phase to register additional - * obstacles at a later point in time. - *

- * @param context The context to register the obstacles with. - * @param p1 The coordinates of the starting point of the line. - * @param cp The coordinates of the control point of the curve. - * @param p2 The coordinates of the ending point of the line. - * @see yfiles.view.BridgeManager#registerObstacleLine - */ - registerObstacleQuadCurve(context:yfiles.view.IRenderContext,p1:yfiles.geometry.Point,cp:yfiles.geometry.Point,p2:yfiles.geometry.Point):void; - /** - * Called to initialize the context with the obstacles. - * @param context The context that will be used to store the obstacles with. - * @see yfiles.view.BridgeManager#registerObstacle - * @see yfiles.view.BridgeManager#registerObstacleLine - * @protected - */ - registerObstacles(context:yfiles.view.IRenderContext):void; - /** - * Removes a previously {@link yfiles.view.BridgeManager#addObstacleProvider added} {@link yfiles.view.IObstacleProvider} from the list of registered providers. - * @param provider The provider instance to remove from this instance. - * @see yfiles.view.BridgeManager#addObstacleProvider - */ - removeObstacleProvider(provider:yfiles.view.IObstacleProvider):void; - /** - * Reverts the {@link yfiles.view.BridgeManager#install} method. - * @param canvas The {@link #canvasComponent}. - * @protected - */ - uninstall(canvas:yfiles.view.CanvasComponent):void; - /** - * Gets or sets the default implementation of the {@link yfiles.view.IBridgeCreator} that will be used if {@link yfiles.view.BridgeManager#addBridges} - * is invoked with a null callback argument. - * @see yfiles.view.BridgeManager#defaultBridgeCrossingStyle - * @see yfiles.view.BridgeManager#defaultBridgeWidth - * @see yfiles.view.BridgeManager#defaultBridgeHeight - * @see yfiles.view.BridgeManager#insertDefaultCustomBridge - * @type {yfiles.view.IBridgeCreator} - */ - defaultBridgeCreator:yfiles.view.IBridgeCreator; - /** - * Gets or sets a value that determines whether curves ({@link yfiles.geometry.GeneralPath#cubicTo cubic} and {@link yfiles.geometry.GeneralPath#quadTo quadratic}) should be considered as obstacles. - *

- * This can be a costly operation so the default is false. - *

- * @type {boolean} - */ - considerCurves:boolean; - /** - * Gets or sets a threshold value that determines below which zoom level, there should be no more bridge calculation. - *

- * Since the calculation of the bridges is a costly operation if there are many items visible and bridges are not clearly - * visible at low zoom levels, it is convenient to disable the calculation of bridges for these zoom levels to speed up the - * rendering process. The default value is 0.3d. - *

- * @type {number} - */ - zoomThreshold:number; - /** - * Gets or sets the {@link yfiles.view.BridgeCrossingPolicy} mode that is used by this instance. - *

- * By default the {@link yfiles.view.BridgeCrossingPolicy#HORIZONTAL_BRIDGES_VERTICAL} mode is set. - *

- * @type {yfiles.view.BridgeCrossingPolicy} - */ - bridgeCrossingPolicy:yfiles.view.BridgeCrossingPolicy; - /** - * Gets or sets the {@link yfiles.view.BridgeManager#canvasComponent} that should be managed by this instance. - *

- * This method will {@link yfiles.view.BridgeManager#install} a {@link yfiles.view.CanvasComponent#addPrepareRenderContextListener preparation stage} for the {@link yfiles.view.IRenderContext} in the - * provided {@link yfiles.view.BridgeManager#canvasComponent} via the {@link yfiles.graph.ILookup#lookup} mechanism. - *

- * @type {yfiles.view.CanvasComponent} - */ - canvasComponent:yfiles.view.CanvasComponent; - /** - * Gets or sets the default {@link yfiles.view.BridgeCrossingStyle} that will be used by the default implementation of the {@link yfiles.view.IBridgeCreator} - * that is initially assigned to the {@link yfiles.view.BridgeManager#defaultBridgeCreator} property. - *

- * The default value is {@link yfiles.view.BridgeCrossingStyle#ARC}. - *

- * @see yfiles.view.IBridgeCreator#getCrossingStyle - * @type {yfiles.view.BridgeCrossingStyle} - */ - defaultBridgeCrossingStyle:yfiles.view.BridgeCrossingStyle; - /** - * Gets or sets the default width of a bridge that will be used by the default implementation of the {@link yfiles.view.IBridgeCreator} - * that is initially assigned to the {@link yfiles.view.BridgeManager#defaultBridgeCreator} property. - *

- * The default value is 10.0d. Setting this value will adjust the {@link yfiles.view.BridgeManager#clipMargin}. - *

- * @see yfiles.view.IBridgeCreator#getBridgeWidth - * @type {number} - */ - defaultBridgeWidth:number; - /** - * Gets or sets the margin by which the {@link yfiles.view.IRenderContext#clip} should be enlarged to accommodate for clipped away lines being taken into account - * for bridge calculation. - *

- * This value should be set to at least half the value of {@link yfiles.view.IBridgeCreator#getBridgeWidth the width of the bridges} used in this context. This is because - * obstacles might otherwise be clipped from the view and not taken into account for the calculation of the bridges. By - * default this value will be 2 more than half of the {@link yfiles.view.BridgeManager#defaultBridgeWidth}. - *

- * @type {number} - */ - clipMargin:number; - /** - * Gets or sets the default height of a bridge that will be used by the default implementation of the {@link yfiles.view.IBridgeCreator} - * that is initially assigned to the {@link yfiles.view.BridgeManager#defaultBridgeCreator} property. - *

- * The default value is 5.0d. - *

- * @see yfiles.view.IBridgeCreator#getBridgeHeight - * @type {number} - */ - defaultBridgeHeight:number; - /** - * Gets or sets the default {@link yfiles.view.BridgeOrientationStyle} for bridges that will be used by the default implementation - * of the {@link yfiles.view.IBridgeCreator} that is initially assigned to the {@link yfiles.view.BridgeManager#defaultBridgeCreator} property. - *

- * The default is {@link yfiles.view.BridgeOrientationStyle#UP}. - *

- * @see yfiles.view.IBridgeCreator#getOrientationStyle - * @type {yfiles.view.BridgeOrientationStyle} - */ - defaultBridgeOrientationStyle:yfiles.view.BridgeOrientationStyle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.BridgeManager; - } - /** - * Allows to add bridge visualizations to a {@link yfiles.geometry.GeneralPath}. - *

- * An implementation of this interface is used by {@link yfiles.view.BridgeManager} to {@link yfiles.view.BridgeManager#addBridges insert bridges} into an edge path. - *

- *

- * A custom implementation of this interface is necessary if a {@link yfiles.view.BridgeCrossingStyle#CUSTOM custom bridge drawing style} is used. - *

- *

Related demos:

- *
    - *
  • Demo: Bridges, Demo.yFiles.Graph.Bridges
  • - *
- * @see yfiles.view.BridgeManager - * @interface - */ - export interface IBridgeCreator extends yfiles.lang.Object{ - /** - * Callback that will be used by the {@link yfiles.view.BridgeManager} if the {@link yfiles.view.IBridgeCreator#getCrossingStyle} method - * yields {@link yfiles.view.BridgeCrossingStyle#CUSTOM} to actually insert a bridge into the given {@link yfiles.geometry.GeneralPath}. - *

- * When this method is called the {@link yfiles.geometry.GeneralPath}'s {@link yfiles.geometry.GeneralPath#lastCoordinate last} coordinates are not yet at start. So most - * implementation should first {@link yfiles.geometry.GeneralPath#moveTo} that location. Also at the end of the call, - * implementation should make sure that the GeneralPath's end is at end. The gapLength is provided for convenience so that - * the distance between startPoint and endPoint does not need to be calculated if it is needed for the drawing. - *

- * @param context The context for the call. - * @param path The path to append the bridge segment to. - * @param start The coordinates of the starting point of the bridge. - * @param end The coordinates of the ending point of the bridge. - * @param gapLength The distance between the starting point and the end point. - * @abstract - */ - createCustomBridge(context:yfiles.view.IRenderContext,path:yfiles.geometry.GeneralPath,start:yfiles.geometry.Point,end:yfiles.geometry.Point,gapLength:number):void; - /** - * Gets the height of the bridge for the given {@link yfiles.view.IRenderContext}. - *

- * The height is the default height that will be used for drawing the non-{@link yfiles.view.BridgeCrossingStyle#CUSTOM custom} {@link yfiles.view.BridgeCrossingStyle}s. - *

- * @param context The context where the bridge will be created for. - * @returns The non-negative preferred basic unscaled height of the bridge. - * @abstract - */ - getBridgeHeight(context:yfiles.view.IRenderContext):number; - /** - * Gets the width of the bridge for the given {@link yfiles.view.IRenderContext}. - *

- * The width is the preferred length of the segment that will be removed from the original segment if it crosses an - * obstacle. That bridge will be made larger if multiple obstacle bridges would otherwise overlap. The bridge will be - * automatically made smaller if it happens to be near the end of a segment and would otherwise extend beyond the end of - * the segment. - *

- * @param context The context where the bridge will be created for. - * @returns The positive preferred width of the bridge. - * @abstract - */ - getBridgeWidth(context:yfiles.view.IRenderContext):number; - /** - * Gets the {@link yfiles.view.BridgeCrossingStyle} to use in the given {@link yfiles.view.IRenderContext}. - * @param context The context in which the crossing will be used. - * @returns The style to use, or {@link #CUSTOM} in order to let {@link } call - * {@link #createCustomBridge}. - * @abstract - */ - getCrossingStyle(context:yfiles.view.IRenderContext):yfiles.view.BridgeCrossingStyle; - /** - * Gets the {@link yfiles.view.BridgeOrientationStyle} to use in the given {@link yfiles.view.IRenderContext}. - * @param context The context in which the style will be used.. - * @returns The style to use. Any value can be returned and will be ignored if the {@link #getCrossingStyle crossing style} is set to - * {@link #CUSTOM}. - * @abstract - */ - getOrientationStyle(context:yfiles.view.IRenderContext):yfiles.view.BridgeOrientationStyle; - } - var IBridgeCreator:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.view.IBridgeCreator; - }; - /** - * Implementations of this interface can provide a path that is used to determine bridges by {@link yfiles.view.BridgeManager}. - *

- * Typically the {@link yfiles.graph.ILookup} implementation of styles will return an implementation of this interface. - *

- * @interface - */ - export interface IObstacleProvider extends yfiles.lang.Object{ - /** - * Returns a path representing obstacles that would need bridges. - *

- * For performance reasons the implementation should only return a non-null {@link yfiles.geometry.GeneralPath} if it might be {@link yfiles.view.IVisibilityTestable#isVisible visible} - * in the provided {@link yfiles.view.IRenderContext#clip}. - *

- * @param context The context for which the obstacles are queried. - * @returns A path that describes the obstacles or null if there are no obstacles for the given context. - * @abstract - */ - getObstacles(context:yfiles.view.IRenderContext):yfiles.geometry.GeneralPath; - } - var IObstacleProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.view.IObstacleProvider; - }; - /** - * An {@link yfiles.view.ItemModelManager.} that automatically installs and removes visual representations of items in a {@link yfiles.collections.IObservableCollection.} into or from the canvas. - * Type parameter T: The type of items in the observable collection. - * @class - * @extends {yfiles.view.ItemModelManager.} - * @template T - */ - export interface CollectionModelManager extends yfiles.view.ItemModelManager{} - export class CollectionModelManager { - /** - * Creates a new instance using the given model. - * @param itemType The type of items in the observable collection. - * @param model The model to manage. - */ - constructor(itemType:yfiles.lang.Class,model:yfiles.collections.IObservableCollection); - /** - * Creates a new instance. - * @param itemType The type of items in the observable collection. - * @see yfiles.view.CollectionModelManager.#model - */ - constructor(itemType:yfiles.lang.Class); - /** - * Called when this mode gets {@link yfiles.view.CollectionModelManager.#enabled disabled}. - * @protected - */ - onDisabled():void; - /** - * Called when this mode gets {@link yfiles.view.CollectionModelManager.#enabled enabled}. - * @protected - */ - onEnabled():void; - /** - * Gets or sets a value indicating whether this {@link yfiles.view.CollectionModelManager.} is enabled. - *

- * If the manager is disabled, it will not install the {@link yfiles.view.ICanvasObject}s into the associated - * {@link yfiles.view.CanvasComponent}. - *

- * @type {boolean} - */ - enabled:boolean; - /** - * Gets or sets the model of the items to display in the canvas. - *

- * Setting the model will automatically remove the items installed for a previously installed model. Also the items - * contained in the new model will immediately be queried and installed into the canvas. - *

- * @type {yfiles.collections.IObservableCollection.} - */ - model:yfiles.collections.IObservableCollection; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.CollectionModelManager; - } - /** - * Installs and removes visual representations of items into or from the canvas. - * Type parameter T: The type of managed items. - * @class - * @template T - */ - export interface ItemModelManager extends yfiles.lang.Object{} - export class ItemModelManager { - /** - * - * @param itemType The type of managed items. - */ - constructor(itemType:yfiles.lang.Class); - /** - * Registers and {@link yfiles.view.ItemModelManager.#install installs} the given item into the canvas. - * @param item The item to install. - */ - addItem(item:T):void; - /** - * {@link yfiles.view.ItemModelManager.#addItem Adds} all items to the canvas. - *

- * This is useful to initialize this manager with an existing collection of items. - *

- * @param items The items to add. - */ - addItems(items:yfiles.collections.IEnumerable):void; - /** - * Retrieves the canvas object that has been registered for the given item or null. - * @param item The item to retrieve the canvas object for. - * @returns A canvas object instance or null. - * @see yfiles.view.ItemModelManager.#install - */ - getCanvasObject(item:T):yfiles.view.ICanvasObject; - /** - * Gets the {@link yfiles.view.ICanvasObjectGroup} used to {@link yfiles.view.ItemModelManager.#install} the item in the canvas. - *

- * The default implementation simply returns the value of {@link yfiles.view.ItemModelManager.#canvasObjectGroup}. - *

- * @param item The item to get the group for. - * @returns The {@link } used to {@link #install} an item in the canvas. - * @protected - */ - getCanvasObjectGroup(item:T):yfiles.view.ICanvasObjectGroup; - /** - * Returns the {@link yfiles.view.ICanvasObjectDescriptor} used to {@link yfiles.view.ItemModelManager.#install} the item in the canvas. - *

- * The default implementation simply returns the value of {@link yfiles.view.ItemModelManager.#descriptor}. - *

- * @param item The item to get the descriptor for. - * @returns The {@link } used to {@link #install} an item in the canvas. - * @protected - */ - getDescriptor(item:T):yfiles.view.ICanvasObjectDescriptor; - /** - * Tries to find the item managed by this instance that is associated with the given canvas object. - * @param canvasObject The canvas object to query the corresponding model item for. - * @returns The item or null if no such item could be found. - */ - getItem(canvasObject:yfiles.view.ICanvasObject):T; - /** - * Installs a member of the collection into the canvas using the {@link yfiles.view.ItemModelManager.#descriptor}. - * @param item The member to install. - * @returns The canvas object that has been returned by the installer. - * @protected - */ - install(item:T):yfiles.view.ICanvasObject; - /** - * Event handler for item creation events that adds the item to this manager. - *

- * This method is intended to be used to delegate item creation events from observable collections: - *

- *

- * This method calls {@link yfiles.view.ItemModelManager.#addItem} with {@link yfiles.collections.ItemEventArgs.#item}. - *

- * @param source The instance that raised the event. - * @param evt The event arguments. - */ - itemAddedHandler(source:any,evt:yfiles.collections.ItemEventArgs):void; - /** - * Event handler for item change events that updates the visual representation for that item. - *

- * This method is intended to be used to delegate item change events from observable collections: - *

- *

- * This is necessary if the group the canvas object should be added to might change after the item change. This might - * happen, e.g. after changing an edge's port in a grouped graph. - *

- * @param source The event source. - * @param evt The item event args which indicate the change. - */ - itemChangedHandler(source:any,evt:yfiles.collections.ItemEventArgs):void; - /** - * Event handler for item removal events that removes the item from this manager. - *

- * This method is intended to be used to delegate item removal events from observable collections: - *

- *

- * This method calls {@link yfiles.view.ItemModelManager.#removeItem} with {@link yfiles.collections.ItemEventArgs.#item}. - *

- * @param source The instance that raised the event. - * @param evt The event arguments. - */ - itemRemovedHandler(source:any,evt:yfiles.collections.ItemEventArgs):void; - /** - * Deregisters and uninstalls the given item from the canvas. - * @param item The item to uninstall. - */ - removeItem(item:T):void; - /** - * {@link yfiles.view.ItemModelManager.#removeItem Removes} all items from the canvas. - *

- * This method can be used to clean up this manager before disposing it. - *

- * @param items The items to remove. - */ - removeItems(items:yfiles.collections.IEnumerable):void; - /** - * This method may be called to update the visual representation of the given item in the canvas. - *

- * If no visual representation is registered, yet, {@link yfiles.view.ItemModelManager.#install} will be called. - *

- * @param item The item to update. - */ - update(item:T):void; - /** - * Gets or sets an {@link yfiles.collections.IComparer.} that compares the items so that they are put into the correct order in the canvas tree. - *

- * If this instance is set to null this feature is effectively turned off. - *

- * @type {yfiles.collections.IComparer.} - */ - comparer:yfiles.collections.IComparer; - /** - * Gets or sets the canvas object descriptor used by {@link yfiles.view.ItemModelManager.#install} when an item is {@link yfiles.view.ICanvasObjectGroup#addChild added} to an canvas object group. - *

- * Setting the descriptor to null will prevent this manager from installing new items. - *

- * @type {yfiles.view.ICanvasObjectDescriptor} - */ - descriptor:yfiles.view.ICanvasObjectDescriptor; - /** - * Gets or sets the canvas object group used by {@link yfiles.view.ItemModelManager.#install}. - *

- * Setting this property to null will prevent this manager from installing new items. - *

- * @type {yfiles.view.ICanvasObjectGroup} - */ - canvasObjectGroup:yfiles.view.ICanvasObjectGroup; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.ItemModelManager; - } - /** - * Default implementation of an {@link yfiles.view.ISelectionModel.} that is based on an observable collection to hold the selected elements. - *

- * This selection model has a domain that's controlled with a {@link yfiles.view.DefaultSelectionModel.#isInDomain predicate} which encompasses the items that can be selected. - * If that domain changes it is important to delegate item removal events from the domain model to this selection model to - * ensure that items that have been removed are deselected as well. A {@link yfiles.view.DefaultSelectionModel.#itemRemovedFromDomainHandler convenience event handler} exists for that purpose. - *

- * Type parameter T: The type of the items to be selected. - * @class - * @implements {yfiles.view.ISelectionModel.} - * @template T - */ - export interface DefaultSelectionModel extends yfiles.lang.Object,yfiles.view.ISelectionModel{} - export class DefaultSelectionModel { - /** - * Creates a default selection model implementation that uses a {@link yfiles.collections.ObservableCollection.} to hold the selection. - */ - constructor(); - /** - * - */ - clear():void; - /** - * - * @returns - */ - getEnumerator():yfiles.collections.IEnumerator; - /** - * Determines whether an item is selected by checking for the containment in the {@link yfiles.view.DefaultSelectionModel.#selection}. - * @param item The item to check - * @returns Whether the item is selected. - */ - isSelected(item:T):boolean; - /** - * Event handler for domain item removal events that removes the item from this model. - *

- * This method is intended to be used to delegate item removal events from the respective domain collection: - *

- *

- * This method calls {@link yfiles.view.DefaultSelectionModel.#removeDomainItem} with {@link yfiles.collections.ItemEventArgs.#item}. - *

- * @param source The instance that raised the event. - * @param evt The event arguments. - */ - itemRemovedFromDomainHandler(source:any,evt:yfiles.collections.ItemEventArgs):void; - /** - * Called when an item gets selected or deselected. - *

- * Triggers the {@link yfiles.view.DefaultSelectionModel.#addItemSelectionChangedListener ItemSelectionChanged} event. - *

- * @param o The item. - * @param selected Whether or not the item is selected after the change. - * @protected - */ - onItemSelectionChanged(o:T,selected:boolean):void; - /** - * Removes the given item from the selection in response to the item being removed from the domain. - * @param item The item to remove from the considered items. - */ - removeDomainItem(item:T):void; - /** - * Sets the selection state of the item. - * @param item - * @param selected - */ - setSelected(item:T,selected:boolean):void; - /** - * Gets or sets the predicate which determines whether the queried item should be considered for this selection model. - * @type {function(T): boolean} - */ - isInDomain:(obj:T)=>boolean; - /** - * Gets an observable collection view over the selected items. - * @type {yfiles.collections.IObservableCollection.} - */ - selection:yfiles.collections.IObservableCollection; - /** - * - * @type {number} - */ - size:number; - /** - * - * @param listener - */ - addItemSelectionChangedListener(listener:(sender:any,evt:yfiles.view.ItemSelectionChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeItemSelectionChangedListener(listener:(sender:any,evt:yfiles.view.ItemSelectionChangedEventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.DefaultSelectionModel; - } - export enum ShowFocusPolicy{ - /** - * Indicates that irrespectively of the keyboard focus, the focus should always be rendered for the {@link yfiles.view.FocusIndicatorManager.#focusedItem}. - */ - ALWAYS, - /** - * Indicates that depending on the value of {@link yfiles.view.FocusIndicatorManager.#focused} the focus should only be rendered if this property is set to true. - */ - WHEN_FOCUSED - } - /** - * A {@link yfiles.view.ModelManager.} implementation that manages the visual decoration of the focused element in a canvas. - *

- * For the item that should be focused this class uses the {@link yfiles.graph.ILookup} mechanism of the item to lookup an {@link yfiles.view.IFocusIndicatorInstaller} - * implementation which will do the actual installation of the decoration in the canvas. - *

- * Type parameter T: The type of the items. - * @class - * @extends {yfiles.view.ModelManager.} - * @implements {yfiles.lang.IPropertyObservable} - * @template T - */ - export interface FocusIndicatorManager extends yfiles.view.ModelManager,yfiles.lang.IPropertyObservable{} - export class FocusIndicatorManager { - /** - * Creates an instance that for all focused items in the model dynamically installs a decoration. - * @param canvas The canvas to add the focus marks to. - */ - constructor(canvas:yfiles.view.CanvasComponent); - /** - * Called when the {@link yfiles.view.FocusIndicatorManager.#focused} property has changed. - * @see yfiles.view.FocusIndicatorManager.#focused - * @protected - */ - onFocusedChanged():void; - /** - * Callback method that is triggered when the focused item has changed. - *

- * This method raises the {@link yfiles.view.FocusIndicatorManager.#addPropertyChangedListener PropertyChanged} event. Subclasses overriding this method should make sure to invoke - * the super class implementation. - *

- * @param evt a description of the event - * @see yfiles.view.FocusIndicatorManager.#focusedItem - * @see yfiles.view.FocusIndicatorManager.#addPropertyChangedListener - * @protected - */ - onPropertyChanged(evt:yfiles.lang.PropertyChangedEventArgs):void; - /** - * Adds the given listener for the PropertyChanged event that occurs when the {@link yfiles.view.FocusIndicatorManager.#focusedItem} property has been changed. - * @param listener The listener to add. - * @see yfiles.view.FocusIndicatorManager.#removePropertyChangedListener - */ - addPropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the PropertyChanged event that occurs when the {@link yfiles.view.FocusIndicatorManager.#focusedItem} property has been changed. - * @param listener The listener to remove. - * @see yfiles.view.FocusIndicatorManager.#addPropertyChangedListener - */ - removePropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Gets or sets the focused item, updates the canvas and fires the corresponding property change event. - * @type {T} - */ - focusedItem:T; - /** - * Gets or sets the show focus policy. - *

- * The default is {@link yfiles.view.ShowFocusPolicy#WHEN_FOCUSED}. - *

- * @default yfiles.view.ShowFocusPolicy.WHEN_FOCUSED - * @type {yfiles.view.ShowFocusPolicy} - */ - showFocusPolicy:yfiles.view.ShowFocusPolicy; - /** - * Gets or sets a value indicating whether the {@link yfiles.view.CanvasComponent container} this manager is installed in currently is focused. - * @type {boolean} - */ - focused:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.FocusIndicatorManager; - } - /** - * A {@link yfiles.view.ModelManager.} implementation that manages the visual decorations of highlighted elements in a canvas. - *

- * For each item that should be highlighted this class uses the {@link yfiles.graph.ILookup} mechanism of the items to lookup an {@link yfiles.view.IHighlightIndicatorInstaller} - * implementation which will do the actual installation of the decoration in the canvas. - *

- * Type parameter T: The type of the items. - * @class - * @extends {yfiles.view.ModelManager.} - * @template T - */ - export interface HighlightIndicatorManager extends yfiles.view.ModelManager{} - export class HighlightIndicatorManager { - /** - * Creates an instance that for all selected items in the model dynamically installs a highlight decoration. - * @param canvas The canvas to add the selection marks to. - * @param [selectionModel=null] The model that determines which items are highlighted. - */ - constructor(canvas:yfiles.view.CanvasComponent,selectionModel?:yfiles.view.ISelectionModel); - /** - * Adds another highlight. - * @param item The item to highlight. - */ - addHighlight(item:T):void; - /** - * Removes all highlights. - */ - clearHighlights():void; - /** - * Removes an item from the current highlight selection. - * @param item The item whose highlight decorator will be removed. - */ - removeHighlight(item:T):void; - /** - * Gets or sets the selection model that determines which items are highlighted. - *

- * May be null, in which case no elements are considered highlighted. - *

- * @type {yfiles.view.ISelectionModel.} - */ - selectionModel:yfiles.view.ISelectionModel; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.HighlightIndicatorManager; - } - /** - * Installs visual representations of items in a {@link yfiles.view.CanvasComponent}. - *

- * This interface is most prominently used by {@link yfiles.view.ModelManager.} and its descendants to manage visuals in the canvas. - *

- * @interface - */ - export interface ICanvasObjectInstaller extends yfiles.lang.Object{ - /** - * This the main method of the interface that performs the installation of an item's visual representation in the {@link yfiles.view.CanvasComponent canvas} by - * adding {@link yfiles.view.ICanvasObject}s. - * @param context The context that contains the information required to install the visual representation. - * @param group The canvas object group to add the newly generated {@link } to. - * @param item The item to install. - * @returns The newly generated {@link } for the item's visual representation. null if nothing was installed. - * @abstract - */ - addCanvasObject(context:yfiles.view.ICanvasContext,group:yfiles.view.ICanvasObjectGroup,item:any):yfiles.view.ICanvasObject; - } - var ICanvasObjectInstaller:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.view.ICanvasObjectInstaller; - }; - /** - * An interface for objects that can install a visual representation of a selection decoration of an item in the model - * displayed in a canvas. - *

- * This interface is a tagging sub interface of the {@link yfiles.view.ICanvasObjectInstaller}. This interface is used for {@link yfiles.graph.ILookup#lookup} - * operations. - *

- * @see yfiles.view.SelectionIndicatorManager. - * @see yfiles.view.IHighlightIndicatorInstaller - * @interface - * @implements {yfiles.view.ICanvasObjectInstaller} - */ - export interface ISelectionIndicatorInstaller extends yfiles.lang.Object,yfiles.view.ICanvasObjectInstaller{ - } - var ISelectionIndicatorInstaller:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.view.ISelectionIndicatorInstaller; - }; - /** - * An interface that models the selection state of a set of items. - *

- * This interface extends the {@link yfiles.collections.IEnumerable.} interface for convenient enumeration of the selected items. Use the {@link yfiles.collections.IEnumerable.#getEnumerator} to get - * all selected items. - *

- * Type parameter T: The type of items contained in the selection's domain. - * @interface - * @implements {yfiles.collections.IEnumerable.} - * @template T - */ - export interface ISelectionModel extends yfiles.lang.Object,yfiles.collections.IEnumerable{ - /** - * Clears the selection. - *

- * This is a convenience method that will set the selection state of all elements to unselected. - *

- * @see yfiles.view.ISelectionModel.#addItemSelectionChangedListener - * @abstract - */ - clear():void; - /** - * Determines whether an item is currently selected. - * @param item The item to check. - * @returns Whether it is currently selected. - * @abstract - */ - isSelected(item:T):boolean; - /** - * Sets the selection state of an item. - *

- * If the state changes, this will trigger the {@link yfiles.view.ISelectionModel.#addItemSelectionChangedListener ItemSelectionChanged} event. - *

- * @param item The item to set the selection state for. - * @param selected Whether to select the object. - * @abstract - */ - setSelected(item:T,selected:boolean):void; - /** - * Gets the number of selected items. - * @abstract - * @type {number} - */ - size:number; - /** - * Adds the given listener for the ItemSelectionChanged event that occurs when an item changed its selection state from - * selected to unselected or vice versa. - * @param listener The listener to add. - * @see yfiles.view.ISelectionModel.#setSelected - * @see yfiles.view.ISelectionModel.#removeItemSelectionChangedListener - * @abstract - */ - addItemSelectionChangedListener(listener:(sender:any,evt:yfiles.view.ItemSelectionChangedEventArgs)=>void):void; - /** - * Removes the given listener for the ItemSelectionChanged event that occurs when an item changed its selection state from - * selected to unselected or vice versa. - * @param listener The listener to remove. - * @see yfiles.view.ISelectionModel.#setSelected - * @see yfiles.view.ISelectionModel.#addItemSelectionChangedListener - * @abstract - */ - removeItemSelectionChangedListener(listener:(sender:any,evt:yfiles.view.ItemSelectionChangedEventArgs)=>void):void; - } - var ISelectionModel:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.view.ISelectionModel; - }; - /** - * Provides data for the {@link yfiles.view.ISelectionModel.#addItemSelectionChangedListener ItemSelectionChanged} event. - * Type parameter T. - * @class - * @extends {yfiles.collections.ItemEventArgs.} - * @template T - * @final - */ - export interface ItemSelectionChangedEventArgs extends yfiles.collections.ItemEventArgs{} - export class ItemSelectionChangedEventArgs { - /** - * Initializes a new event argument instance for the given item and its selection state. - * @param item The item whose {@link #isSelected selection state} has changed. - * @param selected The value indicating whether the item is selected after the change. - */ - constructor(item:T,selected:boolean); - /** - * Gets a value indicating whether the item is selected after the change. - * @type {boolean} - */ - itemSelected:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.ItemSelectionChangedEventArgs; - } - /** - * Manages the visual representations of items in a {@link yfiles.view.CanvasComponent}. - * Type parameter T: The type of items this instance deals with. - * @class - * @template T - */ - export interface ModelManager extends yfiles.lang.Object{} - export class ModelManager { - /** - * Creates a new instance that will manage the items for the given canvas. - * @param canvas The canvas to manage. - * @protected - */ - constructor(canvas:yfiles.view.CanvasComponent); - /** - * Installs an itemm and adds it to this managers set of managed items. - *

- * If {@link yfiles.view.ModelManager.#enabled} is set to false the item will not be installed. - *

- * @param item The item to add. - * @returns The newly created canvas object or null if nothing was installed. - * @protected - */ - add(item:T):yfiles.view.ICanvasObject; - /** - * Callback used by {@link yfiles.view.ModelManager.#install} to retrieve the canvas object group for a given item. - *

- * Returning null will cause {@link yfiles.view.ModelManager.#install} not to install anything. - *

- * @param item The item to find a canvas object group for. - * @returns An {@link } or null - * @protected - * @abstract - */ - getCanvasObjectGroup(item:T):yfiles.view.ICanvasObjectGroup; - /** - * Callback used by {@link yfiles.view.ModelManager.#install} to retrieve the installer for a given item. - *

- * Implementations may use the {@link yfiles.graph.ILookup#lookup} of the item. - *

- *

- * Returning null will cause {@link yfiles.view.ModelManager.#install} not to install anything. - *

- * @param item The item to find an installer for. - * @returns An installer or null - * @protected - * @abstract - */ - getInstaller(item:T):yfiles.view.ICanvasObjectInstaller; - /** - * Installs a member of the collection into the canvas using the {@link yfiles.view.ICanvasObjectDescriptor} which is returned by - * {@link yfiles.view.ModelManager.#getInstaller}. - * @param item The member to install. - * @returns The canvas object that has been returned by the installer. - * @protected - */ - install(item:T):yfiles.view.ICanvasObject; - /** - * Called when this mode gets {@link yfiles.view.ModelManager.#enabled disabled}. - * @protected - * @abstract - */ - onDisabled():void; - /** - * Called when this mode gets {@link yfiles.view.ModelManager.#enabled enabled}. - * @protected - * @abstract - */ - onEnabled():void; - /** - * Uninstalls the provided item and removes it from this managers set of managed items. - * @param item The item to remove. - * @protected - */ - remove(item:T):void; - /** - * Simple implementation that removes the given {@link yfiles.view.ICanvasObject}. - * @param canvasObject The canvas objects that have been associated with the descriptor. - * @see yfiles.view.ICanvasObject#remove - * @protected - */ - unInstall(canvasObject:yfiles.view.ICanvasObject):void; - /** - * Gets the canvas instance this instance is managing. - * @type {yfiles.view.CanvasComponent} - */ - canvasComponent:yfiles.view.CanvasComponent; - /** - * Gets or sets whether this {@link yfiles.view.ModelManager.} is enabled. - *

- * If the manager is disabled, it will not install the {@link yfiles.view.ICanvasObject}s into the associated - * {@link yfiles.view.CanvasComponent}. - *

- *

- * The default is true, i.e. this manager is enabled by default. - *

- * @type {boolean} - */ - enabled:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.ModelManager; - } - /** - * A {@link yfiles.view.ModelManager.} implementation that manages the visual decorations of selected elements in a canvas. - *

- * For each item in the {@link yfiles.view.SelectionIndicatorManager.#model} that is marked as selected by the {@link yfiles.view.SelectionIndicatorManager.#selectionModel} this class uses the {@link yfiles.graph.ILookup} mechanism of the items - * to lookup an {@link yfiles.view.ISelectionIndicatorInstaller} implementation which will do the actual installation of the - * decoration in the canvas. - *

- * Type parameter T: The type of the items in the collection and selection model. - * @class - * @extends {yfiles.view.ModelManager.} - * @template T - */ - export interface SelectionIndicatorManager extends yfiles.view.ModelManager{} - export class SelectionIndicatorManager { - /** - * Creates an instance that for all selected items in the model dynamically installs a selection render decoration. - * @param canvas The canvas to add the selection marks to. - * @param model The model that holds the domain. - * @param selectionModel The model that determines which items are selected. - */ - constructor(canvas:yfiles.view.CanvasComponent,model:yfiles.collections.IObservableCollection,selectionModel:yfiles.view.ISelectionModel); - /** - * Adds an item to the current selection. - * @param item The item whose selection decorator will added. - * @returns - */ - addSelection(item:T):yfiles.view.ICanvasObject; - /** - * Removes an item from the current selection. - * @param item The item whose selection decorator will be removed. - */ - removeSelection(item:T):void; - /** - * Gets or sets the selection model that determines which items are selected. - *

- * May be null, in which case no elements are considered selected. - *

- * @type {yfiles.view.ISelectionModel.} - */ - selectionModel:yfiles.view.ISelectionModel; - /** - * Gets or sets the model that describes the domain for the selection. - *

- * Only item contained in this model can be rendered as selected. - *

- * @type {yfiles.collections.IObservableCollection.} - */ - model:yfiles.collections.IObservableCollection; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.SelectionIndicatorManager; - } - /** - * A container that can hold a number of {@link yfiles.view.SvgVisual}s. - *

- * Use this class in a {@link yfiles.view.IVisualCreator} implementation to group several {@link yfiles.view.SvgVisual}s. - *

- *

- * The class cannot be used to group {@link yfiles.view.HtmlCanvasVisual}s. - *

- * @class - * @extends {yfiles.view.SvgVisual} - */ - export interface SvgVisualGroup extends yfiles.view.SvgVisual{} - export class SvgVisualGroup { - /** - * Initializes a new instance of the {@link yfiles.view.SvgVisualGroup} class. - */ - constructor(); - /** - * Adds another {@link yfiles.view.SvgVisual} to the children collection of this instance. - * @param child The child to add. - */ - add(child:yfiles.view.SvgVisual):void; - /** - * Removes a previously added {@link yfiles.view.SvgVisual} from the children collection of this instance. - * @param child The child to remove. - */ - remove(child:yfiles.view.SvgVisual):void; - /** - * Gets or sets a transform that is applied to the children of the container. - * @type {yfiles.geometry.Matrix} - */ - transform:yfiles.geometry.Matrix; - /** - * Gets the list of children with read and write access. - * @type {yfiles.collections.IList.} - */ - children:yfiles.collections.IList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.SvgVisualGroup; - } - /** - * Renders a grid using various different {@link yfiles.view.GridVisualCreator#gridStyle styles}. - * @see yfiles.view.GridInfo - * @see yfiles.view.GridVisualCreator#gridStyle - * @class - * @implements {yfiles.view.IVisualCreator} - */ - export interface GridVisualCreator extends yfiles.lang.Object,yfiles.view.IVisualCreator{} - export class GridVisualCreator { - /** - * Initializes a new instance of the {@link yfiles.view.GridVisualCreator} class. - * @param gridInfo The grid info. - */ - constructor(gridInfo:yfiles.view.GridInfo); - /** - * Initializes a new instance of the {@link yfiles.view.GridVisualCreator} class. - *

- * This initializes the {@link yfiles.view.GridVisualCreator#gridInfo} field using the given values. - *

- * @param horizontalSpacing The x spacing. - * @param verticalSpacing The y spacing. - */ - constructor(horizontalSpacing:number,verticalSpacing:number); - /** - * Initializes a new instance of the {@link yfiles.view.GridVisualCreator} class. - *

- * The spacing is initialized to 25 units. - *

- */ - constructor(); - /** - * - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the grid style that this implementation uses. - * @default yfiles.view.GridStyle.DOTS - * @type {yfiles.view.GridStyle} - */ - gridStyle:yfiles.view.GridStyle; - /** - * Gets or sets the grid info that describes the geometry of the grid. - * @type {yfiles.view.GridInfo} - */ - gridInfo:yfiles.view.GridInfo; - /** - * Gets or sets a value indicating whether this {@link yfiles.view.GridVisualCreator} is visible. - * @default true - * @type {boolean} - */ - visible:boolean; - /** - * Gets or sets the {@link yfiles.view.GridVisualCreator#stroke} to use for painting the grid points. - * @type {yfiles.view.Stroke} - */ - stroke:yfiles.view.Stroke; - /** - * Gets or sets the visibility threshold. - *

- * This indicates the minimum distance in the view coordinate system between two grid points. If the distance becomes - * smaller, the grid will not be rendered. The default value is 20.0d. - *

- * @default 20.0 - * @type {number} - */ - visibilityThreshold:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.GridVisualCreator; - } - export enum GridStyle{ - /** - * For each grid point, there is a small dot rendered. - */ - DOTS, - /** - * For each grid point, there is a small cross rendered. - */ - CROSSES, - /** - * Draws horizontal and vertical lines through the grid points. - */ - LINES - } - /** - * Interface that is implemented for elements that can provide rendering bounds in the world coordinate system. - *

- * This information can be used by the rendering engine to increase rendering performance significantly. - *

- *

Related demos:

- *
    - *
  • Tutorial: 02 Custom Styles, step 06 GetBounds
  • - *
- * @see yfiles.view.IVisualCreator - * @see yfiles.view.CanvasComponent - * @see yfiles.view.ICanvasObjectDescriptor - * @see yfiles.view.ICanvasObject - * @interface - */ - export interface IBoundsProvider extends yfiles.lang.Object{ - /** - * Returns a tight rectangular area where the whole rendering would fit into. - *

- * If calculating the bounds is too expensive or the rendering is not bound to a certain area, this method may return - * {@link yfiles.geometry.Rect#INFINITE}. If nothing is rendered, this method should return an empty rectangle, where either or - * both the width and height is non-positive or {@link yfiles.geometry.Rect#EMPTY}. - *

- * @param context the context to calculate the bounds for - * @returns the bounds or {@link #EMPTY} to indicate an unbound area - * @abstract - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - } - var IBoundsProvider:{ - /** - * Creates an instance that returns the given model as the bounds. - * @param bounds the rectangle - * @returns - * @static - */ - fromRectangle?(bounds:yfiles.geometry.IRectangle):yfiles.view.IBoundsProvider; - /** - * An implementation that returns an {@link yfiles.view.IBoundsProvider} that yields an "Empty" bounds. - * @const - * @static - * @type {yfiles.view.IBoundsProvider} - */ - EMPTY?:yfiles.view.IBoundsProvider; - /** - * An implementation that returns an {@link yfiles.view.IBoundsProvider} that yields {@link yfiles.geometry.Rect#INFINITE "infinite"} bounds. - * @const - * @static - * @type {yfiles.view.IBoundsProvider} - */ - UNBOUNDED?:yfiles.view.IBoundsProvider; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.view.IBoundsProvider; - }; - /** - * Interface that is implemented for elements that can determine whether they might be visible in a given clipping - * rectangle. - *

Related demos:

- *
    - *
  • Tutorial: 02 Custom Styles, step 09 IsVisible
  • - *
- * @see yfiles.view.IVisualCreator - * @see yfiles.view.CanvasComponent - * @see yfiles.view.ICanvasObjectDescriptor - * @see yfiles.view.ICanvasObject - * @interface - */ - export interface IVisibilityTestable extends yfiles.lang.Object{ - /** - * Determines whether an element might intersect the visible region for a given context. - *

- * Conservative implementations can always return true. - *

- * @param context The context to determine the visibility for. - * @param rectangle The visible region clip. - * @returns false if and only if it is safe not to paint the element because it would not affect the given clipping region. - * @abstract - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - } - var IVisibilityTestable:{ - /** - * An implementation of a {@link yfiles.view.IVisibilityTestable} that always yields true. - * @const - * @static - * @type {yfiles.view.IVisibilityTestable} - */ - ALWAYS?:yfiles.view.IVisibilityTestable; - /** - * An implementation of a {@link yfiles.view.IVisibilityTestable} that always yields false. - * @const - * @static - * @type {yfiles.view.IVisibilityTestable} - */ - NEVER?:yfiles.view.IVisibilityTestable; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.view.IVisibilityTestable; - }; - export enum VisualCachingPolicy{ - /** - * Disables caching of {@link yfiles.view.Visual}s completely. - */ - NEVER, - /** - * {@link yfiles.view.Visual}s will always be cached. - *

- * The cached reference will be kept until the corresponding {@link yfiles.view.ICanvasObject} is removed. - *

- */ - ALWAYS - } - /** - * An interface that describes the current context for rendering routines. - * @see yfiles.view.IVisualCreator - * @interface - * @implements {yfiles.view.ICanvasContext} - */ - export interface IRenderContext extends yfiles.lang.Object,yfiles.view.ICanvasContext{ - /** - * Notifies the context that the visual has been removed from the visual tree. - *

- * This has to be done in a {@link yfiles.view.IVisualCreator}'s {@link yfiles.view.IVisualCreator#updateVisual} method if a - * {@link yfiles.view.IVisualCreator}'s {@link yfiles.view.IVisualCreator#createVisual} is called or a previously added visual will be - * removed or replaced. Calling this method will call a previously {@link yfiles.view.IRenderContext#setDisposeCallback registered} dispose visual callback that the visual has - * been removed and needs to free its resources. - *

- *

- * If the visual has not been registered previously this method will do nothing. - *

- * @param visual The visual which has been removed. - * @see yfiles.view.IRenderContext#setDisposeCallback - * @see yfiles.view.IVisualCreator - * @see yfiles.view.IVisualCreator#updateVisual - */ - childVisualRemoved?(visual:yfiles.view.Visual):void; - /** - * Registers a visual if children have registered themselves for disposal. - *

- * This is necessary for visual creators which delegate to another visual creator to create one or more child visuals, like - * style decorators. - *

- *

- * Implementors have to add a call to this method at the end of their {@link yfiles.view.IVisualCreator#createVisual} and {@link yfiles.view.IVisualCreator#updateVisual} - * methods. - *

- *

- * The registered callback has to call {@link yfiles.view.IRenderContext#childVisualRemoved} on all child visuals of the visual. - *

- * @param visual The visual to be registered. This is the visual which is returned by the {@link #createVisual} or {@link #updateVisual} - * method which calls this method. - * @param callback A dispose visual callback which calls {@link #childVisualRemoved} on all child visuals of the - * registered visual. - */ - registerForChildrenIfNecessary?(visual:yfiles.view.Visual,callback:(context:yfiles.view.IRenderContext,removedVisual:yfiles.view.Visual,dispose:boolean)=>yfiles.view.Visual):void; - /** - * Registers a callback which will be called when the visual will be removed from the visual tree. - *

- * This applies to a {@link yfiles.view.IVisualCreator}'s {@link yfiles.view.IVisualCreator#createVisual} method if the created visual - * allocates resources which should be freed after the visual is no longer used. In this case the visual has to be - * registered together with a dispose visual callback which can free the allocated resources. The callback will be called - * by the framework when the visual is removed from the visual tree. - *

- *

- * The callback can also be used to support caching for temporarily removed visuals. See dispose visual callback. - *

- * @param visual The visual which needs to be disposed after removal. - * @param callback A callback which will dispose the visual. - * @see yfiles.view.IVisualCreator - * @see yfiles.view.IVisualCreator#createVisual - */ - setDisposeCallback?(visual:yfiles.view.Visual,callback:(context:yfiles.view.IRenderContext,removedVisual:yfiles.view.Visual,dispose:boolean)=>yfiles.view.Visual):void; - /** - * Converts the given set of world coordinates to a coordinate pair that can be used to render within the {@link yfiles.view.IRenderContext#viewTransform}. - * @param worldPoint The coordinates in the world coordinate system. - * @returns The coordinates in the view coordinate system. - * @see yfiles.view.IRenderContext#viewTransform - * @abstract - */ - toViewCoordinates(worldPoint:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Gets the clipping rectangle in world coordinates. - *

- * Rendering outside of this clip may be skipped altogether. - *

- * @abstract - * @type {yfiles.geometry.Rect} - */ - clip:yfiles.geometry.Rect; - /** - * Gets a transform that can be added to the transform list of a visual to be displayed in the original coordinate system - * (the view coordinate system). - *

- * In contrast to the world coordinate system where the logical coordinates of the elements that are managed by a {@link yfiles.view.CanvasComponent} - * (for example, graph elements like node and edges), the view coordinate system is used to display visualizations that are - * independent to scale (zoom) or translation transformations (like handles or selection indicators). - *

- * @abstract - * @type {yfiles.geometry.Matrix} - */ - viewTransform:yfiles.geometry.Matrix; - /** - * Provides access to the defs element in the SVG DOM that is managed by this instance. - * @see yfiles.view.IRenderContext#svgDefsManager - * @abstract - * @type {Element} - */ - defsElement:Element; - /** - * Provides access to the {@link yfiles.view.SvgDefsManager} that manages this instance. - * @abstract - * @type {yfiles.view.SvgDefsManager} - */ - svgDefsManager:yfiles.view.SvgDefsManager; - } - var IRenderContext:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.view.IRenderContext; - }; - /** - * Factory interface which is used by implementations that know how to create {@link yfiles.view.Visual}s for rendering into a - * given {@link yfiles.view.IRenderContext}. - * @see yfiles.view.CanvasComponent - * @see yfiles.view.ICanvasObjectDescriptor - * @see yfiles.view.ICanvasObject - * @interface - */ - export interface IVisualCreator extends yfiles.lang.Object{ - /** - * This method is called by the framework to create a {@link yfiles.view.Visual} that will be included into the - * {@link yfiles.view.IRenderContext}. - *

- * {@link yfiles.view.CanvasComponent} uses this interface through the {@link yfiles.view.ICanvasObjectDescriptor} to populate the visual - * canvas object tree. - *

- * @param context The context that describes where the visual will be used. - * @returns The visual to include in the canvas object visual tree. This may be null. - * @see yfiles.view.IVisualCreator#updateVisual - * @abstract - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * This method updates or replaces a previously created {@link yfiles.view.Visual} for inclusion in the - * {@link yfiles.view.IRenderContext}. - *

- * The {@link yfiles.view.CanvasComponent} uses this method to give implementations a chance to update an existing Visual that has - * previously been created by the same instance during a call to {@link yfiles.view.IVisualCreator#createVisual}. Implementation - * may update the oldVisual and return that same reference, or create a new visual and return the new instance or null. - *

- * @param context The context that describes where the visual will be used in. - * @param oldVisual The visual instance that had been returned the last time the {@link #createVisual} method was called - * on this instance. - * @returns oldVisual, if this instance modified the visual, or a new visual that should replace the existing one in the canvas - * object visual tree. - * @see yfiles.view.IVisualCreator#createVisual - * @see yfiles.view.ICanvasObjectDescriptor - * @see yfiles.view.CanvasComponent - * @abstract - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - } - var IVisualCreator:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.view.IVisualCreator; - }; - /** - * A void/null implementation of the {@link yfiles.view.IVisualCreator} interface that does nothing. - *

- * Use {@link yfiles.view.VoidVisualCreator#INSTANCE} for methods that require non-null {@link yfiles.view.IVisualCreator} implementations - * if you want to have no visualization. - *

- * @class - * @implements {yfiles.view.IVisualCreator} - * @final - */ - export interface VoidVisualCreator extends yfiles.lang.Object,yfiles.view.IVisualCreator{} - export class VoidVisualCreator { - /** - * Returns null. - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * Returns null. - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * An immutable and shareable convenience instance of the {@link yfiles.view.VoidVisualCreator} class. - * @const - * @static - * @type {yfiles.view.IVisualCreator} - */ - static INSTANCE:yfiles.view.IVisualCreator; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.VoidVisualCreator; - } - /** - * An abstract base class for the {@link yfiles.view.ISelectionIndicatorInstaller}, {@link yfiles.view.IFocusIndicatorInstaller} and {@link yfiles.view.IHighlightIndicatorInstaller} - * implementations that draws an oriented rectangle using a {@link yfiles.view.OrientedRectangleIndicatorInstaller#template}. - *

- * In the {@link yfiles.view.ICanvasObjectInstaller#addCanvasObject} method, this implementation will add either a fixed {@link yfiles.geometry.IOrientedRectangle} - * instance that is passed in the constructor as a parameter or the return value of the method {@link yfiles.view.OrientedRectangleIndicatorInstaller#getRectangle} - * if the former does not exist (i.e. the parameterless constructor was used to instantiate this class). - *

- * @class - * @implements {yfiles.view.ISelectionIndicatorInstaller} - * @implements {yfiles.view.IHighlightIndicatorInstaller} - * @implements {yfiles.view.IFocusIndicatorInstaller} - */ - export interface OrientedRectangleIndicatorInstaller extends yfiles.lang.Object,yfiles.view.ISelectionIndicatorInstaller,yfiles.view.IHighlightIndicatorInstaller,yfiles.view.IFocusIndicatorInstaller{} - export class OrientedRectangleIndicatorInstaller { - /** - * Initializes a new instance of the {@link yfiles.view.OrientedRectangleIndicatorInstaller} class with fixed bounds and a {@link string}. - *

- * The given {@link yfiles.geometry.IOrientedRectangle} is used for all items as object that is added to the {@link yfiles.view.ICanvasObjectGroup} - * in the {@link yfiles.view.ICanvasObjectInstaller#addCanvasObject} method. - *

- *

- * If the {@link yfiles.view.OrientedRectangleIndicatorInstaller#template} property is not set, the templateKey is used to lookup a {@link yfiles.view.IVisualTemplate} in the resources of the - * {@link yfiles.view.CanvasComponent}. If there is none, a default templated is used. - *

- * @param fixedBounds - * @param [templateKey=null] - */ - constructor(fixedBounds:yfiles.geometry.IOrientedRectangle,templateKey?:string); - /** - * Initializes a new instance of the {@link yfiles.view.OrientedRectangleIndicatorInstaller} class without fixed bounds. - *

- * The object that is created through this constructor relies on the value returned by the {@link yfiles.view.OrientedRectangleIndicatorInstaller#getRectangle} - * method to {@link yfiles.view.ICanvasObjectGroup#addChild add} to the {@link yfiles.view.ICanvasObjectGroup} in the {@link yfiles.view.ICanvasObjectInstaller#addCanvasObject} method. - *

- */ - constructor(); - /** - * - * @param context - * @param group - * @param item - * @returns - */ - addCanvasObject(context:yfiles.view.ICanvasContext,group:yfiles.view.ICanvasObjectGroup,item:any):yfiles.view.ICanvasObject; - /** - * Factory method that returns an {@link yfiles.geometry.IOrientedRectangle} for a given user object. - *

- * This method is called for the object to {@link yfiles.view.ICanvasObjectGroup#addChild add} to the - * {@link yfiles.view.ICanvasObjectGroup}, if there are no fixed bounds set on this instance (i.e. the parameterless constructor - * was used to instantiate this class). - *

- *

- * This implementation returns null for every given object. - *

- * @param item - * @returns An {@link } for the given item that is {@link #addChild added} to the {@link }. - * @protected - */ - getRectangle(item:any):yfiles.geometry.IOrientedRectangle; - /** - * A {@link string} that will be used to find the {@link yfiles.view.IVisualTemplate} for drawing the selection indicator. - * @const - * @static - * @type {string} - */ - static SELECTION_TEMPLATE_KEY:string; - /** - * A {@link string} that will be used to find the {@link yfiles.view.IVisualTemplate} for drawing the focus indicator. - * @const - * @static - * @type {string} - */ - static FOCUS_TEMPLATE_KEY:string; - /** - * A {@link string} that will be used to find the {@link yfiles.view.IVisualTemplate} for drawing the highlight indicator. - * @const - * @static - * @type {string} - */ - static HIGHLIGHT_TEMPLATE_KEY:string; - /** - * Gets or sets the {@link yfiles.view.IVisualTemplate} to use for this indicator. - *

- * If this property is not set, the {@link string} passed in the constructor is used to lookup a {@link yfiles.view.IVisualTemplate} in the - * resources of the {@link yfiles.view.CanvasComponent}. If there is none, a default templated is used. - *

- * @type {yfiles.view.IVisualTemplate} - */ - template:yfiles.view.IVisualTemplate; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.OrientedRectangleIndicatorInstaller; - } - /** - * A simple {@link yfiles.view.ISelectionIndicatorInstaller} implementation that draws an ellipse centered at a given point in - * world coordinate space. - * @class - * @implements {yfiles.view.ISelectionIndicatorInstaller} - */ - export interface PointSelectionIndicatorInstaller extends yfiles.lang.Object,yfiles.view.ISelectionIndicatorInstaller{} - export class PointSelectionIndicatorInstaller { - /** - * Creates a new instance that indicates a point. - * @param point The point to use for the center of the painting. - */ - constructor(point:yfiles.geometry.IPoint); - /** - * - * @param context - * @param group - * @param item - * @returns - */ - addCanvasObject(context:yfiles.view.ICanvasContext,group:yfiles.view.ICanvasObjectGroup,item:any):yfiles.view.ICanvasObject; - /** - * Factory method that retrieves the center for a given user object. - *

- * This implementation simply returns the value provided to the constructor. - *

- * @param userObject - * @returns - * @protected - */ - getCenterPoint(userObject:any):yfiles.geometry.IPoint; - /** - * Gets or sets the {@link yfiles.view.Stroke} to use for drawing the point in the view coordinate system. - * @type {yfiles.view.Stroke} - */ - stroke:yfiles.view.Stroke; - /** - * Gets or sets the {@link yfiles.view.Fill} to use for filling the point's ellipse in the view coordinate system. - * @type {yfiles.view.Fill} - */ - fill:yfiles.view.Fill; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.PointSelectionIndicatorInstaller; - } - /** - * A basis implementation of {@link yfiles.view.ISelectionIndicatorInstaller}, {@link yfiles.view.IFocusIndicatorInstaller} and {@link yfiles.view.IHighlightIndicatorInstaller} - * that draws a rectangle using a {@link yfiles.view.RectangleIndicatorInstaller#template}. - *

- * In the {@link yfiles.view.ICanvasObjectInstaller#addCanvasObject} method, this implementation will add either a fixed {@link yfiles.geometry.IRectangle} - * instance that is passed in the constructor as a parameter or the return value of the method {@link yfiles.view.RectangleIndicatorInstaller#getRectangle} - * if the former does not exist (i.e. the parameterless constructor was used to instantiate this class). - *

- * @class - * @implements {yfiles.view.ISelectionIndicatorInstaller} - * @implements {yfiles.view.IHighlightIndicatorInstaller} - * @implements {yfiles.view.IFocusIndicatorInstaller} - */ - export interface RectangleIndicatorInstaller extends yfiles.lang.Object,yfiles.view.ISelectionIndicatorInstaller,yfiles.view.IHighlightIndicatorInstaller,yfiles.view.IFocusIndicatorInstaller{} - export class RectangleIndicatorInstaller { - /** - * Initializes a new instance of the {@link yfiles.view.RectangleIndicatorInstaller} class with fixed bounds and a {@link string}. - *

- * The given {@link yfiles.geometry.IOrientedRectangle} is used for all items as object that is added to the {@link yfiles.view.ICanvasObjectGroup} - * in the {@link yfiles.view.ICanvasObjectInstaller#addCanvasObject} method. - *

- *

- * If the {@link yfiles.view.RectangleIndicatorInstaller#template} property is not set, the resourceKey is used to lookup a {@link yfiles.view.IVisualTemplate} in the resources of the - * {@link yfiles.view.CanvasComponent}. If there is none, a default templated is used. - *

- * @param fixedBounds - * @param [resourceKey=null] - */ - constructor(fixedBounds:yfiles.geometry.IRectangle,resourceKey?:string); - /** - * Initializes a new instance of the {@link yfiles.view.RectangleIndicatorInstaller} class without fixed bounds. - *

- * The object that is created through this constructor relies on the value returned by the {@link yfiles.view.RectangleIndicatorInstaller#getRectangle} - * method to {@link yfiles.view.ICanvasObjectGroup#addChild add} to the {@link yfiles.view.ICanvasObjectGroup} in the {@link yfiles.view.ICanvasObjectInstaller#addCanvasObject} method. - *

- */ - constructor(); - /** - * - * @param context - * @param group - * @param item - * @returns - */ - addCanvasObject(context:yfiles.view.ICanvasContext,group:yfiles.view.ICanvasObjectGroup,item:any):yfiles.view.ICanvasObject; - /** - * Factory method that returns an {@link yfiles.geometry.IRectangle} for a given user object. - *

- * This method is called for the object to {@link yfiles.view.ICanvasObjectGroup#addChild add} to the - * {@link yfiles.view.ICanvasObjectGroup}, if there are no fixed bounds set on this instance (i.e. the parameterless constructor - * was used to instantiate this class). - *

- *

- * This implementation returns null for every given object. - *

- * @param userObject - * @returns An {@link } for the given item that is {@link #addChild added} to the {@link }. - * @protected - */ - getRectangle(userObject:any):yfiles.geometry.IRectangle; - /** - * A {@link string} that will be used to find the {@link yfiles.view.IVisualTemplate} for drawing the selection indicator. - * @const - * @static - * @type {string} - */ - static SELECTION_TEMPLATE_KEY:string; - /** - * A {@link string} that will be used to find the {@link yfiles.view.IVisualTemplate} for drawing the focus indicator. - * @const - * @static - * @type {string} - */ - static FOCUS_TEMPLATE_KEY:string; - /** - * A {@link string} that will be used to find the {@link yfiles.view.IVisualTemplate} for drawing the highlight indicator. - * @const - * @static - * @type {string} - */ - static HIGHLIGHT_TEMPLATE_KEY:string; - /** - * Gets or sets the {@link yfiles.view.IVisualTemplate} to use for this indicator. - *

- * If this property is not set, the {@link string} passed in the constructor is used to lookup a {@link yfiles.view.IVisualTemplate} in the - * resources of the {@link yfiles.view.CanvasComponent}. If there is none, a default templated is used. - *

- * @type {yfiles.view.IVisualTemplate} - */ - template:yfiles.view.IVisualTemplate; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.RectangleIndicatorInstaller; - } - /** - * Helper class used by {@link yfiles.view.CanvasComponent} to limit the interactive movement of the viewport. - *

- * The {@link yfiles.view.CanvasComponent#viewportLimiter} instance should be consulted whenever the user tries to change the viewport. Using method {@link yfiles.view.ViewportLimiter#limitViewport} - * the desired viewport can be validated by the implementation. Note that setting the {@link yfiles.view.CanvasComponent#zoom} property or {@link yfiles.view.CanvasComponent#viewPoint} property will not be - * influenced by implementations of this class. It is up to the caller to perform verification. - *

- * @see yfiles.view.ViewportLimiter#bounds - * @class - */ - export interface ViewportLimiter extends yfiles.lang.Object{} - export class ViewportLimiter { - /** - * Initializes a new instance of the {@link yfiles.view.ViewportLimiter} class. - */ - constructor(); - /** - * Gets the to bounds that should be honored for the upcoming call. - *

- * This method is used as callback by {@link yfiles.view.ViewportLimiter#limitViewport} for each request. The default - * implementation just yields {@link yfiles.view.ViewportLimiter#bounds}. - *

- * @param canvas The canvas control. - * @param suggestedViewport The suggested viewport. - * @returns The bounds to honor or null. - * @protected - */ - getCurrentBounds(canvas:yfiles.view.CanvasComponent,suggestedViewport:yfiles.geometry.Rect):yfiles.geometry.Rect; - /** - * Inspects the desired or suggested new viewport for the given control and returns a valid viewport to use. - * @param canvas The canvas control on which the viewport should be applied. - * @param suggestedViewport The suggested viewport. - * @returns The viewport that should be used. - */ - limitViewport(canvas:yfiles.view.CanvasComponent,suggestedViewport:yfiles.geometry.Rect):yfiles.geometry.Rect; - /** - * Gets or sets a value indicating whether both dimensions of {@link yfiles.view.ViewportLimiter#bounds} need to be honored. - * @default true - * @type {boolean} - */ - honorBothDimensions:boolean; - /** - * Gets or sets the maximal allowed navigable bounds for the viewport. - * @type {yfiles.geometry.Rect} - */ - bounds:yfiles.geometry.Rect; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.ViewportLimiter; - } - export enum DragDropKeyStates{ - /** - * The left mouse button is down or a touch gesture is in progress. - */ - POINTER_DOWN, - /** - * No button and no key is pressed. - */ - NONE, - /** - * The shift key is down. - */ - SHIFT_KEY, - /** - * The control key is down. - */ - CONTROL_KEY, - /** - * The alt key is down. - */ - ALT_KEY - } - /** - * A simple {@link yfiles.view.ICanvasObjectDescriptor} that can be used to draw {@link yfiles.input.IPortCandidate} instances in a - * {@link yfiles.view.CanvasComponent}. - * @class - * @implements {yfiles.view.ICanvasObjectDescriptor} - * @implements {yfiles.view.IVisualCreator} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - */ - export interface DefaultPortCandidateDescriptor extends yfiles.lang.Object,yfiles.view.ICanvasObjectDescriptor,yfiles.view.IVisualCreator,yfiles.view.IBoundsProvider,yfiles.input.IHitTestable,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable{} - export class DefaultPortCandidateDescriptor { - /** - * Instantiates a new descriptor. - */ - constructor(); - /** - * - * @param forUserObject - * @returns - */ - getBoundsProvider(forUserObject:any):yfiles.view.IBoundsProvider; - /** - * - * @param forUserObject - * @returns - */ - getHitTestable(forUserObject:any):yfiles.input.IHitTestable; - /** - * - * @param forUserObject - * @returns - */ - getVisibilityTestable(forUserObject:any):yfiles.view.IVisibilityTestable; - /** - * - * @param forUserObject - * @returns - */ - getVisualCreator(forUserObject:any):yfiles.view.IVisualCreator; - /** - * - * @param context - * @param canvasObject - * @returns - */ - isDirty(context:yfiles.view.ICanvasContext,canvasObject:yfiles.view.ICanvasObject):boolean; - /** - * Sets the {@link yfiles.view.IVisualTemplate} to use for the given {@link string} by this instance. - *

- * This method can be used to reconfigure the visualization for the various keys that are declared by this class. - *

- * @param resourceKey The key to reconfigure. This is one of - * {@link #CANDIDATE_DRAWING_VALID_NON_FOCUSED_KEY}, - * {@link #CANDIDATE_DRAWING_INVALID_NON_FOCUSED_KEY}, - * {@link #CANDIDATE_DRAWING_INVALID_FOCUSED_KEY}, - * {@link #CANDIDATE_DRAWING_VALID_FOCUSED_KEY}. - * @param template The template to use instead of the default. - */ - setTemplate(resourceKey:string,template:yfiles.view.IVisualTemplate):void; - /** - * A {@link string} that can be used by instances of the {@link yfiles.view.DefaultPortCandidateDescriptor} to look up a {@link yfiles.view.IVisualTemplate} - * that will be used for rendering a valid, non-focused {@link yfiles.input.IPortCandidate}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static CANDIDATE_DRAWING_VALID_NON_FOCUSED_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.view.DefaultPortCandidateDescriptor} to look up a {@link yfiles.view.IVisualTemplate} - * that will be used for rendering a valid, focused {@link yfiles.input.IPortCandidate}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static CANDIDATE_DRAWING_VALID_FOCUSED_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.view.DefaultPortCandidateDescriptor} to look up a {@link yfiles.view.IVisualTemplate} - * that will be used for rendering an invalid, non-focused {@link yfiles.input.IPortCandidate}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static CANDIDATE_DRAWING_INVALID_NON_FOCUSED_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.view.DefaultPortCandidateDescriptor} to look up a {@link yfiles.view.IVisualTemplate} - * that will be used for rendering a invalid, focused {@link yfiles.input.IPortCandidate}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static CANDIDATE_DRAWING_INVALID_FOCUSED_KEY:string; - /** - * Gets or sets a property that determines whether this descriptor uses the "current" candidates. - * @type {boolean} - */ - currentCandidate:boolean; - /** - * Gets or sets the logical size of the candidate. - *

- * This size is used for hit testing, visibility tests, etc. The default is 3. - *

- * @type {number} - */ - size:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.DefaultPortCandidateDescriptor; - } - /** - * Manages the visual appearance of an {@link yfiles.graph.IGraph} instance in a {@link yfiles.view.CanvasComponent}. - *

- * This class monitors the structural changes of an {@link yfiles.graph.IGraph} implementation and installs the necessary {@link yfiles.view.ICanvasObject} - * instance in the canvas for each item in the graph. Note that {@link yfiles.view.GraphComponent} has an instance of this type - * built-in already and usually it is not necessary to create an own one. This class will also {@link yfiles.view.GraphModelManager#useHierarchicNodeNesting use the node hierarchy} to - * nest the nodes {@link yfiles.view.GraphModelManager#useHierarchicEdgeNesting and edges} accordingly. - *

- * @see yfiles.view.GraphModelManager#nodeGroup - * @see yfiles.view.GraphModelManager#useHierarchicEdgeNesting - * @see yfiles.view.GraphModelManager#useHierarchicNodeNesting - * @class - */ - export interface GraphModelManager extends yfiles.lang.Object{} - export class GraphModelManager { - /** - * Creates a manager instance for the given control. - *

- * The contents of the graph will be added to given group that is must be part of the canvas. - *

- *

- * In order to get anything useful out of this instance the {@link yfiles.view.GraphModelManager#graph} property should be set to an instance after construction. - *

- * @param canvas the canvas to manage the visual appearance of a graph for. - * @param contentGroup the group to add the graph's visual content to. Can be null, in which case {@link #contentGroup} should be set afterwards or {@link #createContentGroup} - * will automatically create a group lazily. - */ - constructor(canvas:yfiles.view.CanvasComponent,contentGroup:yfiles.view.ICanvasObjectGroup); - /** - * Creates a manager instance for the given control. - *

- * The contents of the graph will be added to a newly created group that is added to the root of the scene graph. - *

- *

- * In order to get anything useful out of this instance the {@link yfiles.view.GraphModelManager#graph} property should be set to an instance after construction. - *

- * @param canvas the canvas to manage the visual appearance of a graph for. - */ - constructor(canvas:yfiles.view.CanvasComponent); - /** - * Compares two items with respect to their visibility order. - * @param item1 the first item to compare - * @param item2 the second item to compare - * @returns an integer value indicating the relative rendering order of the two items - * @see yfiles.view.GraphModelManager#comparer - */ - compare(item1:yfiles.graph.IModelItem,item2:yfiles.graph.IModelItem):number; - /** - * Factory method that creates the {@link yfiles.view.GraphModelManager#contentGroup} - *

- * The default implementation will just add another group to the {@link yfiles.view.CanvasComponent}. - *

- * @returns The group to use for adding the content. - * @protected - */ - createContentGroup():yfiles.view.ICanvasObjectGroup; - /** - * Factory method for the {@link yfiles.view.GraphModelManager#edgeGroup} property. - *

- * This method will be called upon first access to the property. - *

- * @returns a new group that has been added to the {@link #contentGroup} - * @protected - */ - createEdgeGroup():yfiles.view.ICanvasObjectGroup; - /** - * Factory method for the {@link yfiles.view.GraphModelManager#edgeLabelGroup} property. - *

- * This method will be called upon first access to the property. - *

- * @returns a new group that has been added to the {@link #contentGroup} - * @protected - */ - createEdgeLabelGroup():yfiles.view.ICanvasObjectGroup; - /** - * Gets a {@link yfiles.input.IHitTester.} that can be used to enumerate hits on the canvas at a given world coordinate position. - *

- * This enumerator will enumerate hits in the order so that the visually topmost element will be reported first. - *

- * Type parameter T. - * @param itemType - * @returns - * @template T - */ - createHitTester(itemType:yfiles.lang.Class):yfiles.input.IHitTester; - /** - * Factory method for the {@link yfiles.view.GraphModelManager#nodeGroup} property. - *

- * This method will be called upon first access to the property. - *

- * @returns a new group that has been added to the {@link #contentGroup} - * @protected - */ - createNodeGroup():yfiles.view.ICanvasObjectGroup; - /** - * Factory method for the {@link yfiles.view.GraphModelManager#nodeLabelGroup} property. - *

- * This method will be called upon first access to the property. - *

- * @returns a new group that has been added to the {@link #contentGroup} - * @protected - */ - createNodeLabelGroup():yfiles.view.ICanvasObjectGroup; - /** - * Factory method for the {@link yfiles.view.GraphModelManager#portGroup} property. - *

- * This method will be called upon first access to the property. - *

- * @returns a new group that has been added to the {@link #contentGroup} - * @protected - */ - createPortGroup():yfiles.view.ICanvasObjectGroup; - /** - * Retrieves the {@link yfiles.view.ICanvasObject} for a given model item managed by this instance. - * @param item the item - * @returns the canvas object for the given item or null - * @see yfiles.view.ItemModelManager.#getCanvasObject - */ - getCanvasObject(item:yfiles.graph.IModelItem):yfiles.view.ICanvasObject; - /** - * Retrieves the Canvas Object group to use for the given label. - *

- * This implementation is called by the default {@link yfiles.view.GraphModelManager#nodeLabelDescriptor} and {@link yfiles.view.GraphModelManager#edgeLabelDescriptor} instances. - *

- * @param label The label that will be installed in the canvas. - * @returns The group to use. - * @protected - */ - getCanvasObjectGroup(label:yfiles.graph.ILabel):yfiles.view.ICanvasObjectGroup; - /** - * Retrieves the Canvas Object group to use for the given port. - *

- * This implementation is called by the default {@link yfiles.view.GraphModelManager#portDescriptor} instance. - *

- * @param port The port that will be installed in the canvas. - * @returns The group to use. - * @protected - */ - getCanvasObjectGroup(port:yfiles.graph.IPort):yfiles.view.ICanvasObjectGroup; - /** - * Retrieves the Canvas Object group to use for the given edge. - *

- * This implementation is called by the default {@link yfiles.view.GraphModelManager#edgeDescriptor} instance. - *

- * @param edge The edge that will be installed in the canvas. - * @returns The group to use. - * @protected - */ - getCanvasObjectGroup(edge:yfiles.graph.IEdge):yfiles.view.ICanvasObjectGroup; - /** - * Retrieves the Canvas Object group to use for the given node. - *

- * This implementation is called by the default {@link yfiles.view.GraphModelManager#nodeDescriptor} instance. - *

- * @param node The node that will be installed in the canvas. - * @returns The group to use. - * @protected - */ - getCanvasObjectGroup(node:yfiles.graph.INode):yfiles.view.ICanvasObjectGroup; - /** - * Retrieves the corresponding {@link yfiles.graph.IModelItem} for the given canvas object. - * @param canvasObject the instance to use for the query - * @returns The item that is associated with the object or null. - */ - getModelItem(canvasObject:yfiles.view.ICanvasObject):yfiles.graph.IModelItem; - /** - * Enumerates hits on the canvas at a given world coordinate position for a given context. - *

- * The instance returned will enumerate hits in the order so that the topmost visual element will be reported first. The - * enumeration is performed lazily. - *

- * @param context The context to provide to {@link #isHit} - * @param location the world coordinates to perform the hit test - * @param root The group to search the subtree of. - * @returns an enumerable that will enumerate the hits at the given coordinates - */ - hitElementsAt(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,root:yfiles.view.ICanvasObjectGroup):yfiles.collections.IEnumerable; - /** - * Enumerates hits on the canvas at a given world coordinate position. - *

- * The instance returned will enumerate hits in the order so that the topmost visual element will be reported first. The - * enumeration is performed lazily. - *

- * @param location the world coordinates to perform the hit test - * @returns an enumerable that will enumerate the hits at the given coordinates - */ - hitElementsAt(location:yfiles.geometry.Point):yfiles.collections.IEnumerable; - /** - * Called when the {@link yfiles.view.GraphModelManager#graph} property changes. - *

- * This method registers the collections of the graph instance with the {@link yfiles.view.CollectionModelManager. mechanism} that manages the mapping between the - * elements and the - * {@link yfiles.view.ICanvasObject}s. Subclasses should call the base method if they want to use the default mechanisms. - *

- * @param oldGraph The old graph instance. - * @param newGraph The new graph instance. - * @protected - */ - onGraphChanged(oldGraph:yfiles.graph.IGraph,newGraph:yfiles.graph.IGraph):void; - /** - * Enumerates hits on the canvas at a given world coordinate position in a given context. - *

- * The instance returned will enumerate hits in the order so that the topmost visual element will be reported first. The - * enumeration is performed lazily. - *

- * Type parameter T. - * @param modelItemType - * @param context The context to provide to {@link #isHit} - * @param location the world coordinates to perform the hit test - * @param root The group to search the subtree of. - * @returns an enumerable that will enumerate the hits at the given coordinates - * @template T - */ - typedHitElementsAt(modelItemType:yfiles.lang.Class,context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,root:yfiles.view.ICanvasObjectGroup):yfiles.collections.IEnumerable; - /** - * Enumerates hits on the canvas at a given world coordinate position. - *

- * The instance returned will enumerate hits in the order so that the topmost visual element will be reported first. The - * enumeration is performed lazily. - *

- * Type parameter T. - * @param itemType - * @param location the world coordinates to perform the hit test - * @returns an enumerable that will enumerate the hits at the given coordinates - * @template T - */ - typedHitElementsAt(itemType:yfiles.lang.Class,location:yfiles.geometry.Point):yfiles.collections.IEnumerable; - /** - * {@link yfiles.view.CollectionModelManager.#update Updates} the visual representation of the given item. - * @param item The item to update the visual representation - * @see yfiles.view.CollectionModelManager.#update - */ - update(item:yfiles.graph.IModelItem):void; - /** - * Gets the {@link yfiles.view.ICanvasObjectGroup} instance that will be used for installing node styles. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.GraphModelManager#createNodeGroup} - * will be called. Note that in the case of {@link yfiles.view.GraphModelManager#useHierarchicNodeNesting hierarchic node nesting}, nodes will not be installed at the top-level of this - * group. Rather a more complicated nesting of dynamically created {@link yfiles.view.ICanvasObjectGroup}s will be used. - *

- * @see yfiles.view.GraphModelManager#getCanvasObjectGroup - * @see yfiles.view.GraphModelManager#nodeDescriptor - * @type {yfiles.view.ICanvasObjectGroup} - */ - nodeGroup:yfiles.view.ICanvasObjectGroup; - /** - * Gets the {@link yfiles.view.ICanvasObjectGroup} instance that will be used for installing edge styles. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.GraphModelManager#createEdgeGroup} - * will be called. Note that in the case of {@link yfiles.view.GraphModelManager#useHierarchicNodeNesting hierarchically nested graphs} edges will only be put directly in this - * {@link yfiles.view.ICanvasObjectGroup}, if the {@link yfiles.view.GraphModelManager#useHierarchicEdgeNesting} property is set to false. Otherwise edges will actually be nested in the subtree - * of the {@link yfiles.view.GraphModelManager#nodeGroup} according to the node nesting. - *

- * @see yfiles.view.GraphModelManager#getCanvasObjectGroup - * @see yfiles.view.GraphModelManager#edgeDescriptor - * @type {yfiles.view.ICanvasObjectGroup} - */ - edgeGroup:yfiles.view.ICanvasObjectGroup; - /** - * Gets the {@link yfiles.view.ICanvasObjectGroup} instance that will be used for installing edge label styles. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.GraphModelManager#createEdgeLabelGroup} - * will be called. - *

- * @see yfiles.view.GraphModelManager#getCanvasObjectGroup - * @see yfiles.view.GraphModelManager#edgeLabelDescriptor - * @type {yfiles.view.ICanvasObjectGroup} - */ - edgeLabelGroup:yfiles.view.ICanvasObjectGroup; - /** - * Gets the {@link yfiles.view.ICanvasObjectGroup} instance that will be used for installing node label styles. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.GraphModelManager#createNodeLabelGroup} - * will be called. - *

- * @see yfiles.view.GraphModelManager#getCanvasObjectGroup - * @see yfiles.view.GraphModelManager#nodeLabelDescriptor - * @type {yfiles.view.ICanvasObjectGroup} - */ - nodeLabelGroup:yfiles.view.ICanvasObjectGroup; - /** - * Gets the {@link yfiles.view.ICanvasObjectGroup} instance that will be used for installing port styles. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.GraphModelManager#createPortGroup} - * will be called. - *

- * @see yfiles.view.GraphModelManager#getCanvasObjectGroup - * @see yfiles.view.GraphModelManager#portDescriptor - * @type {yfiles.view.ICanvasObjectGroup} - */ - portGroup:yfiles.view.ICanvasObjectGroup; - /** - * Gets or sets the {@link yfiles.view.ICanvasObjectDescriptor} instance used for installing an {@link yfiles.graph.IEdge} into the - * canvas. - * @type {yfiles.view.ICanvasObjectDescriptor} - */ - edgeDescriptor:yfiles.view.ICanvasObjectDescriptor; - /** - * Gets or sets the {@link yfiles.view.ICanvasObjectDescriptor} instance used for installing an {@link yfiles.graph.IPort} into the - * canvas. - * @type {yfiles.view.ICanvasObjectDescriptor} - */ - portDescriptor:yfiles.view.ICanvasObjectDescriptor; - /** - * Gets or sets the {@link yfiles.view.ICanvasObjectDescriptor} instance used for installing an {@link yfiles.graph.ILabel} of an {@link yfiles.graph.IEdge} - * into the canvas. - * @type {yfiles.view.ICanvasObjectDescriptor} - */ - edgeLabelDescriptor:yfiles.view.ICanvasObjectDescriptor; - /** - * Gets or sets the {@link yfiles.view.ICanvasObjectDescriptor} instance used for installing an {@link yfiles.graph.ILabel} of an {@link yfiles.graph.INode} - * into the canvas. - * @type {yfiles.view.ICanvasObjectDescriptor} - */ - nodeLabelDescriptor:yfiles.view.ICanvasObjectDescriptor; - /** - * Gets or sets whether this instance should nest the edges accordingly if the graph is grouped. - *

- * Hierarchic nesting for edges requires that {@link yfiles.view.GraphModelManager#useHierarchicNodeNesting hierarchic nesting for nodes} is enabled as well. If both properties are - * enabled (the default) the edges will actually be interleaved with the nodes in the nested canvas object subtree so the {@link yfiles.view.GraphModelManager#edgeGroup} - * will be empty. - *

- * @see yfiles.view.GraphModelManager#useHierarchicNodeNesting - * @type {boolean} - */ - useHierarchicEdgeNesting:boolean; - /** - * Gets or sets the {@link yfiles.view.ICanvasObjectDescriptor} instance used for installing an {@link yfiles.graph.INode} into the - * canvas. - * @type {yfiles.view.ICanvasObjectDescriptor} - */ - nodeDescriptor:yfiles.view.ICanvasObjectDescriptor; - /** - * Gets or sets the content group this manager instance uses to add visual representation of the graph to. - * @type {yfiles.view.ICanvasObjectGroup} - */ - contentGroup:yfiles.view.ICanvasObjectGroup; - /** - * Gets an {@link yfiles.collections.IComparer.} instance that can be used to compare two model items with respect to their visual display order. - *

- * An item is considered to be greater than another item if it is rendered on top of it. - *

- * @type {yfiles.collections.IComparer.} - */ - comparer:yfiles.collections.IComparer; - /** - * Gets a {@link yfiles.input.IHitTester.} that can be used to enumerate hits on the canvas at a given world coordinate position. - *

- * This enumerator will enumerate hits in the order so that the visually topmost element will be reported first. - *

- * @type {yfiles.input.IHitTester.} - */ - hitTester:yfiles.input.IHitTester; - /** - * Gets or sets the graph this manager manages. - * @see yfiles.view.GraphModelManager#onGraphChanged - * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - /** - * Gets or sets whether this instance should nest the nodes {@link yfiles.view.GraphModelManager#useHierarchicEdgeNesting and optionally edges} accordingly if the graph is grouped. - * @type {boolean} - */ - useHierarchicNodeNesting:boolean; - /** - * The immutable instance of the default {@link yfiles.view.ICanvasObjectDescriptor} for {@link yfiles.graph.INode}s which simply defers to - * the node's {@link yfiles.styles.INodeStyle}. - * @const - * @static - * @type {yfiles.view.ICanvasObjectDescriptor} - */ - static DEFAULT_NODE_DESCRIPTOR:yfiles.view.ICanvasObjectDescriptor; - /** - * The immutable instance of the default {@link yfiles.view.ICanvasObjectDescriptor} for {@link yfiles.graph.IEdge}s which simply defers to - * the edge's {@link yfiles.styles.IEdgeStyle}. - * @const - * @static - * @type {yfiles.view.ICanvasObjectDescriptor} - */ - static DEFAULT_EDGE_DESCRIPTOR:yfiles.view.ICanvasObjectDescriptor; - /** - * The immutable instance of the default {@link yfiles.view.ICanvasObjectDescriptor} for {@link yfiles.graph.IPort}s which simply defers to - * the port's {@link yfiles.styles.IPortStyle}. - * @const - * @static - * @type {yfiles.view.ICanvasObjectDescriptor} - */ - static DEFAULT_PORT_DESCRIPTOR:yfiles.view.ICanvasObjectDescriptor; - /** - * The immutable instance of the default {@link yfiles.view.ICanvasObjectDescriptor} for {@link yfiles.graph.ILabel}s which simply defers - * to the label's {@link yfiles.styles.ILabelStyle}. - * @const - * @static - * @type {yfiles.view.ICanvasObjectDescriptor} - */ - static DEFAULT_LABEL_DESCRIPTOR:yfiles.view.ICanvasObjectDescriptor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.GraphModelManager; - } - /** - * An implementation of the {@link yfiles.view.IObstacleProvider} interface that uses the {@link yfiles.graph.IGraph#edges edges} and {@link yfiles.graph.IGraph#nodes nodes} of an {@link yfiles.graph.IGraph} - * as obstacles. - *

- * The {@link yfiles.view.BridgeManager} then calculates bridges for edge paths that cross these obstacles. - *

- *

- * This class can be used to add bridge support via the {@link yfiles.view.BridgeManager} to a rendered {@link yfiles.graph.IGraph}. - *

- * @see yfiles.view.BridgeManager#addObstacleProvider - * @see yfiles.view.BridgeManager - * @see yfiles.view.IObstacleProvider - * @class - * @implements {yfiles.view.IObstacleProvider} - */ - export interface GraphObstacleProvider extends yfiles.lang.Object,yfiles.view.IObstacleProvider{} - export class GraphObstacleProvider { - /** - * Helper method that retrieves the {@link yfiles.graph.IGraph} to use from the context - *

- * This implementation uses the {@link yfiles.graph.ILookup#lookup} of the {@link yfiles.view.ICanvasContext#canvasComponent} to query the {@link yfiles.graph.IGraph} implementation. - *

- * @param context The context to retrieve the implementation from. - * @returns The {@link } instance to query or null. - * @protected - */ - getGraph(context:yfiles.view.IRenderContext):yfiles.graph.IGraph; - /** - * Iterates over all {@link yfiles.graph.IGraph#edges} and {@link yfiles.graph.IGraph#nodes} to query an {@link yfiles.view.IObstacleProvider} from the {@link yfiles.graph.IModelItem}'s - * {@link yfiles.graph.ILookup#lookup}. - *

- * This method will depending on the {@link yfiles.view.GraphObstacleProvider#queryEdges} and {@link yfiles.view.GraphObstacleProvider#queryNodes} property query the items for an implementation of {@link yfiles.view.IObstacleProvider} - * and concatenate all resulting {@link yfiles.geometry.GeneralPath} obstacles into one path that will then be returned. - *

- * @param context The context where the obstacles are queried for. - * @returns A path that is the concatenated path of all obstacles for the given context. - */ - getObstacles(context:yfiles.view.IRenderContext):yfiles.geometry.GeneralPath; - /** - * Gets or sets a value indicating whether to query the {@link yfiles.graph.IGraph#edges} for an {@link yfiles.view.IObstacleProvider} implementation. - *

- * The default is true. - *

- * @type {boolean} - */ - queryEdges:boolean; - /** - * Gets or sets a value indicating whether to query the {@link yfiles.graph.IGraph#nodes} for an {@link yfiles.view.IObstacleProvider} implementation. - * @type {boolean} - */ - queryNodes:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.GraphObstacleProvider; - } - /** - * Simple implementation of the {@link yfiles.view.IGraphSelection} interface. - * @class - * @implements {yfiles.view.IGraphSelection} - */ - export interface GraphSelection extends yfiles.lang.Object,yfiles.view.IGraphSelection{} - export class GraphSelection { - /** - * Instantiates an instance using the the graph as the model. - * @param graph - */ - constructor(graph:yfiles.graph.IGraph); - /** - * Creates a new instance with no initial {@link yfiles.view.GraphSelection#graph} assigned. - *

- * In order to be always in sync with the structural changes in a graph, an instance should be associated with an {@link yfiles.graph.IGraph} - * using the {@link yfiles.view.GraphSelection#graph} property. - *

- */ - constructor(); - /** - * - */ - clear():void; - /** - * Factory method that creates the {@link yfiles.view.DefaultSelectionModel.} to use for the bends. - * @returns - * @protected - */ - createBendSelectionModel():yfiles.view.DefaultSelectionModel; - /** - * Factory method that creates the {@link yfiles.view.DefaultSelectionModel.} to use for the edges. - * @returns - * @protected - */ - createEdgeSelectionModel():yfiles.view.DefaultSelectionModel; - /** - * Factory method that creates the {@link yfiles.view.DefaultSelectionModel.} to use for the labels. - * @returns - * @protected - */ - createLabelSelectionModel():yfiles.view.DefaultSelectionModel; - /** - * Factory method that creates the {@link yfiles.view.DefaultSelectionModel.} to use for the nodes. - * @returns - * @protected - */ - createNodeSelectionModel():yfiles.view.DefaultSelectionModel; - /** - * Factory method that creates the {@link yfiles.view.DefaultSelectionModel.} to use for the ports. - * @returns - * @protected - */ - createPortSelectionModel():yfiles.view.DefaultSelectionModel; - /** - * Returns an enumerator that iterates through the collection of all selected elements. - * @returns An {@link } object that can be used to iterate through all selected elements. - */ - getEnumerator():yfiles.collections.IEnumerator; - /** - * - * @param item - * @returns - */ - isSelected(item:yfiles.graph.IModelItem):boolean; - /** - * Raises the {@link yfiles.view.GraphSelection#addItemSelectionChangedListener ItemSelectionChanged} event - * @param evt The parameters for the event - * @protected - */ - onItemSelectionChanged(evt:yfiles.view.ItemSelectionChangedEventArgs):void; - /** - * - * @param item - * @param selected - */ - setSelected(item:yfiles.graph.IModelItem,selected:boolean):void; - /** - * - * @type {yfiles.view.ISelectionModel.} - */ - selectedNodes:yfiles.view.ISelectionModel; - /** - * - * @type {yfiles.view.ISelectionModel.} - */ - selectedEdges:yfiles.view.ISelectionModel; - /** - * - * @type {yfiles.view.ISelectionModel.} - */ - selectedLabels:yfiles.view.ISelectionModel; - /** - * - * @type {yfiles.view.ISelectionModel.} - */ - selectedPorts:yfiles.view.ISelectionModel; - /** - * - * @type {yfiles.view.ISelectionModel.} - */ - selectedBends:yfiles.view.ISelectionModel; - /** - * - * @type {number} - */ - size:number; - /** - * Gets or sets the {@link yfiles.graph.IGraph} this instance is using as the domain for the selection. - * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - /** - * - * @param listener - */ - addItemSelectionChangedListener(listener:(sender:any,evt:yfiles.view.ItemSelectionChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeItemSelectionChangedListener(listener:(sender:any,evt:yfiles.view.ItemSelectionChangedEventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.GraphSelection; - } - /** - * Manages the selection state of items in an {@link yfiles.graph.IGraph} instance. - *

- * This interface provides access to the {@link yfiles.view.ISelectionModel.} instances that manage the selection of nodes, edges, labels, ports, and bends. - * The generic methods that use {@link yfiles.graph.IModelItem} parameters delegate to the corresponding domain-specific selection - * models. - *

- * @see yfiles.view.ISelectionModel. - * @interface - * @implements {yfiles.view.ISelectionModel.} - */ - export interface IGraphSelection extends yfiles.lang.Object,yfiles.view.ISelectionModel{ - /** - * Gets an {@link yfiles.view.ISelectionModel.} of the selected nodes. - *

- * This is the node part of the selection that this instance is a composite of. - *

- * @abstract - * @type {yfiles.view.ISelectionModel.} - */ - selectedNodes:yfiles.view.ISelectionModel; - /** - * Gets an {@link yfiles.view.ISelectionModel.} of the selected labels. - *

- * This is the label part of the selection that this instance is a composite of. - *

- * @abstract - * @type {yfiles.view.ISelectionModel.} - */ - selectedLabels:yfiles.view.ISelectionModel; - /** - * Gets an {@link yfiles.view.ISelectionModel.} of the selected edges. - *

- * This is the edge part of the selection that this instance is a composite of. - *

- * @abstract - * @type {yfiles.view.ISelectionModel.} - */ - selectedEdges:yfiles.view.ISelectionModel; - /** - * Gets an {@link yfiles.view.ISelectionModel.} of the selected ports. - *

- * This is the ports part of the selection that this instance is a composite of. - *

- * @abstract - * @type {yfiles.view.ISelectionModel.} - */ - selectedPorts:yfiles.view.ISelectionModel; - /** - * Gets an {@link yfiles.view.ISelectionModel.} of the selected bends. - *

- * This is the bend part of the selection that this instance is a composite of. - *

- * @abstract - * @type {yfiles.view.ISelectionModel.} - */ - selectedBends:yfiles.view.ISelectionModel; - } - var IGraphSelection:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.view.IGraphSelection; - }; - /** - * An implementation of the {@link yfiles.view.ICanvasObjectInstaller} interface that can decorate the visual appearence of an - * {@link yfiles.graph.IEdge}. - *

- * This will install an {@link yfiles.view.ICanvasObject} during {@link yfiles.view.ICanvasObjectInstaller#addCanvasObject installation}, that will render the path and the bends of an edge - * using a {@link yfiles.view.EdgeDecorationInstaller#getStroke pen} for the path and a {@link yfiles.view.EdgeDecorationInstaller#getBendDrawing drawing} for the bends. - *

- * @class - * @implements {yfiles.view.ISelectionIndicatorInstaller} - * @implements {yfiles.view.IHighlightIndicatorInstaller} - * @implements {yfiles.view.IFocusIndicatorInstaller} - */ - export interface EdgeDecorationInstaller extends yfiles.lang.Object,yfiles.view.ISelectionIndicatorInstaller,yfiles.view.IHighlightIndicatorInstaller,yfiles.view.IFocusIndicatorInstaller{} - export class EdgeDecorationInstaller { - /** - * Installs a rendering for the item if it is an {@link yfiles.graph.IEdge} that will use the {@link yfiles.view.EdgeDecorationInstaller#getBendDrawing} - * and {@link yfiles.view.EdgeDecorationInstaller#getStroke} to render the path and bends. - * @param context The canvas context. - * @param group The {@link } to add the new canvas object to. - * @param item The item to install. - * @returns The canvas object representing the item. - */ - addCanvasObject(context:yfiles.view.ICanvasContext,group:yfiles.view.ICanvasObjectGroup,item:any):yfiles.view.ICanvasObject; - /** - * Callback method that retrieves the drawing of the bend for the context. - *

- * This implementation will use the {@link yfiles.view.EdgeSelectionIndicatorInstaller#BEND_TEMPLATE_KEY} resource to find a {@link yfiles.view.IVisualTemplate} - * instance. If null is yielded, a default drawing will be used. - *

- * @param canvas The canvas for which the drawing shall be returned. - * @param edge The edge for which the rendering will be used. - * @returns The drawing instance to use for the rendering of the bends in the given context. - * @protected - * @abstract - */ - getBendDrawing(canvas:yfiles.view.CanvasComponent,edge:yfiles.graph.IEdge):yfiles.view.IVisualTemplate; - /** - * Callback method that retrieves the {@link yfiles.view.Stroke} for the context. - *

- * This implementation will use the {@link yfiles.view.EdgeSelectionIndicatorInstaller#STROKE_KEY} resource to find a {@link yfiles.view.Stroke} - * instance. If null is yielded, a default {@link yfiles.view.Stroke} will be used. - *

- * @param edge The edge for which the rendering will be used. - * @param canvas The canvas for which the {@link } shall be returned. - * @returns The {@link } instance to use for the rendering of the edge in the given context. - * @protected - * @abstract - */ - getStroke(canvas:yfiles.view.CanvasComponent,edge:yfiles.graph.IEdge):yfiles.view.Stroke; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.EdgeDecorationInstaller; - } - /** - * An implementation of the {@link yfiles.view.ICanvasObjectInstaller} interface that can install the selection outline of an - * {@link yfiles.graph.IEdge}. - *

- * This will {@link yfiles.view.EdgeDecorationInstaller#addCanvasObject install} an {@link yfiles.view.ICanvasObject} that will render the path and the bends of an edge using a {@link yfiles.view.EdgeSelectionIndicatorInstaller#getStroke pen} for the - * path and a {@link yfiles.view.EdgeSelectionIndicatorInstaller#getBendDrawing drawing} for the bends. - *

- * @class - * @extends {yfiles.view.EdgeDecorationInstaller} - */ - export interface EdgeSelectionIndicatorInstaller extends yfiles.view.EdgeDecorationInstaller{} - export class EdgeSelectionIndicatorInstaller { - constructor(); - /** - * A {@link string} that will be used to find the {@link yfiles.view.Stroke} that will be used to draw the path of the edge. - * @const - * @static - * @type {string} - */ - static STROKE_KEY:string; - /** - * A {@link string} that will be used to find the {@link yfiles.view.IVisualTemplate} that will be used to draw the bends of the edge. - * @const - * @static - * @type {string} - */ - static BEND_TEMPLATE_KEY:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.EdgeSelectionIndicatorInstaller; - } - /** - * An specialized subclass of the {@link yfiles.view.EdgeSelectionIndicatorInstaller} that can install the focus indicator of an - * {@link yfiles.graph.IEdge}. - *

- * This will {@link yfiles.view.EdgeDecorationInstaller#addCanvasObject install} an {@link yfiles.view.ICanvasObject} that will render the path and the bends of an edge using a {@link yfiles.view.EdgeFocusIndicatorInstaller#getStroke pen} for the - * path and a {@link yfiles.view.EdgeFocusIndicatorInstaller#getBendDrawing drawing} for the bends. - *

- * @class - * @extends {yfiles.view.EdgeDecorationInstaller} - */ - export interface EdgeFocusIndicatorInstaller extends yfiles.view.EdgeDecorationInstaller{} - export class EdgeFocusIndicatorInstaller { - constructor(); - /** - * A {@link string} that will be used to find the {@link yfiles.view.Stroke} that will be used to draw the path of the edge. - * @const - * @static - * @type {string} - */ - static STROKE_KEY:string; - /** - * A {@link string} that will be used to find the {@link yfiles.view.IVisualTemplate} that will be used to draw the bends of the edge. - * @const - * @static - * @type {string} - */ - static BEND_TEMPLATE_KEY:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.EdgeFocusIndicatorInstaller; - } - /** - * An specialized subclass of the {@link yfiles.view.EdgeSelectionIndicatorInstaller} that can install the highlight rendering of - * an {@link yfiles.graph.IEdge}. - *

- * This will {@link yfiles.view.EdgeDecorationInstaller#addCanvasObject install} an {@link yfiles.view.ICanvasObject} that will render the path and the bends of an edge using a {@link yfiles.view.EdgeHighlightIndicatorInstaller#getStroke pen} for the - * path and a {@link yfiles.view.EdgeHighlightIndicatorInstaller#getBendDrawing drawing} for the bends. - *

- * @class - * @extends {yfiles.view.EdgeDecorationInstaller} - */ - export interface EdgeHighlightIndicatorInstaller extends yfiles.view.EdgeDecorationInstaller{} - export class EdgeHighlightIndicatorInstaller { - constructor(); - /** - * A {@link string} that will be used to find the {@link yfiles.view.Stroke} that will be used to draw the path of the edge. - * @const - * @static - * @type {string} - */ - static STROKE_KEY:string; - /** - * A {@link string} that will be used to find the {@link yfiles.view.IVisualTemplate} that will be used to draw the bends of the edge. - * @const - * @static - * @type {string} - */ - static BEND_TEMPLATE_KEY:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.EdgeHighlightIndicatorInstaller; - } - /** - * Allows the use of an {@link yfiles.styles.IEdgeStyle} to render the selection, highlight or focus indicator of edges. - *

- * The renderer of the {@link yfiles.view.EdgeStyleDecorationInstaller#edgeStyle} used by this class must create {@link yfiles.view.SvgVisual}s. - *

- *

- * The {@link yfiles.view.EdgeStyleDecorationInstaller#zoomPolicy} property defines how the zoom level affects the rendering of the indicator. It can either scale according to the - * zoom level similar to regular graph items or have always to same thickness regardless of the zoom, similar to the - * default yFiles indicators. - *

- * @see yfiles.view.NodeStyleDecorationInstaller - * @see yfiles.view.LabelStyleDecorationInstaller - * @class - * @implements {yfiles.view.ISelectionIndicatorInstaller} - * @implements {yfiles.view.IHighlightIndicatorInstaller} - * @implements {yfiles.view.IFocusIndicatorInstaller} - */ - export interface EdgeStyleDecorationInstaller extends yfiles.lang.Object,yfiles.view.ISelectionIndicatorInstaller,yfiles.view.IHighlightIndicatorInstaller,yfiles.view.IFocusIndicatorInstaller{} - export class EdgeStyleDecorationInstaller { - /** - * Create a new instance of this class. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.styles.IEdgeStyle} options.edgeStyle The style to use for the rendering. - *

- * This option sets the {@link yfiles.view.EdgeStyleDecorationInstaller#edgeStyle} property on the created object. - *

- * @param {yfiles.view.StyleDecorationZoomPolicy} options.zoomPolicy How the style is affected by the current zoom level. - *

- * This option sets the {@link yfiles.view.EdgeStyleDecorationInstaller#zoomPolicy} property on the created object. - *

- */ - constructor(options?:{edgeStyle?:yfiles.styles.IEdgeStyle,zoomPolicy?:yfiles.view.StyleDecorationZoomPolicy}); - /** - * Installs a rendering for the item if it is an {@link yfiles.graph.IEdge}. - * @param context The canvas context. - * @param group The canvas object group to add the newly created {@link } to. - * @param item The item to install. - * @returns The canvas object representing the item. - */ - addCanvasObject(context:yfiles.view.ICanvasContext,group:yfiles.view.ICanvasObjectGroup,item:any):yfiles.view.ICanvasObject; - /** - * Gets or sets how the style is affected by the current zoom level. - *

- * Changes of the value of this property are propagated to all styles created by this instance and become immediately - * visible. - *

- *

- * The default value is {@link yfiles.view.StyleDecorationZoomPolicy#VIEW_COORDINATES}. - *

- * @type {yfiles.view.StyleDecorationZoomPolicy} - */ - zoomPolicy:yfiles.view.StyleDecorationZoomPolicy; - /** - * Gets or sets the style to use for the rendering. - *

- * Changes of the value of this property are not propagated to already created styles. - *

- *

- * The default value is an instance of {@link yfiles.styles.PolylineEdgeStyle}. - *

- * @type {yfiles.styles.IEdgeStyle} - */ - edgeStyle:yfiles.styles.IEdgeStyle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.EdgeStyleDecorationInstaller; - } - /** - * An {@link yfiles.view.IVisualCreator} for use in a {@link yfiles.view.CanvasComponent} that renders a {@link yfiles.graph.IGraph} instance in a - * sloppy overview style. - * @class - * @implements {yfiles.view.IVisualCreator} - */ - export interface GraphOverviewCanvasVisualCreator extends yfiles.lang.Object,yfiles.view.IVisualCreator{} - export class GraphOverviewCanvasVisualCreator { - /** - * Creates a new instance for the given graph. - * @param graph - */ - constructor(graph:yfiles.graph.IGraph); - /** - * Callback that paints the specified edge. - * @param renderContext - * @param ctx - * @param edge - * @protected - */ - paintEdge(renderContext:yfiles.view.IRenderContext,ctx:CanvasRenderingContext2D,edge:yfiles.graph.IEdge):void; - /** - * Callback method that paints the specified node. - * @param renderContext - * @param ctx - * @param node - * @protected - */ - paintGroupNode(renderContext:yfiles.view.IRenderContext,ctx:CanvasRenderingContext2D,node:yfiles.graph.INode):void; - /** - * Callback method that paints the specified node. - * @param renderContext - * @param ctx - * @param node - * @protected - */ - paintNode(renderContext:yfiles.view.IRenderContext,ctx:CanvasRenderingContext2D,node:yfiles.graph.INode):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.GraphOverviewCanvasVisualCreator; - } - /** - * Allows the use of an {@link yfiles.styles.ILabelStyle} to render the selection, highlight or focus indicator of labels. - *

- * The renderer of the {@link yfiles.view.LabelStyleDecorationInstaller#labelStyle} used by this class must create {@link yfiles.view.SvgVisual}s. - *

- *

- * The {@link yfiles.view.LabelStyleDecorationInstaller#zoomPolicy} property defines how the zoom level affects the rendering of the indicator. It can either scale according to the - * zoom level similar to regular graph items or have always to same thickness regardless of the zoom, similar to the - * default yFiles indicators. - *

- * @see yfiles.view.EdgeStyleDecorationInstaller - * @see yfiles.view.NodeStyleDecorationInstaller - * @class - * @implements {yfiles.view.ISelectionIndicatorInstaller} - * @implements {yfiles.view.IHighlightIndicatorInstaller} - * @implements {yfiles.view.IFocusIndicatorInstaller} - */ - export interface LabelStyleDecorationInstaller extends yfiles.lang.Object,yfiles.view.ISelectionIndicatorInstaller,yfiles.view.IHighlightIndicatorInstaller,yfiles.view.IFocusIndicatorInstaller{} - export class LabelStyleDecorationInstaller { - /** - * Create a new instance of this class. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.styles.ILabelStyle} options.labelStyle The style to use for the rendering. - *

- * This option sets the {@link yfiles.view.LabelStyleDecorationInstaller#labelStyle} property on the created object. - *

- * @param {yfiles.geometry.Insets} options.margins The margins around the label layout. - *

- * This option sets the {@link yfiles.view.LabelStyleDecorationInstaller#margins} property on the created object. - *

- * @param {yfiles.view.StyleDecorationZoomPolicy} options.zoomPolicy How the style is affected by the current zoom level. - *

- * This option sets the {@link yfiles.view.LabelStyleDecorationInstaller#zoomPolicy} property on the created object. - *

- */ - constructor(options?:{labelStyle?:yfiles.styles.ILabelStyle,margins?:yfiles.geometry.Insets,zoomPolicy?:yfiles.view.StyleDecorationZoomPolicy}); - /** - * Installs a rendering for the item if it is an {@link yfiles.graph.ILabel}. - * @param context The canvas context. - * @param group The canvas object group to add the newly created canvas object to. - * @param item The item to install. - * @returns The canvas object representing the item. - */ - addCanvasObject(context:yfiles.view.ICanvasContext,group:yfiles.view.ICanvasObjectGroup,item:any):yfiles.view.ICanvasObject; - /** - * Gets or sets how the style is affected by the current zoom level. - *

- * Changes of the value of this property are propagated to all styles created by this instance and become immediately - * visible. - *

- *

- * The default value is {@link yfiles.view.StyleDecorationZoomPolicy#VIEW_COORDINATES}. - *

- * @type {yfiles.view.StyleDecorationZoomPolicy} - */ - zoomPolicy:yfiles.view.StyleDecorationZoomPolicy; - /** - * Gets or sets the margins around the label layout. - *

- * Actually, the bounds rendered by the style is the original label layout enlarged by these margins. - *

- *

- * Changes of the value of this property are propagated to all styles created by this instance and become immediately - * visible. - *

- *

- * The default margins have a value of 5 for all four sides. - *

- * @type {yfiles.geometry.Insets} - */ - margins:yfiles.geometry.Insets; - /** - * Gets or sets the style to use for the rendering. - *

- * Changes of the value of this property are not propagated to already created styles. - *

- *

- * The default value is an instance of {@link yfiles.styles.DefaultLabelStyle}. - *

- * @type {yfiles.styles.ILabelStyle} - */ - labelStyle:yfiles.styles.ILabelStyle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.LabelStyleDecorationInstaller; - } - /** - * Allows the use of an {@link yfiles.styles.INodeStyle} to render the selection, highlight or focus indicator of nodes. - *

- * The renderer of the {@link yfiles.view.NodeStyleDecorationInstaller#nodeStyle} used by this class must create {@link yfiles.view.SvgVisual}s. - *

- *

- * The {@link yfiles.view.NodeStyleDecorationInstaller#zoomPolicy} property defines how the zoom level affects the rendering of the indicator. It can either scale according to the - * zoom level similar to regular graph items or have always to same thickness regardless of the zoom, similar to the - * default yFiles indicators. - *

- * @see yfiles.view.EdgeStyleDecorationInstaller - * @see yfiles.view.LabelStyleDecorationInstaller - * @class - * @implements {yfiles.view.ISelectionIndicatorInstaller} - * @implements {yfiles.view.IHighlightIndicatorInstaller} - * @implements {yfiles.view.IFocusIndicatorInstaller} - */ - export interface NodeStyleDecorationInstaller extends yfiles.lang.Object,yfiles.view.ISelectionIndicatorInstaller,yfiles.view.IHighlightIndicatorInstaller,yfiles.view.IFocusIndicatorInstaller{} - export class NodeStyleDecorationInstaller { - /** - * Create a new instance of this class. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.styles.INodeStyle} options.nodeStyle The style to use for the rendering. - *

- * This option sets the {@link yfiles.view.NodeStyleDecorationInstaller#nodeStyle} property on the created object. - *

- * @param {yfiles.geometry.Insets} options.margins The margins around the node layout. - *

- * This option sets the {@link yfiles.view.NodeStyleDecorationInstaller#margins} property on the created object. - *

- * @param {yfiles.view.StyleDecorationZoomPolicy} options.zoomPolicy How the style is affected by the current zoom level. - *

- * This option sets the {@link yfiles.view.NodeStyleDecorationInstaller#zoomPolicy} property on the created object. - *

- */ - constructor(options?:{nodeStyle?:yfiles.styles.INodeStyle,margins?:yfiles.geometry.Insets,zoomPolicy?:yfiles.view.StyleDecorationZoomPolicy}); - /** - * Installs a rendering for the item if it is an {@link yfiles.graph.INode}. - * @param context The canvas context. - * @param group The canvas object group to add the newly created canvas object to. - * @param item The item to install. - * @returns The canvas object representing the item. - */ - addCanvasObject(context:yfiles.view.ICanvasContext,group:yfiles.view.ICanvasObjectGroup,item:any):yfiles.view.ICanvasObject; - /** - * Gets or sets how the style is affected by the current zoom level. - *

- * Changes of the value of this property are propagated to all styles created by this instance and become immediately - * visible. - *

- *

- * The default value is {@link yfiles.view.StyleDecorationZoomPolicy#VIEW_COORDINATES}. - *

- * @type {yfiles.view.StyleDecorationZoomPolicy} - */ - zoomPolicy:yfiles.view.StyleDecorationZoomPolicy; - /** - * Gets or sets the margins around the node layout. - *

- * Actually, the bounds rendered by the style is the original node layout enlarged by these margins. - *

- *

- * Changes of the value of this property are propagated to all styles created by this instance and become immediately - * visible. - *

- *

- * The default margins have a value of 5 for all four sides. - *

- * @type {yfiles.geometry.Insets} - */ - margins:yfiles.geometry.Insets; - /** - * Gets or sets the style to use for the rendering. - *

- * Changes of the value of this property are not propagated to already created styles. - *

- *

- * The default value is an instance of {@link yfiles.styles.ShapeNodeStyle}. - *

- * @type {yfiles.styles.INodeStyle} - */ - nodeStyle:yfiles.styles.INodeStyle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.NodeStyleDecorationInstaller; - } - export enum StyleDecorationZoomPolicy{ - /** - * The visual is rendered in the view coordinate space and doesn't scale with the zoom level. - *

- * This is similar to the default node resize handles, for example. - *

- */ - VIEW_COORDINATES, - /** - * The visual is rendered in the world coordinate space and scales with the zoom level like a regular graph item - * visualization, for example a node style. - */ - WORLD_COORDINATES, - /** - * Uses WorldCoordinates rendering for zoom level >= 1 and ViewCoordinates rendering for zoom level < 1. - */ - MIXED - } - /** - * Represents any object which fills an area. - * @class - * @implements {yfiles.lang.ICloneable} - */ - export interface Fill extends yfiles.lang.Object,yfiles.lang.ICloneable{} - export class Fill { - /** - * Assigns the fill defined by this instance to the given element. - *

- * If this {@link yfiles.view.Fill} is a gradient and implements the {@link yfiles.view.ISvgDefsCreator} interface, it will be added to the - * defs section of the SVG document. The fill of the given element will be set to a reference to the gradient element. - *

- * @param element The element whose fill should be set. - * @param context The context. - */ - applyTo(element:SVGElement,context:yfiles.view.ICanvasContext):void; - /** - * Clones this instance by returning a {@link any#memberwiseClone} or this in case this instance is already {@link yfiles.view.Fill#isFrozen frozen}. - * @returns An instance of the same type as this instance. - */ - clone():any; - /** - * Freezes this instance. - *

- * Freezing an object makes it immutable, which can result in performance enhancements. - *

- */ - freeze():void; - /** - * Determines if this instance is frozen. - * @returns - */ - isFrozen():boolean; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color AliceBlue. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static ALICE_BLUE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color AntiqueWhite. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static ANTIQUE_WHITE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Aqua. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static AQUA:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Aquamarine. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static AQUAMARINE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Azure. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static AZURE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Beige. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static BEIGE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Bisque. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static BISQUE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Black. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static BLACK:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color BlanchedAlmond. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static BLANCHED_ALMOND:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Blue. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static BLUE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color BlueViolet. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static BLUE_VIOLET:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Brown. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static BROWN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color BurlyWood. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static BURLY_WOOD:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color CadetBlue. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static CADET_BLUE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Chartreuse. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static CHARTREUSE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Chocolate. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static CHOCOLATE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Coral. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static CORAL:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color CornflowerBlue. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static CORNFLOWER_BLUE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Cornsilk. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static CORNSILK:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Crimson. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static CRIMSON:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Cyan. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static CYAN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color DarkBlue. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static DARK_BLUE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color DarkCyan. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static DARK_CYAN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color DarkGoldenrod. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static DARK_GOLDENROD:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color DarkGray. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static DARK_GRAY:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color DarkGreen. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static DARK_GREEN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color DarkKhaki. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static DARK_KHAKI:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color DarkMagenta. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static DARK_MAGENTA:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color DarkOliveGreen. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static DARK_OLIVE_GREEN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color DarkOrange. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static DARK_ORANGE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color DarkOrchid. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static DARK_ORCHID:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color DarkRed. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static DARK_RED:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color DarkSalmon. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static DARK_SALMON:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color DarkSeaGreen. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static DARK_SEA_GREEN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color DarkSlateBlue. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static DARK_SLATE_BLUE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color DarkSlateGray. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static DARK_SLATE_GRAY:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color DarkTurquoise. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static DARK_TURQUOISE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color DarkViolet. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static DARK_VIOLET:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color DeepPink. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static DEEP_PINK:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color DeepSkyBlue. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static DEEP_SKY_BLUE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color DimGray. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static DIM_GRAY:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color DodgerBlue. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static DODGER_BLUE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Firebrick. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static FIREBRICK:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color FloralWhite. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static FLORAL_WHITE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color ForestGreen. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static FOREST_GREEN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Fuchsia. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static FUCHSIA:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Gainsboro. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static GAINSBORO:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color GhostWhite. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static GHOST_WHITE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Gold. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static GOLD:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Goldenrod. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static GOLDENROD:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Gray. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static GRAY:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Green. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static GREEN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color GreenYellow. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static GREEN_YELLOW:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Honeydew. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static HONEYDEW:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color HotPink. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static HOT_PINK:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color IndianRed. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static INDIAN_RED:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Indigo. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static INDIGO:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Ivory. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static IVORY:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Khaki. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static KHAKI:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Lavender. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static LAVENDER:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color LavenderBlush. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static LAVENDER_BLUSH:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color LawnGreen. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static LAWN_GREEN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color LemonChiffon. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static LEMON_CHIFFON:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color LightBlue. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static LIGHT_BLUE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color LightCoral. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static LIGHT_CORAL:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color LightCyan. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static LIGHT_CYAN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color LightGoldenrodYellow. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static LIGHT_GOLDENROD_YELLOW:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color LightGray. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static LIGHT_GRAY:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color LightGreen. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static LIGHT_GREEN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color LightPink. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static LIGHT_PINK:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color LightSalmon. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static LIGHT_SALMON:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color LightSeaGreen. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static LIGHT_SEA_GREEN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color LightSkyBlue. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static LIGHT_SKY_BLUE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color LightSlateGray. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static LIGHT_SLATE_GRAY:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color LightSteelBlue. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static LIGHT_STEEL_BLUE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color LightYellow. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static LIGHT_YELLOW:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Lime. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static LIME:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color LimeGreen. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static LIME_GREEN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Linen. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static LINEN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Magenta. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static MAGENTA:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Maroon. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static MAROON:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color MediumAquamarine. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static MEDIUM_AQUAMARINE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color MediumBlue. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static MEDIUM_BLUE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color MediumOrchid. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static MEDIUM_ORCHID:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color MediumPurple. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static MEDIUM_PURPLE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color MediumSeaGreen. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static MEDIUM_SEA_GREEN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color MediumSlateBlue. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static MEDIUM_SLATE_BLUE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color MediumSpringGreen. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static MEDIUM_SPRING_GREEN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color MediumTurquoise. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static MEDIUM_TURQUOISE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color MediumVioletRed. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static MEDIUM_VIOLET_RED:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color MidnightBlue. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static MIDNIGHT_BLUE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color MintCream. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static MINT_CREAM:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color MistyRose. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static MISTY_ROSE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Moccasin. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static MOCCASIN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color NavajoWhite. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static NAVAJO_WHITE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Navy. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static NAVY:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color OldLace. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static OLD_LACE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Olive. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static OLIVE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color OliveDrab. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static OLIVE_DRAB:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Orange. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static ORANGE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color OrangeRed. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static ORANGE_RED:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Orchid. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static ORCHID:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color PaleGoldenrod. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static PALE_GOLDENROD:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color PaleGreen. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static PALE_GREEN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color PaleTurquoise. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static PALE_TURQUOISE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color PaleVioletRed. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static PALE_VIOLET_RED:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color PapayaWhip. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static PAPAYA_WHIP:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color PeachPuff. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static PEACH_PUFF:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Peru. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static PERU:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Pink. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static PINK:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Plum. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static PLUM:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color PowderBlue. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static POWDER_BLUE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Purple. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static PURPLE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Red. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static RED:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color RosyBrown. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static ROSY_BROWN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color RoyalBlue. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static ROYAL_BLUE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color SaddleBrown. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static SADDLE_BROWN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Salmon. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static SALMON:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color SandyBrown. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static SANDY_BROWN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color SeaGreen. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static SEA_GREEN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color SeaShell. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static SEA_SHELL:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Sienna. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static SIENNA:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Silver. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static SILVER:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color SkyBlue. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static SKY_BLUE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color SlateBlue. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static SLATE_BLUE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color SlateGray. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static SLATE_GRAY:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Snow. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static SNOW:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color SpringGreen. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static SPRING_GREEN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color SteelBlue. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static STEEL_BLUE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Tan. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static TAN:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Teal. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static TEAL:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Thistle. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static THISTLE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Tomato. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static TOMATO:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Transparent. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static TRANSPARENT:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Turquoise. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static TURQUOISE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Violet. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static VIOLET:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Wheat. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static WHEAT:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color White. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static WHITE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color WhiteSmoke. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static WHITE_SMOKE:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color Yellow. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static YELLOW:yfiles.view.Fill; - /** - * Gets a {@link yfiles.view.SolidColorFill} for the color YellowGreen. - *

- * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. - *

- */ - static YELLOW_GREEN:yfiles.view.Fill; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.Fill; - } - /** - * Represents an ARGB (alpha, red, green, blue) encoded color object. - * @class - * @final - */ - export interface Color extends yfiles.lang.Object{} - export class Color { - /** - * Initializes a new instance of the {@link yfiles.view.Color} class. - * @param [a=255] The alpha value; 255 by default. - * @param [r=0] The red value; 0 by default. - * @param [g=0] The green value; 0 by default - * @param [b=0] The blue value; 0 by default. - */ - constructor(r?:number,g?:number,b?:number,a?:number); - /** - * Initializes a new instance of the {@link yfiles.view.Color} class. - * @param {Object} options The parameters to pass. - * @param [options.a=255] The alpha value; 255 by default. - * @param [options.r=0] The red value; 0 by default. - * @param [options.g=0] The green value; 0 by default - * @param [options.b=0] The blue value; 0 by default. - */ - constructor(options:{r?:number,g?:number,b?:number,a?:number}); - /** - * Creates a new color instance from ARGB values. - *

- * All values must be between 0 and 255. - *

- * @param a The alpha value. - * @param r The red value. - * @param g The green value. - * @param b The blue value. - * @returns A new color instance with the given values. - * @static - */ - static fromArgb(a:number,r:number,g:number,b:number):yfiles.view.Color; - /** - * Gets the value of the red component of the color. - *

- * The value is between 0 and 255. A higher value represents a higher part of the color is made up of this component. - *

- * @type {number} - */ - r:number; - /** - * Gets the value of the green component of the color. - *

- * The value is between 0 and 255. A higher value represents a higher part of the color is made up of this component. - *

- * @type {number} - */ - g:number; - /** - * Gets the value of the blue component of the color. - *

- * The value is between 0 and 255. A higher value represents a higher part of the color is made up of this component. - *

- * @type {number} - */ - b:number; - /** - * Gets the value of the alpha component of the color. - *

- * The value is between 0 and 255. If this component is 0, then the color will be transparent. - *

- * @type {number} - */ - a:number; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name AliceBlue. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static ALICE_BLUE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name AntiqueWhite. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static ANTIQUE_WHITE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Aqua. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static AQUA:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Aquamarine. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static AQUAMARINE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Azure. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static AZURE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Beige. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static BEIGE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Bisque. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static BISQUE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Black. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static BLACK:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name BlanchedAlmond. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static BLANCHED_ALMOND:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Blue. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static BLUE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name BlueViolet. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static BLUE_VIOLET:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Brown. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static BROWN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name BurlyWood. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static BURLY_WOOD:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name CadetBlue. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static CADET_BLUE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Chartreuse. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static CHARTREUSE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Chocolate. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static CHOCOLATE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Coral. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static CORAL:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name CornflowerBlue. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static CORNFLOWER_BLUE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Cornsilk. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static CORNSILK:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Crimson. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static CRIMSON:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Cyan. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static CYAN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name DarkBlue. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static DARK_BLUE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name DarkCyan. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static DARK_CYAN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name DarkGoldenrod. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static DARK_GOLDENROD:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name DarkGray. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static DARK_GRAY:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name DarkGreen. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static DARK_GREEN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name DarkKhaki. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static DARK_KHAKI:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name DarkMagenta. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static DARK_MAGENTA:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name DarkOliveGreen. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static DARK_OLIVE_GREEN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name DarkOrange. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static DARK_ORANGE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name DarkOrchid. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static DARK_ORCHID:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name DarkRed. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static DARK_RED:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name DarkSalmon. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static DARK_SALMON:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name DarkSeaGreen. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static DARK_SEA_GREEN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name DarkSlateBlue. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static DARK_SLATE_BLUE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name DarkSlateGray. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static DARK_SLATE_GRAY:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name DarkTurquoise. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static DARK_TURQUOISE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name DarkViolet. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static DARK_VIOLET:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name DeepPink. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static DEEP_PINK:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name DeepSkyBlue. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static DEEP_SKY_BLUE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name DimGray. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static DIM_GRAY:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name DodgerBlue. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static DODGER_BLUE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Firebrick. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static FIREBRICK:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name FloralWhite. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static FLORAL_WHITE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name ForestGreen. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static FOREST_GREEN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Fuchsia. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static FUCHSIA:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Gainsboro. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static GAINSBORO:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name GhostWhite. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static GHOST_WHITE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Gold. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static GOLD:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Goldenrod. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static GOLDENROD:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Gray. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static GRAY:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Green. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static GREEN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name GreenYellow. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static GREEN_YELLOW:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Honeydew. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static HONEYDEW:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name HotPink. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static HOT_PINK:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name IndianRed. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static INDIAN_RED:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Indigo. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static INDIGO:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Ivory. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static IVORY:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Khaki. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static KHAKI:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Lavender. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static LAVENDER:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name LavenderBlush. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static LAVENDER_BLUSH:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name LawnGreen. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static LAWN_GREEN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name LemonChiffon. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static LEMON_CHIFFON:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name LightBlue. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static LIGHT_BLUE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name LightCoral. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static LIGHT_CORAL:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name LightCyan. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static LIGHT_CYAN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name LightGoldenrodYellow. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static LIGHT_GOLDENROD_YELLOW:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name LightGray. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static LIGHT_GRAY:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name LightGreen. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static LIGHT_GREEN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name LightPink. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static LIGHT_PINK:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name LightSalmon. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static LIGHT_SALMON:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name LightSeaGreen. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static LIGHT_SEA_GREEN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name LightSkyBlue. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static LIGHT_SKY_BLUE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name LightSlateGray. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static LIGHT_SLATE_GRAY:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name LightSteelBlue. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static LIGHT_STEEL_BLUE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name LightYellow. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static LIGHT_YELLOW:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Lime. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static LIME:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name LimeGreen. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static LIME_GREEN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Linen. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static LINEN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Magenta. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static MAGENTA:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Maroon. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static MAROON:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name MediumAquamarine. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static MEDIUM_AQUAMARINE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name MediumBlue. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static MEDIUM_BLUE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name MediumOrchid. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static MEDIUM_ORCHID:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name MediumPurple. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static MEDIUM_PURPLE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name MediumSeaGreen. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static MEDIUM_SEA_GREEN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name MediumSlateBlue. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static MEDIUM_SLATE_BLUE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name MediumSpringGreen. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static MEDIUM_SPRING_GREEN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name MediumTurquoise. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static MEDIUM_TURQUOISE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name MediumVioletRed. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static MEDIUM_VIOLET_RED:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name MidnightBlue. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static MIDNIGHT_BLUE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name MintCream. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static MINT_CREAM:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name MistyRose. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static MISTY_ROSE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Moccasin. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static MOCCASIN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name NavajoWhite. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static NAVAJO_WHITE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Navy. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static NAVY:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name OldLace. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static OLD_LACE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Olive. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static OLIVE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name OliveDrab. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static OLIVE_DRAB:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Orange. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static ORANGE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name OrangeRed. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static ORANGE_RED:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Orchid. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static ORCHID:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name PaleGoldenrod. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static PALE_GOLDENROD:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name PaleGreen. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static PALE_GREEN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name PaleTurquoise. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static PALE_TURQUOISE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name PaleVioletRed. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static PALE_VIOLET_RED:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name PapayaWhip. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static PAPAYA_WHIP:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name PeachPuff. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static PEACH_PUFF:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Peru. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static PERU:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Pink. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static PINK:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Plum. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static PLUM:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name PowderBlue. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static POWDER_BLUE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Purple. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static PURPLE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Red. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static RED:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name RosyBrown. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static ROSY_BROWN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name RoyalBlue. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static ROYAL_BLUE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name SaddleBrown. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static SADDLE_BROWN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Salmon. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static SALMON:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name SandyBrown. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static SANDY_BROWN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name SeaGreen. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static SEA_GREEN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name SeaShell. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static SEA_SHELL:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Sienna. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static SIENNA:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Silver. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static SILVER:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name SkyBlue. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static SKY_BLUE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name SlateBlue. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static SLATE_BLUE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name SlateGray. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static SLATE_GRAY:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Snow. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static SNOW:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name SpringGreen. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static SPRING_GREEN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name SteelBlue. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static STEEL_BLUE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Tan. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static TAN:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Teal. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static TEAL:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Thistle. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static THISTLE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Tomato. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static TOMATO:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Transparent. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static TRANSPARENT:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Turquoise. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static TURQUOISE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Violet. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static VIOLET:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Wheat. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static WHEAT:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name White. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static WHITE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name WhiteSmoke. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static WHITE_SMOKE:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name Yellow. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static YELLOW:yfiles.view.Color; - /** - * Yields a new {@link yfiles.view.Color} for the wellknown name YellowGreen. - *

- * This method will yield the same value for every call because it is immutable. - *

- */ - static YELLOW_GREEN:yfiles.view.Color; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.Color; - } - /** - * - * @class - * @extends {yfiles.graphml.MarkupExtension} - */ - export interface ColorExtension extends yfiles.graphml.MarkupExtension{} - export class ColorExtension { - /** - * - * @param color - */ - constructor(color:yfiles.view.Color); - /** - * - */ - constructor(); - /** - * - * @type {string} - */ - value:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.ColorExtension; - } - /** - * Represents a cursor object. - * @class - */ - export interface Cursor extends yfiles.lang.Object{} - export class Cursor { - /** - * Initializes a new {@link yfiles.view.Cursor} instance using the provided url and an alternative. - * @param url The url should point to a file in the ".cur" format with a size of at most 32x32 pixels to ensure compatibility across - * browsers. - * @param alternative Cursors can be chained but the last alternative needs to be one of the predefined cursors. - */ - constructor(url:string,alternative:yfiles.view.Cursor); - /** - * Returns the CSS text representation for the cursor and its alternatives. - * @returns The CSS text representation for the cursor. - */ - getSystemCursor():string; - /** - * Gets the invisible cursor. - *

- * This corresponds to the none CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static NONE:yfiles.view.Cursor; - /** - * Gets the default cursor. - *

- * This corresponds to the default CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static DEFAULT:yfiles.view.Cursor; - /** - * Gets the cursor with a pointing hand, as used for example on a hyperlink. - *

- * This corresponds to the pointer CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static POINTER:yfiles.view.Cursor; - /** - * Gets the cursor that indicates that help is available for the object under the cursor. - *

- * This corresponds to the help CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static HELP:yfiles.view.Cursor; - /** - * Gets the cursor that indicates progress. - *

- * This corresponds to the progress CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static PROGRESS:yfiles.view.Cursor; - /** - * Gets the text selection cursor. - *

- * This corresponds to the text CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static TEXT:yfiles.view.Cursor; - /** - * Gets the wait cursor. - *

- * This corresponds to the wait CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static WAIT:yfiles.view.Cursor; - /** - * Gets the crosshair cursor. - *

- * This corresponds to the crosshair CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static CROSSHAIR:yfiles.view.Cursor; - /** - * Gets the move cursor. - *

- * This corresponds to the move CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static MOVE:yfiles.view.Cursor; - /** - * Gets a cursor that indicates that an edge at the east will be moved. - *

- * Depending on the browser this might just be a horizontal resize cursor. - *

- *

- * This corresponds to the e-resize CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static E_RESIZE:yfiles.view.Cursor; - /** - * Gets a cursor that indicates that an edge at the north will be moved. - *

- * Depending on the browser this might just be a vertical resize cursor. - *

- *

- * This corresponds to the n-resize CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static N_RESIZE:yfiles.view.Cursor; - /** - * Gets a cursor that indicates that edges at the north and east will be moved. - *

- * Depending on the browser this might just be the diagonal resize cursor for NE to SW resizes. - *

- *

- * This corresponds to the ne-resize CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static NE_RESIZE:yfiles.view.Cursor; - /** - * Gets a cursor that indicates that edges at the north and west will be moved. - *

- * Depending on the browser this might just be the diagonal resize cursor for NW to SE resizes. - *

- *

- * This corresponds to the nw-resize CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static NW_RESIZE:yfiles.view.Cursor; - /** - * Gets a cursor that indicates that the edge at the south will be moved. - *

- * Depending on the browser this might just be a vertical resize cursor. - *

- *

- * This corresponds to the s-resize CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static S_RESIZE:yfiles.view.Cursor; - /** - * Gets a cursor that indicates that edges at the south and east will be moved. - *

- * Depending on the browser this might just be the diagonal resize cursor for NW to SE resizes. - *

- *

- * This corresponds to the se-resize CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static SE_RESIZE:yfiles.view.Cursor; - /** - * Gets a cursor that indicates that edges at the south and west will be moved. - *

- * Depending on the browser this might just be the diagonal resize cursor for NE to SW resizes. - *

- *

- * This corresponds to the sw-resize CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static SW_RESIZE:yfiles.view.Cursor; - /** - * Gets a cursor that indicates that the edge at the west will be moved. - *

- * Depending on the browser this might just be a horizontal resize cursor. - *

- *

- * This corresponds to the w-resize CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static W_RESIZE:yfiles.view.Cursor; - /** - * Gets the vertical resize cursor. - *

- * This corresponds to the ns-resize CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static NS_RESIZE:yfiles.view.Cursor; - /** - * Gets the diagonal resize cursor for NW to SE resizes. - *

- * This corresponds to the nwse-resize CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static NWSE_RESIZE:yfiles.view.Cursor; - /** - * Gets the diagonal resize cursor for NE to SW resizes. - *

- * This corresponds to the nesw-resize CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static NESW_RESIZE:yfiles.view.Cursor; - /** - * Gets the horizontal resize cursor. - *

- * This corresponds to the ew-resize CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static EW_RESIZE:yfiles.view.Cursor; - /** - * Gets the cursor for resizing columns. - *

- * This corresponds to the col-resize CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static COL_RESIZE:yfiles.view.Cursor; - /** - * Gets the cursor for resizing rows. - *

- * This corresponds to the row-resize CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static ROW_RESIZE:yfiles.view.Cursor; - /** - * Gets the cursor where the browser determines the actual cursor to be displayed. - *

- * This corresponds to the auto CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static AUTO:yfiles.view.Cursor; - /** - * Gets the cursor to indicate that there is a context menu available. - *

- * This corresponds to the context-menu CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static CONTEXT_MENU:yfiles.view.Cursor; - /** - * Gets the cursor to indicate selection of a table cell.. - *

- * This corresponds to the cell CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static CELL:yfiles.view.Cursor; - /** - * Gets the vertical text selection cursor. - *

- * This corresponds to the vertical-text CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static VERTICAL_TEXT:yfiles.view.Cursor; - /** - * Gets the cursor to be shown when an alias or shortcut can be created. - *

- * This corresponds to the alias CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static ALIAS:yfiles.view.Cursor; - /** - * Gets the cursor to be shown when something can be copied (often used for drag & drop). - *

- * This corresponds to the copy CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static COPY:yfiles.view.Cursor; - /** - * Gets the cursor to be shown where nothing can be dropped in a drag & drop operation. - *

- * This corresponds to the no-drop CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static NO_DROP:yfiles.view.Cursor; - /** - * Gets the cursor to be shown when an action cannot be done. - *

- * This corresponds to the not-allowed CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static NOT_ALLOWED:yfiles.view.Cursor; - /** - * Gets the cursor indicating that something can be scrolled or panned. - *

- * This corresponds to the all-scroll CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static ALL_SCROLL:yfiles.view.Cursor; - /** - * Gets the cursor for zooming in. - *

- * This corresponds to the zoom-in CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static ZOOM_IN:yfiles.view.Cursor; - /** - * Gets the cursor for zooming out. - *

- * This corresponds to the zoom-out CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static ZOOM_OUT:yfiles.view.Cursor; - /** - * Gets the cursor indicating that something can be grabbed (usually in conjunction with {@link yfiles.view.Cursor#GRABBING}). - *

- * This corresponds to the grab CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static GRAB:yfiles.view.Cursor; - /** - * Gets the cursor indicating that something is currently being grabbed (usually in conjunction with {@link yfiles.view.Cursor#GRAB}). - *

- * This corresponds to the grabbing CSS cursor. This is how it appears in your browser (hover to see): - *

- */ - static GRABBING:yfiles.view.Cursor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.Cursor; - } - /** - * A container for {@link yfiles.view.DashStyle#dashes} and an {@link yfiles.view.DashStyle#offset}. - *

- * All of these values are in terms of multiples of the the thickness of a - * {@link yfiles.view.Stroke}. This is different from the corresponding properties of a SVG stroke. - *

- * @class - */ - export interface DashStyle extends yfiles.lang.Object{} - export class DashStyle { - /** - * Initializes a new instance of the {@link yfiles.view.DashStyle} class using the provided dashes and offset. - * @param dashes The dashes. - * @param offset The offset. - */ - constructor(dashes:number[],offset:number); - /** - * Initializes a new instance of the {@link yfiles.view.DashStyle} class using an empty {@link yfiles.view.DashStyle#dashes} and zero {@link yfiles.view.DashStyle#offset}. - */ - constructor(); - /** - * Clones this instance by returning a {@link any#memberwiseClone} or this in case this instance is already {@link yfiles.view.DashStyle#isFrozen frozen}. - * @returns An instance of the same type as this instance. - */ - clone():any; - /** - * Freezes this instance. - *

- * Freezing an object makes it immutable, which can result in performance enhancements. - *

- */ - freeze():void; - /** - * Determines if this instance is frozen. - * @returns - */ - isFrozen():boolean; - /** - * Gets or sets the dashes. - * @type {yfiles.collections.List.} - */ - dashes:yfiles.collections.List; - /** - * Gets or sets the offset. - * @type {number} - */ - offset:number; - /** - * Gets the dash style with a single dash. - *

- * This style is designed for dash caps that extend into the 'gaps' like {@link yfiles.view.LineCap#SQUARE} and - * {@link yfiles.view.LineCap#ROUND}. A pen with this style doesn't look as expected if its dash cap is {@link yfiles.view.LineCap#FLAT}. - * Since {@link yfiles.view.LineCap#FLAT} is the default value, you should explicitly set another value. - *

- */ - static DASH:yfiles.view.DashStyle; - /** - * Gets the dash style with a single dash and dot. - *

- * This style is designed for dash caps that extend into the 'gaps' like {@link yfiles.view.LineCap#SQUARE} and - * {@link yfiles.view.LineCap#ROUND}. A pen with this style doesn't contain visible dots if its dash cap is - * {@link yfiles.view.LineCap#FLAT}. Since {@link yfiles.view.LineCap#FLAT} is the default value, you should explicitly set another value. - *

- */ - static DASH_DOT:yfiles.view.DashStyle; - /** - * Gets the dash style with a single dash and two dots. - *

- * This style is designed for dash caps that extend into the 'gaps' like {@link yfiles.view.LineCap#SQUARE} and - * {@link yfiles.view.LineCap#ROUND}. A pen with this style doesn't contain visible dots if its dash cap is - * {@link yfiles.view.LineCap#FLAT}. Since {@link yfiles.view.LineCap#FLAT} is the default value, you should explicitly set another value. - *

- */ - static DASH_DOT_DOT:yfiles.view.DashStyle; - /** - * Gets the dash style with a single dot. - *

- * This style is designed for dash caps that extend into the 'gaps' like {@link yfiles.view.LineCap#SQUARE} and - * {@link yfiles.view.LineCap#ROUND}. A pen with this style doesn't contain visible dots if its dash cap is - * {@link yfiles.view.LineCap#FLAT}. Since {@link yfiles.view.LineCap#FLAT} is the default value, you should explicitly set another value. - *

- */ - static DOT:yfiles.view.DashStyle; - /** - * Gets the solid dash style with no dashes. - */ - static SOLID:yfiles.view.DashStyle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.DashStyle; - } - /** - * Template factory for creating visual representations of rectangular shaped objects. - *

- * Implementations of this class have the purpose of creating a {@link yfiles.view.SvgVisual} that serves as the visual - * representation of the object associated with this instance. This special-purpose interface is only used in some places - * where the user interface can be customized. The {@link yfiles.view.IVisualCreator} interface is the main interface used by the - * {@link yfiles.view.CanvasComponent}. - *

- * @interface - */ - export interface IVisualTemplate extends yfiles.lang.Object{ - /** - * This method is called by the framework to create a {@link yfiles.view.SvgVisual} with the given bounds. - *

- * {@link yfiles.view.CanvasComponent} uses this interface through the {@link yfiles.view.ICanvasObjectDescriptor} to populate the visual - * canvas object tree. - *

- * @param context The context that describes where the visual will be used. - * @param bounds The initial bounds to use for the visual. - * @param dataObject The data object to visualize. - * @returns The visual to include in the canvas object visual tree. This may be null. - * @see yfiles.view.IVisualTemplate#updateVisual - * @abstract - */ - createVisual(context:yfiles.view.IRenderContext,bounds:yfiles.geometry.Rect,dataObject:any):yfiles.view.SvgVisual; - /** - * This method updates or replaces a previously created {@link yfiles.view.SvgVisual} for inclusion in the - * {@link yfiles.view.IRenderContext}. - *

- * The {@link yfiles.view.CanvasComponent} uses this method to give implementations a chance to update an existing Visual that has - * previously been created by the same instance during a call to {@link yfiles.view.IVisualTemplate#createVisual}. Implementation - * may update the oldVisual and return that same reference, or create a new visual and return the new instance or null. - *

- * @param context The context that describes where the visual will be used in. - * @param oldVisual The visual instance that had been returned the last time the {@link #createVisual} method was called - * on this instance. - * @param bounds The initial bounds to use for the visual. - * @param dataObject The data object to visualize. - * @returns oldVisual, if this instance modified the visual, or a new visual that should replace the existing one in the canvas - * object visual tree. - * @abstract - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.SvgVisual,bounds:yfiles.geometry.Rect,dataObject:any):yfiles.view.SvgVisual; - } - var IVisualTemplate:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.view.IVisualTemplate; - }; - /** - * The default implementation of a data object for the {@link yfiles.input.DropInputMode}. - * @class - * @final - */ - export interface DragDropItem extends yfiles.lang.Object{} - export class DragDropItem { - /** - * Initializes a new instance of the {@link yfiles.view.DragDropItem} class and sets the provided data item for the specified - * format. - * @param [format=null] The format. - * @param [data=null] The data item. - * @see yfiles.view.DragDropItem#setData - */ - constructor(format?:string,data?:any); - /** - * Initializes a new instance of the {@link yfiles.view.DragDropItem} class and sets the provided data item for the specified - * format. - * @param {Object} options The parameters to pass. - * @param [options.format=null] The format. - * @param [options.data=null] The data item. - * @see yfiles.view.DragDropItem#setData - */ - constructor(options:{format?:string,data?:Object}); - /** - * Gets the data item for the given format. - * @param format The format. - * @returns The data item that is stored for this format, or null if no such item exists. - * @see yfiles.view.DragDropItem#setData - */ - getData(format:string):any; - /** - * Sets the data item for the given format. - * @param format The format. - * @param data The data item. - * @see yfiles.view.DragDropItem#getData - */ - setData(format:string,data:any):void; - /** - * Gets the types of the data items stored in this instance. - * @type {Array.} - */ - types:string[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.DragDropItem; - } - export enum DragDropEffects{ - /** - * Indicates that the drop target cannot be used for dropping the data. - */ - NONE, - /** - * Indicates that the data can be copied to the drop target. - */ - COPY, - /** - * Indicates that the data can be moved to the drop target. - */ - MOVE, - /** - * Indicates that the data can be linked to the drop target. - */ - LINK, - /** - * Indicates that the data can be copied or linked to the drop target. - */ - COPY_LINK, - /** - * Indicates that the data can be linked or copied to the drop target. - */ - LINK_MOVE, - /** - * Indicates that the data can be copied or moved to the drop target. - */ - COPY_MOVE, - /** - * Indicates that the value is uninitialized. - */ - UNINITIALIZED, - /** - * A combination of all of the flags. - */ - ALL - } - /** - * The event argument that will be used by {@link yfiles.view.DropTarget} to notify handlers of the various events during a drag - * and drop operation. - * @class - * @extends {yfiles.lang.EventArgs} - */ - export interface DragEventArgs extends yfiles.lang.EventArgs{} - export class DragEventArgs { - /** - * Gets the position of the current drag operation in the coordinates system of the provided element. - * @param element The element for which the coordinates should be used. - * @returns The position in the coordinates system of element - */ - getPosition(element:HTMLElement):yfiles.geometry.Point; - /** - * Gets or sets the effects that the current handler can realize. - *

- * Setting this value will automatically mark this instance as {@link yfiles.view.DragEventArgs#handled}. - *

- * @type {yfiles.view.DragDropEffects} - */ - dropEffect:yfiles.view.DragDropEffects; - /** - * Gets the key states relevant during the drag and drop operation. - * @type {yfiles.view.DragDropKeyStates} - */ - keyStates:yfiles.view.DragDropKeyStates; - /** - * Gets the data that is associated with the drag. - * @see yfiles.view.DragSource#startDrag - * @type {yfiles.view.DragDropItem} - */ - item:yfiles.view.DragDropItem; - /** - * Gets the allowed effects for the current drag operation as specified by the {@link yfiles.view.DragSource}. - * @type {yfiles.view.DragDropEffects} - */ - effectAllowed:yfiles.view.DragDropEffects; - /** - * Gets or sets a value indicating whether this {@link yfiles.view.DragEventArgs} has been handled. - *

- * This property needs to be adjusted by handlers to tell the engine that the event has been handled. - *

- * @type {boolean} - */ - handled:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.DragEventArgs; - } - export enum GradientSpreadMethod{ - /** - * The outside is filled with the terminal colors of the gradient. - */ - PAD, - /** - * The outside is filled by repeating the gradient but in alternating directions, until the area is filled. - */ - REFLECT, - /** - * The outside is filled by repeating the original gradient. - */ - REPEAT - } - /** - * Specifies the properties of a transition point of a gradient. - * @class - * @implements {yfiles.lang.ICloneable} - */ - export interface GradientStop extends yfiles.lang.Object,yfiles.lang.ICloneable{} - export class GradientStop { - /** - * Creates a new transition point of a gradient with the given rgba values and offset. - *

- * The rgba values must be between 0 and 255. - *

- * @param r The red value. - * @param g The green value. - * @param b The blue value. - * @param [a=255] The alpha value, 255 by default. - * @param [offset=0] The offset, 0 by default. - */ - constructor(r:number,g:number,b:number,a?:number,offset?:number); - /** - * Creates a new transition point of a gradient with the given rgba values and offset. - *

- * The rgba values must be between 0 and 255. - *

- * @param {Object} options The parameters to pass. - * @param options.r The red value. - * @param options.g The green value. - * @param options.b The blue value. - * @param [options.a=255] The alpha value, 255 by default. - * @param [options.offset=0] The offset, 0 by default. - */ - constructor(options:{r:number,g:number,b:number,a?:number,offset?:number}); - /** - * Creates a new transition point of a gradient with the given color and offset. - * @param [color=null] The stop's color. - * @param [offset=0] The offset. - */ - constructor(color?:yfiles.view.Color,offset?:number); - /** - * Creates a new transition point of a gradient with the given color and offset. - * @param {Object} options The parameters to pass. - * @param [options.color=null] The stop's color. - * @param [options.offset=0] The offset. - */ - constructor(options:{color?:yfiles.view.Color,offset?:number}); - /** - * Clones this instance by returning a {@link any#memberwiseClone} or this in case this instance is already {@link yfiles.view.GradientStop#isFrozen frozen}. - * @returns An instance of the same type as this instance. - */ - clone():any; - /** - * Freezes this instance. - *

- * Freezing an object makes it immutable, which can result in performance enhancements. - *

- */ - freeze():void; - /** - * Determines if this instance is frozen. - * @returns - */ - isFrozen():boolean; - /** - * Gets or sets the color of this transition point. - * @type {yfiles.view.Color} - */ - color:yfiles.view.Color; - /** - * Gets or sets the offset of this transition point. - * @type {number} - */ - offset:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.GradientStop; - } - /** - * Classes that implement this interface can be placed in the SVGs defs section by the {@link yfiles.view.SvgDefsManager}. - *

- * The {@link yfiles.view.SvgDefsManager} can then create and update an element that can be used with an SVG use element. The - * interface is also used to help the {@link yfiles.view.SvgDefsManager} to find unused elements that can be removed from the defs - * section. - *

- *

- * When an element is created using this interface, the {@link yfiles.view.SvgDefsManager} assigns an ID to it that is required to - * reference it through an SVG use element. The ID that was assigned to it can be queried using the {@link yfiles.view.ICanvasContext#getDefsId} - * method when the {@link yfiles.view.ISvgDefsCreator} object is passed in that was used to create the element. - *

- * @interface - */ - export interface ISvgDefsCreator extends yfiles.lang.Object{ - /** - * Checks if the specified node references the element represented by this object. - * @param context The current canvas context. - * @param node The SVG node. - * @param id The defs id that has been stored for this instance by the provided context. - * @returns true if node references the element represented by this instance. - * @abstract - */ - accept(context:yfiles.view.ICanvasContext,node:Node,id:string):boolean; - /** - * Creates the element that is put into the defs section of the SVG element. - * @param context The canvas context that can be used to register brushes etc. - * @returns An {@link } that can be put into the defs section of the SVG element. - * @abstract - */ - createDefsElement(context:yfiles.view.ICanvasContext):SVGElement; - /** - * Updates the defs element with the current gradient data. - * @param context - * @param oldElement - * @abstract - */ - updateDefsElement(context:yfiles.view.ICanvasContext,oldElement:SVGElement):void; - } - var ISvgDefsCreator:{ - /** - * Determine whether the given element has an attribute with the given name that references the id in the defs element. - * @param element The element to inspect - * @param attributeName The attribute to check - * @param defsId The id in the defs section - * @returns Whether the attribute is equal to "url(#{defsId})" - * @static - */ - isAttributeReference?(element:Element,attributeName:string,defsId:string):boolean; - /** - * Determines whether the specified element is an SVG use element that references the given id. - * @param element The element to inspect. - * @param defsId The id of the element in the defs section. - * @returns true if the specified element references the element; otherwise, false. - * @static - */ - isUseReference?(element:Node,defsId:string):boolean; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.view.ISvgDefsCreator; - }; - export enum ImageRenderingType{ - /** - * Indicates that the rendering engine should use a balanced setup with a slight preference of quality. - */ - AUTO, - /** - * Indicates that the rendering speed should be optimized. - */ - OPTIMIZE_SPEED, - /** - * Indicates that the rendering quality should be optimized. - */ - OPTIMIZE_QUALITY, - INHERIT - } - export enum Key{ - ESCAPE, - DELETE, - SHIFT, - CTRL, - ENTER, - SPACE, - NONE, - ALT, - PAGE_UP, - PAGE_DOWN, - INSERT, - BACK, - ADD, - SUBTRACT, - F1, - F2, - F3, - F4, - F5, - F6, - F7, - F8, - F9, - F10, - F11, - F12, - ARROW_LEFT, - ARROW_UP, - ARROW_RIGHT, - ARROW_DOWN, - D0, - D1, - D2, - D3, - D4, - D5, - D6, - D7, - D8, - D9, - A, - B, - C, - D, - E, - F, - G, - H, - I, - J, - K, - L, - M, - N, - O, - P, - Q, - R, - S, - T, - U, - V, - W, - X, - Y, - Z, - TAB, - PAUSE, - HOME, - END, - N0, - N1, - N2, - N3, - N4, - N5, - N6, - N7, - N8, - N9, - MULTIPLY, - CAPS, - DECIMAL, - DIVIDE, - SEMICOLON, - EQUAL, - COMMA, - DASH, - PERIOD, - ACCENT, - OPEN_BRACKET, - BACK_SLASH, - CLOSE_BRACKET, - SINGLE_QUOTE - } - export enum KeyEventType{ - /** - * Neither Pressed, nor Typed, nor Released. - */ - NONE, - /** - * The key has been pressed. - */ - PRESSED, - /** - * The character has been typed. - */ - TYPED, - /** - * The key has been released. - */ - RELEASED - } - /** - * A wrapper for the native keyboard event which abstracts away incompatibilities in browser implementations. - * @class - * @extends {yfiles.lang.EventArgs} - */ - export interface KeyEventArgs extends yfiles.lang.EventArgs{} - export class KeyEventArgs { - /** - * Creates a new instance of this class from a native keyboard event. - * @param evt The native keyboard event. - * @param isPrintable if set to true [is printable]. - * @param type The type of the event. - */ - constructor(evt:KeyboardEvent,isPrintable:boolean,type:yfiles.view.KeyEventType); - /** - * Sets this event's {@link yfiles.view.KeyEventArgs#defaultPrevented} property to true signalling that the event has been properly handled and any default behaviors should - * be prevented. - *

- * This will call the corresponding method on the {@link yfiles.view.KeyEventArgs#originalEvent original native event}. - *

- * @see yfiles.view.KeyEventArgs#defaultPrevented - */ - preventDefault():void; - /** - * Gets the original DOM event associated with this event. - * @type {Event} - */ - originalEvent:Event; - /** - * Gets the original source. - * @type {Node} - */ - originalSource:Node; - /** - * Gets the type of the event. - * @type {yfiles.view.KeyEventType} - */ - eventType:yfiles.view.KeyEventType; - /** - * Gets the key. - * @type {yfiles.view.Key} - */ - key:yfiles.view.Key; - /** - * Gets the charcode of the original event, if the original event was a key press. - *

- * Otherwise returns 0. - *

- * @type {number} - */ - charCode:number; - /** - * Gets the modifiers. - * @type {yfiles.view.ModifierKeys} - */ - modifiers:yfiles.view.ModifierKeys; - /** - * Gets a value indicating whether the alt modifier is pressed. - * @type {boolean} - */ - alt:boolean; - /** - * Gets a value indicating whether the shift modifier is pressed. - * @type {boolean} - */ - shift:boolean; - /** - * Gets a value indicating whether the control modifier is pressed. - * @type {boolean} - */ - control:boolean; - /** - * Gets a value indicating whether the meta modifier is pressed. - * @type {boolean} - */ - meta:boolean; - /** - * Gets a value indicating whether the default behaviors for this event have been prevented by a previous call to - * {@link yfiles.view.KeyEventArgs#preventDefault}. - * @type {boolean} - */ - defaultPrevented:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.KeyEventArgs; - } - /** - * Fills an area with a linear gradient. - * @class - * @extends {yfiles.view.Fill} - * @implements {yfiles.view.ISvgDefsCreator} - */ - export interface LinearGradient extends yfiles.view.Fill,yfiles.view.ISvgDefsCreator{} - export class LinearGradient { - /** - * Initializes a new instance of the {@link yfiles.view.LinearGradient} class. - * @param {Object} [options=null] The parameters to pass. - * @param options.gradientStops An array of {@link }s. Each item will be added to the {@link #gradientStops} collection. - * @param {yfiles.geometry.Point} options.startPoint The start point of this gradient. - *

- * This option sets the {@link yfiles.view.LinearGradient#startPoint} property on the created object. - *

- * @param {yfiles.geometry.Point} options.endPoint The end point of this gradient. - *

- * This option sets the {@link yfiles.view.LinearGradient#endPoint} property on the created object. - *

- * @param {yfiles.view.GradientSpreadMethod} options.spreadMethod The spread method of this gradient. - *

- * This option sets the {@link yfiles.view.LinearGradient#spreadMethod} property on the created object. - *

- */ - constructor(options?:{startPoint?:yfiles.geometry.Point,endPoint?:yfiles.geometry.Point,spreadMethod?:yfiles.view.GradientSpreadMethod,gradientStops?:Array}); - /** - * - * @param context - * @param item - * @param id - * @returns - */ - accept(context:yfiles.view.ICanvasContext,item:Node,id:string):boolean; - /** - * Creates a new SVG gradient that corresponds to this gradient brush. - * @param context - * @returns A new SVG gradient that corresponds to this gradient brush - */ - createDefsElement(context:yfiles.view.ICanvasContext):SVGElement; - /** - * Creates a new SVG gradient that corresponds to this gradient brush. - * @returns A new SVG gradient that corresponds to this gradient brush - */ - toSvgGradient():SVGElement; - /** - * Updates the SVG gradient within the defs section of the SVG document if it has changed. - * @param context The context. - * @param oldElement The old element. - */ - updateDefsElement(context:yfiles.view.ICanvasContext,oldElement:SVGElement):void; - /** - * Updates the SVG gradient within the defs section of the SVG document if it has changed. - * @param oldElement The old element. - * @param context The context. - */ - updateSvgGradient(oldElement:SVGElement,context:yfiles.view.ICanvasContext):void; - /** - * Gets or sets the spread method of this gradient. - * @type {yfiles.view.GradientSpreadMethod} - */ - spreadMethod:yfiles.view.GradientSpreadMethod; - /** - * Gets or sets the start point of this gradient. - * @type {yfiles.geometry.Point} - */ - startPoint:yfiles.geometry.Point; - /** - * Gets or sets the end point of this gradient. - * @type {yfiles.geometry.Point} - */ - endPoint:yfiles.geometry.Point; - /** - * Gets or sets the gradient stops of this brush. - * @type {yfiles.collections.List.} - */ - gradientStops:yfiles.collections.List; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.LinearGradient; - } - export enum ModifierKeys{ - /** - * Indicates that no modifier key was pressed. - */ - NONE, - /** - * Indicates that the control key was pressed. - */ - CONTROL, - /** - * Indicates that the shift key was pressed. - */ - SHIFT, - /** - * Indicates that the alt key was pressed. - */ - ALT, - /** - * Indicates that the windows (or meta) key was pressed. - */ - WINDOWS - } - /** - * Fills an area with a SVG pattern. - * @class - * @extends {yfiles.view.Fill} - * @implements {yfiles.view.ISvgDefsCreator} - */ - export interface PatternFill extends yfiles.view.Fill,yfiles.view.ISvgDefsCreator{} - export class PatternFill { - /** - * Initializes a new instance of the {@link yfiles.view.PatternFill} class. - */ - constructor(); - /** - * - * @param context - * @param node - * @param id - * @returns - */ - accept(context:yfiles.view.ICanvasContext,node:Node,id:string):boolean; - /** - * - * @param context - * @returns - */ - createDefsElement(context:yfiles.view.ICanvasContext):SVGElement; - /** - * - * @param context - * @param oldElement - */ - updateDefsElement(context:yfiles.view.ICanvasContext,oldElement:SVGElement):void; - /** - * Gets or sets the content. - * @type {yfiles.view.SvgVisual} - */ - content:yfiles.view.SvgVisual; - /** - * Gets or sets the SVG view box of this pattern brush. - * @type {yfiles.geometry.Rect} - */ - viewBox:yfiles.geometry.Rect; - /** - * Gets or sets the origin of this pattern brush. - * @type {yfiles.geometry.Point} - */ - origin:yfiles.geometry.Point; - /** - * Gets or sets the size of this pattern brush. - * @type {yfiles.geometry.Size} - */ - size:yfiles.geometry.Size; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.PatternFill; - } - /** - * A utility class that holds all properties of a {@link yfiles.view.Stroke}. - * @class - * @implements {yfiles.lang.ICloneable} - * @final - */ - export interface Stroke extends yfiles.lang.Object,yfiles.lang.ICloneable{} - export class Stroke { - /** - * Initializes a new instance of the {@link yfiles.view.Stroke} class using the given rgba values and thickness. - *

- * The rgba values must be between 0 and 255. - *

- * @param r The red value. - * @param g The green value. - * @param b The blue value. - * @param [a=255] The alpha value, 255 by default. - * @param [thickness=1.0] The thickness, 1 by default. - */ - constructor(r:number,g:number,b:number,a?:number,thickness?:number); - /** - * Initializes a new instance of the {@link yfiles.view.Stroke} class using the given rgba values and thickness. - *

- * The rgba values must be between 0 and 255. - *

- * @param {Object} options The parameters to pass. - * @param options.r The red value. - * @param options.g The green value. - * @param options.b The blue value. - * @param [options.a=255] The alpha value, 255 by default. - * @param [options.thickness=1.0] The thickness, 1 by default. - * @param {yfiles.view.LineCap} options.lineCap The dash cap. - *

- * This option sets the {@link yfiles.view.Stroke#lineCap} property on the created object. - *

- * @param {yfiles.view.DashStyle} options.dashStyle The dash style for the {@link yfiles.view.Stroke}. - *

- * This option sets the {@link yfiles.view.Stroke#dashStyle} property on the created object. - *

- * @param {yfiles.view.LineJoin} options.lineJoin The line join property. - *

- * This option sets the {@link yfiles.view.Stroke#lineJoin} property on the created object. - *

- * @param {number} options.miterLimit The miter limit. - *

- * This option sets the {@link yfiles.view.Stroke#miterLimit} property on the created object. - *

- */ - constructor(options:{r:number,g:number,b:number,a?:number,thickness?:number,lineCap?:yfiles.view.LineCap,dashStyle?:yfiles.view.DashStyle,lineJoin?:yfiles.view.LineJoin,miterLimit?:number}); - /** - * Initializes a new instance of the {@link yfiles.view.Stroke} class using the given brush and thickness. - * @param [fill=null] The brush. - * @param [thickness=1.0] The thickness. - */ - constructor(fill?:yfiles.view.Fill,thickness?:number); - /** - * Initializes a new instance of the {@link yfiles.view.Stroke} class using the given brush and thickness. - * @param {Object} options The parameters to pass. - * @param [options.fill=null] The brush. - * @param [options.thickness=1.0] The thickness. - * @param {yfiles.view.LineCap} options.lineCap The dash cap. - *

- * This option sets the {@link yfiles.view.Stroke#lineCap} property on the created object. - *

- * @param {yfiles.view.DashStyle} options.dashStyle The dash style for the {@link yfiles.view.Stroke}. - *

- * This option sets the {@link yfiles.view.Stroke#dashStyle} property on the created object. - *

- * @param {yfiles.view.LineJoin} options.lineJoin The line join property. - *

- * This option sets the {@link yfiles.view.Stroke#lineJoin} property on the created object. - *

- * @param {number} options.miterLimit The miter limit. - *

- * This option sets the {@link yfiles.view.Stroke#miterLimit} property on the created object. - *

- */ - constructor(options:{fill?:yfiles.view.Fill,thickness?:number,lineCap?:yfiles.view.LineCap,dashStyle?:yfiles.view.DashStyle,lineJoin?:yfiles.view.LineJoin,miterLimit?:number}); - /** - * Assigns the stroke defined by this instance to the given element. - * @param element The element whose stroke should be set. - * @param context The context. - */ - applyTo(element:SVGElement,context:yfiles.view.ICanvasContext):void; - /** - * Clones this instance by returning a {@link any#memberwiseClone} or this in case this instance is already {@link yfiles.view.Stroke#isFrozen frozen}. - * @returns An instance of the same type as this instance. - */ - clone():any; - /** - * Clones the current value of this instance to a new unfrozen {@link yfiles.view.Stroke}. - * @returns - */ - cloneCurrentValue():yfiles.view.Stroke; - /** - * Freezes this instance. - *

- * Freezing an object makes it immutable, which can result in performance enhancements. - *

- */ - freeze():void; - /** - * Determines if this instance is frozen. - * @returns - */ - isFrozen():boolean; - /** - * Gets or sets the brush for the {@link yfiles.view.Stroke}. - * @default 'Black' - * @type {yfiles.view.Fill} - */ - fill:yfiles.view.Fill; - /** - * Gets or sets the dash cap. - * @default yfiles.view.LineCap.FLAT - * @type {yfiles.view.LineCap} - */ - lineCap:yfiles.view.LineCap; - /** - * Gets or sets the line join property. - * @default yfiles.view.LineJoin.MITER - * @type {yfiles.view.LineJoin} - */ - lineJoin:yfiles.view.LineJoin; - /** - * Gets or sets the dash style for the {@link yfiles.view.Stroke}. - *

- * The visual appearance of the 'dashes' and 'gaps' specified by this property depends on the value of the property {@link yfiles.view.Stroke#lineCap}, too. - *

- *

- * The predefined dash styles are designed for dash caps that extend into the 'gaps' like {@link yfiles.view.LineCap#SQUARE} and - * {@link yfiles.view.LineCap#ROUND}. With {@link yfiles.view.LineCap#FLAT}, the dashes might not look like expected, for example {@link yfiles.view.DashStyle#DOT} will not - * be visible at all. Since {@link yfiles.view.LineCap#FLAT} is the default value, you should explicitly set another value in this - * case. - *

- * @default 'Solid' - * @type {yfiles.view.DashStyle} - */ - dashStyle:yfiles.view.DashStyle; - /** - * Gets or sets the miter limit. - * @default 10.0 - * @type {number} - */ - miterLimit:number; - /** - * Gets or sets the thickness of the stroke. - * @default 1.0 - * @type {number} - */ - thickness:number; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#ALICE_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static ALICE_BLUE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#ANTIQUE_WHITE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static ANTIQUE_WHITE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#AQUA} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static AQUA:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#AQUAMARINE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static AQUAMARINE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#AZURE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static AZURE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#BEIGE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static BEIGE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#BISQUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static BISQUE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#BLACK} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static BLACK:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#BLANCHED_ALMOND} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static BLANCHED_ALMOND:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static BLUE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#BLUE_VIOLET} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static BLUE_VIOLET:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#BROWN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static BROWN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#BURLY_WOOD} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static BURLY_WOOD:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#CADET_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static CADET_BLUE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#CHARTREUSE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static CHARTREUSE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#CHOCOLATE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static CHOCOLATE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#CORAL} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static CORAL:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#CORNFLOWER_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static CORNFLOWER_BLUE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#CORNSILK} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static CORNSILK:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#CRIMSON} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static CRIMSON:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#CYAN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static CYAN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static DARK_BLUE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_CYAN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static DARK_CYAN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_GOLDENROD} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static DARK_GOLDENROD:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_GRAY} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static DARK_GRAY:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static DARK_GREEN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_KHAKI} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static DARK_KHAKI:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_MAGENTA} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static DARK_MAGENTA:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_OLIVE_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static DARK_OLIVE_GREEN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_ORANGE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static DARK_ORANGE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_ORCHID} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static DARK_ORCHID:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_RED} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static DARK_RED:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_SALMON} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static DARK_SALMON:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_SEA_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static DARK_SEA_GREEN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_SLATE_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static DARK_SLATE_BLUE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_SLATE_GRAY} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static DARK_SLATE_GRAY:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_TURQUOISE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static DARK_TURQUOISE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_VIOLET} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static DARK_VIOLET:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DEEP_PINK} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static DEEP_PINK:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DEEP_SKY_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static DEEP_SKY_BLUE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DIM_GRAY} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static DIM_GRAY:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DODGER_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static DODGER_BLUE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#FIREBRICK} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static FIREBRICK:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#FLORAL_WHITE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static FLORAL_WHITE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#FOREST_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static FOREST_GREEN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#FUCHSIA} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static FUCHSIA:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#GAINSBORO} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static GAINSBORO:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#GHOST_WHITE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static GHOST_WHITE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#GOLD} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static GOLD:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#GOLDENROD} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static GOLDENROD:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#GRAY} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static GRAY:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static GREEN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#GREEN_YELLOW} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static GREEN_YELLOW:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#HONEYDEW} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static HONEYDEW:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#HOT_PINK} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static HOT_PINK:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#INDIAN_RED} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static INDIAN_RED:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#INDIGO} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static INDIGO:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#IVORY} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static IVORY:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#KHAKI} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static KHAKI:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LAVENDER} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static LAVENDER:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LAVENDER_BLUSH} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static LAVENDER_BLUSH:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LAWN_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static LAWN_GREEN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LEMON_CHIFFON} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static LEMON_CHIFFON:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static LIGHT_BLUE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_CORAL} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static LIGHT_CORAL:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_CYAN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static LIGHT_CYAN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_GOLDENROD_YELLOW} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static LIGHT_GOLDENROD_YELLOW:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_GRAY} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static LIGHT_GRAY:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static LIGHT_GREEN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_PINK} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static LIGHT_PINK:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_SALMON} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static LIGHT_SALMON:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_SEA_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static LIGHT_SEA_GREEN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_SKY_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static LIGHT_SKY_BLUE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_SLATE_GRAY} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static LIGHT_SLATE_GRAY:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_STEEL_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static LIGHT_STEEL_BLUE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_YELLOW} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static LIGHT_YELLOW:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIME} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static LIME:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIME_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static LIME_GREEN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LINEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static LINEN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MAGENTA} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static MAGENTA:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MAROON} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static MAROON:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MEDIUM_AQUAMARINE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static MEDIUM_AQUAMARINE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MEDIUM_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static MEDIUM_BLUE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MEDIUM_ORCHID} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static MEDIUM_ORCHID:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MEDIUM_PURPLE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static MEDIUM_PURPLE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MEDIUM_SEA_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static MEDIUM_SEA_GREEN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MEDIUM_SLATE_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static MEDIUM_SLATE_BLUE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MEDIUM_SPRING_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static MEDIUM_SPRING_GREEN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MEDIUM_TURQUOISE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static MEDIUM_TURQUOISE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MEDIUM_VIOLET_RED} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static MEDIUM_VIOLET_RED:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MIDNIGHT_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static MIDNIGHT_BLUE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MINT_CREAM} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static MINT_CREAM:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MISTY_ROSE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static MISTY_ROSE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MOCCASIN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static MOCCASIN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#NAVAJO_WHITE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static NAVAJO_WHITE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#NAVY} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static NAVY:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#OLD_LACE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static OLD_LACE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#OLIVE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static OLIVE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#OLIVE_DRAB} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static OLIVE_DRAB:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#ORANGE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static ORANGE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#ORANGE_RED} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static ORANGE_RED:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#ORCHID} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static ORCHID:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#PALE_GOLDENROD} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static PALE_GOLDENROD:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#PALE_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static PALE_GREEN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#PALE_TURQUOISE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static PALE_TURQUOISE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#PALE_VIOLET_RED} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static PALE_VIOLET_RED:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#PAPAYA_WHIP} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static PAPAYA_WHIP:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#PEACH_PUFF} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static PEACH_PUFF:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#PERU} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static PERU:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#PINK} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static PINK:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#PLUM} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static PLUM:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#POWDER_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static POWDER_BLUE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#PURPLE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static PURPLE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#RED} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static RED:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#ROSY_BROWN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static ROSY_BROWN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#ROYAL_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static ROYAL_BLUE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SADDLE_BROWN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static SADDLE_BROWN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SALMON} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static SALMON:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SANDY_BROWN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static SANDY_BROWN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SEA_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static SEA_GREEN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SEA_SHELL} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static SEA_SHELL:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SIENNA} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static SIENNA:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SILVER} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static SILVER:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SKY_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static SKY_BLUE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SLATE_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static SLATE_BLUE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SLATE_GRAY} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static SLATE_GRAY:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SNOW} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static SNOW:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SPRING_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static SPRING_GREEN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#STEEL_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static STEEL_BLUE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#TAN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static TAN:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#TEAL} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static TEAL:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#THISTLE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static THISTLE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#TOMATO} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static TOMATO:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#TRANSPARENT} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static TRANSPARENT:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#TURQUOISE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static TURQUOISE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#VIOLET} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static VIOLET:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#WHEAT} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static WHEAT:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#WHITE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static WHITE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#WHITE_SMOKE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static WHITE_SMOKE:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#YELLOW} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static YELLOW:yfiles.view.Stroke; - /** - * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#YELLOW_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. - */ - static YELLOW_GREEN:yfiles.view.Stroke; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.Stroke; - } - export enum LineCap{ - /** - * Indicates that the line cap of a {@link yfiles.view.Stroke} should be squared. - */ - SQUARE, - /** - * Indicates that the line cap of a {@link yfiles.view.Stroke} should be flat. - */ - FLAT, - /** - * Indicates that the line cap of a {@link yfiles.view.Stroke} should be a semicircle. - */ - ROUND - } - export enum LineJoin{ - /** - * Indicates that the line joins of a {@link yfiles.view.Stroke} should be beveled. - */ - BEVEL, - /** - * Indicates that the line joins of a {@link yfiles.view.Stroke} should be rounded. - */ - ROUND, - /** - * Indicates that the line joins of a {@link yfiles.view.Stroke} should be sharp. - */ - MITER - } - /** - * Fills an area with a radial gradient. - * @class - * @extends {yfiles.view.Fill} - * @implements {yfiles.view.ISvgDefsCreator} - */ - export interface RadialGradient extends yfiles.view.Fill,yfiles.view.ISvgDefsCreator{} - export class RadialGradient { - /** - * Initializes a new instance of the {@link yfiles.view.RadialGradient} class. - * @param {Object} [options=null] The parameters to pass. - * @param options.gradientStops An array of {@link }s. Each item will be added to the {@link #gradientStops} collection. - * @param {yfiles.geometry.Point} options.center The center of this radial gradient. - *

- * This option sets the {@link yfiles.view.RadialGradient#center} property on the created object. - *

- * @param {number} options.radiusX The radius of the largest circle of this radial gradient in horizontal direction. - *

- * This option sets the {@link yfiles.view.RadialGradient#radiusX} property on the created object. - *

- * @param {number} options.radiusY The radius of the largest circle of this radial gradient in vertical direction. - *

- * This option sets the {@link yfiles.view.RadialGradient#radiusY} property on the created object. - *

- * @param {yfiles.view.GradientSpreadMethod} options.spreadMethod The spread method of this gradient. - *

- * This option sets the {@link yfiles.view.RadialGradient#spreadMethod} property on the created object. - *

- * @param {yfiles.geometry.Point} options.gradientOrigin The origin of this radial gradient. - *

- * This option sets the {@link yfiles.view.RadialGradient#gradientOrigin} property on the created object. - *

- */ - constructor(options?:{center?:yfiles.geometry.Point,radiusX?:number,radiusY?:number,spreadMethod?:yfiles.view.GradientSpreadMethod,gradientOrigin?:yfiles.geometry.Point,gradientStops?:Array}); - /** - * - * @param context - * @param item - * @param id - * @returns - */ - accept(context:yfiles.view.ICanvasContext,item:Node,id:string):boolean; - /** - * Creates a new SVG gradient that corresponds to this gradient brush. - * @param context - * @returns A new SVG gradient that corresponds to this gradient brush - */ - createDefsElement(context:yfiles.view.ICanvasContext):SVGElement; - /** - * Creates a new SVG gradient that corresponds to this gradient brush. - * @returns A new SVG gradient that corresponds to this gradient brush - */ - toSvgGradient():SVGElement; - /** - * Updates the SVG gradient within the defs section of the SVG document if it has changed. - * @param context The context. - * @param oldElement The old element. - */ - updateDefsElement(context:yfiles.view.ICanvasContext,oldElement:SVGElement):void; - /** - * Updates the SVG gradient within the defs section of the SVG document if it has changed. - * @param oldElement The old element. - * @param context The context. - */ - updateSvgGradient(oldElement:SVGElement,context:yfiles.view.ICanvasContext):void; - /** - * Gets or sets the center of this radial gradient. - * @type {yfiles.geometry.Point} - */ - center:yfiles.geometry.Point; - /** - * Gets or sets the origin of this radial gradient. - * @type {yfiles.geometry.Point} - */ - gradientOrigin:yfiles.geometry.Point; - /** - * Gets or sets the radius of the largest circle of this radial gradient in horizontal direction. - * @type {number} - */ - radiusX:number; - /** - * Gets or sets the radius of the largest circle of this radial gradient in vertical direction. - * @type {number} - */ - radiusY:number; - /** - * Gets or sets the spread method of this gradient. - * @type {yfiles.view.GradientSpreadMethod} - */ - spreadMethod:yfiles.view.GradientSpreadMethod; - /** - * Gets or sets the gradient stops of this brush. - * @type {yfiles.collections.List.} - */ - gradientStops:yfiles.collections.List; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.RadialGradient; - } - /** - * Base class for {@link yfiles.view.Visual}s that use HTML5's Canvas for the visualization. - *

- * Note that instances of this class cannot be used anywhere where a {@link yfiles.view.Visual} is required. The visualization is - * implemented by the {@link yfiles.view.HtmlCanvasVisual#paint} method. This means that this kind of visual does not work in a {@link yfiles.view.SvgVisualGroup} - * and wrapping the visual will not work as there is no {@link SVGElement} that could be put into another SVG container. These kind - * of visuals can be used at the top-level of a {@link yfiles.view.CanvasComponent}'s {@link yfiles.view.ICanvasObject}s, only. - *

- * @see yfiles.view.HtmlCanvasVisual#paint - * @class - * @extends {yfiles.view.Visual} - */ - export interface HtmlCanvasVisual extends yfiles.view.Visual{} - export class HtmlCanvasVisual { - constructor(); - /** - * Paints onto the context using HTML5 Canvas operations. - *

- * Implementations should not destroy the context's state, but should make sure to restore the state to the previously - * active state. This is especially true for the transformation and clip. - *

- * @param renderContext The render context of the {@link } - * @param ctx The HTML5 Canvas context to use for rendering. - * @abstract - */ - paint(renderContext:yfiles.view.IRenderContext,ctx:CanvasRenderingContext2D):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.HtmlCanvasVisual; - } - export enum ShapeRenderingType{ - /** - * Indicates that the rendering engine should use a balanced setup with a slight preference of geometric precision. - */ - AUTO, - /** - * Indicates that the rendering speed should be optimized. - */ - OPTIMIZE_SPEED, - /** - * Indicates that the rendering should be optimized for crisp edges. - */ - CRISP_EDGES, - /** - * Indicates that the rendering should be optimized for geometric precision. - */ - GEOMETRIC_PRECISION, - INHERIT - } - /** - * Fills an area with a specified solid color. - * @class - * @extends {yfiles.view.Fill} - */ - export interface SolidColorFill extends yfiles.view.Fill{} - export class SolidColorFill { - /** - * Initializes a new instance of the {@link yfiles.view.SolidColorFill} class with the specified rgba values. - *

- * All values must be between 0 and 255. - *

- * @param r The red value. - * @param g The green value. - * @param b The blue value. - * @param [a=255] The alpha value, 255 by default. - */ - constructor(r:number,g:number,b:number,a?:number); - /** - * Initializes a new instance of the {@link yfiles.view.SolidColorFill} class with the specified color. - * @param [color=null] The solid color with which the area is filled. - */ - constructor(color?:yfiles.view.Color); - /** - * Gets the solid color with which the area is filled. - * @type {yfiles.view.Color} - */ - color:yfiles.view.Color; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.SolidColorFill; - } - /** - * Wraps a {@link SVGElement} as {@link yfiles.view.Visual}. - * @class - * @extends {yfiles.view.Visual} - */ - export interface SvgVisual extends yfiles.view.Visual{} - export class SvgVisual { - /** - * Initializes a new instance of the {@link yfiles.view.SvgVisual} class which wraps the specified SVG element. - * @param element The SVG element which this object wraps. - */ - constructor(element:SVGElement); - /** - * Sets the transform to a scale transform using the given parameters. - *

- * This implementation uses caching and the baseVal property of the transform attribute if possible and thus performs - * better than using the plain DOM API. - *

- * @param transformable The SVG element that should be translated. - * @param scaleX The vertical scale. - * @param scaleY The horizontal scale. - * @static - */ - static setScale(transformable:Element,scaleX:number,scaleY:number):void; - /** - * Sets the transform to a translate transform using the given parameters. - *

- * This implementation uses caching and the baseVal property of the transform attribute if possible and thus performs - * better than using the plain DOM API. - *

- * @param transformable The SVG element that should be translated. - * @param dx The offset on the x-axis. - * @param dy The offset on the y-axis. - * @static - */ - static setTranslate(transformable:Element,dx:number,dy:number):void; - /** - * Gets or sets the SVG element that is wrapped by this object. - * @type {SVGElement} - */ - svgElement:SVGElement; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.SvgVisual; - } - export enum HorizontalTextAlignment{ - /** - * Indicates that the text should be centered. - */ - CENTER, - /** - * Indicates that the text should be aligned to the left. - */ - LEFT, - /** - * Indicates that the text should be aligned to the right. - */ - RIGHT - } - export enum TextDecoration{ - /** - * No Text Decoration - */ - NONE, - /** - * Underlined text - */ - UNDERLINE, - /** - * Overlined Text - */ - OVERLINE, - /** - * Text with line through - */ - LINE_THROUGH, - /** - * Blinking Text - */ - BLINK - } - export enum TextDecorations{ - /** - * No text decoration - */ - NONE, - /** - * Underlined text. - */ - UNDERLINE, - /** - * Overlined text. - */ - OVERLINE, - /** - * Crossed out text. - */ - STRIKETHROUGH - } - export enum TextWrapping{ - /** - * The text should not be trimmed. - */ - NONE, - /** - * The text could be wrapped and clipped after any character. - */ - CHARACTER, - /** - * The text could be wrapped and clipped after any character and an ellipsis is added to indicate clipped text. - */ - CHARACTER_ELLIPSIS, - /** - * The text could be wrapped and clipped at word boundaries. - */ - WORD, - /** - * The text could be wrapped and clipped at word boundaries and an ellipsis is added to indicate trimmed text. - */ - WORD_ELLIPSIS - } - /** - * Displays a string or any HTML element as tool tip. - * @class - */ - export interface ToolTip extends yfiles.lang.Object{} - export class ToolTip { - /** - * Creates a new instance. - *

- * This implementation calls {@link yfiles.view.ToolTip#createToolTip} to create the HTML element to display as tool tip. - *

- */ - constructor(); - /** - * Creates the {@link HTMLDivElement HTML element} in which the content is displayed. - *

- * This implementation creates a simple HTML div element with the CSS class yfiles-tooltip. - *

- * @returns A HTML div element. - * @protected - */ - createToolTip():HTMLDivElement; - /** - * Sets the content to the HTML element that is displayed as tool tip. - *

- * This implementation adds a string as innerHTML of the Div. A HTMLElement is added as child to the Div. - *

- *

- * Subclasses which intend to use a more complex element as tool tip have to override this method to set the content - * properly. - *

- * @param oldContent The content to remove. - * @param newContent The content to add. - * @protected - */ - onContentChanged(oldContent:any,newContent:any):void; - /** - * Gets the div element that represents this {@link yfiles.view.ToolTip}. - * @type {HTMLDivElement} - */ - div:HTMLDivElement; - /** - * Specifies whether the tool tip is visible. - * @type {boolean} - */ - isOpen:boolean; - /** - * The top position of the tool tip. - * @type {number} - */ - verticalOffset:number; - /** - * The left position of the tool tip. - * @type {number} - */ - horizontalOffset:number; - /** - * Gets or sets the desired size of this control. - * @type {yfiles.geometry.Size} - */ - desiredSize:yfiles.geometry.Size; - /** - * Gets or sets the content of this tooltip. - *

- * The content can be either a string or any HTML element. - *

- *

- * This setter invokes the method {@link yfiles.view.ToolTip#onContentChanged} if the content is changed. - *

- * @type {any} - */ - content:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.ToolTip; - } - /** - * Describes a font, with size, family, style, weight and line spacing. - * @class - */ - export interface Font extends yfiles.lang.Object{} - export class Font { - /** - * Initializes a new instance of the {@link yfiles.view.Font} class with size 10, "Arial" family, normal weight and style and line - * spacing 0.5, or the given values. - * @param [fontFamily=null] - * @param [fontSize=10] - * @param [fontStyle=null] - * @param [fontWeight=null] - * @param [lineSpacing=0.5] - * @param [textDecoration=null] - * @see yfiles.view.Font#createCopy - */ - constructor(fontFamily?:string,fontSize?:number,fontStyle?:yfiles.view.FontStyle,fontWeight?:yfiles.view.FontWeight,lineSpacing?:number,textDecoration?:yfiles.view.TextDecoration); - /** - * Initializes a new instance of the {@link yfiles.view.Font} class with size 10, "Arial" family, normal weight and style and line - * spacing 0.5, or the given values. - * @param {Object} options The parameters to pass. - * @param [options.fontFamily=null] - * @param [options.fontSize=10] - * @param [options.fontStyle=null] - * @param [options.fontWeight=null] - * @param [options.lineSpacing=0.5] - * @param [options.textDecoration=null] - * @see yfiles.view.Font#createCopy - */ - constructor(options:{fontFamily?:string,fontSize?:number,fontStyle?:yfiles.view.FontStyle,fontWeight?:yfiles.view.FontWeight,lineSpacing?:number,textDecoration?:yfiles.view.TextDecoration}); - /** - * Assigns the text properties of this instance to the given text element. - * @param textElement The text element to assign set the {@link } on. - */ - applyTo(textElement:SVGTextElement):void; - /** - * Creates a copy with the values of this instance or optionally the explicitly specified values. - * @param [fontFamily=null] The font family to use for the copy. - * @param [fontSize=-1] The font size to use for the copy. - * @param [fontStyle=null] The font style to use for the copy. - * @param [fontWeight=null] The font weight to use for the copy. - * @param [lineSpacing=-1] The line spacing to use for the copy. - * @param [textDecoration=null] The text decoration to use for the copy. - * @returns A new {@link } instance. - */ - createCopy(fontFamily?:string,fontSize?:number,fontStyle?:yfiles.view.FontStyle,fontWeight?:yfiles.view.FontWeight,lineSpacing?:number,textDecoration?:yfiles.view.TextDecoration):yfiles.view.Font; - /** - * Creates a copy with the values of this instance or optionally the explicitly specified values. - * @param {Object} options The parameters to pass. - * @param [options.fontFamily=null] The font family to use for the copy. - * @param [options.fontSize=-1] The font size to use for the copy. - * @param [options.fontStyle=null] The font style to use for the copy. - * @param [options.fontWeight=null] The font weight to use for the copy. - * @param [options.lineSpacing=-1] The line spacing to use for the copy. - * @param [options.textDecoration=null] The text decoration to use for the copy. - * @returns A new {@link } instance. - */ - createCopy(options:{fontFamily?:string,fontSize?:number,fontStyle?:yfiles.view.FontStyle,fontWeight?:yfiles.view.FontWeight,lineSpacing?:number,textDecoration?:yfiles.view.TextDecoration}):yfiles.view.Font; - /** - * Gets the size of the font. - *

- * The font size is interpreted as px. - *

- * @default 10 - * @type {number} - */ - fontSize:number; - /** - * Gets or sets the font family. - * @default 'Arial' - * @type {string} - */ - fontFamily:string; - /** - * Gets or sets the font style. - * @default yfiles.view.FontStyle.NORMAL - * @type {yfiles.view.FontStyle} - */ - fontStyle:yfiles.view.FontStyle; - /** - * Gets or sets the font weight. - * @default yfiles.view.FontWeight.NORMAL - * @type {yfiles.view.FontWeight} - */ - fontWeight:yfiles.view.FontWeight; - /** - * Gets or sets the line spacing. - *

- * The value is interpreted as parts of the line height. - *

- * @default 0.5 - * @type {number} - */ - lineSpacing:number; - /** - * Gets or sets the text decoration. - * @default yfiles.view.TextDecoration.NONE - * @type {yfiles.view.TextDecoration} - */ - textDecoration:yfiles.view.TextDecoration; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.Font; - } - export enum FontStyle{ - NORMAL, - ITALIC, - OBLIQUE, - INHERIT - } - export enum FontWeight{ - NORMAL, - BOLD, - BOLDER, - LIGHTER, - ITEM100, - ITEM200, - ITEM300, - ITEM400, - ITEM500, - ITEM600, - ITEM700, - ITEM800, - ITEM900, - INHERIT - } - export enum VerticalTextAlignment{ - /** - * Indicates that the object should be placed in the center of another object. - */ - CENTER, - /** - * Indicates that the object should be placed at the top of another object. - */ - TOP, - /** - * Indicates that the object should be placed at the bottom of another object. - */ - BOTTOM - } - /** - * Base class for all objects that support drawing in the context of a {@link yfiles.view.CanvasComponent}. - * @see yfiles.view.SvgVisual - * @see yfiles.view.HtmlCanvasVisual - * @class - */ - export interface Visual extends yfiles.lang.Object{} - export class Visual { - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.Visual; - } - export enum MouseEventTypes{ - /** - * Not a mouse event. - */ - NONE, - /** - * The mouse has been moved. - */ - MOVE, - /** - * The mouse has been dragged, which means it has been moved while at least one button has been pressed. - */ - DRAG, - /** - * A button has been pressed. - */ - DOWN, - /** - * A button has been released. - *

- * If there was no drag event since the last press event, this will result in a click. - *

- */ - UP, - /** - * The mouse has entered the control's bounds. - */ - ENTER, - /** - * The mouse has exited the control's bounds. - */ - LEAVE, - /** - * The mouse wheel has been turned. - */ - WHEEL, - /** - * A mouse click has been recognized. - *

- * This is the case if a press has directly been followed by a release. - *

- */ - CLICK, - /** - * Mouse input capture has been lost. - *

- * This can happen during mouse drags, if any button is pressed and the focus is taken from the application or transferred - * to another component by other means then moving the mouse. - *

- */ - LOST_CAPTURE - } - /** - * Complex event arguments that is used by the {@link yfiles.view.CanvasComponent} to indicate mouse events in world coordinates. - * @class - * @extends {yfiles.lang.EventArgs} - */ - export interface MouseEventArgs extends yfiles.lang.EventArgs{} - export class MouseEventArgs { - /** - * Constructs a new mouse event argument. - * @param eventType The type of the event - * @param location the position of the mouse in world coordinates at the time of the event - * @param [changedButtons=yfiles.view.MouseButtons.NONE] the mouse buttons that have changed state if the type of event is {@link #DOWN} or - * {@link #UP} - * @param [changedModifiers=yfiles.view.ModifierKeys.NONE] the modifier Keys that have been changed - * @param [buttons=yfiles.view.MouseButtons.NONE] the current state of the MouseButtons - * @param [modifiers=yfiles.view.ModifierKeys.NONE] the current state of the modifier Keys - * @param [clickCount=0] the number of clicks this event represents, 2 for a double click - * @param [mouseWheelDelta=0] the signed number of mouse wheel turn units - * @param [scrollAmount=0] The number of lines to scroll, if scrollType is {@link #LINES}. - * @param [scrollType=yfiles.view.MouseWheelDeltaMode.LINES] The type of scrolling performed. - * @param originalEvent - */ - constructor(originalEvent:Event,eventType:yfiles.view.MouseEventTypes,location:yfiles.geometry.Point,changedButtons?:yfiles.view.MouseButtons,changedModifiers?:yfiles.view.ModifierKeys,buttons?:yfiles.view.MouseButtons,modifiers?:yfiles.view.ModifierKeys,clickCount?:number,mouseWheelDelta?:number,scrollAmount?:number,scrollType?:yfiles.view.MouseWheelDeltaMode); - /** - * Constructs a new mouse event argument. - * @param {Object} options The parameters to pass. - * @param options.eventType The type of the event - * @param options.location the position of the mouse in world coordinates at the time of the event - * @param [options.changedButtons=yfiles.view.MouseButtons.NONE] the mouse buttons that have changed state if the type of event is {@link #DOWN} or - * {@link #UP} - * @param [options.changedModifiers=yfiles.view.ModifierKeys.NONE] the modifier Keys that have been changed - * @param [options.buttons=yfiles.view.MouseButtons.NONE] the current state of the MouseButtons - * @param [options.modifiers=yfiles.view.ModifierKeys.NONE] the current state of the modifier Keys - * @param [options.clickCount=0] the number of clicks this event represents, 2 for a double click - * @param [options.mouseWheelDelta=0] the signed number of mouse wheel turn units - * @param [options.scrollAmount=0] The number of lines to scroll, if scrollType is {@link #LINES}. - * @param [options.scrollType=yfiles.view.MouseWheelDeltaMode.LINES] The type of scrolling performed. - * @param options.originalEvent - */ - constructor(options:{originalEvent:Event,eventType:yfiles.view.MouseEventTypes,location:yfiles.geometry.Point,changedButtons?:yfiles.view.MouseButtons,changedModifiers?:yfiles.view.ModifierKeys,buttons?:yfiles.view.MouseButtons,modifiers?:yfiles.view.ModifierKeys,clickCount?:number,mouseWheelDelta?:number,scrollAmount?:number,scrollType?:yfiles.view.MouseWheelDeltaMode}); - /** - * Sets this event's {@link yfiles.view.MouseEventArgs#defaultPrevented} property to true signalling that the event has been properly handled and any default behaviors should - * be prevented. - *

- * This will call the corresponding method on the {@link yfiles.view.MouseEventArgs#originalEvent original native event}. - *

- * @see yfiles.view.MouseEventArgs#defaultPrevented - */ - preventDefault():void; - /** - * Gets the type of this event. - * @type {yfiles.view.MouseEventTypes} - */ - eventType:yfiles.view.MouseEventTypes; - /** - * Gets the coordinates in the world coordinate space associated with this event. - * @type {yfiles.geometry.Point} - */ - location:yfiles.geometry.Point; - /** - * Gets the number of clicks the current event represents if it is of type {@link yfiles.view.MouseEventTypes#CLICK}. - * @type {number} - */ - clickCount:number; - /** - * Gets the signed number of mouse wheel turn units. - *

- * Note that this can, for high-precision mouse wheels, include fractional turns. - *

- * @type {number} - */ - wheelDelta:number; - /** - * Gets the distance to scroll at once when {@link yfiles.view.MouseEventArgs#deltaMode} is {@link yfiles.view.MouseWheelDeltaMode#LINES}. - *

- * This is a system setting that only applies to scrolling (not zooming) and usually translates to the number of small - * scroll increments per scroll wheel notch. - *

- *

- * This property has a value of 1 if {@link yfiles.view.MouseEventArgs#deltaMode} is {@link yfiles.view.MouseWheelDeltaMode#PAGE}, as it is not applicable in that case. - *

- * @type {number} - */ - scrollAmount:number; - /** - * Gets the scrolling behavior. - *

- * This is a system setting that only applies to scrolling (not zooming) and can be either - * {@link yfiles.view.MouseWheelDeltaMode#LINES}, in which case {@link yfiles.view.MouseEventArgs#scrollAmount} will contain the number of "lines" to scroll with each scroll - * wheel notch, or {@link yfiles.view.MouseWheelDeltaMode#PAGE} in which case a single scroll wheel notch should scroll a "page" at - * a time. - *

- * @type {yfiles.view.MouseWheelDeltaMode} - */ - deltaMode:yfiles.view.MouseWheelDeltaMode; - /** - * Gets the modifier keys that have changed for this event. - * @see yfiles.view.MouseEventArgs#modifiers - * @type {yfiles.view.ModifierKeys} - */ - changedModifiers:yfiles.view.ModifierKeys; - /** - * Gets the mouse buttons that have changed for this event. - * @see yfiles.view.MouseEventArgs#buttons - * @type {yfiles.view.MouseButtons} - */ - changedButtons:yfiles.view.MouseButtons; - /** - * Gets the state of the modifier keys at the time of the event creation. - * @type {yfiles.view.ModifierKeys} - */ - modifiers:yfiles.view.ModifierKeys; - /** - * Gets the state of the mouse buttons at the time of the event creation. - * @type {yfiles.view.MouseButtons} - */ - buttons:yfiles.view.MouseButtons; - /** - * Gets the original DOM event associated with this event. - * @type {Event} - */ - originalEvent:Event; - /** - * Gets a value indicating whether the default behaviors for this event have been prevented by a previous call to - * {@link yfiles.view.MouseEventArgs#preventDefault}. - * @type {boolean} - */ - defaultPrevented:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.MouseEventArgs; - } - export enum MouseWheelDeltaMode{ - /** - * Scrolling should scroll a set number of lines per mouse wheel notch. - * @see yfiles.view.MouseEventArgs#scrollAmount - */ - LINES, - /** - * Scrolling should scroll a single "page" per mouse wheel notch. - */ - PAGE - } - export enum TouchEventTypes{ - /** - * Not a touch event. - */ - NONE, - /** - * A pointer has been moved. - */ - MOVE, - /** - * A touch device went down. - */ - DOWN, - /** - * A touch device went up. - */ - UP, - /** - * A touch device has entered the control's bounds. - */ - ENTER, - /** - * A touch device has exited the control's bounds. - */ - LEAVE, - /** - * A touch tap has been recognized. - *

- * This is the case if a down has directly been followed by an up. - *

- */ - TAP, - /** - * A long press has been recognized. - *

- * This is the case if a down has been held a certain amount of time without a move. - *

- */ - LONG_PRESS, - /** - * Touch capture has been lost while the device was down. or sent to the background or similar actions. - *

- * This can be the case if the application or control is minimized - *

- */ - LOST_CAPTURE - } - /** - * Complex event arguments that is used by the {@link yfiles.view.CanvasComponent} to indicate touch events in world coordinates. - * @class - * @extends {yfiles.lang.EventArgs} - */ - export interface TouchEventArgs extends yfiles.lang.EventArgs{} - export class TouchEventArgs { - /** - * Constructs a new touch event argument. - * @param eventType The type of the event - * @param location The position of the touch device in world coordinates at the time of the event - * @param device The device the event was triggered by - * @param originalEvent - */ - constructor(originalEvent:Event,eventType:yfiles.view.TouchEventTypes,location:yfiles.geometry.Point,device:yfiles.view.TouchDevice); - /** - * Constructs a new touch event argument. - * @param eventType The type of the event - * @param location The position of the touch device in world coordinates at the time of the event - * @param device The device the event was triggered by - * @param tapCount the number of taps this event represents, 2 for a double tap - * @param originalEvent - */ - constructor(originalEvent:Event,eventType:yfiles.view.TouchEventTypes,location:yfiles.geometry.Point,device:yfiles.view.TouchDevice,tapCount:number); - /** - * Sets this event's {@link yfiles.view.TouchEventArgs#defaultPrevented} property to true signalling that the event has been properly handled and any default behaviors should - * be prevented. - *

- * This will call the corresponding method on the {@link yfiles.view.TouchEventArgs#originalEvent original native event}. - *

- * @see yfiles.view.TouchEventArgs#defaultPrevented - */ - preventDefault():void; - /** - * Gets the type of this event. - * @type {yfiles.view.TouchEventTypes} - */ - eventType:yfiles.view.TouchEventTypes; - /** - * Returns the location represented by this event in world coordinates. - * @type {yfiles.geometry.Point} - */ - location:yfiles.geometry.Point; - /** - * Returns the touch device associated with this event. - * @type {yfiles.view.TouchDevice} - */ - device:yfiles.view.TouchDevice; - /** - * Returns the number of taps the current event represents if it is of type {@link yfiles.view.TouchEventTypes#TAP}. - * @type {number} - */ - tapCount:number; - /** - * Gets the original DOM event associated with this event. - * @type {Event} - */ - originalEvent:Event; - /** - * Gets a value indicating whether the default behaviors for this event have been prevented by a previous call to - * {@link yfiles.view.TouchEventArgs#preventDefault}. - * @type {boolean} - */ - defaultPrevented:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.TouchEventArgs; - } - /** - * The representation of a touch point on the screen. - * @class - */ - export interface TouchDevice extends yfiles.lang.Object{} - export class TouchDevice { - /** - * Gets the device's index - * @type {number} - */ - deviceIndex:number; - /** - * Gets a value indicating whether this device is the primary one. - *

- * If {@link yfiles.view.TouchDevice#deviceIndex} is 0 this property has the value true, otherwise false. - *

- * @type {boolean} - */ - isPrimaryDevice:boolean; - /** - * Gets the last device coordinate in the view coordinate system. - * @type {yfiles.geometry.Point} - */ - lastViewCoordinate:yfiles.geometry.Point; - /** - * Gets the time of the last {@link yfiles.view.TouchEventArgs event} that was raised by this device. - * @type {Date} - */ - lastEventTimeJS:Date; - /** - * Indicates if this device is currently down or not. - *

- * Default is true. - *

- * @type {boolean} - */ - isDown:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.TouchDevice; - } - /** - * The event argument class that is used by {@link yfiles.view.DragSource#addQueryContinueDragListener QueryContinueDrag} - * during drags to query the drag source whether the drag should be continued. - * @class - * @extends {yfiles.lang.EventArgs} - * @final - */ - export interface QueryContinueDragEventArgs extends yfiles.lang.EventArgs{} - export class QueryContinueDragEventArgs { - /** - * Gets or sets the action. - * @type {yfiles.view.DragAction} - */ - action:yfiles.view.DragAction; - /** - * Gets a value indicating whether the escape key had been pressed. - * @type {boolean} - */ - escapePressed:boolean; - /** - * Gets the current state of the keys. - * @type {yfiles.view.DragDropKeyStates} - */ - keyStates:yfiles.view.DragDropKeyStates; - /** - * Gets or sets a value indicating whether this {@link yfiles.view.QueryContinueDragEventArgs} is handled. - * @type {boolean} - */ - handled:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.QueryContinueDragEventArgs; - } - export enum DragAction{ - /** - * Whether the drag should be continued. - */ - CONTINUE, - /** - * Whether the drag should be finalized by an immediate drop. - */ - DROP, - /** - * Whether the drag operation should be canceled. - */ - CANCEL - } - /** - * Helper class for drag and drop support that is used for the source of drag and drop operations. - * @class - */ - export interface DragSource extends yfiles.lang.Object{} - export class DragSource { - /** - * Initializes a new instance of the {@link yfiles.view.DragSource} class setting the {@link yfiles.view.DragSource#source} property to the given element. - * @param source The source. - */ - constructor(source:HTMLElement); - /** - * Cleans up by removing the association with the {@link yfiles.view.DragSource#source} element. - */ - cleanUp():void; - /** - * Raises the {@link yfiles.view.DragSource#addQueryContinueDragListener QueryContinueDrag} event. - *

- * If the event is not {@link yfiles.view.QueryContinueDragEventArgs#handled handled}, a default logic will be applied: the drag operation is canceled if the left mouse button is - * released or escape has been pressed, otherwise the drag will be {@link yfiles.view.DragAction#CONTINUE continued}. - *

- * @param evt The {@link } instance containing the event data. - */ - onQueryContinueDrag(evt:yfiles.view.QueryContinueDragEventArgs):void; - /** - * Initiates a new drag operation using the provided drag data and effects. - *

- * If useCssCursors is enabled, the following CSS classes are assigned to elements hovered during a drag operation, - * depending on the allowed drag-drop operations for these elements: - *

- *
    - *
  • yfiles-cursor-dragdrop-move
  • - *
  • yfiles-cursor-dragdrop-link
  • - *
  • yfiles-cursor-dragdrop-all
  • - *
  • yfiles-cursor-dragdrop-no-drop
  • - *
- * @param dragData The data to use for the drag. - * @param [dragDropEffects=yfiles.view.DragDropEffects.ALL] The allowed effects. - * @param [useCssCursors=true] Whether to adjust the classes of elements being hovered over during the drag. The default is true. - */ - startDrag(dragData:yfiles.view.DragDropItem,dragDropEffects?:yfiles.view.DragDropEffects,useCssCursors?:boolean):void; - /** - * Initiates a new drag operation using the provided drag data and effects. - *

- * If useCssCursors is enabled, the following CSS classes are assigned to elements hovered during a drag operation, - * depending on the allowed drag-drop operations for these elements: - *

- *
    - *
  • yfiles-cursor-dragdrop-move
  • - *
  • yfiles-cursor-dragdrop-link
  • - *
  • yfiles-cursor-dragdrop-all
  • - *
  • yfiles-cursor-dragdrop-no-drop
  • - *
- * @param {Object} options The parameters to pass. - * @param options.dragData The data to use for the drag. - * @param [options.dragDropEffects=yfiles.view.DragDropEffects.ALL] The allowed effects. - * @param [options.useCssCursors=true] Whether to adjust the classes of elements being hovered over during the drag. The default is true. - */ - startDrag(options:{dragData:yfiles.view.DragDropItem,dragDropEffects?:yfiles.view.DragDropEffects,useCssCursors?:boolean}):void; - /** - * Adds the given listener for the QueryContinueDrag event that occurs when the state of the {@link yfiles.view.DragDropKeyStates} - * has changed to query the source whether the drag operation should be continued. - *

- * Handlers should adjust the {@link yfiles.view.QueryContinueDragEventArgs#handled} and {@link yfiles.view.QueryContinueDragEventArgs#action} properties accordingly. - *

- * @param listener The listener to add. - * @see yfiles.view.DragSource#removeQueryContinueDragListener - */ - addQueryContinueDragListener(listener:(sender:any,evt:yfiles.view.QueryContinueDragEventArgs)=>void):void; - /** - * Removes the given listener for the QueryContinueDrag event that occurs when the state of the {@link yfiles.view.DragDropKeyStates} - * has changed to query the source whether the drag operation should be continued. - *

- * Handlers should adjust the {@link yfiles.view.QueryContinueDragEventArgs#handled} and {@link yfiles.view.QueryContinueDragEventArgs#action} properties accordingly. - *

- * @param listener The listener to remove. - * @see yfiles.view.DragSource#addQueryContinueDragListener - */ - removeQueryContinueDragListener(listener:(sender:any,evt:yfiles.view.QueryContinueDragEventArgs)=>void):void; - /** - * Gets or sets the source element from which drags can originate. - *

- * If the {@link yfiles.view.DragSource#allowDrag} property is enabled, this will automatically register mouse event handlers on the element that will recognize - * default drag gestures (press followed by drag) to {@link yfiles.view.DragSource#startDrag initiate a drag and drop operation}. - *

- * @default null - * @type {HTMLElement} - */ - source:HTMLElement; - /** - * Gets or sets a value indicating whether default drag gestures should be automatically recognized on the {@link yfiles.view.DragSource#source}. - * @default false - * @type {boolean} - */ - allowDrag:boolean; - /** - * Gets or sets the data that will be used for the {@link yfiles.view.DragSource#allowDrag automatic drag operation}. - *

- * If this data is not a {@link yfiles.view.DragDropItem}, the expected format of the automatic drag operation will be code. - *

- * @default null - * @type {any} - */ - item:any; - /** - * Gets or sets the {@link yfiles.view.DragSource#effectAllowed} that will be used for the {@link yfiles.view.DragSource#allowDrag automatic drag operation}. - * @default yfiles.view.DragDropEffects.ALL - * @type {yfiles.view.DragDropEffects} - */ - effectAllowed:yfiles.view.DragDropEffects; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.DragSource; - } - /** - * Helper class that plays the role of the target during a drag and drop operation that is initiated using {@link yfiles.view.DragSource#startDrag} - * in a {@link yfiles.view.DragSource}. - * @class - */ - export interface DropTarget extends yfiles.lang.Object{} - export class DropTarget { - /** - * Initializes a new instance of the {@link yfiles.view.DropTarget} class. - *

- * In order to make the instance available to the drag and drop mechanisms, the {@link yfiles.view.DropTarget#setDropTarget} helper - * method should be used. If the optional element is passed in, it will automatically be registered. - *

- * @param [element=null] The element to optionally {@link #setDropTarget associate} with the new instance. - * @see yfiles.view.DropTarget#setDropTarget - * @see yfiles.view.DropTarget#getDropTarget - */ - constructor(element?:Element); - /** - * Gets the {@link yfiles.view.DropTarget} instance associated with the given element. - * @param element The element to get the drop target instance of. - * @returns The associated instance or null. - * @see yfiles.view.DropTarget#setDropTarget - * @static - */ - static getDropTarget(element:Element):yfiles.view.DropTarget; - /** - * Sets the drop target for the given element. - * @param element The element or null to register the drop target instance with. - * @param dropTarget The instance to attach to the element, null to remove the association from the element. - * @see yfiles.view.DropTarget#getDropTarget - * @static - */ - static setDropTarget(element:Element,dropTarget:yfiles.view.DropTarget):void; - /** - * Adds the given listener for the DragEnter event that occurs when a drag enters the drop target. - *

- * The handler may adjust the {@link yfiles.view.DragEventArgs#dropEffect} and call {@link yfiles.view.DragEventArgs#handled}. - *

- * @param listener The listener to add. - * @see yfiles.view.DropTarget#removeDragEnterListener - */ - addDragEnterListener(listener:(sender:any,evt:yfiles.view.DragEventArgs)=>void):void; - /** - * Removes the given listener for the DragEnter event that occurs when a drag enters the drop target. - *

- * The handler may adjust the {@link yfiles.view.DragEventArgs#dropEffect} and call {@link yfiles.view.DragEventArgs#handled}. - *

- * @param listener The listener to remove. - * @see yfiles.view.DropTarget#addDragEnterListener - */ - removeDragEnterListener(listener:(sender:any,evt:yfiles.view.DragEventArgs)=>void):void; - /** - * Adds the given listener for the DragLeave event that occurs when a drag leaves the drop target. - *

- * The handler may adjust the {@link yfiles.view.DragEventArgs#dropEffect} and call {@link yfiles.view.DragEventArgs#handled}. - *

- * @param listener The listener to add. - * @see yfiles.view.DropTarget#removeDragLeaveListener - */ - addDragLeaveListener(listener:(sender:any,evt:yfiles.view.DragEventArgs)=>void):void; - /** - * Removes the given listener for the DragLeave event that occurs when a drag leaves the drop target. - *

- * The handler may adjust the {@link yfiles.view.DragEventArgs#dropEffect} and call {@link yfiles.view.DragEventArgs#handled}. - *

- * @param listener The listener to remove. - * @see yfiles.view.DropTarget#addDragLeaveListener - */ - removeDragLeaveListener(listener:(sender:any,evt:yfiles.view.DragEventArgs)=>void):void; - /** - * Adds the given listener for the DragOver event that occurs when a drag is being performed over the drop target. - *

- * The handler may adjust the {@link yfiles.view.DragEventArgs#dropEffect} and call {@link yfiles.view.DragEventArgs#handled}. - *

- * @param listener The listener to add. - * @see yfiles.view.DropTarget#removeDragOverListener - */ - addDragOverListener(listener:(sender:any,evt:yfiles.view.DragEventArgs)=>void):void; - /** - * Removes the given listener for the DragOver event that occurs when a drag is being performed over the drop target. - *

- * The handler may adjust the {@link yfiles.view.DragEventArgs#dropEffect} and call {@link yfiles.view.DragEventArgs#handled}. - *

- * @param listener The listener to remove. - * @see yfiles.view.DropTarget#addDragOverListener - */ - removeDragOverListener(listener:(sender:any,evt:yfiles.view.DragEventArgs)=>void):void; - /** - * Adds the given listener for the Drop event that occurs when the drop operation is performed on the drop target. - *

- * The handler may adjust the {@link yfiles.view.DragEventArgs#dropEffect} and call {@link yfiles.view.DragEventArgs#handled}. - *

- * @param listener The listener to add. - * @see yfiles.view.DropTarget#removeDropListener - */ - addDropListener(listener:(sender:any,evt:yfiles.view.DragEventArgs)=>void):void; - /** - * Removes the given listener for the Drop event that occurs when the drop operation is performed on the drop target. - *

- * The handler may adjust the {@link yfiles.view.DragEventArgs#dropEffect} and call {@link yfiles.view.DragEventArgs#handled}. - *

- * @param listener The listener to remove. - * @see yfiles.view.DropTarget#addDropListener - */ - removeDropListener(listener:(sender:any,evt:yfiles.view.DragEventArgs)=>void):void; - /** - * Gets or sets a value indicating whether dropping to this target is currently allowed. - * @type {boolean} - */ - allowDrop:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.DropTarget; - } - /** - * An animation for the {@link yfiles.graph.IStripe stripes} in an {@link yfiles.graph.ITable}. - * @class - * @implements {yfiles.view.IAnimation} - */ - export interface TableAnimation extends yfiles.lang.Object,yfiles.view.IAnimation{} - export class TableAnimation { - /** - * Initializes a new instance of the {@link yfiles.view.TableAnimation} class for the given table, the column widths, and row - * heights. - *

- * Note that only the sizes of - * leaf stripes, i.e. those without child stripes, are considered. The sizes of a stripe with children is implicitly determined by its - * contents. - *

- * @param table The table to animate. - * @param columnLayout The sizes of the leaf columns, in natural order. - * @param rowLayout The sizes of the leaf rows, in natural order. - */ - constructor(table:yfiles.graph.ITable,columnLayout:number[],rowLayout:number[]); - /** - * - * @param time - */ - animate(time:number):void; - /** - * - */ - cleanup():void; - /** - * Create the animation for a single {@link yfiles.graph.IStripe} - * @param stripe The stripe - * @param targetSize The target size of the stripe - * @returns An animation that morphs the stripe size - * @protected - */ - createStripeAnimation(stripe:yfiles.graph.IStripe,targetSize:number):yfiles.view.IAnimation; - /** - * - */ - initialize():void; - /** - * Gets or sets the preferred duration of the animation. - * @type {yfiles.lang.TimeSpan} - */ - preferredDuration:yfiles.lang.TimeSpan; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.TableAnimation; - } - /** - * Manages the selection state of items in an {@link yfiles.graph.ITable} instance. - *

- * This interface provides access to the {@link yfiles.view.ISelectionModel.} instances that manage the selection of rows and columns. The generic methods that - * use {@link yfiles.graph.IModelItem} parameters delegate to the corresponding domain-specific selection models. - *

- * @see yfiles.view.ISelectionModel. - * @interface - * @implements {yfiles.view.ISelectionModel.} - */ - export interface IStripeSelection extends yfiles.lang.Object,yfiles.view.ISelectionModel{ - /** - * Gets an {@link yfiles.view.ISelectionModel.} of the selected rows. - *

- * This is the row part of the selection that this instance is a composite of. - *

- * @abstract - * @type {yfiles.view.ISelectionModel.} - */ - selectedRows:yfiles.view.ISelectionModel; - /** - * Gets an {@link yfiles.view.ISelectionModel.} of the selected columns. - *

- * This is the column part of the selection that this instance is a composite of. - *

- * @abstract - * @type {yfiles.view.ISelectionModel.} - */ - selectedColumns:yfiles.view.ISelectionModel; - /** - * Gets or sets whether to allow mixed row/column selections - * @abstract - * @type {boolean} - */ - allowMixedSelection:boolean; - /** - * Gets or sets whether to allow the selection to span multiple table instances - *

- * The default is false - *

- * @abstract - * @type {boolean} - */ - allowCrossTableSelection:boolean; - } - var IStripeSelection:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.view.IStripeSelection; - }; - /** - * Default implementation of the {@link yfiles.view.IStripeSelection} interface. - * @class - * @implements {yfiles.view.IStripeSelection} - */ - export interface StripeSelection extends yfiles.lang.Object,yfiles.view.IStripeSelection{} - export class StripeSelection { - /** - * Default constructor that creates empty selection models. - */ - constructor(); - /** - * - */ - clear():void; - /** - * - * @returns - */ - getEnumerator():yfiles.collections.IEnumerator; - /** - * Return whether stripe is currently selected - * @param stripe The stripe to test - * @returns true iff stripe is currently selected - */ - isSelected(stripe:yfiles.graph.IStripe):boolean; - /** - * Raises the {@link yfiles.view.StripeSelection#addItemSelectionChangedListener ItemSelectionChanged} event - * @param evt The parameters for the event - * @protected - */ - onItemSelectionChanged(evt:yfiles.view.ItemSelectionChangedEventArgs):void; - /** - * - * @param item - * @param selected - */ - setSelected(item:yfiles.graph.IStripe,selected:boolean):void; - /** - * Gets or sets whether to allow mixed row/column selections - *

- * The default is false - *

- * @type {boolean} - */ - allowMixedSelection:boolean; - /** - * Gets or sets whether to allow the selection to span multiple table instances - *

- * The default is true - *

- * @type {boolean} - */ - allowCrossTableSelection:boolean; - /** - * - * @type {yfiles.view.ISelectionModel.} - */ - selectedRows:yfiles.view.ISelectionModel; - /** - * - * @type {yfiles.view.ISelectionModel.} - */ - selectedColumns:yfiles.view.ISelectionModel; - /** - * - * @type {number} - */ - size:number; - /** - * - * @param listener - */ - addItemSelectionChangedListener(listener:(sender:any,evt:yfiles.view.ItemSelectionChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeItemSelectionChangedListener(listener:(sender:any,evt:yfiles.view.ItemSelectionChangedEventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.view.StripeSelection; - } - }export namespace input{ - export enum GridSnapTypes{ - /** - * There is no grid snapping at all. - */ - NONE, - /** - * Elements shall be snapped to horizontal grid lines. - */ - HORIZONTAL_LINES, - /** - * Elements shall be snapped to vertical grid lines. - */ - VERTICAL_LINES, - /** - * Elements shall be snapped to horizontal and vertical grid lines. - */ - LINES, - /** - * Elements shall be snapped to grid points. - */ - GRID_POINTS, - /** - * Elements shall be snapped to horizontal and vertical grid lines as well as to grid points. - */ - ALL - } - /** - * An interface that can enumerate hits of a given type for a certain position in world coordinates. - * Type parameter T: the type of hits returned by the enumerator - * @interface - * @template T - */ - export interface IHitTester extends yfiles.lang.Object{ - /** - * Yields an enumerable that enumerates the hits for a given world coordinate. - * @param context The context in which to perform the hit testing. - * @param location the coordinates in the world coordinate system - * @returns an enumerable that yields hits for the given coordinates - * @abstract - */ - enumerateHits(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):yfiles.collections.IEnumerable; - } - var IHitTester:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IHitTester; - }; - /** - * This is a flagging interface for instances of {@link yfiles.input.IHitTester.} that enumerate over a collection of {@link yfiles.graph.INode INodes}. - *

- * An implementation of this interface can be queried using the lookup of a {@link yfiles.view.GraphComponent} - *

- * @interface - * @implements {yfiles.input.IHitTester.} - */ - export interface INodeHitTester extends yfiles.lang.Object,yfiles.input.IHitTester{ - } - var INodeHitTester:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.INodeHitTester; - }; - /** - * This is a flagging interface for instances of {@link yfiles.input.IHitTester.} that enumerate over a collection of {@link yfiles.graph.ILabel ILabels}. - *

- * An implementation of this interface can be queried using the lookup of a {@link yfiles.view.GraphComponent} - *

- * @interface - * @implements {yfiles.input.IHitTester.} - */ - export interface ILabelHitTester extends yfiles.lang.Object,yfiles.input.IHitTester{ - } - var ILabelHitTester:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.ILabelHitTester; - }; - /** - * This is a flagging interface for instances of {@link yfiles.input.IHitTester.} that enumerate over a collection of {@link yfiles.graph.ILabelOwner}. - *

- * An implementation of this interface can be queried using the lookup of a {@link yfiles.view.GraphComponent} - *

- * @interface - * @implements {yfiles.input.IHitTester.} - */ - export interface ILabelOwnerHitTester extends yfiles.lang.Object,yfiles.input.IHitTester{ - } - var ILabelOwnerHitTester:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.ILabelOwnerHitTester; - }; - /** - * This is a flagging interface for instances of {@link yfiles.input.IHitTester.} that enumerate over a collection of {@link yfiles.graph.IPort IPorts}. - *

- * An implementation of this interface can be queried using the lookup of a {@link yfiles.view.GraphComponent} - *

- * @interface - * @implements {yfiles.input.IHitTester.} - */ - export interface IPortHitTester extends yfiles.lang.Object,yfiles.input.IHitTester{ - } - var IPortHitTester:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IPortHitTester; - }; - /** - * This is a flagging interface for instances of {@link yfiles.input.IHitTester.} that enumerate over a collection of {@link yfiles.graph.IEdge IEdges}. - *

- * An implementation of this interface can be queried using the lookup of a {@link yfiles.view.GraphComponent} - *

- * @interface - * @implements {yfiles.input.IHitTester.} - */ - export interface IEdgeHitTester extends yfiles.lang.Object,yfiles.input.IHitTester{ - } - var IEdgeHitTester:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IEdgeHitTester; - }; - /** - * This is a flagging interface for instances of {@link yfiles.input.IHitTester.} that enumerate over a collection of {@link yfiles.graph.IBend IBends}. - *

- * An implementation of this interface can be queried using the lookup of a {@link yfiles.view.GraphComponent} - *

- * @interface - * @implements {yfiles.input.IHitTester.} - */ - export interface IBendHitTester extends yfiles.lang.Object,yfiles.input.IHitTester{ - } - var IBendHitTester:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IBendHitTester; - }; - /** - * Abstract base class implementation of an {@link yfiles.input.IInputMode} that can be used concurrently with other {@link yfiles.input.IInputMode} - * implementations if its {@link yfiles.input.InputModeBase#exclusive} property is true. - *

- * This class adds convenience methods for derived classes. - *

- * @class - * @implements {yfiles.input.IInputMode} - */ - export interface InputModeBase extends yfiles.lang.Object,yfiles.input.IInputMode{} - export class InputModeBase { - /** - * Initializes a new instance of the {@link yfiles.input.InputModeBase} class. - * @param exclusive Iff this mode should be {@link #exclusive}. - * @protected - */ - constructor(exclusive:boolean); - /** - * Initializes a new instance of the {@link yfiles.input.InputModeBase} class that is {@link yfiles.input.InputModeBase#exclusive} by default. - * @protected - */ - constructor(); - /** - * Cancels the editing of this mode by first disabling and afterwards reenabling the installed {@link yfiles.input.InputModeBase#controller}. - *

- * This implementation disables and reenables the {@link yfiles.input.InputModeBase#controller} and fires the {@link yfiles.input.InputModeBase#onCanceled} event afterwards. - * Classes that need to perform clean-up should override the {@link yfiles.input.InputModeBase#onConcurrencyControllerDeactivated} - * method and invoke base.OnConcurrencyControllerDeactivated as the last statement. - *

- * @see yfiles.input.InputModeBase#onCanceled - * @see yfiles.input.InputModeBase#addCanceledListener - */ - cancel():void; - /** - * Determines whether this instance can request the mutex. - *

- * This will return true, iff a {@link yfiles.input.InputModeBase#controller} has been injected and the helper allows requesting the mutex. - *

- * @returns Whether a call to {@link #requestMutex} would currently succeed. - * @protected - */ - canRequestMutex():boolean; - /** - * Creates an implementation of {@link yfiles.input.IInputModeContext} that is specific to this mode. - *

- * This is needed for events that are triggered by this InputMode to signalize where the event is coming from. A common - * usage for this is for example in {@link yfiles.input.IHitTestable#isHit} calls. - *

- *

- * The result can be given to {@link yfiles.input.IHitTestable#isHit} or {@link yfiles.view.CanvasComponent#hitElementsAt} to let - * implementations of {@link yfiles.input.IHitTestable} get access to the current {@link yfiles.input.IInputModeContext}. This can be done - * by looking up {@link yfiles.input.IInputModeContext} from the {@link yfiles.view.ICanvasContext}'s {@link yfiles.graph.ILookup#lookup} method or - * simply downcasting. - *

- * @returns A readily configured {@link }. - * @see yfiles.view.CanvasComponent#hitElementsAt - * @see yfiles.input.IHitTestable#isHit - * @see yfiles.input.IInputModeContext - * @protected - */ - createChildInputModeContext():yfiles.input.IInputModeContext; - /** - * Helper method that yields a suitably configured {@link yfiles.input.InputModeEventArgs} for this input mode. - * @param context An input mode context that is available in the {@link }. - *

- * Can be null in which case a new context for this instance is created automatically. - *

- * @returns An input mode event argument that is configured for this instance. - * @protected - */ - createInputModeEventArgs(context:yfiles.input.IInputModeContext):yfiles.input.InputModeEventArgs; - /** - * Determines whether this instance owns the input mutex. - *

- * If no {@link yfiles.input.InputModeBase#controller} had been associated with this instance upon the call to {@link yfiles.input.InputModeBase#requestMutex} this method will - * return false. - *

- * @returns Whether this instance has the input mutex. - * @protected - */ - hasMutex():boolean; - /** - * Performs one-time initialization of this instance. - *

- * This method should not be invoked by subclasses. This will be done automatically upon first {@link yfiles.input.InputModeBase#install installation} of this mode. - *

- *

- * This code will be executed only once per instance. The {@link yfiles.input.InputModeBase#inputModeContext} property will be null when this code is executed. This method - * should not be used to install this mode into a specific canvas. Subclasses should always call base.Initialize() first. - *

- * @see yfiles.input.InputModeBase#install - * @protected - */ - initialize():void; - /** - * Installs this mode into a {@link yfiles.view.CanvasComponent} using the provided {@link yfiles.input.IInputModeContext}. - *

- * Subclasses should override this method and callbase.Install(context), first. One-time initialization should be performed - * in the {@link yfiles.input.InputModeBase#initialize} method. This implementation will call the {@link yfiles.input.InputModeBase#initialize} - * method the first time this mode gets installed. The initialization will be surrounded by calls to {@link yfiles.input.InputModeBase#onInitializing} - * and {@link yfiles.input.InputModeBase#onInitialized} to trigger the corresponding events. - *

- * @param context the context to install this mode into - * @param controller The {@link #controller} for this mode. - * @see yfiles.input.InputModeBase#inputModeContext - * @see yfiles.view.CanvasComponent#inputMode - */ - install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; - /** - * Event dispatch method that will dispatch the {@link yfiles.input.InputModeBase#addCanceledListener Canceled} - * event. - *

- * This method is called by subclasses when the editing process has been {@link yfiles.input.InputModeBase#cancel}ed. - *

- * @param evt The event arguments. - * @see yfiles.input.InputModeBase#initialize - * @protected - */ - onCanceled(evt:yfiles.input.InputModeEventArgs):void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been activated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerActivated():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerDeactivated():void; - /** - * Event dispatch method that will dispatch the {@link yfiles.input.InputModeBase#addInitializedListener Initialized} - * event. - *

- * This method will be called by {@link yfiles.input.InputModeBase#install} for the first installation directly after {@link yfiles.input.InputModeBase#initialize} - * has returned. - *

- * @param evt The event arguments. - * @see yfiles.input.InputModeBase#initialize - * @protected - */ - onInitialized(evt:yfiles.input.InputModeEventArgs):void; - /** - * Event dispatch method that will dispatch the {@link yfiles.input.InputModeBase#addInitializingListener Initializing} - * event. - *

- * This method will be called by {@link yfiles.input.InputModeBase#install} for the first installation directly before {@link yfiles.input.InputModeBase#initialize} - * is invoked. - *

- * @param evt The event arguments. - * @see yfiles.input.InputModeBase#initialize - * @protected - */ - onInitializing(evt:yfiles.input.InputModeEventArgs):void; - /** - * Called when this instance obtains the mutex. - *

- * If no {@link yfiles.input.InputModeBase#controller} had been associated with this instance upon the call to {@link yfiles.input.InputModeBase#requestMutex} this method will - * not be called. - *

- * @protected - */ - onMutexObtained():void; - /** - * Called when this instance released the mutex. - *

- * If no {@link yfiles.input.InputModeBase#controller} had been associated with this instance upon the call to {@link yfiles.input.InputModeBase#requestMutex} this method will - * not be called. - *

- * @protected - */ - onMutexReleased():void; - /** - * Event dispatch method that will dispatch the {@link yfiles.input.InputModeBase#addStoppedListener Stopped} - * event. - *

- * This method will be called by {@link yfiles.input.InputModeBase#tryStop} or can be called by subclasses during a {@link yfiles.input.InputModeBase#tryStop} - * operation. - *

- * @param evt The event arguments. - * @see yfiles.input.InputModeBase#tryStop - * @see yfiles.input.InputModeBase#addStoppedListener - * @protected - */ - onStopped(evt:yfiles.input.InputModeEventArgs):void; - /** - * Releases previously captured keyboard input. - * @protected - */ - releaseKeyboard():void; - /** - * Releases the mutex that is currently owned by this instance. - *

- * This will trigger the {@link yfiles.input.InputModeBase#onMutexReleased} method if this instance previously owned the mutex. - *

- * @protected - */ - releaseMutex():void; - /** - * Releases previously captured mouse and touch input. - * @protected - */ - releasePointer():void; - /** - * Requests capturing of all keyboard input that happens in the {@link yfiles.view.CanvasComponent}. - *

- * This sets the CaptureAllKeyboardInput property to - * true, which will prevent visuals inside the canvas from stealing key strokes. - *

- * @see yfiles.input.InputModeBase#releaseKeyboard - * @protected - */ - requestKeyboard():void; - /** - * Requests the mutex from the current {@link yfiles.input.InputModeBase#controller}. - *

- * This implementation will call the {@link yfiles.input.InputModeBase#onMutexObtained} method if the mutex has been successfully - * obtained. If the mutex cannot be obtained this method will trigger an exception. - *

- * @throws {yfiles.lang.Exception} If the mutex could not be obtained. - * @protected - */ - requestMutex():void; - /** - * Requests capturing of all mouse and touch input that happens in the {@link yfiles.view.CanvasComponent}. - *

- * This sets the {@link yfiles.view.CanvasComponent#captureAllPointerInput} property to true, which will prevent visuals inside the canvas from stealing mouse input. - *

- * @see yfiles.input.InputModeBase#releasePointer - * @protected - */ - requestPointer():void; - /** - * Tries to stop the editing. - *

- * This implementation returns if this instance does not currently {@link yfiles.input.InputModeBase#hasMutex have the input mutex}. - *

- *

- * This implementation calls {@link yfiles.input.InputModeBase#onStopped}. Subclasses that want to prevent a stop or need to do - * special clean up should do this here if the base class implementation of {@link yfiles.input.InputModeBase#tryStop} returns - * true. A typical implementation should follow this idiom if it wants to stop: - *

- *

- * and if it doesn't want to stop simply return false immediately. - *

- *

- * Calling this method raises the {@link yfiles.input.InputModeBase#addStoppedListener Stopped} event. - *

- * @returns true iff this instance does not {@link #hasMutex own the mutex}. - * @see yfiles.input.InputModeBase#onStopped - */ - tryStop():boolean; - /** - * Uninstalls this mode from the canvas. - *

- * Subclasses should always call base.Uninstall(context) as the last statement. - *

- * @param context The context to remove this mode from. This is the same instance that has been passed to - * {@link #install}. - */ - uninstall(context:yfiles.input.IInputModeContext):void; - /** - * Adds the given listener for the Initializing event that occurs before the call to {@link yfiles.input.InputModeBase#initialize} - *

- * Clients can use this event to perform configuration of the instance shortly before the initialization begins. - *

- * @param listener The listener to add. - * @see yfiles.input.InputModeBase#install - * @see yfiles.input.InputModeBase#removeInitializingListener - */ - addInitializingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the Initializing event that occurs before the call to - * {@link yfiles.input.InputModeBase#initialize} - *

- * Clients can use this event to perform configuration of the instance shortly before the initialization begins. - *

- * @param listener The listener to remove. - * @see yfiles.input.InputModeBase#install - * @see yfiles.input.InputModeBase#addInitializingListener - */ - removeInitializingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the Initialized event that occurs after the call to {@link yfiles.input.InputModeBase#initialize} - *

- * Clients can use this event to perform post configuration steps of the instance shortly after the initialization has been - * performed. - *

- * @param listener The listener to add. - * @see yfiles.input.InputModeBase#install - * @see yfiles.input.InputModeBase#removeInitializedListener - */ - addInitializedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the Initialized event that occurs after the call to - * {@link yfiles.input.InputModeBase#initialize} - *

- * Clients can use this event to perform post configuration steps of the instance shortly after the initialization has been - * performed. - *

- * @param listener The listener to remove. - * @see yfiles.input.InputModeBase#install - * @see yfiles.input.InputModeBase#addInitializedListener - */ - removeInitializedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the Canceled event that occurs after the call to {@link yfiles.input.InputModeBase#cancel} - *

- * Clients can use this event to perform post cleanup steps of the instance shortly after the mode has been canceled. - *

- * @param listener The listener to add. - * @see yfiles.input.InputModeBase#onCanceled - * @see yfiles.input.InputModeBase#cancel - * @see yfiles.input.InputModeBase#tryStop - * @see yfiles.input.InputModeBase#addStoppedListener - * @see yfiles.input.InputModeBase#removeCanceledListener - */ - addCanceledListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the Canceled event that occurs after the call to {@link yfiles.input.InputModeBase#cancel} - *

- * Clients can use this event to perform post cleanup steps of the instance shortly after the mode has been canceled. - *

- * @param listener The listener to remove. - * @see yfiles.input.InputModeBase#onCanceled - * @see yfiles.input.InputModeBase#cancel - * @see yfiles.input.InputModeBase#tryStop - * @see yfiles.input.InputModeBase#addStoppedListener - * @see yfiles.input.InputModeBase#addCanceledListener - */ - removeCanceledListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the Stopped event that occurs after the call to {@link yfiles.input.InputModeBase#tryStop} - *

- * Clients can use this event to perform post cleanup steps of the instance shortly after the mode has been stopped. - *

- * @param listener The listener to add. - * @see yfiles.input.InputModeBase#onStopped - * @see yfiles.input.InputModeBase#cancel - * @see yfiles.input.InputModeBase#tryStop - * @see yfiles.input.InputModeBase#addCanceledListener - * @see yfiles.input.InputModeBase#removeStoppedListener - */ - addStoppedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the Stopped event that occurs after the call to {@link yfiles.input.InputModeBase#tryStop} - *

- * Clients can use this event to perform post cleanup steps of the instance shortly after the mode has been stopped. - *

- * @param listener The listener to remove. - * @see yfiles.input.InputModeBase#onStopped - * @see yfiles.input.InputModeBase#cancel - * @see yfiles.input.InputModeBase#tryStop - * @see yfiles.input.InputModeBase#addCanceledListener - * @see yfiles.input.InputModeBase#addStoppedListener - */ - removeStoppedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Gets whether this mode is currently installed in a {@link yfiles.view.CanvasComponent}. - * @see yfiles.input.InputModeBase#install - * @type {boolean} - */ - installed:boolean; - /** - * Gets the context instance this mode is currently installed in or null if this instance is not installed. - *

- * Note that this instance should not be passed down to subordinate modes or instances. Instead a corresponding context - * that has this instance set as the {@link yfiles.input.IInputModeContext#parentInputMode} should be used. One such instance can be obtained through helper method - * {@link yfiles.input.InputModeBase#createChildInputModeContext}. - *

- * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * - * @type {number} - */ - priority:number; - /** - * Gets or sets the enabled state of this input mode. - *

- * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed - * {@link yfiles.input.InputModeBase#controller} so a disabled instance should never try to acquire the input mutex. - *

- * @type {boolean} - */ - enabled:boolean; - /** - * Gets if this mode is active. - *

- * This mode is active if a {@link yfiles.input.InputModeBase#controller} is installed and is {@link yfiles.input.ConcurrencyController#active}. - *

- * @type {boolean} - */ - active:boolean; - /** - * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. - *

- * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.InputModeBase#controller}. - *

- *

- * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} - * will be deactivated. Otherwise it will always run concurrently with all other modes. - *

- * @type {boolean} - */ - exclusive:boolean; - /** - * Gets the installed {@link yfiles.input.InputModeBase#controller}. - * @see yfiles.input.InputModeBase#requestMutex - * @see yfiles.input.InputModeBase#releaseMutex - * @see yfiles.input.InputModeBase#hasMutex - * @see yfiles.input.InputModeBase#canRequestMutex - * @protected - * @type {yfiles.input.ConcurrencyController} - */ - controller:yfiles.input.ConcurrencyController; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.InputModeBase; - } - /** - * Event arguments used by {@link yfiles.input.ClickInputMode#addClickedListener Clicked}. - * @class - * @extends {yfiles.input.InputModeEventArgs} - */ - export interface ClickEventArgs extends yfiles.input.InputModeEventArgs{} - export class ClickEventArgs { - /** - * Initializes a new instance of the {@link yfiles.input.ClickEventArgs} class. - * @param context The context in which the click occurred. - * @param location The location. - * @param modifiers State of the modifiers. - * @param mouseButtons The mouse button(s) that have changed - * @param clickCount - */ - constructor(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,modifiers:yfiles.view.ModifierKeys,mouseButtons:yfiles.view.MouseButtons,clickCount:number); - /** - * Gets the location of the click. - * @type {yfiles.geometry.Point} - */ - location:yfiles.geometry.Point; - /** - * Gets the state of the modifiers at the time of the click. - * @type {yfiles.view.ModifierKeys} - */ - modifiers:yfiles.view.ModifierKeys; - /** - * Gets or sets a value indicating whether this {@link yfiles.input.ClickEventArgs} have been handled. - *

- * Client code that is triggered by the event and does not want the event to become handled by other handles should set - * this property to true to stop propagation of the event. - *

- * @type {boolean} - */ - handled:boolean; - /** - * Gets the MouseButtons that have changed for this event. - * @type {yfiles.view.MouseButtons} - */ - mouseButtons:yfiles.view.MouseButtons; - /** - * Gets the number of clicks associated with this event. - *

- * This can be used to distinguish between single and multiple clicks. Note that for compatibility reasons, a negative - * value means that no click count has been provided at event creation time. - *

- * @type {number} - */ - clickCount:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.ClickEventArgs; - } - export enum DoubleClickPolicy{ - /** - * In case of a double click, only the double click event is raised, but no single click events. - *

- * Single clicks not belonging to a double click will be reported with a short delay to ensure that they do not become - * double clicks. - *

- */ - DOUBLE_CLICK_ONLY, - /** - * In case of a double click, one single click event is raised, followed by a double click event. - *

- * The second click of the double click is not reported as a single click. Single clicks not belonging to a double click - * will be reported instantly. - *

- */ - INITIAL_SINGLE_AND_DOUBLE_CLICK, - /** - * In case of a double click, two single click events are raised, followed by a double click event. - */ - BOTH_SINGLE_CLICKS_AND_DOUBLE_CLICK - } - /** - * An input mode that recognizes simple mouse clicks. - *

- * Clients register to {@link yfiles.input.ClickInputMode#addClickedListener Clicked} to get notified of mouse - * clicks. The {@link yfiles.input.ClickInputMode#activeButtons} property can be used to switch between the detection of right and left mouse clicks. - *
- * This mode can be instructed to {@link yfiles.input.ClickInputMode#swallowFocusClick swallow clicks} if they lead happen shortly after the control gained focus. This is useful - * to prevent accidental clicks from being processed if the user wanted to put the focus into the control, only. - *

- *

- * This mode is {@link yfiles.input.ClickInputMode#exclusive} by default. - *

- * @see yfiles.input.ClickInputMode#doubleClickPolicy - * @see yfiles.input.ClickInputMode#swallowFocusClick - * @see yfiles.input.ClickInputMode#activeButtons - * @class - * @implements {yfiles.input.IInputMode} - */ - export interface ClickInputMode extends yfiles.lang.Object,yfiles.input.IInputMode{} - export class ClickInputMode { - /** - * Creates a new instance of this mode that detects left mouse clicks. - */ - constructor(); - /** - * Cancels the editing of this mode. - *

- * This implementation {@link yfiles.input.ConcurrencyController#releaseMutex releases} the mutex if it is currently owned by this instance and calls - * {@link yfiles.input.ClickInputMode#onCanceled}. - *

- * @see yfiles.input.ClickInputMode#onCanceled - */ - cancel():void; - /** - * Creates the event recognizer that is used to recognize the clicks for this instance. - * @returns - * @protected - */ - createClickRecognizer():(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Creates the event recognizer that is used to recognize the press event for this instance. - * @returns - * @protected - */ - createPressRecognizer():(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Creates the event recognizer that is used to recognize the release event for this instance. - * @returns - * @protected - */ - createReleaseRecognizer():(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Installs this mode into the given context that is provided by the canvas. - *

- * In general a mode can only be installed into a single canvas at all times. - *

- *

- * This method is called to initialize this instance. Subclasses should override this method to register the corresponding - * event handler delegates for the various input events they need to register with. - *

- *

- * Overriding implementations should call the base implementation, first. - *

- * @param context The context that this instance shall be installed into. The same instance will be passed to this instance during - * {@link #uninstall}. A reference to the context may be kept and queried during the time the mode is - * installed. - * @param controller The {@link #controller} for this mode. - * @see yfiles.input.IInputMode#uninstall - */ - install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; - /** - * Determines whether the given event is a press event that occurred at an invalid location. - * @param eventSource - * @param evt - * @returns - * @see yfiles.input.ClickInputMode#validClickHitTestable - * @protected - */ - isInvalidPress(eventSource:any,evt:yfiles.lang.EventArgs):boolean; - /** - * Determines whether the given event is a valid click event. - * @param src - * @param evt - * @returns - * @see yfiles.input.ClickInputMode#validClickHitTestable - * @protected - */ - isValidClick(src:any,evt:yfiles.lang.EventArgs):boolean; - /** - * Determines whether the given event is a valid press event. - * @param eventSource - * @param evt - * @returns - * @protected - */ - isValidPress(eventSource:any,evt:yfiles.lang.EventArgs):boolean; - /** - * Determines whether the given event is a valid release event. - * @param src - * @param evt - * @returns - * @see yfiles.input.ClickInputMode#validClickHitTestable - * @protected - */ - isValidRelease(src:any,evt:yfiles.lang.EventArgs):boolean; - /** - * Called after {@link yfiles.input.ClickInputMode#cancel} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been canceled. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onCanceled():void; - /** - * Called once this mode has recognized a click gesture. - *

- * This method will trigger the {@link yfiles.input.ClickInputMode#addClickedListener Clicked} event. - *

- * @param evt The arguments. - * @protected - */ - onClicked(evt:yfiles.input.ClickEventArgs):void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been activated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerActivated():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerDeactivated():void; - /** - * Called once this mode has recognized a double-click gesture. - *

- * This method will trigger the {@link yfiles.input.ClickInputMode#addDoubleClickedListener DoubleClicked} event. - *

- * @param evt The arguments. - * @protected - */ - onDoubleClicked(evt:yfiles.input.ClickEventArgs):void; - /** - * Called once this mode has recognized a left click gesture. - *

- * This method will trigger the {@link yfiles.input.ClickInputMode#addLeftClickedListener LeftClicked} event. - *

- * @param evt The arguments. - * @protected - */ - onLeftClicked(evt:yfiles.input.ClickEventArgs):void; - /** - * Called once this mode has recognized a left double-click gesture. - *

- * This method will trigger the {@link yfiles.input.ClickInputMode#addLeftDoubleClickedListener LeftDoubleClicked} - * event. - *

- * @param evt The arguments. - * @protected - */ - onLeftDoubleClicked(evt:yfiles.input.ClickEventArgs):void; - /** - * Called once this mode has recognized a right click gesture. - *

- * This method will trigger the {@link yfiles.input.ClickInputMode#addRightClickedListener RightClicked} event. - *

- * @param evt The arguments. - * @protected - */ - onRightClicked(evt:yfiles.input.ClickEventArgs):void; - /** - * Called once this mode has recognized a double-click gesture. - *

- * This method will trigger the {@link yfiles.input.ClickInputMode#addRightDoubleClickedListener RightDoubleClicked} - * event. - *

- * @param evt The arguments. - * @protected - */ - onRightDoubleClicked(evt:yfiles.input.ClickEventArgs):void; - /** - * Called after {@link yfiles.input.ClickInputMode#tryStop} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been stopped. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onStopped():void; - /** - * Prevents a double-click event from being issued if the next click would do so and sends only a single click instead. - *

- * The intention is for "breaking" a double click if an input mode using {@link yfiles.input.ClickInputMode} performs actions that - * would lead to surprising behavior if the next click would lead to a double-click. Examples of this are - * {@link yfiles.input.GraphEditorInputMode}'s selection cycling where several clicks in short succession may occur, as well as - * creating a node by clicking on the canvas and selecting it immediately afterwards with another click. - *

- *

- * This method's effect is very short-lived. It really only prevents a double-click event for the very next click that this - * input mode handles. The internal flag set by this method is re-set on every click received. This also means that if you - * call this method and the next click is just a regular single-click the flag is cleared nonetheless. - *

- */ - preventNextDoubleClick():void; - /** - * Returns and resets the flag set by {@link yfiles.input.ClickInputMode#preventNextDoubleClick}. - *

- * To ensure that the flag really acts just once, this method resets the flag and returns its value prior to the reset. - *

- * @returns - * @protected - */ - queryAndResetPreventNextDoubleClick():boolean; - /** - * - * @returns - */ - tryStop():boolean; - /** - * Uninstalls this mode from the given context. - *

- * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} method. After a mode has - * been uninstalled it can be installed again into the same or another canvas. - *

- *

- * Overriding implementations should call the base implementation after their own code. - *

- * @param context The context to deregister from. This is the same instance that had been passed to {@link #install} during - * installation. - */ - uninstall(context:yfiles.input.IInputModeContext):void; - /** - * - * @type {number} - */ - priority:number; - /** - * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. - *

- * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.ClickInputMode#controller}. - *

- *

- * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} - * will be deactivated. Otherwise it will always run concurrently with all other modes. - *

- * @type {boolean} - */ - exclusive:boolean; - /** - * Gets or sets the enabled state of this input mode. - *

- * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed - * {@link yfiles.input.ClickInputMode#controller} so a disabled instance should never try to acquire the input mutex. - *

- * @type {boolean} - */ - enabled:boolean; - /** - * - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Gets the installed {@link yfiles.input.ClickInputMode#controller}. - * @see yfiles.input.IInputMode#install - * @protected - * @type {yfiles.input.ConcurrencyController} - */ - controller:yfiles.input.ConcurrencyController; - /** - * Adds the given listener for the Clicked event that occurs once a click has been detected. - * @param listener The listener to add. - * @see yfiles.input.ClickEventArgs - * @see yfiles.input.ClickInputMode#doubleClickPolicy - * @see yfiles.input.ClickInputMode#removeClickedListener - */ - addClickedListener(listener:(sender:any,evt:yfiles.input.ClickEventArgs)=>void):void; - /** - * Removes the given listener for the Clicked event that occurs once a click has been detected. - * @param listener The listener to remove. - * @see yfiles.input.ClickEventArgs - * @see yfiles.input.ClickInputMode#doubleClickPolicy - * @see yfiles.input.ClickInputMode#addClickedListener - */ - removeClickedListener(listener:(sender:any,evt:yfiles.input.ClickEventArgs)=>void):void; - /** - * Adds the given listener for the LeftClicked event that occurs once a left click has been detected. - * @param listener The listener to add. - * @see yfiles.input.ClickEventArgs - * @see yfiles.input.ClickInputMode#doubleClickPolicy - * @see yfiles.input.ClickInputMode#removeLeftClickedListener - */ - addLeftClickedListener(listener:(sender:any,evt:yfiles.input.ClickEventArgs)=>void):void; - /** - * Removes the given listener for the LeftClicked event that occurs once a left click has been detected. - * @param listener The listener to remove. - * @see yfiles.input.ClickEventArgs - * @see yfiles.input.ClickInputMode#doubleClickPolicy - * @see yfiles.input.ClickInputMode#addLeftClickedListener - */ - removeLeftClickedListener(listener:(sender:any,evt:yfiles.input.ClickEventArgs)=>void):void; - /** - * Adds the given listener for the RightClicked event that occurs once a right click has been detected. - * @param listener The listener to add. - * @see yfiles.input.ClickEventArgs - * @see yfiles.input.ClickInputMode#doubleClickPolicy - * @see yfiles.input.ClickInputMode#removeRightClickedListener - */ - addRightClickedListener(listener:(sender:any,evt:yfiles.input.ClickEventArgs)=>void):void; - /** - * Removes the given listener for the RightClicked event that occurs once a right click has been detected. - * @param listener The listener to remove. - * @see yfiles.input.ClickEventArgs - * @see yfiles.input.ClickInputMode#doubleClickPolicy - * @see yfiles.input.ClickInputMode#addRightClickedListener - */ - removeRightClickedListener(listener:(sender:any,evt:yfiles.input.ClickEventArgs)=>void):void; - /** - * Adds the given listener for the DoubleClicked event that occurs once a double-click has been detected. - * @param listener The listener to add. - * @see yfiles.input.ClickEventArgs - * @see yfiles.input.ClickInputMode#doubleClickPolicy - * @see yfiles.input.ClickInputMode#removeDoubleClickedListener - */ - addDoubleClickedListener(listener:(sender:any,evt:yfiles.input.ClickEventArgs)=>void):void; - /** - * Removes the given listener for the DoubleClicked event that occurs once a double-click has been detected. - * @param listener The listener to remove. - * @see yfiles.input.ClickEventArgs - * @see yfiles.input.ClickInputMode#doubleClickPolicy - * @see yfiles.input.ClickInputMode#addDoubleClickedListener - */ - removeDoubleClickedListener(listener:(sender:any,evt:yfiles.input.ClickEventArgs)=>void):void; - /** - * Adds the given listener for the LeftDoubleClicked event that occurs once a left double-click has been detected. - * @param listener The listener to add. - * @see yfiles.input.ClickEventArgs - * @see yfiles.input.ClickInputMode#doubleClickPolicy - * @see yfiles.input.ClickInputMode#removeLeftDoubleClickedListener - */ - addLeftDoubleClickedListener(listener:(sender:any,evt:yfiles.input.ClickEventArgs)=>void):void; - /** - * Removes the given listener for the LeftDoubleClicked event that occurs once a left double-click has been detected. - * @param listener The listener to remove. - * @see yfiles.input.ClickEventArgs - * @see yfiles.input.ClickInputMode#doubleClickPolicy - * @see yfiles.input.ClickInputMode#addLeftDoubleClickedListener - */ - removeLeftDoubleClickedListener(listener:(sender:any,evt:yfiles.input.ClickEventArgs)=>void):void; - /** - * Adds the given listener for the RightDoubleClicked event that occurs once a right double-click has been detected. - * @param listener The listener to add. - * @see yfiles.input.ClickEventArgs - * @see yfiles.input.ClickInputMode#doubleClickPolicy - * @see yfiles.input.ClickInputMode#removeRightDoubleClickedListener - */ - addRightDoubleClickedListener(listener:(sender:any,evt:yfiles.input.ClickEventArgs)=>void):void; - /** - * Removes the given listener for the RightDoubleClicked event that occurs once a right double-click has been detected. - * @param listener The listener to remove. - * @see yfiles.input.ClickEventArgs - * @see yfiles.input.ClickInputMode#doubleClickPolicy - * @see yfiles.input.ClickInputMode#addRightDoubleClickedListener - */ - removeRightDoubleClickedListener(listener:(sender:any,evt:yfiles.input.ClickEventArgs)=>void):void; - /** - * Gets or sets the click handling mode that determines the triggering behavior of {@link yfiles.input.ClickInputMode#addClickedListener Clicked} - * and {@link yfiles.input.ClickInputMode#addDoubleClickedListener DoubleClicked}. - * @see yfiles.input.ClickInputMode#doubleClickPolicy - * @default yfiles.input.DoubleClickPolicy.BOTH_SINGLE_CLICKS_AND_DOUBLE_CLICK - * @type {yfiles.input.DoubleClickPolicy} - */ - doubleClickPolicy:yfiles.input.DoubleClickPolicy; - /** - * Gets or sets a hit test that determines where this mode should recognize clicks. - *

- * This implementation is tested during the {@link yfiles.input.ClickInputMode#isValidPress} to determine whether it is valid to - * click here. The default implementation is {@link yfiles.input.IHitTestable#ALWAYS}. - *

- * @type {yfiles.input.IHitTestable} - */ - validClickHitTestable:yfiles.input.IHitTestable; - /** - * Gets or sets whether to {@link yfiles.input.ConcurrencyController#requestMutex request the mutex} on a click. - *

- * If set to true this will discard other concurrent input modes on a click. The default is true. - *

- * @default true - * @type {boolean} - */ - requestMutexOnClick:boolean; - /** - * Gets or sets the cursor to use when hovering over a valid hit region. - *

- * The default is null and the current cursor is used instead. - *

- * @type {yfiles.view.Cursor} - */ - validClickHitCursor:yfiles.view.Cursor; - /** - * Gets or sets for which button(s) mouse clicks should be processed. - *

- * Default value is {@link yfiles.view.MouseButtons#LEFT} - *

- * @see yfiles.input.ClickInputMode#createClickRecognizer - * @default yfiles.view.MouseButtons.LEFT - * @type {yfiles.view.MouseButtons} - */ - activeButtons:yfiles.view.MouseButtons; - /** - * Gets or sets a property that determines whether clicks should be swallowed if they happen within a short amount of time - * after the {@link yfiles.view.CanvasComponent} got focus. - *

- * The default is false. If set to true clicks are discarded within 100 ms after the focus entered. - *

- * @default false - * @type {boolean} - */ - swallowFocusClick:boolean; - /** - * Gets the location of the last click. - * @type {yfiles.geometry.Point} - */ - clickLocation:yfiles.geometry.Point; - /** - * Gets the state of the modifier keys at the time of the end of the gesture. - * @type {yfiles.view.ModifierKeys} - */ - modifiers:yfiles.view.ModifierKeys; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.ClickInputMode; - } - /** - * Event arguments for the {@link yfiles.input.SnapContext#addCollectSnapResultsListener CollectSnapResults} event. - *

- * Event handlers can use the {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult} method to add snapping results for the - * current move operation. - *

- * @class - * @extends {yfiles.input.InputModeEventArgs} - */ - export interface CollectSnapResultsEventArgs extends yfiles.input.InputModeEventArgs{} - export class CollectSnapResultsEventArgs { - /** - * Creates a new instance of the event arguments using the provided values for initialization. - * @param context The context for which the event is queried. - * @param originalLocation The original location of the mouse at the beginning of the gesture. - * @param newLocation The new (current) location of the mouse. - * @param snapDistance The zoom invariant snap distance. - * @param snapResults The collection to store the snap results in. - */ - constructor(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point,snapDistance:number,snapResults:yfiles.collections.ICollection); - /** - * Adds a {@link yfiles.input.SnapResult} to the collection of snap results. - *

- * null values will be discarded. - *

- * @param snapResult The result to add. - */ - addSnapResult(snapResult:yfiles.input.SnapResult):void; - /** - * Gets the original location of the mouse at the beginning of the gesture. - * @type {yfiles.geometry.Point} - */ - originalLocation:yfiles.geometry.Point; - /** - * Gets the new (current) location of the mouse that is going to be manipulated by the snapping process. - * @type {yfiles.geometry.Point} - */ - newLocation:yfiles.geometry.Point; - /** - * Gets the vector by which the mouse has been moved since initialization of the snapping process. - * @type {yfiles.geometry.Point} - */ - delta:yfiles.geometry.Point; - /** - * Gets the zoom invariant snap distance. - * @type {number} - */ - snapDistance:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.CollectSnapResultsEventArgs; - } - /** - * A controller class that manages a single {@link yfiles.input.IInputMode} implementation. - *

- * The controller will be passed to its associated {@link yfiles.input.IInputMode} in the input mode's {@link yfiles.input.IInputMode#install} - * method. The associated mode can {@link yfiles.input.ConcurrencyController#requestMutex request} an input mutex to {@link yfiles.input.ConcurrencyController#active deactivate} other modes added to the same {@link yfiles.input.MultiplexingInputMode} - * and using {@link yfiles.input.ConcurrencyController#exclusive} controllers. {@link yfiles.input.ConcurrencyController#releaseMutex Releasing the mutex} will reactivate the controller of other modes. - *

- * @see yfiles.input.IInputMode - * @see yfiles.input.MultiplexingInputMode - * @class - * @final - */ - export interface ConcurrencyController extends yfiles.lang.Object{} - export class ConcurrencyController { - /** - * Creates an instance that can be used to {@link yfiles.input.IInputMode#install} the given mode. - *

- * The returned {@link yfiles.input.ConcurrencyController} is not synchronized with any other one so the mode will effectively run - * in a non-{@link yfiles.input.ConcurrencyController#exclusive exclusive} mode. - *

- * @param mode The mode, the {@link } shall be created for. - */ - constructor(mode:yfiles.input.IInputMode); - /** - * Determines if the mutex can be successfully requested currently. - *

- * This will return true, iff this instance is {@link yfiles.input.ConcurrencyController#active} and doesn't hold the mutex. - *

- * @returns Whether a call to {@link #requestMutex} would currently succeed. - */ - canRequestMutex():boolean; - /** - * Determines whether this instance owns the input mutex. - *

- * The instance owns the input mutex if it has successfully {@link yfiles.input.ConcurrencyController#requestMutex requested} the mutex in the past and not yet {@link yfiles.input.ConcurrencyController#releaseMutex released} it. - *

- * @returns Whether this instance has the input mutex. - */ - hasMutex():boolean; - /** - * Triggers a {@link yfiles.input.ConcurrencyController#addPriorityChangedListener PriorityChanged} event with - * {@link yfiles.lang.EventArgs#EMPTY}. - *

- * This method should be called by the associated mode if its {@link yfiles.input.IInputMode#priority} has changed. - *

- */ - onPriorityChanged():void; - /** - * Releases the input mutex. - *

- * Modes should call this method when they have finished editing the contents exclusively. This will reactivate those modes - * whose controller that had been {@link yfiles.input.ConcurrencyController#active deactivated} at the time the mutex has been requested. - *

- */ - releaseMutex():void; - /** - * Can be called to request an input mutex for the input mode. - *

- * Modes should call this method to request exclusive editing for a canvas control. {@link yfiles.input.ConcurrencyController#canRequestMutex} - * should be called before requesting the mutex. If the mutex cannot be obtained, this method will trigger an exception. - *

- * @throws {yfiles.lang.Exception} If the mutex could not be obtained. - */ - requestMutex():void; - /** - * Adds the given listener for the MutexObtained event that occurs when the mutex has been successfully obtained. - *

- * This event is invoked with {@link yfiles.lang.EventArgs#EMPTY} per default. - *

- * @param listener The listener to add. - * @see yfiles.input.ConcurrencyController#removeMutexObtainedListener - */ - addMutexObtainedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the MutexObtained event that occurs when the mutex has been successfully obtained. - *

- * This event is invoked with {@link yfiles.lang.EventArgs#EMPTY} per default. - *

- * @param listener The listener to remove. - * @see yfiles.input.ConcurrencyController#addMutexObtainedListener - */ - removeMutexObtainedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Adds the given listener for the MutexReleased event that occurs when the mutex has been released. - *

- * This event is invoked with {@link yfiles.lang.EventArgs#EMPTY} per default. - *

- * @param listener The listener to add. - * @see yfiles.input.ConcurrencyController#removeMutexReleasedListener - */ - addMutexReleasedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the MutexReleased event that occurs when the mutex has been released. - *

- * This event is invoked with {@link yfiles.lang.EventArgs#EMPTY} per default. - *

- * @param listener The listener to remove. - * @see yfiles.input.ConcurrencyController#addMutexReleasedListener - */ - removeMutexReleasedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Gets the current owner of the input mutex or null if no mode currently owns the mutex. - * @type {yfiles.input.IInputMode} - */ - mutexOwner:yfiles.input.IInputMode; - /** - * Gets or sets if this controller is enabled. - *

- * The default state is disabled. A disabled controller is always {@link yfiles.input.ConcurrencyController#active inactive}. - *

- *

- * When the controller is {@link yfiles.input.IInputMode#install installed} and the input mode is ready for editing, it has to set this property to true if it - * wants to use the input mutex. - *

- * @see yfiles.input.ConcurrencyController#active - * @see yfiles.input.ConcurrencyController#addActiveChangedListener - * @type {boolean} - */ - enabled:boolean; - /** - * Gets if this controller is active. - *

- * An {@link yfiles.input.IInputMode} should only handle events and gestures if this property on its associated {@link yfiles.input.ConcurrencyController} - * is set to true. - *

- *

- * If this controller is set as {@link yfiles.input.ConcurrencyController#exclusive non-exclusive} by its input mode it is active iff it is {@link yfiles.input.ConcurrencyController#enabled}. Otherwise it has to be {@link yfiles.input.ConcurrencyController#enabled} and no - * other input mode may have the {@link yfiles.input.ConcurrencyController#requestMutex input mutex}. - *

- * @see yfiles.input.ConcurrencyController#addActiveChangedListener - * @type {boolean} - */ - active:boolean; - /** - * Adds the given listener for the ActiveChanged event that occurs the {@link yfiles.input.ConcurrencyController#active} property changes. - *

- * This event is invoked with {@link yfiles.lang.EventArgs#EMPTY} per default. - *

- * @param listener The listener to add. - * @see yfiles.input.ConcurrencyController#removeActiveChangedListener - */ - addActiveChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the ActiveChanged event that occurs the {@link yfiles.input.ConcurrencyController#active} property changes. - *

- * This event is invoked with {@link yfiles.lang.EventArgs#EMPTY} per default. - *

- * @param listener The listener to remove. - * @see yfiles.input.ConcurrencyController#addActiveChangedListener - */ - removeActiveChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Gets or sets a value indicating whether this controller will be the only one running when it has the mutex. - *

- * If this controller is marked as exclusive and has the mutex, all controllers of other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} - * will be {@link yfiles.input.ConcurrencyController#active deactivated}. Otherwise it will always run concurrently with all other controllers. - *

- *

- * Changing this property will temporarily {@link yfiles.input.ConcurrencyController#enabled disable} the controller. - *

- * @type {boolean} - */ - exclusive:boolean; - /** - * Gets or sets the cursor the associated mode of this controller would like to have displayed in the - * {@link yfiles.view.CanvasComponent}. - *

- * To indicate that the mode does not have any preferences the property should be set to null. - *

- * @type {yfiles.view.Cursor} - */ - preferredCursor:yfiles.view.Cursor; - /** - * Adds the given listener for the PreferredCursorChanged event that occurs when the {@link yfiles.input.ConcurrencyController#preferredCursor} property changes. - *

- * {@link yfiles.input.MultiplexingInputMode} listens to property changes of the controller of its sub modes. properties. This - * event is invoked with {@link yfiles.lang.EventArgs#EMPTY} per default. - *

- * @param listener The listener to add. - * @see yfiles.input.ConcurrencyController#removePreferredCursorChangedListener - */ - addPreferredCursorChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the PreferredCursorChanged event that occurs when the {@link yfiles.input.ConcurrencyController#preferredCursor} property changes. - *

- * {@link yfiles.input.MultiplexingInputMode} listens to property changes of the controller of its sub modes. properties. This - * event is invoked with {@link yfiles.lang.EventArgs#EMPTY} per default. - *

- * @param listener The listener to remove. - * @see yfiles.input.ConcurrencyController#addPreferredCursorChangedListener - */ - removePreferredCursorChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Adds the given listener for the PriorityChanged event that occurs when {@link yfiles.input.ConcurrencyController#onPriorityChanged} - * is called by the associated mode. - *

- * {@link yfiles.input.MultiplexingInputMode} listens to priority changes of the controller of its sub modes. - *

- * @param listener The listener to add. - * @see yfiles.input.ConcurrencyController#removePriorityChangedListener - */ - addPriorityChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the PriorityChanged event that occurs when {@link yfiles.input.ConcurrencyController#onPriorityChanged} - * is called by the associated mode. - *

- * {@link yfiles.input.MultiplexingInputMode} listens to priority changes of the controller of its sub modes. - *

- * @param listener The listener to remove. - * @see yfiles.input.ConcurrencyController#addPriorityChangedListener - */ - removePriorityChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.ConcurrencyController; - } - /** - * Event arguments for the {@link yfiles.input.ContextMenuInputMode#addPopulateMenuListener PopulateMenu} - * event. - * @class - * @extends {yfiles.input.InputModeEventArgs} - */ - export interface PopulateMenuEventArgs extends yfiles.input.InputModeEventArgs{} - export class PopulateMenuEventArgs { - /** - * Initializes a new instance of the {@link yfiles.input.PopulateMenuEventArgs} class. - * @param context The context. - * @param queryLocation The query location. - */ - constructor(context:yfiles.input.IInputModeContext,queryLocation:yfiles.geometry.Point); - /** - * Gets the queried location in world coordinates. - * @type {yfiles.geometry.Point} - */ - queryLocation:yfiles.geometry.Point; - /** - * Gets or sets a value indicating whether this {@link yfiles.input.PopulateMenuEventArgs} has been handled. - *

- * If this event is marked as handled, the input mode will use the property {@link yfiles.input.PopulateMenuEventArgs#showMenu} to decide whether to show the context menu. - *

- *

- * This property is automatically set to true if a value is assigned to the property {@link yfiles.input.PopulateMenuEventArgs#showMenu}. - *

- * @type {boolean} - */ - handled:boolean; - /** - * Gets or sets a value indicating whether to actually display the context menu. - *

- * This will set the {@link yfiles.input.PopulateMenuEventArgs#handled} property to true. - *

- *

- * The default value of this property is true. - *

- * @type {boolean} - */ - showMenu:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.PopulateMenuEventArgs; - } - /** - * An implementation of the {@link yfiles.input.IInputMode} interface that handles the display of a custom context menu when the - * user right clicks on the {@link yfiles.view.CanvasComponent}. - *

- * This mode can be used with any context menu implementation since it does not impose any specific requirements. - * Typically, it is used in the following way. - *

- *

- * First, this mode must be informed that the user wants to show the context menu with the method - * {@link yfiles.input.ContextMenuInputMode#shouldOpenMenu}, for example because a contextmenu event was fired. - *

- *

- * Then, in response, this mode checks whether its current state allows opening a context menu, and fires the {@link yfiles.input.ContextMenuInputMode#addPopulateMenuListener PopulateMenu} - * and GraphInputMode.populateItemContextMenu. - *

- *

- * If the context menu was closed because of user interaction with it, for example the user selected an menu entry, this - * mode must be informed by calling the method {@link yfiles.input.ContextMenuInputMode#menuClosed}. - *

- *

- * This mode detects automatically if the menu must be closed because of other user interaction, for example the user - * clicked somewhere else, and fires the event {@link yfiles.input.ContextMenuInputMode#addCloseMenuListener CloseMenu} - * to request closing of the context menu. - *

- *

Related demos:

- *
    - *
  • Demo: Context Menu, demo.yfiles.input.contextmenu
  • - *
- * @class - * @implements {yfiles.input.IInputMode} - */ - export interface ContextMenuInputMode extends yfiles.lang.Object,yfiles.input.IInputMode{} - export class ContextMenuInputMode { - /** - * Initializes a new instance of the {@link yfiles.input.ContextMenuInputMode} class. - */ - constructor(); - /** - * Cancels the display of the context menu and requests that the context menu is closed. - */ - cancel():void; - /** - * Creates an {@link yfiles.input.IInputModeContext} for use with the {@link yfiles.input.ContextMenuInputMode#addPopulateMenuListener PopulateMenu} - * call in the upcoming query. - * @returns An instance of {@link }. - * @protected - */ - createPopulateMenuContext():yfiles.input.IInputModeContext; - /** - * Installs this mode in the canvas. - * @param context The context to install this mode into. - * @param controller The {@link #controller} for this mode. - */ - install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; - /** - * This method must be called by custom code to indicate that the menu has been closed. - *

- * Since this input mode cannot know when the user has closed a context menu, this callback should be used to allow the - * instance to adjust the internal state. - *

- * @see yfiles.input.ContextMenuInputMode#addCloseMenuListener - */ - menuClosed():void; - /** - * Called after {@link yfiles.input.ContextMenuInputMode#cancel} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been canceled. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onCanceled():void; - /** - * Called when the menu is closed and triggers the {@link yfiles.input.ContextMenuInputMode#addCloseMenuListener CloseMenu} - * event. - * @protected - */ - onCloseMenu():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been activated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerActivated():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerDeactivated():void; - /** - * This will populate the context menu for the given world coordinate. - *

- * This implementation will trigger the {@link yfiles.input.ContextMenuInputMode#addPopulateMenuListener PopulateMenu} - * event and will use the {@link yfiles.input.PopulateMenuEventArgs#showMenu} value as the return value. If the event will not be handled, this method will return true if the - * menu already contains elements. - *

- * @param location The location in the world coordinate system for which the context menu has been invoked. - * @returns Whether to show the context menu. - * @protected - */ - onMenuOpening(location:yfiles.geometry.Point):boolean; - /** - * Raises the {@link yfiles.input.ContextMenuInputMode#addPopulateMenuListener PopulateMenu} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onPopulateMenu(evt:yfiles.input.PopulateMenuEventArgs):void; - /** - * Called after {@link yfiles.input.ContextMenuInputMode#tryStop} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been stopped. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onStopped():void; - /** - * This method must be called by custom code to inform this input mode that a context menu is about to be opened by a user - * gesture. - *

- * Since this input mode does not know when the user wants to open a context menu, this method must be called to possibly - * cancel the request and, otherwise, update the internal state of this mode. - *

- * @param [queryLocation=null] The optional location for which the context menu content should be queried. This value will be passed to {@link #onPopulateMenu} - * and will ultimately be available in {@link #queryLocation}. If not specified, the last known mouse location will be used. - * @returns - * @see yfiles.input.ContextMenuInputMode#menuClosed - * @see yfiles.input.ContextMenuInputMode#addCloseMenuListener - */ - shouldOpenMenu(queryLocation?:yfiles.geometry.Point):boolean; - /** - * Stops the display of the context menu and requests that the context menu is closed. - * @returns - */ - tryStop():boolean; - /** - * Removes the menu from the context and replaces it with the old instance. - * @param context The context to uninstall this mode from. - */ - uninstall(context:yfiles.input.IInputModeContext):void; - /** - * - * @type {number} - */ - priority:number; - /** - * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. - *

- * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.ContextMenuInputMode#controller}. - *

- *

- * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} - * will be deactivated. Otherwise it will always run concurrently with all other modes. - *

- * @type {boolean} - */ - exclusive:boolean; - /** - * Gets or sets the enabled state of this input mode. - *

- * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed - * {@link yfiles.input.ContextMenuInputMode#controller} so a disabled instance should never try to acquire the input mutex. - *

- * @type {boolean} - */ - enabled:boolean; - /** - * - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Gets the installed {@link yfiles.input.ConcurrencyController}. - * @protected - * @type {yfiles.input.ConcurrencyController} - */ - controller:yfiles.input.ConcurrencyController; - /** - * Adds the given listener for the PopulateMenu event that occurs when the context menu is about to be shown. - *

- * Handlers of the event can populate their context menu, set the {@link yfiles.input.PopulateMenuEventArgs#showMenu} and set or respect the {@link yfiles.input.PopulateMenuEventArgs#handled} property. Note that all handlers - * will be called, even if one of them sets the {@link yfiles.input.PopulateMenuEventArgs#handled} property to - * true. Every handler should query this property and decide carefully what to do. - *

- * @param listener The listener to add. - * @see yfiles.input.ContextMenuInputMode#removePopulateMenuListener - */ - addPopulateMenuListener(listener:(sender:any,evt:yfiles.input.PopulateMenuEventArgs)=>void):void; - /** - * Removes the given listener for the PopulateMenu event that occurs when the context menu is about to be shown. - *

- * Handlers of the event can populate their context menu, set the {@link yfiles.input.PopulateMenuEventArgs#showMenu} and set or respect the {@link yfiles.input.PopulateMenuEventArgs#handled} property. Note that all handlers - * will be called, even if one of them sets the {@link yfiles.input.PopulateMenuEventArgs#handled} property to - * true. Every handler should query this property and decide carefully what to do. - *

- * @param listener The listener to remove. - * @see yfiles.input.ContextMenuInputMode#addPopulateMenuListener - */ - removePopulateMenuListener(listener:(sender:any,evt:yfiles.input.PopulateMenuEventArgs)=>void):void; - /** - * Gets or sets an {@link yfiles.input.IHitTestable} that determines whether it is valid to open a context menu at the queried - * position. - *

- * If the instance yields false {@link yfiles.input.ContextMenuInputMode#onMenuOpening} will not be queried and the context menu - * will not be shown. By default there is a hit testable instance that always yields true. - *

- * @type {yfiles.input.IHitTestable} - */ - validMenuLocationHitTestable:yfiles.input.IHitTestable; - /** - * Gets or sets a value that determines whether clicks are swallowed if they happen within a short amount of time after a - * context menu was closed. - *

- * This is especially useful to cancel the menu by clicking somewhere outside the menu without creating a node. The default - * is true. - *

- * @type {boolean} - */ - swallowCloseClick:boolean; - /** - * Adds the given listener for the CloseMenu event that occurs when this instance requests closing an open context menu. - *

- * Custom context menus must be closed in response to this event. - *

- * @param listener The listener to add. - * @see yfiles.input.ContextMenuInputMode#menuClosed - * @see yfiles.input.ContextMenuInputMode#removeCloseMenuListener - */ - addCloseMenuListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the CloseMenu event that occurs when this instance requests closing an open context - * menu. - *

- * Custom context menus must be closed in response to this event. - *

- * @param listener The listener to remove. - * @see yfiles.input.ContextMenuInputMode#menuClosed - * @see yfiles.input.ContextMenuInputMode#addCloseMenuListener - */ - removeCloseMenuListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.ContextMenuInputMode; - } - /** - * This is an input mode handling drag and drop related events on a {@link yfiles.view.CanvasComponent}. - *

- * An instance of DropInputMode is initialized for an expected data format in the constructor. There are four events raised - * by an instance of this class. - *

- *
    - *
  • - * {@link yfiles.input.DropInputMode#addDragEnteredListener DragEntered} is raised, if a drag operation enters the - * {@link yfiles.view.CanvasComponent}. - *
  • - *
  • - * {@link yfiles.input.DropInputMode#addDragOverListener DragOver} is raised, if a drag operation moves over the - * {@link yfiles.view.CanvasComponent} after having entered it. - *
  • - *
  • - * {@link yfiles.input.DropInputMode#addDragDroppedListener DragDropped} is raised, if a drag is dropped onto the - * {@link yfiles.view.CanvasComponent}. - *
  • - *
  • - * {@link yfiles.input.DropInputMode#addDragLeftListener DragLeft} is raised, if a drag is operation leaves the - * {@link yfiles.view.CanvasComponent}. - *
  • - *
- *

- * Clients can query the current {@link yfiles.input.DropInputMode#mousePosition} which is updated while a drag is in progress. Clients get the data from the drag - * operation by calling {@link yfiles.input.DropInputMode#dropData} from an event handler registered for any of these events. - *

- *

- * This mode is {@link yfiles.input.DropInputMode#exclusive} by default. - *

- * @class - * @implements {yfiles.input.IInputMode} - */ - export interface DropInputMode extends yfiles.lang.Object,yfiles.input.IInputMode{} - export class DropInputMode { - /** - * Initializes a new instance of the {@link yfiles.input.DropInputMode} class for the expected data format. - *

- * This instance fires events only if a drag operation carries data of the expected format. - *

- * @param expectedFormat This is a format that is used in {@link #getData}. - * @see yfiles.input.DropInputMode#addDragEnteredListener - * @see yfiles.input.DropInputMode#addDragDroppedListener - */ - constructor(expectedFormat:string); - /** - * Callback that adjusts the effect accordingly. - * @param evt - * @returns - * @protected - */ - adjustEffect(evt:yfiles.view.DragEventArgs):boolean; - /** - * Cleanly cancels this mode. - */ - cancel():void; - /** - * Helper method that yields a suitably configured {@link yfiles.input.InputModeEventArgs} for this input mode. - * @returns An input mode event argument that is configured for this instance. - * @protected - */ - createInputModeEventArgs():yfiles.input.InputModeEventArgs; - /** - * Installs this mode into the given canvas. - *

- * Clients should not call this method as this is handled by the framework. - *

- * @param context the context to install this mode into - * @param controller The {@link #controller} for this mode. - * @see yfiles.view.CanvasComponent - */ - install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; - /** - * Called after {@link yfiles.input.DropInputMode#cancel} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been canceled. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onCanceled():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been activated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerActivated():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerDeactivated():void; - /** - * Called once a drag has been dropped on the canvas. - * @param evt - * @protected - */ - onDragDropped(evt:yfiles.input.InputModeEventArgs):void; - /** - * Called once a drag has entered the canvas. - * @param evt - * @protected - */ - onDragEntered(evt:yfiles.input.InputModeEventArgs):void; - /** - * Called whenever a drag is over the canvas. - * @param evt - * @protected - */ - onDraggedOver(evt:yfiles.input.InputModeEventArgs):void; - /** - * Called once a drag has left the canvas. - * @param evt - * @protected - */ - onDragLeft(evt:yfiles.input.InputModeEventArgs):void; - /** - * Called after {@link yfiles.input.DropInputMode#tryStop} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been stopped. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onStopped():void; - /** - * This method updates the {@link yfiles.input.DropInputMode#mousePosition} according to the coordinates passed in. - *

- * It is called prior to the {@link yfiles.input.DropInputMode#onDragEntered}, {@link yfiles.input.DropInputMode#onDraggedOver}, {@link yfiles.input.DropInputMode#onDragDropped} - * and {@link yfiles.input.DropInputMode#onDragLeft} methods. - *

- * @param location The current location of the mouse in world coordinates. - * @protected - */ - setDragLocation(location:yfiles.geometry.Point):void; - /** - * Overridden to only return true if this instance does not currently {@link yfiles.input.ConcurrencyController#hasMutex have the input mutex}. - * @returns true iff this instance does not {@link #hasMutex own the mutex}. - */ - tryStop():boolean; - /** - * Uninstalls this mode from the canvas. - *

- * Clients should not call this method as this is handled by the framework. - *

- * @param context the context - */ - uninstall(context:yfiles.input.IInputModeContext):void; - /** - * - * @type {number} - */ - priority:number; - /** - * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. - *

- * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.DropInputMode#controller}. - *

- *

- * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} - * will be deactivated. Otherwise it will always run concurrently with all other modes. - *

- * @type {boolean} - */ - exclusive:boolean; - /** - * Gets or sets the enabled state of this input mode. - *

- * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed - * {@link yfiles.input.DropInputMode#controller} so a disabled instance should never try to acquire the input mutex. - *

- * @type {boolean} - */ - enabled:boolean; - /** - * - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Gets the installed {@link yfiles.input.DropInputMode#controller}. - * @protected - * @type {yfiles.input.ConcurrencyController} - */ - controller:yfiles.input.ConcurrencyController; - /** - * Adds the given listener for the DragEntered event that occurs when a drag operation enters the {@link yfiles.view.CanvasComponent} - * into which this instance is installed. - *

- * No event is raised - *

- *
    - *
  • if this instance is not {@link yfiles.input.DropInputMode#enabled},
  • - *
  • if another concurrent input mode is active or
  • - *
  • the data from the drag operation does not conform to the expected format.
  • - *
- *

- * To get additional data for the event, clients should use the sender which is set to the sending - * {@link yfiles.input.DropInputMode}. The {@link yfiles.lang.EventArgs} provide no useful data. - *

- * @param listener The listener to add. - * @see yfiles.input.DropInputMode#removeDragEnteredListener - */ - addDragEnteredListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragEntered event that occurs when a drag operation enters the {@link yfiles.view.CanvasComponent} - * into which this instance is installed. - *

- * No event is raised - *

- *
    - *
  • if this instance is not {@link yfiles.input.DropInputMode#enabled},
  • - *
  • if another concurrent input mode is active or
  • - *
  • the data from the drag operation does not conform to the expected format.
  • - *
- *

- * To get additional data for the event, clients should use the sender which is set to the sending - * {@link yfiles.input.DropInputMode}. The {@link yfiles.lang.EventArgs} provide no useful data. - *

- * @param listener The listener to remove. - * @see yfiles.input.DropInputMode#addDragEnteredListener - */ - removeDragEnteredListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragOver event that occurs when a drag operation drags over the {@link yfiles.view.CanvasComponent} - * into which this instance is installed. - *

- * No event is raised - *

- *
    - *
  • if this instance is not {@link yfiles.input.DropInputMode#enabled},
  • - *
  • if another concurrent input mode is active or
  • - *
  • the data from the drag operation does not conform to the expected format.
  • - *
- *

- * To get additional data for the event, clients should use the sender which is set to the sending - * {@link yfiles.input.DropInputMode}. The {@link yfiles.lang.EventArgs} provide no useful data. - *

- * @param listener The listener to add. - * @see yfiles.input.DropInputMode#removeDragOverListener - */ - addDragOverListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragOver event that occurs when a drag operation drags over the {@link yfiles.view.CanvasComponent} - * into which this instance is installed. - *

- * No event is raised - *

- *
    - *
  • if this instance is not {@link yfiles.input.DropInputMode#enabled},
  • - *
  • if another concurrent input mode is active or
  • - *
  • the data from the drag operation does not conform to the expected format.
  • - *
- *

- * To get additional data for the event, clients should use the sender which is set to the sending - * {@link yfiles.input.DropInputMode}. The {@link yfiles.lang.EventArgs} provide no useful data. - *

- * @param listener The listener to remove. - * @see yfiles.input.DropInputMode#addDragOverListener - */ - removeDragOverListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragLeft event that occurs when a drag operation leaves the {@link yfiles.view.CanvasComponent} - * into which this instance is installed. - *

- * No event is raised - *

- *
    - *
  • if this instance is not {@link yfiles.input.DropInputMode#enabled},
  • - *
  • if another concurrent input mode is active or
  • - *
  • the data from the drag operation does not conform to the expected format.
  • - *
- *

- * To get additional data for the event, clients should use the sender which is set to the sending - * {@link yfiles.input.DropInputMode}. The {@link yfiles.lang.EventArgs} provide no useful data. - *

- * @param listener The listener to add. - * @see yfiles.input.DropInputMode#removeDragLeftListener - */ - addDragLeftListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragLeft event that occurs when a drag operation leaves the {@link yfiles.view.CanvasComponent} - * into which this instance is installed. - *

- * No event is raised - *

- *
    - *
  • if this instance is not {@link yfiles.input.DropInputMode#enabled},
  • - *
  • if another concurrent input mode is active or
  • - *
  • the data from the drag operation does not conform to the expected format.
  • - *
- *

- * To get additional data for the event, clients should use the sender which is set to the sending - * {@link yfiles.input.DropInputMode}. The {@link yfiles.lang.EventArgs} provide no useful data. - *

- * @param listener The listener to remove. - * @see yfiles.input.DropInputMode#addDragLeftListener - */ - removeDragLeftListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragDropped event that occurs when a drag operation is dropped onto the {@link yfiles.view.CanvasComponent} - * into which this instance is installed. - *

- * No event is raised - *

- *
    - *
  • if this instance is not {@link yfiles.input.DropInputMode#enabled},
  • - *
  • if another concurrent input mode is active or
  • - *
  • the data from the drag operation does not conform to the expected format.
  • - *
- *

- * To get additional data for the event, clients should use the sender which is set to the sending - * {@link yfiles.input.DropInputMode}. The {@link yfiles.lang.EventArgs} provide no useful data. - *

- * @param listener The listener to add. - * @see yfiles.input.DropInputMode#removeDragDroppedListener - */ - addDragDroppedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragDropped event that occurs when a drag operation is dropped onto the {@link yfiles.view.CanvasComponent} - * into which this instance is installed. - *

- * No event is raised - *

- *
    - *
  • if this instance is not {@link yfiles.input.DropInputMode#enabled},
  • - *
  • if another concurrent input mode is active or
  • - *
  • the data from the drag operation does not conform to the expected format.
  • - *
- *

- * To get additional data for the event, clients should use the sender which is set to the sending - * {@link yfiles.input.DropInputMode}. The {@link yfiles.lang.EventArgs} provide no useful data. - *

- * @param listener The listener to remove. - * @see yfiles.input.DropInputMode#addDragDroppedListener - */ - removeDragDroppedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Gets or sets the {@link yfiles.view.DragDropEffects} that will be used for drags on the canvas. - * @type {yfiles.view.DragDropEffects} - */ - dragDropEffect:yfiles.view.DragDropEffects; - /** - * Gets or sets the {@link yfiles.input.IHitTestable} that determines whether the given location is a valid drop location. - * @type {yfiles.input.IHitTestable} - */ - validDropHitTestable:yfiles.input.IHitTestable; - /** - * Gets the last processed drag event argument. - * @type {yfiles.view.DragEventArgs} - */ - lastDragEventArgs:yfiles.view.DragEventArgs; - /** - * Gets the current mouse position during drag operations. - *

- * The position is returned in world coordinates according to the {@link yfiles.view.CanvasComponent} into which this input mode is - * installed. - *

- * @type {yfiles.geometry.IPoint} - */ - mousePosition:yfiles.geometry.IPoint; - /** - * Gets the mouse position after dropping an item. - *

- * The position is returned in world coordinates according to the {@link yfiles.view.CanvasComponent} into which this input mode is - * installed. - *

- * @type {yfiles.geometry.Point} - */ - dropLocation:yfiles.geometry.Point; - /** - * Gets the data carried by a drag operation. - *

- * This is only valid, if a drag entered the {@link yfiles.view.CanvasComponent} first. - *

- * @type {any} - */ - dropData:any; - /** - * Gets or sets a value indicating whether to capture mouse input during drag operations. - *

- * The default is true and thus prevents mouse events from being processed by visuals in the canvas. - *

- * @default true - * @type {boolean} - */ - captureMouseInputDuringDrag:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.DropInputMode; - } - /** - * An {@link yfiles.input.IInputMode} that can be added to a {@link yfiles.input.MultiplexingInputMode} to suppress other modes from doing - * unwanted things if the control has just become focused. - *

- * This mode requests the input mutex once the canvas gains focus. It returns the mutex after the mode has regained focus - * and the mouse has been clicked or 100 milliseconds have passed. This mode should be registered with the {@link yfiles.input.MultiplexingInputMode} - * using the {@link yfiles.input.MultiplexingInputMode#add} method and a large priority number (e.g. - * 1000). So that other modes don't receive the input mutex once this one has released the mutex. - *

- *

- * This mode is {@link yfiles.input.ConcurrencyController#exclusive} by default. - *

- * @class - * @implements {yfiles.input.IInputMode} - */ - export interface FocusGuardInputMode extends yfiles.lang.Object,yfiles.input.IInputMode{} - export class FocusGuardInputMode { - /** - * Creates a new instance of this mode. - */ - constructor(); - /** - * - */ - cancel():void; - /** - * Installs this mode into the given context that is provided by the canvas. - *

- * In general a mode can only be installed into a single canvas at all times. - *

- *

- * This method is called to initialize this instance. Subclasses should override this method to register the corresponding - * event handler delegates for the various input events they need to register with. - *

- *

- * Overriding implementations should call the base implementation, first. - *

- * @param context The context that this instance shall be installed into. The same instance will be passed to this instance during - * {@link #uninstall}. A reference to the context may be kept and queried during the time the mode is - * installed. - * @param controller The {@link #controller} for this mode. - * @see yfiles.input.IInputMode#uninstall - */ - install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; - /** - * Called after {@link yfiles.input.FocusGuardInputMode#cancel} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been canceled. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onCanceled():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been activated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerActivated():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerDeactivated():void; - /** - * Called after {@link yfiles.input.FocusGuardInputMode#tryStop} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been stopped. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onStopped():void; - /** - * - * @returns - */ - tryStop():boolean; - /** - * Uninstalls this mode from the given context. - *

- * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} method. After a mode has - * been uninstalled it can be installed again into the same or another canvas. - *

- *

- * Overriding implementations should call the base implementation after their own code. - *

- * @param context The context to deregister from. This is the same instance that had been passed to {@link #install} during - * installation. - */ - uninstall(context:yfiles.input.IInputModeContext):void; - /** - * - * @type {number} - */ - priority:number; - /** - * Gets or sets the enabled state of this input mode. - *

- * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed - * {@link yfiles.input.FocusGuardInputMode#controller} so a disabled instance should never try to acquire the input mutex. - *

- * @type {boolean} - */ - enabled:boolean; - /** - * - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Gets the installed {@link yfiles.input.FocusGuardInputMode#controller}. - * @protected - * @type {yfiles.input.ConcurrencyController} - */ - controller:yfiles.input.ConcurrencyController; - /** - * Gets or sets the {@link yfiles.view.Cursor} that will be shown during active guards. - *

- * The default is {@link yfiles.view.Cursor#DEFAULT} - *

- * @type {yfiles.view.Cursor} - */ - guardCursor:yfiles.view.Cursor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.FocusGuardInputMode; - } - /** - * An {@link yfiles.input.IInputMode} implementation that can handle a collection of {@link yfiles.input.IHandle}s. - *

- * This mode will render a visual representation of {@link yfiles.input.IHandle}s in the {@link yfiles.view.CanvasComponent} and deal with - * mouse gestures that drag the visual representations accordingly. - *

- *

- * This mode is {@link yfiles.input.HandleInputMode#exclusive} by default. - *

- * @see yfiles.input.IHandle - * @class - * @implements {yfiles.input.IInputMode} - */ - export interface HandleInputMode extends yfiles.lang.Object,yfiles.input.IInputMode{} - export class HandleInputMode { - /** - * Creates a new mode with no handles initially. - * @see yfiles.input.HandleInputMode#handles - */ - constructor(); - /** - * Adds a handle to the collection of handles managed by this instance. - * @param handle The handle to add. - */ - addHandle(handle:yfiles.input.IHandle):void; - /** - * Factory method that creates and {@link yfiles.input.HandleInputMode#addHandle adds} a handle to this mode by wrapping a given {@link yfiles.geometry.IMutablePoint} instance. - *

- * The cursor and type are used to initialize the {@link yfiles.input.IHandle} instance. - *

- * @param location The point to use as a handle. - * @param [cursor=null] The cursor to use. - * @param [type=yfiles.input.HandleTypes.DEFAULT] The type of the handle to create. - * @returns The handle created. - */ - addHandle(location:yfiles.geometry.IMutablePoint,cursor?:yfiles.view.Cursor,type?:yfiles.input.HandleTypes):yfiles.input.IHandle; - /** - * Factory method that creates and {@link yfiles.input.HandleInputMode#addHandle adds} a handle to this mode by wrapping a given {@link yfiles.geometry.IMutablePoint} instance. - *

- * The cursor and type are used to initialize the {@link yfiles.input.IHandle} instance. - *

- * @param {Object} options The parameters to pass. - * @param options.location The point to use as a handle. - * @param [options.cursor=null] The cursor to use. - * @param [options.type=yfiles.input.HandleTypes.DEFAULT] The type of the handle to create. - * @returns The handle created. - */ - addHandle(options:{location:yfiles.geometry.IMutablePoint,cursor?:yfiles.view.Cursor,type?:yfiles.input.HandleTypes}):yfiles.input.IHandle; - /** - * Callback method that is invoked when this mode gets "armed". - *

- * This happens when the mouse pointer hovers over a handle. This changes the mouse cursor to the handle's {@link yfiles.input.IHandle#cursor}. - *

- * @param handle - * @protected - */ - arm(handle:yfiles.input.IHandle):void; - /** - * Method that can be used to initialize the dragging of a given handle by hand. - *

- * This will simulate the user having initialized a drag of the given handle. - *

- * @param handle The handle to be dragged. - */ - beginDragging(handle:yfiles.input.IHandle):void; - /** - * - */ - cancel():void; - /** - * Creates an {@link yfiles.input.IInputModeContext} for use with the {@link yfiles.input.IHandle} interface for the upcoming drag - * operation. - * @returns An instance of {@link }. - * @protected - */ - createHandleInputModeContext():yfiles.input.IInputModeContext; - /** - * Helper method that yields a suitably configured {@link yfiles.input.InputModeEventArgs} for this input mode. - * @returns An input mode event argument that is configured for this instance. - * @protected - */ - createInputModeEventArgs():yfiles.input.InputModeEventArgs; - /** - * Callback that creates the {@link yfiles.view.Visual} for the given handle. - * @param handle The handle to create a visual representation for. - * @param context - * @returns The {@link }. - * @protected - */ - createVisual(context:yfiles.view.IRenderContext,handle:yfiles.input.IHandle):yfiles.view.SvgVisual; - /** - * Callback method that is invoked when this mode gets "disarmed". - *

- * This happens when the mouse stops hovering over a handle. This resets the mouse cursor - *

- * @protected - */ - disarm():void; - /** - * Finds the closest hit handle for the given world coordinate pair. - *

- * The default implementation compares the manhatten distance of the handles to find the closest handle. - *

- * @param location The coordinates in the world coordinate system. - * @returns The closest handle that has been hit or null - * @protected - */ - getClosestHitHandle(location:yfiles.geometry.Point):yfiles.input.IHandle; - /** - * Finds the closest hit handle for the given world coordinate pair. - * @param location The coordinates in the world coordinate system. - * @returns The closest handle that has been hit or null - * @protected - */ - getClosestHitHandleTouch(location:yfiles.geometry.Point):yfiles.input.IHandle; - /** - * Determines whether a given handle has been visually hit by the mouse at the given world coordinates. - *

- * This implementation uses the manhatten distance as a metric to determine if the handle was hit. - *

- * @param handle The handle to check - * @param location The view coordinates to check. - * @param distance The distance of the handle to the location. In the default implementation, this is a tuple representing the x- and - * y-distance of the handle to the location. - * @returns Whether the handle has been hit. - * @protected - */ - handleIsHit(handle:yfiles.input.IHandle,location:yfiles.geometry.Point,distance:yfiles.geometry.Point):boolean; - /** - * Determines whether a given handle has been visually hit by the touch device at the given world coordinates. - * @param handle The handle to check - * @param location The world coordinates to check. - * @param distance The distance of the handle to the touch location. In the default implementation, this is a tuple representing the x- and - * y-distance of the handle to the touch location. - * @returns Whether the handle has been hit. - * @protected - */ - handleIsHitTouch(handle:yfiles.input.IHandle,location:yfiles.geometry.Point,distance:yfiles.geometry.Point):boolean; - /** - * Installs the visual representation of the handles into the canvas into the {@link yfiles.view.CanvasComponent#inputModeGroup}. - * @param context - * @param controller - */ - install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; - /** - * Convenience method that invalidates the canvas this mode is currently installed in. - * @protected - */ - invalidate():void; - /** - * Event recognizer callback used to determine whether the mouse is currently hovering over a handle. - * @param sender - * @param evt - * @returns Whether the mouse is hovering over handle. - * @see yfiles.input.HandleInputMode#getClosestHitHandle - * @protected - */ - isHovering(sender:any,evt:yfiles.lang.EventArgs):boolean; - /** - * Called after {@link yfiles.input.HandleInputMode#cancel} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been canceled. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onCanceled():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been activated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerActivated():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerDeactivated():void; - /** - * Triggers the {@link yfiles.input.HandleInputMode#addDragCanceledListener DragCanceled} event. - * @param evt The event argument that contains context information. - * @protected - */ - onDragCanceled(evt:yfiles.input.InputModeEventArgs):void; - /** - * Triggers the {@link yfiles.input.HandleInputMode#addDragCancelingListener DragCanceling} event. - * @param evt The event argument that contains context information. - * @protected - */ - onDragCanceling(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered once the drag has been finalized. - *

- * This method triggers the {@link yfiles.input.HandleInputMode#addDragFinishedListener DragFinished} event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragFinished(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered before the drag will be finalized. - *

- * This method triggers the {@link yfiles.input.HandleInputMode#addDragFinishingListener DragFinishing} event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragFinishing(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered at the end of each drag. - *

- * This method triggers the {@link yfiles.input.HandleInputMode#addDraggedListener Dragged} event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragged(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered at the start of each drag. - *

- * This method triggers the {@link yfiles.input.HandleInputMode#addDraggingListener Dragging} event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragging(evt:yfiles.input.InputModeEventArgs):void; - /** - * Triggers the {@link yfiles.input.HandleInputMode#addDragStartedListener DragStarted} event. - * @param evt The event argument that contains context information. - * @protected - */ - onDragStarted(evt:yfiles.input.InputModeEventArgs):void; - /** - * Triggers the {@link yfiles.input.HandleInputMode#addDragStartingListener DragStarting} event. - * @param evt The event argument that contains context information. - * @protected - */ - onDragStarting(evt:yfiles.input.InputModeEventArgs):void; - /** - * Called after {@link yfiles.input.HandleInputMode#tryStop} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been stopped. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onStopped():void; - /** - * Removes a handle from the collection of handles managed by this instance. - * @param handle The handle to remove. - */ - removeHandle(handle:yfiles.input.IHandle):void; - /** - * - * @returns - */ - tryStop():boolean; - /** - * Removes the {@link yfiles.view.ICanvasObject} that displays the handles from the canvas. - * @param context - */ - uninstall(context:yfiles.input.IInputModeContext):void; - /** - * - * @type {number} - */ - priority:number; - /** - * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. - *

- * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.HandleInputMode#controller}. - *

- *

- * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} - * will be deactivated. Otherwise it will always run concurrently with all other modes. - *

- * @type {boolean} - */ - exclusive:boolean; - /** - * Gets or sets the enabled state of this input mode. - *

- * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed - * {@link yfiles.input.HandleInputMode#controller} so a disabled instance should never try to acquire the input mutex. - *

- *

- * Disabling this mode will hide the handles and prevent the user from interacting with them. - *

- * @type {boolean} - */ - enabled:boolean; - /** - * - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Gets the installed {@link yfiles.input.HandleInputMode#controller}. - * @protected - * @type {yfiles.input.ConcurrencyController} - */ - controller:yfiles.input.ConcurrencyController; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#DEFAULT}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_DEFAULT_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#MOVE}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_MOVE_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#RESIZE}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_RESIZE_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#ROTATE}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_ROTATE_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#SHEAR}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_SHEAR_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#INVISIBLE}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_INVISIBLE_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#INVISIBLE} | - * {@link yfiles.input.HandleTypes#VARIANT2}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_INVISIBLE_VARIANT2_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#INVISIBLE} | - * {@link yfiles.input.HandleTypes#VARIANT3}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_INVISIBLE_VARIANT3_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#INVISIBLE} | - * {@link yfiles.input.HandleTypes#VARIANT4}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_INVISIBLE_VARIANT4_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} H{@link yfiles.input.HandleTypes#DEFAULT} | - * {@link yfiles.input.HandleTypes#VARIANT2}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_DEFAULT_VARIANT2_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#MOVE} | - * {@link yfiles.input.HandleTypes#VARIANT2}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_MOVE_VARIANT2_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#RESIZE} | - * {@link yfiles.input.HandleTypes#VARIANT2} - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_RESIZE_VARIANT2_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#ROTATE} | - * {@link yfiles.input.HandleTypes#VARIANT2}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_ROTATE_VARIANT2_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#SHEAR} | - * {@link yfiles.input.HandleTypes#VARIANT2}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_SHEAR_VARIANT2_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#DEFAULT} | - * {@link yfiles.input.HandleTypes#VARIANT3}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_DEFAULT_VARIANT3_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#MOVE} | - * {@link yfiles.input.HandleTypes#VARIANT3}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_MOVE_VARIANT3_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#RESIZE} | - * {@link yfiles.input.HandleTypes#VARIANT3}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_RESIZE_VARIANT3_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#ROTATE} | - * {@link yfiles.input.HandleTypes#VARIANT3}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_ROTATE_VARIANT3_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#SHEAR} | - * {@link yfiles.input.HandleTypes#VARIANT3}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_SHEAR_VARIANT3_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#DEFAULT} | - * {@link yfiles.input.HandleTypes#VARIANT4}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_DEFAULT_VARIANT4_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#MOVE} | - * {@link yfiles.input.HandleTypes#VARIANT4}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_MOVE_VARIANT4_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#RESIZE} | - * {@link yfiles.input.HandleTypes#VARIANT4}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_RESIZE_VARIANT4_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#ROTATE} | - * {@link yfiles.input.HandleTypes#VARIANT4}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_ROTATE_VARIANT4_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#SHEAR} | - * {@link yfiles.input.HandleTypes#VARIANT4}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_SHEAR_VARIANT4_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#WARP}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_WARP_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#WARP} | - * {@link yfiles.input.HandleTypes#VARIANT2}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_WARP_VARIANT2_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#WARP} | - * {@link yfiles.input.HandleTypes#VARIANT3}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_WARP_VARIANT3_KEY:string; - /** - * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will - * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#WARP} | - * {@link yfiles.input.HandleTypes#VARIANT4}. - *

- * The drawing returned should be centered around (0,0). - *

- * @const - * @static - * @type {string} - */ - static HANDLE_DRAWING_WARP_VARIANT4_KEY:string; - /** - * Gets or sets event recognizer that recognizes when the user temporarily disables snapping. - * @see yfiles.input.HandleInputMode#enableSnappingRecognizer - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - disableSnappingRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets event recognizer that recognizes when the user reenables temporarily disabled snapping. - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - enableSnappingRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "pressed" state recognizer. - *

- * This recognizer instance will be used to determine when the user begins to move a handle. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - pressedRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "dragged" recognizer. - *

- * This recognizer instance determines when the user is moving a handle. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - draggedRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "cancel" recognizer. - *

- * This recognizer recognizes the cancel action during the move. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - cancelRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "released" recognizer. - *

- * This instance determines when the user has finished moving the handle. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - releasedRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "pressed" state recognizer for touch input. - *

- * This recognizer instance will be used to determine when the user begins to move a handle. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - pressedRecognizerTouch:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "dragged" recognizer for touch input. - *

- * This recognizer instance determines when the user is moving a handle. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - draggedRecognizerTouch:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "released" recognizer for touch input. - *

- * This instance determines when the user has finished moving the handle. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - releasedRecognizerTouch:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the collection of {@link yfiles.input.IHandle}s this mode manages. - * @type {yfiles.collections.IObservableCollection.} - */ - handles:yfiles.collections.IObservableCollection; - /** - * Gets or sets the {@link yfiles.input.HandleInputMode#snapContext} which manages snapping model items to certain coordinates (for instance, other items). - *

- * If set to null (the default) this input mode tries to obtain the {@link yfiles.input.HandleInputMode#snapContext} from the {@link yfiles.input.IInputModeContext}. To explicitly - * disable snapping, a {@link yfiles.input.HandleInputMode#snapContext} implementation that does nothing has to be set to this instance. - *

- * @type {yfiles.input.SnapContext} - */ - snapContext:yfiles.input.SnapContext; - /** - * Gets the handle that is currently being moved or null otherwise. - * @type {yfiles.input.IHandle} - */ - currentHandle:yfiles.input.IHandle; - /** - * Gets an immutable snapshot of the {@link yfiles.graph.IModelItem}s affected by the currently modified {@link yfiles.input.HandleInputMode#currentHandle handle} gesture. - *

- * When the gesture is {@link yfiles.input.HandleInputMode#addDragStartingListener starting} and the {@link yfiles.input.HandleInputMode#currentHandle} is {@link yfiles.input.IDragHandler#initializeDrag initialized}, the implementation can {@link yfiles.input.IModelItemCollector#add register} the affected item(s) through the {@link yfiles.input.IModelItemCollector} - * instance that is bound to the {@link yfiles.input.HandleInputMode#createHandleInputModeContext context} available via its {@link yfiles.graph.ILookup#lookup}. - *

- *

- * Client code can register with the {@link yfiles.input.HandleInputMode#addDragStartedListener DragStarted} - * event, as well as the {@link yfiles.input.HandleInputMode#addDragFinishedListener DragFinished} event to get - * notified of the elements that may be or have been affected respectively by this input mode. - *

- * @type {yfiles.collections.IEnumerable.} - */ - affectedItems:yfiles.collections.IEnumerable; - /** - * Adds the given listener for the DragFinishing event that occurs before the drag will be finished. - * @param listener The listener to add. - * @see yfiles.input.HandleInputMode#removeDragFinishingListener - */ - addDragFinishingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragFinishing event that occurs before the drag will be finished. - * @param listener The listener to remove. - * @see yfiles.input.HandleInputMode#addDragFinishingListener - */ - removeDragFinishingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragFinished event that occurs once the drag has been finished. - * @param listener The listener to add. - * @see yfiles.input.HandleInputMode#removeDragFinishedListener - */ - addDragFinishedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragFinished event that occurs once the drag has been finished. - * @param listener The listener to remove. - * @see yfiles.input.HandleInputMode#addDragFinishedListener - */ - removeDragFinishedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragStarting event that occurs once the drag is starting. - * @param listener The listener to add. - * @see yfiles.input.HandleInputMode#removeDragStartingListener - */ - addDragStartingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragStarting event that occurs once the drag is starting. - * @param listener The listener to remove. - * @see yfiles.input.HandleInputMode#addDragStartingListener - */ - removeDragStartingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragStarted event that occurs once the drag is initialized and has started. - * @param listener The listener to add. - * @see yfiles.input.HandleInputMode#removeDragStartedListener - */ - addDragStartedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragStarted event that occurs once the drag is initialized and has started. - * @param listener The listener to remove. - * @see yfiles.input.HandleInputMode#addDragStartedListener - */ - removeDragStartedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the Dragging event that occurs at the start of every drag. - * @param listener The listener to add. - * @see yfiles.input.HandleInputMode#removeDraggingListener - */ - addDraggingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the Dragging event that occurs at the start of every drag. - * @param listener The listener to remove. - * @see yfiles.input.HandleInputMode#addDraggingListener - */ - removeDraggingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the Dragged event that occurs at the end of every drag. - * @param listener The listener to add. - * @see yfiles.input.HandleInputMode#removeDraggedListener - */ - addDraggedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the Dragged event that occurs at the end of every drag. - * @param listener The listener to remove. - * @see yfiles.input.HandleInputMode#addDraggedListener - */ - removeDraggedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragCanceled event that occurs when the drag has been canceled. - * @param listener The listener to add. - * @see yfiles.input.HandleInputMode#removeDragCanceledListener - */ - addDragCanceledListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragCanceled event that occurs when the drag has been canceled. - * @param listener The listener to remove. - * @see yfiles.input.HandleInputMode#addDragCanceledListener - */ - removeDragCanceledListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragCanceling event that occurs before the drag will be canceled. - * @param listener The listener to add. - * @see yfiles.input.HandleInputMode#removeDragCancelingListener - */ - addDragCancelingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragCanceling event that occurs before the drag will be canceled. - * @param listener The listener to remove. - * @see yfiles.input.HandleInputMode#addDragCancelingListener - */ - removeDragCancelingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.HandleInputMode; - } - /** - * Interface for an object that can be used to drag something displayed in a {@link yfiles.view.CanvasComponent} - *

- * Items can be dragged with the mouse and an instance of this class will modify their position accordingly. A drag will - * trigger the invocation of {@link yfiles.input.IDragHandler#initializeDrag}, zero or more {@link yfiles.input.IDragHandler#handleMove} - * calls, and will be finalized by either {@link yfiles.input.IDragHandler#dragFinished} or {@link yfiles.input.IDragHandler#cancelDrag}. - *

- *

Related demos:

- *
    - *
  • Demo: PositionHandler, demo.yfiles.input.positionhandler
  • - *
- * @see yfiles.input.IPositionHandler - * @see yfiles.input.IHandle - * @see yfiles.input.IInputModeContext - * @interface - */ - export interface IDragHandler extends yfiles.lang.Object{ - /** - * Called by clients to indicate that the dragging has been canceled by the user. - *

- * This method may be called after the initial {@link yfiles.input.IDragHandler#initializeDrag} and zero or more invocations of - * {@link yfiles.input.IDragHandler#handleMove}. Implementations should reset the position of the items they modify to their - * initial state. Alternatively to this method the {@link yfiles.input.IDragHandler#dragFinished} method might be called. - *

- * @param context The context to retrieve information about the drag from. - * @param originalLocation The value of the coordinate of the {@link #location} property at the time of {@link #initializeDrag}. - * @abstract - */ - cancelDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; - /** - * Called by clients to indicate that the repositioning has just been finished. - *

- * This method may be called after the initial {@link yfiles.input.IDragHandler#initializeDrag} and zero or more invocations of - * {@link yfiles.input.IDragHandler#handleMove}. Alternatively to this method the {@link yfiles.input.IDragHandler#cancelDrag} method might - * be called. - *

- * @param context The context to retrieve information about the drag from. - * @param newLocation The coordinates in the world coordinate system that the client wants the handle to be at. Depending on the - * implementation the {@link #location} may or may not be modified to reflect the new value. This is the same value as delivered in the last - * invocation of {@link #handleMove} - * @param originalLocation The value of the {@link #location} property at the time of {@link #initializeDrag}. - * @abstract - */ - dragFinished(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; - /** - * Called by clients to indicate that the element has been dragged and its position should be updated. - *

- * This method may be called more than once after an initial {@link yfiles.input.IDragHandler#initializeDrag} and will the final - * call will be followed by either one {@link yfiles.input.IDragHandler#dragFinished} or one {@link yfiles.input.IDragHandler#cancelDrag} - * call. - *

- * @param context The context to retrieve information about the drag from. - * @param originalLocation The value of the {@link #location} property at the time of {@link #initializeDrag}. - * @param newLocation The coordinates in the world coordinate system that the client wants the handle to be at. Depending on the - * implementation the {@link #location} may or may not be modified to reflect the new value. - * @abstract - */ - handleMove(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; - /** - * Called by clients to indicate that the element is going to be dragged. - *

- * This call will be followed by one or more calls to {@link yfiles.input.IDragHandler#handleMove}, and a final {@link yfiles.input.IDragHandler#dragFinished} - * or {@link yfiles.input.IDragHandler#cancelDrag}. - *

- * @param context The context to retrieve information about the drag from. - * @abstract - */ - initializeDrag(context:yfiles.input.IInputModeContext):void; - /** - * Gets a view of the location of the item. - *

- * The point describes the current world coordinate of the element that can be modified by this handler. - *

- * @abstract - * @type {yfiles.geometry.IPoint} - */ - location:yfiles.geometry.IPoint; - } - var IDragHandler:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IDragHandler; - }; - export enum SnapPolicy{ - /** - * Don't perform snapping. - */ - NO_SNAPPING, - /** - * Snap to the nearest grid coordinate. - */ - TO_NEAREST, - /** - * Snap to the nearest grid coordinate whose value is not less than the current coordinate. - */ - TO_GREATER, - /** - * Snap to the nearest grid coordinate whose value is not greater than the current coordinate. - */ - TO_SMALLER - } - /** - * Interface for classes that can snap coordinates of items of a specific type to a grid. - * Type parameter T: The type of the items this class can snap - * @see yfiles.input.GridConstraintProvider. - * @interface - * @template T - */ - export interface IGridConstraintProvider extends yfiles.lang.Object{ - /** - * Performs the actual snapping to grid coordinates. - * @param context The context in which the snapping should occur. - * @param item The item of which the coordinates should be snapped. - * @param location The coordinates to snap. - * @param xSnapPolicy The policy for the x coordinate. - * @param ySnapPolicy The policy for the y coordinate. - * @returns Whether the point has been snapped. - * @abstract - */ - snapToGrid(context:yfiles.input.IInputModeContext,item:T,location:yfiles.geometry.IMutablePoint,xSnapPolicy:yfiles.input.SnapPolicy,ySnapPolicy:yfiles.input.SnapPolicy):boolean; - /** - * Gets the canonic grid width in horizontal direction. - * @abstract - * @type {number} - */ - horizontalGridWidth:number; - /** - * Gets the canonic grid width in vertical direction. - * @abstract - * @type {number} - */ - verticalGridWidth:number; - /** - * Gets the canonic origin of the grid. - * @abstract - * @type {yfiles.geometry.Point} - */ - gridOrigin:yfiles.geometry.Point; - } - var IGridConstraintProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IGridConstraintProvider; - }; - /** - * A simple integer based implementation of {@link yfiles.input.IGridConstraintProvider.}. - * Type parameter T: The type of the items. - * @class - * @implements {yfiles.input.IGridConstraintProvider.} - * @template T - */ - export interface GridConstraintProvider extends yfiles.lang.Object,yfiles.input.IGridConstraintProvider{} - export class GridConstraintProvider { - /** - * Creates a new instance using the given grid info. - * @param gridInfo The grid info object. - */ - constructor(gridInfo:yfiles.view.GridInfo); - /** - * Creates a new instance using the given grid specification. - * @param gridWidth Width of the grid. - * @param gridHeight Height of the grid. - */ - constructor(gridWidth:number,gridHeight:number); - /** - * Creates a new instance using the given grid distances. - * @param gridSize - */ - constructor(gridSize:number); - /** - * - * @param context - * @param item - * @param location - * @param xSnapPolicy - * @param ySnapPolicy - * @returns - */ - snapToGrid(context:yfiles.input.IInputModeContext,item:T,location:yfiles.geometry.IMutablePoint,xSnapPolicy:yfiles.input.SnapPolicy,ySnapPolicy:yfiles.input.SnapPolicy):boolean; - /** - * Gets or sets the grid info that describes the geometry of the grid. - * @type {yfiles.view.GridInfo} - */ - gridInfo:yfiles.view.GridInfo; - /** - * Gets the grid height. - *

- * This implementation delegates to the {@link yfiles.input.GridConstraintProvider.#gridInfo} - *

- * @type {number} - */ - horizontalGridWidth:number; - /** - * Gets the grid width. - *

- * This implementation delegates to the {@link yfiles.input.GridConstraintProvider.#gridInfo} - *

- * @type {number} - */ - verticalGridWidth:number; - /** - * Gets the grid origin. - *

- * This implementation delegates to the {@link yfiles.input.GridConstraintProvider.#gridInfo} - *

- * @type {yfiles.geometry.Point} - */ - gridOrigin:yfiles.geometry.Point; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.GridConstraintProvider; - } - export enum HandleTypes{ - /** - * A handle which serves a general purpose but should not be displayed. - *

- * This is the basic type of a handle and can be queried using the {@link yfiles.input.HandleTypes#TYPE_MASK}. - *

- */ - INVISIBLE, - /** - * A default handle which serves a general purpose. - *

- * This is the basic type of a handle and can be queried using the {@link yfiles.input.HandleTypes#TYPE_MASK}. - *

- */ - DEFAULT, - /** - * A handle which can be used to resize something. - *

- * This is the basic type of a handle and can be queried using the {@link yfiles.input.HandleTypes#TYPE_MASK}. - *

- */ - RESIZE, - /** - * A handle which can be used to rotate something. - *

- * This is the basic type of a handle and can be queried using the {@link yfiles.input.HandleTypes#TYPE_MASK}. - *

- */ - ROTATE, - /** - * A handle which can be used to move something. - *

- * This is the basic type of a handle and can be queried using the {@link yfiles.input.HandleTypes#TYPE_MASK}. - *

- */ - MOVE, - /** - * A handle which can be used to shear an object. - *

- * This is the basic type of a handle and can be queried using the {@link yfiles.input.HandleTypes#TYPE_MASK}. - *

- */ - SHEAR, - /** - * A handle which can be used to warp an object. - *

- * This is the basic type of a handle and can be queried using the {@link yfiles.input.HandleTypes#TYPE_MASK}. - *

- */ - WARP, - /** - * A bitmask that can be used to query the basic type of a handle type. - * @see yfiles.input.HandleTypes#DEFAULT - * @see yfiles.input.HandleTypes#MOVE - * @see yfiles.input.HandleTypes#RESIZE - * @see yfiles.input.HandleTypes#ROTATE - * @see yfiles.input.HandleTypes#SHEAR - * @see yfiles.input.HandleTypes#WARP - */ - TYPE_MASK, - /** - * A default variant modifier that decorates a basic type. - * @see yfiles.input.HandleTypes#VARIANT_MASK - */ - VARIANT1, - /** - * The second variant modifier that decorates a basic type. - * @see yfiles.input.HandleTypes#VARIANT_MASK - */ - VARIANT2, - /** - * The third variant modifier that decorates a basic type. - * @see yfiles.input.HandleTypes#VARIANT_MASK - */ - VARIANT3, - /** - * The forth variant modifier that decorates a basic type. - * @see yfiles.input.HandleTypes#VARIANT_MASK - */ - VARIANT4, - /** - * A bitmask that can be used to query the variant of a basic handle type. - * @see yfiles.input.HandleTypes#VARIANT1 - * @see yfiles.input.HandleTypes#VARIANT2 - * @see yfiles.input.HandleTypes#VARIANT3 - * @see yfiles.input.HandleTypes#VARIANT4 - */ - VARIANT_MASK, - /** - * A modifier that can be used to tell the rendering engine to render the visual representation of this handle with an - * offset to the north. - * @see yfiles.input.HandleTypes#OFFSET_MASK - */ - OFFSET_NORTH, - /** - * A modifier that can be used to tell the rendering engine to render the visual representation of this handle with an - * offset to the east. - * @see yfiles.input.HandleTypes#OFFSET_MASK - */ - OFFSET_EAST, - /** - * A modifier that can be used to tell the rendering engine to render the visual representation of this handle with an - * offset to the south. - * @see yfiles.input.HandleTypes#OFFSET_MASK - */ - OFFSET_SOUTH, - /** - * A modifier that can be used to tell the rendering engine to render the visual representation of this handle with an - * offset to the west. - * @see yfiles.input.HandleTypes#OFFSET_MASK - */ - OFFSET_WEST, - /** - * A bitmask that can be used to query the offsets of a basic handle type. - * @see yfiles.input.HandleTypes#OFFSET_NORTH - * @see yfiles.input.HandleTypes#OFFSET_EAST - * @see yfiles.input.HandleTypes#OFFSET_SOUTH - * @see yfiles.input.HandleTypes#OFFSET_WEST - */ - OFFSET_MASK - } - export enum HandlePositions{ - /** - * Indicates no position at all. - */ - NONE, - /** - * Indicates the position at north west. - */ - NORTH_WEST, - /** - * Indicates the position at north. - */ - NORTH, - /** - * Indicates the position at north east. - */ - NORTH_EAST, - /** - * Indicates the position at west. - */ - WEST, - /** - * Indicates the position at the center. - */ - CENTER, - /** - * Indicates the position at east. - */ - EAST, - /** - * Indicates the position at south west. - */ - SOUTH_WEST, - /** - * Indicates the position at south. - */ - SOUTH, - /** - * Indicates the position at south east. - */ - SOUTH_EAST, - /** - * A combined bitset of all possible handle positions at the four corners of a rectangle. - */ - CORNERS, - /** - * A combined bitset of the two horizontal handles of a rectangle. - */ - HORIZONTAL, - /** - * A combined bitset of the two vertical handles of a rectangle. - */ - VERTICAL, - /** - * A combined bitset of all possible handle positions at the border of a rectangle. - */ - BORDER, - /** - * A combined bitset of all possible handle positions. - */ - ALL - } - /** - * Interface for a handle that can be displayed in a {@link yfiles.view.CanvasComponent} as a UI element for the user to modify the - * contents of the control. - *

- * Handles can be dragged with the mouse and will thereby modify their context. Typically client code will use the {@link yfiles.input.IDragHandler#location} to - * render a visual handle that can be dragged using the mouse. A drag will trigger the invocation of - * {@link yfiles.input.IDragHandler#initializeDrag}, zero or more {@link yfiles.input.IDragHandler#handleMove} calls, and will be finalized - * by either {@link yfiles.input.IDragHandler#dragFinished} or {@link yfiles.input.IDragHandler#cancelDrag}. - *

- *

Related demos:

- *
    - *
  • Demo: ReshapeHandleProvider, demo.yfiles.input.reshapehandleprovider
  • - *
- * @see yfiles.input.HandleInputMode - * @see yfiles.input.IDragHandler - * @interface - * @implements {yfiles.input.IDragHandler} - */ - export interface IHandle extends yfiles.lang.Object,yfiles.input.IDragHandler{ - /** - * Gets the type of the handle that can be used by the rendering engine to render types differently. - * @abstract - * @type {yfiles.input.HandleTypes} - */ - type:yfiles.input.HandleTypes; - /** - * Gets the cursor to display when the mouse hovers over or drags this handle. - * @abstract - * @type {yfiles.view.Cursor} - */ - cursor:yfiles.view.Cursor; - } - var IHandle:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IHandle; - }; - /** - * Interface for an object that provides a number of {@link yfiles.input.IHandle} implementations. - * @interface - */ - export interface IHandleProvider extends yfiles.lang.Object{ - /** - * Returns a collection of zero or more {@link yfiles.input.IHandle} implementations that are associated with this instance. - * @param context - * @returns A collection of handles. - * @abstract - */ - getHandles(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; - } - var IHandleProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IHandleProvider; - }; - /** - * A specialized version of the {@link yfiles.input.IHandleProvider} interface that can be used to query {@link yfiles.input.IHandle} - * implementation for resizing an object. - *

Related demos:

- *
    - *
  • Demo: ReshapeHandleProvider, demo.yfiles.input.reshapehandleprovider
  • - *
- * @interface - */ - export interface IReshapeHandleProvider extends yfiles.lang.Object{ - /** - * Returns a bitwise combination of all of the {@link yfiles.input.HandlePositions} this interface can provide an implementation - * for. - *

- * Client code will use this method to query the available positions and may then call for each of the positions the {@link yfiles.input.IReshapeHandleProvider#getHandle} - * method to retrieve an implementation. - *

- * @param context The context for which the handles are queried. - * @returns A bitwise combination of all positions the {@link #getHandle} method can be queried for. - * @abstract - */ - getAvailableHandles(context:yfiles.input.IInputModeContext):yfiles.input.HandlePositions; - /** - * Returns an implementation of an {@link yfiles.input.IHandle} for the given position, that can be used to reshape an object. - *

- * This method may be called for each possible single position contained in the set as returned by - * {@link yfiles.input.IReshapeHandleProvider#getAvailableHandles}. - *

- * @param context The context for which the handles are queried. - * @param position The single position a handle implementation should be returned for. - * @returns An implementation of {@link } for the given position. - * @abstract - */ - getHandle(context:yfiles.input.IInputModeContext,position:yfiles.input.HandlePositions):yfiles.input.IHandle; - } - var IReshapeHandleProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IReshapeHandleProvider; - }; - /** - * Interface implemented by input modes that can be registered with a {@link yfiles.view.CanvasComponent} instance. - *

- * Input modes capture user gestures (or any other kind of "input") and manipulate the contents of the scene graph or the - * model behind the scene graph. - *

- *

- * Implementations may request an input mutex from the {@link yfiles.input.ConcurrencyController} that will be given to them in - * their {@link yfiles.input.IInputMode#install} method. This allows them to exclusively modify the contents of the view. If - * another {@link yfiles.input.IInputMode} successfully acquires the mutex, the {@link yfiles.input.ConcurrencyController} will be - * {@link yfiles.input.ConcurrencyController#active deactivated}. - *

- * @see yfiles.input.InputModeBase - * @interface - */ - export interface IInputMode extends yfiles.lang.Object{ - /** - * Called by the client to unconditionally cancel all editing. - *

- * This will be called prior to the uninstalling of this instance. - *

- *

- * In order to stop an active input mode manually, client code should use the following idiom: - *

- * @abstract - */ - cancel():void; - /** - * Installs this mode into the given context that is provided by the canvas. - *

- * In general a mode can only be installed into a single canvas at all times. - *

- *

- * This method is called to initialize this instance. Subclasses should override this method to register the corresponding - * event handler delegates for the various input events they need to register with. - *
- * When this instance gets {@link yfiles.input.IInputMode#uninstall uninstalled} from the context the same context instance will be passed to it. - *
- * Implementations may hold a reference to the context instance and use it while they are being installed. - *

- * @param context The context that this instance shall be installed into. The same instance will be passed to this instance during - * {@link #uninstall}. A reference to the context may be kept and queried during the time the mode is - * installed. - * @param controller The {@link } for this mode. - * @see yfiles.input.IInputMode#uninstall - * @abstract - */ - install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; - /** - * Called by the client in order to stop a current editing progress. - *

- * This should stop the current edit, if one is in progress and possibly commit all of the changes. If stopping is not - * possible, this method can return false - *

- * @returns true if and only if the editing has been stopped or there was no edit in progress - * @see yfiles.input.IInputMode#cancel - * @abstract - */ - tryStop():boolean; - /** - * Uninstalls this mode from the given context. - *

- * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} method. After a mode has - * been uninstalled it can be installed again into the same or another canvas. - *

- * @param context The context to deregister from. This is the same instance that had been passed to {@link #install} during - * installation. - * @abstract - */ - uninstall(context:yfiles.input.IInputModeContext):void; - /** - * Gets the context instance this mode is currently installed in or null if this instance is not installed. - *

- * Note that this instance should not be passed down to subordinate modes or instances. Instead a corresponding context - * that has this instance set as the {@link yfiles.input.IInputModeContext#parentInputMode} should be used. - *

- * @abstract - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Gets the priority of this input mode. - *

- * The priority will influence the order in which the modes will be {@link yfiles.input.IInputMode#install installed} into the canvas control. The lower the - * priority value, the earlier it will be installed. If two modes are installed using the same priority value, the first - * one will be installed earlier. - *

- * @abstract - * @type {number} - */ - priority:number; - } - var IInputMode:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IInputMode; - }; - /** - * The interface for the context object that is passed to {@link yfiles.input.IInputMode} instances during {@link yfiles.input.IInputMode#install} - * and {@link yfiles.input.IInputMode#uninstall} and {@link yfiles.input.IDragHandler} implementations like {@link yfiles.input.IPositionHandler} - * and {@link yfiles.input.IHandle} to provide additional context for the implementations. - *

- * Implementations of this interface can carry additional information through their {@link yfiles.graph.ILookup#lookup} method. - *

- * @see yfiles.graph.ILookup - * @see yfiles.input.IInputMode - * @interface - * @implements {yfiles.view.ICanvasContext} - */ - export interface IInputModeContext extends yfiles.lang.Object,yfiles.view.ICanvasContext{ - /** - * Tries to call {@link yfiles.graph.IGraph#invalidateDisplays} on the {@link yfiles.input.IInputModeContext#graph graph} obtains from the {@link yfiles.input.IInputModeContext}. - *

- * If the graph instance cannot be found, {@link yfiles.view.CanvasComponent#invalidate} will be called instead. - *

- */ - invalidateDisplays?():void; - /** - * Gets the {@link yfiles.input.IInputMode} which issued the context object. - *

- * This can be null if this context is used outside the context of an IInputMode. - *

- * @abstract - * @type {yfiles.input.IInputMode} - */ - parentInputMode:yfiles.input.IInputMode; - /** - * Tries to retrieve an {@link yfiles.graph.IGraph} instance from an {@link yfiles.input.IInputModeContext}. - *

- * This will use the {@link yfiles.graph.ILookup} and if this yields nothing, it will use the {@link yfiles.graph.ILookup} of the {@link yfiles.view.ICanvasContext#canvasComponent} or - * finally test if it is a {@link yfiles.view.GraphComponent} to obtain the graph from. - *

- * @type {yfiles.graph.IGraph} - */ - graph?:yfiles.graph.IGraph; - } - var IInputModeContext:{ - /** - * Factory method that creates an {@link yfiles.input.IInputModeContext} that uses the provided parent mode, parent context, and - * lookup decoration. - * @param parent - * @param parentContext - * @param lookupCallback - * @returns - * @static - */ - createInputModeContext?(parent:yfiles.input.IInputMode,parentContext:yfiles.input.IInputModeContext,lookupCallback:(subject:any,type:yfiles.lang.Class)=>any):yfiles.input.IInputModeContext; - /** - * Factory method that creates an {@link yfiles.input.IInputModeContext} that uses the provided parent mode and lookup decoration. - * @param parent - * @param lookupCallback - * @returns - * @static - */ - createInputModeContext?(parent:yfiles.input.IInputMode,lookupCallback:(subject:any,type:yfiles.lang.Class)=>any):yfiles.input.IInputModeContext; - /** - * Factory method that creates an {@link yfiles.input.IInputModeContext} that uses the provided values. - * @param canvas The {@link } to use, may not be null. - * @param [parent=null] The mode to set as the parent. This may be null for the canvas' context. - * @param [lookup=null] The lookup to use. - * @returns - * @static - */ - createInputModeContext?(canvas:yfiles.view.CanvasComponent,parent?:yfiles.input.IInputMode,lookup?:yfiles.graph.ILookup):yfiles.input.IInputModeContext; - /** - * Factory method that creates an {@link yfiles.input.IInputModeContext} that uses the provided values. - * @param {Object} options The parameters to pass. - * @param options.canvas The {@link } to use, may not be null. - * @param [options.parent=null] The mode to set as the parent. This may be null for the canvas' context. - * @param [options.lookup=null] The lookup to use. - * @returns - * @static - */ - createInputModeContext?(options:{canvas:yfiles.view.CanvasComponent,parent?:yfiles.input.IInputMode,lookup?:yfiles.graph.ILookup}):yfiles.input.IInputModeContext; - /** - * Factory method that creates an {@link yfiles.input.IInputModeContext} that uses the provided parent mode, parent context, and - * lookup decoration. - * @param parent - * @param parentContext - * @param lookup - * @returns - * @static - */ - createInputModeContext?(parent:yfiles.input.IInputMode,parentContext:yfiles.input.IInputModeContext,lookup:yfiles.graph.ILookup):yfiles.input.IInputModeContext; - /** - * Factory method that creates an {@link yfiles.input.IInputModeContext} that uses the provided parent mode and lookup decoration. - * @param parent - * @param [lookup=null] - * @returns - * @static - */ - createInputModeContext?(parent:yfiles.input.IInputMode,lookup?:yfiles.graph.ILookup):yfiles.input.IInputModeContext; - /** - * An empty context where both the inputmode and the canvas is null. - *

- * The lookup always yields null, also. - *

- * @const - * @static - * @type {yfiles.input.IInputModeContext} - */ - EMPTY?:yfiles.input.IInputModeContext; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IInputModeContext; - }; - /** - * An interface that allows input modes to collect {@link yfiles.graph.IModelItem}s for various purposes. - *

- * This is mainly used for {@link yfiles.input.HandleInputMode} and {@link yfiles.input.MoveInputMode} to allow access to the items that - * were affected during the respective operation. - *

- * @see yfiles.input.HandleInputMode#affectedItems - * @see yfiles.input.MoveInputMode#affectedItems - * @interface - */ - export interface IModelItemCollector extends yfiles.lang.Object{ - /** - * Adds a model item to this collector instance. - * @param item The model item to add. - * @abstract - */ - add(item:yfiles.graph.IModelItem):void; - } - var IModelItemCollector:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IModelItemCollector; - }; - /** - * Interface for an object that can handle the position of an item displayed in a {@link yfiles.view.CanvasComponent} - *

- * The point as indicated by {@link yfiles.input.IDragHandler#location} describes the current world coordinate position of the element. It is up to the - * implementation how this position is interpreted. The values returned by that instance will be used for the - * "originalLocation" parameter in the {@link yfiles.input.IDragHandler#handleMove}, {@link yfiles.input.IDragHandler#cancelDrag} and {@link yfiles.input.IDragHandler#dragFinished} - * methods. Items can be dragged with the mouse and an instance of this class will modify their position accordingly. - * Typically client code will use the {@link yfiles.input.IDragHandler#location}'s coordinates to determine the current position of the elements. A drag will trigger - * the invocation of {@link yfiles.input.IDragHandler#initializeDrag}, zero or more {@link yfiles.input.IDragHandler#handleMove} calls, and - * finally by either {@link yfiles.input.IDragHandler#dragFinished} or {@link yfiles.input.IDragHandler#cancelDrag}. - *

- *

Related demos:

- *
    - *
  • Demo: PositionHandler, demo.yfiles.input.positionhandler
  • - *
- * @see yfiles.input.IDragHandler - * @see yfiles.input.IHandle - * @see yfiles.input.MoveInputMode - * @interface - * @implements {yfiles.input.IDragHandler} - */ - export interface IPositionHandler extends yfiles.lang.Object,yfiles.input.IDragHandler{ - } - var IPositionHandler:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IPositionHandler; - }; - /** - * Interface for an object that can be interactively reshaped in a {@link yfiles.view.CanvasComponent} - *

- * Items can be reshaped interactively and an instance of this class can be used to handle that process. A reshape - * operation will be initialized by a call to {@link yfiles.input.IReshapeHandler#initializeReshape}, then zero or more {@link yfiles.input.IReshapeHandler#handleReshape} - * calls follow, and the operation will be finalized by a call to either {@link yfiles.input.IReshapeHandler#reshapeFinished} or - * {@link yfiles.input.IReshapeHandler#cancelReshape}. Note that implementations of this class will only be used during interactive - * reshape operations. - *

- * @see yfiles.input.IDragHandler - * @see yfiles.input.IPositionHandler - * @see yfiles.input.IHandle - * @see yfiles.input.IInputModeContext - * @interface - */ - export interface IReshapeHandler extends yfiles.lang.Object{ - /** - * Called by clients to indicate that the reshaping has been canceled by the user. - *

- * This method may be called after the initial {@link yfiles.input.IReshapeHandler#initializeReshape} and zero or more invocations - * of {@link yfiles.input.IReshapeHandler#handleReshape}. Implementations should reset the bounds of the items they modify to their - * initial state. Alternatively to this method the {@link yfiles.input.IReshapeHandler#reshapeFinished} method might be called. - *

- * @param context The context to retrieve information about the reshaping from. - * @param originalBounds The value of the coordinate of the {@link #bounds} property at the time of {@link #initializeReshape}. - * @abstract - */ - cancelReshape(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect):void; - /** - * Called by clients to indicate that the element has been dragged and its position should be updated. - *

- * This method may be called more than once after an initial {@link yfiles.input.IReshapeHandler#initializeReshape} and will the - * final call will be followed by either one {@link yfiles.input.IReshapeHandler#reshapeFinished} or one {@link yfiles.input.IReshapeHandler#cancelReshape} - * call. - *

- * @param context The context to retrieve information about the reshaping from. - * @param originalBounds The value of the {@link #bounds} property at the time of {@link #initializeReshape}. - * @param newBounds The coordinates of the bounds in the world coordinate system that the client wants the shape to be at. Depending on the - * implementation the {@link #bounds} may or may not be modified to reflect the new value. - * @abstract - */ - handleReshape(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect,newBounds:yfiles.geometry.Rect):void; - /** - * Called by clients to indicate that the element is going to be reshaped. - *

- * This call will be followed by one or more calls to {@link yfiles.input.IReshapeHandler#handleReshape}, and a final {@link yfiles.input.IReshapeHandler#reshapeFinished} - * or {@link yfiles.input.IReshapeHandler#cancelReshape}. - *

- * @param context The context to retrieve information about the drag from. - * @abstract - */ - initializeReshape(context:yfiles.input.IInputModeContext):void; - /** - * Called by clients to indicate that the reshaping has just been finished. - *

- * This method may be called after the initial {@link yfiles.input.IReshapeHandler#initializeReshape} and zero or more invocations - * of {@link yfiles.input.IReshapeHandler#handleReshape}. Alternatively to this method the {@link yfiles.input.IReshapeHandler#cancelReshape} - * method might be called. - *

- * @param context The context to retrieve information about the drag from. - * @param newBounds The coordinates of the bounds in the world coordinate system that the client wants the shape to be at. Depending on the - * implementation the {@link #bounds} may or may not be modified to reflect the new value. This is the same value as delivered in the last - * invocation of {@link #handleReshape} - * @param originalBounds The value of the coordinate of the {@link #bounds} property at the time of {@link #initializeReshape}. - * @abstract - */ - reshapeFinished(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect,newBounds:yfiles.geometry.Rect):void; - /** - * Gets a view of the bounds of the item. - *

- * The rectangle describes the current world coordinate of the element that can be modified by this handler. - *

- * @abstract - * @type {yfiles.geometry.IRectangle} - */ - bounds:yfiles.geometry.IRectangle; - } - var IReshapeHandler:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IReshapeHandler; - }; - /** - * Event argument base class that is used by events that are triggered by {@link yfiles.input.IInputMode} implementations - * @class - * @extends {yfiles.lang.EventArgs} - */ - export interface InputModeEventArgs extends yfiles.lang.EventArgs{} - export class InputModeEventArgs { - /** - * Initializes a new instance of the {@link yfiles.input.InputModeEventArgs} class. - * @param context The context to initialize the {@link #context} property with. - */ - constructor(context:yfiles.input.IInputModeContext); - /** - * Gets the context for the current event. - * @type {yfiles.input.IInputModeContext} - */ - context:yfiles.input.IInputModeContext; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.InputModeEventArgs; - } - /** - * An {@link yfiles.input.IInputMode} that recognizes simple key events and invokes a registered handler. - *

- * This mode is {@link yfiles.input.KeyboardInputMode#exclusive} by default. - *

- * @class - * @implements {yfiles.input.IInputMode} - */ - export interface KeyboardInputMode extends yfiles.lang.Object,yfiles.input.IInputMode{} - export class KeyboardInputMode { - constructor(); - /** - * Adds a command and associated execution handlers to this instance. - *

- * The command will not be allowed to execute if this mode is {@link yfiles.input.KeyboardInputMode#enabled disabled} or {@link yfiles.input.ConcurrencyController#active inactive}. - *

- * @param command The command to register handlers with. - * @param [execute=null] The handler for the execution; a handler that will do nothing if omitted. - * @param [canExecute=null] The handler that determines executability; a handler that is always enabled if omitted. - * @returns A token for the newly created command binding that can used to later {@link #remove remove} this binding from this instance again. - */ - addCommandBinding(command:yfiles.input.ICommand,execute?:(command:yfiles.input.ICommand,parameter:any,source:any)=>boolean,canExecute?:(command:yfiles.input.ICommand,parameter:any,source:any)=>boolean):yfiles.input.KeyboardInputModeBinding; - /** - * Adds a command and associated execution handlers to this instance. - *

- * The command will not be allowed to execute if this mode is {@link yfiles.input.KeyboardInputMode#enabled disabled} or {@link yfiles.input.ConcurrencyController#active inactive}. - *

- * @param {Object} options The parameters to pass. - * @param options.command The command to register handlers with. - * @param [options.execute=null] The handler for the execution; a handler that will do nothing if omitted. - * @param [options.canExecute=null] The handler that determines executability; a handler that is always enabled if omitted. - * @returns A token for the newly created command binding that can used to later {@link #remove remove} this binding from this instance again. - */ - addCommandBinding(options:{command:yfiles.input.ICommand,execute?:(command:yfiles.input.ICommand,parameter:Object,source:Object)=>boolean,canExecute?:(command:yfiles.input.ICommand,parameter:Object,source:Object)=>boolean}):yfiles.input.KeyboardInputModeBinding; - /** - * Adds an event handler for a specific key press gesture to this mode. - *

- * Using this registration method, the command will not be allowed to execute if this mode is {@link yfiles.input.KeyboardInputMode#enabled disabled} or {@link yfiles.input.ConcurrencyController#active inactive}. - *

- * @param key The key constant that should be recognized. - * @param modifiers The modifiers that should be recognized when the key is pressed. - * @param command The command to execute. - * @param [commandParameter=null] The command parameter to use for the {@link #execute execution}; null if omitted. - * @returns A token for the newly created command binding that can used to later {@link #remove remove} this binding from this instance again. - */ - addKeyBinding(key:yfiles.view.Key,modifiers:yfiles.view.ModifierKeys,command:yfiles.input.ICommand,commandParameter?:any):yfiles.input.KeyboardInputModeBinding; - /** - * Adds a given handler to this instance that will be triggered if the event recognizer recognizes a {@link yfiles.view.KeyEventArgs key event} that has - * been triggered by the {@link yfiles.view.CanvasComponent}. - * @param recognizer An event recognizer that will be fed with all key events. - * @param command The command to invoke if the recognizer matches a key event. - * @param [commandParameter=null] The optional parameter to provide to the command. - * @returns The newly constructed binding on which {@link #remove} can be called to remove the - * resulting binding from this instance. - */ - addRecognizerBinding(recognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean,command:yfiles.input.ICommand,commandParameter?:any):yfiles.input.KeyboardInputModeBinding; - /** - * - */ - cancel():void; - /** - * Installs this mode into the given context that is provided by the canvas. - *

- * In general a mode can only be installed into a single canvas at all times. - *

- *

- * This method is called to initialize this instance. Subclasses should override this method to register the corresponding - * event handler delegates for the various input events they need to register with. - *

- *

- * Overriding implementations should call the base implementation, first. - *

- * @param context The context that this instance shall be installed into. The same instance will be passed to this instance during - * {@link #uninstall}. A reference to the context may be kept and queried during the time the mode is - * installed. - * @param controller The {@link #controller} for this mode. - * @see yfiles.input.IInputMode#uninstall - */ - install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; - /** - * Called after {@link yfiles.input.KeyboardInputMode#cancel} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been canceled. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onCanceled():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. - *

- * Enables the registered commands and can be overridden in subclasses to perform additional actions after the mode has - * been activated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerActivated():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. - *

- * Disables the registered commands and can be overridden in subclasses to perform additional actions after the mode has - * been deactivated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerDeactivated():void; - /** - * Called after {@link yfiles.input.KeyboardInputMode#tryStop} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been stopped. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onStopped():void; - /** - * Removes all previously registered commands from this instance. - *

- * This effectively disables the command for the instance managed by this mode. - *

- * @param command The command to remove from all registered bindings. - * @see yfiles.input.KeyboardInputMode#addKeyBinding - * @see yfiles.input.KeyboardInputMode#addRecognizerBinding - */ - removeCommand(command:yfiles.input.ICommand):void; - /** - * Overridden to only return true if this instance does not currently {@link yfiles.input.ConcurrencyController#hasMutex have the input mutex}. - * @returns true iff this instance does not {@link #hasMutex own the mutex}. - */ - tryStop():boolean; - /** - * Uninstalls this mode from the given context. - *

- * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} method. After a mode has - * been uninstalled it can be installed again into the same or another canvas. - *

- *

- * Overriding implementations should call the base implementation after their own code. - *

- * @param context The context to deregister from. This is the same instance that had been passed to {@link #install} during - * installation. - */ - uninstall(context:yfiles.input.IInputModeContext):void; - /** - * - * @type {number} - */ - priority:number; - /** - * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. - *

- * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.KeyboardInputMode#controller}. - *

- *

- * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} - * will be deactivated. Otherwise it will always run concurrently with all other modes. - *

- * @type {boolean} - */ - exclusive:boolean; - /** - * Gets or sets the enabled state of this input mode. - *

- * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed - * {@link yfiles.input.KeyboardInputMode#controller} so a disabled instance should never try to acquire the input mutex. - *

- * @type {boolean} - */ - enabled:boolean; - /** - * - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Gets the installed {@link yfiles.input.KeyboardInputMode#controller}. - * @protected - * @type {yfiles.input.ConcurrencyController} - */ - controller:yfiles.input.ConcurrencyController; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.KeyboardInputMode; - } - /** - * A token returned by {@link yfiles.input.KeyboardInputMode}'s factory methods that can be used to {@link yfiles.input.KeyboardInputModeBinding#remove} - * the binding again. - *

- * Instances of this class can only be obtained from AddCommandBinding, {@link yfiles.input.KeyboardInputMode#addKeyBinding}, and - * {@link yfiles.input.KeyboardInputMode#addRecognizerBinding}. Removing the instances is done via the instance method {@link yfiles.input.KeyboardInputModeBinding#remove} - * of this type. - *

- * @class - * @final - */ - export interface KeyboardInputModeBinding extends yfiles.lang.Object{} - export class KeyboardInputModeBinding { - /** - * Removes the binding represented by this instance from the {@link yfiles.input.KeyboardInputMode} it has been created for. - *

- * Once this method has been called, the instance can be - *

- */ - remove():void; - /** - * Gets the {@link yfiles.input.ICommand} that is associated with this binding. - * @type {yfiles.input.ICommand} - */ - command:yfiles.input.ICommand; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.KeyboardInputModeBinding; - } - /** - * An {@link yfiles.input.IInputMode} implementation that can handle marquee selections performed by the user with a mouse. - *

- * This implementation will request the mutex as soon as it recognizes a mouse drag. - *

- *

- * This mode is {@link yfiles.input.MarqueeSelectionInputMode#exclusive} by default. - *

- * @class - * @implements {yfiles.input.IInputMode} - */ - export interface MarqueeSelectionInputMode extends yfiles.lang.Object,yfiles.input.IInputMode{} - export class MarqueeSelectionInputMode { - /** - * Creates a new instance of the marquee selection mode. - */ - constructor(); - /** - * Cancels any pending marquee selection. - */ - cancel():void; - /** - * Helper method that yields a suitably configured {@link yfiles.input.InputModeEventArgs} for this input mode. - * @returns An input mode event argument that is configured for this instance. - * @protected - */ - createInputModeEventArgs():yfiles.input.MarqueeSelectionEventArgs; - /** - * Installs this mode into the given context that is provided by the canvas. - *

- * In general a mode can only be installed into a single canvas at all times. - *

- *

- * This method is called to initialize this instance. Subclasses should override this method to register the corresponding - * event handler delegates for the various input events they need to register with. - *

- *

- * Overriding implementations should call the base implementation, first. - *

- * @param context The context that this instance shall be installed into. The same instance will be passed to this instance during - * {@link #uninstall}. A reference to the context may be kept and queried during the time the mode is - * installed. - * @param controller The {@link #controller} for this mode. - * @see yfiles.input.IInputMode#uninstall - */ - install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; - /** - * Called after {@link yfiles.input.MarqueeSelectionInputMode#cancel} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been canceled. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onCanceled():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been activated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerActivated():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerDeactivated():void; - /** - * Triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDragCanceledListener DragCanceled} - * event. - * @param evt The event argument that contains context information. - * @protected - */ - onDragCanceled(evt:yfiles.input.MarqueeSelectionEventArgs):void; - /** - * Triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDragCancelingListener DragCanceling} - * event. - * @param evt The event argument that contains context information. - * @protected - */ - onDragCanceling(evt:yfiles.input.MarqueeSelectionEventArgs):void; - /** - * Callback triggered once the drag has been finalized. - *

- * This method triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDragFinishedListener DragFinished} - * event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragFinished(evt:yfiles.input.MarqueeSelectionEventArgs):void; - /** - * Callback triggered before the drag will be finalized. - *

- * This method triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDragFinishingListener DragFinishing} - * event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragFinishing(evt:yfiles.input.MarqueeSelectionEventArgs):void; - /** - * Callback triggered at the end of each drag. - *

- * This method triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDraggedListener Dragged} - * event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragged(evt:yfiles.input.MarqueeSelectionEventArgs):void; - /** - * Callback triggered at the start of each drag. - *

- * This method triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDraggingListener Dragging} - * event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragging(evt:yfiles.input.MarqueeSelectionEventArgs):void; - /** - * Triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDragStartedListener DragStarted} - * event. - * @param evt The event argument that contains context information. - * @protected - */ - onDragStarted(evt:yfiles.input.MarqueeSelectionEventArgs):void; - /** - * Triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDragStartingListener DragStarting} - * event. - * @param evt The event argument that contains context information. - * @protected - */ - onDragStarting(evt:yfiles.input.MarqueeSelectionEventArgs):void; - /** - * Called after {@link yfiles.input.MarqueeSelectionInputMode#tryStop} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been stopped. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onStopped():void; - /** - * - * @returns - */ - tryStop():boolean; - /** - * Uninstalls this mode from the given context. - *

- * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} method. After a mode has - * been uninstalled it can be installed again into the same or another canvas. - *

- *

- * Overriding implementations should call the base implementation after their own code. - *

- * @param context The context to deregister from. This is the same instance that had been passed to {@link #install} during - * installation. - */ - uninstall(context:yfiles.input.IInputModeContext):void; - /** - * - * @type {number} - */ - priority:number; - /** - * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. - *

- * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.MarqueeSelectionInputMode#controller}. - *

- *

- * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} - * will be deactivated. Otherwise it will always run concurrently with all other modes. - *

- * @type {boolean} - */ - exclusive:boolean; - /** - * Gets or sets the enabled state of this input mode. - *

- * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed - * {@link yfiles.input.MarqueeSelectionInputMode#controller} so a disabled instance should never try to acquire the input mutex. - *

- * @type {boolean} - */ - enabled:boolean; - /** - * - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Gets the installed {@link yfiles.input.MarqueeSelectionInputMode#controller}. - * @protected - * @type {yfiles.input.ConcurrencyController} - */ - controller:yfiles.input.ConcurrencyController; - /** - * Gets the current or last marquee selection rectangle. - * @type {yfiles.geometry.Rect} - */ - selectionRectangle:yfiles.geometry.Rect; - /** - * Gets or sets the template that is used for the visualization of the marquee rectangle. - * @type {yfiles.view.IVisualTemplate} - */ - template:yfiles.view.IVisualTemplate; - /** - * Gets or sets the "cancel" recognizer. - *

- * This recognizer recognizes the cancel action during the marquee selection. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - cancelRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * A {@link string} that can be used to store a {@link yfiles.view.IVisualTemplate} that can be used to create the visual that will be used to - * draw the marquee box. - * @const - * @static - * @type {string} - */ - static MARQUEE_RECTANGLE_TEMPLATE_KEY:string; - /** - * Gets or sets the cursor to use during the dragging of the marquee. - *

- * The default is Cursors.Cross - *

- * @type {yfiles.view.Cursor} - */ - marqueeCursor:yfiles.view.Cursor; - /** - * Gets or sets the "pressed" state recognizer. - *

- * This recognizer instance will be used to determine when the user begins to draw the marquee. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - pressedRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "dragged" recognizer. - *

- * This recognizer instance determines when the user is dragging the marquee. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - draggedRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "released" recognizer. - *

- * This instance determines when the user has finished creating the marquee. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - releasedRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "pressed" state recognizer for touch input. - *

- * This recognizer instance will be used to determine when the user begins to draw the marquee. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - pressedRecognizerTouch:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "dragged" recognizer for touch input. - *

- * This recognizer instance determines when the user is dragging the marquee. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - draggedRecognizerTouch:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "released" recognizer for touch input. - *

- * This instance determines when the user has finished creating the marquee. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - releasedRecognizerTouch:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Adds the given listener for the Dragging event that occurs at the start of every drag. - * @param listener The listener to add. - * @see yfiles.input.MarqueeSelectionInputMode#removeDraggingListener - */ - addDraggingListener(listener:(sender:any,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; - /** - * Removes the given listener for the Dragging event that occurs at the start of every drag. - * @param listener The listener to remove. - * @see yfiles.input.MarqueeSelectionInputMode#addDraggingListener - */ - removeDraggingListener(listener:(sender:any,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; - /** - * Adds the given listener for the Dragged event that occurs at the end of every drag. - * @param listener The listener to add. - * @see yfiles.input.MarqueeSelectionInputMode#removeDraggedListener - */ - addDraggedListener(listener:(sender:any,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; - /** - * Removes the given listener for the Dragged event that occurs at the end of every drag. - * @param listener The listener to remove. - * @see yfiles.input.MarqueeSelectionInputMode#addDraggedListener - */ - removeDraggedListener(listener:(sender:any,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; - /** - * Adds the given listener for the DragCanceled event that occurs when the drag has been canceled. - * @param listener The listener to add. - * @see yfiles.input.MarqueeSelectionInputMode#removeDragCanceledListener - */ - addDragCanceledListener(listener:(sender:any,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; - /** - * Removes the given listener for the DragCanceled event that occurs when the drag has been canceled. - * @param listener The listener to remove. - * @see yfiles.input.MarqueeSelectionInputMode#addDragCanceledListener - */ - removeDragCanceledListener(listener:(sender:any,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; - /** - * Adds the given listener for the DragCanceling event that occurs before the drag will be canceled. - * @param listener The listener to add. - * @see yfiles.input.MarqueeSelectionInputMode#removeDragCancelingListener - */ - addDragCancelingListener(listener:(sender:any,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; - /** - * Removes the given listener for the DragCanceling event that occurs before the drag will be canceled. - * @param listener The listener to remove. - * @see yfiles.input.MarqueeSelectionInputMode#addDragCancelingListener - */ - removeDragCancelingListener(listener:(sender:any,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; - /** - * Adds the given listener for the DragFinishing event that occurs before the drag will be finished. - * @param listener The listener to add. - * @see yfiles.input.MarqueeSelectionInputMode#removeDragFinishingListener - */ - addDragFinishingListener(listener:(sender:any,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; - /** - * Removes the given listener for the DragFinishing event that occurs before the drag will be finished. - * @param listener The listener to remove. - * @see yfiles.input.MarqueeSelectionInputMode#addDragFinishingListener - */ - removeDragFinishingListener(listener:(sender:any,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; - /** - * Adds the given listener for the DragFinished event that occurs the drag has been finished. - * @param listener The listener to add. - * @see yfiles.input.MarqueeSelectionInputMode#removeDragFinishedListener - */ - addDragFinishedListener(listener:(sender:any,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; - /** - * Removes the given listener for the DragFinished event that occurs the drag has been finished. - * @param listener The listener to remove. - * @see yfiles.input.MarqueeSelectionInputMode#addDragFinishedListener - */ - removeDragFinishedListener(listener:(sender:any,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; - /** - * Adds the given listener for the DragStarting event that occurs once the drag is starting. - * @param listener The listener to add. - * @see yfiles.input.MarqueeSelectionInputMode#removeDragStartingListener - */ - addDragStartingListener(listener:(sender:any,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; - /** - * Removes the given listener for the DragStarting event that occurs once the drag is starting. - * @param listener The listener to remove. - * @see yfiles.input.MarqueeSelectionInputMode#addDragStartingListener - */ - removeDragStartingListener(listener:(sender:any,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; - /** - * Adds the given listener for the DragStarted event that occurs once the drag is initialized and has started. - * @param listener The listener to add. - * @see yfiles.input.MarqueeSelectionInputMode#removeDragStartedListener - */ - addDragStartedListener(listener:(sender:any,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; - /** - * Removes the given listener for the DragStarted event that occurs once the drag is initialized and has started. - * @param listener The listener to remove. - * @see yfiles.input.MarqueeSelectionInputMode#addDragStartedListener - */ - removeDragStartedListener(listener:(sender:any,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.MarqueeSelectionInputMode; - } - /** - * Event arguments used by {@link yfiles.input.MarqueeSelectionInputMode}. - * @class - * @extends {yfiles.input.InputModeEventArgs} - */ - export interface MarqueeSelectionEventArgs extends yfiles.input.InputModeEventArgs{} - export class MarqueeSelectionEventArgs { - /** - * Gets the current {@link yfiles.input.MarqueeSelectionInputMode#selectionRectangle selection rectangle} of the {@link yfiles.input.MarqueeSelectionInputMode}. - * @type {yfiles.geometry.Rect} - */ - rectangle:yfiles.geometry.Rect; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.MarqueeSelectionEventArgs; - } - /** - * Event argument that can be used to query the text to display when the mouse hovers over the given point in world - * coordinate space. - * @see yfiles.input.MouseHoverInputMode - * @class - * @extends {yfiles.input.InputModeEventArgs} - */ - export interface ToolTipQueryEventArgs extends yfiles.input.InputModeEventArgs{} - export class ToolTipQueryEventArgs { - /** - * Initializes a new instance of the {@link yfiles.input.ToolTipQueryEventArgs} class. - * @param context The context of the query. - * @param queryLocation The query location. - */ - constructor(context:yfiles.input.IInputModeContext,queryLocation:yfiles.geometry.Point); - /** - * Gets the query location in world coordinates. - * @type {yfiles.geometry.Point} - */ - queryLocation:yfiles.geometry.Point; - /** - * Gets or sets the tool tip content to use. - *

- * The content can be either a string or any HTML element. - *

- *

- * Setting this property will set the {@link yfiles.input.ToolTipQueryEventArgs#handled} property to true. - *

- * @type {any} - */ - toolTip:any; - /** - * Gets or sets a value indicating whether this {@link yfiles.input.ToolTipQueryEventArgs} has been handled. - *

- * This property is automatically set to true if {@link yfiles.input.ToolTipQueryEventArgs#toolTip} property has been assigned a value. Marking this event as handled tells - * the issuer of the query whether the {@link yfiles.input.ToolTipQueryEventArgs#toolTip} property should be used or whether additional logic should be used to determine - * whether to show the menu. - *

- * @type {boolean} - */ - handled:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.ToolTipQueryEventArgs; - } - /** - * An {@link yfiles.input.IInputMode} that detects when the mouse hovers over the {@link yfiles.view.CanvasComponent}. - *

- * This implementation will show a {@link yfiles.input.MouseHoverInputMode#toolTip ToolTip}. In order to make use of this instance one has to register with the {@link yfiles.input.MouseHoverInputMode#addQueryToolTipListener QueryToolTip} - * event. Setting a custom {@link yfiles.input.MouseHoverInputMode#validHoverLocationHitTestable} will restrict the area where a tool tip can be shown. - *

- *

- * This mode is {@link yfiles.input.MouseHoverInputMode#exclusive} by default. - *

- * @class - * @implements {yfiles.input.IInputMode} - */ - export interface MouseHoverInputMode extends yfiles.lang.Object,yfiles.input.IInputMode{} - export class MouseHoverInputMode { - /** - * Creates a new instance using the provided {@link yfiles.input.MouseHoverInputMode#toolTip} and query callback. - * @param toolTip - * @param textProvider - */ - constructor(toolTip:yfiles.view.ToolTip,textProvider:(sender:any,evt:yfiles.input.ToolTipQueryEventArgs)=>void); - /** - * Creates a new instance with default values. - */ - constructor(); - /** - * Adjust the calculated tooltip position. - *

- * This default implementation of this method moves the tooltip into the visible area if it extends beyond the document - * bounds. - *

- * @param originalPosition The calculated tooltip position relative to the document root - * @returns The adjusted tooltip location - * @see yfiles.input.MouseHoverInputMode#getToolTipLocation - * @protected - */ - adjustTooltipPosition(originalPosition:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * - */ - cancel():void; - /** - * Creates an {@link yfiles.input.IInputModeContext} for use with the {@link yfiles.input.MouseHoverInputMode#addQueryToolTipListener QueryToolTip} - * event for the upcoming text query operation. - * @returns An instance of {@link }. - * @protected - */ - createHoverInputModeContext():yfiles.input.IInputModeContext; - /** - * Factory method that creates the {@link yfiles.input.MouseHoverInputMode#toolTip}. - * @returns A simple {@link #toolTip}. - * @protected - */ - createToolTip():yfiles.view.ToolTip; - /** - * Callback method that provides a text for the given location or null. - * @param location The location to find a text for. - * @returns A string or null to indicate that no tool tip should be shown. - * @see yfiles.input.MouseHoverInputMode#addQueryToolTipListener - * @see yfiles.input.MouseHoverInputMode#createHoverInputModeContext - * @protected - */ - getToolTipContent(location:yfiles.geometry.Point):any; - /** - * Finds the position in canvas view coordinates to display the tool tip at for the given world coordinates. - *

- * This method adds the {@link yfiles.input.MouseHoverInputMode#toolTipLocationOffset} after converting the given location to view coordinates. - *

- * @param location The position in world coordinates. - * @returns The position in view coordinates. - * @see yfiles.input.MouseHoverInputMode#toolTipLocationOffset - * @protected - */ - getToolTipLocation(location:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Immediately hides the tool tip. - */ - hide():void; - /** - * Installs this mode into the given context that is provided by the canvas. - *

- * In general a mode can only be installed into a single canvas at all times. - *

- *

- * This method is called to initialize this instance. Subclasses should override this method to register the corresponding - * event handler delegates for the various input events they need to register with. - *

- *

- * Overriding implementations should call the base implementation, first. - *

- * @param context The context that this instance shall be installed into. The same instance will be passed to this instance during - * {@link #uninstall}. A reference to the context may be kept and queried during the time the mode is - * installed. - * @param controller The {@link #controller} for this mode. - * @see yfiles.input.IInputMode#uninstall - */ - install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; - /** - * Called after {@link yfiles.input.MouseHoverInputMode#cancel} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been canceled. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onCanceled():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been activated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerActivated():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerDeactivated():void; - /** - * Called when the tooltip should be hidden. - * @protected - */ - onHide():void; - /** - * Raises the {@link yfiles.input.MouseHoverInputMode#addQueryToolTipListener QueryToolTip} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onQueryToolTip(evt:yfiles.input.ToolTipQueryEventArgs):void; - /** - * Triggered when the mouse hovers over the given coordinates. - *

- * This method will call {@link yfiles.input.MouseHoverInputMode#getToolTipContent} to query the content and will display the {@link yfiles.input.MouseHoverInputMode#toolTip} at - * the location returned by {@link yfiles.input.MouseHoverInputMode#getToolTipLocation} if the content is not null. - *

- * @param location - * @protected - */ - onShow(location:yfiles.geometry.Point):void; - /** - * Called after {@link yfiles.input.MouseHoverInputMode#tryStop} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been stopped. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onStopped():void; - /** - * Immediately shows the tool tip at the given location. - * @param location The location in the world coordinate system. - */ - show(location:yfiles.geometry.Point):void; - /** - * Overridden to only return true if this instance does not currently {@link yfiles.input.ConcurrencyController#hasMutex have the input mutex}. - * @returns true iff this instance does not {@link #hasMutex own the mutex}. - */ - tryStop():boolean; - /** - * Uninstalls this mode from the given context. - *

- * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} method. After a mode has - * been uninstalled it can be installed again into the same or another canvas. - *

- *

- * Overriding implementations should call the base implementation after their own code. - *

- * @param context The context to deregister from. This is the same instance that had been passed to {@link #install} during - * installation. - */ - uninstall(context:yfiles.input.IInputModeContext):void; - /** - * - * @type {number} - */ - priority:number; - /** - * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. - *

- * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.MouseHoverInputMode#controller}. - *

- *

- * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} - * will be deactivated. Otherwise it will always run concurrently with all other modes. - *

- * @type {boolean} - */ - exclusive:boolean; - /** - * Gets or sets the enabled state of this input mode. - *

- * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed - * {@link yfiles.input.MouseHoverInputMode#controller} so a disabled instance should never try to acquire the input mutex. - *

- * @type {boolean} - */ - enabled:boolean; - /** - * - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Gets the installed {@link yfiles.input.MouseHoverInputMode#controller}. - * @protected - * @type {yfiles.input.ConcurrencyController} - */ - controller:yfiles.input.ConcurrencyController; - /** - * Gets or sets an {@link yfiles.input.IHitTestable} that determines where the mouse may hover and a tool tip can be {@link yfiles.input.MouseHoverInputMode#onShow shown}. - *

- * The default value of this property is {@link yfiles.input.IHitTestable#ALWAYS} - *

- * @type {yfiles.input.IHitTestable} - */ - validHoverLocationHitTestable:yfiles.input.IHitTestable; - /** - * Gets or sets the {@link yfiles.input.MouseHoverInputMode#toolTip} instance to use during display. - *

- * This method will trigger the {@link yfiles.input.MouseHoverInputMode#createToolTip} method if no tool tip has been set. - *

- * @type {yfiles.view.ToolTip} - */ - toolTip:yfiles.view.ToolTip; - /** - * Gets or sets whether the tool tip is currently showing. - * @type {boolean} - */ - showing:boolean; - /** - * Gets or sets the tool tip location offset in view coordinates. - *

- * The value of this property is used by {@link yfiles.input.MouseHoverInputMode#getToolTipLocation} in order to move the tool tip - * away from the mouse pointer. The default value is (0,0). - *

- * @see yfiles.input.MouseHoverInputMode#getToolTipLocation - * @type {yfiles.geometry.Point} - */ - toolTipLocationOffset:yfiles.geometry.Point; - /** - * Gets or sets the duration to show the tool tip. - *

- * The default value is 3 seconds. - *

- * @default '00:00:03.0' - * @type {yfiles.lang.TimeSpan} - */ - duration:yfiles.lang.TimeSpan; - /** - * Gets or sets the delay time before showing the tool tip. - *

- * The default value is 1 second. - *

- * @default '00:00:01.0' - * @type {yfiles.lang.TimeSpan} - */ - delay:yfiles.lang.TimeSpan; - /** - * Gets or sets the amount the mouse pointer has to move in order to hide the tooltip. - *

- * The default value is 10, 10. - *

- * @default '10, 10' - * @type {yfiles.geometry.Size} - */ - mouseHoverSize:yfiles.geometry.Size; - /** - * If true the tooltip is closed when the a click is performed over the tooltip. - * @type {boolean} - */ - closeOnClick:boolean; - /** - * Adds the given listener for the QueryToolTip event that occurs when this mode queries the tool tip for a certain query - * location. - *

- * Handlers should set the {@link yfiles.input.ToolTipQueryEventArgs#toolTip} property or set/respect the {@link yfiles.input.ToolTipQueryEventArgs#handled} property accordingly. - *

- * @param listener The listener to add. - * @see yfiles.input.MouseHoverInputMode#removeQueryToolTipListener - */ - addQueryToolTipListener(listener:(sender:any,evt:yfiles.input.ToolTipQueryEventArgs)=>void):void; - /** - * Removes the given listener for the QueryToolTip event that occurs when this mode queries the tool tip for a certain - * query location. - *

- * Handlers should set the {@link yfiles.input.ToolTipQueryEventArgs#toolTip} property or set/respect the {@link yfiles.input.ToolTipQueryEventArgs#handled} property accordingly. - *

- * @param listener The listener to remove. - * @see yfiles.input.MouseHoverInputMode#addQueryToolTipListener - */ - removeQueryToolTipListener(listener:(sender:any,evt:yfiles.input.ToolTipQueryEventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.MouseHoverInputMode; - } - /** - * Generic {@link yfiles.input.IInputMode} implementation that can be used to move something in the canvas using the mouse. - *

- * This implementation uses the {@link yfiles.input.MoveInputMode#hitTestable} to determine where the user can begin dragging the selection. It will then use the {@link yfiles.input.MoveInputMode#positionHandler} to - * delegate the actual work of moving the elements to. - *

- *

- * This mode is {@link yfiles.input.MoveInputMode#exclusive} by default. - *

- * @class - * @implements {yfiles.input.IInputMode} - */ - export interface MoveInputMode extends yfiles.lang.Object,yfiles.input.IInputMode{} - export class MoveInputMode { - /** - * Initializes a new instance of the {@link yfiles.input.MoveInputMode} class. - */ - constructor(); - /** - * Callback that is called when this mode is "armed". - *

- * This happens when the mouse {@link yfiles.input.MoveInputMode#hoverRecognizer hovers} over the item(s) to move. This implementation sets the mouse cursor to {@link yfiles.input.MoveInputMode#moveCursor}. - *

- * @protected - */ - arm():void; - /** - * Cancels the editing of this mode. - *

- * This implementation {@link yfiles.input.ConcurrencyController#releaseMutex releases} the mutex if it is currently owned by this instance and calls - * {@link yfiles.input.MoveInputMode#onCanceled}. - *

- * @see yfiles.input.MoveInputMode#onCanceled - */ - cancel():void; - /** - * Creates an {@link yfiles.input.IInputModeContext} for use with the {@link yfiles.input.IPositionHandler} interface for the upcoming drag - * operation. - * @returns An instance of {@link }. - * @protected - */ - createPositionHandlerInputModeContext():yfiles.input.IInputModeContext; - /** - * Callback that is called when this mode is "disarmed". - *

- * This happens when the mouse stops hovering over the item(s). This implementation resets the mouse cursor again. - *

- * @protected - */ - disarm():void; - /** - * Simulates the start of a drag and puts the state machine into the dragging state. - *

- * Subsequent moves of input devices will behave as if the dragging has been successfully initiated at location. - *

- * @param location The location where the drag had been initialized. - */ - doStartDrag(location:yfiles.geometry.Point):void; - /** - * Installs this mode into the given context that is provided by the canvas. - *

- * In general a mode can only be installed into a single canvas at all times. - *

- *

- * This method is called to initialize this instance. Subclasses should override this method to register the corresponding - * event handler delegates for the various input events they need to register with. - *

- *

- * Overriding implementations should call the base implementation, first. - *

- * @param context The context that this instance shall be installed into. The same instance will be passed to this instance during - * {@link #uninstall}. A reference to the context may be kept and queried during the time the mode is - * installed. - * @param controller The {@link #controller} for this mode. - * @see yfiles.input.IInputMode#uninstall - */ - install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; - /** - * Determines whether the given location is a valid start location for the move gesture. - *

- * This implementation delegates to the {@link yfiles.input.MoveInputMode#hitTestable}. During this callback it is possible to reset or reconfigure the {@link yfiles.input.MoveInputMode#positionHandler}. - *

- * @param location The location in the world coordinate system. - * @returns true if at the given location it is valid to start the move gesture; otherwise, false. - * @protected - */ - isValidStartLocation(location:yfiles.geometry.Point):boolean; - /** - * Called after {@link yfiles.input.MoveInputMode#cancel} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been canceled. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onCanceled():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been activated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerActivated():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerDeactivated():void; - /** - * Triggers the {@link yfiles.input.MoveInputMode#addDragCanceledListener DragCanceled} event. - * @param evt The event argument that contains context information. - * @protected - */ - onDragCanceled(evt:yfiles.input.InputModeEventArgs):void; - /** - * Triggers the {@link yfiles.input.MoveInputMode#addDragCancelingListener DragCanceling} event. - * @param evt The event argument that contains context information. - * @protected - */ - onDragCanceling(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered once the drag has been finalized. - *

- * This method triggers the {@link yfiles.input.MoveInputMode#addDragFinishedListener DragFinished} event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragFinished(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered before the drag will be finalized. - *

- * This method triggers the {@link yfiles.input.MoveInputMode#addDragFinishingListener DragFinishing} event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragFinishing(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered at the end of each drag. - *

- * This method triggers the {@link yfiles.input.MoveInputMode#addDraggedListener Dragged} event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragged(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered at the start of each drag. - *

- * This method triggers the {@link yfiles.input.MoveInputMode#addDraggingListener Dragging} event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragging(evt:yfiles.input.InputModeEventArgs):void; - /** - * Triggers the {@link yfiles.input.MoveInputMode#addDragStartedListener DragStarted} event. - * @param evt The event argument that contains context information. - * @protected - */ - onDragStarted(evt:yfiles.input.InputModeEventArgs):void; - /** - * Triggers the {@link yfiles.input.MoveInputMode#addDragStartingListener DragStarting} event. - * @param evt The event argument that contains context information. - * @protected - */ - onDragStarting(evt:yfiles.input.InputModeEventArgs):void; - /** - * Raises the {@link yfiles.input.MoveInputMode#addQueryPositionHandlerListener QueryPositionHandler} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onQueryPositionHandler(evt:yfiles.input.QueryPositionHandlerEventArgs):void; - /** - * Called after {@link yfiles.input.MoveInputMode#tryStop} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been stopped. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onStopped():void; - /** - * - * @returns - */ - tryStop():boolean; - /** - * Uninstalls this mode from the given context. - *

- * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} method. After a mode has - * been uninstalled it can be installed again into the same or another canvas. - *

- *

- * Overriding implementations should call the base implementation after their own code. - *

- * @param context The context to deregister from. This is the same instance that had been passed to {@link #install} during - * installation. - */ - uninstall(context:yfiles.input.IInputModeContext):void; - /** - * Gets or sets the enabled state of this input mode. - *

- * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed - * {@link yfiles.input.MoveInputMode#controller} so a disabled instance should never try to acquire the input mutex. - *

- * @type {boolean} - */ - enabled:boolean; - /** - * - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Gets the installed {@link yfiles.input.MoveInputMode#controller}. - * @protected - * @type {yfiles.input.ConcurrencyController} - */ - controller:yfiles.input.ConcurrencyController; - /** - * - * @type {number} - */ - priority:number; - /** - * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. - *

- * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.MoveInputMode#controller}. - *

- *

- * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} - * will be deactivated. Otherwise it will always run concurrently with all other modes. - *

- * @type {boolean} - */ - exclusive:boolean; - /** - * Gets or sets event recognizer that recognizes when the user temporarily disables snapping. - * @see yfiles.input.MoveInputMode#enableSnappingRecognizer - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - disableSnappingRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets event recognizer that recognizes when the user reenables temporarily disabled snapping. - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - enableSnappingRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "pressed" state recognizer. - *

- * This recognizer instance will be used to determine when the user begins to move the selection. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - pressedRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "hovering" state recognizer. - *

- * This recognizer instance will be used to determine whether the user is hovering over an item where pressing can - * initialize a move operation. The default implementation uses the {@link yfiles.input.MoveInputMode#isValidStartLocation} method - * to determine whether the mode can be initialized, here. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - hoverRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "dragged" recognizer. - *

- * This recognizer instance determines when the user is moving the selection - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - draggedRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "cancel" recognizer. - *

- * This recognizer recognizes a cancel action during the move. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - cancelRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "released" recognizer. - *

- * This instance determines when the user has finished the move. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - releasedRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "pressed" recognizer for touch events. - *

- * This recognizer instance determines when the user begins the move selection operation. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - pressedRecognizerTouch:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "dragged" recognizer for touch events. - *

- * This recognizer instance determines when the user is moving the selection - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - draggedRecognizerTouch:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "released" recognizer for touch events. - *

- * This instance determines when the user has finished the move using touch. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - releasedRecognizerTouch:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the {@link yfiles.input.IHitTestable} that will be used by this mode to determine where the user may start - * dragging. - * @type {yfiles.input.IHitTestable} - */ - hitTestable:yfiles.input.IHitTestable; - /** - * Gets or sets the {@link yfiles.input.IPositionHandler} that will be used as fallback to handle that actual movement of the - * elements during the drag. - *

- * Note that the {@link yfiles.input.IPositionHandler} retrieved by the {@link yfiles.input.MoveInputMode#addQueryPositionHandlerListener QueryPositionHandler} - * event has priority before this property. Only if the event is not {@link yfiles.input.QueryPositionHandlerEventArgs#handled} this property is used. - *

- * @type {yfiles.input.IPositionHandler} - */ - positionHandler:yfiles.input.IPositionHandler; - /** - * Gets or sets the cursor to use during the move. - * @type {yfiles.view.Cursor} - */ - moveCursor:yfiles.view.Cursor; - /** - * Gets or sets the {@link yfiles.input.MoveInputMode#snapContext} which manages snapping model items to certain coordinates (for instance, other items). - *

- * If set to null (the default) this input mode tries to obtain the {@link yfiles.input.MoveInputMode#snapContext} from the {@link yfiles.input.IInputModeContext}. To explicitly - * disable snapping, a {@link yfiles.input.MoveInputMode#snapContext} implementation that does nothing has to be set to this instance. - *

- * @type {yfiles.input.SnapContext} - */ - snapContext:yfiles.input.SnapContext; - /** - * Adds the given listener for the QueryPositionHandler event that occurs when a drag is recognized for the - * {@link yfiles.input.MoveInputMode}. - *

- * If the event args are {@link yfiles.input.QueryPositionHandlerEventArgs#handled}, the {@link yfiles.input.IPositionHandler} that is carried with the event args is used to actually move - * the items. Otherwise the pre-set {@link yfiles.input.MoveInputMode#positionHandler} property is used. - *

- * @param listener The listener to add. - * @see yfiles.input.MoveInputMode#removeQueryPositionHandlerListener - */ - addQueryPositionHandlerListener(listener:(sender:any,evt:yfiles.input.QueryPositionHandlerEventArgs)=>void):void; - /** - * Removes the given listener for the QueryPositionHandler event that occurs when a drag is recognized for the - * {@link yfiles.input.MoveInputMode}. - *

- * If the event args are {@link yfiles.input.QueryPositionHandlerEventArgs#handled}, the {@link yfiles.input.IPositionHandler} that is carried with the event args is used to actually move - * the items. Otherwise the pre-set {@link yfiles.input.MoveInputMode#positionHandler} property is used. - *

- * @param listener The listener to remove. - * @see yfiles.input.MoveInputMode#addQueryPositionHandlerListener - */ - removeQueryPositionHandlerListener(listener:(sender:any,evt:yfiles.input.QueryPositionHandlerEventArgs)=>void):void; - /** - * Gets a value indicating whether a drag operation is currently in progress. - * @type {boolean} - */ - isDragging:boolean; - /** - * Gets the initial position where the dragging was initiated. - * @type {yfiles.geometry.Point} - */ - initialLocation:yfiles.geometry.Point; - /** - * Gets an immutable snapshot of the {@link yfiles.graph.IModelItem}s affected by the currently {@link yfiles.input.MoveInputMode#isDragging active} gesture. - *

- * When the gesture is {@link yfiles.input.MoveInputMode#addDragStartingListener starting} and the {@link yfiles.input.MoveInputMode#positionHandler} is {@link yfiles.input.IDragHandler#initializeDrag initialized}, the implementation can {@link yfiles.input.IModelItemCollector#add register} the affected item(s) through the {@link yfiles.input.IModelItemCollector} - * instance that is bound to the {@link yfiles.input.MoveInputMode#createPositionHandlerInputModeContext context} available via its {@link yfiles.graph.ILookup#lookup}. - *

- *

- * Client code can register with the {@link yfiles.input.MoveInputMode#addDragStartedListener DragStarted} event, as - * well as the {@link yfiles.input.MoveInputMode#addDragFinishedListener DragFinished} event to get notified of the - * elements that may be or have been affected respectively by this input mode. - *

- * @type {yfiles.collections.IEnumerable.} - */ - affectedItems:yfiles.collections.IEnumerable; - /** - * Adds the given listener for the DragFinishing event that occurs before the drag will be finished. - * @param listener The listener to add. - * @see yfiles.input.MoveInputMode#removeDragFinishingListener - */ - addDragFinishingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragFinishing event that occurs before the drag will be finished. - * @param listener The listener to remove. - * @see yfiles.input.MoveInputMode#addDragFinishingListener - */ - removeDragFinishingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragFinished event that occurs once the drag has been finished. - * @param listener The listener to add. - * @see yfiles.input.MoveInputMode#removeDragFinishedListener - */ - addDragFinishedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragFinished event that occurs once the drag has been finished. - * @param listener The listener to remove. - * @see yfiles.input.MoveInputMode#addDragFinishedListener - */ - removeDragFinishedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragStarting event that occurs once the drag is starting. - * @param listener The listener to add. - * @see yfiles.input.MoveInputMode#removeDragStartingListener - */ - addDragStartingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragStarting event that occurs once the drag is starting. - * @param listener The listener to remove. - * @see yfiles.input.MoveInputMode#addDragStartingListener - */ - removeDragStartingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragStarted event that occurs once the drag is initialized and has started. - * @param listener The listener to add. - * @see yfiles.input.MoveInputMode#removeDragStartedListener - */ - addDragStartedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragStarted event that occurs once the drag is initialized and has started. - * @param listener The listener to remove. - * @see yfiles.input.MoveInputMode#addDragStartedListener - */ - removeDragStartedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the Dragging event that occurs at the start of every drag. - * @param listener The listener to add. - * @see yfiles.input.MoveInputMode#removeDraggingListener - */ - addDraggingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the Dragging event that occurs at the start of every drag. - * @param listener The listener to remove. - * @see yfiles.input.MoveInputMode#addDraggingListener - */ - removeDraggingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the Dragged event that occurs at the end of every drag. - * @param listener The listener to add. - * @see yfiles.input.MoveInputMode#removeDraggedListener - */ - addDraggedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the Dragged event that occurs at the end of every drag. - * @param listener The listener to remove. - * @see yfiles.input.MoveInputMode#addDraggedListener - */ - removeDraggedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragCanceled event that occurs when the drag has been canceled. - * @param listener The listener to add. - * @see yfiles.input.MoveInputMode#removeDragCanceledListener - */ - addDragCanceledListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragCanceled event that occurs when the drag has been canceled. - * @param listener The listener to remove. - * @see yfiles.input.MoveInputMode#addDragCanceledListener - */ - removeDragCanceledListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragCanceling event that occurs before the drag will be canceled. - * @param listener The listener to add. - * @see yfiles.input.MoveInputMode#removeDragCancelingListener - */ - addDragCancelingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragCanceling event that occurs before the drag will be canceled. - * @param listener The listener to remove. - * @see yfiles.input.MoveInputMode#addDragCancelingListener - */ - removeDragCancelingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.MoveInputMode; - } - /** - * Event argument that is used to query the {@link yfiles.input.IPositionHandler} that is used to move the items while dragging via - * {@link yfiles.input.MoveInputMode}. - * @see yfiles.input.MoveInputMode - * @see yfiles.input.MoveInputMode#addQueryPositionHandlerListener - * @class - * @extends {yfiles.input.InputModeEventArgs} - */ - export interface QueryPositionHandlerEventArgs extends yfiles.input.InputModeEventArgs{} - export class QueryPositionHandlerEventArgs { - /** - * Instantiates a new {@link yfiles.input.QueryPositionHandlerEventArgs} - * @param context The {@link } of the operation. - * @param queryLocation The initial location of the movement. - */ - constructor(context:yfiles.input.IInputModeContext,queryLocation:yfiles.geometry.Point); - /** - * Gets or sets the {@link yfiles.input.IPositionHandler} to use for the movement of the items that are affected by the - * {@link yfiles.input.MoveInputMode}. - * @type {yfiles.input.IPositionHandler} - */ - positionHandler:yfiles.input.IPositionHandler; - /** - * Gets the location of the movement (where the drag has started). - * @type {yfiles.geometry.Point} - */ - queryLocation:yfiles.geometry.Point; - /** - * Gets or sets a value indicating whether this {@link yfiles.input.QueryPositionHandlerEventArgs} has been handled. - * @type {boolean} - */ - handled:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.QueryPositionHandlerEventArgs; - } - export enum InertiaPolicies{ - /** - * Never move the viewport using inertia. - */ - NEVER, - /** - * Move the viewport using inertia when the mouse has been used to drag the viewport. - */ - MOUSE, - /** - * Move the viewport using inertia when touch has been used to drag the viewport. - */ - TOUCH, - /** - * Always move the viewport using inertia no matter what input gesture has been used. - */ - ALWAYS - } - /** - * An {@link yfiles.input.IInputMode} implementation that can be used to grab and drag the viewport of the control it is installed - * in. - *

- * This implementation will request the mutex as soon as it recognizes a drag with the mouse or touch. Zooming is done with - * two fingers using the pinch zoom gesture. If the primary pointer is released during pinch, the secondary pointer is used - * for viewpoint dragging. The pinch zoom then can be restarted by touching another pointer that is recognized as the - * primary pointer. - *

- *

- * This mode is {@link yfiles.input.MoveViewportInputMode#exclusive} by default. - *

- * @class - * @implements {yfiles.input.IInputMode} - */ - export interface MoveViewportInputMode extends yfiles.lang.Object,yfiles.input.IInputMode{} - export class MoveViewportInputMode { - /** - * Creates a new instance of the move viewport mode - */ - constructor(); - /** - * Called to prepare moving the viewport when the mouse is pressed. - *

- * This will set the mouse cursor to {@link yfiles.input.MoveViewportInputMode#dragCursor}. - *

- * @protected - */ - arm():void; - /** - * Cancels navigation. - */ - cancel():void; - /** - * Called after moving the viewport is finished or canceled. - *

- * This will reset the mouse cursor. - *

- * @protected - */ - disarm():void; - /** - * Installs this mode into the given context that is provided by the canvas. - *

- * In general a mode can only be installed into a single canvas at all times. - *

- *

- * This method is called to initialize this instance. Subclasses should override this method to register the corresponding - * event handler delegates for the various input events they need to register with. - *

- *

- * Overriding implementations should call the base implementation, first. - *

- * @param context The context that this instance shall be installed into. The same instance will be passed to this instance during - * {@link #uninstall}. A reference to the context may be kept and queried during the time the mode is - * installed. - * @param controller The {@link #controller} for this mode. - * @see yfiles.input.IInputMode#uninstall - */ - install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; - /** - * Called after {@link yfiles.input.MoveViewportInputMode#cancel} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been canceled. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onCanceled():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been activated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerActivated():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerDeactivated():void; - /** - * Triggers the {@link yfiles.input.MoveViewportInputMode#addDragCanceledListener DragCanceled} event. - * @param evt The event argument that contains context information. - * @protected - */ - onDragCanceled(evt:yfiles.input.InputModeEventArgs):void; - /** - * Triggers the {@link yfiles.input.MoveViewportInputMode#addDragCancelingListener DragCanceling} event. - * @param evt The event argument that contains context information. - * @protected - */ - onDragCanceling(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered once the drag has been finalized. - *

- * This method triggers the {@link yfiles.input.MoveViewportInputMode#addDragFinishedListener DragFinished} - * event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragFinished(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered before the drag will be finalized. - *

- * This method triggers the {@link yfiles.input.MoveViewportInputMode#addDragFinishingListener DragFinishing} - * event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragFinishing(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered at the end of each drag. - *

- * This method triggers the {@link yfiles.input.MoveViewportInputMode#addDraggedListener Dragged} - * event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragged(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered at the start of each drag. - *

- * This method triggers the {@link yfiles.input.MoveViewportInputMode#addDraggingListener Dragging} - * event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragging(evt:yfiles.input.InputModeEventArgs):void; - /** - * Triggers the {@link yfiles.input.MoveViewportInputMode#addDragStartedListener DragStarted} event. - * @param evt The event argument that contains context information. - * @protected - */ - onDragStarted(evt:yfiles.input.InputModeEventArgs):void; - /** - * Triggers the {@link yfiles.input.MoveViewportInputMode#addDragStartingListener DragStarting} event. - * @param evt The event argument that contains context information. - * @protected - */ - onDragStarting(evt:yfiles.input.InputModeEventArgs):void; - /** - * Called after {@link yfiles.input.MoveViewportInputMode#tryStop} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been stopped. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onStopped():void; - /** - * - * @returns - */ - tryStop():boolean; - /** - * - * @param context - */ - uninstall(context:yfiles.input.IInputModeContext):void; - /** - * - * @type {number} - */ - priority:number; - /** - * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. - *

- * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.MoveViewportInputMode#controller}. - *

- *

- * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} - * will be deactivated. Otherwise it will always run concurrently with all other modes. - *

- * @type {boolean} - */ - exclusive:boolean; - /** - * Gets or sets the enabled state of this input mode. - *

- * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed - * {@link yfiles.input.MoveViewportInputMode#controller} so a disabled instance should never try to acquire the input mutex. - *

- * @type {boolean} - */ - enabled:boolean; - /** - * - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Gets the installed {@link yfiles.input.MoveViewportInputMode#controller}. - * @protected - * @type {yfiles.input.ConcurrencyController} - */ - controller:yfiles.input.ConcurrencyController; - /** - * Gets or sets the event recognizer that starts the 'move viewport' gesture. - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - primaryDownRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that moves the viewport or zooms the canvas if a secondary device is down. - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - primaryMoveRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that ends the 'move viewport' or 'pinch' gesture. - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - primaryUpRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that starts the 'pinch' gesture - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - secondaryDownRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that zooms the canvas using the 'pinch' gesture or moves the viewport if no primary - * device is down. - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - secondaryMoveRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that ends the pinch zoom gesture or ends the move if no primary device is down. - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - secondaryUpRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the factor that determines how much the recent movement data is taken into account for the calculation of - * inertia speed and direction. - *

- * The default value is 0.02d - *

- * @default 0.02 - * @type {number} - */ - inertiaFactor:number; - /** - * Gets or sets the threshold that determines when inertia movement should stop. - *

- * The default value is 30 - *

- * @type {number} - */ - inertiaThreshold:number; - /** - * Gets or sets the amount of damping that is applied to the inertia movement. - *

- * The default value is 0.15d - *

- * @type {number} - */ - inertiaDamping:number; - /** - * Gets or sets the mode that determines when to use inertia when dragging the viewport. - * @default yfiles.input.InertiaPolicies.TOUCH - * @type {yfiles.input.InertiaPolicies} - */ - inertia:yfiles.input.InertiaPolicies; - /** - * Gets or sets a value indicating whether to allow the pinch zoom gesture. - * @default true - * @type {boolean} - */ - allowPinchZoom:boolean; - /** - * Gets or sets the cursor to use during the dragging. - *

- * The default is {@link yfiles.view.Cursor#POINTER}. - *

- * @type {yfiles.view.Cursor} - */ - dragCursor:yfiles.view.Cursor; - /** - * Gets or sets the "pressed" state recognizer. - *

- * This recognizer instance will be used to determine when the user begins the navigation gesture. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - pressedRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "dragged" recognizer. - *

- * This recognizer instance determines when the user is dragging the viewport. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - draggedRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "released" recognizer. - *

- * This instance determines when the user has finished dragging the viewport. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - releasedRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Adds the given listener for the Dragging event that occurs at the start of every drag. - * @param listener The listener to add. - * @see yfiles.input.MoveViewportInputMode#removeDraggingListener - */ - addDraggingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the Dragging event that occurs at the start of every drag. - * @param listener The listener to remove. - * @see yfiles.input.MoveViewportInputMode#addDraggingListener - */ - removeDraggingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the Dragged event that occurs at the end of every drag. - * @param listener The listener to add. - * @see yfiles.input.MoveViewportInputMode#removeDraggedListener - */ - addDraggedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the Dragged event that occurs at the end of every drag. - * @param listener The listener to remove. - * @see yfiles.input.MoveViewportInputMode#addDraggedListener - */ - removeDraggedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragFinishing event that occurs before the drag will be finished. - * @param listener The listener to add. - * @see yfiles.input.MoveViewportInputMode#removeDragFinishingListener - */ - addDragFinishingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragFinishing event that occurs before the drag will be finished. - * @param listener The listener to remove. - * @see yfiles.input.MoveViewportInputMode#addDragFinishingListener - */ - removeDragFinishingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragFinished event that occurs once the drag has been finished. - * @param listener The listener to add. - * @see yfiles.input.MoveViewportInputMode#removeDragFinishedListener - */ - addDragFinishedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragFinished event that occurs once the drag has been finished. - * @param listener The listener to remove. - * @see yfiles.input.MoveViewportInputMode#addDragFinishedListener - */ - removeDragFinishedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragStarting event that occurs once the drag is starting. - * @param listener The listener to add. - * @see yfiles.input.MoveViewportInputMode#removeDragStartingListener - */ - addDragStartingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragStarting event that occurs once the drag is starting. - * @param listener The listener to remove. - * @see yfiles.input.MoveViewportInputMode#addDragStartingListener - */ - removeDragStartingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragStarted event that occurs once the drag is initialized and has started. - * @param listener The listener to add. - * @see yfiles.input.MoveViewportInputMode#removeDragStartedListener - */ - addDragStartedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragStarted event that occurs once the drag is initialized and has started. - * @param listener The listener to remove. - * @see yfiles.input.MoveViewportInputMode#addDragStartedListener - */ - removeDragStartedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragCanceled event that occurs when the drag has been canceled. - * @param listener The listener to add. - * @see yfiles.input.MoveViewportInputMode#removeDragCanceledListener - */ - addDragCanceledListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragCanceled event that occurs when the drag has been canceled. - * @param listener The listener to remove. - * @see yfiles.input.MoveViewportInputMode#addDragCanceledListener - */ - removeDragCanceledListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragCanceling event that occurs before the drag will be canceled. - * @param listener The listener to add. - * @see yfiles.input.MoveViewportInputMode#removeDragCancelingListener - */ - addDragCancelingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragCanceling event that occurs before the drag will be canceled. - * @param listener The listener to remove. - * @see yfiles.input.MoveViewportInputMode#addDragCancelingListener - */ - removeDragCancelingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.MoveViewportInputMode; - } - /** - * A composite {@link yfiles.input.IInputMode} implementation that additionally can deal with {@link yfiles.input.ConcurrencyController#exclusive} instances. - *

- * Instances of this class can {@link yfiles.input.MultiplexingInputMode#install} and {@link yfiles.input.MultiplexingInputMode#uninstall} - * multiple {@link yfiles.input.IInputMode}s. Child input modes can be added using the {@link yfiles.input.MultiplexingInputMode#add} - * method. By providing {@link yfiles.input.IInputMode#priority priorities} to the different modes, their {@link yfiles.input.IInputMode#install installation} order can be influenced. Input modes with - * lower priorities are handled earlier. - *

- *

- * Child input modes can run exclusively while they hold the mutex. Other exclusive input modes are temporarily {@link yfiles.input.ConcurrencyController#active deactivated} - * until the mutex is released. This can be controlled by setting the {@link yfiles.input.ConcurrencyController#exclusive} property on the controller. Input modes that disable - * the {@link yfiles.input.ConcurrencyController#exclusive} property will always run concurrently with all other input modes. - *

- *

- * This class itself implements the {@link yfiles.input.IInputMode} interface so that hierarchies of instances of this class can - * easily be built. This class will request the input mutex if one of its child modes requests the mutex. Also if the - * instance itself gets {@link yfiles.input.MultiplexingInputMode#enabled disabled}, it will stop or cancel the current {@link yfiles.input.MultiplexingInputMode#mutexOwner owner of the mutex}. - *

- * @see yfiles.input.MultiplexingInputMode#mutexOwner - * @see yfiles.input.MultiplexingInputMode#add - * @class - * @implements {yfiles.input.IInputMode} - */ - export interface MultiplexingInputMode extends yfiles.lang.Object,yfiles.input.IInputMode{} - export class MultiplexingInputMode { - /** - * Creates an instance with no initial modes. - */ - constructor(); - /** - * Adds the given mode. - *

- * The input modes will be ordered according to their {@link yfiles.input.IInputMode#priority}: Input modes with lower priority will be {@link yfiles.input.IInputMode#install installed} earlier. - *

- *

- * Input modes will run exclusively if the {@link yfiles.input.ConcurrencyController#exclusive} property of their {@link yfiles.input.IInputMode#install installed controller} is set to true. Otherwise they can not - * and will not be deactivated if another {@link yfiles.input.IInputMode} acquires the mutex. - *

- * @param mode The input mode to add to this mode. - * @throws {Stubs.Exceptions.ArgumentError} If the same mode has is already added to this instance. - */ - add(mode:yfiles.input.IInputMode):void; - /** - * Adjusts the cursor of the {@link yfiles.view.CanvasComponent} according to the current input mutex owner or the first mode in - * the list whose {@link yfiles.input.ConcurrencyController} returns a non-null {@link yfiles.input.ConcurrencyController#preferredCursor}. - *

- * This method will set {@link yfiles.input.MultiplexingInputMode#defaultCursor} as the current cursor if no other {@link yfiles.input.ConcurrencyController#preferredCursor} has been specified. - *

- */ - adjustCursor():void; - /** - * Cancels all modes. - */ - cancel():void; - /** - * Callback method that will be used by the {@link yfiles.input.MultiplexingInputMode#createChildInputModeContext child context's} {@link yfiles.graph.ILookup#lookup} method. - * @param type The type argument passed to {@link #lookup}. - * @returns The result of the lookup query, or null. - * @see yfiles.input.MultiplexingInputMode#createChildInputModeContext - * @protected - */ - childInputModeContextLookup(type:yfiles.lang.Class):any; - /** - * Yields an {@link yfiles.input.IInputModeContext} for the child modes of this mode. - *

- * This method is called during {@link yfiles.input.MultiplexingInputMode#install installation} to create a new context for the child modes and can be used by client code to - * obtain a suitable context object. The {@link yfiles.input.MultiplexingInputMode#inputModeContext} property is already set, when this method is called. {@link yfiles.graph.ILookup#lookup} - * calls for the created context will be resolved by this instance's {@link yfiles.input.MultiplexingInputMode#childInputModeContextLookup} - * method. - *

- * @returns A new instance that delegates to the {@link #inputModeContext parent's context.} - * @protected - */ - createChildInputModeContext():yfiles.input.IInputModeContext; - /** - * Helper method that yields a suitably configured {@link yfiles.input.InputModeEventArgs} for this input mode. - * @param context An input mode context that is available in the {@link }. - *

- * Can be null in which case a new context for this instance is created automatically. - *

- * @returns An input mode event argument that is configured for this instance. - * @protected - */ - createInputModeEventArgs(context:yfiles.input.IInputModeContext):yfiles.input.InputModeEventArgs; - /** - * Returns a list of all modes managed by this instance in sorted order. - * @returns A list of the modes. - */ - getSortedModes():yfiles.collections.IList; - /** - * Performs one-time initialization of this instance. - *

- * This method should not be invoked by subclasses. This will be done automatically upon first {@link yfiles.input.MultiplexingInputMode#install installation} of this mode. - *

- *

- * This code will be executed only once per instance. The {@link yfiles.input.MultiplexingInputMode#inputModeContext} property will be null when this code is executed. This method - * should not be used to install this mode into a specific canvas. Subclasses should always call base.Initialize() first. - *

- * @see yfiles.input.MultiplexingInputMode#install - * @protected - */ - initialize():void; - /** - * - * @param context - * @param controller - */ - install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; - /** - * Convenience method for subclass implementations that invalidates the canvas this mode is currently installed in. - * @protected - */ - invalidate():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. - *

- * This implementation reenabled previously disabled concurrent child modes. - *

- * @protected - */ - onConcurrencyControllerActivated():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. - *

- * This implementation sets the {@link yfiles.input.ConcurrencyController#preferredCursor} property to null and {@link yfiles.input.ConcurrencyController#releaseMutex releases} the mutex if the mutex is currently owned by this instance. - * Also, all concurrent child modes will be disabled. - *

- * @protected - */ - onConcurrencyControllerDeactivated():void; - /** - * Removes the given mode from this compound mode. - * @param mode The mode to remove. - */ - remove(mode:yfiles.input.IInputMode):void; - /** - * Called when the {@link yfiles.input.IInputMode#priority} of an {@link yfiles.input.MultiplexingInputMode#add installed} sub mode has changed. - *

- * This implementation {@link yfiles.input.MultiplexingInputMode#uninstall uninstalls} all sub modes and then re-{@link yfiles.input.MultiplexingInputMode#install installs} them according to their new priorities. - *

- * @protected - */ - subModePriorityChanged():void; - /** - * Tries to stop all modes. - * @returns - */ - tryStop():boolean; - /** - * - * @param context - */ - uninstall(context:yfiles.input.IInputModeContext):void; - /** - * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. - *

- * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.MultiplexingInputMode#controller}. - *

- *

- * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} - * will be deactivated. Otherwise it will always run concurrently with all other modes. - *

- * @type {boolean} - */ - exclusive:boolean; - /** - * Gets or sets the enabled state of this input mode. - *

- * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed - * {@link yfiles.input.MultiplexingInputMode#controller} so a disabled instance should never try to acquire the input mutex. - *

- * @type {boolean} - */ - enabled:boolean; - /** - * - * @type {number} - */ - priority:number; - /** - * - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Gets the installed {@link yfiles.input.MultiplexingInputMode#controller}. - * @protected - * @type {yfiles.input.ConcurrencyController} - */ - controller:yfiles.input.ConcurrencyController; - /** - * Gets the {@link yfiles.input.IInputMode} that currently owns the mutex. - * @type {yfiles.input.IInputMode} - */ - mutexOwner:yfiles.input.IInputMode; - /** - * Gets or sets the cursor to use whenever no child mode prefers a different cursor. - *

- * The default is null - *

- * @see yfiles.input.MultiplexingInputMode#adjustCursor - * @default null - * @type {yfiles.view.Cursor} - */ - defaultCursor:yfiles.view.Cursor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.MultiplexingInputMode; - } - /** - * An {@link yfiles.input.IInputMode} that can be used for an overview {@link yfiles.view.CanvasComponent}. - *

- * This mode will add navigation capabilities to the control it is installed in. - *

- * @see yfiles.input.OverviewInputMode#canvasComponent - * @see yfiles.input.OverviewInputMode#handleInputMode - * @see yfiles.input.OverviewInputMode#moveInputMode - * @see yfiles.input.OverviewInputMode#keyboardInputMode - * @see yfiles.input.OverviewInputMode#clickInputMode - * @see yfiles.input.OverviewInputMode#tapInputMode - * @class - * @extends {yfiles.input.MultiplexingInputMode} - */ - export interface OverviewInputMode extends yfiles.input.MultiplexingInputMode{} - export class OverviewInputMode { - /** - * Creates a new instance. - */ - constructor(); - /** - * Factory method for the {@link yfiles.input.OverviewInputMode#clickInputMode} property. - *

- * This method will be called upon first access to the {@link yfiles.input.OverviewInputMode#clickInputMode} property. - *

- * @returns a new instance of ClickInputMode - * @protected - */ - createClickInputMode():yfiles.input.ClickInputMode; - /** - * Factory method for the {@link yfiles.input.OverviewInputMode#handleInputMode} property. - *

- * This method will be called upon first access to the {@link yfiles.input.OverviewInputMode#handleInputMode} property. - *

- * @returns a new instance of {@link } - * @protected - */ - createHandleInputMode():yfiles.input.HandleInputMode; - /** - * Factory method for the {@link yfiles.input.OverviewInputMode#keyboardInputMode} property. - *

- * This method will be called upon first access to the {@link yfiles.input.OverviewInputMode#keyboardInputMode} property. - *

- * @returns a new instance of {@link }. - * @protected - */ - createKeyboardInputMode():yfiles.input.KeyboardInputMode; - /** - * Factory method for the {@link yfiles.input.OverviewInputMode#moveInputMode} property. - *

- * This method will be called upon first access to the {@link yfiles.input.OverviewInputMode#moveInputMode} property. - *

- * @returns a new instance of MoveInputMode - * @protected - */ - createMoveInputMode():yfiles.input.MoveInputMode; - /** - * Factory method for the {@link yfiles.input.OverviewInputMode#tapInputMode} property. - *

- * This method will be called upon first access to the {@link yfiles.input.OverviewInputMode#tapInputMode} property. - *

- * @returns a new instance of TapInputMode - * @protected - */ - createTapInputMode():yfiles.input.TapInputMode; - /** - * Callback method that is used by {@link yfiles.input.OverviewInputMode#createKeyboardInputMode} to determine which of the - * built-in {@link yfiles.input.ICommand}s to install. - *

- * This implementation unconditionally returns true, subclasses may override this method to adjust the behavior. - *

- * @param command The command to install. - * @returns Whether to install this command. - * @protected - */ - shouldInstallCommand(command:yfiles.input.ICommand):boolean; - /** - * Updates the {@link yfiles.view.CanvasComponent#zoom zoom} and {@link yfiles.view.CanvasComponent#viewPoint viewpoint} of the overview control. - *

- * This method is called when the {@link yfiles.view.CanvasComponent#contentRect graph bounds} of the {@link yfiles.input.OverviewInputMode#canvasComponent } have changed. The {@link yfiles.input.OverviewInputMode#margins margins} should be respected. - *

- * @protected - */ - updateVisibleArea():void; - /** - * Gets or sets whether the the canvas this mode is installed in should automatically be invalidated if the client canvas - * gets invalidated. - *

- * Automatic invalidation will be deferred to avoid too frequent updates of the overview. - *

- *

- * To manually update the overview when this property is false, call the {@link yfiles.view.CanvasComponent#invalidate} method on - * the {@link yfiles.view.GraphOverviewComponent}. - *

- * @type {boolean} - */ - autoInvalidate:boolean; - /** - * A resource key that should yield a {@link yfiles.view.IVisualTemplate} that will be used by this mode render the viewport. - *

- * When explicitly setting a {@link yfiles.input.OverviewInputMode#template}, this key will not be used. This is only a fallback if {@link yfiles.input.OverviewInputMode#template} is null. - *

- * @const - * @static - * @type {string} - */ - static VIEWPORT_TEMPLATE_KEY:string; - /** - * Gets the {@link yfiles.input.HandleInputMode}. - *

- * This mode is responsible for handling the single handle that allows to resize the viewport rectangle. - *

- *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.OverviewInputMode#createHandleInputMode} - * will be called. - *

- *

- * By default this input mode has a priority of 10. - *

- * @type {yfiles.input.HandleInputMode} - */ - handleInputMode:yfiles.input.HandleInputMode; - /** - * Gets the {@link yfiles.input.MoveInputMode}. - *

- * This mode is responsible for moving the viewport rectangle. - *

- *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.OverviewInputMode#createMoveInputMode} - * will be called. - *

- *

- * By default this input mode has a priority of 20. - *

- * @type {yfiles.input.MoveInputMode} - */ - moveInputMode:yfiles.input.MoveInputMode; - /** - * Gets the {@link yfiles.input.OverviewInputMode#clickInputMode}. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.OverviewInputMode#createClickInputMode} - * will be called. - *

- *

- * By default this input mode has a priority of 0. - *

- * @type {yfiles.input.ClickInputMode} - */ - clickInputMode:yfiles.input.ClickInputMode; - /** - * Gets the {@link yfiles.input.OverviewInputMode#tapInputMode}. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.OverviewInputMode#createTapInputMode} - * will be called. - *

- *

- * By default this input mode has a priority of 30. - *

- * @type {yfiles.input.TapInputMode} - */ - tapInputMode:yfiles.input.TapInputMode; - /** - * Gets the {@link yfiles.input.KeyboardInputMode}. - *

- * This mode handles all keyboard interaction gestures with the overview control. - *

- *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.OverviewInputMode#createKeyboardInputMode} - * will be called. - *

- *

- * By default this input mode has a priority of 0. - *

- * @type {yfiles.input.KeyboardInputMode} - */ - keyboardInputMode:yfiles.input.KeyboardInputMode; - /** - * Gets the list of commands that are available in this instance. - *

- * Removing commands from this collection also removes the command bindings registered by this instance. - *

- *

- * Add supported commands to make them available in this instance. - *

- *

- * Supported commands are - *

- *
    - *
  • {@link yfiles.input.ICommand#MOVE_LEFT}
  • - *
  • {@link yfiles.input.ICommand#MOVE_RIGHT}
  • - *
  • {@link yfiles.input.ICommand#MOVE_UP}
  • - *
  • {@link yfiles.input.ICommand#MOVE_DOWN}
  • - *
  • {@link yfiles.input.ICommand#ZOOM}
  • - *
  • {@link yfiles.input.ICommand#INCREASE_ZOOM}
  • - *
  • {@link yfiles.input.ICommand#DECREASE_ZOOM}
  • - *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_DOWN}
  • - *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_UP}
  • - *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_LEFT}
  • - *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_RIGHT}
  • - *
  • {@link yfiles.input.ICommand#FIT_CONTENT}
  • - *
  • {@link yfiles.input.ICommand#UPDATE_CONTENT_RECT}
  • - *
- * @type {yfiles.collections.ICollection.} - */ - availableCommands:yfiles.collections.ICollection; - /** - * Gets or sets the canvas this canvas should use to navigate. - * @type {yfiles.view.CanvasComponent} - */ - canvasComponent:yfiles.view.CanvasComponent; - /** - * Gets or sets the template that is used for the visualization of the marquee rectangle. - * @type {yfiles.view.IVisualTemplate} - */ - template:yfiles.view.IVisualTemplate; - /** - * Gets or sets whether the mouse wheel can be used to perform zooming in the {@link yfiles.input.OverviewInputMode#canvasComponent}. - *

- * The default value is true. - *

- * @default true - * @type {boolean} - */ - autoMouseWheelZoom:boolean; - /** - * Gets and sets the insets in view coordinates that should be used by the {@link yfiles.input.OverviewInputMode#updateVisibleArea} - * operation. - *

- * This influences the amount of visible whitespace in the view coordinate system around the graph after the {@link yfiles.view.CanvasComponent#contentRect content rect} - * of the {@link yfiles.input.OverviewInputMode#canvasComponent} has changed. The default value is (5,5,5,5). - *

- * @type {yfiles.geometry.Insets} - */ - margins:yfiles.geometry.Insets; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.OverviewInputMode; - } - /** - * A specialized subclass of {@link yfiles.input.PopulateMenuEventArgs} that carries the {@link yfiles.input.PopulateItemContextMenuEventArgs.#item} for which the context menu should be - * populated. - * Type parameter TModelItem: The type of the {@link yfiles.input.PopulateItemContextMenuEventArgs.#item model item}. - * @class - * @extends {yfiles.input.PopulateMenuEventArgs} - * @template TModelItem - */ - export interface PopulateItemContextMenuEventArgs extends yfiles.input.PopulateMenuEventArgs{} - export class PopulateItemContextMenuEventArgs { - /** - * Initializes a new instance of the {@link yfiles.input.PopulateItemContextMenuEventArgs.} class. - * @param context The context to populate the menu for. - * @param queryLocation The query location. - * @param item The item for which the context menu should be populated, may be null. - */ - constructor(context:yfiles.input.IInputModeContext,queryLocation:yfiles.geometry.Point,item:TModelItem); - /** - * Gets the item for which the tool tip is queried. - * @type {TModelItem} - */ - item:TModelItem; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.PopulateItemContextMenuEventArgs; - } - /** - * A specialized subclass of {@link yfiles.input.ToolTipQueryEventArgs} that carries the {@link yfiles.input.QueryItemToolTipEventArgs.#item} for which the tool tip is queried. - * Type parameter TModelItem: The type of the {@link yfiles.input.QueryItemToolTipEventArgs.#item model item}. - * @class - * @extends {yfiles.input.ToolTipQueryEventArgs} - * @template TModelItem - */ - export interface QueryItemToolTipEventArgs extends yfiles.input.ToolTipQueryEventArgs{} - export class QueryItemToolTipEventArgs { - /** - * Initializes a new instance of the {@link yfiles.input.QueryItemToolTipEventArgs.} class. - * @param context The context to yield the tool tip for. - * @param queryLocation The query location. - * @param item The item for which the tool tip is queried.. - */ - constructor(context:yfiles.input.IInputModeContext,queryLocation:yfiles.geometry.Point,item:TModelItem); - /** - * Gets the item for which the tool tip is queried. - * @type {TModelItem} - */ - item:TModelItem; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.QueryItemToolTipEventArgs; - } - /** - * A simple convenience implementation of an {@link yfiles.input.IReshapeHandleProvider} that returns handles that modify a - * {@link yfiles.geometry.IMutableRectangle}. - * @class - * @extends {yfiles.input.ReshapeHandleProviderBase} - */ - export interface RectangleReshapeHandleProvider extends yfiles.input.ReshapeHandleProviderBase{} - export class RectangleReshapeHandleProvider { - /** - * Creates a default instance that provide handles for each of the positions given for the rectangle. - * @param rectangle The rectangle to create handles for. - * @param [handlePositions=yfiles.input.HandlePositions.BORDER] A bitwise combination of all handle positions this instance should provide a handle for. - */ - constructor(rectangle:yfiles.geometry.IMutableRectangle,handlePositions?:yfiles.input.HandlePositions); - /** - * Gets the rectangle to read the current state from. - * @protected - * @type {yfiles.geometry.IMutableRectangle} - */ - rectangle:yfiles.geometry.IMutableRectangle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.RectangleReshapeHandleProvider; - } - /** - * Abstract base class implementation of the {@link yfiles.input.IReshapeHandleProvider} interface that has properties to restrict - * the size and area of a reshapeable. - * @class - * @implements {yfiles.input.IReshapeHandleProvider} - */ - export interface ReshapeHandleProviderBase extends yfiles.lang.Object,yfiles.input.IReshapeHandleProvider{} - export class ReshapeHandleProviderBase { - constructor(); - /** - * Returns the {@link yfiles.input.ReshapeHandleProviderBase#handlePositions} property. - * @param context - * @returns A bitwise combination of all handle positions this instance provides a handle for if queried in - * {@link #getHandle}. - */ - getAvailableHandles(context:yfiles.input.IInputModeContext):yfiles.input.HandlePositions; - /** - * Provides a {@link yfiles.input.IHandle} that uses the rectangle and reshapeable instance bound to this instance to perform the - * actual reshaping. - *

- * This method may be called for each possible single position contained in the set as returned by - * {@link yfiles.input.ReshapeHandleProviderBase#getAvailableHandles}. - *

- * @param context The context for which the handles are queried. - * @param position The position to provide an instance for. - * @returns A handle implementation. - * @abstract - */ - getHandle(context:yfiles.input.IInputModeContext,position:yfiles.input.HandlePositions):yfiles.input.IHandle; - /** - * Gets or sets the minimum size allowed for the reshapeable. - *

- * The default value is {@link yfiles.geometry.Size#ZERO}. - *

- * @see yfiles.input.RectangleHandle#minimumSize - * @type {yfiles.geometry.ISize} - */ - minimumSize:yfiles.geometry.ISize; - /** - * Gets or sets the minimum rectangular area that needs to be contained in the reshapeable. - *

- * The default value is {@link yfiles.geometry.Size#ZERO}. - *

- * @see yfiles.input.RectangleHandle#minimumEnclosedArea - * @type {yfiles.geometry.IRectangle} - */ - minimumEnclosedArea:yfiles.geometry.IRectangle; - /** - * Gets or sets the maximum size allowed for the reshapeable. - *

- * The default value is {@link yfiles.geometry.Size#INFINITE}. - *

- * @see yfiles.input.RectangleHandle#maximumSize - * @type {yfiles.geometry.ISize} - */ - maximumSize:yfiles.geometry.ISize; - /** - * Gets or sets the bitwise combination of all handle positions this instance provides a handle for. - * @see yfiles.input.ReshapeHandleProviderBase#getAvailableHandles - * @see yfiles.input.RectangleReshapeHandleProvider#getHandle - * @type {yfiles.input.HandlePositions} - */ - handlePositions:yfiles.input.HandlePositions; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.ReshapeHandleProviderBase; - } - /** - * Event arguments that are used when modifying a {@link yfiles.view.ISelectionModel.} - * Type parameter T: The type of the items in the {@link yfiles.view.ISelectionModel.}. - * @class - * @extends {yfiles.input.InputModeEventArgs} - * @template T - */ - export interface SelectionEventArgs extends yfiles.input.InputModeEventArgs{} - export class SelectionEventArgs { - /** - * Creates a new instance. - * @param context The context the event with these event args is dispatched. - * @param selection The selection that is modified. - */ - constructor(context:yfiles.input.IInputModeContext,selection:yfiles.view.ISelectionModel); - /** - * Gets the selection these event arguments refer to. - * @type {yfiles.view.ISelectionModel.} - */ - selection:yfiles.view.ISelectionModel; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.SelectionEventArgs; - } - /** - * Manages interactive snapping of elements to other elements during drag operations like movements. - *

- * This class should be used by {@link yfiles.input.IInputMode} implementations and similar code as follows: - *

- *
    - *
  • To initialize the operation {@link yfiles.input.SnapContext#initializeDrag} needs to be called.
  • - *
  • - * Method {@link yfiles.input.SnapContext#dragInitialized} needs to be called after the mode has performed all of its own - * initialization. - *
  • - *
  • - * Then a series of zero or more invocations {@link yfiles.input.SnapContext#handleMove} needs to be called for each incremental - * movement of the user's input device. - *
  • - *
  • - * After {@link yfiles.input.SnapContext#handleMove} has been called, the mode should perform the move and report back to the - * instance by calling the {@link yfiles.input.SnapContext#dragged} method. - *
  • - *
  • If the operation is canceled by the user {@link yfiles.input.SnapContext#cancelDrag} should be called.
  • - *
  • If the operation is finalized the {@link yfiles.input.SnapContext#dragFinished} method should be called.
  • - *
- * @see yfiles.input.HandleInputMode#snapContext - * @see yfiles.input.MoveInputMode#snapContext - * @see yfiles.input.SnapContext#createSnapResultsModelManager - * @class - */ - export interface SnapContext extends yfiles.lang.Object{} - export class SnapContext { - /** - * Initializes a new instance of the {@link yfiles.input.SnapContext} class. - */ - constructor(); - /** - * Called when a drag has been canceled. - *

- * Clears all temporary lists and sets {@link yfiles.input.SnapContext#isInitialized} back to false, as well as performs {@link yfiles.input.SnapContext#cleanUp} and finally - * triggers the {@link yfiles.input.SnapContext#addCleanedUpListener CleanedUp} event. - *

- */ - cancelDrag():void; - /** - * Performs clean up procedures. - *

- * This is called in response to {@link yfiles.input.SnapContext#cancelDrag} and {@link yfiles.input.SnapContext#dragFinished} as well as - * initially during {@link yfiles.input.SnapContext#initializeDrag}. - *

- * @protected - */ - cleanUp():void; - /** - * Helper method used by {@link yfiles.input.SnapContext#createSnapResultsModelManager} to create the {@link yfiles.view.ICanvasObjectDescriptor} - * for the {@link yfiles.input.SnapResult} type. - * @returns An instance that can install {@link }s in a {@link }. - */ - createSnapResultCanvasObjectDescriptor():yfiles.view.ICanvasObjectDescriptor; - /** - * Helper method that creates the a {@link yfiles.view.CollectionModelManager.} that can be used to present the current {@link yfiles.input.SnapResult}s in the provided - * {@link yfiles.view.CanvasComponent}. - * @param canvas The control to initialize the {@link } with. - * @returns The model manager that manages the visual representation of the {@link }s. - */ - createSnapResultsModelManager(canvas:yfiles.view.CanvasComponent):yfiles.view.CollectionModelManager; - /** - * Called when a drag has been successfully finished. - *

- * Clears all temporary lists and sets {@link yfiles.input.SnapContext#isInitialized} back to false. Also the {@link yfiles.input.SnapContext#cleanUp} method is invoked and the - * {@link yfiles.input.SnapContext#addCleanedUpListener CleanedUp} event is triggered. - *

- * @param newLocation The current mouse location. - * @param snappingDisabled If set to true snapping is temporarily disabled. This will remove the snap line visualizations and return a {@link } - * with the unchanged coordinates and the {@link #NOT_SNAPPED} {@link #snapType}. - * @returns A {@link } that specifies the adjusted coordinates and how they have been adjusted. The unchanged - * coordinates if snapping has been temporarily disabled by setting snappingDisabled to true. - */ - dragFinished(newLocation:yfiles.geometry.Point,snappingDisabled:boolean):yfiles.input.SnapState; - /** - * This method needs to be called by the client {@link yfiles.input.IInputMode} that {@link yfiles.input.SnapContext#initializeDrag initialized} this instance after it has - * performed the actual move operation with the adjusted coordinates after a call to {@link yfiles.input.SnapContext#handleMove}. - *

- * Most of the client code implementations will just call this method with the exact values returned by - * {@link yfiles.input.SnapContext#handleMove}. This method does not need to be called if snapping has been temporarily disabled by - * calling {@link yfiles.input.SnapContext#handleMove} with its snappingDisabled parameter set to true. - *

- * @param mouseLocation The actual mouse location. - * @param finalSnapState The final snap state that contains the location that has been used by the client code for the move and how it has been - * snapped. - */ - dragged(mouseLocation:yfiles.geometry.Point,finalSnapState:yfiles.input.SnapState):void; - /** - * Collects a list of snap lines. - *

- * Snap lines represent possible horizontal or vertical lines to which a moved item can "snap". - *

- *

- * This method is called at the start of {@link yfiles.input.MoveInputMode}'s or - * {@link yfiles.input.HandleInputMode}'s gesture after all items to be moved or reshaped have been added. - *

- */ - dragInitialized():void; - /** - * Handles a move. - *

- * This method returns the adjusted (mouse) coordinates. It also manages the collection of {@link yfiles.input.SnapResult}s. If - * snapping should be temporarily (for a mouse move) disabled, snappingDisabled has to be set to true. - *

- * @param newLocation The current mouse location. - * @param snappingDisabled If set to true snapping is temporarily disabled. This will remove the snap line visualizations and return a {@link } - * with the unchanged coordinates and the {@link #snapType} {@link #NOT_SNAPPED}. - * @returns The adjusted coordinates and how they have been adjusted. The unchanged coordinates if snapping has been temporarily - * disabled by setting snappingDisabled to true. - */ - handleMove(newLocation:yfiles.geometry.Point,snappingDisabled:boolean):yfiles.input.SnapState; - /** - * Called by {@link yfiles.input.IInputMode} implementations when an interactive drag is started. - *

- * Updates {@link yfiles.input.SnapContext#isInitializing}, {@link yfiles.input.SnapContext#originalLocation}, and {@link yfiles.input.SnapContext#currentInputModeContext} and then triggers the {@link yfiles.input.SnapContext#addInitializingListener Initializing} event. - *

- * @param context The context in which the interactive drag is started. - * @param originalLocation The original location of the mouse. - * @throws {Stubs.Exceptions.InvalidOperationError} If this context is already {@link yfiles.input.SnapContext#isInitialized initialized}. - */ - initializeDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; - /** - * Raises the {@link yfiles.input.SnapContext#cleanUp} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onCleanUp(evt:yfiles.input.InputModeEventArgs):void; - /** - * Raises the {@link yfiles.input.SnapContext#addCollectSnapResultsListener CollectSnapResults} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onCollectSnapResults(evt:yfiles.input.CollectSnapResultsEventArgs):void; - /** - * Raises the {@link yfiles.input.SnapContext#addInitializedListener Initialized} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onInitialized(evt:yfiles.input.InputModeEventArgs):void; - /** - * Raises the {@link yfiles.input.SnapContext#addInitializingListener Initializing} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onInitializing(evt:yfiles.input.InputModeEventArgs):void; - /** - * Chooses the current {@link yfiles.input.SnapResult}s from a temporary list. - *

- * Chooses from a list of possible results the most important ones. Also maintains the collection of snap results. - *

- * @param snapResults A temporary list of suggested {@link }s. - * @param originalLocation The point in world coordinates where the mouse move started. - * @param newLocation The current mouse location. - * @returns The adjusted coordinates and how they have been adjusted. - * @protected - */ - processSnapResults(snapResults:yfiles.collections.List,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):yfiles.input.SnapState; - /** - * Helper method that wraps the given context so that a {@link yfiles.graph.ILookup#lookup} query on the wrapped context for the {@link yfiles.input.SnapContext} - * type yields this instance. - * @param context The context to wrap and delegate all calls to. - * @returns A modified instance that yields this instance if it is queried for the {@link } type. - */ - wrapContext(context:yfiles.input.IInputModeContext):yfiles.input.IInputModeContext; - /** - * Adds the given listener for the CollectSnapResults event that occurs while {@link yfiles.input.IDragHandler#handleMove moving} items and handles. - *

- * The moving model items must register for this event, preferably in the {@link yfiles.input.IDragHandler#initializeDrag} method - * of the {@link yfiles.input.IDragHandler}. - *

- *

- * The event handler has to add {@link yfiles.input.SnapResult}s for the moving object to the list. The - * {@link yfiles.input.IDragHandler}s of the moved items have to take care themselves whether to add a handler to the list - * depending on the their settings. - *

- * @param listener The listener to add. - * @see yfiles.input.SnapContext#removeCollectSnapResultsListener - */ - addCollectSnapResultsListener(listener:(sender:any,evt:yfiles.input.CollectSnapResultsEventArgs)=>void):void; - /** - * Removes the given listener for the CollectSnapResults event that occurs while {@link yfiles.input.IDragHandler#handleMove moving} items and handles. - *

- * The moving model items must register for this event, preferably in the {@link yfiles.input.IDragHandler#initializeDrag} method - * of the {@link yfiles.input.IDragHandler}. - *

- *

- * The event handler has to add {@link yfiles.input.SnapResult}s for the moving object to the list. The - * {@link yfiles.input.IDragHandler}s of the moved items have to take care themselves whether to add a handler to the list - * depending on the their settings. - *

- * @param listener The listener to remove. - * @see yfiles.input.SnapContext#addCollectSnapResultsListener - */ - removeCollectSnapResultsListener(listener:(sender:any,evt:yfiles.input.CollectSnapResultsEventArgs)=>void):void; - /** - * Adds the given listener for the CleanedUp event that occurs when this instance has been cleaned up. - * @param listener The listener to add. - * @see yfiles.input.SnapContext#cleanUp - * @see yfiles.input.SnapContext#removeCleanedUpListener - */ - addCleanedUpListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the CleanedUp event that occurs when this instance has been cleaned up. - * @param listener The listener to remove. - * @see yfiles.input.SnapContext#cleanUp - * @see yfiles.input.SnapContext#addCleanedUpListener - */ - removeCleanedUpListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the Initialized event that occurs when this instance has been initialized. - * @param listener The listener to add. - * @see yfiles.input.SnapContext#initializeDrag - * @see yfiles.input.SnapContext#removeInitializedListener - */ - addInitializedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the Initialized event that occurs when this instance has been initialized. - * @param listener The listener to remove. - * @see yfiles.input.SnapContext#initializeDrag - * @see yfiles.input.SnapContext#addInitializedListener - */ - removeInitializedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the Initializing event that occurs when this instance is about to be initialized. - * @param listener The listener to add. - * @see yfiles.input.SnapContext#initializeDrag - * @see yfiles.input.SnapContext#removeInitializingListener - */ - addInitializingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the Initializing event that occurs when this instance is about to be initialized. - * @param listener The listener to remove. - * @see yfiles.input.SnapContext#initializeDrag - * @see yfiles.input.SnapContext#addInitializingListener - */ - removeInitializingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Gets or sets a value indicating whether to visualize the snap results. - * @see yfiles.input.SnapContext#createSnapResultsModelManager - * @type {boolean} - */ - visualizeSnapResults:boolean; - /** - * Gets or sets a value indicating whether this instance is currently initializing. - * @see yfiles.input.SnapContext#addInitializedListener - * @see yfiles.input.SnapContext#addInitializingListener - * @see yfiles.input.SnapContext#isInitialized - * @type {boolean} - */ - isInitializing:boolean; - /** - * Gets the current input mode context. - * @protected - * @type {yfiles.input.IInputModeContext} - */ - currentInputModeContext:yfiles.input.IInputModeContext; - /** - * Gets the collection of {@link yfiles.input.SnapResult}s. - *

- * This collection is automatically updated during moving the mouse. - *

- * @type {yfiles.collections.IObservableCollection.} - */ - snapResults:yfiles.collections.IObservableCollection; - /** - * Gets whether the context is initialized. - *

- * The context is initialized between the calls to {@link yfiles.input.SnapContext#dragInitialized} and {@link yfiles.input.SnapContext#dragFinished} - * or {@link yfiles.input.SnapContext#cancelDrag}. - *

- * @type {boolean} - */ - isInitialized:boolean; - /** - * Gets or sets the global snap distance, which is the maximum distance between the current mouse coordinates and the - * coordinates to which the mouse will snap. - *

- * The distance is interpreted in view coordinates. - *

- *

- * The default is 5.0d - *

- * @see yfiles.input.CollectSnapResultsEventArgs#snapDistance - * @type {number} - */ - snapDistance:number; - /** - * Gets the original location of the mouse at the time the gesture was initialized. - * @see yfiles.input.SnapContext#initializeDrag - * @type {yfiles.geometry.Point} - */ - originalLocation:yfiles.geometry.Point; - /** - * Gets or sets a value indicating whether this {@link yfiles.input.SnapContext} is enabled. - * @type {boolean} - */ - enabled:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.SnapContext; - } - /** - * This is the abstract base class used by the implementers of {@link yfiles.input.SnapContext} to model the result of the mouse - * being snapped to a certain location. - *

- * It carries a {@link yfiles.input.SnapResult#weight} and can be used to obtain a {@link yfiles.view.IVisualCreator} that will be included in the view if the result is - * actually {@link yfiles.input.SnapResult#isSnapped snapped} after all other results with higher weight have been {@link yfiles.input.SnapResult#snap snapped}. - *

- * @class - * @implements {yfiles.lang.IComparable} - */ - export interface SnapResult extends yfiles.lang.Object,yfiles.lang.IComparable{} - export class SnapResult { - /** - * Factory method that creates a {@link yfiles.input.SnapResult} to which a {@link yfiles.graph.ILabel} will snap, based on the given - * snapLine. - * @param layoutParameter The {@link } which represents the position to snap to. - * @param weight The weight of this result. The higher the weight, the more important it is. - * @param delta The value to add to the mouse coordinates to snap to this result. - * @param tag The tag associated with this result. If more than one result uses the same tag (not null), only the one with the highest - * {@link #weight} will be rendered. - * @param snapLine The snap line this class would snap to or null if it doesn't snap to a SnapLine. - * @param snappedCoordinates The coordinates at the moved item at which the drawn snap line should end. - * @param movedObject The moved object for which this result is created. - * @returns - * @static - */ - static createLabelSnapResult(layoutParameter:yfiles.graph.ILabelModelParameter,weight:number,delta:yfiles.geometry.Point,tag:any,snapLine:yfiles.input.SnapLine,snappedCoordinates:yfiles.geometry.Point,movedObject:any):yfiles.input.SnapResult; - /** - * Factory method that creates a {@link yfiles.input.SnapResult} that snaps to a given location. - * @param location The location to snap to. - * @param weight The weight to assign to the result. - * @param tag The tag associated with this result. If more than one result uses the same tag (not null), only the one with the highest - * {@link #weight} will be rendered. - * @param visualCreator The visual creator to use. - * @param snapType The type of the snapping operation to apply. - * @returns A result that snaps to the provided location using the provided mode. - * @static - */ - static createPointSnapResult(location:yfiles.geometry.Point,weight:number,tag:any,visualCreator:yfiles.view.IVisualCreator,snapType:yfiles.input.SnapTypes):yfiles.input.SnapResult; - /** - * Factory method that creates a {@link yfiles.input.SnapResult} which snaps to a given size through a resize operation. - * @param weight The weight of this result. The higher the weight, the more important it is. - * @param delta The value to add to the mouse coordinates to snap to this result. - * @param tag The tag associated with this result. If more than one result uses the same tag (not null), only the one with the highest - * {@link #weight} will be rendered. - * @param rectangles The rectangles that have the same width or height as the node will. The rectangle are used for visualization and should - * include all objects for which a visualization should be displayed. Typically, these are all objects which have the same - * size and the object which is currently reshaped. - * @param size The target size to which the resized object will snap. - * @param horizontal Indicates whether width or height should snap. true if the width should snap. - * @returns - * @static - */ - static createResizeSnapResult(weight:number,delta:number,tag:any,rectangles:yfiles.collections.IEnumerable,size:number,horizontal:boolean):yfiles.input.SnapResult; - /** - * Factory method that creates a {@link yfiles.input.SnapResult} which represents a {@link yfiles.input.SnapLine} to which the current - * moved item will potentially snap. - * @param weight The weight of this result. The higher the weight, the more important it is. - * @param delta The value to add to the mouse coordinates to snap to this result. - * @param tag The tag associated with this result. If more than one result uses the same tag (not null), only the one with the highest - * {@link #weight} will be rendered. - * @param snapLine The snap line this class would snap to or null if it doesn't snap to a SnapLine. - * @param snappedLocation The coordinates at the moved item at which the drawn snap line should end. - * @param movedObject The moved object for which this result is created. - * @returns - * @static - */ - static createSnapLineSnapResult(weight:number,delta:yfiles.geometry.Point,tag:any,snapLine:yfiles.input.SnapLine,snappedLocation:yfiles.geometry.Point,movedObject:any):yfiles.input.SnapResult; - /** - * Returns a {@link yfiles.view.IVisualCreator} instance that can be used to create a {@link yfiles.view.Visual} for this result. - * @returns A visual creator which creates a {@link } which depicts this snap result. - * @see yfiles.view.VoidVisualCreator#INSTANCE - * @abstract - */ - getVisualCreator():yfiles.view.IVisualCreator; - /** - * Checks whether this instance is still snapped given the final mouse location. - *

- * This implementation simply returns false. - *

- * @param unsnappedLocation The unsnapped location. - * @param finalSnapState The final snap state that has been used by the client. - * @returns Whether the location are still snapped for this instance. - */ - isSnapped(unsnappedLocation:yfiles.geometry.Point,finalSnapState:yfiles.input.SnapState):boolean; - /** - * Core method that performs the actual snapping. - *

- * This implementation does nothing. - *

- * @param unsnappedLocation The location prior to the snapping. - * @param currentSnapState The currently snapped location and the state of the snapping. This instance can be modified by subclasses. - */ - snap(unsnappedLocation:yfiles.geometry.Point,currentSnapState:yfiles.input.SnapState):void; - /** - * Gets the weight of this result. - *

- * Higher weights represent more important results. - *

- * @type {number} - */ - weight:number; - /** - * Gets the tag associated with this result. - *

- * If more than one result uses the same tag (not null), only the one with the highest {@link yfiles.input.SnapResult#weight} will be rendered. - *

- * @type {any} - */ - tag:any; - /** - * Gets a {@link yfiles.input.SnapResult} representing that there is no snapping of the x or y coordinate. - * @static - * @type {yfiles.input.SnapResult} - */ - static NULL_RESULT:yfiles.input.SnapResult; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.SnapResult; - } - export enum SnapTypes{ - /** - * Indicates that the location has been snapped to its x value. - *

- * Constant for use in {@link yfiles.input.SnapResult#snap} and {@link yfiles.input.SnapResult#isSnapped}. The methods can take a bitwise - * combination of this field and {@link yfiles.input.SnapTypes#SNAPPED_Y}, {@link yfiles.input.SnapTypes#SNAPPED_X_Y} and - * {@link yfiles.input.SnapTypes#NOT_SNAPPED}. - *

- */ - SNAPPED_X, - /** - * Indicates that the location has been snapped to its y value. - *

- * Constant for use in {@link yfiles.input.SnapResult#snap} and {@link yfiles.input.SnapResult#isSnapped}. The methods can take a bitwise - * combination of this field and {@link yfiles.input.SnapTypes#SNAPPED_X}, {@link yfiles.input.SnapTypes#SNAPPED_X_Y} and - * {@link yfiles.input.SnapTypes#NOT_SNAPPED}. - *

- */ - SNAPPED_Y, - /** - * Indicates that the location has been snapped to its x and y values. - *

- * Constant for use in {@link yfiles.input.SnapResult#snap} and {@link yfiles.input.SnapResult#isSnapped}. This is a bitwise combination of - * {@link yfiles.input.SnapTypes#SNAPPED_X} and {@link yfiles.input.SnapTypes#SNAPPED_Y}. - *

- */ - SNAPPED_X_Y, - /** - * Indicates that the location has not been snapped at all. - *

- * Constant for use in {@link yfiles.input.SnapResult#snap} and {@link yfiles.input.SnapResult#isSnapped}. - *

- */ - NOT_SNAPPED - } - /** - * Describes the state of a snapping operation. - *

- * This class is used by {@link yfiles.input.SnapContext} to {@link yfiles.input.SnapContext#processSnapResults process} {@link yfiles.input.SnapResult#snap snap results}. - *

- * @class - * @final - */ - export interface SnapState extends yfiles.lang.Object{} - export class SnapState { - /** - * Initializes a new instance of the {@link yfiles.input.SnapState} class. - * @param location The initial location. - * @param [snapType=yfiles.input.SnapTypes.NOT_SNAPPED] The current type of the snap. - */ - constructor(location:yfiles.geometry.Point,snapType?:yfiles.input.SnapTypes); - /** - * Sets the {@link yfiles.input.SnapState#location} to the given point and adjusts the {@link yfiles.input.SnapState#snapType} accordingly. - * @param newLocation The new location. - */ - snapTo(newLocation:yfiles.geometry.Point):void; - /** - * Modifies the X property of the {@link yfiles.input.SnapState#location} and adjusts the {@link yfiles.input.SnapState#snapType} accordingly. - * @param newX The new X. - */ - snapX(newX:number):void; - /** - * Modifies the Y property of the {@link yfiles.input.SnapState#location} and adjusts the {@link yfiles.input.SnapState#snapType} accordingly. - * @param newY The new Y. - */ - snapY(newY:number):void; - /** - * Gets the current location. - * @type {yfiles.geometry.Point} - */ - location:yfiles.geometry.Point; - /** - * Gets or sets the type of the snap. - * @type {yfiles.input.SnapTypes} - */ - snapType:yfiles.input.SnapTypes; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.SnapState; - } - /** - * Event arguments used by {@link yfiles.input.TapInputMode#addTappedListener Tapped}. - * @class - * @extends {yfiles.input.InputModeEventArgs} - */ - export interface TapEventArgs extends yfiles.input.InputModeEventArgs{} - export class TapEventArgs { - /** - * Initializes a new instance of the {@link yfiles.input.TapEventArgs} class. - * @param context The context in which the tap occurred. - * @param location The location. - */ - constructor(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point); - /** - * Initializes a new instance of the {@link yfiles.input.TapEventArgs} class. - * @param location The location. - */ - constructor(location:yfiles.geometry.Point); - /** - * Gets the location of the tap. - * @type {yfiles.geometry.Point} - */ - location:yfiles.geometry.Point; - /** - * Gets or sets a value indicating whether this {@link yfiles.input.TapEventArgs} have been handled. - *

- * Client code that is triggered by the event and does not want the event to become handled by other handles should set - * this property to true to stop propagation of the event. - *

- * @type {boolean} - */ - handled:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.TapEventArgs; - } - export enum TapHandlingPolicy{ - /** - * Using this mode, in case of a double tap, only the double tap is reported, but neither of the two single taps. - *

- * Single taps will be reported with a short delay to ensure that they do not become double taps. - *

- */ - DOUBLE_TAP_ONLY, - /** - * In this mode, in case of a double tap, only one single tap is reported and one double tap. - *

- * The second tap for the double tap is not reported as a single tap. - *

- */ - INITIAL_SINGLE_AND_DOUBLE_TAP, - /** - * In this mode, every tap (both single tap and either of the taps of a multi-tap) is reported as a single tap and every - * double tap is reported as a double tap. - */ - BOTH_SINGLE_TAPS_AND_DOUBLE_TAP - } - /** - * An input mode that recognizes simple touch taps. - *

- * Clients register to {@link yfiles.input.TapInputMode#addTappedListener Tapped} to get notified of touch taps. - * This mode can be instructed to {@link yfiles.input.TapInputMode#swallowFocusTap swallow taps} if they lead happen shortly after the control gained focus. This is useful - * to prevent accidental taps from being processed if the user wanted to put the focus into the control, only. - *

- *

- * This mode is {@link yfiles.input.TapInputMode#exclusive} by default. - *

- * @see yfiles.input.TapInputMode#tapHandlingPolicy - * @see yfiles.input.TapInputMode#swallowFocusTap - * @class - * @implements {yfiles.input.IInputMode} - */ - export interface TapInputMode extends yfiles.lang.Object,yfiles.input.IInputMode{} - export class TapInputMode { - /** - * Creates a new instance of this mode that detects touch taps. - */ - constructor(); - /** - * Cancels the editing of this mode. - *

- * This implementation {@link yfiles.input.ConcurrencyController#releaseMutex releases} the mutex if it is currently owned by this instance and calls - * {@link yfiles.input.TapInputMode#onCanceled}. - *

- * @see yfiles.input.TapInputMode#onCanceled - */ - cancel():void; - /** - * Creates the event recognizer that is used to recognize the press event for this instance. - * @returns - * @protected - */ - createPressRecognizer():(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Creates the event recognizer that is used to recognize the release event for this instance. - * @returns - * @protected - */ - createReleaseRecognizer():(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Creates the event recognizer that is used to recognize the taps for this instance. - * @returns - * @protected - */ - createTapRecognizer():(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Installs this mode into the given context that is provided by the canvas. - *

- * In general a mode can only be installed into a single canvas at all times. - *

- *

- * This method is called to initialize this instance. Subclasses should override this method to register the corresponding - * event handler delegates for the various input events they need to register with. - *

- *

- * Overriding implementations should call the base implementation, first. - *

- * @param context The context that this instance shall be installed into. The same instance will be passed to this instance during - * {@link #uninstall}. A reference to the context may be kept and queried during the time the mode is - * installed. - * @param controller The {@link } for this mode. - * @see yfiles.input.IInputMode#uninstall - */ - install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; - /** - * Determines whether the given event is a press event that occurred at an invalid location. - * @param eventSource - * @param evt - * @returns - * @see yfiles.input.TapInputMode#validTapHitTestable - * @protected - */ - isInvalidPress(eventSource:any,evt:yfiles.lang.EventArgs):boolean; - /** - * Determines whether the given event is a valid press event. - * @param eventSource - * @param evt - * @returns - * @protected - */ - isValidPress(eventSource:any,evt:yfiles.lang.EventArgs):boolean; - /** - * Determines whether the given event is a valid release event. - * @param eventSource - * @param evt - * @returns - * @protected - */ - isValidRelease(eventSource:any,evt:yfiles.lang.EventArgs):boolean; - /** - * Determines whether the given event is a valid tap event. - * @param eventSource - * @param evt - * @returns - * @protected - */ - isValidTap(eventSource:any,evt:yfiles.lang.EventArgs):boolean; - /** - * Called after {@link yfiles.input.TapInputMode#cancel} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been canceled. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onCanceled():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been activated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerActivated():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerDeactivated():void; - /** - * Called once this mode has recognized a double-tap gesture. - *

- * This method will trigger the {@link yfiles.input.TapInputMode#addDoubleTappedListener DoubleTapped} event. - *

- * @param evt The arguments. - * @protected - */ - onDoubleTapped(evt:yfiles.input.TapEventArgs):void; - /** - * Called after {@link yfiles.input.TapInputMode#tryStop} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been stopped. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onStopped():void; - /** - * Called once this mode has recognized a tap gesture. - *

- * This method will trigger the {@link yfiles.input.TapInputMode#addTappedListener Tapped} event. - *

- * @param evt The arguments. - * @protected - */ - onTapped(evt:yfiles.input.TapEventArgs):void; - /** - * Prevents a double-tap event from being issued if the next tap would do so and sends only a single tap instead. - *

- * The intention is for "breaking" a double tap if an input mode using {@link yfiles.input.TapInputMode} performs actions that - * would lead to surprising behavior if the next tap would lead to a double-tap. Examples of this are - * {@link yfiles.input.GraphEditorInputMode}'s selection cycling where several taps in short succession may occur, as well as - * creating a node by tapping on the canvas and selecting it immediately afterwards with another tap. - *

- *

- * This method's effect is very short-lived. It really only prevents a double-tap event for the very next tap that this - * input mode handles. The internal flag set by this method is re-set on every tap received. This also means that if you - * call this method and the next tap is just a regular single-tap the flag is cleared nonetheless. - *

- */ - preventNextDoubleTap():void; - /** - * Returns and resets the flag set by {@link yfiles.input.TapInputMode#preventNextDoubleTap}. - *

- * To ensure that the flag really acts just once, this method resets the flag and returns its value prior to the reset. - *

- * @returns - * @protected - */ - queryAndResetPreventNextDoubleTap():boolean; - /** - * - * @returns - */ - tryStop():boolean; - /** - * Uninstalls this mode from the given context. - *

- * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} method. After a mode has - * been uninstalled it can be installed again into the same or another canvas. - *

- *

- * Overriding implementations should call the base implementation after their own code. - *

- * @param context The context to deregister from. This is the same instance that had been passed to {@link #install} during - * installation. - */ - uninstall(context:yfiles.input.IInputModeContext):void; - /** - * - * @type {number} - */ - priority:number; - /** - * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. - *

- * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.TapInputMode#controller}. - *

- *

- * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} - * will be deactivated. Otherwise it will always run concurrently with all other modes. - *

- * @type {boolean} - */ - exclusive:boolean; - /** - * Gets or sets the enabled state of this input mode. - *

- * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed - * {@link yfiles.input.TapInputMode#controller} so a disabled instance should never try to acquire the input mutex. - *

- * @type {boolean} - */ - enabled:boolean; - /** - * - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Returns the installed {@link yfiles.input.ConcurrencyController}. - * @protected - * @type {yfiles.input.ConcurrencyController} - */ - controller:yfiles.input.ConcurrencyController; - /** - * Adds the given listener for the Tapped event that occurs once a tap has been detected. - * @param listener The listener to add. - * @see yfiles.input.TapEventArgs - * @see yfiles.input.TapInputMode#tapHandlingPolicy - * @see yfiles.input.TapInputMode#removeTappedListener - */ - addTappedListener(listener:(sender:any,evt:yfiles.input.TapEventArgs)=>void):void; - /** - * Removes the given listener for the Tapped event that occurs once a tap has been detected. - * @param listener The listener to remove. - * @see yfiles.input.TapEventArgs - * @see yfiles.input.TapInputMode#tapHandlingPolicy - * @see yfiles.input.TapInputMode#addTappedListener - */ - removeTappedListener(listener:(sender:any,evt:yfiles.input.TapEventArgs)=>void):void; - /** - * Adds the given listener for the DoubleTapped event that occurs once a double-tap has been detected. - * @param listener The listener to add. - * @see yfiles.input.TapEventArgs - * @see yfiles.input.TapInputMode#tapHandlingPolicy - * @see yfiles.input.TapInputMode#removeDoubleTappedListener - */ - addDoubleTappedListener(listener:(sender:any,evt:yfiles.input.TapEventArgs)=>void):void; - /** - * Removes the given listener for the DoubleTapped event that occurs once a double-tap has been detected. - * @param listener The listener to remove. - * @see yfiles.input.TapEventArgs - * @see yfiles.input.TapInputMode#tapHandlingPolicy - * @see yfiles.input.TapInputMode#addDoubleTappedListener - */ - removeDoubleTappedListener(listener:(sender:any,evt:yfiles.input.TapEventArgs)=>void):void; - /** - * Gets or sets the tap handling policy that determines the triggering behavior of {@link yfiles.input.TapInputMode#addTappedListener Tapped} - * and {@link yfiles.input.TapInputMode#addDoubleTappedListener DoubleTapped}. - * @see yfiles.input.TapInputMode#tapHandlingPolicy - * @default yfiles.input.TapHandlingPolicy.BOTH_SINGLE_TAPS_AND_DOUBLE_TAP - * @type {yfiles.input.TapHandlingPolicy} - */ - tapHandlingPolicy:yfiles.input.TapHandlingPolicy; - /** - * Gets or sets a hit test that determines where this mode should recognize taps. - *

- * This implementation is tested during the {@link yfiles.input.TapInputMode#isValidPress} to determine whether it is valid to tap - * here. The default implementation is {@link yfiles.input.IHitTestable#ALWAYS}. - *

- * @type {yfiles.input.IHitTestable} - */ - validTapHitTestable:yfiles.input.IHitTestable; - /** - * Whether to {@link yfiles.input.ConcurrencyController#requestMutex request the mutex} on a tap. - *

- * If set to true this will discard other concurrent input modes on a tap. The default is true. - *

- * @default true - * @type {boolean} - */ - requestMutexOnTap:boolean; - /** - * Gets or sets a property that determines whether taps should be swallowed if they happen within a short amount of time - * after the {@link yfiles.view.CanvasComponent} got focus. - *

- * The default is false. If set to true taps are discarded within 100 ms after the focus entered. - *

- * @default false - * @type {boolean} - */ - swallowFocusTap:boolean; - /** - * Gets the location of the last tap. - * @type {yfiles.geometry.Point} - */ - tapLocation:yfiles.geometry.Point; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.TapInputMode; - } - /** - * A simple {@link yfiles.input.IInputMode} that displays a textarea in the {@link yfiles.view.CanvasComponent} to let the user edit a - * text. - *

- * Hitting escape or enter will cancel or stop editing. - *

- *

- * This mode is {@link yfiles.input.TextEditorInputMode#exclusive} by default. - *

- * @class - * @implements {yfiles.input.IInputMode} - */ - export interface TextEditorInputMode extends yfiles.lang.Object,yfiles.input.IInputMode{} - export class TextEditorInputMode { - /** - * Creates a new instance using a default text box. - */ - constructor(); - /** - * Adjusts the position of the text box in the {@link yfiles.view.CanvasComponent}. - * @protected - */ - adjustPosition():void; - /** - * Adjusts the size of the text box in the {@link yfiles.input.TextEditorInputMode#editorContainer}. - * @param maxSize The suggested maximum size to use. - * @protected - */ - adjustSize(maxSize:yfiles.geometry.Size):void; - /** - * Calculates the maximum size for this instance. - *

- * The result is passed to {@link yfiles.input.TextEditorInputMode#adjustSize}. - *

- *

- * This implementation makes sure the textbox does not exceed the bounds of the canvas. - *

- * @returns The maximum size for the textbox. - * @see yfiles.input.TextEditorInputMode#adjustSize - * @protected - */ - calculateMaxTextBoxSize():yfiles.geometry.Size; - /** - * Cancels editing of the text box. - */ - cancel():void; - /** - * Resets the contents of the text box. - */ - clear():void; - /** - * Starts interactive text editing. - * @returns A Promise that will fulfill with the edited text or fulfill with null if editing is cancelled. - */ - edit():Promise; - /** - * Adjusts the {@link yfiles.view.CanvasComponent#viewport} of the {@link yfiles.view.CanvasComponent} such that the text box is in the visible area. - *

- * Called once when the editing starts. - *

- * @protected - */ - ensureVisible():void; - /** - * Returns the bounds of the text area in world coordinates. - * @returns - * @protected - */ - getTextBoxBounds():yfiles.geometry.Rect; - /** - * Installs this mode into the given context that is provided by the canvas. - *

- * In general a mode can only be installed into a single canvas at all times. - *

- *

- * This method is called to initialize this instance. Subclasses should override this method to register the corresponding - * event handler delegates for the various input events they need to register with. - *

- *

- * Overriding implementations should call the base implementation, first. - *

- * @param context The context that this instance shall be installed into. The same instance will be passed to this instance during - * {@link #uninstall}. A reference to the context may be kept and queried during the time the mode is - * installed. - * @param controller The {@link #controller} for this mode. - * @see yfiles.input.IInputMode#uninstall - */ - install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; - /** - * Installs the text box in the canvas and puts focus into it. - * @protected - */ - installTextBox():void; - /** - * Called when editing starts. - *

- * Requests the input mutex, and installs the text box. - *

- * @protected - */ - onBeginEditing():void; - /** - * Called after {@link yfiles.input.TextEditorInputMode#cancel} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been canceled. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onCanceled():void; - /** - * Called when editing gets canceled. - *

- * Removes the text box and releases the input mutex. - *

- * @protected - */ - onCancelEditing():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been activated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerActivated():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerDeactivated():void; - /** - * Raises the {@link yfiles.input.TextEditorInputMode#addEditingCanceledListener EditingCanceled} event. - * @param evt The event argument - * @protected - */ - onEditingCanceled(evt:yfiles.input.TextEventArgs):void; - /** - * Raises the {@link yfiles.input.TextEditorInputMode#addEditingStartedListener EditingStarted} event. - * @param evt The event argument. - * @protected - */ - onEditingStarted(evt:yfiles.input.TextEventArgs):void; - /** - * Called when editing is stopped. - *

- * Triggers the {@link yfiles.input.TextEditorInputMode#addTextEditedListener TextEdited} event, removes the - * box and releases the input mutex. - *

- * @protected - */ - onStopEditing():void; - /** - * Called after {@link yfiles.input.TextEditorInputMode#tryStop} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been stopped. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onStopped():void; - /** - * Raises the {@link yfiles.input.TextEditorInputMode#addTextEditedListener TextEdited} event. - * @param evt The event arguments. - * @protected - */ - onTextEdited(evt:yfiles.input.TextEventArgs):void; - /** - * Stops editing and returns true. - * @returns base.Stop() - */ - tryStop():boolean; - /** - * Uninstalls this mode from the given context. - *

- * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} method. After a mode has - * been uninstalled it can be installed again into the same or another canvas. - *

- *

- * Overriding implementations should call the base implementation after their own code. - *

- * @param context The context to deregister from. This is the same instance that had been passed to {@link #install} during - * installation. - */ - uninstall(context:yfiles.input.IInputModeContext):void; - /** - * Removes the text box. - * @protected - */ - uninstallTextBox():void; - /** - * - * @type {number} - */ - priority:number; - /** - * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. - *

- * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.TextEditorInputMode#controller}. - *

- *

- * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} - * will be deactivated. Otherwise it will always run concurrently with all other modes. - *

- * @type {boolean} - */ - exclusive:boolean; - /** - * Gets or sets the enabled state of this input mode. - *

- * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed - * {@link yfiles.input.TextEditorInputMode#controller} so a disabled instance should never try to acquire the input mutex. - *

- * @type {boolean} - */ - enabled:boolean; - /** - * - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Gets the installed {@link yfiles.input.TextEditorInputMode#controller}. - * @protected - * @type {yfiles.input.ConcurrencyController} - */ - controller:yfiles.input.ConcurrencyController; - /** - * Adds the given listener for the TextEdited event that occurs once the text has been edited. - * @param listener The listener to add. - * @see yfiles.input.TextEditorInputMode#removeTextEditedListener - */ - addTextEditedListener(listener:(sender:any,evt:yfiles.input.TextEventArgs)=>void):void; - /** - * Removes the given listener for the TextEdited event that occurs once the text has been edited. - * @param listener The listener to remove. - * @see yfiles.input.TextEditorInputMode#addTextEditedListener - */ - removeTextEditedListener(listener:(sender:any,evt:yfiles.input.TextEventArgs)=>void):void; - /** - * Adds the given listener for the EditingCanceled event that occurs if the editing has not been finished. - * @param listener The listener to add. - * @see yfiles.input.TextEditorInputMode#removeEditingCanceledListener - */ - addEditingCanceledListener(listener:(sender:any,evt:yfiles.input.TextEventArgs)=>void):void; - /** - * Removes the given listener for the EditingCanceled event that occurs if the editing has not been finished. - * @param listener The listener to remove. - * @see yfiles.input.TextEditorInputMode#addEditingCanceledListener - */ - removeEditingCanceledListener(listener:(sender:any,evt:yfiles.input.TextEventArgs)=>void):void; - /** - * Adds the given listener for the EditingStarted event that occurs when text editing is started. - * @param listener The listener to add. - * @see yfiles.input.TextEditorInputMode#removeEditingStartedListener - */ - addEditingStartedListener(listener:(sender:any,evt:yfiles.input.TextEventArgs)=>void):void; - /** - * Removes the given listener for the EditingStarted event that occurs when text editing is started. - * @param listener The listener to remove. - * @see yfiles.input.TextEditorInputMode#addEditingStartedListener - */ - removeEditingStartedListener(listener:(sender:any,evt:yfiles.input.TextEventArgs)=>void):void; - /** - * Gets or sets a property that determines whether the text edited should be committed if the focus gets lost or the - * editing should be canceled. - *

- * The default behavior is to cancel the editing process. - *

- * @default false - * @type {boolean} - */ - autoCommitOnFocusLost:boolean; - /** - * Gets or sets a property that determines whether this mode should try to {@link yfiles.view.CanvasComponent#focus} the canvas - * once the editor is closed via a keyboard gesture. - *

- * The default is true - *

- * @default true - * @type {boolean} - */ - autoFocusCanvasOnEditorClosed:boolean; - /** - * Gets or sets whether this mode should automatically fire up the editor once it gets installed. - *

- * If this mode is permanently installed, set this flag to false and set the {@link yfiles.input.TextEditorInputMode#editing} flag to true in order to start editing. - *

- * @default false - * @type {boolean} - */ - autoStartEditing:boolean; - /** - * Gets or sets the event recognizer to detect the key gesture for new line breaks. - *

- * When the provided {@link yfiles.view.KeyEventArgs} are recognized, a new line break is inserted at the current caret position. - *

- * @see yfiles.input.TextEditorInputMode#cancelRecognizer - * @see yfiles.input.TextEditorInputMode#stopRecognizer - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - lineBreakRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer to detect when editing the text shall be canceled. - *

- * When the provided {@link yfiles.view.KeyEventArgs} are recognized, {@link yfiles.input.TextEditorInputMode#cancel} is called. - *

- * @see yfiles.input.TextEditorInputMode#lineBreakRecognizer - * @see yfiles.input.TextEditorInputMode#stopRecognizer - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - cancelRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer to detect when editing the text shall be stopped. - *

- * When the provided {@link yfiles.view.KeyEventArgs} are recognized, {@link yfiles.input.TextEditorInputMode#tryStop} is called. - *

- * @see yfiles.input.TextEditorInputMode#lineBreakRecognizer - * @see yfiles.input.TextEditorInputMode#cancelRecognizer - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - stopRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the current editing state of the editor. - *

- * Setting a new value will trigger the {@link yfiles.input.TextEditorInputMode#onBeginEditing} and {@link yfiles.input.TextEditorInputMode#onCancelEditing} - * methods respectively. - *

- * @type {boolean} - */ - editing:boolean; - /** - * Gets or sets the location of the text box in world coordinates. - * @type {yfiles.geometry.IPoint} - */ - location:yfiles.geometry.IPoint; - /** - * Gets or sets the point that describes the "up"-vector that will be used to determine the orientation of the text box in - * the world coordinate system. - *

- * The default is 0, -1. - *

- * @see yfiles.input.TextEditorInputMode#rotateTextBox - * @type {yfiles.geometry.IPoint} - */ - upVector:yfiles.geometry.IPoint; - /** - * Gets or sets the anchor of the text box. - *

- * The anchor is the point inside the coordinate system of the text box that shall coincide with the {@link yfiles.input.TextEditorInputMode#location} in the world - * coordinate system. The X and Y values are expressed as relative width/height ratios. - *

- * @type {yfiles.geometry.IPoint} - */ - anchor:yfiles.geometry.IPoint; - /** - * Gets the div-element that contains the text editor. - * @type {HTMLDivElement} - */ - editorContainer:HTMLDivElement; - /** - * Gets or sets the text that is displayed and edited. - *

- * If customizations change the way the text is edited by providing a custom editor, this property needs to be overridden - * to return the current text contents. - *

- * @returns The textual contents of the editor. - * @type {string} - */ - editorText:string; - /** - * Gets or sets a value indicating whether to automatically flip the orientation of the text box if the {@link yfiles.input.TextEditorInputMode#upVector} actually points - * downwards. - *

- * The default is true. - *

- * @type {boolean} - */ - autoFlipTextBox:boolean; - /** - * Gets or sets a value indiciating whether the text box should be rotated with the {@link yfiles.input.TextEditorInputMode#upVector}. - *

- * If the value is false (the default), the text box will always be horizontal. - *

- * @type {boolean} - */ - rotateTextBox:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.TextEditorInputMode; - } - /** - * Event arguments used by {@link yfiles.input.TextEditorInputMode}. - * @class - * @extends {yfiles.input.InputModeEventArgs} - */ - export interface TextEventArgs extends yfiles.input.InputModeEventArgs{} - export class TextEventArgs { - /** - * Creates a new instance. - * @param context The context in which this text event happened. - * @param text The text that was or will be edited. - */ - constructor(context:yfiles.input.IInputModeContext,text:string); - /** - * Gets the text that was or will be edited. - * @type {string} - */ - text:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.TextEventArgs; - } - /** - * An {@link yfiles.input.IInputMode} implementation that can be used to block user interaction. - *

- * Setting the {@link yfiles.input.WaitInputMode#waiting} property will try to cancel ongoing edits of the {@link yfiles.input.ConcurrencyController#mutexOwner mutex owner} and set the preferred cursor to {@link yfiles.input.WaitInputMode#waitCursor}. This mode - * will try to add itself to the {@link yfiles.view.CanvasComponent#lookup Lookup of the CanvasControl}, so that other clients can make use of its functionality. - *

- *

- * This mode uses an {@link yfiles.input.ConcurrencyController#exclusive} controller by default. - *

- * @see yfiles.input.WaitInputMode#waiting - * @class - * @implements {yfiles.input.IInputMode} - */ - export interface WaitInputMode extends yfiles.lang.Object,yfiles.input.IInputMode{} - export class WaitInputMode { - /** - * Creates a new instance of this mode. - */ - constructor(); - /** - * - */ - cancel():void; - /** - * Returns if this mode can request the mutex when {@link yfiles.input.WaitInputMode#waiting} is set to true. - * @returns if this mode can request the mutex when {@link #waiting} is set to true. - */ - canStartWaiting():boolean; - /** - * Called when waiting is finished. - *

- * This will reset the {@link yfiles.input.ConcurrencyController#preferredCursor} and {@link yfiles.input.ConcurrencyController#releaseMutex the mutex is released.} - *

- * @protected - */ - endWaiting():void; - /** - * Installs this mode into the given context that is provided by the canvas. - *

- * In general a mode can only be installed into a single canvas at all times. - *

- *

- * This method is called to initialize this instance. Subclasses should override this method to register the corresponding - * event handler delegates for the various input events they need to register with. - *

- *

- * Overriding implementations should call the base implementation, first. - *

- * @param context The context that this instance shall be installed into. The same instance will be passed to this instance during - * {@link #uninstall}. A reference to the context may be kept and queried during the time the mode is - * installed. - * @param controller The {@link #controller} for this mode. - * @see yfiles.input.IInputMode#uninstall - */ - install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; - /** - * Called after {@link yfiles.input.WaitInputMode#cancel} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been canceled. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onCanceled():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been activated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerActivated():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerDeactivated():void; - /** - * Called after {@link yfiles.input.WaitInputMode#tryStop} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been stopped. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onStopped():void; - /** - * Raises the {@link yfiles.input.WaitInputMode#addWaitingEndedListener WaitingEnded} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onWaitingEnded(evt:yfiles.input.InputModeEventArgs):void; - /** - * Raises the {@link yfiles.input.WaitInputMode#addWaitingStartedListener WaitingStarted} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onWaitingStarted(evt:yfiles.input.InputModeEventArgs):void; - /** - * This will initiate the waiting process by trying to - * {@link yfiles.input.ConcurrencyController#requestMutex}request the input mutex. - *

- * This will set the {@link yfiles.input.ConcurrencyController#preferredCursor} to {@link yfiles.input.WaitInputMode#waitCursor}. - *

- * @protected - */ - startWaiting():void; - /** - * - * @returns - */ - tryStop():boolean; - /** - * Uninstalls this mode from the given context. - *

- * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} method. After a mode has - * been uninstalled it can be installed again into the same or another canvas. - *

- *

- * Overriding implementations should call the base implementation after their own code. - *

- * @param context The context to deregister from. This is the same instance that had been passed to {@link #install} during - * installation. - */ - uninstall(context:yfiles.input.IInputModeContext):void; - /** - * - * @type {number} - */ - priority:number; - /** - * Gets or sets the enabled state of this input mode. - *

- * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed - * {@link yfiles.input.WaitInputMode#controller} so a disabled instance should never try to acquire the input mutex. - *

- * @type {boolean} - */ - enabled:boolean; - /** - * - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Gets the installed {@link yfiles.input.WaitInputMode#controller}. - * @protected - * @type {yfiles.input.ConcurrencyController} - */ - controller:yfiles.input.ConcurrencyController; - /** - * Gets or sets the Waiting property. - *

- * Setting this property to true will {@link yfiles.input.WaitInputMode#startWaiting start the waiting process.} Setting it to false will {@link yfiles.input.WaitInputMode#endWaiting end the waiting}. - *

- * @type {boolean} - */ - waiting:boolean; - /** - * Adds the given listener for the WaitingStarted event that occurs when the waiting started. - * @param listener The listener to add. - * @see yfiles.input.WaitInputMode#removeWaitingStartedListener - */ - addWaitingStartedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the WaitingStarted event that occurs when the waiting started. - * @param listener The listener to remove. - * @see yfiles.input.WaitInputMode#addWaitingStartedListener - */ - removeWaitingStartedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the WaitingEnded event that occurs when the waiting ended. - * @param listener The listener to add. - * @see yfiles.input.WaitInputMode#removeWaitingEndedListener - */ - addWaitingEndedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the WaitingEnded event that occurs when the waiting ended. - * @param listener The listener to remove. - * @see yfiles.input.WaitInputMode#addWaitingEndedListener - */ - removeWaitingEndedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Gets or sets the WaitCursor property. - * @type {yfiles.view.Cursor} - */ - waitCursor:yfiles.view.Cursor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.WaitInputMode; - } - /** - * A convenience implementation of the {@link yfiles.input.IPositionHandler} interface that can be used to constrain the position - * of an item. - * @see yfiles.input.ConstrainedDragHandler. - * @see yfiles.input.ConstrainedDragHandler.#constrainNewLocation - * @class - * @extends {yfiles.input.ConstrainedDragHandler.} - * @implements {yfiles.input.IPositionHandler} - */ - export interface ConstrainedPositionHandler extends yfiles.input.ConstrainedDragHandler,yfiles.input.IPositionHandler{} - export class ConstrainedPositionHandler { - /** - * Initializes a new instance of the {@link yfiles.input.ConstrainedPositionHandler} class that delegates to the wrappedHandler. - * @param wrappedHandler The handler to wrap. - * @protected - */ - constructor(wrappedHandler:yfiles.input.IPositionHandler); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.ConstrainedPositionHandler; - } - /** - * A convenience implementation of the {@link yfiles.input.IHandle} interface that can be used to constrain the handle of an item. - * @see yfiles.input.ConstrainedDragHandler. - * @see yfiles.input.ConstrainedDragHandler.#constrainNewLocation - * @class - * @extends {yfiles.input.ConstrainedDragHandler.} - * @implements {yfiles.input.IHandle} - */ - export interface ConstrainedHandle extends yfiles.input.ConstrainedDragHandler,yfiles.input.IHandle{} - export class ConstrainedHandle { - /** - * Initializes a new instance of the {@link yfiles.input.ConstrainedHandle} class that delegates to the wrappedHandle. - * @param wrappedHandle The handle to wrap. - * @protected - */ - constructor(wrappedHandle:yfiles.input.IHandle); - /** - * Gets the {@link yfiles.input.ConstrainedDragHandler.#wrappedHandler}'s {@link yfiles.input.IHandle#type} property. - * @type {yfiles.input.HandleTypes} - */ - type:yfiles.input.HandleTypes; - /** - * Gets the {@link yfiles.input.ConstrainedDragHandler.#wrappedHandler}'s {@link yfiles.input.IHandle#cursor} property. - * @type {yfiles.view.Cursor} - */ - cursor:yfiles.view.Cursor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.ConstrainedHandle; - } - /** - * A utility implementation of the {@link yfiles.input.IReshapeHandler} interface that can be used to constrain the reshaping of an - * existing instance conveniently. - * @see yfiles.input.ConstrainedHandle - * @see yfiles.input.ConstrainedPositionHandler - * @see yfiles.input.ConstrainedReshapeHandler#constrainNewBounds - * @class - * @implements {yfiles.input.IReshapeHandler} - */ - export interface ConstrainedReshapeHandler extends yfiles.lang.Object,yfiles.input.IReshapeHandler{} - export class ConstrainedReshapeHandler { - /** - * Initializes a new instance of the {@link yfiles.input.ConstrainedReshapeHandler} class that delegates to the wrappedHandler. - * @param wrappedHandler The handler to wrap. - * @protected - */ - constructor(wrappedHandler:yfiles.input.IReshapeHandler); - /** - * Cancels the move operation and calls {@link yfiles.input.ConstrainedReshapeHandler#onCanceled} - * @param context The context to retrieve information about the drag from. - * @param originalBounds The value of the coordinate of the {@link #bounds} property at the time of {@link #initializeReshape}. - */ - cancelReshape(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect):void; - /** - * Callback that needs to implement the constraints for the new bounds. - * @param context The context in which the reshape will be performed. - * @param originalBounds The value of the {@link #bounds} property at the time of {@link #initializeReshape}. - * @param newBounds The coordinates in the world coordinate system that the client wants the handle to be at. Depending on the - * implementation the {@link #bounds} may or may not be modified to reflect the new value. - * @returns The constrained value of newBounds. - * @protected - * @abstract - */ - constrainNewBounds(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect,newBounds:yfiles.geometry.Rect):yfiles.geometry.Rect; - /** - * Handles the reshape operation and subsequently calls {@link yfiles.input.ConstrainedReshapeHandler#onReshaped} - *

- * This method will use the {@link yfiles.input.ConstrainedReshapeHandler#constrainNewBounds} callback to let subclasses constrain - * the reshaping. - *

- * @param context The context in which the reshape will be performed. - * @param originalBounds The value of the {@link #bounds} property at the time of {@link #initializeReshape}. - * @param newBounds The coordinates in the world coordinate system that the client wants to reshape the item to. Depending on the - * implementation the {@link #bounds} may or may not be modified to reflect the new value. - */ - handleReshape(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect,newBounds:yfiles.geometry.Rect):void; - /** - * Initializes the reshape operation and subsequently calls {@link yfiles.input.ConstrainedReshapeHandler#onInitialized} - * @param context The context in which the drag will be performed. - */ - initializeReshape(context:yfiles.input.IInputModeContext):void; - /** - * Called when the {@link yfiles.input.ConstrainedReshapeHandler#cancelReshape} method has been called. - * @param context The input mode context. - * @param originalBounds The original bounds. - * @protected - */ - onCanceled(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect):void; - /** - * Called when the {@link yfiles.input.ConstrainedReshapeHandler#reshapeFinished} method has been called. - * @param context The input mode context. - * @param originalBounds The original bounds. - * @param newBounds The new bounds. - * @protected - */ - onFinished(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect,newBounds:yfiles.geometry.Rect):void; - /** - * Called when the {@link yfiles.input.ConstrainedReshapeHandler#initializeReshape} method has been called. - * @param context The input mode context. - * @param originalBounds The original bounds. - * @protected - */ - onInitialized(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect):void; - /** - * Called when the {@link yfiles.input.ConstrainedReshapeHandler#handleReshape} operation has been performed. - * @param context The input mode context. - * @param originalBounds The original Bounds. - * @param newBounds The new Bounds. - * @protected - */ - onReshaped(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect,newBounds:yfiles.geometry.Rect):void; - /** - * Handles the finish operation and invokes {@link yfiles.input.ConstrainedReshapeHandler#onFinished} - * @param context The context to retrieve information about the drag from. - * @param originalBounds The value of the {@link #bounds} property at the time of {@link #initializeReshape}. - * @param newBounds The coordinates in the world coordinate system that the client wants the handle to be at. Depending on the - * implementation the {@link #bounds} may or may not be modified to reflect the new value. This is the same value as delivered in the last - * invocation of {@link #handleReshape} - */ - reshapeFinished(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect,newBounds:yfiles.geometry.Rect):void; - /** - * Gets the wrapped handler to which calls will be ultimately delegated. - * @protected - * @type {yfiles.input.IReshapeHandler} - */ - wrappedHandler:yfiles.input.IReshapeHandler; - /** - * Gets the {@link yfiles.input.ConstrainedReshapeHandler#wrappedHandler}'s {@link yfiles.input.IReshapeHandler#bounds} property. - * @type {yfiles.geometry.IRectangle} - */ - bounds:yfiles.geometry.IRectangle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.ConstrainedReshapeHandler; - } - /** - * A utility implementation of the {@link yfiles.input.IDragHandler} interface that can be used to constrain the movement of an - * existing instance. - * Type parameter TWrapped: The exact type of the wrapped implementation. - * @see yfiles.input.ConstrainedHandle - * @see yfiles.input.ConstrainedPositionHandler - * @see yfiles.input.ConstrainedDragHandler.#constrainNewLocation - * @class - * @implements {yfiles.input.IDragHandler} - * @template TWrapped - */ - export interface ConstrainedDragHandler extends yfiles.lang.Object,yfiles.input.IDragHandler{} - export class ConstrainedDragHandler { - /** - * Initializes a new instance of the {@link yfiles.input.ConstrainedDragHandler.} class that delegates to the wrappedHandler. - * @param wrappedHandler The handler to wrap. - * @protected - */ - constructor(wrappedHandler:TWrapped); - /** - * Cancels the move operation and calls {@link yfiles.input.ConstrainedDragHandler.#onCanceled} - * @param context The context to retrieve information about the drag from. - * @param originalLocation The value of the coordinate of the {@link #location} property at the time of {@link #initializeDrag}. - */ - cancelDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; - /** - * Callback that needs to implement the constraints for the new location. - * @param context The context in which the drag will be performed. - * @param originalLocation The value of the {@link #location} property at the time of {@link #initializeDrag}. - * @param newLocation The coordinates in the world coordinate system that the client wants the handle to be at. Depending on the - * implementation the {@link #location} may or may not be modified to reflect the new value. - * @returns The constrained value of newLocation. - * @protected - * @abstract - */ - constrainNewLocation(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Handles the finish operation and invokes {@link yfiles.input.ConstrainedDragHandler.#onFinished} - * @param context The context to retrieve information about the drag from. - * @param originalLocation The value of the {@link #location} property at the time of {@link #initializeDrag}. - * @param newLocation The coordinates in the world coordinate system that the client wants the handle to be at. Depending on the - * implementation the {@link #location} may or may not be modified to reflect the new value. This is the same value as delivered in the last - * invocation of {@link #handleMove} - */ - dragFinished(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; - /** - * Handles the move operation and subsequently calls {@link yfiles.input.ConstrainedDragHandler.#onMoved} - *

- * This method will use the {@link yfiles.input.ConstrainedDragHandler.#constrainNewLocation} callback to let subclasses constrain the movement. - *

- * @param context The context in which the drag will be performed. - * @param originalLocation The value of the {@link #location} property at the time of {@link #initializeDrag}. - * @param newLocation The coordinates in the world coordinate system that the client wants the handle to be at. Depending on the - * implementation the {@link #location} may or may not be modified to reflect the new value. - */ - handleMove(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; - /** - * Initializes the drag operation and subsequently calls {@link yfiles.input.ConstrainedDragHandler.#onInitialized} - * @param context The context in which the drag will be performed. - */ - initializeDrag(context:yfiles.input.IInputModeContext):void; - /** - * Called when the {@link yfiles.input.ConstrainedDragHandler.#cancelDrag} method has been called. - * @param context The input mode context. - * @param originalLocation The original location. - * @protected - */ - onCanceled(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; - /** - * Called when the {@link yfiles.input.ConstrainedDragHandler.#dragFinished} method has been called. - * @param context The input mode context. - * @param originalLocation The original location. - * @param newLocation The new location. - * @protected - */ - onFinished(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; - /** - * Called when the {@link yfiles.input.ConstrainedDragHandler.#initializeDrag} method has been called. - * @param context The input mode context. - * @param originalLocation The original location. - * @protected - */ - onInitialized(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; - /** - * Called when the {@link yfiles.input.ConstrainedDragHandler.#handleMove} operation has been performed. - * @param context The input mode context. - * @param originalLocation The original location. - * @param newLocation The new location. - * @protected - */ - onMoved(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; - /** - * Gets the wrapped handler to which calls will be ultimately delegated. - * @protected - * @type {TWrapped} - */ - wrappedHandler:TWrapped; - /** - * Gets the {@link yfiles.input.ConstrainedDragHandler.#wrappedHandler}'s {@link yfiles.input.IDragHandler#location} property. - * @type {yfiles.geometry.IPoint} - */ - location:yfiles.geometry.IPoint; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.ConstrainedDragHandler; - } - /** - * Interface that is implemented for elements that can be hit or picked in a coordinate system. - *

Related demos:

- *
    - *
  • Tutorial: 02 Custom Styles, step 05 Hit Test
  • - *
  • Tutorial: 02 Custom Styles, step 17 Edge Hit Test
  • - *
- * @see yfiles.view.CanvasComponent - * @see yfiles.view.ICanvasObjectDescriptor - * @see yfiles.view.ICanvasObject - * @interface - */ - export interface IHitTestable extends yfiles.lang.Object{ - /** - * Determines if something has been hit at the given coordinates in the world coordinate system. - *

- * Implementations should inspect the {@link yfiles.view.ICanvasContext#hitTestRadius} and take the value into account when performing hit tests. This allows the user to - * hit elements even if the zoom level is very small and allows for accurate hit tests at greater zoom levels. - *

- * @param context the context the hit test is performed in - * @param location the coordinates in world coordinate system - * @returns whether something has been hit - * @abstract - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - } - var IHitTestable:{ - /** - * Wrap a handler into an interface. - * @param handler - * @returns - * @static - */ - create?(handler:(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point)=>boolean):yfiles.input.IHitTestable; - /** - * An {@link yfiles.input.IHitTestable} that always returns false. - * @const - * @static - * @type {yfiles.input.IHitTestable} - */ - NEVER?:yfiles.input.IHitTestable; - /** - * An {@link yfiles.input.IHitTestable} that always returns true. - * @const - * @static - * @type {yfiles.input.IHitTestable} - */ - ALWAYS?:yfiles.input.IHitTestable; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IHitTestable; - }; - /** - * Interface that is used to test whether a rendered item is deemed to be inside a rectangular marquee selection. - *

Related demos:

- *
    - *
  • Tutorial: 02 Custom Styles, step 05 Hit Test
  • - *
- * @interface - */ - export interface IMarqueeTestable extends yfiles.lang.Object{ - /** - * This callback returns true if the corresponding item is considered to intersect the given rectangular box. - *

- * This method may return false if the item cannot be selected using a selection marquee or optionally if the item is only - * partially contained within the box. - *

- *

- * Implementations should respect the {@link yfiles.view.ICanvasContext#hitTestRadius} if marquee selections should behave differently on different zoom levels. - *

- * @param context the current input mode context - * @param rectangle the box describing the marquee's bounds - * @returns true if the item is considered to be captured by the marquee - * @abstract - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - } - var IMarqueeTestable:{ - /** - * An implementation that always yields true. - * @const - * @static - * @type {yfiles.input.IMarqueeTestable} - */ - ALWAYS?:yfiles.input.IMarqueeTestable; - /** - * An implementation that always yields false. - * @const - * @static - * @type {yfiles.input.IMarqueeTestable} - */ - NEVER?:yfiles.input.IMarqueeTestable; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IMarqueeTestable; - }; - /** - * A more sophisticated {@link yfiles.input.IHandle} implementation that modifies a rectangle. - *

- * Implementations of this class work on a mutable rectangle instance for handling drags of the handle. A separate point - * implementation is used for specifying the position of the handle. As a convenience this class also implements the {@link yfiles.geometry.IMutablePoint} - * interface which modifies the handle's position. - *

- * @class - * @implements {yfiles.geometry.IMutablePoint} - * @implements {yfiles.input.IHandle} - */ - export interface RectangleHandle extends yfiles.lang.Object,yfiles.geometry.IMutablePoint,yfiles.input.IHandle{} - export class RectangleHandle { - /** - * Subclass constructor that creates a handle for the given position using the location instance as the {@link yfiles.input.IDragHandler#location} for the handle. - *

- * The instance modifies the instances using the reshapeable interface and reads the current state using the rect. The - * handle will automatically trim changes of the rectangle to the specified minimum and maximum size. - *

- * @param position The position of the handle. - * @param rectangle The rectangle to change. - */ - constructor(position:yfiles.input.HandlePositions,rectangle:yfiles.geometry.IMutableRectangle); - /** - * Delegates the original values to {@link yfiles.input.RectangleHandle#set} - * @param context - * @param originalLocation - */ - cancelDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; - /** - * This implementation does nothing. - * @param context - * @param originalLocation - * @param newLocation - */ - dragFinished(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; - /** - * Delegates to {@link yfiles.input.RectangleHandle#set}. - * @param context - * @param originalLocation - * @param newLocation - */ - handleMove(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; - /** - * This implementation does nothing. - * @param context - */ - initializeDrag(context:yfiles.input.IInputModeContext):void; - /** - * Delegates the work to the reshapeable. - * @param delta - */ - moveBy(delta:yfiles.geometry.Point):void; - /** - * Delegates to {@link yfiles.input.RectangleHandle#moveBy}. - * @param x - * @param y - */ - set(x:number,y:number):void; - /** - * Gets the position of the handle. - * @protected - * @type {yfiles.input.HandlePositions} - */ - position:yfiles.input.HandlePositions; - /** - * Gets the rectangle instance to modify. - * @protected - * @type {yfiles.geometry.IMutableRectangle} - */ - rectangle:yfiles.geometry.IMutableRectangle; - /** - * Gets or sets the minimum size allowed for the reshapeable. - *

- * The value is stored by reference. The default is {@link yfiles.geometry.Size#ZERO}. - *

- * @type {yfiles.geometry.ISize} - */ - minimumSize:yfiles.geometry.ISize; - /** - * Gets or sets the minimum enclosed area that needs to be encompassed by this reshapeable. - *

- * The value is stored by reference. The default is {@link yfiles.geometry.Size#ZERO}, which does not restrict the area at all. - *

- * @type {yfiles.geometry.IRectangle} - */ - minimumEnclosedArea:yfiles.geometry.IRectangle; - /** - * Gets or sets the maximum size allowed for the reshapeable. - *

- * The value is stored by reference. The default is {@link yfiles.geometry.Size#INFINITE}. - *

- * @type {yfiles.geometry.ISize} - */ - maximumSize:yfiles.geometry.ISize; - /** - * Gets a view of the center of the handle. - *

- * The point describes the current world coordinate of the element that can be modified by this handle. - *

- * @type {yfiles.geometry.IPoint} - */ - location:yfiles.geometry.IPoint; - /** - * Gets or sets the type of the handle that can be used by the rendering engine to render types differently. - * @type {yfiles.input.HandleTypes} - */ - type:yfiles.input.HandleTypes; - /** - * Gets or sets the cursor to display when the mouse hovers over or drags this handle. - * @type {yfiles.view.Cursor} - */ - cursor:yfiles.view.Cursor; - /** - * Gets or sets the x coordinate. - *

- * The setter delegates to {@link yfiles.input.RectangleHandle#moveBy} - *

- * @type {number} - */ - x:number; - /** - * Gets or sets the y coordinate. - *

- * The setter delegates to {@link yfiles.input.RectangleHandle#moveBy} - *

- * @type {number} - */ - y:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.RectangleHandle; - } - /** - * A more sophisticated {@link yfiles.input.IHandle} implementation that delegates to a {@link yfiles.input.IReshapeHandler}. - *

- * This class works on an {@link yfiles.input.IReshapeHandler}. - *

- * @class - * @implements {yfiles.input.IHandle} - */ - export interface ReshapeHandlerHandle extends yfiles.lang.Object,yfiles.input.IHandle{} - export class ReshapeHandlerHandle { - /** - * Subclass constructor that creates a handle for the given position using the location instance as the {@link yfiles.input.IDragHandler#location} for the handle. - *

- * The instance modifies the instances using the reshapeable interface and reads the current state using the rect. The - * handle will automatically trim changes of the rectangle to the specified minimum and maximum size. - *

- * @param position The position of the handle. - * @param reshapeHandler The reshapeable to write the changes to. - * @param [maximumSize=null] The maximum size allowed for the rectangle. - * @param [minimumSize=null] The minimum size allowed for the rectangle. - */ - constructor(position:yfiles.input.HandlePositions,reshapeHandler:yfiles.input.IReshapeHandler,minimumSize?:yfiles.geometry.ISize,maximumSize?:yfiles.geometry.ISize); - /** - * Subclass constructor that creates a handle for the given position using the location instance as the {@link yfiles.input.IDragHandler#location} for the handle. - *

- * The instance modifies the instances using the reshapeable interface and reads the current state using the rect. The - * handle will automatically trim changes of the rectangle to the specified minimum and maximum size. - *

- * @param {Object} options The parameters to pass. - * @param options.position The position of the handle. - * @param options.reshapeHandler The reshapeable to write the changes to. - * @param [options.maximumSize=null] The maximum size allowed for the rectangle. - * @param [options.minimumSize=null] The minimum size allowed for the rectangle. - */ - constructor(options:{position:yfiles.input.HandlePositions,reshapeHandler:yfiles.input.IReshapeHandler,minimumSize?:yfiles.geometry.ISize,maximumSize?:yfiles.geometry.ISize}); - /** - * Delegates the cancel request to the {@link yfiles.input.IReshapeHandler}. - * @param context - * @param originalLocation - */ - cancelDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; - /** - * Delegates the finish request to the {@link yfiles.input.IReshapeHandler}. - * @param context - * @param originalLocation - * @param newLocation - */ - dragFinished(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; - /** - * Delegates the move request to the {@link yfiles.input.IReshapeHandler#handleReshape} method. - * @param context - * @param originalLocation - * @param newLocation - */ - handleMove(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; - /** - * This implementation does nothing. - * @param context - */ - initializeDrag(context:yfiles.input.IInputModeContext):void; - /** - * Gets the reshapeable instance to write the changes to. - * @protected - * @type {yfiles.input.IReshapeHandler} - */ - reshapeHandler:yfiles.input.IReshapeHandler; - /** - * Gets or sets the minimum size allowed for the reshapeable. - *

- * The value is stored by reference. The default is {@link yfiles.geometry.Size#ZERO}. - *

- * @type {yfiles.geometry.ISize} - */ - minimumSize:yfiles.geometry.ISize; - /** - * Gets or sets the minimum enclosed area that needs to be encompassed by this reshapeable. - *

- * The value is stored by reference. The default is {@link yfiles.geometry.Size#ZERO}, which does not restrict the area at all. - *

- * @type {yfiles.geometry.IRectangle} - */ - minimumEnclosedArea:yfiles.geometry.IRectangle; - /** - * Gets or sets the maximum size allowed for the reshapeable. - *

- * The value is stored by reference. The default is {@link yfiles.geometry.Size#INFINITE}. - *

- * @type {yfiles.geometry.ISize} - */ - maximumSize:yfiles.geometry.ISize; - /** - * Gets a view of the center of the handle. - *

- * The point describes the current world coordinate of the element that can be modified by this handle. - *

- * @type {yfiles.geometry.IPoint} - */ - location:yfiles.geometry.IPoint; - /** - * Gets or sets the type of the handle that can be used by the rendering engine to render types differently. - * @type {yfiles.input.HandleTypes} - */ - type:yfiles.input.HandleTypes; - /** - * Gets or sets the cursor to display when the mouse hovers over or drags this handle. - * @type {yfiles.view.Cursor} - */ - cursor:yfiles.view.Cursor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.ReshapeHandlerHandle; - } - /** - * Event arguments for the {@link yfiles.input.GraphSnapContext#addCollectSnapLinesListener CollectSnapLines} event. - *

- * Instances of this class are also passed to - * {@link yfiles.input.ISnapLineProvider#addSnapLines}. Implementations of that interface can use the following methods to add snap - * lines for specific purposes: - *

- *
    - *
  • {@link yfiles.input.CollectGraphSnapLinesEventArgs#addFixedNodeSnapLine} – Adds an orthogonal snap line for nodes.
  • - *
  • {@link yfiles.input.CollectGraphSnapLinesEventArgs#addFixedSegmentSnapLine} – Adds an orthogonal snap line for edge segments and bends.
  • - *
  • {@link yfiles.input.CollectGraphSnapLinesEventArgs#addPortSnapLine} – Adds an orthogonal snap line for ports.
  • - *
  • {@link yfiles.input.CollectGraphSnapLinesEventArgs#addAdditionalSnapLine} – Adds an additional orthogonal snap line to which all element will snap.
  • - *
- * @class - * @extends {yfiles.input.InputModeEventArgs} - */ - export interface CollectGraphSnapLinesEventArgs extends yfiles.input.InputModeEventArgs{} - export class CollectGraphSnapLinesEventArgs { - /** - * Initializes a new instance of the {@link yfiles.input.CollectGraphSnapLinesEventArgs} class. - * @param context The context where the event is being used in. - * @param fixedNodeSnapLines The fixed node snap lines collection to add to. - * @param fixedSegmentSnapLines The fixed segment snap lines collection to add to. - * @param fixedPortSnapLines The fixed port snap lines collection to add to. - * @param additionalSnapLines The additional snap lines collection to add to. - */ - constructor(context:yfiles.input.IInputModeContext,fixedNodeSnapLines:yfiles.collections.ICollection,fixedSegmentSnapLines:yfiles.collections.ICollection,fixedPortSnapLines:yfiles.collections.ICollection,additionalSnapLines:yfiles.collections.ICollection); - /** - * Adds a snap line all elements will snap to. - * @param snapLine The snap line to add to the list of lines that all elements snap to by default. - * @see yfiles.input.GraphSnapContext#additionalSnapLines - */ - addAdditionalSnapLine(snapLine:yfiles.input.OrthogonalSnapLine):void; - /** - * Adds a snap line for nodes. - * @param snapLine The snap line to add to the list of lines that nodes snap to by default. - * @see yfiles.input.GraphSnapContext#fixedNodeSnapLines - */ - addFixedNodeSnapLine(snapLine:yfiles.input.OrthogonalSnapLine):void; - /** - * Adds a snap line for edge segments and bends. - * @param snapLine The snap line to add to the list of lines that segments snap to by default. - * @see yfiles.input.GraphSnapContext#fixedSegmentSnapLines - */ - addFixedSegmentSnapLine(snapLine:yfiles.input.OrthogonalSnapLine):void; - /** - * Adds a snap line for ports. - * @param snapLine The snap line to add to the list of lines that ports snap to by default. - * @see yfiles.input.GraphSnapContext#fixedPortSnapLines - */ - addPortSnapLine(snapLine:yfiles.input.OrthogonalSnapLine):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.CollectGraphSnapLinesEventArgs; - } - /** - * Abstract base class for {@link yfiles.input.GraphViewerInputMode} and {@link yfiles.input.GraphEditorInputMode}. - *

- * This class is not supposed to and in fact cannot be extended from user code. It only exists to provide common - * functionality to the two aforementioned input modes. If customizations are wanted or needed both {@link yfiles.input.GraphViewerInputMode} - * and {@link yfiles.input.GraphEditorInputMode} can be extended. - *

- * @class - * @extends {yfiles.input.MultiplexingInputMode} - */ - export interface GraphInputMode extends yfiles.input.MultiplexingInputMode{} - export class GraphInputMode { - /** - * Clears the selection on the current {@link yfiles.input.GraphInputMode#graphSelection}. - *

- * This implementation may be overridden for customizations. All it does is call {@link yfiles.view.ISelectionModel.#clear}. - *

- */ - clearSelection():void; - /** - * Actually performs the click on the given item. - *

- * This will raise the {@link yfiles.input.GraphInputMode#addItemLeftClickedListener ItemLeftClicked}, {@link yfiles.input.GraphInputMode#addItemRightClickedListener ItemRightClicked} - * (depending on the button), and {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} events. If - * either event is unhandled by all its event handlers the item will be {@link yfiles.input.GraphInputMode#setSelected selected} and {@link yfiles.input.GraphInputMode#setCurrentItem focused}. Before selection - * {@link yfiles.input.GraphInputMode#clearSelection the current selection will be cleared}, unless the {@link yfiles.input.GraphInputMode#multiSelectionRecognizer} is triggered. - *

- * @param item The item that has been clicked. - * @param evt The original event arguments for the click. Setting its {@link #handled} property to true will indicate that the click was handled. By - * default this happens when the clicked item is either selected or focused. - * @protected - */ - click(item:yfiles.graph.IModelItem,evt:yfiles.input.ClickEventArgs):void; - /** - * Clears the selection on click if {@link yfiles.view.CanvasComponent#lastMouseEvent the click} is not recognized by {@link yfiles.input.GraphInputMode#multiSelectionRecognizer}. - *

- * This method is only called if no item has been hit and at least one item is currently selected. - *

- *

- * This will use the {@link yfiles.input.GraphInputMode#clearSelection} method to deselect all items. - *

- * @param context The context where the click appeared - * @returns Whether the selection has been cleared by this method. - * @protected - */ - clickClearSelection(context:yfiles.input.IInputModeContext):boolean; - /** - * Copies the currently selected elements to the clipboard. - */ - copy():void; - /** - * Factory method for the {@link yfiles.input.GraphInputMode#clickInputMode} property. - *

- * This method will be called upon first access to the {@link yfiles.input.GraphInputMode#clickInputMode} property. - *

- *

- * This implementation {@link yfiles.input.ClickInputMode#activeButtons activates} both {@link yfiles.view.MouseButtons#LEFT} and {@link yfiles.view.MouseButtons#RIGHT} - *

- * @returns a new instance of ClickInputMode - * @protected - */ - createClickInputMode():yfiles.input.ClickInputMode; - /** - * Factory method for the {@link yfiles.input.GraphInputMode#contextMenuInputMode} property. - *

- * This method will be called upon first access to the {@link yfiles.input.GraphInputMode#contextMenuInputMode} property. - *

- * @returns a new instance of ContextMenuInputMode - * @protected - */ - createContextMenuInputMode():yfiles.input.ContextMenuInputMode; - /** - * Factory method for the {@link yfiles.input.GraphInputMode#itemHoverInputMode} property. - *

- * This method will be called upon first access to the {@link yfiles.input.GraphInputMode#itemHoverInputMode} property. - *

- * @returns a new instance of {@link #itemHoverInputMode} with the {@link #hoverItems} property set to {@link #NONE}. - * @protected - */ - createItemHoverInputMode():yfiles.input.ItemHoverInputMode; - /** - * Factory method that creates the {@link yfiles.input.GraphInputMode#keyboardInputMode} instance. - * @returns - * @protected - */ - createKeyboardInputMode():yfiles.input.KeyboardInputMode; - /** - * Factory method for the {@link yfiles.input.GraphInputMode#marqueeSelectionInputMode} property. - *

- * This method will be called upon first access to the {@link yfiles.input.GraphInputMode#marqueeSelectionInputMode} property. - *

- * @returns a new instance of MarqueeSelectionInputMode - * @protected - */ - createMarqueeSelectionInputMode():yfiles.input.MarqueeSelectionInputMode; - /** - * Factory method for the {@link yfiles.input.MouseHoverInputMode} property. - *

- * This method will be called upon first access to the {@link yfiles.input.MouseHoverInputMode} property. - *

- * @returns a new instance of {@link } - * @protected - */ - createMouseHoverInputMode():yfiles.input.MouseHoverInputMode; - /** - * Factory method for the {@link yfiles.input.GraphInputMode#moveViewportInputMode} property. - *

- * This method will be called upon first access to the {@link yfiles.input.GraphInputMode#moveViewportInputMode} property. - *

- * @returns a new instance of {@link #moveViewportInputMode} - * @protected - */ - createMoveViewportInputMode():yfiles.input.MoveViewportInputMode; - /** - * Factory method for the {@link yfiles.input.GraphInputMode#navigationInputMode} property. - *

- * This method will be called upon first access to the {@link yfiles.input.GraphInputMode#navigationInputMode} property. - *

- * @returns a new instance of NavigationInputMode - * @protected - */ - createNavigationInputMode():yfiles.input.NavigationInputMode; - /** - * Helper method that yields a suitably configured {@link yfiles.input.SelectionEventArgs.} using the {@link yfiles.input.GraphInputMode#graphSelection} for this input mode. - * @param context An input mode context that is available in the {@link }. - *

- * Can be null in which case a new context for this instance is created automatically. - *

- * @returns A selection event argument that is configured for this instance. - * @protected - */ - createSelectionEventArgs(context:yfiles.input.IInputModeContext):yfiles.input.SelectionEventArgs; - /** - * Factory method for the {@link yfiles.input.GraphInputMode#tapInputMode} property. - *

- * This method will be called upon first access to the {@link yfiles.input.GraphInputMode#tapInputMode} property. - *

- * @returns a new instance of TapInputMode - * @protected - */ - createTapInputMode():yfiles.input.TapInputMode; - /** - * Factory method for the {@link yfiles.input.GraphInputMode#waitInputMode} property. - *

- * This method will be called upon first access to the {@link yfiles.input.GraphInputMode#waitInputMode} property. - *

- * @returns a new instance of {@link #waitInputMode} - * @protected - */ - createWaitInputMode():yfiles.input.WaitInputMode; - /** - * Actually performs a double-click on the given item. - *

- * This will raise the {@link yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} and {@link yfiles.input.GraphInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked} - * (depending on the button), and {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} - * events. - *

- * @param item The item that has been double-clicked. - * @param evt The original event arguments for the click. Setting its {@link #handled} property to true will indicate that the double-click was - * handled and events on other items in the same location are no longer raised. - * @protected - */ - doubleClick(item:yfiles.graph.IModelItem,evt:yfiles.input.ClickEventArgs):void; - /** - * Actually performs a double-tap on the given item. - *

- * This will raise the {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} event. - *

- * @param item The item that has been double-tapped. - * @param evt The original event arguments for the tap. Setting its {@link #handled} property to true will indicate that the double-tap was handled - * and events on other items in the same location are no longer raised. - * @protected - */ - doubleTap(item:yfiles.graph.IModelItem,evt:yfiles.input.TapEventArgs):void; - /** - * Used as a callback to find the items hit underneath a certain point. - *

- * This implementation uses the {@link yfiles.input.GraphEditorInputMode#hitTester} to determine the hit items. - *

- * @param context The context to use for to the {@link #isHit} callback. - * @param location The location to test. - * @param tests An array of {@link } values that encode for which model items the hit test should be performed for - * prioritizing. - * @param [filter=null] The predicate that can be used to filter the results. May be null. - * @returns An enumerable over the items that have been found for the location. - */ - findItems(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,tests:yfiles.graph.GraphItemTypes[],filter?:(obj:yfiles.graph.IModelItem)=>boolean):yfiles.collections.IEnumerable; - /** - * Used as a callback to find the items hit underneath a certain point. - *

- * This implementation uses the {@link yfiles.input.GraphEditorInputMode#hitTester} to determine the hit items. - *

- * @param location The location to test. - * @param tests An array of {@link } values that encode for which model items the hit test should be performed for - * prioritizing. - * @param [filter=null] The predicate that can be used to filter the results. May be null. - * @returns An enumerable over the items that have been found for the location. - */ - findItems(location:yfiles.geometry.Point,tests:yfiles.graph.GraphItemTypes[],filter?:(obj:yfiles.graph.IModelItem)=>boolean):yfiles.collections.IEnumerable; - /** - * Called by {@link yfiles.input.GraphInputMode#click} to query the item for an {@link yfiles.input.IClickListener} in its {@link yfiles.graph.ILookup#lookup} - * and handle it appropriately. - *

- * This method will query the {@link yfiles.input.IClickListener} and check whether it was {@link yfiles.input.IClickListener#getHitTestable hit} by the click, and if so, will invoke - * {@link yfiles.input.IClickListener#onClicked} and return true. - *

- * @param context The context for the click. - * @param item The item that has been clicked. - * @param location The click location. - * @returns Whether the action has been invoked and handling should be stopped. - * @see yfiles.input.IClickListener - * @see yfiles.input.GraphInputMode#click - * @protected - */ - handleClickListener(context:yfiles.input.IInputModeContext,item:yfiles.graph.IModelItem,location:yfiles.geometry.Point):boolean; - /** - * Performs marquee-selection with the given rectangle. - *

- * It delegates directly to the {@link yfiles.input.GraphInputMode#onMarqueeSelect} overload internally. - *

- * @param marqueeRectangle The selection rectangle. - */ - marqueeSelect(marqueeRectangle:yfiles.geometry.Rect):void; - /** - * Raises the {@link yfiles.input.GraphInputMode#addCanvasClickedListener CanvasClicked} event. - *

- * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.input.ClickEventArgs#handled} property to true. - *

- * @param evt The {@link } instance that contains the information about the click. - * @protected - */ - onCanvasClicked(evt:yfiles.input.ClickEventArgs):void; - /** - * Called when the {@link yfiles.input.GraphInputMode#clickInputMode} property value changes and after initialization of the field. - * @param oldMode the old value, which may be null the first time - * @param newMode the new value - * @protected - */ - onClickInputModeChanged(oldMode:yfiles.input.ClickInputMode,newMode:yfiles.input.ClickInputMode):void; - /** - * Called when the {@link yfiles.input.ContextMenuInputMode} property value changes and after initialization of the field. - * @param oldMode the old value, which may be null the first time - * @param newMode the new value - * @protected - */ - onContextMenuInputModeChanged(oldMode:yfiles.input.ContextMenuInputMode,newMode:yfiles.input.ContextMenuInputMode):void; - /** - * Raises the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} event. - *

- * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true. - *

- * @param evt The {@link } instance that contains the item that has been clicked. - * @protected - */ - onItemClicked(evt:yfiles.input.ItemClickedEventArgs):void; - /** - * Raises the {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} event. - *

- * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true. - *

- * @param evt The {@link } instance that contains the item that has been double clicked. - * @protected - */ - onItemDoubleClicked(evt:yfiles.input.ItemClickedEventArgs):void; - /** - * Called when the {@link yfiles.input.GraphInputMode#itemHoverInputMode} property value changes and after initialization of the field. - * @param oldMode the old value, which may be null the first time - * @param newMode the new value - * @protected - */ - onItemHoverInputModeChanged(oldMode:yfiles.input.ItemHoverInputMode,newMode:yfiles.input.ItemHoverInputMode):void; - /** - * Raises the {@link yfiles.input.GraphInputMode#addItemLeftClickedListener ItemLeftClicked} event. - *

- * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true. - *

- * @param evt The {@link } instance that contains the item that has been clicked. - * @protected - */ - onItemLeftClicked(evt:yfiles.input.ItemClickedEventArgs):void; - /** - * Raises the {@link yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} event. - *

- * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true. - *

- * @param evt The {@link } instance that contains the item that has been double clicked. - * @protected - */ - onItemLeftDoubleClicked(evt:yfiles.input.ItemClickedEventArgs):void; - /** - * Raises the {@link yfiles.input.GraphInputMode#addItemRightClickedListener ItemRightClicked} event. - *

- * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true. - *

- * @param evt The {@link } instance that contains the item that has been clicked. - * @protected - */ - onItemRightClicked(evt:yfiles.input.ItemClickedEventArgs):void; - /** - * Raises the {@link yfiles.input.GraphInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked} event. - *

- * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true. - *

- * @param evt The {@link } instance that contains the item that has been double clicked. - * @protected - */ - onItemRightDoubleClicked(evt:yfiles.input.ItemClickedEventArgs):void; - /** - * Called when the {@link yfiles.input.GraphInputMode#keyboardInputMode} changed. - * @param oldMode The old {@link #keyboardInputMode}. - * @param newMode The new {@link #keyboardInputMode}. - * @protected - */ - onKeyboardInputModeChanged(oldMode:yfiles.input.KeyboardInputMode,newMode:yfiles.input.KeyboardInputMode):void; - /** - * Performs marquee-selection with the given rectangle. - *

- * This method is called internally when either the {@link yfiles.input.GraphInputMode#marqueeSelect} method is called or the user - * performs a marquee-selection gesture via {@link yfiles.input.GraphInputMode#marqueeSelectionInputMode}. - *

- * @param context The input mode context. - * @param marqueeRectangle The selection rectangle. - * @protected - */ - onMarqueeSelect(context:yfiles.input.IInputModeContext,marqueeRectangle:yfiles.geometry.Rect):void; - /** - * Called when the {@link yfiles.input.GraphInputMode#marqueeSelectionInputMode} property value changes and after initialization of the field. - * @param oldMode the old value, which may be null the first time - * @param newMode the new value - * @protected - */ - onMarqueeSelectionInputModeChanged(oldMode:yfiles.input.MarqueeSelectionInputMode,newMode:yfiles.input.MarqueeSelectionInputMode):void; - /** - * Selects the given elements in the editor inside the provided marquee-selection rectangle. - *

- * This implementation iterates over the items and queries them for an implementation of {@link yfiles.input.IMarqueeTestable} - * using their {@link yfiles.graph.ILookup#lookup}. This instance will be used to determine whether the item should be selected. - *

- *

- * This method is, in the default implementation, only called with individual item types in items. - *

- * @param context The input mode context. - * @param marqueeRectangle The rectangle in world coordinates. - * @param items The items to iterate over. - * @param predicate The predicate that determines whether the provided item should be tested at all. May be null. - * @see yfiles.input.GraphInputMode#setSelected - * @see yfiles.input.GraphInputMode#onMarqueeSelect - * @protected - */ - onMarqueeSelectItems(context:yfiles.input.IInputModeContext,marqueeRectangle:yfiles.geometry.Rect,items:yfiles.collections.IEnumerable,predicate:(obj:yfiles.graph.IModelItem)=>boolean):void; - /** - * Called when the {@link yfiles.input.MouseHoverInputMode} property value changes and after initialization of the field. - * @param oldMode the old value, which may be null the first time - * @param newMode the new value - * @protected - */ - onMouseHoverInputModeChanged(oldMode:yfiles.input.MouseHoverInputMode,newMode:yfiles.input.MouseHoverInputMode):void; - /** - * Called when the {@link yfiles.input.GraphInputMode#moveViewportInputMode} property value changes and after initialization of the field. - * @param oldMode the old value, which may be null the first time - * @param newMode the new value - * @protected - */ - onMoveViewportInputModeChanged(oldMode:yfiles.input.MoveViewportInputMode,newMode:yfiles.input.MoveViewportInputMode):void; - /** - * Raises the {@link yfiles.input.GraphInputMode#addMultiSelectionFinishedListener MultiSelectionFinished} event. - * @param evt - * @protected - */ - onMultiSelectionFinished(evt:yfiles.input.SelectionEventArgs):void; - /** - * Raises the {@link yfiles.input.GraphInputMode#addMultiSelectionStartedListener MultiSelectionStarted} event. - * @param evt - * @protected - */ - onMultiSelectionStarted(evt:yfiles.input.SelectionEventArgs):void; - /** - * Called when the {@link yfiles.input.GraphInputMode#navigationInputMode} property value changes and after initialization of the field. - * @param oldMode the old value, which may be null the first time - * @param newMode the new value - * @protected - */ - onNavigationInputModeChanged(oldMode:yfiles.input.NavigationInputMode,newMode:yfiles.input.NavigationInputMode):void; - /** - * Raises the {@link yfiles.input.GraphInputMode#addPopulateItemContextMenuListener PopulateItemContextMenu} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onPopulateItemContextMenu(evt:yfiles.input.PopulateItemContextMenuEventArgs):void; - /** - * Raises the {@link yfiles.input.GraphInputMode#addQueryItemToolTipListener QueryItemToolTip} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onQueryItemToolTip(evt:yfiles.input.QueryItemToolTipEventArgs):void; - /** - * Called when the {@link yfiles.input.GraphInputMode#tapInputMode} property value changes and after initialization of the field. - * @param oldMode the old value, which may be null the first time - * @param newMode the new value - * @protected - */ - onTapInputModeChanged(oldMode:yfiles.input.TapInputMode,newMode:yfiles.input.TapInputMode):void; - /** - * Called when the {@link yfiles.input.GraphInputMode#waitInputMode} property value changes and after initialization of the field. - * @param oldMode the old value, which may be null the first time - * @param newMode the new value - * @protected - */ - onWaitInputModeChanged(oldMode:yfiles.input.WaitInputMode,newMode:yfiles.input.WaitInputMode):void; - /** - * Clears the current selection and selects all nodes and bends in this graph. - *

- * By default, this method will be called in response to a Ctrl+A key press recognized by {@link yfiles.input.GraphInputMode#keyboardInputMode}. - *

- * @see yfiles.input.GraphInputMode#clearSelection - * @see yfiles.input.GraphInputMode#setSelected - * @see yfiles.input.ICommand#SELECT_ALL - * @see yfiles.input.GraphInputMode#selectableItems - * @see yfiles.input.GraphInputMode#ignoreVoidStyles - */ - selectAll():void; - /** - * Callback that is used by this instance to set the current item on the {@link yfiles.input.NavigationInputMode#setCurrentItem NavigationInputMode} - * @param item The item to set as the new "current" item. - */ - setCurrentItem(item:yfiles.graph.IModelItem):void; - /** - * Uses the {@link yfiles.input.GraphInputMode#graphSelection} to select the given item. - * @param item The item to set the selection state on. - * @param selected The new selection state. - */ - setSelected(item:yfiles.graph.IModelItem,selected:boolean):void; - /** - * Callback predicate method that is used to determine whether the given item can be {@link yfiles.input.GraphInputMode#click clicked}. - *

- * This implementation uses the {@link yfiles.input.GraphInputMode#clickableItems} value to determine whether the item should be clicked. Note that this method will not be - * called for items that don't match {@link yfiles.input.GraphInputMode#clickableItems} for performance reasons. - *

- * @param item The item to check. - * @returns Whether the item should be {@link #click clicked} in response to a detected mouse click. - * @protected - */ - shouldClick(item:yfiles.graph.IModelItem):boolean; - /** - * Callback predicate method that is used to determine whether the given item should be selected when - * {@link yfiles.input.GraphInputMode#click clicked with the primary mouse button}. - *

- * This implementation uses the {@link yfiles.input.GraphInputMode#clickSelectableItems} value to determine whether the item should be selected. Note that this method will not be - * called for items that don't match {@link yfiles.input.GraphInputMode#clickSelectableItems} and {@link yfiles.input.GraphInputMode#selectableItems} for performance reasons. - *

- * @param item The item to check. - * @returns Whether the item should be selected in response to a detected mouse click with the primary button. - * @protected - */ - shouldClickSelect(item:yfiles.graph.IModelItem):boolean; - /** - * Callback predicate method that is used to determine whether the given item can be {@link yfiles.input.GraphInputMode#doubleClick double clicked}. - *

- * This implementation uses the {@link yfiles.input.GraphInputMode#shouldClick} method to determine whether the item should be - * double clicked. Note that this method will not be called for items that don't match {@link yfiles.input.GraphInputMode#clickableItems} for performance reasons. - *

- * @param item The item to check. - * @returns Whether the item should be {@link #doubleClick double clicked} in response to a detected mouse click. - * @protected - */ - shouldDoubleClick(item:yfiles.graph.IModelItem):boolean; - /** - * Callback that determines whether the provided {@link yfiles.graph.IModelItem} should be {@link yfiles.input.GraphInputMode#setCurrentItem set to the current item}. - *

- * This implementation uses the {@link yfiles.input.GraphInputMode#focusableItems} property to determine whether the item can be set to the current item. It also honors the - * {@link yfiles.input.GraphInputMode#ignoreVoidStyles} property. - *

- * @param item The item to check. - * @returns Whether to set the item as the current item. - * @protected - */ - shouldFocus(item:yfiles.graph.IModelItem):boolean; - /** - * Callback method that is used to determine which of the built-in {@link yfiles.input.ICommand}s to install. - *

- * This implementation unconditionally returns true, subclasses may override this method to adjust the behavior. - *

- * @param command The command to install. - * @returns Whether to install this command. - * @protected - */ - shouldInstallCommand(command:yfiles.input.ICommand):boolean; - /** - * Callback method used by {@link yfiles.input.GraphInputMode#marqueeSelect} that takes {@link yfiles.input.GraphInputMode#marqueeSelectableItems} and {@link yfiles.input.GraphInputMode#shouldSelectItem} - * into account. - * @param item The item to check. - * @returns Whether to possibly marquee select the item. - * @protected - */ - shouldMarqueeSelect(item:yfiles.graph.IModelItem):boolean; - /** - * Determines whether for the given item a context menu should be queried. - *

- * This implementation uses the {@link yfiles.input.GraphInputMode#contextMenuItems} property to determine whether a context menu should be queried for the given item. - *

- * @param item The item to check. - * @returns Whether to raise a {@link #addPopulateItemContextMenuListener PopulateItemContextMenu} event for - * the given item. - * @protected - */ - shouldPopulateContextMenu(item:yfiles.graph.IModelItem):boolean; - /** - * Determines whether for the given item a tool tip should be queried. - *

- * This implementation uses the {@link yfiles.input.GraphInputMode#toolTipItems} property to determine whether tool tip should be queried for the given item. - *

- * @param item The item to check. - * @returns Whether to raise a {@link #addQueryItemToolTipListener QueryItemToolTip} event for the - * given item. - * @protected - */ - shouldQueryToolTip(item:yfiles.graph.IModelItem):boolean; - /** - * Callback predicate method that is used as a broad classification whether an item can generally be selected. - *

- * This implementation uses and honors the {@link yfiles.input.GraphInputMode#selectableItems}, {@link yfiles.input.GraphInputMode#ignoreVoidStyles} and {@link yfiles.input.GraphInputMode#selectablePredicate} properties. This method is by default also called by {@link yfiles.input.GraphInputMode#shouldClickSelect} - * and {@link yfiles.input.GraphInputMode#shouldMarqueeSelect}, so turning selection off here also turns it off in other places. - *

- * @param item The item to check. - * @returns true if the item is selectable in general, false if not. - * @protected - */ - shouldSelectItem(item:yfiles.graph.IModelItem):boolean; - /** - * Actually performs the tap on the given item. - *

- * This will raise the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} event. If the event - * is unhandled by all its event handlers the item will be {@link yfiles.input.GraphInputMode#setSelected selected} and {@link yfiles.input.GraphInputMode#setCurrentItem focused}. Before selection - * {@link yfiles.input.GraphInputMode#clearSelection the current selection will be cleared}. - *

- * @param item The item that has been tapped. - * @param evt The original event arguments for the tap. Setting its {@link #handled} property to true will indicate that the tap was handled. By - * default this happens when the tapped item is either selected or focused. - * @protected - */ - tap(item:yfiles.graph.IModelItem,evt:yfiles.input.TapEventArgs):void; - /** - * Gets the graph instance from the {@link yfiles.input.MultiplexingInputMode#inputModeContext}. - * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - /** - * Gets the graph selection from the {@link yfiles.input.MultiplexingInputMode#inputModeContext}. - * @type {yfiles.view.IGraphSelection} - */ - graphSelection:yfiles.view.IGraphSelection; - /** - * Gets or sets the order of the types of items that should be used to determine what item has been clicked or tapped. - *

- * Change this field to adjust which items will be {@link yfiles.input.GraphInputMode#setSelected selected} if there are multiple items at a given location. The default - * order is - *

- *
    - *
  • {@link yfiles.graph.GraphItemTypes#BEND}
  • - *
  • {@link yfiles.graph.GraphItemTypes#EDGE_LABEL}
  • - *
  • {@link yfiles.graph.GraphItemTypes#EDGE}
  • - *
  • {@link yfiles.graph.GraphItemTypes#NODE}
  • - *
  • {@link yfiles.graph.GraphItemTypes#NODE_LABEL}
  • - *
  • {@link yfiles.graph.GraphItemTypes#PORT}
  • - *
- * @see yfiles.input.GraphInputMode#clickSelectableItems - * @see yfiles.input.GraphInputMode#selectableItems - * @see yfiles.input.GraphInputMode#findItems - * @type {Array.} - */ - clickHitTestOrder:yfiles.graph.GraphItemTypes[]; - /** - * Gets or sets the order of the types of items that should be used to determine what item has been double-clicked or - * double-tapped. - *

- * Change this field to adjust which items will be considered when {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener double-clicked} if there are multiple items at a given - * location. The default order is - *

- *
    - *
  • {@link yfiles.graph.GraphItemTypes#EDGE_LABEL}
  • - *
  • {@link yfiles.graph.GraphItemTypes#NODE_LABEL}
  • - *
  • {@link yfiles.graph.GraphItemTypes#BEND}
  • - *
  • {@link yfiles.graph.GraphItemTypes#EDGE}
  • - *
  • {@link yfiles.graph.GraphItemTypes#NODE}
  • - *
  • {@link yfiles.graph.GraphItemTypes#PORT}
  • - *
- * @see yfiles.input.GraphInputMode#clickSelectableItems - * @see yfiles.input.GraphInputMode#selectableItems - * @see yfiles.input.GraphInputMode#findItems - * @type {Array.} - */ - doubleClickHitTestOrder:yfiles.graph.GraphItemTypes[]; - /** - * Gets or sets the event recognizer that will be queried to decide if a click should select the item that is currently - * visible under the mouse cursor, without giving more important items higher priority. - *

- * If the recognizer determines that the user wanted to use the detail clicking behavior, the {@link yfiles.input.GraphEditorInputMode#hitTester} will be queried for the - * given item and the first item that is returned will be considered a hit. Otherwise all hit items are examined and are - * prioritized by item type. E.g. by default clicking on a node will select the node, even if there is a node label which - * has been clicked at the same point. If detail selection is recognized, the label will be selected. - *

- *

- * The default is {@link yfiles.input.KeyEventRecognizers#SHIFT_PRESSED}. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - detailSelectionRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that will be queried to decide if a click should cycle through all the items that are - * currently under the mouse cursor. - *

- * If the recognizer determines that the user wanted to use the cyclic click selection behavior, the {@link yfiles.input.GraphEditorInputMode#hitTester} will be queried for - * the given item and previously reported items will be ignored. E.g. if multiple nodes are overlapping each other, - * clicking on them will report the first item for the first click, the second one for the second click and so on. If all - * elements have been reported previously, the first one is going to be reported again. If the order of the elements at the - * clicked location changes, the cyclic selection is restarted anew. - *

- *

- * The default is {@link yfiles.input.KeyEventRecognizers#ALT_PRESSED}. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - cyclicSelectionRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that will be queried to decide if a click is deemed a multi selection gesture. - *

- * The default is a combination of {@link yfiles.input.KeyEventRecognizers#CONTROL_PRESSED} or - * {@link yfiles.input.KeyEventRecognizers#META_PRESSED}. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - multiSelectionRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets which types of items should be reported through the {@link yfiles.input.GraphInputMode#addItemClickedListener item click events}. - *

- * This also affects taps. - *

- *

- * The default is {@link yfiles.graph.GraphItemTypes#ALL}. - *

- * @see yfiles.input.GraphInputMode#shouldClick - * @type {yfiles.graph.GraphItemTypes} - */ - clickableItems:yfiles.graph.GraphItemTypes; - /** - * Gets or sets the items that can be given focus via the {@link yfiles.input.GraphInputMode#setCurrentItem} method. - *

- * The focusable items. The default is {@link yfiles.graph.GraphItemTypes#NODE} - *

- * @default yfiles.graph.GraphItemTypes.NODE - * @type {yfiles.graph.GraphItemTypes} - */ - focusableItems:yfiles.graph.GraphItemTypes; - /** - * Gets or sets which types of items should be selectable at all. - *

- * The default is {@link yfiles.graph.GraphItemTypes#ALL}. - *

- * @see yfiles.input.GraphInputMode#setSelected - * @type {yfiles.graph.GraphItemTypes} - */ - selectableItems:yfiles.graph.GraphItemTypes; - /** - * Gets or sets a predicate that is queried to determine whether a given {@link yfiles.graph.IModelItem} is selectable. - *

- * This allows to further restrict which items are selectable, compared to {@link yfiles.input.GraphInputMode#selectableItems}. If this property is set to null the effect is - * the same as a predicate that always returns true. - *

- * @type {function(yfiles.graph.IModelItem): boolean} - */ - selectablePredicate:(obj:yfiles.graph.IModelItem)=>boolean; - /** - * Gets or sets which types of items should be selectable by mouse clicks. - *

- * The default is {@link yfiles.graph.GraphItemTypes#ALL}. - *

- * @see yfiles.input.GraphInputMode#shouldClickSelect - * @see yfiles.input.GraphInputMode#setSelected - * @type {yfiles.graph.GraphItemTypes} - */ - clickSelectableItems:yfiles.graph.GraphItemTypes; - /** - * Gets or sets which types of items should be selected during {@link yfiles.input.GraphInputMode#marqueeSelect marquee selections}. - *

- * The default is a combination of {@link yfiles.graph.GraphItemTypes#NODE}, {@link yfiles.graph.GraphItemTypes#EDGE}, and - * {@link yfiles.graph.GraphItemTypes#BEND}. - *

- * @see yfiles.input.GraphInputMode#shouldMarqueeSelect - * @see yfiles.input.GraphInputMode#setSelected - * @type {yfiles.graph.GraphItemTypes} - */ - marqueeSelectableItems:yfiles.graph.GraphItemTypes; - /** - * Gets or sets a value indicating whether void styles ({@link yfiles.styles.VoidNodeStyle}, {@link yfiles.styles.VoidEdgeStyle}, - * {@link yfiles.styles.VoidLabelStyle}, and {@link yfiles.styles.VoidPortStyle}) should be ignored when selecting or focusing items. - * @type {boolean} - */ - ignoreVoidStyles:boolean; - /** - * Gets or sets the {@link yfiles.input.GraphInputMode#contextMenuInputMode} property. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.GraphInputMode#createContextMenuInputMode} - * will be called. Upon change the {@link yfiles.input.GraphInputMode#onContextMenuInputModeChanged} method will be called. - *

- *

- * By default this input mode has a priority of 60. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @type {yfiles.input.ContextMenuInputMode} - */ - contextMenuInputMode:yfiles.input.ContextMenuInputMode; - /** - * Gets or sets the types of items a context menu should be queried for. - *

- * The items for which a context menu should be {@link yfiles.input.GraphInputMode#addPopulateItemContextMenuListener queried}. The default value is - * {@link yfiles.graph.GraphItemTypes#NODE}|{@link yfiles.graph.GraphItemTypes#EDGE}. - *

- * @default 1 | 2 - * @type {yfiles.graph.GraphItemTypes} - */ - contextMenuItems:yfiles.graph.GraphItemTypes; - /** - * Adds the given listener for the PopulateItemContextMenu event that occurs when the {@link yfiles.input.ContextMenuInputMode context menu} over an item is about to - * be opened to determine the contents of the Menu. - *

- * This method will only be called for items that match the {@link yfiles.input.GraphInputMode#contextMenuItems} type. - *

- * @param listener The listener to add. - * @see yfiles.input.GraphInputMode#removePopulateItemContextMenuListener - */ - addPopulateItemContextMenuListener(listener:(sender:any,evt:yfiles.input.PopulateItemContextMenuEventArgs)=>void):void; - /** - * Removes the given listener for the PopulateItemContextMenu event that occurs when the {@link yfiles.input.ContextMenuInputMode context menu} over an item is about - * to be opened to determine the contents of the Menu. - *

- * This method will only be called for items that match the {@link yfiles.input.GraphInputMode#contextMenuItems} type. - *

- * @param listener The listener to remove. - * @see yfiles.input.GraphInputMode#addPopulateItemContextMenuListener - */ - removePopulateItemContextMenuListener(listener:(sender:any,evt:yfiles.input.PopulateItemContextMenuEventArgs)=>void):void; - /** - * Gets or sets the {@link yfiles.input.GraphInputMode#mouseHoverInputMode} property. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.GraphInputMode#createMouseHoverInputMode} - * will be called. Upon change the {@link yfiles.input.GraphInputMode#onMouseHoverInputModeChanged} method will be called. - *

- *

- * By default this input mode has a priority of 100. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @type {yfiles.input.MouseHoverInputMode} - */ - mouseHoverInputMode:yfiles.input.MouseHoverInputMode; - /** - * Gets or sets the types of the items that should be queried a tool tip for. - *

- * The items for which a tool tip text should be {@link yfiles.input.GraphInputMode#addQueryItemToolTipListener queried}. The default value is - * {@link yfiles.graph.GraphItemTypes#NODE}|{@link yfiles.graph.GraphItemTypes#EDGE}|{@link yfiles.graph.GraphItemTypes#LABEL}|{@link yfiles.graph.GraphItemTypes#PORT}|. - *

- * @default 1 | 2 | 12 | 16 - * @type {yfiles.graph.GraphItemTypes} - */ - toolTipItems:yfiles.graph.GraphItemTypes; - /** - * Adds the given listener for the QueryItemToolTip event that occurs when the mouse is {@link yfiles.input.MouseHoverInputMode hovering} over an item to determine - * the tool tip to display. - *

- * This method will only be called for items that match the {@link yfiles.input.GraphInputMode#toolTipItems} type. - *

- * @param listener The listener to add. - * @see yfiles.input.GraphInputMode#removeQueryItemToolTipListener - */ - addQueryItemToolTipListener(listener:(sender:any,evt:yfiles.input.QueryItemToolTipEventArgs)=>void):void; - /** - * Removes the given listener for the QueryItemToolTip event that occurs when the mouse is {@link yfiles.input.MouseHoverInputMode hovering} over an item to - * determine the tool tip to display. - *

- * This method will only be called for items that match the {@link yfiles.input.GraphInputMode#toolTipItems} type. - *

- * @param listener The listener to remove. - * @see yfiles.input.GraphInputMode#addQueryItemToolTipListener - */ - removeQueryItemToolTipListener(listener:(sender:any,evt:yfiles.input.QueryItemToolTipEventArgs)=>void):void; - /** - * Gets or sets the {@link yfiles.input.ClickInputMode} that is used by this instance to determine clicks. - *

- * Whenever the mode detects a {@link yfiles.input.ClickInputMode#addClickedListener click}, this mode will use the {@link yfiles.input.IHitTester.} from the {@link yfiles.input.MultiplexingInputMode#inputModeContext} to determine the items being hit. If they match the - * {@link yfiles.input.GraphInputMode#clickableItems} type, the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} event will be triggered. If - * they {@link yfiles.input.GraphInputMode#shouldFocus}, the item will be {@link yfiles.input.GraphInputMode#setCurrentItem set as the current item}. - *

- *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.GraphInputMode#createClickInputMode} - * will be called. Upon change the {@link yfiles.input.GraphInputMode#onClickInputModeChanged} method will be called. - *

- *

- * By default this input mode has a priority of 10. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @see yfiles.input.GraphInputMode#onItemClicked - * @type {yfiles.input.ClickInputMode} - */ - clickInputMode:yfiles.input.ClickInputMode; - /** - * Gets or sets the {@link yfiles.input.GraphInputMode#tapInputMode} property. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.GraphInputMode#createTapInputMode} - * will be called. Upon change the {@link yfiles.input.GraphInputMode#onTapInputModeChanged} method will be called. - *

- *

- * By default this input mode has a priority of 20. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @type {yfiles.input.TapInputMode} - */ - tapInputMode:yfiles.input.TapInputMode; - /** - * Adds the given listener for the ItemClicked event that occurs when an item has been clicked. - *

- * If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. - *

- *

- * This event will also be raised for {@link yfiles.input.GraphInputMode#tap taps}. - *

- *

- * Button-specific events ({@link yfiles.input.GraphInputMode#addItemLeftClickedListener ItemLeftClicked} and - * {@link yfiles.input.GraphInputMode#addItemRightClickedListener ItemRightClicked}) will be raised before this event. - * If one of those is marked {@link yfiles.input.ItemClickedEventArgs.#handled} this event will not be raised anymore. - *

- * @param listener The listener to add. - * @see yfiles.input.GraphInputMode#clickableItems - * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener - * @see yfiles.input.GraphInputMode#addItemLeftClickedListener - * @see yfiles.input.GraphInputMode#addItemRightClickedListener - * @see yfiles.input.GraphInputMode#removeItemClickedListener - */ - addItemClickedListener(listener:(sender:any,evt:yfiles.input.ItemClickedEventArgs)=>void):void; - /** - * Removes the given listener for the ItemClicked event that occurs when an item has been clicked. - *

- * If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. - *

- *

- * This event will also be raised for {@link yfiles.input.GraphInputMode#tap taps}. - *

- *

- * Button-specific events ({@link yfiles.input.GraphInputMode#addItemLeftClickedListener ItemLeftClicked} and - * {@link yfiles.input.GraphInputMode#addItemRightClickedListener ItemRightClicked}) will be raised before this event. - * If one of those is marked {@link yfiles.input.ItemClickedEventArgs.#handled} this event will not be raised anymore. - *

- * @param listener The listener to remove. - * @see yfiles.input.GraphInputMode#clickableItems - * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener - * @see yfiles.input.GraphInputMode#addItemLeftClickedListener - * @see yfiles.input.GraphInputMode#addItemRightClickedListener - * @see yfiles.input.GraphInputMode#addItemClickedListener - */ - removeItemClickedListener(listener:(sender:any,evt:yfiles.input.ItemClickedEventArgs)=>void):void; - /** - * Adds the given listener for the ItemLeftClicked event that occurs when an item has been left clicked. - *

- * This event will be raised before the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} - * event. If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. This also means - * that the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} event will not be raised in that - * case. - *

- * @param listener The listener to add. - * @see yfiles.input.GraphInputMode#clickableItems - * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener - * @see yfiles.input.GraphInputMode#addItemClickedListener - * @see yfiles.input.GraphInputMode#addItemRightClickedListener - * @see yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener - * @see yfiles.input.GraphInputMode#removeItemLeftClickedListener - */ - addItemLeftClickedListener(listener:(sender:any,evt:yfiles.input.ItemClickedEventArgs)=>void):void; - /** - * Removes the given listener for the ItemLeftClicked event that occurs when an item has been left clicked. - *

- * This event will be raised before the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} - * event. If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. This also means - * that the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} event will not be raised in that - * case. - *

- * @param listener The listener to remove. - * @see yfiles.input.GraphInputMode#clickableItems - * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener - * @see yfiles.input.GraphInputMode#addItemClickedListener - * @see yfiles.input.GraphInputMode#addItemRightClickedListener - * @see yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener - * @see yfiles.input.GraphInputMode#addItemLeftClickedListener - */ - removeItemLeftClickedListener(listener:(sender:any,evt:yfiles.input.ItemClickedEventArgs)=>void):void; - /** - * Adds the given listener for the ItemRightClicked event that occurs when an item has been right clicked. - *

- * This event will be raised before the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} - * event. If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. This also means - * that the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} event will not be raised in that - * case. - *

- * @param listener The listener to add. - * @see yfiles.input.GraphInputMode#clickableItems - * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener - * @see yfiles.input.GraphInputMode#addItemClickedListener - * @see yfiles.input.GraphInputMode#addItemLeftClickedListener - * @see yfiles.input.GraphInputMode#addItemRightDoubleClickedListener - * @see yfiles.input.GraphInputMode#removeItemRightClickedListener - */ - addItemRightClickedListener(listener:(sender:any,evt:yfiles.input.ItemClickedEventArgs)=>void):void; - /** - * Removes the given listener for the ItemRightClicked event that occurs when an item has been right clicked. - *

- * This event will be raised before the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} - * event. If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. This also means - * that the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} event will not be raised in that - * case. - *

- * @param listener The listener to remove. - * @see yfiles.input.GraphInputMode#clickableItems - * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener - * @see yfiles.input.GraphInputMode#addItemClickedListener - * @see yfiles.input.GraphInputMode#addItemLeftClickedListener - * @see yfiles.input.GraphInputMode#addItemRightDoubleClickedListener - * @see yfiles.input.GraphInputMode#addItemRightClickedListener - */ - removeItemRightClickedListener(listener:(sender:any,evt:yfiles.input.ItemClickedEventArgs)=>void):void; - /** - * Adds the given listener for the ItemDoubleClicked event that occurs when an item has been double clicked. - *

- * If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. - *

- *

- * Depending on the value of the {@link yfiles.input.ClickInputMode#doubleClickPolicy} property of {@link yfiles.input.GraphInputMode#clickInputMode} this event may be preceded by no, one, or two {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} - * events (as well as the corresponding button-specific event). - *

- *

- * Button-specific events ({@link yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} and - * {@link yfiles.input.GraphInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked}) will be raised before this - * event. If one of those is marked {@link yfiles.input.ItemClickedEventArgs.#handled} this event will not be raised anymore. - *

- * @param listener The listener to add. - * @see yfiles.input.GraphInputMode#addItemClickedListener - * @see yfiles.input.GraphInputMode#clickableItems - * @see yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener - * @see yfiles.input.GraphInputMode#addItemRightDoubleClickedListener - * @see yfiles.input.GraphInputMode#removeItemDoubleClickedListener - */ - addItemDoubleClickedListener(listener:(sender:any,evt:yfiles.input.ItemClickedEventArgs)=>void):void; - /** - * Removes the given listener for the ItemDoubleClicked event that occurs when an item has been double clicked. - *

- * If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. - *

- *

- * Depending on the value of the {@link yfiles.input.ClickInputMode#doubleClickPolicy} property of {@link yfiles.input.GraphInputMode#clickInputMode} this event may be preceded by no, one, or two {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} - * events (as well as the corresponding button-specific event). - *

- *

- * Button-specific events ({@link yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} and - * {@link yfiles.input.GraphInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked}) will be raised before this - * event. If one of those is marked {@link yfiles.input.ItemClickedEventArgs.#handled} this event will not be raised anymore. - *

- * @param listener The listener to remove. - * @see yfiles.input.GraphInputMode#addItemClickedListener - * @see yfiles.input.GraphInputMode#clickableItems - * @see yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener - * @see yfiles.input.GraphInputMode#addItemRightDoubleClickedListener - * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener - */ - removeItemDoubleClickedListener(listener:(sender:any,evt:yfiles.input.ItemClickedEventArgs)=>void):void; - /** - * Adds the given listener for the ItemLeftDoubleClicked event that occurs when an item has been left double clicked. - *

- * This event will be raised before the {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} - * event. If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. This also means - * that the {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} event will not be raised - * in that case. - *

- * @param listener The listener to add. - * @see yfiles.input.GraphInputMode#clickableItems - * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener - * @see yfiles.input.GraphInputMode#addItemRightDoubleClickedListener - * @see yfiles.input.GraphInputMode#removeItemLeftDoubleClickedListener - */ - addItemLeftDoubleClickedListener(listener:(sender:any,evt:yfiles.input.ItemClickedEventArgs)=>void):void; - /** - * Removes the given listener for the ItemLeftDoubleClicked event that occurs when an item has been left double clicked. - *

- * This event will be raised before the {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} - * event. If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. This also means - * that the {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} event will not be raised - * in that case. - *

- * @param listener The listener to remove. - * @see yfiles.input.GraphInputMode#clickableItems - * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener - * @see yfiles.input.GraphInputMode#addItemRightDoubleClickedListener - * @see yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener - */ - removeItemLeftDoubleClickedListener(listener:(sender:any,evt:yfiles.input.ItemClickedEventArgs)=>void):void; - /** - * Adds the given listener for the ItemRightDoubleClicked event that occurs when an item has been right double clicked. - *

- * This event will be raised before the {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} - * event. If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. This also means - * that the {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} event will not be raised - * in that case. - *

- * @param listener The listener to add. - * @see yfiles.input.GraphInputMode#clickableItems - * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener - * @see yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener - * @see yfiles.input.GraphInputMode#removeItemRightDoubleClickedListener - */ - addItemRightDoubleClickedListener(listener:(sender:any,evt:yfiles.input.ItemClickedEventArgs)=>void):void; - /** - * Removes the given listener for the ItemRightDoubleClicked event that occurs when an item has been right double clicked. - *

- * This event will be raised before the {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} - * event. If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. This also means - * that the {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} event will not be raised - * in that case. - *

- * @param listener The listener to remove. - * @see yfiles.input.GraphInputMode#clickableItems - * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener - * @see yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener - * @see yfiles.input.GraphInputMode#addItemRightDoubleClickedListener - */ - removeItemRightDoubleClickedListener(listener:(sender:any,evt:yfiles.input.ItemClickedEventArgs)=>void):void; - /** - * Adds the given listener for the CanvasClicked event that occurs when the empty canvas area has been clicked. - *

- * If one of the event handlers sets the {@link yfiles.input.ClickEventArgs#handled} property to true the event will not be propagated anymore. - *

- * @param listener The listener to add. - * @see yfiles.input.GraphInputMode#addItemClickedListener - * @see yfiles.input.GraphInputMode#removeCanvasClickedListener - */ - addCanvasClickedListener(listener:(sender:any,evt:yfiles.input.ClickEventArgs)=>void):void; - /** - * Removes the given listener for the CanvasClicked event that occurs when the empty canvas area has been clicked. - *

- * If one of the event handlers sets the {@link yfiles.input.ClickEventArgs#handled} property to true the event will not be propagated anymore. - *

- * @param listener The listener to remove. - * @see yfiles.input.GraphInputMode#addItemClickedListener - * @see yfiles.input.GraphInputMode#addCanvasClickedListener - */ - removeCanvasClickedListener(listener:(sender:any,evt:yfiles.input.ClickEventArgs)=>void):void; - /** - * Gets or sets the {@link yfiles.input.GraphInputMode#marqueeSelectionInputMode} property. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.GraphInputMode#createMarqueeSelectionInputMode} - * will be called. Upon change the {@link yfiles.input.GraphInputMode#onMarqueeSelectionInputModeChanged} method will be called. - *

- *

- * By default this input mode has a priority of 50. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @type {yfiles.input.MarqueeSelectionInputMode} - */ - marqueeSelectionInputMode:yfiles.input.MarqueeSelectionInputMode; - /** - * Gets or sets the {@link yfiles.input.GraphInputMode#navigationInputMode} property. - *

- * This mode is responsible for navigating and traversing the elements in the {@link yfiles.graph.IGraph}. If the field has not yet - * been initialized upon first access, the factory method {@link yfiles.input.GraphInputMode#createNavigationInputMode} will be - * called. Upon change the {@link yfiles.input.GraphInputMode#onNavigationInputModeChanged} method will be called. - *

- *

- * By default this input mode has a priority of 55. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @type {yfiles.input.NavigationInputMode} - */ - navigationInputMode:yfiles.input.NavigationInputMode; - /** - * Adds the given listener for the MultiSelectionStarted event that occurs when a single or multi select operation has been - * started. - *

- * The event is not triggered for the individual selection operations that constitute a multi selection operation. - *

- * @param listener The listener to add. - * @see yfiles.input.GraphInputMode#removeMultiSelectionStartedListener - */ - addMultiSelectionStartedListener(listener:(sender:any,evt:yfiles.input.SelectionEventArgs)=>void):void; - /** - * Removes the given listener for the MultiSelectionStarted event that occurs when a single or multi select operation has - * been started. - *

- * The event is not triggered for the individual selection operations that constitute a multi selection operation. - *

- * @param listener The listener to remove. - * @see yfiles.input.GraphInputMode#addMultiSelectionStartedListener - */ - removeMultiSelectionStartedListener(listener:(sender:any,evt:yfiles.input.SelectionEventArgs)=>void):void; - /** - * Adds the given listener for the MultiSelectionFinished event that occurs when a single or multi select operation has - * been finished. - *

- * The event is not triggered for the individual selection operations that constitute a multi selection operation. - *

- * @param listener The listener to add. - * @see yfiles.input.GraphInputMode#removeMultiSelectionFinishedListener - */ - addMultiSelectionFinishedListener(listener:(sender:any,evt:yfiles.input.SelectionEventArgs)=>void):void; - /** - * Removes the given listener for the MultiSelectionFinished event that occurs when a single or multi select operation has - * been finished. - *

- * The event is not triggered for the individual selection operations that constitute a multi selection operation. - *

- * @param listener The listener to remove. - * @see yfiles.input.GraphInputMode#addMultiSelectionFinishedListener - */ - removeMultiSelectionFinishedListener(listener:(sender:any,evt:yfiles.input.SelectionEventArgs)=>void):void; - /** - * Gets or sets the {@link yfiles.input.WaitInputMode} that is provided by this instance for those who need to make use of it. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.GraphInputMode#createWaitInputMode} - * will be called. Upon change the {@link yfiles.input.GraphInputMode#onWaitInputModeChanged} method will be called. - *

- *

- * By default this input mode has a priority of -1. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @see yfiles.input.WaitInputMode#waiting - * @type {yfiles.input.WaitInputMode} - */ - waitInputMode:yfiles.input.WaitInputMode; - /** - * Gets or sets the {@link yfiles.input.GraphInputMode#itemHoverInputMode} that is provided by this instance for those who need to make use of it. - *

- * Note that initially the {@link yfiles.input.ItemHoverInputMode#hoverItems} property is set to - * {@link yfiles.graph.GraphItemTypes#NONE}, which effectively disables the functionality of the mode initially. In order to get - * the mode to fire events, the property should be set to a corresponding value. - *

- *

- * If the backing field has not yet been initialized upon first access, the factory method {@link yfiles.input.GraphInputMode#createItemHoverInputMode} - * will be called. Upon change the {@link yfiles.input.GraphInputMode#onItemHoverInputModeChanged} method will be called. - *

- *

- * By default this input mode has a priority of 55. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @type {yfiles.input.ItemHoverInputMode} - */ - itemHoverInputMode:yfiles.input.ItemHoverInputMode; - /** - * Gets or sets the {@link yfiles.input.GraphInputMode#moveViewportInputMode} associated with this instance. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.GraphInputMode#createMoveViewportInputMode} - * will be called. Upon change the {@link yfiles.input.GraphInputMode#onMoveViewportInputModeChanged} method will be called. - *

- *

- * By default this input mode has a priority of 39. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @type {yfiles.input.MoveViewportInputMode} - */ - moveViewportInputMode:yfiles.input.MoveViewportInputMode; - /** - * Gets or sets the {@link yfiles.input.GraphInputMode#keyboardInputMode}. - *

- * By default this input mode has a priority of 0. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @type {yfiles.input.KeyboardInputMode} - */ - keyboardInputMode:yfiles.input.KeyboardInputMode; - /** - * Gets a collection of commands that this input mode will handle. - *

- * This collection can be modified by removing commands to prevent the input mode from handling them. Previously removed - * commands can also be re-added again to enable them again. However, the input mode will never handle commands that - * weren't in the initial collection. Adding those will do nothing. - *

- * @type {yfiles.collections.ICollection.} - */ - availableCommands:yfiles.collections.ICollection; - /** - * Gets or sets a property that determines whether clipboard operations with the usual shortcuts are enabled on the - * canvas. - *

- * Default value is true - *

- * @default true - * @type {boolean} - */ - allowClipboardOperations:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.GraphInputMode; - } - /** - * Concrete {@link yfiles.input.SnapContext} implementation which handles snapping movement for {@link yfiles.graph.IGraph} items. - *

- * This class provides a set of properties that determine the way snapping operations are being performed in the context of - * {@link yfiles.graph.IGraph}s. {@link yfiles.input.IPositionHandler} implementations and the like can use the following idiom to retrieve - * instances of this class: - *

- *

Related demos:

- *
    - *
  • Tutorial: 01 Getting Started, step 15 Snapping
  • - *
- * @see yfiles.input.GraphEditorInputMode - * @see yfiles.input.GraphEditorInputMode#snapContext - * @class - * @extends {yfiles.input.SnapContext} - */ - export interface GraphSnapContext extends yfiles.input.SnapContext{} - export class GraphSnapContext { - /** - * Creates a new instance with default settings. - */ - constructor(); - /** - * Adds {@link yfiles.input.MovementInfo} representing an {@link yfiles.graph.IBend} that will be considered for the next drag gesture. - *

- * The default {@link yfiles.input.IHandle} of an {@link yfiles.graph.IBend} calls this method in its {@link yfiles.input.IDragHandler#initializeDrag} - * method so snap results are calculated when this bend is repositioned. Custom {@link yfiles.input.IHandle} implementations can - * add infos created by {@link yfiles.input.GraphSnapContext#getMovementInfo}. - *

- * @param info The {@link } representing the bend to be moved. Can be created with - * {@link #getMovementInfo}. - */ - addBendToBeMoved(info:yfiles.input.MovementInfo):void; - /** - * Adds {@link yfiles.input.MovementInfo} representing the end of an {@link yfiles.graph.IEdge} that will be considered for the next drag - * gesture. - *

- * The {@link yfiles.input.IHandle} returned by the default {@link yfiles.input.IEdgePortHandleProvider} of an {@link yfiles.graph.IEdge} calls - * this method in its {@link yfiles.input.IDragHandler#initializeDrag} method so snap results are calculated when reparenting this - * edge end. Custom {@link yfiles.input.IHandle} implementations can call {@link yfiles.input.GraphSnapContext#getMovementInfos} and add - * the first or last {@link yfiles.input.MovementInfo} of the returned list. - *

- * @param info The {@link } representing the edge end to be reparented. Can be created with - * {@link #getMovementInfos}. - * @param sourceEnd true if the info represents the source end of the edge. - */ - addEdgeEndToBeMoved(info:yfiles.input.MovementInfo,sourceEnd:boolean):void; - /** - * Adds an item which will be reshaped. - * @param item The item to be reshaped. - */ - addItemToBeReshaped(item:yfiles.graph.IModelItem):void; - /** - * Adds {@link yfiles.input.MovementInfo} representing an {@link yfiles.graph.INode} that will be considered for the next drag gesture. - *

- * The default {@link yfiles.input.IPositionHandler} of an {@link yfiles.graph.INode} calls this method in its {@link yfiles.input.IDragHandler#initializeDrag} - * method so snap results are calculated when this node is repositioned. Custom {@link yfiles.input.IPositionHandler} - * implementations can add infos created by {@link yfiles.input.GraphSnapContext#getMovementInfo}. - *

- * @param info The {@link } representing the node to be moved. Can be created with - * {@link #getMovementInfo}. - */ - addNodeToBeMoved(info:yfiles.input.MovementInfo):void; - /** - * Adds an orthogonally moved segment to this context for which this instance will automatically collect - * {@link yfiles.input.SnapResult}s and provide a default visualization. - *

- * This method can be called during initialization to collect orthogonal segments that should be tested against {@link yfiles.input.GraphSnapContext#fixedSegmentSnapLines} and {@link yfiles.input.GraphSnapContext#additionalSnapLines}. - *

- * @param start The starting point of the manipulated segment. - * @param end The end point of the manipulated segment. - */ - addOrthogonalSegment(start:yfiles.input.MovementInfo,end:yfiles.input.MovementInfo):void; - /** - * Adds {@link yfiles.input.MovementInfo} representing an {@link yfiles.graph.IPort} that will be considered for the next drag gesture. - *

- * The default {@link yfiles.input.IHandle} of an {@link yfiles.graph.IPort} calls this method in its {@link yfiles.input.IDragHandler#initializeDrag} - * method so snap results are calculated for this port. Custom {@link yfiles.input.IHandle} implementations can add infos created - * by {@link yfiles.input.GraphSnapContext#getMovementInfo}. - *

- * @param info The {@link } representing the port to be moved. Can be created with - * {@link #getMovementInfo}. - */ - addPortToBeMoved(info:yfiles.input.MovementInfo):void; - /** - * Adds an entry for the same-height-snapping. - *

- * During {@link yfiles.input.SnapContext#isInitializing initialization} this method can be used to register entries that can later be retrieved using the {@link yfiles.input.GraphSnapContext#findSameHeightEntries} - * method. The rectangle will be used to obtain the height value and will also be used for the visualization of the snap - * result. - *

- * @param rectangle The rectangle to obtain the height value from. This rectangle will be used for the snap result visualization. - * @see yfiles.input.GraphSnapContext#addSameWidthEntry - */ - addSameHeightEntry(rectangle:yfiles.geometry.Rect):void; - /** - * Adds an entry for the same-width-snapping. - *

- * During {@link yfiles.input.SnapContext#isInitializing initialization} this method can be used to register entries that can later be retrieved using the {@link yfiles.input.GraphSnapContext#findSameWidthEntries} - * method. The rectangle will be used to obtain the width value and will also be used for the visualization of the snap - * result. - *

- * @param rectangle The rectangle to obtain the width value from. This rectangle will be used for the snap result visualization. - * @see yfiles.input.GraphSnapContext#addSameHeightEntry - */ - addSameWidthEntry(rectangle:yfiles.geometry.Rect):void; - /** - * Collects the {@link yfiles.input.OrthogonalSnapLine}s for the nodes which are not moving. - *

- * Delegates to the {@link yfiles.input.ISnapLineProvider} implementation in the lookup of the {@link yfiles.graph.INode}. - *

- * @param evt - * @protected - */ - collectFixedNodeSnapLines(evt:yfiles.input.CollectGraphSnapLinesEventArgs):void; - /** - * Collects the {@link yfiles.input.OrthogonalSnapLine}s for the ports which are not moving. - *

- * Delegates to the {@link yfiles.input.ISnapLineProvider} implementation in the lookup of the {@link yfiles.graph.IPort}. - *

- * @param evt - * @protected - */ - collectFixedPortSnapLines(evt:yfiles.input.CollectGraphSnapLinesEventArgs):void; - /** - * Collects snap lines for edge segments. - *

- * Delegates to the {@link yfiles.input.ISnapLineProvider} implementation in the lookup of the {@link yfiles.graph.IEdge}. This - * implementation should then make us of {@link yfiles.input.GraphSnapContext#getMovementInfos} to determine what segments are - * fixed. - *

- * @param evt - * @protected - */ - collectFixedSegmentSnapLines(evt:yfiles.input.CollectGraphSnapLinesEventArgs):void; - /** - * Collects all node widths and heights in the collections {@link yfiles.input.GraphSnapContext#findSameWidthEntries} and - * {@link yfiles.input.GraphSnapContext#findSameHeightEntries}. - *

- * This method will only be called if {@link yfiles.input.GraphSnapContext#collectNodeSizes} is enabled and delegates to {@link yfiles.input.GraphSnapContext#addSameHeightEntry} and - * {@link yfiles.input.GraphSnapContext#addSameWidthEntry}. - *

- * @protected - */ - collectSameSizeEntries():void; - /** - * Finds pairs of nodes that are visually adjacent to create {@link yfiles.input.GraphSnapContext#collectNodePairCenterSnapLines center} and {@link yfiles.input.GraphSnapContext#collectNodePairSnapLines same distance} snap lines. - * @protected - */ - collectVisibleNodePairs():void; - /** - * Finds the entries ({@link yfiles.geometry.Rect}s) that have been registered using the {@link yfiles.input.GraphSnapContext#addSameHeightEntry} - * previously that best match the given constraints. - * @param size The size to find the closest set of identical sizes. - * @param maxSize The maximum allowed size. - * @param minSize The minimum allowed size. - * @returns The set of rectangles that have been added previously using {@link #addSameHeightEntry}. - */ - findSameHeightEntries(size:number,maxSize:number,minSize:number):yfiles.collections.IListEnumerable; - /** - * Finds the entries ({@link yfiles.geometry.Rect}s) that have been registered using the {@link yfiles.input.GraphSnapContext#addSameWidthEntry} - * previously that best match the given constraints. - * @param size The size to find the closest set of identical sizes. - * @param maxSize The maximum allowed size. - * @param minSize The minimum allowed size. - * @returns The set of rectangles that have been added previously using {@link #addSameWidthEntry}. - */ - findSameWidthEntries(size:number,maxSize:number,minSize:number):yfiles.collections.IListEnumerable; - /** - * Gets a subset of {@link yfiles.input.GraphSnapContext#additionalSnapLines} that matches the given orientation, snapType and intersects with the provided area. - * @param orientation The orientation of the lines to return. - * @param snapType The snap type to be included. - * @param area The area to test for intersection. - * @returns An enumerable of the snap lines that match the provided criteria. - */ - getAdditionalSnapLines(orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,area:yfiles.geometry.Rect):yfiles.collections.IEnumerable; - /** - * Gets a subset of {@link yfiles.input.GraphSnapContext#fixedNodeSnapLines} that matches the given orientation, snapType and intersects with the provided area. - * @param orientation The orientation of the lines to return. - * @param snapType The snap type to be included. - * @param area The area to test for intersection. - * @returns An enumerable of the snap lines that match the provided criteria. - */ - getFixedNodeSnapLines(orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,area:yfiles.geometry.Rect):yfiles.collections.IEnumerable; - /** - * Gets a subset of {@link yfiles.input.GraphSnapContext#fixedPortSnapLines} that matches the given orientation, snapType and intersects with the provided area. - * @param orientation The orientation of the lines to return. - * @param snapType The snap type to be included. - * @param area The area to test for intersection. - * @returns An enumerable of the snap lines that match the provided criteria. - */ - getFixedPortSnapLines(orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,area:yfiles.geometry.Rect):yfiles.collections.IEnumerable; - /** - * Gets a subset of {@link yfiles.input.GraphSnapContext#fixedSegmentSnapLines} that matches the given orientation, snapType and intersects with the provided area. - * @param orientation The orientation of the lines to return. - * @param snapType The snap type to be included. - * @param area The area to test for intersection. - * @returns An enumerable of the snap lines that match the provided criteria. - */ - getFixedSegmentSnapLines(orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,area:yfiles.geometry.Rect):yfiles.collections.IEnumerable; - /** - * Gets the movement info for the given port. - *

- * This is either the info passed to {@link yfiles.input.GraphSnapContext#addNodeToBeMoved} or another, dynamically created - * instance, if no specific one had been registered. - *

- * @param port The port to obtain the info for. - * @returns An instance of {@link } that describes the movement of the port. - */ - getMovementInfo(port:yfiles.graph.IPort):yfiles.input.MovementInfo; - /** - * Gets the movement info for the given node. - *

- * This is either the info passed to {@link yfiles.input.GraphSnapContext#addNodeToBeMoved} or another, dynamically created - * instance, if no specific one had been registered. - *

- * @param node The node to obtain the info for. - * @returns An instance of {@link } that describes the movement of the node. - */ - getMovementInfo(node:yfiles.graph.INode):yfiles.input.MovementInfo; - /** - * Gets the movement info for the given bend. - *

- * This is either the info passed to {@link yfiles.input.GraphSnapContext#addBendToBeMoved} or a dynamically created instance if no - * specific one had been registered. - *

- * @param bend The bend to obtain the info for. - * @returns An instance of {@link } that describes the movement of the bend. - */ - getMovementInfo(bend:yfiles.graph.IBend):yfiles.input.MovementInfo; - /** - * Gets the {@link yfiles.input.MovementInfo movement information} for the provided edge. - *

- * The result describes the shape of the edge and the reshaping behavior of the geometry. The first element in the - * enumerable is the source end of the edge, followed by bend like elements and the target side. Note that it cannot in - * general be assumed {@link yfiles.input.MovementInfo#movedItem} of the first and last element is either a {@link yfiles.graph.IPort} or {@link yfiles.graph.IEdge}, also items in - * between may not necessarily be bound to {@link yfiles.graph.IBend}s and therefore their {@link yfiles.input.MovementInfo#movedItem} can be of a different type than - * {@link yfiles.graph.IBend}. - *

- * @param edge The edge to obtain the movement information of. - * @returns An {@link } of {@link }s items that describe the geometry of the edge being modified. - */ - getMovementInfos(edge:yfiles.graph.IEdge):yfiles.collections.IListEnumerable; - /** - * Raises the {@link yfiles.input.GraphSnapContext#addCollectSnapLinesListener CollectSnapLines} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onCollectSnapLines(evt:yfiles.input.CollectGraphSnapLinesEventArgs):void; - /** - * Gets the nodes that stay fixed for the current edit. - * @protected - * @type {yfiles.collections.ICollection.} - */ - fixedNodes:yfiles.collections.ICollection; - /** - * Adds the given listener for the CollectSnapLines event that occurs every time this instance has been {@link yfiles.input.SnapContext#dragInitialized initialized} to - * collect {@link yfiles.input.OrthogonalSnapLine}s. - *

- * Event handlers should add snap lines to the caller using the methods provided by - * {@link yfiles.input.CollectGraphSnapLinesEventArgs}. - *

- * @param listener The listener to add. - * @see yfiles.input.GraphSnapContext#removeCollectSnapLinesListener - */ - addCollectSnapLinesListener(listener:(sender:any,evt:yfiles.input.CollectGraphSnapLinesEventArgs)=>void):void; - /** - * Removes the given listener for the CollectSnapLines event that occurs every time this instance has been {@link yfiles.input.SnapContext#dragInitialized initialized} to - * collect {@link yfiles.input.OrthogonalSnapLine}s. - *

- * Event handlers should add snap lines to the caller using the methods provided by - * {@link yfiles.input.CollectGraphSnapLinesEventArgs}. - *

- * @param listener The listener to remove. - * @see yfiles.input.GraphSnapContext#addCollectSnapLinesListener - */ - removeCollectSnapLinesListener(listener:(sender:any,evt:yfiles.input.CollectGraphSnapLinesEventArgs)=>void):void; - /** - * Gets or sets whether this instance should collect {@link yfiles.input.GraphSnapContext#fixedSegmentSnapLines fixed snap lines} for edge segments. - *

- * The default is true. - *

- * @see yfiles.input.ISnapLineProvider - * @see yfiles.input.GraphSnapContext#collectFixedSegmentSnapLines - * @default true - * @type {boolean} - */ - collectEdgeSnapLines:boolean; - /** - * Gets or sets whether this instance should collect the sizes of fixed nodes. - *

- * The default is true. - *

- * @see yfiles.input.GraphSnapContext#collectSameSizeEntries - * @default true - * @type {boolean} - */ - collectNodeSizes:boolean; - /** - * Gets or sets whether this instance should collect {@link yfiles.input.GraphSnapContext#fixedNodeSnapLines fixed snap lines} for nodes. - *

- * The default is true. - *

- * @see yfiles.input.ISnapLineProvider - * @see yfiles.input.GraphSnapContext#collectFixedNodeSnapLines - * @default true - * @type {boolean} - */ - collectNodeSnapLines:boolean; - /** - * Gets or sets whether this instance should collect {@link yfiles.input.GraphSnapContext#fixedPortSnapLines fixed snap lines} for ports. - *

- * The default is true. - *

- * @see yfiles.input.ISnapLineProvider - * @see yfiles.input.GraphSnapContext#collectFixedPortSnapLines - * @default true - * @type {boolean} - */ - collectPortSnapLines:boolean; - /** - * Gets or sets whether this context will automatically snap the movements of bends so that the two adjacent segments - * become horizontally or vertically oriented. - *

- * The default is true. - *

- * @default true - * @type {boolean} - */ - snapBendAdjacentSegments:boolean; - /** - * Gets or sets whether this context will automatically snap the movements of nodes so that the first and last segments of - * edges become orthogonal. - *

- * The default is true. - *

- * @default true - * @type {boolean} - */ - snapPortAdjacentSegments:boolean; - /** - * Gets or sets whether this context will automatically snap orthogonal edge segments to snap lines. - *

- * The default is true. - *

- * @default true - * @type {boolean} - */ - snapSegmentsToSnapLines:boolean; - /** - * Gets or sets whether this context will automatically snap the bends to snap lines. - *

- * The default is false. - *

- * @default false - * @type {boolean} - */ - snapBendsToSnapLines:boolean; - /** - * Gets or sets whether {@link yfiles.input.INodeSnapResultProvider} implementations should snap nodes to snap lines. - *

- * The default is true. - *

- * @default true - * @type {boolean} - */ - snapNodesToSnapLines:boolean; - /** - * Gets or sets the preferred distance between node borders. - *

- * This will influence the creation of the node snap lines. For each fixed node there will be snap lines on the borders of - * the node itself and around the node at the specified distance. - *

- *

- * The default is 0.0d which disables distant snap lines around the nodes. - *

- * @default 0.0 - * @type {number} - */ - nodeToNodeDistance:number; - /** - * Gets or sets the preferred distance between node borders and edge segments. - *

- * This will influence the creation of the node snap lines. For each fixed node there will be snap lines on the borders of - * the node itself and around the node at the specified distance to which orthogonal edge segments can snap. - *

- *

- * The default is -1.0d which disables distant snap lines around the nodes for edge segments. - *

- * @default -1.0 - * @type {number} - */ - nodeToEdgeDistance:number; - /** - * Gets or sets the preferred distance between edges. - *

- * This will influence the creation of the segment snap lines. For each orthogonally oriented fixed segment there will be - * snap lines on the segment itself and to both sides of the segment at the specified distance. - *

- *

- * The default is 0.0d which disables parallel snap lines. - *

- * @default 0.0 - * @type {number} - */ - edgeToEdgeDistance:number; - /** - * Gets or sets whether this context will automatically snap the movement in such a way that the overall move gesture is - * constrained to the horizontal or vertical axis. - *

- * The default is false. - *

- * @default false - * @type {boolean} - */ - snapOrthogonalMovement:boolean; - /** - * Gets or sets whether this instance will try to align the centers of adjacent nodes so that their centers are equally far - * away from each other. - *

- * Note that this will only make a difference for differently sized nodes. - *

- *

- * By default this feature is turned off, so that the instance will try to distribute nodes evenly, so that there is the - * same spacing between their borders, not between their centers. - *

- * @default false - * @type {boolean} - */ - collectNodePairCenterSnapLines:boolean; - /** - * Gets or sets a value indicating whether this instance will collect pairs of adjacent nodes and add snapping logic so - * that moved nodes will snap so that the distances to the adjacent nodes are equal. - * @default true - * @type {boolean} - */ - collectNodePairSnapLines:boolean; - /** - * Gets or sets a value indicating whether this instance will collect pairs of adjacent nodes and add snapping logic so - * that moved edge segments will snap so that the distances to the adjacent nodes are equal. - * @default true - * @type {boolean} - */ - collectNodePairSegmentSnapLines:boolean; - /** - * Gets or sets the type of the grid snapping that should be performed. - *

- * Determines which grid elements an object should snap to. - *

- * @see yfiles.input.GraphSnapContext#nodeGridConstraintProvider - * @see yfiles.input.GraphSnapContext#bendGridConstraintProvider - * @see yfiles.input.GraphSnapContext#portGridConstraintProvider - * @default yfiles.input.GridSnapTypes.NONE - * @type {yfiles.input.GridSnapTypes} - */ - gridSnapType:yfiles.input.GridSnapTypes; - /** - * Gets or sets the GridSnapDistance. - *

- * The maximum distance between the current mouse coordinates and the coordinates to which the mouse will snap. The - * distance is interpreted in view coordinates. - *

- * @default 10.0 - * @type {number} - */ - gridSnapDistance:number; - /** - * Gets or sets the grid constraint provider for the {@link yfiles.graph.INode}s. - * @type {yfiles.input.IGridConstraintProvider.} - */ - nodeGridConstraintProvider:yfiles.input.IGridConstraintProvider; - /** - * Gets or sets the grid constraint provider for the {@link yfiles.graph.IBend}s. - * @type {yfiles.input.IGridConstraintProvider.} - */ - bendGridConstraintProvider:yfiles.input.IGridConstraintProvider; - /** - * Gets or sets the grid constraint provider for the {@link yfiles.graph.IPort}s. - * @type {yfiles.input.IGridConstraintProvider.} - */ - portGridConstraintProvider:yfiles.input.IGridConstraintProvider; - /** - * Gets or sets the amount by which snap lines that are induced by existing edge segments and node borders are being - * extended. - *

- * The default is 40.0d, this value will be used to extend the ends of the snap lines. - *

- * @default 40.0 - * @type {number} - */ - snapLineExtension:number; - /** - * Gets or sets a value indicating whether to crop the snap lines at obstacles. - *

- * The default is true - *

- * @type {boolean} - */ - cropSnapLines:boolean; - /** - * Gets the collection of {@link yfiles.input.OrthogonalSnapLine}s for fixed nodes. - *

- * This collection is only available if {@link yfiles.input.SnapContext#isInitialized} is true. - *

- * @see yfiles.input.GraphSnapContext#getFixedNodeSnapLines - * @type {yfiles.collections.IEnumerable.} - */ - fixedNodeSnapLines:yfiles.collections.IEnumerable; - /** - * Gets the collection of {@link yfiles.input.OrthogonalSnapLine}s for fixed segments. - *

- * This collection is only available if {@link yfiles.input.SnapContext#isInitialized} is true. - *

- * @see yfiles.input.GraphSnapContext#getFixedSegmentSnapLines - * @type {yfiles.collections.IEnumerable.} - */ - fixedSegmentSnapLines:yfiles.collections.IEnumerable; - /** - * Gets the collection of {@link yfiles.input.OrthogonalSnapLine}s to which ports should be snapping. - *

- * This collection is only available if {@link yfiles.input.SnapContext#isInitialized} is true. - *

- * @see yfiles.input.GraphSnapContext#getFixedPortSnapLines - * @type {yfiles.collections.IEnumerable.} - */ - fixedPortSnapLines:yfiles.collections.IEnumerable; - /** - * Gets the collection of additional {@link yfiles.input.OrthogonalSnapLine}s. - *

- * This collection is only available if {@link yfiles.input.SnapContext#isInitialized} is true. - *

- * @see yfiles.input.GraphSnapContext#getAdditionalSnapLines - * @type {yfiles.collections.IEnumerable.} - */ - additionalSnapLines:yfiles.collections.IEnumerable; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.GraphSnapContext; - } - export enum MoveTypes{ - /** - * The element does not move at all during the edit. - */ - FIXED, - /** - * The element moves linearly with the mouse in horizontal direction. - */ - LINEAR_MOVE_X, - /** - * The element moves linearly with the mouse in vertical direction. - */ - LINEAR_MOVE_Y, - /** - * The element moves linearly with the mouse in both directions. - */ - LINEAR_MOVE, - /** - * The element moves in horizontal direction but not linearly/predictably with the mouse. - *

- * A typical example is a port whose position is adjusted during a resize of its owning node. - *

- *

- * Elements which do not move linearly with the mouse cannot snap to a defined position. - *

- */ - ARBITRARY_MOVE_X, - /** - * The element moves in vertical direction but not linearly/predictably with the mouse. - *

- * A typical example is a port whose position is adjusted during a resize of its owning node. - *

- *

- * Elements which do not move linearly with the mouse cannot snap to a defined position. - *

- */ - ARBITRARY_MOVE_Y, - /** - * The element moves in both directions but not linearly/predictably with the mouse. - *

- * A typical example is a port whose position is adjusted during a resize of its owning node. - *

- *

- * Elements which do not move linearly with the mouse cannot snap to a defined position. - *

- */ - ARBITRARY_MOVE, - /** - * The bitwise combination of {@link yfiles.input.MoveTypes#LINEAR_MOVE_X} and {@link yfiles.input.MoveTypes#ARBITRARY_MOVE_X} - */ - MOVEMENT_X, - /** - * The bitwise combination of {@link yfiles.input.MoveTypes#LINEAR_MOVE_Y} and {@link yfiles.input.MoveTypes#ARBITRARY_MOVE_Y} - */ - MOVEMENT_Y - } - /** - * A helper class that is used in the context of {@link yfiles.input.GraphSnapContext} to describe the movement of entities during - * the edit process. - * @class - */ - export interface MovementInfo extends yfiles.lang.Object{} - export class MovementInfo { - /** - * Initializes a new instance of the {@link yfiles.input.MovementInfo} class. - * @param originalLocation The original location. - * @param moveType The type of the move. - * @param movedItem The item that is being moved. - * @protected - */ - constructor(originalLocation:yfiles.geometry.Point,moveType:yfiles.input.MoveTypes,movedItem:yfiles.graph.IModelItem); - /** - * Gets the new x coordinate of the element if the mouse has been moved by dx during the gesture. - *

- * This takes the {@link yfiles.input.MovementInfo#moveType} and {@link yfiles.input.MovementInfo#originalLocation} into account. - *

- * @param dx The delta x coordinate. - * @returns The new x coordinate. - */ - getX(dx:number):number; - /** - * Gets the new y coordinate of the element if the mouse has been moved by dy during the gesture. - *

- * This takes the {@link yfiles.input.MovementInfo#moveType} and {@link yfiles.input.MovementInfo#originalLocation} into account. - *

- * @param dy The delta y coordinate. - * @returns The new y coordinate. - */ - getY(dy:number):number; - /** - * Determines whether this instances moves synchronized with the provided info. - * @param info The info to check. - * @returns Whether this info and the given info move horizontally synchronized. - * @see yfiles.input.MovementInfo#horizontalAnchor - */ - movesHorizontallySynchronizedWith(info:yfiles.input.MovementInfo):boolean; - /** - * Determines whether this instances moves synchronized with the provided info. - * @param info The info to check. - * @returns Whether this info and the given info move vertically synchronized. - * @see yfiles.input.MovementInfo#verticalAnchor - */ - movesVerticallySynchronizedWith(info:yfiles.input.MovementInfo):boolean; - /** - * Gets the item that is being moved. - * @type {yfiles.graph.IModelItem} - */ - movedItem:yfiles.graph.IModelItem; - /** - * Gets or sets the horizontal movement info to which this info is anchored horizontally. - *

- * This info can be declared to be implicitly anchored to another info. Method {@link yfiles.input.MovementInfo#movesHorizontallySynchronizedWith} - * will try to match against the anchors to determine if two infos are moving synchronized. - *

- * @type {yfiles.input.MovementInfo} - */ - horizontalAnchor:yfiles.input.MovementInfo; - /** - * Gets or sets the vertical movement info to which this info is anchored vertically. - *

- * This info can be declared to be implicitly anchored to another info. Method {@link yfiles.input.MovementInfo#movesVerticallySynchronizedWith} - * will try to match against the anchors to determine if two infos are moving synchronized. - *

- * @type {yfiles.input.MovementInfo} - */ - verticalAnchor:yfiles.input.MovementInfo; - /** - * Gets the original location of the element at the time the editing started. - * @type {yfiles.geometry.Point} - */ - originalLocation:yfiles.geometry.Point; - /** - * Gets the current location as a live point. - * @abstract - * @type {yfiles.geometry.IPoint} - */ - currentLocation:yfiles.geometry.IPoint; - /** - * Gets or sets the type of the movement for this instance. - * @type {yfiles.input.MoveTypes} - */ - moveType:yfiles.input.MoveTypes; - /** - * Gets a value indicating whether the y coordinate of the item is fixed during the move operation. - * @type {boolean} - */ - isVerticallyFixed:boolean; - /** - * Gets a value indicating whether the x coordinate of the item is fixed during the move operation. - * @type {boolean} - */ - isHorizontallyFixed:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.MovementInfo; - } - /** - * An {@link yfiles.input.IInputMode} implementation for use in a {@link yfiles.view.GraphComponent} to assign to the {@link yfiles.view.CanvasComponent#inputMode} property. - *

- * This mode can be used in a viewer-centric application where there is no need to modify the {@link yfiles.graph.IGraph} but - * browsing of the graph should be convenient. This mode allows for {@link yfiles.input.GraphInputMode#addItemClickedListener clicking on items using the mouse}, - * {@link yfiles.input.GraphInputMode#addQueryItemToolTipListener displaying tool tips for items}, {@link yfiles.input.GraphInputMode#addPopulateItemContextMenuListener showing a context menu}, {@link yfiles.input.NavigationInputMode allowing for easy navigation and traversal}, - * {@link yfiles.input.MoveViewportInputMode moving the view port}, and {@link yfiles.input.GraphInputMode#marqueeSelectableItems optionally doing marquee selection}. Also {@link yfiles.input.ItemHoverInputMode} can be used to get - * notified of the elements that the mouse is hovering over. - *

- *

- * Due to the viewer-centric nature of this input mode, collapsing and expanding groups is disabled per default. To enable - * this feature, set {@link yfiles.input.NavigationInputMode#allowCollapseGroup} and {@link yfiles.input.NavigationInputMode#allowExpandGroup} to true. - *

- *

- * This input mode manages a set of specialized input modes, each handling a specific part of the interaction with the - * graph. The following list details those along with their default - * {@link yfiles.input.IInputMode#priority priorities}. Lower priorities come earlier when handing events. - *

- *
    - *
  • {@link yfiles.input.WaitInputMode} (−1) – Disables this input mode when layouts or animations run.
  • - *
  • {@link yfiles.input.KeyboardInputMode} (0) – Handles commands and arbitrary keyboard shortcuts.
  • - *
  • {@link yfiles.input.ClickInputMode} (10) – Handles mouse clicks and double-clicks.
  • - *
  • {@link yfiles.input.TapInputMode} (20) – Handles taps and double-tap.
  • - *
  • {@link yfiles.input.MarqueeSelectionInputMode} (30) – Allows dragging a rectangle to select items within it.
  • - *
  • {@link yfiles.input.MoveViewportInputMode} (39) – Allows panning the viewport.
  • - *
  • {@link yfiles.input.ItemHoverInputMode} (55) – Provides events to indicate that the mouse pointer hovers over an item.
  • - *
  • {@link yfiles.input.NavigationInputMode} (55) – Provides general navigation facilities, such as navigating from one item to another with the arrow keys.
  • - *
  • {@link yfiles.input.ContextMenuInputMode} (60) – Handles querying the context menu contents based on a location as well as preparing the menu for display.
  • - *
  • {@link yfiles.input.MouseHoverInputMode} (100) – Handles tool tips.
  • - *
- * @class - * @extends {yfiles.input.GraphInputMode} - */ - export interface GraphViewerInputMode extends yfiles.input.GraphInputMode{} - export class GraphViewerInputMode { - /** - * Initializes a new instance of the {@link yfiles.input.GraphViewerInputMode} class. - */ - constructor(); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.GraphViewerInputMode; - } - /** - * A simple interface that can be used to react to clicks on regions of {@link yfiles.styles.INodeStyle}s etc. - *

- * {@link yfiles.input.GraphEditorInputMode} will query the {@link yfiles.graph.IModelItem}'s Lookup method for this interface if it has - * detected {@link yfiles.input.GraphInputMode#click}s. If the item yields an instance of this interface and the click was inside - * the {@link yfiles.input.IClickListener#getHitTestable}, then {@link yfiles.input.IClickListener#onClicked} is invoked. - *

- * @see yfiles.input.GraphEditorInputMode - * @see yfiles.styles.CollapsibleNodeStyleDecorator - * @interface - */ - export interface IClickListener extends yfiles.lang.Object{ - /** - * Gets an {@link yfiles.input.IHitTestable} that can be used to check if {@link yfiles.input.IClickListener#onClicked} should be invoked. - * @returns A hit testable that can determine whether {@link #onClicked} should be invoked by a given click. - * @abstract - */ - getHitTestable():yfiles.input.IHitTestable; - /** - * Called by the framework to indicate that the {@link yfiles.graph.IModelItem} has been clicked by the user at the specified - * location. - *

- * This method is called by {@link yfiles.input.GraphInputMode#click} for the - * {@link yfiles.graph.IModelItem}s that yielded an instance of this interface. - *

- * @param context The context to use for the click operation. - * @param location The location of the click - * @abstract - */ - onClicked(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):void; - } - var IClickListener:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IClickListener; - }; - /** - * An interface for classes that can yield {@link yfiles.input.IHandle} implementations for the {@link yfiles.graph.IEdge#sourcePort source} and {@link yfiles.graph.IEdge#targetPort target} ends of an - * {@link yfiles.graph.IEdge}. - *

- * This interface will be queried by the default implementation of the {@link yfiles.input.IHandleProvider} that is in the lookup - * of an {@link yfiles.graph.IEdge}. It is recommended to use this interface instead of the more generic {@link yfiles.input.IHandleProvider} - * interface, because other generic code can then use this interface to gain access to a specific {@link yfiles.input.IHandle} more - * easily. - *

- * @interface - */ - export interface IEdgePortHandleProvider extends yfiles.lang.Object{ - /** - * Gets an {@link yfiles.input.IHandle} implementation for one end of the provided edge. - * @param context The context in which the handle will be used. - * @param edge The edge for which an handle is needed. - * @param sourceHandle if set to true the handle for the source side/port should be returned. - * @returns The handle to use for the provided side or null. - * @abstract - */ - getHandle(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,sourceHandle:boolean):yfiles.input.IHandle; - } - var IEdgePortHandleProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IEdgePortHandleProvider; - }; - /** - * Helper interface to customize interactive label editing. - *

- * Implementations of this interface can be put into the {@link yfiles.graph.ILookup} of {@link yfiles.graph.ILabelOwner}s and - * {@link yfiles.graph.ILabel}s so that it is possible to tweak the behavior on a case by case basis. - *

- *

- * Conceptually, in most cases, implementations of this interface behaves like an additional event handler for {@link yfiles.input.GraphEditorInputMode#addLabelAddingListener LabelAdding} - * and {@link yfiles.input.GraphEditorInputMode#addLabelEditingListener LabelEditing}. If no event handler - * handled those events, an {@link yfiles.input.IEditLabelHelper} will be queried from the {@link yfiles.graph.ILookup} and the unhandled - * event arguments passed to the respective methods. - *

- * @see yfiles.input.EditLabelHelper - * @see yfiles.input.GraphEditorInputMode#createLabel - * @see yfiles.input.GraphEditorInputMode#editLabel - * @see yfiles.input.GraphEditorInputMode#addLabel - * @see yfiles.input.GraphEditorInputMode#addLabelAddingListener - * @see yfiles.input.GraphEditorInputMode#addLabelEditingListener - * @interface - */ - export interface IEditLabelHelper extends yfiles.lang.Object{ - /** - * Helper method that will be called when trying to add a label to an {@link yfiles.graph.ILabelOwner}. - *

- * Implementations of this method can set the {@link yfiles.graph.ILabel#style}, {@link yfiles.graph.ILabel#layoutParameter}, {@link yfiles.graph.ILabel#preferredSize}, and {@link yfiles.graph.ITagOwner#tag} for newly-added labels by setting the appropriate properties on - * evt. - *

- *

- * Setting the {@link yfiles.input.LabelEditingEventArgs#cancel} property on evt to true will disallow label creation. - *

- * @param evt The original event arguments. - * @see yfiles.input.IEditLabelHelper#onLabelEditing - * @abstract - */ - onLabelAdding(evt:yfiles.input.LabelEditingEventArgs):void; - /** - * Helper method that will be called when trying to edit a label. - *

- * This method can be called for editing labels for an {@link yfiles.graph.ILabelOwner}, in which case the {@link yfiles.input.LabelEditingEventArgs#label} property on evt will be - * null, but the {@link yfiles.input.LabelEditingEventArgs#owner} property will be non-null. It can also be called for editing a specific label, in which case the {@link yfiles.input.LabelEditingEventArgs#label} - * property on evt will be non-null, and the {@link yfiles.input.LabelEditingEventArgs#owner} property will be set to the label's owner. - *

- *

- * Implementations of this method can set a specific label to be edited, by setting the {@link yfiles.input.LabelEditingEventArgs#label} property of the evt to an existing - * label instance. This label does not need to belong to the same owner that is queried for. Setting the {@link yfiles.input.LabelEditingEventArgs#label} property to null - * will not edit an existing label, but instead add a new one on the {@link yfiles.graph.ILabelOwner} set in the {@link yfiles.input.LabelEditingEventArgs#owner} property. - *

- *

- * When a new label is added, the properties {@link yfiles.input.LabelEditingEventArgs#style}, {@link yfiles.input.LabelEditingEventArgs#layoutParameter}, {@link yfiles.input.LabelEditingEventArgs#preferredSize}, and {@link yfiles.input.LabelEditingEventArgs#tag} are used for the newly-created label, just as in - * {@link yfiles.input.IEditLabelHelper#onLabelAdding}. - *

- *

- * Setting the {@link yfiles.input.LabelEditingEventArgs#cancel} property on evt to true will disallow label editing and creation. - *

- * @param evt The original event arguments. - * @see yfiles.input.IEditLabelHelper#onLabelAdding - * @abstract - */ - onLabelEditing(evt:yfiles.input.LabelEditingEventArgs):void; - } - var IEditLabelHelper:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IEditLabelHelper; - }; - /** - * Provides the snap lines and the snap results to the {@link yfiles.input.LabelSnapContext} during dragging of labels. - * @see yfiles.input.LabelSnapContext - * @see yfiles.graph.LabelDecorator#labelSnapContextHelperDecorator - * @interface - */ - export interface ILabelSnapContextHelper extends yfiles.lang.Object{ - /** - * Called during {@link yfiles.input.IDragHandler#initializeDrag initialization} of a label dragging to add {@link yfiles.input.SnapLine snap lines} to which the label can potentially snap to the - * snapContext. - * @param snapContext The snap context which manages the snap lines and the settings. Note that implementations should not change the state of - * the context explicitly. - * @param inputModeContext The context of the input mode that handles the dragging. - * @param label The label that is dragged. - * @abstract - */ - addSnapLines(snapContext:yfiles.input.LabelSnapContext,inputModeContext:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel):void; - /** - * Called while the given label is {@link yfiles.input.IDragHandler#handleMove dragged} to add {@link yfiles.input.SnapResult snap results} for the {@link yfiles.input.SnapLine snap lines} provided by the context. - * @param context The snap context which manages the snap lines and the settings. - * @param evt The event argument to obtain the necessary information from and {@link #addSnapResult add results to}. - * @param suggestedLayout The {@link #layout layout} of the label that would be used without snapping. - * @param label The label that is dragged. - * @abstract - */ - collectSnapResults(context:yfiles.input.LabelSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,suggestedLayout:yfiles.geometry.IOrientedRectangle,label:yfiles.graph.ILabel):void; - } - var ILabelSnapContextHelper:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.ILabelSnapContextHelper; - }; - /** - * An interface used by implementations that provide various size constraints for {@link yfiles.graph.INode}s. - *

Related demos:

- *
    - *
  • Demo: SizeConstraintProvider, demo.yfiles.input.sizeconstraintprovider
  • - *
- * @see yfiles.input.NodeSizeConstraintProvider - * @interface - */ - export interface INodeSizeConstraintProvider extends yfiles.lang.Object{ - /** - * Returns the maximum size allowed for the given node. - * @param node The node to return the maximum size for. - * @returns The maximum size or {@link #INFINITE} if there is no constraint on the size. - * @abstract - */ - getMaximumSize(node:yfiles.graph.INode):yfiles.geometry.Size; - /** - * Returns the minimum area that needs to be enclosed by the given node. - * @param node The node to return the area for. - * @returns The area to enclose or {@link #EMPTY} if there is no constraint on the size due to an enclosed area. - * @abstract - */ - getMinimumEnclosedArea(node:yfiles.graph.INode):yfiles.geometry.Rect; - /** - * Returns the minimum size allowed for the given node. - * @param node The node to return the minimum size for. - * @returns The minimum size or {@link #EMPTY} if there is no constraint on the size. - * @abstract - */ - getMinimumSize(node:yfiles.graph.INode):yfiles.geometry.Size; - } - var INodeSizeConstraintProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.INodeSizeConstraintProvider; - }; - /** - * A simple default implementation of {@link yfiles.input.INodeSizeConstraintProvider} - * @class - * @implements {yfiles.input.INodeSizeConstraintProvider} - */ - export interface NodeSizeConstraintProvider extends yfiles.lang.Object,yfiles.input.INodeSizeConstraintProvider{} - export class NodeSizeConstraintProvider { - /** - * Creates a new instance using the provided size instances as the initial values. - *

- * Not specifing the minimumEnclosedArea will set it to {@link yfiles.geometry.Rect#EMPTY}. - *

- * @param minimumSize The {@link #minimumSize}. - * @param maximumSize The {@link #maximumSize}. - * @param [minimumEnclosedArea=null] The {@link #minimumEnclosedArea}. - */ - constructor(minimumSize:yfiles.geometry.ISize,maximumSize:yfiles.geometry.ISize,minimumEnclosedArea?:yfiles.geometry.IRectangle); - /** - * - * @param node - * @returns - */ - getMaximumSize(node:yfiles.graph.INode):yfiles.geometry.Size; - /** - * - * @param node - * @returns - */ - getMinimumEnclosedArea(node:yfiles.graph.INode):yfiles.geometry.Rect; - /** - * - * @param node - * @returns - */ - getMinimumSize(node:yfiles.graph.INode):yfiles.geometry.Size; - /** - * Gets or sets the instance to return by {@link yfiles.input.NodeSizeConstraintProvider#getMaximumSize}. - * @type {yfiles.geometry.ISize} - */ - maximumSize:yfiles.geometry.ISize; - /** - * Gets or sets the instance to return by {@link yfiles.input.NodeSizeConstraintProvider#getMinimumEnclosedArea}. - * @type {yfiles.geometry.IRectangle} - */ - minimumEnclosedArea:yfiles.geometry.IRectangle; - /** - * Gets or sets the instance to return by {@link yfiles.input.NodeSizeConstraintProvider#getMinimumSize}. - * @type {yfiles.geometry.ISize} - */ - minimumSize:yfiles.geometry.ISize; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.NodeSizeConstraintProvider; - } - /** - * Interface used by {@link yfiles.input.OrthogonalEdgeEditingContext} and the like that can be decorated to the {@link yfiles.graph.ILookup} - * of {@link yfiles.graph.IEdge}s. - *

- * This interface is for editing edges in such a way that their path stays orthogonal, i.e. all of the segments are - * oriented either horizontally or vertically. - *

- * @see yfiles.input.OrthogonalEdgeEditingContext#getOrthogonalEdgeHelper - * @interface - */ - export interface IOrthogonalEdgeHelper extends yfiles.lang.Object{ - /** - * Callback method that is invoked after the provided edge has been edited orthogonally. - *

- * This callback can be used to remove unused bends and finalize the orthogonal edge editing gesture. - *

- * @param context The input mode context which edited the edge. - * @param graph The graph to use for modifying the edge instance. - * @param edge The edge to clean up the path. - * @abstract - */ - cleanUpEdge(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge):void; - /** - * Gets the declared orientation of the given segment at the provided edge. - *

- * The orientation cannot always be inferred from the current geometry: If a segment has a zero length it is unclear what - * orientation it should have, also a segment could be accidentally orthogonally oriented, while in fact it is considered - * {@link yfiles.input.SegmentOrientation#NON_ORTHOGONAL}. - *

- * @param context The input mode context in which the orientation is needed. - * @param edge The edge to inspect. - * @param segmentIndex The index of the segment. - * @returns The declared orientation of the segment. - * @abstract - */ - getSegmentOrientation(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,segmentIndex:number):yfiles.input.SegmentOrientation; - /** - * Determines whether the provided edge should be edited orthogonally in the specified input mode context. - *

- * If this method returns false, the other methods will not be queried at all. - *

- * @param context The input mode context in which the edge is about to be edited. - * @param edge The edge to inspect. - * @returns true if the edge should be orthogonally edited in the specified input mode context; false otherwise. - * @abstract - */ - shouldEditOrthogonally(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):boolean; - /** - * Determines whether this end of the provided edge can be moved in the input mode context. - *

- * This information is required to determine whether an edge's first or last segment needs to be split or the adjacent edge - * end can be moved along with the other end of the segment. - *

- * @param context The input mode context in which the segment is edited. - * @param edge The edge to inspect. - * @param sourceEnd if set to true the source end of the edge is queried, otherwise the target end. - * @returns true if the end of the edge can be moved for the specified input mode context; false otherwise, in which case the - * corresponding segment needs to be split to keep the segment orientation orthogonal. - * @abstract - */ - shouldMoveEndImplicitly(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,sourceEnd:boolean):boolean; - } - var IOrthogonalEdgeHelper:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IOrthogonalEdgeHelper; - }; - /** - * Interface used for implementations that recognize, approve and disapprove node reparenting gestures, as well as actually - * performs the reparenting. - *

- * Implementations of this interface are queried from the {@link yfiles.input.IInputModeContext} by code that wants to reparent a - * node. Specifically this is used by default to reparent nodes during the {@link yfiles.input.MoveInputMode dragging of nodes}. - *

- *

Related demos:

- *
    - *
  • Demo: ReparentHandler, demo.yfiles.input.reparenthandler
  • - *
- * @interface - */ - export interface IReparentNodeHandler extends yfiles.lang.Object{ - /** - * Determines whether the current gesture that can be determined through the context is a reparent gesture. - * @param context The context that provides information about the user input. - * @param node The node that will possibly be reparented. - * @returns Whether this is a reparenting gesture. - * @abstract - */ - isReparentGesture(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode):boolean; - /** - * Determines whether the provided node may be reparented to a newParent. - * @param context The context that provides information about the user input. - * @param node The node that will be reparented. - * @param newParent The potential new parent or null. Can be a group or a non-group node. - * @returns Whether newParent is a valid new parent for node. - * @abstract - */ - isValidParent(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode,newParent:yfiles.graph.INode):boolean; - /** - * Performs the actual reparenting after the reparent gesture has been finalized. - *

- * Implementations should {@link yfiles.graph.IGraph#setParent set the parent} of node to newParent. - *

- * @param context The context that provides information about the user input. - * @param node The node that will be reparented. - * @param newParent The potential new parent or null. Can be a group or a non-group node. - * @abstract - */ - reparent(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode,newParent:yfiles.graph.INode):void; - /** - * Determines whether the user may detach the given node from its current parent in order to reparent it. - * @param context The context that provides information about the user input. - * @param node The node that is about to be detached from its current parent. - * @returns Whether the node may be detached and reparented. - * @abstract - */ - shouldReparent(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode):boolean; - } - var IReparentNodeHandler:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IReparentNodeHandler; - }; - /** - * Queried by the {@link yfiles.input.GraphSnapContext} to add {@link yfiles.input.OrthogonalSnapLine}s to its collections during the - * {@link yfiles.input.SnapContext#isInitializing initialization phase}. - *

- * Implementations of this interface are queried by {@link yfiles.input.GraphSnapContext} for each item that is not modified during - * the edit using the {@link yfiles.graph.ILookup#lookup} of the respective item. - *

- * @see yfiles.graph.NodeDecorator#snapLineProviderDecorator - * @interface - */ - export interface ISnapLineProvider extends yfiles.lang.Object{ - /** - * Called by the {@link yfiles.input.GraphSnapContext} when a {@link yfiles.input.GraphSnapContext#initializeDrag drag} is about to start. - * @param context The context which holds the settings for the snap lines. Note that implementations should not change the state of the - * context explicitly. - * @param evt The argument to use for adding snap lines. - * @param item The item to add snap lines for. - * @abstract - */ - addSnapLines(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectGraphSnapLinesEventArgs,item:yfiles.graph.IModelItem):void; - } - var ISnapLineProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.ISnapLineProvider; - }; - /** - * Provides data for the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked}, - * {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked}, - * {@link yfiles.input.GraphInputMode#addItemLeftClickedListener ItemLeftClicked}, - * {@link yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked}, {@link yfiles.input.GraphInputMode#addItemRightClickedListener ItemRightClicked} - * and {@link yfiles.input.GraphInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked} events. - * Type parameter T: The type of the item this event carries. - * @class - * @extends {yfiles.collections.ItemEventArgs.} - * @template T - */ - export interface ItemClickedEventArgs extends yfiles.collections.ItemEventArgs{} - export class ItemClickedEventArgs { - /** - * Initializes a new instance of the {@link yfiles.input.ItemClickedEventArgs.} class. - * @param item The item which is the subject of the event. - * @param location The location of the click. - */ - constructor(item:T,location:yfiles.geometry.Point); - /** - * Gets or sets a value indicating whether this {@link yfiles.input.ItemClickedEventArgs.} is handled. - *

- * Setting the event to handled indicates whether the event should be further propagated or whether there has not been any - * code that actively handled the event to the event source. How this flag is actually being treated depends on the source - * of the event. - *

- * @type {boolean} - */ - handled:boolean; - /** - * Gets the location of the click. - * @type {yfiles.geometry.Point} - */ - location:yfiles.geometry.Point; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.ItemClickedEventArgs; - } - /** - * An input mode for use in a {@link yfiles.view.GraphComponent} that fires events when the mouse enters or leaves the - * visualization of a {@link yfiles.graph.IModelItem graph item}. - *

- * This mode can be used to determine when the mouse is being moved from one item to the next. - *

- *

- * This mode is {@link yfiles.input.ItemHoverInputMode#exclusive} by default. - *

- * @class - * @implements {yfiles.input.IInputMode} - */ - export interface ItemHoverInputMode extends yfiles.lang.Object,yfiles.input.IInputMode{} - export class ItemHoverInputMode { - /** - * Initializes a new instance of the {@link yfiles.input.ItemHoverInputMode} class. - */ - constructor(); - /** - * - */ - cancel():void; - /** - * Gets the items that have been hit at the given location. - * @param location The location in world coordinates to query. - * @returns An enumerable over all items that have been hit at the given location. - * @protected - */ - getHitItemsAt(location:yfiles.geometry.Point):yfiles.collections.IEnumerable; - /** - * Installs this mode into the given context that is provided by the canvas. - *

- * In general a mode can only be installed into a single canvas at all times. - *

- *

- * This method is called to initialize this instance. Subclasses should override this method to register the corresponding - * event handler delegates for the various input events they need to register with. - *

- *

- * Overriding implementations should call the base implementation, first. - *

- * @param context The context that this instance shall be installed into. The same instance will be passed to this instance during - * {@link #uninstall}. A reference to the context may be kept and queried during the time the mode is - * installed. - * @param controller The {@link #controller} for this mode. - * @see yfiles.input.IInputMode#uninstall - */ - install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; - /** - * Determines whether the given item is a valid item to be considered for hovering. - *

- * This implementation checks whether the item is covered by the {@link yfiles.input.ItemHoverInputMode#hoverItems} set, only. - *

- * @param item The item to check. - * @returns true if it is valid to report a hover over the specified item; false otherwise. - * @see yfiles.input.ItemHoverInputMode#discardInvalidItems - * @protected - */ - isValidHoverItem(item:yfiles.graph.IModelItem):boolean; - /** - * Called after {@link yfiles.input.ItemHoverInputMode#cancel} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been canceled. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onCanceled():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been activated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerActivated():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerDeactivated():void; - /** - * Raises the {@link yfiles.input.ItemHoverInputMode#addHoveredItemChangedListener HoveredItemChanged} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onHoveredItemChanged(evt:yfiles.input.HoveredItemChangedEventArgs):void; - /** - * Called after {@link yfiles.input.ItemHoverInputMode#tryStop} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been stopped. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onStopped():void; - /** - * Overridden to only return true if this instance does not currently {@link yfiles.input.ConcurrencyController#hasMutex have the input mutex}. - * @returns true iff this instance does not {@link #hasMutex own the mutex}. - */ - tryStop():boolean; - /** - * Uninstalls this mode from the given context. - *

- * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} method. After a mode has - * been uninstalled it can be installed again into the same or another canvas. - *

- *

- * Overriding implementations should call the base implementation after their own code. - *

- * @param context The context to deregister from. This is the same instance that had been passed to {@link #install} during - * installation. - */ - uninstall(context:yfiles.input.IInputModeContext):void; - /** - * Forces a reevaluation of the item that the mouse is currently hovering over or at a specific location. - *

- * This method may be called by code that is aware of the fact that the visualization has changed, but the mouse may not - * have been moved. By default this implementation will only re-query the items at the mouse location when the mouse has - * moved. This method can be called to force a reevaluation in other cases. - *

- * @param [location=null] The query location. - */ - updateHover(location?:yfiles.geometry.Point):void; - /** - * - * @type {number} - */ - priority:number; - /** - * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. - *

- * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.ItemHoverInputMode#controller}. - *

- *

- * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} - * will be deactivated. Otherwise it will always run concurrently with all other modes. - *

- * @type {boolean} - */ - exclusive:boolean; - /** - * Gets or sets the enabled state of this input mode. - *

- * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed - * {@link yfiles.input.ItemHoverInputMode#controller} so a disabled instance should never try to acquire the input mutex. - *

- * @type {boolean} - */ - enabled:boolean; - /** - * - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Gets the installed {@link yfiles.input.ItemHoverInputMode#controller}. - * @protected - * @type {yfiles.input.ConcurrencyController} - */ - controller:yfiles.input.ConcurrencyController; - /** - * Adds the given listener for the HoveredItemChanged event that occurs when the item that is being hovered over with the - * mouse changes. - *

- * This event is also fired when the mouse pointer leaves an item. - *

- * @param listener The listener to add. - * @see yfiles.input.ItemHoverInputMode#removeHoveredItemChangedListener - */ - addHoveredItemChangedListener(listener:(sender:any,evt:yfiles.input.HoveredItemChangedEventArgs)=>void):void; - /** - * Removes the given listener for the HoveredItemChanged event that occurs when the item that is being hovered over with - * the mouse changes. - *

- * This event is also fired when the mouse pointer leaves an item. - *

- * @param listener The listener to remove. - * @see yfiles.input.ItemHoverInputMode#addHoveredItemChangedListener - */ - removeHoveredItemChangedListener(listener:(sender:any,evt:yfiles.input.HoveredItemChangedEventArgs)=>void):void; - /** - * Gets the current item the mouse is hovering over. - * @type {yfiles.graph.IModelItem} - */ - currentHoverItem:yfiles.graph.IModelItem; - /** - * Gets or sets which graph items are considered by this input mode. - *

- * The default is {@link yfiles.graph.GraphItemTypes#ALL}. - *

- * @type {yfiles.graph.GraphItemTypes} - */ - hoverItems:yfiles.graph.GraphItemTypes; - /** - * Gets or sets the cursor to use when the mouse is hovering over a {@link yfiles.input.ItemHoverInputMode#isValidHoverItem} valid - * hover item. - * @type {yfiles.view.Cursor} - */ - hoverCursor:yfiles.view.Cursor; - /** - * Gets or sets whether items that have been hit at the current location that are not {@link yfiles.input.ItemHoverInputMode#isValidHoverItem valid items} should be ignored or - * reported as null. - * @see yfiles.input.ItemHoverInputMode#isValidHoverItem - * @type {boolean} - */ - discardInvalidItems:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.ItemHoverInputMode; - } - /** - * Event argument class containing information about which {@link yfiles.graph.IModelItem} the mouse is currently hovering over. - *

- * This event is used by the {@link yfiles.input.ItemHoverInputMode#addHoveredItemChangedListener HoveredItemChanged} - * event. The {@link yfiles.collections.ItemEventArgs.#item} property yields the item that is currently being hovered over or null if the mouse just left an item without - * hovering over an other one. The {@link yfiles.input.HoveredItemChangedEventArgs#oldItem} property provides the previously hovered item. - *

- * @class - * @extends {yfiles.collections.ItemEventArgs.} - */ - export interface HoveredItemChangedEventArgs extends yfiles.collections.ItemEventArgs{} - export class HoveredItemChangedEventArgs { - /** - * Initializes a new instance of the {@link yfiles.input.HoveredItemChangedEventArgs} class. - * @param item The model item, possibly null. - * @param oldItem The old item, possibly null. - */ - constructor(item:yfiles.graph.IModelItem,oldItem:yfiles.graph.IModelItem); - /** - * Gets or sets the item that was previously hovered, possibly null. - * @see yfiles.collections.ItemEventArgs.#item - * @type {yfiles.graph.IModelItem} - */ - oldItem:yfiles.graph.IModelItem; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.HoveredItemChangedEventArgs; - } - /** - * Event arguments for the {@link yfiles.input.GraphEditorInputMode#addLabelAddingListener LabelAdding} and {@link yfiles.input.GraphEditorInputMode#addLabelEditingListener LabelEditing} - * events, as well as the {@link yfiles.input.IEditLabelHelper} interface. - * @class - * @extends {yfiles.input.InputModeEventArgs} - * @final - */ - export interface LabelEditingEventArgs extends yfiles.input.InputModeEventArgs{} - export class LabelEditingEventArgs { - /** - * Initializes a new instance of the {@link yfiles.input.LabelEditingEventArgs} class with the given context, owner, and label. - * @param context The input mode context to use. - * @param owner The {@link } whose label should be edited. - * @param label The {@link } that should be edited. - */ - constructor(context:yfiles.input.IInputModeContext,owner:yfiles.graph.ILabelOwner,label:yfiles.graph.ILabel); - /** - * Gets or sets the label to edit. - *

- * This can be set to an exiting label to edit a specific one, or set to null to add a new label instead (e.g. for - * {@link yfiles.graph.ILabelOwner}s that have no label yet). - *

- *

- * If this property is set to null, the properties {@link yfiles.input.LabelEditingEventArgs#style}, {@link yfiles.input.LabelEditingEventArgs#preferredSize}, {@link yfiles.input.LabelEditingEventArgs#layoutParameter}, and {@link yfiles.input.LabelEditingEventArgs#tag} are used for the newly-added label, just like with - * {@link yfiles.input.LabelEditingEventArgs}. - *

- *

- * Setting this property implicitly also sets {@link yfiles.input.LabelEditingEventArgs#handled} to true. - *

- * @type {yfiles.graph.ILabel} - */ - label:yfiles.graph.ILabel; - /** - * Gets or sets a value indicating whether the action (adding or editing a label) should be canceled. - *

- * Setting this property implicitly also sets {@link yfiles.input.LabelEditingEventArgs#handled} to true. - *

- * @type {boolean} - */ - cancel:boolean; - /** - * Gets or sets a value indicating whether this event has been handled. - *

- * A handled instance of {@link yfiles.input.LabelEditingEventArgs} will not be passed to further event handlers or an {@link yfiles.input.IEditLabelHelper} - * instance. - *

- *

- * Setting any of the other properties implicitly also sets this to true. - *

- * @type {boolean} - */ - handled:boolean; - /** - * Gets or sets the owner of the label. - *

- * This property can be null if there is no owner known, e.g. if the event is raised for - * non-{@link yfiles.graph.ILabelOwner}s. Otherwise it is initially set to the item for which the event is raised. - *

- *

- * Setting this property implicitly also sets {@link yfiles.input.LabelEditingEventArgs#handled} to true. - *

- * @type {yfiles.graph.ILabelOwner} - */ - owner:yfiles.graph.ILabelOwner; - /** - * Gets or sets the {@link yfiles.graph.ILabel#style} of the label to add. - *

- * Setting this property implicitly also sets {@link yfiles.input.LabelEditingEventArgs#handled} to true. - *

- * @type {yfiles.styles.ILabelStyle} - */ - style:yfiles.styles.ILabelStyle; - /** - * Gets or sets the {@link yfiles.graph.ILabel#preferredSize} of the label to add. - *

- * Setting this property implicitly also sets {@link yfiles.input.LabelEditingEventArgs#handled} to true. - *

- * @type {yfiles.geometry.Size} - */ - preferredSize:yfiles.geometry.Size; - /** - * Gets or sets the {@link yfiles.graph.ILabel#layoutParameter} of the label to add. - *

- * Setting this property implicitly also sets {@link yfiles.input.LabelEditingEventArgs#handled} to true. - *

- * @type {yfiles.graph.ILabelModelParameter} - */ - layoutParameter:yfiles.graph.ILabelModelParameter; - /** - * Gets or sets the {@link yfiles.graph.ITagOwner#tag} of the label to add. - *

- * Setting this property implicitly also sets {@link yfiles.input.LabelEditingEventArgs#handled} to true. - *

- * @type {any} - */ - tag:any; - /** - * Gets or sets the configurator for the {@link yfiles.input.TextEditorInputMode} for editing the provided label instance. - *

- * Setting this property implicitly also sets {@link yfiles.input.LabelEditingEventArgs#handled} to true. - *

- * @type {function(yfiles.input.IInputModeContext, yfiles.input.TextEditorInputMode, yfiles.graph.ILabel): void} - */ - textEditorInputModeConfigurator:(context:yfiles.input.IInputModeContext,mode:yfiles.input.TextEditorInputMode,label:yfiles.graph.ILabel)=>void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.LabelEditingEventArgs; - } - /** - * Manages interactive snapping of {@link yfiles.graph.ILabel}s to their owner during drag operations like movements. - *

- * This class provides a set of properties to customize the snapping behavior. {@link yfiles.input.IPositionHandler} - * implementations and similar classes can use the following idiom to get an instance of this class: - *

- *

Related demos:

- *
    - *
  • Tutorial: 01 Getting Started, step 15 Snapping
  • - *
- * @see yfiles.input.MoveLabelInputMode - * @see yfiles.input.GraphEditorInputMode#snapContext - * @class - * @extends {yfiles.input.SnapContext} - */ - export interface LabelSnapContext extends yfiles.input.SnapContext{} - export class LabelSnapContext { - /** - * Initializes a new instance of the {@link yfiles.input.LabelSnapContext} class. - */ - constructor(); - /** - * Adds the given snapLine to the {@link yfiles.input.LabelSnapContext#snapLines snap line} collection of this context. - * @param snapLine The snap line to add. - * @see yfiles.input.GraphSnapContext#additionalSnapLines - */ - addSnapLine(snapLine:yfiles.input.SnapLine):void; - /** - * Raises the {@link yfiles.input.LabelSnapContext#addCollectSnapLinesListener CollectSnapLines} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onCollectSnapLines(evt:yfiles.input.CollectLabelSnapLineEventArgs):void; - /** - * Gets or sets whether this instance should collect snap lines for the initial position of a label. - *

- * The default is true. - *

- * @default true - * @type {boolean} - */ - collectInitialLocationSnapLines:boolean; - /** - * Gets or sets whether this instance should collect six snap lines, two through the center and four through the border - * sides of the label owner. - *

- * The default is true. - *

- * @default true - * @type {boolean} - */ - collectNodeShapeSnapLines:boolean; - /** - * Gets or sets whether this instance should collect four snap lines in parallel to the owner's borders at the initial - * label distance. - *

- * Note that the label snaps to these snap lines with the side that is closer to the node's border. That way, snapping to - * such a snap line preserves the perceived distance from the node border for both labels inside and outside the node - * bounds. - *

- *

- * The default is true. - *

- * @default true - * @type {boolean} - */ - collectOwnNodeDistanceSnapLines:boolean; - /** - * Gets or sets whether this instance should collect snap lines in parallel to the border of the label owner at the - * distance of other node labels of that owner. - *

- * Note that the label snaps to these snap lines with the side that is closer to the node's border. That way, snapping to - * such a snap line preserves the perceived distance from the node border for both labels inside and outside the node - * bounds. - *

- *

- * The default is true. - *

- * @default true - * @type {boolean} - */ - collectSameOwnerNodeDistanceSnapLines:boolean; - /** - * Gets or sets whether this instance should collect snap lines in parallel to the border of the label owner at the - * distance of other node labels in the graph. - *

- * Note that the label snaps to these snap lines with the side that is closer to the node's border. That way, snapping to - * such a snap line preserves the perceived distance from the node border for both labels inside and outside the node - * bounds. - *

- *

- * The default is false. - *

- * @default false - * @type {boolean} - */ - collectAllNodeDistanceSnapLines:boolean; - /** - * Gets or sets whether this instance should collect snap lines on the edge path. - *

- * The default is true. - *

- * @default true - * @type {boolean} - */ - collectEdgePathSnapLines:boolean; - /** - * Gets or sets whether this instance should collect two snap lines in parallel to the edge path of the label owner at the - * initial distance of the edge label. - *

- * The default is true. - *

- * @default true - * @type {boolean} - */ - collectOwnEdgeDistanceSnapLines:boolean; - /** - * Gets or sets whether this instance should collect snap lines in parallel to the edge path of the label owner at the - * distances of all edge labels of that owner. - *

- * The default is true. - *

- * @default true - * @type {boolean} - */ - collectSameOwnerEdgeDistanceSnapLines:boolean; - /** - * Gets or sets whether this instance should collect snap lines in parallel to the edge path of the label owner at the - * distance of other edge labels in the graph. - *

- * The default is false. - *

- * @default false - * @type {boolean} - */ - collectAllEdgeDistanceSnapLines:boolean; - /** - * Gets or sets whether this context will automatically snap the node labels to snap lines. - *

- * The default is true. - *

- * @default true - * @type {boolean} - */ - snapNodeLabels:boolean; - /** - * Gets or sets whether this context will automatically snap the edge labels to snap lines. - *

- * The default is true. - *

- * @default true - * @type {boolean} - */ - snapEdgeLabels:boolean; - /** - * Gets or sets the amount by which snap lines that are induced by existing edge segments are being extended. - *

- * The default is 40.0d, this value will be used to prolongate the ends of the snap lines. - *

- * @default 40.0 - * @type {number} - */ - snapLineExtension:number; - /** - * Gets the collection of the {@link yfiles.input.SnapLine snap lines} that have been {@link yfiles.input.LabelSnapContext#addSnapLine added} to this context. - *

- * This collection is only available if {@link yfiles.input.SnapContext#isInitialized} is true. - *

- * @see yfiles.input.LabelSnapContext#addSnapLine - * @type {yfiles.collections.IEnumerable.} - */ - snapLines:yfiles.collections.IEnumerable; - /** - * Adds the given listener for the CollectSnapLines event that occurs every time this instance has been {@link yfiles.input.SnapContext#dragInitialized initialized} to - * collect {@link yfiles.input.SnapLine}s. - *

- * Event handlers should add snap lines to the caller using the methods provided by - * {@link yfiles.input.CollectLabelSnapLineEventArgs}. - *

- * @param listener The listener to add. - * @see yfiles.input.LabelSnapContext#removeCollectSnapLinesListener - */ - addCollectSnapLinesListener(listener:(sender:any,evt:yfiles.input.CollectLabelSnapLineEventArgs)=>void):void; - /** - * Removes the given listener for the CollectSnapLines event that occurs every time this instance has been {@link yfiles.input.SnapContext#dragInitialized initialized} to - * collect {@link yfiles.input.SnapLine}s. - *

- * Event handlers should add snap lines to the caller using the methods provided by - * {@link yfiles.input.CollectLabelSnapLineEventArgs}. - *

- * @param listener The listener to remove. - * @see yfiles.input.LabelSnapContext#addCollectSnapLinesListener - */ - removeCollectSnapLinesListener(listener:(sender:any,evt:yfiles.input.CollectLabelSnapLineEventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.LabelSnapContext; - } - /** - * The event arguments used by {@link yfiles.input.LabelSnapContext} to collect custom snap lines for each drag. - * @see yfiles.input.LabelSnapContext#addCollectSnapLinesListener - * @class - * @extends {yfiles.input.InputModeEventArgs} - */ - export interface CollectLabelSnapLineEventArgs extends yfiles.input.InputModeEventArgs{} - export class CollectLabelSnapLineEventArgs { - /** - * Creates a new instance of this class. - * @param context The context this event is being used in. - * @param snapLines The snap lines collection to add to. - */ - constructor(context:yfiles.input.IInputModeContext,snapLines:yfiles.collections.ICollection); - /** - * Adds the given snap line to the snap line collection of this class. - * @param snapLine the snap line to add. - */ - addSnapLine(snapLine:yfiles.input.OrthogonalSnapLine):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.CollectLabelSnapLineEventArgs; - } - /** - * An {@link yfiles.input.IInputMode} that can {@link yfiles.input.NavigationInputMode#moveTo navigate} an {@link yfiles.graph.IGraph} displayed in a {@link yfiles.input.NavigationInputMode#graphComponent}. - *

- * This mode is {@link yfiles.input.NavigationInputMode#exclusive} by default. - *

- * @class - * @implements {yfiles.input.IInputMode} - */ - export interface NavigationInputMode extends yfiles.lang.Object,yfiles.input.IInputMode{} - export class NavigationInputMode { - /** - * Initializes a new instance of the {@link yfiles.input.NavigationInputMode} class. - */ - constructor(); - /** - * Callback that adjusts the {@link yfiles.view.CanvasComponent#contentRect} to encompass all elements. - *

- * This implementation will try to delegate to {@link yfiles.input.GraphEditorInputMode#adjustContentRect} if it can find the {@link yfiles.input.GraphEditorInputMode} - * in the {@link yfiles.input.NavigationInputMode#inputModeContext}, otherwise the {@link yfiles.input.ICommand#FIT_GRAPH_BOUNDS} is executed. - *

- * @protected - */ - adjustContentRect():void; - /** - * Adjust the group node location according to the value of {@link yfiles.input.NavigationInputMode#autoGroupNodeAlignmentPolicy}. - * @param collapse true iff the node has just been collapsed. - * @param groupNode The node that has changed its state. - * @protected - */ - adjustGroupNodeLocation(collapse:boolean,groupNode:yfiles.graph.INode):void; - /** - * - */ - cancel():void; - /** - * Clears the selection in the {@link yfiles.input.NavigationInputMode#graphComponent}. - */ - clearSelection():void; - /** - * {@link yfiles.graph.IFoldingView#collapse Collapses} the given group node to hide the contents of the group node from this {@link yfiles.graph.IFoldingView}. - * @param groupNode The group node to collapse. - * @see yfiles.graph.FoldingManager - * @see yfiles.input.NavigationInputMode#allowCollapseGroup - */ - collapseGroup(groupNode:yfiles.graph.INode):void; - /** - * Performs {@link yfiles.input.NavigationInputMode#collapseGroup} for all {@link yfiles.view.IGraphSelection#selectedNodes}. - */ - collapseSelection():void; - /** - * This method allows for entering a group node so that the currently displayed {@link yfiles.graph.IFoldingView}'s {@link yfiles.graph.IFoldingView#localRoot} will be reset - * to the provided node. - *

- * It is possible to both use a local group node that is part of the currently displayed {@link yfiles.input.NavigationInputMode#graph} as the node argument, as well as - * an item that belongs to the {@link yfiles.graph.FoldingManager#masterGraph} to allow for switching to group nodes which are currently not being displayed in this - * view. - *

- * @param node The node that needs to be either part of the current graph, or part of the {@link #masterGraph}. - * @see yfiles.input.NavigationInputMode#shouldEnterGroup - * @see yfiles.input.NavigationInputMode#allowEnterGroup - * @see yfiles.graph.FoldingManager - */ - enterGroup(node:yfiles.graph.INode):void; - /** - * Performs {@link yfiles.input.NavigationInputMode#enterGroup} for the first valid {@link yfiles.view.IGraphSelection#selectedNodes}. - */ - enterSelectedGroup():void; - /** - * Exits the current {@link yfiles.graph.IFoldingView#localRoot} of the currently displayed {@link yfiles.graph.IFoldingView view} and shows the contents of the parent container. - *

- * This method will also {@link yfiles.input.GraphInputMode#clearSelection clear the selection} and {@link yfiles.input.GraphInputMode#setSelected select} the exited group node. - *

- * @see yfiles.graph.FoldingManager - * @see yfiles.input.NavigationInputMode#allowExitGroup - * @see yfiles.input.NavigationInputMode#shouldExitGroup - */ - exitGroup():void; - /** - * {@link yfiles.graph.IFoldingView#expand Expands} the given group node to show the contents of the collapsed group node in this {@link yfiles.graph.IFoldingView}. - * @param groupNode The group node to expand - * @see yfiles.graph.FoldingManager - * @see yfiles.input.NavigationInputMode#allowExpandGroup - */ - expandGroup(groupNode:yfiles.graph.INode):void; - /** - * Performs {@link yfiles.input.NavigationInputMode#expandGroup} for all {@link yfiles.view.IGraphSelection#selectedNodes}. - */ - expandSelection():void; - /** - * Moves the focus into the given direction, extending the selection to the new element. - * @param direction The direction to move the focus and extend the selection. - */ - extendSelectionTo(direction:yfiles.input.MoveFocusDirection):void; - /** - * Installs this mode into the given context that is provided by the canvas. - *

- * In general a mode can only be installed into a single canvas at all times. - *

- *

- * This method is called to initialize this instance. Subclasses should override this method to register the corresponding - * event handler delegates for the various input events they need to register with. - *

- *

- * Overriding implementations should call the base implementation, first. - *

- * @param context The context that this instance shall be installed into. The same instance will be passed to this instance during - * {@link #uninstall}. A reference to the context may be kept and queried during the time the mode is - * installed. - * @param controller The {@link #controller} for this mode. - * @see yfiles.input.IInputMode#uninstall - */ - install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; - /** - * Moves the focus into the given direction, not changing the current selection. - * @param direction The direction to move the focus. - */ - moveFocusTo(direction:yfiles.input.MoveFocusDirection):void; - /** - * Moves the focus into the given direction, setting the selection to the new element. - * @param direction The direction to move the focus and selection. - */ - moveTo(direction:yfiles.input.MoveFocusDirection):void; - /** - * Called after {@link yfiles.input.NavigationInputMode#cancel} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been canceled. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onCanceled():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been activated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerActivated():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerDeactivated():void; - /** - * Raises the {@link yfiles.input.NavigationInputMode#addGroupCollapsedListener GroupCollapsed} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onGroupCollapsed(evt:yfiles.collections.ItemEventArgs):void; - /** - * Raises the {@link yfiles.input.NavigationInputMode#addGroupCollapsingListener GroupCollapsing} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onGroupCollapsing(evt:yfiles.collections.ItemEventArgs):void; - /** - * Raises the {@link yfiles.input.NavigationInputMode#addGroupEnteredListener GroupEntered} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onGroupEntered(evt:yfiles.collections.ItemEventArgs):void; - /** - * Raises the {@link yfiles.input.NavigationInputMode#addGroupEnteringListener GroupEntering} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onGroupEntering(evt:yfiles.collections.ItemEventArgs):void; - /** - * Raises the {@link yfiles.input.NavigationInputMode#addGroupExitedListener GroupExited} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onGroupExited(evt:yfiles.collections.ItemEventArgs):void; - /** - * Raises the {@link yfiles.input.NavigationInputMode#addGroupExitingListener GroupExiting} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onGroupExiting(evt:yfiles.collections.ItemEventArgs):void; - /** - * Raises the {@link yfiles.input.NavigationInputMode#addGroupExpandedListener GroupExpanded} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onGroupExpanded(evt:yfiles.collections.ItemEventArgs):void; - /** - * Raises the {@link yfiles.input.NavigationInputMode#addGroupExpandingListener GroupExpanding} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onGroupExpanding(evt:yfiles.collections.ItemEventArgs):void; - /** - * Callback that actually sets the current item property. - * @param graphComponent The {@link #graphComponent} to set the current item of. - * @param item The item to set. - * @returns Whether the operation was actually performed. - * @protected - */ - onSetCurrentItem(graphComponent:yfiles.view.GraphComponent,item:yfiles.graph.IModelItem):boolean; - /** - * Called after {@link yfiles.input.NavigationInputMode#tryStop} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been stopped. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onStopped():void; - /** - * Selects the {@link yfiles.view.GraphComponent#currentItem} current item. - *

- * This method delegates to {@link yfiles.input.NavigationInputMode#selectItem}. - *

- */ - selectCurrentItem():void; - /** - * Callback that selects the given item. - * @param graphComponent The {@link #graphComponent}. - * @param item The item to select. - * @param extendSelection if set to true the current selection is extended otherwise it is cleared beforehand. - * @see yfiles.input.NavigationInputMode#clearSelection - * @protected - */ - selectItem(graphComponent:yfiles.view.GraphComponent,item:yfiles.graph.IModelItem,extendSelection:boolean):void; - /** - * Sets the "current" item to the given one. - * @param item The item to set as the current item. - * @see yfiles.input.NavigationInputMode#onSetCurrentItem - */ - setCurrentItem(item:yfiles.graph.IModelItem):void; - /** - * Sets the {@link yfiles.input.NavigationInputMode#graphComponent} to use for the various actions. - *

- * This will register or unregister the commands for the control. This method is called in response to {@link yfiles.input.NavigationInputMode#install} - * and {@link yfiles.input.NavigationInputMode#uninstall}. - *

- * @param graphComponent The control to use or null. - * @protected - */ - setGraphComponent(graphComponent:yfiles.view.GraphComponent):void; - /** - * Predicate method that decides whether it is allowed to {@link yfiles.input.NavigationInputMode#collapseGroup collapse} the given group node. - *

- * This implementation returns the value of {@link yfiles.input.NavigationInputMode#allowCollapseGroup}. - *

- * @param groupNode - * @returns Whether to collapse the given group or not. - * @protected - */ - shouldCollapseGroup(groupNode:yfiles.graph.INode):boolean; - /** - * Predicate method that decides whether it is allowed to {@link yfiles.input.NavigationInputMode#enterGroup enter} the specific group node. - *

- * This implementation yields the value of {@link yfiles.input.NavigationInputMode#allowEnterGroup}. - *

- * @param node The group node to enter. - * @returns Whether to enter the group or not. - * @protected - */ - shouldEnterGroup(node:yfiles.graph.INode):boolean; - /** - * Predicate method that decides whether it is allowed to {@link yfiles.input.NavigationInputMode#exitGroup exit} the current group node. - *

- * This implementation yields the value of {@link yfiles.input.NavigationInputMode#allowExitGroup}. - *

- * @returns Whether to exit the current group or not. - * @protected - */ - shouldExitGroup():boolean; - /** - * Predicate method that decides whether it is allowed to {@link yfiles.input.NavigationInputMode#expandGroup expand} the given group node. - *

- * This implementation yields the value of {@link yfiles.input.NavigationInputMode#allowExpandGroup}. - *

- * @param node - * @returns Whether to expand the given group or not. - * @protected - */ - shouldExpandGroup(node:yfiles.graph.INode):boolean; - /** - * Callback predicate method that determines whether a given model item should be navigated to. - *

- * This implementation uses the {@link yfiles.input.NavigationInputMode#navigableItems} property to determine whether the item can be navigated to. - *

- * @param item The model item. - * @returns Whether the item should be considered for navigational commands. - * @protected - */ - shouldNavigateTo(item:yfiles.graph.IModelItem):boolean; - /** - * Determines whether the input mode should try to request the mutex when a command is executed. - *

- * This resets the state of any other input mode, unless it currently possesses the mutex. - *

- *

- * The value of this method is queried for {@link yfiles.input.ICommand#COLLAPSE_GROUP}, {@link yfiles.input.ICommand#EXPAND_GROUP}, - * {@link yfiles.input.ICommand#TOGGLE_EXPANSION_STATE}, {@link yfiles.input.ICommand#ENTER_GROUP} and {@link yfiles.input.ICommand#EXIT_GROUP}. - *

- * @returns whether the input mode should request the mutex. - * @protected - */ - shouldRequestMutex():boolean; - /** - * Callback predicate method that determines whether a given model item should be selected. - *

- * This implementation uses the {@link yfiles.input.NavigationInputMode#selectableItems} property to determine whether the item should be selected. - *

- * @param item The model item. - * @returns Whether the item should be selected by the navigational commands. - * @protected - */ - shouldSelect(item:yfiles.graph.IModelItem):boolean; - /** - * Predicate method that decides whether it is allowed to {@link yfiles.input.NavigationInputMode#toggleExpansionState toggle} the collapsed state of the given group node. - *

- * This implementation uses {@link yfiles.input.NavigationInputMode#shouldExpandGroup} and {@link yfiles.input.NavigationInputMode#shouldCollapseGroup} - * respectively. - *

- * @param node - * @returns Whether to expand the given group or not. - * @protected - */ - shouldToggleExpansionState(node:yfiles.graph.INode):boolean; - /** - * Toggles the {@link yfiles.graph.IFoldingView#isExpanded expanded/collapsed} state for the given group node in the {@link yfiles.graph.IFoldingView}. - * @param groupNode The group node to toggle the state for. - * @see yfiles.graph.FoldingManager - */ - toggleExpansionState(groupNode:yfiles.graph.INode):void; - /** - * Overridden to only return true if this instance does not currently {@link yfiles.input.ConcurrencyController#hasMutex have the input mutex}. - * @returns true iff this instance does not {@link #hasMutex own the mutex}. - */ - tryStop():boolean; - /** - * Uninstalls this mode from the given context. - *

- * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} method. After a mode has - * been uninstalled it can be installed again into the same or another canvas. - *

- *

- * Overriding implementations should call the base implementation after their own code. - *

- * @param context The context to deregister from. This is the same instance that had been passed to {@link #install} during - * installation. - */ - uninstall(context:yfiles.input.IInputModeContext):void; - /** - * - * @type {number} - */ - priority:number; - /** - * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. - *

- * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.NavigationInputMode#controller}. - *

- *

- * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} - * will be deactivated. Otherwise it will always run concurrently with all other modes. - *

- * @type {boolean} - */ - exclusive:boolean; - /** - * Gets or sets the enabled state of this input mode. - *

- * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed - * {@link yfiles.input.NavigationInputMode#controller} so a disabled instance should never try to acquire the input mutex. - *

- * @type {boolean} - */ - enabled:boolean; - /** - * - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Gets the installed {@link yfiles.input.NavigationInputMode#controller}. - * @protected - * @type {yfiles.input.ConcurrencyController} - */ - controller:yfiles.input.ConcurrencyController; - /** - * Gets or sets the item types that can be navigated to by this mode. - * @see yfiles.input.NavigationInputMode#shouldNavigateTo - * @type {yfiles.graph.GraphItemTypes} - */ - navigableItems:yfiles.graph.GraphItemTypes; - /** - * Gets the types of the items that should be selectable by this instance. - *

- * The selectable items. The default value is {@link yfiles.graph.GraphItemTypes#NODE}. - *

- * @default yfiles.graph.GraphItemTypes.NODE - * @type {yfiles.graph.GraphItemTypes} - */ - selectableItems:yfiles.graph.GraphItemTypes; - /** - * Gets or sets the the location that should be kept fixed if toggling a group node state. - *

- * Default value is {@link yfiles.input.NodeAlignmentPolicy#NONE} - *

- * @see yfiles.input.NavigationInputMode#expandGroup - * @see yfiles.input.NavigationInputMode#collapseGroup - * @default yfiles.input.NodeAlignmentPolicy.NONE - * @type {yfiles.input.NodeAlignmentPolicy} - */ - autoGroupNodeAlignmentPolicy:yfiles.input.NodeAlignmentPolicy; - /** - * Gets or sets the {@link yfiles.input.NavigationInputMode#graphComponent} this mode acts on. - * @type {yfiles.view.GraphComponent} - */ - graphComponent:yfiles.view.GraphComponent; - /** - * Gets the list of commands that are available in this instance. - *

- * By default, all supported commands are available - *

- *

- * Removing commands from this collection also removes the command bindings registered by this instance. - *

- *

- * Add supported commands to make them available in this instance. - *

- *

- * Supported commands are - *

- *
    - *
  • {@link yfiles.input.ICommand#MOVE_LEFT}
  • - *
  • {@link yfiles.input.ICommand#MOVE_RIGHT}
  • - *
  • {@link yfiles.input.ICommand#MOVE_UP}
  • - *
  • {@link yfiles.input.ICommand#MOVE_DOWN}
  • - *
  • {@link yfiles.input.ICommand#MOVE_TO_PAGE_UP}
  • - *
  • {@link yfiles.input.ICommand#MOVE_TO_PAGE_DOWN}
  • - *
  • {@link yfiles.input.ICommand#MOVE_FOCUS_BACK}
  • - *
  • {@link yfiles.input.ICommand#MOVE_FOCUS_FORWARD}
  • - *
  • {@link yfiles.input.ICommand#MOVE_FOCUS_UP}
  • - *
  • {@link yfiles.input.ICommand#MOVE_FOCUS_DOWN}
  • - *
  • {@link yfiles.input.ICommand#MOVE_FOCUS_PAGE_UP}
  • - *
  • {@link yfiles.input.ICommand#MOVE_FOCUS_PAGE_DOWN}
  • - *
  • {@link yfiles.input.ICommand#EXTEND_SELECTION_LEFT}
  • - *
  • {@link yfiles.input.ICommand#EXTEND_SELECTION_RIGHT}
  • - *
  • {@link yfiles.input.ICommand#EXTEND_SELECTION_UP}
  • - *
  • {@link yfiles.input.ICommand#EXTEND_SELECTION_DOWN}
  • - *
  • {@link yfiles.input.ICommand#SELECT_TO_PAGE_UP}
  • - *
  • {@link yfiles.input.ICommand#SELECT_TO_PAGE_DOWN}
  • - *
- * @type {yfiles.collections.ICollection.} - */ - availableCommands:yfiles.collections.ICollection; - /** - * Gets or sets a value indicating whether to use the {@link yfiles.view.GraphComponent#currentItem} as a fallback for the commands if no item is provided in the - * parameter and the current selection is empty. - *

- * This applies to the following commands: - *

- *
    - *
  • {@link yfiles.input.ICommand#ENTER_GROUP}
  • - *
  • {@link yfiles.input.ICommand#EXPAND_GROUP}
  • - *
  • {@link yfiles.input.ICommand#COLLAPSE_GROUP}
  • - *
  • {@link yfiles.input.ICommand#TOGGLE_EXPANSION_STATE}
  • - *
- * @default false - * @type {boolean} - */ - useCurrentItemForCommands:boolean; - /** - * Gets or sets the {@link yfiles.view.IGraphSelection} this mode operates on. - * @type {yfiles.view.IGraphSelection} - */ - graphSelection:yfiles.view.IGraphSelection; - /** - * Gets or sets the graph this mode operates on. - * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - /** - * Gets or sets a value that determines whether it is allowed to {@link yfiles.input.NavigationInputMode#enterGroup enter group nodes} via the - * {@link yfiles.input.ICommand#ENTER_GROUP}. - *

- * The default value is true. - *

- * @see yfiles.input.NavigationInputMode#shouldEnterGroup - * @see yfiles.graph.FoldingManager - * @type {boolean} - */ - allowEnterGroup:boolean; - /** - * Gets or sets a value that determines whether it is allowed to collapse group nodes via the - * {@link yfiles.input.ICommand#COLLAPSE_GROUP}. - *

- * The default value is true. - *

- * @see yfiles.input.NavigationInputMode#collapseGroup - * @see yfiles.input.NavigationInputMode#shouldCollapseGroup - * @see yfiles.graph.FoldingManager - * @type {boolean} - */ - allowCollapseGroup:boolean; - /** - * Gets or sets a value that determines whether it is allowed to {@link yfiles.input.NavigationInputMode#expandGroup expand group nodes} via the - * {@link yfiles.input.ICommand#EXPAND_GROUP}. - *

- * The default value is true. - *

- * @see yfiles.input.NavigationInputMode#shouldExpandGroup - * @see yfiles.graph.FoldingManager - * @type {boolean} - */ - allowExpandGroup:boolean; - /** - * Gets or sets a value that determines whether it is allowed to {@link yfiles.input.NavigationInputMode#exitGroup exit the current group node} via the - * {@link yfiles.input.ICommand#EXIT_GROUP}. - *

- * The default value is true. - *

- * @see yfiles.input.NavigationInputMode#shouldExitGroup - * @see yfiles.graph.FoldingManager - * @default true - * @type {boolean} - */ - allowExitGroup:boolean; - /** - * Gets or sets a value that determines whether {@link yfiles.view.CanvasComponent#fitContent} or the {@link yfiles.input.ICommand#FIT_CONTENT} - * should be triggered after a group navigation action. - *

- * The default value is true. - *

- * @default true - * @type {boolean} - */ - fitContentAfterGroupActions:boolean; - /** - * Adds the given listener for the GroupCollapsing event that occurs before a group will be {@link yfiles.input.NavigationInputMode#collapseGroup Collapsed}. - * @param listener The listener to add. - * @see yfiles.input.NavigationInputMode#removeGroupCollapsingListener - */ - addGroupCollapsingListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the GroupCollapsing event that occurs before a group will be {@link yfiles.input.NavigationInputMode#collapseGroup Collapsed}. - * @param listener The listener to remove. - * @see yfiles.input.NavigationInputMode#addGroupCollapsingListener - */ - removeGroupCollapsingListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the GroupCollapsed event that occurs whenever a group has been {@link yfiles.input.NavigationInputMode#collapseGroup Collapsed}. - * @param listener The listener to add. - * @see yfiles.input.NavigationInputMode#removeGroupCollapsedListener - */ - addGroupCollapsedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the GroupCollapsed event that occurs whenever a group has been {@link yfiles.input.NavigationInputMode#collapseGroup Collapsed}. - * @param listener The listener to remove. - * @see yfiles.input.NavigationInputMode#addGroupCollapsedListener - */ - removeGroupCollapsedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the GroupExpanding event that occurs before a group will be {@link yfiles.input.NavigationInputMode#expandGroup Expanded}. - * @param listener The listener to add. - * @see yfiles.input.NavigationInputMode#removeGroupExpandingListener - */ - addGroupExpandingListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the GroupExpanding event that occurs before a group will be {@link yfiles.input.NavigationInputMode#expandGroup Expanded}. - * @param listener The listener to remove. - * @see yfiles.input.NavigationInputMode#addGroupExpandingListener - */ - removeGroupExpandingListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the GroupExpanded event that occurs whenever a group has been {@link yfiles.input.NavigationInputMode#expandGroup Expanded}. - * @param listener The listener to add. - * @see yfiles.input.NavigationInputMode#removeGroupExpandedListener - */ - addGroupExpandedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the GroupExpanded event that occurs whenever a group has been {@link yfiles.input.NavigationInputMode#expandGroup Expanded}. - * @param listener The listener to remove. - * @see yfiles.input.NavigationInputMode#addGroupExpandedListener - */ - removeGroupExpandedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the GroupEntering event that occurs before a group will be {@link yfiles.input.NavigationInputMode#enterGroup Entered}. - * @param listener The listener to add. - * @see yfiles.input.NavigationInputMode#removeGroupEnteringListener - */ - addGroupEnteringListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the GroupEntering event that occurs before a group will be {@link yfiles.input.NavigationInputMode#enterGroup Entered}. - * @param listener The listener to remove. - * @see yfiles.input.NavigationInputMode#addGroupEnteringListener - */ - removeGroupEnteringListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the GroupEntered event that occurs whenever a group has been {@link yfiles.input.NavigationInputMode#enterGroup Entered}. - * @param listener The listener to add. - * @see yfiles.input.NavigationInputMode#removeGroupEnteredListener - */ - addGroupEnteredListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the GroupEntered event that occurs whenever a group has been {@link yfiles.input.NavigationInputMode#enterGroup Entered}. - * @param listener The listener to remove. - * @see yfiles.input.NavigationInputMode#addGroupEnteredListener - */ - removeGroupEnteredListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the GroupExiting event that occurs before a group will be {@link yfiles.input.NavigationInputMode#exitGroup Exited}. - * @param listener The listener to add. - * @see yfiles.input.NavigationInputMode#removeGroupExitingListener - */ - addGroupExitingListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the GroupExiting event that occurs before a group will be {@link yfiles.input.NavigationInputMode#exitGroup Exited}. - * @param listener The listener to remove. - * @see yfiles.input.NavigationInputMode#addGroupExitingListener - */ - removeGroupExitingListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the GroupExited event that occurs whenever a group has been {@link yfiles.input.NavigationInputMode#exitGroup Exited}. - * @param listener The listener to add. - * @see yfiles.input.NavigationInputMode#removeGroupExitedListener - */ - addGroupExitedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the GroupExited event that occurs whenever a group has been {@link yfiles.input.NavigationInputMode#exitGroup Exited}. - * @param listener The listener to remove. - * @see yfiles.input.NavigationInputMode#addGroupExitedListener - */ - removeGroupExitedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.NavigationInputMode; - } - export enum MoveFocusDirection{ - /** - * No direction. - */ - NONE, - /** - * In the direction of the negative x Axis. - */ - LEFT, - /** - * In the direction of the positive x Axis. - */ - RIGHT, - /** - * In the direction of the negative y Axis. - */ - UP, - /** - * In the direction of the positive y Axis. - */ - DOWN, - /** - * In the direction of the {@link yfiles.graph.IGraph#setParent parent} in the grouped graph. - */ - PARENT, - /** - * In the direction of the {@link yfiles.graph.IGraph#getChildren children} in the grouped graph. - */ - CHILD - } - export enum NodeAlignmentPolicy{ - /** - * Don't fix any specific point, only use the layout from the target state. - */ - NONE, - /** - * Fix the center point. - */ - CENTER, - /** - * Fix the upper left corner. - */ - TOP_LEFT, - /** - * Fix the lower left corner. - */ - BOTTOM_LEFT, - /** - * Fix the upper right corner. - */ - TOP_RIGHT, - /** - * Fix the lower right corner. - */ - BOTTOM_RIGHT, - /** - * Fix the uppermost center. - */ - TOP_CENTER, - /** - * Fix the lowermost center. - */ - BOTTOM_CENTER, - /** - * Fix the left center. - */ - CENTER_LEFT, - /** - * Fix the right center. - */ - CENTER_RIGHT - } - export enum OrthogonalEdgeEditingPolicy{ - /** - * Enables orthogonal edge creation or editing for a specific sub-aspect automatically if an {@link yfiles.input.OrthogonalEdgeEditingContext#enabled} {@link yfiles.input.OrthogonalEdgeEditingContext} - * instance is set in the {@link yfiles.input.GraphEditorInputMode#orthogonalEdgeEditingContext parent input mode}. - */ - AUTO, - /** - * Enables orthogonal edge creation or editing for a specific sub-aspect of edge creation. - */ - ALWAYS, - /** - * Disables orthogonal edge creation or editing for a specific sub-aspect of edge creation. - */ - NEVER - } - export enum SegmentOrientation{ - /** - * The segment has a horizontal orientation, which means that the end points should be moved vertically in synch so that - * the orientation is not destroyed. - */ - HORIZONTAL, - /** - * The segment has a vertical orientation, which means that the end points should be moved horizontally in synch so that - * the orientation is not destroyed. - */ - VERTICAL, - /** - * The segment does not need to be treated especially, both endpoints can be moved independently from each other. - */ - NON_ORTHOGONAL - } - /** - * A snap line is a line segment in the world coordinate system to which other items (lines or points) snap during - * interactive movements. - *

- * {@link yfiles.input.GraphSnapContext} and {@link yfiles.input.LabelSnapContext} make use of this class to interactively snap moving - * elements to snap lines. - *

- * @class - */ - export interface SnapLine extends yfiles.lang.Object{} - export class SnapLine { - /** - * Creates a new snap line using the provided attributes. - * @param snapType The type of the line that describes how other items will snap to this line. This is one of - * {@link #TOP}, {@link #BOTTOM}, {@link #LEFT}, - * {@link #RIGHT}, or {@link #CENTER}. - * @param resourceKey A resource key which determines the visual representation of this snap line. - * @param coordinates The coordinates of the center point of the snap line. - * @param from The first location that delimits this snap line. - * @param to The second location that delimits this snap line. - * @param tag A tag that is associated with this snap line - see {@link #tag} for a typical use of this value. - * @param weight The weight (importance) of this snap line. If more than one snap line is snapped to, the one with the greater weight - * will be used. - */ - constructor(snapType:yfiles.input.SnapLineSnapTypes,resourceKey:string,coordinates:yfiles.geometry.Point,from:yfiles.geometry.Point,to:yfiles.geometry.Point,tag:any,weight:number); - /** - * Resource key which determines a snap line having a fixed visualization independent of the {@link yfiles.input.SnapResult}. - * @const - * @static - * @type {string} - */ - static SNAP_LINE_FIXED_LINE_KEY:string; - /** - * Resource key which determines a snap line with three special locations, for example the start, end and center of an edge - * segment. - * @const - * @static - * @type {string} - */ - static SNAP_LINE_EDGE_SEGMENT_KEY:string; - /** - * Resource key which determines a grid snap line having a fixed visualization independent of the {@link yfiles.input.SnapResult}. - * @const - * @static - * @type {string} - */ - static GRID_LINE_FIXED_LINE_KEY:string; - /** - * Resource key which determines a decorated snap line between the {@link yfiles.input.SnapLine#coordinates} and the snapped coordinates. - * @const - * @static - * @type {string} - */ - static SNAP_LINE_VARIABLE_LINE_KEY:string; - /** - * Resource key which determines a blank line between the {@link yfiles.input.SnapLine#coordinates} and the snapped coordinates. - * @const - * @static - * @type {string} - */ - static SNAP_LINE_BLANK_VARIABLE_LINE_KEY:string; - /** - * Resource key which determines a decorated line between the {@link yfiles.input.SnapLine#coordinates} and the snapped coordinates that is extended on both sides. - * @const - * @static - * @type {string} - */ - static SNAP_LINE_EXTENDED_VARIABLE_LINE_KEY:string; - /** - * Resource key which determines a snap line which lets an item snap in a defined distance to another graph item. - * @const - * @static - * @type {string} - */ - static SNAP_LINE_FIXED_DISTANCE_KEY:string; - /** - * Resource key which determines a snap line which lets an item snap in the center between the bounds of two other items. - * @const - * @static - * @type {string} - */ - static SNAP_LINE_CENTER_BETWEEN_BOUNDS_KEY:string; - /** - * Resource key which determines a snap line which lets an item snap in the center between the centers of two other items. - * @const - * @static - * @type {string} - */ - static SNAP_LINE_CENTER_BETWEEN_CENTERS_KEY:string; - /** - * Resource key which determines a snap line which lets an item snap if it has an equal distance to two other items. - * @const - * @static - * @type {string} - */ - static SNAP_LINE_EQUAL_DISTANCE_BETWEEN_BOUNDS_KEY:string; - /** - * Resource key which determines a snap line which lets an item snap if it's center has an equal distance to the centers' - * of two other items. - * @const - * @static - * @type {string} - */ - static SNAP_LINE_EQUAL_DISTANCE_BETWEEN_CENTERS_KEY:string; - /** - * Resource key which determines the snapping of a resized item if it's new width is equal to another item. - * @const - * @static - * @type {string} - */ - static SNAP_LINE_EQUAL_WIDTH_KEY:string; - /** - * Resource key which determines the snapping of a resized item if it's new height is equal to another item. - * @const - * @static - * @type {string} - */ - static SNAP_LINE_EQUAL_HEIGHT_KEY:string; - /** - * Resource key which determines the snapping of an item to a grid position. - * @const - * @static - * @type {string} - */ - static SNAP_TO_GRID_KEY:string; - /** - * Resource key which determines the {@link yfiles.view.Stroke} used for the snap line visualization. - * @const - * @static - * @type {string} - */ - static SNAP_LINE_STROKE_KEY:string; - /** - * Gets the type of the line that describes how other items will snap to this line. - *

- * his is one of {@link yfiles.input.SnapLineSnapTypes#TOP}, {@link yfiles.input.SnapLineSnapTypes#BOTTOM}, - * {@link yfiles.input.SnapLineSnapTypes#LEFT}, {@link yfiles.input.SnapLineSnapTypes#RIGHT}, or {@link yfiles.input.SnapLineSnapTypes#CENTER}. - *

- * @type {yfiles.input.SnapLineSnapTypes} - */ - snapType:yfiles.input.SnapLineSnapTypes; - /** - * Gets the coordinates of the center point of the snap line. - * @type {yfiles.geometry.Point} - */ - coordinates:yfiles.geometry.Point; - /** - * Gets the tag that is associated with this snap line. - *

- * The tag is most commonly used for the {@link yfiles.input.SnapResult#tag snap result tag}. - *

- * @type {any} - */ - tag:any; - /** - * Gets the weight/importance of this snap line. - *

- * Greater values indicate greater importance. - *

- * @type {number} - */ - weight:number; - /** - * Gets or sets the first location that delimits this snap line. - * @type {yfiles.geometry.Point} - */ - from:yfiles.geometry.Point; - /** - * Gets or sets the second location that delimits this snap line. - * @type {yfiles.geometry.Point} - */ - to:yfiles.geometry.Point; - /** - * Gets the resource key which determines the visual appearance of the snap line. - * @type {string} - */ - resourceKey:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.SnapLine; - } - /** - * An orthogonal snap line, in other words, one that is parallel to the x or y axis. - * @class - * @extends {yfiles.input.SnapLine} - */ - export interface OrthogonalSnapLine extends yfiles.input.SnapLine{} - export class OrthogonalSnapLine { - /** - * Creates a new snap line using the provided attributes. - * @param orientation The orientation of the snap line. This is one of {@link #HORIZONTAL} or - * {@link #VERTICAL}. - * @param snapType The type of the line that describes how other items will snap to this line. This is one of - * {@link #TOP}, {@link #BOTTOM}, {@link #LEFT}, - * {@link #RIGHT}, or {@link #CENTER}. - * @param resourceKey A resource key which determines the visual representation of this snap line. - * @param coordinates The coordinates of the center point of the snap line. - * @param tag A tag that is associated with this snap line - see {@link #tag} for a typical use of this value. - * @param weight The weight (importance) of this snap line. If more than one snap line is snapped to, the one with the greater weight - * will be used. - */ - constructor(orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,resourceKey:string,coordinates:yfiles.geometry.Point,tag:any,weight:number); - /** - * Creates a new snap line using the provided attributes. - * @param orientation The orientation of the snap line. This is one of {@link #HORIZONTAL} or - * {@link #VERTICAL}. - * @param snapType The type of the line that describes how other items will snap to this line. This is one of - * {@link #TOP}, {@link #BOTTOM}, {@link #LEFT}, - * {@link #RIGHT}, or {@link #CENTER}. - * @param resourceKey A resource key which determines the visual representation of this snap line. - * @param coordinates The coordinates of the center point of the snap line. - * @param from The smaller value of the coordinate that delimits this snap line. - * @param to The greater value of the coordinate that delimits this snap line. - * @param tag A tag that is associated with this snap line - see {@link #tag} for a typical use of this value. - * @param weight The weight (importance) of this snap line. If more than one snap line is snapped to, the one with the greater weight - * will be used. - */ - constructor(orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,resourceKey:string,coordinates:yfiles.geometry.Point,from:number,to:number,tag:any,weight:number); - /** - * Gets the orientation of the snap line. - *

- * This is one of {@link yfiles.input.SnapLineOrientation#HORIZONTAL} or {@link yfiles.input.SnapLineOrientation#VERTICAL}. - *

- * @type {yfiles.input.SnapLineOrientation} - */ - orientation:yfiles.input.SnapLineOrientation; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.OrthogonalSnapLine; - } - /** - * A specialized {@link yfiles.input.OrthogonalSnapLine} that stores a {@link yfiles.input.NodeBasedSnapLine#node} as additional information that can be used for the - * visualization. - * @class - * @extends {yfiles.input.OrthogonalSnapLine} - */ - export interface NodeBasedSnapLine extends yfiles.input.OrthogonalSnapLine{} - export class NodeBasedSnapLine { - /** - * Initializes a new instance of the {@link yfiles.input.NodeBasedSnapLine} class. - * @param node The node to assign to {@link #node}. - * @param orientation The orientation of the snap line. This is one of {@link #HORIZONTAL} or - * {@link #VERTICAL}. - * @param snapType The type of the line that describes how other items will snap to this line. This is one of - * {@link #TOP}, {@link #BOTTOM}, {@link #LEFT}, - * {@link #RIGHT}, or {@link #CENTER}. - * @param resourceKey A resource key which determines the visual representation of this snap line. - * @param coordinates The coordinates of the center point of the snap line. - * @param tag A tag that is associated with this snap line - see {@link #tag} for a typical use of this value. - * @param weight The weight (importance) of this snap line. If more than one snap line is snapped to, the one with the greater weight - * will be used. - * @param from The smaller value of the coordinate that delimits this snap line. - * @param to The greater value of the coordinate that delimits this snap line. - */ - constructor(node:yfiles.graph.INode,orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,resourceKey:string,coordinates:yfiles.geometry.Point,from:number,to:number,tag:any,weight:number); - /** - * Initializes a new instance of the {@link yfiles.input.NodeBasedSnapLine} class. - * @param node The node to assign to {@link #node}. - * @param orientation The orientation of the snap line. This is one of {@link #HORIZONTAL} or - * {@link #VERTICAL}. - * @param snapType The type of the line that describes how other items will snap to this line. This is one of - * {@link #TOP}, {@link #BOTTOM}, {@link #LEFT}, - * {@link #RIGHT}, or {@link #CENTER}. - * @param resourceKey A resource key which determines the visual representation of this snap line. - * @param coordinates The coordinates of the center point of the snap line. - * @param tag A tag that is associated with this snap line - see {@link #tag} for a typical use of this value. - * @param weight The weight (importance) of this snap line. If more than one snap line is snapped to, the one with the greater weight - * will be used. - */ - constructor(node:yfiles.graph.INode,orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,resourceKey:string,coordinates:yfiles.geometry.Point,tag:any,weight:number); - /** - * Gets the node that is associated with this snap line. - *

- * Usually this is the instance that induced this snap line. - *

- * @type {yfiles.graph.INode} - */ - node:yfiles.graph.INode; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.NodeBasedSnapLine; - } - /** - * A specialized {@link yfiles.input.OrthogonalSnapLine} that stores two {@link yfiles.graph.INode nodes} as additional information that can be used for the - * visualization. - * @see yfiles.input.NodePairBasedSnapLine#firstNode - * @see yfiles.input.NodePairBasedSnapLine#secondNode - * @class - * @extends {yfiles.input.OrthogonalSnapLine} - */ - export interface NodePairBasedSnapLine extends yfiles.input.OrthogonalSnapLine{} - export class NodePairBasedSnapLine { - /** - * Initializes a new instance of the {@link yfiles.input.NodePairBasedSnapLine} class. - * @param firstNode The first node to assign to {@link #firstNode}. - * @param secondNode The second node to assign to {@link #secondNode}. - * @param orientation The orientation of the snap line. This is one of {@link #HORIZONTAL} or - * {@link #VERTICAL}. - * @param snapType The type of the line that describes how other items will snap to this line. This is one of - * {@link #TOP}, {@link #BOTTOM}, {@link #LEFT}, - * {@link #RIGHT}, or {@link #CENTER}. - * @param resourceKey A resource key which determines the visual representation of this snap line. - * @param coordinates The coordinates of the center point of the snap line. - * @param tag A tag that is associated with this snap line - see {@link #tag} for a typical use of this value. - * @param weight The weight (importance) of this snap line. If more than one snap line is snapped to, the one with the greater weight - * will be used. - * @param from The smaller value of the coordinate that delimits this snap line. - * @param to The greater value of the coordinate that delimits this snap line. - */ - constructor(firstNode:yfiles.graph.INode,secondNode:yfiles.graph.INode,orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,resourceKey:string,coordinates:yfiles.geometry.Point,from:number,to:number,tag:any,weight:number); - /** - * Initializes a new instance of the {@link yfiles.input.NodePairBasedSnapLine} class. - * @param firstNode The first node to assign to {@link #firstNode}. - * @param secondNode The second node to assign to {@link #secondNode}. - * @param orientation The orientation of the snap line. This is one of {@link #HORIZONTAL} or - * {@link #VERTICAL}. - * @param snapType The type of the line that describes how other items will snap to this line. This is one of - * {@link #TOP}, {@link #BOTTOM}, {@link #LEFT}, - * {@link #RIGHT}, or {@link #CENTER}. - * @param resourceKey A resource key which determines the visual representation of this snap line. - * @param coordinates The coordinates of the center point of the snap line. - * @param tag A tag that is associated with this snap line - see {@link #tag} for a typical use of this value. - * @param weight The weight (importance) of this snap line. If more than one snap line is snapped to, the one with the greater weight - * will be used. - */ - constructor(firstNode:yfiles.graph.INode,secondNode:yfiles.graph.INode,orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,resourceKey:string,coordinates:yfiles.geometry.Point,tag:any,weight:number); - /** - * Gets the first node that is associated with this snap line. - *

- * Usually this is one of the instances that induced this snap line. - *

- * @type {yfiles.graph.INode} - */ - firstNode:yfiles.graph.INode; - /** - * Gets the second node that is associated with this snap line. - *

- * Usually this is one of the instances that induced this snap line. - *

- * @type {yfiles.graph.INode} - */ - secondNode:yfiles.graph.INode; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.NodePairBasedSnapLine; - } - /** - * A specialized {@link yfiles.input.OrthogonalSnapLine} that stores a {@link yfiles.input.PointBasedSnapLine#point} instance as additional information that can be used for the - * visualization. - * @class - * @extends {yfiles.input.OrthogonalSnapLine} - */ - export interface PointBasedSnapLine extends yfiles.input.OrthogonalSnapLine{} - export class PointBasedSnapLine { - /** - * Initializes a new instance of the {@link yfiles.input.PointBasedSnapLine} class. - * @param point The point to assign to {@link #point}. - * @param orientation The orientation of the snap line. This is one of {@link #HORIZONTAL} or - * {@link #VERTICAL}. - * @param snapType The type of the line that describes how other items will snap to this line. This is one of - * {@link #TOP}, {@link #BOTTOM}, {@link #LEFT}, - * {@link #RIGHT}, or {@link #CENTER}. - * @param resourceKey A resource key which determines the visual representation of this snap line. - * @param coordinates The coordinates of the center point of the snap line. - * @param tag A tag that is associated with this snap line - see {@link #tag} for a typical use of this value. - * @param weight The weight (importance) of this snap line. If more than one snap line is snapped to, the one with the greater weight - * will be used. - * @param from The smaller value of the coordinate that delimits this snap line. - * @param to The greater value of the coordinate that delimits this snap line. - */ - constructor(point:yfiles.geometry.IPoint,orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,resourceKey:string,coordinates:yfiles.geometry.Point,from:number,to:number,tag:any,weight:number); - /** - * Initializes a new instance of the {@link yfiles.input.PointBasedSnapLine} class. - * @param point The point to assign to {@link #point}. - * @param orientation The orientation of the snap line. This is one of {@link #HORIZONTAL} or - * {@link #VERTICAL}. - * @param snapType The type of the line that describes how other items will snap to this line. This is one of - * {@link #TOP}, {@link #BOTTOM}, {@link #LEFT}, - * {@link #RIGHT}, or {@link #CENTER}. - * @param resourceKey A resource key which determines the visual representation of this snap line. - * @param coordinates The coordinates of the center point of the snap line. - * @param tag A tag that is associated with this snap line - see {@link #tag} for a typical use of this value. - * @param weight The weight (importance) of this snap line. If more than one snap line is snapped to, the one with the greater weight - * will be used. - */ - constructor(point:yfiles.geometry.IPoint,orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,resourceKey:string,coordinates:yfiles.geometry.Point,tag:any,weight:number); - /** - * Gets the point that is associated with this snap line. - *

- * Usually this is the instance that induced this snap line. - *

- * @type {yfiles.geometry.IPoint} - */ - point:yfiles.geometry.IPoint; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.PointBasedSnapLine; - } - /** - * A specialized {@link yfiles.input.SnapLine} that is parallel to an edge segment and stores that edge. - *

- * In addition to the line itself, this class has three special nape locations the represent the source, center and end - * location of the related edge segment. All snap lines of this type have the {@link yfiles.input.SnapLine#snapType} {@link yfiles.input.SnapLineSnapTypes#CENTER} and - * the {@link yfiles.input.SnapLine#resourceKey} {@link yfiles.input.SnapLine#SNAP_LINE_EDGE_SEGMENT_KEY}. - *

- * @class - * @extends {yfiles.input.SnapLine} - */ - export interface EdgeSegmentSnapLine extends yfiles.input.SnapLine{} - export class EdgeSegmentSnapLine { - /** - * Initializes a new instance of the {@link yfiles.input.PointBasedSnapLine} class. - * @param edge The edge to assign to {@link #edge}. - * @param from The first location that delimits this snap line. - * @param to The second location that delimits this snap line. - * @param segmentSource The location that represents the source of the related segment on this line. - * @param segmentTarget The location that represents the target of the related segment on this line. - * @param distance The distance of this snap line from its related edge segment. - * @param segmentIndex The segment index of the related edge segment. - * @param tag A tag that is associated with this snap line. - * @param weight The weight (importance) of this snap line. - */ - constructor(edge:yfiles.graph.IEdge,from:yfiles.geometry.Point,to:yfiles.geometry.Point,segmentSource:yfiles.geometry.Point,segmentTarget:yfiles.geometry.Point,distance:number,segmentIndex:number,tag:any,weight:number); - /** - * Initializes a new instance of the {@link yfiles.input.PointBasedSnapLine} class. - * @param edge The edge to assign to {@link #edge}. - * @param segmentSource The location that represents the source of the related segment on this line. In addition, this location is used as {@link #from} - * location. - * @param segmentTarget The location that represents the target of the related segment on this line. In addition, this location is used as {@link #to} - * location. - * @param distance The distance of this snap line from its related edge segment. - * @param segmentIndex The segment index of the related edge segment. - */ - constructor(edge:yfiles.graph.IEdge,segmentSource:yfiles.geometry.Point,segmentTarget:yfiles.geometry.Point,distance:number,segmentIndex:number); - /** - * Gets the edge that is associated with this snap line. - * @type {yfiles.graph.IEdge} - */ - edge:yfiles.graph.IEdge; - /** - * Gets the direction vector of this snap line. - * @type {yfiles.geometry.Point} - */ - direction:yfiles.geometry.Point; - /** - * Gets the distance of this snap line from its related edge segment. - * @type {number} - */ - distance:number; - /** - * Gets the segment index of the related edge segment. - * @type {number} - */ - segmentIndex:number; - /** - * Gets the location that represents the source of the related segment on this line. - * @type {yfiles.geometry.Point} - */ - segmentSource:yfiles.geometry.Point; - /** - * Gets the location that represents the target of the related segment on this line. - * @type {yfiles.geometry.Point} - */ - segmentTarget:yfiles.geometry.Point; - /** - * Gets or sets the location of the source marker of this snap line. - *

- * If this is null, the location of the {@link yfiles.input.EdgeSegmentSnapLine#segmentSource} is marked instead. - *

- * @type {yfiles.geometry.Point} - */ - sourceMarker:yfiles.geometry.Point; - /** - * Gets or sets the location of the target marker of this snap line. - *

- * If this is null, the location of the {@link yfiles.input.EdgeSegmentSnapLine#segmentTarget} is marked instead. - *

- * @type {yfiles.geometry.Point} - */ - targetMarker:yfiles.geometry.Point; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.EdgeSegmentSnapLine; - } - export enum SnapLineOrientation{ - /** - * Constant that describes a horizontal {@link yfiles.input.SnapLineOrientation orientation} of a snap line. - */ - HORIZONTAL, - /** - * Constant that describes a vertical {@link yfiles.input.SnapLineOrientation orientation} of a snap line. - */ - VERTICAL - } - export enum SnapLineSnapTypes{ - /** - * Describes snap lines to which nothing will snap. - */ - NONE, - /** - * Describes snap lines to which the top sides of rectangular elements will snap. - */ - TOP, - /** - * Describes snap lines to which the bottom sides of rectangular elements will snap. - */ - BOTTOM, - /** - * Describes snap lines to which the left sides of rectangular elements will snap. - */ - LEFT, - /** - * Describes snap lines to which the right sides of rectangular elements will snap. - */ - RIGHT, - /** - * Describes snap lines to which the center of elements will snap. - */ - CENTER, - /** - * Describes vertical snap lines - */ - VERTICAL, - /** - * Describes horizontal snap lines - */ - HORIZONTAL, - /** - * Describes snap lines to which all elements will snap at all sides - */ - ALL - } - /** - * A simple default implementation of an {@link yfiles.input.IPortCandidate}. - *

- * Subclasses need to override {@link yfiles.input.DefaultPortCandidate#createInstance} if they don't {@link yfiles.input.DefaultPortCandidate#setInstance set} a port instance. - *

- * @class - * @implements {yfiles.input.IPortCandidate} - */ - export interface DefaultPortCandidate extends yfiles.lang.Object,yfiles.input.IPortCandidate{} - export class DefaultPortCandidate { - /** - * Creates a candidate for the given owner that uses the graph's defaults for the port's style and a default parameter for - * the given model. - *

- * The {@link yfiles.input.DefaultPortCandidate#locationParameter} is set to the parameter that best matches the {@link yfiles.geometry.Point#ORIGIN origin} for the given model. - *

- * @param owner The owner. - * @param model The model. - */ - constructor(owner:yfiles.graph.IPortOwner,model:yfiles.graph.IPortLocationModel); - /** - * Creates a candidate for the given owner that uses the graph's defaults for the port's style and the given - * locationParameter. - *

- * If no locationParameter is given, the used candidate has a fixed location at {@link yfiles.geometry.Point#ORIGIN} that does not - * depend on the owner. - *

- * @param owner The owner. - * @param [locationParameter=null] The location. - * @param [validity=yfiles.input.PortCandidateValidity.VALID] The validity of the port candidate. - */ - constructor(owner:yfiles.graph.IPortOwner,locationParameter?:yfiles.graph.IPortLocationModelParameter,validity?:yfiles.input.PortCandidateValidity); - /** - * Creates a candidate for the given owner that uses the graph's defaults for the port's style and the given - * locationParameter. - *

- * If no locationParameter is given, the used candidate has a fixed location at {@link yfiles.geometry.Point#ORIGIN} that does not - * depend on the owner. - *

- * @param {Object} options The parameters to pass. - * @param options.owner The owner. - * @param [options.locationParameter=null] The location. - * @param [options.validity=yfiles.input.PortCandidateValidity.VALID] The validity of the port candidate. - */ - constructor(options:{owner:yfiles.graph.IPortOwner,locationParameter?:yfiles.graph.IPortLocationModelParameter,validity?:yfiles.input.PortCandidateValidity}); - /** - * Creates a candidate using the given port as the template. - * @param port The port to use. - */ - constructor(port:yfiles.graph.IPort); - /** - * Actually creates the {@link yfiles.graph.IPort} instance. - *

- * This method is called in response to a call to {@link yfiles.input.DefaultPortCandidate#createPort} on this instance and the - * instances created by {@link yfiles.input.DefaultPortCandidate#getPortCandidateAt}. - *

- * @param context The input mode context. - * @param graph The graph to add the port to. - * @param locationParameter The parameter to use. - * @param style The style to use. - * @param tag The tag to use. - * @returns The newly created port. - * @protected - */ - createInstance(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,locationParameter:yfiles.graph.IPortLocationModelParameter,style:yfiles.styles.IPortStyle,tag:any):yfiles.graph.IPort; - /** - * This implementation will throw a {@link yfiles.lang.Exception} if the validity is {@link yfiles.input.PortCandidateValidity#DYNAMIC}. - *

- * This implementation will delegate to the {@link yfiles.input.DefaultPortCandidate#createInstance} method. - *

- * @param context - * @returns - */ - createPort(context:yfiles.input.IInputModeContext):yfiles.graph.IPort; - /** - * Returns a candidate that is derived from this instance that best fits the provided location. - *

- * The returned implementation will finally call {@link yfiles.input.DefaultPortCandidate#createInstance} using the newly - * calculated {@link yfiles.input.DefaultPortCandidate#locationParameter}. - *

- * @param context The input mode context for which a concrete candidate is queried. - * @param location The location for which a candidate should be returned. - * @returns A {@link } implementation whose {@link #validity} is guaranteed to be non-{@link #DYNAMIC}. - * @see yfiles.input.DefaultPortCandidate#validity - */ - getPortCandidateAt(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):yfiles.input.IPortCandidate; - /** - * Sets the instance that will be returned by {@link yfiles.input.DefaultPortCandidate#port} and {@link yfiles.input.DefaultPortCandidate#createPort}. - * @param port A port that already exists in the graph or null. - */ - setInstance(port:yfiles.graph.IPort):void; - /** - * Gets or sets whether this candidate is a valid one depending on the context it has been obtained from. - * @default yfiles.input.PortCandidateValidity.VALID - * @type {yfiles.input.PortCandidateValidity} - */ - validity:yfiles.input.PortCandidateValidity; - /** - * Gets or set the tag for this candidate. - *

- * The interpretation of this value is implementation dependent and may be used for visual feedback or interactive - * behavior. - *

- * @default null - * @type {any} - */ - candidateTag:any; - /** - * Gets or sets the port tag to create the port with. - * @default null - * @type {any} - */ - portTag:any; - /** - * Gets or sets the model parameter that will be used for the {@link yfiles.graph.IPort#locationParameter} if this candidate is chosen. - *

- * The parameter which may not be null. - *

- * @type {yfiles.graph.IPortLocationModelParameter} - */ - locationParameter:yfiles.graph.IPortLocationModelParameter; - /** - * Gets or sets the model that will be used by this instance to determine the new {@link yfiles.input.DefaultPortCandidate#locationParameter} if the {@link yfiles.input.DefaultPortCandidate#getPortCandidateAt} - * is called and the {@link yfiles.input.DefaultPortCandidate#validity} is set to {@link yfiles.input.PortCandidateValidity#DYNAMIC}. - * @default null - * @type {yfiles.graph.IPortLocationModel} - */ - model:yfiles.graph.IPortLocationModel; - /** - * Gets or sets the style to use for the newly created port. - * @default null - * @type {yfiles.styles.IPortStyle} - */ - style:yfiles.styles.IPortStyle; - /** - * Gets or sets the owner of the port to be created. - * @type {yfiles.graph.IPortOwner} - */ - owner:yfiles.graph.IPortOwner; - /** - * Gets the instance provided to the constructor or to the {@link yfiles.input.DefaultPortCandidate#setInstance setter}. - * @see yfiles.input.DefaultPortCandidate#createPort - * @type {yfiles.graph.IPort} - */ - port:yfiles.graph.IPort; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.DefaultPortCandidate; - } - /** - * The {@link yfiles.input.IPositionHandler} implementation used in the context of {@link yfiles.graph.IGraph}s where there is a - * {@link yfiles.graph.IGraph#getChildren active hierarchy}. - *

- * This implementation delegates through to a simpler implementation that only deals with the geometric relocation of the - * node. In addition to that it finds the {@link yfiles.input.IReparentNodeHandler} from the {@link yfiles.input.IInputModeContext} to - * detect {@link yfiles.input.IReparentNodeHandler#isReparentGesture a reparenting gesture} by the user. If such a gesture is recognized, the node can be moved freely until a {@link yfiles.input.IReparentNodeHandler#isValidParent valid new parent node} - * is found. This implementation then temporarily sets that node as a new visual parent and highlight the node. When the - * gesture is finished, the {@link yfiles.input.IReparentNodeHandler#reparent} method is called to perform the actual reparenting. - *

- *

- * In order to customize this default behavior, subclasses of this type can be {@link yfiles.graph.NodeDecorator#positionHandlerDecorator decorated} to the - * {@link yfiles.graph.INode}s in the graph. - *

- * @class - * @implements {yfiles.input.IPositionHandler} - */ - export interface GroupingNodePositionHandler extends yfiles.lang.Object,yfiles.input.IPositionHandler{} - export class GroupingNodePositionHandler { - /** - * Initializes a new instance of the {@link yfiles.input.GroupingNodePositionHandler} class. - *

- * This implementation uses the provided wrappedHandler to delegate the handling of the node's {@link yfiles.graph.INode#layout} changes. - *

- * @param node The node to reposition. - * @param [wrappedHandler=null] The positionhandler to - */ - constructor(node:yfiles.graph.INode,wrappedHandler?:yfiles.input.IPositionHandler); - /** - * - * @param context - * @param originalLocation - */ - cancelDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; - /** - * - * @param context - * @param originalLocation - * @param newLocation - */ - dragFinished(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; - /** - * - * @param context - * @param originalLocation - * @param newLocation - */ - handleMove(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; - /** - * - * @param context - */ - initializeDrag(context:yfiles.input.IInputModeContext):void; - /** - * Sets a temporary visual parent for the node during reparenting. - *

- * This is used to show the grouping hierarchy level a node would end in after finishing the reparenting gesture. Override - * this method with an empty implementation to not change the z-order of the dragged node during the gesture. - *

- * @param context The current {@link }. - * @param node The node being reparented. - * @param parent The temporary parent for the node. - */ - setCurrentParent(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode,parent:yfiles.graph.INode):void; - /** - * Gets a view of the location of the item. - *

- * Delegates to the wrapped {@link yfiles.input.IPositionHandler}'s {@link yfiles.input.IDragHandler#location location}. - *

- * @type {yfiles.geometry.IPoint} - */ - location:yfiles.geometry.IPoint; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.GroupingNodePositionHandler; - } - /** - * Callback interface for instances that can create bends for a given edge and graph. - *

- * Implementations of this interface may be found in the {@link yfiles.graph.ILookup#lookup} of {@link yfiles.graph.IEdge} instances. This - * interface is used by {@link yfiles.input.GraphEditorInputMode} to create new bends for an edge as soon as the user performs the - * bend creation gesture. - *

- * @see yfiles.input.GraphEditorInputMode#onCreateBendInputModeBendCreated - * @interface - */ - export interface IBendCreator extends yfiles.lang.Object{ - /** - * Creates a bend at the given graph for the given edge at the position supplied. - * @param context The context for which the bend should be created. - * @param graph The graph, the edge belongs to. - * @param edge The edge. - * @param location The preferred coordinates of the bend. - * @returns The index of the bend in the edges' {@link #bends} or -1 if no bend has been created. - * @abstract - */ - createBend(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,location:yfiles.geometry.Point):number; - } - var IBendCreator:{ - /** - * A static instance that does not create any bends. - * @const - * @static - * @type {yfiles.input.IBendCreator} - */ - NO_BENDS?:yfiles.input.IBendCreator; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IBendCreator; - }; - /** - * Interface that can be used to find bends at specific locations in the canvas. - *

- * This interface is usually provided through the {@link yfiles.graph.ILookup#lookup} of {@link yfiles.graph.IEdge} implementations. - *

- * @interface - */ - export interface IBendSelectionTester extends yfiles.lang.Object{ - /** - * Returns the bends within the given rectangle. - * @param context The input mode context to use for querying the position. - * @param rectangle A rectangle in world coordinates. - * @returns The bends inside of rectangle. - * @abstract - */ - getBendsInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):yfiles.collections.IEnumerable; - /** - * Returns the bend at the given world coordinate position. - * @param context The input mode context to use for querying the position. - * @param location A location in world coordinates. - * @returns The bend at the position or null if there is no bend. - * @abstract - */ - getHitBend(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):yfiles.graph.IBend; - } - var IBendSelectionTester:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IBendSelectionTester; - }; - /** - * An interface that checks for containment of an {@link yfiles.graph.IBend} in 2D coordinate space. - *

- * This interface is used to determine which bends of edges that connect child nodes are moved when the parent node is - * moved. Therefore, special care has to be taken if you want to provide this interface in the node lookup for other purposes, as this - * can also affect implicit bend movement. - *

- * @interface - */ - export interface IContainsBendTester extends yfiles.lang.Object{ - /** - * Determines whether the provided bend is deemed to lie within the shape this test is implemented for. - *

- * This method is used to determine which bends of edges that connect child nodes are moved when the parent node is moved. - * If an implementation of {@link yfiles.input.IContainsBendTester} is present in the node's {@link yfiles.graph.ILookup#lookup}, this - * method is called with the bend and the bend will be moved together with the parent node iff true is returned. If no - * implemention is provided, only bends that lie inside the bounds of the parent node are moved. - *

- * @param context The input mode context to use. - * @param bend The bend to test - * @returns true iff the bend is contained within the shape. - * @abstract - */ - contains(context:yfiles.input.IInputModeContext,bend:yfiles.graph.IBend):boolean; - } - var IContainsBendTester:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IContainsBendTester; - }; - /** - * Interface that is used by the {@link yfiles.input.GraphSnapContext} for {@link yfiles.graph.INode nodes} to collect a number of - * {@link yfiles.input.SnapResult}s during the move/edit operation. - *

- * This interface is queried from the {@link yfiles.graph.ILookup} of the - * {@link yfiles.graph.INode}s that are being moved during the edit. - *

- * @see yfiles.input.GraphSnapContext - * @see yfiles.graph.NodeDecorator#nodeSnapResultProviderDecorator - * @interface - */ - export interface INodeSnapResultProvider extends yfiles.lang.Object{ - /** - * Called when a node is {@link yfiles.input.IDragHandler#handleMove dragged} to add {@link yfiles.input.SnapResult}s for - * {@link yfiles.input.OrthogonalSnapLine}s to which this node can potentially snap. - * @param context The snap context which manages the snap lines and the settings. - * @param evt The event argument to obtain the necessary information from and {@link #addSnapResult add results to}. - * @param suggestedLayout The {@link #layout layout} of the node if the node would not snap. - * @param node The node that is being moved. - * @abstract - */ - collectSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,suggestedLayout:yfiles.geometry.Rect,node:yfiles.graph.INode):void; - } - var INodeSnapResultProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.INodeSnapResultProvider; - }; - /** - * Interface for classes that help during snapping of parts of edges. - *

- * An implementation of this class is obtained from the lookup of the {@link yfiles.graph.IEdge}s which are being edited during an - * operation where {@link yfiles.input.GraphSnapContext graph snapping} is involved. - *

- * @see yfiles.graph.EdgeDecorator#edgeSnapResultProviderDecorator - * @interface - */ - export interface IEdgeSnapResultProvider extends yfiles.lang.Object{ - /** - * Called to during the snapping operation whenever {@link yfiles.input.SnapContext#addCollectSnapResultsListener snap results are collected}. - *

- * This method will be called for each collection of the results. - *

- * @param context The context that is using this instance. - * @param evt The event argument to obtain the necessary information from and {@link #addSnapResult add results to}. - * @param movementInfos The movement infos that describe the edge. - * @param edge The edge for which the {@link }s should be {@link #addSnapResult collected}. - * @abstract - */ - collectSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,movementInfos:yfiles.collections.IListEnumerable,edge:yfiles.graph.IEdge):void; - } - var IEdgeSnapResultProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IEdgeSnapResultProvider; - }; - /** - * Interface that is used by the {@link yfiles.input.GraphSnapContext} for {@link yfiles.graph.IBend bends} to collect a number of - * {@link yfiles.input.SnapResult}s during the move/edit operation. - *

- * This interface is queried from the {@link yfiles.graph.ILookup} of the - * {@link yfiles.graph.IBend}s that are being moved during the edit. - *

- * @see yfiles.input.GraphSnapContext - * @see yfiles.graph.BendDecorator#bendSnapResultProviderDecorator - * @interface - */ - export interface IBendSnapResultProvider extends yfiles.lang.Object{ - /** - * Called when a node is {@link yfiles.input.IDragHandler#handleMove dragged} to add {@link yfiles.input.SnapResult}s for - * {@link yfiles.input.OrthogonalSnapLine}s to which this bend can potentially snap. - * @param context The snap context which manages the snap lines and the settings. - * @param evt The event argument to obtain the necessary information from and {@link #addSnapResult add results to}. - * @param suggestedLocation The {@link #location location} of the bend if the bend would not snap. - * @param bend The bend that is being moved. - * @abstract - */ - collectSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,suggestedLocation:yfiles.geometry.Point,bend:yfiles.graph.IBend):void; - } - var IBendSnapResultProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IBendSnapResultProvider; - }; - /** - * Interface that is used by the {@link yfiles.input.GraphSnapContext} for {@link yfiles.graph.IPort port} to collect a number of - * {@link yfiles.input.SnapResult}s during the move/edit operation. - *

- * This interface is queried from the {@link yfiles.graph.ILookup} of the - * {@link yfiles.graph.IPort}s that are being moved during the edit. - *

- * @see yfiles.input.GraphSnapContext - * @see yfiles.graph.PortDecorator#portSnapResultProviderDecorator - * @interface - */ - export interface IPortSnapResultProvider extends yfiles.lang.Object{ - /** - * Called when a node is {@link yfiles.input.IDragHandler#handleMove dragged} to add {@link yfiles.input.SnapResult}s for - * {@link yfiles.input.OrthogonalSnapLine}s to which this bend can potentially snap. - * @param context The snap context which manages the snap lines and the settings. - * @param evt The event argument to obtain the necessary information from and {@link #addSnapResult add results to}. - * @param suggestedLocation The {@link #location location} of the bend if the bend would not snap. - * @param port The port that is being moved - * @abstract - */ - collectSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,suggestedLocation:yfiles.geometry.Point,port:yfiles.graph.IPort):void; - } - var IPortSnapResultProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IPortSnapResultProvider; - }; - /** - * Interface for an implementation which evaluates a list of given {@link yfiles.input.SnapLine}s for a node which is resized and - * adds a set of {@link yfiles.input.SnapResult}s for sizes to which this node can potentially snap. - * @interface - */ - export interface INodeReshapeSnapResultProvider extends yfiles.lang.Object{ - /** - * Called when a node's handle is {@link yfiles.input.IDragHandler#handleMove dragged} to add {@link yfiles.input.SnapResult}s for - * {@link yfiles.input.OrthogonalSnapLine}s or sizes to which this node can potentially snap during resizing. - * @param context The snap context which manages the snap lines and the settings. - * @param evt The event argument to obtain the context from and add the results to. - * @param node The node that is being reshaped. - * @param reshapeContext Carries information about the reshape operation. - * @abstract - */ - collectSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,reshapeContext:yfiles.input.ReshapeRectangleContext):void; - } - var INodeReshapeSnapResultProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.INodeReshapeSnapResultProvider; - }; - /** - * Helper class that carries information about a reshape operation. - *

- * This class is mainly intended for use by {@link yfiles.input.INodeReshapeSnapResultProvider#collectSnapResults}. - *

- * @class - * @final - */ - export interface ReshapeRectangleContext extends yfiles.lang.Object{} - export class ReshapeRectangleContext { - /** - * Initializes a new instance of the {@link yfiles.input.ReshapeRectangleContext} class. - * @param initialBounds The initial bounds of the node. - * @param minimumSize The minimum size of the node. - * @param maximumSize The maximum size of the node. - * @param minimumEnclosedArea The minimum area the node's layout needs to encompass. - * @param reshapePosition The position of the reshape handle. - * @param topLeftChangeFactor The factor by which the top left corner of the node layout changes when the handle is dragged. - * @param bottomRightChangeFactor The factor by which the bottom right corner of the node layout changes when the handle is dragged. - * @param sizeChangeFactor The factor by which the size of the node layout changes when the handle is dragged. - */ - constructor(initialBounds:yfiles.geometry.Rect,minimumSize:yfiles.geometry.ISize,maximumSize:yfiles.geometry.ISize,minimumEnclosedArea:yfiles.geometry.IRectangle,reshapePosition:yfiles.input.HandlePositions,topLeftChangeFactor:yfiles.geometry.Point,bottomRightChangeFactor:yfiles.geometry.Point,sizeChangeFactor:yfiles.geometry.Size); - /** - * Gets the initial bounds of the node. - * @type {yfiles.geometry.Rect} - */ - initialBounds:yfiles.geometry.Rect; - /** - * Gets the minimum size of the node. - * @type {yfiles.geometry.ISize} - */ - minimumSize:yfiles.geometry.ISize; - /** - * Gets or sets the maximum size of the node. - * @type {yfiles.geometry.ISize} - */ - maximumSize:yfiles.geometry.ISize; - /** - * Gets minimum area the node's layout needs to encompass - * @type {yfiles.geometry.IRectangle} - */ - minimumEnclosedArea:yfiles.geometry.IRectangle; - /** - * Gets the position of the reshape handle. - * @type {yfiles.input.HandlePositions} - */ - reshapePosition:yfiles.input.HandlePositions; - /** - * Gets the factor by which the top left corner of the node layout changes when the handle is dragged. - * @type {yfiles.geometry.Point} - */ - topLeftChangeFactor:yfiles.geometry.Point; - /** - * Gets the factor by which the bottom right corner of the node layout changes when the handle is dragged. - * @type {yfiles.geometry.Point} - */ - bottomRightChangeFactor:yfiles.geometry.Point; - /** - * Gets the factor by which the size of the node layout changes when the handle is dragged. - * @type {yfiles.geometry.Size} - */ - sizeChangeFactor:yfiles.geometry.Size; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.ReshapeRectangleContext; - } - /** - * An interface for possible {@link yfiles.graph.IPort} candidates used by {@link yfiles.input.IPortCandidateProvider} and the like. - *

- * Note that if an instance's {@link yfiles.input.IPortCandidate#validity} property is {@link yfiles.input.PortCandidateValidity#DYNAMIC} this instance {@link yfiles.input.IPortCandidate#getPortCandidateAt} - * method serves as a factory for the actual candidates. - *

- * @see yfiles.input.IEdgeReconnectionPortCandidateProvider - * @see yfiles.input.IPortCandidateProvider - * @see yfiles.input.DefaultPortCandidate - * @interface - */ - export interface IPortCandidate extends yfiles.lang.Object{ - /** - * If the client decides to use this port candidate, this method will serve as a factory to create the instance. - *

- * If this candidate wraps an existing port, it may return that {@link yfiles.input.IPortCandidate#port instance}. If this instance's {@link yfiles.input.IPortCandidate#validity} is {@link yfiles.input.PortCandidateValidity#DYNAMIC} - * this method may throw an {@link yfiles.lang.Exception}. - *

- * @param context The input mode context for which the port will be created. Implementations can depend on it providing an {@link } - * instance in the lookup of the instance. - * @returns The port instance to use if this candidate has been chosen. This method may not return null. - * @throws {Stubs.Exceptions.NotSupportedError} If the {@link yfiles.input.IPortCandidate#validity} is {@link yfiles.input.PortCandidateValidity#DYNAMIC}. - * @see yfiles.input.IInputModeContext#graph - * @see yfiles.input.IPortCandidate#port - * @see yfiles.input.IPortCandidate#getPortCandidateAt - * @abstract - */ - createPort(context:yfiles.input.IInputModeContext):yfiles.graph.IPort; - /** - * Returns a candidate that is derived from this instance that best fits the provided location. - *

- * This method needs to be called by clients if the {@link yfiles.input.IPortCandidate#validity} of this instance is {@link yfiles.input.PortCandidateValidity#DYNAMIC}. In - * that case calling this method must return an instance whose validity is not {@link yfiles.input.PortCandidateValidity#DYNAMIC}. - *

- * @param context The input mode context for which a concrete candidate is queried. - * @param location The location for which a candidate should be returned. - * @returns A {@link } implementation whose {@link #validity} is guaranteed to be non-{@link #DYNAMIC}. - * @see yfiles.input.IPortCandidate#validity - * @abstract - */ - getPortCandidateAt(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):yfiles.input.IPortCandidate; - /** - * Gets a user defined tag for this candidate. - *

- * The interpretation of this value is implementation dependent and may be used for visual feedback or interactive - * behavior. - *

- * @abstract - * @type {any} - */ - candidateTag:any; - /** - * Gets whether this instance is a valid port candidate. - *

- * Implementations of {@link yfiles.input.IPortCandidateProvider} may return sets of port candidates where some of them are marked - * as invalid e.g. in order to provide visual feedback. If the value is {@link yfiles.input.PortCandidateValidity#DYNAMIC}, method - * {@link yfiles.input.IPortCandidate#getPortCandidateAt} needs to be used to determine a concrete candidate instance. - *

- * @see yfiles.input.IPortCandidate#getPortCandidateAt - * @abstract - * @type {yfiles.input.PortCandidateValidity} - */ - validity:yfiles.input.PortCandidateValidity; - /** - * Gets the model parameter that will be used for the {@link yfiles.graph.IPort#locationParameter} if this candidate is chosen. - *

- * Note that the value of this property is undefined if this instance's {@link yfiles.input.IPortCandidate#validity} is {@link yfiles.input.PortCandidateValidity#DYNAMIC}. In - * this case, the parameter needs to be obtained via the {@link yfiles.input.IPortCandidate#getPortCandidateAt} instance. - *

- * @abstract - * @type {yfiles.graph.IPortLocationModelParameter} - */ - locationParameter:yfiles.graph.IPortLocationModelParameter; - /** - * Gets the possible owner of the port to be created for this candidate. - * @abstract - * @type {yfiles.graph.IPortOwner} - */ - owner:yfiles.graph.IPortOwner; - /** - * Gets the port instance that is already live in the graph if this candidate wraps an existing port or null otherwise. - * @see yfiles.input.IPortCandidate#createPort - * @abstract - * @type {yfiles.graph.IPort} - */ - port:yfiles.graph.IPort; - } - var IPortCandidate:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IPortCandidate; - }; - export enum PortCandidateValidity{ - /** - * The candidate is valid and can be used to connect an edge to. - */ - VALID, - /** - * The candidate should not be used to connect an edge to. - */ - INVALID, - /** - * The candidate cannot be used to create a port, instead {@link yfiles.input.IPortCandidate#getPortCandidateAt} needs to be called - * to obtain a {@link yfiles.input.IPortCandidate} that is either {@link yfiles.input.PortCandidateValidity#VALID} or - * {@link yfiles.input.PortCandidateValidity#INVALID}. - */ - DYNAMIC - } - /** - * This interface is used to provide {@link yfiles.input.IPortCandidate}s for a specific {@link yfiles.graph.IPortOwner}. - *

- * It is used in the context of the items that will later become the owner ({@link yfiles.graph.IPortOwner}) of the ports obtained - * from the candidates. They are mainly used during edge creation where there is no real edge yet (only the dummy edge) and - * thus they need to use the opposite {@link yfiles.input.IPortCandidate} to understand the context. - *

- *

- * Implementations of this interface may be queried using the {@link yfiles.graph.ILookup#lookup} method of {@link yfiles.graph.IPortOwner} - * implementations like {@link yfiles.graph.INode}. - *

- *

- * Note that this interface is similar to the interface {@link yfiles.input.IEdgeReconnectionPortCandidateProvider} in the sense - * that they will both provide {@link yfiles.input.IPortCandidate} instances in a certain query context. They are used in different - * query contexts, though. The two interfaces can come together in concrete implementations of - * {@link yfiles.input.IEdgeReconnectionPortCandidateProvider}: an edge could potentially be connected to ports at any given {@link yfiles.graph.IPortOwner} - * and thus the {@link yfiles.input.IPortCandidateProvider} interface can be queried from the respective {@link yfiles.graph.IPortOwner} - * that the edge will be reconnected to. - *

- *

Related demos:

- *
    - *
  • Demo: PortCandidateProvider, demo.yfiles.input.portcandidateprovider
  • - *
- * @see yfiles.graph.NodeDecorator#portCandidateProviderDecorator - * @interface - */ - export interface IPortCandidateProvider extends yfiles.lang.Object{ - /** - * Returns all port candidates that apply for the provided opposite port candidate. - *

- * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} port candidates. - *

- * @param target The opposite port candidate. - * @param context The context for which the candidates should be provided. - * @returns An enumerable over all port candidates that are associated with the given opposite port. - * @abstract - */ - getSourcePortCandidates(context:yfiles.input.IInputModeContext,target:yfiles.input.IPortCandidate):yfiles.collections.IEnumerable; - /** - * Returns all source port candidates that belong to the context of this provider. - *

- * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} port candidates. - *

- * @param context The context for which the candidates should be provided. - * @returns An enumerable over all source port candidates that are associated with the current context. - * @abstract - */ - getSourcePortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; - /** - * Returns all port candidates that apply for the provided opposite port candidate. - *

- * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} port candidates. - *

- * @param context The context for which the candidates should be provided. - * @param source The opposite port candidate. - * @returns An enumerable over all port candidates that are associated with the given opposite port. - * @abstract - */ - getTargetPortCandidates(context:yfiles.input.IInputModeContext,source:yfiles.input.IPortCandidate):yfiles.collections.IEnumerable; - /** - * Returns all target port candidates that belong to the context of this provider. - *

- * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} port candidates. - *

- * @param context The context for which the candidates should be provided. - * @returns An enumerable over all target port candidates that are associated with the current context. - * @abstract - */ - getTargetPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; - } - var IPortCandidateProvider:{ - /** - * Creates a generic composite implementation for the {@link yfiles.input.IPortCandidateProvider} interface. - * @param providers The providers to create the composite from. - * @returns - * @static - */ - combine?(...providers:yfiles.input.IPortCandidateProvider[]):yfiles.input.IPortCandidateProvider; - /** - * Creates a generic composite implementation for the {@link yfiles.input.IPortCandidateProvider} interface. - * @param providers The providers to create the composite from. - * @returns - * @static - */ - combine?(providers:yfiles.collections.IEnumerable):yfiles.input.IPortCandidateProvider; - /** - * Creates an implementation of an {@link yfiles.input.IPortCandidateProvider} that provides only the given port candidates. - * @param candidates The port candidates the provider should provide. - * @returns A new {@link }. - * @static - */ - fromCandidates?(...candidates:yfiles.input.IPortCandidate[]):yfiles.input.PortCandidateProviderBase; - /** - * Creates an implementation of an {@link yfiles.input.IPortCandidateProvider} that provides only the given port candidates. - * @param candidates The port candidates the provider should provide. - * @returns A new {@link }. - * @static - */ - fromCandidates?(candidates:yfiles.collections.IEnumerable):yfiles.input.PortCandidateProviderBase; - /** - * Creates an implementation of the {@link yfiles.input.IPortCandidateProvider} interface that returns the ports that exist in the - * given {@link yfiles.graph.IPortOwner#ports}'s {@link yfiles.graph.IPortOwner} collection. - * @param owner The owner of the port collection. - * @returns - * @static - */ - fromExistingPorts?(owner:yfiles.graph.IPortOwner):yfiles.input.IPortCandidateProvider; - /** - * Creates a trivial implementation of an {@link yfiles.input.IPortCandidateProvider} that always returns exactly one candidate - * that is centered at the node's {@link yfiles.graph.INode#layout}. - * @param node The node to get the layout's center from. - * @returns - * @static - */ - fromNodeCenter?(node:yfiles.graph.INode):yfiles.input.PortCandidateProviderBase; - /** - * Creates a simple implementation of an {@link yfiles.input.IPortCandidateProvider} that always returns a candidate that uses the - * default {@link yfiles.graph.IPortDefaults#locationParameter} for the corresponding {@link yfiles.graph.IPortDefaults}. - * @param owner - * @returns - * @static - */ - fromPortDefaults?(owner:yfiles.graph.IPortOwner):yfiles.input.IPortCandidateProvider; - /** - * Creates an implementation of {@link yfiles.input.IPortCandidateProvider} that works for {@link yfiles.graph.IPortOwner} implementations - * that have {@link yfiles.styles.IShapeGeometry} instances in their lookup. - * @param owner The owner to receive the shape geometry from - * @param minimumSegmentLength the minimum length a segment needs to have in order to be used to add port candidates. - * @param ratios A number of double values that are interpreted as ratio values between 0.0 and 1.0. If none are given, the provider - * inserts a port candidate at the center of each straight line segment. - * @param addExistingPortsEnabled determines whether {@link #addExistingPorts existing ports should be added to the list of ports}. - * @returns - * @static - */ - fromShapeGeometry?(owner:yfiles.graph.IPortOwner,addExistingPortsEnabled:boolean,minimumSegmentLength:number,...ratios:number[]):yfiles.input.PortCandidateProviderBase; - /** - * Creates an implementation of {@link yfiles.input.IPortCandidateProvider} that works for {@link yfiles.graph.IPortOwner} implementations - * that have {@link yfiles.styles.IShapeGeometry} instances in their lookup. - * @param owner The owner to receive the shape geometry from - * @param ratios A number of double values that are interpreted as ratio values between 0.0 and 1.0. If none are given, the provider - * inserts a port candidate at the center of each straight line segment. - * @returns - * @static - */ - fromShapeGeometry?(owner:yfiles.graph.IPortOwner,...ratios:number[]):yfiles.input.PortCandidateProviderBase; - /** - * Creates a simple implementation of an {@link yfiles.input.IPortCandidateProvider} that returns unoccupied ports at a given - * entity. - * @param owner The owner to query the ports from. - * @returns - * @static - */ - fromUnoccupiedPorts?(owner:yfiles.graph.IPortOwner):yfiles.input.IPortCandidateProvider; - /** - * A generic implementation of the {@link yfiles.input.IPortCandidateProvider} interface that provides no candidates. - * @const - * @static - * @type {yfiles.input.IPortCandidateProvider} - */ - NO_CANDIDATES?:yfiles.input.IPortCandidateProvider; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IPortCandidateProvider; - }; - /** - * This interface can be used to query {@link yfiles.input.IPortCandidate}s for a specific existing {@link yfiles.graph.IEdge} - *

- * As the name implies this is only used in the context of reconnecting existing edges. It is queried for existing edges to - * find out about possible alternative port candidates that given edge could connect to. It is used during gestures where - * an edge is reconnected to another port(candidate), i.e. when the source or target port handle of an edge is moved and - * the source or target port properties of the edge get set to the new {@link yfiles.input.IPortCandidate}s. - *

- *

- * Implementations of this interface can be queried using the {@link yfiles.graph.ILookup#lookup} method of an {@link yfiles.graph.IEdge} - * implementation. This interface provides alternative candidates for the {@link yfiles.graph.IEdge#sourcePort} or {@link yfiles.graph.IEdge#targetPort} of an edge. - *

- *

- * Note that this interface is similar to the interface {@link yfiles.input.IPortCandidateProvider} in the sense that they will - * both provide {@link yfiles.input.IPortCandidate} instances in a certain query context. They are used in different query - * contexts, though. The two interfaces can come together in concrete implementations of - * {@link yfiles.input.IEdgeReconnectionPortCandidateProvider}: an edge could potentially be connected to ports at any given {@link yfiles.graph.IPortOwner} - * and thus the {@link yfiles.input.IPortCandidateProvider} interface can be queried from the respective {@link yfiles.graph.IPortOwner} - * that the edge will be reconnected to. - *

- *

Related demos:

- *
    - *
  • Demo: EdgePortCandidateProvider, demo.yfiles.input.edgeportcandidateprovider
  • - *
- * @interface - */ - export interface IEdgeReconnectionPortCandidateProvider extends yfiles.lang.Object{ - /** - * Returns all source port candidates that may be used for the edge. - *

- * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} port candidates. - *

- * @param context The context for which the candidates should be provided. - * @returns An enumerable over all source port candidates that are associated with the current context edge. - * @abstract - */ - getSourcePortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; - /** - * Returns all source port candidates that may be used for the edge. - *

- * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} port candidates. - *

- * @param context The context for which the candidates should be provided. - * @returns An enumerable over all target port candidates that are associated with the current context edge. - * @abstract - */ - getTargetPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; - } - var IEdgeReconnectionPortCandidateProvider:{ - /** - * Creates an implementation of the {@link yfiles.input.IEdgeReconnectionPortCandidateProvider} interface that returns the - * candidates provided by the source and target port's owner's {@link yfiles.input.IPortCandidateProvider} implementations or the - * existing edge's port, if no such provider is registered. - *

- * This instance uses the lookup mechanism of the nodes to query the providers. - *

- * @param edge - * @returns - * @static - */ - fromSourceAndTarget?(edge:yfiles.graph.IEdge):yfiles.input.IEdgeReconnectionPortCandidateProvider; - /** - * Creates an implementation of the {@link yfiles.input.IEdgeReconnectionPortCandidateProvider} interface that returns a union of - * all {@link yfiles.input.IPortCandidateProvider#getSourcePortCandidates source port candidates} or {@link yfiles.input.IPortCandidateProvider#getTargetPortCandidates target port candidates}, respectively, of nodes in the graph. - *

- * This implementation can be used to allow for {@link yfiles.input.PortRelocationHandle relocating an edge's port} to any available source or target port in the - * graph. - *

- * @const - * @static - * @type {yfiles.input.IEdgeReconnectionPortCandidateProvider} - */ - ALL_NODE_CANDIDATES?:yfiles.input.IEdgeReconnectionPortCandidateProvider; - /** - * Creates an implementation of the {@link yfiles.input.IEdgeReconnectionPortCandidateProvider} interface that returns a union of - * all {@link yfiles.input.IPortCandidateProvider#getSourcePortCandidates source port candidates} or {@link yfiles.input.IPortCandidateProvider#getTargetPortCandidates target port candidates}, respectively, of nodse and edges in the graph. - *

- * This implementation can be used to allow for {@link yfiles.input.PortRelocationHandle relocating an edge's port} to any available source or target port in the - * graph. - *

- * @const - * @static - * @type {yfiles.input.IEdgeReconnectionPortCandidateProvider} - */ - ALL_NODE_AND_EDGE_CANDIDATES?:yfiles.input.IEdgeReconnectionPortCandidateProvider; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IEdgeReconnectionPortCandidateProvider; - }; - /** - * Interface that can be used to find ports at specific locations in the canvas. - *

- * This interface is mostly provided through the {@link yfiles.graph.ILookup#lookup} of {@link yfiles.graph.IPortOwner} implementations - * such as {@link yfiles.graph.INode}. - *

- * @interface - */ - export interface IPortSelectionTester extends yfiles.lang.Object{ - /** - * Returns the port at the given world coordinate position or null if there is no such port. - * @param context The input mode context to use for querying the position. - * @param location The coordinates of the position in the world coordinate system. - * @returns The port at the position or null. - * @abstract - */ - getHitPort(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):yfiles.graph.IPort; - /** - * Returns the ports for the given marquee rectangle. - * @param context The input mode context to use for querying the position. - * @param rectangle The marquee selection box in the world coordinate system. - * @returns An enumerable over the ports inside the marquee selection box. - * @abstract - */ - getPortsInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):yfiles.collections.IEnumerable; - } - var IPortSelectionTester:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IPortSelectionTester; - }; - /** - * Interface for implementations that yield insets for a given {@link yfiles.graph.INode}. - *

- * Implementations of this interface will be queried from an {@link yfiles.graph.INode}'s {@link yfiles.graph.ILookup#lookup} method. The - * default implementation of a graph uses this instance by default to determine the insets of a group node. - *

- * @interface - */ - export interface INodeInsetsProvider extends yfiles.lang.Object{ - /** - * Returns the insets for the given node. - * @param node The node to yield insets for. - * @returns The insets for the node. - * @abstract - */ - getInsets(node:yfiles.graph.INode):yfiles.geometry.Insets; - } - var INodeInsetsProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.INodeInsetsProvider; - }; - /** - * Base interface for a command that can be executed. - *

- * Implementations of this interface are provided by the library. Use {@link yfiles.input.ICommand#createCommand} to conveniently - * create your own implementation of this interface that can then be used with AddCommandBinding. - *

- * @see yfiles.input.ICommand#createCommand - * @interface - */ - export interface ICommand extends yfiles.lang.Object{ - /** - * Determines whether this command be executed with respect to the given parameter and target. - * @param [parameter=null] The parameter or null - * @param [target=null] The target to execute the command on or null - * @returns Whether {@link #execute} can be called with the given parameter and target. - * @abstract - */ - canExecute(parameter?:any,target?:any):boolean; - /** - * Determines whether this command be executed with respect to the given parameter and target. - * @param {Object} options The parameters to pass. - * @param [options.parameter=null] The parameter or null - * @param [options.target=null] The target to execute the command on or null - * @returns Whether {@link #execute} can be called with the given parameter and target. - * @abstract - */ - canExecute(options:{parameter?:Object,target?:Object}):boolean; - /** - * Executes this command with respect to the given parameter and target. - * @param [parameter=null] The parameter or null - * @param [target=null] The target to execute the command on or null - * @abstract - */ - execute(parameter?:any,target?:any):void; - /** - * Executes this command with respect to the given parameter and target. - * @param {Object} options The parameters to pass. - * @param [options.parameter=null] The parameter or null - * @param [options.target=null] The target to execute the command on or null - * @abstract - */ - execute(options:{parameter?:Object,target?:Object}):void; - /** - * Adds the given listener for the CanExecuteChanged event that occurs when the result of a call to {@link yfiles.input.ICommand#canExecute} - * may yield a different result. - * @param listener The listener to add. - * @see yfiles.input.ICommand#removeCanExecuteChangedListener - * @abstract - */ - addCanExecuteChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the CanExecuteChanged event that occurs when the result of a call to {@link yfiles.input.ICommand#canExecute} - * may yield a different result. - * @param listener The listener to remove. - * @see yfiles.input.ICommand#addCanExecuteChangedListener - * @abstract - */ - removeCanExecuteChangedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - } - var ICommand:{ - /** - * Creates a new {@link yfiles.input.ICommand} instance that does nothing. - *

- * The return value serves as a token and does not in itself contain any command handling logic. Use to associate command - * handlers with the instance returned. - *

- * @param [name=null] The optional name for the command. - * @returns A new {@link } instance. - * @static - */ - createCommand?(name?:string):yfiles.input.ICommand; - /** - * Suggests a requery of the {@link Root.UO#canExecute executability} of all routed commands that are known to the system to adjust the UI to properly - * reflect the state. - *

- * This will enqueue a delayed query into the event queue. - *

- * @static - */ - invalidateRequerySuggested?():void; - /** - * An {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to select the item that is - * specified by the parameter. - * @const - * @static - * @type {yfiles.input.ICommand} - */ - SELECT_ITEM?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to toggle the selection state - * of the item that is specified by the parameter. - * @const - * @static - * @type {yfiles.input.ICommand} - */ - TOGGLE_ITEM_SELECTION?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to deselect the item that is - * specified by the parameter. - * @const - * @static - * @type {yfiles.input.ICommand} - */ - DESELECT_ITEM?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to {@link yfiles.input.GraphEditorInputMode#editLabel edit the label} that is - * specified by the parameter. - *

- * If no parameter is set, this will trigger the {@link yfiles.input.GraphEditorInputMode#onEditLabel} if {@link yfiles.input.GraphEditorInputMode} - * is used. - *

- * @const - * @static - * @type {yfiles.input.ICommand} - */ - EDIT_LABEL?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to {@link yfiles.input.GraphEditorInputMode#addLabel add another label} to the {@link yfiles.graph.ILabelOwner} - * that is specified by the parameter. - *

- * If no parameter is set, this will trigger the {@link yfiles.input.GraphEditorInputMode#onAddLabel} if {@link yfiles.input.GraphEditorInputMode} - * is used. - *

- * @const - * @static - * @type {yfiles.input.ICommand} - */ - ADD_LABEL?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to - * {@link yfiles.input.GraphEditorInputMode#groupSelection group the currently selected items}. - * @const - * @static - * @type {yfiles.input.ICommand} - */ - GROUP_SELECTION?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to - * {@link yfiles.input.GraphEditorInputMode#adjustGroupNodeSize adjust the size of the selected group nodes}. - *

- * The default keyboard binding for this command is ctrl-shift-G. - *

- * @const - * @static - * @type {yfiles.input.ICommand} - */ - ADJUST_GROUP_NODE_SIZE?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to - * {@link yfiles.input.GraphEditorInputMode#ungroupSelection ungroup the currently selected items}. - * @const - * @static - * @type {yfiles.input.ICommand} - */ - UNGROUP_SELECTION?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to {@link yfiles.view.ISelectionModel.#clear clear the selection}. - * @const - * @static - * @type {yfiles.input.ICommand} - */ - DESELECT_ALL?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to {@link yfiles.input.NavigationInputMode#expandGroup expand} group nodes. - *

- * If the parameter to this command is null, the currently selected group nodes are expanded. If the parameter is an {@link yfiles.graph.INode} - * instance, that node will be expanded. If the parameter is an {@link yfiles.collections.IEnumerable.} instance, then all group nodes in that enumeration are - * expanded. - *

- * @const - * @static - * @type {yfiles.input.ICommand} - */ - EXPAND_GROUP?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to {@link yfiles.input.NavigationInputMode#collapseGroup collapse} group nodes. - *

- * If the parameter to this command is null, the currently selected group nodes are collapsed. If the parameter is an {@link yfiles.graph.INode} - * instance, that group node will be collapsed. If the parameter is an {@link yfiles.collections.IEnumerable.} instance, then all group nodes in that enumeration - * are collapsed. - *

- * @const - * @static - * @type {yfiles.input.ICommand} - */ - COLLAPSE_GROUP?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to {@link yfiles.input.NavigationInputMode#toggleExpansionState toggle} the - * collapsed/expanded state of currently selected group nodes. - *

- * If the parameter to this command is null, the currently selected group nodes are toggled. If the parameter is an {@link yfiles.graph.INode} - * instance, that group node will be toggled. If the parameter is an {@link yfiles.collections.IEnumerable.} instance, then all group nodes in that enumeration - * are toggled. - *

- * @const - * @static - * @type {yfiles.input.ICommand} - */ - TOGGLE_EXPANSION_STATE?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to {@link yfiles.graph.IFoldingView#localRoot switch the local root} of the - * current {@link yfiles.graph.IFoldingView} view to the given group node. - * @const - * @static - * @type {yfiles.input.ICommand} - */ - ENTER_GROUP?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to {@link yfiles.graph.IFoldingView#localRoot exit the current local root} - * of the current {@link yfiles.graph.IFoldingView} view to the given parent view. - * @const - * @static - * @type {yfiles.input.ICommand} - */ - EXIT_GROUP?:yfiles.input.ICommand; - /** - * This is an {@link yfiles.input.ICommand} that {@link yfiles.input.CreateEdgeInputMode} instances can execute if they have been {@link yfiles.input.IInputMode#install installed} - * in a {@link yfiles.view.CanvasComponent}. - *

- * If this command gets executed, the parameter is inspected to see if it is set to either an {@link yfiles.input.IPortCandidate}, - * an {@link yfiles.graph.IPort}, or an {@link yfiles.graph.INode} that is an element in the currently edited graph instance. If so, method - * {@link yfiles.input.CreateEdgeInputMode#doStartEdgeCreation} will be invoked and the user can finish the edge creation gesture. - *

- * @const - * @static - * @type {yfiles.input.ICommand} - */ - BEGIN_EDGE_CREATION?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to {@link yfiles.graph.GraphClipboard#duplicate duplicate items} of the - * current {@link yfiles.graph.IGraph}. - * @const - * @static - * @type {yfiles.input.ICommand} - */ - DUPLICATE?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} that reverses the direction of edges. - *

- * {@link yfiles.input.GraphEditorInputMode} can execute this command if it is installed in a {@link yfiles.view.GraphComponent}. The parameter - * specifies the edges to be reversed and can be an {@link yfiles.graph.IEdge}, an {@link yfiles.collections.IEnumerable. IEnumerable<IEdge>} or null. If the parameter is - * null the currently selected edges will be reversed. - *

- * @see yfiles.input.GraphEditorInputMode#reverseEdges - * @const - * @static - * @type {yfiles.input.ICommand} - */ - REVERSE_EDGE?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to print. - *

- * This command is not necessarily handled by yFiles. Application writers can handle the command in a manner that makes - * sense in the context of the application, e.g. printing the currently visible portion of the graph. - *

- *

- * The default shortcut for this command is Ctrl+P. - *

- * @see yfiles.input.ICommand#PRINT_PREVIEW - * @const - * @static - * @type {yfiles.input.ICommand} - */ - PRINT?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to close a document. - *

- * This command is not necessarily handled by yFiles. Application writers can handle the command in a manner that makes - * sense in the context of the application, e.g. closing the current window. - *

- *

- * There is no default shortcut for this command. - *

- * @const - * @static - * @type {yfiles.input.ICommand} - */ - CLOSE?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to open help. - *

- * This command is not necessarily handled by yFiles. Application writers can handle the command in a manner that makes - * sense in the context of the application, e.g. showing the online help. - *

- *

- * The default shortcut for this command is F1. - *

- * @const - * @static - * @type {yfiles.input.ICommand} - */ - HELP?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to show properties of an item. - *

- * This command is not necessarily handled by yFiles. Application writers can handle the command in a manner that makes - * sense in the context of the application. - *

- *

- * There is no default shortcut for this command. - *

- * @const - * @static - * @type {yfiles.input.ICommand} - */ - PROPERTIES?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to create a new document. - *

- * This command is not necessarily handled by yFiles. Application writers can handle the command in a manner that makes - * sense in the context of the application, e.g. creating a new graph. - *

- *

- * The default shortcut for this command is Ctrl+N. - *

- * @const - * @static - * @type {yfiles.input.ICommand} - */ - NEW?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to open a document. - *

- * {@link yfiles.view.GraphComponent} handles this command to open a dialog prompting to open a GraphML file. - *

- *

- * The default shortcut for this command is Ctrl+O. - *

- * @see yfiles.input.ICommand#SAVE - * @const - * @static - * @type {yfiles.input.ICommand} - */ - OPEN?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to select all items. - *

- * {@link yfiles.input.GraphEditorInputMode} and {@link yfiles.input.GraphViewerInputMode} handle this command to select all items in the - * graph. - *

- *

- * The default shortcut for this command is Ctrl+A. - *

- * @const - * @static - * @type {yfiles.input.ICommand} - */ - SELECT_ALL?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to delete an item. - *

- * {@link yfiles.input.GraphEditorInputMode} handles this command to delete the currently selected items. - *

- *

- * The default shortcut for this command is Del. - *

- * @const - * @static - * @type {yfiles.input.ICommand} - */ - DELETE?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to save an item. - *

- * {@link yfiles.view.GraphComponent} handles this command to open a dialog prompting to save the graph as a GraphML file, if the - * graph was never saved before, and simply saving to the previous file name if it was. - *

- *

- * The default shortcut for this command is Ctrl+S. - *

- * @see yfiles.input.ICommand#OPEN - * @const - * @static - * @type {yfiles.input.ICommand} - */ - SAVE?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to cut an item and place it in the clipboard. - *

- * {@link yfiles.input.GraphEditorInputMode} handles this command in conjunction with {@link yfiles.graph.GraphClipboard}. - *

- *

- * The default shortcuts for this command are Ctrl+X and Shift+Del. - *

- * @see yfiles.input.ICommand#COPY - * @see yfiles.input.ICommand#PASTE - * @const - * @static - * @type {yfiles.input.ICommand} - */ - CUT?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to copy to the clipboard. - *

- * {@link yfiles.input.GraphViewerInputMode} and {@link yfiles.input.GraphEditorInputMode} handle this command in conjunction with - * {@link yfiles.graph.GraphClipboard}. - *

- *

- * The default shortcuts for this command are Ctrl+C and Ctrl+Ins. - *

- * @see yfiles.input.ICommand#CUT - * @see yfiles.input.ICommand#PASTE - * @const - * @static - * @type {yfiles.input.ICommand} - */ - COPY?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to paste from the clipboard. - *

- * {@link yfiles.input.GraphEditorInputMode} handles this command in conjunction with {@link yfiles.graph.GraphClipboard}. The command - * parameter can be an {@link yfiles.geometry.IPoint} to specify a location for pasting. - *

- *

- * The default shortcuts for this command are Ctrl+V and Shift+Ins. - *

- * @see yfiles.input.ICommand#CUT - * @see yfiles.input.ICommand#COPY - * @const - * @static - * @type {yfiles.input.ICommand} - */ - PASTE?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to undo the previous operation. - *

- * {@link yfiles.input.GraphEditorInputMode} handles this command in conjunction with {@link yfiles.graph.UndoEngine}. - *

- *

- * The default shortcut for this command is Ctrl+Z. - *

- * @see yfiles.input.ICommand#REDO - * @const - * @static - * @type {yfiles.input.ICommand} - */ - UNDO?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to redo a previously undone operation. - *

- * {@link yfiles.input.GraphEditorInputMode} handles this command in conjunction with {@link yfiles.graph.UndoEngine}. - *

- *

- * The default shortcut for this command is Ctrl+Y. - *

- * @see yfiles.input.ICommand#UNDO - * @const - * @static - * @type {yfiles.input.ICommand} - */ - REDO?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} that indicates the intention to print and show a preview of what to print beforehand. - *

- * This command is not necessarily handled by yFiles. Application writers can handle the command in a manner that makes - * sense in the context of the application. - *

- *

- * The default shortcut for this command is Ctrl+F2. - *

- * @see yfiles.input.ICommand#PRINT - * @const - * @static - * @type {yfiles.input.ICommand} - */ - PRINT_PREVIEW?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to scroll up. - *

- * {@link yfiles.view.CanvasComponent} handles this command to move the viewport upwards. By default this is done by a full - * viewport height. The parameter can be a factor that is applied to the viewport height to move the viewport by a - * different amount. - *

- *

- * The default shortcut for this command is Page Up. - *

- * @see yfiles.input.ICommand#SCROLL_PAGE_DOWN - * @see yfiles.input.ICommand#SCROLL_PAGE_LEFT - * @see yfiles.input.ICommand#SCROLL_PAGE_RIGHT - * @const - * @static - * @type {yfiles.input.ICommand} - */ - SCROLL_PAGE_UP?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to scroll down. - *

- * {@link yfiles.view.CanvasComponent} handles this command to move the viewport downwards. By default this is done by a full - * viewport height. The parameter can be a factor that is applied to the viewport height to move the viewport by a - * different amount. - *

- *

- * The default shortcut for this command is Page Down. - *

- * @see yfiles.input.ICommand#SCROLL_PAGE_UP - * @see yfiles.input.ICommand#SCROLL_PAGE_LEFT - * @see yfiles.input.ICommand#SCROLL_PAGE_RIGHT - * @const - * @static - * @type {yfiles.input.ICommand} - */ - SCROLL_PAGE_DOWN?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to scroll left. - *

- * {@link yfiles.view.CanvasComponent} handles this command to move the viewport to the left. By default this is done by a full - * viewport width. The parameter can be a factor that is applied to the viewport width to move the viewport by a different - * amount. - *

- *

- * There is no default shortcut for this command. - *

- * @see yfiles.input.ICommand#SCROLL_PAGE_UP - * @see yfiles.input.ICommand#SCROLL_PAGE_DOWN - * @see yfiles.input.ICommand#SCROLL_PAGE_RIGHT - * @const - * @static - * @type {yfiles.input.ICommand} - */ - SCROLL_PAGE_LEFT?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to scroll right. - *

- * {@link yfiles.view.CanvasComponent} handles this command to move the viewport to the right. By default this is done by a full - * viewport width. The parameter can be a factor that is applied to the viewport width to move the viewport by a different - * amount. - *

- *

- * There is no default shortcut for this command. - *

- * @see yfiles.input.ICommand#SCROLL_PAGE_UP - * @see yfiles.input.ICommand#SCROLL_PAGE_DOWN - * @see yfiles.input.ICommand#SCROLL_PAGE_LEFT - * @const - * @static - * @type {yfiles.input.ICommand} - */ - SCROLL_PAGE_RIGHT?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to move the selection left. - *

- * {@link yfiles.input.NavigationInputMode} handles this command to select the next item to the left. - *

- *

- * The default shortcut for this command is Arrow Left. - *

- * @see yfiles.input.ICommand#MOVE_UP - * @see yfiles.input.ICommand#MOVE_DOWN - * @see yfiles.input.ICommand#MOVE_RIGHT - * @see yfiles.input.ICommand#MOVE_TO_PAGE_UP - * @see yfiles.input.ICommand#MOVE_TO_PAGE_DOWN - * @const - * @static - * @type {yfiles.input.ICommand} - */ - MOVE_LEFT?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to move the selection right. - *

- * {@link yfiles.input.NavigationInputMode} handles this command to select the next item to the right. - *

- *

- * The default shortcut for this command is Arrow Right. - *

- * @see yfiles.input.ICommand#MOVE_UP - * @see yfiles.input.ICommand#MOVE_DOWN - * @see yfiles.input.ICommand#MOVE_LEFT - * @see yfiles.input.ICommand#MOVE_TO_PAGE_UP - * @see yfiles.input.ICommand#MOVE_TO_PAGE_DOWN - * @const - * @static - * @type {yfiles.input.ICommand} - */ - MOVE_RIGHT?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to move the selection up. - *

- * {@link yfiles.input.NavigationInputMode} handles this command to select the next item above. - *

- *

- * The default shortcut for this command is Arrow Up. - *

- * @see yfiles.input.ICommand#MOVE_DOWN - * @see yfiles.input.ICommand#MOVE_LEFT - * @see yfiles.input.ICommand#MOVE_RIGHT - * @see yfiles.input.ICommand#MOVE_TO_PAGE_UP - * @see yfiles.input.ICommand#MOVE_TO_PAGE_DOWN - * @const - * @static - * @type {yfiles.input.ICommand} - */ - MOVE_UP?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to move the selection down. - *

- * {@link yfiles.input.NavigationInputMode} handles this command to select the next item below. - *

- *

- * The default shortcut for this command is Arrow Down. - *

- * @see yfiles.input.ICommand#MOVE_UP - * @see yfiles.input.ICommand#MOVE_LEFT - * @see yfiles.input.ICommand#MOVE_RIGHT - * @see yfiles.input.ICommand#MOVE_TO_PAGE_UP - * @see yfiles.input.ICommand#MOVE_TO_PAGE_DOWN - * @const - * @static - * @type {yfiles.input.ICommand} - */ - MOVE_DOWN?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to move the selection up a page. - *

- * {@link yfiles.input.NavigationInputMode} handles this command to select the parent node, if possible. - *

- *

- * The default shortcut for this command is Page Up. - *

- * @see yfiles.input.ICommand#MOVE_UP - * @see yfiles.input.ICommand#MOVE_DOWN - * @see yfiles.input.ICommand#MOVE_LEFT - * @see yfiles.input.ICommand#MOVE_RIGHT - * @see yfiles.input.ICommand#MOVE_TO_PAGE_DOWN - * @const - * @static - * @type {yfiles.input.ICommand} - */ - MOVE_TO_PAGE_UP?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to move the selection down a page. - *

- * {@link yfiles.input.NavigationInputMode} handles this command to select the first child node, if possible. - *

- *

- * The default shortcut for this command is Page Down. - *

- * @see yfiles.input.ICommand#MOVE_UP - * @see yfiles.input.ICommand#MOVE_DOWN - * @see yfiles.input.ICommand#MOVE_LEFT - * @see yfiles.input.ICommand#MOVE_RIGHT - * @see yfiles.input.ICommand#MOVE_TO_PAGE_UP - * @const - * @static - * @type {yfiles.input.ICommand} - */ - MOVE_TO_PAGE_DOWN?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to move the focus backwards. - *

- * {@link yfiles.input.NavigationInputMode} handles this command to focus the next item to the left. - *

- *

- * The default shortcut for this command is Ctrl+Arrow Left. - *

- * @see yfiles.input.ICommand#MOVE_FOCUS_FORWARD - * @see yfiles.input.ICommand#MOVE_FOCUS_UP - * @see yfiles.input.ICommand#MOVE_FOCUS_DOWN - * @see yfiles.input.ICommand#MOVE_FOCUS_PAGE_UP - * @see yfiles.input.ICommand#MOVE_FOCUS_PAGE_DOWN - * @const - * @static - * @type {yfiles.input.ICommand} - */ - MOVE_FOCUS_BACK?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to move the focus forwards. - *

- * {@link yfiles.input.NavigationInputMode} handles this command to focus the next item to the right. - *

- *

- * The default shortcut for this command is Ctrl+Arrow Right. - *

- * @see yfiles.input.ICommand#MOVE_FOCUS_BACK - * @see yfiles.input.ICommand#MOVE_FOCUS_UP - * @see yfiles.input.ICommand#MOVE_FOCUS_DOWN - * @see yfiles.input.ICommand#MOVE_FOCUS_PAGE_UP - * @see yfiles.input.ICommand#MOVE_FOCUS_PAGE_DOWN - * @const - * @static - * @type {yfiles.input.ICommand} - */ - MOVE_FOCUS_FORWARD?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to move the focus upwards. - *

- * {@link yfiles.input.NavigationInputMode} handles this command to focus the next item above. - *

- *

- * The default shortcut for this command is Ctrl+Arrow Up. - *

- * @see yfiles.input.ICommand#MOVE_FOCUS_BACK - * @see yfiles.input.ICommand#MOVE_FOCUS_FORWARD - * @see yfiles.input.ICommand#MOVE_FOCUS_DOWN - * @see yfiles.input.ICommand#MOVE_FOCUS_PAGE_UP - * @see yfiles.input.ICommand#MOVE_FOCUS_PAGE_DOWN - * @const - * @static - * @type {yfiles.input.ICommand} - */ - MOVE_FOCUS_UP?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to move the focus downwards. - *

- * {@link yfiles.input.NavigationInputMode} handles this command to focus the next item below. - *

- *

- * The default shortcut for this command is Ctrl+Arrow Down. - *

- * @see yfiles.input.ICommand#MOVE_FOCUS_BACK - * @see yfiles.input.ICommand#MOVE_FOCUS_FORWARD - * @see yfiles.input.ICommand#MOVE_FOCUS_UP - * @see yfiles.input.ICommand#MOVE_FOCUS_PAGE_UP - * @see yfiles.input.ICommand#MOVE_FOCUS_PAGE_DOWN - * @const - * @static - * @type {yfiles.input.ICommand} - */ - MOVE_FOCUS_DOWN?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to move the focus up a page. - *

- * {@link yfiles.input.NavigationInputMode} handles this command to focus the parent node, if possible. - *

- *

- * The default shortcut for this command is Ctrl+Page Up. - *

- * @see yfiles.input.ICommand#MOVE_FOCUS_BACK - * @see yfiles.input.ICommand#MOVE_FOCUS_FORWARD - * @see yfiles.input.ICommand#MOVE_FOCUS_UP - * @see yfiles.input.ICommand#MOVE_FOCUS_DOWN - * @see yfiles.input.ICommand#MOVE_FOCUS_PAGE_DOWN - * @const - * @static - * @type {yfiles.input.ICommand} - */ - MOVE_FOCUS_PAGE_UP?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to move the focus up a page. - *

- * {@link yfiles.input.NavigationInputMode} handles this command to focus the first child node, if possible. - *

- *

- * The default shortcut for this command is Ctrl+Page Down. - *

- * @see yfiles.input.ICommand#MOVE_FOCUS_BACK - * @see yfiles.input.ICommand#MOVE_FOCUS_FORWARD - * @see yfiles.input.ICommand#MOVE_FOCUS_UP - * @see yfiles.input.ICommand#MOVE_FOCUS_DOWN - * @see yfiles.input.ICommand#MOVE_FOCUS_PAGE_UP - * @const - * @static - * @type {yfiles.input.ICommand} - */ - MOVE_FOCUS_PAGE_DOWN?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to extend the selection to the left. - *

- * {@link yfiles.input.NavigationInputMode} handles this command to extend the selection with the next item to the left. - *

- *

- * The default shortcut for this command is Shift+Arrow Left. - *

- * @see yfiles.input.ICommand#EXTEND_SELECTION_UP - * @see yfiles.input.ICommand#EXTEND_SELECTION_DOWN - * @see yfiles.input.ICommand#EXTEND_SELECTION_RIGHT - * @see yfiles.input.ICommand#SELECT_TO_PAGE_UP - * @see yfiles.input.ICommand#SELECT_TO_PAGE_DOWN - * @const - * @static - * @type {yfiles.input.ICommand} - */ - EXTEND_SELECTION_LEFT?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to extend the selection to the right. - *

- * {@link yfiles.input.NavigationInputMode} handles this command to extend the selection with the next item to the right. - *

- *

- * The default shortcut for this command is Shift+Arrow Right. - *

- * @see yfiles.input.ICommand#EXTEND_SELECTION_UP - * @see yfiles.input.ICommand#EXTEND_SELECTION_DOWN - * @see yfiles.input.ICommand#EXTEND_SELECTION_LEFT - * @see yfiles.input.ICommand#SELECT_TO_PAGE_UP - * @see yfiles.input.ICommand#SELECT_TO_PAGE_DOWN - * @const - * @static - * @type {yfiles.input.ICommand} - */ - EXTEND_SELECTION_RIGHT?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to extend the selection upwards. - *

- * {@link yfiles.input.NavigationInputMode} handles this command to extend the selection with the next item above. - *

- *

- * The default shortcut for this command is Shift+Arrow Up. - *

- * @see yfiles.input.ICommand#EXTEND_SELECTION_DOWN - * @see yfiles.input.ICommand#EXTEND_SELECTION_LEFT - * @see yfiles.input.ICommand#EXTEND_SELECTION_RIGHT - * @see yfiles.input.ICommand#SELECT_TO_PAGE_UP - * @see yfiles.input.ICommand#SELECT_TO_PAGE_DOWN - * @const - * @static - * @type {yfiles.input.ICommand} - */ - EXTEND_SELECTION_UP?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to extend the selection downwards. - *

- * {@link yfiles.input.NavigationInputMode} handles this command to extend the selection with the next item below. - *

- *

- * The default shortcut for this command is Shift+Arrow Down. - *

- * @see yfiles.input.ICommand#EXTEND_SELECTION_UP - * @see yfiles.input.ICommand#EXTEND_SELECTION_LEFT - * @see yfiles.input.ICommand#EXTEND_SELECTION_RIGHT - * @see yfiles.input.ICommand#SELECT_TO_PAGE_UP - * @see yfiles.input.ICommand#SELECT_TO_PAGE_DOWN - * @const - * @static - * @type {yfiles.input.ICommand} - */ - EXTEND_SELECTION_DOWN?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to extend the selection a page upwards. - *

- * {@link yfiles.input.NavigationInputMode} handles this command to extend the selection with the parent node, if possible. - *

- *

- * The default shortcut for this command is Shift+Page Up. - *

- * @see yfiles.input.ICommand#EXTEND_SELECTION_UP - * @see yfiles.input.ICommand#EXTEND_SELECTION_DOWN - * @see yfiles.input.ICommand#EXTEND_SELECTION_LEFT - * @see yfiles.input.ICommand#EXTEND_SELECTION_RIGHT - * @see yfiles.input.ICommand#SELECT_TO_PAGE_DOWN - * @const - * @static - * @type {yfiles.input.ICommand} - */ - SELECT_TO_PAGE_UP?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to extend the selection a page downwards. - *

- * {@link yfiles.input.NavigationInputMode} handles this command to extend the selection with the first child node, if possible. - *

- *

- * The default shortcut for this command is Shift+Page Down. - *

- * @see yfiles.input.ICommand#EXTEND_SELECTION_UP - * @see yfiles.input.ICommand#EXTEND_SELECTION_DOWN - * @see yfiles.input.ICommand#EXTEND_SELECTION_LEFT - * @see yfiles.input.ICommand#EXTEND_SELECTION_RIGHT - * @see yfiles.input.ICommand#SELECT_TO_PAGE_UP - * @const - * @static - * @type {yfiles.input.ICommand} - */ - SELECT_TO_PAGE_DOWN?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to increase the zoom level. - *

- * {@link yfiles.view.CanvasComponent} handles this command to increase the zoom level by 20%. A different factor from the default - * 1.2 may be given as the command parameter. - *

- *

- * There is no default shortcut for this command. - *

- * @see yfiles.input.ICommand#DECREASE_ZOOM - * @see yfiles.input.ICommand#ZOOM - * @const - * @static - * @type {yfiles.input.ICommand} - */ - INCREASE_ZOOM?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to decrease the zoom level. - *

- * {@link yfiles.view.CanvasComponent} handles this command to decrease the zoom level by 20%. A different factor from the default - * 1.2 may be given as the command parameter. - *

- *

- * There is no default shortcut for this command. - *

- * @see yfiles.input.ICommand#INCREASE_ZOOM - * @see yfiles.input.ICommand#ZOOM - * @const - * @static - * @type {yfiles.input.ICommand} - */ - DECREASE_ZOOM?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} to set the zoom level. - *

- * {@link yfiles.view.CanvasComponent} handles this command to change the viewport. If the parameter is a {@link yfiles.geometry.Point}, - * the viewport will be centered as that point while not changing the zoom level. If the parameter is a - * {@link yfiles.geometry.Rect}, the viewport will encompass that rectangle and change the zoom level accordingly. If the parameter - * is an instance of {@link yfiles.graph.ILookup} which returns an instance of {@link yfiles.view.IBoundsProvider}, that {@link yfiles.view.IBoundsProvider} - * will be used to obtain a rectangle, which will be used in the same manner as the {@link yfiles.geometry.Rect} mentioned before. - * This can be used to zoom to a specific {@link yfiles.graph.IModelItem}. Finally, if the parameter is {@link yfiles.lang.Number convertible} to - * {@link number}, it will be used as the new zoom level to set. - *

- *

- * There is no default shortcut for this command. - *

- * @see yfiles.input.ICommand#INCREASE_ZOOM - * @see yfiles.input.ICommand#DECREASE_ZOOM - * @const - * @static - * @type {yfiles.input.ICommand} - */ - ZOOM?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} that invokes {@link yfiles.view.GraphComponent#currentItem} if executed. - * @const - * @static - * @type {yfiles.input.ICommand} - */ - SET_CURRENT_ITEM?:yfiles.input.ICommand; - /** - * The {@link yfiles.input.ICommand} that performs the FitGraphBounds(InsetsD) action. - *

- * The parameter can be either an {@link yfiles.geometry.Insets} or convertible that will be used to create an appropriately sized - * insets object from. - *

- * @const - * @static - * @type {yfiles.input.ICommand} - */ - FIT_GRAPH_BOUNDS?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} that changes the {@link yfiles.view.CanvasComponent#zoom} and the {@link yfiles.view.CanvasComponent#viewPoint} in an animated fashion such that the {@link yfiles.view.GraphComponent#currentItem} becomes fully visible. - * @const - * @static - * @type {yfiles.input.ICommand} - */ - ZOOM_TO_CURRENT_ITEM?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} that invokes {@link yfiles.view.CanvasComponent#fitContent} if executed. - * @const - * @static - * @type {yfiles.input.ICommand} - */ - FIT_CONTENT?:yfiles.input.ICommand; - /** - * An {@link yfiles.input.ICommand} that invokes {@link yfiles.view.CanvasComponent#updateContentRect} if executed. - * @const - * @static - * @type {yfiles.input.ICommand} - */ - UPDATE_CONTENT_RECT?:yfiles.input.ICommand; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.ICommand; - }; - /** - * Utility class that holds implementation singletons and utility methods for simple event recognizers. - * @class - * @static - */ - export interface EventRecognizers extends yfiles.lang.Object{} - export class EventRecognizers { - /** - * Creates an instance that is the logical 'and' combination of the provided recognizers. - * @param recognizers The recognizers to perform the logical operation on. - * @returns An instance that is the result of the logical 'and' operation of the provided instances. - * @static - */ - static createAndRecognizer(...recognizers:((eventSource:any,evt:yfiles.lang.EventArgs)=>boolean)[]):(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Creates an instance that is the logical 'or' combination of the provided recognizers. - * @param recognizers The recognizers to perform the logical operation on. - * @returns An instance that is the result of the logical 'or' operation of the provided instances. - * @static - */ - static createOrRecognizer(...recognizers:((eventSource:any,evt:yfiles.lang.EventArgs)=>boolean)[]):(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Creates an event recognizer instance that yields the boolean inverse of the given event recognizer. - * @param recognizer The recognizer to invert. - * @returns An implementation that performs the logical negation for the argument. - * @static - */ - static inverse(recognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean):(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * A callback that will always return true; - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static ALWAYS:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * A callback that will always return false; - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static NEVER:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.EventRecognizers; - } - /** - * Utility class with simple event recognizers that work on {@link yfiles.view.KeyEventArgs}. - * @class - * @static - */ - export interface KeyEventRecognizers extends yfiles.lang.Object{} - export class KeyEventRecognizers { - /** - * Creates an event recognizer for a given key and type using a given set of modifiers. - * @param type The type of the event. - * @param value The key that is subject of the event. - * @param [modifiers=yfiles.view.ModifierKeys.NONE] The state of the modifiers that must be set. This is {@link #NONE} if not set. - * @returns - * @static - */ - static create(type:yfiles.view.KeyEventType,value:yfiles.view.Key,modifiers?:yfiles.view.ModifierKeys):(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Creates an event recognizer that matches key presses. - * @param key The key to create the recognizer for. - * @param [modifiers=yfiles.view.ModifierKeys.NONE] The modifier keys that should be pressed for the recognizer - * @returns An event recognizer that uses the gesture. - * @static - */ - static createKeyPress(key:yfiles.view.Key,modifiers?:yfiles.view.ModifierKeys):(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that recognizes when Escape has been typed. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static ESCAPE_TYPED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that recognizes when any key has been pressed. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static KEY_PRESSED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that recognizes when any key has been typed. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static KEY_TYPED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that recognizes when any key has been released. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static KEY_RELEASED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that recognizes when Escape has been pressed. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static ESCAPE_PRESSED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that recognizes when Delete has been pressed. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static DELETE_PRESSED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that recognizes when Escape has been released. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static ESCAPE_RELEASED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that recognizes when the Shift modifier is active. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static SHIFT_PRESSED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that recognizes when the Alt modifier is active. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static ALT_PRESSED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that recognizes when the Ctrl modifier is active. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static CONTROL_PRESSED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that recognizes when the Meta modifier is active. - *

- * Meta maps to the Windows key on Windows platforms and the Command key on Mac. - *

- * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static META_PRESSED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that recognizes when the Shift modifier is being pressed. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static SHIFT_DOWN:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that recognizes when the Shift modifier is being released. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static SHIFT_UP:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that recognizes when the Ctrl modifier is being pressed. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static CTRL_DOWN:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that recognizes when the Ctrl modifier is being released. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static CTRL_UP:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.KeyEventRecognizers; - } - /** - * A utility class that offers event recognizers that deal with {@link yfiles.view.MouseEventArgs}. - * @class - * @static - */ - export interface MouseEventRecognizers extends yfiles.lang.Object{} - export class MouseEventRecognizers { - /** - * An event recognizer that identifies mouse movements that are not drags. - * @see yfiles.input.MouseEventRecognizers#DRAGGED - * @see yfiles.input.MouseEventRecognizers#MOVED_OR_DRAGGED - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static MOVED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies mouse movements. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static MOVED_OR_DRAGGED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies mousedown events. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static PRESSED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies mouseup events. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static RELEASED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies mouse input capture lost events. - *

- * This event will occur often, especially after all mouse buttons have been released. More relevant for - * {@link yfiles.input.IInputMode}s is the {@link yfiles.input.MouseEventRecognizers#LOST_CAPTURE_DURING_DRAG} event recognizer. - *

- * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static LOST_CAPTURE:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies mouse input capture lost events while at least one mouse button was pressed. - *

- * Since the mouse capture has been lost, the necessary {@link yfiles.view.MouseEventTypes#UP} events will never be triggered. This - * recognizer is useful for identifying this situation. - *

- * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static LOST_CAPTURE_DURING_DRAG:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies left mouse button clicks. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static LEFT_CLICKED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies button clicks. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static CLICKED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies button multi-clicks. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static MULTI_CLICKED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies right mouse button clicks. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static RIGHT_CLICKED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies middle mouse button clicks. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static MIDDLE_CLICKED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies left mouse button double clicks. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static LEFT_DOUBLE_CLICKED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies right mouse button double clicks. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static RIGHT_DOUBLE_CLICKED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies middle mouse button double clicks. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static MIDDLE_DOUBLE_CLICKED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies mousedown events of left mouse button. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static LEFT_PRESSED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies mouseup events of left mouse button. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static LEFT_RELEASED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies mousedown events of right mouse button. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static RIGHT_PRESSED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies mouseup events of right mouse button. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static RIGHT_RELEASED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies mouse drag events. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static DRAGGED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies left mouse button drags. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static LEFT_DRAGGED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies when the has left the control. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static EXITED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies when the mouse has entered the control. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static ENTERED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies right mouse button drags. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static RIGHT_DRAGGED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies middle mouse button drags. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static MIDDLE_DRAGGED:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.MouseEventRecognizers; - } - /** - * A utility class that offers event recognizers that deal with {@link yfiles.view.TouchEventArgs}. - * @class - * @static - */ - export interface TouchEventRecognizers extends yfiles.lang.Object{} - export class TouchEventRecognizers { - /** - * An event recognizer that identifies touch movements of the primary device. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static TOUCH_MOVED_PRIMARY:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies the loss of touch capture for the any device. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static LOST_CAPTURE:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies the loss of touch capture for the primary device. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static LOST_CAPTURE_PRIMARY:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies the loss of touch capture for the secondary device. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static LOST_CAPTURE_SECONDARY:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies touch movements of the primary device. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static TOUCH_DOWN_PRIMARY:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies touch movements of the primary device. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static TOUCH_UP_PRIMARY:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies touch taps of the primary device. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static TOUCH_TAPPED_PRIMARY:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies touch double-taps of the primary device. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static TOUCH_DOUBLE_TAPPED_PRIMARY:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies touch multi-taps of the primary device. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static TOUCH_MULTI_TAPPED_PRIMARY:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies when the primary device has left the control. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static TOUCH_EXITED_PRIMARY:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies when the primary device has entered the control. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static TOUCH_ENTERED_PRIMARY:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies long presses of the primary device. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static TOUCH_LONG_PRESSED_PRIMARY:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies touch movements of the secondary device. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static TOUCH_MOVED_SECONDARY:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies touch movements of the secondary device. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static TOUCH_DOWN_SECONDARY:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies touch movements of the secondary device. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static TOUCH_UP_SECONDARY:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies touch taps of the secondary device. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static TOUCH_TAPPED_SECONDARY:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies touch double-taps of the secondary device. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static TOUCH_DOUBLE_TAPPED_SECONDARY:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies touch multi-taps of the secondary device. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static TOUCH_MULTI_TAPPED_SECONDARY:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies when the secondary device has left the control. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static TOUCH_EXITED_SECONDARY:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies when the secondary device has entered the control. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static TOUCH_ENTERED_SECONDARY:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * An event recognizer that identifies long presses of the secondary device. - * @const - * @static - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - static TOUCH_LONG_PRESSED_SECONDARY:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.TouchEventRecognizers; - } - /** - * An {@link yfiles.input.IInputMode} used for recognizing the gesture of creating {@link yfiles.graph.IBend}s in an {@link yfiles.graph.IGraph}. - *

- * This mode is used by {@link yfiles.input.GraphEditorInputMode} but can be used stand-alone, too. Client code should register - * with the {@link yfiles.input.CreateBendInputMode#addBendCreatedListener BendCreated} event to perform - * additional actions after the bend has been created. - *

- *

- * This mode is {@link yfiles.input.CreateBendInputMode#exclusive} by default. - *

- * @class - * @implements {yfiles.input.IInputMode} - */ - export interface CreateBendInputMode extends yfiles.lang.Object,yfiles.input.IInputMode{} - export class CreateBendInputMode { - /** - * Creates a new instance that will use the {@link yfiles.graph.IGraph} from the {@link yfiles.input.CreateBendInputMode#inputModeContext} to create bends in. - * @see yfiles.input.CreateBendInputMode#graph - */ - constructor(); - /** - * Called when a bend creation gesture can be started at the current mouse pointer location. - *

- * This implementation sets the {@link yfiles.input.ConcurrencyController#preferredCursor} to {@link yfiles.input.CreateBendInputMode#armedCursor}. - *

- * @protected - */ - arm():void; - /** - * Cancels the editing of this mode. - *

- * This implementation {@link yfiles.input.ConcurrencyController#releaseMutex releases} the mutex if it is currently owned by this instance and calls - * {@link yfiles.input.CreateBendInputMode#onCanceled}. - *

- * @see yfiles.input.CreateBendInputMode#onCanceled - */ - cancel():void; - /** - * Creates the bend. - *

- * The bend is created using the hit edge's {@link yfiles.input.IBendCreator} implementation, as obtained from the edge's - * {@link yfiles.graph.ILookup#lookup}. - *

- * @param edge The hit edge. - * @param location The coordinates of the hit. - * @returns The created bend or null. - * @see yfiles.input.CreateBendInputMode#createInputModeContext - * @protected - */ - createBend(edge:yfiles.graph.IEdge,location:yfiles.geometry.Point):yfiles.graph.IBend; - /** - * Creates an {@link yfiles.input.IInputModeContext} for use with the upcoming {@link yfiles.input.IBendCreator#createBend} call in - * {@link yfiles.input.CreateBendInputMode#createBend}. - * @returns An instance of {@link }. - * @protected - */ - createInputModeContext():yfiles.input.IInputModeContext; - /** - * Called when a bend creation gesture can no longer be started at the current mouse pointer location. - *

- * This implementation sets the {@link yfiles.input.ConcurrencyController#preferredCursor} back to null. - *

- * @protected - */ - disarm():void; - /** - * Updates the {@link yfiles.input.CreateBendInputMode#splitOrthogonalSegment} property and then delegates to {@link yfiles.input.CreateBendInputMode#createBend}. - *

- * This method triggers the {@link yfiles.input.CreateBendInputMode#addBendCreatedListener BendCreated} event - * if a bend is created. - *

- * @param edge The edge to create a bend for. - * @param dragLocation The location at which the user initiated the gesture. - * @protected - */ - dragSegment(edge:yfiles.graph.IEdge,dragLocation:yfiles.geometry.Point):void; - /** - * Finds the edge at the given coordinate. - * @param location The coordinates. - * @returns The edge that has been hit. - * @protected - */ - getEdge(location:yfiles.geometry.Point):yfiles.graph.IEdge; - /** - * Installs this mode into the given context that is provided by the canvas. - *

- * In general a mode can only be installed into a single canvas at all times. - *

- *

- * This method is called to initialize this instance. Subclasses should override this method to register the corresponding - * event handler delegates for the various input events they need to register with. - *

- *

- * Overriding implementations should call the base implementation, first. - *

- * @param context The context that this instance shall be installed into. The same instance will be passed to this instance during - * {@link #uninstall}. A reference to the context may be kept and queried during the time the mode is - * installed. - * @param controller The {@link #controller} for this mode. - * @see yfiles.input.IInputMode#uninstall - */ - install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; - /** - * Determines whether the current location is valid to begin a bend creation gesture. - * @param source - * @param evt - * @returns - * @protected - */ - isValidBegin(source:any,evt:yfiles.lang.EventArgs):boolean; - /** - * Triggers the {@link yfiles.input.CreateBendInputMode#addBendCreatedListener BendCreated} event. - * @param evt - * @protected - */ - onBendCreated(evt:yfiles.graph.BendEventArgs):void; - /** - * Called after {@link yfiles.input.CreateBendInputMode#cancel} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been canceled. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onCanceled():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been activated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerActivated():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerDeactivated():void; - /** - * Triggers the {@link yfiles.input.CreateBendInputMode#addDragCanceledListener DragCanceled} event. - * @param evt The event argument that contains context information. - * @protected - */ - onDragCanceled(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered at the end of each drag. - *

- * This method triggers the {@link yfiles.input.CreateBendInputMode#addDraggedListener Dragged} event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragged(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered at the start of each drag. - *

- * This method triggers the {@link yfiles.input.CreateBendInputMode#addDraggingListener Dragging} event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragging(evt:yfiles.input.InputModeEventArgs):void; - /** - * Called after {@link yfiles.input.CreateBendInputMode#tryStop} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been stopped. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onStopped():void; - /** - * - * @returns - */ - tryStop():boolean; - /** - * Uninstalls this mode from the given context. - *

- * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} method. After a mode has - * been uninstalled it can be installed again into the same or another canvas. - *

- *

- * Overriding implementations should call the base implementation after their own code. - *

- * @param context The context to deregister from. This is the same instance that had been passed to {@link #install} during - * installation. - */ - uninstall(context:yfiles.input.IInputModeContext):void; - /** - * - * @type {number} - */ - priority:number; - /** - * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. - *

- * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.CreateBendInputMode#controller}. - *

- *

- * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} - * will be deactivated. Otherwise it will always run concurrently with all other modes. - *

- * @type {boolean} - */ - exclusive:boolean; - /** - * Gets or sets the enabled state of this input mode. - *

- * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed - * {@link yfiles.input.CreateBendInputMode#controller} so a disabled instance should never try to acquire the input mutex. - *

- * @type {boolean} - */ - enabled:boolean; - /** - * - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Gets the installed {@link yfiles.input.CreateBendInputMode#controller}. - * @protected - * @type {yfiles.input.ConcurrencyController} - */ - controller:yfiles.input.ConcurrencyController; - /** - * Adds the given listener for the BendCreated event that occurs once a bend creation gesture has been recognized. - * @param listener The listener to add. - * @see yfiles.input.CreateBendInputMode#removeBendCreatedListener - */ - addBendCreatedListener(listener:(sender:any,evt:yfiles.graph.BendEventArgs)=>void):void; - /** - * Removes the given listener for the BendCreated event that occurs once a bend creation gesture has been recognized. - * @param listener The listener to remove. - * @see yfiles.input.CreateBendInputMode#addBendCreatedListener - */ - removeBendCreatedListener(listener:(sender:any,evt:yfiles.graph.BendEventArgs)=>void):void; - /** - * Gets or sets the cursor to use when this mode is in "armed" state. - * @type {yfiles.view.Cursor} - */ - armedCursor:yfiles.view.Cursor; - /** - * Gets or sets the "pressed" state recognizer. - *

- * This recognizer instance will be used to determine when the user begins to move the selection. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - pressedRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "dragged" recognizer. - *

- * This recognizer instance determines when the user is moving the selection - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - draggedRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "released" recognizer. - *

- * This instance determines when the user has finished the move. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - releasedRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "pressed" state recognizer specifically for touch input. - *

- * This recognizer instance will be used to determine when the user begins to move the selection. The default value is - * {@link yfiles.input.TouchEventRecognizers#TOUCH_LONG_PRESSED_PRIMARY}. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - prepareRecognizerTouch:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "moved" state recognizer specifically for touch input. - *

- * This recognizer instance will be used to determine when the user begins actually moves the selection. The default value - * is {@link yfiles.input.TouchEventRecognizers#TOUCH_MOVED_PRIMARY}. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - movedRecognizerTouch:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "released" state recognizer specifically for touch input. - *

- * This recognizer instance will be used to determine when the finalized the gesture. The default value is - * {@link yfiles.input.TouchEventRecognizers#TOUCH_UP_PRIMARY}. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - releasedRecognizerTouch:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the {@link yfiles.input.IHitTestable} that determines where bends may be created. - * @type {yfiles.input.IHitTestable} - */ - beginHitTestable:yfiles.input.IHitTestable; - /** - * Gets the location where the bend creation gesture was initialized. - * @type {yfiles.geometry.Point} - */ - location:yfiles.geometry.Point; - /** - * Gets the graph this mode is acting upon. - * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - /** - * Adds the given listener for the Dragging event that occurs at the start of every drag. - * @param listener The listener to add. - * @see yfiles.input.CreateBendInputMode#removeDraggingListener - */ - addDraggingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the Dragging event that occurs at the start of every drag. - * @param listener The listener to remove. - * @see yfiles.input.CreateBendInputMode#addDraggingListener - */ - removeDraggingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the Dragged event that occurs at the end of every drag. - * @param listener The listener to add. - * @see yfiles.input.CreateBendInputMode#removeDraggedListener - */ - addDraggedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the Dragged event that occurs at the end of every drag. - * @param listener The listener to remove. - * @see yfiles.input.CreateBendInputMode#addDraggedListener - */ - removeDraggedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragCanceled event that occurs when the drag has been canceled. - * @param listener The listener to add. - * @see yfiles.input.CreateBendInputMode#removeDragCanceledListener - */ - addDragCanceledListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragCanceled event that occurs when the drag has been canceled. - * @param listener The listener to remove. - * @see yfiles.input.CreateBendInputMode#addDragCanceledListener - */ - removeDragCanceledListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Gets or sets the event recognizer that determines whether the bend creation should be treated as a split segment - * operation. - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - splitOrthogonalSegmentRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets a value indicating whether an orthogonal segment should be split by the last bend creation. - *

- * This property can be read by implementations of {@link yfiles.input.IBendCreator} if they retrieve this instance from their {@link yfiles.input.IInputModeContext#parentInputMode}. If - * this property is - * true, implementation are advised to treat the bend creation as a gesture that splits the segment into two. - *

- * @see yfiles.input.CreateBendInputMode#splitOrthogonalSegmentRecognizer - * @type {boolean} - */ - splitOrthogonalSegment:boolean; - /** - * Gets or sets a property that determines whether this mode should use an existing bend in {@link yfiles.input.CreateBendInputMode#createBend} - * if there is one found at the given location. - *

- * The default is true - *

- * @default true - * @type {boolean} - */ - useExistingBend:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.CreateBendInputMode; - } - /** - * Simple default implementation of the {@link yfiles.input.IEditLabelHelper} interface. - *

- * This class provided a number of factory methods that can be overwritten to change the default behavior which is modeled - * after the behavior used by {@link yfiles.input.GraphEditorInputMode}'s {@link yfiles.input.GraphEditorInputMode#createLabel} and - * {@link yfiles.input.GraphEditorInputMode#editLabel}. - *

- * @class - * @implements {yfiles.input.IEditLabelHelper} - */ - export interface EditLabelHelper extends yfiles.lang.Object,yfiles.input.IEditLabelHelper{} - export class EditLabelHelper { - /** - * Determines the label model parameter to use for the label, depending on the owner. - *

- * This method will obtain the default parameter instances from the {@link yfiles.input.EditLabelHelper#graph} considering the type of the current owner. - *

- * @param context The input mode context. - * @param owner The label's owner. - * @returns The layout parameter to use or null. - * @protected - */ - getLabelParameter(context:yfiles.input.IInputModeContext,owner:yfiles.graph.ILabelOwner):yfiles.graph.ILabelModelParameter; - /** - * Determines the style to use for the label, depending on the owner. - *

- * This method will obtain the default style instances from the {@link yfiles.input.EditLabelHelper#graph} considering the type of the current owner. - *

- * @param context The input mode context. - * @param owner The label's owner. - * @returns The style to use or null. - * @protected - */ - getLabelStyle(context:yfiles.input.IInputModeContext,owner:yfiles.graph.ILabelOwner):yfiles.styles.ILabelStyle; - /** - * Gets the preferred size for the label. - *

- * This implementation yields null to indicate that the preferred size should be calculated after the text has been - * entered. - *

- * @param context The input mode context. - * @param label The label to get the preferred size from. - * @returns The size to use or null. - * @protected - */ - getPreferredSize(context:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel):yfiles.geometry.Size; - /** - * Helper method that will be called for {@link yfiles.graph.ILabelOwner}s. - *

- * This method delegates to {@link yfiles.input.EditLabelHelper#getLabelParameter}, {@link yfiles.input.EditLabelHelper#getLabelStyle}, and - * {@link yfiles.input.EditLabelHelper#getPreferredSize} to set the appropriate properties on evt and sets the {@link yfiles.input.LabelEditingEventArgs#handled} property to - * true. Label creation thus is always possible. - *

- * @param evt The original event arguments. - */ - onLabelAdding(evt:yfiles.input.LabelEditingEventArgs):void; - /** - * Helper method that will be called for {@link yfiles.graph.ILabelOwner}s. - *

- * This method returns the first of the {@link yfiles.graph.ILabelOwner#labels} that belong to the {@link yfiles.input.LabelEditingEventArgs#owner}, if set. Otherwise, it delegates to - * {@link yfiles.input.EditLabelHelper#getLabelParameter}, {@link yfiles.input.EditLabelHelper#getLabelStyle}, and {@link yfiles.input.EditLabelHelper#getPreferredSize} - * to set the appropriate properties on evt. - *

- *

- * The arguments are always set as {@link yfiles.input.LabelEditingEventArgs#handled}, so label editing is always possible. - *

- * @param evt The original event arguments. - */ - onLabelEditing(evt:yfiles.input.LabelEditingEventArgs):void; - /** - * Gets or sets the graph instance to retrieve the default values from. - *

- * If this instance is not set, the implementation will try to retrieve the graph from the {@link yfiles.input.IInputModeContext}'s - * {@link yfiles.graph.ILookup}. - *

- * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.EditLabelHelper; - } - /** - * An {@link yfiles.input.IInputMode} for interacticely creating edges between nodes and edges in an {@link yfiles.graph.IGraph} displayed - * in a {@link yfiles.view.CanvasComponent} or {@link yfiles.view.GraphComponent}. - *

- * This class provides a {@link yfiles.input.CreateEdgeInputMode#edgeCreator factory callback} that the final edge creation will be delegated to. The styling of the newly - * created edge can be customized via the {@link yfiles.input.CreateEdgeInputMode#edgeDefaults}. Defaults can be automatically adjusted in response to the various events that - * will be triggered by this instance during the edge creation. Use the {@link yfiles.input.CreateEdgeInputMode#dummyEdgeGraph} property to modify the appearance of the dummy - * edge. This class uses {@link yfiles.input.IPortCandidateProvider} instances found in the {@link yfiles.graph.ILookup} of the {@link yfiles.graph.INode nodes} in - * the graph to display port candidates and to finally create the edges. - *

- *

- * This mode is {@link yfiles.input.CreateEdgeInputMode#exclusive} by default. - *

- * @class - * @implements {yfiles.input.IInputMode} - */ - export interface CreateEdgeInputMode extends yfiles.lang.Object,yfiles.input.IInputMode{} - export class CreateEdgeInputMode { - /** - * Creates a new instance that will use the {@link yfiles.graph.IGraph} from the {@link yfiles.input.CreateEdgeInputMode#inputModeContext} to create edges in. - *

- * Setting the {@link yfiles.input.CreateEdgeInputMode#graph} property can be used to optionally set a different graph to work on. - *

- * @see yfiles.input.CreateEdgeInputMode#graph - */ - constructor(); - /** - * Cancels the editing of this mode. - *

- * This implementation {@link yfiles.input.ConcurrencyController#releaseMutex releases} the mutex if it is currently owned by this instance and calls - * {@link yfiles.input.CreateEdgeInputMode#onCanceled}. - *

- * @see yfiles.input.CreateEdgeInputMode#onCanceled - */ - cancel():void; - /** - * Creates the dummy edge that will be displayed by the input mode during the creation. - * @returns An {@link } implementation that can be used as a dummy. - * @protected - */ - createDummyEdge():yfiles.graph.IEdge; - /** - * Factory method that will create the dummy graph to hold the preview of the {@link yfiles.input.CreateEdgeInputMode#dummyEdge}. - *

- * Note that the instance returned by this instance must accept any port as valid source and target ports for it's {@link yfiles.graph.IGraph#setEdgePorts} - * method. This will allow the preview edge to be connected to the actual {@link yfiles.input.CreateEdgeInputMode#graph}. - *

- * @returns A graph instance that will be rendered as a preview. - * @protected - */ - createDummyEdgeGraph():yfiles.graph.IGraph; - /** - * Callback used by {@link yfiles.input.CreateEdgeInputMode#createEdge} if both {@link yfiles.input.CreateEdgeInputMode#sourcePortCandidate} and {@link yfiles.input.CreateEdgeInputMode#targetPortCandidate} have been set. - *

- * This method will first {@link yfiles.input.IPortCandidate#createPort create the new ports} if necessary and then create the edge via the {@link yfiles.input.CreateEdgeInputMode#edgeCreator} callback to the ports. After - * the ports are created the corresponding {@link yfiles.input.CreateEdgeInputMode#addPortAddedListener PortAdded} - * events are triggered. If the edge creation is canceled by the creator callback, newly created ports will be removed - * again. - *

- * @param graph The graph to create the edge for. - * @param sourcePortCandidate The candidate to use for the source. - * @param targetPortCandidate The candidate to use for the target. - * @returns The edge created or null. - * @protected - */ - createEdge(graph:yfiles.graph.IGraph,sourcePortCandidate:yfiles.input.IPortCandidate,targetPortCandidate:yfiles.input.IPortCandidate):yfiles.graph.IEdge; - /** - * Callback at the end of the edge creation process. - *

- * This method will actually create the edge using the {@link yfiles.input.CreateEdgeInputMode#createEdge} method. This method will - * ultimately call {@link yfiles.input.CreateEdgeInputMode#onEdgeCreated}. - *

- * @returns The edge created or null. - * @protected - */ - createEdge():yfiles.graph.IEdge; - /** - * Creates an {@link yfiles.input.IInputModeContext} for use with the port candidates queries for the upcoming edge creation - * operation and the actual edge creation - * @returns An instance of {@link } that is configured for this mode. - * @protected - */ - createEdgeCreationInputModeContext():yfiles.input.IInputModeContext; - /** - * Synthetically starts the interactive edge creation process using the provided {@link yfiles.input.IPortCandidate} as the source - * port. - *

- * This instance needs to be {@link yfiles.input.IInputMode#install installed} and {@link yfiles.input.CreateEdgeInputMode#enabled} and it needs to be able to {@link yfiles.input.ConcurrencyController#canRequestMutex request the input mutex} in order to proceed. If any - * of these conditions are not satisfied, this method will throw an {@link yfiles.lang.Exception}. - *

- * @param sourcePortCandidate The source port candidate to use for the edge creation. - */ - doStartEdgeCreation(sourcePortCandidate:yfiles.input.IPortCandidate):void; - /** - * Finds the closest {@link yfiles.input.PortCandidateValidity#VALID} candidate given a number of - * {@link yfiles.input.IPortCandidate}s and a location in world coordinates. - * @param candidates The candidates to find the closest from. - * @param location The location of the mouse in world coordinates. - * @returns The candidate to use or null if no candidate satisfies the needs - * @protected - */ - getClosestCandidate(candidates:yfiles.collections.IEnumerable,location:yfiles.geometry.Point):yfiles.input.IPortCandidate; - /** - * Finds the closest candidate given a number of {@link yfiles.input.IPortCandidate}s and a location in world coordinates. - * @param candidates The candidates to find the closest from. - * @param location The location of the pointer in world coordinates. - * @returns The candidate to use or null if no candidate satisfies the needs - * @protected - */ - getClosestSourceCandidate(candidates:yfiles.collections.IEnumerable,location:yfiles.geometry.Point):yfiles.input.IPortCandidate; - /** - * Finds the closest target candidate given a number of {@link yfiles.input.IPortCandidate}s and a location in world coordinates. - * @param candidates The candidates to find the closest from. - * @param location The location of the mouse in world coordinates. - * @returns The candidate to use or null if no candidate satisfies the needs or {@link #enforceBendCreationRecognizer} yields true. - * @protected - */ - getClosestTargetCandidate(candidates:yfiles.collections.IEnumerable,location:yfiles.geometry.Point):yfiles.input.IPortCandidate; - /** - * Gets the snap lines lines that are induced by the current dummy edge. - * @param context The graph snap context. - * @param provider The dummy edge segment snap line provider. - * @returns The snap lines induced by the current dummy edge. - * @protected - */ - getDummyEdgeSnapLines(context:yfiles.input.GraphSnapContext,provider:yfiles.input.ISnapLineProvider):yfiles.collections.IEnumerable; - /** - * Calculates direction of first edge segment of the DummyNode. - *

- * An edge starting in an border will always be orthogonal to the border's outer line. An edge starting in a corner will - * point the way the user dragged the mouse. An edge starting in the inner of the node will be directed the way dragged - * unless another edge that is close to the new edge ({@link yfiles.input.CreateEdgeInputMode#preferredMinimalEdgeDistance}) already went that way. - *

- * @returns A {@link } defining the direction of the first edge segment. - * @protected - */ - getFirstSegmentDirection():yfiles.input.EdgeSegmentDirection; - /** - * Retrieves the port owner at a given position in world coordinates. - *

- * If there is a {@link yfiles.input.IHitTester.} for type {@link yfiles.graph.INode} in the lookup of this mode's {@link yfiles.input.CreateEdgeInputMode#inputModeContext} then this instance will be used for the query. - * - *
- * Otherwise this implementation calls the {@link yfiles.styles.INodeStyleRenderer#getHitTestable} method of the nodes to find hit - * nodes and uses an {@link yfiles.collections.IComparer.} to determine the first hit node. - *

- * @param location The position in world coordinates. - * @returns The node or null if no suitable node was found. - * @protected - */ - getPortOwner(location:yfiles.geometry.Point):yfiles.graph.IPortOwner; - /** - * Retrieves the port owners from the graph in the order of their importance. - *

- * This implementation only considers nodes in the graph unless {@link yfiles.input.CreateEdgeInputMode#allowEdgeToEdgeConnections} is set to - * true, in which case edges are also added to the enumerable. - *

- * @returns An enumerable over all {@link }s in this graph - * @protected - */ - getPortOwners():yfiles.collections.IEnumerable; - /** - * Finds the source {@link yfiles.graph.IPortOwner port owner} at the specified location. - *

- * This always is the source {@link yfiles.graph.INode node} if {@link yfiles.input.CreateEdgeInputMode#allowEdgeToEdgeConnections} is set to false. - *
- * This default implementation simply delegates to {@link yfiles.input.CreateEdgeInputMode#getPortOwner}. - *

- * @param sourceLocation The location of the mouse at the beginning of the gesture. - * @returns The port owner to use for the source node or null. - * @protected - */ - getSource(sourceLocation:yfiles.geometry.Point):yfiles.graph.IPortOwner; - /** - * Finds the best matching source port {@link yfiles.input.IPortCandidate} given a provider and the current location. - *

- * The resolveCandidates parameter determines whether dynamic port candidates should be {@link yfiles.input.CreateEdgeInputMode#resolveCandidates resolved} with respect to location - * or simply be discarded. - *

- * @param provider The provider for the candidates. - * @param location The location where the gesture was initiated. - * @param resolveCandidates Determines whether {@link #DYNAMIC} ports should be resolved with respect to the location or - * not. - * @returns The candidate to use or null. - * @see yfiles.input.CreateEdgeInputMode#resolveSourcePortCandidates - * @see yfiles.input.CreateEdgeInputMode#portCandidateResolutionRecognizer - * @protected - */ - getSourcePortCandidate(provider:yfiles.input.IPortCandidateProvider,location:yfiles.geometry.Point,resolveCandidates:boolean):yfiles.input.IPortCandidate; - /** - * Finds the best matching source {@link yfiles.input.IPortCandidate port candidate} based on the given location. - *

- * This implementation will use the {@link yfiles.input.CreateEdgeInputMode#getSource port owner} to look up the {@link yfiles.input.IPortCandidateProvider port candidate provider} and finally delegate to - * {@link yfiles.input.CreateEdgeInputMode#getSourcePortCandidate}. - *

- * @param location The location where the gesture was initiated. - * @returns - * @see yfiles.input.CreateEdgeInputMode#getSource - * @see yfiles.input.CreateEdgeInputMode#getSourcePortCandidateProvider - * @see yfiles.input.CreateEdgeInputMode#getSourcePortCandidate - * @protected - */ - getSourcePortCandidate(location:yfiles.geometry.Point):yfiles.input.IPortCandidate; - /** - * Retrieves the port candidate provider instance given a source port owner. - *

- * This implementations uses the sourceOwner's {@link yfiles.graph.ILookup#lookup} to retrieve an {@link yfiles.input.IPortCandidateProvider} - * implementation. - *

- * @param sourceOwner The {@link } to find the candidates for. - * @returns A provider instance or null. - * @protected - */ - getSourcePortCandidateProvider(sourceOwner:yfiles.graph.IPortOwner):yfiles.input.IPortCandidateProvider; - /** - * Finds the target {@link yfiles.graph.IPortOwner port owner} at the specified location. - *

- * This always is a target {@link yfiles.graph.INode node} if {@link yfiles.input.CreateEdgeInputMode#allowEdgeToEdgeConnections} is set to false. - *
- * This default implementation simply delegates to {@link yfiles.input.CreateEdgeInputMode#getPortOwner}. - *

- * @param targetLocation The location of the pointer at the beginning of the gesture. - * @returns The port owner or null. - * @protected - */ - getTarget(targetLocation:yfiles.geometry.Point):yfiles.graph.IPortOwner; - /** - * Retrieves the port candidate provider instance given a source port candidate and a possible target item. - *

- * This implementations uses the targetOwner's {@link yfiles.graph.ILookup#lookup} to retrieve an {@link yfiles.input.IPortCandidateProvider} - * implementation. - *

- * @param sourcePortCandidate The current source port candidate. - * @param targetOwner The {@link } to find the candidates for. - * @param location The location of the mouse. - * @returns A provider instance or null. - * @protected - */ - getTargetPortCandidateProvider(sourcePortCandidate:yfiles.input.IPortCandidate,targetOwner:yfiles.graph.IPortOwner,location:yfiles.geometry.Point):yfiles.input.IPortCandidateProvider; - /** - * Retrieves the {@link yfiles.input.IPortCandidateProvider} instance that provides the possible candidates for the target of the - * edge given the current source candidate. - *

- * This implementation queries all nodes in the graph for {@link yfiles.input.CreateEdgeInputMode#getTargetPortCandidateProvider their provider} and returns a composite unless {@link yfiles.input.CreateEdgeInputMode#useHitItemsCandidatesOnly} is set to true in - * which case the {@link yfiles.input.CreateEdgeInputMode#getTargetPortCandidateProvider} is queried using the current {@link yfiles.input.CreateEdgeInputMode#getTarget target}. - *

- * @param sourcePortCandidate The source candidate that has been chosen for the edge creation. - * @param location The location of the mouse. - * @returns The provider to get the port candidates from. - * @protected - */ - getTargetPortCandidateProvider(sourcePortCandidate:yfiles.input.IPortCandidate,location:yfiles.geometry.Point):yfiles.input.IPortCandidateProvider; - /** - * Retrieves the target port candidates for a given location in world coordinates. - *

- * The resolveCandidates parameter determines whether dynamic port candidates should be {@link yfiles.input.CreateEdgeInputMode#resolveCandidates resolved} with respect to location - * or simply be discarded. This implementation delegates to {@link yfiles.input.CreateEdgeInputMode#getTargetPortCandidateProvider} - * or returns an empty enumerable if no provider has been found. - *

- * @param location The location of the mouse in world coordinates. - * @param resolveCandidates Determines whether {@link #DYNAMIC} ports should be resolved with respect to the location or - * not. - * @returns A possibly empty enumeration over all target port candidates. - * @see yfiles.input.CreateEdgeInputMode#sourcePortCandidate - * @see yfiles.input.CreateEdgeInputMode#resolveTargetPortCandidates - * @see yfiles.input.CreateEdgeInputMode#portCandidateResolutionRecognizer - * @protected - */ - getTargetPortCandidates(location:yfiles.geometry.Point,resolveCandidates:boolean):yfiles.collections.IEnumerable; - /** - * Installs this mode into the given context that is provided by the canvas. - *

- * In general a mode can only be installed into a single canvas at all times. - *

- *

- * This method is called to initialize this instance. Subclasses should override this method to register the corresponding - * event handler delegates for the various input events they need to register with. - *

- *

- * Overriding implementations should call the base implementation, first. - *

- * @param context The context that this instance shall be installed into. The same instance will be passed to this instance during - * {@link #uninstall}. A reference to the context may be kept and queried during the time the mode is - * installed. - * @param controller The {@link #controller} for this mode. - * @see yfiles.input.IInputMode#uninstall - */ - install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; - /** - * Called after {@link yfiles.input.CreateEdgeInputMode#cancel} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been canceled. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onCanceled():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController} property of the installed {@link yfiles.input.ConcurrencyController} has - * been set to true. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been activated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerActivated():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerDeactivated():void; - /** - * Called by {@link yfiles.input.CreateEdgeInputMode#createEdge} after the edge has been finalized. - *

- * This method will trigger the {@link yfiles.input.CreateEdgeInputMode#addEdgeCreatedListener EdgeCreated} - * event. - *

- * @param evt The event argument holding the edge. - * @protected - */ - onEdgeCreated(evt:yfiles.graph.EdgeEventArgs):void; - /** - * Raises the {@link yfiles.input.CreateEdgeInputMode#addEdgeCreationStartedListener EdgeCreationStarted} event when - * the gesture for creating an edge has been initialized. - * @param evt The {@link } instance containing the dummy edge that will be used during edge creation. - * @protected - */ - onEdgeCreationStarted(evt:yfiles.graph.EdgeEventArgs):void; - /** - * Triggers the {@link yfiles.input.CreateEdgeInputMode#addGestureCanceledListener GestureCanceled} event. - * @param evt The event argument that contains context information. - * @protected - */ - onGestureCanceled(evt:yfiles.input.InputModeEventArgs):void; - /** - * Triggers the {@link yfiles.input.CreateEdgeInputMode#addGestureCancelingListener GestureCanceling} event. - * @param evt The event argument that contains context information. - * @protected - */ - onGestureCanceling(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered once the drag has been finalized. - *

- * This method triggers the {@link yfiles.input.CreateEdgeInputMode#addGestureFinishedListener GestureFinished} - * event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onGestureFinished(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered before the drag will be finalized. - *

- * This method triggers the {@link yfiles.input.CreateEdgeInputMode#addGestureFinishingListener GestureFinishing} - * event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onGestureFinishing(evt:yfiles.input.InputModeEventArgs):void; - /** - * Triggers the {@link yfiles.input.CreateEdgeInputMode#addGestureStartedListener GestureStarted} event. - * @param evt The event argument that contains context information. - * @protected - */ - onGestureStarted(evt:yfiles.input.InputModeEventArgs):void; - /** - * Triggers the {@link yfiles.input.CreateEdgeInputMode#addGestureStartingListener GestureStarting} event. - * @param evt The event argument that contains context information. - * @protected - */ - onGestureStarting(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered at the end of each drag. - *

- * This method triggers the {@link yfiles.input.CreateEdgeInputMode#addMovedListener Moved} event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onMoved(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered at the start of each drag. - *

- * This method triggers the {@link yfiles.input.CreateEdgeInputMode#addMovingListener Moving} event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onMoving(evt:yfiles.input.InputModeEventArgs):void; - /** - * Raises the {@link yfiles.input.CreateEdgeInputMode#addPortAddedListener PortAdded} event if the mode has - * {@link yfiles.graph.IGraph#addPort added a port} for the source or target node to complete the edge creation. - * @param evt The {@link } instance containing the port that has been added. - * @see yfiles.input.CreateEdgeInputMode#addPortAddedListener - * @protected - */ - onPortAdded(evt:yfiles.collections.ItemEventArgs):void; - /** - * Triggers the {@link yfiles.input.CreateEdgeInputMode#addSourcePortCandidateChangedListener SourcePortCandidateChanged} - * event. - * @param evt The event argument that contains context information. - * @protected - */ - onSourcePortCandidateChanged(evt:yfiles.collections.ItemEventArgs):void; - /** - * Called after {@link yfiles.input.CreateEdgeInputMode#tryStop} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been stopped. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onStopped():void; - /** - * Triggers the {@link yfiles.input.CreateEdgeInputMode#addTargetPortCandidateChangedListener TargetPortCandidateChanged} - * event. - * @param evt The event argument that contains context information. - * @protected - */ - onTargetPortCandidateChanged(evt:yfiles.collections.ItemEventArgs):void; - /** - * Returns an enumerable over the given candidates where no instance has {@link yfiles.input.PortCandidateValidity#DYNAMIC} {@link yfiles.input.IPortCandidate#validity}. - *

- * If the location has a value, method {@link yfiles.input.IPortCandidate#getPortCandidateAt} is used to resolve the dynamic - * candidate to a real candidate, otherwise that candidate is discarded. - *

- * @param candidates The candidates to possibly resolve. - * @param location The location to resolve dynamic candidates against or null if they should be discarded instead. - * @returns An enumerable of non-{@link #DYNAMIC} port candidates. - * @protected - */ - resolveCandidates(candidates:yfiles.collections.IEnumerable,location:yfiles.geometry.Point):yfiles.collections.IEnumerable; - /** - * - * @returns - */ - tryStop():boolean; - /** - * Uninstalls this mode from the given context. - *

- * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} method. After a mode has - * been uninstalled it can be installed again into the same or another canvas. - *

- *

- * Overriding implementations should call the base implementation after their own code. - *

- * @param context The context to deregister from. This is the same instance that had been passed to {@link #install} during - * installation. - */ - uninstall(context:yfiles.input.IInputModeContext):void; - /** - * Updates the {@link yfiles.input.CreateEdgeInputMode#dummyEdge} to reflect the current source port candidate. - *

- * This implementation creates a self loop of the dummy edge if the sourcePortCandidate is the same as the owner of the {@link yfiles.input.CreateEdgeInputMode#targetPortCandidate}. - *

- * @param sourcePortCandidate The new owner target port candidate. - * @protected - */ - updateDummyEdgeSourcePort(sourcePortCandidate:yfiles.input.IPortCandidate):void; - /** - * Updates the {@link yfiles.input.CreateEdgeInputMode#dummyEdge} to reflect the current target port candidate. - *

- * This implementation creates a self loop of the dummy edge if the targetPortCandidate is the same as the owner of the {@link yfiles.input.CreateEdgeInputMode#sourcePortCandidate}. - *

- * @param targetPortCandidate The new owner target port candidate. - * @protected - */ - updateDummyEdgeTargetPort(targetPortCandidate:yfiles.input.IPortCandidate):void; - /** - * Updates the drag point. - *

- * This method is called when the current target location for the creation gesture is changed. - *

- * @param location The new coordinates. - * @protected - */ - updateTargetLocation(location:yfiles.geometry.Point):void; - /** - * - * @type {number} - */ - priority:number; - /** - * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. - *

- * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.CreateEdgeInputMode#controller}. - *

- *

- * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} - * will be deactivated. Otherwise it will always run concurrently with all other modes. - *

- * @type {boolean} - */ - exclusive:boolean; - /** - * Gets or sets the enabled state of this input mode. - *

- * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed - * {@link yfiles.input.CreateEdgeInputMode#controller} so a disabled instance should never try to acquire the input mutex. - *

- * @type {boolean} - */ - enabled:boolean; - /** - * - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Gets the installed {@link yfiles.input.CreateEdgeInputMode#controller}. - * @protected - * @type {yfiles.input.ConcurrencyController} - */ - controller:yfiles.input.ConcurrencyController; - /** - * Gets or sets the cursor that indicates a valid place to begin an edge creation. - * @type {yfiles.view.Cursor} - */ - validBeginCursor:yfiles.view.Cursor; - /** - * Gets or sets the cursor that indicates a valid place to create a bend. - * @type {yfiles.view.Cursor} - */ - validBendCursor:yfiles.view.Cursor; - /** - * Gets or sets the cursor that indicates a valid place to finish creation. - * @type {yfiles.view.Cursor} - */ - validEndCursor:yfiles.view.Cursor; - /** - * Gets or sets event recognizer that temporarily disables snapping. - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - disableSnappingRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets event recognizer that reenables temporarily disabled snapping. - * @see yfiles.input.CreateEdgeInputMode#disableSnappingRecognizer - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - enableSnappingRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that toggles the orientation of the first orthogonally created segment. - * @see yfiles.input.CreateEdgeInputMode#orthogonalEdgeCreation - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - toggleSegmentOrientationRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that recognizes the finishing gesture that is used to end the edge creation on the - * target node. - *

- * The default is a combination of {@link yfiles.input.MouseEventRecognizers#LEFT_PRESSED} and - * {@link yfiles.input.MouseEventRecognizers#LEFT_RELEASED}. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - finishRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that recognizes the starting gesture that is used to prepare the edge creation on the - * source node. - *

- * The default is {@link yfiles.input.MouseEventRecognizers#LEFT_PRESSED}. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - prepareRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that recognizes the initial dragging gesture that is used to initiate the creation - * after the preparation. - *

- * The default is {@link yfiles.input.MouseEventRecognizers#DRAGGED}. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - draggedRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that recognizes the movement of the end point of the edge. - *

- * The default is {@link yfiles.input.MouseEventRecognizers#MOVED_OR_DRAGGED}. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - endPointMovedRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that recognizes the creation of a bend. - *

- * The default is {@link yfiles.input.MouseEventRecognizers#LEFT_RELEASED}. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - createBendRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that determines cancel events. - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - cancelRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that determines bend removal events. - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - removeBendRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that determines whether dynamic port candidates should be resolved. - *

- * By default this is {@link yfiles.input.KeyEventRecognizers#SHIFT_PRESSED}. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - portCandidateResolutionRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that recognizes the finishing gesture that is used to end the edge creation on the - * target node by a touch gesture. - *

- * The default is {@link yfiles.input.TouchEventRecognizers#TOUCH_UP_PRIMARY}. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - finishRecognizerTouch:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that recognizes the starting gesture that is used to prepare the edge creation on the - * source node via touch. - *

- * The default is {@link yfiles.input.TouchEventRecognizers#TOUCH_LONG_PRESSED_PRIMARY}. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - prepareRecognizerTouch:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that recognizes the initial dragging gesture that is used to initiate the creation - * after the preparation via touch. - *

- * The default is {@link yfiles.input.TouchEventRecognizers#TOUCH_MOVED_PRIMARY}. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - draggedRecognizerTouch:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that recognizes the creation of a bend via touch. - *

- * The default is {@link yfiles.input.TouchEventRecognizers#TOUCH_UP_PRIMARY}. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - createBendRecognizerTouch:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that determines cancel events via touch. - *

- * The default is {@link yfiles.input.TouchEventRecognizers#TOUCH_MULTI_TAPPED_SECONDARY}. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - cancelRecognizerTouch:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the event recognizer that determines bend removal events via touch. - *

- * The default is {@link yfiles.input.TouchEventRecognizers#TOUCH_LONG_PRESSED_SECONDARY}. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - removeBendRecognizerTouch:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets whether or not to display possible port candidates during the creation of the edge. - *

- * The default is true. - *

- * @default true - * @type {boolean} - */ - showPortCandidates:boolean; - /** - * Gets or sets whether or not edges are allowed to connect to other edges. - *

- * The default is false. - *

- * @default false - * @type {boolean} - */ - allowEdgeToEdgeConnections:boolean; - /** - * Gets or sets the distance in the view coordinate system that determines how far the mouse should be snapped to a port - * candidate if {@link yfiles.input.CreateEdgeInputMode#snapToTargetCandidate} is enabled. - *

- * The default value is 20. - *

- * @default 20.0 - * @type {number} - */ - snapDistance:number; - /** - * Gets or sets the {@link yfiles.input.CreateEdgeInputMode#snapContext} which manages snapping model items to certain coordinates (for instance, other items). - *

- * If set to null (the default) this input mode tries to obtain the {@link yfiles.input.CreateEdgeInputMode#snapContext} from the {@link yfiles.input.IInputModeContext}. To explicitly - * disable snapping, a {@link yfiles.input.CreateEdgeInputMode#snapContext} implementation that does nothing has to be set to this instance. - *

- * @type {yfiles.input.SnapContext} - */ - snapContext:yfiles.input.SnapContext; - /** - * Gets or sets the {@link yfiles.view.ICanvasObjectDescriptor} that is used for visualizing the - * {@link yfiles.input.IPortCandidate}s in the canvas during the edit. - *

- * This descriptor is queried for the {@link yfiles.view.IVisualCreator} to obtain the visualizations for the candidates that are - * not currently closest. By default an instance of {@link yfiles.view.DefaultPortCandidateDescriptor} is used. - *

- * @see yfiles.input.CreateEdgeInputMode#closestCandidateDescriptor - * @type {yfiles.view.ICanvasObjectDescriptor} - */ - candidateDescriptor:yfiles.view.ICanvasObjectDescriptor; - /** - * Gets or sets the {@link yfiles.view.ICanvasObjectDescriptor} that is used for visualizing the closest {@link yfiles.input.IPortCandidate} - * in the canvas during the edit. - *

- * This descriptor is queried for the {@link yfiles.view.IVisualCreator} to obtain the visualization for the currently closest - * candidate. By default an instance of {@link yfiles.view.DefaultPortCandidateDescriptor} is used. - *

- * @see yfiles.input.CreateEdgeInputMode#candidateDescriptor - * @type {yfiles.view.ICanvasObjectDescriptor} - */ - closestCandidateDescriptor:yfiles.view.ICanvasObjectDescriptor; - /** - * Gets or sets the distance in the view coordinate system that determines how far the mouse should be snapped to a - * horizontal or vertical line. - *

- * The default value is 5. - *

- * @default 5.0 - * @type {number} - */ - orthogonalSnapDistance:number; - /** - * Gets or sets a property that determines whether the mouse should be forced to snap to the nearest valid port candidate - * if the mouse hovers over a target node. - *

- * If the nearest port candidate is farther away than {@link yfiles.input.CreateEdgeInputMode#snapDistance} and the mouse hovers over a valid {@link yfiles.input.CreateEdgeInputMode#getTarget target}, this property will cause - * the mouse to snap to the nearest valid candidate. The default is true. - *

- * @default true - * @type {boolean} - */ - forceSnapToCandidate:boolean; - /** - * Gets or sets a property that determines whether this mode should use only the {@link yfiles.input.CreateEdgeInputMode#getTargetPortCandidates target port candidates} of the node the - * mouse currently hovers over. - *

- * The default is true. - *

- * @see yfiles.input.CreateEdgeInputMode#showPortCandidates - * @see yfiles.input.CreateEdgeInputMode#getTarget - * @see yfiles.input.CreateEdgeInputMode#getTargetPortCandidates - * @default true - * @type {boolean} - */ - useHitItemsCandidatesOnly:boolean; - /** - * Gets or sets the the policy that controls whether edges will be create orthogonally. - *

- * By default orthogonal edge creation is enabled if orthogonal edge editing is enabled on the {@link yfiles.input.GraphEditorInputMode parent input mode}. - *

- * @see yfiles.input.GraphEditorInputMode#orthogonalEdgeEditingContext - * @see yfiles.input.OrthogonalEdgeEditingContext#enabled - * @default yfiles.input.OrthogonalEdgeEditingPolicy.AUTO - * @type {yfiles.input.OrthogonalEdgeEditingPolicy} - */ - orthogonalEdgeCreation:yfiles.input.OrthogonalEdgeEditingPolicy; - /** - * Gets or sets the preferred minimal distance of orthogonal edges. - *

- * This information is needed when deciding which way to route the first segment of an orthogonal edge. - *

- * @default 10.0 - * @type {number} - */ - preferredMinimalEdgeDistance:number; - /** - * Gets or sets a value indicating whether {@link yfiles.input.PortCandidateValidity#DYNAMIC} ports that are part of the {@link yfiles.input.CreateEdgeInputMode#getSourcePortCandidate source port candidates} - * should be resolved for the current mouse location. - *

- * By default this feature is enabled and the {@link yfiles.input.CreateEdgeInputMode#portCandidateResolutionRecognizer} is configured so that the resolution mechanism is used if the user holds the - * shift modifier during the gesture. - *

- * @see yfiles.input.CreateEdgeInputMode#portCandidateResolutionRecognizer - * @see yfiles.input.CreateEdgeInputMode#resolveCandidates - * @default true - * @type {boolean} - */ - resolveSourcePortCandidates:boolean; - /** - * Gets or sets a value indicating whether {@link yfiles.input.PortCandidateValidity#DYNAMIC} ports that are part of the {@link yfiles.input.CreateEdgeInputMode#getTargetPortCandidates target port candidates} - * should be resolved for the current mouse location. - *

- * By default this feature is enabled and the {@link yfiles.input.CreateEdgeInputMode#portCandidateResolutionRecognizer} is configured so that the resolution mechanism is used if the user holds the - * shift modifier during the gesture. - *

- * @see yfiles.input.CreateEdgeInputMode#portCandidateResolutionRecognizer - * @see yfiles.input.CreateEdgeInputMode#resolveCandidates - * @default true - * @type {boolean} - */ - resolveTargetPortCandidates:boolean; - /** - * Gets or sets the width of a node's border which is taken into account when deciding which way to route the first segment - * of an orthogonal edge. - *

- * An edge starting inside a given margin is always pointing away from it. - *

- * @default 0.1 - * @type {number} - */ - nodeBorderWidthRatio:number; - /** - * Gets or sets the ports based edge creation callback. - *

- * The default creator will delegate to {@link yfiles.graph.IGraph#createEdge} and obtain the tag from the {@link yfiles.input.CreateEdgeInputMode#dummyEdge}. It will then copy over - * all bends, labels, and ports from the {@link yfiles.input.CreateEdgeInputMode#dummyEdge}. - *

- * @throws {Stubs.Exceptions.ArgumentError} If the argument is null - * @type {function(yfiles.input.IInputModeContext, yfiles.graph.IGraph, yfiles.input.IPortCandidate, yfiles.input.IPortCandidate, yfiles.graph.IEdge): yfiles.graph.IEdge} - */ - edgeCreator:(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,sourcePortCandidate:yfiles.input.IPortCandidate,targetPortCandidate:yfiles.input.IPortCandidate,templateEdge:yfiles.graph.IEdge)=>yfiles.graph.IEdge; - /** - * Gets or sets whether or not to allow the creation of self loops. - *

- * The default is true, which enables that an edge is connected to a {@link yfiles.graph.IEdge#sourcePort} and {@link yfiles.graph.IEdge#targetPort} that have the same {@link yfiles.graph.IPort#owner}. - *

- * @default true - * @type {boolean} - */ - allowSelfloops:boolean; - /** - * Gets or sets whether an edge creation gesture will be canceled when the gesture is ended on an invalid target and no - * bend may be created there. - *

- * If bend creation is allowed at the target location (i.e. {@link yfiles.input.CreateEdgeInputMode#validBendHitTestable} returns true), the gesture will always continue by creating a - * bend. Otherwise, if this property is true, the gesture will be canceled automatically. - *

- *

- * The default is false, meaning that the gesture must always be canceled explicitely. - *

- * @see yfiles.input.CreateEdgeInputMode#allowCreateBend - * @see yfiles.input.CreateEdgeInputMode#validBendHitTestable - * @type {boolean} - */ - cancelGestureOnInvalidTarget:boolean; - /** - * Gets or sets whether or not to allow the creation of bends. - *

- * The default is true. - *

- * @type {boolean} - */ - allowCreateBend:boolean; - /** - * Gets the dummy edge instance that will be used to render a preview of the edge to be created. - *

- * This instance will be used for rendering the edge during the gesture. If this property is unset initially, factory - * method {@link yfiles.input.CreateEdgeInputMode#createDummyEdge} will be called. - *

- * @type {yfiles.graph.IEdge} - */ - dummyEdge:yfiles.graph.IEdge; - /** - * Gets the dummy graph instance that will hold the items that will render a preview of the newly created edge. - *

- * The dummy edge graph can be used to change the appearance and other properties of the dummy edge, either when starting a - * gesture or during it in response to certain events. Possible actions are: - *

- *
    - *
  • Changing the style of the dummy edge.
  • - *
  • Adding bends to the dummy edge.
  • - *
  • Adding labels to the dummy edge.
  • - *
  • Changing style and other properties of the added labels.
  • - *
- *

- * All changes made to the dummy edge during the gesture will be persisted to the created edge in the original graph. This - * behavior can be changed by setting a custom {@link yfiles.input.CreateEdgeInputMode#edgeCreator}. - *

- *

- * The dummy edge graph only allows operations on the dummy edge. - *

- *

- * If the property is not set initially, method {@link yfiles.input.CreateEdgeInputMode#createDummyEdgeGraph} will be used as the - * factory method. - *

- * @see yfiles.input.CreateEdgeInputMode#dummyEdge - * @type {yfiles.graph.IGraph} - */ - dummyEdgeGraph:yfiles.graph.IGraph; - /** - * Gets or sets the appearance of newly created edges. - *

- * This property directly delegates to the {@link yfiles.graph.IGraph#edgeDefaults} of the {@link yfiles.input.CreateEdgeInputMode#dummyEdgeGraph}. - *

- * @type {yfiles.graph.IEdgeDefaults} - */ - edgeDefaults:yfiles.graph.IEdgeDefaults; - /** - * Gets or sets the candidate for the {@link yfiles.graph.IEdge#sourcePort} of the edge to be created. - *

- * This property will be populated automatically when edge creation has started. - *

- * @type {yfiles.input.IPortCandidate} - */ - sourcePortCandidate:yfiles.input.IPortCandidate; - /** - * Gets or sets the current candidate for the {@link yfiles.graph.IEdge#targetPort} of the edge to be created. - * @type {yfiles.input.IPortCandidate} - */ - targetPortCandidate:yfiles.input.IPortCandidate; - /** - * Adds the given listener for the SourcePortCandidateChanged event that occurs when the value of the {@link yfiles.input.CreateEdgeInputMode#sourcePortCandidate} property changes. - * @param listener The listener to add. - * @see yfiles.input.CreateEdgeInputMode#removeSourcePortCandidateChangedListener - */ - addSourcePortCandidateChangedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the SourcePortCandidateChanged event that occurs when the value of the {@link yfiles.input.CreateEdgeInputMode#sourcePortCandidate} property - * changes. - * @param listener The listener to remove. - * @see yfiles.input.CreateEdgeInputMode#addSourcePortCandidateChangedListener - */ - removeSourcePortCandidateChangedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the TargetPortCandidateChanged event that occurs when the value of the {@link yfiles.input.CreateEdgeInputMode#targetPortCandidate} property changes. - * @param listener The listener to add. - * @see yfiles.input.CreateEdgeInputMode#removeTargetPortCandidateChangedListener - */ - addTargetPortCandidateChangedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the TargetPortCandidateChanged event that occurs when the value of the {@link yfiles.input.CreateEdgeInputMode#targetPortCandidate} property - * changes. - * @param listener The listener to remove. - * @see yfiles.input.CreateEdgeInputMode#addTargetPortCandidateChangedListener - */ - removeTargetPortCandidateChangedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Gets or sets whether after calls to {@link yfiles.input.CreateEdgeInputMode#createEdge} the current undo edit should be canceled - * if the method returns null. - *

- * This should be set to false if you want to perform some undoable actions in these methods and/or in the {@link yfiles.input.CreateEdgeInputMode#edgeCreator} callback, but - * need to return null from any of these methods. Default value is true, meaning that returning null results in canceling - * the composite undo entry. - *

- * @default true - * @type {boolean} - */ - cancelEditImplicitly:boolean; - /** - * Adds the given listener for the EdgeCreated event that occurs after an edge has been created by this mode. - * @param listener The listener to add. - * @see yfiles.input.CreateEdgeInputMode#onEdgeCreated - * @see yfiles.input.CreateEdgeInputMode#removeEdgeCreatedListener - */ - addEdgeCreatedListener(listener:(sender:any,evt:yfiles.graph.EdgeEventArgs)=>void):void; - /** - * Removes the given listener for the EdgeCreated event that occurs after an edge has been created by this mode. - * @param listener The listener to remove. - * @see yfiles.input.CreateEdgeInputMode#onEdgeCreated - * @see yfiles.input.CreateEdgeInputMode#addEdgeCreatedListener - */ - removeEdgeCreatedListener(listener:(sender:any,evt:yfiles.graph.EdgeEventArgs)=>void):void; - /** - * Adds the given listener for the PortAdded event that occurs when this instance {@link yfiles.graph.IGraph#addPort adds a port} to the source or target node - * during completion of the edge creation gesture. - * @param listener The listener to add. - * @see yfiles.input.CreateEdgeInputMode#removePortAddedListener - */ - addPortAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the PortAdded event that occurs when this instance {@link yfiles.graph.IGraph#addPort adds a port} to the source or target - * node during completion of the edge creation gesture. - * @param listener The listener to remove. - * @see yfiles.input.CreateEdgeInputMode#addPortAddedListener - */ - removePortAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Gets or sets whether or not the edge's end point should snap to the current target port candidate during the creation of - * the edge. - *

- * This will make the edge's end point point to the position of the target port candidate. This will result in the preview - * edge looking exactly like the edge after creation. - *

- * @type {boolean} - */ - snapToTargetCandidate:boolean; - /** - * Gets or sets a {@link yfiles.input.IHitTestable} that determines, whether it is valid to start an edge creation gesture here. - *

- * The default implementation returns true if {@link yfiles.input.CreateEdgeInputMode#getSource} yields a non-null value. - *

- * @type {yfiles.input.IHitTestable} - */ - beginHitTestable:yfiles.input.IHitTestable; - /** - * Gets or sets a {@link yfiles.input.IHitTestable} that determines, whether it is valid to finish an edge creation gesture here. - *

- * If fact this hit testable is only queried at all if {@link yfiles.input.CreateEdgeInputMode#forceSnapToCandidate} is disabled and if there is currently no {@link yfiles.input.CreateEdgeInputMode#targetPortCandidate} available. - *

- *

- * The default implementation returns true if there is a node at the given location. - *

- * @type {yfiles.input.IHitTestable} - */ - endHitTestable:yfiles.input.IHitTestable; - /** - * Gets or sets a {@link yfiles.input.IHitTestable} that determines, whether it is valid to create a bend here. - *

- * The default implementation returns always true. - *

- * @type {yfiles.input.IHitTestable} - */ - validBendHitTestable:yfiles.input.IHitTestable; - /** - * Gets a copy of the starting point at which the edge creation gesture started. - * @type {yfiles.geometry.Point} - */ - startPoint:yfiles.geometry.Point; - /** - * Gets the dynamically updated dragging point for the edge creation. - * @type {yfiles.geometry.IPoint} - */ - dragPoint:yfiles.geometry.IPoint; - /** - * Gets whether currently an edge creation is in progress. - *

- * This property yields true after the edge creation has been started and before it has been {@link yfiles.input.CreateEdgeInputMode#cancel cancelled} or finalized. - *

- * @type {boolean} - */ - isCreationInProgress:boolean; - /** - * Adds the given listener for the GestureFinishing event that occurs before the gesture will be finished. - * @param listener The listener to add. - * @see yfiles.input.CreateEdgeInputMode#removeGestureFinishingListener - */ - addGestureFinishingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the GestureFinishing event that occurs before the gesture will be finished. - * @param listener The listener to remove. - * @see yfiles.input.CreateEdgeInputMode#addGestureFinishingListener - */ - removeGestureFinishingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the GestureFinished event that occurs once the gesture has been finished. - * @param listener The listener to add. - * @see yfiles.input.CreateEdgeInputMode#removeGestureFinishedListener - */ - addGestureFinishedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the GestureFinished event that occurs once the gesture has been finished. - * @param listener The listener to remove. - * @see yfiles.input.CreateEdgeInputMode#addGestureFinishedListener - */ - removeGestureFinishedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the GestureStarting event that occurs once the gesture is starting. - * @param listener The listener to add. - * @see yfiles.input.CreateEdgeInputMode#removeGestureStartingListener - */ - addGestureStartingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the GestureStarting event that occurs once the gesture is starting. - * @param listener The listener to remove. - * @see yfiles.input.CreateEdgeInputMode#addGestureStartingListener - */ - removeGestureStartingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the GestureStarted event that occurs once the gesture is initialized and has started. - * @param listener The listener to add. - * @see yfiles.input.CreateEdgeInputMode#removeGestureStartedListener - */ - addGestureStartedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the GestureStarted event that occurs once the gesture is initialized and has started. - * @param listener The listener to remove. - * @see yfiles.input.CreateEdgeInputMode#addGestureStartedListener - */ - removeGestureStartedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the Moving event that occurs at the start of every drag or move. - * @param listener The listener to add. - * @see yfiles.input.CreateEdgeInputMode#removeMovingListener - */ - addMovingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the Moving event that occurs at the start of every drag or move. - * @param listener The listener to remove. - * @see yfiles.input.CreateEdgeInputMode#addMovingListener - */ - removeMovingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the Moved event that occurs at the end of every drag or move. - * @param listener The listener to add. - * @see yfiles.input.CreateEdgeInputMode#removeMovedListener - */ - addMovedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the Moved event that occurs at the end of every drag or move. - * @param listener The listener to remove. - * @see yfiles.input.CreateEdgeInputMode#addMovedListener - */ - removeMovedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the GestureCanceled event that occurs when the gesture has been canceled. - * @param listener The listener to add. - * @see yfiles.input.CreateEdgeInputMode#removeGestureCanceledListener - */ - addGestureCanceledListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the GestureCanceled event that occurs when the gesture has been canceled. - * @param listener The listener to remove. - * @see yfiles.input.CreateEdgeInputMode#addGestureCanceledListener - */ - removeGestureCanceledListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the GestureCanceling event that occurs before the gesture will be canceled. - * @param listener The listener to add. - * @see yfiles.input.CreateEdgeInputMode#removeGestureCancelingListener - */ - addGestureCancelingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the GestureCanceling event that occurs before the gesture will be canceled. - * @param listener The listener to remove. - * @see yfiles.input.CreateEdgeInputMode#addGestureCancelingListener - */ - removeGestureCancelingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the EdgeCreationStarted event that occurs when the edge creation has started. - *

- * The edge that is stored in the Item property is the {@link yfiles.input.CreateEdgeInputMode#dummyEdge} that is used during creation. - *

- * @param listener The listener to add. - * @see yfiles.input.CreateEdgeInputMode#removeEdgeCreationStartedListener - */ - addEdgeCreationStartedListener(listener:(sender:any,evt:yfiles.graph.EdgeEventArgs)=>void):void; - /** - * Removes the given listener for the EdgeCreationStarted event that occurs when the edge creation has started. - *

- * The edge that is stored in the Item property is the {@link yfiles.input.CreateEdgeInputMode#dummyEdge} that is used during creation. - *

- * @param listener The listener to remove. - * @see yfiles.input.CreateEdgeInputMode#addEdgeCreationStartedListener - */ - removeEdgeCreationStartedListener(listener:(sender:any,evt:yfiles.graph.EdgeEventArgs)=>void):void; - /** - * Gets or sets the event recognizer that will be queried to decide if bend creation is enforced. - *

- * The default is {@link yfiles.input.KeyEventRecognizers#CONTROL_PRESSED} or {@link yfiles.input.KeyEventRecognizers#META_PRESSED}. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - enforceBendCreationRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets the Graph this mode is acting upon. - * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.CreateEdgeInputMode; - } - export enum EdgeSegmentDirection{ - /** - * The edge segment is going into north direction - */ - NORTH, - /** - * The edge segment is going into east direction - */ - EAST, - /** - * The edge segment is going into south direction - */ - SOUTH, - /** - * The edge segment is going into west direction - */ - WEST - } - export enum AdjustContentRectPolicy{ - /** - * The content rectangle is not adjusted automatically after interactive changes. - */ - NEVER, - /** - * The new content rectangle is recalculated with the union of the previous content rectangle and the new - * {@link yfiles.view.GraphComponent#fitGraphBounds bounds of the graph}. - */ - UNION, - /** - * The new content rectangle is recalculated with the new {@link yfiles.view.GraphComponent#fitGraphBounds bounds of the graph}. - */ - ALWAYS - } - /** - * A complex {@link yfiles.input.IInputMode} that can be used in a {@link yfiles.input.GraphEditorInputMode#graphComponent} to edit an {@link yfiles.graph.IGraph} instance. - *

- * This class delegates most of the work to minor {@link yfiles.input.IInputMode} implementations. However it contains a number of - * properties that influence the general behavior: - *

- *
    - *
  • {@link yfiles.input.GraphInputMode#selectableItems} – Determines the types of items that can be selected at all.
  • - *
  • {@link yfiles.input.GraphInputMode#selectablePredicate} – Allows to further constrain {@link yfiles.input.GraphInputMode#selectableItems} with a predicate.
  • - *
  • {@link yfiles.input.GraphInputMode#marqueeSelectableItems} – Determines the types of items that can be selected with {@link yfiles.input.MarqueeSelectionInputMode marquee selection}.
  • - *
  • {@link yfiles.input.GraphInputMode#clickSelectableItems} – Determines the types of items that can be selected by {@link yfiles.input.ClickInputMode clicking them}.
  • - *
  • - * {@link yfiles.input.GraphInputMode#detailSelectionRecognizer} – Determines when to use a detail click selection mode, which allows for selecting the item that is directly under the - * mouse without taking into account the {@link yfiles.input.GraphInputMode#clickHitTestOrder}. - *
  • - *
  • {@link yfiles.input.GraphInputMode#clickHitTestOrder} – Determines the priorities for hit tests during mouse clicks to determine which items should get {@link yfiles.input.GraphInputMode#addItemClickedListener click events}.
  • - *
  • {@link yfiles.input.GraphInputMode#doubleClickHitTestOrder} – Determines the priorities for hit tests when {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener double-clicking items}.
  • - *
  • {@link yfiles.input.GraphEditorInputMode#movableItems} – Determines the type of the items that can be {@link yfiles.input.GraphEditorInputMode#moveInputMode moved} with the mouse.
  • - *
  • {@link yfiles.input.GraphEditorInputMode#showHandleItems} – Determines the type of the items whose {@link yfiles.input.IHandle}s should be shown and movable by the {@link yfiles.input.GraphEditorInputMode#handleInputMode}.
  • - *
  • {@link yfiles.input.GraphEditorInputMode#deletableItems} – Determines the type of the items that can be deleted by {@link yfiles.input.GraphEditorInputMode#deleteSelection}.
  • - *
  • {@link yfiles.input.GraphEditorInputMode#deletablePredicate} – Allows to further constrain {@link yfiles.input.GraphEditorInputMode#deletableItems} with a predicate.
  • - *
  • {@link yfiles.input.GraphEditorInputMode#labelEditableItems} – Determines the type of the items that can have their labels edited.
  • - *
  • {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations} – Determines whether this input mode should allow grouping operations at all.
  • - *
  • {@link yfiles.input.GraphEditorInputMode#allowGroupSelection} – Determines whether this input mode should allow {@link yfiles.input.GraphEditorInputMode#groupSelection grouping the current selection}.
  • - *
  • {@link yfiles.input.GraphEditorInputMode#allowUngroupSelection} – Determines whether this input mode should allow {@link yfiles.input.GraphEditorInputMode#ungroupSelection ungrouping the current selection}.
  • - *
  • - * {@link yfiles.input.GraphEditorInputMode#allowClearSelection} – Determines whether this input mode should allow {@link yfiles.input.GraphInputMode#clearSelection clearing the selection}. This has implications both for the {@link yfiles.input.ICommand#DESELECT_ALL} - * and for click/marquee selection which usually clear the selection unless the {@link yfiles.input.GraphInputMode#multiSelectionRecognizer} is pressed. - *
  • - *
  • {@link yfiles.input.GraphInputMode#allowClipboardOperations} – Determines whether this input mode should enable {@link yfiles.graph.GraphClipboard graph clipboard operations.}
  • - *
  • {@link yfiles.input.GraphEditorInputMode#allowDuplicate} – Determines whether this input mode should enable {@link yfiles.graph.GraphClipboard graph clipboard's} {@link yfiles.graph.GraphClipboard#duplicate} operation.
  • - *
  • {@link yfiles.input.GraphEditorInputMode#allowEditLabel} – Determines whether this input mode should allow editing labels.
  • - *
  • {@link yfiles.input.GraphEditorInputMode#allowReparentNodes} – Determines whether this input mode should allow {@link yfiles.input.IReparentNodeHandler reparenting nodes to other groups.}
  • - *
  • {@link yfiles.input.GraphEditorInputMode#allowCreateNode} – Determines whether this input mode should allow {@link yfiles.input.GraphEditorInputMode#nodeCreator creating new nodes} via simple mouse clicks.
  • - *
  • {@link yfiles.input.GraphEditorInputMode#allowCreateEdge} – Determines whether {@link yfiles.input.GraphEditorInputMode#createEdgeInputMode} should be {@link yfiles.input.CreateEdgeInputMode#enabled} to allow for creating new edges.
  • - *
  • {@link yfiles.input.GraphEditorInputMode#allowEditLabelOnDoubleClick} – Determines whether labels should be editable on otherwise unhandled double clicks.
  • - *
  • {@link yfiles.input.GraphEditorInputMode#allowReverseEdge} – Determines whether edges can be reversed.
  • - *
  • {@link yfiles.input.GraphEditorInputMode#allowCreateBend} – Determines whether the {@link yfiles.input.GraphEditorInputMode#createBendInputMode} should be {@link yfiles.input.CreateBendInputMode#enabled} to allow for creating new bends.
  • - *
  • {@link yfiles.input.NavigationInputMode#allowEnterGroup} – Determines whether the mode allows for {@link yfiles.input.NavigationInputMode#enterGroup entering} group nodes in {@link yfiles.graph.IFoldingView}s.
  • - *
  • {@link yfiles.input.NavigationInputMode#allowExitGroup} – Determines whether the mode allows for {@link yfiles.input.NavigationInputMode#exitGroup exiting} the current group node in {@link yfiles.graph.IFoldingView}s.
  • - *
  • {@link yfiles.input.NavigationInputMode#allowCollapseGroup} – Determines whether the mode allows for {@link yfiles.input.NavigationInputMode#collapseGroup collapsing} group nodes in {@link yfiles.graph.IFoldingView}s.
  • - *
  • {@link yfiles.input.NavigationInputMode#allowExpandGroup} – Determines whether the mode allows for {@link yfiles.input.NavigationInputMode#expandGroup expanding} group nodes in {@link yfiles.graph.IFoldingView}s.
  • - *
  • - * {@link yfiles.input.ItemHoverInputMode#hoverItems} – Determines which items should be reported as being hovered through the {@link yfiles.input.ItemHoverInputMode#addHoveredItemChangedListener corresponding event} in this instance's - * {@link yfiles.input.ItemHoverInputMode}. - *
  • - *
  • {@link yfiles.input.GraphInputMode#shouldInstallCommand} – Determines which of the built-in {@link yfiles.input.ICommand}s this input mode should provide and install.
  • - *
- *

- * By default, {@link yfiles.input.GraphEditorInputMode} supports the following commands. Most of them have default keybindings: - *

- *
    - *
  • {@link yfiles.input.ICommand#UNDO} (Ctrl+Z) – Undoes the last operation. Can be disabled with {@link yfiles.input.GraphEditorInputMode#allowUndoOperations}.
  • - *
  • {@link yfiles.input.ICommand#REDO} (Ctrl+Y) – Redoes the last operation that was undone. Can be disabled with {@link yfiles.input.GraphEditorInputMode#allowUndoOperations}.
  • - *
  • {@link yfiles.input.ICommand#SELECT_ALL} (Ctrl+A) – Selects all items. Can be configured with {@link yfiles.input.GraphInputMode#selectableItems} and {@link yfiles.input.GraphInputMode#selectablePredicate}.
  • - *
  • {@link yfiles.input.ICommand#DESELECT_ALL} (Ctrl+Shift+A) – Clears the current selection. Can be disabled with {@link yfiles.input.GraphEditorInputMode#allowClearSelection}.
  • - *
  • {@link yfiles.input.ICommand#CUT} (Ctrl+X, Shift+Del) – Cuts the current selection and places it in the clipboard. Can be disabled with {@link yfiles.input.GraphInputMode#allowClipboardOperations}.
  • - *
  • {@link yfiles.input.ICommand#COPY} (Ctrl+C, Ctrl+Ins) – Copies the current selection to the clipboard. Can be disabled with {@link yfiles.input.GraphInputMode#allowClipboardOperations}.
  • - *
  • {@link yfiles.input.ICommand#PASTE} (Ctrl+V, Shift+Ins) – Pastes the current clipboard contents into the graph. Can be disabled with {@link yfiles.input.GraphInputMode#allowClipboardOperations}.
  • - *
  • {@link yfiles.input.ICommand#DUPLICATE} (Ctrl+D) – Duplicates the current selection. Can be disabled with {@link yfiles.input.GraphEditorInputMode#allowDuplicate}.
  • - *
  • {@link yfiles.input.ICommand#DELETE} (Del) – Deletes the current selection. Can be configured with {@link yfiles.input.GraphEditorInputMode#deletablePredicate} and {@link yfiles.input.GraphEditorInputMode#deletableItems}.
  • - *
  • {@link yfiles.input.ICommand#ADD_LABEL} (Shift+F2) – Adds a new label to the selected item. Can be configured with {@link yfiles.input.GraphEditorInputMode#labelEditableItems} and disabled with {@link yfiles.input.GraphEditorInputMode#allowAddLabel}.
  • - *
  • {@link yfiles.input.ICommand#EDIT_LABEL} (F2) – Edits an existing label or adds a new one to the selected item. Can be configured with {@link yfiles.input.GraphEditorInputMode#labelEditableItems} and disabled with {@link yfiles.input.GraphEditorInputMode#allowEditLabel}.
  • - *
  • {@link yfiles.input.ICommand#REVERSE_EDGE} (Ctrl+R) – Reverses the direction of the selected edges. Can be disabled with {@link yfiles.input.GraphEditorInputMode#allowReverseEdge}.
  • - *
  • {@link yfiles.input.ICommand#GROUP_SELECTION} (Ctrl+G) – Creates a new group node and places the currently selected nodes into it. Can be disabled with {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations} and {@link yfiles.input.GraphEditorInputMode#allowGroupSelection}.
  • - *
  • {@link yfiles.input.ICommand#UNGROUP_SELECTION} (Ctrl+U) – Creates a new group node and places the currently selected nodes into it. Can be disabled with {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations} and {@link yfiles.input.GraphEditorInputMode#allowUngroupSelection}.
  • - *
  • {@link yfiles.input.ICommand#ADJUST_GROUP_NODE_SIZE} (Ctrl+Shift+G) – Adjusts the sizes of the selected group nodes to fit exactly around their contents. Can be disabled with {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations} and {@link yfiles.input.GraphEditorInputMode#allowAdjustGroupNodeSize}.
  • - *
- *

- * All commands can also be selectively disabled by using the {@link yfiles.input.GraphInputMode#availableCommands} collection. Furthermore, there are a few commands provided - * by {@link yfiles.input.GraphInputMode#navigationInputMode}: - *

- *
    - *
  • {@link yfiles.input.ICommand#COLLAPSE_GROUP} (Ctrl+Minus) – Collapses the currently selected group nodes. Can be disabled with {@link yfiles.input.NavigationInputMode#allowCollapseGroup} of {@link yfiles.input.GraphInputMode#navigationInputMode}.
  • - *
  • {@link yfiles.input.ICommand#EXPAND_GROUP} (Ctrl+Plus) – Expands the currently selected group nodes. Can be disabled with {@link yfiles.input.NavigationInputMode#allowExpandGroup} of {@link yfiles.input.GraphInputMode#navigationInputMode}.
  • - *
  • - * {@link yfiles.input.ICommand#TOGGLE_EXPANSION_STATE} (Ctrl+Multiply) – Collapses expanded group nodes and expands collapsed group nodes in the current selection. Can be disabled with {@link yfiles.input.NavigationInputMode#allowCollapseGroup} and {@link yfiles.input.NavigationInputMode#allowExpandGroup} of - * {@link yfiles.input.GraphInputMode#navigationInputMode}. - *
  • - *
  • {@link yfiles.input.ICommand#ENTER_GROUP} (Ctrl+Enter) – Replaces the currently displayed graph with the contents of the selected group node. Can be disabled with {@link yfiles.input.NavigationInputMode#allowEnterGroup} of {@link yfiles.input.GraphInputMode#navigationInputMode}.
  • - *
  • - * {@link yfiles.input.ICommand#EXIT_GROUP} (Ctrl+Backspace) – Replaces the currently displayed graph with the contents of the parent of the group node whose contents are currently - * displayed. Can be disabled with {@link yfiles.input.NavigationInputMode#allowExitGroup} of {@link yfiles.input.GraphInputMode#navigationInputMode}. - *
  • - *
- *

- * {@link yfiles.input.GraphEditorInputMode} can be configured to automatically {@link yfiles.input.GraphEditorInputMode#adjustContentRect adjust the content rectangle} of the {@link yfiles.input.GraphEditorInputMode#graphComponent} whenever the - * graph is changed using gestures. - *
- * This class contains a number of public methods that can be used to programmatically perform the corresponding actions, - * too. - *
- * Setting the {@link yfiles.input.GraphEditorInputMode#nodeCreator} to another instance or null changes the way nodes are created. Also the various minor {@link yfiles.input.IInputMode} - * instances can be disabled, to change the behavior, too. - *

- *

- * This input mode manages a set of specialized input modes, each handling a specific part of the interaction with the - * graph. The following list details those along with their default - * {@link yfiles.input.IInputMode#priority priorities}. Lower priorities come earlier when handling events. - *

- *
    - *
  • {@link yfiles.input.WaitInputMode} (−1) – Disables this input mode when layouts or animations run.
  • - *
  • {@link yfiles.input.GraphEditorInputMode#handleInputMode} (0) – Deals with displaying handles on or around items and interacting with them.
  • - *
  • {@link yfiles.input.KeyboardInputMode} (0) – Handles commands and arbitrary keyboard shortcuts.
  • - *
  • {@link yfiles.input.ClickInputMode} (10) – Handles mouse clicks and double-clicks.
  • - *
  • {@link yfiles.input.TapInputMode} (20) – Handles taps and double-tap.
  • - *
  • {@link yfiles.input.MoveViewportInputMode} (39) – Allows panning the viewport.
  • - *
  • {@link yfiles.input.GraphEditorInputMode#moveLabelInputMode} (39) – Allows moving labels to new positions.
  • - *
  • {@link yfiles.input.GraphEditorInputMode#moveInputMode} (40) – Allows moving items that are not labels.
  • - *
  • {@link yfiles.input.GraphEditorInputMode#createBendInputMode} (42) – Allows creating bends on edges.
  • - *
  • {@link yfiles.input.GraphEditorInputMode#createEdgeInputMode} (45) – Allows creating edges
  • - *
  • {@link yfiles.input.MarqueeSelectionInputMode} (50) – Allows dragging a rectangle to select items within it.
  • - *
  • {@link yfiles.input.ItemHoverInputMode} (55) – Provides events to indicate that the mouse pointer hovers over an item.
  • - *
  • - * {@link yfiles.input.NavigationInputMode} (55) – Provides general navigation facilities, such as navigating from one item to another with the arrow keys, collapsing, - * expanding, entering or exiting groups, as well as providing commands for those tasks. - *
  • - *
  • {@link yfiles.input.ContextMenuInputMode} (60) – Handles querying the context menu contents based on a location as well as preparing the menu for display.
  • - *
  • {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode} (70) – Allows dropping nodes on the {@link yfiles.input.GraphEditorInputMode#graphComponent}, e.g. for dragging items from a palette.
  • - *
  • {@link yfiles.input.MouseHoverInputMode} (100) – Handles tool tips.
  • - *
  • {@link yfiles.input.GraphEditorInputMode#textEditorInputMode} (100) – Handles editing labels.
  • - *
- *

- * To enable single selection mode, disable {@link yfiles.input.MarqueeSelectionInputMode} and set {@link yfiles.input.GraphInputMode#multiSelectionRecognizer} to - * {@link yfiles.input.EventRecognizers#NEVER}. Remove {@link yfiles.input.ICommand#SELECT_ALL} and {@link yfiles.input.ICommand#TOGGLE_ITEM_SELECTION} - * from {@link yfiles.input.GraphInputMode#availableCommands} and from {@link yfiles.input.GraphInputMode#navigationInputMode}.{@link yfiles.input.NavigationInputMode#availableCommands}. An example can be found in demo.yfiles.input.singleselection. - *

- *

- * An overview of this input mode is given in the section {@link @DGUIDE_PREFIX@/interaction-geim.html Editing Graphs}. Additionally, specific support for graph - * hierarchies is discussed in {@link @DGUIDE_PREFIX@/interaction-support.html#interaction-grouping Supported User Interactions: Grouping}. - *

- *

Related demos:

- *
    - *
  • Demo: SimpleEditorForm, Demo.yFiles.Graph.SimpleEditor
  • - *
  • Demo: GraphEditorForm, Demo.yFiles.GraphEditor
  • - *
  • Demo: InputModeForm, Demo.yFiles.Graph.InputModes
  • - *
  • Demo: DataSetGraphForm, Demo.yFiles.Graph.DataSetGraph
  • - *
  • Demo: TreeLayoutForm, Demo.yFiles.Graph.Tree
  • - *
  • Demo: SingleSelectionWindow, Demo.yFiles.Graph.Input.SingleSelection
  • - *
  • Tutorial: 01 Getting Started, step 06 Basic Interaction
  • - *
- * @see yfiles.input.GraphEditorInputMode#createEdgeInputMode - * @see yfiles.input.GraphEditorInputMode#createBendInputMode - * @see yfiles.input.GraphEditorInputMode#moveLabelInputMode - * @see yfiles.input.GraphEditorInputMode#nodeDropInputMode - * @class - * @extends {yfiles.input.GraphInputMode} - */ - export interface GraphEditorInputMode extends yfiles.input.GraphInputMode{} - export class GraphEditorInputMode { - /** - * Creates a new instance that is not bound to an existing graph or selection, initially. - *

- * The {@link yfiles.graph.IGraph} and {@link yfiles.view.IGraphSelection} instances are obtained later from the {@link yfiles.input.IInputModeContext} - * once this mode gets {@link yfiles.input.GraphEditorInputMode#install installed} in a suitable canvas control. - *

- */ - constructor(); - /** - * Adds a new label to the given item interactively. - *

- * This will activate the {@link yfiles.input.GraphEditorInputMode#textEditorInputMode} to let the user interactively enter the label's text and unless the user cancels label creation - * the returned {@link Promise.} will contain the label. - *

- *

- * The text that the user enters may be {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener validated} before the label is actually added. - *

- *

- * This method works nearly identical to {@link yfiles.input.GraphEditorInputMode#createLabel}. The only difference is when either - * the {@link yfiles.input.GraphEditorInputMode#addLabelAddingListener LabelAdding} event is handled, or owner - * has an - * {@link yfiles.input.IEditLabelHelper}, and via those instead of adding a label an existing one should be edited. This method - * will edit that label instead of adding a new one. - *

- * @param owner The item to add a label to. - * @returns A promise that fulfills with either the newly created label or null if the {@link #addEditingCanceledListener editing was canceled} or the text did not - * {@link #addValidateLabelTextListener validate}. - */ - addLabel(owner:yfiles.graph.ILabelOwner):Promise; - /** - * Updates the {@link yfiles.view.CanvasComponent#contentRect} using {@link yfiles.view.CanvasComponent#updateContentRect} and {@link yfiles.input.GraphEditorInputMode#contentRectMargins} - *

- * This method is called whenever the content changes and takes the {@link yfiles.input.GraphEditorInputMode#adjustContentRectPolicy} into account. - *

- */ - adjustContentRect():void; - /** - * {@link yfiles.graph.IGraph#adjustGroupNodeLayout Adjusts the size} of the group nodes in the enumerable. - *

- * This action is executed in response to the {@link yfiles.input.ICommand#ADJUST_GROUP_NODE_SIZE} if {@link yfiles.input.GraphEditorInputMode#allowAdjustGroupNodeSize} is set to true. - *

- * @param nodes The nodes to adjust their sizes. - * @protected - */ - adjustGroupNodeSize(nodes:yfiles.collections.IEnumerable):void; - /** - * {@link yfiles.graph.IGraph#adjustGroupNodeLayout Adjusts the size} of the selected group nodes. - *

- * This method delegates to {@link yfiles.input.GraphEditorInputMode#adjustGroupNodeSize} with the {@link yfiles.view.IGraphSelection#selectedNodes currently selected nodes}. - *

- * @see yfiles.input.GraphEditorInputMode#adjustGroupNodeSize - * @see yfiles.input.ICommand#ADJUST_GROUP_NODE_SIZE - */ - adjustGroupNodeSizes():void; - /** - * Adjusts the node's {@link yfiles.graph.INode#layout} to adhere to possible {@link yfiles.input.INodeSizeConstraintProvider size constraints}. - *

- * This method will use the {@link yfiles.input.INodeSizeConstraintProvider} for {@link yfiles.graph.INode} that can be found in their {@link yfiles.graph.ILookup} - * to make sure they are still valid. The actual work of this method will be delegated to - * {@link yfiles.input.GraphEditorInputMode#setNodeLayout}. - *

- * @param node The node to possibly adjust the size of. - */ - adjustToSizeConstraints(node:yfiles.graph.INode):void; - /** - * Creates a node on click. - *

- * This method is only called if no item has been hit and {@link yfiles.input.GraphInputMode#clickClearSelection} returned false. - *

- * @param context The input mode context. - * @param location The location of the click. - * @returns true if a node was successfully created, otherwise false. - * @see yfiles.input.GraphEditorInputMode#shouldClickCreateNode - * @protected - */ - clickCreateNode(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * Closes the label editor if it is currently open. - * @param cancel Whether to cancel the editor and discard changes. - */ - closeLabelEditor(cancel:boolean):void; - /** - * Factory method for the {@link yfiles.input.GraphEditorInputMode#createBendInputMode} property. - *

- * This method will be called upon first access to the {@link yfiles.input.GraphEditorInputMode#createBendInputMode} property. - *

- * @returns a new instance of CreateBendInputMode - * @protected - */ - createCreateBendInputMode():yfiles.input.CreateBendInputMode; - /** - * Factory method for the {@link yfiles.input.GraphEditorInputMode#createEdgeInputMode} property. - *

- * This method will be called upon first access to the {@link yfiles.input.GraphEditorInputMode#createEdgeInputMode} property. - *

- * @returns a new instance of CreateEdgeInputMode - * @protected - */ - createCreateEdgeInputMode():yfiles.input.CreateEdgeInputMode; - /** - * Factory method for the {@link yfiles.input.GraphEditorInputMode#handleInputMode} property. - *

- * This method will be called upon first access to the {@link yfiles.input.GraphEditorInputMode#handleInputMode} property. - *

- * @returns a new instance of HandleInputMode - * @protected - */ - createHandleInputMode():yfiles.input.HandleInputMode; - /** - * Interactively creates a new label for the provided label owner. - *

- * This method will invoke the text editor that will let the user edit the text of the label. If the user commits the label - * text the label will be added to the label owner. - *

- *

- * The text that the user enters may be {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener validated} before the label is actually added. - *

- *

- * This method works nearly identical to {@link yfiles.input.GraphEditorInputMode#addLabel}. The only difference is when either the - * {@link yfiles.input.GraphEditorInputMode#addLabelAddingListener LabelAdding} event is handled, or owner - * has an - * {@link yfiles.input.IEditLabelHelper}, and via those instead of adding a label an existing one should be edited. This method - * will do nothing instead of editing an existing label or adding a new one in that case. - *

- * @param owner The item to create a new label for. - * @returns A Promise that fulfills with the edited label instance. It will fulfill with null if {@link #addEditingCanceledListener editing was canceled} or the text - * did not {@link #addValidateLabelTextListener validate}. - */ - createLabel(owner:yfiles.graph.ILabelOwner):Promise; - /** - * Factory method for the {@link yfiles.input.GraphEditorInputMode#moveInputMode} property. - *

- * This method will be called upon first access to the {@link yfiles.input.MoveInputMode} property. - *

- * @returns a new instance of MoveInputMode - * @protected - */ - createMoveInputMode():yfiles.input.MoveInputMode; - /** - * Factory method for the {@link yfiles.input.GraphEditorInputMode#moveLabelInputMode} property. - *

- * This method will be called upon first access to the {@link yfiles.input.GraphEditorInputMode#moveLabelInputMode} property. - *

- * @returns a new instance of {@link } - * @protected - */ - createMoveLabelInputMode():yfiles.input.MoveLabelInputMode; - /** - * Helper method that can be used to create a {@link yfiles.input.MoveInputMode} instance that can be used to move unselected model - * items. - *

- * In order to use this mode, the created instance should be installed in a {@link yfiles.input.GraphEditorInputMode} like this but - * using a smaller {@link yfiles.input.IInputMode#priority priority} value than the {@link yfiles.input.IInputMode#priority priority} of the mode that is {@link yfiles.input.GraphEditorInputMode#moveInputMode installed by default}. - *

- * @param recognizer Use this instance to make this mode work under certain conditions only. null for default behavior, one of the {@link } - * constants, e.g. for alternate behavior. - * @returns A {@link #moveInputMode} instance that uses the {@link } instances of the items that are hit at the position of the - * cursor, regardless of their selection state. - */ - createMoveUnselectedInputMode(recognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean):yfiles.input.MoveInputMode; - /** - * Creates a node given a certain click point. - *

- * This implementation delegates to the current node creation callback or simply returns null if there is no such callback - * or {@link yfiles.input.GraphEditorInputMode#allowCreateNode} yields false. Finally, it tries to {@link yfiles.input.GraphInputMode#setCurrentItem set the node as the current item}. - *

- * @param location The point where the mouse had been clicked. - * @returns The newly created node or null. - * @see yfiles.input.GraphEditorInputMode#onNodeCreated - * @see yfiles.input.GraphInputMode#setCurrentItem - */ - createNode(location:yfiles.geometry.Point):yfiles.graph.INode; - /** - * Factory method that creates the {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode} lazily the first time the property is accessed. - * @returns A plain new instance of the {@link } type, which is initially {@link #enabled disabled}. - * @protected - */ - createNodeDropInputMode():yfiles.input.NodeDropInputMode; - /** - * Factory method for the {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler} property. - *

- * This method will be called upon first access to the {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler} property. - *

- * @returns a new instance of {@link #reparentNodeHandler} - * @protected - */ - createReparentNodeHandler():yfiles.input.IReparentNodeHandler; - /** - * Factory method for the {@link yfiles.input.GraphEditorInputMode#textEditorInputMode} property. - *

- * This method will be called upon first access to the {@link yfiles.input.GraphEditorInputMode#textEditorInputMode} property. - *

- * @returns a new instance of TextEditorInputMode - * @protected - */ - createTextEditorInputMode():yfiles.input.TextEditorInputMode; - /** - * Cuts and inserts the currently selected elements to the clipboard. - */ - cut():void; - /** - * This method deletes the currently selected elements. - *

- * If the {@link yfiles.view.GraphSelection} is non-empty this implementation triggers the {@link yfiles.input.GraphEditorInputMode#addDeletingSelectionListener DeletingSelection} - * event, possibly a number of {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} - * events, and a final {@link yfiles.input.GraphEditorInputMode#deleteSelection} event. Note that {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} - * will not be called for items that are removed implicitly, e.g. if the event is triggered for a node, its labels, ports, - * and adjacent edges will not be reported separately. - *

- * @see yfiles.input.GraphEditorInputMode#addDeletingSelectionListener - * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener - * @see yfiles.input.GraphEditorInputMode#addDeletedSelectionListener - */ - deleteSelection():void; - /** - * Initiates the {@link yfiles.input.GraphEditorInputMode#handleInputMode} to drag the given bend. - * @param bend The bend to drag. - * @see yfiles.input.GraphEditorInputMode#onCreateBendInputModeBendCreated - */ - dragBend(bend:yfiles.graph.IBend):void; - /** - * Duplicates the selected elements. - */ - duplicateSelection():void; - /** - * Starts editing the given label. - *

- * This implementation uses the {@link yfiles.input.TextEditorInputMode} to display an editor to edit the label. The text that the - * user enters may be {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener validated} before the label is actually edited. - *

- *

- * The label to edit can be a - * {@link yfiles.graph.SimpleLabel}, which will be edited as usual, except that the label text changes will be written directly - * back into the instance. - *

- *

- * This method will raise the {@link yfiles.input.GraphEditorInputMode#addLabelEditingListener LabelEditing} - * event and query the {@link yfiles.input.IEditLabelHelper} for the label and its owner, but will ignore the result except for the - * {@link yfiles.input.LabelEditingEventArgs#textEditorInputModeConfigurator} property on the {@link yfiles.input.LabelEditingEventArgs}. Thus editing a label via this method cannot be prevented by event - * handlers or {@link yfiles.input.IEditLabelHelper}s. - *

- * @param label The label to edit. - * @returns A Promise that fulfills with the edited label instance. It will also fulfill with the instance if editing is {@link #addEditingCanceledListener editing was canceled} - * or the text did not {@link #addValidateLabelTextListener validate} and the edit was reverted automatically. - * @see yfiles.input.GraphEditorInputMode#onLabelTextEdited - */ - editLabel(label:yfiles.graph.ILabel):Promise; - /** - * Starts label editing by executing {@link yfiles.input.ICommand#EDIT_LABEL }. - *

- * The method should return whether the request was satisfied. - *

- * @param item The item whose label or the label itself that should be edited upon the double click gesture. - * @returns true iff the request was handled. - * @see yfiles.input.GraphInputMode#doubleClick - * @see yfiles.input.GraphEditorInputMode#allowEditLabelOnDoubleClick - * @protected - */ - editLabelOnDoubleClick(item:yfiles.graph.IModelItem):boolean; - /** - * Creates a new group for all of the currently selected elements. - *

- * This method will also clear the selection and select the newly created group node. - *

- *

- * The default shortcut for this is Ctrl+G. - *

- * @returns The newly created group node or null. - * @see yfiles.input.ICommand#GROUP_SELECTION - * @see yfiles.input.GraphInputMode#clearSelection - * @see yfiles.input.GraphInputMode#setSelected - */ - groupSelection():yfiles.graph.INode; - /** - * Callback that is invoked if the shift+F2 key is pressed and {@link yfiles.input.GraphEditorInputMode#allowAddLabel} is set to true. - *

- * This method determines the label owner to add to and delegates to {@link yfiles.input.GraphEditorInputMode#createLabel}. - *

- * @returns - * @protected - */ - onAddLabel():boolean; - /** - * Callback that is called as soon as {@link yfiles.input.CreateBendInputMode} created a new bend. - *

- * This method selects the bend and starts the {@link yfiles.input.GraphEditorInputMode#handleInputMode} using the handle for the newly created bend. The bend is created using the - * hit edge's {@link yfiles.input.IBendCreator} implementation, as obtained from the edge's {@link yfiles.graph.ILookup#lookup} and calls - * {@link yfiles.input.GraphEditorInputMode#dragBend}. If the subsequent drag is canceled by the user, this call will remove the - * bend again. - *

- * @param sender - * @param evt - * @protected - */ - onCreateBendInputModeBendCreated(sender:any,evt:yfiles.collections.ItemEventArgs):void; - /** - * Called when the {@link yfiles.input.GraphEditorInputMode#createBendInputMode} property value changes and after initialization of the field. - * @param oldMode the old value, which may be null the first time - * @param newMode the new value - * @protected - */ - onCreateBendInputModeChanged(oldMode:yfiles.input.CreateBendInputMode,newMode:yfiles.input.CreateBendInputMode):void; - /** - * Called when the {@link yfiles.input.GraphEditorInputMode#createEdgeInputMode} property value changes and after initialization of the field. - * @param oldMode the old value, which may be null the first time - * @param newMode the new value - * @protected - */ - onCreateEdgeInputModeChanged(oldMode:yfiles.input.CreateEdgeInputMode,newMode:yfiles.input.CreateEdgeInputMode):void; - /** - * Raises the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} event. - * @param evt The instance containing the event data. - * @protected - */ - onDeletedItem(evt:yfiles.collections.ItemEventArgs):void; - /** - * Raises the {@link yfiles.input.GraphEditorInputMode#addDeletedSelectionListener DeletedSelection} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onDeletedSelection(evt:yfiles.input.SelectionEventArgs):void; - /** - * Raises the {@link yfiles.input.GraphEditorInputMode#addDeletingSelectionListener DeletingSelection} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onDeletingSelection(evt:yfiles.input.SelectionEventArgs):void; - /** - * Callback to be invoked after an edge's source and/or target ports have been changed as the result of an input gesture. - *

- * Dispatches the {@link yfiles.input.GraphEditorInputMode#addEdgePortsChangedListener EdgePortsChanged} event. - *

- * @param evt The {@link } for the - * {@link #addEdgePortsChangedListener EdgePortsChanged}. - * @protected - */ - onEdgePortsChanged(evt:yfiles.graph.EdgeEventArgs):void; - /** - * Callback that is invoked if the F2 key is pressed and {@link yfiles.input.GraphEditorInputMode#allowEditLabel} is set to true. - *

- * This method determines the label to edit and delegates to either {@link yfiles.input.GraphEditorInputMode#editLabel} or {@link yfiles.input.GraphEditorInputMode#createLabel} - * if no label could be found. - *

- * @returns - * @protected - */ - onEditLabel():boolean; - /** - * Called when the {@link yfiles.input.GraphEditorInputMode#graphComponent} property changes. - * @param oldGraphComponent The old control. - * @param newGraphComponent The new control. - * @protected - */ - onGraphComponentChanged(oldGraphComponent:yfiles.view.GraphComponent,newGraphComponent:yfiles.view.GraphComponent):void; - /** - * Called when the {@link yfiles.view.GraphSelection} property changes. - *

- * This will update the internal state of the modes. - *

- * @param oldSelection The old selection instance. - * @param newSelection The new selection instance. - * @protected - */ - onGraphSelectionChanged(oldSelection:yfiles.view.IGraphSelection,newSelection:yfiles.view.IGraphSelection):void; - /** - * Called when the {@link yfiles.input.GraphEditorInputMode#handleInputMode} property value changes and after initialization of the field. - * @param oldMode the old value, which may be null the first time - * @param newMode the new value - * @protected - */ - onHandleInputModeChanged(oldMode:yfiles.input.HandleInputMode,newMode:yfiles.input.HandleInputMode):void; - /** - * Raises the {@link yfiles.input.GraphEditorInputMode#addLabelAddedListener LabelAdded} event. - * @param evt The {@link } instance that contains the {@link } that has been added. - * @protected - */ - onLabelAdded(evt:yfiles.graph.LabelEventArgs):void; - /** - * Raises the {@link yfiles.input.GraphEditorInputMode#addLabelAddingListener LabelAdding} event. - *

- * Invoking the event handlers stops once one event marks the evt as handled. - *

- * @param evt The event arguments. - * @protected - */ - onLabelAdding(evt:yfiles.input.LabelEditingEventArgs):void; - /** - * Raises the {@link yfiles.input.GraphEditorInputMode#addLabelEditingListener LabelEditing} event. - *

- * Invoking the event handlers stops once one event marks the evt as handled. - *

- * @param evt The event arguments. - * @protected - */ - onLabelEditing(evt:yfiles.input.LabelEditingEventArgs):void; - /** - * Called when the {@link yfiles.input.GraphEditorInputMode#labelSnapContext} property context changed. - * @param oldContext The old snap context. - * @param newContext The new snap context. - * @protected - */ - onLabelSnapContextChanged(oldContext:yfiles.input.SnapContext,newContext:yfiles.input.SnapContext):void; - /** - * Raises the {@link yfiles.input.GraphEditorInputMode#addLabelTextChangedListener LabelTextChanged} event. - * @param evt The {@link } instance that contains the {@link } that has changed the text. - * @protected - */ - onLabelTextChanged(evt:yfiles.graph.LabelEventArgs):void; - /** - * Called when the text of a label has been {@link yfiles.input.GraphEditorInputMode#editLabel edited}. - *

- * This method {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener validates the label text} and if successful calls {@link yfiles.input.GraphEditorInputMode#setLabelText}. - *

- * @param label The label that was edited. - * @param text The new text. - * @protected - */ - onLabelTextEdited(label:yfiles.graph.ILabel,text:string):void; - /** - * Raises the {@link yfiles.input.GraphEditorInputMode#addLabelTextEditingCanceledListener LabelTextEditingCanceled} - * event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onLabelTextEditingCanceled(evt:yfiles.graph.LabelEventArgs):void; - /** - * Raises the {@link yfiles.input.GraphEditorInputMode#addLabelTextEditingStartedListener LabelTextEditingStarted} - * event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onLabelTextEditingStarted(evt:yfiles.graph.LabelEventArgs):void; - /** - * Called when the {@link yfiles.input.GraphEditorInputMode#moveInputMode} property value changes and after initialization of the field. - * @param oldMode the old value, which may be null the first time - * @param newMode the new value - * @protected - */ - onMoveInputModeChanged(oldMode:yfiles.input.MoveInputMode,newMode:yfiles.input.MoveInputMode):void; - /** - * Called when {@link yfiles.input.MoveInputMode#addDragCanceledListener DragCanceled} is triggered. - * @param sender - * @param evt - * @protected - */ - onMoveInputModeDragCanceled(sender:any,evt:yfiles.lang.EventArgs):void; - /** - * Called when {@link yfiles.input.MoveInputMode#addDragFinishedListener DragFinished} is triggered. - * @param sender - * @param evt - * @protected - */ - onMoveInputModeDragFinished(sender:any,evt:yfiles.lang.EventArgs):void; - /** - * Called when the {@link yfiles.input.GraphEditorInputMode#moveLabelInputMode} property value changes and after initialization of the field. - * @param oldMode the old value, which may be null the first time - * @param newMode the new value - * @protected - */ - onMoveLabelInputModeChanged(oldMode:yfiles.input.MoveLabelInputMode,newMode:yfiles.input.MoveLabelInputMode):void; - /** - * Raises the {@link yfiles.input.GraphEditorInputMode#addNodeCreatedListener NodeCreated} event. - *

- * Note that if {@link yfiles.input.NodeDropInputMode#allowFolderNodeAsParent} is set to true, the reported node can actually be part of the {@link yfiles.graph.IFoldingView master graph}. - *

- * @param evt The {@link } instance containing the created node. - * @protected - */ - onNodeCreated(evt:yfiles.collections.ItemEventArgs):void; - /** - * Called when the {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode} property value changes and after initialization of the field. - * @param oldMode the old value, which may be null the first time - * @param newMode the new value - * @protected - */ - onNodeDropInputModeChanged(oldMode:yfiles.input.NodeDropInputMode,newMode:yfiles.input.NodeDropInputMode):void; - /** - * Called when the {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode}'s {@link yfiles.input.ItemDropInputMode.#addItemCreatedListener ItemCreated} event is triggered. - *

- * This implementation {@link yfiles.input.GraphEditorInputMode#adjustContentRect adjusts the content rect}, triggers the {@link yfiles.input.GraphEditorInputMode#addNodeCreatedListener NodeCreated} - * event and tries to set the newly created node as the {@link yfiles.input.GraphInputMode#setCurrentItem current item}. - *

- * @param sender The sender. - * @param evt The event argument instance containing the event data. - * @protected - */ - onNodeDropInputModeNodeCreated(sender:any,evt:yfiles.collections.ItemEventArgs):void; - /** - * Raises the {@link yfiles.input.GraphEditorInputMode#addNodeReparentedListener NodeReparented} event. - * @param evt The {@link } instance containing the event data. - * @see yfiles.input.GraphEditorInputMode#reparentNodeHandler - * @protected - */ - onNodeReparented(evt:yfiles.graph.NodeEventArgs):void; - /** - * Called when the {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler} property value changes and after initialization of the field. - * @param oldMode the old value, which may be null the first time - * @param newMode the new value - * @protected - */ - onReparentNodeHandlerChanged(oldMode:yfiles.input.IReparentNodeHandler,newMode:yfiles.input.IReparentNodeHandler):void; - /** - * Called when the {@link yfiles.input.GraphEditorInputMode#snapContext} property context changed. - * @param oldContext The old snap context. - * @param newContext The new snap context. - * @protected - */ - onSnapContextChanged(oldContext:yfiles.input.SnapContext,newContext:yfiles.input.SnapContext):void; - /** - * Called when the {@link yfiles.input.GraphEditorInputMode#textEditorInputMode} property value changes and after initialization of the field. - * @param oldMode the old value, which may be null the first time - * @param newMode the new value - * @protected - */ - onTextEditorInputModeChanged(oldMode:yfiles.input.TextEditorInputMode,newMode:yfiles.input.TextEditorInputMode):void; - /** - * Raises the {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener ValidateLabelText} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onValidateLabelText(evt:yfiles.input.LabelTextValidatingEventArgs):void; - /** - * Pastes the current clipboard contents. - * @see yfiles.input.GraphEditorInputMode#pasteAtLocation - */ - paste():void; - /** - * Pastes the current clipboard contents at the given location. - *

- * The location is at the center of the bounds of the items that are pasted. This method reconfigures {@link yfiles.graph.GraphClipboard#pasteDelta} and calls - * {@link yfiles.input.GraphEditorInputMode#paste}. - *

- * @param location The location at which the center of the clipboard's contents should be positioned. - */ - pasteAtLocation(location:yfiles.geometry.Point):void; - /** - * Delegates to the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.UndoEngine}'s {@link yfiles.graph.UndoEngine#redo} method. - */ - redo():void; - /** - * Trigger a reevaluation of all visible handles - *

- * This method is called when the {@link yfiles.input.GraphEditorInputMode#showHandleItems} property is changed. - *

- * @protected - */ - requeryHandles():void; - /** - * Reverses the given edges. - *

- * The edge will only be reversed if {@link yfiles.input.GraphEditorInputMode#allowReverseEdge} is set to true and {@link yfiles.input.GraphEditorInputMode#shouldReverseEdge} returns true - * for the edge. A {@link yfiles.input.GraphEditorInputMode#addEdgePortsChangedListener EdgePortsChanged} event - * will be dispatched after the edge has been reversed. - *

- * @param edge - */ - reverseEdge(edge:yfiles.graph.IEdge):void; - /** - * Reverses the given edges. - *

- * The edges will only be reversed if {@link yfiles.input.GraphEditorInputMode#allowReverseEdge} is set to true and {@link yfiles.input.GraphEditorInputMode#shouldReverseEdge} returns true - * for the edge. - *

- *

- * For each edge a {@link yfiles.input.GraphEditorInputMode#addEdgePortsChangedListener EdgePortsChanged} event - * will be dispatched. - *

- * @param edges - * @see yfiles.input.ICommand#REVERSE_EDGE - */ - reverseEdges(edges:yfiles.collections.IEnumerable):void; - /** - * Reverses the selected edges. - *

- * This implementation invokes {@link yfiles.input.GraphEditorInputMode#reverseEdges} providing the {@link yfiles.view.GraphSelection selected edges}. - *

- *

- * The edges will only be reversed if {@link yfiles.input.GraphEditorInputMode#shouldReverseEdge} returns true for each edge. - *

- *

- * For each edge an {@link yfiles.input.GraphEditorInputMode#addEdgePortsChangedListener EdgePortsChanged} event - * will be dispatched. - *

- */ - reverseSelectedEdges():void; - /** - * Selects the node and possible bends of selfloop edges. - *

- * This method delegates to {@link yfiles.input.GraphInputMode#setSelected} for the node and all adjacent self loop bends. - *

- * @param node The node to select. - */ - selectNodeAndSelfloopBends(node:yfiles.graph.INode):void; - /** - * Sets the label's text after it has been {@link yfiles.input.GraphEditorInputMode#editLabel edited}. - *

- * Depending on {@link yfiles.input.GraphEditorInputMode#autoRemoveEmptyLabels} it will either set the label's text or remove it from the graph. Also this method will query the label's {@link yfiles.graph.ILabel#owner} - * for an {@link yfiles.input.INodeSizeConstraintProvider} if the owner is an {@link yfiles.graph.INode} and will make sure that the size - * constraints are still kept if the {@link yfiles.graph.ILabel#preferredSize} changes due to the edit by calling - * {@link yfiles.input.GraphEditorInputMode#adjustToSizeConstraints}. - *

- * @param label The label to set the text or remove. - * @param text The new text. - */ - setLabelText(label:yfiles.graph.ILabel,text:string):void; - /** - * Updates the bounds of the node. - *

- * This method differs from a simple call to {@link yfiles.graph.IGraph#setNodeLayout} in a number of ways: - *

- *
    - *
  • An undo unit is enqueued.
  • - *
  • - * The node is reshaped interactively using the {@link yfiles.input.IReshapeHandler} implementation found in its lookup. This - * enables correctly adjusting e.g. affected orthogonal edges and parent group nodes. - *
  • - *
  • {@link yfiles.input.GraphEditorInputMode#adjustContentRect} is called.
  • - *
- * @param node The node to reshape. - * @param layout The new node layout. - */ - setNodeLayout(node:yfiles.graph.INode,layout:yfiles.geometry.Rect):void; - /** - * Predicate that determines whether a label may be added interactively to item - *

- * This is overridden if the item has a {@link yfiles.input.IEditLabelHelper} that returns false for its {@link yfiles.input.IEditLabelHelper#onLabelAdding} - * method. - *

- * @param item The item to query - * @returns true iff a label may be added - * @protected - */ - shouldAddLabel(item:yfiles.graph.IModelItem):boolean; - /** - * Specifies whether a node should be created by - * {@link yfiles.input.ClickInputMode#addClickedListener Clicked}. - *

- * This implementation returns false when {@link yfiles.input.ContextMenuInputMode#swallowCloseClick} is true and the click has closed a context menu. - *

- * @param context The input mode context. - * @param clickPoint The location of the click. - * @returns Whether {@link #clickCreateNode} should be called to create a node. - * @see yfiles.input.GraphEditorInputMode#clickCreateNode - * @protected - */ - shouldClickCreateNode(context:yfiles.input.IInputModeContext,clickPoint:yfiles.geometry.Point):boolean; - /** - * Callback method that determines whether the given item should be deleted during - * {@link yfiles.input.GraphEditorInputMode#deleteSelection}. - *

- * This implementation uses and honors the {@link yfiles.input.GraphEditorInputMode#deletableItems} and {@link yfiles.input.GraphEditorInputMode#deletablePredicate} properties. - *

- * @param item The item. - * @returns Whether to delete that item. - * @protected - */ - shouldDelete(item:yfiles.graph.IModelItem):boolean; - /** - * Callback method that determines whether the label or the labels of the provided item should be edited in response to {@link yfiles.input.GraphEditorInputMode#onEditLabel} - * or {@link yfiles.input.GraphEditorInputMode#onAddLabel}. - * @param item The item. - * @returns Whether to edit the label or the labels for that item. - * @protected - */ - shouldEditLabel(item:yfiles.graph.IModelItem):boolean; - /** - * Determines whether or not moving the item is allowed. - *

- * This predicate determines whether an item can be moved by any appropriate input mode, e.g by default it also evaluates to true - * for {@link yfiles.graph.ILabel}s which are moved by {@link yfiles.input.GraphEditorInputMode#moveLabelInputMode} instead of {@link yfiles.input.GraphEditorInputMode#moveInputMode}. - *

- *

- * This implementation returns the result of the {@link yfiles.input.GraphEditorInputMode#movableItems} property for the given item. - *

- * @param item The item to check. - * @returns Whether or not moving the item is allowed. - * @see yfiles.input.GraphEditorInputMode#movableItems - * @see yfiles.input.GraphEditorInputMode#moveInputMode - * @see yfiles.input.GraphEditorInputMode#moveLabelInputMode - * @protected - */ - shouldMove(item:yfiles.graph.IModelItem):boolean; - /** - * Callback which determines whether the given edge should be reversed by {@link yfiles.input.GraphEditorInputMode#reverseEdge}, - * {@link yfiles.input.GraphEditorInputMode#reverseEdges}, or {@link yfiles.input.GraphEditorInputMode#reverseEdges}. - *

- * This implementation returns the value of {@link yfiles.input.GraphEditorInputMode#allowReverseEdge}. - *

- * @param edge The edge which should be reversed. - * @returns true if the edge should be reversed. - * @protected - */ - shouldReverseEdge(edge:yfiles.graph.IEdge):boolean; - /** - * Can be overridden to determine which items should be selected after {@link yfiles.input.GraphEditorInputMode#paste} or - * {@link yfiles.input.GraphEditorInputMode#duplicateSelection}. - *

- * This implementation returns true for the {@link yfiles.input.GraphEditorInputMode#pasteSelectableItems} items. - *

- * @param item The item to check. - * @returns Whether to select the item after {@link #paste} or - * {@link #duplicateSelection}. - * @protected - */ - shouldSelectAfterPaste(item:yfiles.graph.IModelItem):boolean; - /** - * Determines whether to show the {@link yfiles.input.GraphEditorInputMode#handleInputMode handles} for the given item. - * @param item The item to check - * @returns Whether to show the item based on the setting of the corresponding {@link #showHandleItems}, property. - * @protected - */ - shouldShowHandles(item:yfiles.graph.IModelItem):boolean; - /** - * Snaps the node to the grid using the {@link yfiles.input.IGridConstraintProvider.} for {@link yfiles.graph.INode}s queried from the given context. - *

- * This method is called by this instance whenever new nodes are created using the UI. - *

- * @param context - * @param node - * @see yfiles.input.MultiplexingInputMode#createChildInputModeContext - */ - snapToGrid(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode):void; - /** - * Delegates to the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.UndoEngine}'s {@link yfiles.graph.UndoEngine#undo} method. - */ - undo():void; - /** - * Makes each of the currently selected nodes a direct child of the root group. - *

- * The default shortcut for this is Ctrl+U. - *

- * @see yfiles.input.ICommand#UNGROUP_SELECTION - */ - ungroupSelection():void; - /** - * Gets or sets the orthogonal edge editing context. - *

- * The default value is null. - *

- *

Related demos:

- *
    - *
  • Tutorial: 01 Getting Started, step 17 Orthogonal Edge Creation
  • - *
- * @default null - * @type {yfiles.input.OrthogonalEdgeEditingContext} - */ - orthogonalEdgeEditingContext:yfiles.input.OrthogonalEdgeEditingContext; - /** - * Gets or sets the policy that controls whether removing bends from an orthogonal edge will keep the edge orthogonal. - *

- * By default this feature is enabled automatically if an {@link yfiles.input.GraphEditorInputMode#orthogonalEdgeEditingContext} is set. - *

- * @see yfiles.input.GraphEditorInputMode#orthogonalEdgeEditingContext - * @default yfiles.input.OrthogonalEdgeEditingPolicy.AUTO - * @type {yfiles.input.OrthogonalEdgeEditingPolicy} - */ - orthogonalBendRemoval:yfiles.input.OrthogonalEdgeEditingPolicy; - /** - * Gets or sets the {@link yfiles.input.IReparentNodeHandler} that is used for moving nodes out of group nodes or into other group - * nodes. - *

- * This setting has no effect if reparenting nodes is generally disallowed by setting {@link yfiles.input.GraphEditorInputMode#allowReparentNodes} to false. - *

- *

- * Child input modes will use this {@link yfiles.input.IReparentNodeHandler} as well, since it is added to - * {@link yfiles.input.GraphEditorInputMode#childInputModeContextLookup}. - *

- *

- * If not already initialized, the factory method {@link yfiles.input.GraphEditorInputMode#createReparentNodeHandler} will be - * called on first access. Upon changes, the {@link yfiles.input.GraphEditorInputMode#onReparentNodeHandlerChanged} method will be - * called. - *

- * @see yfiles.input.GraphEditorInputMode#allowReparentNodes - * @see yfiles.input.ReparentNodeHandler - * @type {yfiles.input.IReparentNodeHandler} - */ - reparentNodeHandler:yfiles.input.IReparentNodeHandler; - /** - * Gets or sets the hitTester property. - *

- * The enumerator will be queried for hit tests if the user clicks on the canvas. - *

- * @type {yfiles.input.IHitTester.} - */ - hitTester:yfiles.input.IHitTester; - /** - * Gets or sets which types of items should be selected after {@link yfiles.input.GraphEditorInputMode#paste} or - * {@link yfiles.input.GraphEditorInputMode#duplicateSelection}. - *

- * The default is {@link yfiles.graph.GraphItemTypes#ALL}. - *

- * @see yfiles.input.GraphEditorInputMode#shouldSelectAfterPaste - * @see yfiles.input.GraphEditorInputMode#smartPasteSelection - * @see yfiles.input.GraphInputMode#setSelected - * @default yfiles.graph.GraphItemTypes.ALL - * @type {yfiles.graph.GraphItemTypes} - */ - pasteSelectableItems:yfiles.graph.GraphItemTypes; - /** - * Gets or sets whether nodes, edges, labels, and ports should only be selected after {@link yfiles.input.GraphEditorInputMode#paste} - * or {@link yfiles.input.GraphEditorInputMode#duplicateSelection} if they were selected when they were initially copied into the - * clipboard. - *

- * The default is true. Disabling this feature will select all {@link yfiles.input.GraphEditorInputMode#pasteSelectableItems} after a paste or duplicate operation. - *

- * @see yfiles.input.GraphEditorInputMode#shouldSelectAfterPaste - * @see yfiles.input.GraphEditorInputMode#pasteSelectableItems - * @see yfiles.input.GraphInputMode#setSelected - * @default true - * @type {boolean} - */ - smartPasteSelection:boolean; - /** - * Gets or sets which types of items should be movable using the {@link yfiles.input.GraphEditorInputMode#moveInputMode} or {@link yfiles.input.GraphEditorInputMode#moveLabelInputMode} respectively in case of labels. - *

- * The default is {@link yfiles.graph.GraphItemTypes#ALL}. - *

- * @see yfiles.input.GraphEditorInputMode#shouldMove - * @type {yfiles.graph.GraphItemTypes} - */ - movableItems:yfiles.graph.GraphItemTypes; - /** - * Gets or sets which types of items may be deleted using the {@link yfiles.input.GraphEditorInputMode#deleteSelection} action. - *

- * The default is {@link yfiles.graph.GraphItemTypes#ALL}. - *

- * @see yfiles.input.GraphEditorInputMode#shouldDelete - * @type {yfiles.graph.GraphItemTypes} - */ - deletableItems:yfiles.graph.GraphItemTypes; - /** - * Gets or sets a predicate that is queried to determine whether an {@link yfiles.graph.IModelItem} can be deleted or not. - *

- * This allows to further restrict which items are deletable, compared to {@link yfiles.input.GraphEditorInputMode#deletableItems}. If this property is set to null the effect is - * the same as a predicate that always returns true. - *

- * @type {function(yfiles.graph.IModelItem): boolean} - */ - deletablePredicate:(obj:yfiles.graph.IModelItem)=>boolean; - /** - * Gets or sets which types of items may have their {@link yfiles.input.GraphEditorInputMode#onEditLabel labels edited}. - *

- * The default is {@link yfiles.graph.GraphItemTypes#LABEL_OWNER}|{@link yfiles.graph.GraphItemTypes#LABEL}, which allows for editing the - * labels of {@link yfiles.graph.ILabelOwner}s, and existing {@link yfiles.graph.ILabel}s. - *

- * @see yfiles.input.GraphEditorInputMode#shouldEditLabel - * @type {yfiles.graph.GraphItemTypes} - */ - labelEditableItems:yfiles.graph.GraphItemTypes; - /** - * Gets or sets the {@link yfiles.input.GraphEditorInputMode#handleInputMode} property. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.GraphEditorInputMode#createHandleInputMode} - * will be called. Upon change the {@link yfiles.input.GraphEditorInputMode#onHandleInputModeChanged} method will be called. - *

- *

- * By default this input mode has a priority of 0. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @type {yfiles.input.HandleInputMode} - */ - handleInputMode:yfiles.input.HandleInputMode; - /** - * Gets or sets which types of items should have their {@link yfiles.input.IHandle}s shown. - *

- * The default is {@link yfiles.graph.GraphItemTypes#ALL}. - *

- * @see yfiles.input.GraphEditorInputMode#shouldShowHandles - * @type {yfiles.graph.GraphItemTypes} - */ - showHandleItems:yfiles.graph.GraphItemTypes; - /** - * Gets or sets a value indicating whether to use the {@link yfiles.view.GraphComponent#currentItem} as a fallback for the commands if no item is provided in the - * parameter and the current selection is empty. - *

- * This applies to the following commands: - *

- *
    - *
  • {@link yfiles.input.ICommand#ADD_LABEL}
  • - *
  • {@link yfiles.input.ICommand#EDIT_LABEL}
  • - *
  • {@link yfiles.input.ICommand#ADJUST_GROUP_NODE_SIZE}
  • - *
- * @default false - * @type {boolean} - */ - useCurrentItemForCommands:boolean; - /** - * Gets or sets the offset for paste operation if clipboard operations are enabled. - *

- * Default is (15, 15). - *

- * @default '15,15' - * @type {yfiles.geometry.Point} - */ - pasteDelta:yfiles.geometry.Point; - /** - * Gets or sets a value determining whether the {@link yfiles.input.ICommand#EDIT_LABEL} command should be handled. - *

- * If this flag is set to true pressing F2 will start the label editor. By default this feature is enabled. - *

- * @see yfiles.input.GraphEditorInputMode#editLabel - * @see yfiles.input.GraphEditorInputMode#onEditLabel - * @type {boolean} - */ - allowEditLabel:boolean; - /** - * Gets or sets a value determining whether double-clicking should start label editing. - *

- * If enabled, double-clicking an item will automatically execute the {@link yfiles.input.ICommand#EDIT_LABEL} command. - *

- *

- * This setting has no effect if label editing is generally disallowed by setting {@link yfiles.input.GraphEditorInputMode#allowEditLabel} to false. - *

- *

- * The default value is true. - *

- * @see yfiles.input.GraphEditorInputMode#allowEditLabel - * @type {boolean} - */ - allowEditLabelOnDoubleClick:boolean; - /** - * Gets or sets a value determining whether the {@link yfiles.input.ICommand#ADD_LABEL} command should be handled. - *

- * If this flag is set to true pressing Shift+F2 will start the label editor. By default this feature is enabled. - *

- * @see yfiles.input.GraphEditorInputMode#createLabel - * @type {boolean} - */ - allowAddLabel:boolean; - /** - * Adds the given listener for the LabelAdded event that occurs when this mode has triggered the addition of an - * {@link yfiles.graph.ILabel}, for instance, in response to {@link yfiles.input.GraphEditorInputMode#createLabel}. - * @param listener The listener to add. - * @see yfiles.input.GraphEditorInputMode#removeLabelAddedListener - */ - addLabelAddedListener(listener:(sender:any,evt:yfiles.graph.LabelEventArgs)=>void):void; - /** - * Removes the given listener for the LabelAdded event that occurs when this mode has triggered the addition of an - * {@link yfiles.graph.ILabel}, for instance, in response to {@link yfiles.input.GraphEditorInputMode#createLabel}. - * @param listener The listener to remove. - * @see yfiles.input.GraphEditorInputMode#addLabelAddedListener - */ - removeLabelAddedListener(listener:(sender:any,evt:yfiles.graph.LabelEventArgs)=>void):void; - /** - * Adds the given listener for the LabelTextEditingStarted event that occurs when the actual label editing process is about - * to start. - *

- * This allows to customize the label editing process. - *

- * @param listener The listener to add. - * @see yfiles.input.GraphEditorInputMode#addValidateLabelTextListener - * @see yfiles.input.GraphEditorInputMode#removeLabelTextEditingStartedListener - */ - addLabelTextEditingStartedListener(listener:(sender:any,evt:yfiles.graph.LabelEventArgs)=>void):void; - /** - * Removes the given listener for the LabelTextEditingStarted event that occurs when the actual label editing process is - * about to start. - *

- * This allows to customize the label editing process. - *

- * @param listener The listener to remove. - * @see yfiles.input.GraphEditorInputMode#addValidateLabelTextListener - * @see yfiles.input.GraphEditorInputMode#addLabelTextEditingStartedListener - */ - removeLabelTextEditingStartedListener(listener:(sender:any,evt:yfiles.graph.LabelEventArgs)=>void):void; - /** - * Adds the given listener for the LabelTextEditingCanceled event that occurs when the actual label editing process is - * canceled. - *

- * This allows to unconfigure temporary customizations for the actual label editing process. - *

- * @param listener The listener to add. - * @see yfiles.input.GraphEditorInputMode#addValidateLabelTextListener - * @see yfiles.input.GraphEditorInputMode#removeLabelTextEditingCanceledListener - */ - addLabelTextEditingCanceledListener(listener:(sender:any,evt:yfiles.graph.LabelEventArgs)=>void):void; - /** - * Removes the given listener for the LabelTextEditingCanceled event that occurs when the actual label editing process is - * canceled. - *

- * This allows to unconfigure temporary customizations for the actual label editing process. - *

- * @param listener The listener to remove. - * @see yfiles.input.GraphEditorInputMode#addValidateLabelTextListener - * @see yfiles.input.GraphEditorInputMode#addLabelTextEditingCanceledListener - */ - removeLabelTextEditingCanceledListener(listener:(sender:any,evt:yfiles.graph.LabelEventArgs)=>void):void; - /** - * Adds the given listener for the ValidateLabelText event that occurs when a label that is about to be {@link yfiles.input.GraphEditorInputMode#addLabel added} or {@link yfiles.input.GraphEditorInputMode#editLabel edited}. - *

- * This event that can be used to validate the label text before inserting/updating the actual label. - *

- *

- * Note that in the case of {@link yfiles.input.GraphEditorInputMode#addLabel} the {@link yfiles.input.LabelTextValidatingEventArgs#label} is not part of the current graph but only a - * dummy instance. - *

- * @param listener The listener to add. - * @see yfiles.input.GraphEditorInputMode#onValidateLabelText - * @see yfiles.input.GraphEditorInputMode#removeValidateLabelTextListener - */ - addValidateLabelTextListener(listener:(sender:any,evt:yfiles.input.LabelTextValidatingEventArgs)=>void):void; - /** - * Removes the given listener for the ValidateLabelText event that occurs when a label that is about to be {@link yfiles.input.GraphEditorInputMode#addLabel added} or - * {@link yfiles.input.GraphEditorInputMode#editLabel edited}. - *

- * This event that can be used to validate the label text before inserting/updating the actual label. - *

- *

- * Note that in the case of {@link yfiles.input.GraphEditorInputMode#addLabel} the {@link yfiles.input.LabelTextValidatingEventArgs#label} is not part of the current graph but only a - * dummy instance. - *

- * @param listener The listener to remove. - * @see yfiles.input.GraphEditorInputMode#onValidateLabelText - * @see yfiles.input.GraphEditorInputMode#addValidateLabelTextListener - */ - removeValidateLabelTextListener(listener:(sender:any,evt:yfiles.input.LabelTextValidatingEventArgs)=>void):void; - /** - * Adds the given listener for the LabelTextChanged event that occurs when this mode has triggered the edit of an - * {@link yfiles.graph.ILabel}, for instance, in response to {@link yfiles.input.GraphEditorInputMode#editLabel}. - * @param listener The listener to add. - * @see yfiles.input.GraphEditorInputMode#removeLabelTextChangedListener - */ - addLabelTextChangedListener(listener:(sender:any,evt:yfiles.graph.LabelEventArgs)=>void):void; - /** - * Removes the given listener for the LabelTextChanged event that occurs when this mode has triggered the edit of an - * {@link yfiles.graph.ILabel}, for instance, in response to {@link yfiles.input.GraphEditorInputMode#editLabel}. - * @param listener The listener to remove. - * @see yfiles.input.GraphEditorInputMode#addLabelTextChangedListener - */ - removeLabelTextChangedListener(listener:(sender:any,evt:yfiles.graph.LabelEventArgs)=>void):void; - /** - * Adds the given listener for the DeletingSelection event that occurs just before the {@link yfiles.input.GraphEditorInputMode#deleteSelection} - * method starts its work and will be followed by any number of {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} - * events and finalized by a {@link yfiles.input.GraphEditorInputMode#addDeletedSelectionListener DeletedSelection} - * event. - * @param listener The listener to add. - * @see yfiles.input.GraphEditorInputMode#deleteSelection - * @see yfiles.input.GraphEditorInputMode#removeDeletingSelectionListener - */ - addDeletingSelectionListener(listener:(sender:any,evt:yfiles.input.SelectionEventArgs)=>void):void; - /** - * Removes the given listener for the DeletingSelection event that occurs just before the {@link yfiles.input.GraphEditorInputMode#deleteSelection} - * method starts its work and will be followed by any number of {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} - * events and finalized by a {@link yfiles.input.GraphEditorInputMode#addDeletedSelectionListener DeletedSelection} - * event. - * @param listener The listener to remove. - * @see yfiles.input.GraphEditorInputMode#deleteSelection - * @see yfiles.input.GraphEditorInputMode#addDeletingSelectionListener - */ - removeDeletingSelectionListener(listener:(sender:any,evt:yfiles.input.SelectionEventArgs)=>void):void; - /** - * Adds the given listener for the DeletedItem event that occurs when an item has been deleted interactively by this mode. - *

- * Note that this event will not be triggered for items that are removed implicitly, e.g. if the event is triggered for a - * node, its labels, ports, and adjacent edges will not necessarily be reported separately. In order to be notified of any - * removal events, the {@link yfiles.graph.IGraph} events should be used instead. - *

- * @param listener The listener to add. - * @see yfiles.input.GraphEditorInputMode#removeDeletedItemListener - */ - addDeletedItemListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the DeletedItem event that occurs when an item has been deleted interactively by this - * mode. - *

- * Note that this event will not be triggered for items that are removed implicitly, e.g. if the event is triggered for a - * node, its labels, ports, and adjacent edges will not necessarily be reported separately. In order to be notified of any - * removal events, the {@link yfiles.graph.IGraph} events should be used instead. - *

- * @param listener The listener to remove. - * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener - */ - removeDeletedItemListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the DeletedSelection event that occurs just before the {@link yfiles.input.GraphEditorInputMode#deleteSelection} - * method has deleted the selection after all selected items have been removed. - * @param listener The listener to add. - * @see yfiles.input.GraphEditorInputMode#deleteSelection - * @see yfiles.input.GraphEditorInputMode#removeDeletedSelectionListener - */ - addDeletedSelectionListener(listener:(sender:any,evt:yfiles.input.SelectionEventArgs)=>void):void; - /** - * Removes the given listener for the DeletedSelection event that occurs just before the {@link yfiles.input.GraphEditorInputMode#deleteSelection} - * method has deleted the selection after all selected items have been removed. - * @param listener The listener to remove. - * @see yfiles.input.GraphEditorInputMode#deleteSelection - * @see yfiles.input.GraphEditorInputMode#addDeletedSelectionListener - */ - removeDeletedSelectionListener(listener:(sender:any,evt:yfiles.input.SelectionEventArgs)=>void):void; - /** - * Gets or sets the {@link yfiles.input.GraphEditorInputMode#moveInputMode} property. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.GraphEditorInputMode#createMoveInputMode} - * will be called. Upon change the {@link yfiles.input.GraphEditorInputMode#onMoveInputModeChanged} method will be called. - *

- *

- * By default this input mode has a priority of 40. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @see yfiles.input.GraphEditorInputMode#shouldMove - * @type {yfiles.input.MoveInputMode} - */ - moveInputMode:yfiles.input.MoveInputMode; - /** - * Gets or sets a property that determines whether this instance should automatically adjust the {@link yfiles.view.CanvasComponent#contentRect} if the graph changes. - *

- * The {@link yfiles.input.GraphEditorInputMode#adjustContentRect} method is called whenever the content changes. The default is - * {@link yfiles.input.AdjustContentRectPolicy#UNION}. - *

- * @default yfiles.input.AdjustContentRectPolicy.UNION - * @type {yfiles.input.AdjustContentRectPolicy} - */ - adjustContentRectPolicy:yfiles.input.AdjustContentRectPolicy; - /** - * Gets or sets the margins to use for {@link yfiles.view.CanvasComponent#updateContentRect} in {@link yfiles.input.GraphEditorInputMode#adjustContentRect} - * calls. - * @type {yfiles.geometry.Insets} - */ - contentRectMargins:yfiles.geometry.Insets; - /** - * Gets the {@link yfiles.input.GraphEditorInputMode#graphComponent} instance this mode is working on or null. - *

- * This property is set when this mode is {@link yfiles.input.GraphEditorInputMode#install}ed in a {@link yfiles.input.GraphEditorInputMode#graphComponent}. - *

- * @type {yfiles.view.GraphComponent} - */ - graphComponent:yfiles.view.GraphComponent; - /** - * Gets or sets the {@link yfiles.input.SnapContext} instance that handles interactive snapping of elements during drag operations - * like movements. - *

- * Setting this property to a {@link yfiles.input.SnapContext} which is {@link yfiles.input.SnapContext#enabled disabled} will disable snapping, whereas setting it to null - * will make the child modes use the context from their {@link yfiles.input.IInputModeContext}s, if available. Upon change the {@link yfiles.input.GraphEditorInputMode#onSnapContextChanged} - * method is called, which will as a side effect configure the snap context to display the {@link yfiles.input.SnapResult}s in the - * {@link yfiles.view.CanvasComponent}. Default is null. - *

- * @default null - * @type {yfiles.input.SnapContext} - */ - snapContext:yfiles.input.SnapContext; - /** - * Gets or sets the {@link yfiles.input.LabelSnapContext} instance that handles interactive snapping of - * {@link yfiles.graph.ILabel}s to their owner during drag operations like movements. - *

- * Setting this property to null will disable snapping, whereas setting it to null will make the child modes use the - * context from their {@link yfiles.input.IInputModeContext}s, if available. Upon change the {@link yfiles.input.GraphEditorInputMode#onLabelSnapContextChanged} - * method is called, which will as a side effect configure the snap context to display the {@link yfiles.input.SnapResult}s in the - * {@link yfiles.view.CanvasComponent}. Default is null. - *

- * @default null - * @type {yfiles.input.SnapContext} - */ - labelSnapContext:yfiles.input.SnapContext; - /** - * Gets or sets the {@link yfiles.input.GraphEditorInputMode#moveLabelInputMode} property. - *

- * This mode is responsible for moving labels to another candidate position. If the field has not yet been initialized upon - * first access, the factory method {@link yfiles.input.GraphEditorInputMode#createMoveLabelInputMode} will be called. Upon change - * the {@link yfiles.input.GraphEditorInputMode#onMoveLabelInputModeChanged} method will be called. - *

- *

- * By default this input mode has a priority of 39. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @see yfiles.input.GraphEditorInputMode#shouldMove - * @type {yfiles.input.MoveLabelInputMode} - */ - moveLabelInputMode:yfiles.input.MoveLabelInputMode; - /** - * Gets or sets a value indicating whether grouping operations like {@link yfiles.input.GraphEditorInputMode#allowGroupSelection grouping selected nodes} or {@link yfiles.input.GraphEditorInputMode#allowReparentNodes moving nodes into group nodes} - * should be enabled. - *

- * Setting this property to false effectively disables handling of all grouping {@link yfiles.input.ICommand commands}. If this property is set to true - * the related properties {@link yfiles.input.GraphEditorInputMode#allowGroupSelection}, {@link yfiles.input.GraphEditorInputMode#allowUngroupSelection}, and {@link yfiles.input.GraphEditorInputMode#allowReparentNodes} allow for selectively enabling or disabling only certain grouping operations. - *

- *

- * The default value is false. - *

- * @see yfiles.input.GraphEditorInputMode#allowGroupSelection - * @see yfiles.input.GraphEditorInputMode#allowUngroupSelection - * @see yfiles.input.GraphEditorInputMode#allowAdjustGroupNodeSize - * @see yfiles.input.GraphEditorInputMode#allowReparentNodes - * @default false - * @type {boolean} - */ - allowGroupingOperations:boolean; - /** - * Gets or sets a value determining whether the {@link yfiles.input.ICommand#GROUP_SELECTION} command should be handled. - *

- * This setting has no effect if grouping operations are generally disallowed by setting {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations} to false. - *

- *

- * The default value is true. - *

- * @see yfiles.input.GraphEditorInputMode#allowGroupingOperations - * @see yfiles.input.GraphEditorInputMode#groupSelection - * @default true - * @type {boolean} - */ - allowGroupSelection:boolean; - /** - * Gets or sets a value determining whether the {@link yfiles.input.ICommand#ADJUST_GROUP_NODE_SIZE} command should be handled. - *

- * This setting has no effect if grouping operations are generally disallowed by setting {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations} to false. - *

- *

- * The default value is true. - *

- * @see yfiles.input.GraphEditorInputMode#allowGroupingOperations - * @see yfiles.input.GraphEditorInputMode#adjustGroupNodeSizes - * @see yfiles.input.GraphEditorInputMode#adjustGroupNodeSize - * @default true - * @type {boolean} - */ - allowAdjustGroupNodeSize:boolean; - /** - * Gets or sets a value determining whether the {@link yfiles.input.ICommand#UNGROUP_SELECTION} command should be handled. - *

- * This setting has no effect if grouping operations are generally disallowed by setting {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations} to false. - *

- *

- * The default value is true. - *

- * @see yfiles.input.GraphEditorInputMode#allowGroupingOperations - * @see yfiles.input.GraphEditorInputMode#ungroupSelection - * @default true - * @type {boolean} - */ - allowUngroupSelection:boolean; - /** - * Gets or sets a value determining whether the {@link yfiles.input.ICommand#DESELECT_ALL} command should be handled. - *

- * The default value is true. - *

- * @default true - * @type {boolean} - */ - allowClearSelection:boolean; - /** - * Gets or sets a value determining whether the {@link yfiles.input.ICommand#PASTE} command should be handled. - *

- * This setting has no effect if clipboard operations are generally disallowed by setting {@link yfiles.input.GraphInputMode#allowClipboardOperations} to false. - *

- *

- * The default value is true. - *

- * @default true - * @type {boolean} - */ - allowPaste:boolean; - /** - * Gets or sets a value determining whether the {@link yfiles.input.ICommand#DUPLICATE} command should be handled. - *

- * This setting has no effect if clipboard operations are generally disallowed by setting {@link yfiles.input.GraphInputMode#allowClipboardOperations} to false. - *

- *

- * The default value is true. - *

- * @default true - * @type {boolean} - */ - allowDuplicate:boolean; - /** - * Gets or sets a value indicating whether undo operations, that is, {@link yfiles.input.GraphEditorInputMode#undo} and {@link yfiles.input.GraphEditorInputMode#redo} - * should be enabled. - *

- * Note that even if this feature is enabled, an {@link yfiles.graph.UndoEngine undo engine} needs to be available in the {@link yfiles.input.InputModeBase#inputModeContext}in order to work. - *

- *

- * Setting this property to false effectively disables handling of the commands {@link yfiles.input.ICommand#UNDO} and - * {@link yfiles.input.ICommand#REDO}. - *

- *

- * The default value is true. - *

- * @see yfiles.input.GraphEditorInputMode#undo - * @see yfiles.input.GraphEditorInputMode#redo - * @default true - * @type {boolean} - */ - allowUndoOperations:boolean; - /** - * Gets or sets a value indicating whether moving nodes out of group nodes or into other group nodes is allowed. - *

- * If set to false the {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler} will effectively be disabled and not called anymore for reparenting operations. - *

- *

- * The default value is true. - *

- * @see yfiles.input.GraphEditorInputMode#reparentNodeHandler - * @default true - * @type {boolean} - */ - allowReparentNodes:boolean; - /** - * Gets or sets a value indicating whether moving nodes into {@link yfiles.graph.IGraph#isGroupNode non-group nodes} is allowed to convert them into group nodes. - *

- * If {@link yfiles.input.GraphEditorInputMode#allowReparentNodes reparenting nodes is allowed} in general and this property is enabled, users may reparent nodes not only to groups and - * folders but also to non-group nodes. Still, the decision about the final acceptance of the reparenting and the actual - * execution are delegated to the {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler}. - *

- *

- * This setting has no effect if grouping operations are generally disallowed by setting {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations} to false. - *

- *

- * The default value is false. - *

- * @see yfiles.input.GraphEditorInputMode#allowGroupingOperations - * @default false - * @type {boolean} - */ - allowReparentToNonGroupNodes:boolean; - /** - * Adds the given listener for the NodeReparented event that occurs when a node has been reparented interactively. - *

- * This is triggered whenever the {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler}'s {@link yfiles.input.IReparentNodeHandler#reparent} method has been called to reparent a node - * interactively. - *

- * @param listener The listener to add. - * @see yfiles.input.GraphEditorInputMode#reparentNodeHandler - * @see yfiles.input.GraphEditorInputMode#removeNodeReparentedListener - */ - addNodeReparentedListener(listener:(sender:any,evt:yfiles.graph.NodeEventArgs)=>void):void; - /** - * Removes the given listener for the NodeReparented event that occurs when a node has been reparented interactively. - *

- * This is triggered whenever the {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler}'s {@link yfiles.input.IReparentNodeHandler#reparent} method has been called to reparent a node - * interactively. - *

- * @param listener The listener to remove. - * @see yfiles.input.GraphEditorInputMode#reparentNodeHandler - * @see yfiles.input.GraphEditorInputMode#addNodeReparentedListener - */ - removeNodeReparentedListener(listener:(sender:any,evt:yfiles.graph.NodeEventArgs)=>void):void; - /** - * Adds the given listener for the NodeCreated event that occurs when this mode has created a node in response to user - * interaction. - *

- * This event is triggered if the node is created using a click gesture via {@link yfiles.input.GraphEditorInputMode#createNode}, - * or via a drag and drop operation that was completed by {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode}. Note that if {@link yfiles.input.NodeDropInputMode#allowFolderNodeAsParent} is set to true, the reported node can actually be - * part of the {@link yfiles.graph.IFoldingView master graph}. - *

- * @param listener The listener to add. - * @see yfiles.input.GraphEditorInputMode#createNode - * @see yfiles.input.GraphEditorInputMode#removeNodeCreatedListener - */ - addNodeCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the NodeCreated event that occurs when this mode has created a node in response to user - * interaction. - *

- * This event is triggered if the node is created using a click gesture via {@link yfiles.input.GraphEditorInputMode#createNode}, - * or via a drag and drop operation that was completed by {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode}. Note that if {@link yfiles.input.NodeDropInputMode#allowFolderNodeAsParent} is set to true, the reported node can actually be - * part of the {@link yfiles.graph.IFoldingView master graph}. - *

- * @param listener The listener to remove. - * @see yfiles.input.GraphEditorInputMode#createNode - * @see yfiles.input.GraphEditorInputMode#addNodeCreatedListener - */ - removeNodeCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Gets or sets a value determining whether {@link yfiles.input.GraphEditorInputMode#createNode node creation} by clicking on an empty canvas location is enabled. - *

- * To disable node creation via drag and drop gestures, the {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode} must be disabled, too. However, it is disabled by default. - *

- *

- * The default value is true. - *

- * @see yfiles.input.GraphEditorInputMode#nodeCreator - * @see yfiles.input.GraphEditorInputMode#createNode - * @type {boolean} - */ - allowCreateNode:boolean; - /** - * Gets or sets a value determining whether {@link yfiles.input.GraphEditorInputMode#createBendInputMode bend creation} should be {@link yfiles.input.CreateBendInputMode#enabled enabled}. - *

- * This property delegates to {@link yfiles.input.GraphEditorInputMode#createBendInputMode}'s {@link yfiles.input.CreateBendInputMode#enabled} property. - *

- *

- * The default value is true. - *

- * @type {boolean} - */ - allowCreateBend:boolean; - /** - * Gets or sets a value determining whether {@link yfiles.input.GraphEditorInputMode#createEdgeInputMode edge creation} should be {@link yfiles.input.CreateEdgeInputMode#enabled enabled}. - *

- * This property delegates to {@link yfiles.input.GraphEditorInputMode#createEdgeInputMode}'s {@link yfiles.input.CreateEdgeInputMode#enabled} property. - *

- *

- * The default value is true. - *

- * @type {boolean} - */ - allowCreateEdge:boolean; - /** - * Gets or sets a value indicating whether the {@link yfiles.input.ICommand#REVERSE_EDGE} command should be handled. - *

- * If set to false the methods {@link yfiles.input.GraphEditorInputMode#reverseEdge}, - * {@link yfiles.input.GraphEditorInputMode#reverseEdges}, and {@link yfiles.input.GraphEditorInputMode#reverseSelectedEdges} do nothing. - *

- *

- * The default value is true. - *

- * @default true - * @type {boolean} - */ - allowReverseEdge:boolean; - /** - * Adds the given listener for the EdgePortsChanged event that occurs after an edge's source and/or target ports have been - * changed as the result of an input gesture. - * @param listener The listener to add. - * @see yfiles.graph.EdgeEventArgs - * @see yfiles.input.GraphEditorInputMode#reverseSelectedEdges - * @see yfiles.input.GraphEditorInputMode#reverseEdges - * @see yfiles.input.GraphEditorInputMode#reverseEdge - * @see yfiles.input.GraphEditorInputMode#removeEdgePortsChangedListener - */ - addEdgePortsChangedListener(listener:(sender:any,evt:yfiles.graph.EdgeEventArgs)=>void):void; - /** - * Removes the given listener for the EdgePortsChanged event that occurs after an edge's source and/or target ports have - * been changed as the result of an input gesture. - * @param listener The listener to remove. - * @see yfiles.graph.EdgeEventArgs - * @see yfiles.input.GraphEditorInputMode#reverseSelectedEdges - * @see yfiles.input.GraphEditorInputMode#reverseEdges - * @see yfiles.input.GraphEditorInputMode#reverseEdge - * @see yfiles.input.GraphEditorInputMode#addEdgePortsChangedListener - */ - removeEdgePortsChangedListener(listener:(sender:any,evt:yfiles.graph.EdgeEventArgs)=>void):void; - /** - * Gets or sets the callback that is responsible for creating a new node, for instance, in response to a mouse click. - *

- * A null value will disable node creation using mouse clicks, just as setting {@link yfiles.input.GraphEditorInputMode#allowCreateNode} to false. - *

- * @see yfiles.input.GraphEditorInputMode#createNode - * @type {function(yfiles.input.IInputModeContext, yfiles.graph.IGraph, yfiles.geometry.Point, yfiles.graph.INode): yfiles.graph.INode} - */ - nodeCreator:(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,location:yfiles.geometry.Point,parent:yfiles.graph.INode)=>yfiles.graph.INode; - /** - * Gets or sets the {@link yfiles.input.GraphEditorInputMode#textEditorInputMode} property. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.GraphEditorInputMode#createTextEditorInputMode} - * will be called. Upon change the {@link yfiles.input.GraphEditorInputMode#onTextEditorInputModeChanged} method will be called. - *

- *

- * By default this input mode has a priority of 100. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @type {yfiles.input.TextEditorInputMode} - */ - textEditorInputMode:yfiles.input.TextEditorInputMode; - /** - * Gets or sets the {@link yfiles.input.GraphEditorInputMode#createEdgeInputMode} property. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.GraphEditorInputMode#createCreateEdgeInputMode} - * will be called. Upon change the {@link yfiles.input.GraphEditorInputMode#onCreateEdgeInputModeChanged} method will be called. - *

- *

- * By default this input mode has a priority of 45. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @type {yfiles.input.CreateEdgeInputMode} - */ - createEdgeInputMode:yfiles.input.CreateEdgeInputMode; - /** - * Gets or sets a value indicating whether this mode should automatically {@link yfiles.graph.IGraph#remove remove labels} from the graph when a label text - * has been edited and the label text is empty. - *

- * The default value is true. - *

- * @default true - * @type {boolean} - */ - autoRemoveEmptyLabels:boolean; - /** - * Gets or sets a property that determines whether clicking on a node should automatically select all bends of self loops - * adjacent to that node. - *

- * The default value is true. - *

- * @see yfiles.input.GraphInputMode#clickSelectableItems - * @default true - * @type {boolean} - */ - autoSelectSelfloopBends:boolean; - /** - * Gets or sets a property that determines whether the label should be hidden while it is edited. - *

- * If enabled, any selection, focus, and highlight visualizations of the label are hidden along with the label - * visualization itself. - *

- *

- * Even if enabled, the label text is still visible in the label text editor. - *

- *

- * The default value is true. - *

- * @default true - * @type {boolean} - */ - hideLabelDuringEditing:boolean; - /** - * Gets or sets the {@link yfiles.input.GraphEditorInputMode#createBendInputMode} property. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.GraphEditorInputMode#createCreateBendInputMode} - * will be called. Upon change the {@link yfiles.input.GraphEditorInputMode#onCreateBendInputModeChanged} method will be called. - *

- *

- * By default this input mode has a priority of 42. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @type {yfiles.input.CreateBendInputMode} - */ - createBendInputMode:yfiles.input.CreateBendInputMode; - /** - * Gets or sets the {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode} property that is responsible for handling drag and drop operations of nodes onto the Canvas. - *

- * The mode by default is {@link yfiles.input.DropInputMode#enabled disabled} and needs to be enabled to work, first. If the field has not yet been initialized upon - * first access, the factory method {@link yfiles.input.GraphEditorInputMode#createNodeDropInputMode} will be called. Upon change - * the {@link yfiles.input.GraphEditorInputMode#onNodeDropInputModeChanged} method will be called. - *

- *

- * By default this input mode has a priority of 70. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @type {yfiles.input.NodeDropInputMode} - */ - nodeDropInputMode:yfiles.input.NodeDropInputMode; - /** - * Gets or sets whether the {@link yfiles.input.WaitInputMode} should be waiting. - *

- * This property just delegates to {@link yfiles.input.WaitInputMode#waiting}. - *

- * @type {boolean} - */ - waiting:boolean; - /** - * Adds the given listener for the LabelAdding event that occurs when a label is about to be added. - *

- * Event handlers for this event can customize the behavior for adding a new label extensively. Adding a label can be - * forbidden entirely, or the properties of the added label can be changed, by setting the appropriate properties on the - * {@link yfiles.input.LabelEditingEventArgs}. It is even possible to forbid adding a label, but edit an existing one instead. - *

- * @param listener The listener to add. - * @see yfiles.input.GraphEditorInputMode#removeLabelAddingListener - */ - addLabelAddingListener(listener:(sender:any,evt:yfiles.input.LabelEditingEventArgs)=>void):void; - /** - * Removes the given listener for the LabelAdding event that occurs when a label is about to be added. - *

- * Event handlers for this event can customize the behavior for adding a new label extensively. Adding a label can be - * forbidden entirely, or the properties of the added label can be changed, by setting the appropriate properties on the - * {@link yfiles.input.LabelEditingEventArgs}. It is even possible to forbid adding a label, but edit an existing one instead. - *

- * @param listener The listener to remove. - * @see yfiles.input.GraphEditorInputMode#addLabelAddingListener - */ - removeLabelAddingListener(listener:(sender:any,evt:yfiles.input.LabelEditingEventArgs)=>void):void; - /** - * Adds the given listener for the LabelEditing event that occurs when a label is about to be edited. - *

- * Event handlers for this event can customize the behavior for editing an existing label. Editing can be forbidden - * entirely, or redirected to a different label, even on a different owner. In case editing existing labels is unwanted, - * event handlers can also specify that instead of editing a label, a new one should be added. - *

- * @param listener The listener to add. - * @see yfiles.input.GraphEditorInputMode#removeLabelEditingListener - */ - addLabelEditingListener(listener:(sender:any,evt:yfiles.input.LabelEditingEventArgs)=>void):void; - /** - * Removes the given listener for the LabelEditing event that occurs when a label is about to be edited. - *

- * Event handlers for this event can customize the behavior for editing an existing label. Editing can be forbidden - * entirely, or redirected to a different label, even on a different owner. In case editing existing labels is unwanted, - * event handlers can also specify that instead of editing a label, a new one should be added. - *

- * @param listener The listener to remove. - * @see yfiles.input.GraphEditorInputMode#addLabelEditingListener - */ - removeLabelEditingListener(listener:(sender:any,evt:yfiles.input.LabelEditingEventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.GraphEditorInputMode; - } - /** - * A {@link yfiles.input.DropInputMode} providing a preview of the dragged item. - *

- * A dragged {@link yfiles.graph.IModelItem} is visualized during the drag operation. In addition, this input mode supports - * snapping of the dragged {@link yfiles.graph.IModelItem} via the {@link yfiles.input.SnapContext} and highlighting the {@link yfiles.input.ItemDropInputMode.#dropTarget}. - *

- *

- * Highlighting is done via a {@link yfiles.view.HighlightIndicatorManager.}. - *

- * Type parameter T. - * @class - * @extends {yfiles.input.DropInputMode} - * @template T - */ - export interface ItemDropInputMode extends yfiles.input.DropInputMode{} - export class ItemDropInputMode { - /** - * Initializes a new instance of the {@link yfiles.input.ItemDropInputMode.} class for the expected data format. - *

- * This instance fires events only if a drag operation carries data of the expected format. - *

- * @param expectedFormat This is a format that is used in {@link #getData}. - * @protected - */ - constructor(expectedFormat:string); - /** - * Cleanup method that calls {@link yfiles.input.ItemDropInputMode.#cleanupSnapContext}, {@link yfiles.input.ItemDropInputMode.#cleanupPreview} and {@link yfiles.input.ItemDropInputMode.#cleanupDropTarget}. - *

- * This method should be called for cleanup actions after a drag/drop gesture has been finished or canceled. - *

- * @protected - */ - cleanup():void; - /** - * Cleans up the drop target and its highlighting. - * @protected - */ - cleanupDropTarget():void; - /** - * Cleans up the item preview. - * @protected - */ - cleanupPreview():void; - /** - * Cleans up the snap context. - * @protected - */ - cleanupSnapContext():void; - /** - * Callback registered on the {@link yfiles.input.SnapContext} that collects {@link yfiles.input.SnapResult}s for the dragged element. - *

- * The default implementation doesn't collect any snap results. - *

- * @param source The {@link } this callback is registered at. - * @param evt The arguments describing the movement {@link }s shall be collected for. - * @protected - */ - collectSnapResults(source:any,evt:yfiles.input.CollectSnapResultsEventArgs):void; - /** - * Returns the drop target at the specified location. - *

- * The drop target is highlighted, if {@link yfiles.input.ItemDropInputMode.#highlightDropTarget} is enabled. Per default, null is returned. - *

- * @param dragLocation The location to return the drop target for. - * @returns The drop target at the specified location or null if no drop target can be found. - * @protected - */ - getDropTarget(dragLocation:yfiles.geometry.Point):yfiles.graph.IModelItem; - /** - * Initializes the drop target. - * @protected - */ - initializeDropTarget():void; - /** - * Initializes the item preview. - *

- * This method is called by {@link yfiles.input.ItemDropInputMode.#onDragEntered}. If a preview {@link yfiles.input.ItemDropInputMode.#showPreview shall be displayed}, the {@link yfiles.input.ItemDropInputMode.#previewGraph preview graph} is initialized and {@link yfiles.input.ItemDropInputMode.#populatePreviewGraph} - * is called. - *

- * @protected - */ - initializePreview():void; - /** - * Initializes the snapping context. - *

- * This method is called by {@link yfiles.input.ItemDropInputMode.#onDragEntered} - *

- * @protected - */ - initializeSnapContext():void; - /** - * Called whenever a new item is created - * @param evt - * @protected - */ - onItemCreated(evt:yfiles.collections.ItemEventArgs):void; - /** - * Subclasses shall fill the specified graph that is used to preview the dragged item. - * @param previewGraph The preview graph to fill. - * @protected - */ - populatePreviewGraph(previewGraph:yfiles.graph.IGraph):void; - /** - * Calls {@link yfiles.input.ItemDropInputMode.#getDropTarget} for {@link yfiles.input.ItemDropInputMode.#snappedMousePosition} and sets the returned item as {@link yfiles.input.ItemDropInputMode.#dropTarget}. - *

- * If {@link yfiles.input.ItemDropInputMode.#highlightDropTarget} is enabled, the highlight is updated as well. - *

- * @param dragLocation The location to update the drop target for. - * @protected - */ - updateDropTarget(dragLocation:yfiles.geometry.Point):void; - /** - * Subclasses shall update the {@link yfiles.input.ItemDropInputMode.#previewGraph preview graph} so the dragged item is displayed at the specified dragLocation. - * @param previewGraph The preview graph to update. - * @param dragLocation The current drag location. - * @protected - */ - updatePreview(previewGraph:yfiles.graph.IGraph,dragLocation:yfiles.geometry.Point):void; - /** - * Adds the given listener for the ItemCreated event that occurs when a new item gets created by this input mode. - * @param listener The listener to add. - * @see yfiles.input.ItemDropInputMode.#removeItemCreatedListener - */ - addItemCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the ItemCreated event that occurs when a new item gets created by this input mode. - * @param listener The listener to remove. - * @see yfiles.input.ItemDropInputMode.#addItemCreatedListener - */ - removeItemCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Gets or sets whether a preview of the dragged element is displayed during the drag - * @type {boolean} - */ - showPreview:boolean; - /** - * Gets or sets whether dragged items are snapped. - * @type {boolean} - */ - snappingEnabled:boolean; - /** - * Gets or sets event recognizer that temporarily disables snapping. - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - disableSnappingRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets whether the drop target is highlighted. - * @type {boolean} - */ - highlightDropTarget:boolean; - /** - * Gets or sets the {@link yfiles.input.ItemDropInputMode.#snapContext} which is used to snap the dragged element during the drag. - *

- * If set to null (the default) this input mode tries to obtain the {@link yfiles.input.ItemDropInputMode.#snapContext} from the {@link yfiles.input.IInputModeContext}. To explicitly - * disable snapping, a {@link yfiles.input.ItemDropInputMode.#snapContext} implementation that does nothing has to be set to this instance. - *

- * @type {yfiles.input.SnapContext} - */ - snapContext:yfiles.input.SnapContext; - /** - * Gets the current snapped mouse position during drag operations. - *

- * The position is returned in world coordinates according to the {@link yfiles.view.CanvasComponent} into which this input mode is - * installed. If {@link yfiles.input.ItemDropInputMode.#snappingEnabled} is false, this value corresponds with {@link yfiles.input.DropInputMode#mousePosition}. - *

- * @type {yfiles.geometry.Point} - */ - snappedMousePosition:yfiles.geometry.Point; - /** - * Gets the drop target at {@link yfiles.input.ItemDropInputMode.#snappedMousePosition} - * @see yfiles.input.ItemDropInputMode.#highlightDropTarget - * @type {yfiles.graph.IModelItem} - */ - dropTarget:yfiles.graph.IModelItem; - /** - * Gets the currently dragged {@link yfiles.graph.IModelItem} instance. - *

- * This implementation simply tries to cast the {@link yfiles.input.DropInputMode#dropData} to the type of the dragged items. - *

- * @protected - * @abstract - * @type {T} - */ - draggedItem:T; - /** - * Gets or sets the callback for item creation. - *

- * Called by method {@link yfiles.input.ItemDropInputMode.#onDragDropped}. - *

- * @type {function(yfiles.input.IInputModeContext, yfiles.graph.IGraph, T, yfiles.graph.IModelItem, yfiles.geometry.Point): T} - */ - itemCreator:(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,draggedItem:T,dropTarget:yfiles.graph.IModelItem,dropLocation:yfiles.geometry.Point)=>T; - /** - * Gets the graph displayed as item preview. - * @protected - * @type {yfiles.graph.IGraph} - */ - previewGraph:yfiles.graph.IGraph; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.ItemDropInputMode; - } - /** - * An implementation of {@link yfiles.input.IPositionHandler} that shows the various label position candidates and lets the user - * move a label to one of those candidate positions. - * @class - * @implements {yfiles.input.IPositionHandler} - */ - export interface LabelPositionHandler extends yfiles.lang.Object,yfiles.input.IPositionHandler{} - export class LabelPositionHandler { - /** - * Initializes a new instance of the {@link yfiles.input.LabelPositionHandler} class. - * @param label The label that shall be moved. - */ - constructor(label:yfiles.graph.ILabel); - /** - * - * @param context - * @param originalLocation - */ - cancelDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; - /** - * Creates an {@link yfiles.view.ICanvasObjectDescriptor} to display the given candidate position. - * @param context The context for which the descriptor is created. - * @param highlight Whether to highlight the paintable. This will be true for the current position and false for the others. - * @returns An implementation that will render the given candidate. - * @protected - */ - createCandidateDescriptor(context:yfiles.input.IInputModeContext,highlight:boolean):yfiles.view.ICanvasObjectDescriptor; - /** - * - * @param context - * @param originalLocation - * @param newLocation - */ - dragFinished(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; - /** - * Calculates a distance value between a candidate rectangle and the mouse location. - * @param rectangle The rectangle candidate. - * @param location The mouse location. - * @returns A value indicating the closeness of the mouse to the rectangle. - * @protected - */ - getDistance(rectangle:yfiles.geometry.IOrientedRectangle,location:yfiles.geometry.Point):number; - /** - * Callback method that gets the candidates for the given label. - * @param label The label. - * @returns A possibly empty enumerator over possible label parameter candidates. - * @protected - */ - getParameterCandidates(label:yfiles.graph.ILabel):yfiles.collections.IEnumerable; - /** - * - * @param context - * @param originalLocation - * @param newLocation - */ - handleMove(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; - /** - * - * @param context - */ - initializeDrag(context:yfiles.input.IInputModeContext):void; - /** - * Actually applies the given parameter at the end of the gesture. - * @param label The label to set the parameter for. - * @param layoutParameter The new parameter. - * @protected - */ - setLayoutParameter(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):void; - /** - * - * @param location - */ - setPosition(location:yfiles.geometry.Point):void; - /** - * Determines whether to use a {@link yfiles.graph.ILabelModelParameterFinder} to find the best candidate. - *

- * This implementation returns true if the {@link yfiles.input.LabelPositionHandler#useFinder} property is true and the control key is pressed. - *

- * @param context The context that is currently being used - may be null if the method is called without context. - * @returns - * @protected - */ - useParameterFinder(context:yfiles.input.IInputModeContext):boolean; - /** - * A {@link string} that will be used to find the {@link yfiles.view.IVisualTemplate} that will be used to represent the rectangular selection. - * @const - * @static - * @type {string} - */ - static CANDIDATE_TEMPLATE_KEY:string; - /** - * A {@link string} that will be used to find the {@link yfiles.view.IVisualTemplate} that will be used to represent the rectangular selection. - * @const - * @static - * @type {string} - */ - static HIGHLIGHT_TEMPLATE_KEY:string; - /** - * Gets or sets the template to use for showing candidates. - * @type {yfiles.view.IVisualTemplate} - */ - candidateTemplate:yfiles.view.IVisualTemplate; - /** - * Gets or sets the template to use for showing highlighted candidates. - * @type {yfiles.view.IVisualTemplate} - */ - highlightTemplate:yfiles.view.IVisualTemplate; - /** - * Gets the graph instance from the {@link yfiles.input.IInputModeContext} that has been passed to the {@link yfiles.input.LabelPositionHandler#initializeDrag} - * method. - * @protected - * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - /** - * Gets the label instance. - * @protected - * @type {yfiles.graph.ILabel} - */ - label:yfiles.graph.ILabel; - /** - * - * @type {yfiles.geometry.IPoint} - */ - location:yfiles.geometry.IPoint; - /** - * Gets or sets a property that determines whether the handler may use a {@link yfiles.graph.ILabelModelParameterFinder} to assign - * arbitrary positions. - *

- * The default value is true - *

- * @see yfiles.input.LabelPositionHandler#useParameterFinder - * @type {boolean} - */ - useFinder:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.LabelPositionHandler; - } - /** - * The default label snap context helper that provides the snap lines and the snap results to the {@link yfiles.input.LabelSnapContext} - * during dragging of labels. - * @see yfiles.input.LabelSnapContext - * @see yfiles.graph.LabelDecorator#labelSnapContextHelperDecorator - * @class - * @implements {yfiles.input.ILabelSnapContextHelper} - */ - export interface LabelSnapContextHelper extends yfiles.lang.Object,yfiles.input.ILabelSnapContextHelper{} - export class LabelSnapContextHelper { - /** - * Adds snap lines to the snapContext that are parallel to the path segments of the owner edge at the given distance. - *

- * This method is not used by this class to create its snap lines. Instead, it can be called by custom sub-classes to - * create this kind of snap lines. - *

- * @param snapContext The snap context which manages the snap lines and the settings. Note that implementations should not change the state of - * the context explicitly. - * @param inputModeContext The context of the input mode that handles the dragging. - * @param label The edge label that is dragged. - * @param distance The distance of the added snap lines from the edge path. - * @protected - */ - addEdgePathSnapLines(snapContext:yfiles.input.LabelSnapContext,inputModeContext:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel,distance:number):void; - /** - * Adds snap lines to the snapContext that are parallel to the path segments of the owner edge at particular distances. - *

- * The corresponding settings of the snapContext specify which snap lines are actually created. - *

- * @param snapContext The snap context which manages the snap lines and the settings. Note that implementations should not change the state of - * the context explicitly. - * @param inputModeContext The context of the input mode that handles the dragging. - * @param label The edge label that is dragged. - * @protected - */ - addEdgePathSnapLines(snapContext:yfiles.input.LabelSnapContext,inputModeContext:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel):void; - /** - * Adds two snap line for the initial center location of the label, one in the direction of the up vector, the other - * orthogonal to that direction. - *

- * This method is called by {@link yfiles.input.LabelSnapContextHelper#addSnapLines} to add the snap lines for the initial position - * label location. - *

- * @param snapContext The snap context which manages the snap lines and the settings. Note that implementations should not change the state of - * the context explicitly. - * @param inputModeContext The context of the input mode that handles the dragging. - * @param label The label that is dragged. - * @protected - */ - addInitialLocationSnapLines(snapContext:yfiles.input.LabelSnapContext,inputModeContext:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel):void; - /** - * Adds snap lines to the snapContext that are parallel to the owner node's border at particular distances. - *

- * The corresponding settings of the snapContext specify which snap lines are actually created. - *

- * @param snapContext The snap context which manages the snap lines and the settings. Note that implementations should not change the state of - * the context explicitly. - * @param inputModeContext The context of the input mode that handles the dragging. - * @param label The node label that is dragged. - * @protected - */ - addNodeShapeSnapLines(snapContext:yfiles.input.LabelSnapContext,inputModeContext:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel):void; - /** - * Called during {@link yfiles.input.IDragHandler#initializeDrag initialization} of a label dragging to add {@link yfiles.input.SnapLine snap lines} to which the label can potentially snap to the - * snapContext. - * @param snapContext The snap context which manages the snap lines and the settings. Note that implementations should not change the state of - * the context explicitly. - * @param inputModeContext The context of the input mode that handles the dragging. - * @param label The label that is dragged. - */ - addSnapLines(snapContext:yfiles.input.LabelSnapContext,inputModeContext:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel):void; - /** - * - * @param context - * @param evt - * @param suggestedLayout - * @param label - */ - collectSnapResults(context:yfiles.input.LabelSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,suggestedLayout:yfiles.geometry.IOrientedRectangle,label:yfiles.graph.ILabel):void; - /** - * Returns the static shared instance of this class. - *

- * Since this implementation does not carry any state, this instance can safely be used even in multi-threaded - * environments. - *

- * @const - * @static - * @type {yfiles.input.LabelSnapContextHelper} - */ - static INSTANCE:yfiles.input.LabelSnapContextHelper; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.LabelSnapContextHelper; - } - /** - * Event arguments for the {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener ValidateLabelText} - * event. - *

- * Event handlers can set the {@link yfiles.input.LabelTextValidatingEventArgs#cancel} property to true to cancel label editing if validation failed, or set the {@link yfiles.input.LabelTextValidatingEventArgs#newText} property to a - * changed, validated value. - *

- * @class - * @extends {yfiles.input.InputModeEventArgs} - * @final - */ - export interface LabelTextValidatingEventArgs extends yfiles.input.InputModeEventArgs{} - export class LabelTextValidatingEventArgs { - /** - * Initializes a new instance of the {@link yfiles.input.LabelTextValidatingEventArgs} class. - * @param context The context. - * @param label The label. - * @param newText The initial new text as entered by the user. - */ - constructor(context:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel,newText:string); - /** - * Gets the label that is being edited. - *

- * Note that the label might not belong to a graph if it is a dummy for a label that is about to be created. - *

- * @type {yfiles.graph.ILabel} - */ - label:yfiles.graph.ILabel; - /** - * Gets or sets the new text to use for the label. - * @see yfiles.input.LabelTextValidatingEventArgs#cancel - * @type {string} - */ - newText:string; - /** - * Gets or sets a value indicating whether the edit should be canceled. - * @type {boolean} - */ - cancel:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.LabelTextValidatingEventArgs; - } - /** - * An {@link yfiles.input.IInputMode} that can be used to drag a {@link yfiles.graph.ILabel} in a {@link yfiles.view.GraphComponent}. - *

- * This implementation shows the possible candidate positions for a given label and allows the user to drag the label to - * one of these positions. - *

- * @class - * @extends {yfiles.input.MoveInputMode} - */ - export interface MoveLabelInputMode extends yfiles.input.MoveInputMode{} - export class MoveLabelInputMode { - /** - * Creates a new instance that will move labels in the graph retrieved from the {@link yfiles.input.MoveInputMode#inputModeContext}. - * @see yfiles.input.MoveLabelInputMode#graph - */ - constructor(); - /** - * Creates the hit testable that will be used to determine whether this mode may be activated. - *

- * This implementation returns an instance that delegates to {@link yfiles.input.MoveLabelInputMode#isValidLabelHit}. - *

- * @returns A hit testable. - * @protected - */ - createLabelHitTestable():yfiles.input.IHitTestable; - /** - * Creates the {@link yfiles.input.IPositionHandler position handler} for the given label used in {@link yfiles.input.MoveLabelInputMode#isValidLabelHit}. - *

- * First, this implementation checks for a position handler in the label's - * {@link yfiles.graph.ILookup lookup}. If this fails, it creates a new label position handler for the given label. - *

- * @param label The label to create a position handler for. - * @returns A position handler for the given label. - * @protected - */ - createLabelPositionHandler(label:yfiles.graph.ILabel):yfiles.input.IPositionHandler; - /** - * Looks for a label that has been hit at the specified position. - *

- * This implementation checks the {@link yfiles.input.MoveLabelInputMode#graphSelection} to see if there is exactly one selected label. This label is returned if it is hit by - * the mouse and {@link yfiles.input.MoveLabelInputMode#shouldMove} returns true. Otherwise, null is returned. - *

- * @param context The context for the hit test. - * @param location The coordinates for the hit test. - * @returns The label hit at the given location or null. - * @see yfiles.input.MoveLabelInputMode#isValidLabelHit - * @see yfiles.input.MoveLabelInputMode#shouldMove - * @protected - */ - getHitLabel(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):yfiles.graph.ILabel; - /** - * Determines whether or not a valid label has been hit at the specified position. - *

- * This implementation calls {@link yfiles.input.MoveLabelInputMode#getHitLabel} to find the label at the specified location. If a - * label is hit, the {@link yfiles.input.IPositionHandler} is created by - * {@link yfiles.input.MoveLabelInputMode#createLabelPositionHandler}. - *

- * @param context The context for the hit test. - * @param location The coordinates for the hit test. - * @returns true if a valid label is hit and the label moving should be started here. Otherwise, false. - * @protected - */ - isValidLabelHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * Determines whether or not a label is allowed to be moved. - *

- * This implementation returns false if the parent input mode {@link yfiles.input.GraphEditorInputMode#shouldMove forbids} moving the label. Overriding implementations should - * query this implementation as base if this feature is desired. - *

- * @param context The context. - * @param label The label to be checked. - * @returns true if the label is allowed to move. - * @see yfiles.input.MoveLabelInputMode#getHitLabel - * @protected - */ - shouldMove(context:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel):boolean; - /** - * Gets or sets a value indicating whether or not using the {@link yfiles.graph.ILabelModelParameterFinder} to assign new label - * model parameters is allowed. - *

- * The default is true - *

- *

- * This property has no effect if an {@link yfiles.input.IPositionHandler} is available in the label's {@link yfiles.graph.ILookup lookup}. - *

- * @see yfiles.input.MoveLabelInputMode#createLabelPositionHandler - * @type {boolean} - */ - useLabelModelParameterFinder:boolean; - /** - * Gets the label that is currently moved or null if there is no such label. - *

- * The value of this property is not null only if this mode is currently active and performs a move operation, that is - * between the {@link yfiles.input.MoveInputMode#addDragStartingListener DragStarting} and the {@link yfiles.input.MoveInputMode#addDragFinishedListener DragFinished} - * event handlers. - *

- * @type {yfiles.graph.ILabel} - */ - movedLabel:yfiles.graph.ILabel; - /** - * Gets the {@link yfiles.view.IGraphSelection} this mode is acting upon. - * @type {yfiles.view.IGraphSelection} - */ - graphSelection:yfiles.view.IGraphSelection; - /** - * Gets the {@link yfiles.graph.IGraph} this mode is acting upon. - * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.MoveLabelInputMode; - } - /** - * An {@link yfiles.input.ItemDropInputMode.} specialized to drag'n'drop {@link yfiles.graph.INode}s. - *

- * A dragged {@link yfiles.graph.INode} is visualized during the drag operation. The input mode does also support snapping of the - * dragged {@link yfiles.graph.INode} via the {@link yfiles.input.SnapContext}. When the {@link yfiles.input.ItemDropInputMode.#draggedItem dragged node} is dropped, This mode can can drag - * nodes onto {@link yfiles.graph.IGraph#isGroupNode group} and optional {@link yfiles.graph.IFoldingView#collapse folder nodes} and automatically add the node to the corresponding group node in the - * hierarchy. In this case the {@link yfiles.input.NodeDropInputMode#isValidParentPredicate} will be queried if the dropped upon node is actually a valid parent. - *

- * @see yfiles.input.NodeDropInputMode#startDrag - * @class - * @extends {yfiles.input.ItemDropInputMode.} - */ - export interface NodeDropInputMode extends yfiles.input.ItemDropInputMode{} - export class NodeDropInputMode { - /** - * Initializes a new instance of the {@link yfiles.input.NodeDropInputMode} class for the expected data format. - * @param expectedFormat This is a format that is used in {@link #startDrag}. - * @protected - */ - constructor(expectedFormat:string); - /** - * Initializes a new instance of the {@link yfiles.input.NodeDropInputMode} class for {@link yfiles.graph.INode}s. - *

- * This instance fires events only if the format of the data of the drag operation is the full name of the {@link yfiles.graph.INode} - * type. Such a drag operation can be started for example with {@link yfiles.input.NodeDropInputMode#startDrag}. - *

- */ - constructor(); - /** - * Creates the node in the graph after it's been dropped. - *

- * This method is called by the {@link yfiles.input.ItemDropInputMode.#itemCreator} that is set as default on this class. - *

- * @param context The context for which the node should be created. - * @param graph The {@link Graph} in which to create the item. - * @param node The node that was dragged and should therefore be created. - * @param dropTarget The {@link } on which the node is dropped. - * @param layout The bounds of the new node. - * @returns a newly created node. - * @protected - */ - createNode(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,node:yfiles.graph.INode,dropTarget:yfiles.graph.IModelItem,layout:yfiles.geometry.Rect):yfiles.graph.INode; - /** - * Calculates the layout of the new node. - *

- * In this implementation the mouse location is used as center of the node. Can be overridden in child class to implement a - * different layout. - *

- * @param mouseLocation Current mouse position - * @param size Size of the node - * @returns a {@link } with the given size and the mouse location as center. - * @protected - */ - getNodeLayout(mouseLocation:yfiles.geometry.Point,size:yfiles.geometry.Size):yfiles.geometry.Rect; - /** - * Starts a drag and drop operation for a {@link yfiles.graph.INode}. - *

- * This convenience implementation delegates to {@link yfiles.view.DragSource#startDrag} passing the node to the {@link yfiles.view.DragDropItem} - * using the corresponding type. - *

- *

- * If useCssCursors is enabled, the following CSS classes are assigned to elements hovered during a drag operation, - * depending on the allowed drag-drop operations for these elements: - *

- *
    - *
  • yfiles-cursor-dragdrop-move
  • - *
  • yfiles-cursor-dragdrop-link
  • - *
  • yfiles-cursor-dragdrop-all
  • - *
  • yfiles-cursor-dragdrop-no-drop
  • - *
- * @param dragSource The source of the drag operation. - * @param node The node to drag. - * @param [dragDropEffects=yfiles.view.DragDropEffects.ALL] The allowed drag drop effects. - * @param [useCssCursors=true] Whether to adjust the classes of elements being hovered over during the drag. The default is true. - * @see yfiles.view.DragSource#startDrag - * @see yfiles.view.DragDropItem - * @static - */ - static startDrag(dragSource:HTMLElement,node:yfiles.graph.INode,dragDropEffects?:yfiles.view.DragDropEffects,useCssCursors?:boolean):void; - /** - * Starts a drag and drop operation for a {@link yfiles.graph.INode}. - *

- * This convenience implementation delegates to {@link yfiles.view.DragSource#startDrag} passing the node to the {@link yfiles.view.DragDropItem} - * using the corresponding type. - *

- *

- * If useCssCursors is enabled, the following CSS classes are assigned to elements hovered during a drag operation, - * depending on the allowed drag-drop operations for these elements: - *

- *
    - *
  • yfiles-cursor-dragdrop-move
  • - *
  • yfiles-cursor-dragdrop-link
  • - *
  • yfiles-cursor-dragdrop-all
  • - *
  • yfiles-cursor-dragdrop-no-drop
  • - *
- * @param {Object} options The parameters to pass. - * @param options.dragSource The source of the drag operation. - * @param options.node The node to drag. - * @param [options.dragDropEffects=yfiles.view.DragDropEffects.ALL] The allowed drag drop effects. - * @param [options.useCssCursors=true] Whether to adjust the classes of elements being hovered over during the drag. The default is true. - * @see yfiles.view.DragSource#startDrag - * @see yfiles.view.DragDropItem - * @static - */ - static startDrag(options:{dragSource:HTMLElement,node:yfiles.graph.INode,dragDropEffects?:yfiles.view.DragDropEffects,useCssCursors?:boolean}):void; - /** - * Gets or sets the callback for testing whether a {@link yfiles.input.ItemDropInputMode.#draggedItem dragged node} should be created as a {@link yfiles.graph.IGraph#isGroupNode group node}. - *

- * The default implementation returns false always. Can be set to a different value to implement custom group node - * detection. - *

- * @type {function(yfiles.graph.INode): boolean} - */ - isGroupNodePredicate:(obj:yfiles.graph.INode)=>boolean; - /** - * Gets or sets the callback for testing whether an existing node in the graph can be used as a valid parent node in the - * context of grouping. - *

- * The default implementation returns true always. Can be set to a different value to implement custom group node - * detection. Note that the node passed to the predicate may be null to indicate that the node will be placed at the root - * of the hierarchy. - *

- * @see yfiles.input.NodeDropInputMode#allowNonGroupNodeAsParent - * @see yfiles.input.NodeDropInputMode#allowFolderNodeAsParent - * @type {function(yfiles.graph.INode): boolean} - */ - isValidParentPredicate:(obj:yfiles.graph.INode)=>boolean; - /** - * Gets or sets a value indicating whether nodes can be dropped on {@link yfiles.graph.IFoldingView#collapse collapsed} folder nodes. - *

- * If this property is set to true, dropping nodes on collapsed folder nodes will create the node inside the folder node in - * the master graph. In that case the {@link yfiles.input.ItemDropInputMode.#addItemCreatedListener ItemCreated} event will yield the node in the {@link yfiles.graph.FoldingManager#masterGraph master graph}. The node will - * not be {@link yfiles.graph.IGraph#contains contained} in the currently visible graph. By default this feature is disabled. In any case the {@link yfiles.input.NodeDropInputMode#isValidParentPredicate} will be queried - * additionally if the node is a valid parent. - *

- * @type {boolean} - */ - allowFolderNodeAsParent:boolean; - /** - * Gets or sets a value indicating whether nodes can be dropped onto nodes that are no {@link yfiles.graph.IGraph#isGroupNode group nodes}. - *

- * If this property is enabled, dropping a node on a non-group node will effectively convert the non-group node to a real - * group node. By default this feature is disabled. In any case the {@link yfiles.input.NodeDropInputMode#isValidParentPredicate} will be queried additionally if the node is a valid - * parent. - *

- * @type {boolean} - */ - allowNonGroupNodeAsParent:boolean; - /** - * Gets the currently dragged {@link yfiles.graph.IModelItem} instance. - *

- * This implementation simply tries to cast the {@link yfiles.input.DropInputMode#dropData} to {@link yfiles.graph.INode}. - *

- * @protected - * @type {yfiles.graph.INode} - */ - draggedItem:yfiles.graph.INode; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.NodeDropInputMode; - } - /** - * A helper class that can be used to interactively reshape orthogonal edge paths. - *

- * This class will be queried from the {@link yfiles.input.IInputModeContext} of implementations of {@link yfiles.input.IPositionHandler}, - * {@link yfiles.input.IHandle}, and {@link yfiles.input.IReshapeHandler} that support orthogonal editing of edges. - *

- *

- * In a first step, the edit (which is a movement of one or more {@link yfiles.graph.IPort}s, {@link yfiles.graph.IBend}s, {@link yfiles.graph.IEdge edge ends}, or - * {@link yfiles.graph.IPortOwner}s) is being {@link yfiles.input.OrthogonalEdgeEditingContext#initializeDrag initialized} before anything has been changed. Then, client code that seeks to modify - * the graph, uses the methods {@link yfiles.input.OrthogonalEdgeEditingContext#addExplicitlyMovedBend}, - * {@link yfiles.input.OrthogonalEdgeEditingContext#addMovedEdgeEnd}, {@link yfiles.input.OrthogonalEdgeEditingContext#addMovedPort}, and - * {@link yfiles.input.OrthogonalEdgeEditingContext#addTransformedPortOwner}. In the next step, the {@link yfiles.input.OrthogonalEdgeEditingContext#dragInitialized drag is being initialized} and - * all affected edges will be {@link yfiles.input.OrthogonalEdgeEditingContext#prepareEdgePaths prepared} so that the editing will not destroy the orthogonality. Interested editors now get - * the chance to register and negotiate {@link yfiles.input.OrthogonalEdgeEditingContext#addImplicitlyMovedBend implicitly moved} bends. Then the actual editing is performed and the edit is either - * {@link yfiles.input.OrthogonalEdgeEditingContext#cancelDrag canceled}, in which case the {@link yfiles.input.OrthogonalEdgeEditingContext#removeAddedBends added bends are removed} or the edit is {@link yfiles.input.OrthogonalEdgeEditingContext#dragFinished finished} and the affected edges are being - * {@link yfiles.input.OrthogonalEdgeEditingContext#cleanUp cleaned up}. - *

- * @see yfiles.input.IOrthogonalEdgeHelper - * @see yfiles.input.OrthogonalEdgeEditingContext#enabled - * @see yfiles.input.OrthogonalEdgeEditingContext#movePorts - * @class - */ - export interface OrthogonalEdgeEditingContext extends yfiles.lang.Object{} - export class OrthogonalEdgeEditingContext { - /** - * Initializes a new instance of the {@link yfiles.input.OrthogonalEdgeEditingContext} class that is initially {@link yfiles.input.OrthogonalEdgeEditingContext#enabled}. - */ - constructor(); - /** - * Registers the provided bend with this instance so that it will be considered explicitly moved for this edit. - *

- * {@link yfiles.input.IDragHandler} implementations that are being used to explicitly move a bend during the edit should use this - * method to register their edit while they are being {@link yfiles.input.IDragHandler#initializeDrag initialized}. - *

- * @param movementInfo The movement info that describes the movement of the bend. - */ - addExplicitlyMovedBend(movementInfo:yfiles.input.MovementInfo):void; - /** - * Registers the provided bend as being moved implicitly for this edit. - *

- * The instance will be returned by {@link yfiles.input.OrthogonalEdgeEditingContext#createImplicitlyMovedBendInfo} and the {@link yfiles.input.MovementInfo#moveType} will - * be combined with the requested move type. - *

- * @param movementInfo The movement info for the bend. - * @returns The info that has been registered with this instance. - */ - addImplicitlyMovedBend(movementInfo:yfiles.input.MovementInfo):yfiles.input.MovementInfo; - /** - * Registers the provided end of the edge with this instance so that it will be considered explicitly moved for this edit. - *

- * {@link yfiles.input.IDragHandler} implementations that are being used to explicitly move the end of an edge during the edit - * should use this method to register their edit while they are being {@link yfiles.input.IDragHandler#initializeDrag initialized}. - *

- * @param movementInfo The movement info that describes the movement of the end of the edge. The {@link #movedItem} must be an {@link }. - * @param sourceEnd true if the movementInfo represents the source end of the edge. - * @see yfiles.input.IEdgePortHandleProvider - */ - addMovedEdgeEnd(movementInfo:yfiles.input.MovementInfo,sourceEnd:boolean):void; - /** - * Registers the provided port with this instance so that it will be considered explicitly moved for this edit. - *

- * {@link yfiles.input.IDragHandler} implementations that are being used to explicitly move a bend during the edit should use this - * method to register their edit while they are being {@link yfiles.input.IDragHandler#initializeDrag initialized}. - *

- * @param movementInfo The movement info that describes the movement of the port. - */ - addMovedPort(movementInfo:yfiles.input.MovementInfo):void; - /** - * Adds an {@link yfiles.graph.IPortOwner} that is being transformed somehow during the edit so that the attached {@link yfiles.graph.IPortOwner#ports ports} will be - * moved in an irregular ({@link yfiles.input.MoveTypes#ARBITRARY_MOVE non-linear}) way. - *

- * Normally this will be nodes that are being resized or moved in a non-linear way, or edges, whose bends or ports are - * being changed. - *

- * @param owner The item that will be transformed. - */ - addTransformedPortOwner(owner:yfiles.graph.IPortOwner):void; - /** - * Called by client edit code when a drag has been canceled. - *

- * Resets all internal state lists and sets {@link yfiles.input.OrthogonalEdgeEditingContext#isInitialized} back to false. Also {@link yfiles.input.OrthogonalEdgeEditingContext#removeAddedBends temporarily added bends are removed} and {@link yfiles.input.OrthogonalEdgeEditingContext#addCleanedUpListener CleanedUp} - * will be triggered. - *

- */ - cancelDrag():void; - /** - * Performs clean up procedures. - *

- * This is called in response to {@link yfiles.input.OrthogonalEdgeEditingContext#cancelDrag} and {@link yfiles.input.OrthogonalEdgeEditingContext#dragFinished} - * as well as initially during {@link yfiles.input.OrthogonalEdgeEditingContext#initializeDrag}. - *

- * @protected - */ - cleanUp():void; - /** - * Cleans up the edge's path after a successfully {@link yfiles.input.OrthogonalEdgeEditingContext#dragFinished finished drag}. - *

- * This implementations delegates to the {@link yfiles.input.IOrthogonalEdgeHelper}'s {@link yfiles.input.IOrthogonalEdgeHelper#cleanUpEdge} - * method. - *

- * @param graph The graph in which the edge resides. - * @param edge The modified edge. - * @see yfiles.input.OrthogonalEdgeEditingContext#getOrthogonalEdgeHelper - * @protected - */ - cleanUpEdgePath(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge):void; - /** - * Called after a successfully {@link yfiles.input.OrthogonalEdgeEditingContext#dragFinished finished drag} to clean up artifacts of modified edges. - * @param graph The graph. - * @see yfiles.input.OrthogonalEdgeEditingContext#cleanUpEdgePath - * @protected - */ - cleanupEdgePaths(graph:yfiles.graph.IGraph):void; - /** - * Creates or obtains a previously created {@link yfiles.input.MovementInfo} for the provided implicitly moved bend. - *

- * This method is queried by client {@link yfiles.input.IDragHandler} implementations that have been initialized for the current - * edit that need to move adjacent bends implicitly. Implementations should pass as the parameters the movement information - * that controls the vertical or horizontal movement of the bend implicitly. - *

- * @param bend The implicitly moved bend. - * @param verticalAdjacentInfo The movement info that implicitly constrains the vertical movement of the bend or null. - * @param horizontalAdjacentInfo The movement info that implicitly constrains the horizontal movement of the bend or null. - * @returns The info to be used by clients that requested it. - */ - createImplicitlyMovedBendInfo(bend:yfiles.graph.IBend,horizontalAdjacentInfo:yfiles.input.MovementInfo,verticalAdjacentInfo:yfiles.input.MovementInfo):yfiles.input.MovementInfo; - /** - * Called when a drag has been successfully finished. - *

- * This method will perform the necessary clean up and {@link yfiles.input.OrthogonalEdgeEditingContext#cleanupEdgePaths clean up edge paths}. - *

- * @see yfiles.input.OrthogonalEdgeEditingContext#addCleanedUpListener - */ - dragFinished():void; - /** - * Needs to be called by client editing code after {@link yfiles.input.OrthogonalEdgeEditingContext#initializeDrag} has been called - * and all {@link yfiles.input.IDragHandler}s have been initialized. - *

- * This method will update the {@link yfiles.input.OrthogonalEdgeEditingContext#isInitializing} and {@link yfiles.input.OrthogonalEdgeEditingContext#isInitialized} properties accordingly and will {@link yfiles.input.OrthogonalEdgeEditingContext#prepareEdgePaths prepare} the edge paths. Finally, the {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializedListener Initialized} - * event is raised so that registered handlers can perform their post-initialization process. - *

- */ - dragInitialized():void; - /** - * Gets the {@link yfiles.input.MovementInfo movement infos} that describe the orthogonal path of the edge. - * @param edge The edge to obtain the infos for. - * @returns An array that contains for the first entry the source end of the edge, then all bends and then as the final entry the - * target end of the edge. For the bends, this can be be null values if nothing is known about the bend, yet. - * @protected - */ - getMovementInfos(edge:yfiles.graph.IEdge):yfiles.collections.IListEnumerable; - /** - * Callback method that gets the {@link yfiles.input.IOrthogonalEdgeHelper} instance associated with the given edge. - *

- * This implementation obtains the helper instance from the {@link yfiles.graph.ILookup#lookup} of the edge. - *

- * @param edge The edge to obtain the helper instance for. - * @returns The helper instance to use or null, in which case the default behavior will be used. - * @see yfiles.input.OrthogonalEdgeHelper - * @protected - */ - getOrthogonalEdgeHelper(edge:yfiles.graph.IEdge):yfiles.input.IOrthogonalEdgeHelper; - /** - * Gets the declared segment orientation for the provided segment at the given edge. - *

- * This implementation uses the {@link yfiles.input.OrthogonalEdgeEditingContext#getOrthogonalEdgeHelper GetOrthogonalEdgeHelper()}.{@link yfiles.input.IOrthogonalEdgeHelper#getSegmentOrientation GetSegmentOrientation} method to yield the orientation. - *

- * @param edge The edge to determine the orientation of the segment. - * @param segmentIndex Index of the segment. - * @returns The orientation of the segment. - */ - getSegmentOrientation(edge:yfiles.graph.IEdge,segmentIndex:number):yfiles.input.SegmentOrientation; - /** - * Called by client code when a drag is started about to be started. - *

- * This code needs to be called before any of the {@link yfiles.input.IDragHandler} implementations are initialized so that they - * can then register the items they are going to modify with this instance. After this method has been called, the handlers - * that perform the actual edit need to be initialized and as soon as this has been done, {@link yfiles.input.OrthogonalEdgeEditingContext#dragInitialized} - * should be called. - *

- * @param context The context in which the edit is going to be performed. - * @throws {Stubs.Exceptions.InvalidOperationError} If this context is already {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializedListener Initialized} - * or currently - * {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializingListener Initializing}. - * @see yfiles.input.OrthogonalEdgeEditingContext#dragInitialized - */ - initializeDrag(context:yfiles.input.IInputModeContext):void; - /** - * Callback that can be used by - * {@link yfiles.input.IDragHandler}s and the like to determines whether the given edge is orthogonally edited edge in the - * specified input mode context. - *

- * This implementation will always yield false if it is {@link yfiles.input.OrthogonalEdgeEditingContext#enabled disabled}. Otherwise {@link yfiles.input.OrthogonalEdgeEditingContext#getOrthogonalEdgeHelper} - * will be used to delegate the query to {@link yfiles.input.IOrthogonalEdgeHelper#shouldEditOrthogonally}. - *

- * @param context The input mode context which is editing the edge. - * @param edge The edge that will be edited. - * @returns true if this edge should be orthogonally edited for the specified input mode context; false otherwise. - * @see yfiles.input.OrthogonalEdgeEditingContext#enabled - * @see yfiles.input.IOrthogonalEdgeHelper#shouldEditOrthogonally - */ - isOrthogonallyEditedEdge(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):boolean; - /** - * Locks the movement of the ports of the edges so that {@link yfiles.input.OrthogonalEdgeEditingContext#shouldMoveEndImplicitly} - * will yield false for the provided edge during the current edit. - *

- * This state will be reset after the current edit. - *

- * @param edge The edge to lock the ports of. - * @see yfiles.input.OrthogonalEdgeEditingContext#lockedPortEdges - */ - lockPortMovement(edge:yfiles.graph.IEdge):void; - /** - * Raises the {@link yfiles.input.OrthogonalEdgeEditingContext#addCleanedUpListener CleanedUp} - * event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onCleanedUp(evt:yfiles.input.InputModeEventArgs):void; - /** - * Raises the {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializedListener Initialized} - * event. - * @param evt The {@link } instance containing the event data. - * @see yfiles.input.OrthogonalEdgeEditingContext#addInitializedListener - * @see yfiles.input.OrthogonalEdgeEditingContext#dragInitialized - * @protected - */ - onInitialized(evt:yfiles.input.InputModeEventArgs):void; - /** - * Raises the {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializingListener Initializing} - * event. - * @param evt The {@link } instance containing the event data. - * @see yfiles.input.OrthogonalEdgeEditingContext#addInitializingListener - * @see yfiles.input.OrthogonalEdgeEditingContext#initializeDrag - * @protected - */ - onInitializing(evt:yfiles.input.InputModeEventArgs):void; - /** - * Called during {@link yfiles.input.OrthogonalEdgeEditingContext#dragInitialized} to prepare the edge paths for orthogonal - * editing. - * @param graph The graph that contains the edges to be edited. - * @see yfiles.input.OrthogonalEdgeEditingContext#prepareOrthogonalEdge - * @protected - */ - prepareEdgePaths(graph:yfiles.graph.IGraph):void; - /** - * Helper method that inspects and prepares an orthogonal edge for the upcoming edit process. - *

- * This method inspects an edge and possibly inserts new bends into an edge to assure that during editing the orthogonality - * won't be lost. - *

- * @param graph The graph to use for modifying the bends. - * @param edge The edge to inspect. - * @param orientations The orientations of the segments - the array is of length (edge.Bends.Count + 1). - * @param infos The {@link } instances for the source end, the bends, and the target end. This array contains {@link } - * instances representing either edge ends or ports at the first and last position and {@link }s or null - * entries for the bends. The length thus is (edge.Bends.Count + 2) and null entries indicate that there is no information - * about the movement (in case the bend will only be moved implicitly later, if at all). - * @protected - */ - prepareOrthogonalEdge(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,orientations:yfiles.collections.IListEnumerable,infos:yfiles.collections.IListEnumerable):void; - /** - * Can be used by subclasses during {@link yfiles.input.OrthogonalEdgeEditingContext#prepareOrthogonalEdge} to register added bends - * that can later be {@link yfiles.input.OrthogonalEdgeEditingContext#removeAddedBends removed} in case the operation is canceled. - *

- * This method will only record the addition of bends if this instance is {@link yfiles.input.OrthogonalEdgeEditingContext#isInitialized initialized} or {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializingListener still initializing}. - *

- * @param bend The bend that has been added to guarantee orthogonality. - * @protected - */ - registerAddedBend(bend:yfiles.graph.IBend):void; - /** - * Removes previously {@link yfiles.input.OrthogonalEdgeEditingContext#registerAddedBend registered} added bends. - * @param graph The graph to use for removing the bends. - * @param addedBends The added bends. - * @see yfiles.input.OrthogonalEdgeEditingContext#addedBends - * @see yfiles.input.OrthogonalEdgeEditingContext#registerAddedBend - * @protected - */ - removeAddedBends(graph:yfiles.graph.IGraph,addedBends:yfiles.collections.IEnumerable):void; - /** - * Callback that can be used by {@link yfiles.input.IDragHandler}s and the like to determines whether the specified end of the - * provided edge should be moved implicitly. - *

- * If an item is next to the end of an edge and the last segment should be kept orthogonal, this may only be possible if - * the end of the edge is moved, too. This can be achieved by moving the edge to another {@link yfiles.graph.IPort}, or by moving - * the port instance itself. This depends on the implementation of the {@link yfiles.input.IEdgePortHandleProvider} for the given - * edge. This implementation will delegate to the {@link yfiles.input.IOrthogonalEdgeHelper#shouldMoveEndImplicitly} method of the - * {@link yfiles.input.IOrthogonalEdgeHelper} instance returned by {@link yfiles.input.OrthogonalEdgeEditingContext#getOrthogonalEdgeHelper} - * unless the side of the edge is connected to an {@link yfiles.graph.IPortOwner} instance that is marked as {@link yfiles.input.OrthogonalEdgeEditingContext#addTransformedPortOwner transformed} during the - * edit. - *

- * @param edge The edge for which it should be determined whether the edge end can be moved. - * @param sourceSide if set to true the source side of the end is queried, else the target side. - * @returns true if the specified side of the edge can be moved; false otherwise, in which case the segment should be split to - * maintain orthogonality. - * @see yfiles.input.OrthogonalEdgeEditingContext#getOrthogonalEdgeHelper - * @see yfiles.input.IOrthogonalEdgeHelper#shouldMoveEndImplicitly - * @see yfiles.input.OrthogonalEdgeEditingContext#movePorts - */ - shouldMoveEndImplicitly(edge:yfiles.graph.IEdge,sourceSide:boolean):boolean; - /** - * Adds the given listener for the CleanedUp event that occurs when the recent edit operation has been cleaned up. - * @param listener The listener to add. - * @see yfiles.input.OrthogonalEdgeEditingContext#cleanUp - * @see yfiles.input.OrthogonalEdgeEditingContext#onCleanedUp - * @see yfiles.input.OrthogonalEdgeEditingContext#removeCleanedUpListener - */ - addCleanedUpListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the CleanedUp event that occurs when the recent edit operation has been cleaned up. - * @param listener The listener to remove. - * @see yfiles.input.OrthogonalEdgeEditingContext#cleanUp - * @see yfiles.input.OrthogonalEdgeEditingContext#onCleanedUp - * @see yfiles.input.OrthogonalEdgeEditingContext#addCleanedUpListener - */ - removeCleanedUpListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the Initializing event that occurs when the edit is about to be initialized. - * @param listener The listener to add. - * @see yfiles.input.OrthogonalEdgeEditingContext#initializeDrag - * @see yfiles.input.OrthogonalEdgeEditingContext#onInitializing - * @see yfiles.input.OrthogonalEdgeEditingContext#removeInitializingListener - */ - addInitializingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the Initializing event that occurs when the edit is about to be initialized. - * @param listener The listener to remove. - * @see yfiles.input.OrthogonalEdgeEditingContext#initializeDrag - * @see yfiles.input.OrthogonalEdgeEditingContext#onInitializing - * @see yfiles.input.OrthogonalEdgeEditingContext#addInitializingListener - */ - removeInitializingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the Initialized event that occurs when the edit has been initialized. - * @param listener The listener to add. - * @see yfiles.input.OrthogonalEdgeEditingContext#dragInitialized - * @see yfiles.input.OrthogonalEdgeEditingContext#onInitialized - * @see yfiles.input.OrthogonalEdgeEditingContext#removeInitializedListener - */ - addInitializedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the Initialized event that occurs when the edit has been initialized. - * @param listener The listener to remove. - * @see yfiles.input.OrthogonalEdgeEditingContext#dragInitialized - * @see yfiles.input.OrthogonalEdgeEditingContext#onInitialized - * @see yfiles.input.OrthogonalEdgeEditingContext#addInitializedListener - */ - removeInitializedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Gets or sets a value indicating whether this instance is currently initializing. - * @type {boolean} - */ - isInitializing:boolean; - /** - * Gets or sets a value indicating whether orthogonal edge editing is enabled at all. - *

- * The default value is true. - *

- * @see yfiles.input.OrthogonalEdgeEditingContext#isOrthogonallyEditedEdge - * @see yfiles.input.IOrthogonalEdgeHelper#shouldEditOrthogonally - * @default true - * @type {boolean} - */ - enabled:boolean; - /** - * Gets or sets a value indicating ports are allowed to be moved at all. - *

- * The default value is true. - *

- * @see yfiles.input.OrthogonalEdgeEditingContext#shouldMoveEndImplicitly - * @see yfiles.input.IOrthogonalEdgeHelper#shouldMoveEndImplicitly - * @default true - * @type {boolean} - */ - movePorts:boolean; - /** - * Gets the current input mode context that is in effect for the current edit. - * @protected - * @type {yfiles.input.IInputModeContext} - */ - currentInputModeContext:yfiles.input.IInputModeContext; - /** - * Gets or sets whether the context is initialized. - *

- * The context is initialized between the calls to {@link yfiles.input.OrthogonalEdgeEditingContext#initializeDrag} and {@link yfiles.input.OrthogonalEdgeEditingContext#dragFinished} - * or {@link yfiles.input.OrthogonalEdgeEditingContext#cancelDrag}. - *

- * @type {boolean} - */ - isInitialized:boolean; - /** - * Gets the previously {@link yfiles.input.OrthogonalEdgeEditingContext#registerAddedBend registered added} bends. - * @protected - * @type {yfiles.collections.IEnumerable.} - */ - addedBends:yfiles.collections.IEnumerable; - /** - * Gets the enumeration of {@link yfiles.graph.IPortOwner} instances that are being transformed during the edit. - *

- * For elements in the enumerable the attached {@link yfiles.graph.IPortOwner#ports} are considered to be moved in an irregular way during the edit. - *

- * @see yfiles.input.MoveTypes#ARBITRARY_MOVE - * @protected - * @type {yfiles.collections.IEnumerable.} - */ - transformedPortOwners:yfiles.collections.IEnumerable; - /** - * Gets the enumeration of {@link yfiles.graph.IEdge} instances whose ports have been locked at source and target end. - *

- * For elements in the enumerable the end points should not be moved and thus {@link yfiles.input.OrthogonalEdgeEditingContext#shouldMoveEndImplicitly} - * returns false for these edges. Note that this collection is reset for each edit. - *

- * @see yfiles.input.MoveTypes#ARBITRARY_MOVE - * @type {yfiles.collections.IEnumerable.} - */ - lockedPortEdges:yfiles.collections.IEnumerable; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.OrthogonalEdgeEditingContext; - } - /** - * Default implementation of the {@link yfiles.input.IOrthogonalEdgeHelper} - *

- * This class inspects the edges in question and infers the - * {@link yfiles.input.SegmentOrientation}s of the segments from the current geometry of the edge path. - *

- * @class - * @implements {yfiles.input.IOrthogonalEdgeHelper} - */ - export interface OrthogonalEdgeHelper extends yfiles.lang.Object,yfiles.input.IOrthogonalEdgeHelper{} - export class OrthogonalEdgeHelper { - /** - * Returns whether the given bend can be removed. - *

- * This implementation always returns true. - *

- * @param context The input mode context. - * @param bend The bend that is designated for removal. - * @returns - * @protected - */ - canRemoveBend(context:yfiles.input.IInputModeContext,bend:yfiles.graph.IBend):boolean; - /** - * Callback method that is invoked after the provided edge has been edited orthogonally. - *

- * The default implementation in this class removes duplicate and collinear bends, as well as segments of zero length. - *

- * @param context The input mode context which edited the edge. - * @param graph The graph to use for modifying the edge instance. - * @param edge The edge to clean up the path. - */ - cleanUpEdge(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge):void; - /** - * Gets the orientation of the given segment by looking at the geometry of the segment. - *

- * If the segment has a zero length, the adjacent segments will be inspected to infer the orientation such that the - * orientation toggles between {@link yfiles.input.SegmentOrientation#VERTICAL} and {@link yfiles.input.SegmentOrientation#HORIZONTAL}. - *

- * @param context The input mode context in which the orientation is needed. - * @param edge The edge to inspect. - * @param segmentIndex The index of the segment. - * @returns The declared orientation of the segment. - */ - getSegmentOrientation(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,segmentIndex:number):yfiles.input.SegmentOrientation; - /** - * Determines whether the provided edge should be edited orthogonally in the specified input mode context. - *

- * If this method returns false, the other methods will not be queried at all. - *

- *

- * The default implementation in this class always returns true. - *

- * @param context The input mode context in which the edge is about to be edited. - * @param edge The edge to inspect. - * @returns true if the edge should be orthogonally edited in the specified input mode context; false otherwise. - */ - shouldEditOrthogonally(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):boolean; - /** - * Determines whether this end of the provided edge can be moved in the input mode context. - *

- * This information is required to determine whether an edge's first or last segment needs to be split or the adjacent edge - * end can be moved along with the other end of the segment. - *

- *

- * The default implementation in this class always returns false. - *

- * @param context The input mode context in which the segment is edited. - * @param edge The edge to inspect. - * @param sourceEnd if set to true the source end of the edge is queried, otherwise the target end. - * @returns true if the end of the edge can be moved for the specified input mode context; false otherwise, in which case the - * corresponding segment needs to be split to keep the segment orientation orthogonal. - */ - shouldMoveEndImplicitly(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,sourceEnd:boolean):boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.OrthogonalEdgeHelper; - } - /** - * An implementation of the {@link yfiles.input.IHandle} that can be used to move an {@link yfiles.graph.IPort} interactively by assigning - * new {@link yfiles.graph.IPortLocationModelParameter}s to the {@link yfiles.graph.IPort#locationParameter} - *

- * This class also provides snapping facilities and can be used in conjunction with both - * {@link yfiles.input.OrthogonalEdgeEditingContext}, as well as {@link yfiles.input.GraphSnapContext}. - *

- * @class - * @implements {yfiles.input.IHandle} - */ - export interface PortLocationModelParameterHandle extends yfiles.lang.Object,yfiles.input.IHandle{} - export class PortLocationModelParameterHandle { - /** - * Initializes a new instance of the {@link yfiles.input.PortLocationModelParameterHandle} class to change the {@link yfiles.graph.IPortLocationModelParameter} - * of the given port - * @param port The port to adjust the location parameter of. - */ - constructor(port:yfiles.graph.IPort); - /** - * - * @param context - * @param originalLocation - */ - cancelDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; - /** - * Called during the drag to collect snap results. - *

- * This implementation will delegate to the {@link yfiles.input.IPortSnapResultProvider} that has been received from the port this - * instance is bound to. - *

- * @param source The source of the event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - collectSnapResults(source:any,evt:yfiles.input.CollectSnapResultsEventArgs):void; - /** - * - * @param context - * @param originalLocation - * @param newLocation - */ - dragFinished(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; - /** - * Gets the graph to use for {@link yfiles.graph.IGraph#setPortLocationParameter setting the parameter} from the context. - * @param context The input mode context to use. - * @returns The graph or null if the graph could not be obtained. - * @see yfiles.input.IInputModeContext#graph - * @protected - */ - getGraph(context:yfiles.input.IInputModeContext):yfiles.graph.IGraph; - /** - * Determines the type of the movement for the given port. - *

- * This is used for the {@link yfiles.input.MovementInfo} that is passed to the {@link yfiles.input.OrthogonalEdgeEditingContext#addMovedPort} - * method. - *

- * @param port The port to determine the move type for. - * @returns This implementation returns {@link #LINEAR_MOVE} for models of type {@link } - * and {@link #ARBITRARY_MOVE} for all others. - * @protected - */ - getMoveType(port:yfiles.graph.IPort):yfiles.input.MoveTypes; - /** - * Callback method that obtains the new parameter for the given location and port. - * @param port The port to obtain a parameter for. - * @param model The model to use. - * @param location The new location. - * @returns The new parameter to use. - * @protected - */ - getNewParameter(port:yfiles.graph.IPort,model:yfiles.graph.IPortLocationModel,location:yfiles.geometry.Point):yfiles.graph.IPortLocationModelParameter; - /** - * - * @param context - * @param originalLocation - * @param newLocation - */ - handleMove(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; - /** - * - * @param context - */ - initializeDrag(context:yfiles.input.IInputModeContext):void; - /** - * Callback method that applies the parameter. - * @param graph The graph to use for applying. - * @param port The port to apply the parameter to. - * @param locationParameter The new parameter to apply. - * @protected - */ - setParameter(graph:yfiles.graph.IGraph,port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):void; - /** - * - * @type {yfiles.geometry.IPoint} - */ - location:yfiles.geometry.IPoint; - /** - * Gets the port this instance acts on. - * @protected - * @type {yfiles.graph.IPort} - */ - port:yfiles.graph.IPort; - /** - * Gets or sets the type of the handle that can be used by the rendering engine to render types differently. - * @type {yfiles.input.HandleTypes} - */ - type:yfiles.input.HandleTypes; - /** - * Gets or sets the cursor to display when the mouse hovers over or drags this handle. - * @type {yfiles.view.Cursor} - */ - cursor:yfiles.view.Cursor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.PortLocationModelParameterHandle; - } - /** - * Simple default implementation of {@link yfiles.input.IReparentNodeHandler} that treats shift key presses as reparent gestures - * and allows for reparenting all nodes. - * @class - * @implements {yfiles.input.IReparentNodeHandler} - */ - export interface ReparentNodeHandler extends yfiles.lang.Object,yfiles.input.IReparentNodeHandler{} - export class ReparentNodeHandler { - constructor(); - /** - * - * @param context - * @param node - * @returns - */ - isReparentGesture(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode):boolean; - /** - * - * @param context - * @param node - * @param newParent - * @returns - */ - isValidParent(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode,newParent:yfiles.graph.INode):boolean; - /** - * - * @param context - * @param node - * @param newParent - */ - reparent(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode,newParent:yfiles.graph.INode):void; - /** - * - * @param context - * @param node - * @returns - */ - shouldReparent(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode):boolean; - /** - * Gets or sets the event recognizer that will be queried to determine whether the gesture is a reparent gesture. - *

- * The default is {@link yfiles.input.KeyEventRecognizers#SHIFT_PRESSED} - *

- * @see yfiles.input.ReparentNodeHandler#isReparentGesture - * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - reparentRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.ReparentNodeHandler; - } - /** - * An implementation of the {@link yfiles.input.ISnapLineProvider} interface that provides {@link yfiles.input.OrthogonalSnapLine}s for - * {@link yfiles.graph.INode}s. - *

- * This implementation uses the {@link yfiles.input.GraphSnapContext} to create snap lines around the geometric border of the - * node. - *

- * @class - * @implements {yfiles.input.ISnapLineProvider} - */ - export interface NodeSnapLineProvider extends yfiles.lang.Object,yfiles.input.ISnapLineProvider{} - export class NodeSnapLineProvider { - /** - * Callback method that is called by {@link yfiles.input.NodeSnapLineProvider#addSnapLines} the collect snap lines for the centers - * of the node. - *

- * This method is called by {@link yfiles.input.NodeSnapLineProvider#addSnapLines} and by default used the {@link yfiles.input.NodeSnapLineProvider#createCenterSnapLine} - * to add them to the {@link yfiles.input.CollectGraphSnapLinesEventArgs#addFixedNodeSnapLine fixed node} and {@link yfiles.input.CollectGraphSnapLinesEventArgs#addFixedSegmentSnapLine fixed segment} collections - *

- * @param context The context which holds the settings for the snap lines. Note that implementations should not change the state of the - * context explicitly. - * @param evt The argument to use for adding snap lines. - * @param node The node to add snap lines for. - * @param layout The layout of the node to use for adding the snap lines. - * @protected - */ - addCenterSnapLines(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectGraphSnapLinesEventArgs,node:yfiles.graph.INode,layout:yfiles.geometry.Rect):void; - /** - * Callback method that adds the fixed snap lines around the border of the nodes' layout. - *

- * This method is called by {@link yfiles.input.NodeSnapLineProvider#addSnapLines} - *

- * @param context The context which holds the settings for the snap lines. Note that implementations should not change the state of the - * context explicitly. - * @param evt The argument to use for adding snap lines. - * @param node The node to add snap lines for. - * @param layout The layout of the node to use for adding the snap lines. - * @protected - */ - addFixedNodeBorderSnapLines(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectGraphSnapLinesEventArgs,node:yfiles.graph.INode,layout:yfiles.geometry.Rect):void; - /** - * Callback method that adds the fixed snap lines around the node for other nodes to snap to using the {@link yfiles.input.GraphSnapContext#nodeToNodeDistance}. - *

- * This method is called by {@link yfiles.input.NodeSnapLineProvider#addSnapLines} and uses the {@link yfiles.input.GraphSnapContext#nodeToNodeDistance} to determine the location of the - * segments to add around the layout. - *

- * @param context The context which holds the settings for the snap lines. Note that implementations should not change the state of the - * context explicitly. - * @param evt The argument to use for adding snap lines. - * @param node The node to add snap lines for. - * @param layout The layout of the node to use for adding the snap lines. - * @protected - */ - addNodeToNodeSnapLines(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectGraphSnapLinesEventArgs,node:yfiles.graph.INode,layout:yfiles.geometry.Rect):void; - /** - * Callback method that adds the fixed snap lines around the node for edge segments to snap to. - *

- * This method is called by {@link yfiles.input.NodeSnapLineProvider#addSnapLines} and uses the {@link yfiles.input.GraphSnapContext#nodeToEdgeDistance} to determine the location of the - * segments to add around the layout. - *

- * @param context The context which holds the settings for the snap lines. Note that implementations should not change the state of the - * context explicitly. - * @param evt The argument to use for adding snap lines. - * @param node The node to add snap lines for. - * @param layout The layout of the node to use for adding the snap lines. - * @protected - */ - addNodeToSegmentSnapLines(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectGraphSnapLinesEventArgs,node:yfiles.graph.INode,layout:yfiles.geometry.Rect):void; - /** - * Callback method that is called by {@link yfiles.input.NodeSnapLineProvider#addSnapLines} the collect snap lines to snap ports to - * at the provided node. - *

- * This method is called by {@link yfiles.input.NodeSnapLineProvider#addSnapLines} - *

- * @param context The context which holds the settings for the snap lines. Note that implementations should not change the state of the - * context explicitly. - * @param evt The argument to use for adding snap lines. - * @param node The node to add snap lines for. - * @param layout The layout of the node to use for adding the snap lines. - * @protected - */ - addPortSnapLines(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectGraphSnapLinesEventArgs,node:yfiles.graph.INode,layout:yfiles.geometry.Rect):void; - /** - * Called by the {@link yfiles.input.GraphSnapContext} when a {@link yfiles.input.GraphSnapContext#initializeDrag drag} is about to start. - *

- * This means that the provided item, which can be cast to {@link yfiles.graph.INode} will not be moved during the edit and thus - * can contribute to the set of fixed snap lines. This implementation delegates to - * {@link yfiles.input.NodeSnapLineProvider#addFixedNodeBorderSnapLines}, {@link yfiles.input.NodeSnapLineProvider#addPortSnapLines}, - * {@link yfiles.input.NodeSnapLineProvider#addNodeToNodeSnapLines}, and {@link yfiles.input.NodeSnapLineProvider#addCenterSnapLines}. - *

- * @param context The context which holds the settings for the snap lines. Note that implementations should not change the state of the - * context explicitly. - * @param evt The argument to use for adding snap lines. - * @param item The item to add snap lines for. - */ - addSnapLines(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectGraphSnapLinesEventArgs,item:yfiles.graph.IModelItem):void; - /** - * Convenience method that creates a snap line for the center of nodes. - * @param context The context which holds the settings for the snap lines. Note that implementations should not change the state of the - * context explicitly. - * @param node The node to add snap lines for. - * @param orientation The snap line orientation. - * @param location The location of the snap line. - * @returns A snap line that other centers can snap to. - * @protected - */ - createCenterSnapLine(context:yfiles.input.GraphSnapContext,node:yfiles.graph.INode,orientation:yfiles.input.SnapLineOrientation,location:yfiles.geometry.Point):yfiles.input.OrthogonalSnapLine; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.NodeSnapLineProvider; - } - /** - * Simple implementation of the {@link yfiles.input.ISnapLineProvider} interface that can be used to add snap lines for - * orthogonally routed {@link yfiles.graph.IEdge}s. - *

- * This implementation can be put into the {@link yfiles.graph.ILookup#lookup} of an {@link yfiles.graph.IEdge}. - *

- * @see yfiles.graph.EdgeDecorator#snapLineProviderDecorator - * @class - * @implements {yfiles.input.ISnapLineProvider} - */ - export interface EdgeSnapLineProvider extends yfiles.lang.Object,yfiles.input.ISnapLineProvider{} - export class EdgeSnapLineProvider { - /** - * Adds horizontal snap lines for a horizontally oriented fixed segment snap lines. - * @param context The context which holds the settings for the snap lines. Note that implementations should not change the state of the - * context explicitly. - * @param edge The edge to add snap lines for. - * @param segmentStart The start of the segment. - * @param evt The argument to use for adding snap lines. - * @param segmentEnd The end of the segment. - * @see yfiles.input.EdgeSnapLineProvider#addVerticalSegmentSnapLines - * @protected - */ - addHorizontalSegmentSnapLines(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectGraphSnapLinesEventArgs,edge:yfiles.graph.IEdge,segmentStart:yfiles.geometry.Point,segmentEnd:yfiles.geometry.Point):void; - /** - * Adds the snap lines for the given model item to the evt. - *

- * This implementation queries the {@link yfiles.input.GraphSnapContext#getMovementInfos movement information} for the provided edge to determine which edge segments stay fixed. - * For each fixed segment, it will call {@link yfiles.input.EdgeSnapLineProvider#addVerticalSegmentSnapLines} or {@link yfiles.input.EdgeSnapLineProvider#addHorizontalSegmentSnapLines} - * respectively. - *

- * @param context The context which holds the settings for the snap lines. Note that implementations should not change the state of the - * context explicitly. - * @param item The item to add snap lines for. - * @param evt The argument to use for adding snap lines. - */ - addSnapLines(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectGraphSnapLinesEventArgs,item:yfiles.graph.IModelItem):void; - /** - * Adds vertical snap lines for a vertically oriented fixed segment snap lines. - * @param context The context which holds the settings for the snap lines. Note that implementations should not change the state of the - * context explicitly. - * @param edge The edge to add snap lines for. - * @param segmentStart The start of the segment. - * @param segmentEnd The end of the segment. - * @param evt The argument to use for adding snap lines. - * @see yfiles.input.EdgeSnapLineProvider#addHorizontalSegmentSnapLines - * @protected - */ - addVerticalSegmentSnapLines(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectGraphSnapLinesEventArgs,edge:yfiles.graph.IEdge,segmentStart:yfiles.geometry.Point,segmentEnd:yfiles.geometry.Point):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.EdgeSnapLineProvider; - } - /** - * The default implementation of the {@link yfiles.input.INodeSnapResultProvider} interface. - * @class - * @implements {yfiles.input.INodeSnapResultProvider} - */ - export interface NodeSnapResultProvider extends yfiles.lang.Object,yfiles.input.INodeSnapResultProvider{} - export class NodeSnapResultProvider { - /** - * Calculates a {@link yfiles.input.SnapResult} and {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult adds it} to the argument. - *

- * This method delegates to {@link yfiles.input.NodeSnapResultProvider#addGridSnapResultCore} using {@link yfiles.input.GraphSnapContext#gridSnapType} and {@link yfiles.input.SnapPolicy#TO_NEAREST} - * as the additional arguments. This method snaps the location to the next grid point or grid lines that are determined by - * {@link yfiles.input.GraphSnapContext#nodeGridConstraintProvider} or obtained from the {@link yfiles.input.InputModeEventArgs#context}. - *

- * @param context The context in which the snapping is performed. - * @param evt The arguments to add the results to. - * @param location A location in the layout of the suggested layout of the node that will be snapped to a grid point location. - * @param node The node that is currently being processed. - * @protected - */ - addGridSnapResult(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,location:yfiles.geometry.Point,node:yfiles.graph.INode):void; - /** - * Calculates a {@link yfiles.input.SnapResult} and {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult adds it} to the argument. - *

- * This method snaps the location to the next grid point or grid lines that are determined by {@link yfiles.input.GraphSnapContext#nodeGridConstraintProvider} or obtained from the {@link yfiles.input.InputModeEventArgs#context}. - *

- * @param context The context in which the snapping is performed. - * @param evt The arguments to add the results to. - * @param location A location in the layout of the suggested layout of the node that will be snapped to a grid point location. - * @param node The node that is currently being processed. - * @param gridSnapType The type of snapping that should be performed. - * @param xSnapPolicy How to snap the x coordinate. - * @param ySnapPolicy How to snap the y coordinate. - * @protected - */ - addGridSnapResultCore(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,location:yfiles.geometry.Point,node:yfiles.graph.INode,gridSnapType:yfiles.input.GridSnapTypes,xSnapPolicy:yfiles.input.SnapPolicy,ySnapPolicy:yfiles.input.SnapPolicy):void; - /** - * Collects snap results that snap the node to a grid and {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult adds them} to the argument. - *

- * This implementation simply delegates to {@link yfiles.input.NodeSnapResultProvider#addGridSnapResult} using the center of the - * suggestedLayout. - *

- * @param context The context in which the snapping is performed. - * @param evt The arguments to add the results to. - * @param suggestedLayout The layout of the node if it would move without snapping. - * @param node The node that is currently being processed. - * @protected - */ - collectGridSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,suggestedLayout:yfiles.geometry.Rect,node:yfiles.graph.INode):void; - /** - * Collects the results for the given layout for all snap lines in question. - *

- * For each snap line that could be snapped to, this method calls - * {@link yfiles.input.NodeSnapResultProvider#collectSnapResultsForSnapLine}. - *

- * @param context The context for which the results are being queried. - * @param evt The {@link } instance to which the results should be {@link #addSnapResult added}. - * @param suggestedLayout The suggested layout of the node. - * @param node The node that is being dragged. - * @protected - */ - collectSnapLineSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,suggestedLayout:yfiles.geometry.Rect,node:yfiles.graph.INode):void; - /** - * - * @param context - * @param evt - * @param suggestedLayout - * @param node - */ - collectSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,suggestedLayout:yfiles.geometry.Rect,node:yfiles.graph.INode):void; - /** - * Verifies whether the node will snap to the given snap line. - *

- * If the node will snap, a {@link yfiles.input.SnapResult} for a {@link yfiles.input.SnapLine} will be created and added to the event - * argument. - *

- * @param evt The arguments to add the results to. - * @param snapLine The snap line to test snapping for. - * @param suggestedLayout The layout of the node if it would move without snapping. - * @param node The node that is currently being processed. - * @protected - */ - collectSnapResultsForSnapLine(evt:yfiles.input.CollectSnapResultsEventArgs,snapLine:yfiles.input.OrthogonalSnapLine,suggestedLayout:yfiles.geometry.Rect,node:yfiles.graph.INode):void; - /** - * Yields the static shared instance of this class. - * @const - * @static - * @type {yfiles.input.INodeSnapResultProvider} - */ - static INSTANCE:yfiles.input.INodeSnapResultProvider; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.NodeSnapResultProvider; - } - /** - * The default implementation of the {@link yfiles.input.INodeReshapeSnapResultProvider} interface. - * @class - * @implements {yfiles.input.INodeReshapeSnapResultProvider} - */ - export interface NodeReshapeSnapResultProvider extends yfiles.lang.Object,yfiles.input.INodeReshapeSnapResultProvider{} - export class NodeReshapeSnapResultProvider { - /** - * Adds a snap result for a location that snaps to a grid line. - *

- * This method is called by {@link yfiles.input.NodeReshapeSnapResultProvider#collectGridSnapResults} for each grid line snap. - *

- * @param context The context in which the snapping is performed. - * @param evt The {@link } instance containing the event data. - * @param node The node that is being reshaped. - * @param delta The amount the mouse needs to be moved in order to get to the snapping location. - * @param snappedLocation The location of the mouse that is associated with the grid point. - * @param snapLineType The type of snap line. - * @param snapLineLocation The point at which the snap line is anchored. - * @param from Where the snap line starts. - * @param to Where the snap line ends. - * @param snapLinePoint A point of interest on the snap line that can be highlighted. - * @protected - */ - addGridLineSnapResult(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,snapLineType:yfiles.input.SnapLineSnapTypes,snapLineLocation:yfiles.geometry.IPoint,delta:number,snappedLocation:yfiles.geometry.Point,from:number,to:number,snapLinePoint:yfiles.geometry.Point):void; - /** - * Adds a snap result for a location that snaps to the grid. - *

- * This method is called by {@link yfiles.input.NodeReshapeSnapResultProvider#collectGridSnapResults} for each grid snap. - *

- * @param context The context in which the snapping is performed. - * @param evt The {@link } instance containing the event data. - * @param node The node that is being reshaped. - * @param provider The provider that is associated with the grid snapping. - * @param gridSnappedPoint The point on the grid that should be highlighted. - * @param snappedLocation The location of the mouse that is associated with the grid point. - * @protected - */ - addGridSnapResult(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,provider:yfiles.input.IGridConstraintProvider,gridSnappedPoint:yfiles.geometry.Point,snappedLocation:yfiles.geometry.Point):void; - /** - * Adds a snap result for "same size" to the collect event argument. - *

- * This method is called by {@link yfiles.input.NodeReshapeSnapResultProvider#collectSameSizeSnapResults} for each result found. - *

- * @param context The context in which the snapping is performed. - * @param evt The {@link } instance containing the event data. This will be used to {@link #addSnapResult add} the result - * to. - * @param node The node that is being reshaped. - * @param orientation The orientation of the result - indicates whether width or height have been snapped. - * @param rectangles The rectangles that have the same width or height as the node will - this does not yet includes the rectangle of the - * node being reshaped. - * @param finalSize The target size to which the node will snap. - * @param snapDelta The snap delta that the mouse needs to be moved in order to snap. - * @protected - */ - addSameSizeSnapResult(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,orientation:yfiles.input.SnapLineOrientation,rectangles:yfiles.collections.IEnumerable,finalSize:number,snapDelta:number):void; - /** - * Adds a snap result for a location that snaps the node's bounds to a snap line. - *

- * This method is called by {@link yfiles.input.NodeReshapeSnapResultProvider#collectSnapLineResults} for each snap line snap. - *

- * @param context The context in which the snapping is performed. - * @param evt The {@link } instance containing the event data. - * @param node The node that is being reshaped. - * @param snapLine The snap line to which the node can be snapped - * @param delta The amount the mouse needs to be moved in order to get to the snapping location. - * @param snapPoint The point of interest that can be highlighted on the snap line. - * @protected - */ - addSnaplineSnapResult(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,snapLine:yfiles.input.OrthogonalSnapLine,delta:number,snapPoint:yfiles.geometry.Point):void; - /** - * Collects the snap results for the grid. - * @param context The context in which the snapping is performed. - * @param evt The {@link } instance containing the event data. - * @param node The node that is being reshaped. - * @param reshapeContext The reshape context that describes how the node's layout is reshaped. - * @param suggestedLayout The suggested layout of the node. - * @protected - */ - collectGridSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,reshapeContext:yfiles.input.ReshapeRectangleContext,suggestedLayout:yfiles.geometry.Rect):void; - /** - * Collects the snap results that make the node the same size as other elements. - *

- * This method ultimately delegates to {@link yfiles.input.NodeReshapeSnapResultProvider#addSameSizeSnapResult} to add the results - * to the event argument. - *

- * @param context The context in which the snapping is performed. - * @param evt The {@link } instance containing the event data. - * @param node The node that is being reshaped. - * @param reshapeContext The reshape context that contains information about the nature of the resize. - * @param suggestedLayout The layout of the node as it would be if the mouse location would not be snapped. - * @protected - */ - collectSameSizeSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,reshapeContext:yfiles.input.ReshapeRectangleContext,suggestedLayout:yfiles.geometry.Rect):void; - /** - * Collects the snap results that makes the node's bounds snap to the {@link yfiles.input.GraphSnapContext#getFixedNodeSnapLines fixed node snap lines}. - *

- * This method ultimately delegates to {@link yfiles.input.NodeReshapeSnapResultProvider#addSnaplineSnapResult} to add the results - * to the event argument. Method {@link yfiles.input.NodeReshapeSnapResultProvider#getSnapLines} is used to query the snap lines - * that will be checked by this method. - *

- * @param context The context in which the snapping is performed. - * @param evt The {@link } instance containing the event data. - * @param node The node that is being reshaped. - * @param reshapeContext The reshape context that contains information about the nature of the resize. - * @param suggestedLayout The layout of the node as it would be if the mouse location would not be snapped. - * @protected - */ - collectSnapLineResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,reshapeContext:yfiles.input.ReshapeRectangleContext,suggestedLayout:yfiles.geometry.Rect):void; - /** - * Called when a node is {@link yfiles.input.IDragHandler#handleMove dragged} to add {@link yfiles.input.SnapResult}s for - * {@link yfiles.input.OrthogonalSnapLine}s or sizes to which this node can potentially snap during resizing. - *

- * This implementation delegates to the following methods in order: - *

- *
    - *
  • {@link yfiles.input.NodeReshapeSnapResultProvider#collectGridSnapResults}
  • - *
  • {@link yfiles.input.NodeReshapeSnapResultProvider#collectSameSizeSnapResults}
  • - *
  • {@link yfiles.input.NodeReshapeSnapResultProvider#collectSnapLineResults}
  • - *
- * @param context The snap context which manages the snap lines and the settings. - * @param evt The event argument to obtain the context from and add the results to. - * @param node The node that is being reshaped. - * @param reshapeContext Carries information about the reshape process. - */ - collectSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,reshapeContext:yfiles.input.ReshapeRectangleContext):void; - /** - * Helper method for method {@link yfiles.input.NodeReshapeSnapResultProvider#collectSnapLineResults} that gets all the {@link yfiles.input.SnapLine} - * that should be checked for the currently moved node. - *

- * This method aggregates the {@link yfiles.input.GraphSnapContext#getFixedNodeSnapLines fixed nodes' snaplines} and the {@link yfiles.input.GraphSnapContext#getAdditionalSnapLines additional snap lines} that are relevant to the node. - *

- * @param context The context in which the snapping is performed. - * @param node The node that is being reshaped. - * @param reshapeContext The reshape context that contains information about the nature of the resize. - * @param suggestedLayout The layout of the node as it would be if the mouse location would not be snapped. - * @returns - * @protected - */ - getSnapLines(context:yfiles.input.GraphSnapContext,node:yfiles.graph.INode,reshapeContext:yfiles.input.ReshapeRectangleContext,suggestedLayout:yfiles.geometry.Rect):yfiles.collections.IEnumerable; - /** - * A shared singleton instance of this type. - * @const - * @static - * @type {yfiles.input.INodeReshapeSnapResultProvider} - */ - static INSTANCE:yfiles.input.INodeReshapeSnapResultProvider; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.NodeReshapeSnapResultProvider; - } - /** - * Simple default implementations of the {@link yfiles.input.IBendCreator} interface used during the creation of bends in the UI. - *

- * An instance of this class can be found in the {@link yfiles.graph.ILookup#lookup} of an edge, e.g. - *

- * @class - * @implements {yfiles.input.IBendCreator} - */ - export interface DefaultBendCreator extends yfiles.lang.Object,yfiles.input.IBendCreator{} - export class DefaultBendCreator { - /** - * - * @param context - * @param graph - * @param edge - * @param location - * @returns - */ - createBend(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,location:yfiles.geometry.Point):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.DefaultBendCreator; - } - /** - * An abstract convenience implementation of the {@link yfiles.input.IPortCandidateProvider} interface. - * @class - * @implements {yfiles.input.IPortCandidateProvider} - */ - export interface PortCandidateProviderBase extends yfiles.lang.Object,yfiles.input.IPortCandidateProvider{} - export class PortCandidateProviderBase { - /** - * Convenience method for subclasses that adds all existing {@link yfiles.graph.IPortOwner#ports} of the owner to the provided list. - * @param owner The port owner whose ports should be added. - * @param list The list to add candidates for existing ports to. - * @protected - */ - addExistingPorts(owner:yfiles.graph.IPortOwner,list:yfiles.collections.IList):void; - /** - * Factory method that creates a simple candidate that will use the {@link yfiles.input.PortCandidateProviderBase#createInstance} - * method of this instance to delegate {@link yfiles.input.IPortCandidate#createPort} queries to. - * @param locationParameter The location of the candidate. This instance is assigned by reference to the candidate. - * @param owner The owner to use for the candidate. - * @param [valid=true] Whether the port should be {@link #VALID}. - * @returns A candidate whose {@link #createPort} method delegates to this instance's - * {@link #createInstance}. - * @protected - */ - createCandidate(owner:yfiles.graph.IPortOwner,locationParameter:yfiles.graph.IPortLocationModelParameter,valid?:boolean):yfiles.input.DefaultPortCandidate; - /** - * Callback method used by the ports created using the factory methods - * {@link yfiles.input.PortCandidateProviderBase#createCandidate}. - *

- * This method can be overridden by subclasses to perform more sophisticated port creation logic. - *

- * @param context The context in which the instance is created. - * @param candidate The candidate to create a port for. - * @returns The new port. - * @protected - */ - createInstance(context:yfiles.input.IInputModeContext,candidate:yfiles.input.DefaultPortCandidate):yfiles.graph.IPort; - /** - * Callback method used by the ports created using the factory methods - * {@link yfiles.input.PortCandidateProviderBase#createCandidate}. - *

- * This method can be overridden by subclasses to perform more sophisticated candidate creation logic. - *

- * @param context The context in which the instance is created. - * @param candidate The candidate to create a port for. - * @param suggestedLocation The location to get a candidate for. - * @returns The new candidate whose {@link #validity} may not be {@link #DYNAMIC}. - * @protected - */ - getPortCandidateAt(context:yfiles.input.IInputModeContext,candidate:yfiles.input.DefaultPortCandidate,suggestedLocation:yfiles.geometry.Point):yfiles.input.IPortCandidate; - /** - * Creates an enumeration of possibly port candidates. - *

- * This method is used as a callback by most of the getter methods in this class. Subclasses should override this method to - * provide the same candidates for all use-cases. - *

- * @param context The context for which the candidates should be provided. - * @returns An enumerable collection of port candidates. - * @protected - * @abstract - */ - getPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; - /** - * Convenience implementation that simply delegates to {@link yfiles.input.PortCandidateProviderBase#getPortCandidates}. - * @param context - * @param target - * @returns - */ - getSourcePortCandidates(context:yfiles.input.IInputModeContext,target:yfiles.input.IPortCandidate):yfiles.collections.IEnumerable; - /** - * Convenience implementation that simply delegates to {@link yfiles.input.PortCandidateProviderBase#getPortCandidates}. - * @param context - * @returns - */ - getSourcePortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; - /** - * Convenience implementation that simply delegates to {@link yfiles.input.PortCandidateProviderBase#getPortCandidates}. - * @param context - * @param source - * @returns - */ - getTargetPortCandidates(context:yfiles.input.IInputModeContext,source:yfiles.input.IPortCandidate):yfiles.collections.IEnumerable; - /** - * Convenience implementation that simply delegates to {@link yfiles.input.PortCandidateProviderBase#getPortCandidates}. - * @param context - * @returns - */ - getTargetPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; - /** - * Gets or sets the style to use for the creation of the port in {@link yfiles.input.PortCandidateProviderBase#createInstance}. - *

- * A value of null will make the implementation use the corresponding current default port style. - *

- * @type {yfiles.styles.IPortStyle} - */ - style:yfiles.styles.IPortStyle; - /** - * Gets or sets the tag to assign to the port in {@link yfiles.input.PortCandidateProviderBase#createInstance} - * @type {any} - */ - tag:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.PortCandidateProviderBase; - } - /** - * A sophisticated implementation of the {@link yfiles.input.IHandle} interface that lets the user change an edge's {@link yfiles.graph.IEdge#sourcePort source} and - * {@link yfiles.graph.IEdge#targetPort target port}. - *

- * This handle will move one of the edge's end points visually to another {@link yfiles.graph.IPort} or {@link yfiles.input.IPortCandidate} - * and upon finalization of the gesture will {@link yfiles.input.PortRelocationHandle#setPorts set the new ports} for the edge. This class heavily relies on the - * implementation of the {@link yfiles.input.IEdgeReconnectionPortCandidateProvider} that is queried from the {@link yfiles.graph.IEdge} - * this handle is acting on. - *

- * @see yfiles.input.PortRelocationHandle#getPortCandidates - * @see yfiles.graph.EdgeDecorator#edgeReconnectionPortCandidateProviderDecorator - * @class - * @implements {yfiles.input.IHandle} - */ - export interface PortRelocationHandle extends yfiles.lang.Object,yfiles.input.IHandle{} - export class PortRelocationHandle { - /** - * Creates a new instance of the {@link yfiles.input.PortRelocationHandle} class. - * @param graph The graph or null. If the graph instance is not specified, the handle will try to receive the graph from the {@link } - * it is passed in during {@link #initializeDrag}. - * @param edge The edge. - * @param sourceEnd if set to true the source end will be subject to relocation, otherwise it will be the target port. - */ - constructor(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,sourceEnd:boolean); - /** - * - * @param context - * @param originalLocation - */ - cancelDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; - /** - * Factory method that creates the {@link yfiles.view.ICanvasObjectDescriptor} that will be used to paint the "current" - * {@link yfiles.input.IPortCandidate}. - * @returns The descriptor to use for the rendering in the {@link }. - * @protected - */ - createCurrentPortCandidateDescriptor():yfiles.view.ICanvasObjectDescriptor; - /** - * Factory method that creates the dummy edge that will be shown during the drag operation. - * @param edge The edge to be represented by the dummy edge. - * @returns The dummy edge instance to use. - * @see yfiles.input.PortRelocationHandle#showDummyEdge - * @protected - */ - createDummyEdge(edge:yfiles.graph.IEdge):yfiles.graph.SimpleEdge; - /** - * Factory method that creates a dummy paintable for the dummy edge during the drag operation. - * @param dummy The dummy to create a paintable for. - * @returns A paintable that shows the dummy. - * @see yfiles.input.PortRelocationHandle#showDummyEdge - * @protected - */ - createDummyEdgeVisualCreator(dummy:yfiles.graph.SimpleEdge):yfiles.view.IVisualCreator; - /** - * Factory method that creates the candidate for the existing port. - * @param port The port to create a candidate for. - * @returns The candidate or null. - * @see yfiles.input.PortRelocationHandle#getPortCandidates - * @see yfiles.input.PortRelocationHandle#addExistingPort - * @protected - */ - createExistingPortCandidate(port:yfiles.graph.IPort):yfiles.input.IPortCandidate; - /** - * Factory method that creates the {@link yfiles.view.ICanvasObjectDescriptor} that will be used to paint the - * {@link yfiles.input.IPortCandidate}s. - * @returns The descriptor to use for the rendering in the {@link }. - * @protected - */ - createPortCandidateDescriptor():yfiles.view.ICanvasObjectDescriptor; - /** - * - * @param context - * @param originalLocation - * @param newLocation - */ - dragFinished(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; - /** - * Finds the closest candidate from the given set of candidates. - * @param context The context in for which the closest handle candidate is sought. - * @param location The location for which to find a candidate. - * @param candidates The list of possible candidates. - * @returns The closes candidate or null. - * @protected - */ - getClosestCandidate(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,candidates:yfiles.collections.IEnumerable):yfiles.input.IPortCandidate; - /** - * Gets the graph to use from the context. - * @param context The input mode context. - * @returns A graph instance or null. - * @protected - */ - getGraph(context:yfiles.input.IInputModeContext):yfiles.graph.IGraph; - /** - * Callback used during {@link yfiles.input.PortRelocationHandle#dragFinished} to actually get the new port from the chosen - * candidate. - *

- * This implementation returns the result of {@link yfiles.input.IPortCandidate#createPort} or calls {@link yfiles.graph.IGraph#addPort} if - * the result was null. - *

- * @param context - * @param portCandidate The candidate to get a port instance from. - * @param suggestedLocation The suggested location for the port. - * @returns A non-null port instance. - * @see yfiles.input.PortRelocationHandle#setPorts - * @protected - */ - getPort(context:yfiles.input.IInputModeContext,portCandidate:yfiles.input.IPortCandidate,suggestedLocation:yfiles.geometry.Point):yfiles.graph.IPort; - /** - * Gets the possible candidates for the given edge. - *

- * This implementation uses the {@link yfiles.input.IEdgeReconnectionPortCandidateProvider} from the edge's {@link yfiles.graph.ILookup#lookup} - * to retrieve the candidate sets. If {@link yfiles.input.PortRelocationHandle#addExistingPort} is enabled, the existing port will be part of the candidates. - *

- * @param context The context that is used to retrieve the candidates for. - * @param edge The edge. - * @param sourcePort Whether to look for source port candidates. - * @returns A non-null enumerable over the candidates. - * @protected - */ - getPortCandidates(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,sourcePort:boolean):yfiles.collections.IEnumerable; - /** - * - * @param context - * @param originalLocation - * @param newLocation - */ - handleMove(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; - /** - * Hides the original edge that during the drag operation. - * @param edge The edge to hide. - * @param context The context to get the canvas the edge should be hidden from. - * @see yfiles.input.PortRelocationHandle#unhideOriginalEdge - * @see yfiles.input.PortRelocationHandle#showDummyEdge - * @protected - */ - hideOriginalEdge(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):void; - /** - * - * @param context - */ - initializeDrag(context:yfiles.input.IInputModeContext):void; - /** - * Determines whether {@link yfiles.input.PortRelocationHandle#resolveCandidate port candidate resolution} is enabled for the current gesture. - *

- * This implementation checks whether the the parent input mode is an instance of {@link yfiles.input.HandleInputMode}, the {@link yfiles.input.PortRelocationHandle#portCandidateResolutionRecognizer} - * recognizes its {@link yfiles.view.MouseEventArgs}, and the {@link yfiles.input.HandleInputMode#currentHandle}'s location is equal to this {@link yfiles.input.PortRelocationHandle#location}. - *

- * @param context The context to inspect. - * @returns true if port candidates may be resolved; false otherwise. - * @protected - */ - isPortCandidateResolutionEnabled(context:yfiles.input.IInputModeContext):boolean; - /** - * Tries to {@link yfiles.input.IPortCandidate#getPortCandidateAt resolve} a dynamic port candidate for the given location. - * @param context The context in which the candidate is resolved. - * @param portCandidate The candidate. - * @param location The current location. - * @returns A candidate. - * @protected - */ - resolveCandidate(context:yfiles.input.IInputModeContext,portCandidate:yfiles.input.IPortCandidate,location:yfiles.geometry.Point):yfiles.input.IPortCandidate; - /** - * Updates the closest candidate for visual feedback. - * @param portCandidate - * @protected - */ - setClosestCandidate(portCandidate:yfiles.input.IPortCandidate):void; - /** - * Callback that is triggered by {@link yfiles.input.PortRelocationHandle#dragFinished} to actually change the port. - * @param context The context. - * @param edge The edge to change ports. - * @param setSourcePort Whether to set the source port. false for target ports. - * @param portCandidate The candidate that has been chosen. - * @param suggestedLocation The suggested location for the port. - * @protected - */ - setPort(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,setSourcePort:boolean,portCandidate:yfiles.input.IPortCandidate,suggestedLocation:yfiles.geometry.Point):void; - /** - * Finally sets the ports for the edge to the new values. - * @param context The context in which the ports are set. - * @param edge The edge to set the ports for. - * @param sourcePort The (possibly) new source port. - * @param targetPort The (possibly) new target port. - * @protected - */ - setPorts(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):void; - /** - * Updates the position of the handle. - * @param location The new location of the handle. - * @protected - */ - setPosition(location:yfiles.geometry.Point):void; - /** - * Updates the dummy edge's visual appearance to reflect the new port candidate. - * @param dummy The dummy edge. - * @param source Whether to update the source or target port. - * @param portCandidate The new candidate to indicate. - * @protected - */ - setToPortCandidate(dummy:yfiles.graph.SimpleEdge,source:boolean,portCandidate:yfiles.input.IPortCandidate):void; - /** - * Unhides the original edge that was hidden during the drag operation. - * @param edge The edge to unhide. - * @param canvas The canvas the edge was hidden from. - * @see yfiles.input.PortRelocationHandle#hideOriginalEdge - * @see yfiles.input.PortRelocationHandle#showDummyEdge - * @protected - */ - unhideOriginalEdge(edge:yfiles.graph.IEdge,canvas:yfiles.view.CanvasComponent):void; - /** - * Gets or sets a value indicating whether to show the candidates of hit {@link yfiles.graph.IPortOwner}s only. - * @type {boolean} - */ - showHitPortOwnerCandidatesOnly:boolean; - /** - * Gets or sets the maximum distance the pointer may be away of a candidate in order to be snapped to the candidate. - *

- * The distance is measured in view coordinates. The default value is 50.0. - *

- * @type {number} - */ - maximumSnapDistance:number; - /** - * Gets or sets whether or not edges are allowed to connect to other edges. - *

- * The default is true. - *

- * @default true - * @type {boolean} - */ - allowEdgeToEdgeConnections:boolean; - /** - * Gets or sets whether or not cyclic port dependencies are allowed. - *

- * If {@link yfiles.input.PortRelocationHandle#allowEdgeToEdgeConnections edge to edge connections} are allowed by this instance, this property determines whether - * {@link yfiles.input.PortRelocationHandle#getClosestCandidate}s are will yield candidates that would result in the edge being - * modified would create a cyclic dependency. The default is false. - *

- * @default false - * @type {boolean} - */ - allowCyclicPortDependencies:boolean; - /** - * Gets or sets a property that determines whether the existing port should be available as a possible port candidate, - * too. - *

- * The default is true. If this property is set to false, {@link yfiles.input.PortRelocationHandle#getPortCandidates} will return - * only the ports provided by the {@link yfiles.input.IPortCandidateProvider} in the node's lookup. - *

- * @type {boolean} - */ - addExistingPort:boolean; - /** - * - * @type {yfiles.input.HandleTypes} - */ - type:yfiles.input.HandleTypes; - /** - * - * @type {yfiles.view.Cursor} - */ - cursor:yfiles.view.Cursor; - /** - * Gets or sets a value indicating whether a {@link yfiles.input.PortCandidateValidity#DYNAMIC dynamic port candidate} should be resolved for the current mouse location. - *

- * By default this feature is enabled and the {@link yfiles.input.PortRelocationHandle#portCandidateResolutionRecognizer} is configured so that the resolution mechanism is used if the user {@link yfiles.input.KeyEventRecognizers#SHIFT_PRESSED holds the shift modifier} - * during the gesture. - *

- * @see yfiles.input.PortRelocationHandle#portCandidateResolutionRecognizer - * @see yfiles.input.PortRelocationHandle#resolveCandidate - * @default true - * @type {boolean} - */ - resolvePortCandidates:boolean; - /** - * Gets or sets the event recognizer that determines whether a {@link yfiles.input.PortCandidateValidity#DYNAMIC dynamic port candidate} should be resolved. - *

- * Note that this property has no effect if {@link yfiles.input.PortRelocationHandle#resolvePortCandidates} is set to false. - *

- *

- * By default this is set to {@link yfiles.input.KeyEventRecognizers#SHIFT_PRESSED}. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - portCandidateResolutionRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets a value indicating whether the source end of the edge is handled by this instance. - * @protected - * @type {boolean} - */ - sourceEnd:boolean; - /** - * Gets the edge this instance acts upon. - * @protected - * @type {yfiles.graph.IEdge} - */ - edge:yfiles.graph.IEdge; - /** - * Gets the dummy edge this instance uses during the edit. - * @see yfiles.input.PortRelocationHandle#showDummyEdge - * @protected - * @type {yfiles.graph.SimpleEdge} - */ - dummyEdge:yfiles.graph.SimpleEdge; - /** - * Gets or sets a value indicating whether to show a dummy edge during the drag operation. - *

- * The default is true. - *

- * @default true - * @type {boolean} - */ - showDummyEdge:boolean; - /** - * Gets or sets the context to operate on. - * @protected - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Gets a view of the location of the item. - *

- * This implementation returns this. - *

- * @type {yfiles.geometry.IPoint} - */ - location:yfiles.geometry.IPoint; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.PortRelocationHandle; - } - /** - * Simple implementation of a {@link yfiles.input.IHandleProvider} that can be used for {@link yfiles.graph.IEdge}s. - *

- * It will return the {@link yfiles.input.IHandle}s for the {@link yfiles.graph.IEdge#sourcePort source} and {@link yfiles.graph.IEdge#targetPort target} ports using {@link yfiles.input.PortRelocationHandle}s. - *

- *

- * Note that this implementation also explicitly implements the {@link yfiles.input.IEdgePortHandleProvider} and that it is - * recommended to decorate the {@link yfiles.input.IEdgePortHandleProvider} interface with edges in order to influence the handles - * of the source and target port of the edge instead of directly decorating and implementing the {@link yfiles.input.IHandleProvider} - * interface. The default implementation of the {@link yfiles.input.IHandleProvider} interface in the lookup of the - * {@link yfiles.graph.IEdge}s (see {@link yfiles.graph.DefaultGraph#DEFAULT_EDGE_LOOKUP}) will use the {@link yfiles.input.IEdgeReconnectionPortCandidateProvider} interface to collect the - * source and target port handles. - *

- * @class - * @implements {yfiles.input.IHandleProvider} - * @implements {yfiles.input.IEdgePortHandleProvider} - */ - export interface PortRelocationHandleProvider extends yfiles.lang.Object,yfiles.input.IHandleProvider,yfiles.input.IEdgePortHandleProvider{} - export class PortRelocationHandleProvider { - /** - * Initializes a new instance of the {@link yfiles.input.PortRelocationHandleProvider} class using the given graph and edge. - * @param graph The graph or null. If the graph is null, the handles will try to receive the graph from the {@link } - * it is used in. - * @param edge The edge. - */ - constructor(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge); - /** - * Factory method that creates the handle for this provider. - * @param graph The graph that contains the edge. - * @param edge The edge. - * @param sourcePort if set to true the handle for the source port is sought. - * @returns A handle or null. - * @protected - */ - createPortRelocationHandle(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,sourcePort:boolean):yfiles.input.IHandle; - /** - * - * @param context - * @returns - */ - getHandles(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; - /** - * The graph this provider is working on. - * @protected - * @const - * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - /** - * The edge this provider is working on. - * @protected - * @const - * @type {yfiles.graph.IEdge} - */ - edge:yfiles.graph.IEdge; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.PortRelocationHandleProvider; - } - /** - * A simple implementation of an {@link yfiles.input.IHandleProvider} that returns all handles in the lookup of the ports owned by - * the given owner. - *

- * Using this class to display port handles will result in exceptions if the underlying port instances are removed from the - * graph while the handles are displayed. This can happen, for example, through Undo or if ports are removed - * programmatically with - * {@link yfiles.graph.IGraph#remove}. In that case, you need to query the handles again before interacting with the graph, for - * example by temporarily unselecting and reselecting the port-owning nodes. - *

- * @class - * @implements {yfiles.input.IHandleProvider} - */ - export interface PortsHandleProvider extends yfiles.lang.Object,yfiles.input.IHandleProvider{} - export class PortsHandleProvider { - /** - * Creates an instance using the given owner as the provider for the ports. - * @param owner - */ - constructor(owner:yfiles.graph.IPortOwner); - /** - * Retrieves the handle implementation from the port's lookup. - * @param port - * @returns - * @protected - */ - getHandle(port:yfiles.graph.IPort):yfiles.input.IHandle; - /** - * Returns a collection of zero or more {@link yfiles.input.IHandle} implementations that are associated with the ports of this - * context. - * @param context - * @returns A collection of handles. - */ - getHandles(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; - /** - * The owner of the ports. - * @protected - * @const - * @type {yfiles.graph.IPortOwner} - */ - portOwner:yfiles.graph.IPortOwner; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.PortsHandleProvider; - } - /** - * Specialized input mode that is used to resize a stripe by dragging one of its borders. - *

- * By default, adjacent stripes are moved. To redistribute the space instead, use {@link yfiles.input.ResizeStripeInputMode#resizeNeighborsRecognizer}. Also, by default the content of the - * stripes is either moved or constrains the minimum available sizes for the stripe resize operations. To completely ignore - * all content nodes, use {@link yfiles.input.ResizeStripeInputMode#ignoreContentRecognizer}. - *

- *

- * This mode is {@link yfiles.input.ResizeStripeInputMode#exclusive} by default. - *

- * @class - * @implements {yfiles.input.IInputMode} - */ - export interface ResizeStripeInputMode extends yfiles.lang.Object,yfiles.input.IInputMode{} - export class ResizeStripeInputMode { - /** - * Creates a new instance of this input mode. - */ - constructor(); - /** - * Cancels the editing of this mode. - *

- * This implementation {@link yfiles.input.ConcurrencyController#releaseMutex releases} the mutex if it is currently owned by this instance and calls - * {@link yfiles.input.ResizeStripeInputMode#onCanceled}. - *

- * @see yfiles.input.ResizeStripeInputMode#onCanceled - */ - cancel():void; - /** - * Installs this mode into the given context that is provided by the canvas. - *

- * In general a mode can only be installed into a single canvas at all times. - *

- *

- * This method is called to initialize this instance. Subclasses should override this method to register the corresponding - * event handler delegates for the various input events they need to register with. - *

- *

- * Overriding implementations should call the base implementation, first. - *

- * @param context The context that this instance shall be installed into. The same instance will be passed to this instance during - * {@link #uninstall}. A reference to the context may be kept and queried during the time the mode is - * installed. - * @param controller The {@link #controller} for this mode. - * @see yfiles.input.IInputMode#uninstall - */ - install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; - /** - * Called to determine whether it is valid to begin the gesture - *

- * This implementation checks whether a stripe border has been hit at the latest {@link yfiles.view.MouseEventArgs} - *

- * @param source - * @param evt - * @returns true iff a stripe border has been hit at the latest {@link } - * @protected - */ - isValidBegin(source:any,evt:yfiles.lang.EventArgs):boolean; - /** - * Called after {@link yfiles.input.ResizeStripeInputMode#cancel} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been canceled. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onCanceled():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been activated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerActivated():void; - /** - * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. - *

- *

- * Overriding implementations should call the base implementation. - *

- * @protected - */ - onConcurrencyControllerDeactivated():void; - /** - * Triggers the {@link yfiles.input.ResizeStripeInputMode#addDragCanceledListener DragCanceled} event. - * @param evt The event argument that contains context information. - * @protected - */ - onDragCanceled(evt:yfiles.input.InputModeEventArgs):void; - /** - * Triggers the {@link yfiles.input.ResizeStripeInputMode#addDragCancelingListener DragCanceling} event. - * @param evt The event argument that contains context information. - * @protected - */ - onDragCanceling(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered once the drag has been finalized. - *

- * This method triggers the {@link yfiles.input.ResizeStripeInputMode#addDragFinishedListener DragFinished} - * event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragFinished(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered before the drag will be finalized. - *

- * This method triggers the {@link yfiles.input.ResizeStripeInputMode#addDragFinishingListener DragFinishing} - * event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragFinishing(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered at the end of each drag. - *

- * This method triggers the {@link yfiles.input.ResizeStripeInputMode#addDraggedListener Dragged} - * event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragged(evt:yfiles.input.InputModeEventArgs):void; - /** - * Callback triggered at the start of each drag. - *

- * This method triggers the {@link yfiles.input.ResizeStripeInputMode#addDraggingListener Dragging} - * event. - *

- * @param evt The event argument that contains context information. - * @protected - */ - onDragging(evt:yfiles.input.InputModeEventArgs):void; - /** - * Triggers the {@link yfiles.input.ResizeStripeInputMode#addDragStartedListener DragStarted} event. - * @param evt The event argument that contains context information. - * @protected - */ - onDragStarted(evt:yfiles.input.InputModeEventArgs):void; - /** - * Triggers the {@link yfiles.input.ResizeStripeInputMode#addDragStartingListener DragStarting} event. - * @param evt The event argument that contains context information. - * @protected - */ - onDragStarting(evt:yfiles.input.InputModeEventArgs):void; - /** - * Called after {@link yfiles.input.ResizeStripeInputMode#tryStop} has been called. - *

- * Can be overridden in subclasses to perform additional actions after the mode has been stopped. - *

- *

- * This implementation does nothing. - *

- * @protected - */ - onStopped():void; - /** - * - * @returns - */ - tryStop():boolean; - /** - * Uninstalls this mode from the given context. - *

- * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} method. After a mode has - * been uninstalled it can be installed again into the same or another canvas. - *

- *

- * Overriding implementations should call the base implementation after their own code. - *

- * @param context The context to deregister from. This is the same instance that had been passed to {@link #install} during - * installation. - */ - uninstall(context:yfiles.input.IInputModeContext):void; - /** - * - * @type {number} - */ - priority:number; - /** - * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. - *

- * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.ResizeStripeInputMode#controller}. - *

- *

- * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} - * will be deactivated. Otherwise it will always run concurrently with all other modes. - *

- * @type {boolean} - */ - exclusive:boolean; - /** - * Gets or sets the enabled state of this input mode. - *

- * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed - * {@link yfiles.input.ResizeStripeInputMode#controller} so a disabled instance should never try to acquire the input mutex. - *

- * @type {boolean} - */ - enabled:boolean; - /** - * - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Gets the installed {@link yfiles.input.ResizeStripeInputMode#controller}. - * @protected - * @type {yfiles.input.ConcurrencyController} - */ - controller:yfiles.input.ConcurrencyController; - /** - * Gets or sets the "pressed" state recognizer for touch input. - *

- * This recognizer instance will be used to determine when the user begins to move a handle. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - pressedRecognizerTouch:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "dragged" recognizer for touch input. - *

- * This recognizer instance determines when the user is moving a handle. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - draggedRecognizerTouch:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "released" recognizer for touch input. - *

- * This instance determines when the user has finished moving the handle. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - releasedRecognizerTouch:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "pressed" state recognizer. - *

- * This recognizer instance will be used to determine when the user begins to resize the stripe. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - pressedRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "dragged" recognizer. - *

- * This recognizer instance determines when the user is dragging the mouse to resize the stripe. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - draggedRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "cancel" recognizer. - *

- * This recognizer recognizes a cancel action during the resize operation. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - cancelRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the "released" recognizer. - *

- * This instance determines when the user has finished the resize operation. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - releasedRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the recognizer that changes the behavior to resize adjacent stripes instead of moving them. - *

- * If this recognizer recognizes its gesture, the behavior will be to resize adjacent stripes instead of moving them (which - * is the default). - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - resizeNeighborsRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets the recognizer that changes the behavior to ignore the content of all stripes instead of moving them or - * considering for minimum sizes. - *

- * If this recognizer recognizes its gesture, the behavior will be to completely ignore all stripe contents. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - ignoreContentRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Adds the given listener for the DragFinishing event that occurs before the drag will be finished. - * @param listener The listener to add. - * @see yfiles.input.ResizeStripeInputMode#removeDragFinishingListener - */ - addDragFinishingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragFinishing event that occurs before the drag will be finished. - * @param listener The listener to remove. - * @see yfiles.input.ResizeStripeInputMode#addDragFinishingListener - */ - removeDragFinishingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragFinished event that occurs once the drag has been finished. - * @param listener The listener to add. - * @see yfiles.input.ResizeStripeInputMode#removeDragFinishedListener - */ - addDragFinishedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragFinished event that occurs once the drag has been finished. - * @param listener The listener to remove. - * @see yfiles.input.ResizeStripeInputMode#addDragFinishedListener - */ - removeDragFinishedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragStarting event that occurs once the drag is starting. - * @param listener The listener to add. - * @see yfiles.input.ResizeStripeInputMode#removeDragStartingListener - */ - addDragStartingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragStarting event that occurs once the drag is starting. - * @param listener The listener to remove. - * @see yfiles.input.ResizeStripeInputMode#addDragStartingListener - */ - removeDragStartingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragStarted event that occurs once the drag is initialized and has started. - * @param listener The listener to add. - * @see yfiles.input.ResizeStripeInputMode#removeDragStartedListener - */ - addDragStartedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragStarted event that occurs once the drag is initialized and has started. - * @param listener The listener to remove. - * @see yfiles.input.ResizeStripeInputMode#addDragStartedListener - */ - removeDragStartedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the Dragging event that occurs at the start of every drag. - * @param listener The listener to add. - * @see yfiles.input.ResizeStripeInputMode#removeDraggingListener - */ - addDraggingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the Dragging event that occurs at the start of every drag. - * @param listener The listener to remove. - * @see yfiles.input.ResizeStripeInputMode#addDraggingListener - */ - removeDraggingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the Dragged event that occurs at the end of every drag. - * @param listener The listener to add. - * @see yfiles.input.ResizeStripeInputMode#removeDraggedListener - */ - addDraggedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the Dragged event that occurs at the end of every drag. - * @param listener The listener to remove. - * @see yfiles.input.ResizeStripeInputMode#addDraggedListener - */ - removeDraggedListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragCanceled event that occurs when the drag has been canceled. - * @param listener The listener to add. - * @see yfiles.input.ResizeStripeInputMode#removeDragCanceledListener - */ - addDragCanceledListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragCanceled event that occurs when the drag has been canceled. - * @param listener The listener to remove. - * @see yfiles.input.ResizeStripeInputMode#addDragCanceledListener - */ - removeDragCanceledListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Adds the given listener for the DragCanceling event that occurs before the drag will be canceled. - * @param listener The listener to add. - * @see yfiles.input.ResizeStripeInputMode#removeDragCancelingListener - */ - addDragCancelingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - /** - * Removes the given listener for the DragCanceling event that occurs before the drag will be canceled. - * @param listener The listener to remove. - * @see yfiles.input.ResizeStripeInputMode#addDragCancelingListener - */ - removeDragCancelingListener(listener:(sender:any,evt:yfiles.input.InputModeEventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.ResizeStripeInputMode; - } - /** - * Interface used for implementations that recognize, approve and disapprove stripe reparenting gestures, as well as - * actually performs the reparenting. - * @see yfiles.input.ReparentStripePositionHandler - * @interface - */ - export interface IReparentStripeHandler extends yfiles.lang.Object{ - /** - * Determines whether the provided node may be reparented to a newParent. - *

- * This method is called to determine whether a {@link yfiles.input.IReparentStripeHandler#reparent} operation should actually be - * executed. - *

- * @param context The context that provides information about the user input. - * @param stripe The stripe that will be reparented. - * @param newParent The potential new parent. - * @param index The index where the stripe would be {@link #reparent reparented} - * @param reparentPosition Where to place the stripe as a result of the gesture that would be used for the {@link #reparent } - * operation. - * @returns Whether newParent is a valid new parent for stripe for the given index and gesture. - * @abstract - */ - isValidParent(context:yfiles.input.IInputModeContext,stripe:yfiles.graph.IStripe,newParent:yfiles.graph.IStripe,index:number,reparentPosition:yfiles.input.StripeReparentPolicy):boolean; - /** - * Performs the actual reparenting after the reparent gesture has been finalized. - *

- * Implementations should use {@link yfiles.graph.ITable#setParent} or {@link yfiles.graph.ITable#setParent} to set the parent of movedStripe - * to newParent. - *

- * @param context The context that provides information about the user input. - * @param movedStripe The stripe that will be reparented. - * @param newParent The potential new parent. - * @param index The index where the stripe should be inserted. - * @param reparentPosition Where to place the stripe as a result of the gesture that triggered the reparent operation. - * @abstract - */ - reparent(context:yfiles.input.IInputModeContext,movedStripe:yfiles.graph.IStripe,newParent:yfiles.graph.IStripe,index:number,reparentPosition:yfiles.input.StripeReparentPolicy):void; - /** - * Determines whether the user may detach the given stripe from its current parent in order to reparent it. - * @param context The context that provides information about the user input. - * @param stripe The stripe that is about to be detached from its current parent. - * @returns Whether the stripe may be detached and reparented. - * @abstract - */ - shouldReparent(context:yfiles.input.IInputModeContext,stripe:yfiles.graph.IStripe):boolean; - } - var IReparentStripeHandler:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IReparentStripeHandler; - }; - /** - * Default implementation of the {@link yfiles.input.IReparentStripeHandler} interface. - *

- * This implementation allows to specify a maximal nesting depth for reparent operations. - *

- * @class - * @implements {yfiles.input.IReparentStripeHandler} - */ - export interface ReparentStripeHandler extends yfiles.lang.Object,yfiles.input.IReparentStripeHandler{} - export class ReparentStripeHandler { - constructor(); - /** - * Adjust the size of the source or the target stripe. - *

- * This implementation adjusts the size of stripe to Math.Max(originalStripeSize, originalParentSize) if reparentPosition - * is an {@link yfiles.input.StripeReparentPolicy#ADD_CHILD} operation - *

- * @param context The context that provides information about the user input. - * @param stripe The stripe that will be reparented. - * @param newParent The potential new parent. - * @param index The index where the stripe should be inserted. - * @param reparentPosition Where to place the stripe as a result of the gesture that triggered the reparent operation. - * @param originalStripeSize The original size of stripe - * @param originalParentSize The original size of newParent - * @protected - */ - adjustSize(context:yfiles.input.IInputModeContext,stripe:yfiles.graph.IStripe,newParent:yfiles.graph.IStripe,reparentPosition:yfiles.input.StripeReparentPolicy,index:number,originalStripeSize:number,originalParentSize:number):void; - /** - * Checks the constraints imposed by {@link yfiles.input.ReparentStripeHandler#maxRowLevel} or {@link yfiles.input.ReparentStripeHandler#maxColumnLevel} for a valid gesture. - * @param context The context that provides information about the user input. - * @param stripe The stripe that will be reparented. - * @param newParent The potential new parent. - * @param index The index where the stripe would be {@link #reparent reparented} - * @param reparentPosition Where to place the stripe as a result of the gesture that would be used for the {@link #reparent } - * operation. - * @returns true iff the resulting nesting depth is smaller than {@link #maxRowLevel} or {@link #maxColumnLevel}, or if the nesting depth would not increase by the operation. - */ - isValidParent(context:yfiles.input.IInputModeContext,stripe:yfiles.graph.IStripe,newParent:yfiles.graph.IStripe,index:number,reparentPosition:yfiles.input.StripeReparentPolicy):boolean; - /** - * Performs the actual reparenting after the reparent gesture has been finalized. - *

- * This implementation adjusts the size of the moved and/or the target stripe by calling {@link yfiles.input.ReparentStripeHandler#adjustSize} - * . - *

- * @param context The context that provides information about the user input. - * @param stripe The stripe that will be reparented. - * @param newParent The potential new parent. - * @param index The index where the stripe should be inserted. - * @param reparentPosition Where to place the stripe as a result of the gesture that triggered the reparent operation. - */ - reparent(context:yfiles.input.IInputModeContext,stripe:yfiles.graph.IStripe,newParent:yfiles.graph.IStripe,index:number,reparentPosition:yfiles.input.StripeReparentPolicy):void; - /** - * Determines whether the user may detach the given stripe from its current parent in order to reparent it. - * @param context The context that provides information about the user input. - * @param stripe The stripe that is about to be detached from its current parent. - * @returns This implementation returns always true. - */ - shouldReparent(context:yfiles.input.IInputModeContext,stripe:yfiles.graph.IStripe):boolean; - /** - * Gets or sets the maximum nesting level the row hierarchy may acquire during a reparent gesture. - *

- * Note that it is always possible to decrease the nesting depth, even if the resulting depth would still be too high. This - * allows to interactively reduce an invalid nesting depth in multiple steps. The default value is - * 0x7FFFFFFF, which effectively means an unlimited nesting depth. - *

- * @type {number} - */ - maxRowLevel:number; - /** - * Gets or sets the maximum nesting level the column hierarchy may acquire during a reparent gesture. - *

- * Note that it is always possible to decrease the nesting depth, even if the resulting depth would still be too high. This - * allows to interactively reduce an invalid nesting depth in multiple steps. The default value is - * 0x7FFFFFFF, which effectively means an unlimited nesting depth. - *

- * @type {number} - */ - maxColumnLevel:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.ReparentStripeHandler; - } - /** - * Specialized input mode that is used to reparent a stripe inside an {@link yfiles.graph.ITable} structure. - *

- * This implementation delegates most work to an instance of {@link yfiles.input.ReparentStripePositionHandler} - *

- * @class - * @extends {yfiles.input.MoveInputMode} - */ - export interface ReparentStripeInputMode extends yfiles.input.MoveInputMode{} - export class ReparentStripeInputMode { - constructor(); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.ReparentStripeInputMode; - } - /** - * Customized {@link yfiles.input.IPositionHandler} implementation that moves a stripe in the table hierarchy when the stripe is - * dragged. - *

- * This class is used by default by both {@link yfiles.input.ReparentStripeInputMode} and {@link yfiles.input.StripeDropInputMode} to - * perform the actual reparenting and insertion. - *

- * @class - * @implements {yfiles.input.IPositionHandler} - */ - export interface ReparentStripePositionHandler extends yfiles.lang.Object,yfiles.input.IPositionHandler{} - export class ReparentStripePositionHandler { - /** - * Creates a new instance of this position handler which moves movedStripe - * @param movedStripe - */ - constructor(movedStripe:yfiles.graph.IStripe); - /** - * - * @param context - * @param originalLocation - */ - cancelDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; - /** - * Create a visualization for the source region of the reparent gesture. - *

- * The default implementation uses the return value of {@link yfiles.input.IStripeInputVisualizationHelper#getVisualCreator} with - * type {@link yfiles.input.StripeVisualizationType#DRAG_SOURCE}. - *

- * @param context The current input mode context - * @returns A canvas object that is used to visualize the target region. - * @see yfiles.input.ReparentStripePositionHandler#updateSourceVisualization - * @protected - */ - createSourceGhostVisualization(context:yfiles.input.IInputModeContext):yfiles.view.ICanvasObject; - /** - * Create a visualization for the target region of the reparent gesture. - *

- * The default implementation uses the return value of {@link yfiles.input.IStripeInputVisualizationHelper#getVisualCreator} with - * type {@link yfiles.input.StripeVisualizationType#DROP_TARGET}. - *

- * @param context The current input mode context - * @param stripe The stripe for which the visualization should be created. - * @returns A canvas object that is used to visualize the target region. - * @see yfiles.input.ReparentStripePositionHandler#updateTargetVisualization - * @protected - */ - createTargetGhostVisualization(context:yfiles.input.IInputModeContext,stripe:yfiles.graph.IStripe):yfiles.view.ICanvasObject; - /** - * Determine the reparent gesture that would result from the given parameters. - *

- * The target region has already been determined by {@link yfiles.input.ReparentStripePositionHandler#getTargetSubregion} - *

- * @param context The current input mode context - * @param location The current drag location - * @param sourceStripe The stripe that is moved - * @param targetSubregion The stripe subregion for the target. - * @param targetBounds The target bounds - * @returns A {@link } that specifies the operation to perform. - * @protected - */ - determineGesture(context:yfiles.input.IInputModeContext,location:yfiles.geometry.IPoint,sourceStripe:yfiles.graph.IStripe,targetSubregion:yfiles.input.StripeSubregion,targetBounds:yfiles.geometry.Rect):yfiles.input.StripeReparentPolicy; - /** - * - * @param context - * @param originalLocation - * @param newLocation - */ - dragFinished(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; - /** - * Finds the target stripe subregion at location and its associated owner node. - * @param location The hit location. - * @returns A {@link } that lies at location, or null if no such region could be found. - * @protected - */ - getTargetSubregion(location:yfiles.geometry.Point):yfiles.input.StripeSubregion; - /** - * - * @param context - * @param originalLocation - * @param newLocation - */ - handleMove(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; - /** - * - * @param context - */ - initializeDrag(context:yfiles.input.IInputModeContext):void; - /** - * Called whenever a change in the oldTable hierarchy occurs through this position handler - * @param evt - * @protected - */ - onStripeChanged(evt:yfiles.graph.StripeEventArgs):void; - /** - * - * @param location - */ - setPosition(location:yfiles.geometry.Point):void; - /** - * Modifies the source visualization itself - *

- * The default does not change targetVisualization. - *

- * @param context The current input mode context. - * @param targetVisualization The canvas object for the target visualization - * @param targetStripe The target for the reparent gesture - * @param reparentPosition Where to place the stripe after reparenting. - * @returns - * @protected - */ - updateSourceVisualization(context:yfiles.input.IInputModeContext,targetVisualization:yfiles.view.ICanvasObject,targetStripe:yfiles.graph.IStripe,reparentPosition:yfiles.input.StripeReparentPolicy):yfiles.view.ICanvasObject; - /** - * Modifies the target visualization itself. - *

- * The default implementation only hides targetVisualization iff reparentPosition is - * {@link yfiles.input.StripeReparentPolicy#INVALID}. - *

- * @param context The current input mode context. - * @param targetVisualization The canvas object for the target visualization. - * @param targetStripe The target for the reparent gesture. - * @param reparentPosition The mode the describes the results of the reparent gesture. - * @param targetBounds The current visualization bounds that have been computed with - * {@link #updateTargetVisualizationBounds} - * @returns - * @protected - */ - updateTargetVisualization(context:yfiles.input.IInputModeContext,targetVisualization:yfiles.view.ICanvasObject,targetStripe:yfiles.graph.IStripe,reparentPosition:yfiles.input.StripeReparentPolicy,targetBounds:yfiles.geometry.Rect):yfiles.view.ICanvasObject; - /** - * Updates the visualization bounds for the target visualization depending on the provided values. - * @param originalTargetBounds The target bounds prior to this method call. - * @param reparentPosition Where to place the stripe after the reparenting operations according to the reparent gesture. - * @param targetStripe The target stripe which has been determined by the input mode. - * @returns Updated bounds for the target visualization. - * @protected - */ - updateTargetVisualizationBounds(originalTargetBounds:yfiles.geometry.Rect,reparentPosition:yfiles.input.StripeReparentPolicy,targetStripe:yfiles.graph.IStripe):yfiles.geometry.Rect; - /** - * - * @type {yfiles.geometry.IPoint} - */ - location:yfiles.geometry.IPoint; - /** - * Gets the moved stripe. - * @type {yfiles.graph.IStripe} - */ - movedStripe:yfiles.graph.IStripe; - /** - * Gets the current {@link yfiles.input.IInputModeContext} - * @protected - * @type {yfiles.input.IInputModeContext} - */ - inputModeContext:yfiles.input.IInputModeContext; - /** - * Adds the given listener for the StripeChanged event that occurs when a stripe state is changed by this input mode. - * @param listener The listener to add. - * @see yfiles.input.ReparentStripePositionHandler#removeStripeChangedListener - */ - addStripeChangedListener(listener:(sender:any,evt:yfiles.graph.StripeEventArgs)=>void):void; - /** - * Removes the given listener for the StripeChanged event that occurs when a stripe state is changed by this input mode. - * @param listener The listener to remove. - * @see yfiles.input.ReparentStripePositionHandler#addStripeChangedListener - */ - removeStripeChangedListener(listener:(sender:any,evt:yfiles.graph.StripeEventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.ReparentStripePositionHandler; - } - /** - * An {@link yfiles.input.ItemDropInputMode.} specialized to drag 'n' drop {@link yfiles.graph.IStripe}s. - *

- * A dragged {@link yfiles.graph.IStripe} is optionally visualized during the drag operation. - *

- * @see yfiles.input.StripeDropInputMode#startDrag - * @class - * @extends {yfiles.input.ItemDropInputMode.} - */ - export interface StripeDropInputMode extends yfiles.input.ItemDropInputMode{} - export class StripeDropInputMode { - /** - * Initializes a new instance of the {@link yfiles.input.StripeDropInputMode} class for the expected data format. - *

- * You might want to adjust the {@link yfiles.input.StripeDropInputMode#draggedItem} getter, too. - *

- * @param expectedFormat This is a format that is used in {@link #startDrag}. - * @protected - */ - constructor(expectedFormat:string); - /** - * Initializes a new instance of the {@link yfiles.input.NodeDropInputMode} class for {@link yfiles.graph.INode}s. - *

- * This instance fires events only if the format of the data of the drag operation is the full name of the {@link yfiles.graph.IStripe} - * type. Such a drag operation can be started for example with {@link yfiles.input.StripeDropInputMode#startDrag}. - *

- */ - constructor(); - /** - * Create a preview version of the table that is temporarily used to show the dragged stripe. - * @returns - * @protected - */ - createPreviewTable():yfiles.graph.ITable; - /** - * Create a new stripe as the result of a drag and drop gesture. - *

- * This method is called by the {@link yfiles.input.ItemDropInputMode.#itemCreator} that is set as default on this class. - *

- * @param newParent The parent for which to create the stripe. - * @param context The context for which the stripe should be created. - * @returns a newly created stripe. - * @protected - */ - createStripe(context:yfiles.input.IInputModeContext,newParent:yfiles.graph.IStripe):yfiles.graph.IStripe; - /** - * Calculates the layout of the new table. - *

- * In this implementation the mouse location is used as center of the table. Can be overridden in child class to implement - * a different layout. - *

- * @param location Current mouse position - * @param size Size of the table - * @returns a {@link } with the given size and the mouse location as center. - * @protected - */ - getPreviewTableLayout(location:yfiles.geometry.Point,size:yfiles.geometry.Size):yfiles.geometry.Rect; - /** - * Called whenever a new stripe is created - * @param evt - * @protected - */ - onStripeCreated(evt:yfiles.collections.ItemEventArgs):void; - /** - * Starts a drag and drop operation for an {@link yfiles.graph.IStripe}. - *

- * This convenience implementation delegates to {@link yfiles.view.DragSource#startDrag} passing the stripe to the {@link yfiles.view.DragDropItem} - * using the corresponding type. - *

- *

- * If useCssCursors is enabled, the following CSS classes are assigned to elements hovered during a drag operation, - * depending on the allowed drag-drop operations for these elements: - *

- *
    - *
  • yfiles-cursor-dragdrop-move
  • - *
  • yfiles-cursor-dragdrop-link
  • - *
  • yfiles-cursor-dragdrop-all
  • - *
  • yfiles-cursor-dragdrop-no-drop
  • - *
- * @param dragSource The source of the drag operation. - * @param stripe The stripe to drag. - * @param [dragDropEffects=yfiles.view.DragDropEffects.ALL] The allowed drag drop effects. - * @param [useCssCursors=true] Whether to adjust the classes of elements being hovered over during the drag. The default is true. - * @see yfiles.view.DragSource#startDrag - * @see yfiles.view.DragDropItem - * @static - */ - static startDrag(dragSource:HTMLElement,stripe:yfiles.graph.IStripe,dragDropEffects?:yfiles.view.DragDropEffects,useCssCursors?:boolean):void; - /** - * Starts a drag and drop operation for an {@link yfiles.graph.IStripe}. - *

- * This convenience implementation delegates to {@link yfiles.view.DragSource#startDrag} passing the stripe to the {@link yfiles.view.DragDropItem} - * using the corresponding type. - *

- *

- * If useCssCursors is enabled, the following CSS classes are assigned to elements hovered during a drag operation, - * depending on the allowed drag-drop operations for these elements: - *

- *
    - *
  • yfiles-cursor-dragdrop-move
  • - *
  • yfiles-cursor-dragdrop-link
  • - *
  • yfiles-cursor-dragdrop-all
  • - *
  • yfiles-cursor-dragdrop-no-drop
  • - *
- * @param {Object} options The parameters to pass. - * @param options.dragSource The source of the drag operation. - * @param options.stripe The stripe to drag. - * @param [options.dragDropEffects=yfiles.view.DragDropEffects.ALL] The allowed drag drop effects. - * @param [options.useCssCursors=true] Whether to adjust the classes of elements being hovered over during the drag. The default is true. - * @see yfiles.view.DragSource#startDrag - * @see yfiles.view.DragDropItem - * @static - */ - static startDrag(options:{dragSource:HTMLElement,stripe:yfiles.graph.IStripe,dragDropEffects?:yfiles.view.DragDropEffects,useCssCursors?:boolean}):void; - /** - * Gets the currently dragged {@link yfiles.graph.IModelItem} instance. - *

- * This implementation simply tries to cast the {@link yfiles.input.DropInputMode#dropData} to {@link yfiles.graph.INode}. - *

- * @protected - * @type {yfiles.graph.IStripe} - */ - draggedItem:yfiles.graph.IStripe; - /** - * Adds the given listener for the StripeCreated event that occurs when a new stripe gets created by this input mode. - * @param listener The listener to add. - * @see yfiles.input.StripeDropInputMode#removeStripeCreatedListener - */ - addStripeCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the StripeCreated event that occurs when a new stripe gets created by this input mode. - * @param listener The listener to remove. - * @see yfiles.input.StripeDropInputMode#addStripeCreatedListener - */ - removeStripeCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.StripeDropInputMode; - } - /** - * Input mode that can be used to interactively edit a table. - *

- * This mode can either be used as a stand alone input mode, or as a child mode of - * {@link yfiles.input.GraphEditorInputMode}. In that case, some child modes of this implementation are disabled: - *

- *
    - *
  • {@link yfiles.input.TableEditorInputMode#clickInputMode}
  • - *
  • {@link yfiles.input.TableEditorInputMode#textEditorInputMode}
  • - *
  • {@link yfiles.input.TableEditorInputMode#keyboardInputMode}
  • - *
- *

- * In addition, the {@link yfiles.input.TableEditorInputMode#stripeSelection stripe selection} is optionally synchronized with the {@link yfiles.input.GraphInputMode#graphSelection}. - *

- * @class - * @extends {yfiles.input.MultiplexingInputMode} - */ - export interface TableEditorInputMode extends yfiles.input.MultiplexingInputMode{} - export class TableEditorInputMode { - /** - * Default constructor. - */ - constructor(); - /** - * Adds a new label to the given stripe interactively. - *

- * This will activate the {@link yfiles.input.TableEditorInputMode#textEditorInputMode} to let the user interactively enter the label's text and unless the user cancels label creation - * the returned {@link Promise.} will contain the label. - *

- *

- * The text that the user enters may be {@link yfiles.input.TableEditorInputMode#addValidateLabelTextListener validated} before the label is actually added. - *

- *

- * This method is similar to {@link yfiles.input.TableEditorInputMode#createLabel}. It differs only when either the {@link yfiles.input.TableEditorInputMode#addLabelAddingListener LabelAdding} - * event is handled or the owner has an {@link yfiles.input.IEditLabelHelper} requests editing an existing label instead of - * creating a new one. In this case, this method will edit that label instead of adding a new one. - *

- * @param owner The item. - * @returns A promise that fulfills with either the newly created label or null if the {@link #addEditingCanceledListener editing was canceled} or the text did not - * {@link #addValidateLabelTextListener validate}. - */ - addLabel(owner:yfiles.graph.ILabelOwner):Promise; - /** - * Clears the current selection. - * @see yfiles.input.TableEditorInputMode#selectableItems - */ - clearSelection():void; - /** - * Factory method that creates the {@link yfiles.input.TableEditorInputMode#keyboardInputMode} instance. - * @returns - * @protected - */ - createClickInputMode():yfiles.input.ClickInputMode; - /** - * Factory method that creates the {@link yfiles.input.TableEditorInputMode#keyboardInputMode} instance. - * @returns - * @protected - */ - createKeyboardInputMode():yfiles.input.KeyboardInputMode; - /** - * Interactively creates a new label for the provided stripe. - *

- * This method will invoke the text editor that will let the user edit the text of the label. If the user commits the label - * text the label will be added to the label owner. - *

- *

- * The text that the user enters may be {@link yfiles.input.TableEditorInputMode#addValidateLabelTextListener validated} before the label is actually added. - *

- *

- * This method is similar to {@link yfiles.input.TableEditorInputMode#addLabel}. It differs only when either the {@link yfiles.input.TableEditorInputMode#addLabelAddingListener LabelAdding} - * event is handled or the stripe has an {@link yfiles.input.IEditLabelHelper} requests editing an existing label instead of - * creating a new one. In both cases, this method will do nothing and neither adds a new label nor edits an existing one. - *

- * @param stripe The item to create a new label for. - * @returns A future of the label that will be notified of the newly created label or a null if the creation was canceled. - */ - createLabel(stripe:yfiles.graph.IStripe):Promise; - /** - * Factory method for the {@link yfiles.input.TableEditorInputMode#reparentStripeHandler} property. - *

- * This method will be called upon first access to the {@link yfiles.input.TableEditorInputMode#reparentStripeHandler} property. - *

- * @returns a new instance of {@link } - * @protected - */ - createReparentStripeHandler():yfiles.input.IReparentStripeHandler; - /** - * Factory method that creates the {@link yfiles.input.TableEditorInputMode#reparentStripeInputMode} lazily the first time the property is accessed. - * @returns A plain new instance of the {@link } type, which is initially {@link #enabled enabled}. - * @protected - */ - createReparentStripeInputMode():yfiles.input.ReparentStripeInputMode; - /** - * Factory method that creates the {@link yfiles.input.TableEditorInputMode#resizeStripeInputMode} lazily the first time the property is accessed. - * @returns A plain new instance of the {@link } type, which is initially {@link #enabled enabled}. - * @protected - */ - createResizeStripeInputMode():yfiles.input.ResizeStripeInputMode; - /** - * Factory method that creates the {@link yfiles.input.TableEditorInputMode#stripeDropInputMode} lazily the first time the property is accessed. - * @returns A plain new instance of the {@link } type, which is initially {@link #enabled disabled}. - * @protected - */ - createStripeDropInputMode():yfiles.input.StripeDropInputMode; - /** - * Create a new instance of {@link yfiles.view.IStripeSelection} the first time property {@link yfiles.input.TableEditorInputMode#stripeSelection} is accessed. - *

- * By default, the {@link yfiles.view.IStripeSelection#allowMixedSelection} property is false. - *

- * @returns A new {@link } instance. - * @protected - */ - createStripeSelection():yfiles.view.IStripeSelection; - /** - * Factory method for the {@link yfiles.input.TableEditorInputMode#textEditorInputMode} property. - *

- * This method will be called upon first access to the {@link yfiles.input.TableEditorInputMode#textEditorInputMode} property. - *

- * @returns a new instance of {@link } - * @protected - */ - createTextEditorInputMode():yfiles.input.TextEditorInputMode; - /** - * This method deletes the currently selected stripes. - *

- * If the {@link yfiles.input.TableEditorInputMode#stripeSelection} is non-empty this implementation triggers the {@link yfiles.input.TableEditorInputMode#addDeletingSelectionListener DeletingSelection} - * event, possibly a number of {@link yfiles.input.TableEditorInputMode#addDeletedItemListener DeletedItem} - * events, and a final {@link yfiles.input.TableEditorInputMode#deleteSelection} event. - *

- * @see yfiles.input.TableEditorInputMode#addDeletingSelectionListener - * @see yfiles.input.TableEditorInputMode#addDeletedItemListener - * @see yfiles.input.TableEditorInputMode#addDeletedSelectionListener - */ - deleteSelection():void; - /** - * Deletes a single stripe - * @param stripe The stripe to delete. - */ - deleteStripe(stripe:yfiles.graph.IStripe):void; - /** - * Starts editing of the given label. - *

- * The label must be bound to an {@link yfiles.graph.IStripe} instance for this call to succeed. - *

- *

- * This implementation uses the {@link yfiles.input.TableEditorInputMode#textEditorInputMode} to display an editor to edit the label. The text that the user enters may be {@link yfiles.input.TableEditorInputMode#addValidateLabelTextListener validated} - * before the label is actually edited. - *

- *

- * This method will raise the {@link yfiles.input.TableEditorInputMode#addLabelEditingListener LabelEditing} - * event and query the {@link yfiles.input.IEditLabelHelper} for the label and its owner, but will ignore the result except for the - * {@link yfiles.input.LabelEditingEventArgs#textEditorInputModeConfigurator} property on the {@link yfiles.input.LabelEditingEventArgs}. Thus editing a label via this method cannot be prevented by event - * handlers or {@link yfiles.input.IEditLabelHelper}s. - *

- * @param label The label to edit. - * @returns - * @see yfiles.input.TableEditorInputMode#onLabelTextEdited - */ - editLabel(label:yfiles.graph.ILabel):Promise; - /** - * Used as a callback to find the items underneath a certain point. - * @param location The location to test. - * @param stripeTypes An enumeration value of {@link } to specify the stripe type. - * @param subregionTypes An enumeration value of {@link } to further restrict the stripe region. - * @param [filter=null] Additional predicate to further restrict the hit test results. - * @returns The stripe subregions that have been found for the location or null. - */ - findStripe(location:yfiles.geometry.Point,stripeTypes:yfiles.graph.StripeTypes,subregionTypes:yfiles.input.StripeSubregionTypes,filter?:(obj:yfiles.input.StripeSubregion)=>boolean):yfiles.input.StripeSubregion; - /** - * Used as a callback to find the items underneath a certain point. - * @param location The location to test. - * @param stripeTypes An enumeration value of {@link } to specify the stripe type. - * @param subregionTypes An enumeration value of {@link } to further restrict the stripe region. - * @param [filter=null] Additional predicate to further restrict the hit test results. - * @returns The stripe subregions that have been found for the location. - */ - findStripes(location:yfiles.geometry.Point,stripeTypes:yfiles.graph.StripeTypes,subregionTypes:yfiles.input.StripeSubregionTypes,filter?:(obj:yfiles.input.StripeSubregion)=>boolean):yfiles.collections.IEnumerable; - /** - * Convenience method that inserts a new stripe as child of owner - *

- * This method automatically resizes the table node and moves all content in neighboring stripes accordingly. The stripe is - * created with an initial size and otherwise the default settings of the table where owner belongs to. If size is entered - * as 0, the owners default size is used. - *

- * @param owner The parent of the new stripe. - * @param index The index where to insert the new stripe. - * @param [size=null] The initial size of the stripe - * @returns A new stripe at the given index. - */ - insertChild(owner:yfiles.graph.IStripe,index:number,size?:number):yfiles.graph.IStripe; - /** - * Callback that is invoked if the shift+F2 key is pressed and {@link yfiles.input.TableEditorInputMode#allowAddLabel} is set to true. - *

- * This method determines the label owner to add to and delegates to {@link yfiles.input.TableEditorInputMode#createLabel}. - *

- * @returns - * @protected - */ - onAddLabel():boolean; - /** - * Called when the {@link yfiles.input.TableEditorInputMode#clickInputMode} property value changes and after initialization of the field. - * @param oldMode the old value, which may be null the first time - * @param newMode the new value - * @protected - */ - onClickInputModeChanged(oldMode:yfiles.input.ClickInputMode,newMode:yfiles.input.ClickInputMode):void; - /** - * Callback that gets triggered once {@link yfiles.input.TableEditorInputMode#clickInputMode} triggers the {@link yfiles.input.ClickInputMode#addClickedListener Clicked} - * event. - * @param sender - * @param evt - * @protected - */ - onClickInputModeClicked(sender:any,evt:yfiles.input.ClickEventArgs):void; - /** - * Callback that gets triggered once {@link yfiles.input.TableEditorInputMode#clickInputMode} triggers the {@link yfiles.input.ClickInputMode#addDoubleClickedListener DoubleClicked} - * event. - * @param sender - * @param evt - * @protected - */ - onClickInputModeDoubleClicked(sender:any,evt:yfiles.input.ClickEventArgs):void; - /** - * Raises the {@link yfiles.input.TableEditorInputMode#addDeletedItemListener DeletedItem} event. - * @param evt The instance containing the event data. - * @protected - */ - onDeletedItem(evt:yfiles.collections.ItemEventArgs):void; - /** - * Raises the {@link yfiles.input.TableEditorInputMode#addDeletedSelectionListener DeletedSelection} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onDeletedSelection(evt:yfiles.input.SelectionEventArgs):void; - /** - * Raises the {@link yfiles.input.TableEditorInputMode#addDeletingSelectionListener DeletingSelection} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onDeletingSelection(evt:yfiles.input.SelectionEventArgs):void; - /** - * Callback that is invoked if the F2 key is pressed and {@link yfiles.input.TableEditorInputMode#allowEditLabel} is set to true. - *

- * This method determines the label to edit and delegates to either {@link yfiles.input.TableEditorInputMode#editLabel} or {@link yfiles.input.TableEditorInputMode#createLabel} - * if no label could be found. - *

- * @returns - * @protected - */ - onEditLabel():boolean; - /** - * Called when the {@link yfiles.input.TableEditorInputMode#keyboardInputMode} changed. - * @param oldMode The old {@link #keyboardInputMode}. - * @param newMode The new {@link #keyboardInputMode}. - * @protected - */ - onKeyboardInputModeChanged(oldMode:yfiles.input.KeyboardInputMode,newMode:yfiles.input.KeyboardInputMode):void; - /** - * Raises the {@link yfiles.input.TableEditorInputMode#addLabelAddedListener LabelAdded} event. - * @param evt The {@link } instance that contains the {@link } that has been added. - * @protected - */ - onLabelAdded(evt:yfiles.graph.LabelEventArgs):void; - /** - * Raises the {@link yfiles.input.TableEditorInputMode#addLabelAddingListener LabelAdding} event. - *

- * Invoking the event handlers stops once one event marks the evt as handled. - *

- * @param evt The event arguments. - * @protected - */ - onLabelAdding(evt:yfiles.input.LabelEditingEventArgs):void; - /** - * Raises the {@link yfiles.input.TableEditorInputMode#addLabelEditingListener LabelEditing} event. - *

- * Invoking the event handlers stops once one event marks the evt as handled. - *

- * @param evt The event arguments. - * @protected - */ - onLabelEditing(evt:yfiles.input.LabelEditingEventArgs):void; - /** - * Raises the {@link yfiles.input.TableEditorInputMode#addLabelTextChangedListener LabelTextChanged} event. - * @param evt The {@link } instance that contains the {@link } that has changed the text. - * @protected - */ - onLabelTextChanged(evt:yfiles.collections.ItemEventArgs):void; - /** - * Called when the text of a label has been {@link yfiles.input.TableEditorInputMode#editLabel edited}. - *

- * This method {@link yfiles.input.TableEditorInputMode#addValidateLabelTextListener validates the label text} and if successful sets the label text. - *

- * @param label The label that was edited. - * @param text The new text. - * @protected - */ - onLabelTextEdited(label:yfiles.graph.ILabel,text:string):void; - /** - * Raises the {@link yfiles.input.TableEditorInputMode#addLabelTextEditingCanceledListener LabelTextEditingCanceled} - * event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onLabelTextEditingCanceled(evt:yfiles.graph.LabelEventArgs):void; - /** - * Raises the {@link yfiles.input.TableEditorInputMode#addLabelTextEditingStartedListener LabelTextEditingStarted} - * event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onLabelTextEditingStarted(evt:yfiles.graph.LabelEventArgs):void; - /** - * Called when the {@link yfiles.input.TableEditorInputMode#reparentStripeHandler} property value changes and after initialization of the field. - * @param oldHandler the old value, which may be null the first time - * @param newHandler the new value - * @protected - */ - onReparentStripeHandlerChanged(oldHandler:yfiles.input.IReparentStripeHandler,newHandler:yfiles.input.IReparentStripeHandler):void; - /** - * Called when the {@link yfiles.input.TableEditorInputMode#reparentStripeInputMode} property value changes and after initialization of the field. - * @param oldHandler the old value, which may be null the first time - * @param newHandler the new value - * @protected - */ - onReparentStripeInputModeChanged(oldHandler:yfiles.input.ReparentStripeInputMode,newHandler:yfiles.input.ReparentStripeInputMode):void; - /** - * Called when the {@link yfiles.input.TableEditorInputMode#resizeStripeInputMode} property value changes and after initialization of the field. - * @param oldMode the old value, which may be null the first time - * @param newMode the new value - * @protected - */ - onResizeStripeInputModeChanged(oldMode:yfiles.input.ResizeStripeInputMode,newMode:yfiles.input.ResizeStripeInputMode):void; - /** - * Called when the {@link yfiles.input.TableEditorInputMode#stripeDropInputMode} property value changes and after initialization of the field. - * @param oldMode the old value, which may be null the first time - * @param newMode the new value - * @protected - */ - onStripeDropInputModeChanged(oldMode:yfiles.input.StripeDropInputMode,newMode:yfiles.input.StripeDropInputMode):void; - /** - * Called when the {@link yfiles.input.TableEditorInputMode#textEditorInputMode} property value changes and after initialization of the field. - * @param oldMode the old value, which may be null the first time - * @param newMode the new value - * @protected - */ - onTextEditorInputModeChanged(oldMode:yfiles.input.TextEditorInputMode,newMode:yfiles.input.TextEditorInputMode):void; - /** - * Raises the {@link yfiles.input.TableEditorInputMode#addValidateLabelTextListener ValidateLabelText} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onValidateLabelText(evt:yfiles.input.LabelTextValidatingEventArgs):void; - /** - * Clears the current selection and selects all stripes in all table instances. - *

- * By default, this method will be called in response to a Ctrl-A-key press recognized by {@link yfiles.input.TableEditorInputMode#keyboardInputMode}. - *

- * @see yfiles.input.ICommand#SELECT_ALL - * @see yfiles.input.TableEditorInputMode#selectableItems - */ - selectAll():void; - /** - * Predicate that determines whether a label may be added interactively to item - *

- * This is overridden if the item has a {@link yfiles.input.IEditLabelHelper} that returns false for its {@link yfiles.input.IEditLabelHelper#onLabelAdding} - * method. - *

- * @param item The item to query - * @returns true iff a label may be added - * @protected - */ - shouldAddLabel(item:yfiles.graph.IModelItem):boolean; - /** - * Callback method that determines whether the given item should be deleted during - * {@link yfiles.input.TableEditorInputMode#deleteSelection}. - *

- * This implementation deletes an item if it is of one of the {@link yfiles.input.TableEditorInputMode#deletableItems} type and if it is not the last stripe of a given type in the - * table (e.g. the only row or the only column). - *

- * @param stripe The item. - * @returns Whether to delete that item. - * @protected - */ - shouldDelete(stripe:yfiles.graph.IStripe):boolean; - /** - * Callback method that determines whether the label or the labels of the provided item should be edited in response to a - * command or explicit method call to {@link yfiles.input.TableEditorInputMode#editLabel} or - * {@link yfiles.input.TableEditorInputMode#createLabel}. - * @param item The item. - * @returns Whether to edit the label or the labels for that item. - * @protected - */ - shouldEditLabel(item:yfiles.graph.IModelItem):boolean; - /** - * Callback method that is used by {@link yfiles.input.TableEditorInputMode#onKeyboardInputModeChanged} to determine which of the - * built-in {@link yfiles.input.ICommand}s to install. - *

- * This implementation unconditionally returns true, subclasses may override this method to adjust the behavior. - *

- * @param command The command to install. - * @returns Whether to install this command. - * @protected - */ - shouldInstallCommand(command:yfiles.input.ICommand):boolean; - /** - * Gets or sets the {@link yfiles.input.ResizeStripeInputMode} that is used to change the size of a stripe interactively. - *

- * The mode by default is {@link yfiles.input.ResizeStripeInputMode#enabled enabled} with a priority of 0. If the field has not yet been initialized upon first access, the - * factory method {@link yfiles.input.TableEditorInputMode#createResizeStripeInputMode} will be called. Upon change the {@link yfiles.input.TableEditorInputMode#onResizeStripeInputModeChanged} - * method will be called. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @type {yfiles.input.ResizeStripeInputMode} - */ - resizeStripeInputMode:yfiles.input.ResizeStripeInputMode; - /** - * Gets or sets the {@link yfiles.input.TableEditorInputMode#reparentStripeHandler} property. - *

- * This handler will be delegated to by an implementation of the {@link yfiles.input.IReparentStripeHandler} interface that this - * class puts into the {@link yfiles.input.TableEditorInputMode#childInputModeContextLookup}. If the field has not yet been - * initialized upon first access, the factory method {@link yfiles.input.TableEditorInputMode#createReparentStripeHandler} will be - * called. Upon change the {@link yfiles.input.TableEditorInputMode#onReparentStripeHandlerChanged} method will be called. - *

- * @see yfiles.input.ReparentStripeHandler - * @type {yfiles.input.IReparentStripeHandler} - */ - reparentStripeHandler:yfiles.input.IReparentStripeHandler; - /** - * Gets or sets the {@link yfiles.input.ReparentStripeInputMode} that is used to change a stripes position in the table hierarchy. - *

- * The mode by default is {@link yfiles.input.MoveInputMode#enabled enabled} with a priority of 0. If the field has not yet been initialized upon first access, the - * factory method {@link yfiles.input.TableEditorInputMode#createReparentStripeInputMode} will be called. Upon change the {@link yfiles.input.TableEditorInputMode#onReparentStripeInputModeChanged} - * method will be called. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @type {yfiles.input.ReparentStripeInputMode} - */ - reparentStripeInputMode:yfiles.input.ReparentStripeInputMode; - /** - * Gets or sets the {@link yfiles.input.TableEditorInputMode#stripeDropInputMode} property that is responsible for handling drag and drop operations of stripes onto the Canvas. - *

- * The mode by default is {@link yfiles.input.DropInputMode#enabled disabled} and needs to be enabled to work, first. If the field has not yet been initialized upon - * first access, the factory method {@link yfiles.input.TableEditorInputMode#createStripeDropInputMode} will be called. Upon change - * the {@link yfiles.input.TableEditorInputMode#onStripeDropInputModeChanged} method will be called. - *

- *

- * By default this input mode has a priority of 70. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @type {yfiles.input.StripeDropInputMode} - */ - stripeDropInputMode:yfiles.input.StripeDropInputMode; - /** - * Gets or sets the {@link yfiles.input.TableEditorInputMode#keyboardInputMode}. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.TableEditorInputMode#createKeyboardInputMode} - * will be called. Upon change the {@link yfiles.input.TableEditorInputMode#onKeyboardInputModeChanged} method will be called. If - * the parent {@link yfiles.input.TableEditorInputMode} instance is installed as child mode of a {@link yfiles.input.GraphEditorInputMode} - * instance, this mode is not used, since all work is delegated to the parent's {@link yfiles.input.GraphInputMode#keyboardInputMode} instance. This implies that all modifications - * made to the property value have no effect as long as the parent mode is child of a {@link yfiles.input.GraphEditorInputMode} - * instance. - *

- *

- * By default this input mode has a priority of 0. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @type {yfiles.input.KeyboardInputMode} - */ - keyboardInputMode:yfiles.input.KeyboardInputMode; - /** - * Gets or sets the {@link yfiles.input.TableEditorInputMode#textEditorInputMode}. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.TableEditorInputMode#createTextEditorInputMode} - * will be called. Upon change the {@link yfiles.input.TableEditorInputMode#onTextEditorInputModeChanged} method will be called. If - * the parent {@link yfiles.input.TableEditorInputMode} instance is installed as child mode of a {@link yfiles.input.GraphEditorInputMode} - * instance, this mode is not used, since all work is delegated to the parent's {@link yfiles.input.GraphEditorInputMode#textEditorInputMode} instance. This implies that all modifications - * made to the property value have no effect as long as the parent mode is child of a {@link yfiles.input.GraphEditorInputMode} - * instance. - *

- *

- * By default this input mode has a priority of 100. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @type {yfiles.input.TextEditorInputMode} - */ - textEditorInputMode:yfiles.input.TextEditorInputMode; - /** - * Gets or set a property that determines which types of items may have their {@link yfiles.input.TableEditorInputMode#editLabel labels edited}. - *

- * The default is {@link yfiles.graph.StripeTypes#ALL} which allows for editing the labels of all {@link yfiles.graph.ILabelOwner}s, and - * existing {@link yfiles.graph.ILabel}s. - *

- * @see yfiles.input.TableEditorInputMode#shouldEditLabel - * @type {yfiles.graph.StripeTypes} - */ - labelEditableItems:yfiles.graph.StripeTypes; - /** - * Adds the given listener for the LabelAdding event that occurs when a label is about to be added. - *

- * Event handlers for this event can customize the behavior for adding a new label extensively. Adding a label can be - * forbidden entirely, or the properties of the added label can be changed, by setting the appropriate properties on the - * {@link yfiles.input.LabelEditingEventArgs}. It is even possible to forbid adding a label, but edit an existing one instead. - *

- * @param listener The listener to add. - * @see yfiles.input.TableEditorInputMode#removeLabelAddingListener - */ - addLabelAddingListener(listener:(sender:any,evt:yfiles.input.LabelEditingEventArgs)=>void):void; - /** - * Removes the given listener for the LabelAdding event that occurs when a label is about to be added. - *

- * Event handlers for this event can customize the behavior for adding a new label extensively. Adding a label can be - * forbidden entirely, or the properties of the added label can be changed, by setting the appropriate properties on the - * {@link yfiles.input.LabelEditingEventArgs}. It is even possible to forbid adding a label, but edit an existing one instead. - *

- * @param listener The listener to remove. - * @see yfiles.input.TableEditorInputMode#addLabelAddingListener - */ - removeLabelAddingListener(listener:(sender:any,evt:yfiles.input.LabelEditingEventArgs)=>void):void; - /** - * Adds the given listener for the LabelEditing event that occurs when a label is about to be edited. - *

- * Event handlers for this event can customize the behavior for editing an existing label. Editing can be forbidden - * entirely, or redirected to a different label, even on a different owner. In case editing existing labels is unwanted, - * event handlers can also specify that instead of editing a label, a new one should be added. - *

- * @param listener The listener to add. - * @see yfiles.input.TableEditorInputMode#removeLabelEditingListener - */ - addLabelEditingListener(listener:(sender:any,evt:yfiles.input.LabelEditingEventArgs)=>void):void; - /** - * Removes the given listener for the LabelEditing event that occurs when a label is about to be edited. - *

- * Event handlers for this event can customize the behavior for editing an existing label. Editing can be forbidden - * entirely, or redirected to a different label, even on a different owner. In case editing existing labels is unwanted, - * event handlers can also specify that instead of editing a label, a new one should be added. - *

- * @param listener The listener to remove. - * @see yfiles.input.TableEditorInputMode#addLabelEditingListener - */ - removeLabelEditingListener(listener:(sender:any,evt:yfiles.input.LabelEditingEventArgs)=>void):void; - /** - * Adds the given listener for the LabelAdded event that occurs when this mode has triggered the addition of an - * {@link yfiles.graph.ILabel}, for instance, in response to {@link yfiles.input.TableEditorInputMode#createLabel}. - * @param listener The listener to add. - * @see yfiles.input.TableEditorInputMode#removeLabelAddedListener - */ - addLabelAddedListener(listener:(sender:any,evt:yfiles.graph.LabelEventArgs)=>void):void; - /** - * Removes the given listener for the LabelAdded event that occurs when this mode has triggered the addition of an - * {@link yfiles.graph.ILabel}, for instance, in response to {@link yfiles.input.TableEditorInputMode#createLabel}. - * @param listener The listener to remove. - * @see yfiles.input.TableEditorInputMode#addLabelAddedListener - */ - removeLabelAddedListener(listener:(sender:any,evt:yfiles.graph.LabelEventArgs)=>void):void; - /** - * Adds the given listener for the LabelTextChanged event that occurs when this mode has triggered the edit of an - * {@link yfiles.graph.ILabel}, for instance, in response to {@link yfiles.input.TableEditorInputMode#editLabel}. - * @param listener The listener to add. - * @see yfiles.input.TableEditorInputMode#removeLabelTextChangedListener - */ - addLabelTextChangedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the LabelTextChanged event that occurs when this mode has triggered the edit of an - * {@link yfiles.graph.ILabel}, for instance, in response to {@link yfiles.input.TableEditorInputMode#editLabel}. - * @param listener The listener to remove. - * @see yfiles.input.TableEditorInputMode#addLabelTextChangedListener - */ - removeLabelTextChangedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the LabelTextEditingStarted event that occurs when the actual label editing process is about - * to start. - *

- * This allows to customize the actual label editing process further. - *

- * @param listener The listener to add. - * @see yfiles.input.TableEditorInputMode#onValidateLabelText - * @see yfiles.input.TableEditorInputMode#removeLabelTextEditingStartedListener - */ - addLabelTextEditingStartedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the LabelTextEditingStarted event that occurs when the actual label editing process is - * about to start. - *

- * This allows to customize the actual label editing process further. - *

- * @param listener The listener to remove. - * @see yfiles.input.TableEditorInputMode#onValidateLabelText - * @see yfiles.input.TableEditorInputMode#addLabelTextEditingStartedListener - */ - removeLabelTextEditingStartedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the LabelTextEditingCanceled event that occurs when the actual label editing process is - * canceled. - *

- * This allows to revert temporary customizations for the actual label editing process. - *

- * @param listener The listener to add. - * @see yfiles.input.TableEditorInputMode#onValidateLabelText - * @see yfiles.input.TableEditorInputMode#removeLabelTextEditingCanceledListener - */ - addLabelTextEditingCanceledListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the LabelTextEditingCanceled event that occurs when the actual label editing process is - * canceled. - *

- * This allows to revert temporary customizations for the actual label editing process. - *

- * @param listener The listener to remove. - * @see yfiles.input.TableEditorInputMode#onValidateLabelText - * @see yfiles.input.TableEditorInputMode#addLabelTextEditingCanceledListener - */ - removeLabelTextEditingCanceledListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the ValidateLabelText event that occurs after label editing to validate the label text for a - * label that is about to be added or edited. - *

- * Note that the {@link yfiles.input.LabelTextValidatingEventArgs#label} may only a dummy instance, i.e. not bound to a live stripe instance. - *

- * @param listener The listener to add. - * @see yfiles.input.TableEditorInputMode#onValidateLabelText - * @see yfiles.input.TableEditorInputMode#removeValidateLabelTextListener - */ - addValidateLabelTextListener(listener:(sender:any,evt:yfiles.input.LabelTextValidatingEventArgs)=>void):void; - /** - * Removes the given listener for the ValidateLabelText event that occurs after label editing to validate the label text - * for a label that is about to be added or edited. - *

- * Note that the {@link yfiles.input.LabelTextValidatingEventArgs#label} may only a dummy instance, i.e. not bound to a live stripe instance. - *

- * @param listener The listener to remove. - * @see yfiles.input.TableEditorInputMode#onValidateLabelText - * @see yfiles.input.TableEditorInputMode#addValidateLabelTextListener - */ - removeValidateLabelTextListener(listener:(sender:any,evt:yfiles.input.LabelTextValidatingEventArgs)=>void):void; - /** - * Gets or sets a value indicating whether this mode should automatically {@link yfiles.graph.ITable#remove remove labels} from the table when a label text - * has been edited and the label text is empty. - *

- * If the {@link yfiles.input.TableEditorInputMode} instance is installed as child mode of a {@link yfiles.input.GraphEditorInputMode} - * instance, auto removal is only enabled allowed if both the value of this property and the value of {@link yfiles.input.GraphEditorInputMode#autoRemoveEmptyLabels} are true. - *

- * @default true - * @type {boolean} - */ - autoRemoveEmptyLabels:boolean; - /** - * Gets or sets the {@link yfiles.input.TableEditorInputMode#clickInputMode}. - *

- * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.TableEditorInputMode#createClickInputMode} - * will be called. Upon change the {@link yfiles.input.TableEditorInputMode#onClickInputModeChanged} method will be called. If the - * parent {@link yfiles.input.TableEditorInputMode} instance is installed as child mode of a {@link yfiles.input.GraphEditorInputMode} - * instance, this mode is not used, since all work is delegated to the parent's {@link yfiles.input.GraphInputMode#clickInputMode} instance. This implies that all modifications - * made to the property value have no effect as long as the parent mode is child of a {@link yfiles.input.GraphEditorInputMode} - * instance. - *

- *

- * By default this input mode has a priority of 0. - *

- * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install installed}. To exchange a mode, first - * {@link yfiles.input.IInputMode#uninstall}, then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. - * @type {yfiles.input.ClickInputMode} - */ - clickInputMode:yfiles.input.ClickInputMode; - /** - * Adds the given listener for the DeletingSelection event that occurs just before the {@link yfiles.input.TableEditorInputMode#deleteSelection} - * method starts its work and will be followed by any number of {@link yfiles.input.TableEditorInputMode#addDeletedItemListener DeletedItem} - * events and finalized by a {@link yfiles.input.TableEditorInputMode#addDeletedSelectionListener DeletedSelection} - * event. - * @param listener The listener to add. - * @see yfiles.input.TableEditorInputMode#deleteSelection - * @see yfiles.input.TableEditorInputMode#removeDeletingSelectionListener - */ - addDeletingSelectionListener(listener:(sender:any,evt:yfiles.input.SelectionEventArgs)=>void):void; - /** - * Removes the given listener for the DeletingSelection event that occurs just before the {@link yfiles.input.TableEditorInputMode#deleteSelection} - * method starts its work and will be followed by any number of {@link yfiles.input.TableEditorInputMode#addDeletedItemListener DeletedItem} - * events and finalized by a {@link yfiles.input.TableEditorInputMode#addDeletedSelectionListener DeletedSelection} - * event. - * @param listener The listener to remove. - * @see yfiles.input.TableEditorInputMode#deleteSelection - * @see yfiles.input.TableEditorInputMode#addDeletingSelectionListener - */ - removeDeletingSelectionListener(listener:(sender:any,evt:yfiles.input.SelectionEventArgs)=>void):void; - /** - * Adds the given listener for the DeletedItem event that occurs when an item has been deleted interactively by this mode. - * @param listener The listener to add. - * @see yfiles.input.TableEditorInputMode#removeDeletedItemListener - */ - addDeletedItemListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the DeletedItem event that occurs when an item has been deleted interactively by this - * mode. - * @param listener The listener to remove. - * @see yfiles.input.TableEditorInputMode#addDeletedItemListener - */ - removeDeletedItemListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the DeletedSelection event that occurs just before the {@link yfiles.input.TableEditorInputMode#deleteSelection} - * method has deleted the selection after all selected items have been removed. - * @param listener The listener to add. - * @see yfiles.input.TableEditorInputMode#deleteSelection - * @see yfiles.input.TableEditorInputMode#removeDeletedSelectionListener - */ - addDeletedSelectionListener(listener:(sender:any,evt:yfiles.input.SelectionEventArgs)=>void):void; - /** - * Removes the given listener for the DeletedSelection event that occurs just before the {@link yfiles.input.TableEditorInputMode#deleteSelection} - * method has deleted the selection after all selected items have been removed. - * @param listener The listener to remove. - * @see yfiles.input.TableEditorInputMode#deleteSelection - * @see yfiles.input.TableEditorInputMode#addDeletedSelectionListener - */ - removeDeletedSelectionListener(listener:(sender:any,evt:yfiles.input.SelectionEventArgs)=>void):void; - /** - * Gets or set a property that determines which types of items may be deleted using the {@link yfiles.input.TableEditorInputMode#deleteSelection} - * action. - *

- * The default is {@link yfiles.graph.GraphItemTypes#ALL}. - *

- * @see yfiles.input.TableEditorInputMode#shouldDelete - * @type {yfiles.graph.StripeTypes} - */ - deletableItems:yfiles.graph.StripeTypes; - /** - * Gets or set a property that determines which types of items should be selectable at all. - *

- * The default is {@link yfiles.graph.StripeTypes#ALL}. - *

- * @see yfiles.input.GraphInputMode#setSelected - * @type {yfiles.graph.StripeTypes} - */ - selectableItems:yfiles.graph.StripeTypes; - /** - * Gets or set a property that determines which types of items should be selectable through {@link yfiles.input.TableEditorInputMode#onClickInputModeClicked mouse clicks.}. - *

- * The default is {@link yfiles.graph.StripeTypes#ALL}. - *

- * @see yfiles.input.GraphInputMode#setSelected - * @type {yfiles.graph.StripeTypes} - */ - clickSelectableItems:yfiles.graph.StripeTypes; - /** - * Gets or sets whether the label editor will be automatically invoked if the F2 key is pressed. - *

- * If the {@link yfiles.input.TableEditorInputMode} instance is installed as child mode of a {@link yfiles.input.GraphEditorInputMode} - * instance, editing a label is only allowed if both the value of this property and the value of {@link yfiles.input.GraphEditorInputMode#allowEditLabel} are - * true. If label editing is allowed, pressing F2 will start the label editor. By default this feature is enabled. - *

- * @see yfiles.input.TableEditorInputMode#editLabel - * @default true - * @type {boolean} - */ - allowEditLabel:boolean; - /** - * Gets or sets whether the label editor will be automatically invoked if the Shift+F2 key is pressed. - *

- * If the {@link yfiles.input.TableEditorInputMode} instance is installed as child mode of a {@link yfiles.input.GraphEditorInputMode} - * instance, adding a label is only allowed if both the value of this property and the value of {@link yfiles.input.GraphEditorInputMode#allowAddLabel} are true. If label adding - * is allowed, true pressing Shift+F2 will start the label editor. By default this feature is enabled. - *

- * @see yfiles.input.TableEditorInputMode#createLabel - * @default true - * @type {boolean} - */ - allowAddLabel:boolean; - /** - * Gets or sets the event recognizer that will be queried to decide if a click is deemed a multi selection gesture. - *

- * The default is a combination of {@link yfiles.input.KeyEventRecognizers#CONTROL_PRESSED} or - * {@link yfiles.input.KeyEventRecognizers#META_PRESSED}. If the {@link yfiles.input.TableEditorInputMode} instance is installed as child - * mode of a {@link yfiles.input.GraphEditorInputMode} instance, the value of {@link yfiles.input.GraphInputMode#multiSelectionRecognizer} is used instead. - *

- * @type {function(any, yfiles.lang.EventArgs): boolean} - */ - multiSelectionRecognizer:(eventSource:any,evt:yfiles.lang.EventArgs)=>boolean; - /** - * Gets or sets clicks on which {@link yfiles.input.StripeSubregionTypes}(s) should toggle a stripe selection state. - *

- * This is independent to {@link yfiles.input.TableEditorInputMode#clickSelectableItems}. By default, only clicks on a stripe {@link yfiles.input.StripeSubregionTypes#HEADER} are handled. - *

- * @default yfiles.input.StripeSubregionTypes.HEADER - * @type {yfiles.input.StripeSubregionTypes} - */ - clickSelectableRegions:yfiles.input.StripeSubregionTypes; - /** - * Gets or sets a value indicating whether {@link yfiles.input.TableEditorInputMode#stripeSelection} should be synchronized with the {@link yfiles.input.GraphInputMode#graphSelection} if this instance is installed as a child of a - * {@link yfiles.input.GraphEditorInputMode} instance. - *

- * This feature needs to be disabled temporarily if the {@link yfiles.view.GraphComponent#selection} is changed. - *

- *

- * By default, this feature is enabled. - *

- * @default true - * @type {boolean} - */ - synchronizeWithGraphSelection:boolean; - /** - * Gets or sets whether to allow mixed selections of graph elements and table elements - *

- * Default is true. Changing this property only has an effetc if {@link yfiles.input.TableEditorInputMode#synchronizeWithGraphSelection} is enabled. - *

- * @type {boolean} - */ - allowMixedSelection:boolean; - /** - * Gets the {@link yfiles.view.IStripeSelection selected stripes} - * @type {yfiles.view.IStripeSelection} - */ - stripeSelection:yfiles.view.IStripeSelection; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.TableEditorInputMode; - } - /** - * {@link yfiles.input.IReshapeHandler} implementation that constrains node resizes so that minimum size constraints of an - * associated {@link yfiles.graph.ITable} are satisfied and which resizes the outer - * {@link yfiles.graph.IStripe}s of such a table when the node is resized. - *

- * The constraints are applied in addition to any constraints imposed by the {@link yfiles.input.IReshapeHandler} which is wrapped - * by this implementation. - *

- * @class - * @implements {yfiles.input.IReshapeHandler} - */ - export interface TableReshapeHandler extends yfiles.lang.Object,yfiles.input.IReshapeHandler{} - export class TableReshapeHandler { - /** - * Creates a new instance of this Handler which wraps an existing instance of coreHandler and uses table for additional - * constraints. - *

- * In addition, table's outer stripes are resized if necessary. - *

- *

- * table should be associated to tableNode - *

- * @param coreHandler The handler that is wrapped by this instance. - * @param tableNode The node for which this handler is used - * @param table The table that is used for additional constraints. - */ - constructor(coreHandler:yfiles.input.IReshapeHandler,tableNode:yfiles.graph.INode,table:yfiles.graph.ITable); - /** - * - * @param context - * @param originalBounds - */ - cancelReshape(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect):void; - /** - * - * @param context - * @param originalBounds - * @param newBounds - */ - handleReshape(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect,newBounds:yfiles.geometry.Rect):void; - /** - * - * @param context - */ - initializeReshape(context:yfiles.input.IInputModeContext):void; - /** - * - * @param context - * @param originalBounds - * @param newBounds - */ - reshapeFinished(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect,newBounds:yfiles.geometry.Rect):void; - /** - * Gets the core reshape handler wrapped by this instance. - * @type {yfiles.input.IReshapeHandler} - */ - coreHandler:yfiles.input.IReshapeHandler; - /** - * Gets the node this handler is used for. - * @type {yfiles.graph.INode} - */ - tableNode:yfiles.graph.INode; - /** - * Gets the table used for additional constraints. - * @type {yfiles.graph.ITable} - */ - table:yfiles.graph.ITable; - /** - * - * @type {yfiles.geometry.IRectangle} - */ - bounds:yfiles.geometry.IRectangle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.TableReshapeHandler; - } - export enum StripeReparentPolicy{ - /** - * Add the moved stripe as a new child of the target stripe - */ - ADD_CHILD, - /** - * Insert the moved stripe before the target stripe - */ - INSERT_BEFORE, - /** - * Insert the moved stripe after the target stripe - */ - INSERT_AFTER, - /** - * The current gesture would result in an invalid operation (such as trying to make a stripe to its own child). - */ - INVALID - } - /** - * Helper interface that allows to bundle {@link yfiles.input.IHitTestable} implementations for the main regions of a {@link yfiles.graph.IStripe} - * instance. - *

- * The default {@link yfiles.graph.IRow} and {@link yfiles.graph.IColumn} implementations provide default implementations of this - * interface. - *

- * @interface - */ - export interface IStripeHitTestHelper extends yfiles.lang.Object{ - /** - * Return a {@link yfiles.input.IHitTestable} that should report hits on the far border region of the stripe. - *

- * The far border is the region that is used for the resize gesture in {@link yfiles.input.ResizeStripeInputMode} to expand the - * stripe to the bottom or the right. This is typically the bottom border for an {@link yfiles.graph.IRow} instance and the right - * border for an {@link yfiles.graph.IColumn}. - *

- * @returns a {@link } that should report hits on the far border region of the stripe. - * @see yfiles.input.StripeSubregion - * @see yfiles.input.StripeSubregionTypes#FAR_BORDER - * @abstract - */ - getFarBorderHitTestable():yfiles.input.IHitTestable; - /** - * Return a {@link yfiles.input.IHitTestable} that should report hits on the leading header region of the stripe. - *

- * The leading header is the region that is used by default for click selection and as start location for a stripe drag. - * Typically, this is the area occupied by the left insets for an {@link yfiles.graph.IRow} instance and by the top insets for an {@link yfiles.graph.IColumn} - * instance. - *

- * @returns a {@link } that should report hits on the header region of the stripe. - * @see yfiles.input.StripeSubregion - * @see yfiles.input.StripeSubregionTypes#HEADER - * @abstract - */ - getLeadingHeaderHitTestable():yfiles.input.IHitTestable; - /** - * Return a {@link yfiles.input.IHitTestable} that should report hits on the near border region of the stripe. - *

- * The near border is the region that is used for the resize gesture in {@link yfiles.input.ResizeStripeInputMode} to expand the - * stripe to the top or the left. This is typically the upper border for an {@link yfiles.graph.IRow} instance and the left border - * for an {@link yfiles.graph.IColumn}. - *

- * @returns a {@link } that should report hits on the near border region of the stripe. - * @see yfiles.input.StripeSubregion - * @see yfiles.input.StripeSubregionTypes#NEAR_BORDER - * @abstract - */ - getNearBorderHitTestable():yfiles.input.IHitTestable; - /** - * Return a {@link yfiles.input.IHitTestable} that should report hits on the whole stripe. - * @returns a {@link } that should report hits on the whole stripe. - * @see yfiles.input.StripeSubregion - * @see yfiles.input.StripeSubregionTypes#STRIPE - * @abstract - */ - getStripeHitTestable():yfiles.input.IHitTestable; - /** - * Return a {@link yfiles.input.IHitTestable} that should report hits on the trailing header region of the stripe. - *

- * The trailing header is the region that is used by default for click selection and as start location for a stripe drag. - * Typically, this is the area occupied by the right insets for an {@link yfiles.graph.IRow} instance and by the bottom insets for - * an {@link yfiles.graph.IColumn} instance. - *

- * @returns a {@link } that should report hits on the header region of the stripe. - * @see yfiles.input.StripeSubregion - * @see yfiles.input.StripeSubregionTypes#HEADER - * @abstract - */ - getTrailingHeaderHitTestable():yfiles.input.IHitTestable; - } - var IStripeHitTestHelper:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IStripeHitTestHelper; - }; - export enum StripeSubregionTypes{ - /** - * No active hotspot region. - */ - NONE, - /** - * The hot spot region includes the stripe itself. - * @see yfiles.input.IStripeHitTestHelper#getStripeHitTestable - */ - STRIPE, - /** - * The hot spot region includes the leading stripe header. - *

- * The leading header is the region that is used by default for click selection and as start location for a stripe drag. - * Typically, this is the area occupied by the left insets for an {@link yfiles.graph.IRow} instance and by the top insets for an {@link yfiles.graph.IColumn} - * instance. - *

- * @see yfiles.input.IStripeHitTestHelper#getLeadingHeaderHitTestable - */ - LEADING_HEADER, - /** - * The hot spot region includes the trailing stripe header. - *

- * The trailing header is the region that is used by default for click selection and as start location for a stripe drag. - * Typically, this is the area occupied by the right insets for an {@link yfiles.graph.IRow} instance and by the bottom insets for - * an {@link yfiles.graph.IColumn} instance. - *

- * @see yfiles.input.IStripeHitTestHelper#getTrailingHeaderHitTestable - */ - TRAILING_HEADER, - /** - * The hot spot region includes both stripe headers. - *

- * This is a bitwise combination of {@link yfiles.input.StripeSubregionTypes#LEADING_HEADER} and - * {@link yfiles.input.StripeSubregionTypes#TRAILING_HEADER} - *

- * @see yfiles.input.IStripeHitTestHelper#getTrailingHeaderHitTestable - */ - HEADER, - /** - * The hot spot region includes the near-border region of the stripe. - *

- * The near border is the region that is used for the resize gesture in {@link yfiles.input.ResizeStripeInputMode} to expand the - * stripe to the top or the left. This is typically the upper border for an {@link yfiles.graph.IRow} instance and the left border - * for an {@link yfiles.graph.IColumn}. - *

- * @see yfiles.input.IStripeHitTestHelper#getNearBorderHitTestable - */ - NEAR_BORDER, - /** - * The hot spot region includes the stripe far-border region. - *

- * The far border is the region that is used for the resize gesture in {@link yfiles.input.ResizeStripeInputMode} to expand the - * stripe to the bottom or the right. This is typically the bottom border for an {@link yfiles.graph.IRow} instance and the right - * border for an {@link yfiles.graph.IColumn}. - *

- * @see yfiles.input.IStripeHitTestHelper#getFarBorderHitTestable - */ - FAR_BORDER, - /** - * Flag for any stripe region. - */ - ALL - } - /** - * Helper class that further describes the result of a hit test on a stripe or table. - *

- * Instances of this class are returned by the default {@link yfiles.input.StripeHitTester} implementation. - *

- * @class - * @final - */ - export interface StripeSubregion extends yfiles.lang.Object{} - export class StripeSubregion { - /** - * Create a new instance that describes the specific subregion. - * @param subregionType The specific subregion - * @param stripe The stripe - */ - constructor(subregionType:yfiles.input.StripeSubregionTypes,stripe:yfiles.graph.IStripe); - /** - * Gets the specific subregion type that this instance describes. - * @type {yfiles.input.StripeSubregionTypes} - */ - subregionType:yfiles.input.StripeSubregionTypes; - /** - * Gets the stripe that this instance describes. - * @type {yfiles.graph.IStripe} - */ - stripe:yfiles.graph.IStripe; - /** - * Gets or sets the node the region is associated to. - *

- * This property is not null only is this instance was returned by - * {@link yfiles.input.ReparentStripePositionHandler#getTargetSubregion}. Otherwise, especially if this instance was returned by - * {@link yfiles.graph.ITable#findStripe}, it is null. In this case, you can get the table from the {@link yfiles.input.StripeSubregion#stripe} of this instance. - *

- * @type {yfiles.graph.INode} - */ - targetTableNode:yfiles.graph.INode; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.StripeSubregion; - } - /** - * Default implementation of {@link yfiles.input.IStripeInputVisualizationHelper} that uses - * {@link yfiles.view.IVisualTemplate}s for the actual visualization. - *

- * If you want to change the global behavior, you can just provide a different {@link yfiles.view.IVisualTemplate} for the various - * predefined template keys in the application resources. If you want to override the visualization for a specific stripe - * only, assign a different {@link yfiles.view.IVisualTemplate} to the instance that is already present in the stripe's lookup. - *

- * @class - * @implements {yfiles.input.IStripeInputVisualizationHelper} - */ - export interface DefaultStripeInputVisualizationHelper extends yfiles.lang.Object,yfiles.input.IStripeInputVisualizationHelper{} - export class DefaultStripeInputVisualizationHelper { - /** - * Default constructor - * @param stripe The stripe for which the visualizations are intended - */ - constructor(stripe:yfiles.graph.IStripe); - /** - * Provide a {@link yfiles.view.IVisualTemplate} that is used to visualize type. - * @param context The input mode context. Allows you to access the {@link } to retrieve the resources. - * @param type The visualization type - * @returns A {@link } that is used to visualize type. - * @protected - */ - findTemplate(context:yfiles.input.IInputModeContext,type:yfiles.input.StripeVisualizationType):yfiles.view.IVisualTemplate; - /** - * Return an {@link yfiles.view.IVisualCreator} that is used to visualize the input operation specified by type. - *

- * This implementation uses {@link yfiles.view.IVisualTemplate}s for the actual visualization. - *

- * @param context The input mode context which provides further information. - * @param tableNode The node where the stripe's owner is currently bound to. - * @param type The actual visualization type - * @returns A {@link } instance that renders a representation for the current operation. - * @see yfiles.input.DefaultStripeInputVisualizationHelper#resizeStripeTemplate - */ - getVisualCreator(context:yfiles.input.IInputModeContext,tableNode:yfiles.graph.INode,type:yfiles.input.StripeVisualizationType):yfiles.view.IVisualCreator; - /** - * A {@link string} that can be used to store a {@link yfiles.view.IVisualTemplate} that can be used to create the visual that will be used to - * draw the highlight for the stripe that is resized. - *

- * This template is used for {@link yfiles.input.StripeVisualizationType#RESIZE} - *

- * @see yfiles.input.DefaultStripeInputVisualizationHelper#getVisualCreator - * @const - * @static - * @type {string} - */ - static RESIZE_STRIPE_TEMPLATE_KEY:string; - /** - * Gets or sets the {@link yfiles.view.IVisualTemplate} that is used to visualize the current stripe resize operation. - *

- * This template is used for {@link yfiles.input.StripeVisualizationType#RESIZE} - *

- * @see yfiles.input.DefaultStripeInputVisualizationHelper#getVisualCreator - * @type {yfiles.view.IVisualTemplate} - */ - resizeStripeTemplate:yfiles.view.IVisualTemplate; - /** - * A {@link string} that can be used to store a {@link yfiles.view.IVisualTemplate} that can be used to create the visual that will be used to - * draw the highlight for the stripe that is selected. - *

- * This template is used for {@link yfiles.input.StripeVisualizationType#SELECTION} - *

- * @see yfiles.input.DefaultStripeInputVisualizationHelper#getVisualCreator - * @const - * @static - * @type {string} - */ - static SELECTED_STRIPE_TEMPLATE_KEY:string; - /** - * Gets or sets the {@link yfiles.view.IVisualTemplate} that is used to visualize the current stripe selection operation. - *

- * This template is used for {@link yfiles.input.StripeVisualizationType#SELECTION} - *

- * @see yfiles.input.DefaultStripeInputVisualizationHelper#getVisualCreator - * @type {yfiles.view.IVisualTemplate} - */ - selectedStripeTemplate:yfiles.view.IVisualTemplate; - /** - * A {@link string} that can be used to store a {@link yfiles.view.IVisualTemplate} that can be used to create the visual that will be used to - * draw the highlight for the current source of a stripe reparent operation. - *

- * This template is used for {@link yfiles.input.StripeVisualizationType#DRAG_SOURCE} - *

- * @see yfiles.input.DefaultStripeInputVisualizationHelper#getVisualCreator - * @const - * @static - * @type {string} - */ - static DRAG_SOURCE_STRIPE_TEMPLATE_KEY:string; - /** - * Gets or sets the {@link yfiles.view.IVisualTemplate} that is used to visualize the current source of a stripe reparent - * operation. - *

- * This template is used for {@link yfiles.input.StripeVisualizationType#DRAG_SOURCE} - *

- * @see yfiles.input.DefaultStripeInputVisualizationHelper#getVisualCreator - * @type {yfiles.view.IVisualTemplate} - */ - dragSourceStripeTemplate:yfiles.view.IVisualTemplate; - /** - * A {@link string} that can be used to store a {@link yfiles.view.IVisualTemplate} that can be used to create the visual that will be used to - * draw the highlight for the current target of a stripe reparent operation. - *

- * This template is used for {@link yfiles.input.StripeVisualizationType#DROP_TARGET} - *

- * @see yfiles.input.DefaultStripeInputVisualizationHelper#getVisualCreator - * @const - * @static - * @type {string} - */ - static DROP_TARGET_STRIPE_TEMPLATE_KEY:string; - /** - * Gets or sets the {@link yfiles.view.IVisualTemplate} that is used to visualize the current target of a stripe reparent - * operation. - *

- * This template is used for {@link yfiles.input.StripeVisualizationType#DROP_TARGET} - *

- * @see yfiles.input.DefaultStripeInputVisualizationHelper#getVisualCreator - * @type {yfiles.view.IVisualTemplate} - */ - dropTargetStripeTemplate:yfiles.view.IVisualTemplate; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.DefaultStripeInputVisualizationHelper; - } - export enum StripeVisualizationType{ - /** - * Visualization for a selected stripe. - */ - SELECTION, - /** - * Visualization for the source stripe of a reparent operation. - * @see yfiles.input.ReparentStripeInputMode - */ - DRAG_SOURCE, - /** - * Visualization for the target stripe of a reparent or drag and drop operation. - * @see yfiles.input.ReparentStripeInputMode - * @see yfiles.input.StripeDropInputMode - */ - DROP_TARGET, - /** - * Visualization for resize operations that are triggered for example by {@link yfiles.input.ResizeStripeInputMode} - */ - RESIZE - } - /** - * This interface allows to change the visualization for different input gestures. - *

- * A stripe should provide an implementation of this interface in its lookup which is queried by the various table related - * input modes. - *

- * @interface - */ - export interface IStripeInputVisualizationHelper extends yfiles.lang.Object{ - /** - * Return an {@link yfiles.view.IVisualCreator} that is used to visualize the input operation specified by type. - * @param context The input mode context which provides further information. - * @param tableNode The node where the stripe's owner is currently bound to. - * @param type The actual visualization type - * @returns A {@link } instance that renders a representation for the current operation. - * @abstract - */ - getVisualCreator(context:yfiles.input.IInputModeContext,tableNode:yfiles.graph.INode,type:yfiles.input.StripeVisualizationType):yfiles.view.IVisualCreator; - } - var IStripeInputVisualizationHelper:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.input.IStripeInputVisualizationHelper; - }; - /** - * Support class that allows to iterate over hits on table elements or subregions of table elements. - * @class - */ - export interface StripeHitTester extends yfiles.lang.Object{} - export class StripeHitTester { - /** - * Create a new instance for a specific table instance that use the order specified by tableRenderingOrder to determine the - * order of the hit test results. - * @param table The table to use - * @param tableRenderingOrder The hit test order. This determines the order in which stripes are returned by - * {@link #enumerateHits} - */ - constructor(table:yfiles.graph.ITable,tableRenderingOrder:yfiles.styles.TableRenderingOrder); - /** - * Return a collection of hits at location. - *

- * This implementation returns the hits in the following order: - *

- *
    - *
  1. First all {@link yfiles.graph.IRow}s or {@link yfiles.graph.IColumn}s at the given location, in the order specified by the {@link yfiles.input.StripeHitTester#tableRenderingOrder} property.
  2. - *
  3. For each stripe type, the stripes are returned in bottom up order, i.e. children are returned before their parents.
  4. - *
  5. - * For each stripe, the subregions are returned in the order {@link yfiles.input.StripeSubregionTypes#NEAR_BORDER}, - * {@link yfiles.input.StripeSubregionTypes#FAR_BORDER}, {@link yfiles.input.StripeSubregionTypes#LEADING_HEADER}, - * {@link yfiles.input.StripeSubregionTypes#TRAILING_HEADER},{@link yfiles.input.StripeSubregionTypes#STRIPE}, e.g. a header hit is always - * returned before a hit on the whole stripe. - *
  6. - *
- * @param context The input mode context to use. - * @param location The location in absolute coordinates. - * @param node The node where the table instance is currently bound to. - * @returns A collection of {@link }s at location - */ - enumerateHits(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,node:yfiles.graph.INode):yfiles.collections.IEnumerable; - /** - * Gets the hit test order that is currently used by this instance - * @type {yfiles.styles.TableRenderingOrder} - */ - tableRenderingOrder:yfiles.styles.TableRenderingOrder; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.input.StripeHitTester; - } - }export namespace graph{ - /** - * Base interface for items that can be used in a {@link yfiles.view.CanvasComponent}. - *

- * Most prominently this is the interface all graph elements used in {@link yfiles.graph.IGraph} implement. - *

- *

- * It adds no functionality over the {@link yfiles.graph.ILookup} and {@link yfiles.graph.ITagOwner} interfaces it inherits. - *

- *

- * To add custom visuals to a {@link yfiles.view.CanvasComponent} it is not necessary to implement this interface. Instead, any - * object can be {@link yfiles.view.ICanvasObjectGroup#addChild added directly to the canvas}, provided there is a suitable {@link yfiles.view.ICanvasObjectDescriptor} - * implementation for rendering it. - *

- * @interface - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.graph.ITagOwner} - */ - export interface IModelItem extends yfiles.lang.Object,yfiles.graph.ILookup,yfiles.graph.ITagOwner{ - } - var IModelItem:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IModelItem; - }; - /** - * An implementation of the {@link yfiles.graph.IPortLocationModel} that can create {@link yfiles.graph.IPortLocationModelParameter}s that - * describe the location of ports that are attached to the bends of {@link yfiles.graph.IEdge}s. - * @class - * @implements {yfiles.graph.IPortLocationModel} - * @final - */ - export interface BendAnchoredPortLocationModel extends yfiles.lang.Object,yfiles.graph.IPortLocationModel{} - export class BendAnchoredPortLocationModel { - /** - * Creates a parameter that indicates the location of the bend with index bendIndex starting from the source side. - * @param bendIndex The index of the bend counting from the source side. - * @returns A parameter that anchors the port at a bend. - */ - createFromSource(bendIndex:number):yfiles.graph.IPortLocationModelParameter; - /** - * Creates a parameter that indicates the location of the bend with index bendIndex starting from the target side. - * @param bendIndex The index of the bend counting from the target side. - * @returns A parameter that anchors the port at a bend. - */ - createFromTarget(bendIndex:number):yfiles.graph.IPortLocationModelParameter; - /** - * - * @param owner - * @param location - * @returns - */ - createParameter(owner:yfiles.graph.IPortOwner,location:yfiles.geometry.Point):yfiles.graph.IPortLocationModelParameter; - /** - * - * @param port - * @param locationParameter - * @returns - */ - getContext(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.graph.ILookup; - /** - * - * @param port - * @param locationParameter - * @returns - */ - getLocation(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.geometry.Point; - /** - * This implementation has nothing in its lookup and will always yield null - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * A static immutable global instance of this class. - * @const - * @static - * @type {yfiles.graph.BendAnchoredPortLocationModel} - */ - static INSTANCE:yfiles.graph.BendAnchoredPortLocationModel; - /** - * A convenience instance of a parameter that is bound to the first {@link yfiles.graph.IBend} of the edge. - * @see yfiles.graph.BendAnchoredPortLocationModel#createFromSource - * @const - * @static - * @type {yfiles.graph.IPortLocationModelParameter} - */ - static FIRST_BEND:yfiles.graph.IPortLocationModelParameter; - /** - * A convenience instance of a parameter that is bound to the last {@link yfiles.graph.IBend} of the edge. - * @see yfiles.graph.BendAnchoredPortLocationModel#createFromTarget - * @const - * @static - * @type {yfiles.graph.IPortLocationModelParameter} - */ - static LAST_BEND:yfiles.graph.IPortLocationModelParameter; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.BendAnchoredPortLocationModel; - } - /** - * An implementation of {@link yfiles.graph.ILabelModel} that can be used to create custom label models out of existing {@link yfiles.graph.ILabelModel} - * instances. - *

- * This class holds a number of models and can provide all of their parameters in - * {@link yfiles.graph.CompositeLabelModel#getParameters}. A custom model can easily be created that way: - *

- * @class - * @implements {yfiles.graph.ILabelModel} - * @implements {yfiles.graph.ILabelModelParameterProvider} - * @implements {yfiles.graph.ILabelModelParameterFinder} - */ - export interface CompositeLabelModel extends yfiles.lang.Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider,yfiles.graph.ILabelModelParameterFinder{} - export class CompositeLabelModel { - /** - * Creates a new instance of this label model with an empty {@link yfiles.graph.CompositeLabelModel#labelModels} collection. - */ - constructor(); - /** - * Creates a default parameter that can be used for this model. - *

- * If {@link yfiles.graph.CompositeLabelModel#labelModels} is not empty, the default parameter for the first model in that list is returned. Otherwise, the default parameter - * for {@link yfiles.graph.FreeLabelModel#createDefaultParameter} is returned. - *

- * @returns a parameter for this model instance - */ - createDefaultParameter():yfiles.graph.ILabelModelParameter; - /** - * Tries to find a parameter that best matches the given layout for the provided label instance. - *

- * This implementation tests all parameters from all models in {@link yfiles.graph.CompositeLabelModel#labelModels}. - *

- * @param label The label to find a parameter for. - * @param model The model instance to use. This should be the instance this instance has been obtained from. - * @param layout The anticipated layout for the label. - * @returns A non-null parameter that can be used for the label to approximate the provided layout. - */ - findBestParameter(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel,layout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; - /** - * Returns an enumerator over a set of possible {@link yfiles.graph.ILabelModelParameter} instances that can be used for the given - * label and model. - *

- * This implementation returns all parameters from all models in {@link yfiles.graph.CompositeLabelModel#labelModels} - *

- * @param label The label instance to use. - * @param model The model to provide parameters for. - * @returns A possibly empty enumerator over a set of label model parameters. - */ - getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * Gets a list of {@link yfiles.graph.ILabelModel} implementations that are wrapped by this instance. - * @type {yfiles.collections.IList.} - */ - labelModels:yfiles.collections.IList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.CompositeLabelModel; - } - /** - * A simple mutable implementation of the {@link yfiles.graph.IBend} interface that can be used stand-alone. - *

- * Note that this class is not the one used as the default implementation of a {@link yfiles.graph.DefaultGraph}'s - * {@link yfiles.graph.IBend}s and casting them to {@link yfiles.graph.SimpleBend} will fail. Instances of this class can be used without - * an accompanying graph instance. All of the properties are mutable. An example of a possible use case would be the - * rendering of a {@link yfiles.graph.SimpleEdge} with bends into a graphics context: Simply create two {@link yfiles.graph.SimpleNode}s, a - * {@link yfiles.graph.SimpleEdge} to connect the two nodes and add instances of this class to the edge's {@link yfiles.graph.SimpleEdge#bends} model. Then render the - * edge. - *

- * @class - * @implements {yfiles.graph.IBend} - */ - export interface SimpleBend extends yfiles.lang.Object,yfiles.graph.IBend{} - export class SimpleBend { - /** - * Initializes a new instance of the {@link yfiles.graph.SimpleBend} class using the given owner and location. - * @param owner The owner of the bend. - * @param location The bend's location. - */ - constructor(owner:yfiles.graph.IEdge,location:yfiles.geometry.IPoint); - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * Gets or sets the edge this bend instance belongs to. - *

- * This implies that Owner.Bends contains this instance. - *

- * @type {yfiles.graph.IEdge} - */ - owner:yfiles.graph.IEdge; - /** - * Gets or sets the location of this bend. - * @see yfiles.graph.SimpleBend#x - * @see yfiles.graph.SimpleBend#y - * @type {yfiles.geometry.IPoint} - */ - location:yfiles.geometry.IPoint; - /** - * Gets the current x coordinate of this bend. - *

- * This delegates to the {@link yfiles.graph.SimpleBend#location} instance. - *

- * @type {number} - */ - x:number; - /** - * Gets the current y coordinate of this bend. - *

- * This delegates to the {@link yfiles.graph.SimpleBend#location} instance. - *

- * @type {number} - */ - y:number; - /** - * - * @type {any} - */ - tag:any; - /** - * Gets or sets the {@link yfiles.graph.ILookup} implementation used for calls to {@link yfiles.graph.SimpleBend#lookup} on this instance. - * @type {yfiles.graph.ILookup} - */ - lookupImplementation:yfiles.graph.ILookup; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.SimpleBend; - } - /** - * A simple mutable implementation of the {@link yfiles.graph.IEdge} interface that can be used stand-alone. - *

- * Note that this class is not the one used as the default implementation of a {@link yfiles.graph.DefaultGraph}'s - * {@link yfiles.graph.IEdge}s and casting them to {@link yfiles.graph.SimpleEdge} will fail. Instances of this class can be used without - * an accompanying graph instance. All of the properties are mutable. An example of a possible use case would be the - * rendering of an edge into a graphics context: Simply create a - * {@link yfiles.graph.SimpleEdge}, associate a style with it and use the style's renderer instance to obtain a rendering for the - * edge. - *

- * @class - * @implements {yfiles.graph.IEdge} - */ - export interface SimpleEdge extends yfiles.lang.Object,yfiles.graph.IEdge{} - export class SimpleEdge { - /** - * Creates an edge with a {@link yfiles.graph.DefaultGraph#DEFAULT_EDGE_LOOKUP default lookup}, and the given source and target ports. - *

- * While technically the source and target port can be null here, this will cause all kinds of issues, e.g. with {@link yfiles.styles.IEdgeStyle styles} or - * {@link yfiles.graph.ILabelModel label models} that require the ports to be non-null to work properly. - *

- * @param sourcePort The source port for the edge. - * @param targetPort The target port for the edge. - */ - constructor(sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort); - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * Gets or sets the style that is responsible for the visual representation of this edge in a {@link yfiles.view.CanvasComponent}. - *

- * Note that the style instance associated with an edge instance may be shared between multiple edge instances and that the - * modification of this style will result in a change of the appearance of all edges that are associated with the same - * style instance. - *

- * @type {yfiles.styles.IEdgeStyle} - */ - style:yfiles.styles.IEdgeStyle; - /** - * Gets or sets the collection of {@link yfiles.graph.IBend bends} that describe the geometry of this edge. - * @type {yfiles.collections.IListEnumerable.} - */ - bends:yfiles.collections.IListEnumerable; - /** - * Gets or sets the source port instance this edge is connected to. - *

- * Although the notion of source and target port is used for directed edges, it is still up to the client to decide whether - * the edge should be treated as such. - *

- * @type {yfiles.graph.IPort} - */ - sourcePort:yfiles.graph.IPort; - /** - * Gets or sets the target port instance this edge is connected to. - *

- * Although the notion of source and target port is used for directed edges, it is still up to the client to decide whether - * the edge should be treated as such. - *

- * @type {yfiles.graph.IPort} - */ - targetPort:yfiles.graph.IPort; - /** - * Gets or sets the collection of {@link yfiles.graph.IPort ports} that are owned by this instance. - * @type {yfiles.collections.IListEnumerable.} - */ - ports:yfiles.collections.IListEnumerable; - /** - * Gets or sets the collection of {@link yfiles.graph.ILabel labels} that are owned by this instance. - * @type {yfiles.collections.IListEnumerable.} - */ - labels:yfiles.collections.IListEnumerable; - /** - * - * @type {any} - */ - tag:any; - /** - * Gets or sets the {@link yfiles.graph.ILookup} implementation used for calls to {@link yfiles.graph.SimpleEdge#lookup} on this instance. - * @type {yfiles.graph.ILookup} - */ - lookupImplementation:yfiles.graph.ILookup; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.SimpleEdge; - } - /** - * Central implementation of the {@link yfiles.graph.IGraph} interface. - *

- * This implementation deals with the proper firing of events and handling of default values. - *
- * This implementation has inherent support for undoability. If the {@link yfiles.graph.DefaultGraph#undoEngineEnabled} property is set to true, changes to the structure of - * the graph will automatically be recorded using the {@link yfiles.graph.UndoEngine} instance that can be queried from this - * instance's {@link yfiles.graph.DefaultGraph#lookup} method. Clients that wish to enqueue custom undo events or that need to make - * non-structural changes to the graph can use the {@link yfiles.graph.UndoEngine} to do so. The current instance of {@link yfiles.graph.UndoEngine} - * can be queried using the {@link yfiles.graph.ILookup#lookup} method of this instance. Also there are several protected methods Create...UndoUnit - * that will be used by this instance to create the actual undo units for structural changes in the graph's structure. If - * clients need to customize these units they can create a subclass of {@link yfiles.graph.DefaultGraph} and override these - * methods. - *
- * Finally this implementation supports grouped graphs. - *

- *

- * DefaultGraph is {@link yfiles.graph.IGraph}'s default implementation as described in the section {@link @DGUIDE_PREFIX@/graph_model-graph.html The Graph Model - IGraph}. - *

- *

Related demos:

- *
    - *
  • Demo: Simple Editor Demo, Demo.yFiles.Graph.SimpleEditor
  • - *
- * @see yfiles.graph.DefaultGraph#createUndoEngine - * @see yfiles.graph.DefaultGraph#lookup - * @see yfiles.graph.DefaultGraph - * @see yfiles.graph.FoldingManager - * @class - * @implements {yfiles.graph.IGraph} - */ - export interface DefaultGraph extends yfiles.lang.Object,yfiles.graph.IGraph{} - export class DefaultGraph { - /** - * Creates a new instance of a graph that provides an {@link yfiles.graph.ILookupDecorator} for all of its entities. - * @param {Object} [options=null] The parameters to pass. - * @param options.nodes An array of nodes to create in this graph. Each item will be passed to the {@link #createNode} method. - * @param {yfiles.graph.IEdgeDefaults} [options.edgeDefaults=null] Sets the edgeDefaults property. - * @param {yfiles.graph.INodeDefaults} [options.groupNodeDefaults=null] Sets the groupNodeDefaults property. - * @param {yfiles.graph.IMapperRegistry} options.mapperRegistry The mapper registry that is associated with this graph instance. - *

- * This option sets the {@link yfiles.graph.DefaultGraph#mapperRegistry} property on the created object. - *

- * @param {yfiles.graph.INodeDefaults} [options.nodeDefaults=null] Sets the nodeDefaults property. - * @param {boolean} options.undoEngineEnabled Whether or not the {@link yfiles.graph.UndoEngine} used for this instance should be enabled. - *

- * This option sets the {@link yfiles.graph.DefaultGraph#undoEngineEnabled} property on the created object. - *

- */ - constructor(options?:{edgeDefaults?:yfiles.graph.IEdgeDefaults,groupNodeDefaults?:yfiles.graph.INodeDefaults,mapperRegistry?:yfiles.graph.IMapperRegistry,nodeDefaults?:yfiles.graph.INodeDefaults,undoEngineEnabled?:boolean,nodes?:Array}); - /** - * - * @param edge - * @param location - * @param [index=-1] - * @returns - */ - addBend(edge:yfiles.graph.IEdge,location:yfiles.geometry.Point,index?:number):yfiles.graph.IBend; - /** - * - * @param owner - * @param text - * @param [layoutParameter=null] - * @param [style=null] - * @param [preferredSize=null] - * @param [tag=null] - * @returns - */ - addLabel(owner:yfiles.graph.ILabelOwner,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,preferredSize?:yfiles.geometry.Size,tag?:any):yfiles.graph.ILabel; - /** - * - * @param {Object} options The parameters to pass. - * @param options.owner - * @param options.text - * @param [options.layoutParameter=null] - * @param [options.style=null] - * @param [options.preferredSize=null] - * @param [options.tag=null] - * @returns - */ - addLabel(options:{owner:yfiles.graph.ILabelOwner,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,preferredSize?:yfiles.geometry.Size,tag?:Object}):yfiles.graph.ILabel; - /** - * Adds the chain element to the lookup for this instance. - * @param lookup The lookup to decorate the current instance with. - */ - addLookup(lookup:yfiles.graph.IContextLookupChainLink):void; - /** - * Add a port to the given port owner using the coordinates as the new initial position of the port anchor. - * @param owner the owner to add the port instance to. - * @param [locationParameter=null] the parameter to use for the port to determine its location. - * @param [style=null] the style to assign initially to the port, e.g. {@link #INSTANCE}. - * @param [tag=null] The tag to associate with the port, may be null. - * @returns the newly created port - * @throws {Stubs.Exceptions.NotSupportedError} If this instance cannot add a port to owner. - * @throws {Stubs.Exceptions.ArgumentError} If owner is not in this graph. - * @see yfiles.graph.DefaultGraph#addPortAddedListener - */ - addPort(owner:yfiles.graph.IPortOwner,locationParameter?:yfiles.graph.IPortLocationModelParameter,style?:yfiles.styles.IPortStyle,tag?:any):yfiles.graph.IPort; - /** - * Add a port to the given port owner using the coordinates as the new initial position of the port anchor. - * @param {Object} options The parameters to pass. - * @param options.owner the owner to add the port instance to. - * @param [options.locationParameter=null] the parameter to use for the port to determine its location. - * @param [options.style=null] the style to assign initially to the port, e.g. {@link #INSTANCE}. - * @param [options.tag=null] The tag to associate with the port, may be null. - * @returns the newly created port - * @throws {Stubs.Exceptions.NotSupportedError} If this instance cannot add a port to owner. - * @throws {Stubs.Exceptions.ArgumentError} If owner is not in this graph. - * @see yfiles.graph.DefaultGraph#addPortAddedListener - */ - addPort(options:{owner:yfiles.graph.IPortOwner,locationParameter?:yfiles.graph.IPortLocationModelParameter,style?:yfiles.styles.IPortStyle,tag?:Object}):yfiles.graph.IPort; - /** - * Determines whether this graph contains the specified item. - * @param item The item. - * @returns true if this graph contains the specified item; otherwise, false. - */ - contains(item:yfiles.graph.IModelItem):boolean; - /** - * - * @param sourcePort - * @param targetPort - * @param [style=null] - * @param [tag=null] - * @returns - */ - createEdge(sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort,style?:yfiles.styles.IEdgeStyle,tag?:any):yfiles.graph.IEdge; - /** - * - * @param {Object} options The parameters to pass. - * @param options.sourcePort - * @param options.targetPort - * @param [options.style=null] - * @param [options.tag=null] - * @returns - */ - createEdge(options:{sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort,style?:yfiles.styles.IEdgeStyle,tag?:Object}):yfiles.graph.IEdge; - /** - * Convenience method that creates and returns an edge that connects to the given node instances using the given style - * instance. - *

- * The nodes must be part of this graph at the time of the invocation, and the implementation will choose the {@link yfiles.graph.IPort} - * instances to which the edge will be connected. The edge will be a part of this graph after the method returns. This will - * trigger the corresponding events. - *

- * @param source The source node the created edge will connect to. This implementation queries the {@link #getNewSourcePort} - * method to determine which port to use. - * @param target The target node the created edge will connect to. This implementation queries the {@link #getNewSourcePort} - * method to determine which port to use. - * @param [style=null] The style instance that will be assigned to the newly created instance. This is done by reference. - * @param [tag=null] the initial {@link #tag} to assign. - * @returns the newly created edge instance - * @throws {Stubs.Exceptions.ArgumentError} If source or target is not in this graph. - * @see yfiles.graph.DefaultGraph#addEdgeCreatedListener - * @see yfiles.graph.DefaultGraph#getNewSourcePort - * @see yfiles.graph.DefaultGraph#getNewTargetPort - * @see yfiles.graph.DefaultGraph#createEdge - */ - createEdge(source:yfiles.graph.INode,target:yfiles.graph.INode,style?:yfiles.styles.IEdgeStyle,tag?:any):yfiles.graph.IEdge; - /** - * Convenience method that creates and returns an edge that connects to the given node instances using the given style - * instance. - *

- * The nodes must be part of this graph at the time of the invocation, and the implementation will choose the {@link yfiles.graph.IPort} - * instances to which the edge will be connected. The edge will be a part of this graph after the method returns. This will - * trigger the corresponding events. - *

- * @param {Object} options The parameters to pass. - * @param options.source The source node the created edge will connect to. This implementation queries the {@link #getNewSourcePort} - * method to determine which port to use. - * @param options.target The target node the created edge will connect to. This implementation queries the {@link #getNewSourcePort} - * method to determine which port to use. - * @param [options.style=null] The style instance that will be assigned to the newly created instance. This is done by reference. - * @param [options.tag=null] the initial {@link #tag} to assign. - * @returns the newly created edge instance - * @throws {Stubs.Exceptions.ArgumentError} If source or target is not in this graph. - * @see yfiles.graph.DefaultGraph#addEdgeCreatedListener - * @see yfiles.graph.DefaultGraph#getNewSourcePort - * @see yfiles.graph.DefaultGraph#getNewTargetPort - * @see yfiles.graph.DefaultGraph#createEdge - */ - createEdge(options:{source:yfiles.graph.INode,target:yfiles.graph.INode,style?:yfiles.styles.IEdgeStyle,tag?:Object}):yfiles.graph.IEdge; - /** - * - * @param [parent=null] - * @param [layout=null] - * @param [style=null] - * @param [tag=null] - * @returns - */ - createGroupNode(parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:any):yfiles.graph.INode; - /** - * - * @param {Object} options The parameters to pass. - * @param [options.parent=null] - * @param [options.layout=null] - * @param [options.style=null] - * @param [options.tag=null] - * @returns - */ - createGroupNode(options:{parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object}):yfiles.graph.INode; - /** - * - * @param layout - * @param [style=null] - * @param [tag=null] - * @returns - */ - createNode(layout:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:any):yfiles.graph.INode; - /** - * - * @param {Object} options The parameters to pass. - * @param options.layout - * @param [options.style=null] - * @param [options.tag=null] - * @returns - */ - createNode(options:{layout:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object}):yfiles.graph.INode; - /** - * - * @param [parent=null] - * @param [layout=null] - * @param [style=null] - * @param [tag=null] - * @returns - */ - createNode(parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:any):yfiles.graph.INode; - /** - * - * @param {Object} options The parameters to pass. - * @param [options.parent=null] - * @param [options.layout=null] - * @param [options.style=null] - * @param [options.tag=null] - * @returns - */ - createNode(options:{parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object}):yfiles.graph.INode; - /** - * Creates an {@link yfiles.graph.UndoEngine} instance that automatically triggers {@link yfiles.graph.DefaultGraph#invalidateDisplays} - * upon each invocation of {@link yfiles.graph.UndoEngine#undo} and {@link yfiles.graph.UndoEngine#redo} - * @returns An {@link } instance. - * @protected - */ - createUndoEngine():yfiles.graph.UndoEngine; - /** - * Creates the bend addition {@link yfiles.graph.IUndoUnit undo unit} for the given bend. - * @param bend The bend that has been added. - * @param index The index at which the bend has been added. - * @returns The unit that can be used to undo and redo the creation. - * @protected - */ - createUndoUnitForBendAddition(bend:yfiles.graph.IBend,index:number):yfiles.graph.IUndoUnit; - /** - * Creates the bend removal {@link yfiles.graph.IUndoUnit undo unit} for the given bend. - * @param bend The bend that will be removed. - * @returns The unit that can be used to undo and redo the removal. - * @protected - */ - createUndoUnitForBendRemoval(bend:yfiles.graph.IBend):yfiles.graph.IUndoUnit; - /** - * Creates the edge creation {@link yfiles.graph.IUndoUnit undo unit} for the given edge. - * @param edge The edge that has been created. - * @returns The unit that can be used to undo and redo the creation. - * @protected - */ - createUndoUnitForEdgeCreation(edge:yfiles.graph.IEdge):yfiles.graph.IUndoUnit; - /** - * Creates the edge reconnection {@link yfiles.graph.IUndoUnit undo unit} for the given edge. - * @param edge The edge that has been reconnected to other ports. - * @param oldSource The old source port the edge connected to before the change. - * @param oldTarget The old target port the edge connected to before the change. - * @returns The unit that can be used to undo and redo the port change operation. - * @protected - */ - createUndoUnitForEdgeReconnection(edge:yfiles.graph.IEdge,oldSource:yfiles.graph.IPort,oldTarget:yfiles.graph.IPort):yfiles.graph.IUndoUnit; - /** - * Creates the edge removal {@link yfiles.graph.IUndoUnit undo unit} for the given edge. - * @param edge The edge that will be removed. - * @returns The unit that can be used to undo and redo the removal. - * @protected - */ - createUndoUnitForEdgeRemoval(edge:yfiles.graph.IEdge):yfiles.graph.IUndoUnit; - /** - * Creates the {@link yfiles.graph.IUndoUnit undo unit} for changing whether the given node is a group node. - * @param node The node whose group node status has been changed. - * @param isGroupNode The new group node status. - * @returns The unit that can be used to undo and redo the group node status change. - * @protected - */ - createUndoUnitForIsGroupNodeChange(node:yfiles.graph.INode,isGroupNode:boolean):yfiles.graph.IUndoUnit; - /** - * Creates the label addition {@link yfiles.graph.IUndoUnit undo unit} for the given label. - * @param label The label that has been added. - * @returns The unit that can be used to undo and redo the creation. - * @protected - */ - createUndoUnitForLabelAddition(label:yfiles.graph.ILabel):yfiles.graph.IUndoUnit; - /** - * Creates the label removal {@link yfiles.graph.IUndoUnit undo unit} for the given label. - * @param label The label that will be removed. - * @returns The unit that can be used to undo and redo the removal. - * @protected - */ - createUndoUnitForLabelRemoval(label:yfiles.graph.ILabel):yfiles.graph.IUndoUnit; - /** - * Creates the node creation {@link yfiles.graph.IUndoUnit undo unit} for the given node. - * @param node The node that has been created. - * @param parent - * @param isGroupNode - * @returns The unit that can be used to undo and redo the creation. - * @protected - */ - createUndoUnitForNodeCreation(node:yfiles.graph.INode,parent:yfiles.graph.INode,isGroupNode:boolean):yfiles.graph.IUndoUnit; - /** - * Creates the node removal {@link yfiles.graph.IUndoUnit undo unit} for the given node. - * @param node The node that will be removed. - * @returns The unit that can be used to undo and redo the removal. - * @protected - */ - createUndoUnitForNodeRemoval(node:yfiles.graph.INode):yfiles.graph.IUndoUnit; - /** - * Creates the parent change {@link yfiles.graph.IUndoUnit undo unit} for the given node. - * @param node The node whose parent has been changed. - * @param oldParent - * @param newParent The node which is the new parent. - * @returns The unit that can be used to undo and redo the parent change. - * @protected - */ - createUndoUnitForParentChange(node:yfiles.graph.INode,oldParent:yfiles.graph.INode,newParent:yfiles.graph.INode):yfiles.graph.IUndoUnit; - /** - * Creates the port addition {@link yfiles.graph.IUndoUnit undo unit} for the given port. - * @param port The port that has been added. - * @returns The unit that can be used to undo and redo the creation. - * @protected - */ - createUndoUnitForPortAddition(port:yfiles.graph.IPort):yfiles.graph.IUndoUnit; - /** - * Creates the port removal {@link yfiles.graph.IUndoUnit undo unit} for the given port. - * @param port The port that will be removed. - * @returns The unit that can be used to undo and redo the removal. - * @protected - */ - createUndoUnitForPortRemoval(port:yfiles.graph.IPort):yfiles.graph.IUndoUnit; - /** - * - * @param owner - * @param [type=yfiles.graph.AdjacencyTypes.ALL] - * @returns - */ - edgesAt(owner:yfiles.graph.IPortOwner,type?:yfiles.graph.AdjacencyTypes):yfiles.collections.IListEnumerable; - /** - * - * @param port - * @param [type=yfiles.graph.AdjacencyTypes.ALL] - * @returns - */ - edgesAt(port:yfiles.graph.IPort,type?:yfiles.graph.AdjacencyTypes):yfiles.collections.IListEnumerable; - /** - * - * @param node - * @returns - */ - getChildren(node:yfiles.graph.INode):yfiles.collections.IListEnumerable; - /** - * Returns the lookup implementation that is used for {@link yfiles.graph.DefaultGraph#lookup} calls. - * @returns The replacing lookup instance or null if the internal lookup mechanism is used. - * @see yfiles.graph.DefaultGraph#setLookupImplementation - */ - getLookup():yfiles.graph.ILookup; - /** - * Determines a {@link yfiles.graph.IPort} instance to use for the creation of a new edge that starts at the given - * {@link yfiles.graph.IPortOwner}. - *

- * This implementation will {@link yfiles.graph.DefaultGraph#addPort add a new center anchored port} to the node. - *

- * @param source The source node to find a port for. - * @returns The port to use for a newly created edge. - * @see yfiles.graph.DefaultGraph#createEdge - * @protected - */ - getNewSourcePort(source:yfiles.graph.IPortOwner):yfiles.graph.IPort; - /** - * Determines a {@link yfiles.graph.IPort} instance to use for the creation of a new edge that ends at the given - * {@link yfiles.graph.IPortOwner}. - *

- * This implementation will {@link yfiles.graph.DefaultGraph#addPort add a new center anchored port} to the node. - *

- * @param targetOwner The target node to find a port for. - * @returns The port to use for a newly created edge. - * @see yfiles.graph.DefaultGraph#createEdge - * @protected - */ - getNewTargetPort(targetOwner:yfiles.graph.IPortOwner):yfiles.graph.IPort; - /** - * - * @param node - * @returns - */ - getParent(node:yfiles.graph.INode):yfiles.graph.INode; - /** - * The last element in the lookup chain is implemented by this method. - * @param type - * @returns - * @protected - */ - innerLookup(type:yfiles.lang.Class):any; - /** - * Triggers the {@link yfiles.graph.DefaultGraph#addDisplaysInvalidatedListener DisplaysInvalidated} event. - *

- * Clients can call this method to force an invalidation of the displays that show this graph instance. This implementation - * delegates to {@link yfiles.graph.DefaultGraph#onInvalidateDisplays}. - *

- */ - invalidateDisplays():void; - /** - * - * @param node - * @returns - */ - isGroupNode(node:yfiles.graph.INode):boolean; - /** - * Returns an instance that provides another aspect of this instance of the given type or null. - *

- * Typically, this method will be called in order to obtain a different view or aspect of the current instance. This is - * quite similar to casting or using a super type or interface of this instance, but is not limited to inheritance or - * compile time constraints. This method is not required to return non-null implementations for the types, nor does it have - * to return the same instance any time. Also it depends on the type and context whether the instance returned stays up to - * date or needs to be re-obtained for subsequent use. This implementation uses the {@link yfiles.graph.DefaultGraph#setLookupImplementation set lookup implementation} if it has - * been set or an internal {@link yfiles.graph.LookupChain lookup chain}, that can be customized using the {@link yfiles.graph.DefaultGraph#addLookup} and {@link yfiles.graph.DefaultGraph#removeLookup} - * methods. - *

- * @param type the type for which an instance shall be returned - * @returns An instance that is assignable to type or null - */ - lookup(type:yfiles.lang.Class):any; - /** - * Callback that is invoked before a bend is added to this graph's structure. - * @param edge The edge the bend will be added to. - * @param bend The bend that will be added to the edge. - * @param index The index where the bend will be added to the edge. - * @protected - */ - onAddingBend(edge:yfiles.graph.IEdge,bend:yfiles.graph.IBend,index:number):void; - /** - * Callback method that will be called just before an edge label is added to an edge. - * @param edge - * @param label - * @protected - */ - onAddingEdgeLabel(edge:yfiles.graph.IEdge,label:yfiles.graph.ILabel):void; - /** - * Callback method that will be called just before a node label is added to a node. - * @param node - * @param label - * @protected - */ - onAddingNodeLabel(node:yfiles.graph.INode,label:yfiles.graph.ILabel):void; - /** - * Called when a port is going to be added to a node. - * @param owner The node. - * @param port The port to be added. - * @protected - */ - onAddingPort(owner:yfiles.graph.IPortOwner,port:yfiles.graph.IPort):void; - /** - * Callback that after a bend has been added to this graph's structure. - *

- * When overriding this method it is mandatory to call the base implementation. - *

- * @param bend The bend that has been added to the edge. - * @protected - */ - onBendAdded(bend:yfiles.graph.IBend):void; - /** - * Callback that is invoked after a bend location has changed. - *

- * This will trigger the {@link yfiles.graph.DefaultGraph#addBendLocationChangedListener BendLocationChanged} event. - *

- * @param bend The bend whose location has changed. - * @param oldLocation The bend location before the change - * @protected - */ - onBendLocationChanged(bend:yfiles.graph.IBend,oldLocation:yfiles.geometry.Point):void; - /** - * Callback method that is invoked just after a bend has been removed from its edge. - *

- * When overriding this method it is mandatory to call the base implementation. - *

- * @param owner The old edge. - * @param bend The bend. - * @param index The former index of the bend in the {@link #bends} list. - * @protected - */ - onBendRemoved(owner:yfiles.graph.IEdge,bend:yfiles.graph.IBend,index:number):void; - /** - * Callback that is invoked after a bend tag has changed. - *

- * This will trigger the {@link yfiles.graph.DefaultGraph#addBendTagChangedListener BendTagChanged} event. - *

- * @param bend The bend whose tag has changed. - * @param oldTag The bend tag before the change - * @protected - */ - onBendTagChanged(bend:yfiles.graph.IBend,oldTag:any):void; - /** - * Callback that is invoked before the ports of an edge are being changed. - * @param edge An edge whose the ports are to be changed. - * @param newSource The new source port - * @param newTarget The new target port - * @protected - */ - onChangingEdgePorts(edge:yfiles.graph.IEdge,newSource:yfiles.graph.IPort,newTarget:yfiles.graph.IPort):void; - /** - * Callback that is invoked before an edge style is being changed. - * @param edge An edge whose the style is going to be changed. - * @param newStyle The new edge style. - * @protected - */ - onChangingEdgeStyle(edge:yfiles.graph.IEdge,newStyle:yfiles.styles.IEdgeStyle):void; - /** - * Callback that is invoked before the graph's tag is being changed. - * @param newTag The new port tag - * @protected - */ - onChangingGraphTag(newTag:any):void; - /** - * Callback that is invoked before the {@link yfiles.graph.ILabel#layoutParameter} of a label is being changed. - * @param label A label whose {@link #layoutParameter} is to be changed. - * @param newLayoutParameter The new label model parameter - * @protected - */ - onChangingLabelLayoutParameter(label:yfiles.graph.ILabel,newLayoutParameter:yfiles.graph.ILabelModelParameter):void; - /** - * Callback that is invoked before the preferred size of a label is being changed. - * @param label A label whose preferred size is going to be changed. - * @param newSize The new preferred size - * @protected - */ - onChangingLabelPreferredSize(label:yfiles.graph.ILabel,newSize:yfiles.geometry.Size):void; - /** - * Callback that is invoked before a label style is being changed. - * @param label A label whose the style is going to be changed. - * @param newStyle The new label style. - * @protected - */ - onChangingLabelStyle(label:yfiles.graph.ILabel,newStyle:yfiles.styles.ILabelStyle):void; - /** - * Callback that is invoked before the text of a label is being changed. - * @param label A label whose text is going to be changed. - * @param newText The new label text - * @protected - */ - onChangingLabelText(label:yfiles.graph.ILabel,newText:string):void; - /** - * Callback that is invoked before a node style is being changed. - * @param node A node whose the style is going to be changed. - * @param newStyle The new node style. - * @protected - */ - onChangingNodeStyle(node:yfiles.graph.INode,newStyle:yfiles.styles.INodeStyle):void; - /** - * Callback that is invoked before the {@link yfiles.graph.IPort#locationParameter} of a port is being changed. - * @param port A port whose {@link #locationParameter} is to be changed. - * @param newLocationParameter The new location model parameter - * @protected - */ - onChangingPortLocationModelParameter(port:yfiles.graph.IPort,newLocationParameter:yfiles.graph.IPortLocationModelParameter):void; - /** - * Callback that is invoked before a port style is being changed. - * @param port A port whose the style is going to be changed. - * @param newStyle The new port style. - * @protected - */ - onChangingPortStyle(port:yfiles.graph.IPort,newStyle:yfiles.styles.IPortStyle):void; - /** - * Callback that is invoked before the edge is added to this graph's structure. - * @param edge An edge that is not yet contained in this graph. - * @param sourcePort The source port this edge will connect to. - * @param targetPort The target port this edge will connect to. - * @protected - */ - onCreatingEdge(edge:yfiles.graph.IEdge,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):void; - /** - * Callback that is invoked before the node is added to this graph's structure. - * @param node A node that is not yet contained in this graph. - * @protected - */ - onCreatingNode(node:yfiles.graph.INode):void; - /** - * Callback that triggers the {@link yfiles.graph.DefaultGraph#addEdgeCreatedListener EdgeCreated} event. - * @param edge The edge that has been created. - * @protected - */ - onEdgeCreated(edge:yfiles.graph.IEdge):void; - /** - * Called after a label has been added to an edge. - *

- * This method triggers the {@link yfiles.graph.DefaultGraph#addLabelAddedListener LabelAdded} event. - *

- *

- * When overriding this method it is mandatory to call the base implementation. - *

- * @param label The label that has just been added. - * @protected - */ - onEdgeLabelAdded(label:yfiles.graph.ILabel):void; - /** - * Called after a label has been removed from its edge. - *

- * When overriding this method it is mandatory to call the base implementation. - *

- * @param label The label that has just been removed. - * @param owner The previous owner of the label. - * @protected - */ - onEdgeLabelRemoved(owner:yfiles.graph.ILabelOwner,label:yfiles.graph.ILabel):void; - /** - * Callback that is invoked after the ports of an edge has changed. - *

- * This will trigger the {@link yfiles.graph.DefaultGraph#addEdgePortsChangedListener EdgePortsChanged} event. - *

- * @param edge The edge whose ports have changed. - * @param oldSource The source port that the edge had been connected to before the change. - * @param oldTarget The target port that the edge had been connected to before the change. - * @protected - */ - onEdgePortsChanged(edge:yfiles.graph.IEdge,oldSource:yfiles.graph.IPort,oldTarget:yfiles.graph.IPort):void; - /** - * Callback that triggers the {@link yfiles.graph.DefaultGraph#addEdgeRemovedListener EdgeRemoved} event. - * @param edge The edge that got removed - * @param oldSource The source port that the edge had been connected to. - * @param oldTarget The target port that the edge had been connected to. - * @protected - */ - onEdgeRemoved(edge:yfiles.graph.IEdge,oldSource:yfiles.graph.IPort,oldTarget:yfiles.graph.IPort):void; - /** - * Callback that is invoked after the style of an edge has changed. - *

- * This will trigger the {@link yfiles.graph.DefaultGraph#addEdgeStyleChangedListener EdgeStyleChanged} event. - *

- * @param edge The edge whose style that has changed. - * @param oldStyle The edge style before the change - * @protected - */ - onEdgeStyleChanged(edge:yfiles.graph.IEdge,oldStyle:yfiles.styles.IEdgeStyle):void; - /** - * Callback that is invoked after the tag of an edge has changed. - *

- * This will trigger the {@link yfiles.graph.DefaultGraph#addEdgeTagChangedListener EdgeTagChanged} event. - *

- * @param edge The edge whose tag has changed. - * @param oldTag The edge tag before the change. - * @protected - */ - onEdgeTagChanged(edge:yfiles.graph.IEdge,oldTag:any):void; - /** - * Callback that triggers the {@link yfiles.graph.DefaultGraph#addGraphTagChangedListener GraphTagChanged} event. - * @param oldTag The graph tag before the change. - * @protected - */ - onGraphTagChanged(oldTag:any):void; - /** - * Triggers the {@link yfiles.graph.DefaultGraph#addDisplaysInvalidatedListener DisplaysInvalidated} event. - * @param evt The event arguments. - * @protected - */ - onInvalidateDisplays(evt:yfiles.lang.EventArgs):void; - /** - * Callback that is invoked after a label model parameter has changed. - *

- * This will trigger the {@link yfiles.graph.DefaultGraph#addLabelLayoutParameterChangedListener LabelLayoutParameterChanged} event. - *

- * @param label The label whose model parameter has changed. - * @param oldLayoutParamater The label model parameter before the change - * @protected - */ - onLabelLayoutParameterChanged(label:yfiles.graph.ILabel,oldLayoutParamater:yfiles.graph.ILabelModelParameter):void; - /** - * Callback that is invoked after the preferred size of a label has changed. - *

- * This will trigger the {@link yfiles.graph.DefaultGraph#addLabelPreferredSizeChangedListener LabelPreferredSizeChanged} event. - *

- * @param label The label whose preferred size has changed. - * @param oldSize The preferred size of the label before the change - */ - onLabelPreferredSizeChanged(label:yfiles.graph.ILabel,oldSize:yfiles.geometry.Size):void; - /** - * Callback that is invoked after a label style has changed. - *

- * This will trigger the {@link yfiles.graph.DefaultGraph#addLabelStyleChangedListener LabelStyleChanged} event. - *

- * @param label The label whose style has changed. - * @param oldStyle The label style before the change. - * @protected - */ - onLabelStyleChanged(label:yfiles.graph.ILabel,oldStyle:yfiles.styles.ILabelStyle):void; - /** - * Callback that is invoked after a label tag has changed. - *

- * This will trigger the {@link yfiles.graph.DefaultGraph#addLabelTagChangedListener LabelTagChanged} event. - *

- * @param label The label whose tag has changed. - * @param oldTag The label tag before the change - */ - onLabelTagChanged(label:yfiles.graph.ILabel,oldTag:any):void; - /** - * Callback that is invoked after a label text has changed. - *

- * This will trigger the {@link yfiles.graph.DefaultGraph#addLabelTextChangedListener LabelTextChanged} event. - *

- * @param label The label whose text has changed. - * @param oldText The label text before the change. - */ - onLabelTextChanged(label:yfiles.graph.ILabel,oldText:string):void; - /** - * Callback that triggers the {@link yfiles.graph.DefaultGraph#addNodeCreatedListener NodeCreated} event. - * @param node The node that has been created. - * @protected - */ - onNodeCreated(node:yfiles.graph.INode):void; - /** - * Called after a label has been added to a node. - *

- * This method triggers the {@link yfiles.graph.DefaultGraph#addLabelAddedListener LabelAdded} event. - *

- *

- * When overriding this method it is mandatory to call the base implementation. - *

- * @param label The label that has just been added. - * @protected - */ - onNodeLabelAdded(label:yfiles.graph.ILabel):void; - /** - * Called after a label has been removed from its node. - *

- * When overriding this method it is mandatory to call the base implementation. - *

- * @param label The label that has just been removed. - * @param owner The old owner of the label. - * @protected - */ - onNodeLabelRemoved(owner:yfiles.graph.ILabelOwner,label:yfiles.graph.ILabel):void; - /** - * Callback that is invoked after a node layout has changed. - *

- * This will trigger the {@link yfiles.graph.DefaultGraph#addNodeLayoutChangedListener NodeLayoutChanged} event. - *

- * @param node The node whose layout has changed. - * @param oldLayout The node layout before the change - * @protected - */ - onNodeLayoutChanged(node:yfiles.graph.INode,oldLayout:yfiles.geometry.Rect):void; - /** - * Callback that triggers the {@link yfiles.graph.DefaultGraph#addNodeRemovedListener NodeRemoved} event. - * @param node The node that got removed - * @param oldParent - * @param oldIsGroupNode - * @protected - */ - onNodeRemoved(node:yfiles.graph.INode,oldParent:yfiles.graph.INode,oldIsGroupNode:boolean):void; - /** - * Callback that is invoked after a node style has changed. - *

- * This will trigger the {@link yfiles.graph.DefaultGraph#addNodeStyleChangedListener NodeStyleChanged} event. - *

- * @param node The node whose style has changed. - * @param oldStyle The node style before the change - * @protected - */ - onNodeStyleChanged(node:yfiles.graph.INode,oldStyle:yfiles.styles.INodeStyle):void; - /** - * Callback that is invoked after a node tag has changed. - *

- * This will trigger the {@link yfiles.graph.DefaultGraph#addNodeTagChangedListener NodeTagChanged} event. - *

- * @param node The node whose tag has changed. - * @param oldTag The node tag before the change - * @protected - */ - onNodeTagChanged(node:yfiles.graph.INode,oldTag:any):void; - /** - * Called when a port has been added to a node. - *

- * When overriding this method it is mandatory to call the base implementation. - *

- * @param port The port that has just been added to its owner. - * @protected - */ - onPortAdded(port:yfiles.graph.IPort):void; - /** - * Callback that is invoked after a port location model parameter has changed. - *

- * This will trigger the {@link yfiles.graph.DefaultGraph#addPortLocationParameterChangedListener PortLocationParameterChanged} - * event. - *

- * @param port The port whose location model parameter has changed. - * @param oldLocationParameter The port location model parameter before the change - */ - onPortLocationParameterChanged(port:yfiles.graph.IPort,oldLocationParameter:yfiles.graph.IPortLocationModelParameter):void; - /** - * Callback method that is called just after a port has been removed from its owner. - *

- * When overriding this method it is mandatory to call the base implementation. - *

- * @param port The port that has been removed. - * @param oldOwner The previous owner of the port. - * @protected - */ - onPortRemoved(oldOwner:yfiles.graph.IPortOwner,port:yfiles.graph.IPort):void; - /** - * Callback that is invoked after a port style has changed. - *

- * This will trigger the {@link yfiles.graph.DefaultGraph#addPortStyleChangedListener PortStyleChanged} event. - *

- * @param port The port whose style has changed. - * @param oldStyle The port style before the change - * @protected - */ - onPortStyleChanged(port:yfiles.graph.IPort,oldStyle:yfiles.styles.IPortStyle):void; - /** - * Callback that is invoked after a port tag has changed. - *

- * This will trigger the {@link yfiles.graph.DefaultGraph#addPortTagChangedListener PortTagChanged} event. - *

- * @param port The port whose tag has changed. - * @param oldTag The port tag before the change - * @protected - */ - onPortTagChanged(port:yfiles.graph.IPort,oldTag:any):void; - /** - * Callback method that is invoked just before a bend is removed. - * @param bend The bend that will be removed. - * @protected - */ - onRemovingBend(bend:yfiles.graph.IBend):void; - /** - * Callback that will be invoked before the node will be removed. - * @param edge That edge that is going to be removed. - * @protected - */ - onRemovingEdge(edge:yfiles.graph.IEdge):void; - /** - * Callback method that will be called just before an edge label is removed from its edge. - * @param label - * @protected - */ - onRemovingEdgeLabel(label:yfiles.graph.ILabel):void; - /** - * Callback that will be invoked before the node will be removed. - * @param node That node that is going to be removed. - * @protected - */ - onRemovingNode(node:yfiles.graph.INode):void; - /** - * Callback method that will be called just before a node label is removed from its node. - * @param label - * @protected - */ - onRemovingNodeLabel(label:yfiles.graph.ILabel):void; - /** - * Callback method that is called just before a port will be removed. - * @param port The port that is about to be removed. - * @protected - */ - onRemovingPort(port:yfiles.graph.IPort):void; - /** - * - * @param item - */ - remove(item:yfiles.graph.IModelItem):void; - /** - * Removes a previously added lookup chain element from the lookup of this. - * @param lookup The element to remove. - */ - removeLookup(lookup:yfiles.graph.IContextLookupChainLink):void; - /** - * Modifies the location of the given bend. - *

- * This implementation will also trigger an {@link yfiles.graph.DefaultGraph#invalidateDisplays} call. - *

- * @param bend the bend whose location is to be modified - * @param location the new coordinates of the bend - * @throws {Stubs.Exceptions.ArgumentError} If bend is not in this graph. - * @see yfiles.graph.DefaultGraph#addBend - */ - setBendLocation(bend:yfiles.graph.IBend,location:yfiles.geometry.Point):void; - /** - * Sets the ports of the given edge to the new values. - *

- * This will trigger an {@link yfiles.graph.DefaultGraph#addEdgePortsChangedListener EdgePortsChanged} event if source or - * target ports differ from the current ones. Both ports and the edge must belong to the current graph instance. If {@link yfiles.graph.IPortDefaults#autoCleanup} is - * enabled, this method will remove unoccupied ports after they have been changed. - *

- * @param edge The edge to change the ports. - * @param sourcePort The new source port instance. - * @param targetPort The new target port instance. - */ - setEdgePorts(edge:yfiles.graph.IEdge,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):void; - /** - * - * @param node - * @param isGroupNode - */ - setIsGroupNode(node:yfiles.graph.INode,isGroupNode:boolean):void; - /** - * - * @param label - * @param layoutParameter - */ - setLabelLayoutParameter(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):void; - /** - * - * @param label - * @param size - */ - setLabelPreferredSize(label:yfiles.graph.ILabel,size:yfiles.geometry.Size):void; - /** - * Sets the label text of the given label. - *

- * This implementation will {@link yfiles.graph.IGraph#adjustLabelPreferredSize adjust the preferred size} for the label if {@link yfiles.graph.ILabelDefaults#autoAdjustPreferredSize} is enabled. - *

- * @param label the label to modify - * @param text the new text of the label - * @throws {Stubs.Exceptions.ArgumentError} If label is not in this graph. - * @throws {Stubs.Exceptions.ArgumentError} If text is null. - * @see yfiles.graph.ILabel#text - */ - setLabelText(label:yfiles.graph.ILabel,text:string):void; - /** - * Sets the lookup implementation that will be used for {@link yfiles.graph.DefaultGraph#lookup} calls. - *

- * A value of null will revert to the default behavior. - *

- * @param lookup The lookup instance to delegate lookup calls to. - * @see yfiles.graph.DefaultGraph#addLookup - * @see yfiles.graph.DefaultGraph#getLookup - * @protected - */ - setLookupImplementation(lookup:yfiles.graph.ILookup):void; - /** - * Sets the layout of the given node to the new values. - *

- * This will trigger a call to {@link yfiles.graph.DefaultGraph#invalidateDisplays}. - *

- * @param node a live node that belongs to this graph - * @param layout the new absolute layout in world coordinates of the node - * @see yfiles.graph.INode#layout - */ - setNodeLayout(node:yfiles.graph.INode,layout:yfiles.geometry.Rect):void; - /** - * - * @param node - * @param parent - */ - setParent(node:yfiles.graph.INode,parent:yfiles.graph.INode):void; - /** - * - * @param port - * @param locationParameter - */ - setPortLocationParameter(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):void; - /** - * - * @param port - * @param style - */ - setStyle(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):void; - /** - * - * @param edge - * @param style - */ - setStyle(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):void; - /** - * Assigns the given style instance by reference to the label. - *

- * Style instances can be shared. - *

- *

- * This implementation will {@link yfiles.graph.IGraph#adjustLabelPreferredSize adjust the preferred size} for the label if {@link yfiles.graph.ILabelDefaults#autoAdjustPreferredSize} is enabled. - *

- * @param label The label that will be assigned the new style - * @param style The style instance that will be assigned to the label. - * @throws {Stubs.Exceptions.ArgumentError} If label is not in this graph. - * @throws {Stubs.Exceptions.ArgumentError} If style is null. - * @see yfiles.graph.ILabel#style - * @see yfiles.graph.DefaultGraph#onChangingLabelStyle - * @see yfiles.graph.DefaultGraph#addLabelStyleChangedListener - */ - setStyle(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):void; - /** - * Assigns the given style instance by reference to the node. - *

- * Style instances can be shared. - *

- * @param node The node that will be assigned the new style - * @param style The style instance that will be assigned to the node. - * @throws {Stubs.Exceptions.ArgumentError} If node is not in this graph. - * @throws {Stubs.Exceptions.ArgumentError} If style is null. - * @see yfiles.graph.INode#style - * @see yfiles.graph.DefaultGraph#onChangingNodeStyle - * @see yfiles.graph.DefaultGraph#addNodeStyleChangedListener - */ - setStyle(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):void; - /** - * Gets an {@link yfiles.graph.IContextLookup} that provides the default implementations returned by an - * {@link yfiles.graph.INode}'s lookup. - *

- * The provided default implementations can for example be used as fallback when the node lookup is wrapped. - *

- * @static - * @type {yfiles.graph.IContextLookup} - */ - static DEFAULT_NODE_LOOKUP:yfiles.graph.IContextLookup; - /** - * Gets an {@link yfiles.graph.IContextLookup} that provides the default implementations returned by an - * {@link yfiles.graph.IEdge}'s lookup. - *

- * The provided default implementations can for example be used as fallback when the edge lookup is wrapped. - *

- * @static - * @type {yfiles.graph.IContextLookup} - */ - static DEFAULT_EDGE_LOOKUP:yfiles.graph.IContextLookup; - /** - * Gets an {@link yfiles.graph.IContextLookup} that provides the default implementations returned by an - * {@link yfiles.graph.ILabel}'s lookup. - *

- * The provided default implementations can for example be used as fallback when the label lookup is wrapped. - *

- * @static - * @type {yfiles.graph.IContextLookup} - */ - static DEFAULT_LABEL_LOOKUP:yfiles.graph.IContextLookup; - /** - * Gets an {@link yfiles.graph.IContextLookup} that provides the default implementations returned by an - * {@link yfiles.graph.IPort}'s lookup. - *

- * The provided default implementations can for example be used as fallback when the port lookup is wrapped. - *

- * @static - * @type {yfiles.graph.IContextLookup} - */ - static DEFAULT_PORT_LOOKUP:yfiles.graph.IContextLookup; - /** - * Gets an {@link yfiles.graph.IContextLookup} that provides the default implementations returned by an - * {@link yfiles.graph.IBend}'s lookup. - *

- * The provided default implementations can for example be used as fallback when the bend lookup is wrapped. - *

- * @static - * @type {yfiles.graph.IContextLookup} - */ - static DEFAULT_BEND_LOOKUP:yfiles.graph.IContextLookup; - /** - * Gets the mapper registry that is associated with this graph instance. - *

- * The registry can be used to store data mappings for the items in this instance. This field is populated upon first - * access. Also this property provides write access. - *

- * @see yfiles.graph.IMapperRegistry - * @see yfiles.graph.IModelItem - * @see yfiles.graph.ITagOwner#tag - * @type {yfiles.graph.IMapperRegistry} - */ - mapperRegistry:yfiles.graph.IMapperRegistry; - /** - * Gets or sets whether or not the {@link yfiles.graph.UndoEngine} used for this instance should be enabled. - *

- * The default is false. In order to enable undoability for this instance, set this property to true and {@link yfiles.graph.DefaultGraph#lookup} - * the {@link yfiles.graph.UndoEngine} type. Disabling this property clears and removes the current {@link yfiles.graph.UndoEngine} (and - * all enqueued IUndoUnits). - *

- * @default false - * @type {boolean} - */ - undoEngineEnabled:boolean; - /** - * - * @type {yfiles.graph.IEdgeDefaults} - */ - edgeDefaults:yfiles.graph.IEdgeDefaults; - /** - * - * @type {yfiles.graph.INodeDefaults} - */ - nodeDefaults:yfiles.graph.INodeDefaults; - /** - * - * @type {yfiles.collections.IListEnumerable.} - */ - nodes:yfiles.collections.IListEnumerable; - /** - * - * @type {yfiles.collections.IListEnumerable.} - */ - labels:yfiles.collections.IListEnumerable; - /** - * - * @type {yfiles.collections.IListEnumerable.} - */ - ports:yfiles.collections.IListEnumerable; - /** - * - * @type {yfiles.collections.IListEnumerable.} - */ - edges:yfiles.collections.IListEnumerable; - /** - * - * @param listener - */ - addGraphTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeGraphTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addNodeCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - removeNodeCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - addNodeRemovedListener(listener:(sender:any,evt:yfiles.graph.NodeEventArgs)=>void):void; - /** - * - * @param listener - */ - removeNodeRemovedListener(listener:(sender:any,evt:yfiles.graph.NodeEventArgs)=>void):void; - /** - * - * @param listener - */ - addNodeStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeNodeStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addNodeLayoutChangedListener(listener:(source:any,node:yfiles.graph.INode,oldLayout:yfiles.geometry.Rect)=>void):void; - /** - * - * @param listener - */ - removeNodeLayoutChangedListener(listener:(source:any,node:yfiles.graph.INode,oldLayout:yfiles.geometry.Rect)=>void):void; - /** - * - * @param listener - */ - addNodeTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeNodeTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addEdgeCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - removeEdgeCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - addEdgeRemovedListener(listener:(sender:any,evt:yfiles.graph.EdgeEventArgs)=>void):void; - /** - * - * @param listener - */ - removeEdgeRemovedListener(listener:(sender:any,evt:yfiles.graph.EdgeEventArgs)=>void):void; - /** - * - * @param listener - */ - addEdgeStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeEdgeStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addEdgePortsChangedListener(listener:(sender:any,evt:yfiles.graph.EdgeEventArgs)=>void):void; - /** - * - * @param listener - */ - removeEdgePortsChangedListener(listener:(sender:any,evt:yfiles.graph.EdgeEventArgs)=>void):void; - /** - * - * @param listener - */ - addEdgeTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeEdgeTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addBendAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - removeBendAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - addBendRemovedListener(listener:(sender:any,evt:yfiles.graph.BendEventArgs)=>void):void; - /** - * - * @param listener - */ - removeBendRemovedListener(listener:(sender:any,evt:yfiles.graph.BendEventArgs)=>void):void; - /** - * - * @param listener - */ - addBendLocationChangedListener(listener:(source:any,bend:yfiles.graph.IBend,oldLocation:yfiles.geometry.Point)=>void):void; - /** - * - * @param listener - */ - removeBendLocationChangedListener(listener:(source:any,bend:yfiles.graph.IBend,oldLocation:yfiles.geometry.Point)=>void):void; - /** - * - * @param listener - */ - addBendTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeBendTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addLabelAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - removeLabelAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - addLabelRemovedListener(listener:(sender:any,evt:yfiles.graph.LabelEventArgs)=>void):void; - /** - * - * @param listener - */ - removeLabelRemovedListener(listener:(sender:any,evt:yfiles.graph.LabelEventArgs)=>void):void; - /** - * - * @param listener - */ - addLabelStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeLabelStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addLabelPreferredSizeChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeLabelPreferredSizeChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addLabelTextChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeLabelTextChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addLabelLayoutParameterChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeLabelLayoutParameterChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addLabelTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeLabelTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addPortAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - removePortAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - addPortRemovedListener(listener:(sender:any,evt:yfiles.graph.PortEventArgs)=>void):void; - /** - * - * @param listener - */ - removePortRemovedListener(listener:(sender:any,evt:yfiles.graph.PortEventArgs)=>void):void; - /** - * - * @param listener - */ - addPortStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removePortStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addPortLocationParameterChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removePortLocationParameterChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addPortTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removePortTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addDisplaysInvalidatedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * - * @param listener - */ - removeDisplaysInvalidatedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * - * @type {yfiles.graph.INodeDefaults} - */ - groupNodeDefaults:yfiles.graph.INodeDefaults; - /** - * - * @param listener - */ - addParentChangedListener(listener:(sender:any,evt:yfiles.graph.NodeEventArgs)=>void):void; - /** - * - * @param listener - */ - removeParentChangedListener(listener:(sender:any,evt:yfiles.graph.NodeEventArgs)=>void):void; - /** - * - * @param listener - */ - addIsGroupNodeChangedListener(listener:(sender:any,evt:yfiles.graph.NodeEventArgs)=>void):void; - /** - * - * @param listener - */ - removeIsGroupNodeChangedListener(listener:(sender:any,evt:yfiles.graph.NodeEventArgs)=>void):void; - /** - * - * @type {any} - */ - tag:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.DefaultGraph; - } - /** - * A simple mutable implementation of the {@link yfiles.graph.ILabel} interface that can be used stand-alone. - *

- * Note that this class is not the one used as the default implementation of a {@link yfiles.graph.DefaultGraph}'s - * {@link yfiles.graph.ILabel}s and casting them to {@link yfiles.graph.SimpleLabel} will fail. Instances of this class can be used without - * an accompanying graph instance. All of the properties are mutable. An example of a possible use case would be the - * rendering of a label into a graphics context: Simply create a - * {@link yfiles.graph.SimpleLabel}, associate a style with it and use the style's renderer instance to obtain a rendering for the - * label. - *

- * @class - * @implements {yfiles.graph.ILabel} - */ - export interface SimpleLabel extends yfiles.lang.Object,yfiles.graph.ILabel{} - export class SimpleLabel { - /** - * Creates an instance of the {@link yfiles.graph.SimpleLabel} class with default {@link yfiles.graph.DefaultGraph#DEFAULT_LABEL_LOOKUP lookup}, an instance of {@link yfiles.styles.VoidLabelStyle} - * and the given {@link yfiles.graph.ILabelModelParameter parameter}, text, and owner. - * @param layoutParameter The parameter that describes the label's layout. - * @param text The label's text. - * @param owner The label's owner. - */ - constructor(owner:yfiles.graph.ILabelOwner,text:string,layoutParameter:yfiles.graph.ILabelModelParameter); - /** - * Gets the {@link yfiles.styles.ILabelStyleRenderer#getPreferredSize} from the labels style and sets the {@link yfiles.graph.SimpleLabel#preferredSize} to that value. - */ - adoptPreferredSizeFromStyle():void; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * Gets or sets the label model's parameter that determines the positioning of this label. - *

- * Note that the label model parameter instance associated with a label instance may be shared between multiple label - * instances and that the modification of this instance or its {@link yfiles.graph.ILabelModelParameter#model} will result in a change of the positioning of all labels - * that are associated with the same parameter or model instance. - *

- * @type {yfiles.graph.ILabelModelParameter} - */ - layoutParameter:yfiles.graph.ILabelModelParameter; - /** - * Gets or sets the text string associated with this label. - *

- * It is up to the visualization engine to interpret this property for the visualization of the label. Normally, it will - * render the text into the {@link yfiles.graph.ILabel#layout layout} of this instance. - *

- * @type {string} - */ - text:string; - /** - * Gets or sets the style that is responsible for the visual representation of this node in a {@link yfiles.view.CanvasComponent}. - *

- * Note that the style instance associated with a label instance may be shared between multiple label instances and that - * the modification of this style will result in a change of the appearance of all labels that are associated with the same - * style instance. - *

- * @type {yfiles.styles.ILabelStyle} - */ - style:yfiles.styles.ILabelStyle; - /** - * Gets or sets the owner of this label. - *

- * Typically this will yield an instance of {@link yfiles.graph.INode} or {@link yfiles.graph.IEdge}. - *

- * @type {yfiles.graph.ILabelOwner} - */ - owner:yfiles.graph.ILabelOwner; - /** - * Gets or sets the preferred size of the label with respect to its current contents and the implementation of the - * visualization. - *

- * Often times the {@link yfiles.graph.ILabel#layout layout's} size will be the same as the preferred size, but it's up to the implementation of the {@link yfiles.graph.ILabelModel} - * to interpret it differently. - *

- * @type {yfiles.geometry.Size} - */ - preferredSize:yfiles.geometry.Size; - /** - * - * @type {any} - */ - tag:any; - /** - * Gets or sets the {@link yfiles.graph.ILookup} implementation used for calls to {@link yfiles.graph.SimpleLabel#lookup} on this - * instance. - * @type {yfiles.graph.ILookup} - */ - lookupImplementation:yfiles.graph.ILookup; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.SimpleLabel; - } - /** - * A simple mutable implementation of the {@link yfiles.graph.INode} interface that can be used stand-alone. - *

- * Note that this class is not the one used as the default implementation of a {@link yfiles.graph.DefaultGraph}'s - * {@link yfiles.graph.INode}s and casting them to {@link yfiles.graph.SimpleNode} will fail. - *

- *

- * Instances of this class can be used without an accompanying graph instance. All of the properties are mutable. An - * example of a possible use case would be the rendering of a node into a graphics context: Simply create a - * {@link yfiles.graph.SimpleNode}, associate a style with it and use the style's renderer instance to obtain a rendering for the - * node. - *

- * @class - * @implements {yfiles.graph.INode} - */ - export interface SimpleNode extends yfiles.lang.Object,yfiles.graph.INode{} - export class SimpleNode { - /** - * Creates a default node with default {@link yfiles.graph.DefaultGraph#DEFAULT_NODE_LOOKUP lookup}, an instance of {@link yfiles.styles.VoidNodeStyle}, empty {@link yfiles.graph.SimpleNode#layout} and no labels or ports. - *

- * The instances assigned to {@link yfiles.graph.SimpleNode#layout}, {@link yfiles.graph.SimpleNode#ports} and {@link yfiles.graph.SimpleNode#labels} are immutable by default. To modify the values of those properties, first assign an - * instance of a mutable class. - *

- */ - constructor(); - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * Gets or sets the layout of the node. - *

- * The layout of a node is a rectangle in the world coordinate system that describes the bounding box of the representation - * of a node. - *

- * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - /** - * Gets or sets the style that is responsible for the visual representation of this node in a {@link yfiles.view.CanvasComponent}. - *

- * Note that the style instance associated with a node instance may be shared between multiple node instances and that the - * modification of this style will result in a change of the appearance of all nodes that are associated with the same - * style instance. - *

- * @type {yfiles.styles.INodeStyle} - */ - style:yfiles.styles.INodeStyle; - /** - * Gets or sets the collection of {@link yfiles.graph.IPort ports} that are owned by this instance. - * @type {yfiles.collections.IListEnumerable.} - */ - ports:yfiles.collections.IListEnumerable; - /** - * Gets or sets the collection of {@link yfiles.graph.ILabel labels} that are owned by this instance. - * @type {yfiles.collections.IListEnumerable.} - */ - labels:yfiles.collections.IListEnumerable; - /** - * - * @type {any} - */ - tag:any; - /** - * Gets or sets the {@link yfiles.graph.ILookup} implementation used for calls to {@link yfiles.graph.SimpleNode#lookup} on this instance. - * @type {yfiles.graph.ILookup} - */ - lookupImplementation:yfiles.graph.ILookup; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.SimpleNode; - } - /** - * A simple mutable implementation of the {@link yfiles.graph.IPort} interface that can be used stand-alone. - *

- * Note that this class is not the one used as the default implementation of a {@link yfiles.graph.DefaultGraph}'s - * {@link yfiles.graph.IPort}s and casting them to {@link yfiles.graph.SimplePort} will fail. Instances of this class can be used without - * an accompanying graph instance. All of the properties are mutable. An example of a possible use case would be the - * rendering of a port into a graphics context: Simply create a - * {@link yfiles.graph.SimplePort}, associate a style with it and use the style's renderer instance to obtain a rendering for the - * port. - *

- * @class - * @implements {yfiles.graph.IPort} - */ - export interface SimplePort extends yfiles.lang.Object,yfiles.graph.IPort{} - export class SimplePort { - /** - * Creates a port with a {@link yfiles.graph.DefaultGraph#DEFAULT_PORT_LOOKUP default lookup} using the given location and owner. - *

- * While technically the owner can be null here, this can cause issues, e.g. with {@link yfiles.graph.IPortLocationModel port location models} that position the - * port relative to its owner. - *

- * @param owner The port's owner. - * @param locationParameter The port's location model parameter. - */ - constructor(owner:yfiles.graph.IPortOwner,locationParameter:yfiles.graph.IPortLocationModelParameter); - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * Sets the location of this port. - * @param location - */ - setLocation(location:yfiles.geometry.Point):void; - /** - * Gets or sets the style that is responsible for the visual representation of this port in a {@link yfiles.view.CanvasComponent}. - *

- * Note that the style instance associated with a port instance may be shared between multiple port instances and that the - * modification of this style will result in a change of the appearance of all ports that are associated with the same - * style instance. - *

- * @type {yfiles.styles.IPortStyle} - */ - style:yfiles.styles.IPortStyle; - /** - * Gets or sets the {@link yfiles.graph.IPortLocationModelParameter} that is used to determine the location of this port. - *

- * The port location can be calculated using the {@link yfiles.graph.IPortLocationModelParameter#model}'s {@link yfiles.graph.IPortLocationModel#getLocation} method or the convenience - * methods {@link yfiles.graph.IPort#location} and {@link yfiles.graph.IPort#dynamicLocation}. - *

- *

- * Note that parameters may be shared across port instances. - *

- * @see yfiles.graph.IGraph#setPortLocationParameter - * @see yfiles.graph.IPort#location - * @see yfiles.graph.IPort#dynamicLocation - * @type {yfiles.graph.IPortLocationModelParameter} - */ - locationParameter:yfiles.graph.IPortLocationModelParameter; - /** - * Gets or sets the owner of this port. - * @type {yfiles.graph.IPortOwner} - */ - owner:yfiles.graph.IPortOwner; - /** - * - * @type {any} - */ - tag:any; - /** - * Gets or sets the {@link yfiles.graph.ILookup} implementation used for calls to {@link yfiles.graph.SimplePort#lookup} on this instance. - * @type {yfiles.graph.ILookup} - */ - lookupImplementation:yfiles.graph.ILookup; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.SimplePort; - } - /** - * A label model that wraps an existing label model and decorates it with a {@link yfiles.graph.ILabelCandidateDescriptor descriptor}. - * @class - * @implements {yfiles.graph.ILabelModel} - * @implements {yfiles.graph.ILabelCandidateDescriptorProvider} - * @implements {yfiles.graph.ILabelModelParameterProvider} - */ - export interface DescriptorWrapperLabelModel extends yfiles.lang.Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelCandidateDescriptorProvider,yfiles.graph.ILabelModelParameterProvider{} - export class DescriptorWrapperLabelModel { - /** - * Initializes a new instance of the {@link yfiles.graph.DescriptorWrapperLabelModel} class. - * @param innerModel The wrapped label model. - */ - constructor(innerModel:yfiles.graph.ILabelModel); - /** - * Initializes a new instance of the {@link yfiles.graph.DescriptorWrapperLabelModel} class. - * @param {Object} options The parameters to pass. - * @param options.innerModel The wrapped label model. - * @param {yfiles.graph.ILabelCandidateDescriptor} options.descriptor The descriptor. - *

- * This option sets the {@link yfiles.graph.DescriptorWrapperLabelModel#descriptor} property on the created object. - *

- */ - constructor(options:{innerModel:yfiles.graph.ILabelModel,descriptor?:yfiles.graph.ILabelCandidateDescriptor}); - /** - * Creates a new instance that uses {@link yfiles.graph.FreeLabelModel#INSTANCE} as inner model. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.graph.ILabelCandidateDescriptor} options.descriptor The descriptor. - *

- * This option sets the {@link yfiles.graph.DescriptorWrapperLabelModel#descriptor} property on the created object. - *

- * @param {yfiles.graph.ILabelModel} options.innerModel The inner label model - *

- * This option sets the {@link yfiles.graph.DescriptorWrapperLabelModel#innerModel} property on the created object. - *

- */ - constructor(options?:{descriptor?:yfiles.graph.ILabelCandidateDescriptor,innerModel?:yfiles.graph.ILabelModel}); - /** - * Creates a default parameter that can be used for this model. - * @returns The default parameter from {@link #innerModel} - */ - createDefaultParameter():yfiles.graph.ILabelModelParameter; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getDescriptor(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILabelCandidateDescriptor; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; - /** - * - * @param label - * @param model - * @returns - */ - getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * Gets or sets the descriptor. - * @type {yfiles.graph.ILabelCandidateDescriptor} - */ - descriptor:yfiles.graph.ILabelCandidateDescriptor; - /** - * Gets or sets the inner label model - * @type {yfiles.graph.ILabelModel} - */ - innerModel:yfiles.graph.ILabelModel; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.DescriptorWrapperLabelModel; - } - /** - * A data holder that can be used to describe a {@link yfiles.graph.IFoldingView#isInFoldingState folding} edge that connects to nodes inside a collapsed group or to other - * folder nodes in a {@link yfiles.graph.IFoldingView}. - *

- * Instances of this type are passed to the various methods in {@link yfiles.graph.FoldingManager} to identify different possible - * states of an edge inside {@link yfiles.graph.IFoldingView}s. A folding edge is identified through the master edge, which is an - * edge in the {@link yfiles.graph.FoldingManager#masterGraph} and a source and target node. Also whether those source and target nodes are currently {@link yfiles.graph.IFoldingView#isInFoldingState folder} nodes needs - * to be taken into account. The source and target nodes need to be either the true {@link yfiles.graph.IPort#owner owners} of the adjacent edge's {@link yfiles.graph.IEdge#sourcePort} and {@link yfiles.graph.IEdge#targetPort} - * respectively, or {@link yfiles.graph.IGraph#getParent ancestor} group nodes in the {@link yfiles.graph.FoldingManager#masterGraph}. In the latter case these folding edges are used to describe the state of - * the folding edges that are present in the views of the corresponding group nodes are in {@link yfiles.graph.IFoldingView#collapse collapsed} state, so that the - * true source and target nodes are not currently visible in the view. As such the {@link yfiles.graph.FoldingEdgeStateId#currentMasterSource} and {@link yfiles.graph.FoldingEdgeStateId#currentMasterTarget} nodes represent the {@link yfiles.graph.IFoldingView#getMasterItem masters} of the - * nearest ancestors in the {@link yfiles.graph.FoldingManager#masterGraph} that are visible in the {@link yfiles.graph.IFoldingView folding view} graph. - *

- * @see yfiles.graph.FoldingManager#hasFoldingEdgeState - * @see yfiles.graph.FoldingManager#getFoldingEdgeState - * @see yfiles.graph.IFoldingView#isInFoldingState - * @class - */ - export interface FoldingEdgeStateId extends yfiles.lang.Object{} - export class FoldingEdgeStateId { - /** - * Initializes an id for a folding edge in a {@link yfiles.graph.IFoldingView view} that represent a master edge and connects a specific pair of nodes. - *

- * All of the arguments need to be entities of the {@link yfiles.graph.FoldingManager#masterGraph master graph}. - *

- * @param masterEdge An edge in the {@link #masterGraph} that is represented by the folding edge. - * @param currentMasterSource The source node of the edge or one of its ancestors to which the folding edge connects in the view, if the actual parent - * is currently {@link #collapse collapsed in an ancestor node}. - * @param sourceCollapsed true if the currentMasterSource is the true source of the masterEdge, but is in its {@link #collapse collapsed/dummy} state. - * @param targetCollapsed true if the currentMasterTarget is the true target of the masterEdge, but is in its {@link #collapse collapsed/dummy} state. - * @param currentMasterTarget The target node of the edge or one of its ancestors to which the folding edge connects in the view, if the actual parent - * is currently {@link #collapse collapsed in an ancestor node}. - */ - constructor(masterEdge:yfiles.graph.IEdge,currentMasterSource:yfiles.graph.INode,sourceCollapsed:boolean,currentMasterTarget:yfiles.graph.INode,targetCollapsed:boolean); - /** - * Initializes an id for a folding edge that is currently part of the given view. - * @param foldingView The view the folding edge is part of. - * @param foldingEdge The instance that is part of the {@link #graph folding view graph}. - */ - constructor(foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge); - /** - * Gets the edge instance in the {@link yfiles.graph.FoldingManager#masterGraph} that is represented by the folding edge in a view. - * @type {yfiles.graph.IEdge} - */ - masterEdge:yfiles.graph.IEdge; - /** - * Gets the source node of the edge or an ancestor (both in the {@link yfiles.graph.FoldingManager#masterGraph}). - *

- * This may be an ancestor of the true source node if this ancestor is {@link yfiles.graph.IFoldingView#collapse collapsed}. More specific it is the source node of - * the {@link yfiles.graph.FoldingEdgeStateId#masterEdge} if the source node is represented in the view and otherwise the first ancestor of the source node which is - * represented in the view. - *

- * @type {yfiles.graph.INode} - */ - currentMasterSource:yfiles.graph.INode; - /** - * Gets the target node of the edge or an ancestor (both in the {@link yfiles.graph.FoldingManager#masterGraph}). - *

- * This may be an ancestor of the true target node if this ancestor is {@link yfiles.graph.IFoldingView#collapse collapsed}. More precisely it is the target node of - * the {@link yfiles.graph.FoldingEdgeStateId#masterEdge} if the target node is represented in the view and otherwise the first ancestor of the target node which is - * represented in the view. - *

- * @type {yfiles.graph.INode} - */ - currentMasterTarget:yfiles.graph.INode; - /** - * Gets whether the {@link yfiles.graph.FoldingEdgeStateId#currentMasterSource} node {@link yfiles.graph.IFoldingView#isInFoldingState is in folder state}. - *

- * Since an edge will be converted to a folding edge if the adjacent node itself will be {@link yfiles.graph.IFoldingView#collapse collapsed} to a folder node, this - * property determines which state the source node is in for this folding edge. - *

- * @type {boolean} - */ - sourceIsCollapsed:boolean; - /** - * Gets whether the {@link yfiles.graph.FoldingEdgeStateId#currentMasterTarget} node {@link yfiles.graph.IFoldingView#isInFoldingState is in folder state}. - *

- * Since an edge will be converted to a folding edge if the adjacent node itself will be {@link yfiles.graph.IFoldingView#collapse collapsed} to a folder node, this - * property determines which state the source node is in for this folding edge. - *

- * @type {boolean} - */ - targetIsCollapsed:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.FoldingEdgeStateId; - } - /** - * An edge label model that allows placement of labels along the edge path at a set of continuous positions at specified - * {@link yfiles.graph.EdgePathLabelModel#sideOfEdge sides of the edge path}. - *

- * The set of positions can be influenced by specifying the {@link yfiles.graph.EdgePathLabelModel#sideOfEdge} value that controls on which side of the edge labels positions - * should be considered. Furthermore, it's possible to specify distance values that control the distance between label and - * edge and between label and nodes. - *

- *

- * If a label model parameter is created {@link yfiles.graph.EdgeSides#ON_EDGE}, the label's center is usually placed on the edge. - * It can be shifted by specifying a {@link yfiles.graph.EdgePathLabelModel#offset} value but the {@link yfiles.graph.EdgePathLabelModel#distance} value is ignored. For all other values of {@link yfiles.graph.EdgeSides} the - * total distance between the label bounds and the edge path is the sum of {@link yfiles.graph.EdgePathLabelModel#offset} and {@link yfiles.graph.EdgePathLabelModel#distance}. - *

- *

- * The label placements use a {@link yfiles.graph.EdgePathLabelModel#createRatioParameter ratio} value as fraction of the full edge path length. This is the main difference to the {@link yfiles.graph.EdgePathLabelModel} - * which uses a specified segment index from the {@link yfiles.graph.EdgeSegmentLabelModel#createParameterFromSource source} or {@link yfiles.graph.EdgeSegmentLabelModel#createParameterFromTarget target} side and a ratio on this segment. - *

- * @class - * @implements {yfiles.graph.ILabelModel} - * @implements {yfiles.graph.ILabelModelParameterProvider} - * @implements {yfiles.graph.ILabelModelParameterFinder} - */ - export interface EdgePathLabelModel extends yfiles.lang.Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider,yfiles.graph.ILabelModelParameterFinder{} - export class EdgePathLabelModel { - /** - * Initializes a new instance of the {@link yfiles.graph.EdgePathLabelModel} class. - * @param distance the distance to the edge. - * @param offset the offset to the default placement. - * @param angle the angle of the label's rotation in radians. - * @param autoRotationEnabled if set to true auto rotation is enabled. - * @param sideOfEdge the side of the edge labels. - */ - constructor(distance:number,offset:number,angle:number,autoRotationEnabled:boolean,sideOfEdge:yfiles.graph.EdgeSides); - /** - * Returns a new instance of {@link yfiles.graph.EdgePathLabelModel} class. - * @param {Object} [options=null] The parameters to pass. - * @param {number} options.angle The rotation angle of all labels with this model in radians. - *

- * This option sets the {@link yfiles.graph.EdgePathLabelModel#angle} property on the created object. - *

- * @param {boolean} options.autoRotationEnabled Whether edge labels are automatically rotated according to the angle of the corresponding reference edge segment. - *

- * This option sets the {@link yfiles.graph.EdgePathLabelModel#autoRotationEnabled} property on the created object. - *

- * @param {number} options.distance The distance between the label box and the edge path. - *

- * This option sets the {@link yfiles.graph.EdgePathLabelModel#distance} property on the created object. - *

- * @param {number} options.offset The offset of the label box and the edge path relative to the default placement. - *

- * This option sets the {@link yfiles.graph.EdgePathLabelModel#offset} property on the created object. - *

- * @param {yfiles.graph.EdgeSides} options.sideOfEdge The side placement specifiers for edge labels. - *

- * This option sets the {@link yfiles.graph.EdgePathLabelModel#sideOfEdge} property on the created object. - *

- */ - constructor(options?:{angle?:number,autoRotationEnabled?:boolean,distance?:number,offset?:number,sideOfEdge?:yfiles.graph.EdgeSides}); - /** - * A model parameter that encodes the default position of this model's allowed edge label positions. - *

- * Returns a model parameter that encodes the default position of this model's allowed edge label positions. - *

- * @returns - */ - createDefaultParameter():yfiles.graph.ILabelModelParameter; - /** - * Creates a parameter at the provided edge path ratio. - * @param edgePathRatio The ratio at which to place the label at the edge path. A ratio of 0.0 will place the label at the source side of the - * edge path, a ratio of 1.0 at the target side. - * @param sideOfEdge The side of the edge the label is placed on. Note that only single enum values but no combined ones are allowed. - * @returns A label parameter at the provided edge path ratio for this model instance. - */ - createRatioParameter(edgePathRatio:number,sideOfEdge:yfiles.graph.EdgeSides):yfiles.graph.ILabelModelParameter; - /** - * Returns an empty context. - * @param label The label to use in the context. - * @param layoutParameter The parameter to use for the label in the context. - * @returns An empty context. - */ - getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * Gets or sets the side placement specifiers for edge labels. - *

- * The label model parameter {@link yfiles.graph.ILabelModelParameterFinder finder} and {@link yfiles.graph.ILabelModelParameterProvider provider} returned by {@link yfiles.graph.EdgePathLabelModel#lookup} consider the specified - * sides. - *

- * @see yfiles.graph.EdgeSides - * @default 'OnEdge, LeftOfEdge, RightOfEdge' - * @type {yfiles.graph.EdgeSides} - */ - sideOfEdge:yfiles.graph.EdgeSides; - /** - * Gets or sets the distance between the label box and the edge path. - *

- * The interpretation of the values depends on the {@link yfiles.graph.EdgePathLabelModel#sideOfEdge} of the individual {@link yfiles.graph.ILabelModelParameter}. - *

- *

- * Note that for {@link yfiles.graph.EdgeSides#ON_EDGE} this property is ignored. For all other values of {@link yfiles.graph.EdgeSides} - * the {@link yfiles.graph.EdgePathLabelModel#offset} property is added to this distance. - *

- * @see yfiles.graph.EdgePathLabelModel#sideOfEdge - * @see yfiles.graph.EdgeSides - * @see yfiles.graph.EdgePathLabelModel#offset - * @default 0.0 - * @type {number} - */ - distance:number; - /** - * Gets or sets the offset of the label box and the edge path relative to the default placement. - *

- * For {@link yfiles.graph.EdgeSides#ON_EDGE} this is the offset between the center of the label box and the edge path. For all - * other {@link yfiles.graph.EdgeSides} values this offset is added to the {@link yfiles.graph.EdgePathLabelModel#distance} property which results in the total distance between - * the label box and the edge path. - *

- * @see yfiles.graph.EdgePathLabelModel#sideOfEdge - * @see yfiles.graph.EdgeSides - * @default 0.0 - * @type {number} - */ - offset:number; - /** - * Gets or sets whether edge labels are automatically rotated according to the angle of the corresponding reference edge - * segment. - *

- * By default, this feature is enabled. - *

- * @default true - * @type {boolean} - */ - autoRotationEnabled:boolean; - /** - * Gets or sets the rotation angle of all labels with this model in radians. - * @default 0.0 - * @type {number} - */ - angle:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.EdgePathLabelModel; - } - /** - * An edge label model that allows placement of labels relative to an edge segment at a set of continuous positions at - * specified {@link yfiles.graph.EdgeSegmentLabelModel#sideOfEdge sides of the edge path}. - *

- * The set of positions can be influenced by specifying the {@link yfiles.graph.EdgeSegmentLabelModel#sideOfEdge} value that controls on which side of the edge labels positions - * should be considered. Furthermore, it's possible to specify distance values that control the distance between label and - * edge and between label and nodes. - *

- *

- * If a label model parameter is created {@link yfiles.graph.EdgeSides#ON_EDGE}, the label's center is usually placed on the edge. - * It can be shifted by specifying a {@link yfiles.graph.EdgeSegmentLabelModel#offset} value but the {@link yfiles.graph.EdgeSegmentLabelModel#distance} value is ignored. For all other values of {@link yfiles.graph.EdgeSides} the - * total distance between the label bounds and the edge path is the sum of {@link yfiles.graph.EdgeSegmentLabelModel#offset} and {@link yfiles.graph.EdgeSegmentLabelModel#distance}. - *

- *

- * The label placements use a specified segment index from the {@link yfiles.graph.EdgeSegmentLabelModel#createParameterFromSource source} or {@link yfiles.graph.EdgeSegmentLabelModel#createParameterFromTarget target} side and a ratio on this segment. This is - * the main difference to the {@link yfiles.graph.EdgePathLabelModel} which only uses a ratio value of the full edge path. - *

- * @class - * @implements {yfiles.graph.ILabelModel} - * @implements {yfiles.graph.ILabelModelParameterProvider} - * @implements {yfiles.graph.ILabelModelParameterFinder} - */ - export interface EdgeSegmentLabelModel extends yfiles.lang.Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider,yfiles.graph.ILabelModelParameterFinder{} - export class EdgeSegmentLabelModel { - /** - * Initializes a new instance of the {@link yfiles.graph.EdgeSegmentLabelModel} class. - * @param distance the distance to the edge. - * @param offset the offset to the default placement. - * @param angle the angle of the label's rotation in radians. - * @param autoRotationEnabled if set to true auto rotation is enabled. - * @param sideOfEdge the side of the edge labels. - */ - constructor(distance:number,offset:number,angle:number,autoRotationEnabled:boolean,sideOfEdge:yfiles.graph.EdgeSides); - /** - * Returns a new instance of {@link yfiles.graph.EdgeSegmentLabelModel}. - * @param {Object} [options=null] The parameters to pass. - * @param {number} options.angle The rotation angle of all labels with this model in radians. - *

- * This option sets the {@link yfiles.graph.EdgeSegmentLabelModel#angle} property on the created object. - *

- * @param {boolean} options.autoRotationEnabled Whether edge labels are automatically rotated according to the angle of the corresponding reference edge segment. - *

- * This option sets the {@link yfiles.graph.EdgeSegmentLabelModel#autoRotationEnabled} property on the created object. - *

- * @param {number} options.distance The distance between the label box and the edge path. - *

- * This option sets the {@link yfiles.graph.EdgeSegmentLabelModel#distance} property on the created object. - *

- * @param {number} options.offset The offset of the label box and the edge path relative to the default placement. - *

- * This option sets the {@link yfiles.graph.EdgeSegmentLabelModel#offset} property on the created object. - *

- * @param {yfiles.graph.EdgeSides} options.sideOfEdge The side placement specifiers for edge labels. - *

- * This option sets the {@link yfiles.graph.EdgeSegmentLabelModel#sideOfEdge} property on the created object. - *

- */ - constructor(options?:{angle?:number,autoRotationEnabled?:boolean,distance?:number,offset?:number,sideOfEdge?:yfiles.graph.EdgeSides}); - /** - * A model parameter that encodes the default position of this model's allowed edge label positions. - *

- * Returns a model parameter that encodes the default position of this model's allowed edge label positions. - *

- * @returns - */ - createDefaultParameter():yfiles.graph.ILabelModelParameter; - /** - * Creates a parameter where the label is attached to the edge segment that contains the edge's midpoint. - * @param segmentRatio The ratio at which to place the label at the segment. A ratio of 0.0 will place the label at the source side of the - * segment, a ratio of 1.0 at the target side. Ratios < 0.0 or > 1.0 will be interpreted as absolute values in world - * coordinates. - * @param sideOfEdge The side of the edge the label is placed on. Note that only single enum values but no combined ones are allowed. - * @returns A label parameter that describes the provided parameters for this model instance. - */ - createParameterFromCenter(segmentRatio:number,sideOfEdge:yfiles.graph.EdgeSides):yfiles.graph.ILabelModelParameter; - /** - * Creates a parameter that measures the provided segment index from the source side of the edge path. - * @param segmentIndex The zero-based index of the segment beginning from the source side. - * @param segmentRatio The ratio at which to place the label at the segment. A ratio of 0.0 will place the label at the source side of the - * segment, a ratio of 1.0 at the target side. Ratios < 0.0 or > 1.0 will be interpreted as absolute values in world - * coordinates. - * @param sideOfEdge The side of the edge the label is placed on. Note that only single enum values but no combined ones are allowed. - * @returns A label parameter that describes the provided parameters for this model instance. - */ - createParameterFromSource(segmentIndex:number,segmentRatio:number,sideOfEdge:yfiles.graph.EdgeSides):yfiles.graph.ILabelModelParameter; - /** - * Creates a parameter that measures the provided segment index from the target side of the edge path. - * @param segmentIndex The zero-based index of the segment beginning from the target side. - * @param segmentRatio The ratio at which to place the label at the segment. A ratio of 0.0 will place the label at the target side of the - * segment, a ratio of 1.0 at the source side. Ratios < 0.0 or > 1.0 will be interpreted as absolute values in world - * coordinates. - * @param sideOfEdge The side of the edge the label is placed on. Note that only single enum values but no combined ones are allowed. - * @returns A label parameter that describes the provided parameters for this model instance. - */ - createParameterFromTarget(segmentIndex:number,segmentRatio:number,sideOfEdge:yfiles.graph.EdgeSides):yfiles.graph.ILabelModelParameter; - /** - * Returns an empty context. - * @param label The label to use in the context. - * @param layoutParameter The parameter to use for the label in the context. - * @returns An empty context. - */ - getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * Gets or sets the side placement specifiers for edge labels. - *

- * The label model parameter {@link yfiles.graph.ILabelModelParameterFinder finder} and {@link yfiles.graph.ILabelModelParameterProvider provider} returned by {@link yfiles.graph.EdgeSegmentLabelModel#lookup} consider the - * specified sides. - *

- * @see yfiles.graph.EdgeSides - * @default 'OnEdge, LeftOfEdge, RightOfEdge' - * @type {yfiles.graph.EdgeSides} - */ - sideOfEdge:yfiles.graph.EdgeSides; - /** - * Gets or sets the distance between the label box and the edge path. - *

- * The interpretation of the values depends on the {@link yfiles.graph.EdgeSegmentLabelModel#sideOfEdge} of the individual {@link yfiles.graph.ILabelModelParameter}. - *

- *

- * Note that for {@link yfiles.graph.EdgeSides#ON_EDGE} this property is ignored. For all other values of {@link yfiles.graph.EdgeSides} - * the {@link yfiles.graph.EdgeSegmentLabelModel#offset} property is added to this distance. - *

- * @see yfiles.graph.EdgeSegmentLabelModel#sideOfEdge - * @see yfiles.graph.EdgeSides - * @see yfiles.graph.EdgeSegmentLabelModel#offset - * @default 0.0 - * @type {number} - */ - distance:number; - /** - * Gets or sets the offset of the label box and the edge path relative to the default placement. - *

- * For {@link yfiles.graph.EdgeSides#ON_EDGE} this is the offset between the center of the label box and the edge path. For all - * other {@link yfiles.graph.EdgeSides} values this offset is added to the {@link yfiles.graph.EdgeSegmentLabelModel#distance} property which results in the total distance between - * the label box and the edge path. - *

- * @see yfiles.graph.EdgeSegmentLabelModel#sideOfEdge - * @see yfiles.graph.EdgeSides - * @default 0.0 - * @type {number} - */ - offset:number; - /** - * Gets or sets whether edge labels are automatically rotated according to the angle of the corresponding reference edge - * segment. - *

- * By default, this feature is enabled. - *

- * @default true - * @type {boolean} - */ - autoRotationEnabled:boolean; - /** - * Gets or sets the rotation angle of all labels with this model in radians. - * @default 0.0 - * @type {number} - */ - angle:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.EdgeSegmentLabelModel; - } - export enum EdgeSides{ - /** - * The label should be placed on the path of the edge. - */ - ON_EDGE, - /** - * The label should be placed on the left hand side of the edge path if looking from the source node into the direction of - * the target node. - */ - LEFT_OF_EDGE, - /** - * The label should be placed on the right hand side of the edge path if looking from the source node into the direction of - * the target node. - */ - RIGHT_OF_EDGE, - /** - * The label should be placed above the edge (in geometric sense). - */ - ABOVE_EDGE, - /** - * The label should be placed below the edge (in geometric sense). - */ - BELOW_EDGE - } - export enum PlaceAlongEdge{ - /** - * The segment index is counted from the edge source. - */ - AT_SOURCE, - /** - * The segment index is counted from the edge target. - */ - AT_TARGET, - /** - * The label is at the center of the edge and the segment index is ignored. - */ - AT_CENTER - } - export enum ExteriorLabelModelPosition{ - /** - * Encodes a position outside the node at the top - */ - NORTH, - /** - * Encodes a position outside the node at the right side - */ - EAST, - /** - * Encodes a position outside the node at the bottom - */ - SOUTH, - /** - * Encodes a position outside the node at the left side - */ - WEST, - /** - * Encodes a position outside the node at the upper right corner - */ - NORTH_EAST, - /** - * Encodes a position outside the node at the lower right corner - */ - SOUTH_EAST, - /** - * Encodes a position outside the node at the upper left corner - */ - NORTH_WEST, - /** - * Encodes a position outside the node at the lower left corner - */ - SOUTH_WEST - } - /** - * A label model for node labels that lie outside of the node's {@link yfiles.graph.INode#layout} bounds. - *

- * This label model supports eight positions outside of the layout's bounds. - *

- * @class - * @implements {yfiles.graph.ILabelModel} - * @implements {yfiles.graph.ILabelModelParameterProvider} - */ - export interface ExteriorLabelModel extends yfiles.lang.Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{} - export class ExteriorLabelModel { - /** - * Creates a new instance of this model - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.geometry.Insets} options.insets The insets to use by this model. - *

- * This option sets the {@link yfiles.graph.ExteriorLabelModel#insets} property on the created object. - *

- */ - constructor(options?:{insets?:yfiles.geometry.Insets}); - /** - * - * @returns - */ - createDefaultParameter():yfiles.graph.ILabelModelParameter; - /** - * Creates a new parameter that is associated with this instance for the provided position. - * @param position The position constant that describes the position of the label. - * @returns A new parameter instance. - */ - createParameter(position:yfiles.graph.ExteriorLabelModelPosition):yfiles.graph.ILabelModelParameter; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; - /** - * - * @param label - * @param model - * @returns - */ - getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.ExteriorLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static NORTH:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.ExteriorLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static EAST:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.ExteriorLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static SOUTH:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.ExteriorLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static SOUTH_EAST:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.ExteriorLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static SOUTH_WEST:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.ExteriorLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static WEST:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.ExteriorLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static NORTH_EAST:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.ExteriorLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static NORTH_WEST:yfiles.graph.ILabelModelParameter; - /** - * Gets or sets the insets to use by this model. - *

- * The insets are in fact "outsets", i.e. they are treated as margins. Positive values will increase the distance of the - * labels to the node. - *

- * @default '0' - * @type {yfiles.geometry.Insets} - */ - insets:yfiles.geometry.Insets; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.ExteriorLabelModel; - } - /** - * An {@link yfiles.graph.IGraph} that contains a live subgraph of another {@link yfiles.graph.IGraph}. - *

- * {@link yfiles.graph.FilteredGraphWrapper} is a decorator for another {@link yfiles.graph.IGraph} instance and can be used to retain only - * a subset of nodes and edges of the original graph. The properties {@link yfiles.graph.FilteredGraphWrapper#nodePredicate} and {@link yfiles.graph.FilteredGraphWrapper#edgePredicate} control which nodes and edges are retained in - * the filtered graph. Edges adjacent to filtered nodes are also filtered automatically (as their source or target would - * not be in the graph anyway). - *

- *

- * Note that {@link yfiles.graph.FilteredGraphWrapper} has to listen to events raised by the wrapped graph to keep itself updated, - * so {@link yfiles.graph.FilteredGraphWrapper#dispose} should be called if this instance is not used any more. Otherwise the - * wrapped graph may be kept alive for longer than necessary. - *

- *

- * {@link yfiles.graph.IPortOwner#ports} at {@link yfiles.graph.IEdge}s (i.e. edge-to-edge connections) are not fully supported. - *

- *

Related demos:

- *
    - *
  • Demo: OrgChart, Demo.yFiles.Graph.OrgChart
  • - *
  • Demo: Collapsible Tree, Demo.yFiles.Graph.Collapse
  • - *
- * @class - * @extends {yfiles.graph.GraphWrapperBase} - * @final - */ - export interface FilteredGraphWrapper extends yfiles.graph.GraphWrapperBase{} - export class FilteredGraphWrapper { - /** - * Creates a new graph instance that wraps the original graph and uses the predicates to determine which nodes and edges - * should be contained in the graph. - *

- * Note that this instance will register listeners with the graph, so {@link yfiles.graph.FilteredGraphWrapper#dispose} should be - * called if this instance is not used any more. - *

- * @param graph The graph to wrap - * @param nodePredicate The predicate that determines which nodes to keep. - * @param edgePredicate The predicate that determines which edges to keep. - */ - constructor(graph:yfiles.graph.IGraph,nodePredicate:(obj:yfiles.graph.INode)=>boolean,edgePredicate:(obj:yfiles.graph.IEdge)=>boolean); - /** - * Should be called by the client if the {@link yfiles.graph.FilteredGraphWrapper#edgePredicate} changed for the given edge in the graph. - * @param edge - */ - edgePredicateChanged(edge:yfiles.graph.IEdge):void; - /** - * Should be called by the client if the {@link yfiles.graph.FilteredGraphWrapper#edgePredicate} changed for the edge in the graph. - */ - edgePredicateChanged():void; - /** - * Should be called by clients if the {@link yfiles.graph.FilteredGraphWrapper#nodePredicate} changed for the given node. - * @param node The node. - */ - nodePredicateChanged(node:yfiles.graph.INode):void; - /** - * Should be called by the client if the {@link yfiles.graph.FilteredGraphWrapper#nodePredicate} changed for the nodes in the graph. - */ - nodePredicateChanged():void; - /** - * Gets the predicate function for the nodes. - * @type {function(yfiles.graph.INode): boolean} - */ - nodePredicate:(obj:yfiles.graph.INode)=>boolean; - /** - * Gets the predicate function for the edges. - * @type {function(yfiles.graph.IEdge): boolean} - */ - edgePredicate:(obj:yfiles.graph.IEdge)=>boolean; - /** - * - * @type {yfiles.collections.IListEnumerable.} - */ - nodes:yfiles.collections.IListEnumerable; - /** - * - * @type {yfiles.collections.IListEnumerable.} - */ - edges:yfiles.collections.IListEnumerable; - /** - * - * @type {yfiles.collections.IListEnumerable.} - */ - labels:yfiles.collections.IListEnumerable; - /** - * - * @type {yfiles.collections.IListEnumerable.} - */ - ports:yfiles.collections.IListEnumerable; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.FilteredGraphWrapper; - } - /** - * An edge label model that can be used to describe any position and orientation of a label. - *

- * The position of the label is stored relative to the positions of the ports of the edge the label belongs to. - *

- * @class - * @implements {yfiles.graph.ILabelModelParameterFinder} - * @implements {yfiles.graph.ILabelModel} - */ - export interface FreeEdgeLabelModel extends yfiles.lang.Object,yfiles.graph.ILabelModelParameterFinder,yfiles.graph.ILabelModel{} - export class FreeEdgeLabelModel { - /** - * - * @returns - */ - createDefaultParameter():yfiles.graph.ILabelModelParameter; - /** - * Creates a parameter for the given location. - * @param ratio The ratio at which the label will be anchored between the location of the source port and the location of the target - * port. - * @param distance The distance orthogonally to the connection between the source and target point. - * @param angle The angle by which the label should be rotated. - * @returns A parameter that describes the position. - * @see yfiles.graph.FreeEdgeLabelModel#edgeRelativeAngle - */ - createEdgeAnchored(ratio:number,distance:number,angle:number):yfiles.graph.ILabelModelParameter; - /** - * Tries to find a parameter that best matches the given layout for the provided label instance. - *

- * This implementation will match the provided layout perfectly. - *

- * @param label The label to find a parameter for. - * @param model The model instance to use. This should be this instance. - * @param layout The anticipated layout for the label. - * @returns A non-null parameter that can be used for the label to approximate the provided layout. - */ - findBestParameter(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel,layout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * Gets or sets a property that indicates whether the angle used by the {@link yfiles.graph.FreeEdgeLabelModel#createEdgeAnchored parameter} should be interpreted relative to the - * edge's orientation or as an absolute angle in the coordinate system. - *

- * By default the angle is interpreted to be relative to the world coordinates axes. - *

- * @default false - * @type {boolean} - */ - edgeRelativeAngle:boolean; - /** - * A shared unmodifiable public instance that can be used to obtain parameters. - * @const - * @static - * @type {yfiles.graph.FreeEdgeLabelModel} - */ - static INSTANCE:yfiles.graph.FreeEdgeLabelModel; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.FreeEdgeLabelModel; - } - /** - * A label model that can be used to describe any position and orientation of a label. - *

- * The position of the label is stored absolutely and is not influenced by the layout or position of the owner of the - * label. In fact the owner is not even queried during a call to {@link yfiles.graph.FreeLabelModel#getGeometry}. - *

- * @class - * @implements {yfiles.graph.ILabelModelParameterFinder} - * @implements {yfiles.graph.ILabelModel} - */ - export interface FreeLabelModel extends yfiles.lang.Object,yfiles.graph.ILabelModelParameterFinder,yfiles.graph.ILabelModel{} - export class FreeLabelModel { - /** - * Creates a new label model parameter that places the label at the given absolute position using the provided angle. - * @param anchorLocation The location for the parameter. - * @param angle The angle of rotation. - * @returns A new parameter that is associated with this instance. - */ - createAbsolute(anchorLocation:yfiles.geometry.Point,angle:number):yfiles.graph.ILabelModelParameter; - /** - * Creates a new label at the given dynamic location using the provided angle. - * @param location The location to place the parameter at. That instance is stored by reference. - * @param angle The angle of rotation. - * @returns A new parameter that is associated with this instance. - */ - createAnchored(location:yfiles.geometry.IPoint,angle:number):yfiles.graph.ILabelModelParameter; - /** - * - * @returns - */ - createDefaultParameter():yfiles.graph.ILabelModelParameter; - /** - * Creates a new label model parameter that dynamically reads the label layout from the provided instance. - * @param layout The oriented rectangle to dynamically retrieve the values from. - * @returns A new parameter that is associated with this instance. - */ - createDynamic(layout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * A shared public instance that can be used to obtain parameters. - * @const - * @static - * @type {yfiles.graph.FreeLabelModel} - */ - static INSTANCE:yfiles.graph.FreeLabelModel; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.FreeLabelModel; - } - /** - * This node label model can be used to specify any position and orientation of a label. - *

- * The position of the label is stored relative to the layout of the node the label belongs to. - *

- * @class - * @implements {yfiles.graph.ILabelModel} - * @implements {yfiles.graph.ILabelModelParameterFinder} - */ - export interface FreeNodeLabelModel extends yfiles.lang.Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterFinder{} - export class FreeNodeLabelModel { - /** - * Creates a parameter instance that anchors the label to the node at the canonical position with respect to the given - * reference point. - *

- * This method {@link yfiles.graph.FreeNodeLabelModel#createParameter creates a parameter} with the canonical settings for the ratios and offsets in the following way. Each - * coordinate axis is considered independently. If the reference point coordinate is within the node layout interval, its - * relative location specifies the layout ratio for this coordinate. Otherwise, the absolute distance of the reference - * point and the interval specifies the layout offset and the layout ratio is either either 0.0 or - * 1.0. The parameters for the label ratio and label offset are calculated analogously. If no reference point is provided, - * the reference point is determined automatically in the following way: For each coordinate, if the node layout and label - * layout do not overlap, the reference is the label corner that is closest to the node. If they overlap and if in addition - * the start or end coordinate of the label matches the start, center or end coordinate of the node, that coordinate is the - * reference. Otherwise, the center of the label specifies the reference. - *

- * @param nodeLayout The node layout. - * @param labelLayout The label layout. - * @param [referenceLocation=null] The reference location. - * @returns The canonical parameter for the specified node and label layout. - */ - createCanonicalParameter(nodeLayout:yfiles.geometry.Rect,labelLayout:yfiles.geometry.IOrientedRectangle,referenceLocation?:yfiles.geometry.Point):yfiles.graph.ILabelModelParameter; - /** - * Creates a parameter that is anchored at the node center and has no rotation. - * @returns A parameter that is anchored at the node center and has no rotation. - */ - createDefaultParameter():yfiles.graph.ILabelModelParameter; - /** - * Creates a parameter instance that anchors the label to the node at a given position. - *

- * The parameter will use the ratio and offset values to determine a point on both the label and the node. It will place - * the label in such a way that both points coincide. - *

- * @param layoutRatio The ratio that describes the point on the node's layout relative to its upper-left corner. A value of (0,0) describes - * the upper-left corner, while (1,1) is the lower-right corner. - * @param layoutOffset The absolute offset to apply to the point on the node after the ratio has been determined. - * @param labelRatio The ratio that describes the point on the label's layout relative to its upper-left corner. A value of (0,0) describes - * the upper-left corner, while (1,1) is the lower-right corner. - * @param labelOffset The absolute offset to apply to the point on the label after the ratio has been determined. - * @param angle The angle by which the label should be rotated around the point described using the ratio and offset, measured in - * radians. - * @returns A parameter that exactly fits the described location. - */ - createParameter(layoutRatio:yfiles.geometry.Point,layoutOffset:yfiles.geometry.Point,labelRatio:yfiles.geometry.Point,labelOffset:yfiles.geometry.Point,angle:number):yfiles.graph.ILabelModelParameter; - /** - * Tries to find a parameter that best matches the given layout for the provided label instance. - *

- * This implementation will match the provided layout perfectly. - *

- * @param label The label to find a parameter for. - * @param model The model instance to use. This should be this instance. - * @param layout The anticipated layout for the label. - * @returns A non-null parameter that can be used for the label to approximate the provided layout. - */ - findBestParameter(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel,layout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; - /** - * Returns an empty context. - * @param label The label to use in the context. - * @param layoutParameter The parameter to use for the label in the context. - * @returns An empty context. - */ - getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; - /** - * Returns this instance if an instance of {@link yfiles.graph.ILabelModelParameterFinder} is requested and null otherwise. - * @param type The type for which an instance is requested. - * @returns An instance that is assignable to the given type or null. - */ - lookup(type:yfiles.lang.Class):any; - /** - * A shared public instance that can be used to obtain parameters. - * @const - * @static - * @type {yfiles.graph.FreeNodeLabelModel} - */ - static INSTANCE:yfiles.graph.FreeNodeLabelModel; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.FreeNodeLabelModel; - } - /** - * A straightforward implementation of an {@link yfiles.graph.IPortLocationModel} for {@link yfiles.graph.IPort}s at {@link yfiles.graph.INode}s - * that determine the location dynamically using the {@link yfiles.graph.INode#layout}. - *

- * Internally the location is stored as the ratios by which the {@link yfiles.geometry.ISize#width} and {@link yfiles.geometry.ISize#height} of the {@link yfiles.graph.INode#layout} need to be scaled and additional offsets to - * obtain the offset to the top-left corner of the node layout. - *

- * @class - * @implements {yfiles.graph.IPortLocationModel} - * @final - */ - export interface FreeNodePortLocationModel extends yfiles.lang.Object,yfiles.graph.IPortLocationModel{} - export class FreeNodePortLocationModel { - /** - * - * @param owner - * @param location - * @returns - */ - createParameter(owner:yfiles.graph.IPortOwner,location:yfiles.geometry.Point):yfiles.graph.IPortLocationModelParameter; - /** - * Creates a parameter that uses the given ratios and offsets. - *

- * The ratios will be scaled by the node layout's size and added to the node's top left corner and the offset to determine - * the port location. - *

- * @param ratios The ratios of the node layout's size. - * @param [offset=null] The offset that is added after the ratios are applied. - * @returns A new parameter that matches the specification. - */ - createParameterForRatios(ratios:yfiles.geometry.Point,offset?:yfiles.geometry.Point):yfiles.graph.IPortLocationModelParameter; - /** - * - * @param port - * @param locationParameter - * @returns - */ - getContext(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.graph.ILookup; - /** - * - * @param port - * @param locationParameter - * @returns - */ - getLocation(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.geometry.Point; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * A read only immutable instance of the {@link yfiles.graph.FreeNodePortLocationModel}. - * @const - * @static - * @type {yfiles.graph.FreeNodePortLocationModel} - */ - static INSTANCE:yfiles.graph.FreeNodePortLocationModel; - /** - * A read only immutable singleton instance of a parameter that locates the port at the center of the node layout. - *

- * This is the same as {@link yfiles.graph.FreeNodePortLocationModel#createParameterForRatios creating a parameter} using (0.5,0.5) as ratios and (0,0) as offsets. - *

- * @const - * @static - * @type {yfiles.graph.IPortLocationModelParameter} - */ - static NODE_CENTER_ANCHORED:yfiles.graph.IPortLocationModelParameter; - /** - * A read only immutable singleton instance of a parameter that locates the port at the center of the left border of the - * node layout. - *

- * This is the same as {@link yfiles.graph.FreeNodePortLocationModel#createParameterForRatios creating a parameter} using (0,0.5) as ratios and (0,0) as offsets. - *

- * @const - * @static - * @type {yfiles.graph.IPortLocationModelParameter} - */ - static NODE_LEFT_ANCHORED:yfiles.graph.IPortLocationModelParameter; - /** - * A read only immutable singleton instance of a parameter that locates the port at the center of the right border of the - * node layout. - *

- * This is the same as {@link yfiles.graph.FreeNodePortLocationModel#createParameterForRatios creating a parameter} using (1,0.5) as ratios and (0,0) as offsets. - *

- * @const - * @static - * @type {yfiles.graph.IPortLocationModelParameter} - */ - static NODE_RIGHT_ANCHORED:yfiles.graph.IPortLocationModelParameter; - /** - * A read only immutable singleton instance of a parameter that locates the port at the center of the top border of the - * node layout. - *

- * This is the same as {@link yfiles.graph.FreeNodePortLocationModel#createParameterForRatios creating a parameter} using (0.5,0) as ratios and (0,0) as offsets. - *

- * @const - * @static - * @type {yfiles.graph.IPortLocationModelParameter} - */ - static NODE_TOP_ANCHORED:yfiles.graph.IPortLocationModelParameter; - /** - * A read only immutable singleton instance of a parameter that locates the port at the center of the bottom border of the - * node layout. - *

- * This is the same as {@link yfiles.graph.FreeNodePortLocationModel#createParameterForRatios creating a parameter} using (0.5,1) as ratios and (0,0) as offsets. - *

- * @const - * @static - * @type {yfiles.graph.IPortLocationModelParameter} - */ - static NODE_BOTTOM_ANCHORED:yfiles.graph.IPortLocationModelParameter; - /** - * A read only immutable singleton instance of a parameter that locates the port at the top left corner of the node - * layout. - *

- * This is the same as {@link yfiles.graph.FreeNodePortLocationModel#createParameterForRatios creating a parameter} using (0,0) as ratios and (0,0) as offsets. - *

- * @const - * @static - * @type {yfiles.graph.IPortLocationModelParameter} - */ - static NODE_TOP_LEFT_ANCHORED:yfiles.graph.IPortLocationModelParameter; - /** - * A read only immutable singleton instance of a parameter that locates the port at the top right corner of the node - * layout. - *

- * This is the same as {@link yfiles.graph.FreeNodePortLocationModel#createParameterForRatios creating a parameter} using (1,0) as ratios and (0,0) as offsets. - *

- * @const - * @static - * @type {yfiles.graph.IPortLocationModelParameter} - */ - static NODE_TOP_RIGHT_ANCHORED:yfiles.graph.IPortLocationModelParameter; - /** - * A read only immutable singleton instance of a parameter that locates the port at the bottom right corner of the node - * layout. - *

- * This is the same as {@link yfiles.graph.FreeNodePortLocationModel#createParameterForRatios creating a parameter} using (1,1) as ratios and (0,0) as offsets. - *

- * @const - * @static - * @type {yfiles.graph.IPortLocationModelParameter} - */ - static NODE_BOTTOM_RIGHT_ANCHORED:yfiles.graph.IPortLocationModelParameter; - /** - * A read only immutable singleton instance of a parameter that locates the port at the bottom left corner of the node - * layout. - *

- * This is the same as {@link yfiles.graph.FreeNodePortLocationModel#createParameterForRatios creating a parameter} using (0,1) as ratios and (0,0) as offsets. - *

- * @const - * @static - * @type {yfiles.graph.IPortLocationModelParameter} - */ - static NODE_BOTTOM_LEFT_ANCHORED:yfiles.graph.IPortLocationModelParameter; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.FreeNodePortLocationModel; - } - /** - * An implementation of {@link yfiles.graph.ILabelModel} that can be used to create custom label models out of existing {@link yfiles.graph.ILabelModelParameter} - * instances. - *

- * This class holds a number of parameters and serves as a container for these parameters. Custom models can easily be - * created that way: - *

- * @class - * @implements {yfiles.graph.ILabelModel} - * @implements {yfiles.graph.ILabelModelParameterProvider} - * @implements {yfiles.graph.ILabelCandidateDescriptorProvider} - * @implements {yfiles.graphml.IMarkupExtensionConverter} - */ - export interface GenericLabelModel extends yfiles.lang.Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider,yfiles.graph.ILabelCandidateDescriptorProvider,yfiles.graphml.IMarkupExtensionConverter{} - export class GenericLabelModel { - /** - * Create a new generic label model using the provided parameter as the {@link yfiles.graph.GenericLabelModel#createDefaultParameter default parameter.} - *

- * The parameter is stored by reference. - *

- * @param defaultLayoutParameter The parameter to use as the default. - * @param [descriptor=null] The descriptor to associate with the parameter. - * @throws {Stubs.Exceptions.ArgumentError} defaultParameter is null. - * @see yfiles.graph.GenericLabelModel#getDescriptor - */ - constructor(defaultLayoutParameter:yfiles.graph.ILabelModelParameter,descriptor?:yfiles.graph.ILabelCandidateDescriptor); - /** - * Adds another parameter to this models collection of parameters. - *

- * Note that the parameter will be wrapped by this class and the resulting parameter which will use this model instance as - * its {@link yfiles.graph.ILabelModelParameter#model} will be returned. The parameter is stored by reference and subsequent modification of the parameter or its - * associated model will be reflected by this instance. Also the methods allows for associating a {@link yfiles.graph.ILabelCandidateDescriptor} - * with each parameter that can later be retrieved via the {@link yfiles.graph.GenericLabelModel#getDescriptor} method. - *

- * @param layoutParameter The parameter to add to this instance. - * @param [descriptor=null] The descriptor to associate with the parameter. - * @returns A new parameter that wraps the provided parameter and uses this instance as its model. - */ - addParameter(layoutParameter:yfiles.graph.ILabelModelParameter,descriptor?:yfiles.graph.ILabelCandidateDescriptor):yfiles.graph.ILabelModelParameter; - /** - * - * @returns - */ - createDefaultParameter():yfiles.graph.ILabelModelParameter; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; - /** - * Yields the {@link yfiles.graph.ILabelCandidateDescriptor} that has been associated with the instance during - * {@link yfiles.graph.GenericLabelModel#addParameter}. - * @param label The label instance to use. - * @param layoutParameter The parameter to get the descriptor for. - * @returns The descriptor instance that had been added to this instance during {@link #addParameter}. - */ - getDescriptor(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILabelCandidateDescriptor; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.GenericLabelModel; - } - /** - * An implementation of {@link yfiles.graph.IPortLocationModel} that can be used to create custom port location models out of - * existing {@link yfiles.graph.IPortLocationModelParameter} instances. - *

- * This class holds a number of parameters and serves as a container for these parameters. - *

- *

- * Custom models can easily be created in the following way: - *

- *

- * Note that in order to work, this model needs to have at least one {@link yfiles.graph.GenericPortLocationModel#addParameter parameter added}. - *

- * @see yfiles.graph.GenericPortLocationModel#addParameter - * @class - * @implements {yfiles.graph.IPortLocationModel} - * @implements {yfiles.collections.IEnumerable.} - * @implements {yfiles.graphml.IMarkupExtensionConverter} - * @final - */ - export interface GenericPortLocationModel extends yfiles.lang.Object,yfiles.graph.IPortLocationModel,yfiles.collections.IEnumerable,yfiles.graphml.IMarkupExtensionConverter{} - export class GenericPortLocationModel { - /** - * Initializes a new instance of the {@link yfiles.graph.GenericPortLocationModel} class. - */ - constructor(); - /** - * This method simply delegates to {@link yfiles.graph.GenericPortLocationModel#addParameter}. - *

- * It is there to allow for convenient initialization in code. - *

- *

- * This method is used by the compiler if the collection initializer syntax is used. - *

- * @param locationParameter The parameter to add to this instance. - * @see yfiles.graph.GenericPortLocationModel#addParameter - */ - add(locationParameter:yfiles.graph.IPortLocationModelParameter):void; - /** - * Adds the given parameter to the {@link yfiles.graph.GenericPortLocationModel#locationParameters} of this instance. - *

- * Note that this will create a new parameter instance that is then actually bound to this instance and returned. The - * instance is stored by reference so if this is a mutable instance this instance will be modified, implicitly, too. - *

- * @param locationParameter The parameter to add to this instance. - * @returns The parameter to use with this model that wraps the given parameter. - * @see yfiles.graph.GenericPortLocationModel#add - */ - addParameter(locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.graph.IPortLocationModelParameter; - /** - * Factory method that creates a parameter for the given port that tries to match the provided location in absolute world - * coordinates. - *

- * This implementation iterates over all {@link yfiles.graph.GenericPortLocationModel#locationParameters} to return the one that matches the given location the best. - *

- * @param owner The port owner that will own the port for which the parameter shall be created. - * @param location The location in the world coordinate system that should be matched as best as possible. - * @returns A new instance that can be used to describe the location of an {@link } at the given owner. - */ - createParameter(owner:yfiles.graph.IPortOwner,location:yfiles.geometry.Point):yfiles.graph.IPortLocationModelParameter; - /** - * - * @param port - * @param locationParameter - * @returns - */ - getContext(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.graph.ILookup; - /** - * - * @param port - * @param locationParameter - * @returns - */ - getLocation(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.geometry.Point; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * Gets all parameters that are associated with this instance. - *

- * This enumerates the instances that wraps the parameters that have been added to this instance via - * {@link yfiles.graph.GenericPortLocationModel#addParameter} - *

- * @type {yfiles.collections.IEnumerable.} - */ - locationParameters:yfiles.collections.IEnumerable; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.GenericPortLocationModel; - } - /** - * This interface can be used to customize the clipboard behavior for individual {@link yfiles.graph.IModelItem}s. - *

- * Implementations of this interface can {@link yfiles.graph.ILookupDecorator#addLookup decorate} the {@link yfiles.graph.ILookup#lookup} method of {@link yfiles.graph.IModelItem}s to - * change their behavior during {@link yfiles.graph.GraphClipboard clipboard} actions. - *

- *

- * The easiest way to decorate certain model items with a custom {@link yfiles.graph.IClipboardHelper} implementation is via the - * various decorators available on {@link yfiles.graph.GraphDecorator}: - *

- *

Related demos:

- *
    - *
  • Demo: Clipboard, Demo.yFiles.Graph.Clipboard
  • - *
- * @interface - */ - export interface IClipboardHelper extends yfiles.lang.Object{ - /** - * This method is called during the copy operation of the given item to retrieve additional state that can be later used - * during a {@link yfiles.graph.IClipboardHelper#paste} operation. - *

- * If the source graph is a managed folding view, the item is always a master item. - *

- * @param context The context in which this interface is used, can be null - * @param item The item to copy to the clipboard. - * @returns A custom user object that will later be provided to {@link #paste}. - * @abstract - */ - copy(context:yfiles.graph.IGraphClipboardContext,item:yfiles.graph.IModelItem):any; - /** - * This method is called during the cut operation of the given item to retrieve additional state that can be later used - * during a {@link yfiles.graph.IClipboardHelper#paste} operation. - *

- * If the source graph is a managed folding view, the item is always a master item. - *

- * @param context The context in which this interface is used, can be null - * @param item The item to cut to the clipboard. - * @returns A custom user object that will later be provided to {@link #paste}. - * @abstract - */ - cut(context:yfiles.graph.IGraphClipboardContext,item:yfiles.graph.IModelItem):any; - /** - * This method is called after the item has been pasted from the clipboard. - *

- * The item is always a master item since the clipboard graph is not a managed folding view. - *

- * @param context The context in which this interface is used, can be null - * @param item The item that has been created during the paste operation. - * @param userData The data that had been queried during {@link #cut} or {@link #copy} - * respectively. - * @abstract - */ - paste(context:yfiles.graph.IGraphClipboardContext,item:yfiles.graph.IModelItem,userData:any):void; - /** - * Determines whether the given item can or should be copied to the clipboard. - *

- * If the source graph is a managed folding view, the item is always a view item. Furthermore, if collapsed nodes are to be - * copied, this method will be queried with the collapsed group node as item for each "hidden" node that is currently not - * visible. - *

- * @param context The context in which this interface is used, can be null - * @param item The item in question. - * @returns Whether this item should be copied. - * @abstract - */ - shouldCopy(context:yfiles.graph.IGraphClipboardContext,item:yfiles.graph.IModelItem):boolean; - /** - * Determines whether the given item can or should be cut to the clipboard. - *

- * If the source graph is a managed folding view, the item is always a view item. Furthermore, if collapsed nodes are to be - * cut, this method will be queried with the collapsed group node as item for each "hidden" node that is currently not - * visible. - *

- * @param context The context in which this interface is used, can be null - * @param item The item in question. - * @returns Whether this item should be cut. - * @abstract - */ - shouldCut(context:yfiles.graph.IGraphClipboardContext,item:yfiles.graph.IModelItem):boolean; - /** - * Determines whether the given item can or should be pasted from the clipboard to the target graph. - *

- * The item is always a master item since the clipboard graph is not a managed folding view. - *

- * @param context The context in which this interface is used, can be null - * @param item The item in the clipboard graph. - * @param userData The state memento that had been created during {@link #cut} or {@link #copy}. - * @returns Whether this item should be pasted. - * @abstract - */ - shouldPaste(context:yfiles.graph.IGraphClipboardContext,item:yfiles.graph.IModelItem,userData:any):boolean; - } - var IClipboardHelper:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IClipboardHelper; - }; - /** - * The interface for the context that is passed by the {@link yfiles.graph.GraphClipboard} implementation to the {@link yfiles.graph.IClipboardHelper} - * methods and {@link yfiles.graph.IClipboardIdProvider}. - * @interface - * @implements {yfiles.graph.ILookup} - */ - export interface IGraphClipboardContext extends yfiles.lang.Object,yfiles.graph.ILookup{ - /** - * Gets the clipboard that created this context and is used during the current operation. - * @abstract - * @type {yfiles.graph.GraphClipboard} - */ - clipboard:yfiles.graph.GraphClipboard; - /** - * Gets the source graph for the current operation. - * @abstract - * @type {yfiles.graph.IGraph} - */ - sourceGraph:yfiles.graph.IGraph; - /** - * Gets the target graph for the current operation. - * @abstract - * @type {yfiles.graph.IGraph} - */ - targetGraph:yfiles.graph.IGraph; - } - var IGraphClipboardContext:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IGraphClipboardContext; - }; - /** - * Used by the {@link yfiles.graph.GraphClipboard} to assign IDs for elements in the clipboard. - *

- * IDs are created when items are copied (or cut) into the clipboard and queried when the items are pasted from the - * clipboard. - *
- * Providing a custom ID provider allows for identifying conceptually identical items across different graph instances. - *
- * The default implementation uses the {@link yfiles.graph.IModelItem} object reference as the ID. - *

- * @interface - */ - export interface IClipboardIdProvider extends yfiles.lang.Object{ - /** - * Gets the ID for the given originalItem. - * @param context The clipboard context - * @param originalItem The original item which is copied. The item is part of the original graph from which the item is copied. - * @returns An ID for the given item. The object should be suitable for use in a {@link }. - * @abstract - */ - getId(context:yfiles.graph.IGraphClipboardContext,originalItem:yfiles.graph.IModelItem):any; - /** - * Gets the item which is represented by the given id. - * @param context The clipboard context. - * @param id The ID to get the item for. - * @returns The item which is represented by the given ID or null if the item cannot be located or is invalid. The item needs to be - * part of the target graph for paste operations. - * @abstract - */ - getItem(context:yfiles.graph.IGraphClipboardContext,id:any):yfiles.graph.IModelItem; - } - var IClipboardIdProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IClipboardIdProvider; - }; - export enum ParentNodeDetectionModes{ - /** - * Nodes should always be pasted into the root group. - */ - ROOT, - /** - * If exactly one group node is selected the nodes should be pasted into that group. - *

- * As long as {@link yfiles.graph.ParentNodeDetectionModes#ALLOW_SELF} is not set, too, a node will not be pasted into its original - * node. Note that it can be pasted into a copy of its original, though. - *

- *

- * If this setting is combined with {@link yfiles.graph.ParentNodeDetectionModes#ROOT} or {@link yfiles.graph.ParentNodeDetectionModes#PREVIOUS_PARENT} - * it will override that setting if a group node is selected. - *

- */ - SELECTION, - /** - * A node should be pasted into its original parent. - *

- * If the parent has been removed from the graph in between the copy and paste operation the node will be placed into the - * parent's parent. - *

- *

- * If the previous parent has been moved too far away the node will be placed into the root unless {@link yfiles.graph.ParentNodeDetectionModes#FORCE} - * is set, too. - *

- *

- * If this setting is combined with {@link yfiles.graph.ParentNodeDetectionModes#SELECTION} or {@link yfiles.graph.ParentNodeDetectionModes#AT_LOCATION} - * it will be overridden by the other setting. - *

- */ - PREVIOUS_PARENT, - /** - * A node should be pasted into the group node at the location where the node is pasted to or the root if there is no group - * node. - *

- * As long as {@link yfiles.graph.ParentNodeDetectionModes#ALLOW_SELF} is not set, too, the node will not be pasted into its - * original node. Note that it can be pasted into a copy of its original, though. - *

- */ - AT_LOCATION, - /** - * When used in combination with {@link yfiles.graph.ParentNodeDetectionModes#SELECTION} or {@link yfiles.graph.ParentNodeDetectionModes#AT_LOCATION} - * this setting will allow pasting nodes into their original. - */ - ALLOW_SELF, - /** - * If combined with {@link yfiles.graph.ParentNodeDetectionModes#PREVIOUS_PARENT} forces the node to be pasted into its original - * parent, even if the parent has moved far away and pasting the node would increase the parents size considerably. - */ - FORCE, - /** - * A bitmask that can be used to query the actual mode ({@link yfiles.graph.ParentNodeDetectionModes#ROOT}, - * {@link yfiles.graph.ParentNodeDetectionModes#SELECTION}, {@link yfiles.graph.ParentNodeDetectionModes#AT_LOCATION}, or - * {@link yfiles.graph.ParentNodeDetectionModes#PREVIOUS_PARENT}). - */ - MODE_MASK, - /** - * A bitmask that can be used to query modifications of the actual mode such as {@link yfiles.graph.ParentNodeDetectionModes#ALLOW_SELF} - * or {@link yfiles.graph.ParentNodeDetectionModes#FORCE}. - */ - MODIFIER_MASK - } - /** - * Clipboard implementation for {@link yfiles.graph.IGraph} instances. - *

- * This implementation copies a given graph to an internally held - * {@link yfiles.graph.GraphClipboard#clipboardGraph clipboard graph}. The clipboard graph can then be pasted to a target graph instance. - *

- *

- * The clipboard can be configured to copy and paste {@link yfiles.graph.GraphClipboard#independentCopyItems items that depend on other items} without copying the items it depends - * on, e.g. labels, ports, edges, and bends. - *

- *

- * Also depending on the selection in the target graph, items can be pasted at multiple locations at once, e.g. a single - * label can be copied to the clipboard independently and pasted onto several selected target items. - *

- *

Related demos:

- *
    - *
  • Demo: Simple Editor, Demo.yFiles.Graph.SimpleEditor
  • - *
- * @see yfiles.graph.IClipboardHelper - * @see yfiles.graph.GraphClipboard#cut - * @see yfiles.graph.GraphClipboard#onCopy - * @see yfiles.graph.GraphClipboard#paste - * @see yfiles.graph.GraphClipboard#clipboardGraph - * @class - */ - export interface GraphClipboard extends yfiles.lang.Object{} - export class GraphClipboard { - /** - * Creates a new initially empty clipboard. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.geometry.Point} options.pasteDelta A vector that will be used to move nodes and bends by after they have been pasted to the target graph. - *

- * This option sets the {@link yfiles.graph.GraphClipboard#pasteDelta} property on the created object. - *

- * @param {yfiles.graph.GraphCopier} options.toClipboardCopier The {@link yfiles.graph.GraphCopier} instance that will be used to copy the graph to the clipboard. - *

- * This option sets the {@link yfiles.graph.GraphClipboard#toClipboardCopier} property on the created object. - *

- * @param {yfiles.graph.GraphCopier} options.fromClipboardCopier The {@link yfiles.graph.GraphCopier} instance that will be used to copy the graph from the clipboard to the target graph. - *

- * This option sets the {@link yfiles.graph.GraphClipboard#fromClipboardCopier} property on the created object. - *

- * @param {yfiles.graph.GraphCopier} options.duplicateCopier The {@link yfiles.graph.GraphCopier} instance that will be used to duplicate elements inside the graph. - *

- * This option sets the {@link yfiles.graph.GraphClipboard#duplicateCopier} property on the created object. - *

- * @param {yfiles.graph.IClipboardIdProvider} options.idProvider The {@link yfiles.graph.IClipboardIdProvider} used by this instance to provide IDs for copied items. - *

- * This option sets the {@link yfiles.graph.GraphClipboard#idProvider} property on the created object. - *

- * @param {yfiles.graph.IGraph} options.clipboardGraph The graph that contains the clipboard's contents. - *

- * This option sets the {@link yfiles.graph.GraphClipboard#clipboardGraph} property on the created object. - *

- * @param {yfiles.graph.ParentNodeDetectionModes} options.parentNodeDetection Whether or not nodes should be automatically put into a group node and if so how this group will be determined. - *

- * This option sets the {@link yfiles.graph.GraphClipboard#parentNodeDetection} property on the created object. - *

- * @param {yfiles.graph.GraphItemTypes} options.dependentCopyItems The type of items that depend on other elements but should automatically be copied implicitly to the clipboard if all elements that it depends on are explicitly selected for copying. - *

- * This option sets the {@link yfiles.graph.GraphClipboard#dependentCopyItems} property on the created object. - *

- * @param {yfiles.graph.GraphItemTypes} options.independentCopyItems The type of items that can be copied and pasted independently of their owning element. - *

- * This option sets the {@link yfiles.graph.GraphClipboard#independentCopyItems} property on the created object. - *

- * @param {yfiles.graph.GraphItemTypes} options.copyItems The type of items that can be copied and pasted at all using the clipboard. - *

- * This option sets the {@link yfiles.graph.GraphClipboard#copyItems} property on the created object. - *

- */ - constructor(options?:{pasteDelta?:yfiles.geometry.Point,toClipboardCopier?:yfiles.graph.GraphCopier,fromClipboardCopier?:yfiles.graph.GraphCopier,duplicateCopier?:yfiles.graph.GraphCopier,idProvider?:yfiles.graph.IClipboardIdProvider,clipboardGraph?:yfiles.graph.IGraph,parentNodeDetection?:yfiles.graph.ParentNodeDetectionModes,dependentCopyItems?:yfiles.graph.GraphItemTypes,independentCopyItems?:yfiles.graph.GraphItemTypes,copyItems?:yfiles.graph.GraphItemTypes}); - /** - * Clears the clipboard's contents. - */ - clear():void; - /** - * Copies the elements indicated by the filter to the clipboard graph. - *

- * For each element copied to the clipboard graph the {@link yfiles.graph.GraphClipboard#onElementCopied} delegate will be called. - * The actual work of this method is delegated to the {@link yfiles.graph.GraphClipboard#toClipboardCopier}'s {@link yfiles.graph.GraphCopier#copy} method. - *

- * @param sourceGraph The graph to copy the contents from. - * @param filter The filter to apply to the source graph's elements. - */ - copy(sourceGraph:yfiles.graph.IGraph,filter:(obj:yfiles.graph.IModelItem)=>boolean):void; - /** - * Creates the graph used for the clipboard. - * @returns A new readily configured {@link } instance. - * @protected - */ - createClipboardGraph():yfiles.graph.IGraph; - /** - * Convenience method that creates a predicate that is based upon the outcome of the {@link yfiles.graph.IClipboardHelper#shouldCopy} - * method that can be found in the {@link yfiles.graph.ILookup#lookup} of the provided {@link yfiles.graph.IModelItem}. - * @returns A predicate that uses {@link #shouldCopy}. - * @see yfiles.graph.GraphClipboard#onCopy - */ - createClipBoardHelperCopyFilter():(obj:yfiles.graph.IModelItem)=>boolean; - /** - * Convenience method that creates a predicate that is based upon the outcome of the {@link yfiles.graph.IClipboardHelper#shouldCut} - * method that can be found in the {@link yfiles.graph.ILookup#lookup} of the provided {@link yfiles.graph.IModelItem}. - * @returns A predicate that uses {@link #shouldCut}. - * @see yfiles.graph.GraphClipboard#cut - */ - createClipBoardHelperCutFilter():(obj:yfiles.graph.IModelItem)=>boolean; - /** - * Convenience method that creates a predicate that is based upon the outcome of the {@link yfiles.graph.IClipboardHelper#shouldPaste} - * method that can be found in the {@link yfiles.graph.ILookup#lookup} of the provided {@link yfiles.graph.IModelItem}. - * @returns A predicate that uses {@link #shouldPaste}. - * @see yfiles.graph.GraphClipboard#cut - */ - createClipBoardHelperPasteFilter():(obj:yfiles.graph.IModelItem)=>boolean; - /** - * Factory method that creates the context for the upcoming calls to the {@link yfiles.graph.IClipboardHelper} methods. - * @param sourceGraph The source graph of the operation. - * @param targetGraph The target graph of the operation. - * @returns A context that has the properties configured according to the parameters. - * @protected - */ - createContext(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph):yfiles.graph.IGraphClipboardContext; - /** - * Creates the default {@link yfiles.graph.IClipboardIdProvider} used by this instance to provide IDs for copied items. - *

- * The default implementation simply uses a reference to the original item as ID. - *

- *

- * Custom ID can be used to map between elements in different graphs. - *

- * @returns - * @protected - */ - createDefaultClipboardIdProvider():yfiles.graph.IClipboardIdProvider; - /** - * Creates a predicate for use in the {@link yfiles.graph.GraphClipboard#onCopy} method. - *

- * This filter uses two predicates to decide whether a graph item can be copied. The base set of items specified by this - * filter is induced by the {@link yfiles.graph.GraphClipboard#createSelectionFilter}. Optionally, this set can be restricted - * further by an {@link yfiles.graph.IClipboardHelper#shouldCopy} predicate. If such a predicate returns false for the item itself - * or any item this item depends on, then the item will not be copied. Items without such a predicate are handled solely - * according to their selection state. - *

- * @param selection The selection model to base the filter on. - * @param graph The graph to use for determining adjacency. - * @returns A predicate that filters subgraph induced by the selection of nodes and restricted by an optional {@link #shouldCopy} - * predicate. - */ - createDefaultCopyFilter(selection:yfiles.view.IGraphSelection,graph:yfiles.graph.IGraph):(obj:yfiles.graph.IModelItem)=>boolean; - /** - * Creates a predicate for use in the {@link yfiles.graph.GraphClipboard#cut} method. - *

- * This filter uses two predicates to decide whether a graph item can be cut. The base set of items specified by this - * filter is induced by the {@link yfiles.graph.GraphClipboard#createSelectionFilter}. Optionally, this set can be restricted - * further by an {@link yfiles.graph.IClipboardHelper#shouldCut} predicate. If such a predicate returns false for the item itself - * or any item this item depends on, then the item will not be cut. Items without such a predicate are handled solely - * according to their selection state. - *

- * @param selection The selection model to base the filter on. - * @param graph The graph to use for determining adjacency. - * @returns A predicate that filters subgraph induced by the selection of nodes and restricted by an optional {@link #shouldCut} - * predicate. - */ - createDefaultCutFilter(selection:yfiles.view.IGraphSelection,graph:yfiles.graph.IGraph):(obj:yfiles.graph.IModelItem)=>boolean; - /** - * Creates a predicate for use in the {@link yfiles.graph.GraphClipboard#duplicate} method. - *

- * By default this method uses the same filter implementation as {@link yfiles.graph.GraphClipboard#createDefaultCopyFilter}: This - * filter uses two predicates to decide whether a graph item will be duplicated. The base set of items specified by this - * filter is induced by the {@link yfiles.graph.GraphClipboard#createSelectionFilter}. Optionally, this set can be restricted - * further by an {@link yfiles.graph.IClipboardHelper#shouldCopy} predicate. If such a predicate returns false for the item itself - * or any item this item depends on, then the item will not be copied. Items without such a predicate are handled solely - * according to their selection state. - *

- * @param selection The selection model to base the filter on. - * @param graph The graph to use for determining adjacency. - * @returns A predicate that filters subgraph induced by the selection of nodes and restricted by an optional {@link #shouldCopy} - * predicate. - */ - createDefaultDuplicateFilter(selection:yfiles.view.IGraphSelection,graph:yfiles.graph.IGraph):(obj:yfiles.graph.IModelItem)=>boolean; - /** - * Factory method that creates the {@link yfiles.graph.GraphClipboard#duplicateCopier}. - * @returns A new {@link } instance. - * @protected - */ - createDuplicateCopier():yfiles.graph.GraphCopier; - /** - * Factory method that creates the {@link yfiles.graph.GraphClipboard#fromClipboardCopier}. - * @returns A new {@link } instance. - * @protected - */ - createFromClipboardCopier():yfiles.graph.GraphCopier; - /** - * Creates a predicate for use in the {@link yfiles.graph.GraphClipboard#cut} and {@link yfiles.graph.GraphClipboard#onCopy} methods. - *

- * This predicate is based on the element induced by the set of selected nodes, e.g. each edge that has both of its - * adjacent port owners selected will be included as well as each label and port whose owner is included. Also ports where - * no adjacent edge is included (but edges exist), will not be included, unless the {@link yfiles.graph.IPortDefaults#autoCleanup} is set to false. - *

- * @param selection The selection model to base the filter on. - * @param graph The graph to use for determining adjacency. - * @returns A predicate that filters subgraph induced by the selection of nodes. - */ - createSelectionFilter(selection:yfiles.view.IGraphSelection,graph:yfiles.graph.IGraph):(obj:yfiles.graph.IModelItem)=>boolean; - /** - * Factory method that creates the {@link yfiles.graph.GraphClipboard#toClipboardCopier}. - * @returns A new {@link } instance. - * @protected - */ - createToClipboardCopier():yfiles.graph.GraphCopier; - /** - * Creates an induced predicate from coreFilter for use in the {@link yfiles.graph.GraphClipboard#cut} and {@link yfiles.graph.GraphClipboard#onCopy} - * methods that takes dependent items into account. - *

- * This method can create a predicate for only a core set of items which is then extended or restricted depending on the - * predicate values of graph item dependencies. - *

- *

- * The restrictive parameter determines whether the result restricts or extends the set of elements handled by coreFilter: - *

- *
    - *
  • - * If restrictive is false, an item is allowed if either coreFilter returns true for itself or if all items it depends on - * (e.g. label/port owner, source/target port etc.) are allowed by coreFilter. - *
  • - *
  • - * If restrictive is true, an item is forbidden if either coreFilter returns false for itself or if any item it depends on - * (e.g. label/port owner, source/target port etc.) is forbidden by coreFilter. - *
  • - *
- * @param coreFilter The core predicate for the base set of elements. - * @param graph The graph to use for determining adjacency. - * @param restrictive Whether to create a restriction or extension for the coreFilter predicate - * @returns - * @static - */ - static createWrappedFilter(coreFilter:(obj:yfiles.graph.IModelItem)=>boolean,graph:yfiles.graph.IGraph,restrictive:boolean):(obj:yfiles.graph.IModelItem)=>boolean; - /** - * Cuts the items indicated by filter to the clipboard and removes them from the graph. - *

- * This method delegates the core work to {@link yfiles.graph.GraphClipboard#onCopy} which will use the {@link yfiles.graph.GraphClipboard#toClipboardCopier} to copy the cut elements - * to the clipboard. - *

- * @param sourceGraph The graph to cut the items from. - * @param filter The filter to use. - * @see yfiles.graph.GraphClipboard#createSelectionFilter - */ - cut(sourceGraph:yfiles.graph.IGraph,filter:(obj:yfiles.graph.IModelItem)=>boolean):void; - /** - * Duplicates the elements indicated by the filter. - *

- * The {@link yfiles.graph.GraphClipboard#clipboardGraph} is not altered by this operation. - *

- * @param context The current {@link }. - * @param sourceGraph The graph whose elements should be duplicated. - * @param filter A predicate which returns true for elements which should be duplicated. - * @param elementDuplicated An element copied callback which gets invoked for each element which has been duplicated. The two parameters passed into - * the callback are guaranteed to be part of the sourceGraph. - */ - duplicate(context:yfiles.input.IInputModeContext,sourceGraph:yfiles.graph.IGraph,filter:(obj:yfiles.graph.IModelItem)=>boolean,elementDuplicated:(original:yfiles.graph.IModelItem,copy:yfiles.graph.IModelItem)=>void):void; - /** - * Retrieves the {@link yfiles.graph.IClipboardHelper} instance associated with the given item. - *

- * This implementation uses the item's {@link yfiles.graph.ILookup#lookup} method to retrieve the helper instance. - *

- * @param item The item to find the clipboard helper for. - * @returns An instance or null. - * @protected - */ - getClipboardHelper(item:yfiles.graph.IModelItem):yfiles.graph.IClipboardHelper; - /** - * Gets a folding state of an edge for a given {@link yfiles.graph.FoldingEdgeStateId}. - *

- * This method might be overridden to map folding states for edges whose source or target node's hierarchy might have - * changed during a paste operation. - *

- * @param edge The edge to get the folding state for. - * @param id The original {@link } to get the folding state for. Passing null will return the folding state - * which was visible when the edge was copied into the clipboard. - * @returns The folding state which is mapped to the given id. May be null. - * @protected - */ - getFoldingEdgeState(edge:yfiles.graph.IEdge,id:yfiles.graph.FoldingEdgeStateId):yfiles.graph.IEdge; - /** - * Gets a {@link yfiles.graph.ILabelModelParameter} for the given label to be placed at the given newOwner. - *

- * Implementations might delegate to {@link yfiles.graph.GraphCopier#copyLabelLayoutParameter} to copy the existing parameter or - * use the {@link yfiles.graph.IGraph#nodeDefaults} or {@link yfiles.graph.IGraph#edgeDefaults} to create a new one. Note that the type of the owner might have changed during the copy operation. - *

- * @param copier The {@link } whose {@link #copyLabelLayoutParameter} method can be used to copy the - * existing parameter. - * @param graph The {@link } whose {@link #nodeDefaults} or {@link #edgeDefaults} can be used to create a new parameter. - * @param label The label to be copied. - * @param newOwner The new owner for the label. - * @returns An {@link } for the copied label. - * @protected - */ - getLabelLayoutParameter(copier:yfiles.graph.GraphCopier,graph:yfiles.graph.IGraph,label:yfiles.graph.ILabel,newOwner:yfiles.graph.ILabelOwner):yfiles.graph.ILabelModelParameter; - /** - * Retrieves the memento associated with an item in the clipboard graph that has been stored with the item during {@link yfiles.graph.GraphClipboard#onElementCopied} - * and {@link yfiles.graph.GraphClipboard#onElementCut}. - * @param clipboardItem The item in the clipboard graph. - * @returns The object returned by the {@link } methods or null. - */ - getMemento(clipboardItem:yfiles.graph.IModelItem):any; - /** - * Gets a {@link yfiles.graph.IPortLocationModelParameter} for the given originalPort to be placed at the given newOwner. - *

- * Implementations might delegate to {@link yfiles.graph.GraphCopier#copyPortLocationParameter} to copy the existing parameter or - * use the {@link yfiles.graph.IGraph#nodeDefaults} or {@link yfiles.graph.IGraph#edgeDefaults} to create a new one. Note that the type of the owner might have changed during the copy operation. - *

- * @param copier The {@link } whose {@link #copyPortLocationParameter} method can be used to copy the - * existing parameter. - * @param graph The {@link } whose {@link #nodeDefaults} or {@link #edgeDefaults} can be used to create a new parameter. - * @param originalPort The port to be copied. - * @param newOwner The new owner for the port. - * @returns An {@link } for the copied port. - * @protected - */ - getPortLocationParameter(copier:yfiles.graph.GraphCopier,graph:yfiles.graph.IGraph,originalPort:yfiles.graph.IPort,newOwner:yfiles.graph.IPortOwner):yfiles.graph.IPortLocationModelParameter; - /** - * Provides an {@link yfiles.graph.IEdge} where the given originalBend can be added to. - *

- * Called for {@link yfiles.graph.IBend}s whose edge is not copied to provide a new owner. Might return null if no target for the - * given originalBend is found. In this case the bend will not be copied. - *

- * @param originalBend The bend to be copied. - * @returns An {@link } for the bend to be added to or null if the bend should not be copied. - * @protected - */ - getTargetEdge(originalBend:yfiles.graph.IBend):yfiles.graph.IEdge; - /** - * Provides an {@link yfiles.graph.ILabelOwner} where the given originalLabel can be added to. - *

- * Called for {@link yfiles.graph.ILabel}s whose owners are not copied to provide a new owner. Might return null if no target for - * the given originalLabel is found. In this case the label will not be copied. - *

- * @param originalLabel The label to be copied. - * @returns An {@link } for the label to be added to or null if the label should not be copied. - * @protected - */ - getTargetLabeledItem(originalLabel:yfiles.graph.ILabel):yfiles.graph.ILabelOwner; - /** - * Provides a parent group node for the given originalNode. - *

- * Called for {@link yfiles.graph.INode}s to place them inside a group node. Might return null if the given node should be placed - * at the root or if the graph is not grouped. - *

- * @param originalNode The node to be copied. - * @returns The new parent group of the node or null if the node should be placed at the root of the hierarchy or if the graph is - * not grouped. - * @see yfiles.graph.GraphClipboard#parentNodeDetection - * @protected - */ - getTargetNode(originalNode:yfiles.graph.INode):yfiles.graph.INode; - /** - * Provides an {@link yfiles.graph.IPort} where the given originalEdge can be added to. - *

- * Called for {@link yfiles.graph.IEdge}s whose source or target ports are not copied to provide a new port. Might return null if - * no target for the given originalEdge is found. In this case the edge will not be copied. - *

- * @param originalEdge The edge to be copied. - * @param atSource Whether to look for a source port. - * @returns An {@link } for the edge to be added to or null if the edge should not be copied. - * @protected - */ - getTargetPort(originalEdge:yfiles.graph.IEdge,atSource:boolean):yfiles.graph.IPort; - /** - * Provides an {@link yfiles.graph.IPortOwner} where the given originalPort can be added to. - *

- * Called for {@link yfiles.graph.IPort}s whose owners are not copied to provide a new owner. Might return null if no target for - * the given originalPort is found. In this case the port will not be copied. - *

- * @param originalPort The port to be copied. - * @returns An {@link } for the port to be added to or null if the port should not be copied. - * @protected - */ - getTargetPortOwner(originalPort:yfiles.graph.IPort):yfiles.graph.IPortOwner; - /** - * Whether the given item is a "dummy" item which should not be pasted. - *

- * A dummy item is used to keep {@link yfiles.graph.IModelItem}s which cannot exist without an owner in the {@link yfiles.graph.GraphClipboard#clipboardGraph} (e.g. - * {@link yfiles.graph.ILabel}s). - *

- * @param item The item to test. - * @returns true if the item is a "dummy" item. - */ - isDummy(item:yfiles.graph.IModelItem):boolean; - /** - * Whether the given item exists in a folding state of its owner. - * @param owner The owner of the given item. - * @param item An {@link }, {@link }, or {@link }. - * @returns true if the given item exists in a folding state. - * @protected - * @static - */ - static isFoldingStateElement(owner:yfiles.graph.IModelItem,item:yfiles.graph.IModelItem):boolean; - /** - * Calls {@link yfiles.graph.GraphCopier#copy} on the current {@link yfiles.graph.GraphClipboard#toClipboardCopier} instance or {@link yfiles.graph.GraphClipboard#fromClipboardCopier} instance, depending on whether the targetGraph is the {@link yfiles.graph.GraphClipboard#clipboardGraph} - * instance. - * @param sourceGraph The source graph to pass to {@link #copy} - * @param filter The predicate to pass on. - * @param targetGraph The target graph to pass on. - * @param targetRootNode The node to use as the root node in the grouped targetGraph. - * @param elementCopiedCallback The delegate to pass on. For each element that is copied during the operation to the clipboard, this callback will be - * passed the original and the copy of the item. In case the sourceGraph is a {@link #views folding view graph} both elements are passed - * as {@link #masterGraph master} elements or {@link #getFolderNodeState folding state elements} if a master element does not exist. - * @protected - */ - onCopy(sourceGraph:yfiles.graph.IGraph,filter:(obj:yfiles.graph.IModelItem)=>boolean,targetGraph:yfiles.graph.IGraph,targetRootNode:yfiles.graph.INode,elementCopiedCallback:(original:yfiles.graph.IModelItem,copy:yfiles.graph.IModelItem)=>void):void; - /** - * A callback that will be invoked for each item that has been copied into the clipboard graph in response to a {@link yfiles.graph.GraphClipboard#onCopy} - * operation. - *

- * This implementation will {@link yfiles.graph.ILookup#lookup} a {@link yfiles.graph.IClipboardHelper} for each item in the original graph - * and remember the memento retrieved by the {@link yfiles.graph.IClipboardHelper#copy} method for later use during the {@link yfiles.graph.GraphClipboard#onElementPasted} - * operation. - *

- * @param original The original element from the source graph instance. If the source graph is a managed folding view, this is always a - * master item. - * @param copy The copy from the clipboard graph. - * @protected - */ - onElementCopied(original:yfiles.graph.IModelItem,copy:yfiles.graph.IModelItem):void; - /** - * A callback function that will be invoked for each item that has been copied into the clipboard graph in response to a {@link yfiles.graph.GraphClipboard#cut} - * operation. - *

- * This implementation will {@link yfiles.graph.ILookup#lookup} a {@link yfiles.graph.IClipboardHelper} for each item in the original graph - * and remember the memento retrieved by the {@link yfiles.graph.IClipboardHelper#cut} method for later use during the {@link yfiles.graph.GraphClipboard#onElementPasted} - * operation. - *

- * @param original The original element from the source graph instance. If the source graph is a managed folding view, this is always a - * master item. - * @param copy The copy from the clipboard graph. - * @protected - */ - onElementCut(original:yfiles.graph.IModelItem,copy:yfiles.graph.IModelItem):void; - /** - * A callback function that will be invoked for each item that has been pasted into the target graph in response to a - * Paste(IGraph) operation. - *

- * This method will use a previously stored {@link yfiles.graph.IClipboardHelper} to let it {@link yfiles.graph.IClipboardHelper#paste finish} its work. - *

- * @param original The original element from the clipboard graph instance. If the target graph is a managed folding view, this is always a - * master item. - * @param copy The copy from the target graph. - * @protected - */ - onElementPasted(original:yfiles.graph.IModelItem,copy:yfiles.graph.IModelItem):void; - /** - * Calls {@link yfiles.graph.GraphCopier#copy} on the current {@link yfiles.graph.GraphClipboard#fromClipboardCopier} instance, depending on whether the targetGraph is the {@link yfiles.graph.GraphClipboard#clipboardGraph} instance. - * @param sourceGraph The source graph to pass to {@link #copy} - * @param filter The predicate to pass on. - * @param targetGraph The target graph to pass on. - * @param targetRootNode The node to use as the root node in the grouped targetGraph. - * @param elementCopiedCallback The delegate to pass on. For each element that is copied during the operation to the clipboard, this callback will be - * passed the original and the copy of the item. In case the targetGraph is a {@link #views folding view graph} the original element is - * passed as {@link #masterGraph master} elements or {@link #getFolderNodeState folding state elements} if a master element does not exist. The copied element is always - * part of the targetGraph. - * @param targetFilter This predicate is used to determine which {@link }s and {@link }s can be used as targets for paste - * operations, e.g. if a labels or ports are copied without their owners. If null all model items can be used as targets. - * @protected - */ - onPaste(sourceGraph:yfiles.graph.IGraph,filter:(obj:yfiles.graph.IModelItem)=>boolean,targetGraph:yfiles.graph.IGraph,targetRootNode:yfiles.graph.INode,elementCopiedCallback:(original:yfiles.graph.IModelItem,copy:yfiles.graph.IModelItem)=>void,targetFilter:(obj:yfiles.graph.IModelItem)=>boolean):void; - /** - * Pastes the {@link yfiles.graph.GraphClipboard#clipboardGraph}'s contents into the targetGraph, selecting all pasted elements. - *

- * The actual work of this method is delegated to the {@link yfiles.graph.GraphClipboard#fromClipboardCopier}'s {@link yfiles.graph.GraphCopier#copy} method. - *

- * @param targetGraph The graph to paste into. - * @param selection The selection model to set the selection on. - */ - paste(targetGraph:yfiles.graph.IGraph,selection:yfiles.view.IGraphSelection):void; - /** - * Pastes the contents from the {@link yfiles.graph.GraphClipboard#clipboardGraph} to the targetGraph after applying a filter. - *

- * For each element pasted into the graph the elementPasted delegate will be invoked and the {@link yfiles.graph.GraphClipboard#onElementPasted} - * method will be called. The actual work of this method is delegated to the {@link yfiles.graph.GraphClipboard#fromClipboardCopier}'s {@link yfiles.graph.GraphCopier#copy} method. - *
- * Providing a valid targetFilter allows for pasting {@link yfiles.graph.ILabel}s, {@link yfiles.graph.IPort}s, and - * {@link yfiles.graph.IEdge}s without valid owners. - *

- * @param context A valid input mode context. Passing a valid input mode context is required for keeping orthogonal edges at group nodes - * whose size might be adjusted after the paste operation. - * @param targetGraph The graph to paste the contents in. - * @param filter The filter to apply to the clipboard graph. - * @param elementPasted The callback to use for each element that has been pasted. For each element that is copied during the operation to the - * clipboard, this callback will be passed the original and the copy of the item. In case the targetGraph is a {@link #views folding view graph} - * the original element is passed as {@link #masterGraph master} elements or {@link #getFolderNodeState folding state elements} if a master element does not exist. The - * copied element is always part of the targetGraph. - * @param targetFilter A filter which returns true for model items which can be used as target for clipboard items which need an owner (e.g. - * {@link }s which were copied without their owner). If null all model items can be used as targets. - */ - paste(context:yfiles.input.IInputModeContext,targetGraph:yfiles.graph.IGraph,filter:(obj:yfiles.graph.IModelItem)=>boolean,elementPasted:(original:yfiles.graph.IModelItem,copy:yfiles.graph.IModelItem)=>void,targetFilter:(obj:yfiles.graph.IModelItem)=>boolean):void; - /** - * Pastes the contents from the {@link yfiles.graph.GraphClipboard#clipboardGraph} to the targetGraph after applying a filter. - *

- * For each element pasted into the graph the elementPasted delegate will be invoked and the {@link yfiles.graph.GraphClipboard#onElementPasted} - * method will be called. The actual work of this method is delegated to the {@link yfiles.graph.GraphClipboard#fromClipboardCopier}'s {@link yfiles.graph.GraphCopier#copy} method. - *

- * @param targetGraph The graph to paste the contents in. - * @param [filter=null] The filter to apply to the clipboard graph. - * @param [elementPasted=null] The callback to use for each element that has been pasted. For each element that is copied during the operation to the - * clipboard, this callback will be passed the original and the copy of the item. In case the targetGraph is a {@link #views folding view graph} - * the original element is passed as {@link #masterGraph master} elements or {@link #getFolderNodeState folding state elements} if a master element does not exist. The - * copied element is always part of the targetGraph. - */ - paste(targetGraph:yfiles.graph.IGraph,filter?:(obj:yfiles.graph.IModelItem)=>boolean,elementPasted?:(original:yfiles.graph.IModelItem,copy:yfiles.graph.IModelItem)=>void):void; - /** - * Pastes the contents from the {@link yfiles.graph.GraphClipboard#clipboardGraph} to the targetGraph after applying a filter. - *

- * For each element pasted into the graph the elementPasted delegate will be invoked and the {@link yfiles.graph.GraphClipboard#onElementPasted} - * method will be called. The actual work of this method is delegated to the {@link yfiles.graph.GraphClipboard#fromClipboardCopier}'s {@link yfiles.graph.GraphCopier#copy} method. - *

- * @param {Object} options The parameters to pass. - * @param options.targetGraph The graph to paste the contents in. - * @param [options.filter=null] The filter to apply to the clipboard graph. - * @param [options.elementPasted=null] The callback to use for each element that has been pasted. For each element that is copied during the operation to the - * clipboard, this callback will be passed the original and the copy of the item. In case the targetGraph is a {@link #views folding view graph} - * the original element is passed as {@link #masterGraph master} elements or {@link #getFolderNodeState folding state elements} if a master element does not exist. The - * copied element is always part of the targetGraph. - */ - paste(options:{targetGraph:yfiles.graph.IGraph,filter?:(obj:yfiles.graph.IModelItem)=>boolean,elementPasted?:(original:yfiles.graph.IModelItem,copy:yfiles.graph.IModelItem)=>void}):void; - /** - * Removes elements from the graph based on a predicate. - * @param sourceGraph The graph to remove elements from. - * @param predicate The predicate that decides which elements to remove. - * @see yfiles.graph.GraphClipboard#cut - * @protected - */ - removeElements(sourceGraph:yfiles.graph.IGraph,predicate:(obj:yfiles.graph.IModelItem)=>boolean):void; - /** - * Gets or sets a vector that will be used to move nodes and bends by after they have been pasted to the target graph. - * @type {yfiles.geometry.Point} - */ - pasteDelta:yfiles.geometry.Point; - /** - * Gets whether the clipboard graph is empty. - * @type {boolean} - */ - empty:boolean; - /** - * Gets or sets the {@link yfiles.graph.GraphCopier} instance that will be used to copy the graph to the clipboard. - *

- * This instance is lazily created using {@link yfiles.graph.GraphClipboard#createToClipboardCopier}. - *

- * @type {yfiles.graph.GraphCopier} - */ - toClipboardCopier:yfiles.graph.GraphCopier; - /** - * Gets or sets the {@link yfiles.graph.GraphCopier} instance that will be used to copy the graph from the clipboard to the target - * graph. - *

- * This instance is lazily created using {@link yfiles.graph.GraphClipboard#createFromClipboardCopier}. - *

- * @type {yfiles.graph.GraphCopier} - */ - fromClipboardCopier:yfiles.graph.GraphCopier; - /** - * Gets or sets the {@link yfiles.graph.GraphCopier} instance that will be used to duplicate elements inside the graph. - *

- * This instance is lazily created using {@link yfiles.graph.GraphClipboard#createDuplicateCopier}. - *

- * @type {yfiles.graph.GraphCopier} - */ - duplicateCopier:yfiles.graph.GraphCopier; - /** - * Gets or sets the {@link yfiles.graph.IClipboardIdProvider} used by this instance to provide IDs for copied items. - *

- * The default implementation simply uses a reference to the original item as - * ID. - *
- * Custom ID can be used to map between elements in different graphs. - *

- * @type {yfiles.graph.IClipboardIdProvider} - */ - idProvider:yfiles.graph.IClipboardIdProvider; - /** - * Gets or sets the graph that contains the clipboard's contents. - * @throws {Stubs.Exceptions.ArgumentError} If value is null. - * @type {yfiles.graph.IGraph} - */ - clipboardGraph:yfiles.graph.IGraph; - /** - * Gets or sets whether or not nodes should be automatically put into a group node and if so how this group will be - * determined. - *

- * This property is used by {@link yfiles.graph.GraphClipboard#getTargetNode} to decide what node to yield as the target group node - * for the newly pasted node. - *

- *

- * The default is {@link yfiles.graph.ParentNodeDetectionModes#SELECTION}|{@link yfiles.graph.ParentNodeDetectionModes#PREVIOUS_PARENT}. - *

- * @type {yfiles.graph.ParentNodeDetectionModes} - */ - parentNodeDetection:yfiles.graph.ParentNodeDetectionModes; - /** - * Gets or sets the type of items that depend on other elements but should automatically be copied implicitly to the - * clipboard if all elements that it depends on are explicitly selected for copying. - *

- * {@link yfiles.graph.ILabel Labels} depend on their {@link yfiles.graph.ILabelOwner owner}, like {@link yfiles.graph.IPort ports} depend on their {@link yfiles.graph.IPortOwner owner}. Also {@link yfiles.graph.IBend bends} of course depend on their {@link yfiles.graph.IEdge owning edge}. - *

- *

- * If the corresponding element type is set in this property, items that depend on other items are implicitly included in - * the copy operation, if all of the items that they depend on are included recursively, even if they are not included - * explicitly themselves. - *

- *

- * The default is {@link yfiles.graph.GraphItemTypes#ALL} minus - * {@link yfiles.graph.GraphItemTypes#NODE}, which means that selecting a number of nodes will automatically select all elements - * that directly and indirectly depend on the existence of this set of nodes will be copied to the clipboard, too. - *

- *

- * Technically nodes do not depend on anything. Setting this property to a value that includes {@link yfiles.graph.GraphItemTypes#NODE} - * will include all child nodes for every selected group node. - *

- * @default 63 & ~1 - * @type {yfiles.graph.GraphItemTypes} - */ - dependentCopyItems:yfiles.graph.GraphItemTypes; - /** - * Gets or sets the type of items that can be copied and pasted independently of their owning element. - *

- * {@link yfiles.graph.ILabel Labels} depend on their {@link yfiles.graph.ILabelOwner owner}, like {@link yfiles.graph.IPort ports} depend on their {@link yfiles.graph.IPortOwner owner}. Also {@link yfiles.graph.IBend bends} of course depend on their {@link yfiles.graph.IEdge owning edge}. - *

- *

- * If the corresponding element type is set in this property, items can be copied alone to the clipboard and be pasted onto - * different owning elements. - *

- *

- * This enables copying of a label to one or more owners, without having to copy the owner of the label. Also ports can be - * copied to other {@link yfiles.graph.IPortOwner}s and bends to other edges. - *

- *

- * The default is {@link yfiles.graph.GraphItemTypes#ALL} which means that all elements can be copied to the clipboard even if the - * items that they depend on are not copied to the clipboard. - *

- *

- * Technically owning elements are still part of the clipboard as - * {@link yfiles.graph.GraphClipboard#isDummy dummy elements}, but these elements will not be pasted to the target during paste or duplicate operations. - *

- * @default yfiles.graph.GraphItemTypes.ALL - * @type {yfiles.graph.GraphItemTypes} - */ - independentCopyItems:yfiles.graph.GraphItemTypes; - /** - * Gets or sets the type of items that can be copied and pasted at all using the clipboard. - *

- * If the corresponding element type is set in this property, items can be effectively copied. - *

- *

- * If the corresponding element type is not set in this property, items will not be pasted, even if they have been - * explicitly selected. They may copied to the clipboard and become part of the {@link yfiles.graph.GraphClipboard#clipboardGraph}, nevertheless though, if they are required - * as {@link yfiles.graph.GraphClipboard#isDummy dummy elements}. But these elements will not be pasted to the target during paste or duplicate operations. - *

- *

- * The default is {@link yfiles.graph.GraphItemTypes#ALL}. - *

- * @default yfiles.graph.GraphItemTypes.ALL - * @type {yfiles.graph.GraphItemTypes} - */ - copyItems:yfiles.graph.GraphItemTypes; - /** - * Gets or sets whether to paste edges whose source or target node was selected when copying to the clipboard while the - * other node was not. - *

- * The default is false. - *

- * @type {boolean} - */ - ignoreEdgesWithOneNode:boolean; - /** - * Adds the given listener for the ElementsCut event that occurs when the {@link yfiles.graph.GraphClipboard#cut} operation - * finished successfully. - * @param listener The listener to add. - * @see yfiles.graph.GraphClipboard#removeElementsCutListener - */ - addElementsCutListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the ElementsCut event that occurs when the {@link yfiles.graph.GraphClipboard#cut} operation - * finished successfully. - * @param listener The listener to remove. - * @see yfiles.graph.GraphClipboard#addElementsCutListener - */ - removeElementsCutListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Adds the given listener for the ElementsCopied event that occurs when the {@link yfiles.graph.GraphClipboard#copy} operation - * finished successfully. - * @param listener The listener to add. - * @see yfiles.graph.GraphClipboard#removeElementsCopiedListener - */ - addElementsCopiedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the ElementsCopied event that occurs when the {@link yfiles.graph.GraphClipboard#copy} operation - * finished successfully. - * @param listener The listener to remove. - * @see yfiles.graph.GraphClipboard#addElementsCopiedListener - */ - removeElementsCopiedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Adds the given listener for the ElementsPasted event that occurs when the {@link yfiles.graph.GraphClipboard#paste} operation - * finished successfully. - * @param listener The listener to add. - * @see yfiles.graph.GraphClipboard#removeElementsPastedListener - */ - addElementsPastedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the ElementsPasted event that occurs when the {@link yfiles.graph.GraphClipboard#paste} operation - * finished successfully. - * @param listener The listener to remove. - * @see yfiles.graph.GraphClipboard#addElementsPastedListener - */ - removeElementsPastedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.GraphClipboard; - } - export enum CloneTypes{ - /** - * Indicates the {@link yfiles.styles.INodeStyle} constant. - */ - NODE_STYLE, - /** - * Indicates the {@link yfiles.styles.IEdgeStyle} constant. - */ - EDGE_STYLE, - /** - * Indicates the {@link yfiles.styles.IPortStyle} constant. - */ - PORT_STYLE, - /** - * Indicates the {@link yfiles.styles.ILabelStyle} constant. - */ - LABEL_STYLE, - /** - * Indicates the {@link yfiles.graph.ILabelModelParameter} constant. - */ - LABEL_MODEL_PARAMETER, - /** - * Indicates the {@link yfiles.graph.IPortLocationModelParameter} constant. - */ - PORT_LOCATION_MODEL_PARAMETER, - /** - * Indicates the {@link yfiles.graph.ITagOwner#tag} constant. - */ - TAGS, - /** - * A combination of all flags in this enumeration. - */ - ALL - } - /** - * Utility class that copies parts of an {@link yfiles.graph.IGraph} to another instance. - *

- * Instances of this class can be used in {@link yfiles.graph.GraphClipboard}, e.g. - *

- * @class - */ - export interface GraphCopier extends yfiles.lang.Object{} - export class GraphCopier { - constructor(); - /** - * Callback method that adds a bend to the targetEdge in the targetGraph as a copy of the source bend. - * @param sourceGraph The source graph. - * @param targetGraph The target graph. - * @param targetEdge The target edge to add the bend to. - * @param sourceBend The source bend to copy the values from. - * @param offset The offset to apply to the copied bend. - * @param index The index to add the bend at. - * @returns The newly created bend. - * @protected - */ - addBend(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph,targetEdge:yfiles.graph.IEdge,sourceBend:yfiles.graph.IBend,offset:yfiles.geometry.Point,index:number):yfiles.graph.IBend; - /** - * Callback method that adds a label to the target item in the targetGraph as a copy of the source label. - *

- * This implementation uses {@link yfiles.graph.GraphCopier#copyLabelLayoutParameter}, {@link yfiles.graph.GraphCopier#copyLabelStyle}, and - * {@link yfiles.graph.GraphCopier#copyLabelTag} as callbacks. - *

- * @param sourceGraph The source graph. - * @param targetGraph The target graph. - * @param targetOwner The item owner in the target graph to add the label to. - * @param sourceLabel The source label in the source graph. - * @returns The newly created label. - * @protected - */ - addLabel(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph,targetOwner:yfiles.graph.ILabelOwner,sourceLabel:yfiles.graph.ILabel):yfiles.graph.ILabel; - /** - * Callback method that adds a port to the targetPortOwner in the targetGraph as a copy of the source port. - *

- * This implementation does not need to copy the adjacent {@link yfiles.graph.IEdge}s of the sourcePort. This implementation uses - * {@link yfiles.graph.GraphCopier#copyPortLocationParameter}, {@link yfiles.graph.GraphCopier#copyPortStyle}, and {@link yfiles.graph.GraphCopier#copyPortTag} - * as callbacks. - *

- * @param sourceGraph The source graph. - * @param targetGraph The target graph. - * @param targetOwner The port owner in the target graph to add the port to. - * @param sourcePort The source port in the source graph. - * @returns The newly created port. - */ - addPort(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph,targetOwner:yfiles.graph.IPortOwner,sourcePort:yfiles.graph.IPort):yfiles.graph.IPort; - /** - * This method places the given copy into an internal cache. - *

- * The cache can be queried using {@link yfiles.graph.GraphCopier#getCopy}. The cache is held until {@link yfiles.graph.GraphCopier#clearCopyCache} - * is called. - *

- * Type parameter T: The type of the item to cache. - * @param original The original item. - * @param copy The copy of the item. - * @see yfiles.graph.GraphCopier#getOrCreateCopy - * @protected - * @template T - */ - cacheCopy(original:T,copy:T):void; - /** - * Clears the cache for the {@link yfiles.graph.GraphCopier#cacheCopy cached copies} of the instance copied using this class. - *

- * This method is called before and after a copy operation. - *

- * @protected - */ - clearCopyCache():void; - /** - * Copies a subgraph induced by a predicate from the sourceGraph to the targetGraph. - *

- * For each element that has been copied, the elementCopiedCallback will be invoked. - *

- * @param sourceGraph The graph to copy the elements from. - * @param filter The filter that decides which elements to copy. - * @param targetGraph The graph to copy the elements to. - * @param targetRootNode The group node that should act as the root node for the pasted elements. May be null if there is no such node. - * @param offset The offset to apply to the copied items. Only nodes and bends will be offset explicitly, while other items will move - * implicitly. - * @param elementCopiedCallback A delegate to invoke for each element being copied. - * @throws {Stubs.Exceptions.ArgumentError} if targetRootNode is not in targetGraph - */ - copy(sourceGraph:yfiles.graph.IGraph,filter:(obj:yfiles.graph.IModelItem)=>boolean,targetGraph:yfiles.graph.IGraph,targetRootNode:yfiles.graph.INode,offset:yfiles.geometry.Point,elementCopiedCallback:(original:yfiles.graph.IModelItem,copy:yfiles.graph.IModelItem)=>void):void; - /** - * Copies a subgraph described by a predicate from the sourceGraph to the targetGraph. - *

- * For each element that has been copied, the elementCopiedCallback will be invoked. This method actually delegates to {@link yfiles.graph.GraphCopier#copy} - * and provides the root as the "targetGraph" parameter if there is a hierarchy associated with targetGraph. - *

- * @param sourceGraph The graph to copy the elements from. - * @param filter The filter that decides which elements to copy. - * @param targetGraph The graph to copy the elements to. - * @param offset The offset to apply to the copied items. Only nodes and bends will be offset explicitly, while other items will move - * implicitly. - * @param elementCopiedCallback A delegate to invoke for each element being copied. - */ - copy(sourceGraph:yfiles.graph.IGraph,filter:(obj:yfiles.graph.IModelItem)=>boolean,targetGraph:yfiles.graph.IGraph,offset:yfiles.geometry.Point,elementCopiedCallback:(original:yfiles.graph.IModelItem,copy:yfiles.graph.IModelItem)=>void):void; - /** - * Copies sourceGraph to targetGraph. - *

- * This method actually delegates to {@link yfiles.graph.GraphCopier#copy} and provides the root as the "targetGraph" parameter if - * there is a hierarchy associated with targetGraph. - *

- * @param sourceGraph The graph to copy. - * @param targetGraph The graph to copy to. - */ - copy(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph):void; - /** - * Callback method that adds an edge to the targetGraph as a copy of the source edge. - *

- * This implementation does not need to copy the {@link yfiles.graph.IBend}s of the sourceEdge, nor should it copy - * {@link yfiles.graph.IPort}s or {@link yfiles.graph.ILabel}s. This implementation uses {@link yfiles.graph.GraphCopier#copyEdgeStyle} and {@link yfiles.graph.GraphCopier#copyEdgeTag} - * as callbacks. - *

- * @param sourceGraph The source graph. - * @param targetGraph The target graph. - * @param sourceEdge The edge in the source graph. - * @param targetSourcePort The new source port in the target graph. - * @param targetTargetPort The new target port in the target graph. - * @returns The newly created edge. - * @protected - */ - copyEdge(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph,sourceEdge:yfiles.graph.IEdge,targetSourcePort:yfiles.graph.IPort,targetTargetPort:yfiles.graph.IPort):yfiles.graph.IEdge; - /** - * Copies an {@link yfiles.styles.IEdgeStyle} instance. - *

- * This implementation uses the {@link yfiles.lang.ICloneable#clone} method to create a copy. - *

- * @param graph The graph that contains the edge. - * @param edge The edge to copy the style from. - * @returns The style to apply for the copy. - * @see yfiles.graph.GraphCopier#copy - */ - copyEdgeStyle(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge):yfiles.styles.IEdgeStyle; - /** - * Callback that copies the {@link yfiles.graph.ITagOwner#tag} of an {@link yfiles.graph.IEdge}. - *

- * This implementation simply delegates to {@link yfiles.graph.GraphCopier#copyTag} - *

- * @param edge The old edge. - * @param tag The tag to copy. - * @returns The copy of the tag. - * @protected - */ - copyEdgeTag(edge:yfiles.graph.IEdge,tag:any):any; - /** - * Callback method that creates a copy of the sourceGroupNode in the targetGraph. - *

- * This implementation does not need to copy {@link yfiles.graph.IPort}s or {@link yfiles.graph.ILabel}s. This implementation uses {@link yfiles.graph.GraphCopier#copyNodeStyle} - * and {@link yfiles.graph.GraphCopier#copyNodeTag} as callbacks. - *

- * @param sourceGraph The source graph. - * @param targetGraph The target graph. - * @param sourceGroupNode The source node to create a copy of in the targetGraph. - * @param targetParent The parent of the group node in the target graph. - * @param offset The offset to apply to the copied node. - * @returns The newly created node. - * @protected - */ - copyGroupNode(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph,sourceGroupNode:yfiles.graph.INode,targetParent:yfiles.graph.INode,offset:yfiles.geometry.Point):yfiles.graph.INode; - /** - * Copies a {@link yfiles.graph.ILabelModelParameter} for a given label. - *

- * This implementation uses the {@link yfiles.lang.ICloneable#clone} method to create a copy. - *

- * @param graph The graph that contains the label. - * @param label The label to copy the label model parameter from. - * @returns The copy of the parameter to apply for the copy. - * @see yfiles.graph.GraphCopier#copy - */ - copyLabelLayoutParameter(graph:yfiles.graph.IGraph,label:yfiles.graph.ILabel):yfiles.graph.ILabelModelParameter; - /** - * Copies an {@link yfiles.styles.ILabelStyle} instance. - *

- * This implementation uses the {@link yfiles.lang.ICloneable#clone} method to create a copy. - *

- * @param graph The graph that contains the label. - * @param label The label to copy the style from. - * @returns The style to apply for the copy. - * @see yfiles.graph.GraphCopier#copy - */ - copyLabelStyle(graph:yfiles.graph.IGraph,label:yfiles.graph.ILabel):yfiles.styles.ILabelStyle; - /** - * Callback that copies the {@link yfiles.graph.ITagOwner#tag} of a {@link yfiles.graph.ILabel}. - *

- * This implementation simply delegates to {@link yfiles.graph.GraphCopier#copyTag} - *

- * @param label The old label. - * @param tag The tag to copy. - * @returns The copy of the tag. - */ - copyLabelTag(label:yfiles.graph.ILabel,tag:any):any; - /** - * Callback method that creates a copy of the node in the targetGraph. - *

- * This implementation does not need to copy {@link yfiles.graph.IPort}s or {@link yfiles.graph.ILabel}s. This implementation uses {@link yfiles.graph.GraphCopier#copyNodeStyle} - * and {@link yfiles.graph.GraphCopier#copyNodeTag} as callbacks. - *

- * @param sourceGraph The source graph. - * @param targetGraph The target graph. - * @param targetParent The parent of the group node in the target graph. - * @param node The source node to create a copy of in the targetGraph. - * @param offset The offset to apply to the copied node. - * @returns The newly created node. - * @protected - */ - copyNode(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph,node:yfiles.graph.INode,targetParent:yfiles.graph.INode,offset:yfiles.geometry.Point):yfiles.graph.INode; - /** - * Callback method that creates a copy of the node in the targetGraph. - *

- * This implementation does not need to copy {@link yfiles.graph.IPort}s or {@link yfiles.graph.ILabel}s. This implementation uses {@link yfiles.graph.GraphCopier#copyNodeStyle} - * and {@link yfiles.graph.GraphCopier#copyNodeTag} as callbacks. - *

- * @param sourceGraph The source graph. - * @param targetGraph The target graph. - * @param node The source node to create a copy of in the targetGraph. - * @param offset The offset to apply to the copied node. - * @returns The newly created node. - * @protected - */ - copyNode(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph,node:yfiles.graph.INode,offset:yfiles.geometry.Point):yfiles.graph.INode; - /** - * Copies an {@link yfiles.styles.INodeStyle} instance. - *

- * This implementation uses the {@link yfiles.lang.ICloneable#clone} method to create a copy. - *

- * @param graph The graph that contains the node. - * @param node The node to copy the style from. - * @returns The style to apply for the copy. - * @see yfiles.graph.GraphCopier#copy - */ - copyNodeStyle(graph:yfiles.graph.IGraph,node:yfiles.graph.INode):yfiles.styles.INodeStyle; - /** - * Callback that copies the {@link yfiles.graph.ITagOwner#tag} of a {@link yfiles.graph.INode}. - *

- * This implementation simply delegates to {@link yfiles.graph.GraphCopier#copyTag} - *

- * @param node The old node. - * @param tag The tag to copy. - * @returns The copy of the tag. - * @protected - */ - copyNodeTag(node:yfiles.graph.INode,tag:any):any; - /** - * Copies a {@link yfiles.graph.IPortLocationModelParameter} for a given port. - *

- * This implementation uses the {@link yfiles.lang.ICloneable#clone} method to create a copy. - *

- * @param graph The graph that contains the port. - * @param port The port to copy the model parameter from. - * @returns The copy of the parameter to apply for the copy. - * @see yfiles.graph.GraphCopier#copy - */ - copyPortLocationParameter(graph:yfiles.graph.IGraph,port:yfiles.graph.IPort):yfiles.graph.IPortLocationModelParameter; - /** - * Copies an {@link yfiles.styles.IPortStyle} instance. - *

- * This implementation uses the {@link yfiles.lang.ICloneable#clone} method to create a copy. - *

- * @param graph The graph that contains the port. - * @param port The port to copy the style from. - * @returns The style to apply for the copy. - * @see yfiles.graph.GraphCopier#copy - */ - copyPortStyle(graph:yfiles.graph.IGraph,port:yfiles.graph.IPort):yfiles.styles.IPortStyle; - /** - * Callback that copies the {@link yfiles.graph.ITagOwner#tag} of a {@link yfiles.graph.IPort}. - *

- * This implementation simply delegates to {@link yfiles.graph.GraphCopier#copyTag} - *

- * @param port The old port. - * @param tag The tag to copy. - * @returns The copy of the tag. - * @protected - */ - copyPortTag(port:yfiles.graph.IPort,tag:any):any; - /** - * Callback that will copy a {@link yfiles.graph.ITagOwner#tag} for the target graph. - *

- * This implementation will try to {@link yfiles.lang.ICloneable#clone} the tag if the {@link yfiles.graph.GraphCopier#clone} property has the {@link yfiles.graph.CloneTypes#TAGS} - * flag set. If this is not the case or the tag is not {@link yfiles.lang.ICloneable}, the instance will be returned. - *

- * @param owner The old owner of the tag. - * @param tag The tag to copy. - * @returns A copy of the tag. - */ - copyTag(owner:yfiles.graph.IModelItem,tag:any):any; - /** - * Tries to obtain a previously {@link yfiles.graph.GraphCopier#cacheCopy cached} copy for the given original. - *

- * Values will be stored in the cache until the next call to {@link yfiles.graph.GraphCopier#clearCopyCache}. In order to indicate - * that no copy is available, this implementation yields {@link yfiles.graph.GraphCopier#NO_COPY}. In contrast, null is a valid - * return value that is the copied value of the original. - *

- * Type parameter T: The type of the item to copy. - * @param itemType The type of the item to copy. - * @param original The original item. - * @returns The copy of original or {@link #NO_COPY} if no copy has been found. - * @see yfiles.graph.GraphCopier#cacheCopy - * @see yfiles.graph.GraphCopier#getOrCreateCopy - * @protected - * @template T - */ - getCopy(itemType:yfiles.lang.Class,original:T):T; - /** - * Convenience method that either yields a previously {@link yfiles.graph.GraphCopier#cacheCopy cached} copy for the given original or uses the copyDelegate to create - * the copy of the original. - *

- * If there is a cache miss, the delegate will be used to create the copy and the copy will be placed into the {@link yfiles.graph.GraphCopier#cacheCopy cache}. - *

- * Type parameter T: The type of the item to copy. - * @param tType The type of the item to copy. - * @param original The original item. - * @param copyDelegate The copy delegate to create the copy. - * @returns A copy of the original, either cached, or newly created and then cached. - * @template T - */ - getOrCreateCopy(tType:yfiles.lang.Class,original:T,copyDelegate:(arg:T)=>T):T; - /** - * Called after a bend has been copied. - *

- * Raises the {@link yfiles.graph.GraphCopier#addBendCopiedListener BendCopied} event. - *

- * @param original The original of the copied bend. - * @param copy The copied bend. - */ - onBendCopied(original:yfiles.graph.IBend,copy:yfiles.graph.IBend):void; - /** - * Called after an edge has been copied. - *

- * Raises the {@link yfiles.graph.GraphCopier#addEdgeCopiedListener EdgeCopied} event. - *

- * @param original The original of the copied edge. - * @param copy The copied edge. - * @protected - */ - onEdgeCopied(original:yfiles.graph.IEdge,copy:yfiles.graph.IEdge):void; - /** - * Called after the entire graph has been copied. - *

- * Raises the {@link yfiles.graph.GraphCopier#addGraphCopiedListener GraphCopied} event. - *

- * @param sourceGraph The source graph from which the elements have been copied. - * @param targetGraph The graph to which the elements have been copied. - * @protected - */ - onGraphCopied(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph):void; - /** - * Called after a label has been copied. - *

- * Raises the {@link yfiles.graph.GraphCopier#addLabelCopiedListener LabelCopied} event. - *

- * @param original The original of the copied label. - * @param copy The copied label. - */ - onLabelCopied(original:yfiles.graph.ILabel,copy:yfiles.graph.ILabel):void; - /** - * Called after a node has been copied. - *

- * Raises the {@link yfiles.graph.GraphCopier#addNodeCopiedListener NodeCopied} event. - *

- * @param original The original of the copied node. - * @param copy The copied node. - * @protected - */ - onNodeCopied(original:yfiles.graph.INode,copy:yfiles.graph.INode):void; - /** - * Emits the {@link yfiles.graph.GraphCopier#addObjectCopiedListener ObjectCopied} event. - * @param evt The argument to use. - * @protected - */ - onObjectCopied(evt:yfiles.graph.ItemCopiedEventArgs):void; - /** - * Called after a port has been copied. - *

- * Raises the {@link yfiles.graph.GraphCopier#addPortCopiedListener PortCopied} event. - *

- * @param original The original of the copied port. - * @param copy The copied port. - */ - onPortCopied(original:yfiles.graph.IPort,copy:yfiles.graph.IPort):void; - /** - * Gets or sets the types of items that should be {@link yfiles.lang.ICloneable#clone cloned} for the copy operation. - * @type {yfiles.graph.CloneTypes} - */ - clone:yfiles.graph.CloneTypes; - /** - * Gets or sets the types of objects where the referential identity should be kept across clipboard operations. - *

- * For each of the types that are set via this property, this implementation will use a caching copy mechanism as follows: - * If there has already been an instance copied via this clipboard ({@link yfiles.graph.GraphCopier#getCopy}), that instance will - * instead be returned, otherwise, this implementation will clone the original instance (depending on the setting of {@link yfiles.graph.GraphCopier#clone}) and - * {@link yfiles.graph.GraphCopier#cacheCopy cache the copy} until after the operation the {@link yfiles.graph.GraphCopier#clearCopyCache cache is cleared}. This feature is implemented directly by the various {@link yfiles.graph.GraphCopier#copyNodeStyle CopyXXX} - * methods. - *

- * @see yfiles.graph.GraphCopier#getOrCreateCopy - * @type {yfiles.graph.CloneTypes} - */ - referentialIdentityTypes:yfiles.graph.CloneTypes; - /** - * The sentinel return value for use in {@link yfiles.graph.GraphCopier#getCopy}. - * @returns This value is used as a place-holder to indicate that no copy has been stored previously. - * @protected - * @const - * @static - * @type {any} - */ - static NO_COPY:any; - /** - * Gets or sets a property that determines whether grouping information should be copied to target graphs. - *

- * With this property set to false the {@link yfiles.graph.GraphCopier} can be used to flatten a grouped graph, i.e. remove the - * grouping information. - *

- *

- * The default is true. - *

- * @type {boolean} - */ - copyGrouping:boolean; - /** - * Gets or sets a property that determines whether {@link yfiles.graph.FoldingManager additional folding states}. - *

- * Should be copied to target graphs. - *

- *

- * If the source and target graphs have an instance of {@link yfiles.graph.FoldingManager} in their lookup, the additional {@link yfiles.graph.FoldingManager#getFolderNodeState folding state} - * of the nodes and edges will be copied. The default is true. - *

- * @type {boolean} - */ - copyFoldingStates:boolean; - /** - * Adds the given listener for the NodeCopied event that occurs after a node has been copied. - *

- * This event is dispatched after the element copied callback has been executed. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original original} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#copy copied} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. - *

- * @param listener The listener to add. - * @see yfiles.graph.GraphCopier#removeNodeCopiedListener - */ - addNodeCopiedListener(listener:(sender:any,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; - /** - * Removes the given listener for the NodeCopied event that occurs after a node has been copied. - *

- * This event is dispatched after the element copied callback has been executed. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original original} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#copy copied} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. - *

- * @param listener The listener to remove. - * @see yfiles.graph.GraphCopier#addNodeCopiedListener - */ - removeNodeCopiedListener(listener:(sender:any,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; - /** - * Adds the given listener for the BendCopied event that occurs after a bend has been copied. - *

- * This event is dispatched after the element copied callback has been executed. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original original} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#copy copied} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. - *

- *

- * For {@link yfiles.graph.FoldingManager#getFoldingEdgeState folding edge} bends, their view state representation is passed. These elements are neither part of the {@link yfiles.graph.FoldingManager#masterGraph} nor the - * {@link yfiles.graph.FoldingManager#views view graph}. - *

- * @param listener The listener to add. - * @see yfiles.graph.GraphCopier#removeBendCopiedListener - */ - addBendCopiedListener(listener:(sender:any,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; - /** - * Removes the given listener for the BendCopied event that occurs after a bend has been copied. - *

- * This event is dispatched after the element copied callback has been executed. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original original} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#copy copied} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. - *

- *

- * For {@link yfiles.graph.FoldingManager#getFoldingEdgeState folding edge} bends, their view state representation is passed. These elements are neither part of the {@link yfiles.graph.FoldingManager#masterGraph} nor the - * {@link yfiles.graph.FoldingManager#views view graph}. - *

- * @param listener The listener to remove. - * @see yfiles.graph.GraphCopier#addBendCopiedListener - */ - removeBendCopiedListener(listener:(sender:any,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; - /** - * Adds the given listener for the ObjectCopied event that occurs after a style has been copied. - *

- * This event is triggered for all minor objects the graph items are made up of, e.g. the {@link yfiles.graph.GraphCopier#copyNodeStyle styles}, {@link yfiles.graph.GraphCopier#copyTag tags}, {@link yfiles.graph.GraphCopier#copyLabelLayoutParameter labels}, and {@link yfiles.graph.GraphCopier#copyPortLocationParameter port} - * parameters. - *

- *

- * This event will not be triggered for the graph items themselves and will not be triggered if the object reference is - * reused, i.e. it will only be triggered if the old and new references actually differ. - *

- * @param listener The listener to add. - * @see yfiles.graph.GraphCopier#removeObjectCopiedListener - */ - addObjectCopiedListener(listener:(sender:any,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; - /** - * Removes the given listener for the ObjectCopied event that occurs after a style has been copied. - *

- * This event is triggered for all minor objects the graph items are made up of, e.g. the {@link yfiles.graph.GraphCopier#copyNodeStyle styles}, {@link yfiles.graph.GraphCopier#copyTag tags}, {@link yfiles.graph.GraphCopier#copyLabelLayoutParameter labels}, and {@link yfiles.graph.GraphCopier#copyPortLocationParameter port} - * parameters. - *

- *

- * This event will not be triggered for the graph items themselves and will not be triggered if the object reference is - * reused, i.e. it will only be triggered if the old and new references actually differ. - *

- * @param listener The listener to remove. - * @see yfiles.graph.GraphCopier#addObjectCopiedListener - */ - removeObjectCopiedListener(listener:(sender:any,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; - /** - * Adds the given listener for the EdgeCopied event that occurs after an edge has been copied. - *

- * This event is dispatched after the element copied callback has been executed. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original original} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#copy copied} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. - *

- * @param listener The listener to add. - * @see yfiles.graph.GraphCopier#removeEdgeCopiedListener - */ - addEdgeCopiedListener(listener:(sender:any,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; - /** - * Removes the given listener for the EdgeCopied event that occurs after an edge has been copied. - *

- * This event is dispatched after the element copied callback has been executed. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original original} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#copy copied} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. - *

- * @param listener The listener to remove. - * @see yfiles.graph.GraphCopier#addEdgeCopiedListener - */ - removeEdgeCopiedListener(listener:(sender:any,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; - /** - * Adds the given listener for the PortCopied event that occurs after a port has been copied. - *

- * This event is dispatched after the element copied callback has been executed. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original original} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#copy copied} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. - *

- * @param listener The listener to add. - * @see yfiles.graph.GraphCopier#removePortCopiedListener - */ - addPortCopiedListener(listener:(sender:any,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; - /** - * Removes the given listener for the PortCopied event that occurs after a port has been copied. - *

- * This event is dispatched after the element copied callback has been executed. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original original} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#copy copied} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. - *

- * @param listener The listener to remove. - * @see yfiles.graph.GraphCopier#addPortCopiedListener - */ - removePortCopiedListener(listener:(sender:any,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; - /** - * Adds the given listener for the LabelCopied event that occurs after a label has been copied. - *

- * This event is dispatched after the element copied callback has been executed. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original original} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#copy copied} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. - *

- *

- * For {@link yfiles.graph.FoldingManager#getFoldingEdgeState folding edge} or dummy node labels, their view state representation is passed. These elements are neither part of the - * {@link yfiles.graph.FoldingManager#masterGraph} nor the {@link yfiles.graph.FoldingManager#views view graph}. - *

- * @param listener The listener to add. - * @see yfiles.graph.GraphCopier#removeLabelCopiedListener - */ - addLabelCopiedListener(listener:(sender:any,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; - /** - * Removes the given listener for the LabelCopied event that occurs after a label has been copied. - *

- * This event is dispatched after the element copied callback has been executed. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original original} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#copy copied} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. - *

- *

- * For {@link yfiles.graph.FoldingManager#getFoldingEdgeState folding edge} or dummy node labels, their view state representation is passed. These elements are neither part of the - * {@link yfiles.graph.FoldingManager#masterGraph} nor the {@link yfiles.graph.FoldingManager#views view graph}. - *

- * @param listener The listener to remove. - * @see yfiles.graph.GraphCopier#addLabelCopiedListener - */ - removeLabelCopiedListener(listener:(sender:any,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; - /** - * Adds the given listener for the GraphCopied event that occurs after the entire graph has been copied. - *

- * This event is dispatched at the end of the {@link yfiles.graph.GraphCopier#copy} method. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original source graph} item is the {@link yfiles.graph.FoldingManager#masterGraph master graph} of the folding view. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#copy target graph} is the {@link yfiles.graph.FoldingManager#masterGraph master graph} of the folding view. - *

- * @param listener The listener to add. - * @see yfiles.graph.GraphCopier#removeGraphCopiedListener - */ - addGraphCopiedListener(listener:(sender:any,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; - /** - * Removes the given listener for the GraphCopied event that occurs after the entire graph has been copied. - *

- * This event is dispatched at the end of the {@link yfiles.graph.GraphCopier#copy} method. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original source graph} item is the {@link yfiles.graph.FoldingManager#masterGraph master graph} of the folding view. - *

- *

- * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph is a folding view - * graph the {@link yfiles.graph.ItemCopiedEventArgs.#copy target graph} is the {@link yfiles.graph.FoldingManager#masterGraph master graph} of the folding view. - *

- * @param listener The listener to remove. - * @see yfiles.graph.GraphCopier#addGraphCopiedListener - */ - removeGraphCopiedListener(listener:(sender:any,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.GraphCopier; - } - /** - * Event arguments for the events in {@link yfiles.graph.GraphCopier}. - *

- * This event is used for the {@link yfiles.graph.GraphCopier#addNodeCopiedListener NodeCopied}, - * {@link yfiles.graph.GraphCopier#addEdgeCopiedListener EdgeCopied}, - * {@link yfiles.graph.GraphCopier#addPortCopiedListener PortCopied}, - * {@link yfiles.graph.GraphCopier#addGraphCopiedListener GraphCopied}, - * {@link yfiles.graph.GraphCopier#addLabelCopiedListener LabelCopied}, and {@link yfiles.graph.GraphCopier#addObjectCopiedListener ObjectCopied} - * events. This event holds references to the {@link yfiles.graph.ItemCopiedEventArgs.#original original} of the copied item and the {@link yfiles.graph.ItemCopiedEventArgs.#copy copied item} itself. - *

- * Type parameter T: The logical base type of the copied item. - * @class - * @extends {yfiles.lang.EventArgs} - * @template T - */ - export interface ItemCopiedEventArgs extends yfiles.lang.EventArgs{} - export class ItemCopiedEventArgs { - /** - * Creates a new argument for the given item and its original. - * @param original The {@link #original original} of the copied item. - * @param copy The {@link #copy copied item}. - */ - constructor(original:T,copy:T); - /** - * Gets the original of the {@link yfiles.graph.ItemCopiedEventArgs.#copy copied item}. - * @type {T} - */ - original:T; - /** - * Gets the copied item. - * @type {T} - */ - copy:T; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.ItemCopiedEventArgs; - } - /** - * Helper class that can be used to aid in decorating {@link yfiles.graph.IModelItem}s from an {@link yfiles.graph.IGraph} instance. - *

- * This class servers as a factory for lookup decorators for the various items that make up an {@link yfiles.graph.IGraph}. This is - * a convenience class that obtains the {@link yfiles.graph.ILookupDecorator} from the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup} - * and passes that to the various specialized decorator convenience classes like e.g. {@link yfiles.graph.NodeDecorator}. - *

- * @see yfiles.graph.GraphDecorator#nodeDecorator - * @see yfiles.graph.NodeDecorator - * @see yfiles.graph.GraphDecorator#edgeDecorator - * @see yfiles.graph.EdgeDecorator - * @see yfiles.graph.GraphDecorator#labelDecorator - * @see yfiles.graph.LabelDecorator - * @see yfiles.graph.GraphDecorator#portDecorator - * @see yfiles.graph.PortDecorator - * @see yfiles.graph.GraphDecorator#bendDecorator - * @see yfiles.graph.BendDecorator - * @class - * @final - */ - export interface GraphDecorator extends yfiles.lang.Object{} - export class GraphDecorator { - /** - * Initializes a new instance of the {@link yfiles.graph.GraphDecorator} class. - * @param graph The graph. - */ - constructor(graph:yfiles.graph.IGraph); - /** - * Gets a {@link yfiles.graph.GraphDecorator#nodeDecorator} instance that can be used to decorate the {@link yfiles.graph.INode} instances in the graph that this decorator has been - * created for. - *

- * This will obtain the {@link yfiles.graph.ILookupDecorator} instance from the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup} - * method and use it to initialize the {@link yfiles.graph.NodeDecorator} - *

- * @type {yfiles.graph.NodeDecorator} - */ - nodeDecorator:yfiles.graph.NodeDecorator; - /** - * Gets an {@link yfiles.graph.GraphDecorator#edgeDecorator} instance that can be used to decorate the {@link yfiles.graph.IEdge} instances in the graph that this decorator has - * been created for. - *

- * This will obtain the {@link yfiles.graph.ILookupDecorator} instance from the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup} - * method and use it to initialize the {@link yfiles.graph.EdgeDecorator} - *

- * @type {yfiles.graph.EdgeDecorator} - */ - edgeDecorator:yfiles.graph.EdgeDecorator; - /** - * Gets a {@link yfiles.graph.GraphDecorator#labelDecorator} instance that can be used to decorate the {@link yfiles.graph.ILabel} instances in the graph that this decorator has - * been created for. - *

- * This will obtain the {@link yfiles.graph.ILookupDecorator} instance from the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup} - * method and use it to initialize the {@link yfiles.graph.LabelDecorator} - *

- * @type {yfiles.graph.LabelDecorator} - */ - labelDecorator:yfiles.graph.LabelDecorator; - /** - * Gets a {@link yfiles.graph.GraphDecorator#portDecorator} instance that can be used to decorate the {@link yfiles.graph.IPort} instances in the graph that this decorator has been - * created for. - *

- * This will obtain the {@link yfiles.graph.ILookupDecorator} instance from the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup} - * method and use it to initialize the {@link yfiles.graph.PortDecorator} - *

- * @type {yfiles.graph.PortDecorator} - */ - portDecorator:yfiles.graph.PortDecorator; - /** - * Gets a {@link yfiles.graph.GraphDecorator#bendDecorator} instance that can be used to decorate the {@link yfiles.graph.IBend} instances in the graph that this decorator has been - * created for. - *

- * This will obtain the {@link yfiles.graph.ILookupDecorator} instance from the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup} - * method and use it to initialize the {@link yfiles.graph.BendDecorator} - *

- * @type {yfiles.graph.BendDecorator} - */ - bendDecorator:yfiles.graph.BendDecorator; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.GraphDecorator; - } - /** - * A utility class that helps in {@link yfiles.graph.ILookupDecorator#addLookup decorating} the {@link yfiles.graph.ILookup#lookup} method of {@link yfiles.graph.ILabel} instances that - * are contained in an {@link yfiles.graph.IGraph} which are managed by an {@link yfiles.graph.ILookupDecorator}. - *

- * This decorator can be used to conveniently {@link yfiles.graph.ILookupDecorator decorate the lookup} of {@link yfiles.graph.ILabel}s in an {@link yfiles.graph.IGraph}. It - * serves as a factory for predefined {@link yfiles.graph.LookupDecorator.} instances that are specifically useful for the {@link yfiles.graph.ILabel} type. Note that - * the list of possible decorations that are available using this class is not exhaustive in any way. This is merely a way - * to provide access to those interfaces that are more commonly being decorated by the developer. - *

- * @see yfiles.graph.GraphDecorator - * @see yfiles.graph.LookupDecorator. - * @class - * @final - */ - export interface LabelDecorator extends yfiles.lang.Object{} - export class LabelDecorator { - /** - * Initializes a new instance of the {@link yfiles.graph.LabelDecorator} class. - * @param decorator The decorator to use, which can be null. - */ - constructor(decorator:yfiles.graph.ILookupDecorator); - /** - * Creates a {@link yfiles.graph.LookupDecorator.} for {@link yfiles.graph.ILabel}s that can be used to decorate TInterface types of the labels. - * Type parameter TInterface: The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. - * @param type The type of the interface that should be decorated of the instances' {@link #lookup}. - * @param [decorateNulls=true] if set to true null values will be decorated, otherwise not. - * @param [nullIsFallback=false] if set to true null values will be treated as fallback values, otherwise they will be used as the final result. - * @returns A new {@link } for the specified interface. - * @template TInterface - */ - getDecoratorFor(type:yfiles.lang.Class,decorateNulls?:boolean,nullIsFallback?:boolean):yfiles.graph.LookupDecorator; - /** - * Creates a {@link yfiles.graph.LookupDecorator.} for {@link yfiles.graph.ILabel}s that can be used to decorate TInterface types of the labels. - * Type parameter TInterface: The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. - * @param {Object} options The parameters to pass. - * @param options.type The type of the interface that should be decorated of the instances' {@link #lookup}. - * @param [options.decorateNulls=true] if set to true null values will be decorated, otherwise not. - * @param [options.nullIsFallback=false] if set to true null values will be treated as fallback values, otherwise they will be used as the final result. - * @returns A new {@link } for the specified interface. - * @template TInterface - */ - getDecoratorFor(options:{type:yfiles.lang.Class,decorateNulls?:boolean,nullIsFallback?:boolean}):yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IPositionHandler} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.input.IPositionHandler} implementations can be used to restrict or enhance the way the user moves elements - * interactively in the editor. This interface is mainly used by the {@link yfiles.input.MoveInputMode}. This is a convenient - * alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s - * {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - positionHandlerDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.graph.IClipboardHelper} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.graph.IClipboardHelper} implementations can be used to customize the way the clipboard operations are - * performed by {@link yfiles.graph.GraphClipboard}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - clipboardHelperDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IMarqueeTestable} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.input.IMarqueeTestable} implementations can be used to change the way tests for marquee inclusions are - * performed on the items in the editor. This interface is mainly used by the {@link yfiles.input.GraphEditorInputMode}. This is a - * convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the - * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - marqueeTestableDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.graph.IMementoSupport} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.graph.IMementoSupport} implementations can be used to make the {@link yfiles.graph.UndoEngine} aware of changes to - * data that is associated with the model items. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - mementoSupportDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.ISelectionIndicatorInstaller} type for the type of items this instance has been - * created for. - *

- * Custom {@link yfiles.view.ISelectionIndicatorInstaller} implementations can be used change the way the selection of an item is - * represented in a {@link yfiles.view.CanvasComponent}. This interface is mainly used by the {@link yfiles.view.SelectionIndicatorManager.} in the {@link yfiles.view.GraphComponent}. - * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the - * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - selectionDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IHighlightIndicatorInstaller} type for the type of items this instance has been - * created for. - *

- * Custom {@link yfiles.view.IHighlightIndicatorInstaller} implementations can be used change the way the highlighting of an item - * is represented in a {@link yfiles.view.CanvasComponent}. This interface is mainly used by the {@link yfiles.view.HighlightIndicatorManager.} in the - * {@link yfiles.view.GraphComponent}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - highlightDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IFocusIndicatorInstaller} type for the type of items this instance has been - * created for. - *

- * Custom {@link yfiles.view.IFocusIndicatorInstaller} implementations can be used change the way the focus of an item is - * represented in a {@link yfiles.view.GraphComponent}. This interface is mainly used by the {@link yfiles.view.FocusIndicatorManager.} in the {@link yfiles.view.GraphComponent}. - * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the - * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - focusIndicatorDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IHandleProvider} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.input.IHandleProvider} implementations provide interactive draggable handles for the user to change the - * geometry or other aspects of items in the {@link yfiles.view.GraphComponent}. This interface is mainly used by the {@link yfiles.input.HandleInputMode} - * in the {@link yfiles.input.GraphEditorInputMode}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - handleProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IObstacleProvider} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.view.IObstacleProvider} implementations provide information about obstacles that will be considered by {@link yfiles.view.GraphObstacleProvider} - * which itself serves as a provider for geometric obstacles to {@link yfiles.view.BridgeManager} that manages the rendering of - * bridges in edge paths. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is - * provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @see yfiles.view.GraphObstacleProvider - * @see yfiles.view.BridgeManager - * @type {yfiles.graph.LookupDecorator.} - */ - obstacleProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.graph.ILabelModelParameterFinder} type for the - * {@link yfiles.graph.ILabel}s of the graph this instance has been created for. - *

- * Custom {@link yfiles.graph.ILabelModelParameterFinder} implementations can be used change the way {@link yfiles.graph.ILabel}s can be - * dragged interactively by the user. It helps in determining the right {@link yfiles.graph.ILabelModelParameter} for a given - * location that has been chosen by the user. This interface is mainly used by the {@link yfiles.input.LabelPositionHandler} in the - * {@link yfiles.view.GraphComponent}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - labelModelParameterFinderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IEditLabelHelper} type for the - * {@link yfiles.graph.ILabel}s this instance has been created for. - *

- * Custom {@link yfiles.input.IEditLabelHelper} implementations can be used to change or customize interactive label editing. This - * interface is mainly used by the {@link yfiles.input.GraphEditorInputMode} which uses the callbacks from the implementation to - * determine whether the label can be edited, as well as to customize the {@link yfiles.input.TextEditorInputMode} appearance for - * the upcoming edit. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is - * provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - editLabelHelperDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.graph.ILabelModelParameterProvider} type for the - * {@link yfiles.graph.ILabel}s of the graph this instance has been created for. - *

- * Custom {@link yfiles.graph.ILabelModelParameterProvider} implementations can be used to change the set of possible - * {@link yfiles.graph.ILabelModelParameter}s that the user can assign to a label interactively by dragging it in a - * {@link yfiles.view.GraphComponent}. This interface is mainly used by the {@link yfiles.input.LabelPositionHandler} and {@link yfiles.input.MoveLabelInputMode} - * in the {@link yfiles.view.GraphComponent}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - labelModelParameterProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.ILabelSnapContextHelper} for the - * {@link yfiles.graph.ILabel}s this instance has been created for. - *

- * Custom {@link yfiles.input.ILabelSnapContextHelper} implementations can be used to provide custom {@link yfiles.input.SnapLine snap lines} and {@link yfiles.input.SnapResult snap results} - * based on the {@link yfiles.graph.ILabel}s this instance has been created for. This interface is mainly used by the label's {@link yfiles.input.IPositionHandler} - * to collect snap results during a drag gesture for the label. This is a convenient alternative to the direct usage of the - * {@link yfiles.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - labelSnapContextHelperDecorator:yfiles.graph.LookupDecorator; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.LabelDecorator; - } - /** - * A utility class that helps in {@link yfiles.graph.ILookupDecorator#addLookup decorating} the {@link yfiles.graph.ILookup#lookup} method of {@link yfiles.graph.IEdge} instances that are - * contained in an {@link yfiles.graph.IGraph} which are managed by an {@link yfiles.graph.ILookupDecorator}. - *

- * This decorator can be used to conveniently {@link yfiles.graph.ILookupDecorator decorate the lookup} of {@link yfiles.graph.IEdge}s in an {@link yfiles.graph.IGraph}. It - * serves as a factory for predefined {@link yfiles.graph.LookupDecorator.} instances that are specifically useful for the {@link yfiles.graph.IEdge} type. Note that - * the list of possible decorations that are available using this class is not exhaustive in any way. This is merely a way - * to provide access to those interfaces that are more commonly being decorated by the developer. - *

- * @see yfiles.graph.GraphDecorator - * @see yfiles.graph.LookupDecorator. - * @class - * @final - */ - export interface EdgeDecorator extends yfiles.lang.Object{} - export class EdgeDecorator { - /** - * Initializes a new instance of the {@link yfiles.graph.EdgeDecorator} class. - * @param decorator The decorator to use, which can be null. - */ - constructor(decorator:yfiles.graph.ILookupDecorator); - /** - * Creates a {@link yfiles.graph.LookupDecorator.} for {@link yfiles.graph.IEdge}s that can be used to decorate TInterface types of the edges. - * Type parameter TInterface: The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. - * @param type The type of the interface that should be decorated of the instances' {@link #lookup}. - * @param [decorateNulls=true] if set to true null values will be decorated, otherwise not. - * @param [nullIsFallback=false] if set to true null values will be treated as fallback values, otherwise they will be used as the final result. - * @returns A new {@link } for the specified interface. - * @template TInterface - */ - getDecoratorFor(type:yfiles.lang.Class,decorateNulls?:boolean,nullIsFallback?:boolean):yfiles.graph.LookupDecorator; - /** - * Creates a {@link yfiles.graph.LookupDecorator.} for {@link yfiles.graph.IEdge}s that can be used to decorate TInterface types of the edges. - * Type parameter TInterface: The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. - * @param {Object} options The parameters to pass. - * @param options.type The type of the interface that should be decorated of the instances' {@link #lookup}. - * @param [options.decorateNulls=true] if set to true null values will be decorated, otherwise not. - * @param [options.nullIsFallback=false] if set to true null values will be treated as fallback values, otherwise they will be used as the final result. - * @returns A new {@link } for the specified interface. - * @template TInterface - */ - getDecoratorFor(options:{type:yfiles.lang.Class,decorateNulls?:boolean,nullIsFallback?:boolean}):yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IEdgeReconnectionPortCandidateProvider} type for the - * {@link yfiles.graph.IEdge}s of the graph this instance has been created for. - *

- * Custom {@link yfiles.input.IEdgeReconnectionPortCandidateProvider} implementations can be used to change the set of possible - * {@link yfiles.input.IPortCandidate}s that are available for an existing edge in the {@link yfiles.graph.IGraph} if the user - * interactively tries to {@link yfiles.graph.IGraph#setEdgePorts change the ports} of an {@link yfiles.graph.IEdge} in a {@link yfiles.view.GraphComponent}. This interface is - * mainly used by the {@link yfiles.input.PortRelocationHandle}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - edgeReconnectionPortCandidateProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IPortCandidateProvider} for the - * {@link yfiles.graph.IEdge}s this instance has been created for. - *

- * Custom {@link yfiles.input.IPortCandidateProvider} implementations can be used to present the user with a set of - * {@link yfiles.input.IPortCandidate}s that newly created edges can use as their {@link yfiles.graph.IEdge#sourcePort source} and {@link yfiles.graph.IEdge#targetPort target} {@link yfiles.graph.IPort}s. This - * interface is mainly used by the {@link yfiles.input.CreateEdgeInputMode} mode of {@link yfiles.input.GraphEditorInputMode} if {@link yfiles.input.CreateEdgeInputMode#allowEdgeToEdgeConnections} is - * enabled. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by - * the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - portCandidateProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IEdgePortHandleProvider} type for the type of items this instance has been - * created for. - *

- * Custom {@link yfiles.input.IEdgePortHandleProvider} implementations can be used provide interactive draggable handles for the - * source and target end points of an edge. This interface is mainly used by the {@link yfiles.input.HandleInputMode} in the {@link yfiles.input.GraphEditorInputMode} - * and by the implementations that work with {@link yfiles.input.OrthogonalEdgeEditingContext}. Implementations may decide, e.g. - * whether to yield {@link yfiles.input.IHandle} implementations that either move the edge to another port(-{@link yfiles.input.IPortCandidate candidate}) using {@link yfiles.graph.IGraph#setEdgePorts} - * or whether to move the port the edge is currently connected to itself, instead. This is a convenient alternative to the - * direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s - * {@link yfiles.graph.ILookup#lookup}. - *

- * @see yfiles.input.PortRelocationHandle - * @see yfiles.input.IHandle - * @see yfiles.input.IHandleProvider - * @see yfiles.input.OrthogonalEdgeEditingContext - * @type {yfiles.graph.LookupDecorator.} - */ - edgePortHandleProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IOrthogonalEdgeHelper} type for the - * {@link yfiles.graph.IEdge}s of the graph this instance has been created for. - *

- * Custom {@link yfiles.input.IOrthogonalEdgeHelper} implementations can be used to change the orthogonal edge editing behavior in - * the context of {@link yfiles.input.OrthogonalEdgeEditingContext}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - orthogonalEdgeHelperDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IEdgeSnapResultProvider} type for the - * {@link yfiles.graph.IEdge}s of the graph this instance has been created for. - *

- * Custom {@link yfiles.input.IEdgeSnapResultProvider} implementations can be used to change the snapping behavior of edges while - * they are being moved in the context of a {@link yfiles.input.GraphSnapContext}. This is a convenient alternative to the direct - * usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - edgeSnapResultProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IEditLabelHelper} type for the - * {@link yfiles.graph.IEdge}s this instance has been created for. - *

- * Custom {@link yfiles.input.IEditLabelHelper} implementations can be used to change or customize interactive label editing and - * label creation. This interface is mainly used by the {@link yfiles.input.GraphEditorInputMode} which uses the callbacks from the - * implementation to determine the label to add or edit, as well as to customize the {@link yfiles.input.TextEditorInputMode} - * appearance for the upcoming edit. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - editLabelHelperDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IBendCreator} type for the - * {@link yfiles.graph.IEdge}s of the graph this instance has been created for. - *

- * Custom {@link yfiles.input.IBendCreator} implementations can be used to influence the interactive creation of new - * {@link yfiles.graph.IBend}s. This interface is mainly used by the {@link yfiles.input.CreateBendInputMode} in - * {@link yfiles.input.GraphEditorInputMode}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - bendCreatorDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IBendSelectionTester} type for the - * {@link yfiles.graph.IEdge}s of the graph this instance has been created for. - *

- * Custom {@link yfiles.input.IBendSelectionTester} implementations can be used to influence hit test behavior for bends on edges. - * This interface is mainly used by the {@link yfiles.input.GraphEditorInputMode} and {@link yfiles.input.CreateBendInputMode} to determine - * whether an existing bend has been hit. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - bendSelectionTesterDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.ISnapLineProvider} for the - * {@link yfiles.graph.IEdge}s this instance has been created for. - *

- * Custom {@link yfiles.input.ISnapLineProvider} implementations can be used to provide custom {@link yfiles.input.OrthogonalSnapLine}s - * based on the {@link yfiles.graph.IEdge}s this instance has been created for. This could e.g. be a horizontal {@link yfiles.input.OrthogonalSnapLine} - * vertically centered between two horizontal segments of one of these edges. This interface is mainly used by the {@link yfiles.input.GraphSnapContext} - * to collect all available {@link yfiles.input.OrthogonalSnapLine}s of orthogonal edge segments. This is a convenient alternative - * to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s - * {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - snapLineProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IPositionHandler} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.input.IPositionHandler} implementations can be used to restrict or enhance the way the user moves elements - * interactively in the editor. This interface is mainly used by the {@link yfiles.input.MoveInputMode}. This is a convenient - * alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s - * {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - positionHandlerDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.graph.IClipboardHelper} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.graph.IClipboardHelper} implementations can be used to customize the way the clipboard operations are - * performed by {@link yfiles.graph.GraphClipboard}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - clipboardHelperDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IMarqueeTestable} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.input.IMarqueeTestable} implementations can be used to change the way tests for marquee inclusions are - * performed on the items in the editor. This interface is mainly used by the {@link yfiles.input.GraphEditorInputMode}. This is a - * convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the - * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - marqueeTestableDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.graph.IMementoSupport} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.graph.IMementoSupport} implementations can be used to make the {@link yfiles.graph.UndoEngine} aware of changes to - * data that is associated with the model items. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - mementoSupportDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.ISelectionIndicatorInstaller} type for the type of items this instance has been - * created for. - *

- * Custom {@link yfiles.view.ISelectionIndicatorInstaller} implementations can be used change the way the selection of an item is - * represented in a {@link yfiles.view.CanvasComponent}. This interface is mainly used by the {@link yfiles.view.SelectionIndicatorManager.} in the {@link yfiles.view.GraphComponent}. - * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the - * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - selectionDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IHighlightIndicatorInstaller} type for the type of items this instance has been - * created for. - *

- * Custom {@link yfiles.view.IHighlightIndicatorInstaller} implementations can be used change the way the highlighting of an item - * is represented in a {@link yfiles.view.CanvasComponent}. This interface is mainly used by the {@link yfiles.view.HighlightIndicatorManager.} in the - * {@link yfiles.view.GraphComponent}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - highlightDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IFocusIndicatorInstaller} type for the type of items this instance has been - * created for. - *

- * Custom {@link yfiles.view.IFocusIndicatorInstaller} implementations can be used change the way the focus of an item is - * represented in a {@link yfiles.view.GraphComponent}. This interface is mainly used by the {@link yfiles.view.FocusIndicatorManager.} in the {@link yfiles.view.GraphComponent}. - * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the - * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - focusIndicatorDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IHandleProvider} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.input.IHandleProvider} implementations provide interactive draggable handles for the user to change the - * geometry or other aspects of items in the {@link yfiles.view.GraphComponent}. This interface is mainly used by the {@link yfiles.input.HandleInputMode} - * in the {@link yfiles.input.GraphEditorInputMode}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - handleProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IObstacleProvider} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.view.IObstacleProvider} implementations provide information about obstacles that will be considered by {@link yfiles.view.GraphObstacleProvider} - * which itself serves as a provider for geometric obstacles to {@link yfiles.view.BridgeManager} that manages the rendering of - * bridges in edge paths. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is - * provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @see yfiles.view.GraphObstacleProvider - * @see yfiles.view.BridgeManager - * @type {yfiles.graph.LookupDecorator.} - */ - obstacleProviderDecorator:yfiles.graph.LookupDecorator; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.EdgeDecorator; - } - /** - * A utility class that helps in {@link yfiles.graph.ILookupDecorator#addLookup decorating} the {@link yfiles.graph.ILookup#lookup} method of {@link yfiles.graph.IBend} instances that are - * contained in an {@link yfiles.graph.IGraph} which are managed by an {@link yfiles.graph.ILookupDecorator}. - *

- * This decorator can be used to conveniently {@link yfiles.graph.ILookupDecorator decorate the lookup} of {@link yfiles.graph.IBend}s in an {@link yfiles.graph.IGraph}. It - * serves as a factory for predefined {@link yfiles.graph.LookupDecorator.} instances that are specifically useful for the {@link yfiles.graph.IBend} type. Note that - * the list of possible decorations that are available using this class is not exhaustive in any way. This is merely a way - * to provide access to those interfaces that are more commonly being decorated by the developer. - *

- * @see yfiles.graph.GraphDecorator - * @see yfiles.graph.LookupDecorator. - * @class - * @final - */ - export interface BendDecorator extends yfiles.lang.Object{} - export class BendDecorator { - /** - * Initializes a new instance of the {@link yfiles.graph.BendDecorator} class. - * @param decorator The decorator to use, which can be null. - */ - constructor(decorator:yfiles.graph.ILookupDecorator); - /** - * Creates a {@link yfiles.graph.LookupDecorator.} for {@link yfiles.graph.IBend}s that can be used to decorate TInterface types of the bends. - * Type parameter TInterface: The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. - * @param type The type of the interface that should be decorated of the instances' {@link #lookup}. - * @param [decorateNulls=true] if set to true null values will be decorated, otherwise not. - * @param [nullIsFallback=false] if set to true null values will be treated as fallback values, otherwise they will be used as the final result. - * @returns A new {@link } for the specified interface. - * @template TInterface - */ - getDecoratorFor(type:yfiles.lang.Class,decorateNulls?:boolean,nullIsFallback?:boolean):yfiles.graph.LookupDecorator; - /** - * Creates a {@link yfiles.graph.LookupDecorator.} for {@link yfiles.graph.IBend}s that can be used to decorate TInterface types of the bends. - * Type parameter TInterface: The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. - * @param {Object} options The parameters to pass. - * @param options.type The type of the interface that should be decorated of the instances' {@link #lookup}. - * @param [options.decorateNulls=true] if set to true null values will be decorated, otherwise not. - * @param [options.nullIsFallback=false] if set to true null values will be treated as fallback values, otherwise they will be used as the final result. - * @returns A new {@link } for the specified interface. - * @template TInterface - */ - getDecoratorFor(options:{type:yfiles.lang.Class,decorateNulls?:boolean,nullIsFallback?:boolean}):yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IHandle} type for the - * {@link yfiles.graph.IBend}s of the graph this instance has been created for. - *

- * Custom {@link yfiles.input.IHandle} implementations can be used to change the way the user can drag a bend interactively to - * change its position in a {@link yfiles.view.GraphComponent}. This interface is mainly used by the {@link yfiles.input.HandleInputMode} - * in {@link yfiles.input.GraphEditorInputMode}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - handleDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IBendSnapResultProvider} for the - * {@link yfiles.graph.IBend}s this instance has been created for. - *

- * Custom {@link yfiles.input.IBendSnapResultProvider} implementations can be used to provide custom {@link yfiles.input.SnapResult}s based - * on the {@link yfiles.graph.IBend}s this instance has been created for. This could e.g. be a {@link yfiles.input.SnapResult} describing - * that the bend wants to snap vertically to the top border of a node. This interface is mainly used by the default {@link yfiles.input.IHandle} - * for {@link yfiles.graph.IBend}s to collect {@link yfiles.input.SnapResult}s during a drag gesture for the bend. This is a convenient - * alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s - * {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - bendSnapResultProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IPositionHandler} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.input.IPositionHandler} implementations can be used to restrict or enhance the way the user moves elements - * interactively in the editor. This interface is mainly used by the {@link yfiles.input.MoveInputMode}. This is a convenient - * alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s - * {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - positionHandlerDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.graph.IClipboardHelper} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.graph.IClipboardHelper} implementations can be used to customize the way the clipboard operations are - * performed by {@link yfiles.graph.GraphClipboard}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - clipboardHelperDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IMarqueeTestable} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.input.IMarqueeTestable} implementations can be used to change the way tests for marquee inclusions are - * performed on the items in the editor. This interface is mainly used by the {@link yfiles.input.GraphEditorInputMode}. This is a - * convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the - * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - marqueeTestableDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.graph.IMementoSupport} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.graph.IMementoSupport} implementations can be used to make the {@link yfiles.graph.UndoEngine} aware of changes to - * data that is associated with the model items. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - mementoSupportDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.ISelectionIndicatorInstaller} type for the type of items this instance has been - * created for. - *

- * Custom {@link yfiles.view.ISelectionIndicatorInstaller} implementations can be used change the way the selection of an item is - * represented in a {@link yfiles.view.CanvasComponent}. This interface is mainly used by the {@link yfiles.view.SelectionIndicatorManager.} in the {@link yfiles.view.GraphComponent}. - * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the - * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - selectionDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IHighlightIndicatorInstaller} type for the type of items this instance has been - * created for. - *

- * Custom {@link yfiles.view.IHighlightIndicatorInstaller} implementations can be used change the way the highlighting of an item - * is represented in a {@link yfiles.view.CanvasComponent}. This interface is mainly used by the {@link yfiles.view.HighlightIndicatorManager.} in the - * {@link yfiles.view.GraphComponent}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - highlightDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IFocusIndicatorInstaller} type for the type of items this instance has been - * created for. - *

- * Custom {@link yfiles.view.IFocusIndicatorInstaller} implementations can be used change the way the focus of an item is - * represented in a {@link yfiles.view.GraphComponent}. This interface is mainly used by the {@link yfiles.view.FocusIndicatorManager.} in the {@link yfiles.view.GraphComponent}. - * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the - * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - focusIndicatorDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IHandleProvider} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.input.IHandleProvider} implementations provide interactive draggable handles for the user to change the - * geometry or other aspects of items in the {@link yfiles.view.GraphComponent}. This interface is mainly used by the {@link yfiles.input.HandleInputMode} - * in the {@link yfiles.input.GraphEditorInputMode}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - handleProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IObstacleProvider} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.view.IObstacleProvider} implementations provide information about obstacles that will be considered by {@link yfiles.view.GraphObstacleProvider} - * which itself serves as a provider for geometric obstacles to {@link yfiles.view.BridgeManager} that manages the rendering of - * bridges in edge paths. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is - * provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @see yfiles.view.GraphObstacleProvider - * @see yfiles.view.BridgeManager - * @type {yfiles.graph.LookupDecorator.} - */ - obstacleProviderDecorator:yfiles.graph.LookupDecorator; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.BendDecorator; - } - /** - * A utility class that helps in {@link yfiles.graph.ILookupDecorator#addLookup decorating} the {@link yfiles.graph.ILookup#lookup} method of {@link yfiles.graph.IPort} instances that are - * contained in an {@link yfiles.graph.IGraph} which are managed by an {@link yfiles.graph.ILookupDecorator}. - *

- * This decorator can be used to conveniently {@link yfiles.graph.ILookupDecorator decorate the lookup} of {@link yfiles.graph.IPort}s in an {@link yfiles.graph.IGraph}. It - * serves as a factory for predefined {@link yfiles.graph.LookupDecorator.} instances that are specifically useful for the {@link yfiles.graph.IPort} type. Note that - * the list of possible decorations that are available using this class is not exhaustive in any way. This is merely a way - * to provide access to those interfaces that are more commonly being decorated by the developer. - *

- * @see yfiles.graph.GraphDecorator - * @see yfiles.graph.LookupDecorator. - * @class - * @final - */ - export interface PortDecorator extends yfiles.lang.Object{} - export class PortDecorator { - /** - * Initializes a new instance of the {@link yfiles.graph.PortDecorator} class. - * @param decorator The decorator to use, which can be null. - */ - constructor(decorator:yfiles.graph.ILookupDecorator); - /** - * Creates a {@link yfiles.graph.LookupDecorator.} for {@link yfiles.graph.IPort}s that can be used to decorate TInterface types of the ports. - * Type parameter TInterface: The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. - * @param type The type of the interface that should be decorated of the instances' {@link #lookup}. - * @param [decorateNulls=true] if set to true null values will be decorated, otherwise not. - * @param [nullIsFallback=false] if set to true null values will be treated as fallback values, otherwise they will be used as the final result. - * @returns A new {@link } for the specified interface. - * @template TInterface - */ - getDecoratorFor(type:yfiles.lang.Class,decorateNulls?:boolean,nullIsFallback?:boolean):yfiles.graph.LookupDecorator; - /** - * Creates a {@link yfiles.graph.LookupDecorator.} for {@link yfiles.graph.IPort}s that can be used to decorate TInterface types of the ports. - * Type parameter TInterface: The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. - * @param {Object} options The parameters to pass. - * @param options.type The type of the interface that should be decorated of the instances' {@link #lookup}. - * @param [options.decorateNulls=true] if set to true null values will be decorated, otherwise not. - * @param [options.nullIsFallback=false] if set to true null values will be treated as fallback values, otherwise they will be used as the final result. - * @returns A new {@link } for the specified interface. - * @template TInterface - */ - getDecoratorFor(options:{type:yfiles.lang.Class,decorateNulls?:boolean,nullIsFallback?:boolean}):yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IHandle} type for the - * {@link yfiles.graph.IPort}s of the graph this instance has been created for. - *

- * Custom {@link yfiles.input.IHandle} implementations can be used to change the way the user can drag a port interactively to - * change its position in a {@link yfiles.view.GraphComponent}. This interface is mainly used by the {@link yfiles.input.HandleInputMode} - * in {@link yfiles.input.GraphEditorInputMode} which obtains the {@link yfiles.input.IHandle} from the {@link yfiles.graph.IPort} by querying the - * {@link yfiles.input.IHandleProvider} from it, which in turn will query the {@link yfiles.input.IHandle} from itself. Alternatively, - * selected nodes can put the {@link yfiles.input.IHandle} of their ports into their {@link yfiles.input.IHandleProvider} implementation. - * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the - * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - handleDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.styles.IEdgePathCropper} type for the - * {@link yfiles.graph.IPort}s of the graph this instance has been created for. - *

- * Custom {@link yfiles.styles.IEdgePathCropper} implementations can be used to change the way the path of {@link yfiles.styles.PathBasedEdgeStyleRenderer.} implementations - * calculate the {@link yfiles.geometry.GeneralPath} of the visual representation of an {@link yfiles.graph.IEdge} in a - * {@link yfiles.view.GraphComponent}. This interface is mainly used by the {@link yfiles.styles.PathBasedEdgeStyleRenderer.} to find the intersection of an edge with the bounds of - * the adjacent node to properly crop the edge path. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - edgePathCropperDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.ISnapLineProvider} for the - * {@link yfiles.graph.IPort}s this instance has been created for. - *

- * Custom {@link yfiles.input.ISnapLineProvider} implementations can be used to provide custom {@link yfiles.input.OrthogonalSnapLine}s - * based on the {@link yfiles.graph.IPort}s this instance has been created for. This could e.g. be a {@link yfiles.input.OrthogonalSnapLine} - * with a horizontal or vertical offset to the port's location. This interface is mainly used by the {@link yfiles.input.GraphSnapContext} - * to collect all available {@link yfiles.input.OrthogonalSnapLine}s. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - snapLineProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IPortSnapResultProvider} for the - * {@link yfiles.graph.IPort}s this instance has been created for. - *

- * Custom {@link yfiles.input.IPortSnapResultProvider} implementations can be used to provide custom {@link yfiles.input.SnapResult}s based - * on the {@link yfiles.graph.IPort}s this instance has been created for. This could e.g. be a {@link yfiles.input.SnapResult} describing - * that the port wants to snap to a grid point. This interface is mainly used by the {@link yfiles.input.PortLocationModelParameterHandle} - * to collect {@link yfiles.input.SnapResult}s during a drag gesture for the port. This is a convenient alternative to the direct - * usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - portSnapResultProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IPositionHandler} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.input.IPositionHandler} implementations can be used to restrict or enhance the way the user moves elements - * interactively in the editor. This interface is mainly used by the {@link yfiles.input.MoveInputMode}. This is a convenient - * alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s - * {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - positionHandlerDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.graph.IClipboardHelper} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.graph.IClipboardHelper} implementations can be used to customize the way the clipboard operations are - * performed by {@link yfiles.graph.GraphClipboard}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - clipboardHelperDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IMarqueeTestable} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.input.IMarqueeTestable} implementations can be used to change the way tests for marquee inclusions are - * performed on the items in the editor. This interface is mainly used by the {@link yfiles.input.GraphEditorInputMode}. This is a - * convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the - * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - marqueeTestableDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.graph.IMementoSupport} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.graph.IMementoSupport} implementations can be used to make the {@link yfiles.graph.UndoEngine} aware of changes to - * data that is associated with the model items. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - mementoSupportDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.ISelectionIndicatorInstaller} type for the type of items this instance has been - * created for. - *

- * Custom {@link yfiles.view.ISelectionIndicatorInstaller} implementations can be used change the way the selection of an item is - * represented in a {@link yfiles.view.CanvasComponent}. This interface is mainly used by the {@link yfiles.view.SelectionIndicatorManager.} in the {@link yfiles.view.GraphComponent}. - * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the - * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - selectionDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IHighlightIndicatorInstaller} type for the type of items this instance has been - * created for. - *

- * Custom {@link yfiles.view.IHighlightIndicatorInstaller} implementations can be used change the way the highlighting of an item - * is represented in a {@link yfiles.view.CanvasComponent}. This interface is mainly used by the {@link yfiles.view.HighlightIndicatorManager.} in the - * {@link yfiles.view.GraphComponent}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - highlightDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IFocusIndicatorInstaller} type for the type of items this instance has been - * created for. - *

- * Custom {@link yfiles.view.IFocusIndicatorInstaller} implementations can be used change the way the focus of an item is - * represented in a {@link yfiles.view.GraphComponent}. This interface is mainly used by the {@link yfiles.view.FocusIndicatorManager.} in the {@link yfiles.view.GraphComponent}. - * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the - * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - focusIndicatorDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IHandleProvider} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.input.IHandleProvider} implementations provide interactive draggable handles for the user to change the - * geometry or other aspects of items in the {@link yfiles.view.GraphComponent}. This interface is mainly used by the {@link yfiles.input.HandleInputMode} - * in the {@link yfiles.input.GraphEditorInputMode}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - handleProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IObstacleProvider} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.view.IObstacleProvider} implementations provide information about obstacles that will be considered by {@link yfiles.view.GraphObstacleProvider} - * which itself serves as a provider for geometric obstacles to {@link yfiles.view.BridgeManager} that manages the rendering of - * bridges in edge paths. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is - * provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @see yfiles.view.GraphObstacleProvider - * @see yfiles.view.BridgeManager - * @type {yfiles.graph.LookupDecorator.} - */ - obstacleProviderDecorator:yfiles.graph.LookupDecorator; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.PortDecorator; - } - /** - * A utility class that helps in {@link yfiles.graph.ILookupDecorator#addLookup decorating} the {@link yfiles.graph.ILookup#lookup} method of {@link yfiles.graph.INode} instances that are - * contained in an {@link yfiles.graph.IGraph} which are managed by an {@link yfiles.graph.ILookupDecorator}. - *

- * This decorator can be used to conveniently {@link yfiles.graph.ILookupDecorator decorate the lookup} of {@link yfiles.graph.INode}s in an {@link yfiles.graph.IGraph}. It - * serves as a factory for predefined {@link yfiles.graph.LookupDecorator.} instances that are specifically useful for the {@link yfiles.graph.INode} type. Note that - * the list of possible decorations that are available using this class is not exhaustive in any way. This is merely a way - * to provide access to those interfaces that are more commonly being decorated by the developer. - *

- * @see yfiles.graph.GraphDecorator - * @see yfiles.graph.LookupDecorator. - * @class - * @final - */ - export interface NodeDecorator extends yfiles.lang.Object{} - export class NodeDecorator { - /** - * Initializes a new instance of the {@link yfiles.graph.NodeDecorator} class. - * @param decorator The decorator to use, which can be null. - */ - constructor(decorator:yfiles.graph.ILookupDecorator); - /** - * Creates a {@link yfiles.graph.LookupDecorator.} for {@link yfiles.graph.INode}s that can be used to decorate TInterface types of the nodes. - * Type parameter TInterface: The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. - * @param type The type of the interface that should be decorated of the instances' {@link #lookup}. - * @param [decorateNulls=true] if set to true null values will be decorated, otherwise not. - * @param [nullIsFallback=false] if set to true null values will be treated as fallback values, otherwise they will be used as the final result. - * @returns A new {@link } for the specified interface. - * @template TInterface - */ - getDecoratorFor(type:yfiles.lang.Class,decorateNulls?:boolean,nullIsFallback?:boolean):yfiles.graph.LookupDecorator; - /** - * Creates a {@link yfiles.graph.LookupDecorator.} for {@link yfiles.graph.INode}s that can be used to decorate TInterface types of the nodes. - * Type parameter TInterface: The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. - * @param {Object} options The parameters to pass. - * @param options.type The type of the interface that should be decorated of the instances' {@link #lookup}. - * @param [options.decorateNulls=true] if set to true null values will be decorated, otherwise not. - * @param [options.nullIsFallback=false] if set to true null values will be treated as fallback values, otherwise they will be used as the final result. - * @returns A new {@link } for the specified interface. - * @template TInterface - */ - getDecoratorFor(options:{type:yfiles.lang.Class,decorateNulls?:boolean,nullIsFallback?:boolean}):yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IReshapeHandleProvider} type for the - * {@link yfiles.graph.INode}s this instance has been created for. - *

- * Custom {@link yfiles.input.IReshapeHandleProvider} implementations can be used to change the number and type of - * {@link yfiles.input.IHandle}s that can be used by the user to reshape the {@link yfiles.graph.INode}s in interactively in the editor. - * This interface is mainly used by the {@link yfiles.input.GraphEditorInputMode} which passes the {@link yfiles.input.IHandle}s to the - * {@link yfiles.input.HandleInputMode}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - reshapeHandleProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IEditLabelHelper} type for the - * {@link yfiles.graph.INode}s this instance has been created for. - *

- * Custom {@link yfiles.input.IEditLabelHelper} implementations can be used to change or customize interactive label editing and - * label creation. This interface is mainly used by the {@link yfiles.input.GraphEditorInputMode} which uses the callbacks from the - * implementation to determine the label to add or edit, as well as to customize the {@link yfiles.input.TextEditorInputMode} - * appearance for the upcoming edit. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - editLabelHelperDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.styles.IShapeGeometry} type for the type - * {@link yfiles.graph.INode}s this instance has been created for. - *

- * Custom {@link yfiles.styles.IShapeGeometry} implementations can be used to change the way different code parts interpret the {@link yfiles.graph.INode#layout} of - * an {@link yfiles.graph.INode}. This interface is mainly used by the {@link yfiles.styles.DefaultEdgePathCropper}, and a custom {@link yfiles.input.IPortCandidateProvider} - * that can be obtained from {@link yfiles.input.IPortCandidateProvider#fromShapeGeometry}. Note that decorating the {@link yfiles.styles.IShapeGeometry} - * for an {@link yfiles.graph.INode} will not change the result of a call to {@link yfiles.styles.INodeStyleRenderer#getShapeGeometry} of - * the {@link yfiles.graph.INode#style}. So standard hit tests will not be influenced by such a change. This is a convenient alternative to the direct - * usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - shapeGeometryDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.INodeSizeConstraintProvider} type for the type - * {@link yfiles.graph.INode}s this instance has been created for. - *

- * Custom {@link yfiles.input.INodeSizeConstraintProvider} implementations can be used to add constraints to the size of a node. - * These constraints are used by the default {@link yfiles.input.IReshapeHandleProvider} implementation for nodes to enforce size - * constraints for interactive resize gestures. Also {@link yfiles.input.GraphEditorInputMode} uses this interface to constrain the - * size of a node whenever its labels are being edited interactively. This is a convenient alternative to the direct usage - * of the {@link yfiles.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - sizeConstraintProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.graph.IGroupBoundsCalculator} type for the - * {@link yfiles.graph.INode}s this instance has been created for. - *

- * Custom {@link yfiles.graph.IGroupBoundsCalculator} implementations can be used to change the way the bounds of {@link yfiles.graph.IGraph#createGroupNode group nodes} are - * being calculated if the geometry of child nodes is changed by the user. This is a convenient alternative to the direct - * usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - groupBoundsCalculatorDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.INodeInsetsProvider} (tied to the {@link yfiles.graph.INode} type parameter) for the - * {@link yfiles.graph.INode}s this instance has been created for. - *

- * Custom {@link yfiles.input.INodeInsetsProvider} implementations can be used to change the way the bounds of {@link yfiles.graph.IGraph#createGroupNode group nodes} are - * being calculated if the geometry of child nodes is changed by the user. This interface will be used if there is no - * custom {@link yfiles.graph.IGroupBoundsCalculator} associated with the nodes (see {@link yfiles.graph.NodeDecorator#groupBoundsCalculatorDecorator}). This is a convenient alternative to the - * direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s - * {@link yfiles.graph.ILookup#lookup}. Note that many {@link yfiles.styles.INodeStyle} implementations provide an Insets property whose - * value will be reported by a {@link yfiles.input.INodeInsetsProvider} implementation that is provided by the corresponding - * {@link yfiles.styles.INodeStyleRenderer}. Using this property instead of decorating the lookup of the {@link yfiles.graph.INode} is thus - * often simpler. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - insetsProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IPortCandidateProvider} for the - * {@link yfiles.graph.INode}s this instance has been created for. - *

- * Custom {@link yfiles.input.IPortCandidateProvider} implementations can be used to present the user with a set of - * {@link yfiles.input.IPortCandidate}s that newly created edges can use as their {@link yfiles.graph.IEdge#sourcePort source} and {@link yfiles.graph.IEdge#targetPort target} {@link yfiles.graph.IPort}s. This - * interface is mainly used by the {@link yfiles.input.CreateEdgeInputMode} mode of {@link yfiles.input.GraphEditorInputMode}. Also the - * default implementation of {@link yfiles.input.IEdgeReconnectionPortCandidateProvider} will use this interface to determine the - * candidates that are available if the user interactively moves the ports using {@link yfiles.input.PortRelocationHandle} (see {@link yfiles.graph.PortDecorator#handleDecorator}). - * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the - * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - portCandidateProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.ISnapLineProvider} for the - * {@link yfiles.graph.INode}s this instance has been created for. - *

- * Custom {@link yfiles.input.ISnapLineProvider} implementations can be used to provide custom {@link yfiles.input.OrthogonalSnapLine}s - * based on the {@link yfiles.graph.INode}s this instance has been created for. This could e.g. be a horizontal {@link yfiles.input.OrthogonalSnapLine} - * at the vertical center of the node to which other nodes should snap with their top border. This interface is mainly used - * by the {@link yfiles.input.GraphSnapContext} to collect all available {@link yfiles.input.OrthogonalSnapLine}s. This is a convenient - * alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s - * {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - snapLineProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.INodeSnapResultProvider} for the - * {@link yfiles.graph.INode}s this instance has been created for. - *

- * Custom {@link yfiles.input.INodeSnapResultProvider} implementations can be used to provide custom {@link yfiles.input.SnapResult}s based - * on the {@link yfiles.graph.INode}s this instance has been created for. This could e.g. be a {@link yfiles.input.SnapResult} describing - * that the top left corner of the node wants to snap to a grid point. This interface is mainly used by the default {@link yfiles.input.IPositionHandler} - * for {@link yfiles.graph.INode}s to collect {@link yfiles.input.SnapResult}s during a drag gesture for the node. This is a convenient - * alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s - * {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - nodeSnapResultProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.ISnapLineProvider} for the - * {@link yfiles.graph.INode}s this instance has been created for. - *

- * Custom {@link yfiles.input.INodeReshapeSnapResultProvider} implementations can be used to provide custom - * {@link yfiles.input.SnapResult}s based on the {@link yfiles.graph.INode}s this instance has been created for. This could e.g. be a {@link yfiles.input.SnapResult} - * describing that the top left corner of the node wants to snap to a grid point. This interface is mainly used by the - * default {@link yfiles.input.IReshapeHandler} for {@link yfiles.graph.INode}s to collect {@link yfiles.input.SnapResult}s during a resize gesture - * for the node. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided - * by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - nodeReshapeSnapResultProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IPositionHandler} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.input.IPositionHandler} implementations can be used to restrict or enhance the way the user moves elements - * interactively in the editor. This interface is mainly used by the {@link yfiles.input.MoveInputMode}. This is a convenient - * alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s - * {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - positionHandlerDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.graph.IClipboardHelper} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.graph.IClipboardHelper} implementations can be used to customize the way the clipboard operations are - * performed by {@link yfiles.graph.GraphClipboard}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - clipboardHelperDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IMarqueeTestable} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.input.IMarqueeTestable} implementations can be used to change the way tests for marquee inclusions are - * performed on the items in the editor. This interface is mainly used by the {@link yfiles.input.GraphEditorInputMode}. This is a - * convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the - * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - marqueeTestableDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.graph.IMementoSupport} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.graph.IMementoSupport} implementations can be used to make the {@link yfiles.graph.UndoEngine} aware of changes to - * data that is associated with the model items. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - mementoSupportDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.ISelectionIndicatorInstaller} type for the type of items this instance has been - * created for. - *

- * Custom {@link yfiles.view.ISelectionIndicatorInstaller} implementations can be used change the way the selection of an item is - * represented in a {@link yfiles.view.CanvasComponent}. This interface is mainly used by the {@link yfiles.view.SelectionIndicatorManager.} in the {@link yfiles.view.GraphComponent}. - * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the - * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - selectionDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IHighlightIndicatorInstaller} type for the type of items this instance has been - * created for. - *

- * Custom {@link yfiles.view.IHighlightIndicatorInstaller} implementations can be used change the way the highlighting of an item - * is represented in a {@link yfiles.view.CanvasComponent}. This interface is mainly used by the {@link yfiles.view.HighlightIndicatorManager.} in the - * {@link yfiles.view.GraphComponent}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - highlightDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IFocusIndicatorInstaller} type for the type of items this instance has been - * created for. - *

- * Custom {@link yfiles.view.IFocusIndicatorInstaller} implementations can be used change the way the focus of an item is - * represented in a {@link yfiles.view.GraphComponent}. This interface is mainly used by the {@link yfiles.view.FocusIndicatorManager.} in the {@link yfiles.view.GraphComponent}. - * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the - * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - focusIndicatorDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IHandleProvider} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.input.IHandleProvider} implementations provide interactive draggable handles for the user to change the - * geometry or other aspects of items in the {@link yfiles.view.GraphComponent}. This interface is mainly used by the {@link yfiles.input.HandleInputMode} - * in the {@link yfiles.input.GraphEditorInputMode}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} - * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @type {yfiles.graph.LookupDecorator.} - */ - handleProviderDecorator:yfiles.graph.LookupDecorator; - /** - * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IObstacleProvider} type for the type of items this instance has been created for. - *

- * Custom {@link yfiles.view.IObstacleProvider} implementations provide information about obstacles that will be considered by {@link yfiles.view.GraphObstacleProvider} - * which itself serves as a provider for geometric obstacles to {@link yfiles.view.BridgeManager} that manages the rendering of - * bridges in edge paths. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is - * provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. - *

- * @see yfiles.view.GraphObstacleProvider - * @see yfiles.view.BridgeManager - * @type {yfiles.graph.LookupDecorator.} - */ - obstacleProviderDecorator:yfiles.graph.LookupDecorator; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.NodeDecorator; - } - /** - * A convenience class that simplifies using an {@link yfiles.graph.ILookupDecorator}. - *

- * This class provides convenience methods that help in performing common tasks related to decorating the {@link yfiles.graph.ILookup#lookup} - * method for a certain TDecoratedType. - *

- * Type parameter TDecoratedType: The type of the instances whose {@link yfiles.graph.ILookup#lookup} behavior should be modified. - * Type parameter TInterface: The interface or type that clients will use during the {@link yfiles.graph.ILookup#lookup} call. Note that this is normally an - * interface and not the implementation of the interface since client code will use the interface for the query. - * @see yfiles.graph.ILookup - * @see yfiles.graph.GraphDecorator - * @class - * @template TDecoratedType,TInterface - * @final - */ - export interface LookupDecorator extends yfiles.lang.Object{} - export class LookupDecorator { - /** - * Initializes a new instance of the {@link yfiles.graph.LookupDecorator.} class. - * @param decoratedType The type of the instances whose {@link #lookup} behavior should be modified. - * @param interfaceType The interface or type that clients will use during the {@link #lookup} call. Note that this is normally an - * interface and not the implementation of the interface since client code will use the interface for the query. - * @param decorator The decorator instance that will be used to {@link #addLookup extend the Lookup mechanism}. - * @param decorateNulls The initial value of the {@link #decorateNulls} property. - * @param nullIsFallback The initial value of the {@link #nullIsFallback} property. - */ - constructor(decoratedType:yfiles.lang.Class,interfaceType:yfiles.lang.Class,decorator:yfiles.graph.ILookupDecorator,decorateNulls:boolean,nullIsFallback:boolean); - /** - * Simple helper method that tries to add the provided chain link to the {@link yfiles.graph.LookupDecorator.#decorator}. - * @param lookup The link to add. - * @returns The lookup that has been {@link #addLookup added} to the {@link #decorator} as a result of this call, or null if the decoration was unsuccessful. - * @see yfiles.graph.ILookupDecorator#addLookup - */ - addChainLink(lookup:yfiles.graph.IContextLookupChainLink):yfiles.graph.IContextLookupChainLink; - /** - * Amends the {@link yfiles.graph.IContextLookupChainLink lookup chain} for all TDecoratedType items matching a predicate to return null if TInterface is queried during the - * {@link yfiles.graph.ILookup#lookup}. - *

- * This can be used to temporarily or permanently disable a certain behavior for all items. To do this only for items - * matching a predicate, use {@link yfiles.graph.LookupDecorator.#hideImplementation} instead. - *

- *

- * The effects of this method call can be undone by passing the return value to - * {@link yfiles.graph.ILookupDecorator#removeLookup}. - *

- * @param [predicate=null] The predicate that determines for which items the implementation shall be hidden. - * @returns An {@link } that has been {@link #addLookup added} to the {@link #decorator} as a result of this call, or null if decoration was - * unsuccessful. - * @see yfiles.graph.ILookupDecorator#addLookup - */ - hideImplementation(predicate?:(obj:TDecoratedType)=>boolean):yfiles.graph.IContextLookupChainLink; - /** - * Amends the {@link yfiles.graph.IContextLookupChainLink lookup chain} for items matching a predicate with a factory that creates a TInterface instance if TInterface is queried during the - * {@link yfiles.graph.ILookup#lookup}. - *

- * This can be used to modify the lookup of all items matching a certain predicate where the returned instance either - * depends on the item or uses it in some way. - *

- *

- * To adjust the lookup of all items in this manner, use {@link yfiles.graph.LookupDecorator.#setFactory} instead. To adjust the lookup of a single item, use - * {@link yfiles.graph.LookupDecorator.#setImplementation}. - *

- *

- * Note that depending on the value of the {@link yfiles.graph.LookupDecorator.#nullIsFallback} property a null return value from the factory will be either returned directly, - * or interpreted as a hint to return a fallback value which is obtained by querying the remainder of the lookup chain. - *

- *

- * The effects of this method call can be undone by passing the return value to - * {@link yfiles.graph.ILookupDecorator#removeLookup}. - *

- * @param predicate The predicate that determines for which items the factory shall be called. - * @param factory The factory that is queried to create the result. - * @returns An {@link } that has been {@link #addLookup added} to the {@link #decorator} as a result of this call, or null if decoration was - * unsuccessful. - * @see yfiles.graph.ILookupDecorator#addLookup - * @see yfiles.graph.LookupDecorator.#nullIsFallback - */ - setFactory(predicate:(obj:TDecoratedType)=>boolean,factory:(arg:TDecoratedType)=>TInterface):yfiles.graph.IContextLookupChainLink; - /** - * Amends the {@link yfiles.graph.IContextLookupChainLink lookup chain} for all TDecoratedType items, so that factory is used to create a TInterface instance if TInterface is queried during the - * {@link yfiles.graph.ILookup#lookup}. - *

- * This can be used to modify the lookup of all items where the returned instance either depends on the item or uses it in - * some way. - *

- *

- * To only adjust the lookup of items matching a predicate in this manner, use {@link yfiles.graph.LookupDecorator.#setFactory} instead. To adjust the lookup of - * a single item, use {@link yfiles.graph.LookupDecorator.#setImplementation}. - *

- *

- * Note that depending on the value of the {@link yfiles.graph.LookupDecorator.#nullIsFallback} property a null return value from the factory will be either returned directly, - * or interpreted as a hint to return a fallback value which is obtained by querying the remainder of the lookup chain. - *

- *

- * The effects of this method call can be undone by passing the return value to - * {@link yfiles.graph.ILookupDecorator#removeLookup}. - *

- * @param factory The factory that is queried to create the result. - * @returns An {@link } that has been {@link #addLookup added} to the {@link #decorator} as a result of this call, or null if decoration was - * unsuccessful. - * @see yfiles.graph.ILookupDecorator#addLookup - * @see yfiles.graph.LookupDecorator.#nullIsFallback - */ - setFactory(factory:(arg:TDecoratedType)=>TInterface):yfiles.graph.IContextLookupChainLink; - /** - * Amends the {@link yfiles.graph.IContextLookupChainLink lookup chain} for all items matching a predicate with a fixed TInterface implementation if TInterface is queried on an item's - * {@link yfiles.graph.ILookup#lookup}. - *

- * This can be used to modify the lookup of all items matching a certain predicate in the same way. - *

- *

- * To adjust the lookup of only a single item, use {@link yfiles.graph.LookupDecorator.#setImplementation} instead. To adjust the lookup of all items, use - * {@link yfiles.graph.LookupDecorator.#setImplementation}. - *

- *

- * The effects of this method call can be undone by passing the return value to - * {@link yfiles.graph.ILookupDecorator#removeLookup}. - *

- * @param predicate A predicate that determines which items are affected. - * @param implementation The implementation to return if the predicate matches and TInterface is queried. - * @returns An {@link } that has been {@link #addLookup added} to the {@link #decorator} as a result of this call, or null if decoration was - * unsuccessful. - * @see yfiles.graph.ILookupDecorator#addLookup - */ - setImplementation(predicate:(obj:TDecoratedType)=>boolean,implementation:TInterface):yfiles.graph.IContextLookupChainLink; - /** - * Amends the {@link yfiles.graph.IContextLookupChainLink lookup chain} for a single item with a fixed TInterface implementation if TInterface is queried on the item's - * {@link yfiles.graph.ILookup#lookup}. - *

- * This can be used to modify the lookup of a single item only. - *

- *

- * To adjust the lookup of all items matching a predicate, use {@link yfiles.graph.LookupDecorator.#setImplementation} instead. To adjust the lookup of all - * items, use {@link yfiles.graph.LookupDecorator.#setImplementation}. - *

- *

- * The effects of this method call can be undone by passing the return value to - * {@link yfiles.graph.ILookupDecorator#removeLookup}. - *

- * @param item The item for which the implementation shall be returned. - * @param implementation The implementation to return if item is queried for TInterface. - * @returns An {@link } that has been {@link #addLookup added} to the {@link #decorator} as a result of this call, or null if decoration was - * unsuccessful. - * @see yfiles.graph.ILookupDecorator#addLookup - */ - setImplementation(item:TDecoratedType,implementation:TInterface):yfiles.graph.IContextLookupChainLink; - /** - * Amends the {@link yfiles.graph.IContextLookupChainLink lookup chain}, so that implementation is always returned if TInterface is queried on an item's - * {@link yfiles.graph.ILookup#lookup}. - *

- * This can be used to modify the lookup of all items in the same way. - *

- *

- * To adjust the lookup of only a single item, use {@link yfiles.graph.LookupDecorator.#setImplementation} instead. To adjust the lookup of all items matching a - * certain predicate, use {@link yfiles.graph.LookupDecorator.#setImplementation}. - *

- *

- * The effects of this method call can be undone by passing the return value to - * {@link yfiles.graph.ILookupDecorator#removeLookup}. - *

- * @param implementation The implementation to return unconditionally. - * @returns An {@link } that has been {@link #addLookup added} to the {@link #decorator} as a result of this call, or null if decoration was - * unsuccessful. - * @see yfiles.graph.ILookupDecorator#addLookup - */ - setImplementation(implementation:TInterface):yfiles.graph.IContextLookupChainLink; - /** - * Amends the {@link yfiles.graph.IContextLookupChainLink lookup chain} for all items matching a predicate with a factory callback that wraps the underlying - * implementation if TInterface is queried during the {@link yfiles.graph.ILookup#lookup}. - *

- * This can be used to modify the lookup of all items matching a certain predicate where the factory implementation may - * delegate to the wrapped implementation in certain cases. - *

- *

- * To adjust the lookup for all items in this manner, use {@link yfiles.graph.LookupDecorator.#setImplementationWrapper} instead. To adjust the lookup of a - * single item, use {@link yfiles.graph.LookupDecorator.#setImplementation}. - *

- *

- * Note that depending on the value of the {@link yfiles.graph.LookupDecorator.#decorateNulls} property, the factory will not not be called to decorate null results. - *

- *

- * The effects of this method call can be undone by passing the return value to - * {@link yfiles.graph.ILookupDecorator#removeLookup}. - *

- * @param predicate The predicate that determines for which items the wrapping shall be performed. - * @param factory The factory that will be passed the underlying implementation and that is queried to create the result. - * @returns An {@link } that has been {@link #addLookup added} to the {@link #decorator} as a result of this call, or null if decoration was - * unsuccessful. - * @see yfiles.graph.ILookupDecorator#addLookup - */ - setImplementationWrapper(predicate:(obj:TDecoratedType)=>boolean,factory:(arg1:TDecoratedType,arg2:TInterface)=>TInterface):yfiles.graph.IContextLookupChainLink; - /** - * Amends the {@link yfiles.graph.IContextLookupChainLink lookup chain} for all items with a factory callback that wraps the underlying implementation if TInterface is queried - * during the {@link yfiles.graph.ILookup#lookup}. - *

- * This can be used to modify the lookup of all items matching where the factory implementation may delegate to the wrapped - * implementation in certain cases. - *

- *

- * To adjust the lookup in this manner only for items matching a predicate, use {@link yfiles.graph.LookupDecorator.#setImplementationWrapper} instead. To - * adjust the lookup of a single item, use {@link yfiles.graph.LookupDecorator.#setImplementation}. - *

- *

- * Note that depending on the value of the {@link yfiles.graph.LookupDecorator.#decorateNulls} property, the factory will not not be called to decorate null results. - *

- *

- * The effects of this method call can be undone by passing the return value to - * {@link yfiles.graph.ILookupDecorator#removeLookup}. - *

- * @param factory The factory that will be passed the underlying implementation and that is queried to create the result. - * @returns An {@link } that has been {@link #addLookup added} to the {@link #decorator} as a result of this call, or null if decoration was - * unsuccessful. - * @see yfiles.graph.ILookupDecorator#addLookup - */ - setImplementationWrapper(factory:(arg1:TDecoratedType,arg2:TInterface)=>TInterface):yfiles.graph.IContextLookupChainLink; - /** - * Gets the {@link yfiles.graph.ILookupDecorator} instance that is used. - *

- * This can be null. In this case all methods of this class do nothing. - *

- * @type {yfiles.graph.ILookupDecorator} - */ - decorator:yfiles.graph.ILookupDecorator; - /** - * Gets or sets a value indicating whether wrapping implementations will wrap null values from the rest of the lookup chain - * or those values will simply be returned instead. - *

- * If this is true, then the {@link yfiles.graph.LookupDecorator.#setImplementationWrapper SetImplementationWrapper} methods will not wrap null values from the rest of the lookup chain - * and the result of the call to {@link yfiles.graph.ILookup#lookup} will simply be null. If this is false, the wrapper will get null - * as the implementation to wrap and should handle this accordingly. - *

- * @type {boolean} - */ - decorateNulls:boolean; - /** - * Gets or sets a value indicating whether a null result value of the methods {@link yfiles.graph.LookupDecorator.#setImplementation} and {@link yfiles.graph.LookupDecorator.#setFactory} should be - * interpreted as taking the fallback value, or actually return null. - *

- * If this is true, then null values returned from the implementation or factory set with {@link yfiles.graph.LookupDecorator.#setImplementation} or {@link yfiles.graph.LookupDecorator.#setFactory} - * are not returned, but rather interpreted as a hint to query the rest of the lookup chain. If this is false, then null - * values are returned as is. - *

- * @type {boolean} - */ - nullIsFallback:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.LookupDecorator; - } - /** - * Provides less frequently used methods for analyzing and managing grouped graphs. - *

- * An instance of this class which is configured for a given {@link yfiles.graph.IGraph} instance can be obtained via {@link yfiles.graph.IGraph#groupingSupport}. - *

- * @class - */ - export interface GroupingSupport extends yfiles.lang.Object{} - export class GroupingSupport { - /** - * Creates a new instance which operates on the given graph. - * @param graph The graph to use for operations on this instance. - */ - constructor(graph:yfiles.graph.IGraph); - /** - * Calculates the minimum area to enclose by the given group node with respect to its {@link yfiles.graph.IGroupBoundsCalculator}. - * @param groupNode The group node to calculate the minimum enclosed area of. - * @returns The area to enclose for the given group node. This is {@link #EMPTY} if the node is not a group node, or if - * it hasn't any children. - */ - calculateMinimumEnclosedArea(groupNode:yfiles.graph.INode):yfiles.geometry.Rect; - /** - * Enlarges all group nodes in the graph in an interactive scenario, so that the {@link yfiles.graph.GroupingSupport#calculateMinimumEnclosedArea minimum enclosed area} is respected. - *

- * This method should be used in an interactive editing scenario. It records an {@link yfiles.graph.ICompoundEdit} to support - * undoability and uses the {@link yfiles.input.IReshapeHandler} for the resizing of the nodes. That way, e.g. orthogonally edited - * edges will be properly reshaped. - *

- * @param context The context to use for the {@link }s. - * @see yfiles.graph.GroupingSupport#enlargeGroupNode - */ - enlargeAllGroupNodes(context:yfiles.input.IInputModeContext):void; - /** - * Enlarges all group nodes in the graph so that the {@link yfiles.graph.GroupingSupport#calculateMinimumEnclosedArea minimum enclosed area} is respected. - * @see yfiles.graph.GroupingSupport#enlargeGroupNode - */ - enlargeAllGroupNodes():void; - /** - * Enlarges the group nodes in an interactive scenario, using {@link yfiles.input.IReshapeHandler} implementations of the group - * nodes to perform the actual resizing. - *

- * This method should be used in an interactive editing scenario. It records an {@link yfiles.graph.ICompoundEdit} to support - * undoability and uses the {@link yfiles.input.IReshapeHandler} for the resizing of the nodes. That way, e.g. orthogonally edited - * edges will be properly reshaped. - *

- * @param context The context to use for the {@link }s. - * @param node The node to enlarge appropriately. - * @param ancestors if set to true ancestors the ancestor group nodes will be adjusted, too, if necessary. - * @see yfiles.input.IReshapeHandler - */ - enlargeGroupNode(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode,ancestors:boolean):void; - /** - * Enlarges the given group node to ensure that the {@link yfiles.graph.GroupingSupport#calculateMinimumEnclosedArea minimum enclosed} area is inside of its bounds. - *

- * This method can be used to resize a group node and all of its parent group nodes to fully contain its children, e.g. - * after a child node has changed its bounds. Note that this method will only enlarge the bounds of the group nodes, it - * will never reduce the size of a group node. - *

- * @param groupNode The group node to resize. - * @param ancestors if set to true all ancestor group nodes will be resized, too, if necessary - * @see yfiles.graph.GroupingSupport#enlargeGroupNode - */ - enlargeGroupNode(groupNode:yfiles.graph.INode,ancestors:boolean):void; - /** - * Returns all descendants of the provided node that are part of the grouped graph. - *

- * The enumeration will be top down, i.e. all of a node's ancestors will be enumerated before the respective node. - *

- * @param node The root node to get the descendants from. - * @returns An enumeration of the children of the node at the time of this invocation in reverse DFS prefix order. - */ - getDescendants(node:yfiles.graph.INode):yfiles.collections.IEnumerable; - /** - * Returns all descendants of the provided node that are part of the grouped graph. - *

- * The enumeration will be bottom up, i.e. all of a node's children will be enumerated before the respective node. - *

- * @param node The root node to get the descendants from. - * @returns An enumeration of the children of the node at the time of this invocation in DFS postfix order. - */ - getDescendantsBottomUp(node:yfiles.graph.INode):yfiles.collections.IEnumerable; - /** - * Determines the nearest common ancestor of the provided nodes in the graph. - * @param nodes The nodes to find the nearest common ancestor of. - * @returns - */ - getNearestCommonAncestor(...nodes:yfiles.graph.INode[]):yfiles.graph.INode; - /** - * Determines the nearest common ancestor of the provided nodes in the graph. - * @param nodes The nodes to find the nearest common ancestor of. - * @returns - */ - getNearestCommonAncestor(nodes:yfiles.collections.IEnumerable):yfiles.graph.INode; - /** - * Gets the path to root traversing all {@link yfiles.graph.IGraph#getParent parents} of the given item. - * @param node The node to start. - * @returns A list that includes the node but not the root, unless they are identical and all parents in between them. - */ - getPathToRoot(node:yfiles.graph.INode):yfiles.collections.IList; - /** - * Determines whether there are group nodes in the graph. - *

- * This methods considers all {@link yfiles.graph.IGraph#isGroupNode group} nodes, that is, nodes that could have children. - *

- * @returns true if there are {@link #isGroupNode group}. - */ - hasGroupNodes():boolean; - /** - * Determines whether ancestor is an ancestor of node in the grouped graph. - * @param node The node to check. - * @param ancestor The ancestor to check. - * @returns Whether ancestor is an ancestor of node. - */ - isDescendant(node:yfiles.graph.INode,ancestor:yfiles.graph.INode):boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.GroupingSupport; - } - /** - * An abstract {@link yfiles.graph.IGraph} implementation that delegates all of its work to an existing implementation. - *

- * Subclasses can override all of the methods to customize the behavior of this instance. Note that this instance will - * register listeners with the wrapped graph instance, so {@link yfiles.graph.GraphWrapperBase#dispose} should be called if this - * instance is not used any more. - *

- * @class - * @implements {yfiles.graph.IGraph} - */ - export interface GraphWrapperBase extends yfiles.lang.Object,yfiles.graph.IGraph{} - export class GraphWrapperBase { - /** - * Creates a new instance that wraps a given {@link yfiles.graph.IGraph}. - *

- * Note that this instance will {@link yfiles.graph.GraphWrapperBase#addEventHandlers register listeners} with the graph, so {@link yfiles.graph.GraphWrapperBase#dispose} should be - * called if this instance is not used any more. - *

- * @param graph The graph to wrap. - * @protected - */ - constructor(graph:yfiles.graph.IGraph); - /** - * - * @param edge - * @param location - * @param [index=-1] - * @returns - */ - addBend(edge:yfiles.graph.IEdge,location:yfiles.geometry.Point,index?:number):yfiles.graph.IBend; - /** - * Adds event handlers that propagate graph events from graph to listeners on this instance. - * @param graph The graph for which event propagators should be created - * @protected - */ - addEventHandlers(graph:yfiles.graph.IGraph):void; - /** - * - * @param owner - * @param text - * @param [layoutParameter=null] - * @param [style=null] - * @param [preferredSize=null] - * @param [tag=null] - * @returns - */ - addLabel(owner:yfiles.graph.ILabelOwner,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,preferredSize?:yfiles.geometry.Size,tag?:any):yfiles.graph.ILabel; - /** - * - * @param {Object} options The parameters to pass. - * @param options.owner - * @param options.text - * @param [options.layoutParameter=null] - * @param [options.style=null] - * @param [options.preferredSize=null] - * @param [options.tag=null] - * @returns - */ - addLabel(options:{owner:yfiles.graph.ILabelOwner,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,preferredSize?:yfiles.geometry.Size,tag?:Object}):yfiles.graph.ILabel; - /** - * - * @param owner - * @param [locationParameter=null] - * @param [style=null] - * @param [tag=null] - * @returns - */ - addPort(owner:yfiles.graph.IPortOwner,locationParameter?:yfiles.graph.IPortLocationModelParameter,style?:yfiles.styles.IPortStyle,tag?:any):yfiles.graph.IPort; - /** - * - * @param {Object} options The parameters to pass. - * @param options.owner - * @param [options.locationParameter=null] - * @param [options.style=null] - * @param [options.tag=null] - * @returns - */ - addPort(options:{owner:yfiles.graph.IPortOwner,locationParameter?:yfiles.graph.IPortLocationModelParameter,style?:yfiles.styles.IPortStyle,tag?:Object}):yfiles.graph.IPort; - /** - * - * @param item - * @returns - */ - contains(item:yfiles.graph.IModelItem):boolean; - /** - * - * @param source - * @param target - * @param [style=null] - * @param [tag=null] - * @returns - */ - createEdge(source:yfiles.graph.INode,target:yfiles.graph.INode,style?:yfiles.styles.IEdgeStyle,tag?:any):yfiles.graph.IEdge; - /** - * - * @param {Object} options The parameters to pass. - * @param options.source - * @param options.target - * @param [options.style=null] - * @param [options.tag=null] - * @returns - */ - createEdge(options:{source:yfiles.graph.INode,target:yfiles.graph.INode,style?:yfiles.styles.IEdgeStyle,tag?:Object}):yfiles.graph.IEdge; - /** - * - * @param sourcePort - * @param targetPort - * @param [style=null] - * @param [tag=null] - * @returns - */ - createEdge(sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort,style?:yfiles.styles.IEdgeStyle,tag?:any):yfiles.graph.IEdge; - /** - * - * @param {Object} options The parameters to pass. - * @param options.sourcePort - * @param options.targetPort - * @param [options.style=null] - * @param [options.tag=null] - * @returns - */ - createEdge(options:{sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort,style?:yfiles.styles.IEdgeStyle,tag?:Object}):yfiles.graph.IEdge; - /** - * - * @param [parent=null] - * @param [layout=null] - * @param [style=null] - * @param [tag=null] - * @returns - */ - createGroupNode(parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:any):yfiles.graph.INode; - /** - * - * @param {Object} options The parameters to pass. - * @param [options.parent=null] - * @param [options.layout=null] - * @param [options.style=null] - * @param [options.tag=null] - * @returns - */ - createGroupNode(options:{parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object}):yfiles.graph.INode; - /** - * - * @param layout - * @param [style=null] - * @param [tag=null] - * @returns - */ - createNode(layout:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:any):yfiles.graph.INode; - /** - * - * @param {Object} options The parameters to pass. - * @param options.layout - * @param [options.style=null] - * @param [options.tag=null] - * @returns - */ - createNode(options:{layout:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object}):yfiles.graph.INode; - /** - * - * @param [parent=null] - * @param [layout=null] - * @param [style=null] - * @param [tag=null] - * @returns - */ - createNode(parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:any):yfiles.graph.INode; - /** - * - * @param {Object} options The parameters to pass. - * @param [options.parent=null] - * @param [options.layout=null] - * @param [options.style=null] - * @param [options.tag=null] - * @returns - */ - createNode(options:{parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object}):yfiles.graph.INode; - /** - * Clears the internal state of this instance and released memory and bound listeners. - *

- * After this instance has been disposed of, it will not work as expected anymore. This implementation {@link yfiles.graph.GraphWrapperBase#removeEventHandlers removes all event handlers} - * from the {@link yfiles.graph.GraphWrapperBase#wrappedGraph} and releases the reference. - *

- */ - dispose():void; - /** - * - * @param owner - * @param [type=yfiles.graph.AdjacencyTypes.ALL] - * @returns - */ - edgesAt(owner:yfiles.graph.IPortOwner,type?:yfiles.graph.AdjacencyTypes):yfiles.collections.IListEnumerable; - /** - * - * @param port - * @param [type=yfiles.graph.AdjacencyTypes.ALL] - * @returns - */ - edgesAt(port:yfiles.graph.IPort,type?:yfiles.graph.AdjacencyTypes):yfiles.collections.IListEnumerable; - /** - * - * @param node - * @returns - */ - getChildren(node:yfiles.graph.INode):yfiles.collections.IListEnumerable; - /** - * Gets the lookup instance to use in {@link yfiles.graph.GraphWrapperBase#lookup} - * @returns - */ - getLookup():yfiles.graph.ILookup; - /** - * - * @param node - * @returns - */ - getParent(node:yfiles.graph.INode):yfiles.graph.INode; - /** - * - */ - invalidateDisplays():void; - /** - * - * @param node - * @returns - */ - isGroupNode(node:yfiles.graph.INode):boolean; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addBendAddedListener BendAdded} event - * @param evt The parameters for the event - * @protected - */ - onBendAdded(evt:yfiles.collections.ItemEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addBendLocationChangedListener BendLocationChanged} event - * @param bend The bend whose location changed - * @param oldLocation The bend location before the change - * @protected - */ - onBendLocationChanged(bend:yfiles.graph.IBend,oldLocation:yfiles.geometry.Point):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addBendRemovedListener BendRemoved} event - * @param evt The parameters for the event - * @protected - */ - onBendRemoved(evt:yfiles.graph.BendEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addBendTagChangedListener BendTagChanged} event - * @param evt The parameters for the event - * @protected - */ - onBendTagChanged(evt:yfiles.graph.ItemChangedEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addEdgeCreatedListener EdgeCreated} event - * @param evt The parameters for the event - * @protected - */ - onEdgeCreated(evt:yfiles.collections.ItemEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addEdgePortsChangedListener EdgePortsChanged} event - * @param evt The parameters for the event - * @protected - */ - onEdgePortsChanged(evt:yfiles.graph.EdgeEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addEdgeRemovedListener EdgeRemoved} event - * @param evt The parameters for the event - * @protected - */ - onEdgeRemoved(evt:yfiles.graph.EdgeEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addEdgeStyleChangedListener EdgeStyleChanged} event - * @param evt The parameters for the event - * @protected - */ - onEdgeStyleChanged(evt:yfiles.graph.ItemChangedEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addEdgeTagChangedListener EdgeTagChanged} event - * @param evt The parameters for the event - * @protected - */ - onEdgeTagChanged(evt:yfiles.graph.ItemChangedEventArgs):void; - /** - * Called when the {@link yfiles.graph.GraphWrapperBase#wrappedGraph} property value changes and after initialization of the field. - *

- * Delegates to {@link yfiles.graph.GraphWrapperBase#addEventHandlers} for newGraph and to {@link yfiles.graph.GraphWrapperBase#removeEventHandlers} - * for oldGraph. - *

- * @param oldGraph the old value, which may be null the first time - * @param newGraph the new value - * @protected - */ - onGraphChanged(oldGraph:yfiles.graph.IGraph,newGraph:yfiles.graph.IGraph):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addGraphTagChangedListener GraphTagChanged} event - * @param evt The parameters for the event - * @protected - */ - onGraphTagChanged(evt:yfiles.graph.ItemChangedEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addDisplaysInvalidatedListener DisplaysInvalidated} event - * @param evt The parameters for the event - * @protected - */ - onInvalidateDisplays(evt:yfiles.lang.EventArgs):void; - /** - * Dispatches the {@link yfiles.graph.GraphWrapperBase#addIsGroupNodeChangedListener IsGroupNodeChanged} event. - * @param evt The event args to dispatch. - * @protected - */ - onIsGroupNodeChanged(evt:yfiles.graph.NodeEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addLabelAddedListener LabelAdded} event - * @param evt The parameters for the event - * @protected - */ - onLabelAdded(evt:yfiles.collections.ItemEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addLabelLayoutParameterChangedListener LabelLayoutParameterChanged} event - * @param evt The parameters for the event - * @protected - */ - onLabelLayoutParameterChanged(evt:yfiles.graph.ItemChangedEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addLabelPreferredSizeChangedListener LabelPreferredSizeChanged} event - * @param evt The parameters for the event - * @protected - */ - onLabelPreferredSizeChanged(evt:yfiles.graph.ItemChangedEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addLabelRemovedListener LabelRemoved} event - * @param evt The parameters for the event - * @protected - */ - onLabelRemoved(evt:yfiles.graph.LabelEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addLabelStyleChangedListener LabelStyleChanged} event - * @param evt The parameters for the event - * @protected - */ - onLabelStyleChanged(evt:yfiles.graph.ItemChangedEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addLabelTagChangedListener LabelTagChanged} event - * @param evt The parameters for the event - * @protected - */ - onLabelTagChanged(evt:yfiles.graph.ItemChangedEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addLabelTextChangedListener LabelTextChanged} event - * @param evt The parameters for the event - * @protected - */ - onLabelTextChanged(evt:yfiles.graph.ItemChangedEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addNodeCreatedListener NodeCreated} event - * @param evt The parameters for the event - * @protected - */ - onNodeCreated(evt:yfiles.collections.ItemEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addNodeLayoutChangedListener NodeLayoutChanged} event - * @param node The node whose layout changed - * @param oldLayout The node layout before the change - * @protected - */ - onNodeLayoutChanged(node:yfiles.graph.INode,oldLayout:yfiles.geometry.Rect):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addNodeRemovedListener NodeRemoved} event - * @param evt The parameters for the event - * @protected - */ - onNodeRemoved(evt:yfiles.graph.NodeEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addNodeStyleChangedListener NodeStyleChanged} event - * @param evt The parameters for the event - * @protected - */ - onNodeStyleChanged(evt:yfiles.graph.ItemChangedEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addNodeTagChangedListener NodeTagChanged} event - * @param evt The parameters for the event - * @protected - */ - onNodeTagChanged(evt:yfiles.graph.ItemChangedEventArgs):void; - /** - * Dispatches the {@link yfiles.graph.GraphWrapperBase#addParentChangedListener ParentChanged} event. - * @param evt The event args to dispatch. - * @protected - */ - onParentChanged(evt:yfiles.graph.NodeEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addPortAddedListener PortAdded} event - * @param evt The parameters for the event - * @protected - */ - onPortAdded(evt:yfiles.collections.ItemEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addPortLocationParameterChangedListener PortLocationParameterChanged} event - * @param evt The parameters for the event - * @protected - */ - onPortLocationParameterChanged(evt:yfiles.graph.ItemChangedEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addPortRemovedListener PortRemoved} event - * @param evt The parameters for the event - * @protected - */ - onPortRemoved(evt:yfiles.graph.PortEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addPortStyleChangedListener PortStyleChanged} event - * @param evt The parameters for the event - * @protected - */ - onPortStyleChanged(evt:yfiles.graph.ItemChangedEventArgs):void; - /** - * Raises the {@link yfiles.graph.GraphWrapperBase#addPortTagChangedListener PortTagChanged} event - * @param evt The parameters for the event - * @protected - */ - onPortTagChanged(evt:yfiles.graph.ItemChangedEventArgs):void; - /** - * - * @param item - */ - remove(item:yfiles.graph.IModelItem):void; - /** - * Removes event handlers for graph that have been added with {@link yfiles.graph.GraphWrapperBase#addEventHandlers}. - * @param graph The graph for which event propagators should be removed - * @protected - */ - removeEventHandlers(graph:yfiles.graph.IGraph):void; - /** - * - * @param bend - * @param location - */ - setBendLocation(bend:yfiles.graph.IBend,location:yfiles.geometry.Point):void; - /** - * - * @param edge - * @param sourcePort - * @param targetPort - */ - setEdgePorts(edge:yfiles.graph.IEdge,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):void; - /** - * - * @param node - * @param isGroupNode - */ - setIsGroupNode(node:yfiles.graph.INode,isGroupNode:boolean):void; - /** - * - * @param label - * @param layoutParameter - */ - setLabelLayoutParameter(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):void; - /** - * - * @param label - * @param preferredSize - */ - setLabelPreferredSize(label:yfiles.graph.ILabel,preferredSize:yfiles.geometry.Size):void; - /** - * - * @param label - * @param text - */ - setLabelText(label:yfiles.graph.ILabel,text:string):void; - /** - * Sets the lookup instance to use in {@link yfiles.graph.GraphWrapperBase#lookup} - * @param lookup - */ - setLookup(lookup:yfiles.graph.ILookup):void; - /** - * - * @param node - * @param layout - */ - setNodeLayout(node:yfiles.graph.INode,layout:yfiles.geometry.Rect):void; - /** - * - * @param node - * @param parent - */ - setParent(node:yfiles.graph.INode,parent:yfiles.graph.INode):void; - /** - * - * @param port - * @param locationParameter - */ - setPortLocationParameter(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):void; - /** - * - * @param port - * @param style - */ - setStyle(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):void; - /** - * - * @param edge - * @param style - */ - setStyle(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):void; - /** - * - * @param label - * @param style - */ - setStyle(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):void; - /** - * - * @param node - * @param style - */ - setStyle(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):void; - /** - * Gets the graph that has been wrapped by this instance. - * @type {yfiles.graph.IGraph} - */ - wrappedGraph:yfiles.graph.IGraph; - /** - * - * @type {yfiles.collections.IListEnumerable.} - */ - nodes:yfiles.collections.IListEnumerable; - /** - * - * @type {yfiles.collections.IListEnumerable.} - */ - edges:yfiles.collections.IListEnumerable; - /** - * - * @type {yfiles.collections.IListEnumerable.} - */ - labels:yfiles.collections.IListEnumerable; - /** - * - * @type {yfiles.collections.IListEnumerable.} - */ - ports:yfiles.collections.IListEnumerable; - /** - * - * @type {yfiles.graph.IEdgeDefaults} - */ - edgeDefaults:yfiles.graph.IEdgeDefaults; - /** - * - * @type {yfiles.graph.INodeDefaults} - */ - nodeDefaults:yfiles.graph.INodeDefaults; - /** - * - * @param listener - */ - addGraphTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeGraphTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addNodeCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - removeNodeCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - addNodeRemovedListener(listener:(sender:any,evt:yfiles.graph.NodeEventArgs)=>void):void; - /** - * - * @param listener - */ - removeNodeRemovedListener(listener:(sender:any,evt:yfiles.graph.NodeEventArgs)=>void):void; - /** - * - * @param listener - */ - addNodeStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeNodeStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addNodeLayoutChangedListener(listener:(source:any,node:yfiles.graph.INode,oldLayout:yfiles.geometry.Rect)=>void):void; - /** - * - * @param listener - */ - removeNodeLayoutChangedListener(listener:(source:any,node:yfiles.graph.INode,oldLayout:yfiles.geometry.Rect)=>void):void; - /** - * - * @param listener - */ - addNodeTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeNodeTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addEdgeCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - removeEdgeCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - addEdgeRemovedListener(listener:(sender:any,evt:yfiles.graph.EdgeEventArgs)=>void):void; - /** - * - * @param listener - */ - removeEdgeRemovedListener(listener:(sender:any,evt:yfiles.graph.EdgeEventArgs)=>void):void; - /** - * - * @param listener - */ - addEdgeStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeEdgeStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addEdgePortsChangedListener(listener:(sender:any,evt:yfiles.graph.EdgeEventArgs)=>void):void; - /** - * - * @param listener - */ - removeEdgePortsChangedListener(listener:(sender:any,evt:yfiles.graph.EdgeEventArgs)=>void):void; - /** - * - * @param listener - */ - addEdgeTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeEdgeTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addBendAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - removeBendAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - addBendRemovedListener(listener:(sender:any,evt:yfiles.graph.BendEventArgs)=>void):void; - /** - * - * @param listener - */ - removeBendRemovedListener(listener:(sender:any,evt:yfiles.graph.BendEventArgs)=>void):void; - /** - * - * @param listener - */ - addBendLocationChangedListener(listener:(source:any,bend:yfiles.graph.IBend,oldLocation:yfiles.geometry.Point)=>void):void; - /** - * - * @param listener - */ - removeBendLocationChangedListener(listener:(source:any,bend:yfiles.graph.IBend,oldLocation:yfiles.geometry.Point)=>void):void; - /** - * - * @param listener - */ - addBendTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeBendTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addLabelAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - removeLabelAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - addLabelRemovedListener(listener:(sender:any,evt:yfiles.graph.LabelEventArgs)=>void):void; - /** - * - * @param listener - */ - removeLabelRemovedListener(listener:(sender:any,evt:yfiles.graph.LabelEventArgs)=>void):void; - /** - * - * @param listener - */ - addLabelStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeLabelStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addLabelPreferredSizeChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeLabelPreferredSizeChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addLabelTextChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeLabelTextChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addLabelLayoutParameterChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeLabelLayoutParameterChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addLabelTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removeLabelTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addPortAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - removePortAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - addPortRemovedListener(listener:(sender:any,evt:yfiles.graph.PortEventArgs)=>void):void; - /** - * - * @param listener - */ - removePortRemovedListener(listener:(sender:any,evt:yfiles.graph.PortEventArgs)=>void):void; - /** - * - * @param listener - */ - addPortStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removePortStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addPortLocationParameterChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removePortLocationParameterChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addPortTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - removePortTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * - * @param listener - */ - addDisplaysInvalidatedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * - * @param listener - */ - removeDisplaysInvalidatedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * - * @type {yfiles.graph.IMapperRegistry} - */ - mapperRegistry:yfiles.graph.IMapperRegistry; - /** - * - * @type {yfiles.graph.INodeDefaults} - */ - groupNodeDefaults:yfiles.graph.INodeDefaults; - /** - * - * @param listener - */ - addParentChangedListener(listener:(sender:any,evt:yfiles.graph.NodeEventArgs)=>void):void; - /** - * - * @param listener - */ - removeParentChangedListener(listener:(sender:any,evt:yfiles.graph.NodeEventArgs)=>void):void; - /** - * - * @param listener - */ - addIsGroupNodeChangedListener(listener:(sender:any,evt:yfiles.graph.NodeEventArgs)=>void):void; - /** - * - * @param listener - */ - removeIsGroupNodeChangedListener(listener:(sender:any,evt:yfiles.graph.NodeEventArgs)=>void):void; - /** - * - * @type {any} - */ - tag:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.GraphWrapperBase; - } - /** - * The interface used in an {@link yfiles.graph.IGraph} implementation to control the layout of {@link yfiles.graph.IEdge edges}. - *

- * This interface provides read-only access to the properties of a bend. In order to modify the state of an instance use - * the various methods provided by the {@link yfiles.graph.IGraph} this instance belongs to. Bends are stored in {@link yfiles.collections.IListEnumerable.}s, that can be - * obtained from the {@link yfiles.graph.IEdge} implementation that owns this bend. Like all items in an IGraph, this item supports - * the {@link yfiles.graph.ILookup#lookup} method that can be used to query additional aspects of the item. - *

- *

- * The graph model with all relevant types and their relationships is presented in detail in the section {@link @DGUIDE_PREFIX@/graph.html The Graph Model}. - *

- *

- * Using the look-up mechanism is explained in the section {@link @DGUIDE_PREFIX@/customizing_concepts_lookup.html Service Locator Pattern: Lookup}. - *

- * @interface - * @implements {yfiles.graph.IModelItem} - */ - export interface IBend extends yfiles.lang.Object,yfiles.graph.IModelItem{ - /** - * Gets the edge this bend instance belongs to. - *

- * This implies that Owner.Bends contains this instance. - *

- * @abstract - * @type {yfiles.graph.IEdge} - */ - owner:yfiles.graph.IEdge; - /** - * Gets a view of the location of the bend in the world coordinate system. - *

- * The {@link yfiles.geometry.IPoint#x} and {@link yfiles.geometry.IPoint#y} properties describe the location of the bend in the world coordinate system. This property is a live view of - * the location and will be updated in the future if the location changes. To keep the current state of the location, - * callers need to create a copy of it - *

- * @see yfiles.geometry.IPoint#toPoint - * @abstract - * @type {yfiles.geometry.IPoint} - */ - location:yfiles.geometry.IPoint; - /** - * Gets the index of the bend at its {@link yfiles.graph.IBend#owner}. - * @type {number} - */ - index?:number; - } - var IBend:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IBend; - }; - /** - * The interface used to model edges in an {@link yfiles.graph.IGraph} implementation. - *

- * This interface provides read-only access to the properties of an edge. In order to modify the state of an instance use - * the various methods provided by the {@link yfiles.graph.IGraph} this instance belongs to. An edge connects to two ports and may - * consist of a number of bends. Also it can have zero or more labels. This interface combines the functionality of {@link yfiles.graph.IPortOwner} - * to get access to the ports that edges can optionally have, {@link yfiles.graph.ILabelOwner} to get access to the labels, and, - * like all items in an IGraph, edges support the {@link yfiles.graph.ILookup#lookup} method inherited from the {@link yfiles.graph.IModelItem} - * interface that can be used to query additional aspects of each instance. - *

- *

- * The graph model with all relevant types and their relationships is presented in detail in the section {@link @DGUIDE_PREFIX@/graph.html The Graph Model}. - *

- *

- * Using the look-up mechanism is explained in the section {@link @DGUIDE_PREFIX@/customizing_concepts_lookup.html Service Locator Pattern: Lookup}. - *

- * @interface - * @implements {yfiles.graph.IPortOwner} - * @implements {yfiles.graph.ILabelOwner} - * @implements {yfiles.graph.IModelItem} - */ - export interface IEdge extends yfiles.lang.Object,yfiles.graph.IPortOwner,yfiles.graph.ILabelOwner,yfiles.graph.IModelItem{ - /** - * Gets the opposite port of an {@link yfiles.graph.IEdge}. - * @param port The port that the {@link } is connected to. - * @returns The opposite port. - * @throws {Stubs.Exceptions.ArgumentError} If port is neither the source or target of the edge. - */ - opposite?(port:yfiles.graph.IPort):yfiles.graph.IPort; - /** - * Gets the opposite port owner of an {@link yfiles.graph.IEdge}. - * @param owner The owner of the port that the {@link } is connected to. - * @returns The owner of the opposite port. - * @throws {Stubs.Exceptions.ArgumentError} If owner is neither the source or target of the edge. - */ - opposite?(owner:yfiles.graph.IPortOwner):yfiles.graph.IPortOwner; - /** - * Gets a collection of {@link yfiles.graph.IBend bends} that describe the geometry of this edge. - *

- * This gives access to a read-only live view of the bends, i.e. the collection can change over time, as well as the bends - * contained in it. If a snapshot of the current state is needed, one needs to copy the collection. In order to modify the - * bend collection of an edge, use the {@link yfiles.graph.IGraph#addBend various methods} in {@link yfiles.graph.IGraph}. - *

- * @abstract - * @type {yfiles.collections.IListEnumerable.} - */ - bends:yfiles.collections.IListEnumerable; - /** - * Gets the source port instance this edge is connected to. - *

- * Although the notion of source and target port is used for directed edges, it is still up to the client to decide whether - * the edge should be treated as such. - *

- * @abstract - * @type {yfiles.graph.IPort} - */ - sourcePort:yfiles.graph.IPort; - /** - * Gets the target port instance this edge is connected to. - *

- * Although the notion of source and target port is used for directed edges, it is still up to the client to decide whether - * the edge should be treated as such. - *

- * @abstract - * @type {yfiles.graph.IPort} - */ - targetPort:yfiles.graph.IPort; - /** - * Gets the style that is responsible for the visual representation of this edge in a {@link yfiles.view.CanvasComponent}. - *

- * In order to set the style on an instance, use the {@link yfiles.graph.IGraph#setStyle} method. Note that the style instance - * associated with an edge instance may be shared between multiple edge instances and that the modification of this style - * will result in a change of the appearance of all edges that are associated with the same style instance. - *

- * @abstract - * @type {yfiles.styles.IEdgeStyle} - */ - style:yfiles.styles.IEdgeStyle; - /** - * Gets the source node for the given edge or null. - * @type {yfiles.graph.INode} - */ - sourceNode?:yfiles.graph.INode; - /** - * Gets the target node for the given edge or null. - * @type {yfiles.graph.INode} - */ - targetNode?:yfiles.graph.INode; - /** - * Determines whether an {@link yfiles.graph.IEdge edge} is a self-loop, that is, it starts and ends at the same port owner. - * @type {boolean} - */ - isSelfloop?:boolean; - } - var IEdge:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IEdge; - }; - /** - * Interface used by {@link yfiles.graph.IGraph} to declare and obtain the defaults for edges and their labels and ports. - *

- * Note that changing these defaults does not change properties of already created model items. Rather, only items created - * after the change are affected. - *

- * @see yfiles.graph.IGraph#edgeDefaults - * @interface - */ - export interface IEdgeDefaults extends yfiles.lang.Object{ - /** - * Factory method that returns a style instance for use with newly created edges. - *

- * Most implementations will yield either, a {@link yfiles.lang.ICloneable#clone clone} of or the {@link yfiles.graph.IEdgeDefaults#style} property, if {@link yfiles.graph.IEdgeDefaults#shareStyleInstance} is enabled, but they might use more complicated - * logic, too. - *

- * @returns The style to use, which for most implementations is either a {@link #clone clone} of or the {@link #style} property, if {@link #shareStyleInstance} is enabled. - * @abstract - */ - getStyleInstance():yfiles.styles.IEdgeStyle; - /** - * Gets or sets the defaults for ports at edges. - *

- * Note that these are not the {@link yfiles.graph.IEdge#sourcePort}s or {@link yfiles.graph.IEdge#targetPort}s, because conceptually they belong to the nodes (and their - * {@link yfiles.graph.INodeDefaults}), but rather for ports at edges to which other edges can connect. - *

- * @abstract - * @type {yfiles.graph.IPortDefaults} - */ - ports:yfiles.graph.IPortDefaults; - /** - * Gets or sets the defaults for labels at edges. - * @abstract - * @type {yfiles.graph.ILabelDefaults} - */ - labels:yfiles.graph.ILabelDefaults; - /** - * Gets or sets the style to use for edges. - *

- * Depending on the setting of {@link yfiles.graph.IEdgeDefaults#shareStyleInstance}, the {@link yfiles.graph.IEdgeDefaults#getStyleInstance} method should return a {@link yfiles.lang.ICloneable#clone clone} of this - * instance or the very same instance. - *

- * @see yfiles.graph.IEdgeDefaults#shareStyleInstance - * @abstract - * @type {yfiles.styles.IEdgeStyle} - */ - style:yfiles.styles.IEdgeStyle; - /** - * Gets or sets a value indicating whether the {@link yfiles.graph.IEdgeDefaults#style} instance should be shared referentially or {@link yfiles.lang.ICloneable#clone cloned} upon a call to - * {@link yfiles.graph.IEdgeDefaults#getStyleInstance}. - * @see yfiles.graph.IEdgeDefaults#getStyleInstance - * @see yfiles.graph.IEdgeDefaults#style - * @abstract - * @type {boolean} - */ - shareStyleInstance:boolean; - } - var IEdgeDefaults:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IEdgeDefaults; - }; - /** - * Interface that is used for manipulating a {@link yfiles.graph.FoldingManager#createFoldingView managed view} of an {@link yfiles.graph.IGraph} that supports folding operations like {@link yfiles.graph.IFoldingView#expand expanding} - * and {@link yfiles.graph.IFoldingView#collapse collapsing} of nodes. - *

- * The {@link yfiles.graph.FoldingManager} creates views of a {@link yfiles.graph.FoldingManager#masterGraph} which is created using copies of the original "master" entities. The - * views are being synchronized via the {@link yfiles.graph.FoldingManager#masterGraph}, but may contain additional {@link yfiles.graph.FoldingManager#getFolderNodeState view state}. Typically nodes and edges are being copied - * from the {@link yfiles.graph.FoldingManager#masterGraph} and they share many of their properties by reference (e.g. {@link yfiles.graph.INode#style}). However if group nodes are being represented by - * {@link yfiles.graph.IFoldingView#collapse collapsed} group nodes in this view, they maintain a separate set of {@link yfiles.graph.ILabel labels}, {@link yfiles.graph.IPort ports}, {@link yfiles.graph.IBend bends}, and {@link yfiles.graph.INode#layout geometry}. This view-local - * state is shared between all views that have been {@link yfiles.graph.FoldingManager#createFoldingView created} by the same Manager and can be obtained and modified via the - * {@link yfiles.graph.FoldingManager}'s GetFoldingEdgeState methods for {@link yfiles.graph.FoldingManager#getFoldingEdgeState folding edges} and {@link yfiles.graph.FoldingManager#getFolderNodeState folder nodes} in the absence of a - * corresponding {@link yfiles.graph.IFoldingView} view instance. Developers typically don't need to implement this interface - * themselves, rather an implementation is provided by the framework and can be obtained from the - * {@link yfiles.graph.FoldingManager}. Use {@link yfiles.graph.FoldingManager#createFoldingView} to obtain an {@link yfiles.graph.IGraph} - * implementation that contains an implementation of this class in its {@link yfiles.graph.ILookup#lookup} method: - *

- *

- * This interface extends the {@link yfiles.lang.IPropertyObservable} interface. This can be used to easily monitor the {@link yfiles.graph.IFoldingView#invalid validity} of - * this view. Also changes to the {@link yfiles.graph.IFoldingView#localRoot} property will be published via this event. - *

- *

- * A brief description of the interface's API and some usage aspects is given in the section {@link @DGUIDE_PREFIX@/folding.html#folding-working_with_folding Working with Folding}. Class - * FoldingManager's central role for folding support in general is discussed in the section {@link @DGUIDE_PREFIX@/folding-technical_background.html Folding Revisited}. - *

- * @see yfiles.graph.FoldingManager - * @interface - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.lang.IPropertyObservable} - */ - export interface IFoldingView extends yfiles.lang.Object,yfiles.graph.ILookup,yfiles.lang.IPropertyObservable{ - /** - * This method will collapse the {@link yfiles.graph.IGraph#getChildren children} of a group node into the group node. - *

- * If a {@link yfiles.graph.IGraph#isGroupNode group} node that belongs to this view's hierarchy is in {@link yfiles.graph.IFoldingView#expand expanded} state, calling this method will remove the {@link yfiles.graph.IGraph#getChildren children} - * from this {@link yfiles.graph.IFoldingView#graph view}. This method will do nothing if the node is already collapsed. Note that collapsing a group node will - * make it a {@link yfiles.graph.IGraph#isGroupNode non-group} node in the hierarchy. The collapsed group node has its own separate set of attributes, which can be - * obtained using the {@link yfiles.graph.FoldingManager#getFolderNodeState} method. Therefore it may appear that the node changes - * its location during a collapse operation. This behavior ensures that collapsing a node does not modify the state of the - * model (only the state in the view is changed), but depending on the application this may confuse the user because he - * might loose his mental map of the diagram. In order to customize the behavior custom code can register with the {@link yfiles.graph.IFoldingView#addGroupCollapsedListener GroupCollapsed} - * event to perform the necessary modifications, like adjusting the view port or moving the node to the desired location. - *

- *

- * In addition to that this method can also be used for {@link yfiles.graph.FoldingManager#masterGraph master} nodes which are currently not represented in this view. In - * this case these nodes will be displayed as collapsed the next time they will be included in this view. - *

- * @param groupNode A group node that is part of the {@link #graph} or the {@link #masterGraph master graph}. - * @see yfiles.graph.IFoldingView#isExpanded - * @abstract - */ - collapse(groupNode:yfiles.graph.INode):void; - /** - * Directly creates a collapsed node on this instance with the given parameters. - *

- * This will implicitly create a new empty group node on the {@link yfiles.graph.FoldingManager#masterGraph} with the defaults for such a group node. The parent must be - * part of the {@link yfiles.graph.IFoldingView#graph Folded Graph View} or null to create a folder at the root of the current hierarchy. It will be converted into - * a group node if necessary. The returned {@link yfiles.graph.INode} is also part of the {@link yfiles.graph.IFoldingView#graph Folded Graph View}. - *

- * @param [parent=null] The parent node in the {@link #graph}, or null - * @param [layout=null] The layout for the collapsed node. - * @param [style=null] The style for the collapsed node - * @param [tag=null] The tag of the node. - * @returns A collapsed (folder) node that lives in {@link #graph} - * @abstract - */ - createFolderNode(parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:any):yfiles.graph.INode; - /** - * Directly creates a collapsed node on this instance with the given parameters. - *

- * This will implicitly create a new empty group node on the {@link yfiles.graph.FoldingManager#masterGraph} with the defaults for such a group node. The parent must be - * part of the {@link yfiles.graph.IFoldingView#graph Folded Graph View} or null to create a folder at the root of the current hierarchy. It will be converted into - * a group node if necessary. The returned {@link yfiles.graph.INode} is also part of the {@link yfiles.graph.IFoldingView#graph Folded Graph View}. - *

- * @param {Object} options The parameters to pass. - * @param [options.parent=null] The parent node in the {@link #graph}, or null - * @param [options.layout=null] The layout for the collapsed node. - * @param [options.style=null] The style for the collapsed node - * @param [options.tag=null] The tag of the node. - * @returns A collapsed (folder) node that lives in {@link #graph} - * @abstract - */ - createFolderNode(options:{parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object}):yfiles.graph.INode; - /** - * Disposes of this view explicitly. - *

- * Normally it is not necessary to do so, because the view will be garbage collected automatically. However if the view - * still displays contents, this might have unwanted negative side effects (group node sizes being calculated, etc.) A - * disposed of instance is not synchronized with the {@link yfiles.graph.FoldingManager} anymore and should not be used anymore. - *

- * @abstract - */ - dispose():void; - /** - * This method will expand a previously {@link yfiles.graph.IFoldingView#collapse collapsed} group node to make its contents appear in this view. - *

- * If a node that belongs to this view is in {@link yfiles.graph.IFoldingView#collapse collapsed} state, calling this method will make the {@link yfiles.graph.IGraph#getChildren children} appear in this - * {@link yfiles.graph.IFoldingView#graph view}. This method will do nothing if the node is already expanded. Note that expanding a collapsed group node will make - * the node a {@link yfiles.graph.IGraph#isGroupNode group node}, whereas a collapsed group node is no group node in this hierarchy and thus cannot have visible - * children. The expanded group node has its own separate set of attributes, which may be different from the collapsed - * state that can be obtained using the {@link yfiles.graph.FoldingManager#getFolderNodeState} method. The expanded state is always - * the same as the state of the {@link yfiles.graph.IFoldingView#getMasterItem master node}. Because of these differences it may appear that the node changes its location - * during an expand operation. This behavior ensures that expanding a node does not modify the state of the model by moving - * the node or its descendants (only the state in the view is changed), but depending on the application this may confuse - * the user because he might loose his mental map of the diagram. In order to customize the behavior custom code can - * register with the {@link yfiles.graph.IFoldingView#addGroupExpandedListener GroupExpanded} event to perform the - * necessary modifications, like adjusting the view port or moving the node and its descendants to the desired location. - *

- *

- * In addition to that this method can also be used for {@link yfiles.graph.FoldingManager#masterGraph master} nodes which are currently not represented in this view. In - * this case these nodes will be displayed as expanded the next time they will be included in this view. - *

- * @param groupNode A group node that is part of the {@link #graph} or the {@link #masterGraph master graph}. - * @see yfiles.graph.IFoldingView#isExpanded - * @see yfiles.graph.IFoldingView#collapse - * @abstract - */ - expand(groupNode:yfiles.graph.INode):void; - /** - * Helper method that corresponds to the {@link yfiles.graph.IFoldingView#getMasterItem} method, but is used for folding edges, - * only. - *

- * Since folding edges can represent more than one master edge, this method can be used to query all of the master edges - * that the provided folding edge represents. If the folding edge corresponds to a single master edge, the result will - * enumerate that edge, only. - *

- * @param foldingEdge The folding edge for which the master edges should be returned. - * @returns An enumerable that can enumerate all of the edges in the {@link #masterGraph} that are being represented by the folding edge in this {@link #graph view}. - * @see yfiles.graph.IFoldingEdgeFactory#addToExistingFoldingEdge - * @see yfiles.graph.IFoldingView#getViewItem - * @abstract - */ - getMasterEdges(foldingEdge:yfiles.graph.IEdge):yfiles.collections.IEnumerable; - /** - * Helper method that can be used to retrieve the original "master" items in the {@link yfiles.graph.FoldingManager#masterGraph} that is managed by the Manager associated - * with this view. - *

- * Since the {@link yfiles.graph.IFoldingView#graph} view that is associated with this instance maintains a copy of the entities in the Manager's {@link yfiles.graph.FoldingManager#masterGraph}, there is a - * mapping between elements that belong to this view's {@link yfiles.graph.IFoldingView#graph} and the elements in the master graph. This method can be called for - * the elements contained in this {@link yfiles.graph.IGraph} and will return the corresponding item in the master graph that the - * element corresponds to, if any. Note that for some items in the {@link yfiles.graph.IFoldingView#graph}, there is no master item in the {@link yfiles.graph.FoldingManager#masterGraph}, e.g. the {@link yfiles.graph.IPort} - * instances to which {@link yfiles.graph.FoldingEdgeStateId folding edges} connect have no corresponding ports in the master graph. The same holds true for the {@link yfiles.graph.IBend bends} - * and {@link yfiles.graph.ILabel labels} of folding edges and folder nodes. For folding edges, this method will yield the main representing edge in - * the master, if the folding edge represents more than one master edge. For nodes, the master node will be returned, no - * matter whether the node is currently {@link yfiles.graph.IFoldingView#collapse collapsed} or not. - *

- * Type parameter T: The type of the argument, which is typically {@link yfiles.graph.INode}, {@link yfiles.graph.IEdge}, {@link yfiles.graph.ILabel}, - * {@link yfiles.graph.IBend}, or {@link yfiles.graph.IPort}. - * @param item The item that is part of this {@link #graph} for which the original "master" item in the {@link #masterGraph} will be returned. - * @returns An item in the {@link #masterGraph} that corresponds to the item or null, if there is no such item. - * @see yfiles.graph.IFoldingView#getViewItem - * @template T - * @abstract - */ - getMasterItem(item:T):T; - /** - * Helper method that can be used to retrieve the items in this {@link yfiles.graph.IFoldingView#graph}-view for all items that are part of the {@link yfiles.graph.FoldingManager#masterGraph} that is - * associated with the Manager of this instance. - *

- * Since the {@link yfiles.graph.IFoldingView#graph} view that is associated with this instance maintains a copy of the entities in the Manager's {@link yfiles.graph.FoldingManager#masterGraph}, there is a - * mapping between elements that belong to master graph and the elements in the {@link yfiles.graph.IFoldingView#graph} of this view. This method can be called - * for the elements contained in this {@link yfiles.graph.FoldingManager#masterGraph master graph's} items and will return the corresponding item in this view's {@link yfiles.graph.IFoldingView#graph} if the - * element is represented by an item in this view. Note that for some items in the {@link yfiles.graph.FoldingManager#masterGraph}, there may be no item in the {@link yfiles.graph.IFoldingView#graph} instance, - * e.g. those elements which are part of a {@link yfiles.graph.IFoldingView#collapse collapsed} subtree in the {@link yfiles.graph.FoldingManager#masterGraph} hierarchy or those items that do not belong to the - * subtree that is induced by the {@link yfiles.graph.IFoldingView#localRoot} of this view. Also, for nodes and edges that are being represented by dummies in this - * view, labels, ports, and bends are not being represented directly by corresponding entities in this graph. If more than - * one edge is represented by a folding edge in this view, this method will yield the same folding edge instance for each - * of them. - *

- * Type parameter T: The type of the argument, which is typically {@link yfiles.graph.INode}, {@link yfiles.graph.IEdge}, {@link yfiles.graph.ILabel}, - * {@link yfiles.graph.IBend}, or {@link yfiles.graph.IPort}. - * @param item An item that is part of the {@link #masterGraph} that is associated with the Manager of this instance. - * @returns An item in the {@link #graph local graph view} that corresponds to the item or - * null, if the item is not currently being represented in this view. - * @see yfiles.graph.IFoldingView#getMasterItem - * @see yfiles.graph.IFoldingView#getMasterEdges - * @template T - * @abstract - */ - getViewItem(item:T):T; - /** - * Determines whether the provided node is currently expanded or will be displayed in - * {@link yfiles.graph.IFoldingView#expand}ed state the next time it will be included in this view. - *

- * Expanded group nodes will have all of their {@link yfiles.graph.IGraph#getChildren children} visible in this {@link yfiles.graph.IFoldingView#graph view}. - *

- *

- * The groupNode can be either a node of the {@link yfiles.graph.IFoldingView#graph view} or the {@link yfiles.graph.FoldingManager#masterGraph master graph}. If the node is from the master graph and is - * currently not represented in this view, this method will return the - * {@link yfiles.graph.IFoldingView#expand}ed state it will have the next time it will be included in this view. - *

- * @param groupNode The group node for which the {@link #expand expanded} state will be returned. - * @returns true, if the group node can be {@link #collapse collapsed}. - * @abstract - */ - isExpanded(groupNode:yfiles.graph.INode):boolean; - /** - * Determines whether the specified item is a folding state in this view. - *

- * This method can be used to determine if an {@link yfiles.graph.INode}, {@link yfiles.graph.IEdge}, {@link yfiles.graph.IPort}, - * {@link yfiles.graph.ILabel}, or {@link yfiles.graph.IBend} has a {@link yfiles.graph.FoldingManager#getFolderNodeState view local state} and is not a direct copy of the {@link yfiles.graph.IFoldingView#getMasterItem master item}, if any. - * Note that {@link yfiles.graph.IFoldingView#collapse collapsed} group nodes are in folding state, even though they do have a {@link yfiles.graph.IFoldingView#getMasterItem master} item in the master graph and - * folding edges always have at least one - * {@link yfiles.graph.IFoldingView#getMasterEdges master edge}, while all other folding items don't have a corresponding master item in the master graph. - *

- * @param item One of the items that are {@link #contains contained} in the {@link #graph}. - * @returns Whether the item is in folding state and is not an exact copy of an item in the {@link #masterGraph}. - * @abstract - */ - isInFoldingState(item:yfiles.graph.IModelItem):boolean; - /** - * Adds the given listener for the GroupCollapsed event that occurs whenever a group has been - * {@link yfiles.graph.IFoldingView#collapse}d. - * @param listener The listener to add. - * @see yfiles.graph.IFoldingView#removeGroupCollapsedListener - * @abstract - */ - addGroupCollapsedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the GroupCollapsed event that occurs whenever a group has been - * {@link yfiles.graph.IFoldingView#collapse}d. - * @param listener The listener to remove. - * @see yfiles.graph.IFoldingView#addGroupCollapsedListener - * @abstract - */ - removeGroupCollapsedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the GroupExpanded event that occurs whenever a group has been - * {@link yfiles.graph.IFoldingView#expand}ed. - * @param listener The listener to add. - * @see yfiles.graph.IFoldingView#removeGroupExpandedListener - * @abstract - */ - addGroupExpandedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the GroupExpanded event that occurs whenever a group has been - * {@link yfiles.graph.IFoldingView#expand}ed. - * @param listener The listener to remove. - * @see yfiles.graph.IFoldingView#addGroupExpandedListener - * @abstract - */ - removeGroupExpandedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Gets the {@link yfiles.graph.IGraph} implementation that provides the actual view data. - *

- * The instance has an implementation of this interface in its {@link yfiles.graph.ILookup} that has been obtained from the - * {@link yfiles.graph.FoldingManager}'s {@link yfiles.graph.FoldingManager#createFoldingView} set of methods. The instance holds the - * elements in the view only, which in general is a subset of the {@link yfiles.graph.FoldingManager#masterGraph}. Also note that the elements are not the same references - * as their {@link yfiles.graph.IFoldingView#getMasterItem masters}, they are copies that may share the same attributes. - *

- * @abstract - * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - /** - * Gets or sets whether this instance should automatically switch the {@link yfiles.graph.IFoldingView#localRoot} to an ancestor of the current root, if this view - * becomes {@link yfiles.graph.IFoldingView#invalid}. - *

- * By default this property is set to true which assures that this view will never become - * {@link yfiles.graph.IFoldingView#invalid}. It is the responsibility of the client code to check for the validity of this view before trying to modify it if this - * feature is disabled. - *

- * @abstract - * @type {boolean} - */ - autoSwitchToAncestor:boolean; - /** - * Gets whether this view is currently valid and can be edited. - *

- * A view is invalid if the {@link yfiles.graph.IFoldingView#localRoot} is not currently part of the {@link yfiles.graph.FoldingManager#masterGraph} hierarchy. This can happen if the root node is removed from the - * {@link yfiles.graph.FoldingManager#masterGraph}. Note that the view can become valid again if the removal is undone. - *

- * @see yfiles.graph.IFoldingView#autoSwitchToAncestor - * @abstract - * @type {boolean} - */ - invalid:boolean; - /** - * Gets or sets whether changes to the {@link yfiles.graph.IFoldingView#localRoot} property and calls to {@link yfiles.graph.IFoldingView#collapse} and {@link yfiles.graph.IFoldingView#expand} - * should be recorded in undo history. - *

- * By default this property is set to false, however depending on the use case it may make sense to enqueue - * {@link yfiles.graph.IUndoUnit}s for this type of operations. - *

- * @see yfiles.graph.IFoldingView#autoSwitchToAncestor - * @abstract - * @type {boolean} - */ - enqueueNavigationalUndoUnits:boolean; - /** - * Gets or sets an entity of the {@link yfiles.graph.FoldingManager#masterGraph} hierarchy to serve as the virtual root for the view's local hierarchy. - *

- * This property can be set to any {@link yfiles.graph.IGraph#isGroupNode group} node in the - * {@link yfiles.graph.FoldingManager#masterGraph}'s hierarchy whose contents will then be represented in this view. Note that the root of the view's local hierarchy is - * not set to the same instance. - *

- * @abstract - * @type {yfiles.graph.INode} - */ - localRoot:yfiles.graph.INode; - /** - * Provides access to the manager that created this view and that contains a reference to the {@link yfiles.graph.FoldingManager#masterGraph}. - * @type {yfiles.graph.FoldingManager} - */ - manager?:yfiles.graph.FoldingManager; - } - var IFoldingView:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IFoldingView; - }; - export enum AdjacencyTypes{ - /** - * Neither {@link yfiles.graph.AdjacencyTypes#INCOMING} nor {@link yfiles.graph.AdjacencyTypes#OUTGOING} - */ - NONE, - /** - * The constant for incoming edges. - *

- * An edge that is incoming at its owner has the owner as its target. - *

- */ - INCOMING, - /** - * The constant for outgoing edges. - *

- * An edge that is outgoing from its owner has the owner as its source. - *

- */ - OUTGOING, - /** - * Both {@link yfiles.graph.AdjacencyTypes#INCOMING} and {@link yfiles.graph.AdjacencyTypes#OUTGOING} - */ - ALL - } - export enum GraphItemTypes{ - /** - * Constant for nodes. - * @see yfiles.graph.INode - */ - NODE, - /** - * Constant for edges. - * @see yfiles.graph.IEdge - */ - EDGE, - /** - * Constant for node labels. - * @see yfiles.graph.ILabel - */ - NODE_LABEL, - /** - * Constant for edge labels. - * @see yfiles.graph.ILabel - */ - EDGE_LABEL, - /** - * Constant for ports. - * @see yfiles.graph.IPort - */ - PORT, - /** - * Constant for all kinds of labels. - *

- * This is a bitwise combination of {@link yfiles.graph.GraphItemTypes#NODE_LABEL} and {@link yfiles.graph.GraphItemTypes#EDGE_LABEL}. - *

- * @see yfiles.graph.ILabel - */ - LABEL, - /** - * Constant for all kinds of {@link yfiles.graph.ILabelOwner}. - *

- * This is a bitwise combination of {@link yfiles.graph.GraphItemTypes#NODE} and {@link yfiles.graph.GraphItemTypes#EDGE}. - *

- * @see yfiles.graph.ILabelOwner - */ - LABEL_OWNER, - /** - * Constant for edge bends. - * @see yfiles.graph.IBend - */ - BEND, - /** - * Constant for all item types. - *

- * This is a bitwise combination of all other types declared in this enum. - *

- */ - ALL, - /** - * Constant for no item type. - *

- * This is a constant where no type bit has been set, i.e. it is 0. - *

- */ - NONE - } - /** - * Central interface that models a graph which can be displayed in a {@link yfiles.view.CanvasComponent canvas} or {@link yfiles.view.GraphComponent}. - *

- * This interface can be used to query structural information, it also offers methods that change the structure of the - * graph and its attributes. A number of events will trigger appropriate events if the structure of the graph changes. - *

- *

- * The graph is made up of collections of {@link yfiles.graph.INode nodes} and {@link yfiles.graph.IEdge edges}. Each node and edge can be associated with a number of {@link yfiles.graph.ILabel labels} and - * possibly {@link yfiles.graph.IPort ports} to which edges connect. An edge connects to two ports and may consist of zero or more {@link yfiles.graph.IBend bends}. The graph is - * treated as a directed graph, i.e. edges have a {@link yfiles.graph.IEdge#sourcePort source port} and a - * {@link yfiles.graph.IEdge#targetPort target port}. It is up to the algorithms and the visualization to possibly treat them as undirected. - *

- *

- * This interface also provides support for hierarchically organized, i.e. grouped graphs. This means that nodes together - * with their connecting edges can be {@link yfiles.graph.IGraph#setParent put into} other nodes. The containing node is referred to as a "group node." To create - * and edit group nodes interactively use the {@link yfiles.input.GraphEditorInputMode} as input mode and enable the - * {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations grouping operations}. - *

- *

- * The {@link yfiles.graph.IGraph#edgesAt} and {@link yfiles.graph.IGraph#edgesAt} methods can be used to query adjacency information from - * the graph's structure. - *

- *

- * Each element in the graph can be associated with a style that is used for the visualization of the element. Styles can - * be shared between multiple instances. - *

- *

- * To associate data with the elements in the graph, code can make use of the {@link yfiles.graph.ITagOwner#tag} property that all {@link yfiles.graph.IModelItem}s - * provide. In order to associate more than one data element with the graph items, compound data objects can be used. - * Alternatively the {@link yfiles.graph.IMapperRegistry} that can be obtained from the {@link yfiles.graph.IGraph#mapperRegistry} property can be used to associate - * arbitrary data sets with the items in this graph. - *

- *

- * This interface provides a number of events that can be used to get notified for changes in the graph structure. These - * events are raised whenever the corresponding state change occurs, e.g. also when loading the graph from a file. If you - * are only interested in changes that are triggered interactively, you should subscribe to the corresponding events on the - * {@link yfiles.input.IInputMode} implementations that implement the user interaction. Especially, you may not modify the graph - * structure in handlers for these event, e.g. try to prevent or undo the change that has raised the event. - *

- *

- * The graph model with all relevant types and their relationships is presented in detail in the section {@link @DGUIDE_PREFIX@/graph.html The Graph Model}. - *

- *

- * More information on visual styles can be found in the section {@link @DGUIDE_PREFIX@/view_visualization-graph-elements.html Visualization of Graph Elements}. - *

- * @see yfiles.graph.DefaultGraph - * @see yfiles.graph.INode - * @see yfiles.graph.IEdge - * @see yfiles.graph.IPort - * @see yfiles.graph.ILabel - * @see yfiles.graph.IBend - * @see yfiles.graph.IMapperRegistry - * @interface - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.graph.ITagOwner} - */ - export interface IGraph extends yfiles.lang.Object,yfiles.graph.ILookup,yfiles.graph.ITagOwner{ - /** - * Adds a bend at the given index to the given edge using the coordinates provided. - *

- * The added instance will be returned. - *

- * @param edge The edge to which the bend will be added. - * @param location the coordinates to use for the newly created bend - * @param [index=-1] The index for the newly added bend; a negative value (which is the default) indicates that the bend should be appended - * to the end of the list of bends. - * @returns a newly created live bend - * @throws {Stubs.Exceptions.ArgumentError} edge is not in this graph. - * @see yfiles.graph.IGraph#remove - * @see yfiles.graph.IGraph#setBendLocation - * @abstract - */ - addBend(edge:yfiles.graph.IEdge,location:yfiles.geometry.Point,index?:number):yfiles.graph.IBend; - /** - * Adds bends with the given locations to the end of the bend list of the given edge. - * @param edge The edge to add the bends to. - * @param locations The locations of the bends. - * @throws {Stubs.Exceptions.ArgumentError} edge is not in this graph. - */ - addBends?(edge:yfiles.graph.IEdge,locations:yfiles.collections.IEnumerable):void; - /** - * Add a label to the given node or edge using the text as the initial label text and label model parameter, style and - * tag. - * @param owner The node or edge to add the label to. - * @param text The initial text of the label - * @param [layoutParameter=null] The label model parameter instance to use. - * @param [style=null] The style to use for the label - * @param [preferredSize=null] The initial values to use for the {@link #preferredSize}. - * @param [tag=null] The initial {@link #tag} to assign. - * @returns the newly created label - * @throws {Stubs.Exceptions.ArgumentError} owner is not in this graph. - * @see yfiles.graph.IGraph#addLabelAddedListener - * @see yfiles.graph.IGraph#setLabelText - * @see yfiles.graph.IGraph#setLabelLayoutParameter - * @see yfiles.graph.IGraph#setStyle - * @see yfiles.styles.VoidLabelStyle#INSTANCE - * @abstract - */ - addLabel(owner:yfiles.graph.ILabelOwner,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,preferredSize?:yfiles.geometry.Size,tag?:any):yfiles.graph.ILabel; - /** - * Add a label to the given node or edge using the text as the initial label text and label model parameter, style and - * tag. - * @param {Object} options The parameters to pass. - * @param options.owner The node or edge to add the label to. - * @param options.text The initial text of the label - * @param [options.layoutParameter=null] The label model parameter instance to use. - * @param [options.style=null] The style to use for the label - * @param [options.preferredSize=null] The initial values to use for the {@link #preferredSize}. - * @param [options.tag=null] The initial {@link #tag} to assign. - * @returns the newly created label - * @throws {Stubs.Exceptions.ArgumentError} owner is not in this graph. - * @see yfiles.graph.IGraph#addLabelAddedListener - * @see yfiles.graph.IGraph#setLabelText - * @see yfiles.graph.IGraph#setLabelLayoutParameter - * @see yfiles.graph.IGraph#setStyle - * @see yfiles.styles.VoidLabelStyle#INSTANCE - * @abstract - */ - addLabel(options:{owner:yfiles.graph.ILabelOwner,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,preferredSize?:yfiles.geometry.Size,tag?:Object}):yfiles.graph.ILabel; - /** - * Add a port to the given port owner using the location model parameter, style and tag. - *

- * The locationParameter determines the location of the port. - *

- *

- * An implementation may throw an {@link yfiles.lang.Exception} if the type of the owner instance does not support adding of - * ports. - *

- * @param owner the owner to add the port instance to. - * @param [locationParameter=null] the parameter to use for the port to determine its location. - * @param [style=null] the style to initially assign to the {@link #style} property, e.g. {@link #INSTANCE}. - * @param [tag=null] the initial {@link #tag} to assign. - * @returns the newly created port - * @throws {Stubs.Exceptions.NotSupportedError} If this instance cannot add a port to owner. - * @throws {Stubs.Exceptions.ArgumentError} owner is not in this graph. - * @see yfiles.graph.IGraph#addPortAddedListener - * @see yfiles.styles.VoidPortStyle#INSTANCE - * @abstract - */ - addPort(owner:yfiles.graph.IPortOwner,locationParameter?:yfiles.graph.IPortLocationModelParameter,style?:yfiles.styles.IPortStyle,tag?:any):yfiles.graph.IPort; - /** - * Add a port to the given port owner using the location model parameter, style and tag. - *

- * The locationParameter determines the location of the port. - *

- *

- * An implementation may throw an {@link yfiles.lang.Exception} if the type of the owner instance does not support adding of - * ports. - *

- * @param {Object} options The parameters to pass. - * @param options.owner the owner to add the port instance to. - * @param [options.locationParameter=null] the parameter to use for the port to determine its location. - * @param [options.style=null] the style to initially assign to the {@link #style} property, e.g. {@link #INSTANCE}. - * @param [options.tag=null] the initial {@link #tag} to assign. - * @returns the newly created port - * @throws {Stubs.Exceptions.NotSupportedError} If this instance cannot add a port to owner. - * @throws {Stubs.Exceptions.ArgumentError} owner is not in this graph. - * @see yfiles.graph.IGraph#addPortAddedListener - * @see yfiles.styles.VoidPortStyle#INSTANCE - * @abstract - */ - addPort(options:{owner:yfiles.graph.IPortOwner,locationParameter?:yfiles.graph.IPortLocationModelParameter,style?:yfiles.styles.IPortStyle,tag?:Object}):yfiles.graph.IPort; - /** - * Add a port to the given port owner using the absolute coordinates as the new initial position of the port anchor. - * @param owner the owner to add the port instance to. - * @param location the location to use for the port to determine its location. This is passed to the {@link #createDefaultPortLocationParameter} - * method to determine the initial {@link } to use. - * @param [style=null] the style to initially assign to the {@link #style} property, e.g. {@link #INSTANCE}. - * @param [tag=null] the initial {@link #tag} to assign. - * @returns the newly created port - * @throws {Stubs.Exceptions.NotSupportedError} If this instance cannot add a port to owner. - * @throws {Stubs.Exceptions.ArgumentError} owner is not in this graph. - */ - addPortAt?(owner:yfiles.graph.IPortOwner,location:yfiles.geometry.Point,style?:yfiles.styles.IPortStyle,tag?:any):yfiles.graph.IPort; - /** - * Add a port to the given port owner using the absolute coordinates as the new initial position of the port anchor. - * @param {Object} options The parameters to pass. - * @param options.owner the owner to add the port instance to. - * @param options.location the location to use for the port to determine its location. This is passed to the {@link #createDefaultPortLocationParameter} - * method to determine the initial {@link } to use. - * @param [options.style=null] the style to initially assign to the {@link #style} property, e.g. {@link #INSTANCE}. - * @param [options.tag=null] the initial {@link #tag} to assign. - * @returns the newly created port - * @throws {Stubs.Exceptions.NotSupportedError} If this instance cannot add a port to owner. - * @throws {Stubs.Exceptions.ArgumentError} owner is not in this graph. - */ - addPortAt?(options:{owner:yfiles.graph.IPortOwner,location:yfiles.geometry.Point,style?:yfiles.styles.IPortStyle,tag?:Object}):yfiles.graph.IPort; - /** - * Adds a new port to the graph at the node using a location that is relative to the center of the node. - *

- * The port style for the newly-created port is taken from the graph's defaults. The location parameter is determined by - * delegating to {@link yfiles.graph.IGraph#addPortAt}. - *

- * @param node The owner of the port. - * @param relativeLocation The offset of the port relative to the center of the {@link #layout}. - * @returns The newly added port instance. - * @throws {Stubs.Exceptions.ArgumentError} node is not in this graph. - */ - addRelativePort?(node:yfiles.graph.INode,relativeLocation:yfiles.geometry.Point):yfiles.graph.IPort; - /** - * Convenience method that uses the {@link yfiles.graph.UndoEngine} from the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup} to - * {@link yfiles.graph.UndoEngine#addUnit add a unit}. - * @param undoName The name of the undo operation. - * @param redoName The name of the redo operation. - * @param undo The undo action. - * @param redo The redo action. - */ - addUndoUnit?(undoName:string,redoName:string,undo:()=>void,redo:()=>void):void; - /** - * Method to adjust the size of a group node. - *

- * This will resize the group node bounds such that the node requires the least amount of space. If the node does not have - * any {@link yfiles.graph.IGraph#getChildren children}, its bounds will be left unchanged. This will also respect any {@link yfiles.input.INodeSizeConstraintProvider}s - * for {@link yfiles.graph.INode}s, that are available in the lookup of the groupNode. - *

- * @param groupNode The group node to adjust the size of. - * @throws {Stubs.Exceptions.ArgumentError} groupNode is not in this graph. - * @see yfiles.graph.IGroupBoundsCalculator - * @see yfiles.input.INodeSizeConstraintProvider - * @see yfiles.graph.GroupingSupport#calculateMinimumEnclosedArea - * @see yfiles.graph.GroupingSupport#enlargeGroupNode - * @see yfiles.graph.GroupingSupport#enlargeAllGroupNodes - */ - adjustGroupNodeLayout?(groupNode:yfiles.graph.INode):void; - /** - * Adjusts the {@link yfiles.graph.ILabel#preferredSize} property of a label to fit the suggested size of its {@link yfiles.styles.ILabelStyleRenderer}. - *

- * This implementation uses the {@link yfiles.graph.ILabel#style style's} renderer for the label to determine the preferred rendering size. This is useful - * after the label's content or style have been changed. - *

- * @param label The label to adjust the size for. - * @see yfiles.graph.ILabelDefaults#autoAdjustPreferredSize - */ - adjustLabelPreferredSize?(label:yfiles.graph.ILabel):void; - /** - * Convenience method that runs a layout on a graph using {@link yfiles.layout.LayoutGraphAdapter#applyLayout}. - * @param layout The layout. - * @param [layoutData=null] The layout data. - * @see yfiles.view.GraphComponent#morphLayout - */ - applyLayout?(layout:yfiles.layout.ILayoutAlgorithm,layoutData?:yfiles.layout.LayoutData):void; - /** - * Starts an {@link yfiles.graph.ICompoundEdit} that uses the {@link yfiles.graph.IMementoSupport memento design pattern} to record changes to the items in the given items - * collection. - *

- * This method uses the {@link yfiles.graph.IMementoSupport} returned by the provider to record the state of an item at the - * beginning of the edit and when {@link yfiles.graph.ICompoundEdit#commit} is called to create an {@link yfiles.graph.IUndoUnit} that can - * revert the item to the recorded state and back. If no provider is given, this method uses the {@link yfiles.graph.IMementoSupport} - * returned by the {@link yfiles.graph.ILookup#lookup} implementation of the items to record the state of an item at the beginning - * of the edit and when {@link yfiles.graph.ICompoundEdit#commit} is called to create an {@link yfiles.graph.IUndoUnit} that can revert the - * item to the recorded state and back. - *

- *

- * Calling this method will immediately enqueue an {@link yfiles.graph.IUndoUnit} into the undo queue. Subsequent additions to the - * queue will be added after the created instance, even if they are added to the queue before the {@link yfiles.graph.ICompoundEdit#commit} - * method has been called. - *

- *

- * The following is an example implementation of an item that is being managed using {@link yfiles.graph.IMementoSupport}: - *

- *

- * A collection of items from this type can then be watched using the following code snippet: - *

- *

- * Alternatively, when using a specific provider, consider the following examples. The following is an example - * implementation of an item that is being managed using {@link yfiles.graph.IMementoSupport}: - *

- *

- * A collection of items from this type can then be watched using the following code snippet, using the provider to return - * an appropriate {@link yfiles.graph.IMementoSupport} implementation: - *

- *

- * Implementing the {@link yfiles.graph.IMementoSupport} interface is quite unrestrained, the type of the state returned by {@link yfiles.graph.IMementoSupport#getState} - * method can by anything as long as the {@link yfiles.graph.IMementoSupport#applyState} and {@link yfiles.graph.IMementoSupport#stateEquals} - * methods can deal with it: - *

- *

- * In summary, use this concept when you want to track the state of items during certain operations for undo/redo. This is - * efficient if it's easier to handle an item's state than the changes to the item themselves. If you want to focus on the - * changes or on certain events, you should use custom {@link yfiles.graph.IUndoUnit} - *

- * Type parameter T: The type of the items that will be modified subsequently. - * @param undoName The {@link #undoName} of the {@link } that will be placed into the undo queue after {@link #commit} has - * been called. - * @param redoName The {@link #redoName} of the {@link } that will be placed into the undo queue after {@link #commit} has - * been called. - * @param items The items that will be changed after this call and before the call to {@link #commit}. - * @param [provider=null] The provider for the {@link } of the items. if the provider returns null for a given item, changes - * to this item are not being recorded. - * @returns An implementation of the {@link } interface whose {@link #commit} or {@link #cancel} - * methods need to be called after the items have been modified. - * @see yfiles.graph.IMementoSupport - * @template T - */ - beginEdit?(undoName:string,redoName:string,items:yfiles.collections.IEnumerable,provider?:(item:T)=>yfiles.graph.IMementoSupport):yfiles.graph.ICompoundEdit; - /** - * Starts an {@link yfiles.graph.ICompoundEdit} that records graph changes and {@link yfiles.graph.IGraph#addUndoUnit custom undo units} in a single compound unit. - *

- * This method can be used to bracket several undo units. All edits added to the queue after this call and before a call to - * {@link yfiles.graph.ICompoundEdit#cancel} or {@link yfiles.graph.ICompoundEdit#commit} will be placed into the queue as a single block. - *

- *

- * Client code needs to make sure that either the {@link yfiles.graph.ICompoundEdit#cancel} or {@link yfiles.graph.ICompoundEdit#commit} - * method is called on the returned instance. - *

- * @param undoName The undo name for the compound edit. - * @param redoName The redo name for the compound edit. - * @returns The handle to stop the recording by calling {@link #cancel} or {@link #commit} on - * it. - */ - beginEdit?(undoName:string,redoName:string):yfiles.graph.ICompoundEdit; - /** - * Calculates the preferred size of a label with the given properties. - * @param owner The item that will own the label. - * @param text The text. - * @param [layoutParameter=null] The label model parameter. - * @param [style=null] The label style. - * @param [tag=null] The tag for the label. - * @returns The size as calculated by the {@link }. - */ - calculateLabelPreferredSize?(owner:yfiles.graph.ILabelOwner,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,tag?:any):yfiles.geometry.Size; - /** - * Calculates the preferred size of a label with the given properties. - * @param {Object} options The parameters to pass. - * @param options.owner The item that will own the label. - * @param options.text The text. - * @param [options.layoutParameter=null] The label model parameter. - * @param [options.style=null] The label style. - * @param [options.tag=null] The tag for the label. - * @returns The size as calculated by the {@link }. - */ - calculateLabelPreferredSize?(options:{owner:yfiles.graph.ILabelOwner,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,tag?:Object}):yfiles.geometry.Size; - /** - * Clears the graph, removing all items in proper order. - * @see yfiles.graph.IGraph#remove - */ - clear?():void; - /** - * Removes all bends from the given edge. - *

- * The edge must be part of this graph at the time of the invocation. This will trigger the corresponding events. - *

- * @param edge the edge whose bends will be removed - * @throws {Stubs.Exceptions.ArgumentError} edge is not in this graph. - * @see yfiles.graph.IGraph#remove - * @see yfiles.graph.IGraph#addBendRemovedListener - */ - clearBends?(edge:yfiles.graph.IEdge):void; - /** - * Determines whether this graph contains the specified item. - * @param item The item. - * @returns true if this graph contains the specified item; otherwise, false. - * @abstract - */ - contains(item:yfiles.graph.IModelItem):boolean; - /** - * Creates the label layout parameter for a given {@link yfiles.graph.ILabelOwner}. - *

- * This implementation uses the {@link yfiles.graph.IGraph#getLabelDefaults label defaults} for the graph to {@link yfiles.graph.ILabelDefaults#getLayoutParameterInstance obtain the parameter instance}. - *

- * @param owner The item that is the {@link #owner} of the label in question. - * @returns The default label layout parameter to use for newly created labels at the item. - * @see yfiles.graph.ILabelDefaults#getLayoutParameterInstance - * @see yfiles.graph.IGraph#getLabelDefaults - */ - createDefaultLabelLayoutParameter?(owner:yfiles.graph.ILabelOwner):yfiles.graph.ILabelModelParameter; - /** - * Creates a location model parameter for a newly created {@link yfiles.graph.IPort} at the owner that matches the location. - *

- * If location is null, this method uses the {@link yfiles.graph.IGraph#getPortDefaults port defaults} for the owner to obtain the {@link yfiles.graph.IPortDefaults#getLocationParameterInstance location parameter}. - *

- * @param owner The owner of the port. - * @param [location=null] The location in the world coordinate system where the port should be added. - * @returns Either a location model parameter that matches the location, or the default parameter to use for the {@link } - * as returned by {@link #getLocationParameterInstance}. - * @see yfiles.graph.IPortLocationModel#createParameter - * @see yfiles.graph.IGraph#getPortDefaults - */ - createDefaultPortLocationParameter?(owner:yfiles.graph.IPortOwner,location?:yfiles.geometry.Point):yfiles.graph.IPortLocationModelParameter; - /** - * Convenience method that creates and returns an edge that connects to the given node instances using the given style - * instance. - *

- * The nodes must be part of this graph at the time of the invocation, and an implementation can choose the {@link yfiles.graph.IPort} - * instances to which the edge will be connected. The edge will be a part of this graph after the method returns. This will - * trigger the corresponding events. - *

- * @param source The source node the created edge will connect to. It is up to the implementation to decide which port to use at the - * given node. An implementation may create a new port of the edge. - * @param target The target node the created edge will connect to. It is up to the implementation to decide which port to use at the - * given node. An implementation may create a new port of the edge. - * @param [style=null] The style instance that will be assigned to the newly created instance. This is done by reference. - * @param [tag=null] The initial value of the {@link #tag} that will be assigned to the new edge. - * @returns the newly created edge instance - * @see yfiles.graph.IGraph#addEdgeCreatedListener - * @see yfiles.styles.VoidEdgeStyle#INSTANCE - * @abstract - */ - createEdge(source:yfiles.graph.INode,target:yfiles.graph.INode,style?:yfiles.styles.IEdgeStyle,tag?:any):yfiles.graph.IEdge; - /** - * Convenience method that creates and returns an edge that connects to the given node instances using the given style - * instance. - *

- * The nodes must be part of this graph at the time of the invocation, and an implementation can choose the {@link yfiles.graph.IPort} - * instances to which the edge will be connected. The edge will be a part of this graph after the method returns. This will - * trigger the corresponding events. - *

- * @param {Object} options The parameters to pass. - * @param options.source The source node the created edge will connect to. It is up to the implementation to decide which port to use at the - * given node. An implementation may create a new port of the edge. - * @param options.target The target node the created edge will connect to. It is up to the implementation to decide which port to use at the - * given node. An implementation may create a new port of the edge. - * @param [options.style=null] The style instance that will be assigned to the newly created instance. This is done by reference. - * @param [options.tag=null] The initial value of the {@link #tag} that will be assigned to the new edge. - * @param options.labels An array of labels to add to the newly created node. Each item will be passed to the {@link #addLabel} - * method. - * @param options.ports An array of ports to add to the newly created node. Each item will be passed to the {@link #addPort} method. - * @param options.bends An array of bends to add to the newly created edge. Each item will be passed to the {@link #addBend} method. - * @returns the newly created edge instance - * @see yfiles.graph.IGraph#addEdgeCreatedListener - * @see yfiles.styles.VoidEdgeStyle#INSTANCE - * @abstract - */ - createEdge(options:{source:yfiles.graph.INode,target:yfiles.graph.INode,style?:yfiles.styles.IEdgeStyle,tag?:Object,labels?:Array,ports?:Array,bends?:Array}):yfiles.graph.IEdge; - /** - * Creates and returns an edge that connects to the given port instances. - *

- * The ports must be part of this graph at the time of the invocation. The edge will be a part of this graph after the - * method returns. This will trigger the corresponding events. - *

- * @param sourcePort The source port the created edge will connect to. - * @param targetPort The target port the created edge will connect to. - * @param [style=null] The style instance that will be assigned to the newly created instance. This is done by reference. - * @param [tag=null] The initial value of the {@link #tag} that will be assigned to the new edge. - * @returns the newly created edge instance - * @see yfiles.graph.IGraph#addEdgeCreatedListener - * @see yfiles.styles.VoidEdgeStyle#INSTANCE - * @abstract - */ - createEdge(sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort,style?:yfiles.styles.IEdgeStyle,tag?:any):yfiles.graph.IEdge; - /** - * Creates and returns an edge that connects to the given port instances. - *

- * The ports must be part of this graph at the time of the invocation. The edge will be a part of this graph after the - * method returns. This will trigger the corresponding events. - *

- * @param {Object} options The parameters to pass. - * @param options.sourcePort The source port the created edge will connect to. - * @param options.targetPort The target port the created edge will connect to. - * @param [options.style=null] The style instance that will be assigned to the newly created instance. This is done by reference. - * @param [options.tag=null] The initial value of the {@link #tag} that will be assigned to the new edge. - * @param options.labels An array of labels to add to the newly created node. Each item will be passed to the {@link #addLabel} - * method. - * @param options.ports An array of ports to add to the newly created node. Each item will be passed to the {@link #addPort} method. - * @param options.bends An array of bends to add to the newly created edge. Each item will be passed to the {@link #addBend} method. - * @returns the newly created edge instance - * @see yfiles.graph.IGraph#addEdgeCreatedListener - * @see yfiles.styles.VoidEdgeStyle#INSTANCE - * @abstract - */ - createEdge(options:{sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort,style?:yfiles.styles.IEdgeStyle,tag?:Object,labels?:Array,ports?:Array,bends?:Array}):yfiles.graph.IEdge; - /** - * Creates a new group node using the provided style and layout as a child of parent. - *

- * The group node will be a direct descendant of parent. - *

- *

- * To create group nodes interactively use the {@link yfiles.input.GraphEditorInputMode} as input mode and enable the - * {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations grouping operations}. - *

- * @param [parent=null] The node to use as the parent in the grouping hierarchy or null if the new node should become a top-level node. - * @param [layout=null] The initial layout to use for the new node. - * @param [style=null] The style to use for the new node. - * @param [tag=null] The {@link #tag} to assign to the {@link }. - * @returns The newly created group node. - * @abstract - */ - createGroupNode(parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:any):yfiles.graph.INode; - /** - * Creates a new group node using the provided style and layout as a child of parent. - *

- * The group node will be a direct descendant of parent. - *

- *

- * To create group nodes interactively use the {@link yfiles.input.GraphEditorInputMode} as input mode and enable the - * {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations grouping operations}. - *

- * @param {Object} options The parameters to pass. - * @param [options.parent=null] The node to use as the parent in the grouping hierarchy or null if the new node should become a top-level node. - * @param [options.layout=null] The initial layout to use for the new node. - * @param [options.style=null] The style to use for the new node. - * @param [options.tag=null] The {@link #tag} to assign to the {@link }. - * @param options.labels An array of labels to add to the newly created node. Each item will be passed to the {@link #addLabel} - * method. - * @param options.ports An array of ports to add to the newly created node. Each item will be passed to the {@link #addPort} method. - * @param options.children An array of nodes to create as child nodes of this group node. Each item will be passed to the {@link #createNode} - * method. - * @returns The newly created group node. - * @abstract - */ - createGroupNode(options:{parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object,labels?:Array,ports?:Array,children?:Array}):yfiles.graph.INode; - /** - * Creates and returns a node using the specified values for the initial geometry, style, and {@link yfiles.graph.ITagOwner#tag}. - *

- * The node will be a part of this graph after the method returns. This will trigger the corresponding events. - *

- * @param layout The layout to use initially. The values will be copied to the node's {@link #layout Layout} field - * @param [style=null] The style instance that will be assigned to the newly created instance. This is done by reference. - * @param [tag=null] The initial value of the {@link #tag} that will be assigned to the new node. - * @returns A newly created node instance - * @see yfiles.graph.IGraph#addNodeCreatedListener - * @see yfiles.styles.VoidNodeStyle#INSTANCE - * @abstract - */ - createNode(layout:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:any):yfiles.graph.INode; - /** - * Creates and returns a node using the specified values for the initial geometry, style, and {@link yfiles.graph.ITagOwner#tag}. - *

- * The node will be a part of this graph after the method returns. This will trigger the corresponding events. - *

- * @param {Object} options The parameters to pass. - * @param options.layout The layout to use initially. The values will be copied to the node's {@link #layout Layout} field - * @param [options.style=null] The style instance that will be assigned to the newly created instance. This is done by reference. - * @param [options.tag=null] The initial value of the {@link #tag} that will be assigned to the new node. - * @param options.labels An array of labels to add to the newly created node. Each item will be passed to the {@link #addLabel} - * method. - * @param options.ports An array of ports to add to the newly created node. Each item will be passed to the {@link #addPort} method. - * @returns A newly created node instance - * @see yfiles.graph.IGraph#addNodeCreatedListener - * @see yfiles.styles.VoidNodeStyle#INSTANCE - * @abstract - */ - createNode(options:{layout:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object,labels?:Array,ports?:Array}):yfiles.graph.INode; - /** - * Creates a new ordinary node as a direct descendant of parent using the given layout and style. - * @param [parent=null] The node to use as the parent in the grouping hierarchy or null if the new node should become a top-level node. - * @param [layout=null] The layout to use initially. The values will be copied to the node's {@link #layout Layout} field. - * @param [style=null] The style instance that will be assigned to the newly created instance. This is done by reference. - * @param [tag=null] The {@link #tag} to assign to the {@link }. - * @returns The newly created node. - * @throws {Stubs.Exceptions.ArgumentError} parent is not in this graph. - * @see yfiles.graph.IGraph#setParent - * @see yfiles.graph.IGraph#createNode - * @see yfiles.graph.IGraph#createGroupNode - * @abstract - */ - createNode(parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:any):yfiles.graph.INode; - /** - * Creates a new ordinary node as a direct descendant of parent using the given layout and style. - * @param {Object} options The parameters to pass. - * @param [options.parent=null] The node to use as the parent in the grouping hierarchy or null if the new node should become a top-level node. - * @param [options.layout=null] The layout to use initially. The values will be copied to the node's {@link #layout Layout} field. - * @param [options.style=null] The style instance that will be assigned to the newly created instance. This is done by reference. - * @param [options.tag=null] The {@link #tag} to assign to the {@link }. - * @param options.labels An array of labels to add to the newly created node. Each item will be passed to the {@link #addLabel} - * method. - * @param options.ports An array of ports to add to the newly created node. Each item will be passed to the {@link #addPort} method. - * @returns The newly created node. - * @throws {Stubs.Exceptions.ArgumentError} parent is not in this graph. - * @see yfiles.graph.IGraph#setParent - * @see yfiles.graph.IGraph#createNode - * @see yfiles.graph.IGraph#createGroupNode - * @abstract - */ - createNode(options:{parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object,labels?:Array,ports?:Array}):yfiles.graph.INode; - /** - * Creates and returns a node using the specified initial center location and style, as well as the tag. - *

- * The node will be a part of this graph after the method returns. This will trigger the corresponding events. - *

- * @param location the initial coordinates of the center of the node's {@link #layout Layout} property - * @param [style=null] The style instance that will be assigned to the newly created instance. This is done by reference. - * @param [tag=null] The initial value of the {@link #tag} that will be assigned to the new node. - * @returns A newly created node instance - * @see yfiles.graph.IGraph#addNodeCreatedListener - */ - createNodeAt?(location:yfiles.geometry.Point,style?:yfiles.styles.INodeStyle,tag?:any):yfiles.graph.INode; - /** - * Creates and returns a node using the specified initial center location and style, as well as the tag. - *

- * The node will be a part of this graph after the method returns. This will trigger the corresponding events. - *

- * @param {Object} options The parameters to pass. - * @param options.location the initial coordinates of the center of the node's {@link #layout Layout} property - * @param [options.style=null] The style instance that will be assigned to the newly created instance. This is done by reference. - * @param [options.tag=null] The initial value of the {@link #tag} that will be assigned to the new node. - * @param options.labels An array of labels to add to the newly created node. Each item will be passed to the {@link #addLabel} - * method. - * @param options.ports An array of ports to add to the newly created node. Each item will be passed to the {@link #addPort} method. - * @returns A newly created node instance - * @see yfiles.graph.IGraph#addNodeCreatedListener - */ - createNodeAt?(options:{location:yfiles.geometry.Point,style?:yfiles.styles.INodeStyle,tag?:Object,labels?:Array,ports?:Array}):yfiles.graph.INode; - /** - * Calculates the number of edges at the given {@link yfiles.graph.IPort} for this graph. - *

- * Note that an edge that is both incoming and outgoing will be counted twice. - *

- * @param port The port owner to count the degree of. - * @returns The number of edges that are incident to the port. - * @throws {Stubs.Exceptions.ArgumentError} port is not in this graph. - */ - degree?(port:yfiles.graph.IPort):number; - /** - * Calculates the number of edges at the given {@link yfiles.graph.IPortOwner} for this graph. - *

- * Note that an edge that is both incoming and outgoing will be counted twice. - *

- * @param owner The port owner to count the degree of. - * @returns The number of edges that are incident to the port owner. - * @throws {Stubs.Exceptions.ArgumentError} owner is not in this graph. - */ - degree?(owner:yfiles.graph.IPortOwner):number; - /** - * Returns an {@link yfiles.collections.IListEnumerable.} for all edges that have the given port owner as their {@link yfiles.graph.IEdge#targetPort target port's} or {@link yfiles.graph.IEdge#sourcePort source port's} {@link yfiles.graph.IPort#owner} depending on the - * {@link yfiles.graph.AdjacencyTypes} - *

- * Note that even though edges can be accessed via index, the underlying graph structure in the default {@link yfiles.graph.IGraph} - * implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the edges in - * your own list, if possible. This is not necessary for the first or last element or when iterating over the adjacent - * edges via a foreach loop. - *

- * @param [type=yfiles.graph.AdjacencyTypes.ALL] The type of adjacency to consider. - * @param owner the port owner to check - * @returns An enumeration of all adjacent edges of the given type. - * @throws {Stubs.Exceptions.ArgumentError} owner is not in this graph. - * @see yfiles.graph.IGraph#inEdgesAt - * @see yfiles.graph.IGraph#outEdgesAt - * @see yfiles.graph.AdjacencyTypes - * @abstract - */ - edgesAt(owner:yfiles.graph.IPortOwner,type?:yfiles.graph.AdjacencyTypes):yfiles.collections.IListEnumerable; - /** - * Returns an {@link yfiles.collections.IEnumerable.} for all edges that are adjacent to the given port as a {@link yfiles.graph.IEdge#sourcePort} or {@link yfiles.graph.IEdge#targetPort}. - *

- * Note that even though edges can be accessed via index, the underlying graph structure in the default {@link yfiles.graph.IGraph} - * implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the edges in - * your own list, if possible. This is not necessary for the first or last element or when iterating over the adjacent - * edges via a foreach loop. - *

- * @param port the port to check - * @param [type=yfiles.graph.AdjacencyTypes.ALL] The type of adjacency to consider. - * @returns An enumeration of all adjacent edges of the given type. - * @throws {Stubs.Exceptions.ArgumentError} port is not in this graph. - * @see yfiles.graph.IGraph#inEdgesAt - * @see yfiles.graph.IGraph#outEdgesAt - * @see yfiles.graph.AdjacencyTypes - * @abstract - */ - edgesAt(port:yfiles.graph.IPort,type?:yfiles.graph.AdjacencyTypes):yfiles.collections.IListEnumerable; - /** - * Returns an enumerable over the children of the provided node. - * @param node The node for which to return the children or null if the top-level nodes should be returned. - * @returns All nodes that have node as their {@link #getParent parent}. - * @throws {Stubs.Exceptions.ArgumentError} node is not in this graph. - * @abstract - */ - getChildren(node:yfiles.graph.INode):yfiles.collections.IListEnumerable; - /** - * Finds an edge that connects sourcePort and targetPort in the given graph. - * @param sourcePort The {@link #sourcePort} of the edge to find. - * @param targetPort The {@link #targetPort} of the edge to find. - * @returns An edge that satisfies the constraints or null, if none was found. - * @throws {Stubs.Exceptions.ArgumentError} sourcePort or targetPort are not in this graph. - */ - getEdge?(sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):yfiles.graph.IEdge; - /** - * Finds an edge that connects from and to in the given graph. - * @param from The {@link #sourcePort} owner of the edge to find. - * @param to The {@link #targetPort} owner of the edge to find. - * @returns An edge that satisfies the constraints or null, if none was found. - * @throws {Stubs.Exceptions.ArgumentError} from or to are not in this graph. - */ - getEdge?(from:yfiles.graph.IPortOwner,to:yfiles.graph.IPortOwner):yfiles.graph.IEdge; - /** - * Gets the {@link yfiles.graph.ILabelDefaults label defaults} for a given {@link yfiles.graph.ILabelOwner} in the context of the graph. - * @param owner The item that the label defaults are returned for. If this is a group node, the {@link #groupNodeDefaults}'s {@link #labels label defaults} will be returned, - * otherwise the {@link #nodeDefaults} or {@link #edgeDefaults} {@link #labels labels} will be returned. - * @returns Appropriate {@link } for the provided owner. - */ - getLabelDefaults?(owner:yfiles.graph.ILabelOwner):yfiles.graph.ILabelDefaults; - /** - * Returns the parent node of the node or null if node is a top-level node. - * @param node The node to retrieve the parent node for. - * @returns The parent node in this hierarchy or null if node is a top-level node. - * @throws {Stubs.Exceptions.ArgumentError} node is not in this graph. - * @abstract - */ - getParent(node:yfiles.graph.INode):yfiles.graph.INode; - /** - * Gets the {@link yfiles.graph.IPortDefaults port defaults} for a given {@link yfiles.graph.IPortOwner} in the context of the graph. - * @param owner The item that the label defaults are returned for. If this is a group node, the {@link #groupNodeDefaults}'s {@link #ports port defaults} will be returned, - * otherwise the {@link #nodeDefaults} or {@link #edgeDefaults} {@link #ports ports} will be returned. - * @returns Appropriate {@link } for the provided owner. - */ - getPortDefaults?(owner:yfiles.graph.IPortOwner):yfiles.graph.IPortDefaults; - /** - * Groups the nodes in children into the provided group node. - *

- * The parent needs to be a group node at the time of the invocation. This operation is basically the same as calling {@link yfiles.graph.IGraph#setParent} - * for each node in children whose parent is not part of the set. - *

- * @param parent The node to use as the parent in the grouping hierarchy. - * @param children The children to group into the group node. - * @throws {Stubs.Exceptions.ArgumentError} parent or one of children is not in this graph. - * @see yfiles.graph.IGraph#groupNodes - * @see yfiles.graph.IGraph#setParent - * @see yfiles.graph.IGraph#createGroupNode - */ - groupNodes?(parent:yfiles.graph.INode,children:yfiles.collections.IEnumerable):void; - /** - * Groups the nodes in children into a newly created group node. - *

- * The group node will be created at the common ancestor level of all nodes in children. - *

- * @param children The children to group into the new group node. - * @returns The newly created group node. - * @throws {Stubs.Exceptions.ArgumentError} One of children is not in this graph. - * @see yfiles.graph.GroupingSupport#getNearestCommonAncestor - * @see yfiles.graph.IGraph#groupNodes - */ - groupNodes?(children:yfiles.collections.IEnumerable):yfiles.graph.INode; - /** - * Groups the nodes in children into a newly created group node. - *

- * The group node will be created at the common ancestor level of all nodes in children. - *

- * @param {Object} options The parameters to pass. - * @param options.children The children to group into the new group node. - * @param options.labels An array of labels to add to the newly created node. Each item will be passed to the {@link #addLabel} - * method. - * @param options.ports An array of ports to add to the newly created node. Each item will be passed to the {@link #addPort} method. - * @returns The newly created group node. - * @throws {Stubs.Exceptions.ArgumentError} One of children is not in this graph. - * @see yfiles.graph.GroupingSupport#getNearestCommonAncestor - * @see yfiles.graph.IGraph#groupNodes - */ - groupNodes?(options:{children:yfiles.collections.IEnumerable,labels?:Array,ports?:Array}):yfiles.graph.INode; - /** - * Calculates the number of incoming edges at the given {@link yfiles.graph.IPort} for this graph. - * @param port The port to count the incoming edges of. - * @returns The number of edges that have the port as their target port. - * @throws {Stubs.Exceptions.ArgumentError} port is not in this graph. - */ - inDegree?(port:yfiles.graph.IPort):number; - /** - * Calculates the number of incoming edges at the given {@link yfiles.graph.IPortOwner} for this graph. - * @param owner The port owner to count the incoming edges of. - * @returns The number of edges that have the port owner as their target port's owner. - * @throws {Stubs.Exceptions.ArgumentError} owner is not in this graph. - */ - inDegree?(owner:yfiles.graph.IPortOwner):number; - /** - * Convenience method that yields the incoming edges at the given port. - *

- * This method delegates to {@link yfiles.graph.IGraph#edgesAt} using {@link yfiles.graph.AdjacencyTypes#INCOMING}. - *

- *

- * Note that even though edges can be accessed via index, the underlying graph structure in the default {@link yfiles.graph.IGraph} - * implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the edges in - * your own list, if possible. This is not necessary for the first or last element or when iterating over the incoming - * edges via a foreach loop. - *

- * @param port The port of the edges. - * @returns An enumerable for the edges. - * @throws {Stubs.Exceptions.ArgumentError} port is not in this graph. - */ - inEdgesAt?(port:yfiles.graph.IPort):yfiles.collections.IListEnumerable; - /** - * Convenience method that yields the incoming edges at the given owner. - *

- * This method delegates to {@link yfiles.graph.IGraph#edgesAt} using {@link yfiles.graph.AdjacencyTypes#INCOMING}. - *

- *

- * Note that even though edges can be accessed via index, the underlying graph structure in the default {@link yfiles.graph.IGraph} - * implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the edges in - * your own list, if possible. This is not necessary for the first or last element or when iterating over the incoming - * edges via a foreach loop. - *

- * @param owner The owner of the edges. - * @returns An enumerable for the edges. - * @throws {Stubs.Exceptions.ArgumentError} owner is not in this graph. - */ - inEdgesAt?(owner:yfiles.graph.IPortOwner):yfiles.collections.IListEnumerable; - /** - * Causes the {@link yfiles.graph.IGraph#addDisplaysInvalidatedListener DisplaysInvalidated} event to be triggered. - *

- * This method may be called by client code to invalidate all views of the graph that have registered with the {@link yfiles.graph.IGraph#addDisplaysInvalidatedListener DisplaysInvalidated} - * event. Views that need to be informed if non-structural changes have been made to the graph should register with the - * corresponding event. - *

- * @abstract - */ - invalidateDisplays():void; - /** - * Returns whether the given node is considered a group node. - *

- * Group nodes may have {@link yfiles.graph.IGraph#getChildren children} but do not necessarily have to. - *

- * @param node The node to check. - * @returns Whether the node is considered a group node. - * @throws {Stubs.Exceptions.ArgumentError} node is not in this graph. - * @see yfiles.graph.IGraph#getChildren - * @see yfiles.graph.IGraph#setIsGroupNode - * @abstract - */ - isGroupNode(node:yfiles.graph.INode):boolean; - /** - * Enumerates the neighbors of a given {@link yfiles.graph.INode}. - *

- * Neighbors are calculated by going through all {@link yfiles.graph.IPortOwner#ports} and inspecting the {@link yfiles.graph.IGraph#edgesAt edges at these ports}, collecting the - * {@link yfiles.graph.IEdge#opposite}s. - *

- * @param node The node. - * @returns An enumerable over all neighbors. - * @throws {Stubs.Exceptions.ArgumentError} node is not in this graph. - */ - neighbors?(node:yfiles.graph.INode):yfiles.collections.IEnumerable; - /** - * Calculates the number of outgoing edges at the given {@link yfiles.graph.IPort} for this graph. - * @param port The port to count the outgoing edges of. - * @returns The number of edges that have the port as their source port. - * @throws {Stubs.Exceptions.ArgumentError} port is not in this graph. - */ - outDegree?(port:yfiles.graph.IPort):number; - /** - * Calculates the number of outgoing edges at the given {@link yfiles.graph.IPortOwner} for this graph. - * @param owner The port owner to count the outgoing edges of. - * @returns The number of edges that have the port owner as their source port's owner. - * @throws {Stubs.Exceptions.ArgumentError} owner is not in this graph. - */ - outDegree?(owner:yfiles.graph.IPortOwner):number; - /** - * Convenience method that yields the outgoing edges at the given port. - *

- * This method delegates to {@link yfiles.graph.IGraph#edgesAt} using {@link yfiles.graph.AdjacencyTypes#OUTGOING}. - *

- *

- * Note that even though edges can be accessed via index, the underlying graph structure in the default {@link yfiles.graph.IGraph} - * implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the edges in - * your own list, if possible. This is not necessary for the first or last element or when iterating over the outgoing - * edges via a foreach loop. - *

- * @param port The owner of the edges. - * @returns An enumerable for the edges. - * @throws {Stubs.Exceptions.ArgumentError} port is not in this graph. - */ - outEdgesAt?(port:yfiles.graph.IPort):yfiles.collections.IListEnumerable; - /** - * Convenience method that yields the outgoing edges at the given owner. - *

- * This method delegates to {@link yfiles.graph.IGraph#edgesAt} using {@link yfiles.graph.AdjacencyTypes#OUTGOING}. - *

- *

- * Note that even though edges can be accessed via index, the underlying graph structure in the default {@link yfiles.graph.IGraph} - * implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the edges in - * your own list, if possible. This is not necessary for the first or last element or when iterating over the outgoing - * edges via a foreach loop. - *

- * @param owner The owner of the edges. - * @returns An enumerable for the edges. - * @throws {Stubs.Exceptions.ArgumentError} owner is not in this graph. - */ - outEdgesAt?(owner:yfiles.graph.IPortOwner):yfiles.collections.IListEnumerable; - /** - * Enumerates the predecessors of a given {@link yfiles.graph.INode}. - *

- * Predecessors are calculated by going through all {@link yfiles.graph.IPortOwner#ports} and inspecting the {@link yfiles.graph.IGraph#inEdgesAt incoming edges at these ports}, collecting the {@link yfiles.graph.IEdge#sourcePort} {@link yfiles.graph.IPort#owner}s. - *

- * @param node The node. - * @returns An enumerable over all predecessors. - * @throws {Stubs.Exceptions.ArgumentError} node is not in this graph. - */ - predecessors?(node:yfiles.graph.INode):yfiles.collections.IEnumerable; - /** - * Removes the given {@link yfiles.graph.IModelItem item} from this graph. - *

- * The item must be a part of this graph. - *

- *

- * If the item is a {@link yfiles.graph.INode node} the {@link yfiles.graph.IGraph#addNodeRemovedListener NodeRemoved} event will be triggered. This - * will remove all adjacent edges and their corresponding ports in proper order before the node will be removed. Also this - * will trigger the removal of all labels owned by this instance. - *

- *

- * If the item is an {@link yfiles.graph.IEdge edge} the {@link yfiles.graph.IGraph#addEdgeRemovedListener EdgeRemoved} event will be triggered. An - * implementation may decide to remove the corresponding ports from the node if no other edge connects to them after the - * given edge has been removed. Also this will trigger the removal of all labels and bends owned by this instance. - *

- *

- * If the item is a {@link yfiles.graph.IBend bend} the {@link yfiles.graph.IGraph#addBendRemovedListener BendRemoved} event will be triggered. - *

- *

- * If the item is a {@link yfiles.graph.IPort port} the {@link yfiles.graph.IGraph#addPortRemovedListener PortRemoved} event will be triggered. This - * will also remove all edges that are currently connected to the port. - *

- *

- * If the item is a {@link yfiles.graph.ILabel label} the {@link yfiles.graph.IGraph#addLabelRemovedListener LabelRemoved} event will be triggered. - *

- * @param item the live item to be removed from this graph instance - * @throws {Stubs.Exceptions.ArgumentError} item is not in this graph. - * @abstract - */ - remove(item:yfiles.graph.IModelItem):void; - /** - * Reverses an edge by {@link yfiles.graph.IGraph#setEdgePorts setting source and target port} to {@link yfiles.graph.IEdge#targetPort} and {@link yfiles.graph.IEdge#sourcePort}. - *

- * This also reverses the bends by clearing them and reinserting them in reverse order if there is more than one bend. - *

- * @param edge The edge to reverse. - * @throws {Stubs.Exceptions.ArgumentError} edge is not in this graph. - */ - reverse?(edge:yfiles.graph.IEdge):void; - /** - * Modifies the location of the given bend. - * @param bend the bend whose location is to be modified - * @param location the new location of the bend - * @throws {Stubs.Exceptions.ArgumentError} bend is not in this graph. - * @see yfiles.graph.IGraph#addBend - * @abstract - */ - setBendLocation(bend:yfiles.graph.IBend,location:yfiles.geometry.Point):void; - /** - * Sets the ports of the given edge to the new values. - *

- * This will trigger an {@link yfiles.graph.IGraph#addEdgePortsChangedListener EdgePortsChanged} event if source or target ports - * differ from the current ones. Both ports and the edge must belong to the current graph instance. - *

- *

- * An implementation may decide to remove the corresponding ports if no other edge connects to them after the given edge - * has its source or target ports changed. - *

- * @param edge The edge to change the ports. - * @param sourcePort The new source port instance. - * @param targetPort The new target port instance. - * @throws {Stubs.Exceptions.ArgumentError} Either edge, sourcePort, or targetPort are not in this graph. - * @abstract - */ - setEdgePorts(edge:yfiles.graph.IEdge,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):void; - /** - * Determines whether the given node should be considered a group node. - *

- * Group nodes may have {@link yfiles.graph.IGraph#getChildren children} but do not necessarily need to have one. Attempting to set a node to the - * non-group-node-status while it has children at the same time will result in an {@link yfiles.lang.Exception}. - *

- * @param node The node to set the group node status for. - * @param isGroupNode Whether to make the node a group node. - * @throws {Stubs.Exceptions.ArgumentError} node is not in this graph. - * @throws {Stubs.Exceptions.InvalidOperationError} node is null or currently has children and isGroupNode is false. - * @see yfiles.graph.IGraph#getChildren - * @see yfiles.graph.IGraph#isGroupNode - * @abstract - */ - setIsGroupNode(node:yfiles.graph.INode,isGroupNode:boolean):void; - /** - * Sets the label model parameter for the given label. - * @param label The label. - * @param layoutParameter The new parameter. - * @throws {Stubs.Exceptions.ArgumentError} label is not in this graph, or layoutParameter cannot be used for label. - * @abstract - */ - setLabelLayoutParameter(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):void; - /** - * Sets the preferred size of the label. - * @param label The label. - * @param preferredSize The new preferred size. - * @throws {Stubs.Exceptions.ArgumentError} label is not in this graph. - * @see yfiles.graph.ILabel#preferredSize - * @abstract - */ - setLabelPreferredSize(label:yfiles.graph.ILabel,preferredSize:yfiles.geometry.Size):void; - /** - * Sets the label text of the given label. - * @param label the label to modify - * @param text the new text of the label - * @throws {Stubs.Exceptions.ArgumentError} label is not in this graph. - * @see yfiles.graph.ILabel#text - * @abstract - */ - setLabelText(label:yfiles.graph.ILabel,text:string):void; - /** - * Sets the center of a node to the given world coordinates. - *

- * This implementation delegates to {@link yfiles.graph.IGraph#setNodeLayout} - *

- * @param node The node to recenter. - * @param center The new center coordinates of the node in the world coordinate system. - */ - setNodeCenter?(node:yfiles.graph.INode,center:yfiles.geometry.Point):void; - /** - * Sets the layout of the given node to the new value. - * @param node a live node that belongs to this graph - * @param layout The new layout of the node to assign to its {@link #layout}. - * @throws {Stubs.Exceptions.ArgumentError} node is not in this graph. - * @see yfiles.graph.INode#layout - * @abstract - */ - setNodeLayout(node:yfiles.graph.INode,layout:yfiles.geometry.Rect):void; - /** - * Sets the parent node for a given node. - *

- * Use null as parent to make node a top-level node for this graph. - *

- * @param node The node to assign a new parent. - * @param parent The parent group node to assign to node or null to make node a top-level node. - * @throws {Stubs.Exceptions.ArgumentError} Either node or parent are not in this graph. - * @see yfiles.graph.IGraph#getParent - * @abstract - */ - setParent(node:yfiles.graph.INode,parent:yfiles.graph.INode):void; - /** - * Convenience method that tries to set the absolute coordinates of the given port to the given values. - *

- * For full control over the placement of the ports, the {@link yfiles.graph.IGraph#setPortLocationParameter} method should be used - * instead. This implementation will use the port's {@link yfiles.graph.IPort#locationParameter}'s {@link yfiles.graph.IPortLocationModelParameter#model} to obtain a new {@link yfiles.graph.IPortLocationModelParameter} via the {@link yfiles.graph.IPortLocationModel#createParameter} - * method. This might result in the port using a different location, because the model might not support parameters that - * result in the given location. This will also trigger an {@link yfiles.graph.IGraph#invalidateDisplays} call. - *

- * @param port The port to modify - * @param location the new absolute coordinates of the port - * @throws {Stubs.Exceptions.ArgumentError} port is not in this graph. - * @see yfiles.graph.IGraph#addPort - */ - setPortLocation?(port:yfiles.graph.IPort,location:yfiles.geometry.Point):void; - /** - * Sets a new {@link yfiles.graph.IPortLocationModelParameter} for the given port. - * @param port The port to modify - * @param locationParameter the new parameter that determines the coordinates of the port - * @throws {Stubs.Exceptions.ArgumentError} port is not in this graph, or locationParameter cannot be used for port. - * @abstract - */ - setPortLocationParameter(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):void; - /** - * Tries to set the location of the port relative to its {@link yfiles.graph.IPort#owner owner} if the owner is a {@link yfiles.graph.INode node}. - *

- * If the port is not owned by a node that is part of this graph, this method will throw an {@link yfiles.lang.Exception}. This - * method will delegate to {@link yfiles.graph.IGraph#setPortLocation}. - *

- * @param port the port - * @param relativeLocation the new coordinate offsets relative to the center of the node's {@link #layout}'s center. - * @throws {Stubs.Exceptions.ArgumentError} port is not in this graph or has no owner. - * @see yfiles.graph.INode#layout - */ - setRelativePortLocation?(port:yfiles.graph.IPort,relativeLocation:yfiles.geometry.Point):void; - /** - * Assigns the given style instance by reference to the port. - *

- * Style instances can be shared. - *

- * @param port The port that will be assigned the new style - * @param style The style instance that will be assigned to the port. - * @throws {Stubs.Exceptions.ArgumentError} port is not in this graph. - * @see yfiles.graph.IPort#style - * @see yfiles.graph.IGraph#addPortStyleChangedListener - * @see yfiles.styles.VoidPortStyle#INSTANCE - * @abstract - */ - setStyle(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):void; - /** - * Assigns the given style instance by reference to the edge. - *

- * Style instances can be shared. - *

- * @param edge The edge that will be assigned the new style - * @param style The style instance that will be assigned to the edge. - * @throws {Stubs.Exceptions.ArgumentError} edge is not in this graph. - * @see yfiles.graph.IEdge#style - * @see yfiles.graph.IGraph#addEdgeStyleChangedListener - * @see yfiles.styles.VoidEdgeStyle#INSTANCE - * @abstract - */ - setStyle(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):void; - /** - * Assigns the given style instance by reference to the label. - *

- * Style instances can be shared. - *

- * @param label The label that will be assigned the new style - * @param style The style instance that will be assigned to the label. - * @throws {Stubs.Exceptions.ArgumentError} label is not in this graph. - * @see yfiles.graph.ILabel#style - * @see yfiles.graph.IGraph#addLabelStyleChangedListener - * @see yfiles.styles.VoidLabelStyle#INSTANCE - * @abstract - */ - setStyle(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):void; - /** - * Assigns the given style instance by reference to the node. - *

- * Style instances can be shared. - *

- * @param node The node that will be assigned the new style - * @param style The style instance that will be assigned to the node. - * @throws {Stubs.Exceptions.ArgumentError} node is not in this graph. - * @see yfiles.graph.INode#style - * @see yfiles.graph.IGraph#addNodeStyleChangedListener - * @see yfiles.styles.VoidNodeStyle#INSTANCE - * @abstract - */ - setStyle(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):void; - /** - * Enumerates the successors of a given {@link yfiles.graph.INode}. - *

- * Successors are calculated by going through all {@link yfiles.graph.IPortOwner#ports} and inspecting the {@link yfiles.graph.IGraph#outEdgesAt outgoing edges at these ports}, collecting the {@link yfiles.graph.IEdge#targetPort} {@link yfiles.graph.IPort#owner}s. - *

- * @param node The node. - * @returns An enumerable over all successors. - * @throws {Stubs.Exceptions.ArgumentError} node is not in this graph. - */ - successors?(node:yfiles.graph.INode):yfiles.collections.IEnumerable; - /** - * Gets a view of the nodes contained in this graph. - *

- * This is a live view of the nodes that always represents the current state of the graph. The same reference will be - * returned for each invocation. - *

- *

- * Note that even though nodes can be accessed via index, the underlying graph structure in the default {@link yfiles.graph.IGraph} - * implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the nodes in - * your own list, if possible. This is not necessary for the first or last element or when iterating over the nodes via a foreach - * loop. - *

- * @abstract - * @type {yfiles.collections.IListEnumerable.} - */ - nodes:yfiles.collections.IListEnumerable; - /** - * Gets a view of the edges contained in this graph. - *

- * This is a live view of the edges that always represents the current state of the graph. The same reference will be - * returned for each invocation. - *

- *

- * Note that even though edges can be accessed via index, the underlying graph structure in the default {@link yfiles.graph.IGraph} - * implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the edges in - * your own list, if possible. This is not necessary for the first or last element or when iterating over the edges via a foreach - * loop. - *

- * @abstract - * @type {yfiles.collections.IListEnumerable.} - */ - edges:yfiles.collections.IListEnumerable; - /** - * Gets a view of the node and edge labels contained in this graph. - *

- * This is a live view of the labels that always represents the current state of the graph. The same reference will be - * returned for each invocation. - *

- *

- * Note that even though labels can be accessed via index, the underlying graph structure in the default {@link yfiles.graph.IGraph} - * implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the labels in - * your own list, if possible. This is not necessary for the first or last element or when iterating over the labels via a - * foreach loop. - *

- * @abstract - * @type {yfiles.collections.IListEnumerable.} - */ - labels:yfiles.collections.IListEnumerable; - /** - * Gets a view of the ports contained in this graph. - *

- * This is a live view of the ports that always represents the current state of the graph. The same reference will be - * returned for each invocation. - *

- *

- * Note that even though ports can be accessed via index, the underlying graph structure in the default {@link yfiles.graph.IGraph} - * implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the ports in - * your own list, if possible. This is not necessary for the first or last element or when iterating over the ports via a foreach - * loop. - *

- * @abstract - * @type {yfiles.collections.IListEnumerable.} - */ - ports:yfiles.collections.IListEnumerable; - /** - * Gets or sets the defaults for normal nodes. - *

- * The settings that are obtained from the instance influence newly created elements only. Setting different defaults - * afterwards does not influence existing elements. - *

- * @abstract - * @type {yfiles.graph.INodeDefaults} - */ - nodeDefaults:yfiles.graph.INodeDefaults; - /** - * Gets or sets the defaults for normal edges. - *

- * The settings that are obtained from the instance influence newly created elements only. Setting different defaults - * afterwards does not influence existing elements. - *

- * @abstract - * @type {yfiles.graph.IEdgeDefaults} - */ - edgeDefaults:yfiles.graph.IEdgeDefaults; - /** - * Gets the mapper registry that is associated with this graph instance. - *

- * The registry can be used to store data mappings for the items in this instance. - *

- * @see yfiles.graph.IMapperRegistry - * @see yfiles.graph.IModelItem - * @see yfiles.graph.ITagOwner#tag - * @abstract - * @type {yfiles.graph.IMapperRegistry} - */ - mapperRegistry:yfiles.graph.IMapperRegistry; - /** - * Adds the given listener for the GraphTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of the graph has been replaced. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.ITagOwner#tag - * @see yfiles.graph.IGraph#removeGraphTagChangedListener - * @abstract - */ - addGraphTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Removes the given listener for the GraphTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of the graph has been replaced. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.ITagOwner#tag - * @see yfiles.graph.IGraph#addGraphTagChangedListener - * @abstract - */ - removeGraphTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Adds the given listener for the NodeCreated event that occurs when a node has been created. - *

- * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addNodeCreatedListener NodeCreated} - * event if you are interested only in node creation events that result from user interaction. - * Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the node creation - * that has triggered this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#createNode - * @see yfiles.graph.IGraph#createNode - * @see yfiles.graph.IGraph#createGroupNode - * @see yfiles.input.GraphEditorInputMode#addNodeCreatedListener - * @see yfiles.graph.IGraph#removeNodeCreatedListener - * @abstract - */ - addNodeCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the NodeCreated event that occurs when a node has been created. - *

- * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addNodeCreatedListener NodeCreated} - * event if you are interested only in node creation events that result from user interaction. - * Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the node creation - * that has triggered this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#createNode - * @see yfiles.graph.IGraph#createNode - * @see yfiles.graph.IGraph#createGroupNode - * @see yfiles.input.GraphEditorInputMode#addNodeCreatedListener - * @see yfiles.graph.IGraph#addNodeCreatedListener - * @abstract - */ - removeNodeCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the DisplaysInvalidated event that occurs when the graph has changed visually and the - * display should be updated to reflect the changes. - *

- * This event is invoked with {@link yfiles.lang.EventArgs#EMPTY} per default. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#removeDisplaysInvalidatedListener - * @abstract - */ - addDisplaysInvalidatedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the DisplaysInvalidated event that occurs when the graph has changed visually and the - * display should be updated to reflect the changes. - *

- * This event is invoked with {@link yfiles.lang.EventArgs#EMPTY} per default. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#addDisplaysInvalidatedListener - * @abstract - */ - removeDisplaysInvalidatedListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Adds the given listener for the NodeRemoved event that occurs when a node has been removed. - *

- * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} - * event if you are interested only in node removal events that result from user interaction. - * Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the node removal - * that has triggered this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#remove - * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener - * @see yfiles.graph.IGraph#removeNodeRemovedListener - * @abstract - */ - addNodeRemovedListener(listener:(sender:any,evt:yfiles.graph.NodeEventArgs)=>void):void; - /** - * Removes the given listener for the NodeRemoved event that occurs when a node has been removed. - *

- * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} - * event if you are interested only in node removal events that result from user interaction. - * Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the node removal - * that has triggered this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#remove - * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener - * @see yfiles.graph.IGraph#addNodeRemovedListener - * @abstract - */ - removeNodeRemovedListener(listener:(sender:any,evt:yfiles.graph.NodeEventArgs)=>void):void; - /** - * Adds the given listener for the NodeStyleChanged event that occurs when a node style has been replaced. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#setStyle - * @see yfiles.graph.IGraph#removeNodeStyleChangedListener - * @abstract - */ - addNodeStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Removes the given listener for the NodeStyleChanged event that occurs when a node style has been replaced. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#setStyle - * @see yfiles.graph.IGraph#addNodeStyleChangedListener - * @abstract - */ - removeNodeStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Adds the given listener for the NodeLayoutChanged event that occurs when a node layout has been changed. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#setNodeLayout - * @see yfiles.graph.IGraph#removeNodeLayoutChangedListener - * @abstract - */ - addNodeLayoutChangedListener(listener:(source:any,node:yfiles.graph.INode,oldLayout:yfiles.geometry.Rect)=>void):void; - /** - * Removes the given listener for the NodeLayoutChanged event that occurs when a node layout has been changed. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#setNodeLayout - * @see yfiles.graph.IGraph#addNodeLayoutChangedListener - * @abstract - */ - removeNodeLayoutChangedListener(listener:(source:any,node:yfiles.graph.INode,oldLayout:yfiles.geometry.Rect)=>void):void; - /** - * Adds the given listener for the NodeTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of a node has been replaced. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.ITagOwner#tag - * @see yfiles.graph.IGraph#removeNodeTagChangedListener - * @abstract - */ - addNodeTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Removes the given listener for the NodeTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of a node has been replaced. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.ITagOwner#tag - * @see yfiles.graph.IGraph#addNodeTagChangedListener - * @abstract - */ - removeNodeTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Adds the given listener for the EdgeCreated event that occurs when an edge has been created. - *

- * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.CreateEdgeInputMode#addEdgeCreatedListener EdgeCreated} - * event if you are interested only in edge creation events that result from user interaction. - * Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the edge creation - * that has triggered this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#createEdge - * @see yfiles.input.CreateEdgeInputMode#addEdgeCreatedListener - * @see yfiles.graph.IGraph#removeEdgeCreatedListener - * @abstract - */ - addEdgeCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the EdgeCreated event that occurs when an edge has been created. - *

- * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.CreateEdgeInputMode#addEdgeCreatedListener EdgeCreated} - * event if you are interested only in edge creation events that result from user interaction. - * Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the edge creation - * that has triggered this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#createEdge - * @see yfiles.input.CreateEdgeInputMode#addEdgeCreatedListener - * @see yfiles.graph.IGraph#addEdgeCreatedListener - * @abstract - */ - removeEdgeCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the EdgeRemoved event that occurs when an edge has been removed. - *

- * This event will be triggered, too, prior to a node removal. - *

- *

- * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} - * event if you are interested only in edge removal events that result from user interaction. - * Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the edge removal - * that has triggered this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#remove - * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener - * @see yfiles.graph.IGraph#removeEdgeRemovedListener - * @abstract - */ - addEdgeRemovedListener(listener:(sender:any,evt:yfiles.graph.EdgeEventArgs)=>void):void; - /** - * Removes the given listener for the EdgeRemoved event that occurs when an edge has been removed. - *

- * This event will be triggered, too, prior to a node removal. - *

- *

- * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} - * event if you are interested only in edge removal events that result from user interaction. - * Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the edge removal - * that has triggered this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#remove - * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener - * @see yfiles.graph.IGraph#addEdgeRemovedListener - * @abstract - */ - removeEdgeRemovedListener(listener:(sender:any,evt:yfiles.graph.EdgeEventArgs)=>void):void; - /** - * Adds the given listener for the EdgeStyleChanged event that occurs when an edge style has been replaced. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#setStyle - * @see yfiles.graph.IGraph#removeEdgeStyleChangedListener - * @abstract - */ - addEdgeStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Removes the given listener for the EdgeStyleChanged event that occurs when an edge style has been replaced. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#setStyle - * @see yfiles.graph.IGraph#addEdgeStyleChangedListener - * @abstract - */ - removeEdgeStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Adds the given listener for the EdgePortsChanged event that occurs when an edge had its {@link yfiles.graph.IEdge#sourcePort} or {@link yfiles.graph.IEdge#targetPort} {@link yfiles.graph.IGraph#setEdgePorts changed}. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#setEdgePorts - * @see yfiles.graph.IGraph#removeEdgePortsChangedListener - * @abstract - */ - addEdgePortsChangedListener(listener:(sender:any,evt:yfiles.graph.EdgeEventArgs)=>void):void; - /** - * Removes the given listener for the EdgePortsChanged event that occurs when an edge had its {@link yfiles.graph.IEdge#sourcePort} or {@link yfiles.graph.IEdge#targetPort} {@link yfiles.graph.IGraph#setEdgePorts changed}. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#setEdgePorts - * @see yfiles.graph.IGraph#addEdgePortsChangedListener - * @abstract - */ - removeEdgePortsChangedListener(listener:(sender:any,evt:yfiles.graph.EdgeEventArgs)=>void):void; - /** - * Adds the given listener for the EdgeTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of an edge has been replaced. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.ITagOwner#tag - * @see yfiles.graph.IGraph#removeEdgeTagChangedListener - * @abstract - */ - addEdgeTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Removes the given listener for the EdgeTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of an edge has been replaced. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.ITagOwner#tag - * @see yfiles.graph.IGraph#addEdgeTagChangedListener - * @abstract - */ - removeEdgeTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Adds the given listener for the BendAdded event that occurs when a bend has been added to an edge in this graph. - *

- * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.CreateBendInputMode#addBendCreatedListener BendCreated} - * event if you are interested only in bend creation events that result from user interaction. - * Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the bend creation - * that has triggered this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#addBend - * @see yfiles.input.CreateBendInputMode#addBendCreatedListener - * @see yfiles.graph.IGraph#removeBendAddedListener - * @abstract - */ - addBendAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the BendAdded event that occurs when a bend has been added to an edge in this graph. - *

- * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.CreateBendInputMode#addBendCreatedListener BendCreated} - * event if you are interested only in bend creation events that result from user interaction. - * Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the bend creation - * that has triggered this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#addBend - * @see yfiles.input.CreateBendInputMode#addBendCreatedListener - * @see yfiles.graph.IGraph#addBendAddedListener - * @abstract - */ - removeBendAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the BendRemoved event that occurs when a bend has been removed from an edge in this graph. - *

- * This event will be triggered, too, if an edge has been removed from the graph, for each of the bends that belonged to - * the edge. - *

- *

- * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} - * event if you are interested only in bend removal events that result from user interaction. - * Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the bend removal - * that has triggered this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#remove - * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener - * @see yfiles.graph.IGraph#removeBendRemovedListener - * @abstract - */ - addBendRemovedListener(listener:(sender:any,evt:yfiles.graph.BendEventArgs)=>void):void; - /** - * Removes the given listener for the BendRemoved event that occurs when a bend has been removed from an edge in this - * graph. - *

- * This event will be triggered, too, if an edge has been removed from the graph, for each of the bends that belonged to - * the edge. - *

- *

- * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} - * event if you are interested only in bend removal events that result from user interaction. - * Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the bend removal - * that has triggered this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#remove - * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener - * @see yfiles.graph.IGraph#addBendRemovedListener - * @abstract - */ - removeBendRemovedListener(listener:(sender:any,evt:yfiles.graph.BendEventArgs)=>void):void; - /** - * Adds the given listener for the BendLocationChanged event that occurs when the location of a bend has been changed. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#setBendLocation - * @see yfiles.graph.IGraph#removeBendLocationChangedListener - * @abstract - */ - addBendLocationChangedListener(listener:(source:any,bend:yfiles.graph.IBend,oldLocation:yfiles.geometry.Point)=>void):void; - /** - * Removes the given listener for the BendLocationChanged event that occurs when the location of a bend has been changed. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#setBendLocation - * @see yfiles.graph.IGraph#addBendLocationChangedListener - * @abstract - */ - removeBendLocationChangedListener(listener:(source:any,bend:yfiles.graph.IBend,oldLocation:yfiles.geometry.Point)=>void):void; - /** - * Adds the given listener for the BendTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of a bend has been replaced. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.ITagOwner#tag - * @see yfiles.graph.IGraph#removeBendTagChangedListener - * @abstract - */ - addBendTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Removes the given listener for the BendTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of a bend has been replaced. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.ITagOwner#tag - * @see yfiles.graph.IGraph#addBendTagChangedListener - * @abstract - */ - removeBendTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Adds the given listener for the LabelAdded event that occurs when a label has been added to this graph instance. - *

- * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addLabelAddedListener LabelAdded} - * event if you are interested only in label creation events that result from user interaction. - * Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the label creation - * that has triggered this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#addLabel - * @see yfiles.input.GraphEditorInputMode#addLabelAddedListener - * @see yfiles.graph.IGraph#removeLabelAddedListener - * @abstract - */ - addLabelAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the LabelAdded event that occurs when a label has been added to this graph instance. - *

- * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addLabelAddedListener LabelAdded} - * event if you are interested only in label creation events that result from user interaction. - * Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the label creation - * that has triggered this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#addLabel - * @see yfiles.input.GraphEditorInputMode#addLabelAddedListener - * @see yfiles.graph.IGraph#addLabelAddedListener - * @abstract - */ - removeLabelAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the LabelRemoved event that occurs when a label has been removed from this graph instance. - *

- * This event will also be triggered, prior to the removal of the {@link yfiles.graph.ILabel#owner owner} of the label. - *

- *

- * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} - * event if you are interested only in label removal events that result from user interaction. - * Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the label removal - * that has triggered this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#remove - * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener - * @see yfiles.input.GraphEditorInputMode#addLabelTextChangedListener - * @see yfiles.graph.IGraph#removeLabelRemovedListener - * @abstract - */ - addLabelRemovedListener(listener:(sender:any,evt:yfiles.graph.LabelEventArgs)=>void):void; - /** - * Removes the given listener for the LabelRemoved event that occurs when a label has been removed from this graph - * instance. - *

- * This event will also be triggered, prior to the removal of the {@link yfiles.graph.ILabel#owner owner} of the label. - *

- *

- * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} - * event if you are interested only in label removal events that result from user interaction. - * Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the label removal - * that has triggered this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#remove - * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener - * @see yfiles.input.GraphEditorInputMode#addLabelTextChangedListener - * @see yfiles.graph.IGraph#addLabelRemovedListener - * @abstract - */ - removeLabelRemovedListener(listener:(sender:any,evt:yfiles.graph.LabelEventArgs)=>void):void; - /** - * Adds the given listener for the LabelStyleChanged event that occurs when a label style has been replaced. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#setStyle - * @see yfiles.graph.IGraph#removeLabelStyleChangedListener - * @abstract - */ - addLabelStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Removes the given listener for the LabelStyleChanged event that occurs when a label style has been replaced. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#setStyle - * @see yfiles.graph.IGraph#addLabelStyleChangedListener - * @abstract - */ - removeLabelStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Adds the given listener for the LabelPreferredSizeChanged event that occurs when the preferred size of a label has been - * changed. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#setLabelPreferredSize - * @see yfiles.graph.IGraph#removeLabelPreferredSizeChangedListener - * @abstract - */ - addLabelPreferredSizeChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Removes the given listener for the LabelPreferredSizeChanged event that occurs when the preferred size of a label has - * been changed. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#setLabelPreferredSize - * @see yfiles.graph.IGraph#addLabelPreferredSizeChangedListener - * @abstract - */ - removeLabelPreferredSizeChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Adds the given listener for the LabelTextChanged event that occurs when the text of a label has been changed. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#setLabelText - * @see yfiles.graph.IGraph#removeLabelTextChangedListener - * @abstract - */ - addLabelTextChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Removes the given listener for the LabelTextChanged event that occurs when the text of a label has been changed. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#setLabelText - * @see yfiles.graph.IGraph#addLabelTextChangedListener - * @abstract - */ - removeLabelTextChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Adds the given listener for the LabelLayoutParameterChanged event that occurs when the model parameter of a label has - * been changed. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#setLabelLayoutParameter - * @see yfiles.graph.IGraph#removeLabelLayoutParameterChangedListener - * @abstract - */ - addLabelLayoutParameterChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Removes the given listener for the LabelLayoutParameterChanged event that occurs when the model parameter of a label has - * been changed. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#setLabelLayoutParameter - * @see yfiles.graph.IGraph#addLabelLayoutParameterChangedListener - * @abstract - */ - removeLabelLayoutParameterChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Adds the given listener for the LabelTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of a label has been replaced. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.ITagOwner#tag - * @see yfiles.graph.IGraph#removeLabelTagChangedListener - * @abstract - */ - addLabelTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Removes the given listener for the LabelTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of a label has been replaced. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.ITagOwner#tag - * @see yfiles.graph.IGraph#addLabelTagChangedListener - * @abstract - */ - removeLabelTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Adds the given listener for the PortAdded event that occurs when a port has been added to this graph instance. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the port creation - * that has triggered this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#addPort - * @see yfiles.graph.IGraph#createEdge - * @see yfiles.graph.IGraph#removePortAddedListener - * @abstract - */ - addPortAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the PortAdded event that occurs when a port has been added to this graph instance. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the port creation - * that has triggered this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#addPort - * @see yfiles.graph.IGraph#createEdge - * @see yfiles.graph.IGraph#addPortAddedListener - * @abstract - */ - removePortAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the PortRemoved event that occurs when a port has been removed from its {@link yfiles.graph.IPort#owner owner}. - *

- * This event will also be triggered prior to the removal of the corresponding owner of the port. - *

- *

- * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} - * event if you are interested only in port removal events that result from user interaction. - * Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the port removal - * that has triggered this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#remove - * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener - * @see yfiles.graph.IGraph#removePortRemovedListener - * @abstract - */ - addPortRemovedListener(listener:(sender:any,evt:yfiles.graph.PortEventArgs)=>void):void; - /** - * Removes the given listener for the PortRemoved event that occurs when a port has been removed from its {@link yfiles.graph.IPort#owner owner}. - *

- * This event will also be triggered prior to the removal of the corresponding owner of the port. - *

- *

- * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} - * event if you are interested only in port removal events that result from user interaction. - * Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the port removal - * that has triggered this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#remove - * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener - * @see yfiles.graph.IGraph#addPortRemovedListener - * @abstract - */ - removePortRemovedListener(listener:(sender:any,evt:yfiles.graph.PortEventArgs)=>void):void; - /** - * Adds the given listener for the PortStyleChanged event that occurs when a port style has been replaced. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#setStyle - * @see yfiles.graph.IGraph#removePortStyleChangedListener - * @abstract - */ - addPortStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Removes the given listener for the PortStyleChanged event that occurs when a port style has been replaced. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#setStyle - * @see yfiles.graph.IGraph#addPortStyleChangedListener - * @abstract - */ - removePortStyleChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Adds the given listener for the PortLocationParameterChanged event that occurs when the location model parameter of a - * port has been changed. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.IGraph#setPortLocationParameter - * @see yfiles.graph.IGraph#removePortLocationParameterChangedListener - * @abstract - */ - addPortLocationParameterChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Removes the given listener for the PortLocationParameterChanged event that occurs when the location model parameter of a - * port has been changed. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.IGraph#setPortLocationParameter - * @see yfiles.graph.IGraph#addPortLocationParameterChangedListener - * @abstract - */ - removePortLocationParameterChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Adds the given listener for the PortTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of a port has been replaced. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to add. - * @see yfiles.graph.ITagOwner#tag - * @see yfiles.graph.IGraph#removePortTagChangedListener - * @abstract - */ - addPortTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Removes the given listener for the PortTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of a port has been replaced. - *

- * This event is intended to provide notification of low level changes in the graph structure. - * Note:You may not modify the graph in the event handler for this event. - *

- * @param listener The listener to remove. - * @see yfiles.graph.ITagOwner#tag - * @see yfiles.graph.IGraph#addPortTagChangedListener - * @abstract - */ - removePortTagChangedListener(listener:(sender:any,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; - /** - * Gets or sets the defaults for group nodes. - * @abstract - * @type {yfiles.graph.INodeDefaults} - */ - groupNodeDefaults:yfiles.graph.INodeDefaults; - /** - * Adds the given listener for the ParentChanged event that occurs if a node has been reparented in the model. - * @param listener The listener to add. - * @see yfiles.graph.IGraph#removeParentChangedListener - * @abstract - */ - addParentChangedListener(listener:(sender:any,evt:yfiles.graph.NodeEventArgs)=>void):void; - /** - * Removes the given listener for the ParentChanged event that occurs if a node has been reparented in the model. - * @param listener The listener to remove. - * @see yfiles.graph.IGraph#addParentChangedListener - * @abstract - */ - removeParentChangedListener(listener:(sender:any,evt:yfiles.graph.NodeEventArgs)=>void):void; - /** - * Adds the given listener for the IsGroupNodeChanged event that occurs if the group node status of a node has changed. - * @param listener The listener to add. - * @see yfiles.graph.IGraph#removeIsGroupNodeChangedListener - * @abstract - */ - addIsGroupNodeChangedListener(listener:(sender:any,evt:yfiles.graph.NodeEventArgs)=>void):void; - /** - * Removes the given listener for the IsGroupNodeChanged event that occurs if the group node status of a node has changed. - * @param listener The listener to remove. - * @see yfiles.graph.IGraph#addIsGroupNodeChangedListener - * @abstract - */ - removeIsGroupNodeChangedListener(listener:(sender:any,evt:yfiles.graph.NodeEventArgs)=>void):void; - /** - * Gets a {@link yfiles.graph.GraphDecorator} instance for use with the given graph. - * @type {yfiles.graph.GraphDecorator} - */ - decorator?:yfiles.graph.GraphDecorator; - /** - * Creates a {@link yfiles.graph.GroupingSupport} instance for the graph. - *

- * {@link yfiles.graph.GroupingSupport} provides less frequently used methods for grouped graphs, such as methods for analyzing and - * walking the grouping hierarchy. - *

- * @type {yfiles.graph.GroupingSupport} - */ - groupingSupport?:yfiles.graph.GroupingSupport; - /** - * Gets the {@link yfiles.graph.IFoldingView folding view} instance associated with this {@link yfiles.graph.IGraph} or null if none is associated with it. - *

- * This convenience method uses the {@link yfiles.graph.ILookup#lookup} of the {@link yfiles.graph.IGraph} to obtain the - * {@link yfiles.graph.IFoldingView}. - *

- * @see yfiles.graph.FoldingManager - * @see yfiles.graph.FoldingManager#createFoldingView - * @type {yfiles.graph.IFoldingView} - */ - foldingView?:yfiles.graph.IFoldingView; - /** - * Gets the {@link yfiles.graph.UndoEngine} instance associated with this {@link yfiles.graph.IGraph} or null if none is associated with - * it. - *

- * This convenience method uses the {@link yfiles.graph.ILookup#lookup} of the {@link yfiles.graph.IGraph} to obtain the - * {@link yfiles.graph.UndoEngine}. - *

- * @type {yfiles.graph.UndoEngine} - */ - undoEngine?:yfiles.graph.UndoEngine; - /** - * Gets or sets whether or not the {@link yfiles.graph.UndoEngine} used for this instance should be enabled. - * @see yfiles.graph.IGraph#undoEngine - * @type {boolean} - */ - undoEngineEnabled?:boolean; - /** - * Gets a live view of all bends contained in this {@link yfiles.graph.IGraph}. - * @type {yfiles.collections.IEnumerable.} - */ - bends?:yfiles.collections.IEnumerable; - /** - * Gets a live view of all edge labels contained in this {@link yfiles.graph.IGraph}. - * @type {yfiles.collections.IEnumerable.} - */ - edgeLabels?:yfiles.collections.IEnumerable; - /** - * Gets a live view of all node labels contained in this {@link yfiles.graph.IGraph}. - * @type {yfiles.collections.IEnumerable.} - */ - nodeLabels?:yfiles.collections.IEnumerable; - } - var IGraph:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IGraph; - }; - /** - * A specialized subclass of the {@link yfiles.collections.ItemEventArgs.} class that is bound to the {@link yfiles.graph.INode} type and carries additional information - * about the parent node and the group node status. - *

- * Since for some events ({@link yfiles.graph.IGraph#addNodeRemovedListener NodeRemoved}, - * {@link yfiles.graph.IGraph#addIsGroupNodeChangedListener IsGroupNodeChanged}, - * {@link yfiles.graph.IGraph#addParentChangedListener ParentChanged}) it is unclear which {@link yfiles.graph.NodeEventArgs#parent} or {@link yfiles.graph.NodeEventArgs#isGroupNode} the node had before the event - * this event can be used to carry exactly that information. - *

- * @class - * @extends {yfiles.collections.ItemEventArgs.} - * @final - */ - export interface NodeEventArgs extends yfiles.collections.ItemEventArgs{} - export class NodeEventArgs { - /** - * Creates a new instance. - * @param item The node that has changed. - * @param oldParent The parent the node had before this event. - * @param oldIsGroupNode Whether the node was a group node before this event. - */ - constructor(item:yfiles.graph.INode,oldParent:yfiles.graph.INode,oldIsGroupNode:boolean); - /** - * Gets the parent of the {@link yfiles.collections.ItemEventArgs.#item node} before this event. - * @type {yfiles.graph.INode} - */ - parent:yfiles.graph.INode; - /** - * Gets whether the {@link yfiles.collections.ItemEventArgs.#item node} was a group node before this event. - * @type {boolean} - */ - isGroupNode:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.NodeEventArgs; - } - /** - * A specialized subclass of the {@link yfiles.collections.ItemEventArgs.} class that is bound to the {@link yfiles.graph.IEdge} type and carries additional source and - * target port information. - *

- * Since for some events ({@link yfiles.graph.IGraph#addEdgePortsChangedListener EdgePortsChanged} and - * {@link yfiles.graph.IGraph#addEdgeRemovedListener EdgeRemoved}) it is unclear what {@link yfiles.graph.IEdge#sourcePort} and {@link yfiles.graph.IEdge#targetPort} the edge had been connected to - * before the event, this event can be used to carry exactly that information. - *

- * @class - * @extends {yfiles.collections.ItemEventArgs.} - * @final - */ - export interface EdgeEventArgs extends yfiles.collections.ItemEventArgs{} - export class EdgeEventArgs { - /** - * Initializes a new instance of the {@link yfiles.graph.EdgeEventArgs} class. - * @param edge The edge to assign to the {@link #item} property. - * @param [sourcePort=null] The source port the edge was connected to before the event happened. - * @param [targetPort=null] The target port the edge was connected to before the event happened. - * @param [sourcePortOwner=null] The owner of the source port the edge was connected to before the event happened. - * @param [targetPortOwner=null] The owner of the target port the edge was connected to before the event happened. - */ - constructor(edge:yfiles.graph.IEdge,sourcePort?:yfiles.graph.IPort,targetPort?:yfiles.graph.IPort,sourcePortOwner?:yfiles.graph.IPortOwner,targetPortOwner?:yfiles.graph.IPortOwner); - /** - * Initializes a new instance of the {@link yfiles.graph.EdgeEventArgs} class. - * @param {Object} options The parameters to pass. - * @param options.edge The edge to assign to the {@link #item} property. - * @param [options.sourcePort=null] The source port the edge was connected to before the event happened. - * @param [options.targetPort=null] The target port the edge was connected to before the event happened. - * @param [options.sourcePortOwner=null] The owner of the source port the edge was connected to before the event happened. - * @param [options.targetPortOwner=null] The owner of the target port the edge was connected to before the event happened. - */ - constructor(options:{edge:yfiles.graph.IEdge,sourcePort?:yfiles.graph.IPort,targetPort?:yfiles.graph.IPort,sourcePortOwner?:yfiles.graph.IPortOwner,targetPortOwner?:yfiles.graph.IPortOwner}); - /** - * Gets the source port the edge was connected to before the event happened. - * @type {yfiles.graph.IPort} - */ - sourcePort:yfiles.graph.IPort; - /** - * Gets the target port the edge was connected to before the event happened. - * @type {yfiles.graph.IPort} - */ - targetPort:yfiles.graph.IPort; - /** - * Gets the owner of the source port the edge was connected to before the event happened. - * @type {yfiles.graph.IPortOwner} - */ - sourcePortOwner:yfiles.graph.IPortOwner; - /** - * Gets the owner of the target port the edge was connected to before the event happened. - * @type {yfiles.graph.IPortOwner} - */ - targetPortOwner:yfiles.graph.IPortOwner; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.EdgeEventArgs; - } - /** - * A specialized subclass of the {@link yfiles.collections.ItemEventArgs.} class that is bound to the {@link yfiles.graph.IPort} type and carries additional {@link yfiles.graph.IPortOwner} - * information. - *

- * Since for some events ({@link yfiles.graph.IGraph#addPortRemovedListener PortRemoved}) it is unclear what {@link yfiles.graph.IPort#owner} the port had - * been attached to before the event, this event can be used to carry exactly that information. - *

- * @class - * @extends {yfiles.collections.ItemEventArgs.} - * @final - */ - export interface PortEventArgs extends yfiles.collections.ItemEventArgs{} - export class PortEventArgs { - /** - * Initializes a new instance of the {@link yfiles.graph.PortEventArgs} class. - * @param port The port to assign to the {@link #item} property. - * @param owner The owner of the port the port was attached to. - */ - constructor(port:yfiles.graph.IPort,owner:yfiles.graph.IPortOwner); - /** - * Gets the owner the port the was connected to before the event happened. - * @type {yfiles.graph.IPortOwner} - */ - owner:yfiles.graph.IPortOwner; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.PortEventArgs; - } - /** - * A specialized subclass of the {@link yfiles.collections.ItemEventArgs.} class that is bound to the {@link yfiles.graph.ILabel} type and carries additional {@link yfiles.graph.ILabelOwner owner} - * information. - *

- * Since for some events ({@link yfiles.graph.IGraph#addLabelRemovedListener LabelRemoved}) it is unclear what {@link yfiles.graph.ILabel#owner} the label - * was owned by before the event, this event can be used to carry exactly that information. - *

- * @class - * @extends {yfiles.collections.ItemEventArgs.} - * @final - */ - export interface LabelEventArgs extends yfiles.collections.ItemEventArgs{} - export class LabelEventArgs { - /** - * Initializes a new instance of the {@link yfiles.graph.LabelEventArgs} class. - * @param label The label to assign to the {@link #item} property. - * @param owner The previous owner of the label. - */ - constructor(label:yfiles.graph.ILabel,owner:yfiles.graph.ILabelOwner); - /** - * Gets the owner of the label that owned the label before the event happened. - * @type {yfiles.graph.ILabelOwner} - */ - owner:yfiles.graph.ILabelOwner; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.LabelEventArgs; - } - /** - * A specialized subclass of the {@link yfiles.collections.ItemEventArgs.} class that is bound to the {@link yfiles.graph.IBend} type and carries additional {@link yfiles.graph.IEdge owner} and index - * information. - *

- * Since for some events ({@link yfiles.graph.IGraph#addBendRemovedListener BendRemoved}) it is unclear what {@link yfiles.graph.IBend#owner} the bend was - * owned by before the event, this event can be used to carry exactly that information. - *

- * @class - * @extends {yfiles.collections.ItemEventArgs.} - * @final - */ - export interface BendEventArgs extends yfiles.collections.ItemEventArgs{} - export class BendEventArgs { - /** - * Initializes a new instance of the {@link yfiles.graph.BendEventArgs} class. - * @param bend The bend to assign to the {@link #item} property. - * @param owner The previous owner of the bend. - * @param index The previous index of the bend in the {@link #bends} list. - */ - constructor(bend:yfiles.graph.IBend,owner:yfiles.graph.IEdge,index:number); - /** - * Gets the owner of the bend that owned the bend before the event happened. - * @type {yfiles.graph.IEdge} - */ - owner:yfiles.graph.IEdge; - /** - * Gets the former index of the bend in the {@link yfiles.graph.IEdge#bends} list. - * @type {number} - */ - index:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.BendEventArgs; - } - /** - * Event argument class used by {@link yfiles.graph.IGraph} if a model item's property has been changed. - * Type parameter TItem: The type of the item contained in the event. - * Type parameter TValue: The type of the item's property that has been changed. - * @class - * @extends {yfiles.collections.ItemEventArgs.} - * @template TItem,TValue - */ - export interface ItemChangedEventArgs extends yfiles.collections.ItemEventArgs{} - export class ItemChangedEventArgs { - /** - * Initializes a new instance of the {@link yfiles.graph.ItemChangedEventArgs.} class. - * @param item The item whose property has been changed. - * @param oldValue The value of the property before the change. - */ - constructor(item:TItem,oldValue:TValue); - /** - * Gets the value of the property before the change. - * @type {TValue} - */ - oldValue:TValue; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.ItemChangedEventArgs; - } - /** - * The interface used in an {@link yfiles.graph.IGraph} implementation for labels. - *

- * This interface provides read-only access to the properties of a label. In order to modify the state of an instance use - * the various methods provided by the {@link yfiles.graph.IGraph} this instance belongs to. Labels are stored in - * {@link yfiles.collections.IListEnumerable. IListEnumerable<ILabel>}s, that can be obtained from {@link yfiles.graph.ILabelOwner} implementations' {@link yfiles.graph.ILabelOwner#labels} property. Typical owners - * of a label are {@link yfiles.graph.INode} and {@link yfiles.graph.IEdge} instances. Like all items in an IGraph, this item supports the - * {@link yfiles.graph.ILookup#lookup} method that can be used to query additional aspects of the item. - *

- *

- * The graph model with all relevant types and their relationships is presented in detail in the section {@link @DGUIDE_PREFIX@/graph.html The Graph Model}. - *

- *

- * Using the look-up mechanism is explained in the section {@link @DGUIDE_PREFIX@/customizing_concepts_lookup.html Service Locator Pattern: Lookup}. - *

- * @interface - * @implements {yfiles.graph.IModelItem} - */ - export interface ILabel extends yfiles.lang.Object,yfiles.graph.IModelItem{ - /** - * Gets the style that is responsible for the visual representation of this node in a {@link yfiles.view.CanvasComponent}. - *

- * In order to set the style on an instance, use the {@link yfiles.graph.IGraph#setStyle} method. Note that the style instance - * associated with a label instance may be shared between multiple label instances and that the modification of this style - * will result in a change of the appearance of all labels that are associated with the same style instance. - *

- * @abstract - * @type {yfiles.styles.ILabelStyle} - */ - style:yfiles.styles.ILabelStyle; - /** - * Gets the preferred size of the label with respect to its current contents and the implementation of the visualization. - *

- * Often times the {@link yfiles.graph.ILabel#layout layout's} size will be the same as the preferred size, but it's up to the implementation of the {@link yfiles.graph.ILabelModel} - * to interpret it differently. In order to set a different preferred size for this label instance use {@link yfiles.graph.IGraph}'s - * {@link yfiles.graph.IGraph#setLabelPreferredSize} method. - *

- * @abstract - * @type {yfiles.geometry.Size} - */ - preferredSize:yfiles.geometry.Size; - /** - * Gets the owner of this label. - *

- * Typically this will yield an instance of {@link yfiles.graph.INode} or {@link yfiles.graph.IEdge}. - *

- * @abstract - * @type {yfiles.graph.ILabelOwner} - */ - owner:yfiles.graph.ILabelOwner; - /** - * Gets the text string associated with this label. - *

- * It is up to the visualization engine to interpret this property for the visualization of the label. Normally, it will - * render the text into the {@link yfiles.graph.ILabel#layout layout} of this instance. - *

- * @abstract - * @type {string} - */ - text:string; - /** - * Gets the label model's parameter that determines the positioning of this label. - *

- * In order to set a different parameter for this label, use {@link yfiles.graph.IGraph}'s {@link yfiles.graph.IGraph#setLabelLayoutParameter} - * method. Note that the label model parameter instance associated with a label instance may be shared between multiple - * label instances and that the modification of this instance or its {@link yfiles.graph.ILabelModelParameter#model} will result in a change of the positioning of all - * labels that are associated with the same parameter or model instance. - *

- * @abstract - * @type {yfiles.graph.ILabelModelParameter} - */ - layoutParameter:yfiles.graph.ILabelModelParameter; - /** - * Gets the index of the label at its {@link yfiles.graph.ILabel#owner}. - * @type {number} - */ - index?:number; - /** - * Gets a snapshot of the current layout of the label. - *

- * Labels have a {@link yfiles.geometry.ISize size} and are anchored at a given location in world coordinate space. The anchor is the point around which - * the oriented rectangle is rotated in the world coordinate system. If the oriented rectangle has default orientation, - * i.e. its up vector points north (<0,-1>), it coincides with its lower left corner. The positioning of the label is - * determined using a pair of {@link yfiles.graph.ILabelModel} and {@link yfiles.graph.ILabelModelParameter}. In order to modify the layout - * of a label instance, set another {@link yfiles.graph.ILabel#layoutParameter} for this label or modify its associated instance. - *

- * @type {yfiles.geometry.IOrientedRectangle} - */ - layout?:yfiles.geometry.IOrientedRectangle; - } - var ILabel:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.ILabel; - }; - /** - * Interface used by {@link yfiles.graph.IGraph} and the like to declare and obtain the defaults for labels. - *

- * Note that changing these defaults does not change properties of already created model items. Rather, only items created - * after the change are affected. - *

- * @see yfiles.graph.INodeDefaults#labels - * @see yfiles.graph.IEdgeDefaults#labels - * @see yfiles.graph.IGraph#nodeDefaults - * @see yfiles.graph.IGraph#edgeDefaults - * @see yfiles.graph.IGraph#groupNodeDefaults - * @interface - */ - export interface ILabelDefaults extends yfiles.lang.Object{ - /** - * Factory method that returns a label model parameter instance for use with newly created labels. - *

- * Most implementations will yield either, a {@link yfiles.lang.ICloneable#clone clone} of or the {@link yfiles.graph.ILabelDefaults#layoutParameter} property, if {@link yfiles.graph.ILabelDefaults#shareLayoutParameterInstance} is enabled, but they might use more complicated - * logic, too. - *

- * @param owner The owner of the label that will be created. - * @returns The parameter to use, which for most implementations is either a {@link #clone clone} of or the {@link #layoutParameter} property, if {@link #shareLayoutParameterInstance} is enabled. - * @abstract - */ - getLayoutParameterInstance(owner:yfiles.graph.ILabelOwner):yfiles.graph.ILabelModelParameter; - /** - * Factory method that returns a style instance for use with newly created labels. - *

- * Most implementations will yield either, a {@link yfiles.lang.ICloneable#clone clone} of or the {@link yfiles.graph.ILabelDefaults#style} property, if {@link yfiles.graph.ILabelDefaults#shareStyleInstance} is enabled, but they might use more complicated - * logic, too. - *

- * @param owner The owner of the label that will be created. - * @returns The style to use, which for most implementations is either a {@link #clone clone} of or the {@link #style} property, if {@link #shareStyleInstance} is enabled. - * @abstract - */ - getStyleInstance(owner:yfiles.graph.ILabelOwner):yfiles.styles.ILabelStyle; - /** - * Gets or sets the style to use for labels. - *

- * Depending on the setting of {@link yfiles.graph.ILabelDefaults#shareStyleInstance}, the {@link yfiles.graph.ILabelDefaults#getStyleInstance} method should return a {@link yfiles.lang.ICloneable#clone clone} of this - * instance or the very same instance. - *

- * @see yfiles.graph.ILabelDefaults#shareStyleInstance - * @abstract - * @type {yfiles.styles.ILabelStyle} - */ - style:yfiles.styles.ILabelStyle; - /** - * Gets or sets a property that determines whether to automatically adjust the preferred size of a label. - *

- * On a call to {@link yfiles.graph.IGraph#setLabelText} or - * {@link yfiles.graph.IGraph#setStyle}, the preferred size of the label will automatically be adjusted to the preferred size that - * is suggested by the label's style renderer, if this property is set to true. - *

- * @see yfiles.styles.ILabelStyleRenderer#getPreferredSize - * @abstract - * @type {boolean} - */ - autoAdjustPreferredSize:boolean; - /** - * Gets or sets a value indicating whether the {@link yfiles.graph.ILabelDefaults#layoutParameter} instance should be shared referentially or {@link yfiles.lang.ICloneable#clone cloned} upon a call to - * {@link yfiles.graph.ILabelDefaults#getLayoutParameterInstance}. - * @see yfiles.graph.ILabelDefaults#getLayoutParameterInstance - * @see yfiles.graph.ILabelDefaults#layoutParameter - * @abstract - * @type {boolean} - */ - shareLayoutParameterInstance:boolean; - /** - * Gets or sets a value indicating whether the {@link yfiles.graph.ILabelDefaults#style} instance should be shared referentially or {@link yfiles.lang.ICloneable#clone cloned} upon a call to - * {@link yfiles.graph.ILabelDefaults#getStyleInstance}. - * @see yfiles.graph.ILabelDefaults#getStyleInstance - * @see yfiles.graph.ILabelDefaults#style - * @abstract - * @type {boolean} - */ - shareStyleInstance:boolean; - /** - * Gets or sets the label model parameter to use for labels. - *

- * Depending on the setting of {@link yfiles.graph.ILabelDefaults#shareLayoutParameterInstance}, the {@link yfiles.graph.ILabelDefaults#getLayoutParameterInstance} method should return a {@link yfiles.lang.ICloneable#clone clone} of - * this instance or the very same instance. - *

- * @see yfiles.graph.ILabelDefaults#shareLayoutParameterInstance - * @see yfiles.graph.ILabelDefaults#getLayoutParameterInstance - * @abstract - * @type {yfiles.graph.ILabelModelParameter} - */ - layoutParameter:yfiles.graph.ILabelModelParameter; - } - var ILabelDefaults:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.ILabelDefaults; - }; - /** - * Defines the geometry of {@link yfiles.graph.ILabel} instances with respect to specific {@link yfiles.graph.ILabelModelParameter}s. - *

- * In addition to defining the geometry of a label with respect to a specific - * {@link yfiles.graph.ILabelModelParameter}, a label model is typically the factory of the label model parameters that are - * compatible with it, too. - *

- *

- * Typically, the label model defines a, possibly infinite, compilation of valid geometries for labels, and a specific - * label model parameter specifies an exact geometry for a label. - *

- *

- * By design, the same instance of a label model can be shared by multiple label model parameters. Similarly, the same - * instance of a label model parameter can be shared by multiple labels. - *

- *

- * This interface supports the {@link yfiles.graph.ILookup#lookup} method that can be used to query additional aspects of the - * implementation. - *

- * @see yfiles.graph.ILabelModelParameter - * @see yfiles.graph.ILabel - * @see yfiles.graph.IGraph - * @interface - * @implements {yfiles.graph.ILookup} - */ - export interface ILabelModel extends yfiles.lang.Object,yfiles.graph.ILookup{ - /** - * Creates a default parameter that can be used for this model. - * @returns a parameter for this model instance - * @abstract - */ - createDefaultParameter():yfiles.graph.ILabelModelParameter; - /** - * Provides a {@link yfiles.graph.ILookup lookup context} for the given combination of label and parameter. - * @param label The label to use in the context. - * @param layoutParameter The parameter to use for the label in the context. - * @returns An implementation of the {@link } interface that can be used to query additional aspects of the - * label/parameter combination. - * @see yfiles.graph.ILookup#EMPTY - * @abstract - */ - getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; - /** - * Calculates the {@link yfiles.geometry.IOrientedRectangle geometry} of the given label using the given model parameter. - * @param label The label to calculate the geometry for. - * @param layoutParameter A parameter that is compatible with this model. Typically, this is a parameter that has been created by this model, and - * its property {@link #model} returns this instance. - * @returns An {@link } that describes the geometry of the label. This is typically designed as a - * flyweight, therefore clients should not cache the instance but store the values if they need a snapshot for later use. - * @abstract - */ - getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; - } - var ILabelModel:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.ILabelModel; - }; - /** - * Interface that provides more information about a potential label geometry (a candidate) to an automatic labeling - * algorithm. - *

- * Typically, instances of this interface are created by an implementation of {@link yfiles.graph.ILabelCandidateDescriptorProvider} - * for a pair of an {@link yfiles.graph.ILabel} and a {@link yfiles.graph.ILabelModelParameter} that describes a potential placement of - * that label (a 'candidate'). - *

- * @see yfiles.graph.ILabelCandidateDescriptorProvider - * @interface - */ - export interface ILabelCandidateDescriptor extends yfiles.lang.Object{ - /** - * Gets a value indicating whether this candidate is deemed an external candidate. - *

- * This is mainly for {@link yfiles.graph.INode} labels that are a visual part of the node's internals. It could be used for edge - * labels, too, if the edge occupies significant amounts of visual space. - *

- * @abstract - * @type {boolean} - */ - externalCandidate:boolean; - /** - * Gets a penalty value that is used by labeling algorithms to judge the severity if this candidate overlaps with an edge - * path. - *

- * This value must be between 0 and 1 (inclusive). A value of 0 means that an overlap is considered not important, while a - * value of 1 means that an overlap is considered severe. - *

- * @abstract - * @type {number} - */ - edgeOverlapPenalty:number; - /** - * Gets a penalty value that is used by labeling algorithms to judge the severity if this label candidate overlaps with a - * node's bounds. - *

- * This value must be between 0 and 1 (inclusive). A value of 0 means that an overlap is considered not important, while a - * value of 1 means that an overlap is considered severe. - *

- * @abstract - * @type {number} - */ - nodeOverlapPenalty:number; - /** - * Gets a profit value that is used by labeling algorithms to judge how good this label candidate is. - *

- * This value must be between 0 and 1 (inclusive). Higher profit means better candidates. Hence, there is a higher - * probability that the candidate is chosen by a labeling algorithm. - *

- * @abstract - * @type {number} - */ - profit:number; - } - var ILabelCandidateDescriptor:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.ILabelCandidateDescriptor; - }; - /** - * An interface that can be used to retrieve {@link yfiles.graph.ILabelCandidateDescriptor} instances for a given pair of a {@link yfiles.graph.ILabel} - * and a {@link yfiles.graph.ILabelModelParameter candidate parameter}. - *

- * This interface can be used by automatic labeling algorithms to help decide which labels candidate positions should be - * used. - *

- * @see yfiles.graph.ILabelCandidateDescriptor - * @interface - */ - export interface ILabelCandidateDescriptorProvider extends yfiles.lang.Object{ - /** - * Gets the descriptor for a given pair of a label and a {@link yfiles.graph.ILabelModelParameter}. - * @param label The label to possibly assign the layoutParameter. - * @param layoutParameter The parameter to provide a descriptor for if applied to the given label. - * @returns A descriptor or null. - * @abstract - */ - getDescriptor(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILabelCandidateDescriptor; - } - var ILabelCandidateDescriptorProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.ILabelCandidateDescriptorProvider; - }; - /** - * An implementation of the {@link yfiles.graph.ILabelCandidateDescriptorProvider} interface that always yields a constant - * {@link yfiles.graph.ILabelCandidateDescriptor}. - * @class - * @implements {yfiles.graph.ILabelCandidateDescriptorProvider} - * @final - */ - export interface ConstantLabelCandidateDescriptorProvider extends yfiles.lang.Object,yfiles.graph.ILabelCandidateDescriptorProvider{} - export class ConstantLabelCandidateDescriptorProvider { - /** - * Initializes a new instance of the {@link yfiles.graph.ConstantLabelCandidateDescriptorProvider} class that always yields descriptor - * in {@link yfiles.graph.ConstantLabelCandidateDescriptorProvider#getDescriptor}. - * @param descriptor The descriptor to yield in {@link #getDescriptor}. - */ - constructor(descriptor:yfiles.graph.ILabelCandidateDescriptor); - /** - * Always yields the parameter that has been passed to the constructor. - * @param label - * @param layoutParameter - * @returns - */ - getDescriptor(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILabelCandidateDescriptor; - /** - * A sharable implementation of the {@link yfiles.graph.ILabelCandidateDescriptorProvider} interface that always yields - * {@link yfiles.graph.LabelCandidateDescriptor#EXTERNAL_DESCRIPTOR}. - * @const - * @static - * @type {yfiles.graph.ILabelCandidateDescriptorProvider} - */ - static EXTERNAL_DESCRIPTOR_PROVIDER:yfiles.graph.ILabelCandidateDescriptorProvider; - /** - * A sharable implementation of the {@link yfiles.graph.ILabelCandidateDescriptorProvider} interface that always yields - * {@link yfiles.graph.LabelCandidateDescriptor#INTERNAL_DESCRIPTOR}. - * @const - * @static - * @type {yfiles.graph.ILabelCandidateDescriptorProvider} - */ - static INTERNAL_DESCRIPTOR_PROVIDER:yfiles.graph.ILabelCandidateDescriptorProvider; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.ConstantLabelCandidateDescriptorProvider; - } - /** - * A simple mutable default implementation of the {@link yfiles.graph.ILabelCandidateDescriptor} interface. - *

- * All properties are read/write in this implementation. - *

- * @class - * @implements {yfiles.graph.ILabelCandidateDescriptor} - */ - export interface LabelCandidateDescriptor extends yfiles.lang.Object,yfiles.graph.ILabelCandidateDescriptor{} - export class LabelCandidateDescriptor { - /** - * A sharable immutable implementation of the {@link yfiles.graph.ILabelCandidateDescriptor} interface that has penalties of 1.0d - * and a profit of 1.0d and yields true for the {@link yfiles.graph.ILabelCandidateDescriptor#externalCandidate} property. - * @const - * @static - * @type {yfiles.graph.ILabelCandidateDescriptor} - */ - static EXTERNAL_DESCRIPTOR:yfiles.graph.ILabelCandidateDescriptor; - /** - * A sharable immutable implementation of the {@link yfiles.graph.ILabelCandidateDescriptor} interface that has penalties of 1.0d - * and a profit of 1.0d and yields false for the {@link yfiles.graph.ILabelCandidateDescriptor#externalCandidate} property. - * @const - * @static - * @type {yfiles.graph.ILabelCandidateDescriptor} - */ - static INTERNAL_DESCRIPTOR:yfiles.graph.ILabelCandidateDescriptor; - /** - * - * @type {boolean} - */ - externalCandidate:boolean; - /** - * - * @default 1.0 - * @type {number} - */ - edgeOverlapPenalty:number; - /** - * - * @default 1.0 - * @type {number} - */ - nodeOverlapPenalty:number; - /** - * - * @default 1.0 - * @type {number} - */ - profit:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.LabelCandidateDescriptor; - } - /** - * Defines a state that can be used to {@link yfiles.graph.ILabelModel#getGeometry determine the geometry of a label} with a {@link yfiles.graph.ILabelModel}. - *

- * Typically, implementations of this interface are created by factory methods of the corresponding {@link yfiles.graph.ILabelModelParameter#model}. - *

- *

- * This interface extends the {@link yfiles.lang.ICloneable} interface. This allows clients to obtain a persistent copy of the - * current state of this parameter. Immutable parameter implementations may return themselves. - *

- * @see yfiles.graph.ILabelModel - * @see yfiles.graph.ILabel - * @interface - * @implements {yfiles.lang.ICloneable} - */ - export interface ILabelModelParameter extends yfiles.lang.Object,yfiles.lang.ICloneable{ - /** - * Determines whether this parameter can be used for a given label instance. - *

- * A parameter must not necessarily support all types of labels. This method returns whether it supports the given label. - * For example, a parameter might only support labels that are owned by an {@link yfiles.graph.INode}. - *

- * @param label The label to test. - * @returns true if this instance can be used for the given label, false otherwise. - * @abstract - */ - supports(label:yfiles.graph.ILabel):boolean; - /** - * Gets the model that can be used to determine the geometry of a label given this parameter and a label instance. - * @abstract - * @type {yfiles.graph.ILabelModel} - */ - model:yfiles.graph.ILabelModel; - } - var ILabelModelParameter:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.ILabelModelParameter; - }; - /** - * Utility interface used by {@link yfiles.graph.ILabelModel} implementations to find the best {@link yfiles.graph.ILabelModelParameter} to - * approximate a given layout. - *

- * Implementations of this class may be retrieved from {@link yfiles.graph.ILabelModel} implementations using their {@link yfiles.graph.ILookup#lookup} - * method. Note that implementations are not required to return an instance if queried for this interface. - *

- * @see yfiles.graph.DefaultLabelModelParameterFinder - * @interface - */ - export interface ILabelModelParameterFinder extends yfiles.lang.Object{ - /** - * Tries to find a parameter that best matches the given layout for the provided label instance. - *

- * This method may not necessarily find a parameter that matches the provided layout exactly. Implementations may choose to - * simply return the model's {@link yfiles.graph.ILabelModel#createDefaultParameter default parameter} but may never return null. - *

- * @param label The label to find a parameter for. - * @param model The model instance to use. This should be the instance this instance has been obtained from. - * @param layout The anticipated layout for the label. - * @returns A non-null parameter that can be used for the label to approximate the provided layout. - * @abstract - */ - findBestParameter(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel,layout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; - } - var ILabelModelParameterFinder:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.ILabelModelParameterFinder; - }; - /** - * A simple default implementation of the {@link yfiles.graph.ILabelModelParameterFinder} interface that uses the - * {@link yfiles.graph.ILabelModel}'s own {@link yfiles.graph.ILabelModelParameterProvider} instance to find the closest match. - *

- * This implementation uses a metric to find the closest of the provided parameter candidates to the layout provided in - * {@link yfiles.graph.DefaultLabelModelParameterFinder#selectBestParameter}. - *

- * @class - * @implements {yfiles.graph.ILabelModelParameterFinder} - */ - export interface DefaultLabelModelParameterFinder extends yfiles.lang.Object,yfiles.graph.ILabelModelParameterFinder{} - export class DefaultLabelModelParameterFinder { - /** - * Calculates a metric for the given label/parameter pair and the target label layout. - *

- * This implementation gets the geometry from the parameter's model's {@link yfiles.graph.ILabelModel#getGeometry} method and - * returns the result of a call to {@link yfiles.graph.DefaultLabelModelParameterFinder#distance}. - *

- * @param label The label to apply the parameter to. - * @param layoutParameter The parameter candidate. - * @param layout The targeted layout rectangle. - * @returns A metric that indicates the distance between the candidate's layout and the target layout. - * @protected - */ - calculateMetric(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter,layout:yfiles.geometry.IOrientedRectangle):number; - /** - * Returns the distance between two {@link yfiles.geometry.IOrientedRectangle} instances. - *

- * The distance is calculated using the Euclidean distance between the two centers and the angular deviation between the - * two up vectors. - *

- * @param rectangle1 The first geometry. - * @param rectangle2 The geometry to compare the first one with. - * @returns A value indicating the distance between the two instances. - * @protected - */ - distance(rectangle1:yfiles.geometry.IOrientedRectangle,rectangle2:yfiles.geometry.IOrientedRectangle):number; - /** - * Tries to find a parameter that best matches the given layout for the provided label instance. - *

- * This method may not necessarily find a parameter that matches the provided layout exactly. It will first query the {@link yfiles.graph.DefaultLabelModelParameterFinder#getCandidateParameters} - * parameter for an enumeration of candidates and will then find the best matching candidate using a metric calculated by - * {@link yfiles.graph.DefaultLabelModelParameterFinder#calculateMetric}. If no parameter can be found this method returns the {@link yfiles.graph.ILabelModel#createDefaultParameter default parameter} - * for the model. - *

- * @param label The label to find a parameter for. - * @param model The model instance to use. This should be the instance this instance has been obtained from. - * @param layout The anticipated layout for the label. - * @returns A non-null parameter that can be used for the label to approximate the provided layout. - */ - findBestParameter(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel,layout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; - /** - * Retrieves an enumerator over all candidates for a given label and model. - * @param label The label. - * @param model The model of the label. - * @returns An enumerator over the candidates. The enumerator may be empty. - * @protected - */ - getCandidateParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; - /** - * Tries to find a parameter that best matches the given layout for the provided label instance among the set of given - * parameters. - *

- * Null may be returned if an empty enumerable is passed. - *

- * @param label The label to find a parameter for. - * @param layout The anticipated layout for the label. - * @param layoutParameters A set of parameters to choose from. - * @returns A parameter that can be used for the label to approximate the provided layout. - */ - selectBestParameter(label:yfiles.graph.ILabel,layout:yfiles.geometry.IOrientedRectangle,layoutParameters:yfiles.collections.IEnumerable):yfiles.graph.ILabelModelParameter; - /** - * A singleton instance of this class. - * @const - * @static - * @type {yfiles.graph.DefaultLabelModelParameterFinder} - */ - static INSTANCE:yfiles.graph.DefaultLabelModelParameterFinder; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.DefaultLabelModelParameterFinder; - } - /** - * Helper interface used by {@link yfiles.graph.ILabelModel} implementations to provide possible candidate - * {@link yfiles.graph.ILabelModelParameter}s for a given label and model. - *

- * Implementations of this interface can be retrieved from the {@link yfiles.graph.ILabelModel}'s {@link yfiles.graph.ILookup#lookup} - * method. Note that not all models necessarily need to or can provide implementations of this interface. - *

- * @interface - */ - export interface ILabelModelParameterProvider extends yfiles.lang.Object{ - /** - * Returns an enumerator over a set of possible {@link yfiles.graph.ILabelModelParameter} instances that can be used for the given - * label and model. - * @param label The label instance to use. - * @param model The model to provide parameters for. - * @returns A possibly empty enumerator over a set of label model parameters. - * @abstract - */ - getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; - } - var ILabelModelParameterProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.ILabelModelParameterProvider; - }; - /** - * Common interface for items in an {@link yfiles.graph.IGraph} implementation that may own {@link yfiles.graph.ILabel labels}. - *

- * Like all items in an IGraph, this item supports the {@link yfiles.graph.ILookup#lookup} method that can be used to query - * additional aspects of the item. - *

- * @see yfiles.graph.INode - * @see yfiles.graph.IEdge - * @interface - * @implements {yfiles.graph.IModelItem} - */ - export interface ILabelOwner extends yfiles.lang.Object,yfiles.graph.IModelItem{ - /** - * Gets a collection of {@link yfiles.graph.ILabel labels} that are owned by this instance. - *

- * This gives access to a read-only live view of the labels, i.e. the collection can change over time, as well as the - * labels contained in it. If a snapshot of the current state is needed, one needs to copy the collection and its - * contents. - *

- * @abstract - * @type {yfiles.collections.IListEnumerable.} - */ - labels:yfiles.collections.IListEnumerable; - } - var ILabelOwner:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.ILabelOwner; - }; - /** - * A registry that can be used to store {@link yfiles.collections.IMapper.} implementations by tag. - *

- * Implementations of this interface can be found in the {@link yfiles.graph.ILookup#lookup} of the default {@link yfiles.graph.IGraph} - * implementations in the framework. - *

- *

- * Using IMapperRegistry is described in the section {@link @DGUIDE_PREFIX@/customizing_graph-binding_data.html Associating Data with Graph Elements}. - *

- * @see yfiles.graph.MapperRegistry - * @interface - */ - export interface IMapperRegistry extends yfiles.lang.Object{ - /** - * Registers a mapper for the given tag. - *

- * If there already was a mapper for tag, it will be replaced. - *

- * Type parameter K: The key type for the mapper. - * Type parameter V: The value type for the mapper. - * @param valueType The value type for the mapper. - * @param keyType The key type for the mapper. - * @param tag The tag to use. - * @param mapper The mapper to register. - * @template K,V - * @abstract - */ - addMapper(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,tag:any,mapper:yfiles.collections.IMapper):void; - /** - * Creates a simple read-only {@link yfiles.collections.IMapper.} implementation with key type {@link yfiles.graph.ILabel} and {@link yfiles.graph.IMapperRegistry#addMapper adds} it to the registry using the - * provided tag. - *

- * The value type of the mapper is inferred by the provided tag. If there already was a mapper for - * tag, it will be replaced. - *

- * Type parameter V: The type of the values of the mapper. - * @param tag The tag. - * @param constant The value to yield during {@link } reads. - * @returns The newly created mapper instance. - * @see yfiles.collections.IMapper.#fromDelegate - * @template V - */ - createConstantMapper?(tag:yfiles.algorithms.ILabelLayoutDpKey,constant:V):yfiles.collections.IMapper; - /** - * Creates a simple read-only {@link yfiles.collections.IMapper.} implementation with key type {@link yfiles.graph.IEdge} and {@link yfiles.graph.IMapperRegistry#addMapper adds} it to the registry using the - * provided tag. - *

- * The value type of the mapper is inferred by the provided tag. If there already was a mapper for - * tag, it will be replaced. - *

- * Type parameter V: The type of the values of the mapper. - * @param tag The tag. - * @param constant The value to yield during {@link } reads. - * @returns The newly created mapper instance. - * @see yfiles.collections.IMapper.#fromDelegate - * @template V - */ - createConstantMapper?(tag:yfiles.algorithms.EdgeDpKey,constant:V):yfiles.collections.IMapper; - /** - * Creates a simple read-only {@link yfiles.collections.IMapper.} implementation with key type {@link yfiles.graph.INode} and {@link yfiles.graph.IMapperRegistry#addMapper adds} it to the registry using the - * provided tag. - *

- * The value type of the mapper is inferred by the provided tag. If there already was a mapper for - * tag, it will be replaced. - *

- * Type parameter V: The type of the values of the mapper. - * @param tag The tag. - * @param constant The value to yield during {@link } reads. - * @returns The newly created mapper instance. - * @see yfiles.collections.IMapper.#fromDelegate - * @template V - */ - createConstantMapper?(tag:yfiles.algorithms.NodeDpKey,constant:V):yfiles.collections.IMapper; - /** - * Creates a simple read-only {@link yfiles.collections.IMapper.} implementation and {@link yfiles.graph.IMapperRegistry#addMapper adds} it to the registry using the provided tag. - *

- * If there already was a mapper for tag, it will be replaced. - *

- * Type parameter K: The type of the keys of the mapper. - * Type parameter V: The type of the values of the mapper. - * @param tag The tag. - * @param constant The value to yield during {@link } reads. - * @returns The newly created mapper instance. - * @see yfiles.collections.IMapper.#fromConstant - * @template K,V - */ - createConstantMapper?(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,tag:any,constant:V):yfiles.collections.IMapper; - /** - * Creates a delegate-based read-only {@link yfiles.collections.IMapper.} implementation with key type {@link yfiles.graph.ILabel} and {@link yfiles.graph.IMapperRegistry#addMapper adds} it to the registry using - * the provided tag. - *

- * The value type of the mapper is inferred by the provided tag. If there already was a mapper for - * tag, it will be replaced. - *

- * Type parameter V: The type of the values of the mapper. - * @param tag The tag. - * @param getter The getter delegate to which {@link } reads will be delegated. - * @returns The newly created mapper instance. - * @see yfiles.collections.IMapper.#fromDelegate - * @template V - */ - createDelegateMapper?(tag:yfiles.algorithms.ILabelLayoutDpKey,getter:(key:yfiles.graph.ILabel)=>V):yfiles.collections.IMapper; - /** - * Creates a delegate-based read-only {@link yfiles.collections.IMapper.} implementation with key type {@link yfiles.graph.IEdge} and {@link yfiles.graph.IMapperRegistry#addMapper adds} it to the registry using - * the provided tag. - *

- * The value type of the mapper is inferred by the provided tag. If there already was a mapper for - * tag, it will be replaced. - *

- * Type parameter V: The type of the values of the mapper. - * @param tag The tag. - * @param getter The getter delegate to which {@link } reads will be delegated. - * @returns The newly created mapper instance. - * @see yfiles.collections.IMapper.#fromDelegate - * @template V - */ - createDelegateMapper?(tag:yfiles.algorithms.EdgeDpKey,getter:(key:yfiles.graph.IEdge)=>V):yfiles.collections.IMapper; - /** - * Creates a delegate-based read-only {@link yfiles.collections.IMapper.} implementation with key type {@link yfiles.graph.INode} and {@link yfiles.graph.IMapperRegistry#addMapper adds} it to the registry using - * the provided tag. - *

- * The value type of the mapper is inferred by the provided tag. If there already was a mapper for - * tag, it will be replaced. - *

- * Type parameter V: The type of the values of the mapper. - * @param tag The tag. - * @param getter The getter delegate to which {@link } reads will be delegated. - * @returns The newly created mapper instance. - * @see yfiles.collections.IMapper.#fromDelegate - * @template V - */ - createDelegateMapper?(tag:yfiles.algorithms.NodeDpKey,getter:(key:yfiles.graph.INode)=>V):yfiles.collections.IMapper; - /** - * Creates a delegate-based read-only {@link yfiles.collections.IMapper.} implementation and {@link yfiles.graph.IMapperRegistry#addMapper adds} it to the registry using the provided tag. - *

- * If there already was a mapper for tag, it will be replaced. - *

- * Type parameter K: The type of the keys of the mapper. - * Type parameter V: The type of the values of the mapper. - * @param tag The tag. - * @param getter The getter delegate to which {@link } reads will be delegated. - * @returns The newly created mapper instance. - * @see yfiles.collections.IMapper.#fromDelegate - * @template K,V - */ - createDelegateMapper?(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,tag:any,getter:(key:K)=>V):yfiles.collections.IMapper; - /** - * Creates and {@link yfiles.graph.IMapperRegistry#addMapper adds} a new {@link yfiles.collections.Mapper.} with key type {@link yfiles.graph.IEdge} to the registry using the provided tag. - *

- * The value type of the mapper is inferred by the provided tag. If there already was a mapper for - * tag, it will be replaced. - *

- * Type parameter V: The type of the values of the mapper. - * @param tag The tag. - * @returns The newly created mapper instance. - * @see yfiles.collections.Mapper. - * @template V - */ - createMapper?(tag:yfiles.algorithms.EdgeDpKey):yfiles.collections.Mapper; - /** - * Creates and {@link yfiles.graph.IMapperRegistry#addMapper adds} a new {@link yfiles.collections.Mapper.} with key type {@link yfiles.graph.ILabel} to the registry using the provided tag. - *

- * The value type of the mapper is inferred by the provided tag. If there already was a mapper for - * tag, it will be replaced. - *

- * Type parameter V: The type of the values of the mapper. - * @param tag The tag. - * @returns The newly created mapper instance. - * @see yfiles.collections.Mapper. - * @template V - */ - createMapper?(tag:yfiles.algorithms.ILabelLayoutDpKey):yfiles.collections.Mapper; - /** - * Creates and {@link yfiles.graph.IMapperRegistry#addMapper adds} a new {@link yfiles.collections.Mapper.} with key type {@link yfiles.graph.INode} to the registry using the provided tag. - *

- * The value type of the mapper is inferred by the provided tag. If there already was a mapper for - * tag, it will be replaced. - *

- * Type parameter V: The type of the values of the mapper. - * @param tag The tag. - * @returns The newly created mapper instance. - * @see yfiles.collections.Mapper. - * @template V - */ - createMapper?(tag:yfiles.algorithms.NodeDpKey):yfiles.collections.Mapper; - /** - * Creates and {@link yfiles.graph.IMapperRegistry#addMapper adds} a new {@link yfiles.collections.Mapper.} to the registry using the provided tag. - *

- * If there already was a mapper for tag, it will be replaced. - *

- * Type parameter K: The type of the keys of the mapper. - * Type parameter V: The type of the values of the mapper. - * @param tag The tag. - * @returns The newly created mapper instance. - * @see yfiles.collections.Mapper. - * @template K,V - */ - createMapper?(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,tag:any):yfiles.collections.Mapper; - /** - * Returns a mapper that has previously been registered with this instance for the given tag. - * Type parameter K: The key type for the mapper. - * Type parameter V: The value type for the mapper. - * @param tag The tag to use to look up the mapper. - * @returns The previously registered instance or null. - * @template K,V - * @abstract - */ - getMapper(tag:any):yfiles.collections.IMapper; - /** - * Gets the mapper {@link yfiles.graph.MapperMetadata meta data} for the mapper that is registered using the tag. - * @param tag The tag. - * @returns The meta data or null if there is no such mapper registered for the given tag. - * @abstract - */ - getMapperMetadata(tag:any):yfiles.graph.MapperMetadata; - /** - * Removes a previously registered mapper for the given tag. - * @param tag The tag that has been used for registering the mapper. - * @abstract - */ - removeMapper(tag:any):void; - /** - * Sets the mapper meta data for the mapper that has been {@link yfiles.graph.IMapperRegistry#addMapper registered} using the provided tag. - * @param tag The tag. - * @param metadata The meta data to store with the mapper. - * @throws {Stubs.Exceptions.ArgumentError} If the {@link yfiles.graph.MapperMetadata#keyType} or {@link yfiles.graph.MapperMetadata#valueType} mismatch the mapper instance in the registry. - * @abstract - */ - setMapperMetadata(tag:any,metadata:yfiles.graph.MapperMetadata):void; - /** - * Gets an enumerable over all tags that have been used to register mapper implementations with this interface. - * @abstract - * @type {yfiles.collections.IEnumerable.} - */ - registeredTags:yfiles.collections.IEnumerable; - } - var IMapperRegistry:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IMapperRegistry; - }; - /** - * The interface for node entities in an {@link yfiles.graph.IGraph}. - *

- * This interface provides read-only access to the properties of a node. In order to modify the state of an instance use - * the various methods provided by the {@link yfiles.graph.IGraph} this instance belongs to. Nodes and {@link yfiles.graph.IEdge edges} are the main entities - * that make up an {@link yfiles.graph.IGraph}. Nodes have zero or more {@link yfiles.graph.IPortOwner#ports} to which zero or more edges can connect. {@link yfiles.graph.IGraph} - * provides the {@link yfiles.graph.IGraph#edgesAt} method for querying the edges that connect to nodes. Also it is possible to - * query the {@link yfiles.graph.IGraph#edgesAt adjacent edges for each port} that is owned by nodes. This interface combines the functionality of {@link yfiles.graph.IPortOwner} - * to get access to the ports, {@link yfiles.graph.ILabelOwner} to get access to the labels, and, like all items in an IGraph, - * nodes support the {@link yfiles.graph.ILookup#lookup} method inherited from the {@link yfiles.graph.IModelItem} interface can be used to - * query additional aspects of each instance. - *

- *

- * The graph model with all relevant types and their relationships is presented in detail in the section {@link @DGUIDE_PREFIX@/graph.html The Graph Model}. - *

- *

- * Using the look-up mechanism is explained in the section {@link @DGUIDE_PREFIX@/customizing_concepts_lookup.html Service Locator Pattern: Lookup}. - *

- * @see yfiles.graph.IGraph - * @see yfiles.graph.IEdge - * @interface - * @implements {yfiles.graph.IPortOwner} - * @implements {yfiles.graph.ILabelOwner} - */ - export interface INode extends yfiles.lang.Object,yfiles.graph.IPortOwner,yfiles.graph.ILabelOwner{ - /** - * Gets a live view of the layout of the node. - *

- * The layout of a node is a rectangle in the world coordinate system that describes the bounding box of the representation - * of a node. Since this method will yield a live view, it is up to the client to copy the values of the instance if a - * snapshot of the state is needed. In order to modify the layout of a node, use the {@link yfiles.graph.IGraph#setNodeLayout various methods} in - * {@link yfiles.graph.IGraph}. - *

- * @abstract - * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - /** - * Gets the style that is responsible for the visual representation of this node in a {@link yfiles.view.CanvasComponent}. - *

- * In order to set the style on an instance, use the {@link yfiles.graph.IGraph#setStyle} method. Note that the style instance - * associated with a node instance may be shared between multiple node instances and that the modification of this style - * will result in a change of the appearance of all nodes that are associated with the same style instance. - *

- * @abstract - * @type {yfiles.styles.INodeStyle} - */ - style:yfiles.styles.INodeStyle; - } - var INode:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.INode; - }; - /** - * Interface used by {@link yfiles.graph.IGraph} and the like to declare and obtain the defaults for nodes and their labels or - * ports. - *

- * Note that changing these defaults does not change properties of already created model items. Rather, only items created - * after the change are affected. - *

- * @see yfiles.graph.IGraph#nodeDefaults - * @see yfiles.graph.IGraph#groupNodeDefaults - * @interface - */ - export interface INodeDefaults extends yfiles.lang.Object{ - /** - * Factory method that returns a style instance for use with newly created nodes. - *

- * Most implementations will yield either, a {@link yfiles.lang.ICloneable#clone clone} of or the {@link yfiles.graph.INodeDefaults#style} property, if {@link yfiles.graph.INodeDefaults#shareStyleInstance} is enabled, but they might use more complicated - * logic, too. - *

- * @returns The style to use, which for most implementations is either a {@link #clone clone} of or the {@link #style} property, if {@link #shareStyleInstance} is enabled. - * @abstract - */ - getStyleInstance():yfiles.styles.INodeStyle; - /** - * Gets or sets the style to use for nodes. - *

- * Depending on the setting of {@link yfiles.graph.INodeDefaults#shareStyleInstance}, the {@link yfiles.graph.INodeDefaults#getStyleInstance} method should return a {@link yfiles.lang.ICloneable#clone clone} of this - * instance or the very same instance. - *

- * @see yfiles.graph.INodeDefaults#shareStyleInstance - * @abstract - * @type {yfiles.styles.INodeStyle} - */ - style:yfiles.styles.INodeStyle; - /** - * Gets or sets a value indicating whether the {@link yfiles.graph.INodeDefaults#style} instance should be shared referentially or {@link yfiles.lang.ICloneable#clone cloned} upon a call to - * {@link yfiles.graph.INodeDefaults#getStyleInstance}. - * @see yfiles.graph.INodeDefaults#getStyleInstance - * @see yfiles.graph.INodeDefaults#style - * @abstract - * @type {boolean} - */ - shareStyleInstance:boolean; - /** - * Gets or sets the defaults for ports at nodes. - * @abstract - * @type {yfiles.graph.IPortDefaults} - */ - ports:yfiles.graph.IPortDefaults; - /** - * Gets or sets the defaults for labels at nodes. - * @abstract - * @type {yfiles.graph.ILabelDefaults} - */ - labels:yfiles.graph.ILabelDefaults; - /** - * Gets or sets the default node size. - *

- * The values of this size will be used by the {@link yfiles.graph.IGraph#createNodeAt} and {@link yfiles.graph.IGraph#createNodeAt} - * methods. - *

- * @abstract - * @type {yfiles.geometry.Size} - */ - size:yfiles.geometry.Size; - } - var INodeDefaults:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.INodeDefaults; - }; - /** - * The interface used in an {@link yfiles.graph.IGraph} implementation for {@link yfiles.graph.IEdge}s to connect to. - *

- * This interface provides read-only access to the properties of a port. In order to modify the state of an instance use - * the various methods provided by the {@link yfiles.graph.IGraph} this instance belongs to. Ports are owned by {@link yfiles.graph.IPortOwner IPortOwners}, - * normally an {@link yfiles.graph.INode}, but this can also be an {@link yfiles.graph.IEdge} in special graph implementations. To obtain - * the {@link yfiles.graph.IEdge} instances that are connected to a certain port instance, applications need to use the {@link yfiles.graph.IGraph#edgesAt} - * method provided by {@link yfiles.graph.IGraph}. Zero or more edges may be connected to a port, depending on the implementation - * of the graph. Like all items in an IGraph, this item supports the {@link yfiles.graph.ILookup#lookup} method that can be used to - * query additional aspects of the item. - *

- *

- * The graph model with all relevant types and their relationships is presented in detail in the section {@link @DGUIDE_PREFIX@/graph.html The Graph Model}. - *

- *

- * Using the look-up mechanism is explained in the section {@link @DGUIDE_PREFIX@/customizing_concepts_lookup.html Service Locator Pattern: Lookup}. - *

- * @interface - * @implements {yfiles.graph.IModelItem} - */ - export interface IPort extends yfiles.lang.Object,yfiles.graph.IModelItem{ - /** - * Gets the owner of this port. - *

- * In traditional {@link yfiles.graph.IGraph} implementations, this will be an {@link yfiles.graph.INode} and can safely be cast to one. In - * order to get to the {@link yfiles.graph.IEdge}s that connect to this instance, use {@link yfiles.graph.IGraph}'s {@link yfiles.graph.IGraph#edgesAt} - * method. - *

- * @abstract - * @type {yfiles.graph.IPortOwner} - */ - owner:yfiles.graph.IPortOwner; - /** - * Gets the style that is responsible for the visual representation of this port in a {@link yfiles.view.CanvasComponent}. - *

- * In order to set the style on an instance, use the {@link yfiles.graph.IGraph#setStyle} method. Note that the style instance - * associated with a port instance may be shared between multiple port instances and that the modification of this style - * will result in a change of the appearance of all ports that are associated with the same style instance. - *

- * @abstract - * @type {yfiles.styles.IPortStyle} - */ - style:yfiles.styles.IPortStyle; - /** - * Gets the {@link yfiles.graph.IPortLocationModelParameter} that is used to determine the location of this port. - *

- * The port location can be calculated using the {@link yfiles.graph.IPortLocationModelParameter#model}'s {@link yfiles.graph.IPortLocationModel#getLocation} method or the convenience - * methods {@link yfiles.graph.IPort#location} and {@link yfiles.graph.IPort#dynamicLocation}. - *

- *

- * Note that parameters may be shared across port instances. - *

- * @see yfiles.graph.IGraph#setPortLocationParameter - * @see yfiles.graph.IPort#location - * @see yfiles.graph.IPort#dynamicLocation - * @abstract - * @type {yfiles.graph.IPortLocationModelParameter} - */ - locationParameter:yfiles.graph.IPortLocationModelParameter; - /** - * Gets a snapshot of the current location of the port. - *

- * Unlike {@link yfiles.graph.IPort#dynamicLocation} this does not return a dynamic point that always refers to the current location. - *

- * @type {yfiles.geometry.Point} - */ - location?:yfiles.geometry.Point; - /** - * Gets a live view of the location of the port in world coordinates. - *

- * The location is the anchor for the edges, that connect to this port, however it is up to the visualization logic where - * exactly the visual part of an edge will end. As this will yield a live view, it is up to the client to copy the values - * if a snapshot of the state is needed. In order to modify the location of a port, use the {@link yfiles.graph.IGraph#setPortLocationParameter} - * in {@link yfiles.graph.IGraph}. - *

- * @see yfiles.graph.IPort#locationParameter - * @type {yfiles.geometry.IPoint} - */ - dynamicLocation?:yfiles.geometry.IPoint; - } - var IPort:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IPort; - }; - /** - * The common interface for items in an {@link yfiles.graph.IGraph} that may own {@link yfiles.graph.IPort ports}. - *

- * Typically this interface is actively implemented by {@link yfiles.graph.INode}'s in an {@link yfiles.graph.IGraph}. To get to the edge - * instances that connect to the ports, the {@link yfiles.graph.IGraph#edgesAt} method can be used. Alternatively for each {@link yfiles.graph.IPort} - * in {@link yfiles.graph.IPortOwner#ports}, one can use the {@link yfiles.graph.IGraph#edgesAt} method provided by {@link yfiles.graph.IGraph}. Like all items in an IGraph, - * this item supports the {@link yfiles.graph.ILookup#lookup} method that can be used to query additional aspects of the item. - *

- * @see yfiles.graph.INode - * @see yfiles.graph.IEdge - * @interface - * @implements {yfiles.graph.IModelItem} - */ - export interface IPortOwner extends yfiles.lang.Object,yfiles.graph.IModelItem{ - /** - * Gets a collection of {@link yfiles.graph.IPort ports} that are owned by this instance. - *

- * This gives access to a read-only live view of the ports, i.e. the collection can change over time, as well as the ports - * contained in it. If a snapshot of the current state is needed, one needs to copy the collection. - *

- * @abstract - * @type {yfiles.collections.IListEnumerable.} - */ - ports:yfiles.collections.IListEnumerable; - } - var IPortOwner:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IPortOwner; - }; - /** - * Interface used by {@link yfiles.graph.IGraph} to declare and obtain the defaults for ports at nodes and edges. - *

- * Note that changing these defaults does not change properties of already created model items. Rather, only items created - * after the change are affected. - *

- * @see yfiles.graph.IPort - * @see yfiles.graph.INodeDefaults#ports - * @see yfiles.graph.IEdgeDefaults#ports - * @see yfiles.graph.IGraph#nodeDefaults - * @see yfiles.graph.IGraph#edgeDefaults - * @interface - */ - export interface IPortDefaults extends yfiles.lang.Object{ - /** - * Factory method that returns a location model parameter instance for use with newly created ports. - *

- * Most implementations will yield either, a {@link yfiles.lang.ICloneable#clone clone} of or the {@link yfiles.graph.IPortDefaults#locationParameter} property, if {@link yfiles.graph.IPortDefaults#shareLocationParameterInstance} is enabled, but they might use more complicated - * logic, too. - *

- * @param owner The owner of the port that will be created. - * @returns The parameter to use, which for most implementations is either a {@link #clone clone} of or the {@link #locationParameter} property, if {@link #shareLocationParameterInstance} is enabled. - * @abstract - */ - getLocationParameterInstance(owner:yfiles.graph.IPortOwner):yfiles.graph.IPortLocationModelParameter; - /** - * Factory method that returns a style instance for use with newly created ports. - *

- * Most implementations will yield either, a {@link yfiles.lang.ICloneable#clone clone} of or the {@link yfiles.graph.IPortDefaults#style} property, if {@link yfiles.graph.IPortDefaults#shareStyleInstance} is enabled, but they might use more complicated - * logic, too. - *

- * @param owner The owner of the port that will be created. - * @returns The style to use, which for most implementations is either a {@link #clone clone} of or the {@link #style} property, if {@link #shareStyleInstance} is enabled. - * @abstract - */ - getStyleInstance(owner:yfiles.graph.IPortOwner):yfiles.styles.IPortStyle; - /** - * Gets or sets the style to use for ports. - *

- * Depending on the setting of {@link yfiles.graph.IPortDefaults#shareStyleInstance}, the {@link yfiles.graph.IPortDefaults#getStyleInstance} method should return a {@link yfiles.lang.ICloneable#clone clone} of this - * instance or the very same instance. - *

- * @see yfiles.graph.IPortDefaults#shareStyleInstance - * @abstract - * @type {yfiles.styles.IPortStyle} - */ - style:yfiles.styles.IPortStyle; - /** - * Gets or sets whether unused ports should automatically be removed from their owners as soon as no further edge is - * connected to them. - * @see yfiles.graph.IGraph#remove - * @abstract - * @type {boolean} - */ - autoCleanup:boolean; - /** - * Gets or sets a value indicating whether the {@link yfiles.graph.IPortDefaults#style} instance should be shared referentially or {@link yfiles.lang.ICloneable#clone cloned} upon a call to - * {@link yfiles.graph.IPortDefaults#getStyleInstance}. - * @see yfiles.graph.IPortDefaults#getStyleInstance - * @see yfiles.graph.IPortDefaults#style - * @abstract - * @type {boolean} - */ - shareStyleInstance:boolean; - /** - * Gets or sets the location model parameter to use for ports. - *

- * Depending on the setting of {@link yfiles.graph.IPortDefaults#shareLocationParameterInstance}, the {@link yfiles.graph.IPortDefaults#getLocationParameterInstance} method should return a {@link yfiles.lang.ICloneable#clone clone} - * of this instance or the very same instance. - *

- * @see yfiles.graph.IPortDefaults#shareLocationParameterInstance - * @see yfiles.graph.IPortDefaults#getLocationParameterInstance - * @abstract - * @type {yfiles.graph.IPortLocationModelParameter} - */ - locationParameter:yfiles.graph.IPortLocationModelParameter; - /** - * Gets or sets a value indicating whether the {@link yfiles.graph.IPortDefaults#locationParameter} instance should be shared referentially or {@link yfiles.lang.ICloneable#clone cloned} upon a call to - * {@link yfiles.graph.IPortDefaults#getLocationParameterInstance}. - * @see yfiles.graph.IPortDefaults#getLocationParameterInstance - * @see yfiles.graph.IPortDefaults#locationParameter - * @abstract - * @type {boolean} - */ - shareLocationParameterInstance:boolean; - } - var IPortDefaults:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IPortDefaults; - }; - /** - * Defines the geometry of {@link yfiles.graph.IPort} instances with respect to specific - * {@link yfiles.graph.IPortLocationModelParameter}s. - *

- * In addition to defining the location of a port with respect to a specific - * {@link yfiles.graph.IPortLocationModelParameter}, a port location model is typically the factory of the model parameters that - * are compatible with it, too. - *

- *

- * Typically, the port location model defines a compilation of valid locations for ports, and a specific model parameter - * specifies an exact geometry for a port. - *

- *

- * By design, the same instance of a port location model can be shared by multiple port location model parameters. - * Similarly, the same instance of a port location model parameter can be shared by multiple ports. - *

- *

- * This interface supports the {@link yfiles.graph.ILookup#lookup} method that can be used to query additional aspects of the - * implementation. - *

- * @see yfiles.graph.IPortLocationModelParameter - * @see yfiles.graph.IPort - * @see yfiles.graph.IGraph - * @interface - * @implements {yfiles.graph.ILookup} - */ - export interface IPortLocationModel extends yfiles.lang.Object,yfiles.graph.ILookup{ - /** - * Factory method that creates a parameter for the given port that tries to match the provided location in absolute world - * coordinates. - * @param owner The port owner that will own the port for which the parameter shall be created. - * @param location The location in the world coordinate system that should be matched as best as possible. - * @returns A new instance that can be used to describe the location of an {@link } at the given owner. - * @abstract - */ - createParameter(owner:yfiles.graph.IPortOwner,location:yfiles.geometry.Point):yfiles.graph.IPortLocationModelParameter; - /** - * Provides a {@link yfiles.graph.ILookup lookup context} for the given combination of port and parameter. - * @param port The port to use in the context. - * @param locationParameter The parameter to use for the port in the context. - * @returns An implementation of the {@link } interface that can be used to query additional aspects of the - * port/parameter combination. - * @abstract - */ - getContext(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.graph.ILookup; - /** - * Determines the location of the port for the given parameter. - * @param port The port to determine the location for. - * @param locationParameter The parameter to use. The parameter can be expected to be created by this instance having the {@link #model} property set to this - * instance.. - * @returns The calculated location of the port. - * @abstract - */ - getLocation(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.geometry.Point; - } - var IPortLocationModel:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IPortLocationModel; - }; - /** - * Defines a state that can be used to {@link yfiles.graph.IPortLocationModel#getLocation determine the location of a port} with a {@link yfiles.graph.IPortLocationModel}. - *

- * Typically, implementations of this interface are created by factory methods of the corresponding {@link yfiles.graph.IPortLocationModelParameter#model}. - *

- *

- * This interface extends the {@link yfiles.lang.ICloneable} interface. This allows clients to obtain a persistent copy of the - * current state of this parameter. Immutable parameter implementations may return themselves. - *

- * @see yfiles.graph.IPortLocationModel - * @see yfiles.graph.IPort - * @interface - * @implements {yfiles.lang.ICloneable} - */ - export interface IPortLocationModelParameter extends yfiles.lang.Object,yfiles.lang.ICloneable{ - /** - * Determines whether this parameter can be used for ports at the given owner. - *

- * A parameter must not necessarily support all types of ports. This method returns whether it supports ports at the given - * owner. - *

- * @param owner The port owner to test. - * @returns true if this instance can be used for ports of the given port owner, false otherwise. - * @abstract - */ - supports(owner:yfiles.graph.IPortOwner):boolean; - /** - * Gets the model that created this parameter. - * @abstract - * @type {yfiles.graph.IPortLocationModel} - */ - model:yfiles.graph.IPortLocationModel; - } - var IPortLocationModelParameter:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IPortLocationModelParameter; - }; - export enum InteriorStretchLabelModelPosition{ - /** - * Encodes a position at the top side of the node interior - */ - NORTH, - /** - * Encodes a position at the right side of the node interior - */ - EAST, - /** - * Encodes a position at the bottom side of the node interior - */ - SOUTH, - /** - * Encodes a position at the left side of the node interior - */ - WEST, - /** - * Encodes a position at the center of the node interior - */ - CENTER - } - /** - * A label model for node labels that lie inside of the node's {@link yfiles.graph.INode#layout} bounds and have been stretched to fit the node's size. - *

- * This label model supports 5 positions inside of the layout's bounds. - *

- * @class - * @implements {yfiles.graph.ILabelModel} - * @implements {yfiles.graph.ILabelModelParameterProvider} - */ - export interface InteriorStretchLabelModel extends yfiles.lang.Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{} - export class InteriorStretchLabelModel { - /** - * Creates a new instance of this model with empty insets. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.geometry.Insets} options.insets The insets to use within the node's {@link yfiles.graph.INode#layout}. - *

- * This option sets the {@link yfiles.graph.InteriorStretchLabelModel#insets} property on the created object. - *

- */ - constructor(options?:{insets?:yfiles.geometry.Insets}); - /** - * - * @returns - */ - createDefaultParameter():yfiles.graph.ILabelModelParameter; - /** - * Creates the parameter for the given position. - * @param position The position. - * @returns - */ - createParameter(position:yfiles.graph.InteriorStretchLabelModelPosition):yfiles.graph.ILabelModelParameter; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; - /** - * Returns the minimum size this model would require for the node owner of the label if the the given label was used with - * the provided parameter. - * @param label The label to use. - * @param layoutParameter The parameter to use. - * @returns The minimum size requirements for this label. - */ - getMinimumNodeSize(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.Size; - /** - * Returns the insets this model would require for the node owner of the label if the the given label was used with the - * provided parameter. - * @param label The label to use. - * @param layoutParameter The parameter to use. - * @returns The insets rectangle. - */ - getNodeInsets(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.Insets; - /** - * - * @param label - * @param model - * @returns - */ - getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instance's {@link yfiles.graph.InteriorStretchLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static NORTH:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instance's {@link yfiles.graph.InteriorStretchLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static EAST:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instance's {@link yfiles.graph.InteriorStretchLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static SOUTH:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instance's {@link yfiles.graph.InteriorStretchLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static WEST:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instance's {@link yfiles.graph.InteriorStretchLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static CENTER:yfiles.graph.ILabelModelParameter; - /** - * Gets or sets the insets to use within the node's {@link yfiles.graph.INode#layout}. - * @default '0' - * @type {yfiles.geometry.Insets} - */ - insets:yfiles.geometry.Insets; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.InteriorStretchLabelModel; - } - export enum InteriorLabelModelPosition{ - /** - * Encodes a position at the top side of the node interior - */ - NORTH, - /** - * Encodes a position at the right side of the node interior - */ - EAST, - /** - * Encodes a position at the bottom side of the node interior - */ - SOUTH, - /** - * Encodes a position at the left side of the node interior - */ - WEST, - /** - * Encodes a position at the upper right corner of the node interior - */ - NORTH_EAST, - /** - * Encodes a position at the lower right corner of the node interior - */ - SOUTH_EAST, - /** - * Encodes a position at the upper left corner of the node interior - */ - NORTH_WEST, - /** - * Encodes a position at the lower left corner of the node interior - */ - SOUTH_WEST, - /** - * Encodes a position at the center of the node interior - */ - CENTER - } - /** - * A label model for node labels that lie inside of the node's {@link yfiles.graph.INode#layout} bounds. - *

- * This label model supports nine positions inside of the layout's bounds. - *

- * @class - * @implements {yfiles.graph.ILabelModel} - * @implements {yfiles.graph.ILabelModelParameterProvider} - */ - export interface InteriorLabelModel extends yfiles.lang.Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{} - export class InteriorLabelModel { - /** - * Creates a new instance of this model with empty insets. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.geometry.Insets} options.insets The insets to use within the node's {@link yfiles.graph.INode#layout}. - *

- * This option sets the {@link yfiles.graph.InteriorLabelModel#insets} property on the created object. - *

- */ - constructor(options?:{insets?:yfiles.geometry.Insets}); - /** - * - * @returns - */ - createDefaultParameter():yfiles.graph.ILabelModelParameter; - /** - * Creates the parameter for the given position. - * @param position The position. - * @returns - */ - createParameter(position:yfiles.graph.InteriorLabelModelPosition):yfiles.graph.ILabelModelParameter; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; - /** - * Returns the minimum size this model would require for the node owner of the label if the the given label was used with - * the provided parameter. - * @param label The label to use. - * @param layoutParameter The parameter to use. - * @returns The minimum size requirements for this label. - */ - getMinimumNodeSize(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.Size; - /** - * Returns the insets this model would require for the node owner of the label if the the given label was used with the - * provided parameter. - * @param label The label to use. - * @param layoutParameter The parameter to use. - * @returns The insets rectangle. - */ - getNodeInsets(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.Insets; - /** - * - * @param label - * @param model - * @returns - */ - getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.InteriorLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static NORTH:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.InteriorLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static EAST:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.InteriorLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static SOUTH:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.InteriorLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static SOUTH_EAST:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.InteriorLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static SOUTH_WEST:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.InteriorLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static WEST:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.InteriorLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static NORTH_EAST:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.InteriorLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static NORTH_WEST:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.InteriorLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static CENTER:yfiles.graph.ILabelModelParameter; - /** - * Gets or sets the insets to use within the node's {@link yfiles.graph.INode#layout}. - * @default '0' - * @type {yfiles.geometry.Insets} - */ - insets:yfiles.geometry.Insets; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.InteriorLabelModel; - } - /** - * The meta data that is associated with {@link yfiles.collections.IMapper.}s in a {@link yfiles.graph.IMapperRegistry}. - * @see yfiles.graph.IMapperRegistry#getMapperMetadata - * @see yfiles.graph.IMapperRegistry#setMapperMetadata - * @class - */ - export interface MapperMetadata extends yfiles.lang.Object{} - export class MapperMetadata { - /** - * Initializes a new instance of the {@link yfiles.graph.MapperMetadata} class. - * @param keyType Type of the keys. - * @param valueType Type of the values. - */ - constructor(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class); - /** - * Initializes a new instance of the {@link yfiles.graph.MapperMetadata} from the given instance class. - * @param metadata The metadata to copy key and value type from. - * @protected - */ - constructor(metadata:yfiles.graph.MapperMetadata); - /** - * Creates an instance for the specified mapper. - * Type parameter TKey: The type of the keys. - * Type parameter TValue: The type of the values. - * @param valueType The type of the values. - * @param keyType The type of the keys. - * @param mapper The mapper instance to create the metadata for. - * @returns An instance that uses the {@link #keyType} and {@link #valueType} of the mapper. - * @template TKey,TValue - * @static - */ - static create(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,mapper:yfiles.collections.IMapper):yfiles.graph.MapperMetadata; - /** - * - * @type {yfiles.lang.Class} - */ - keyType:yfiles.lang.Class; - /** - * - * @type {yfiles.lang.Class} - */ - valueType:yfiles.lang.Class; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.MapperMetadata; - } - /** - * A simple {@link yfiles.collections.Map.}-based implementation of the {@link yfiles.graph.IMapperRegistry} interface. - * @class - * @implements {yfiles.graph.IMapperRegistry} - * @final - */ - export interface MapperRegistry extends yfiles.lang.Object,yfiles.graph.IMapperRegistry{} - export class MapperRegistry { - constructor(); - /** - * - * Type parameter K. - * Type parameter V. - * @param valueType - * @param keyType - * @param tag - * @param mapper - * @template K,V - */ - addMapper(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,tag:any,mapper:yfiles.collections.IMapper):void; - /** - * - * Type parameter K. - * Type parameter V. - * @param tag - * @returns - * @template K,V - */ - getMapper(tag:any):yfiles.collections.IMapper; - /** - * - * @param tag - * @returns - */ - getMapperMetadata(tag:any):yfiles.graph.MapperMetadata; - /** - * - * @param tag - */ - removeMapper(tag:any):void; - /** - * - * @param tag - * @param metadata - */ - setMapperMetadata(tag:any,metadata:yfiles.graph.MapperMetadata):void; - /** - * - * @type {yfiles.collections.IEnumerable.} - */ - registeredTags:yfiles.collections.IEnumerable; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.MapperRegistry; - } - export enum NinePositionsEdgeLabelModelPosition{ - /** - * Encodes a label position at the source above the edge - */ - SOURCE_ABOVE, - /** - * Encodes a label position at the center above the edge - */ - CENTER_ABOVE, - /** - * Encodes a label position at the target above the edge - */ - TARGET_ABOVE, - /** - * Encodes a label position at the source of the edge that lies on the edge - */ - SOURCE_CENTERED, - /** - * Encodes a label position at the center of the edge that lies on the edge - */ - CENTER_CENTERED, - /** - * Encodes a label position at the source of the edge that lies on the edge - */ - TARGET_CENTERED, - /** - * Encodes a label position at the source below the edge - */ - SOURCE_BELOW, - /** - * Encodes a label position at the center below the edge - */ - CENTER_BELOW, - /** - * Encodes a label position at the target below the edge - */ - TARGET_BELOW - } - /** - * An edge label model that knows nine different label positions. - *

- * The possible positions are near the source port, at the center of the edge, or near the target port, each above, below, - * or centered on the edge. The distance to the edge and the absolute angular orientation of the label can be specified. - *

- * @class - * @implements {yfiles.graph.ILabelModel} - * @implements {yfiles.graph.ILabelModelParameterProvider} - */ - export interface NinePositionsEdgeLabelModel extends yfiles.lang.Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{} - export class NinePositionsEdgeLabelModel { - /** - * Initializes a new instance of the {@link yfiles.graph.NinePositionsEdgeLabelModel} class. - * @param distance The distance. - * @param angle The angle. - */ - constructor(distance:number,angle:number); - /** - * Initializes a new instance of the {@link yfiles.graph.NinePositionsEdgeLabelModel} class with a {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} of 10 and an {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} of 0. - * @param {Object} [options=null] The parameters to pass. - * @param {number} options.angle The angle for the rotation of the labels. - *

- * This option sets the {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} property on the created object. - *

- * @param {number} options.distance The distance of the labels above or below the edge. - *

- * This option sets the {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} property on the created object. - *

- */ - constructor(options?:{angle?:number,distance?:number}); - /** - * - * @returns - */ - createDefaultParameter():yfiles.graph.ILabelModelParameter; - /** - * Create a model parameter for the specified position - * @param position The position for this parameter - * @returns a model parameter for the specified position - */ - createParameter(position:yfiles.graph.NinePositionsEdgeLabelModelPosition):yfiles.graph.ILabelModelParameter; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; - /** - * - * @param label - * @param model - * @returns - */ - getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} or {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} properties will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static SOURCE_ABOVE:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} or {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} properties will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static CENTER_ABOVE:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} or {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} properties will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static TARGET_ABOVE:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} or {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} properties will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static SOURCE_CENTERED:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} or {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} properties will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static CENTER_CENTERED:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} or {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} properties will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static TARGET_CENTERED:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} or {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} properties will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static SOURCE_BELOW:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} or {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} properties will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static CENTER_BELOW:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} or {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} properties will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static TARGET_BELOW:yfiles.graph.ILabelModelParameter; - /** - * Gets or sets the angle for the rotation of the labels. - *

- * A value of 0 makes the label appear horizontally aligned. - *

- * @default 0.0 - * @type {number} - */ - angle:number; - /** - * Gets or sets the distance of the labels above or below the edge. - * @default 10.0 - * @type {number} - */ - distance:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.NinePositionsEdgeLabelModel; - } - /** - * A node label model that knows only two possible positions. - *

- * The label will be placed centered on top or below the node's {@link yfiles.graph.INode#layout} using a specifiable {@link yfiles.graph.SandwichLabelModel#yOffset}. - *

- * @class - * @implements {yfiles.graph.ILabelModel} - * @implements {yfiles.graph.ILabelModelParameterProvider} - */ - export interface SandwichLabelModel extends yfiles.lang.Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{} - export class SandwichLabelModel { - /** - * Initializes a new instance of the {@link yfiles.graph.SandwichLabelModel} class with zero offset. - * @param {Object} [options=null] The parameters to pass. - * @param {number} options.yOffset The distance between the node's {@link yfiles.graph.INode#layout} and the label's {@link yfiles.graph.ILabel#layout layout}. - *

- * This option sets the {@link yfiles.graph.SandwichLabelModel#yOffset} property on the created object. - *

- */ - constructor(options?:{yOffset?:number}); - /** - * - * @returns - */ - createDefaultParameter():yfiles.graph.ILabelModelParameter; - /** - * Creates a parameter for the north side of the node. - * @returns - */ - createNorthParameter():yfiles.graph.ILabelModelParameter; - /** - * Creates a parameter for the south side of the node. - * @returns - */ - createSouthParameter():yfiles.graph.ILabelModelParameter; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; - /** - * - * @param label - * @param model - * @returns - */ - getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.SandwichLabelModel#yOffset} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static NORTH:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.SandwichLabelModel#yOffset} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static SOUTH:yfiles.graph.ILabelModelParameter; - /** - * Gets or sets the distance between the node's {@link yfiles.graph.INode#layout} and the label's {@link yfiles.graph.ILabel#layout layout}. - * @default 0.0 - * @type {number} - */ - yOffset:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.SandwichLabelModel; - } - /** - * A port location model that places the port on a certain edge segment at a specified ratio. - * @class - * @implements {yfiles.graph.IPortLocationModel} - * @final - */ - export interface SegmentRatioPortLocationModel extends yfiles.lang.Object,yfiles.graph.IPortLocationModel{} - export class SegmentRatioPortLocationModel { - /** - * Creates the a new parameter for the specified segment index and ratio. - * @param ratio The ratio for the segment, with 0 being at the start of the segment and 1 at the end. - * @param segmentIndex The index of the segment. - * @returns A parameter for the given ratio and segment. - */ - createFromSource(ratio:number,segmentIndex:number):yfiles.graph.IPortLocationModelParameter; - /** - * Creates the a new parameter for the specified segment index counted from the target end of the edge and the provided - * ratio. - * @param ratio The ratio for the segment, with 0 being at the start of the segment and 1 at the end. - * @param segmentIndex The index of the segment counted from the target end. - * @returns A parameter for the given ratio and segment. - */ - createFromTarget(ratio:number,segmentIndex:number):yfiles.graph.IPortLocationModelParameter; - /** - * - * @param owner - * @param location - * @returns - */ - createParameter(owner:yfiles.graph.IPortOwner,location:yfiles.geometry.Point):yfiles.graph.IPortLocationModelParameter; - /** - * - * @param port - * @param locationParameter - * @returns - */ - getContext(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.graph.ILookup; - /** - * - * @param port - * @param locationParameter - * @returns - */ - getLocation(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.geometry.Point; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * A static immutable global instance of this class. - * @const - * @static - * @type {yfiles.graph.SegmentRatioPortLocationModel} - */ - static INSTANCE:yfiles.graph.SegmentRatioPortLocationModel; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.SegmentRatioPortLocationModel; - } - /** - * An edge label model that allows the placement at any position. - *

- * Similar to - * {@link yfiles.graph.EdgeSegmentLabelModel}, a position is specified by an edge segment and a ratio on that segment, amongst - * others. During changes of the edge path, the label keeps its relative location with respect to the bends of the - * reference segment in a similar way. - *

- *

- * In contrast to {@link yfiles.graph.EdgeSegmentLabelModel}, the distance from the edge path is not a property of the model but of - * the particular parameter. In addition, this class does not implement {@link yfiles.graph.ILabelModelParameterProvider} and - * therefore, labels with this model can be moved freely and are not restricted to a fixed set of candidates at a given - * distance from the edge. - *

- *

- * If {@link yfiles.graph.SmartEdgeLabelModel#autoRotation} is enabled, labels are automatically rotated according to the angle of the corresponding reference edge segment. - *

- *

- * During movements, labels with this model snap to noteable positions if the {@link yfiles.input.MoveLabelInputMode} provides a {@link yfiles.input.LabelSnapContext} - * that is enabled and has a suitable configuration. - *

- * @class - * @implements {yfiles.graph.ILabelModel} - * @implements {yfiles.graph.ILabelModelParameterFinder} - */ - export interface SmartEdgeLabelModel extends yfiles.lang.Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterFinder{} - export class SmartEdgeLabelModel { - /** - * Initializes a new instance of this class. - * @param {Object} [options=null] The parameters to pass. - * @param {number} options.angle The rotation angle of all labels with this model. - *

- * This option sets the {@link yfiles.graph.SmartEdgeLabelModel#angle} property on the created object. - *

- * @param {boolean} options.autoRotation Whether or not edge labels are automatically rotated according to the angle of the corresponding reference edge segment. - *

- * This option sets the {@link yfiles.graph.SmartEdgeLabelModel#autoRotation} property on the created object. - *

- */ - constructor(options?:{angle?:number,autoRotation?:boolean}); - /** - * - * @returns - */ - createDefaultParameter():yfiles.graph.ILabelModelParameter; - /** - * Creates a parameter that measures the provided segment index from the source side of the edge path. - * @param segmentIndex The zero-based index of the segment beginning from the source side. - * @param distance The distance between the label's box and the edge's path. - * @param segmentRatio The ratio at which to place the label at the segment. A ratio of 0.0 will place the label at the source side of the - * segment, a ratio of 1.0 at the target side. Ratios lesser than 0.0 or greater than 1.0 will be interpreted as absolute - * values in world coordinates. - * @returns A label parameter that describes the provided parameters for this model instance. - */ - createParameterFromSource(segmentIndex:number,distance:number,segmentRatio:number):yfiles.graph.ILabelModelParameter; - /** - * Creates a parameter that measures the provided segment index from the target side of the edge path. - * @param segmentIndex The zero-based index of the segment beginning from the target side. - * @param distance The distance between the label's box and the edge's path. - * @param segmentRatio The ratio at which to place the label at the segment. A ratio of 0.0 will place the label at the target side of the - * segment, a ratio of 1.0 at the source side. Ratios lesser than 0.0 or greater than 1.0 will be interpreted as absolute - * values in world coordinates. - * @returns A label parameter that describes the provided parameters for this model instance. - */ - createParameterFromTarget(segmentIndex:number,distance:number,segmentRatio:number):yfiles.graph.ILabelModelParameter; - /** - * - * @param label - * @param model - * @param layout - * @returns - */ - findBestParameter(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel,layout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; - /** - * Gets the distance from the edge path described by the specified parameter. - * @param layoutParameter The parameter to get the edge path distance for. - * @returns The distance from the edge path - */ - getDistance(layoutParameter:yfiles.graph.ILabelModelParameter):number; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * Gets or sets whether or not edge labels are automatically rotated according to the angle of the corresponding reference - * edge segment. - *

- * By default, this feature is enabled. - *

- * @default true - * @type {boolean} - */ - autoRotation:boolean; - /** - * Gets or sets the rotation angle of all labels with this model. - * @default 0.0 - * @type {number} - */ - angle:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.SmartEdgeLabelModel; - } - export enum StripeTypes{ - /** - * Constant for rows. - * @see yfiles.graph.StripeTypes#ROW - */ - ROW, - /** - * Constant for columns. - * @see yfiles.graph.StripeTypes#COLUMN - */ - COLUMN, - /** - * Constant for all item types. - *

- * This is a bitwise combination of all other types declared in this enum. - *

- */ - ALL, - /** - * Constant for no item type. - *

- * This is a constant where no type bit has been set, i.e. it is 0. - *

- */ - NONE - } - /** - * A canonic implementation of the {@link yfiles.graph.IPortDefaults} interface. - * @class - * @implements {yfiles.graph.IPortDefaults} - */ - export interface PortDefaults extends yfiles.lang.Object,yfiles.graph.IPortDefaults{} - export class PortDefaults { - /** - * Initializes a new instance of the {@link yfiles.graph.PortDefaults} class using a trivial location model parameter. - * @param {Object} [options=null] The parameters to pass. - * @param {boolean} [options.autoCleanup=null] Sets the autoCleanup property. - * @param {yfiles.graph.IPortLocationModelParameter} [options.locationParameter=null] Sets the locationParameter property. - * @param {boolean} [options.shareLocationParameterInstance=null] Sets the shareLocationParameterInstance property. - * @param {yfiles.styles.IPortStyle} [options.style=null] Sets the style property. - * @param {boolean} [options.shareStyleInstance=null] Sets the shareStyleInstance property. - */ - constructor(options?:{autoCleanup?:boolean,locationParameter?:yfiles.graph.IPortLocationModelParameter,shareLocationParameterInstance?:boolean,style?:yfiles.styles.IPortStyle,shareStyleInstance?:boolean}); - /** - * Factory method that returns a style instance for use with newly created ports. - *

- * Most implementations will yield either, a {@link yfiles.lang.ICloneable#clone clone} of or the {@link yfiles.graph.PortDefaults#style} property, if {@link yfiles.graph.PortDefaults#shareStyleInstance} is enabled, but they might use more complicated - * logic, too. - *

- * @returns The style to use, which for most implementations is either a {@link #clone clone} of or the {@link #style} property, if {@link #shareStyleInstance} is enabled. - */ - GetDefaultStyleInstance():yfiles.styles.IPortStyle; - /** - * - * @param owner - * @returns - */ - getLocationParameterInstance(owner:yfiles.graph.IPortOwner):yfiles.graph.IPortLocationModelParameter; - /** - * - * @param owner - * @returns - */ - getStyleInstance(owner:yfiles.graph.IPortOwner):yfiles.styles.IPortStyle; - /** - * - * @default true - * @type {boolean} - */ - autoCleanup:boolean; - /** - * - * @type {yfiles.graph.IPortLocationModelParameter} - */ - locationParameter:yfiles.graph.IPortLocationModelParameter; - /** - * - * @default true - * @type {boolean} - */ - shareLocationParameterInstance:boolean; - /** - * - * @type {yfiles.styles.IPortStyle} - */ - style:yfiles.styles.IPortStyle; - /** - * - * @default true - * @type {boolean} - */ - shareStyleInstance:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.PortDefaults; - } - /** - * A canonic implementation of the {@link yfiles.graph.INodeDefaults} interface. - * @class - * @implements {yfiles.graph.INodeDefaults} - */ - export interface NodeDefaults extends yfiles.lang.Object,yfiles.graph.INodeDefaults{} - export class NodeDefaults { - /** - * Initializes a new instance of the {@link yfiles.graph.NodeDefaults} class using default properties. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.geometry.Size} [options.size=null] Sets the size property. - * @param {yfiles.graph.ILabelDefaults} [options.labels=null] Sets the labels property. - * @param {yfiles.graph.IPortDefaults} [options.ports=null] Sets the ports property. - * @param {yfiles.styles.INodeStyle} [options.style=null] Sets the style property. - * @param {boolean} [options.shareStyleInstance=null] Sets the shareStyleInstance property. - */ - constructor(options?:{size?:yfiles.geometry.Size,labels?:yfiles.graph.ILabelDefaults,ports?:yfiles.graph.IPortDefaults,style?:yfiles.styles.INodeStyle,shareStyleInstance?:boolean}); - /** - * - * @returns - */ - getStyleInstance():yfiles.styles.INodeStyle; - /** - * - * @type {yfiles.geometry.Size} - */ - size:yfiles.geometry.Size; - /** - * - * @type {yfiles.graph.ILabelDefaults} - */ - labels:yfiles.graph.ILabelDefaults; - /** - * - * @type {yfiles.graph.IPortDefaults} - */ - ports:yfiles.graph.IPortDefaults; - /** - * - * @type {yfiles.styles.INodeStyle} - */ - style:yfiles.styles.INodeStyle; - /** - * - * @default true - * @type {boolean} - */ - shareStyleInstance:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.NodeDefaults; - } - /** - * A canonic implementation of the {@link yfiles.graph.IEdgeDefaults} interface - * @class - * @implements {yfiles.graph.IEdgeDefaults} - */ - export interface EdgeDefaults extends yfiles.lang.Object,yfiles.graph.IEdgeDefaults{} - export class EdgeDefaults { - /** - * Initializes a new instance of the {@link yfiles.graph.EdgeDefaults} class with default edge style and label and port defaults. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.graph.ILabelDefaults} [options.labels=null] Sets the labels property. - * @param {yfiles.graph.IPortDefaults} [options.ports=null] Sets the ports property. - * @param {yfiles.styles.IEdgeStyle} [options.style=null] Sets the style property. - * @param {boolean} [options.shareStyleInstance=null] Sets the shareStyleInstance property. - */ - constructor(options?:{labels?:yfiles.graph.ILabelDefaults,ports?:yfiles.graph.IPortDefaults,style?:yfiles.styles.IEdgeStyle,shareStyleInstance?:boolean}); - /** - * - * @returns - */ - getStyleInstance():yfiles.styles.IEdgeStyle; - /** - * - * @type {yfiles.graph.ILabelDefaults} - */ - labels:yfiles.graph.ILabelDefaults; - /** - * - * @type {yfiles.graph.IPortDefaults} - */ - ports:yfiles.graph.IPortDefaults; - /** - * - * @type {yfiles.styles.IEdgeStyle} - */ - style:yfiles.styles.IEdgeStyle; - /** - * - * @default true - * @type {boolean} - */ - shareStyleInstance:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.EdgeDefaults; - } - /** - * A canonic implementation of the {@link yfiles.graph.ILabelDefaults} interface - * @class - * @implements {yfiles.graph.ILabelDefaults} - */ - export interface LabelDefaults extends yfiles.lang.Object,yfiles.graph.ILabelDefaults{} - export class LabelDefaults { - /** - * Initializes a new instance of the {@link yfiles.graph.LabelDefaults} class using a trivial parameter. - * @param {Object} [options=null] The parameters to pass. - * @param {boolean} [options.autoAdjustPreferredSize=null] Sets the autoAdjustPreferredSize property. - * @param {boolean} [options.shareLayoutParameterInstance=null] Sets the shareLayoutParameterInstance property. - * @param {yfiles.graph.ILabelModelParameter} [options.layoutParameter=null] Sets the layoutParameter property. - * @param {boolean} [options.shareStyleInstance=null] Sets the shareStyleInstance property. - * @param {yfiles.styles.ILabelStyle} [options.style=null] Sets the style property. - */ - constructor(options?:{autoAdjustPreferredSize?:boolean,shareLayoutParameterInstance?:boolean,layoutParameter?:yfiles.graph.ILabelModelParameter,shareStyleInstance?:boolean,style?:yfiles.styles.ILabelStyle}); - /** - * - * @param owner - * @returns - */ - getLayoutParameterInstance(owner:yfiles.graph.ILabelOwner):yfiles.graph.ILabelModelParameter; - /** - * - * @param owner - * @returns - */ - getStyleInstance(owner:yfiles.graph.ILabelOwner):yfiles.styles.ILabelStyle; - /** - * - * @type {boolean} - */ - autoAdjustPreferredSize:boolean; - /** - * - * @type {boolean} - */ - shareLayoutParameterInstance:boolean; - /** - * - * @type {yfiles.graph.ILabelModelParameter} - */ - layoutParameter:yfiles.graph.ILabelModelParameter; - /** - * - * @type {yfiles.styles.ILabelStyle} - */ - style:yfiles.styles.ILabelStyle; - /** - * - * @type {boolean} - */ - shareStyleInstance:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.LabelDefaults; - } - /** - * Interface for implementations that can calculate the bounds of a group node in a grouped graph. - *

- * Implementations of this interface will be queried from {@link yfiles.graph.INode}'s {@link yfiles.graph.ILookup#lookup} method. - *

- * @interface - */ - export interface IGroupBoundsCalculator extends yfiles.lang.Object{ - /** - * Calculates the bounds of the {@link yfiles.graph.INode#layout} for the given groupNode that is a group node in the graph. - * @param graph The graph which holds the groupNode. - * @param groupNode The node to calculate the bounds for. - * @returns The minimum bounds to use for the given group node. - * @abstract - */ - calculateBounds(graph:yfiles.graph.IGraph,groupNode:yfiles.graph.INode):yfiles.geometry.Rect; - } - var IGroupBoundsCalculator:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IGroupBoundsCalculator; - }; - /** - * A group of {@link yfiles.graph.IUndoUnit}s that are undone/redone as a single unit. - *

- * Clients can use this class to build an {@link yfiles.graph.IUndoUnit} that groups together multiple {@link yfiles.graph.IUndoUnit}s. The - * {@link yfiles.graph.IUndoUnit}s added to this unit are undone/redone in the order in which they were added. This implementation - * will try to {@link yfiles.graph.IUndoUnit#tryMergeUnit merge} or {@link yfiles.graph.IUndoUnit#tryReplaceUnit replace} units that are {@link yfiles.graph.CompositeUndoUnit#add added}. - *

- * @class - * @implements {yfiles.graph.IUndoUnit} - */ - export interface CompositeUndoUnit extends yfiles.lang.Object,yfiles.graph.IUndoUnit{} - export class CompositeUndoUnit { - /** - * Creates a new instance using the provided names. - * @param [undoName=null] - * @param [redoName=null] - */ - constructor(undoName?:string,redoName?:string); - /** - * Creates a new instance using the provided names. - * @param {Object} options The parameters to pass. - * @param [options.undoName=null] - * @param [options.redoName=null] - */ - constructor(options:{undoName?:string,redoName?:string}); - /** - * Adds a new {@link yfiles.graph.IUndoUnit} to the queue. - * @param unit The unit of work to add. - */ - add(unit:yfiles.graph.IUndoUnit):void; - /** - * Determines whether a call to {@link yfiles.graph.CompositeUndoUnit#redo} can be made. - * @returns - */ - canRedo():boolean; - /** - * Determines whether a call to {@link yfiles.graph.CompositeUndoUnit#undo} can be made. - * @returns - */ - canUndo():boolean; - /** - * Clears the internal collection of units. - */ - clear():void; - /** - * Disposes this unit and all of its contents. - *

- * This unit cannot be used anymore after this has been invoked. - *

- */ - dispose():void; - /** - * Redoes the next {@link yfiles.graph.IUndoUnit}. - * @throws {Stubs.Exceptions.NotSupportedError} If an undo operation is already in progress. - * @throws {yfiles.lang.Exception} If {@link yfiles.graph.CompositeUndoUnit#canRedo} would yield false. - */ - redo():void; - /** - * Tries to remove a given unit from this compound unit. - *

- * This method will throw an exception if this unit has been undone or an undo or redo is in progress or this unit has - * already been disposed. This method will not automatically {@link yfiles.graph.IUndoUnit#dispose Dispose} removed units. - *

- * @param unit The unit to remove. - * @returns true iff the unit has been removed from this instance. - */ - removeUnit(unit:yfiles.graph.IUndoUnit):boolean; - /** - * Undoes the next {@link yfiles.graph.IUndoUnit}. - * @throws {Stubs.Exceptions.NotSupportedError} If an undo operation is already in progress. - * @throws {yfiles.lang.Exception} If {@link yfiles.graph.CompositeUndoUnit#canUndo} would yield false. - */ - undo():void; - /** - * Gets the number of units that are contained in this compound unit. - * @type {number} - */ - count:number; - /** - * Gets or sets the current redo name. - * @type {string} - */ - redoName:string; - /** - * Gets or sets the current redo name. - * @type {string} - */ - undoName:string; - /** - * Gets whether this instance has been {@link yfiles.graph.CompositeUndoUnit#dispose disposed.} - *

- * An instance that has been disposed cannot be {@link yfiles.graph.CompositeUndoUnit#undo undone} or {@link yfiles.graph.CompositeUndoUnit#redo redone}. - *

- * @type {boolean} - */ - disposed:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.CompositeUndoUnit; - } - /** - * This interface is a means to bracket several - * {@link yfiles.graph.IUndoUnit}s, that is a collection of units that are treated as one (for example they are always undone or - * redone as a single unit). - *

- * {@link yfiles.graph.ICompoundEdit}s have two states: active and settled. Whenever an {@link yfiles.graph.ICompoundEdit} is retrieved from the {@link yfiles.graph.UndoEngine} - * or the graph instance, it automatically is active. While an edit is in the active state, it gathers {@link yfiles.graph.IUndoUnit}s until - * the {@link yfiles.graph.ICompoundEdit#commit} or {@link yfiles.graph.ICompoundEdit#cancel} methods are called. Calling the {@link yfiles.graph.ICompoundEdit#commit} - * method commits all gathered {@link yfiles.graph.IUndoUnit}s to the {@link yfiles.graph.UndoEngine}, while canceling will {@link yfiles.graph.IUndoUnit#dispose dispose} them. - * Calling either method will put the edit in the settled state. In this state, the edit does not gather units anymore and is not - * reusable. - *

- *

- * {@link yfiles.graph.ICompoundEdit}s can also be nested, in this case the changes of the inner edit are not committed directly to - * the {@link yfiles.graph.UndoEngine} but to the outer edit. Only when the outer edit is committed, the units are committed to the - * {@link yfiles.graph.UndoEngine}. - *

- * @see yfiles.graph.UndoEngine - * @see yfiles.graph.IUndoUnit - * @interface - */ - export interface ICompoundEdit extends yfiles.lang.Object{ - /** - * This method cancels the compound editing process. - *

- * The recorded {@link yfiles.graph.IUndoUnit}s are {@link yfiles.graph.IUndoUnit#dispose disposed} and the edit is not usable anymore. - *

- * @abstract - */ - cancel():void; - /** - * This method commits the compound editing process. - *

- * The {@link yfiles.graph.IUndoUnit}s are enqueued into the corresponding {@link yfiles.graph.UndoEngine} instance and the edit is not - * usable anymore. - *

- * @abstract - */ - commit():void; - } - var ICompoundEdit:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.ICompoundEdit; - }; - /** - * The basic lookup interface that allows for retrieving implementations for different aspects of the current instance. - *

- * The lookup idiom allows for dynamically providing, adding, changing, and removing implementation aspects of an instance - * that would not be possible to achieve using ordinary object oriented methods. - *

- * @interface - */ - export interface ILookup extends yfiles.lang.Object{ - /** - * Returns an instance that implements the given type or null. - *

- * Typically, this method will be called in order to obtain a different view or aspect of the current instance. This is - * quite similar to casting or using a super type or interface of this instance, but is not limited to inheritance or - * compile time constraints. An instance implementing this method is not required to return non-null implementations for - * the types, nor does it have to return the same instance any time. Also it depends on the type and context whether the - * instance returned stays up to date or needs to be reobtained for subsequent use. - *

- * @param type the type for which an instance shall be returned - * @returns an instance that is assignable to type or null - * @abstract - */ - lookup(type:yfiles.lang.Class):any; - } - var ILookup:{ - /** - * Creates a lookup implementation that wraps an existing ILookup instance using an additional lookup implementations. - *

- * For each lookup call that the additionalLookup would yield null, the basicLookup will be queried instead. - *

- * @param basicLookup the fallback lookup implementation - * @param additionalLookup the lookup that has precedence over the fallback - * @returns an implementation that decorates the first with the latter - * @static - */ - createCascadingLookup?(basicLookup:yfiles.graph.ILookup,additionalLookup:yfiles.graph.ILookup):yfiles.graph.ILookup; - /** - * Creates a dynamic lookup implementation that for each type that the given subject can be assigned to yields that - * subject. - * @param subject the subject to yield if it is assignable to the type in the lookup query - * @returns an instance that will either yield subject or null - * @static - */ - createDynamicLookup?(subject:any):yfiles.graph.ILookup; - /** - * Creates a simple mutable {@link yfiles.graph.ILookup} implementation that is backed by an {@link yfiles.collections.IMap.}. - *

- * The {@link yfiles.graph.ILookup#lookup lookup} method uses the specified type as key when delegating to the backingDictionary. - *

- * @param backingDictionary The backing {@link } that is used in the {@link #lookup lookup} calls. - * @returns A simple mutable {@link } implementation that is backed by a dictionary. - * @static - */ - createMapLookup?(backingDictionary:yfiles.collections.Map):yfiles.graph.ILookup; - /** - * Creates a simple lookup implementation that yields subject if type is queried. - * @param subject the subject to yield - * @param type the type that should yield the subject - * @returns an ILookup implementation - * @static - */ - createSingleLookup?(subject:any,type:yfiles.lang.Class):yfiles.graph.ILookup; - /** - * An ILookup instance that always returns null. - * @const - * @static - * @type {yfiles.graph.ILookup} - */ - EMPTY?:yfiles.graph.ILookup; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.ILookup; - }; - /** - * An interface for instances that can provide a {@link yfiles.graph.ILookup} capabilities for a given object. - *

- * This is useful in the case where lookup functionality is not intrinsic to an item or where an existing object cannot - * implement the interface or when an item needs to be decorated externally with new lookup functionality. - *

- * @see yfiles.graph.ILookup - * @interface - */ - export interface IContextLookup extends yfiles.lang.Object{ - /** - * Tries to create or retrieve an implementation of the given type for a given item. - * @param item the item to lookup a type for - * @param type the type to look up - * @returns an implementation or null - * @see yfiles.graph.ILookup#lookup - * @abstract - */ - contextLookup(item:any,type:yfiles.lang.Class):any; - } - var IContextLookup:{ - /** - * An ILookupContext instance that always returns null. - * @const - * @static - * @type {yfiles.graph.IContextLookup} - */ - EMPTY_CONTEXT_LOOKUP?:yfiles.graph.IContextLookup; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IContextLookup; - }; - /** - * An interface for instances that can be used to chain lookup operations. - *

- * Implementations will perform the lookup in the {@link yfiles.graph.IContextLookup#contextLookup} method and delegate to the next - * implementation in the chain if they cannot satisfy the request. - *

- * @interface - * @implements {yfiles.graph.IContextLookup} - */ - export interface IContextLookupChainLink extends yfiles.lang.Object,yfiles.graph.IContextLookup{ - /** - * This method is called by the framework to register the fallback lookup implementation that should be used during a call - * to {@link yfiles.graph.IContextLookup#contextLookup}. - *

- * If the implementation cannot satisfy the query, it will use the provided context as a fallback. Note that - * implementations can also use the results returned by the next lookup and decorate it appropriately. - *

- * @param next The context to use as a fallback. - * @abstract - */ - setNext(next:yfiles.graph.IContextLookup):void; - } - var IContextLookupChainLink:{ - /** - * Factory method for a lookup chain element that simply adds an entry to a lookup chain. - * @param type The type to add to the lookup. - * @param instance The instance to return if the type is being looked up. - * @returns An instance that can be used in a lookup chain. - * @static - */ - addingLookupChainLink?(type:yfiles.lang.Class,instance:any):yfiles.graph.IContextLookupChainLink; - /** - * Factory method for a lookup chain element that adds an {@link yfiles.graph.ILookup} layer to a lookup chain. - *

- * If the lookup returns null, the call will be propagated to the chain. - *

- * @param lookup The lookup to use. - * @returns An instance that can be used in a lookup chain. - * @static - */ - addingLookupChainLink?(lookup:yfiles.graph.ILookup):yfiles.graph.IContextLookupChainLink; - /** - * Factory method for a lookup chain element that adds an dynamic instance to a lookup chain. - *

- * The instance returned will check whether instance is of the queried type and will then return the instance. - *

- * @param instance The instance to query the type from dynamically. - * @returns An instance that can be used in a lookup chain. - * @static - */ - addingLookupChainLink?(instance:any):yfiles.graph.IContextLookupChainLink; - /** - * Creates a lookup chain link that is backed by the given callback. - *

- * If the callback returns null the request is passed to the chain. - *

- * @param callback The callback to invoke. - * @returns The implementation of the link that uses the callback. - * @static - */ - createContextLookupChainLink?(callback:(subject:any,type:yfiles.lang.Class)=>any):yfiles.graph.IContextLookupChainLink; - /** - * Factory method for a lookup chain element that uses a function of type function(TContext) to yield a TResult for a specific TContext. - *

- * If the resulting link is {@link yfiles.graph.IContextLookup#contextLookup queried} for TResult and the context is of type TContext, the factory method will be queried and the result - * will be returned. Otherwise the {@link yfiles.graph.IContextLookupChainLink#setNext next} chain link will be delegated the request to. - *

- * Type parameter TContext. - * Type parameter TResult. - * @param factory The factory delegate to use that yields the result for a given context. - * @returns An instance that can be used in a lookup chain. - * @template TContext,TResult - * @static - */ - factoryLookupChainLink?(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,factory:(arg:TContext)=>TResult):yfiles.graph.IContextLookupChainLink; - /** - * Factory method for a lookup chain element that removes the entry from the lookup chain for a given type. - * @param type The type to hide from the lookup. - * @returns An instance that can be used in a lookup chain. - * @static - */ - hidingLookupChainLink?(type:yfiles.lang.Class):yfiles.graph.IContextLookupChainLink; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IContextLookupChainLink; - }; - /** - * Interface that can be used to decorate the lookup result for a set of types. - * @see yfiles.graph.ILookup - * @see yfiles.graph.IContextLookupChainLink - * @interface - */ - export interface ILookupDecorator extends yfiles.lang.Object{ - /** - * Adds a lookup implementation for a given type using a function of type function(TContext, TResult). - *

- * This method is closely related to the {@link yfiles.graph.ILookupDecorator#add} method, however it passes the result of the - * remaining chain to the delegate for convenient wrapping of the result. Note that if the implementation does not depend - * on the previous result in order to wrap it, it is better to use that variant, in order to avoid the possibly costly - * evaluation of the remainder of the lookup chain. - *

- * Type parameter TContext: The type of the context subject. - * Type parameter TResult: The type of the query, which is a base type or the type of the result. - * @param wrapperFactory The factory delegate that will be used to satisfy queries of type TResult - * @param [decorateNull=true] Whether to actually decorate null results of remainder of the chain. If this is set to false, the wrapperFactory will - * never be called with null as the second argument but the result of the query for this chain link will be the null - * value. - * @returns The {@link } instance as returned by the {@link #addLookup} call or - * null, if either decorator was null, or it {@link #canDecorate could not decorate} the TContext type. - * @template TContext,TResult - */ - add?(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,wrapperFactory:(arg1:TContext,arg2:TResult)=>TResult,decorateNull?:boolean):yfiles.graph.IContextLookupChainLink; - /** - * Adds a lookup implementation for a given type using a func. - * Type parameter TContext: The type of the context subject. - * Type parameter TResult: The type of the query, which is a base type or the type of the result. - * @param factory The factory delegate that will be used to satisfy queries of type TResult. - * @param [nullIsFallback=true] Whether to treat null-results of the factory as hints to use the remainder of the chain link or to actually yield the - * value as the final result. - * @returns The {@link } instance as returned by the {@link #addLookup} call or - * null, if either decorator was null, or it {@link #canDecorate could not decorate} the TContext type. - * @template TContext,TResult - */ - add?(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,factory:(arg:TContext)=>TResult,nullIsFallback?:boolean):yfiles.graph.IContextLookupChainLink; - /** - * Add a lookup implementation for a given type that always yields a constant result. - * Type parameter TContext: The type of the context subject. - * Type parameter TResult: The type of the query, which is a base type or the type of the result. - * @param result The constant value to yield if the chain is queried for an implementation of type TResult. - * @returns The {@link } instance as returned by the {@link #addLookup} call or - * null, if either decorator was null, or it {@link #canDecorate could not decorate} the TContext type. - * @template TContext,TResult - */ - addConstant?(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,result:TResult):yfiles.graph.IContextLookupChainLink; - /** - * Adds a lookup chain element to the chain of lookups for a given type. - *

- * The lookup chain is context specific. This method will not generally decorate the lookup of all instances of type t, but - * only those that stand in context of this instance. This method will only succeed if {@link yfiles.graph.ILookupDecorator#canDecorate} - * yields true for t. - *

- * @param t The type to decorate the lookup. - * @param lookup The chain element to add to the lookup of the given type. - * @see yfiles.graph.ILookupDecorator#removeLookup - * @see yfiles.graph.ILookupDecorator#add - * @see yfiles.graph.ILookupDecorator#add - * @see yfiles.graph.ILookupDecorator#addConstant - * @abstract - */ - addLookup(t:yfiles.lang.Class,lookup:yfiles.graph.IContextLookupChainLink):void; - /** - * Determines whether this instance can be used to decorate the lookup for a certain type. - * @param t The type to decorate the lookup for. - * @returns - * @abstract - */ - canDecorate(t:yfiles.lang.Class):boolean; - /** - * Removes a previously registered lookup chain element from the chain of lookups for a given type. - * @param t The type to remove the decorator from. - * @param lookup The chain element to remove from the lookup of the given type. - * @see yfiles.graph.ILookupDecorator#addLookup - * @abstract - */ - removeLookup(t:yfiles.lang.Class,lookup:yfiles.graph.IContextLookupChainLink):void; - } - var ILookupDecorator:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.ILookupDecorator; - }; - /** - * Interface implemented by items that can be tagged with arbitrary objects. - *

- * The object held by implementations of this interface is usually a user defined object. Implementations don't depend on - * this tag. They just serve as a storage for the tag that will be used by other parts of the implementation. - *

- * @interface - */ - export interface ITagOwner extends yfiles.lang.Object{ - /** - * Gets or sets the tag associated with this instance. - *

- * The implementation itself does not normally depend on the tag associated with it. It serves as storage for the object - * only. - *

- * @abstract - * @type {any} - */ - tag:any; - } - var ITagOwner:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.ITagOwner; - }; - /** - * An implementation of a chain of {@link yfiles.graph.IContextLookupChainLink}s. - * @class - * @implements {yfiles.graph.IContextLookup} - * @implements {yfiles.lang.IPropertyObservable} - */ - export interface LookupChain extends yfiles.lang.Object,yfiles.graph.IContextLookup,yfiles.lang.IPropertyObservable{} - export class LookupChain { - constructor(); - /** - * A convenience method that adds a {@link yfiles.graph.IContextLookupChainLink} to the given chain that is based on a function of - * type function(TContext, TResult). - *

- * Depending on decorateNull, null results of the underlying chain will be passed to the - * wrapperFactory, or simply yielded as the final result. - *

- * Type parameter TContext: The type of the context. - * Type parameter TResult: The type of the result. - * @param resultType The type of the result. - * @param contextType The type of the context. - * @param wrapperFactory The wrapper factory that will be called for queries to TResult to wrap the result of the query to the remainder of the chain. - * @param [decorateNull=false] if set to true null return values of the remainder of the chain will be passed to the wrapper factory so that it can - * decorate the null, otherwise null will be yielded as the final result. - * @returns The link that has been registered with the chain. - * @template TContext,TResult - */ - add(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,wrapperFactory:(arg1:TContext,arg2:TResult)=>TResult,decorateNull?:boolean):yfiles.graph.IContextLookupChainLink; - /** - * A convenience method that adds a {@link yfiles.graph.IContextLookupChainLink} to the given chain that is based on a function of - * type function(TContext). - *

- * Depending on nullIsFallback, null return values of the factory will be interpreted as the final result or indicate to - * the implementation that the chain should be queried for the result. - *

- * Type parameter TContext: The type of the context. - * Type parameter TResult: The type of the result. - * @param resultType The type of the result. - * @param contextType The type of the context. - * @param factory The factory that will be called for queries to TResult. - * @param [nullIsFallback=true] If set to true, null return values of the factory method will be interpreted as the final result, otherwise the request - * will propagate down the chain. - * @returns The link that has been registered with the chain. - * @template TContext,TResult - */ - add(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,factory:(arg:TContext)=>TResult,nullIsFallback?:boolean):yfiles.graph.IContextLookupChainLink; - /** - * Adds the given link to the end of the chain. - * @param lookup The link to add. - * @see yfiles.graph.LookupChain#remove - */ - add(lookup:yfiles.graph.IContextLookupChainLink):void; - /** - * Convenience method that can be used instead of the {@link yfiles.graph.LookupChain#add} method to easily add a lookup - * implementation for a given type that always yields a constant result. - * Type parameter TResult: The type of the query, which is a base type or the type of the result. - * @param result The constant value to yield if the chain is queried for an implementation of type TResult. - * @returns The {@link } instance that has been added to the chain. - * @template TResult - */ - addConstant(resultType:yfiles.lang.Class,result:TResult):yfiles.graph.IContextLookupChainLink; - /** - * Performs the actual lookup operation. - *

- * This call will traverse the chain to satisfy the query. - *

- * @param item The item to use as the context. - * @param type The type of the query. - * @returns The result of the query. - */ - contextLookup(item:any,type:yfiles.lang.Class):any; - /** - * Can be called by client code to trigger the {@link yfiles.graph.LookupChain#addPropertyChangedListener PropertyChanged} - * event manually. - */ - notifyChange():void; - /** - * Notifies client code that the lookup of this instance might have changed. - * @param evt The arguments - * @protected - */ - onPropertyChanged(evt:yfiles.lang.PropertyChangedEventArgs):void; - /** - * Removes the link that has previously been added to this instance from this chain. - * @param link The link to remove. - */ - remove(link:yfiles.graph.IContextLookupChainLink):void; - /** - * Adds the given listener for the PropertyChanged event that occurs when the lookup of this instance has changed for some - * or all of the types or items. - * @param listener The listener to add. - * @see yfiles.graph.LookupChain#removePropertyChangedListener - */ - addPropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the PropertyChanged event that occurs when the lookup of this instance has changed for - * some or all of the types or items. - * @param listener The listener to remove. - * @see yfiles.graph.LookupChain#addPropertyChangedListener - */ - removePropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.LookupChain; - } - /** - * The main class to provide undo and redo functionality. - *

- * The {@link yfiles.graph.UndoEngine} is in charge of {@link yfiles.graph.UndoEngine#beginCompoundEdit recording}, {@link yfiles.graph.UndoEngine#addUnit managing} and {@link yfiles.graph.UndoEngine#undo executing} single units of work that can be undone - * and redone, represented by the interface {@link yfiles.graph.IUndoUnit}. - *

- *

- * These units are managed in a queue-like structure and can be added manually to the queue by calling the {@link yfiles.graph.UndoEngine#addUnit} - * method. - *

- *

- * Executing the units is done by client code or commands by calling {@link yfiles.graph.UndoEngine#undo} or - * {@link yfiles.graph.UndoEngine#redo}. The engine automatically manages the queue so that calling these two methdos will - * consistently move the units in the queue. - *

- *

- * The {@link yfiles.graph.UndoEngine#beginCompoundEdit} method allows to record units by bracketing serveral changes in an - * {@link yfiles.graph.ICompoundEdit}. Implementations of the {@link yfiles.graph.ICompoundEdit} interface record all subsequent changes - * until it is {@link yfiles.graph.ICompoundEdit#commit committed} and therefore all recorded units are added to the engine. For more information and examples see - * {@link yfiles.graph.ICompoundEdit}. - *

- *

- * Depending on the properties {@link yfiles.graph.UndoEngine#mergeUnits} and {@link yfiles.graph.UndoEngine#autoMergeTime}, the engine tries to collapse added {@link yfiles.graph.IUndoUnit}s if possible. This enhances - * the performance and reduces the required memory for undo changes. For example, when a node is moved interactively, - * instead of saving every position that the node had when being dragged the engine will only hold one {@link yfiles.graph.IUndoUnit} - * at the end to undo the entire movement. - *

- *

- *
Customizing Undo/Redo - *

    - *
  • - * In general, to be able to undo or redo certain work client code can implement {@link yfiles.graph.IUndoUnit} or subclass - * {@link yfiles.graph.UndoUnitBase UndoUnitBase}. The client application needs to encapsulate - * changes in this implementation and provide the logic to completely undo and redo these changes. - * Instances of your custom {@link yfiles.graph.IUndoUnit} implementations need to be added to the {@link yfiles.graph.UndoEngine} - * manually via {@link yfiles.graph.UndoEngine#addUnit}. - *
  • - *
  • - * In certain cases it is difficult or not efficient to track and save the changes between certain states, - * and better to save the states themselves and to restore these. For example when there are potentially - * many intermediate steps between two states of interest and it would be complicated - * to produce {@link yfiles.graph.IUndoUnit}s for each intermediate step and merge them in the end. - * In such cases client code should implement {@link yfiles.graph.IMementoSupport} instead. - * See the documentation of {@link yfiles.graph.IMementoSupport} for examples and guidelines on how to implement - * this memento design pattern concept. - *
  • - *
  • - * It is generally not necessary to subclass {@link yfiles.graph.UndoEngine} unless you want to customize the internal - * handling of the units, which is both complicated and prone to errors. In most use cases it is sufficient - * to provide custom {@link yfiles.graph.IUndoUnit}s or {@link yfiles.graph.IMementoSupport}. - *
  • - *
- *

- * @see yfiles.graph.IUndoUnit - * @see yfiles.graph.UndoUnitBase - * @see yfiles.graph.IMementoSupport - * @see yfiles.graph.ICompoundEdit - * @class - * @implements {yfiles.lang.IPropertyObservable} - */ - export interface UndoEngine extends yfiles.lang.Object,yfiles.lang.IPropertyObservable{} - export class UndoEngine { - /** - * Initializes a new instance of the {@link yfiles.graph.UndoEngine} class. - * @param {Object} [options=null] The parameters to pass. - * @param {boolean} options.mergeUnits A value that indicates whether or not this instance should try to merge newly added units. - *

- * This option sets the {@link yfiles.graph.UndoEngine#mergeUnits} property on the created object. - *

- * @param {yfiles.lang.TimeSpan} options.autoMergeTime The duration during which the engine will try to merge newly added units. - *

- * This option sets the {@link yfiles.graph.UndoEngine#autoMergeTime} property on the created object. - *

- * @param {number} options.size The maximum size of the undo queue this instance is managing. - *

- * This option sets the {@link yfiles.graph.UndoEngine#size} property on the created object. - *

- */ - constructor(options?:{mergeUnits?:boolean,autoMergeTime?:yfiles.lang.TimeSpan,size?:number}); - /** - * Adds a new {@link yfiles.graph.IUndoUnit} to the queue. - *

- * This implementation will automatically group multiple units into a single unit if the time since the last add is less - * than {@link yfiles.graph.UndoEngine#autoMergeTime}. - *

- * @param unit The unit of work to add. - */ - addUnit(unit:yfiles.graph.IUndoUnit):void; - /** - * Begins a compound edit that will use the provided name. - *

- * This will create a new edit that can independently be {@link yfiles.graph.ICompoundEdit#cancel canceled} or {@link yfiles.graph.ICompoundEdit#commit committed}. Note that only if the outer-most instances - * is committed, the corresponding {@link yfiles.graph.IUndoUnit} units will be enqueued into this instance. - *

- * @param undoName The undo name to use for the edit. - * @param redoName The redo name to use for the edit. - * @returns A compound edit implementation that needs to be {@link #cancel canceled} or {@link #commit committed} later. - */ - beginCompoundEdit(undoName:string,redoName:string):yfiles.graph.ICompoundEdit; - /** - * Determines whether a call to {@link yfiles.graph.UndoEngine#redo} can be made. - * @returns - */ - canRedo():boolean; - /** - * Determines whether a call to {@link yfiles.graph.UndoEngine#undo} can be made. - * @returns - */ - canUndo():boolean; - /** - * Clears the internal queue and {@link yfiles.graph.IUndoUnit#dispose disposes} all units in it. - */ - clear():void; - /** - * Returns a token that can be used to store and compare the state of the undo queue. - *

- * E.g. an application can retrieve the token once the user has saved his document. Comparing the token returned by this - * instance with another one retrieved at a later point in time enables the application to determine whether the document - * is in the same state. - *

- * @returns An object that can be checked against other tokens via the {@link #equals} method. - */ - getToken():any; - /** - * This will trigger the corresponding {@link yfiles.graph.UndoEngine#addPropertyChangedListener PropertyChanged} event. - * @param name The name of the property that changed. - * @protected - */ - onPropertyChanged(name:string):void; - /** - * Redoes the next {@link yfiles.graph.IUndoUnit}. - * @throws {Stubs.Exceptions.NotSupportedError} If an undo operation is already in progress. - * @throws {yfiles.lang.Exception} If {@link yfiles.graph.UndoEngine#canRedo} would yield false. - */ - redo():void; - /** - * Undoes the next {@link yfiles.graph.IUndoUnit}. - * @throws {Stubs.Exceptions.NotSupportedError} If an undo operation is already in progress. - * @throws {yfiles.lang.Exception} If {@link yfiles.graph.UndoEngine#canUndo} would yield false. - */ - undo():void; - /** - * Gets or sets a value that indicates whether or not this instance should try to merge newly added units. - *

- * If true this instance will try to {@link yfiles.graph.IUndoUnit#tryMergeUnit merge} or {@link yfiles.graph.IUndoUnit#tryReplaceUnit replace} units in the queue. Note that when the {@link yfiles.graph.UndoEngine#autoMergeTime} property is set to {@link yfiles.lang.TimeSpan#ZERO} - * and this property is set to true, the engine will always try to merge incoming units. Otherwise the {@link yfiles.graph.UndoEngine#autoMergeTime} dictates whether - * the engine will try to merge a unit or not. - *

- * @see yfiles.graph.UndoEngine#autoMergeTime - * @type {boolean} - */ - mergeUnits:boolean; - /** - * Gets or sets the duration during which the engine will try to merge newly added units. - *

- * If this is set to {@link yfiles.lang.TimeSpan#ZERO}, the engine will try to merge incoming units depending on the {@link yfiles.graph.UndoEngine#mergeUnits} property. - * Otherwise, if the time span between the last added unit and the new unit exceeds the set value, the engine does not try - * to merge the units regardless what the {@link yfiles.graph.UndoEngine#mergeUnits} property is set to. Likewise, if the time span is smaller than the set value, - * the engine will always try to merge units. - *

- * @see yfiles.graph.UndoEngine#mergeUnits - * @type {yfiles.lang.TimeSpan} - */ - autoMergeTime:yfiles.lang.TimeSpan; - /** - * Gets or sets the maximum size of the undo queue this instance is managing. - *

- * A size of 0 effectively disables this implementation. - *

- * @type {number} - */ - size:number; - /** - * Gets the {@link yfiles.graph.IUndoUnit#undoName} of the next {@link yfiles.graph.UndoEngine#undo} operation. - * @type {string} - */ - undoName:string; - /** - * Gets the {@link yfiles.graph.IUndoUnit#redoName} of the next {@link yfiles.graph.UndoEngine#redo} operation. - * @type {string} - */ - redoName:string; - /** - * Gets whether this instance is currently performing an undo operation. - * @type {boolean} - */ - performingUndo:boolean; - /** - * Gets whether this instance is currently performing a redo operation. - * @type {boolean} - */ - performingRedo:boolean; - /** - * Adds the given listener for the PropertyChanged event that occurs when {@link yfiles.graph.UndoEngine#canUndo}, - * {@link yfiles.graph.UndoEngine#canRedo}, {@link yfiles.graph.UndoEngine#undoName}, or {@link yfiles.graph.UndoEngine#redoName} changed its value. - * @param listener The listener to add. - * @see yfiles.graph.UndoEngine#removePropertyChangedListener - */ - addPropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the PropertyChanged event that occurs when {@link yfiles.graph.UndoEngine#canUndo}, - * {@link yfiles.graph.UndoEngine#canRedo}, {@link yfiles.graph.UndoEngine#undoName}, or {@link yfiles.graph.UndoEngine#redoName} changed its value. - * @param listener The listener to remove. - * @see yfiles.graph.UndoEngine#addPropertyChangedListener - */ - removePropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Adds the given listener for the UnitUndone event that occurs when the engine has successfully executed the {@link yfiles.graph.IUndoUnit#undo} - * operation of an {@link yfiles.graph.IUndoUnit}. - * @param listener The listener to add. - * @see yfiles.graph.UndoEngine#removeUnitUndoneListener - */ - addUnitUndoneListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the UnitUndone event that occurs when the engine has successfully executed the {@link yfiles.graph.IUndoUnit#undo} - * operation of an {@link yfiles.graph.IUndoUnit}. - * @param listener The listener to remove. - * @see yfiles.graph.UndoEngine#addUnitUndoneListener - */ - removeUnitUndoneListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Adds the given listener for the UnitRedone event that occurs when the engine has successfully executed the {@link yfiles.graph.IUndoUnit#redo} - * operation of an {@link yfiles.graph.IUndoUnit}. - * @param listener The listener to add. - * @see yfiles.graph.UndoEngine#removeUnitRedoneListener - */ - addUnitRedoneListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - /** - * Removes the given listener for the UnitRedone event that occurs when the engine has successfully executed the {@link yfiles.graph.IUndoUnit#redo} - * operation of an {@link yfiles.graph.IUndoUnit}. - * @param listener The listener to remove. - * @see yfiles.graph.UndoEngine#addUnitRedoneListener - */ - removeUnitRedoneListener(listener:(sender:any,evt:yfiles.lang.EventArgs)=>void):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.UndoEngine; - } - /** - * Represents a unit of work that can be undone and redone. - *

- * Clients should use this interface when certain actions, changes or events should be monitored and have undoability - * provided for them. If you simply want to track the state of certain items between two states of interest, you should - * consider using {@link yfiles.graph.IMementoSupport mementos} instead. - *

- *

- * The central methods of this interface are {@link yfiles.graph.IUndoUnit#undo} and {@link yfiles.graph.IUndoUnit#redo} which contain the - * logic to undo or redo a unit of work. Keep in mind that undo/redo are sensible operations and should maintain a - * consistent state before and after each operation since they may be executed potentially often one after another. - *

- *

- * The requirement for an {@link yfiles.graph.IUndoUnit} is that when a program is in a certain state and a call to {@link yfiles.graph.IUndoUnit#undo} - * is followed by a call to {@link yfiles.graph.IUndoUnit#redo} then the program is in the exact same state as before (the same - * holds true for the other way around). - *

- *

- * A default implementation of this interface is the abstract class {@link yfiles.graph.UndoUnitBase} which forces only the - * implementation of the undo/redo logic and defaults the other methods. Clients should primarily extend this class instead - * of implementing the whole interface. - *

- *

- * IUndoUnits are managed by the {@link yfiles.graph.UndoEngine}. Custom units can always be added to the engine using the method - * {@link yfiles.graph.UndoEngine#addUnit}. Also consider to use one of the convenience implementations: {@link yfiles.graph.DelegateUndoUnit.} takes delegates for the - * undo/redo operations and {@link yfiles.graph.CompositeUndoUnit} creates a bracketing unit comprising several other units. - *

- *

- * Also note that in order to keep a consistent state, methods of objects of this type should not be called by clientcode - * directly but use the {@link yfiles.graph.UndoEngine} instead. - *

- * @interface - */ - export interface IUndoUnit extends yfiles.lang.Object{ - /** - * Called by the {@link yfiles.graph.UndoEngine} and client code to let the unit dispose of references aren't needed anymore. - *

- * When this method is called, the other methods of this interface will not be called anymore by the undo engine. The undo - * engine calls this method on instances that it will not use anymore to enable the instances to release instances and - * memory actively. - *

- * @abstract - */ - dispose():void; - /** - * Redoes the work that is represented by this unit. - *

- * Undo/redo are sensible operations and should maintain a consistent state before and after each operation since they may - * be executed potentially often one after another. - *

- * @see yfiles.graph.IUndoUnit#redoName - * @abstract - */ - redo():void; - /** - * Tries to merge the given unit with this one. - *

- * This method is called when this unit is the head of an {@link yfiles.graph.UndoEngine}'s or {@link yfiles.graph.CompositeUndoUnit}'s - * queue and a new unit is added. It is meant to try to incorporate the change of the given unit into this and if - * successful return true. This should be the case when the end state of this unit is equal to the start state of the given - * unit. - *

- *

- * For example, if this unit is the head of the queue and represents the work from state A to state B and the given unit - * the work from state B to state C, then this method should try to make this unit shift from state A to state C. If this - * is successful, the method is expected to return true. The other unit is then {@link yfiles.graph.IUndoUnit#dispose disposed} by the {@link yfiles.graph.UndoEngine} - * afterwards. - *

- *

- * Clients don't necessarily have to implement this method if the unit doesn't happen very often. In fact, the default - * implementation of {@link yfiles.graph.UndoUnitBase#tryMergeUnit} simply returns false. Implementing this method faithfully will - * cause multiple units of work to inseparably appear as one and undoing/redoing it will undo/redo the work of all - * collapsed units. Depending on the situation this may be reasonable, for example when there are potentially a lot of - * changes where not every intermediate step is required to be recorded. In this case implementing this method faithfully - * will greatly improve the performance and reduce the required amount of memory of the undo process. If you want to group - * together multiple units as a single block but still want to be able to separate each step, consider to use a {@link yfiles.graph.CompositeUndoUnit} - * instead. - *

- * @param unit The unit to incorporate that happened after this unit. - * @returns Whether the state change of unit has been incorporated into this unit and unit can be disposed of. - * @abstract - */ - tryMergeUnit(unit:yfiles.graph.IUndoUnit):boolean; - /** - * Tries to replace the given unit with this one. - *

- * This method is called if a newly added unit couldn't be {@link yfiles.graph.IUndoUnit#tryMergeUnit merged} with the head unit of the queue (i.e. returned false). - * Instead of trying to merge a newly added unit, this method tries to replace the given unit (which is the head of the - * queue) with this by incorporating the change of the given unit into this and if successful return true. This should be - * the case when the start state of this unit is equal to the end state of the given unit. - *

- *

- * For example, if the given unit represents the work from state A to state B and this unit the work from state B to state - * C, then this method should try to make this unit shift from state A to state C. If this is successful, the method is - * expected to return true. The given unit is then {@link yfiles.graph.IUndoUnit#dispose disposed} by the {@link yfiles.graph.UndoEngine} afterwards and replaced with this - * unit in the queue. - *

- *

- * Clients don't necessarily have to implement this method if the unit doesn't happen very often. In fact, the default - * implementation of {@link yfiles.graph.UndoUnitBase#tryReplaceUnit} simply returns false. Implementing this method faithfully - * will cause multiple units of work to inseparably appear as one and undoing/redoing it will undo/redo the work of all - * collapsed units. Depending on the situation this may be reasonable, for example when there are potentially a lot of - * changes where not every intermediate step is required to be recorded. In this case implementing this method faithfully - * will greatly improve the performance and reduce the required amount of memory of the undo process. If you want to group - * together multiple units as a single block but still want to be able to separate each step, consider to use a {@link yfiles.graph.CompositeUndoUnit} - * instead. - *

- * @param unit The unit to incorporate that happened before this unit. - * @returns Whether the state change of this unit has been incorporated into the given unit and this can be disposed of. - * @abstract - */ - tryReplaceUnit(unit:yfiles.graph.IUndoUnit):boolean; - /** - * Undoes the work that is represented by this unit. - *

- * Undo/redo are sensible operations and should maintain a consistent state before and after each operation since they may - * be executed potentially often one after another. - *

- * @see yfiles.graph.IUndoUnit#undoName - * @abstract - */ - undo():void; - /** - * Gets the name of the undo unit. - *

- * Depending on the implementation and context this might be a human readable representation of the undo action or a - * symbolic name that needs localization. - *

- * @abstract - * @type {string} - */ - undoName:string; - /** - * Gets the name of the redo unit. - *

- * Depending on the implementation and context this might be a human readable representation of the redo action or a - * symbolic name that needs localization. - *

- * @abstract - * @type {string} - */ - redoName:string; - } - var IUndoUnit:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IUndoUnit; - }; - /** - * This interface provides access to the memento design pattern to provide undoability for arbitrary models. - *

- * By implementing this interface as well as {@link yfiles.graph.ILookup}, clients can add undoability for changes to their model - * classes. The yFiles undo mechanism uses the return value of {@link yfiles.graph.IMementoSupport#getState} to retrieve a state of - * an item at the beginning of the compound editing process. When the process ends, another state will be retrieved of the - * same item and compared to the original state. If they differ, an {@link yfiles.graph.IUndoUnit} is created that uses the {@link yfiles.graph.IMementoSupport#applyState} - * method to apply either state to the item in case of {@link yfiles.graph.IUndoUnit#undo undo} or {@link yfiles.graph.IUndoUnit#redo redo}. This represents an abstraction to the undo mechanism - * where it is only needed to define "states" of items and hides the more complicated mechanism of creating and inserting - * {@link yfiles.graph.IUndoUnit}s. - *

- *

- * The following is an example implementation of an item that is being managed using {@link yfiles.graph.IMementoSupport}: - *

- *

- * A collection of items from this type can then be watched using the following code snippet: - *

- *

- * Implementing the {@link yfiles.graph.IMementoSupport} interface is quite unrestrained, the type of the state returned by {@link yfiles.graph.IMementoSupport#getState} - * method can by anything as long as the {@link yfiles.graph.IMementoSupport#applyState} and {@link yfiles.graph.IMementoSupport#stateEquals} - * methods can deal with it: - *

- *

- * In summary, use this concept when you want to track the state of items during certain operations for undo/redo. This is - * efficient if it's easier to handle an item's state than the changes to the item themselves. If you want to focus on the - * changes or on certain events, you should use custom {@link yfiles.graph.IUndoUnit} implementations instead. - *

- * @see yfiles.graph.ILookup - * @see yfiles.graph.ICompoundEdit - * @see yfiles.graph.UndoEngine - * @interface - */ - export interface IMementoSupport extends yfiles.lang.Object{ - /** - * Reapplies a previously queried state object to a given subject. - *

- * The state object has been created using the {@link yfiles.graph.IMementoSupport#getState} method. - *

- * @param subject The subject to modify the state. - * @param state The state object as returned by {@link #getState} - * @abstract - */ - applyState(subject:any,state:any):void; - /** - * Retrieves an object representing the state at the moment this method is called. - *

- * The returned state may be reapplied later to the subject in the {@link yfiles.graph.IMementoSupport#applyState} method. - *

- * @param subject The subject to read the state from - * @returns An object that describes the current state of subject. - * @abstract - */ - getState(subject:any):any; - /** - * Determines whether two state objects are equal. - *

- * The undo mechanism in yFiles calls this method to determine if the subject has changed and whether an {@link yfiles.graph.IUndoUnit} - * should be created for these changes. If this method returns false, an {@link yfiles.graph.IUndoUnit} is created for the two - * states that can reapply either state (for either undo or redo). If this method returns true the state is considered not - * to have changed and no undo unit will be created. Conservative implementations my simply return false. - *

- * @param state1 The first state as obtained from {@link #getState} - * @param state2 The second state as obtained from {@link #getState} - * @returns true if the states are equal; false otherwise. - * @abstract - */ - stateEquals(state1:any,state2:any):boolean; - } - var IMementoSupport:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IMementoSupport; - }; - /** - * A convenience implementation of the {@link yfiles.graph.IUndoUnit} interface that uses simple delegates for the actual undo and - * redo operations. - * Type parameter T: The type of the single parameter that is passed to the delegate. - * @class - * @extends {yfiles.graph.UndoUnitBase} - * @template T - * @final - */ - export interface DelegateUndoUnit extends yfiles.graph.UndoUnitBase{} - export class DelegateUndoUnit { - /** - * Creates a new instance using the provided name and a undo and redo handler as well as the parameters to pass to the - * delegates. - * @param undoName The name of the undo. - * @param undo The undo handler delegate. - * @param redo The redo handler delegate. - * @param undoParam The undo parameter to pass to the delegate. - * @param redoParam The redo parameter to pass to the delegate. - */ - constructor(undoName:string,undo:(param:T)=>void,redo:(param:T)=>void,undoParam:T,redoParam:T); - /** - * Creates a new instance using the provided name and a undo/redo handler as well as the parameters to pass to the - * delegates. - * @param undoName The name of the undo. - * @param undoRedo The undo and redo handler delegate. - * @param undoParam The undo parameter to pass to the delegate. - * @param redoParam The redo parameter to pass to the delegate. - */ - constructor(undoName:string,undoRedo:(param:T)=>void,undoParam:T,redoParam:T); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.DelegateUndoUnit; - } - /** - * An abstract convenience implementation of {@link yfiles.graph.IUndoUnit}. - *

- * This class defaults most methods required by the {@link yfiles.graph.IUndoUnit} interface. Subclasses only have to implement the - * undo/redo logic. Most notably, {@link yfiles.graph.IUndoUnit#tryMergeUnit} and {@link yfiles.graph.IUndoUnit#tryReplaceUnit} are - * implemented to return - * false. Subclasses are of course allowed to override more methods if clients want to enable additional functionality. - *

- *

- * Use this class for simple custom implementations of {@link yfiles.graph.IUndoUnit}. - *

- * @see yfiles.graph.IUndoUnit - * @see yfiles.graph.UndoEngine - * @class - * @implements {yfiles.graph.IUndoUnit} - */ - export interface UndoUnitBase extends yfiles.lang.Object,yfiles.graph.IUndoUnit{} - export class UndoUnitBase { - /** - * Creates a new instance using the given name as undo and redo name. - * @param undoName The undo name. - * @param [redoName=null] The redo name. - * @protected - */ - constructor(undoName:string,redoName?:string); - /** - * - */ - dispose():void; - /** - * - * @abstract - */ - redo():void; - /** - * - * @param unit - * @returns - */ - tryMergeUnit(unit:yfiles.graph.IUndoUnit):boolean; - /** - * - * @param unit - * @returns - */ - tryReplaceUnit(unit:yfiles.graph.IUndoUnit):boolean; - /** - * - * @abstract - */ - undo():void; - /** - * - * @type {string} - */ - undoName:string; - /** - * - * @type {string} - */ - redoName:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.UndoUnitBase; - } - /** - * An abstract basic implementation of the {@link yfiles.graph.IFoldingEdgeConverter} interface that may be derived from to create - * a customized {@link yfiles.graph.FoldingManager#foldingEdgeConverter}. - *

- * This class provides default mechanisms and callbacks that can be used to set another style for folding edges, for the - * ports of folding edges, synchronizing the first label of a folding edge with the master edge, etc. Subclasses need to - * implement the {@link yfiles.graph.FoldingEdgeConverterBase#addFoldingEdge} method, only. - *

- * @see yfiles.graph.DefaultFoldingEdgeConverter - * @see yfiles.graph.FoldingManager - * @class - * @implements {yfiles.graph.IFoldingEdgeConverter} - */ - export interface FoldingEdgeConverterBase extends yfiles.lang.Object,yfiles.graph.IFoldingEdgeConverter{} - export class FoldingEdgeConverterBase { - /** - * - * @param factory - * @param foldingView - * @param masterEdge - * @param source - * @param sourceIsCollapsed - * @param target - * @param targetIsCollapsed - * @returns - * @abstract - */ - addFoldingEdge(factory:yfiles.graph.IFoldingEdgeFactory,foldingView:yfiles.graph.IFoldingView,masterEdge:yfiles.graph.IEdge,source:yfiles.graph.INode,sourceIsCollapsed:boolean,target:yfiles.graph.INode,targetIsCollapsed:boolean):yfiles.graph.IEdge; - /** - * Callback factory method that creates the {@link yfiles.styles.IEdgeStyle} for use in - * {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgeStyle}. - * @param foldingView The folding view instance. - * @param foldingEdge The folding edge in the view whose {@link #style} should be initialized. - * @param masterEdges The edges that are being represented by the folding edge. - * @returns The {@link #foldingEdgeStyle} or a {@link #clone} of it depending on the {@link #cloneEdgeStyle} property. This method may return null to indicate that - * the default style should not be changed. - * @protected - */ - createEdgeStyle(foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):yfiles.styles.IEdgeStyle; - /** - * Callback factory method that creates the {@link yfiles.graph.ILabelModelParameter} for use in - * {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgeLabels}. - * @param foldingView The folding view instance. - * @param localLabel The local label in the view whose {@link #layoutParameter} should be initialized. May be null if the label layout parameter is requested for the - * label creation. - * @param masterLabel The label that is being represented by the folding label. - * @returns The {@link #labelLayoutParameter} or a {@link #clone} of it depending on the {@link #cloneLabelLayoutParameter} property. This method may return null to indicate that - * the default label layout parameter should not be changed. - * @protected - */ - createLabelLayoutParameter(foldingView:yfiles.graph.IFoldingView,localLabel:yfiles.graph.ILabel,masterLabel:yfiles.graph.ILabel):yfiles.graph.ILabelModelParameter; - /** - * Callback factory method that creates the {@link yfiles.styles.ILabelStyle} for use in - * {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgeLabels}. - * @param foldingView The folding view instance. - * @param localLabel The local label in the view whose {@link #style} should be initialized. May be null if the label style is requested for the label - * creation. - * @param masterLabel The label that is being represented by the folding label. - * @returns The {@link #labelStyle} or a {@link #clone} of it depending on the {@link #cloneLabelStyle} property. This method may return null to indicate that - * the default style should not be changed. - * @protected - */ - createLabelStyle(foldingView:yfiles.graph.IFoldingView,localLabel:yfiles.graph.ILabel,masterLabel:yfiles.graph.ILabel):yfiles.styles.ILabelStyle; - /** - * Callback factory method that creates the {@link yfiles.graph.IPortLocationModelParameter} of the source port for use in - * {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgePorts}. - * @param foldingView The folding view instance. - * @param localEdge The local edge in the view whose source port's {@link #locationParameter} should be initialized. - * @param masterEdges The master edges that the folding edge represents. - * @returns The {@link #sourcePortLocationParameter} or a {@link #clone} of it depending on the {@link #cloneSourcePortLocationParameter} property. This method may return null to indicate that - * the default port location parameter should not be changed. - * @protected - */ - createSourcePortLocationParameter(foldingView:yfiles.graph.IFoldingView,localEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):yfiles.graph.IPortLocationModelParameter; - /** - * Callback factory method that creates the {@link yfiles.styles.IPortStyle} of the source port for use in - * {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgePorts}. - * @param foldingView The folding view instance. - * @param localEdge The local edge in the view whose source port's {@link #style} should be initialized. - * @param masterEdges The master edges that the folding edge represents. - * @returns The {@link #sourcePortStyle} or a {@link #clone} of it depending on the {@link #cloneSourcePortStyle} property. This method may return null to indicate that - * the default style should not be changed. - * @protected - */ - createSourcePortStyle(foldingView:yfiles.graph.IFoldingView,localEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):yfiles.styles.IPortStyle; - /** - * Callback factory method that creates the {@link yfiles.graph.IPortLocationModelParameter} of the target port for use in - * {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgePorts}. - * @param foldingView The folding view instance. - * @param localEdge The local edge in the view whose target port's {@link #locationParameter} should be initialized. - * @param masterEdges The master edges that the folding edge represents. - * @returns The {@link #targetPortLocationParameter} or a {@link #clone} of it depending on the {@link #cloneTargetPortLocationParameter} property. This method may return null to indicate that - * the default port location parameter should not be changed. - * @protected - */ - createTargetPortLocationParameter(foldingView:yfiles.graph.IFoldingView,localEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):yfiles.graph.IPortLocationModelParameter; - /** - * Callback factory method that creates the {@link yfiles.styles.IPortStyle} of the target port for use in - * {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgePorts}. - * @param foldingView The folding view instance. - * @param localEdge The local edge in the view whose target port's {@link #style} should be initialized. - * @param masterEdges The master edges that the folding edge represents. - * @returns The {@link #targetPortStyle} or a {@link #clone} of it depending on the {@link #cloneTargetPortStyle} property. This method may return null to indicate that - * the default style should not be changed. - * @protected - */ - createTargetPortStyle(foldingView:yfiles.graph.IFoldingView,localEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):yfiles.styles.IPortStyle; - /** - * Callback method that initializes the bends of the folding edge. - *

- * This will call the {@link yfiles.graph.FoldingEdgeState#clearBends} callback if {@link yfiles.graph.FoldingEdgeConverterBase#resetBends} is enabled. - *

- * @param state The viewstate to change. - * @param foldingView The folding view instance that has triggered the {@link #initializeFoldingEdgeState} call. - * @param foldingEdge The folding edge in the view that may be changed using the state. - * @param masterEdges The master edges that the folding edge represents. - * @protected - */ - initializeFoldingEdgeBends(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; - /** - * Callback method that initializes the initial labels of the folding edge. - *

- * This will first {@link yfiles.graph.FoldingLabelOwnerState#clearLabels clear all the labels} and then try to copy the first label of the single master edge if {@link yfiles.graph.FoldingEdgeConverterBase#copyFirstLabel} is enabled. It - * will call {@link yfiles.graph.FoldingEdgeConverterBase#createLabelStyle} and {@link yfiles.graph.FoldingEdgeConverterBase#createLabelLayoutParameter} - * and use the returned style and layout parameter if they are non-null when {@link yfiles.graph.FoldingEdgeState#addLabel adding the label} on the folding edge. - *

- * @param state The viewstate to change. - * @param foldingView The folding view instance that has triggered the {@link #initializeFoldingEdgeState} call. - * @param foldingEdge The folding edge in the view that may be changed using the state. - * @param masterEdges The master edges that the folding edge represents. - * @see yfiles.graph.FoldingEdgeConverterBase#labelStyle - * @see yfiles.graph.FoldingEdgeConverterBase#labelLayoutParameter - * @protected - */ - initializeFoldingEdgeLabels(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; - /** - * Callback method that initializes the ports of the folding edge. - *

- * If the source port of the foldingEdge {@link yfiles.graph.IFoldingView#isInFoldingState is in folding state}, this implementation calls {@link yfiles.graph.FoldingEdgeConverterBase#createSourcePortStyle} - * and {@link yfiles.graph.FoldingEdgeConverterBase#createSourcePortLocationParameter} and {@link yfiles.graph.FoldingPortState#style assigns the style} and {@link yfiles.graph.FoldingPortState#locationParameter location parameter} - * to the folding source port if non-null values have been returned. The same holds true for the target port where the {@link yfiles.graph.FoldingEdgeConverterBase#createTargetPortStyle} - * and {@link yfiles.graph.FoldingEdgeConverterBase#createTargetPortLocationParameter} callbacks are used. - *

- * @param state The viewState to change. - * @param foldingView The folding view instance that has triggered the {@link #initializeFoldingEdgeState} call. - * @param foldingEdge The folding edge in the view that may be changed using the state. - * @param masterEdges The master edges that the folding edge represents. - * @see yfiles.graph.FoldingEdgeConverterBase#sourcePortStyle - * @see yfiles.graph.FoldingEdgeConverterBase#targetPortStyle - * @see yfiles.graph.FoldingEdgeConverterBase#sourcePortLocationParameter - * @see yfiles.graph.FoldingEdgeConverterBase#targetPortLocationParameter - * @see yfiles.graph.FoldingEdgeConverterBase#createSourcePortStyle - * @see yfiles.graph.FoldingEdgeConverterBase#createTargetPortStyle - * @see yfiles.graph.FoldingEdgeConverterBase#createSourcePortLocationParameter - * @see yfiles.graph.FoldingEdgeConverterBase#createTargetPortLocationParameter - * @protected - */ - initializeFoldingEdgePorts(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; - /** - * Implements the {@link yfiles.graph.IFoldingEdgeConverter#initializeFoldingEdgeState} method and initializes the folding edge - * appearance. - *

- * This method calls {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgeStyle}, - * {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgePorts}, - * {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgeBends}, - * {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgeLabels}. - *

- * @param state - * @param foldingView - * @param foldingEdge - * @param masterEdges - */ - initializeFoldingEdgeState(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; - /** - * Callback method that initializes the {@link yfiles.graph.FoldingEdgeState#style style property} of the folding edge. - *

- * This implementation calls {@link yfiles.graph.FoldingEdgeConverterBase#createEdgeStyle} and {@link yfiles.graph.FoldingEdgeState#style assigns} the style to the folding - * edge if a non-null value has been returned. - *

- * @param state The viewstate to change. - * @param foldingView The folding view instance that has triggered the {@link #initializeFoldingEdgeState} call. - * @param foldingEdge The folding edge in the view that may be changed using the state. - * @param masterEdges The master edges that the folding edge represents. - * @protected - */ - initializeFoldingEdgeStyle(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; - /** - * Called by {@link yfiles.graph.FoldingEdgeConverterBase#updateFoldingEdgeState} to synchronize the first label if {@link yfiles.graph.FoldingEdgeConverterBase#copyFirstLabel} is enabled. - *

- * This will adjust the label's text, preferred size and tag properties or remove the label if there is no master label or - * there is more than one master edge. - *

- * @param state The viewstate of the edge to change. - * @param foldingView The folding view. - * @param foldingEdge The folding edge. - * @param masterEdges The master edges. - * @protected - */ - synchronizeLabels(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; - /** - * Implements the {@link yfiles.graph.IFoldingEdgeConverter#updateFoldingEdgeState} method and changes the folding edge - * appearance. - *

- * This method calls {@link yfiles.graph.FoldingEdgeConverterBase#synchronizeLabels}, only. - *

- * @param state - * @param foldingView - * @param foldingEdge - * @param masterEdges - */ - updateFoldingEdgeState(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; - /** - * Gets or sets a value indicating whether the {@link yfiles.graph.FoldingEdgeConverterBase#foldingEdgeStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. - * @type {boolean} - */ - cloneEdgeStyle:boolean; - /** - * Gets or sets the {@link yfiles.styles.IPortStyle} to use for the folding source port. - *

- * A value of null will leave the style property unmodified. - *

- * @type {yfiles.styles.IPortStyle} - */ - sourcePortStyle:yfiles.styles.IPortStyle; - /** - * Gets or sets a value indicating whether the {@link yfiles.graph.FoldingEdgeConverterBase#sourcePortStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone clone} or not. - * @type {boolean} - */ - cloneSourcePortStyle:boolean; - /** - * Gets or sets the {@link yfiles.styles.IPortStyle} to use for the folding target port. - *

- * A value of null will leave the style property unmodified. - *

- * @type {yfiles.styles.IPortStyle} - */ - targetPortStyle:yfiles.styles.IPortStyle; - /** - * Gets or sets a value indicating whether the {@link yfiles.graph.FoldingEdgeConverterBase#targetPortStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. - * @type {boolean} - */ - cloneTargetPortStyle:boolean; - /** - * Gets or sets the {@link yfiles.graph.IPortLocationModelParameter} to use for the source port of the folding edge. - *

- * Since the appearance of the folding edge may totally differ from the appearance of the master edge, the location of the - * source port may also be different. This property can be used to assign a different specific location parameter to the - * source port if the edge {@link yfiles.graph.IFoldingView#isInFoldingState is in folding state}. A value of null will leave the location parameter property unmodified. The - * default is null - *

- * @see yfiles.graph.FoldingEdgeConverterBase#createSourcePortLocationParameter - * @type {yfiles.graph.IPortLocationModelParameter} - */ - sourcePortLocationParameter:yfiles.graph.IPortLocationModelParameter; - /** - * Gets or sets a value indicating whether the {@link yfiles.graph.FoldingEdgeConverterBase#sourcePortLocationParameter} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. - * @type {boolean} - */ - cloneSourcePortLocationParameter:boolean; - /** - * Gets or sets the {@link yfiles.graph.IPortLocationModelParameter} to use for the target port of the folding edge. - *

- * Since the appearance of the folding edge may totally differ from the appearance of the master edge, the location of the - * target port may also be different. This property can be used to assign a different specific location parameter to the - * target port if the edge {@link yfiles.graph.IFoldingView#isInFoldingState is in folding state}. A value of null will leave the location parameter property unmodified. The - * default is null - *

- * @see yfiles.graph.FoldingEdgeConverterBase#createTargetPortLocationParameter - * @type {yfiles.graph.IPortLocationModelParameter} - */ - targetPortLocationParameter:yfiles.graph.IPortLocationModelParameter; - /** - * Gets or sets a value indicating whether the {@link yfiles.graph.FoldingEdgeConverterBase#targetPortLocationParameter} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. - * @type {boolean} - */ - cloneTargetPortLocationParameter:boolean; - /** - * Gets or sets the {@link yfiles.styles.ILabelStyle} to use for the first label of the folding edge. - *

- * This will only affect the folding edge if the {@link yfiles.graph.FoldingEdgeConverterBase#copyFirstLabel} property is set to true. - *

- *

- * A value of null will leave the style property unmodified. - *

- * @type {yfiles.styles.ILabelStyle} - */ - labelStyle:yfiles.styles.ILabelStyle; - /** - * Gets or sets a value indicating whether the {@link yfiles.graph.FoldingEdgeConverterBase#labelStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. - * @type {boolean} - */ - cloneLabelStyle:boolean; - /** - * Gets or sets the {@link yfiles.graph.ILabelModelParameter} to use for the first label of the folding edge. - *

- * This will only affect the folding edge if the {@link yfiles.graph.FoldingEdgeConverterBase#copyFirstLabel} property is set to true. - *

- *

- * A value of null will leave the label model parameter property unmodified. - *

- * @type {yfiles.graph.ILabelModelParameter} - */ - labelLayoutParameter:yfiles.graph.ILabelModelParameter; - /** - * Gets or sets a value indicating whether the {@link yfiles.graph.FoldingEdgeConverterBase#labelLayoutParameter} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. - * @type {boolean} - */ - cloneLabelLayoutParameter:boolean; - /** - * Gets or sets the {@link yfiles.styles.IEdgeStyle} to use for the folding edge. - *

- * Depending on the {@link yfiles.graph.FoldingEdgeConverterBase#cloneEdgeStyle} property this implementation will assign a {@link yfiles.lang.ICloneable#clone} to the property or this - * instance. - *

- *

- * A value of null (the default) will leave the style property unmodified. - *

- * @type {yfiles.styles.IEdgeStyle} - */ - foldingEdgeStyle:yfiles.styles.IEdgeStyle; - /** - * Gets or sets a value indicating whether to reset and clear the bends of a folding edge initially. - * @type {boolean} - */ - resetBends:boolean; - /** - * Gets or sets a value indicating whether the first label of the {@link yfiles.graph.IFoldingView#getMasterItem master edge} should be recreated for the folding edge. - *

- * This setting can be used to initially create a copy of the first label of the master edge (if any) and subsequently - * synchronize the {@link yfiles.graph.ILabel#text} property with the master's edge label text. - *

- * @see yfiles.graph.FoldingEdgeConverterBase#labelStyle - * @see yfiles.graph.FoldingEdgeConverterBase#labelLayoutParameter - * @type {boolean} - */ - copyFirstLabel:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.FoldingEdgeConverterBase; - } - /** - * The default implementation of the {@link yfiles.graph.IFoldingEdgeConverter} that is used by the {@link yfiles.graph.FoldingManager} - * initially and can be customized to suit the application's needs. - * @see yfiles.graph.FoldingEdgeConverterBase - * @see yfiles.graph.DefaultFoldingEdgeConverter#reuseMasterPorts - * @class - * @extends {yfiles.graph.FoldingEdgeConverterBase} - */ - export interface DefaultFoldingEdgeConverter extends yfiles.graph.FoldingEdgeConverterBase{} - export class DefaultFoldingEdgeConverter { - constructor(); - /** - * Gets or sets a property that determines whether this implementation should reuse the ports of the {@link yfiles.graph.FoldingManager#masterGraph} at non-{@link yfiles.graph.IFoldingView#isInFoldingState folder} nodes - * for the folding edges. - *

- * The {@link yfiles.graph.IFoldingView view} can be configured to use separate port instances for folding edges. This makes it possible to assign different - * styles and locations to source and target ports of folding edges, which may be desirable if the style and geometry of - * folding edges differs a lot from the style of the master edges. Folding edges may of course still connect to non-folder - * nodes at one of their ports. Setting this property to true will make the folding edge connect to the {@link yfiles.graph.IFoldingView#getViewItem view} port instance. - * This property can be set to true, iff the graph model used is port-centric, i.e. each edge connects to specific ports - * and even folding edges should still connect to those specific view ports. The default value is false - *

- * @see yfiles.graph.DefaultFoldingEdgeConverter#reuseFolderNodePorts - * @type {boolean} - */ - reuseMasterPorts:boolean; - /** - * Gets or sets a property that determines whether this implementation should reuse the ports of {@link yfiles.graph.IFoldingView#isInFoldingState folder} nodes for the - * folding edges. - *

- * The {@link yfiles.graph.IFoldingView view} can be configured to use separate port instances for folding edges. This makes it possible to assign different - * styles and locations to source and target ports of folding edges, which may be desirable if the style and geometry of - * folding edges differs a lot from the style of the master edges. Folder nodes ({@link yfiles.graph.IFoldingView#collapse collapsed} group nodes), will have all of - * their master's ports {@link yfiles.graph.IFoldingView#getViewItem represented} in the view. This property can be used to make folding edges that connect to the master - * ports connect to these folding port instances instead of creating extra folding ports for the edges. Note that ports can - * only be automatically reused by folding edges if they still connect to the same nodes. Otherwise the view will have to - * create new folding ports to let the edges connect to the representing adjacent nodes. This property can be set to true, - * iff the graph model used is port-centric, i.e. each edge connects to specific ports and even folding edges should still - * connect to those specific port instances, if possible. The default value is false. - *

- * @see yfiles.graph.DefaultFoldingEdgeConverter#reuseMasterPorts - * @type {boolean} - */ - reuseFolderNodePorts:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.DefaultFoldingEdgeConverter; - } - /** - * Simple default implementation of the {@link yfiles.graph.IFolderNodeConverter} interface that is used by the - * {@link yfiles.graph.FoldingManager}'s {@link yfiles.graph.FoldingManager#folderNodeConverter} property. - *

- * This class has a couple of properties that can be adjusted to customize the behavior. Also, it contains a number of - * callback methods for conveniently overriding the implementation in custom sub classes. - *

- * @see yfiles.graph.FoldingManager - * @see yfiles.graph.IFolderNodeConverter - * @see yfiles.graph.DefaultFoldingEdgeConverter - * @class - * @implements {yfiles.graph.IFolderNodeConverter} - */ - export interface DefaultFolderNodeConverter extends yfiles.lang.Object,yfiles.graph.IFolderNodeConverter{} - export class DefaultFolderNodeConverter { - /** - * Initializes a new instance of this class using the values provided by the folderNodeDefaults parameter. - * @param folderNodeDefaults - */ - constructor(folderNodeDefaults:yfiles.graph.INodeDefaults); - /** - * Initializes a new instance of this class using the values provided by the folderNodeDefaults parameter. - * @param {Object} options The parameters to pass. - * @param options.folderNodeDefaults - * @param {boolean} options.cloneLabelLayoutParameter A value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#labelLayoutParameter} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#cloneLabelLayoutParameter} property on the created object. - *

- * @param {boolean} options.cloneLabelStyle A value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#labelStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#cloneLabelStyle} property on the created object. - *

- * @param {boolean} options.cloneNodeStyle A value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#folderNodeStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#cloneNodeStyle} property on the created object. - *

- * @param {boolean} options.clonePortStyle A value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#portStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#clonePortStyle} property on the created object. - *

- * @param {boolean} options.copyFirstLabel A value indicating whether the first label of the {@link yfiles.graph.IFoldingView#getMasterItem master group node} should be recreated for the collapsed group node instance. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#copyFirstLabel} property on the created object. - *

- * @param {yfiles.geometry.Size} options.folderNodeSize The initial size of the {@link yfiles.graph.INode#layout} of the collapsed group node that will be assigned during the {@link yfiles.graph.IFolderNodeConverter#initializeFolderNodeState creation} of the appearance of the collapsed group node. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#folderNodeSize} property on the created object. - *

- * @param {yfiles.styles.INodeStyle} options.folderNodeStyle The {@link yfiles.styles.INodeStyle} to use for the {@link yfiles.graph.IFoldingView#collapse collapsed} group nodes. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#folderNodeStyle} property on the created object. - *

- * @param {yfiles.graph.ILabelModelParameter} options.labelLayoutParameter The {@link yfiles.graph.ILabelModelParameter} to use for the first label of the collapsed group node. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#labelLayoutParameter} property on the created object. - *

- * @param {yfiles.styles.ILabelStyle} options.labelStyle The {@link yfiles.styles.ILabelStyle} to use for the first label of the collapsed group nodes. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#labelStyle} property on the created object. - *

- * @param {yfiles.graph.IPortLocationModelParameter} options.portLocationParameter The {@link yfiles.graph.IPortLocationModelParameter} to use for the ports at the collapsed group node that {@link yfiles.graph.IFoldingView#getViewItem represent} the ports of the {@link yfiles.graph.IFoldingView#getMasterItem master group node} in the collapsed state. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#portLocationParameter} property on the created object. - *

- * @param {yfiles.styles.IPortStyle} options.portStyle The {@link yfiles.styles.IPortStyle} to use for the ports at the collapsed group node that {@link yfiles.graph.IFoldingView#getViewItem represent} the ports of the {@link yfiles.graph.IFoldingView#getMasterItem master group node} in the collapsed state. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#portStyle} property on the created object. - *

- */ - constructor(options:{folderNodeDefaults:yfiles.graph.INodeDefaults,cloneLabelLayoutParameter?:boolean,cloneLabelStyle?:boolean,cloneNodeStyle?:boolean,clonePortStyle?:boolean,copyFirstLabel?:boolean,folderNodeSize?:yfiles.geometry.Size,folderNodeStyle?:yfiles.styles.INodeStyle,labelLayoutParameter?:yfiles.graph.ILabelModelParameter,labelStyle?:yfiles.styles.ILabelStyle,portLocationParameter?:yfiles.graph.IPortLocationModelParameter,portStyle?:yfiles.styles.IPortStyle}); - /** - * Initializes a new instance of this class with default values. - * @param {Object} [options=null] The parameters to pass. - * @param {boolean} options.cloneLabelLayoutParameter A value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#labelLayoutParameter} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#cloneLabelLayoutParameter} property on the created object. - *

- * @param {boolean} options.cloneLabelStyle A value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#labelStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#cloneLabelStyle} property on the created object. - *

- * @param {boolean} options.cloneNodeStyle A value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#folderNodeStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#cloneNodeStyle} property on the created object. - *

- * @param {boolean} options.clonePortStyle A value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#portStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#clonePortStyle} property on the created object. - *

- * @param {boolean} options.copyFirstLabel A value indicating whether the first label of the {@link yfiles.graph.IFoldingView#getMasterItem master group node} should be recreated for the collapsed group node instance. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#copyFirstLabel} property on the created object. - *

- * @param {yfiles.geometry.Size} options.folderNodeSize The initial size of the {@link yfiles.graph.INode#layout} of the collapsed group node that will be assigned during the {@link yfiles.graph.IFolderNodeConverter#initializeFolderNodeState creation} of the appearance of the collapsed group node. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#folderNodeSize} property on the created object. - *

- * @param {yfiles.styles.INodeStyle} options.folderNodeStyle The {@link yfiles.styles.INodeStyle} to use for the {@link yfiles.graph.IFoldingView#collapse collapsed} group nodes. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#folderNodeStyle} property on the created object. - *

- * @param {yfiles.graph.ILabelModelParameter} options.labelLayoutParameter The {@link yfiles.graph.ILabelModelParameter} to use for the first label of the collapsed group node. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#labelLayoutParameter} property on the created object. - *

- * @param {yfiles.styles.ILabelStyle} options.labelStyle The {@link yfiles.styles.ILabelStyle} to use for the first label of the collapsed group nodes. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#labelStyle} property on the created object. - *

- * @param {yfiles.graph.IPortLocationModelParameter} options.portLocationParameter The {@link yfiles.graph.IPortLocationModelParameter} to use for the ports at the collapsed group node that {@link yfiles.graph.IFoldingView#getViewItem represent} the ports of the {@link yfiles.graph.IFoldingView#getMasterItem master group node} in the collapsed state. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#portLocationParameter} property on the created object. - *

- * @param {yfiles.styles.IPortStyle} options.portStyle The {@link yfiles.styles.IPortStyle} to use for the ports at the collapsed group node that {@link yfiles.graph.IFoldingView#getViewItem represent} the ports of the {@link yfiles.graph.IFoldingView#getMasterItem master group node} in the collapsed state. - *

- * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#portStyle} property on the created object. - *

- */ - constructor(options?:{cloneLabelLayoutParameter?:boolean,cloneLabelStyle?:boolean,cloneNodeStyle?:boolean,clonePortStyle?:boolean,copyFirstLabel?:boolean,folderNodeSize?:yfiles.geometry.Size,folderNodeStyle?:yfiles.styles.INodeStyle,labelLayoutParameter?:yfiles.graph.ILabelModelParameter,labelStyle?:yfiles.styles.ILabelStyle,portLocationParameter?:yfiles.graph.IPortLocationModelParameter,portStyle?:yfiles.styles.IPortStyle}); - /** - * Callback factory method that creates the {@link yfiles.graph.ILabelModelParameter} for use in - * {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodeLabels}. - * @param foldingView The folding view instance. - * @param localLabel The local label in the view whose {@link #layoutParameter} should be initialized. May be null if the label layout parameter is requested for the - * label creation. - * @param masterLabel The label that is being represented by the folding label. - * @returns The {@link #labelLayoutParameter} or a {@link #clone} of it depending on the {@link #cloneLabelLayoutParameter} property. This method may return null to indicate that - * the default label layout parameter should not be changed. - * @protected - */ - createLabelLayoutParameter(foldingView:yfiles.graph.IFoldingView,localLabel:yfiles.graph.ILabel,masterLabel:yfiles.graph.ILabel):yfiles.graph.ILabelModelParameter; - /** - * Callback factory method that creates the {@link yfiles.styles.ILabelStyle} for use in - * {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodeLabels}. - * @param foldingView The folding view instance. - * @param localLabel The local label in the view whose {@link #style} should be initialized. May be null if the label style is requested for the label - * creation. - * @param masterLabel The label that is being represented by the folding label. - * @returns The {@link #labelStyle} or a {@link #clone} of it depending on the {@link #cloneLabelStyle} property. This method may return null to indicate that - * the default style should not be changed. - * @protected - */ - createLabelStyle(foldingView:yfiles.graph.IFoldingView,localLabel:yfiles.graph.ILabel,masterLabel:yfiles.graph.ILabel):yfiles.styles.ILabelStyle; - /** - * Callback factory method that creates the {@link yfiles.styles.INodeStyle} for use in - * {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodeStyle}. - * @param foldingView The folding view instance. - * @param viewNode The local folder node in the view whose {@link #style} should be initialized. - * @param masterNode The node that is being represented by the folder node. - * @returns The {@link #folderNodeStyle} or a {@link #clone} of it depending on the {@link #cloneNodeStyle} property. This method may return null to indicate that - * the default style should not be changed. - * @protected - */ - createNodeStyle(foldingView:yfiles.graph.IFoldingView,viewNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):yfiles.styles.INodeStyle; - /** - * Callback factory method that creates the {@link yfiles.graph.IPortLocationModelParameter} for use in - * {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodePorts}. - * @param foldingView The folding view instance. - * @param localPort The local port in the view whose {@link #locationParameter} should be initialized. - * @param masterPort The port that is being represented by the folding port. - * @returns The {@link #portLocationParameter} or a {@link #clone} of it depending on the {@link #clonePortLocationParameter} property. This method may return null to indicate that - * the default port location parameter should not be changed. - * @protected - */ - createPortLocationParameter(foldingView:yfiles.graph.IFoldingView,localPort:yfiles.graph.IPort,masterPort:yfiles.graph.IPort):yfiles.graph.IPortLocationModelParameter; - /** - * Callback factory method that creates the {@link yfiles.styles.IPortStyle} for use in - * {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodePorts}. - * @param foldingView The folding view instance. - * @param localPort The local port in the view whose {@link #style} should be initialized. - * @param masterPort The port that is being represented by the folding port. - * @returns The {@link #portStyle} or a {@link #clone} of it depending on the {@link #clonePortStyle} property. This method may return null to indicate that - * the default style should not be changed. - * @protected - */ - createPortStyle(foldingView:yfiles.graph.IFoldingView,localPort:yfiles.graph.IPort,masterPort:yfiles.graph.IPort):yfiles.styles.IPortStyle; - /** - * Callback method that initializes the initial labels of the collapsed group node. - *

- * This will try to copy the first label of the master node if {@link yfiles.graph.DefaultFolderNodeConverter#copyFirstLabel} is enabled. It will call {@link yfiles.graph.DefaultFolderNodeConverter#createLabelStyle} - * and {@link yfiles.graph.DefaultFolderNodeConverter#createLabelLayoutParameter} and use the returned style and layout parameter - * if they are non-null when {@link yfiles.graph.FolderNodeState#addLabel adding the label} on the folder node. - *

- * @param state The node view state whose labels should be synchronized. - * @param foldingView The folding view instance that has triggered the {@link #initializeFolderNodeState} - * call. - * @param viewNode The collapsed group node in the view that may be changed using the {@link }. - * @param masterNode The master node that the folder node represents. - * @see yfiles.graph.DefaultFolderNodeConverter#labelStyle - * @see yfiles.graph.DefaultFolderNodeConverter#labelLayoutParameter - * @see yfiles.graph.FoldingManager#getFolderNodeState - * @protected - */ - initializeFolderNodeLabels(state:yfiles.graph.FolderNodeState,foldingView:yfiles.graph.IFoldingView,viewNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; - /** - * Callback method that initializes the {@link yfiles.graph.INode#layout} of the collapsed group node. - *

- * This implementation will {@link yfiles.graph.FolderNodeState#layout set the bounds} of the nodes in such a way that the size will be that of the {@link yfiles.graph.DefaultFolderNodeConverter#folderNodeSize} property (if - * non-null) but not smaller than the {@link yfiles.input.INodeSizeConstraintProvider#getMinimumSize minimum} size that is reported by a potential {@link yfiles.input.INodeSizeConstraintProvider} - * for {@link yfiles.graph.INode}s that has been found in the {@link yfiles.graph.ILookup} of the viewNode. - *

- * @param state The node view state whose layout should be synchronized. - * @param foldingView The folding view instance. - * @param viewNode The local collapsed group node to change. - * @param masterNode The master node that is represented by the local group node. - * @protected - */ - initializeFolderNodeLayout(state:yfiles.graph.FolderNodeState,foldingView:yfiles.graph.IFoldingView,viewNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; - /** - * Called by {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodeState} to initialize the appearance of the {@link yfiles.graph.IFoldingView#getViewItem representatives} - * of the master ports at the collapsed group node. - *

- * This method will call {@link yfiles.graph.DefaultFolderNodeConverter#createPortStyle} and {@link yfiles.graph.DefaultFolderNodeConverter#createPortLocationParameter} - * for each port at the group node and assign the returned style and location parameter if they are non-null. - *

- * @param state The node view state whose ports should be synchronized. - * @param foldingView The folding view instance. - * @param viewNode The local group node. - * @param masterNode The master group node. - * @protected - */ - initializeFolderNodePorts(state:yfiles.graph.FolderNodeState,foldingView:yfiles.graph.IFoldingView,viewNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; - /** - * Implements the {@link yfiles.graph.IFolderNodeConverter#initializeFolderNodeState} method and initializes the appearance of the - * collapsed group node. - *

- * This method calls {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodeStyle}, - * {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodeLabels}, - * {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodeLayout}, and - * {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodePorts}. - *

- * @param state - * @param foldingView - * @param viewNode - * @param masterNode - */ - initializeFolderNodeState(state:yfiles.graph.FolderNodeState,foldingView:yfiles.graph.IFoldingView,viewNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; - /** - * Callback method that initializes the {@link yfiles.graph.FolderNodeState#style style property} of the collapsed group node. - *

- * This implementation calls {@link yfiles.graph.DefaultFolderNodeConverter#createNodeStyle} and {@link yfiles.graph.FolderNodeState#style assigns} the style to the group - * node if a non-null value has been returned. - *

- * @param state The node view state whose style should be synchronized. - * @param foldingView The folding view instance that has triggered the {@link #initializeFolderNodeState} - * call. - * @param viewNode The local node in the view that may be changed using the {@link }. - * @param masterNode The master node that the local folder node represents. - * @see yfiles.graph.FoldingManager#getFolderNodeState - * @protected - */ - initializeFolderNodeStyle(state:yfiles.graph.FolderNodeState,foldingView:yfiles.graph.IFoldingView,viewNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; - /** - * Called by {@link yfiles.graph.DefaultFolderNodeConverter#updateFolderNodeState} to synchronize the first label if {@link yfiles.graph.DefaultFolderNodeConverter#copyFirstLabel} is enabled. - *

- * This will adjust the label text property or remove the label if there is no master label. - *

- * @param state The node view state whose labels should be synchronized. - * @param foldingView The folding view. - * @param viewNode The local node instance. - * @param masterNode The master node. - * @protected - */ - synchronizeLabels(state:yfiles.graph.FolderNodeState,foldingView:yfiles.graph.IFoldingView,viewNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; - /** - * Implements the {@link yfiles.graph.IFolderNodeConverter#updateFolderNodeState} method and changes the folder node appearance. - *

- * This method calls {@link yfiles.graph.DefaultFolderNodeConverter#synchronizeLabels}, only. - *

- * @param state - * @param foldingView - * @param viewNode - * @param masterNode - */ - updateFolderNodeState(state:yfiles.graph.FolderNodeState,foldingView:yfiles.graph.IFoldingView,viewNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; - /** - * Gets or sets the {@link yfiles.styles.INodeStyle} to use for the {@link yfiles.graph.IFoldingView#collapse collapsed} group nodes. - *

- * Depending on the {@link yfiles.graph.DefaultFolderNodeConverter#cloneNodeStyle} property this implementation will assign a {@link yfiles.lang.ICloneable#clone} to the property or this - * instance. The default is null - *

- *

- * A value of null will leave the style property unmodified. - *

- * @type {yfiles.styles.INodeStyle} - */ - folderNodeStyle:yfiles.styles.INodeStyle; - /** - * Gets or sets a value indicating whether the first label of the {@link yfiles.graph.IFoldingView#getMasterItem master group node} should be recreated for the collapsed - * group node instance. - *

- * This setting can be used to initially create a copy of the first label of the master group node (if any) and - * subsequently synchronize the {@link yfiles.graph.ILabel#text} property with the master's node label text. Set it to true if the first label should be - * copied; false otherwise. The default is false. - *

- * @see yfiles.graph.DefaultFolderNodeConverter#labelStyle - * @see yfiles.graph.DefaultFolderNodeConverter#labelLayoutParameter - * @type {boolean} - */ - copyFirstLabel:boolean; - /** - * Gets or sets the {@link yfiles.styles.ILabelStyle} to use for the first label of the collapsed group nodes. - *

- * This will only affect the collapsed group node if the {@link yfiles.graph.DefaultFolderNodeConverter#copyFirstLabel} property is set to true. The default is null - *

- *

- * A value of null will leave the style property unmodified. - *

- * @see yfiles.graph.DefaultFolderNodeConverter#copyFirstLabel - * @type {yfiles.styles.ILabelStyle} - */ - labelStyle:yfiles.styles.ILabelStyle; - /** - * Gets or sets the {@link yfiles.graph.ILabelModelParameter} to use for the first label of the collapsed group node. - *

- * This will only affect the folder node if the {@link yfiles.graph.DefaultFolderNodeConverter#copyFirstLabel} property is set to true. The default is null - *

- *

- * A value of null will leave the label model parameter property unmodified. - *

- * @see yfiles.graph.DefaultFolderNodeConverter#copyFirstLabel - * @see yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodeLabels - * @type {yfiles.graph.ILabelModelParameter} - */ - labelLayoutParameter:yfiles.graph.ILabelModelParameter; - /** - * Gets or sets the {@link yfiles.styles.IPortStyle} to use for the ports at the collapsed group node that {@link yfiles.graph.IFoldingView#getViewItem represent} the ports of - * the {@link yfiles.graph.IFoldingView#getMasterItem master group node} in the collapsed state. - *

- * Since the appearance of the collapsed group node may totally differ from the appearance of the expanded group node, the - * appearance of the ports may also be different. This property can be used to assign a different specific style to the - * ports if the node is in collapsed state. A value of null will leave the style property unmodified. The default is null - *

- * @see yfiles.graph.DefaultFolderNodeConverter#createPortStyle - * @type {yfiles.styles.IPortStyle} - */ - portStyle:yfiles.styles.IPortStyle; - /** - * Sets the initial size of the {@link yfiles.graph.INode#layout} of the collapsed group node that will be assigned during the {@link yfiles.graph.IFolderNodeConverter#initializeFolderNodeState creation} of the appearance of - * the collapsed group node. - *

- * Since the {@link yfiles.graph.INode#layout} of an {@link yfiles.graph.IFoldingView#expand expanded} group node normally encompasses the child nodes, it will have quite a large size. Since the - * contents of a collapsed group node are not visible, there is no need for the collapsed group node to encompass the area - * of its children. Thus the size can be different and most of the time should be smaller. Setting this property to non-null - * values will make the initial layout of the collapsed node become the given size assigned. The default is null - *

- * @see yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodeLayout - * @type {yfiles.geometry.Size} - */ - folderNodeSize:yfiles.geometry.Size; - /** - * Gets or sets the {@link yfiles.graph.IPortLocationModelParameter} to use for the ports at the collapsed group node that {@link yfiles.graph.IFoldingView#getViewItem represent} - * the ports of the {@link yfiles.graph.IFoldingView#getMasterItem master group node} in the collapsed state. - *

- * Since the appearance of the collapsed group node may totally differ from the appearance of the expanded group node, the - * appearance of the ports may also be different. This property can be used to assign a different specific location - * parameter to the ports if the node is in collapsed state. A value of null will leave the location parameter property - * unmodified. The default is null - *

- * @see yfiles.graph.DefaultFolderNodeConverter#createPortLocationParameter - * @type {yfiles.graph.IPortLocationModelParameter} - */ - portLocationParameter:yfiles.graph.IPortLocationModelParameter; - /** - * Gets or sets a value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#folderNodeStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. - * @type {boolean} - */ - cloneNodeStyle:boolean; - /** - * Gets or sets a value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#portStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. - * @type {boolean} - */ - clonePortStyle:boolean; - /** - * Gets or sets a value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#portLocationParameter} instance should be assigned as a {@link yfiles.lang.ICloneable#clone clone} or not. - * @type {boolean} - */ - clonePortLocationParameter:boolean; - /** - * Gets or sets a value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#labelStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. - * @type {boolean} - */ - cloneLabelStyle:boolean; - /** - * Gets or sets a value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#labelLayoutParameter} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. - * @type {boolean} - */ - cloneLabelLayoutParameter:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.DefaultFolderNodeConverter; - } - /** - * A simple implementation of the {@link yfiles.graph.IFoldingEdgeConverter} interface for use in the {@link yfiles.graph.FoldingManager#foldingEdgeConverter} property, that will prevent - * folding edges from appearing in the {@link yfiles.graph.IFoldingView view}. - * @class - * @implements {yfiles.graph.IFoldingEdgeConverter} - */ - export interface ExcludingFoldingEdgeConverter extends yfiles.lang.Object,yfiles.graph.IFoldingEdgeConverter{} - export class ExcludingFoldingEdgeConverter { - /** - * Always calls {@link yfiles.graph.IFoldingEdgeFactory#excludeFoldingEdge} - * @param factory - * @param foldingView - * @param masterEdge - * @param source - * @param sourceIsCollapsed - * @param target - * @param targetIsCollapsed - * @returns - */ - addFoldingEdge(factory:yfiles.graph.IFoldingEdgeFactory,foldingView:yfiles.graph.IFoldingView,masterEdge:yfiles.graph.IEdge,source:yfiles.graph.INode,sourceIsCollapsed:boolean,target:yfiles.graph.INode,targetIsCollapsed:boolean):yfiles.graph.IEdge; - /** - * Does nothing and should not normally be called by the view since all folding edges are excluded from it. - * @param state - * @param foldingView - * @param foldingEdge - * @param masterEdges - */ - initializeFoldingEdgeState(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; - /** - * Does nothing and should not normally be called by the view since all folding edges are excluded from it. - * @param state - * @param foldingView - * @param foldingEdge - * @param masterEdges - */ - updateFoldingEdgeState(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.ExcludingFoldingEdgeConverter; - } - /** - * A simple implementation of the {@link yfiles.graph.IFoldingEdgeConverter} interface that will make the {@link yfiles.graph.IFoldingView view} contain at most one - * folding edge between each pair of nodes by letting a single folding edge represent all master edges. - *

- * This implementation by default, will have the {@link yfiles.graph.FoldingEdgeConverterBase#sourcePortLocationParameter} and the {@link yfiles.graph.FoldingEdgeConverterBase#targetPortLocationParameter} properties set to {@link yfiles.graph.FreeNodePortLocationModel#NODE_CENTER_ANCHORED} - * and the {@link yfiles.graph.FoldingEdgeConverterBase#resetBends} property set to true. - *

- * @class - * @extends {yfiles.graph.FoldingEdgeConverterBase} - */ - export interface MergingFoldingEdgeConverter extends yfiles.graph.FoldingEdgeConverterBase{} - export class MergingFoldingEdgeConverter { - /** - * Initializes a new instance of the {@link yfiles.graph.MergingFoldingEdgeConverter} class. - */ - constructor(); - /** - * Adds the first separate edge to the source and target node pair using the {@link yfiles.graph.IFoldingEdgeFactory#addAsSeparateEdge} - * method. - * @param factory - * @param foldingView - * @param masterEdge - * @param viewSourceNode - * @param sourceIsCollapsed - * @param targetSourceNode - * @param targetIsCollapsed - * @returns - * @protected - */ - addFirstSeparateEdge(factory:yfiles.graph.IFoldingEdgeFactory,foldingView:yfiles.graph.IFoldingView,masterEdge:yfiles.graph.IEdge,viewSourceNode:yfiles.graph.INode,sourceIsCollapsed:boolean,targetSourceNode:yfiles.graph.INode,targetIsCollapsed:boolean):yfiles.graph.IEdge; - /** - * Gets or sets a value indicating whether edge direction should be ignored for the determination of the - * {@link yfiles.graph.IFoldingEdgeFactory#getExistingFoldingEdges existing folding edges}. - * @type {boolean} - */ - ignoreEdgeDirection:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.MergingFoldingEdgeConverter; - } - /** - * This class adds folding support to {@link yfiles.graph.IGraph} implementations. - *

- * This implementation manages the varying states nodes and edges can have in different views and during different {@link yfiles.graph.IFoldingView#isExpanded collapsed/expanded} - * states of the nodes. Create an instance of this class for a given {@link yfiles.graph.IGraph} and use the {@link yfiles.graph.FoldingManager#createFoldingView} - * methods to create an {@link yfiles.graph.IGraph} implementation that provides a view of a subset of the graph, where {@link yfiles.graph.IGraph#isGroupNode group nodes} - * can be {@link yfiles.graph.IFoldingView#collapse collapsed} and {@link yfiles.graph.IFoldingView#expand expanded}. - *

- *

- * This class can be used to {@link yfiles.graph.FoldingManager#createFoldingView create folding views} of the {@link yfiles.graph.FoldingManager#masterGraph}, where group nodes can appear as {@link yfiles.graph.IFoldingView#collapse collapsed} group nodes with their - * contents hidden. Edges that connect to elements inside collapsed group nodes can be {@link yfiles.graph.FoldingManager#foldingEdgeConverter configured} to be represented by {@link yfiles.graph.FoldingEdgeStateId folding edges} - * in the views. The process of converting one or more true edges from the {@link yfiles.graph.FoldingManager#masterGraph} to zero or more folding edges can be - * customized, as well as the process of {@link yfiles.graph.FoldingManager#folderNodeConverter converting} an expanded group node to a collapsed group node. - *

- *

- * Class FoldingManager's central role for folding support is discussed in the section {@link @DGUIDE_PREFIX@/folding-technical_background.html Folding Revisited}. A brief - * description of the class's API, set-up, etc. is given in the section {@link @DGUIDE_PREFIX@/folding.html#folding-working_with_folding Working with Folding}. - *

- *

Related demos:

- *
    - *
  • Demo: Simple Editor Demo, Demo.yFiles.Graph.SimpleEditor
  • - *
- * @see yfiles.graph.IFoldingView - * @see yfiles.graph.FoldingManager#createFoldingView - * @class - */ - export interface FoldingManager extends yfiles.lang.Object{} - export class FoldingManager { - /** - * Creates a manager instance for the given {@link yfiles.graph.FoldingManager#masterGraph} to create views on top of it that support folding operations. - * @param masterGraph The graph to use as the {@link #masterGraph}. - * @throws {Stubs.Exceptions.ArgumentError} masterGraph is null. - */ - constructor(masterGraph:yfiles.graph.IGraph); - /** - * Creates a manager instance for the given {@link yfiles.graph.FoldingManager#masterGraph} to create views on top of it that support folding operations. - * @param {Object} options The parameters to pass. - * @param options.masterGraph The graph to use as the {@link #masterGraph}. - * @param {yfiles.graph.IFoldingEdgeConverter} options.foldingEdgeConverter The {@link yfiles.graph.IFoldingEdgeConverter} implementation that is used to create/convert and modify the {@link yfiles.graph.FoldingEdgeStateId folding edges} inside the view instances. - *

- * This option sets the {@link yfiles.graph.FoldingManager#foldingEdgeConverter} property on the created object. - *

- * @param {yfiles.graph.IFolderNodeConverter} options.folderNodeConverter The {@link yfiles.graph.IFolderNodeConverter} implementation that is used to create/convert and modify the folder nodes inside the view instances. - *

- * This option sets the {@link yfiles.graph.FoldingManager#folderNodeConverter} property on the created object. - *

- * @throws {Stubs.Exceptions.ArgumentError} masterGraph is null. - */ - constructor(options:{masterGraph:yfiles.graph.IGraph,foldingEdgeConverter?:yfiles.graph.IFoldingEdgeConverter,folderNodeConverter?:yfiles.graph.IFolderNodeConverter}); - /** - * Creates a new manager with a default backing graph implementation. - *

- * Use {@link yfiles.graph.FoldingManager#createFoldingView} to create a view that supports the {@link yfiles.graph.IFoldingView} interface - * for displaying and working with a collapsible graph structure. - *

- * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.graph.IFoldingEdgeConverter} options.foldingEdgeConverter The {@link yfiles.graph.IFoldingEdgeConverter} implementation that is used to create/convert and modify the {@link yfiles.graph.FoldingEdgeStateId folding edges} inside the view instances. - *

- * This option sets the {@link yfiles.graph.FoldingManager#foldingEdgeConverter} property on the created object. - *

- * @param {yfiles.graph.IFolderNodeConverter} options.folderNodeConverter The {@link yfiles.graph.IFolderNodeConverter} implementation that is used to create/convert and modify the folder nodes inside the view instances. - *

- * This option sets the {@link yfiles.graph.FoldingManager#folderNodeConverter} property on the created object. - *

- * @see yfiles.graph.FoldingManager#createFoldingView - * @see yfiles.graph.FoldingManager#masterGraph - */ - constructor(options?:{foldingEdgeConverter?:yfiles.graph.IFoldingEdgeConverter,folderNodeConverter?:yfiles.graph.IFolderNodeConverter}); - /** - * Creates a separate view instance of the {@link yfiles.graph.FoldingManager#masterGraph} which is a synchronized copy of a subset of the items from the master graph. - *

- * This method will create a new instance of an {@link yfiles.graph.IGraph} that is constructed as a synchronized copy of the {@link yfiles.graph.FoldingManager#masterGraph}. - * That instance can be obtained from the {@link yfiles.graph.IFoldingView#graph} property of the returned {@link yfiles.graph.IFoldingView} implementation. The graph - * instance will provide an {@link yfiles.graph.IFoldingView} instance in its {@link yfiles.graph.ILookup#lookup} mechanism: - *

- *

- * This instance can be used to gain access to this manager instance and the folding operations. - *

- *

- * Note that the entities that are contained in the returned graph instance are not the same instances as the original - * "master" entities in the {@link yfiles.graph.FoldingManager#masterGraph}. However they share the same properties (style, {@link yfiles.graph.ITagOwner#tag tag}, {@link yfiles.graph.ILabelModelParameter parameters}, and {@link yfiles.graph.INode#layout geometry}). For collapsed - * group nodes and view edges, there is a separate set of properties available for each possible state combination. The {@link yfiles.graph.FoldingManager#getFoldingEdgeState} - * method for edges and the {@link yfiles.graph.FoldingManager#getFolderNodeState} method for nodes provide access to that state - * while it is not being displayed in a view. - *

- * @param [root=null] A group node or the root of the {@link #masterGraph} whose contents will be displayed in the view. - * @param [isExpanded=null] A predicate that can be provided to the view that will be used as a callback to determine the initial {@link #isExpanded expansion state} of - * group nodes in the view. - * @returns A new graph instance that represents a synchronized view on the {@link #masterGraph}. - * @see yfiles.graph.FoldingManager#prepareFoldingView - */ - createFoldingView(root?:yfiles.graph.INode,isExpanded?:(obj:yfiles.graph.INode)=>boolean):yfiles.graph.IFoldingView; - /** - * Creates a separate view instance of the {@link yfiles.graph.FoldingManager#masterGraph} which is a synchronized copy of a subset of the items from the master graph. - *

- * This method will create a new instance of an {@link yfiles.graph.IGraph} that is constructed as a synchronized copy of the {@link yfiles.graph.FoldingManager#masterGraph}. - * That instance can be obtained from the {@link yfiles.graph.IFoldingView#graph} property of the returned {@link yfiles.graph.IFoldingView} implementation. The graph - * instance will provide an {@link yfiles.graph.IFoldingView} instance in its {@link yfiles.graph.ILookup#lookup} mechanism: - *

- *

- * This instance can be used to gain access to this manager instance and the folding operations. - *

- *

- * Note that the entities that are contained in the returned graph instance are not the same instances as the original - * "master" entities in the {@link yfiles.graph.FoldingManager#masterGraph}. However they share the same properties (style, {@link yfiles.graph.ITagOwner#tag tag}, {@link yfiles.graph.ILabelModelParameter parameters}, and {@link yfiles.graph.INode#layout geometry}). For collapsed - * group nodes and view edges, there is a separate set of properties available for each possible state combination. The {@link yfiles.graph.FoldingManager#getFoldingEdgeState} - * method for edges and the {@link yfiles.graph.FoldingManager#getFolderNodeState} method for nodes provide access to that state - * while it is not being displayed in a view. - *

- * @param {Object} options The parameters to pass. - * @param [options.root=null] A group node or the root of the {@link #masterGraph} whose contents will be displayed in the view. - * @param [options.isExpanded=null] A predicate that can be provided to the view that will be used as a callback to determine the initial {@link #isExpanded expansion state} of - * group nodes in the view. - * @returns A new graph instance that represents a synchronized view on the {@link #masterGraph}. - * @see yfiles.graph.FoldingManager#prepareFoldingView - */ - createFoldingView(options:{root?:yfiles.graph.INode,isExpanded?:(obj:yfiles.graph.INode)=>boolean}):yfiles.graph.IFoldingView; - /** - * Disposes of this instance. - *

- * This will disconnect the {@link yfiles.graph.FoldingManager#masterGraph} from the previously created {@link yfiles.graph.FoldingManager#createFoldingView managed views}. Also each view will be {@link yfiles.graph.IFoldingView#dispose disposed}. - *

- */ - dispose():void; - /** - * Provides access to the folder node state of a node. - *

- * This method can be used to query the collapsed state of a node, even if the node is currently not present in any managed - * view or the node is in fact expanded in all views. - *

- * @param masterNode The node in the {@link #masterGraph} for which the state should be returned. - * @returns A state holder implementation of a node, which is not part of any graph. - * @throws {Stubs.Exceptions.ArgumentError} The master node does not belong to the managed graph. - */ - getFolderNodeState(masterNode:yfiles.graph.INode):yfiles.graph.FolderNodeState; - /** - * Return a data container implementation that is not part of any actual {@link yfiles.graph.IGraph} that describes the state of - * the edge for the given {@link yfiles.graph.FoldingEdgeStateId}. - *

- * This method can be used to query the state of an edge that is either not currently visible in any {@link yfiles.graph.FoldingManager#views view} or connects to - * different source and target nodes because of the {@link yfiles.graph.IFoldingView#collapse collapsed} states of the nodes and their parents in the view. - *

- * @param id The ID of the folding edge for which the folding state should be returned. - * @returns A {@link } that can be used to query and change the properties of the edge. - * @see yfiles.graph.FoldingManager#getFolderNodeState - * @see yfiles.graph.FoldingEdgeStateId - */ - getFoldingEdgeState(id:yfiles.graph.FoldingEdgeStateId):yfiles.graph.FoldingEdgeState; - /** - * Determines whether for the given masterNode this manager has stored associated folder node state. - *

- * The manager does not necessarily have folder node state for folder nodes if that specific state has never been requested - * by a {@link yfiles.graph.IFoldingView view} because it has never been visualized. This method indicates whether there is state information available for - * the given master node. - *

- * @param masterNode The master node for which the state is requested. - * @returns Whether {@link #getFolderNodeState} would return existing state information. - * @see yfiles.graph.FoldingManager#getFolderNodeState - */ - hasFolderNodeState(masterNode:yfiles.graph.INode):boolean; - /** - * Determines whether for the given {@link yfiles.graph.FoldingEdgeStateId} this manager has stored associated view local state. - *

- * The manager does not necessarily have a {@link yfiles.graph.FoldingEdgeState} for folding elements if that specific state has - * never been requested by a {@link yfiles.graph.IFoldingView} because it has never been visualized. This method indicates whether - * there is state information available for the given id. - *

- * @param id The id for which state is requested. - * @returns Whether {@link #getFoldingEdgeState} would return existing state information. - * @see yfiles.graph.FoldingManager#getFoldingEdgeState - */ - hasFoldingEdgeState(id:yfiles.graph.FoldingEdgeStateId):boolean; - /** - * Callback that can be overridden by subclasses to prepare the {@link yfiles.graph.IFoldingView} instance right before it will be - * initialized with a copy of the elements in the initial graph. - *

- * Subclasses could override this method to register additional {@link yfiles.collections.IMapper.} instances with the graph instance or add - * {@link yfiles.graph.IContextLookupChainLink}s via the {@link yfiles.graph.ILookupDecorator} of the {@link yfiles.graph.IFoldingView#graph} to the instance if they are - * essential for the initial creation of the elements in the view instance. Overriding methods should always consider to - * call the base class implementation, first. - *

- * @param foldingView The graph view that has just been created but is still empty. - * @protected - */ - prepareFoldingView(foldingView:yfiles.graph.IFoldingView):void; - /** - * Triggers a call to {@link yfiles.graph.IFolderNodeConverter#updateFolderNodeState} for all view nodes that {@link yfiles.graph.IFoldingView#getViewItem represent} the given masterNode - * in its collapsed state. - *

- * In all {@link yfiles.graph.FoldingManager#views} that are currrently showing the node in collapsed state, the {@link yfiles.graph.FoldingManager#getFolderNodeState view-local state} will be updated via a call to the - * {@link yfiles.graph.IFolderNodeConverter}'s {@link yfiles.graph.IFolderNodeConverter#updateFolderNodeState} method. - *

- *

- * Note that all {@link yfiles.graph.FoldingManager#views} share the same {@link yfiles.graph.FolderNodeState} for the masterNode. - *

- *

- * This method is useful in situations where a change in the data on the master graph did not automatically trigger a call - * to the converter. Using this method, the state of the collapsed nodes in the views can be synchronized according to the - * logic in the {@link yfiles.graph.IFolderNodeConverter} implementation. - *

- * @param masterNode The master node that belongs to the {@link #masterGraph}. - * @throws {Stubs.Exceptions.ArgumentError} If the provided master node does not belong to the master graph. - * @see yfiles.graph.FoldingManager#updateFoldingEdgeStates - */ - updateFolderNodeStates(masterNode:yfiles.graph.INode):void; - /** - * Triggers a call to {@link yfiles.graph.IFoldingEdgeConverter#updateFoldingEdgeState} for all folder edges that {@link yfiles.graph.IFoldingView#getViewItem represent} the - * given masterEdge. - *

- * In all {@link yfiles.graph.FoldingManager#views} that are currrently showing the view edge for the provided master edge, the {@link yfiles.graph.FoldingManager#getFoldingEdgeState view-local state} will be updated via - * a call to the {@link yfiles.graph.IFoldingEdgeConverter}'s {@link yfiles.graph.IFoldingEdgeConverter#updateFoldingEdgeState} method. - *

- *

- * This method is useful in situations where a change in the data on the master graph did not automatically trigger a call - * to the converter. Using this method, the state of the representing edges in the views can be synchronized according to - * the logic in the {@link yfiles.graph.IFoldingEdgeConverter} implementation. - *

- * @param masterEdge The master edge that belongs to the {@link #masterGraph}. - * @throws {Stubs.Exceptions.ArgumentError} If the provided master edge does not belong to the master graph. - * @see yfiles.graph.FoldingManager#updateFolderNodeStates - */ - updateFoldingEdgeStates(masterEdge:yfiles.graph.IEdge):void; - /** - * Gets or sets the {@link yfiles.graph.IFoldingEdgeConverter} implementation that is used to create/convert and modify the {@link yfiles.graph.FoldingEdgeStateId folding edges} - * inside the view instances. - *

- * The converter instance will be used to {@link yfiles.graph.IFoldingEdgeConverter#initializeFoldingEdgeState create the initial} and {@link yfiles.graph.IFoldingEdgeConverter#updateFoldingEdgeState change} the appearance of the folding edges as soon as they - * appear in a view. - *

- * @throws {Stubs.Exceptions.ArgumentError} value is null. - * @see yfiles.graph.DefaultFoldingEdgeConverter - * @type {yfiles.graph.IFoldingEdgeConverter} - */ - foldingEdgeConverter:yfiles.graph.IFoldingEdgeConverter; - /** - * Gets or sets the {@link yfiles.graph.IFolderNodeConverter} implementation that is used to create/convert and modify the folder - * nodes inside the view instances. - *

- * The converter instance will be used to {@link yfiles.graph.IFolderNodeConverter#initializeFolderNodeState create the initial} and {@link yfiles.graph.IFolderNodeConverter#updateFolderNodeState change} the appearance of the folder nodes as soon as they - * appear in a view. - *

- * @see yfiles.graph.DefaultFolderNodeConverter - * @type {yfiles.graph.IFolderNodeConverter} - */ - folderNodeConverter:yfiles.graph.IFolderNodeConverter; - /** - * Gets the master {@link yfiles.graph.IGraph} instance that holds the complete model in expanded group node state. - *

- * This graph contains all non-folding edges and expanded group nodes, no folding edges and no collapsed group nodes. - *

- * @type {yfiles.graph.IGraph} - */ - masterGraph:yfiles.graph.IGraph; - /** - * Gets all currently known {@link yfiles.graph.FoldingManager#createFoldingView view instances} that are managed by this instance. - * @see yfiles.graph.IFoldingView#graph - * @type {yfiles.collections.IEnumerable.} - */ - views:yfiles.collections.IEnumerable; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.FoldingManager; - } - /** - * A data container representing the state of a bend of a {@link yfiles.graph.FoldingEdgeState}. - *

- * When the properties of the state are changed, these changes are reflected immediately in the {@link yfiles.graph.FoldingManager#views}. - *

- * @class - * @final - */ - export interface FoldingBendState extends yfiles.lang.Object{} - export class FoldingBendState { - /** - * Returns an {@link yfiles.graph.IBend} instance which represents this bend state. - *

- * The returned bend is not present in any graph but may be passed to {@link yfiles.graph.IFoldingView#getViewItem} to get the bend - * state's view bend in the {@link yfiles.graph.IFoldingView#graph folding view graph}. - *

- * @returns An {@link } instance which represents this bend state. - */ - asBend():yfiles.graph.IBend; - /** - * Gets or sets the location of the bend. - * @type {yfiles.geometry.Point} - */ - location:yfiles.geometry.Point; - /** - * Gets or sets the tag of the bend. - * @type {any} - */ - tag:any; - /** - * Gets the bend's index in the {@link yfiles.graph.FoldingEdgeState#bends} of its owner. - * @type {number} - */ - index:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.FoldingBendState; - } - /** - * A data container representing the state of an edge whose source and/or target node are collapsed. - *

- * When the properties of the state are changed, these changes are reflected immediately in the {@link yfiles.graph.FoldingManager#views}. - *

- * @see yfiles.graph.FoldingEdgeStateId - * @see yfiles.graph.FoldingManager#getFoldingEdgeState - * @class - * @extends {yfiles.graph.FoldingLabelOwnerState} - * @final - */ - export interface FoldingEdgeState extends yfiles.graph.FoldingLabelOwnerState{} - export class FoldingEdgeState { - /** - * Adds a new {@link yfiles.graph.FoldingBendState} to this edge state at the given index and location. - * @param location The location of the new bend state. - * @param [index=-1] The index the bend state shall be inserted in the - * {@link #bends}; a negative value (which is the default) indicates that the bend should be appended to the end of the list of bends. - * @returns The newly added bend state. - */ - addBend(location:yfiles.geometry.Point,index?:number):yfiles.graph.FoldingBendState; - /** - * Returns an {@link yfiles.graph.IEdge} instance which represents this edge state. - *

- * The returned edge is not present in any graph but may be passed to {@link yfiles.graph.IFoldingView#getViewItem} to get the edge - * state's view edge in the {@link yfiles.graph.IFoldingView#graph folding view graph}. - *

- * @returns An {@link } instance which represents this edge state. - */ - asEdge():yfiles.graph.IEdge; - /** - * Removes all {@link yfiles.graph.FoldingEdgeState#bends}. - */ - clearBends():void; - /** - * - * @param label - */ - remove(label:yfiles.graph.FoldingLabelState):void; - /** - * Removes the bend from this edge state. - * @param bend The bend to remove. - * @throws {Stubs.Exceptions.ArgumentError} Thrown if the bend doesn't belong to this edge state. - */ - remove(bend:yfiles.graph.FoldingBendState):void; - /** - * Gets or sets the tag of the edge. - * @type {any} - */ - tag:any; - /** - * Gets the {@link yfiles.graph.FoldingBendState}s of this state. - * @type {yfiles.collections.IListEnumerable.} - */ - bends:yfiles.collections.IListEnumerable; - /** - * Gets the {@link yfiles.graph.FoldingPortState} which represents the source port of this edge state. - * @type {yfiles.graph.FoldingPortState} - */ - sourcePort:yfiles.graph.FoldingPortState; - /** - * Gets the {@link yfiles.graph.FoldingPortState} which represents the target port of this edge state. - * @type {yfiles.graph.FoldingPortState} - */ - targetPort:yfiles.graph.FoldingPortState; - /** - * Gets or sets the style of this edge. - * @type {yfiles.styles.IEdgeStyle} - */ - style:yfiles.styles.IEdgeStyle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.FoldingEdgeState; - } - /** - * A data container representing the state of a label at a {@link yfiles.graph.FolderNodeState} or {@link yfiles.graph.FoldingEdgeState}. - *

- * When the properties of the state are changed, these changes are reflected immediately in the {@link yfiles.graph.FoldingManager#views}. - *

- * @see yfiles.graph.FoldingLabelOwnerState#labels - * @see yfiles.graph.FoldingLabelOwnerState#addLabel - * @class - * @final - */ - export interface FoldingLabelState extends yfiles.lang.Object{} - export class FoldingLabelState { - /** - * Returns an {@link yfiles.graph.ILabel} instance which represents this label state. - *

- * The returned label is not present in any graph but may be passed to {@link yfiles.graph.IFoldingView#getViewItem} to get the - * label state's view label in the {@link yfiles.graph.IFoldingView#graph folding view graph}. - *

- * @returns An {@link } instance which represents this label state. - */ - asLabel():yfiles.graph.ILabel; - /** - * Gets or sets the style of this label. - * @type {yfiles.styles.ILabelStyle} - */ - style:yfiles.styles.ILabelStyle; - /** - * Gets or sets the preferred size of the label. - * @type {yfiles.geometry.Size} - */ - preferredSize:yfiles.geometry.Size; - /** - * Gets or sets the label's text. - * @type {string} - */ - text:string; - /** - * Gets or sets the {@link yfiles.graph.ILabelModelParameter} used to describe the label's layout. - * @type {yfiles.graph.ILabelModelParameter} - */ - layoutParameter:yfiles.graph.ILabelModelParameter; - /** - * Gets or sets the tag of the label. - * @type {any} - */ - tag:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.FoldingLabelState; - } - /** - * An abstract base class for data containers representing the state of model items which can own labels. - *

- * Developers should not extend this class. Only instances of its subclasses {@link yfiles.graph.FolderNodeState} and {@link yfiles.graph.FoldingEdgeState} - * are supported. - *

- *

- * When the properties of the state are changed, these changes are reflected immediately in the {@link yfiles.graph.FoldingManager#views}. - *

- * @see yfiles.graph.FolderNodeState - * @see yfiles.graph.FoldingEdgeState - * @see yfiles.graph.FoldingLabelState - * @class - */ - export interface FoldingLabelOwnerState extends yfiles.lang.Object{} - export class FoldingLabelOwnerState { - constructor(); - /** - * Adds a {@link yfiles.graph.FoldingLabelState} to this state. - * @param text The text of the new label. - * @param layoutParameter The layout parameter of the new label. - * @param style The style of the new label. - * @param preferredSize The preferred size of the label. - * @param tag The tag of the label. - * @returns The newly added {@link }. - * @abstract - */ - addLabel(text:string,layoutParameter:yfiles.graph.ILabelModelParameter,style:yfiles.styles.ILabelStyle,preferredSize:yfiles.geometry.Size,tag:any):yfiles.graph.FoldingLabelState; - /** - * Removes all {@link yfiles.graph.FoldingLabelOwnerState#labels}. - */ - clearLabels():void; - /** - * Gets the {@link yfiles.graph.FoldingLabelState}s owned by this state. - * @type {yfiles.collections.IListEnumerable.} - */ - labels:yfiles.collections.IListEnumerable; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.FoldingLabelOwnerState; - } - /** - * A data container representing the state of a port at a {@link yfiles.graph.FolderNodeState} or {@link yfiles.graph.FoldingEdgeState}. - *

- * When the properties of the state are changed, these changes are reflected immediately in the {@link yfiles.graph.FoldingManager#views}. - *

- * @see yfiles.graph.FoldingEdgeState#sourcePort - * @see yfiles.graph.FoldingEdgeState#targetPort - * @see yfiles.graph.FolderNodeState#ports - * @see yfiles.graph.FolderNodeState#getFoldingPortState - * @class - */ - export interface FoldingPortState extends yfiles.lang.Object{} - export class FoldingPortState { - /** - * Returns an {@link yfiles.graph.IPort} instance which represents this port state. - *

- * The returned port is not present in any graph but may be passed to {@link yfiles.graph.IFoldingView#getViewItem} to get the port - * state's view port in the {@link yfiles.graph.IFoldingView#graph folding view graph}. - *

- * @returns An {@link } instance which represents this port state. - * @abstract - */ - asPort():yfiles.graph.IPort; - /** - * Gets or sets the style of this port. - * @type {yfiles.styles.IPortStyle} - */ - style:yfiles.styles.IPortStyle; - /** - * Gets or sets the {@link yfiles.graph.IPortLocationModelParameter} describing the position of this port. - * @type {yfiles.graph.IPortLocationModelParameter} - */ - locationParameter:yfiles.graph.IPortLocationModelParameter; - /** - * Gets or sets the tag of the port. - * @abstract - * @type {any} - */ - tag:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.FoldingPortState; - } - /** - * A data container representing the collapsed state of a node. - *

- * When the properties of the state are changed, these changes are reflected immediately in the {@link yfiles.graph.FoldingManager#views}. - *

- * @see yfiles.graph.FoldingManager#getFolderNodeState - * @class - * @extends {yfiles.graph.FoldingLabelOwnerState} - * @final - */ - export interface FolderNodeState extends yfiles.graph.FoldingLabelOwnerState{} - export class FolderNodeState { - /** - * Returns an {@link yfiles.graph.INode} instance which represents this folder node state. - *

- * The returned node is not present in any graph but may be passed to {@link yfiles.graph.IFoldingView#getViewItem} to get the node - * state's folder node in the {@link yfiles.graph.IFoldingView#graph folding view graph}. - *

- * @returns An {@link } instance which represents this folder node state. - */ - asNode():yfiles.graph.INode; - /** - * Provides access to the folding state of a master port. - *

- * This method can be used to query the folding state of a port at the folder which is represented by this state. - *

- * @param masterPort The master port for which the state should be returned. - * @returns A state holder implementation of the masterPort, which reflects the port in the node's collapsed state. - * @see yfiles.graph.FoldingPortState#style - * @see yfiles.graph.FoldingPortState#locationParameter - */ - getFoldingPortState(masterPort:yfiles.graph.IPort):yfiles.graph.FoldingPortState; - /** - * - * @param label - */ - remove(label:yfiles.graph.FoldingLabelState):void; - /** - * Gets or sets the layout of the node. - * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - /** - * Gets or sets the style of this node. - * @type {yfiles.styles.INodeStyle} - */ - style:yfiles.styles.INodeStyle; - /** - * Gets or sets the tag of the node. - * @type {any} - */ - tag:any; - /** - * Gets the {@link yfiles.graph.FoldingPortState}s owned by this state. - * @type {yfiles.collections.IListEnumerable.} - */ - ports:yfiles.collections.IListEnumerable; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.FolderNodeState; - } - /** - * Interface used by {@link yfiles.graph.FoldingManager} and {@link yfiles.graph.IFoldingView} which is responsible for managing edges - * between folder nodes. - *

- * Since {@link yfiles.graph.FoldingManager#createFoldingView} creates views that can potentially contain edges that connect to - * nodes which have a different set of attributes, these edges might need to have a separate set of attributes, too. - * Implementations of this interface are being called by the - * {@link yfiles.graph.IFoldingView}s to configure these kind of folding edges. - *

- * @see yfiles.graph.DefaultFoldingEdgeConverter - * @see yfiles.graph.FoldingManager#foldingEdgeConverter - * @see yfiles.graph.FoldingEdgeStateId - * @interface - */ - export interface IFoldingEdgeConverter extends yfiles.lang.Object{ - /** - * This method gets called by the {@link yfiles.graph.IFoldingView} implementation to determine whether a given edge in the {@link yfiles.graph.FoldingManager#masterGraph} should - * be represented by a folding edge in the given view. - *

- * The implementation will be passed in a factory object that implements the {@link yfiles.graph.IFoldingEdgeFactory} interface, - * which needs to be used by the implementation to communicate the result of the query. The implementation needs to either - * call {@link yfiles.graph.IFoldingEdgeFactory#addAsSeparateEdge}, {@link yfiles.graph.IFoldingEdgeFactory#addToExistingFoldingEdge}, or {@link yfiles.graph.IFoldingEdgeFactory#excludeFoldingEdge} - * and return the values that these implementation yields to the caller. The implementation can optionally query the {@link yfiles.graph.IFoldingEdgeFactory#getExistingFoldingEdges existing folding edges} - * between the source and target node and decide whether to add the edge {@link yfiles.graph.IFoldingEdgeFactory#addToExistingFoldingEdge to the existing folding edge}. - *

- * @param factory The {@link } implementation that needs to be called in order to communicate the results of this - * query. - * @param foldingView The instance into which the folding edge is going to be inserted. - * @param masterEdge The edge from the {@link #masterGraph} that needs to be represented by a folding edge. Note that you may not return this instance. - * @param source The source node that belongs to the {@link } graph that will act as the local view node of the actual - * source node. - * @param sourceIsCollapsed Determines whether the source is currently a folder node. - * @param target The target node that belongs to the {@link } graph that will act as the local view node of the actual - * target node. - * @param targetIsCollapsed Determines whether the target is currently a folder node. - * @returns The edge as returned by {@link #addAsSeparateEdge}, or - * {@link #addToExistingFoldingEdge}, or null if the edge will be {@link #excludeFoldingEdge excluded} from the view. - * @abstract - */ - addFoldingEdge(factory:yfiles.graph.IFoldingEdgeFactory,foldingView:yfiles.graph.IFoldingView,masterEdge:yfiles.graph.IEdge,source:yfiles.graph.INode,sourceIsCollapsed:boolean,target:yfiles.graph.INode,targetIsCollapsed:boolean):yfiles.graph.IEdge; - /** - * Callback that is triggered by the {@link yfiles.graph.IFoldingView view} to initially create the appearance of a folding edge. - *

- * Implementations may not use the {@link yfiles.graph.IFoldingView}'s {@link yfiles.graph.IFoldingView#graph} instance to modify the foldingEdge, because this would - * create and enqueue undo events. Rather the properties provided by the state implementation must be set. - *

- * @param state The {@link } of the edge to change. - * @param foldingView The graph to which the folding edge belongs. - * @param foldingEdge The folding edge for which the appearance shall be determined. - * @param masterEdges The list of {@link #getMasterEdges master edges}, that the folding edge initially represents. - * @see yfiles.graph.IFoldingEdgeConverter#updateFoldingEdgeState - * @abstract - */ - initializeFoldingEdgeState(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; - /** - * Callback that is triggered by the {@link yfiles.graph.IFoldingView view} to adjust the appearance of a folding edge - *

- * For instance, it can be used to reflect a state change in the {@link yfiles.graph.IFoldingView#getMasterEdges master edges} that make up that folding edge. - *

- *

- * Implementations may not use the {@link yfiles.graph.IFoldingView}'s {@link yfiles.graph.IFoldingView#graph} instance to modify the foldingEdge, because this would - * create and enqueue undo events. Rather the properties provided by the state implementation must be set. - *

- * @param state The {@link } of the edge to change. - * @param foldingView The graph to which the folding edge belongs. - * @param foldingEdge The folding edge for which the appearance might need an update. - * @param masterEdges The list of {@link #getMasterEdges master edges}, that the folding edge currently represents. - * @see yfiles.graph.IFoldingEdgeConverter#initializeFoldingEdgeState - * @abstract - */ - updateFoldingEdgeState(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; - } - var IFoldingEdgeConverter:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IFoldingEdgeConverter; - }; - /** - * Interface used by {@link yfiles.graph.FoldingManager} and {@link yfiles.graph.IFoldingView} which is responsible for managing the - * appearance of folder nodes. - *

- * Since {@link yfiles.graph.FoldingManager#createFoldingView} creates views that can potentially contain nodes which have a - * different set of attributes, these attributes need to be determined somehow. Implementations of this interface are being - * called by the {@link yfiles.graph.IFoldingView view}s to configure the appearance of these {@link yfiles.graph.IFoldingView#isInFoldingState folder nodes}. - *

- * @see yfiles.graph.DefaultFolderNodeConverter - * @see yfiles.graph.FoldingManager#folderNodeConverter - * @see yfiles.graph.IFoldingView#isInFoldingState - * @interface - */ - export interface IFolderNodeConverter extends yfiles.lang.Object{ - /** - * Callback that is used by {@link yfiles.graph.IFoldingView view} implementations to initially create the appearance of a {@link yfiles.graph.IFoldingView#isInFoldingState folder} node. - *

- * This method is called by the view to allow for initially creating the appearance of a local folder node in the view when - * it is included in the view for the first time. This can be used, e.g. to initialize the labels or style properties with - * the corresponding properties of the masterNode. - *

- *

- * By default the state is an exact copy of the masterNode, including layout, style, labels, and ports. - *

- *

- * Note that changing the appearance has to be done on state. - *

- * @param state The folder node state to initialize. - * @param foldingView The graph instance for which the folder node has been created. - * @param viewNode The folder node instance in the view - * @param masterNode The node that represents the {@link #getMasterItem} of the viewstate to change. - * @see yfiles.graph.IFolderNodeConverter#updateFolderNodeState - * @abstract - */ - initializeFolderNodeState(state:yfiles.graph.FolderNodeState,foldingView:yfiles.graph.IFoldingView,viewNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; - /** - * Callback that is used by {@link yfiles.graph.IFoldingView view} implementations to change the appearance of a {@link yfiles.graph.IFoldingView#isInFoldingState folder} node. - *

- * This method is called by the view to allow for adjusting the appearance of a local folder node in the view when the {@link yfiles.graph.IFoldingView#getMasterItem master} - * node for it has changed properties. This can be used, e.g. to synchronize the label or style properties with the - * corresponding properties of the masterNode. - *

- *

- * Note that changing the appearance has to be done on state. - *

- * @param state The folder node state to update. - * @param foldingView The graph instance for which the folder node can be changed. - * @param viewNode The folder node instance in the view - * @param masterNode The node that represents the {@link #getMasterItem} of the viewstate to change. - * @see yfiles.graph.IFolderNodeConverter#initializeFolderNodeState - * @abstract - */ - updateFolderNodeState(state:yfiles.graph.FolderNodeState,foldingView:yfiles.graph.IFoldingView,viewNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; - } - var IFolderNodeConverter:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IFolderNodeConverter; - }; - /** - * The interface of the factory that is passed to implementations of the {@link yfiles.graph.IFoldingEdgeConverter}'s {@link yfiles.graph.IFoldingEdgeConverter#addFoldingEdge} - * method. - *

- * Implementors of the {@link yfiles.graph.IFoldingEdgeConverter} need to use this interface to tell the calling {@link yfiles.graph.IFoldingView} - * implementation how to add the folding edge to the given view. They need to call exactly one of the following methods for - * each factory: - *

- *
    - *
  • - * {@link yfiles.graph.IFoldingEdgeFactory#addAsSeparateEdge} – Call this to add a separate folding edge for the given master edge to the view. Pass the return value of that method to - * the caller. - *
  • - *
  • - * {@link yfiles.graph.IFoldingEdgeFactory#addToExistingFoldingEdge} – Call this to reuse a folding edge that is already part of the view as a representative for the master edge. Pass the - * return value of that method to the caller. - *
  • - *
  • {@link yfiles.graph.IFoldingEdgeFactory#excludeFoldingEdge} – Call this in order not to add a folding edge for the master edge to the view at all. Pass null to the caller.
  • - *
- * @see yfiles.graph.IFoldingEdgeConverter#addFoldingEdge - * @see yfiles.graph.IFoldingEdgeConverter - * @see yfiles.graph.FoldingManager#foldingEdgeConverter - * @interface - */ - export interface IFoldingEdgeFactory extends yfiles.lang.Object{ - /** - * Tells the {@link yfiles.graph.IFoldingView} implementation to add the edge provided to the {@link yfiles.graph.IFoldingEdgeConverter#addFoldingEdge} - * method as a separate folding edge to the view at the given ports. - *

- * This tells the view that there is currently no {@link yfiles.graph.IFoldingEdgeFactory#getExistingFoldingEdges existing folding edge} in the view to which the master edge should be - * added to. Instead the view should add a separate folding edge that represents the master edge. Use the result of this - * method call as the return value for the {@link yfiles.graph.IFoldingEdgeConverter#addFoldingEdge} call. Note that the returned - * folding edge should not be modified by this code, instead the {@link yfiles.graph.IFoldingEdgeConverter#initializeFoldingEdgeState} - * and {@link yfiles.graph.IFoldingEdgeConverter#updateFoldingEdgeState} callbacks need to be used to change the appearance of the - * folding edge. Existing ports at the provided source and target nodes may be specified to further influence the folding - * edge creation. - *

- * @param sourcePort The source port at the source node in the view to use or null if an extra {@link #isInFoldingState folding state} port should be added for the - * edge to connect to at the source. - * @param targetPort The target port at the target node in the view to use or null if an extra {@link #isInFoldingState folding state} port should be added for the - * edge to connect to at the target. - * @returns The folding edge that has been created in the view. Don't change the properties of the edge directly. - * @see yfiles.graph.IFoldingEdgeConverter - * @see yfiles.graph.IFoldingView#getViewItem - * @abstract - */ - addAsSeparateEdge(sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):yfiles.graph.IEdge; - /** - * Tells the {@link yfiles.graph.IFoldingView} implementation to logically add the edge provided to the {@link yfiles.graph.IFoldingEdgeConverter#addFoldingEdge} - * method to a folding edge that already exists in the view. - *

- * This tells the view that there is already an {@link yfiles.graph.IFoldingEdgeFactory#getExistingFoldingEdges existing folding edge} in the view to which the master edge should be added - * logically added to. The given foldingEdge will have the master edge added to its collection of {@link yfiles.graph.IFoldingView#getMasterEdges master edges}. Note that - * the returned folding edge should not be modified by this code, instead the {@link yfiles.graph.IFoldingEdgeConverter#updateFoldingEdgeState} - * callback needs to be used to change the appearance of the folding edge. Implementations can use the {@link yfiles.graph.IFoldingEdgeFactory#getExistingFoldingEdges} - * method to retrieve the current set of existing folding edges that interconnect the same source and target nodes. The - * range of valid parameters is constrained to this collection. - *

- * @param foldingEdge One of the {@link #getExistingFoldingEdges existing folding edges} from the view which has been chosen to represent the master edge in this view. - * @returns The folding edge that represents the edge in the view, which is the same as the foldingEdge parameter. Don't change the - * properties of the edge directly. - * @see yfiles.graph.IFoldingEdgeConverter - * @see yfiles.graph.IFoldingEdgeFactory#getExistingFoldingEdges - * @abstract - */ - addToExistingFoldingEdge(foldingEdge:yfiles.graph.IEdge):yfiles.graph.IEdge; - /** - * Tells the {@link yfiles.graph.IFoldingView} implementation not to add a folding edge for the edge provided to the {@link yfiles.graph.IFoldingEdgeConverter#addFoldingEdge} - * method in this view. - *

- * This tells the view that there should not be a representation of the master edge in this view. If this method is called, - * null should be returned as the result of a {@link yfiles.graph.IFoldingEdgeConverter#addFoldingEdge} call, which is the same as - * the return value of this method. So it is possible to just pass the return value on to the caller. - *

- * @returns This method will always return null. This is for symmetry reasons to be easily exchangeable with the other methods. - * @see yfiles.graph.IFoldingEdgeConverter - * @abstract - */ - excludeFoldingEdge():yfiles.graph.IEdge; - /** - * Helper methods that can be used by the implementation of the {@link yfiles.graph.IFoldingEdgeConverter#addFoldingEdge} method to - * determine the folding edges that are currently part of the view and interconnect the same nodes as the folding edge - * would, if it was included in the view. - *

- * This method will yield all {@link yfiles.graph.IFoldingView#isInFoldingState folding edges} that interconnect the same source and target node as that the folding edge - * would, if it was included in this view. One of the items in the returned collection can be passed to the {@link yfiles.graph.IFoldingEdgeFactory#addToExistingFoldingEdge} - * method. - *

- * @param ignoreDirection Whether the direction of the edges should be ignored so that reverse edges are included in the enumeration, too. - * @returns An collection of currently existing folding edges in the view that interconnects the same source and target node. - * @abstract - */ - getExistingFoldingEdges(ignoreDirection:boolean):yfiles.collections.IEnumerable; - } - var IFoldingEdgeFactory:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IFoldingEdgeFactory; - }; - /** - * This interface defines a child element of a table or a table element container - * @interface - * @implements {yfiles.graph.ILabelOwner} - */ - export interface IStripe extends yfiles.lang.Object,yfiles.graph.ILabelOwner{ - /** - * Returns the layout of stripe in absolute coordinates. - *

- * Since {@link yfiles.graph.IStripe#layout} is relative to the owning node's left corner, you need to provide an node node to calculate the absolute layout. - *

- * @param node The node relative to which the stripe layout is calculated. This should be the same node where {@link #table} for stripe is associated - * to. - * @returns - */ - getAbsoluteBounds?(node:yfiles.graph.INode):yfiles.geometry.Rect; - /** - * Gets the insets for this stripe. - *

- * These insets are applied in addition to any implicit insets provided by the child stripes. To find out the actual insets - * that are currently in effect, use {@link yfiles.graph.IStripe#actualInsets}. - *

- * @abstract - * @type {yfiles.geometry.Insets} - */ - insets:yfiles.geometry.Insets; - /** - * Gets a live view of the relative layout of the stripe. - *

- * The layout of a stripe is a rectangle in the coordinate system that is relative to the upper left corner of the parent. - * Since this method will yield a live view, it is up to the client to copy the values of the instance if a snapshot of the - * state is needed. - *

- * @abstract - * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - /** - * Gets the style for this stripe. - * @abstract - * @type {yfiles.styles.IStripeStyle} - */ - style:yfiles.styles.IStripeStyle; - /** - * Gets the current changeable dimension of the stripe. - *

- * This is always the stripe size which is not implicitly determined by other stripes, i.e. the height for {@link yfiles.graph.IRow} - * instances and the width for {@link yfiles.graph.IColumn} instances. - *

- * @abstract - * @type {number} - */ - size:number; - /** - * Gets the minimal permissible value for {@link yfiles.graph.IStripe#size}. - *

- * This value determines how much the stripe may be shrunk by interactive manipulation. - *

- * @abstract - * @type {number} - */ - minimumSize:number; - /** - * Gets the {@link yfiles.graph.ITable} instance where this stripe is installed. - * @abstract - * @type {yfiles.graph.ITable} - */ - table:yfiles.graph.ITable; - /** - * Checks whether stripe is the root item of a stripe hierarchy. - * @see yfiles.graph.IStripe#root - * @type {boolean} - */ - isRoot?:boolean; - /** - * Gets the index of stripe in its {@link yfiles.graph.IStripe#parentStripe} collection of {@link yfiles.graph.IStripe#childStripes}. - *

- * The stripe is the GetIndexth child of its parent. - *

- * @see yfiles.graph.IColumn#childColumns - * @see yfiles.graph.IRow#childRows - * @type {number} - */ - index?:number; - /** - * Returns the actual minimum size a stripe can acquire. - *

- * This is the maximum of {@link yfiles.graph.IStripe#minimumSize} and the horizontal or vertical {@link yfiles.graph.IStripe#insets}. - *

- * @type {number} - */ - actualMinSize?:number; - /** - * Gets the direct children of stripe in a table hierarchy. - *

- * For {@link yfiles.graph.IColumn} instances, this returns {@link yfiles.graph.IColumn#childColumns}, for {@link yfiles.graph.IRow} instances, this returns {@link yfiles.graph.IRow#childRows} - *

- * @see yfiles.graph.IColumn#childColumns - * @see yfiles.graph.IRow#childRows - * @type {yfiles.collections.IEnumerable.} - */ - childStripes?:yfiles.collections.IEnumerable; - /** - * Gets the parent of stripe in a table hierarchy. - *

- * For {@link yfiles.graph.IColumn} instances, this returns {@link yfiles.graph.IColumn#parentColumn}, for {@link yfiles.graph.IRow} instances, this returns {@link yfiles.graph.IRow#parentRow} - *

- * @see yfiles.graph.IColumn#parentColumn - * @see yfiles.graph.IRow#parentRow - * @type {yfiles.graph.IStripe} - */ - parentStripe?:yfiles.graph.IStripe; - /** - * Gets the root of the stripe hierarchy of stripe in a table hierarchy. - *

- * If the stripe is part of an {@link yfiles.graph.ITable} instance, this returns {@link yfiles.graph.ITable#rootColumn} for {@link yfiles.graph.IColumn} instances and {@link yfiles.graph.IRow#parentRow} for {@link yfiles.graph.ITable#rootRow} - * instances. Otherwise null is returned. - *

- * @see yfiles.graph.ITable#rootColumn - * @see yfiles.graph.ITable#rootRow - * @see yfiles.graph.IStripe#isRoot - * @type {yfiles.graph.IStripe} - */ - root?:yfiles.graph.IStripe; - /** - * Returns a collection of all descendants of stripe that are leaves and therefore don't have any child stripes. - * @type {yfiles.collections.IEnumerable.} - */ - leaves?:yfiles.collections.IEnumerable; - /** - * Returns a collection of all descendants of stripe. - *

- * The descendants are returned in top to bottom order. - *

- * @type {yfiles.collections.IEnumerable.} - */ - descendants?:yfiles.collections.IEnumerable; - /** - * Gets the insets that are currently in effect for this stripe. - *

- * This value is determined by the accumulated insets of all ancestor, sibling and descendant insets. These insets may be - * larger than {@link yfiles.graph.IStripe#insets}. - *

- * @type {yfiles.geometry.Insets} - */ - actualInsets?:yfiles.geometry.Insets; - /** - * The current actual dimension of the stripe. - *

- * This is always the stripe size which is actually used for the stripe. For leaf stripes, this is the same as - * {@link yfiles.graph.IStripe#size}, otherwise, it is the accumulated size of all descendants with taking nested insets into account. - *

- * @type {number} - */ - actualSize?:number; - } - var IStripe:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IStripe; - }; - /** - * Central interface which provides support for tabular data presentation. - *

- * This interface supports a presentation of data where the nodes of a diagram are organized in a tabular way, i.e., where - * each node is associated to a specific row and column in the grid-like structure of a table. The {@link yfiles.graph.ITable} - * together with its associated interfaces {@link yfiles.graph.IColumn} and {@link yfiles.graph.IRow} represents the model for the tabular - * presentation (or table, for short). It also provides means for altering the model, in particular creation ({@link yfiles.graph.ITable#createChildColumn} - * and {@link yfiles.graph.ITable#createChildRow}) and {@link yfiles.graph.ITable#remove removal} of columns and rows but also changing their size or appearance. - *

- *

- * The table structure is backed by a group node. As a consequence, the nodes which should be presented in a tabular - * fashion need to be set up as children of this group node. Using a group node to hold the content nodes has several - * advantages: For example, when the group node is moved, the child nodes move accordingly, thus maintaining the visual - * clue that they are contained in the table group node. - *

- *

- * Note that the table structure and its content nodes are only loosely coupled: the node's center coordinates determine - * the row and column that it belongs to. - *

- *

- * Associating an {@link yfiles.graph.ITable} instance with its backing group node can most conveniently be done by setting a {@link yfiles.styles.TableNodeStyle} - * instance as style of the associated group node. This style manages the visualization of the individual rows and columns. - * It also associates its {@link yfiles.styles.TableNodeStyle#table} with the group node by decorating its {@link yfiles.graph.ILookup#lookup} to return the table instance. - *

- *

- * User interaction is supported by the {@link yfiles.input.TableEditorInputMode} which provides support for intractively resizing - * rows and columns, re-parenting them, or editing their labels. - *

- *

- * The table model with all relevant types and their relationships is presented in detail in the section {@link @DGUIDE_PREFIX@/tables.html Tables}. - *

- * @see yfiles.graph.IStripe - * @see yfiles.graph.IColumn - * @see yfiles.graph.IRow - * @see yfiles.graph.Table - * @see yfiles.input.TableEditorInputMode - * @interface - * @implements {yfiles.graph.ILookup} - */ - export interface ITable extends yfiles.lang.Object,yfiles.graph.ILookup{ - /** - * Add a label to the given owner using the text as the initial label text and label model parameter and style. - * @param owner the owner to add the label to. - * @param text the initial text of the label - * @param [layoutParameter=null] The label model parameter instance to use. - * @param [style=null] The style to use for the label - * @param [preferredSize=null] The initial values to use for the {@link #preferredSize}. - * @param [tag=null] the initial {@link #tag} to assign. - * @returns the newly created label - * @see yfiles.graph.ITable#setLabelText - * @see yfiles.graph.ITable#setLabelLayoutParameter - * @see yfiles.graph.ITable#setStyle - * @abstract - */ - addLabel(owner:yfiles.graph.IStripe,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,preferredSize?:yfiles.geometry.Size,tag?:any):yfiles.graph.ILabel; - /** - * Add a label to the given owner using the text as the initial label text and label model parameter and style. - * @param {Object} options The parameters to pass. - * @param options.owner the owner to add the label to. - * @param options.text the initial text of the label - * @param [options.layoutParameter=null] The label model parameter instance to use. - * @param [options.style=null] The style to use for the label - * @param [options.preferredSize=null] The initial values to use for the {@link #preferredSize}. - * @param [options.tag=null] the initial {@link #tag} to assign. - * @returns the newly created label - * @see yfiles.graph.ITable#setLabelText - * @see yfiles.graph.ITable#setLabelLayoutParameter - * @see yfiles.graph.ITable#setStyle - * @abstract - */ - addLabel(options:{owner:yfiles.graph.IStripe,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,preferredSize?:yfiles.geometry.Size,tag?:Object}):yfiles.graph.ILabel; - /** - * Adjusts the {@link yfiles.graph.ILabel#preferredSize} property of a label to fit the suggested size of its {@link yfiles.styles.ILabelStyleRenderer}. - *

- * This implementation uses the {@link yfiles.graph.ILabel#style style's} renderer for the label to determine the preferred rendering size. This is useful - * after the label's content or style have been changed. - *

- * @param label The label to adjust the size for. - * @see yfiles.graph.ILabelDefaults#autoAdjustPreferredSize - */ - adjustLabelPreferredSize?(label:yfiles.graph.ILabel):void; - /** - * Calculates the preferred size of a label with the given properties. - * @param stripe The item that will own the label. - * @param style The label style. - * @param layoutParameter The label model parameter. - * @param text The text. - * @param tag The tag for the label. - * @returns The size as calculated by the {@link }. - */ - calculateLabelPreferredSize?(stripe:yfiles.graph.IStripe,style:yfiles.styles.ILabelStyle,layoutParameter:yfiles.graph.ILabelModelParameter,text:string,tag:any):yfiles.geometry.Size; - /** - * Convenience method that clears all stripes from a table. - *

- * All existing rows and columns are cleared from table - *

- */ - clear?():void; - /** - * Create a new column as the indexth child of owner with the given parameters. - * @param owner The owner of the new column. - * @param [index=null] The position in the child list. - * @param [width=null] The actual width of the column. - * @param [minWidth=null] The minimal width of the column. - * @param [insets=null] The insets of the column. - * @param [style=null] The style of the column. - * @param [tag=null] The tag of the column - * @returns A new column instance - * @abstract - */ - createChildColumn(owner:yfiles.graph.IColumn,width?:number,minWidth?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:any,index?:number):yfiles.graph.IColumn; - /** - * Create a new column as the indexth child of owner with the given parameters. - * @param {Object} options The parameters to pass. - * @param options.owner The owner of the new column. - * @param [options.index=null] The position in the child list. - * @param [options.width=null] The actual width of the column. - * @param [options.minWidth=null] The minimal width of the column. - * @param [options.insets=null] The insets of the column. - * @param [options.style=null] The style of the column. - * @param [options.tag=null] The tag of the column - * @param options.labels An array of labels to add to the newly created node. Each item will be passed to the {@link #addLabel} - * method. - * @param options.childColumns An array of rows to create as children of this row. Each item will be passed to the {@link #createChildColumn} - * method. - * @returns A new column instance - * @abstract - */ - createChildColumn(options:{owner:yfiles.graph.IColumn,width?:number,minWidth?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:Object,index?:number,labels?:Array,childColumns?:Array}):yfiles.graph.IColumn; - /** - * Create a new row as the indexth child of owner with the given parameters. - * @param owner The owner of the new row. - * @param [index=null] The position in the child list. - * @param [height=null] The actual height of the row. - * @param [minHeight=null] The minimal height of the row. - * @param [insets=null] The insets of the row. - * @param [style=null] The style of the row. - * @param [tag=null] The tag of the row - * @returns A new row instance - * @abstract - */ - createChildRow(owner:yfiles.graph.IRow,height?:number,minHeight?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:any,index?:number):yfiles.graph.IRow; - /** - * Create a new row as the indexth child of owner with the given parameters. - * @param {Object} options The parameters to pass. - * @param options.owner The owner of the new row. - * @param [options.index=null] The position in the child list. - * @param [options.height=null] The actual height of the row. - * @param [options.minHeight=null] The minimal height of the row. - * @param [options.insets=null] The insets of the row. - * @param [options.style=null] The style of the row. - * @param [options.tag=null] The tag of the row - * @param options.labels An array of labels to add to the newly created node. Each item will be passed to the {@link #addLabel} - * method. - * @param options.childRows An array of rows to create as children of this row. Each item will be passed to the {@link #createChildRow} - * method. - * @returns A new row instance - * @abstract - */ - createChildRow(options:{owner:yfiles.graph.IRow,height?:number,minHeight?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:Object,index?:number,labels?:Array,childRows?:Array}):yfiles.graph.IRow; - /** - * Creates and returns a column as last child of table. - *

- * The column will be a part of this table after the method returns. This will trigger the corresponding events. - *

- * @param [width=null] The actual width of the column. - * @param [minWidth=null] The minimal width of the column. - * @param [insets=null] The insets of the column. - * @param [style=null] The style of the column. - * @param [tag=null] The tag of the column - * @param [index=null] The position in the child list. - * @returns A newly created column instance - * @see yfiles.graph.ITable#addStripeCreatedListener - */ - createColumn?(width?:number,minWidth?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:any,index?:number):yfiles.graph.IColumn; - /** - * Creates and returns a column as last child of table. - *

- * The column will be a part of this table after the method returns. This will trigger the corresponding events. - *

- * @param {Object} options The parameters to pass. - * @param [options.width=null] The actual width of the column. - * @param [options.minWidth=null] The minimal width of the column. - * @param [options.insets=null] The insets of the column. - * @param [options.style=null] The style of the column. - * @param [options.tag=null] The tag of the column - * @param [options.index=null] The position in the child list. - * @returns A newly created column instance - * @see yfiles.graph.ITable#addStripeCreatedListener - */ - createColumn?(options:{width?:number,minWidth?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:Object,index?:number}):yfiles.graph.IColumn; - /** - * Convenience method that creates a columns x rows. - *

- * All existing rows and columns are cleared from table - *

- * @param columns The number of columns to test. - * @param rows The number of rows to test. - */ - createGrid?(columns:number,rows:number):void; - /** - * Creates the label model parameter for a given {@link yfiles.graph.ILabelOwner}. - *

- * This implementation uses the label defaults for the table to {@link yfiles.graph.ILabelDefaults#getLayoutParameterInstance obtain the parameter instance}. - *

- * @param stripe The item that is the {@link #owner} of the label in question. - * @returns The default label model parameter to use for newly created labels at the item. - * @see yfiles.graph.ILabelDefaults#getLayoutParameterInstance - */ - createLabelLayoutParameter?(stripe:yfiles.graph.IStripe):yfiles.graph.ILabelModelParameter; - /** - * Convenience method that delegates to the {@link yfiles.graph.ILabelDefaults#getStyleInstance} method for the given {@link yfiles.graph.IStripe stripe}. - * @param stripe The item the newly created label will belong to. - * @returns The style instance to use for newly created stripes. - */ - createLabelStyle?(stripe:yfiles.graph.IStripe):yfiles.styles.ILabelStyle; - /** - * Creates and returns a row as last child of table. - *

- * The row will be a part of this table after the method returns. This will trigger the corresponding events. - *

- * @param [height=null] The actual height of the row. - * @param [minHeight=null] The minimal height of the row. - * @param [insets=null] The insets of the row. - * @param [style=null] The style of the row. - * @param [tag=null] The tag of the row - * @param [index=null] The position in the child list. - * @returns A newly created row instance - * @see yfiles.graph.ITable#addStripeCreatedListener - */ - createRow?(height?:number,minHeight?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:any,index?:number):yfiles.graph.IRow; - /** - * Creates and returns a row as last child of table. - *

- * The row will be a part of this table after the method returns. This will trigger the corresponding events. - *

- * @param {Object} options The parameters to pass. - * @param [options.height=null] The actual height of the row. - * @param [options.minHeight=null] The minimal height of the row. - * @param [options.insets=null] The insets of the row. - * @param [options.style=null] The style of the row. - * @param [options.tag=null] The tag of the row - * @param [options.index=null] The position in the child list. - * @returns A newly created row instance - * @see yfiles.graph.ITable#addStripeCreatedListener - */ - createRow?(options:{height?:number,minHeight?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:Object,index?:number}):yfiles.graph.IRow; - /** - * Convenience method to find a column underneath a certain point. - *

- * The column are tested in bottom up order. - *

- * @param node The node this table is currently bound to - * @param location The location to test. - * @param filter Additional predicate to further restrict the results. - * @returns The topmost column that has been found for the location or null. - */ - findColumn?(node:yfiles.graph.INode,location:yfiles.geometry.Point,filter:(obj:yfiles.graph.IStripe)=>boolean):yfiles.graph.IColumn; - /** - * Convenience method to find a row underneath a certain point. - *

- * The rows are tested in bottom up order. - *

- * @param node The node this table is currently bound to - * @param location The location to test. - * @param filter Additional predicate to further restrict the results. - * @returns The topmost row that has been found for the location or null. - */ - findRow?(node:yfiles.graph.INode,location:yfiles.geometry.Point,filter:(obj:yfiles.graph.IStripe)=>boolean):yfiles.graph.IRow; - /** - * Convenience method to find all stripes underneath a certain point. - *

- * The stripes are always returned in bottom up, rows first order. Note that this method does not take any {@link yfiles.view.ICanvasContext#hitTestRadius} into account. - *

- * @param node The node this table is currently bound to - * @param location The location to test. - * @param stripeTypes An enumeration value of {@link } to specify the stripe type. - * @param filter Additional predicate to further restrict the hit test results. - * @returns The stripes that have been found for the location or null. - */ - findStripes?(node:yfiles.graph.INode,location:yfiles.geometry.Point,stripeTypes:yfiles.graph.StripeTypes,filter:(obj:yfiles.graph.IStripe)=>boolean):yfiles.collections.IEnumerable; - /** - * Return the accumulated insets for the table. - * @returns - */ - getAccumulatedInsets?():yfiles.geometry.Insets; - /** - * Calculates the relative bounds of a table cell that is determined by column and row - *

- * Both column and row must live in the provided table instance. Otherwise, an {@link yfiles.lang.Exception} is thrown. - *

- * @param column The column that determines the cell - * @param row The row that determines the cell - * @returns The relative bounds of a the cell determined by column and row - * @throws {Stubs.Exceptions.ArgumentError} If column and row are part of a different table instance. - */ - getCellBounds?(column:yfiles.graph.IColumn,row:yfiles.graph.IRow):yfiles.geometry.Rect; - /** - * Removes stripe from its parent container. - *

- * This method reparents all children of stripe to the parent of the stripe. - *

- * @param stripe The stripe to remove - * @abstract - */ - remove(stripe:yfiles.graph.IStripe):void; - /** - * Removes the given label from its owner. - *

- * This will trigger the corresponding event. - *

- * @param label the label to remove - * @abstract - */ - remove(label:yfiles.graph.ILabel):void; - /** - * {@link yfiles.graph.ITable#remove Removes} stripe and all of its descendants from table. - *

- * This method does not resize any stripes, use {@link yfiles.graph.ITable#removeRecursivelyWithResize} instead. - *

- * @param stripe The stripe to remove - */ - removeRecursively?(stripe:yfiles.graph.IStripe):void; - /** - * {@link yfiles.graph.ITable#removeWithResize Removes} the given stripe and all of its descendants from table and resizes all affected stripes so that the table size - * does not change if possible. - * @param stripe The stripe to remove - */ - removeRecursivelyWithResize?(stripe:yfiles.graph.IStripe):void; - /** - * {@link yfiles.graph.ITable#remove Removes} stripe from table and resizes all affected stripes so that the table size does not change if possible. - * @param stripe The stripe to remove - */ - removeWithResize?(stripe:yfiles.graph.IStripe):void; - /** - * Sets the label model parameter for the given label. - * @param label The label. - * @param layoutParameter The new parameter. - * @throws {Stubs.Exceptions.ArgumentError} If the parameter cannot be used for this label. - * @abstract - */ - setLabelLayoutParameter(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):void; - /** - * Sets the preferred size of the label. - * @param label The label. - * @param preferredSize The new preferred size. - * @see yfiles.graph.ILabel#preferredSize - * @abstract - */ - setLabelPreferredSize(label:yfiles.graph.ILabel,preferredSize:yfiles.geometry.Size):void; - /** - * Sets the label text of the given label. - * @param label the label to modify - * @param text the new text of the label - * @see yfiles.graph.ILabel#text - * @abstract - */ - setLabelText(label:yfiles.graph.ILabel,text:string):void; - /** - * Sets the minimum size of stripe. - *

- * This method sets the {@link yfiles.graph.IStripe#minimumSize} of stripe. - *

- * @param stripe The stripe to change - * @param minimumSize The new minimum size of the stripe - * @abstract - */ - setMinimumSize(stripe:yfiles.graph.IStripe,minimumSize:number):void; - /** - * Sets owner as new parent of column, inserting column at the given index. - *

- * The column will be inserted at position index in the child list of the new parent. - *

- * @param owner - * @param column - * @param [index=null] - * @abstract - */ - setParent(owner:yfiles.graph.IColumn,column:yfiles.graph.IColumn,index?:number):void; - /** - * Sets owner as new parent of row, inserting row at the given index. - *

- * The row will be inserted at position index in the child list of the new parent. - *

- * @param owner - * @param row - * @param [index=null] - * @abstract - */ - setParent(owner:yfiles.graph.IRow,row:yfiles.graph.IRow,index?:number):void; - /** - * Sets the actual size of stripe. - *

- * This method sets the {@link yfiles.graph.IStripe#size} of stripe. - *

- * @param stripe The stripe to change - * @param size The new size of the stripe - * @abstract - */ - setSize(stripe:yfiles.graph.IStripe,size:number):void; - /** - * Sets the insets of stripe. - * @param stripe The stripe to change - * @param insets The new insets of the stripe - * @abstract - */ - setStripeInsets(stripe:yfiles.graph.IStripe,insets:yfiles.geometry.Insets):void; - /** - * Sets the style of stripe. - * @param stripe The stripe to change - * @param style The new style of the stripe - * @abstract - */ - setStyle(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):void; - /** - * Assigns the given style instance by reference to the label. - *

- * Style instances can be shared. - *

- * @param label The label that will be assigned the new style - * @param style The style instance that will be assigned to the label. - * @see yfiles.graph.ILabel#style - * @abstract - */ - setStyle(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):void; - /** - * Gets or sets the insets for this table. - *

- * These insets are applied in addition to any implicit insets provided by the child stripes. - *

- * @abstract - * @default '0' - * @type {yfiles.geometry.Insets} - */ - insets:yfiles.geometry.Insets; - /** - * Gets or sets the relative location of the upper left corner of the table. - *

- * The actual interpretation of this value depends on the context. If the table is bound to a node, this location is - * usually interpreted relative to the upper left corner of the node layout. - *

- * @see yfiles.graph.ITable#layout - * @abstract - * @default '0,0' - * @type {yfiles.geometry.Point} - */ - relativeLocation:yfiles.geometry.Point; - /** - * Gets the relative layout of the table. - *

- * The upper left corner of the layout always coincides with {@link yfiles.graph.ITable#relativeLocation}. - *

- * @see yfiles.graph.ITable#relativeLocation - * @abstract - * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - /** - * Gets or sets the defaults for rows. - *

- * The settings that are obtained from the instance influence newly created elements only. Setting different defaults later - * does not influence existing elements. - *

- * @abstract - * @type {yfiles.graph.IStripeDefaults} - */ - rowDefaults:yfiles.graph.IStripeDefaults; - /** - * Gets or sets the defaults for Columns. - *

- * The settings that are obtained from the instance influence newly created elements only. Setting different defaults later - * does not influence existing elements. - *

- * @abstract - * @type {yfiles.graph.IStripeDefaults} - */ - columnDefaults:yfiles.graph.IStripeDefaults; - /** - * Gets the virtual root of the row hierarchy - *

- * This row should not be queried except for the {@link yfiles.graph.IRow#parentRow} and the associated {@link yfiles.graph.IStripe#table} - *

- * @see yfiles.graph.ITable#setParent - * @see yfiles.graph.ITable#createChildRow - * @abstract - * @type {yfiles.graph.IRow} - */ - rootRow:yfiles.graph.IRow; - /** - * Gets the virtual root of the column hierarchy - *

- * This column should not be queried except for the {@link yfiles.graph.IColumn#parentColumn} and the associated {@link yfiles.graph.IStripe#table} - *

- * @see yfiles.graph.ITable#setParent - * @see yfiles.graph.ITable#createChildColumn - * @abstract - * @type {yfiles.graph.IColumn} - */ - rootColumn:yfiles.graph.IColumn; - /** - * Adds the given listener for the LabelAdded event that occurs when a label has been added to this graph instance. - * @param listener The listener to add. - * @see yfiles.graph.ITable#addLabel - * @see yfiles.graph.ITable#removeLabelAddedListener - * @abstract - */ - addLabelAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the LabelAdded event that occurs when a label has been added to this graph instance. - * @param listener The listener to remove. - * @see yfiles.graph.ITable#addLabel - * @see yfiles.graph.ITable#addLabelAddedListener - * @abstract - */ - removeLabelAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the LabelRemoved event that occurs when a label has been removed from this graph instance. - *

- * This event will also be triggered, prior to the removal of the {@link yfiles.graph.ILabel#owner owner} of the label. - *

- *

- * Implementations may choose to use the {@link yfiles.graph.LabelEventArgs} to carry additional label owner information. The {@link yfiles.graph.LabelEventArgs#owner} - * property will be set to the the owner of the label that owned it before the removal. - *

- * @param listener The listener to add. - * @see yfiles.graph.ITable#remove - * @see yfiles.graph.ITable#removeLabelRemovedListener - * @abstract - */ - addLabelRemovedListener(listener:(sender:any,evt:yfiles.graph.LabelEventArgs)=>void):void; - /** - * Removes the given listener for the LabelRemoved event that occurs when a label has been removed from this graph - * instance. - *

- * This event will also be triggered, prior to the removal of the {@link yfiles.graph.ILabel#owner owner} of the label. - *

- *

- * Implementations may choose to use the {@link yfiles.graph.LabelEventArgs} to carry additional label owner information. The {@link yfiles.graph.LabelEventArgs#owner} - * property will be set to the the owner of the label that owned it before the removal. - *

- * @param listener The listener to remove. - * @see yfiles.graph.ITable#remove - * @see yfiles.graph.ITable#addLabelRemovedListener - * @abstract - */ - removeLabelRemovedListener(listener:(sender:any,evt:yfiles.graph.LabelEventArgs)=>void):void; - /** - * Adds the given listener for the LabelChanged event that occurs when a label has been changed, for instance, if its style - * has been replaced. - * @param listener The listener to add. - * @see yfiles.graph.ITable#setStyle - * @see yfiles.graph.ITable#removeLabelChangedListener - * @abstract - */ - addLabelChangedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the LabelChanged event that occurs when a label has been changed, for instance, if its - * style has been replaced. - * @param listener The listener to remove. - * @see yfiles.graph.ITable#setStyle - * @see yfiles.graph.ITable#addLabelChangedListener - * @abstract - */ - removeLabelChangedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the StripeCreated event that occurs when a stripe has been added. - * @param listener The listener to add. - * @see yfiles.graph.ITable#createChildRow - * @see yfiles.graph.ITable#createChildColumn - * @see yfiles.graph.ITable#removeStripeCreatedListener - * @abstract - */ - addStripeCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Removes the given listener for the StripeCreated event that occurs when a stripe has been added. - * @param listener The listener to remove. - * @see yfiles.graph.ITable#createChildRow - * @see yfiles.graph.ITable#createChildColumn - * @see yfiles.graph.ITable#addStripeCreatedListener - * @abstract - */ - removeStripeCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Adds the given listener for the StripeRemoved event that occurs when a stripe has been removed from its parent. - * @param listener The listener to add. - * @see yfiles.graph.ITable#remove - * @see yfiles.graph.ITable#removeStripeRemovedListener - * @abstract - */ - addStripeRemovedListener(listener:(sender:any,evt:yfiles.graph.StripeEventArgs)=>void):void; - /** - * Removes the given listener for the StripeRemoved event that occurs when a stripe has been removed from its parent. - * @param listener The listener to remove. - * @see yfiles.graph.ITable#remove - * @see yfiles.graph.ITable#addStripeRemovedListener - * @abstract - */ - removeStripeRemovedListener(listener:(sender:any,evt:yfiles.graph.StripeEventArgs)=>void):void; - /** - * Adds the given listener for the StripeChanged event that occurs when a stripe has been changed, for instance, if its - * style has been replaced. - * @param listener The listener to add. - * @see yfiles.graph.ITable#setStyle - * @see yfiles.graph.ITable#setStripeInsets - * @see yfiles.graph.ITable#setSize - * @see yfiles.graph.ITable#setMinimumSize - * @see yfiles.graph.ITable#removeStripeChangedListener - * @abstract - */ - addStripeChangedListener(listener:(sender:any,evt:yfiles.graph.StripeEventArgs)=>void):void; - /** - * Removes the given listener for the StripeChanged event that occurs when a stripe has been changed, for instance, if its - * style has been replaced. - * @param listener The listener to remove. - * @see yfiles.graph.ITable#setStyle - * @see yfiles.graph.ITable#setStripeInsets - * @see yfiles.graph.ITable#setSize - * @see yfiles.graph.ITable#setMinimumSize - * @see yfiles.graph.ITable#addStripeChangedListener - * @abstract - */ - removeStripeChangedListener(listener:(sender:any,evt:yfiles.graph.StripeEventArgs)=>void):void; - } - var ITable:{ - /** - * Convenience method to find a stripe underneath a certain point. - * @param location The location to test. - * @param stripeTypes An enumeration value of {@link } to specify the stripe type. - * @param subregionTypes An enumeration value of {@link } to further restrict the stripe region. - * @param canvas The canvas that provides necessary context for hit determination, such as {@link #hitTestRadius}. - * @param filter Additional predicate to further restrict the hit test results. - * @returns The stripe subregions that have been found for the location or null. - * @static - */ - findStripe?(location:yfiles.geometry.Point,stripeTypes:yfiles.graph.StripeTypes,subregionTypes:yfiles.input.StripeSubregionTypes,canvas:yfiles.view.CanvasComponent,filter:(obj:yfiles.input.StripeSubregion)=>boolean):yfiles.input.StripeSubregion; - /** - * Used as a callback to find the items underneath a certain point. - * @param location The location to test. - * @param stripeTypes An enumeration value of {@link } to specify the stripe type. - * @param subregionTypes An enumeration value of {@link } to further restrict the stripe region. - * @param canvas The canvas that provides necessary context for hit determination, such as {@link #hitTestRadius}. - * @param filter Additional predicate to further restrict the hit test results. - * @returns The stripe subregions that have been found for the location. - * @static - */ - findStripes?(location:yfiles.geometry.Point,stripeTypes:yfiles.graph.StripeTypes,subregionTypes:yfiles.input.StripeSubregionTypes,canvas:yfiles.view.CanvasComponent,filter:(obj:yfiles.input.StripeSubregion)=>boolean):yfiles.collections.IEnumerable; - /** - * Calculates the absolute bounds of a table cell that is determined by column and row - *

- * Both column and row must live in the same {@link yfiles.graph.ITable} instance that is also present in the tableNodes - * {@link yfiles.graph.ILookup}. Otherwise, an {@link yfiles.lang.Exception} is thrown. - *

- * @param tableNode The node where a table is bound to via the node's lookup - * @param column The column that determines the cell - * @param row The row that determines the cell - * @returns The absolute bounds of a the cell determined by column and row - * @throws {Stubs.Exceptions.ArgumentError} If no table is present in the {@link yfiles.graph.ILookup} of tableNode, or if column and row are part of a different table - * instance. - * @static - */ - getCellBounds?(tableNode:yfiles.graph.INode,column:yfiles.graph.IColumn,row:yfiles.graph.IRow):yfiles.geometry.Rect; - /** - * Places node in the center of the table cell determined by column and row. - *

- * Both column and row must live in the same {@link yfiles.graph.ITable} instance that is also present in the tableNodes - * {@link yfiles.graph.ILookup}. Otherwise, an {@link yfiles.lang.Exception} is thrown. The cell bounds are determined by - * {@link yfiles.graph.ITable#getCellBounds}. - *

- *

- * If reparent is true, the node is made a child node of tableNode if it is no descendant of the table node hierarchy yet. - * Otherwise, the grouping hierarchy is not changed. - *

- *

- * If alwaysMove is - * true, the node is moved even if its center is already contained in the cell, otherwise only when the node layout center - * is currently outside of the cell bounds. - *

- *

- * This method does not change the size of the target stripes if they would be too small to contain the whole node layout. - * Callers must increase the stripe size before or after calling this method, if necessary. - *

- * @param graph The graph instance where the move should be performed - * @param node The node that should be moved into the given cell. - * @param tableNode The node where a table is bound to via the node's lookup - * @param column The column that determines the cell - * @param row The row that determines the cell - * @param [reparent=true] Whether node should also be made part of tableNode's grouping hierarchy if it is not yet contained in it. - * @param [alwaysMove=false] Whether node should be moved even if it is already placed in the cell. - * @throws {Stubs.Exceptions.ArgumentError} If no table is present in the {@link yfiles.graph.ILookup} of tableNode, or if column and row are part of a different table - * instance. - * @static - */ - placeNodeInCell?(graph:yfiles.graph.IGraph,node:yfiles.graph.INode,tableNode:yfiles.graph.INode,column:yfiles.graph.IColumn,row:yfiles.graph.IRow,reparent?:boolean,alwaysMove?:boolean):void; - /** - * Places node in the center of the table cell determined by column and row. - *

- * Both column and row must live in the same {@link yfiles.graph.ITable} instance that is also present in the tableNodes - * {@link yfiles.graph.ILookup}. Otherwise, an {@link yfiles.lang.Exception} is thrown. The cell bounds are determined by - * {@link yfiles.graph.ITable#getCellBounds}. - *

- *

- * If reparent is true, the node is made a child node of tableNode if it is no descendant of the table node hierarchy yet. - * Otherwise, the grouping hierarchy is not changed. - *

- *

- * If alwaysMove is - * true, the node is moved even if its center is already contained in the cell, otherwise only when the node layout center - * is currently outside of the cell bounds. - *

- *

- * This method does not change the size of the target stripes if they would be too small to contain the whole node layout. - * Callers must increase the stripe size before or after calling this method, if necessary. - *

- * @param {Object} options The parameters to pass. - * @param options.graph The graph instance where the move should be performed - * @param options.node The node that should be moved into the given cell. - * @param options.tableNode The node where a table is bound to via the node's lookup - * @param options.column The column that determines the cell - * @param options.row The row that determines the cell - * @param [options.reparent=true] Whether node should also be made part of tableNode's grouping hierarchy if it is not yet contained in it. - * @param [options.alwaysMove=false] Whether node should be moved even if it is already placed in the cell. - * @throws {Stubs.Exceptions.ArgumentError} If no table is present in the {@link yfiles.graph.ILookup} of tableNode, or if column and row are part of a different table - * instance. - * @static - */ - placeNodeInCell?(options:{graph:yfiles.graph.IGraph,node:yfiles.graph.INode,tableNode:yfiles.graph.INode,column:yfiles.graph.IColumn,row:yfiles.graph.IRow,reparent?:boolean,alwaysMove?:boolean}):void; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.ITable; - }; - /** - * Interface that describes a row in a {@link yfiles.graph.ITable} instance. - *

- * Default implementations of this interface are created by the factory methods in the {@link yfiles.graph.ITable} interface and - * its implementations, therefore, it usually shouldn't be necessary to implement this interface yourself. - *

- * @see yfiles.graph.ITable#createChildRow - * @interface - * @implements {yfiles.graph.IStripe} - */ - export interface IRow extends yfiles.lang.Object,yfiles.graph.IStripe{ - /** - * Gets the parent of this row. - *

- * In a table, each row has a parent, except for the {@link yfiles.graph.ITable#rootRow} hierarchy root. - *

- * @abstract - * @type {yfiles.graph.IRow} - */ - parentRow:yfiles.graph.IRow; - /** - * Gets the child rows. - *

- * This collection may be empty. Each entry in this collection has this instance as {@link yfiles.graph.IRow#parentRow}. - *

- * @abstract - * @type {yfiles.collections.IEnumerable.} - */ - childRows:yfiles.collections.IEnumerable; - } - var IRow:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IRow; - }; - /** - * Interface that describes a column in a {@link yfiles.graph.ITable} instance. - *

- * Default implementations of this interface are created by the factory methods in the {@link yfiles.graph.ITable} interface and - * its implementations, therefore, it usually shouldn't be necessary to implement this interface yourself. - *

- * @see yfiles.graph.ITable#createChildColumn - * @interface - * @implements {yfiles.graph.IStripe} - */ - export interface IColumn extends yfiles.lang.Object,yfiles.graph.IStripe{ - /** - * Gets the parent of this column. - *

- * In a table, each column has a parent, except for the {@link yfiles.graph.ITable#rootColumn} hierarchy root. - *

- * @abstract - * @type {yfiles.graph.IColumn} - */ - parentColumn:yfiles.graph.IColumn; - /** - * Gets the child columns. - *

- * This collection may be empty. Each entry in this collection has this instance as {@link yfiles.graph.IColumn#parentColumn}. - *

- * @abstract - * @type {yfiles.collections.IEnumerable.} - */ - childColumns:yfiles.collections.IEnumerable; - } - var IColumn:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IColumn; - }; - export enum StretchStripeLabelModelPosition{ - /** - * Encodes a position at the top side of the node interior - */ - NORTH, - /** - * Encodes a position at the right side of the node interior - */ - EAST, - /** - * Encodes a position at the bottom side of the node interior - */ - SOUTH, - /** - * Encodes a position at the left side of the node interior - */ - WEST - } - /** - * A label model for labels that is especially tailored to be used as a model for the four default positions where the - * label of a stripe may lie. - *

- * This label model supports four positions inside of the stripe bounds. The east and west positions are rotated - * automatically. The {@link yfiles.graph.ILabel#owner} is expected to be an {@link yfiles.graph.IStripe} instance, i.e. the parameter supports only {@link yfiles.graph.IStripe} - * instances. - *

- * @class - * @implements {yfiles.graph.ILabelModel} - * @implements {yfiles.graph.ILabelModelParameterProvider} - */ - export interface StretchStripeLabelModel extends yfiles.lang.Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{} - export class StretchStripeLabelModel { - /** - * Creates a new instance of this model with empty insets. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.geometry.Insets} options.insets The insets to use within the stripe's {@link yfiles.graph.IStripe#layout}. - *

- * This option sets the {@link yfiles.graph.StretchStripeLabelModel#insets} property on the created object. - *

- * @param {boolean} options.useActualInsets Whether or not to use the {@link yfiles.graph.IStripe#actualInsets actual insets} or the normal {@link yfiles.graph.IStripe#insets} of a stripe for centering the label inside the stripe header area. - *

- * This option sets the {@link yfiles.graph.StretchStripeLabelModel#useActualInsets} property on the created object. - *

- */ - constructor(options?:{insets?:yfiles.geometry.Insets,useActualInsets?:boolean}); - /** - * - * @returns - */ - createDefaultParameter():yfiles.graph.ILabelModelParameter; - /** - * Creates the parameter for the given position. - * @param position The position. - * @returns - */ - createParameter(position:yfiles.graph.StretchStripeLabelModelPosition):yfiles.graph.ILabelModelParameter; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; - /** - * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} for a given label using the given model - * parameter. - *

- * The geometry is calculated in table coordinates, i.e. relative to {@link yfiles.graph.ITable#relativeLocation}. - *

- * @param label the label to calculate the geometry for - * @param layoutParameter A parameter that has been created by this model. This is typically the parameter that yielded this instance through its - * {@link #model} property. - * @returns An instance that describes the geometry. This is typically an instance designed as a flyweight, so clients should not - * cache the instance but store the values if they need a snapshot for later use - */ - getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; - /** - * - * @param label - * @param model - * @returns - */ - getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.StretchStripeLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static NORTH:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.StretchStripeLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static SOUTH:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.StretchStripeLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static EAST:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.StretchStripeLabelModel#insets} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static WEST:yfiles.graph.ILabelModelParameter; - /** - * Gets or sets the insets to use within the stripe's {@link yfiles.graph.IStripe#layout}. - * @default '0' - * @type {yfiles.geometry.Insets} - */ - insets:yfiles.geometry.Insets; - /** - * Gets or sets whether or not to use the {@link yfiles.graph.IStripe#actualInsets actual insets} or the normal {@link yfiles.graph.IStripe#insets} of a stripe for centering the label inside the - * stripe header area. - *

- * If true the header insets are used. Default is false - *

- * @default false - * @type {boolean} - */ - useActualInsets:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.StretchStripeLabelModel; - } - /** - * A specialized subclass of the {@link yfiles.collections.ItemEventArgs.} class that is bound to the {@link yfiles.graph.IStripe} type and carries additional {@link yfiles.graph.IStripe owner} - * information. - *

- * Since for some events ({@link yfiles.graph.ITable#addStripeRemovedListener StripeRemoved}) it is unclear what {@link yfiles.graph.IStripe#parentStripe parent} the - * stripe was owned by before the event, this event can be used to carry exactly that information. - *

- * @class - * @extends {yfiles.collections.ItemEventArgs.} - * @final - */ - export interface StripeEventArgs extends yfiles.collections.ItemEventArgs{} - export class StripeEventArgs { - /** - * Initializes a new instance of the {@link yfiles.graph.StripeEventArgs} class. - * @param stripe The stripe to assign to the {@link #item} property. - * @param parentStripe The previous parent of the stripe. - * @param table The table the stripe belonged to previously. - */ - constructor(stripe:yfiles.graph.IStripe,parentStripe:yfiles.graph.IStripe,table:yfiles.graph.ITable); - /** - * Gets the parent of the stripe that owned the stripe before the event happened. - * @type {yfiles.graph.IStripe} - */ - parentStripe:yfiles.graph.IStripe; - /** - * Gets the table that owned the stripe before the event happened. - * @type {yfiles.graph.ITable} - */ - table:yfiles.graph.ITable; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.StripeEventArgs; - } - export enum StripeLabelModelPosition{ - /** - * Encodes a position at the top side of the node interior - */ - NORTH, - /** - * Encodes a position at the right side of the node interior - */ - EAST, - /** - * Encodes a position at the bottom side of the node interior - */ - SOUTH, - /** - * Encodes a position at the left side of the node interior - */ - WEST - } - /** - * A label model for labels that is especially tailored to be used as a model for the four default positions where the - * label of a stripe may lie. - *

- * This label model supports four positions inside of the stripe bounds. The east and west positions are rotated - * automatically. The {@link yfiles.graph.ILabel#owner} is expected to be an {@link yfiles.graph.IStripe} instance, i.e. the parameter supports only {@link yfiles.graph.IStripe} - * instances. - *

- * @class - * @implements {yfiles.graph.ILabelModel} - * @implements {yfiles.graph.ILabelModelParameterProvider} - */ - export interface StripeLabelModel extends yfiles.lang.Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{} - export class StripeLabelModel { - /** - * Creates a new instance of this model with empty insets. - * @param {Object} [options=null] The parameters to pass. - * @param {number} options.ratio The ratio how far the label should be positioned from the border in the header area. - *

- * This option sets the {@link yfiles.graph.StripeLabelModel#ratio} property on the created object. - *

- * @param {boolean} options.useActualInsets A value indicating whether to use the {@link yfiles.graph.IStripe#actualInsets actual insets} or the normal {@link yfiles.graph.IStripe#insets} of a stripe for centering the label inside the stripe header area. - *

- * This option sets the {@link yfiles.graph.StripeLabelModel#useActualInsets} property on the created object. - *

- */ - constructor(options?:{ratio?:number,useActualInsets?:boolean}); - /** - * - * @returns - */ - createDefaultParameter():yfiles.graph.ILabelModelParameter; - /** - * Creates the parameter for the given position. - * @param position The position. - * @returns - */ - createParameter(position:yfiles.graph.StripeLabelModelPosition):yfiles.graph.ILabelModelParameter; - /** - * - * @param label - * @param layoutParameter - * @returns - */ - getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; - /** - * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} for a given label using the given model - * parameter. - *

- * The geometry is calculated in table coordinates, i.e. relative to {@link yfiles.graph.ITable#relativeLocation}. - *

- * @param label the label to calculate the geometry for - * @param layoutParameter A parameter that has been created by this model. This is typically the parameter that yielded this instance through its - * {@link #model} property. - * @returns An instance that describes the geometry. This is typically an instance designed as a flyweight, so clients should not - * cache the instance but store the values if they need a snapshot for later use - */ - getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; - /** - * - * @param label - * @param model - * @returns - */ - getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.StripeLabelModel#ratio} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static NORTH:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.StripeLabelModel#ratio} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static SOUTH:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.StripeLabelModel#ratio} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static EAST:yfiles.graph.ILabelModelParameter; - /** - * A convenience parameter instance that can be shared between label instances. - *

- * Trying to change that instances' {@link yfiles.graph.StripeLabelModel#ratio} will raise an {@link yfiles.lang.Exception}. - *

- * @const - * @static - * @type {yfiles.graph.ILabelModelParameter} - */ - static WEST:yfiles.graph.ILabelModelParameter; - /** - * Gets or sets a value indicating whether to use the {@link yfiles.graph.IStripe#actualInsets actual insets} or the normal {@link yfiles.graph.IStripe#insets} of a stripe for centering the label - * inside the stripe header area. - *

- * If true the header insets are used. Default is false - *

- * @default false - * @type {boolean} - */ - useActualInsets:boolean; - /** - * Gets or sets the ratio how far the label should be positioned from the border in the header area. - *

- * 0 means the label is positioned on the outer border, 1 means it is positioned at the inner border of the header or inset - * area. Default value is 0.5 - *

- * @default 0.5 - * @type {number} - */ - ratio:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.StripeLabelModel; - } - /** - * Default implementation of the {@link yfiles.graph.ITable} interface. - * @class - * @implements {yfiles.graph.ITable} - * @implements {yfiles.lang.ICloneable} - */ - export interface Table extends yfiles.lang.Object,yfiles.graph.ITable,yfiles.lang.ICloneable{} - export class Table { - /** - * Default constructor that creates an empty table - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.geometry.Insets} [options.insets=null] Sets the insets property. - * @param {yfiles.geometry.Point} [options.relativeLocation=null] Sets the relativeLocation property. - * @param {yfiles.graph.IStripeDefaults} options.rowDefaults The defaults for rows. - *

- * This option sets the {@link yfiles.graph.Table#rowDefaults} property on the created object. - *

- * @param {yfiles.graph.IStripeDefaults} options.columnDefaults The defaults for Columns. - *

- * This option sets the {@link yfiles.graph.Table#columnDefaults} property on the created object. - *

- */ - constructor(options?:{insets?:yfiles.geometry.Insets,relativeLocation?:yfiles.geometry.Point,rowDefaults?:yfiles.graph.IStripeDefaults,columnDefaults?:yfiles.graph.IStripeDefaults}); - /** - * - * @param owner - * @param text - * @param [layoutParameter=null] - * @param [style=null] - * @param [preferredSize=null] - * @param [tag=null] - * @returns - */ - addLabel(owner:yfiles.graph.IStripe,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,preferredSize?:yfiles.geometry.Size,tag?:any):yfiles.graph.ILabel; - /** - * - * @param {Object} options The parameters to pass. - * @param options.owner - * @param options.text - * @param [options.layoutParameter=null] - * @param [options.style=null] - * @param [options.preferredSize=null] - * @param [options.tag=null] - * @returns - */ - addLabel(options:{owner:yfiles.graph.IStripe,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,preferredSize?:yfiles.geometry.Size,tag?:Object}):yfiles.graph.ILabel; - /** - * - * @returns - */ - clone():any; - /** - * Called during {@link yfiles.graph.Table#clone} to create a copy of column - *

- * If column implements the {@link yfiles.lang.ICloneable} interface, the column instance is - * {@link yfiles.lang.ICloneable#clone}d, otherwise, the original instance is returned unchanged. - *

- * @param column The column that should be copied during a clone operation. - * @returns A clone of column if possible, otherwise the original reference to column - * @protected - */ - copyColumn(column:yfiles.graph.IColumn):yfiles.graph.IColumn; - /** - * Called during {@link yfiles.graph.Table#clone} to create a copy of originalDefaults - *

- * This implementation returns an unchanged reference to originalDefaults. If you need to create a deep clone of - * originalDefaults, you'll have to perform the cloning yourself. - *

- * @param originalDefaults The default settings that should be copied during a clone operation. - * @returns The original reference to originalDefaults - * @protected - */ - copyDefaults(originalDefaults:yfiles.graph.IStripeDefaults):yfiles.graph.IStripeDefaults; - /** - * Called during {@link yfiles.graph.Table#clone} to create a copy of row - *

- * If row implements the {@link yfiles.lang.ICloneable} interface, the row instance is - * {@link yfiles.lang.ICloneable#clone}d, otherwise, the original instance is returned unchanged. - *

- * @param row The row that should be copied during a clone operation. - * @returns A clone of row if possible, otherwise the original reference to row - * @protected - */ - copyRow(row:yfiles.graph.IRow):yfiles.graph.IRow; - /** - * - * @param owner - * @param [width=null] - * @param [minWidth=null] - * @param [insets=null] - * @param [style=null] - * @param [tag=null] - * @param [index=null] - * @returns - */ - createChildColumn(owner:yfiles.graph.IColumn,width?:number,minWidth?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:any,index?:number):yfiles.graph.IColumn; - /** - * - * @param {Object} options The parameters to pass. - * @param options.owner - * @param [options.width=null] - * @param [options.minWidth=null] - * @param [options.insets=null] - * @param [options.style=null] - * @param [options.tag=null] - * @param [options.index=null] - * @returns - */ - createChildColumn(options:{owner:yfiles.graph.IColumn,width?:number,minWidth?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:Object,index?:number}):yfiles.graph.IColumn; - /** - * - * @param owner - * @param [height=null] - * @param [minHeight=null] - * @param [insets=null] - * @param [style=null] - * @param [tag=null] - * @param [index=null] - * @returns - */ - createChildRow(owner:yfiles.graph.IRow,height?:number,minHeight?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:any,index?:number):yfiles.graph.IRow; - /** - * - * @param {Object} options The parameters to pass. - * @param options.owner - * @param [options.height=null] - * @param [options.minHeight=null] - * @param [options.insets=null] - * @param [options.style=null] - * @param [options.tag=null] - * @param [options.index=null] - * @returns - */ - createChildRow(options:{owner:yfiles.graph.IRow,height?:number,minHeight?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:Object,index?:number}):yfiles.graph.IRow; - /** - * Callback method that creates the Column defaults. - * @returns A new instance of the {@link } class which is used for {@link #createChildColumn newly created columns}. - * @protected - */ - createColumnDefaults():yfiles.graph.IStripeDefaults; - /** - * Callback method that creates the row defaults. - * @returns A new instance of the {@link } class that is used for {@link #createChildRow newly created rows}. - * @protected - */ - createRowDefaults():yfiles.graph.IStripeDefaults; - /** - * Installs the undo support for use with all tables that are bound to nodes in graph. - *

- * This method queries the graph for its undo support dynamically whenever undo support is queried in the table. In - * contrast to {@link yfiles.graph.Table#installStaticUndoSupport} the undo support installed with this method will thus always be - * the one which is the currently available support for the graph. - *

- * @param graph The graph where the nodes exist or will be created/changed and where the undo support should come from. - * @see yfiles.graph.Table#uninstallDynamicUndoSupport - * @see yfiles.graph.Table#installStaticUndoSupport - * @static - */ - static installDynamicUndoSupport(graph:yfiles.graph.IGraph):void; - /** - * Installs the undo support for use with all tables that are bound to nodes in graph. - *

- * This methods installs the undo support which manages the graph at the time this method is called. In contrast to {@link yfiles.graph.Table#installDynamicUndoSupport} - * the installed undo support will not change when the graph's undo support changes. - *

- *

- * This method adds undo support both for existing nodes in graph as well as for newly created or changed nodes. - *

- * @param graph The graph where the nodes exist or will be created/changed. - * @see yfiles.graph.Table#uninstallStaticUndoSupport - * @see yfiles.graph.Table#installDynamicUndoSupport - * @static - */ - static installStaticUndoSupport(graph:yfiles.graph.IGraph):void; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * Called after a label has been added to a stripe. - *

- * This method raises the {@link yfiles.graph.Table#addLabelAddedListener LabelAdded} event. - *

- * @param label The label that has just been added. - * @protected - */ - onLabelAdded(label:yfiles.graph.ILabel):void; - /** - * Callback that is invoked after a label has changed. - *

- * This method raises the {@link yfiles.graph.Table#addLabelChangedListener LabelChanged} event. - *

- * @param label The label that has changed. - * @protected - */ - onLabelChanged(label:yfiles.graph.ILabel):void; - /** - * Called after a label has been removed from its stripe. - *

- * This method raises the {@link yfiles.graph.Table#addLabelRemovedListener LabelRemoved} event. - *

- * @param label The label that has just been removed. - * @param owner The old owner of the label. - * @protected - */ - onLabelRemoved(owner:yfiles.graph.ILabelOwner,label:yfiles.graph.ILabel):void; - /** - * Callback that is invoked after a stripe has changed. - *

- * This will trigger the {@link yfiles.graph.Table#addStripeChangedListener StripeChanged} event. - *

- * @param owner The original owner - * @param stripe The stripe that has changed. - * @param oldTable The original table owner, in case the stripe has been moved between different table instances - * @protected - */ - onStripeChanged(owner:yfiles.graph.IStripe,stripe:yfiles.graph.IStripe,oldTable:yfiles.graph.ITable):void; - /** - * Called after a stripe has been created and added to a table. - *

- * This method raises the {@link yfiles.graph.Table#addStripeCreatedListener StripeCreated} event. - *

- * @param stripe The stripe that has just been created. - * @protected - */ - onStripeCreated(stripe:yfiles.graph.IStripe):void; - /** - * Called after a stripe has been removed from its owner. - *

- * This method raises the {@link yfiles.graph.Table#addStripeRemovedListener StripeRemoved} event. - *

- * @param stripe The stripe that has just been removed. - * @param owner The old owner of the stripe. - * @protected - */ - onStripeRemoved(owner:yfiles.graph.IStripe,stripe:yfiles.graph.IStripe):void; - /** - * Removes the given label from its owner. - *

- * This will trigger the corresponding event. - *

- * @param label the label to remove - * @throws {Stubs.Exceptions.ArgumentError} If the label is not associated with this table instance. - */ - remove(label:yfiles.graph.ILabel):void; - /** - * - * @param stripe - */ - remove(stripe:yfiles.graph.IStripe):void; - /** - * Sets the label model parameter for the given label. - * @param label The label. - * @param layoutParameter The new parameter. - * @throws {Stubs.Exceptions.ArgumentError} If the parameter cannot be used for this label or if the label is not associated with this table instance. - */ - setLabelLayoutParameter(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):void; - /** - * Sets the preferred size of the label. - * @param label The label. - * @param preferredSize The new preferred size. - * @throws {Stubs.Exceptions.ArgumentError} If the label is not associated with this table instance. - * @see yfiles.graph.ILabel#preferredSize - */ - setLabelPreferredSize(label:yfiles.graph.ILabel,preferredSize:yfiles.geometry.Size):void; - /** - * Sets the label text of the given label. - * @param label the label to modify - * @param text the new text of the label - * @throws {Stubs.Exceptions.ArgumentError} If the label is not associated with this table instance. - * @see yfiles.graph.ILabel#text - */ - setLabelText(label:yfiles.graph.ILabel,text:string):void; - /** - * - * @param stripe - * @param minimumSize - */ - setMinimumSize(stripe:yfiles.graph.IStripe,minimumSize:number):void; - /** - * - * @param owner - * @param column - * @param [index=null] - */ - setParent(owner:yfiles.graph.IColumn,column:yfiles.graph.IColumn,index?:number):void; - /** - * - * @param owner - * @param row - * @param [index=null] - */ - setParent(owner:yfiles.graph.IRow,row:yfiles.graph.IRow,index?:number):void; - /** - * - * @param stripe - * @param size - */ - setSize(stripe:yfiles.graph.IStripe,size:number):void; - /** - * - * @param stripe - * @param insets - */ - setStripeInsets(stripe:yfiles.graph.IStripe,insets:yfiles.geometry.Insets):void; - /** - * Assigns the given style instance by reference to the label. - *

- * Style instances can be shared. - *

- * @param label The label that will be assigned the new style - * @param style The style instance that will be assigned to the label. - * @see yfiles.graph.ILabel#style - */ - setStyle(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):void; - /** - * - * @param stripe - * @param style - */ - setStyle(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):void; - /** - * Uninstalls the undo support that has previously been installed with {@link yfiles.graph.Table#installDynamicUndoSupport} - * @param graph The graph where the tables are installed for which the undo support should be cleared. - * @static - */ - static uninstallDynamicUndoSupport(graph:yfiles.graph.IGraph):void; - /** - * Uninstalls the undo support that has previously been installed with {@link yfiles.graph.Table#installStaticUndoSupport} - * @param graph The graph where the tables are installed for which the undo support should be cleared. - * @static - */ - static uninstallStaticUndoSupport(graph:yfiles.graph.IGraph):void; - /** - * Gets an {@link yfiles.graph.IContextLookup} that provides the default implementations returned by an - * {@link yfiles.graph.IStripe}'s lookup. - *

- * The provided default implementations can for example be used as fallback when the stripe lookup is wrapped. - *

- * @static - * @type {yfiles.graph.IContextLookup} - */ - static DEFAULT_STRIPE_LOOKUP:yfiles.graph.IContextLookup; - /** - * Gets an {@link yfiles.graph.IContextLookup} that provides the default implementations returned by an - * {@link yfiles.graph.IColumn}'s lookup. - *

- * The provided default implementations can for example be used as fallback when the column lookup is wrapped. - *

- * @static - * @type {yfiles.graph.IContextLookup} - */ - static DEFAULT_COLUMN_LOOKUP:yfiles.graph.IContextLookup; - /** - * Gets an {@link yfiles.graph.IContextLookup} that provides the default implementations returned by an - * {@link yfiles.graph.IRow}'s lookup. - *

- * The provided default implementations can for example be used as fallback when the row lookup is wrapped. - *

- * @static - * @type {yfiles.graph.IContextLookup} - */ - static DEFAULT_ROW_LOOKUP:yfiles.graph.IContextLookup; - /** - * Gets the toplevel {@link yfiles.graph.IRow}s in this table. - * @type {yfiles.collections.IEnumerable.} - */ - rows:yfiles.collections.IEnumerable; - /** - * Gets the toplevel {@link yfiles.graph.IColumn}s in this table. - * @type {yfiles.collections.IEnumerable.} - */ - columns:yfiles.collections.IEnumerable; - /** - * - * @default '0' - * @type {yfiles.geometry.Insets} - */ - insets:yfiles.geometry.Insets; - /** - * - * @default '0,0' - * @type {yfiles.geometry.Point} - */ - relativeLocation:yfiles.geometry.Point; - /** - * Gets the relative layout of the table. - *

- * The upper left corner of the layout always coincides with {@link yfiles.graph.Table#relativeLocation}. - *

- * @see yfiles.graph.Table#relativeLocation - * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - /** - * - * @param listener - */ - addStripeCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - removeStripeCreatedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - addStripeRemovedListener(listener:(sender:any,evt:yfiles.graph.StripeEventArgs)=>void):void; - /** - * - * @param listener - */ - removeStripeRemovedListener(listener:(sender:any,evt:yfiles.graph.StripeEventArgs)=>void):void; - /** - * - * @param listener - */ - addStripeChangedListener(listener:(sender:any,evt:yfiles.graph.StripeEventArgs)=>void):void; - /** - * - * @param listener - */ - removeStripeChangedListener(listener:(sender:any,evt:yfiles.graph.StripeEventArgs)=>void):void; - /** - * - * @param listener - */ - addLabelAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - removeLabelAddedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - addLabelRemovedListener(listener:(sender:any,evt:yfiles.graph.LabelEventArgs)=>void):void; - /** - * - * @param listener - */ - removeLabelRemovedListener(listener:(sender:any,evt:yfiles.graph.LabelEventArgs)=>void):void; - /** - * - * @param listener - */ - addLabelChangedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * - * @param listener - */ - removeLabelChangedListener(listener:(sender:any,evt:yfiles.collections.ItemEventArgs)=>void):void; - /** - * Gets or sets the defaults for rows. - *

- * The settings that are obtained from the instance influence newly created elements only. Setting different defaults later - * does not influence existing elements. - *

- *

- * If no value is set explicitly a default will be created using {@link yfiles.graph.Table#createRowDefaults} upon first read - * access. - *

- * @type {yfiles.graph.IStripeDefaults} - */ - rowDefaults:yfiles.graph.IStripeDefaults; - /** - * Gets or sets the defaults for Columns. - *

- * The settings that are obtained from the instance influence newly created elements only. Setting different defaults later - * does not influence existing elements. - *

- *

- * If no value is set explicitly a default will be created using {@link yfiles.graph.Table#createColumnDefaults} upon first read - * access. - *

- * @type {yfiles.graph.IStripeDefaults} - */ - columnDefaults:yfiles.graph.IStripeDefaults; - /** - * - * @type {yfiles.graph.IRow} - */ - rootRow:yfiles.graph.IRow; - /** - * - * @type {yfiles.graph.IColumn} - */ - rootColumn:yfiles.graph.IColumn; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.Table; - } - /** - * Interface used by {@link yfiles.graph.ITable} and the like to declare and obtain the defaults for stripes and their labels. - * @see yfiles.graph.ITable#rowDefaults - * @see yfiles.graph.ITable#columnDefaults - * @interface - */ - export interface IStripeDefaults extends yfiles.lang.Object{ - /** - * Factory method that returns a style instance for use with newly created stripes. - *

- * Most implementations will yield either, a {@link yfiles.lang.ICloneable#clone clone} of or the {@link yfiles.graph.IStripeDefaults#style} property, if {@link yfiles.graph.IStripeDefaults#shareStyleInstance} is enabled, but they might use more complicated - * logic, too. - *

- * @returns The style to use, which for most implementations is either a {@link #clone clone} of or the {@link #style} property, if {@link #shareStyleInstance} is enabled. - * @abstract - */ - getStyleInstance():yfiles.styles.IStripeStyle; - /** - * Gets or sets the default insets for a stripe. - * @abstract - * @type {yfiles.geometry.Insets} - */ - insets:yfiles.geometry.Insets; - /** - * Gets or sets the default stripe size. - * @see yfiles.graph.IStripe#size - * @abstract - * @type {number} - */ - size:number; - /** - * Gets or sets the default minimum stripe size. - * @see yfiles.graph.IStripe#minimumSize - * @abstract - * @type {number} - */ - minimumSize:number; - /** - * Gets or sets the defaults for labels at stripes. - * @abstract - * @type {yfiles.graph.ILabelDefaults} - */ - labels:yfiles.graph.ILabelDefaults; - /** - * Gets or sets the style to use for stripes. - *

- * Depending on the setting of {@link yfiles.graph.IStripeDefaults#shareStyleInstance}, the {@link yfiles.graph.IStripeDefaults#getStyleInstance} method should return a {@link yfiles.lang.ICloneable#clone clone} of this - * instance or the very same instance. - *

- * @see yfiles.graph.IStripeDefaults#shareStyleInstance - * @abstract - * @type {yfiles.styles.IStripeStyle} - */ - style:yfiles.styles.IStripeStyle; - /** - * Gets or sets a value indicating whether the {@link yfiles.graph.IStripeDefaults#style} instance should be shared referentially or {@link yfiles.lang.ICloneable#clone cloned} upon a call to - * {@link yfiles.graph.IStripeDefaults#getStyleInstance}. - * @see yfiles.graph.IStripeDefaults#getStyleInstance - * @see yfiles.graph.IStripeDefaults#style - * @abstract - * @type {boolean} - */ - shareStyleInstance:boolean; - } - var IStripeDefaults:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.graph.IStripeDefaults; - }; - /** - * A canonic implementation of the {@link yfiles.graph.IStripeDefaults} interface. - * @class - * @implements {yfiles.graph.IStripeDefaults} - */ - export interface StripeDefaults extends yfiles.lang.Object,yfiles.graph.IStripeDefaults{} - export class StripeDefaults { - /** - * Default constructor - *

- * This constructor sets the style to {@link yfiles.styles.VoidNodeStyle#INSTANCE} and the insets to {@link yfiles.geometry.Insets#EMPTY} - *

- * @param {Object} [options=null] The parameters to pass. - * @param {number} options.size The default stripe size. - *

- * This option sets the {@link yfiles.graph.StripeDefaults#size} property on the created object. - *

- * @param {number} options.minimumSize The default minimum stripe size. - *

- * This option sets the {@link yfiles.graph.StripeDefaults#minimumSize} property on the created object. - *

- * @param {yfiles.graph.ILabelDefaults} [options.labels=null] Sets the labels property. - * @param {yfiles.styles.IStripeStyle} [options.style=null] Sets the style property. - * @param {boolean} [options.shareStyleInstance=null] Sets the shareStyleInstance property. - */ - constructor(options?:{size?:number,minimumSize?:number,labels?:yfiles.graph.ILabelDefaults,style?:yfiles.styles.IStripeStyle,shareStyleInstance?:boolean}); - /** - * - * @returns - */ - getStyleInstance():yfiles.styles.IStripeStyle; - /** - * Gets or sets the default insets for a stripe. - * @default '0' - * @type {yfiles.geometry.Insets} - */ - insets:yfiles.geometry.Insets; - /** - * Gets or sets the default stripe size. - * @see yfiles.graph.IStripe#size - * @default 100 - * @type {number} - */ - size:number; - /** - * Gets or sets the default minimum stripe size. - * @see yfiles.graph.IStripe#minimumSize - * @default 10 - * @type {number} - */ - minimumSize:number; - /** - * - * @type {yfiles.graph.ILabelDefaults} - */ - labels:yfiles.graph.ILabelDefaults; - /** - * - * @type {yfiles.styles.IStripeStyle} - */ - style:yfiles.styles.IStripeStyle; - /** - * - * @default true - * @type {boolean} - */ - shareStyleInstance:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.graph.StripeDefaults; - } - }export namespace geometry{ - export enum PathType{ - /** - * The type that is used to move the {@link yfiles.view.Stroke} to the next position. - *

- * This type uses one coordinate pair. - *

- */ - MOVE_TO, - /** - * The type that is used to add a line from the current position to the next position. - *

- * This type uses one coordinate pair. - *

- */ - LINE_TO, - /** - * The type that is used to add a quadratic Bézier curve from the current position to the next position using one control - * point. - *

- * This type uses two coordinate pairs. - *

- */ - QUAD_TO, - /** - * The type that is used to add a cubic Bézier curve from the current position to the next position using two intermediate - * control points. - *

- * This type uses three coordinate pairs. - *

- */ - CUBIC_TO, - /** - * The type that is used to add a line from the current position to the last {@link yfiles.geometry.PathType#MOVE_TO} position. - *

- * This type uses no coordinate pair. - *

- */ - CLOSE - } - /** - * A class that is used by {@link yfiles.geometry.GeneralPath} to iterate over the elements the path is made up of. - * @see yfiles.geometry.GeneralPath#createCursor - * @class - */ - export interface GeneralPathCursor extends yfiles.lang.Object{} - export class GeneralPathCursor { - /** - * Places the coordinates for the current type into the given array. - *

- * The array needs to have a length of at least 6, since {@link yfiles.geometry.PathType#CUBIC_TO} needs six coordinates. If the - * path has been flattened a length of two suffices. - *

- * @param coordinates - * @returns The current type of the path element. - * @see yfiles.geometry.GeneralPathCursor#getCurrentEndPoint - */ - getCurrent(coordinates:number[]):yfiles.geometry.PathType; - /** - * Places the current end coordinates of the last path element into the array. - * @param coordinates An array with length at least 2. - * @returns The type of the current element. - */ - getCurrentEndPoint(coordinates:number[]):yfiles.geometry.PathType; - /** - * Advances the cursor to the next position if possible. - * @returns Whether the cursor has been moved successfully. false if the cursor has been moved beyond the end of the path. - */ - moveNext():boolean; - /** - * Moves the cursor to the previous position in the path. - * @returns Whether the move was successful. - */ - movePrevious():boolean; - /** - * Reset the cursor to point to the beginning of the path. - */ - reset():void; - /** - * Resets the cursor to point to the last element in the path. - * @returns Whether the cursor has been moved successfully. - */ - toLast():boolean; - /** - * Gets the current position of the cursor. - * @type {number} - */ - index:number; - /** - * Gets the type of the path at the position of the cursor. - * @type {yfiles.geometry.PathType} - */ - pathType:yfiles.geometry.PathType; - /** - * Gets the current x coordinate of the last path element. - * @type {number} - */ - currentEndPointX:number; - /** - * Gets the current end point of the last path element. - * @type {yfiles.geometry.Point} - */ - currentEndPoint:yfiles.geometry.Point; - /** - * Gets the current y coordinate of the last path element. - * @type {number} - */ - currentEndPointY:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.geometry.GeneralPathCursor; - } - /** - * Models a path that consists of lines and Bézier curves. - *

- * This class uses double precision coordinates to model a virtual pen that can be moved across the world coordinate system - * and which can be used to draw lines and Bézier curves. This class provides many geometric utility methods, such as - * calculating the bounds, hit tests, containment tests, curve flattening, path transformation, path modification, and path - * iteration. - *

- * @class - * @implements {yfiles.lang.ICloneable} - * @final - */ - export interface GeneralPath extends yfiles.lang.Object,yfiles.lang.ICloneable{} - export class GeneralPath { - /** - * Creates a new instance with given initial capacity. - * @param [capacity=16] The number of elements for which storage will be allocated initially. - */ - constructor(capacity?:number); - /** - * Appends parts of the contents of the given path to this path. - *

- * If connect is true, an initial {@link yfiles.geometry.PathType#MOVE_TO} in other will be transformed into a - * {@link yfiles.geometry.PathType#LINE_TO}. - *

- * @param other The path to append to this path. - * @param connect Whether to connect the path to the end of this path. - * @param beginIndex The first element to be copied from other, inclusively. - * @param endIndex The last element to be copied from other, exclusively. - */ - append(other:yfiles.geometry.GeneralPath,beginIndex:number,endIndex:number,connect:boolean):void; - /** - * Appends the contents of the given path to this path. - *

- * If connect is true, an initial {@link yfiles.geometry.PathType#MOVE_TO} in other will be transformed into a - * {@link yfiles.geometry.PathType#LINE_TO}. - *

- * @param other The path to append to this path. - * @param connect Whether to connect the path to the end of this path. - */ - append(other:yfiles.geometry.GeneralPath,connect:boolean):void; - /** - * Appends an ellipse using the given bounding box to this instance. - * @param bounds The bounds of the ellipse. - * @param connect Whether to initially {@link #lineTo} the ellipses lowest point. - */ - appendEllipse(bounds:yfiles.geometry.IRectangle,connect:boolean):void; - /** - * Appends an {@link yfiles.geometry.IOrientedRectangle} to this path instance. - * @param rectangle The {@link } to get the coordinates from. - * @param connect Whether to use a {@link #lineTo} to the anchor corner. - */ - appendOrientedRectangle(rectangle:yfiles.geometry.IOrientedRectangle,connect:boolean):void; - /** - * Appends a rectangle to this path instance. - * @param rectangle The rectangle to get the coordinates from. - * @param connect Whether to use a {@link #lineTo} to the upper left corner. - */ - appendRectangle(rectangle:yfiles.geometry.IRectangle,connect:boolean):void; - /** - * Checks whether the point lies inside the area that is described by this path instance. - *

- * Note that this will only work as expected for closed paths. The epsilon is used for internally flattening Bézier - * curves. - *

- * @param point The coordinates of the point to test. - * @param [eps=0.5] The value to use for flattening Bézier curves during the test. 0.5 is the default value. - * @returns Whether the point lies within the area described by this path. - */ - areaContains(point:yfiles.geometry.IPoint,eps?:number):boolean; - /** - * Resets this path to be an empty path. - */ - clear():void; - /** - * Creates a clone of this instance, copying the path information to the new instance. - * @returns An exact clone of this instance. - */ - clone():any; - /** - * Appends a {@link yfiles.geometry.PathType#CLOSE} operation to the path elements, creating a line to the last {@link yfiles.geometry.PathType#MOVE_TO} - * position. - *

- * This draws a line from the current end point to the last {@link yfiles.geometry.GeneralPath#moveTo} position, closing the - * current sub path. - *

- */ - close():void; - /** - * Compresses the internal data structures so that the amount of memory used by this instance is minimal with respect to - * the information stored in it. - */ - compress():void; - /** - * Creates a cursor for iterating over the elements of this path. - *

- * The cursor is fail-fast, i.e. if the path's structure is modified after the construction of the cursor any cursor - * operation will fail. - *

- * @returns A cursor to iterate over this path. - */ - createCursor():yfiles.geometry.GeneralPathCursor; - /** - * Creates a new path based on this one where corners are smoothed with a quadratic Bézier arc starting at smoothingLength - * away from the corner. - * @param smoothingLength Distance from the corner where the arc begins. - * @returns A new path, with its corners smoothed. - */ - createSmoothedPath(smoothingLength:number):yfiles.geometry.GeneralPath; - /** - * Creates an SVG path element using the provided parameters. - * @param [transform=null] The matrix to apply to the path data. - * @returns A {@link path} that displays this instance using the provided attributes. - */ - createSvgPath(transform?:yfiles.geometry.Matrix):SVGPathElement; - /** - * Creates the data for a SVG path element that corresponds to this instance with the provided transform. - * @param [transform=null] The transform to apply to the created data. - * @returns The path data for an SVG path element that corresponds to this instance with the provided transform. - */ - createSvgPathData(transform?:yfiles.geometry.Matrix):string; - /** - * Creates a new {@link yfiles.geometry.GeneralPath} that is a copy of this path with all geometry transformed using the supplied - * matrix. - * @param transform The matrix to multiply the geometry with. - * @returns A new path. - */ - createTransformedPath(transform:yfiles.geometry.Matrix):yfiles.geometry.GeneralPath; - /** - * Crops the path after the position indicated by the cursor. - *

- * This will remove all path operations that follow the position indicated by the cursor. - *

- * @param cursor The cursor that depicts a position in this path. - */ - cropAfter(cursor:yfiles.geometry.GeneralPathCursor):void; - /** - * Crops the path before the position indicated by the cursor. - *

- * This will remove all path operations that precede the position indicated by the cursor. - *

- * @param cursor The cursor that depicts a position in this path. - */ - cropBefore(cursor:yfiles.geometry.GeneralPathCursor):void; - /** - * Appends a {@link yfiles.geometry.PathType#CUBIC_TO cubic Bézier curve} to the path elements. - *

- * This draws a cubic Bézier curve from the current end point to the given position using the two given control points. - *

- * @param c1x The x coordinate of the first Bézier control point. - * @param c1y The y coordinate of the first Bézier control point. - * @param c2x The x coordinate of the second Bézier control point. - * @param c2y The y coordinate of the second Bézier control point. - * @param x The x coordinate of the curve's end point. - * @param y The y coordinate of the curve's end point. - */ - cubicTo(c1x:number,c1y:number,c2x:number,c2y:number,x:number,y:number):void; - /** - * Appends a {@link yfiles.geometry.PathType#CUBIC_TO cubic Bézier curve} to the path elements. - *

- * This draws a cubic Bézier curve from the current end point to the given position using the two given control points. - *

- * @param c1 The coordinates of the first Bézier control point. - * @param c2 The coordinates of the second Bézier control point. - * @param end The coordinates of the curve's end point. - */ - cubicTo(c1:yfiles.geometry.IPoint,c2:yfiles.geometry.IPoint,end:yfiles.geometry.IPoint):void; - /** - * Finds an intersection point between a line and this {@link yfiles.geometry.GeneralPath}. - *

- * The value returned will be the smallest positive value smaller than 1 such that the point depicted by start + result * (end - start) - * is an intersection point between the line and the path. - *

- * @param start The coordinates of the first point of the line. - * @param end The coordinates of the second point of the line. - * @param [eps=0.5] The value to use for interpolating Bézier curves. - * @returns The factor to calculate the intersection point or double.PositiveInfinity. - */ - findLineIntersection(start:yfiles.geometry.Point,end:yfiles.geometry.Point,eps?:number):number; - /** - * Finds the first intersection of a ray with this {@link yfiles.geometry.GeneralPath} using a given epsilon for flattening Bézier - * curves contained in the path. - *

- * The ray is treated like an infinite line starting at the given anchor point and continuing in the direction of rayX, - * rayY. The ray vector does not need to be normalized. The value returned will be the smallest positive value such that - * the point depicted by (anchorX + result * rayX, anchorY + result * rayY) is an intersection point between the ray and - * the path. - *

- * @param anchor The coordinates of the anchor point of the ray. - * @param direction The coordinates of the direction vector of the ray. - * @param [eps=0.5] The epsilon value that is used for the accuracy with which the implementation should test Bézier curves within the path - * for intersections. - * @returns The factor to calculate the intersection point or double.PositiveInfinity. - */ - findRayIntersection(anchor:yfiles.geometry.Point,direction:yfiles.geometry.Point,eps?:number):number; - /** - * Creates a new path from this instance flattening all Bézier curves using the given epsilon. - *

- * This will create a path that consists of {@link yfiles.geometry.PathType#MOVE_TO}, {@link yfiles.geometry.PathType#LINE_TO}, and {@link yfiles.geometry.PathType#CLOSE} - * operations only. - *

- * @param eps The maximum value the flattened path may diverge from the original path for the Bézier curve line interpolations. - * @returns A new path that does not contain Bézier curves. - */ - flatten(eps:number):yfiles.geometry.GeneralPath; - /** - * Gets the bounds of a flattened version the path. - * @param eps The epsilon to use for the flattening operation. - * @returns The bounds of the flattened path. - */ - getBounds(eps:number):yfiles.geometry.Rect; - /** - * Calculates the bounds of this path and returns it. - *

- * This will not yield tight bounds if the path contains Bézier curves. The bounds are calculated using the union of all - * points and control points contained in this path. - *

- * @returns A rectangle that describes the geometric bounds of this path. - * @see yfiles.geometry.GeneralPath#getBounds - */ - getBounds():yfiles.geometry.Rect; - /** - * Returns the geometric length of this path. - *

- * Note that Bézier curves are still treated as line segments. - *

- * @returns The length of this path. - */ - getLength():number; - /** - * Gets a point on this path instance at the given ratio. - *

- * Note that this implementation still treats Bézier curves as linear segments. - *

- * @param ratio A value between 0 and 1 inclusively that indicates a ratio from the beginning to the end of this path. - * @returns The coordinates of the point. - */ - getPoint(ratio:number):yfiles.geometry.Point; - /** - * Gets the number of segments in this path, that is the number of {@link yfiles.geometry.PathType#LINE_TO} and {@link yfiles.geometry.PathType#CLOSE} - * operations. - * @returns The number of segments. - */ - getSegmentCount():number; - /** - * Gets the tangent on this path instance at the segment and segment ratio. - *

- * Note that this implementation still treats Bézier curves as linear segments. - *

- * @param ratio A value between 0 and 1 inclusively that indicates a ratio from the beginning to the end of the segment at segmentIndex - * for this path. - * @param segmentIndex The segment index to determine a point at. - * @returns The tangent, if any exists; null otherwise. The tangent vector may not be normalized. - */ - getTangent(segmentIndex:number,ratio:number):yfiles.geometry.Tangent; - /** - * Gets the tangent on this path instance at the given ratio. - *

- * Note that this implementation still treats Bézier curves as linear segments. - *

- * @param ratio A value between 0 and 1 inclusively that indicates a ratio from the beginning to the end of this path. - * @returns The tangent, if any exists; null otherwise. The tangent vector may not be normalized. - */ - getTangent(ratio:number):yfiles.geometry.Tangent; - /** - * Determines whether a given {@link yfiles.geometry.GeneralPath} instance can be considered equivalent to this one, that is, both - * represent the same path with the same sub-path types and coordinates. - * @param path The other {@link } instance to compare. - * @returns true if path and this instance have the same sub-path types and coordinates, false if not. - */ - hasSameValue(path:yfiles.geometry.GeneralPath):boolean; - /** - * Checks whether this path intersects the given rectangle. - *

- * This will yield false if the rectangle is fully contained within the area of the path. - *

- * @param rectangle The rectangle to test. - * @param eps The epsilon to use for fuzzy testing. - * @returns Whether the path described by this instance intersects the rectangle. - */ - intersects(rectangle:yfiles.geometry.Rect,eps:number):boolean; - /** - * Appends a {@link yfiles.geometry.PathType#LINE_TO} operation to the path elements. - *

- * This draws a line from the current end point to the given position. - *

- * @param x The x coordinate of the line's end point. - * @param y The y coordinate of the line's end point. - */ - lineTo(x:number,y:number):void; - /** - * Appends a {@link yfiles.geometry.PathType#LINE_TO} operation to the path elements. - *

- * This draws a line from the current end point to the given position. - *

- * @param point The coordinates of the line's end point. - */ - lineTo(point:yfiles.geometry.IPoint):void; - /** - * Performs a quick test to decide whether this path might intersect the clipping rectangle, provided the path would be - * rendered using stroke of the given width. - *

- * This method will return false if the clip is entirely inside the area of this path. - *

- * @param clip The clip to check for intersection. - * @param width The width of the stroke. - * @returns false if it is guaranteed that this instance would not intersect the given clip. - */ - mayIntersectClip(clip:yfiles.geometry.Rect,width:number):boolean; - /** - * Appends a {@link yfiles.geometry.PathType#MOVE_TO} operation to the path elements. - *

- * This moves the pen to a new position without drawing a line. - *

- * @param x The next x coordinate. - * @param y The next y coordinate. - */ - moveTo(x:number,y:number):void; - /** - * Appends a {@link yfiles.geometry.PathType#MOVE_TO} operation to the path elements. - *

- * This moves the pen to a new position without drawing a line. - *

- * @param point The next coordinate. - */ - moveTo(point:yfiles.geometry.IPoint):void; - /** - * Tests whether the line of the path is hit at the given point using an epsilon for fuzzy hit testing. - * @param point The p coordinates of the point to test. - * @param [eps=0.5] The allowed distance from the point to the path that is considered a hit.0.5 is the default value. - * @returns Whether the point hits the path. - */ - pathContains(point:yfiles.geometry.IPoint,eps?:number):boolean; - /** - * Adds the contents of the given path to the beginning of this path. - *

- * If connect is true, the initial {@link yfiles.geometry.PathType#MOVE_TO} in this will be transformed into a - * {@link yfiles.geometry.PathType#LINE_TO}. - *

- * @param other The path to append to this path. - * @param connect Whether to connect the path to the end of this path. - */ - prepend(other:yfiles.geometry.GeneralPath,connect:boolean):void; - /** - * Appends a {@link yfiles.geometry.PathType#QUAD_TO quadratic Bézier curve} to the path elements. - *

- * This draws a quadratic Bézier curve from the current end point to the given position using the given control point. - *

- * @param cx The x coordinate of the Bézier control point. - * @param cy The y coordinate of the Bézier control point. - * @param x The x coordinate of the curve's end point. - * @param y The y coordinate of the curve's end point. - */ - quadTo(cx:number,cy:number,x:number,y:number):void; - /** - * Appends a {@link yfiles.geometry.PathType#QUAD_TO quadratic Bézier curve} to the path elements. - *

- * This draws a quadratic Bézier curve from the current end point to the given position using the given control point. - *

- * @param center The coordinates of the Bézier control point. - * @param point The coordinates of the curve's end point. - */ - quadTo(center:yfiles.geometry.IPoint,point:yfiles.geometry.IPoint):void; - /** - * Transforms this {@link yfiles.geometry.GeneralPath} in place using the given transform. - * @param transform The matrix to multiply the geometry with. - */ - transform(transform:yfiles.geometry.Matrix):void; - /** - * Gets the last x coordinate of the last path element. - * @type {number} - */ - lastX:number; - /** - * Gets the last coordinates of the last path element. - * @type {yfiles.geometry.Point} - */ - lastCoordinate:yfiles.geometry.Point; - /** - * Gets the last y coordinate of the last path element. - * @type {number} - */ - lastY:number; - /** - * Gets a value indicating whether this path contains elements other than an initial {@link yfiles.geometry.PathType#MOVE_TO}. - * @type {boolean} - */ - isEmpty:boolean; - /** - * Gets a value indicating whether the path contains visible parts. - * @type {boolean} - */ - isVisible:boolean; - /** - * Gets the number of {@link yfiles.geometry.PathType} operations stored in this instance. - * @type {number} - */ - size:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.geometry.GeneralPath; - } - /** - * An immutable {@link yfiles.geometry.ISize} implementation to describe a size in two-dimensional space. - * @class - * @implements {yfiles.geometry.ISize} - * @final - */ - export interface Size extends yfiles.lang.Struct,yfiles.geometry.ISize{} - export class Size { - /** - * Creates a new size using the provided width and height. - * @param width The new width. - * @param height The new height. - */ - constructor(width:number,height:number); - /** - * - * @returns - */ - clone():yfiles.geometry.Size; - /** - * Performs an implicit conversion from {@link yfiles.geometry.MutableSize} to {@link yfiles.geometry.Size}. - * @param size The size. - * @returns The result of the conversion. - * @static - */ - static convertFrom(size:yfiles.geometry.MutableSize):yfiles.geometry.Size; - /** - * Performs an explicit conversion from {@link yfiles.geometry.Size} to {@link yfiles.geometry.MutableSize}. - * @param size The size. - * @returns The result of the conversion. - * @static - */ - static convertToMutableSize(size:yfiles.geometry.Size):yfiles.geometry.MutableSize; - /** - * Returns a size whose {@link yfiles.geometry.Size#width} and {@link yfiles.geometry.Size#height} is the {@link Math#max} of the respecting properties of the two parameters. - * @param size1 The first size. - * @param size2 The second size. - * @returns A size whose {@link #width} and {@link #height} is the {@link #max} of the respecting properties of the two parameters. - * @static - */ - static max(size1:yfiles.geometry.Size,size2:yfiles.geometry.Size):yfiles.geometry.Size; - /** - * Returns a size whose {@link yfiles.geometry.Size#width} and {@link yfiles.geometry.Size#height} is the {@link Math#min} of the respecting properties of the two parameters. - * @param size1 The first size. - * @param size2 The second size. - * @returns A size whose {@link #width} and {@link #height} is the {@link #min} of the respecting properties of the two parameters. - * @static - */ - static min(size1:yfiles.geometry.Size,size2:yfiles.geometry.Size):yfiles.geometry.Size; - /** - * Multiplies the {@link yfiles.geometry.Size#width} and {@link yfiles.geometry.Size#height} by the given factor and returns the result. - * @param factor The factor to multiply the width and height by. - * @returns A new size that has the width and height multiplied by the factor. - */ - multiply(factor:number):yfiles.geometry.Size; - /** - * Converts this instance to an {@link yfiles.geometry.MutableSize} instance - * @returns The {@link } instance, whose attributes have been initialized with the values of this instance. - */ - toMutableSize():yfiles.geometry.MutableSize; - /** - * Creates a {@link yfiles.algorithms.YDimension} from a given {@link yfiles.geometry.Size}. - * @returns The {@link }. - */ - toYDimension():yfiles.algorithms.YDimension; - /** - * The "empty" size that has {@link yfiles.geometry.Size#width} and {@link yfiles.geometry.Size#height} set to -1.0d. - * @const - * @static - * @type {yfiles.geometry.Size} - */ - static EMPTY:yfiles.geometry.Size; - /** - * The "zero" size that has {@link yfiles.geometry.Size#width} and {@link yfiles.geometry.Size#height} set to 0.0d. - *

- * This size is not treated as {@link yfiles.geometry.Size#isEmpty}. - *

- * @const - * @static - * @type {yfiles.geometry.Size} - */ - static ZERO:yfiles.geometry.Size; - /** - * The "infinite" size that has {@link yfiles.geometry.Size#width} and {@link yfiles.geometry.Size#height} set to {@link number#POSITIVE_INFINITY}. - * @const - * @static - * @type {yfiles.geometry.Size} - */ - static INFINITE:yfiles.geometry.Size; - /** - * Gets the width. - *

- * Negative values for the width indicate an {@link yfiles.geometry.Size#isEmpty empty} size. - *

- * @type {number} - */ - width:number; - /** - * Gets the height. - *

- * Negative values for the height indicate an {@link yfiles.geometry.Size#isEmpty empty} size. - *

- * @type {number} - */ - height:number; - /** - * Gets the area of this instance which is the product of {@link yfiles.geometry.Size#width} and {@link yfiles.geometry.Size#height}. - * @type {number} - */ - area:number; - /** - * Gets a value indicating whether this instance is deemed empty. - * @type {boolean} - */ - isEmpty:boolean; - /** - * Gets a value indicating whether this instance is finite. - *

- * This means that neither {@link yfiles.geometry.Size#width} nor {@link yfiles.geometry.Size#height} are infinite. - *

- * @type {boolean} - */ - isFinite:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.geometry.Size; - } - /** - * An immutable {@link yfiles.geometry.IPoint} that models a point in 2-d Cartesian coordinate space with double coordinates. - *

- * This class implements the {@link yfiles.geometry.IPoint} interface so that it can be used in methods that require that - * interface. - *

- * @class - * @implements {yfiles.geometry.IPoint} - * @final - */ - export interface Point extends yfiles.lang.Struct,yfiles.geometry.IPoint{} - export class Point { - /** - * Initializes a new instance using the given values for the {@link yfiles.geometry.Point#x} and {@link yfiles.geometry.Point#y} properties. - * @param x The x coordinate. - * @param y The y coordinate. - */ - constructor(x:number,y:number); - /** - * Adds the given vector to this instance. - *

- * This operator is applied componentwise to {@link yfiles.geometry.Point#x} and {@link yfiles.geometry.Point#y}. - *

- * @param otherPoint The second point. - * @returns The result of the vector addition. - */ - add(otherPoint:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * - * @returns - */ - clone():yfiles.geometry.Point; - /** - * Performs an explicit conversion from {@link yfiles.geometry.MutablePoint} to {@link yfiles.geometry.Point}. - * @param p The point to convert. - * @returns The result of the conversion. - * @static - */ - static convertFrom(p:yfiles.geometry.MutablePoint):yfiles.geometry.Point; - /** - * Performs an implicit conversion from {@link yfiles.geometry.Point} to {@link yfiles.geometry.MutablePoint}. - * @param point The point to convert. - * @returns - * @static - */ - static convertToMutablePoint(point:yfiles.geometry.Point):yfiles.geometry.MutablePoint; - /** - * Determines the distance between this point and a line segment. - * @param start The coordinates of the first point of the line. - * @param end The coordinates of the second point of the line. - * @returns The distance between this point and the closest point on the line segment. - */ - distanceToSegment(start:yfiles.geometry.Point,end:yfiles.geometry.Point):number; - /** - * Determines whether the two given points have the same coordinates with respect to a certain given eps. - * @param other The other point to check for equality against this point. - * @param eps The epsilon value. - * @returns Whether both coordinates are equal with respect for the given epsilon. - */ - equalsEps(other:yfiles.geometry.Point,eps:number):boolean; - /** - * Create a constrained copy of this instance that lies within the given non-empty rectangle. - *

- * If the given rectangle is {@link yfiles.geometry.Rect#EMPTY}, this implementation will silently return. - *

- * @param rectangle The rectangle to constrain this instance by. - * @returns A constrained copy of this instance. - */ - getConstrained(rectangle:yfiles.geometry.Rect):yfiles.geometry.Point; - /** - * Calculates the projection of this point onto a line. - * @param anchor An anchor for the infinite line. - * @param direction A direction vector for the infinite line. - * @returns The point on the line that is closest to this point. - */ - getProjectionOnLine(anchor:yfiles.geometry.Point,direction:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Calculates the projection of this point onto a ray. - *

- * If the perpendicular projection onto the line is outside of the ray ("behind" the rayStart) the rayStart is returned - * instead. - *

- * @param rayStart The start of the segment. - * @param direction The direction of the ray. - * @returns The point on the ray that is closest to this point. - */ - getProjectionOnRay(rayStart:yfiles.geometry.Point,direction:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Calculates the projection of this point onto a segment. - *

- * If the perpendicular projection onto the line is outside of the segment the nearest segment endpoint is returned. - *

- * @param start The start of the segment. - * @param end The end of the segment. - * @returns The point on the segment that is closest to this point. - */ - getProjectionOnSegment(start:yfiles.geometry.Point,end:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Determines if the point lies close to this point given an epsilon. - * @param other The coordinates of the other point. - * @param hitTestRadius The hit test epsilon. - * @returns Whether the distance between the two points is smaller than hitTestRadius - */ - hits(other:yfiles.geometry.Point,hitTestRadius:number):boolean; - /** - * Determines whether this point hits the line segment with respect to a given radius. - * @param start The starting point of the line segment to test. - * @param end The ending point of the line segment to test. - * @param radius The hit test radius. - * @returns Whether this point hits the given line segment within the radius. - */ - hitsLineSegment(start:yfiles.geometry.Point,end:yfiles.geometry.Point,radius:number):boolean; - /** - * Determines whether a polygonal line is hit by this point given an epsilon. - * @param points The list of points that is treated as a polygon - * @param radius A positive value allows for fuzzy hit testing. If the point lies outside the given object but it's distance is less than - * or equal to that value, it will be considered a hit. - * @returns Whether the point hits the polygon. - */ - hitsPolyline(points:yfiles.collections.IEnumerable,radius:number):boolean; - /** - * Applies the given matrix to this instance by calling {@link yfiles.geometry.Matrix#transform} and returns the result. - * @param matrix The matrix to use for the transformation. - * @returns The result of the transformation. - */ - multiply(matrix:yfiles.geometry.Matrix):yfiles.geometry.Point; - /** - * Multiplies the given factor with this instance using scalar multiplication and returns the result. - *

- * This factor is applied componentwise to {@link yfiles.geometry.Point#x} and {@link yfiles.geometry.Point#y}. - *

- * @param factor The factor to scale the components by. - * @returns The result of the scalar multiplication. - */ - multiply(factor:number):yfiles.geometry.Point; - /** - * Calculates the scalar product of this and the given vector. - * @param other The other vector. - * @returns The scalar product (X*other.X + Y*other.Y) - */ - scalarProduct(other:yfiles.geometry.Point):number; - /** - * Calculates the scalar product of the two given points. - * @param point1 The first point. - * @param point2 The second point. - * @returns The scalar product of the two points. - * @static - */ - static scalarProduct(point1:yfiles.geometry.Point,point2:yfiles.geometry.Point):number; - /** - * Subtracts the given vector from this instance. - *

- * This operator is applied componentwise to {@link yfiles.geometry.Point#x} and {@link yfiles.geometry.Point#y}. - *

- * @param otherPoint The second point. - * @returns The result of the vector subtraction. - */ - subtract(otherPoint:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Creates an {@link yfiles.geometry.IMutablePoint} that has the same coordinates as this instance. - * @returns A {@link } with the same coordinates. - */ - toMutablePoint():yfiles.geometry.IMutablePoint; - /** - * Creates a {@link yfiles.algorithms.Point2D} from a given {@link yfiles.geometry.Point}. - * @returns The {@link }. - */ - toPoint2D():yfiles.algorithms.Point2D; - /** - * Creates a {@link yfiles.algorithms.YPoint} from a given {@link yfiles.geometry.Point}. - * @returns The {@link }. - */ - toYPoint():yfiles.algorithms.YPoint; - /** - * Creates a {@link yfiles.algorithms.YVector} from a given {@link yfiles.geometry.Point}. - * @returns The {@link }. - */ - toYVector():yfiles.algorithms.YVector; - /** - * An instance that has {@link yfiles.geometry.Point#x} and {@link yfiles.geometry.Point#y} set to 0.0d. - * @const - * @static - * @type {yfiles.geometry.Point} - */ - static ORIGIN:yfiles.geometry.Point; - /** - * Gets the X coordinate of the point. - * @type {number} - */ - x:number; - /** - * Gets the Y coordinate of the point. - * @type {number} - */ - y:number; - /** - * Gets the length of the vector that has {@link yfiles.geometry.Point#x} and {@link yfiles.geometry.Point#y} as its components. - * @type {number} - */ - vectorLength:number; - /** - * Gets the squared length of the vector that has {@link yfiles.geometry.Point#x} and {@link yfiles.geometry.Point#y} as its components. - * @type {number} - */ - squaredVectorLength:number; - /** - * Gets the normalized version of this vector. - * @type {yfiles.geometry.Point} - */ - normalized:yfiles.geometry.Point; - /** - * Gets whether this instance is a vertically oriented vector. - * @type {boolean} - */ - isVerticalVector:boolean; - /** - * Gets whether this instance is a horizontally oriented vector. - * @type {boolean} - */ - isHorizontalVector:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.geometry.Point; - } - /** - * A class that models the thickness of insets as double precision floating point values. - * @class - * @final - */ - export interface Insets extends yfiles.lang.Struct{} - export class Insets { - /** - * Initializes a new instance. - * @param left The left inset. - * @param top The top inset. - * @param right The right inset. - * @param bottom The bottom inset. - */ - constructor(left:number,top:number,right:number,bottom:number); - /** - * Initializes a new instance using the provided inset for all four sides. - * @param inset The inset to use for all sides. - */ - constructor(inset:number); - /** - * - * @returns - */ - clone():yfiles.geometry.Insets; - /** - * Calculates the union of this instance and the given inset which is done by performing {@link Math#max} on all four inset - * values. - * @param insets The insets to max with these insets. - * @returns - */ - createUnion(insets:yfiles.geometry.Insets):yfiles.geometry.Insets; - /** - * Creates an enlarged instance by adding the insets of the specified insets to this instance and returning the result. - * @param insets The insets to add to this instance. - * @returns - */ - getEnlarged(insets:yfiles.geometry.Insets):yfiles.geometry.Insets; - /** - * Multiplies each side of the insets by the given factor and returns the result. - * @param factor The factor to scales up by. - * @returns New insets scaled up by the factor. - */ - multiply(factor:number):yfiles.geometry.Insets; - /** - * Creates a {@link yfiles.algorithms.Insets} from a given {@link yfiles.geometry.Insets}. - * @returns The {@link }. - */ - toInsets():yfiles.algorithms.Insets; - /** - * The "empty" insets that has all properties set to 0.0d. - * @const - * @static - * @type {yfiles.geometry.Insets} - */ - static EMPTY:yfiles.geometry.Insets; - /** - * Gets the top inset. - * @type {number} - */ - top:number; - /** - * Gets the left inset. - * @type {number} - */ - left:number; - /** - * Gets the bottom inset. - * @type {number} - */ - bottom:number; - /** - * Gets the right inset. - * @type {number} - */ - right:number; - /** - * Gets the vertical insets, which is the sum of {@link yfiles.geometry.Insets#top} and {@link yfiles.geometry.Insets#bottom}. - * @type {number} - */ - verticalInsets:number; - /** - * Gets the horizontal insets, which is the sum of {@link yfiles.geometry.Insets#left} and {@link yfiles.geometry.Insets#right}. - * @type {number} - */ - horizontalInsets:number; - /** - * Gets a value indicating whether this instance is empty, that is all insets are 0.0d. - * @type {boolean} - */ - isEmpty:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.geometry.Insets; - } - /** - * An immutable class that models a rectangle in 2-d Cartesian coordinate space with double coordinates. - *

- * This class differs from other possible implementation in the way negative {@link yfiles.geometry.Rect#width} and {@link yfiles.geometry.Rect#height} properties are handled and interpreted. - * Width and/or height values may be negative in which case the rectangle is considered {@link yfiles.geometry.Rect#isEmpty empty} and non-existent. Empty - * rectangles are not considered in {@link yfiles.geometry.Rect#add union-like} operations, whereas rectangles with {@link yfiles.geometry.Rect#width} and {@link yfiles.geometry.Rect#height} of 0.0d are. This class implements - * the {@link yfiles.geometry.IRectangle} interface so that it can be used in methods that require that interface. - *

- * @class - * @implements {yfiles.geometry.IRectangle} - * @final - */ - export interface Rect extends yfiles.lang.Struct,yfiles.geometry.IRectangle{} - export class Rect { - /** - * Initializes a new instance. - * @param x The {@link #x} coordinate of the top left corner. - * @param y The {@link #y} coordinate of the top left corner. - * @param width The {@link #width} of the rectangle. - * @param height The {@link #height} of the rectangle. - */ - constructor(x:number,y:number,width:number,height:number); - /** - * Initializes a new instance using the {@link yfiles.geometry.Rect#topLeft} corner and the {@link yfiles.geometry.Rect#size}. - * @param location The top left corner. - * @param size The size to use. - */ - constructor(location:yfiles.geometry.Point,size:yfiles.geometry.Size); - /** - * Initializes a new instance using two point to define the bounds - *

- * This will always result in non-{@link yfiles.geometry.Rect#isEmpty} rectangles as the coordinates of the points are sorted so that the smaller gets assigned - * to {@link yfiles.geometry.Rect#x} and {@link yfiles.geometry.Rect#y} respectively and the greater ones define the {@link yfiles.geometry.Rect#width} and {@link yfiles.geometry.Rect#height}. - *

- * @param p1 The first point to determine the bounds. - * @param p2 The second point to determine the bounds. - */ - constructor(p1:yfiles.geometry.Point,p2:yfiles.geometry.Point); - /** - * Initializes a new instance of the {@link yfiles.geometry.Rect} class with the initial values obtained from the given rectangle. - * @param rectangle The rectangle to retrieve the initial values from. - */ - constructor(rectangle:yfiles.geometry.IRectangle); - /** - * Returns the union of this rectangle and the given point. - * @param point The point to include in the rectangle's bounds. - * @returns The enlarged rectangle. - */ - add(point:yfiles.geometry.Point):yfiles.geometry.Rect; - /** - * Returns the union of the given rectangles. - *

- * {@link yfiles.geometry.Rect#isEmpty empty} rectangles will not be considered. - *

- * @param firstRectangle The first rectangle to use for the union. - * @param secondRectangle The second rectangle to use for the union. - * @returns A rectangle that encompasses the area of the two given rectangles. - * @static - */ - static add(firstRectangle:yfiles.geometry.Rect,secondRectangle:yfiles.geometry.Rect):yfiles.geometry.Rect; - /** - * - * @returns - */ - clone():yfiles.geometry.Rect; - /** - * Determines whether this rectangle contains the specified point with respect to a given epsilon. - * @param point The point to test. - * @param eps The positive epsilon distance that the point may lie outside the rectangle and still be considered contained. - * @returns true if this rectangle contains the specified point; false otherwise. An {@link #isEmpty empty} instance never contains any point. A - * point is considered to be contained in the rectangle when the coordinates are not smaller than {@link #minX} and {@link #minY} minus eps nor - * greater than {@link #maxX} and {@link #maxY} plus eps. - */ - containsWithEps(point:yfiles.geometry.Point,eps:number):boolean; - /** - * Performs an explicit conversion from {@link yfiles.geometry.MutableRectangle} to {@link yfiles.geometry.Rect}. - * @param rectangle The rectangle to convert. - * @returns The result of the conversion. - * @static - */ - static convertFrom(rectangle:yfiles.geometry.MutableRectangle):yfiles.geometry.Rect; - /** - * Performs an explicit conversion from {@link yfiles.geometry.Rect} to {@link yfiles.geometry.MutableRectangle}. - * @param rectangle The rectangle to convert. - * @returns The result of the conversion. - * @static - */ - static convertToMutableRectangle(rectangle:yfiles.geometry.Rect):yfiles.geometry.MutableRectangle; - /** - * Finds the intersection between a rectangle and a line. - * @param inner The coordinates of a point lying inside the rectangle. - * @param outer The coordinates of a point lying outside the rectangle. - * @returns The intersection point if the inner point lies inside the rectangle, the outer point lies outside the rectangle and thus - * an intersection point has been found, or null otherwise. - */ - findLineIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Creates a new instance given the center of the rectangle and its size. - * @param center The center to use. - * @param size The size to assign. - * @returns An instance whose center is set to center and size is size - * @static - */ - static fromCenter(center:yfiles.geometry.Point,size:yfiles.geometry.Size):yfiles.geometry.Rect; - /** - * Creates an enlarged instance of this rectangle using the same insets for all sides. - *

- * If this instance {@link yfiles.geometry.Rect#isEmpty}, the result will be the same. - *

- * @param size The inset to add to each of the sides to grow the new instance. - * @returns - * @see yfiles.geometry.Rect#getEnlarged - */ - getEnlarged(size:number):yfiles.geometry.Rect; - /** - * Creates an enlarged instance that is the same as this one but enlarged by the specified insets. - *

- * If this instance {@link yfiles.geometry.Rect#isEmpty}, the same will be returned. - *

- * @param insets The insets to use to add to the instance. - * @returns - */ - getEnlarged(insets:yfiles.geometry.Insets):yfiles.geometry.Rect; - /** - * Transforms this instance using the specified matrix and returns the result. - * @param transform The transform matrix to apply to this instance. - * @returns - */ - getTransformed(transform:yfiles.geometry.Matrix):yfiles.geometry.Rect; - /** - * Returns a translated instance of this which has modified {@link yfiles.geometry.Rect#x} and {@link yfiles.geometry.Rect#y} by the given amount. - * @param delta The delta to add to {@link #x} and {@link #y}. - * @returns - */ - getTranslated(delta:yfiles.geometry.Point):yfiles.geometry.Rect; - /** - * Determines whether the bounds of this instance intersect with the bounds of the specified rectangle. - * @param rectangle The rectangle to check. - * @returns Whether both instance are non-empty and have an intersection with positive {@link #area}. - */ - intersects(rectangle:yfiles.geometry.Rect):boolean; - /** - * Determines whether this rectangle intersects an {@link yfiles.geometry.IOrientedRectangle}, given an epsilon. - * @param rectangle The {@link } to test. - * @param [eps=0] A positive value allows for fuzzy hit testing. If the point lies outside the given object but it's distance is less than - * or equal to that value, it will be considered a hit. - * @returns Whether they have a non-empty intersection. - */ - intersects(rectangle:yfiles.geometry.IOrientedRectangle,eps?:number):boolean; - /** - * Determines whether this rectangle intersects a line. - * @param start The first end point of the line. - * @param end The second end point of the line. - * @returns Whether the line intersects the rectangle. - */ - intersectsLine(start:yfiles.geometry.Point,end:yfiles.geometry.Point):boolean; - /** - * Determines whether a rectangle intersects a polygonal line. - * @param points The list of points that is interpreted as a number of line segments. - * @returns true if the rectangle intersects at least one segment of the line. - */ - intersectsPolyline(points:yfiles.collections.IEnumerable):boolean; - /** - * Creates an {@link yfiles.geometry.IMutableRectangle} using the values from this instance. - * @returns An instance that has been initialized from the values of this instance. - */ - toMutableRectangle():yfiles.geometry.IMutableRectangle; - /** - * Creates a {@link yfiles.algorithms.Rectangle2D Rectangle2D} from a given {@link yfiles.geometry.Rect}. - * @returns The {@link Rectangle2D}. - */ - toRectangle2D():yfiles.algorithms.Rectangle2D; - /** - * Creates a {@link yfiles.algorithms.YRectangle} from a given {@link yfiles.geometry.Rect}. - * @returns The {@link }. - */ - toYRectangle():yfiles.algorithms.YRectangle; - /** - * An {@link yfiles.geometry.Rect#isEmpty empty} rectangle. - *

- * {@link yfiles.geometry.Rect#width} and {@link yfiles.geometry.Rect#height} are set to -1.0d, {@link yfiles.geometry.Rect#x} and {@link yfiles.geometry.Rect#y} are set to 0.0d. - *

- * @const - * @static - * @type {yfiles.geometry.Rect} - */ - static EMPTY:yfiles.geometry.Rect; - /** - * An infinite rectangle. - *

- * {@link yfiles.geometry.Rect#width} and {@link yfiles.geometry.Rect#height} are set to {@link number#POSITIVE_INFINITY}, {@link yfiles.geometry.Rect#x} and {@link yfiles.geometry.Rect#y} are set to {@link number#NEGATIVE_INFINITY}. - *

- * @const - * @static - * @type {yfiles.geometry.Rect} - */ - static INFINITE:yfiles.geometry.Rect; - /** - * Gets the X coordinate of the upper left corner of the rectangle. - * @type {number} - */ - x:number; - /** - * Gets the Y coordinate of the upper left corner of the rectangle. - * @type {number} - */ - y:number; - /** - * Gets the width of the rectangle. - * @type {number} - */ - width:number; - /** - * Gets the height of the rectangle. - * @type {number} - */ - height:number; - /** - * Gets the center X coordinate of the rectangle. - * @type {number} - */ - centerX:number; - /** - * Gets the center Y coordinate of the rectangle. - * @type {number} - */ - centerY:number; - /** - * Gets the center of the rectangle using {@link yfiles.geometry.Rect#centerX} and {@link yfiles.geometry.Rect#centerY}. - * @type {yfiles.geometry.Point} - */ - center:yfiles.geometry.Point; - /** - * Gets the coordinates of the top left corner of the rectangle. - * @type {yfiles.geometry.Point} - */ - topLeft:yfiles.geometry.Point; - /** - * Gets the coordinates of the top right corner of the rectangle. - * @type {yfiles.geometry.Point} - */ - topRight:yfiles.geometry.Point; - /** - * Gets the coordinates of the bottom left corner of the rectangle. - * @type {yfiles.geometry.Point} - */ - bottomLeft:yfiles.geometry.Point; - /** - * Gets the coordinates of the bottom right corner of the rectangle. - * @type {yfiles.geometry.Point} - */ - bottomRight:yfiles.geometry.Point; - /** - * Gets the size of this instance. - * @type {yfiles.geometry.Size} - */ - size:yfiles.geometry.Size; - /** - * Gets a value indicating whether this instance is considered empty. - *

- * Yields true if this at least one of {@link yfiles.geometry.Rect#width} or {@link yfiles.geometry.Rect#height} is negative; false otherwise. Note that a width and height of both 0.0d is not - * considered empty for this implementation. - *

- * @type {boolean} - */ - isEmpty:boolean; - /** - * Gets a value indicating whether this instance is finite. - * @type {boolean} - */ - isFinite:boolean; - /** - * Gets the coordinates of the right border for this instance. - * @type {number} - */ - maxX:number; - /** - * Gets the coordinates of the lower border for this instance. - * @type {number} - */ - maxY:number; - /** - * Gets the X coordinates of the left side of this instance. - * @type {number} - */ - minX:number; - /** - * Gets the Y coordinates of the top side of this instance. - * @type {number} - */ - minY:number; - /** - * Gets the area of this instance which is the product of {@link yfiles.geometry.Rect#width} and {@link yfiles.geometry.Rect#height}. - * @type {number} - */ - area:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.geometry.Rect; - } - /** - * An immutable class that represents a tangent in a 2-d Cartesian coordinate space with double values. - *

- * The tangent consists of its point of tangency ({@link yfiles.geometry.Tangent#point}) and a direction ({@link yfiles.geometry.Tangent#vector}). - *

- * @class - * @final - */ - export interface Tangent extends yfiles.lang.Struct{} - export class Tangent { - /** - * Initializes a new instance of the {@link yfiles.geometry.Tangent} class using the given values for the {@link yfiles.geometry.Tangent#point} and {@link yfiles.geometry.Tangent#vector} properties. - * @param point The point of tangency. - * @param vector The directional vector. - */ - constructor(point:yfiles.geometry.Point,vector:yfiles.geometry.Point); - /** - * Gets the point of tangency. - * @type {yfiles.geometry.Point} - */ - point:yfiles.geometry.Point; - /** - * Gets the directional vector. - * @type {yfiles.geometry.Point} - */ - vector:yfiles.geometry.Point; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.geometry.Tangent; - } - /** - * Utility class that performs all kind of geometric operations. - *

- * Also it serves as a factory for various implementations of geometric primitives. - *

- * @class - * @static - */ - export interface GeomUtilities extends yfiles.lang.Object{} - export class GeomUtilities { - /** - * Checks whether an ellipse contains the given point. - * @param bounds The coordinates of the bounds of the ellipse's enclosing rectangle. - * @param point The coordinates of the point to test. - * @param eps A positive value allows for fuzzy hit testing. If the point lies outside the given object but it's distance is less than - * or equal to that value, it will be considered a hit. - * @returns Whether the point lies within the ellipse - * @static - */ - static ellipseContains(bounds:yfiles.geometry.Rect,point:yfiles.geometry.Point,eps:number):boolean; - /** - * Returns the ellipse/line intersection point for the given point pair. - *

- * This will always return the intersection point that lies in the direction from inner to outer. - *

- * @param bounds The coordinates of the bounds of the ellipse's enclosing rectangle. - * @param inner The coordinates of a point lying inside the ellipse. - * @param outer The coordinates of a point lying outside the ellipse. - * @returns The intersection point iff the inner point lies inside the ellipse and an intersection point has been found, otherwise - * null. - * @static - */ - static findEllipseLineIntersection(bounds:yfiles.geometry.Rect,inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Finds the intersection between a line segment and an infinite ray. - *

- * The ray is described using an anchor point and a ray direction. The direction vector does not need to be normalized. In - * order to obtain the intersection point do the following: - *

- * @param start The coordinates of the first end point of the line segment. - * @param end The coordinates of the second end point of the line segment. - * @param anchor The coordinates of the starting point of the ray. - * @param rayDirection The direction vector of the ray. - * @returns The distance factor or {@link #POSITIVE_INFINITY} if the ray does not intersect the line. - * @static - */ - static findRayIntersection(start:yfiles.geometry.Point,end:yfiles.geometry.Point,anchor:yfiles.geometry.Point,rayDirection:yfiles.geometry.Point):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.geometry.GeomUtilities; - } - /** - * Interface for mutable oriented rectangles in 2D coordinate space with double precision coordinates. - * @see yfiles.geometry.ISize - * @see yfiles.geometry.IOrientedRectangle - * @see yfiles.geometry.OrientedRectangle - * @interface - * @implements {yfiles.geometry.IOrientedRectangle} - * @implements {yfiles.geometry.IMutableSize} - */ - export interface IMutableOrientedRectangle extends yfiles.lang.Object,yfiles.geometry.IOrientedRectangle,yfiles.geometry.IMutableSize{ - /** - * Sets the anchor vector of the oriented rectangle to the given value. - * @param location The coordinates of the new anchor location. - */ - setAnchor?(location:yfiles.geometry.Point):void; - /** - * Sets the center of the oriented rectangle to the given value. - * @param center The coordinates of the new center. - */ - setCenter?(center:yfiles.geometry.Point):void; - /** - * Sets the orientation of this oriented rectangle by modifying the up vector components. - *

- * It is up to the caller to assure that the values describe a vector of length 1. - *

- * @param upx The x component of the normalized up vector. - * @param upy The y component of the normalized up vector. - * @see yfiles.geometry.IOrientedRectangle#upX - * @see yfiles.geometry.IOrientedRectangle#upY - * @abstract - */ - setUpVector(upx:number,upy:number):void; - /** - * Gets or sets the x coordinate for the anchor of the rectangle. - *

- * Implementations may adjust the coordinates internally, e.g. to automatically snap the coordinates to grid points. So - * depending on context the value that can be read might not necessarily be the exact same value that has just been - * written. - *

- * @abstract - * @type {number} - */ - anchorX:number; - /** - * Gets or sets the y coordinate for the anchor of the rectangle. - *

- * Implementations may adjust the coordinates internally, e.g. to automatically snap the coordinates to grid points. So - * depending on context the value that can be read might not necessarily be the exact same value that has just been - * written. - *

- * @abstract - * @type {number} - */ - anchorY:number; - } - var IMutableOrientedRectangle:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.geometry.IMutableOrientedRectangle; - }; - /** - * Interface for a mutable point in 2D coordinate space with double precision coordinates. - *

- * This interface provides read and write access to the coordinates. It adds write access to the read only interface - * {@link yfiles.geometry.IPoint}. - *

- * @see yfiles.geometry.IPoint - * @see yfiles.geometry.MutablePoint - * @interface - * @implements {yfiles.geometry.IPoint} - */ - export interface IMutablePoint extends yfiles.lang.Object,yfiles.geometry.IPoint{ - /** - * Sets the coordinates of the point to the given values. - * @param x The new x coordinate - * @param y The new y coordinate - */ - relocate?(x:number,y:number):void; - /** - * Sets the coordinates of the point to the given values. - * @param location The new location. - */ - relocate?(location:yfiles.geometry.IPoint):void; - /** - * Gets or sets the x coordinate for this point. - *

- * Implementations may adjust the coordinates internally, e.g. to automatically snap the coordinates to grid points. So - * depending on context the value that can be read might not necessarily be the exact same value that has just been - * written. - *

- * @see yfiles.geometry.IPoint#x - * @abstract - * @type {number} - */ - x:number; - /** - * Gets or sets the y coordinate for this point. - *

- * Implementations may adjust the coordinates internally, e.g. to automatically snap the coordinates to grid points. So - * depending on context the value that can be read might not necessarily be the exact same value that has just been - * written. - *

- * @see yfiles.geometry.IPoint#y - * @abstract - * @type {number} - */ - y:number; - } - var IMutablePoint:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.geometry.IMutablePoint; - }; - /** - * Interface for mutable rectangles aligned to the axes in 2D coordinate space with double precision coordinates. - *

- * This interface provides read and write access to the features of the rectangle. This interface does not declare any - * additional methods. It combines the {@link yfiles.geometry.IMutablePoint} interface that describes the upper left corner of the - * rectangle with the {@link yfiles.geometry.IMutableSize} interface that describes the width and height of the rectangle. - *

- * @see yfiles.geometry.ISize - * @see yfiles.geometry.IPoint - * @see yfiles.geometry.MutableRectangle - * @interface - * @implements {yfiles.geometry.IMutableSize} - * @implements {yfiles.geometry.IMutablePoint} - * @implements {yfiles.geometry.IRectangle} - */ - export interface IMutableRectangle extends yfiles.lang.Object,yfiles.geometry.IMutableSize,yfiles.geometry.IMutablePoint,yfiles.geometry.IRectangle{ - /** - * Adds a point to a rectangle, possibly enlarging the rectangle. - *

- * If the rectangle is initially empty, i.e. its width or height is negative, the bounds of the rectangle will be set to - * (p.x, p.y, 0, 0) - *

- * @param point The coordinate to include in the bounds. - */ - add?(point:yfiles.geometry.IPoint):void; - /** - * Adds a rectangle to another one. - *

- * The result is placed into the first rectangle, which is returned. If either of the two rectangles is empty, i.e. it's - * width or height is negative, the result will be the other rectangle. - *

- * @param rectangle2 The rectangle to be added. - */ - add?(rectangle2:yfiles.geometry.IRectangle):void; - /** - * Applies a new position and size to a given mutable rectangle. - * @param x The new x coordinate of the upper left corner of the rectangle. - * @param y The new y coordinate of the upper left corner of the rectangle. - * @param width The new width of the rectangle. - * @param height The new height of the rectangle. - */ - reshape?(x:number,y:number,width:number,height:number):void; - /** - * Applies a new position and size to a given mutable rectangle. - * @param position The new location. - * @param size The new size. - */ - reshape?(position:yfiles.geometry.IPoint,size:yfiles.geometry.ISize):void; - /** - * Applies a new position and size to a given mutable rectangle. - * @param newRectangle The bounds to set to the rectangle. - */ - reshape?(newRectangle:yfiles.geometry.IRectangle):void; - /** - * Sets the center of the rectangle to the provided value. - * @param center The new center coordinates. - */ - setCenter?(center:yfiles.geometry.Point):void; - /** - * Creates the union of two rectangles, placing the result in the this parameter. - *

- * Either of the two parameters rectangles may be the same as the first parameter. The result is placed into the this - * parameter. This method treats rectangles with negative width or height as empty. - *

- * @param rectangle1 The first rectangle to create the union of. - * @param rectangle2 The second rectangle to create the union of. - */ - setToUnion?(rectangle1:yfiles.geometry.IRectangle,rectangle2:yfiles.geometry.IRectangle):void; - } - var IMutableRectangle:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.geometry.IMutableRectangle; - }; - /** - * Interface for a mutable size in 2D coordinate space with double precision width and height. - *

- * This interface provides read and write access to the size. It extends the read only interface {@link yfiles.geometry.ISize}. - *

- * @see yfiles.geometry.ISize - * @see yfiles.geometry.MutableSize - * @interface - * @implements {yfiles.geometry.ISize} - */ - export interface IMutableSize extends yfiles.lang.Object,yfiles.geometry.ISize{ - /** - * Sets the coordinates of the size to the given values. - * @param newWidth The new x coordinate - * @param newHeight The new y coordinate - */ - resize?(newWidth:number,newHeight:number):void; - /** - * Sets the coordinates of the size to the given values. - * @param newSize The new location. - */ - resize?(newSize:yfiles.geometry.ISize):void; - /** - * Gets or sets the width of this instance. - *

- * Implementations may adjust the values internally, e.g. to automatically snap the values to grid sizes. So depending on - * context the value that can be read might not necessarily be the exact same value that has just been written. - *

- * @see yfiles.geometry.ISize#width - * @abstract - * @type {number} - */ - width:number; - /** - * Gets or sets the height of this instance. - *

- * Implementations may adjust the values internally, e.g. to automatically snap the values to grid sizes. So depending on - * context the value that can be read might not necessarily be the exact same value that has just been written. - *

- * @see yfiles.geometry.ISize#height - * @abstract - * @type {number} - */ - height:number; - } - var IMutableSize:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.geometry.IMutableSize; - }; - /** - * Interface for oriented rectangles in 2D coordinate space with double precision coordinates. - *

- * The rectangle described by this interface has its lower left corner at the anchor as described by the {@link yfiles.geometry.IOrientedRectangle#anchorX} and {@link yfiles.geometry.IOrientedRectangle#anchorY} properties - * and is oriented in space so that its upper left corner lies in direction of the ({@link yfiles.geometry.IOrientedRectangle#upX},{@link yfiles.geometry.IOrientedRectangle#upY}) vector. The size of the instance - * does not describe the bounds of the instance but the lengths of the sides of the rectangle. An {@link yfiles.geometry.IRectangle} - * would thus be an oriented rectangle, whose anchor is the lower left corner of the rectangle, whose size is the same as - * that of the rectangle and whose up vector is (0,-1). This interface provides read access to the features of the oriented - * rectangle only, however this does not mean that an instance that implements IOrientedRectangle will always return the - * same values for its properties. Often times the instance provides a dynamic read access to the current state of a - * rectangle. It depends on the context whether it is allowed to or even necessary to copy the state of the properties or - * whether the reference to the instance should always be used to query the values. - *

- * @see yfiles.geometry.ISize - * @see yfiles.geometry.IRectangle - * @see yfiles.geometry.OrientedRectangle - * @see yfiles.geometry.MutableRectangle - * @interface - * @implements {yfiles.geometry.ISize} - */ - export interface IOrientedRectangle extends yfiles.lang.Object,yfiles.geometry.ISize{ - /** - * Determines whether the given oriented rectangle contains the provided point, using an epsilon value. - * @param point The coordinates of the point to test. - * @param eps A positive value allows for fuzzy hit testing. If the point lies outside the given object but it's distance is less than - * or equal to that value, it will be considered a hit. - * @returns true iff the point lies inside the rectangle. - */ - containsWithEps?(point:yfiles.geometry.Point,eps:number):boolean; - /** - * Creates a transformation matrix that can be used to transform points that are in the local coordinate system of the - * oriented rectangle if the top-left corner is the origin. - * @returns A matrix that can be used to transform from oriented rectangle coordinates to world coordinates. - */ - createTransform?():yfiles.geometry.Matrix; - /** - * Determines whether the oriented rectangle contains the provided point, using an epsilon value. - * @param location The coordinates of the point to test. - * @param eps A positive value allows for fuzzy hit testing. If the point lies outside the given object but it's distance is less than - * or equal to that value, it will be considered a hit. - * @returns true iff the point lies inside the rectangle. - */ - hits?(location:yfiles.geometry.Point,eps:number):boolean; - /** - * Creates a {@link yfiles.algorithms.YOrientedRectangle} from a given {@link yfiles.geometry.IOrientedRectangle}. - * @returns The {@link }. - */ - toOrientedRectangle?():yfiles.algorithms.YOrientedRectangle; - /** - * Gets the x coordinate of the anchor of the oriented rectangle. - *

- * The anchor is the lower left corner of the oriented rectangle if the up vector is (0,-1). - *

- * @abstract - * @type {number} - */ - anchorX:number; - /** - * Gets the y coordinate of the anchor of the oriented rectangle. - *

- * The anchor is the lower left corner of the oriented rectangle if the up vector is (0,-1). - *

- * @abstract - * @type {number} - */ - anchorY:number; - /** - * Gets the x value of the up vector. - *

- * The up vector points from the lower left corner to the upper left corner and is always normalized, i.e. it's length is - * always 1. - *

- * @abstract - * @type {number} - */ - upX:number; - /** - * Gets the y value of the up vector. - *

- * The up vector points from the lower left corner to the upper left corner and is always normalized, i.e. it's length is - * always 1. - *

- * @abstract - * @type {number} - */ - upY:number; - /** - * Gets the up vector of the oriented rectangle as a {@link yfiles.geometry.Point} struct. - * @type {yfiles.geometry.Point} - */ - upVector?:yfiles.geometry.Point; - /** - * Gets the anchor location of the oriented rectangle as a {@link yfiles.geometry.Point} struct. - * @type {yfiles.geometry.Point} - */ - anchorLocation?:yfiles.geometry.Point; - /** - * Gets the current center of the oriented rectangle as a {@link yfiles.geometry.Point} struct. - * @type {yfiles.geometry.Point} - */ - orientedRectangleCenter?:yfiles.geometry.Point; - /** - * Determines the bounds of an oriented rectangle. - *

- * Bounding rectangles are parallel to the coordinate axes. - *

- * @type {yfiles.geometry.Rect} - */ - bounds?:yfiles.geometry.Rect; - } - var IOrientedRectangle:{ - /** - * An immutable empty {@link yfiles.geometry.IOrientedRectangle} with width and height of -1. - * @const - * @static - * @type {yfiles.geometry.IOrientedRectangle} - */ - EMPTY?:yfiles.geometry.IOrientedRectangle; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.geometry.IOrientedRectangle; - }; - /** - * Interface for a point in 2D coordinate space with double precision coordinates. - *

- * This interface provides read access to the coordinates only, however this does not mean that an instance that implements - * IPoint will always return the same values for the coordinate properties. Often times the instance provides a dynamic - * read access to the current state of a point. It depends on the context whether it is allowed to or even necessary to - * copy the state of the properties or whether the reference to the instance should always be used to query the values. - *

- * @see yfiles.geometry.IMutablePoint - * @see yfiles.geometry.MutablePoint - * @interface - */ - export interface IPoint extends yfiles.lang.Object{ - /** - * Calculates the Euclidean distance between two points. - * @param point2 The second point. - * @returns The distance between the two points. - */ - distanceTo?(point2:yfiles.geometry.IPoint):number; - /** - * Copies the current values of the coordinates of the point to a {@link yfiles.geometry.Point} struct. - *

- * This method is useful to obtain a copy of the state and for making use of the various utility methods that are provided - * by {@link yfiles.geometry.Point}. - *

- * @returns The current values of the coordinates of the point. - * @see yfiles.geometry.Point#toMutablePoint - */ - toPoint?():yfiles.geometry.Point; - /** - * Gets the current x coordinate of this point. - *

- * Depending on context the values returned may change over time. - *

- * @abstract - * @type {number} - */ - x:number; - /** - * Gets the current y coordinate of this point. - *

- * Depending on context the values returned may change over time. - *

- * @abstract - * @type {number} - */ - y:number; - } - var IPoint:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.geometry.IPoint; - }; - /** - * Interface for rectangles aligned to the axes in 2D coordinate space with double precision coordinates. - *

- * This interface provides read access to the features of the rectangle only, however this does not mean that an instance - * that implements IRectangle will always return the same values for its properties. Often times the instance provides a - * dynamic read access to the current state of a rectangle. It depends on the context whether it is allowed to or even - * necessary to copy the state of the properties or whether the reference to the instance should always be used to query - * the values. This interface does not declare any additional methods. It combines the {@link yfiles.geometry.IPoint} interface - * that describes the upper left corner of the rectangle with the {@link yfiles.geometry.ISize} interface that describes the width - * and height of the rectangle. - *

- * @see yfiles.geometry.IMutableRectangle - * @see yfiles.geometry.IMutablePoint - * @see yfiles.geometry.ISize - * @see yfiles.geometry.IPoint - * @see yfiles.geometry.MutableRectangle - * @interface - * @implements {yfiles.geometry.ISize} - * @implements {yfiles.geometry.IPoint} - */ - export interface IRectangle extends yfiles.lang.Object,yfiles.geometry.ISize,yfiles.geometry.IPoint{ - /** - * Determines whether the given rectangle contains the provided point. - * @param point The point to test. - * @returns true iff the point lies inside the rectangle. - */ - contains?(point:yfiles.geometry.Point):boolean; - /** - * Determines whether the given rectangle contains the provided point. - * @param point The point to test. - * @returns true iff the point lies inside the rectangle. - */ - contains?(point:yfiles.geometry.IPoint):boolean; - /** - * Copies the current values of the rectangle to {@link yfiles.geometry.Rect} struct. - *

- * This method can be used to obtain a copy of the current state of the rectangle and for using the utility methods that - * are available for the {@link yfiles.geometry.Rect} type. - *

- * @returns A {@link } that holds the values of the rectangle at the time of the invocation. - * @see yfiles.geometry.IMutableRectangle#reshape - * @see yfiles.geometry.Rect#toMutableRectangle - */ - toRect?():yfiles.geometry.Rect; - /** - * Gets the coordinates of the top left corner of the rectangle as a {@link yfiles.geometry.Point}. - * @type {yfiles.geometry.Point} - */ - topLeft?:yfiles.geometry.Point; - /** - * Gets the coordinates of the bottom left corner of the rectangle as a {@link yfiles.geometry.Point}. - * @type {yfiles.geometry.Point} - */ - bottomLeft?:yfiles.geometry.Point; - /** - * Gets the coordinates of the center of the rectangle as a {@link yfiles.geometry.Point}. - * @type {yfiles.geometry.Point} - */ - center?:yfiles.geometry.Point; - /** - * Gets the maximum X coordinate of the rectangle. - *

- * This is the x coordinate of the right side of the rectangle, or the left side if the rectangle is {@link yfiles.geometry.IRectangle#isEmpty}. - *

- * @type {number} - */ - maxX?:number; - /** - * Determines whether the specified rectangle is empty. - *

- * {@link yfiles.geometry.IRectangle} instances are considered empty if their {@link yfiles.geometry.ISize#width} or {@link yfiles.geometry.ISize#height} is less than 0.0d. - *

- * @type {boolean} - */ - isEmpty?:boolean; - /** - * Gets the maximum Y coordinate of the rectangle. - *

- * This is the y coordinate of the bottom side of the rectangle, or the top side if the rectangle is {@link yfiles.geometry.IRectangle#isEmpty}. - *

- * @type {number} - */ - maxY?:number; - /** - * Gets the coordinates of the top right corner of the rectangle as a {@link yfiles.geometry.Point}. - * @type {yfiles.geometry.Point} - */ - topRight?:yfiles.geometry.Point; - /** - * Gets the coordinates of the bottom right corner of the rectangle as a {@link yfiles.geometry.Point}. - * @type {yfiles.geometry.Point} - */ - bottomRight?:yfiles.geometry.Point; - } - var IRectangle:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.geometry.IRectangle; - }; - /** - * Interface for an object that has a size in 2D coordinate space with double precision floating point size values. - *

- * This interface provides read access to the size only, however this does not mean that an instance that implements ISize - * will always return the same values for the size properties. Often times the instance provides a dynamic read access to - * the current state of an instance. It depends on the context whether it is allowed to or even necessary to copy the state - * of the properties or whether the reference to the instance should always be used to query the values. - *

- * @see yfiles.geometry.IMutableSize - * @see yfiles.geometry.MutableSize - * @interface - */ - export interface ISize extends yfiles.lang.Object{ - /** - * Converts the {@link yfiles.geometry.ISize} to a {@link yfiles.geometry.Size} struct. - * @returns A {@link } struct that has been initialized with the current values of size. - */ - toSize?():yfiles.geometry.Size; - /** - * Gets the current width of this instance. - *

- * Depending on context the values returned may change over time. - *

- * @abstract - * @type {number} - */ - width:number; - /** - * Gets the current height of this instance. - *

- * Depending on context the values returned may change over time. - *

- * @abstract - * @type {number} - */ - height:number; - } - var ISize:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.geometry.ISize; - }; - export enum MatrixOrder{ - /** - * Constant that defines a prepend operation for matrix multiplications. - *

- * Prepending a matrix T to another matrix M results in the operation M′ = M T. Essentially, this means that T is applied before - * M when applying M′ to a vector. - *

- */ - PREPEND, - /** - * Constant that defines an append operation for matrix multiplications. - *

- * Appending a matrix T to another matrix M results in the operation M′ = T M. Essentially, this means that T is applied after M - * when applying M′ to a vector. - *

- */ - APPEND - } - /** - * An implementation of a matrix that represents an affine transformation and works with {@link yfiles.geometry.Point}. - *

- * The matrix is interpreted row-major. The rows are defined as follows: [ m11 m12 dx ], [ m21 m22 dy ], ([ 0 0 1 ] - * implicitly). - *

- *

- * When transforming a vector v using this matrix, the multiplication is done in this order: v' = M v. - *

- *

- * {@link yfiles.geometry.MatrixOrder#PREPEND Prepending} a matrix T to this instance results in the operation M′ = M T. In concept, this means that T is applied before M - * when applying M' to a vector. {@link yfiles.geometry.MatrixOrder#APPEND Appending} T to M results in M′ = T M. - *

- * @class - * @implements {yfiles.lang.ICloneable} - * @final - */ - export interface Matrix extends yfiles.lang.Object,yfiles.lang.ICloneable{} - export class Matrix { - /** - * Create a matrix using the provided matrix entries. - * @param m11 - * @param m12 - * @param m21 - * @param m22 - * @param dx - * @param dy - */ - constructor(m11:number,m12:number,m21:number,m22:number,dx:number,dy:number); - /** - * Create an identity matrix. - */ - constructor(); - /** - * Applies this matrix to the given SVG element. - * @param element The element to transform. - */ - applyTo(element:SVGElement):void; - /** - * Applies this matrix to the given HTML canvas rendering context. - * @param ctx The context to transform. - */ - applyTo(ctx:CanvasRenderingContext2D):void; - /** - * Creates a matrix rotation instance around the origin. - * @param theta The rotation angle in radians. - * @returns A new matrix. - * @static - */ - static createRotateInstance(theta:number):yfiles.geometry.Matrix; - /** - * Determines whether this has the same values like other. - * @param other The object to compare this to. Must be of the same type. - * @returns true if this has the same values like the other object. - */ - hasSameValue(other:yfiles.geometry.Matrix):boolean; - /** - * Inverts this instance. - */ - invert():void; - /** - * Multiplies this matrix instance by the given instance using the given order. - * @param matrix The matrix to multiply with this one. - * @param [order=yfiles.geometry.MatrixOrder.PREPEND] The order of the multiplication. {@link #PREPEND} if not specified. - */ - multiply(matrix:yfiles.geometry.Matrix,order?:yfiles.geometry.MatrixOrder):void; - /** - * Resets this instance to the identity. - */ - reset():void; - /** - * Prepends or appends a rotation operation to this matrix around the specified rotation center. - * @param theta The rotation angle in radians - * @param center The coordinate of the center of the rotation. - * @param [order=yfiles.geometry.MatrixOrder.PREPEND] Whether to append or prepend the rotation matrix. - */ - rotate(theta:number,center:yfiles.geometry.Point,order?:yfiles.geometry.MatrixOrder):void; - /** - * Prepends or appends a rotation operation to this matrix around the origin. - * @param theta The rotation angle in radians - * @param [order=yfiles.geometry.MatrixOrder.PREPEND] Whether to append or prepend the rotation matrix. - */ - rotate(theta:number,order?:yfiles.geometry.MatrixOrder):void; - /** - * Appends or prepends a scale operation to this instance. - * @param x - * @param y - * @param [order=yfiles.geometry.MatrixOrder.PREPEND] - */ - scale(x:number,y:number,order?:yfiles.geometry.MatrixOrder):void; - /** - * Sets all elements of this instance. - * @param m0 - * @param m1 - * @param m2 - * @param m3 - * @param dx - * @param dy - */ - set(m0:number,m1:number,m2:number,m3:number,dx:number,dy:number):void; - /** - * Sets the values of the given matrix to this instance. - * @param matrix - */ - set(matrix:yfiles.geometry.Matrix):void; - /** - * Converts the {@link yfiles.geometry.Matrix} object to an SVG transform string. - *

- * The returned string can be used in a transform attribute. - *

- * @returns The transform string - */ - toSvgTransform():string; - /** - * Transforms the given coordinate. - * @param point The coordinate to transform. - * @returns The transformed coordinates. - */ - transform(point:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Transforms the given point in place. - * @param point The point to transform and return. - * @returns point - */ - transform(point:yfiles.geometry.IMutablePoint):yfiles.geometry.IMutablePoint; - /** - * Appends or Prepends a translation to this instance. - * @param delta - * @param [order=yfiles.geometry.MatrixOrder.PREPEND] - */ - translate(delta:yfiles.geometry.Point,order?:yfiles.geometry.MatrixOrder):void; - /** - * Gets a new double[] of the elements describing the matrix. - *

- * The order is m11, m12, m21, m22, dx, dy. - *

- * @type {Array.} - */ - elements:number[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.geometry.Matrix; - } - /** - * A simple default implementation of a mutable point in 2D coordinate space with double precision coordinates. - *

- * This implementation stores the values of the coordinates in double precision floating point members. As a convenience it - * implements the {@link yfiles.lang.ICloneable} interface. - *

- * @see yfiles.geometry.IPoint - * @class - * @implements {yfiles.geometry.IMutablePoint} - * @implements {yfiles.lang.ICloneable} - * @final - */ - export interface MutablePoint extends yfiles.lang.Object,yfiles.geometry.IMutablePoint,yfiles.lang.ICloneable{} - export class MutablePoint { - /** - * Creates an instance using the given coordinate pair. - * @param x The x coordinate - * @param y The y coordinate - */ - constructor(x:number,y:number); - /** - * Creates an instance using the given coordinate pair. - * @param point The coordinate. - */ - constructor(point:yfiles.geometry.IPoint); - /** - * Creates the point with initially 0.0d values for {@link yfiles.geometry.MutablePoint#x} and {@link yfiles.geometry.MutablePoint#y}. - */ - constructor(); - /** - * Moves this instance by adding the provided offsets to the coordinates of this point. - * @param delta The offset to add to this point's x coordinate - */ - moveBy(delta:yfiles.geometry.Point):void; - /** - * Normalizes this point as if it was a vector. - *

- * After this the "length" of this point is 1.0d if it is treated as a vector. - *

- * @see yfiles.geometry.Point#normalized - */ - normalize():void; - /** - * Gets or sets the x coordinate. - * @type {number} - */ - x:number; - /** - * Gets or sets the y coordinate. - * @type {number} - */ - y:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.geometry.MutablePoint; - } - /** - * A simple default implementation of a mutable rectangle in 2D coordinate space with double precision values stored in an - * instance of {@link yfiles.geometry.IMutablePoint} and {@link yfiles.geometry.IMutableSize}. - *

- * This implementation delegates the storage to implementations of {@link yfiles.geometry.IMutablePoint} for the upper left corner - * of the rectangle and {@link yfiles.geometry.IMutableSize} for the size of the rectangle. members. As a convenience it implements - * the {@link yfiles.geometry.IOrientedRectangle}, and the {@link yfiles.lang.ICloneable} interfaces. - *

- * @see yfiles.geometry.IRectangle - * @see yfiles.geometry.IMutableRectangle - * @class - * @implements {yfiles.geometry.IMutableRectangle} - * @implements {yfiles.geometry.IOrientedRectangle} - * @implements {yfiles.lang.ICloneable} - * @final - */ - export interface MutableRectangle extends yfiles.lang.Object,yfiles.geometry.IMutableRectangle,yfiles.geometry.IOrientedRectangle,yfiles.lang.ICloneable{} - export class MutableRectangle { - /** - * Creates a new instance using the provided values to initialize the position and size. - *

- * An instance of {@link yfiles.geometry.MutablePoint} will be used to store the position and an instance of {@link yfiles.geometry.MutableRectangle#size} will be used to store - * the size. - *

- * @param x The x coordinate of the upper left corner of the rectangle. - * @param y The y coordinate of the upper left corner of the rectangle. - * @param width The width of the rectangle. - * @param height The height of the rectangle. - */ - constructor(x:number,y:number,width:number,height:number); - /** - * Creates a new instance using the provided values to initialize the position and size. - *

- * An instance of {@link yfiles.geometry.MutablePoint} will be used to store the position and an instance of {@link yfiles.geometry.MutableRectangle#size} will be used to store - * the size. - *

- * @param location The coordinates of the upper left corner of the rectangle. - * @param size The size of the rectangle. - */ - constructor(location:yfiles.geometry.Point,size:yfiles.geometry.Size); - /** - * Creates a new instance using the provided implementation for the storage of the position and size of the rectangle. - *

- * The instances provided will be referenced by this instance. This instance will be used as a live view over the provided - * instances. Changes to them will indirectly change the state of this instance and changes applied through this instance - * will be written to the referenced implementations. - *

- * @param location The provider for the dynamic position of this instance. - * @param size The provider for the dynamic size of this instance. - */ - constructor(location:yfiles.geometry.IMutablePoint,size:yfiles.geometry.IMutableSize); - /** - * Creates a new instance initialized to the values of the provided argument. - * @param rectangle - */ - constructor(rectangle:yfiles.geometry.IRectangle); - /** - * Creates a new empty instance located at the origin with width and height set to -1. - */ - constructor(); - /** - * Moves this rectangle by applying the offset to the {@link yfiles.geometry.MutableRectangle#location} - * @param delta The offset to move the rectangle's position by. - */ - moveBy(delta:yfiles.geometry.Point):void; - /** - * Gets whether this instance has negative width or height. - * @type {boolean} - */ - isEmpty:boolean; - /** - * Gets the position of this rectangle. - *

- * This will return a live view of the position of this rectangle. However setting a position instance will only copy the - * values of the point provided to the current position. - *

- * @type {yfiles.geometry.IPoint} - */ - location:yfiles.geometry.IPoint; - /** - * Gets the size of this rectangle. - *

- * This will return a live view of the size of this rectangle. However setting a size instance will only copy the values of - * the size provided to the current size. - *

- * @type {yfiles.geometry.ISize} - */ - size:yfiles.geometry.ISize; - /** - * Gets or sets the width of this instance from the {@link yfiles.geometry.MutableRectangle#size} instance. - *

- * Note that depending on the implementation used for holding the size the results may vary. However the default - * implementation will do just that: read and write the values without modifying them in any way. - *

- * @type {number} - */ - width:number; - /** - * Gets or sets the height of this instance from the {@link yfiles.geometry.MutableRectangle#size} instance. - *

- * Note that that depending on the implementation used for holding the size the results may vary. However the default - * implementation will do just that: read and write the values without modifying them in any way. - *

- * @type {number} - */ - height:number; - /** - * Gets or sets the x coordinate of the upper left corner of this instance from the {@link yfiles.geometry.MutableRectangle#location} instance. - *

- * Note that depending on the implementation used for holding the position the results may vary. However the default - * implementation will do just that: read and write the values without modifying them in any way. - *

- * @type {number} - */ - x:number; - /** - * Gets or sets the y coordinate of the upper left corner of this instance from the {@link yfiles.geometry.MutableRectangle#location} instance. - *

- * Note that depending on the implementation used for holding the position the results may vary. However the default - * implementation will do just that: read and write the values without modifying them in any way. - *

- * @type {number} - */ - y:number; - /** - * Gets or sets the x coordinate of the lower right corner of this instance using the {@link yfiles.geometry.MutableRectangle#location} and {@link yfiles.geometry.MutableRectangle#size} instances. - *

- * Setting this value will update the width accordingly. Note that depending on the implementation used for holding the {@link yfiles.geometry.MutableRectangle#size} - * the results may vary. However the default implementation will do just that: read and write the values without modifying - * them in any way. - *

- * @type {number} - */ - x2:number; - /** - * Gets or sets the y coordinate of the lower right corner of this instance using the {@link yfiles.geometry.MutableRectangle#location} and {@link yfiles.geometry.MutableRectangle#size} instances. - *

- * Setting this value will update the height accordingly. Note that depending on the implementation used for holding the {@link yfiles.geometry.MutableRectangle#size} - * the results may vary. However the default implementation will do just that: read and write the values without modifying - * them in any way. - *

- * @type {number} - */ - y2:number; - /** - * Gets the x coordinate of the {@link yfiles.geometry.MutableRectangle#location}. - *

- * This implementation behaves like an {@link yfiles.geometry.IOrientedRectangle} that is anchored at the lower left corner of this - * rectangle and whose up vector is (0, -1). - *

- * @type {number} - */ - anchorX:number; - /** - * Gets the y coordinate of the {@link yfiles.geometry.MutableRectangle#location} plus the {@link yfiles.geometry.ISize#height}. - *

- * This implementation behaves like an {@link yfiles.geometry.IOrientedRectangle} that is anchored at the lower left corner of this - * rectangle and whose up vector is (0, -1). - *

- * @type {number} - */ - anchorY:number; - /** - * Gets the x value of the up vector which is always 0 - *

- * This implementation behaves like an {@link yfiles.geometry.IOrientedRectangle} that is anchored at the lower left corner of this - * rectangle and whose up vector is (0, -1). - *

- * @type {number} - */ - upX:number; - /** - * Gets the y value of the up vector which is always -1 - *

- * This implementation behaves like an {@link yfiles.geometry.IOrientedRectangle} that is anchored at the lower left corner of this - * rectangle and whose up vector is (0, -1). - *

- * @type {number} - */ - upY:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.geometry.MutableRectangle; - } - /** - * A simple default implementation of a mutable size in 2D coordinate space with double precision values. - *

- * This implementation stores the values of the width and height in double precision floating point members. - *

- * @see yfiles.geometry.ISize - * @class - * @implements {yfiles.geometry.IMutableSize} - * @implements {yfiles.lang.ICloneable} - * @final - */ - export interface MutableSize extends yfiles.lang.Object,yfiles.geometry.IMutableSize,yfiles.lang.ICloneable{} - export class MutableSize { - /** - * Creates an instance using the given width and height. - * @param width The width. - * @param height The height - */ - constructor(width:number,height:number); - /** - * Creates an instance using the values provided by the size instance. - *

- * This will not create a dynamic instance. The values will be copied from size immediately and no reference is held to - * that instance thereafter. - *

- * @param size A size to retrieve the initial values from. - */ - constructor(size:yfiles.geometry.ISize); - /** - * Creates the initially empty size, that is both {@link yfiles.geometry.MutableSize#width} and {@link yfiles.geometry.MutableSize#height} are 0.0d. - */ - constructor(); - /** - * Gets or sets the width. - * @type {number} - */ - width:number; - /** - * Gets or sets the height. - * @type {number} - */ - height:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.geometry.MutableSize; - } - /** - * A simple default implementation of a mutable oriented rectangle in 2D coordinate space with double precision values - * stored in an instance of {@link yfiles.geometry.IMutablePoint} and {@link yfiles.geometry.IMutableSize} as well as two doubles for the - * up vector components. - *

- * This implementation delegates the storage to implementations of {@link yfiles.geometry.IMutablePoint} for the anchor of the - * oriented rectangle. and {@link yfiles.geometry.IMutableSize} for the size of the oriented rectangle. members. As a convenience - * it implements the {@link yfiles.geometry.IMutablePoint} and the {@link yfiles.lang.ICloneable} interfaces. - *

- * @see yfiles.geometry.IOrientedRectangle - * @see yfiles.geometry.IMutableOrientedRectangle - * @class - * @implements {yfiles.geometry.IMutablePoint} - * @implements {yfiles.geometry.IMutableOrientedRectangle} - * @implements {yfiles.lang.ICloneable} - * @final - */ - export interface OrientedRectangle extends yfiles.lang.Object,yfiles.geometry.IMutablePoint,yfiles.geometry.IMutableOrientedRectangle,yfiles.lang.ICloneable{} - export class OrientedRectangle { - /** - * Creates a new instance using the provided values to initialize the anchor and size. - *

- * The up vector will be initialized to - * (0, -1). The instances provided will be referenced by this instance. This instance will be used as a live view over the - * provided instances. Changes to them will indirectly change the state of this instance and changes applied through this - * instance will be written to the referenced implementations. - *

- * @param anchor The provider for the dynamic anchor of this instance. - * @param size The provider for the dynamic size of this instance. - */ - constructor(anchor:yfiles.geometry.IMutablePoint,size:yfiles.geometry.IMutableSize); - /** - * Creates a new instance using the provided values to initialize. - *

- * This will basically create a copy of the given rectangle - *

- * @param rectangle The rectangle to initialize the anchor and size and up vector from. - */ - constructor(rectangle:yfiles.geometry.IOrientedRectangle); - /** - * Creates a new instance using the provided rectangle to initialize the anchor and size. - *

- * The anchor will be set to the lower left corner of the provided rectangle. Thus this instance will have the exact same - * bounds as the rectangle initially. The up vector will be initialized to (0, -1). - *

- * @param rectangle The rectangle to initialize the anchor and size from. - */ - constructor(rectangle:yfiles.geometry.IRectangle); - /** - * Creates a new instance using the provided values to initialize the anchor and size. - *

- * It is up to the caller to ensure that the up vector is normalized. - *

- * @param anchorX The x coordinate of the anchor of the oriented rectangle. - * @param anchorY The y coordinate of the anchor of the oriented rectangle. - * @param width The width of the rectangle. - * @param height The height of the rectangle. - * @param [upX=0] The x component of the up vector. - * @param [upY=-1] The y component of the up vector. - */ - constructor(anchorX:number,anchorY:number,width:number,height:number,upX?:number,upY?:number); - /** - * Creates a new instance using the provided values to initialize the anchor and size. - *

- * It is up to the caller to ensure that the up vector is normalized. - *

- * @param {Object} options The parameters to pass. - * @param options.anchorX The x coordinate of the anchor of the oriented rectangle. - * @param options.anchorY The y coordinate of the anchor of the oriented rectangle. - * @param options.width The width of the rectangle. - * @param options.height The height of the rectangle. - * @param [options.upX=0] The x component of the up vector. - * @param [options.upY=-1] The y component of the up vector. - */ - constructor(options:{anchorX:number,anchorY:number,width:number,height:number,upX?:number,upY?:number}); - /** - * Initializes a new instance of the {@link yfiles.geometry.OrientedRectangle} class located at 0.0d,0.0d with empty width and - * height (-1.0d). - */ - constructor(); - /** - * A casting operator that creates a new instance of {@link yfiles.geometry.OrientedRectangle} using the current state of the - * rectangle that is cast. - *

- * The anchor will be set to the lower left corner of the provided rectangle. Thus this instance will have the exact same - * bounds as the rectangle initially. The up vector will be initialized to - * (0, -1). Unlike true casting this will create a new instance that will be initialized to the current state of the object - * being cast, but which will not stay in sync with the state of the object. - *

- * @param rect the rectangle to get the current state from - * @returns A new instance of {@link } that holds no reference to the provided rectangle. - * @static - */ - static convertFrom(rect:yfiles.geometry.MutableRectangle):yfiles.geometry.OrientedRectangle; - /** - * Creates an immutable {@link yfiles.geometry.IOrientedRectangle} with the given values. - * @param anchorX - * @param anchorY - * @param width - * @param height - * @param upX - * @param upY - * @returns - * @static - */ - static createImmutable(anchorX:number,anchorY:number,width:number,height:number,upX:number,upY:number):yfiles.geometry.IOrientedRectangle; - /** - * Moves this rectangle by applying the offset to the {@link yfiles.geometry.OrientedRectangle#anchor} - * @param delta The offset to move the rectangle's anchor by. - */ - moveBy(delta:yfiles.geometry.Point):void; - /** - * Applies the values provided by the given instance to the values of this instance. - * @param rectangle The instance to retrieve the values from. - */ - reshape(rectangle:yfiles.geometry.IOrientedRectangle):void; - /** - * Sets the components of the up vector to the new values. - *

- * It is up to the caller to assure that the values describe a vector of length 1. - *

- * @param upx The x component of the normalized up vector. - * @param upy The y component of the normalized up vector. - * @see yfiles.geometry.OrientedRectangle#angle - */ - setUpVector(upx:number,upy:number):void; - /** - * Gets whether this instance has negative width or height. - * @type {boolean} - */ - isEmpty:boolean; - /** - * Gets or sets the anchor of this oriented rectangle. - *

- * This will return a live view of the anchor of this rectangle. However setting an anchor instance will only copy the - * values of the point provided to the current anchor. - *

- * @type {yfiles.geometry.IPoint} - */ - anchor:yfiles.geometry.IPoint; - /** - * Gets or sets the size of this rectangle. - *

- * This will return a live view of the size of this rectangle. However setting a size instance will only copy the values of - * the size provided to the current size. - *

- * @type {yfiles.geometry.ISize} - */ - size:yfiles.geometry.ISize; - /** - * Gets or sets the width of this instance from the {@link yfiles.geometry.OrientedRectangle#size} instance. - *

- * Note that depending on the implementation used for holding the size the results may vary. However the default - * implementation will do just that: read and write the values without modifying them in any way. - *

- * @type {number} - */ - width:number; - /** - * Gets or sets the height of this instance from the {@link yfiles.geometry.OrientedRectangle#size} instance. - *

- * Note that that depending on the implementation used for holding the size the results may vary. However the default - * implementation will do just that: read and write the values without modifying them in any way. - *

- * @type {number} - */ - height:number; - /** - * Gets or sets the x coordinate of the anchor of this instance from the {@link yfiles.geometry.OrientedRectangle#anchor} instance. - *

- * Note that depending on the implementation used for holding the anchor the results may vary. However the default - * implementation will do just that: read and write the values without modifying them in any way. - *

- * @type {number} - */ - x:number; - /** - * Gets or sets the y coordinate of the anchor of this instance from the {@link yfiles.geometry.OrientedRectangle#anchor} instance. - *

- * Note that depending on the implementation used for holding the anchor the results may vary. However the default - * implementation will do just that: read and write the values without modifying them in any way. - *

- * @type {number} - */ - y:number; - /** - * Gets or sets the x coordinate of the anchor of this instance from the {@link yfiles.geometry.OrientedRectangle#anchor} instance. - *

- * Note that depending on the implementation used for holding the anchor the results may vary. However the default - * implementation will do just that: read and write the values without modifying them in any way. - *

- * @type {number} - */ - anchorX:number; - /** - * Gets or sets the y coordinate of the anchor of this instance from the {@link yfiles.geometry.OrientedRectangle#anchor} instance. - *

- * Note that depending on the implementation used for holding the anchor the results may vary. However the default - * implementation will do just that: read and write the values without modifying them in any way. - *

- * @type {number} - */ - anchorY:number; - /** - * Gets or sets the x component of the up vector to the new value. - *

- * It is up to the caller to assure that the values describe a vector of length 1. - *

- * @see yfiles.geometry.OrientedRectangle#angle - * @see yfiles.geometry.OrientedRectangle#setUpVector - * @see yfiles.geometry.OrientedRectangle#upY - * @type {number} - */ - upX:number; - /** - * Gets or sets the y component of the up vector to the new value. - *

- * It is up to the caller to assure that the values describe a vector of length 1. - *

- * @see yfiles.geometry.OrientedRectangle#angle - * @see yfiles.geometry.OrientedRectangle#setUpVector - * @see yfiles.geometry.OrientedRectangle#upX - * @type {number} - */ - upY:number; - /** - * Gets or sets the orientation of this rectangle. - *

- * The angle is specified in radians. An angle of 0 means the up vector points up in direction (0,-1). The angle value is - * not stored and will be recalculated from {@link yfiles.geometry.OrientedRectangle#upX} and {@link yfiles.geometry.OrientedRectangle#upY} every time this is invoked, so this is a costly method. Setting the angle - * changes the {@link yfiles.geometry.OrientedRectangle#upX} and {@link yfiles.geometry.OrientedRectangle#upY} values accordingly. - *

- * @type {number} - */ - angle:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.geometry.OrientedRectangle; - } - }export namespace styles{ - /** - * A default implementation of the {@link yfiles.styles.IArrow} interface that can render {@link yfiles.styles.ArrowType}s. - * @class - * @implements {yfiles.styles.IArrow} - * @implements {yfiles.lang.ICloneable} - * @final - */ - export interface Arrow extends yfiles.lang.Object,yfiles.styles.IArrow,yfiles.lang.ICloneable{} - export class Arrow { - /** - * Creates a new arrow with the given color to use for {@link yfiles.styles.Arrow#stroke} and brush. - *

- * The {@link yfiles.styles.Arrow#stroke} is created with thickness 1. - *

- * @param color The color to use for {@link #stroke} and brush. - */ - constructor(color:yfiles.view.Color); - /** - * Creates a new arrow with the given color to use for {@link yfiles.styles.Arrow#stroke} and brush. - *

- * The {@link yfiles.styles.Arrow#stroke} is created with thickness 1. - *

- * @param {Object} options The parameters to pass. - * @param options.color The color to use for {@link #stroke} and brush. - * @param {number} options.cropLength The cropping length associated with this instance. - *

- * This option sets the {@link yfiles.styles.Arrow#cropLength} property on the created object. - *

- * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.Arrow#stroke} of the outline of this arrow. - *

- * This option sets the {@link yfiles.styles.Arrow#stroke} property on the created object. - *

- * @param {number} options.scale The scale factor of this arrow. - *

- * This option sets the {@link yfiles.styles.Arrow#scale} property on the created object. - *

- * @param {yfiles.styles.ArrowType} options.type The type of this arrow. - *

- * This option sets the {@link yfiles.styles.Arrow#type} property on the created object. - *

- */ - constructor(options:{color:yfiles.view.Color,cropLength?:number,stroke?:yfiles.view.Stroke,scale?:number,type?:yfiles.styles.ArrowType}); - /** - * Creates a new arrow with default values for {@link yfiles.styles.Arrow#stroke} and brush. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.view.Fill} options.fill The {@link yfiles.styles.Arrow#fill} of the fill of this arrow. - *

- * This option sets the {@link yfiles.styles.Arrow#fill} property on the created object. - *

- * @param {number} options.cropLength The cropping length associated with this instance. - *

- * This option sets the {@link yfiles.styles.Arrow#cropLength} property on the created object. - *

- * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.Arrow#stroke} of the outline of this arrow. - *

- * This option sets the {@link yfiles.styles.Arrow#stroke} property on the created object. - *

- * @param {number} options.scale The scale factor of this arrow. - *

- * This option sets the {@link yfiles.styles.Arrow#scale} property on the created object. - *

- * @param {yfiles.styles.ArrowType} options.type The type of this arrow. - *

- * This option sets the {@link yfiles.styles.Arrow#type} property on the created object. - *

- */ - constructor(options?:{fill?:yfiles.view.Fill,cropLength?:number,stroke?:yfiles.view.Stroke,scale?:number,type?:yfiles.styles.ArrowType}); - /** - * Returns an immutable {@link yfiles.styles.IArrow} instance that uses the current properties. - * @returns An immutable instance - */ - asFrozen():yfiles.styles.IArrow; - /** - * Gets or sets the type of this arrow. - * @default yfiles.styles.ArrowType.DEFAULT - * @type {yfiles.styles.ArrowType} - */ - type:yfiles.styles.ArrowType; - /** - * Gets or sets the scale factor of this arrow. - *

- * The arrow bounds are scaled with this factor. - *

- * @default 1.0 - * @type {number} - */ - scale:number; - /** - * Gets or sets the {@link yfiles.styles.Arrow#stroke} of the outline of this arrow. - * @default null - * @type {yfiles.view.Stroke} - */ - stroke:yfiles.view.Stroke; - /** - * Gets or sets the {@link yfiles.styles.Arrow#fill} of the fill of this arrow. - * @default null - * @type {yfiles.view.Fill} - */ - fill:yfiles.view.Fill; - /** - * Gets the cropping length associated with this instance. - *

- * This value is used by {@link yfiles.styles.IEdgeStyle} implementations to let the edge appear to end shortly before its actual - * target. - *

- * @default 0.0 - * @type {number} - */ - cropLength:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.Arrow; - } - /** - * The default implementation of the {@link yfiles.styles.IEdgePathCropper}. - *

Related demos:

- *
    - *
  • Tutorial: 02 Custom Styles, step 18 Edge Cropping
  • - *
- * @class - * @implements {yfiles.styles.IEdgePathCropper} - */ - export interface DefaultEdgePathCropper extends yfiles.lang.Object,yfiles.styles.IEdgePathCropper{} - export class DefaultEdgePathCropper { - /** - * Calculates the total length the edge path is cropped. - *

- * This method can be overridden to change the length that is cropped from an edge. The default implementation returns the - * sum of {@link yfiles.styles.DefaultEdgePathCropper#extraCropLength}, {@link yfiles.styles.IArrow#length arrow length} and {@link yfiles.styles.IArrow#cropLength arrow crop length} - *

- * @param arrow The arrow at this edge end. - * @param atSource true if the crop length should be calculated at the edge source. false otherwise. - * @returns The total length the edge path is cropped. - * @see yfiles.styles.DefaultEdgePathCropper#cropEdgePath - * @see yfiles.styles.DefaultEdgePathCropper#cropEdgePathAtArrow - * @protected - */ - calculateTotalCropLength(arrow:yfiles.styles.IArrow,atSource:boolean):number; - /** - * Crops the provided path at one end of an edge. - *

- * If {@link yfiles.styles.DefaultEdgePathCropper#cropAtPort} is true this implementation delegates to {@link yfiles.styles.DefaultEdgePathCropper#cropEdgePathAtPortGeometry}. Otherwise - * the edge path is cropped at the {@link yfiles.styles.DefaultEdgePathCropper#getNodeGeometry node geometry}. If this would result in an empty path, the cropping is delegated to {@link yfiles.styles.DefaultEdgePathCropper#handleEmptyPath} - * instead. - *

- * @param edge The edge whose path is to be cropped. - * @param atSource Whether to crop the source or target side of the path. - * @param arrow The arrow that is used at the end of the edge. - * @param path The path to crop. - * @returns The cropped path. This is can be either the same instance of the given path or a newly created instance. - */ - cropEdgePath(edge:yfiles.graph.IEdge,atSource:boolean,arrow:yfiles.styles.IArrow,path:yfiles.geometry.GeneralPath):yfiles.geometry.GeneralPath; - /** - * Crops an edge's path at the source or target side with respect to the given arrow. - *

- * The path is cropped by the length {@link yfiles.styles.DefaultEdgePathCropper#calculateTotalCropLength} returns for arrow and - * atSource. - *

- * @param atSource if set to true the source side is cropped. - * @param arrow The arrow to consider for the cropping. - * @param path The edge's path to crop. - * @returns The cropped path. This is can be either the same instance of the given path or a newly created instance. - */ - cropEdgePathAtArrow(atSource:boolean,arrow:yfiles.styles.IArrow,path:yfiles.geometry.GeneralPath):yfiles.geometry.GeneralPath; - /** - * Crops an edge's path at the source or target side at the {@link yfiles.styles.DefaultEdgePathCropper#getPortGeometry port geometry} with respect to the given arrow. - * @param edge The edge whose path is to be cropped. - * @param atSource Whether to crop the source or target side of the path. - * @param arrow The arrow that is used at the end of the edge. - * @param path The path to crop. - * @returns The cropped path. This is can be either the same instance of the given path or a newly created instance. - * @protected - */ - cropEdgePathAtPortGeometry(edge:yfiles.graph.IEdge,atSource:boolean,arrow:yfiles.styles.IArrow,path:yfiles.geometry.GeneralPath):yfiles.geometry.GeneralPath; - /** - * Finds the intersection between a node and the edge. - * @param node - * @param nodeShapeGeometry - * @param edge - * @param inner - * @param outer - * @returns - * @protected - */ - getIntersection(node:yfiles.graph.INode,nodeShapeGeometry:yfiles.styles.IShapeGeometry,edge:yfiles.graph.IEdge,inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Returns the {@link yfiles.styles.IShapeGeometry geometry} that is used to crop the edge at the node outline. - *

- * The default implementation queries the {@link yfiles.styles.INodeStyleRenderer#getShapeGeometry node style renderer} for an implementation of {@link yfiles.styles.IShapeGeometry}. This - * method can be overridden to return an arbitrary {@link yfiles.styles.IShapeGeometry geometry} for a node. - *

- * @param node The node the edge should be cropped at. - * @returns The {@link geometry} of the node. - * @protected - */ - getNodeGeometry(node:yfiles.graph.INode):yfiles.styles.IShapeGeometry; - /** - * Returns the {@link yfiles.styles.IShapeGeometry geometry} that is used to crop the edge at the port outline if {@link yfiles.styles.DefaultEdgePathCropper#cropAtPort} is set to true. - *

- * The default implementation returns null. This method can be overridden to return an arbitrary {@link yfiles.styles.IShapeGeometry geometry} for a port. - *

- * @param port The port the edge should be cropped at. - * @returns The {@link geometry} of the port. - * @see yfiles.styles.DefaultEdgePathCropper#cropAtPort - * @protected - */ - getPortGeometry(port:yfiles.graph.IPort):yfiles.styles.IShapeGeometry; - /** - * Handles the edge path cropping if {@link yfiles.styles.DefaultEdgePathCropper#cropEdgePath} would result in a {@link yfiles.geometry.GeneralPath#clear cleared} path. - *

- * This method is called by {@link yfiles.styles.DefaultEdgePathCropper#cropEdgePath} if {@link yfiles.styles.DefaultEdgePathCropper#cropAtPort} is false and cropping the edge path at - * the {@link yfiles.styles.DefaultEdgePathCropper#getNodeGeometry node geometry} would result in an empty path. - *

- *

- * The default implementation is to {@link yfiles.geometry.GeneralPath#clear} the edge path. - *

- * @param edge The edge whose path is to be cropped. - * @param atSource Whether to crop the source or target side of the path. - * @param arrow The arrow that is used at the end of the edge. - * @param path The path to crop. - * @returns The cropped path. This is can be either the same instance of the given path or a newly created instance. - * @protected - */ - handleEmptyPath(edge:yfiles.graph.IEdge,atSource:boolean,arrow:yfiles.styles.IArrow,path:yfiles.geometry.GeneralPath):yfiles.geometry.GeneralPath; - /** - * Checks whether a given point is inside a node's shape geometry with respect to the edge that is being calculated. - * @param location - * @param node - * @param nodeShapeGeometry - * @param edge - * @returns - * @protected - */ - isInside(location:yfiles.geometry.Point,node:yfiles.graph.INode,nodeShapeGeometry:yfiles.styles.IShapeGeometry,edge:yfiles.graph.IEdge):boolean; - /** - * A singleton instance. - *

- * Note that this is an immutable instance that cannot be cast to the {@link yfiles.styles.DefaultEdgePathCropper} type. - *

- * @const - * @static - * @type {yfiles.styles.IEdgePathCropper} - */ - static INSTANCE:yfiles.styles.IEdgePathCropper; - /** - * Gets or sets an extra length the edge is cropped. - *

- * The default value is 0. - *

- * @type {number} - */ - extraCropLength:number; - /** - * Gets the value that determines if the edge path is cropped at the port or at the node bounds. - *

- * The default is false. - *

- * @type {boolean} - */ - cropAtPort:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.DefaultEdgePathCropper; - } - /** - * The interface for the visual representation of an arrow that is normally used to decorate the visual representation of - * an {@link yfiles.graph.IEdge}. - *

- * Instances of this class are used by {@link yfiles.styles.IEdgeStyle} implementations. - *

- *

Related demos:

- *
    - *
  • Tutorial: 02 Custom Styles, step 20 Custom Arrow
  • - *
  • Tutorial: 02 Custom Styles, step 21 Arrow Thickness
  • - *
- * @interface - */ - export interface IArrow extends yfiles.lang.Object{ - /** - * Gets an {@link yfiles.view.IBoundsProvider} implementation that can yield this arrow's bounds if painted at the given location - * using the given direction for the given edge. - * @param edge the edge this arrow belongs to - * @param atSource whether this will be the source arrow - * @param anchor the anchor point for the tip of the arrow - * @param directionVector the direction the arrow is pointing in - * @returns an implementation of the {@link } interface that can subsequently be used to query the bounds. - * Clients will always call this method before using the implementation and may not cache the instance returned. This - * allows for applying the flyweight design pattern to implementations. - * @abstract - */ - getBoundsProvider(edge:yfiles.graph.IEdge,atSource:boolean,anchor:yfiles.geometry.Point,directionVector:yfiles.geometry.Point):yfiles.view.IBoundsProvider; - /** - * Gets an {@link yfiles.view.IVisualCreator} implementation that will paint this arrow at the given location using the given - * direction for the given edge. - * @param edge the edge this arrow belongs to - * @param atSource whether this will be the source arrow - * @param anchor the anchor point for the tip of the arrow - * @param direction the direction the arrow is pointing in - * @returns an implementation of the {@link } interface that can subsequently be used to perform the actual - * painting. Clients will always call this method before using the implementation and may not cache the instance returned. - * This allows for applying the flyweight design pattern to implementations. - * @abstract - */ - getVisualCreator(edge:yfiles.graph.IEdge,atSource:boolean,anchor:yfiles.geometry.Point,direction:yfiles.geometry.Point):yfiles.view.IVisualCreator; - /** - * Gets the length of the arrow (the distance from the arrow's tip to the position where the visual representation of the - * edge's path should begin). - * @abstract - * @type {number} - */ - length:number; - /** - * Gets the cropping length associated with this instance. - *

- * This value is used by {@link yfiles.styles.IEdgeStyle} implementations to let the edge appear to end shortly before its actual - * target. - *

- * @abstract - * @type {number} - */ - cropLength:number; - } - var IArrow:{ - /** - * A singleton {@link yfiles.styles.IArrow} instance that paints no arrow at all. - * @const - * @static - * @type {yfiles.styles.IArrow} - */ - NONE?:yfiles.styles.IArrow; - /** - * A singleton {@link yfiles.styles.IArrow} instance that paints a simple black arrow. - * @const - * @static - * @type {yfiles.styles.IArrow} - */ - SIMPLE?:yfiles.styles.IArrow; - /** - * A singleton {@link yfiles.styles.IArrow} instance that paints a default shaped black arrow. - * @const - * @static - * @type {yfiles.styles.IArrow} - */ - DEFAULT?:yfiles.styles.IArrow; - /** - * A singleton {@link yfiles.styles.IArrow} instance that paints a short black arrow. - * @const - * @static - * @type {yfiles.styles.IArrow} - */ - SHORT?:yfiles.styles.IArrow; - /** - * A singleton {@link yfiles.styles.IArrow} instance that paints a simple diamond-shaped black arrow. - * @const - * @static - * @type {yfiles.styles.IArrow} - */ - DIAMOND?:yfiles.styles.IArrow; - /** - * A singleton {@link yfiles.styles.IArrow} instance that paints a simple cross-shaped black arrow. - * @const - * @static - * @type {yfiles.styles.IArrow} - */ - CROSS?:yfiles.styles.IArrow; - /** - * A singleton {@link yfiles.styles.IArrow} instance that paints a simple circle-shaped black arrow. - * @const - * @static - * @type {yfiles.styles.IArrow} - */ - CIRCLE?:yfiles.styles.IArrow; - /** - * A singleton {@link yfiles.styles.IArrow} instance that paints a simple triangle-shaped black arrow. - * @const - * @static - * @type {yfiles.styles.IArrow} - */ - TRIANGLE?:yfiles.styles.IArrow; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.styles.IArrow; - }; - /** - * A void implementation of an edge style that does nothing and behaves like an invisible style. - *

- * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidEdgeStyle#INSTANCE} of this class - * instead of null where null is not allowed. For example you cannot assign null to the {@link yfiles.graph.IEdge#style} property of an - * {@link yfiles.graph.IEdge}. - *

- * @class - * @implements {yfiles.styles.IEdgeStyle} - * @final - */ - export interface VoidEdgeStyle extends yfiles.lang.Object,yfiles.styles.IEdgeStyle{} - export class VoidEdgeStyle { - /** - * Returns this. - * @returns this - */ - clone():any; - /** - * The {@link yfiles.styles.VoidEdgeStyle} singleton. - * @const - * @static - * @type {yfiles.styles.VoidEdgeStyle} - */ - static INSTANCE:yfiles.styles.VoidEdgeStyle; - /** - * Gets the {@link yfiles.styles.VoidEdgeStyleRenderer#INSTANCE VoidEdgeStyleRenderer instance}. - * @see yfiles.styles.IEdgeStyle#renderer - * @type {yfiles.styles.IEdgeStyleRenderer} - */ - renderer:yfiles.styles.IEdgeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.VoidEdgeStyle; - } - /** - * A void implementation of an edge style renderer that does nothing. - *

- * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidEdgeStyleRenderer#INSTANCE} of this - * class instead of null where null is not allowed. For example you cannot assign null to the {@link yfiles.styles.IEdgeStyle#renderer} property of an - * {@link yfiles.styles.IEdgeStyle}. - *

- * @class - * @implements {yfiles.styles.IEdgeStyleRenderer} - * @final - */ - export interface VoidEdgeStyleRenderer extends yfiles.lang.Object,yfiles.styles.IEdgeStyleRenderer{} - export class VoidEdgeStyleRenderer { - /** - * Yields the {@link yfiles.view.IBoundsProvider#EMPTY} that will return empty bounds. - * @param edge - * @param style - * @returns - */ - getBoundsProvider(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.view.IBoundsProvider; - /** - * Yields the {@link yfiles.graph.ILookup#EMPTY} that will not yield anything. - * @param edge - * @param style - * @returns - */ - getContext(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.graph.ILookup; - /** - * Yields the {@link yfiles.input.IHitTestable#NEVER} that will always report misses. - * @param edge - * @param style - * @returns - */ - getHitTestable(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.input.IHitTestable; - /** - * Yields the {@link yfiles.input.IMarqueeTestable#NEVER} that will always report misses. - * @param edge - * @param style - * @returns - */ - getMarqueeTestable(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.input.IMarqueeTestable; - /** - * This method always returns the {@link yfiles.styles.VoidPathGeometry#INSTANCE VoidPathGeometry instance}. - * @param edge The edge to provide an instance for - * @param style The style to use for the rendering - * @returns The {@link #INSTANCE VoidPathGeometry instance}. - * @see yfiles.styles.IEdgeStyleRenderer#getPathGeometry - */ - getPathGeometry(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.styles.IPathGeometry; - /** - * Yields the {@link yfiles.view.IVisibilityTestable#NEVER} that will always claim invisibility. - * @param edge - * @param style - * @returns - */ - getVisibilityTestable(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.view.IVisibilityTestable; - /** - * Yields the {@link yfiles.view.VoidVisualCreator#INSTANCE} that will do nothing. - * @param edge - * @param style - * @returns - */ - getVisualCreator(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.view.IVisualCreator; - /** - * The {@link yfiles.styles.VoidEdgeStyleRenderer} singleton. - * @const - * @static - * @type {yfiles.styles.IEdgeStyleRenderer} - */ - static INSTANCE:yfiles.styles.IEdgeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.VoidEdgeStyleRenderer; - } - /** - * A void implementation of the {@link yfiles.styles.IPathGeometry} interface that does nothing and behaves like an empty path. - *

- * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidPathGeometry#INSTANCE} of this class - * instead of null were null is not allowed. The {@link yfiles.styles.VoidEdgeStyleRenderer} does so for example. - *

- * @class - * @implements {yfiles.styles.IPathGeometry} - * @final - */ - export interface VoidPathGeometry extends yfiles.lang.Object,yfiles.styles.IPathGeometry{} - export class VoidPathGeometry { - /** - * The {@link yfiles.styles.VoidPathGeometry} singleton. - * @const - * @static - * @type {yfiles.styles.IPathGeometry} - */ - static INSTANCE:yfiles.styles.IPathGeometry; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.VoidPathGeometry; - } - /** - * Style implementation for {@link yfiles.graph.IEdge} instances in an {@link yfiles.graph.IGraph}. - *

- * Implementations are responsible for rendering {@link yfiles.graph.IEdge} instances in a {@link yfiles.view.CanvasComponent}. It is up to - * the implementation to interpret the visual appearance of an edge. The framework uses the associated, possibly shared {@link yfiles.styles.IEdgeStyle#renderer} to - * perform the actual rendering of this style for a given edge. This interface extends the {@link yfiles.lang.ICloneable} - * interface. This allows clients to obtain a persistent copy of the current state of this style. Immutable style - * implementations may return themselves. - *

- *

- * Working with styles (and their style renderers) is explained in detail in the section {@link @DGUIDE_PREFIX@/view_visualization-graph-elements.html Visualization of Graph Elements}. - *

- *

Related demos:

- *
    - *
  • Demo: SimpleCustomStyle, demo.yfiles.style.simplecustomstyle
  • - *
  • Tutorial: 02 Custom Styles, step 16 Custom Edge Style
  • - *
- * @interface - * @implements {yfiles.lang.ICloneable} - */ - export interface IEdgeStyle extends yfiles.lang.Object,yfiles.lang.ICloneable{ - /** - * Gets the renderer implementation that can be queried for implementations that provide details about the visual - * appearance and visual behavior for a given edge and this style instance. - *

- * The idiom for retrieving, e.g. an {@link yfiles.view.IVisualCreator} implementation for a given style is: - *

- * @abstract - * @type {yfiles.styles.IEdgeStyleRenderer} - */ - renderer:yfiles.styles.IEdgeStyleRenderer; - } - var IEdgeStyle:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.styles.IEdgeStyle; - }; - /** - * Interface used by {@link yfiles.styles.IEdgeStyle} implementations that can be used to query the actual - * {@link yfiles.view.IVisualCreator}, {@link yfiles.view.IVisibilityTestable}, {@link yfiles.view.IBoundsProvider}, {@link yfiles.input.IHitTestable}, and - * {@link yfiles.input.IMarqueeTestable} implementations for an edge and an associated style. - *

- * Implementations of this interface should be designed to be sharable between multiple style instances and should - * therefore not contain style specific state. - *

- * @see yfiles.styles.IEdgeStyle - * @see yfiles.graph.IEdge - * @see yfiles.styles.INodeStyleRenderer - * @see yfiles.styles.ILabelStyleRenderer - * @see yfiles.styles.IPortStyleRenderer - * @interface - */ - export interface IEdgeStyleRenderer extends yfiles.lang.Object{ - /** - * Gets an implementation of the {@link yfiles.view.IBoundsProvider} interface that can handle the provided edge and its associated - * style. - *

- * This method may return a flyweight implementation. - *

- * @param edge The edge to provide an instance for - * @param style The style to use for the calculating the painting bounds - * @returns An implementation that may be used to subsequently query the edge's painting bounds. Clients should not cache this - * instance and must always call this method immediately before using the value returned. This enables the use of the - * flyweight design pattern for implementations - * @abstract - */ - getBoundsProvider(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.view.IBoundsProvider; - /** - * Gets a temporary context instance that can be used to query additional information for the edge's style. - *

- * Implementations may return {@link yfiles.graph.ILookup#EMPTY} if they don't support this, but may not return null. - *

- * @param edge The edge to provide a context instance for. - * @param style The style to use for the context. - * @returns An non-null lookup implementation. - * @see yfiles.graph.ILookup#EMPTY - * @see yfiles.graph.ILookup - * @abstract - */ - getContext(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.graph.ILookup; - /** - * Gets an implementation of the {@link yfiles.input.IHitTestable} interface that can handle the provided edge and its associated - * style. - *

- * This method may return a flyweight implementation. - *

- * @param edge The edge to provide an instance for - * @param style The style to use for the querying hit tests - * @returns An implementation that may be used to subsequently perform hit tests. Clients should not cache this instance and must - * always call this method immediately before using the value returned. This enables the use of the flyweight design - * pattern for implementations. This method may return null to indicate that the edge cannot be hit tested. - * @abstract - */ - getHitTestable(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.input.IHitTestable; - /** - * Gets an implementation of the {@link yfiles.input.IMarqueeTestable} interface that can handle the provided edge and its - * associated style. - *

- * This method may return a flyweight implementation. - *

- * @param edge The edge to provide an instance for - * @param style The style to use for the querying marquee intersection test. - * @returns An implementation that may be used to subsequently query the marquee intersections. Clients should not cache this - * instance and must always call this method immediately before using the value returned. This enables the use of the - * flyweight design pattern for implementations - * @abstract - */ - getMarqueeTestable(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.input.IMarqueeTestable; - /** - * Gets an implementation of the {@link yfiles.styles.IPathGeometry} interface that can handle the provided edge and its associated - * style. - *

- * This method may return a flyweight implementation. - *

- * @param edge The edge to provide an instance for - * @param style The style to use for the rendering - * @returns An implementation that may be used to subsequently query geometry information from. Clients should not cache this - * instance and must always call this method immediately before using the value returned. This enables the use of the - * flyweight design pattern for implementations - * @abstract - */ - getPathGeometry(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.styles.IPathGeometry; - /** - * Gets an implementation of the {@link yfiles.view.IVisibilityTestable} interface that can handle the provided edge and its - * associated style. - *

- * This method may return a flyweight implementation. - *

- * @param edge The edge to provide an instance for - * @param style The style to use for the testing the visibility - * @returns An implementation that may be used to subsequently query the edge's visibility. Clients should not cache this instance - * and must always call this method immediately before using the value returned. This enables the use of the flyweight - * design pattern for implementations - * @abstract - */ - getVisibilityTestable(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.view.IVisibilityTestable; - /** - * Gets an implementation of the {@link yfiles.view.IVisualCreator} interface that can handle the provided edge and its associated - * style. - *

- * This method may return a flyweight implementation, but never null. - *

- * @param edge The edge to provide an instance for - * @param style The style to use for the creation of the visual - * @returns An implementation that may be used to subsequently create or update the visual for the edge. Clients should not cache - * this instance and must always call this method immediately before using the value returned. This enables the use of the - * flyweight design pattern for implementations. This method may not return null but should yield a {@link #INSTANCE void} implementation - * instead. - * @see yfiles.view.VoidVisualCreator#INSTANCE - * @abstract - */ - getVisualCreator(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.view.IVisualCreator; - } - var IEdgeStyleRenderer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.styles.IEdgeStyleRenderer; - }; - export enum ArrowType{ - /** - * Default arrow - */ - DEFAULT, - /** - * Simple arrow - */ - SIMPLE, - /** - * Short arrow - */ - SHORT, - /** - * Diamond shaped arrow - */ - DIAMOND, - /** - * No arrow - */ - NONE, - /** - * Circular shaped arrow - */ - CIRCLE, - /** - * Cross shaped arrow - */ - CROSS, - /** - * Triangular shaped arrow - */ - TRIANGLE - } - /** - * Interface used by the framework mainly for calculating the visible path of an edge. - *

- * This interface is queried through the {@link yfiles.graph.ILookup#lookup} of {@link yfiles.graph.IPort} instances to calculate the - * visible portion of an edge path. - *

- *

Related demos:

- *
    - *
  • Tutorial: 02 Custom Styles, step 18 Edge Cropping
  • - *
- * @interface - */ - export interface IEdgePathCropper extends yfiles.lang.Object{ - /** - * Crops the provided path at one end of an edge. - * @param edge The edge whose path is to be cropped. - * @param atSource Whether to crop the source or target side of the path. - * @param arrow The arrow that is used at the end of the edge. - * @param path The path to crop. - * @returns The cropped path. This is can be either the same instance of the given path or a newly created instance. - * @abstract - */ - cropEdgePath(edge:yfiles.graph.IEdge,atSource:boolean,arrow:yfiles.styles.IArrow,path:yfiles.geometry.GeneralPath):yfiles.geometry.GeneralPath; - } - var IEdgePathCropper:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.styles.IEdgePathCropper; - }; - /** - * A void implementation of a label style that does nothing and behaves like an invisible style. - *

- * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidLabelStyle#INSTANCE} of this class - * instead of null where null is not allowed. For example you cannot assign null to the {@link yfiles.graph.ILabel#style} property of an - * {@link yfiles.graph.ILabel}. - *

- * @class - * @implements {yfiles.styles.ILabelStyle} - * @final - */ - export interface VoidLabelStyle extends yfiles.lang.Object,yfiles.styles.ILabelStyle{} - export class VoidLabelStyle { - /** - * Returns this. - * @returns this - */ - clone():any; - /** - * The singleton instance of this style. - * @const - * @static - * @type {yfiles.styles.VoidLabelStyle} - */ - static INSTANCE:yfiles.styles.VoidLabelStyle; - /** - * Gets the {@link yfiles.styles.VoidLabelStyleRenderer#INSTANCE VoidLabelStyleRenderer instance}. - * @see yfiles.styles.ILabelStyle#renderer - * @type {yfiles.styles.ILabelStyleRenderer} - */ - renderer:yfiles.styles.ILabelStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.VoidLabelStyle; - } - /** - * A void implementation of a label style renderer that does nothing. - *

- * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidLabelStyleRenderer#INSTANCE} of this - * class instead of null where null is not allowed. For example you cannot assign null to the {@link yfiles.styles.ILabelStyle#renderer} property of an - * {@link yfiles.styles.ILabelStyle}. - *

- * @class - * @implements {yfiles.styles.ILabelStyleRenderer} - * @final - */ - export interface VoidLabelStyleRenderer extends yfiles.lang.Object,yfiles.styles.ILabelStyleRenderer{} - export class VoidLabelStyleRenderer { - /** - * Yields the {@link yfiles.view.IBoundsProvider#EMPTY} that will return empty bounds. - * @param label - * @param style - * @returns - */ - getBoundsProvider(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IBoundsProvider; - /** - * Yields the {@link yfiles.graph.ILookup#EMPTY} that will not yield anything. - * @param label - * @param style - * @returns - */ - getContext(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.graph.ILookup; - /** - * Yields the {@link yfiles.input.IHitTestable#NEVER} that will always report misses. - * @param label - * @param style - * @returns - */ - getHitTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IHitTestable; - /** - * Yields the {@link yfiles.input.IMarqueeTestable#NEVER} that will always report misses. - * @param label - * @param style - * @returns - */ - getMarqueeTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IMarqueeTestable; - /** - * Yields {@link yfiles.geometry.Size#EMPTY}. - * @param label - * @param style - * @returns - */ - getPreferredSize(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.geometry.Size; - /** - * Yields the {@link yfiles.view.IVisibilityTestable#NEVER} that will always claim invisibility. - * @param label - * @param style - * @returns - */ - getVisibilityTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisibilityTestable; - /** - * Yields the {@link yfiles.view.VoidVisualCreator#INSTANCE} that will do nothing. - * @param label - * @param style - * @returns - */ - getVisualCreator(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisualCreator; - /** - * The singleton instance of this renderer. - * @const - * @static - * @type {yfiles.styles.ILabelStyleRenderer} - */ - static INSTANCE:yfiles.styles.ILabelStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.VoidLabelStyleRenderer; - } - /** - * Style implementation for {@link yfiles.graph.ILabel} instances in an {@link yfiles.graph.IGraph}. - *

- * Implementations are responsible for rendering {@link yfiles.graph.ILabel} instances in a {@link yfiles.view.CanvasComponent}. It is up - * to the implementation to interpret the visual appearance of a label. The framework uses the associated, possibly shared - * {@link yfiles.styles.ILabelStyle#renderer} to perform the actual rendering of this style for a given label. This interface extends the {@link yfiles.lang.ICloneable} - * interface. This allows clients to obtain a persistent copy of the current state of this style. Immutable style - * implementations may return themselves. - *

- *

- * Working with styles (and their style renderers) is explained in detail in the section {@link @DGUIDE_PREFIX@/view_visualization-graph-elements.html Visualization of Graph Elements}. - *

- *

Related demos:

- *
    - *
  • Demo: SimpleCustomStyle, demo.yfiles.style.simplecustomstyle
  • - *
  • Tutorial: 02 Custom Styles, step 10 Custom Label Style
  • - *
- * @interface - * @implements {yfiles.lang.ICloneable} - */ - export interface ILabelStyle extends yfiles.lang.Object,yfiles.lang.ICloneable{ - /** - * Gets the renderer implementation that can be queried for implementations that provide details about the visual - * appearance and visual behavior for a given label and this style instance. - *

- * The idiom for retrieving, e.g. an {@link yfiles.view.IVisualCreator} implementation for a given style is: - *

- * @abstract - * @type {yfiles.styles.ILabelStyleRenderer} - */ - renderer:yfiles.styles.ILabelStyleRenderer; - } - var ILabelStyle:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.styles.ILabelStyle; - }; - /** - * Interface used by {@link yfiles.styles.ILabelStyle} implementations to query the actual {@link yfiles.view.IVisualCreator}, - * {@link yfiles.view.IVisibilityTestable}, {@link yfiles.view.IBoundsProvider}, {@link yfiles.input.IHitTestable}, and {@link yfiles.input.IMarqueeTestable} - * implementations for a label and an associated style. - *

- * Implementations of this interface should be designed to be sharable between multiple style instances and should - * therefore not contain style specific state. - *

- * @see yfiles.styles.ILabelStyle - * @see yfiles.graph.ILabel - * @see yfiles.styles.INodeStyleRenderer - * @see yfiles.styles.IEdgeStyleRenderer - * @see yfiles.styles.IPortStyleRenderer - * @interface - */ - export interface ILabelStyleRenderer extends yfiles.lang.Object{ - /** - * Gets an implementation of the {@link yfiles.view.IBoundsProvider} interface that can handle the provided label and its - * associated style. - *

- * This method may return a flyweight implementation. - *

- * @param label The label to provide an instance for - * @param style The style to use for the calculating the painting bounds - * @returns An implementation that may be used to subsequently query the label's painting bounds. Clients should not cache this - * instance and must always call this method immediately before using the value returned. This enables the use of the - * flyweight design pattern for implementations - * @abstract - */ - getBoundsProvider(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IBoundsProvider; - /** - * Gets a temporary context instance that can be used to query additional information for the label's style. - *

- * Implementations may return {@link yfiles.graph.ILookup#EMPTY} if they don't support this, but may not return null. - *

- * @param label The label to provide a context instance for. - * @param style The style to use for the context. - * @returns An non-null lookup implementation. - * @see yfiles.graph.ILookup#EMPTY - * @see yfiles.graph.ILookup - * @abstract - */ - getContext(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.graph.ILookup; - /** - * Gets an implementation of the {@link yfiles.input.IHitTestable} interface that can handle the provided label and its associated - * style. - *

- * This method may return a flyweight implementation. - *

- * @param label The label to provide an instance for - * @param style The style to use for the querying hit tests - * @returns An implementation that may be used to subsequently perform hit tests. Clients should not cache this instance and must - * always call this method immediately before using the value returned. This enables the use of the flyweight design - * pattern for implementations. This method may return null to indicate that the label cannot be hit tested. - * @abstract - */ - getHitTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IHitTestable; - /** - * Gets an implementation of the {@link yfiles.input.IMarqueeTestable} interface that can handle the provided label and its - * associated style. - *

- * This method may return a flyweight implementation. - *

- * @param label The label to provide an instance for - * @param style The style to use for the querying marquee intersection test. - * @returns An implementation that may be used to subsequently query the marquee intersections. Clients should not cache this - * instance and must always call this method immediately before using the value returned. This enables the use of the - * flyweight design pattern for implementations - * @abstract - */ - getMarqueeTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IMarqueeTestable; - /** - * Calculates the {@link yfiles.graph.ILabel#preferredSize preferred size} of a given label using the associated style. - * @param label The label to determine the preferred size for - * @param style The style instance that uses this instance as its {@link #renderer} - * @returns A size that can be used as the {@link #preferredSize} if this renderer renders the label using the associated style. - * @abstract - */ - getPreferredSize(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.geometry.Size; - /** - * Gets an implementation of the {@link yfiles.view.IVisibilityTestable} interface that can handle the provided label and its - * associated style. - *

- * This method may return a flyweight implementation. - *

- * @param label The label to provide an instance for - * @param style The style to use for the testing the visibility - * @returns An implementation that may be used to subsequently query the label's visibility. Clients should not cache this instance - * and must always call this method immediately before using the value returned. This enables the use of the flyweight - * design pattern for implementations - * @abstract - */ - getVisibilityTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisibilityTestable; - /** - * Gets an implementation of the {@link yfiles.view.IVisualCreator} interface that can handle the provided label and its associated - * style. - *

- * This method may return a flyweight implementation, but never null. - *

- * @param label The label to provide an instance for - * @param style The style to use for the creation of the visual - * @returns An implementation that may be used to subsequently create or update the visual for the label. Clients should not cache - * this instance and must always call this method immediately before using the value returned. This enables the use of the - * flyweight design pattern for implementations. This method may not return null but should yield a {@link #INSTANCE void} implementation - * instead. - * @see yfiles.view.VoidVisualCreator#INSTANCE - * @abstract - */ - getVisualCreator(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisualCreator; - } - var ILabelStyleRenderer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.styles.ILabelStyleRenderer; - }; - /** - * A void implementation of the {@link yfiles.styles.IShapeGeometry} interface that does nothing and behaves like an empty - * geometry. - *

- * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidShapeGeometry#INSTANCE} of this - * class instead of null were null is not allowed. The {@link yfiles.styles.VoidNodeStyleRenderer} does so for example. - *

- * @class - * @implements {yfiles.styles.IShapeGeometry} - * @final - */ - export interface VoidShapeGeometry extends yfiles.lang.Object,yfiles.styles.IShapeGeometry{} - export class VoidShapeGeometry { - /** - * This implementation always returns null (a {@link T} with no value). - * @param inner The first point of the line that is inside the shape. - * @param outer The second point of the line that is outside the shape. - * @returns A {@link } with no value. - * @see yfiles.styles.IShapeGeometry#getIntersection - */ - getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * This implementation returns an empty path. - *

- * This means that the outline never intersects any line or contains any point. - *

- * @returns The empty path. - * @see yfiles.styles.IShapeGeometry#getOutline - */ - getOutline():yfiles.geometry.GeneralPath; - /** - * This implementation always returns false. - * @param location The point to test. - * @returns false - * @see yfiles.styles.IShapeGeometry#isInside - */ - isInside(location:yfiles.geometry.Point):boolean; - /** - * The {@link yfiles.styles.VoidShapeGeometry} singleton. - * @const - * @static - * @type {yfiles.styles.IShapeGeometry} - */ - static INSTANCE:yfiles.styles.IShapeGeometry; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.VoidShapeGeometry; - } - /** - * A void implementation of a node style that does nothing and behaves like an invisible style. - *

- * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidNodeStyle#INSTANCE} of this class - * instead of null where null is not allowed. For example you cannot assign null to the {@link yfiles.graph.INode#style} property of an - * {@link yfiles.graph.INode}. - *

- * @class - * @implements {yfiles.styles.INodeStyle} - * @final - */ - export interface VoidNodeStyle extends yfiles.lang.Object,yfiles.styles.INodeStyle{} - export class VoidNodeStyle { - /** - * Returns this. - * @returns this - */ - clone():any; - /** - * The {@link yfiles.styles.VoidNodeStyle} singleton. - * @const - * @static - * @type {yfiles.styles.VoidNodeStyle} - */ - static INSTANCE:yfiles.styles.VoidNodeStyle; - /** - * Gets the {@link yfiles.styles.VoidNodeStyleRenderer#INSTANCE VoidNodeStyleRenderer instance}. - * @see yfiles.styles.INodeStyle#renderer - * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.VoidNodeStyle; - } - /** - * A void implementation of a node style renderer that does nothing. - *

- * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidNodeStyleRenderer#INSTANCE} of this - * class instead of null where null is not allowed. For example you cannot assign null to the {@link yfiles.styles.INodeStyle#renderer} property of an - * {@link yfiles.styles.INodeStyle}. - *

- * @class - * @implements {yfiles.styles.INodeStyleRenderer} - * @final - */ - export interface VoidNodeStyleRenderer extends yfiles.lang.Object,yfiles.styles.INodeStyleRenderer{} - export class VoidNodeStyleRenderer { - /** - * Yields the {@link yfiles.view.IBoundsProvider#EMPTY} that will return empty bounds. - * @param node - * @param style - * @returns - */ - getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; - /** - * Yields the {@link yfiles.graph.ILookup#EMPTY} that will not yield anything. - * @param node - * @param style - * @returns - */ - getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; - /** - * Yields the {@link yfiles.input.IHitTestable#NEVER} that will always report misses. - * @param node - * @param style - * @returns - */ - getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; - /** - * Yields the {@link yfiles.input.IMarqueeTestable#NEVER} that will always report misses. - * @param node - * @param style - * @returns - */ - getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; - /** - * This implementation always returns the {@link yfiles.styles.VoidShapeGeometry#INSTANCE VoidShapeGeometry instance}. - * @param node The node to provide an instance for - * @param style The style to use for the rendering - * @returns The {@link #INSTANCE VoidShapeGeometry instance}. - * @see yfiles.styles.INodeStyleRenderer#getShapeGeometry - */ - getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; - /** - * Yields the {@link yfiles.view.IVisibilityTestable#NEVER} that will always claim invisibility. - * @param node - * @param style - * @returns - */ - getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; - /** - * Yields the {@link yfiles.view.VoidVisualCreator#INSTANCE} that will do nothing. - * @param node - * @param style - * @returns - */ - getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; - /** - * The {@link yfiles.styles.VoidNodeStyleRenderer} singleton. - * @const - * @static - * @type {yfiles.styles.INodeStyleRenderer} - */ - static INSTANCE:yfiles.styles.INodeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.VoidNodeStyleRenderer; - } - /** - * Style implementation for {@link yfiles.graph.INode} instances in an {@link yfiles.graph.IGraph}. - *

- * Implementations are responsible for rendering {@link yfiles.graph.INode} instances in a {@link yfiles.view.CanvasComponent}. It is up to - * the implementation to interpret the visual appearance of a node. The framework uses the associated, possibly shared {@link yfiles.styles.INodeStyle#renderer} to - * perform the actual rendering of this style for a given node. This interface extends the {@link yfiles.lang.ICloneable} - * interface. This allows clients to obtain a persistent copy of the current state of this style. Immutable style - * implementations may return themselves. - *

- *

- * Working with styles (and their style renderers) is explained in detail in the section {@link @DGUIDE_PREFIX@/view_visualization-graph-elements.html Visualization of Graph Elements}. - *

- *

Related demos:

- *
    - *
  • Demo: SimpleCustomStyle, demo.yfiles.style.simplecustomstyle
  • - *
  • Tutorial: 02 Custom Styles, step 01 Custom Node Style
  • - *
- * @interface - * @implements {yfiles.lang.ICloneable} - */ - export interface INodeStyle extends yfiles.lang.Object,yfiles.lang.ICloneable{ - /** - * Gets the renderer implementation that can be queried for implementations that provide details about the visual - * appearance and visual behavior for a given node and this style instance. - *

- * The idiom for retrieving, e.g. an {@link yfiles.view.IVisualCreator} implementation for a given style is: - *

- * @abstract - * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - } - var INodeStyle:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.styles.INodeStyle; - }; - /** - * Interface used by {@link yfiles.styles.INodeStyle} implementations that can be used to query the actual - * {@link yfiles.view.IVisualCreator}, {@link yfiles.view.IBoundsProvider}, {@link yfiles.input.IHitTestable}, and {@link yfiles.input.IMarqueeTestable} - * implementations for a node and an associated style. - *

- * Implementations of this interface should be designed to be sharable between multiple style instances and should - * therefore not contain style specific state. - *

- * @see yfiles.styles.INodeStyle - * @see yfiles.graph.INode - * @see yfiles.styles.IEdgeStyleRenderer - * @see yfiles.styles.ILabelStyleRenderer - * @see yfiles.styles.IPortStyleRenderer - * @interface - */ - export interface INodeStyleRenderer extends yfiles.lang.Object{ - /** - * Gets an implementation of the {@link yfiles.view.IBoundsProvider} interface that can handle the provided node and its associated - * style. - *

- * This method may return a flyweight implementation. - *

- * @param node The node to provide an instance for - * @param style The style to use for the calculating the painting bounds - * @returns An implementation that may be used to subsequently query the node's painting bounds. Clients should not cache this - * instance and must always call this method immediately before using the value returned. This enables the use of the - * flyweight design pattern for implementations - * @abstract - */ - getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; - /** - * Gets a temporary context instance that can be used to query additional information for the node's style. - *

- * Implementations may return {@link yfiles.graph.ILookup#EMPTY} if they don't support this, but may not return null. - *

- * @param node The node to provide a context instance for. - * @param style The style to use for the context. - * @returns An non-null lookup implementation. - * @see yfiles.graph.ILookup#EMPTY - * @see yfiles.graph.ILookup - * @abstract - */ - getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; - /** - * Gets an implementation of the {@link yfiles.input.IHitTestable} interface that can handle the provided node and its associated - * style. - *

- * This method may return a flyweight implementation. - *

- * @param node The node to provide an instance for - * @param style The style to use for the querying hit tests - * @returns An implementation that may be used to subsequently perform hit tests. Clients should not cache this instance and must - * always call this method immediately before using the value returned. This enables the use of the flyweight design - * pattern for implementations. This method may return null to indicate that the node cannot be hit tested. - * @abstract - */ - getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; - /** - * Gets an implementation of the {@link yfiles.input.IMarqueeTestable} interface that can handle the provided node and its - * associated style. - *

- * This method may return a flyweight implementation. - *

- * @param node The node to provide an instance for - * @param style The style to use for the querying marquee intersection test. - * @returns An implementation that may be used to subsequently query the marquee intersections. Clients should not cache this - * instance and must always call this method immediately before using the value returned. This enables the use of the - * flyweight design pattern for implementations - * @abstract - */ - getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; - /** - * Gets an implementation of the {@link yfiles.styles.IShapeGeometry} interface that can handle the provided node and its - * associated style. - *

- * This method may return a flyweight implementation. - *

- * @param node The node to provide an instance for - * @param style The style to use for the rendering - * @returns An implementation that may be used to subsequently query geometry information from. Clients should not cache this - * instance and must always call this method immediately before using the value returned. This enables the use of the - * flyweight design pattern for implementations - * @abstract - */ - getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; - /** - * Gets an implementation of the {@link yfiles.view.IVisibilityTestable} interface that can handle the provided node and its - * associated style. - *

- * This method may return a flyweight implementation. - *

- * @param node The node to provide an instance for - * @param style The style to use for the testing the visibility - * @returns An implementation that may be used to subsequently query the node's visibility. Clients should not cache this instance - * and must always call this method immediately before using the value returned. This enables the use of the flyweight - * design pattern for implementations - * @abstract - */ - getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; - /** - * Gets an implementation of the {@link yfiles.view.IVisualCreator} interface that can handle the provided node and its associated - * style. - *

- * This method may return a flyweight implementation, but never null. - *

- * @param node The node to provide an instance for - * @param style The style to use for the creation of the visual - * @returns An implementation that may be used to subsequently create or update the visual for the node. Clients should not cache - * this instance and must always call this method immediately before using the value returned. This enables the use of the - * flyweight design pattern for implementations. This method may not return null but should yield a {@link #INSTANCE void} implementation - * instead. - * @see yfiles.view.VoidVisualCreator#INSTANCE - * @abstract - */ - getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; - } - var INodeStyleRenderer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.styles.INodeStyleRenderer; - }; - /** - * Interface that is used mainly by {@link yfiles.styles.IEdgeStyleRenderer} implementations to reveal geometric details about the - * visualization of an edge's path. - * @interface - */ - export interface IPathGeometry extends yfiles.lang.Object{ - /** - * Returns a representation of the visible path of the edge in form of a {@link yfiles.geometry.GeneralPath} - * @returns An instance that describes the visible path or null if this is not applicable for the current geometry. - * @abstract - */ - getPath():yfiles.geometry.GeneralPath; - /** - * Returns the number of "segments" this edge's path consists of. - * @returns the number of segments or -1 if there is no such thing as a segment for this edge. - * @abstract - */ - getSegmentCount():number; - /** - * Calculates the tangent on the edge's path at the given ratio point for the given segment. - * @param segmentIndex the segment to use for the calculation - * @param ratio a value in [0,1] where 0 is the source's end and 1 is at the target's end of the segment - * @returns The tangential line, if any exists. - * @see yfiles.styles.IPathGeometry#getTangent - * @see yfiles.styles.IPathGeometry#getSegmentCount - * @abstract - */ - getTangent(segmentIndex:number,ratio:number):yfiles.geometry.Tangent; - /** - * Calculates the tangent on the edge's path at the given ratio point. - * @param ratio a value in [0,1] where 0 is the source's end and 1 is at the target's end of the visible edge path - * @returns The tangential line, if any exists. - * @abstract - */ - getTangent(ratio:number):yfiles.geometry.Tangent; - } - var IPathGeometry:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.styles.IPathGeometry; - }; - /** - * A void implementation of a port style renderer that does nothing. - *

- * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidPortStyleRenderer#INSTANCE} of this - * class instead of null where null is not allowed. For example you cannot assign null to the {@link yfiles.styles.IPortStyle#renderer} property of an - * {@link yfiles.styles.IPortStyle}. - *

- * @class - * @implements {yfiles.styles.IPortStyleRenderer} - * @final - */ - export interface VoidPortStyleRenderer extends yfiles.lang.Object,yfiles.styles.IPortStyleRenderer{} - export class VoidPortStyleRenderer { - /** - * Yields the {@link yfiles.view.IBoundsProvider#EMPTY} that will return empty bounds. - * @param port - * @param style - * @returns - */ - getBoundsProvider(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.view.IBoundsProvider; - /** - * Yields the {@link yfiles.graph.ILookup#EMPTY} that will not yield anything. - * @param port - * @param style - * @returns - */ - getContext(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.graph.ILookup; - /** - * Yields the {@link yfiles.input.IHitTestable#NEVER} that will always report misses. - * @param port - * @param style - * @returns - */ - getHitTestable(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.input.IHitTestable; - /** - * Yields the {@link yfiles.input.IMarqueeTestable#NEVER} that will always report misses. - * @param port - * @param style - * @returns - */ - getMarqueeTestable(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.input.IMarqueeTestable; - /** - * Yields the {@link yfiles.view.IVisibilityTestable#NEVER} that will always claim invisibility. - * @param port - * @param style - * @returns - */ - getVisibilityTestable(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.view.IVisibilityTestable; - /** - * Yields the {@link yfiles.view.VoidVisualCreator#INSTANCE} that will do nothing. - * @param port - * @param style - * @returns - */ - getVisualCreator(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.view.IVisualCreator; - /** - * The {@link yfiles.styles.VoidPortStyleRenderer} singleton. - * @const - * @static - * @type {yfiles.styles.IPortStyleRenderer} - */ - static INSTANCE:yfiles.styles.IPortStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.VoidPortStyleRenderer; - } - /** - * A void implementation of a port style that does nothing and behaves like an invisible style. - *

- * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidPortStyle#INSTANCE} of this class - * instead of null where null is not allowed. For example you cannot assign null to the {@link yfiles.graph.IPort#style} property of an - * {@link yfiles.graph.IPort}. - *

- * @class - * @implements {yfiles.styles.IPortStyle} - * @final - */ - export interface VoidPortStyle extends yfiles.lang.Object,yfiles.styles.IPortStyle{} - export class VoidPortStyle { - /** - * Returns this. - * @returns this - */ - clone():any; - /** - * The {@link yfiles.styles.VoidPortStyle} singleton. - * @const - * @static - * @type {yfiles.styles.VoidPortStyle} - */ - static INSTANCE:yfiles.styles.VoidPortStyle; - /** - * Gets the {@link yfiles.styles.VoidPortStyleRenderer#INSTANCE VoidPortStyleRenderer instance}. - * @see yfiles.styles.IPortStyle#renderer - * @type {yfiles.styles.IPortStyleRenderer} - */ - renderer:yfiles.styles.IPortStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.VoidPortStyle; - } - /** - * Style implementation for {@link yfiles.graph.IPort} instances in an {@link yfiles.graph.IGraph}. - *

- * Implementations are responsible for rendering {@link yfiles.graph.IPort} instances in a {@link yfiles.view.CanvasComponent}. It is up to - * the implementation to interpret the visual appearance of a port. The framework uses the associated, possibly shared {@link yfiles.styles.IPortStyle#renderer} to - * perform the actual rendering of this style for a given port. This interface extends the {@link yfiles.lang.ICloneable} - * interface. This allows clients to obtain a persistent copy of the current state of this style. Immutable style - * implementations may return themselves. - *

- *

- * Working with styles (and their style renderers) is explained in detail in the section {@link @DGUIDE_PREFIX@/view_visualization-graph-elements.html Visualization of Graph Elements}. - *

- *

Related demos:

- *
    - *
  • Demo: SimpleCustomStyle, demo.yfiles.style.simplecustomstyle
  • - *
  • Tutorial: 02 Custom Styles, step 22 Custom Ports
  • - *
- * @interface - * @implements {yfiles.lang.ICloneable} - */ - export interface IPortStyle extends yfiles.lang.Object,yfiles.lang.ICloneable{ - /** - * Gets the renderer implementation that can be queried for implementations that provide details about the visual - * appearance and visual behavior for a given port and this style instance. - *

- * The idiom for retrieving, e.g. an {@link yfiles.view.IVisualCreator} implementation for a given style is: - *

- * @abstract - * @type {yfiles.styles.IPortStyleRenderer} - */ - renderer:yfiles.styles.IPortStyleRenderer; - } - var IPortStyle:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.styles.IPortStyle; - }; - /** - * Interface used by {@link yfiles.styles.IPortStyle} implementations that can be used to query the actual - * {@link yfiles.view.IVisualCreator}, {@link yfiles.view.IBoundsProvider}, {@link yfiles.input.IHitTestable}, {@link yfiles.view.IVisibilityTestable}, and - * {@link yfiles.input.IMarqueeTestable} implementations for a port and an associated style. - *

- * Implementations of this interface should be designed to be sharable between multiple style instances and should - * therefore not contain style specific state. - *

- * @see yfiles.styles.IPortStyle - * @see yfiles.graph.IPort - * @see yfiles.styles.INodeStyleRenderer - * @see yfiles.styles.IEdgeStyleRenderer - * @see yfiles.styles.ILabelStyleRenderer - * @interface - */ - export interface IPortStyleRenderer extends yfiles.lang.Object{ - /** - * Gets an implementation of the {@link yfiles.view.IBoundsProvider} interface that can handle the provided port and its associated - * style. - *

- * This method may return a flyweight implementation. - *

- * @param port The port to provide an instance for - * @param style The style to use for the calculating the painting bounds - * @returns An implementation that may be used to subsequently query the port's painting bounds. Clients should not cache this - * instance and must always call this method immediately before using the value returned. This enables the use of the - * flyweight design pattern for implementations - * @abstract - */ - getBoundsProvider(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.view.IBoundsProvider; - /** - * Gets a temporary context instance that can be used to query additional information for the port's style. - *

- * Implementations may return {@link yfiles.graph.ILookup#EMPTY} if they don't support this, but may not return null. - *

- * @param port The port to provide a context instance for. - * @param style The style to use for the context. - * @returns An non-null lookup implementation. - * @see yfiles.graph.ILookup#EMPTY - * @see yfiles.graph.ILookup - * @abstract - */ - getContext(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.graph.ILookup; - /** - * Gets an implementation of the {@link yfiles.input.IHitTestable} interface that can handle the provided port and its associated - * style. - *

- * This method may return a flyweight implementation. - *

- * @param port The port to provide an instance for - * @param style The style to use for the querying hit tests - * @returns An implementation that may be used to subsequently perform hit tests. Clients should not cache this instance and must - * always call this method immediately before using the value returned. This enables the use of the flyweight design - * pattern for implementations. This method may return null to indicate that the port cannot be hit tested. - * @abstract - */ - getHitTestable(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.input.IHitTestable; - /** - * Gets an implementation of the {@link yfiles.input.IMarqueeTestable} interface that can handle the provided port and its - * associated style. - *

- * This method may return a flyweight implementation. - *

- * @param port The port to provide an instance for - * @param style The style to use for the querying marquee intersection test. - * @returns An implementation that may be used to subsequently query the marquee intersections. Clients should not cache this - * instance and must always call this method immediately before using the value returned. This enables the use of the - * flyweight design pattern for implementations - * @abstract - */ - getMarqueeTestable(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.input.IMarqueeTestable; - /** - * Gets an implementation of the {@link yfiles.view.IVisibilityTestable} interface that can handle the provided port and its - * associated style. - *

- * This method may return a flyweight implementation. - *

- * @param port The port to provide an instance for - * @param style The style to use for the testing the visibility - * @returns An implementation that may be used to subsequently query the port's visibility. Clients should not cache this instance - * and must always call this method immediately before using the value returned. This enables the use of the flyweight - * design pattern for implementations - * @abstract - */ - getVisibilityTestable(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.view.IVisibilityTestable; - /** - * Gets an implementation of the {@link yfiles.view.IVisualCreator} interface that can handle the provided port and its associated - * style. - *

- * This method may return a flyweight implementation, but never null. - *

- * @param port The port to provide an instance for - * @param style The style to use for the creation of the visual - * @returns An implementation that may be used to subsequently create or update the visual for the port. Clients should not cache - * this instance and must always call this method immediately before using the value returned. This enables the use of the - * flyweight design pattern for implementations. This method may not return null but should yield a {@link #INSTANCE void} implementation - * instead. - * @see yfiles.view.VoidVisualCreator#INSTANCE - * @abstract - */ - getVisualCreator(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.view.IVisualCreator; - } - var IPortStyleRenderer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.styles.IPortStyleRenderer; - }; - /** - * Interface that describes the geometry of a shape which has an interior and an exterior. - *

Related demos:

- *
    - *
  • Tutorial: 02 Custom Styles, step 04 IsInside
  • - *
  • Tutorial: 02 Custom Styles, step 06 GetBounds
  • - *
- * @interface - */ - export interface IShapeGeometry extends yfiles.lang.Object{ - /** - * Returns the intersection for the given line with this shape's geometry. - * @param inner The first point of the line that is inside the shape. - * @param outer The second point of the line that is outside the shape. - * @returns The coordinates of the intersection point, if an intersection was found. - * @abstract - */ - getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Returns the outline of the shape or null. - * @returns The outline or null if no outline can be provided. - * @abstract - */ - getOutline():yfiles.geometry.GeneralPath; - /** - * Checks whether the given coordinate is deemed to lie within the shape's geometric bounds. - * @param location The point to test. - * @returns True if the point lies within the shape. - * @abstract - */ - isInside(location:yfiles.geometry.Point):boolean; - } - var IShapeGeometry:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.styles.IShapeGeometry; - }; - /** - * An {@link yfiles.view.IVisualCreator} for use in a {@link yfiles.view.CanvasComponent} that renders a {@link yfiles.graph.IGraph} instance in a - * sloppy overview style. - * @class - * @implements {yfiles.view.IVisualCreator} - */ - export interface GraphOverviewSvgVisualCreator extends yfiles.lang.Object,yfiles.view.IVisualCreator{} - export class GraphOverviewSvgVisualCreator { - /** - * Creates a new instance for the given graph. - * @param graph - */ - constructor(graph:yfiles.graph.IGraph); - /** - * Callback that returns and/or configures a edge style for the given edge to render. - * @param edge The edge to render. - * @returns The style or null - * @protected - */ - getEdgeStyle(edge:yfiles.graph.IEdge):yfiles.styles.IEdgeStyle; - /** - * Obtains the {@link yfiles.view.IVisualCreator} for the given edge. - * @param context The context. - * @param edge The edge. - * @returns The visual creator that is obtained from the {@link #getEdgeStyle}'s {@link #getVisualCreator} - * method. - * @protected - */ - getEdgeVisualCreator(context:yfiles.view.IRenderContext,edge:yfiles.graph.IEdge):yfiles.view.IVisualCreator; - /** - * Callback that returns and/or configures a group node style for the given node to render. - * @param node The group node to render. - * @returns The style or null - * @protected - */ - getGroupNodeStyle(node:yfiles.graph.INode):yfiles.styles.INodeStyle; - /** - * Obtains the {@link yfiles.view.IVisualCreator} for the given group node. - * @param context The context. - * @param node The group node. - * @returns The visual creator that is obtained from the {@link #getGroupNodeStyle}'s {@link #getVisualCreator} - * method. - * @protected - */ - getGroupNodeVisualCreator(context:yfiles.view.IRenderContext,node:yfiles.graph.INode):yfiles.view.IVisualCreator; - /** - * Callback that returns and/or configures a node style for the given node to render. - * @param node The node to render. - * @returns The style or null - * @protected - */ - getNodeStyle(node:yfiles.graph.INode):yfiles.styles.INodeStyle; - /** - * Obtains the {@link yfiles.view.IVisualCreator} for the given node. - * @param context The context. - * @param node The node. - * @returns The visual creator that is obtained from the {@link #getNodeStyle}'s {@link #getVisualCreator} - * method. - * @protected - */ - getNodeVisualCreator(context:yfiles.view.IRenderContext,node:yfiles.graph.INode):yfiles.view.IVisualCreator; - /** - * Gets or sets the overview node style. - * @type {yfiles.styles.INodeStyle} - */ - nodeStyle:yfiles.styles.INodeStyle; - /** - * Gets or sets the overview group node style. - * @type {yfiles.styles.INodeStyle} - */ - groupNodeStyle:yfiles.styles.INodeStyle; - /** - * Gets or sets the overview edge style. - * @type {yfiles.styles.IEdgeStyle} - */ - edgeStyle:yfiles.styles.IEdgeStyle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.GraphOverviewSvgVisualCreator; - } - /** - * Decorates an arbitrary node styles with an additional collapse/expand handle. - *

- * This style uses the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer} to adorn an existing {@link yfiles.styles.INodeStyle} - * with a Button that can then be used to trigger the {@link yfiles.input.ICommand#TOGGLE_EXPANSION_STATE}. - *

- *

- * By default, this handle is rendered as a plus ("+") sign when in collapsed state, and a minus ("-") sign when in - * expanded state. - *

- *

- * The collapse button can be styled using the CSS class selectors 'yfiles-collapsebutton', 'yfiles-collapsebutton-checked' - * and 'yfiles-collapsebutton-unchecked'. - *

- * @see yfiles.styles.CollapsibleNodeStyleDecoratorRenderer - * @class - * @implements {yfiles.styles.INodeStyle} - */ - export interface CollapsibleNodeStyleDecorator extends yfiles.lang.Object,yfiles.styles.INodeStyle{} - export class CollapsibleNodeStyleDecorator { - /** - * Initializes a new instance of the {@link yfiles.styles.CollapsibleNodeStyleDecorator} class using the provided style for the {@link yfiles.styles.CollapsibleNodeStyleDecorator#wrapped} - * property and the provided {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer} as renderer. - * @param wrapped The decorated style. - * @param [renderer=null] An instance of {@link } to render this style. - */ - constructor(wrapped:yfiles.styles.INodeStyle,renderer?:yfiles.styles.CollapsibleNodeStyleDecoratorRenderer); - /** - * Initializes a new instance of the {@link yfiles.styles.CollapsibleNodeStyleDecorator} class using the provided style for the {@link yfiles.styles.CollapsibleNodeStyleDecorator#wrapped} - * property and the provided {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer} as renderer. - * @param {Object} options The parameters to pass. - * @param options.wrapped The decorated style. - * @param [options.renderer=null] An instance of {@link } to render this style. - * @param {yfiles.graph.ILabelModelParameter} options.buttonPlacement An {@link yfiles.graph.ILabelModelParameter} that determines the placement of the button for toggling the expanded state. - *

- * This option sets the {@link yfiles.styles.CollapsibleNodeStyleDecorator#buttonPlacement} property on the created object. - *

- * @param {yfiles.geometry.Insets} options.insets The insets to use for the {@link yfiles.input.INodeInsetsProvider} that will be reported by the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer}'s {@link yfiles.graph.ILookup}. - *

- * This option sets the {@link yfiles.styles.CollapsibleNodeStyleDecorator#insets} property on the created object. - *

- */ - constructor(options:{wrapped:yfiles.styles.INodeStyle,renderer?:yfiles.styles.CollapsibleNodeStyleDecoratorRenderer,buttonPlacement?:yfiles.graph.ILabelModelParameter,insets?:yfiles.geometry.Insets}); - /** - * Initializes a new instance of the {@link yfiles.styles.CollapsibleNodeStyleDecorator} class. - *

- * The {@link yfiles.styles.CollapsibleNodeStyleDecorator#wrapped} property will be initialized with a {@link yfiles.styles.ShapeNodeStyle}. - *

- * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.graph.ILabelModelParameter} options.buttonPlacement An {@link yfiles.graph.ILabelModelParameter} that determines the placement of the button for toggling the expanded state. - *

- * This option sets the {@link yfiles.styles.CollapsibleNodeStyleDecorator#buttonPlacement} property on the created object. - *

- * @param {yfiles.geometry.Insets} options.insets The insets to use for the {@link yfiles.input.INodeInsetsProvider} that will be reported by the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer}'s {@link yfiles.graph.ILookup}. - *

- * This option sets the {@link yfiles.styles.CollapsibleNodeStyleDecorator#insets} property on the created object. - *

- */ - constructor(options?:{buttonPlacement?:yfiles.graph.ILabelModelParameter,insets?:yfiles.geometry.Insets}); - /** - * - * @returns - */ - clone():any; - /** - * Gets or sets an {@link yfiles.graph.ILabelModelParameter} that determines the placement of the button for toggling the expanded - * state. - *

- * The {@link yfiles.graph.ILabelModelParameter} should {@link yfiles.graph.ILabelModelParameter#supports support} labels bound to an {@link yfiles.graph.INode} because the button will be - * positioned as if it was an {@link yfiles.graph.ILabel} owned by the {@link yfiles.graph.INode} that uses this style. - *

- * @default 'yWorks.yFiles.UI.LabelModels.InteriorLabelModel.NorthWest' - * @type {yfiles.graph.ILabelModelParameter} - */ - buttonPlacement:yfiles.graph.ILabelModelParameter; - /** - * Gets or sets the insets to use for the {@link yfiles.input.INodeInsetsProvider} that will be reported by the - * {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer}'s {@link yfiles.graph.ILookup}. - *

- * This effectively influences the way the bounds of a group node are being calculated. The default {@link yfiles.graph.IGroupBoundsCalculator} - * implementation will use these insets to determine the minimum size of a group node given a set of contained nodes. - *

- * @default '5, 16, 5, 5' - * @type {yfiles.geometry.Insets} - */ - insets:yfiles.geometry.Insets; - /** - * - * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - /** - * Gets or sets the wrapped node style that will be used to perform the actual rendering of the node. - * @type {yfiles.styles.INodeStyle} - */ - wrapped:yfiles.styles.INodeStyle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.CollapsibleNodeStyleDecorator; - } - /** - * {@link yfiles.styles.INodeStyleRenderer} implementation that can be used in conjunction with {@link yfiles.styles.CollapsibleNodeStyleDecorator} - * instances. - * @class - * @implements {yfiles.styles.INodeStyleRenderer} - * @implements {yfiles.styles.IShapeGeometry} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface CollapsibleNodeStyleDecoratorRenderer extends yfiles.lang.Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class CollapsibleNodeStyleDecoratorRenderer { - /** - * Initializes a new instance of the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer} class. - */ - constructor(); - /** - * Adds the toggle expansion state command to the given button visual. - *

- * This method adds event listeners for click and tap events to the given button visual that execute - * {@link yfiles.input.ICommand#TOGGLE_EXPANSION_STATE}. It is called by - * {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#createButton}. - *

- * @param button The button visual to add the event listeners to. - * @param currentNode The group node whose state is to be toggled. - * @param context The context. - * @static - */ - static addToggleExpansionStateCommand(button:yfiles.view.SvgVisual,currentNode:yfiles.graph.INode,context:yfiles.view.IRenderContext):void; - /** - * Prepares this instance for subsequent calls after the style and node have been initialized. - *

- * Upon invocation the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#style} and {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#node} properies have been populated by the - * {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getVisualCreator}, - * {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getBoundsProvider}, - * {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getHitTestable}, or {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getMarqueeTestable} - * methods. - *

- *

- * This is an empty implementation. Subclasses might have to override this method. - *

- * @protected - */ - configure():void; - /** - * Creates the button visual. - *

- * This method is called from {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#createVisual} to create the button. Custom - * implementations can override this method to use a custom button visualization. - *

- *

- * This implementation adds the {@link yfiles.input.ICommand#TOGGLE_EXPANSION_STATE} command to the button. The created button is - * automatically unchecked if the group node is {@link yfiles.graph.IFoldingView#isExpanded expanded} and vice versa. - *

- * @param context The context. - * @param expanded Specifies whether the button visual is created for the expanded or the collapsed state. - * @param size The button size. - * @returns - * @protected - */ - createButton(context:yfiles.view.IRenderContext,expanded:boolean,size:yfiles.geometry.Size):yfiles.view.SvgVisual; - /** - * Callback that provides a customized {@link yfiles.view.ISelectionIndicatorInstaller}. - * @returns This implementation yields a {@link } that uses - * {@link #SELECTION_TEMPLATE_KEY}. - * @protected - */ - createSelectionInstaller():yfiles.view.ISelectionIndicatorInstaller; - /** - * Creates the visual for the given context. - *

- * This method uses {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#createButton} to create the togglebutton instance. - * It will then use the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getButtonLocationParameter} to determine the - * placement of the button and use the {@link yfiles.styles.CollapsibleNodeStyleDecorator#wrapped wrapped style} to create the visual for the actual node. - *

- * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * Delegates to the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle} and takes the button into account. - * @param context - * @returns - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#configure} and - * returns this. - * @param node The node to retrieve the bounds provider for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getBounds - */ - getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; - /** - * Yields the {@link yfiles.styles.CollapsibleNodeStyleDecorator#buttonPlacement} for the current {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#style} - * @returns - * @protected - */ - getButtonLocationParameter():yfiles.graph.ILabelModelParameter; - /** - * Returns the size of new buttons. - * @returns The size of new buttons - * @protected - */ - getButtonSize():yfiles.geometry.Size; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#configure} and - * returns this. - *

- * As this method may be called often it will not automatically call - * {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#configure}, instead subclasses should ensure that in the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#lookup} - * method call they should call {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#configure} only if needed, i.e. if they - * decide to return this or an instance that depends on a correctly configured this. - *

- * @param node The node to query the context for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#lookup - */ - getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#configure} and - * returns this. - * @param node The node to query hit test with. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#isHit - */ - getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; - /** - * Delegates to the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle}. - * @param inner - * @param outer - * @returns - */ - getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#configure} and - * returns this. - * @param node The node to query marquee intersection tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#isInBox - */ - getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; - /** - * Delegates to the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle}. - * @returns - */ - getOutline():yfiles.geometry.GeneralPath; - /** - * Configures the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#style} and {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#node} properties, calls {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#configure} and returns this. - * @param node The node to retrieve the shape geometry for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#isInside - * @see yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getIntersection - */ - getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#configure} and - * returns this. - *

- * Unlike most of the other methods this implementation does not call - * {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#configure}. If the subclass implementation depends on this instance - * to be configured, it needs to call Configure in {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#isVisible}. - *

- * @param node The node to query visibility tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#isVisible - */ - getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#configure} and - * returns this. - * @param node The node to retrieve the {@link } for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#createVisual - * @see yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#updateVisual - */ - getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; - /** - * Yields the {@link yfiles.styles.CollapsibleNodeStyleDecorator#wrapped} property for the current {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#style} - * @returns - * @protected - */ - getWrappedStyle():yfiles.styles.INodeStyle; - /** - * Delegates to the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle} and checks the button. - * @param context - * @param location - * @returns - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * Delegates to the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle}. - * @param context - * @param rectangle - * @returns - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Delegates to the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle}. - * @param location - * @returns - */ - isInside(location:yfiles.geometry.Point):boolean; - /** - * Delegates to the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle}. - * @param context - * @param rectangle - * @returns - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * Updates the button visual. - *

- * This method is called from {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#updateVisual} to update an existing button - * or to create a new one. Custom implementations can override this method to use a custom button visualization. - *

- * @param context The context. - * @param expanded Specifies whether the button visual is updated for the expanded or the collapsed state. - * @param size The button size. - * @param oldButton The old button visual. - * @returns - * @protected - */ - updateButton(context:yfiles.view.IRenderContext,expanded:boolean,size:yfiles.geometry.Size,oldButton:yfiles.view.Visual):yfiles.view.SvgVisual; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.CollapsibleNodeStyleDecorator} - */ - style:yfiles.styles.CollapsibleNodeStyleDecorator; - /** - * Gets or sets the currently configured node. - * @protected - * @type {yfiles.graph.INode} - */ - node:yfiles.graph.INode; - /** - * Gets the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. - *

- * Returns Node.Layout. - *

- * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.CollapsibleNodeStyleDecoratorRenderer; - } - /** - * An abstract base class that makes it possible to easily implement a custom {@link yfiles.styles.IEdgeStyle}. - *

- * The only method that needs to be implemented by subclasses is {@link yfiles.styles.EdgeStyleBase#createVisual}, however to - * improve rendering performance it is highly recommended to implement at least - * {@link yfiles.styles.EdgeStyleBase#updateVisual}, too. - *

- *

- * This implementation differs from the straightforward {@link yfiles.styles.IEdgeStyle} implementation in that there is no visible - * separation between the style and its - * {@link yfiles.styles.IEdgeStyleRenderer}. Instead the renderer used by the base class is fixed and delegates all calls back to - * the style instance. - *

- *

Related demos:

- *
    - *
  • Demo: SimpleCustomStyle, demo.yfiles.style.simplecustomstyle
  • - *
  • Tutorial: 02 Custom Styles, step 16 Custom Edge Style
  • - *
  • Tutorial: 02 Custom Styles, step 17 Edge Hit Test
  • - *
  • Tutorial: 02 Custom Styles, step 18 Edge Cropping
  • - *
- * @class - * @implements {yfiles.styles.IEdgeStyle} - */ - export interface EdgeStyleBase extends yfiles.lang.Object,yfiles.styles.IEdgeStyle{} - export class EdgeStyleBase { - /** - * Initializes a new instance of the {@link yfiles.styles.EdgeStyleBase} class. - * @protected - */ - constructor(); - /** - * Convenience method that adds the arrows to a given container. - * @param context The context for the rendering. - * @param group The container to which the arrows should be added. - * @param edge The edge that is being rendered. - * @param edgePath The edge path. - * @param sourceArrow The source arrow. - * @param targetArrow The target arrow. - * @protected - */ - addArrows(context:yfiles.view.IRenderContext,group:SVGGElement,edge:yfiles.graph.IEdge,edgePath:yfiles.geometry.GeneralPath,sourceArrow:yfiles.styles.IArrow,targetArrow:yfiles.styles.IArrow):void; - /** - * Creates a new object that is a copy of the current instance. - *

- * Immutable subclasses should consider returning this. - *

- * @returns A new object that is a copy of this instance using {@link #memberwiseClone}. - */ - clone():any; - /** - * Callback that creates the visual. - *

- * This method is called in response to a {@link yfiles.view.IVisualCreator#createVisual} call to the instance that has been - * queried from the {@link yfiles.styles.EdgeStyleBase#renderer}. - *

- * @param context The render context. - * @param edge The edge to which this style instance is assigned. - * @returns The visual as required by the {@link #createVisual} interface. - * @see yfiles.styles.EdgeStyleBase#updateVisual - * @protected - * @abstract - */ - createVisual(context:yfiles.view.IRenderContext,edge:yfiles.graph.IEdge):yfiles.view.Visual; - /** - * Convenience method that crops the edge's path at the nodes. - *

- * This implementation uses the {@link yfiles.styles.IEdgePathCropper} instances found in the {@link yfiles.graph.ILookup#lookup} of the - * source and target port of the edge to perform the actual cropping. - *

- * @param edge The edge that is being rendered. - * @param path The path that should be cropped. - * @param sourceArrow The source arrow instance. - * @param targetArrow The target arrow instance. - * @returns The cropped path. This is can be either the same instance of the given path or a newly created instance. - * @protected - */ - cropPath(edge:yfiles.graph.IEdge,sourceArrow:yfiles.styles.IArrow,targetArrow:yfiles.styles.IArrow,path:yfiles.geometry.GeneralPath):yfiles.geometry.GeneralPath; - /** - * Gets the bounds of the visual for the edge in the given context. - *

- * This method is called in response to a {@link yfiles.view.IBoundsProvider#getBounds} call to the instance that has been queried - * from the {@link yfiles.styles.EdgeStyleBase#renderer}. This implementation simply yields a {@link yfiles.geometry.Rect rectangle} containing. the locations of the {@link yfiles.graph.IEdge#sourcePort source port} and the {@link yfiles.graph.IEdge#targetPort target port} - * of the edge and the locations of all its {@link yfiles.graph.IEdge#bends bends}. - *

- * @param context The canvas context. - * @param edge The edge to which this style instance is assigned. - * @returns The visual bounds of the visual representation. - * @protected - */ - getBounds(context:yfiles.view.ICanvasContext,edge:yfiles.graph.IEdge):yfiles.geometry.Rect; - /** - * Gets the path of the edge. - * @param edge The edge. - * @returns The path. - * @protected - */ - getPath(edge:yfiles.graph.IEdge):yfiles.geometry.GeneralPath; - /** - * Gets the number of segments of the edge. - * @param edge The edge. - * @returns The segment count. - * @protected - */ - getSegmentCount(edge:yfiles.graph.IEdge):number; - /** - * Convenience method that calculates the source arrow anchor and direction for a a given arrow and path. - * @param path The path of the edge. - * @param arrow The arrow. - * @returns The anchor and directional vector of the arrow, if any exist. - * @protected - */ - getSourceArrowAnchor(path:yfiles.geometry.GeneralPath,arrow:yfiles.styles.IArrow):yfiles.geometry.Tangent; - /** - * Gets the tangent to the edge at the specified ratio of a segment of the edge and the corresponding touch point. - * @param edge The edge. - * @param segmentIndex Index of the segment of the edge. - * @param ratio A value between 0 and 1 inclusively that indicates a ratio from the beginning to the end of the segment of the edge. - * @returns The tangent, if any exists. - * @protected - */ - getTangent(edge:yfiles.graph.IEdge,segmentIndex:number,ratio:number):yfiles.geometry.Tangent; - /** - * Gets the tangent to the edge at the specified ratio and the corresponding touch point. - * @param edge The edge. - * @param ratio A value between 0 and 1 inclusively that indicates a ratio from the beginning to the end of the path of the edge. - * @returns The tangent, if any exists. - * @protected - */ - getTangent(edge:yfiles.graph.IEdge,ratio:number):yfiles.geometry.Tangent; - /** - * Convenience method that calculates the target arrow anchor and direction for a a given arrow and path. - * @param path The path of the edge. - * @param arrow The arrow. - * @returns The anchor and directional vector of the arrow, if any exist. - * @protected - */ - getTargetArrowAnchor(path:yfiles.geometry.GeneralPath,arrow:yfiles.styles.IArrow):yfiles.geometry.Tangent; - /** - * Determines whether the visual representation of the edge has been hit at the given location. - *

- * This method is called in response to a {@link yfiles.input.IHitTestable#isHit} call to the instance that has been queried from - * the {@link yfiles.styles.EdgeStyleBase#renderer}. - *

- *

- * This implementation returns the result of the {@link yfiles.geometry.Point#hitsPolyline} method of class {@link yfiles.geometry.Point} - * with the polygonal line defined by the source port, the target port and the bends of the edge and the {@link yfiles.view.ICanvasContext#hitTestRadius} of the - * {@link yfiles.view.ICanvasContext canvas context}. - *

- * @param context The input mode context. - * @param location The point to test. - * @param edge The edge to which this style instance is assigned. - * @returns true if the specified edge representation is hit; false otherwise. - * @see yfiles.geometry.Point#hitsPolyline - * @protected - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,edge:yfiles.graph.IEdge):boolean; - /** - * Determines whether the visualization for the specified edge is included in the marquee selection. - *

- * This method is called in response to a {@link yfiles.input.IMarqueeTestable#isInBox} call to the instance that has been queried - * from the {@link yfiles.styles.EdgeStyleBase#renderer}. - *

- *

- * This implementation returns the result of the {@link yfiles.geometry.Rect#intersectsPolyline} method of class {@link yfiles.geometry.Rect} - * with the polygonal line defined by the source port, the target port and the bends of the edge. - *

- * @param context The input mode context. - * @param rectangle The marquee selection box. - * @param edge The edge to which this style instance is assigned. - * @returns true if the specified edge is visible is selected by the marquee rectangle; false otherwise. - * @protected - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect,edge:yfiles.graph.IEdge):boolean; - /** - * Determines whether the visualization for the specified edge is visible in the context. - *

- * This method is called in response to a {@link yfiles.view.IVisibilityTestable#isVisible} call to the instance that has been - * queried from the {@link yfiles.styles.EdgeStyleBase#renderer}. This implementation simply tests whether the {@link yfiles.styles.EdgeStyleBase#getBounds bounds} intersect the clip. - *

- * @param context The canvas context. - * @param rectangle The clipping rectangle. - * @param edge The edge to which this style instance is assigned. - * @returns true if the specified edge is visible in the clipping rectangle; false otherwise. - * @protected - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect,edge:yfiles.graph.IEdge):boolean; - /** - * Performs the {@link yfiles.graph.ILookup#lookup} operation for the {@link yfiles.styles.IEdgeStyleRenderer#getContext} that has been - * queried from the {@link yfiles.styles.EdgeStyleBase#renderer}. - *

- * This implementation yields null for everything but: - *

- *
    - *
  • {@link yfiles.input.IHitTestable}
  • - *
  • {@link yfiles.view.IVisualCreator}
  • - *
  • {@link yfiles.view.IBoundsProvider}
  • - *
  • {@link yfiles.view.IVisibilityTestable}
  • - *
  • {@link yfiles.input.IMarqueeTestable}
  • - *
  • {@link yfiles.graph.ILookup}
  • - *
  • {@link yfiles.styles.IPathGeometry}
  • - *
- *

- * For these interfaces an implementation will be returned that delegates to the methods in this instance. - *

- * @param edge The edge to use for the context lookup. - * @param type The type to query. - * @returns An implementation of the type or null. - * @protected - */ - lookup(edge:yfiles.graph.IEdge,type:yfiles.lang.Class):any; - /** - * Convenience method that updates the arrows in a given container. - * @param context The context for the rendering. - * @param group The container to which the arrows should be added. - * @param edge The edge that is being rendered. - * @param edgePath The edge path. - * @param sourceArrow The source arrow. - * @param targetArrow The target arrow. - * @protected - */ - updateArrows(context:yfiles.view.IRenderContext,group:SVGGElement,edge:yfiles.graph.IEdge,edgePath:yfiles.geometry.GeneralPath,sourceArrow:yfiles.styles.IArrow,targetArrow:yfiles.styles.IArrow):void; - /** - * Callback that updates the visual previously created by {@link yfiles.styles.EdgeStyleBase#createVisual}. - *

- * This method is called in response to a {@link yfiles.view.IVisualCreator#updateVisual} call to the instance that has been - * queried from the {@link yfiles.styles.EdgeStyleBase#renderer}. This implementation simply delegates to {@link yfiles.styles.EdgeStyleBase#createVisual} so subclasses should - * override to improve rendering performance. - *

- * @param context The render context. - * @param oldVisual The visual that has been created in the call to {@link #createVisual}. - * @param edge The edge to which this style instance is assigned. - * @returns The visual as required by the {@link #createVisual} interface. - * @see yfiles.styles.EdgeStyleBase#createVisual - * @protected - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual,edge:yfiles.graph.IEdge):yfiles.view.Visual; - /** - * Gets the renderer implementation for this instance. - *

- * The private implementation will delegate all API calls back to this instance. - *

- * @type {yfiles.styles.IEdgeStyleRenderer} - */ - renderer:yfiles.styles.IEdgeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.EdgeStyleBase; - } - /** - * An abstract base class that makes it possible to easily implement a custom {@link yfiles.styles.ILabelStyle}. - *

- * Only {@link yfiles.styles.LabelStyleBase#createVisual} and {@link yfiles.styles.LabelStyleBase#getPreferredSize} need to be implemented - * by subclasses, however to improve rendering performance it is highly recommended to implement at least - * {@link yfiles.styles.LabelStyleBase#updateVisual}, too. - *

- *

- * This implementation differs from the straightforward {@link yfiles.styles.ILabelStyle} implementation in that there is no - * visible separation between the style and its - * {@link yfiles.styles.ILabelStyleRenderer}. Instead the renderer used by the base class is fixed and delegates all calls back to - * the style instance. - *

- *

Related demos:

- *
    - *
  • Demo: SimpleCustomStyle, demo.yfiles.style.simplecustomstyle
  • - *
  • Tutorial: 02 Custom Styles, step 10 Custom Label Style
  • - *
  • Tutorial: 02 Custom Styles, step 11 Label Preferred Size
  • - *
  • Tutorial: 02 Custom Styles, step 12 High Performance Rendering of Label
  • - *
- * @class - * @implements {yfiles.styles.ILabelStyle} - */ - export interface LabelStyleBase extends yfiles.lang.Object,yfiles.styles.ILabelStyle{} - export class LabelStyleBase { - /** - * Initializes a new instance of the {@link yfiles.styles.LabelStyleBase} class. - * @protected - */ - constructor(); - /** - * Creates a new object that is a copy of the current instance. - *

- * Immutable subclasses should consider returning this. - *

- * @returns A new object that is a copy of this instance using {@link #memberwiseClone}. - */ - clone():any; - /** - * Creates a transform matrix that can be applied to a {@link yfiles.view.Visual} to arrange it according to the given layout and autoFlip - * rule. - * @param layout The layout used to create the transform matrix. - * @param autoFlip Whether to automatically flip the mtrix by 180 degrees, if the result would be pointing downwards. - * @returns The transform matrix. - * @static - */ - static createLayoutTransform(layout:yfiles.geometry.IOrientedRectangle,autoFlip:boolean):yfiles.geometry.Matrix; - /** - * Callback that creates the visual. - *

- * This method is called in response to a {@link yfiles.view.IVisualCreator#createVisual} call to the instance that has been - * queried from the {@link yfiles.styles.LabelStyleBase#renderer}. - *

- * @param context The render context. - * @param label The label to which this style instance is assigned. - * @returns The visual as required by the {@link #createVisual} interface. - * @see yfiles.styles.LabelStyleBase#updateVisual - * @protected - * @abstract - */ - createVisual(context:yfiles.view.IRenderContext,label:yfiles.graph.ILabel):yfiles.view.Visual; - /** - * Gets the bounds of the visual for the label in the given context. - *

- * This method is called in response to a {@link yfiles.view.IBoundsProvider#getBounds} call to the instance that has been queried - * from the {@link yfiles.styles.LabelStyleBase#renderer}. - *

- *

- * This implementation simply yields the {@link yfiles.geometry.IOrientedRectangle#bounds bounds} of the {@link yfiles.graph.ILabel#layout layout} of the given label. - *

- * @param context The canvas context. - * @param label The label to which this style instance is assigned. - * @returns The visual bounds of the visual representation. - * @protected - */ - getBounds(context:yfiles.view.ICanvasContext,label:yfiles.graph.ILabel):yfiles.geometry.Rect; - /** - * Callback that returns the preferred {@link yfiles.geometry.Size size} of the label. - * @param label The label to which this style instance is assigned. - * @returns The preferred size. - * @protected - * @abstract - */ - getPreferredSize(label:yfiles.graph.ILabel):yfiles.geometry.Size; - /** - * Determines whether the visual representation of the label has been hit at the given location. - *

- * This method is called in response to a {@link yfiles.input.IHitTestable#isHit} call to the instance that has been queried from - * the {@link yfiles.styles.LabelStyleBase#renderer}. - *

- *

- * This implementation returns the result of the {@link yfiles.geometry.IOrientedRectangle#hits} method invoked for the {@link yfiles.graph.ILabel#layout layout} of - * the label, the given {@link yfiles.geometry.Point point} and the {@link yfiles.view.ICanvasContext#hitTestRadius hit test radius} of the {@link yfiles.view.ICanvasContext canvas context}. - *

- * @param context The input mode context. - * @param location The point to test. - * @param label The label to which this style instance is assigned. - * @returns true if the specified label representation is hit; false otherwise. - * @protected - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,label:yfiles.graph.ILabel):boolean; - /** - * Determines whether the visualization for the specified label is included in the marquee selection. - *

- * This method is called in response to a {@link yfiles.input.IMarqueeTestable#isInBox} call to the instance that has been queried - * from the {@link yfiles.styles.LabelStyleBase#renderer}. - *

- *

- * This implementation returns the result of the {@link yfiles.geometry.Rect#intersects} method invoked on rectangle for the {@link yfiles.graph.ILabel#layout layout} - * of the label and the context. - *

- * @param context The input mode context. - * @param rectangle The marquee selection box. - * @param label The label to which this style instance is assigned. - * @returns true if the specified label is visible is selected by the marquee rectangle; false otherwise. - * @protected - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect,label:yfiles.graph.ILabel):boolean; - /** - * Determines whether the visualization for the specified label is visible in the context. - *

- * This method is called in response to a {@link yfiles.view.IVisibilityTestable#isVisible} call to the instance that has been - * queried from the {@link yfiles.styles.LabelStyleBase#renderer}. - *

- *

- * This implementation simply tests whether the {@link yfiles.styles.LabelStyleBase#getBounds bounds} intersect the clip. - *

- * @param context The canvas context. - * @param rectangle The clipping rectangle. - * @param label The label to which this style instance is assigned. - * @returns true if the specified label is visible in the clipping rectangle; false otherwise. - * @protected - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect,label:yfiles.graph.ILabel):boolean; - /** - * Performs the {@link yfiles.graph.ILookup#lookup} operation for the {@link yfiles.styles.ILabelStyleRenderer#getContext} that has been - * queried from the {@link yfiles.styles.LabelStyleBase#renderer}. - *

- * This implementation yields null for everything but: - *

- *
    - *
  • {@link yfiles.input.IHitTestable}
  • - *
  • {@link yfiles.view.IVisualCreator}
  • - *
  • {@link yfiles.view.IBoundsProvider}
  • - *
  • {@link yfiles.view.IVisibilityTestable}
  • - *
  • {@link yfiles.input.IMarqueeTestable}
  • - *
  • {@link yfiles.graph.ILookup}
  • - *
- *

- * For these interfaces an implementation will be returned that delegates to the methods in this instance. - *

- * @param label The label to use for the context lookup. - * @param type The type to query. - * @returns An implementation of the type or null. - * @protected - */ - lookup(label:yfiles.graph.ILabel,type:yfiles.lang.Class):any; - /** - * Callback that updates the visual previously created by {@link yfiles.styles.LabelStyleBase#createVisual}. - *

- * This method is called in response to a {@link yfiles.view.IVisualCreator#updateVisual} call to the instance that has been - * queried from the {@link yfiles.styles.LabelStyleBase#renderer}. This implementation simply delegates to {@link yfiles.styles.LabelStyleBase#createVisual} so subclasses - * should override to improve rendering performance. - *

- * @param context The render context. - * @param oldVisual The visual that has been created in the call to {@link #createVisual}. - * @param label The label to which this style instance is assigned. - * @returns The visual as required by the {@link #createVisual} interface. - * @see yfiles.styles.LabelStyleBase#createVisual - * @protected - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual,label:yfiles.graph.ILabel):yfiles.view.Visual; - /** - * Gets the renderer implementation for this instance. - *

- * The private implementation will delegate all API calls back to this instance. - *

- * @type {yfiles.styles.ILabelStyleRenderer} - */ - renderer:yfiles.styles.ILabelStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.LabelStyleBase; - } - /** - * An abstract base class that makes it possible to easily implement a custom {@link yfiles.styles.INodeStyle}. - *

- * The only method that needs to be implemented by subclasses is {@link yfiles.styles.NodeStyleBase#createVisual}, however to - * improve rendering performance it is highly recommended to implement at least - * {@link yfiles.styles.NodeStyleBase#updateVisual}, too. - *

- *

- * This implementation differs from the straightforward {@link yfiles.styles.INodeStyle} implementation in that there is no visible - * separation between the style and its - * {@link yfiles.styles.INodeStyleRenderer}. Instead the renderer used by the base class is fixed and delegates all calls back to - * the style instance. - *

- *

Related demos:

- *
    - *
  • Demo: SimpleCustomStyle, demo.yfiles.style.simplecustomstyle
  • - *
  • Tutorial: 02 Custom Styles, step 01 Custom Node Style
  • - *
  • Tutorial: 02 Custom Styles, step 03 UpdateVisual and RenderDataCache
  • - *
  • Tutorial: 02 Custom Styles, step 05 Hit Test
  • - *
- * @class - * @implements {yfiles.styles.INodeStyle} - */ - export interface NodeStyleBase extends yfiles.lang.Object,yfiles.styles.INodeStyle{} - export class NodeStyleBase { - /** - * Initializes a new instance of the {@link yfiles.styles.NodeStyleBase} class. - * @protected - */ - constructor(); - /** - * Creates a new object that is a copy of the current instance. - *

- * Immutable subclasses should consider returning this. - *

- * @returns A new object that is a copy of this instance using {@link #memberwiseClone}. - */ - clone():any; - /** - * Callback that creates the visual. - *

- * This method is called in response to a {@link yfiles.view.IVisualCreator#createVisual} call to the instance that has been - * queried from the {@link yfiles.styles.NodeStyleBase#renderer}. - *

- * @param context The render context. - * @param node The node to which this style instance is assigned. - * @returns The visual as required by the {@link #createVisual} interface. - * @see yfiles.styles.NodeStyleBase#updateVisual - * @protected - * @abstract - */ - createVisual(context:yfiles.view.IRenderContext,node:yfiles.graph.INode):yfiles.view.Visual; - /** - * Gets the bounds of the visual for the node in the given context. - *

- * This method is called in response to a {@link yfiles.view.IBoundsProvider#getBounds} call to the instance that has been queried - * from the {@link yfiles.styles.NodeStyleBase#renderer}. This implementation simply yields the {@link yfiles.graph.INode#layout}. - *

- * @param context The canvas context. - * @param node The node to which this style instance is assigned. - * @returns The visual bounds of the visual representation. - * @protected - */ - getBounds(context:yfiles.view.ICanvasContext,node:yfiles.graph.INode):yfiles.geometry.Rect; - /** - * Gets the intersection of a line with the visual representation of the node. - *

- * This method is called in response to a {@link yfiles.styles.IShapeGeometry#getIntersection} call to the instance that has been - * queried from the {@link yfiles.styles.NodeStyleBase#renderer}. This implementation simply uses the {@link yfiles.styles.NodeStyleBase#getOutline outline} to determine the intersection or the {@link yfiles.graph.INode#layout} if the outline is - * null. If it is feasible to determine the intersection point for the current shape, this method should be implemented in - * addition to {@link yfiles.styles.NodeStyleBase#getOutline} to improve performance. - *

- * @param node The node to which this style instance is assigned. - * @param inner The coordinates of a point lying {@link #isInside inside} the shape. - * @param outer The coordinates of a point lying outside the shape. - * @returns The intersection point if one has been found or null, otherwise. - * @see yfiles.styles.NodeStyleBase#isInside - * @protected - */ - getIntersection(node:yfiles.graph.INode,inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Gets the outline of the visual style. - *

- * This implementation yields null to indicate that the {@link yfiles.graph.INode#layout} depicts the outline. Implementing this method influences the - * behavior of {@link yfiles.styles.NodeStyleBase#isInside} and {@link yfiles.styles.NodeStyleBase#getIntersection} since the default - * implementations delegate to it. - *

- * @param node The node to which this style instance is assigned. - * @returns The outline of the visual representation or null. - * @protected - */ - getOutline(node:yfiles.graph.INode):yfiles.geometry.GeneralPath; - /** - * Determines whether the visual representation of the node has been hit at the given location. - *

- * This method is called in response to a {@link yfiles.input.IHitTestable#isHit} call to the instance that has been queried from - * the {@link yfiles.styles.NodeStyleBase#renderer}. This implementation uses the {@link yfiles.styles.NodeStyleBase#getOutline outline} to determine whether the node has been hit. - *

- * @param context The canvas context. - * @param location The point to test. - * @param node The node to which this style instance is assigned. - * @returns true if the specified node representation is hit; false otherwise. - * @protected - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,node:yfiles.graph.INode):boolean; - /** - * Determines whether the visualization for the specified node is included in the marquee selection. - *

- * This method is called in response to a {@link yfiles.input.IMarqueeTestable#isInBox} call to the instance that has been queried - * from the {@link yfiles.styles.NodeStyleBase#renderer}. This implementation simply tests whether the {@link yfiles.styles.NodeStyleBase#getBounds bounds} intersect the marquee box. - *

- * @param context The input mode context. - * @param rectangle The marquee selection box. - * @param node The node to which this style instance is assigned. - * @returns true if the specified node is visible is selected by the marquee rectangle; false otherwise. - * @protected - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect,node:yfiles.graph.INode):boolean; - /** - * Determines whether the provided point is geometrically inside the visual bounds of the node. - *

- * This method is called in response to a {@link yfiles.styles.IShapeGeometry#isInside} call to the instance that has been queried - * from the {@link yfiles.styles.NodeStyleBase#renderer}. This implementation simply uses the {@link yfiles.styles.NodeStyleBase#getOutline outline} to determine whether the point is contained or the {@link yfiles.graph.INode#layout} if the - * outline is null. If it is feasible to determine whether a given point lies inside the shape, this method should be - * implemented in addition to {@link yfiles.styles.NodeStyleBase#getOutline} to improve performance. - *

- * @param node The node to which this style instance is assigned. - * @param location The point to test. - * @returns Whether the point is considered to lie inside the shape. - * @protected - */ - isInside(node:yfiles.graph.INode,location:yfiles.geometry.Point):boolean; - /** - * Determines whether the visualization for the specified node is visible in the context. - *

- * This method is called in response to a {@link yfiles.view.IVisibilityTestable#isVisible} call to the instance that has been - * queried from the {@link yfiles.styles.NodeStyleBase#renderer}. This implementation simply tests whether the {@link yfiles.styles.NodeStyleBase#getBounds bounds} intersect the clip. - *

- * @param context The canvas context. - * @param rectangle The clipping rectangle. - * @param node The node to which this style instance is assigned. - * @returns true if the specified node is visible in the clipping rectangle; false otherwise. - * @protected - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect,node:yfiles.graph.INode):boolean; - /** - * Performs the {@link yfiles.graph.ILookup#lookup} operation for the {@link yfiles.styles.INodeStyleRenderer#getContext} that has been - * queried from the {@link yfiles.styles.NodeStyleBase#renderer}. - *

- * This implementation yields null for everything but: - *

- *
    - *
  • {@link yfiles.input.IHitTestable}
  • - *
  • {@link yfiles.view.IVisualCreator}
  • - *
  • {@link yfiles.view.IBoundsProvider}
  • - *
  • {@link yfiles.view.IVisibilityTestable}
  • - *
  • {@link yfiles.input.IMarqueeTestable}
  • - *
  • {@link yfiles.graph.ILookup}
  • - *
  • {@link yfiles.styles.IShapeGeometry}
  • - *
- *

- * For these interfaces an implementation will be returned that delegates to the methods in this instance. - *

- * @param node The node to use for the context lookup. - * @param type The type to query. - * @returns An implementation of the type or null. - * @protected - */ - lookup(node:yfiles.graph.INode,type:yfiles.lang.Class):any; - /** - * Callback that updates the visual previously created by {@link yfiles.styles.NodeStyleBase#createVisual}. - *

- * This method is called in response to a {@link yfiles.view.IVisualCreator#updateVisual} call to the instance that has been - * queried from the {@link yfiles.styles.NodeStyleBase#renderer}. This implementation simply delegates to {@link yfiles.styles.NodeStyleBase#createVisual} so subclasses should - * override to improve rendering performance. - *

- * @param context The render context. - * @param oldVisual The visual that has been created in the call to {@link #createVisual}. - * @param node The node to which this style instance is assigned. - * @returns The visual as required by the {@link #createVisual} interface. - * @see yfiles.styles.NodeStyleBase#createVisual - * @protected - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual,node:yfiles.graph.INode):yfiles.view.Visual; - /** - * Gets the renderer implementation for this instance. - *

- * The private implementation will delegate all API calls back to this instance. - *

- * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.NodeStyleBase; - } - /** - * A label style decorator that uses a node style instance to render the background and a label style instance to render - * the foreground of a label. - *

- * The renderer of the {@link yfiles.styles.NodeStyleLabelStyleAdapter#nodeStyle} used by this class must create {@link yfiles.view.SvgVisual}s. - *

- * @class - * @implements {yfiles.styles.ILabelStyle} - */ - export interface NodeStyleLabelStyleAdapter extends yfiles.lang.Object,yfiles.styles.ILabelStyle{} - export class NodeStyleLabelStyleAdapter { - /** - * Creates a label style that uses the provided node style to render the background and the label style to render the - * foreground of this style. - *

- * Note that the styles will be stored by reference, thus modifying the style will directly affect the rendering of this - * instance. - *

- * @param nodeStyle The style to use for rendering the background of the label. - * @param labelStyle The style to use for rendering the foreground of the label. - */ - constructor(nodeStyle:yfiles.styles.INodeStyle,labelStyle:yfiles.styles.ILabelStyle); - /** - * Creates a label style that uses the provided node style to render the background and the label style to render the - * foreground of this style. - *

- * Note that the styles will be stored by reference, thus modifying the style will directly affect the rendering of this - * instance. - *

- * @param {Object} options The parameters to pass. - * @param options.nodeStyle The style to use for rendering the background of the label. - * @param options.labelStyle The style to use for rendering the foreground of the label. - * @param {boolean} options.autoFlip A value indicating whether the label should be flipped 180 degrees automatically, if it would be oriented downwards, otherwise. - *

- * This option sets the {@link yfiles.styles.NodeStyleLabelStyleAdapter#autoFlip} property on the created object. - *

- * @param {yfiles.geometry.Insets} options.labelStyleInsets The insets to apply for the {@link yfiles.styles.NodeStyleLabelStyleAdapter#labelStyle} as margins. - *

- * This option sets the {@link yfiles.styles.NodeStyleLabelStyleAdapter#labelStyleInsets} property on the created object. - *

- */ - constructor(options:{nodeStyle:yfiles.styles.INodeStyle,labelStyle:yfiles.styles.ILabelStyle,autoFlip?:boolean,labelStyleInsets?:yfiles.geometry.Insets}); - /** - * Initializes a new instance of the {@link yfiles.styles.NodeStyleLabelStyleAdapter} class. - *

- * This constructor uses a {@link yfiles.styles.ShapeNodeStyle} and a {@link yfiles.styles.DefaultLabelStyle} for the {@link yfiles.styles.NodeStyleLabelStyleAdapter#nodeStyle} and {@link yfiles.styles.NodeStyleLabelStyleAdapter#labelStyle} properties. - *

- * @param {Object} [options=null] The parameters to pass. - * @param {boolean} options.autoFlip A value indicating whether the label should be flipped 180 degrees automatically, if it would be oriented downwards, otherwise. - *

- * This option sets the {@link yfiles.styles.NodeStyleLabelStyleAdapter#autoFlip} property on the created object. - *

- * @param {yfiles.styles.ILabelStyle} options.labelStyle The {@link yfiles.styles.ILabelStyle} that is used for rendering the foreground of the label. - *

- * This option sets the {@link yfiles.styles.NodeStyleLabelStyleAdapter#labelStyle} property on the created object. - *

- * @param {yfiles.geometry.Insets} options.labelStyleInsets The insets to apply for the {@link yfiles.styles.NodeStyleLabelStyleAdapter#labelStyle} as margins. - *

- * This option sets the {@link yfiles.styles.NodeStyleLabelStyleAdapter#labelStyleInsets} property on the created object. - *

- * @param {yfiles.styles.INodeStyle} options.nodeStyle The {@link yfiles.styles.INodeStyle} that is used for rendering the background of the label. - *

- * This option sets the {@link yfiles.styles.NodeStyleLabelStyleAdapter#nodeStyle} property on the created object. - *

- */ - constructor(options?:{autoFlip?:boolean,labelStyle?:yfiles.styles.ILabelStyle,labelStyleInsets?:yfiles.geometry.Insets,nodeStyle?:yfiles.styles.INodeStyle}); - /** - * - * @returns - */ - clone():any; - /** - * - * @type {yfiles.styles.ILabelStyleRenderer} - */ - renderer:yfiles.styles.ILabelStyleRenderer; - /** - * Gets the {@link yfiles.styles.INodeStyle} that is used for rendering the background of the label. - * @type {yfiles.styles.INodeStyle} - */ - nodeStyle:yfiles.styles.INodeStyle; - /** - * Gets the {@link yfiles.styles.ILabelStyle} that is used for rendering the foreground of the label. - * @type {yfiles.styles.ILabelStyle} - */ - labelStyle:yfiles.styles.ILabelStyle; - /** - * Gets a value indicating whether the label should be flipped 180 degrees automatically, if it would be oriented - * downwards, otherwise. - * @default true - * @type {boolean} - */ - autoFlip:boolean; - /** - * Gets or sets the insets to apply for the {@link yfiles.styles.NodeStyleLabelStyleAdapter#labelStyle} as margins. - * @default '0' - * @type {yfiles.geometry.Insets} - */ - labelStyleInsets:yfiles.geometry.Insets; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.NodeStyleLabelStyleAdapter; - } - /** - * A port style decorator that uses a node style instance to render the port. - *

- * The renderer of the {@link yfiles.styles.NodeStylePortStyleAdapter#nodeStyle} used by this class must create {@link yfiles.view.SvgVisual}s. - *

- * @class - * @implements {yfiles.styles.IPortStyle} - */ - export interface NodeStylePortStyleAdapter extends yfiles.lang.Object,yfiles.styles.IPortStyle{} - export class NodeStylePortStyleAdapter { - /** - * Creates a port style that uses the provided node style to render the port. - *

- * Note that the styles will be stored by reference, thus modifying the style will directly affect the rendering of this - * instance. - *

- * @param nodeStyle The style to use for rendering the port. - */ - constructor(nodeStyle:yfiles.styles.INodeStyle); - /** - * Creates a port style that uses the provided node style to render the port. - *

- * Note that the styles will be stored by reference, thus modifying the style will directly affect the rendering of this - * instance. - *

- * @param {Object} options The parameters to pass. - * @param options.nodeStyle The style to use for rendering the port. - * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.MutableSize} of the port that will be displayed using {@link yfiles.styles.NodeStylePortStyleAdapter#nodeStyle}. - *

- * This option sets the {@link yfiles.styles.NodeStylePortStyleAdapter#renderSize} property on the created object. - *

- */ - constructor(options:{nodeStyle:yfiles.styles.INodeStyle,renderSize?:yfiles.geometry.Size}); - /** - * Initializes a new instance of the {@link yfiles.styles.NodeStylePortStyleAdapter} class. - *

- * This constructor uses an ellipse {@link yfiles.styles.ShapeNodeStyle} with a black {@link yfiles.view.Fill} for the {@link yfiles.styles.NodeStylePortStyleAdapter#nodeStyle} property. - *

- * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.styles.INodeStyle} options.nodeStyle The {@link yfiles.styles.INodeStyle} that is used for rendering the port. - *

- * This option sets the {@link yfiles.styles.NodeStylePortStyleAdapter#nodeStyle} property on the created object. - *

- * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.MutableSize} of the port that will be displayed using {@link yfiles.styles.NodeStylePortStyleAdapter#nodeStyle}. - *

- * This option sets the {@link yfiles.styles.NodeStylePortStyleAdapter#renderSize} property on the created object. - *

- */ - constructor(options?:{nodeStyle?:yfiles.styles.INodeStyle,renderSize?:yfiles.geometry.Size}); - /** - * - * @returns - */ - clone():any; - /** - * - * @type {yfiles.styles.IPortStyleRenderer} - */ - renderer:yfiles.styles.IPortStyleRenderer; - /** - * Gets the {@link yfiles.styles.INodeStyle} that is used for rendering the port. - * @type {yfiles.styles.INodeStyle} - */ - nodeStyle:yfiles.styles.INodeStyle; - /** - * Gets or sets the {@link yfiles.geometry.MutableSize} of the port that will be displayed using {@link yfiles.styles.NodeStylePortStyleAdapter#nodeStyle}. - *

- * The default value is (5,5). - *

- * @default '5,5' - * @type {yfiles.geometry.Size} - */ - renderSize:yfiles.geometry.Size; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.NodeStylePortStyleAdapter; - } - /** - * An abstract base class that makes it possible to easily implement a custom {@link yfiles.styles.IPortStyle}. - *

- * Only {@link yfiles.styles.PortStyleBase#createVisual} and {@link yfiles.styles.PortStyleBase#getBounds} need to be implemented by - * subclasses, however to improve rendering performance it is highly recommended to implement at least - * {@link yfiles.styles.PortStyleBase#updateVisual}, too. - *

- *

- * This implementation differs from the straightforward {@link yfiles.styles.IPortStyle} implementation in that there is no visible - * separation between the style and its - * {@link yfiles.styles.IPortStyleRenderer}. Instead the renderer used by the base class is fixed and delegates all calls back to - * the style instance. - *

- *

Related demos:

- *
    - *
  • Demo: SimpleCustomStyle, demo.yfiles.style.simplecustomstyle
  • - *
  • Tutorial: 02 Custom Styles, step 22 Custom Ports
  • - *
- * @class - * @implements {yfiles.styles.IPortStyle} - */ - export interface PortStyleBase extends yfiles.lang.Object,yfiles.styles.IPortStyle{} - export class PortStyleBase { - /** - * Initializes a new instance of the {@link yfiles.styles.PortStyleBase} class. - * @protected - */ - constructor(); - /** - * Creates a new object that is a copy of the current instance. - *

- * Immutable subclasses should consider returning this. - *

- * @returns A new object that is a copy of this instance using {@link #memberwiseClone}. - */ - clone():any; - /** - * Callback that creates the visual. - *

- * This method is called in response to a {@link yfiles.view.IVisualCreator#createVisual} call to the instance that has been - * queried from the {@link yfiles.styles.PortStyleBase#renderer}. - *

- * @param context The render context. - * @param port The port to which this style instance is assigned. - * @returns The visual as required by the {@link #createVisual} interface. - * @see yfiles.styles.PortStyleBase#updateVisual - * @protected - * @abstract - */ - createVisual(context:yfiles.view.IRenderContext,port:yfiles.graph.IPort):yfiles.view.Visual; - /** - * Callback that returns the bounds of the visual for the port in the given context. - * @param context The canvas context. - * @param port The port to which this style instance is assigned. - * @returns The visual bounds of the visual representation. - * @protected - * @abstract - */ - getBounds(context:yfiles.view.ICanvasContext,port:yfiles.graph.IPort):yfiles.geometry.Rect; - /** - * Determines whether the visual representation of the port has been hit at the given location. - *

- * This method is called in response to a {@link yfiles.input.IHitTestable#isHit} call to the instance that has been queried from - * the {@link yfiles.styles.PortStyleBase#renderer}. - *

- *

- * This implementation uses the {@link yfiles.styles.PortStyleBase#getBounds bounds} to determine whether the port has been hit. - *

- * @param context The input mode context. - * @param location The point to test. - * @param port The port to which this style instance is assigned. - * @returns true if the specified port representation is hit; false otherwise. - * @protected - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,port:yfiles.graph.IPort):boolean; - /** - * Determines whether the visualization for the specified port is included in the marquee selection. - *

- * This method is called in response to a {@link yfiles.input.IMarqueeTestable#isInBox} call to the instance that has been queried - * from the {@link yfiles.styles.PortStyleBase#renderer}. - *

- *

- * This implementation simply tests whether the {@link yfiles.styles.PortStyleBase#getBounds bounds} intersect the marquee box. - *

- * @param context The input mode context. - * @param rectangle The marquee selection box. - * @param port The port to which this style instance is assigned. - * @returns true if the specified port is visible is selected by the marquee rectangle; false otherwise. - * @protected - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect,port:yfiles.graph.IPort):boolean; - /** - * Determines whether the visualization for the specified port is visible in the context. - *

- * This method is called in response to a {@link yfiles.view.IVisibilityTestable#isVisible} call to the instance that has been - * queried from the {@link yfiles.styles.PortStyleBase#renderer}. This implementation simply tests whether the {@link yfiles.styles.PortStyleBase#getBounds bounds} intersect the clip. - *

- * @param context The canvas context. - * @param rectangle The clipping rectangle. - * @param port The port to which this style instance is assigned. - * @returns true if the specified port is visible in the clipping rectangle; false otherwise. - * @protected - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect,port:yfiles.graph.IPort):boolean; - /** - * Performs the {@link yfiles.graph.ILookup#lookup} operation for the {@link yfiles.styles.IPortStyleRenderer#getContext} that has been - * queried from the {@link yfiles.styles.PortStyleBase#renderer}. - *

- * This implementation yields null for everything but: - *

- *
    - *
  • {@link yfiles.input.IHitTestable}
  • - *
  • {@link yfiles.view.IVisualCreator}
  • - *
  • {@link yfiles.view.IBoundsProvider}
  • - *
  • {@link yfiles.view.IVisibilityTestable}
  • - *
  • {@link yfiles.input.IMarqueeTestable}
  • - *
  • {@link yfiles.graph.ILookup}
  • - *
- *

- * For these interfaces an implementation will be returned that delegates to the methods in this instance. - *

- * @param port The port to use for the context lookup. - * @param type The type to query. - * @returns An implementation of the type or null. - * @protected - */ - lookup(port:yfiles.graph.IPort,type:yfiles.lang.Class):any; - /** - * Callback that updates the visual previously created by {@link yfiles.styles.PortStyleBase#createVisual}. - *

- * This method is called in response to a {@link yfiles.view.IVisualCreator#updateVisual} call to the instance that has been - * queried from the {@link yfiles.styles.PortStyleBase#renderer}. This implementation simply delegates to {@link yfiles.styles.PortStyleBase#createVisual} so subclasses should - * override to improve rendering performance. - *

- * @param context The render context. - * @param oldVisual The visual that has been created in the call to {@link #createVisual}. - * @param port The port to which this style instance is assigned. - * @returns The visual as required by the {@link #createVisual} interface. - * @see yfiles.styles.PortStyleBase#createVisual - * @protected - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual,port:yfiles.graph.IPort):yfiles.view.Visual; - /** - * Gets the renderer implementation for this instance. - *

- * The private implementation will delegate all API calls back to this instance. - *

- * @type {yfiles.styles.IPortStyleRenderer} - */ - renderer:yfiles.styles.IPortStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.PortStyleBase; - } - /** - * A utility class that provides {@link yfiles.styles.TextRenderSupport#measureText text size measurement} and {@link yfiles.styles.TextRenderSupport#addText text placement} functionality, for instance, for label rendering - * and measurement. - * @class - */ - export interface TextRenderSupport extends yfiles.lang.Object{} - export class TextRenderSupport { - /** - * Add the text content to the provided SVG text element. - * @param targetElement An SVG text element to add the provided text to (either as textContent, or by appending tspan elements). - * @param text The text content to add to the provided text element (may contain newline characters). - * @param font The {@link } that defines the font properties to apply to the added text. - * @param maximumSize The bounds that shouldn't be exceeded when placing the text; null or not provided means unbound. - * @param [wrapping=yfiles.view.TextWrapping.NONE] The {@link } policy to apply when the text exceeds the provided maximumSize; {@link #WORD} - * per default. - * @param [measurePolicy=yfiles.styles.TextMeasurePolicy.AUTOMATIC] The measure policy to use for measuring the size of the text; {@link #AUTOMATIC} per default. - * @returns The text that was actually placed in the targetElement. - * @static - */ - static addText(targetElement:SVGTextElement,text:string,font:yfiles.view.Font,maximumSize:yfiles.geometry.Size,wrapping?:yfiles.view.TextWrapping,measurePolicy?:yfiles.styles.TextMeasurePolicy):string; - /** - * Add the text content to the provided SVG text element. - * @param {Object} options The parameters to pass. - * @param options.targetElement An SVG text element to add the provided text to (either as textContent, or by appending tspan elements). - * @param options.text The text content to add to the provided text element (may contain newline characters). - * @param options.font The {@link } that defines the font properties to apply to the added text. - * @param options.maximumSize The bounds that shouldn't be exceeded when placing the text; null or not provided means unbound. - * @param [options.wrapping=yfiles.view.TextWrapping.NONE] The {@link } policy to apply when the text exceeds the provided maximumSize; {@link #WORD} - * per default. - * @param [options.measurePolicy=yfiles.styles.TextMeasurePolicy.AUTOMATIC] The measure policy to use for measuring the size of the text; {@link #AUTOMATIC} per default. - * @returns The text that was actually placed in the targetElement. - * @static - */ - static addText(options:{targetElement:SVGTextElement,text:string,font:yfiles.view.Font,maximumSize:yfiles.geometry.Size,wrapping?:yfiles.view.TextWrapping,measurePolicy?:yfiles.styles.TextMeasurePolicy}):string; - /** - * Calculate the width and height required to render the provided text using the provided {@link yfiles.view.Font}. - * @param text The text that should be measured. - * @param font The {@link } to apply to the text before measuring. - * @param [measurePolicy=yfiles.styles.TextMeasurePolicy.AUTOMATIC] The measure policy to use for measuring the size of the text; {@link #AUTOMATIC} per default. - * @returns The measured text size - * @static - */ - static measureText(text:string,font:yfiles.view.Font,measurePolicy?:yfiles.styles.TextMeasurePolicy):yfiles.geometry.Size; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TextRenderSupport; - } - export enum TextMeasurePolicy{ - /** - * The measure policy will be determined heuristically. - */ - AUTOMATIC, - /** - * Use getBBox() to measure the size of text elements. - */ - SVG, - /** - * Use CanvasRenderingContext2D.measureText() to measure the width of text elements. - */ - CANVAS - } - /** - * A basic label style which renders the label's {@link yfiles.graph.ILabel#text} and optionally a {@link yfiles.styles.DefaultLabelStyle#backgroundFill background} and {@link yfiles.styles.DefaultLabelStyle#backgroundStroke border}. - *

- * This style uses a {@link yfiles.styles.DefaultLabelStyleRenderer} to create its visualization. - *

- * @class - * @implements {yfiles.styles.ILabelStyle} - */ - export interface DefaultLabelStyle extends yfiles.lang.Object,yfiles.styles.ILabelStyle{} - export class DefaultLabelStyle { - /** - * Creates a new instance using the provided renderer. - * @param renderer The custom renderer for this style instance. - */ - constructor(renderer:yfiles.styles.ILabelStyleRenderer); - /** - * Creates a new instance using the provided renderer. - * @param {Object} options The parameters to pass. - * @param options.renderer The custom renderer for this style instance. - * @param {boolean} options.autoFlip A value indicating whether the label should be flipped 180 degrees automatically, if it would be oriented downwards, otherwise. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#autoFlip} property on the created object. - *

- * @param {yfiles.view.Fill} options.backgroundFill The brush to use for the background box of the label. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#backgroundFill} property on the created object. - *

- * @param {yfiles.view.Stroke} options.backgroundStroke The pen to use for the background box of the label. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#backgroundStroke} property on the created object. - *

- * @param {boolean} options.clipText A value that determines whether text should be clipped. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#clipText} property on the created object. - *

- * @param {yfiles.view.HorizontalTextAlignment} options.horizontalTextAlignment The text alignment. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#horizontalTextAlignment} property on the created object. - *

- * @param {yfiles.view.Fill} options.textFill The brush to use for the label's text. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#textFill} property on the created object. - *

- * @param {number} options.textSize The size of the text. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#textSize} property on the created object. - *

- * @param {yfiles.view.TextWrapping} options.wrapping The text trimming. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#wrapping} property on the created object. - *

- * @param {yfiles.view.Font} options.font The typeface to use for the label. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#font} property on the created object. - *

- * @param {yfiles.view.VerticalTextAlignment} options.verticalTextAlignment The vertical text alignment to use if the label is assigned more space than needed. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#verticalTextAlignment} property on the created object. - *

- */ - constructor(options:{renderer:yfiles.styles.ILabelStyleRenderer,autoFlip?:boolean,backgroundFill?:yfiles.view.Fill,backgroundStroke?:yfiles.view.Stroke,clipText?:boolean,horizontalTextAlignment?:yfiles.view.HorizontalTextAlignment,textFill?:yfiles.view.Fill,textSize?:number,wrapping?:yfiles.view.TextWrapping,font?:yfiles.view.Font,verticalTextAlignment?:yfiles.view.VerticalTextAlignment}); - /** - * Creates a new instance using {@link yfiles.styles.DefaultLabelStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {boolean} options.autoFlip A value indicating whether the label should be flipped 180 degrees automatically, if it would be oriented downwards, otherwise. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#autoFlip} property on the created object. - *

- * @param {yfiles.view.Fill} options.backgroundFill The brush to use for the background box of the label. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#backgroundFill} property on the created object. - *

- * @param {yfiles.view.Stroke} options.backgroundStroke The pen to use for the background box of the label. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#backgroundStroke} property on the created object. - *

- * @param {boolean} options.clipText A value that determines whether text should be clipped. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#clipText} property on the created object. - *

- * @param {yfiles.view.HorizontalTextAlignment} options.horizontalTextAlignment The text alignment. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#horizontalTextAlignment} property on the created object. - *

- * @param {yfiles.view.Fill} options.textFill The brush to use for the label's text. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#textFill} property on the created object. - *

- * @param {number} options.textSize The size of the text. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#textSize} property on the created object. - *

- * @param {yfiles.view.TextWrapping} options.wrapping The text trimming. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#wrapping} property on the created object. - *

- * @param {yfiles.view.Font} options.font The typeface to use for the label. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#font} property on the created object. - *

- * @param {yfiles.view.VerticalTextAlignment} options.verticalTextAlignment The vertical text alignment to use if the label is assigned more space than needed. - *

- * This option sets the {@link yfiles.styles.DefaultLabelStyle#verticalTextAlignment} property on the created object. - *

- */ - constructor(options?:{autoFlip?:boolean,backgroundFill?:yfiles.view.Fill,backgroundStroke?:yfiles.view.Stroke,clipText?:boolean,horizontalTextAlignment?:yfiles.view.HorizontalTextAlignment,textFill?:yfiles.view.Fill,textSize?:number,wrapping?:yfiles.view.TextWrapping,font?:yfiles.view.Font,verticalTextAlignment?:yfiles.view.VerticalTextAlignment}); - /** - * - * @returns - */ - clone():any; - /** - * Gets or sets the brush to use for the background box of the label. - *

- * The default value is null. - *

- * @default null - * @type {yfiles.view.Fill} - */ - backgroundFill:yfiles.view.Fill; - /** - * Gets or sets the vertical text alignment to use if the label is assigned more space than needed. - *

- * The default value is {@link yfiles.view.VerticalTextAlignment#TOP}. - *

- * @default yfiles.view.VerticalTextAlignment.TOP - * @type {yfiles.view.VerticalTextAlignment} - */ - verticalTextAlignment:yfiles.view.VerticalTextAlignment; - /** - * Gets or sets the text alignment. - *

- * The default value is {@link yfiles.view.HorizontalTextAlignment#LEFT}. - *

- * @default yfiles.view.HorizontalTextAlignment.LEFT - * @type {yfiles.view.HorizontalTextAlignment} - */ - horizontalTextAlignment:yfiles.view.HorizontalTextAlignment; - /** - * Gets or sets the text trimming. - *

- * The default value is {@link yfiles.view.TextWrapping#NONE}. - *

- * @default yfiles.view.TextWrapping.NONE - * @type {yfiles.view.TextWrapping} - */ - wrapping:yfiles.view.TextWrapping; - /** - * Gets or sets a value that determines whether text should be clipped. - *

- * The default value is true. - *

- * @default true - * @type {boolean} - */ - clipText:boolean; - /** - * Gets or sets the pen to use for the background box of the label. - *

- * The default value is null. - *

- * @default null - * @type {yfiles.view.Stroke} - */ - backgroundStroke:yfiles.view.Stroke; - /** - * - * @type {yfiles.styles.ILabelStyleRenderer} - */ - renderer:yfiles.styles.ILabelStyleRenderer; - /** - * Gets or sets the typeface to use for the label. - *

- * The default value is an instance of {@link yfiles.styles.DefaultLabelStyle#font} for Arial". - *

- * @throws {Stubs.Exceptions.ArgumentError} value cannot be null! - * @type {yfiles.view.Font} - */ - font:yfiles.view.Font; - /** - * Gets or sets a value indicating whether the label should be flipped 180 degrees automatically, if it would be oriented - * downwards, otherwise. - *

- * The default value is true. - *

- * @default true - * @type {boolean} - */ - autoFlip:boolean; - /** - * Gets or sets the brush to use for the label's text. - *

- * The default value is {@link yfiles.view.Fill#BLACK}. - *

- * @throws {Stubs.Exceptions.ArgumentError} value cannot be null! - * @default 'Black' - * @type {yfiles.view.Fill} - */ - textFill:yfiles.view.Fill; - /** - * Gets or sets the size of the text. - *

- * This property delegates to the size of the {@link yfiles.styles.DefaultLabelStyle#font} property. - *

- *

- * The default value is 12.0d. - *

- * @default 12 - * @type {number} - */ - textSize:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.DefaultLabelStyle; - } - /** - * A label style that draws an icon in addition to the text. - *

- * This style draws the icon at the location specified by {@link yfiles.styles.IconLabelStyle#iconPlacement} and delegates the drawing of the label's text to the {@link yfiles.styles.IconLabelStyle#wrapped} style. - *

- * @class - * @implements {yfiles.styles.ILabelStyle} - */ - export interface IconLabelStyle extends yfiles.lang.Object,yfiles.styles.ILabelStyle{} - export class IconLabelStyle { - /** - * Creates a new instance using the provided icon and renderer. - * @param icon The icon to draw. - * @param [renderer=null] The custom renderer for this style instance. - */ - constructor(icon:string,renderer?:yfiles.styles.ILabelStyleRenderer); - /** - * Creates a new instance using the provided icon and renderer. - * @param {Object} options The parameters to pass. - * @param options.icon The icon to draw. - * @param [options.renderer=null] The custom renderer for this style instance. - * @param {boolean} options.autoFlip A value indicating whether to automatically flip the rendering should the {@link yfiles.graph.ILabel#layout layout}'s {@link yfiles.geometry.IOrientedRectangle#upY up vector} point downwards. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#autoFlip} property on the created object. - *

- * @param {yfiles.graph.ILabelModelParameter} options.iconPlacement The parameter that specifies the icon placement. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#iconPlacement} property on the created object. - *

- * @param {yfiles.geometry.Size} options.iconSize The size of the icon to paint for the label. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#iconSize} property on the created object. - *

- * @param {yfiles.styles.ILabelStyle} options.wrapped The style that renders the text of the label. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#wrapped} property on the created object. - *

- * @param {yfiles.geometry.Insets} options.wrappedInsets The insets that should be applied for the {@link yfiles.graph.ILabel#layout layout} of the {@link yfiles.styles.IconLabelStyle#wrapped wrapped style} rendering. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#wrappedInsets} property on the created object. - *

- */ - constructor(options:{icon:string,renderer?:yfiles.styles.ILabelStyleRenderer,autoFlip?:boolean,iconPlacement?:yfiles.graph.ILabelModelParameter,iconSize?:yfiles.geometry.Size,wrapped?:yfiles.styles.ILabelStyle,wrappedInsets?:yfiles.geometry.Insets}); - /** - * Creates a new instance using no icon and {@link yfiles.styles.IconLabelStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {boolean} options.autoFlip A value indicating whether to automatically flip the rendering should the {@link yfiles.graph.ILabel#layout layout}'s {@link yfiles.geometry.IOrientedRectangle#upY up vector} point downwards. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#autoFlip} property on the created object. - *

- * @param {string} options.icon The URL of the icon. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#icon} property on the created object. - *

- * @param {yfiles.graph.ILabelModelParameter} options.iconPlacement The parameter that specifies the icon placement. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#iconPlacement} property on the created object. - *

- * @param {yfiles.geometry.Size} options.iconSize The size of the icon to paint for the label. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#iconSize} property on the created object. - *

- * @param {yfiles.styles.ILabelStyle} options.wrapped The style that renders the text of the label. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#wrapped} property on the created object. - *

- * @param {yfiles.geometry.Insets} options.wrappedInsets The insets that should be applied for the {@link yfiles.graph.ILabel#layout layout} of the {@link yfiles.styles.IconLabelStyle#wrapped wrapped style} rendering. - *

- * This option sets the {@link yfiles.styles.IconLabelStyle#wrappedInsets} property on the created object. - *

- */ - constructor(options?:{autoFlip?:boolean,icon?:string,iconPlacement?:yfiles.graph.ILabelModelParameter,iconSize?:yfiles.geometry.Size,wrapped?:yfiles.styles.ILabelStyle,wrappedInsets?:yfiles.geometry.Insets}); - /** - * - * @returns - */ - clone():any; - /** - * Gets or sets the URL of the icon. - *

- * The URL can either be a relative URL, an absolute URL, or a Data URI. Relative URLs are resolved relative to the - * document. Eventually, this string becomes the value of the href attribute of an SVG image element. - *

- * @type {string} - */ - icon:string; - /** - * Gets or sets the size of the icon to paint for the label. - *

- * The default value is {@link yfiles.geometry.Size#EMPTY}. - *

- * @type {yfiles.geometry.Size} - */ - iconSize:yfiles.geometry.Size; - /** - * Gets or sets the parameter that specifies the icon placement. - *

- * All valid node label model parameters can be used. The label's {@link yfiles.graph.ILabel#layout layout} will be interpreted as the a node's layout and the - * icon will be placed relative to that layout as if it was a node's label. - *

- *

- * The default value is {@link yfiles.graph.ExteriorLabelModel#WEST}. - *

- * @throws {Stubs.Exceptions.ArgumentError} value is null. - * @type {yfiles.graph.ILabelModelParameter} - */ - iconPlacement:yfiles.graph.ILabelModelParameter; - /** - * Gets or sets the style that renders the text of the label. - *

- * This style will be rendered before the icon and is responsible for rendering the {@link yfiles.graph.ILabel#text}, since {@link yfiles.styles.IconLabelStyleRenderer} - * will only render the {@link yfiles.styles.IconLabelStyle#icon}. - *

- *

- * The default value is {@link yfiles.styles.DefaultLabelStyle}. - *

- * @throws {Stubs.Exceptions.ArgumentError} value is null. - * @type {yfiles.styles.ILabelStyle} - */ - wrapped:yfiles.styles.ILabelStyle; - /** - * Gets or sets the insets that should be applied for the {@link yfiles.graph.ILabel#layout layout} of the {@link yfiles.styles.IconLabelStyle#wrapped wrapped style} rendering. - *

- * The {@link yfiles.styles.IconLabelStyleRenderer#getPreferredSize} will take the preferred size of the {@link yfiles.styles.IconLabelStyle#wrapped}'s {@link yfiles.styles.ILabelStyleRenderer} - * and add these insets to it. During the {@link yfiles.view.IVisualCreator rendering} these insets will be used to offset the rendering of the wrapped - * style. - *

- *

- * The default insets are empty. - *

- * @default '0' - * @type {yfiles.geometry.Insets} - */ - wrappedInsets:yfiles.geometry.Insets; - /** - * - * @type {yfiles.styles.ILabelStyleRenderer} - */ - renderer:yfiles.styles.ILabelStyleRenderer; - /** - * Gets a value indicating whether to automatically flip the rendering should the {@link yfiles.graph.ILabel#layout layout}'s {@link yfiles.geometry.IOrientedRectangle#upY up vector} point downwards. - *

- * The default value is true. - *

- * @default true - * @type {boolean} - */ - autoFlip:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.IconLabelStyle; - } - /** - * A simple {@link yfiles.styles.ILabelStyleRenderer} implementation that can handle {@link yfiles.styles.DefaultLabelStyle} instances. - *

- * This implementation will just draw the label's {@link yfiles.graph.ILabel#text} using the properties provided by {@link yfiles.styles.DefaultLabelStyle} into - * the label's {@link yfiles.graph.ILabel#layout layout} area. - *

- * @class - * @implements {yfiles.styles.ILabelStyleRenderer} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface DefaultLabelStyleRenderer extends yfiles.lang.Object,yfiles.styles.ILabelStyleRenderer,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class DefaultLabelStyleRenderer { - /** - * Creates a new default instance. - */ - constructor(); - /** - * Add the text content to the provided SVG text element. - * @param textElement An SVG text element to add the provided text to. - * @param font The {@link } that defines the font properties to apply to the added text. - * @param text The text content to add to the provided text element (may contain newline characters). - * @param maxSize The bounds that shouldn't be exceeded when placing the text; null or not provided means unbound. - * @param wrapping The {@link } policy to apply when the text exceeds the provided maxSize. - * @returns - * @protected - */ - addTextElements(textElement:SVGTextElement,font:yfiles.view.Font,text:string,maxSize:yfiles.geometry.Size,wrapping:yfiles.view.TextWrapping):string; - /** - * Prepares this instance for subsequent calls after the style and label have been initialized. - *

- * Upon invocation the {@link yfiles.styles.DefaultLabelStyleRenderer#style} and {@link yfiles.styles.DefaultLabelStyleRenderer#label} properties have been populated by the - * {@link yfiles.styles.DefaultLabelStyleRenderer#getVisualCreator}, {@link yfiles.styles.DefaultLabelStyleRenderer#getBoundsProvider}, - * {@link yfiles.styles.DefaultLabelStyleRenderer#getHitTestable}, or {@link yfiles.styles.DefaultLabelStyleRenderer#getMarqueeTestable} - * methods. - *

- *

- * Stores the {@link yfiles.graph.ILabel#layout layout} into {@link yfiles.styles.DefaultLabelStyleRenderer#layout}. Subclasses which to override this method should call the base implementation. - *

- * @protected - */ - configure():void; - /** - * - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * - * @param context - * @returns - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the style and label parameters, calls {@link yfiles.styles.DefaultLabelStyleRenderer#configure} and returns this. - * @param label The label to retrieve the bounds provider for. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.DefaultLabelStyleRenderer#getBounds - */ - getBoundsProvider(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IBoundsProvider; - /** - * Configures the style and label parameters, does not call {@link yfiles.styles.DefaultLabelStyleRenderer#configure} and returns - * this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.DefaultLabelStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.DefaultLabelStyleRenderer#lookup} method call they should call - * {@link yfiles.styles.DefaultLabelStyleRenderer#configure} only if needed, i.e. if they decide to return this or an instance that - * depends on a correctly configured this. - *

- * @param label The label to query the context for. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.DefaultLabelStyleRenderer#lookup - */ - getContext(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.graph.ILookup; - /** - * Configures the style and label parameters, calls {@link yfiles.styles.DefaultLabelStyleRenderer#configure} and returns this. - * @param label The label to query hit test with. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.DefaultLabelStyleRenderer#isHit - */ - getHitTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IHitTestable; - /** - * Determines how the text should be aligned within the assigned label bounds. - * @returns This value as obtained from the style. - * @protected - */ - getHorizontalTextAlignment():yfiles.view.HorizontalTextAlignment; - /** - * Configures the style and label parameters, calls {@link yfiles.styles.DefaultLabelStyleRenderer#configure} and returns this. - * @param label The label to query marquee intersection tests. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.DefaultLabelStyleRenderer#isInBox - */ - getMarqueeTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IMarqueeTestable; - /** - * - * @param label - * @param style - * @returns - */ - getPreferredSize(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.geometry.Size; - /** - * Calculates the preferred size given the current state of the renderer. - * @returns The size as suggested by this renderer. - * @protected - */ - getPreferredSizeCore():yfiles.geometry.Size; - /** - * Determines how the text should be aligned vertically within the assigned label bounds. - * @returns This value as obtained from the style. - * @protected - */ - getVerticalTextAlignment():yfiles.view.VerticalTextAlignment; - /** - * Configures the style and label parameters, does not call {@link yfiles.styles.DefaultLabelStyleRenderer#configure} and returns - * this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.DefaultLabelStyleRenderer#configure}. If - * the subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.DefaultLabelStyleRenderer#isVisible}. - *

- * @param label The label to query visibility tests. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.DefaultLabelStyleRenderer#isVisible - */ - getVisibilityTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and label parameters, calls {@link yfiles.styles.DefaultLabelStyleRenderer#configure} and returns this. - * @param label The label to retrieve the {@link } for. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.DefaultLabelStyleRenderer#createVisual - * @see yfiles.styles.DefaultLabelStyleRenderer#updateVisual - */ - getVisualCreator(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisualCreator; - /** - * Determines how the text should be trimmed to fit the assigned label bounds. - * @returns This value as obtained from the style. - * @protected - */ - getWrapping():yfiles.view.TextWrapping; - /** - * Delegates to {@link yfiles.styles.DefaultLabelStyle#autoFlip} - * @returns Whether to flip the drawing if it is upside down. - * @protected - */ - isAutoFlip():boolean; - /** - * Determines whether text should be forced to be clipped inside the rectangle. - * @returns This value as obtained from the style. - * @protected - */ - isClippingText():boolean; - /** - * - * @param context - * @param location - * @returns - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Uses the {@link yfiles.graph.ILabel#layout} to determine whether the clip intersects. - * @param context - * @param rectangle - * @returns - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Implements the {@link yfiles.graph.ILookup} interface. - *

- * This method will be used by default if {@link yfiles.styles.DefaultLabelStyleRenderer#getContext} has been queried for a lookup - * implementation. Note that it cannot be assumed that {@link yfiles.styles.DefaultLabelStyleRenderer#configure} has already been - * invoked. However, normally {@link yfiles.styles.DefaultLabelStyleRenderer#label} and {@link yfiles.styles.DefaultLabelStyleRenderer#style} will be correctly configured if invoked directly after GetContext. Subclass - * implementations should make sure to configure this instance before they return this as a result of a successful lookup. - * This implementation will check if type.IsInstanceOfType(this) and will call {@link yfiles.styles.DefaultLabelStyleRenderer#configure} - * on success and return this. - *

- * @param type The type to query for. - * @returns An implementation or null. - */ - lookup(type:yfiles.lang.Class):any; - /** - * Calculate the width and height required to render the provided text using the provided {@link yfiles.view.Font}. - * @param text The text that should be measured. - * @param font The {@link } to apply to the text before measuring. - * @returns The text size. - * @protected - */ - measureText(text:string,font:yfiles.view.Font):yfiles.geometry.Size; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the current {@link yfiles.graph.ILabel#layout layout}. - * @protected - * @type {yfiles.geometry.IOrientedRectangle} - */ - layout:yfiles.geometry.IOrientedRectangle; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.DefaultLabelStyle} - */ - style:yfiles.styles.DefaultLabelStyle; - /** - * Gets or sets the currently configured label. - * @protected - * @type {yfiles.graph.ILabel} - */ - label:yfiles.graph.ILabel; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.DefaultLabelStyleRenderer; - } - /** - * An {@link yfiles.styles.ILabelStyleRenderer} that can handle {@link yfiles.styles.IconLabelStyle} instances. - *

- * This implementation renders the label's inner style and an icon. - *

- * @class - * @implements {yfiles.styles.ILabelStyleRenderer} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface IconLabelStyleRenderer extends yfiles.lang.Object,yfiles.styles.ILabelStyleRenderer,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class IconLabelStyleRenderer { - /** - * Creates a new instance of this renderer. - */ - constructor(); - /** - * - * @protected - */ - configure():void; - /** - * - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * - * @param context - * @returns - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the style and label parameters, calls {@link yfiles.styles.IconLabelStyleRenderer#configure} and returns this. - * @param label The label to retrieve the bounds provider for. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.IconLabelStyleRenderer#getBounds - */ - getBoundsProvider(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IBoundsProvider; - /** - * Configures the style and label parameters, does not call {@link yfiles.styles.IconLabelStyleRenderer#configure} and returns this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.IconLabelStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.IconLabelStyleRenderer#lookup} method call they should call {@link yfiles.styles.IconLabelStyleRenderer#configure} - * only if needed, i.e. if they decide to return this or an instance that depends on a correctly configured this. - *

- * @param label The label to query the context for. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.IconLabelStyleRenderer#lookup - */ - getContext(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.graph.ILookup; - /** - * Configures the style and label parameters, calls {@link yfiles.styles.IconLabelStyleRenderer#configure} and returns this. - * @param label The label to query hit test with. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.IconLabelStyleRenderer#isHit - */ - getHitTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IHitTestable; - /** - * Retrieves the {@link yfiles.styles.IconLabelStyle#icon} from the {@link yfiles.styles.IconLabelStyleRenderer#style}. - * @returns The icon. - * @protected - */ - getIcon():string; - /** - * Retrieves the {@link yfiles.styles.IconLabelStyle#iconPlacement} from the {@link yfiles.styles.IconLabelStyleRenderer#style}. - * @returns The placement parameter. - * @protected - */ - getIconPlacement():yfiles.graph.ILabelModelParameter; - /** - * Gets the size of the icon from the {@link yfiles.styles.IconLabelStyle#iconSize} property. - * @returns The size to use for the icon. - * @protected - */ - getIconSize():yfiles.geometry.Size; - /** - * Configures the style and label parameters, calls {@link yfiles.styles.IconLabelStyleRenderer#configure} and returns this. - * @param label The label to query marquee intersection tests. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.IconLabelStyleRenderer#isInBox - */ - getMarqueeTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IMarqueeTestable; - /** - * - * @param label - * @param style - * @returns - */ - getPreferredSize(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.geometry.Size; - /** - * Calculates the preferred size given the current state of the renderer. - * @returns The size as suggested by this renderer. - * @protected - */ - getPreferredSizeCore():yfiles.geometry.Size; - /** - * Configures the style and label parameters, does not call {@link yfiles.styles.IconLabelStyleRenderer#configure} and returns this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.IconLabelStyleRenderer#configure}. If the - * subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.IconLabelStyleRenderer#isVisible}. - *

- * @param label The label to query visibility tests. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.IconLabelStyleRenderer#isVisible - */ - getVisibilityTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and label parameters, calls {@link yfiles.styles.IconLabelStyleRenderer#configure} and returns this. - * @param label The label to retrieve the {@link } for. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.IconLabelStyleRenderer#createVisual - * @see yfiles.styles.IconLabelStyleRenderer#updateVisual - */ - getVisualCreator(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisualCreator; - /** - * Retrieves the {@link yfiles.styles.IconLabelStyle#wrapped} from the {@link yfiles.styles.IconLabelStyleRenderer#style}. - * @returns The style. - * @protected - */ - getWrappedStyle():yfiles.styles.ILabelStyle; - /** - * Retrieves the {@link yfiles.styles.IconLabelStyle#wrappedInsets} from the {@link yfiles.styles.IconLabelStyleRenderer#style}. - * @returns The insets. - * @protected - */ - getWrappedStyleInsets():yfiles.geometry.Insets; - /** - * Retrieves the {@link yfiles.styles.IconLabelStyle#autoFlip} property from the {@link yfiles.styles.IconLabelStyleRenderer#style}. - * @returns The autoflip property value. - * @protected - */ - isAutoFlip():boolean; - /** - * - * @param context - * @param location - * @returns - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Implements the {@link yfiles.graph.ILookup} interface. - *

- * This method will be used by default if {@link yfiles.styles.IconLabelStyleRenderer#getContext} has been queried for a lookup - * implementation. Note that it cannot be assumed that {@link yfiles.styles.IconLabelStyleRenderer#configure} has already been - * invoked. However, normally {@link yfiles.styles.IconLabelStyleRenderer#label} and {@link yfiles.styles.IconLabelStyleRenderer#style} will be correctly configured if invoked directly after GetContext. Subclass - * implementations should make sure to configure this instance before they return this as a result of a successful lookup. - * This implementation will check if type.IsInstanceOfType(this) and will call {@link yfiles.styles.IconLabelStyleRenderer#configure} - * on success and return this. - *

- * @param type The type to query for. - * @returns An implementation or null. - */ - lookup(type:yfiles.lang.Class):any; - /** - * Returns whether the icon bounds should be considered for hit testing. - * @returns true - * @protected - */ - shouldHitTestIcon():boolean; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.IconLabelStyle} - */ - style:yfiles.styles.IconLabelStyle; - /** - * Gets or sets the currently configured label. - * @protected - * @type {yfiles.graph.ILabel} - */ - label:yfiles.graph.ILabel; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.IconLabelStyleRenderer; - } - /** - * A node style that can display node shapes with a boundary that is defined by a {@link yfiles.geometry.GeneralPath} instance. - * @class - * @implements {yfiles.styles.INodeStyle} - */ - export interface GeneralPathNodeStyle extends yfiles.lang.Object,yfiles.styles.INodeStyle{} - export class GeneralPathNodeStyle { - /** - * Creates a new instance using the specified path and a custom renderer instance. - * @param path The path that defines the boundary of this style. - * @param [renderer=null] Custom renderer instance for this style - */ - constructor(path:yfiles.geometry.GeneralPath,renderer?:yfiles.styles.GeneralPathNodeStyleRenderer); - /** - * Creates a new instance using the specified path and a custom renderer instance. - * @param {Object} options The parameters to pass. - * @param options.path The path that defines the boundary of this style. - * @param [options.renderer=null] Custom renderer instance for this style - * @param {yfiles.view.Fill} options.fill The {@link yfiles.view.Fill} that is used to draw the shape. - *

- * This option sets the {@link yfiles.styles.GeneralPathNodeStyle#fill} property on the created object. - *

- * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.view.Stroke} that is used to draw the shape. - *

- * This option sets the {@link yfiles.styles.GeneralPathNodeStyle#stroke} property on the created object. - *

- */ - constructor(options:{path:yfiles.geometry.GeneralPath,renderer?:yfiles.styles.GeneralPathNodeStyleRenderer,fill?:yfiles.view.Fill,stroke?:yfiles.view.Stroke}); - /** - * Creates a new instance using a simple rectangular path and {@link yfiles.styles.GeneralPathNodeStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.view.Fill} options.fill The {@link yfiles.view.Fill} that is used to draw the shape. - *

- * This option sets the {@link yfiles.styles.GeneralPathNodeStyle#fill} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.path The path that defines the boundary of the shape. - *

- * This option sets the {@link yfiles.styles.GeneralPathNodeStyle#path} property on the created object. - *

- * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.view.Stroke} that is used to draw the shape. - *

- * This option sets the {@link yfiles.styles.GeneralPathNodeStyle#stroke} property on the created object. - *

- */ - constructor(options?:{fill?:yfiles.view.Fill,path?:yfiles.geometry.GeneralPath,stroke?:yfiles.view.Stroke}); - /** - * - * @returns - */ - clone():any; - /** - * Get or sets the path that defines the boundary of the shape. - *

- * The path must be defined in such a way that <0,0> will be at the top left of a node's {@link yfiles.graph.INode#layout} and <1,1> will be at the lower - * right. The path will be scaled accordingly during the painting. - *

- *

- * The default is a simple rectangular path. - *

- * @type {yfiles.geometry.GeneralPath} - */ - path:yfiles.geometry.GeneralPath; - /** - * - * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - /** - * Gets or sets the {@link yfiles.view.Fill} that is used to draw the shape. - *

- * The default value is {@link yfiles.view.Fill#WHITE}. - *

- * @default 'System.Drawing.Brushes.White' - * @type {yfiles.view.Fill} - */ - fill:yfiles.view.Fill; - /** - * Gets or sets the {@link yfiles.view.Stroke} that is used to draw the shape. - *

- * The default value is {@link yfiles.view.Stroke#BLACK}. - *

- * @default 'System.Drawing.Pens.Black' - * @type {yfiles.view.Stroke} - */ - stroke:yfiles.view.Stroke; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.GeneralPathNodeStyle; - } - /** - * An {@link yfiles.styles.INodeStyleRenderer} implementation that can handle {@link yfiles.styles.GeneralPathNodeStyle} instances. - * @class - * @implements {yfiles.styles.INodeStyleRenderer} - * @implements {yfiles.styles.IShapeGeometry} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface GeneralPathNodeStyleRenderer extends yfiles.lang.Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class GeneralPathNodeStyleRenderer { - /** - * Initializes a new instance of the {@link yfiles.styles.GeneralPathNodeStyleRenderer} class. - */ - constructor(); - /** - * Prepares this instance for subsequent calls after the style and node have been initialized. - *

- * Upon invocation the {@link yfiles.styles.GeneralPathNodeStyleRenderer#style} and {@link yfiles.styles.GeneralPathNodeStyleRenderer#node} properties have been populated by the - * {@link yfiles.styles.GeneralPathNodeStyleRenderer#getVisualCreator}, - * {@link yfiles.styles.GeneralPathNodeStyleRenderer#getBoundsProvider}, {@link yfiles.styles.GeneralPathNodeStyleRenderer#getHitTestable}, - * or {@link yfiles.styles.GeneralPathNodeStyleRenderer#getMarqueeTestable} methods. - *

- *

- * This is an empty implementation. Subclasses might have to override this method. - *

- * @protected - */ - configure():void; - /** - * - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * - * @param context - * @returns - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the bounds provider for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.GeneralPathNodeStyleRenderer#getBounds - */ - getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} and returns - * this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.GeneralPathNodeStyleRenderer#lookup} method call they should - * call {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} only if needed, i.e. if they decide to return this or an - * instance that depends on a correctly configured this. - *

- * @param node The node to query the context for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.GeneralPathNodeStyleRenderer#lookup - */ - getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} and returns this. - * @param node The node to query hit test with. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.GeneralPathNodeStyleRenderer#isHit - */ - getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; - /** - * - * @param inner - * @param outer - * @returns - */ - getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} and returns this. - * @param node The node to query marquee intersection tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.GeneralPathNodeStyleRenderer#isInBox - */ - getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; - /** - * - * @returns - */ - getOutline():yfiles.geometry.GeneralPath; - /** - * Configures the {@link yfiles.styles.GeneralPathNodeStyleRenderer#style} and {@link yfiles.styles.GeneralPathNodeStyleRenderer#node} properties, calls {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the shape geometry for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.GeneralPathNodeStyleRenderer#isInside - * @see yfiles.styles.GeneralPathNodeStyleRenderer#getIntersection - */ - getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} and returns - * this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure}. If - * the subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.GeneralPathNodeStyleRenderer#isVisible}. - *

- * @param node The node to query visibility tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.GeneralPathNodeStyleRenderer#isVisible - */ - getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the {@link } for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.GeneralPathNodeStyleRenderer#createVisual - * @see yfiles.styles.GeneralPathNodeStyleRenderer#updateVisual - */ - getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; - /** - * - * @param context - * @param location - * @returns - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param location - * @returns - */ - isInside(location:yfiles.geometry.Point):boolean; - /** - * Determines visibility by checking for an intersection with the {@link yfiles.styles.GeneralPathNodeStyleRenderer#layout}. - * @param context The context. - * @param rectangle The current clip - * @returns Whether the {@link #layout} is visible in the clip. - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Implements the {@link yfiles.graph.ILookup} interface. - *

- * This method will be used by default if {@link yfiles.styles.GeneralPathNodeStyleRenderer#getContext} has been queried for a - * lookup implementation. Note that it cannot be assumed that {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} has - * already been invoked. However, normally {@link yfiles.styles.GeneralPathNodeStyleRenderer#node} and {@link yfiles.styles.GeneralPathNodeStyleRenderer#style} will be correctly configured if invoked directly after GetContext. - * Subclass implementations should make sure to configure this instance before they return this as a result of a successful - * lookup. This implementation will check if type.IsInstanceOfType(this) and will call {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} - * on success and return this. - *

- * @param type The type to query for. - * @returns An implementation or null. - */ - lookup(type:yfiles.lang.Class):any; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.GeneralPathNodeStyle} - */ - style:yfiles.styles.GeneralPathNodeStyle; - /** - * Gets or sets the currently configured node. - * @protected - * @type {yfiles.graph.INode} - */ - node:yfiles.graph.INode; - /** - * Gets the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. - *

- * Returns Node.Layout. - *

- * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.GeneralPathNodeStyleRenderer; - } - /** - * An abstract base class for {@link yfiles.styles.IEdgeStyleRenderer} implementations that are based on the calculation of a - * {@link yfiles.geometry.GeneralPath}. - * Type parameter TStyle: The exact type of style to use for this instance. - * @class - * @implements {yfiles.styles.IEdgeStyleRenderer} - * @implements {yfiles.styles.IPathGeometry} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - * @implements {yfiles.view.IObstacleProvider} - * @template TStyle - */ - export interface PathBasedEdgeStyleRenderer extends yfiles.lang.Object,yfiles.styles.IEdgeStyleRenderer,yfiles.styles.IPathGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator,yfiles.view.IObstacleProvider{} - export class PathBasedEdgeStyleRenderer { - /** - * - * @param edgeStyleType The exact type of style to use for this instance. - */ - constructor(edgeStyleType:yfiles.lang.Class); - /** - * Prepares this instance for subsequent calls after the style and edge have been initialized. - *

- * Upon invocation the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#style} and {@link yfiles.styles.PathBasedEdgeStyleRenderer.#edge} properties have been populated by the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getVisualCreator}, {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getBoundsProvider}, {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getHitTestable}, - * or {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getMarqueeTestable} methods. - *

- *

- * Subclasses which override this method have to call the base implementation, first. - *

- * @protected - */ - configure():void; - /** - * This method should create the basic uncropped path given the control points. - * @returns A path that has to be cropped, yet. - * @protected - * @abstract - */ - createPath():yfiles.geometry.GeneralPath; - /** - * Static utility method that creates a rectangular self loop path. - * @param sx The x coordinate of the source port. - * @param sy The y coordinate of the source port. - * @param oppositeX The x coordinate of the single control point. - * @param oppositeY The y coordinate of the single control point. - * @param tx The x coordinate of the target port. - * @param ty The y coordinate of the target port. - * @returns A path that describes a rectangular self loop. - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#createSelfLoopPath - * @protected - * @static - */ - static createRectangleSelfLoop(sx:number,sy:number,oppositeX:number,oppositeY:number,tx:number,ty:number):yfiles.geometry.GeneralPath; - /** - * Static utility method that creates a round self loop path. - * @param sx The x coordinate of the source port. - * @param sy The y coordinate of the source port. - * @param oppositeX The x coordinate of the single control point. - * @param oppositeY The y coordinate of the single control point. - * @param tx The x coordinate of the target port. - * @param ty The y coordinate of the target port. - * @returns A path that describes a round self loop. - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#createSelfLoopPath - * @protected - * @static - */ - static createRoundSelfLoop(sx:number,sy:number,oppositeX:number,oppositeY:number,tx:number,ty:number):yfiles.geometry.GeneralPath; - /** - * Special implementation that will create a self loop path. - * @param roundSelfLoop - * @returns - * @protected - */ - createSelfLoopPath(roundSelfLoop:boolean):yfiles.geometry.GeneralPath; - /** - * - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * Crops the edge's path at the nodes. - *

- * This implementation uses the {@link yfiles.styles.IEdgePathCropper} instances found in the {@link yfiles.graph.ILookup#lookup} of the - * source and target port of the edge to perform the actual cropping. - *

- * @param path The path that should be cropped. - * @returns The cropped path. This is can be either the same instance of the given path or a newly created instance. - * @protected - */ - cropPath(path:yfiles.geometry.GeneralPath):yfiles.geometry.GeneralPath; - /** - * - * @param context - * @returns - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the style and edge parameters, calls {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} and returns this. - * @param edge The edge to retrieve the bounds provider for. The value will be stored in the {@link #edge} property. - * @param style The style to associate with the edge. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getBounds - */ - getBoundsProvider(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.view.IBoundsProvider; - /** - * Yields the {@link yfiles.view.IBridgeCreator} to use for {@link yfiles.styles.PathBasedEdgeStyleRenderer.#addBridges adding bridges} to the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#createPath created path}. - *

- * The return value of this method (which may be null) will be passed to the {@link yfiles.view.BridgeManager}'s {@link yfiles.view.BridgeManager#addBridges} - * method. - *

- * @returns This implementation returns null. - * @protected - */ - getBridgeCreator():yfiles.view.IBridgeCreator; - /** - * Configures the style and edge parameters, does not call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} and returns this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure}, instead subclasses should ensure that in - * the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#lookup} method call they should call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} only if needed, i.e. if they decide to return this or an instance - * that depends on a correctly configured this. - *

- * @param edge The edge to query the context for. The value will be stored in the {@link #edge} property. - * @param style The style to associate with the edge. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#lookup - */ - getContext(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.graph.ILookup; - /** - * Configures the style and edge parameters and returns this. - *

- * This implementation does not call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure}. If subclasses depend on a configured instance in an override of {@link yfiles.styles.PathBasedEdgeStyleRenderer.#isHit}, - * they need to override this method, too and call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} if the base call returns a non-null value. - *

- * @param edge - * @param style - * @returns - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#isHit - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#configure - * @see yfiles.styles.IEdgeStyleRenderer#getHitTestable - */ - getHitTestable(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.input.IHitTestable; - /** - * Configures the style and edge parameters, calls {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} and returns this. - * @param edge The edge to query marquee intersection tests. The value will be stored in the {@link #edge} property. - * @param style The style to associate with the edge. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#isInBox - */ - getMarqueeTestable(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.input.IMarqueeTestable; - /** - * Returns {@link yfiles.styles.PathBasedEdgeStyleRenderer.#createPath} unless {@link yfiles.styles.PathBasedEdgeStyleRenderer.#isVisible} yields false for the provided context and {@link yfiles.view.IRenderContext#clip}. - * @param context The context to yield the obstacles for. - * @returns Either null or the result of {@link #createPath}. - * @see yfiles.view.IObstacleProvider - */ - getObstacles(context:yfiles.view.IRenderContext):yfiles.geometry.GeneralPath; - /** - * - * @returns - */ - getPath():yfiles.geometry.GeneralPath; - /** - * Gets an implementation of the {@link yfiles.styles.IPathGeometry} interface that can handle the provided edge and its associated - * style. - * @param edge The edge to provide an instance for - * @param style The style to use for the painting - * @returns this - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#configure - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getTangent - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getTangent - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getSegmentCount - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getPath - */ - getPathGeometry(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.styles.IPathGeometry; - /** - * Returns the number of "segments" this edge's path consists of. - *

- * This method is part of the {@link yfiles.styles.IPathGeometry} interface, that is implemented by this class. This interface will - * be returned by {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getPathGeometry}. - *

- * @returns the number of segments or -1 if there is no such thing as a segment for this edge. - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getPathGeometry - * @abstract - */ - getSegmentCount():number; - /** - * Gets the value that determines the radius of the smoothing arcs that can be added to the path at the bends. - *

- * This implementation returns 0.0d, which effectively turns off path smoothing. - *

- * @returns The radius of the arcs to use at the bends of the path. - * @protected - */ - getSmoothingLength():number; - /** - * Gets the source arrow from the style. - * @returns The arrow to use. - * @protected - * @abstract - */ - getSourceArrow():yfiles.styles.IArrow; - /** - * Calculate and update the anchor and the source arrow's direction vector. - * @param arrow The arrow to calculate the anchor for. - * @returns The anchor and directional vector of the arrow, if any exist. - * @protected - */ - getSourceArrowAnchor(arrow:yfiles.styles.IArrow):yfiles.geometry.Tangent; - /** - * Gets the {@link yfiles.view.Stroke} to use to render the path. - * @returns The {@link } or null. - * @protected - * @abstract - */ - getStroke():yfiles.view.Stroke; - /** - * Calculates the tangent on the edge's path at the given ratio point for the given segment. - *

- * This method is part of the {@link yfiles.styles.IPathGeometry} interface, that is implemented by this class. This interface will - * be returned by {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getPathGeometry}. - *

- * @param segmentIndex the segment to use for the calculation - * @param ratio a value in [0,1] where 0 is the source's end and 1 is at the target's end of the segment - * @returns The tangential line, if any exists. - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getTangent - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getSegmentCount - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getPathGeometry - * @abstract - */ - getTangent(segmentIndex:number,ratio:number):yfiles.geometry.Tangent; - /** - * Calculates the tangent on the edge's path at the given ratio point. - *

- * This method is part of the {@link yfiles.styles.IPathGeometry} interface, that is implemented by this class. This interface will - * be returned by {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getPathGeometry}. - *

- * @param ratio a value in [0,1] where 0 is the source's end and 1 is at the target's end of the visible edge path - * @returns The tangential line, if any exists. - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getPathGeometry - * @abstract - */ - getTangent(ratio:number):yfiles.geometry.Tangent; - /** - * Gets the target arrow from the style. - * @returns The arrow to use. - * @protected - * @abstract - */ - getTargetArrow():yfiles.styles.IArrow; - /** - * Calculate and update the anchor and the target arrow's direction vector. - * @param arrow The arrow to calculate the anchor for. - * @returns The anchor and directional vector of the arrow, if any exist. - * @protected - */ - getTargetArrowAnchor(arrow:yfiles.styles.IArrow):yfiles.geometry.Tangent; - /** - * Configures the style and edge parameters, does not call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} and returns this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure}. If the subclass implementation depends on - * this instance to be configured, it needs to call Configure in {@link yfiles.styles.PathBasedEdgeStyleRenderer.#isVisible}. - *

- * @param edge The edge to query visibility tests. The value will be stored in the {@link #edge} property. - * @param style The style to associate with the edge. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#isVisible - */ - getVisibilityTestable(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and edge parameters, calls {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} and returns this. - * @param edge The edge to retrieve the {@link } for. The value will be stored in the {@link #edge} property. - * @param style The style to associate with the edge. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#createVisual - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#updateVisual - */ - getVisualCreator(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.view.IVisualCreator; - /** - * This method is overridden for performance reasons. - *

- * This implementation uses {@link yfiles.styles.PathBasedEdgeStyleRenderer.#isVisible} as an early exit indicator. If IsVisible returns false for a certain rectangle, the - * instance will not be configured but a non-hit will be assumed. Otherwise this instance will be configured and the - * standard path based hit test routine - *
- * Subclasses should not depend on the fact that {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} has already been called. This may not be the case. If your - * subclass depends on Configure being called, override {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getHitTestable} and call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} after the base class call. - *

- * @param context - * @param location - * @returns - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getHitTestable - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#configure - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Calls {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} and test the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#edge} using the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#style} for a visible intersection with the clip bounds. - *

- * This simple implementation uses {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getBounds} to determine the visibility. Subclasses may choose to override this behavior - * for improved performance but need to make sure to call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} if they depend on a configured instance. - *

- * @param context the current canvas context - * @param rectangle the clip bounds - * @returns true if the edge may be painted within the clip bounds. - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getVisibilityTestable - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * The path instance that this instance is working with. - * @protected - * @type {yfiles.geometry.GeneralPath} - */ - path:yfiles.geometry.GeneralPath; - /** - * Gets or sets the currently configured style. - * @protected - * @type {TStyle} - */ - style:TStyle; - /** - * Gets or sets the currently configured edge. - * @protected - * @type {yfiles.graph.IEdge} - */ - edge:yfiles.graph.IEdge; - /** - * Gets whether the rendered path should use the {@link yfiles.view.BridgeManager} to {@link yfiles.view.BridgeManager#addBridges add bridges to it.} - * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getBridgeCreator - * @protected - * @type {boolean} - */ - addBridges:boolean; - /** - * Gets or sets the distance between the node's layout and its self loop control points. - * @type {number} - */ - selfLoopDistance:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.PathBasedEdgeStyleRenderer; - } - /** - * An {@link yfiles.styles.IEdgeStyleRenderer} that will render {@link yfiles.styles.PolylineEdgeStyle} instances. - * @class - * @extends {yfiles.styles.PathBasedEdgeStyleRenderer.} - */ - export interface PolylineEdgeStyleRenderer extends yfiles.styles.PathBasedEdgeStyleRenderer{} - export class PolylineEdgeStyleRenderer { - constructor(); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.PolylineEdgeStyleRenderer; - } - /** - * A polygonal {@link yfiles.styles.IEdgeStyle} where straight line segments are used to connect the bends. - * @class - * @implements {yfiles.styles.IEdgeStyle} - */ - export interface PolylineEdgeStyle extends yfiles.lang.Object,yfiles.styles.IEdgeStyle{} - export class PolylineEdgeStyle { - /** - * Creates a new instance using the provided renderer. - * @param renderer The custom renderer for this style instance. - */ - constructor(renderer:yfiles.styles.PolylineEdgeStyleRenderer); - /** - * Creates a new instance using the provided renderer. - * @param {Object} options The parameters to pass. - * @param options.renderer The custom renderer for this style instance. - * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.PolylineEdgeStyle#stroke} for the line. - *

- * This option sets the {@link yfiles.styles.PolylineEdgeStyle#stroke} property on the created object. - *

- * @param {number} options.smoothingLength The smoothing length used for creating smooth bends. - *

- * This option sets the {@link yfiles.styles.PolylineEdgeStyle#smoothingLength} property on the created object. - *

- * @param {yfiles.styles.IArrow} options.sourceArrow The visual arrow at the source end of edges that use this style. - *

- * This option sets the {@link yfiles.styles.PolylineEdgeStyle#sourceArrow} property on the created object. - *

- * @param {yfiles.styles.IArrow} options.targetArrow The visual arrow at the target end of edges that use this style. - *

- * This option sets the {@link yfiles.styles.PolylineEdgeStyle#targetArrow} property on the created object. - *

- */ - constructor(options:{renderer:yfiles.styles.PolylineEdgeStyleRenderer,stroke?:yfiles.view.Stroke,smoothingLength?:number,sourceArrow?:yfiles.styles.IArrow,targetArrow?:yfiles.styles.IArrow}); - /** - * Creates a new instance using {@link yfiles.styles.PolylineEdgeStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.PolylineEdgeStyle#stroke} for the line. - *

- * This option sets the {@link yfiles.styles.PolylineEdgeStyle#stroke} property on the created object. - *

- * @param {number} options.smoothingLength The smoothing length used for creating smooth bends. - *

- * This option sets the {@link yfiles.styles.PolylineEdgeStyle#smoothingLength} property on the created object. - *

- * @param {yfiles.styles.IArrow} options.sourceArrow The visual arrow at the source end of edges that use this style. - *

- * This option sets the {@link yfiles.styles.PolylineEdgeStyle#sourceArrow} property on the created object. - *

- * @param {yfiles.styles.IArrow} options.targetArrow The visual arrow at the target end of edges that use this style. - *

- * This option sets the {@link yfiles.styles.PolylineEdgeStyle#targetArrow} property on the created object. - *

- */ - constructor(options?:{stroke?:yfiles.view.Stroke,smoothingLength?:number,sourceArrow?:yfiles.styles.IArrow,targetArrow?:yfiles.styles.IArrow}); - /** - * Performs a {@link any#memberwiseClone} - * @returns - */ - clone():any; - /** - * Gets or sets the {@link yfiles.styles.PolylineEdgeStyle#stroke} for the line. - *

- * The default value is {@link yfiles.view.Stroke#BLACK}. - *

- * @default 'System.Drawing.Pens.Black' - * @type {yfiles.view.Stroke} - */ - stroke:yfiles.view.Stroke; - /** - * Gets or sets the smoothing length used for creating smooth bends. - *

- * A value of 0.0d will disable smoothing. - *

- *

- * The default value is 0. - *

- * @default 0.0 - * @type {number} - */ - smoothingLength:number; - /** - * Gets or sets the visual arrow at the target end of edges that use this style. - *

- * Arrow instances may be shared between multiple style instances. - *

- *

- * This property may not be null. To have no target arrow set, use {@link yfiles.styles.IArrow#NONE} instead. - *

- *

- * The default value is {@link yfiles.styles.IArrow#NONE}. - *

- * @default 'None' - * @type {yfiles.styles.IArrow} - */ - targetArrow:yfiles.styles.IArrow; - /** - * Gets or sets the visual arrow at the source end of edges that use this style. - *

- * Arrow instances may be shared between multiple style instances. - *

- *

- * This property may not be null. To have no source arrow set, use {@link yfiles.styles.IArrow#NONE} instead. - *

- *

- * The default value is {@link yfiles.styles.IArrow#NONE}. - *

- * @default 'None' - * @type {yfiles.styles.IArrow} - */ - sourceArrow:yfiles.styles.IArrow; - /** - * Gets the renderer implementation that has been supplied to this instance in the constructor. - * @type {yfiles.styles.IEdgeStyleRenderer} - */ - renderer:yfiles.styles.IEdgeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.PolylineEdgeStyle; - } - export enum ShapeNodeShape{ - /** - * A rectangular shape - */ - RECTANGLE, - /** - * A rectangular shape with rounded edges - */ - ROUND_RECTANGLE, - /** - * An elliptical shape - */ - ELLIPSE, - /** - * A triangular shape that points to the top - */ - TRIANGLE, - /** - * A triangular shape that points to the bottom - */ - TRIANGLE2, - /** - * A rectangle that is sheared in the horizontal direction to the right - */ - SHEARED_RECTANGLE, - /** - * A rectangle that is sheared in the horizontal direction to the left - */ - SHEARED_RECTANGLE2, - /** - * A trapezoid shape that is smaller at the bottom - */ - TRAPEZ, - /** - * A trapezoid shape that is smaller at the top - */ - TRAPEZ2, - /** - * A 5-star shape - */ - STAR5, - /** - * A 6-star shape - */ - STAR6, - /** - * An 8-star shape - */ - STAR8, - /** - * An arrow like shape that points to the right - */ - FAT_ARROW, - /** - * An arrow like shape that points to the left - */ - FAT_ARROW2, - /** - * A symmetric parallelogram shape that has sloped edges - */ - DIAMOND, - /** - * A regular eight-sided shape, - */ - OCTAGON, - /** - * A regular six-sided shape, - */ - HEXAGON - } - /** - * Default renderer implementation that can be used for {@link yfiles.styles.ShapeNodeStyle} instances. - * @class - * @implements {yfiles.styles.INodeStyleRenderer} - * @implements {yfiles.styles.IShapeGeometry} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface ShapeNodeStyleRenderer extends yfiles.lang.Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class ShapeNodeStyleRenderer { - constructor(); - /** - * Prepares this instance for subsequent calls after the style and node have been initialized. - *

- * Upon invocation the {@link yfiles.styles.ShapeNodeStyleRenderer#style} and {@link yfiles.styles.ShapeNodeStyleRenderer#node} properies have been populated by the {@link yfiles.styles.ShapeNodeStyleRenderer#getVisualCreator}, - * {@link yfiles.styles.ShapeNodeStyleRenderer#getBoundsProvider}, {@link yfiles.styles.ShapeNodeStyleRenderer#getHitTestable}, or {@link yfiles.styles.ShapeNodeStyleRenderer#getMarqueeTestable} - * methods. - *

- *

- * This is an empty implementation. Subclasses might have to override this method. - *

- * @protected - */ - configure():void; - /** - * - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * Returns the layout bounds as an upper bound for the painting bound. - *

- * This implementation simply sets the {@link yfiles.styles.ShapeNodeStyleRenderer#layout}'s bounds to the scratch variable and returns. - *

- * @param context the context to calculate the bounds for - * @returns the bounds or null to indicate an unbound area - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ShapeNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the bounds provider for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShapeNodeStyleRenderer#getBounds - */ - getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.ShapeNodeStyleRenderer#configure} and returns this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.ShapeNodeStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.ShapeNodeStyleRenderer#lookup} method call they should call {@link yfiles.styles.ShapeNodeStyleRenderer#configure} - * only if needed, i.e. if they decide to return this or an instance that depends on a correctly configured this. - *

- * @param node The node to query the context for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShapeNodeStyleRenderer#lookup - */ - getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; - /** - * Get the brush that is currently used by this renderer. - *

- * This implementation retrieves the brush from the owning style - *

- * @returns The brush that is currently used by this renderer. - * @protected - */ - getFill():yfiles.view.Fill; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ShapeNodeStyleRenderer#configure} and returns this. - * @param node The node to query hit test with. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShapeNodeStyleRenderer#isHit - */ - getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; - /** - * - * @param inner - * @param outer - * @returns - */ - getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ShapeNodeStyleRenderer#configure} and returns this. - * @param node The node to query marquee intersection tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShapeNodeStyleRenderer#isInBox - */ - getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; - /** - * - * @returns - */ - getOutline():yfiles.geometry.GeneralPath; - /** - * Get the shape that is currently used by this renderer. - *

- * This implementation retrieves the shape from the owning style - *

- * @returns The shape that is currently used by this renderer. - * @protected - */ - getShape():yfiles.styles.ShapeNodeShape; - /** - * Configures the {@link yfiles.styles.ShapeNodeStyleRenderer#style} and {@link yfiles.styles.ShapeNodeStyleRenderer#node} properties, calls {@link yfiles.styles.ShapeNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the shape geometry for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShapeNodeStyleRenderer#isInside - * @see yfiles.styles.ShapeNodeStyleRenderer#getIntersection - */ - getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; - /** - * Get the pen that is currently used by this renderer. - *

- * This implementation retrieves the {@link yfiles.view.Stroke} from the owning style - *

- * @returns The {@link } that is currently used by this renderer. - * @protected - */ - getStroke():yfiles.view.Stroke; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.ShapeNodeStyleRenderer#configure} and returns this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.ShapeNodeStyleRenderer#configure}. If the - * subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.ShapeNodeStyleRenderer#isVisible}. - *

- * @param node The node to query visibility tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShapeNodeStyleRenderer#isVisible - */ - getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ShapeNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the {@link } for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShapeNodeStyleRenderer#createVisual - * @see yfiles.styles.ShapeNodeStyleRenderer#updateVisual - */ - getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; - /** - * - * @param context - * @param location - * @returns - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * Tests the {@link yfiles.styles.ShapeNodeStyleRenderer#node node} using the current {@link yfiles.styles.ShapeNodeStyleRenderer#style} for an intersection with the given box. - *

- * This implementation uses the {@link yfiles.styles.ShapeNodeStyleRenderer#layout} to determine whether the node is in the box. - *

- * @param context the current input mode context - * @param rectangle the box describing the marquee's bounds - * @returns true if the node is considered to be captured by the marquee - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param location - * @returns - */ - isInside(location:yfiles.geometry.Point):boolean; - /** - * Determines visibility by checking for an intersection with the {@link yfiles.styles.ShapeNodeStyleRenderer#layout}. - * @param context The context. - * @param rectangle The current clip - * @returns Whether the {@link #layout} is visible in the clip. - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Implements the {@link yfiles.graph.ILookup} interface. - *

- * This method will be used by default if {@link yfiles.styles.ShapeNodeStyleRenderer#getContext} has been queried for a lookup - * implementation. Note that it cannot be assumed that {@link yfiles.styles.ShapeNodeStyleRenderer#configure} has already been - * invoked. However, normally {@link yfiles.styles.ShapeNodeStyleRenderer#node} and {@link yfiles.styles.ShapeNodeStyleRenderer#style} will be correctly configured if invoked directly after GetContext. Subclass - * implementations should make sure to configure this instance before they return this as a result of a successful lookup. - * This implementation will check if type.IsInstanceOfType(this) and will call {@link yfiles.styles.ShapeNodeStyleRenderer#configure} - * on success and return this. - *

- * @param type The type to query for. - * @returns An implementation or null. - */ - lookup(type:yfiles.lang.Class):any; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.ShapeNodeStyle} - */ - style:yfiles.styles.ShapeNodeStyle; - /** - * Gets or sets the currently configured node. - * @protected - * @type {yfiles.graph.INode} - */ - node:yfiles.graph.INode; - /** - * Gets the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. - *

- * Returns Node.Layout. - *

- * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - /** - * Gets or sets the radius that is used to draw rounded edges. - * @type {number} - */ - roundRectArcRadius:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.ShapeNodeStyleRenderer; - } - /** - * Node style implementation that can show predefined shapes of type {@link yfiles.styles.ShapeNodeShape}. - *

- * This style can be used together with {@link yfiles.styles.ShapeNodeStyleRenderer} instances. - *

- * @class - * @implements {yfiles.styles.INodeStyle} - */ - export interface ShapeNodeStyle extends yfiles.lang.Object,yfiles.styles.INodeStyle{} - export class ShapeNodeStyle { - /** - * Creates a new instance using the provided renderer. - * @param renderer Custom renderer instance for this style. - */ - constructor(renderer:yfiles.styles.ShapeNodeStyleRenderer); - /** - * Creates a new instance using the provided renderer. - * @param {Object} options The parameters to pass. - * @param options.renderer Custom renderer instance for this style. - * @param {yfiles.view.Fill} options.fill The {@link yfiles.styles.ShapeNodeStyle#fill} for this style. - *

- * This option sets the {@link yfiles.styles.ShapeNodeStyle#fill} property on the created object. - *

- * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.ShapeNodeStyle#stroke} for this style. - *

- * This option sets the {@link yfiles.styles.ShapeNodeStyle#stroke} property on the created object. - *

- * @param {yfiles.styles.ShapeNodeShape} options.shape The shape for this style. - *

- * This option sets the {@link yfiles.styles.ShapeNodeStyle#shape} property on the created object. - *

- */ - constructor(options:{renderer:yfiles.styles.ShapeNodeStyleRenderer,fill?:yfiles.view.Fill,stroke?:yfiles.view.Stroke,shape?:yfiles.styles.ShapeNodeShape}); - /** - * Creates a new instance using {@link yfiles.styles.ShapeNodeStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.view.Fill} options.fill The {@link yfiles.styles.ShapeNodeStyle#fill} for this style. - *

- * This option sets the {@link yfiles.styles.ShapeNodeStyle#fill} property on the created object. - *

- * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.ShapeNodeStyle#stroke} for this style. - *

- * This option sets the {@link yfiles.styles.ShapeNodeStyle#stroke} property on the created object. - *

- * @param {yfiles.styles.ShapeNodeShape} options.shape The shape for this style. - *

- * This option sets the {@link yfiles.styles.ShapeNodeStyle#shape} property on the created object. - *

- */ - constructor(options?:{fill?:yfiles.view.Fill,stroke?:yfiles.view.Stroke,shape?:yfiles.styles.ShapeNodeShape}); - /** - * - * @returns - */ - clone():any; - /** - * Gets or sets the {@link yfiles.styles.ShapeNodeStyle#stroke} for this style. - *

- * The default value is {@link yfiles.view.Stroke#BLACK}. - *

- * @default 'System.Drawing.Pens.Black' - * @type {yfiles.view.Stroke} - */ - stroke:yfiles.view.Stroke; - /** - * Gets or sets the {@link yfiles.styles.ShapeNodeStyle#fill} for this style. - *

- * The default value is {@link yfiles.view.Fill#WHITE}. - *

- * @default 'System.Drawing.Brushes.White' - * @type {yfiles.view.Fill} - */ - fill:yfiles.view.Fill; - /** - * Gets or sets the shape for this style. - *

- * The default value is {@link yfiles.styles.ShapeNodeShape#RECTANGLE}. - *

- * @default yfiles.styles.ShapeNodeShape.RECTANGLE - * @type {yfiles.styles.ShapeNodeShape} - */ - shape:yfiles.styles.ShapeNodeShape; - /** - * - * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.ShapeNodeStyle; - } - /** - * Default renderer implementation for {@link yfiles.styles.ArcEdgeStyle} - * @class - * @extends {yfiles.styles.PathBasedEdgeStyleRenderer.} - */ - export interface ArcEdgeStyleRenderer extends yfiles.styles.PathBasedEdgeStyleRenderer{} - export class ArcEdgeStyleRenderer { - constructor(); - /** - * Retrieves the {@link yfiles.styles.ArcEdgeStyle#height} of the style. - * @returns the height. - */ - getHeight():number; - /** - * Gets a value indicating whether this {@link yfiles.styles.ArcEdgeStyleRenderer#getHeight} should be interpreted as an absolute - * or relative value. - * @returns true if the height value should be interpreted as a fixed value, otherwise, false. - * @see yfiles.styles.ArcEdgeStyleRenderer#getHeight - */ - isFixedHeight():boolean; - /** - * Gets whether bridges are added to the edge path. - *

- * Overridden to return false since the flattening interferes with its own obstacles. - *

- * @protected - * @type {boolean} - */ - addBridges:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.ArcEdgeStyleRenderer; - } - /** - * Provides an arc representation for an edge. - *

- * The rendering does not take into account bends of an edge, instead the arc's height is determined as a fixed ratio or - * fixed height. - *

- *

- * This style uses an {@link yfiles.styles.ArcEdgeStyleRenderer} for its visualization. - *

- * @class - * @implements {yfiles.styles.IEdgeStyle} - */ - export interface ArcEdgeStyle extends yfiles.lang.Object,yfiles.styles.IEdgeStyle{} - export class ArcEdgeStyle { - /** - * Creates a new instance using the provided renderer. - * @param renderer The custom renderer for this style instance. - */ - constructor(renderer:yfiles.styles.ArcEdgeStyleRenderer); - /** - * Creates a new instance using the provided renderer. - * @param {Object} options The parameters to pass. - * @param options.renderer The custom renderer for this style instance. - * @param {boolean} options.fixedHeight A value indicating whether this {@link yfiles.styles.ArcEdgeStyle} interprets the {@link yfiles.styles.ArcEdgeStyle#height} value as an absolute or relative value. - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#fixedHeight} property on the created object. - *

- * @param {number} options.height The "height" of the arc. - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#height} property on the created object. - *

- * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.ArcEdgeStyle#stroke} that is used to draw the arc - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#stroke} property on the created object. - *

- * @param {boolean} options.provideHeightHandle A value indicating whether the {@link yfiles.styles.ArcEdgeStyleRenderer} should provide an {@link yfiles.input.IHandle} if queried for the {@link yfiles.input.IHandleProvider} implementation that allows for adjusting the {@link yfiles.styles.ArcEdgeStyle#height} of this instance. - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#provideHeightHandle} property on the created object. - *

- * @param {yfiles.styles.IArrow} options.sourceArrow The visual arrow at the source end of edges that use this style. - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#sourceArrow} property on the created object. - *

- * @param {yfiles.styles.IArrow} options.targetArrow The visual arrow at the target end of edges that use this style. - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#targetArrow} property on the created object. - *

- */ - constructor(options:{renderer:yfiles.styles.ArcEdgeStyleRenderer,fixedHeight?:boolean,height?:number,stroke?:yfiles.view.Stroke,provideHeightHandle?:boolean,sourceArrow?:yfiles.styles.IArrow,targetArrow?:yfiles.styles.IArrow}); - /** - * Creates a new instance using {@link yfiles.styles.ArcEdgeStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {boolean} options.fixedHeight A value indicating whether this {@link yfiles.styles.ArcEdgeStyle} interprets the {@link yfiles.styles.ArcEdgeStyle#height} value as an absolute or relative value. - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#fixedHeight} property on the created object. - *

- * @param {number} options.height The "height" of the arc. - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#height} property on the created object. - *

- * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.ArcEdgeStyle#stroke} that is used to draw the arc - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#stroke} property on the created object. - *

- * @param {boolean} options.provideHeightHandle A value indicating whether the {@link yfiles.styles.ArcEdgeStyleRenderer} should provide an {@link yfiles.input.IHandle} if queried for the {@link yfiles.input.IHandleProvider} implementation that allows for adjusting the {@link yfiles.styles.ArcEdgeStyle#height} of this instance. - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#provideHeightHandle} property on the created object. - *

- * @param {yfiles.styles.IArrow} options.sourceArrow The visual arrow at the source end of edges that use this style. - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#sourceArrow} property on the created object. - *

- * @param {yfiles.styles.IArrow} options.targetArrow The visual arrow at the target end of edges that use this style. - *

- * This option sets the {@link yfiles.styles.ArcEdgeStyle#targetArrow} property on the created object. - *

- */ - constructor(options?:{fixedHeight?:boolean,height?:number,stroke?:yfiles.view.Stroke,provideHeightHandle?:boolean,sourceArrow?:yfiles.styles.IArrow,targetArrow?:yfiles.styles.IArrow}); - /** - * Performs a {@link any#memberwiseClone} - * @returns - */ - clone():any; - /** - * Gets or sets the {@link yfiles.styles.ArcEdgeStyle#stroke} that is used to draw the arc - *

- * The default value is {@link yfiles.view.Stroke#BLACK}. - *

- * @default 'System.Drawing.Pens.Black' - * @type {yfiles.view.Stroke} - */ - stroke:yfiles.view.Stroke; - /** - * Gets or sets the "height" of the arc. - *

- * Depending on the setting of {@link yfiles.styles.ArcEdgeStyle#fixedHeight}, this value is interpreted differently: If {@link yfiles.styles.ArcEdgeStyle#fixedHeight} is disabled, the height of the arc will depend - * on it's width. The width will be multiplied by this value to obtain the height. If the {@link yfiles.styles.ArcEdgeStyle#fixedHeight} feature is enabled, this value - * will be interpreted as the absolute height. - *

- *

- * The default value is 0. - *

- * @default 0 - * @type {number} - */ - height:number; - /** - * Gets or sets a value indicating whether this {@link yfiles.styles.ArcEdgeStyle} interprets the {@link yfiles.styles.ArcEdgeStyle#height} value as an absolute or relative - * value. - *

- * The default value is true. - *

- * @see yfiles.styles.ArcEdgeStyle#height - * @default true - * @type {boolean} - */ - fixedHeight:boolean; - /** - * Gets or sets a value indicating whether the {@link yfiles.styles.ArcEdgeStyleRenderer} should provide an {@link yfiles.input.IHandle} if - * queried for the {@link yfiles.input.IHandleProvider} implementation that allows for adjusting the {@link yfiles.styles.ArcEdgeStyle#height} of this instance. - *

- * The default value is true. - *

- * @default true - * @type {boolean} - */ - provideHeightHandle:boolean; - /** - * Gets or sets the visual arrow at the target end of edges that use this style. - *

- * Arrow instances may be shared between multiple style instances. - *

- *

- * The default value is {@link yfiles.styles.IArrow#NONE}. - *

- * @default 'None' - * @type {yfiles.styles.IArrow} - */ - targetArrow:yfiles.styles.IArrow; - /** - * Gets or sets the visual arrow at the source end of edges that use this style. - *

- * Arrow instances may be shared between multiple style instances. - *

- *

- * The default value is {@link yfiles.styles.IArrow#NONE}. - *

- * @default 'None' - * @type {yfiles.styles.IArrow} - */ - sourceArrow:yfiles.styles.IArrow; - /** - * Gets the renderer implementation that has been supplied to this instance in the constructor. - * @type {yfiles.styles.IEdgeStyleRenderer} - */ - renderer:yfiles.styles.IEdgeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.ArcEdgeStyle; - } - /** - * A {@link yfiles.styles.INodeStyle} {@link yfiles.styles.INodeStyleRenderer renderer} implementation that draws a rounded rectangle with a bevel border in a 'shiny plate' - * fashion. - * @class - * @implements {yfiles.styles.INodeStyleRenderer} - * @implements {yfiles.styles.IShapeGeometry} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface BevelNodeStyleRenderer extends yfiles.lang.Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class BevelNodeStyleRenderer { - /** - * Prepares this instance for subsequent calls after the style and node have been initialized. - *

- * Upon invocation the {@link yfiles.styles.BevelNodeStyleRenderer#style} and {@link yfiles.styles.BevelNodeStyleRenderer#node} properties have been populated by the {@link yfiles.styles.BevelNodeStyleRenderer#getVisualCreator}, - * {@link yfiles.styles.BevelNodeStyleRenderer#getBoundsProvider}, {@link yfiles.styles.BevelNodeStyleRenderer#getHitTestable}, or {@link yfiles.styles.BevelNodeStyleRenderer#getMarqueeTestable} - * methods. - *

- *

- * This is an empty implementation. Subclasses might have to override this method. - *

- * @protected - */ - configure():void; - /** - * - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * Returns the layout bounds as an upper bound for the painting bound. - *

- * This implementation simply sets the {@link yfiles.styles.BevelNodeStyleRenderer#layout}'s bounds to the scratch variable and returns. - *

- * @param context the context to calculate the bounds for - * @returns the bounds or null to indicate an unbound area - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.BevelNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the bounds provider for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.BevelNodeStyleRenderer#getBounds - */ - getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.BevelNodeStyleRenderer#configure} and returns this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.BevelNodeStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.BevelNodeStyleRenderer#lookup} method call they should call {@link yfiles.styles.BevelNodeStyleRenderer#configure} - * only if needed, i.e. if they decide to return this or an instance that depends on a correctly configured this. - *

- * @param node The node to query the context for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.BevelNodeStyleRenderer#lookup - */ - getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.BevelNodeStyleRenderer#configure} and returns this. - * @param node The node to query hit test with. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.BevelNodeStyleRenderer#isHit - */ - getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; - /** - * - * @param inner - * @param outer - * @returns - */ - getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.BevelNodeStyleRenderer#configure} and returns this. - * @param node The node to query marquee intersection tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.BevelNodeStyleRenderer#isInBox - */ - getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; - /** - * - * @returns - */ - getOutline():yfiles.geometry.GeneralPath; - /** - * Configures the {@link yfiles.styles.BevelNodeStyleRenderer#style} and {@link yfiles.styles.BevelNodeStyleRenderer#node} properties, calls {@link yfiles.styles.BevelNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the shape geometry for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.BevelNodeStyleRenderer#isInside - * @see yfiles.styles.BevelNodeStyleRenderer#getIntersection - */ - getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.BevelNodeStyleRenderer#configure} and returns this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.BevelNodeStyleRenderer#configure}. If the - * subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.BevelNodeStyleRenderer#isVisible}. - *

- * @param node The node to query visibility tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.BevelNodeStyleRenderer#isVisible - */ - getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.BevelNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the {@link } for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.BevelNodeStyleRenderer#createVisual - * @see yfiles.styles.BevelNodeStyleRenderer#updateVisual - */ - getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; - /** - * - * @param context - * @param location - * @returns - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * Tests the {@link yfiles.styles.BevelNodeStyleRenderer#node node} using the current {@link yfiles.styles.BevelNodeStyleRenderer#style} for an intersection with the given box. - *

- * This implementation uses the {@link yfiles.styles.BevelNodeStyleRenderer#layout} to determine whether the node is in the box. - *

- * @param context the current input mode context - * @param rectangle the box describing the marquee's bounds - * @returns true if the node is considered to be captured by the marquee - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param location - * @returns - */ - isInside(location:yfiles.geometry.Point):boolean; - /** - * Determines visibility by checking for an intersection with the {@link yfiles.styles.BevelNodeStyleRenderer#layout}. - * @param context The context. - * @param rectangle The current clip - * @returns Whether the {@link #layout} is visible in the clip. - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.BevelNodeStyle} - */ - style:yfiles.styles.BevelNodeStyle; - /** - * Gets or sets the currently configured node. - * @protected - * @type {yfiles.graph.INode} - */ - node:yfiles.graph.INode; - /** - * Gets the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. - *

- * Returns Node.Layout. - *

- * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - /** - * Gets the color from the style. - * @protected - * @type {yfiles.view.Color} - */ - color:yfiles.view.Color; - /** - * Gets the inset from the style. - * @protected - * @type {number} - */ - inset:number; - /** - * Gets the radius to use from the style. - * @protected - * @type {number} - */ - radius:number; - /** - * Gets or sets a property that determines whether this instance should provide an {@link yfiles.input.IHandle} for editing the - * radius of the shape. - *

- * The default is false. This implementation will add an appropriate {@link yfiles.input.IHandleProvider} to the {@link yfiles.styles.BevelNodeStyleRenderer#lookup} - * of this instance if this feature is enabled. - *

- * @default false - * @type {boolean} - */ - provideRadiusHandle:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.BevelNodeStyleRenderer; - } - /** - * An implementation of the {@link yfiles.styles.INodeStyle} that can be used to create rectangular nodes with rounded corners, a - * bevel border, and a shining background. - *

- * Optionally, this style renders a drop shadow by itself. - *

- *

- * This style uses the {@link yfiles.styles.BevelNodeStyleRenderer} to visualize a node. - *

- * @see yfiles.styles.BevelNodeStyleRenderer - * @class - * @implements {yfiles.styles.INodeStyle} - */ - export interface BevelNodeStyle extends yfiles.lang.Object,yfiles.styles.INodeStyle{} - export class BevelNodeStyle { - /** - * Creates a new instance using the provided renderer to share. - * @param renderer - */ - constructor(renderer:yfiles.styles.BevelNodeStyleRenderer); - /** - * Creates a new instance using the provided renderer to share. - * @param {Object} options The parameters to pass. - * @param options.renderer - * @param {yfiles.view.Color} options.color The base color to use. - *

- * This option sets the {@link yfiles.styles.BevelNodeStyle#color} property on the created object. - *

- * @param {boolean} options.drawShadow A value indicating whether to draw a drop shadow. - *

- * This option sets the {@link yfiles.styles.BevelNodeStyle#drawShadow} property on the created object. - *

- * @param {number} options.inset The insets to use for the bevel. - *

- * This option sets the {@link yfiles.styles.BevelNodeStyle#inset} property on the created object. - *

- * @param {number} options.radius The radius of the corner of the rounded rectangle. - *

- * This option sets the {@link yfiles.styles.BevelNodeStyle#radius} property on the created object. - *

- */ - constructor(options:{renderer:yfiles.styles.BevelNodeStyleRenderer,color?:yfiles.view.Color,drawShadow?:boolean,inset?:number,radius?:number}); - /** - * Creates a new instance using {@link yfiles.styles.BevelNodeStyleRenderer} as renderer to share. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.view.Color} options.color The base color to use. - *

- * This option sets the {@link yfiles.styles.BevelNodeStyle#color} property on the created object. - *

- * @param {boolean} options.drawShadow A value indicating whether to draw a drop shadow. - *

- * This option sets the {@link yfiles.styles.BevelNodeStyle#drawShadow} property on the created object. - *

- * @param {number} options.inset The insets to use for the bevel. - *

- * This option sets the {@link yfiles.styles.BevelNodeStyle#inset} property on the created object. - *

- * @param {number} options.radius The radius of the corner of the rounded rectangle. - *

- * This option sets the {@link yfiles.styles.BevelNodeStyle#radius} property on the created object. - *

- */ - constructor(options?:{color?:yfiles.view.Color,drawShadow?:boolean,inset?:number,radius?:number}); - /** - * - * @returns - */ - clone():any; - /** - * Gets or sets the insets to use for the bevel. - *

- * The default value is 3. - *

- * @type {number} - */ - inset:number; - /** - * Gets or sets the radius of the corner of the rounded rectangle. - *

- * The default value is 10. - *

- * @type {number} - */ - radius:number; - /** - * Gets or sets the base color to use. - *

- * The default value is {@link yfiles.view.Color#BLACK}. - *

- * @default 'Black' - * @type {yfiles.view.Color} - */ - color:yfiles.view.Color; - /** - * - * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - /** - * Gets or sets a value indicating whether to draw a drop shadow. - *

- * The default value is false. - *

- * @default false - * @type {boolean} - */ - drawShadow:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.BevelNodeStyle; - } - /** - * A style renderer implementation that can be used together with {@link yfiles.styles.ImageNodeStyle} instances. - * @class - * @implements {yfiles.styles.INodeStyleRenderer} - * @implements {yfiles.styles.IShapeGeometry} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface ImageNodeStyleRenderer extends yfiles.lang.Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class ImageNodeStyleRenderer { - constructor(); - /** - * Prepares this instance for subsequent calls after the style and node have been initialized. - *

- * Upon invocation the {@link yfiles.styles.ImageNodeStyleRenderer#style} and {@link yfiles.styles.ImageNodeStyleRenderer#node} properties have been populated by the {@link yfiles.styles.ImageNodeStyleRenderer#getVisualCreator}, - * {@link yfiles.styles.ImageNodeStyleRenderer#getBoundsProvider}, {@link yfiles.styles.ImageNodeStyleRenderer#getHitTestable}, or {@link yfiles.styles.ImageNodeStyleRenderer#getMarqueeTestable} - * methods. - *

- *

- * This is an empty implementation. Subclasses might have to override this method. - *

- * @protected - */ - configure():void; - /** - * - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * Returns the layout bounds as an upper bound for the painting bound. - *

- * This implementation simply sets the {@link yfiles.styles.ImageNodeStyleRenderer#layout}'s bounds to the scratch variable and returns. - *

- * @param context the context to calculate the bounds for - * @returns the bounds or null to indicate an unbound area - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ImageNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the bounds provider for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ImageNodeStyleRenderer#getBounds - */ - getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.ImageNodeStyleRenderer#configure} and returns this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.ImageNodeStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.ImageNodeStyleRenderer#lookup} method call they should call {@link yfiles.styles.ImageNodeStyleRenderer#configure} - * only if needed, i.e. if they decide to return this or an instance that depends on a correctly configured this. - *

- * @param node The node to query the context for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ImageNodeStyleRenderer#lookup - */ - getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; - /** - * Get the style's fallback image. - * @returns - * @protected - */ - getFallbackImage():string; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ImageNodeStyleRenderer#configure} and returns this. - * @param node The node to query hit test with. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ImageNodeStyleRenderer#isHit - */ - getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; - /** - * Get the image that is currently used to render the style. - * @returns - * @protected - */ - getImage():string; - /** - * Tries to use the {@link yfiles.styles.ImageNodeStyle#normalizedOutline} to perform the intersection calculation, otherwise reverts to default (rectangular) behavior. - * @param inner - * @param outer - * @returns - */ - getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ImageNodeStyleRenderer#configure} and returns this. - * @param node The node to query marquee intersection tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ImageNodeStyleRenderer#isInBox - */ - getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; - /** - * Tries to use the {@link yfiles.styles.ImageNodeStyle#normalizedOutline} to create the outline shape path, otherwise reverts to default (rectangular) behavior. - * @returns - */ - getOutline():yfiles.geometry.GeneralPath; - /** - * Gets the value that determines whether the aspect ratio of the image should be preserved. - * @returns false - * @protected - */ - getPreserveAspectRatio():boolean; - /** - * Configures the {@link yfiles.styles.ImageNodeStyleRenderer#style} and {@link yfiles.styles.ImageNodeStyleRenderer#node} properties, calls {@link yfiles.styles.ImageNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the shape geometry for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ImageNodeStyleRenderer#isInside - * @see yfiles.styles.ImageNodeStyleRenderer#getIntersection - */ - getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.ImageNodeStyleRenderer#configure} and returns this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.ImageNodeStyleRenderer#configure}. If the - * subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.ImageNodeStyleRenderer#isVisible}. - *

- * @param node The node to query visibility tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ImageNodeStyleRenderer#isVisible - */ - getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ImageNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the {@link } for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ImageNodeStyleRenderer#createVisual - * @see yfiles.styles.ImageNodeStyleRenderer#updateVisual - */ - getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; - /** - * Tries to use {@link yfiles.styles.ImageNodeStyle#normalizedOutline} to perform the hit test analysis, otherwise reverts to default (rectangular) behavior. - * @param context the context the hit test is performed in - * @param location the coordinates in world coordinate system - * @returns whether something has been hit - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * Tries to use the {@link yfiles.styles.ImageNodeStyle#normalizedOutline} to perform the marquee intersection analysis, otherwise reverts to default (rectangular) behavior. - * @param context - * @param rectangle - * @returns - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Tries to use the {@link yfiles.styles.ImageNodeStyle#normalizedOutline} to perform the contains test, otherwise reverts to default (rectangular) behavior. - * @param location - * @returns - */ - isInside(location:yfiles.geometry.Point):boolean; - /** - * Determines visibility by checking for an intersection with the {@link yfiles.styles.ImageNodeStyleRenderer#layout}. - * @param context The context. - * @param rectangle The current clip - * @returns Whether the {@link #layout} is visible in the clip. - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Implements the {@link yfiles.graph.ILookup} interface. - *

- * This method will be used by default if {@link yfiles.styles.ImageNodeStyleRenderer#getContext} has been queried for a lookup - * implementation. Note that it cannot be assumed that {@link yfiles.styles.ImageNodeStyleRenderer#configure} has already been - * invoked. However, normally {@link yfiles.styles.ImageNodeStyleRenderer#node} and {@link yfiles.styles.ImageNodeStyleRenderer#style} will be correctly configured if invoked directly after GetContext. Subclass - * implementations should make sure to configure this instance before they return this as a result of a successful lookup. - * This implementation will check if type.IsInstanceOfType(this) and will call {@link yfiles.styles.ImageNodeStyleRenderer#configure} - * on success and return this. - *

- * @param type The type to query for. - * @returns An implementation or null. - */ - lookup(type:yfiles.lang.Class):any; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.ImageNodeStyle} - */ - style:yfiles.styles.ImageNodeStyle; - /** - * Gets or sets the currently configured node. - * @protected - * @type {yfiles.graph.INode} - */ - node:yfiles.graph.INode; - /** - * Gets the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. - *

- * Returns Node.Layout. - *

- * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - /** - * A {@link string} that will be used to find the fallback image url that will be used to render the node, if the style does not - * explicitly specify a {@link yfiles.styles.ImageNodeStyle#fallbackImage fallback image}. - * @const - * @static - * @type {string} - */ - static TEMPLATE_KEY:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.ImageNodeStyleRenderer; - } - /** - * A node style that can use an image for the visual representation of a node. - *

- * This style can be used together with {@link yfiles.styles.ImageNodeStyleRenderer} instances. - *

- * @class - * @implements {yfiles.styles.INodeStyle} - */ - export interface ImageNodeStyle extends yfiles.lang.Object,yfiles.styles.INodeStyle{} - export class ImageNodeStyle { - /** - * Creates a new instance that uses the specified image and a custom renderer instance. - * @param image The image. - * @param [fallbackImage=null] The fallback image. - * @param [renderer=null] The renderer for this instance - */ - constructor(image:string,fallbackImage?:string,renderer?:yfiles.styles.ImageNodeStyleRenderer); - /** - * Creates a new instance that uses the specified image and a custom renderer instance. - * @param {Object} options The parameters to pass. - * @param options.image The image. - * @param [options.fallbackImage=null] The fallback image. - * @param [options.renderer=null] The renderer for this instance - * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of the image that will be displayed. - *

- * This option sets the {@link yfiles.styles.ImageNodeStyle#normalizedOutline} property on the created object. - *

- */ - constructor(options:{image:string,fallbackImage?:string,renderer?:yfiles.styles.ImageNodeStyleRenderer,normalizedOutline?:yfiles.geometry.GeneralPath}); - /** - * Creates a new instance with no image and {@link yfiles.styles.ImageNodeStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {string} [options.fallbackImage=null] Sets the fallbackImage property. - * @param {string} options.image The image that is used for the style instance. - *

- * This option sets the {@link yfiles.styles.ImageNodeStyle#image} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of the image that will be displayed. - *

- * This option sets the {@link yfiles.styles.ImageNodeStyle#normalizedOutline} property on the created object. - *

- */ - constructor(options?:{fallbackImage?:string,image?:string,normalizedOutline?:yfiles.geometry.GeneralPath}); - /** - * This implementation performs a shallow copy with respect to the {@link yfiles.styles.ImageNodeStyle#image} property. - *

- * If clients need to have a deep copy of this instance, they need to manually clone and reassign the {@link yfiles.styles.ImageNodeStyle#image} to the clone. - *

- * @returns A shallow copy of this instance. - */ - clone():any; - /** - * - * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - /** - * Gets or sets the image that is used for the style instance. - *

- * The default value is null. - *

- * @type {string} - */ - image:string; - /** - * - * @default null - * @type {string} - */ - fallbackImage:string; - /** - * Gets or sets the normalized outline of the image that will be displayed. - *

- * This shape will be used to satisfy requests to {@link yfiles.input.IMarqueeTestable#isInBox} and {@link yfiles.input.IHitTestable#isHit} - * and may be left null to indicate default (rectangular) behavior. - *

- *

- * The default value is null. - *

- * @default null - * @type {yfiles.geometry.GeneralPath} - */ - normalizedOutline:yfiles.geometry.GeneralPath; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.ImageNodeStyle; - } - /** - * An implementation of {@link yfiles.styles.INodeStyle} that draws a simple floating panel with a slight gradient, a thin border - * and optionally a drop shadow. - *

- * This style can be used to create the visual representation for group nodes, for example. By default, it a drop shadow by - * itself. - *

- *

- * This style uses the {@link yfiles.styles.PanelNodeStyleRenderer} to visualize a node. - *

- * @see yfiles.styles.PanelNodeStyleRenderer - * @class - * @implements {yfiles.styles.INodeStyle} - */ - export interface PanelNodeStyle extends yfiles.lang.Object,yfiles.styles.INodeStyle{} - export class PanelNodeStyle { - /** - * Creates a new instance using the provided renderer to share. - * @param renderer - */ - constructor(renderer:yfiles.styles.PanelNodeStyleRenderer); - /** - * Creates a new instance using the provided renderer to share. - * @param {Object} options The parameters to pass. - * @param options.renderer - * @param {yfiles.view.Color} options.color The base color to use. - *

- * This option sets the {@link yfiles.styles.PanelNodeStyle#color} property on the created object. - *

- * @param {yfiles.geometry.Insets} options.insets The instance to use that provides the insets for this style. - *

- * This option sets the {@link yfiles.styles.PanelNodeStyle#insets} property on the created object. - *

- * @param {yfiles.view.Color} options.labelInsetsColor The base color to use for drawing the label insets background. - *

- * This option sets the {@link yfiles.styles.PanelNodeStyle#labelInsetsColor} property on the created object. - *

- */ - constructor(options:{renderer:yfiles.styles.PanelNodeStyleRenderer,color?:yfiles.view.Color,insets?:yfiles.geometry.Insets,labelInsetsColor?:yfiles.view.Color}); - /** - * Creates a new instance using {@link yfiles.styles.PanelNodeStyleRenderer} as renderer to share. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.view.Color} options.color The base color to use. - *

- * This option sets the {@link yfiles.styles.PanelNodeStyle#color} property on the created object. - *

- * @param {yfiles.geometry.Insets} options.insets The instance to use that provides the insets for this style. - *

- * This option sets the {@link yfiles.styles.PanelNodeStyle#insets} property on the created object. - *

- * @param {yfiles.view.Color} options.labelInsetsColor The base color to use for drawing the label insets background. - *

- * This option sets the {@link yfiles.styles.PanelNodeStyle#labelInsetsColor} property on the created object. - *

- */ - constructor(options?:{color?:yfiles.view.Color,insets?:yfiles.geometry.Insets,labelInsetsColor?:yfiles.view.Color}); - /** - * - * @returns - */ - clone():any; - /** - * Gets or sets the base color to use. - *

- * The default value is {@link yfiles.view.Color#BLACK}. - *

- * @default 'Black' - * @type {yfiles.view.Color} - */ - color:yfiles.view.Color; - /** - * Gets or sets the base color to use for drawing the label insets background. - *

- * Setting this to null effectively disables label insets background coloring. - *

- *

- * The default value is {@link yfiles.view.Color#LIGHT_GRAY}. - *

- * @default 'LightGray' - * @type {yfiles.view.Color} - */ - labelInsetsColor:yfiles.view.Color; - /** - * Gets or sets the instance to use that provides the insets for this style. - *

- * The {@link yfiles.styles.PanelNodeStyleRenderer} will use these insets and return them via an {@link yfiles.input.INodeInsetsProvider} - * if such an instance is queried through the {@link yfiles.styles.INodeStyleRenderer#getContext context lookup}. - *

- *

- * The default insets are set to (5,5,5,5). - *

- * @see yfiles.input.INodeInsetsProvider - * @default '5, 5, 5, 5' - * @type {yfiles.geometry.Insets} - */ - insets:yfiles.geometry.Insets; - /** - * - * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.PanelNodeStyle; - } - /** - * A {@link yfiles.styles.INodeStyle} {@link yfiles.styles.INodeStyleRenderer renderer} implementation that draws a simple floating panel with a slight gradient, a thin - * border and a simple drop shadow. - * @see yfiles.styles.PanelNodeStyle - * @class - * @implements {yfiles.styles.INodeStyleRenderer} - * @implements {yfiles.styles.IShapeGeometry} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface PanelNodeStyleRenderer extends yfiles.lang.Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class PanelNodeStyleRenderer { - /** - * The style that it currently assigned to this renderer instance. - */ - constructor(); - /** - * Prepares this instance for subsequent calls after the style and node have been initialized. - *

- * Upon invocation the {@link yfiles.styles.PanelNodeStyleRenderer#style} and {@link yfiles.styles.PanelNodeStyleRenderer#node} properties have been populated by the {@link yfiles.styles.PanelNodeStyleRenderer#getVisualCreator}, - * {@link yfiles.styles.PanelNodeStyleRenderer#getBoundsProvider}, {@link yfiles.styles.PanelNodeStyleRenderer#getHitTestable}, or {@link yfiles.styles.PanelNodeStyleRenderer#getMarqueeTestable} - * methods. - *

- *

- * This is an empty implementation. Subclasses might have to override this method. - *

- * @protected - */ - configure():void; - /** - * - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * Determines whether to draw the drop shadow. - * @returns true, always. - * @protected - */ - drawShadow():boolean; - /** - * - * @param context - * @returns - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.PanelNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the bounds provider for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PanelNodeStyleRenderer#getBounds - */ - getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.PanelNodeStyleRenderer#configure} and returns this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.PanelNodeStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.PanelNodeStyleRenderer#lookup} method call they should call {@link yfiles.styles.PanelNodeStyleRenderer#configure} - * only if needed, i.e. if they decide to return this or an instance that depends on a correctly configured this. - *

- * @param node The node to query the context for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PanelNodeStyleRenderer#lookup - */ - getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.PanelNodeStyleRenderer#configure} and returns this. - * @param node The node to query hit test with. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PanelNodeStyleRenderer#isHit - */ - getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; - /** - * Finds an intersection for the current {@link yfiles.styles.PanelNodeStyleRenderer#node node} using the {@link yfiles.styles.PanelNodeStyleRenderer#style}. - *

- * This implementation returns the intersection for the {@link yfiles.styles.PanelNodeStyleRenderer#layout}. - *

- * @param inner - * @param outer - * @returns True if an intersection was actually found - */ - getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.PanelNodeStyleRenderer#configure} and returns this. - * @param node The node to query marquee intersection tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PanelNodeStyleRenderer#isInBox - */ - getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; - /** - * Returns the outline of the shape using the node's {@link yfiles.styles.PanelNodeStyleRenderer#layout}. - * @returns The outline of the bounds of the node. - */ - getOutline():yfiles.geometry.GeneralPath; - /** - * Configures the {@link yfiles.styles.PanelNodeStyleRenderer#style} and {@link yfiles.styles.PanelNodeStyleRenderer#node} properties, calls {@link yfiles.styles.PanelNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the shape geometry for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PanelNodeStyleRenderer#isInside - * @see yfiles.styles.PanelNodeStyleRenderer#getIntersection - */ - getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.PanelNodeStyleRenderer#configure} and returns this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.PanelNodeStyleRenderer#configure}. If the - * subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.PanelNodeStyleRenderer#isVisible}. - *

- * @param node The node to query visibility tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PanelNodeStyleRenderer#isVisible - */ - getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.PanelNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the {@link } for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.PanelNodeStyleRenderer#createVisual - * @see yfiles.styles.PanelNodeStyleRenderer#updateVisual - */ - getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; - /** - * Hit tests the {@link yfiles.styles.PanelNodeStyleRenderer#node node} using the current {@link yfiles.styles.PanelNodeStyleRenderer#style}. - *

- * This implementation uses the {@link yfiles.styles.PanelNodeStyleRenderer#layout} to determine whether the node has been hit. The check is delegated to {@link yfiles.geometry.Rect#containsWithEps} - * using {@link yfiles.view.ICanvasContext#hitTestRadius} as the last argument. - *

- * @param context the context the hit test is performed in - * @param location the coordinates in world coordinate system - * @returns whether something has been hit - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * Tests the {@link yfiles.styles.PanelNodeStyleRenderer#node node} using the current {@link yfiles.styles.PanelNodeStyleRenderer#style} for an intersection with the given box. - *

- * This implementation uses the {@link yfiles.styles.PanelNodeStyleRenderer#layout} to determine whether the node is in the box. - *

- * @param context the current input mode context - * @param rectangle the box describing the marquee's bounds - * @returns true if the node is considered to be captured by the marquee - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Checks whether the given coordinate lies within the shape's geometric bounds. - *

- * This implementation checks for containment in the {@link yfiles.styles.PanelNodeStyleRenderer#layout}. - *

- * @param location - * @returns True if the point lies within the geometry of the rendering. - */ - isInside(location:yfiles.geometry.Point):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.PanelNodeStyle} - */ - style:yfiles.styles.PanelNodeStyle; - /** - * Gets or sets the currently configured node. - * @protected - * @type {yfiles.graph.INode} - */ - node:yfiles.graph.INode; - /** - * Gets the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. - *

- * Returns Node.Layout. - *

- * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - /** - * Gets the color from the style. - * @protected - * @type {yfiles.view.Color} - */ - color:yfiles.view.Color; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.PanelNodeStyleRenderer; - } - /** - * Decorates other node styles with a smooth drop shadow. - *

- * This implementation uses an SVG filter effect. This may cause performance issues for larger nodes or high zoom factors. - * In this case it might be more appropriate to implement a drop shadow implementation using canvas drawing and displaying - * the canvas content using an image element with canvas.toDataURL. - *

- * @class - * @implements {yfiles.styles.INodeStyle} - */ - export interface ShadowNodeStyleDecorator extends yfiles.lang.Object,yfiles.styles.INodeStyle{} - export class ShadowNodeStyleDecorator { - /** - * Creates a new instance wrapping the provided style. - *

- * The provided instance is used by reference, so subsequent changes to the style will affect the appearance of this - * style. - *

- * @param wrapped The style to wrap. - */ - constructor(wrapped:yfiles.styles.INodeStyle); - /** - * Creates a new instance wrapping a simple {@link yfiles.styles.ShapeNodeStyle}. - *

- * The provided instance is used by reference, so subsequent changes to the style will affect the appearance of this - * style. - *

- * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.styles.INodeStyle} options.wrapped The wrapped node style instance by reference. - *

- * This option sets the {@link yfiles.styles.ShadowNodeStyleDecorator#wrapped} property on the created object. - *

- * @see yfiles.styles.ShadowNodeStyleDecorator#wrapped - */ - constructor(options?:{wrapped?:yfiles.styles.INodeStyle}); - /** - * - * @returns - */ - clone():any; - /** - * Gets or sets the wrapped node style instance by reference. - * @type {yfiles.styles.INodeStyle} - */ - wrapped:yfiles.styles.INodeStyle; - /** - * - * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.ShadowNodeStyleDecorator; - } - /** - * Implementation of the {@link yfiles.styles.INodeStyle} which creates rectangular nodes with rounded corners and a highlighted - * ('shiny plate') interior. - *

- * By default, this style renders a drop shadow by itself. - *

- *

- * This style uses the {@link yfiles.styles.ShinyPlateNodeStyleRenderer} to visualize a node. - *

- * @see yfiles.styles.ShinyPlateNodeStyleRenderer - * @class - * @implements {yfiles.styles.INodeStyle} - */ - export interface ShinyPlateNodeStyle extends yfiles.lang.Object,yfiles.styles.INodeStyle{} - export class ShinyPlateNodeStyle { - /** - * Creates a new instance using the provided renderer. - * @param renderer - */ - constructor(renderer:yfiles.styles.ShinyPlateNodeStyleRenderer); - /** - * Creates a new instance using the provided renderer. - * @param {Object} options The parameters to pass. - * @param options.renderer - * @param {yfiles.view.Fill} options.fill The background brush for this style. - *

- * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#fill} property on the created object. - *

- * @param {boolean} options.drawShadow A value indicating whether to draw a drop shadow. - *

- * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#drawShadow} property on the created object. - *

- * @param {yfiles.geometry.Insets} options.insets The instance to use that provides the insets for this style. - *

- * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#insets} property on the created object. - *

- * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.ShinyPlateNodeStyle#stroke} to use for the outline. - *

- * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#stroke} property on the created object. - *

- * @param {number} options.radius The corner radius of the rounded rectangle - *

- * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#radius} property on the created object. - *

- */ - constructor(options:{renderer:yfiles.styles.ShinyPlateNodeStyleRenderer,fill?:yfiles.view.Fill,drawShadow?:boolean,insets?:yfiles.geometry.Insets,stroke?:yfiles.view.Stroke,radius?:number}); - /** - * Creates a new instance using {@link yfiles.styles.ShinyPlateNodeStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.view.Fill} options.fill The background brush for this style. - *

- * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#fill} property on the created object. - *

- * @param {boolean} options.drawShadow A value indicating whether to draw a drop shadow. - *

- * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#drawShadow} property on the created object. - *

- * @param {yfiles.geometry.Insets} options.insets The instance to use that provides the insets for this style. - *

- * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#insets} property on the created object. - *

- * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.ShinyPlateNodeStyle#stroke} to use for the outline. - *

- * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#stroke} property on the created object. - *

- * @param {number} options.radius The corner radius of the rounded rectangle - *

- * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#radius} property on the created object. - *

- */ - constructor(options?:{fill?:yfiles.view.Fill,drawShadow?:boolean,insets?:yfiles.geometry.Insets,stroke?:yfiles.view.Stroke,radius?:number}); - /** - * - * @returns - */ - clone():any; - /** - * Gets or sets the background brush for this style. - *

- * The default value is {@link yfiles.view.Fill#BLACK}. - *

- * @type {yfiles.view.Fill} - */ - fill:yfiles.view.Fill; - /** - * Gets or sets the {@link yfiles.styles.ShinyPlateNodeStyle#stroke} to use for the outline. - *

- * The default value is null. - *

- * @default null - * @type {yfiles.view.Stroke} - */ - stroke:yfiles.view.Stroke; - /** - * Gets or sets the corner radius of the rounded rectangle - *

- * The default value is 5. - *

- * @default 5 - * @type {number} - */ - radius:number; - /** - * Gets or sets a value indicating whether to draw a drop shadow. - *

- * The default value is true. - *

- * @default true - * @type {boolean} - */ - drawShadow:boolean; - /** - * Gets or sets the instance to use that provides the insets for this style. - *

- * The {@link yfiles.styles.ShinyPlateNodeStyleRenderer} will use these insets and return them via an {@link yfiles.input.INodeInsetsProvider} - * if such an instance is queried through the {@link yfiles.styles.INodeStyleRenderer#getContext context lookup}. - *

- *

- * The default insets are set to (5,5,5,5). - *

- * @see yfiles.input.INodeInsetsProvider - * @default '5,5,5,5' - * @type {yfiles.geometry.Insets} - */ - insets:yfiles.geometry.Insets; - /** - * - * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.ShinyPlateNodeStyle; - } - /** - * A {@link yfiles.styles.INodeStyle} {@link yfiles.styles.INodeStyleRenderer renderer} implementation that draws a simple floating shinyPlate with a slight gradient, a - * thin border and a simple drop shadow. - * @see yfiles.styles.ShinyPlateNodeStyle - * @class - * @implements {yfiles.styles.INodeStyleRenderer} - * @implements {yfiles.styles.IShapeGeometry} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface ShinyPlateNodeStyleRenderer extends yfiles.lang.Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class ShinyPlateNodeStyleRenderer { - /** - * Prepares this instance for subsequent calls after the style and node have been initialized. - *

- * Upon invocation the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#style} and {@link yfiles.styles.ShinyPlateNodeStyleRenderer#node} properties have been populated by the - * {@link yfiles.styles.ShinyPlateNodeStyleRenderer#getVisualCreator}, {@link yfiles.styles.ShinyPlateNodeStyleRenderer#getBoundsProvider}, - * {@link yfiles.styles.ShinyPlateNodeStyleRenderer#getHitTestable}, or {@link yfiles.styles.ShinyPlateNodeStyleRenderer#getMarqueeTestable} - * methods. - *

- *

- * This is an empty implementation. Subclasses might have to override this method. - *

- * @protected - */ - configure():void; - /** - * - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * Determines whether to draw the drop shadow. - * @returns {@link #drawShadow}. - * @protected - */ - drawShadow():boolean; - /** - * - * @param context - * @returns - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the bounds provider for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShinyPlateNodeStyleRenderer#getBounds - */ - getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} and returns - * this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#lookup} method call they should - * call {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} only if needed, i.e. if they decide to return this or an - * instance that depends on a correctly configured this. - *

- * @param node The node to query the context for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShinyPlateNodeStyleRenderer#lookup - */ - getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} and returns this. - * @param node The node to query hit test with. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShinyPlateNodeStyleRenderer#isHit - */ - getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; - /** - * - * @param inner - * @param outer - * @returns - */ - getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} and returns this. - * @param node The node to query marquee intersection tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShinyPlateNodeStyleRenderer#isInBox - */ - getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; - /** - * - * @returns - */ - getOutline():yfiles.geometry.GeneralPath; - /** - * Configures the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#style} and {@link yfiles.styles.ShinyPlateNodeStyleRenderer#node} properties, calls {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the shape geometry for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShinyPlateNodeStyleRenderer#isInside - * @see yfiles.styles.ShinyPlateNodeStyleRenderer#getIntersection - */ - getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} and returns - * this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure}. If - * the subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.ShinyPlateNodeStyleRenderer#isVisible}. - *

- * @param node The node to query visibility tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShinyPlateNodeStyleRenderer#isVisible - */ - getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the {@link } for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.ShinyPlateNodeStyleRenderer#createVisual - * @see yfiles.styles.ShinyPlateNodeStyleRenderer#updateVisual - */ - getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; - /** - * - * @param context - * @param location - * @returns - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * Tests the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#node node} using the current {@link yfiles.styles.ShinyPlateNodeStyleRenderer#style} for an intersection with the given box. - *

- * This implementation uses the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#layout} to determine whether the node is in the box. - *

- * @param context the current input mode context - * @param rectangle the box describing the marquee's bounds - * @returns true if the node is considered to be captured by the marquee - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param location - * @returns - */ - isInside(location:yfiles.geometry.Point):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.ShinyPlateNodeStyle} - */ - style:yfiles.styles.ShinyPlateNodeStyle; - /** - * Gets or sets the currently configured node. - * @protected - * @type {yfiles.graph.INode} - */ - node:yfiles.graph.INode; - /** - * Gets the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. - *

- * Returns Node.Layout. - *

- * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - /** - * Gets the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#fill} from the style. - * @protected - * @type {yfiles.view.Fill} - */ - fill:yfiles.view.Fill; - /** - * Gets the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#stroke} from the style. - * @protected - * @type {yfiles.view.Stroke} - */ - stroke:yfiles.view.Stroke; - /** - * Gets the radius from the style. - * @protected - * @type {number} - */ - radius:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.ShinyPlateNodeStyleRenderer; - } - /** - * Base class for stripe styles that use a SVG snippet as template for the visualization of {@link yfiles.graph.IStripe}s. - * @see yfiles.styles.TemplateStripeStyle - * @see yfiles.styles.StringTemplateStripeStyle - * @class - * @implements {yfiles.styles.IStripeStyle} - * @implements {yfiles.lang.IPropertyObservable} - * @implements {yfiles.lang.ICloneable} - */ - export interface TemplateStripeStyleBase extends yfiles.lang.Object,yfiles.styles.IStripeStyle,yfiles.lang.IPropertyObservable,yfiles.lang.ICloneable{} - export class TemplateStripeStyleBase { - /** - * Constructs a new instance using the provided renderer. - * @param renderer - * @protected - */ - constructor(renderer:yfiles.styles.TemplateStripeStyleRenderer); - /** - * Constructs a new instance of this style with default values. - * @protected - */ - constructor(); - /** - * Performs a shallow clone of this instance, except for the value of {@link yfiles.styles.TemplateStripeStyleBase#styleTag} which is cloned, too, if it can be cloned. - * @returns A clone of this instance. - */ - clone():any; - /** - * Factory method that is called by the {@link yfiles.styles.TemplateStripeStyleRenderer} to create the visual that will be used - * for the display of the stripe. - * @param context The context for which the visual should be created. - * @param stripe The stripe that will be rendered. - * @returns The readily styled visual. - */ - createTemplate(context:yfiles.view.IRenderContext,stripe:yfiles.graph.IStripe):yfiles.view.SvgVisual; - /** - * Loads all template script elements that have not been parsed, yet, and creates the respective template cache objects. - *

- * This method can be called to perform the template loading at a certain point in time, for example during application - * startup. By default, a template is loaded lazily when the first visual using this template is built. - *

- * @static - */ - static loadAllTemplates():void; - /** - * Raises the {@link yfiles.styles.TemplateStripeStyleBase#addPropertyChangedListener PropertyChanged} - * event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onPropertyChanged(evt:yfiles.lang.PropertyChangedEventArgs):void; - /** - * Adds the given listener for the PropertyChanged event that occurs when a property value changes. - * @param listener The listener to add. - * @see yfiles.styles.TemplateStripeStyleBase#removePropertyChangedListener - */ - addPropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the PropertyChanged event that occurs when a property value changes. - * @param listener The listener to remove. - * @see yfiles.styles.TemplateStripeStyleBase#addPropertyChangedListener - */ - removePropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Gets or sets the tag that is associated with this style instance. - *

- * The various style renderer implementations can use this tag to make it accessible in the context of the instantiated - * templates and controls. The framework does not make any assumptions about the value of this property. It is there for - * convenient use in the process of data binding the templates. This property supports {@link yfiles.lang.IPropertyObservable property change notification} and can - * thus be data bound easily. - *

- * @default null - * @type {any} - */ - styleTag:any; - /** - * Gets or sets an implementation of {@link yfiles.graph.IContextLookup} that can be used to satisfy queries that are made to the - * implementation which is returned by calls to {@link yfiles.styles.IStripeStyleRenderer#getContext} that are made on the style - * renderer that is associated with this style instance. - *

- * This can be used to conveniently customize the lookup behavior of the style renderers that are associated with this - * instance. The default value is {@link yfiles.graph.IContextLookup#EMPTY_CONTEXT_LOOKUP} - *

- * @default 'Lookups.EmptyContextLookup' - * @type {yfiles.graph.IContextLookup} - */ - contextLookup:yfiles.graph.IContextLookup; - /** - * Convenience getter that yields the {@link yfiles.styles.TemplateStripeStyleRenderer} that is used by this instance. - * @see yfiles.styles.IStripeStyle#renderer - * @type {yfiles.styles.IStripeStyleRenderer} - */ - renderer:yfiles.styles.IStripeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplateStripeStyleBase; - } - /** - * An {@link yfiles.styles.IStripeStyle} implementation that can render complex {@link yfiles.view.Visual}s for the visualization of - * {@link yfiles.graph.IStripe}s using a {@link yfiles.styles.TemplateStripeStyleRenderer}. - *

- * The {@link yfiles.styles.TemplateStripeStyle#styleResourceKey} is used to determine the template that will be applied to the {@link yfiles.view.Visual}. - *

- *

Related demos:

- *
    - *
  • Demo: Control Styles Demo, Demo.yFiles.Graph.ControlStyles
  • - *
  • Demo: OrgChart Demo, Demo.yFiles.Graph.OrgChart
  • - *
- * @class - * @extends {yfiles.styles.TemplateStripeStyleBase} - */ - export interface TemplateStripeStyle extends yfiles.styles.TemplateStripeStyleBase{} - export class TemplateStripeStyle { - /** - * Creates a new instance using the given resource key and a custom renderer instance. - * @param styleResourceKey The key of the style resource that will be used for the component. - * @param renderer The custom renderer for this style instance. - */ - constructor(styleResourceKey:string,renderer:yfiles.styles.TemplateStripeStyleRenderer); - /** - * Creates a new instance using the given resource key and {@link yfiles.styles.TemplateStripeStyleRenderer} as renderer. - * @param styleResourceKey The key of the style resource that will be used for the component. - */ - constructor(styleResourceKey:string); - /** - * Creates a new instance with no style resource key and {@link yfiles.styles.TemplateStripeStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {string} options.styleResourceKey The {@link string} that will be used to look up the template that is applied to the component. - *

- * This option sets the {@link yfiles.styles.TemplateStripeStyle#styleResourceKey} property on the created object. - *

- */ - constructor(options?:{styleResourceKey?:string}); - /** - * Gets or sets the {@link string} that will be used to look up the template that is applied to the component. - * @default null - * @type {string} - */ - styleResourceKey:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplateStripeStyle; - } - /** - * A {@link yfiles.styles.IStripeStyle} that uses an SVG snippet as template for the visualization of {@link yfiles.graph.IStripe}s. - *

- * In contrast to {@link yfiles.styles.TemplateStripeStyle}, the SVG template used by this style must be encoded as string and set - * to the {@link yfiles.styles.StringTemplateStripeStyle#svgContent} property. - *

- *

- * It is vital that the {@link yfiles.styles.StringTemplateStripeStyle#svgContent SVG snippet} does not declare the SVG namespace itself. Its content is parsed in a dummy namespace - * in order to avoid immediate validation of the result. The resulting SVG elements are automatically created in the SVG - * namespace before they are added to the DOM. - *

- * @class - * @extends {yfiles.styles.TemplateStripeStyleBase} - */ - export interface StringTemplateStripeStyle extends yfiles.styles.TemplateStripeStyleBase{} - export class StringTemplateStripeStyle { - /** - * Creates a new instance using the given SVG template and a custom renderer instance. - * @param svgContent The SVG snippet that will be used as a template for the component. - * @param renderer The custom renderer for this instance. - */ - constructor(svgContent:string,renderer:yfiles.styles.TemplateStripeStyleRenderer); - /** - * Creates a new instance using the given SVG template and a custom renderer instance. - * @param {Object} options The parameters to pass. - * @param options.svgContent The SVG snippet that will be used as a template for the component. - * @param options.renderer The custom renderer for this instance. - * @param {Object} options.styleTag The tag that is associated with this style instance. - *

- * This option sets the {@link yfiles.styles.TemplateStripeStyleBase#styleTag} property on the created object. - *

- */ - constructor(options:{svgContent:string,renderer:yfiles.styles.TemplateStripeStyleRenderer,styleTag?:Object}); - /** - * Creates a new instance using the given SVG template and {@link yfiles.styles.TemplateStripeStyleRenderer} as renderer. - * @param svgContent The SVG snippet that will be used as a template for the component. - */ - constructor(svgContent:string); - /** - * Creates a new instance with no SVG template and {@link yfiles.styles.TemplateStripeStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {string} options.svgContent The SVG content that is the template for the stripe visualization. - *

- * This option sets the {@link yfiles.styles.StringTemplateStripeStyle#svgContent} property on the created object. - *

- */ - constructor(options?:{svgContent?:string}); - /** - * Gets or sets the SVG content that is the template for the stripe visualization. - * @default null - * @type {string} - */ - svgContent:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.StringTemplateStripeStyle; - } - /** - * An implementation of the {@link yfiles.styles.IStripeStyleRenderer} interface that can render {@link yfiles.styles.TemplateStripeStyle} - * instances. - * @see yfiles.styles.TemplateStripeStyle - * @class - * @implements {yfiles.styles.IStripeStyleRenderer} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface TemplateStripeStyleRenderer extends yfiles.lang.Object,yfiles.styles.IStripeStyleRenderer,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class TemplateStripeStyleRenderer { - /** - * Prepares this instance for subsequent calls after the style and stripe have been initialized. - *

- * Upon invocation the {@link yfiles.styles.TemplateStripeStyleRenderer#style} and {@link yfiles.styles.TemplateStripeStyleRenderer#stripe} properties have been populated by the {@link yfiles.styles.TemplateStripeStyleRenderer#getVisualCreator} - * or {@link yfiles.styles.TemplateStripeStyleRenderer#getContext} methods. - *

- *

- * This is an empty implementation. Subclasses might have to override this method. - *

- * @protected - */ - configure():void; - /** - * Creates the visual by delegating to CreateControl and then initializing the control with the context. - * @param context The context for the creation. - * @returns The control that is used for rendering the stripe. - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * Configures the style and stripe parameters, does not call {@link yfiles.styles.TemplateStripeStyleRenderer#configure} and returns - * this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.TemplateStripeStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.TemplateStripeStyleRenderer#lookup} method call they should - * call {@link yfiles.styles.TemplateStripeStyleRenderer#configure} only if needed, i.e. if they decide to return this or an - * instance that depends on a correctly configured this. - *

- * @param stripe The stripe to query the context for. The value will be stored in the {@link #stripe} property. - * @param style The style to associate with the stripe. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateStripeStyleRenderer#lookup - */ - getContext(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):yfiles.graph.ILookup; - /** - * Gets the context by delegating to {@link yfiles.styles.TemplateStripeStyleBase#contextLookup}. - * @param style - * @returns - * @protected - */ - getContextLookup(style:yfiles.styles.TemplateStripeStyleBase):yfiles.graph.IContextLookup; - /** - * Configures the style and stripe parameters, calls {@link yfiles.styles.TemplateStripeStyleRenderer#configure} and returns this. - * @param stripe The stripe to retrieve the {@link } for. The value will be stored in the {@link #stripe} property. - * @param style The style to associate with the stripe. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateStripeStyleRenderer#createVisual - * @see yfiles.styles.TemplateStripeStyleRenderer#updateVisual - */ - getVisualCreator(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):yfiles.view.IVisualCreator; - /** - * Implementation of the {@link yfiles.graph.ILookup#lookup} method. - *

- * Delegates to the lookup returned by GetContextLookup(StripeControlStripeStyle), first. Last, it returns this class if it - * implements the queried type. - *

- * @param type The type to query an instance for. - * @returns The implementation or null. - */ - lookup(type:yfiles.lang.Class):any; - /** - * Updates the component correspondingly. - * @param context The context for the creation. - * @param oldVisual The currently rendered visual. - * @returns The control that is used for rendering the stripe. - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.TemplateStripeStyleBase} - */ - style:yfiles.styles.TemplateStripeStyleBase; - /** - * Gets or sets the currently configured stripe. - * @protected - * @type {yfiles.graph.IStripe} - */ - stripe:yfiles.graph.IStripe; - /** - * Gets the {@link yfiles.graph.IStripe#layout} of the stripe this renderer is currently configured for. - *

- * Returns Stripe.Layout. - *

- * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplateStripeStyleRenderer; - } - /** - * A {@link yfiles.styles.INodeStyle} for {@link yfiles.graph.ITable tables}. - *

- * This implementations stores the table instance and therefore, its instances cannot be shared among different table - * instances. - *

- * @class - * @implements {yfiles.styles.INodeStyle} - * @implements {yfiles.lang.IPropertyObservable} - */ - export interface TableNodeStyle extends yfiles.lang.Object,yfiles.styles.INodeStyle,yfiles.lang.IPropertyObservable{} - export class TableNodeStyle { - /** - * Constructor with a custom renderer implementation that uses table as backing table model. - * @param table The table instance that defines the tabular structure. - * @param [renderer=null] Custom renderer instance for this style. - */ - constructor(table:yfiles.graph.ITable,renderer?:yfiles.styles.TableNodeStyleRenderer); - /** - * Constructor with a custom renderer implementation that uses table as backing table model. - * @param {Object} options The parameters to pass. - * @param options.table The table instance that defines the tabular structure. - * @param [options.renderer=null] Custom renderer instance for this style. - * @param {yfiles.styles.INodeStyle} options.backgroundStyle The style that is used to draw the background of the table - *

- * This option sets the {@link yfiles.styles.TableNodeStyle#backgroundStyle} property on the created object. - *

- * @param {yfiles.styles.TableRenderingOrder} options.tableRenderingOrder The order in which rows and columns are rendered. - *

- * This option sets the {@link yfiles.styles.TableNodeStyle#tableRenderingOrder} property on the created object. - *

- */ - constructor(options:{table:yfiles.graph.ITable,renderer?:yfiles.styles.TableNodeStyleRenderer,backgroundStyle?:yfiles.styles.INodeStyle,tableRenderingOrder?:yfiles.styles.TableRenderingOrder}); - /** - * Default constructor that creates an empty table. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.styles.INodeStyle} options.backgroundStyle The style that is used to draw the background of the table - *

- * This option sets the {@link yfiles.styles.TableNodeStyle#backgroundStyle} property on the created object. - *

- * @param {yfiles.graph.ITable} options.table The {@link yfiles.graph.ITable} instance that defines the tabular structure. - *

- * This option sets the {@link yfiles.styles.TableNodeStyle#table} property on the created object. - *

- * @param {yfiles.styles.TableRenderingOrder} options.tableRenderingOrder The order in which rows and columns are rendered. - *

- * This option sets the {@link yfiles.styles.TableNodeStyle#tableRenderingOrder} property on the created object. - *

- */ - constructor(options?:{backgroundStyle?:yfiles.styles.INodeStyle,table?:yfiles.graph.ITable,tableRenderingOrder?:yfiles.styles.TableRenderingOrder}); - /** - * - * @returns - */ - clone():any; - /** - * Create a copy of the background style when this style instance is cloned - * @param style The original background node style - * @returns This implementation always returns the original style instance. - * @protected - */ - copyBackgroundStyle(style:yfiles.styles.INodeStyle):yfiles.styles.INodeStyle; - /** - * Create a copy of the table when this style instance is cloned - * @param table The original table instance - * @returns This implementation always tries to {@link #clone} clone the original table instance, if possible, - * otherwise it returns table unchanged. - * @protected - */ - copyTable(table:yfiles.graph.ITable):yfiles.graph.ITable; - /** - * Raises the {@link yfiles.styles.TableNodeStyle#addPropertyChangedListener PropertyChanged} event. - *

- * Called when the value of the {@link yfiles.styles.TableNodeStyle#table} property changes. - *

- * @param evt The {@link } instance containing the event data. - * @protected - */ - onPropertyChanged(evt:yfiles.lang.PropertyChangedEventArgs):void; - /** - * Gets or sets the order in which rows and columns are rendered. - * @default yfiles.styles.TableRenderingOrder.COLUMNS_FIRST - * @type {yfiles.styles.TableRenderingOrder} - */ - tableRenderingOrder:yfiles.styles.TableRenderingOrder; - /** - * Gets or sets the style that is used to draw the background of the table - * @default 'TableNodeStyle.defaultBackgroundStyle' - * @type {yfiles.styles.INodeStyle} - */ - backgroundStyle:yfiles.styles.INodeStyle; - /** - * Adds the given listener for the PropertyChanged event that occurs when the value of the {@link yfiles.styles.TableNodeStyle#table} property changes. - * @param listener The listener to add. - * @see yfiles.styles.TableNodeStyle#removePropertyChangedListener - */ - addPropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the PropertyChanged event that occurs when the value of the {@link yfiles.styles.TableNodeStyle#table} property changes. - * @param listener The listener to remove. - * @see yfiles.styles.TableNodeStyle#addPropertyChangedListener - */ - removePropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Gets or sets the {@link yfiles.graph.ITable} instance that defines the tabular structure. - * @type {yfiles.graph.ITable} - */ - table:yfiles.graph.ITable; - /** - * - * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TableNodeStyle; - } - /** - * Default renderer implementation that can be used for {@link yfiles.styles.TableNodeStyle} instances. - * @class - * @implements {yfiles.styles.INodeStyleRenderer} - * @implements {yfiles.styles.IShapeGeometry} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface TableNodeStyleRenderer extends yfiles.lang.Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class TableNodeStyleRenderer { - /** - * Prepares this instance for subsequent calls after the style and node have been initialized. - *

- * Upon invocation the {@link yfiles.styles.TableNodeStyleRenderer#style} and {@link yfiles.styles.TableNodeStyleRenderer#node} properties have been populated by the {@link yfiles.styles.TableNodeStyleRenderer#getVisualCreator}, - * {@link yfiles.styles.TableNodeStyleRenderer#getBoundsProvider}, {@link yfiles.styles.TableNodeStyleRenderer#getHitTestable}, or {@link yfiles.styles.TableNodeStyleRenderer#getMarqueeTestable} - * methods. - *

- *

- * This is an empty implementation. Subclasses might have to override this method. - *

- * @protected - */ - configure():void; - /** - * - * @param context - * @returns - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * Get the {@link yfiles.styles.INodeStyle background style} that is currently used by this renderer. - *

- * This implementation retrieves the {@link yfiles.styles.TableNodeStyle#backgroundStyle} from the owning style - *

- * @returns The {@link background style} that is currently used by this renderer. - * @protected - */ - getBackgroundStyle():yfiles.styles.INodeStyle; - /** - * - * @param context - * @returns - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * - * @param node - * @param style - * @returns - */ - getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; - /** - * - * @param node - * @param style - * @returns - */ - getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; - /** - * - * @param node - * @param style - * @returns - */ - getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; - /** - * - * @param inner - * @param outer - * @returns - */ - getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * - * @param node - * @param style - * @returns - */ - getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; - /** - * - * @returns - */ - getOutline():yfiles.geometry.GeneralPath; - /** - * - * @param node - * @param style - * @returns - */ - getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; - /** - * Gets the table object that should be used for rendering. - *

- * This implementation delegates to the Table provided by the {@link yfiles.styles.TableNodeStyle#table} property. - *

- * @returns The table that should be used for the rendering process. - * @protected - */ - getTable():yfiles.graph.ITable; - /** - * Get the {@link yfiles.styles.TableRenderingOrder} that is currently used by this renderer. - *

- * This implementation retrieves the {@link yfiles.styles.TableRenderingOrder} from the owning style - *

- * @returns The {@link } that is currently used by this renderer. - * @protected - */ - getTableRenderingOrder():yfiles.styles.TableRenderingOrder; - /** - * - * @param node - * @param style - * @returns - */ - getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; - /** - * - * @param node - * @param style - * @returns - */ - getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; - /** - * - * @param context - * @param location - * @returns - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param location - * @returns - */ - isInside(location:yfiles.geometry.Point):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * - * @param type - * @returns - */ - lookup(type:yfiles.lang.Class):any; - /** - * - * @param context - * @param oldVisual - * @returns - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.TableNodeStyle} - */ - style:yfiles.styles.TableNodeStyle; - /** - * Gets or sets the currently configured node. - * @protected - * @type {yfiles.graph.INode} - */ - node:yfiles.graph.INode; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TableNodeStyleRenderer; - } - /** - * The context of a TemplateBinding. This interface exposes properties of a graph element onto which a TemplateBinding can - * be bound. - * @interface - * @implements {yfiles.lang.IPropertyObservable} - */ - export interface ITemplateStyleBindingContext extends yfiles.lang.Object,yfiles.lang.IPropertyObservable{ - /** - * Gets the width of the visual. - * @abstract - * @type {number} - */ - width:number; - /** - * Gets the height of the visual. - * @abstract - * @type {number} - */ - height:number; - /** - * Gets or sets the {@link yfiles.view.CanvasComponent} instance this instance is used in. - * @abstract - * @type {yfiles.view.CanvasComponent} - */ - canvasComponent:yfiles.view.CanvasComponent; - /** - * Gets or sets a value indicating whether the item is currently selected. - *

- * This state is bound to the {@link yfiles.view.IGraphSelection} which is used in the {@link yfiles.styles.ITemplateStyleBindingContext#canvasComponent} this visual is being used in. Setting this - * value will write through to the {@link yfiles.view.IGraphSelection}. - *

- * @abstract - * @type {boolean} - */ - itemSelected:boolean; - /** - * Gets or sets a value indicating whether the item is the currently focused item in the {@link yfiles.view.GraphComponent}. - *

- * This state is bound to the {@link yfiles.view.GraphComponent#currentItem} which is used in the {@link yfiles.styles.ITemplateStyleBindingContext#canvasComponent} this visual is being used in. Setting this value will write through to - * the {@link yfiles.view.GraphComponent#currentItem}. - *

- * @abstract - * @type {boolean} - */ - itemFocused:boolean; - /** - * Gets or sets a value indicating whether the item is currently highlighted. - *

- * This state is bound to the {@link yfiles.view.HighlightIndicatorManager.} which is used in the {@link yfiles.styles.ITemplateStyleBindingContext#canvasComponent} this visual is being used in. Setting this value will write through to - * the {@link yfiles.view.HighlightIndicatorManager.}'s {@link yfiles.view.HighlightIndicatorManager.#selectionModel} - *

- * @abstract - * @type {boolean} - */ - itemHighlighted:boolean; - /** - * Gets or sets the item that is rendered by this instance. - * @abstract - * @type {yfiles.graph.IModelItem} - */ - item:yfiles.graph.IModelItem; - /** - * Gets or sets the style tag that is associated with the style that created this visual. - *

- * This property can be used by implementers as a convenient property to pass data to the visual. - *

- * @abstract - * @type {any} - */ - styleTag:any; - } - var ITemplateStyleBindingContext:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.styles.ITemplateStyleBindingContext; - }; - /** - * Enhances the context of a TemplateBinding ({@link yfiles.styles.ITemplateStyleBindingContext}) for labels. This interface - * exposes additional properties of a label onto which a TemplateBinding can be bound. - * @interface - * @implements {yfiles.lang.IPropertyObservable} - */ - export interface ILabelTemplateStyleBindingContext extends yfiles.lang.Object,yfiles.lang.IPropertyObservable{ - /** - * Gets or sets the label text property that is populated using the {@link yfiles.graph.ILabel}'s {@link yfiles.graph.ILabel#text} property. - * @abstract - * @type {string} - */ - labelText:string; - /** - * Gets a value indicating whether this instance has been flipped so that it points upwards. - * @abstract - * @type {boolean} - */ - isFlipped:boolean; - /** - * Gets a value indicating whether this instance is currently rendered upside down. - * @abstract - * @type {boolean} - */ - isUpsideDown:boolean; - } - var ILabelTemplateStyleBindingContext:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.styles.ILabelTemplateStyleBindingContext; - }; - /** - * Base class for label styles that use a SVG snippet as template for the visualization of {@link yfiles.graph.ILabel}s. - * @see yfiles.styles.TemplateLabelStyle - * @see yfiles.styles.StringTemplateLabelStyle - * @class - * @implements {yfiles.styles.ILabelStyle} - * @implements {yfiles.lang.IPropertyObservable} - * @implements {yfiles.lang.ICloneable} - */ - export interface TemplateLabelStyleBase extends yfiles.lang.Object,yfiles.styles.ILabelStyle,yfiles.lang.IPropertyObservable,yfiles.lang.ICloneable{} - export class TemplateLabelStyleBase { - /** - * Constructs a new instance using the provided renderer. - * @param renderer - */ - constructor(renderer:yfiles.styles.TemplateLabelStyleRenderer); - /** - * Constructs a new instance of this style with default values. - * @protected - */ - constructor(); - /** - * Performs a shallow clone of this instance, except for the value of {@link yfiles.styles.TemplateLabelStyleBase#styleTag} which is cloned, too, if it can be cloned. - * @returns A clone of this instance. - */ - clone():any; - /** - * Factory method that is called by the {@link yfiles.styles.TemplateLabelStyleRenderer} to create the visual that will be used for - * the display of the label. - * @param context The context for which the visual should be created. - * @param label The label that will be rendered. - * @returns The readily styled visual. - */ - createTemplate(context:yfiles.view.IRenderContext,label:yfiles.graph.ILabel):yfiles.view.SvgVisual; - /** - * Convenience method that determines the preferred size of the label if this style was applied. - * @param context The context for which the size should be calculated. - * @param label The label to determine the preferred size of. - * @returns The preferred size. - */ - getPreferredSize(context:yfiles.view.IRenderContext,label:yfiles.graph.ILabel):yfiles.geometry.Size; - /** - * Loads all template script elements that have not been parsed, yet, and creates the respective template cache objects. - *

- * This method can be called to perform the template loading at a certain point in time, for example during application - * startup. By default, a template is loaded lazily when the first visual using this template is built. - *

- * @static - */ - static loadAllTemplates():void; - /** - * Raises the {@link yfiles.styles.TemplateLabelStyleBase#addPropertyChangedListener PropertyChanged} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onPropertyChanged(evt:yfiles.lang.PropertyChangedEventArgs):void; - /** - * Adds the given listener for the PropertyChanged event that occurs when a property value changes. - * @param listener The listener to add. - * @see yfiles.styles.TemplateLabelStyleBase#removePropertyChangedListener - */ - addPropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the PropertyChanged event that occurs when a property value changes. - * @param listener The listener to remove. - * @see yfiles.styles.TemplateLabelStyleBase#addPropertyChangedListener - */ - removePropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Gets or sets the tag that is associated with this style instance. - *

- * The various style renderer implementations can use this tag to make it accessible in the context of the instantiated - * templates and controls. The framework does not make any assumptions about the value of this property. It is there for - * convenient use in the process of data binding the templates. This property supports {@link yfiles.lang.IPropertyObservable property change notification} and can - * thus be data bound easily. - *

- * @default null - * @type {any} - */ - styleTag:any; - /** - * Gets or sets an implementation of {@link yfiles.graph.IContextLookup} that can be used to satisfy queries that are made to the - * implementation which is returned by calls to {@link yfiles.styles.ILabelStyleRenderer#getContext} that are made on the style - * renderer that is associated with this style instance. - *

- * This can be used to conveniently customize the lookup behavior of the style renderers that are associated with this - * instance. The default value is {@link yfiles.graph.IContextLookup#EMPTY_CONTEXT_LOOKUP} - *

- * @default 'Lookups.EmptyContextLookup' - * @type {yfiles.graph.IContextLookup} - */ - contextLookup:yfiles.graph.IContextLookup; - /** - * Gets or sets the normalized outline of a label that will be displayed using the created visual. - *

- * The shape will automatically arranged and transformed to have the bounds of the label. This shape will be used to - * satisfy requests to {@link yfiles.input.IMarqueeTestable#isInBox} and {@link yfiles.input.IHitTestable#isHit} and may be left null to - * indicate default (rectangular) behavior. - *

- *

- * The default value is null. - *

- * @default null - * @type {yfiles.geometry.GeneralPath} - */ - normalizedOutline:yfiles.geometry.GeneralPath; - /** - * Gets or sets a value indicating whether the rendering should automatically be flipped (rotated by 180 degrees) if - * otherwise it would be rendered upside-down. - *

- * The default value is true. - *

- * @default true - * @type {boolean} - */ - autoFlip:boolean; - /** - * Gets or sets the preferred size of the labels that use this style. - * @type {yfiles.geometry.Size} - */ - preferredSize:yfiles.geometry.Size; - /** - * - * @type {yfiles.styles.ILabelStyleRenderer} - */ - renderer:yfiles.styles.ILabelStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplateLabelStyleBase; - } - /** - * An {@link yfiles.styles.ILabelStyle} implementation that uses an SVG snippet as template for the visualization of - * {@link yfiles.graph.ILabel}s. - *

- * The {@link yfiles.styles.TemplateLabelStyle#styleResourceKey} is used to determine the template that will be applied to the component. The template must be specified in the DOM - * in a script tag with type='text/yfiles-template'. - *

- *

- * The SVG template snippet can contain bindings in the form attribute="{Binding propertyName}" that bind the attribute - * value to the value of the property with the given name in the node's tag. - *

- *

- * TemplateBindings in the form attribute="{TemplateBinding propertyName}" bind the attribute value to a set of - * well-defined properties of the label that are provided by the style. The available template binding properties are: - *

- *
    - *
  • width: The width of the graph element
  • - *
  • height: The height of the graph element
  • - *
  • bounds: The bounding rectangle of the graph element
  • - *
  • canvas: The {@link yfiles.view.GraphComponent} the element is rendered in
  • - *
  • itemSelected: Whether the element is selected
  • - *
  • itemFocused: Whether the element has the focus
  • - *
  • itemHighlighted: Whether the element is highlighted
  • - *
  • styleTag: The tag associated with the element's style instance
  • - *
  • labelText: The label text property that is populated using the {@link yfiles.graph.ILabel}'s {@link yfiles.graph.ILabel#text} property
  • - *
  • isFlipped: Whether the element has been flipped
  • - *
  • isUpsideDown: Whether the element is currently rendered upside down
  • - *
- * @class - * @extends {yfiles.styles.TemplateLabelStyleBase} - */ - export interface TemplateLabelStyle extends yfiles.styles.TemplateLabelStyleBase{} - export class TemplateLabelStyle { - /** - * Creates a new instance using the given render template id and a custom renderer instance. - * @param renderTemplateId The id of the SVG snippet that will be used for the component. - * @param renderer The custom renderer for this style instance. - */ - constructor(renderTemplateId:string,renderer:yfiles.styles.TemplateLabelStyleRenderer); - /** - * Creates a new instance using the given render template id and a custom renderer instance. - * @param {Object} options The parameters to pass. - * @param options.renderTemplateId The id of the SVG snippet that will be used for the component. - * @param options.renderer The custom renderer for this style instance. - * @param {boolean} options.autoFlip A value indicating whether the rendering should automatically be flipped (rotated by 180 degrees) if otherwise it would be rendered upside-down. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#autoFlip} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a label that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.preferredSize The preferred size of the labels that use this style. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#preferredSize} property on the created object. - *

- */ - constructor(options:{renderTemplateId:string,renderer:yfiles.styles.TemplateLabelStyleRenderer,autoFlip?:boolean,normalizedOutline?:yfiles.geometry.GeneralPath,preferredSize?:yfiles.geometry.Size}); - /** - * Creates a new instance using the given render template id. - * @param renderTemplateId The id of the render template that will be used for the component. - */ - constructor(renderTemplateId:string); - /** - * Creates a new instance using the given render template id. - * @param {Object} options The parameters to pass. - * @param options.renderTemplateId The id of the render template that will be used for the component. - * @param {boolean} options.autoFlip A value indicating whether the rendering should automatically be flipped (rotated by 180 degrees) if otherwise it would be rendered upside-down. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#autoFlip} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a label that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.preferredSize The preferred size of the labels that use this style. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#preferredSize} property on the created object. - *

- */ - constructor(options:{renderTemplateId:string,autoFlip?:boolean,normalizedOutline?:yfiles.geometry.GeneralPath,preferredSize?:yfiles.geometry.Size}); - /** - * Creates a new instance with no render template id and {@link yfiles.styles.TemplateLabelStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {boolean} options.autoFlip A value indicating whether the rendering should automatically be flipped (rotated by 180 degrees) if otherwise it would be rendered upside-down. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#autoFlip} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a label that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.preferredSize The preferred size of the labels that use this style. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#preferredSize} property on the created object. - *

- * @param {string} options.styleResourceKey The {@link string} that will be used to look up the template that is applied to the component. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyle#styleResourceKey} property on the created object. - *

- */ - constructor(options?:{autoFlip?:boolean,normalizedOutline?:yfiles.geometry.GeneralPath,preferredSize?:yfiles.geometry.Size,styleResourceKey?:string}); - /** - * Gets or sets the {@link string} that will be used to look up the template that is applied to the component. - *

- * The default value is null. - *

- * @default null - * @type {string} - */ - styleResourceKey:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplateLabelStyle; - } - /** - * An {@link yfiles.styles.ILabelStyle} that uses an SVG snippet as template for the visualization of {@link yfiles.graph.ILabel}s. - *

- * In contrast to {@link yfiles.styles.TemplateLabelStyle}, the SVG template used by this style must be encoded as string and set - * to the {@link yfiles.styles.StringTemplateLabelStyle#svgContent} property. - *

- *

- * It is vital that the {@link yfiles.styles.StringTemplateLabelStyle#svgContent SVG snippet} does not declare the SVG namespace itself. Its content is parsed in a dummy namespace - * in order to avoid immediate validation of the result. The resulting SVG elements are automatically created in the SVG - * namespace before they are added to the DOM. - *

- *

- * The SVG template snippet can contain bindings in the form attribute="{Binding propertyName}" that bind the attribute - * value to the value of the property with the given name in the node's tag. - *

- *

- * TemplateBindings in the form attribute="{TemplateBinding propertyName}" bind the attribute value to a set of - * well-defined properties of the label that are provided by the style. The available template binding properties are: - *

- *
    - *
  • width: The width of the graph element
  • - *
  • height: The height of the graph element
  • - *
  • bounds: The bounding rectangle of the graph element
  • - *
  • canvas: The {@link yfiles.view.GraphComponent} the element is rendered in
  • - *
  • itemSelected: Whether the element is selected
  • - *
  • itemFocused: Whether the element has the focus
  • - *
  • itemHighlighted: Whether the element is highlighted
  • - *
  • styleTag: The tag associated with the element's style instance
  • - *
  • labelText: The label text property that is populated using the {@link yfiles.graph.ILabel}'s {@link yfiles.graph.ILabel#text} property
  • - *
  • isFlipped: Whether this instance has been flipped so that it points upwards
  • - *
  • isUpsideDown: Whether this instance is currently rendered upside down
  • - *
- * @class - * @extends {yfiles.styles.TemplateLabelStyleBase} - */ - export interface StringTemplateLabelStyle extends yfiles.styles.TemplateLabelStyleBase{} - export class StringTemplateLabelStyle { - /** - * Creates a new instance using the provided renderer. - * @param renderer The custom renderer for this style instance. - */ - constructor(renderer:yfiles.styles.TemplateLabelStyleRenderer); - /** - * Creates a new instance using the provided renderer. - * @param {Object} options The parameters to pass. - * @param options.renderer The custom renderer for this style instance. - * @param {boolean} options.autoFlip A value indicating whether the rendering should automatically be flipped (rotated by 180 degrees) if otherwise it would be rendered upside-down. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#autoFlip} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a label that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.preferredSize The preferred size of the labels that use this style. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#preferredSize} property on the created object. - *

- * @param {string} options.svgContent The SVG content that is the template for the label visualization. - *

- * This option sets the {@link yfiles.styles.StringTemplateLabelStyle#svgContent} property on the created object. - *

- */ - constructor(options:{renderer:yfiles.styles.TemplateLabelStyleRenderer,autoFlip?:boolean,normalizedOutline?:yfiles.geometry.GeneralPath,preferredSize?:yfiles.geometry.Size,svgContent?:string}); - /** - * Initializes a new instance of this class and sets the given string as its {@link yfiles.styles.StringTemplateLabelStyle#svgContent}. - * @param svgContent The SVG snippet to use as template. - */ - constructor(svgContent:string); - /** - * Initializes a new instance of this class and sets the given string as its {@link yfiles.styles.StringTemplateLabelStyle#svgContent}. - * @param {Object} options The parameters to pass. - * @param options.svgContent The SVG snippet to use as template. - * @param {boolean} options.autoFlip A value indicating whether the rendering should automatically be flipped (rotated by 180 degrees) if otherwise it would be rendered upside-down. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#autoFlip} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a label that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.preferredSize The preferred size of the labels that use this style. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#preferredSize} property on the created object. - *

- */ - constructor(options:{svgContent:string,autoFlip?:boolean,normalizedOutline?:yfiles.geometry.GeneralPath,preferredSize?:yfiles.geometry.Size}); - /** - * Initializes a new instance of this class. - * @param {Object} [options=null] The parameters to pass. - * @param {boolean} options.autoFlip A value indicating whether the rendering should automatically be flipped (rotated by 180 degrees) if otherwise it would be rendered upside-down. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#autoFlip} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a label that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.preferredSize The preferred size of the labels that use this style. - *

- * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#preferredSize} property on the created object. - *

- * @param {string} options.svgContent The SVG content that is the template for the label visualization. - *

- * This option sets the {@link yfiles.styles.StringTemplateLabelStyle#svgContent} property on the created object. - *

- */ - constructor(options?:{autoFlip?:boolean,normalizedOutline?:yfiles.geometry.GeneralPath,preferredSize?:yfiles.geometry.Size,svgContent?:string}); - /** - * Gets or sets the SVG content that is the template for the label visualization. - * @default null - * @type {string} - */ - svgContent:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.StringTemplateLabelStyle; - } - /** - * An implementation of the {@link yfiles.styles.ILabelStyleRenderer} interface that can render {@link yfiles.styles.TemplateLabelStyleBase} - * instances. - * @see yfiles.styles.TemplateLabelStyle - * @see yfiles.styles.StringTemplateLabelStyle - * @class - * @implements {yfiles.styles.ILabelStyleRenderer} - * @implements {yfiles.view.IVisualCreator} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.graph.ILookup} - */ - export interface TemplateLabelStyleRenderer extends yfiles.lang.Object,yfiles.styles.ILabelStyleRenderer,yfiles.view.IVisualCreator,yfiles.view.IBoundsProvider,yfiles.input.IHitTestable,yfiles.input.IMarqueeTestable,yfiles.view.IVisibilityTestable,yfiles.graph.ILookup{} - export class TemplateLabelStyleRenderer { - /** - * Stores the {@link yfiles.graph.ILabel#layout layout}. - *

- * Subclasses should override this method, call the super implementation and configure their painting entities. - *

- * @protected - */ - configure():void; - /** - * Creates the visual by delegating to {@link yfiles.styles.TemplateLabelStyleBase#createTemplate} and then initializing the - * control with the context. - * @param context The context for the creation. - * @returns The visual that is used for rendering the label. - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * - * @param context - * @returns - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the {@link yfiles.styles.TemplateLabelStyleRenderer#style} and {@link yfiles.styles.TemplateLabelStyleRenderer#label} properties, calls {@link yfiles.styles.TemplateLabelStyleRenderer#configure} and returns this. - * @param label The label to retrieve the bounds provider for. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateLabelStyleRenderer#getBounds - */ - getBoundsProvider(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IBoundsProvider; - /** - * Configures the {@link yfiles.styles.TemplateLabelStyleRenderer#style} and {@link yfiles.styles.TemplateLabelStyleRenderer#label} properties, does not call {@link yfiles.styles.TemplateLabelStyleRenderer#configure} and returns this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.TemplateLabelStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.TemplateLabelStyleRenderer#lookup} method call they should - * call {@link yfiles.styles.TemplateLabelStyleRenderer#configure} only if needed, i.e. if they decide to return this or an - * instance that depends on a correctly configured this. - *

- * @param label The label to query the context for. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateLabelStyleRenderer#lookup - */ - getContext(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.graph.ILookup; - /** - * Configures the {@link yfiles.styles.TemplateLabelStyleRenderer#style} and {@link yfiles.styles.TemplateLabelStyleRenderer#label} properties, calls {@link yfiles.styles.TemplateLabelStyleRenderer#configure} and returns this. - * @param label The label to query hit test with. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateLabelStyleRenderer#isHit - */ - getHitTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IHitTestable; - /** - * Configures the {@link yfiles.styles.TemplateLabelStyleRenderer#style} and {@link yfiles.styles.TemplateLabelStyleRenderer#label} properties, calls {@link yfiles.styles.TemplateLabelStyleRenderer#configure} and returns this. - * @param label The label to query marquee intersection tests. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateLabelStyleRenderer#isInBox - */ - getMarqueeTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IMarqueeTestable; - /** - * Gets the normalized outline by delegating to {@link yfiles.styles.TemplateLabelStyleBase#normalizedOutline}. - * @param style - * @returns - * @protected - */ - getNormalizedOutline(style:yfiles.styles.TemplateLabelStyleBase):yfiles.geometry.GeneralPath; - /** - * Calculates the preferred size for the given label and style. - * @param label The label instance. - * @param style The style instance to apply. - * @returns The preferred size for the given label and style. - * @see yfiles.styles.TemplateLabelStyleRenderer#getPreferredSizeCore - */ - getPreferredSize(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.geometry.Size; - /** - * Gets the size of the preferred for the current configuration using the provided context. - * @param context The context. - * @returns - * @protected - */ - getPreferredSizeCore(context:yfiles.view.IRenderContext):yfiles.geometry.Size; - /** - * Calculates the preferred size for the given label and style. - * @param context - * @param label The label instance. - * @param style The style instance to apply. - * @returns The preferred size for the given label and style. - * @see yfiles.styles.TemplateLabelStyleRenderer#getPreferredSizeCore - */ - getPreferredSizeWithContext(context:yfiles.view.IRenderContext,label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.geometry.Size; - /** - * Configures the {@link yfiles.styles.TemplateLabelStyleRenderer#style} and {@link yfiles.styles.TemplateLabelStyleRenderer#label} properties, does not call {@link yfiles.styles.TemplateLabelStyleRenderer#configure} and returns this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.TemplateLabelStyleRenderer#configure}. If - * the subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.TemplateLabelStyleRenderer#isVisible}. - *

- * @param label The label to query visibility tests. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateLabelStyleRenderer#isVisible - */ - getVisibilityTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the {@link yfiles.styles.TemplateLabelStyleRenderer#style} and {@link yfiles.styles.TemplateLabelStyleRenderer#label} properties, calls {@link yfiles.styles.TemplateLabelStyleRenderer#configure} and returns this. - * @param label The label to retrieve the {@link } for. The value will be stored in the {@link #label} property. - * @param style The style to associate with the label. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateLabelStyleRenderer#createVisual - * @see yfiles.styles.TemplateLabelStyleRenderer#updateVisual - */ - getVisualCreator(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisualCreator; - /** - * Delegates to the {@link yfiles.styles.TemplateLabelStyleBase}'s {@link yfiles.styles.TemplateLabelStyleBase#autoFlip} property. - * @param style - * @returns - * @protected - */ - isAutoFlip(style:yfiles.styles.TemplateLabelStyleBase):boolean; - /** - * - * @param context - * @param location - * @returns - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Uses the {@link yfiles.graph.ILabel#layout layout} to determine whether the clip intersects. - * @param context - * @param rectangle - * @returns - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Delegates to the {@link yfiles.styles.TemplateLabelStyleBase#contextLookup} of the {@link yfiles.styles.ILabelStyle}. - * @param type The type to query an instance for. - * @returns The implementation or null. - */ - lookup(type:yfiles.lang.Class):any; - /** - * Delegates to the {@link yfiles.styles.TemplateLabelStyleBase}'s {@link yfiles.styles.TemplateLabelStyleBase#contextLookup}. - * @param style The style to look up the context for. - * @param label The current label. - * @param type The type to look up. - * @returns The result from the context or null. - * @protected - */ - lookupContext(style:yfiles.styles.TemplateLabelStyleBase,label:yfiles.graph.ILabel,type:yfiles.lang.Class):any; - /** - * Updates the visual correspondingly. - * @param context The context for the creation. - * @param oldVisual The currently rendered visual. - * @returns The visual that is used for rendering the label. - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets the layout of the current label. - *

- * This value is set during {@link yfiles.styles.TemplateLabelStyleRenderer#configure} to the label's {@link yfiles.graph.ILabel#layout layout} - *

- * @protected - * @type {yfiles.geometry.IOrientedRectangle} - */ - layout:yfiles.geometry.IOrientedRectangle; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.TemplateLabelStyleBase} - */ - style:yfiles.styles.TemplateLabelStyleBase; - /** - * Gets or sets the currently configured label. - * @protected - * @type {yfiles.graph.ILabel} - */ - label:yfiles.graph.ILabel; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplateLabelStyleRenderer; - } - /** - * Base class for node styles that use a SVG snippet as template for the visualization of {@link yfiles.graph.INode}s. - * @see yfiles.styles.TemplateNodeStyle - * @see yfiles.styles.StringTemplateNodeStyle - * @class - * @implements {yfiles.styles.INodeStyle} - * @implements {yfiles.lang.IPropertyObservable} - * @implements {yfiles.lang.ICloneable} - */ - export interface TemplateNodeStyleBase extends yfiles.lang.Object,yfiles.styles.INodeStyle,yfiles.lang.IPropertyObservable,yfiles.lang.ICloneable{} - export class TemplateNodeStyleBase { - /** - * Constructs a new instance using the provided renderer. - * @param renderer - * @protected - */ - constructor(renderer:yfiles.styles.TemplateNodeStyleRenderer); - /** - * Constructs a new instance of this style with default values. - * @protected - */ - constructor(); - /** - * Performs a shallow clone of this instance, except for the value of {@link yfiles.styles.TemplateNodeStyleBase#styleTag} which is cloned, too, if it can be cloned. - * @returns A clone of this instance. - */ - clone():any; - /** - * Factory method that is called by the {@link yfiles.styles.TemplateNodeStyleRenderer} to create the visual that will be used for - * the display of the node. - * @param context The context for which the visual should be created. - * @param node The node that will be rendered. - * @returns The readily styled visual. - */ - createTemplate(context:yfiles.view.IRenderContext,node:yfiles.graph.INode):yfiles.view.SvgVisual; - /** - * Convenience method that determines the preferred size of the node if this style was applied. - * @param context The context for which the size should be calculated. Can be obtained through - * {@link #createRenderContext}. - * @param node The node to determine the preferred size of. Can be a live node or an {@link }. - * @returns The preferred size. - * @see yfiles.view.CanvasComponent#createRenderContext - */ - getPreferredSize(context:yfiles.view.IRenderContext,node:yfiles.graph.INode):yfiles.geometry.Size; - /** - * Loads all template script elements that have not been parsed, yet, and creates the respective template cache objects. - *

- * This method can be called to perform the template loading at a certain point in time, for example during application - * startup. By default, a template is loaded lazily when the first visual using this template is built. - *

- * @static - */ - static loadAllTemplates():void; - /** - * Raises the {@link yfiles.styles.TemplateNodeStyleBase#addPropertyChangedListener PropertyChanged} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onPropertyChanged(evt:yfiles.lang.PropertyChangedEventArgs):void; - /** - * Adds the given listener for the PropertyChanged event that occurs when a property value changes. - * @param listener The listener to add. - * @see yfiles.styles.TemplateNodeStyleBase#removePropertyChangedListener - */ - addPropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the PropertyChanged event that occurs when a property value changes. - * @param listener The listener to remove. - * @see yfiles.styles.TemplateNodeStyleBase#addPropertyChangedListener - */ - removePropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Gets or sets the tag that is associated with this style instance. - *

- * The various style renderer implementations can use this tag to make it accessible in the context of the instantiated - * templates and controls. The framework does not make any assumptions about the value of this property. It is there for - * convenient use in the process of data binding the templates. This property supports {@link yfiles.lang.IPropertyObservable property change notification} and can - * thus be data bound easily. - *

- * @default null - * @type {any} - */ - styleTag:any; - /** - * Gets or sets an implementation of {@link yfiles.graph.IContextLookup} that can be used to satisfy queries that are made to the - * implementation which is returned by calls to {@link yfiles.styles.INodeStyleRenderer#getContext} that are made on the style - * renderer that is associated with this style instance. - *

- * This can be used to conveniently customize the lookup behavior of the style renderers that are associated with this - * instance. E.g. it is possible to provide customized implementations of {@link yfiles.view.ISelectionIndicatorInstaller}, - * {@link yfiles.view.IHighlightIndicatorInstaller}, {@link yfiles.input.IHandleProvider}, {@link yfiles.input.INodeSizeConstraintProvider}, and - * {@link yfiles.input.INodeInsetsProvider}. Simple style implementations can use {@link yfiles.graph.IContextLookup#EMPTY_CONTEXT_LOOKUP} - * but may not use null for this property. The default value is {@link yfiles.graph.IContextLookup#EMPTY_CONTEXT_LOOKUP} - *

- * @default 'Lookups.EmptyContextLookup' - * @type {yfiles.graph.IContextLookup} - */ - contextLookup:yfiles.graph.IContextLookup; - /** - * Gets or sets the insets the {@link yfiles.input.INodeInsetsProvider} implementation for {@link yfiles.graph.INode} should yield for this - * instance. - *

- * This is especially useful if this style is used for {@link yfiles.graph.IGraph#createGroupNode group nodes}, as they require insets for the calculation of the - * bounds. The insets can be used to make sure that child nodes do not cover visual elements of the style inside the - * insets. The default value is an {@link yfiles.geometry.Insets} insets with 5 for all insets. - *

- * @see yfiles.input.INodeInsetsProvider - * @see yfiles.styles.INodeStyleRenderer#getContext - * @default '5' - * @type {yfiles.geometry.Insets} - */ - insets:yfiles.geometry.Insets; - /** - * Gets or sets the minimum size an {@link yfiles.input.INodeSizeConstraintProvider} implementation for {@link yfiles.graph.INode} should - * yield. - *

- * The default value is {@link yfiles.geometry.Size#EMPTY}. - *

- * @see yfiles.input.INodeSizeConstraintProvider - * @default 'Empty' - * @type {yfiles.geometry.Size} - */ - minimumSize:yfiles.geometry.Size; - /** - * Gets or sets the normalized outline of a node that will be displayed using the created visual. - *

- * This shape will be used to satisfy requests to {@link yfiles.input.IMarqueeTestable#isInBox}, {@link yfiles.input.IHitTestable#isHit}, - * as well as for {@link yfiles.styles.IShapeGeometry} methods (which affect edge cropping at the node outline). - *

- *

- * This property may be left at or set to null to indicate default (rectangular) behavior. - *

- *

- * The default value is null. - *

- * @default null - * @type {yfiles.geometry.GeneralPath} - */ - normalizedOutline:yfiles.geometry.GeneralPath; - /** - * - * @type {yfiles.styles.INodeStyleRenderer} - */ - renderer:yfiles.styles.INodeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplateNodeStyleBase; - } - /** - * A {@link yfiles.styles.INodeStyle} implementation that uses an SVG snippet as template for the visualization of - * {@link yfiles.graph.INode}s. - *

- * The {@link yfiles.styles.TemplateNodeStyle#styleResourceKey} is used to determine the template that will be applied to the {@link yfiles.view.Visual}. The template must be specified in - * the DOM in a script tag with type='text/yfiles-template'. - *

- *

- * The SVG template snippet can contain bindings in the form attribute="{Binding propertyName}" that bind the attribute - * value to the value of the property with the given name in the node's tag. - *

- *

- * TemplateBindings in the form attribute="{TemplateBinding propertyName}" bind the attribute value to a set of - * well-defined properties of the node that are provided by the style. The available template binding properties are: - *

- *
    - *
  • width: The width of the graph element
  • - *
  • height: The height of the graph element
  • - *
  • bounds: The bounding rectangle of the graph element
  • - *
  • canvas: The {@link yfiles.view.GraphComponent} the element is rendered in
  • - *
  • itemSelected: Whether the element is selected
  • - *
  • itemFocused: Whether the element has the focus
  • - *
  • itemHighlighted: Whether the element is highlighted
  • - *
  • styleTag: The tag associated with the element's style instance
  • - *
- *

Related demos:

- *
    - *
  • Demo: OrgChart Demo, Demo.yFiles.Graph.OrgChart
  • - *
  • Demo: Collapse Demo, Demo.yFiles.Graph.Collapse
  • - *
- * @class - * @extends {yfiles.styles.TemplateNodeStyleBase} - */ - export interface TemplateNodeStyle extends yfiles.styles.TemplateNodeStyleBase{} - export class TemplateNodeStyle { - /** - * Creates a new instance using the given render template id and a custom renderer instance. - * @param renderTemplateId The id of the SVG snippet that will be used for the component. - * @param renderer The custom renderer for this instance. - */ - constructor(renderTemplateId:string,renderer:yfiles.styles.TemplateNodeStyleRenderer); - /** - * Creates a new instance using the given render template id and a custom renderer instance. - * @param {Object} options The parameters to pass. - * @param options.renderTemplateId The id of the SVG snippet that will be used for the component. - * @param options.renderer The custom renderer for this instance. - * @param {yfiles.geometry.Insets} options.insets The insets the {@link yfiles.input.INodeInsetsProvider} implementation for {@link yfiles.graph.INode} should yield for this instance. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#insets} property on the created object. - *

- * @param {yfiles.geometry.Size} options.minimumSize The minimum size an {@link yfiles.input.INodeSizeConstraintProvider} implementation for {@link yfiles.graph.INode} should yield. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#minimumSize} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a node that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#normalizedOutline} property on the created object. - *

- */ - constructor(options:{renderTemplateId:string,renderer:yfiles.styles.TemplateNodeStyleRenderer,insets?:yfiles.geometry.Insets,minimumSize?:yfiles.geometry.Size,normalizedOutline?:yfiles.geometry.GeneralPath}); - /** - * Creates a new instance using the given render template id and {@link yfiles.styles.TemplateNodeStyleRenderer} as renderer. - * @param renderTemplateId The id of the SVG snippet that will be used for the component. - */ - constructor(renderTemplateId:string); - /** - * Creates a new instance using the given render template id and {@link yfiles.styles.TemplateNodeStyleRenderer} as renderer. - * @param {Object} options The parameters to pass. - * @param options.renderTemplateId The id of the SVG snippet that will be used for the component. - * @param {yfiles.geometry.Insets} options.insets The insets the {@link yfiles.input.INodeInsetsProvider} implementation for {@link yfiles.graph.INode} should yield for this instance. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#insets} property on the created object. - *

- * @param {yfiles.geometry.Size} options.minimumSize The minimum size an {@link yfiles.input.INodeSizeConstraintProvider} implementation for {@link yfiles.graph.INode} should yield. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#minimumSize} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a node that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#normalizedOutline} property on the created object. - *

- */ - constructor(options:{renderTemplateId:string,insets?:yfiles.geometry.Insets,minimumSize?:yfiles.geometry.Size,normalizedOutline?:yfiles.geometry.GeneralPath}); - /** - * Creates a new instance with no render template id key and {@link yfiles.styles.TemplateNodeStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.geometry.Insets} options.insets The insets the {@link yfiles.input.INodeInsetsProvider} implementation for {@link yfiles.graph.INode} should yield for this instance. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#insets} property on the created object. - *

- * @param {yfiles.geometry.Size} options.minimumSize The minimum size an {@link yfiles.input.INodeSizeConstraintProvider} implementation for {@link yfiles.graph.INode} should yield. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#minimumSize} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a node that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#normalizedOutline} property on the created object. - *

- * @param {string} options.styleResourceKey The {@link string} that will be used to look up the template that is applied to the component. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyle#styleResourceKey} property on the created object. - *

- */ - constructor(options?:{insets?:yfiles.geometry.Insets,minimumSize?:yfiles.geometry.Size,normalizedOutline?:yfiles.geometry.GeneralPath,styleResourceKey?:string}); - /** - * Gets or sets the {@link string} that will be used to look up the template that is applied to the component. - *

- * The default value is null. - *

- * @default null - * @type {string} - */ - styleResourceKey:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplateNodeStyle; - } - /** - * A {@link yfiles.styles.INodeStyle} that uses an SVG snippet as template for the visualization of {@link yfiles.graph.INode}s. - *

- * In contrast to {@link yfiles.styles.TemplateNodeStyle}, the SVG template used by this style must be encoded as string and set to - * the {@link yfiles.styles.StringTemplateNodeStyle#svgContent} property. - *

- *

- * It is vital that the {@link yfiles.styles.StringTemplateNodeStyle#svgContent SVG snippet} does not declare the SVG namespace itself. Its content is parsed in a dummy namespace - * in order to avoid immediate validation of the result. The resulting SVG elements are automatically created in the SVG - * namespace before they are added to the DOM. - *

- *

- * The SVG template snippet can contain bindings in the form attribute="{Binding propertyName}" that bind the attribute - * value to the value of the property with the given name in the node's tag. - *

- *

- * TemplateBindings in the form attribute="{TemplateBinding propertyName}" bind the attribute value to a set of - * well-defined properties of the node that are provided by the style. The available template binding properties are: - *

- *
    - *
  • width: The width of the graph element
  • - *
  • height: The height of the graph element
  • - *
  • bounds: The bounding rectangle of the graph element
  • - *
  • canvas: The {@link yfiles.view.GraphComponent} the element is rendered in
  • - *
  • itemSelected: Whether the element is selected
  • - *
  • itemFocused: Whether the element has the focus
  • - *
  • itemHighlighted: Whether the element is highlighted
  • - *
  • styleTag: The tag associated with the element's style instance
  • - *
- * @class - * @extends {yfiles.styles.TemplateNodeStyleBase} - */ - export interface StringTemplateNodeStyle extends yfiles.styles.TemplateNodeStyleBase{} - export class StringTemplateNodeStyle { - /** - * Creates a new instance using the given SVG template and a custom renderer instance. - * @param svgContent The SVG snippet that will be used as a template for the component. - * @param renderer The custom renderer for this instance. - */ - constructor(svgContent:string,renderer:yfiles.styles.TemplateNodeStyleRenderer); - /** - * Creates a new instance using the given SVG template and a custom renderer instance. - * @param {Object} options The parameters to pass. - * @param options.svgContent The SVG snippet that will be used as a template for the component. - * @param options.renderer The custom renderer for this instance. - * @param {yfiles.geometry.Insets} options.insets The insets the {@link yfiles.input.INodeInsetsProvider} implementation for {@link yfiles.graph.INode} should yield for this instance. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#insets} property on the created object. - *

- * @param {yfiles.geometry.Size} options.minimumSize The minimum size an {@link yfiles.input.INodeSizeConstraintProvider} implementation for {@link yfiles.graph.INode} should yield. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#minimumSize} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a node that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#normalizedOutline} property on the created object. - *

- */ - constructor(options:{svgContent:string,renderer:yfiles.styles.TemplateNodeStyleRenderer,insets?:yfiles.geometry.Insets,minimumSize?:yfiles.geometry.Size,normalizedOutline?:yfiles.geometry.GeneralPath}); - /** - * Creates a new instance using the given SVG template and {@link yfiles.styles.TemplateNodeStyleRenderer} as renderer. - * @param svgContent The SVG snippet that will be used as a template for the component. - */ - constructor(svgContent:string); - /** - * Creates a new instance using the given SVG template and {@link yfiles.styles.TemplateNodeStyleRenderer} as renderer. - * @param {Object} options The parameters to pass. - * @param options.svgContent The SVG snippet that will be used as a template for the component. - * @param {yfiles.geometry.Insets} options.insets The insets the {@link yfiles.input.INodeInsetsProvider} implementation for {@link yfiles.graph.INode} should yield for this instance. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#insets} property on the created object. - *

- * @param {yfiles.geometry.Size} options.minimumSize The minimum size an {@link yfiles.input.INodeSizeConstraintProvider} implementation for {@link yfiles.graph.INode} should yield. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#minimumSize} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a node that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#normalizedOutline} property on the created object. - *

- */ - constructor(options:{svgContent:string,insets?:yfiles.geometry.Insets,minimumSize?:yfiles.geometry.Size,normalizedOutline?:yfiles.geometry.GeneralPath}); - /** - * Creates a new instance with no SVG template and {@link yfiles.styles.TemplateNodeStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.geometry.Insets} options.insets The insets the {@link yfiles.input.INodeInsetsProvider} implementation for {@link yfiles.graph.INode} should yield for this instance. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#insets} property on the created object. - *

- * @param {yfiles.geometry.Size} options.minimumSize The minimum size an {@link yfiles.input.INodeSizeConstraintProvider} implementation for {@link yfiles.graph.INode} should yield. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#minimumSize} property on the created object. - *

- * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a node that will be displayed using the created visual. - *

- * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#normalizedOutline} property on the created object. - *

- * @param {string} options.svgContent The SVG content that is the template for the node visualization. - *

- * This option sets the {@link yfiles.styles.StringTemplateNodeStyle#svgContent} property on the created object. - *

- */ - constructor(options?:{insets?:yfiles.geometry.Insets,minimumSize?:yfiles.geometry.Size,normalizedOutline?:yfiles.geometry.GeneralPath,svgContent?:string}); - /** - * Gets or sets the SVG content that is the template for the node visualization. - * @default null - * @type {string} - */ - svgContent:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.StringTemplateNodeStyle; - } - /** - * An implementation of the {@link yfiles.styles.INodeStyleRenderer} interface that can render {@link yfiles.styles.TemplateNodeStyleBase} - * instances. - * @see yfiles.styles.TemplateNodeStyle - * @see yfiles.styles.StringTemplateNodeStyle - * @class - * @implements {yfiles.styles.INodeStyleRenderer} - * @implements {yfiles.styles.IShapeGeometry} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface TemplateNodeStyleRenderer extends yfiles.lang.Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class TemplateNodeStyleRenderer { - /** - * Prepares this instance for subsequent calls after the style and node have been initialized. - *

- * Upon invocation the {@link yfiles.styles.TemplateNodeStyleRenderer#style} and {@link yfiles.styles.TemplateNodeStyleRenderer#node} properties have been populated by the - * {@link yfiles.styles.TemplateNodeStyleRenderer#getVisualCreator}, {@link yfiles.styles.TemplateNodeStyleRenderer#getBoundsProvider}, - * {@link yfiles.styles.TemplateNodeStyleRenderer#getHitTestable}, or {@link yfiles.styles.TemplateNodeStyleRenderer#getMarqueeTestable} - * methods. - *

- *

- * This is an empty implementation. Subclasses might have to override this method. - *

- * @protected - */ - configure():void; - /** - * Creates the visual by delegating to {@link yfiles.styles.TemplateNodeStyleBase#createTemplate} and then initializing the control - * with the context. - * @param context The context for the creation. - * @returns The visual that is used for rendering the node. - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * Returns the layout bounds as an upper bound for the painting bound. - *

- * This implementation simply sets the {@link yfiles.styles.TemplateNodeStyleRenderer#layout}'s bounds to the scratch variable and returns. - *

- * @param context the context to calculate the bounds for - * @returns the bounds or null to indicate an unbound area - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Provides a {@link yfiles.view.IBoundsProvider bounds calculation} implementation for the given style and node. - *

- * If {@link yfiles.styles.TemplateNodeStyleBase#contextLookup} provides an implementation of the {@link yfiles.view.IBoundsProvider} interface than this instance will be returned, - * otherwise the default (rectangular) behavior will be used. - *

- * @param node The node to query the provider for. - * @param style The style whose provider is queried. - * @returns An implementation that can calculate visual bounds. - */ - getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.TemplateNodeStyleRenderer#configure} and returns - * this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.TemplateNodeStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.TemplateNodeStyleRenderer#lookup} method call they should call - * {@link yfiles.styles.TemplateNodeStyleRenderer#configure} only if needed, i.e. if they decide to return this or an instance that - * depends on a correctly configured this. - *

- * @param node The node to query the context for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateNodeStyleRenderer#lookup - */ - getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; - /** - * Gets the context by delegating to {@link yfiles.styles.TemplateNodeStyleBase#contextLookup}. - * @param style - * @returns - * @protected - */ - getContextLookup(style:yfiles.styles.TemplateNodeStyleBase):yfiles.graph.IContextLookup; - /** - * Provides a {@link yfiles.input.IHitTestable hit testing} implementation for the given style and node. - *

- * If {@link yfiles.styles.TemplateNodeStyleBase#contextLookup} provides an implementation of the {@link yfiles.input.IHitTestable} interface than this instance will be returned, otherwise - * the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} will be used to perform the hit testing. - *

- * @param node The node to query the tester for. - * @param style The style whose tester is queried. - * @returns An implementation that can perform the hit testing. - * @see yfiles.styles.TemplateNodeStyleRenderer#isHit - */ - getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; - /** - * Gets the insets by delegating to {@link yfiles.styles.TemplateNodeStyleBase#insets}. - * @param style - * @returns - * @protected - */ - getInsets(style:yfiles.styles.TemplateNodeStyleBase):yfiles.geometry.Insets; - /** - * Tries to use the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} to perform the intersection calculation, otherwise reverts to default (rectangular) - * behavior. - * @param inner - * @param outer - * @returns - */ - getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; - /** - * Provides a {@link yfiles.input.IMarqueeTestable marquee testing} implementation for the given style and node. - *

- * If {@link yfiles.styles.TemplateNodeStyleBase#contextLookup} provides an implementation of the {@link yfiles.input.IMarqueeTestable} interface than this instance will be returned, - * otherwise the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} will be used to determine the marquee intersection test with the visual representation of - * the node. - *

- * @param node The node to query the tester for. - * @param style The style whose tester is queried. - * @returns An implementation that can test for marquee intersections. - * @see yfiles.styles.TemplateNodeStyleRenderer#isInBox - */ - getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; - /** - * Gets the minimum size by delegating to {@link yfiles.styles.TemplateNodeStyleBase#minimumSize}. - * @param style - * @returns - * @protected - */ - getMinimumSize(style:yfiles.styles.TemplateNodeStyleBase):yfiles.geometry.Size; - /** - * Gets the normalized outline by delegating to {@link yfiles.styles.TemplateNodeStyleBase#normalizedOutline}. - * @param style - * @returns - * @protected - */ - getNormalizedOutline(style:yfiles.styles.TemplateNodeStyleBase):yfiles.geometry.GeneralPath; - /** - * Tries to use the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} to create the outline shape path, otherwise reverts to default (rectangular) behavior. - * @returns - */ - getOutline():yfiles.geometry.GeneralPath; - /** - * Calculates the preferred size for the given node and style in the provided context. - * @param context The context for which the preferred size should be calculated. - * @param node The node instance. - * @param style The style instance to apply. - * @returns The preferred size for the given label and style. - * @see yfiles.styles.TemplateNodeStyleRenderer#getPreferredSizeCore - */ - getPreferredSize(context:yfiles.view.IRenderContext,node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.geometry.Size; - /** - * Calculates the preferred size for the given node and style. - * @param node The node instance. - * @param style The style instance to apply. - * @returns The preferred size for the given label and style. - * @see yfiles.styles.TemplateNodeStyleRenderer#getPreferredSizeCore - */ - getPreferredSize(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.geometry.Size; - /** - * Calculates the preferred size given the current state of the renderer for the given context. - * @param context The render context for which the preferred size should be calculated. - * @returns The size as suggested by this renderer. - * @protected - */ - getPreferredSizeCore(context:yfiles.view.IRenderContext):yfiles.geometry.Size; - /** - * Provides the geometry for the visual representation. - *

- * If {@link yfiles.styles.TemplateNodeStyleBase#contextLookup} provides an implementation of the {@link yfiles.styles.IShapeGeometry} interface than this instance will be returned, - * otherwise the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} will be used to determine the outline of the visual representation of a node. - *

- * @param node The node to query the geometry for. - * @param style The style for which the geometry is queried. - * @returns An implementation that describes the outline geometry of the shape. - * @see yfiles.styles.TemplateNodeStyleRenderer#isInside - * @see yfiles.styles.TemplateNodeStyleRenderer#getOutline - */ - getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; - /** - * Configures the style and node parameters, does not call {@link yfiles.styles.TemplateNodeStyleRenderer#configure} and returns - * this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.TemplateNodeStyleRenderer#configure}. If - * the subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.TemplateNodeStyleRenderer#isVisible}. - *

- * @param node The node to query visibility tests. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateNodeStyleRenderer#isVisible - */ - getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and node parameters, calls {@link yfiles.styles.TemplateNodeStyleRenderer#configure} and returns this. - * @param node The node to retrieve the {@link } for. The value will be stored in the {@link #node} property. - * @param style The style to associate with the node. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplateNodeStyleRenderer#createVisual - * @see yfiles.styles.TemplateNodeStyleRenderer#updateVisual - */ - getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; - /** - * Tries to use the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} to perform the hit test analysis, otherwise reverts to default (rectangular) behavior. - * @param context the context the hit test is performed in - * @param location the hit point in world coordinates - * @returns whether something has been hit - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * Tries to use the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} to perform the marquee intersection analysis, otherwise reverts to default (rectangular) - * behavior. - * @param context - * @param rectangle - * @returns - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Tries to use the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} to perform the contains test, otherwise reverts to default (rectangular) behavior. - * @param location - * @returns - */ - isInside(location:yfiles.geometry.Point):boolean; - /** - * Determines visibility by checking for an intersection with the {@link yfiles.styles.TemplateNodeStyleRenderer#layout}. - * @param context The context. - * @param rectangle The current clip - * @returns Whether the {@link #layout} is visible in the clip. - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Implementation of the {@link yfiles.graph.ILookup#lookup} method. - *

- * Delegates to the lookup returned by {@link yfiles.styles.TemplateNodeStyleRenderer#getContextLookup}, first. Returns special {@link yfiles.input.INodeInsetsProvider} - * or {@link yfiles.input.INodeSizeConstraintProvider} implementations if asked for. Last, it returns this class if it implements - * the queried type. - *

- * @param type The type to query an instance for. - * @returns The implementation or null. - */ - lookup(type:yfiles.lang.Class):any; - /** - * Updates the component correspondingly. - * @param context The context for the creation. - * @param oldVisual The currently rendered visual. - * @returns The visual that is used for rendering the node. - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.TemplateNodeStyleBase} - */ - style:yfiles.styles.TemplateNodeStyleBase; - /** - * Gets or sets the currently configured node. - * @protected - * @type {yfiles.graph.INode} - */ - node:yfiles.graph.INode; - /** - * Gets the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. - *

- * Returns Node.Layout. - *

- * @type {yfiles.geometry.IRectangle} - */ - layout:yfiles.geometry.IRectangle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplateNodeStyleRenderer; - } - /** - * Base class for port styles that use a SVG snippet as template for the visualization of {@link yfiles.graph.IPort}s. - * @see yfiles.styles.TemplatePortStyle - * @see yfiles.styles.TemplatePortStyle - * @class - * @implements {yfiles.styles.IPortStyle} - * @implements {yfiles.lang.IPropertyObservable} - * @implements {yfiles.lang.ICloneable} - */ - export interface TemplatePortStyleBase extends yfiles.lang.Object,yfiles.styles.IPortStyle,yfiles.lang.IPropertyObservable,yfiles.lang.ICloneable{} - export class TemplatePortStyleBase { - /** - * Constructs a new instance using the provided renderer. - * @param renderer - * @protected - */ - constructor(renderer:yfiles.styles.TemplatePortStyleRenderer); - /** - * Constructs a new instance of this style with default values. - * @protected - */ - constructor(); - /** - * Performs a shallow clone of this instance, except for the value of {@link yfiles.styles.TemplatePortStyleBase#styleTag} which is cloned, too, if it can be cloned. - * @returns A clone of this instance. - */ - clone():any; - /** - * Factory method that is called by the {@link yfiles.styles.TemplatePortStyleRenderer} to create the visual that will be used for - * the display of the port. - * @param context The context for which the visual should be created. - * @param port The port that will be rendered. - * @returns The readily styled visual. - */ - createTemplate(context:yfiles.view.IRenderContext,port:yfiles.graph.IPort):yfiles.view.SvgVisual; - /** - * Convenience method that determines the preferred {@link yfiles.styles.TemplatePortStyleBase#renderSize} of the port if this style was applied. - * @param context The context for which the size should be calculated. - * @param port The port to determine the preferred size of. - * @returns The preferred size. - */ - getPreferredSize(context:yfiles.view.IRenderContext,port:yfiles.graph.IPort):yfiles.geometry.Size; - /** - * Loads all template script elements that have not been parsed, yet, and creates the respective template cache objects. - *

- * This method can be called to perform the template loading at a certain point in time, for example during application - * startup. By default, a template is loaded lazily when the first visual using this template is built. - *

- * @static - */ - static loadAllTemplates():void; - /** - * Raises the {@link yfiles.styles.TemplatePortStyleBase#addPropertyChangedListener PropertyChanged} event. - * @param evt The {@link } instance containing the event data. - * @protected - */ - onPropertyChanged(evt:yfiles.lang.PropertyChangedEventArgs):void; - /** - * Adds the given listener for the PropertyChanged event that occurs when a property value changes. - * @param listener The listener to add. - * @see yfiles.styles.TemplatePortStyleBase#removePropertyChangedListener - */ - addPropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Removes the given listener for the PropertyChanged event that occurs when a property value changes. - * @param listener The listener to remove. - * @see yfiles.styles.TemplatePortStyleBase#addPropertyChangedListener - */ - removePropertyChangedListener(listener:(sender:any,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; - /** - * Gets or sets the tag that is associated with this style instance. - *

- * The various style renderer implementations can use this tag to make it accessible in the context of the instantiated - * templates and controls. The framework does not make any assumptions about the value of this property. It is there for - * convenient use in the process of data binding the templates. This property supports {@link yfiles.lang.IPropertyObservable property change notification} and can - * thus be data bound easily. - *

- * @default null - * @type {any} - */ - styleTag:any; - /** - * Gets or sets an implementation of {@link yfiles.graph.IContextLookup} that can be used to satisfy queries that are made to the - * implementation which is returned by calls to {@link yfiles.styles.IPortStyleRenderer#getContext} that are made on the style - * renderer that is associated with this style instance. - *

- * This can be used to conveniently customize the lookup behavior of the style renderers that are associated with this - * instance. E.g. it is possible to provide customized implementations of {@link yfiles.view.ISelectionIndicatorInstaller}, - * {@link yfiles.view.IHighlightIndicatorInstaller}, {@link yfiles.input.IHandleProvider}, {@link yfiles.input.INodeSizeConstraintProvider}, and - * {@link yfiles.input.INodeInsetsProvider}. Simple style implementations can use {@link yfiles.graph.IContextLookup#EMPTY_CONTEXT_LOOKUP} - * but may not use null for this property. The default value is {@link yfiles.graph.IContextLookup#EMPTY_CONTEXT_LOOKUP} - *

- * @default 'Lookups.EmptyContextLookup' - * @type {yfiles.graph.IContextLookup} - */ - contextLookup:yfiles.graph.IContextLookup; - /** - * Gets or sets the {@link yfiles.geometry.Size size} of the of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This size will be used to arrange the visual correctly. The default value is (5,5). - *

- * @default '5,5' - * @type {yfiles.geometry.Size} - */ - renderSize:yfiles.geometry.Size; - /** - * Gets or sets the normalized outline of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * The shape will automatically be arranged and transformed to have the bounds of the port. This shape will be used to - * satisfy requests to {@link yfiles.input.IMarqueeTestable#isInBox} and {@link yfiles.input.IHitTestable#isHit} and may be left null to - * indicate default (rectangular) behavior. - *

- *

- * The default value is null. - *

- * @default null - * @type {yfiles.geometry.GeneralPath} - */ - normalizedOutline:yfiles.geometry.GeneralPath; - /** - * - * @type {yfiles.styles.IPortStyleRenderer} - */ - renderer:yfiles.styles.IPortStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplatePortStyleBase; - } - /** - * An {@link yfiles.styles.IPortStyle} that uses an SVG snippet as template for the visualization of {@link yfiles.graph.IPort}s. - *

- * The {@link yfiles.styles.TemplatePortStyle#styleResourceKey} is used to determine the template that will be applied to the component. The template must be specified in the DOM - * in a script tag with type='text/yfiles-template'. - *

- *

- * Note that the {@link yfiles.styles.TemplatePortStyleBase#renderSize} should be specified to match the size of the visual's template. - *

- *

- * The SVG template snippet can contain bindings in the form attribute="{Binding propertyName}" that bind the attribute - * value to the value of the property with the given name in the node's tag. - *

- *

- * TemplateBindings in the form attribute="{TemplateBinding propertyName}" bind the attribute value to a set of - * well-defined properties of the port that are provided by the style. The available template binding properties are: - *

- *
    - *
  • width: The width of the graph element
  • - *
  • height: The height of the graph element
  • - *
  • bounds: The bounding rectangle of the graph element
  • - *
  • canvas: The {@link yfiles.view.GraphComponent} the element is rendered in
  • - *
  • itemSelected: Whether the element is selected
  • - *
  • itemFocused: Whether the element has the focus
  • - *
  • itemHighlighted: Whether the element is highlighted
  • - *
  • styleTag: The tag associated with the element's style instance
  • - *
- * @class - * @extends {yfiles.styles.TemplatePortStyleBase} - */ - export interface TemplatePortStyle extends yfiles.styles.TemplatePortStyleBase{} - export class TemplatePortStyle { - /** - * Creates a new instance using the given render template id and a custom renderer instance. - * @param renderTemplateId The id of the SVG snippet that will be used for the component. - * @param renderer The custom renderer for this style instance. - */ - constructor(renderTemplateId:string,renderer:yfiles.styles.TemplatePortStyleRenderer); - /** - * Creates a new instance using the given render template id and a custom renderer instance. - * @param {Object} options The parameters to pass. - * @param options.renderTemplateId The id of the SVG snippet that will be used for the component. - * @param options.renderer The custom renderer for this style instance. - * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.Size size} of the of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#renderSize} property on the created object. - *

- */ - constructor(options:{renderTemplateId:string,renderer:yfiles.styles.TemplatePortStyleRenderer,normalizedOutline?:yfiles.geometry.GeneralPath,renderSize?:yfiles.geometry.Size}); - /** - * Creates a new instance using the given resource key and a custom renderer instance.{@link yfiles.styles.TemplatePortStyleRenderer} - * as renderer. - * @param renderTemplateId The id of the SVG snippet that will be used for the component. - */ - constructor(renderTemplateId:string); - /** - * Creates a new instance using the given resource key and a custom renderer instance.{@link yfiles.styles.TemplatePortStyleRenderer} - * as renderer. - * @param {Object} options The parameters to pass. - * @param options.renderTemplateId The id of the SVG snippet that will be used for the component. - * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.Size size} of the of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#renderSize} property on the created object. - *

- */ - constructor(options:{renderTemplateId:string,normalizedOutline?:yfiles.geometry.GeneralPath,renderSize?:yfiles.geometry.Size}); - /** - * Creates a new instance with no render template id and {@link yfiles.styles.TemplatePortStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.Size size} of the of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#renderSize} property on the created object. - *

- * @param {string} options.styleResourceKey The {@link string} that will be used to look up the template that is applied to the component. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyle#styleResourceKey} property on the created object. - *

- */ - constructor(options?:{normalizedOutline?:yfiles.geometry.GeneralPath,renderSize?:yfiles.geometry.Size,styleResourceKey?:string}); - /** - * Gets or sets the {@link string} that will be used to look up the template that is applied to the component. - *

- * The default value is null. - *

- * @default null - * @type {string} - */ - styleResourceKey:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplatePortStyle; - } - /** - * An implementation of the {@link yfiles.styles.IPortStyleRenderer} interface that can render {@link yfiles.styles.TemplatePortStyleBase} - * instances. - * @see yfiles.styles.TemplatePortStyle - * @see yfiles.styles.StringTemplatePortStyle - * @class - * @implements {yfiles.styles.IPortStyleRenderer} - * @implements {yfiles.view.IBoundsProvider} - * @implements {yfiles.view.IVisibilityTestable} - * @implements {yfiles.input.IMarqueeTestable} - * @implements {yfiles.input.IHitTestable} - * @implements {yfiles.graph.ILookup} - * @implements {yfiles.view.IVisualCreator} - */ - export interface TemplatePortStyleRenderer extends yfiles.lang.Object,yfiles.styles.IPortStyleRenderer,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} - export class TemplatePortStyleRenderer { - constructor(); - /** - * Prepares this instance for subsequent calls after the style and port have been initialized. - *

- * Upon invocation the {@link yfiles.styles.TemplatePortStyleRenderer#style} and {@link yfiles.styles.TemplatePortStyleRenderer#port} properties have been populated by the - * {@link yfiles.styles.TemplatePortStyleRenderer#getVisualCreator}, {@link yfiles.styles.TemplatePortStyleRenderer#getBoundsProvider}, - * {@link yfiles.styles.TemplatePortStyleRenderer#getHitTestable}, or {@link yfiles.styles.TemplatePortStyleRenderer#getMarqueeTestable} - * methods. - *

- * @protected - */ - configure():void; - /** - * Creates the visual by delegating to {@link yfiles.styles.TemplatePortStyleBase#createTemplate} and then initializing the visual - * with the context. - * @param context The context for the creation. - * @returns The visual that is used for rendering the port. - */ - createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; - /** - * - * @param context - * @returns - */ - getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; - /** - * Configures the style and port parameters, calls {@link yfiles.styles.TemplatePortStyleRenderer#configure} and returns this. - * @param port The port to retrieve the bounds provider for. The value will be stored in the {@link #port} property. - * @param style The style to associate with the port. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplatePortStyleRenderer#getBounds - */ - getBoundsProvider(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.view.IBoundsProvider; - /** - * Configures the style and port parameters, does not call {@link yfiles.styles.TemplatePortStyleRenderer#configure} and returns - * this. - *

- * As this method may be called often it will not automatically call {@link yfiles.styles.TemplatePortStyleRenderer#configure}, - * instead subclasses should ensure that in the {@link yfiles.styles.TemplatePortStyleRenderer#lookup} method call they should call - * {@link yfiles.styles.TemplatePortStyleRenderer#configure} only if needed, i.e. if they decide to return this or an instance that - * depends on a correctly configured this. - *

- * @param port The port to query the context for. The value will be stored in the {@link #port} property. - * @param style The style to associate with the port. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplatePortStyleRenderer#lookup - */ - getContext(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.graph.ILookup; - /** - * Configures the style and port parameters, calls {@link yfiles.styles.TemplatePortStyleRenderer#configure} and returns this. - * @param port The port to query hit test with. The value will be stored in the {@link #port} property. - * @param style The style to associate with the port. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplatePortStyleRenderer#isHit - */ - getHitTestable(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.input.IHitTestable; - /** - * Configures the style and port parameters, calls {@link yfiles.styles.TemplatePortStyleRenderer#configure} and returns this. - * @param port The port to query marquee intersection tests. The value will be stored in the {@link #port} property. - * @param style The style to associate with the port. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplatePortStyleRenderer#isInBox - */ - getMarqueeTestable(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.input.IMarqueeTestable; - /** - * Gets the normalized outline by delegating to {@link yfiles.styles.TemplatePortStyleBase#normalizedOutline}. - * @param style - * @returns - * @protected - */ - getNormalizedOutline(style:yfiles.styles.TemplatePortStyleBase):yfiles.geometry.GeneralPath; - /** - * Calculates the preferred size for the given port and style. - * @param context The render context which can be null. - * @param port The port instance. - * @param style The style instance to apply. - * @returns The preferred size for the given port and style. - * @see yfiles.styles.TemplatePortStyleRenderer#getPreferredSizeCore - */ - getPreferredSize(context:yfiles.view.IRenderContext,port:yfiles.graph.IPort,style:yfiles.styles.TemplatePortStyleBase):yfiles.geometry.Size; - /** - * Gets the preferred size for the current configuration. - * @param context - * @returns The preferred size. - * @protected - */ - getPreferredSizeCore(context:yfiles.view.IRenderContext):yfiles.geometry.Size; - /** - * Gets the size of the rendering from the style. - * @returns The {@link #renderSize}. - * @protected - */ - getRenderSize():yfiles.geometry.Size; - /** - * Configures the style and port parameters, does not call {@link yfiles.styles.TemplatePortStyleRenderer#configure} and returns - * this. - *

- * Unlike most of the other methods this implementation does not call {@link yfiles.styles.TemplatePortStyleRenderer#configure}. If - * the subclass implementation depends on this instance to be configured, it needs to call Configure in - * {@link yfiles.styles.TemplatePortStyleRenderer#isVisible}. - *

- * @param port The port to query visibility tests. The value will be stored in the {@link #port} property. - * @param style The style to associate with the port. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplatePortStyleRenderer#isVisible - */ - getVisibilityTestable(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.view.IVisibilityTestable; - /** - * Configures the style and port parameters, calls {@link yfiles.styles.TemplatePortStyleRenderer#configure} and returns this. - * @param port The port to retrieve the {@link } for. The value will be stored in the {@link #port} property. - * @param style The style to associate with the port. The value will be stored in the {@link #style} property. - * @returns this - * @see yfiles.styles.TemplatePortStyleRenderer#createVisual - * @see yfiles.styles.TemplatePortStyleRenderer#updateVisual - */ - getVisualCreator(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.view.IVisualCreator; - /** - * - * @param context - * @param location - * @returns - */ - isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; - /** - * - * @param context - * @param rectangle - * @returns - */ - isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Calls {@link yfiles.styles.TemplatePortStyleRenderer#configure} and test the {@link yfiles.styles.TemplatePortStyleRenderer#port} using the {@link yfiles.styles.TemplatePortStyleRenderer#style} for a visible intersection with the - * clip bounds. - *

- * This simple implementation uses {@link yfiles.styles.TemplatePortStyleRenderer#getBounds} to determine the visibility. - * Subclasses may choose to override this behavior for improved performance but need to make sure to call {@link yfiles.styles.TemplatePortStyleRenderer#configure} if they depend on a configured - * instance. - *

- * @param context the current canvas context - * @param rectangle the clip bounds - * @returns true if the port may be painted within the clip bounds. - * @see yfiles.styles.TemplatePortStyleRenderer#getVisibilityTestable - */ - isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; - /** - * Implements the {@link yfiles.graph.ILookup} interface. - *

- * This method will be used by default if {@link yfiles.styles.TemplatePortStyleRenderer#getContext} has been queried for a lookup - * implementation. Note that it cannot be assumed that {@link yfiles.styles.TemplatePortStyleRenderer#configure} has already been - * invoked. However, normally {@link yfiles.styles.TemplatePortStyleRenderer#port} and {@link yfiles.styles.TemplatePortStyleRenderer#style} will be correctly configured if invoked directly after GetContext. Subclass - * implementations should make sure to configure this instance before they return this as a result of a successful lookup. - * This implementation will check if type.IsInstanceOfType(this) and will call {@link yfiles.styles.TemplatePortStyleRenderer#configure} - * on success and return this. - *

- * @param type The type to query for. - * @returns An implementation or null. - */ - lookup(type:yfiles.lang.Class):any; - /** - * Delegates to the {@link yfiles.styles.TemplatePortStyleBase}'s {@link yfiles.styles.TemplatePortStyleBase#contextLookup}. - * @param style - * @param port - * @param type - * @returns - * @protected - */ - lookupContext(style:yfiles.styles.TemplatePortStyleBase,port:yfiles.graph.IPort,type:yfiles.lang.Class):any; - /** - * Updates the component correspondingly. - * @param context The context for the creation. - * @param oldVisual The currently rendered visual. - * @returns The visual that is used for rendering the port. - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; - /** - * Gets the center of the port. - * @protected - * @type {yfiles.geometry.Point} - */ - center:yfiles.geometry.Point; - /** - * Gets or sets the currently configured style. - * @protected - * @type {yfiles.styles.TemplatePortStyleBase} - */ - style:yfiles.styles.TemplatePortStyleBase; - /** - * Gets or sets the currently configured port. - * @protected - * @type {yfiles.graph.IPort} - */ - port:yfiles.graph.IPort; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.TemplatePortStyleRenderer; - } - /** - * A {@link yfiles.styles.TemplatePortStyleBase} that uses an SVG snippet as template for the visualization of - * {@link yfiles.graph.IPort}s. - *

- * In contrast to {@link yfiles.styles.TemplatePortStyle}, the SVG template used by this style must be encoded as string and set to - * the {@link yfiles.styles.StringTemplatePortStyle#svgContent} property. Note that the RenderSize should be specified to match the size of the visual's template. - *

- *

- * It is vital that the {@link yfiles.styles.StringTemplatePortStyle#svgContent SVG snippet} does not declare the SVG namespace itself. Its content is parsed in a dummy namespace - * in order to avoid immediate validation of the result. The resulting SVG elements are automatically created in the SVG - * namespace before they are added to the DOM. - *

- *

- * The SVG template snippet can contain bindings in the form attribute="{Binding propertyName}" that bind the attribute - * value to the value of the property with the given name in the node's tag. - *

- *

- * TemplateBindings in the form attribute="{TemplateBinding propertyName}" bind the attribute value to a set of - * well-defined properties of the port that are provided by the style. The available template binding properties are: - *

- *
    - *
  • width: The width of the graph element
  • - *
  • height: The height of the graph element
  • - *
  • bounds: The bounding rectangle of the graph element
  • - *
  • canvas: The {@link yfiles.view.GraphComponent} the element is rendered in
  • - *
  • itemSelected: Whether the element is selected
  • - *
  • itemFocused: Whether the element has the focus
  • - *
  • itemHighlighted: Whether the element is highlighted
  • - *
  • styleTag: The tag associated with the element's style instance
  • - *
- * @class - * @extends {yfiles.styles.TemplatePortStyleBase} - */ - export interface StringTemplatePortStyle extends yfiles.styles.TemplatePortStyleBase{} - export class StringTemplatePortStyle { - /** - * Creates a new instance using the provided renderer. - * @param renderer The custom renderer for this style instance. - */ - constructor(renderer:yfiles.styles.TemplatePortStyleRenderer); - /** - * Creates a new instance using the provided renderer. - * @param {Object} options The parameters to pass. - * @param options.renderer The custom renderer for this style instance. - * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.Size size} of the of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#renderSize} property on the created object. - *

- */ - constructor(options:{renderer:yfiles.styles.TemplatePortStyleRenderer,normalizedOutline?:yfiles.geometry.GeneralPath,renderSize?:yfiles.geometry.Size}); - /** - * Initializes a new instance of this class and sets the given string as its {@link yfiles.styles.StringTemplatePortStyle#svgContent}. - * @param svgContent The SVG snippet to use as template. - */ - constructor(svgContent:string); - /** - * Initializes a new instance of this class and sets the given string as its {@link yfiles.styles.StringTemplatePortStyle#svgContent}. - * @param {Object} options The parameters to pass. - * @param options.svgContent The SVG snippet to use as template. - * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.Size size} of the of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#renderSize} property on the created object. - *

- */ - constructor(options:{svgContent:string,normalizedOutline?:yfiles.geometry.GeneralPath,renderSize?:yfiles.geometry.Size}); - /** - * Creates a new instance using {@link yfiles.styles.TemplatePortStyleRenderer} as renderer. - * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#normalizedOutline} property on the created object. - *

- * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.Size size} of the of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. - *

- * This option sets the {@link yfiles.styles.TemplatePortStyleBase#renderSize} property on the created object. - *

- * @param {string} options.svgContent The SVG content that is the template for the port visualization. - *

- * This option sets the {@link yfiles.styles.StringTemplatePortStyle#svgContent} property on the created object. - *

- */ - constructor(options?:{normalizedOutline?:yfiles.geometry.GeneralPath,renderSize?:yfiles.geometry.Size,svgContent?:string}); - /** - * Gets or sets the SVG content that is the template for the port visualization. - * @default null - * @type {string} - */ - svgContent:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.StringTemplatePortStyle; - } - /** - * Style implementation for {@link yfiles.graph.IStripe} instances in an {@link yfiles.graph.ITable}. - *

- * It is up to the implementation to interpret the visual appearance of a stripe. The framework uses the associated, - * possibly shared {@link yfiles.styles.IStripeStyle#renderer} to perform the actual rendering of this style for a given stripe. This interface extends the {@link yfiles.lang.ICloneable} - * interface. This allows clients to obtain a persistent copy of the current state of this style. Immutable style - * implementations may return themselves. - *

- *

Related demos:

- *
    - *
  • Demo: TableNodeStyle, Demo.yFiles.Graph.TableNodeStyle
  • - *
- * @interface - * @implements {yfiles.lang.ICloneable} - */ - export interface IStripeStyle extends yfiles.lang.Object,yfiles.lang.ICloneable{ - /** - * Gets the renderer implementation that can be queried for implementations that provide details about the visual - * appearance and visual behavior for a given stripe and this style instance. - *

- * The idiom for retrieving, e.g. an {@link yfiles.view.IVisualCreator} implementation for a given stripe is: - *

- * @abstract - * @type {yfiles.styles.IStripeStyleRenderer} - */ - renderer:yfiles.styles.IStripeStyleRenderer; - } - var IStripeStyle:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.styles.IStripeStyle; - }; - /** - * Interface used by {@link yfiles.styles.IStripeStyle} implementations that can be used to query the actual {@link yfiles.view.IVisualCreator} - * implementation for a stripe and an associated style. - *

- * Implementations of this interface should be designed to be sharable between multiple style instances and should - * therefore not contain style specific state. - *

- * @see yfiles.styles.IStripeStyle - * @see yfiles.graph.IStripe - * @interface - */ - export interface IStripeStyleRenderer extends yfiles.lang.Object{ - /** - * Gets a temporary context instance that can be used to query additional information for the stripe's style. - *

- * Implementations may return {@link yfiles.graph.ILookup#EMPTY} if they don't support this, but may not return null. - *

- * @param stripe The stripe to provide a context instance for. - * @param style The style to use for the context. - * @returns An non-null lookup implementation. - * @see yfiles.graph.ILookup#EMPTY - * @see yfiles.graph.ILookup - * @abstract - */ - getContext(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):yfiles.graph.ILookup; - /** - * Gets an implementation of the {@link yfiles.view.IVisualCreator} interface that can handle the provided stripe and its - * associated style. - *

- * This method may return a flyweight implementation, but never null. - *

- * @param stripe The nstripeode to provide an instance for - * @param style The style to use for the creation of the visual - * @returns An implementation that may be used to subsequently create or update the visual for the stripe. Clients should not cache - * this instance and must always call this method immediately before using the value returned. This enables the use of the - * flyweight design pattern for implementations. This method may not return null but should yield a {@link #INSTANCE void} implementation - * instead. - * @see yfiles.view.VoidVisualCreator#INSTANCE - * @abstract - */ - getVisualCreator(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):yfiles.view.IVisualCreator; - } - var IStripeStyleRenderer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.styles.IStripeStyleRenderer; - }; - /** - * A void implementation of a stripe style that does nothing and behaves like an invisible style. - *

- * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidStripeStyle#INSTANCE} of this class - * instead of null where null is not allowed. For example you cannot assign null to the {@link yfiles.graph.IStripe#style} property of an - * {@link yfiles.graph.IStripe}. - *

- * @class - * @implements {yfiles.styles.IStripeStyle} - * @final - */ - export interface VoidStripeStyle extends yfiles.lang.Object,yfiles.styles.IStripeStyle{} - export class VoidStripeStyle { - /** - * Returns this. - * @returns this - */ - clone():any; - /** - * The {@link yfiles.styles.VoidStripeStyle} singleton. - * @const - * @static - * @type {yfiles.styles.VoidStripeStyle} - */ - static INSTANCE:yfiles.styles.VoidStripeStyle; - /** - * Gets the {@link yfiles.styles.VoidStripeStyleRenderer#INSTANCE VoidStripeStyleRenderer instance}. - * @see yfiles.styles.IStripeStyle#renderer - * @type {yfiles.styles.IStripeStyleRenderer} - */ - renderer:yfiles.styles.IStripeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.VoidStripeStyle; - } - /** - * A void implementation of a stripe style renderer that does nothing. - *

- * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidStripeStyleRenderer#INSTANCE} of - * this class instead of null where null is not allowed. For example you cannot assign null to the {@link yfiles.styles.IStripeStyle#renderer} property of an - * {@link yfiles.styles.IStripeStyle}. - *

- * @class - * @implements {yfiles.styles.IStripeStyleRenderer} - * @final - */ - export interface VoidStripeStyleRenderer extends yfiles.lang.Object,yfiles.styles.IStripeStyleRenderer{} - export class VoidStripeStyleRenderer { - /** - * Yields the {@link yfiles.graph.ILookup#EMPTY} that will not yield anything. - * @param stripe - * @param style - * @returns - */ - getContext(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):yfiles.graph.ILookup; - /** - * Yields the {@link yfiles.view.VoidVisualCreator#INSTANCE} that will do nothing. - * @param stripe - * @param style - * @returns - */ - getVisualCreator(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):yfiles.view.IVisualCreator; - /** - * The {@link yfiles.styles.VoidStripeStyleRenderer} singleton. - * @const - * @static - * @type {yfiles.styles.IStripeStyleRenderer} - */ - static INSTANCE:yfiles.styles.IStripeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.VoidStripeStyleRenderer; - } - /** - * A stripe style decorator that uses a node style instance to render the stripe. - *

- * The renderer of the {@link yfiles.styles.NodeStyleStripeStyleAdapter#nodeStyle} used by this class must create {@link yfiles.view.SvgVisual}s. - *

- * @class - * @implements {yfiles.styles.IStripeStyle} - */ - export interface NodeStyleStripeStyleAdapter extends yfiles.lang.Object,yfiles.styles.IStripeStyle{} - export class NodeStyleStripeStyleAdapter { - /** - * Creates a stripe style that uses the provided node style to render the stripe. - *

- * Note that the styles will be stored by reference, thus modifying the style will directly affect the rendering of this - * instance. - *

- * @param nodeStyle The node style to use for rendering the stripe. - */ - constructor(nodeStyle:yfiles.styles.INodeStyle); - /** - * Initializes a new instance of the {@link yfiles.styles.NodeStyleStripeStyleAdapter} class. - *

- * This constructor uses an rectangular {@link yfiles.styles.ShapeNodeStyle} with a transparent brush and a black pen for the {@link yfiles.styles.NodeStyleStripeStyleAdapter#nodeStyle} - * property. - *

- * @param {Object} [options=null] The parameters to pass. - * @param {yfiles.styles.INodeStyle} options.nodeStyle The {@link yfiles.styles.INodeStyle} that is used for rendering the stripe. - *

- * This option sets the {@link yfiles.styles.NodeStyleStripeStyleAdapter#nodeStyle} property on the created object. - *

- */ - constructor(options?:{nodeStyle?:yfiles.styles.INodeStyle}); - /** - * - * @returns - */ - clone():any; - /** - * - * @type {yfiles.styles.IStripeStyleRenderer} - */ - renderer:yfiles.styles.IStripeStyleRenderer; - /** - * Gets the {@link yfiles.styles.INodeStyle} that is used for rendering the stripe. - * @type {yfiles.styles.INodeStyle} - */ - nodeStyle:yfiles.styles.INodeStyle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.NodeStyleStripeStyleAdapter; - } - export enum TableRenderingOrder{ - /** - * Draw columns, then rows - */ - COLUMNS_FIRST, - /** - * Draw rows, then columns - */ - ROWS_FIRST - } - /** - * An abstract base class that makes it possible to easily implement a custom {@link yfiles.styles.IStripeStyle}. - *

- * The only method that needs to be implemented by subclasses is {@link yfiles.styles.StripeStyleBase#createVisual}, however to - * improve rendering performance it is highly recommended to implement at least - * {@link yfiles.styles.StripeStyleBase#updateVisual}, too. - *

- *

- * This implementation differs from the straightforward {@link yfiles.styles.IStripeStyle} implementation in that there is no - * visible separation between the style and its - * {@link yfiles.styles.IStripeStyleRenderer}. Instead the renderer used by the base class is fixed and delegates all calls back to - * the style instance. - *

- * @class - * @implements {yfiles.styles.IStripeStyle} - */ - export interface StripeStyleBase extends yfiles.lang.Object,yfiles.styles.IStripeStyle{} - export class StripeStyleBase { - /** - * Initializes a new instance of the {@link yfiles.styles.StripeStyleBase} class. - * @protected - */ - constructor(); - /** - * Creates a new object that is a copy of the current instance. - *

- * Immutable subclasses should consider returning this. - *

- * @returns A new object that is a copy of this instance using {@link #memberwiseClone}. - */ - clone():any; - /** - * Callback that creates the visual. - *

- * This method is called in response to a {@link yfiles.view.IVisualCreator#createVisual} call to the instance that has been - * queried from the {@link yfiles.styles.StripeStyleBase#renderer}. - *

- * @param context - * @param stripe The stripe to which this style instance is assigned. - * @returns The visual as required by the {@link #createVisual} interface. - * @see yfiles.styles.StripeStyleBase#updateVisual - * @protected - * @abstract - */ - createVisual(context:yfiles.view.IRenderContext,stripe:yfiles.graph.IStripe):yfiles.view.Visual; - /** - * Performs the {@link yfiles.graph.ILookup#lookup} operation for the {@link yfiles.styles.IStripeStyleRenderer#getContext} that has been - * queried from the {@link yfiles.styles.StripeStyleBase#renderer}. - *

- * This implementation yields null for everything but: - *

- *
    - *
  • {@link yfiles.view.IVisualCreator}
  • - *
  • {@link yfiles.graph.ILookup}
  • - *
- *

- * For these interfaces an implementation will be returned that delegates to the methods in this instance. - *

- * @param stripe The stripe to use for the context lookup. - * @param type The type to query. - * @returns An implementation of the type or null. - * @protected - */ - lookup(stripe:yfiles.graph.IStripe,type:yfiles.lang.Class):any; - /** - * Callback that updates the visual previously created by {@link yfiles.styles.StripeStyleBase#createVisual}. - *

- * This method is called in response to a {@link yfiles.view.IVisualCreator#updateVisual} call to the instance that has been - * queried from the {@link yfiles.styles.StripeStyleBase#renderer}. This implementation simply delegates to {@link yfiles.styles.StripeStyleBase#createVisual} so subclasses - * should override to improve rendering performance. - *

- * @param context - * @param oldVisual The visual that has been created in the call to {@link #createVisual}. - * @param stripe The stripe to which this style instance is assigned. - * @returns The visual as required by the {@link #createVisual} interface. - * @see yfiles.styles.StripeStyleBase#createVisual - * @protected - */ - updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual,stripe:yfiles.graph.IStripe):yfiles.view.Visual; - /** - * Gets the renderer implementation for this instance. - *

- * The private implementation will delegate all API calls back to this instance. - *

- * @type {yfiles.styles.IStripeStyleRenderer} - */ - renderer:yfiles.styles.IStripeStyleRenderer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.styles.StripeStyleBase; - } - }export namespace binding{ - /** - * This class is an adapter that populates a {@link yfiles.binding.GraphBuilderBase#graph} from custom business data. - *

- * This class can be used when the business data specifies a collection of nodes and the edges are implicitly defined as - * collections of predecessors and successors of each node object. - *

- *

- * The nodes in the graph are determined using the {@link yfiles.binding.GraphBuilderBase#nodesSource}, {@link yfiles.binding.AdjacentNodesGraphBuilder#predecessorsBinding} and {@link yfiles.binding.AdjacentNodesGraphBuilder#successorsBinding} properties. The predecessors and successors bindings define the - * direct neighbors of a node. Edges are automatically added between a node and its predecessors and successors. If a {@link yfiles.binding.GraphBuilderBase#nodeIdBinding} is - * set, the {@link yfiles.binding.AdjacentNodesGraphBuilder#predecessorsBinding} and {@link yfiles.binding.AdjacentNodesGraphBuilder#successorsBinding} should yield these IDs instead of the node business objects. - *

- *

- * The method {@link yfiles.binding.GraphBuilderBase#updateGraph} can be used to update the {@link yfiles.graph.IGraph} when the underlying - * collection of the business objects changed. In this case, the nodes specified by NodesSource are always present. All - * other nodes, that are the ones defined only in the predecessor or successor binding, persist only if they are reachable - * by a sequence of neighborhood bindings that originates at a node specified by NodesSource. Graph components that are no - * longer reachable by a sequence of neighborhood bindings from a node specified by NodesSource are completely removed from - * the graph. - *

- *

- * For assigning nodes to groups the {@link yfiles.binding.GraphBuilderBase#groupBinding} has to be defined. Group nodes can be nested using the {@link yfiles.binding.GraphBuilderBase#parentGroupBinding} property. - *

- *

- * The visual appearance of the graph constructed from the business objects can be configured using the {@link yfiles.graph.IGraph#nodeDefaults}, the {@link yfiles.graph.IGraph#groupNodeDefaults}, and the {@link yfiles.graph.IGraph#edgeDefaults} of - * the {@link yfiles.graph.IGraph}. - *

- * @class - * @extends {yfiles.binding.GraphBuilderBase} - */ - export interface AdjacentNodesGraphBuilder extends yfiles.binding.GraphBuilderBase{} - export class AdjacentNodesGraphBuilder { - /** - * Initializes a new instance of this class using the given graph. - *

- * The graph will be {@link yfiles.graph.IGraph#clear cleared} and re-built from the data in {@link yfiles.binding.GraphBuilderBase#nodesSource} when {@link yfiles.binding.GraphBuilderBase#buildGraph} is called. - *

- * @param graph - */ - constructor(graph:yfiles.graph.IGraph); - /** - * Creates a new edge connecting the given nodes. - *

- * This class calls this method to create all new edges, and customers may override it to customize edge creation. - *

- * @param graph The graph. - * @param source The source node of the edge. - * @param target The target node of the edge. - * @returns The created edge. - * @protected - */ - createEdge(graph:yfiles.graph.IGraph,source:yfiles.graph.INode,target:yfiles.graph.INode):yfiles.graph.IEdge; - /** - * Updates an existing edge connecting the given nodes when {@link yfiles.binding.GraphBuilderBase#updateGraph} is called and the - * edge should remain in the graph. - * @param graph The graph. - * @param edge The edge to update. - * @param source The source node of the edge. - * @param target The target node of the edge. - * @protected - */ - updateEdge(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,source:yfiles.graph.INode,target:yfiles.graph.INode):void; - /** - * Gets or sets the successors binding. - *

- * This binding maps a business object that represents a node to another business object o which specifies the successor - * nodes of this node. Similar to {@link yfiles.binding.GraphBuilderBase#nodesSource}, the object o can either be an array, an {@link yfiles.collections.IEnumerable.}, or a plain JavaScript object and should - * contain business objects that represent nodes. If a {@link yfiles.binding.GraphBuilderBase#nodeIdBinding} is set, this collection should contain the IDs of the objects that - * specifies the nodes instead of the objects themselves. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @see yfiles.binding.AdjacentNodesGraphBuilder#predecessorsBinding - * @type {any} - */ - successorsBinding:any; - /** - * Gets or sets the predecessors binding. - *

- * This binding maps a business object that represents a node to another business object o which specifies the predecessor - * nodes of this node. Similar to {@link yfiles.binding.GraphBuilderBase#nodesSource}, the object o can either be an array, an {@link yfiles.collections.IEnumerable.}, or a plain JavaScript object and should - * contain business objects that represent nodes. If a {@link yfiles.binding.GraphBuilderBase#nodeIdBinding} is set, this collection should contain the IDs of the objects that - * specifies the nodes instead of the objects themselves. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @see yfiles.binding.AdjacentNodesGraphBuilder#successorsBinding - * @type {any} - */ - predecessorsBinding:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.binding.AdjacentNodesGraphBuilder; - } - /** - * This class is an adapter that populates a {@link yfiles.binding.GraphBuilderBase#graph} from custom business data. - *

- * This class can be used when the business data specifies a collection of nodes, a collection of edges, and optionally, a - * collection of groups. The business data can be set using the {@link yfiles.binding.GraphBuilderBase#nodesSource}, {@link yfiles.binding.GraphBuilderBase#groupsSource} and {@link yfiles.binding.GraphBuilder#edgesSource} properties. - *

- *

- * To determine the source and target of an edge, the {@link yfiles.binding.GraphBuilder#sourceNodeBinding} and the {@link yfiles.binding.GraphBuilder#targetNodeBinding} need to be set for business objects that are the source for - * edges. If a {@link yfiles.binding.GraphBuilderBase#nodeIdBinding} is set, the {@link yfiles.binding.GraphBuilder#sourceNodeBinding} and {@link yfiles.binding.GraphBuilder#targetNodeBinding} should yield these IDs instead of the node business objects. - *

- *

- * For assigning nodes to groups the {@link yfiles.binding.GraphBuilderBase#groupBinding} has to be defined. Group nodes can be nested using the {@link yfiles.binding.GraphBuilderBase#parentGroupBinding} property. Labels for the - * edges can be defined by setting a suitable {@link yfiles.binding.GraphBuilder#edgeLabelBinding}. - *

- *

- * The visual appearance of the graph constructed from the business objects can be configured using the {@link yfiles.graph.IGraph#nodeDefaults}, the {@link yfiles.graph.IGraph#groupNodeDefaults}, and the {@link yfiles.graph.IGraph#edgeDefaults} of - * the {@link yfiles.graph.IGraph}. - *

- * @class - * @extends {yfiles.binding.GraphBuilderBase} - */ - export interface GraphBuilder extends yfiles.binding.GraphBuilderBase{} - export class GraphBuilder { - /** - * Initializes a new instance of this class using the given graph. - *

- * The graph will be {@link yfiles.graph.IGraph#clear cleared} and re-built from the data in {@link yfiles.binding.GraphBuilderBase#nodesSource} and {@link yfiles.binding.GraphBuilder#edgesSource} when {@link yfiles.binding.GraphBuilderBase#buildGraph} is - * called. - *

- * @param graph - */ - constructor(graph:yfiles.graph.IGraph); - /** - * Creates a new edge connecting the given nodes and assigns the businessObjectparameter to the edge's {@link yfiles.graph.ITagOwner#tag Tag} property. - *

- * This class calls this method to create all new edges, and customers may override it to customize edge creation. - *

- * @param graph The graph. - * @param source The source node of the edge. - * @param target The target node of the edge. - * @param labelData The optional label data of the edge if an {@link #edgeLabelBinding} is specified. - * @param businessObject The business data associated with the edge. - * @returns The created edge. - * @protected - */ - createEdge(graph:yfiles.graph.IGraph,source:yfiles.graph.INode,target:yfiles.graph.INode,labelData:any,businessObject:any):yfiles.graph.IEdge; - /** - * Retrieves the associated edge in the {@link yfiles.binding.GraphBuilderBase#graph} for a business object from the {@link yfiles.binding.GraphBuilder#edgesSource}. - * @param businessObject A business object from the {@link #edgesSource} to get the edge for. - * @returns The edge associated with the business object or null for unknown objects. - * @see yfiles.binding.GraphBuilderBase#getBusinessObject - * @see yfiles.binding.GraphBuilderBase#getNode - * @see yfiles.binding.GraphBuilderBase#getGroup - */ - getEdge(businessObject:any):yfiles.graph.IEdge; - /** - * Updates an existing edge when {@link yfiles.binding.GraphBuilderBase#updateGraph} is called and the edge should remain in the - * graph. - * @param graph The graph. - * @param edge The edge to update. - * @param labelData The optional label data of the edge if an {@link #edgeLabelBinding} is specified. - * @param businessObject The business data associated with the edge. - * @protected - */ - updateEdge(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,labelData:any,businessObject:any):void; - /** - * Gets or sets a value indicating whether or not the source and target bindings must yield business objects that are - * contained in {@link yfiles.binding.GraphBuilderBase#nodesSource}. - *

- * If this property is set to false, an edge is created if and only if its source and target bindings yield a business - * object that is contained in {@link yfiles.binding.GraphBuilderBase#nodesSource}. Otherwise, if this property is true, an edge is created for each item of {@link yfiles.binding.GraphBuilder#edgesSource} and nodes are - * created for the source and target as needed. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @see yfiles.binding.GraphBuilder#edgesSource - * @type {boolean} - */ - lazyNodeDefinition:boolean; - /** - * Get or set the business objects to be represented as edges of the {@link yfiles.binding.GraphBuilderBase#graph}. - *

- * This can either be an array of objects, a plain JavaScript object or an {@link yfiles.collections.IEnumerable.} containing the objects to be displayed as - * edges. - *

- *

- * In case the value of this property is a plain JavaScript object, the object's properties are enumerated with Object.getOwnPropertyNames - * and used as the source for the graph edges. - *

- * @type {any} - */ - edgesSource:any; - /** - * Gets or sets the mandatory source node binding. - *

- * This binding maps a business object e that represents an edge to another business object n which represents a node. This - * node will become the source node of the edge. If a {@link yfiles.binding.GraphBuilderBase#nodeIdBinding} is set, the object n should be the ID of the object that specifies - * the node instead of the object itself. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @see yfiles.binding.GraphBuilder#targetNodeBinding - * @see yfiles.binding.GraphBuilder#edgesSource - * @type {any} - */ - sourceNodeBinding:any; - /** - * Gets or sets the mandatory target node binding. - *

- * This binding maps a business object e that represents an edge to another business object n which represents a node. This - * node will become the target node of the edge. If a {@link yfiles.binding.GraphBuilderBase#nodeIdBinding} is set, the object n should be the ID of the object that specifies - * the node instead of the object itself. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @see yfiles.binding.GraphBuilder#sourceNodeBinding - * @see yfiles.binding.GraphBuilder#edgesSource - * @type {any} - */ - targetNodeBinding:any; - /** - * Gets or sets the edge label binding. - *

- * This binding maps a business object that represents an edge to an object that specifies the label data of that edge. By - * default, the label data object must be convertible into a string. This can be customized by overriding {@link yfiles.binding.GraphBuilder#createEdge} - * and {@link yfiles.binding.GraphBuilder#updateEdge}. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilder#edgesSource - * @type {any} - */ - edgeLabelBinding:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.binding.GraphBuilder; - } - /** - * Base class for adapters that populate a {@link yfiles.binding.GraphBuilderBase#graph} from custom business data. - *

- * Customers should not create own implementations based on this class but use one of the ready-made adapters {@link yfiles.binding.GraphBuilder} - * or {@link yfiles.binding.AdjacentNodesGraphBuilder}. - *

- * @class - */ - export interface GraphBuilderBase extends yfiles.lang.Object{} - export class GraphBuilderBase { - /** - * Initializes a new instance of this class using the given graph. - *

- * The graph will be {@link yfiles.graph.IGraph#clear cleared} and re-built from the data in {@link yfiles.binding.GraphBuilderBase#nodesSource} when {@link yfiles.binding.GraphBuilderBase#buildGraph} is called. - *

- * @param graph - * @protected - */ - constructor(graph:yfiles.graph.IGraph); - /** - * Populates the graph instance with items generated from the bound business data. - *

- * First, this method clears the graph, and then it adds new groups, nodes, and edges as specified by the business data and - * bindings. - *

- * @returns The created graph. - * @see yfiles.binding.GraphBuilderBase#updateGraph - */ - buildGraph():yfiles.graph.IGraph; - /** - * Creates a new group node and assigns the businessObjectparameter to the group node's {@link yfiles.graph.ITagOwner#tag Tag} property. - * @param graph The graph. - * @param businessObject The business data associated with the group node. - * @returns The created node. - * @protected - */ - createGroupNode(graph:yfiles.graph.IGraph,businessObject:any):yfiles.graph.INode; - /** - * Creates a new node with the specified parent and assigns the businessObjectparameter to the node's {@link yfiles.graph.ITagOwner#tag Tag} property. - *

- * This class calls this method to create all new nodes, and customers may override it to customize node creation. - *

- * @param graph The graph. - * @param parent The node's parent node. - * @param location The location of the node. - * @param labelData The optional label data of the node if an {@link #nodeLabelBinding} is specified. - * @param businessObject The business data associated with the node. - * @returns The created node. - * @protected - */ - createNode(graph:yfiles.graph.IGraph,parent:yfiles.graph.INode,location:yfiles.geometry.Point,labelData:any,businessObject:any):yfiles.graph.INode; - /** - * Retrieves the associated business object for a given {@link yfiles.graph.IModelItem graph item} from the {@link yfiles.binding.GraphBuilderBase#graph}. - * @param item The item of the graph to get the business object for. - * @returns The business object associated with the graph item. - * @see yfiles.binding.GraphBuilderBase#getNode - * @see yfiles.binding.GraphBuilderBase#getGroup - */ - getBusinessObject(item:yfiles.graph.IModelItem):any; - /** - * Retrieves the associated group node in the {@link yfiles.binding.GraphBuilderBase#graph} for a business object from the {@link yfiles.binding.GraphBuilderBase#groupsSource}. - * @param businessObject A business object from the {@link #groupsSource} to get the group for. - * @returns The group associated with the business object or null for unknown objects. - * @see yfiles.binding.GraphBuilderBase#getBusinessObject - * @see yfiles.binding.GraphBuilderBase#getNode - */ - getGroup(businessObject:any):yfiles.graph.INode; - /** - * Retrieves the associated node in the {@link yfiles.binding.GraphBuilderBase#graph} for a business object from the {@link yfiles.binding.GraphBuilderBase#nodesSource}. - * @param businessObject A business object from the {@link #nodesSource} to get the node for. - * @returns The node associated with the business object or null for unknown objects. - * @see yfiles.binding.GraphBuilderBase#getBusinessObject - * @see yfiles.binding.GraphBuilderBase#getGroup - */ - getNode(businessObject:any):yfiles.graph.INode; - /** - * Updates the graph instance to fit the bound business data. - *

- * This method can be used to update the graph to fit changed business data. In contrast to - * {@link yfiles.binding.GraphBuilderBase#buildGraph}, it does not initially clear the graph. Instead, it keeps graph elements that - * for business objects are still present in the data, creates new elements for new data, and removes obsolete elements. - *

- */ - updateGraph():void; - /** - * Updates an existing group node when {@link yfiles.binding.GraphBuilderBase#updateGraph} is called and the group should remain in - * the graph. - *

- * This class calls this method to create all new groups, and customers may override it to customize group creation. - *

- * @param graph The graph. - * @param groupNode The group node to update. - * @param businessObject The business data associated with the group node. - * @protected - */ - updateGroupNode(graph:yfiles.graph.IGraph,groupNode:yfiles.graph.INode,businessObject:any):void; - /** - * Updates an existing node when {@link yfiles.binding.GraphBuilderBase#updateGraph} is called and the node should remain in the - * graph. - * @param graph The graph. - * @param node The node to update. - * @param parent The node's parent node. - * @param location The location of the node. - * @param labelData The optional label data of the node if an {@link #nodeLabelBinding} is specified. - * @param businessObject The business data associated with the node. - * @protected - */ - updateNode(graph:yfiles.graph.IGraph,node:yfiles.graph.INode,parent:yfiles.graph.INode,location:yfiles.geometry.Point,labelData:any,businessObject:any):void; - /** - * Returns the {@link yfiles.graph.IGraph graph} used by this class. - * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - /** - * Gets or sets the business objects to be represented as nodes of the {@link yfiles.binding.GraphBuilderBase#graph}. - *

- * This can either be an array of objects, a plain JavaScript object or an {@link yfiles.collections.IEnumerable.} containing the objects to be displayed as - * nodes. - *

- *

- * In case the value of this property is a plain JavaScript object, the object's properties are enumerated with Object.getOwnPropertyNames - * and used as the source for the graph nodes. - *

- * @type {any} - */ - nodesSource:any; - /** - * Gets or sets the business objects to be represented as group nodes of the {@link yfiles.binding.GraphBuilderBase#graph}. - *

- * This can either be an array of objects, a plain JavaScript object or an {@link yfiles.collections.IEnumerable.} containing the objects to be displayed as group - * nodes. - *

- *

- * In case the value of this property is a plain JavaScript object, the object's properties are enumerated with Object.getOwnPropertyNames - * and used as the source for the graph nodes. - *

- * @type {any} - */ - groupsSource:any; - /** - * Gets or sets the node ID binding. - *

- * This binding maps a business object that represents a node to its ID. If this binding is set, node IDs can be used in a - * business object that represents an edge to identify the source node and target node of the corresponding edge. The - * binding should not be changed once the graph is built. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @type {any} - */ - nodeIdBinding:any; - /** - * Gets or sets the node label binding. - *

- * This binding maps a business object that represents a node to an object that specifies the label data of that node. - *

- *

- * By default, the label data object must be convertible into a string. This can be customized by overriding {@link yfiles.binding.GraphBuilderBase#createNode} - * and {@link yfiles.binding.GraphBuilderBase#updateNode}. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @type {any} - */ - nodeLabelBinding:any; - /** - * Gets or sets the group node ID binding. - *

- * This binding maps a business object that represents a group to its ID. If this binding is set, group IDs can be used in - * a business object that represents a node to identify the parent group of the corresponding node. The binding should not - * be changed once the graph is built. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. Functions will be called with both this and the first and only argument as the value to convert. - *

- * @see yfiles.binding.GraphBuilderBase#groupsSource - * @type {any} - */ - groupIdBinding:any; - /** - * Gets or sets the group binding. - *

- * This binding maps a business object o1 that represents a group to another object o2 that specifies the parent group of - * o1. If o2 is contained in {@link yfiles.binding.GraphBuilderBase#groupsSource}, then the node for o1 becomes a child node of the group for o2. - *

- *

- * If a {@link yfiles.binding.GraphBuilderBase#groupIdBinding} is set, to object o2 should be the ID of the object that specifies the group instead of the object itself. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @type {any} - */ - groupBinding:any; - /** - * Gets or sets the parent group binding. - *

- * This binding maps a business object o1 that represents a group to another object o2 that specifies the parent group of - * o1. If o2 is contained in {@link yfiles.binding.GraphBuilderBase#groupsSource}, then the group for o1 becomes a child node of the group for o2. - *

- *

- * If a {@link yfiles.binding.GraphBuilderBase#groupIdBinding} is set, to object o2 should be the ID of the object that specifies the group instead of the object itself. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @type {any} - */ - parentGroupBinding:any; - /** - * Gets or sets the binding for determining a node's position on the x-axis. - *

- * This binding maps a business object that represents a node to a number that specifies the x-coordinate of that node. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @type {any} - */ - locationXBinding:any; - /** - * Gets or sets the binding for determining a node's position on the y-axis. - *

- * This binding maps a business object that represents a node to a number that specifies the y-coordinate of that node. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @type {any} - */ - locationYBinding:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.binding.GraphBuilderBase; - } - /** - * This class is an adapter which populates a {@link yfiles.binding.TreeBuilder#graph} from hierarchical business data. - *

- * The nodes in the tree are determined using the {@link yfiles.binding.TreeBuilder#nodesSource} and {@link yfiles.binding.TreeBuilder#childBinding} properties. Optionally, a collection of group nodes can be - * specified with {@link yfiles.binding.TreeBuilder#groupsSource}. - *

- *

- * Graph items will be visualized using the styles defined in the {@link yfiles.graph.IGraph#nodeDefaults}, {@link yfiles.graph.IGraph#edgeDefaults} and {@link yfiles.graph.IGraph#groupNodeDefaults} property of the {@link yfiles.binding.TreeBuilder#graph}. - *

- *

- * The created {@link yfiles.binding.TreeBuilder#graph} is a directed forest, a set of directed trees. Each directed tree has exactly one root node with no - * incoming edges. For every other node v in a directed tree there is exactly one directed path from the root node of the - * directed tree to node v. - *

- *

- * To assign nodes to groups the {@link yfiles.binding.GraphBuilderBase#groupBinding} has to be defined. Group nodes can be nested using the {@link yfiles.binding.GraphBuilderBase#parentGroupBinding} property. Labels for the edges - * can be defined by setting a suitable {@link yfiles.binding.TreeBuilder#edgeLabelBinding}, which is resolved on the target (child) node. - *

- *

- * This class can be used to {@link yfiles.binding.TreeBuilder#updateGraph update} the {@link yfiles.binding.TreeBuilder#graph} when the underlying collection of the business objects ({@link yfiles.binding.TreeBuilder#nodesSource} and {@link yfiles.binding.TreeBuilder#childBinding}) changes. - *

- * @see yfiles.binding.TreeBuilder#nodesSource - * @see yfiles.binding.TreeBuilder#childBinding - * @class - */ - export interface TreeBuilder extends yfiles.lang.Object{} - export class TreeBuilder { - /** - * Creates a new empty instance using the given graph. - *

- * The graph will be {@link yfiles.graph.IGraph#clear cleared} and re-built from the data in {@link yfiles.binding.TreeBuilder#nodesSource} when {@link yfiles.binding.TreeBuilder#buildGraph} is called. The {@link yfiles.binding.TreeBuilder#childBinding} - * needs to be set in order to actually create a tree. - *

- * @param graph - */ - constructor(graph:yfiles.graph.IGraph); - /** - * Populates the graph instance with items generated from the bound business data. - *

- * First, this method clears the graph, and then it adds new groups, nodes, and edges as specified by the business data and - * bindings. - *

- * @returns The created graph. - * @see yfiles.binding.TreeBuilder#updateGraph - */ - buildGraph():yfiles.graph.IGraph; - /** - * Creates an edge between the source and target node. - * @param graph The graph. - * @param source The source node of the edge. - * @param target The target node of the edge. - * @param labelData The optional label data of the edge if an {@link #edgeLabelBinding} is specified. - * @returns The created edge. - * @protected - */ - createEdge(graph:yfiles.graph.IGraph,source:yfiles.graph.INode,target:yfiles.graph.INode,labelData:any):yfiles.graph.IEdge; - /** - * Creates a new group node and assigns the businessObjectparameter to the group node's {@link yfiles.graph.ITagOwner#tag Tag} property. - * @param graph The graph. - * @param businessObject The business data associated with the group node. - * @returns The created node. - * @protected - */ - createGroupNode(graph:yfiles.graph.IGraph,businessObject:any):yfiles.graph.INode; - /** - * Creates a node with the specified parent and assigns the businessObject parameter to the node's {@link yfiles.graph.ITagOwner#tag Tag} property. - * @param graph The graph. - * @param parent The node's parent node. - * @param location The location of the node. - * @param labelData The optional label data of the node if an {@link #nodeLabelBinding} is specified. - * @param businessObject The business data associated with the node. - * @returns The created node. - * @protected - */ - createNode(graph:yfiles.graph.IGraph,parent:yfiles.graph.INode,location:yfiles.geometry.Point,labelData:any,businessObject:any):yfiles.graph.INode; - /** - * Retrieves the associated business object for a given {@link yfiles.graph.INode node} from the {@link yfiles.binding.TreeBuilder#graph}. - * @param item The node of the graph to get the business object for. - * @returns The business object associated with the graph element. - * @see yfiles.binding.TreeBuilder#getNode - */ - getBusinessObject(item:yfiles.graph.IModelItem):any; - /** - * Retrieves the associated node in the {@link yfiles.binding.TreeBuilder#graph} for a business object from the {@link yfiles.binding.TreeBuilder#nodesSource}. - * @param businessObject A business object from the {@link #nodesSource} to get the node for. - * @returns The node associated with the business object or null for unknown objects. - * @see yfiles.binding.TreeBuilder#getBusinessObject - */ - getNode(businessObject:any):yfiles.graph.INode; - /** - * Updates an edge with the given data. - * @param graph The graph. - * @param edge The edge to update. - * @param source The edge's source node. - * @param target The edge's target node. - * @param labelData The business data associated with the edge. - * @protected - */ - updateEdge(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,source:yfiles.graph.INode,target:yfiles.graph.INode,labelData:any):void; - /** - * Updates the graph instance to fit the bound business data. - *

- * This method can be used to update the graph to fit changed business data. In contrast to - * {@link yfiles.binding.TreeBuilder#buildGraph}, it does not initially clear the graph. Instead, it keeps graph elements that for - * business objects are still present in the data, creates new elements for new data, and removes obsolete elements. - *

- */ - updateGraph():void; - /** - * Updates an existing group node when {@link yfiles.binding.TreeBuilder#updateGraph} is called and the group should remain in the - * graph. - *

- * This class calls this method to create all new groups, and customers may override it to customize group creation. - *

- * @param graph The graph. - * @param groupNode The group node to update. - * @param businessObject The business data associated with the group node. - * @protected - */ - updateGroupNode(graph:yfiles.graph.IGraph,groupNode:yfiles.graph.INode,businessObject:any):void; - /** - * Updates a node with the given data. - * @param graph The graph. - * @param node The node to update. - * @param parent The node's parent node. - * @param location The location of the node. - * @param labelData The optional label data of the edge if an {@link #nodeLabelBinding} is specified. - * @param businessObject The business data associated with the node. - * @protected - */ - updateNode(graph:yfiles.graph.IGraph,node:yfiles.graph.INode,parent:yfiles.graph.INode,location:yfiles.geometry.Point,labelData:any,businessObject:any):void; - /** - * Returns the {@link yfiles.graph.IGraph graph} used by this instance. - * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - /** - * Gets or sets the business objects to be represented as nodes. - *

- * This can either be an array of objects, a plain JavaScript object, or an {@link yfiles.collections.IEnumerable.} containing the objects to be displayed as - * nodes - *

- *

- * Note that it is not necessary to include all nodes in this property, if they can be reached via the - * {@link yfiles.binding.TreeBuilder#childBinding}. In this case it suffices to include all root nodes. - *

- *

- * If the nodes source contains more than just the root nodes, some node sources are visited more than once during the - * construction of the - * {@link yfiles.binding.TreeBuilder#graph}. In order to avoid duplicate nodes, the tree source keeps track of node sources for which nodes have already been - * constructed. - *

- *

- * In case the value of this property is a plain JavaScript object, the object's properties are enumerated with Object.getOwnPropertyNames - * and used as the source for the tree nodes. - *

- * @type {any} - */ - nodesSource:any; - /** - * Gets or sets the business objects to be represented as group nodes of the {@link yfiles.binding.TreeBuilder#graph}. - *

- * This can either be an array of objects, a plain JavaScript object or an {@link yfiles.collections.IEnumerable.} containing the objects to be displayed as group - * nodes. - *

- *

- * In case the value of this property is a plain JavaScript object, the object's properties are enumerated with Object.getOwnPropertyNames - * and used as the source for the graph nodes. - *

- * @type {any} - */ - groupsSource:any; - /** - * Gets or sets the binding for the children of a node. - *

- * This binding maps a business object that represents a node to another business object o which specifies the children of - * this node. Similar to {@link yfiles.binding.GraphBuilderBase#nodesSource}, the object o can either be an array, an {@link yfiles.collections.IEnumerable.}, or a plain JavaScript object and should contain - * business objects that represent nodes. If a {@link yfiles.binding.GraphBuilderBase#nodeIdBinding} is set, these collection should contain the IDs of the objects that - * specifies the nodes instead of the objects themselves. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.GraphBuilderBase#nodesSource - * @type {any} - */ - childBinding:any; - /** - * Gets or sets the node ID binding. - *

- * This binding maps a business object that represents a node to its ID. If this binding is set, node IDs can be used in a - * business object that represents an edge to identify the source node and target node of the corresponding edge. The - * binding should not be changed once the graph is built. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.TreeBuilder#nodesSource - * @type {any} - */ - idBinding:any; - /** - * Gets or sets the edge label binding. - *

- * This binding maps a business object that represents a node to an object that specifies the label data of the incoming - * edge of that node. By default, the label data object must be convertible into a string. This can be customized by - * overriding {@link yfiles.binding.TreeBuilder#createEdge} and {@link yfiles.binding.TreeBuilder#updateEdge}. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @type {any} - */ - edgeLabelBinding:any; - /** - * Gets or sets the node label binding. - *

- * This binding maps a business object that represents a node to an object that specifies the label data of that node. - *

- *

- * By default, the label data object must be convertible into a string. This can be customized by overriding {@link yfiles.binding.TreeBuilder#createNode} - * and {@link yfiles.binding.TreeBuilder#updateNode}. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.TreeBuilder#nodesSource - * @type {any} - */ - nodeLabelBinding:any; - /** - * Gets or sets the binding for determining a node's position on the x-axis. - *

- * This binding maps a business object that represents a node to a number that specifies the x-coordinate of that node. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.TreeBuilder#nodesSource - * @type {any} - */ - locationXBinding:any; - /** - * Gets or sets the binding for determining a node's position on the y-axis. - *

- * This binding maps a business object that represents a node to a number that specifies the y-coordinate of that node. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.TreeBuilder#nodesSource - * @type {any} - */ - locationYBinding:any; - /** - * Gets or sets the group node ID binding. - *

- * This binding maps a business object that represents a group to its ID. If this binding is set, group IDs can be used in - * a business object that represents a node to identify the parent group of the corresponding node. The binding should not - * be changed once the graph is built. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.TreeBuilder#groupsSource - * @type {any} - */ - groupIdBinding:any; - /** - * Gets or sets the group binding. - *

- * This binding maps a business object o1 that represents a group to another object o2 that specifies the parent group of - * o1. If o2 is contained in {@link yfiles.binding.TreeBuilder#groupsSource}, then the node for o1 becomes a child node of the group for o2. - *

- *

- * If a {@link yfiles.binding.TreeBuilder#groupIdBinding} is set, to object o2 should be the ID of the object that specifies the group instead of the object itself. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @see yfiles.binding.TreeBuilder#nodesSource - * @type {any} - */ - groupBinding:any; - /** - * Gets or sets the parent group binding. - *

- * This binding maps a business object o1 that represents a group to another object o2 that specifies the parent group of - * o1. If o2 is contained in {@link yfiles.binding.TreeBuilder#groupsSource}, then the group for o1 becomes a child node of the group for o2. - *

- *

- * If a {@link yfiles.binding.TreeBuilder#groupIdBinding} is set, to object o2 should be the ID of the object that specifies the group instead of the object itself. - *

- *

- * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types - * recursively. A function is called with the business object to convert as first and only parameter, and the function's this - * is set to the business object, too. - *

- * @type {any} - */ - parentGroupBinding:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.binding.TreeBuilder; - } - }export namespace algorithms{ - /** - * This class provides a means for early termination of graph algorithms. - *

- * Instances of this class may be attached to and retrieved from a graph and may receive requests for stopping and - * canceling an algorithm that is currently executed on the given graph. - *

- *

- * Client Code Usage - *

- *

- * An instance of this class can be attached to a graph using method {@link yfiles.algorithms.AbortHandler#createForGraph}. The - * handler's {@link yfiles.algorithms.AbortHandler#stopDuration} and {@link yfiles.algorithms.AbortHandler#cancelDuration} methods can be used to automatically stop or cancel an algorithm after a specified period of time has - * elapsed. Algorithms can check for these requests and handle them appropriately. - *

- *
    - *
  • - * Stop – The algorithm should terminate gracefully, delivering a consistent result. Although the termination will be early, it - * will usually not be immediate. - *
  • - *
  • Cancel – The algorithm should terminate immediately and all work done so far will be discarded.
  • - *
- *

- * If a graph with an attached handler is processed by multiple algorithms (or multiple times by the same algorithm), the - * attached handler has to be {@link yfiles.algorithms.AbortHandler#reset} between algorithm runs. Otherwise, previous requests for - * early termination may lead to an undesired early termination of the next algorithm run. - *

- *

- * Usage in Algorithms - *

- *

- * Algorithms have to retrieve an instance of this class from the graph that is processed using method - * {@link yfiles.algorithms.AbortHandler#getFromGraph}. Then, the algorithm needs to query the retrieved instance of this class for - * stop or cancel requests using method {@link yfiles.algorithms.AbortHandler#check}. - *

- *

- * Alternatively, convenience method {@link yfiles.algorithms.AbortHandler#check} for one-time checks is available. For performance - * critical code that checks repeatedly, it is recommended to follow the first approach, though. - *

- *

- * When handling a stop request, algorithms should ensure that the resulting graph is still in a consistent state. - *

- * @class - */ - export interface AbortHandler extends yfiles.lang.Object{} - export class AbortHandler { - /** - * Creates a new {@link yfiles.algorithms.AbortHandler} instance. - * @see yfiles.algorithms.AbortHandler#stopDuration - * @see yfiles.algorithms.AbortHandler#cancelDuration - * @see yfiles.algorithms.AbortHandler#reset - */ - constructor(); - /** - * Determines whether or not an algorithm should terminate immediately. - *

- * This method returns true if the algorithm should terminate gracefully and ensures that the processed graph remains in a - * consistent state. - *

- * @returns true, if the algorithm should terminate immediately, false otherwise - * @throws {yfiles.algorithms.AlgorithmAbortedError} if the algorithm should terminate immediately - * @see yfiles.algorithms.AbortHandler#stop - */ - check():boolean; - /** - * Determines whether or not an algorithm should terminate immediately. - *

- * This method returns true if the algorithm should terminate gracefully and ensures that the processed graph remains in a - * consistent state. - *

- *

- * This convenience method is meant for one-time checks only. For performance critical code that needs to check repeatedly, - * it is recommended to retrieve the given graph's attached handler once and only call the handler's {@link yfiles.algorithms.AbortHandler#check} - * method repeatedly. - *

- * @param graph - * @returns true, if the algorithm should stop immediately while still providing some valid result, false otherwise - * @throws {yfiles.algorithms.AlgorithmAbortedError} if the algorithm should terminate immediately - * @throws {Stubs.Exceptions.ArgumentError} if the given graph is null - * @see yfiles.algorithms.AbortHandler#check - * @see yfiles.algorithms.AbortHandler#stop - * @static - */ - static check(graph:yfiles.algorithms.Graph):boolean; - /** - * Attaches the {@link yfiles.algorithms.AbortHandler} instance of the given source graph to the target graph as well. - * @param source the graph whose handler is attached to the target graph - * @param target the graph to which the handler of the source graph is attached - * @throws {Stubs.Exceptions.ArgumentError} if the given source is null - * @static - */ - static copyHandler(source:yfiles.algorithms.Graph,target:yfiles.algorithms.Graph):void; - /** - * Creates an {@link yfiles.algorithms.AbortHandler handler} instance and attaches it to the given graph. - *

- * If the given graph has already an attached handler instance, this is the instance that will be returned and this method - * will not create a new {@link yfiles.algorithms.AbortHandler}. - *

- *

- * This method should be called by client code prior to starting a graph algorithm that may be terminated early. - *

- * @param graph the graph to which the handler will be attached - * @returns the {@link } instance for the given graph - * @throws {Stubs.Exceptions.ArgumentError} if the given graph is null. - * @see yfiles.algorithms.AbortHandler#hasHandler - * @static - */ - static createForGraph(graph:yfiles.algorithms.Graph):yfiles.algorithms.AbortHandler; - /** - * Returns an {@link yfiles.algorithms.AbortHandler} instance for the given graph. - *

- * If {@link yfiles.algorithms.AbortHandler#createForGraph} has been used for attaching a new handler to the given graph, this is - * the instance that will be returned. Otherwise, a non-functional instance is returned whose methods do nothing. Use {@link yfiles.algorithms.AbortHandler#hasHandler} - * to check whether or not a handler has been already attached to the given graph. - *

- * @param graph the given graph - * @returns an {@link } for the given graph or a non-functional instance if no handler has been previously - * created - * @throws {Stubs.Exceptions.ArgumentError} if the given graph is null - * @see yfiles.algorithms.AbortHandler#createForGraph - * @see yfiles.algorithms.AbortHandler#hasHandler - * @static - */ - static getFromGraph(graph:yfiles.algorithms.Graph):yfiles.algorithms.AbortHandler; - /** - * Determines whether or not an {@link yfiles.algorithms.AbortHandler} instance is attached to the given graph. - * @param graph the given graph - * @returns true if a handler is attached to the given graph, false otherwise - * @throws {Stubs.Exceptions.ArgumentError} if the given graph is null - * @static - */ - static hasHandler(graph:yfiles.algorithms.Graph):boolean; - /** - * Removes any attached {@link yfiles.algorithms.AbortHandler} instance from the given graph. - * @param graph the given graph - * @throws {Stubs.Exceptions.ArgumentError} if the given graph is null. - * @static - */ - static removeFromGraph(graph:yfiles.algorithms.Graph):void; - /** - * Resets the state of the {@link yfiles.algorithms.AbortHandler handler}. - *

- * Resetting the {@link yfiles.algorithms.AbortHandler handler} discards any previous stop or cancel requests. Moreover, the handler's internal timestamp that is - * used for determining whether or not an algorithm should be stopped or cancelled automatically is reset as well. - *

- *

- * This method should be called whenever a graph with an attached handler is processed an additional time to prevent - * previous requests for early termination to result in an undesired early termination of the next algorithm run. - *

- * @see yfiles.algorithms.AbortHandler#cancelDuration - * @see yfiles.algorithms.AbortHandler#stopDuration - */ - reset():void; - /** - * Schedules a stop request. - *

- * Algorithms that detect stop requests should terminate gracefully and ensure that the processed graph remains in a - * consistent state. - *

- *

- * If a Cancel request has already been scheduled for this handler, the stop request is ignored. If a Cancel request is - * scheduled later on, the stop request is overridden. - *

- * @see yfiles.algorithms.AbortHandler#check - * @see yfiles.algorithms.AbortHandler#cancelDuration - */ - stop():void; - /** - * Determines the remaining time (in milliseconds) until an algorithm that {@link yfiles.algorithms.AbortHandler#check checks} this handler is cancelled automatically. - * @returns the remaining time until the algorithm is cancelled automatically. - * @see yfiles.algorithms.AbortHandler#cancelDuration - * @see yfiles.algorithms.AbortHandler#reset - * @see yfiles.algorithms.AbortHandler#cancelDuration - */ - timeToCancel():yfiles.lang.TimeSpan; - /** - * Determines the remaining time until an algorithm that {@link yfiles.algorithms.AbortHandler#check checks} this handler is stopped automatically. - *

- * If the {@link yfiles.algorithms.AbortHandler#stopDuration stop duration} is less than or equal to zero, -1 will be returned which means that the algorithm may run - * unrestricted. - *

- * @returns the remaining time until the algorithm is stopped automatically or -1 if the algorithm may run unrestricted - * @see yfiles.algorithms.AbortHandler#stopDuration - * @see yfiles.algorithms.AbortHandler#reset - * @see yfiles.algorithms.AbortHandler#stop - */ - timeToStop():yfiles.lang.TimeSpan; - /** - * Data provider key for attaching an AbortHandler instance to a graph - *

- * Only instances of {@link yfiles.algorithms.AbortHandler} should be assigned to this {@link yfiles.algorithms.IDataProvider}, otherwise a - * {@link yfiles.lang.Exception} will occur. Layout algorithms will use the attached handler to check for requests to cancel or - * stop the layout process. - *

- * @const - * @static - * @type {yfiles.algorithms.GraphDpKey.} - */ - static ABORT_HANDLER_DP_KEY:yfiles.algorithms.GraphDpKey; - /** - * Returns whether or not a stop request was scheduled explicitly with the {@link yfiles.algorithms.AbortHandler#stop} method. - * @type {boolean} - */ - stopRequested:boolean; - /** - * Gets or sets the duration an algorithm may run before being stopped automatically. - *

- * An algorithm is terminated gracefully, if the time in between {@link yfiles.algorithms.AbortHandler creating} or {@link yfiles.algorithms.AbortHandler#reset resetting} this handler and calling {@link yfiles.algorithms.AbortHandler#check} - * exceeds the stop duration. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the duration is negative - * @see yfiles.algorithms.AbortHandler#timeToStop - * @see yfiles.algorithms.AbortHandler#reset - * @see yfiles.algorithms.AbortHandler#stop - * @type {yfiles.lang.TimeSpan} - */ - stopDuration:yfiles.lang.TimeSpan; - /** - * Gets or sets the duration an algorithm may run before being cancelled automatically. - *

- * An algorithm is terminated immediately, if the time in between {@link yfiles.algorithms.AbortHandler creating} or {@link yfiles.algorithms.AbortHandler#reset resetting} this handler and calling {@link yfiles.algorithms.AbortHandler#check} - * exceeds the cancel duration. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the duration is negative - * @see yfiles.algorithms.AbortHandler#reset - * @see yfiles.algorithms.AbortHandler#cancelDuration - * @type {yfiles.lang.TimeSpan} - */ - cancelDuration:yfiles.lang.TimeSpan; - /** - * Gets whether or not methods {@link yfiles.algorithms.AbortHandler#check} or {@link yfiles.algorithms.AbortHandler#check} were called - * after a stop or cancel event. - *

- * More precisely, it returns true if one of the check methods either threw an {@link yfiles.lang.Exception} or returned true to - * indicate that the calling algorithm should terminate gracefully. Otherwise, this method returns false. - *

- * @see yfiles.algorithms.AbortHandler#check - * @see yfiles.algorithms.AbortHandler#check - * @type {boolean} - */ - checkFailed:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.AbortHandler; - } - /** - * This class provides services that center around breadth first search (BFS). - *

- * Breadth first search starts at a given set of nodes and explores the neighboring nodes first, before visiting the next - * level neighbors. - *

- *

- * A breadth first search run can be either directed or undirected. All methods require a list of nodes that are considered - * as the core nodes from which the breadth first search starts. These nodes can be identified either with a {@link yfiles.algorithms.NodeList} - * or with a {@link yfiles.algorithms.IDataProvider} that returns true for core nodes and false for all other nodes. The output is - * given as an array of {@link yfiles.algorithms.NodeList}s each of which contains the nodes of a particular layer. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":0},"n":[[-35,-35,1,[[-25.34,-10.65,10.67,18.7,"0"]]],[-35,85,[[-25.34,109.35,10.67,18.7,"1"]]],[85,-35,[[94.66,-10.65,10.67,18.7,"1"]]],[85,85,[[94.66,109.35,10.67,18.7,"2"]]],[205,-35,[[214.66,-10.65,10.67,18.7,"3"]]],[205,85,[[214.66,109.35,10.67,18.7,"4"]]]],"e":[[4,3],[2,0],[0,1],[1,3],[2,3],[4,5]],"vp":[-35.0,-35.0,270.0,150.0]}} Example for a BFS run. The marked node is the core node from which BFS starts while node labels indicate the resulting - * layers. - *

- * @class - * @static - */ - export interface Bfs extends yfiles.lang.Object{} - export class Bfs { - /** - * Returns the layers of nodes constructed by a directed/undirected breadth first search where the maximum number of layers - * is restricted. - *

- * The first of these layers contains all nodes within the given {@link yfiles.algorithms.NodeList}. These nodes are the core nodes - * from which a breadth first search to the other nodes starts. The algorithm fills the provided {@link yfiles.algorithms.INodeMap} - * with an integer indicating the layer of each node. - *

- *

- * In the i-th layer are previously unassigned nodes that are connected to nodes in the (i-1)-th layer. - *

- * @param graph the given graph - * @param coreNodes the list of core nodes - * @param direction one of the predefined direction specifiers - * @param layerIDMap the {@link } that will be filled during the BFS execution and holds the zero-based index of the BFS - * layer to which each node belongs or -1 if the node is not reachable - * @param [maxLayers=0] the number of layers that will be returned or 0 if all layers are required - * @returns an array of {@link }s each of which contains the nodes of a particular layer - * @throws {Stubs.Exceptions.ArgumentError} if the given direction is not supported - * @static - */ - static getLayers(graph:yfiles.algorithms.Graph,coreNodes:yfiles.algorithms.NodeList,direction:yfiles.algorithms.BfsDirection,layerIDMap:yfiles.algorithms.INodeMap,maxLayers?:number):yfiles.algorithms.NodeList[]; - /** - * Returns the layers of nodes constructed by a directed/undirected breadth first search where the maximum number of layers - * is restricted. - *

- * The first of these layers contains all nodes within the given {@link yfiles.algorithms.NodeList}. These nodes are the core nodes - * from which either a directed or undirected breadth first search to the other nodes starts. The algorithm fills the - * provided {@link yfiles.algorithms.INodeMap} with an integer indicating the layer of each node. - *

- *

- * In the i-th layer are previously unassigned nodes that are connected to nodes in the (i-1)-th layer. - *

- * @param graph the given graph - * @param coreNodes the list of core nodes from which the BFS starts - * @param directed true if the graph should be considered directed, false otherwise - * @param layerIDMap the {@link } that will be filled during the BFS execution and holds the zero-based index of the BFS - * layer to which each node belongs or -1 if the node is not reachable - * @param [maxLayers=0] the number of layers that will be returned or 0 if all layers are required - * @returns an array of {@link }s each of which contains the nodes of a particular layer - * @static - */ - static getLayers(graph:yfiles.algorithms.Graph,coreNodes:yfiles.algorithms.NodeList,directed:boolean,layerIDMap:yfiles.algorithms.INodeMap,maxLayers?:number):yfiles.algorithms.NodeList[]; - /** - * Returns the layers of nodes constructed by a breadth first search. - *

- * The first of these layers contains all nodes within the given {@link yfiles.algorithms.NodeList}. These nodes are the core nodes - * from which an undirected breadth first search to the other nodes starts. The algorithm fills the provided {@link yfiles.algorithms.INodeMap} - * with an integer indicating the layer of each node. - *

- *

- * In the i-th layer are previously unassigned nodes that are connected to nodes in the (i-1)-th layer. - *

- * @param graph the given graph - * @param coreNodes the list of core nodes from which the BFS starts - * @param layerIDMap the {@link } that will be filled during the BFS execution and holds the zero-based index of the BFS - * layer to which each node belongs or -1 if the node is not reachable - * @returns an array of {@link }s each of which contains the nodes of a particular layer - * @static - */ - static getLayers(graph:yfiles.algorithms.Graph,coreNodes:yfiles.algorithms.NodeList,layerIDMap:yfiles.algorithms.INodeMap):yfiles.algorithms.NodeList[]; - /** - * Returns the layers of nodes constructed by a breadth first search. - *

- * The first of these layers contains all nodes for which the given {@link yfiles.algorithms.IDataProvider} returns true. These - * nodes are the core nodes from which an undirected breadth first search to the other nodes starts. The algorithm fills - * the provided {@link yfiles.algorithms.INodeMap} with an integer indicating the layer of each node. - *

- *

- * In the i-th layer are previously unassigned nodes that are connected to nodes in the (i-1)-th layer. - *

- * @param graph the given graph - * @param isCoreNode the {@link } that contains the nodes from which the BFS starts; core nodes are marked with a true - * value - * @param layerIDMap the {@link } that will be filled during the BFS execution and holds the zero-based index of the BFS - * layer to which each node belongs or -1 if the node is not reachable - * @returns an array of {@link }s each of which contains the nodes of a particular layer - * @static - */ - static getLayers(graph:yfiles.algorithms.Graph,isCoreNode:yfiles.algorithms.IDataProvider,layerIDMap:yfiles.algorithms.INodeMap):yfiles.algorithms.NodeList[]; - /** - * Returns the layers of nodes calculated by a breadth first search. - *

- * The first of these layers contains all nodes within the given - * {@link yfiles.algorithms.NodeList}. These nodes are the core nodes from which an undirected breadth first search to the other - * nodes starts. - *

- *

- * In the i-th layer are previously unassigned nodes that are connected to nodes in the (i-1)-th layer. - *

- * @param graph the given graph - * @param coreNodes the list of core nodes from which the BFS starts - * @returns an array of {@link }s each of which contains the nodes of a particular layer - * @static - */ - static getLayers(graph:yfiles.algorithms.Graph,coreNodes:yfiles.algorithms.NodeList):yfiles.algorithms.NodeList[]; - /** - * Returns the layers of nodes constructed by a breadth first search. - *

- * The first of these layers contains all nodes for which the given {@link yfiles.algorithms.IDataProvider} returns - * true. These nodes are the core nodes from which an undirected breadth first search to the other nodes starts. - *

- *

- * In the i-th layer are previously unassigned nodes that are connected to nodes in the (i-1)-th layer. - *

- * @param graph the given graph - * @param isCoreNode the {@link } that contains the nodes from which the BFS starts; core nodes are marked with a true - * value - * @returns an array of {@link }s each of which contains the nodes of a particular layer - * @static - */ - static getLayers(graph:yfiles.algorithms.Graph,isCoreNode:yfiles.algorithms.IDataProvider):yfiles.algorithms.NodeList[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Bfs; - } - /** - * This class provides methods to determine whether a graph is bipartite and to obtain the corresponding partitions. - *

- * A bipartite graph is a graph whose nodes can be partitioned into two sets such that each edges connects two nodes of different - * sets. In other words, there are no edges connecting nodes that belong to the same partition. - *

- *

- * The two sets/partitions are represented by two {@link any} constants i.e., {@link yfiles.algorithms.Bipartitions#RED} or - * {@link yfiles.algorithms.Bipartitions#BLUE}. - *

- *

- * {@graph {"ann":{"s":[40,40],"d":0, "b":0},"styles":{"6":{"c":1, "b":0}},"n":[[365,205,6],[365,305,6],[365,405,6],[505,205],[505,305],[505,405]],"e":[[0,4],[0,3],[0,5],[1,4],[2,3],[2,5],[1,5]],"vp":[365.0,200.0,170.0,250.0]}} Example of a bipartite graph. Circular and rectangular nodes represent the two partitions. - *

- * @class - * @static - */ - export interface Bipartitions extends yfiles.lang.Object{} - export class Bipartitions { - /** - * Calculates a bipartition of the given graph, if one exists. - *

- * If the graph is bipartite, then for all nodes of the given graph either {@link yfiles.algorithms.Bipartitions#RED} or {@link yfiles.algorithms.Bipartitions#BLUE} - * objects will be set in the given {@link yfiles.algorithms.INodeMap}, depending on the partition to which each node belongs. - *

- * @param graph the given graph - * @param markMap the {@link } that will be filled during the BFS execution and returns the partition (either {@link #RED} - * or {@link #BLUE}) to which each node belongs - * @returns true if the graph is bipartite, false otherwise - * @static - */ - static getBipartition(graph:yfiles.algorithms.Graph,markMap:yfiles.algorithms.INodeMap):boolean; - /** - * Determines whether or not the given graph is bipartite. - * @param graph the given graph - * @returns true if the graph is bipartite, false otherwise - * @static - */ - static isBipartite(graph:yfiles.algorithms.Graph):boolean; - /** - * A constant for marking a node that belongs to the red partition. - * @const - * @static - * @type {any} - */ - static RED:any; - /** - * A constant for marking a node that belongs to the blue partition. - * @const - * @static - * @type {any} - */ - static BLUE:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Bipartitions; - } - /** - * This class provides methods to determine various centrality indices of nodes or edges of a graph. - *

- * Centrality indices serve to quantify an intuitive feeling that in most networks some nodes or edges are "more central" - * than others. The provided methods assign a double value to each node or edge of a graph that represents its centrality. - * The higher an assigned value, the more central the element is considered by the algorithm. - *

- *

- * Also, this class provides convenience methods that normalize the returned centrality values such that they lie within - * the interval [0,1]. - *

- *

- * Definitions - *

- *
    - *
  • Betweenness centrality is a measure for how often a node/edge lies on a shortest path between each pair of nodes in the graph.
  • - *
  • Closeness centrality is the reciprocal of the sum of shortest path distances of a node to all other nodes in the graph.
  • - *
  • Graph centrality is the reciprocal of the maximum of all shortest path distances from a node to all other nodes in the graph.
  • - *
  • - * Degree centrality is the number of the incoming, outgoing or overall edges incident to a node (measures incoming, outgoing and overall - * degree). - *
  • - *
  • Weight centrality measures the weight associated with incoming, outgoing, or all edges of a node.
  • - *
- * @class - * @static - */ - export interface Centrality extends yfiles.lang.Object{} - export class Centrality { - /** - * Computes the closeness centrality for the nodes of a graph. - *

- * Closeness centrality is defined as the reciprocal of the sum of shortest path distances of a node to all other nodes in the graph. - * Therefore, a node with high closeness centrality has short distances to all other nodes of a graph. If the sum of the - * shortest path distances is 0, the closeness of a node is set to {@link number#POSITIVE_INFINITY}. - *

- * @param graph the input graph - * @param closeness the {@link } that will be filled during the execution and returns a double value (centrality) for each - * node - * @param directed true if the graph should be considered as directed, false otherwise - * @param edgeCosts the {@link } that returns a positive double value (cost) or null if the edges are of equal cost - * @static - */ - static closenessCentrality(graph:yfiles.algorithms.Graph,closeness:yfiles.algorithms.INodeMap,directed:boolean,edgeCosts:yfiles.algorithms.IDataProvider):void; - /** - * Computes the degree centrality for the nodes of a given graph. - *

- * Degree centrality is the number of the incoming, outgoing or overall edges incident to a node (measures incoming, outgoing and overall - * degree). - *

- * @param graph the input graph - * @param centrality the {@link } that will be filled during the execution and returns a double value (centrality) for each - * node - * @param considerInEdges true if the incoming edges should be considered, false otherwise - * @param considerOutEdges true if the outgoing edges should be considered, false otherwise - * @static - */ - static degreeCentrality(graph:yfiles.algorithms.Graph,centrality:yfiles.algorithms.INodeMap,considerInEdges:boolean,considerOutEdges:boolean):void; - /** - * Computes betweenness centrality for each edge of a given graph. - *

- * Betweenness centrality is a measure for how often an edge lies on a shortest path between each pair of nodes in the graph. Removing a central - * edge will cause many shortest paths to change. - *

- * @param graph the input graph - * @param centrality the {@link } that will be filled during the execution and returns a double value (centrality) for each - * edge - * @param directed true if the graph should be considered as directed, false otherwise - * @param edgeCosts the {@link } that returns a positive double value (cost) or null if the edges are of equal cost; - * for invalid input values the algorithm uses cost 1.0 - * @static - */ - static edgeBetweenness(graph:yfiles.algorithms.Graph,centrality:yfiles.algorithms.IEdgeMap,directed:boolean,edgeCosts:yfiles.algorithms.IDataProvider):void; - /** - * Computes the graph centrality for the nodes of a graph. - *

- * Graph centrality is defined as the reciprocal of the maximum of all shortest path distances from a node to all other nodes in the graph. - * Nodes with high graph centrality have short distances to all other nodes in the graph. - *

- * @param graph the input graph - * @param centrality the {@link } that will be filled during the execution and returns a double value (centrality) for each - * node - * @param directed true if the graph should be considered as directed, false otherwise - * @param edgeCosts the {@link } that returns a positive double value (cost) or null if the edges are of equal cost - * @static - */ - static graphCentrality(graph:yfiles.algorithms.Graph,centrality:yfiles.algorithms.INodeMap,directed:boolean,edgeCosts:yfiles.algorithms.IDataProvider):void; - /** - * Computes betweenness centrality for each node of a given graph. - *

- * Betweenness centrality is a measure for how often a node lies on a shortest path between each pair of nodes in the graph. Removing a central - * edge will cause many shortest paths to change. - *

- * @param graph the input graph - * @param centrality the {@link } that will be filled during the execution and returns a double value (centrality) for each - * node - * @param directed true if the graph should be considered as directed, false otherwise - * @param edgeCosts the {@link } that returns a positive double value (cost) or null if the edges are of equal cost; - * for invalid input values the algorithm uses cost 1.0 - * @static - */ - static nodeBetweenness(graph:yfiles.algorithms.Graph,centrality:yfiles.algorithms.INodeMap,directed:boolean,edgeCosts:yfiles.algorithms.IDataProvider):void; - /** - * Computes betweenness centrality for each node and edge of a given graph. - *

- * Betweenness centrality is a measure for how often a node/edge lies on a shortest path between each pair of nodes in the graph. Removing a - * central node/edge will cause many shortest paths to change. - *

- * @param graph the input graph - * @param nodeCentrality the {@link } that will be filled during the execution and returns a double value (centrality) for each - * node - * @param edgeCentrality the {@link } that will be filled during the execution and returns a double value (centrality) for each - * edge - * @param directed true if the graph should be considered as directed, false otherwise - * @param edgeCosts the {@link } that returns a positive double value (cost) or null if the edges are of equal cost; - * for invalid input values the algorithm uses cost 1.0 - * @static - */ - static nodeEdgeBetweenness(graph:yfiles.algorithms.Graph,nodeCentrality:yfiles.algorithms.INodeMap,edgeCentrality:yfiles.algorithms.IEdgeMap,directed:boolean,edgeCosts:yfiles.algorithms.IDataProvider):void; - /** - * Normalizes the double values of a given {@link yfiles.algorithms.IEdgeMap} by dividing each of them by the maximum of all values - * (maximum norm). - * @param graph the input graph - * @param map the {@link } that will be filled during the execution and returns a double value from [0,1] interval - * @static - */ - static normalizeEdgeMap(graph:yfiles.algorithms.Graph,map:yfiles.algorithms.IEdgeMap):void; - /** - * Normalizes the double values of a given {@link yfiles.algorithms.INodeMap} by dividing each of them by the maximum of all values - * (maximum norm). - * @param graph the input graph - * @param map the {@link } that will be filled during the execution and returns a double value from [0,1] interval - * @static - */ - static normalizeNodeMap(graph:yfiles.algorithms.Graph,map:yfiles.algorithms.INodeMap):void; - /** - * Computes the weight centrality for the nodes of a graph. - *

- * Weight centrality measures the weight associated with incoming, outgoing, or all edges of a node. - *

- * @param graph the input graph - * @param centrality the {@link } that will be filled during the execution and returns a double value (centrality) for each - * node - * @param considerInEdges true if the incoming edges should be considered, false otherwise - * @param considerOutEdges true if the outgoing edges should be considered, false otherwise - * @param edgeWeights the {@link } that returns a positive double value (weight) or null if the edges are considered to - * have uniform weight of 1.0 - * @static - */ - static weightCentrality(graph:yfiles.algorithms.Graph,centrality:yfiles.algorithms.INodeMap,considerInEdges:boolean,considerOutEdges:boolean,edgeWeights:yfiles.algorithms.IDataProvider):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Centrality; - } - /** - * This class is responsible for finding cycles within a graph that have certain properties. - *

- * Definitions - *

- *
    - *
  • - * An edge path with vertices v0, v1, v2, ... , vk (with k > 0 and (vi-1,vi), 0 < i <= k is edge of the given graph) is - * called simple if no vertex appears more than once. - *
  • - *
  • An edge path forms a cycle if v0 = vk.
  • - *
  • A cycle is called simple if no vertex appears more than once.
  • - *
  • A graph that contains no cycles is called acyclic.
  • - *
- *

- * {@graph {"ann":{"s":[30,30],"d":1, "c":1},"n":[[45,5],[105,65],[-15,65],[45,125],[185,65],[-95,65]],"e":[[0,1],[0,2],[1,3],[2,3],[1,4],[2,5]],"vp":[-95.0,5.0,310.0,150.0]}} Example of an acyclic directed graph (edge directions are considered) {@graph {"ann":{"s":[30,30],"d":1, "c":1},"n":[[305,185],[385,125],[345,285],[505,125],[545,225],[465,305]],"e":[[0,1],[1,3],[4,5,1],[5,2,1],[2,0,1],[0,4,1]],"vp":[305.0,125.0,270.0,210.0]}} Example of a graph containing a cycle. Marked - * edges form a directed cycle. - *

- * @class - * @static - */ - export interface Cycles extends yfiles.lang.Object{} - export class Cycles { - /** - * Returns an {@link yfiles.algorithms.EdgeList} that contains all the edges that are part of at least one directed or undirected - * simple cycle. - * @param graph the input graph - * @param directed true if the graph should be considered directed, false otherwise - * @returns an {@link } that contains all the edges that are part of at least one directed or undirected simple - * cycle - * @static - */ - static findAllCycleEdges(graph:yfiles.algorithms.Graph,directed:boolean):yfiles.algorithms.EdgeList; - /** - * Returns an {@link yfiles.algorithms.EdgeList} that contains the edges of a cycle found in the given graph. - *

- * The edges are returned in the order they appear in the detected cycle. - *

- *

- * If the returned cycle is empty, no cycle has been found in the given graph. - *

- * @param graph the given graph - * @param directed true if the graph should be considered directed, false otherwise - * @returns an {@link } containing the edges of a cycle or an empty {@link } if the graph is - * acyclic - * @static - */ - static findCycle(graph:yfiles.algorithms.Graph,directed:boolean):yfiles.algorithms.EdgeList; - /** - * Marks the edges of a given graph whose removal or reversal would make the graph acyclic while trying to minimize the - * cost associated with the marked edges. - *

- * This minimization is performed heuristically, since it is a well known hard problem to come up with an optimal - * solution. - *

- *

- * The costs are assigned using a {@link yfiles.algorithms.IDataProvider} that holds a non-negative double value for each edge. - *

- * @param graph the given graph - * @param cycleEdges the {@link } that will be filled during the execution and returns whether an edge is a detected cycle - * edge - * @param [costDP=null] the {@link } that holds the non-negative {@link } reversal cost for each edge - * @static - */ - static findCycleEdges(graph:yfiles.algorithms.Graph,cycleEdges:yfiles.algorithms.IEdgeMap,costDP?:yfiles.algorithms.IDataProvider):void; - /** - * Marks the edges of a given graph whose removal or reversal would make the graph acyclic based on a depth first search. - *

- * The number of marked cycle edges is expected to be slightly greater than when using - * {@link yfiles.algorithms.Cycles#findCycleEdges}. The advantage of this method is that the result set is more stable when edges - * are added or removed over time. - *

- * @param graph the given graph - * @param cycleEdges the {@link } that will be filled during the execution and returns a boolean value indicating whether - * or not an edge is a detected cycle edge - * @static - */ - static findCycleEdgesDFS(graph:yfiles.algorithms.Graph,cycleEdges:yfiles.algorithms.IEdgeMap):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Cycles; - } - /** - * Represents a dart of a face of a {@link yfiles.algorithms.PlanarEmbedding}. - *

- * For each edge there exist two darts, one that represents the edge in its original direction (i.e., from source to - * target) and one that represents its reverse. Each dart is associated with a {@link yfiles.algorithms.Dart#face face}. - *

- * @class - * @final - */ - export interface Dart extends yfiles.lang.Object{} - export class Dart { - /** - * Gets the edge associated with this dart. - * @type {yfiles.algorithms.Edge} - */ - associatedEdge:yfiles.algorithms.Edge; - /** - * Gets whether this dart represents the original edge or its reverse. - * @type {boolean} - */ - reversed:boolean; - /** - * Gets the opposite dart. - *

- * The opposite dart is associated with the same edge as this dart but with a different {@link yfiles.algorithms.Dart#reversed direction}. - *

- * @type {yfiles.algorithms.Dart} - */ - oppositeDart:yfiles.algorithms.Dart; - /** - * Gets the face list associated with this dart. - * @type {yfiles.collections.IList.} - */ - face:yfiles.collections.IList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Dart; - } - /** - * Framework class for implementing depth first search (DFS) based algorithms. - *

- * A depth first search starts from a specified node and traverses the neighbors within a branch as deeply as possible - * (i.e., without visiting any vertex twice) before backtracking. - *

- *

- * A depth first search traversal induces a DFS forest that may consist of more than one DFS tree. Based on these trees, - * the edges are divided into four categories (see example): - *

- *
    - *
  • Tree Edges: The edges of the DFS forest.
  • - *
  • Back edges: Non-tree edges that connect nodes with their ancestors in the DFS tree. Self-loops are also considered as back edges.
  • - *
  • Forward edges: Edges that connect nodes of the DFS tree to one of their descendants.
  • - *
  • Cross edges: All other edges.
  • - *
- *

- * During a DFS run each node of the graph can be in one of the following states: - *

- *
    - *
  • Undiscovered: A node that has not been visited yet.
  • - *
  • - * Discovered but not finished: A node that has been already visited, but has not been completed yet, i.e. it is still part of an active path of the - * DFS tree. - *
  • - *
  • - * Finished: A node that has been completed, i.e. it has been visited before and is not part of an active path of the DFS tree - * anymore. - *
  • - *
- *

- * Graph algorithms, which are based on a depth first search, can extend this class and override appropriate callback - * methods provided by this class. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1, "c":1},"styles" : {"6" : {"s" : "#000000", "d" : 1, "l" : [3] }, "7" : {"s" : "#000000", "d" : 1, "l" : [1,4] }, "8" : {"s" : "#000000", "d" : 1, "l" : [7] }},"n":[[145,-15,[[154.66,9.35,10.67,18.7,"1"]]],[65,65,[[74.66,89.35,10.67,18.7,"2"]]],[185,65,[[194.66,89.35,10.67,18.7,"8"]]],[45,225,[[54.66,249.35,10.67,18.7,"5"]]],[125,145,[[134.66,169.35,10.67,18.7,"7"]]],[65,145,[[74.66,169.35,10.67,18.7,"6"]]],[-35,225,[[-25.34,249.35,10.67,18.7,"4"]]],[5,145,[[14.66,169.35,10.67,18.7,"3"]]],[185,145,[[194.66,169.35,10.67,18.7,"9"]]]],"e":[[0,1],[1,7],[0,2],[7,3],[1,4],[1,5],[7,6],[2,1,6,[],[[118.33,72.85,35.34,18.7,"Cross"]]],[6,1,8,[-60,100,-60,100],[[-95.2,149.04,30.68,18.7,2.4492935982947064E-16,-1.0,"Back"]]],[0,3,7,[360,140],[[270.38,202.85,48.01,18.7,2.4492935982947064E-16,-1.0,"Forward"]]],[2,8]],"vp":[-96.0,-15.0,456.0,270.0]}} Example of a DFS traversal. Node labels indicate the order in which nodes are visited. Solid edges are the edges of the - * DFS tree while dashed edges represent back, forward and cross edges. - *

- * @class - */ - export interface Dfs extends yfiles.lang.Object{} - export class Dfs { - /** - * Creates a new {@link yfiles.algorithms.Dfs} instance with default settings. - */ - constructor(); - /** - * Cancels the depth first search. - *

- * It may be overridden to support custom implementations. - *

- */ - cancel():void; - /** - * Callback method that will be invoked whenever DFS continues its search at a new root node. - *

- * By default, this method does nothing. It may be overridden to support custom implementations. - *

- * @param v the new root node - * @protected - */ - lookFurther(v:yfiles.algorithms.Node):void; - /** - * Callback method that will be invoked after the DFS has returned from the given node. - *

- * By default, this method does nothing. It may be overridden to support custom implementations. - *

- * @param edge the given edge - * @param node the node that has been reached via the given edge - * @protected - */ - postTraverse(edge:yfiles.algorithms.Edge,node:yfiles.algorithms.Node):void; - /** - * Callback method that will be invoked whenever a node visit has been completed. - *

- * By default, this method does nothing. It may be overridden to support custom implementations. - *

- * @param node the given node - * @param dfsNumber the DFS number of the given node - * @param compNumber the completion number of the given node - * @protected - */ - postVisit(node:yfiles.algorithms.Node,dfsNumber:number,compNumber:number):void; - /** - * Callback method that will be invoked if the given edge will be considered the first (and only) time during the DFS. - *

- * By default, this method does nothing. It may be overridden to support custom implementations. - *

- * @param edge the given edge - * @param node the node to be visited next only if treeEdge == true - * @param treeEdge true if the node will be visited, false otherwise - * @protected - */ - preTraverse(edge:yfiles.algorithms.Edge,node:yfiles.algorithms.Node,treeEdge:boolean):void; - /** - * Callback method that will be invoked whenever a formerly unvisited node gets visited for the first time. - *

- * By default, this method does nothing. It may be overridden to support custom implementations. - *

- * @param node the given node - * @param dfsNumber the DFS number of the given node - * @protected - */ - preVisit(node:yfiles.algorithms.Node,dfsNumber:number):void; - /** - * Starts a depth first search from a given {@link yfiles.algorithms.Node} of the input graph. - * @param graph the input graph - * @param start the given start node - */ - start(graph:yfiles.algorithms.Graph,start:yfiles.algorithms.Node):void; - /** - * Starts a depth first search on the given graph. - *

- * The first node of the graph will be visited first. - *

- * @param graph the input graph - */ - start(graph:yfiles.algorithms.Graph):void; - /** - * A {@link yfiles.algorithms.INodeMap} that holds for each {@link yfiles.algorithms.Node} an {@link any} indicating the current state of the given - * node as it is visited by this algorithm. - *

- * Each node will be assigned one of the {@link yfiles.algorithms.Dfs#WHITE WHITE}, {@link yfiles.algorithms.Dfs#GRAY GRAY} or {@link yfiles.algorithms.Dfs#BLACK BLACK} objects that describe the state of the nodes. - *

- * @protected - * @type {yfiles.algorithms.INodeMap} - */ - stateMap:yfiles.algorithms.INodeMap; - /** - * A constant indicating a node has not been visited yet. - * @protected - * @const - * @static - * @type {any} - */ - static WHITE:any; - /** - * A constant indicating a node has already been visited, but has not been completed yet. - *

- * Such a node is still part of an active path of the DFS tree. - *

- * @protected - * @const - * @static - * @type {any} - */ - static GRAY:any; - /** - * A constant indicating a node has been completed. - *

- * Such a node has been visited before and is no longer part of an active path of the DFS tree. - *

- * @protected - * @const - * @static - * @type {any} - */ - static BLACK:any; - /** - * Sets whether or not to interpret the edges of the graph as directed. - * @type {boolean} - */ - directedMode:boolean; - /** - * Sets whether or not to continue the depth first search after all nodes reachable from the first node have been visited. - * @type {boolean} - */ - lookFurtherMode:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Dfs; - } - /** - * This is the base class of all look-up keys that are used to register {@link yfiles.algorithms.IDataProvider} with a - * {@link yfiles.algorithms.Graph}. - * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. - * @see yfiles.algorithms.Graph#addDataProvider - * @see yfiles.algorithms.Graph#getDataProvider - * @see yfiles.algorithms.Graph#removeDataProvider - * @class - * @template TValue - */ - export interface DpKeyBase extends yfiles.lang.Object{} - export class DpKeyBase { - /** - * Initializes a new instance of the {@link yfiles.algorithms.DpKeyBase.} class. - * @param valueType The type of the values that are returned by the {@link } registered with this class. - * @param declaringType Type that declares this key. - * @param name The name of this key. - */ - constructor(valueType:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); - /** - * Returns whether this key is equal to the specified other. - * @param other The other key to compare with this instance. - * @returns true if the specified key is equal to this instance; otherwise, false. - * @protected - */ - equalsCore(other:yfiles.algorithms.DpKeyBase):boolean; - /** - * Gets the type that declares this key. - * @type {yfiles.lang.Class} - */ - declaringType:yfiles.lang.Class; - /** - * Gets the name of this key. - * @type {string} - */ - name:string; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.DpKeyBase; - } - /** - * This class is used as look-up key for registering {@link yfiles.algorithms.IDataProvider} for {@link yfiles.algorithms.Edge}s with a - * {@link yfiles.algorithms.Graph}. - * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. - * @see yfiles.algorithms.Graph#addDataProvider - * @see yfiles.algorithms.Graph#getDataProvider - * @see yfiles.algorithms.Graph#removeDataProvider - * @class - * @extends {yfiles.algorithms.DpKeyBase.} - * @template TValue - */ - export interface EdgeDpKey extends yfiles.algorithms.DpKeyBase{} - export class EdgeDpKey { - /** - * Initializes a new instance of the {@link yfiles.algorithms.EdgeDpKey.} class. - * @param valueType The type of the values that are returned by the {@link } registered with this class. - * @param declaringType Type that declares this key. - * @param name The name of this key. - */ - constructor(valueType:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.EdgeDpKey; - } - /** - * This class is used as look-up key for registering {@link yfiles.algorithms.IDataProvider} for the {@link yfiles.algorithms.Graph} itself - * with a graph. - * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. - * @see yfiles.algorithms.Graph#addDataProvider - * @see yfiles.algorithms.Graph#getDataProvider - * @see yfiles.algorithms.Graph#removeDataProvider - * @class - * @extends {yfiles.algorithms.DpKeyBase.} - * @template TValue - */ - export interface GraphDpKey extends yfiles.algorithms.DpKeyBase{} - export class GraphDpKey { - /** - * Initializes a new instance of the {@link yfiles.algorithms.GraphDpKey.} class. - * @param valueType The type of the values that are returned by the {@link } registered with this class. - * @param declaringType Type that declares this key. - * @param name The name of this key. - */ - constructor(valueType:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.GraphDpKey; - } - /** - * This class is used as look-up key for registering {@link yfiles.algorithms.IDataProvider} for {@link yfiles.algorithms.GraphObject}s - * with a {@link yfiles.algorithms.Graph}. - * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. - * @see yfiles.algorithms.Graph#addDataProvider - * @see yfiles.algorithms.Graph#getDataProvider - * @see yfiles.algorithms.Graph#removeDataProvider - * @class - * @extends {yfiles.algorithms.DpKeyBase.} - * @template TValue - */ - export interface GraphObjectDpKey extends yfiles.algorithms.DpKeyBase{} - export class GraphObjectDpKey { - /** - * Initializes a new instance of the {@link yfiles.algorithms.GraphObjectDpKey.} class. - * @param valueType The type of the values that are returned by the {@link } registered with this class. - * @param declaringType Type that declares this key. - * @param name The name of this key. - */ - constructor(valueType:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.GraphObjectDpKey; - } - /** - * This class is used as look-up key for registering {@link yfiles.algorithms.IDataProvider} for IEdgeLabelLayouts with a - * {@link yfiles.algorithms.Graph}. - * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. - * @see yfiles.algorithms.Graph#addDataProvider - * @see yfiles.algorithms.Graph#getDataProvider - * @see yfiles.algorithms.Graph#removeDataProvider - * @class - * @extends {yfiles.algorithms.DpKeyBase.} - * @template TValue - */ - export interface IEdgeLabelLayoutDpKey extends yfiles.algorithms.DpKeyBase{} - export class IEdgeLabelLayoutDpKey { - /** - * Initializes a new instance of the {@link yfiles.algorithms.IEdgeLabelLayoutDpKey.} class. - * @param valueType The type of the values that are returned by the {@link } registered with this class. - * @param declaringType Type that declares this key. - * @param name The name of this key. - */ - constructor(valueType:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.IEdgeLabelLayoutDpKey; - } - /** - * This class is used as look-up key for registering {@link yfiles.algorithms.IDataProvider} for INodeLabelLayouts with a - * {@link yfiles.algorithms.Graph}. - * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. - * @see yfiles.algorithms.Graph#addDataProvider - * @see yfiles.algorithms.Graph#getDataProvider - * @see yfiles.algorithms.Graph#removeDataProvider - * @class - * @extends {yfiles.algorithms.DpKeyBase.} - * @template TValue - */ - export interface INodeLabelLayoutDpKey extends yfiles.algorithms.DpKeyBase{} - export class INodeLabelLayoutDpKey { - /** - * Initializes a new instance of the {@link yfiles.algorithms.INodeLabelLayoutDpKey.} class. - * @param valueType The type of the values that are returned by the {@link } registered with this class. - * @param declaringType Type that declares this key. - * @param name The name of this key. - */ - constructor(valueType:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.INodeLabelLayoutDpKey; - } - /** - * This class is used as look-up key for registering {@link yfiles.algorithms.IDataProvider} for ILabelLayouts with a - * {@link yfiles.algorithms.Graph}. - * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. - * @see yfiles.algorithms.Graph#addDataProvider - * @see yfiles.algorithms.Graph#getDataProvider - * @see yfiles.algorithms.Graph#removeDataProvider - * @class - * @extends {yfiles.algorithms.DpKeyBase.} - * @template TValue - */ - export interface ILabelLayoutDpKey extends yfiles.algorithms.DpKeyBase{} - export class ILabelLayoutDpKey { - /** - * Initializes a new instance of the {@link yfiles.algorithms.ILabelLayoutDpKey.} class. - * @param valueType The type of the values that are returned by the {@link } registered with this class. - * @param declaringType Type that declares this key. - * @param name The name of this key. - */ - constructor(valueType:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.ILabelLayoutDpKey; - } - /** - * This class is used as look-up key for registering {@link yfiles.algorithms.IDataProvider} for {@link yfiles.algorithms.Node}s with a - * {@link yfiles.algorithms.Graph}. - * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. - * @see yfiles.algorithms.Graph#addDataProvider - * @see yfiles.algorithms.Graph#getDataProvider - * @see yfiles.algorithms.Graph#removeDataProvider - * @class - * @extends {yfiles.algorithms.DpKeyBase.} - * @template TValue - */ - export interface NodeDpKey extends yfiles.algorithms.DpKeyBase{} - export class NodeDpKey { - /** - * Initializes a new instance of the {@link yfiles.algorithms.NodeDpKey.} class. - * @param valueType The type of the values that are returned by the {@link } registered with this class. - * @param declaringType Type that declares this key. - * @param name The name of this key. - */ - constructor(valueType:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.NodeDpKey; - } - /** - * Represents an edge, i.e., a directed connection between two nodes (represented by instances of class - * {@link yfiles.algorithms.Node}) in the directed graph data type {@link yfiles.algorithms.Graph}. - *

- *
The directed stems from the fact that an edge has a distinct source node and a distinct target node. Using pair notation, an - * edge would be written as (<source node>, <target node>). - *

- *

- * Most notably, an edge provides access to its source node ({@link yfiles.algorithms.Edge#source}) and its target node ({@link yfiles.algorithms.Edge#target}). Note that an edge can have the same - * node as its source and target. Such an edge is then called "self-loop" and method {@link yfiles.algorithms.Edge#selfLoop} yields true. - *

- *

- * Important: Class Graph is the single authority for any structural changes to the graph data type. Specifically, this means that - * there is no way to create or delete a node or an edge without using an actual Graph instance. - *

- * @class - * @extends {yfiles.algorithms.GraphObject} - */ - export interface Edge extends yfiles.algorithms.GraphObject{} - export class Edge { - /** - * Creates a new edge that belongs to the given graph. - *

- * The new edge e has source node v and target node w. - *
- * - *
- * Edge e is inserted in such a way that an iteration over the edges at node v returns e - *

- *
    - *
  • after e1, if d1 == AFTER
  • - *
  • before e1, if d1 == BEFORE,
  • - *
- *

- * and an iteration over the edges at w returns e - *

- *
    - *
  • after e2, if d2 == AFTER
  • - *
  • before e2, if d2 == BEFORE.
  • - *
- * @param v The source node of the edge. - * @param e1 An edge with source node v. - * @param w The target node of the edge. - * @param e2 An edge with target node w. - * @param d1 One of the object insertion specifiers {@link #BEFORE} or - * {@link #AFTER}. - * @param d2 One of the object insertion specifiers {@link #BEFORE} or - * {@link #AFTER}. - * @param g - */ - constructor(g:yfiles.algorithms.Graph,v:yfiles.algorithms.Node,e1:yfiles.algorithms.Edge,w:yfiles.algorithms.Node,e2:yfiles.algorithms.Edge,d1:yfiles.algorithms.GraphElementInsertion,d2:yfiles.algorithms.GraphElementInsertion); - /** - * Creates a copy of this edge that will be inserted into the given graph connecting the given source and target nodes. - * @param g The graph the created edge will belong to. - * @param v The source node of the created edge. - * @param w The target node of the created edge. - * @returns The newly created Edge object. - */ - createCopy(g:yfiles.algorithms.Graph,v:yfiles.algorithms.Node,w:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Callback method that is invoked from a graph just before this edge will be reinserted into that graph. - */ - onReinsert():void; - /** - * Returns the node at the opposite edge end with respect to the given node. - *

- * Note that self-loops have the same node at both edge ends. - *

- * @param v - * @returns - */ - opposite(v:yfiles.algorithms.Node):yfiles.algorithms.Node; - /** - * Gets the graph this edge belongs to. - *

- * If the edge does not belong to a graph, because it was removed or hidden from it, this method returns null. - *

- * @type {yfiles.algorithms.Graph} - */ - graph:yfiles.algorithms.Graph; - /** - * Gets the index of this edge within its graph G. - *

- * Edge indices represent the ordering of standard edge iteration on G. The value of an index is >= 0 and - * < G.edgeCount(). - *

- *

- * Note that indices are subject to change whenever the sequence of edges in a graph is modified by either removing, - * hiding, reinserting, or unhiding an edge, or by explicitly changing its position in the sequence. - *

- * @see yfiles.algorithms.Graph#removeEdge - * @see yfiles.algorithms.Graph#hide - * @see yfiles.algorithms.Graph#reInsertEdge - * @see yfiles.algorithms.Graph#unhide - * @see yfiles.algorithms.Graph#moveToFirst - * @see yfiles.algorithms.Graph#moveToLast - * @type {number} - */ - index:number; - /** - * Gets the source node connected to this edge. - * @see yfiles.algorithms.Edge#target - * @type {yfiles.algorithms.Node} - */ - source:yfiles.algorithms.Node; - /** - * Gets the target node connected to this edge. - * @see yfiles.algorithms.Edge#source - * @type {yfiles.algorithms.Node} - */ - target:yfiles.algorithms.Node; - /** - * Gets true if and only if this edge is a self-loop. - *

- * An edge is called a self-loop, if it is adjacent to only one node, i.e., source node and target node are the same. - *

- * @type {boolean} - */ - selfLoop:boolean; - /** - * Gets the successor of this edge in the list of outgoing edges at its source node. - *

- * If this edge is the last outgoing edge at its source node, then null is returned. - *

- * @see yfiles.algorithms.Edge#prevOutEdge - * @see yfiles.algorithms.Edge#nextInEdge - * @type {yfiles.algorithms.Edge} - */ - nextOutEdge:yfiles.algorithms.Edge; - /** - * Gets the successor of this edge in the list of incoming edges at its target node. - *

- * If this edge is the last incoming edge at its target node, then null is returned. - *

- * @see yfiles.algorithms.Edge#prevInEdge - * @see yfiles.algorithms.Edge#nextOutEdge - * @type {yfiles.algorithms.Edge} - */ - nextInEdge:yfiles.algorithms.Edge; - /** - * Gets the predecessor of this edge in the list of outgoing edges at its source node. - *

- * If this edge is the first outgoing edge at its source node, then null is returned. - *

- * @see yfiles.algorithms.Edge#nextOutEdge - * @see yfiles.algorithms.Edge#prevInEdge - * @type {yfiles.algorithms.Edge} - */ - prevOutEdge:yfiles.algorithms.Edge; - /** - * Gets the predecessor of this edge in the list of incoming edges at its target node. - *

- * If this edge is the first incoming edge at its target node, then null is returned. - *

- * @see yfiles.algorithms.Edge#nextInEdge - * @see yfiles.algorithms.Edge#prevOutEdge - * @type {yfiles.algorithms.Edge} - */ - prevInEdge:yfiles.algorithms.Edge; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Edge; - } - /** - * Specialized list implementation for instances of type {@link yfiles.algorithms.Edge}. - * @class - * @extends {yfiles.algorithms.YList} - * @implements {yfiles.collections.IEnumerable.} - */ - export interface EdgeList extends yfiles.algorithms.YList{} - export class EdgeList { - /** - * Creates a list that is initialized with an EdgeList. - * @param edgeList - */ - constructor(edgeList:yfiles.algorithms.EdgeList); - /** - * Creates a list that is initialized with a single edge provided. - * @param e - */ - constructor(e:yfiles.algorithms.Edge); - /** - * Creates a list that is initialized with those edges from the given EdgeCursor object for which the given data provider - * returns true upon calling its {@link yfiles.algorithms.IDataProvider#getBoolean getBool} method. - * @param ec An edge cursor providing edges that should be added to this list. - * @param predicate A data provider that acts as a inclusion predicate for each edge accessible by the given edge cursor. - */ - constructor(ec:yfiles.algorithms.IEdgeCursor,predicate:yfiles.algorithms.IDataProvider); - /** - * Creates a list that is initialized with the edges provided by the given array of edges. - * @param a - */ - constructor(a:yfiles.algorithms.Edge[]); - /** - * Creates a list that is initialized with the edges provided by the given EdgeCursor object. - * @param c - */ - constructor(c:yfiles.algorithms.IEdgeCursor); - /** - * Creates an empty edge list. - */ - constructor(); - /** - * Returns an edge cursor for this edge list. - * @returns An edge cursor granting access to the edges within this list. - */ - edges():yfiles.algorithms.IEdgeCursor; - /** - * Returns the first edge in this list, or null when the list is empty. - * @returns The first edge in the list. - */ - firstEdge():yfiles.algorithms.Edge; - /** - * Returns an enumerator for this collection. - * @returns - */ - getEnumerator():yfiles.collections.IEnumerator; - /** - * Returns the last edge in this list, or null when the list is empty. - * @returns The last edge in the list. - */ - lastEdge():yfiles.algorithms.Edge; - /** - * Removes the first edge from this list and returns it. - * @returns The first edge from the list. - */ - popEdge():yfiles.algorithms.Edge; - /** - * Returns an edge array containing all elements of this list in the canonical order. - * @returns - */ - toEdgeArray():yfiles.algorithms.Edge[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.EdgeList; - } - export enum BfsDirection{ - /** - * An edge direction specifier for incoming edges. - * @see yfiles.algorithms.Bfs#getLayers - */ - PREDECESSOR, - /** - * An edge direction specifier for outgoing edges. - * @see yfiles.algorithms.Bfs#getLayers - */ - SUCCESSOR, - /** - * An edge direction specifier for both incoming and outgoing edges. - * @see yfiles.algorithms.Bfs#getLayers - */ - BOTH - } - export enum GraphElementInsertion{ - /** - * Object insertion specifier. An object gets inserted before another one. - */ - BEFORE, - /** - * Object insertion specifier. An object gets inserted after another one. - */ - AFTER - } - export enum GraphEventType{ - /** - * Type constant that identifies an event that gets fired immediately after a node has been created. The data of the event - * is the newly created node. - */ - NODE_CREATION, - /** - * Type constant that identifies an event that gets fired immediately after an edge has been created. The data of the event - * is the newly created edge. - */ - EDGE_CREATION, - /** - * Type constant that identifies an event that gets fired immediately before a node will be removed from the graph. The - * data of the event is the node to be removed. - */ - PRE_NODE_REMOVAL, - /** - * Type constant that identifies an event that gets fired immediately after a node has been removed from the graph. The - * data of the event is the removed node. - */ - POST_NODE_REMOVAL, - /** - * Type constant that identifies an event that gets fired immediately before an edge will be removed from the graph. The - * data of the event is the edge to be removed. - */ - PRE_EDGE_REMOVAL, - /** - * Type constant that identifies an event that gets fired immediately after an edge has been removed from the graph. The - * data of the event is the removed edge. - */ - POST_EDGE_REMOVAL, - /** - * Type constant that identifies an event that gets fired immediately after a node has been reinserted into the graph. The - * data of the event is the reinserted node. - */ - NODE_REINSERTION, - /** - * Type constant that identifies an event that gets fired immediately after an edge has been reinserted into the graph. The - * data of the event is the reinserted edge. - */ - EDGE_REINSERTION, - /** - * Type constant that identifies an event that gets fired immediately before the end points of an edge will be changed. The - * data of the event is the edge to be redefined. - */ - PRE_EDGE_CHANGE, - /** - * Type constant that identifies an event that gets fired immediately after the end points of an edge have been changed. - * The data of the event is the redefined edge. - */ - POST_EDGE_CHANGE, - /** - * Type constant that identifies an event that gets fired after a subgraph of a graph G has been moved to the emitting - * graph. The data of the event is a {@link yfiles.algorithms.NodeList} containing the nodes that induce the moved subgraph. - *

- * This event gets fired just after the {@link yfiles.algorithms.GraphEventType#SUBGRAPH_REMOVAL} event got fired on the subgraph's - * original graph G. Note that at the time the event gets fired, the nodes from the node list are already part of the - * emitting graph. - *

- */ - SUBGRAPH_INSERTION, - /** - * Type constant that identifies an event that gets fired after a subgraph of the emitting graph has been moved to a graph - * G. The data of the event is a {@link yfiles.algorithms.NodeList} containing the nodes that induce the moved subgraph. - *

- * This event gets fired just before the {@link yfiles.algorithms.GraphEventType#SUBGRAPH_INSERTION} event will be fired on the - * subgraph's new graph G. Note that at the time the event gets fired, the nodes from the node list are already part of - * graph G. - *

- */ - SUBGRAPH_REMOVAL, - /** - * Type constant that signals the start of a some logically coherent event sequence. If specified, the data of this event - * is its ID. - */ - PRE_EVENT, - /** - * Type constant that signals the end of a some logically coherent event sequence. If specified, the data of this event is - * its ID. - */ - POST_EVENT - } - export enum DistanceMetric{ - /** - * A specifier for euclidean distance metric. - * @see yfiles.algorithms.Groups#kMeansClustering - */ - EUCLIDEAN, - /** - * A specifier for euclidean squared distance metric. - * @see yfiles.algorithms.Groups#kMeansClustering - */ - EUCLIDEAN_SQUARED, - /** - * A specifier for Manhattan distance metric. - * @see yfiles.algorithms.Groups#kMeansClustering - */ - MANHATTAN, - /** - * A specifier for Chebychev distance metric. - * @see yfiles.algorithms.Groups#kMeansClustering - */ - CHEBYCHEV - } - export enum Linkage{ - /** - * A specifier for single-linkage clustering. - *

- * At the beginning, each element belongs to its own cluster. At each step of the clustering algorithm the two most - * "similar" clusters are merged together until all nodes belong to the same cluster. - *

- * @see yfiles.algorithms.Groups#hierarchicalClustering - * @see yfiles.algorithms.Groups#hierarchicalClustering - * @see yfiles.algorithms.Groups#hierarchicalClustering - */ - SINGLE, - /** - * A specifier for complete-linkage clustering. - *

- * At the beginning, each element belongs to its own cluster. At each step of the clustering algorithm the two most - * "dissimilar" clusters are merged and the distance equals to the distance of those two nodes that are farthest away from - * each other. The algorithm continues until all nodes belong to the same cluster. - *

- * @see yfiles.algorithms.Groups#hierarchicalClustering - * @see yfiles.algorithms.Groups#hierarchicalClustering - * @see yfiles.algorithms.Groups#hierarchicalClustering - */ - COMPLETE, - /** - * A specifier for average-linkage clustering. - *

- * At the beginning, each element belongs to its own cluster. At each step of the clustering algorithm the two most - * "similar" clusters are combined and the distance between them is defined as the average all distances between the nodes - * that belong to the two clusters that are combined. The algorithm continues until all nodes belong to the same cluster. - *

- * @see yfiles.algorithms.Groups#hierarchicalClustering - * @see yfiles.algorithms.Groups#hierarchicalClustering - * @see yfiles.algorithms.Groups#hierarchicalClustering - */ - AVERAGE - } - /** - * This class represents a line in the 2D-dimensional affine space. - *

- * The line is defined by the equation ax + by + c = 0 - *

- * @class - */ - export interface AffineLine extends yfiles.lang.Object{} - export class AffineLine { - /** - * Creates an affine line which is defined by two points. - * @param p1 - * @param p2 - */ - constructor(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint); - /** - * Creates an affine line which is defined by a point and a vector. - * @param p1 - * @param v - */ - constructor(p1:yfiles.algorithms.YPoint,v:yfiles.algorithms.YVector); - /** - * Returns the crossing of two lines. - *

- * If the lines are parallel, null is returned. - *

- * @param l1 - * @param l2 - * @returns - * @static - */ - static getCrossing(l1:yfiles.algorithms.AffineLine,l2:yfiles.algorithms.AffineLine):yfiles.algorithms.YPoint; - /** - * Projects an point on the line in direction of the X-axis. - * @param p - * @returns - */ - getXProjection(p:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; - /** - * Projects an point on the line in direction of the Y-axis. - * @param p - * @returns - */ - getYProjection(p:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; - /** - * Gets a from ax+by+c = 0 - * @type {number} - */ - a:number; - /** - * Gets b from ax+by+c = 0 - * @type {number} - */ - b:number; - /** - * Gets c from ax+by+c = 0 - * @type {number} - */ - c:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.AffineLine; - } - /** - * The handle of a segment of a borderline. - * @class - */ - export interface BorderLineSegment extends yfiles.lang.Object{} - export class BorderLineSegment { - /** - * Returns the segment's value at the given position. - *

- * Note: In case the position lies outside the segments range, the calculated value might be invalid. As the segment is not - * aware of any offsets the position also must not include any offsets. - *

- * @param position the position the value is retrieved for. - * @returns the segment's value at the given position. - */ - getValueAt(position:number):number; - /** - * Returns the next segment or null if there is no such segment. - * @returns - */ - next():yfiles.algorithms.BorderLineSegment; - /** - * Returns the previous segment or null if there is no such segment. - * @returns - */ - prev():yfiles.algorithms.BorderLineSegment; - /** - * Gets the end of this segment. - * @type {number} - */ - end:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.BorderLineSegment; - } - /** - * This class can be used to easily model an orthogonal border line or sky-line. - *

- * It provides methods for measuring the distance between different BorderLine instances, merging multiple instances, - * modifying and efficiently moving them around. - *

- * @class - */ - export interface BorderLine extends yfiles.lang.Object{} - export class BorderLine { - /** - * Creates a new BorderLine from a single segment. - * @param min the beginning of this borderline - * @param max the ending of this borderline - * @param valueAtMin the value of the segment at the beginning of this borderline - * @param valueAtMax the value of the segment at the ending of this borderline - */ - constructor(min:number,max:number,valueAtMin:number,valueAtMax:number); - /** - * Creates a new BorderLine from a single segment. - * @param min the beginning of this borderline - * @param max the ending of this borderline - * @param value the value of the segment - */ - constructor(min:number,max:number,value:number); - /** - * Creates a new BorderLine with the given value from -Double.MAX_VALUE to Double.MAX_VALUE. - * @param value the value of the segment - */ - constructor(value:number); - /** - * Adds the given offset to the segments' positions. - *

- * This method has complexity O(1). - *

- * @param delta the delta to add to the positions - */ - addOffset(delta:number):void; - /** - * Adds the given offset to the current values of the whole borderline. - *

- * This method has complexity O(1). - *

- * @param delta the delta to add to the values - */ - addValueOffset(delta:number):void; - /** - * Convenience method that copies the actual data from the given argument to this instance. - * @param other the argument to retrieve the values from - */ - adoptValues(other:yfiles.algorithms.BorderLine):void; - /** - * Creates a copy of this borderline. - *

- * Optionally negates the values or offsets. - *

- * @param negateValues whether the values are negated - * @param negateOffsets whether the offsets are negated - * @returns the copy of the borderline - */ - createCopy(negateValues:boolean,negateOffsets:boolean):yfiles.algorithms.BorderLine; - /** - * Merges this borderline with the given borderline using the "maximum" policy. - *

- * That means the resulting borderline will have greater value of both borderline on each position. If you imagine each - * borderline as a the upper border of a plane, the resulting borderline will be the upper border of the merged planes. - *

- * @param other the other borderline - * @returns a new borderline that is the result of the merge - */ - createMax(other:yfiles.algorithms.BorderLine):yfiles.algorithms.BorderLine; - /** - * Merges this borderline with the given borderline using the "minimum" policy. - *

- * That means the resulting borderline will have smaller value of both borderline on each position. If you imagine each - * borderline as a the lower border of a plane, the resulting borderline will be the lower border of the merged planes. - *

- * @param other the other borderline - * @returns a new borderline that is the result of the merge - */ - createMin(other:yfiles.algorithms.BorderLine):yfiles.algorithms.BorderLine; - /** - * Returns the first segment or null if there is no such segment. - * @returns - */ - firstSegment():yfiles.algorithms.BorderLineSegment; - /** - * Calculates the minimal distance between this borderline and the other one. - *

- * The other one is treated as if the values were all greater. - *

- * @param greater - * @returns - */ - getDistanceTo(greater:yfiles.algorithms.BorderLine):number; - /** - * Returns the maximum position of the given segment. - * @param s the segment - * @returns - */ - getMax(s:yfiles.algorithms.BorderLineSegment):number; - /** - * Calculates the maximum value in the interval from->to. - * @param from - * @param to - * @returns - */ - getMaxValue(from:number,to:number):number; - /** - * Returns the minimum position of the given segment. - * @param s the segment - * @returns - */ - getMin(s:yfiles.algorithms.BorderLineSegment):number; - /** - * Calculates the minimum value in the interval from->to. - * @param from - * @param to - * @returns - */ - getMinValue(from:number,to:number):number; - /** - * Returns the segment at the given position. - * @param pos the position - * @returns - */ - getSegmentAt(pos:number):yfiles.algorithms.BorderLineSegment; - /** - * Returns the slope of the given segment. - * @param s the segment - * @returns - */ - getSlope(s:yfiles.algorithms.BorderLineSegment):number; - /** - * Returns the value of the minimum of the given segment. - *

- * If the segment's slope is 0, it's the value of the whole segment. In case the slope differs from 0, it's the value of - * the start of the slope. - *

- * @param s the segment - * @returns - */ - getValue(s:yfiles.algorithms.BorderLineSegment):number; - /** - * Returns the value that is set on this borderline at the specified position. - *

- * The position must lie within the range of the segment. - *

- * @param segment The segment whose value shall be returned. - * @param pos the position where the value will be retrieved. - * @returns the value - * @throws {Stubs.Exceptions.ArgumentError} if pos is outside the segment's range. - */ - getValueAt(segment:yfiles.algorithms.BorderLineSegment,pos:number):number; - /** - * Returns the value that is set on this borderline at the specified position. - *

- * The position must lie within the range of the segment that is stored in cell. - *

- * @param cell The list cell containing the segment whose value shall be returned. - * @param pos the position - * @returns the value - * @throws {Stubs.Exceptions.ArgumentError} if pos is outside the segment's range that is stored in cell. - */ - getValueAt(cell:yfiles.algorithms.ListCell,pos:number):number; - /** - * Returns the value that is set on this borderline at the specified position. - * @param pos the position - * @returns the value - * @throws {Stubs.Exceptions.IndexOutOfRangeError} if the position is outside of the borderline. - */ - getValueAt(pos:number):number; - /** - * Grows this BorderLine horizontally, so that the {@link yfiles.algorithms.BorderLine#getValueAt values} of the BorderLine stay the same however their {@link yfiles.algorithms.BorderLine#getMin start} and {@link yfiles.algorithms.BorderLine#getMax end} - * points are moved in the direction of toMin and toMax. - *

- * This is useful for scenarios where a BorderLine is needed that consists of an enlarged border. - *

- *

- * Note that this method normalizes the segments, i.e., it transforms each segment with slope != 0 to a segment with slope - * == 0. - *

- * @param toMin the delta by which the border should be extended towards -Infinity - * @param toMax the delta by which the border should be extended towards +Infinity - * @param positive whether the BorderLine should be interpreted to point in positive direction. This influences the direction into which a - * segment's border is extended. - */ - grow(toMin:number,toMax:number,positive:boolean):void; - /** - * Returns the last segment or null if there is no such segment. - * @returns - */ - lastSegment():yfiles.algorithms.BorderLineSegment; - /** - * Merges this borderline with the given borderline using the "maximum" policy. - * @param other the other borderline - */ - mergeWithMax(other:yfiles.algorithms.BorderLine):void; - /** - * Merges this borderline with the given borderline using the "minimum" policy. - * @param other the other borderline - */ - mergeWithMin(other:yfiles.algorithms.BorderLine):void; - /** - * Returns the next segment or null if there is no such segment. - * @param s - * @returns - */ - next(s:yfiles.algorithms.BorderLineSegment):yfiles.algorithms.BorderLineSegment; - /** - * Returns the previous segment or null if there is no such segment. - * @param s - * @returns - */ - prev(s:yfiles.algorithms.BorderLineSegment):yfiles.algorithms.BorderLineSegment; - /** - * Assures that all values in the given interval are greater or equal than the given value. - * @param min the lower end of the interval - * @param max the upper end of the interval - * @param value the smallest possible value for the interval - */ - setMaxValue(min:number,max:number,value:number):void; - /** - * Assures that all values in the given interval are less or equal than the given value. - * @param min the lower end of the interval - * @param max the upper end of the interval - * @param value the greatest possible value for the interval - */ - setMinValue(min:number,max:number,value:number):void; - /** - * Sets a specific interval to a slope starting at a given value. - * @param min the left side of the interval. - * @param max the right side of the interval. - * @param value the value at min where the slope starts. - * @param slope the slope of the segment in the given interval. - * @throws {Stubs.Exceptions.ArgumentError} if min is greater than max. - */ - setSloped(min:number,max:number,value:number,slope:number):void; - /** - * Sets a specific interval described by min and max to a given value. - * @param min the left side of the interval. - * @param max the right side of the interval. - * @param value the value for the whole interval. - */ - setValue(min:number,max:number,value:number):void; - /** - * Gets the smallest position of this borderline - * @type {number} - */ - min:number; - /** - * Gets the greatest position of this borderline - * @type {number} - */ - max:number; - /** - * Gets the minimum value that is set on this borderline - * @type {number} - */ - minValue:number; - /** - * Gets the maximum value that is set on this borderline - * @type {number} - */ - maxValue:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.BorderLine; - } - /** - * This class provides useful geometric primitives and advanced geometric algorithms. - * @class - * @static - */ - export interface Geom extends yfiles.lang.Object{} - export class Geom { - /** - * Calculates the convex hull for a set of points. - * @param points a list of {@link } objects - * @returns a list of {@link } objects that constitute the convex hull of the given points. The list contains points - * in counter clockwise order around the hull. The first point is the one with the smallest x coordinate. If two such - * points exist then of these points the one with the smallest y coordinate is chosen as the first one. - * @static - */ - static calcConvexHull(points:yfiles.algorithms.YList):yfiles.algorithms.YList; - /** - * Calculates the intersection point of two affine lines. - *

- * Each line is given by two points. - *

- * @param p1 one point on the first line. - * @param p2 another point on the first line. - * @param p3 one point on the second line. - * @param p4 another point on the second line. - * @returns the intersection point of the specified lines or null if there is no intersection. - * @static - */ - static calcIntersection(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint,p3:yfiles.algorithms.YPoint,p4:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; - /** - * Calculates the intersection point of two affine lines. - *

- * Each line is given by a point and a direction vector. - *

- * @param p1 origin point of the first line. - * @param d1 direction vector of the first line. - * @param p2 origin point of the second line. - * @param d2 direction vector of the second line. - * @returns the intersection point of the specified lines or null if there is no intersection. - * @static - */ - static calcIntersection(p1:yfiles.algorithms.YPoint,d1:yfiles.algorithms.YVector,p2:yfiles.algorithms.YPoint,d2:yfiles.algorithms.YVector):yfiles.algorithms.YPoint; - /** - * Calculates the intersection point of two affine lines. - *

- * Each line is given by the coordinates of two points. - *

- * @param x1 x-coordinate of one point on the first line. - * @param y1 y-coordinate of one point on the first line. - * @param x2 x-coordinate of another point on the first line. - * @param y2 y-coordinate of another point on the first line. - * @param x3 x-coordinate of one point on the second line. - * @param y3 y-coordinate of one point on the second line. - * @param x4 x-coordinate of another point on the second line. - * @param y4 y-coordinate of another point on the second line. - * @returns the intersection point of the specified lines or null if there is no intersection. - * @static - */ - static calcIntersection(x1:number,y1:number,x2:number,y2:number,x3:number,y3:number,x4:number,y4:number):yfiles.algorithms.YPoint; - /** - * Intersects the pair of specified source Rectangle2D objects and puts the result into the specified destination Rectangle2D - * object. - *

- * If one or both of the source rectangles have negative width or height, the resulting rectangle will be located at (0,0) - * with a width and height of -1. One of the source rectangles can also be the destination to avoid creating a third - * Rectangle2D object, but in this case the original points of this source rectangle will be overwritten by this method. - *

- * @param r1 the first of a pair of Rectangle2D objects to be intersected with each other - * @param r2 the second of a pair of Rectangle2D objects to be intersected with each other - * @param dest the Rectangle2D that holds the results of the intersection of r1 and r2 - * @returns - * @static - */ - static calcIntersection(r1:yfiles.algorithms.Rectangle2D,r2:yfiles.algorithms.Rectangle2D,dest:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D; - /** - * Unions the pair of source Rectangle2D objects and puts the result into the specified destination Rectangle2D object. - *

- * If one of the source rectangles has negative width or height, it is excluded from the union. If both source rectangles - * have negative width or height, the destination rectangle will become a copy of r1. One of the source rectangles can also - * be the destination to avoid creating a third Rectangle2D object, but in this case the original points of this source - * rectangle will be overwritten by this method. If the destination is null, a new Rectangle2D is created. - *

- * @param r1 the first of a pair of Rectangle2D objects to be combined with each other - * @param r2 the second of a pair of Rectangle2D objects to be combined with each other - * @param dest the Rectangle2D that holds the results of the union of r1 and r2 - * @returns - * @static - */ - static calcUnion(r1:yfiles.algorithms.Rectangle2D,r2:yfiles.algorithms.Rectangle2D,dest:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D; - /** - * Returns true iff the given points are collinear, i.e. - *

- * all three points lie on a common line. - *

- *

- * Same as {@link yfiles.algorithms.Geom#orientation orientation(p,q,r) == 0} - *

- * @param p - * @param q - * @param r - * @returns - * @static - */ - static collinear(p:yfiles.algorithms.YPoint,q:yfiles.algorithms.YPoint,r:yfiles.algorithms.YPoint):boolean; - /** - * Determines the distance of the point p to the line segment [l1, l2]. - * @param pointX the x coordinate of p - * @param pointY the y coordinate of p - * @param lineX1 the x coordinate of l1 - * @param lineY1 the y coordinate of l1 - * @param lineX2 the x coordinate of l2 - * @param lineY2 the y coordinate of l2 - * @returns - * @static - */ - static distanceToLineSegment(pointX:number,pointY:number,lineX1:number,lineY1:number,lineX2:number,lineY2:number):number; - /** - * Same as {@link yfiles.algorithms.Geom#orientation orientation(p,q,r) > 0} - * @param p - * @param q - * @param r - * @returns - * @static - */ - static leftTurn(p:yfiles.algorithms.YPoint,q:yfiles.algorithms.YPoint,r:yfiles.algorithms.YPoint):boolean; - /** - * Returns whether the two lines defined by the given coordinates intersect or not. - * @param x1 - * @param y1 - * @param x2 - * @param y2 - * @param x3 - * @param y3 - * @param x4 - * @param y4 - * @returns - * @static - */ - static linesIntersect(x1:number,y1:number,x2:number,y2:number,x3:number,y3:number,x4:number,y4:number):boolean; - /** - * Same as {@link yfiles.algorithms.Geom#orientation} with double values as arguments. - * @param px - * @param py - * @param qx - * @param qy - * @param rx - * @param ry - * @returns - * @static - */ - static orientation(px:number,py:number,qx:number,qy:number,rx:number,ry:number):number; - /** - * Returns the orientation of point r relative to the directed line from point p to point q. - *

- * The given tuple of points is said to have positive orientation if p and q are distinct and r lies to the left of the - * oriented line passing through p and q and oriented from p to q. - *

- *

- * The tuple is said to have negative orientation if p and q are distinct and r lies to the right of the line, and the - * tuple is said to have orientation zero if the three points are collinear. - *

- * @param p - * @param q - * @param r - * @returns +1 in the case of positive orientation, -1 in the case of negative orientation and 0 in the case of zero orientation. - * @static - */ - static orientation(p:yfiles.algorithms.YPoint,q:yfiles.algorithms.YPoint,r:yfiles.algorithms.YPoint):number; - /** - * Determines the projection of the point p onto the line segment [l1, l2]. - *

- * The resulting point is - *

- *
    - *
  • the orthogonal projection of p onto the line through l1 and l2, iff the projection lies on the line segment [l1, l2]
  • - *
  • the end point of the line segment [l1, l2] that is closest to p, otherwise
  • - *
- * @param pointX the x coordinate of p - * @param pointY the y coordinate of p - * @param lineX1 the x coordinate of l1 - * @param lineY1 the y coordinate of l1 - * @param lineX2 the x coordinate of l2 - * @param lineY2 the y coordinate of l2 - * @returns - * @static - */ - static projection(pointX:number,pointY:number,lineX1:number,lineY1:number,lineX2:number,lineY2:number):yfiles.algorithms.YPoint; - /** - * Same as {@link yfiles.algorithms.Geom#orientation orientation(p,q,r) < 0} - * @param p - * @param q - * @param r - * @returns - * @static - */ - static rightTurn(p:yfiles.algorithms.YPoint,q:yfiles.algorithms.YPoint,r:yfiles.algorithms.YPoint):boolean; - /** - * Returns +1 if point d lies left of the directed circle through points a, b, and c, 0 if a,b,c and d are cocircular, and - * -1 otherwise. - * @param a - * @param b - * @param c - * @param d - * @returns - * @static - */ - static sideOfCircle(a:yfiles.algorithms.YPoint,b:yfiles.algorithms.YPoint,c:yfiles.algorithms.YPoint,d:yfiles.algorithms.YPoint):number; - /** - * Converts the given degree value from radian to angular - * @param angrad - * @returns - * @static - */ - static toDegrees(angrad:number):number; - /** - * Converts the given degree value from angular to radian. - * @param angdeg - * @returns - * @static - */ - static toRadians(angdeg:number):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Geom; - } - /** - * This is an interface for a sequence of instances of LineSegment. - * @interface - * @implements {yfiles.algorithms.ICursor} - */ - export interface ILineSegmentCursor extends yfiles.lang.Object,yfiles.algorithms.ICursor{ - /** - * Gets the instance of LineSegment the cursor is currently pointing on. - * @abstract - * @type {yfiles.algorithms.LineSegment} - */ - lineSegment:yfiles.algorithms.LineSegment; - } - var ILineSegmentCursor:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.ILineSegmentCursor; - }; - /** - * This interface describes a 2-dimensional object which has a finite bounding box. - * @interface - */ - export interface IPlaneObject extends yfiles.lang.Object{ - /** - * Gets the smallest Rectangle which contains the object. - * @abstract - * @type {yfiles.algorithms.YRectangle} - */ - boundingBox:yfiles.algorithms.YRectangle; - } - var IPlaneObject:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.IPlaneObject; - }; - /** - * This is an interface for a sequence of instances of YPoint. - * @interface - * @implements {yfiles.algorithms.ICursor} - */ - export interface IPointCursor extends yfiles.lang.Object,yfiles.algorithms.ICursor{ - /** - * Gets the instance of YPoint the cursor is currently pointing on. - * @abstract - * @type {yfiles.algorithms.YPoint} - */ - point:yfiles.algorithms.YPoint; - } - var IPointCursor:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.IPointCursor; - }; - /** - * Double-precision immutable insets representation. - * @class - * @implements {yfiles.lang.ICloneable} - */ - export interface Insets extends yfiles.lang.Object,yfiles.lang.ICloneable{} - export class Insets { - /** - * Creates a new instance with the given values - * @param top The new top inset value - * @param left The new left inset value - * @param bottom The new bottom inset value - * @param right The new right inset value - */ - constructor(top:number,left:number,bottom:number,right:number); - /** - * - * @returns - */ - clone():any; - /** - * Creates a {@link yfiles.geometry.Insets} from a given {@link yfiles.algorithms.Insets}. - * @returns The {@link }. - */ - toInsets():yfiles.geometry.Insets; - /** - * The inset from the top. - * @const - * @type {number} - */ - top:number; - /** - * The inset from the left. - * @const - * @type {number} - */ - left:number; - /** - * The inset from the bottom. - * @const - * @type {number} - */ - bottom:number; - /** - * The inset from the right. - * @const - * @type {number} - */ - right:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Insets; - } - /** - * An instance of this interface handles intersections found by the IntersectionAlgorithm, - * @interface - */ - export interface IIntersectionHandler extends yfiles.lang.Object{ - /** - * This method is called at every intersection. - * @param a - * @param b - * @abstract - */ - checkIntersection(a:any,b:any):void; - } - var IIntersectionHandler:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.IIntersectionHandler; - }; - /** - * This class calculates the intersection of rectangles in the plane with the help of a sweep-line algorithm. - *

- *
The complexity is O(n log n + s) where n is the number of rectangles and s the number of intersections. - *

- * @class - * @static - */ - export interface IntersectionAlgorithm extends yfiles.lang.Object{} - export class IntersectionAlgorithm { - /** - * Calculates the intersections of rectangles in the plane. - *

- * Every found intersection is reported to an - * IntersectionHandler. Rectangles with negative size are completely ignored by this implementation (i.e. never generate - * intersections) - *

- * @param objects a list of PlaneObject objects. - * @param iHandler intersections are reported to this class. - * @static - */ - static intersect(objects:yfiles.algorithms.YList,iHandler:yfiles.algorithms.IIntersectionHandler):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.IntersectionAlgorithm; - } - /** - * This class represents a line segment in the plane. - *

- * A line segment is defined by its two end points. - *

- * @class - * @implements {yfiles.algorithms.IPlaneObject} - */ - export interface LineSegment extends yfiles.lang.Object,yfiles.algorithms.IPlaneObject{} - export class LineSegment { - /** - * Returns a new LineSegment. - * @param p1 the first end point of the line segment. - * @param p2 the second end point of the line segment. - */ - constructor(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint); - /** - * Checks whether a line segment intersects a paraxial box. - *

- * Implemented using the Cohen-Sutherland algorithm. - *

- * @param boxX1 x-coordinate of the upper left corner of the box - * @param boxY1 y-coordinate of the upper left corner of the box - * @param boxX2 x-coordinate of the lower right corner of the box - * @param boxY2 y-coordinate of the lower right corner of the box - * @param sX1 x-coordinate of the first end point of the line segment - * @param sY1 y-coordinate of the first end point of the line segment - * @param sX2 x-coordinate of the second end point of the line segment - * @param sY2 y-coordinate of the second end point of the line segment - * @returns true if the line segment intersects the box, false otherwise. - * @static - */ - static boxIntersectsSegment(boxX1:number,boxY1:number,boxX2:number,boxY2:number,sX1:number,sY1:number,sX2:number,sY2:number):boolean; - /** - * Checks whether a line segment intersects a box. - *

- * Implemented using the Cohen-Sutherland algorithm. - *

- * @param box A rectangle - * @param x1 x-coordinate of the first end point of the line segment - * @param y1 y-coordinate of the first end point of the line segment - * @param x2 x-coordinate of the second end point of the line segment - * @param y2 y-coordinate of the second end point of the line segment - * @returns true if the line segment intersects the box, false otherwise. - * @static - */ - static boxIntersectsSegment(box:yfiles.algorithms.YRectangle,x1:number,y1:number,x2:number,y2:number):boolean; - /** - * Checks whether a line segment intersects a box. - * @param box A rectangle. - * @param s first end point of the line segment. - * @param t second end point of the line segment. - * @returns true if the line segments intersects the box, false otherwise. - * @static - */ - static boxIntersectsSegment(box:yfiles.algorithms.YRectangle,s:yfiles.algorithms.YPoint,t:yfiles.algorithms.YPoint):boolean; - /** - * Checks whether a given point lies on this line segment. - * @param point an arbitrary point. - * @returns true if the line segments intersects the box, false otherwise. - */ - contains(point:yfiles.algorithms.YPoint):boolean; - /** - * Returns intersection point between the two line segments, if there is one or null if the two line segments do not - * intersect. - * @param s1 first line segment - * @param s2 second line segment - * @returns - * @static - */ - static getIntersection(s1:yfiles.algorithms.LineSegment,s2:yfiles.algorithms.LineSegment):yfiles.algorithms.YPoint; - /** - * Checks whether the line segment intersects a point. - * @param p a point - * @returns true if the line segments intersects the given point, false otherwise. - */ - intersects(p:yfiles.algorithms.YPoint):boolean; - /** - * Checks whether the line segment intersects a box. - * @param box A rectangle. - * @returns true if the line segments intersects the box, false otherwise. - */ - intersects(box:yfiles.algorithms.YRectangle):boolean; - /** - * Determines if the given points define a horizontal line segment. - *

- * This methods allows for y-coordinate differences of up to 1e-8. - *

- * @param p1 - * @param p2 - * @returns true if the given points define a horizontal line segment; false otherwise. - * @static - */ - static isHorizontalSegment(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):boolean; - /** - * Returns if the projection on the X axis of the line segment covers a certain point on the X Axis. - * @param x - * @returns - */ - isInXIntervall(x:number):boolean; - /** - * Returns if the projection on the Y axis of the line segment covers a certain point on the Y Axis. - * @param y - * @returns - */ - isInYIntervall(y:number):boolean; - /** - * Determines if the given points define a vertical line segment. - *

- * This methods allows for x-coordinate differences of up to 1e-8. - *

- * @param p1 - * @param p2 - * @returns true if the given points define a vertical line segment; false otherwise. - * @static - */ - static isVerticalSegment(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):boolean; - /** - * Returns the length of the line segment, this is the value of the Euclidean norm. - * @returns an value > 0. - */ - length():number; - /** - * Returns the affine line defined by the end points of the line segment. - * @returns - */ - toAffineLine():yfiles.algorithms.AffineLine; - /** - * Returns the vector pointing from the first end point to the second end point of the line segment. - * @returns - */ - toYVector():yfiles.algorithms.YVector; - /** - * Gets if this segment is considered vertical, i.e. - *

- * the x values of the end point differ less then 0.00000001 - *

- * @type {boolean} - */ - isVertical:boolean; - /** - * Gets if the interval is horizontal. - * @type {boolean} - */ - isHorizontal:boolean; - /** - * Gets the first end point of the line segment. - * @type {yfiles.algorithms.YPoint} - */ - firstEndPoint:yfiles.algorithms.YPoint; - /** - * Gets the second end point of the line segment. - * @type {yfiles.algorithms.YPoint} - */ - secondEndPoint:yfiles.algorithms.YPoint; - /** - * Gets the y value of the line on x coordinate 0. - * @type {number} - */ - xOffset:number; - /** - * Gets the slope of the line segment. - * @type {number} - */ - slope:number; - /** - * Gets the smallest Rectangle which contains the object. - * @type {yfiles.algorithms.YRectangle} - */ - boundingBox:yfiles.algorithms.YRectangle; - /** - * Gets the distance from start to end point in x-coordinates. - * @type {number} - */ - deltaX:number; - /** - * Gets the distance from start to end point in y-coordinates. - * @type {number} - */ - deltaY:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.LineSegment; - } - /** - * Represents a two-dimensional point located at (x, y). - * @class - * @implements {yfiles.lang.ICloneable} - */ - export interface Point2D extends yfiles.lang.Object,yfiles.lang.ICloneable{} - export class Point2D { - /** - * Creates a new instance at the given location. - * @param x The x coordinate of the new point - * @param y The x coordinate of the new point - */ - constructor(x:number,y:number); - /** - * Creates a new instance that is located at (0, 0) - */ - constructor(); - /** - * Creates a new instance of this class that has the same values as this objects. - * @returns a new instance of this class that has the same values as this objects. - */ - clone():any; - /** - * Calculates the distance between this points and another one, given as its coordinates. - * @param px The x coordinate of the second point. - * @param py The y coordinate of the second point. - * @returns the distance between this points and another one, given as its coordinates. - */ - distance(px:number,py:number):number; - /** - * Calculates the distance between this points and another one. - * @param p The second point. - * @returns the distance between this points and another one. - */ - distance(p:yfiles.algorithms.Point2D):number; - /** - * Calculates the distance between two points, given as their coordinates. - * @param x1 The x coordinate of the first point. - * @param y1 The y coordinate of the first point. - * @param x2 The x coordinate of the second point. - * @param y2 The y coordinate of the second point. - * @returns the distance between two points, given as their coordinates. - * @static - */ - static distance(x1:number,y1:number,x2:number,y2:number):number; - /** - * Calculates the squared distance between this points and another one, given as its coordinates. - * @param px The x coordinate of the second point. - * @param py The y coordinate of the second point. - * @returns the squared distance between this points and another one, given as its coordinates. - */ - distanceSq(px:number,py:number):number; - /** - * Calculates the squared distance between this points and another one. - * @param p The second point. - * @returns the squared distance between this points and another one. - */ - distanceSq(p:yfiles.algorithms.Point2D):number; - /** - * Calculates the squared distance between two points, given as their coordinates. - * @param x1 The x coordinate of the first point. - * @param y1 The y coordinate of the first point. - * @param x2 The x coordinate of the second point. - * @param y2 The y coordinate of the second point. - * @returns the squared distance between two points, given as their coordinates. - * @static - */ - static distanceSq(x1:number,y1:number,x2:number,y2:number):number; - /** - * Sets the location of this point to the given coordinates. - * @param x the new x coordinate - * @param y the new y coordinate - */ - setLocation(x:number,y:number):void; - /** - * Creates a {@link yfiles.geometry.Point} from a given {@link yfiles.algorithms.Point2D}. - * @returns The {@link }. - */ - toPoint():yfiles.geometry.Point; - /** - * Sets the location of this point to the same values as for the given point. - * @type {yfiles.algorithms.Point2D} - */ - location:yfiles.algorithms.Point2D; - /** - * Gets the x coordinate of this point. - * @type {number} - */ - x:number; - /** - * Gets the y coordinate of this point. - * @type {number} - */ - y:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Point2D; - } - /** - * Represents a two-dimensional rectangle of size (width x height), located at the point (x, y). - * @class - * @implements {yfiles.lang.ICloneable} - */ - export interface Rectangle2D extends yfiles.lang.Object,yfiles.lang.ICloneable{} - export class Rectangle2D { - /** - * Creates a new rectangle of the specified size at the specified location. - * @param x the x-coordinate of the upper left corner of the created rectangle. - * @param y the y-coordinate of the upper left corner of the created rectangle. - * @param width the width of the created rectangle. - * @param height the height of the created rectangle. - */ - constructor(x:number,y:number,width:number,height:number); - /** - * Creates a new rectangle of size (0 x 0) at the location (0, 0). - */ - constructor(); - /** - * Adds a point, specified by its coordinates, to this rectangle. - *

- * The rectangle will be grown if necessary. Note that for points that would lie on the right or bottom border of the - * rectangle, {@link yfiles.algorithms.Rectangle2D#contains} will still return false for the added point. - *

- * @param px the x coordinate of the point to add - * @param py the y coordinate of the point to add - */ - add(px:number,py:number):void; - /** - * Adds a rectangle to this rectangle. - *

- * The rectangle will be grown to the union of both rectangles - *

- * @param r the rectangle to add - */ - add(r:yfiles.algorithms.Rectangle2D):void; - /** - * Creates a new instance of this class that has the same values as this objects. - * @returns a new instance of this class that has the same values as this objects. - */ - clone():any; - /** - * Checks whether this rectangle completely contains the second specified rectangle. - * @param x the x coordinate of the second rectangle. - * @param y the y coordinate of the second rectangle. - * @param width the width coordinate of the second rectangle. - * @param height the height coordinate of the second rectangle. - * @returns true if this rectangle contains the second one - */ - contains(x:number,y:number,width:number,height:number):boolean; - /** - * Checks if the point specified by the given coordinates is contained in this rectangle. - * @param x the x-coordinate of the point. - * @param y the y-coordinate of the point. - * @returns true if the specified point is contained in this rectangle; false otherwise. - */ - contains(x:number,y:number):boolean; - /** - * Checks whether this rectangle completely contains the second specified rectangle. - * @param rect the rectangle to check for containment - * @returns true if this rectangle contains the second one - */ - contains(rect:yfiles.algorithms.Rectangle2D):boolean; - /** - * Calculates the intersection of this rectangle with the given rectangle and returns the result as new rectangle. - * @param r a rectangle to intersect with this rectangle. - * @returns a new rectangle that represents the calculated intersection. - */ - createIntersection(r:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D; - /** - * Calculates the union of this rectangle with the given rectangle and returns the result as new rectangle. - * @param r a rectangle to union with this rectangle. - * @returns a new rectangle that represents the calculated union. - */ - createUnion(r:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D; - /** - * Calculates the intersection of the first and second specified rectangle and sets the resulting location and size to the - * third rectangle. - * @param src1 the first rectangle to intersect. - * @param src2 the second rectangle to intersect. - * @param dst the rectangle to which the result is set. - * @static - */ - static intersect(src1:yfiles.algorithms.Rectangle2D,src2:yfiles.algorithms.Rectangle2D,dst:yfiles.algorithms.Rectangle2D):void; - /** - * Checks whether this rectangle and the second specified rectangle intersect. - * @param x the x coordinate of the second rectangle. - * @param y the y coordinate of the second rectangle. - * @param width the width coordinate of the second rectangle. - * @param height the height coordinate of the second rectangle. - * @returns true if both rectangles intersect - */ - intersects(x:number,y:number,width:number,height:number):boolean; - /** - * Checks whether this rectangle and the second specified rectangle intersect. - * @param rect the rectangle to check for intersection - * @returns true if both rectangles intersect - */ - intersects(rect:yfiles.algorithms.Rectangle2D):boolean; - /** - * Checks if the line segment specified by the given coordinates intersects this rectangle. - * @param x1 the x-coordinate of the first end point of the line. - * @param y1 the y-coordinate of the first end point of the line. - * @param x2 the x-coordinate of the other end point of the line. - * @param y2 the y-coordinate of the other end point of the line. - * @returns true if the specified line intersects this rectangle; false otherwise. - */ - intersectsLine(x1:number,y1:number,x2:number,y2:number):boolean; - /** - * Sets the outer bounds of this rectangle based on the specified location and size. - * @param x the new x-coordinate of the upper left corner. - * @param y the new y-coordinate of the upper left corner. - * @param width the new width. - * @param height the new height. - */ - setFrame(x:number,y:number,width:number,height:number):void; - /** - * Sets the outer bounds of this rectangle based on the specified new center and corner. - * @param centerX the x-coordinate of the new center of this rectangle. - * @param centerY the y-coordinate of the new center of this rectangle. - * @param cornerX the x-coordinate of any new corner of this rectangle. - * @param cornerY the y-coordinate of any new corner of this rectangle. - */ - setFrameFromCenter(centerX:number,centerY:number,cornerX:number,cornerY:number):void; - /** - * Sets the outer bounds of this rectangle based on the specified new center and corner. - * @param center the new center of this rectangle. - * @param corner any new corner of this rectangle. - */ - setFrameFromCenter(center:yfiles.algorithms.Point2D,corner:yfiles.algorithms.Point2D):void; - /** - * Sets the outer bounds of this rectangle based on the end points of one of its diagonals. - * @param x1 the x-coordinate of the first end point of a diagonal. - * @param y1 the y-coordinate of the first end point of a diagonal. - * @param x2 the x-coordinate of the other end point of a diagonal. - * @param y2 the y-coordinate of the other end point of a diagonal. - */ - setFrameFromDiagonal(x1:number,y1:number,x2:number,y2:number):void; - /** - * Sets the outer bounds of this rectangle based on the end points of one of its diagonals. - * @param p1 the first end point of a diagonal. - * @param p2 the other end point of a diagonal. - */ - setFrameFromDiagonal(p1:yfiles.algorithms.Point2D,p2:yfiles.algorithms.Point2D):void; - /** - * Sets the location and size of this rectangle to the specified values. - * @param x the new x-coordinate of the upper left corner. - * @param y the new y-coordinate of the upper left corner. - * @param width the new width. - * @param height the new height. - */ - setRect(x:number,y:number,width:number,height:number):void; - /** - * Creates a {@link yfiles.geometry.Rect} from a given {@link yfiles.algorithms.Rectangle2D}. - * @returns The {@link }. - */ - toRect():yfiles.geometry.Rect; - /** - * Calculates the union of the first and second specified rectangle and sets the resulting location and size to the third - * rectangle. - * @param src1 the first rectangle to union. - * @param src2 the second rectangle to union. - * @param dst the rectangle to which the result is set. - * @static - */ - static union(src1:yfiles.algorithms.Rectangle2D,src2:yfiles.algorithms.Rectangle2D,dst:yfiles.algorithms.Rectangle2D):void; - /** - * Gets or sets the outer bounds of this rectangle in double coordinates. - * @type {yfiles.algorithms.Rectangle2D} - */ - frame:yfiles.algorithms.Rectangle2D; - /** - * Sets the location and size of this rectangle to be similar to the specified rectangle. - * @type {yfiles.algorithms.Rectangle2D} - */ - rect:yfiles.algorithms.Rectangle2D; - /** - * Gets the x coordinate of the upper left corner. - * @type {number} - */ - x:number; - /** - * Gets the y coordinate of the upper left corner. - * @type {number} - */ - y:number; - /** - * Gets the width of this rectangle. - * @type {number} - */ - width:number; - /** - * Gets the height of this rectangle. - * @type {number} - */ - height:number; - /** - * Gets whether this instance is empty, i.e. - *

- * covers no area. - *

- * @type {boolean} - */ - empty:boolean; - /** - * Gets the smallest x coordinate of this rectangle. - * @type {number} - */ - minX:number; - /** - * Gets the smallest y coordinate of this rectangle. - * @type {number} - */ - minY:number; - /** - * Gets the largest x coordinate of this rectangle. - * @type {number} - */ - maxX:number; - /** - * Gets the largest y coordinate of this rectangle. - * @type {number} - */ - maxY:number; - /** - * Gets the x coordinate of the center point of this rectangle. - * @type {number} - */ - centerX:number; - /** - * Gets the y coordinate of the center point of this rectangle. - * @type {number} - */ - centerY:number; - /** - * Gets the bounds of this instance in double precision. - * @type {yfiles.algorithms.Rectangle2D} - */ - bounds2D:yfiles.algorithms.Rectangle2D; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Rectangle2D; - } - /** - * This class provides algorithms for the triangulation of point sets in the plane. - * @class - * @static - */ - export interface Triangulator extends yfiles.lang.Object{} - export class Triangulator { - /** - * Computes a Delauney triangulation of the given points. - *

- * A Delauney triangulation is a triangulation such that none of the given points is inside the circumcircle of any of the - * calculated triangles. - *

- *

- * The calculated triangulation is represented by an embedded graph, i.e. to each edge there exists a reverse edge and the - * outedges around each node are in embedded order. The returned edge and the (optional) reverseEdgeMap can be used to - * construct all faces of the plane graph and to determine its outer face. - *

- * @param result a graph whose nodes represent the points that need to be triangulated. - * @param pointData must provide the location (YPoint) for each node in the given graph. - * @param revMap a node map that will contain for each edge its reverse edge. If this argument is null then no reverse edge information - * will be available. - * @returns an edge on the outer face of the result graph. - * @static - */ - static calcDelauneyTriangulation(result:yfiles.algorithms.Graph,pointData:yfiles.algorithms.IDataProvider,revMap:yfiles.algorithms.IEdgeMap):yfiles.algorithms.Edge; - /** - * Computes a triangulation of the given points. - *

- * The calculated triangulation is represented by an embedded graph, i.e. to each edge there exists a reverse edge and the - * outedges around each node are in embedded order. The returned edge and the (optional) reverseEdgeMap can be used to - * construct all faces of the plane graph and to determine its outer face. - *

- * @param points the point set to be triangulated. The points must be provided as a YList of YPoints. - * @param result the resulting triangulation - * @param resultMap the node map that forms the link between a point and a node. - * @param reverseEdgeMap a node map that will contain for each edge its reverse edge. If this argument is null then no reverse edge information - * will be available. - * @returns an edge on the outer face of the result graph. - * @static - */ - static triangulatePoints(points:yfiles.algorithms.YList,result:yfiles.algorithms.Graph,resultMap:yfiles.algorithms.INodeMap,reverseEdgeMap:yfiles.algorithms.IEdgeMap):yfiles.algorithms.Edge; - /** - * Computes a triangulation of the given points. - *

- * The calculated triangulation is represented by an embedded graph, i.e. to each edge there exists a reverse edge and the - * outedges around each node are in embedded order. The returned edge and the (optional) reverseEdgeMap can be used to - * construct all faces of the plane graph and to determine its outer face. - *

- * @param result a graph whose nodes represent the points that need to be triangulated. - * @param pointData must provide the location (YPoint) for each node in the given graph. - * @param reverseEdgeMap a node map that will contain for each edge its reverse edge. If this argument is null then no reverse edge information - * will be available. - * @returns an edge on the outer face of the result graph. - * @static - */ - static triangulatePoints(result:yfiles.algorithms.Graph,pointData:yfiles.algorithms.IDataProvider,reverseEdgeMap:yfiles.algorithms.IEdgeMap):yfiles.algorithms.Edge; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Triangulator; - } - /** - * This class represents the size of an object. - *

- * An instance of this class implements the immutable design pattern. - *

- * @class - * @implements {yfiles.lang.IComparable} - */ - export interface YDimension extends yfiles.lang.Object,yfiles.lang.IComparable{} - export class YDimension { - /** - * Creates a new YDimension2D object for given size. - * @param width - * @param height - */ - constructor(width:number,height:number); - /** - * - * @param o - * @returns - */ - compareTo(o:any):number; - /** - * Creates a {@link yfiles.geometry.Size} from a given {@link yfiles.algorithms.YDimension}. - * @returns The {@link }. - */ - toSize():yfiles.geometry.Size; - /** - * Gets the width of the dimension object. - * @type {number} - */ - width:number; - /** - * Gets the height of the dimension object. - * @type {number} - */ - height:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.YDimension; - } - /** - * An oriented rectangle in 2D coordinate space with double precision coordinates. - *

- * The rectangle's height extends from its {@link yfiles.algorithms.YOrientedRectangle#anchor anchor point} in the direction of its up - * vector ({@link yfiles.algorithms.YOrientedRectangle#upX ux}, {@link yfiles.algorithms.YOrientedRectangle#upY uy}). Its width extends from its {@link yfiles.algorithms.YOrientedRectangle#anchor anchor point} in - * direction (-uy, ux) (i.e. perpendicular to the up vector). This means that an oriented rectangle with anchor point (0, 0) width - * 100, height 10, and up vector (0, -1) is a paraxial rectangle with upper left corner (0, -10) and lower right corner - * (100, 0). - *

- * @class - * @implements {yfiles.algorithms.IPlaneObject} - */ - export interface YOrientedRectangle extends yfiles.lang.Object,yfiles.algorithms.IPlaneObject{} - export class YOrientedRectangle { - /** - * Creates a new instance using the provided rectangle's values to initialize anchor, size, and up vector. - * @param rect the provided rectangle. - */ - constructor(rect:yfiles.algorithms.YOrientedRectangle); - /** - * Creates a new instance using the provided rectangle's values to initialize anchor and size. - *

- * The oriented rectangle's up vector will be (0, -1). - *

- * @param rect the provided rectangle. - */ - constructor(rect:yfiles.algorithms.YRectangle); - /** - * Creates a new instance using the provided values to initialize anchor, size, and up vector. - * @param anchorX The x coordinate of the anchor of the oriented rectangle. - * @param anchorY The y coordinate of the anchor of the oriented rectangle. - * @param width The width of the rectangle. - * @param height The height of the rectangle. - * @param upX The x component of the up vector. - * @param upY The y component of the up vector. - */ - constructor(anchorX:number,anchorY:number,width:number,height:number,upX:number,upY:number); - /** - * Creates a new instance using the provided values to initialize anchor and size. - *

- * The oriented rectangle's up vector will be (0, -1). - *

- * @param anchorX The x coordinate of the anchor of the oriented rectangle. - * @param anchorY The y coordinate of the anchor of the oriented rectangle. - * @param width The width of the rectangle. - * @param height The height of the rectangle. - */ - constructor(anchorX:number,anchorY:number,width:number,height:number); - /** - * Creates a new instance using the provided values to initialize anchor, size, and up vector. - * @param position The provider for the dynamic anchor of this instance. - * @param size The provider for the dynamic size of this instance. - * @param upVector The up vector. - */ - constructor(position:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,upVector:yfiles.algorithms.YVector); - /** - * Creates a new instance using the provided values to initialize the anchor and size. - *

- * The oriented rectangle's up vector will be (0, -1). - *

- * @param anchor The provider for the dynamic anchor of this instance. - * @param size The provider for the dynamic size of this instance. - */ - constructor(anchor:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension); - /** - * Copies the actual values from the given OrientedRectangle to this instance. - * @param other the OrientedRectangle to retrieve the values from - */ - adoptValues(other:yfiles.algorithms.YOrientedRectangle):void; - /** - * Determines the four corner points of an oriented rectangle. - * @param rect The rectangle to determine the bounds. - * @returns the array of corner points. - * @static - */ - static calcPoints(rect:yfiles.algorithms.YOrientedRectangle):yfiles.algorithms.YPoint[]; - /** - * Determines the coordinates of the four corners of an oriented rectangle. - * @param rect The rectangle to determine the bounds. - * @returns the array of coordinates of the corner points in which each even index has the x-coordinate and each odd index the - * y-coordinate - * @static - */ - static calcPointsInDouble(rect:yfiles.algorithms.YOrientedRectangle):number[]; - /** - * Determines whether or not the specified point lies inside this oriented rectangle. - * @param x the x-coordinate of the point to check. - * @param y the y-coordinate of the point to check. - * @param [closed=false] if true, all points on the border of the rectangle are considered to be contained. - * @returns true iff the specified point lies inside; false otherwise. - */ - contains(x:number,y:number,closed?:boolean):boolean; - /** - * Determines whether the given rectangle r1 contains rectangle r2, using an epsilon value. - * @param r1 The first rectangle. - * @param r2 The second rectangle. - * @param eps A positive value allows for fuzzy hit testing. If the point lies outside the given object but it's distance is less than - * or equal to that value, it will be considered a hit. - * @returns true iff the r1 contains r2. - * @static - */ - static contains(r1:yfiles.algorithms.YOrientedRectangle,r2:yfiles.algorithms.YOrientedRectangle,eps:number):boolean; - /** - * Determines whether the given oriented rectangle contains the provided point, using an epsilon value. - * @param rect The rectangle. - * @param p The point to test. - * @param eps fuzziness range. A positive value allows for fuzzy hit testing. If a point lies outside the given rectangle, but its - * distance is less than or equal to that value, it will be considered a hit. - * @returns true if the point lies inside the rectangle; false otherwise. - * @static - */ - static contains(rect:yfiles.algorithms.YOrientedRectangle,p:yfiles.algorithms.YPoint,eps:number):boolean; - /** - * Determines whether the given oriented rectangle contains the provided point, using an epsilon value. - * @param rect The rectangle. - * @param x x-coordinate of the point to test. - * @param y y-coordinate of the point to test. - * @param eps fuzziness range. A positive value allows for fuzzy hit testing. If a point lies outside the given rectangle, but its - * distance is less than or equal to that value, it will be considered a hit. - * @returns true if the point lies inside the rectangle; false otherwise. - * @static - */ - static contains(rect:yfiles.algorithms.YOrientedRectangle,x:number,y:number,eps:number):boolean; - /** - * Creates a new OrientedRectangle instance whose anchor point is moved by the specified distance values, but has the same - * width, height, and up vector as this rectangle. - * @param dx the distance to move the anchor point in x-direction. A positive value means "move" to the right, a negative value means - * "move" to the left. - * @param dy the distance to move the anchor point in y-direction. A positive value means "move" downwards, a negative value means - * "move" upwards. - * @returns a new OrientedRectangle instance whose anchor point is moved by the specified distance values. - */ - getMovedInstance(dx:number,dy:number):yfiles.algorithms.YOrientedRectangle; - /** - * Creates a new OrientedRectangle instance that has the specified width and height, but has the same anchor point and up - * vector as this rectangle. - * @param width the width of the new rectangle. - * @param height the height of the new rectangle. - * @returns a new OrientedRectangle instance that has the specified width and height. - */ - getResizedInstance(width:number,height:number):yfiles.algorithms.YOrientedRectangle; - /** - * Determines an intersection point of the specified oriented rectangle and the specified line segment. - *

- * Note: there might be more than one intersection point. However this method only returns one intersection point or null - * if there is no intersection. - *

- * @param rect - * @param line - * @param eps - * @returns an intersection point of the specified oriented rectangle and the specified line segment or null if the rectangle and - * the segment do not intersect. - * @static - */ - static intersectionPoint(rect:yfiles.algorithms.YOrientedRectangle,line:yfiles.algorithms.LineSegment,eps:number):yfiles.algorithms.YPoint; - /** - * Determines whether or not the specified oriented rectangle and the specified line segment intersect. - * @param rect - * @param line - * @param eps - * @returns true if the rectangle and the segment intersect and false otherwise. - * @static - */ - static intersects(rect:yfiles.algorithms.YOrientedRectangle,line:yfiles.algorithms.LineSegment,eps:number):boolean; - /** - * Determines whether a rectangle intersects an oriented rectangle, given an epsilon. - * @param orientedRectangle The oriented rectangle to test. - * @param rectangle The rectangle to test. - * @param eps A positive value allows for fuzzy hit testing. If the point lies outside the given object but it's distance is less than - * or equal to that value, it will be considered a hit. - * @returns Whether they have a non-empty intersection. - * @static - */ - static intersects(orientedRectangle:yfiles.algorithms.YOrientedRectangle,rectangle:yfiles.algorithms.YRectangle,eps:number):boolean; - /** - * Moves this rectangle by applying the offset to the anchor. - * @param dx The x offset to move the rectangle's position by. - * @param dy The y offset to move the rectangle's position by. - */ - moveBy(dx:number,dy:number):void; - /** - * Sets the anchor of this rectangle. - * @param x the new x-coordinate of the anchor point. - * @param y the new y-coordinate of the anchor point. - */ - setAnchor(x:number,y:number):void; - /** - * Sets the anchor of the OrientedRectangle so that the center of the rectangle coincides with the given coordinate pair. - * @param cx The x coordinate of the center. - * @param cy The y coordinate of the center. - */ - setCenter(cx:number,cy:number):void; - /** - * Sets the size of this rectangle. - * @param width the new width. - * @param height the new height. - */ - setSize(width:number,height:number):void; - /** - * Sets the components of the up vector to the new values. - * @param upX The x component of the normalized up vector. - * @param upY The y component of the normalized up vector. - */ - setUpVector(upX:number,upY:number):void; - /** - * Creates an immutable {@link yfiles.geometry.IOrientedRectangle} from a given {@link yfiles.algorithms.YOrientedRectangle}. - * @returns The {@link }. - */ - toImmutableOrientedRectangle():yfiles.geometry.IOrientedRectangle; - /** - * Gets whether this instance has negative width or height. - * @type {boolean} - */ - empty:boolean; - /** - * Gets or sets the anchor of this oriented rectangle. - * @type {yfiles.algorithms.YPoint} - */ - anchor:yfiles.algorithms.YPoint; - /** - * Gets the x-coordinate of this rectangle's anchor point. - * @type {number} - */ - anchorX:number; - /** - * Gets the y-coordinate of this rectangle's anchor point. - * @type {number} - */ - anchorY:number; - /** - * Gets or sets the size of this rectangle. - * @type {yfiles.algorithms.YDimension} - */ - size:yfiles.algorithms.YDimension; - /** - * Gets the width of this rectangle. - * @type {number} - */ - width:number; - /** - * Gets the height of this rectangle. - * @type {number} - */ - height:number; - /** - * Gets the x-component of this rectangle's up vector. - * @type {number} - */ - upX:number; - /** - * Gets the y-component of this rectangle's up vector. - * @type {number} - */ - upY:number; - /** - * Gets or sets the angle (measured in radians) of this rectangle. - *

- * The angle of an oriented rectangle is the angle between the vector (0, -1) and the rectangle's up vector in counter - * clockwise order. An angle of 0 means the up vector points up in direction (0, -1). - *

- * @type {number} - */ - angle:number; - /** - * Gets or sets the current center of the oriented rectangle. - * @type {yfiles.algorithms.YPoint} - */ - center:yfiles.algorithms.YPoint; - /** - * Calculates the paraxial bounding box of this oriented rectangle. - * @type {yfiles.algorithms.YRectangle} - */ - boundingBox:yfiles.algorithms.YRectangle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.YOrientedRectangle; - } - /** - * This class represents a point in the plane with double coordinates. - *

- * This class implements the immutable design pattern. - *

- * @class - * @implements {yfiles.lang.IComparable} - * @final - */ - export interface YPoint extends yfiles.lang.Object,yfiles.lang.IComparable{} - export class YPoint { - /** - * Creates a new YPoint object for a given position. - * @param x the x coordinate of the point. - * @param y the y coordinate of the point. - */ - constructor(x:number,y:number); - /** - * Creates a new YPoint at location (0,0) - */ - constructor(); - /** - * Adds two points and returns the result. - * @param p1 an arbitrary instance of YPoint. - * @param p2 an arbitrary instance of YPoint. - * @returns - * @static - */ - static add(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; - /** - * Comparable implementation. - *

- * YPoints are ordered by ascending x-coordinates. If the x-coordinates of two points equal, then these points are ordered - * by ascending y-coordinates. - *

- * @param o - * @returns - */ - compareTo(o:any):number; - /** - * Returns the euclidean distance between two points. - * @param x1 x-coordinate of first point - * @param y1 y-coordinate of first point - * @param x2 x-coordinate of second point - * @param y2 y-coordinate of second point - * @returns the euclidean distance between first and second point - * @static - */ - static distance(x1:number,y1:number,x2:number,y2:number):number; - /** - * Returns the euclidean distance between two points. - * @param p1 an arbitrary point - * @param p2 an arbitrary point - * @returns the Euclidean distance between p1 and p2. - * @static - */ - static distance(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):number; - /** - * Returns the euclidean distance between this point and a given point. - * @param x the x coordinate of an arbitrary point - * @param y the y coordinate of an arbitrary point - * @returns the Euclidean distance between this point and the point (x,y). - */ - distanceTo(x:number,y:number):number; - /** - * Returns the euclidean distance between this point and a given point. - * @param p an arbitrary point - * @returns the Euclidean distance between this point and p. - */ - distanceTo(p:yfiles.algorithms.YPoint):number; - /** - * Returns a point that geometrically lies in in the middle of the line formed by the given points. - * @param p1 an arbitrary instance of YPoint. - * @param p2 an arbitrary instance of YPoint. - * @returns - * @static - */ - static midPoint(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; - /** - * Returns the point, got by moving this point to another position. - * @param x the value which is added on the x-coordinate of the point. - * @param y the value which is added on the y-coordinate of the point. - * @returns a new instance of YPoint which is the result of the moving operation. - */ - moveBy(x:number,y:number):yfiles.algorithms.YPoint; - /** - * Subtracts two points (p1 - p2) and returns the result. - * @param p1 an arbitrary instance of YPoint. - * @param p2 an arbitrary instance of YPoint. - * @returns - * @static - */ - static subtract(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; - /** - * Returns a copy of the given point with exchanged x- and y-coordinates. - * @param p an arbitrary instance of YPoint. - * @returns - * @static - */ - static swap(p:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; - /** - * Creates a {@link yfiles.geometry.Point} from a given {@link yfiles.algorithms.YPoint}. - * @returns The {@link }. - */ - toPoint():yfiles.geometry.Point; - /** - * A YPoint constant with coordinates (0,0). - * @const - * @static - * @type {yfiles.algorithms.YPoint} - */ - static ORIGIN:yfiles.algorithms.YPoint; - /** - * Gets the x-coordinate of the point object. - * @type {number} - */ - x:number; - /** - * Gets the y-coordinate of the point object. - * @type {number} - */ - y:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.YPoint; - } - /** - * This class represents an ordered list of points in the plane. - * @class - * @final - */ - export interface YPointPath extends yfiles.lang.Object{} - export class YPointPath { - /** - * Creates a new path from an array of points. - * @param path - */ - constructor(path:yfiles.algorithms.YPoint[]); - /** - * Creates a new path from a list of points. - * @param l a list of {@link } instances. - */ - constructor(l:yfiles.collections.IList); - /** - * Creates a new empty path. - */ - constructor(); - /** - * Calculate the (geometric) length of the path. - *

- * The length of the path is the sum of lengths of all line segments making up the path. - *

- * @returns the (geometric) length of the path - */ - calculateLength():number; - /** - * Create a point path with reverse ordering of the points. - * @returns - */ - createReverse():yfiles.algorithms.YPointPath; - /** - * Get the points in the path. - * @returns - */ - cursor():yfiles.algorithms.ICursor; - /** - * Returns a line segment in the path. - * @param i - * @returns - */ - getLineSegment(i:number):yfiles.algorithms.LineSegment; - /** - * Get the number of points in the path. - * @returns - */ - length():number; - /** - * Get the points in the path. - * @returns - */ - lineSegments():yfiles.algorithms.ILineSegmentCursor; - /** - * Get the points in the path. - * @returns - */ - points():yfiles.algorithms.IPointCursor; - /** - * Get the points in the list as array. - * @returns - */ - toArray():yfiles.algorithms.YPoint[]; - /** - * Get the points in the path as list. - * @returns a list of {@link } instances. - */ - toList():yfiles.collections.IList; - /** - * Defines a path with no points. - * @const - * @static - * @type {yfiles.algorithms.YPointPath} - */ - static EMPTY_PATH:yfiles.algorithms.YPointPath; - /** - * Gets the first point in the path. - * @type {yfiles.algorithms.YPoint} - */ - first:yfiles.algorithms.YPoint; - /** - * Gets the last point in the path. - * @type {yfiles.algorithms.YPoint} - */ - last:yfiles.algorithms.YPoint; - /** - * Gets the number of line segments in the path. - * @type {number} - */ - lineSegmentCount:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.YPointPath; - } - /** - * This class defines a rectangle and provides utility methods for it. - * @class - * @extends {yfiles.algorithms.YDimension} - * @implements {yfiles.algorithms.IPlaneObject} - */ - export interface YRectangle extends yfiles.algorithms.YDimension,yfiles.algorithms.IPlaneObject{} - export class YRectangle { - /** - * Creates a new rectangle with given upper left corner and size. - * @param x x-coordinate of upper left corner of the rectangle. - * @param y y-coordinate of upper left corner of the rectangle. - * @param width width of the rectangle. - * @param height height of the rectangle. - */ - constructor(x:number,y:number,width:number,height:number); - /** - * Creates a new rectangle with given upper left corner and size. - * @param pos upper left corner of the rectangle. - * @param size size of the rectangle. - */ - constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension); - /** - * Creates a new rectangle with upper left corner (0,0) and size (0,0). - */ - constructor(); - /** - * Checks whether or not this YRectangle contains the given rectangle. - * @param p - * @returns - */ - contains(p:yfiles.algorithms.YRectangle):boolean; - /** - * Checks whether or not this YRectangle contains the given point. - * @param p - * @returns - */ - contains(p:yfiles.algorithms.YPoint):boolean; - /** - * Checks whether or not this YRectangle contains the rectangle defined by the given frame. - * @param x - * @param y - * @param width - * @param height - * @returns - */ - contains(x:number,y:number,width:number,height:number):boolean; - /** - * Checks whether or not this YRectangle contains the given point. - * @param x the x-coordinate of the point to check. - * @param y the x-coordinate of the point to check. - * @returns true if the point lies inside the rectangle; false otherwise. - */ - contains(x:number,y:number):boolean; - /** - * Determines whether the specified rectangle contains the specified point. - * @param rx the x-coordinate of the upper left corner of the rectangle. - * @param ry the y-coordinate of the upper left corner of the rectangle. - * @param rw the width of the rectangle. - * @param rh the height of the rectangle. - * @param x the x-coordinate of the point to check. - * @param y the x-coordinate of the point to check. - * @param [closed=false] if true, all points on the border of the rectangle are considered to be contained. - * @returns true if the point lies inside the rectangle; false otherwise. - * @static - */ - static contains(rx:number,ry:number,rw:number,rh:number,x:number,y:number,closed?:boolean):boolean; - /** - * Returns the Euclidean distance to the passed rectangle. - *

- * If they overlap, the distance is 0. - *

- * @param other the second rectangle. - * @returns the distance to the given rectangle. - */ - getEuclideanDistance(other:yfiles.algorithms.YRectangle):number; - /** - * Returns the Manhattan distance to the passed rectangle. - *

- * If they overlap the distance is 0. - *

- * @param other the second rectangle. - * @returns the distance to the given rectangle. - */ - getManhattanDistance(other:yfiles.algorithms.YRectangle):number; - /** - * Returns whether or not the given rectangles intersect. - * @param r1 - * @param r2 - * @returns - * @static - */ - static intersects(r1:yfiles.algorithms.YRectangle,r2:yfiles.algorithms.YRectangle):boolean; - /** - * Creates a {@link yfiles.geometry.Rect} from a given {@link yfiles.algorithms.YRectangle}. - * @returns The {@link }. - */ - toRect():yfiles.geometry.Rect; - /** - * Gets x-coordinate of upper left corner. - * @type {number} - */ - x:number; - /** - * Gets y-coordinate of upper left corner. - * @type {number} - */ - y:number; - /** - * Gets coordinates of upper left corner. - * @type {yfiles.algorithms.YPoint} - */ - location:yfiles.algorithms.YPoint; - /** - * Gets this object. - * @type {yfiles.algorithms.YRectangle} - */ - boundingBox:yfiles.algorithms.YRectangle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.YRectangle; - } - /** - * This class represents a vector in the 2-dimensional real vector space. - *

- * This vector is an ordered 2 tuple and is defined by two doubles. - *

- * @class - */ - export interface YVector extends yfiles.lang.Object{} - export class YVector { - /** - * Creates a new vector, whose direction is given by two points. - *

- * The vector is defined by p1 - p2. - *

- * @param p1 The first point. - * @param [p2=null] The second point. If no point is spcified, (0,0) is used instead. - */ - constructor(p1:yfiles.algorithms.YPoint,p2?:yfiles.algorithms.YPoint); - /** - * Creates a new vector which is a copy of another vector. - * @param v the vector, whose values are copied. - */ - constructor(v:yfiles.algorithms.YVector); - /** - * Creates a new vector, whose direction is given by two points. - *

- * The vector is defined by (x1 - x2, y1 - y2). - *

- * @param x1 the X-coordinate of the first point. - * @param y1 the Y-coordinate of the first point. - * @param x2 the X-coordinate of the second point. - * @param y2 the Y-coordinate of the second point. - */ - constructor(x1:number,y1:number,x2:number,y2:number); - /** - * Creates a new vector with given direction. - * @param dx the first coordinate - * @param dy the second coordinate - */ - constructor(dx:number,dy:number); - /** - * Adds a vector to this vector. - * @param v the vector to add. - */ - add(v:yfiles.algorithms.YVector):void; - /** - * Adds the vector to a point and returns the resulting point. - * @param p a point. - * @param v the vector to add to the point. - * @returns p+v - * @static - */ - static add(p:yfiles.algorithms.YPoint,v:yfiles.algorithms.YVector):yfiles.algorithms.YPoint; - /** - * Adds two vectors and returns the result. - * @param v first vector to sum. - * @param w second vector to sum. - * @returns v+w - * @static - */ - static add(v:yfiles.algorithms.YVector,w:yfiles.algorithms.YVector):yfiles.algorithms.YVector; - /** - * Returns the result of the addition of two angles between 0 and 2*Pi. - *

- * The result is calculated modulo 2*Pi. - *

- * @param a1 a value in [0,2Pi). - * @param a2 a value in [0,2Pi). - * @returns The sum of a1 and a2 modulo 2*Pi. - * @static - */ - static addAngle(a1:number,a2:number):number; - /** - * Returns the angle (measured in radians) between two vectors in clockwise order (with regards to screen coordinates) from - * v1 to v2. - *

- * Screen coordinates mean positive x-direction is from left to right and positive y-direction is from top to bottom. - *

- * @param v1 - * @param v2 - * @returns - * @static - */ - static angle(v1:yfiles.algorithms.YVector,v2:yfiles.algorithms.YVector):number; - /** - * Returns this vector with unit length. - * @param v - * @returns - * @static - */ - static getNormal(v:yfiles.algorithms.YVector):yfiles.algorithms.YVector; - /** - * Returns the length of the vector, this is the value of the euclidean norm. - * @returns a value > 0. - */ - length():number; - /** - * Assigns unit length to the vector. - *
- */ - norm():void; - /** - * Returns the vector which is orthogonal to the given one and has unit length. - * @param v a vector. - * @returns a vector which is orthogonal to v with unit length. - * @static - */ - static orthoNormal(v:yfiles.algorithms.YVector):yfiles.algorithms.YVector; - /** - * Returns true if vector v1 is on the right side of v2. - * @param v1 - * @param v2 - * @returns - * @static - */ - static rightOf(v1:yfiles.algorithms.YVector,v2:yfiles.algorithms.YVector):boolean; - /** - * Returns a new YVector instance that is obtained by rotating this vector by the given angle (measured in radians) in - * clockwise direction (with regards to screen coordinates). - *

- * Screen coordinates mean positive x-direction is from left to right and positive y-direction is from top to bottom. - *

- * @param angle the angle of rotation in radians. - * @returns the rotated vector. - */ - rotate(angle:number):yfiles.algorithms.YVector; - /** - * Returns the value of the scalar product of two vectors. - * @param v1 the first vector. - * @param v2 the second vector. - * @returns v1.x * v2.x + v1.y * v2.y - * @static - */ - static scalarProduct(v1:yfiles.algorithms.YVector,v2:yfiles.algorithms.YVector):number; - /** - * Scales the vector by an factor. - * @param factor the scale factor, with which the length is multiplied. - */ - scale(factor:number):void; - /** - * Creates a {@link yfiles.geometry.Point} from a given {@link yfiles.algorithms.YVector}. - * @returns The {@link }. - */ - toPoint():yfiles.geometry.Point; - /** - * Gets the first coordinate of the vector. - * @type {number} - */ - x:number; - /** - * Gets the second coordinate of the vector. - * @type {number} - */ - y:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.YVector; - } - /** - * This class implements a directed graph structure. - *

- * Basically, a directed graph consists of a set of objects called "nodes" (represented by instances of class - * {@link yfiles.algorithms.Node}) and a set of node pairs which are called "edges" (represented by instances of class - * {@link yfiles.algorithms.Edge}). - *
- * The directed stems from the fact that all edges in the graph have direction, i.e., they have a distinct source node and a - * distinct target node. Using the aforementioned pair notation, an edge would be written as (<source node>, <target node>). - *

- *

- * Class Graph presents a proper data type that provides support for all essential operations like element creation, - * removal, access, and iteration. - *
- * Important: Class Graph is the single authority for any structural changes to the graph data type. Specifically, this means that - * there is no way to create or delete a node or an edge without using an actual Graph instance. - *

- *

- * Furthermore, this class is also responsible for providing access to its elements. This is done by means of bidirectional - * cursors that present a read-only view on the node set (interface {@link yfiles.algorithms.INodeCursor}) and edge set (interface - * {@link yfiles.algorithms.IEdgeCursor}). - *

- *

- * Class Graph fires notification events that signal structural changes, like, e.g., creation, removal, reinsertion, or - * modification of graph elements. - *

- *

- * This class provides direct support for the notion of data accessors. It allows to register so-called data providers - * (implementations of interface {@link yfiles.algorithms.IDataProvider}) that hold arbitrary data which is associated to its nodes - * and/or edges. - *
- * Also, it serves as a factory to create so-called maps ({@link yfiles.algorithms.INodeMap}, - * {@link yfiles.algorithms.IEdgeMap}) that can be utilized to bind arbitrary data to nodes and edges. - *

- * @class - */ - export interface Graph extends yfiles.lang.Object{} - export class Graph { - /** - * Instantiates a new Graph object as a partial copy of the given graph. - *

- * Only the subgraph induced by the given cursor will be copied to the new Graph instance. If no cursor is specified, the - * complete graph is copied. Values bound to the argument graph via node and edge keys are available in the new Graph - * instance with the keys registered with graph. Only references to these values are copied. - *

- *

- * The new Graph instance also inherits all graph listeners registered with the given graph. - *

- * @param graph The graph to be (partially) copied. - * @param [subNodes=null] A cursor to iterate over the nodes that actually induce the subgraph to be copied. - */ - constructor(graph:yfiles.algorithms.Graph,subNodes?:yfiles.algorithms.ICursor); - /** - * Instantiates an empty Graph object. - */ - constructor(); - /** - * Registers the given data provider using the given look-up key. - *

- * If there is already a data provider registered with that key, then it will be overwritten with the new one. - *

- * @param providerKey - * @param data - */ - addDataProvider(providerKey:any,data:yfiles.algorithms.IDataProvider):void; - /** - * Redefines an edge's end points and fires corresponding notification events to inform registered listeners. - *

- * Edge e has source node v := sourceReference.source() or v := newSource, if sourceReference == null and target node w := targetReference.target() - * or w := newTarget, if targetReference == null. - *
- * - *
- * Edge e is inserted in such a way that an iteration over the edges at v returns e - *

- *
    - *
  • after sourceReference, if sourceD == AFTER
  • - *
  • before sourceReference, if sourceD == BEFORE,
  • - *
- *

- * and an iteration over the edges at w returns e - *

- *
    - *
  • after targetReference, if targetD == AFTER
  • - *
  • before targetReference, if targetD == BEFORE.
  • - *
- * @param e The edge to be changed. - * @param newSource The new source node. - * @param sourceReference Reference edge for insertion at the new source node. - * @param sourceD One of the object insertion specifiers {@link #BEFORE} or - * {@link #AFTER}. - * @param newTarget The new target node. - * @param targetReference Reference edge for insertion at the new target node. - * @param targetD One of the object insertion specifiers {@link #BEFORE} or - * {@link #AFTER}. - */ - changeEdge(e:yfiles.algorithms.Edge,newSource:yfiles.algorithms.Node,sourceReference:yfiles.algorithms.Edge,sourceD:yfiles.algorithms.GraphElementInsertion,newTarget:yfiles.algorithms.Node,targetReference:yfiles.algorithms.Edge,targetD:yfiles.algorithms.GraphElementInsertion):void; - /** - * Redefines an edge's end points and fires corresponding notification events to inform registered listeners. - *

- * Edge e has source node v := e1.source() and target node w := e2.target(). - *
- * - *
- * Edge e is inserted in such a way that an iteration over the edges at v returns e - *

- *
    - *
  • after e1, if d1 == AFTER
  • - *
  • before e1, if d1 == BEFORE,
  • - *
- *

- * and an iteration over the edges at w returns e - *

- *
    - *
  • after e2, if d2 == AFTER
  • - *
  • before e2, if d2 == BEFORE.
  • - *
- * @param e The edge to be changed. - * @param e1 Reference edge for insertion at a new source node. - * @param e2 Reference edge for insertion at a new target node. - * @param d1 One of the object insertion specifiers {@link #BEFORE} or - * {@link #AFTER}. - * @param d2 One of the object insertion specifiers {@link #BEFORE} or - * {@link #AFTER}. - */ - changeEdge(e:yfiles.algorithms.Edge,e1:yfiles.algorithms.Edge,e2:yfiles.algorithms.Edge,d1:yfiles.algorithms.GraphElementInsertion,d2:yfiles.algorithms.GraphElementInsertion):void; - /** - * Redefines an edge's end points and fires corresponding notification events to inform registered listeners. - *

- * The edge is appended to the lists of incoming and outgoing edges at the given source node and target node, - * respectively. - *

- * @param e The edge to be changed. - * @param newSource The new source node of the given edge. - * @param newTarget The new target node of the given edge. - */ - changeEdge(e:yfiles.algorithms.Edge,newSource:yfiles.algorithms.Node,newTarget:yfiles.algorithms.Node):void; - /** - * Removes all nodes and edges from this graph and fires corresponding notification events to inform registered listeners. - */ - clear():void; - /** - * Whether or not this graph contains the given edge. - * @param e - * @returns - */ - contains(e:yfiles.algorithms.Edge):boolean; - /** - * Whether or not this graph contains the given node. - * @param v - * @returns - */ - contains(v:yfiles.algorithms.Node):boolean; - /** - * Returns whether or not this graph contains an edge that connects the given nodes. - * @param source The source node. - * @param target The target node. - * @returns - * @see yfiles.algorithms.Node#getEdgeTo - * @see yfiles.algorithms.Node#getEdgeFrom - * @see yfiles.algorithms.Node#getEdge - */ - containsEdge(source:yfiles.algorithms.Node,target:yfiles.algorithms.Node):boolean; - /** - * Creates a copy of this graph. - *

- * Invokes {@link yfiles.algorithms.Graph#Graph}. - *

- * @returns The newly created Graph object. - */ - createCopy():yfiles.algorithms.Graph; - /** - * Creates a new edge in this graph to be ordered before or after a given edge and fires a corresponding notification event - * to inform registered listeners. - *

- * The new edge e has source node v and target node w, i.e., would be written as edge e = (v, w). - *
- * - *
- * Edge e is inserted in such a way that an iteration over the edges at node v returns e - *

- *
    - *
  • after e1, if d1 == AFTER
  • - *
  • before e1, if d1 == BEFORE,
  • - *
- *

- * and an iteration over the edges at w returns e - *

- *
    - *
  • after e2, if d2 == AFTER
  • - *
  • before e2, if d2 == BEFORE.
  • - *
- * @param v The source node of the edge. - * @param e1 An edge with source node v. - * @param w The target node of the edge. - * @param e2 An edge with target node w. - * @param d1 One of the object insertion specifiers {@link #BEFORE} or - * {@link #AFTER}. - * @param d2 One of the object insertion specifiers {@link #BEFORE} or - * {@link #AFTER}. - * @returns The newly created Edge object. - */ - createEdge(v:yfiles.algorithms.Node,e1:yfiles.algorithms.Edge,w:yfiles.algorithms.Node,e2:yfiles.algorithms.Edge,d1:yfiles.algorithms.GraphElementInsertion,d2:yfiles.algorithms.GraphElementInsertion):yfiles.algorithms.Edge; - /** - * Creates a new edge in this graph and fires a corresponding notification event to inform registered listeners. - *

- * The new edge has source node v and target node w, i.e., would be written as edge e = (v, w). - *

- *

- * The edge is appended to the lists of incoming and outgoing edges at the source node and target node, respectively. - *

- * @param v The source node of the edge. - * @param w The target node of the edge. - * @returns The newly created Edge object. - */ - createEdge(v:yfiles.algorithms.Node,w:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Returns a newly created edge map that is valid for the edges in this graph. - *

- * The implementation returned by this method can be used for any edge that is part of this Graph instance at any point of - * time, i.e., it is safe to modify the graph structure (add and remove nodes and edges) freely. - *

- *

- * The implementation returned uses O(m) memory at all times and provides true O(1) read and write access for each edge. - *

- *

- * In order to release the resources held by this map, {@link yfiles.algorithms.Graph#disposeEdgeMap} has to be called. - *

- * @returns - */ - createEdgeMap():yfiles.algorithms.IEdgeMap; - /** - * Creates an empty base object of the same type as this graph. - *

- * Subclasses should override this method. - *

- * @returns - */ - createGraph():yfiles.algorithms.Graph; - /** - * Creates a new node in this graph and fires a corresponding notification event to inform registered listeners. - * @returns The newly created Node object. - */ - createNode():yfiles.algorithms.Node; - /** - * Returns a newly created node map that is valid for the nodes in this graph. - *

- * The implementation returned by this method can be used for any node that is part of this Graph instance at any point of - * time, i.e., it is safe to modify the graph structure (add and remove nodes and edges) freely. - *

- *

- * The implementation returned uses O(n) memory at all times and provides true O(1) read and write access for each node. - *

- *

- * In order to release the resources held by this map, {@link yfiles.algorithms.Graph#disposeNodeMap} has to be called. - *

- * @returns - */ - createNodeMap():yfiles.algorithms.INodeMap; - /** - * Informs the graph that the given edge map is no longer needed. - *

- * This method is used for EdgeMap implementations that have been obtained using the {@link yfiles.algorithms.Graph#createEdgeMap} - * factory method. - *

- *

- * Calling this method will destroy the edge map and associated resources can be freed. It is strongly recommended to - * dispose of all edge maps that are not needed anymore using this method. - *

- * @param map - */ - disposeEdgeMap(map:yfiles.algorithms.IEdgeMap):void; - /** - * Informs the graph that the given node map is no longer needed. - *

- * This method is used for NodeMap implementations that have been obtained using the {@link yfiles.algorithms.Graph#createNodeMap} - * factory method. - *

- *

- * Calling this method will destroy the node map and associated resources can be freed. It is strongly recommended to - * dispose of all node maps that are not needed anymore using this method. - *

- * @param map - */ - disposeNodeMap(map:yfiles.algorithms.INodeMap):void; - /** - * Low-level iteration support for adjacent edges. - * @param v - * @returns - * @protected - * @static - */ - static firstOutEdge(v:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Returns the data provider that is registered with the graph using the given look-up key. - *

- * The look-up domain of a returned data provider normally consists of either the nodes of the graph, or its edges, or - * both. - *

- * @param providerKey - * @returns - */ - getDataProvider(providerKey:any):yfiles.algorithms.IDataProvider; - /** - * Returns an array containing all edges of this graph. - * @returns - */ - getEdgeArray():yfiles.algorithms.Edge[]; - /** - * Provides access to the edges of the graph. - * @returns An EdgeCursor to iterate over the edges in the graph. - */ - getEdgeCursor():yfiles.algorithms.IEdgeCursor; - /** - * Returns an array containing all nodes of this graph. - * @returns - */ - getNodeArray():yfiles.algorithms.Node[]; - /** - * Provides access to the nodes of the graph. - * @returns A NodeCursor to iterate over the nodes in the graph. - */ - getNodeCursor():yfiles.algorithms.INodeCursor; - /** - * Hides the given node from this graph. - *

- * Hiding a node means to (temporarily) remove the node from the graph. - *

- *

- * The only difference to a proper node removal as performed by {@link yfiles.algorithms.Graph#removeNode} is that no event will be - * emitted that signals the structural change (i.e. the node's removal). - *

- *

- * Generally, hiding should only be used in the sense of temporarily removing an object that will be reinserted shortly after. - *

- *

- * To reinsert a hidden node use {@link yfiles.algorithms.Graph#unhide}. - *

- * @param v - * @see yfiles.algorithms.Graph#hide - * @see yfiles.algorithms.Graph#unhide - */ - hide(v:yfiles.algorithms.Node):void; - /** - * Hides the given edge from this graph. - *

- * Hiding an edge means to (temporarily) remove the edge from the graph. - *

- *

- * The only difference to a proper edge removal as performed by {@link yfiles.algorithms.Graph#removeEdge} is that no event will be - * emitted that signals the structural change (i.e. the edge's removal). - *

- *

- * Generally, hiding should only be used in the sense of temporarily removing an object that will be reinserted shortly after. - *

- *

- * To reinsert a hidden edge use {@link yfiles.algorithms.Graph#unhide}. - *

- * @param e - * @see yfiles.algorithms.Graph#hide - * @see yfiles.algorithms.Graph#unhide - */ - hide(e:yfiles.algorithms.Edge):void; - /** - * Moves the given edge to the first position within the sequence of edges in this graph. - * @param e - */ - moveToFirst(e:yfiles.algorithms.Edge):void; - /** - * Moves the given node to the first position within the sequence of nodes in this graph. - * @param v - */ - moveToFirst(v:yfiles.algorithms.Node):void; - /** - * Moves the given edge to the last position within the sequence of edges in this graph. - * @param e - */ - moveToLast(e:yfiles.algorithms.Edge):void; - /** - * Moves the given node to the last position within the sequence of nodes in this graph. - * @param v - */ - moveToLast(v:yfiles.algorithms.Node):void; - /** - * For internal debugging purposes only. - */ - printNodeSlotSize():void; - /** - * Reinserts a formerly removed edge into this graph and fires a corresponding notification event to inform registered - * listeners. - *

- * The reinserted edge is appended to the sequence of edges in this graph, i.e., normally, its new position does not match - * the position before its removal. The same holds for the edge's positions in the list of incoming and outgoing edges at - * its source node and target node, respectively. - *

- *

- * Note that reinserting an edge whose source/target is not in the graph (e.g., because it's currently hidden/removed) - * causes an exception. Hence, in such cases, you first have to unhide/reinsert the corresponding endpoints. - *

- * @param e The edge to be reinserted. - * @see yfiles.algorithms.Graph#removeEdge - */ - reInsertEdge(e:yfiles.algorithms.Edge):void; - /** - * Reinserts a formerly removed node into this graph and fires a corresponding notification event to inform registered - * listeners. - *

- * The reinserted node is appended to the sequence of nodes in this graph, i.e., normally, its new position does not match - * the position before its removal. - *

- * @param v The node to be reinserted. - * @see yfiles.algorithms.Graph#removeNode - */ - reInsertNode(v:yfiles.algorithms.Node):void; - /** - * Removes the data provider that is registered using the given look-up key. - * @param providerKey - */ - removeDataProvider(providerKey:any):void; - /** - * Removes the given edge from this graph and fires a corresponding notification event to inform registered listeners. - *

- * The edge will be deselected before it gets removed. - *

- * @param e The edge to be removed. - */ - removeEdge(e:yfiles.algorithms.Edge):void; - /** - * Removes the given node from this graph. - *

- * All edges connecting to the given node are removed as well (preceding the actual node removal). Corresponding - * notification events are fired to inform registered listeners. - *

- *

- * The node will be deselected before it gets removed. - *

- * @param v The node to be removed from this graph. - */ - removeNode(v:yfiles.algorithms.Node):void; - /** - * Reverses the given edge and fires corresponding notification events to inform registered listeners. - *

- * This operation exchanges source and target node of the edge. - *

- * @param e - */ - reverseEdge(e:yfiles.algorithms.Edge):void; - /** - * Sorts incoming and outgoing edges at each node of the graph. - *

- * If a given comparator is null, then the corresponding edges (i.e., incoming/outgoing) will not be sorted. This sorts the - * order of the edges as returned by {@link yfiles.algorithms.Node#getOutEdgeCursor} and {@link yfiles.algorithms.Node#getInEdgeCursor} - * respectively. - *

- * @param inComparer The comparator used for the incoming edges at each node. - * @param outComparer The comparator used for the outgoing edges at each node. - */ - sortEdges(inComparer:yfiles.collections.IComparer,outComparer:yfiles.collections.IComparer):void; - /** - * Sorts the internally held list of edges. - *

- * If the given comparator is null, then the edges will not be sorted. This list determines the order of the edges as - * returned by {@link yfiles.algorithms.Graph#getEdgeCursor}. - *

- * @param comparer The comparator used for the edges. - */ - sortEdges(comparer:yfiles.collections.IComparer):void; - /** - * Sorts the internally held list of nodes. - *

- * If the given comparator is null, then the nodes will not be sorted. This list determines the order of the nodes as - * returned by {@link yfiles.algorithms.Graph#getNodeCursor}. - *

- * @param comparer The comparator used for the nodes. - */ - sortNodes(comparer:yfiles.collections.IComparer):void; - /** - * Unhides the given node in this graph. - *

- * Unhiding a node means to reinsert a node that was formerly hidden from this graph by a call to - * {@link yfiles.algorithms.Graph#hide}. - *

- *

- * The only difference to a proper node reinsertion as performed by {@link yfiles.algorithms.Graph#reInsertNode} is that no event - * will be emitted that signals the structural change (i.e. the node's reinsertion). - *

- * @param v - */ - unhide(v:yfiles.algorithms.Node):void; - /** - * Unhides the given edge in this graph. - *

- * Unhiding an edge means to reinsert an edge that was formerly hidden from this graph by a call to - * {@link yfiles.algorithms.Graph#hide}. - *

- *

- * The only difference to a proper edge reinsertion as performed by {@link yfiles.algorithms.Graph#reInsertEdge} is that no event - * will be emitted that signals the structural change (i.e. the edge's reinsertion). - *

- *

- * Note that unhiding an edge whose source/target is not in the graph (e.g., because it's currently hidden/removed) causes - * an exception. Hence, in such cases, you first have to unhide/reinsert the corresponding endpoints. - *

- * @param e - * @see yfiles.algorithms.Graph#hide - * @see yfiles.algorithms.Graph#unhide - */ - unhide(e:yfiles.algorithms.Edge):void; - /** - * Gets the number of nodes in this graph. - *

- * Same as {@link yfiles.algorithms.Graph#nodeCount}. - *

- * @type {number} - */ - n:number; - /** - * Gets the number of nodes in this graph. - * @type {number} - */ - nodeCount:number; - /** - * Gets the number of edges in this graph. - *

- * Same as {@link yfiles.algorithms.Graph#edgeCount}. - *

- * @type {number} - */ - e:number; - /** - * Gets the number of edges in this graph. - * @type {number} - */ - edgeCount:number; - /** - * Gets true if this graph contains no nodes. - * @type {boolean} - */ - empty:boolean; - /** - * Gets the first node in this graph. - * @type {yfiles.algorithms.Node} - */ - firstNode:yfiles.algorithms.Node; - /** - * Gets the first edge in this graph. - * @type {yfiles.algorithms.Edge} - */ - firstEdge:yfiles.algorithms.Edge; - /** - * Gets the last node in this graph. - * @type {yfiles.algorithms.Node} - */ - lastNode:yfiles.algorithms.Node; - /** - * Gets the last edge in this graph. - * @type {yfiles.algorithms.Edge} - */ - lastEdge:yfiles.algorithms.Edge; - /** - * Gets all node maps that have been created by this graph but have not yet been disposed. - * @see yfiles.algorithms.Graph#createNodeMap - * @see yfiles.algorithms.Graph#disposeNodeMap - * @type {Array.} - */ - registeredNodeMaps:yfiles.algorithms.INodeMap[]; - /** - * Gets all edge maps that have been created by this graph but have not yet been disposed. - * @see yfiles.algorithms.Graph#createEdgeMap - * @see yfiles.algorithms.Graph#disposeEdgeMap - * @type {Array.} - */ - registeredEdgeMaps:yfiles.algorithms.IEdgeMap[]; - /** - * Gets an array of all data provider look-up keys that are registered with this graph. - * @type {Array.} - */ - dataProviderKeys:any[]; - /** - * Yields a dynamic {@link yfiles.collections.IEnumerable.} for - * {@link yfiles.algorithms.Node}s that can be used to iterate over the nodes that are contained in this instance. - *

- * This is a live enumerable and will thus reflect the current state of the graph. Note that changes to the graph structure - * during the traversal should be carried out with great care. - *

- * @type {yfiles.collections.IEnumerable.} - */ - nodes:yfiles.collections.IEnumerable; - /** - * Yields a dynamic {@link yfiles.collections.IEnumerable.} for - * {@link yfiles.algorithms.Edge}s that can be used to iterate over the edges that are contained in this instance. - *

- * This is a live enumerable and will thus reflect the current state of the graph. Note that changes to the graph structure - * during the traversal should be carried out with great care. - *

- * @type {yfiles.collections.IEnumerable.} - */ - edges:yfiles.collections.IEnumerable; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Graph; - } - /** - * This class provides methods that check structural properties of a given graph. - *

- * Definitions - *

- *
    - *
  • Cycle: An edge path with vertices v0, v1, v2, ... , vk forms a cycle if v0 = vk and consists of at least one edge.
  • - *
  • Acyclic graph: A graph that contains no directed cycle.
  • - *
  • Cyclic graph: A graph that contains a directed cycle.
  • - *
  • Connected graph: A graph in which there exists an undirected path of edges between every pair of nodes.
  • - *
  • Strongly connected graph: A graph in which there exists a directed path between each pair of nodes.
  • - *
  • Biconnected graph: A graph that has no cut vertex or articulation point (i.e., a node whose removal disconnects the graph).
  • - *
  • Bipartite graph: A graph whose nodes can be partitioned into two sets such that each edge connects two nodes of different sets.
  • - *
  • - * Tree graph: An acyclic graph, in which any pair of vertices is connected through a path. If one vertex of a tree is distinguished - * from the other vertices, then the tree is called rooted tree. - *
  • - *
  • N-ary tree graph: A directed rooted tree where each node has a maximum of n children.
  • - *
  • Forest graph: A graph whose connected components are trees.
  • - *
  • Simple graph: A graph that contains no self-loops and parallel edges.
  • - *
  • Planar graph: A graph that can be drawn on the plane without edge crossings.
  • - *
- * @class - * @static - */ - export interface GraphChecker extends yfiles.lang.Object{} - export class GraphChecker { - /** - * Checks whether or not the given directed graph is acyclic. - *

- * A graph is called acyclic if it contains no directed cycle. - *

- * @param graph the given graph - * @returns true if the graph is acyclic, false, otherwise - * @static - */ - static isAcyclic(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given undirected graph is biconnected. - *

- * A graph is called biconnected if it has no cut vertex or articulation point, i.e., no node whose removal disconnects the graph. - *

- * @param graph the given undirected graph - * @returns true if the graph is biconnected, false otherwise - * @static - */ - static isBiconnected(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given undirected graph is bipartite. - *

- * A graph is called bipartite if its nodes can be partitioned into two sets such that each edge connects two nodes of different - * sets. - *

- * @param graph the given undirected graph - * @returns true if the graph is bipartite, false otherwise - * @static - */ - static isBipartite(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given graph is connected. - *

- * A graph is called connected if there exists an undirected path of edges between every pair of nodes. - *

- * @param graph the given graph - * @returns true if the graph is connected, false otherwise - * @static - */ - static isConnected(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given directed graph is cyclic. - *

- * A graph is called cyclic if it contains a directed cycle. - *

- * @param graph the given graph - * @returns true if the graph is cyclic, false, otherwise - * @static - */ - static isCyclic(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether the given graph is a forest. - *

- * A graph is a forest if its connected components are trees. - *

- * @param graph the given graph - * @returns true if the graph is a forest, false otherwise - * @static - */ - static isForest(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given undirected graph contains no multiple edges. - *

- * More precisely, the method returns true if the graph contains no two distinct edges e1, e2 that connect the same pairs - * of nodes in either direction. - *

- * @param graph the given undirected graph - * @returns true if the graph contains no multiple edges, false otherwise - * @static - */ - static isMultipleEdgeFree(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given graph is a directed rooted tree where each node has a maximum of n children. - * @param graph the given graph - * @param n - * @returns true if the graph is a directed rooted tree where each node has at most n children, false otherwise - * @static - */ - static isNaryTree(graph:yfiles.algorithms.Graph,n:number):boolean; - /** - * Checks whether or not the given directed graph is a directed rooted tree. - * @param graph the given graph - * @returns true if the graph is a directed rooted tree, false otherwise - * @static - */ - static isRootedTree(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given graph contains no self-loops. - * @param graph the given graph - * @returns true if the graph contains no self-loops, false otherwise - * @static - */ - static isSelfLoopFree(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given directed graph is simple. - *

- * A graph is called simple if it contains no two distinct edges e1, e2 where - * e1.source() == e2.source() && e1.target() == e2.target(). - *

- * @param graph the given directed graph - * @returns true if the graph is simple, false otherwise - * @static - */ - static isSimple(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given directed graph is strongly connected. - *

- * A graph is called strongly connected if there exists a directed path between each pair of nodes. - *

- * @param graph the given directed graph - * @returns true if the graph is strongly connected, false, otherwise - * @static - */ - static isStronglyConnected(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given graph is an undirected tree. - * @param graph the given graph - * @returns true if the graph is an undirected tree, false otherwise - * @static - */ - static isTree(graph:yfiles.algorithms.Graph):boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.GraphChecker; - } - /** - * This class provides algorithms for determining certain connectivity components within a graph. - *

- * It also provides convenience methods for working with these components. - *

- *

- * Definitions - *

- *
    - *
  • Connected graph: A graph is called connected if there exists an undirected path of edges between every pair of nodes.
  • - *
  • Strongly connected graph: A graph is called strongly connected if there exists a directed path between each pair of nodes.
  • - *
  • - * Biconnected graph: A graph is called biconnected if it has no cut vertex or articulation point (i.e., a node whose removal disconnects the - * remaining graph). - *
  • - *
- * @class - * @static - */ - export interface GraphConnectivity extends yfiles.lang.Object{} - export class GraphConnectivity { - /** - * Calculates the biconnected components and the articulation points of a given undirected graph and returns the number of - * biconnected components. - *

- * Articulation points are returned in the form of a {@link yfiles.algorithms.INodeMap} that returns for each node a boolean value - * indicating whether or not it is an articulation point. - *

- * @param graph the input graph - * @param compNum the {@link } that will be filled during the execution and returns the zero-based index of the - * biconnected component to which each edge belongs or -1 for self-loops - * @param [aPoint=null] the {@link } that will be filled during the execution and returns a boolean value indicating whether - * or not a given node is an articulation point - * @returns the number of biconnected components - * @see yfiles.algorithms.GraphConnectivity#biconnectedComponents - * @see yfiles.algorithms.GraphConnectivity#biconnectedComponents - * @static - */ - static biconnectedComponents(graph:yfiles.algorithms.Graph,compNum:yfiles.algorithms.IEdgeMap,aPoint?:yfiles.algorithms.INodeMap):number; - /** - * Calculates the biconnected components of a given undirected graph. - *

- * The result is returned as an array of - * {@link yfiles.algorithms.EdgeList}s each containing all edges that belong to the same biconnected component. - *

- * @param graph the input graph - * @returns an array of {@link }s each containing all edges that belong to the same biconnected component - * @see yfiles.algorithms.GraphConnectivity#biconnectedComponents - * @static - */ - static biconnectedComponents(graph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList[]; - /** - * Calculates the connected components of a given graph and returns their number. - *

- * A graph G is called connected if there exists an undirected path of edges between every pair of nodes. - *

- *

- * The connected components of a graph are the maximal connected subgraphs of which the graph consists. - *

- * @param compNum the {@link } that will be filled during the execution and returns the zero-based index of the - * connected component to which each node belongs - * @param graph - * @returns the number of connected components of the given graph - * @static - */ - static connectedComponents(graph:yfiles.algorithms.Graph,compNum:yfiles.algorithms.INodeMap):number; - /** - * Calculates the connected components of a given graph. - *

- * A graph G is called connected if there exists an undirected path of edges between every pair of nodes. - *

- *

- * The connected components of a graph are the maximal connected subgraphs of which the graph consists. - *

- * @param graph the input graph - * @returns an array of {@link }s each of which contains the nodes that belong to the same connected component - * @static - */ - static connectedComponents(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList[]; - /** - * Determines the direct or indirect neighbors of a given set of nodes. - *
    - *
  • A direct neighbor of a node is directly connected by an edge to that node.
  • - *
  • An indirect neighbor of a node is directly connected to another direct or indirect neighbor of a node.
  • - *
- *

- * The order of the returned nodes is determined by a breadth first search. No start node will be part of the resulting - * set. - *

- *

- * To obtain the result, an integer value should be given as input that limits the distance between a start node and a - * returned node. For all returned nodes there must be a path to a start node that has a length equal to or smaller than - * this distance. - *

- *

- * Setting the maximum distance to 1 will only yield the direct neighbors of all start nodes. On the other hand, setting - * the maximum distance to graph.N() or larger will yield all neighbors of all start nodes. - *

- * @param graph - * @param startNodes - * @param maxDistance - * @returns a {@link } that contains all direct and indirect neighbors of a node - * @static - */ - static getNeighbors(graph:yfiles.algorithms.Graph,startNodes:yfiles.algorithms.NodeList,maxDistance:number):yfiles.algorithms.NodeList; - /** - * Determines the direct or indirect predecessors of a given list of nodes. - *
    - *
  • A direct predecessor of a node is the source node of an incoming edge connected to a node.
  • - *
  • An indirect predecessor of a node is a direct predecessor to another predecessor of a node.
  • - *
- *

- * The order of the returned nodes is determined by a breadth first search. No start node will be part of the resulting - * set. - *

- *

- * To obtain the result, an integer value should be given as input that limits the distance between a start node and a - * returned node. For all returned nodes there must be a path to a start node that has a length equal to or smaller than - * this distance. - *

- *

- * Setting the maximum distance to 1 will only yield the direct predecessors of all start nodes. On the other hand, setting - * the maximum distance to graph.N() or larger will yield all predecessors of all start nodes. - *

- * @param graph the given graph - * @param startNodes a {@link } containing the nodes from which the search starts - * @param maxDistance an integer value that limits the distance between a start node and a returned node - * @returns a {@link } that contains all direct and indirect predecessors of a node - * @static - */ - static getPredecessors(graph:yfiles.algorithms.Graph,startNodes:yfiles.algorithms.NodeList,maxDistance:number):yfiles.algorithms.NodeList; - /** - * Determines the direct or indirect successors of a given list of nodes. - *
    - *
  • A direct successor of a node is the target node of an outgoing edge connected to a node.
  • - *
  • An indirect successor of a node is a direct successor to another successor of a node.
  • - *
- *

- * The order of the returned nodes is determined by a breadth first search. No start node will be part of the resulting - * set. - *

- *

- * To obtain the result, an integer value should be given as input that limits the distance between a start node and a - * returned node. For all returned nodes there must be a path to a start node that has a length equal to or smaller than - * this distance. - *

- *

- * Setting the maximum distance to 1 will only yield the direct successors of all start nodes. On the other hand, setting - * the maximum distance to graph.N() or larger will yield all successors of all start nodes. - *

- * @param graph the given graph - * @param startNodes a {@link } containing the nodes from which the search starts - * @param maxDistance an integer value that limits the distance between a start node and a returned node - * @returns a {@link } that contains all direct and indirect successors of a node - * @static - */ - static getSuccessors(graph:yfiles.algorithms.Graph,startNodes:yfiles.algorithms.NodeList,maxDistance:number):yfiles.algorithms.NodeList; - /** - * Checks whether or not the given undirected graph is biconnected. - *

- * A graph is called biconnected if it has no cut vertex or articulation point, i.e., no node whose removal disconnects the graph. - *

- * @param graph the given undirected graph - * @returns true if the graph is biconnected, false otherwise - * @static - */ - static isBiconnected(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given graph is connected. - *

- * A graph is called connected if there exists an undirected path of edges between every pair of nodes. - *

- * @param graph the given graph - * @returns true if the graph is connected, false otherwise - * @static - */ - static isConnected(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given directed graph is strongly connected. - *

- * A graph is called strongly connected if there exists a directed path between each pair of nodes. - *

- * @param graph the given directed graph - * @returns true if the graph is strongly connected, false, otherwise - * @static - */ - static isStronglyConnected(graph:yfiles.algorithms.Graph):boolean; - /** - * Makes the given graph biconnected by inserting a minimum number of edges in the graph. - *

- * The given graph is considered to be undirected. - *

- * @param graph the input graph - * @returns an {@link } containing the edges added to the graph - * @static - */ - static makeBiconnected(graph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList; - /** - * Makes a graph connected by adding additional edges to the graph. - *

- * The number of edges that will be added equals the number of separate components of the original graph minus 1. - *

- * @param graph the input graph - * @returns an {@link } containing the edges added to the graph - * @static - */ - static makeConnected(graph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList; - /** - * Determines the set of nodes that are reachable from a given node when a set of edges that cannot be traversed is - * specified. - *

- * The result is based on a depth first search. - *

- * @param graph the given graph - * @param start the node from which the search starts - * @param directed true if the edges should be traversed from source to target, false if edges can be traversed in both directions - * @param [forbidden=null] an array that holds for each {@link } a {@link } value indicating whether or not an edge can be traversed; an edge - * e is marked as forbidden if forbidden[e.index()] == true - * @param reached an array that will be filled during the execution and returns for each {@link } a {@link } value based on whether - * the node can be reached during the DFS; if a node v is reachable, then reached[v.index()] = true - * @static - */ - static reachable(graph:yfiles.algorithms.Graph,start:yfiles.algorithms.Node,directed:boolean,reached:boolean[],forbidden?:boolean[]):void; - /** - * Calculates the strongly connected components of a given graph and returns their number. - *

- * A graph is called strongly connected if there exists a directed path between each pair of nodes. - *

- *

- * The strongly connected components of a graph are the strongly connected subgraphs of which it consists. - *

- * @param graph the input graph - * @param compNum the {@link } that will be filled during the execution and returns the zero-based index of the - * connected component to which each node belongs - * @returns the number of strongly connected components of the given graph - * @see yfiles.algorithms.GraphConnectivity#stronglyConnectedComponents - * @static - */ - static stronglyConnectedComponents(graph:yfiles.algorithms.Graph,compNum:yfiles.algorithms.INodeMap):number; - /** - * Calculates the strongly connected components of a given graph. - *

- * A graph is called strongly connected if there exists a directed path between each pair of nodes. - *

- *

- * The strongly connected components of a graph are the strongly connected subgraphs of which it consists. - *

- * @param graph the input graph - * @returns an array of - * {@link }s each of which contains the nodes that belong to the same strongly connected component - * @see yfiles.algorithms.GraphConnectivity#stronglyConnectedComponents - * @static - */ - static stronglyConnectedComponents(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList[]; - /** - * Transforms the return values of {@link yfiles.algorithms.GraphConnectivity#biconnectedComponents} to an array of - * {@link yfiles.algorithms.EdgeList}s, like it is returned by {@link yfiles.algorithms.GraphConnectivity#biconnectedComponents}. - * @param graph the input graph - * @param compNum the {@link } that will be filled during the execution and returns the zero-based index of the - * connected component to which each edge belongs - * @param maxCompNum the maximum number of biconnected components - * @returns an array of {@link }s each containing all edges that belong to the same biconnected component - * @static - */ - static toEdgeListArray(graph:yfiles.algorithms.Graph,compNum:yfiles.algorithms.IEdgeMap,maxCompNum:number):yfiles.algorithms.EdgeList[]; - /** - * Transforms the return values of method {@link yfiles.algorithms.GraphConnectivity#connectedComponents} to an array of - * {@link yfiles.algorithms.NodeList}s, like it is returned by {@link yfiles.algorithms.GraphConnectivity#connectedComponents}. - * @param graph the input graph - * @param compNum the {@link } that will be filled during the execution and returns the zero-based index of the - * connected component to which each node belongs - * @param maxCompNum the maximum number of connected components - * @returns an array of {@link }s each of which contains the nodes that belong to the same connected component - * @static - */ - static toNodeListArray(graph:yfiles.algorithms.Graph,compNum:yfiles.algorithms.INodeMap,maxCompNum:number):yfiles.algorithms.NodeList[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.GraphConnectivity; - } - /** - * Common base type for both {@link yfiles.algorithms.Node} and {@link yfiles.algorithms.Edge}. - *

- * This type does not add public functionality to its base type. - *

- * @class - */ - export interface GraphObject extends yfiles.lang.Object{} - export class GraphObject { - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.GraphObject; - } - /** - * This class provides the result of hierarchical clustering algorithms by means of a binary tree structure. - *

- * The dendrogram is created using the agglomerative strategy (i.e., a bottom-up approach) based on the following steps: - *

- *
    - *
  • - * At the beginning (i.e., at level - * 0), each node belongs to its own cluster. At this point, each node of the original graph (the one that will be - * clustered) is mapped to one of the dendrogram nodes that represent a leaf node (i.e., a node with no children). - *
  • - *
  • - * At each step, pairs of clusters are merged while moving up to the hierarchy. In this case, a new dendrogram node is - * created and the corresponding dissimilarity value between the two merged clusters can be obtained using - * {@link yfiles.algorithms.Dendrogram#getDissimilarityValue}. The dissimilarity values are monotone increasing starting from zero - * which corresponds to the leaf nodes of the dendrogram. - *
  • - *
  • - * The algorithm continues until all nodes belong to the same cluster. At this point, the root of the dendrogram is reached - * and can be obtained using method {@link yfiles.algorithms.Dendrogram#root}. - *
  • - *
- *

- * The dendrogram is a binary tree that is directed from the root to the leaves. This means that one can iterate the - * dendrogram starting with the {@link yfiles.algorithms.Dendrogram#root root node}, moving on to its {@link yfiles.algorithms.Dendrogram#getChildren children}, then moving on to their children and so on. - *

- *

- * From each node of the dendrogram, it is possible to retrieve the set of nodes of the original graph that belong to this - * dendrogram node using {@link yfiles.algorithms.Dendrogram#getClusterNodes}. This method returns an array of - * {@link yfiles.algorithms.NodeList}s that contain the nodes of all clusters that are merged when this dendrogram node was - * created. For example, say that clusters C1 = {v1, v2} and C2 = {v3, v4} are merged, where {v1, v2, v3, v4} are nodes of - * the original graph. Say that dendrogram node u is created by this merging. Then, the cluster nodes of u will be returned - * as two {@link yfiles.algorithms.NodeList}s where the first contains nodes v1, v2 and the second v3, v4. - *

- * @see yfiles.algorithms.Groups#hierarchicalClustering - * @see yfiles.algorithms.Groups#hierarchicalClustering - * @see yfiles.algorithms.Groups#hierarchicalClustering - * @class - */ - export interface Dendrogram extends yfiles.lang.Object{} - export class Dendrogram { - /** - * Returns a {@link yfiles.algorithms.NodeList} that contains the child nodes of the given parent node. - *

- * If the given node is a {@link yfiles.algorithms.Dendrogram#isLeaf leaf} node, the returned list will be empty. - *

- * @param parent the parent node for which to retrieve the child nodes - * @returns the list of child nodes of the given parent node - */ - getChildren(parent:yfiles.algorithms.Node):yfiles.algorithms.NodeList; - /** - * Returns an array of - * {@link yfiles.algorithms.NodeList}s that contain the nodes of the original graph that are associated with the given dendrogram - * node. - *

- * Each such {@link yfiles.algorithms.NodeList} represents nodes that belong to the same cluster. For example, say that clusters C1 = {v1, v2} - * and C2 = {v3, v4} are merged, where {v1, v2, v3, v4} are nodes of the original graph. Say that dendrogram node u is - * created by this merging. Then, the cluster nodes of u will be returned as two {@link yfiles.algorithms.NodeList}s where the - * first contains nodes v1, v2 and the second v3, v4. - *

- * @param node the given dendrogram node - * @returns an array of - * {@link }s that contain the nodes of the original graph that are associated with the given dendrogram - * node - */ - getClusterNodes(node:yfiles.algorithms.Node):yfiles.algorithms.NodeList[]; - /** - * Returns the dissimilarity value associated with the given node of the dendrogram. - * @param node the given dendrogram node - * @returns the dissimilarity value associated with the given dendrogram node - */ - getDissimilarityValue(node:yfiles.algorithms.Node):number; - /** - * Returns the level of the given node of the dendrogram. - * @param node the given dendrogram node - * @returns the level of the given dendrogram node - */ - getLevel(node:yfiles.algorithms.Node):number; - /** - * Returns the node of the dendrogram that belongs to the given level index. - *

- * If the given level index is greater than the {@link yfiles.algorithms.Dendrogram#levelCount number of levels}, then this method will return null. - *

- * @param level the given level index - * @returns the node of the dendrogram that belongs to the given level index or null if there exists no level with the given index. - * @throws {Stubs.Exceptions.ArgumentError} if the given level is negative or greater than the {@link yfiles.algorithms.Dendrogram#nodeCount node count} minus one. - */ - getNodeAtLevel(level:number):yfiles.algorithms.Node; - /** - * Returns the node of original graph that is mapped with the given leaf node of the dendrogram. - * @param node the given leaf node - * @returns the node of original graph that is mapped with the given leaf node or null if the given node is an inner dendrogram - * node - */ - getOriginalNode(node:yfiles.algorithms.Node):yfiles.algorithms.Node; - /** - * Returns whether or not the given dendrogram node is a leaf node. - *

- * A leaf node has no further children and represents a node of the original graph. The original node can be retrieved via - * {@link yfiles.algorithms.Dendrogram#getOriginalNode}. - *

- * @param node a dendrogram node - * @returns true if the given node is a leaf node, false otherwise - */ - isLeaf(node:yfiles.algorithms.Node):boolean; - /** - * Gets the root node of the dendrogram. - *

- * A dendrogram traversal can be implemented by starting from this node, then moving on to its children using method - * {@link yfiles.algorithms.Dendrogram#getChildren}, and so on. - *

- * @type {yfiles.algorithms.Node} - */ - root:yfiles.algorithms.Node; - /** - * Gets the number of nodes in this dendrogram. - * @type {number} - */ - nodeCount:number; - /** - * Gets the number of levels this dendrogram has. - * @type {number} - */ - levelCount:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Dendrogram; - } - /** - * An interface that determines the distance between two nodes of a graph. - *

- * It is used by the hierarchical clustering algorithm in order to determine the distance between any two nodes of a - * graph. - *

- * @see yfiles.algorithms.Groups#hierarchicalClustering - * @see yfiles.algorithms.Groups#hierarchicalClustering - * @see yfiles.algorithms.Groups#hierarchicalClustering - * @interface - */ - export interface INodeDistanceProvider extends yfiles.lang.Object{ - /** - * Returns the distance between two given nodes of a graph. - *

- * Implementations of this method have to guarantee that the returned value is greater or equal to zero. Furthermore, the - * distances between two nodes have to be symmetric, i.e., the distance between node n1 and n2 is equal to the distance - * between node n2 and n1. - *

- * @param n1 the first node - * @param n2 the second node - * @returns the distance between the two given nodes - * @abstract - */ - getDistance(n1:yfiles.algorithms.Node,n2:yfiles.algorithms.Node):number; - } - var INodeDistanceProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.INodeDistanceProvider; - }; - /** - * This class provides methods for automatically partitioning nodes of a graph into groups. - *

- * Partitions can be defined using edge betweenness centrality, biconnectivity, k-means clustering or hierarchical - * clustering. - *

- *

- * Definitions - *

- *
    - *
  • Betweenness centrality is a measure for how often a node lies on a shortest path between each pair of nodes in the graph.
  • - *
  • Biconnected graph is a graph that has no cut vertex or articulation point (i.e., a node whose removal disconnects the graph).
  • - *
  • K-means clustering algorithm partitions the nodes of a graph into k-clusters based on their positions on the plane and a given distance metric.
  • - *
  • Hierarchical clustering creates a hierarchy of clusters in a bottom-to-top approach based on some distance metric and linkage.
  • - *
- * @class - * @static - */ - export interface Groups extends yfiles.lang.Object{} - export class Groups { - /** - * This method partitions the graph by analyzing its biconnected components. - *

- * Nodes will be grouped such that the nodes within each group are biconnected. Nodes that belong to multiple biconnected - * components will be assigned to exactly one of these components. - *

- * @param graph the input graph - * @param groupIDs the {@link } that will be filled during the execution and returns an integer value (cluster ID) for - * each node - * @returns the resulting number of different groups - * @static - */ - static biconnectedComponentGrouping(graph:yfiles.algorithms.Graph,groupIDs:yfiles.algorithms.INodeMap):number; - /** - * Partitions the graph into groups using edge betweenness clustering proposed by Girvan and Newman. - *

- * In each iteration the edge with the highest betweenness centrality is removed from the graph. The method stops, if there - * are no more edges to remove or if the requested maximum number of groups is found. The clustering with the best quality - * reached during the process is returned. - *

- *

- * The algorithm includes several heuristic speed-up techniques available through the quality/time ratio. For the highest - * quality setting, it is used almost unmodified. The fast betweenness approximation of Brandes and Pich (Centrality Estimation in Large Networks) is employed for - * values around 0.5. Typically, this results in a tiny decrease in quality but a large speed-up and is the recommended - * setting. To achieve the lowest running time, a local betweenness calculation is used (Gregory: Local Betweenness for Finding Communities in Networks). - *

- *

- * The method requires the maximum number of groups that will be returned. The smaller this value is, the faster the - * overall computation time. The upper bound on the number of groups is - * graph.N(). Also, the number of returned groups is never smaller than the number of connected components of the graph. - *

- * @param graph the input graph - * @param clusterIDs the {@link } that will be filled during the execution and returns an integer value (cluster ID) for - * each node - * @param qualityTimeRatio a value between 0.0 (low quality, fast) and 1.0 (high quality, slow); the recommended value is 0.5 - * @param minGroupCount the minimum number of groups that will be returned - * @param maxGroupCount the maximum number of groups that will be returned - * @param refine true if the algorithm refines the current grouping, false if the algorithm discards the current grouping - * @returns the resulting number of different groups - * @throws {Stubs.Exceptions.ArgumentError} if minGroupCount > maxGroupCount or minGroupCount > graph.N() or maxGroupCount <= 0 - * @static - */ - static edgeBetweennessClustering(graph:yfiles.algorithms.Graph,clusterIDs:yfiles.algorithms.INodeMap,qualityTimeRatio:number,minGroupCount:number,maxGroupCount:number,refine:boolean):number; - /** - * Partitions the graph into groups using edge betweenness centrality. - *

- * In each iteration the edge with the highest betweenness centrality is removed from the graph. The method stops, if there - * are no more edges to remove. The clustering with the best quality reached during the process will be returned. - *

- *

- * The method requires the maximum number of groups that will be returned. The smaller this value is, the faster the - * overall computation time. The upper bound on the number of groups is - * graph.N(). Also, the number of returned groups is never smaller than the number of connected components of the graph. - *

- * @param graph the input graph - * @param clusterIDs the {@link } that will be filled during the execution and returns an integer value (cluster ID) for - * each node - * @param directed true if the graph should be considered as directed, false otherwise - * @param minGroupCount the minimum number of groups that will be returned - * @param maxGroupCount the maximum number of groups that will be returned - * @param edgeCosts the {@link } that holds a positive {@link } cost or null if the edges of the graph are considered to be - * of equal cost - * @returns the resulting number of different groups - * @throws {Stubs.Exceptions.ArgumentError} if minGroupCount > maxGroupCount or minGroupCount > graph.N() or maxGroupCount <= 0 - * @static - */ - static edgeBetweennessClustering(graph:yfiles.algorithms.Graph,clusterIDs:yfiles.algorithms.INodeMap,directed:boolean,minGroupCount:number,maxGroupCount:number,edgeCosts:yfiles.algorithms.IDataProvider):number; - /** - * Partitions the graph into clusters based on hierarchical clustering, while the dendrogram is cut based on a given - * maximum number of clusters. - *

- * The clustering is performed using the agglomerative strategy i.e., a bottom-up approach according to which at the - * beginning each node belongs to its own cluster. At each step pairs of clusters are merged while moving up to the - * hierarchy. The dissimilarity between clusters is determined based on the given linkage and the given node distances. The - * algorithm continues until all nodes belong to the same cluster. - *

- *

- * The result will be given based on the given maximum number of clusters value that is used for cutting the hierarchical - * tree at a point such that the number of remaining clusters equals to this value. - *

- *

- * The maximum number of clusters needs to be greater than zero and less than the number of the nodes of the graph. - *

- * @param graph the input graph - * @param maxCluster the maximum number of clusters that determines where to cut the hierarchic tree into clusters - * @param clusterIDs the {@link } that will be filled during the execution and returns an integer value (cluster ID) for - * each node - * @param distances a given {@link } object that determines the distance between any two graph nodes - * @param linkage one of the predefined linkage values - * @returns the resulting number of clusters - * @throws {Stubs.Exceptions.ArgumentError} if an unknown linkage is given or if the maximum number of clusters is less than or equal to zero or greater than the - * number of nodes of the graph - * @static - */ - static hierarchicalClustering(graph:yfiles.algorithms.Graph,maxCluster:number,clusterIDs:yfiles.algorithms.INodeMap,distances:yfiles.algorithms.INodeDistanceProvider,linkage:yfiles.algorithms.Linkage):number; - /** - * Partitions the graph into clusters based on hierarchical clustering, while the dendrogram is cut based on a given - * cut-off value. - *

- * The clustering is performed using the agglomerative strategy i.e., a bottom-up approach according to which at the - * beginning each node belongs to its own cluster. At each step pairs of clusters are merged while moving up to the - * hierarchy. The dissimilarity between clusters is determined based on the given linkage and the given node distances. The - * algorithm continues until all nodes belong to the same cluster. - *

- *

- * The result will be given based on the given cut-off value that is used for cutting the hierarchical tree at a point such - * that the dissimilarity values of the nodes that remain at the dendrogram are less than this value. - *

- * @param graph the input graph - * @param clusterIDs the {@link } that will be filled during the execution and returns an integer value (cluster ID) for - * each node - * @param distances a given {@link } object that determines the distance between any two nodes - * @param linkage one of the predefined linkage values - * @param cutOff the cut-off value that determines where to cut the hierarchic tree into clusters - * @returns the resulting number of clusters - * @throws {Stubs.Exceptions.ArgumentError} if an unknown linkage is used - * @static - */ - static hierarchicalClustering(graph:yfiles.algorithms.Graph,clusterIDs:yfiles.algorithms.INodeMap,distances:yfiles.algorithms.INodeDistanceProvider,linkage:yfiles.algorithms.Linkage,cutOff:number):number; - /** - * Partitions the graph into clusters based on hierarchical clustering. - *

- * The clustering is performed using the agglomerative strategy i.e., a bottom-up approach according to which at the - * beginning each node belongs to its own cluster. At each step pairs of clusters are merged while moving up to the - * hierarchy. The dissimilarity between clusters is determined based on the given linkage and the given node distances - * metric. The algorithm continues until all nodes belong to the same cluster. - *

- *

- * The result is returned as a {@link yfiles.algorithms.Dendrogram} object which represents the result of the clustering algorithm - * as a binary tree structure. It can easily be traversed by starting from the {@link yfiles.algorithms.Dendrogram#root root node} and moving on to nodes of the next - * level via method {@link yfiles.algorithms.Dendrogram#getChildren}. - *

- * @param graph the input graph - * @param distances a given {@link } object that determines the distance between any two nodes - * @param linkage one of the predefined linkage values - * @returns a {@link } which represents the result of the clustering as a binary tree - * @throws {Stubs.Exceptions.ArgumentError} if an unknown linkage is given - * @static - */ - static hierarchicalClustering(graph:yfiles.algorithms.Graph,distances:yfiles.algorithms.INodeDistanceProvider,linkage:yfiles.algorithms.Linkage):yfiles.algorithms.Dendrogram; - /** - * Partitions the graph into clusters using k-means clustering algorithm. - *

- * The nodes of the graph will be partitioned in k clusters based on their positions such that their distance from the - * cluster's mean (centroid) is minimized. - *

- *

- * The distance can be defined using diverse metrics as euclidean distance, euclidean-squared distance, manhattan distance - * or chebychev distance. - *

- * @param graph the input graph - * @param clusterIDs the {@link } that will be filled during the execution and returns an integer value (cluster ID) for - * each node - * @param nodePositions the {@link } that holds a {@link point} representing the current position of each node in the graph - * @param distanceMetric one of the predefined distance metrics - * @param k the number of clusters - * @param [iterations=100] the maximum number of iterations performed by the algorithm for convergence - * @param [centroids=null] the initial centroids - * @returns the number of resulting (non-empty) clusters - * @throws {Stubs.Exceptions.ArgumentError} if the given distance metric is not supported - * @static - */ - static kMeansClustering(graph:yfiles.algorithms.Graph,clusterIDs:yfiles.algorithms.INodeMap,nodePositions:yfiles.algorithms.IDataProvider,distanceMetric:yfiles.algorithms.DistanceMetric,k:number,iterations?:number,centroids?:yfiles.algorithms.YPoint[]):number; - /** - * Partitions the graph into clusters using k-means clustering algorithm. - *

- * The nodes of the graph will be partitioned in k clusters based on their positions such that their distance from the - * cluster's mean (centroid) is minimized. - *

- *

- * The distance can be defined using diverse metrics as euclidean distance, euclidean-squared distance, manhattan distance - * or chebychev distance. - *

- * @param {Object} options The parameters to pass. - * @param options.graph the input graph - * @param options.clusterIDs the {@link } that will be filled during the execution and returns an integer value (cluster ID) for - * each node - * @param options.nodePositions the {@link } that holds a {@link point} representing the current position of each node in the graph - * @param options.distanceMetric one of the predefined distance metrics - * @param options.k the number of clusters - * @param [options.iterations=100] the maximum number of iterations performed by the algorithm for convergence - * @param [options.centroids=null] the initial centroids - * @returns the number of resulting (non-empty) clusters - * @throws {Stubs.Exceptions.ArgumentError} if the given distance metric is not supported - * @static - */ - static kMeansClustering(options:{graph:yfiles.algorithms.Graph,clusterIDs:yfiles.algorithms.INodeMap,nodePositions:yfiles.algorithms.IDataProvider,distanceMetric:yfiles.algorithms.DistanceMetric,k:number,iterations?:number,centroids?:yfiles.algorithms.YPoint[]}):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Groups; - } - /** - * A general interface for iterating over a collection of objects. - *

- * It can be regarded as a read-only view of such a collection. - *

- *

- * A YCursor acts like a movable pointer on the elements of a collection. The pointer can be moved forward and backward and - * the element currently pointed on can be accessed. The removal of elements can only be performed on the provider of the - * cursor, not on the cursor itself. (That's why the cursor presents a read-only view.) - *

- *

- * Implementations of this interface do not need to support operations marked "optional." - *

- * @interface - */ - export interface ICursor extends yfiles.lang.Object{ - /** - * Moves this cursor one position forward. - * @abstract - */ - next():void; - /** - * Moves this cursor one position backward (optional). - * @abstract - */ - prev():void; - /** - * Moves this cursor to the first valid cursor position (optional). - * @abstract - */ - toFirst():void; - /** - * Moves this cursor to the last valid cursor position (optional). - * @abstract - */ - toLast():void; - /** - * Gets true if the current cursor position is valid. - * @abstract - * @type {boolean} - */ - ok:boolean; - /** - * Gets the object currently pointed on. - * @abstract - * @type {any} - */ - current:any; - /** - * Gets the number of elements that can be accessed with this cursor. - * @abstract - * @type {number} - */ - size:number; - } - var ICursor:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.ICursor; - }; - /** - * A general interface for setting data. - *

- * A data acceptor associates data with data holders. It constitutes a write-only view on particular data. - *

- * @interface - */ - export interface IDataAcceptor extends yfiles.lang.Object{ - /** - * Sets an object value associated with the given data holder. - *

- * This method may throw an UnsupportedOperationException. - *

- * @param dataHolder - * @param value - * @abstract - */ - set(dataHolder:any,value:any):void; - /** - * Sets a boolean value associated with the given data holder. - *

- * This method may throw an UnsupportedOperationException. - *

- * @param dataHolder - * @param value - * @abstract - */ - setBoolean(dataHolder:any,value:boolean):void; - /** - * Sets an integer value associated with the given data holder. - *

- * This method may throw an UnsupportedOperationException. - *

- * @param dataHolder - * @param value - * @abstract - */ - setInt(dataHolder:any,value:number):void; - /** - * Sets a double value associated with the given data holder. - *

- * This method may throw an UnsupportedOperationException. - *

- * @param dataHolder - * @param value - * @abstract - */ - setNumber(dataHolder:any,value:number):void; - } - var IDataAcceptor:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.IDataAcceptor; - }; - /** - * Interface that combines the {@link yfiles.algorithms.IDataProvider} and {@link yfiles.algorithms.IDataAcceptor} interfaces. - *

- * This interface does not declare any additional methods. - *

- * @interface - * @implements {yfiles.algorithms.IDataProvider} - * @implements {yfiles.algorithms.IDataAcceptor} - */ - export interface IDataMap extends yfiles.lang.Object,yfiles.algorithms.IDataProvider,yfiles.algorithms.IDataAcceptor{ - } - var IDataMap:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.IDataMap; - }; - /** - * A general interface for data provision. - *

- * A data provider grants access to data associated with one or more data holders. It constitutes a read-only view on - * particular data. - *

- * @interface - */ - export interface IDataProvider extends yfiles.lang.Object{ - /** - * Returns an object value associated with the given data holder. - *

- * This method may throw an UnsupportedOperationException. - *

- * @param dataHolder - * @returns - * @abstract - */ - get(dataHolder:any):any; - /** - * Returns a boolean value associated with the given data holder. - *

- * This method may throw an UnsupportedOperationException. - *

- * @param dataHolder - * @returns - * @abstract - */ - getBoolean(dataHolder:any):boolean; - /** - * Returns an integer value associated with the given data holder. - *

- * This method may throw an UnsupportedOperationException. - *

- * @param dataHolder - * @returns - * @abstract - */ - getInt(dataHolder:any):number; - /** - * Returns a double value associated with the given data holder. - *

- * This method may throw an UnsupportedOperationException. - *

- * @param dataHolder - * @returns - * @abstract - */ - getNumber(dataHolder:any):number; - } - var IDataProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.IDataProvider; - }; - /** - * A cursor interface for iterating over edges. - * @interface - * @implements {yfiles.algorithms.ICursor} - */ - export interface IEdgeCursor extends yfiles.lang.Object,yfiles.algorithms.ICursor{ - /** - * Moves the cursor to the cyclic next element of the underlying sequence. - *

- * This is the next element if available, else it is the first element. - *

- * @abstract - */ - cyclicNext():void; - /** - * Moves the cursor to the cyclic previous element of the underlying sequence. - *

- * This is the previous element if available, else it is the last element. - *

- * @abstract - */ - cyclicPrev():void; - /** - * Gets the edge at the current location of the cursor. - *

- * This method is the typed variant of {@link yfiles.algorithms.ICursor#current}. - *

- * @abstract - * @type {yfiles.algorithms.Edge} - */ - edge:yfiles.algorithms.Edge; - } - var IEdgeCursor:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.IEdgeCursor; - }; - /** - * Provides access to data associated with an edge. - *

- * An edge map can be considered as a map that allows only edges as keys. Edge keys of an edge map must belong to the same - * graph. - *

- *

- * There are data access methods defined for the most common typed values as well. - *

- *

- * The edge values are initialized with Java(TM) default values (null, 0, 0.0, false) upon initialization. - *

- * @interface - * @implements {yfiles.algorithms.IDataProvider} - * @implements {yfiles.algorithms.IDataAcceptor} - * @implements {yfiles.algorithms.IDataMap} - */ - export interface IEdgeMap extends yfiles.lang.Object,yfiles.algorithms.IDataProvider,yfiles.algorithms.IDataAcceptor,yfiles.algorithms.IDataMap{ - } - var IEdgeMap:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.IEdgeMap; - }; - /** - * A cursor interface for iterating over nodes. - * @interface - * @implements {yfiles.algorithms.ICursor} - */ - export interface INodeCursor extends yfiles.lang.Object,yfiles.algorithms.ICursor{ - /** - * Moves the cursor to the cyclic next element of the underlying sequence. - *

- * This is the next element if available, else it is the first element. - *

- * @abstract - */ - cyclicNext():void; - /** - * Moves the cursor to the cyclic previous element of the underlying sequence. - *

- * This is the previous element if available, else it is the last element. - *

- * @abstract - */ - cyclicPrev():void; - /** - * Gets the node at the current location of the cursor. - *

- * This method is the typed variant of {@link yfiles.algorithms.ICursor#current}. - *

- * @abstract - * @type {yfiles.algorithms.Node} - */ - node:yfiles.algorithms.Node; - } - var INodeCursor:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.INodeCursor; - }; - /** - * Provides access to data associated with a node. - *

- * A node map can be considered as a map that allows only nodes as keys. Node keys of a node map must belong to the same - * graph. - *

- *

- * There are data access methods defined for the most common typed values as well. - *

- *

- * The node values are initialized with Java(TM) default values (null, 0, 0.0, false) upon initialization. - *

- * @interface - * @implements {yfiles.algorithms.IDataProvider} - * @implements {yfiles.algorithms.IDataAcceptor} - * @implements {yfiles.algorithms.IDataMap} - */ - export interface INodeMap extends yfiles.lang.Object,yfiles.algorithms.IDataProvider,yfiles.algorithms.IDataAcceptor,yfiles.algorithms.IDataMap{ - } - var INodeMap:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.INodeMap; - }; - /** - * This is a generic interface for classes that provide an ordering for the nodes of a graph. - * @interface - */ - export interface INodeSequencer extends yfiles.lang.Object{ - /** - * Returns a cursor that grants access to all nodes of the given graph in some order. - * @param graph the input graph - * @returns a {@link } that grants access to all nodes of a graph - * @abstract - */ - nodes(graph:yfiles.algorithms.Graph):yfiles.algorithms.INodeCursor; - } - var INodeSequencer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.algorithms.INodeSequencer; - }; - /** - * This class provides methods for calculating independent sets. - *

- * An independent set is a set of nodes in a graph, in which no two nodes are adjacent. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":0, "c":0},"styles":{"6":{"s":[35,35],"c":1, "f":"#FF0000", "b":0}},"n":[[425,305,6],[645,305],[425,525],[645,525,6],[485,365],[585,365,6],[485,465,6],[585,465]],"e":[[0,4],[0,1],[1,3],[3,2],[2,0],[4,6],[6,2],[6,7],[7,5],[5,4],[5,1],[7,3]],"vp":[425.0,305.0,250.0,250.0]}} Circular nodes represent one of the independent sets of the given graph - *

- * @class - * @static - */ - export interface IndependentSets extends yfiles.lang.Object{} - export class IndependentSets { - /** - * Calculates an independent set for a given graph. - *

- * A greedy heuristic is applied which tries to find a large independent set. - *

- * @param conflictGraph the input graph - * @returns a {@link } containing an independent set of nodes - * @see yfiles.algorithms.IndependentSets#getIndependentSet - * @static - */ - static getIndependentSet(conflictGraph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList; - /** - * Partitions the set of nodes of the given graph into independent sets. - *

- * The method iteratively calls method {@link yfiles.algorithms.IndependentSets#getIndependentSet}. - *

- * @param conflictGraph the input graph - * @returns an array of {@link }s each of which contains an independent set of nodes - * @see yfiles.algorithms.IndependentSets#getIndependentSet - * @static - */ - static getIndependentSets(conflictGraph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.IndependentSets; - } - /** - * Represents a so-called "cell" or "link" of the doubly linked list implementation {@link yfiles.algorithms.YList}. - *

- * It may be used to perform fast access and remove operations on that type of list. - *

- * @class - * @final - */ - export interface ListCell extends yfiles.lang.Object{} - export class ListCell { - /** - * Returns the predecessor cell of this cell. - *

- * If there is no predecessor, then null is returned. - *

- * @returns - */ - pred():yfiles.algorithms.ListCell; - /** - * Returns the successor cell of this cell. - *

- * If there is no successor, then null is returned. - *

- * @returns - */ - succ():yfiles.algorithms.ListCell; - /** - * Gets or sets the element stored in this cell. - * @type {any} - */ - info:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.ListCell; - } - /** - * This class provides sophisticated algorithms for solving classical network flow problems. - *

- * Definitions - *

- *
    - *
  • - * Maximum flow problem: – Given a directed graph in which each edge has a capacity and given a source node s and a sink node t, find a flow of - * maximum value from s to t. - *
  • - *
  • - * Minimum cut problem: – Given a directed graph in which each edge has a capacity and given a source node s and a sink node t, find an s-t cut of - * minimum capacity (i.e., a set of edges of minimum capacity whose removal would disconnect t from s). - *
  • - *
  • - * Minimum cost flow problem: – Given a directed graph in which each edge has a cost and a capacity and each node has a supply or demand, find a flow of - * minimum total cost that satisfies the edge capacities and the node balances. - *
  • - *
  • - * Minimum cost maximum flow problem: – Given a directed graph in which each edge has a cost and a capacity and given a source node s and a sink node t, find a - * flow of maximum value from s to t that has the minimum total cost. - *
  • - *
- * @class - * @static - */ - export interface NetworkFlows extends yfiles.lang.Object{} - export class NetworkFlows { - /** - * Solves a maximum flow problem using the preflow-push method. - *

- * The implementation is based on - *

- *
    - *
  • Mehlhorn, Naeher: LEDA: a platform for combinatorial and geometric computing, Cambridge University Press, 2000, pp. 443-488.
  • - *
- *

- * The worst case running time is O(mdeg * n^2 * m^(1/2)), where n is the number of nodes in the network, m the number of - * edges and mdeg the maximal degree of any node. - *

- *

- * Edges may have infinite capacity, which is denoted by the value 0x7FFFFFFF. - *

- * @param graph the given network - * @param source the source node of the network - * @param sink the sink node of the network - * @param eCapDP the {@link } that returns the integer capacity of each edge or null if no bound is specified - * @param flowEM the {@link } that will be filled during the execution with an integer flow for each edge - * @returns the maximum flow value - * @see yfiles.algorithms.NetworkFlows#calcMaxFlowMinCut - * @static - */ - static calcMaxFlow(graph:yfiles.algorithms.Graph,source:yfiles.algorithms.Node,sink:yfiles.algorithms.Node,eCapDP:yfiles.algorithms.IDataProvider,flowEM:yfiles.algorithms.IEdgeMap):number; - /** - * Solves a maximum flow problem using the preflow-push method but additionally marks all nodes that belong to the minimum - * cut set that is associated with the source of the network. - * @param graph the given network - * @param source the source node of the network - * @param sink the sink node of the network - * @param eCapDP the {@link } that returns the integer capacity of each edge or null if no bound is specified - * @param flowEM the {@link } that will be filled during the execution with an integer flow for each edge - * @param sourceCutNM the {@link } that will be filled during the execution and returns a boolean value indicating whether - * or not a node belongs to the cut set associated with the source of the network - * @returns the maximum flow value - * @see yfiles.algorithms.NetworkFlows#calcMaxFlow - * @static - */ - static calcMaxFlowMinCut(graph:yfiles.algorithms.Graph,source:yfiles.algorithms.Node,sink:yfiles.algorithms.Node,eCapDP:yfiles.algorithms.IDataProvider,flowEM:yfiles.algorithms.IEdgeMap,sourceCutNM:yfiles.algorithms.INodeMap):number; - /** - * Solves a minimum cost maximum flow problem. - * @param graph the given network - * @param s the source node of the network - * @param t the sink node of the network - * @param uCapDP the {@link } that returns the integer capacity of each edge or null if no bound is specified - * @param cost0DP the {@link } that returns a double value (cost) for each edge - * @param flowEM the {@link } that will be filled during the execution with an integer flow for each edge - * @param dualsNM the {@link } that will be filled during the execution with an integer value (dual value) for each node - * or null if no such values occur; dual values are also referred as potentials - * @returns the total cost of the flow - * @see yfiles.algorithms.NetworkFlows#minCostFlow - * @see yfiles.algorithms.NetworkFlows#minCostFlow - * @static - */ - static minCostFlow(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,uCapDP:yfiles.algorithms.IDataProvider,cost0DP:yfiles.algorithms.IDataProvider,flowEM:yfiles.algorithms.IEdgeMap,dualsNM:yfiles.algorithms.INodeMap):number; - /** - * Solves a minimum cost flow problem with a capacity scaling algorithm. - *

- * This algorithm is a variant of the successive shortest path algorithm (see Ahuja,Magnanti,Orlin: Network flows, Prentice Hall, 1993, - * pp.320-324). It has the pseudo-polynomial running time O(m*log U*(m+n log n)) where n is the number of nodes in the - * network, m the number of edges and U the maximal edge capacity. - *

- *

- * Edges may have infinite capacity, which is denoted by the value 0x7FFFFFFF. - *

- *

- * There are no restriction for the costs. In particular, they can also be negative. - *

- * @param graph the given network - * @param lCapDP the {@link } that returns the integer lower bound for the capacity of each edge or null if no - * bound is specified - * @param uCapDP the {@link } that returns the integer upper bound for the capacity of each edge or null if no - * bound is specified - * @param cost0DP the {@link } that returns a double value (cost) of each edge - * @param supplyDP the {@link } that returns the supply/demand of each node; supply is denoted by a positive value, - * demand by a negative value - * @param flowEM the {@link } that will be filled during the execution with an integer flow for each edge - * @param dualsNM the {@link } that will be filled during the execution with an integer value (dual value) for each node - * or null if no such values occur; dual values are also referred as potentials - * @returns the total cost of the flow - * @see yfiles.algorithms.NetworkFlows#minCostFlow - * @see yfiles.algorithms.NetworkFlows#minCostFlow - * @static - */ - static minCostFlow(graph:yfiles.algorithms.Graph,lCapDP:yfiles.algorithms.IDataProvider,uCapDP:yfiles.algorithms.IDataProvider,cost0DP:yfiles.algorithms.IDataProvider,supplyDP:yfiles.algorithms.IDataProvider,flowEM:yfiles.algorithms.IEdgeMap,dualsNM:yfiles.algorithms.INodeMap):number; - /** - * Uses method {@link yfiles.algorithms.NetworkFlows#minCostFlow} to solve a minimum cost flow problem. - * @param graph the given network - * @param uCapDP the {@link } that returns the integer capacity of each edge or null if no bound is specified - * @param cost0DP the {@link } that returns a double value (cost) for each edge - * @param supplyDP the {@link } that returns the supply/demand of each node; supply is denoted by a positive value, - * demand by a negative value - * @param flowEM the {@link } that will be filled during the execution with an integer flow for each edge - * @param dualsNM the {@link } that will be filled during the execution with an integer value (dual value) for each node - * or null if no such values occur; dual values are also referred as potentials - * @returns the total cost of the flow - * @see yfiles.algorithms.NetworkFlows#minCostFlow - * @see yfiles.algorithms.NetworkFlows#minCostFlow - * @static - */ - static minCostFlow(graph:yfiles.algorithms.Graph,uCapDP:yfiles.algorithms.IDataProvider,cost0DP:yfiles.algorithms.IDataProvider,supplyDP:yfiles.algorithms.IDataProvider,flowEM:yfiles.algorithms.IEdgeMap,dualsNM:yfiles.algorithms.INodeMap):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.NetworkFlows; - } - /** - * Represents a so-called node in the directed graph data type {@link yfiles.algorithms.Graph}. - *

- * Most notably, a node provides access to its adjacent edges (represented by instances of class - * {@link yfiles.algorithms.Edge}). These can be distinguished into the sets of incoming and outgoing edges. - *

- *

- * Iteration over all three sets of edges is provided by means of bidirectional cursors that present a read-only view of - * the respective set ({@link yfiles.algorithms.Node#getEdgeCursor}, {@link yfiles.algorithms.Node#getInEdgeCursor}, - * {@link yfiles.algorithms.Node#getOutEdgeCursor}). Also supported is iteration over all nodes at opposite ends of either incoming - * edges or outgoing edges ({@link yfiles.algorithms.Node#getPredecessorCursor}, {@link yfiles.algorithms.Node#getSuccessorCursor}). - *

- *

- * The number of overall edges at a node is called its degree ({@link yfiles.algorithms.Node#degree}), which is the sum of incoming and outgoing edges ({@link yfiles.algorithms.Node#inDegree}, {@link yfiles.algorithms.Node#outDegree}). - *

- *

- * Important: Class Graph is the single authority for any structural changes to the graph data type. Specifically, this means that - * there is no way to create or delete a node or an edge without using an actual Graph instance. - *

- * @class - * @extends {yfiles.algorithms.GraphObject} - */ - export interface Node extends yfiles.algorithms.GraphObject{} - export class Node { - /** - * Instantiates a new Node object that will be part of the given graph. - * @param g The graph that the created node will belong to. - */ - constructor(g:yfiles.algorithms.Graph); - /** - * Creates a copy of this node that will be inserted into the given graph. - * @param g The graph that the created node will belong to. - * @returns The newly created Node object. - */ - createCopy(g:yfiles.algorithms.Graph):yfiles.algorithms.Node; - /** - * Returns an edge that connects this node with the given node, if such an edge exists. - *

- * Otherwise null is returned. - *

- *

- * Note that the first matching edge is returned, and that outgoing edges are tested prior to incoming edges. - *

- * @param opposite - * @returns - * @see yfiles.algorithms.Node#getEdgeFrom - * @see yfiles.algorithms.Node#getEdgeTo - */ - getEdge(opposite:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Returns an edge cursor for all incoming and outgoing edges at this node. - * @returns - * @see yfiles.algorithms.Node#getInEdgeCursor - * @see yfiles.algorithms.Node#getOutEdgeCursor - */ - getEdgeCursor():yfiles.algorithms.IEdgeCursor; - /** - * Returns an incoming edge that connects the given node with this node, if such an edge exists. - *

- * Otherwise null is returned. - *

- * @param source - * @returns - * @see yfiles.algorithms.Node#getEdge - * @see yfiles.algorithms.Node#getEdgeTo - */ - getEdgeFrom(source:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Returns an outgoing edge that connects this node with the given node, if such an edge exists. - *

- * Otherwise null is returned. - *

- * @param target - * @returns - * @see yfiles.algorithms.Node#getEdge - * @see yfiles.algorithms.Node#getEdgeFrom - */ - getEdgeTo(target:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Returns an edge cursor for incoming edges at this node. - *

- * If an edge is specified, the cursor starts at the given edge, and the cyclic sequence order is the same as returned by - * {@link yfiles.algorithms.Node#getInEdgeCursor}. - *

- * @param [startEdge=null] The first edge being accessed by the returned cursor. - * @returns - * @see yfiles.algorithms.Node#getOutEdgeCursor - */ - getInEdgeCursor(startEdge?:yfiles.algorithms.Edge):yfiles.algorithms.IEdgeCursor; - /** - * Returns a node cursor for all neighbor nodes of this node. - *

- * Neighbor nodes are those at the opposite ends of both incoming and outgoing edges. - *

- * @returns - * @see yfiles.algorithms.Node#getPredecessorCursor - * @see yfiles.algorithms.Node#getSuccessorCursor - */ - getNeighborCursor():yfiles.algorithms.INodeCursor; - /** - * Returns an edge cursor for outgoing edges at this node. - *

- * If an edge is specified, the cursor starts at the given edge, and the cyclic sequence order is the same as returned by - * {@link yfiles.algorithms.Node#getOutEdgeCursor}. - *

- * @param [startEdge=null] The first edge being accessed by the returned cursor. - * @returns - * @see yfiles.algorithms.Node#getInEdgeCursor - */ - getOutEdgeCursor(startEdge?:yfiles.algorithms.Edge):yfiles.algorithms.IEdgeCursor; - /** - * Returns a node cursor for all predecessor nodes of this node. - *

- * Predecessor nodes are those at the opposite ends of incoming edges. - *

- * @returns - * @see yfiles.algorithms.Node#getSuccessorCursor - */ - getPredecessorCursor():yfiles.algorithms.INodeCursor; - /** - * Returns a node cursor for all successor nodes of this node. - *

- * Successor nodes are those at the opposite ends of outgoing edges. - *

- * @returns - * @see yfiles.algorithms.Node#getPredecessorCursor - */ - getSuccessorCursor():yfiles.algorithms.INodeCursor; - /** - * Sorts incoming edges at this node according to the given comparator. - * @param c - * @see yfiles.algorithms.Node#sortOutEdges - */ - sortInEdges(c:yfiles.collections.IComparer):void; - /** - * Sorts outgoing edges at this node according to the given comparator. - * @param c - * @see yfiles.algorithms.Node#sortInEdges - */ - sortOutEdges(c:yfiles.collections.IComparer):void; - /** - * Gets the overall number of incoming and outgoing edges at this node. - *

- * Note that self-loops are counted twice. - *

- * @see yfiles.algorithms.Edge - * @see yfiles.algorithms.Node#inDegree - * @see yfiles.algorithms.Node#outDegree - * @type {number} - */ - degree:number; - /** - * Gets the number of incoming edges at this node. - * @see yfiles.algorithms.Node#degree - * @see yfiles.algorithms.Node#outDegree - * @type {number} - */ - inDegree:number; - /** - * Gets the number of outgoing edges at this node. - * @see yfiles.algorithms.Node#degree - * @see yfiles.algorithms.Node#inDegree - * @type {number} - */ - outDegree:number; - /** - * Gets the index of this node within its graph G. - *

- * Node indices represent the ordering of standard node iteration on G. The value of an index is >= 0 and - * < G.nodeCount(). - *

- *

- * Note that indices are subject to change whenever the sequence of nodes in a graph is modified by either removing, - * hiding, reinserting, or unhiding a node, or by explicitly changing its position in the sequence. - *

- * @see yfiles.algorithms.Graph#removeNode - * @see yfiles.algorithms.Graph#hide - * @see yfiles.algorithms.Graph#reInsertNode - * @see yfiles.algorithms.Graph#unhide - * @see yfiles.algorithms.Graph#moveToFirst - * @see yfiles.algorithms.Graph#moveToLast - * @type {number} - */ - index:number; - /** - * Gets the graph this node belongs to. - *

- * If the node does not belong to a graph, because it was removed or hidden from it, this method returns null. - *

- * @type {yfiles.algorithms.Graph} - */ - graph:yfiles.algorithms.Graph; - /** - * Gets the first outgoing edge at this node, or null if it does not exist. - * @see yfiles.algorithms.Node#firstInEdge - * @see yfiles.algorithms.Node#lastOutEdge - * @type {yfiles.algorithms.Edge} - */ - firstOutEdge:yfiles.algorithms.Edge; - /** - * Gets the first incoming edge at this node, or null if it does not exist. - * @see yfiles.algorithms.Node#firstOutEdge - * @see yfiles.algorithms.Node#lastInEdge - * @type {yfiles.algorithms.Edge} - */ - firstInEdge:yfiles.algorithms.Edge; - /** - * Gets the last outgoing edge at this node, or null if it does not exist. - * @see yfiles.algorithms.Node#firstOutEdge - * @see yfiles.algorithms.Node#lastInEdge - * @type {yfiles.algorithms.Edge} - */ - lastOutEdge:yfiles.algorithms.Edge; - /** - * Gets the last incoming edge at this node, or null if it does not exist. - * @see yfiles.algorithms.Node#firstInEdge - * @see yfiles.algorithms.Node#lastOutEdge - * @type {yfiles.algorithms.Edge} - */ - lastInEdge:yfiles.algorithms.Edge; - /** - * Yields a dynamic {@link yfiles.collections.IEnumerable.} for {@link yfiles.algorithms.Edge}s that can be used to iterate over outgoing edges at this instance. - *

- * This is a live enumerable and will thus reflect the current state of the node's adjacency. Note that changes to the - * graph structure during the traversal should be carried out with great care. Note that self-loop edges are reported, - * too. - *

- * @type {yfiles.collections.IEnumerable.} - */ - outEdges:yfiles.collections.IEnumerable; - /** - * Yields a dynamic {@link yfiles.collections.IEnumerable.} for {@link yfiles.algorithms.Edge}s that can be used to iterate over ingoing edges at this instance. - *

- * This is a live enumerable and will thus reflect the current state of the node's adjacency. Note that changes to the - * graph structure during the traversal should be carried out with great care. Note that self-loop edges are reported, - * too. - *

- * @type {yfiles.collections.IEnumerable.} - */ - inEdges:yfiles.collections.IEnumerable; - /** - * Yields a dynamic {@link yfiles.collections.IEnumerable.} for {@link yfiles.algorithms.Edge}s that can be used to iterate over the adjacent edges at this instance. - *

- * This is a live enumerable and will thus reflect the current state of the node's adjacency. Note that changes to the - * graph structure during the traversal should be carried out with great care. Note that self-loop edges are reported twice - * (as in edge and as out edge). - *

- * @type {yfiles.collections.IEnumerable.} - */ - edges:yfiles.collections.IEnumerable; - /** - * Yields a dynamic {@link yfiles.collections.IEnumerable.} for - * {@link yfiles.algorithms.Node}s that can be used to iterate over the opposite sides of adjacent outgoing edges at this - * instance. - *

- * This is a live enumerable and will thus reflect the current state of the node's adjacency. Note that changes to the - * graph structure during the traversal should be carried out with great care. Note that for self-loop edges this node - * itself will be reported as a successor. - *

- * @type {yfiles.collections.IEnumerable.} - */ - successors:yfiles.collections.IEnumerable; - /** - * Yields a dynamic {@link yfiles.collections.IEnumerable.} for - * {@link yfiles.algorithms.Node}s that can be used to iterate over the opposite sides of adjacent incoming edges at this - * instance. - *

- * This is a live enumerable and will thus reflect the current state of the node's adjacency. Note that changes to the - * graph structure during the traversal should be carried out with great care. Note that for self-loop edges this node - * itself will be reported as a predecessor. - *

- * @type {yfiles.collections.IEnumerable.} - */ - predecessors:yfiles.collections.IEnumerable; - /** - * Yields a dynamic {@link yfiles.collections.IEnumerable.} for - * {@link yfiles.algorithms.Node}s that can be used to iterate over the opposite sides of adjacent adjacent edges at this - * instance. - *

- * This is a live enumerable and will thus reflect the current state of the node's adjacency. Note that changes to the - * graph structure during the traversal should be carried out with great care. Note that for self-loop edges this node - * itself will be reported as a neighbor, twice. - *

- * @type {yfiles.collections.IEnumerable.} - */ - neighbors:yfiles.collections.IEnumerable; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Node; - } - /** - * Specialized list implementation for instances of type {@link yfiles.algorithms.Node}. - * @class - * @extends {yfiles.algorithms.YList} - * @implements {yfiles.collections.IEnumerable.} - */ - export interface NodeList extends yfiles.algorithms.YList{} - export class NodeList { - /** - * Creates a list that is initialized with the entries of the given list. - * @param list the values are added to the new list - */ - constructor(list:yfiles.algorithms.NodeList); - /** - * Creates a list that is initialized with a single node provided. - * @param v - */ - constructor(v:yfiles.algorithms.Node); - /** - * Creates a list that is initialized with the nodes provided by the given array of nodes. - * @param a - */ - constructor(a:yfiles.algorithms.Node[]); - /** - * Creates a list that is initialized with those nodes from the given NodeCursor object for which the given data provider - * returns true upon calling its {@link yfiles.algorithms.IDataProvider#getBoolean getBool} method. - * @param nc A node cursor providing nodes that should be added to this list. - * @param predicate A data provider that acts as a inclusion predicate for each node accessible by the given node cursor. - */ - constructor(nc:yfiles.algorithms.INodeCursor,predicate:yfiles.algorithms.IDataProvider); - /** - * Creates a list that is initialized with the nodes provided by the given NodeCursor object. - * @param c - */ - constructor(c:yfiles.algorithms.INodeCursor); - /** - * Creates an empty node list. - */ - constructor(); - /** - * Returns the first node in this list, or null when the list is empty. - * @returns The first node in the list. - */ - firstNode():yfiles.algorithms.Node; - /** - * Returns an enumerator for this collection. - * @returns - */ - getEnumerator():yfiles.collections.IEnumerator; - /** - * Returns the last node in this list, or null when the list is empty. - * @returns The last node in the list. - */ - lastNode():yfiles.algorithms.Node; - /** - * Returns a node cursor for this node list. - * @returns A node cursor granting access to the nodes within this list. - */ - nodes():yfiles.algorithms.INodeCursor; - /** - * Removes the first node from this list and returns it. - * @returns The first node from the list. - */ - popNode():yfiles.algorithms.Node; - /** - * Returns a node array containing all elements of this list in the canonical order. - * @returns - */ - toNodeArray():yfiles.algorithms.Node[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.NodeList; - } - /** - * This class provides algorithms that order the nodes of a graph using specific criteria. - *

- * Definitions - *

- *
    - *
  • - * A topological ordering of the nodes of a directed graph is a linear ordering of the nodes such that for each directed edge (u,v), node u lies - * before v in the ordering. - *
  • - *
  • A DFS completion ordering of the nodes of a graph is a node ordering identical to the order of node completion events in a {@link yfiles.algorithms.Dfs depth first search}.
  • - *
  • An st-ordering (v_1,v_2,....,v_n) of a biconnected graph is a node ordering which guarantees that:
  • - *
- * @class - * @static - */ - export interface NodeOrders extends yfiles.lang.Object{} - export class NodeOrders { - /** - * Calculates an ordering of the nodes identical to the order of node completion events in a depth first search. - *

- * This ordering is a reversed topological ordering in case the input graph is acyclic. - *

- * @param graph the input graph - * @param order an array of {@link }s that returns for each {@link } v, its zero-based index within the calculated ordering, i.e., - * order[v.index()] == 5 means that v is the 6-th node within the ordering - * @see yfiles.algorithms.NodeOrders#topological - * @see yfiles.algorithms.NodeOrders#dfsCompletion - * @static - */ - static dfsCompletion(graph:yfiles.algorithms.Graph,order:number[]):void; - /** - * Calculates an ordering of the nodes identical to the order of node completion events in a depth first search. - *

- * Like {@link yfiles.algorithms.NodeOrders#dfsCompletion} but the result is returned as a {@link yfiles.algorithms.NodeList}. - *

- *

- * This ordering is a reversed topological ordering in case the input graph is acyclic. - *

- * @param graph the input graph - * @returns a {@link } containing the nodes of the graph in the order identical to the order of node completion - * events in a depth first search - * @see yfiles.algorithms.NodeOrders#topological - * @see yfiles.algorithms.NodeOrders#dfsCompletion - * @static - */ - static dfsCompletion(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList; - /** - * Assigns an st-ordering to the nodes of a biconnected graph given the edge between source node s and sink node t. - *

- * An st-ordering (v_1,v_2,....,v_n) of a biconnected graph is a node ordering which guarantees that: - *

- *
    - *
  • Source node s and sink node t are connected by an edge.
  • - *
  • For each node v_i in the ordering other than s or t, there are neighbors v_j and v_k with j < i and k > i.
  • - *
- * @param graph the input graph - * @param stOrder an array of {@link }s that will be filled during the execution and returns for each {@link } v, its zero-based - * index within the calculated ordering, i.e., stOrder[v.index()] == 5 means that v is the 6-th node within the ordering - * @param [stEdge=null] an {@link } that connects source node s and sink node t - * @see yfiles.algorithms.NodeOrders#st - * @see yfiles.algorithms.NodeOrders#st - * @static - */ - static st(graph:yfiles.algorithms.Graph,stOrder:number[],stEdge?:yfiles.algorithms.Edge):void; - /** - * Assigns an st-ordering to the nodes of a biconnected graph. - *

- * Like {@link yfiles.algorithms.NodeOrders#st} but the result is returned as a {@link yfiles.algorithms.NodeList}. - *

- *

- * An st-ordering (v_1,v_2,....,v_n) of a biconnected graph is a node ordering which guarantees that: - *

- *
    - *
  • Source node s and sink node t are connected by an edge.
  • - *
  • For each node v_i in the ordering other than s or t, there are neighbors v_j and v_k with j < i and k > i.
  • - *
- * @param graph the input graph - * @returns a {@link } containing the nodes of the graph in the order defined by the st-ordering - * @see yfiles.algorithms.NodeOrders#st - * @static - */ - static st(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList; - /** - * Converts an array-based result returned by a method of this class to a {@link yfiles.algorithms.NodeList} that contains all - * nodes in the order provided by the given array. - * @param graph the input graph - * @param order an array of {@link }s that will be filled during the execution and returns for each {@link } v, its zero-based - * index within the calculated ordering, i.e., order[v.index()] == 5 means that v is the 6-th node within the ordering - * @returns a {@link } containing the nodes of the graph in the order provided by the given array - * @static - */ - static toNodeList(graph:yfiles.algorithms.Graph,order:number[]):yfiles.algorithms.NodeList; - /** - * Copies an array-based result returned by a method of this class to a {@link yfiles.algorithms.INodeMap} that will provide values - * of basic type int. - * @param graph the input graph - * @param order an array of {@link }s that returns for each {@link } v, its zero-based index within the calculated ordering, i.e., - * order[v.index()] == 5 means that v is the 6-th node within the ordering - * @param result the {@link } that will be filled during the execution with the zero-based index of each node within - * the calculated ordering - * @static - */ - static toNodeMap(graph:yfiles.algorithms.Graph,order:number[],result:yfiles.algorithms.INodeMap):void; - /** - * Copies a {@link yfiles.algorithms.NodeList}-based result returned by a method of this class to a {@link yfiles.algorithms.INodeMap} that - * will provide values of basic type int. - * @param order a {@link } containing the nodes of the graph in the appropriate order - * @param result the {@link } that will be filled during the execution with the zero-based index of each node within - * the calculated ordering - * @static - */ - static toNodeMap(order:yfiles.algorithms.NodeList,result:yfiles.algorithms.INodeMap):void; - /** - * Assigns a topological ordering to the nodes of a directed acyclic graph. - *

- * A topological ordering of the nodes of a directed graph is a linear ordering of the nodes such that for each directed - * edge (u,v), node u lies before v in the ordering. - *

- * @param graph the input graph - * @param order an array of {@link }s that will be filled during the execution and returns for each {@link } v, its zero-based - * index within the calculated ordering, i.e., order[v.index()] == 5 means that v is the 6-th node within the ordering - * @returns true if the graph is acyclic, false otherwise - * @see yfiles.algorithms.NodeOrders#topological - * @static - */ - static topological(graph:yfiles.algorithms.Graph,order:number[]):boolean; - /** - * Returns a topological ordering of the nodes of a directed acyclic graph. - * @param graph the input graph - * @returns a {@link } containing the nodes of the graph in the order they appear in the topological ordering - * @throws {Stubs.Exceptions.ArgumentError} if the graph is cyclic - * @see yfiles.algorithms.NodeOrders#topological - * @static - */ - static topological(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.NodeOrders; - } - /** - * This class provides methods for finding paths within a graph that have certain properties. - *

- * Definitions - *

- *
    - *
  • - * A path of length k from node u to node v in a graph is a sequence v0, v1, v2, ... , vk of nodes such that u = v0, v = vk and - * (vi-1, vi) in E, for each i = 1, 2, .. , k. - *
  • - *
  • A path is called simple if no node appears twice.
  • - *
  • A chain is a path of maximum length in which each internal node has degree 2.
  • - *
  • - * The longest path problem is the problem of finding a simple path of maximum length in a given graph. The longest path problem is - * NP-hard for undirected graphs, but can be solved in linear time for directed acyclic graphs. - *
  • - *
- * @class - * @static - */ - export interface Paths extends yfiles.lang.Object{} - export class Paths { - /** - * Constructs a {@link yfiles.algorithms.NodeList path of nodes} from a given {@link yfiles.algorithms.EdgeList path of edges}. - *

- * The returned node path has length path.size()+1, if the given path is not empty. Otherwise, the returned path will be - * empty. The i-th node in the returned path will be either source or target node of the i-th edge in the given path. - *

- * @param path the given {@link path of edges} - * @returns a {@link path of nodes} from the given {@link path of edges} - * @static - */ - static constructNodePath(path:yfiles.algorithms.EdgeList):yfiles.algorithms.NodeList; - /** - * Returns all chains present in the given graph. - *

- * A chain is a path of maximum length in which each internal node has degree 2. - *

- *

- * The internal nodes on directed chains all have in-degree 1 and out-degree 1. - *

- * @param graph the input graph - * @param directed true if the chain should be considered as directed, false otherwise - * @returns an array of {@link }s each of which contains the edges (at least two) that make up a chain - * @see yfiles.algorithms.Paths#constructNodePath - * @static - */ - static findAllChains(graph:yfiles.algorithms.Graph,directed:boolean):yfiles.algorithms.EdgeList[]; - /** - * A variant of {@link yfiles.algorithms.Paths#findAllPaths} which returns all simple directed or undirected paths between two - * given nodes and, additionally, allows to specify a filter for the paths to be returned. - * @param graph the input graph - * @param startNode the given start node - * @param endNode the given end node - * @param directed true if the path should be considered as directed, false otherwise - * @param filter a predicate that accepts or rejects a found {@link } and adds it to the result - * @returns an array of {@link }s each of which represents a path between the start and end node. - * @static - */ - static findAllPaths(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,directed:boolean,filter:(obj:yfiles.algorithms.EdgeList)=>boolean):yfiles.algorithms.EdgeList[]; - /** - * Returns all simple directed or undirected paths that connect a start node with an end node. - * @param graph the input graph - * @param startNode the given start node - * @param endNode the given end node - * @param directed true if the path should be considered as directed, false otherwise - * @returns an array of {@link }s each of which represents a path between the start and end node - * @static - */ - static findAllPaths(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,directed:boolean):yfiles.algorithms.EdgeList[]; - /** - * Finds all edges that belong to a directed path from a start node to an end node. - * @param graph the input graph - * @param startNode the given start node - * @param endNode the given end node - * @param pathEdges the {@link } that will be filled during the execution with a boolean value indicating whether or not - * an edge belongs to a path connecting the two given nodes - * @static - */ - static findAllPaths(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,pathEdges:yfiles.algorithms.IEdgeMap):void; - /** - * A variant of - * {@link yfiles.algorithms.Paths#findAllPaths}, which returns all simple directed or undirected paths between two given nodes as a - * special cursor that calculates the next path in the sequence, only when needed. - *

- * The returned cursor only supports the operation {@link yfiles.algorithms.ICursor#ok}, {@link yfiles.algorithms.ICursor#current}, {@link yfiles.algorithms.ICursor#size} and {@link yfiles.algorithms.ICursor#next}. - *

- * @param graph the input graph - * @param startNode the given start node - * @param endNode the given end node - * @param directed true if the path should be considered as directed, false otherwise - * @returns a {@link } that calculates the next path in the sequence - * @static - */ - static findAllPathsCursor(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,directed:boolean):yfiles.algorithms.ICursor; - /** - * Returns the longest directed path in a given acyclic weighted graph. - *

- * All edges of the graph have an integral length associated with them. The longest path is defined as one of all directed - * paths within the graph for which the edge lengths of all contained edges sum up to a maximum. - *

- * @param graph a directed acyclic graph - * @param [edgeLength=null] the {@link } that returns the non-negative integer length of each edge - * @returns an {@link } containing the edges of the longest directed path - * @static - */ - static findLongestPath(graph:yfiles.algorithms.Graph,edgeLength?:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList; - /** - * Calculates the longest path from a given node to all other node in a given directed acyclic graph. - * @param graph a directed acyclic graph - * @param startNode the node for which the distances are calculated - * @param dist the {@link } that returns the distance (i.e. weight) of type double for each edge - * @param maxDist the {@link } that will be filled during the execution and holds the maximum distance between the given - * node and all other nodes - * @param predicate the {@link } that returns a boolean value indicating whether or not an edge should be considered - * during the path search - * @static - */ - static findLongestPaths(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,dist:yfiles.algorithms.IEdgeMap,maxDist:yfiles.algorithms.INodeMap,predicate:yfiles.algorithms.IEdgeMap):void; - /** - * Returns an {@link yfiles.algorithms.EdgeList} containing the edges of an undirected simple path within the given graph. - *

- * The edges are returned in the order that they appear in the found path. - *

- *

- * A heuristic is used for finding a path that is long. It is not guaranteed, though, that the returned path is actually - * the longest path within the given graph, since that is a well known hard problem. - *

- * @param graph the given graph - * @returns an {@link } containing the edges of an undirected simple path - * @static - */ - static findLongPath(graph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList; - /** - * Returns whether or not a directed path from a start node to another node in an acyclic graph exists. - * @param graph an acyclic graph which contains the two nodes - * @param topSort a {@link list} of nodes sorted in topological order - * @param predicate the {@link } that returns a boolean value indicating whether or not an edge should be considered - * during the path search - * @param startNode - * @param endNode - * @returns true if a directed path from a start node to another node exists, false otherwise - * @static - */ - static findPath(graph:yfiles.algorithms.Graph,topSort:yfiles.algorithms.NodeList,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,predicate:yfiles.algorithms.IEdgeMap):boolean; - /** - * Returns an {@link yfiles.algorithms.EdgeList} containing the edges of a path from the given start node to the given end node, if - * such a path exists. - *

- * The edges are returned in the order that they appear in the found path. If the returned path is empty, no path between - * the given nodes was found. - *

- * @param graph the input graph - * @param startNode the first node of the path - * @param endNode the last node of the path - * @param directed true if the path should be directed, false otherwise - * @returns an {@link } containing the path edges between the start node and the end node - * @static - */ - static findPath(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,directed:boolean):yfiles.algorithms.EdgeList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Paths; - } - /** - * Represents an embedding of a planar graph. - *

- * A planar embedding is represented by a {@link yfiles.algorithms.PlanarEmbedding#faces list of faces}. Each face is represented by a list of {@link yfiles.algorithms.Dart darts} which describe the - * border of the face. - *

- * @class - * @final - */ - export interface PlanarEmbedding extends yfiles.lang.Object{} - export class PlanarEmbedding { - /** - * Creates a new embedding for the specified planar graph. - * @param graph a planar graph - * @throws {Stubs.Exceptions.ArgumentError} if the specified graph is not planar - */ - constructor(graph:yfiles.algorithms.Graph); - /** - * Returns the cyclic next dart of the given dart. - * @param dart a dart - * @returns the cyclic next dart of the given dart - */ - getCyclicNext(dart:yfiles.algorithms.Dart):yfiles.algorithms.Dart; - /** - * Returns the cyclic previous dart of the given dart. - * @param dart a dart - * @returns the cyclic previous dart of the given dart - */ - getCyclicPrevious(dart:yfiles.algorithms.Dart):yfiles.algorithms.Dart; - /** - * Returns the two darts associated with the given edge. - * @param edge an edge - * @returns the two darts associated with the given edge - */ - getDarts(edge:yfiles.algorithms.Edge):yfiles.algorithms.Dart[]; - /** - * Returns a {@link yfiles.collections.IList.} containing the (cyclic ordered) outgoing darts of the specified node. - * @param node a node - * @returns a {@link } containing the (cyclic ordered) outgoing darts - */ - getOutgoingDarts(node:yfiles.algorithms.Node):yfiles.collections.IList; - /** - * Return whether or not the given graph is planar. - * @param graph the input graph - * @returns true if the given graph is planar, false otherwise - * @static - */ - static isPlanar(graph:yfiles.algorithms.Graph):boolean; - /** - * Gets a {@link yfiles.collections.IList.} of face lists. - *

- * More precisely, each entry of this list is another list that contains all {@link yfiles.algorithms.Dart darts} of a face. - *

- * @type {yfiles.collections.IList.>} - */ - faces:yfiles.collections.IList>; - /** - * Gets the {@link yfiles.collections.IList.} that represents the outer face. - * @see yfiles.algorithms.PlanarEmbedding#faces - * @type {yfiles.collections.IList.} - */ - outerFace:yfiles.collections.IList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.PlanarEmbedding; - } - /** - * This class provides algorithms for solving the rank assignment problem. - *

- * Definitions Let G=(V,E) be a directed acyclic graph. Let length(e) denote the minimum length and weight(e) the weight of an edge - * e. - *

- *

- * The rank assignment problem is the problem of finding integer values rank(v) for all v in V, such that: - *

- *
    - *
  • rank(v) - rank(w) >= length(v,w), for all (v,w) in E and,
  • - *
  • the sum ∑(weight(v,w) * (rank(v) - rank(w))) over all (v,w) in E is minimized.
  • - *
- * @class - * @static - */ - export interface RankAssignments extends yfiles.lang.Object{} - export class RankAssignments { - /** - * Like {@link yfiles.algorithms.RankAssignments#simple}, but arrays are used instead of {@link yfiles.algorithms.INodeMap}s and - * {@link yfiles.algorithms.IEdgeMap}s. - *

- * Minimum edge length and weights should be non-negative. - *

- * @param graph the input graph in which all the edges have directions, such that rank[source] < rank[target] and - * rank[target] - rank[source] >= minlength[edge] - * @param rank an array that will be filled with the ranking r of each node v such that rank[v.index] == r - * @param minLength an array holding a non-negative value len of each edge e such that minLength[e.index] == len - * @param [maximalDuration=0x7FFFFFFFFFFFFFFF] a preferred time limit for the algorithm (in milliseconds) - * @returns the number of layers - * @see yfiles.algorithms.RankAssignments#simple - * @static - */ - static simple(graph:yfiles.algorithms.Graph,rank:number[],minLength:number[],maximalDuration?:number):number; - /** - * This method quickly calculates a tight tree given a maximum time duration for the algorithm. - *

- * The algorithm is using a highly optimized version of Gansner's algorithm: - *

- *
    - *
  • E.R. Gansner et al., A Technique for Drawing Directed Graphs, IEEE Transactions on Software Engineering, Vol.19, No.3, March 1993.
  • - *
- *

- * Minimum edge length and weights should be non-negative. - *

- * @param graph the input graph in which all the edges have directions, such that rank[source] < rank[target] and - * rank[target] - rank[source] >= minlength[edge] - * @param rank the {@link } that will be filled during the execution and returns the integer ranking of each node - * @param minLength the {@link } that returns an integer value (minimum/tight length) of each edge - * @param [maximalDuration=0x7FFFFFFFFFFFFFFF] a preferred time limit for the algorithm (in milliseconds) - * @returns - * @see yfiles.algorithms.RankAssignments#simple - * @static - */ - static simple(graph:yfiles.algorithms.Graph,rank:yfiles.algorithms.INodeMap,minLength:yfiles.algorithms.IEdgeMap,maximalDuration?:number):number; - /** - * Similar to {@link yfiles.algorithms.RankAssignments#simplex} but, additionally, it is possible to provide a valid initial tree - * solution for the problem. - *

- * Minimum edge length and weights should be non-negative. - *

- * @param graph the given graph - * @param layer the {@link } that will be filled during the execution and returns the zero-based ranking index for - * each node - * @param w the {@link } that returns an integer value (weight) of each edge - * @param minLength the {@link } that returns an integer value (minimum length) of each edge - * @param tree the {@link } that returns a boolean value indicating whether or not an edge is a tree edge - * @param _root the given root node of the tree solution - * @param validRanking true if the argument layer contains a valid ranking, false otherwise - * @param [maximalDuration=0x7FFFFFFFFFFFFFFF] a preferred time limit for the algorithm (in milliseconds) - * @returns the number of layers - * @see yfiles.algorithms.RankAssignments#simplex - * @see yfiles.algorithms.RankAssignments#simplex - * @static - */ - static simplex(graph:yfiles.algorithms.Graph,layer:yfiles.algorithms.INodeMap,w:yfiles.algorithms.IDataProvider,minLength:yfiles.algorithms.IDataProvider,tree:yfiles.algorithms.IEdgeMap,_root:yfiles.algorithms.Node,validRanking:boolean,maximalDuration?:number):number; - /** - * Solves the rank assignment problem using the simplex method given a maximum time duration for the algorithm. - *

- * This method assigns a minimum rank to the nodes in a acyclic graph. - *

- *

- * Although its time complexity has not been proven polynomial, in practice it takes few iterations and runs quickly. - *

- *

- * The algorithm is based on: - *

- *
    - *
  • E.R. Gansner et al., A Technique for Drawing Directed Graphs, IEEE Transactions on Software Engineering, Vol.19, No.3, March 1993.
  • - *
- *

- * Minimum edge length and weights should be non-negative. - *

- * @param graph the given graph - * @param layer the {@link } that will be filled during the execution and returns the zero-based ranking index for - * each node - * @param w the {@link } that returns an integer value (weight) of each edge - * @param minLength the {@link } that returns an integer value (minimum length) of each edge - * @param [maximalDuration=0x7FFFFFFFFFFFFFFF] a preferred time limit for the algorithm (in milliseconds) - * @returns the number of layers - * @see yfiles.algorithms.RankAssignments#simplex - * @see yfiles.algorithms.RankAssignments#simplex - * @static - */ - static simplex(graph:yfiles.algorithms.Graph,layer:yfiles.algorithms.INodeMap,w:yfiles.algorithms.IDataProvider,minLength:yfiles.algorithms.IDataProvider,maximalDuration?:number):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.RankAssignments; - } - /** - * This class provides diverse algorithms and helper methods for solving the shortest path problem on weighted graphs. - *

- * Definitions Given a weighted directed/undirected graph: - *

- *
    - *
  • The shortest path problem is the problem of finding a shortest path between a source node s - * and a target node t such that the sum of the edge costs is minimized.
  • - *
  • The k-shortest path problem is the problem of finding k shortest paths between a source - * node s and a target node t such that the sum of the edge costs is minimized.
  • - *
  • The single-source shortest path problem is the problem of finding shortest paths from a source node - * s to all other nodes such that the sum of the edge costs is minimized.
  • - *
  • The single-source single-sink shortest path problem is the problem of finding shortest paths from a source node s to a target node t such that the sum of the edge costs is minimized.
  • - *
  • The all-pairs shortest path problem is the problem of finding shortest paths between every pair of - * nodes such that the sum of the edge costs is minimized.
  • - *
- * @class - * @static - */ - export interface ShortestPaths extends yfiles.lang.Object{} - export class ShortestPaths { - /** - * Solves the single-source shortest path problem for acyclic directed graphs. - *

- * Each edge is associated with an arbitrary double value that represents the cost of that edge. - *

- *

- * This method yields the shortest distance from a given node s to all other nodes. - *

- * @param graph the input graph - * @param s the node from which the shortest path search starts - * @param cost an array of double values that returns the costs for traversing each edge; edge e has cost cost[e.index()] - * @param dist an array of values that will be filled during the execution and returns the shortest distance from node s to all other - * nodes. The distance from s to v is dist[v.index()]. If there is no path from s to v, then - * dist[v.index()] == Double.POSITIVE_INFINITY. - * @param [pred=null] an array of {@link }s that will be filled during the execution and returns for each node t the shortest - * path edge pred[t.index()] which is the last edge on the shortest path from s to t. If t == s or if there is no shortest - * path from s to t, then pred[t.index()] == null. - * @returns true if the input graph is acyclic, false otherwise - * @see yfiles.algorithms.ShortestPaths#acyclic - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @static - */ - static acyclic(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,cost:number[],dist:number[],pred?:yfiles.algorithms.Edge[]):boolean; - /** - * Solves the single-source shortest path problem for acyclic directed graphs. - *

- * Each edge is associated with an arbitrary double value that represents the cost of that edge. - *

- *

- * This method yields the shortest distance from a given node s to all other nodes. - *

- * @param graph the input graph - * @param s the node from which the shortest path search starts - * @param cost the {@link } that returns the double value (cost) for traversing each edge - * @param dist the {@link } that will be filled during the execution and returns a double value (shortest distance) - * from node s to all other nodes or {@link #POSITIVE_INFINITY} if no such paths exist - * @param pred the {@link } that will be filled during the execution and returns for each node t the last edge on the - * shortest path from s to t or null if t == s or no shortest path from s to t exists - * @returns true if the input graph is acyclic, false otherwise - * @see yfiles.algorithms.ShortestPaths#acyclic - * @static - */ - static acyclic(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,cost:yfiles.algorithms.IDataProvider,dist:yfiles.algorithms.INodeMap,pred:yfiles.algorithms.INodeMap):boolean; - /** - * This method solves the all-pairs shortest path problem for graphs with arbitrary edge costs. - *

- * If the given graph contains a negative-cost cycle, then false is returned and the values returned in dist are left - * unspecified. - *

- * @param graph the input graph - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost an array of double values that returns the costs for traversing each edge; edge e has cost cost[e.index()] - * @param dist an array of values that will be filled during the execution and returns the shortest path distances from all pairs of - * nodes s and t in the graph. The distance from s to t is dist[s.index()][t.index()]. If there is no path from s to t, - * then dist[s.index()][t.index()] == Double.POSITIVE_INFINITY. - * @returns true if the given graph does not contain a negative-cost cycle, false otherwise - * @static - */ - static allPairs(graph:yfiles.algorithms.Graph,directed:boolean,cost:number[],dist:number[][]):boolean; - /** - * Solves the single-source shortest path problem for arbitrary graphs. - *

- * Each edge is associated with an arbitrary double value that represents the cost of this edge. - *

- *

- * In case the given weighted graph contains no negative-cost cycles, this method will yield the shortest distance from a given node s to all - * other nodes. If, on the other hand, the given graph contains negative-cost cycles, this method will yield no reasonable - * result which will be indicated by the return value false. - *

- * @param graph the input graph - * @param s the source node - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost the {@link } that returns the double value (cost) for traversing each edge - * @param dist the {@link } that will be filled during the execution and returns a double value (shortest distance) - * from node s to all other nodes or {@link #POSITIVE_INFINITY} if no such paths exist - * @param pred the {@link } that will be filled during the execution and returns for each node t the last edge on the - * shortest path from s to t or null if t == s or no shortest path from s to t exists - * @returns - * @see yfiles.algorithms.ShortestPaths#bellmanFord - * @static - */ - static bellmanFord(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:yfiles.algorithms.IDataProvider,dist:yfiles.algorithms.INodeMap,pred:yfiles.algorithms.INodeMap):boolean; - /** - * Solves the single-source shortest path problem for arbitrary graphs. - *

- * Each edge is associated with an arbitrary double value that represents the cost of this edge. - *

- *

- * In case the given weighted graph contains no negative cost cycles, this method will yield the shortest distance from a given node s to all - * other nodes. If, on the other hand, the given graph contains negative-cost cycles, this method will yield no reasonable - * result which will be indicated by the return value false. - *

- * @param graph the input graph - * @param s the node from which the shortest path search starts - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost an array of double values that returns the costs for traversing each edge; edge e has cost cost[e.index()] - * @param dist an array of values that will be filled during the execution and returns the shortest distance from node s to all other - * nodes. The distance from s to v is dist[v.index()]. If there is no path from s to v, then - * dist[v.index()] == Double.POSITIVE_INFINITY. - * @param [pred=null] an array of {@link }s that will be filled during the execution and returns for each node t the shortest - * path edge pred[t.index()] which is the last edge on the shortest path from s to t. If t == s or if there is no shortest - * path from s to t, then pred[t.index()] == null. - * @returns - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @see yfiles.algorithms.ShortestPaths#bellmanFord - * @static - */ - static bellmanFord(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:number[],dist:number[],pred?:yfiles.algorithms.Edge[]):boolean; - /** - * Convenience method that constructs an explicit {@link yfiles.algorithms.EdgeList path of edges} from the result returned by one of the shortest paths - * methods defined in this class. - *

- * If there is no path from node s to t, then an empty list is returned. - *

- * @param s the start node of the shortest path which must be the same start node that was specified when pred was calculated - * @param t the target node of the path - * @param pred an array of {@link }s that will be filled during the execution and returns for each node t the shortest - * path edge pred[t.index()] which is the last edge on the shortest path from s to t. If t == s or if there is no shortest - * path from s to t, then pred[t.index()] == null. - * @returns a {@link list} containing the edges on the shortest path from s to t in the correct order - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @static - */ - static constructEdgePath(s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,pred:yfiles.algorithms.Edge[]):yfiles.algorithms.EdgeList; - /** - * Like {@link yfiles.algorithms.ShortestPaths#constructEdgePath} but the path edges are given by a - * {@link yfiles.algorithms.IDataProvider}. - *

- * If there is no path from node s to t, then an empty list is returned. - *

- * @param s the start node of the shortest path which must be the same start node that was specified when pred was calculated - * @param t the target node of the path - * @param pred the {@link } that will be filled during the execution and returns for each node t the last edge on the - * shortest path from s to t or null if t == s or no shortest path from s to t exists - * @returns a {@link list} containing the edges on the shortest path from s to t in the correct order - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @static - */ - static constructEdgePath(s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,pred:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList; - /** - * Convenience method that constructs an explicit {@link yfiles.algorithms.NodeList path of nodes} from the result returned by one of the shortest paths - * methods defined in this class. - *

- * If there is no path from node s to t, then an empty list is returned. - *

- * @param s the start node of the shortest path which must be the same start node that was specified when pred was calculated - * @param t the target node of the path - * @param pred an array of {@link }s that will be filled during the execution and returns for each node t the shortest - * path edge pred[t.index()] which is the last edge on the shortest path from s to t. If t == s or if there is no shortest - * path from s to t, then pred[t.index()] == null. - * @returns a {@link list} containing the nodes on the shortest path from s to t in the correct order - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @static - */ - static constructNodePath(s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,pred:yfiles.algorithms.Edge[]):yfiles.algorithms.NodeList; - /** - * Like {@link yfiles.algorithms.ShortestPaths#constructNodePath} but the path edges are given by a - * {@link yfiles.algorithms.IDataProvider}. - *

- * If there is no path from node s to t, then an empty list is returned. - *

- * @param s the start node of the shortest path which must be the same start node that was specified when pred was calculated - * @param t the target node of the path - * @param pred the {@link } that will be filled during the execution and returns for each node t the last edge on the - * shortest path from s to t or null if t == s or no shortest path from s to t exists - * @returns a {@link list} containing the nodes on the shortest path from s to t in the correct order - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @static - */ - static constructNodePath(s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,pred:yfiles.algorithms.IDataProvider):yfiles.algorithms.NodeList; - /** - * Solves the single-source shortest path problem for arbitrary graphs. - *

- * Each edge is associated with a non-negative double value that represents the cost of the edge. - *

- *

- * This method yields the shortest distance from a given node s to all other nodes. - *

- *

- * The costs should be non-negative. - *

- * @param graph the input graph - * @param s the node from which the shortest path search starts - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost an array of double values that returns the costs for traversing each edge; edge e has cost cost[e.index()] - * @param dist an array of values that will be filled during the execution and returns the shortest distance from node s to all other - * nodes. The distance from s to v is dist[v.index()]. If there is no path from s to v, then - * dist[v.index()] == Double.POSITIVE_INFINITY. - * @param [pred=null] an array of {@link }s that will be filled during the execution and returns for each node t the shortest - * path edge pred[t.index()] which is the last edge on the shortest path from s to t. If t == s or if there is no shortest - * path from s to t, then pred[t.index()] == null. - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @see yfiles.algorithms.ShortestPaths#dijkstra - * @static - */ - static dijkstra(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:number[],dist:number[],pred?:yfiles.algorithms.Edge[]):void; - /** - * Solves the single-source shortest path problem for arbitrary graphs. - *

- * Each edge is associated with a non-negative double value that represents the cost of the edge. - *

- *

- * This method yields the shortest distance from a given node s to all other nodes. - *

- *

- * The costs should be non-negative. - *

- * @param graph the input graph - * @param s the node from which the shortest path search starts - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost the {@link } that returns the double value (cost) for traversing each edge - * @param dist the {@link } that will be filled during the execution and returns a double value (shortest distance) - * from node s to all other nodes or {@link #POSITIVE_INFINITY} if no such paths exist - * @param pred the {@link } that will be filled during the execution and returns for each node t the last edge on the - * shortest path from s to t or null if t == s or no shortest path from s to t exists - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @see yfiles.algorithms.ShortestPaths#dijkstra - * @static - */ - static dijkstra(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:yfiles.algorithms.IDataProvider,dist:yfiles.algorithms.INodeMap,pred:yfiles.algorithms.INodeMap):void; - /** - * Finds all nodes and edges that belong to a shortest path from a start node to a set of target nodes in the graph not - * farther away than a given distance. - *

- * This method assumes that each edge of the input graph has a cost of 1.0. - *

- * @param graph the input graph - * @param start the start node - * @param targetMap the {@link } that returns a boolean value indicating whether or not a node belongs to the set of - * target nodes - * @param directed true if the graph should be considered as directed, false otherwise - * @param maxLength the maximum edge length of the shortest paths - * @param pathEdges a {@link list} that will be filled during the execution and returns the edges on the shortest path from s to t in the correct - * order - * @param pathNodes a {@link list} that will be filled during the execution and returns the nodes on the shortest path from s to t in the correct - * order - * @static - */ - static findShortestUniformPaths(graph:yfiles.algorithms.Graph,start:yfiles.algorithms.Node,targetMap:yfiles.algorithms.IDataProvider,directed:boolean,maxLength:number,pathEdges:yfiles.algorithms.EdgeList,pathNodes:yfiles.algorithms.NodeList):void; - /** - * Marks all edges that belong to a shortest path from start node to target node. - *

- * This method assumes that each edge of the input graph has a cost of 1.0. - *

- * @param graph the input graph - * @param start the start node - * @param end the target node - * @param directed true if the graph should be considered as directed, false otherwise - * @param pathMap the {@link } that will be filled during the execution and returns a boolean value indicating whether - * or not the edge belongs to a shortest path connecting the two nodes - * @static - */ - static findShortestUniformPaths(graph:yfiles.algorithms.Graph,start:yfiles.algorithms.Node,end:yfiles.algorithms.Node,directed:boolean,pathMap:yfiles.algorithms.IEdgeMap):void; - /** - * This method finds the k shortest paths connecting a pair of nodes in a directed graph with non-negative edge costs. - *

- * The result will be returned as a list of {@link yfiles.algorithms.EdgeList} objects. - *

- *

- * The cost should be non-negative. - *

- * @param graph the input graph - * @param costDP the {@link } that returns a double value (cost) for traversing each edge - * @param start the given start node - * @param end the given target node - * @param k a non-negative integer value - * @returns a {@link list} of {@link } objects each of which represents a path from start node to target node. The i-th - * path in the list contains the i-th shortest path between the start and target node. - * @static - */ - static kShortestPaths(graph:yfiles.algorithms.Graph,costDP:yfiles.algorithms.IDataProvider,start:yfiles.algorithms.Node,end:yfiles.algorithms.Node,k:number):yfiles.algorithms.YList; - /** - * A variant of {@link yfiles.algorithms.ShortestPaths#kShortestPaths} that returns the result as a special cursor that calculates - * the next path in the sequence only when needed. - *

- * The returned cursor only supports the operation {@link yfiles.algorithms.ICursor#ok}, {@link yfiles.algorithms.ICursor#current} and {@link yfiles.algorithms.ICursor#next}. - *

- *

- * The cost should be non-negative. - *

- * @param graph the input graph - * @param costDP the {@link } that returns a double value (cost) for traversing each edge - * @param start the given start node - * @param end the given target node - * @param k a non-negative integer value - * @returns a {@link cursor} that calculates the next path in the sequence only when needed - * @static - */ - static kShortestPathsCursor(graph:yfiles.algorithms.Graph,costDP:yfiles.algorithms.IDataProvider,start:yfiles.algorithms.Node,end:yfiles.algorithms.Node,k:number):yfiles.algorithms.ICursor; - /** - * Returns two edge-disjoint paths in a non-negatively weighted directed graph, such that both paths connect nodes s and t - * and have minimum total length. - * @param graph the input graph - * @param source the source node of the shortest pair - * @param target the target node of the shortest pair - * @param directed true if the graph should be considered as directed, false otherwise - * @param costDP the {@link } that returns a double value (cost) for traversing each edge - * @returns a two-dimensional array of {@link }s holding the resulting edge-disjoint paths or null if no such - * edge-disjoint paths exist - * @static - */ - static shortestPair(graph:yfiles.algorithms.Graph,source:yfiles.algorithms.Node,target:yfiles.algorithms.Node,directed:boolean,costDP:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList[]; - /** - * This method solves the single-source shortest path problem for arbitrary graphs. - * @param graph the input graph - * @param s the node from which the shortest path search starts - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost an array of double values that returns the costs for traversing each edge; edge e has cost cost[e.index()] - * @param dist an array of values that will be filled during the execution and returns the shortest distance from node s to all other - * nodes. The distance from s to v is dist[v.index()]. If there is no path from s to v, then - * dist[v.index()] == Double.POSITIVE_INFINITY. - * @param [pred=null] an array of {@link }s that will be filled during the execution and returns for each node t the shortest - * path edge pred[t.index()] which is the last edge on the shortest path from s to t. If t == s or if there is no shortest - * path from s to t, then pred[t.index()] == null. - * @returns true if the weighted graph does not contain a negative-cost cycle, false otherwise - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @see yfiles.algorithms.ShortestPaths#singleSource - * @static - */ - static singleSource(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:number[],dist:number[],pred?:yfiles.algorithms.Edge[]):boolean; - /** - * This method solves the single-source shortest path problem for arbitrary graphs. - * @param graph the input graph - * @param s the source node - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost the {@link } that returns the double value (cost) for traversing each edge - * @param dist the {@link } that will be filled during the execution and returns a double value (shortest distance) - * from node s to all other nodes or {@link #POSITIVE_INFINITY} if no such paths exist - * @param pred the {@link } that will be filled during the execution and returns for each node t the last edge on the - * shortest path from s to t or null if t == s or no shortest path from s to t exists - * @returns true if the weighted graph does not contain a negative-cost cycle, false otherwise - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @see yfiles.algorithms.ShortestPaths#singleSource - * @static - */ - static singleSource(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:yfiles.algorithms.IDataProvider,dist:yfiles.algorithms.INodeMap,pred:yfiles.algorithms.INodeMap):boolean; - /** - * This method solves the single-source single-sink shortest path problem for arbitrary graphs. - *

- * Each edge is associated with a non-negative double value that represents the cost of the edge. - *

- *

- * This method returns the shortest distance from node s to node - * t. It also returns information to construct the actual path between these two nodes. - *

- *

- * The costs should be non-negative. - *

- * @param graph the input graph - * @param s the source node - * @param t the sink node - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost an array of double values that returns the costs for traversing each edge; edge e has cost cost[e.index()] - * @param pred an array of {@link }s that will be filled during the execution and returns for each node t the shortest - * path edge pred[t.index()] which is the last edge on the shortest path from s to t. If t == s or if there is no shortest - * path from s to t, then pred[t.index()] == null. - * @returns the distance between sand t if a path between these two nodes exists or Double.POSITIVE_INFINITY otherwise - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @static - */ - static singleSourceSingleSink(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,directed:boolean,cost:number[],pred:yfiles.algorithms.Edge[]):number; - /** - * Like {@link yfiles.algorithms.ShortestPaths#singleSourceSingleSink} but uses {@link yfiles.algorithms.INodeMap}s and - * {@link yfiles.algorithms.IDataProvider}s instead of arrays. - *

- * Each edge is associated with a non-negative double value that represents the cost of the edge. - *

- *

- * The costs should be non-negative. - *

- * @param graph the input graph - * @param s the source node - * @param t the sink node - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost the {@link } that returns the double value (cost) for traversing each edge - * @param pred the {@link } that will be filled during the execution and returns for each node t the last edge on the - * shortest path from s to t or null if t == s or no shortest path from s to t exists - * @returns a shortest {@link path of edges} between source and sink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @static - */ - static singleSourceSingleSink(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,directed:boolean,cost:yfiles.algorithms.IDataProvider,pred:yfiles.algorithms.INodeMap):number; - /** - * Similar to {@link yfiles.algorithms.ShortestPaths#singleSourceSingleSink} but instead of returning the shortest distance between - * the source and sink the actual shortest edge path between these nodes will be returned. - *

- * Each edge is associated with a non-negative double value that represents the cost of the edge. - *

- *

- * If the returned path is empty, then there is no path between the nodes. - *

- *

- * The costs should be non-negative. - *

- * @param graph the input graph - * @param s the source node - * @param t the sink node - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost an array of double values that returns the costs for traversing each edge; edge e has cost cost[e.index()] - * @returns a shortest {@link path of edges} between source and sink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @static - */ - static singleSourceSingleSink(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,directed:boolean,cost:number[]):yfiles.algorithms.EdgeList; - /** - * Similar to {@link yfiles.algorithms.ShortestPaths#singleSourceSingleSink} but instead of returning the shortest distance between - * the source and sink the actual shortest edge path between these nodes will be returned. - *

- * Each edge is associated with a non-negative double value that represents the cost of the edge. - *

- *

- * If the returned path is empty, then there is no path between the nodes. - *

- *

- * The costs should be non-negative. - *

- * @param graph the input graph - * @param s the source node - * @param t the sink node - * @param directed true if the graph should be considered as directed, false otherwise - * @param cost the {@link } that returns the double value (cost) for traversing each edge - * @returns a shortest {@link path of edges} between source and sink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink - * @static - */ - static singleSourceSingleSink(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,directed:boolean,cost:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList; - /** - * Solves the single-source shortest path problem for arbitrary graphs in which each edge has a uniform cost of - * 1.0. - * @param graph the input graph - * @param s the node from which the shortest path search starts - * @param directed true if the graph should be considered as directed, false otherwise - * @param dist an array of values that will be filled during the execution and returns the shortest distance from node s to all other - * nodes. The distance from s to v is dist[v.index()]. If there is no path from s to v, then - * dist[v.index()] == Double.POSITIVE_INFINITY. - * @param [pred=null] an array of {@link }s that will be filled during the execution and returns for each node t the shortest - * path edge pred[t.index()] which is the last edge on the shortest path from s to t. If t == s or if there is no shortest - * path from s to t, then pred[t.index()] == null. - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @static - */ - static uniform(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,dist:number[],pred?:yfiles.algorithms.Edge[]):void; - /** - * Like {@link yfiles.algorithms.ShortestPaths#uniform} but uses {@link yfiles.algorithms.INodeMap}s instead of arrays. - * @param graph the input graph - * @param s the node from which the shortest path search starts - * @param directed true if the graph should be considered as directed, false otherwise - * @param dist the {@link } that will be filled during the execution and returns a double value (shortest distance) - * from node s to all other nodes or {@link #POSITIVE_INFINITY} if no such paths exist - * @param pred the {@link } that will be filled during the execution and returns for each node t the last edge on the - * shortest path from s to t or null if t == s or no shortest path from s to t exists - * @see yfiles.algorithms.ShortestPaths#uniform - * @see yfiles.algorithms.ShortestPaths#constructNodePath - * @see yfiles.algorithms.ShortestPaths#constructEdgePath - * @static - */ - static uniform(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,dist:yfiles.algorithms.INodeMap,pred:yfiles.algorithms.INodeMap):void; - /** - * Convenience method that returns an array containing uniform edge costs of 1.0 for each edge of the given graph. - * @param graph the input graph - * @returns an array that contains uniform edge costs of value 1.0 (i.e., for each edge e: cost[e.index()] == 1.0) - * @static - */ - static uniformCost(graph:yfiles.algorithms.Graph):number[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.ShortestPaths; - } - /** - * This class provides methods for efficiently sorting graph elements in graph structures. - * @class - * @static - */ - export interface Sorting extends yfiles.lang.Object{} - export class Sorting { - /** - * Sorts the nodes of a given graph by degree in ascending order. - * @param graph the given graph - * @returns an array of {@link }s sorted by degree in ascending order - * @static - */ - static sortNodesByDegree(graph:yfiles.algorithms.Graph):yfiles.algorithms.Node[]; - /** - * Sorts the nodes of a given graph by an integer key associated with each node through a {@link yfiles.algorithms.IDataProvider}. - *

- * The nodes are sorted in ascending order. - *

- * @param graph the given graph - * @param keys the {@link } that returns the keys based on which the nodes will be sorted - * @returns an array of {@link }s sorted by an integer key in ascending order - * @static - */ - static sortNodesByIntKey(graph:yfiles.algorithms.Graph,keys:yfiles.algorithms.IDataProvider):yfiles.algorithms.Node[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Sorting; - } - /** - * This class provides (minimum) spanning tree algorithms for graphs. - *

- * Definitions - *

- *
    - *
  • A spanning tree of an undirected connected graph is a subset of its edges that induce a tree that connects all nodes of the graph.
  • - *
  • - * A minimum spanning tree of a weighted connected graph is a spanning tree whose edges have minimum overall cost among all spanning trees of - * that graph. - *
  • - *
- * @class - * @static - */ - export interface SpanningTrees extends yfiles.lang.Object{} - export class SpanningTrees { - /** - * Returns the overall cost of a previously calculated minimum spanning tree. - * @param treeEdges the given {@link list} of edges that form a minimum spanning tree - * @param edgeCost the {@link } that returns a double value (cost) for each tree edge - * @returns the overall cost of the tree edges - * @static - */ - static cost(treeEdges:yfiles.algorithms.EdgeList,edgeCost:yfiles.algorithms.IDataProvider):number; - /** - * Calculates a minimum spanning tree for the given graph. - *

- * The implementation is based on an algorithm originally published in: - *

- *
    - *
  • J.B. Kruskal. On the shortest spanning subtree of a graph and the traveling salesman problem. Proceedings of the American Mathematical Society, pages 48-50, 1956.
  • - *
- * @param graph the input graph - * @param cost the {@link } that returns a double value (cost) for each edge - * @returns a {@link list} containing the edges that form the minimum spanning tree - * @static - */ - static kruskal(graph:yfiles.algorithms.Graph,cost:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList; - /** - * Calculates a minimum spanning tree for the given graph. - *

- * Currently, the result is obtained by calling {@link yfiles.algorithms.SpanningTrees#prim}. - *

- * @param graph the input graph - * @param cost the {@link } that returns a double value (cost) for each edge - * @returns a {@link list} containing the edges that form the minimum spanning tree - * @static - */ - static minimum(graph:yfiles.algorithms.Graph,cost:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList; - /** - * Calculates a minimum spanning tree for the given graph. - *

- * The implementation is based on an algorithm originally published in: - *

- *
    - *
  • R.C. Prim. Shortest connection networks and some generalizations. Bell System Technical Journal, 36:1389-1401, 1957.
  • - *
- * @param graph the input graph - * @param cost the {@link } that returns a double value (cost) for each edge - * @returns a {@link list} containing the edges that form the minimum spanning tree - * @static - */ - static prim(graph:yfiles.algorithms.Graph,cost:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList; - /** - * Calculates a spanning tree for the given graph in which each edge has a uniform cost of 1.0. - * @param graph the input graph - * @returns a {@link list} containing the edges that form the minimum spanning tree - * @static - */ - static uniform(graph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.SpanningTrees; - } - /** - * This class provides algorithms to compute reachability information for directed, acyclic graphs. - *

- * Definitions - *

- *
    - *
  • - * Reflexive, transitive closure: Let G = (V,E) be a directed acyclic graph. The reflexive, transitive closure of G is a graph which contains edge (v,w) only if there exists a path - * from v to w in G. - *
  • - *
  • - * Transitive reduction: Let G = (V,E) be a directed acyclic graph. The transitive reduction of G is a graph which contains edge (v,w) only if there exists no path - * from v to w in G of length 2 or more. - *
  • - *
- * @class - * @static - */ - export interface Transitivity extends yfiles.lang.Object{} - export class Transitivity { - /** - * Calculates the transitive closure for a directed acyclic graph. - *

- * Given a G = (V,E) be a directed acyclic graph. The reflexive, transitive closure of G is a graph which contains edge (v,w) only if there exists a - * path from v to w in G. - *

- * @param graph the input graph to which this method will add transitive edges, if necessary - * @param [addedEdges=null] a {@link list} that will be filled during the execution and contains the edges that have been added to the graph by this method - * @static - */ - static transitiveClosure(graph:yfiles.algorithms.Graph,addedEdges?:yfiles.algorithms.EdgeList):void; - /** - * Calculates the transitive reduction for a directed acyclic graph. - *

- * The transitive edges in the graph will be removed by this method. - *

- *

- * Given G = (V,E) be a directed acyclic graph. The transitive reduction of G is a graph which contains edge (v,w) only if there exists no path - * from v to w in G of length 2 or more. - *

- * @param graph the input graph - * @param [transitiveEdges=null] a {@link list} that will be filled during the execution and contains all transitive edges of the given graph; removal of these - * edges will yield the transitive reduction of the graph - * @static - */ - static transitiveReduction(graph:yfiles.algorithms.Graph,transitiveEdges?:yfiles.algorithms.EdgeList):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Transitivity; - } - /** - * This class provides diverse algorithms and services for tree-structured graphs or subgraphs. - *

- * Definitions - *

- *
    - *
  • - * Tree: An acyclic graph, in which any pair of vertices (nodes) is connected through a path. If one vertex of a tree is - * distinguished from the other vertices, then this vertex is called the root and the tree is called a rooted tree. - *
  • - *
  • Directed rooted tree: A rooted tree where edges are directed from the root to the leaves.
  • - *
  • Depth: The depth of a vertex in a rooted tree is the number of edges of the unique path between this vertex and the root.
  • - *
  • - * Parent: In a rooted tree a vertex v is called parent of a vertex w if v and w are adjacent (i.e. connected by an edge) and the - * unique path between w and the root contains v. Note that each vertex except the root has exactly one parent. - *
  • - *
  • Children: In a rooted tree a vertex w is called child of a vertex v if v is the parent of w. A vertex may have several children.
  • - *
  • N-ary tree: A directed rooted tree where each node has a maximum of n children.
  • - *
  • Forest: A graph whose connected components are trees.
  • - *
  • - * Leaf: A leaf v is a node with out-degree (i.e., the number of edges having v as a target) zero if the input is a directed - * rooted tree, and a node with degree (i.e., the number of edges incident to v) one, otherwise. - *
  • - *
  • Subtree: A subtree of a tree T is a subgraph of T which is also a tree.
  • - *
  • - * Nearest or Lowest or Least common ancestor: The nearest common ancestor of two nodes u and v in a tree graph is the shared ancestor of u and v that is located - * farthest from the root. - *
  • - *
  • Eccentricity: The eccentricity of a tree node is the maximum distance to any other node.
  • - *
  • Center node: The center of a tree is the set of nodes that have minimal eccentricity.
  • - *
- * @class - * @static - */ - export interface Trees extends yfiles.lang.Object{} - export class Trees { - static collectSubtree(root:yfiles.algorithms.Node,nodes:yfiles.algorithms.NodeList):void; - /** - * Converts the given tree to a directed rooted tree with the given node as root element by reversing some edges. - *

- * A list of all reversed edges will be returned by this method. - *

- * @param tree the given tree - * @param [root=null] the given root element - * @returns an {@link } containing the reversed edges - * @static - */ - static directTree(tree:yfiles.algorithms.Graph,root?:yfiles.algorithms.Node):yfiles.algorithms.EdgeList; - /** - * Returns the center node of an undirected tree. - *

- * The center node has the property of inducing a minimum depth tree when being used as the root of that tree. - *

- * @param tree the given undirected tree - * @returns the center node of the given undirected tree - * @static - */ - static getCenterRoot(tree:yfiles.algorithms.Graph):yfiles.algorithms.Node; - /** - * Returns all leaf nodes of the given tree. - *

- * A leaf node is a node with outdegree == 0 if the input is a directed rooted tree, and a node with - * degree == 1, otherwise. - *

- * @param tree the given tree - * @param directedRootedTree true if the algorithm should consider the tree as directed, false otherwise - * @returns a {@link } that contains all leaf nodes of the given tree - * @static - */ - static getLeafNodes(tree:yfiles.algorithms.Graph,directedRootedTree:boolean):yfiles.algorithms.NodeList; - /** - * Returns the nearest common ancestor of a subset of nodes within a directed rooted tree. - *

- * It is not part of the given subset. - *

- * @param tree the given directed rooted tree - * @param root the root of the tree - * @param rootedDownward true if the tree is directed from the root to the leaves, false otherwise - * @param nodes the subset of nodes - * @returns the {@link nearest common ancestor} of the given subset of nodes - * @static - */ - static getNearestCommonAncestor(tree:yfiles.algorithms.Graph,root:yfiles.algorithms.Node,rootedDownward:boolean,nodes:yfiles.algorithms.NodeList):yfiles.algorithms.Node; - /** - * Returns a possible root for the given (undirected) tree. - *

- * More precisely: - *

- *
    - *
  • If the input is a directed rooted tree or reversed directed rooted tree, it returns the corresponding root node.
  • - *
  • - * If the input is a tree, the method returns a maximum weight center node as defined in - * {@link yfiles.algorithms.Trees#getWeightedCenterNode}. - *
  • - *
  • If the input is not a tree, a node with indegree == 0 (or outdegree == 0) is returned.
  • - *
- * @param tree the given tree - * @returns a possible root for the given tree - * @static - */ - static getRoot(tree:yfiles.algorithms.Graph):yfiles.algorithms.Node; - /** - * Returns the depths of each subtree of a rooted directed tree. - * @param tree a rooted directed tree graph - * @param subtreeDepthMap the {@link } that will be filled during the execution with the depth of the subtree rooted at each - * node - * @static - */ - static getSubTreeDepths(tree:yfiles.algorithms.Graph,subtreeDepthMap:yfiles.algorithms.INodeMap):void; - /** - * Returns the size (number of nodes) of each subtree of a rooted directed tree. - * @param tree a rooted directed tree graph - * @param subtreeSizeMap the {@link } that will be filled during the execution with the size of the subtree rooted at each - * node - * @static - */ - static getSubTreeSizes(tree:yfiles.algorithms.Graph,subtreeSizeMap:yfiles.algorithms.INodeMap):void; - /** - * Returns an array of {@link yfiles.algorithms.EdgeList} objects each containing edges that belong to a maximal directed subtree - * of the given graph. - *

- * This method can also be applied to the result obtained by - * {@link yfiles.algorithms.Trees#getUndirectedTreeNodes}. In this case, the subtrees are considered to be undirected. - *

- * @param graph the given graph - * @param [treeNodes=null] an array of {@link }s previously calculated by {@link #getTreeNodes} - * @returns an array of {@link } objects each containing edges that belong to a maximal subtree - * @static - */ - static getTreeEdges(graph:yfiles.algorithms.Graph,treeNodes?:yfiles.algorithms.NodeList[]):yfiles.algorithms.EdgeList[]; - /** - * Returns an array of {@link yfiles.algorithms.NodeList} objects each containing nodes that belong to a maximal directed subtree - * of the given graph. - *

- * For each list of tree nodes, the first node element is the root of a tree. On each such root, all outgoing edges connect - * to nodes in the subtree and each in-degree of the root is at least two. - *

- * @param graph the given graph - * @returns an array of {@link } objects each containing nodes that belong to a maximal directed subtree - * @static - */ - static getTreeNodes(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList[]; - /** - * Returns an array of {@link yfiles.algorithms.NodeList} objects each containing nodes that belong to a maximal undirected subtree - * of the given graph. - *

- * For each list of tree nodes, the first node is the only node of the subtree that may be incident to non-tree edges. - *

- * @param graph the given graph - * @returns an array of {@link } objects each containing nodes that belong to a maximal undirected subtree - * @static - */ - static getUndirectedTreeNodes(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList[]; - /** - * Finds a node used by the greatest number of all (undirected) paths interconnecting all nodes with each other. - *

- * The number of paths per node are stored in the given {@link yfiles.algorithms.INodeMap}. - *

- * @param tree the given tree - * @param [intWeight=null] the {@link } that holds the number of paths per node - * @returns a {@link } used by the greatest number of all undirected paths - * @static - */ - static getWeightedCenterNode(tree:yfiles.algorithms.Graph,intWeight?:yfiles.algorithms.INodeMap):yfiles.algorithms.Node; - /** - * Checks whether or not the given graph is a forest. - *

- * If - * directedRootedTree == true, each component has to be a directed rooted tree. Otherwise, each component has to be an - * undirected tree. - *

- * @param graph the given graph - * @param directedRootedTree true if the algorithm should check for directed rooted trees, false otherwise - * @returns true if the given graph is a forest, false otherwise - * @static - */ - static isForest(graph:yfiles.algorithms.Graph,directedRootedTree:boolean):boolean; - /** - * Checks whether or not the given graph is a forest, that is, a graph whose connected components are directed rooted - * trees. - * @param graph the given graph - * @returns true if the given graph is a forest, false otherwise - * @static - */ - static isForest(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given graph is a directed rooted tree in which each node has a maximum of n children. - * @param graph the given graph - * @param n the allowed maximum of children - * @returns true if the given graph is a n-ary tree, false otherwise - * @static - */ - static isNaryTree(graph:yfiles.algorithms.Graph,n:number):boolean; - /** - * Checks whether or not the given graph is a directed rooted tree. - * @param graph the given graph - * @returns true if the given graph is a directed rooted tree, false otherwise - * @static - */ - static isRootedTree(graph:yfiles.algorithms.Graph):boolean; - /** - * Checks whether or not the given graph is an undirected tree. - * @param graph the given graph - * @returns true if the given graph is an undirected tree, false otherwise - * @static - */ - static isTree(graph:yfiles.algorithms.Graph):boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Trees; - } - /** - * This class provides access to some Comparator instances that are commonly used in yFiles. - * @class - * @static - */ - export interface Comparers extends yfiles.lang.Object{} - export class Comparers { - /** - * Compares the specified floating point numbers. - *

- * Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than - * the second. - *

- *

- * Warning: This method does not handle NaN! If you need NaN-safe comparison, use {@link yfiles.lang.Object#compare} instead. - *

- * @param d1 the first number to compare. - * @param d2 the second number to compare. - * @returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the - * second. - * @see yfiles.collections.IComparer.#compare - * @static - */ - static compare(d1:number,d2:number):number; - /** - * Returns a {@link yfiles.collections.IComparer.} that compares to Objects of type Comparable. - * @returns - * @static - */ - static createComparableComparer():yfiles.collections.IComparer; - /** - * Returns a {@link yfiles.collections.IComparer.} that compares objects of arbitrary type. - *

- * Two objects are compared by comparing the {@link yfiles.lang.IComparable} instances the given data provider returns for each of - * these objects. - *

- * @param dp a data provider that must return a {@link } for each object that is being compared by this comparator. - * @returns a {@link } that compares arbitrary objects. - * @static - */ - static createComparableDataComparer(dp:yfiles.algorithms.IDataProvider):yfiles.collections.IComparer; - /** - * Returns a {@link yfiles.collections.IComparer.} that compares objects of arbitrary type. - *

- * Two objects are compared by comparing the int value the given data provider returns for each of these objects. - *

- * @param dp a data provider that must return an int value for each object that is being compared by this comparator. - * @returns a {@link } that compares arbitrary objects. - * @static - */ - static createIntDataComparer(dp:yfiles.algorithms.IDataProvider):yfiles.collections.IComparer; - /** - * Returns a {@link yfiles.collections.IComparer.} that compares objects of type {@link yfiles.algorithms.Edge}. - *

- * Two edges are compared by comparing their source nodes. Each source node e.source() in turn is compared by the int value - * provided by the given data provider: dp.getInt(e.source()). - *

- * @param dp a data provider that must return an int value for the source node of each edge being compared. - * @returns a {@link } that compares edges. - * @static - */ - static createIntDataSourceComparer(dp:yfiles.algorithms.IDataProvider):yfiles.collections.IComparer; - /** - * Returns a {@link yfiles.collections.IComparer.} that compares objects of type {@link yfiles.algorithms.Edge}. - *

- * Two edges are compared by comparing their target nodes. Each target node e.target() in turn is compared by the int value - * provided by the given data provider: dp.getInt(e.target()). - *

- * @param dp a data provider that must return an int value for the target node of each edge being compared. - * @returns a {@link } that compares edges. - * @static - */ - static createIntDataTargetComparer(dp:yfiles.algorithms.IDataProvider):yfiles.collections.IComparer; - /** - * Returns a {@link yfiles.collections.IComparer.} that compares objects of arbitrary type. - *

- * Two objects are compared by comparing the double value the given data provider returns for each of these objects. - *

- * @param dp a data provider that must return a double value for each object that is being compared by this comparator. - * @returns a {@link } that compares arbitrary objects. - * @static - */ - static createNumberDataComparer(dp:yfiles.algorithms.IDataProvider):yfiles.collections.IComparer; - /** - * Returns a {@link yfiles.collections.IComparer.} that compares objects of type {@link yfiles.algorithms.Edge}. - *

- * Two edges are compared by comparing their source nodes. Each source node e.source() in turn is compared by the double - * value provided by the given data provider: dp.getDouble(e.source()). - *

- * @param dp a data provider that must return a double value for the source node of each edge being compared. - * @returns a {@link } that compares edges. - * @static - */ - static createNumberDataSourceComparer(dp:yfiles.algorithms.IDataProvider):yfiles.collections.IComparer; - /** - * Returns a {@link yfiles.collections.IComparer.} that compares objects of type {@link yfiles.algorithms.Edge}. - *

- * Two edges are compared by comparing their target nodes. Each target node e.target() in turn is compared by the double - * value provided by the given data provider: dp.getDouble(e.target()). - *

- * @param dp a data provider that must return a double value for the target node of each edge being compared. - * @returns a {@link } that compares edges. - * @static - */ - static createNumberDataTargetComparer(dp:yfiles.algorithms.IDataProvider):yfiles.collections.IComparer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Comparers; - } - /** - * Provides utility methods for working with {@link yfiles.algorithms.ICursor cursors}. - * @class - * @static - */ - export interface Cursors extends yfiles.lang.Object{} - export class Cursors { - /** - * Creates a new cursor that provides a logical view on the concatenation of the two given cursors. - * @param c1 - first concatenation argument - * @param c2 - second concatenation argument - * @returns - * @static - */ - static concatenate(c1:yfiles.algorithms.ICursor,c2:yfiles.algorithms.ICursor):yfiles.algorithms.ICursor; - /** - * Creates a cursor view of the given collection. - *

- * Creates an ICursor view of the given collection. - *

- *

- * Note that the returned cursor does not support the {@link yfiles.algorithms.ICursor#prev prev} and {@link yfiles.algorithms.ICursor#toLast toLast} operations. - *

- * Type parameter T. - * @param c The collection. - * @returns The cursor view of the given collection. - * @template T - * @static - */ - static createCursor(c:yfiles.collections.ICollection):yfiles.algorithms.ICursor; - /** - * Creates a cursor view of the given collection. - *

- * Note that the returned cursor does not support the operations {@link yfiles.algorithms.ICursor#prev prev}, {@link yfiles.algorithms.ICursor#toLast toLast}, and - * {@link yfiles.algorithms.IEdgeCursor#cyclicPrev}. - *

- * Type parameter T. - * @param c The collection. - * @returns an {@link } view of the given collection. - * @template T - * @static - */ - static createEdgeCursor(c:yfiles.collections.ICollection):yfiles.algorithms.IEdgeCursor; - /** - * Creates a cursor view of the given collection. - *

- * Note that the returned cursor does not support the operations {@link yfiles.algorithms.ICursor#prev prev}, {@link yfiles.algorithms.ICursor#toLast toLast}, and - * {@link yfiles.algorithms.INodeCursor#cyclicPrev}. - *

- * Type parameter T. - * @param c The collection. - * @returns an {@link } view of the given collection. - * @template T - * @static - */ - static createNodeCursor(c:yfiles.collections.ICollection):yfiles.algorithms.INodeCursor; - /** - * Creates or fills an array with the values provided by the cursor - * @param cursor the cursor - * @param dest the array to fill with the values or null if the method should create the array itself - * @returns dest or a newly created array filled with the values from cursor - * @static - */ - static toArray(cursor:yfiles.algorithms.ICursor,dest:any[]):any[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Cursors; - } - /** - * An abstract adapter class for providing data. - *

- * The data provision methods in this class throw a {@link yfiles.lang.Exception} and {@link yfiles.algorithms.DataProviderAdapter#defined} - * always returns false. - *

- *

- * This class exists as a convenience for creating data provider objects. - *

- *

- * Extend this class to provide either typed or untyped data for a certain lookup domain. - *

- * @class - * @implements {yfiles.algorithms.IDataProvider} - */ - export interface DataProviderAdapter extends yfiles.lang.Object,yfiles.algorithms.IDataProvider{} - export class DataProviderAdapter { - /** - * Returns false for all data holders. - *

- * Subclasses should override this method to make clear for which data holders there is a value accessible via this data - * provider. - *

- * @param dataHolder - * @returns false. - */ - defined(dataHolder:any):boolean; - /** - * Subclasses may override this method to provide access to object values. - * @param dataHolder - * @returns - * @throws {Stubs.Exceptions.NotSupportedError} unless overwritten. - */ - get(dataHolder:any):any; - /** - * Subclasses may override this method to provide access to boolean values. - * @param dataHolder - * @returns - * @throws {Stubs.Exceptions.NotSupportedError} unless overwritten. - */ - getBoolean(dataHolder:any):boolean; - /** - * Subclasses may override this method to provide access to integer values. - * @param dataHolder - * @returns - * @throws {Stubs.Exceptions.NotSupportedError} unless overwritten. - */ - getInt(dataHolder:any):number; - /** - * Subclasses may override this method to provide access to double values. - * @param dataHolder - * @returns - * @throws {Stubs.Exceptions.NotSupportedError} unless overwritten. - */ - getNumber(dataHolder:any):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.DataProviderAdapter; - } - /** - * This class provides convenience and transformation services for DataProviders. - * @class - * @static - */ - export interface DataProviders extends yfiles.lang.Object{} - export class DataProviders { - /** - * Returns a DataProvider that returns the given value for each key. - * @param data constant Object data returned by the created data provider. - * @returns a data provider view of a single value. - * @static - */ - static createConstantDataProvider(data:any):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider view of an Object array defined for edges. - *

- * The Object value data[edge.index()] will be returned by the data provider upon the method call get(edge). - *

- * @param data array data for each edge of a static graph - * @returns a data provider view of the given array - * @static - */ - static createEdgeDataProvider(data:any[]):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider view of a double, int, boolean and Object array defined for edges. - *

- * The double value doubleData[edge.index()] will be returned by the data provider upon the method call getDouble(edge). - *

- *

- * The int value intData[edge.index()] will be returned by the data provider upon the method call getInt(edge). - *

- *

- * The boolean value boolData[edge.index()] will be returned by the data provider upon the method call getBool(edge). - *

- *

- * The Object value objectData[edge.index()] will be returned by the data provider upon the method call get(edge). - *

- * @param doubleData double data for each edge of a static graph - * @param intData int data for each edge of a static graph - * @param boolData boolean data for each edge of a static graph - * @param objectData Object data for each edge of a static graph - * @returns a data provider view of the given arrays - * @static - */ - static createEdgeDataProviderForArrays(doubleData:number[],intData:number[],boolData:boolean[],objectData:any[]):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider view of a boolean array defined for edges. - *

- * The boolean value data[edge.index()] will be returned by the data provider upon the method call getBool(edge). - *

- * @param data array data for each edge of a static graph - * @returns a data provider view of the given array - * @static - */ - static createEdgeDataProviderForBoolean(data:boolean[]):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider view of an int array defined for edges. - *

- * The int value data[edge.index()] will be returned by the data provider upon the method call getInt(edge). - *

- * @param data array data for each edge of a static graph - * @returns a data provider view of the given array - * @static - */ - static createEdgeDataProviderForInt(data:number[]):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider view of a double array defined for edges. - *

- * The double value data[edge.index()] will be returned by the data provider upon the method call getDouble(edge). - *

- * @param data array data for each edge of a static graph - * @returns a data provider view of the given array - * @static - */ - static createEdgeDataProviderForNumber(data:number[]):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider that returns the negated boolean values provided by another data provider. - * @param data - * @returns - * @static - */ - static createNegatedDataProvider(data:yfiles.algorithms.IDataProvider):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider view of an Object array defined for nodes. - *

- * The Object value data[node.index()] will be returned by the data provider upon the method call get(node). - *

- * @param data array data for each node of a static graph - * @returns a data provider view of the given array - * @static - */ - static createNodeDataProvider(data:any[]):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider view of a boolean array defined for nodes. - *

- * The boolean value data[node.index()] will be returned by the data provider upon the method call getBool(node). - *

- * @param data array data for each node of a static graph - * @returns a data provider view of the given array - * @static - */ - static createNodeDataProviderForBoolean(data:boolean[]):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider view of an int array defined for nodes. - *

- * The int value data[node.index()] will be returned by the data provider upon the method call getInt(node). - *

- * @param data array data for each node of a static graph - * @returns a data provider view of the given array - * @static - */ - static createNodeDataProviderForInt(data:number[]):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider view of a double array defined for nodes. - *

- * The double value data[node.index()] will be returned by the data provider upon the method call getDouble(node). - *

- * @param data array data for each node of a static graph - * @returns a data provider view of the given array - * @static - */ - static createNodeDataProviderForNumber(data:number[]):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider view of a double, int, boolean and Object array defined for nodes. - *

- * The double value doubleData[node.index()] will be returned by the data provider upon the method call getDouble(node). - *

- *

- * The int value intData[node.index()] will be returned by the data provider upon the method call getInt(node). - *

- *

- * The boolean value boolData[node.index()] will be returned by the data provider upon the method call getBool(node). - *

- *

- * The Object value objectData[node.index()] will be returned by the data provider upon the method call get(node). - *

- * @param doubleData double data for each node of a static graph - * @param intData int data for each node of a static graph - * @param boolData boolean data for each node of a static graph - * @param objectData Object data for each node of a static graph - * @returns a data provider view of the given arrays - * @static - */ - static createNodeDataProviderWithArrays(doubleData:number[],intData:number[],boolData:boolean[],objectData:any[]):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider for edges that return the data provider values bound to their source nodes. - * @param nodeData - * @returns - * @static - */ - static createSourceDataProvider(nodeData:yfiles.algorithms.IDataProvider):yfiles.algorithms.IDataProvider; - /** - * Returns a DataProvider for edges that return the data provider values bound to their target nodes. - * @param nodeData - * @returns - * @static - */ - static createTargetDataProvider(nodeData:yfiles.algorithms.IDataProvider):yfiles.algorithms.IDataProvider; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.DataProviders; - } - /** - * Provides functionality to hide and unhide partitions of nodes and their adjacent edges of a graph temporarily for - * algorithmic operations. - *

- * This class can be used to temporarily hide away certain elements of a graph and to unhide that parts at a later time - * again. Instances of this class keep track of graph elements that were hidden from a graph in order to make them visible - * again at a later time. - *

- *

- * Note that this class should not be used to hide elements from a Graph2D for pure hiding purposes. Since this class will - * by default prevent the graph instance from firing events, other code might cease to work correctly. Use this class for - * short term removal of nodes and edges, only. - *

- * @class - */ - export interface GraphPartitionManager extends yfiles.lang.Object{} - export class GraphPartitionManager { - /** - * Instantiates a new GraphPartitionManager for the given graph. - *

- * All non-static hiding and unhiding methods will refer to the given graph. - *

- * @param graph - * @param partitionId - */ - constructor(graph:yfiles.algorithms.Graph,partitionId:yfiles.algorithms.IDataProvider); - /** - * Assures that only nodes are visible in the graph that are associated with the given partitionId. - * @param partitionId the partitionId for the nodes that will be made visible - */ - displayPartition(partitionId:any):void; - /** - * Hides the given list of nodes from the graph. - *

- * The hidden nodes and adjacent edges will be stored so that they can be unhidden again at a later time. - *

- * @param nl - */ - hide(nl:yfiles.algorithms.NodeList):void; - /** - * Hides the given list of edges from the graph. - *

- * The hidden edges will be stored so that they can be unhidden again at a later time. - *

- * @param el - */ - hide(el:yfiles.algorithms.EdgeList):void; - /** - * Hides the given edge from the graph. - *

- * The hidden edge will be stored so that they can be unhidden again at a later time. - *

- * @param e - */ - hide(e:yfiles.algorithms.Edge):void; - /** - * Hides the given node and all it's adjacent edges from the graph. - *

- * The hidden elements will be stored so that they can be unhidden again at a later time. - *

- * @param v - */ - hide(v:yfiles.algorithms.Node):void; - /** - * Hides all nodes and edges from this graph. - *

- * The hidden elements will be stored so that they can be unhidden again at a later time. - *

- */ - hideAll():void; - /** - * Hides the given edges from the graph. - *

- * The hidden edges will be stored so that they can be unhidden again at a later time. - *

- * @param ec - */ - hideEdgeCursor(ec:yfiles.algorithms.IEdgeCursor):void; - /** - * Hides all edges from this graph. - *

- * The hidden edges will be stored so that they can be unhidden again at a later time. - *

- */ - hideEdges():void; - /** - * Hides the given elements from the graph. - *

- * The hidden nodes and adjacent edges will be stored so that they can be unhidden again at a later time. - *

- * @param cursor - */ - hideItemCursor(cursor:yfiles.algorithms.ICursor):void; - /** - * Hides multiple edges from the graph. - *

- * If there are multiple edges connecting two nodes then all but one (representative) of these edges will be hidden. The - * hidden edges will be stored so that they can be unhidden again at a later time. - *

- */ - hideMultipleEdges():void; - /** - * Hides the given nodes from the graph. - *

- * The hidden nodes and adjacent edges will be stored so that they can be unhidden again at a later time. - *

- * @param nc - */ - hideNodeCursor(nc:yfiles.algorithms.INodeCursor):void; - /** - * Hides nodes and adjacent edges that have the given partitionId associated. - * @param partitionId the id - */ - hidePartition(partitionId:any):void; - /** - * Hides all self-loop edges from this graph. - *

- * The hidden edges will be stored so that they can be unhidden again at a later time. - *

- */ - hideSelfLoops():void; - /** - * Initializes internal data structures using the new DataProvider. - *

- * This method must also be called whenever the content of the given DataProvider changes. - *

- * @param partitionId the data provider that holds the partitionIds for all elements. - */ - initPartitions(partitionId:yfiles.algorithms.IDataProvider):void; - /** - * Hides all self-loops and multiple edges from the graph. - *

- * The overall effect of this method is that the minimum number of edges are hidden from the graph such that it contains no - * self-loops and no multiple edges anymore. The hidden edges will be stored so that they can be unhidden again at a later - * time. - *

- */ - simplifyGraph():void; - /** - * This method will be called whenever the partition manager is requested to unhide the given node from the graph. - * @param v - * @protected - */ - unhide(v:yfiles.algorithms.Node):void; - /** - * This method will be called whenever the partition manager is requested to unhide the given edge from the graph. - * @param e - * @protected - */ - unhide(e:yfiles.algorithms.Edge):void; - /** - * Unhides all formerly hidden elements in the graph. - */ - unhideAll():void; - /** - * Unhides all formerly hidden edges in the graph. - */ - unhideEdges():void; - /** - * Unhides all formerly hidden nodes in the graph. - *

- * Note that this method does not unhide hidden edges. - *

- */ - unhideNodes():void; - /** - * Unhides nodes that have the given partitionId associated. - * @param partitionId the id - */ - unhidePartition(partitionId:any):void; - /** - * Gets or sets whether or not this partition manager should fire graph events. - *

- * By default the partition manager does not fire graph events. - *

- * @type {boolean} - */ - fireGraphEventsEnabled:boolean; - /** - * Gets the Graph for which this partition manager was created. - * @type {yfiles.algorithms.Graph} - */ - graph:yfiles.algorithms.Graph; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.GraphPartitionManager; - } - /** - * Provides functionality to hide and unhide nodes and edges of a graph temporarily for algorithmic operations. - *

- * This class can be used to temporarily hide away certain elements of a graph and to unhide that parts at a later time - * again. Instances of this class keep track of graph elements that were hidden from a graph in order to make them visible - * again at a later time. - *

- *

- * Note that this class should not be used to hide elements from a Graph2D for pure hiding purposes. Since this class will - * by default prevent the graph instance from firing events, other code might cease to work correctly. Use this class for - * short term removal of nodes and edges, only. - *

- * @class - */ - export interface LayoutGraphHider extends yfiles.lang.Object{} - export class LayoutGraphHider { - /** - * Instantiates a new GraphHider for the given graph. - *

- * All non-static hiding and unhiding methods will refer to the given graph. - *

- * @param g - */ - constructor(g:yfiles.algorithms.Graph); - /** - * The edges that are currently hidden - * @returns a cursor of the currently hidden edges - */ - getHiddenEdgeCursor():yfiles.algorithms.IEdgeCursor; - /** - * The nodes that are currently hidden - * @returns a cursor of the currently hidden nodes - */ - getHiddenNodeCursor():yfiles.algorithms.INodeCursor; - /** - * Hides the given list of nodes from the graph. - *

- * The hidden nodes and adjacent edges will be stored so that they can be unhidden again at a later time. - *

- * @param nl - */ - hide(nl:yfiles.algorithms.NodeList):void; - /** - * Hides the given list of edges from the graph. - *

- * The hidden edges will be stored so that they can be unhidden again at a later time. - *

- * @param el - */ - hide(el:yfiles.algorithms.EdgeList):void; - /** - * Hides the given edge from the graph. - *

- * The hidden edge will be stored so that they can be unhidden again at a later time. - *

- * @param e - */ - hide(e:yfiles.algorithms.Edge):void; - /** - * Hides the given node and all it's adjacent edges from the graph. - *

- * The hidden elements will be stored so that they can be unhidden again at a later time. - *

- * @param v - */ - hide(v:yfiles.algorithms.Node):void; - /** - * Hides all nodes and edges from this graph. - *

- * The hidden elements will be stored so that they can be unhidden again at a later time. - *

- */ - hideAll():void; - /** - * Hides the given edges from the graph. - *

- * The hidden edges will be stored so that they can be unhidden again at a later time. - *

- * @param ec - */ - hideEdgeCursor(ec:yfiles.algorithms.IEdgeCursor):void; - /** - * Hides all edges from this graph. - *

- * The hidden edges will be stored so that they can be unhidden again at a later time. - *

- */ - hideEdges():void; - /** - * Hides the given elements from the graph. - *

- * The hidden nodes and adjacent edges will be stored so that they can be unhidden again at a later time. - *

- * @param cursor - */ - hideItemCursor(cursor:yfiles.algorithms.ICursor):void; - /** - * Hides multiple edges from the graph. - *

- * If there are multiple edges connecting two nodes then all but one (representative) of these edges will be hidden. The - * hidden edges will be stored so that they can be unhidden again at a later time. - *

- */ - hideMultipleEdges():void; - /** - * Hides the given nodes from the graph. - *

- * The hidden nodes and adjacent edges will be stored so that they can be unhidden again at a later time. - *

- * @param nc - */ - hideNodeCursor(nc:yfiles.algorithms.INodeCursor):void; - /** - * Hides all self-loop edges from this graph. - *

- * The hidden edges will be stored so that they can be unhidden again at a later time. - *

- */ - hideSelfLoops():void; - /** - * Hides the subgraph induced by the given edges from the given graph. - *

- * The induced subgraph defined by the given edges consists of the given edges and all nodes that are solely connected to - * the rest of the graph by the given edges. - *

- * @param graph - * @param ec - * @static - */ - static hideSubgraph(graph:yfiles.algorithms.Graph,ec:yfiles.algorithms.IEdgeCursor):void; - /** - * Hides all self-loops and multiple edges from the graph. - *

- * The overall effect of this method is that the minimum number of edges are hidden from the graph such that it contains no - * self-loops and no multiple edges anymore. The hidden edges will be stored so that they can be unhidden again at a later - * time. - *

- */ - simplifyGraph():void; - /** - * This method will be called whenever the hider is requested to unhide the given node from the graph. - * @param v - * @protected - */ - unhide(v:yfiles.algorithms.Node):void; - /** - * This method will be called whenever the hider is requested to unhide the given edge from the graph. - * @param e - * @protected - */ - unhide(e:yfiles.algorithms.Edge):void; - /** - * Unhides all formerly hidden elements in the graph. - */ - unhideAll():void; - /** - * Unhides the given edge. - *

- * Also updates {@link yfiles.algorithms.LayoutGraphHider#hiddenEdges}. - *

- *

- * Note that unhiding an edge whose source/target is not in the graph (e.g., because it's currently hidden/removed) causes - * an exception. Hence, in such cases, you first have to unhide/reinsert the corresponding endpoints. - *

- * @param e the edge that will be unhidden - */ - unhideEdge(e:yfiles.algorithms.Edge):void; - /** - * Unhides the given edges. - *

- * Also updates {@link yfiles.algorithms.LayoutGraphHider#hiddenEdges}. - *

- *

- * Note that unhiding an edge whose source/target is not in the graph (e.g., because it's currently hidden/removed) causes - * an exception. Hence, in such cases, you first have to unhide/reinsert the corresponding endpoints. - *

- * @param edges the edges that will be unhidden - */ - unhideEdges(edges:yfiles.algorithms.EdgeList):void; - /** - * Unhides all formerly hidden edges in the graph. - */ - unhideEdges():void; - /** - * Unhides the given node and if requested its adjacent edges. - *

- * Also updates {@link yfiles.algorithms.LayoutGraphHider#hiddenNodes} and {@link yfiles.algorithms.LayoutGraphHider#hiddenEdges}. - *

- * @param v the node that will be unhidden - * @param unhideAdjacentEdges whether of not to unhide previously hidden edges connected at v whose other end point is not hidden, i.e. it is part of - * the graph. - */ - unhideNode(v:yfiles.algorithms.Node,unhideAdjacentEdges:boolean):void; - /** - * Unhides the given nodes and if requested its adjacent edges. - *

- * Also updates {@link yfiles.algorithms.LayoutGraphHider#hiddenNodes} and {@link yfiles.algorithms.LayoutGraphHider#hiddenEdges}. - *

- * @param nodes the nodes that will be unhidden - * @param unhideAdjacentEdges whether of not to unhide previously hidden edges connected at the given nodes whose other end point is not hidden, i.e. - * it is part of the graph. - */ - unhideNodes(nodes:yfiles.algorithms.NodeList,unhideAdjacentEdges:boolean):void; - /** - * Unhides all formerly hidden nodes in the graph. - *

- * Note that this method does not unhide hidden edges. - *

- */ - unhideNodes():void; - /** - * Unhides the subgraph induced by the given edges in the given graph. - *

- * The induced subgraph defined by the given edges consists of the given edges and all nodes that are either source or - * target of at least one of the given edges. - *

- *

- * Parts of the subgraph that are already contained in the given graph will not be unhidden and pose no problem to this - * method. - *

- * @param graph - * @param ec - * @static - */ - static unhideSubgraph(graph:yfiles.algorithms.Graph,ec:yfiles.algorithms.IEdgeCursor):void; - /** - * holds the list of the hidden edges in stack order - * @protected - * @type {yfiles.algorithms.EdgeList} - */ - hiddenEdges:yfiles.algorithms.EdgeList; - /** - * holds the list of the hidden nodes in stack order - * @protected - * @type {yfiles.algorithms.NodeList} - */ - hiddenNodes:yfiles.algorithms.NodeList; - /** - * Gets or sets whether or not this hider should fire graph events. - *

- * By default the hider does not fire graph events. - *

- * @type {boolean} - */ - fireGraphEvents:boolean; - /** - * Gets the Graph for which this GraphHider was created. - * @type {yfiles.algorithms.Graph} - */ - graph:yfiles.algorithms.Graph; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.LayoutGraphHider; - } - /** - * This class provides convenience and transformation services for Node- and EdgeMaps and other layout-related collection - * types. - * @class - * @static - */ - export interface Maps extends yfiles.lang.Object{} - export class Maps { - /** - * Create a DataMap view of the given map. - *

- * Accessing basic value types is solved by storing the corresponding wrapper types Double, Integer and Boolean within the - * given Map. - *

- * @param map - * @returns - * @static - */ - static createDataMap(map:yfiles.collections.IMap):yfiles.algorithms.IDataMap; - /** - * Create an EdgeMap view of the given map. - *

- * Accessing basic value types is solved by storing the corresponding wrapper types Double, Integer and Boolean within the - * given Map. - *

- * @param map - * @returns - * @static - */ - static createEdgeMap(map:yfiles.collections.IMap):yfiles.algorithms.IEdgeMap; - /** - * Creates a DataMap that is based on hashing. - *

- * The preconditions specified in java.util.HashMap apply for the keys and values of this map. - *

- * @returns - * @static - */ - static createHashedDataMap():yfiles.algorithms.IDataMap; - /** - * Creates an EdgeMap that is based on hashing. - *

- * The preconditions specified in java.util.HashMap apply for the keys and values of this map. - *

- * @returns - * @static - */ - static createHashedEdgeMap():yfiles.algorithms.IEdgeMap; - /** - * Creates a NodeMap that is based on hashing. - *

- * The preconditions specified in java.util.HashMap apply for the keys and values of this map. - *

- * @returns - * @static - */ - static createHashedNodeMap():yfiles.algorithms.INodeMap; - /** - * Factory method that creates a {@link yfiles.collections.IMap.} that is a special hash map implementation mainly used by the layout algorithms. - * Type parameter K. - * Type parameter V. - * @param [entries=null] The items to optionally populate the set with initially. - * @returns A new instance. - * @template K,V - * @static - */ - static createHashMap(entries?:yfiles.collections.ICollection>):yfiles.collections.IMap; - /** - * Factory method that creates an {@link yfiles.collections.ICollection.} implementation with set semantics that is a special hash map based implementation mainly - * used by the layout algorithms. - * Type parameter T. - * @param [items=null] The items to optionally populate the set with initially. - * @returns A new instance. - * @template T - * @static - */ - static createHashSet(items?:yfiles.collections.IEnumerable):yfiles.collections.ICollection; - /** - * Creates a resettable high performance map for values of type double. - *

- * A high performance map is a facade to another map which will allow to reset all bound values to a default value in - * constant time. - *

- * @param backingProvider - * @param backingAcceptor - * @param defaultValue - * @returns - * @static - */ - static createHighPerformanceDoubleMap(backingProvider:yfiles.algorithms.IDataProvider,backingAcceptor:yfiles.algorithms.IDataAcceptor,defaultValue:number):yfiles.algorithms.INodeMap; - /** - * Creates a resettable high performance map for values of type double. - *

- * A high performance map is a facade to another map which will allow to reset all bound values to a default value in - * constant time. - *

- * @param backingMap - * @param defaultValue - * @returns - * @static - */ - static createHighPerformanceDoubleMap(backingMap:yfiles.algorithms.IDataMap,defaultValue:number):yfiles.algorithms.INodeMap; - /** - * Creates a resettable high performance map for values of type int. - *

- * A high performance map is a facade to another map which will allow to reset all bound values to a default value in - * constant time. - *

- * @param backingProvider - * @param backingAcceptor - * @param defaultValue - * @returns - * @static - */ - static createHighPerformanceIntMap(backingProvider:yfiles.algorithms.IDataProvider,backingAcceptor:yfiles.algorithms.IDataAcceptor,defaultValue:number):yfiles.algorithms.INodeMap; - /** - * Creates a resettable high performance map for values of type int. - *

- * A high performance map is a facade to another map which will allow to reset all bound values to a default value in - * constant time. - *

- * @param backingMap - * @param defaultValue - * @returns - * @static - */ - static createHighPerformanceIntMap(backingMap:yfiles.algorithms.IDataMap,defaultValue:number):yfiles.algorithms.INodeMap; - /** - * Creates a resettable high performance map for values of type Object. - *

- * A high performance map is a facade to another map which will allow to reset all bound values to a default value in - * constant time. - *

- * @param backingProvider - * @param backingAcceptor - * @param defaultValue - * @returns - * @static - */ - static createHighPerformanceMap(backingProvider:yfiles.algorithms.IDataProvider,backingAcceptor:yfiles.algorithms.IDataAcceptor,defaultValue:any):yfiles.algorithms.INodeMap; - /** - * Creates a resettable high performance map for values of type Object. - *

- * A high performance map is a facade to another map which will allow to reset all bound values to a default value in - * constant time. - *

- * @param backingMap - * @param defaultValue - * @returns - * @static - */ - static createHighPerformanceMap(backingMap:yfiles.algorithms.IDataMap,defaultValue:any):yfiles.algorithms.INodeMap; - /** - * Returns a EdgeMap view of an Object array defined for edges. - *

- * The Object value data[edge.index()] will be accessed by the EdgeMap upon the method calls get(edge) and - * set(edge,value). - *

- *

- * Warning! The indices of the accessed edges must not change during the use of this EdgeMap. - *

- * @param data array data for each edge of a static graph - * @returns a EdgeMap view of the given array - * @static - */ - static createIndexEdgeMap(data:any[]):yfiles.algorithms.IEdgeMap; - /** - * Returns a EdgeMap view of a boolean array defined for edges. - *

- * The boolean value data[edge.index()] will be accessed by the EdgeMap upon the method calls getBool(edge) and - * setBool(edge,value). - *

- *

- * Warning! The indices of the accessed edges must not change during the use of this EdgeMap. - *

- * @param data array data for each edge of a static graph - * @returns a EdgeMap view of the given array - * @static - */ - static createIndexEdgeMapForBoolean(data:boolean[]):yfiles.algorithms.IEdgeMap; - /** - * Returns a EdgeMap view of an int array defined for edges. - *

- * The int value data[edge.index()] will be accessed by the EdgeMap upon the method calls getInt(edge) and - * setInt(edge,value). - *

- *

- * Warning! The indices of the accessed edges must not change during the use of this EdgeMap. - *

- * @param data array data for each edge of a static graph - * @returns a EdgeMap view of the given array - * @static - */ - static createIndexEdgeMapForInt(data:number[]):yfiles.algorithms.IEdgeMap; - /** - * Returns a EdgeMap view of a double array defined for edges. - *

- * The double value data[edge.index()] will be accessed by the EdgeMap upon the method calls getDouble(edge) and - * setDouble(edge,value). - *

- *

- * Warning! The indices of the accessed edges must not change during the use of this EdgeMap. - *

- * @param data array data for each edge of a static graph - * @returns a EdgeMap view of the given array - * @static - */ - static createIndexEdgeMapForNumber(data:number[]):yfiles.algorithms.IEdgeMap; - /** - * Returns a EdgeMap view of a double, int, boolean and Object array defined for edges. - *

- * The double value doubleData[edge.index()] will be accessed by the EdgeMap upon the method calls getDouble(edge) and - * setDouble(edge,value). - *

- *

- * The int value intData[edge.index()] will be accessed by the EdgeMap upon the method calls getInt(edge) and - * setInt(edge,value). - *

- *

- * The boolean value boolData[edge.index()] will be accessed by the EdgeMap upon the method calls getBool(edge) and - * setBool(edge,value). - *

- *

- * The Object value objectData[edge.index()] will be accessed by the EdgeMap upon the method calls get(edge) and - * set(edge,value). - *

- *

- * Warning! The indices of the accessed edges must not change during the use of this EdgeMap. - *

- * @param doubleData double data for each edge of a static graph - * @param intData int data for each edge of a static graph - * @param boolData boolean data for each edge of a static graph - * @param objectData Object data for each edge of a static graph - * @returns a EdgeMap view of the given arrays - * @static - */ - static createIndexEdgeMapFromArrays(doubleData:number[],intData:number[],boolData:boolean[],objectData:any[]):yfiles.algorithms.IEdgeMap; - /** - * Returns a NodeMap view of an Object array defined for nodes. - *

- * The Object value data[node.index()] will be accessed by the NodeMap upon the method calls get(node) and set(node,value). - * Warning! The indices of the accessed nodes must not change during the use of this NodeMap. - *

- * @param data array data for each node of a static graph - * @returns a NodeMap view of the given array - * @static - */ - static createIndexNodeMap(data:any[]):yfiles.algorithms.INodeMap; - /** - * Returns a NodeMap view of a boolean array defined for nodes. - *

- * The boolean value data[node.index()] will be accessed by the NodeMap upon the method calls getBool(node) and - * setBool(node,value). - *

- * @param data array data for each node of a static graph - * @returns a NodeMap view of the given array - * @static - */ - static createIndexNodeMapForBoolean(data:boolean[]):yfiles.algorithms.INodeMap; - /** - * Returns a NodeMap view of an int array defined for nodes. - *

- * The int value data[node.index()] will be accessed by the NodeMap upon the method calls getInt(node) and - * setInt(node,value). Warning! The indices of the accessed nodes must not change during the use of this NodeMap. - *

- * @param data array data for each node of a static graph - * @returns a NodeMap view of the given array - * @static - */ - static createIndexNodeMapForInt(data:number[]):yfiles.algorithms.INodeMap; - /** - * Returns a NodeMap view of a double array defined for nodes. - *

- * The double value data[node.index()] will be accessed by the NodeMap upon the method calls getDouble(node) and - * setDouble(node,value). - *

- *

- * Warning! The indices of the accessed nodes must not change during the use of this NodeMap. - *

- * @param data array data for each node of a static graph - * @returns a NodeMap view of the given array - * @static - */ - static createIndexNodeMapForNumber(data:number[]):yfiles.algorithms.INodeMap; - /** - * Returns a NodeMap view of a double, int, boolean and Object array defined for nodes. - *

- * The double value doubleData[node.index()] will be accessed by the NodeMap upon the method calls getDouble(node) and - * setDouble(node,value). - *

- *

- * The int value intData[node.index()] will be accessed by the NodeMap upon the method calls getInt(node) and - * setInt(node,value). - *

- *

- * The boolean value boolData[node.index()] will be accessed by the NodeMap upon the method calls getBool(node) and - * setBool(node,value). - *

- *

- * The Object value objectData[node.index()] will be accessed by the NodeMap upon the method calls get(node) and - * set(node,value). - *

- *

- * Warning! The indices of the accessed nodes must not change during the use of this NodeMap. - *

- * @param doubleData double data for each node of a static graph - * @param intData int data for each node of a static graph - * @param boolData boolean data for each node of a static graph - * @param objectData Object data for each node of a static graph - * @returns a NodeMap view of the given arrays - * @static - */ - static createIndexNodeMapFromArrays(doubleData:number[],intData:number[],boolData:boolean[],objectData:any[]):yfiles.algorithms.INodeMap; - /** - * Create a NodeMap view of the given map. - *

- * Accessing basic value types is solved by storing the corresponding wrapper types Double, Integer and Boolean within the - * given Map. - *

- * @param map - * @returns - * @static - */ - static createNodeMap(map:yfiles.collections.IMap):yfiles.algorithms.INodeMap; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.Maps; - } - /** - * An implementation of a doubly linked list that provides direct access to the cells that store the elements. - *

- * The cells are represented by class {@link yfiles.algorithms.ListCell}. - *

- *

- * This class supports fast access and removal operations, specifically, it is possible to remove an element in constant - * time (i.e. O(1)) given a reference to its list cell. - *

- *

- * Class YList supports iteration over the elements either by using the list cells directly (methods {@link yfiles.algorithms.YList#firstCell}/{@link yfiles.algorithms.YList#lastCell} together with - * {@link yfiles.algorithms.YList#succCell}/{@link yfiles.algorithms.YList#predCell}, respectively) or by means of a cursor - * ({@link yfiles.algorithms.YList#cursor}). - *

- *

- * Furthermore, YList offers its own {@link yfiles.algorithms.YList#sort} method. Note that this class also provides all relevant - * methods to use the list like a stack data type. - *

- *

- * This implementation permits null as values. It implements the {@link yfiles.collections.IList.} interface but does not support the {@link yfiles.algorithms.YList#subList} - * method. The implementation of this method will throw an {@link yfiles.lang.Exception} if invoked. The {@link yfiles.algorithms.YList#cursor} - * returned by instances of this class is not fail fast. - *

- * @class - * @implements {yfiles.collections.IList.} - */ - export interface YList extends yfiles.lang.Object,yfiles.collections.IList{} - export class YList { - /** - * Creates a list that is initialized with the elements provided by the given array of objects. - * @param a - */ - constructor(a:any[]); - /** - * Creates a list that is initialized with those elements from the given YCursor object for which the given data provider - * returns true upon calling its {@link yfiles.algorithms.IDataProvider#getBoolean getBool} method. - * @param c A cursor providing objects that should be added to this list. - * @param predicate A data provider that acts as a inclusion predicate for each object accessible by the given cursor. - */ - constructor(c:yfiles.algorithms.ICursor,predicate:yfiles.algorithms.IDataProvider); - /** - * Creates a list that is initialized with the elements provided by the given Collection object. - * @param c - */ - constructor(c:yfiles.collections.IEnumerable); - /** - * Creates a list that is initialized with the elements provided by the given YCursor object. - * @param c - */ - constructor(c:yfiles.algorithms.ICursor); - /** - * Creates an empty doubly linked list. - */ - constructor(); - /** - * Appends all elements provided by the given cursor to this list. - *

- * The cursor will be moved from its given position to the end. - *

- *

- * Be aware that a statement like aList.append(aList.cursor()) results in an infinite recursion. - *

- * @param c - */ - addAll(c:yfiles.algorithms.ICursor):void; - /** - * Appends all elements provided by the given collection to this list. - * @param collection - * @returns Whether there have been elements appended. - */ - addAll(collection:yfiles.collections.ICollection):boolean; - /** - * - * @param index - * @param c - * @returns - */ - addAll(index:number,c:yfiles.collections.ICollection):boolean; - /** - * Inserts the given object at the head of this list. - * @param o - * @returns The newly created ListCell object that stores the given object. - */ - addFirst(o:any):yfiles.algorithms.ListCell; - /** - * Adds a formerly removed ListCell object at the head of this list. - *

- * Attention: If the ListCell object is still part of any list, then that list will be corrupted afterwards. - *

- * @param cell A list cell which is not part of any list. - */ - addFirstCell(cell:yfiles.algorithms.ListCell):void; - /** - * Inserts the given object at the tail of this list. - * @param o - * @returns The newly created ListCell object that stores the given object. - */ - addLast(o:any):yfiles.algorithms.ListCell; - /** - * Adds a formerly removed ListCell object at the tail of this list. - *

- * Attention: If the ListCell object is still part of any list, then that list will be corrupted afterwards. - *

- * @param cell A list cell which is not part of any list. - */ - addLastCell(cell:yfiles.algorithms.ListCell):void; - /** - * Removes all elements from this list. - */ - clear():void; - /** - * Whether or not this list contains all the elements in the given collection. - *

- * Equality of elements is defined by the {@link any#equals} method. - *

- * @param collection - * @returns - */ - containsAll(collection:yfiles.collections.ICollection):boolean; - /** - * Copies the elements of this collection to an array, starting at the specified array index. - * @param array The one-dimensional array that is the destination of the elements copied from this collection. - * @param arrayIndex The zero-based index in array at which copying begins. - */ - copyTo(array:any[],arrayIndex:number):void; - /** - * Returns a cursor for this list. - *

- * All cursor operations are supported. This cursor implementation is not fail-fast and continues to work if this list is - * modified during the traversal as long as the current ListCell the cursor points at is this in this list or has been - * removed from this list but has not been added to another instance since then. - *

- * @returns - */ - cursor():yfiles.algorithms.ICursor; - /** - * Returns the cyclic predecessor cell of the given list cell. - *

- * The last cell is returned as the cyclic predecessor of the first list cell. - *

- * @param c - * @returns - */ - cyclicPred(c:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell; - /** - * Returns the cyclic successor cell of the given list cell. - *

- * The first cell is returned as the cyclic successor of the last list cell. - *

- * @param c - * @returns - */ - cyclicSucc(c:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell; - /** - * Returns the i-th element of this list. - * @param i - * @returns - */ - elementAt(i:number):any; - /** - * Returns the {@link yfiles.algorithms.ListCell} where object o is stored. - *

- * This operation returns null, if no such cell exists. Equality of elements is defined by the {@link any#equals} method. The first - * element in the list that matches that criteria is returned. - *

- * @param o - * @returns the ListCell that contains the element or null if no such ListCell was found - */ - findCell(o:any):yfiles.algorithms.ListCell; - /** - * Gets the element at the specified index. - * @param index The zero-based index of the element to get or set. - * @returns The element at the specified index. - * @see yfiles.algorithms.YList#set - */ - get(index:number):any; - /** - * Gets the cell at the given index. - * @param index the zero-based index of the cell in this list. - * @returns The cell. - * @throws {Stubs.Exceptions.IndexOutOfRangeError} if the index is negative or greater or equal than the {@link yfiles.algorithms.YList#size} - */ - getCell(index:number):yfiles.algorithms.ListCell; - /** - * Returns an enumerator that iterates through this collection. - * @returns An {@link } that can be used to iterate through this collection. - */ - getEnumerator():yfiles.collections.IEnumerator; - /** - * Returns the element stored in the given list cell. - * @param c - * @returns - */ - getInfo(c:yfiles.algorithms.ListCell):any; - /** - * Whether or not this list contains the given element. - *

- * Equality of elements is defined by the {@link any#equals} method. - *

- * @param o - * @returns - */ - includes(o:any):boolean; - /** - * Returns the zero-based index of the given element in this list. - *

- * If the given element is not in the list, -1 is returned. - *

- * @param obj - * @returns - */ - indexOf(obj:any):number; - /** - * - * @param index - * @param element - */ - insert(index:number,element:any):void; - /** - * Inserts the given object into this list with respect to a given reference list cell. - *

- * The (newly created) list cell that stores the object is inserted right after the reference list cell refCell. - *

- *

- * If refCell == null, the given object is inserted at the head of the list. - *

- * @param o The object to be inserted. - * @param refCell The list cell used to reference the position. - * @returns The newly created ListCell object that stores object o. - */ - insertAfter(o:any,refCell:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell; - /** - * Inserts the given object into this list with respect to a given reference list cell. - *

- * The (newly created) list cell that stores the object is inserted right before the reference list cell refCell. - *

- *

- * If refCell == null, the given object is appended to the list. - *

- * @param o The object to be inserted. - * @param refCell The list cell used to reference the position. - * @returns The newly created ListCell object that stores object o. - */ - insertBefore(o:any,refCell:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell; - /** - * Inserts a formerly removed ListCell object into this list with respect to a given reference list cell. - *

- * The ListCell object is inserted right after the reference list cell refCell. - *

- *

- * Attention: If the ListCell object is still part of any list, then that list will be corrupted afterwards. - *

- * @param cellToInsert A list cell which is not part of any list. - * @param refCell The list cell used to reference the position. - */ - insertCellAfter(cellToInsert:yfiles.algorithms.ListCell,refCell:yfiles.algorithms.ListCell):void; - /** - * Inserts a formerly removed ListCell object into this list with respect to a given reference list cell. - *

- * The ListCell object is inserted right before the reference list cell refCell. - *

- *

- * Attention: If the ListCell object is still part of any list, then that list will be corrupted afterwards. - *

- * @param cellToInsert A list cell which is not part of any list. - * @param refCell The list cell used to reference the position. - */ - insertCellBefore(cellToInsert:yfiles.algorithms.ListCell,refCell:yfiles.algorithms.ListCell):void; - /** - * Checks whether this list contains elements. - * @returns - */ - isEmpty():boolean; - /** - * - * @param o - * @returns - */ - lastIndexOf(o:any):number; - /** - * Equivalent to {@link yfiles.algorithms.YList#firstObject}. - * @returns - */ - peek():any; - /** - * Removes the first element from this list and returns it. - * @returns - */ - pop():any; - /** - * Removes the last element from this list and returns it. - * @returns - */ - popLast():any; - /** - * Returns the predecessor cell of the given list cell. - * @param c - * @returns - */ - predCell(c:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell; - /** - * Equivalent to {@link yfiles.algorithms.YList#addFirst}. - * @param o - * @returns - */ - push(o:any):yfiles.algorithms.ListCell; - /** - * Removes the given object from this list. - *

- * Only the first element for which equality to o holds gets removed. - *

- * @param o - * @returns - */ - remove(o:any):boolean; - /** - * Removes the given collection of objects from this list. - * @param collection - * @returns Whether there have been elements removed. - */ - removeAll(collection:yfiles.collections.ICollection):boolean; - /** - * - * @param index - */ - removeAt(index:number):void; - /** - * Removes the element pointed to by the given YCursor object. - * @param c - * @returns The removed element. - */ - removeAtCursor(c:yfiles.algorithms.ICursor):any; - /** - * Removes the given list cell, and hence the element stored in it, from this list. - * @param c - * @returns The element that is stored in the removed cell. - */ - removeCell(c:yfiles.algorithms.ListCell):any; - /** - * Retains only those elements in this list which are contained in the given collection. - * @param collection - * @returns Whether there have been elements removed. - */ - retainAll(collection:yfiles.collections.ICollection):boolean; - /** - * Reverses the sequence of elements in this list. - */ - reverse():void; - /** - * Sets the element at the specified index. - * @param index The zero-based index of the element to get or set. - * @param value The element at the specified index. - * @see yfiles.algorithms.YList#get - */ - set(index:number,value:any):void; - /** - * Updates the element stored in the given list cell with the given object. - * @param c - * @param value - */ - setInfo(c:yfiles.algorithms.ListCell,value:any):void; - /** - * Sorts the elements in this list according to the given comparator. - *

- * NOTE: The elements will be assigned to different list cells by this method. - *

- * @param comparer - */ - sort(comparer:yfiles.collections.IComparer):void; - /** - * Sorts the elements in this list into ascending order, according to their natural ordering. - *

- * All elements must implement the {@link yfiles.lang.IComparable} interface. Furthermore, all elements in this list must be - * mutually comparable (that is, e1.compareTo(e2) must not throw a ClassCastException for any elements e1 and e2 in this - * list). - *

- *

- * NOTE: The elements will be assigned to different list cells by this method. - *

- */ - sort():void; - /** - * Transfers the contents of the given list to the end of this list. - *

- * The given list will be empty after this operation. - *

- *

- * Note that this operation transfers the list cells of the given list to this list. No new list cells are created by this - * operation. - *

- * @param list - */ - splice(list:yfiles.algorithms.YList):void; - /** - * - * @param fromIndex - * @param toIndex - * @returns - */ - subList(fromIndex:number,toIndex:number):yfiles.collections.IList; - /** - * Returns the successor cell of the given list cell. - * @param c - * @returns - */ - succCell(c:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell; - /** - * Returns an array representation of this list. - * @returns - */ - toArray():any[]; - /** - * Gets the number of elements in this list. - * @type {number} - */ - size:number; - /** - * Gets the first element of this list. - * @type {any} - */ - firstObject:any; - /** - * Gets the last element of this list. - * @type {any} - */ - lastObject:any; - /** - * Gets the first cell of this list. - * @type {yfiles.algorithms.ListCell} - */ - firstCell:yfiles.algorithms.ListCell; - /** - * Gets the last cell of this list. - * @type {yfiles.algorithms.ListCell} - */ - lastCell:yfiles.algorithms.ListCell; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.algorithms.YList; - } - }export namespace layout{ - /** - * {@link yfiles.layout.BendConverter} replaces edge bends with dummy nodes for the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm}. - *

- * Concept Replacing the bends works in three steps: - *

- *
    - *
  1. Replacing the bends and the edge segments between them with dummy nodes and edges
  2. - *
  3. Invoking the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm} on the altered graph
  4. - *
  5. Recreating the bends and removing all dummy elements
  6. - *
- *

- * When the dummy elements have been inserted, edge information about {@link yfiles.layout.BendConverter#adoptPortConstraints port constraints}, {@link yfiles.layout.BendConverter#adoptEdgeGroups edge groups} and {@link yfiles.layout.BendConverter#adoptAffectedEdges selection state} can - * be adopted from the original edges. That way, the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm} can access the mentioned information. - *

- * @class - * @implements {yfiles.layout.ILayoutStage} - */ - export interface BendConverter extends yfiles.lang.Object,yfiles.layout.ILayoutStage{} - export class BendConverter { - /** - * Creates a new {@link yfiles.layout.BendConverter} instance with the given size as the width and height for the dummy nodes. - * @param size the size for the dummy nodes - * @throws {Stubs.Exceptions.ArgumentError} if the given size is negative - */ - constructor(size:number); - /** - * Creates a new instance of {@link yfiles.layout.BendConverter} with the given {@link yfiles.layout.BendConverter#coreLayout core layout algorithm}. - * @param core the core layout algorithm - */ - constructor(core:yfiles.layout.ILayoutAlgorithm); - /** - * Creates a new {@link yfiles.layout.BendConverter} instance with default settings. - */ - constructor(); - /** - * Adds information to newly created dummy nodes. - *

- * This is a callback method that will be invoked after new elements for the given edge have been added to the given graph - * by {@link yfiles.layout.BendConverter#prepare}. At this point, the original edge is still in the graph. - *

- *

- * The current implementation does nothing. - *

- * @param graph the input graph - * @param edge the edge whose bends were replaced by the given dummy nodes - * @param dummyNodes the dummy nodes representing the bends of the edge - * @protected - */ - addedPathForEdge(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge,dummyNodes:yfiles.algorithms.NodeList):void; - /** - * Replaces all bends in the current {@link yfiles.layout.BendConverter#DEFAULT_AFFECTED_EDGES_DP_KEY scope} with dummy nodes before invoking the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm}. - *

- * After the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm} has finished, the edges between the dummy nodes are reconnected and the dummy nodes are - * replaced by bends again. - *

- * @param graph the input graph - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Prepares the graph before calling the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm}. - *

- * The bends of the edges belonging to the current scope are replaced by dummy nodes and the segments between those dummy - * nodes are replaced by dummy edges. - *

- *

- * Edge-specific information like {@link yfiles.layout.PortConstraint}s, edge groups or selection state can be applied to the dummy - * edges to keep this information for the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm}. - *

- *

- * This method is called by {@link yfiles.layout.BendConverter#applyLayout} before invoking the - * {@link yfiles.layout.BendConverter#coreLayout core layout algorithm}. It may be overridden to extend the edge-specific information that should be adopted by the dummy - * edges. - *

- * @param graph the input graph - * @see yfiles.layout.BendConverter#restore - * @see yfiles.layout.BendConverter#adoptAffectedEdges - * @see yfiles.layout.BendConverter#adoptPortConstraints - * @see yfiles.layout.BendConverter#adoptEdgeGroups - * @protected - */ - prepare(graph:yfiles.layout.LayoutGraph):void; - /** - * Restores the structure of the graph after the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm} has finished. - *

- * This method is called by {@link yfiles.layout.BendConverter#applyLayout} after invoking the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm}. It may be - * overridden to clean up all additional information added in {@link yfiles.layout.BendConverter#prepare}. - *

- * @param graph the graph arranged by the {@link #coreLayout core layout algorithm} - * @see yfiles.layout.BendConverter#prepare - * @see yfiles.layout.BendConverter#adoptAffectedEdges - * @see yfiles.layout.BendConverter#adoptPortConstraints - * @see yfiles.layout.BendConverter#adoptEdgeGroups - * @protected - */ - restore(graph:yfiles.layout.LayoutGraph):void; - /** - * Data provider key for specifying the set of edges for which this stage will replace bends - *

- * Only the bends of the marked edges will be replaced with dummy nodes. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static DEFAULT_AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets the core layout algorithm that is wrapped by this {@link yfiles.layout.ILayoutStage}. - * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets whether or not edge grouping information of the original edge should be adopted by its replacement edges. - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @type {boolean} - */ - adoptEdgeGroups:boolean; - /** - * Gets or sets whether or not the associated - * {@link yfiles.layout.PortConstraint}s of the original edge should be adopted by its replacement edges. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {boolean} - */ - adoptPortConstraints:boolean; - /** - * Gets or sets whether or not the selection state of the original edge should be adopted by its replacement edges. - *

- * The selection state is looked up in a {@link yfiles.algorithms.IDataProvider} registered with the key returned by {@link yfiles.layout.BendConverter#affectedEdgesDpKey}. - *

- * @see yfiles.layout.BendConverter#affectedEdgesDpKey - * @type {boolean} - */ - adoptAffectedEdges:boolean; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} which identifies edges as selected. - *

- * If {@link yfiles.layout.BendConverter#adoptAffectedEdges the selection is conserved}, the selection state described by the {@link yfiles.algorithms.IDataProvider} registered with this - * key is applied to the according dummy edges. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @see yfiles.layout.BendConverter#adoptAffectedEdges - * @type {any} - */ - affectedEdgesDpKey:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.BendConverter; - } - /** - * A {@link yfiles.layout.BufferedLayout} is a hull algorithm that invokes its {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} on a copy of the input graph. - *

- * After the layout process has finished, the calculated layout will be written back to the original graph. - *

- *

- * This class also provides the possibility to perform arbitrary layout algorithms merely on a graph interface plus - * associated graph layout. This comes in handy if an application has its own graph and only provides a graph interface - * adapter to the yFiles graph layout machinery. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface BufferedLayout extends yfiles.layout.LayoutStageBase{} - export class BufferedLayout { - /** - * Creates a new {@link yfiles.layout.BufferedLayout} instance using the given {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] the core layout routine - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.BufferedLayout; - } - /** - * A {@link yfiles.layout.ComponentLayout} arranges the connected components of a graph. - *

- * Layout Style The components can be arranged using different {@link yfiles.layout.ComponentLayout#style styles}. All styles except {@link yfiles.layout.ComponentArrangementStyles#NONE} - * place the components without overlaps. {@graph {"ann":{"s":[30,30],"d":1},"n":[[552,150],[477,75],[75,150],[150,375],[150,225],[150,300],[351,150],[150,75],[0,150],[552,75],[477,0],[426,75],[351,225],[552,225],[150,150],[351,0],[276,75],[351,75],[75,300],[426,150],[225,150],[75,75],[225,300],[150,0],[477,351],[477,276],[553,351],[553,276],[150,450],[327,402],[276,402],[378,402],[429,402]],"e":[[0,1,-15,0,0,15,[492,165]],[3,5,0,-15,0,15],[5,4,0,-15,0,15],[8,2,15,0,-15,0],[0,9,0,-15,0,15],[9,1,-15,0,15,0],[1,10,0,-15,0,15],[12,6,0,-15,0,15],[0,13,0,15,0,-15],[4,14,0,-15,0,15],[14,2,-15,0,15,0],[14,7,0,-15,0,15],[16,15,0,-15,-15,0,[291,15]],[15,17,0,15,0,-15],[17,11,15,0,-15,0],[17,6,0,15,0,-15],[17,16,-15,0,15,0],[18,5,15,0,-15,0],[6,19,15,0,-15,0],[19,11,0,-15,0,15],[20,14,-15,0,15,0],[2,21,0,-15,0,15],[22,5,-15,0,15,0],[22,20,0,-15,0,15],[23,7,0,15,0,-15],[24,25,0,-15,0,15],[24,26],[26,27,0,-15,0,15],[25,27],[3,28,0,15,0,-15],[30,29],[31,32]],"vp":[0.0,0.0,583.0,480.0]}} - *

- *

- * Layout with orthogonal components using {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS_COMPACT} - *

- *

- * Concept - *

- *

- * {@link yfiles.layout.ComponentLayout} is a {@link yfiles.layout.ILayoutStage} that can wrap another {@link yfiles.layout.ILayoutAlgorithm layout algorithm}. That way, it - * allows handling disconnected graphs for the wrapped {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- *

- * The following steps outline the concept of {@link yfiles.layout.ComponentLayout}: - *

- *
    - *
  1. Determine the connected components of the graph
  2. - *
  3. Hide all graph components
  4. - *
  5. Apply the following steps to each component separately
  6. - *
  7. Unhide all graph components
  8. - *
  9. {@link yfiles.layout.ComponentLayout#componentArrangement Optionally arrange} the components
  10. - *
- *

- * Features - *

- *

- * To arrange the subgraphs of the components, {@link yfiles.layout.ComponentLayout} uses the specified {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. If - * there is no {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} specified, it will keep the locations in the subgraph and arrange the components as - * they are. - *

- *

- * Hierarchically grouped graphs are handled in a special way. The contents of a group node will always belong to the same - * component as the group node itself. To change that behavior {@link yfiles.layout.ComponentLayout#considerGrouping grouping} can be disabled. - *

- *

- * By default, the components consist of the connected nodes in a graph. To choose custom subgraphs to form components, - * register a {@link yfiles.algorithms.IDataProvider} with {@link yfiles.layout.ComponentLayout#COMPONENT_ID_DP_KEY} and assign component - * IDs to the nodes. - *

- * @see yfiles.layout.MultiStageLayout - * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface ComponentLayout extends yfiles.layout.LayoutStageBase{} - export class ComponentLayout { - /** - * Creates a new {@link yfiles.layout.ComponentLayout} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algortihm. - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Produces a component graph layout. - *

- * This method is called by {@link yfiles.layout.ComponentLayout#applyLayout} in case {@link yfiles.layout.ComponentLayout#componentArrangement component arrangement} is enabled. It moves - * the graph's components such that their bounding boxes do not overlap. Subclasses may want to override this method to - * introduce custom component arrangement styles. - *

- * @param graph the input graph - * @param nodes the nodes of the components; the i-th list contains the nodes of the i-th component - * @param edges the edges of the components; the i-th list contains the edges of the i-th component - * @param bbox the bounds of the components; the i-th rectangle describes the bounding box of the i-th component - * @param boxes the extended bounds of the components; the i-th rectangle describes the bounding box of the i-th component extended by - * the spacing between components. The method arranges these boxes in such a way that they do not overlap. Then, the i-th - * graph component must be placed inside the i-th box - * @see yfiles.layout.ComponentLayout#arrangeFields - * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleRows - * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleMultiRows - * @protected - */ - arrangeComponents(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.NodeList[],edges:yfiles.algorithms.EdgeList[],bbox:yfiles.algorithms.YRectangle[],boxes:yfiles.algorithms.Rectangle2D[]):void; - /** - * Arranges the bounding boxes of the components. - *

- * This method is called by {@link yfiles.layout.ComponentLayout#arrangeComponents} if the {@link yfiles.layout.ComponentLayout#style style} is set to - * {@link yfiles.layout.ComponentArrangementStyles#PACKED_RECTANGLE}, - * {@link yfiles.layout.ComponentArrangementStyles#PACKED_COMPACT_RECTANGLE}, {@link yfiles.layout.ComponentArrangementStyles#PACKED_CIRCLE} - * or - * {@link yfiles.layout.ComponentArrangementStyles#PACKED_COMPACT_CIRCLE}. It may be overridden to adjust the component arrangement - * strategy of the mentioned styles. - *

- * @param graph the input graph - * @param nodes the nodes of the components; the i-th list contains the nodes of the i-th component - * @param edges the edges of the components; the i-th list contains the edges of the i-th component - * @param bbox the bounds of the components; the i-th rectangle describes the bounding box of the i-th component - * @param boxes the extended bounds of the components; the i-th rectangle describes the bounding box of the i-th component - * @param circular true if the arrangement should be circular, false if it should be rectangular - * @param fill true if it is allowed to place components in empty spaces inside other - * components, false otherwise - * @param fromSketch true if the initial coordinates should be considered, false otherwise - * @protected - */ - arrangeFields(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.NodeList[],edges:yfiles.algorithms.EdgeList[],bbox:yfiles.algorithms.YRectangle[],boxes:yfiles.algorithms.Rectangle2D[],circular:boolean,fill:boolean,fromSketch:boolean):void; - /** - * Calculates the bounding box of a graph component including {@link yfiles.layout.NodeHalo}s. - *

- * This method will be invoked for each component of the graph. Depending on the state of property - * {@link yfiles.layout.ComponentLayout#considerLabels}, the returned bounding box will also include node and edge labels. It may be overridden to extend the bounds to reserve - * space for other elements. - *

- * @param graph the subgraph containing the nodes and edges of a component - * @returns the bounding box of the component - * @see yfiles.layout.ComponentLayout#considerLabels - * @protected - */ - calculateBounds(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.Rectangle2D; - /** - * Determines which nodes belong to the same graph component. - *

- * This implementation uses the graph connectivity to sort the nodes into different components. Nodes that are not - * connected by a path will be in separate components. - *

- *

- * This method is called by {@link yfiles.layout.ComponentLayout#applyLayout}. It may be overridden to choose another approach to - * find components that will be passed to the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. However, most of the layout algorithms cannot handle disconnected graphs. Also, edges between - * custom components will be ignored. - *

- * @param graph the input graph - * @param compNumber a map that will be filled with the zero-based index of the component to which the node belongs - * @returns the number of connected components of this graph - * @see yfiles.algorithms.GraphConnectivity#connectedComponents - * @protected - */ - findGraphComponents(graph:yfiles.layout.LayoutGraph,compNumber:yfiles.algorithms.INodeMap):number; - /** - * Moves the subgraph containing the given nodes and edges to the specified origin. - *

- * This method is called by {@link yfiles.layout.ComponentLayout#arrangeComponents} and {@link yfiles.layout.ComponentLayout#arrangeFields} - * to move the components to overlap-free positions. - *

- * @param graph the input graph - * @param nodes the nodes in the moving subgraph - * @param edges the edges in the moving subgraph - * @param origin the new origin of the graph - * @param rectangle the current bounds of the subgraph - * @protected - */ - setOrigin(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.NodeList,edges:yfiles.algorithms.EdgeList,origin:yfiles.algorithms.YPoint,rectangle:yfiles.algorithms.YRectangle):void; - /** - * Data provider key for specifying which nodes should be arranged - *

- * If no {@link yfiles.algorithms.IDataProvider} is registered with this key, all components will be laid out by the core layout - * algorithm. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static AFFECTED_COMPONENTS_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for specifying custom graph components - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static COMPONENT_ID_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets the preferred size of the layout. - *

- * The layout size also defines the desired aspect ratio (width/height). - *

- *

- * The width and height need to be greater than zero. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified width or height is negative or zero. - * @type {yfiles.algorithms.YDimension} - */ - preferredSize:yfiles.algorithms.YDimension; - /** - * Gets or sets whether or not to take node and edge labels into account when calculating the bounding box of the graph - * components. - * @see yfiles.layout.ComponentLayout#calculateBounds - * @type {boolean} - */ - considerLabels:boolean; - /** - * Gets or sets whether or not the separately arranged components of the input graph should be arranged relative to each - * other. - *

- * If enabled, the components are arranged using a specific {@link yfiles.layout.ComponentLayout#style style} without producing overlaps between components (except for - * {@link yfiles.layout.ComponentArrangementStyles#NONE}). Otherwise, the layout algorithm will keep the components at their - * location. Then, the components may overlap. - *

- * @type {boolean} - */ - componentArrangement:boolean; - /** - * Gets or sets the current grid spacing. - *

- * Components will be moved by multiples of this value, thus keeping their offset to the grid. That way, components or - * parts of them that were placed on a grid before, will stay on their original grid. The grid spacing also influences the - * distance between the components. - *

- *

- * The spacing needs to be a non-negative value. If the grid spacing is set to 0, the grid won't be considered at all. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given spacing is negative - * @type {number} - */ - gridSpacing:number; - /** - * Gets or sets the distance between the bounding boxes of the components. - *

- * The spacing needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the spacing is negative - * @type {number} - */ - componentSpacing:number; - /** - * Gets or sets whether or not grouping information bound to the graph should be considered when determining the graph - * components. - * @type {boolean} - */ - considerGrouping:boolean; - /** - * Gets or sets how the components are arranged. - * @throws {Stubs.Exceptions.ArgumentError} if the specified style is unknown - * @type {yfiles.layout.ComponentArrangementStyles} - */ - style:yfiles.layout.ComponentArrangementStyles; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ComponentLayout; - } - /** - * {@link yfiles.layout.CompositeLayoutStage} allows for combining multiple {@link yfiles.layout.ILayoutStage}s. - *

- * The {@link yfiles.layout.ILayoutStage}s are organized in a pipeline where additional {@link yfiles.layout.ILayoutStage}s can be {@link yfiles.layout.CompositeLayoutStage#prependStage prepended} - * or {@link yfiles.layout.CompositeLayoutStage#appendStage appended}. - *

- *

- * Each {@link yfiles.layout.ILayoutStage} in the pipeline executes its pre-processing code before calling its successor - * {@link yfiles.layout.ILayoutStage}. Then, after all subsequent - * {@link yfiles.layout.ILayoutStage}s have finished, it will execute its post-processing code. - *

- *

- * Note that the pipeline only works when all {@link yfiles.layout.ILayoutStage}s call their core layout algorithm which is the - * next {@link yfiles.layout.ILayoutStage} in the pipeline. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface CompositeLayoutStage extends yfiles.layout.LayoutStageBase{} - export class CompositeLayoutStage { - /** - * Creates a new {@link yfiles.layout.CompositeLayoutStage} instance with two {@link yfiles.layout.ILayoutStage}s in the pipeline. - *

- * The inner {@link yfiles.layout.ILayoutStage} will be wrapped by the outer {@link yfiles.layout.ILayoutStage}. - *

- * @param outerStage the wrapping {@link } - * @param innerStage the wrapped {@link } - */ - constructor(outerStage:yfiles.layout.ILayoutStage,innerStage:yfiles.layout.ILayoutStage); - /** - * Creates a new {@link yfiles.layout.CompositeLayoutStage} instance with an empty pipeline. - */ - constructor(); - /** - * Appends a {@link yfiles.layout.ILayoutStage} to the previously added {@link yfiles.layout.ILayoutStage}s. - *

- * The added {@link yfiles.layout.ILayoutStage} will be invoked just before the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} will be invoked. Its - * pre-processing code will be executed after the already added {@link yfiles.layout.ILayoutStage}s' pre-processing code, while its - * post-processing code will be executed before the post-processing code of all the other {@link yfiles.layout.ILayoutStage}s. - *

- * @param stage the stage to append - */ - appendStage(stage:yfiles.layout.ILayoutStage):void; - /** - * Prepends a {@link yfiles.layout.ILayoutStage} to the previously added {@link yfiles.layout.ILayoutStage}s. - *

- * The added {@link yfiles.layout.ILayoutStage} will be invoked before any other {@link yfiles.layout.ILayoutStage}. Its pre-processing - * code will be executed before the already added {@link yfiles.layout.ILayoutStage}s' pre-processing code, while its - * post-processing code will be executed after the post-processing code of all the other {@link yfiles.layout.ILayoutStage}s. - *

- * @param stage the stage to prepend - */ - prependStage(stage:yfiles.layout.ILayoutStage):void; - /** - * Gets the complete pipeline of {@link yfiles.layout.ILayoutStage}s that were added to this {@link yfiles.layout.CompositeLayoutStage}. - * @type {yfiles.collections.IList.} - */ - layoutStages:yfiles.collections.IList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.CompositeLayoutStage; - } - /** - * A {@link yfiles.layout.CopiedLayoutGraph} is a {@link yfiles.layout.LayoutGraph} that serves as a copy of another graph with layout information. - *

- * A {@link yfiles.layout.CopiedLayoutGraph} comes to use if a {@link yfiles.layout.ILayoutAlgorithm layout algorithm} should not run directly on the original graph. - * Using a copy, the calculated layout will not be applied to the original graph before the layout algorithm finished - * successfully. This can prevent inconsistencies in case something goes wrong during layout calculations. - *

- *

- * Concept {@link yfiles.layout.CopiedLayoutGraph} contains corresponding nodes and edges for each node and edge in the original graph and - * copies the labels of the original nodes and edges. It also delegates all - * {@link yfiles.algorithms.IDataProvider}s registered with the original graph. - *

- *

- * To preserve the relations between the original elements and the copied elements in this graph, {@link yfiles.layout.CopiedLayoutGraph} - * updates mappings between those elements. - *

- *

- * If there are structural changes to the original graph, they can be transferred to this copied graph using - * {@link yfiles.layout.CopiedLayoutGraph#syncStructure}. Then the copied graph will be altered, adding and removing elements, - * until it corresponds to the original again. - *

- *

- * Method {@link yfiles.layout.CopiedLayoutGraph#commitLayoutToOriginalGraph} will transfer updated layout information to the - * original graph. The original graph will stay unchanged until this method is called. - *

- * @see yfiles.layout.BufferedLayout - * @class - * @extends {yfiles.layout.LayoutGraph} - */ - export interface CopiedLayoutGraph extends yfiles.layout.LayoutGraph{} - export class CopiedLayoutGraph { - /** - * Creates a new {@link yfiles.layout.CopiedLayoutGraph} instance which is a copy of the given graph. - * @param graph the original graph - */ - constructor(graph:yfiles.layout.LayoutGraph); - /** - * Writes the current layout information of all elements of this copied graph to the original graph. - */ - commitLayoutToOriginalGraph():void; - /** - * Creates an edge in the copied graph that corresponds to the given original edge. - *

- * The edge will connect to the copies of the source and target of the original edge. All labels of the original edge will - * be also copied and assigned to this edge. - *

- *

- * The mappings are updated. Hence, it is possible to look up the newly created edge by using {@link yfiles.layout.CopiedLayoutGraph#getCopiedEdge} - * or the original edge by using {@link yfiles.layout.CopiedLayoutGraph#getOriginalEdge}. - *

- *

- * This method can be used for keeping the {@link yfiles.layout.CopiedLayoutGraph} in sync with the original graph. - *

- * @param originalEdge the original edge - * @returns the copy of the original edge - */ - createCopiedEdge(originalEdge:any):yfiles.algorithms.Edge; - /** - * Creates a node in the copied graph that corresponds to the given original node. - *

- * All labels of the original node will be copied and assigned to this node. - *

- *

- * The mappings are updated. Hence, it is possible to look up the newly created node by using {@link yfiles.layout.CopiedLayoutGraph#getCopiedNode} - * or the original node by using {@link yfiles.layout.CopiedLayoutGraph#getOriginalNode}. - *

- *

- * This method can be used for keeping the {@link yfiles.layout.CopiedLayoutGraph} in sync with the original graph. - *

- * @param originalNode the original node - * @returns the copy of the original node - */ - createCopiedNode(originalNode:any):yfiles.algorithms.Node; - /** - * Returns the copied edge that corresponds to the given original edge. - * @param originalEdge an edge of the original graph whose copy resides in this graph - * @returns an edge in this graph that is the copy of the given original edge - */ - getCopiedEdge(originalEdge:any):yfiles.algorithms.Edge; - /** - * Returns the copied node that corresponds to the given original node. - * @param originalNode a node of the original graph whose copy resides in this graph - * @returns a node in this graph that is the copy of the given original node - */ - getCopiedNode(originalNode:any):yfiles.algorithms.Node; - /** - * Returns the original edge that corresponds to the given copied edge. - * @param copiedEdge the edge in this graph that is a copy of the returned edge - * @returns the edge in the original graph whose copy is the given edge - */ - getOriginalEdge(copiedEdge:yfiles.algorithms.Edge):any; - /** - * Returns the original node that corresponds to the given copied node. - * @param copiedNode the node in this graph that is a copy of the returned node - * @returns the node in the original graph whose copy is the given node - */ - getOriginalNode(copiedNode:yfiles.algorithms.Node):any; - /** - * Synchronizes the structure of the {@link yfiles.layout.CopiedLayoutGraph} with the actual structure of the underlying original - * graph. - */ - syncStructure():void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.CopiedLayoutGraph; - } - /** - * {@link yfiles.layout.CurveFittingLayoutStage} fits a piecewise cubic bezier curve to given arbitrary edge paths. - *

- * Concept - *

- *

- * The {@link yfiles.layout.LayoutGraph#getPath path} of an edge, i.e., its start and end point as well as the intermediate control points, are interpreted as the - * set of input points. A cubic bezier curve is then fitted to these points. - *

- *

- * After the fitting, the points of the processed edges can be interpreted as cubic bezier control points. Each four - * consecutive points form a bezier curve, where the first and last of the four points represent the start and end of the - * curve and the second and third point are the control points defining how the curve looks. The second and third point do - * not necessarily lie on the actual curve. - *

- *

- * There are two exceptions to the stated rules: - *

- *
    - *
  • If an input edge only consists of a source and a target point, it will be ignored by this stage.
  • - *
  • - * Self-loop edges with only one intermediate control point are also ignored. Note that self-loops with more control points - * are, however, handled by this stage. - *
  • - *
- *

- * Features - *

- *

- * The {@link yfiles.layout.CurveFittingLayoutStage#maximumError maximum allowed error} for the fitting process can be selected to control how high the precision should be. A high - * allowed error means that the approximation process has a lot of freedom. Curves are only loosely bound to the original - * edge path. If this is not desired, e.g., because no new intersection with other graph elements should be introduced, - * then a rather low error value should be specified. The lower the error value, the larger the number of bend points of an - * approximated edge will be. - *

- *

- * It is possible to define the set of edges that should be processed by this layout stage. Therefore, only paths of a - * sub-set of edges can be changed. Use a {@link yfiles.algorithms.IDataProvider} registered with the specified {@link yfiles.layout.CurveFittingLayoutStage#affectedEdgesDpKey selection key} to - * mark edges which should be part of the considered sub-set. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface CurveFittingLayoutStage extends yfiles.layout.LayoutStageBase{} - export class CurveFittingLayoutStage { - /** - * Creates a new {@link yfiles.layout.CurveFittingLayoutStage} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [core=null] The core layout algorithm. - */ - constructor(core?:yfiles.layout.ILayoutAlgorithm); - /** - * Data provider key for selecting edges for curve fitting - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static DEFAULT_AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets the maximum allowed error for the fitting process. - *

- * The error is defined as the minimum distance between an original input control point (i.e. bend) of and edge and the - * fitted bezier curve. - *

- *

- * The maximum error must be greater than or equal to zero. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified maximum error is negative - * @type {number} - */ - maximumError:number; - /** - * Gets or sets the ratio that defines the distance between the intermediate control points and the end points of a cubic - * segment which actually represents a straight line, i.e., in case the four points are collinear. - *
    - *
  • 0.33 - the second and third control point are equally distributed between te first and fourth point.
  • - *
  • 0.0 - the first and second control point as well as the third and fourth point are equal.
  • - *
  • 0.5 - the second and third control point are equal and exactly the mid-point between the first and fourth point.
  • - *
- *

- * The control point ratio is defined to be within the interval [0.0, 0.5]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified ratio is outside the interval [0.0, 0.5] - * @type {number} - */ - straightControlPointRatio:number; - /** - * Gets or sets the {@link yfiles.algorithms.IDataProvider} key to look up the selection state of the edges that defines whether or - * not an edge's path should be approximated by a bezier curve. - *

- * If there is a {@link yfiles.algorithms.IDataProvider} registered with the input graph with this key, then only marked edges are - * processed by this layout stage. Otherwise, all edges are processed. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.algorithms.IDataProvider} key is null - * @type {any} - */ - affectedEdgesDpKey:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.CurveFittingLayoutStage; - } - /** - * {@link yfiles.layout.DefaultLayoutGraph} is a default implementation of {@link yfiles.layout.LayoutGraph} which holds the complete - * layout information about the graph and its elements. - * @class - * @extends {yfiles.layout.LayoutGraph} - */ - export interface DefaultLayoutGraph extends yfiles.layout.LayoutGraph{} - export class DefaultLayoutGraph { - /** - * Creates a new {@link yfiles.layout.DefaultLayoutGraph} instance which is a copy of the given subgraph. - * @param graph the original graph - * @param nodeSubset the nodes that induce a subgraph of the original graph - */ - constructor(graph:yfiles.layout.LayoutGraph,nodeSubset:yfiles.algorithms.ICursor); - /** - * Creates a new {@link yfiles.layout.DefaultLayoutGraph} instance which is a copy of the given graph. - * @param argGraph the original graph - */ - constructor(argGraph:yfiles.layout.LayoutGraph); - /** - * Creates a new {@link yfiles.layout.DefaultLayoutGraph} instance with default settings. - */ - constructor(); - /** - * Creates a new implementation of {@link yfiles.layout.IEdgeLayout}. - *

- * This method is called by {@link yfiles.layout.DefaultLayoutGraph#getLayout} if there is no layout information assigned to an - * edge, yet. It may be overridden to create custom {@link yfiles.layout.IEdgeLayout}s. - *

- * @returns the layout of an edge - * @protected - */ - createEdgeLayout():yfiles.layout.IEdgeLayout; - /** - * Creates a new implementation of {@link yfiles.layout.INodeLayout}. - *

- * This method is called by {@link yfiles.layout.DefaultLayoutGraph#getLayout} if there is no layout information assigned to a - * node, yet. It may be overridden to create custom {@link yfiles.layout.INodeLayout}s. - *

- * @returns the layout of a node - * @protected - */ - createNodeLayout():yfiles.layout.INodeLayout; - /** - * Specifies the layout information for all associated labels of the given edge. - *

- * The layout information consists of the location, size and orientation of the label. - *

- * @param edge the edge - * @param layout the layout information for the labels of the edge - */ - setLabelLayout(edge:yfiles.algorithms.Edge,layout:yfiles.layout.IEdgeLabelLayout[]):void; - /** - * Specifies the layout information for all associated labels of the given node. - *

- * The layout information consists of the location, size and orientation of the label. - *

- * @param node the node - * @param layout the layout information for the labels of the node - */ - setLabelLayout(node:yfiles.algorithms.Node,layout:yfiles.layout.INodeLabelLayout[]):void; - /** - * Specifies the layout information for all associated labels of the given node in case there is only one label. - *

- * The layout information consists of the location, size and orientation of the label. - *

- * @param node the node - * @param layout the layout information for the label of the node - */ - setLabelLayout(node:yfiles.algorithms.Node,layout:yfiles.layout.INodeLabelLayout):void; - /** - * Specifies the layout information for the given edge. - *

- * The layout information consists of the locations of the control and end points of the edge. - *

- * @param edge the edge - * @param layout the layout information for the edge - */ - setLayout(edge:yfiles.algorithms.Edge,layout:yfiles.layout.IEdgeLayout):void; - /** - * Specifies the layout information for the given node. - *

- * The layout information consists of the location and size of the node. - *

- * @param node the node - * @param layout the layout information for the node - */ - setLayout(node:yfiles.algorithms.Node,layout:yfiles.layout.INodeLayout):void; - /** - * A {@link yfiles.algorithms.INodeMap} associating {@link yfiles.layout.INodeLabelLayout}s with the nodes of this graph. - * @see yfiles.layout.DefaultLayoutGraph#setLabelLayout - * @type {yfiles.algorithms.INodeMap} - */ - nodeLabelMap:yfiles.algorithms.INodeMap; - /** - * An {@link yfiles.algorithms.IEdgeMap} associating {@link yfiles.layout.IEdgeLabelLayout}s with the edges of this graph. - * @see yfiles.layout.DefaultLayoutGraph#setLabelLayout - * @type {yfiles.algorithms.IEdgeMap} - */ - edgeLabelMap:yfiles.algorithms.IEdgeMap; - /** - * A {@link yfiles.collections.IMap.} associating the owner of a node label with the node label itself. - * @type {yfiles.collections.IMap.} - */ - nodeLabelFeatureMap:yfiles.collections.IMap; - /** - * A {@link yfiles.collections.IMap.} associating the owner of an edge label with the edge label itself. - * @type {yfiles.collections.IMap.} - */ - edgeLabelFeatureMap:yfiles.collections.IMap; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.DefaultLayoutGraph; - } - /** - * {@link yfiles.layout.Direction} provides four main directions and some methods to work with them. - * @class - * @final - */ - export interface Direction extends yfiles.lang.Object{} - export class Direction { - /** - * Returns the direction encoded as an integer value. - * @returns 0 for direction {@link #UP}, 1 for {@link #RIGHT}, 2 for {@link #DOWN}, and - * 3 for {@link #LEFT} - */ - getDirection():number; - /** - * Decodes the up direction. - * @const - * @static - * @type {yfiles.layout.Direction} - */ - static UP:yfiles.layout.Direction; - /** - * Decodes the right direction. - * @const - * @static - * @type {yfiles.layout.Direction} - */ - static RIGHT:yfiles.layout.Direction; - /** - * Decodes the down direction. - * @const - * @static - * @type {yfiles.layout.Direction} - */ - static DOWN:yfiles.layout.Direction; - /** - * Decodes the left direction. - * @const - * @static - * @type {yfiles.layout.Direction} - */ - static LEFT:yfiles.layout.Direction; - /** - * Gets the direction that follows this direction in clockwise order. - *

- * The new direction is turned 90 degrees in clockwise direction compared to this instance. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the current direction value is invalid - * @type {yfiles.layout.Direction} - */ - turnCW:yfiles.layout.Direction; - /** - * Gets the direction that follows this direction in counterclockwise order. - *

- * The new direction is turned 90 degrees in counterclockwise direction compared to this instance. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the current direction value is invalid - * @type {yfiles.layout.Direction} - */ - turnCCW:yfiles.layout.Direction; - /** - * Gets the mirror direction. - *

- * The new direction is turned 180 degrees compared to this instance. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the current direction value is invalid - * @type {yfiles.layout.Direction} - */ - mirror:yfiles.layout.Direction; - /** - * Gets whether or not this direction is horizontal ({@link yfiles.layout.Direction#RIGHT} or {@link yfiles.layout.Direction#LEFT}). - * @type {boolean} - */ - horizontal:boolean; - /** - * Gets whether or not this direction is vertical ({@link yfiles.layout.Direction#UP} or {@link yfiles.layout.Direction#DOWN}). - * @type {boolean} - */ - vertical:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.Direction; - } - /** - * {@link yfiles.layout.DiscreteEdgeLabelLayoutModel} describes the placement of rotated labels at some predefined positions along - * the edge. - *

- * {@graph {"ann":{"s":[30,30],"d":1,"lblB":1},"n":[[0,0],[200,0]],"e":[[0,1,[],[[35,-13.59,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[158.19,-13.59,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[96.59,-13.59,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[35,33.22,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[158.19,33.22,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[96.59,33.22,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[35,9.82,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[96.59,9.82,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[158.19,9.82,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"]]]],"vp":[0.0,-27.0,230.0,84.0]}} - *

- *

- * The predefined positions in this model - *

- *

- * It's possible to specify a distance value that controls the distance between label and edge. - *

- *

- * Furthermore, there's the possibility to mask out arbitrary edge label candidates. This can either be done by specifying - * predefined candidate masks or combining several label positions with a logical or-operation to a user-defined mask. - *

- * @class - * @implements {yfiles.layout.IEdgeLabelLayoutModel} - */ - export interface DiscreteEdgeLabelLayoutModel extends yfiles.lang.Object,yfiles.layout.IEdgeLabelLayoutModel{} - export class DiscreteEdgeLabelLayoutModel { - /** - * Creates a new instance of {@link yfiles.layout.DiscreteEdgeLabelLayoutModel} using the given candidate mask. - *

- * The candidates mask can either describe multiple or single valid positions. - *

- * @param candidateMask the position mask that defines the allowed positions for an edge label - */ - constructor(candidateMask:yfiles.layout.DiscreteEdgeLabelPositions); - /** - * Creates a new instance of {@link yfiles.layout.DiscreteEdgeLabelLayoutModel} with default settings. - */ - constructor(); - /** - * - * @param labelBounds - * @param edgeLayout - * @param sourceNode - * @param targetNode - * @returns - */ - createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout):any; - /** - * Returns a model parameter that encodes the specified position. - *

- * This model parameter can be passed to {@link yfiles.layout.DiscreteEdgeLabelLayoutModel#getLabelPlacement} to determine the - * label's position. - *

- * @param position one of the valid positions - * @returns a model parameter that encodes the specified position - * @throws {Stubs.Exceptions.ArgumentError} if the specified position is unknown - * @static - */ - static createPositionParameter(position:number):any; - /** - * - * @param label - * @param edgeLayout - * @param sourceNode - * @param targetNode - * @returns - */ - getLabelCandidates(label:yfiles.layout.IEdgeLabelLayout,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout):yfiles.algorithms.YList; - /** - * - * @param labelSize - * @param edgeLayout - * @param sourceNode - * @param targetNode - * @param param - * @returns - */ - getLabelPlacement(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout,param:any):yfiles.algorithms.YOrientedRectangle; - /** - * Returns the oriented box of the label for the given label position. - *

- * This method is called by {@link yfiles.layout.DiscreteEdgeLabelLayoutModel#getLabelPlacement} and {@link yfiles.layout.DiscreteEdgeLabelLayoutModel#getLabelCandidates} - * to retrieve a valid position. - *

- * @param labelSize the size of the label that should be placed - * @param edgeLayout the layout of the edge to which the label belongs - * @param sourceLayout the layout of the source node of the label-owning edge - * @param targetLayout the layout of the target node of the label-owning edge - * @param position the label position that is valid in this model - * @returns the oriented box of the label - * @protected - */ - getLabelPlacementForPosition(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout,position:yfiles.layout.DiscreteEdgeLabelPositions):yfiles.algorithms.YOrientedRectangle; - /** - * Returns the position specifier that is encoded by the given model parameter. - * @param parameter the model parameter - * @returns the position specifier - * @throws {Stubs.Exceptions.ArgumentError} if the specified model parameter is not valid for this model - * @static - */ - static getPosition(parameter:any):number; - /** - * Checks whether or not the given model parameter encodes a valid edge label position for this model. - *

- * If the model parameter describes a position that is accepted by the candidate mask, this is a valid parameter. - *

- * @param parameter the model parameter - * @returns true if the label position described by the given model parameter is allowed, false otherwise - */ - isParameterValid(parameter:any):boolean; - /** - * Gets the candidate mask which specifies the valid positions for edge labels. - * @type {yfiles.layout.DiscreteEdgeLabelPositions} - */ - candidateMask:yfiles.layout.DiscreteEdgeLabelPositions; - /** - * Gets or sets whether or not the label position mask should be interpreted relative to the edge segment. - *

- * If this option is disabled, the position mask is interpreted in a geometric sense. - *

- * @type {boolean} - */ - positionRelativeToSegment:boolean; - /** - * Gets or sets whether or not edge labels are automatically rotated according to the angle of the corresponding reference - * edge segment. - * @type {boolean} - */ - autoRotationEnabled:boolean; - /** - * Gets or sets whether or not edge labels get flipped if they would be upside down in their current position. - * @type {boolean} - */ - autoFlipping:boolean; - /** - * Gets or sets the angle (measured in radians) of the label model. - *

- * The angle is applied in clockwise direction. - *

- * @type {number} - */ - angle:number; - /** - * Gets or sets the distance between the label's bounding box and the edge path. - *

- * The distance must be a non-negative value. - *

- * @type {number} - */ - distance:number; - /** - * Gets a model parameter that encodes the default position of this model's allowed edge label positions. - *

- * Default positions are (in descending order): - *

- *
    - *
  • {@link yfiles.layout.DiscreteEdgeLabelPositions#CENTER}
  • - *
  • {@link yfiles.layout.DiscreteEdgeLabelPositions#SOURCE_CENTER}
  • - *
  • {@link yfiles.layout.DiscreteEdgeLabelPositions#TAIL}
  • - *
  • {@link yfiles.layout.DiscreteEdgeLabelPositions#SOURCE_TAIL}
  • - *
- *

- * Descending order means that whenever two or more of the above default positions are part of the allowed positions, then - * the model parameter encodes the one that is listed first. - *

- * @type {any} - */ - defaultParameter:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.DiscreteEdgeLabelLayoutModel; - } - /** - * {@link yfiles.layout.DiscreteNodeLabelLayoutModel} allows placing labels at eight positions around a node and at nine positions - * inside the node. - *

- * {@graph {"ann":{"s":[120,80],"d":1,"lblB":1},"n":[[-11.9,13.17,[[31.42,9.17,33.36,18.7,"Label"],[112.1,111.88,33.36,18.7,"Label"],[112.1,62.53,33.36,18.7,"Label"],[31.42,115.88,33.36,18.7,"Label"],[-49.27,111.88,33.36,18.7,"Label"],[-49.27,62.53,33.36,18.7,"Label"],[112.1,13.17,33.36,18.7,"Label"],[-49.27,13.17,33.36,18.7,"Label"],[31.42,62.53,33.36,18.7,"Label"],[-7.9,62.53,33.36,18.7,"Label"],[-7.9,89.17,33.36,18.7,"Label"],[31.42,89.17,33.36,18.7,"Label"],[70.73,89.17,33.36,18.7,"Label"],[-7.9,35.88,33.36,18.7,"Label"],[70.73,62.53,33.36,18.7,"Label"],[70.73,35.88,33.36,18.7,"Label"],[31.42,35.88,33.36,18.7,"Label"]]]],"e":[],"vp":[-50.0,-10.0,196.0,126.0]}} - *

- *

- * The predefined positions in this model - *

- *

- * It's possible to specify an insets value that controls the distance between label and node. - *

- *

- * Furthermore, there's the possibility to mask out arbitrary node label candidates. This can either be done by specifying - * predefined candidate masks or a combination of valid positions of this model using a logical or-operation. - *

- * @class - * @implements {yfiles.layout.INodeLabelLayoutModel} - */ - export interface DiscreteNodeLabelLayoutModel extends yfiles.lang.Object,yfiles.layout.INodeLabelLayoutModel{} - export class DiscreteNodeLabelLayoutModel { - /** - * Creates a new instance of {@link yfiles.layout.DiscreteNodeLabelLayoutModel} using the given candidate mask and insets. - *

- * The specified mask can also describe a single position. - *

- * @param candidateMask the position mask that defines the allowed positions for a node label - * @param [inset=4.0] the inset value that defines the internal label distance to the node's border - */ - constructor(candidateMask:yfiles.layout.DiscreteNodeLabelPositions,inset?:number); - /** - * Creates a new instance of {@link yfiles.layout.DiscreteNodeLabelLayoutModel} with default settings. - */ - constructor(); - /** - * - * @param labelBounds - * @param nodeLayout - * @returns - */ - createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,nodeLayout:yfiles.layout.INodeLayout):any; - /** - * - * @param labelLayout - * @param nodeLayout - * @returns - */ - getLabelCandidates(labelLayout:yfiles.layout.INodeLabelLayout,nodeLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; - /** - * - * @param labelSize - * @param nodeLayout - * @param parameter - * @returns - */ - getLabelPlacement(labelSize:yfiles.algorithms.YDimension,nodeLayout:yfiles.layout.INodeLayout,parameter:any):yfiles.algorithms.YOrientedRectangle; - /** - * Returns the oriented box of the label for the given label position. - *

- * This method is called by {@link yfiles.layout.DiscreteNodeLabelLayoutModel#getLabelPlacement} and {@link yfiles.layout.DiscreteNodeLabelLayoutModel#getLabelCandidates} - * to retrieve a valid position. - *

- * @param labelSize the size of the label that should be placed - * @param nodeLayout the layout of the node to which the label belongs - * @param position the label position that is valid in this model - * @returns the oriented box of the label - * @protected - */ - getLabelPlacementForPosition(labelSize:yfiles.algorithms.YDimension,nodeLayout:yfiles.layout.INodeLayout,position:yfiles.layout.DiscreteNodeLabelPositions):yfiles.algorithms.YOrientedRectangle; - /** - * Checks whether or not the given model parameter encodes a valid node label position for this model. - *

- * If the model parameter describes a position that is accepted by the candidate mask, this is a valid parameter. - *

- * @param parameter the model parameter - * @returns true if the label position described by the given model parameter is allowed, false otherwise - */ - isParameterValid(parameter:any):boolean; - /** - * Gets the candidate mask which specifies the valid positions for node labels. - * @type {yfiles.layout.DiscreteNodeLabelPositions} - */ - candidateMask:yfiles.layout.DiscreteNodeLabelPositions; - /** - * Gets or sets the distance between the label's bounding box and the node. - *

- * The distance must be a non-negative value. - *

- * @type {number} - */ - distance:number; - /** - * Gets a model parameter that encodes the default position of this model's allowed node label positions. - *

- * Default positions are (in descending order): - *

- *
    - *
  • {@link yfiles.layout.DiscreteNodeLabelPositions#CENTER}
  • - *
  • {@link yfiles.layout.DiscreteNodeLabelPositions#NORTH_EAST}
  • - *
  • {@link yfiles.layout.DiscreteNodeLabelPositions#NORTH}
  • - *
  • {@link yfiles.layout.DiscreteNodeLabelPositions#EAST}
  • - *
- *

- * Descending order means that whenever two or more of the above default positions are part of the allowed positions, then - * the model parameter encodes the one that is listed first. - *

- * @type {any} - */ - defaultParameter:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.DiscreteNodeLabelLayoutModel; - } - /** - * An {@link yfiles.layout.EdgeBundleDescriptor} defines the {@link yfiles.layout.EdgeBundling bundling} settings of an edge. - *

- * The defined settings will be considered by {@link yfiles.layout.ILayoutAlgorithm layout algorithms} which support edge bundling. - *

- *

- * Each {@link yfiles.layout.EdgeBundleDescriptor} can either be specified for a single edge or shared by several edges. It is - * assigned to an edge by registering a {@link yfiles.algorithms.IDataProvider} with key {@link yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY} - * to the input graph. - *

- * @see yfiles.layout.EdgeBundling - * @see yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY - * @class - */ - export interface EdgeBundleDescriptor extends yfiles.lang.Object{} - export class EdgeBundleDescriptor { - /** - * Creates a new {@link yfiles.layout.EdgeBundleDescriptor} representing a copy of the given other descriptor instance. - * @param descriptor the descriptor to copy - */ - constructor(descriptor:yfiles.layout.EdgeBundleDescriptor); - /** - * Creates a new {@link yfiles.layout.EdgeBundleDescriptor} with default settings. - */ - constructor(); - /** - * Gets or sets whether or not the direction of the edge associated to this descriptor should be considered. - *

- * During the bundling procedure, the edges are bundled based on their direction such that the incoming edges of a node are - * bundled separately from its outgoing edges. If the direction of edges adjacent to a node is not considered, then they - * are not bundled separately. - *

- *

- * If the direction of some edges is taken into consideration while the direction of some others (adjacent to the same - * node) is ignored, the undirected edges are also bundled separately. This is done to distinguish them from the incoming - * and outgoing edges of the particular node. - *

- * @type {boolean} - */ - considerDirection:boolean; - /** - * Gets or sets whether or not an edge associated to this descriptor should be bundled. - * @type {boolean} - */ - bundled:boolean; - /** - * Gets or sets whether or not a bezier curve should be fit to an edge associated to this descriptor. - *

- * If disabled, the edges resemble B-splines where points of the path are actually curve points. Therefore, this - * representation requires a high number of bends to model curves. - *

- *

- * If this feature is enabled, a bezier curve is fitted to the start and end point as well as the intermediate control - * points of the edge. After the fitting, the points of the edge can be interpreted as cubic bezier control points. Each - * four consecutive points form a bezier curve, where the first and last of the four points represent the start and end of - * the curve and the second and third point are the control points defining how the curve looks. The second and third point - * do not necessarily lie on the actual curve. - *

- * @type {boolean} - */ - bezierFitting:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.EdgeBundleDescriptor; - } - /** - * An {@link yfiles.layout.EdgeBundling} instance defines if and how the edges of a graph should be bundled by a - * {@link yfiles.layout.ILayoutAlgorithm layout algorithm}, given that the algorithm supports edge bundling. - *

- * Bundling together multiple edges means that their common parts are to some degree merged into a bundled part. At the - * source and target point, the edges are again clearly split. Edge bundling is useful to increase the readability of graph - * drawings with a high number of edges that connect a comparably small number of nodes. Without bundling, such drawings - * can often contain visual clutter and feature bad readability. - *

- *

- * The bundling {@link yfiles.layout.EdgeBundling#bundlingStrength strength} and {@link yfiles.layout.EdgeBundling#bundlingQuality quality} are global settings for the bundling process. On the other hand, each edge can get - * specific settings by assigning a {@link yfiles.layout.EdgeBundleDescriptor} to it. A {@link yfiles.algorithms.IDataProvider} can be - * registered with the input graph with key {@link yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY} to assign descriptors - * to edges. This allows, for example, to define which edges should actually be bundled. - *

- * @see yfiles.layout.EdgeBundleDescriptor - * @see yfiles.circular.CircularLayout#edgeBundling - * @class - */ - export interface EdgeBundling extends yfiles.lang.Object{} - export class EdgeBundling { - /** - * Creates a new {@link yfiles.layout.EdgeBundling} instance with the given {@link yfiles.layout.EdgeBundling#bundlingStrength bundling strength} and {@link yfiles.layout.EdgeBundling#bundlingQuality bundling quality}. - * @param bundlingStrength the bundling strength from the interval [0,1] - * @param bundlingQuality the bundling quality from the interval [0,1] - * @throws {Stubs.Exceptions.ArgumentError} if the given bundling strength or quality is not within [0,1] - */ - constructor(bundlingStrength:number,bundlingQuality:number); - /** - * Creates a new {@link yfiles.layout.EdgeBundling} instance with default settings. - */ - constructor(); - /** - * Data provider key for specifying individual bundling settings for edges - *

- * If no {@link yfiles.layout.EdgeBundleDescriptor} is mapped to an edge, the {@link yfiles.layout.EdgeBundling#defaultBundleDescriptor default descriptor} is used by the layout algorithm to - * obtain the bundling setup of that edge. - *

- * @see yfiles.layout.EdgeBundling#defaultBundleDescriptor - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_BUNDLE_DESCRIPTOR_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets the desired quality of the calculated edge bundling. - *

- * Higher quality indicates that the bundling procedure uses more sophisticated methods to compute the actual bundles and - * the routing of the edges. This may lead to a significantly higher running time, especially for large graphs. On the - * other hand, a low quality indicates that run-time is more important than highly optimized bundling results, leading to, - * for example, more crossings between different bundles. - *

- *

- * The quality is defined to lie within [0,1], where higher values stand for higher quality. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given quality value is not within [0,1] - * @type {number} - */ - bundlingQuality:number; - /** - * Gets or sets the strength of the edge bundling. - *

- * The strength controls how tightly the edges are bundled and influences the shape of the curves of bundled edges. Low - * values lead to only slightly bundled edges; results will mostly show individual node-to-node connectivity information. - * High values show the connectivity on a higher level, strongly bundling edges together and generating highly curved edge - * paths. - *

- *

- * The bundling strength is defined as a value from the interval [0,1]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given strength is less than 0 or greater than 1 - * @type {number} - */ - bundlingStrength:number; - /** - * Gets or sets the default {@link yfiles.layout.EdgeBundleDescriptor} used for all edges which do not have a specific descriptor - * assigned via a {@link yfiles.algorithms.IDataProvider} registered with key - * {@link yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY}. - * @throws {Stubs.Exceptions.ArgumentError} if the given descriptor is null - * @see yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.EdgeBundleDescriptor} - */ - defaultBundleDescriptor:yfiles.layout.EdgeBundleDescriptor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.EdgeBundling; - } - /** - * An {@link yfiles.layout.EdgeLabelCandidate} describes one valid placement for an edge label considering the label model. - * @class - * @extends {yfiles.layout.LabelCandidate} - */ - export interface EdgeLabelCandidate extends yfiles.layout.LabelCandidate{} - export class EdgeLabelCandidate { - /** - * Creates a new instance of {@link yfiles.layout.EdgeLabelCandidate} described by location, size, model parameter and internal - * flag. - * @param pos the location of the upper left corner of the candidate - * @param size the size of the candidate - * @param param the parameters of the label model associated with this candidate - * @param owner the label associated with the candidate - * @param [internal=false] true if the candidate is allowed to overlap with its owner, false otherwise - */ - constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:any,owner:yfiles.layout.IEdgeLabelLayout,internal?:boolean); - /** - * Creates a new instance of {@link yfiles.layout.EdgeLabelCandidate} described by its box, model parameter and internal flag. - * @param labelBox the box that specifies the candidate's size and position - * @param param the parameters of the label model associated with this candidate - * @param owner the label associated with the candidate - * @param [internal=false] true if the candidate is allowed to overlap with its owner, false otherwise - */ - constructor(labelBox:yfiles.algorithms.YOrientedRectangle,param:any,owner:yfiles.layout.IEdgeLabelLayout,internal?:boolean); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.EdgeLabelCandidate; - } - /** - * {@link yfiles.layout.EdgeLabelOrientationSupport} provides orientation and mirroring support for {@link yfiles.layout.ILayoutAlgorithm layout algorithms} with - * integrated edge labeling. - *

- * To calculate the position and orientation of edge labels whose placements are defined with the - * {@link yfiles.layout.PreferredPlacementDescriptor}, the {@link yfiles.layout.OrientationLayout} would need the direction of the - * associated edge. Since this direction is not available to the {@link yfiles.layout.OrientationLayout}, because it is a wrapper, - * the calculation must be done in the core layout algorithm itself with the help of the - * {@link yfiles.layout.EdgeLabelOrientationSupport}. - *

- *

- * Important: Since layout algorithms with integrated edge labeling cannot deal with ambiguous preferred placement - * descriptors (combinations of the same setting, e.g., source or target for the {@link yfiles.layout.PreferredPlacementDescriptor#placeAlongEdge}), {@link yfiles.layout.EdgeLabelOrientationSupport#preProcessLabel} - * removes combinations and replaces the original descriptor with a non-ambiguous one during the layout calculation. - *

- * @class - */ - export interface EdgeLabelOrientationSupport extends yfiles.lang.Object{} - export class EdgeLabelOrientationSupport { - /** - * Creates a new {@link yfiles.layout.EdgeLabelOrientationSupport} instance. - * @see yfiles.layout.OrientationLayout#considerEdgeLabels - */ - constructor(); - /** - * Creates and returns a non-ambiguous {@link yfiles.layout.PreferredPlacementDescriptor} of the given potentially ambiguous one. - *

- * The created descriptor will be one without any combinations of settings, e.g., source or target for the {@link yfiles.layout.PreferredPlacementDescriptor#placeAlongEdge}. - *

- * @param ambiguous an ambiguous {@link } - * @returns a non-ambiguous version of the given ambiguous {@link } - * @protected - */ - createNonAmbiguous(ambiguous:yfiles.layout.PreferredPlacementDescriptor):yfiles.layout.PreferredPlacementDescriptor; - /** - * Calculates the up vector of an edge label considering the preferred placement of the label as well as the direction of - * the edge segment the label is attached to. - * @param descriptor the data describing the preferred label orientation - * @param segmentDirection the direction the edge segment is pointing to - * @returns the up vector for the edge label that considers the preferred placement of the label as well as the direction of the - * edge segment the label is attached to - * @static - */ - static getEdgeLabelUpVector(descriptor:yfiles.layout.PreferredPlacementDescriptor,segmentDirection:yfiles.layout.Direction):yfiles.algorithms.YVector; - /** - * Calculates the up vector for a label whose right vector is rotated clockwise by the given angle. - *

- * The up vector starts in the lower-left corner of the label and points up. If the label is paraxial it is (0, -1). The - * right vector starts at the same point and points right. In a paraxial label it is (1, 0). - *

- * @param rightVectorAngle the angle in radians the right vector is rotated by - * @returns the up vector for a label whose right vector is rotated clockwise by the given angle - * @static - */ - static getLabelUpVector(rightVectorAngle:number):yfiles.algorithms.YVector; - /** - * Transforms a direction of the layout to the oriented layout direction. - * @param direction direction in the layout - * @param orientation the orientation of the layout - * @param mirrorMask the mask to determine whether or not the orientation is mirrored - * @returns the direction in the oriented layout - * @static - */ - static getOrientedDirection(direction:yfiles.layout.Direction,orientation:yfiles.layout.LayoutOrientation,mirrorMask:yfiles.layout.MirrorModes):yfiles.layout.Direction; - /** - * Returns whether or not the orientation is mirrored. - * @param orientation the orientation of the layout - * @param mirrorMask the mask to determine whether or not the orientation is mirrored - * @returns true if the orientation is mirrored, false otherwise - * @static - */ - static isOrientationMirrored(orientation:yfiles.layout.LayoutOrientation,mirrorMask:yfiles.layout.MirrorModes):boolean; - /** - * Marks the given port label for a non-port placement (fallback). - *

- * The given edge label's {@link yfiles.layout.PreferredPlacementDescriptor} will internally be changed such that its {@link yfiles.layout.PreferredPlacementDescriptor#placeAlongEdge placement along edge} - * is either {@link yfiles.layout.LabelPlacements#AT_SOURCE} or {@link yfiles.layout.LabelPlacements#AT_TARGET}. - *

- *

- * Algorithms that are executed after this call and before {@link yfiles.layout.EdgeLabelOrientationSupport#resetAmbiguousLabelDescriptors} - * will handle port labels like normal source or target labels. - *

- * @param portLabel an edge label that had a {@link #AT_SOURCE_PORT} or {@link #AT_TARGET_PORT} - * placement preference - * @throws {Stubs.Exceptions.InvalidOperationError} if {@link yfiles.layout.EdgeLabelOrientationSupport#replaceAmbiguousLabelDescriptors} was never called for the graph containing - * the given label. - * @see yfiles.layout.LabelPlacements#AT_SOURCE_PORT - * @see yfiles.layout.LabelPlacements#AT_TARGET_PORT - */ - markPortLabelForFallbackPlacement(portLabel:yfiles.layout.LabelLayoutData):void; - /** - * Restores the original preferred placement and updates the label rotation according to the layout orientation. - *

- * The original {@link yfiles.layout.LabelLayoutData#preferredPlacementDescriptor} that has been replaced in {@link yfiles.layout.EdgeLabelOrientationSupport#preProcessLabel} gets restored. Then it - * moves and rotates the {@link yfiles.layout.LabelLayoutData#bounds label box} in respect of the orientation. - *

- *

- * This method is called by the core layout algorithm with the integrated edge labeling for each edge label after the - * location of the label is determined. - *

- * @param graph the graph to get the orientation information from - * @param label the information about the edge label whose location is determined - */ - postProcessLabel(graph:yfiles.algorithms.Graph,label:yfiles.layout.LabelLayoutData):void; - /** - * Prepares the label for the core layout algorithm. - *

- * First, the {@link yfiles.layout.LabelLayoutData#preferredPlacementDescriptor preferred placement} of the edge label is replaced by a non-ambiguous {@link yfiles.layout.PreferredPlacementDescriptor} - * that has only relative references. This descriptor is orientation independent and can be used in the core layout - * algorithm. Second, the method rotates the {@link yfiles.layout.LabelLayoutData#bounds label box} in respect of its {@link yfiles.layout.PreferredPlacementDescriptor} and the - * direction of the segment to which it belongs. After that call, the core layout algorithm can use the geometry ({@link yfiles.layout.LabelLayoutData#width} and - * {@link yfiles.layout.LabelLayoutData#height}) of the label to calculate its location. - *

- *

- * This method is called by the core layout algorithm with the integrated edge labeling for each edge label before the - * layout algorithm uses the geometry of labels. It should be called as soon as the direction of the segment the label - * belongs to is determined. - *

- * @param graph the graph to get the orientation information from - * @param label the information about the edge label whose segment direction is determined - * @param segmentDirection the direction of the segment the edge label belongs to - */ - preProcessLabel(graph:yfiles.algorithms.Graph,label:yfiles.layout.LabelLayoutData,segmentDirection:yfiles.layout.Direction):void; - /** - * Replaces the - * {@link yfiles.layout.PreferredPlacementDescriptor}s of all edge labels in the given graph with non-ambiguous descriptors. - *

- * The non-ambiguous descriptors are retrieved from the original descriptors. They describe only one of the possible - * placements. - *

- *

- * This method should be called by a layout algorithm at the beginning of the layout calculation to assure that the label's - * placement is handled consistently. - *

- * @param graph the input graph - */ - replaceAmbiguousLabelDescriptors(graph:yfiles.algorithms.Graph):void; - /** - * Restores the - * {@link yfiles.layout.PreferredPlacementDescriptor}s of all edge labels in the given graph with their original descriptors. - *

- * This method should be called by a layout algorithm at the end of the layout calculation to assure that the original - * state of the graph is not corrupted. - *

- * @param graph the input graph - */ - resetAmbiguousLabelDescriptors(graph:yfiles.algorithms.Graph):void; - /** - * Calculates and sets the up vector of an edge label considering the preferred placement of the label as well as the - * direction of the edge segment the label is attached to. - * @param label the data that describes the label orientation and is used for setting the new up vector - * @param segmentDirection the direction the edge segment is pointing to - * @see yfiles.layout.EdgeLabelOrientationSupport#getEdgeLabelUpVector - * @static - */ - static updateLabelOrientation(label:yfiles.layout.LabelLayoutData,segmentDirection:yfiles.layout.Direction):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.EdgeLabelOrientationSupport; - } - /** - * {@link yfiles.layout.FixNodeLayoutStage} fixes the initial position of either a single node or the alignment of the bounding box of - * several nodes (but not the positions of the individual nodes). - *

- * The absolute coordinates of the {@link yfiles.layout.FixNodeLayoutStage#calculateFixPoint fix point} are the same before and after invoking the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. However, the - * relative coordinates of the nodes are altered by the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface FixNodeLayoutStage extends yfiles.layout.LayoutStageBase{} - export class FixNodeLayoutStage { - /** - * Creates a new {@link yfiles.layout.FixNodeLayoutStage} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algorithm. - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Calculates the bounding box of the specified nodes. - *

- * The calculated bounds may contain {@link yfiles.layout.FixNodeLayoutStage#includingEdges edges} and/or {@link yfiles.layout.FixNodeLayoutStage#includingLabels labels}. - *

- *

- * This method is called by {@link yfiles.layout.FixNodeLayoutStage#calculateFixPoint} and may be overridden to customize the size - * of the bounds. - *

- * @param graph the graph associated with the specified nodes - * @param fixed the list of nodes for which to determine the bounding box - * @returns the bounding box of the specified nodes - * @see yfiles.layout.FixNodeLayoutStage#includingEdges - * @see yfiles.layout.FixNodeLayoutStage#includingLabels - * @see yfiles.layout.FixNodeLayoutStage#calculateFixPoint - * @protected - */ - calculateBounds(graph:yfiles.layout.LayoutGraph,fixed:yfiles.algorithms.NodeList):yfiles.algorithms.Rectangle2D; - /** - * Calculates the fix point for the specified nodes in the specified graph. - *

- * The default implementation calls {@link yfiles.layout.FixNodeLayoutStage#calculateBounds} and - * {@link yfiles.layout.FixNodeLayoutStage#calculateFixPoint}. - *

- *

- * This method is called by {@link yfiles.layout.FixNodeLayoutStage#applyLayout} to determine the point that will have the same - * coordinates before and after invoking the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. It may be overridden to introduce a custom policy for retrieving the fix point. - *

- * @param graph the graph associated with the specified nodes - * @param fixed the list of nodes for which a fix point has to be determined - * @returns the fix point for the specified nodes in the specified graph - * @see yfiles.layout.FixNodeLayoutStage#fixPointPolicy - * @see yfiles.layout.FixNodeLayoutStage#calculateBounds - * @see yfiles.layout.FixNodeLayoutStage#calculateFixPoint - * @protected - */ - calculateFixPoint(graph:yfiles.layout.LayoutGraph,fixed:yfiles.algorithms.NodeList):yfiles.algorithms.YPoint; - /** - * Calculates the fix point of the specified rectangle according to the policy returned by {@link yfiles.layout.FixNodeLayoutStage#fixPointPolicy}. - *

- * If the specified rectangle is null or the rectangle has negative width or negative height then null will be returned. - *

- *

- * This method is called by - * {@link yfiles.layout.FixNodeLayoutStage#calculateFixPoint}. It may be overridden to introduce a custom policy for retrieving the - * fix point. - *

- * @param bounds the rectangle for which to determine the fix point - * @returns the fix point of the specified rectangle or null if nothing should be fixed - * @throws {Stubs.Exceptions.ArgumentError} if the current fix point policy is invalid - * @see yfiles.layout.FixNodeLayoutStage#fixPointPolicy - * @protected - */ - calculateFixPoint(bounds:yfiles.algorithms.Rectangle2D):yfiles.algorithms.YPoint; - /** - * Data provider key for determining the nodes that should be considered fixed - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static FIXED_NODE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets the fix point calculation policy used in {@link yfiles.layout.FixNodeLayoutStage#calculateFixPoint} to determine - * which point in the corresponding rectangle should be considered fixed. - * @throws {Stubs.Exceptions.ArgumentError} if the specified policy is unknown - * @type {yfiles.layout.FixPointPolicy} - */ - fixPointPolicy:yfiles.layout.FixPointPolicy; - /** - * Gets or sets whether or not subgraph edges are taken into account when calculating the bounding box of the fixed nodes. - * @see yfiles.layout.FixNodeLayoutStage#calculateBounds - * @type {boolean} - */ - includingEdges:boolean; - /** - * Gets or sets whether or not label geometries are taken into account when calculating the bounding box of the fixed - * nodes. - * @see yfiles.layout.FixNodeLayoutStage#calculateBounds - * @type {boolean} - */ - includingLabels:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.FixNodeLayoutStage; - } - /** - * {@link yfiles.layout.FixPortLocationStage} ensures that layout algorithms that cannot handle port constraints keep the ports of - * edges with strong {@link yfiles.layout.PortConstraint}s. - *

- * Without this stage, the port locations get lost. - *

- *

- * For each edge with strong {@link yfiles.layout.PortConstraint}s, this stage simply stores the original port and restores it - * after applying the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. Therefore, it either replaces the source/target port by the original port or - * adds the original port to the edge path calculated by the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} (see method {@link yfiles.layout.FixPortLocationStage#keepCalculatedPorts}). - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface FixPortLocationStage extends yfiles.layout.LayoutStageBase{} - export class FixPortLocationStage { - /** - * Creates a new {@link yfiles.layout.FixPortLocationStage} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algorithm. - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Gets or sets whether or not the final edge routes should contain the ports calculated by the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- * If this option is disabled, this stage simply replaces the current source/target ports (calculated by the core layout - * algorithm) by the original ports (for strong ports only). Otherwise, the calculated ports are still contained in the - * edge paths. - *

- * @type {boolean} - */ - keepCalculatedPorts:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.FixPortLocationStage; - } - /** - * This model parameter encodes a label position within {@link yfiles.layout.FreeEdgeLabelLayoutModel}. - *

- * It represents every possible location in relation to the source point of the edge. The radius describes the distance of - * the label center from the source point. There is an angle theta which defines the location on the circle with the given - * radius. It is the angle between the first segment of the underlying edge and the imaginary line to the center of the - * label. Finally, there is a second angle that describes the rotation of the label box. - *

- * @see yfiles.layout.FreeEdgeLabelLayoutModelParameter#setPoint - * @see yfiles.layout.FreeEdgeLabelLayoutModelParameter#angle - * @class - */ - export interface FreeEdgeLabelLayoutModelParameter extends yfiles.lang.Object{} - export class FreeEdgeLabelLayoutModelParameter { - /** - * Creates a new instance of {@link yfiles.layout.FreeEdgeLabelLayoutModelParameter} with the given radius, angle and rotation - * angle. - * @param radius the distance of the label from the source node of the underlying edge - * @param theta the angle in radians between the first segment of the underlying edge and the imaginary line to the center of the label - * @param [angle=0] the rotation angle of the label - */ - constructor(radius:number,theta:number,angle?:number); - /** - * Creates a new instance of {@link yfiles.layout.FreeEdgeLabelLayoutModelParameter} with radius 50 and angle 0. - */ - constructor(); - /** - * Specifies a point that represents the location of the label's center in relation to the source point of the edge. - *

- * The x-coordinate corresponds to the radius which describes the distance of the label to the source point. The - * y-coordinate corresponds to the angle between the first segment of the underlying edge and the imaginary line to the - * center of the label. - *

- * @param radius the distance to the source point - * @param theta the location on the radius - */ - setPoint(radius:number,theta:number):void; - /** - * Gets or sets the rotation angle of the label that is placed using this model parameter. - * @type {number} - */ - angle:number; - /** - * Gets a point that represents the location of the label's center in relation to the source point of the edge. - *

- * The x-coordinate corresponds to the radius which describes the distance of the label to the source point. The - * y-coordinate corresponds to the angle between the first segment of the underlying edge and the imaginary line to the - * center of the label. - *

- * @type {yfiles.algorithms.YPoint} - */ - point:yfiles.algorithms.YPoint; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.FreeEdgeLabelLayoutModelParameter; - } - /** - * {@link yfiles.layout.FreeEdgeLabelLayoutModel} allows placing edge labels at any location. - * @class - * @implements {yfiles.layout.IEdgeLabelLayoutModel} - */ - export interface FreeEdgeLabelLayoutModel extends yfiles.lang.Object,yfiles.layout.IEdgeLabelLayoutModel{} - export class FreeEdgeLabelLayoutModel { - /** - * Creates a new instance of {@link yfiles.layout.FreeEdgeLabelLayoutModel}. - */ - constructor(); - /** - * Creates a model parameter that represents the given edge label position within this model. - *

- * The created model parameter represents the current location of the given label. - *

- *

- * This parameter can be passed to {@link yfiles.layout.FreeEdgeLabelLayoutModel#getLabelPlacement} to retrieve the current label - * box. - *

- * @param labelBounds the oriented box of the label the parameter represents - * @param edgeLayout the layout of the edge to which the label belongs - * @param sourceLayout the layout of the source node of the label-owning edge - * @param targetLayout the layout of the target node of the label-owning edge - * @returns the model parameter representing the given label location - * @throws {Stubs.Exceptions.ArgumentError} if one or more of the given bounds' values are invalid, i.e., NaN - * @see yfiles.layout.FreeEdgeLabelLayoutModel#getLabelPlacement - */ - createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout):any; - /** - * Returns the {@link yfiles.layout.EdgeLabelCandidate} that describes the current label position. - * @param labelLayout the label for which candidates should be generated - * @param edgeLayout the layout of the edge to which the label belongs - * @param sourceLayout the layout of the source node of the label-owning edge - * @param targetLayout the layout of the target node of the label-owning edge - * @returns a list of {@link } instances - */ - getLabelCandidates(labelLayout:yfiles.layout.IEdgeLabelLayout,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; - /** - * - * @param labelSize - * @param edgeLayout - * @param sourceNode - * @param targetNode - * @param param - * @returns - */ - getLabelPlacement(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout,param:any):yfiles.algorithms.YOrientedRectangle; - /** - * Gets the model parameter that encodes the default position of {@link yfiles.layout.FreeEdgeLabelLayoutModel}. - *

- * The distance of the label to the edge's source point will be 20. The angle between the line to the center of the label - * and the first segment is 20 radians. The label is not rotated. - *

- *

- * This parameter can be passed to {@link yfiles.layout.FreeEdgeLabelLayoutModel#getLabelPlacement} to retrieve the corresponding - * label box. - *

- * @type {any} - */ - defaultParameter:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.FreeEdgeLabelLayoutModel; - } - /** - * The model parameter that encodes a label position within {@link yfiles.layout.FreeNodeLabelLayoutModel}. - *

- * It represents every possible location in relation to the node. The point describes the offset of the label's center to - * the upper-left corner of the node. - *

- * @see yfiles.layout.FreeNodeLabelLayoutModelParameter#setPoint - * @class - */ - export interface FreeNodeLabelLayoutModelParameter extends yfiles.lang.Object{} - export class FreeNodeLabelLayoutModelParameter { - /** - * Creates a new instance of {@link yfiles.layout.FreeNodeLabelLayoutModelParameter} with the given offset. - * @param dx the horizontal offset - * @param dy the vertical offset - */ - constructor(dx:number,dy:number); - /** - * Creates a new instance of {@link yfiles.layout.FreeNodeLabelLayoutModelParameter}. - *

- * It has no offset, i.e., the upper-left corners of both node label and node are at the same location. - *

- */ - constructor(); - /** - * Specifies the offset of the label's center to the upper-left corner of the node. - * @param dx the horizontal offset - * @param dy the vertical offset - */ - setPoint(dx:number,dy:number):void; - /** - * Gets the offset of the label's center to the upper-left corner of the node. - * @type {yfiles.algorithms.YPoint} - */ - point:yfiles.algorithms.YPoint; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.FreeNodeLabelLayoutModelParameter; - } - /** - * {@link yfiles.layout.FreeNodeLabelLayoutModel} allows placing node labels at any desired position. - *

- * The location of the label does not need to satisfy any constraints. The {@link yfiles.layout.FreeNodeLabelLayoutModel#createModelParameter model parameter} describes a fixed offset between - * the upper-left corner of the node and the center of the label. - *

- * @class - * @implements {yfiles.layout.INodeLabelLayoutModel} - */ - export interface FreeNodeLabelLayoutModel extends yfiles.lang.Object,yfiles.layout.INodeLabelLayoutModel{} - export class FreeNodeLabelLayoutModel { - /** - * Returns a new instance of {@link yfiles.layout.FreeNodeLabelLayoutModel}. - */ - constructor(); - /** - * Creates a model parameter that represents the given node label position within this model. - *

- * The created model parameter represents the current location of the given label. - *

- *

- * This parameter can be passed to {@link yfiles.layout.FreeNodeLabelLayoutModel#getLabelPlacement} to retrieve the current label - * box. - *

- * @param labelBounds the bounds of the label the parameter represents - * @param nodeLayout the layout of the node to which the label belongs - * @returns the model parameter - * @throws {Stubs.Exceptions.ArgumentError} if one or more of the given bounds' values are invalid, i.e., NaN - * @see yfiles.layout.FreeNodeLabelLayoutModel#getLabelPlacement - */ - createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,nodeLayout:yfiles.layout.INodeLayout):any; - /** - * Returns the {@link yfiles.layout.NodeLabelCandidate} that describes the current label position. - * @param labelLayout the label for which candidates should be generated - * @param nodeLayout the layout of the node to which the label belongs - * @returns a list of {@link } instances - */ - getLabelCandidates(labelLayout:yfiles.layout.INodeLabelLayout,nodeLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; - /** - * - * @param labelSize - * @param nodeLayout - * @param param - * @returns - */ - getLabelPlacement(labelSize:yfiles.algorithms.YDimension,nodeLayout:yfiles.layout.INodeLayout,param:any):yfiles.algorithms.YOrientedRectangle; - /** - * Gets a model parameter that encodes the default position of {@link yfiles.layout.INodeLabelLayoutModel}. - *

- * The node label's upper-left corner is placed 20 pixels to the left and 20 pixels above the node. - *

- *

- * This parameter can be passed to {@link yfiles.layout.FreeNodeLabelLayoutModel#getLabelPlacement} to retrieve the corresponding - * label box. - *

- * @type {any} - */ - defaultParameter:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.FreeNodeLabelLayoutModel; - } - export enum ComponentArrangementStyles{ - /** - * Style specifier describing no special component arrangement at all. Components will be centered at the same position - * they resided at before the layout started. If combined with the style modifier - * {@link yfiles.layout.ComponentArrangementStyles#MODIFIER_NO_OVERLAP}, components might get moved so that they don't overlap - * after the layout. - * @see yfiles.layout.ComponentLayout#style - */ - NONE, - /** - * Style specifier describing a component arrangement strategy that places components in multiple rows so that the overall - * aspect ratio of the whole graph gets as close to the aspect ratio of the preferred layout size as possible. - * @see yfiles.layout.ComponentLayout#style - * @see yfiles.layout.ComponentLayout#preferredSize - */ - ROWS, - /** - * Style specifier describing a component arrangement strategy that places all components next to each other in a single - * row. If combined with the style modifier - * {@link yfiles.layout.ComponentArrangementStyles#MODIFIER_AS_IS}, components will be placed in the same order as they were placed - * before the layout. - * @see yfiles.layout.ComponentLayout#style - */ - SINGLE_ROW, - /** - * Style specifier describing a component arrangement strategy that places components above each other in a single column. - * If combined with the style modifier - * {@link yfiles.layout.ComponentArrangementStyles#MODIFIER_AS_IS}, components will be placed in the same order as they were placed - * before the layout. - * @see yfiles.layout.ComponentLayout#style - */ - SINGLE_COLUMN, - /** - * Style specifier describing a component arrangement strategy that places components in a rectangular cloud around the - * biggest component. Entities of different components will not overlap, however the bounding boxes of the components may - * overlap. - *

- * The aspect ratio of the rectangle is defined by the {@link yfiles.layout.ComponentLayout#preferredSize preferred size} of the graph. - *

- * @see yfiles.layout.ComponentLayout#style - * @see yfiles.layout.ComponentLayout#preferredSize - */ - PACKED_RECTANGLE, - /** - * Style specifier describing a component arrangement strategy that places components in a rectangular cloud around the - * biggest component. Entities of different components will not overlap, however the bounding boxes of the components may - * overlap. - *

- * In contrast to - * {@link yfiles.layout.ComponentArrangementStyles#PACKED_RECTANGLE}, components might even be placed in empty spaces inside other - * components. - *

- *

- * The aspect ratio of the rectangle is defined by the {@link yfiles.layout.ComponentLayout#preferredSize preferred size} of the graph. - *

- * @see yfiles.layout.ComponentLayout#style - * @see yfiles.layout.ComponentLayout#preferredSize - */ - PACKED_COMPACT_RECTANGLE, - /** - * Style specifier describing a component arrangement strategy that places components in a circular cloud around the - * biggest component. Entities of different components will not overlap, however the bounding boxes of the components may - * overlap. - * @see yfiles.layout.ComponentLayout#style - */ - PACKED_CIRCLE, - /** - * Style specifier describing a component arrangement strategy that places components in a circular compact cloud around - * the biggest component. Entities of different components will not overlap, however the bounding boxes of the components - * may overlap. - *

- * In contrast to - * {@link yfiles.layout.ComponentArrangementStyles#PACKED_CIRCLE}, components might even be placed in empty spaces inside other - * components. - *

- * @see yfiles.layout.ComponentLayout#style - */ - PACKED_COMPACT_CIRCLE, - /** - * Style specifier describing a component arrangement strategy that places components in multiple rows. - *

- * The strategy tries to arrange the components such that the aspect ratio of the final component placement gets as close - * as possible to the aspect ratio of the preferred layout size, configurable using {@link yfiles.layout.ComponentLayout#preferredSize}. - *

- *

- * In contrast to - * {@link yfiles.layout.ComponentArrangementStyles#ROWS}, each row may also be divided into further sub-rows, which is especially - * useful if there are few very large components and many significantly smaller ones. - *

- * @see yfiles.layout.ComponentLayout#style - * @see yfiles.layout.ComponentLayout#preferredSize - */ - MULTI_ROWS, - /** - * Style specifier describing a component arrangement strategy that places components in multiple rows. - *

- * The strategy tries to arrange the components such that the aspect ratio of the final component placement gets close to - * the aspect ratio of the preferred layout size, configurable using {@link yfiles.layout.ComponentLayout#preferredSize}. But in contrast to - * {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS}, this strategy does not always try to come as close to the preferred - * view ratio, if a ratio close to the preferred ratio only induces a lot of unused view space. This unused space will be - * minimized. - *

- *

- * In contrast to - * {@link yfiles.layout.ComponentArrangementStyles#ROWS}, each row may also be divided into further sub-rows, which is especially - * useful if there are few very large components and many significantly smaller ones. - *

- * @see yfiles.layout.ComponentLayout#style - * @see yfiles.layout.ComponentLayout#preferredSize - */ - MULTI_ROWS_COMPACT, - /** - * Style specifier describing a component arrangement strategy that places the components in {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS} - * with a restricted height. The resulting height does not exceed the preferred height ({@link yfiles.layout.ComponentLayout#preferredSize}). - *

- * In contrast to - * {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS_HEIGHT_CONSTRAINT_COMPACT}, the result will be an arrangement which - * uses as much height as possible, even if that means that all components will be arranged in one single column. - *

- * @see yfiles.layout.ComponentLayout#style - * @see yfiles.layout.ComponentLayout#preferredSize - */ - MULTI_ROWS_HEIGHT_CONSTRAINT, - /** - * Style specifier describing a component arrangement strategy that places the components in {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS} - * with a restricted height and as compact as possible. The resulting height does not exceed the preferred height ({@link yfiles.layout.ComponentLayout#preferredSize}). - *

- * In comparison with - * {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS_HEIGHT_CONSTRAINT}, the result will be compacted, which means that an - * arrangement with the minimum width such that the height constraint is still fulfilled will be realized. - *

- * @see yfiles.layout.ComponentLayout#style - * @see yfiles.layout.ComponentLayout#preferredSize - */ - MULTI_ROWS_HEIGHT_CONSTRAINT_COMPACT, - /** - * Style specifier describing a component arrangement strategy that places the components in {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS} - * with a restricted width. The resulting width does not exceed the preferred width ({@link yfiles.layout.ComponentLayout#preferredSize}). - *

- * In contrast to {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS_WIDTH_CONSTRAINT_COMPACT} the result will be an - * arrangement which uses as much space in width as possible, even if that means that all components will be arranged in a - * single row. - *

- * @see yfiles.layout.ComponentLayout#style - * @see yfiles.layout.ComponentLayout#preferredSize - */ - MULTI_ROWS_WIDTH_CONSTRAINT, - /** - * Style specifier describing a component arrangement strategy that places the components in {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS} - * with a restricted width and as compact as possible. The resulting width does not exceed the preferred width ({@link yfiles.layout.ComponentLayout#preferredSize}). - *

- * In comparison with {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS_HEIGHT_CONSTRAINT} the result will be compacted, - * in order to minimize unused view space induced by components that are large in height. - *

- * @see yfiles.layout.ComponentLayout#style - * @see yfiles.layout.ComponentLayout#preferredSize - */ - MULTI_ROWS_WIDTH_CONSTRAINT_COMPACT, - /** - * A constant for masking actual style constants from style modifiers. - * @see yfiles.layout.ComponentLayout#style - */ - MASK, - /** - * A modifier that can be added to normal style specifiers to indicate that the arrangement strategy should take the - * initial positions of the components into account. - *

- * Combining this modifier is supported with the following styles: {@link yfiles.layout.ComponentArrangementStyles#SINGLE_ROW}, - * {@link yfiles.layout.ComponentArrangementStyles#SINGLE_COLUMN}, {@link yfiles.layout.ComponentArrangementStyles#PACKED_RECTANGLE}, - * {@link yfiles.layout.ComponentArrangementStyles#PACKED_COMPACT_RECTANGLE}, {@link yfiles.layout.ComponentArrangementStyles#PACKED_CIRCLE} - * and {@link yfiles.layout.ComponentArrangementStyles#PACKED_COMPACT_CIRCLE}. - *

- * @see yfiles.layout.ComponentLayout#style - */ - MODIFIER_AS_IS, - /** - * A modifier that can be added to normal style specifiers to indicate that the arrangement strategy should produce a - * non-overlapping component layout. - *

- * Combining this modifier is not supported with {@link yfiles.layout.ComponentArrangementStyles#NONE}. - *

- * @see yfiles.layout.ComponentLayout#style - */ - MODIFIER_NO_OVERLAP - } - export enum DiscreteEdgeLabelPositions{ - /** - * Position specifier that describes a label placement near the source, left/above the edge's path. - */ - SOURCE_HEAD, - /** - * Position specifier that describes a label placement near the middle of the edge, left/above the edge's path. - */ - HEAD, - /** - * Position specifier that describes a label placement near the target, left/above the edge's path. - */ - TARGET_HEAD, - /** - * Position specifier that describes a label placement near the source, right/below the edge's path. - */ - SOURCE_TAIL, - /** - * Position specifier that describes a label placement near the middle of the edge, right/below the edge's path. - */ - TAIL, - /** - * Position specifier that describes a label placement near the target, right/below the edge's path. - */ - TARGET_TAIL, - /** - * Position specifier that describes a label placement near the source, directly on the edge's path. - */ - SOURCE_CENTER, - /** - * Position specifier that describes a label placement near the middle of the edge, directly on the edge's path. - */ - CENTER, - /** - * Position specifier that describes a label placement near the target, directly on the edge's path. - */ - TARGET_CENTER, - /** - * Position mask that constrains the allowed positions to the two locations near the middle of the edge beside the edge's - * path. - * @see yfiles.layout.DiscreteEdgeLabelPositions#HEAD - * @see yfiles.layout.DiscreteEdgeLabelPositions#TAIL - */ - TWO_POS, - /** - * Position mask that constrains the allowed positions to the {@link yfiles.layout.DiscreteEdgeLabelPositions#CENTER} of the edge's - * path. - * @see yfiles.layout.DiscreteEdgeLabelPositions#CENTER - */ - CENTERED, - /** - * Position mask that constrains the allowed positions to a set of six positions beside the edge path. - *

- * Two of the positions are near the source and two others are near the target. The remaining positions are in the middle - * of the edge. - *

- * @see yfiles.layout.DiscreteEdgeLabelPositions#SOURCE_HEAD - * @see yfiles.layout.DiscreteEdgeLabelPositions#SOURCE_TAIL - * @see yfiles.layout.DiscreteEdgeLabelPositions#HEAD - * @see yfiles.layout.DiscreteEdgeLabelPositions#TAIL - * @see yfiles.layout.DiscreteEdgeLabelPositions#TARGET_HEAD - * @see yfiles.layout.DiscreteEdgeLabelPositions#TARGET_TAIL - */ - SIX_POS, - /** - * Position mask that constrains the allowed positions to a set of three positions directly on the edge's path. - * @see yfiles.layout.DiscreteEdgeLabelPositions#SOURCE_CENTER - * @see yfiles.layout.DiscreteEdgeLabelPositions#CENTER - * @see yfiles.layout.DiscreteEdgeLabelPositions#TARGET_CENTER - */ - THREE_CENTER - } - export enum DiscreteNodeLabelPositions{ - /** - * Position specifier that describes a label placement north of the node. - */ - NORTH, - /** - * Position specifier that describes a label placement north-west of the node. - */ - NORTH_WEST, - /** - * Position specifier that describes a label placement north-east of the node. - */ - NORTH_EAST, - /** - * Position specifier that describes a label placement east of the node. - */ - EAST, - /** - * Position specifier that describes a label placement west of the node. - */ - WEST, - /** - * Position specifier that describes a label placement south of the node. - */ - SOUTH, - /** - * Position specifier that describes a label placement south-west of the node. - */ - SOUTH_WEST, - /** - * Position specifier that describes a label placement south-east of the node. - */ - SOUTH_EAST, - /** - * Position specifier that describes a label placement at the center of the node. - */ - CENTER, - /** - * Position specifier that describes a label placement at the bottom inside the node. - */ - BOTTOM, - /** - * Position specifier that describes a label placement at the top inside the node. - */ - TOP, - /** - * Position specifier that describes a label placement at the left inside the node. - */ - LEFT, - /** - * Position specifier that describes a label placement at the right inside the node. - */ - RIGHT, - /** - * Position specifier that describes a label placement at the top-left inside the node. - */ - TOP_LEFT, - /** - * Position specifier that describes a label placement at the top-right inside the node. - */ - TOP_RIGHT, - /** - * Position specifier that describes a label placement at the bottom-left inside the node. - */ - BOTTOM_LEFT, - /** - * Position specifier that describes a label placement at the bottom-right inside the node. - */ - BOTTOM_RIGHT, - /** - * Position mask that constrains the positions to {@link yfiles.layout.DiscreteNodeLabelPositions#NORTH above} and {@link yfiles.layout.DiscreteNodeLabelPositions#SOUTH below} the node. - * @see yfiles.layout.DiscreteNodeLabelPositions#NORTH - * @see yfiles.layout.DiscreteNodeLabelPositions#SOUTH - */ - SANDWICH_MASK, - /** - * Position mask that constrains the positions to the nine node-internal positions. - * @see yfiles.layout.DiscreteNodeLabelPositions#CENTER - * @see yfiles.layout.DiscreteNodeLabelPositions#TOP - * @see yfiles.layout.DiscreteNodeLabelPositions#BOTTOM - * @see yfiles.layout.DiscreteNodeLabelPositions#LEFT - * @see yfiles.layout.DiscreteNodeLabelPositions#RIGHT - * @see yfiles.layout.DiscreteNodeLabelPositions#TOP_LEFT - * @see yfiles.layout.DiscreteNodeLabelPositions#TOP_RIGHT - * @see yfiles.layout.DiscreteNodeLabelPositions#BOTTOM_LEFT - * @see yfiles.layout.DiscreteNodeLabelPositions#BOTTOM_RIGHT - */ - INTERNAL_MASK, - /** - * Position mask that constrains the positions to the node's four sides. - * @see yfiles.layout.DiscreteNodeLabelPositions#EAST - * @see yfiles.layout.DiscreteNodeLabelPositions#WEST - * @see yfiles.layout.DiscreteNodeLabelPositions#NORTH - * @see yfiles.layout.DiscreteNodeLabelPositions#SOUTH - */ - SIDES_MASK, - /** - * Position mask that constrains the positions to the corners outside the node. - * @see yfiles.layout.DiscreteNodeLabelPositions#NORTH_EAST - * @see yfiles.layout.DiscreteNodeLabelPositions#NORTH_WEST - * @see yfiles.layout.DiscreteNodeLabelPositions#SOUTH_EAST - * @see yfiles.layout.DiscreteNodeLabelPositions#SOUTH_WEST - */ - CORNER_MASK, - /** - * Position mask that constraints the positions to the eight node-external positions. - * @see yfiles.layout.DiscreteNodeLabelPositions#NORTH - * @see yfiles.layout.DiscreteNodeLabelPositions#EAST - * @see yfiles.layout.DiscreteNodeLabelPositions#SOUTH - * @see yfiles.layout.DiscreteNodeLabelPositions#WEST - * @see yfiles.layout.DiscreteNodeLabelPositions#NORTH_EAST - * @see yfiles.layout.DiscreteNodeLabelPositions#NORTH_WEST - * @see yfiles.layout.DiscreteNodeLabelPositions#SOUTH_EAST - * @see yfiles.layout.DiscreteNodeLabelPositions#SOUTH_WEST - */ - EIGHT_POS_MASK - } - export enum FixPointPolicy{ - /** - * Fix point calculation policy specifying that the center of a rectangle containing all fixed nodes is considered the fix - * point. - * @see yfiles.layout.FixNodeLayoutStage#fixPointPolicy - */ - CENTER, - /** - * Fix point calculation policy specifying that the upper left corner of a rectangle containing all fixed nodes is considered the fix - * point. - * @see yfiles.layout.FixNodeLayoutStage#fixPointPolicy - */ - UPPER_LEFT, - /** - * Fix point calculation policy specifying that the upper right corner of a rectangle containing all fixed nodes is considered the fix - * point. - * @see yfiles.layout.FixNodeLayoutStage#fixPointPolicy - */ - UPPER_RIGHT, - /** - * Fix point calculation policy specifying that the lower right corner of a rectangle containing all fixed nodes is considered the fix - * point. - * @see yfiles.layout.FixNodeLayoutStage#fixPointPolicy - */ - LOWER_RIGHT, - /** - * Fix point calculation policy specifying that the lower left corner of a rectangle containing all fixed nodes is considered the fix - * point. - * @see yfiles.layout.FixNodeLayoutStage#fixPointPolicy - */ - LOWER_LEFT - } - export enum LabelPlacements{ - /** - * Preferred placement specifier for edge labels which expresses that the label should be placed near the source node of an - * edge. - */ - AT_SOURCE, - /** - * Preferred placement specifier for edge labels which expresses that the label should be placed near the target node of an - * edge. - */ - AT_TARGET, - /** - * Preferred placement specifier for edge labels which expresses that the label should be placed near the center of the - * edge path. - */ - AT_CENTER, - /** - * Preferred placement specifier for edge labels which expresses that the label should be placed directly at the source - * port of the edge. - */ - AT_SOURCE_PORT, - /** - * Preferred placement specifier for edge labels which expresses that the label should be placed directly at the target - * port of the edge. - */ - AT_TARGET_PORT, - /** - * Placement specifier mask that masks all placement specifiers that describe the placement along the edge. - */ - ALONG_EDGE_MASK, - /** - * Preferred placement specifier for edge labels which expresses that the label should be placed on the path of the edge. - */ - ON_EDGE, - /** - * Preferred placement specifier for edge labels which expresses that the label should be placed on the left hand side of - * the edge path. - *

- * The side is interpreted relative to the direction of the edge, if no different {@link yfiles.layout.PreferredPlacementDescriptor#sideReference side reference} is defined. - *

- */ - LEFT_OF_EDGE, - /** - * Preferred placement specifier for edge labels which expresses that the label should be placed on the right hand side of - * the edge path. - *

- * The side is interpreted relative to the direction of the edge, if no different {@link yfiles.layout.PreferredPlacementDescriptor#sideReference side reference} is defined. - *

- */ - RIGHT_OF_EDGE, - /** - * Placement specifier mask that masks all placement specifiers that describe the side of the edge. - */ - ON_SIDE_OF_EDGE_MASK, - /** - * Preferred placement specifier for edge labels which expresses that the label can be placed anywhere along the edge or on - * any side of the edge. - */ - ANYWHERE - } - export enum LayoutOrientation{ - /** - * Orientation specifier which defines that the main layout orientation is from top to bottom. This is the default for all - * layout algorithms. - */ - TOP_TO_BOTTOM, - /** - * Orientation specifier which defines that the main layout orientation is from left to right. The layout will be rotated - * by 90 degrees counterclockwise. - */ - LEFT_TO_RIGHT, - /** - * Orientation specifier which defines that the main layout orientation is from right to left. The layout will be rotated - * by 90 degrees clockwise. - */ - RIGHT_TO_LEFT, - /** - * Orientation specifier which defines that the main layout orientation is from bottom to top. The layout will be flipped - * along the x-axis. - */ - BOTTOM_TO_TOP - } - export enum RowAlignment{ - /** - * Row alignment specifier which defines that each row will be aligned with its left border. - * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleRows - */ - LEADING, - /** - * Row alignment specifier which defines that each row will be aligned with its right border. - * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleRows - */ - TRAILING, - /** - * Row alignment specifier which defines that each row will be aligned with its left border and its right border. - *

- * Rectangles in smaller rows will be distributed over the row, so that the row aligns with both sides. - *

- * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleRows - */ - JUSTIFIED, - /** - * Row alignment specifier which defines that each row will be aligned with its center. - * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleRows - */ - CENTER - } - export enum MultiRowConstraint{ - /** - * Constraint specifier for a multi-row rectangle arrangement that is unconstrained. Both, height and width, are not - * limited in size. The rectangles will be arranged in a way that the view ratio defined by the preferred height and width - * will be achieved. - * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleMultiRows - */ - NONE, - /** - * Constraint specifier for a multi-row rectangle arrangement that constrains the height of the layout. Limits the height - * of the arrangement to the given preferred height value. If some rectangles are higher than allowed, then they are placed - * nevertheless, but the constraint will still be considered for the rest and not weakened to the height of the higher - * rectangles. Having one rectangle being higher than the constraint does always result in arrangements consisting only of - * a single top-level row. - * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleMultiRows - */ - HEIGHT, - /** - * Constraint specifier for a multi-row rectangle arrangement that constrains the width of the layout. Limits the width of - * the arrangement to the given preferred width value. If a rectangle is wider than allowed, then it will nevertheless be - * placed (in a row containing the rectangle alone), but the constraint will be still considered for other rows and not - * weakened. - * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleMultiRows - */ - WIDTH - } - export enum EdgeFlow{ - /** - * Edge flow specifier which defines that the flow direction of most edges is up. - * @see yfiles.layout.LayoutGraphUtilities#determineEdgeFlowDirection - */ - UP, - /** - * Edge flow specifier which defines that the flow direction of most edges is down. - * @see yfiles.layout.LayoutGraphUtilities#determineEdgeFlowDirection - */ - DOWN, - /** - * Edge flow specifier which defines that the flow direction of most edges is left. - * @see yfiles.layout.LayoutGraphUtilities#determineEdgeFlowDirection - */ - LEFT, - /** - * Edge flow specifier which defines that the flow direction of most edges is right. - * @see yfiles.layout.LayoutGraphUtilities#determineEdgeFlowDirection - */ - RIGHT, - /** - * Edge flow specifier that defines that there is no main flow direction. - * @see yfiles.layout.LayoutGraphUtilities#determineEdgeFlowDirection - */ - NONE - } - export enum NodeAlignment{ - /** - * Node alignment policy that results in top-aligned nodes for vertical alignment and left-aligned nodes for horizontal - * alignments. - * @see yfiles.layout.LayoutGraphUtilities#alignNodeLayouts - */ - LEADING, - /** - * Node alignment policy that results in center-aligned nodes. - * @see yfiles.layout.LayoutGraphUtilities#alignNodeLayouts - */ - CENTERED, - /** - * Node alignment policy that results in bottom-aligned nodes for vertical alignment and right-aligned nodes for horizontal - * alignments. - * @see yfiles.layout.LayoutGraphUtilities#alignNodeLayouts - */ - TRAILING, - /** - * Node alignment policy that results in vertically or horizontally distributed nodes. In this context, distributed means that the - * vertical (or horizontal) extensions of nodes do not overlap, independent of their horizontal (or vertical) position. - * @see yfiles.layout.LayoutGraphUtilities#alignNodeLayouts - */ - DISTRIBUTED - } - export enum MirrorModes{ - /** - * Mirroring specifier that can be used for preventing any mirroring of layout orientations. - * @see yfiles.layout.OrientationLayout#mirrorMode - * @see yfiles.layout.OrientationLayout#orientation - */ - NONE, - /** - * Mirroring specifier that defines that layout orientation {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} will be - * mirrored. - *

- * This specifier can be used for creating a mirror mask that defines which layout orientations shall be mirrored at their - * corresponding axis. It can be combined with the other mirroring specifiers to mirror several orientations. - *

- * @see yfiles.layout.OrientationLayout#mirrorMode - * @see yfiles.layout.OrientationLayout#orientation - */ - TOP_TO_BOTTOM, - /** - * Mirroring specifier that defines that layout orientation {@link yfiles.layout.LayoutOrientation#RIGHT_TO_LEFT} will be - * mirrored. - *

- * This specifier can be used for creating a mirror mask that defines which layout orientations shall be mirrored at their - * corresponding axis. It can be combined with the other mirroring specifiers to mirror several orientations. - *

- * @see yfiles.layout.OrientationLayout#mirrorMode - * @see yfiles.layout.OrientationLayout#orientation - */ - RIGHT_TO_LEFT, - /** - * Mirroring specifier that defines that layout orientation {@link yfiles.layout.LayoutOrientation#BOTTOM_TO_TOP} will be - * mirrored. - *

- * This specifier can be used for creating a mirror mask that defines which layout orientations shall be mirrored at their - * corresponding axis. It can be combined with the other mirroring specifiers to mirror several orientations. - *

- * @see yfiles.layout.OrientationLayout#mirrorMode - * @see yfiles.layout.OrientationLayout#orientation - */ - BOTTOM_TO_TOP, - /** - * Mirroring specifier that defines that layout orientation {@link yfiles.layout.LayoutOrientation#LEFT_TO_RIGHT} will be - * mirrored. - *

- * This specifier can be used to create a mirror mask that defines which layout orientations shall be mirrored at their - * corresponding axis. It can be combined with the other mirroring specifiers to mirror several orientations. - *

- * @see yfiles.layout.OrientationLayout#mirrorMode - * @see yfiles.layout.OrientationLayout#orientation - */ - LEFT_TO_RIGHT - } - export enum PortDirections{ - /** - * A port direction specifier indicating a port on the north (i.e., top) side of a node. - */ - NORTH, - /** - * A port direction specifier indicating a port on the east (i.e., right) side of a node. - */ - EAST, - /** - * A port direction specifier indicating a port on the west (i.e., left) side of a node. - */ - WEST, - /** - * A port direction specifier indicating a port on the south (i.e., bottom) side of a node. - */ - SOUTH, - /** - * A port direction specifier indicating a port lying in the direction of the main flow of the edge or of the overall - * layout. - *

- * The exact direction is domain-specific. - *

- */ - WITH_THE_FLOW, - /** - * A port direction specifier indicating a port lying in the opposite direction of the main flow of the edge or of the - * overall layout. - *

- * The exact direction is domain-specific. - *

- */ - AGAINST_THE_FLOW, - /** - * A port direction specifier indicating a port lying left of the direction of the main flow of the edge or of the overall - * layout. - *

- * The exact direction is domain-specific. - *

- */ - LEFT_IN_FLOW, - /** - * A port direction specifier indicating a port lying right of the direction of the main flow of the edge or of the overall - * layout. - *

- * The exact direction is domain-specific. - *

- */ - RIGHT_IN_FLOW, - /** - * A combination of all possible direction specifiers indicating that edges can connect to any side of a node. - */ - ANY - } - export enum PortSide{ - /** - * A weak constraint indicating that edges can connect to any side of a node. - * @see yfiles.layout.PortConstraint#create - */ - ANY, - /** - * A weak constraint indicating that edges can connect to the north side (i.e. top side) of a node. - * @see yfiles.layout.PortConstraint#create - */ - NORTH, - /** - * A weak constraint indicating that edges can connect to the south side (i.e. bottom side) of a node. - * @see yfiles.layout.PortConstraint#create - */ - SOUTH, - /** - * A weak constraint indicating that edges can connect to the east side (i.e. right side) of a node. - * @see yfiles.layout.PortConstraint#create - */ - EAST, - /** - * A weak constraint indicating that edges can connect to the west side (i.e. left side) of a node. - * @see yfiles.layout.PortConstraint#create - */ - WEST - } - export enum LabelSideReferences{ - /** - * Side placement specifier for edge labels which expresses that the preferred side of the edge is interpreted relative to - * the edge flow. - * @see yfiles.layout.PreferredPlacementDescriptor#sideReference - * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge - */ - RELATIVE_TO_EDGE_FLOW, - /** - * Side placement specifier for edge labels which defines that the preferred side for the label is interpreted - * independently of the edge direction placing {@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE left labels} above horizontal segments. - *

- * For vertical segments the label is placed {@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE left} or {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE right} of the edge. In case the segment is horizontal, the label is - * placed above the segment if it should be left of the edge, otherwise below the segment. - *

- * @see yfiles.layout.PreferredPlacementDescriptor#sideReference - * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge - */ - ABSOLUTE_WITH_LEFT_IN_NORTH, - /** - * Side placement specifier for edge labels which defines that the preferred side for the label is interpreted - * independently of the edge direction placing {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE left labels} above horizontal segments. - *

- * For vertical segments the label is placed {@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE left} or {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE right} of the edge. In case the segment is horizontal, the label is - * placed above the segment if it should be right of the edge, otherwise below the segment. - *

- * @see yfiles.layout.PreferredPlacementDescriptor#sideReference - * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge - */ - ABSOLUTE_WITH_RIGHT_IN_NORTH - } - export enum LabelAngleReferences{ - /** - * Angle interpretation specifier for edge labels which expresses that the rotation angle should be interpreted absolute - * and not relative to the edge slope. - * @see yfiles.layout.PreferredPlacementDescriptor#angleReference - * @see yfiles.layout.PreferredPlacementDescriptor#angle - */ - ABSOLUTE, - /** - * Angle interpretation specifier for edge labels which expresses that the rotation angle should be interpreted relative to - * the edge slope. - * @see yfiles.layout.PreferredPlacementDescriptor#angleReference - * @see yfiles.layout.PreferredPlacementDescriptor#angle - */ - RELATIVE_TO_EDGE_FLOW - } - export enum LabelAngleOnRightSideRotations{ - /** - * Angle interpretation specifier which expresses that the rotation angle should be interpreted clockwise. - *

- * Therefore, edge labels whose descriptor {@link yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge} will be co-rotating with the angle of labels that are placed left of or - * centered on the edge. - *

- * @see yfiles.layout.PreferredPlacementDescriptor#angleRotationOnRightSide - * @see yfiles.layout.PreferredPlacementDescriptor#angle - * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge - */ - CLOCKWISE, - /** - * Angle interpretation specifier which expresses that the rotation angle should be interpreted counter-clockwise. - *

- * Therefore, edge labels whose descriptor {@link yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge} will be counter-rotating with the angle of labels that are placed left of or - * centered on the edge. - *

- * @see yfiles.layout.PreferredPlacementDescriptor#angleRotationOnRightSide - * @see yfiles.layout.PreferredPlacementDescriptor#angle - * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge - */ - COUNTER_CLOCKWISE - } - export enum LabelAngleOnRightSideOffsets{ - /** - * Angle offset specifier for edge labels which expresses that no additional offset should be added to the angle. - * @see yfiles.layout.PreferredPlacementDescriptor#angleOffsetOnRightSide - * @see yfiles.layout.PreferredPlacementDescriptor#angle - * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge - */ - NONE, - /** - * Angle offset specifier for edge labels which expresses that an additional offset of 180 degrees should be added to the - * angle. That way, point-symmetric label placements left and right of the edge can be attained. - * @see yfiles.layout.PreferredPlacementDescriptor#angleOffsetOnRightSide - * @see yfiles.layout.PreferredPlacementDescriptor#angle - * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge - */ - SEMI - } - export enum SliderMode{ - /** - * Slider mode specifier which describes continuous label positions directly on the edge path. - * @see yfiles.layout.SliderEdgeLabelLayoutModel#mode - */ - CENTER, - /** - * Slider mode specifier which describes continuous label positions along the sides of the edge path. - * @see yfiles.layout.SliderEdgeLabelLayoutModel#mode - */ - SIDE, - /** - * Slider mode specifier which describes continuous label positions along one side of the edge path. - * @see yfiles.layout.SliderEdgeLabelLayoutModel#mode - */ - SINGLE_SIDE - } - export enum SelfLoopStyle{ - /** - * Self-loop style specifier which defines that the routes of self-loops are orthogonal. - *

- * The routes consist of an alternating sequence of horizontal and vertical line segments. - *

- * @see yfiles.layout.SelfLoopRouter#layoutStyle - */ - ORTHOGONAL, - /** - * Self-loop style specifier which defines that the routes of self-loops are rounded. - *

- * The {@link yfiles.layout.SelfLoopRouter#lineDistance distance between incident self-loops} and {@link yfiles.layout.SelfLoopRouter#cornerApproximationPointsCount rounding of the corners} can be customized for rounded self-loops. - *

- * @see yfiles.layout.SelfLoopRouter#layoutStyle - * @see yfiles.layout.SelfLoopRouter#lineDistance - * @see yfiles.layout.SelfLoopRouter#cornerApproximationPointsCount - */ - ROUNDED - } - export enum SwimlanesMode{ - /** - * Swimlane ordering mode specifier defining that node grouping is ignored during the swimlane ordering optimization. - * @see yfiles.layout.Swimlanes#arrangeSwimlanes - */ - IGNORE_GROUPS, - /** - * Swimlane ordering mode specifier defining that only node grouping is considered during the swimlane ordering - * optimization. - * @see yfiles.layout.Swimlanes#arrangeSwimlanes - */ - ONLY_GROUPS, - /** - * Swimlane ordering mode specifier defining that both node grouping and edge length are considered during the swimlane - * ordering optimization. - * @see yfiles.layout.Swimlanes#arrangeSwimlanes - */ - MIXED - } - /** - * {@link yfiles.layout.GraphLayoutLineWrapper} can line-wrap or column-wrap a graph layout. - *

- * This {@link yfiles.layout.ILayoutStage} supports both wrapping a layout at a given width (height) and wrapping a layout - * automatically at some width (height) such that the resulting overall aspect ratio is close to a desired {@link yfiles.layout.GraphLayoutLineWrapper#targetRatio target ratio}. - *

- *

- * The {@link yfiles.layout.GraphLayoutLineWrapper} can be used on an existing graph layout or on the result of the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface GraphLayoutLineWrapper extends yfiles.layout.LayoutStageBase{} - export class GraphLayoutLineWrapper { - /** - * Creates a new {@link yfiles.layout.GraphLayoutLineWrapper} instance with default settings. - */ - constructor(); - /** - * Gets or sets the space that should be kept between edges. - *

- * The spacing must be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given spacing is a negative value - * @type {number} - */ - edgeSpacing:number; - /** - * Gets or sets whether this {@link yfiles.layout.ILayoutStage} wraps lines/rows or columns. - *

- * If this mode is enabled, the layout is wrapped vertically and new columns are appended to the right of the first column. - * Otherwise, the layout is wrapped horizontally and new rows are appended below the first row. - *

- *

- * Also, the {@link yfiles.layout.GraphLayoutLineWrapper#fixedWidth} property will be interpreted as a fixed height if this mode is enabled. - *

- * @see yfiles.layout.GraphLayoutLineWrapper#fixedWidth - * @type {boolean} - */ - columnMode:boolean; - /** - * Gets or sets the space between adjacent lines of the wrapped graph layout. - *

- * If the {@link yfiles.layout.GraphLayoutLineWrapper#columnMode column mode} is enabled, this spacing defines the distance between adjacent columns. - *

- *

- * The spacing should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the spacing is negative - * @type {number} - */ - spacing:number; - /** - * Gets or sets whether or not every other line is mirrored. - *

- * When breaking a line and placing the remaining line below, this remainder can be rotated by 180 degrees. Then, the edges - * connecting both lines - * stay short. In case the remainder is not rotated, the edges are routed between the two lines to connect to the front of the - * non-mirrored line. - *

- * @type {boolean} - */ - mirror:boolean; - /** - * Gets or sets whether the algorithm should use the {@link yfiles.layout.GraphLayoutLineWrapper#fixedWidth fixed width} or {@link yfiles.layout.GraphLayoutLineWrapper#targetRatio target aspect ratio} to determine line breaks. - * @see yfiles.layout.GraphLayoutLineWrapper#fixedWidth - * @see yfiles.layout.GraphLayoutLineWrapper#targetRatio - * @type {boolean} - */ - fixedWidthLineBreaks:boolean; - /** - * Gets or sets the desired target aspect ratio for the layout. - *

- * The aspect ratio needs to be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the target ratio is 0 or less - * @see yfiles.layout.GraphLayoutLineWrapper#fixedWidthLineBreaks - * @type {number} - */ - targetRatio:number; - /** - * Gets or sets the desired width of the lines. - *

- * The {@link yfiles.layout.GraphLayoutLineWrapper} breaks the lines at the specified width. - *

- *

- * In {@link yfiles.layout.GraphLayoutLineWrapper#columnMode column mode}, the fixed width is interpreted as fixed height for a column. - *

- * @see yfiles.layout.GraphLayoutLineWrapper#fixedWidthLineBreaks - * @see yfiles.layout.GraphLayoutLineWrapper#columnMode - * @type {number} - */ - fixedWidth:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.GraphLayoutLineWrapper; - } - /** - * This class represents a column of a {@link yfiles.layout.PartitionGrid partition grid} structure. - *

- * The results of the calculation of the geometry of the column will be placed into the instances of this class after the - * layout. - *

- * @see yfiles.layout.PartitionGrid - * @class - * @implements {yfiles.lang.IComparable} - */ - export interface ColumnDescriptor extends yfiles.lang.Object,yfiles.lang.IComparable{} - export class ColumnDescriptor { - /** - * Compares this {@link yfiles.layout.ColumnDescriptor} instance with a given other {@link yfiles.layout.ColumnDescriptor} instance based - * on the indices of the two instances. - * @param o the {@link } to compare to - * @returns -1, 0 or 1 if this {@link } is less than, equal to, or greater than the given other - * {@link } - */ - compareTo(o:any):number; - /** - * Gets the index of the column within the {@link yfiles.layout.PartitionGrid partition grid}. - * @type {number} - */ - index:number; - /** - * Gets or sets the minimum width of the column. - *

- * The minimum width is defined to be at least 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum width is negative - * @type {number} - */ - minimumWidth:number; - /** - * Gets or sets the left column inset in which no element will lie in the resulting layout. - *

- * The column inset must be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the left inset is negative - * @type {number} - */ - leftInset:number; - /** - * Gets or sets the right column inset in which no element will lie in the resulting layout. - *

- * The column inset must be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the right inset is negative - * @type {number} - */ - rightInset:number; - /** - * Gets or sets the computed width of the column after the layout has been calculated. - *

- * The computed width needs to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the computed width is negative - * @type {number} - */ - computedWidth:number; - /** - * Gets or sets the original width of the column. - *

- * The original width should be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the original width is negative - * @type {number} - */ - originalWidth:number; - /** - * Gets or sets the original position (smallest x-coordinate) of the column. - * @type {number} - */ - originalPosition:number; - /** - * Gets or sets the computed position (smallest x-coordinate) of the column after the layout has been calculated. - * @type {number} - */ - computedPosition:number; - /** - * Gets or sets the tightness factor of this column. - *

- * This value must lie within the interval [0,1]. - *

- *

- * The larger the value, the more the column will be forced to obtain its minimum width: - *

- *
    - *
  • a value of 0.0d will disable the compression of the column.
  • - *
  • a value of 1.0d will try to force the column to obtain its specified {@link yfiles.layout.ColumnDescriptor#minimumWidth minimum width}.
  • - *
- * @throws {Stubs.Exceptions.ArgumentError} if the tightness value is outside the interval [0,1] - * @type {number} - */ - tightness:number; - /** - * Gets or sets whether the index of the column is fixed or it should be chosen automatically in order to minimize edge - * lengths. - *

- * For all columns where this property is enabled, the relative ordering given by the indices is preserved. The remaining - * columns may be sorted again so that the overall edge lengths are minimized. - *

- * @type {boolean} - */ - indexFixed:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ColumnDescriptor; - } - /** - * This class represents a single partition cell, i.e., a pair consisting of a row and a column. - * @class - * @implements {yfiles.lang.IComparable} - * @final - */ - export interface PartitionCellIdEntry extends yfiles.lang.Object,yfiles.lang.IComparable{} - export class PartitionCellIdEntry { - /** - * Compares this {@link yfiles.layout.PartitionCellIdEntry} instance with a given other {@link yfiles.layout.PartitionCellIdEntry} - * instance. - *

- * The comparison is based on the indices of the {@link yfiles.layout.PartitionCellIdEntry#row rows} and {@link yfiles.layout.PartitionCellIdEntry#column columns} of the two pairs. A {@link yfiles.layout.PartitionCellIdEntry} is - * considered to be smaller than another pair if its {@link yfiles.layout.RowDescriptor#index row index} is smaller than the row index of the other pair. If the row - * indices are equal, the {@link yfiles.layout.PartitionCellIdEntry} with the smaller {@link yfiles.layout.ColumnDescriptor#index column index} is said to be smaller. Hence, - * two {@link yfiles.layout.PartitionCellIdEntry} instances are equal, if the row and column indices are equal. - *

- * @param o the {@link } to be compared - * @returns -1, 0 or 1 if this {@link } is smaller than, equal to, or greater than the given other {@link } - * instance - */ - compareTo(o:any):number; - /** - * Gets the {@link yfiles.layout.RowDescriptor} associated with this {@link yfiles.layout.PartitionCellId partition cell}. - * @type {yfiles.layout.RowDescriptor} - */ - row:yfiles.layout.RowDescriptor; - /** - * Gets the {@link yfiles.layout.ColumnDescriptor} associated with this {@link yfiles.layout.PartitionCellId partition cell}. - * @type {yfiles.layout.ColumnDescriptor} - */ - column:yfiles.layout.ColumnDescriptor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PartitionCellIdEntry; - } - /** - * {@link yfiles.layout.PartitionCellId} represents an identifier for partition cells of a {@link yfiles.layout.PartitionGrid partition grid} structure. - * @see yfiles.layout.PartitionGrid - * @class - */ - export interface PartitionCellId extends yfiles.lang.Object{} - export class PartitionCellId { - /** - * Gets a {@link yfiles.collections.ICollection. collection} of elements of type {@link yfiles.layout.PartitionCellIdEntry}. - *

- * Each pair consists of a {@link yfiles.layout.ColumnDescriptor column} and a {@link yfiles.layout.RowDescriptor row} defining a single {@link yfiles.layout.PartitionCellId partition cell}. - *

- * @type {yfiles.collections.IEnumerable.} - */ - cells:yfiles.collections.IEnumerable; - /** - * Gets whether or not this {@link yfiles.layout.PartitionCellId} represents a multi-cell, i.e., a cell spanning multiple - * rows/columns. - *

- * This means that it was created using {@link yfiles.layout.PartitionGrid#createCellSpanId}, - * {@link yfiles.layout.PartitionGrid#createCellSpanId}, {@link yfiles.layout.PartitionGrid#createCellSpanId}, {@link yfiles.layout.PartitionGrid#createColumnSpanId} - * or {@link yfiles.layout.PartitionGrid#createRowSpanId}. - *

- * @type {boolean} - */ - isSpanning:boolean; - /** - * Gets the first {@link yfiles.layout.RowDescriptor row} associated with this {@link yfiles.layout.PartitionCellId partition cell} identifier. - * @type {yfiles.layout.RowDescriptor} - */ - row:yfiles.layout.RowDescriptor; - /** - * Gets the first {@link yfiles.layout.ColumnDescriptor column} associated with this {@link yfiles.layout.PartitionCellId partition cell} identifier. - * @type {yfiles.layout.ColumnDescriptor} - */ - column:yfiles.layout.ColumnDescriptor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PartitionCellId; - } - /** - * This class represents a partition grid that partitions the drawing area into rectangular partition cells. - *

- * Such a structure allows, for example, to model vertical/horizontal swimlanes which are often used in flow diagrams to - * separate logical units. - *

- *

- * The grid consists of rows and columns that are created using the corresponding constructors of this class or methods {@link yfiles.layout.PartitionGrid#addRow} - * and {@link yfiles.layout.PartitionGrid#addColumn}. The {@link yfiles.layout.PartitionGrid} object has to be registered with the graph - * using the {@link yfiles.algorithms.IDataProvider} key {@link yfiles.layout.PartitionGrid#PARTITION_GRID_DP_KEY}. - *

- *

- * Each node can be assigned to a {@link yfiles.layout.PartitionCellId} which represents a set of partition cells. The mapping has - * to be registered with the graph using {@link yfiles.algorithms.IDataProvider} key - * {@link yfiles.layout.PartitionGrid#PARTITION_CELL_ID_DP_KEY}. Simple partition cell identifiers which represent a single - * partition cell, i.e., a row/column pair, can be created using method {@link yfiles.layout.PartitionGrid#createCellId} or - * {@link yfiles.layout.PartitionGrid#createCellId}. - *

- *

- * Nodes can also be mapped to a partition cell identifier that represents a multi-cell, i.e., a cell spanning multiple - * columns and rows. Please note, however, that multi-cells are not allowed to overlap each other. This means that the user - * has to ensure that each partition cell (row/column pair) is associated with at most one partition cell identifier. The - * multi-cell identifier can be created using methods {@link yfiles.layout.PartitionGrid#createCellSpanId}, - * {@link yfiles.layout.PartitionGrid#createCellSpanId}, {@link yfiles.layout.PartitionGrid#createCellSpanId}, - * {@link yfiles.layout.PartitionGrid#createColumnSpanId}, and {@link yfiles.layout.PartitionGrid#createRowSpanId}. - *

- *

- * {@graph {"ann":{"s":[60,30],"d":1, "lblB" : 1, "lblFont" : "16px sans-serif"},"n":[[265,290,230,142,2,[[265,313.6,230,23.6,5,"Column 0"]]],[311.5,386.5,[[336.16,410.85,10.67,18.7]]],[411.5,346.5,[[436.16,370.85,10.67,18.7]]],[505,289,299,144,2,[[505,312.6,299,23.6,5,"Column 1"]]],[631.5,366.5,[[656.16,390.85,10.67,18.7]]],[731.5,326.5,[[756.16,350.85,10.67,18.7]]],[531.5,326.5,[[556.16,350.85,10.67,18.7]]],[819,290,250,140,2,[[819,313.6,250,23.6,5,"Column 2"]]],[831.5,326.5,[[856.16,350.85,10.67,18.7]]],[265,449,230,123,2],[411.5,466.5,[[436.16,490.85,10.67,18.7]]],[411.5,526.5,[[436.16,550.85,10.67,18.7]]],[505,449,299,123,2],[819,449,250,123,2],[931.5,466.5,[[956.16,490.85,10.67,18.7]]],[505,589,299,104,2],[819,589,250,104,2],[531.5,606.5,[[552.83,630.85,17.35,18.7]]],[265,589,230,104,2],[411.5,606.5,[[432.83,630.85,17.35,18.7]]],[831.5,606.5,[[852.83,630.85,17.35,18.7]]],[105,348.2,150,23.6,2,[[105,371.8,150,23.6,5,"Row 0"]]],[105,488.2,150,23.6,2,[[105,511.8,150,23.6,5,"Row 1"]]],[105,628.2,150,23.6,2,[[105,651.8,150,23.6,5,"Row 2"]]]],"e":[[1,2,30,-10,-30,-0,[381.5,391.5,381.5,361.5]],[1,4,30,-0,-30,10,[581.5,401.5,581.5,391.5]],[2,4,30,7.5,-30,-0,[481.5,369,481.5,381.5]],[4,5,30,-0,-30,7.5,[701.5,381.5,701.5,349]],[2,6,30,-7.5,-30,-0,[481.5,354,481.5,341.5]],[6,4,30,7.5,-30,-10,[601.5,349,601.5,371.5]],[6,5,30,-7.5,-30,-7.5,[621.5,334,621.5,341.5,681.5,341.5,681.5,334]],[5,8,30,-0,-30,-0],[8,14,30,-0,-30,-7.5,[901.5,341.5,901.5,474]],[10,14,30,-0,-30,7.5,[881.5,481.5,881.5,489]],[1,17,30,10,-30,10,[381.5,411.5,381.5,661.5,481.5,661.5,481.5,631.5]],[11,17,30,-0,-30,-10,[481.5,541.5,481.5,611.5]],[19,17,30,-0,-30,-0],[17,20,30,-0,-30,-0]],"vp":[105.0,289.0,964.0,404.0]}} Sample output of a layout algorithm with a partition grid - *

- * @class - */ - export interface PartitionGrid extends yfiles.lang.Object{} - export class PartitionGrid { - /** - * Creates an instance of {@link yfiles.layout.PartitionGrid} with the given number of rows and columns as well as with given - * insets and minimum sizes. - * @param rowCount the number of rows - * @param columnCount the number of columns - * @param rowInsets the top and bottom insets of the rows - * @param columnInsets the left and right insets of the columns - * @param minRowSize the minimum row height - * @param minColumnSize the minimum column width - */ - constructor(rowCount:number,columnCount:number,rowInsets:number,columnInsets:number,minRowSize:number,minColumnSize:number); - /** - * Creates an instance of {@link yfiles.layout.PartitionGrid} with the given number of rows and columns. - * @param rowCount the number of rows - * @param columnCount the number of columns - */ - constructor(rowCount:number,columnCount:number); - /** - * Creates a new empty instance of {@link yfiles.layout.PartitionGrid}. - */ - constructor(); - /** - * Adds a new {@link yfiles.layout.ColumnDescriptor column} to the {@link yfiles.layout.PartitionGrid} instance. - *

- * The index of the column (as returned by {@link yfiles.layout.ColumnDescriptor#index}) is equal to the size of the list returned by {@link yfiles.layout.PartitionGrid#columns}. - *

- * @returns a new {@link } instance - */ - addColumn():yfiles.layout.ColumnDescriptor; - /** - * Adds a new {@link yfiles.layout.RowDescriptor row} to the {@link yfiles.layout.PartitionGrid} instance. - *

- * The index of the row (as returned by {@link yfiles.layout.RowDescriptor#index}) is equal to the size of the list returned by {@link yfiles.layout.PartitionGrid#rows}. - *

- * @returns a new {@link } instance - */ - addRow():yfiles.layout.RowDescriptor; - /** - * Creates a {@link yfiles.layout.PartitionCellId partition cell} identifier that represents the cell defined by the given column and row index. - * @param rowIndex the row index of the row defining the cell - * @param columnIndex the column index of the column defining the cell - * @returns a {@link } instance - * @throws {Stubs.Exceptions.ArgumentError} if the given column/row index is not valid - */ - createCellId(rowIndex:number,columnIndex:number):yfiles.layout.PartitionCellId; - /** - * Creates a {@link yfiles.layout.PartitionCellId partition cell} identifier that represents the cell defined by the given {@link yfiles.layout.ColumnDescriptor column} and {@link yfiles.layout.RowDescriptor row}. - * @param rd the row defining the cell - * @param cd the column defining the cell - * @returns a {@link } instance - * @throws {Stubs.Exceptions.ArgumentError} if the given column/row is null - */ - createCellId(rd:yfiles.layout.RowDescriptor,cd:yfiles.layout.ColumnDescriptor):yfiles.layout.PartitionCellId; - /** - * Creates a {@link yfiles.layout.PartitionCellId partition cell} identifier that represents a multi-cell spanning multiple columns and rows. - *

- * The partition cell identifier represents all cells defined by a row between fromRow and toRow (both including) and a - * column between fromRow and toCol (both including). - *

- *

- * A group node mapped to such a partition cell identifier represents the multi-cell, i.e., its boundary corresponds to the - * smallest rectangle containing all partition cells specified by the partition cell identifier. The boundary does not - * depend on the partition cells associated with the group's descendants. Hence, each non-group descendant has to be - * manually assigned to one of the partition cells. Furthermore, edges incident to such a group node are not considered - * during the layout. - *

- * @param fromRow the topmost row defining the cell - * @param fromCol the leftmost column defining the cell - * @param toRow the bottommost row defining the cell - * @param toCol the rightmost column defining the cell - * @returns a {@link } instance - */ - createCellSpanId(fromRow:yfiles.layout.RowDescriptor,fromCol:yfiles.layout.ColumnDescriptor,toRow:yfiles.layout.RowDescriptor,toCol:yfiles.layout.ColumnDescriptor):yfiles.layout.PartitionCellId; - /** - * Creates a {@link yfiles.layout.PartitionCellId partition cell} identifier that represents a multi-cell spanning multiple columns and rows. - *

- * The partition cell identifier represents all cells defined by a row with index between fromRowIndex and toRowIndex (both - * including) and a column with index between fromColIndex and toColIndex (both including). - *

- *

- * A group node mapped to such a partition cell identifier represents the multi-cell, i.e., its boundary corresponds to the - * smallest rectangle containing all partition cells specified by the partition cell identifier. The boundary does not - * depend on the partition cells associated with the group's descendants. Hence, each non-group descendant has to be - * manually assigned to one of the partition cells. Furthermore, edges incident to such a group node are not considered - * during the layout. - *

- * @param fromRowIndex the row index of the topmost row defining the cell - * @param fromColIndex the column index of the leftmost column defining the cell - * @param toRowIndex the row index of the bottommost row defining the cell - * @param toColIndex the column index of the rightmost column defining the cell - * @returns a {@link } instance - */ - createCellSpanId(fromRowIndex:number,fromColIndex:number,toRowIndex:number,toColIndex:number):yfiles.layout.PartitionCellId; - /** - * Creates a {@link yfiles.layout.PartitionCellId partition cell} identifier that represents a multi-cell spanning multiple columns and rows. - *

- * The partition cell identifier represents all cells spanned by the columns of columnList and rows of rowList. - *

- *

- * A group node mapped to such a partition cell identifier represents the multi-cell, i.e., its boundary corresponds to the - * smallest rectangle containing all partition cells specified by the partition cell identifier. The boundary does not - * depend on the partition cells associated with the group's descendants. Hence, each non-group descendant has to be - * manually assigned to one of the partition cells. Furthermore, edges incident to such a group node are not considered - * during the layout. - *

- * @param rowList the {@link rows} defining the cell - * @param columnList the {@link columns} defining the cell - * @returns a {@link } instance - */ - createCellSpanId(rowList:yfiles.collections.ICollection,columnList:yfiles.collections.ICollection):yfiles.layout.PartitionCellId; - /** - * Creates a {@link yfiles.layout.PartitionCellId partition cell} identifier that represents a cell spanning a whole column. - *

- * A group node mapped to such a partition cell identifier represents the column, i.e., its enclosing boundary corresponds - * to that of the column. The boundary does not depend on the partition cells associated with the group's descendants. - * Hence, each non-group descendant has to be manually assigned to one of the partition cells. Furthermore, edges incident - * to such a group node are not considered during the layout. - *

- * @param columnIndex the column index of the column defining the cell - * @returns a {@link } instance - */ - createColumnSpanId(columnIndex:number):yfiles.layout.PartitionCellId; - /** - * Creates a {@link yfiles.layout.PartitionCellId partition cell} identifier that represents a cell spanning a whole row. - *

- * A group node mapped to such a partition cell identifier represents the row, i.e., its enclosing boundary corresponds to - * that of the row. The boundary does not depend on the partition cells associated with the group's descendants. Hence, - * each non-group descendant has to be manually assigned to one of the partition cells. Furthermore, edges incident to such - * a group node are not considered during the layout. - *

- * @param rowIndex the row index of the row defining the cell - * @returns a {@link } instance - */ - createRowSpanId(rowIndex:number):yfiles.layout.PartitionCellId; - /** - * Finalizes the orientation changes and is called at the end of the {@link yfiles.layout.OrientationLayout} stage. - *

- * Points are transferred to their final positions through {@link yfiles.layout.OrientationLayout#completeTransform}. - *

- * @param orientationLayouter an {@link } instance - * @see yfiles.layout.OrientationLayout - */ - finalizeOrientationChange(orientationLayouter:yfiles.layout.OrientationLayout):void; - /** - * Returns the {@link yfiles.layout.ColumnDescriptor column} with the given index. - * @param index the index of the column to be returned - * @returns the {@link column} with the given index or null if no such column exists - */ - getColumn(index:number):yfiles.layout.ColumnDescriptor; - /** - * Returns the {@link yfiles.layout.PartitionGrid} instance associated with the given graph. - * @param graph the given graph - * @returns the {@link } of the graph or null if the graph has no associated partition grid - * @static - */ - static getPartitionGrid(graph:yfiles.algorithms.Graph):yfiles.layout.PartitionGrid; - /** - * Returns the {@link yfiles.layout.RowDescriptor row} with the given index. - * @param index the index of the row to be returned - * @returns the {@link row} with the given index or null if no such row exists - */ - getRow(index:number):yfiles.layout.RowDescriptor; - static hasAtLeastTwoNonEmptyRows(graph:yfiles.algorithms.Graph):boolean; - /** - * Prepares for the orientation changes and is called at the beginning of the {@link yfiles.layout.OrientationLayout} stage. - *

- * Original points are transferred to their temporary positions through {@link yfiles.layout.OrientationLayout#prepareTransform}. - *

- * @param orientationLayouter an {@link } instance - * @see yfiles.layout.OrientationLayout - */ - prepareOrientationChange(orientationLayouter:yfiles.layout.OrientationLayout):void; - /** - * Data provider key for storing the partition grid structure - *

- * If the {@link yfiles.algorithms.IDataProvider} contains a partition grid structure, this structure will be considered during - * layout (provided that the layout algorithm supports such constraints). - *

- * @const - * @static - * @type {yfiles.algorithms.GraphDpKey.} - */ - static PARTITION_GRID_DP_KEY:yfiles.algorithms.GraphDpKey; - /** - * Data provider key for storing a set of partition cells for each node - *

- * Each node is placed inside the columns/rows defined by the corresponding {@link yfiles.layout.PartitionCellId} identifier. - * Instances can be shared among multiple nodes, but don't have to be shared. - *

- * @see yfiles.layout.PartitionCellId - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static PARTITION_CELL_ID_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets whether or not the order of the columns should be chosen automatically to minimize edge lengths. - *

- * For all columns where {@link yfiles.layout.ColumnDescriptor#indexFixed} is set to - * true, the relative ordering given by the indices is preserved. The remaining columns may be sorted again so that the - * overall edge lengths are minimized. - *

- * @type {boolean} - */ - optimizeColumnOrder:boolean; - /** - * Gets or sets whether or not the order of the rows should be chosen automatically to minimize edge lengths. - *

- * For all rows where {@link yfiles.layout.RowDescriptor#indexFixed} is set to - * true, the relative ordering given by the indices is preserved. The remaining rows may be sorted again so that the - * overall edge lengths are minimized. - *

- * @type {boolean} - */ - optimizeRowOrder:boolean; - /** - * Gets the list of rows of the {@link yfiles.layout.PartitionGrid partition grid}. - * @type {yfiles.algorithms.YList} - */ - rows:yfiles.algorithms.YList; - /** - * Gets the columns of the {@link yfiles.layout.PartitionGrid partition grid}. - * @type {yfiles.algorithms.YList} - */ - columns:yfiles.algorithms.YList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PartitionGrid; - } - /** - * This class represents a row of a {@link yfiles.layout.PartitionGrid partition grid} structure. - *

- * The results of the calculation of the geometry of the row will be placed into the instances of this class after the - * layout. - *

- * @see yfiles.layout.PartitionGrid - * @class - * @implements {yfiles.lang.IComparable} - */ - export interface RowDescriptor extends yfiles.lang.Object,yfiles.lang.IComparable{} - export class RowDescriptor { - /** - * Compares this {@link yfiles.layout.RowDescriptor} instance with a given other {@link yfiles.layout.RowDescriptor} instance based on the - * indices of the two instances. - * @param o the {@link } to compare to - * @returns -1, 0 or 1 if this {@link } is less than, equal to, or greater than the given other - * {@link } - */ - compareTo(o:any):number; - /** - * Gets the index of the row within the {@link yfiles.layout.PartitionGrid partition grid}. - * @type {number} - */ - index:number; - /** - * Gets or sets the minimum height of the row. - *

- * The minimum height is defined to be at least 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum height is negative - * @type {number} - */ - minimumHeight:number; - /** - * Gets or sets the top inset in which no element will lie in the resulting layout. - *

- * The inset value needs to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given top inset is negative - * @type {number} - */ - topInset:number; - /** - * Gets or sets the bottom inset in which no element will lie in the resulting layout. - *

- * The inset value needs to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given bottom inset is negative - * @type {number} - */ - bottomInset:number; - /** - * Gets or sets the computed height of the row after the layout has been calculated. - *

- * The computed height needs to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the computed height is negative - * @type {number} - */ - computedHeight:number; - /** - * Gets or sets the original position (smallest y-coordinate) of the row. - * @type {number} - */ - originalPosition:number; - /** - * Gets or sets the original height of the row. - *

- * The original height needs to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the original height is negative - * @type {number} - */ - originalHeight:number; - /** - * Gets or sets the computed position (smallest y-coordinate) of the row after the layout has been calculated. - * @type {number} - */ - computedPosition:number; - /** - * Gets or sets the tightness factor of this row. - *

- * This value must lie within the interval [0,1]. - *

- *

- * The larger the value, the more the row will be forced to obtain its minimum height: - *

- *
    - *
  • a value of 0.0d will disable the compression of the row.
  • - *
  • a value of 1.0d will try to force the row to obtain its specified {@link yfiles.layout.RowDescriptor#minimumHeight minimum height}.
  • - *
- * @throws {Stubs.Exceptions.ArgumentError} if the tightness value is outside the interval [0,1] - * @type {number} - */ - tightness:number; - /** - * Gets or sets whether the index of the row is fixed or it should be chosen automatically in order to minimize edge - * lengths. - *

- * For all rows where this property is enabled, the relative ordering given by the indices is preserved. The remaining rows - * may be sorted again so that the overall edge lengths are minimized. - *

- * @type {boolean} - */ - indexFixed:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.RowDescriptor; - } - export enum InterEdgeRoutingStyle{ - /** - * An inter-edge routing style based on which the edge layout of inter-edges will be adopted from the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @see yfiles.layout.FixGroupLayoutStage#interEdgeRoutingStyle - */ - ADOPT, - /** - * An inter-edge routing style based on which inter-edges are routed in an orthogonal style. - * @see yfiles.layout.FixGroupLayoutStage#interEdgeRoutingStyle - * @see yfiles.layout.FixGroupLayoutStage#interEdgeRouter - */ - ORTHOGONAL, - /** - * An inter-edge routing style based on which inter-edges are routed as straight lines. - * @see yfiles.layout.FixGroupLayoutStage#interEdgeRoutingStyle - * @see yfiles.layout.FixGroupLayoutStage#interEdgeRouter - */ - STRAIGHTLINE - } - /** - * This interface defines {@link yfiles.algorithms.IDataProvider} keys for those layout algorithms that can handle hierarchically - * grouped graphs. - *

- * There are two groups of {@link yfiles.algorithms.IDataProvider} keys. {@link yfiles.algorithms.IDataProvider}s registered with - * {@link yfiles.layout.GroupingKeys#NODE_ID_DP_KEY}, {@link yfiles.layout.GroupingKeys#GROUP_DP_KEY} and {@link yfiles.layout.GroupingKeys#PARENT_NODE_ID_DP_KEY} - * define the relationship of nodes within the hierarchy. A parent node is defined for each node in the graph. This parent - * is the containing group node. For top-level nodes, this parent is null. - *

- *

- * {@link yfiles.layout.GroupingKeys#GROUP_NODE_INSETS_DP_KEY} and {@link yfiles.layout.GroupingKeys#MINIMUM_NODE_SIZE_DP_KEY} are used for - * registering - * {@link yfiles.algorithms.IDataProvider}s that add layout information to group nodes such as the insets and the minimum size - * respectively. - *

- * @see yfiles.layout.GroupingSupport - * @class - * @static - */ - export interface GroupingKeys extends yfiles.lang.Object{} - export class GroupingKeys { - /** - * Data provider key for assigning a unique ID for each node - *

- * The IDs of the nodes need to differ based on {@link any#hashCode} and {@link any#equals}. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_ID_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for describing the hierarchy of nodes in the graph - * @see yfiles.layout.GroupingKeys#NODE_ID_DP_KEY - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static PARENT_NODE_ID_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for distinguishing normal nodes from group nodes - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static GROUP_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for assigning insets for group nodes - *

- * Insets reserve space around the contents of a group node. Labels and other visual decorations may be placed inside this - * space. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static GROUP_NODE_INSETS_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for assigning minimum sizes for group nodes - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static MINIMUM_NODE_SIZE_DP_KEY:yfiles.algorithms.NodeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.GroupingKeys; - } - /** - * This class provides convenient and efficient access to the hierarchic graph structure. - *

- * The grouping information is provided through {@link yfiles.algorithms.IDataProvider}s registered with the graph with keys - * {@link yfiles.layout.GroupingKeys#NODE_ID_DP_KEY}, {@link yfiles.layout.GroupingKeys#PARENT_NODE_ID_DP_KEY} and - * {@link yfiles.layout.GroupingKeys#GROUP_DP_KEY}. It describes the hierarchy as a tree where a group node is the parent of the - * nodes that it contains. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[444,-37.38,62,82.38,2,[[444,-15,62,22.38,"9"]]],[460,0,[[469.66,24.35,10.67,18.7,"5"]]],[536,0,[[545.66,24.35,10.67,18.7,"6"]]],[384,0,[[393.66,24.35,10.67,18.7,"4"]]],[596,-10,50,50,2,[[596,12.38,50,22.38,"7"]]],[140,-74.75,214,134.75,2,[[140,-52.38,214,22.38,"10"]]],[156,0,[[165.66,24.35,10.67,18.7,"1"]]],[216,-37.38,122,82.38,2,[[216,-15,122,22.38,"8"]]],[232,0,[[241.66,24.35,10.67,18.7,"2"]]],[292,0,[[301.66,24.35,10.67,18.7,"3"]]]],"e":[],"vp":[140.0,-75.0,506.0,135.0]}} This is an example graph that contains group nodes. {@graph {"ann":{"s":[30,30],"d":1},"n":[[34.5,70,42,52.38,2,[[34.5,92.38,42,22.38,"10"]]],[200,162.38,42,52.38,2,[[200,184.75,42,22.38,"9"]]],[150,277.13,[[159.66,301.48,10.67,18.7,"4"]]],[179.25,0,[[160.9,22.7,66.7,18.7,"Virtual Root"]]],[0,277.13,[[9.66,301.48,10.67,18.7,"1"]]],[206,277.13,[[215.66,301.48,10.67,18.7,"5"]]],[69,162.38,42,52.38,2,[[69,184.75,42,22.38,"8"]]],[50,277.13,[[59.66,301.48,10.67,18.7,"2"]]],[100,277.13,[[109.66,301.48,10.67,18.7,"3"]]],[312,254.75,42,52.38,2,[[312,277.13,42,22.38,"7"]]],[262,277.13,[[271.66,301.48,10.67,18.7,"6"]]]],"e":[[3,0,[194.25,50,55.5,50]],[3,2,[194.25,50,165,50]],[3,1,[194.25,50,221,50]],[0,4,[55.5,142.38,15,142.38]],[1,5],[0,6,[55.5,142.38,90,142.38]],[6,7,[90,234.75,65,234.75]],[6,8,[90,234.75,115,234.75]],[3,9,[194.25,50,333,50]],[3,10,[194.25,50,277,50]]],"vp":[0.0,0.0,354.0,308.0]}} The hierarchy tree of the grouped graph reveals the relationship - * among the nodes. The corresponding nodes have the same labels as in the grouped graph. Group nodes are considered as the - * parents of their content which can consist of group nodes and/or normal nodes. Top-level nodes are children of a - * {@link yfiles.layout.GroupingSupport#root virtual root}. Leaf nodes can either be normal nodes or empty groups. - *

- * @class - */ - export interface GroupingSupport extends yfiles.lang.Object{} - export class GroupingSupport { - /** - * Creates a new {@link yfiles.layout.GroupingSupport} instance that represents the hierarchy of the graph. - *

- * The hierarchy information is cached during the constructor call. Later modifications to the graph are not considered and - * may lead to errors when using this {@link yfiles.layout.GroupingSupport} instance. - *

- * @param graph the graph instance from which the hierarchy information is obtained - */ - constructor(graph:yfiles.algorithms.Graph); - /** - * Creates a {@link yfiles.algorithms.INodeMap} to store hierarchy information for each node. - *

- * This method is called in {@link yfiles.layout.GroupingSupport#init} and may be overridden to customize how the {@link yfiles.algorithms.INodeMap} - * is created. - *

- * @param graph the current graph - * @returns the new instance of {@link } - * @see yfiles.layout.GroupingSupport#init - * @see yfiles.layout.GroupingSupport#disposeInfoMap - * @protected - */ - createInfoMap(graph:yfiles.algorithms.Graph):yfiles.algorithms.INodeMap; - /** - * Disposes of all internal data structures held by this {@link yfiles.layout.GroupingSupport instance}. - *

- * {@link yfiles.layout.GroupingSupport} should be disposed of when it is not needed anymore, or if the state of the graph changes - * (e.g. new nodes are added). - *

- */ - dispose():void; - /** - * Disposes of the {@link yfiles.algorithms.INodeMap} created to store hierarchy information for each node. - *

- * This method is called in {@link yfiles.layout.GroupingSupport#dispose} and may be overridden to revert changes from - * {@link yfiles.layout.GroupingSupport#createInfoMap}. - *

- * @param graph the current graph - * @param infoMap the {@link } which contains the hierarchy information for each node - * @see yfiles.layout.GroupingSupport#dispose - * @see yfiles.layout.GroupingSupport#createInfoMap - * @protected - */ - disposeInfoMap(graph:yfiles.algorithms.Graph,infoMap:yfiles.algorithms.INodeMap):void; - /** - * Returns the direct children of the given group node. - *

- * If the {@link yfiles.layout.GroupingSupport#root virtual root of the hierarchy tree} is passed, all top-level nodes are returned. - *

- * @param parent the group node - * @returns a set of child nodes of the given parent node - * @see yfiles.layout.GroupingSupport#root - * @see yfiles.layout.GroupingSupport#getParent - * @see yfiles.layout.GroupingSupport#getDescendants - */ - getChildren(parent:yfiles.algorithms.Node):yfiles.algorithms.NodeList; - /** - * Returns all descendants of the given group node. - *

- * All nodes in the subtree rooted at this group node are collected recursively. - *

- *

- * If the {@link yfiles.layout.GroupingSupport#root virtual root of the hierarchy tree} is passed, all nodes in the graph are returned. - *

- * @param parent the group node - * @returns a set of nodes that belong to a subtree of the hierarchy tree rooted at the given parent - * @see yfiles.layout.GroupingSupport#root - * @see yfiles.layout.GroupingSupport#getParent - * @see yfiles.layout.GroupingSupport#getChildren - */ - getDescendants(parent:yfiles.algorithms.Node):yfiles.algorithms.NodeList; - /** - * Returns all edges crossing the bounds of the given group node such that their targets are inside the group node while - * their sources lie outside the group node. - * @param group the group node whose bounds are crossed - * @returns a set of edges that cross the bounds of the group node starting outside the group node - * @see yfiles.layout.GroupingSupport#getEdgesGoingOut - * @see yfiles.layout.GroupingSupport#isNormalEdge - */ - getEdgesGoingIn(group:yfiles.algorithms.Node):yfiles.algorithms.EdgeList; - /** - * Returns all edges crossing the bounds of the given group node such that their sources are inside the group node while - * their targets lie outside the group node. - * @param group the group node whose bounds are crossed - * @returns a set of edges that cross the bounds of the group node starting inside the group node - * @see yfiles.layout.GroupingSupport#getEdgesGoingIn - * @see yfiles.layout.GroupingSupport#isNormalEdge - */ - getEdgesGoingOut(group:yfiles.algorithms.Node):yfiles.algorithms.EdgeList; - /** - * Returns the nearest common ancestor of the given nodes in the hierarchy structure. - *

- * The nearest common ancestor is the local root of the smallest subtree in the hierarchy tree that contains both nodes. - * This group is the first node that contains these two nodes. If no such node exists, the {@link yfiles.layout.GroupingSupport#root virtual root} is returned. - *

- *

- * Common ancestors in special cases: - *

- *
    - *
  • node1 == node2: the parent of node1/node2
  • - *
  • node1 is parent of node2: the parent of node1
  • - *
  • node2 is parent of node1: the parent of node2
  • - *
- * @param node1 one of the two nodes whose common ancestor is determined - * @param node2 one of the two nodes whose common ancestor is determined - * @returns the nearest common ancestor node or {@link #root} - */ - getNearestCommonAncestor(node1:yfiles.algorithms.Node,node2:yfiles.algorithms.Node):yfiles.algorithms.Node; - /** - * Returns the parent for the given node. - *

- * The parent is the containing group node. - *

- * @param node the node for which the parent is determined - * @returns the parent of the given node or null for a top-level node - * @throws {Stubs.Exceptions.ArgumentError} if the given node is null - * @see yfiles.layout.GroupingSupport#getChildren - * @see yfiles.layout.GroupingSupport#getDescendants - * @see yfiles.layout.GroupingSupport#getNearestCommonAncestor - */ - getParent(node:yfiles.algorithms.Node):yfiles.algorithms.Node; - /** - * Returns an immediate child of the group node that represents the given node. - *

- * If this node is already a child of the group node, the group node will be its representative. In case the node is - * located further down in the hierarchy, the child of the group node, which is also an ancestor of the node, is used. - * There is no representative if the node is not a descendant of the group. - *

- * @param node the node for which a representative is searched - * @param group the group node to which the representative should belong - * @returns the representative or null if the node is not a descendant of the group - * @throws {Stubs.Exceptions.ArgumentError} if the given node is null - */ - getRepresentative(node:yfiles.algorithms.Node,group:yfiles.algorithms.Node):yfiles.algorithms.Node; - /** - * Determines whether or not the given node is a group node with children. - *

- * Normal nodes never have children. - *

- * @param node the potential parent - * @returns true if the given node has children, false otherwise - * @see yfiles.layout.GroupingSupport#getChildren - * @see yfiles.layout.GroupingSupport#isGroupNode - */ - hasChildren(node:yfiles.algorithms.Node):boolean; - /** - * Initializes internal data structures. - *

- * This method is called from {@link yfiles.layout.GroupingSupport} and retrieves the state of the hierarchic graph at the moment - * of invocation. It may be overridden to append additional information used for group handling. - *

- * @see yfiles.layout.GroupingSupport#dispose - * @protected - */ - init():void; - /** - * Returns whether or not the given graph is flat. - *

- * A graph is considered to be flat if there exist no group nodes or there exist group nodes but none of them has children. - *

- * @param graph the input graph - * @returns true if there are no groups or only empty groups in the graph, false otherwise - * @see yfiles.layout.GroupingSupport#isGrouped - * @static - */ - static isFlat(graph:yfiles.algorithms.Graph):boolean; - /** - * Returns whether or not the given graph is grouped. - *

- * A graph is considered to be grouped if there are {@link yfiles.algorithms.IDataProvider}s registered with the graph with keys - * {@link yfiles.layout.GroupingKeys#GROUP_DP_KEY}, {@link yfiles.layout.GroupingKeys#NODE_ID_DP_KEY} and - * {@link yfiles.layout.GroupingKeys#PARENT_NODE_ID_DP_KEY}. - *

- * @param graph the input graph - * @returns true if the graph contains hierarchic information, false otherwise - * @see yfiles.layout.GroupingSupport#isFlat - * @static - */ - static isGrouped(graph:yfiles.algorithms.Graph):boolean; - /** - * Determines whether or not the given node is a group node. - *

- * While group nodes may have children, normal nodes never have children. - *

- * @param node the potential group node - * @returns true if the given node is a group node, false otherwise - * @see yfiles.layout.GroupingSupport#hasChildren - */ - isGroupNode(node:yfiles.algorithms.Node):boolean; - /** - * Determines whether or not the given edge is a normal edge as opposed to an edge that crosses any group node bounds. - *

- * Source and target of a normal edge are part of the same hierarchy level and share the same parent node. - *

- * @param edge the edge to check - * @returns true if the given edge is normal, false otherwise - * @see yfiles.layout.GroupingSupport#getEdgesGoingIn - * @see yfiles.layout.GroupingSupport#getEdgesGoingOut - */ - isNormalEdge(edge:yfiles.algorithms.Edge):boolean; - /** - * Gets the {@link yfiles.algorithms.Graph} instance for which this {@link yfiles.layout.GroupingSupport} object provides hierarchy - * information. - * @type {yfiles.algorithms.Graph} - */ - graph:yfiles.algorithms.Graph; - /** - * Gets a {@link yfiles.algorithms.Node} instance associated with the virtual root of the hierarchy tree. - *

- * This instance can be given to the {@link yfiles.layout.GroupingSupport#getChildren} to obtain the nodes of the top level of the - * hierarchy. - *

- * @see yfiles.layout.GroupingSupport#getChildren - * @type {yfiles.algorithms.Node} - */ - root:yfiles.algorithms.Node; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.GroupingSupport; - } - /** - * A {@link yfiles.layout.ILayoutStage layout stage} that hides the group nodes of hierarchically grouped graphs. - *

- * This stage removes all group nodes and adjacent edges from the graph before passing it to the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. After the core layout algorithm has arranged the graph, the hidden elements will be reinserted. - *

- *

- * This stage is used by layout algorithms that cannot handle grouped graphs (e.g. {@link yfiles.circular.CircularLayout}). - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface HideGroupsStage extends yfiles.layout.LayoutStageBase{} - export class HideGroupsStage { - /** - * Creates an instance of {@link yfiles.layout.HideGroupsStage} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algorithm. - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Hides the group nodes and their incident edges of the input graph. - *

- * Furthermore, this method removes all grouping-related {@link yfiles.algorithms.IDataProvider}s from the input graph. - *

- * @param graph the input graph - * @see yfiles.layout.GroupingKeys#NODE_ID_DP_KEY - * @see yfiles.layout.GroupingKeys#PARENT_NODE_ID_DP_KEY - * @see yfiles.layout.GroupingKeys#GROUP_DP_KEY - * @see yfiles.layout.HideGroupsStage#unhideGroupNodes - */ - hideGroupNodes(graph:yfiles.layout.LayoutGraph):void; - /** - * Un-hides the group nodes and their incident edges of the input graph that were previously hidden using method - * {@link yfiles.layout.HideGroupsStage#hideGroupNodes}. - *

- * Furthermore, this method restores all previously removed grouping related - * {@link yfiles.algorithms.IDataProvider}s on the input graph. - *

- * @param graph the given graph - * @see yfiles.layout.GroupingKeys#NODE_ID_DP_KEY - * @see yfiles.layout.GroupingKeys#PARENT_NODE_ID_DP_KEY - * @see yfiles.layout.GroupingKeys#GROUP_DP_KEY - * @see yfiles.layout.HideGroupsStage#hideGroupNodes - */ - unhideGroupNodes(graph:yfiles.layout.LayoutGraph):void; - /** - * Gets or sets whether or not empty group nodes, i.e., group nodes without children, will be hidden by this stage. - * @type {boolean} - */ - hidingEmptyGroupNodes:boolean; - /** - * Gets or sets the {@link yfiles.layout.IGroupBoundsCalculator} instance for calculating the sizes of group nodes. - *

- * For every group which is in its open state, the {@link yfiles.layout.IGroupBoundsCalculator} will be asked to calculate the - * bounds for the group's child nodes. The resulting size will be used during the ongoing layout calculation. - *

- * @type {yfiles.layout.IGroupBoundsCalculator} - */ - groupBoundsCalculator:yfiles.layout.IGroupBoundsCalculator; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.HideGroupsStage; - } - /** - * A {@link yfiles.layout.IGroupBoundsCalculator} is responsible for calculating the bounds of a group node during a layout - * process. - * @interface - */ - export interface IGroupBoundsCalculator extends yfiles.lang.Object{ - /** - * Calculates the bounds of the given group node that contains the given list of child nodes. - *

- * This method is called during the layout process. - *

- * @param graph the input graph - * @param groupNode the group node whose bounds will be calculated - * @param children a {@link } containing the nodes that reside inside the group node - * @returns a {@link } instance that describes the bounds of the group node - * @abstract - */ - calculateBounds(graph:yfiles.layout.LayoutGraph,groupNode:yfiles.algorithms.Node,children:yfiles.algorithms.NodeList):yfiles.algorithms.Rectangle2D; - } - var IGroupBoundsCalculator:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IGroupBoundsCalculator; - }; - /** - * This {@link yfiles.layout.IGroupBoundsCalculator} calculates the bounds of group nodes and allows to specify custom insets for - * each group node. - *

- * {@link yfiles.algorithms.Insets Insets} are provided by a {@link yfiles.algorithms.IDataProvider} that must have been registered with the graph using the - * specified {@link yfiles.layout.InsetsGroupBoundsCalculator#groupNodeInsetsDpKey insets key} prior to the invocation of the layout algorithm. - *

- * @class - * @implements {yfiles.layout.IGroupBoundsCalculator} - */ - export interface InsetsGroupBoundsCalculator extends yfiles.lang.Object,yfiles.layout.IGroupBoundsCalculator{} - export class InsetsGroupBoundsCalculator { - /** - * Constructs an instance of {@link yfiles.layout.InsetsGroupBoundsCalculator} using the given {@link yfiles.algorithms.IDataProvider} key - * as {@link yfiles.layout.InsetsGroupBoundsCalculator#groupNodeInsetsDpKey group node insets key} and the given insets as {@link yfiles.layout.InsetsGroupBoundsCalculator#defaultInsets default insets}. - * @param [groupNodeInsetsDPKey=null] the {@link } key to use as {@link #groupNodeInsetsDpKey insets key} - * @param [defaultInsets=null] the insets to use as {@link #defaultInsets default insets} - */ - constructor(groupNodeInsetsDPKey?:any,defaultInsets?:yfiles.algorithms.Insets); - /** - * Constructs an instance of {@link yfiles.layout.InsetsGroupBoundsCalculator} using the given {@link yfiles.algorithms.IDataProvider} key - * as {@link yfiles.layout.InsetsGroupBoundsCalculator#groupNodeInsetsDpKey group node insets key} and the given insets as {@link yfiles.layout.InsetsGroupBoundsCalculator#defaultInsets default insets}. - * @param {Object} options The parameters to pass. - * @param [options.groupNodeInsetsDPKey=null] the {@link } key to use as {@link #groupNodeInsetsDpKey insets key} - * @param [options.defaultInsets=null] the insets to use as {@link #defaultInsets default insets} - */ - constructor(options:{groupNodeInsetsDPKey?:Object,defaultInsets?:yfiles.algorithms.Insets}); - /** - * Calculates the bounds of the given group node and enlarges the bounds by the insets associated with the group node. - *

- * The {@link yfiles.algorithms.Insets insets} associated with the group node will be retrieved from a {@link yfiles.algorithms.IDataProvider} registered with the - * graph with the current {@link yfiles.layout.InsetsGroupBoundsCalculator#groupNodeInsetsDpKey insets key}. - *

- * @param graph the input graph - * @param groupNode the group node whose bounds will be calculated - * @param children a {@link } containing the nodes that reside inside the group node - * @returns a {@link } instance that describes the bounds of the group node - */ - calculateBounds(graph:yfiles.layout.LayoutGraph,groupNode:yfiles.algorithms.Node,children:yfiles.algorithms.NodeList):yfiles.algorithms.Rectangle2D; - /** - * Enlarges the given graph bounds by the insets associated with the given group node. - *

- * The {@link yfiles.algorithms.Insets insets} associated with the group node will be retrieved from a {@link yfiles.algorithms.IDataProvider} registered with the - * graph with the current {@link yfiles.layout.InsetsGroupBoundsCalculator#groupNodeInsetsDpKey insets key}. - *

- *

- * This method is called while {@link yfiles.layout.InsetsGroupBoundsCalculator#calculateBounds calculating the group bounds} to realize the support for custom insets. It may be overridden - * to change the way specific insets influence the group node bounds. - *

- * @param graph the input graph - * @param groupNode the group node whose bounds should be enlarged - * @param children the list of nodes that the given group node contains - * @param bounds a {@link } instance representing the bounds of the given group node - * @returns a {@link } instance representing the enlarged bounds of the given group node - */ - createEnlargedBounds(graph:yfiles.layout.LayoutGraph,groupNode:yfiles.algorithms.Node,children:yfiles.algorithms.NodeList,bounds:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D; - /** - * Gets or sets whether or not the labels of nodes contained in a group are considered while calculating the bounds of the - * group node. - * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Gets or sets whether or not the labels of edges contained in a group are considered while calculating the bounds of the - * group node. - * @type {boolean} - */ - considerEdgeLabels:boolean; - /** - * Gets or sets whether or not the calculation of the bounds of a group node considers the {@link yfiles.layout.NodeHalo NodeHalos} associated with the - * group's child nodes. - * @type {boolean} - */ - considerNodeHalos:boolean; - /** - * Gets or sets the default insets that will be used if the {@link yfiles.algorithms.IDataProvider} registered with the {@link yfiles.layout.InsetsGroupBoundsCalculator#groupNodeInsetsDpKey insets key} - * does not contain a mapping for a specific node. - * @type {yfiles.algorithms.Insets} - */ - defaultInsets:yfiles.algorithms.Insets; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that is used to access the insets for the group - * nodes. - *

- * The {@link yfiles.algorithms.IDataProvider} registered with this key must provide a mapping from each group node to a {@link yfiles.algorithms.Insets} - * (or {@link yfiles.algorithms.Insets}) instance. - *

- * @type {any} - */ - groupNodeInsetsDpKey:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.InsetsGroupBoundsCalculator; - } - /** - * A special {@link yfiles.layout.ComponentLayout} implementation that allows to lay out isolated subgraphs within a group as - * separate components. - *

- * {@link yfiles.orthogonal.OrthogonalLayout OrthogonalLayout} uses this layout stage to arrange components. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":0},"n":[[-5,16,210,336.38,2],[10,110,1],[10,35,1],[85,35,1],[160,35,1],[160,110,1],[10,285],[85,285],[85,210]],"e":[[1,2,0,-15,0,15],[2,3,15,0,-15,0],[3,4,15,0,-15,0],[4,5,0,15,0,-15],[5,1,-15,0,15,0],[6,8,0,-15,-15,0,[25,225]],[8,7,0,15,0,-15],[7,6,-15,0,15,0]],"vp":[-5.0,16.0,210.0,337.0]}} Example of a hierarchically grouped graph with two components that are laid out by {@link yfiles.orthogonal.OrthogonalLayout OrthogonalLayout} as separate - * components. - *

- * @class - * @extends {yfiles.layout.ComponentLayout} - */ - export interface IsolatedGroupComponentLayout extends yfiles.layout.ComponentLayout{} - export class IsolatedGroupComponentLayout { - /** - * Creates an instance of {@link yfiles.layout.IsolatedGroupComponentLayout} with the given layout algorithm as - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] the core layout algorithm that will be invoked for each component of the graph - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Determines the nodes that belong to the same graph component. - *

- * Unlike - * {@link yfiles.layout.ComponentLayout}, this implementation additionally identifies isolated subgraphs within a group as separate - * components. - *

- * @param graph the input graph - * @param compNumber the {@link } that will be filled by the layout algorithm, such that it contains the zero-based index - * of the component number to which each node belongs - * @returns the number of separate components - * @protected - */ - findIsolatedGraphComponents(graph:yfiles.layout.LayoutGraph,compNumber:yfiles.algorithms.INodeMap):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.IsolatedGroupComponentLayout; - } - /** - * This {@link yfiles.layout.IGroupBoundsCalculator} allows custom insets for group nodes and guarantees that their provided - * minimum sizes will be maintained. - *

- * As a subclass of {@link yfiles.layout.InsetsGroupBoundsCalculator}, this class supports custom insets for each group node. - * Furthermore, it guarantees that a desired minimum size is maintained. The minimum sizes are provided by a {@link yfiles.algorithms.IDataProvider} - * registered with the graph using the specified {@link yfiles.layout.MinimumSizeGroupBoundsCalculator#minimumNodeSizeDpKey minimum node size key}. - *

- * @class - * @extends {yfiles.layout.InsetsGroupBoundsCalculator} - */ - export interface MinimumSizeGroupBoundsCalculator extends yfiles.layout.InsetsGroupBoundsCalculator{} - export class MinimumSizeGroupBoundsCalculator { - /** - * Creates a new instance of {@link yfiles.layout.MinimumSizeGroupBoundsCalculator} with the given key as {@link yfiles.layout.MinimumSizeGroupBoundsCalculator#minimumNodeSizeDpKey minimum node size key}. - * @param minSizeDataProviderKey the {@link } key to use as {@link #minimumNodeSizeDpKey minimum size key} - */ - constructor(minSizeDataProviderKey:any); - /** - * Creates a new instance of {@link yfiles.layout.MinimumSizeGroupBoundsCalculator} with default settings. - */ - constructor(); - /** - * Gets or sets how the nodes are resized horizontally if the calculated width is smaller than the preferred minimum width - * of a group node. - *

- * The alignment is defined to be a value between 0 and 1, such that: - *

- *
    - *
  • A value of 0 means that the nodes grow to the right while the left border remains unchanged.
  • - *
  • A value of 1 means that the nodes grow to the left while the right border remains unchanged.
  • - *
- * @throws {Stubs.Exceptions.ArgumentError} if the given value does not lie within [0,1] - * @type {number} - */ - xAlignment:number; - /** - * Gets or sets how the nodes are resized vertically if the calculated height is smaller than the preferred minimum height - * of a group node. - *

- * The alignment is defined to be a value between 0 and 1, such that: - *

- *
    - *
  • A value of 0 means that the nodes grow downwards while the top border remains unchanged.
  • - *
  • A value of 1 means that the nodes grow upwards while the bottom border remains unchanged.
  • - *
- * @throws {Stubs.Exceptions.ArgumentError} if the given value does not lie within [0,1] - * @type {number} - */ - yAlignment:number; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that is used to access the minimum sizes for the - * group nodes. - *

- * The {@link yfiles.algorithms.IDataProvider} registered with this key must provide a mapping from each group node to a {@link yfiles.algorithms.YDimension} - * object defining the minimum width and height of the group node. - *

- * @see yfiles.layout.MinimumSizeGroupBoundsCalculator#defaultMinimumNodeSize - * @type {any} - */ - minimumNodeSizeDpKey:any; - /** - * Gets or sets the default minimum size (width and height) for group nodes. - *

- * The default minimum size is used if the {@link yfiles.algorithms.IDataProvider} registered with the {@link yfiles.layout.MinimumSizeGroupBoundsCalculator#minimumNodeSizeDpKey minimum size key} does not - * contain a mapping for a group node. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given {@link yfiles.algorithms.YDimension} is null - * @see yfiles.layout.MinimumSizeGroupBoundsCalculator#minimumNodeSizeDpKey - * @type {yfiles.algorithms.YDimension} - */ - defaultMinimumNodeSize:yfiles.algorithms.YDimension; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.MinimumSizeGroupBoundsCalculator; - } - /** - * This layout algorithm recursively traverses a hierarchically organized graph in a bottom-up fashion and applies a - * specified layout algorithm to the contents (direct children) of each group node. - *

- * Layout Style The way a graph is arranged depends on the {@link yfiles.layout.ILayoutAlgorithm layout algorithms} which are applied to the different group nodes. {@link yfiles.layout.RecursiveGroupLayout} - * is able to produce different layout styles for the content of each group node. - *

- *

- * This layout algorithm can be either applied if a {@link yfiles.layout.ILayoutAlgorithm layout algorithm} cannot handle grouped graphs by itself or if the - * content of (some) group nodes should be arranged differently. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"styles":{"6":{"c":1}},"n":[[-17.5,755,335,340,2],[166.25,770],[247.5,840],[85,840],[172.5,910],[272.5,910],[72.5,910],[272.5,980],[222.5,910],[97.5,980],[47.5,980],[-2.5,910],[147.5,980],[122.5,1050],[172.5,1050],[197.5,980],[-2.5,980],[-2.5,1050],[929.97,593,673.03,664,2],[1028.43,230.79,493.13,238.42,2],[1451.74,249.79,54.83,54.83],[1043.43,336.11,54.83,54.83],[1376.74,346.07],[1143.26,334.82],[1223.95,267.93,37.09,37.09],[1223.95,335.02,37.09,37.09],[1223.95,402.12,37.09,37.09],[1306.05,338.57],[351.41,46.3,547.17,607.39,2],[392.91,738,464.18,374,2],[600.69,849.79,44.43,44.43],[803.73,927.82,38.37,38.37],[600.69,1024.79,44.43,44.43],[707.91,932],[707.91,1032],[507.91,757],[503.73,852.82,38.37,38.37],[407.91,857],[1329,1038,6],[1269,795,6],[1472,612,6],[1411,1025,6],[1427,744,6],[1355,779,6],[1157,888,6],[1108,838,6],[1230,723,6],[1351,946,6],[1185,810,6],[1387,847,6],[1185,956,6],[1221,1212,6],[1311,715,6],[962,988,6],[1558,700,6],[1053,639,6],[1264,993,6],[1509,1121,6],[1143,742,6],[1453,871,6],[1248,1077,6],[1430,943,6],[1093,947,6],[1173,1025,6],[1249.93,858.93,83.14,83.14,6],[406.42,266.45,6],[535.29,224.58,6],[407.4,568.81,54.23,54.23,6],[366.41,92.7,54.23,54.23,6],[464.05,443.83,6],[450.74,65.3,54.23,54.23,6],[464.05,224.58,6],[592.93,401.96,6],[714.87,571.77,41.35,41.35,6],[842.24,530.39,41.35,41.35,6],[793.59,463.42,41.35,41.35,6],[793.59,597.35,41.35,41.35,6],[614.94,334.2,6],[535.29,443.83,6],[714.87,489,41.35,41.35,6],[406.42,401.96,6],[592.93,266.45,6],[384.4,334.2,6],[595.06,86,54.23,54.23,6],[668.28,135.99,54.23,54.23,6],[720.4,207.72,54.23,54.23,6],[745.32,292.81,54.23,54.23,6]],"e":[[1,2],[1,3],[3,4],[2,5],[3,6],[5,7],[2,8],[6,9],[6,10],[3,11],[4,12],[12,13],[12,14],[4,15],[11,16],[16,17],[0,19,0,-170,0,-119.21,[150,0,1275,0]],[21,22,27.41,13.71,-15,7.5,[1108.26,377.23,1158.26,454.21,1336.05,454.21,1361.74,368.57]],[22,20,15,-0,-27.41,18.28,[1416.74,361.07,1436.74,295.48]],[21,23,27.41,-13.71,-15,-0],[23,20,15,-11.25,-27.41,-18.28,[1183.26,338.57,1208.95,252.93,1391.74,252.93,1436.74,258.93]],[23,24,15,-3.75,-18.55,-0,[1183.26,346.07,1208.95,286.48]],[24,20,18.55,-9.27,-27.41,-0],[23,25,15,3.75,-18.55,-0],[23,26,15,11.25,-18.55,-0,[1183.26,361.07,1208.95,420.66]],[25,27,18.55,-0,-15,-0],[24,27,18.55,9.27,-15,-10,[1271.05,295.75,1291.05,343.57]],[26,27,18.55,-0,-15,10,[1271.05,420.66,1291.05,363.57]],[27,22,15,-0,-15,-7.5],[29,28,0,-187,0,303.7],[31,30,0,-19.18,22.21,0,[822.91,872]],[31,32,0,19.18,0,22.21,[822.91,1097,622.91,1097]],[2,32],[32,30,0,-22.21,0,22.21],[31,33,-19.18,0,15,0],[33,32,-15,0,12.5,-22.21,[635.41,947]],[33,34,0,15,0,-15],[34,32,-15,0,22.21,0],[34,31,15,0,-12.5,19.18,[810.41,1047]],[35,30,15,0,0,-22.21,[622.91,772]],[35,36,0,15,0,-19.18],[32,36,-22.21,-12.5,0,19.18,[522.91,1034.5]],[36,30,19.18,0,-22.21,0],[36,37,-19.18,0,15,0],[32,37,-22.21,0,0,15,[422.91,1047]],[37,35,0,-15,-15,0,[422.91,772]],[42,40],[42,54],[41,57],[58,55],[60,51],[62,53],[64,38],[64,39],[64,41,[1330.6,964.06,1337.99,974.52,1346.6,984.13,1356.64,992.4]],[64,42,[1301.28,892.93,1380.34,828.69,1390.42,819.61,1400.14,810]],[64,43],[64,44],[64,45],[64,46,[1257.8,823.49,1254.58,812.63,1252.57,801.6]],[64,47],[64,48],[64,49],[64,50],[64,52,[1313.2,816.82,1315.29,805.72]],[64,56],[64,58,[1227.75,807.43,1218.48,798.12,1198.26,783.57]],[64,59,[1401.91,896.21,1413.4,895.03]],[64,60,[1249.83,992.24,1246.96,1005.02,1247.3,1018.2]],[64,61],[64,62],[64,63],[40,19],[69,67],[65,71],[66,71],[71,70],[71,69],[71,68],[72,21],[73,74],[75,74],[73,76],[74,76],[77,72],[77,71],[71,78],[78,72],[78,69],[72,79],[79,75],[79,73],[69,80],[72,80],[66,81],[81,77],[65,82],[82,81],[82,80],[82,77],[83,81],[84,81],[85,81],[86,81],[51,33]],"vp":[-18.0,0.0,1621.0,1257.0]}}Concept - *

- *

- * {@link yfiles.layout.RecursiveGroupLayout} uses a hierarchy tree representation of the grouped graph in which the content nodes - * are the children of their containing group node. That way, it can traverse the tree recursively while arranging only the - * direct children of each group node. The layout algorithm starts by arranging the leaves in the hierarchy tree, then - * works its way up to the root computing the layout for each group node in the tree. - *

- *

- * All nodes other than the direct children are temporarily hidden. The layout algorithm performs two steps for each group - * node. - *

- *
    - *
  1. - * It arranges the direct children using either the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} or a special layout algorithm retrieved from a {@link yfiles.algorithms.IDataProvider} - * registered with - * {@link yfiles.layout.RecursiveGroupLayout#GROUP_NODE_LAYOUT_DP_KEY}. The content of group nodes among the children is already - * arranged at this time and will be ignored. These group nodes are handled like normal nodes with a size that encloses the - * content. - *
  2. - *
  3. - * Then {@link yfiles.layout.RecursiveGroupLayout} computes the final size of the group node using an implementation of - * {@link yfiles.layout.IGroupBoundsCalculator}. Customized {@link yfiles.layout.IGroupBoundsCalculator}s can be specified using - * {@link yfiles.layout.RecursiveGroupLayout#groupBoundsCalculator}. Aside from the resulting layout, this size is used in the following iteration. - *
  4. - *
- *

- * After a layout is applied to all group nodes, the layout algorithm computes routes for the edges whose source node is - * located at a different hierarchy level than its target node. The edge routing algorithm for these so-called inter-edges - * can be {@link yfiles.layout.RecursiveGroupLayout#interEdgeRouter customized}. - *

- *

- * Note that {@link yfiles.layout.RecursiveGroupLayout} can run without a - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. In this case no layout is calculated, instead the group node bounds are merely adjusted to fit - * their respective contents. - *

- *

- * Features There are two alternatives for applying different layout styles to the contents of group nodes: - *

- *
    - *
  1. - * Mapping each group node to a corresponding {@link yfiles.layout.ILayoutAlgorithm layout algorithm} by registering a {@link yfiles.algorithms.IDataProvider} with key - * {@link yfiles.layout.RecursiveGroupLayout#GROUP_NODE_LAYOUT_DP_KEY}. The content of the hierarchy root is arranged with the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *
  2. - *
  3. Using {@link yfiles.layout.LayoutMultiplexer} as {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}.
  4. - *
- *

- * Since {@link yfiles.layout.RecursiveGroupLayout} delegates the actual arrangement of the graph to other layout algorithms, it - * will support the same features as the currently used layout algorithm. - *

- *

- * The improvement of the routing of inter-edges is based on the {@link yfiles.layout.RecursiveGroupLayout#autoAssignPortCandidates insertion} of {@link yfiles.layout.PortCandidate}s or the {@link yfiles.layout.RecursiveGroupLayout#replacePortConstraints conversion} - * of {@link yfiles.layout.PortConstraint}s into {@link yfiles.layout.PortCandidate}s. Hence, they only work well if the applied layout - * algorithm supports {@link yfiles.layout.PortCandidate}s. - *

- *

- * This algorithm also provides a {@link yfiles.layout.RecursiveGroupLayout#fromSketchMode From Sketch mode} that should be activated if the applied layout algorithm runs in From - * Sketch mode, too. Otherwise, the initial coordinates may not be considered correctly. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface RecursiveGroupLayout extends yfiles.layout.LayoutStageBase{} - export class RecursiveGroupLayout { - /** - * Creates a new instance of {@link yfiles.layout.RecursiveGroupLayout} with default settings using the given {@link yfiles.layout.ILayoutAlgorithm layout algorithm} and - * {@link yfiles.layout.IGroupBoundsCalculator} implementation. - * @param core the layout algorithm that is applied in each step of the recursion - * @param gbc the {@link } for calculating group sizes - */ - constructor(core:yfiles.layout.ILayoutAlgorithm,gbc:yfiles.layout.IGroupBoundsCalculator); - /** - * Creates a new instance of {@link yfiles.layout.RecursiveGroupLayout} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [core=null] The layout algorithm that is applied in each recursion step. - */ - constructor(core?:yfiles.layout.ILayoutAlgorithm); - /** - * Reroutes the given inter-edges using the current {@link yfiles.layout.RecursiveGroupLayout#interEdgeRouter edge routing algorithm}. - *

- * This method is called after calculating the overall layout when the positions of all nodes and normal edges are fixed. - *

- *

- * If no {@link yfiles.layout.RecursiveGroupLayout#interEdgeRouter inter-edge router} is specified, this method {@link yfiles.layout.LayoutGraphUtilities#resetPath resets the path} of all inter-edges that don't connect to the proper - * location within the group. This may happen for inter-edges without - * {@link yfiles.layout.PortCandidate}s or if the applied layout algorithm doesn't support such constraints. - *

- * @param graph the input graph - * @param interEdges the edges which traverse the boundary of a group node - * @see yfiles.layout.RecursiveGroupLayout#autoAssignPortCandidates - * @see yfiles.layout.RecursiveGroupLayout#replacePortConstraints - * @see yfiles.layout.RecursiveGroupLayout#interEdgeRouter - * @protected - */ - routeInterEdges(graph:yfiles.layout.LayoutGraph,interEdges:yfiles.algorithms.EdgeList):void; - /** - * Data provider key for arranging the content of each group node with an individual layout algorithm - *

- * The specified layouter instance is applied to the content of the group node. To arrange the top level elements the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} - * is used. - *

- * @see yfiles.layout.RecursiveGroupLayout#NULL_LAYOUT - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static GROUP_NODE_LAYOUT_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for assigning source split ids to edges connecting to group nodes - *

- * The edges will be aligned with edges that connect to the same group node and have the same split id at their source - * (preferably) or target. - *

- * @see yfiles.layout.RecursiveGroupLayout#TARGET_SPLIT_ID_DP_KEY - * @see yfiles.hierarchic.HierarchicLayout - * @see yfiles.hierarchic.EdgeLayoutDescriptor#directGroupContentEdgeRouting - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static SOURCE_SPLIT_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for assigning target split ids to edges connecting to group nodes - *

- * The edges will be aligned with edges that connect to the same group node and have the same split id at their source or - * target (preferably). - *

- * @see yfiles.layout.RecursiveGroupLayout#SOURCE_SPLIT_ID_DP_KEY - * @see yfiles.hierarchic.HierarchicLayout - * @see yfiles.hierarchic.EdgeLayoutDescriptor#directGroupContentEdgeRouting - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static TARGET_SPLIT_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * A constant that represents a {@link yfiles.layout.ILayoutAlgorithm} implementation that does nothing. - *

- * This implementation can be assigned to group nodes to keep their content unchanged. The layout algorithm will still - * calculate the sizes of the group nodes. - *

- * @const - * @static - * @type {yfiles.layout.ILayoutAlgorithm} - */ - static NULL_LAYOUT:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets whether or not to consider the initial coordinates of the graph elements. - *

- * When using the initial coordinates, {@link yfiles.layout.RecursiveGroupLayout} sets the coordinates of the nodes to their - * initial position before the corresponding {@link yfiles.layout.ILayoutAlgorithm layout algorithm} is called. - *

- * @type {boolean} - */ - fromSketchMode:boolean; - /** - * Gets or sets whether or not temporary {@link yfiles.layout.PortCandidate}s are inserted to improve the routing of inter-edges. - *

- * If enabled, {@link yfiles.layout.RecursiveGroupLayout} will insert {@link yfiles.layout.PortCandidate}s for all inter-edges that cross a - * group node border. Those {@link yfiles.layout.PortCandidate}s are located at the relative position of the real source/target - * node. Inter-edges that connect to such {@link yfiles.layout.PortCandidate}s will be routed when the layout of the containing - * group node is calculated and will not be {@link yfiles.layout.RecursiveGroupLayout#routeInterEdges rerouted} later. This may produce more suitable edge routes but cannot prevent - * edges from crossing nodes. - *

- *

- * Without temporary or user specified {@link yfiles.layout.PortCandidate}s, inter-edges will always end at the border/center of - * the corresponding group node. Thus, they are rerouted afterwards using an {@link yfiles.layout.RecursiveGroupLayout#interEdgeRouter edge routing algorithm}. - *

- * @see yfiles.layout.RecursiveGroupLayout#routeInterEdges - * @see yfiles.layout.RecursiveGroupLayout#interEdgeRouter - * @see yfiles.layout.PortCandidate - * @type {boolean} - */ - autoAssignPortCandidates:boolean; - /** - * Gets or sets whether or not {@link yfiles.layout.PortConstraint}s of inter-edges are temporarily replaced by - * {@link yfiles.layout.PortCandidate}s. - *

- * If disabled, inter-edges will always end at the border/center of the corresponding group node, even if those edges have - * port constraints. Thus, they are {@link yfiles.layout.RecursiveGroupLayout#routeInterEdges rerouted} later without considering the constraint. Enabling this settings may produce - * more suitable edge routes but cannot prevent edges from crossing nodes. - *

- *

- * Port candidates are automatically redirected to their original location. Hence, enabling this option may produce more - * suitable edge routes if the layout algorithm applied to the content of a group node can handle port candidates. - *

- * @see yfiles.layout.RecursiveGroupLayout#routeInterEdges - * @see yfiles.layout.PortCandidate - * @type {boolean} - */ - replacePortConstraints:boolean; - /** - * Gets or sets whether empty group nodes are handled like group nodes with content or like normal nodes. - *

- * If they are handled like other group nodes, {@link yfiles.layout.RecursiveGroupLayout} will resize them according to their - * (non-existing) content. This results in small empty group nodes. Handled like normal nodes, empty group nodes will keep - * their initial size. - *

- * @type {boolean} - */ - considerEmptyGroups:boolean; - /** - * Gets or sets the current edge routing algorithm for handling inter-edges. - *

- * During layout, edges that connect from outside a group node to the content inside (inter-edges) are temporarily - * connected to the group node itself. Hence, these edges have to be routed after restoring the original graph structure - * using this edge routing algorithm. - *

- *

- * It is required that a suitable {@link yfiles.layout.RecursiveGroupLayout#interEdgesDpKey selection key} is specified. The same selection key must be used for setting the sphere of - * action for the edge router. - *

- * @see yfiles.layout.RecursiveGroupLayout#interEdgesDpKey - * @type {yfiles.layout.ILayoutAlgorithm} - */ - interEdgeRouter:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the key for marking the inter-edges to be routed. - *

- * The key should be used by the specified {@link yfiles.layout.RecursiveGroupLayout#interEdgeRouter inter-edge routing algorithm} to obtain the edges to be routed. This layouter - * automatically marks these edges and registers the {@link yfiles.algorithms.IDataProvider} using the specified key. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @see yfiles.layout.RecursiveGroupLayout#interEdgeRouter - * @type {any} - */ - interEdgesDpKey:any; - /** - * Gets or sets a {@link yfiles.layout.IGroupBoundsCalculator} which computes the sizes of all group nodes. - *

- * This {@link yfiles.layout.IGroupBoundsCalculator} is used each time after calculating the layout for a content graph. - *

- * @type {yfiles.layout.IGroupBoundsCalculator} - */ - groupBoundsCalculator:yfiles.layout.IGroupBoundsCalculator; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.RecursiveGroupLayout; - } - /** - * A {@link yfiles.layout.ILayoutStage} that temporarily removes all nodes and edges with NaN-coordinates. - *

- * This layout stage may be necessary when a {@link yfiles.layout.ILayoutAlgorithm} takes the initial coordinates into account. In - * this case initial coordinates containing NaN-values, can cause exceptions or strange results. - *

- *

- * Layouters that consider initial coordinates: - *

- *
    - *
  • {@link yfiles.hierarchic.HierarchicLayout} in incremental mode
  • - *
  • {@link yfiles.orthogonal.OrthogonalLayout} with activated from sketch drawing
  • - *
  • {@link yfiles.organic.OrganicLayout} for a subset of nodes
  • - *
  • {@link yfiles.tree.TreeLayout} when using a from sketch comparator.
  • - *
  • {@link yfiles.tree.BalloonLayout} in incremental mode
  • - *
  • {@link yfiles.partial.PartialLayout}
  • - *
  • - * all edge routing algorithms: {@link yfiles.router.EdgeRouter}, {@link yfiles.router.ChannelEdgeRouter}, {@link yfiles.router.BusRouter}, - * {@link yfiles.router.OrganicEdgeRouter} - *
  • - *
- *

- * Since this stage only hides the invalid graph elements and doesn't apply any new coordinates, it is not defined where - * those nodes and edges will be placed within the calculated layout. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface HandleNaNCoordinatesStage extends yfiles.layout.LayoutStageBase{} - export class HandleNaNCoordinatesStage { - constructor(); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.HandleNaNCoordinatesStage; - } - /** - * {@link yfiles.layout.IEdgeLabelLayout} defines the properties of one edge label from the perspective of a labeling algorithm. - *

- * Note: To avoid inconsistencies, changing the {@link yfiles.layout.ILabelLayout#modelParameter model parameter} should always be combined with updating the corresponding - * {@link yfiles.layout.ILabelLayout#orientedBox oriented box}. - *

- * @interface - * @implements {yfiles.layout.ILabelLayout} - */ - export interface IEdgeLabelLayout extends yfiles.lang.Object,yfiles.layout.ILabelLayout{ - /** - * Gets the label model that describes the valid locations for this label. - * @abstract - * @type {yfiles.layout.IEdgeLabelLayoutModel} - */ - labelModel:yfiles.layout.IEdgeLabelLayoutModel; - /** - * Gets the preferred placement for this edge label, which can be considered by {@link yfiles.layout.ILayoutAlgorithm layout algorithms}. - * @abstract - * @type {yfiles.layout.PreferredPlacementDescriptor} - */ - preferredPlacementDescriptor:yfiles.layout.PreferredPlacementDescriptor; - } - var IEdgeLabelLayout:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IEdgeLabelLayout; - }; - /** - * This interface defines the properties of the model associated with an {@link yfiles.layout.IEdgeLabelLayout}. - *

- * An {@link yfiles.layout.IEdgeLabelLayoutModel} provides a set of possible candidates for the placement of an edge label. It also defines a - * parameter that describes the current location of the label. - *

- *

- * It is important that all state information is encapsulated in the {@link yfiles.layout.IEdgeLabelLayoutModel#createModelParameter model parameter}. {@link yfiles.layout.IEdgeLabelLayoutModel} - * instances may be shared between multiple edge labels but produce different parameters for labels with different - * locations. - *

- * @interface - */ - export interface IEdgeLabelLayoutModel extends yfiles.lang.Object{ - /** - * Creates a model parameter that represents the given edge label position within this model. - *

- * The created model parameter is the closest parameter representation of the given label location that can be achieved - * within this model. - *

- *

- * This parameter can be passed to {@link yfiles.layout.IEdgeLabelLayoutModel#getLabelPlacement} to retrieve the current label - * box. - *

- *

- * A model parameter can be an arbitrary {@link any}. However it must contain all information to allow restoring of the encoded - * location with this {@link yfiles.layout.IEdgeLabelLayoutModel}. - *

- * @param labelBounds the oriented box of the label, encoding the label location for which the parameter should be created - * @param edgeLayout the layout of the edge to which the label belongs - * @param sourceLayout the layout of the source node of the label-owning edge - * @param targetLayout the layout of the target node of the label-owning edge - * @returns the model parameter representing the given label location - * @see yfiles.layout.IEdgeLabelLayoutModel#getLabelPlacement - * @abstract - */ - createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout):any; - /** - * Returns all {@link yfiles.layout.EdgeLabelCandidate}s that describe valid label positions within this model. - *

- * In case the implementing {@link yfiles.layout.IEdgeLabelLayoutModel} allows every possible location, this method always returns - * the current location as a {@link yfiles.layout.LabelCandidate}. - *

- * @param labelLayout the label for which candidates should be generated - * @param edgeLayout the layout of the edge to which the label belongs - * @param sourceLayout the layout of the source node of the label-owning edge - * @param targetLayout the layout of the target node of the label-owning edge - * @returns a list of {@link } instances - * @abstract - */ - getLabelCandidates(labelLayout:yfiles.layout.IEdgeLabelLayout,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; - /** - * Returns the oriented box of the label for the position encoded by the given model parameter. - * @param labelSize the width and height of the label - * @param edgeLayout the layout of the edge to which the label belongs - * @param sourceLayout the layout of the source node of the label-owning edge - * @param targetLayout the layout of the target node of the label-owning edge - * @param parameter the model parameter that describes the abstract position of the label within this model - * @returns the oriented bounds of the label - * @abstract - */ - getLabelPlacement(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout,parameter:any):yfiles.algorithms.YOrientedRectangle; - /** - * Gets a model parameter that encodes the default position of this model's allowed edge label positions. - *

- * This parameter can be passed to {@link yfiles.layout.IEdgeLabelLayoutModel#getLabelPlacement} to retrieve the corresponding - * label box. - *

- * @abstract - * @type {any} - */ - defaultParameter:any; - } - var IEdgeLabelLayoutModel:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IEdgeLabelLayoutModel; - }; - /** - * An {@link yfiles.layout.IEdgeLayout} encapsulates the layout information for an edge. - *

- * The layout information consists of the two end points of the edge layout and a sequence of control points that determine - * the visual path of the edge. - *

- * @interface - */ - export interface IEdgeLayout extends yfiles.lang.Object{ - /** - * Adds a control point to the end of the control point sequence. - * @param x the absolute x-coordinate of the new control point - * @param y the absolute y-coordinate of the new control point - * @abstract - */ - addPoint(x:number,y:number):void; - /** - * Removes all control points from this edge layout. - *

- * The {@link yfiles.layout.IEdgeLayout} still keeps the {@link yfiles.layout.IEdgeLayout#sourcePoint source point} and the {@link yfiles.layout.IEdgeLayout#targetPoint target point}. - *

- * @abstract - */ - clearPoints():void; - /** - * Returns the control point at the given position in the sequence of control points. - *

- * The first control point in the sequence has index 0 and the last control point has index {@link yfiles.layout.IEdgeLayout#pointCount} - * -1. - *

- * @param index the position of the control point in the control point sequence - * @returns the absolute coordinates of the control point at the given index - * @see yfiles.layout.IEdgeLayout#setPoint - * @abstract - */ - getPoint(index:number):yfiles.algorithms.YPoint; - /** - * Returns the number of control points of the edge. - *

- * The source and target points are not included in the point count. - *

- * @returns the number of control points - * @abstract - */ - pointCount():number; - /** - * Sets the absolute coordinates of the control point at the given position in the sequence of control points. - *

- * The first control point in the sequence has index 0 and the last control point has index {@link yfiles.layout.IEdgeLayout#pointCount} - * -1. - *

- * @param index the position of the changing control point in the sequence - * @param x the new absolute x-coordinate of the control point at the given index - * @param y the new absolute y-coordinate of the control point at the given index - * @abstract - */ - setPoint(index:number,x:number,y:number):void; - /** - * Gets or sets the relative coordinates of the first end point of this layout. - *

- * These coordinates are relative to the center location of the edge's source node. To obtain the absolute coordinates of - * the end point, the relative coordinates have to be added to the center coordinates of the source - * {@link yfiles.layout.INodeLayout}. - *

- * @see yfiles.layout.LayoutGraph#getCenterX - * @see yfiles.layout.LayoutGraph#getCenterY - * @see yfiles.layout.INodeLayout#x - * @see yfiles.layout.INodeLayout#y - * @abstract - * @type {yfiles.algorithms.YPoint} - */ - sourcePoint:yfiles.algorithms.YPoint; - /** - * Gets or sets the relative coordinates of the second end point of this layout. - *

- * These coordinates are relative to the center location of the edge's target node. To obtain the absolute coordinates of - * the end point, the relative coordinates have to be added to the center coordinates of the target - * {@link yfiles.layout.INodeLayout}. - *

- * @see yfiles.layout.LayoutGraph#getCenterX - * @see yfiles.layout.LayoutGraph#getCenterY - * @see yfiles.layout.INodeLayout#x - * @see yfiles.layout.INodeLayout#y - * @abstract - * @type {yfiles.algorithms.YPoint} - */ - targetPoint:yfiles.algorithms.YPoint; - } - var IEdgeLayout:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IEdgeLayout; - }; - /** - * An {@link yfiles.layout.IIntersectionCalculator} is responsible for calculating the intersection point between an edge and the - * visual representation of its source or target node. - *

- * This interface is especially useful in conjunction with {@link yfiles.layout.PortCalculator} when adjusting the final port - * locations after the layout is calculated. - *

- * @see yfiles.layout.PortCalculator - * @interface - */ - export interface IIntersectionCalculator extends yfiles.lang.Object{ - /** - * Calculates an intersection point between the edge and the given {@link yfiles.layout.INodeLayout}. - *

- * Implementing classes use a point on the connecting edge segment (specified with an offset to the node's center) along - * with a direction pointing to the node and calculate the intersection between this line and the node. - *

- * @param nodeLayout the layout information of the node - * @param xOffset the x-coordinate of a point on the last line segment relative to the node's center - * @param yOffset the y-coordinate of a point on the last line segment relative to the node's center - * @param dx the x-component of the normalized direction vector indicating the direction of the segment pointing towards the node - * @param dy the y-component of the normalized direction vector indicating the direction of the segment pointing towards the node - * @returns the intersection coordinates relative to the node's center or null if no such intersection was found - * @abstract - */ - calculateIntersectionPoint(nodeLayout:yfiles.layout.INodeLayout,xOffset:number,yOffset:number,dx:number,dy:number):yfiles.algorithms.YPoint; - } - var IIntersectionCalculator:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IIntersectionCalculator; - }; - /** - * Helper class that declares several keys for {@link yfiles.algorithms.IDataProvider} that provide - * {@link yfiles.layout.IIntersectionCalculator}. - * @class - * @static - */ - export interface IntersectionCalculatorKeys extends yfiles.lang.Object{} - export class IntersectionCalculatorKeys { - /** - * Data provider key for providing an individual intersection calculation for each edge source in the graph - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static SOURCE_INTERSECTION_CALCULATOR_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for providing an individual intersection calculation for each edge target in the graph - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static TARGET_INTERSECTION_CALCULATOR_DP_KEY:yfiles.algorithms.EdgeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.IntersectionCalculatorKeys; - } - /** - * {@link yfiles.layout.ILabelLayout} defines the properties of a label from the perspective of a labeling algorithm. - *

- * Both node and edge labels need to implement this interface. It describes the size and position of a label. - *

- *

- * Note: To avoid inconsistencies, changing the {@link yfiles.layout.ILabelLayout#modelParameter model parameter} should always be combined with updating the corresponding - * {@link yfiles.layout.ILabelLayout#orientedBox oriented box}. - *

- * @interface - */ - export interface ILabelLayout extends yfiles.lang.Object{ - /** - * Gets the bounding box of the label. - *

- * The bounding box is the smallest, paraxial rectangle that contains the whole label. - *

- * @abstract - * @type {yfiles.algorithms.YRectangle} - */ - boundingBox:yfiles.algorithms.YRectangle; - /** - * Gets the box of the label. - *

- * This box matches the area that is covered by the label. The {@link yfiles.algorithms.YOrientedRectangle#setUpVector up vector} of the rectangle encodes the orientation of the - * label. - *

- * @abstract - * @type {yfiles.algorithms.YOrientedRectangle} - */ - orientedBox:yfiles.algorithms.YOrientedRectangle; - /** - * Gets or sets the label model parameter that describes the position of this label. - *

- * The model parameter must fit the according label model. - *

- * @abstract - * @type {any} - */ - modelParameter:any; - } - var ILabelLayout:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.ILabelLayout; - }; - /** - * {@link yfiles.layout.ILabelLayoutFactory} provides methods to create, add and remove node/edge labels for - * {@link yfiles.layout.LayoutGraph}s. - *

- * It can be used, e.g., to temporarily add labels during layout calculation. - *

- *

- * Note that original labels which are removed during a layout calculation have to be re-added when the layout calculation - * is done. - *

- *

- * An instance of this factory can be obtained with method {@link yfiles.layout.LayoutGraphUtilities#getLabelFactory}. This method - * uses the {@link yfiles.layout.LayoutGraph#createLabelFactory} method to create the factory. - *

- *

- * Note that each factory instance is bound to a specific graph instance, i.e., you can only create, add and remove labels - * for the graph which was given to method {@link yfiles.layout.LayoutGraphUtilities#getLabelFactory}. - *

- * @interface - */ - export interface ILabelLayoutFactory extends yfiles.lang.Object{ - /** - * Adds the given {@link yfiles.layout.IEdgeLabelLayout} to the given edge. - *

- * The given {@link yfiles.layout.ILabelLayout} has to be created with method {@link yfiles.layout.ILabelLayoutFactory#createLabelLayout} - * or {@link yfiles.layout.ILabelLayoutFactory#createLabelLayout}. - *

- * @param edge the edge - * @param labelLayout the edge label layout that should be added to the given edge - * @throws {Stubs.Exceptions.ArgumentError} if the given label layout has already been added to the graph - * @see yfiles.layout.ILabelLayoutFactory#createLabelLayout - * @see yfiles.layout.ILabelLayoutFactory#createLabelLayout - * @abstract - */ - addLabelLayout(edge:yfiles.algorithms.Edge,labelLayout:yfiles.layout.IEdgeLabelLayout):void; - /** - * Adds the given node label layout to the given node. - *

- * The given label layout has to be created with method {@link yfiles.layout.ILabelLayoutFactory#createLabelLayout} or - * {@link yfiles.layout.ILabelLayoutFactory#createLabelLayout}. - *

- * @param node the node - * @param labelLayout the node label layout that should be added to the given node - * @throws {Stubs.Exceptions.ArgumentError} if the given label layout has already been added to the graph - * @see yfiles.layout.ILabelLayoutFactory#createLabelLayout - * @see yfiles.layout.ILabelLayoutFactory#createLabelLayout - * @abstract - */ - addLabelLayout(node:yfiles.algorithms.Node,labelLayout:yfiles.layout.INodeLabelLayout):void; - /** - * Creates a new {@link yfiles.layout.ILabelLayout} for the given edge. - * @param edge the edge - * @param orientedBox the box specifying the size and location of the label - * @param model specifies the model of the created edge label - * @param descriptor specifies the preferred placement descriptor of the created label. If this value is - * null, the default descriptor is used - * @returns a new edge label layout - * @see yfiles.layout.ILabelLayoutFactory#addLabelLayout - * @abstract - */ - createLabelLayout(edge:yfiles.algorithms.Edge,orientedBox:yfiles.algorithms.YOrientedRectangle,model:yfiles.layout.IEdgeLabelLayoutModel,descriptor:yfiles.layout.PreferredPlacementDescriptor):yfiles.layout.IEdgeLabelLayout; - /** - * Creates a new {@link yfiles.layout.ILabelLayout} for the given node. - * @param node the node - * @param orientedBox the box specifying the size and location of the label - * @param model specifies the model of the created node label - * @returns a new node label layout - * @see yfiles.layout.ILabelLayoutFactory#addLabelLayout - * @abstract - */ - createLabelLayout(node:yfiles.algorithms.Node,orientedBox:yfiles.algorithms.YOrientedRectangle,model:yfiles.layout.INodeLabelLayoutModel):yfiles.layout.INodeLabelLayout; - /** - * Creates a new {@link yfiles.layout.ILabelLayout} for the given edge. - *

- * This method should create a {@link yfiles.layout.ILabelLayout} with an {@link yfiles.layout.IEdgeLabelLayoutModel} that supports the - * desired oriented label box exactly as given. - *

- * @param edge the edge - * @param orientedBox the box specifying the size and location of the label - * @returns a new edge label layout - * @see yfiles.layout.ILabelLayoutFactory#addLabelLayout - * @abstract - */ - createLabelLayout(edge:yfiles.algorithms.Edge,orientedBox:yfiles.algorithms.YOrientedRectangle):yfiles.layout.IEdgeLabelLayout; - /** - * Creates a new {@link yfiles.layout.ILabelLayout} for the given node. - *

- * This method should create a {@link yfiles.layout.ILabelLayout} with a {@link yfiles.layout.INodeLabelLayoutModel} that supports the - * desired oriented label box exactly as given. - *

- * @param node the node - * @param orientedBox the box specifying the size and location of the label - * @returns a new node label layout - * @see yfiles.layout.ILabelLayoutFactory#addLabelLayout - * @abstract - */ - createLabelLayout(node:yfiles.algorithms.Node,orientedBox:yfiles.algorithms.YOrientedRectangle):yfiles.layout.INodeLabelLayout; - /** - * Removes the given {@link yfiles.layout.IEdgeLabelLayout} from the given edge. - * @param edge the edge - * @param labelLayout the label layout that should be removed from the given edge - * @see yfiles.layout.ILabelLayoutFactory#addLabelLayout - * @abstract - */ - removeLabelLayout(edge:yfiles.algorithms.Edge,labelLayout:yfiles.layout.IEdgeLabelLayout):void; - /** - * Removes the given node label layout from the given node. - * @param node the node - * @param labelLayout the label layout that should be removed from the given node - * @see yfiles.layout.ILabelLayoutFactory#addLabelLayout - * @abstract - */ - removeLabelLayout(node:yfiles.algorithms.Node,labelLayout:yfiles.layout.INodeLabelLayout):void; - /** - * Gets the graph associated with this label factory instance. - * @abstract - * @type {yfiles.layout.LayoutGraph} - */ - graph:yfiles.layout.LayoutGraph; - } - var ILabelLayoutFactory:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.ILabelLayoutFactory; - }; - /** - * {@link yfiles.layout.ILayoutAlgorithm} describes the general interface for algorithms that perform a layout process on a - * {@link yfiles.layout.LayoutGraph}. - *

- * The main method for invoking the layout calculation is - * {@link yfiles.layout.ILayoutAlgorithm#applyLayout}. Implementing classes will arrange the graph there. - *

- *

- * This class also provides keys to register {@link yfiles.algorithms.IDataProvider}s with the graph that contain information about - * the nodes and edges in the graph. {@link yfiles.algorithms.IDataProvider}s registered with {@link yfiles.layout.LayoutKeys#NODE_ID_DP_KEY} - * and {@link yfiles.layout.LayoutKeys#EDGE_ID_DP_KEY} contain unique identifiers for both nodes and edges. These identifiers allow - * for ensuring consistent results even if the order of nodes and edges was changed between two layout runs. - *
- * The selection state of nodes and edges is stored in {@link yfiles.algorithms.IDataProvider}s registered with the keys {@link yfiles.layout.LayoutKeys#AFFECTED_NODES_DP_KEY} - * and - * {@link yfiles.layout.LayoutKeys#AFFECTED_EDGES_DP_KEY}. Based on this information, the layout algorithm may reduce its - * calculations to the selected subset of nodes or edges. - *

- * @interface - */ - export interface ILayoutAlgorithm extends yfiles.lang.Object{ - /** - * Main layout routine that assigns new layout information to the given graph. - *

- * The call to this routine will only succeed if the layout algorithm can handle the input graph. - *

- * @param graph the input graph - * @abstract - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - } - var ILayoutAlgorithm:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.ILayoutAlgorithm; - }; - /** - * Helper class that provides unique identifiers for some general purpose {@link yfiles.algorithms.IDataProvider data providers}. - * @class - * @static - */ - export interface LayoutKeys extends yfiles.lang.Object{} - export class LayoutKeys { - /** - * Data provider key for looking up a unique identifier for each node in a graph - *

- * Layout algorithms may use this information to provide consistent layouts for multiple runs. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_ID_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for looking up a unique identifier for each edge in a graph - *

- * Layout algorithms may use this information to provide consistent layouts for multiple runs. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for looking up the selected state of the nodes in the graph - *

- * A layout algorithm can retrieve a {@link yfiles.algorithms.IDataProvider} registered with this key to apply a special handling - * to the selected nodes. For example, the layout algorithm may restrict its scope, i.e., it only arranges the selected - * nodes. - *

- *

- * However, it is often more convenient to use a specific {@link yfiles.algorithms.IDataProvider} key for this purpose, e.g., if - * you want to combine two layout algorithms of the same kind which have to operate on different subsets of the graph. - * Thus, these algorithms may provide a method like setSubgraphNodesDpKey(Object) that customizes the {@link yfiles.algorithms.IDataProvider} - * key allowing to specify different sets of selected nodes for nested layout algorithms. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static AFFECTED_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for looking up the selected state of the edges in the graph - *

- * A layout algorithm can retrieve a {@link yfiles.algorithms.IDataProvider} registered with this key to apply a special handling - * to the selected edges. For example, the layout algorithm may restrict its scope, i.e., it only routes the selected - * edges. - *

- *

- * However, it is often more convenient to use a specific {@link yfiles.algorithms.IDataProvider} key for this purpose, e.g., if - * you want to combine two layout algorithms of the same kind which have to operate on different subsets of the graph. - * Thus, these algorithms may provide a method like setSubgraphEdgesDpKey(Object) that customizes the {@link yfiles.algorithms.IDataProvider} - * key allowing to specify different sets of selected edges for nested layout algorithms. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LayoutKeys; - } - /** - * A {@link yfiles.layout.ILayoutStage} is a layout algorithm that represents a stage of a larger layout process. - *

- * It delegates the core layout process to another {@link yfiles.layout.ILayoutAlgorithm layout algorithm}. Implementing classes may perform pre-processing steps - * before the {@link yfiles.layout.ILayoutStage#coreLayout core layout algorithm} gets called and post-processing steps afterwards. - *

- * @see yfiles.layout.MultiStageLayout - * @interface - * @implements {yfiles.layout.ILayoutAlgorithm} - */ - export interface ILayoutStage extends yfiles.lang.Object,yfiles.layout.ILayoutAlgorithm{ - /** - * Gets or sets the core layout algorithm. - *

- * This algorithm is wrapped by this stage. It is invoked in {@link yfiles.layout.ILayoutAlgorithm#applyLayout}. The {@link yfiles.layout.ILayoutStage} - * may add pre- and post-processing steps before and after calling the core layout algorithm. - *

- * @abstract - * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - } - var ILayoutStage:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.ILayoutStage; - }; - /** - * {@link yfiles.layout.INodeLabelLayout} defines the properties of one node label from the perspective of a labeling algorithm. - *

- * Note: To avoid inconsistencies, changing the {@link yfiles.layout.ILabelLayout#modelParameter model parameter} should always be combined with updating the corresponding - * {@link yfiles.layout.ILabelLayout#orientedBox oriented box}. - *

- * @interface - * @implements {yfiles.layout.ILabelLayout} - */ - export interface INodeLabelLayout extends yfiles.lang.Object,yfiles.layout.ILabelLayout{ - /** - * Gets the label model that describes the valid locations for this label. - * @abstract - * @type {yfiles.layout.INodeLabelLayoutModel} - */ - labelModel:yfiles.layout.INodeLabelLayoutModel; - } - var INodeLabelLayout:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.INodeLabelLayout; - }; - /** - * {@link yfiles.layout.INodeLabelLayoutModel} defines the properties of the model associated with a - * {@link yfiles.layout.INodeLabelLayout}. - *

- * A {@link yfiles.layout.INodeLabelLayoutModel} provides a set of possible candidates for the placement of a node label. It also defines a parameter - * that describes the current location of the label. - *

- *

- * It is important that all state information is encapsulated in the {@link yfiles.layout.INodeLabelLayoutModel#createModelParameter model parameter}. {@link yfiles.layout.INodeLabelLayoutModel} - * instances may be shared between multiple node labels but produce different parameters for labels with different - * locations. - *

- * @interface - */ - export interface INodeLabelLayoutModel extends yfiles.lang.Object{ - /** - * Creates a model parameter that represents the given node label position within this model. - *

- * The created model parameter is the closest parameter representation of the given label location that can be achieved - * within this model. - *

- *

- * This parameter can be passed to {@link yfiles.layout.INodeLabelLayoutModel#getLabelPlacement} to retrieve the current label - * box. - *

- *

- * A model parameter can be an arbitrary {@link any}. However it must contain all information to allow restoring of the encoded - * location with this {@link yfiles.layout.INodeLabelLayoutModel}. - *

- * @param labelBounds the box of the label, encoding the label location for which the parameter should be created - * @param nodeLayout the layout of the node to which the label belongs - * @returns the model parameter representing the given label location - * @see yfiles.layout.INodeLabelLayoutModel#getLabelPlacement - * @abstract - */ - createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,nodeLayout:yfiles.layout.INodeLayout):any; - /** - * Returns all {@link yfiles.layout.NodeLabelCandidate}s that describe valid label positions within this model. - *

- * In case the implementing {@link yfiles.layout.INodeLabelLayoutModel} allows every possible location, this method always returns - * the current location as a {@link yfiles.layout.LabelCandidate}. - *

- * @param labelLayout the label for which candidates should be generated - * @param nodeLayout the layout of the node to which the label belongs - * @returns a list of {@link } instances - * @abstract - */ - getLabelCandidates(labelLayout:yfiles.layout.INodeLabelLayout,nodeLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; - /** - * Returns the bounds of the label for the position encoded by the given model parameter. - * @param labelSize the width and height of the label - * @param nodeLayout the layout of the node to which the label belongs - * @param param the model parameter that describes the abstract position of the label within this model - * @returns the oriented box of the label - * @abstract - */ - getLabelPlacement(labelSize:yfiles.algorithms.YDimension,nodeLayout:yfiles.layout.INodeLayout,param:any):yfiles.algorithms.YOrientedRectangle; - /** - * Gets a model parameter that encodes the default position of this model's allowed node label positions. - *

- * This parameter can be passed to {@link yfiles.layout.INodeLabelLayoutModel#getLabelPlacement} to retrieve the corresponding - * label box. - *

- * @abstract - * @type {any} - */ - defaultParameter:any; - } - var INodeLabelLayoutModel:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.INodeLabelLayoutModel; - }; - /** - * A {@link yfiles.layout.INodeLayout} encapsulates the layout information for a node. - *

- * The layout information consists of the size and position of the node. - *

- * @interface - */ - export interface INodeLayout extends yfiles.lang.Object{ - /** - * Sets the coordinates of the upper-left corner of the node. - * @param x the new x-coordinate of the node - * @param y the new y-coordinate of the node - * @abstract - */ - setLocation(x:number,y:number):void; - /** - * Sets the size of the node. - * @param width the new width of the node - * @param height the new height of the node - * @abstract - */ - setSize(width:number,height:number):void; - /** - * Gets the x-coordinate of the upper-left corner of the node. - *

- * The location of the node is described by the coordinates of the upper-left corner of the node. - *

- * @abstract - * @type {number} - */ - x:number; - /** - * Gets the y-coordinate of the upper-left corner of the node. - *

- * The location of the node is described by the coordinates of the upper-left corner of the node. - *

- * @abstract - * @type {number} - */ - y:number; - /** - * Gets the width of the node. - *

- * The width of the node is the horizontal distance the node spans. - *

- * @abstract - * @type {number} - */ - width:number; - /** - * Gets the height of the node. - *

- * The height of the node is the vertical distance the node spans. - *

- * @abstract - * @type {number} - */ - height:number; - } - var INodeLayout:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.INodeLayout; - }; - /** - * An {@link yfiles.layout.IPartitionInterEdgeRouter} is responsible for routing inter-edges. - *

- * An inter-edge is an edge that connects nodes that belong to different partitions. - *

- * @interface - */ - export interface IPartitionInterEdgeRouter extends yfiles.lang.Object{ - /** - * Routes inter-edges of the partitioned graph. - * @param graph the input graph - * @param partitionIDDP the partition ID for each node in the graph - * @param interEdgeDP the map that marks inter-edges - * @abstract - */ - routeInterEdges(graph:yfiles.layout.LayoutGraph,partitionIDDP:yfiles.algorithms.IDataProvider,interEdgeDP:yfiles.algorithms.IDataProvider):void; - /** - * Gets or sets whether or not to route inter-edges only. - *

- * Inter-edges are edges that connect nodes from different partitions. If this feature is disabled, all edges are routed by - * this routing algorithm. - *

- * @abstract - * @type {boolean} - */ - routeInterEdgesOnly:boolean; - } - var IPartitionInterEdgeRouter:{ - /** - * Routes inter-edges using {@link yfiles.router.ChannelEdgeRouter}. - * @param [router=null] The router instance to use for the edge routing. If not specified, a internal instance is used. - * @returns - * @static - */ - createChannelInterEdgeRouter?(router?:yfiles.router.ChannelEdgeRouter):yfiles.layout.IPartitionInterEdgeRouter; - /** - * Routes inter-edges using {@link yfiles.router.EdgeRouter}. - * @param [router=null] The router instance to use for the edge routing. If not specified, a internal instance is used. - * @returns - * @static - */ - createPolylineInterEdgeRouter?(router?:yfiles.router.EdgeRouter):yfiles.layout.IPartitionInterEdgeRouter; - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IPartitionInterEdgeRouter; - }; - /** - * A {@link yfiles.layout.IProfitModel} ranks - * {@link yfiles.layout.LabelCandidate}s used for prioritizing certain label locations over others. - *

- * Generic labeling algorithm {@link yfiles.labeling.GenericLabeling} will use the ranking to decide which - * {@link yfiles.layout.LabelCandidate}s to eliminate. - *

- *

- * {@link yfiles.layout.LabelCandidate}s with a high profit will be preferred over - * {@link yfiles.layout.LabelCandidate}s with a low profit. - *

- * @interface - */ - export interface IProfitModel extends yfiles.lang.Object{ - /** - * Returns the profit for placing a label using the given {@link yfiles.layout.LabelCandidate}. - *

- * Higher profit means better candidates. Hence, there is a higher probability that the candidate is chosen by a labeling - * algorithm. - *

- *

- * Profits need to have a value between 0 and 1. - *

- * @param candidate the candidate - * @returns the profit of the candidate - * @abstract - */ - getProfit(candidate:yfiles.layout.LabelCandidate):number; - } - var IProfitModel:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IProfitModel; - }; - /** - * A {@link yfiles.layout.LabelCandidate} describes one valid placement for a label considering the label model. - *

- * Generic labeling algorithms place labels according to their label model. To get valid locations for the label, the label - * model generates various - * {@link yfiles.layout.LabelCandidate}s. One of these candidates will be chosen to provide the actual placement of the label. - *

- * @see yfiles.layout.INodeLabelLayoutModel - * @see yfiles.layout.IEdgeLabelLayoutModel - * @see yfiles.labeling.GenericLabeling - * @class - * @implements {yfiles.algorithms.IPlaneObject} - */ - export interface LabelCandidate extends yfiles.lang.Object,yfiles.algorithms.IPlaneObject{} - export class LabelCandidate { - /** - * Creates a new instance of {@link yfiles.layout.LabelCandidate} described by location, size, model parameter and internal flag. - * @param pos the location of the upper left corner of the candidate - * @param size the size of the candidate - * @param param the parameters of the label model associated with this candidate - * @param owner the label associated with the candidate - * @param [internal=false] true if the candidate is allowed to overlap with its owner, false otherwise - */ - constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:any,owner:yfiles.layout.ILabelLayout,internal?:boolean); - /** - * Creates a new instance of {@link yfiles.layout.LabelCandidate} described by its box, model parameter and internal flag. - * @param labelBox the box that specifies the candidate's size and position - * @param param the parameters of the label model associated with this candidate - * @param owner the label associated with the candidate - * @param [internal=false] true if the candidate is allowed to overlap with its owner, false otherwise - */ - constructor(labelBox:yfiles.algorithms.YOrientedRectangle,param:any,owner:yfiles.layout.ILabelLayout,internal?:boolean); - /** - * Replaces the model parameter and box of the owner with the model parameter and box of this candidate. - *

- * When this candidate is chosen to provide the placement of the label, this method transfers the model parameter and the - * candidate box to the {@link yfiles.layout.ILabelLayout}. - *

- * @see yfiles.layout.LabelCandidate#owner - * @see yfiles.layout.LabelCandidate#modelParameter - * @see yfiles.layout.LabelCandidate#box - */ - propagate():void; - /** - * Gets or sets the custom profit for this candidate. - *

- * The profit describes the priority of this candidate with respect to other candidates. Labeling algorithms will use the - * profit to decide which candidate to choose. - *

- *

- * The value is restricted to the interval [0,1], where 1 specifies the highest possible profit. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified value lies outside of [0,1] - * @type {number} - */ - customProfit:number; - /** - * Gets the model parameter that was used by the underlying model to generate this label candidate. - * @type {any} - */ - modelParameter:any; - /** - * Gets the coordinates of the upper-left corner of the candidate's bounds. - *

- * The bounds are the smallest paraxial box that contains the candidate. - *

- * @see yfiles.layout.LabelCandidate#boundingBox - * @type {yfiles.algorithms.YPoint} - */ - location:yfiles.algorithms.YPoint; - /** - * Gets the width and height of the candidate's bounds. - *

- * The bounds are the smallest paraxial box that contains the candidate. - *

- * @see yfiles.layout.LabelCandidate#boundingBox - * @type {yfiles.algorithms.YDimension} - */ - size:yfiles.algorithms.YDimension; - /** - * Gets the minimum x-coordinate of the candidate's bounds. - *

- * The bounds are the smallest paraxial box that contains the candidate. - *

- * @see yfiles.layout.LabelCandidate#location - * @see yfiles.layout.LabelCandidate#boundingBox - * @type {number} - */ - x:number; - /** - * Gets the minimum y-coordinate of the candidate's bounds. - *

- * The bounds are the smallest paraxial box that contains the candidate. - *

- * @see yfiles.layout.LabelCandidate#location - * @see yfiles.layout.LabelCandidate#boundingBox - * @type {number} - */ - y:number; - /** - * Gets the width of the candidate's bounds. - *

- * The bounds are the smallest paraxial box that contains the candidate. - *

- * @see yfiles.layout.LabelCandidate#size - * @see yfiles.layout.LabelCandidate#boundingBox - * @type {number} - */ - width:number; - /** - * Gets the height of the candidate's bounding box. - *

- * The bounding box is the smallest paraxial box that contains the candidate. - *

- * @see yfiles.layout.LabelCandidate#size - * @see yfiles.layout.LabelCandidate#boundingBox - * @type {number} - */ - height:number; - /** - * Gets the bounding box of this candidate. - *

- * The bounding box describes the smallest paraxial box that contains the candidate. - *

- * @type {yfiles.algorithms.YRectangle} - */ - boundingBox:yfiles.algorithms.YRectangle; - /** - * Gets the oriented box of this candidate. - *

- * If the label is rotated, this box will be oriented accordingly. - *

- * @type {yfiles.algorithms.YOrientedRectangle} - */ - box:yfiles.algorithms.YOrientedRectangle; - /** - * Gets the {@link yfiles.layout.ILabelLayout} for which this candidate was created. - * @type {yfiles.layout.ILabelLayout} - */ - owner:yfiles.layout.ILabelLayout; - /** - * Gets whether or not this candidate describes an internal label. - *

- * Internal labels reside inside the boundaries of a node. - *

- * @type {boolean} - */ - internal:boolean; - /** - * Gets or sets a penalty for a candidate position that overlaps the box of a node. - *

- * The penalty should be a factor between 0 and 1, where 0 means that an overlap is considered unimportant and 1 means that - * an overlap is considered severe. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified penalty is outside [0,1] - * @type {number} - */ - nodeOverlapPenalty:number; - /** - * Gets or sets a penalty for a candidate position that overlaps the path of an edge. - *

- * The penalty should be a factor between 0 and 1, where 0 means that an overlap is considered unimportant and 1 means that - * an overlap is considered severe. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified penalty is outside [0,1] - * @type {number} - */ - edgeOverlapPenalty:number; - /** - * Gets the sum of node overlap penalty and edge overlap penalty. - * @see yfiles.layout.LabelCandidate#edgeOverlapPenalty - * @see yfiles.layout.LabelCandidate#nodeOverlapPenalty - * @type {number} - */ - overlapPenalty:number; - /** - * Gets whether or not this candidate's box had already been chosen by the labeling algorithm. - *

- * If this candidate is propagated, its model parameter and box were transferred to the {@link yfiles.layout.LabelCandidate#owner label}. - *

- * @see yfiles.layout.LabelCandidate#propagate - * @type {boolean} - */ - propagated:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LabelCandidate; - } - /** - * {@link yfiles.layout.LabelLayoutBase} is the default implementation of the {@link yfiles.layout.ILabelLayout} interface. - * @class - * @implements {yfiles.layout.ILabelLayout} - */ - export interface LabelLayoutBase extends yfiles.lang.Object,yfiles.layout.ILabelLayout{} - export class LabelLayoutBase { - /** - * Creates a new {@link yfiles.layout.LabelLayoutBase} instance. - */ - constructor(); - /** - * Sets the box of the label. - *

- * This box matches the area that is covered by the label. The {@link yfiles.algorithms.YOrientedRectangle#setUpVector up vector} of the rectangle encodes the orientation of the - * label. - *

- * @type {yfiles.algorithms.YOrientedRectangle} - */ - orientedBox:yfiles.algorithms.YOrientedRectangle; - /** - * Sets the bounding box of the label. - *

- * The bounding box is the smallest, paraxial rectangle that contains the whole label. - *

- * @type {yfiles.algorithms.YRectangle} - */ - boundingBox:yfiles.algorithms.YRectangle; - /** - * - * @type {any} - */ - modelParameter:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LabelLayoutBase; - } - /** - * {@link yfiles.layout.LabelLayoutData} encapsulates layout information for a label. - *

- * The information is used by clients to inform label-aware {@link yfiles.layout.ILayoutAlgorithm layout algorithms} about labeling constraints like label size - * and preferred placement. - *

- *

- * Label-aware algorithms like {@link yfiles.hierarchic.HierarchicLayout} return the calculated label positions by assigning the - * corresponding box to the provided {@link yfiles.layout.LabelLayoutData} instances. - *

- *

- * {@link yfiles.algorithms.IDataProvider DataProviders} are used for associating an array of {@link yfiles.layout.LabelLayoutData} instances with either the nodes or the - * edges of a {@link yfiles.layout.LayoutGraph}. The {@link yfiles.algorithms.IDataProvider DataProviders} must be registered with the input graph using one of the keys - * defined in {@link yfiles.layout.LabelLayoutKeys}. - *

- * @class - */ - export interface LabelLayoutData extends yfiles.lang.Object{} - export class LabelLayoutData { - /** - * Creates a new instance of {@link yfiles.layout.LabelLayoutData} for a label with the given width and height. - * @param width the width of the label - * @param height the height of the label - */ - constructor(width:number,height:number); - /** - * Creates a new instance of {@link yfiles.layout.LabelLayoutData} for a label with the given oriented box and preferred placement - * descriptor. - * @param bounds the box of the label - * @param [preferredPlacement=null] a preferred placement descriptor - * @throws {Stubs.Exceptions.ArgumentError} if the specified descriptor is null - * @see yfiles.layout.PreferredPlacementDescriptor - * @see yfiles.layout.LabelLayoutData#preferredPlacementDescriptor - */ - constructor(bounds:yfiles.algorithms.YOrientedRectangle,preferredPlacement?:yfiles.layout.PreferredPlacementDescriptor); - /** - * Specifies the coordinates of the upper-left corner of the bounding box of the label. - * @param x the new x-coordinate of the upper-left corner - * @param y the new y-coordinate of the upper-left corner - * @see yfiles.layout.LabelLayoutData#x - * @see yfiles.layout.LabelLayoutData#y - * @see yfiles.algorithms.YOrientedRectangle#boundingBox - */ - setLocation(x:number,y:number):void; - /** - * Specifies the width and height of the {@link yfiles.layout.LabelLayoutData#bounds oriented box} of this label. - * @param width the width of the oriented box - * @param height the height of the oriented box - * @see yfiles.layout.LabelLayoutData#bounds - */ - setSize(width:number,height:number):void; - /** - * Gets or sets the {@link yfiles.algorithms.YOrientedRectangle oriented box} of the label. - * @type {yfiles.algorithms.YOrientedRectangle} - */ - bounds:yfiles.algorithms.YOrientedRectangle; - /** - * Gets the width of the label's bounding box. - * @see yfiles.algorithms.YOrientedRectangle#boundingBox - * @type {number} - */ - width:number; - /** - * Gets the height of the label's bounding box. - * @see yfiles.algorithms.YOrientedRectangle#boundingBox - * @type {number} - */ - height:number; - /** - * Gets the x-coordinate of the upper-left corner of the label's bounding box. - * @see yfiles.algorithms.YOrientedRectangle#boundingBox - * @type {number} - */ - x:number; - /** - * Gets the y-coordinate of the upper-left corner of the label's bounding box. - * @see yfiles.algorithms.YOrientedRectangle#boundingBox - * @type {number} - */ - y:number; - /** - * Gets or sets the preferred placement of this label. - * @throws {Stubs.Exceptions.ArgumentError} if the specified descriptor is null - * @type {yfiles.layout.PreferredPlacementDescriptor} - */ - preferredPlacementDescriptor:yfiles.layout.PreferredPlacementDescriptor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LabelLayoutData; - } - /** - * {@link yfiles.layout.LabelLayoutKeys} are used for associating - * {@link yfiles.algorithms.IDataProvider}s that contain label-specific information for edge and node labels. - *

- * Label-aware layout algorithms like {@link yfiles.hierarchic.HierarchicLayout} may look for such {@link yfiles.algorithms.IDataProvider}s - * that contain {@link yfiles.layout.LabelLayoutData} for each edge. - *

- *

- * Instead of setting up {@link yfiles.layout.LabelLayoutData} and {@link yfiles.algorithms.IDataProvider}s one can also use {@link yfiles.layout.LabelLayoutTranslator} - * to automatically translate information provided by the standard label layout classes {@link yfiles.layout.IEdgeLabelLayout} and - * {@link yfiles.layout.INodeLabelLayout} to layout data accessible through the keys defined below. - *

- * @class - * @static - */ - export interface LabelLayoutKeys extends yfiles.lang.Object{} - export class LabelLayoutKeys { - /** - * Data provider key for accessing label information of each edge in the input graph - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_LABEL_LAYOUT_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for accessing label information of each node in the input graph - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_LABEL_LAYOUT_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for marking labels that should be ignored by the layout algorithm - *

- * A label is ignored if there is a {@link yfiles.algorithms.IDataProvider} registered with this key which returns true for the - * given {@link yfiles.layout.ILabelLayout}. - *

- *

- * The {@link yfiles.layout.LabelLayoutTranslator} only translates labels that should not be ignored. - *

- * @const - * @static - * @type {yfiles.algorithms.ILabelLayoutDpKey.} - */ - static IGNORED_LABELS_DP_KEY:yfiles.algorithms.ILabelLayoutDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LabelLayoutKeys; - } - /** - * {@link yfiles.layout.LabelLayoutTranslator} automatically translates label layout information provided by the standard label - * layout classes {@link yfiles.layout.IEdgeLabelLayout} and {@link yfiles.layout.INodeLabelLayout} to layout data of type {@link yfiles.layout.LabelLayoutData} - * that is accessible by the keys defined in class {@link yfiles.layout.LabelLayoutKeys}. - *

- * One can use this {@link yfiles.layout.ILayoutStage} as label layout algorithm of a label-aware layout algorithm like - * {@link yfiles.hierarchic.HierarchicLayout}. This can be done by assigning the stage by an appropriate call to {@link yfiles.layout.MultiStageLayout#labeling setLabelLayouter}. - *

- *

- * When writing the {@link yfiles.layout.LabelLayoutData}, the {@link yfiles.layout.LabelLayoutData#bounds boxes} are set relative. In case of a node label, the box's {@link yfiles.algorithms.YOrientedRectangle#anchor anchor} is - * relative to the center of the owning node. In case of an edge label the box's anchor is relative to the center of the - * source node of the owning edge. - *

- *

- * If {@link yfiles.layout.LabelLayoutTranslator#writeBackNodeLabels writing back node labels} and/or {@link yfiles.layout.LabelLayoutTranslator#writeBackEdgeLabels writing back edge labels} is enabled, the {@link yfiles.layout.LabelLayoutData} is transferred - * back to the {@link yfiles.layout.INodeLabelLayout}s and/or {@link yfiles.layout.IEdgeLabelLayout}s. - *

- *

- * By default, the {@link yfiles.layout.LabelLayoutData#bounds boxes} are now interpreted absolute but by activating {@link yfiles.layout.LabelLayoutTranslator#writeBackRelativeNodeLabelLocation} and/or {@link yfiles.layout.LabelLayoutTranslator#writeBackRelativeEdgeLabelLocation} this can be changed to interpret them - * relative as explained above. - *

- *

- * Note that care must be taken on the choice of the label model that is used by the classes {@link yfiles.layout.IEdgeLabelLayout} - * and {@link yfiles.layout.INodeLabelLayout}. The calculated label positions must be consistent with the label positions allowed - * by the label model. The best label layout results are achieved by choosing {@link yfiles.layout.FreeEdgeLabelLayoutModel} for - * edge layouts and {@link yfiles.layout.FreeNodeLabelLayoutModel} for node layouts. - *

- * @class - * @implements {yfiles.layout.ILayoutStage} - */ - export interface LabelLayoutTranslator extends yfiles.lang.Object,yfiles.layout.ILayoutStage{} - export class LabelLayoutTranslator { - /** - * Creates a new {@link yfiles.layout.LabelLayoutTranslator} instance with default settings. - */ - constructor(); - /** - * Translates traditional {@link yfiles.layout.ILabelLayout} information to {@link yfiles.algorithms.IDataProvider}-based - * {@link yfiles.layout.LabelLayoutData}. - *

- * Afterwards, the calculated layout data will be written back to the original label layout. - *

- * @param graph the input graph - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Gets or sets the core layout algorithm that is wrapped by this {@link yfiles.layout.ILayoutStage}. - * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets whether or not this stage should automatically flip edge label content depending on the label's rotation - * angle. - *

- * More precisely, if this option is enabled and the up vector of the {@link yfiles.algorithms.YOrientedRectangle} associated with - * an {@link yfiles.layout.IEdgeLabelLayout} points downwards ({@link yfiles.algorithms.YOrientedRectangle#upY upY} > 0), this {@link yfiles.layout.ILayoutStage} automatically flips the - * label. It rotates the label by 180 degrees without changing the label's center. - *

- * @see yfiles.layout.LayoutGraphUtilities#autoFlipBox - * @see yfiles.layout.ILabelLayout#orientedBox - * @type {boolean} - */ - autoFlippingEnabled:boolean; - /** - * Gets or sets whether or not to reset the orientation of node labels. - *

- * If this option is enabled, the up vector of the corresponding oriented box is set to (0,-1) before adding it to the - * {@link yfiles.algorithms.IDataProvider}. - *

- * @type {boolean} - */ - resettingNodeLabelOrientation:boolean; - /** - * Gets or sets whether or not to reset the orientation of edge labels. - *

- * If this option is enabled, the up vector of the corresponding oriented box is set to (0,-1) before adding it to the - * {@link yfiles.algorithms.IDataProvider}. - *

- * @type {boolean} - */ - resettingEdgeLabelOrientation:boolean; - /** - * Gets or sets whether or not edge label information is written back to the model after core layout. - * @type {boolean} - */ - writeBackEdgeLabels:boolean; - /** - * Gets or sets whether or not edge label {@link yfiles.layout.LabelLayoutData#bounds boxes} are interpreted relative to the edge when writing them back to the model. - * @type {boolean} - */ - writeBackRelativeEdgeLabelLocation:boolean; - /** - * Gets or sets whether or not node label information is written back to the model after the core layout. - * @type {boolean} - */ - writeBackNodeLabels:boolean; - /** - * Gets or sets whether or not node label {@link yfiles.layout.LabelLayoutData#bounds bounds} are interpreted relative to the node when writing them back to the model. - * @type {boolean} - */ - writeBackRelativeNodeLabelLocation:boolean; - /** - * Gets or sets whether or not node label information is translated. - * @type {boolean} - */ - translateNodeLabels:boolean; - /** - * Gets or sets whether or not edge label information is translated. - * @type {boolean} - */ - translateEdgeLabels:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LabelLayoutTranslator; - } - /** - * A {@link yfiles.layout.LayoutGraph} is a {@link yfiles.algorithms.Graph} with attached layout information that basically represents a - * drawing of a graph. - *

- * It provides access to the layout information for nodes, edges and labels. This layout information consists of - * coordinates for the elements. - *

- *

- * {@link yfiles.layout.ILayoutAlgorithm Layout algorithms} work on {@link yfiles.layout.LayoutGraph}s and arrange their nodes and edges. - *

- * @class - * @extends {yfiles.algorithms.Graph} - */ - export interface LayoutGraph extends yfiles.algorithms.Graph{} - export class LayoutGraph { - /** - * Creates a new {@link yfiles.layout.LayoutGraph} which is a copy of the given subgraph. - * @param graph the original graph - * @param nodeSubset the nodes that induce the subgraph - */ - constructor(graph:yfiles.layout.LayoutGraph,nodeSubset:yfiles.algorithms.ICursor); - /** - * Creates a new {@link yfiles.layout.LayoutGraph} which is a copy of the given subgraph. - * @param subgraph the original subgraph - */ - constructor(subgraph:yfiles.layout.LayoutGraph); - /** - * Creates a new, empty {@link yfiles.layout.LayoutGraph} with default settings. - */ - constructor(); - /** - * Creates a new {@link yfiles.layout.ILabelLayoutFactory} for this {@link yfiles.layout.LayoutGraph} that can be used for copying layout - * information of labels. - * @returns the new {@link } - * @protected - * @abstract - */ - createLabelFactory():yfiles.layout.ILabelLayoutFactory; - /** - * Returns the rectangle describing the bounding box of the given node. - * @param node the node - * @returns the bounds of the node - * @see yfiles.layout.LayoutGraph#getLocation - * @see yfiles.layout.LayoutGraph#getSize - */ - getBoundingBox(node:yfiles.algorithms.Node):yfiles.algorithms.YRectangle; - /** - * Returns the center coordinates of the given node. - * @param node the node - * @returns the location of the node's center - * @see yfiles.layout.INodeLayout - * @see yfiles.layout.LayoutGraph#setCenter - */ - getCenter(node:yfiles.algorithms.Node):yfiles.algorithms.YPoint; - /** - * Returns the x-coordinate of the given node's center. - * @param node the node - * @returns the x-value of the node's center coordinate - * @see yfiles.layout.INodeLayout - */ - getCenterX(node:yfiles.algorithms.Node):number; - /** - * Returns the y-coordinate of the given node's center. - * @param node the node - * @returns the y-value of the node's center coordinate - * @see yfiles.layout.INodeLayout - */ - getCenterY(node:yfiles.algorithms.Node):number; - /** - * Returns the height of the given node. - * @param node the node - * @returns the height of the node - * @see yfiles.layout.INodeLayout#height - */ - getHeight(node:yfiles.algorithms.Node):number; - /** - * Returns the layout information for all labels associated with the given edge. - *

- * The layout information consists of the location, size and orientation of the label. - *

- * @param edge the edge - * @returns the layout information for the edge's labels - * @abstract - */ - getLabelLayout(edge:yfiles.algorithms.Edge):yfiles.layout.IEdgeLabelLayout[]; - /** - * Returns the layout information for all labels associated with the given node. - *

- * The layout information consists of the location, size and orientation of the label. - *

- * @param node the node - * @returns the layout information for the node's labels - * @abstract - */ - getLabelLayout(node:yfiles.algorithms.Node):yfiles.layout.INodeLabelLayout[]; - /** - * Returns the layout information for the given edge. - *

- * The layout information consists of the locations of the control points and end points of the edge. - *

- * @param edge the edge - * @returns the layout information for the edge - * @abstract - */ - getLayout(edge:yfiles.algorithms.Edge):yfiles.layout.IEdgeLayout; - /** - * Returns the layout information for the given node. - *

- * The layout information consists of the location and size of the node. - *

- * @param node the node - * @returns the layout information for the node - * @abstract - */ - getLayout(node:yfiles.algorithms.Node):yfiles.layout.INodeLayout; - /** - * Returns the coordinates of the given node's upper-left corner. - * @param node the node - * @returns the location of the node's upper-left corner - * @see yfiles.layout.INodeLayout#x - * @see yfiles.layout.INodeLayout#y - */ - getLocation(node:yfiles.algorithms.Node):yfiles.algorithms.YPoint; - /** - * Returns the edge to which the given {@link yfiles.layout.IEdgeLabelLayout} belongs. - * @param labelLayout the label's layout information - * @returns the edge that owns the label - * @abstract - */ - getOwnerEdge(labelLayout:yfiles.layout.IEdgeLabelLayout):yfiles.algorithms.Edge; - /** - * Returns the node to which the given {@link yfiles.layout.INodeLabelLayout} belongs. - * @param labelLayout the label's layout information - * @returns the node that owns the label - * @abstract - */ - getOwnerNode(labelLayout:yfiles.layout.INodeLabelLayout):yfiles.algorithms.Node; - /** - * Returns the path of an edge, including the ports. - *

- * The path of an edge is the position of the source port, followed by the positions of the bends, followed by the position - * of the target port. - *

- * @param edge the edge - * @returns the path of the given edge - */ - getPath(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPointPath; - /** - * Returns the path of an edge, including the ports. - *

- * The path of an edge is the position of the source port, followed by the positions of the bends, followed by the position - * of the target port. - *

- * @param edge the edge - * @returns a list of {@link }s representing the path of the given edge - */ - getPathList(edge:yfiles.algorithms.Edge):yfiles.algorithms.YList; - /** - * Returns the control points of an edge. - * @param edge the edge - * @returns a list of {@link }s representing the sequence of control points of the edge - * @see yfiles.layout.IEdgeLayout - */ - getPointList(edge:yfiles.algorithms.Edge):yfiles.algorithms.YList; - /** - * Returns the control points of an edge. - * @param edge the edge - * @returns a {@link } representing the sequence of control points of the edge - * @see yfiles.layout.IEdgeLayout - */ - getPoints(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPointPath; - /** - * Returns the size of the given node. - * @param node the node - * @returns the size of the node - * @see yfiles.layout.INodeLayout#width - * @see yfiles.layout.INodeLayout#height - */ - getSize(node:yfiles.algorithms.Node):yfiles.algorithms.YDimension; - /** - * Returns the absolute coordinates of the source point of the given edge. - * @param edge the edge - * @returns the absolute source point coordinates of the edge - */ - getSourcePointAbs(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPoint; - /** - * Returns the relative coordinates of the source point of the given edge. - *

- * The coordinates are interpreted relative to the center of the source node. - *

- * @param edge the edge - * @returns the relative source point coordinates of the edge - * @see yfiles.layout.IEdgeLayout#sourcePoint - */ - getSourcePointRel(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPoint; - /** - * Returns the absolute coordinates of the target point of the given edge. - * @param edge the edge - * @returns the absolute target point coordinates of the edge - */ - getTargetPointAbs(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPoint; - /** - * Returns the relative coordinates of the target point of the given edge. - *

- * The coordinates are interpreted relative to the center of the target node. - *

- * @param edge the edge - * @returns the relative target point coordinates of the edge - * @see yfiles.layout.IEdgeLayout#targetPoint - */ - getTargetPointRel(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPoint; - /** - * Returns the width of the given node. - * @param node the node - * @returns the width of the node - * @see yfiles.layout.INodeLayout#width - */ - getWidth(node:yfiles.algorithms.Node):number; - /** - * Returns the x-coordinate of the given node's upper-left corner. - * @param node the node - * @returns the x-value of the node's upper-left corner - * @see yfiles.layout.INodeLayout#x - */ - getX(node:yfiles.algorithms.Node):number; - /** - * Returns the y-coordinate of the given node's upper-left corner. - * @param node the node - * @returns the y-value of the node's upper-left corner - * @see yfiles.layout.INodeLayout#y - */ - getY(node:yfiles.algorithms.Node):number; - /** - * Moves the upper-left corner of a node by a given vector. - * @param node the node - * @param dx the x-component of the vector - * @param dy the y-component of the vector - */ - moveBy(node:yfiles.algorithms.Node,dx:number,dy:number):void; - /** - * Specifies the center coordinates of the given node. - * @param node the node - * @param x the new x-coordinate of the node's center - * @param y the new y-coordinate of the node's center - * @see yfiles.layout.INodeLayout - */ - setCenter(node:yfiles.algorithms.Node,x:number,y:number):void; - /** - * Specifies the center coordinates of the given node. - * @param node the node - * @param position the new location of the node's center - * @see yfiles.layout.INodeLayout - * @see yfiles.layout.LayoutGraph#setCenter - */ - setCenter(node:yfiles.algorithms.Node,position:yfiles.algorithms.YPoint):void; - /** - * Specifies the two end points of the given edge in absolute coordinates. - * @param edge the edge - * @param source the port on the source side of the edge - * @param target the port on the target side of the edge - * @see yfiles.layout.LayoutGraph#setSourcePointAbs - * @see yfiles.layout.LayoutGraph#setTargetPointAbs - */ - setEndPointsAbs(edge:yfiles.algorithms.Edge,source:yfiles.algorithms.YPoint,target:yfiles.algorithms.YPoint):void; - /** - * Specifies the coordinates of the upper-left corner of the given node. - * @param node the node - * @param x the new x-coordinate of the upper-left corner - * @param y the new y-coordinate of the upper-left corner - * @see yfiles.layout.INodeLayout#setLocation - */ - setLocation(node:yfiles.algorithms.Node,x:number,y:number):void; - /** - * Specifies the coordinates of the upper-left corner of the given node. - * @param node the node - * @param position the new location of the upper-left corner - * @see yfiles.layout.INodeLayout#setLocation - * @see yfiles.layout.LayoutGraph#setLocation - */ - setLocation(node:yfiles.algorithms.Node,position:yfiles.algorithms.YPoint):void; - /** - * Sets the path of the given edge. - *

- * The path of an edge is the position of the source port, followed by the positions of the bends, followed by the position - * of the target port. - *

- *

- * Both source and target port are expected to be given in absolute coordinates. - *

- * @param edge an edge in the graph - * @param path the list of {@link }s representing the new path sequence of the edge - */ - setPath(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList):void; - /** - * Sets the path of the given edge. - *

- * The path of an edge is the position of the source port, followed by the positions of the bends, followed by the position - * of the target port. - *

- *

- * Both source and target port are expected to be given in absolute coordinates. - *

- * @param edge an edge in the graph - * @param path the new path sequence of the edge - */ - setPath(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YPointPath):void; - /** - * Sets the control points of the given edge. - *

- * The source and target points of the edge will not be modified. - *

- * @param edge an edge in the graph - * @param points the list of {@link }s representing the new sequence of control points - */ - setPoints(edge:yfiles.algorithms.Edge,points:yfiles.algorithms.YList):void; - /** - * Sets the control points of the given edge. - *

- * The source and target points of the edge will not be modified. - *

- * @param edge an edge in the graph - * @param points the new sequence of control points - */ - setPoints(edge:yfiles.algorithms.Edge,points:yfiles.algorithms.YPointPath):void; - /** - * Specifies the width and height of the given node. - * @param node the node - * @param width the new width of the node - * @param height the new height of the node - * @see yfiles.layout.INodeLayout#setSize - */ - setSize(node:yfiles.algorithms.Node,width:number,height:number):void; - /** - * Specifies the size of the given node. - * @param node the node - * @param size the new size of the node - * @see yfiles.layout.LayoutGraph#setSize - * @see yfiles.layout.INodeLayout#setSize - */ - setSize(node:yfiles.algorithms.Node,size:yfiles.algorithms.YDimension):void; - /** - * Specifies the absolute coordinates of the source point of the given edge. - * @param edge the edge - * @param point the new absolute source point coordinates of the edge - */ - setSourcePointAbs(edge:yfiles.algorithms.Edge,point:yfiles.algorithms.YPoint):void; - /** - * Specifies the relative coordinates of the source point of the given edge. - *

- * The coordinates are interpreted relative to the center of the source node. - *

- * @param edge the edge - * @param point the new relative source point coordinates of the edge - * @see yfiles.layout.IEdgeLayout#sourcePoint - */ - setSourcePointRel(edge:yfiles.algorithms.Edge,point:yfiles.algorithms.YPoint):void; - /** - * Specifies the absolute coordinates of the target point of the given edge. - * @param edge the edge - * @param point the new absolute target point coordinates of the edge - */ - setTargetPointAbs(edge:yfiles.algorithms.Edge,point:yfiles.algorithms.YPoint):void; - /** - * Specifies the relative coordinates of the target point of the given edge. - *

- * The coordinates are interpreted relative to the center of the target node. - *

- * @param edge the edge - * @param point the new relative target point coordinates of the edge - * @see yfiles.layout.IEdgeLayout#targetPoint - */ - setTargetPointRel(edge:yfiles.algorithms.Edge,point:yfiles.algorithms.YPoint):void; - /** - * Gets a list of all edges in the graph. - * @type {yfiles.algorithms.EdgeList} - */ - edgeList:yfiles.algorithms.EdgeList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LayoutGraph; - } - /** - * The {@link yfiles.layout.LayoutGraphUtilities} provides several helper and utility functions for {@link yfiles.layout.LayoutGraph} and - * the {@link yfiles.layout.ILayoutAlgorithm layout algorithms}. - * @see yfiles.layout.LayoutGraph - * @class - * @static - */ - export interface LayoutGraphUtilities extends yfiles.lang.Object{} - export class LayoutGraphUtilities { - /** - * Aligns the specified nodes either vertically or horizontally according to the specified node alignment mode. - *

- * For vertical arrangements, nodes are either {@link yfiles.layout.NodeAlignment#LEADING top-aligned}, {@link yfiles.layout.NodeAlignment#CENTERED center-aligned}, {@link yfiles.layout.NodeAlignment#TRAILING bottom-aligned}, or {@link yfiles.layout.NodeAlignment#DISTRIBUTED vertically distributed}. - *

- *

- * For horizontal arrangements, nodes are either {@link yfiles.layout.NodeAlignment#LEADING left-aligned}, {@link yfiles.layout.NodeAlignment#CENTERED center-aligned}, {@link yfiles.layout.NodeAlignment#TRAILING right-aligned}, or {@link yfiles.layout.NodeAlignment#DISTRIBUTED horizontally distributed}. - *

- *

- * In this context, distributed means that the specified nodes are placed in such a way that the projections of their bounds onto the - * vertical or horizontal coordinate axis do not overlap. For example, after vertically distributing nodes, (n1.y + n1.height) <= n2.y - * for two consecutively placed nodes n1 and n2. - *

- * @param graph the graph that contains the specified nodes - * @param nodes the subset of the specified graph's nodes that is arranged - * @param referenceNode if null, the common coordinate for aligning the specified nodes is calculated as the the vertical minimum (top-aligned), - * the vertical center, the vertical maximum (bottom-aligned), the horizontal minimum (left-aligned), the horizontal - * center, or the horizontal maximum (right-aligned) of the bounds of the specified nodes; otherwise the appropriate - * coordinate of the given reference node's bounds is used as common coordinate for aligning the specified nodes. The - * reference node is ignored when {@link #DISTRIBUTED distributing} nodes. - * @param vertical true if nodes should be aligned (or distributed) according to their y-coordinates; otherwise nodes are aligned (or - * distributed) according to their x-coordinates. - * @param mode one of the valid alignment modes - * @static - */ - static alignNodeLayouts(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.NodeList,referenceNode:yfiles.algorithms.Node,vertical:boolean,mode:yfiles.layout.NodeAlignment):void; - /** - * Reassigns the bounds of the rectangles in a grid to fit in a large rectangle with an aspect ratio close to the specified - * aspect ratio. - *

- * The aspect ratio must be greater than 0. - *

- * @param rectangles the rectangles whose coordinates will be modified - * @param finalRect the exact dimension will be placed in this rectangle - * @param aspectRatio the preferred aspect ratio of the grid - * @returns the dimension of the grid - * @throws {Stubs.Exceptions.ArgumentError} if the given aspect ratio is less than or equal to zero - * @static - */ - static arrangeRectangleGrid(rectangles:yfiles.algorithms.Rectangle2D[],finalRect:yfiles.algorithms.Rectangle2D,aspectRatio:number):yfiles.algorithms.YDimension; - /** - * Reassigns the bounds of the rectangles in multiple rows to fit the preferred width and height. - *

- * The rectangles will be placed within this bound, arranged in rows, where each row may be split into more sub-rows. This - * often leads to more compact results than provided by the procedure used in - * {@link yfiles.layout.LayoutGraphUtilities#arrangeRectangleRows}. A row will be subdivided into more rows, if two successive - * rectangles to be placed in the row could be placed stacked within this row without making the row larger in height. - *

- *

- * The preferred width and height should be greater than 0, otherwise the nodes are not arranged. - *

- * @param rectangles the rectangles to arrange (coordinates will be assigned) - * @param finalRect the exact resulting dimension will be stored in this rectangle - * @param preferredWidth the preferred width of the result rectangle - * @param preferredHeight the preferred height of the result rectangle - * @param compaction true if the algorithm tries to always minimize the resulting dimension, whilst respecting the given constraints, false - * otherwise - * @param constraintMode the width or height constraints to consider - * @param [alignment=yfiles.layout.RowAlignment.LEADING] the alignment inside a row - * @returns the number of rows used - * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleMultiRows - * @static - */ - static arrangeRectangleMultiRows(rectangles:yfiles.algorithms.Rectangle2D[],finalRect:yfiles.algorithms.Rectangle2D,preferredWidth:number,preferredHeight:number,compaction:boolean,constraintMode:yfiles.layout.MultiRowConstraint,alignment?:yfiles.layout.RowAlignment):number; - /** - * Reassigns the bounds of the rectangles to fit in a large rectangle with an aspect ratio close to the specified aspect - * ratio. - *

- * This is achieved by arranging the rectangles in rows. - *

- *

- * The aspect ratio must be greater than 0. - *

- * @param rectangles the rectangles whose coordinates will be modified - * @param finalRect the exact dimension of the resulting rectangle - * @param aspectRatio the preferred aspect ratio of the resulting rectangle - * @param [alignment=yfiles.layout.RowAlignment.LEADING] one of the valid row alignments - * @returns the number of used rows - * @throws {Stubs.Exceptions.ArgumentError} if the aspect ratio is 0 or less - * @static - */ - static arrangeRectangleRows(rectangles:yfiles.algorithms.Rectangle2D[],finalRect:yfiles.algorithms.Rectangle2D,aspectRatio:number,alignment?:yfiles.layout.RowAlignment):number; - /** - * Applies the reversed layout of the first edge to the second edge. - * @param graph the graph to which both edges belong - * @param edge1 the edge which adopts the points - * @param edge2 the template - * @static - */ - static assignReverseLayout(graph:yfiles.layout.LayoutGraph,edge1:yfiles.algorithms.Edge,edge2:yfiles.algorithms.Edge):void; - /** - * Flips the orientation of a given rectangle, if its up vector points downward ({@link yfiles.algorithms.YOrientedRectangle#upY upY} > 0). - *

- * That means, it rotates the rectangle by 180 degrees without changing the rectangle's center. - *

- * @param rect the given rectangle - * @returns true if the given rectangle was flipped, false otherwise - * @static - */ - static autoFlipBox(rect:yfiles.algorithms.YOrientedRectangle):boolean; - /** - * Clips the path of the given edge on the bounding box of the source and target points. - *

- * On a clipped edge, the source and target port will be located at the border of the corresponding node. - *

- * @param graph the graph to which the edge belongs - * @param edge the edge to clip - * @static - */ - static clipEdgeOnBounds(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; - /** - * Returns the path of an edge clipped on the bounding box of the source and target node. - *

- * On the clipped edge, the source and target port will be located at the border of the corresponding node. - *

- * @param graph the graph to which the edge belongs - * @param edge the clipped edge - * @returns the clipped path of the edge - * @static - */ - static clipEdgePathOnBounds(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):yfiles.algorithms.YPointPath; - /** - * Returns the path of an edge clipped on insets of the bounding box of the source and target node. - *

- * On the clipped edge, the source and target port will be located inside the node with an inset to the border of the - * corresponding node. - *

- * @param edge the clipped edge - * @param source the source of the edge - * @param target the target of the edge - * @param [inset=0.0] the inset of the node - * @returns the clipped path of the edge - * @static - */ - static clipEdgePathOnBounds(edge:yfiles.layout.IEdgeLayout,source:yfiles.layout.INodeLayout,target:yfiles.layout.INodeLayout,inset?:number):yfiles.algorithms.YPointPath; - /** - * Clips the path of all edges in the graph on the bounding box of their source and target points. - *

- * On a clipped edge, the source and target port will be located at the border of the corresponding node. - *

- * @param graph the graph - * @see yfiles.layout.LayoutGraphUtilities#clipEdgeOnBounds - * @static - */ - static clipEdgesOnBounds(graph:yfiles.layout.LayoutGraph):void; - /** - * Returns the path of a given edge path clipped on the given bounding boxes of the source and target node. - * @param path the path that will be clipped - * @param sourceBox the box of the source node that the given path should be clipped at - * @param targetBox the box of the target node that the given path should be clipped at - * @returns the path clipped on the given nodes boxes - * @static - */ - static clipPathOnBounds(path:yfiles.algorithms.YPointPath,sourceBox:yfiles.algorithms.YRectangle,targetBox:yfiles.algorithms.YRectangle):yfiles.algorithms.YPointPath; - /** - * Determines the main direction of the edge flow by analyzing the current layout of the graph. - *

- * The method only considers edges that are marked in the given {@link yfiles.algorithms.IDataProvider}. - *

- * @param graph the underlying graph - * @param considerEdges the edges to consider - * @returns one of the predefined flow directions - * @static - */ - static determineEdgeFlowDirection(graph:yfiles.layout.LayoutGraph,considerEdges:yfiles.algorithms.IDataProvider):yfiles.layout.EdgeFlow; - /** - * Returns a {@link string} representation of the path of the given edge. - * @param graph the graph to which the edge belongs - * @param edge the edge - * @returns the {@link } that contains all control points of the edge - * @static - */ - static edgeLayoutString(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):string; - /** - * Returns the bounding box of the given edge. - *

- * In this case, the bounding box is the smallest paraxial rectangle which contains the control points as well as the - * absolute coordinates of the source and target point of the edge. - *

- * @param graph the graph that contains the edge - * @param edge the edge - * @returns the bounding box of the edge - * @see yfiles.layout.LayoutGraph#getSourcePointAbs - * @see yfiles.layout.LayoutGraph#getTargetPointAbs - * @see yfiles.layout.LayoutGraph#getLayout - * @static - */ - static getBoundingBox(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):yfiles.algorithms.Rectangle2D; - /** - * Returns the bounding box of the given node. - *

- * In this case, the bounding box is the smallest paraxial rectangle which contains the given node. It is identical to the - * node's bounds. - *

- * @param graph the graph that contains the node - * @param node the node - * @returns the bounding box of the node - * @see yfiles.layout.LayoutGraph#getLayout - * @static - */ - static getBoundingBox(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):yfiles.algorithms.Rectangle2D; - /** - * Returns the bounding box of the nodes and edges accessible through the given cursors, optionally including node labels, - * edge labels or {@link yfiles.layout.NodeHalo}s. - *

- * In this case, the bounding box is the smallest paraxial rectangle which contains the given nodes and the control points - * as well as the source and target points of all edges. If node or edge labels should be included, it also contains their - * boxes. {@link yfiles.layout.NodeHalo}s can also extend the bounding box if desired. - *

- * @param graph the graph that contains the given nodes and edges - * @param nodes the nodes to include in the bounding box - * @param edges the edges to include in the bounding box - * @param includeNodeLabels true if labels of nodes should be included, false otherwise - * @param includeEdgeLabels true if labels of edges should be included, false otherwise - * @param [includeHalos=false] true if {@link }s should be included, false otherwise - * @returns the bounding box of the given nodes and edges - * @static - */ - static getBoundingBox(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.INodeCursor,edges:yfiles.algorithms.IEdgeCursor,includeNodeLabels:boolean,includeEdgeLabels:boolean,includeHalos?:boolean):yfiles.algorithms.Rectangle2D; - /** - * Returns the bounding box of the nodes and edges accessible through the given cursors, optionally including node labels - * and edge labels. - *

- * In this case, the bounding box is the smallest paraxial rectangle which contains the given nodes and the control points - * as well as the source and target points of all edges. If labels should be included, it also contains their boxes. - *

- * @param graph the graph that contains the given nodes and edges - * @param nodes the nodes to include in the bounding box - * @param edges the edges to include in the bounding box - * @param includeLabels true if labels of nodes and edges should be included, false otherwise - * @returns the bounding box of the given nodes and edges - * @see yfiles.layout.LayoutGraphUtilities#getBoundingBox - * @static - */ - static getBoundingBox(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.INodeCursor,edges:yfiles.algorithms.IEdgeCursor,includeLabels:boolean):yfiles.algorithms.Rectangle2D; - /** - * Returns the bounding box of the nodes and edges accessible through the given cursors. - *

- * In this case, the bounding box is the smallest paraxial rectangle which contains the given nodes and the control points - * as well as the source and target points of all edges. - *

- * @param graph the graph that contains the nodes and edges - * @param nodes the nodes to include in the bounding box - * @param edges the edges to include in the bounding box - * @returns the bounding box containing the given nodes and edges - * @see yfiles.layout.LayoutGraphUtilities#getBoundingBoxOfEdges - * @see yfiles.layout.LayoutGraphUtilities#getBoundingBoxOfNodes - * @static - */ - static getBoundingBox(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.INodeCursor,edges:yfiles.algorithms.IEdgeCursor):yfiles.algorithms.Rectangle2D; - /** - * Returns the bounding box of the edges accessible through the given cursor. - *

- * In this case, the bounding box is the smallest paraxial rectangle which contains the control points as well as the - * absolute coordinates of the source and target points of all given edges. - *

- * @param graph the graph that contains the edges - * @param edges the edges to include in the bounding box - * @returns the bounding box containing the given edges - * @see yfiles.layout.LayoutGraph#getSourcePointAbs - * @see yfiles.layout.LayoutGraph#getTargetPointAbs - * @see yfiles.layout.LayoutGraph#getLayout - * @static - */ - static getBoundingBoxOfEdges(graph:yfiles.layout.LayoutGraph,edges:yfiles.algorithms.IEdgeCursor):yfiles.algorithms.Rectangle2D; - /** - * Returns the bounding box of the nodes accessible through the given cursor. - *

- * In this case, the bounding box is the smallest paraxial rectangle which contains the given nodes. - *

- * @param graph the graph that contains the nodes - * @param nodes the nodes to include in the bounding box - * @returns the bounding box containing the given nodes - * @see yfiles.layout.LayoutGraph#getLayout - * @static - */ - static getBoundingBoxOfNodes(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.INodeCursor):yfiles.algorithms.Rectangle2D; - /** - * Returns the {@link yfiles.layout.ILabelLayoutFactory} for the given graph. - * @param graph the graph - * @returns the label factory of the graph - * @static - */ - static getLabelFactory(graph:yfiles.layout.LayoutGraph):yfiles.layout.ILabelLayoutFactory; - /** - * Returns the upper-left corner of the paraxial bounding box of the given edge label as encoded by the specified model - * parameter. - *

- * The parameter describes the abstract position of the label within the specified model. The parameter must have been - * generated by that model. - *

- * @param model the {@link } used for placing the label - * @param labelSize the size of the label that should be placed - * @param edgeLayout the layout of the edge to which the label belongs - * @param sourceLayout the layout of the edge's source node - * @param targetLayout the layout of the edge's target node - * @param param the model parameter - * @returns the upper-left corner of the label's bounding box - * @see yfiles.layout.IEdgeLabelLayoutModel#getLabelPlacement - * @see yfiles.algorithms.YOrientedRectangle#boundingBox - * @static - */ - static getLabelPlacement(model:yfiles.layout.IEdgeLabelLayoutModel,labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout,param:any):yfiles.algorithms.YPoint; - /** - * Returns the upper-left corner of the paraxial bounding box of the given node label as encoded by the specified model - * parameter. - *

- * The parameter describes the abstract position of the label within the specified model. The parameter must have been - * generated by that model. - *

- * @param model the {@link } used for placing the label - * @param labelSize the size of the label - * @param nodeLayout the layout of the node to which the label belongs - * @param param the model parameter - * @returns the upper-left corner of the label's bounding box - * @see yfiles.layout.INodeLabelLayoutModel#getLabelPlacement - * @see yfiles.algorithms.YOrientedRectangle#boundingBox - * @static - */ - static getLabelPlacement(model:yfiles.layout.INodeLabelLayoutModel,labelSize:yfiles.algorithms.YDimension,nodeLayout:yfiles.layout.INodeLayout,param:any):yfiles.algorithms.YPoint; - /** - * Returns the distance between the centers of the two given nodes. - * @param graph the graph to which the nodes belong - * @param node1 the first node - * @param node2 the second node - * @returns the distance between the nodes' centers - * @static - */ - static getNodeDistance(graph:yfiles.layout.LayoutGraph,node1:yfiles.algorithms.Node,node2:yfiles.algorithms.Node):number; - /** - * Returns a {@link string} representation of all node positions in the graph. - * @param graph the graph - * @returns the {@link } containing all node locations - * @see yfiles.layout.LayoutGraph#getLocation - * @static - */ - static getNodePositions(graph:yfiles.layout.LayoutGraph):string; - /** - * Returns the length of the path of the given edge. - *

- * The path starts at the source point, traverses through all control points and ends at the target point. - *

- * @param graph the graph to which the edge belongs - * @param edge the edge - * @returns the length of the edge's path - * @static - */ - static getPathLength(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):number; - /** - * Checks whether or not the path of an edge is outside the bounding box of the source and target node, considering the - * given halo. - *

- * The edge is outside the nodes if its control points as well as the source and target point are not inside the nodes' - * bounding boxes. - *

- *

- * The nodes can be enlarged by a halo to check if the edge keeps some distance to the nodes. - *

- * @param edge the edge - * @param source the source of the edge - * @param target the target of the edge - * @param halo the halo for the nodes - * @returns true if the edge is outside the nodes, false otherwise - * @static - */ - static isEdgeOutsideNodes(edge:yfiles.layout.IEdgeLayout,source:yfiles.layout.INodeLayout,target:yfiles.layout.INodeLayout,halo:number):boolean; - /** - * Checks whether or not the path of an edge is outside the bounding box of the source and target node. - *

- * The edge is outside the nodes if its control points as well as the source and target point are not inside the nodes' - * bounding boxes. - *

- * @param graph the graph to which the edge belongs - * @param edge the edge - * @returns true if the edge is outside the nodes, false otherwise - * @static - */ - static isEdgeOutsideNodes(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):boolean; - /** - * Determines whether or not most of the edges of the graph are routed octilinear. - *

- * The method only considers edges marked in the given {@link yfiles.algorithms.IDataProvider}. - *

- * @param graph the underlying graph - * @param considerEdges the edges to consider - * @returns true if most of the edges in the graph are routed octilinear, false otherwise - * @static - */ - static isUsingOctilinearEdgeRoutes(graph:yfiles.layout.LayoutGraph,considerEdges:yfiles.algorithms.IDataProvider):boolean; - /** - * Determines whether or not most of the edges of the graph are routed orthogonally. - *

- * The method only considers edges marked in the given {@link yfiles.algorithms.IDataProvider}. - *

- * @param graph the underlying graph - * @param considerEdges the edges to consider - * @returns true if most of the edges in the graph are routed orthogonally, false otherwise - * @static - */ - static isUsingOrthogonalEdgeRoutes(graph:yfiles.layout.LayoutGraph,considerEdges:yfiles.algorithms.IDataProvider):boolean; - /** - * Moves all control points of the given edge by the vector (dx,dy). - * @param graph the graph - * @param edge the edge - * @param dx the horizontal distance to move - * @param dy the vertical distance to move - * @static - */ - static moveEdge(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge,dx:number,dy:number):void; - /** - * Moves the control points of all edges accessible through the given {@link yfiles.algorithms.IEdgeCursor} by the vector (dx,dy). - * @param graph the graph - * @param edges the edges to be moved - * @param dx the horizontal distance to move - * @param dy the vertical distance to move - * @static - */ - static moveEdges(graph:yfiles.layout.LayoutGraph,edges:yfiles.algorithms.IEdgeCursor,dx:number,dy:number):void; - /** - * Moves the given node by the vector (dx,dy). - * @param graph the graph - * @param node the node - * @param dx the horizontal distance to move - * @param dy the vertical distance to move - * @static - */ - static moveNode(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node,dx:number,dy:number):void; - /** - * Moves all nodes accessible through the given {@link yfiles.algorithms.INodeCursor} by the vector (dx,dy). - * @param graph the graph - * @param nodes the nodes to be moved - * @param dx the horizontal distance to move - * @param dy the vertical distance to move - * @static - */ - static moveNodes(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.INodeCursor,dx:number,dy:number):void; - /** - * Moves the subgraph induced by the nodes accessible through the given {@link yfiles.algorithms.INodeCursor} by the vector - * (dx,dy). - * @param graph the graph that contains the subgraph - * @param nodes the nodes that induce the subgraph - * @param dx the horizontal distance to move - * @param dy the vertical distance to move - * @static - */ - static moveSubgraph(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.INodeCursor,dx:number,dy:number):void; - /** - * Moves the subgraph induced by the edges accessible through the given {@link yfiles.algorithms.IEdgeCursor} by the vector - * (dx,dy). - * @param graph the graph that contains the subgraph - * @param edges the edges that induce the subgraph - * @param dx the horizontal distance to move - * @param dy the vertical distance to move - * @static - */ - static moveSubgraphOfEdges(graph:yfiles.layout.LayoutGraph,edges:yfiles.algorithms.IEdgeCursor,dx:number,dy:number):void; - /** - * Checks whether or not the path of the given edge intersects the interior of a given rectangular area. - * @param graph the graph to which the edge belongs - * @param edge the edge - * @param rect the rectangular area to check for intersection - * @returns true if the edge path intersects with the given rectangle, false otherwise - * @static - */ - static pathIntersectsRect(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge,rect:yfiles.algorithms.Rectangle2D):boolean; - /** - * Removes successive bends that have the same coordinates from the given edge. - * @param graph the graph - * @param edge the edge - * @static - */ - static removeDuplicateBends(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; - /** - * Removes successive bends that have the same coordinates from all edges in the graph. - * @param graph the graph - * @static - */ - static removeDuplicateBends(graph:yfiles.layout.LayoutGraph):void; - /** - * Assigns a trivial path which has no control points to the specified edge. - * @param graph the graph - * @param edge the edge - * @param [resetPorts=true] true if the ports of the edge should be set to the center of the corresponding nodes, false otherwise - * @static - */ - static resetPath(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge,resetPorts?:boolean):void; - /** - * Assigns a trivial path which has no control points to all edges in the specified graph. - * @param graph the graph - * @param [resetPorts=true] true if the ports of the edges should be set to the center of the corresponding nodes, false otherwise - * @static - */ - static resetPaths(graph:yfiles.layout.LayoutGraph,resetPorts?:boolean):void; - /** - * Sets the ports of all edges in the graph to the center of the nodes. - * @param graph the graph - * @see yfiles.layout.LayoutGraph#setSourcePointRel - * @see yfiles.layout.LayoutGraph#setTargetPointRel - * @static - */ - static resetPorts(graph:yfiles.layout.LayoutGraph):void; - /** - * Reverses the layout of an edge. - *

- * The order of the control points is reversed and source and target point are swapped. - *

- * @param el the layout information of an edge - * @static - */ - static reverseEdgeLayout(el:yfiles.layout.IEdgeLayout):void; - /** - * Rounds the locations of the control points and ports of the given edge to integer values. - * @param graph the graph to which the edge belongs - * @param edge the edge whose values are rounded - * @static - */ - static roundEdgeLayout(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; - /** - * Rounds coordinates and sizes in the layout of an entire graph to integer values. - * @param graph the graph - * @see yfiles.layout.LayoutGraphUtilities#roundNodeLayout - * @see yfiles.layout.LayoutGraphUtilities#roundEdgeLayout - * @static - */ - static roundLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Rounds the location and size of the given node to integer values. - * @param graph the graph to which the node belongs - * @param node the node whose values are rounded - * @static - */ - static roundNodeLayout(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):void; - /** - * Routes a list of edges which are incident to the same nodes in parallel, optionally joining the end points. - *

- * All edges get a path that is parallel to the path of the first (leading) edge. - *

- *

- * The position of the leading edge may be adjusted if there is an odd number of parallel edges. It will be moved from the - * center to achieve a more symmetric port assignment. - *

- * @param graph the graph - * @param leadingEdge the leading edge - * @param edges the list of edges that will be aligned with the leading edge - * @param lineDistance the distance between two edges - * @param [adjustLeadingEdge=false] true if the leading edge should be adjusted if the size of list is odd, false otherwise - * @param [joinEnds=false] true if the edges should share their end points (the ones of the leading edge), false otherwise - * @param [absJoinDistance=0.0] the absolute distance between the end points and the beginning of the parallel segment routing if the ends are joined - * @param [relJoinDistance=0.0] the relative distance, measured relative to the length of the first/last segments if the ends are joined - * @static - */ - static routeEdgesParallel(graph:yfiles.layout.LayoutGraph,leadingEdge:yfiles.algorithms.Edge,edges:yfiles.algorithms.EdgeList,lineDistance:number,adjustLeadingEdge?:boolean,joinEnds?:boolean,absJoinDistance?:number,relJoinDistance?:number):void; - /** - * Routes a list of edges which are incident to the same nodes in parallel, optionally joining the end points. - *

- * All edges get a path that is parallel to the path of the first (leading) edge. - *

- *

- * The position of the leading edge may be adjusted if there is an odd number of parallel edges. It will be moved from the - * center to achieve a more symmetric port assignment. - *

- * @param {Object} options The parameters to pass. - * @param options.graph the graph - * @param options.leadingEdge the leading edge - * @param options.edges the list of edges that will be aligned with the leading edge - * @param options.lineDistance the distance between two edges - * @param [options.adjustLeadingEdge=false] true if the leading edge should be adjusted if the size of list is odd, false otherwise - * @param [options.joinEnds=false] true if the edges should share their end points (the ones of the leading edge), false otherwise - * @param [options.absJoinDistance=0.0] the absolute distance between the end points and the beginning of the parallel segment routing if the ends are joined - * @param [options.relJoinDistance=0.0] the relative distance, measured relative to the length of the first/last segments if the ends are joined - * @static - */ - static routeEdgesParallel(options:{graph:yfiles.layout.LayoutGraph,leadingEdge:yfiles.algorithms.Edge,edges:yfiles.algorithms.EdgeList,lineDistance:number,adjustLeadingEdge?:boolean,joinEnds?:boolean,absJoinDistance?:number,relJoinDistance?:number}):void; - /** - * Routes two edges which are incident to the same nodes in parallel, optionally joining the end points. - *

- * The second edge gets a path that is parallel to the path of the first (leading) edge. - *

- * @param graph the graph - * @param leadingEdge the leading edge - * @param edge the edge to be adjusted - * @param lineDistance the distance between the two edges - * @param [joinEnds=false] true if the edges should share their end points (the ones of the leading edge), false otherwise - * @param [absJoinDistance=0.0] the absolute distance between the end points and the beginning of the parallel segment routing if the ends are joined - * @param [relJoinDistance=0.0] the relative distance, measured relative to the length of the first/last segments if the ends are joined - * @static - */ - static routeEdgesParallel(graph:yfiles.layout.LayoutGraph,leadingEdge:yfiles.algorithms.Edge,edge:yfiles.algorithms.Edge,lineDistance:number,joinEnds?:boolean,absJoinDistance?:number,relJoinDistance?:number):void; - /** - * Routes two edges which are incident to the same nodes in parallel, optionally joining the end points. - *

- * The second edge gets a path that is parallel to the path of the first (leading) edge. - *

- * @param {Object} options The parameters to pass. - * @param options.graph the graph - * @param options.leadingEdge the leading edge - * @param options.edge the edge to be adjusted - * @param options.lineDistance the distance between the two edges - * @param [options.joinEnds=false] true if the edges should share their end points (the ones of the leading edge), false otherwise - * @param [options.absJoinDistance=0.0] the absolute distance between the end points and the beginning of the parallel segment routing if the ends are joined - * @param [options.relJoinDistance=0.0] the relative distance, measured relative to the length of the first/last segments if the ends are joined - * @static - */ - static routeEdgesParallel(options:{graph:yfiles.layout.LayoutGraph,leadingEdge:yfiles.algorithms.Edge,edge:yfiles.algorithms.Edge,lineDistance:number,joinEnds?:boolean,absJoinDistance?:number,relJoinDistance?:number}):void; - /** - * Routes a self-loop. - *

- * For a self-loop edge, source and target are identical. The path of the self-loop will start at the top of the node, go - * around the upper-left corner and end at the left side of the node. - *

- * @param graph the graph to which the edge belongs - * @param edge the self-loop - * @static - */ - static routeSelfLoop(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LayoutGraphUtilities; - } - /** - * A {@link yfiles.layout.LayoutMultiplexer} delegates its layout calls to a core layout algorithm that is dynamically chosen at - * runtime by inspecting the nodes of the input graph. - *

- * If a {@link yfiles.algorithms.IDataProvider} is registered with the given graph using the look-up key - * {@link yfiles.layout.LayoutMultiplexer#LAYOUT_DP_KEY}, it is used for retrieving the {@link yfiles.layout.ILayoutAlgorithm} objects that - * are stored for the graph's nodes. If no such {@link yfiles.algorithms.IDataProvider} is registered, this layout stage's {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} - * (if any) is used for the layout calculation of all nodes. - *

- *

- * Note that the first non-null {@link yfiles.layout.ILayoutAlgorithm} instance retrieved from the {@link yfiles.algorithms.IDataProvider} - * is used for all nodes. - *

- *

- * The main purpose of this class is to enable the use of individual layout algorithms for different components (when used - * as the core layout algorithm of {@link yfiles.layout.ComponentLayout}) or for the contents of group nodes (when used as the core - * layout algorithm of {@link yfiles.layout.RecursiveGroupLayout}). - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface LayoutMultiplexer extends yfiles.layout.LayoutStageBase{} - export class LayoutMultiplexer { - /** - * Creates a new instance of {@link yfiles.layout.LayoutMultiplexer}. - */ - constructor(); - /** - * Returns the core layout algorithm associated with the nodes contained in the given graph. - *

- * This implementation looks up the layout algorithm in the {@link yfiles.algorithms.IDataProvider} registered with the key - * {@link yfiles.layout.LayoutMultiplexer#LAYOUT_DP_KEY}. The first non-null {@link yfiles.layout.ILayoutAlgorithm layout algorithm} instance found for a node of the - * given graph will be returned by this method. If no algorithm is registered at all, it will fall back to the - * {@link yfiles.layout.LayoutStageBase#coreLayout default core layout algorithm}. - *

- *

- * This method is called in {@link yfiles.layout.LayoutMultiplexer#applyLayout} and may be overridden to implement a different way - * of selecting the {@link yfiles.layout.ILayoutAlgorithm layout algorithms}. - *

- * @param graph the input graph - * @returns the according layout algorithm - * @protected - */ - getCoreLayout(graph:yfiles.layout.LayoutGraph):yfiles.layout.ILayoutAlgorithm; - /** - * Data provider key for assigning layout algorithms to the nodes - *

- * At runtime, the layout algorithms are determined and applied to the current graph. The first non-null {@link yfiles.layout.ILayoutAlgorithm} - * instance is used for the whole graph. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static LAYOUT_DP_KEY:yfiles.algorithms.NodeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LayoutMultiplexer; - } - /** - * Abstract base class implementing {@link yfiles.layout.ILayoutStage} that handles the management of the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- * Subclasses of this stage can use the provided methods, such that the management of the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} does not - * need to be considered anymore. - *

- * @see yfiles.layout.MultiStageLayout - * @class - * @implements {yfiles.layout.ILayoutStage} - */ - export interface LayoutStageBase extends yfiles.lang.Object,yfiles.layout.ILayoutStage{} - export class LayoutStageBase { - /** - * Creates a new {@link yfiles.layout.ILayoutStage} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algorithm. - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * - * @param graph - * @abstract - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Invokes the layout process of the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- * Overriding classes may call this method during {@link yfiles.layout.ILayoutAlgorithm#applyLayout} to delegate arranging the - * graph to the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. They can add pre- and post-processing code before and after this call. - *

- * @param graph the input graph - * @protected - */ - applyLayoutCore(graph:yfiles.layout.LayoutGraph):void; - /** - * Gets or sets the core layout algorithm that is wrapped by this stage. - * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LayoutStageBase; - } - /** - * {@link yfiles.layout.MinimumNodeSizeStage} enforces a given minimum width/height of the nodes of a graph during the layout - * process. - *

- * It temporarily enlarges nodes whose width/height is below the specified minimum values. - *

- *

- * This {@link yfiles.layout.ILayoutStage} is especially useful to prevent that the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} has to handle zero-sized - * nodes or nodes with negative sizes. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface MinimumNodeSizeStage extends yfiles.layout.LayoutStageBase{} - export class MinimumNodeSizeStage { - /** - * Creates a new {@link yfiles.layout.MinimumNodeSizeStage} instance using the given {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} along with a specific - * minimum width and height for the nodes. - * @param coreLayouter the core layout routine - * @param minWidth the minimum width of nodes that should be enforced - * @param minHeight the minimum height of nodes that should be enforced - */ - constructor(coreLayouter:yfiles.layout.ILayoutAlgorithm,minWidth:number,minHeight:number); - /** - * Creates a new {@link yfiles.layout.MinimumNodeSizeStage} instance using the given {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- * The nodes will be enlarged to be at least 1 wide and 1 high. - *

- * @param coreLayouter the core routine - */ - constructor(coreLayouter:yfiles.layout.ILayoutAlgorithm); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.MinimumNodeSizeStage; - } - /** - * An abstract base class for layout algorithms that provides services to simplify and decompose the input graph before it - * is passed to the {@link yfiles.layout.MultiStageLayout#applyLayoutCore core layout algorithm} itself. - *

- * Subclasses of this layout algorithm have to provide implementations for the abstract method - * {@link yfiles.layout.MultiStageLayout#applyLayoutCore}. It invokes the actual layout routine of this layout algorithm. - *

- *

- * Concept - *

- *

- * This class provides a configurable pipeline that contains {@link yfiles.layout.ILayoutStage}s that add preprocessing steps - * and/or postprocessing steps to the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm}. {@link yfiles.layout.MultiStageLayout} provides some predefined - * {@link yfiles.layout.ILayoutStage}s, that simplify the input graph for the layout algorithm and complement the result. It is - * also possible to add custom {@link yfiles.layout.ILayoutStage}s which are executed {@link yfiles.layout.MultiStageLayout#prependStage before} or {@link yfiles.layout.MultiStageLayout#appendStage after the predefined ones}. - *

- *

- * Each {@link yfiles.layout.ILayoutStage} in the pipeline wraps its successor. When the layout pipeline is processed, the - * preprocessing code of the preceding {@link yfiles.layout.ILayoutStage} is executed before the code in the current {@link yfiles.layout.ILayoutStage} - * while the postprocessing code is executed afterwards. - *

- *

- * The pipeline of predefined {@link yfiles.layout.ILayoutStage}s of {@link yfiles.layout.MultiStageLayout} (when all are activated) causes - * the following sequence of steps: - *

- *
    - *
  1. Hides the group nodes.
  2. - *
  3. Hides all except for the induced subgraph.
  4. - *
  5. Decomposes the graph into its connected components. Performs steps 4-12 on each component.
  6. - *
  7. Prepares for label placement.
  8. - *
  9. Prepares the layout for an orientation change.
  10. - *
  11. Hides self-loops.
  12. - *
  13. Hides parallel edges.
  14. - *
  15. Invokes the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm} on the simplified graph.
  16. - *
  17. Un-hides and routes parallel edges.
  18. - *
  19. Un-hides and routes self-loops.
  20. - *
  21. Completes orientation change of the layout.
  22. - *
  23. Assigns label positions.
  24. - *
  25. Arranges the connected components of the graph.
  26. - *
  27. Un-hides non-induced subgraph.
  28. - *
  29. Un-hides the group nodes.
  30. - *
- *

- * In order to take effect, a stage that is not already activated by default needs to be activated using the corresponding - * method, e.g., {@link yfiles.layout.MultiStageLayout#hideGroupsStageEnabled}. Vice versa, a stage can also be deactivated, if necessary. - *

- * @class - * @implements {yfiles.layout.ILayoutAlgorithm} - */ - export interface MultiStageLayout extends yfiles.lang.Object,yfiles.layout.ILayoutAlgorithm{} - export class MultiStageLayout { - /** - * Creates a new {@link yfiles.layout.MultiStageLayout} instance with default settings. - */ - constructor(); - /** - * Appends the given {@link yfiles.layout.ILayoutStage} to the layout pipeline. - *

- * Stages that are added with this method will be invoked at the very end of the layout pipeline. This means after all - * prepended {@link yfiles.layout.ILayoutStage}s, all predefined stages, and all previously appended {@link yfiles.layout.ILayoutStage}s, - * but just before the invocation of the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm}. - *

- * @param stage the {@link } instance to be added - * @see yfiles.layout.MultiStageLayout#removeStage - * @see yfiles.layout.MultiStageLayout#prependStage - */ - appendStage(stage:yfiles.layout.ILayoutStage):void; - /** - * Calculates a layout for the given graph and applies it directly to the graph. - *

- * This method executes all activated {@link yfiles.layout.ILayoutStage}s in the layout pipeline as well as the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm}. - *

- * @param layoutGraph the input graph - * @see yfiles.layout.MultiStageLayout#appendStage - * @see yfiles.layout.MultiStageLayout#prependStage - * @see yfiles.layout.MultiStageLayout#applyLayoutCore - */ - applyLayout(layoutGraph:yfiles.layout.LayoutGraph):void; - /** - * Invokes the core layout algorithm. - *

- * This method should be implemented by subclasses in order to perform the layout routine of the layout algorithm. - *

- * @param graph the input graph - * @abstract - */ - applyLayoutCore(graph:yfiles.layout.LayoutGraph):void; - /** - * Checks the sizes of the nodes to be non-zero. - * @param g The graph to check. - * @protected - */ - checkNodeSize(g:yfiles.layout.LayoutGraph):void; - /** - * Deactivates all predefined {@link yfiles.layout.ILayoutStage}s so that upon {@link yfiles.layout.MultiStageLayout#applyLayout} only the - * {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm} will be executed. - */ - disableAllStages():void; - /** - * Prepends the given {@link yfiles.layout.ILayoutStage} to the layout pipeline. - *

- * Stages that are added with this method will be invoked at the very beginning of the layout pipeline. This means before - * all previously prepended {@link yfiles.layout.ILayoutStage}s, all predefined stages, and all appended - * {@link yfiles.layout.ILayoutStage}s. - *

- * @param stage the {@link } instance to be added - * @see yfiles.layout.MultiStageLayout#removeStage - * @see yfiles.layout.MultiStageLayout#appendStage - */ - prependStage(stage:yfiles.layout.ILayoutStage):void; - /** - * Removes the given {@link yfiles.layout.ILayoutStage} from the layout pipeline. - *

- * This method can only remove {@link yfiles.layout.ILayoutStage}s that have been previously added using {@link yfiles.layout.MultiStageLayout#appendStage} - * or {@link yfiles.layout.MultiStageLayout#prependStage}. Predefined {@link yfiles.layout.ILayoutStage}s can be deactivated separately. - *

- * @param stage a {@link } to be removed from the layout pipeline - * @see yfiles.layout.MultiStageLayout#prependStage - * @see yfiles.layout.MultiStageLayout#appendStage - * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouterEnabled - * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled - * @see yfiles.layout.MultiStageLayout#subgraphLayoutEnabled - * @see yfiles.layout.MultiStageLayout#labelingEnabled - * @see yfiles.layout.MultiStageLayout#hideGroupsStageEnabled - * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled - */ - removeStage(stage:yfiles.layout.ILayoutStage):void; - /** - * Gets or sets the {@link yfiles.layout.ILayoutStage} that places the labels of the input graph. - * @see yfiles.layout.MultiStageLayout#labelingEnabled - * @see yfiles.labeling.GenericLabeling - * @type {yfiles.layout.ILayoutStage} - */ - labeling:yfiles.layout.ILayoutStage; - /** - * Gets or sets the {@link yfiles.layout.ILayoutStage} that routes self-loops. - * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled - * @see yfiles.layout.SelfLoopRouter - * @type {yfiles.layout.ILayoutStage} - */ - selfLoopRouter:yfiles.layout.ILayoutStage; - /** - * Gets or sets the {@link yfiles.layout.ILayoutStage} that routes parallel edges. - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouterEnabled - * @see yfiles.router.ParallelEdgeRouter - * @type {yfiles.layout.ILayoutStage} - */ - parallelEdgeRouter:yfiles.layout.ILayoutStage; - /** - * Gets or sets the {@link yfiles.layout.ILayoutStage} that arranges the connected components of an input graph. - * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled - * @see yfiles.layout.ComponentLayout - * @type {yfiles.layout.ILayoutStage} - */ - componentLayout:yfiles.layout.ILayoutStage; - /** - * Gets or sets the {@link yfiles.layout.ILayoutStage} that constrains the layout process to a subgraph of the input graph. - * @see yfiles.layout.MultiStageLayout#subgraphLayoutEnabled - * @see yfiles.layout.SubgraphLayout - * @type {yfiles.layout.ILayoutStage} - */ - subgraphLayout:yfiles.layout.ILayoutStage; - /** - * Gets or sets the {@link yfiles.layout.ILayoutStage} that hides the group nodes of the input graph. - * @see yfiles.layout.MultiStageLayout#hideGroupsStageEnabled - * @see yfiles.layout.HideGroupsStage - * @type {yfiles.layout.ILayoutStage} - */ - hideGroupsStage:yfiles.layout.ILayoutStage; - /** - * Gets or sets the {@link yfiles.layout.ILayoutStage} that modifies the orientation of a computed layout. - * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled - * @see yfiles.layout.MultiStageLayout#layoutOrientation - * @see yfiles.layout.OrientationLayout - * @type {yfiles.layout.ILayoutStage} - */ - orientationLayout:yfiles.layout.ILayoutStage; - /** - * Gets or sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. - *

- * This {@link yfiles.layout.ILayoutStage} may be deactivated if the orientation is irrelevant for the layout or if the core layout - * algorithm already handles the layout orientation by itself. - *

- * @see yfiles.layout.MultiStageLayout#orientationLayout - * @see yfiles.layout.MultiStageLayout#layoutOrientation - * @see yfiles.layout.OrientationLayout - * @type {boolean} - */ - orientationLayoutEnabled:boolean; - /** - * Gets or sets the main orientation of the layout. - *

- * This is a convenience method that configures the {@link yfiles.layout.MultiStageLayout#orientationLayout orientation layout stage}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified orientation does not match a default layout orientation - * @see yfiles.layout.MultiStageLayout#orientationLayout - * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled - * @type {yfiles.layout.LayoutOrientation} - */ - layoutOrientation:yfiles.layout.LayoutOrientation; - /** - * Gets or sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. - *

- * This {@link yfiles.layout.ILayoutStage} should be deactivated if the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm} handles self-loops by itself. - *

- * @see yfiles.layout.MultiStageLayout#selfLoopRouter - * @see yfiles.layout.SelfLoopRouter - * @type {boolean} - */ - selfLoopRouterEnabled:boolean; - /** - * Gets or sets whether or not the {@link yfiles.layout.ILayoutStage} used for placing the labels of the input graph is activated. - *

- * This {@link yfiles.layout.ILayoutStage} may be activated to apply a generic labeling algorithm to the input graph. It will then - * try to find the best locations for the labels in the layout calculated by the - * {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm}. When the stage is deactivated, the labels are ignored or placed by an integrated labeling of the - * layout algorithm. - *

- * @see yfiles.layout.MultiStageLayout#labeling - * @see yfiles.labeling.GenericLabeling - * @type {boolean} - */ - labelingEnabled:boolean; - /** - * Gets or sets whether or not the {@link yfiles.layout.ILayoutStage} used for hiding group nodes is activated. - *

- * This {@link yfiles.layout.ILayoutStage} should be deactivated if the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm} handles group nodes itself. - *

- * @see yfiles.layout.MultiStageLayout#hideGroupsStage - * @see yfiles.layout.HideGroupsStage - * @type {boolean} - */ - hideGroupsStageEnabled:boolean; - /** - * Gets or sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. - *

- * This {@link yfiles.layout.ILayoutStage} should be deactivated if the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm} is able to handle several connected - * components. - *

- * @see yfiles.layout.MultiStageLayout#componentLayout - * @see yfiles.layout.ComponentLayout - * @type {boolean} - */ - componentLayoutEnabled:boolean; - /** - * Gets or sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing parallel edges is activated. - *

- * This {@link yfiles.layout.ILayoutStage} should be deactivated if the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm} handles parallel edges itself. - *

- * @see yfiles.layout.MultiStageLayout#parallelEdgeRouter - * @see yfiles.router.ParallelEdgeRouter - * @type {boolean} - */ - parallelEdgeRouterEnabled:boolean; - /** - * Gets or sets whether or not the {@link yfiles.layout.ILayoutStage} used for constraining the layout process to a subgraph of the - * input graph is activated. - *

- * This {@link yfiles.layout.ILayoutStage} may be activated if the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm} should be applied only to a specific part of - * the graph. The remaining graph will stay unchanged. - *

- * @see yfiles.layout.MultiStageLayout#subgraphLayout - * @see yfiles.layout.SubgraphLayout - * @type {boolean} - */ - subgraphLayoutEnabled:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.MultiStageLayout; - } - /** - * A {@link yfiles.layout.NodeHalo} specifies a rectangular area around a specific node. - *

- * A {@link yfiles.layout.ILayoutAlgorithm layout algorithm} that supports - * {@link yfiles.layout.NodeHalo}s, keeps this area clear of graph elements, except the node labels of this specific node and the - * adjacent segments of its edges. All minimum distances to this node, which are used in the layout calculation, e.g., - * minimum first segment length, will be extended by the halo size. - *

- *

- * This class defines a key used for registering a {@link yfiles.algorithms.IDataProvider} that provides {@link yfiles.layout.NodeHalo}s - * for all nodes of the input graph. {@link yfiles.layout.NodeHalo}-aware layout algorithms like {@link yfiles.hierarchic.HierarchicLayout} - * look for {@link yfiles.algorithms.IDataProvider}s registered with this key to retrieve {@link yfiles.layout.NodeHalo} information. - *

- *

- * The following layouters support {@link yfiles.layout.NodeHalo}s with different restrictions: - *

- *
    - *
  • {@link yfiles.hierarchic.HierarchicLayout}
  • - *
  • {@link yfiles.orthogonal.OrthogonalLayout}
  • - *
  • {@link yfiles.orthogonal.CompactOrthogonalLayout}
  • - *
  • {@link yfiles.tree.TreeLayout}
  • - *
  • {@link yfiles.tree.ClassicTreeLayout}
  • - *
  • {@link yfiles.organic.OrganicLayout}
  • - *
  • {@link yfiles.labeling.GenericLabeling}
  • - *
  • {@link yfiles.router.EdgeRouter}
  • - *
  • {@link yfiles.circular.CircularLayout}
  • - *
  • {@link yfiles.tree.BalloonLayout}
  • - *
  • {@link yfiles.layout.SelfLoopRouter}
  • - *
  • {@link yfiles.radial.RadialLayout}
  • - *
  • {@link yfiles.layout.RecursiveGroupLayout}
  • - *
  • {@link yfiles.layout.ComponentLayout}
  • - *
- * @class - * @final - */ - export interface NodeHalo extends yfiles.lang.Object{} - export class NodeHalo { - /** - * Creates a {@link yfiles.layout.NodeHalo} with the specified values. - *

- * The values must not be negative, {@link number#NaN} or {@link number#POSITIVE_INFINITY}. - *

- * @param top the {@link } size at the top side of the node - * @param left the {@link } size at the left side of the node - * @param bottom the {@link } size at the bottom side of the node - * @param right the {@link } size at the right side of the node - * @returns the newly created {@link } - * @throws {Stubs.Exceptions.ArgumentError} if one of the values is negative, {@link number#NaN} or {@link number#POSITIVE_INFINITY} - * @static - */ - static create(top:number,left:number,bottom:number,right:number):yfiles.layout.NodeHalo; - /** - * Creates a {@link yfiles.layout.NodeHalo} object with the specified value on each side of the node. - *

- * The value must not be negative, {@link number#NaN} or {@link number#POSITIVE_INFINITY}. - *

- * @param value the halo size at each side of the node - * @returns the newly created {@link } - * @throws {Stubs.Exceptions.ArgumentError} if the value is negative, {@link number#NaN} or {@link number#POSITIVE_INFINITY} - * @static - */ - static create(value:number):yfiles.layout.NodeHalo; - /** - * Returns the {@link yfiles.layout.NodeHalo} associated with the given node. - *

- * If no such {@link yfiles.layout.NodeHalo} is available, this method returns a {@link yfiles.layout.NodeHalo#ZERO_HALO}. - *

- * @param graph the graph containing the given node - * @param node the node whose {@link } will be determined - * @returns the {@link } of the given node if available, otherwise a {@link #ZERO_HALO} - * @static - */ - static getHalo(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):yfiles.layout.NodeHalo; - /** - * Returns a {@link yfiles.algorithms.YRectangle} instance with the bounds of the given node including its {@link yfiles.layout.NodeHalo}. - *

- * This {@link yfiles.algorithms.YRectangle} is located at the position of the node. - *

- *

- * If the node does not have a {@link yfiles.layout.NodeHalo} assigned, this box has the same size as the node. - *

- * @param graph the graph containing the given node - * @param node the node whose {@link } will be determined - * @returns a {@link } instance with the bounds of the given node including its {@link } - * @static - */ - static getHaloBox(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):yfiles.algorithms.YRectangle; - /** - * Checks whether or not the given graph contains {@link yfiles.layout.NodeHalo} information. - *

- * This method looks for a {@link yfiles.algorithms.IDataProvider} that has been registered with the given graph using - * {@link yfiles.layout.NodeHalo#NODE_HALO_DP_KEY}. - *

- * @param graph the input graph - * @returns true if a {@link } has been registered with the according key, false otherwise - * @static - */ - static hasHalos(graph:yfiles.layout.LayoutGraph):boolean; - /** - * Data provider key for assigning halos for the nodes - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_HALO_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * A constant holding a {@link yfiles.layout.NodeHalo} with zero size on each side. - * @const - * @static - * @type {yfiles.layout.NodeHalo} - */ - static ZERO_HALO:yfiles.layout.NodeHalo; - /** - * The {@link yfiles.layout.NodeHalo} size at the top side of the node. - * @const - * @type {number} - */ - top:number; - /** - * The {@link yfiles.layout.NodeHalo} size at the left side of the node. - * @const - * @type {number} - */ - left:number; - /** - * The {@link yfiles.layout.NodeHalo} size at the bottom side of the node. - * @const - * @type {number} - */ - bottom:number; - /** - * The {@link yfiles.layout.NodeHalo} size at the right side of the node. - * @const - * @type {number} - */ - right:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.NodeHalo; - } - /** - * A {@link yfiles.layout.NodeLabelCandidate} describes one valid placement for a node label considering the label model. - * @class - * @extends {yfiles.layout.LabelCandidate} - */ - export interface NodeLabelCandidate extends yfiles.layout.LabelCandidate{} - export class NodeLabelCandidate { - /** - * Creates a new instance of {@link yfiles.layout.NodeLabelCandidate} described by location, size, model parameter and internal - * flag. - * @param pos the location of the upper left corner of the candidate - * @param size the size of the candidate - * @param param the parameters of the label model associated with this candidate - * @param owner the label associated with the candidate - * @param [internal=false] true if the candidate is allowed to overlap with its owner, false otherwise - */ - constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:any,owner:yfiles.layout.INodeLabelLayout,internal?:boolean); - /** - * Creates a new instance of {@link yfiles.layout.NodeLabelCandidate} described by its box, model parameter and internal flag. - * @param labelBox the box that specifies the candidate's size and position - * @param param the parameters of the label model associated with this candidate - * @param owner the label associated with the candidate - * @param [internal=false] true if the candidate is allowed to overlap with its owner, false otherwise - */ - constructor(labelBox:yfiles.algorithms.YOrientedRectangle,param:any,owner:yfiles.layout.INodeLabelLayout,internal?:boolean); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.NodeLabelCandidate; - } - /** - * {@link yfiles.layout.NormalizeGraphElementOrderStage} normalizes the order of the elements within a graph to ensure the same - * order for multiple layout invocations. - *

- * Among other factors, the results produced by layout algorithms usually depend on the order of the nodes and edges within - * a graph. Unfortunately, useful operations such as hiding or unhiding elements from a graph or simply invoking layout - * algorithms on a graph will have the potential side effect of changing that order. - *

- *

- * With this {@link yfiles.layout.ILayoutStage} it is possible to establish a predefined order of nodes and edges within a graph to - * avoid non-deterministic layout behavior. Defining the order of nodes and edges is done by associating each node or edge - * in the graph with a {@link yfiles.lang.IComparable} value using a {@link yfiles.algorithms.IDataProvider} registered with the key {@link yfiles.layout.NormalizeGraphElementOrderStage#NODE_COMPARABLE_DP_KEY} - * or {@link yfiles.layout.NormalizeGraphElementOrderStage#EDGE_COMPARABLE_DP_KEY}, respectively. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface NormalizeGraphElementOrderStage extends yfiles.layout.LayoutStageBase{} - export class NormalizeGraphElementOrderStage { - /** - * Creates a new {@link yfiles.layout.NormalizeGraphElementOrderStage} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algorithm. - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Assigns comparable values for each node and edge. - *

- * The compared values are induced from the current ordering of the nodes and edges within the given graph. - *

- *

- * This is a convenient method to fill the given {@link yfiles.algorithms.IDataMap}s which can then be registered with the graph - * with keys {@link yfiles.layout.NormalizeGraphElementOrderStage#NODE_COMPARABLE_DP_KEY} and {@link yfiles.layout.NormalizeGraphElementOrderStage#EDGE_COMPARABLE_DP_KEY} - * and used for several layout calculations. - *

- * @param graph the input graph - * @param comparableNodeMap the map that will be filled with comparable values for the nodes - * @param comparableEdgeMap the map that will be filled with comparable values for the edges - * @static - */ - static fillComparableMapFromGraph(graph:yfiles.algorithms.Graph,comparableNodeMap:yfiles.algorithms.IDataMap,comparableEdgeMap:yfiles.algorithms.IDataMap):void; - /** - * Data provider key for defining a (global) order for nodes - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_COMPARABLE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for defining a (global) order for edges - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_COMPARABLE_DP_KEY:yfiles.algorithms.EdgeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.NormalizeGraphElementOrderStage; - } - /** - * {@link yfiles.layout.OrientationLayout} is a {@link yfiles.layout.ILayoutStage} that changes the orientation of the layout. - *

- * Layout Style There are four orientations that can be used for a layout. These orientations can exist with or without mirroring at - * the x-axis or y-axis. - *

- *

- * Changing the layout orientation is useful for layout styles that show a main direction. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[327.5,0],[136.25,100.31],[327.5,100.31],[507.5,100.31],[507.5,180.94],[260,180.94],[327.5,180.94],[447.5,180.94],[440,262.19],[136.25,180.94],[76.25,180.94],[387.5,342.81],[380,262.19],[500,262.19],[320,262.19],[320,342.81],[560,262.19],[196.25,180.94],[20,262.19],[260,262.19],[80,262.19],[387.5,417.81],[140,262.19],[447.5,342.81],[80,342.81],[620,180.94],[200,262.19],[387.5,180.94],[200,342.81],[140,342.81],[20,342.81],[447.5,417.81],[200,417.81],[320,417.81],[620,262.19],[507.5,342.81],[507.5,417.81],[620,342.81],[567.5,417.81],[687.5,342.81],[687.5,417.81],[627.5,417.81]],"e":[[0,1,-10,15,0,-15,[332.5,40,151.25,85.31]],[0,2,0,15,0,-15],[0,3,10,15,0,-15,[352.5,40,522.5,85.31]],[3,4,0,15,0,-15],[2,5,-10,15,0,-15,[332.5,140.31,275,165.94]],[2,6,0,15,0,-15],[3,7,-10,15,0,-15,[512.5,140.31,462.5,165.94]],[7,8,0,15,0,-15,[462.5,220.94,455,247.19]],[1,9,0,15,0,-15],[1,10,-10,15,0,-15,[141.25,140.31,91.25,165.94]],[8,11,-7.5,15,0,-15,[447.5,302.19,402.5,327.81]],[6,12,7.5,15,0,-15,[350,220.94,395,247.19]],[4,13,-7.5,15,0,-15],[6,14,-7.5,15,0,-15],[14,15,0,15,0,-15],[4,16,7.5,15,0,-15,[530,220.94,575,247.19]],[1,17,10,15,0,-15,[161.25,140.31,211.25,165.94]],[9,18,-11.25,15,0,-15,[140,220.94,35,247.19]],[5,19,0,15,0,-15],[9,20,-3.75,15,0,-15,[147.5,220.94,95,247.19]],[11,21,0,15,0,-15],[9,22,3.75,15,0,-15],[8,23,7.5,15,0,-15],[20,24,0,15,0,-15],[3,25,10,15,0,-15,[532.5,140.31,635,165.94]],[9,26,11.25,15,0,-15,[162.5,220.94,215,247.19]],[2,27,10,15,0,-15,[352.5,140.31,402.5,165.94]],[26,28,0,15,0,-15],[22,29,0,15,0,-15],[18,30,0,15,0,-15],[23,31,0,15,0,-15],[28,32,0,15,0,-15],[15,33,0,15,0,-15],[25,34,0,15,0,-15],[34,35,-10,15,0,-15,[625,302.19,522.5,327.81]],[35,36,0,15,0,-15],[34,37,0,15,0,-15],[37,38,-7.5,15,0,-15,[627.5,382.81,582.5,402.81]],[34,39,10,15,0,-15,[645,302.19,702.5,327.81]],[39,40,0,15,0,-15],[37,41,7.5,15,0,-15]],"vp":[20.0,0.0,698.0,448.0]}} - *

- *

- * {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} layout - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[327.5,-30],[136.25,-130.31],[327.5,-130.31],[507.5,-130.31],[507.5,-210.94],[260,-210.94],[327.5,-210.94],[447.5,-210.94],[440,-292.19],[136.25,-210.94],[76.25,-210.94],[387.5,-372.81],[380,-292.19],[500,-292.19],[320,-292.19],[320,-372.81],[560,-292.19],[196.25,-210.94],[20,-292.19],[260,-292.19],[80,-292.19],[387.5,-447.81],[140,-292.19],[447.5,-372.81],[80,-372.81],[620,-210.94],[200,-292.19],[387.5,-210.94],[200,-372.81],[140,-372.81],[20,-372.81],[447.5,-447.81],[200,-447.81],[320,-447.81],[620,-292.19],[507.5,-372.81],[507.5,-447.81],[620,-372.81],[567.5,-447.81],[687.5,-372.81],[687.5,-447.81],[627.5,-447.81]],"e":[[0,1,-10,-15,0,15,[332.5,-40,151.25,-85.31]],[0,2,0,-15,0,15],[0,3,10,-15,0,15,[352.5,-40,522.5,-85.31]],[3,4,0,-15,0,15],[2,5,-10,-15,0,15,[332.5,-140.31,275,-165.94]],[2,6,0,-15,0,15],[3,7,-10,-15,0,15,[512.5,-140.31,462.5,-165.94]],[7,8,0,-15,0,15,[462.5,-220.94,455,-247.19]],[1,9,0,-15,0,15],[1,10,-10,-15,0,15,[141.25,-140.31,91.25,-165.94]],[8,11,-7.5,-15,0,15,[447.5,-302.19,402.5,-327.81]],[6,12,7.5,-15,0,15,[350,-220.94,395,-247.19]],[4,13,-7.5,-15,0,15],[6,14,-7.5,-15,0,15],[14,15,0,-15,0,15],[4,16,7.5,-15,0,15,[530,-220.94,575,-247.19]],[1,17,10,-15,0,15,[161.25,-140.31,211.25,-165.94]],[9,18,-11.25,-15,0,15,[140,-220.94,35,-247.19]],[5,19,0,-15,0,15],[9,20,-3.75,-15,0,15,[147.5,-220.94,95,-247.19]],[11,21,0,-15,0,15],[9,22,3.75,-15,0,15],[8,23,7.5,-15,0,15],[20,24,0,-15,0,15],[3,25,10,-15,0,15,[532.5,-140.31,635,-165.94]],[9,26,11.25,-15,0,15,[162.5,-220.94,215,-247.19]],[2,27,10,-15,0,15,[352.5,-140.31,402.5,-165.94]],[26,28,0,-15,0,15],[22,29,0,-15,0,15],[18,30,0,-15,0,15],[23,31,0,-15,0,15],[28,32,0,-15,0,15],[15,33,0,-15,0,15],[25,34,0,-15,0,15],[34,35,-10,-15,0,15,[625,-302.19,522.5,-327.81]],[35,36,0,-15,0,15],[34,37,0,-15,0,15],[37,38,-7.5,-15,0,15,[627.5,-382.81,582.5,-402.81]],[34,39,10,-15,0,15,[645,-302.19,702.5,-327.81]],[39,40,0,-15,0,15],[37,41,7.5,-15,0,15]],"vp":[20.0,-448.0,698.0,448.0]}} - *

- *

- * {@link yfiles.layout.LayoutOrientation#BOTTOM_TO_TOP} layout with {@link yfiles.layout.MirrorModes#BOTTOM_TO_TOP mirroring} - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[0,-357.5],[100.31,-166.25],[100.31,-357.5],[100.31,-537.5],[180.94,-537.5],[180.94,-290],[180.94,-357.5],[180.94,-477.5],[262.19,-470],[180.94,-166.25],[180.94,-106.25],[342.81,-417.5],[262.19,-410],[262.19,-530],[262.19,-350],[342.81,-350],[262.19,-590],[180.94,-226.25],[262.19,-50],[262.19,-290],[262.19,-110],[417.81,-417.5],[262.19,-170],[342.81,-477.5],[342.81,-110],[180.94,-650],[262.19,-230],[180.94,-417.5],[342.81,-230],[342.81,-170],[342.81,-50],[417.81,-477.5],[417.81,-230],[417.81,-350],[262.19,-650],[342.81,-537.5],[417.81,-537.5],[342.81,-650],[417.81,-597.5],[342.81,-717.5],[417.81,-717.5],[417.81,-657.5]],"e":[[0,1,15,10,-15,-0,[40,-332.5,85.31,-151.25]],[0,2,15,-0,-15,-0],[0,3,15,-10,-15,-0,[40,-352.5,85.31,-522.5]],[3,4,15,-0,-15,-0],[2,5,15,10,-15,-0,[140.31,-332.5,165.94,-275]],[2,6,15,-0,-15,-0],[3,7,15,10,-15,-0,[140.31,-512.5,165.94,-462.5]],[7,8,15,-0,-15,-0,[220.94,-462.5,247.19,-455]],[1,9,15,-0,-15,-0],[1,10,15,10,-15,-0,[140.31,-141.25,165.94,-91.25]],[8,11,15,7.5,-15,-0,[302.19,-447.5,327.81,-402.5]],[6,12,15,-7.5,-15,-0,[220.94,-350,247.19,-395]],[4,13,15,7.5,-15,-0],[6,14,15,7.5,-15,-0],[14,15,15,-0,-15,-0],[4,16,15,-7.5,-15,-0,[220.94,-530,247.19,-575]],[1,17,15,-10,-15,-0,[140.31,-161.25,165.94,-211.25]],[9,18,15,11.25,-15,-0,[220.94,-140,247.19,-35]],[5,19,15,-0,-15,-0],[9,20,15,3.75,-15,-0,[220.94,-147.5,247.19,-95]],[11,21,15,-0,-15,-0],[9,22,15,-3.75,-15,-0],[8,23,15,-7.5,-15,-0],[20,24,15,-0,-15,-0],[3,25,15,-10,-15,-0,[140.31,-532.5,165.94,-635]],[9,26,15,-11.25,-15,-0,[220.94,-162.5,247.19,-215]],[2,27,15,-10,-15,-0,[140.31,-352.5,165.94,-402.5]],[26,28,15,-0,-15,-0],[22,29,15,-0,-15,-0],[18,30,15,-0,-15,-0],[23,31,15,-0,-15,-0],[28,32,15,-0,-15,-0],[15,33,15,-0,-15,-0],[25,34,15,-0,-15,-0],[34,35,15,10,-15,-0,[302.19,-625,327.81,-522.5]],[35,36,15,-0,-15,-0],[34,37,15,-0,-15,-0],[37,38,15,7.5,-15,-0,[382.81,-627.5,402.81,-582.5]],[34,39,15,-10,-15,-0,[302.19,-645,327.81,-702.5]],[39,40,15,-0,-15,-0],[37,41,15,-7.5,-15,-0]],"vp":[0.0,-718.0,448.0,698.0]}} - *

- *

- * {@link yfiles.layout.LayoutOrientation#LEFT_TO_RIGHT} layout - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[-30,327.5],[-130.31,136.25],[-130.31,327.5],[-130.31,507.5],[-210.94,507.5],[-210.94,260],[-210.94,327.5],[-210.94,447.5],[-292.19,440],[-210.94,136.25],[-210.94,76.25],[-372.81,387.5],[-292.19,380],[-292.19,500],[-292.19,320],[-372.81,320],[-292.19,560],[-210.94,196.25],[-292.19,20],[-292.19,260],[-292.19,80],[-447.81,387.5],[-292.19,140],[-372.81,447.5],[-372.81,80],[-210.94,620],[-292.19,200],[-210.94,387.5],[-372.81,200],[-372.81,140],[-372.81,20],[-447.81,447.5],[-447.81,200],[-447.81,320],[-292.19,620],[-372.81,507.5],[-447.81,507.5],[-372.81,620],[-447.81,567.5],[-372.81,687.5],[-447.81,687.5],[-447.81,627.5]],"e":[[0,1,-15,-10,15,0,[-40,332.5,-85.31,151.25]],[0,2,-15,0,15,0],[0,3,-15,10,15,0,[-40,352.5,-85.31,522.5]],[3,4,-15,0,15,0],[2,5,-15,-10,15,0,[-140.31,332.5,-165.94,275]],[2,6,-15,0,15,0],[3,7,-15,-10,15,0,[-140.31,512.5,-165.94,462.5]],[7,8,-15,0,15,0,[-220.94,462.5,-247.19,455]],[1,9,-15,0,15,0],[1,10,-15,-10,15,0,[-140.31,141.25,-165.94,91.25]],[8,11,-15,-7.5,15,0,[-302.19,447.5,-327.81,402.5]],[6,12,-15,7.5,15,0,[-220.94,350,-247.19,395]],[4,13,-15,-7.5,15,0],[6,14,-15,-7.5,15,0],[14,15,-15,0,15,0],[4,16,-15,7.5,15,0,[-220.94,530,-247.19,575]],[1,17,-15,10,15,0,[-140.31,161.25,-165.94,211.25]],[9,18,-15,-11.25,15,0,[-220.94,140,-247.19,35]],[5,19,-15,0,15,0],[9,20,-15,-3.75,15,0,[-220.94,147.5,-247.19,95]],[11,21,-15,0,15,0],[9,22,-15,3.75,15,0],[8,23,-15,7.5,15,0],[20,24,-15,0,15,0],[3,25,-15,10,15,0,[-140.31,532.5,-165.94,635]],[9,26,-15,11.25,15,0,[-220.94,162.5,-247.19,215]],[2,27,-15,10,15,0,[-140.31,352.5,-165.94,402.5]],[26,28,-15,0,15,0],[22,29,-15,0,15,0],[18,30,-15,0,15,0],[23,31,-15,0,15,0],[28,32,-15,0,15,0],[15,33,-15,0,15,0],[25,34,-15,0,15,0],[34,35,-15,-10,15,0,[-302.19,625,-327.81,522.5]],[35,36,-15,0,15,0],[34,37,-15,0,15,0],[37,38,-15,-7.5,15,0,[-382.81,627.5,-402.81,582.5]],[34,39,-15,10,15,0,[-302.19,645,-327.81,702.5]],[39,40,-15,0,15,0],[37,41,-15,7.5,15,0]],"vp":[-448.0,20.0,448.0,698.0]}} - *

- *

- * {@link yfiles.layout.LayoutOrientation#RIGHT_TO_LEFT} layout - *

- *

- * Concept {@link yfiles.layout.OrientationLayout} performs three basic steps. - *

- *
    - *
  1. - * Preparation: The sizes and locations of nodes and edge bends as well as labels and {@link yfiles.layout.PortConstraint}s are - * transformed to the {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} orientation. - *
  2. - *
  3. - * Delegation: The {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} is invoked and calculates the layout for orientation - * {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM}. - *
  4. - *
  5. Completion: The result of the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} is rotated and mirrored to fit the desired layout orientation.
  6. - *
- *

- * Features - *

- *

- * {@link yfiles.layout.OrientationLayout} can either be used as a {@link yfiles.layout.ILayoutStage} wrapping a {@link yfiles.layout.ILayoutAlgorithm layout algorithm}. Then it - * will change the orientation of the result of the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *
- * If no {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} is specified, {@link yfiles.layout.OrientationLayout} can work alone. It will just change the - * orientation of the layout without arranging nodes and edges. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface OrientationLayout extends yfiles.layout.LayoutStageBase{} - export class OrientationLayout { - /** - * Creates a new {@link yfiles.layout.OrientationLayout} instance using the given orientation. - * @param orientation the orientation specifier - * @throws {Stubs.Exceptions.ArgumentError} if the specified orientation is unknown - * @see yfiles.layout.OrientationLayout#orientation - */ - constructor(orientation:yfiles.layout.LayoutOrientation); - /** - * Creates a new {@link yfiles.layout.OrientationLayout} instance using the given {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param coreLayouter the core layout routine - */ - constructor(coreLayouter:yfiles.layout.ILayoutAlgorithm); - /** - * Creates a new {@link yfiles.layout.OrientationLayout} instance with default settings. - */ - constructor(); - /** - * Applies the desired orientation to the graph. - *

- * It performs the inverse coordinate transformation that has been applied to the layout by method - * {@link yfiles.layout.OrientationLayout#prepareOrientationChange}. - *

- *

- * This method is called by {@link yfiles.layout.OrientationLayout#applyLayout} after invoking the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. It may be overridden to extend the orientation change to custom layout features. - *

- * @param graph the input graph - * @see yfiles.layout.OrientationLayout#prepareOrientationChange - */ - completeOrientationChange(graph:yfiles.layout.LayoutGraph):void; - /** - * Transforms the given point during completion. - *

- * The point is transformed from {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} orientation to the desired orientation. - *

- * @param point the calculated point - * @returns the transformed point - * @see yfiles.layout.OrientationLayout#completeOrientationChange - */ - completeTransform(point:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; - /** - * Creates {@link yfiles.algorithms.Insets} that are a geometric transformation of the given {@link yfiles.algorithms.Insets}. - *

- * The transform will correspond to the currently set orientation. - *

- * @param insets the original insets - * @returns the oriented insets - * @see yfiles.layout.OrientationLayout#orientation - */ - createOrientedInsets(insets:yfiles.algorithms.Insets):yfiles.algorithms.Insets; - /** - * Creates a {@link yfiles.layout.NodeHalo} that is a geometric transformation of the given {@link yfiles.layout.NodeHalo}. - *

- * The transform will correspond to the currently set orientation. - *

- * @param halo the original {@link } - * @returns the oriented {@link } - * @see yfiles.layout.OrientationLayout#orientation - */ - createOrientedNodeHalo(halo:yfiles.layout.NodeHalo):yfiles.layout.NodeHalo; - /** - * Creates a {@link yfiles.algorithms.YDimension} that is a geometric transformation of the given size. - *

- * The transform will correspond to the currently set orientation. - *

- * @param nodeSize the original node size - * @returns the oriented node size - * @see yfiles.layout.OrientationLayout#orientation - */ - createOrientedNodeSize(nodeSize:yfiles.algorithms.YDimension):yfiles.algorithms.YDimension; - /** - * Returns whether or not this {@link yfiles.layout.OrientationLayout} instance will mirror the graph for a given layout - * orientation. - *

- * Horizontal orientations get mirrored at the x-axis while vertical orientations are mirrored at the y-axis. - *

- * @param orientation the layout orientation for which to check the mirror state - * @returns true if the layout algorithm will mirror the graph at the corresponding axis for the given layout orientation, false - * otherwise - * @see yfiles.layout.OrientationLayout#orientation - * @see yfiles.layout.OrientationLayout#mirrorMode - */ - isOrientationMirrored(orientation:yfiles.layout.LayoutOrientation):boolean; - /** - * Prepares the layout for the desired orientation. - *

- * It will rotate and mirror the coordinates and bounds of the graph layout such that the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} can perform - * its calculations assuming the canonical {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} orientation. - *

- *

- * This method is called by {@link yfiles.layout.OrientationLayout#applyLayout} before invoking the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. It might be overridden to extend the preparations to custom layout features. - *

- * @param graph the input graph - * @see yfiles.layout.OrientationLayout#completeOrientationChange - */ - prepareOrientationChange(graph:yfiles.layout.LayoutGraph):void; - /** - * Transforms the given point during preparation. - *

- * The point is transformed so it matches the {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} orientation. - *

- * @param point the original point - * @returns the transformed point - * @see yfiles.layout.OrientationLayout#prepareOrientationChange - */ - prepareTransform(point:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; - /** - * Transforms the given point during the preparation or completion step. - *

- * This method is called by {@link yfiles.layout.OrientationLayout#prepareOrientationChange} and {@link yfiles.layout.OrientationLayout#completeOrientationChange} - * to get the according point location. - *

- * @param point the original/calculated point - * @param prepare true if this method is called during preparation, false if it is called during completion - * @returns the transformed point - * @see yfiles.layout.OrientationLayout#prepareOrientationChange - * @see yfiles.layout.OrientationLayout#completeOrientationChange - * @see yfiles.layout.OrientationLayout#prepareTransform - * @see yfiles.layout.OrientationLayout#completeTransform - * @protected - */ - transform(point:yfiles.algorithms.YPoint,prepare:boolean):yfiles.algorithms.YPoint; - /** - * Gets or sets the main direction of the layout. - * @throws {Stubs.Exceptions.ArgumentError} if the specified orientation is unknown - * @type {yfiles.layout.LayoutOrientation} - */ - orientation:yfiles.layout.LayoutOrientation; - /** - * Gets or sets the mirror mask that defines which orientations this {@link yfiles.layout.OrientationLayout} shall mirror. - *

- * {@link yfiles.layout.OrientationLayout#orientation Setting a layout orientation} can be seen as rotating the graph by 90, 180 or 270 degrees. Afterwards the graph can be - * mirrored at the x-axis (for horizontal layout orientations) or y-axis (for vertical layout orientations). - *

- *

- * Which directions are mirrored can be defined by the given mask. It can combine several mirrored directions with a - * logical or-operation. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an unknown mask is specified - * @type {yfiles.layout.MirrorModes} - */ - mirrorMode:yfiles.layout.MirrorModes; - /** - * Gets whether or not the current orientation is horizontal. - *

- * The orientation is horizontal if it is {@link yfiles.layout.LayoutOrientation#LEFT_TO_RIGHT} or - * {@link yfiles.layout.LayoutOrientation#RIGHT_TO_LEFT}. - *

- * @see yfiles.layout.OrientationLayout#orientation - * @type {boolean} - */ - horizontalOrientation:boolean; - /** - * Gets or sets whether or not the position of the edge labels should be changed during orientation change. - * @type {boolean} - */ - considerEdgeLabels:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.OrientationLayout; - } - /** - * {@link yfiles.layout.PortCalculator} adjusts the final port assignments after a layout has been calculated. - *

- * This can be useful if the port assignment calculated by the layout algorithm is insufficient. This stage uses {@link yfiles.algorithms.IDataProvider} - * instances registered with the graph using the keys defined in the {@link yfiles.layout.IIntersectionCalculator} interface to - * calculate the new port offsets. - *

- *

- * For each edge in the graph, {@link yfiles.layout.IIntersectionCalculator}s are retrieved from these - * {@link yfiles.algorithms.IDataProvider}s. If such an {@link yfiles.layout.IIntersectionCalculator} is assigned, it will provide the - * intersection point of the edge and the node. Then this point is added to the {@link yfiles.layout.IEdgeLayout}. - *

- *

- * For this layout stage to work properly, use {@link yfiles.layout.CompositeLayoutStage#prependStage} or {@link yfiles.layout.MultiStageLayout#prependStage} - * to add this layout stage and register appropriate {@link yfiles.algorithms.IDataProvider}s with the graph using the keys defined - * in {@link yfiles.layout.IIntersectionCalculator}. - *

- *

- * Note that this class will not change the coordinates of a port if it is associated with a strong port constraint. - *

- * @see yfiles.layout.IIntersectionCalculator - * @see yfiles.layout.IntersectionCalculatorKeys#SOURCE_INTERSECTION_CALCULATOR_DP_KEY - * @see yfiles.layout.IntersectionCalculatorKeys#TARGET_INTERSECTION_CALCULATOR_DP_KEY - * @see yfiles.layout.PortConstraint - * @class - * @extends {yfiles.layout.LayoutStageBase} - * @implements {yfiles.layout.ILayoutStage} - */ - export interface PortCalculator extends yfiles.layout.LayoutStageBase,yfiles.layout.ILayoutStage{} - export class PortCalculator { - /** - * Creates a new {@link yfiles.layout.PortCalculator} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - */ - constructor(); - /** - * Performs the actual port calculation on the specified graph instance. - * @param graph the input graph - * @protected - */ - calculatePorts(graph:yfiles.layout.LayoutGraph):void; - /** - * Determines whether two points are equal. - *

- * This implementation uses {@link yfiles.layout.PortCalculator#Eps} to add some tolerance to the comparison. It is called by {@link yfiles.layout.PortCalculator#calculatePorts} - * and may be overridden to change the accuracy/tolerance of the comparison. - *

- * @param x1 the x-coordinate of the first point - * @param y1 the y-coordinate of the first point - * @param x2 the x-coordinate of the second point - * @param y2 the y-coordinate of the second point - * @returns true if both points are considered equal, false otherwise - * @see yfiles.layout.PortCalculator#calculatePorts - * @see yfiles.layout.PortCalculator#Eps - * @protected - */ - equalsEps(x1:number,y1:number,x2:number,y2:number):boolean; - /** - * EPSILON used by {@link yfiles.layout.PortCalculator#equalsEps}. - *

- * By default this is 0.2d. - *

- * @protected - * @type {number} - */ - Eps:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PortCalculator; - } - /** - * This class represents a candidate port on which edges can be connected to their source and/or target node. - *

- * The notion of {@link yfiles.layout.PortCandidate}s extends the one of {@link yfiles.layout.PortConstraint}s. In contrast to - * {@link yfiles.layout.PortConstraint}s, they can be associated with both edges and nodes. Moreover, more than one {@link yfiles.layout.PortCandidate} - * can be specified for an edge or a node. - *

- *

- * Edge {@link yfiles.layout.PortCandidate}s can be introduced to define specific sides or exact locations on which a given edge can be - * connected to its source or target node. - *
- * Information about edge {@link yfiles.layout.PortCandidate}s is held by {@link yfiles.algorithms.IDataProvider}s that are registered with - * the graph using keys {@link yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY} (to specify - * {@link yfiles.layout.PortCandidate}s for an edge on the source node) and {@link yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY} - * (to specify {@link yfiles.layout.PortCandidate}s for an edge on the target node). The {@link yfiles.algorithms.IDataProvider}s hold a {@link yfiles.collections.ICollection. collection} - * of {@link yfiles.layout.PortCandidate}s for each edge. - *

- *

- * Node {@link yfiles.layout.PortCandidate}s determine available ports on the nodes to which edges can be connected. This means that an - * edge of the graph can be connected to any of these node ports (unless edge {@link yfiles.layout.PortCandidate}s are specified - * too). - *
- * To register and define node {@link yfiles.layout.PortCandidate}s refer to {@link yfiles.layout.PortCandidateSet}. - *

- *

- * A {@link yfiles.layout.PortCandidate} is described by the following attributes: - *

- *
    - *
  • - * Offsets: The X-offset (Y-offset) determines the horizontal (vertical) distance of the {@link yfiles.layout.PortCandidate} - * relative to the center of the node. - *
  • - *
  • - * Fixed or free: Fixed - * {@link yfiles.layout.PortCandidate}s are defined using exact coordinates, whereas coordinates of free candidates are selected - * arbitrarily. - *
  • - *
  • - * Direction: Corresponds to the incoming or outgoing directions of the edges when connecting to a target or source node, - * respectively. - *
  • - *
  • - * Penalty cost: Represents the cost of usage of a - * {@link yfiles.layout.PortCandidate}. During the processing of an edge by a layout or routing algorithm, candidates of lower cost - * will be considered first. - *
  • - *
- *

- * If candidates are defined for nodes as well as for edges and if they should be properly matched by layout algorithms - * (i.e. detected as the same candidate), then it is important that the same {@link yfiles.layout.PortCandidate} instance is - * registered. It does not suffice to register candidates with the same parameter values. - *

- *

- * {@graph {"ann":{"s":[60,30],"d":1},"styles":{"6":{"f":"#ff0000","b":1, "c":1}, "7":{"f":"#00ffff","b":1}, "8":{"f":"#008000","b":1}},"n":[[646.5,475.5],[725.5,528.5],[831.5,470],[669.5,605.5],[722.5,530.5,6,6,8],[724,549.5,3,8,7],[783,531,5,5,6],[783,551,5,5,6],[667.5,502,6,6,8],[696.5,604.5,8,3,7],[848,498,5,5,6],[696.5,634,8,3,7],[848,468.12,5,5,6],[667.5,472.5,6,6,8],[737.5,525,6,6,8]],"e":[[0,1,-6,15,-30,-10,[670.5,533.5]],[2,1,-11,15,30,-10,[850.5,533.5]],[3,1,1,-15,-30,10,[700.5,553.5]]],"vp":[646.0,468.0,246.0,169.0]}} Example of using edge port candidates. Edge port candidates are colored uniquely based on the edge with which they are - * associated. - *

- *

- * Not all layout and routing algorithms are able to handle {@link yfiles.layout.PortCandidate}s. Major layout algorithms that obey - * them are {@link yfiles.hierarchic.HierarchicLayout}, {@link yfiles.router.EdgeRouter}, {@link yfiles.router.ChannelEdgeRouter} and - * {@link yfiles.router.BusRouter}. - *

- * @class - */ - export interface PortCandidate extends yfiles.lang.Object{} - export class PortCandidate { - /** - * Factory method that creates a fixed {@link yfiles.layout.PortCandidate} instance with the given cost of usage, direction and - * offset values. - * @param directionMask any combination of the default direction specifiers - * @param xOffset the X-offset relative to the center of the node - * @param yOffset the Y-offset relative to the center of the node - * @param [cost=0.0] the penalty cost for using this {@link } instance - * @returns a new {@link } instance - * @static - */ - static createCandidate(xOffset:number,yOffset:number,directionMask:yfiles.layout.PortDirections,cost?:number):yfiles.layout.PortCandidate; - /** - * Factory method that creates a free {@link yfiles.layout.PortCandidate} instance with the given direction and cost of usage. - * @param directionMask any combination of the default direction specifiers - * @param cost the penalty cost for using this {@link } - * @returns a new {@link } instance - * @static - */ - static createCandidate(directionMask:yfiles.layout.PortDirections,cost:number):yfiles.layout.PortCandidate; - /** - * Factory method that returns a free {@link yfiles.layout.PortCandidate} instance with zero cost of usage and the direction - * specified by the {@link yfiles.layout.PortConstraint#side side} of the given {@link yfiles.layout.PortConstraint}. - * @param fromPortConstraint the {@link } whose {@link #side side} should be used as direction - * @returns a new {@link } instance - * @static - */ - static createCandidate(fromPortConstraint:yfiles.layout.PortConstraint):yfiles.layout.PortCandidate; - /** - * Factory method that creates a free {@link yfiles.layout.PortCandidate} instance with the given direction and zero cost of - * usage. - * @param directionMask any combination of the default direction specifiers - * @returns a new {@link } instance - * @static - */ - static createCandidate(directionMask:yfiles.layout.PortDirections):yfiles.layout.PortCandidate; - /** - * Returns the direction of this {@link yfiles.layout.PortCandidate} instance with respect to the given {@link yfiles.layout.OrientationLayout#orientation layout orientation}. - *

- * If the direction mask is not required to be calculated with respect to the actual {@link yfiles.layout.OrientationLayout#orientation layout orientation}, {@link yfiles.layout.PortCandidate#direction} should be used - * instead. - *

- * @param layoutOrientation - * @returns the direction of this {@link } with respect to the given layout orientation - * @see yfiles.layout.PortCandidate#direction - */ - getDirectionForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation):yfiles.layout.PortDirections; - /** - * Returns the X-offset of the {@link yfiles.layout.PortCandidate} with respect to the center of the corresponding node for the - * given {@link yfiles.layout.OrientationLayout#orientation layout orientation} and {@link yfiles.layout.OrientationLayout#mirrorMode mirror mask}. - *

- * The X-offset encodes the horizontal distance of the port relative to the center of a node. If the {@link yfiles.layout.PortCandidate} - * is not {@link yfiles.layout.PortCandidate#fixed fixed} (i.e., free), the X-offset is equal to zero. - *

- * @param layoutOrientation the layout orientation - * @param mirrorMask the mirror mask - * @returns the X-offset of the port with respect to the given orientation and mirror mask - */ - getXOffsetForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation,mirrorMask:yfiles.layout.MirrorModes):number; - /** - * Returns the X-offset of the {@link yfiles.layout.PortCandidate} with respect to the center of the corresponding node for the - * given {@link yfiles.layout.OrientationLayout#orientation layout orientation}. - *

- * The X-offset encodes the horizontal distance of the port relative to the center of a node. If the {@link yfiles.layout.PortCandidate} - * is not {@link yfiles.layout.PortCandidate#fixed fixed} (i.e., free), the X-offset is equal to zero. - *

- * @param layoutOrientation the layout orientation - * @returns the X-offset of the {@link } with respect to the given layout orientation - */ - getXOffsetForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation):number; - /** - * Returns the Y-offset of the {@link yfiles.layout.PortCandidate} with respect to the center of the corresponding node for the - * given {@link yfiles.layout.OrientationLayout#orientation layout orientation} and {@link yfiles.layout.OrientationLayout#mirrorMode mirror mask}. - *

- * The Y-offset encodes the vertical distance of the port relative to the center of a node. If the {@link yfiles.layout.PortCandidate} - * is not {@link yfiles.layout.PortCandidate#fixed fixed} (i.e., free), the Y-offset is equal to zero. - *

- * @param layoutOrientation the layout orientation - * @param mirrorMask the mirror mask - * @returns the Y-offset of the {@link } with respect to the given orientation and mirror mask - */ - getYOffsetForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation,mirrorMask:yfiles.layout.MirrorModes):number; - /** - * Returns the Y-offset of the {@link yfiles.layout.PortCandidate} with respect to the center of the corresponding node for the - * given {@link yfiles.layout.OrientationLayout#orientation layout orientation}. - *

- * The Y-offset encodes the vertical distance of the port relative to the center of a node. If the {@link yfiles.layout.PortCandidate} - * is not {@link yfiles.layout.PortCandidate#fixed fixed} (i.e., free), the Y-offset is equal to zero. - *

- * @param layoutOrientation the layout orientation - * @returns the Y-offset of the {@link } with respect to the given layout orientation - */ - getYOffsetForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation):number; - /** - * Returns whether or not this {@link yfiles.layout.PortCandidate} lies in the given direction. - * @param directionMask one of the default direction specifiers - * @returns true if this {@link } lies in the given direction, false otherwise - */ - isInDirection(directionMask:yfiles.layout.PortDirections):boolean; - /** - * A utility method that converts the current {@link yfiles.layout.PortCandidate} instance to a {@link yfiles.layout.PortConstraint}. - *

- * The {@link yfiles.layout.PortConstraint#side side} of the created {@link yfiles.layout.PortConstraint} matches the {@link yfiles.layout.PortCandidate#direction direction} of this {@link yfiles.layout.PortCandidate}. - *

- *

- * If this {@link yfiles.layout.PortCandidate} is {@link yfiles.layout.PortCandidate#fixed fixed}, the resulting {@link yfiles.layout.PortConstraint} will be {@link yfiles.layout.PortConstraint#strong strong}. - *

- * @returns a {@link } that matches this {@link } - */ - toPortConstraint():yfiles.layout.PortConstraint; - /** - * A utility method that converts the current {@link yfiles.layout.PortCandidate} instance to a {@link yfiles.layout.PortConstraint} with - * respect to the given {@link yfiles.layout.OrientationLayout#orientation layout orientation}. - *

- * The {@link yfiles.layout.PortConstraint#side side} of the created {@link yfiles.layout.PortConstraint} is the {@link yfiles.layout.PortCandidate#direction direction} of this {@link yfiles.layout.PortCandidate} interpreted - * for the given orientation. - *

- *

- * If this {@link yfiles.layout.PortCandidate} is {@link yfiles.layout.PortCandidate#fixed fixed}, the resulting {@link yfiles.layout.PortConstraint} will be {@link yfiles.layout.PortConstraint#strong strong}. - *

- * @param layoutOrientation - * @returns a {@link } that matches this {@link } with respect to the given orientation - */ - toPortConstraintForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation):yfiles.layout.PortConstraint; - /** - * Data provider key for specifying source port candidates for each edge - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.>} - */ - static SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY:yfiles.algorithms.EdgeDpKey>; - /** - * Data provider key for specifying target port candidates for each edge - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.>} - */ - static TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY:yfiles.algorithms.EdgeDpKey>; - /** - * Gets the direction of this {@link yfiles.layout.PortCandidate}. - *

- * If the direction is required to be calculated with respect to the actual {@link yfiles.layout.OrientationLayout#orientation layout orientation}, {@link yfiles.layout.PortCandidate#getDirectionForLayoutOrientation} - * should be used instead. - *

- * @see yfiles.layout.PortCandidate#getDirectionForLayoutOrientation - * @type {yfiles.layout.PortDirections} - */ - direction:yfiles.layout.PortDirections; - /** - * Gets whether or not this {@link yfiles.layout.PortCandidate} is fixed. - *

- * Fixed - * {@link yfiles.layout.PortCandidate}s are defined using exact coordinates, whereas coordinates of free candidates are selected - * arbitrarily. - *

- * @type {boolean} - */ - fixed:boolean; - /** - * Gets the X-offset of the {@link yfiles.layout.PortCandidate} with respect to the center of the corresponding node. - *

- * The X-offset encodes the horizontal distance of the port relative to the center of a node. If the {@link yfiles.layout.PortCandidate} - * is not {@link yfiles.layout.PortCandidate#fixed fixed} (i.e., free), the X-offset is zero. - *

- * @type {number} - */ - xOffset:number; - /** - * Gets the Y-offset of the {@link yfiles.layout.PortCandidate} with respect to the center of the corresponding node. - *

- * The Y-offset encodes the vertical distance of the port relative to the center of a node. If the {@link yfiles.layout.PortCandidate} - * is not {@link yfiles.layout.PortCandidate#fixed fixed} (i.e., free), the Y-offset is zero. - *

- * @type {number} - */ - yOffset:number; - /** - * Gets the penalty cost for using this {@link yfiles.layout.PortCandidate} instance. - * @type {number} - */ - cost:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PortCandidate; - } - /** - * A {@link yfiles.layout.IPortCandidateMatcher} retrieves the best matching {@link yfiles.layout.IPortCandidateSetEntry entries} from a {@link yfiles.layout.PortCandidateSet}. - *

- * How well a candidate is matching can be decided based on its cost, its currently available capacity, its offsets or - * whether or not its direction is consistent with the desired one. - *

- *

- * To use custom implementations of this interface, method {@link yfiles.layout.PortCandidateSet#createMatcher} should be - * overridden. - *

- * @interface - */ - export interface IPortCandidateMatcher extends yfiles.lang.Object{ - /** - * Returns the next best matching {@link yfiles.layout.IPortCandidateSetEntry} for the given parameters. - * @param edge the edge for which to find a candidate - * @param source true if the given edge connects to its source node, false otherwise - * @param xOffset the preferred X-offset of the port relative to the center of the node - * @param yOffset the preferred Y-offset of the port relative to the center of the node - * @param directionMask any combination of default directions defined in {@link } - * @returns a matching {@link } instance - * @abstract - */ - findMatchingCandidate(edge:yfiles.algorithms.Edge,source:boolean,xOffset:number,yOffset:number,directionMask:yfiles.layout.PortDirections):yfiles.layout.IPortCandidateSetEntry; - /** - * Returns the next best matching {@link yfiles.layout.IPortCandidateSetEntry} for the given parameters. - * @param edge the edge for which to find a candidate - * @param source true if the given edge connects to its source node, false otherwise - * @param directionMask any combination of default directions defined in {@link } - * @returns a matching {@link } instance - * @abstract - */ - findMatchingCandidate(edge:yfiles.algorithms.Edge,source:boolean,directionMask:yfiles.layout.PortDirections):yfiles.layout.IPortCandidateSetEntry; - /** - * Returns the next best matching {@link yfiles.layout.IPortCandidateSetEntry}. - * @returns a matching {@link } instance - * @abstract - */ - findMatchingCandidate():yfiles.layout.IPortCandidateSetEntry; - } - var IPortCandidateMatcher:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IPortCandidateMatcher; - }; - /** - * This interface represents an entry of a {@link yfiles.layout.PortCandidateSet} and provides access to the actual {@link yfiles.layout.PortCandidate} - * instance and the maximum number of edges allowed to connect to it. - * @interface - */ - export interface IPortCandidateSetEntry extends yfiles.lang.Object{ - /** - * Gets the actual {@link yfiles.layout.PortCandidate} associated with this {@link yfiles.layout.IPortCandidateSetEntry}. - * @abstract - * @type {yfiles.layout.PortCandidate} - */ - portCandidate:yfiles.layout.PortCandidate; - /** - * Gets the maximum number of edges allowed to connect to the {@link yfiles.layout.PortCandidate} associated with this - * {@link yfiles.layout.IPortCandidateSetEntry}. - *

- * 0x7FFFFFFF indicates that the number of connections is unbounded. - *

- * @abstract - * @type {number} - */ - connections:number; - } - var IPortCandidateSetEntry:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IPortCandidateSetEntry; - }; - /** - * This class associates {@link yfiles.layout.PortCandidate}s with the nodes of a graph. - *

- * {@link yfiles.layout.PortCandidate}s defined on nodes specify sides or even exact locations at which edges can be connected. - * This means that an edge can be connected to any of the available node ports (unless edge {@link yfiles.layout.PortCandidate}s - * are specified too). Each node {@link yfiles.layout.PortCandidate} has a capacity, i.e., a maximum number of edges allowed to - * connect to it. - *

- *

- * Information about {@link yfiles.layout.PortCandidate}s on nodes is held by a {@link yfiles.algorithms.IDataProvider} that stores a {@link yfiles.layout.PortCandidateSet} - * for each node and is registered with the graph using key {@link yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY}. - *

- *

- * The {@link yfiles.layout.PortCandidate}s are retrieved from the {@link yfiles.layout.PortCandidateSet} through a {@link yfiles.layout.IPortCandidateSetEntry} - * that holds the information about the actual {@link yfiles.layout.PortCandidate}. This object is also used for retrieving the - * best candidate from a {@link yfiles.layout.PortCandidateSet} based on the cost (lower costs are considered first) and the - * available capacity of each candidate. Custom searching for the best {@link yfiles.layout.PortCandidate} can be achieved by - * implementing {@link yfiles.layout.IPortCandidateMatcher} interface. - *

- *

- * {@graph {"ann":{"s":[5,5],"d":1},"styles":{"6":{"f":"#008000","b":1, "c":1}, "7":{"f":"#00ffff","b":1}, "8":{"f":"#ff0000","b":1}},"n":[[-54,-100,60,30],[25,-47,60,30],[131,-105.5,60,30],[-31,30,60,30],[111,30.5,60,30],[63.81,-49.5,8],[40.81,-49.5,8],[23.5,-46,3,8,7],[23.5,-26,3,8,7],[83.5,-46,3,8,7],[83.5,-26,3,8,7,6],[40.81,-19.5,8],[63.81,-19.5,8],[-32.5,-73,6],[-2.5,28,6],[132.5,28,6],[147.5,-77.5,6]],"e":[[0,1,-6,15,-30,-10,[-30,-42]],[2,1,-11,15,30,-10,[150,-42]],[3,1,1,-15,-30,10,[0,-22]],[4,1,-6,-15,30,10,[135,-22]]],"vp":[-54.0,-106.0,245.0,167.0]}} Example of node port candidates. Circular ports represent node port candidates on source nodes of each edge. Square and - * rectangular ports are possible port candidates on the target node. Rectangular ports have zero cost of usage and unit - * capacity whereas square rectangles have unit cost and capacity. - *

- *

- * Not all layout and routing algorithms are able to handle {@link yfiles.layout.PortCandidate}s. Major layout algorithms that obey - * them are {@link yfiles.hierarchic.HierarchicLayout}, {@link yfiles.router.EdgeRouter}, {@link yfiles.router.ChannelEdgeRouter} and - * {@link yfiles.router.BusRouter}. - *

- * @class - */ - export interface PortCandidateSet extends yfiles.lang.Object{} - export class PortCandidateSet { - /** - * Creates a new empty {@link yfiles.layout.PortCandidateSet} instance. - *

- * Addition of {@link yfiles.layout.PortCandidate}s to this {@link yfiles.layout.PortCandidateSet set} can be performed using {@link yfiles.layout.PortCandidateSet#add}. - *

- */ - constructor(); - /** - * Adds a {@link yfiles.layout.PortCandidate} with the given capacity to this {@link yfiles.layout.PortCandidateSet}. - *

- * The capacity value defines the maximum number of edges allowed to connect to the candidate. If no limitation for this - * number exists, 0x7FFFFFFF can be used. - *

- *

- * The capacity must be greater than zero. - *

- * @param p the {@link } to add - * @param [connections=1] the capacity of the given port - * @throws {Stubs.Exceptions.ArgumentError} if the given capacity is less than or equal to zero - */ - add(p:yfiles.layout.PortCandidate,connections?:number):void; - /** - * Creates a {@link yfiles.layout.IPortCandidateMatcher} that retrieves {@link yfiles.layout.IPortCandidateSetEntry entries} from this {@link yfiles.layout.PortCandidateSet}. - *

- * Each next best matching candidate is determined based on its cost, its current available capacity and based on whether - * or not its direction is consistent with the desired one. - *

- *

- * This method may be overridden to support custom implementations of {@link yfiles.layout.IPortCandidateMatcher}. - *

- * @returns a new {@link } instance - */ - createMatcher():yfiles.layout.IPortCandidateMatcher; - /** - * Calculates the penalty cost for the usage of the given {@link yfiles.layout.IPortCandidateSetEntry entry} and the given parameters. - *

- * The cost is equal to the {@link yfiles.layout.PortCandidate#cost cost of usage} of the {@link yfiles.layout.IPortCandidateSetEntry#portCandidate associated port candidate}. - *

- *

- * This method may be overridden to customize the calculation of the cost of usage of an {@link yfiles.layout.IPortCandidateSetEntry entry}. - *

- * @param entry the entry for which the cost is computed - * @param edge the edge that will connect to the {@link } associated with the entry - * @param source true if the given edge connects to its source node, false otherwise - * @param xOffset the preferred X-offset of the port relative to the center of the node - * @param yOffset the preferred Y-offset of the port relative to the center of the node - * @returns the penalty cost for the usage of the given {@link } - */ - getCost(entry:yfiles.layout.IPortCandidateSetEntry,edge:yfiles.algorithms.Edge,source:boolean,xOffset:number,yOffset:number):number; - /** - * Calculates the priority of the given {@link yfiles.layout.IPortCandidateSetEntry entry}. - *

- * Higher priority means that the entry will be considered earlier by a {@link yfiles.layout.IPortCandidateMatcher}. - *

- *

- * This method may be overridden to customize the calculation of the priority of {@link yfiles.layout.IPortCandidateSetEntry entries}. - *

- * @param entry the entry for which the cost is computed - * @param edge the edge that will connect to the {@link } associated with the entry - * @param source true if the given edge connects to its source node, false otherwise - * @returns the priority of the given {@link } - */ - getPriority(entry:yfiles.layout.IPortCandidateSetEntry,edge:yfiles.algorithms.Edge,source:boolean):number; - /** - * Removes the given {@link yfiles.layout.IPortCandidateSetEntry entry} from the list of candidate entries. - * @param entry the entry to remove - */ - remove(entry:yfiles.layout.IPortCandidateSetEntry):void; - /** - * Data provider key for specifying a port candidate set for each node - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_PORT_CANDIDATE_SET_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets the total number of connections allowed by the {@link yfiles.layout.PortCandidate}s described by this {@link yfiles.layout.PortCandidateSet} - * or 0x7FFFFFFF if the number is unbounded. - * @type {number} - */ - connectionCount:number; - /** - * Gets an {@link yfiles.collections.IEnumerator.} over the list of candidate {@link yfiles.layout.IPortCandidateSetEntry entries} of this {@link yfiles.layout.PortCandidateSet}. - * @type {yfiles.collections.IEnumerator.} - */ - entries:yfiles.collections.IEnumerator; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PortCandidateSet; - } - /** - * A {@link yfiles.layout.PortConstraint} represents a constraint for the source or target port of an edge path. - *

- * It determines the location at which an edge path can be connected to its source and/or target node. There exist two - * different types of {@link yfiles.layout.PortConstraint}s: - *

- *
    - *
  • Weak {@link yfiles.layout.PortConstraint}s determine the side of the node to which an edge can be connected.
  • - *
  • - * Strong - * {@link yfiles.layout.PortConstraint}s determine the exact coordinates of the point to which an edge path can be connected. These - * coordinates are determined at the time the edge is processed by a layout or routing algorithm and are always interpreted - * relative to a node's center. - *
  • - *
- *

- * {@graph {"ann":{"s":[3,8],"d":1},"styles":{"6":{"f":"#FF0000"},"7":{"f":"#000000"}},"n":[[-570,-40,90,30],[-395,-140,90,30],[-563.02,-184.16,90,30],[-398.2,-140,9,30,6],[-477,-184.16,9,30,6],[-484.4,-40,9,30,6],[-474,-173.16,7],[-395.2,-135.01,7],[-395.2,-122.49,7],[-481.4,-29,7]],"e":[[0,1,45,0,-45,6,[-463.02,-25,-463.02,-119]],[2,1,45,0,-45,-6,[-424.34,-169.16,-424.34,-131]]],"vp":[-570.0,-185.0,265.0,175.0]}} Sample output of weak port constraints. For both edges, source port constraints are associated with side {@link yfiles.layout.PortSide#EAST} - * while target port constraints are associated with side {@link yfiles.layout.PortSide#WEST}. Red rectangles indicate that edges - * can be connected to any point of these sides. Black rectangles represent the selected ports. {@graph {"ann":{"s":[90,30],"d":1},"styles":{"6":{"f":"#FF0000"},"7":{"f":"#000000"}},"n":[[-145,135.67],[30,35.67],[-138.02,-8.49],[-49.82,1.51,4,10,7],[28,45.67,4,10,7],[-57.36,145.67,4,10,7]],"e":[[0,1,[-35,150.67,-35,50.67]],[2,1,[-0.22,6.51,-0.22,50.67]]],"vp":[-145.0,-9.0,265.0,175.0]}} Sample output of strong port - * constraints. For both edges, source port constraints are associated with side {@link yfiles.layout.PortSide#EAST} while target - * port constraints are associated with side - * {@link yfiles.layout.PortSide#WEST}. Black rectangles indicate the exact points on the corresponding sides of the nodes to which - * edges can be connected. - *

- *

- * Information about {@link yfiles.layout.PortConstraint}s is held by {@link yfiles.algorithms.IDataProvider}s that are registered with the - * graph using keys {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} (to specify - * {@link yfiles.layout.PortConstraint}s for an edge on its source node) and {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY} - * (to specify {@link yfiles.layout.PortConstraint}s for an edge on its target node). - *

- *

- * Not all layout and routing algorithms are able to handle {@link yfiles.layout.PortConstraint}s. Major layout algorithms that - * obey them are {@link yfiles.hierarchic.HierarchicLayout}, {@link yfiles.tree.TreeLayout}, {@link yfiles.router.EdgeRouter}, {@link yfiles.router.ChannelEdgeRouter} - * and {@link yfiles.router.BusRouter}. - *

- * @see yfiles.layout.PortConstraintKeys - * @class - */ - export interface PortConstraint extends yfiles.lang.Object{} - export class PortConstraint { - /** - * Creates a new {@link yfiles.layout.PortConstraint} that constrains the edge to connect to the given side of a node and that can - * be either strong or weak. - *

- * If the {@link yfiles.layout.PortConstraint} is strong, the layout or routing algorithm should use the port coordinates of this - * constraint. - *

- * @param side one of the default side specifiers - * @param [strong=false] true if this {@link } is strong, false otherwise - * @returns a new {@link } instance - * @throws {Stubs.Exceptions.ArgumentError} if an unknown side is given - * @static - */ - static create(side:yfiles.layout.PortSide,strong?:boolean):yfiles.layout.PortConstraint; - /** - * Returns the source {@link yfiles.layout.PortConstraint} associated with the given edge. - *

- * To retrieve the {@link yfiles.algorithms.IDataProvider} that holds information about source {@link yfiles.layout.PortConstraint}s, key {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} - * is used. - *

- * @param graph the input graph - * @param e the edge - * @returns the source {@link } of the given edge or null if there is none - * @static - */ - static getSPC(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):yfiles.layout.PortConstraint; - /** - * Returns the target {@link yfiles.layout.PortConstraint} associated with the given edge. - *

- * To retrieve the {@link yfiles.algorithms.IDataProvider} that holds information about target {@link yfiles.layout.PortConstraint}s, key {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY} - * is used. - *

- * @param graph the input graph - * @param e the edge - * @returns the target {@link } of the given edge or null if there is none - * @static - */ - static getTPC(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):yfiles.layout.PortConstraint; - /** - * Checks whether or not there exist source or target {@link yfiles.layout.PortConstraint}s associated with the given edge. - *

- * To retrieve the {@link yfiles.algorithms.IDataProvider}s that hold information about source or target - * {@link yfiles.layout.PortConstraint}s, keys {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} and {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY} - * are used. - *

- * @param graph the input graph - * @param e the edge - * @returns true if the edge has source or target {@link }s, false otherwise - * @static - */ - static hasPC(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):boolean; - /** - * Checks whether or not there exist source {@link yfiles.layout.PortConstraint}s associated with the given edge. - *

- * To retrieve the {@link yfiles.algorithms.IDataProvider} that holds information about source {@link yfiles.layout.PortConstraint}s, key {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} - * is used. - *

- * @param graph the input graph - * @param e the edge - * @returns true if the edge has source {@link }s, false otherwise - * @static - */ - static hasSPC(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):boolean; - /** - * Checks whether or not there exist target {@link yfiles.layout.PortConstraint}s associated with the given edge. - *

- * To retrieve the {@link yfiles.algorithms.IDataProvider} that holds information about target {@link yfiles.layout.PortConstraint}s, key {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY} - * is used. - *

- * @param graph the input graph - * @param e the edge - * @returns true if the edge has target {@link }s, false otherwise - * @static - */ - static hasTPC(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):boolean; - /** - * Gets whether or not this {@link yfiles.layout.PortConstraint} instance represents a strong constraint. - *

- * A strong {@link yfiles.layout.PortConstraint} determines the exact coordinates where the edge path's end should be located. - *

- * @type {boolean} - */ - strong:boolean; - /** - * Gets the side of the node to which an edge should connect. - * @type {yfiles.layout.PortSide} - */ - side:yfiles.layout.PortSide; - /** - * Gets whether or not this {@link yfiles.layout.PortConstraint} instance is associated with side {@link yfiles.layout.PortSide#NORTH}. - * @type {boolean} - */ - atNorth:boolean; - /** - * Gets whether or not this {@link yfiles.layout.PortConstraint} instance is associated with side {@link yfiles.layout.PortSide#SOUTH}. - * @type {boolean} - */ - atSouth:boolean; - /** - * Gets whether or not this {@link yfiles.layout.PortConstraint} instance is associated with side {@link yfiles.layout.PortSide#EAST}. - * @type {boolean} - */ - atEast:boolean; - /** - * Gets whether or not this {@link yfiles.layout.PortConstraint} instance is associated with side {@link yfiles.layout.PortSide#WEST}. - * @type {boolean} - */ - atWest:boolean; - /** - * Gets whether or not this {@link yfiles.layout.PortConstraint} instance is associated with side {@link yfiles.layout.PortSide#ANY}. - * @type {boolean} - */ - atAnySide:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PortConstraint; - } - /** - * The {@link yfiles.layout.PortConstraintConfigurator} provides the possibility to create - * {@link yfiles.layout.PortConstraint}s according to the initial connecting side of an edge. - * @class - */ - export interface PortConstraintConfigurator extends yfiles.lang.Object{} - export class PortConstraintConfigurator { - /** - * Creates a new {@link yfiles.layout.PortConstraintConfigurator} instance. - */ - constructor(); - /** - * Creates a {@link yfiles.layout.PortConstraint} for the given edge. - *

- * The side of the constraint is set up according to the current drawing of the edge within the given graph. - *

- * @param graph the input graph - * @param edge the edge - * @param source true if a source {@link } for the given edge will be created, false for a target - * {@link } - * @param strong true if a strong {@link } is created, false for a weak {@link } - * @returns the {@link } for the given edge whose side is retrieved from the initial drawing - */ - createPortConstraintFromSketch(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge,source:boolean,strong:boolean):yfiles.layout.PortConstraint; - /** - * Creates {@link yfiles.layout.PortConstraint}s for some edges of the given graph. - * @param graph the input graph - * @param ec the {@link } that provides access to the edges for which to create {@link }s - * @param spcMap the {@link } that will be used for storing the source {@link }s of the edges - * @param strongSP true if strong source {@link }s should be assigned, false otherwise - * @param tpcMap the {@link } that will be used for storing the target {@link }s of the edges - * @param strongTP true if strong target {@link }s should be assigned, false otherwise - */ - createPortConstraintsFromSketch(graph:yfiles.layout.LayoutGraph,ec:yfiles.algorithms.IEdgeCursor,spcMap:yfiles.algorithms.IEdgeMap,strongSP:boolean,tpcMap:yfiles.algorithms.IEdgeMap,strongTP:boolean):void; - /** - * Creates weak {@link yfiles.layout.PortConstraint}s for all edges of the given graph. - * @param graph the input graph - * @param spcMap the {@link } that will be used for storing the source {@link }s of the edges - * @param tpcMap the {@link } that will be used for storing the target {@link }s of the edges - */ - createPortConstraintsFromSketch(graph:yfiles.layout.LayoutGraph,spcMap:yfiles.algorithms.IEdgeMap,tpcMap:yfiles.algorithms.IEdgeMap):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PortConstraintConfigurator; - } - /** - * {@link yfiles.layout.PortConstraintKeys} are used for associating {@link yfiles.algorithms.IDataProvider DataProviders} that contain constraints for the edges of the - * input graph. - *

- * These constraints can either be {@link yfiles.layout.PortConstraint}s or edge groups. - * {@link yfiles.layout.PortConstraint}s force the edges to start/end on specified sides of the node. They may also restrict ports - * of edges to certain coordinates. Edge groups will bundle edges at a common source or target. They will start at the same - * coordinates and may share parts of their edge routes. - *

- *

- * Layout algorithms that support {@link yfiles.layout.PortConstraint}s or edge groups will access the - * {@link yfiles.algorithms.IDataProvider}s using the provided keys. - *

- * @class - * @static - */ - export interface PortConstraintKeys extends yfiles.lang.Object{} - export class PortConstraintKeys { - /** - * Data provider key for providing source constraints for edges in the input graph - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static SOURCE_PORT_CONSTRAINT_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for providing target constraints for edges in the input graph - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static TARGET_PORT_CONSTRAINT_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for assigning source group information for edges of the input graph - *

- * Edges sharing a source group identifier will share a common bus near the source or at a common source node if possible. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static SOURCE_GROUP_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for assigning target group information for edges of the input graph - *

- * Edges sharing a target group identifier will share a common bus near the target or at a common target node if possible. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static TARGET_GROUP_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for assigning port group ids to the edges' source - *

- * All edges with the same port id at a node will share the same port location. However, they will be routed - * independently. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static SOURCE_PORT_GROUP_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for assigning port group ids to the edges' target - *

- * All edges with the same port id at a node will share the same port location. However, they will be routed - * independently. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static TARGET_PORT_GROUP_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PortConstraintKeys; - } - /** - * A {@link yfiles.layout.PreferredPlacementDescriptor} provides placement information for automatic edge labeling. - *

- * It provides several options that influence the label placement in generic labeling algorithms and layout algorithms that - * support integrated label placement. - *

- *

- * The preferred placement can describe multiple locations. For some options, like the {@link yfiles.layout.PreferredPlacementDescriptor#placeAlongEdge placement along the edge}, it is - * possible to have a combination of the valid values. These values can be connected with a logical or-operation. - *

- *

- * The following options describe the preferred placement: - *

- *
    - *
  • the placement along the edge
  • - *
  • the side of the edge
  • - *
  • the reference of the side
  • - *
  • the rotation angle of the label
  • - *
  • the reference for the rotation angle
  • - *
  • the rotation behavior for label on the right side of the edge
  • - *
  • the angle offset for label on the right side of the edge
  • - *
  • the distance between the label and its edge segment
  • - *
- *

- * The {@link yfiles.layout.PreferredPlacementDescriptor} will be immutable after {@link yfiles.layout.PreferredPlacementDescriptor#freeze} - * is called. - *

- *

- * A {@link yfiles.layout.PreferredPlacementDescriptor} must be set for each label and will be retrieved by the layout algorithms - * calling {@link yfiles.layout.IEdgeLabelLayout#preferredPlacementDescriptor}. - *

- * @class - */ - export interface PreferredPlacementDescriptor extends yfiles.lang.Object{} - export class PreferredPlacementDescriptor { - /** - * Creates a new {@link yfiles.layout.PreferredPlacementDescriptor} instance that copies the given descriptor. - * @param descriptor the {@link } that is copied - */ - constructor(descriptor:yfiles.layout.PreferredPlacementDescriptor); - /** - * Creates a new {@link yfiles.layout.PreferredPlacementDescriptor} instance with default settings. - */ - constructor(); - /** - * Clones this instance by returning a {@link any#memberwiseClone} or this in case this instance is already {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen frozen}. - * @returns An instance of the same type as this instance. - */ - clone():any; - /** - * Makes this {@link yfiles.layout.PreferredPlacementDescriptor} instance immutable. - *

- * If this instance is immutable, all setter methods will throw an {@link yfiles.lang.Exception} when invoked. - *

- * @see yfiles.layout.PreferredPlacementDescriptor#isFrozen - */ - freeze():void; - /** - * Returns whether or not this is an immutable instance of {@link yfiles.layout.PreferredPlacementDescriptor}. - *

- * If this instance is immutable, all setter methods will throw an {@link yfiles.lang.Exception} when invoked. - *

- * @returns true if this instance is immutable, false otherwise - * @see yfiles.layout.PreferredPlacementDescriptor#freeze - */ - isFrozen():boolean; - /** - * Returns an immutable descriptor instance for the specified placement. - *

- * Descriptor instances returned by this method will use default values for all properties but {@link yfiles.layout.PreferredPlacementDescriptor#placeAlongEdge placement along edge} and - * {@link yfiles.layout.PreferredPlacementDescriptor#sideOfEdge side of edge}. - *

- * @param placement a combination of valid placements along the edge and valid sides of the edge - * @returns an immutable descriptor instance for the specified placement - * @see yfiles.layout.PreferredPlacementDescriptor#isFrozen - * @see yfiles.layout.PreferredPlacementDescriptor#placeAlongEdge - * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge - * @static - */ - static newSharedInstance(placement:yfiles.layout.LabelPlacements):yfiles.layout.PreferredPlacementDescriptor; - /** - * Gets or sets the preferred placement along the edge. - * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} - * @type {yfiles.layout.LabelPlacements} - */ - placeAlongEdge:yfiles.layout.LabelPlacements; - /** - * Gets or sets the preferred side of the edge. - * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} - * @type {yfiles.layout.LabelPlacements} - */ - sideOfEdge:yfiles.layout.LabelPlacements; - /** - * Gets or sets how to interpret the preferred side as given by {@link yfiles.layout.PreferredPlacementDescriptor#sideOfEdge}. - * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} - * @throws {Stubs.Exceptions.ArgumentError} if the specified side reference is invalid - * @type {yfiles.layout.LabelSideReferences} - */ - sideReference:yfiles.layout.LabelSideReferences; - /** - * Gets or sets the angle (in radians) for the label rotation. - *

- * How this angle is applied depends on the {@link yfiles.layout.PreferredPlacementDescriptor#angleReference angle reference}, the {@link yfiles.layout.PreferredPlacementDescriptor#angleRotationOnRightSide rotation} and the {@link yfiles.layout.PreferredPlacementDescriptor#angleOffsetOnRightSide offset} for labels on the right side of - * the edge. - *

- * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} - * @see yfiles.layout.PreferredPlacementDescriptor#angleReference - * @see yfiles.layout.PreferredPlacementDescriptor#angleRotationOnRightSide - * @see yfiles.layout.PreferredPlacementDescriptor#angleOffsetOnRightSide - * @type {number} - */ - angle:number; - /** - * Gets or sets the reference of the angle given by {@link yfiles.layout.PreferredPlacementDescriptor#angle}. - * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} - * @throws {Stubs.Exceptions.ArgumentError} if the specified value is not a valid angle reference - * @type {yfiles.layout.LabelAngleReferences} - */ - angleReference:yfiles.layout.LabelAngleReferences; - /** - * Gets or sets how the angle is applied to labels on the right side in respect of the labels of the left side of the - * edge. - * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} - * @throws {Stubs.Exceptions.ArgumentError} if the specified value is not a valid angle rotation - * @type {yfiles.layout.LabelAngleOnRightSideRotations} - */ - angleRotationOnRightSide:yfiles.layout.LabelAngleOnRightSideRotations; - /** - * Gets or sets the angle offset for labels that are placed on the right side of the edge. - * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} - * @throws {Stubs.Exceptions.ArgumentError} if the specified value is not valid angle offset - * @type {yfiles.layout.LabelAngleOnRightSideOffsets} - */ - angleOffsetOnRightSide:yfiles.layout.LabelAngleOnRightSideOffsets; - /** - * Gets or sets the preferred distance between a label and the corresponding edge segment. - *

- * If the given distance is < 0, the distance is not fixed, i.e., it is chosen by the automatic labeling algorithm. - *

- * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} - * @throws {Stubs.Exceptions.ArgumentError} if the specified value is infinite or NaN - * @type {number} - */ - distanceToEdge:number; - /** - * Gets whether or not one of the preferred placement locations for this label is at source. - * @see yfiles.layout.LabelPlacements#AT_SOURCE - * @type {boolean} - */ - isAtSource:boolean; - /** - * Gets whether or not one of the preferred placement locations for this label is at center. - * @see yfiles.layout.LabelPlacements#AT_CENTER - * @type {boolean} - */ - isAtCenter:boolean; - /** - * Gets whether or not one of the preferred placements for this label is at target. - * @see yfiles.layout.LabelPlacements#AT_TARGET - * @type {boolean} - */ - isAtTarget:boolean; - /** - * Gets whether or not one of the preferred placements for this label is at the source port. - * @see yfiles.layout.LabelPlacements#AT_SOURCE_PORT - * @type {boolean} - */ - isAtSourcePort:boolean; - /** - * Gets whether or not one of the preferred placements for this label is at the target port. - * @see yfiles.layout.LabelPlacements#AT_TARGET_PORT - * @type {boolean} - */ - isAtTargetPort:boolean; - /** - * Gets whether or not one of the preferred sides for this label is left of the edge. - * @see yfiles.layout.LabelPlacements#LEFT_OF_EDGE - * @type {boolean} - */ - isLeftOfEdge:boolean; - /** - * Gets whether or not one of the preferred sides for this label is on the edge. - * @see yfiles.layout.LabelPlacements#ON_EDGE - * @type {boolean} - */ - isOnEdge:boolean; - /** - * Gets whether or not one of the preferred sides for this label is right of the edge. - * @see yfiles.layout.LabelPlacements#RIGHT_OF_EDGE - * @type {boolean} - */ - isRightOfEdge:boolean; - /** - * Gets whether or not one of the angle interpretations is absolute. - * @see yfiles.layout.LabelAngleReferences#ABSOLUTE - * @type {boolean} - */ - isAngleAbsolute:boolean; - /** - * Gets whether or not one of the angle interpretation is relative to the edge slope. - * @see yfiles.layout.LabelAngleReferences#RELATIVE_TO_EDGE_FLOW - * @type {boolean} - */ - isAngleRelativeToEdgeFlow:boolean; - /** - * Gets whether or not one of the angle interpretations is to rotate the angle of labels that are right of the edge - * co-rotating with the labels left of or centered on the edge, i.e., the angle of all labels is interpreted clockwise. - * @see yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge - * @see yfiles.layout.LabelAngleOnRightSideRotations#CLOCKWISE - * @type {boolean} - */ - isAngleOnRightSideCoRotating:boolean; - /** - * Gets whether or not one of the angle interpretations is to rotate the angle of labels that are right of the edge - * counter-rotating with the labels left of or centered on the edge, i.e., the angle of labels left or centered on edge is - * interpreted clockwise while the angle of labels right of edge is interpreted counter-clockwise. - * @see yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge - * @see yfiles.layout.LabelAngleOnRightSideRotations#COUNTER_CLOCKWISE - * @type {boolean} - */ - isAngleOnRightSideCounterRotating:boolean; - /** - * Gets whether or not one of the angle interpretations is to add no angle offset to labels that are right of the edge. - * @see yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge - * @see yfiles.layout.LabelAngleOnRightSideOffsets#NONE - * @type {boolean} - */ - isAngleOffsetOnRightSideZero:boolean; - /** - * Gets whether or not one of the angle interpretations is to add an angle offset of 180 degrees to labels that are right - * of the edge. - * @see yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge - * @see yfiles.layout.LabelAngleOnRightSideOffsets#SEMI - * @type {boolean} - */ - isAngleOffsetOnRightSide180:boolean; - /** - * Gets whether or not the preferred side specified by {@link yfiles.layout.PreferredPlacementDescriptor#sideOfEdge} is interpreted relative to the edge flow. - * @see yfiles.layout.LabelSideReferences#RELATIVE_TO_EDGE_FLOW - * @type {boolean} - */ - isSideRelativeToEdgeFlow:boolean; - /** - * Gets whether or not the preferred side specified by {@link yfiles.layout.PreferredPlacementDescriptor#sideOfEdge} is interpreted absolute, and on horizontal segments, labels with - * preferred side {@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE} are placed above the segment. - * @see yfiles.layout.LabelSideReferences#ABSOLUTE_WITH_LEFT_IN_NORTH - * @type {boolean} - */ - isSideAbsoluteWithLeftInNorth:boolean; - /** - * Gets whether or not the preferred side specified by {@link yfiles.layout.PreferredPlacementDescriptor#sideOfEdge} is interpreted absolute, and on horizontal segments, labels with - * preferred side {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE} are placed above the segment. - * @see yfiles.layout.LabelSideReferences#ABSOLUTE_WITH_RIGHT_IN_NORTH - * @type {boolean} - */ - isSideAbsoluteWithRightInNorth:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PreferredPlacementDescriptor; - } - /** - * The {@link yfiles.layout.RemoveCollinearBendsStage} removes all collinear bends found in a graph. - *

- * The algorithm traverses each edge path from source to target and removes for each triple of consecutive collinear bends - * the middle one. - *

- *

- * A collinear bend forms a straight line with its preceding bend and its subsequent bend. The angle between the connecting - * edge segments is either 0 or 180 degrees. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface RemoveCollinearBendsStage extends yfiles.layout.LayoutStageBase{} - export class RemoveCollinearBendsStage { - /** - * Creates a new {@link yfiles.layout.RemoveCollinearBendsStage} instance with default settings. - */ - constructor(); - /** - * Gets or sets the scale that defines how accurate the algorithm is when it comes to comparing the coordinates of two - * bends. - *

- * This value determines how the values of the coordinates are rounded. If rounded coordinates lead to a collinear bend, - * this bend will be removed. - *

- *

- * The scaling factor needs to be positive. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified factor is less than or equal to 0 - * @type {number} - */ - scale:number; - /** - * Gets or sets whether the algorithm removes only collinear bends which lie in the middle of their neighbors or all - * collinear bends. - *

- * In the first case, the angle at the middle bend must be 180 degrees, while in the second case, the angle can be either 180 - * degrees or 0 degrees. - *

- * @type {boolean} - */ - removeStraightOnly:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.RemoveCollinearBendsStage; - } - /** - * {@link yfiles.layout.ReverseEdgesStage} selectively reverses edges in a graph, while keeping the layout and label positions of - * the reversed edges as close to the pre-reversal layout and positions as possible. - * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface ReverseEdgesStage extends yfiles.layout.LayoutStageBase{} - export class ReverseEdgesStage { - /** - * Creates a new {@link yfiles.layout.ReverseEdgesStage} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algorithm. - * @see yfiles.layout.LayoutStageBase#coreLayout - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Marks edges in a tree-structured graph component that need to be reversed to make the specified node the root of the - * tree component. - *

- * Only edges in the graph component to which the specified node belongs will be marked. - *

- * @param graph the graph to which the specified node belongs - * @param root the node to be considered the root of its tree component - * @param reversedEdges a {@link } to mark edges for reversal - * @throws {Stubs.Exceptions.ArgumentError} if the specified root node is null or does not belong to the specified graph - * @see yfiles.layout.ReverseEdgesStage#AFFECTED_EDGES_DP_KEY - * @static - */ - static findReversedTreeEdges(graph:yfiles.layout.LayoutGraph,root:yfiles.algorithms.Node,reversedEdges:yfiles.algorithms.IDataAcceptor):void; - /** - * Reverses the specified edge in the specified graph. - *

- * The layout of the specified edge is reversed as specified in - * {@link yfiles.layout.LayoutGraphUtilities#reverseEdgeLayout}. Moreover, the positions of all labels associated with the - * specified edge are adjusted to match the pre-reversal position as closely as possible. (Depending on a label's model it - * might not always be possible to achieve an exact match.) - *

- * @param graph the graph to which the specified edge belongs - * @param edge the edge to be reversed - * @see yfiles.layout.LayoutGraphUtilities#reverseEdgeLayout - */ - reverseEdge(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; - /** - * Reverses selected edges in the specified graph. - *

- * Selected edges are marked in a {@link yfiles.algorithms.IDataProvider} registered with - * {@link yfiles.layout.ReverseEdgesStage#AFFECTED_EDGES_DP_KEY}. - *

- *

- * Implementation detail: This method calls {@link yfiles.layout.ReverseEdgesStage#reverseEdge} in order to reverse a selected edge. - *

- * @param graph the graph in which to reverse edges. - * @see yfiles.layout.ReverseEdgesStage#AFFECTED_EDGES_DP_KEY - * @see yfiles.layout.ReverseEdgesStage#reverseEdge - */ - reverseEdges(graph:yfiles.layout.LayoutGraph):void; - /** - * Data provider key for selecting edges for reversal - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ReverseEdgesStage; - } - /** - * A {@link yfiles.layout.SelfLoopRouter} routes the self-loops (reflexive edges) of a graph. - *

- * Layout Style The nodes and normal edges are arranged by the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. This layout algorithm only handles the paths of self-loops. - *

- *

- * Self-loops are routed either {@link yfiles.layout.SelfLoopStyle#ORTHOGONAL orthogonal} or with {@link yfiles.layout.SelfLoopStyle#ROUNDED rounded} corners. The layout algorithm places the self-loops in the least - * crowded quadrant around a node. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[100,100],[100,0],[0,100],[0,0]],"e":[[0,0,7.5,15,15,7.5,[122.5,145,145,145,145,122.5]],[0,1,5,-15,5,15],[1,1,10,-15,15,-10,[125,-15,145,-15,145,5]],[1,1,5,-15,15,-5,[120,-20,150,-20,150,10]],[1,0,-5,15,-5,-15],[0,2,-15,5,15,5],[2,2,-10,15,-15,10,[5,145,-15,145,-15,125]],[2,2,-5,15,-15,5,[10,150,-20,150,-20,120]],[2,0,15,-5,-15,-5],[1,3,-15,5,15,5],[2,3,5,-15,5,15],[3,3,-7.5,-15,-15,-7.5,[7.5,-15,-15,-15,-15,7.5]],[3,1,15,-5,-15,-5],[3,2,-5,15,-5,-15]],"vp":[-20.0,-20.0,170.0,170.0]}} - *

- *

- * Small graph with self-loops - *

- *

- * Concept Self-loops are handled in four steps: - *

- *
    - *
  1. Remove all self-loops of the input graph
  2. - *
  3. Invoke the core layout algorithm on the now self-loops free graph
  4. - *
  5. Reinsert all formerly removed self-loops
  6. - *
  7. Route the self-loops of the input graph
  8. - *
- *

- * Features - *

- *

- * {@link yfiles.layout.SelfLoopRouter} can either be used as a {@link yfiles.layout.ILayoutStage} wrapping a {@link yfiles.layout.ILayoutAlgorithm layout algorithm} which cannot - * handle self-loops. Then it will hide the self-loops from this {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} and take over the routing of them. - *
- * If no {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} is specified, {@link yfiles.layout.SelfLoopRouter} can work alone. It will route only the self-loops - * and keep the remaining graph unchanged. - *

- *

- * When all self-loops already have a suitable layout, this layout algorithm can {@link yfiles.layout.SelfLoopRouter#keepAllSelfLoopRoutes keep the self-loop paths}. It will just - * hide the self-loops before invoking the core layout algorithm, such that they are not altered by it. - *
- * To only exclude some self-loops from routing, a {@link yfiles.algorithms.IDataProvider} registered with {@link yfiles.layout.SelfLoopRouter#KEEP_SELF_LOOP_LAYOUT_DP_KEY} - * can be used for marking those self-loops. - *

- * @see yfiles.layout.MultiStageLayout - * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface SelfLoopRouter extends yfiles.layout.LayoutStageBase{} - export class SelfLoopRouter { - /** - * Creates a new {@link yfiles.layout.SelfLoopRouter} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algorithm. - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Calculates the routes of the self-loops in the given graph. - *

- * This method will only change the routes of self-loops that are not marked to be {@link yfiles.layout.SelfLoopRouter#KEEP_SELF_LOOP_LAYOUT_DP_KEY kept}. - *

- *

- * This method is called by {@link yfiles.layout.SelfLoopRouter#applyLayout} after the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} has arranged the graph - * and all self-loops have been reinserted into the graph. It may be overridden to introduce custom self-loop styles. - *

- * @param graph the input graph - * @protected - */ - layoutSelfLoops(graph:yfiles.layout.LayoutGraph):void; - /** - * Data provider key for determining which self-loops should keep their current path - *

- * If no {@link yfiles.algorithms.IDataProvider} is registered with this key, all self-loops will be routed. - *

- * @see yfiles.layout.SelfLoopRouter#keepAllSelfLoopRoutes - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static KEEP_SELF_LOOP_LAYOUT_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets the number of points that are used for rounding the corners of the self-loops. - *

- * For rounded corners, the number of points should be at least - * 2. All smaller values will produce one bend and, therefore, an orthogonal path. - *

- *

- * The number of points for a corner must be at least 1. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified point count is less than 1 - * @see yfiles.layout.SelfLoopRouter#layoutStyle - * @see yfiles.layout.SelfLoopStyle#ROUNDED - * @type {number} - */ - cornerApproximationPointsCount:number; - /** - * Gets or sets the distance between two self-loops incident to the same node. - *

- * The distance needs to be a non-negative value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @see yfiles.layout.SelfLoopStyle#ROUNDED - * @type {number} - */ - lineDistance:number; - /** - * Gets or sets whether or not the algorithm chooses the side of the self-loop depending on the incident edges. - *

- * If this option is enabled, self-loops are placed on one of the four corners of the corresponding node. For the choice of - * the corner, the algorithm considers all incident edges. Otherwise, self-loops are always placed at the upper left corner - * of the corresponding node. - *

- * @type {boolean} - */ - smartSelfLoopPlacement:boolean; - /** - * Gets or sets the layout style of the self-loops. - * @throws {Stubs.Exceptions.ArgumentError} if the specified style is unknown - * @type {yfiles.layout.SelfLoopStyle} - */ - layoutStyle:yfiles.layout.SelfLoopStyle; - /** - * Gets or sets whether or not this algorithm should keep all self-loop routes. - *

- * When enabled, no self-loop will be routed, instead the existing self-loop layout will be moved with its node. - *

- * @type {boolean} - */ - keepAllSelfLoopRoutes:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.SelfLoopRouter; - } - /** - * A {@link yfiles.layout.SequentialLayout} allows for chaining multiple {@link yfiles.layout.ILayoutAlgorithm layout algorithms}. - *

- * The {@link yfiles.layout.ILayoutAlgorithm layout algorithms} are invoked one after the other in the order in which they were - * {@link yfiles.layout.SequentialLayout#appendLayout added to the chain}. They all run independently of each other, i.e., they only influence each other by the changed input - * graph. Hence, the sequence determines the result. - *

- *

- * One possible application would be to bundle several {@link yfiles.layout.ILayoutAlgorithm layout algorithms} and pass a single {@link yfiles.layout.ILayoutAlgorithm} - * instance to a {@link yfiles.layout.BufferedLayout}. - *

- * @class - * @implements {yfiles.layout.ILayoutAlgorithm} - */ - export interface SequentialLayout extends yfiles.lang.Object,yfiles.layout.ILayoutAlgorithm{} - export class SequentialLayout { - /** - * Creates a new {@link yfiles.layout.SequentialLayout} instance with an empty chain of {@link yfiles.layout.ILayoutAlgorithm layout algorithms}. - */ - constructor(); - /** - * Appends the given {@link yfiles.layout.ILayoutAlgorithm layout algorithm} to the end of the chain. - * @param layouter the {@link layout algorithm} to append - */ - appendLayout(layouter:yfiles.layout.ILayoutAlgorithm):void; - /** - * Appends the specified list of {@link yfiles.layout.ILayoutAlgorithm layout algorithms} to the end of the chain. - * @param layouters the list of {@link layout algorithms} to append - */ - appendLayouts(layouters:yfiles.collections.ICollection):void; - /** - * Executes all {@link yfiles.layout.ILayoutAlgorithm layout algorithms} in the chain, one after the other. - *

- * The order of the layout algorithms is defined by the order in which they were appended. - *

- * @param graph the input graph - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Clears the current chain of {@link yfiles.layout.ILayoutAlgorithm layout algorithms} and therefore removes all layout algorithms. - */ - removeAll():void; - /** - * Gets or sets the chain of {@link yfiles.layout.ILayoutAlgorithm layout algorithms}. - * @see yfiles.layout.SequentialLayout#appendLayout - * @see yfiles.layout.SequentialLayout#appendLayouts - * @type {yfiles.collections.IList.} - */ - layouts:yfiles.collections.IList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.SequentialLayout; - } - /** - * {@link yfiles.layout.SimpleProfitModel} implements the ranking for edge and node labels. - *

- * In this implementation node label positions have no ranking, the profit for all candidates is 1. - *

- *

- * The ranking of edge label positions depends on the locations described in the {@link yfiles.layout.PreferredPlacementDescriptor} - * associated with an edge. - *

- * @class - * @implements {yfiles.layout.IProfitModel} - */ - export interface SimpleProfitModel extends yfiles.lang.Object,yfiles.layout.IProfitModel{} - export class SimpleProfitModel { - /** - * Creates a new instance of {@link yfiles.layout.SimpleProfitModel}. - */ - constructor(); - /** - * - * @param candidate - * @returns - */ - getProfit(candidate:yfiles.layout.LabelCandidate):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.SimpleProfitModel; - } - /** - * {@link yfiles.layout.SliderEdgeLabelLayoutModel} allows placement of labels at a set of continuous rotated positions along both - * sides of an edge or directly on the edge path. - *

- * It is possible to specify distance values that control the distance between label and edge and between label and nodes. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1,"lblB":1},"n":[[14,10],[14,310],[184,10],[184,310],[354,10],[354,310]],"e":[[0,1,[],[[10.59,58.22,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,281.41,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,253.51,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,225.61,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,197.72,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,169.82,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,141.92,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,114.02,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,86.12,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"]]],[2,3,[],[[157.19,58.22,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,281.41,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,253.51,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,281.41,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,253.51,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,225.61,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,197.72,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,169.82,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,114.02,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,86.12,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,141.92,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,58.22,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,225.61,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,197.72,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,169.82,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,114.02,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,141.92,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,86.12,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"]]],[4,5,[],[[327.19,58.22,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,281.41,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,253.51,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,225.61,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,197.72,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,141.92,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,169.82,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,114.02,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,86.12,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"]]]],"vp":[10.0,10.0,374.0,330.0]}} - *

- *

- * {@link yfiles.layout.SliderMode#CENTER} mode on the left, {@link yfiles.layout.SliderMode#SIDE} mode in the middle and {@link yfiles.layout.SliderMode#SINGLE_SIDE} - * on the right - *

- * @class - * @implements {yfiles.layout.IEdgeLabelLayoutModel} - */ - export interface SliderEdgeLabelLayoutModel extends yfiles.lang.Object,yfiles.layout.IEdgeLabelLayoutModel{} - export class SliderEdgeLabelLayoutModel { - /** - * Creates a new instance of {@link yfiles.layout.SliderEdgeLabelLayoutModel} with the given mode. - * @param mode the slider mode - * @see yfiles.layout.SliderEdgeLabelLayoutModel#mode - */ - constructor(mode:yfiles.layout.SliderMode); - /** - * - * @param labelBounds - * @param edgeLayout - * @param sourceNode - * @param targetNode - * @returns - */ - createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout):any; - /** - * Returns all {@link yfiles.layout.EdgeLabelCandidate}s that describe valid label positions within this model. - *

- * The number of candidates and their respective locations are computed depending on the geometries of both label and - * edge. - *

- * @param labelLayout the label for which candidates should be generated - * @param edgeLayout the layout of the edge to which the label belongs - * @param sourceLayout the layout of the source node of the label-owning edge - * @param targetLayout the layout of the target node of the label-owning edge - * @returns a list of {@link } instances - */ - getLabelCandidates(labelLayout:yfiles.layout.IEdgeLabelLayout,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; - /** - * - * @param labelSize - * @param edgeLayout - * @param sourceNode - * @param targetNode - * @param para - * @returns - */ - getLabelPlacement(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout,para:any):yfiles.algorithms.YOrientedRectangle; - /** - * Gets the model's slider mode which determines whether the label slides {@link yfiles.layout.SliderMode#CENTER on the edge}, {@link yfiles.layout.SliderMode#SIDE along both sides of the edge} or - * {@link yfiles.layout.SliderMode#SINGLE_SIDE along one side of the edge}. - * @type {yfiles.layout.SliderMode} - */ - mode:yfiles.layout.SliderMode; - /** - * Gets or sets whether or not the distance to the edge is interpreted relative to the edge's path. - *

- * If enabled, the label is placed to the left of the edge segment (relative to the segment direction) if the given - * distance is less than 0 and to the right of the edge segment if the given distance is greater than 0. - *

- *

- * If disabled, the label is placed below the edge segment (in geometric sense) if the distance is less than 0 and above - * the edge segment if the distance is greater than 0. - *

- * @see yfiles.layout.SliderEdgeLabelLayoutModel#distance - * @type {boolean} - */ - distanceRelativeToEdge:boolean; - /** - * Gets or sets the distance between the label's box and the edge's path. - * @see yfiles.layout.SliderEdgeLabelLayoutModel#distanceRelativeToEdge - * @type {number} - */ - distance:number; - /** - * Gets or sets whether or not edge labels are automatically rotated according to the angle of the corresponding reference - * edge segment. - * @type {boolean} - */ - autoRotationEnabled:boolean; - /** - * Gets or sets whether or not edge labels get flipped if they would be upside down in their current position. - * @type {boolean} - */ - autoFlipping:boolean; - /** - * Gets or sets the angle (measured in radians) of the label model. - *

- * The angle is applied in clockwise direction. - *

- * @type {number} - */ - angle:number; - /** - * Gets a model parameter that encodes the default position of this model's allowed edge label positions. - *

- * This parameter can be passed to {@link yfiles.layout.SliderEdgeLabelLayoutModel#getLabelPlacement} to retrieve the corresponding - * label box. - *

- *

- * The default positions for the {@link yfiles.layout.SliderEdgeLabelLayoutModel#mode slider modes} are relative to the first edge segment, either at the beginning of the - * segment ({@link yfiles.layout.SliderMode#SIDE} or - * {@link yfiles.layout.SliderMode#SINGLE_SIDE}) or at its middle ({@link yfiles.layout.SliderMode#CENTER}). - *

- * @see yfiles.layout.SliderEdgeLabelLayoutModel#mode - * @type {any} - */ - defaultParameter:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.SliderEdgeLabelLayoutModel; - } - /** - * A {@link yfiles.layout.SubgraphLayout} is a {@link yfiles.layout.ILayoutStage} that filters out all graph elements that are not part of - * a specific subgraph. - *

- * The nodes that induce this subgraph are marked using a {@link yfiles.algorithms.IDataProvider} registered with a {@link yfiles.layout.SubgraphLayout#affectedNodesDpKey specific key}. - * They will be arranged by the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface SubgraphLayout extends yfiles.layout.LayoutStageBase{} - export class SubgraphLayout { - /** - * Creates a new {@link yfiles.layout.SubgraphLayout} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algorithm. - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} which marks the nodes that induce the subgraph to be - * arranged. - * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @type {any} - */ - affectedNodesDpKey:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.SubgraphLayout; - } - /** - * A {@link yfiles.layout.SwimlaneRepresentative SwimlaneRepresentative} represents the position and arrangement mode for a swimlane. - * @class - */ - export interface SwimlaneRepresentative extends yfiles.lang.Object{} - export class SwimlaneRepresentative { - /** - * Creates a new {@link yfiles.layout.SwimlaneRepresentative} instance. - * @param swimlanePos denotes the current position of the represented swimlane - * @param allowRearrangement true if the represented swimlane may be {@link #allowRearrangement rearranged}, false otherwise - */ - constructor(swimlanePos:number,allowRearrangement:boolean); - /** - * Gets or sets the current position of the represented swimlane. - *

- * The swimlane positions are described by a zero-based index and must not be negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the position is smaller than 0 - * @type {number} - */ - swimlanePos:number; - /** - * Gets or sets whether or not the represented swimlane can be rearranged. - *

- * For all swimlanes with disabled rearrangement, the relative ordering given by {@link yfiles.layout.SwimlaneRepresentative#swimlanePos} is preserved. The other swimlanes may be - * rearranged. - *

- * @type {boolean} - */ - allowRearrangement:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.SwimlaneRepresentative; - } - /** - * {@link yfiles.layout.Swimlanes} provides helper classes and methods to handle swimlanes. - *

- * It is used by {@link yfiles.hierarchic.HierarchicLayout} to arrange the nodes in lanes. - *

- * @class - * @static - */ - export interface Swimlanes extends yfiles.lang.Object{} - export class Swimlanes { - /** - * Calculates an ordering of the swimlanes considering the specified ordering mode. - *

- * Depending on the swimlane mode, the ordering will try to reduce: - *

- *
    - *
  1. the number of swimlanes traversed by edges
  2. - *
  3. the number of swimlanes spanned by {@link yfiles.layout.GroupingSupport#isGroupNode group nodes}
  4. - *
- * @param graph the input graph - * @param node2Swimlane the assignment of nodes to swimlanes - * @param iterations the number of iterations performed by the heuristic. - * @param mode one of the valid swimlane ordering mode specifier - * @see yfiles.layout.SwimlaneRepresentative - * @see yfiles.layout.GroupingSupport - * @static - */ - static arrangeSwimlanes(graph:yfiles.algorithms.Graph,node2Swimlane:yfiles.algorithms.IDataProvider,iterations:number,mode:yfiles.layout.SwimlanesMode):void; - /** - * Calculates an ordering of the swimlanes. - *

- * The ordering will try to reduce: - *

- *
    - *
  1. the number of swimlanes traversed by edges
  2. - *
  3. the number of swimlanes spanned by {@link yfiles.layout.GroupingSupport#isGroupNode group nodes}
  4. - *
- * @param graph the input graph - * @param node2Swimlane the assignment of nodes to swimlanes - * @see yfiles.layout.SwimlaneRepresentative - * @see yfiles.layout.GroupingSupport - * @static - */ - static arrangeSwimlanes(graph:yfiles.algorithms.Graph,node2Swimlane:yfiles.algorithms.IDataProvider):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.Swimlanes; - } - export enum OperationType{ - /** - * Operation specifier defining that the graph will be mirrored at the x-axis. - * @see yfiles.layout.GraphTransformer#operation - */ - MIRROR_X_AXIS, - /** - * Operation specifier defining that the graph will be mirrored at the y-axis. - * @see yfiles.layout.GraphTransformer#operation - */ - MIRROR_Y_AXIS, - /** - * Operation specifier defining that the graph will be rotated. - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.GraphTransformer#rotationAngle - * @see yfiles.layout.GraphTransformer#bestFitRotationEnabled - */ - ROTATE, - /** - * Operation specifier defining that the graph will be scaled. - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.GraphTransformer#scaleFactor - * @see yfiles.layout.GraphTransformer#setScaleFactors - * @see yfiles.layout.GraphTransformer#scaleNodeSize - */ - SCALE, - /** - * Operation specifier defining that the graph will be translated. - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.GraphTransformer#translateX - * @see yfiles.layout.GraphTransformer#translateY - */ - TRANSLATE - } - /** - * This layout algorithm applies geometric transformations to (sub-)graphs. - *

- * Layout Style There are several ways to transform the graph that include mirroring, rotating, scaling and translating. {@graph {"ann":{"s":[30,30],"d":1},"n":[[-15,235],[-15,360],[-15,110],[235,485],[110,485],[360,485],[-15,485],[485,235],[485,360],[235,-15],[110,-15],[360,-15],[485,110],[-15,-15],[485,485],[485,-15],[235,235,1],[146.61,146.61,1],[146.61,323.39,1],[58.22,235,1],[323.39,323.39,1],[235,411.78,1],[323.39,146.61,1],[235,58.22,1],[411.78,235,1]],"e":[[1,0],[0,2],[4,3],[3,5],[1,6],[6,4],[7,8],[9,10],[11,9],[12,7],[2,13],[13,10],[8,14],[14,5],[11,15],[12,15],[16,17],[16,18],[19,17],[19,18],[20,16],[18,21],[21,20],[22,16],[23,22],[23,17],[20,24],[22,24],[17,0],[19,1],[23,2],[18,3],[4,19],[5,21],[20,7],[21,8],[9,22],[10,23],[24,11],[24,12]],"vp":[-15.0,-15.0,530.0,530.0]}} - *

- *

- * The highlighted subgraph is rotated by 45 degrees - *

- *

- * Features - *

- *

- * The layout can be {@link yfiles.layout.OperationType#SCALE scaled} with independent factors for the horizontal and vertical scaling. Optionally, the sizes of - * nodes can be scaled, too. - *

- *

- * The layout can be mirrored either on the {@link yfiles.layout.OperationType#MIRROR_X_AXIS x-axis} or the {@link yfiles.layout.OperationType#MIRROR_Y_AXIS y-axis}. - *

- *

- * A {@link yfiles.layout.OperationType#ROTATE rotation} can be specified. Instead of {@link yfiles.layout.GraphTransformer#rotationAngle defining} a rotation angle the angle can be {@link yfiles.layout.GraphTransformer#bestFitRotationEnabled determined automatically} to fit - * specific bounds. - *

- *

- * The coordinates in the layout can be {@link yfiles.layout.OperationType#TRANSLATE translated} by a specific vector. - *

- *

- * To only apply previously mentioned transformations to a subgraph, the {@link yfiles.layout.SubgraphLayout} needs to be {@link yfiles.layout.MultiStageLayout#subgraphLayoutEnabled enabled}. - * Then the nodes in the subgraph must be marked in a {@link yfiles.algorithms.IDataProvider} registered with the according {@link yfiles.layout.SubgraphLayout#affectedNodesDpKey key}. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - * @implements {yfiles.layout.ILayoutStage} - */ - export interface GraphTransformer extends yfiles.layout.MultiStageLayout,yfiles.layout.ILayoutStage{} - export class GraphTransformer { - /** - * Creates a new instance of {@link yfiles.layout.GraphTransformer} with default settings. - */ - constructor(); - /** - * Rotates the given graph so its resulting bounding box fits best to the given bounds. - * @param graph the graph that is rotated - * @param width the width of the preferred layout bounds - * @param height the height of the preferred layout bounds - * @returns the rotation angle - * @see yfiles.layout.GraphTransformer#bestFitRotationEnabled - * @static - */ - static applyBestFitRotationAngle(graph:yfiles.layout.LayoutGraph,width:number,height:number):number; - /** - * Returns the rotation angle for the graph that will result in a layout that fits best to the given bounds. - * @param graph the graph that is rotated - * @param width the width of the preferred layout bounds - * @param height the height of the preferred layout bounds - * @returns the rotation angle - * @see yfiles.layout.GraphTransformer#applyBestFitRotationAngle - * @static - */ - static findBestFitRotationAngle(graph:yfiles.layout.LayoutGraph,width:number,height:number):number; - /** - * Specifies the preferred size of the layout. - *

- * If performing a {@link yfiles.layout.OperationType#ROTATE rotation} and this rotation should be - * {@link yfiles.layout.GraphTransformer#bestFitRotationEnabled automatically fitted}, then the given preferred size defines the aspect ratio that will be used for fitting the layout - * rotation. - *

- *

- * The preferred width and height need to be non-negative. - *

- * @param width the preferred width of the layout - * @param height the preferred height of the layout - * @throws {Stubs.Exceptions.ArgumentError} if the specified width or height is negative - * @see yfiles.layout.GraphTransformer#preferredWidth - * @see yfiles.layout.GraphTransformer#preferredHeight - * @see yfiles.layout.GraphTransformer#bestFitRotationEnabled - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#ROTATE - */ - preferredLayoutSize(width:number,height:number):void; - /** - * Fits the given graph into the specified rectangular bounds. - *

- * If the bounding box fits in the given bounds, nothing is done. Otherwise, the graph is scaled and optionally moved to - * fit. - *

- * @param graph the graph to modify - * @param x the upper left x-coordinate of the bounds - * @param y the upper left y-coordinate of the bounds - * @param w the width of the bounds - * @param h the height of the bounds - * @static - */ - static setMaximalBounds(graph:yfiles.layout.LayoutGraph,x:number,y:number,w:number,h:number):void; - /** - * Specifies the horizontal and vertical scaling factor used for the {@link yfiles.layout.OperationType#SCALE scale operation}. - *

- * Only positive scaling factors are allowed. - *

- * @param xFactor the horizontal scaling factor - * @param yFactor the vertical scaling factor - * @throws {Stubs.Exceptions.ArgumentError} if one the specified scaling factors is negative or 0 - * @see yfiles.layout.GraphTransformer#scaleFactorX - * @see yfiles.layout.GraphTransformer#scaleFactorY - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#SCALE - */ - setScaleFactors(xFactor:number,yFactor:number):void; - /** - * Translates the layout coordinates by the given vector. - * @param graph the graph that is translated - * @param dx the horizontal distance the given graph is moved - * @param dy the vertical distance the given graph is moved - * @see yfiles.layout.OperationType#TRANSLATE - * @see yfiles.layout.GraphTransformer#operation - * @static - */ - static translate(graph:yfiles.layout.LayoutGraph,dx:number,dy:number):void; - /** - * - * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the transformation operation. - * @throws {Stubs.Exceptions.ArgumentError} if the specified operation is unknown - * @type {yfiles.layout.OperationType} - */ - operation:yfiles.layout.OperationType; - /** - * Gets or sets the angle of rotation. - *

- * The angle must be given in degrees. - *

- * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#ROTATE - * @type {number} - */ - rotationAngle:number; - /** - * Gets or sets whether or not to automatically choose the best fitting rotation angle. - *

- * The angle will be chosen such that the bounding box after the rotation fits best to the {@link yfiles.layout.GraphTransformer#preferredLayoutSize preferred aspect ratio}. - *

- * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#ROTATE - * @type {boolean} - */ - bestFitRotationEnabled:boolean; - /** - * Gets or sets the preferred height of the layout. - *

- * This value will be used for {@link yfiles.layout.GraphTransformer#bestFitRotationEnabled fitting the rotation} to preferred bounds. - *

- *

- * The preferred height needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified height is negative - * @see yfiles.layout.GraphTransformer#preferredWidth - * @see yfiles.layout.GraphTransformer#bestFitRotationEnabled - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#ROTATE - * @type {number} - */ - preferredHeight:number; - /** - * Gets or sets the preferred width of the layout. - *

- * This value will be used for {@link yfiles.layout.GraphTransformer#bestFitRotationEnabled fitting the rotation} to preferred bounds. - *

- *

- * The preferred width needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified width is negative - * @see yfiles.layout.GraphTransformer#preferredHeight - * @see yfiles.layout.GraphTransformer#bestFitRotationEnabled - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#ROTATE - * @type {number} - */ - preferredWidth:number; - /** - * Gets or sets whether or not to also scale node sizes when performing the {@link yfiles.layout.OperationType#SCALE scale operation}. - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#SCALE - * @type {boolean} - */ - scaleNodeSize:boolean; - /** - * Sets the uniform scaling factor used for the {@link yfiles.layout.OperationType#SCALE scale operation}. - *

- * This factor applies vertical and horizontal. - *

- *

- * Only positive scaling factors are allowed. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified scaling factor is negative or 0 - * @see yfiles.layout.GraphTransformer#scaleFactorX - * @see yfiles.layout.GraphTransformer#scaleFactorY - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#SCALE - * @type {number} - */ - scaleFactor:number; - /** - * Gets or sets the vertical scaling factor used for the {@link yfiles.layout.OperationType#SCALE scale operation}. - *

- * Only positive scaling factors are allowed. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified scaling factor is negative or 0 - * @see yfiles.layout.GraphTransformer#scaleFactorX - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#SCALE - * @type {number} - */ - scaleFactorY:number; - /** - * Gets or sets the horizontal scaling factor used for the {@link yfiles.layout.OperationType#SCALE scale operation}. - *

- * Only positive scaling factors are allowed. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified scaling factor is negative or 0 - * @see yfiles.layout.GraphTransformer#scaleFactorY - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#SCALE - * @type {number} - */ - scaleFactorX:number; - /** - * Gets or sets the horizontal translation distance. - *

- * A positive value means the graph is moved to the right while, a negative value means the graph is moved to the left. - *

- * @see yfiles.layout.GraphTransformer#translateY - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#TRANSLATE - * @type {number} - */ - translateX:number; - /** - * Gets or sets the vertical translation distance. - *

- * A positive value means the graph is moved downwards, while a negative value means the graph is moved upwards. - *

- * @see yfiles.layout.GraphTransformer#translateX - * @see yfiles.layout.GraphTransformer#operation - * @see yfiles.layout.OperationType#TRANSLATE - * @type {number} - */ - translateY:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.GraphTransformer; - } - /** - * A {@link yfiles.layout.ILayoutStage layout stage} that can handle fixed nodes in hierarchically grouped graphs. - *

- * This stage guarantees that a {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} will maintain - * the relative positions of nodes within the same group. - *

- *

- * Also, this stage is responsible for routing edges that connect nodes belonging to hierarchically unrelated groups. More - * precisely, the stage temporarily replaces fixed group nodes (see - * {@link yfiles.layout.FixGroupLayoutStage#FIXED_GROUP_NODES_DP_KEY}) with normal nodes of the same size while the content of the - * groups is removed from the graph during layout. - *

- *

- * The nodes are used as placeholders and are responsible for keeping the relations to the remaining graph elements. Edges - * that originate from the outside of the group node and terminate in its interior (inter-edges) are redirected such that - * they connect to the node that replaces the group. - *

- *

- * After the layout process, the group nodes are restored and the stage inserts the content at the new group position - * (derived from the position of the associated node). The content itself (including the edges between content nodes) - * remains unchanged and is only relocated. Furthermore, the inter-edges are connected to their original source/target and - * the stage reroutes them using the specified inter-edge routing algorithm (see {@link yfiles.layout.FixGroupLayoutStage#interEdgeRouter}). - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"styles":{"6":{"c":1}},"n":[[759.46,-86.88,290.54,283.26,2],[982.99,109.5,6],[796.47,109.5,6],[854.11,-67.88,6],[925.35,-67.88,6],[1005,41.75,6],[925.35,151.37,6],[796.47,-26.01,6],[774.46,41.75,6],[982.99,-26.01,6],[854.11,151.37,6],[123.31,-231.69,216.69,224.72,2],[212.57,-132.33,6],[263.97,-67.88,6],[263.97,-196.77,6],[138.31,-168.09,6],[194.23,-51.97,6],[295,-132.33,6],[138.31,-96.56,6],[194.23,-212.69,6],[265,40.5,430,339,2],[465,234.5,45,30],[380,59.5,45,30],[465,284.5,45,30],[380,109.5,45,30],[465,84.5,45,30],[465,134.5,45,30],[550,209.5,45,30],[380,309.5,45,30],[550,259.5,45,30],[380,259.5,45,30],[465,334.5,45,30],[550,134.5,45,30],[635,134.5,45,30],[465,184.5,45,30],[280,184.5,60,30]],"e":[[9,4],[3,7],[8,7],[4,3],[2,8],[10,2],[6,10],[1,6],[5,1],[2,3],[2,9],[2,1],[5,9],[12,18],[12,13],[12,14],[12,15],[12,19],[12,17],[12,16],[30,21],[21,29],[21,27],[35,22],[30,23],[35,24],[24,26],[24,25],[26,32],[35,28],[35,30],[30,31],[30,34],[32,33],[33,2],[33,8],[33,7],[35,17]],"vp":[123.0,-232.0,927.0,612.0]}} Initial graph. Nodes inside groups have to remain at their relative positions. {@graph {"ann":{"s":[30,30],"d":1},"styles":{"6":{"c":1}},"n":[[754.73,68.37,290.54,283.26,2],[978.26,264.75,6],[791.74,264.75,6],[849.38,87.37,6],[920.62,87.37,6],[1000.27,197,6],[920.62,306.63,6],[791.74,129.25,6],[769.73,197,6],[978.26,129.25,6],[849.38,306.63,6],[-18.35,97.64,216.69,224.72,2],[70.92,197,6],[122.31,261.44,6],[122.31,132.56,6],[-3.35,161.24,6],[52.58,277.36,6],[153.35,197,6],[-3.35,232.76,6],[52.58,116.64,6],[265,40.5,430,339,2],[465,234.5,45,30],[380,59.5,45,30],[465,284.5,45,30],[380,109.5,45,30],[465,84.5,45,30],[465,134.5,45,30],[550,209.5,45,30],[380,309.5,45,30],[550,259.5,45,30],[380,259.5,45,30],[465,334.5,45,30],[550,134.5,45,30],[635,134.5,45,30],[465,184.5,45,30],[280,184.5,60,30]],"e":[[9,4],[3,7],[8,7],[4,3],[2,8],[10,2],[6,10],[1,6],[5,1],[2,3],[2,9],[2,1],[5,9],[12,18],[12,13],[12,14],[12,15],[12,19],[12,17],[12,16],[30,21],[21,29],[21,27],[35,22],[30,23],[35,24],[24,26],[24,25],[26,32],[35,28],[35,30],[30,31],[30,34],[32,33],[33,8,22.5,6,-2.49,-14.78,[782.24,155.5]],[33,7,22.5,-6,-15,-0.75],[33,2,0,15,-15,0,[657.5,279.75]],[35,17,-30,6.25,13.66,-6.25]],"vp":[-19.0,40.0,1065.0,340.0]}} Example after using {@link yfiles.layout.FixGroupLayoutStage} - * with {@link yfiles.orthogonal.OrthogonalLayout}. Nodes inside groups did not change relative positions. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface FixGroupLayoutStage extends yfiles.layout.LayoutStageBase{} - export class FixGroupLayoutStage { - /** - * Creates a new instance of {@link yfiles.layout.FixGroupLayoutStage} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [core=null] The core layout algorithm. - */ - constructor(core?:yfiles.layout.ILayoutAlgorithm); - /** - * Data provider key for selecting group nodes whose contents should keep their relative positions - *

- * A group node is considered selected in this context, if the corresponding {@link yfiles.algorithms.IDataProvider} returns true for the - * group node or any of its ancestor (group) nodes. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static FIXED_GROUP_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets the inter-edge routing style used by this layout stage. - * @throws {Stubs.Exceptions.ArgumentError} if the given routing style is unknown - * @type {yfiles.layout.InterEdgeRoutingStyle} - */ - interEdgeRoutingStyle:yfiles.layout.InterEdgeRoutingStyle; - /** - * Gets or sets the edge routing algorithm that is applied to route the inter-edges. - *

- * If no routing algorithm is set, a new instance of {@link yfiles.layout.CompositeLayoutStage} associated with a {@link yfiles.layout.HideGroupsStage} - * and an {@link yfiles.router.EdgeRouter} will be used. - *

- * @type {yfiles.layout.ILayoutAlgorithm} - */ - interEdgeRouter:yfiles.layout.ILayoutAlgorithm; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.FixGroupLayoutStage; - } - /** - * A {@link yfiles.layout.IPartitionFinder} is responsible for partitioning the input graph. - * @interface - */ - export interface IPartitionFinder extends yfiles.lang.Object{ - /** - * Returns a partition ID for each node of an input graph. - *

- * Nodes that share a common partition ID are considered to belong to the same partition. - *

- * @param graph the input graph - * @param partitionIDMap the map that is filled with the resulting partition IDs - * @abstract - */ - findPartitions(graph:yfiles.layout.LayoutGraph,partitionIDMap:yfiles.algorithms.INodeMap):void; - } - var IPartitionFinder:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IPartitionFinder; - }; - /** - * A {@link yfiles.layout.IPartitionPlacer} is responsible for arranging the graph partitions. - *

- * Arranging a graph partition usually involves applying a coordinate translation to all elements that belong to the - * partition in order to generate a non-overlapping node arrangement. - *

- * @interface - */ - export interface IPartitionPlacer extends yfiles.lang.Object{ - /** - * Arranges the graph while taking partition IDs and inter-edge information into account. - *

- * Edges which connect nodes that belong to two different partitions are called inter-edges - *

- * @param graph the input graph - * @param partitionIDDP the partition ID for each node in the graph - * @param interEdgeDP the map which marks inter-edges - * @abstract - */ - placePartitions(graph:yfiles.layout.LayoutGraph,partitionIDDP:yfiles.algorithms.IDataProvider,interEdgeDP:yfiles.algorithms.IDataProvider):void; - } - var IPartitionPlacer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.layout.IPartitionPlacer; - }; - /** - * {@link yfiles.layout.PartitionLayout} provides a framework for layouts that are based on a divide and conquer approach. - *

- * Concept The approach can be subdivided into four stages: - *

- *
    - *
  1. The input graph is partitioned into smaller units. Implementations of this phase can be set using method {@link yfiles.layout.PartitionLayout#partitionFinder}.
  2. - *
  3. Optionally, the layout algorithm arranges each partition. Implementations of this phase can be set using method {@link yfiles.layout.LayoutStageBase#coreLayout}.
  4. - *
  5. - * The graph partitions are arranged next to each other keeping their layout. Implementations of this phase can be set - * using method {@link yfiles.layout.PartitionLayout#partitionPlacer}. - *
  6. - *
  7. - * Edges that connect nodes in different graph partitions will be routed. Implementations of this phase can be set using - * method {@link yfiles.layout.PartitionLayout#interEdgeRouter} - *
  8. - *
- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface PartitionLayout extends yfiles.layout.LayoutStageBase{} - export class PartitionLayout { - /** - * Creates a new {@link yfiles.layout.PartitionLayout} instance with default settings. - */ - constructor(); - /** - * Creates a {@link yfiles.layout.IPartitionPlacer} that uses {@link yfiles.layout.ComponentLayout} to place the partitions. - * @param [componentLayout=null] An optional {@link } to use. - * @returns - * @static - */ - static createComponentPartitionPlacer(componentLayout?:yfiles.layout.ComponentLayout):yfiles.layout.IPartitionPlacer; - /** - * Creates a {@link yfiles.layout.IPartitionFinder} that uses {@link yfiles.algorithms.Groups#edgeBetweennessClustering} as strategy for - * finding graph partitions. - * @param [minimumPartitionCount=0] The minimum number of partitions the result should have. - * @param [maximumPartitionCount=0x7FFFFFFF] The maximum number of partitions the result should have. - * @returns - * @static - */ - static createEdgeBetweennessPartitionFinder(minimumPartitionCount?:number,maximumPartitionCount?:number):yfiles.layout.IPartitionFinder; - /** - * Creates a {@link yfiles.layout.IPartitionFinder} that uses {@link yfiles.algorithms.Groups#edgeBetweennessClustering} as strategy for - * finding graph partitions. - * @param {Object} options The parameters to pass. - * @param [options.minimumPartitionCount=0] The minimum number of partitions the result should have. - * @param [options.maximumPartitionCount=0x7FFFFFFF] The maximum number of partitions the result should have. - * @returns - * @static - */ - static createEdgeBetweennessPartitionFinder(options:{minimumPartitionCount?:number,maximumPartitionCount?:number}):yfiles.layout.IPartitionFinder; - /** - * Gets or sets the {@link yfiles.layout.IPartitionFinder} instance that is responsible for partitioning the input graph. - * @type {yfiles.layout.IPartitionFinder} - */ - partitionFinder:yfiles.layout.IPartitionFinder; - /** - * Gets or sets the {@link yfiles.layout.IPartitionPlacer} instance that is responsible for arranging the graph partitions. - * @type {yfiles.layout.IPartitionPlacer} - */ - partitionPlacer:yfiles.layout.IPartitionPlacer; - /** - * Gets or sets the IInterEdgeRouter instance that is responsible for inter-edge routing. - * @type {yfiles.layout.IPartitionInterEdgeRouter} - */ - interEdgeRouter:yfiles.layout.IPartitionInterEdgeRouter; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PartitionLayout; - } - /** - * The {@link yfiles.layout.PortPlacementStage} assigns edges to the ports specified by {@link yfiles.layout.PortConstraint}s or - * {@link yfiles.layout.PortCandidate}s after calling the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- * It can be used for adjusting ports for layout algorithms that cannot handle {@link yfiles.layout.PortConstraint}s. - *

- *

- * If {@link yfiles.layout.PortCandidate}s are assigned for edges and nodes, this stage tries to match them. When there is no - * match, the {@link yfiles.layout.PortCandidate} with the lowest costs specified for the edge is chosen. While - * {@link yfiles.layout.PortConstraint}s are also matched to - * {@link yfiles.layout.PortCandidate}s at nodes and edges, it is not recommended to mix them because they belong to different - * concepts. - *

- *

- * Furthermore, option {@link yfiles.layout.PortPlacementStage#pathCorrection} allows to specify whether the edge path should be corrected after correcting a port. - *

- *

- * It is recommended that the {@link yfiles.layout.PortPlacementStage} is prepended to the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} in order to be - * able to process all the edges and especially, self-loops and parallel edges. Note that edges that might be hidden by - * other {@link yfiles.layout.ILayoutStage}s cannot be handled by {@link yfiles.layout.PortPlacementStage}. - *

- * @see yfiles.layout.PortConstraint - * @see yfiles.layout.PortCandidate - * @see yfiles.layout.PortCandidateSet - * @see yfiles.layout.PortPlacementStage#pathCorrection - * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface PortPlacementStage extends yfiles.layout.LayoutStageBase{} - export class PortPlacementStage { - /** - * Creates a new {@link yfiles.layout.PortPlacementStage} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algorithm. - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Gets or sets whether or not this {@link yfiles.layout.ILayoutStage} corrects the edge paths after moving the port to the - * location specified by a {@link yfiles.layout.PortConstraint} or {@link yfiles.layout.PortCandidate}s. - *

- * If path correction is enabled, the edge will be rerouted within a specific area around its source/target node. Outside - * this area, it will keep the route that was calculated by the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. If this feature is disabled, only the ports are moved which may be more suitable for initially - * straight edges. - *

- * @type {boolean} - */ - pathCorrection:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PortPlacementStage; - } - /** - * Specifies custom data for the {@link yfiles.layout.ComponentLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface ComponentLayoutData extends yfiles.layout.LayoutData{} - export class ComponentLayoutData { - constructor(); - /** - * Gets or sets a collection of nodes that determine the components that shall be laid out. - *

- * Note that components will be laid out if and only if at least one of the nodes is in this collection. - *

- * @see yfiles.layout.ComponentLayout#AFFECTED_COMPONENTS_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - affectedComponents:yfiles.layout.ItemCollection; - /** - * Gets or sets the mapping from nodes to their component comparable that is used to sort the components. - * @see yfiles.layout.ComponentLayout#COMPONENT_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - componentIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ComponentLayoutData; - } - /** - * Combines several {@link yfiles.layout.LayoutData} instances. - *

- * This is especially useful if several layouts are run at once, for example a general layout and a subsequent edge - * routing. - *

- * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface CompositeLayoutData extends yfiles.layout.LayoutData{} - export class CompositeLayoutData { - constructor(); - /** - * Gets or sets a collection of composed layout data objects. - * @type {yfiles.collections.ICollection.} - */ - items:yfiles.collections.ICollection; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.CompositeLayoutData; - } - /** - * Provides different ways to define a mapping from items to values that takes a context object into consideration, too. - *

- * Only one of the provided ways to define a mapping can be used at the same time, therefore only one of the properties {@link yfiles.layout.ContextItemMapping.#contextDelegate}, {@link yfiles.layout.ItemMapping.#delegate}, - * {@link yfiles.layout.ItemMapping.#mapper}, and {@link yfiles.layout.ItemMapping.#constant} should be set on each instance. - *

- *

- * This class supports {@link yfiles.layout.LayoutData} implementations and does not usually have to be used explicitly. - *

- * Type parameter TItem: The type of the items that are mapped. - * Type parameter TValue: The type of the values the items are mapped to. - * Type parameter TContext: The type of the context passed to the {@link yfiles.layout.ContextItemMapping.#contextDelegate} - * @class - * @extends {yfiles.layout.ItemMapping.} - * @template TItem,TValue,TContext - */ - export interface ContextItemMapping extends yfiles.layout.ItemMapping{} - export class ContextItemMapping { - constructor(); - /** - * Provides a mapper mapping the items to values. - * @param adapter The graph adapter the mapper shall be provided for. - * @param layout The layout using the mapper. - * @param context The context object passed to the {@link #contextDelegate}. - * @returns A mapper mapping the items to values. - */ - provideMapperForContext(adapter:yfiles.layout.LayoutGraphAdapter,layout:yfiles.layout.ILayoutAlgorithm,context:TContext):yfiles.collections.IMapper; - /** - * Gets or sets a delegate from the items and a context object to the values. - * @type {function(TItem, TContext): TValue} - */ - contextDelegate:(arg1:TItem,arg2:TContext)=>TValue; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ContextItemMapping; - } - /** - * Wraps an {@link yfiles.collections.IMapper.} into an {@link yfiles.algorithms.IDataProvider}. - *

- * This class is used by {@link yfiles.layout.LayoutExecutor}, {@link yfiles.layout.LayoutGraphAdapter}, and {@link yfiles.layout.YGraphAdapter} to - * convert an {@link yfiles.graph.IGraph} into a corresponding - * {@link yfiles.algorithms.Graph}. Unless that conversion needs to be customized, or aforementioned classes cannot be used, this - * class usually doesn't need to be used explicitly. - *

- * Type parameter TKey: The type of the keys. - * Type parameter TValue: The type of the values. - * @class - * @implements {yfiles.algorithms.IDataProvider} - * @template TKey,TValue - */ - export interface DataProviderAdapter extends yfiles.lang.Object,yfiles.algorithms.IDataProvider{} - export class DataProviderAdapter { - /** - * Creates a new instance that adapts the provided mapper instance. - * @param keyType The type of the keys. - * @param mapper The mapper to adapt. - */ - constructor(keyType:yfiles.lang.Class,mapper:yfiles.collections.IMapper); - /** - * - * @param dataHolder - * @returns - */ - get(dataHolder:any):any; - /** - * - * @param dataHolder - * @returns - */ - getBoolean(dataHolder:any):boolean; - /** - * - * @param dataHolder - * @returns - */ - getInt(dataHolder:any):number; - /** - * - * @param dataHolder - * @returns - */ - getNumber(dataHolder:any):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.DataProviderAdapter; - } - /** - * An adapter implementation that wraps an {@link yfiles.collections.IMapper.} to an {@link yfiles.algorithms.IDataMap}. - * Type parameter K: The type of the key for the mapper. - * Type parameter V: The type of the value for the mapper. - * @see yfiles.layout.DataProviderAdapter. - * @class - * @extends {yfiles.layout.DataProviderAdapter.} - * @implements {yfiles.algorithms.IDataMap} - * @template K,V - */ - export interface DataMapAdapter extends yfiles.layout.DataProviderAdapter,yfiles.algorithms.IDataMap{} - export class DataMapAdapter { - /** - * Initializes a new instance of the {@link yfiles.layout.DataMapAdapter.} class. - * @param keyType The type of the key for the mapper. - * @param valueType The type of the value for the mapper. - * @param mapper The mapper to adapt. - */ - constructor(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,mapper:yfiles.collections.IMapper); - /** - * - * @param dataHolder - * @param value - */ - set(dataHolder:any,value:any):void; - /** - * - * @param dataHolder - * @param value - */ - setBoolean(dataHolder:any,value:boolean):void; - /** - * - * @param dataHolder - * @param value - */ - setInt(dataHolder:any,value:number):void; - /** - * - * @param dataHolder - * @param value - */ - setNumber(dataHolder:any,value:number):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.DataMapAdapter; - } - /** - * An item collection that allows to specify the data provider key the collection is registered with. - *

- * This class supports {@link yfiles.layout.LayoutData} implementations and does not usually have to be used explicitly. - *

- * Type parameter T: The type of the items in the collection. - * @class - * @extends {yfiles.layout.ItemCollection.} - * @template T - */ - export interface DpKeyItemCollection extends yfiles.layout.ItemCollection{} - export class DpKeyItemCollection { - constructor(); - /** - * Gets or sets the data provider key that is used for the item collection. - *

- * If no key is set, the default data provider key is used. - *

- * @type {yfiles.algorithms.DpKeyBase.} - */ - dpKey:yfiles.algorithms.DpKeyBase; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.DpKeyItemCollection; - } - /** - * An {@link yfiles.layout.EdgeLabelCandidate} that provides a {@link yfiles.graph.ILabelCandidateDescriptor candidate descriptor}. - *

- * This class is used by {@link yfiles.layout.LayoutExecutor} and {@link yfiles.layout.LayoutGraphAdapter} to convert an {@link yfiles.graph.IGraph} - * into a corresponding - * {@link yfiles.algorithms.Graph}. Unless that conversion needs to be customized, or aforementioned classes cannot be used, this - * class usually doesn't need to be used explicitly. - *

- * @class - * @extends {yfiles.layout.EdgeLabelCandidate} - */ - export interface ExtendedEdgeLabelCandidate extends yfiles.layout.EdgeLabelCandidate{} - export class ExtendedEdgeLabelCandidate { - /** - * Returns a new instance of ExtendedEdgeLabelCandidate. - *

- * Returns a new instance of ExtendedEdgeLabelCandidate. - *

- * @param pos the location of the upper left corner of the candidate. - * @param size the size of the candidate. - * @param param the parameters of the labeling model associated with this candidate. - * @param owner the label associated to the candidate. - * @param internal flag whether the candidate is allowed to overlap the layout of the edge. - * @param descriptor the label candidate descriptor. - */ - constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:any,owner:yfiles.layout.IEdgeLabelLayout,internal:boolean,descriptor:yfiles.graph.ILabelCandidateDescriptor); - /** - * Returns a new instance of ExtendedEdgeLabelCandidate. - *

- * Returns a new instance of ExtendedEdgeLabelCandidate. - *

- * @param orientedBox the label size and orientation - * @param param the parameters of the labeling model associated with this candidate. - * @param owner the label associated to the candidate. - * @param internal flag whether the candidate is allowed to overlap the layout of the edge. - * @param descriptor the label candidate descriptor. - */ - constructor(orientedBox:yfiles.algorithms.YOrientedRectangle,param:any,owner:yfiles.layout.IEdgeLabelLayout,internal:boolean,descriptor:yfiles.graph.ILabelCandidateDescriptor); - /** - * Returns a new instance of ExtendedEdgeLabelCandidate. - *

- * Returns a new instance of ExtendedEdgeLabelCandidate. - *

- * @param pos the location of the upper left corner of the candidate. - * @param size the size of the candidate. - * @param param the parameters of the labeling model associated with this candidate. - * @param owner the label associated to the candidate. - * @param descriptor the label candidate descriptor. - */ - constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:any,owner:yfiles.layout.IEdgeLabelLayout,descriptor:yfiles.graph.ILabelCandidateDescriptor); - /** - * Gets the label candidate descriptor. - * @type {yfiles.graph.ILabelCandidateDescriptor} - */ - descriptor:yfiles.graph.ILabelCandidateDescriptor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ExtendedEdgeLabelCandidate; - } - /** - * An {@link yfiles.layout.IProfitModel} that returns the profit of a label candidate for instances of {@link yfiles.layout.ExtendedNodeLabelCandidate} - * and {@link yfiles.layout.ExtendedEdgeLabelCandidate}. - *

- * This class is used by {@link yfiles.layout.LayoutExecutor} and {@link yfiles.layout.LayoutGraphAdapter} to convert an {@link yfiles.graph.IGraph} - * into a corresponding - * {@link yfiles.algorithms.Graph}. Unless that conversion needs to be customized, or aforementioned classes cannot be used, this - * class usually doesn't need to be used explicitly. - *

- * @class - * @implements {yfiles.layout.IProfitModel} - */ - export interface ExtendedLabelCandidateProfitModel extends yfiles.lang.Object,yfiles.layout.IProfitModel{} - export class ExtendedLabelCandidateProfitModel { - /** - * Returns the profit for placing a label-candidate. - *

- * This implementation returns the profit for instances of {@link yfiles.layout.ExtendedNodeLabelCandidate} or 0.0 for other - * {@link yfiles.layout.LabelCandidate}s. - *

- * @param candidate a label candidate - * @returns a value between 0 and 1. - */ - getProfit(candidate:yfiles.layout.LabelCandidate):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ExtendedLabelCandidateProfitModel; - } - /** - * A {@link yfiles.layout.NodeLabelCandidate} that provides a {@link yfiles.graph.ILabelCandidateDescriptor candidate descriptor}. - *

- * This class is used by {@link yfiles.layout.LayoutExecutor} and {@link yfiles.layout.LayoutGraphAdapter} to convert an {@link yfiles.graph.IGraph} - * into a corresponding - * {@link yfiles.algorithms.Graph}. Unless that conversion needs to be customized, or aforementioned classes cannot be used, this - * class usually doesn't need to be used explicitly. - *

- * @class - * @extends {yfiles.layout.NodeLabelCandidate} - */ - export interface ExtendedNodeLabelCandidate extends yfiles.layout.NodeLabelCandidate{} - export class ExtendedNodeLabelCandidate { - /** - * Returns a new instance of NodeLabelCandidate. - *

- * Returns a new instance of NodeLabelCandidate. - *

- * @param pos the location of the upper left corner of the candidate. - * @param size the size of the candidate. - * @param param the parameters of the labeling model associated with this candidate. - * @param owner the label associated to the candidate. - * @param internal flag whether the candidate is inside the node, or outside. - * @param descriptor the label candidate descriptor. - */ - constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:any,owner:yfiles.layout.INodeLabelLayout,internal:boolean,descriptor:yfiles.graph.ILabelCandidateDescriptor); - /** - * Returns a new instance of NodeLabelCandidate. - *

- * Returns a new instance of NodeLabelCandidate. - *

- * @param orientedBox the label size and orientation - * @param param the parameters of the labeling model associated with this candidate. - * @param owner the label associated to the candidate. - * @param internal flag whether the candidate is inside the node, or outside. - * @param descriptor the label candidate descriptor. - */ - constructor(orientedBox:yfiles.algorithms.YOrientedRectangle,param:any,owner:yfiles.layout.INodeLabelLayout,internal:boolean,descriptor:yfiles.graph.ILabelCandidateDescriptor); - /** - * Returns a new instance of ExtendedNodeLabelCandidate. - *

- * Returns a new instance of ExtendedNodeLabelCandidate. - *

- * @param pos the location of the upper left corner of the candidate. - * @param size the size of the candidate. - * @param param the parameters of the labeling model associated with this candidate. - * @param owner the label associated to the candidate. - * @param descriptor the label candidate descriptor. - */ - constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:any,owner:yfiles.layout.INodeLabelLayout,descriptor:yfiles.graph.ILabelCandidateDescriptor); - /** - * Gets the label candidate descriptor. - * @type {yfiles.graph.ILabelCandidateDescriptor} - */ - descriptor:yfiles.graph.ILabelCandidateDescriptor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ExtendedNodeLabelCandidate; - } - /** - * Specifies custom data for the {@link yfiles.layout.FixGroupLayoutStage}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface FixGroupLayoutData extends yfiles.layout.LayoutData{} - export class FixGroupLayoutData { - constructor(); - /** - * Gets or sets the collection of group nodes whose contents should keep their relative positions. - * @see yfiles.layout.FixGroupLayoutStage#FIXED_GROUP_NODES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - fixedGroupNodes:yfiles.layout.ItemCollection; - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.FixGroupLayoutData; - } - /** - * Specifies custom data for the {@link yfiles.layout.FixNodeLayoutStage}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface FixNodeLayoutData extends yfiles.layout.LayoutData{} - export class FixNodeLayoutData { - constructor(); - /** - * Gets or sets the collection of nodes which should be considered fixed. - * @see yfiles.layout.FixNodeLayoutStage#FIXED_NODE_DP_KEY - * @type {yfiles.layout.SingleItemCollection.} - */ - fixedNode:yfiles.layout.SingleItemCollection; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.FixNodeLayoutData; - } - /** - * Provides different ways to define the items in a collection for use with {@link yfiles.layout.LayoutData}. - *

- * Only one of the provided ways to define a collection can be used at the same time, therefore only one of the properties - * {@link yfiles.layout.ItemCollection.#items}, {@link yfiles.layout.ItemCollection.#mapper}, and {@link yfiles.layout.ItemCollection.#delegate} should be set on each instance. - *

- *

- * This class supports {@link yfiles.layout.LayoutData} implementations and does not usually have to be used explicitly. - *

- * Type parameter TItem: The type of the items in the collection. - * @class - * @template TItem - */ - export interface ItemCollection extends yfiles.lang.Object{} - export class ItemCollection { - /** - * Provides a mapper describing which elements are contained in this {@link yfiles.layout.ItemCollection.}. - * @param adapter The graph adapter the mapper shall be provided for. - * @param layout The layout using the item collection. - * @returns - */ - provideMapper(adapter:yfiles.layout.LayoutGraphAdapter,layout:yfiles.layout.ILayoutAlgorithm):yfiles.collections.IMapper; - /** - * Gets or sets a mapping from the items to a boolean value. - *

- * The mapped boolean value specifies whether an item is contained in the collection. - *

- * @type {yfiles.collections.IMapper.} - */ - mapper:yfiles.collections.IMapper; - /** - * Gets or sets a delegate from the items to a boolean value. - *

- * The returned boolean value describes whether an item is contained in the collection. - *

- * @type {function(TItem): boolean} - */ - delegate:(obj:TItem)=>boolean; - /** - * Gets or sets a collection of items. - *

- * This collection contains exactly the items in the given collection. - *

- * @type {yfiles.collections.ICollection.} - */ - items:yfiles.collections.ICollection; - /** - * Sets an enumerable of items. - *

- * This collection contains exactly the items in the given enumerable. - *

- * @type {yfiles.collections.IEnumerable.} - */ - source:yfiles.collections.IEnumerable; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ItemCollection; - } - /** - * Provides different ways to define a mapping from items to values for use with {@link yfiles.layout.LayoutData}. - *

- * Only one of the provided ways to define a mapping can be used at the same time, therefore only one of the properties {@link yfiles.layout.ItemMapping.#mapper}, {@link yfiles.layout.ItemMapping.#delegate} - * and {@link yfiles.layout.ItemMapping.#constant} should be set on each instance. - *

- *

- * This class supports {@link yfiles.layout.LayoutData} implementations and does not usually have to be instantiated by client code - * explicitly. Instances of this class are properties of concrete {@link yfiles.layout.LayoutData} implementations. - *

- * Type parameter TItem: The type of the items that are mapped. - * Type parameter TValue: The type of the values the items are mapped to. - * @class - * @template TItem,TValue - */ - export interface ItemMapping extends yfiles.lang.Object{} - export class ItemMapping { - /** - * Provides a mapper mapping the items to values. - *

- * This implementation returns the {@link yfiles.layout.ItemMapping.#mapper} if one has been set, otherwise it will create a mapper from the {@link yfiles.layout.ItemMapping.#delegate} if one has been - * specified or uses a constant mapper if a {@link yfiles.layout.ItemMapping.#constant} has been specified. If none have been specified, null is returned. - *

- * @param adapter The graph adapter the mapper shall be provided for. - * @param layout The layout using the mapper. - * @returns A mapper that maps items to values or null. - */ - provideMapper(adapter:yfiles.layout.LayoutGraphAdapter,layout:yfiles.layout.ILayoutAlgorithm):yfiles.collections.IMapper; - /** - * Gets or sets a delegate that implements the mapping. - *

- * This value will be ignored if either {@link yfiles.layout.ItemMapping.#mapper} as also been set. It overrides values set to the {@link yfiles.layout.ItemMapping.#constant} property. - *

- * @type {function(TItem): TValue} - */ - delegate:(key:TItem)=>TValue; - /** - * Gets or sets an {@link yfiles.collections.IMapper.} that realizes the mapping. - *

- * Getting this property will automatically create an instance. Values set will override the effect of any values set to - * the {@link yfiles.layout.ItemMapping.#constant} or {@link yfiles.layout.ItemMapping.#delegate} properties. - *

- * @type {yfiles.collections.IMapper.} - */ - mapper:yfiles.collections.IMapper; - /** - * Gets or sets a constant value all items are mapped to. - *

- * This value will be ignored if either {@link yfiles.layout.ItemMapping.#mapper} or {@link yfiles.layout.ItemMapping.#delegate} have also been set. - *

- * @type {TValue} - */ - constant:TValue; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ItemMapping; - } - /** - * Base for convenience classes that specify custom data for a layout calculation done with the - * {@link yfiles.layout.LayoutExecutor}. - *

- * Implementations of this class provide item-specific configuration options for a specific layout. Single properties that - * affect the complete layout are available on the specific layout class itself. - *

- *

- * The {@link yfiles.layout.LayoutExecutor} {@link yfiles.layout.LayoutData#apply applies} these configurations when {@link yfiles.layout.LayoutExecutor#start started}. So does - * {@link yfiles.layout.LayoutGraphAdapter#applyLayout}. - *

- * @see yfiles.layout.LayoutExecutor#layoutData - * @see yfiles.layout.LayoutGraphAdapter#applyLayout - * @class - */ - export interface LayoutData extends yfiles.lang.Object{} - export class LayoutData { - /** - * Applies this layout data to the specified layoutGraphAdapter. - *

- * This method should be called before a layout is executed. It will configure the adapter and graph for to the layout. - *

- * @param layoutGraphAdapter The adapter to add the layout data to. - * @param layout The layout that shall use this layout data. - * @param layoutGraph The layout graph used for the layout calculation. - * @abstract - */ - apply(layoutGraphAdapter:yfiles.layout.LayoutGraphAdapter,layout:yfiles.layout.ILayoutAlgorithm,layoutGraph:yfiles.layout.CopiedLayoutGraph):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LayoutData; - } - /** - * Executes a {@link yfiles.layout.ILayoutAlgorithm} and optionally animates the transition to the calculated layout. - *

- * This class is the preferred way to execute a layout. Its animation can be customized in various ways. - *

- *

- * If no fine-grained control of the animation is required, the convenience methods {@link yfiles.graph.IGraph#applyLayout} and {@link yfiles.view.GraphComponent#morphLayout} - * can be used instead. - *

- * @see yfiles.layout.LayoutGraphAdapter - * @class - */ - export interface LayoutExecutor extends yfiles.lang.Object{} - export class LayoutExecutor { - /** - * Initializes a new instance of the {@link yfiles.layout.LayoutExecutor} class. - * @param graphComponent The control which will be animated and provides the {@link } instance. - * @param graph The graph to layout. - * @param layout The {@link } to use. - */ - constructor(graphComponent:yfiles.view.GraphComponent,graph:yfiles.graph.IGraph,layout:yfiles.layout.ILayoutAlgorithm); - /** - * Initializes a new instance of the {@link yfiles.layout.LayoutExecutor} class. - *

- * Use the {@link yfiles.layout.LayoutExecutor#start} method to actually execute the task. This will disable animation and content - * rect updates. - *

- * @param graphComponent The control which will be animated and provides the {@link } instance. - * @param layout The {@link } to use. - */ - constructor(graphComponent:yfiles.view.GraphComponent,layout:yfiles.layout.ILayoutAlgorithm); - /** - * Creates an instance of {@link yfiles.algorithms.AbortHandler}. - *

- * This method is called upon first access to the {@link yfiles.layout.LayoutExecutor#abortHandler} property. - *

- * @returns A new {@link } instance to use during layout calculation. - * @protected - */ - createAbortHandler():yfiles.algorithms.AbortHandler; - /** - * Factory method that creates the {@link yfiles.view.IAnimation} that will be used by this instance after the layout has been - * calculated. - * @returns The animation to use after the layout. - * @see yfiles.layout.LayoutExecutor#duration - * @see yfiles.layout.LayoutExecutor#animateViewport - * @see yfiles.layout.LayoutExecutor#createMorphAnimation - * @see yfiles.layout.LayoutExecutor#createViewportAnimation - * @protected - */ - createAnimation():yfiles.view.IAnimation; - /** - * Factory method that creates the animation for the {@link yfiles.graph.IGraph}. - * @returns The animation instance. - * @see yfiles.layout.LayoutExecutor#createAnimation - * @protected - */ - createMorphAnimation():yfiles.view.IAnimation; - /** - * Creates an animation that morphs the layout of all {@link yfiles.graph.ITable}s in the graph. - * @returns - * @see yfiles.view.TableAnimation - * @see yfiles.layout.LayoutExecutor#configureTableLayout - * @protected - */ - createTableAnimations():yfiles.view.IAnimation; - /** - * Create a new instance of {@link yfiles.layout.TableLayoutConfigurator} that is used if {@link yfiles.layout.LayoutExecutor#configureTableLayout} is enabled. - *

- * This method is called upon first access to the {@link yfiles.layout.LayoutExecutor#tableLayoutConfigurator} property. - *

- * @returns A new instance of the {@link } class. - * @protected - */ - createTableLayoutConfigurator():yfiles.layout.TableLayoutConfigurator; - /** - * Factory method that creates the animation for the {@link yfiles.view.CanvasComponent#viewport}. - *

- * The created animation will morph the currnt viewport into the one where the whole graph fits. The result after the - * animation is thus the same as calling {@link yfiles.view.GraphComponent#fitGraphBounds}. - *

- * @param targetBounds The target bounds of the animation. - * @returns The animation instance. - * @see yfiles.layout.LayoutExecutor#createAnimation - * @protected - */ - createViewportAnimation(targetBounds:yfiles.geometry.Rect):yfiles.view.IAnimation; - /** - * Callback method that performs the actual layout. - * @protected - */ - execute():void; - /** - * Calculate the target bounds to be used for the {@link yfiles.view.CanvasComponent#contentRect} as well as the {@link yfiles.view.ViewportAnimation} after the layout has - * finished. - *

- * By default, the value is computed with {@link yfiles.layout.LayoutGraphUtilities#getBoundingBox} with labels and {@link yfiles.layout.LayoutExecutor#targetBoundsInsets} taken into - * account. - *

- * @returns The desired content rectangle and the bounds for a viewport animation. - * @protected - */ - getTargetBounds():yfiles.geometry.Rect; - /** - * Set up {@link yfiles.layout.LayoutExecutor#tableLayoutConfigurator} for a layout. - *

- * This implementation configures {@link yfiles.layout.TableLayoutConfigurator#horizontalLayout} according to the {@link yfiles.layout.MultiStageLayout#layoutOrientation} and calls {@link yfiles.layout.TableLayoutConfigurator#prepare} - *

- * @protected - */ - prepareTableLayout():void; - /** - * Writes the table layout information provided through {@link yfiles.layout.LayoutExecutor#tableLayoutConfigurator} back to all tables. - *

- * This method is only called when the layout is not animated. - *

- * @see yfiles.layout.LayoutExecutor#prepareTableLayout - * @protected - */ - restoreTableLayout():void; - /** - * Actually starts the layout calculation and the optional animation asynchronously using a Promise. - *

- * This method will ultimately call the {@link yfiles.layout.LayoutExecutor#execute} method. If the {@link yfiles.layout.LayoutExecutor#duration} is zero no animation will be - * performed. - *

- *

- * If this instance is already running, this method returns immediately without doing anything and returns the previous - * Promise. - *

- * @returns A Promise that will be fulfilled once the layout and optional animation is done. - * @see yfiles.layout.LayoutExecutor#execute - */ - start():Promise; - /** - * Stops a currently running layout calculation or animation. - *

- * If a layout calculation is still running, it will be requested to stopped via {@link yfiles.algorithms.AbortHandler#stop} and - * the animation will not run. If the layout calculation was already completed, the animation will be aborted immediately - * and the layout result will be shown immediately. - *

- *

- * To just skip the animation but let the calculation finish normally, the {@link yfiles.layout.LayoutExecutor#duration} can be set to zero at any time before the - * animation was started. - *

- * @returns - */ - stop():Promise; - /** - * Gets the {@link yfiles.algorithms.AbortHandler} that is used during the layout calculation, unless another {@link yfiles.algorithms.AbortHandler} - * has been configured via {@link yfiles.layout.LayoutExecutor#layoutData} or by registering an {@link yfiles.collections.IMapper.} in the graph's {@link yfiles.graph.IGraph#mapperRegistry}. - * @see yfiles.layout.LayoutExecutor#createAbortHandler - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets the {@link yfiles.layout.LayoutExecutor#tableLayoutConfigurator} that is used if {@link yfiles.layout.LayoutExecutor#configureTableLayout} is enabled. - * @see yfiles.layout.LayoutExecutor#createTableLayoutConfigurator - * @type {yfiles.layout.TableLayoutConfigurator} - */ - tableLayoutConfigurator:yfiles.layout.TableLayoutConfigurator; - /** - * Gets or sets a value indicating whether to automatically perform calls to {@link yfiles.layout.TableLayoutConfigurator#prepare} - * and {@link yfiles.layout.TableLayoutConfigurator#restore} in order to layout table nodes. - *

- * The default value is true. - *

- * @type {boolean} - */ - configureTableLayout:boolean; - /** - * Gets or sets the duration of the animation. - *

- * The default value is {@link yfiles.lang.TimeSpan#ZERO}. - *

- * @type {yfiles.lang.TimeSpan} - */ - duration:yfiles.lang.TimeSpan; - /** - * Gets or sets a value indicating whether edge groups are automatically created for edges that are connected to the same - * port. - *

- * If this property is enabled and no edge groups are explicitly created (no {@link yfiles.collections.IMapper.} are registered for the keys {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} - * and {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY}), for each port with multiple outgoing resp. incoming edges - * these edges will be assigned to the same edge group. The necessary - * {@link yfiles.algorithms.IDataProvider}s will be created automatically. - *

- *

- * Without an {@link yfiles.layout.ILayoutAlgorithm} that supports edge groups, this property ahs no visual effect. - *

- *

- * The default value is true. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @see yfiles.layout.LayoutGraphAdapter#automaticEdgeGrouping - * @see yfiles.layout.LayoutExecutor#fixPorts - * @type {boolean} - */ - automaticEdgeGrouping:boolean; - /** - * Controls whether strong port constraints are automatically created. - *

- * If this property is enabled and no edge groups are explicitly created (no {@link yfiles.collections.IMapper.} are registered for the keys {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} - * and {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY}), for all edges strong source and target point constraints - * with {@link yfiles.layout.PortSide#ANY} are created. The necessary - * {@link yfiles.algorithms.IDataProvider}s will be created automatically. - *

- *

- * This ensures that view {@link yfiles.graph.IPort}s are not moved during the layout, if the {@link yfiles.layout.ILayoutAlgorithm} - * supports port constraints. - *

- *

- * The default value is false. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @see yfiles.layout.LayoutGraphAdapter#fixPorts - * @see yfiles.layout.LayoutExecutor#automaticEdgeGrouping - * @type {boolean} - */ - fixPorts:boolean; - /** - * Gets or sets a value indicating whether the viewport should be animated to the new bounds of the graph. - *

- * The result when this property is true after the animation is the same as calling - * {@link yfiles.view.GraphComponent#fitGraphBounds}. Setting this property to true and changing {@link yfiles.layout.LayoutExecutor#duration} to {@link yfiles.lang.TimeSpan#ZERO} will - * disable the animation, but still change the viewport to the new graph bounds. - *

- *

- * When the viewport should stay the same, the layout algorithms often have to be coerced to keep parts of the graph in the - * same location. This can be done by wrapping the layout algorithm in an instance of {@link yfiles.layout.FixNodeLayoutStage}. - *

- *

- * The default value is false. - *

- * @type {boolean} - */ - animateViewport:boolean; - /** - * Gets or sets a value indicating whether to respect the {@link yfiles.view.CanvasComponent#viewportLimiter} of the {@link yfiles.view.GraphComponent} of this instance. - *

- * The default value is false. - *

- * @type {boolean} - */ - considerViewportLimiter:boolean; - /** - * Gets or sets a value indicating whether to use eased animation. - *

- * The default value is false. - *

- * @type {boolean} - */ - easedAnimation:boolean; - /** - * Gets or sets the insets (in world coordinates) that will be added to the content rectangle when calculating the target - * viewport. - *

- * The default value is {@link yfiles.geometry.Insets#EMPTY}. - *

- * @type {yfiles.geometry.Insets} - */ - targetBoundsInsets:yfiles.geometry.Insets; - /** - * Gets or sets a value indicating whether the content rectangle property of the {@link yfiles.view.CanvasComponent} should be - * updated upon completion. - *

- * The default value is false. - *

- * @type {boolean} - */ - updateContentRect:boolean; - /** - * Gets a value indicating whether this instance is currently running. - * @type {boolean} - */ - running:boolean; - /** - * Gets or sets the layout data that is applied when {@link yfiles.layout.LayoutExecutor#start starting} the executor. - * @type {yfiles.layout.LayoutData} - */ - layoutData:yfiles.layout.LayoutData; - /** - * Gets or sets the {@link yfiles.view.ISelectionModel.} to use for the automatically registered {@link yfiles.algorithms.IDataProvider} instances for {@link yfiles.layout.LayoutKeys#AFFECTED_NODES_DP_KEY} - * and {@link yfiles.layout.LayoutKeys#AFFECTED_EDGES_DP_KEY}. - *

- * If this value is null and {@link yfiles.layout.LayoutExecutor#graph} is the same instance as {@link yfiles.layout.LayoutExecutor#graphComponent}'s {@link yfiles.graph.IGraph} instance, the selection model from {@link yfiles.layout.LayoutExecutor#graphComponent} is used - * instead. - *

- * @type {yfiles.view.ISelectionModel.} - */ - selectionModel:yfiles.view.ISelectionModel; - /** - * Gets the layout graph that is used by this instance to calculate the layout. - * @protected - * @type {yfiles.layout.CopiedLayoutGraph} - */ - layoutGraph:yfiles.layout.CopiedLayoutGraph; - /** - * Gets the control this instance has been created for. - * @protected - * @type {yfiles.view.GraphComponent} - */ - graphComponent:yfiles.view.GraphComponent; - /** - * Gets the {@link yfiles.layout.ILayoutAlgorithm} this instance is using. - * @protected - * @type {yfiles.layout.ILayoutAlgorithm} - */ - layout:yfiles.layout.ILayoutAlgorithm; - /** - * Gets the graph this instance is working on. - * @protected - * @type {yfiles.graph.IGraph} - */ - graph:yfiles.graph.IGraph; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LayoutExecutor; - } - /** - * Adapter class that can be used to obtain an {@link yfiles.layout.LayoutGraph} from an {@link yfiles.graph.IGraph}. - *

- * Typically, this class is not used directly but through the convenience class {@link yfiles.layout.LayoutExecutor} or the - * convenience methods {@link yfiles.graph.IGraph#applyLayout} and MorphLayout - *

- *

- * This class will use the provided {@link yfiles.layout.LayoutGraphAdapter#selectionModel} to register corresponding {@link yfiles.algorithms.IDataProvider}s for the data provider keys - * {@link yfiles.layout.LayoutKeys#AFFECTED_NODES_DP_KEY} and {@link yfiles.layout.LayoutKeys#AFFECTED_EDGES_DP_KEY} to the layout graph. - * Moreover, it will automatically convert {@link yfiles.collections.IMapper.} instances registered with the {@link yfiles.graph.IMapperRegistry} of the {@link yfiles.layout.LayoutGraphAdapter#adaptedGraph} into - * corresponding {@link yfiles.algorithms.IDataProvider} instances of the layout graph. - *

- *

- * In addition, this class supports {@link yfiles.graph.IGraph}s with edge to edge connections, i.e., edges that are adjacent to - * other edges. Since such edges are not allowed in an {@link yfiles.layout.LayoutGraph}, the property {@link yfiles.layout.LayoutGraphAdapter#hideEdgesAtEdges} specifies whether these - * edges shouldn't be converted into the layout graph at all or converted into a corresponding structure with dummy nodes. - *

- *

- * The chapter {@link @DGUIDE_LAYOUT_PREFIX@/layout-applying_a_layout.html Applying an Automatic Layout} describes how automatic layout and graph analysis algorithms from the yFiles - * Layout and yFiles Basic library components can be accessed from @COMPONENT_NAME@. - *

- * @see yfiles.layout.CopiedLayoutGraph - * @see yfiles.layout.ILayoutAlgorithm - * @class - */ - export interface LayoutGraphAdapter extends yfiles.lang.Object{} - export class LayoutGraphAdapter { - /** - * Creates the adapter using a given {@link yfiles.graph.IGraph} and {@link yfiles.view.ISelectionModel.}. - * @param graph The graph to build an adapter for. - * @param [selectionModel=null] The optional selection model to use by the {@link #AFFECTED_NODES_DP_KEY} and {@link #AFFECTED_EDGES_DP_KEY} - * {@link } instances that are automatically bound to this adapter. - * @throws {Stubs.Exceptions.ArgumentError} graph is null. - */ - constructor(graph:yfiles.graph.IGraph,selectionModel?:yfiles.view.ISelectionModel); - /** - * Creates the adapter with no initial {@link yfiles.graph.IGraph} and no {@link yfiles.view.ISelectionModel.}. - *

- * Before this instance can be used for automatic layouts, you mus assign a value to the {@link yfiles.layout.LayoutGraphAdapter#adaptedGraph} property. - *

- */ - constructor(); - /** - * Registers a data provider with the graph using the given look-up key and wrapping the given mapper. - *

- * If a mapper is already registered under the given key, it is overwritten. - *

- * Type parameter K: The type of the key to use. - * Type parameter V: The type of the value to use. - * @param valueType The type of the value to use. - * @param keyType The type of the key to use. - * @param dataKey The look-up key to register the data provider with. - * @param mapper The mapper wrapped as data provider. - * @returns - * @template K,V - */ - addDataProvider(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,dataKey:any,mapper:yfiles.collections.IMapper):yfiles.algorithms.IDataProvider; - /** - * Convenience method that applies a {@link yfiles.layout.ILayoutAlgorithm layout algorithm} to an {@link yfiles.graph.IGraph}, optionally applying some - * {@link yfiles.layout.LayoutData}. - * @param layout The layout algorithm to apply. - * @param [layoutData=null] The layout data. - */ - applyLayout(layout:yfiles.layout.ILayoutAlgorithm,layoutData?:yfiles.layout.LayoutData):void; - /** - * Static convenience method that applies a {@link yfiles.layout.ILayoutAlgorithm layout algorithm} to an {@link yfiles.graph.IGraph}. - * @param layout The layout algorithm to apply. - * @param graph The graph to compute the layout on. - * @param [layoutData=null] The layout data. - * @static - */ - static applyLayout(graph:yfiles.graph.IGraph,layout:yfiles.layout.ILayoutAlgorithm,layoutData?:yfiles.layout.LayoutData):void; - /** - * Creates a {@link yfiles.layout.CopiedLayoutGraph} for this instance. - * @returns An instance whose {@link #commitLayoutToOriginalGraph} will update this instance. - */ - createCopiedLayoutGraph():yfiles.layout.CopiedLayoutGraph; - /** - * Creates the {@link yfiles.layout.EdgeLabelCandidate} for a given label and {@link yfiles.graph.ILabelModelParameter} combination. - * @param originalLabel The original label. - * @param dummyLabel The dummy label that describes the current laid out label. - * @param layoutParameter The parameter to create a candidate for. - * @param labelLayout The {@link } of the label to pass to the candidate. - * @returns A candidate to yield for the labeling algorithms or null. - */ - createEdgeLabelCandidate(originalLabel:yfiles.graph.ILabel,dummyLabel:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter,labelLayout:yfiles.layout.IEdgeLabelLayout):yfiles.layout.EdgeLabelCandidate; - /** - * Factory method that creates an {@link yfiles.layout.IEdgeLayout} implementation that wraps the given {@link yfiles.graph.IEdge} - * @param edge The edge to wrap. - * @returns A wrapper instance. - * @protected - */ - createEdgeLayout(edge:yfiles.graph.IEdge):yfiles.layout.IEdgeLayout; - /** - * Callback factory method that creates the {@link yfiles.layout.INodeLayout} for the given {@link yfiles.graph.IPort} that is used as a - * dummy to represent the port at the {@link yfiles.graph.IEdge} that owns port. - * @param port The port to create the layout for. - * @returns A suitable implementation of {@link } that uses the {@link #location port's location} as the center of the node. - * @see yfiles.layout.LayoutGraphAdapter#edgePortNodeSize - * @see yfiles.layout.LayoutGraphAdapter#hideEdgesAtEdges - * @protected - */ - createEdgePortLayout(port:yfiles.graph.IPort):yfiles.layout.INodeLayout; - /** - * Creates a {@link yfiles.layout.NodeLabelCandidate} for a given label and {@link yfiles.graph.ILabelModelParameter} combination. - * @param originalLabel The original label. - * @param dummyLabel The dummy label that describes the current laid out label. - * @param layoutParameter The parameter to create a candidate for. - * @param ownerLayout The {@link } of the label to pass to the candidate. - * @returns A candidate to yield for the labeling algorithms or null. - */ - createNodeLabelCandidate(originalLabel:yfiles.graph.ILabel,dummyLabel:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter,ownerLayout:yfiles.layout.INodeLabelLayout):yfiles.layout.NodeLabelCandidate; - /** - * Factory method that creates a {@link yfiles.layout.INodeLayout} implementation that wraps the given {@link yfiles.graph.INode} - * @param node The node to wrap. - * @returns A wrapper instance. - * @protected - */ - createNodeLayout(node:yfiles.graph.INode):yfiles.layout.INodeLayout; - /** - * - * @returns - */ - edgeObjects():yfiles.collections.IEnumerable; - /** - * - * @param dataKey - * @returns - */ - getDataProvider(dataKey:any):yfiles.algorithms.IDataProvider; - /** - * - * @param edge - * @returns - */ - getEdgeLabelLayout(edge:any):yfiles.layout.IEdgeLabelLayout[]; - /** - * - * @param edge - * @returns - */ - getEdgeLayout(edge:any):yfiles.layout.IEdgeLayout; - /** - * Callback that retrieves the label candidate descriptor for the given label and parameter. - * @param originalLabel The original label to which a parameter will be applied. - * @param dummyLabel The dummy label to which the parameter will be applied. - * @param layoutParameter The parameter to apply. - * @returns A descriptor or null. - * @see yfiles.layout.LayoutGraphAdapter#createNodeLabelCandidate - * @see yfiles.layout.LayoutGraphAdapter#createEdgeLabelCandidate - * @see yfiles.layout.LayoutGraphAdapter#getLabelCandidateDescriptorProvider - * @protected - */ - getLabelCandidateDescriptor(originalLabel:yfiles.graph.ILabel,dummyLabel:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILabelCandidateDescriptor; - /** - * Callback method that gets the label candidate descriptor provider for the given {@link yfiles.graph.IGraph}. - *

- * This implementation uses the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup} to find an implementation of the - * {@link yfiles.graph.ILabelCandidateDescriptorProvider}. - *

- * @param graph The graph. - * @returns The result of a {@link #lookup} query on graph for the {@link } type. - * @protected - */ - getLabelCandidateDescriptorProvider(graph:yfiles.graph.IGraph):yfiles.graph.ILabelCandidateDescriptorProvider; - /** - * - * @param node - * @returns - */ - getNodeLabelLayout(node:any):yfiles.layout.INodeLabelLayout[]; - /** - * - * @param o - * @returns - */ - getNodeLayout(o:any):yfiles.layout.INodeLayout; - /** - * - * @param edgeObject - * @returns - */ - getSource(edgeObject:any):any; - /** - * - * @param edgeObject - * @returns - */ - getTarget(edgeObject:any):any; - /** - * - * @returns - */ - nodeObjects():yfiles.collections.IEnumerable; - /** - * Callback method that assigns a new location that matches newLocation to port. - *

- * This method is called only for ports which are owned by edges. These are represented by dummy nodes during the layout, - * and newLocation is the position of the dummy node after the layout. - *

- * @param port The edge port that should be placed. - * @param newLocation The new location of the port as calculated by the layout algorithm. - * @protected - */ - setEdgePortLocation(port:yfiles.graph.IPort,newLocation:yfiles.geometry.Point):void; - /** - * Callback method that assigns a new relative location to port. - *

- * The default implementation calls {@link yfiles.graph.IGraph#setRelativePortLocation} with - * newRelativeLocation. Depending on the port location model, the actual resulting port location may be different. - *

- * @param port The port that should be placed. - * @param newRelativeLocation The new coordinate offsets relative to the center of the node's {@link #layout}'s center. - * @protected - */ - setRelativePortLocation(port:yfiles.graph.IPort,newRelativeLocation:yfiles.geometry.Point):void; - /** - * An {@link yfiles.graph.IMapperRegistry} tag for an {@link yfiles.collections.IMapper.} that provides for the edge {@link yfiles.graph.ILabel}s in the {@link yfiles.layout.LayoutGraphAdapter#adaptedGraph} a {@link yfiles.layout.PreferredPlacementDescriptor} - * instance. - *

- * If there is a {@link yfiles.collections.IMapper.} in the {@link yfiles.graph.IGraph#mapperRegistry} it will be queried for each {@link yfiles.graph.IEdge edge} {@link yfiles.graph.ILabel label} to set the {@link yfiles.layout.IEdgeLabelLayout#preferredPlacementDescriptor} property of the adapted implementation. - *

- * @const - * @static - * @type {yfiles.algorithms.IEdgeLabelLayoutDpKey.} - */ - static EDGE_LABEL_LAYOUT_PREFERRED_PLACEMENT_DESCRIPTOR_DP_KEY:yfiles.algorithms.IEdgeLabelLayoutDpKey; - /** - * A data provider key that can be used to look up the original {@link yfiles.graph.INode} of a {@link yfiles.algorithms.Node}. - *

- * This data provider is created automatically for a {@link yfiles.layout.CopiedLayoutGraph} that is created as a copy of an {@link yfiles.graph.IGraph} - * with the help of a {@link yfiles.layout.LayoutGraphAdapter}. Especially, it is available if the layout is run with a {@link yfiles.layout.LayoutExecutor} - * or the convenience methods MorphLayout and {@link yfiles.graph.IGraph#applyLayout}. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static ORIGINAL_NODE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * A data provider key that can be used to look up the original {@link yfiles.graph.IEdge} of an {@link yfiles.algorithms.Edge}. - *

- * This data provider is created automatically for a {@link yfiles.layout.CopiedLayoutGraph} that is created as a copy of an {@link yfiles.graph.IGraph} - * with the help of a {@link yfiles.layout.LayoutGraphAdapter}. Especially, it is available if the layout is run with a {@link yfiles.layout.LayoutExecutor} - * or the convenience methods MorphLayout and {@link yfiles.graph.IGraph#applyLayout}. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static ORIGINAL_EDGE_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * A data provider key that can be used to look up the original {@link yfiles.graph.ILabel} of an {@link yfiles.layout.INodeLabelLayout}. - *

- * This data provider is created automatically for a {@link yfiles.layout.CopiedLayoutGraph} that is created as a copy of an {@link yfiles.graph.IGraph} - * with the help of a {@link yfiles.layout.LayoutGraphAdapter}. Especially, it is available if the layout is run with a {@link yfiles.layout.LayoutExecutor} - * or the convenience methods MorphLayout and {@link yfiles.graph.IGraph#applyLayout}. - *

- * @const - * @static - * @type {yfiles.algorithms.INodeLabelLayoutDpKey.} - */ - static ORIGINAL_NODE_LABEL_DP_KEY:yfiles.algorithms.INodeLabelLayoutDpKey; - /** - * A data provider key that can be used to look up the original {@link yfiles.graph.ILabel} of an {@link yfiles.layout.IEdgeLabelLayout}. - *

- * This data provider is created automatically for a {@link yfiles.layout.CopiedLayoutGraph} that is created as a copy of an {@link yfiles.graph.IGraph} - * with the help of a {@link yfiles.layout.LayoutGraphAdapter}. Especially, it is available if the layout is run with a {@link yfiles.layout.LayoutExecutor} - * or the convenience methods MorphLayout and {@link yfiles.graph.IGraph#applyLayout}. - *

- * @const - * @static - * @type {yfiles.algorithms.IEdgeLabelLayoutDpKey.} - */ - static ORIGINAL_EDGE_LABEL_DP_KEY:yfiles.algorithms.IEdgeLabelLayoutDpKey; - /** - * A data provider key that can be used to look up the {@link yfiles.graph.IPort source port} of the original {@link yfiles.graph.IEdge} of an - * {@link yfiles.algorithms.Edge}. - *

- * This data provider is created automatically for a {@link yfiles.layout.CopiedLayoutGraph} that is created as a copy of an {@link yfiles.graph.IGraph} - * with the help of a {@link yfiles.layout.LayoutGraphAdapter}. Especially, it is available if the layout is run with a {@link yfiles.layout.LayoutExecutor} - * or the convenience methods MorphLayout and {@link yfiles.graph.IGraph#applyLayout}. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static ORIGINAL_SOURCE_PORT_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * A data provider key that can be used to look up the {@link yfiles.graph.IPort target port} of the original {@link yfiles.graph.IEdge} of an - * {@link yfiles.algorithms.Edge}. - *

- * This data provider is created automatically for a {@link yfiles.layout.CopiedLayoutGraph} that is created as a copy of an {@link yfiles.graph.IGraph} - * with the help of a {@link yfiles.layout.LayoutGraphAdapter}. Especially, it is available if the layout is run with a {@link yfiles.layout.LayoutExecutor} - * or the convenience methods MorphLayout and {@link yfiles.graph.IGraph#applyLayout}. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static ORIGINAL_TARGET_PORT_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * A data provider key that can be used to look up the original unconnected{@link yfiles.graph.IPort ports} of the original {@link yfiles.graph.IPortOwner} of an {@link yfiles.algorithms.Node} - * or, in the case of edge-to-edge connections, an {@link yfiles.algorithms.Edge}. - *

- * You can access all (connected and unconnected) ports through the {@link yfiles.graph.IPortOwner#ports} property of the original {@link yfiles.graph.IGraph} elements, - * which can be retrieved through the {@link yfiles.layout.LayoutGraphAdapter#ORIGINAL_NODE_DP_KEY} and {@link yfiles.layout.LayoutGraphAdapter#ORIGINAL_EDGE_DP_KEY} - * data providers. The information about whether a port is connected or not is not readily accessible from there, though. - * You can use this data provider to specifically find these port, e.g. to create additional - * {@link yfiles.layout.PortCandidate}s or just reserve space for them. - *

- *

- * This data provider is created automatically for a {@link yfiles.layout.CopiedLayoutGraph} that is created as a copy of an {@link yfiles.graph.IGraph} - * with the help of a {@link yfiles.layout.LayoutGraphAdapter}. Especially, it is available if the layout is run with a {@link yfiles.layout.LayoutExecutor} - * or the convenience methods MorphLayout and {@link yfiles.graph.IGraph#applyLayout}. - *

- * @const - * @static - * @type {yfiles.algorithms.GraphObjectDpKey.>} - */ - static UNCONNECTED_PORTS_DP_KEY:yfiles.algorithms.GraphObjectDpKey>; - /** - * This key is used to provide information about dummy nodes that have been inserted into the graph to model edges at - * edges. - *

- * This key can be used to query an {@link yfiles.algorithms.IDataProvider} that yields true for {@link yfiles.algorithms.IDataProvider#getBoolean} - * for nodes that are actually representatives of {@link yfiles.graph.IPort}s at {@link yfiles.graph.IEdge}s. Also the {@link yfiles.algorithms.IDataProvider#get} - * method will yield the corresponding original {@link yfiles.graph.IEdge}. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static PORT_DUMMY_NODE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Sets or yields the original {@link yfiles.graph.IGraph} instance that is adapted by this instance. - *

- * Before performing a layout, this property must be set or the adapter must have been created with - * {@link yfiles.layout.LayoutGraphAdapter#LayoutGraphAdapter}. Note that this property cannot be assigned again if its value is - * already non null. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the value of this property is already non null - * @type {yfiles.graph.IGraph} - */ - adaptedGraph:yfiles.graph.IGraph; - /** - * Gets or sets the {@link yfiles.view.ISelectionModel.} to use for the automatically registered {@link yfiles.algorithms.IDataProvider} instances for the keys {@link yfiles.layout.LayoutKeys#AFFECTED_NODES_DP_KEY} - * and {@link yfiles.layout.LayoutKeys#AFFECTED_EDGES_DP_KEY}. - * @type {yfiles.view.ISelectionModel.} - */ - selectionModel:yfiles.view.ISelectionModel; - /** - * Gets or sets the size of the nodes that are inserted for the ports that are created for {@link yfiles.graph.IEdge}s that are - * connected at other {@link yfiles.graph.IEdge}s. - *

- * If this instance is configured to create dummy nodes for ports at edges, this will be the initial size of the dummy - * nodes with the center of the node always being the location of the port. The default is 3x3. - *

- * @see yfiles.layout.LayoutGraphAdapter#hideEdgesAtEdges - * @type {yfiles.geometry.Size} - */ - edgePortNodeSize:yfiles.geometry.Size; - /** - * Determines whether edges at other edges will be hidden from the layout graph or included. - *

- * If this property is set to true, edges at other edges are simply ignored and not part of the layout graph. The default - * is false in which case dummy nodes are inserted into the layout graph for each source and target port of an {@link yfiles.graph.IEdge} - * that is {@link yfiles.graph.IPort#owner owned} by an {@link yfiles.graph.IEdge}. - *

- * @see yfiles.layout.LayoutGraphAdapter#edgePortNodeSize - * @type {boolean} - */ - hideEdgesAtEdges:boolean; - /** - * Controls whether edge groups are automatically created for edges that are connected to the same port. - *

- * If this property is enabled and no edge groups are explicitly created ({@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} - * and {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY}), for all ports with multiple outgoing resp. incoming edges - * these edges will be assigned to the same edge group. The necessary - * {@link yfiles.algorithms.IDataProvider}s will be created automatically. - *

- *

- * This features requires edge group support from the {@link yfiles.layout.ILayoutAlgorithm}. - *

- *

- * Default value is true - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @see yfiles.layout.LayoutExecutor#automaticEdgeGrouping - * @see yfiles.layout.LayoutGraphAdapter#fixPorts - * @type {boolean} - */ - automaticEdgeGrouping:boolean; - /** - * Controls whether strong port constraints are automatically created. - *

- * If this property is enabled and no port constraints are explicitly created ({@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} - * and {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY}), for all edges strong source and target point - * constraints with {@link yfiles.layout.PortSide#ANY} are created. The necessary - * {@link yfiles.algorithms.IDataProvider}s will be created automatically. - *

- *

- * This ensures that view {@link yfiles.graph.IPort}s are not moved during the layout, if the {@link yfiles.layout.ILayoutAlgorithm} - * supports port constraints. - *

- *

- * Default value is false - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @see yfiles.layout.LayoutExecutor#fixPorts - * @see yfiles.layout.LayoutGraphAdapter#automaticEdgeGrouping - * @type {boolean} - */ - fixPorts:boolean; - /** - * - * @type {Array.} - */ - dataProviderKeys:any[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.LayoutGraphAdapter; - } - /** - * Specifies a {@link yfiles.layout.PartitionGrid} for a layout. - *

- * The {@link yfiles.layout.PartitionCellId} mapping has to be specified by either setting the {@link yfiles.layout.PartitionGridData#cellIds} property, or either or both of the - * {@link yfiles.layout.PartitionGridData#rowIndices} and {@link yfiles.layout.PartitionGridData#columnIndices} properties. When {@link yfiles.layout.PartitionGridData#cellIds} is set, the {@link yfiles.layout.PartitionGridData#grid} property must be set as well. Otherwise the size of the grid may be induced by the - * maximum row and column indices returned by {@link yfiles.layout.PartitionGridData#rowIndices} and {@link yfiles.layout.PartitionGridData#columnIndices}. - *

- *

- * Note that cell spanning is only supported using the {@link yfiles.layout.PartitionGridData#cellIds}. - *

- * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface PartitionGridData extends yfiles.layout.LayoutData{} - export class PartitionGridData { - constructor(); - /** - * Gets or sets the partition grid. - * @see yfiles.layout.PartitionGrid#PARTITION_GRID_DP_KEY - * @type {yfiles.layout.PartitionGrid} - */ - grid:yfiles.layout.PartitionGrid; - /** - * Gets or sets the mapping from nodes to {@link yfiles.layout.PartitionCellId} using the partition grid as context. - * @type {yfiles.layout.ContextItemMapping.} - */ - cellIds:yfiles.layout.ContextItemMapping; - /** - * Gets or sets the mapping from nodes to the index of their rows. - * @type {yfiles.layout.ItemMapping.} - */ - rowIndices:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to the index of their columns. - * @type {yfiles.layout.ItemMapping.} - */ - columnIndices:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PartitionGridData; - } - /** - * Specifies custom data for the {@link yfiles.layout.PartitionLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface PartitionLayoutData extends yfiles.layout.LayoutData{} - export class PartitionLayoutData { - constructor(); - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to a collection of their source port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - sourcePortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from edges to a collection of their target port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - targetPortCandidates:yfiles.layout.ItemMapping>; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.PartitionLayoutData; - } - /** - * Specifies custom data for the {@link yfiles.layout.RecursiveGroupLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface RecursiveGroupLayoutData extends yfiles.layout.LayoutData{} - export class RecursiveGroupLayoutData { - constructor(); - /** - * Gets or sets the mapping from group nodes to the {@link yfiles.layout.ILayoutAlgorithm} used for their child nodes. - * @see yfiles.layout.RecursiveGroupLayout#GROUP_NODE_LAYOUT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - groupNodeLayouts:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges connecting to group nodes to source split ids. - *

- * Edges will be aligned with edges that connect to the same group node and have the same split id at their source - * (preferably) or target. - *

- * @see yfiles.layout.RecursiveGroupLayout#SOURCE_SPLIT_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourceSplitIds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges connecting to group nodes to target split ids. - *

- * Edges will be aligned with edges that connect to the same group node and have the same split id at their source or - * target (preferably). - *

- * @see yfiles.layout.RecursiveGroupLayout#TARGET_SPLIT_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetSplitIds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to a collection of their source port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - sourcePortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from edges to a collection of their target port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - targetPortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from nodes to their {@link yfiles.layout.PortCandidateSet}. - * @see yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodePortCandidateSets:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.RecursiveGroupLayoutData; - } - /** - * Specifies custom data for the {@link yfiles.layout.ReverseEdgesStage}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface ReverseEdgesStageData extends yfiles.layout.LayoutData{} - export class ReverseEdgesStageData { - constructor(); - /** - * Gets or sets the collection of affected edges. - * @see yfiles.layout.ReverseEdgesStage#AFFECTED_EDGES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - affectedEdges:yfiles.layout.ItemCollection; - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their source edge group. - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourceGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their target edge group. - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetGroupIds:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.ReverseEdgesStageData; - } - /** - * Provides different ways to define the items in a collection for use with - * {@link yfiles.layout.LayoutData}, especially if the collection contains only one item. - *

- * Only one of the provided ways to define a collection can be used at the same time, therefore only one of the properties - * {@link yfiles.layout.SingleItemCollection.#item}, {@link yfiles.layout.ItemCollection.#items}, {@link yfiles.layout.ItemCollection.#mapper}, and {@link yfiles.layout.ItemCollection.#delegate} should be set on each instance. - *

- *

- * This class supports {@link yfiles.layout.LayoutData} implementations and does not usually have to be used explicitly. - *

- * Type parameter V: The type of the items in the collection. - * @class - * @extends {yfiles.layout.ItemCollection.} - * @template V - */ - export interface SingleItemCollection extends yfiles.layout.ItemCollection{} - export class SingleItemCollection { - constructor(); - /** - * Gets or sets the single item this item collection contains. - * @type {V} - */ - item:V; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.SingleItemCollection; - } - /** - * Creates a {@link yfiles.layout.PartitionGrid} that matches a given table configuration of an {@link yfiles.graph.IGraph} and registers {@link yfiles.collections.IMapper.} - * for that grid at the graph. - *

- * Typically, this class is used as part of the convenience class {@link yfiles.layout.LayoutExecutor} to {@link yfiles.layout.TableLayoutConfigurator#prepare} - * a partition grid before the layout is calculated and {@link yfiles.layout.TableLayoutConfigurator#restore} the graph - * afterwards. - *

- * @class - */ - export interface TableLayoutConfigurator extends yfiles.lang.Object{} - export class TableLayoutConfigurator { - /** - * Destroy all information that results from a previous {@link yfiles.layout.TableLayoutConfigurator#prepare} and a subsequent - * layout - * @param graph - */ - cleanUp(graph:yfiles.graph.IGraph):void; - /** - * Return the sizes of all leaf rows. - *

- * This method does not modify originalTable. You also need to call {@link yfiles.layout.TableLayoutConfigurator#cleanUp} - * explicitly if you don't need the {@link yfiles.layout.TableLayoutConfigurator} anymore. - *

- * @param originalTable The table - * @param nodeLayout The final layout of the node that owns the table - * @returns The sizes of all leaf rows in originalTable, in their natural order. - */ - getColumnLayout(originalTable:yfiles.graph.ITable,nodeLayout:yfiles.geometry.Rect):number[]; - /** - * Return the sizes of all leaf rows. - *

- * This method does not modify originalTable. You also need to call {@link yfiles.layout.TableLayoutConfigurator#cleanUp} - * explicitly if you don't need the {@link yfiles.layout.TableLayoutConfigurator} anymore. - *

- * @param originalTable The table - * @param nodeLayout The final layout of the node that owns the table - * @returns The sizes of all leaf rows in originalTable, in their natural order. - */ - getRowLayout(originalTable:yfiles.graph.ITable,nodeLayout:yfiles.geometry.Rect):number[]; - /** - * Setup partition grid information from a graph that contains table structures - * @param graph - */ - prepare(graph:yfiles.graph.IGraph):void; - /** - * Write back all information from the partition grid - * @param graph - */ - restore(graph:yfiles.graph.IGraph):void; - /** - * Gets or sets the minimum distance between two different table nodes - * @type {number} - */ - minimumTableDistance:number; - /** - * Specifies whether or not to enable size compaction for table nodes. - *

- * If size compaction is enabled, the size of a column or row (or a table node for that matter) may be reduced due to - * layout calculation, but never below the column's or row's minimum size. If size compaction is disabled, columns and rows - * (and therefore table nodes) may only grow due to layout calculation. - *

- *

- * The default value for this property is true. - *

- * @type {boolean} - */ - compaction:boolean; - /** - * Gets or sets whether the configurator will prepare its associated graph for a vertical (that is top-to-bottom or - * bottom-to-top) layout calculation or a horizontal (that is left-to-right or right-to-left) one. - *

- * The default value for this property is false. - *

- * @type {boolean} - */ - horizontalLayout:boolean; - /** - * Specifies whether or not from sketch mode should be enabled. - *

- * If enabled, the positions of the table group nodes are considered, i.e., for horizontal layout configuration these nodes - * are sorted according to their y-coordinate and for vertical layout configuration according to their x-coordinate. - *

- * @type {boolean} - */ - fromSketch:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.TableLayoutConfigurator; - } - /** - * Converts an {@link yfiles.graph.IGraph} instance into a {@link yfiles.algorithms.Graph} instance. - *

- * This class creates a structural copy of a given {@link yfiles.graph.IGraph} and provides convenience methods to convert items - * from one graph instance to their corresponding item in the other graph instance. - *

- *

- * The main use case of this class is executing one of the analysis algorithms on an {@link yfiles.graph.IGraph}, for example - * {@link yfiles.algorithms.ShortestPaths}, {@link yfiles.algorithms.Cycles}, and {@link yfiles.algorithms.Centrality}. For executing a layout - * algorithm, use the convenience class {@link yfiles.layout.LayoutExecutor}, the convenience methods {@link yfiles.graph.IGraph#applyLayout} - * and MorphLayout, or {@link yfiles.layout.LayoutGraphAdapter}. - *

- * @see yfiles.layout.LayoutGraphAdapter - * @see yfiles.layout.LayoutExecutor - * @see yfiles.algorithms.Bipartitions - * @see yfiles.algorithms.Centrality - * @see yfiles.algorithms.Cycles - * @see yfiles.algorithms.GraphChecker - * @see yfiles.algorithms.GraphConnectivity - * @see yfiles.algorithms.Groups - * @see yfiles.algorithms.IndependentSets - * @see yfiles.algorithms.NetworkFlows - * @see yfiles.algorithms.NodeOrders - * @see yfiles.algorithms.Paths - * @see yfiles.algorithms.RankAssignments - * @see yfiles.algorithms.ShortestPaths - * @see yfiles.algorithms.SpanningTrees - * @see yfiles.algorithms.Transitivity - * @see yfiles.algorithms.Trees - * @class - */ - export interface YGraphAdapter extends yfiles.lang.Object{} - export class YGraphAdapter { - /** - * Initializes a new instance of the {@link yfiles.layout.YGraphAdapter} class. - *

- * This will create a copy of the originalGraph that has the same structure and makes it available via the {@link yfiles.layout.YGraphAdapter#yGraph} property. - *

- * @param originalGraph The original graph whose structure will be copied. - */ - constructor(originalGraph:yfiles.graph.IGraph); - /** - * Creates an {@link yfiles.algorithms.IDataMap} that delegates to the provided {@link yfiles.collections.IMapper.} when queried for items in the {@link yfiles.layout.YGraphAdapter#yGraph}. - *

- * This method is useful where algorithms require {@link yfiles.algorithms.IDataMap}s as input and that input can be obtained from - * {@link yfiles.collections.IMapper.} instances that provide and accept values for the {@link yfiles.layout.YGraphAdapter#getOriginalNode original nodes} and {@link yfiles.layout.YGraphAdapter#getOriginalEdge edges}. - *

- * Type parameter K: The type of the keys in the mapper. - * Type parameter V: The type of the values in the mapper. - * @param valueType The type of the values in the mapper. - * @param keyType The type of the keys in the mapper. - * @param mapper The mapper to direct requests to. - * @returns An {@link } that will delegate the functionality to the mapper. - * @see yfiles.layout.YGraphAdapter#createDataProvider - * @template K,V - */ - createDataMap(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,mapper:yfiles.collections.IMapper):yfiles.algorithms.IDataMap; - /** - * Creates an {@link yfiles.algorithms.IDataProvider} that delegates to the provided delegate when queried for items in the {@link yfiles.layout.YGraphAdapter#yGraph}. - *

- * This method is useful where algorithms require {@link yfiles.algorithms.IDataProvider}s as input and that input can be through a - * dynamic callback that provides the values for the {@link yfiles.layout.YGraphAdapter#getOriginalNode original nodes} and {@link yfiles.layout.YGraphAdapter#getOriginalEdge edges}. - *

- * Type parameter K: The type of the keys in the mapper. - * Type parameter V: The type of the values in the mapper. - * @param valueType The type of the values in the mapper. - * @param keyType The type of the keys in the mapper. - * @param getter The mapper delegate to direct requests to. - * @returns A DataProvider that will delegate requests to the getter. - * @template K,V - */ - createDataProvider(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,getter:(key:K)=>V):yfiles.algorithms.IDataProvider; - /** - * Creates an {@link yfiles.algorithms.IDataProvider} that delegates to the provided {@link yfiles.collections.IMapper.} when queried for items in the {@link yfiles.layout.YGraphAdapter#yGraph}. - *

- * This method is useful where algorithms require {@link yfiles.algorithms.IDataProvider}s as input and that input can be obtained - * from {@link yfiles.collections.IMapper.} instances that provide the values for the {@link yfiles.layout.YGraphAdapter#getOriginalNode original nodes} and {@link yfiles.layout.YGraphAdapter#getOriginalEdge edges}. - *

- * Type parameter K: The type of the keys in the mapper. - * Type parameter V: The type of the values in the mapper. - * @param valueType The type of the values in the mapper. - * @param keyType The type of the keys in the mapper. - * @param mapper The mapper to direct requests to. - * @returns A DataProvider that will delegate requests to the mapper. - * @template K,V - */ - createDataProvider(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,mapper:yfiles.collections.IMapper):yfiles.algorithms.IDataProvider; - /** - * Creates an {@link yfiles.collections.IEnumerable. enumerable of edges} that maps the edges from the {@link yfiles.algorithms.EdgeList} to their {@link yfiles.layout.YGraphAdapter#getOriginalEdge original} ones. - *

- * This method is useful where algorithms yield {@link yfiles.algorithms.EdgeList} instances as results and the result needs to be - * interpreted in terms of the {@link yfiles.layout.YGraphAdapter#originalGraph}. - *

- * @param edges The edge list. - * @returns An enumerable that contains the {@link #getOriginalEdge original} edges for the ones in the list. - */ - createEdgeEnumerable(edges:yfiles.algorithms.EdgeList):yfiles.collections.IListEnumerable; - /** - * Creates an {@link yfiles.algorithms.EdgeList} that maps the edges from the {@link yfiles.collections.IEnumerable.} to their {@link yfiles.layout.YGraphAdapter#getCopiedEdge copied} ones. - *

- * This method is useful where algorithms require {@link yfiles.algorithms.EdgeList} instances as input and those edges are - * available as {@link yfiles.collections.IEnumerable.}s in the {@link yfiles.layout.YGraphAdapter#originalGraph}. - *

- * @param edges The edges from the {@link #originalGraph}. - * @returns An {@link } that contains the {@link #getCopiedEdge copied} edges for the ones in the enumerable. - */ - createEdgeList(edges:yfiles.collections.IEnumerable):yfiles.algorithms.EdgeList; - /** - * Creates an {@link yfiles.algorithms.IEdgeMap} that delegates to the provided delegate when queried for {@link yfiles.algorithms.Edge}s - * in the {@link yfiles.layout.YGraphAdapter#yGraph}. - *

- * This method is useful where algorithms require {@link yfiles.algorithms.IEdgeMap}s as input and this can be mapped to a - * corresponding dynamic callback that provides the values for the {@link yfiles.layout.YGraphAdapter#getOriginalEdge original edges}. - *

- * Type parameter V: The type of the values in the mapper. - * @param getter The mapper delegate to direct read requests to. - * @returns An {@link } that will delegate reads to the getter. - * @template V - */ - createEdgeMap(getter:(key:yfiles.graph.IEdge)=>V):yfiles.algorithms.IEdgeMap; - /** - * Creates an {@link yfiles.algorithms.IEdgeMap} that delegates to the provided {@link yfiles.collections.IMapper.} when queried for {@link yfiles.algorithms.Edge}s in the {@link yfiles.layout.YGraphAdapter#yGraph}. - *

- * This method is useful where algorithms require {@link yfiles.algorithms.IEdgeMap}s as input and this can be mapped to - * corresponding {@link yfiles.collections.IMapper.} instances that provide and accept the values for the {@link yfiles.layout.YGraphAdapter#getOriginalEdge original edges}. - *

- * Type parameter V: The type of the values in the mapper. - * @param mapper The mapper to direct requests to. - * @returns An {@link } that will delegate reads and writes to the mapper. - * @template V - */ - createEdgeMap(mapper:yfiles.collections.IMapper):yfiles.algorithms.IEdgeMap; - /** - * Creates an {@link yfiles.collections.IMapper.} that delegates to the provided {@link yfiles.algorithms.INodeMap} when queried for items in the - * {@link yfiles.graph.IGraph}. - *

- * This method is useful where algorithms yield {@link yfiles.algorithms.INodeMap}s and their values should be provided using {@link yfiles.collections.IMapper.} - * instances that use the {@link yfiles.layout.YGraphAdapter#getOriginalNode original nodes}. - *

- * Type parameter T: The type of the values in the mapper. - * @param nodeMap The map to direct requests to. - * @returns A mapper that will delegate requests to the nodeMap. - * @template T - */ - createEdgeMapper(nodeMap:yfiles.algorithms.INodeMap):yfiles.collections.IMapper; - /** - * Creates an {@link yfiles.collections.IMapper.} that delegates to the provided {@link yfiles.algorithms.IDataProvider} when queried for items in the - * {@link yfiles.graph.IGraph}. - *

- * This method is useful where algorithms yield {@link yfiles.algorithms.IDataProvider}s and their values should be provided using - * {@link yfiles.collections.IMapper.} instances that use the {@link yfiles.layout.YGraphAdapter#getOriginalEdge original edges} and the {@link yfiles.layout.YGraphAdapter#getOriginalNode original nodes}. - *

- * Type parameter T: The type of the values in the mapper. - * @param dataProvider The provider to direct requests to. - * @returns A mapper that will delegate requests to the dataProvider. - * @template T - */ - createMapper(dataProvider:yfiles.algorithms.IDataProvider):yfiles.collections.IMapper; - /** - * Creates an {@link yfiles.collections.IEnumerable. enumerable of nodes} that maps the nodes from the {@link yfiles.algorithms.NodeList} to their {@link yfiles.layout.YGraphAdapter#getOriginalNode original} ones. - *

- * This method is useful where algorithms yield {@link yfiles.algorithms.NodeList} instances as results and the result needs to be - * interpreted in terms of the {@link yfiles.layout.YGraphAdapter#originalGraph}. - *

- * @param nodes The node list. - * @returns An enumerable that contains the {@link #getOriginalNode original} nodes for the ones in the list. - */ - createNodeEnumerable(nodes:yfiles.algorithms.NodeList):yfiles.collections.IListEnumerable; - /** - * Creates a {@link yfiles.algorithms.NodeList} that maps the nodes from the {@link yfiles.collections.IEnumerable.} to their {@link yfiles.layout.YGraphAdapter#getCopiedNode copied} ones. - *

- * This method is useful where algorithms require {@link yfiles.algorithms.NodeList} instances as input and those nodes are - * available as {@link yfiles.collections.IEnumerable.}s in the {@link yfiles.layout.YGraphAdapter#originalGraph}. - *

- * @param nodes The nodes from the {@link #originalGraph}. - * @returns A {@link } that contains the {@link #getCopiedNode copied} nodes for the ones in the enumerable. - */ - createNodeList(nodes:yfiles.collections.IEnumerable):yfiles.algorithms.NodeList; - /** - * Creates an {@link yfiles.algorithms.INodeMap} that delegates to the provided delegate when queried for {@link yfiles.algorithms.Node}s - * in the {@link yfiles.layout.YGraphAdapter#yGraph}. - *

- * This method is useful where algorithms require {@link yfiles.algorithms.INodeMap}s as input and this can be mapped to a - * corresponding dynamic callback that provides the values for the {@link yfiles.layout.YGraphAdapter#getOriginalNode original nodes}. - *

- * Type parameter V: The type of the values in the mapper. - * @param getter The mapper delegate to direct read requests to. - * @returns An {@link } that will delegate reads to the getter. - * @template V - */ - createNodeMap(getter:(key:yfiles.graph.INode)=>V):yfiles.algorithms.INodeMap; - /** - * Creates an {@link yfiles.algorithms.INodeMap} that delegates to the provided {@link yfiles.collections.IMapper.} when queried for {@link yfiles.algorithms.Node}s in the {@link yfiles.layout.YGraphAdapter#yGraph}. - *

- * This method is useful where algorithms require {@link yfiles.algorithms.INodeMap}s as input and this can be mapped to - * corresponding {@link yfiles.collections.IMapper.} instances that provide and accept the values for the {@link yfiles.layout.YGraphAdapter#getOriginalNode original nodes}. - *

- * Type parameter V: The type of the values in the mapper. - * @param mapper The mapper to direct requests to. - * @returns An {@link } that will delegate reads and writes to the mapper. - * @template V - */ - createNodeMap(mapper:yfiles.collections.IMapper):yfiles.algorithms.INodeMap; - /** - * Creates an {@link yfiles.collections.IMapper.} that delegates to the provided {@link yfiles.algorithms.IEdgeMap} when queried for items in the - * {@link yfiles.graph.IGraph}. - *

- * This method is useful where algorithms yield {@link yfiles.algorithms.IDataProvider}s and their values should be provided using - * {@link yfiles.collections.IMapper.} instances that use the {@link yfiles.layout.YGraphAdapter#getOriginalEdge original edges}. - *

- * Type parameter T: The type of the values in the mapper. - * @param edgeMap The map to direct requests to. - * @returns A mapper that will delegate requests to the edgeMap. - * @template T - */ - createNodeMapper(edgeMap:yfiles.algorithms.IEdgeMap):yfiles.collections.IMapper; - /** - * Yields the edge that has been created as a copy in {@link yfiles.layout.YGraphAdapter#yGraph} to represent the given edge. - * @param edge The edge for which the representation is returned. - * @returns The edge that represents edge in {@link #yGraph}. - */ - getCopiedEdge(edge:yfiles.graph.IEdge):yfiles.algorithms.Edge; - /** - * Yields the node that has been created as a copy in {@link yfiles.layout.YGraphAdapter#yGraph} to represent the given node. - * @param node The node for which the representation is returned. - * @returns The node that represents node in {@link #yGraph}. - */ - getCopiedNode(node:yfiles.graph.INode):yfiles.algorithms.Node; - /** - * Yields the original edge from the {@link yfiles.layout.YGraphAdapter#originalGraph original IGraph} that the given edge has been created for. - * @param edge The edge for which the original instance will be returned. - * @returns The original instance. - */ - getOriginalEdge(edge:yfiles.algorithms.Edge):yfiles.graph.IEdge; - /** - * Yields the original node from the {@link yfiles.layout.YGraphAdapter#originalGraph original IGraph} that the given node has been created for. - * @param node The node for which the original instance will be returned. - * @returns The original instance. - */ - getOriginalNode(node:yfiles.algorithms.Node):yfiles.graph.INode; - /** - * Gets the graph instance that is created during the constructor call. - * @type {yfiles.algorithms.Graph} - */ - yGraph:yfiles.algorithms.Graph; - /** - * Gets the original graph instance. - * @type {yfiles.graph.IGraph} - */ - originalGraph:yfiles.graph.IGraph; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.layout.YGraphAdapter; - } - }export namespace hierarchic{ - /** - * This interface describes a layering constraint. - *

- * Such constraints can be given as additional input to the {@link yfiles.hierarchic.HierarchicLayout}. - *

- * @see yfiles.hierarchic.ILayerConstraintFactory - * @interface - */ - export interface ILayerConstraint extends yfiles.lang.Object{ - /** - * Gets or sets the priority of a constraint. - *

- * This value is used for resolving conflicting constraints. A constraint with a higher priority is more likely to be - * considered. - *

- *

- * The priority has to be greater than 0. - *

- * @abstract - * @type {number} - */ - priority:number; - } - var ILayerConstraint:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.ILayerConstraint; - }; - /** - * This interface provides methods for creating layering constraints. - * @interface - */ - export interface ILayerConstraintFactory extends yfiles.lang.Object{ - /** - * Adds a constraint that forces the {@link yfiles.algorithms.Node} with ID aboveId to lie at least minDistance layers above the {@link yfiles.algorithms.Node} - * with ID referenceId with a given weight penalty for larger layer differences. - *

- * The minimum distance includes potentially empty layers that are removed by the {@link yfiles.hierarchic.ILayerer} instance. In - * that case, the actual layer difference may be smaller than the minimum distance. - *

- * @param referenceId the ID of the reference node - * @param aboveId the ID of the node that should lie above - * @param minDistance the minimum layer distance between the node and its reference node - * @param [weight=0] the weight penalty for larger layer differences - * @returns a {@link } object that represents the constraint - * @see yfiles.hierarchic.ILayerConstraint - * @abstract - */ - addPlaceNodeAboveConstraint(referenceId:any,aboveId:any,minDistance:number,weight?:number):yfiles.hierarchic.ILayerConstraint; - /** - * Adds a constraint that forces the {@link yfiles.algorithms.Node} with ID aboveId to lie above the {@link yfiles.algorithms.Node} with ID - * referenceId. - * @param referenceId the ID of the reference node - * @param aboveId the ID of the node that should lie above - * @returns a {@link } object that represents the constraint - * @see yfiles.hierarchic.ILayerConstraint - * @abstract - */ - addPlaceNodeAboveConstraint(referenceId:any,aboveId:any):yfiles.hierarchic.ILayerConstraint; - /** - * Adds a constraint that places a {@link yfiles.algorithms.Node} on the bottom layer. - * @param nodeId the ID of the node that should lie on the bottom layer - * @returns a {@link } object that represents the constraint - * @see yfiles.hierarchic.ILayerConstraint - * @abstract - */ - addPlaceNodeAtBottomConstraint(nodeId:any):yfiles.hierarchic.ILayerConstraint; - /** - * Adds a constraint that places a {@link yfiles.algorithms.Node} on the topmost layer. - * @param nodeId the ID of the node that should lie on the top layer - * @returns a {@link } object that represents the constraint - * @see yfiles.hierarchic.ILayerConstraint - * @abstract - */ - addPlaceNodeAtTopConstraint(nodeId:any):yfiles.hierarchic.ILayerConstraint; - /** - * Adds a constraint that forces the {@link yfiles.algorithms.Node} with ID belowId to lie at least minDistance layers below the {@link yfiles.algorithms.Node} - * with ID referenceId with a given weight penalty for larger layer differences. - *

- * The minimum distance includes potentially empty layers that are removed by the {@link yfiles.hierarchic.ILayerer} instance. In - * that case, the actual layer difference may be smaller than the minimum distance. - *

- * @param referenceId the ID of the reference node - * @param belowId the ID of the node that should lie below - * @param minDistance the minimum layer distance between the node and its reference node - * @param [weight=0] the weight penalty for larger layer differences - * @returns a {@link } object that represents the constraint - * @see yfiles.hierarchic.ILayerConstraint - * @abstract - */ - addPlaceNodeBelowConstraint(referenceId:any,belowId:any,minDistance:number,weight?:number):yfiles.hierarchic.ILayerConstraint; - /** - * Adds a constraint that forces a {@link yfiles.algorithms.Node} with ID belowId to lie below the {@link yfiles.algorithms.Node} with ID - * referenceId. - * @param referenceId the ID of the reference node - * @param belowId the ID of the node that should lie below - * @returns a {@link } object that represents the constraint - * @see yfiles.hierarchic.ILayerConstraint - * @abstract - */ - addPlaceNodeBelowConstraint(referenceId:any,belowId:any):yfiles.hierarchic.ILayerConstraint; - /** - * Adds a constraint that forces the {@link yfiles.algorithms.Node} with ID sameLayerId to lie in the same layer as the {@link yfiles.algorithms.Node} - * with ID referenceId. - * @param referenceId the ID of the reference node - * @param sameLayerId the ID of the node that should lie in the same layer - * @returns a {@link } object that represents the constraint - * @see yfiles.hierarchic.ILayerConstraint - * @abstract - */ - addPlaceNodeInSameLayerConstraint(referenceId:any,sameLayerId:any):yfiles.hierarchic.ILayerConstraint; - /** - * Disposes this factory. - *

- * This method should be called when this factory is not needed anymore, i.e. after the layout has been calculated. Calling - * this method also clears all constraints. - *

- * @abstract - */ - dispose():void; - /** - * Clears all constraints for a given {@link yfiles.algorithms.Node}. - * @param nodeId the ID of the node for which all constraints should be cleared - * @see yfiles.hierarchic.ILayerConstraint - * @abstract - */ - removeConstraints(nodeId:any):void; - /** - * Gets a token that allows to bind a constraint factory to a graph instance after creation. - *

- * This method should only be used if the constraint factory is not bound to a graph instance initially. It allows to bind - * this factory to a graph instance after creation. See the factory methods that create instances of this interface for a - * description. - *

- * @see yfiles.hierarchic.HierarchicLayout#createLayerConstraintFactory - * @abstract - * @type {any} - */ - memento:any; - } - var ILayerConstraintFactory:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.ILayerConstraintFactory; - }; - /** - * This interface specifies the general contract for factory classes that can be used to associate sequence constraints - * with a graph. - *

- * Sequence constraints affect the sequence of nodes within a {@link yfiles.hierarchic.ILayer layer}. - *

- *

- * A {@link yfiles.hierarchic.ISequenceConstraintFactory} has to be {@link yfiles.hierarchic.ISequenceConstraintFactory#dispose disposed of} after use. Disposing of the factory will also - * remove all constraints previously specified for the factory's associated graph. - *

- * @interface - */ - export interface ISequenceConstraintFactory extends yfiles.lang.Object{ - /** - * Adds a constraint that forces the {@link yfiles.algorithms.Node} or {@link yfiles.algorithms.Edge} with id after to lie after the {@link yfiles.algorithms.Node} - * or {@link yfiles.algorithms.Edge} with id reference. - * @param referenceId the ID of the reference node or edge - * @param afterId the ID of the node or edge that should be placed after the reference element - * @abstract - */ - addPlaceAfterConstraint(referenceId:any,afterId:any):void; - /** - * Adds a constraint that places a {@link yfiles.algorithms.Node} or {@link yfiles.algorithms.Edge} at the start of the sequence. - * @param id the ID of the node or edge that should be placed at the start - * @abstract - */ - addPlaceAtHeadConstraint(id:any):void; - /** - * Adds a constraint that places a {@link yfiles.algorithms.Node} or {@link yfiles.algorithms.Edge} at the end of the sequence. - * @param id the ID of the node or edge that should be placed at the end - * @abstract - */ - addPlaceAtTailConstraint(id:any):void; - /** - * Adds a constraint that forces the {@link yfiles.algorithms.Node} or {@link yfiles.algorithms.Edge} with id before to lie before the {@link yfiles.algorithms.Node} - * or {@link yfiles.algorithms.Edge} with id reference. - * @param referenceId the ID of the reference node or edge - * @param beforeId the ID of the node or edge that should be placed before the reference element - * @abstract - */ - addPlaceBeforeConstraint(referenceId:any,beforeId:any):void; - /** - * Disposes of the {@link yfiles.hierarchic.ISequenceConstraintFactory}. - *

- * This method should be called when the factory is not needed anymore, i.e. after the layout has been calculated. Calling - * this method also clears all constraints. - *

- * @abstract - */ - dispose():void; - /** - * Gets a token that allows to bind a constraint factory to a graph instance after creation. - *

- * This method should only be used if the constraint factory is not bound to a graph instance initially. It allows to bind - * this factory to a graph instance after creation. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#createSequenceConstraintFactory - * @abstract - * @type {any} - */ - memento:any; - } - var ISequenceConstraintFactory:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.ISequenceConstraintFactory; - }; - /** - * {@link yfiles.hierarchic.AsIsLayerer} assigns nodes to layers by analyzing already existing node coordinates. - *

- * Nodes whose bounding boxes overlap in the main layout direction are assigned to the same layer. To influence to which - * amount the boxes need to overlap, the nodes can temporarily be - * {@link yfiles.hierarchic.AsIsLayerer#nodeScalingFactor scaled}. Alternatively, a minimum and maximum size or a halo can be specified for the nodes. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[1.64,133.62,[[11.31,157.97,10.67,18.7,"1"]]],[51.6,4.78,[[61.27,29.13,10.67,18.7,"2"]]],[190,14.75,[[199.66,39.1,10.67,18.7,"3"]]],[226.76,148.06,[[236.42,172.41,10.67,18.7,"4"]]],[108.72,221.62,[[118.38,245.97,10.67,18.7,"5"]]]],"e":[[0,1],[1,2],[3,2],[0,4],[4,3]],"vp":[1.0,4.0,256.0,248.0]}} - *

- *

- * Initial graph - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[20,50,[[29.66,74.35,10.67,18.7,"1"]]],[20,0,[[29.66,24.35,10.67,18.7,"2"]]],[100,0,[[109.66,24.35,10.67,18.7,"3"]]],[100,50,[[109.66,74.35,10.67,18.7,"4"]]],[60,110,[[69.66,134.35,10.67,18.7,"5"]]]],"e":[[0,1,0,-15,0,15],[1,2,15,0,-15,0],[3,2,0,-15,0,15],[0,4,0,15,-7.5,-15,[35,95,67.5,95]],[4,3,7.5,-15,0,15,[82.5,95,115,95]]],"vp":[20.0,0.0,110.0,140.0]}} - *

- *

- * Hierarchic layout when the initial drawing is used as sketch - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[50,0,[[59.66,24.35,10.67,18.7,"1"]]],[20,60,[[29.66,84.35,10.67,18.7,"2"]]],[27.5,170,[[37.16,194.35,10.67,18.7,"3"]]],[80,110,[[89.66,134.35,10.67,18.7,"4"]]],[80,60,[[89.66,84.35,10.67,18.7,"5"]]]],"e":[[0,1,-7.5,15,0,-15,[57.5,45,35,45]],[1,2,0,15,-7.5,-15],[3,2,0,15,7.5,-15,[95,155,50,155]],[0,4,7.5,15,0,-15,[72.5,45,95,45]],[4,3,0,15,0,-15]],"vp":[20.0,0.0,90.0,200.0]}} - *

- *

- * Hierarchic layout when the initial drawing is not used as sketch - *

- * @class - * @implements {yfiles.hierarchic.ILayerer} - */ - export interface AsIsLayerer extends yfiles.lang.Object,yfiles.hierarchic.ILayerer{} - export class AsIsLayerer { - /** - * Creates an instance of {@link yfiles.hierarchic.AsIsLayerer} with default settings. - */ - constructor(); - /** - * Assigns all nodes of the graph to layers by analyzing already existing node coordinates and adds them to the {@link yfiles.hierarchic.ILayers} - * instance. - *

- * Nodes whose bounding boxes overlap in the main layout direction are assigned to the same layer. To influence to which - * amount the boxes need to overlap, the nodes can temporarily be {@link yfiles.hierarchic.AsIsLayerer#nodeScalingFactor scaled}. - *

- * @param graph the input graph - * @param layers the {@link } instance that will be filled with the results of the calculation - * @param ldp the {@link } used for querying information about the nodes and edges - */ - assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Callback used for calculating the lower (max) value of a given node. - * @param graph the graph - * @param node the node - * @returns the lower (max) of a given node - * @protected - */ - getMax(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):number; - /** - * Callback used for calculating the upper (min) value of a given node. - * @param graph the graph - * @param node the node - * @returns the upper (min) value of a given node - * @protected - */ - getMin(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):number; - /** - * Gets or sets the scaling factor used for scaling the size of the nodes. - *

- * Nodes are being scaled from their center. This can be used for more fuzzy layering. - *

- *

- * The scaling factor can take positive values. Factors smaller than 1 only consider large overlaps of the nodes' bounding - * boxes in the main layout direction. Factors larger than 1 also combine nodes with some distance between them. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified value is less than 0 - * @see yfiles.hierarchic.AsIsLayerer#minimumNodeSize - * @see yfiles.hierarchic.AsIsLayerer#maximumNodeSize - * @see yfiles.hierarchic.AsIsLayerer#nodeHalo - * @type {number} - */ - nodeScalingFactor:number; - /** - * Gets or sets the maximum size of a node used for calculating layer overlaps. - *

- * This can be used for more fuzzy layering. - *

- *

- * The maximum size can take positive values. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified value is less than 0 - * @see yfiles.hierarchic.AsIsLayerer#nodeScalingFactor - * @see yfiles.hierarchic.AsIsLayerer#nodeHalo - * @type {number} - */ - maximumNodeSize:number; - /** - * Gets or sets the minimum size of a node used for calculating layer overlaps. - *

- * This can be used for more fuzzy layering. - *

- *

- * The minimum size can take positive values. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified value is less than 0 - * @see yfiles.hierarchic.AsIsLayerer#nodeScalingFactor - * @see yfiles.hierarchic.AsIsLayerer#nodeHalo - * @type {number} - */ - minimumNodeSize:number; - /** - * Gets or sets the size of the halo around a node, that means the insets that are used for calculating layer overlaps. - *

- * If the value of the halo is positive, it specifies a border around a node. In case it is negative, it is considered as - * an inset that defines a smaller area inside the node. - *

- *

- * This can be used for more fuzzy layering. - *

- * @see yfiles.hierarchic.AsIsLayerer#nodeScalingFactor - * @see yfiles.hierarchic.AsIsLayerer#minimumNodeSize - * @see yfiles.hierarchic.AsIsLayerer#maximumNodeSize - * @type {number} - */ - nodeHalo:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.AsIsLayerer; - } - /** - * This class calculates the sequence of the nodes within each layer using the nodes' coordinates. - *

- * For {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation} - * {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM}, the order corresponds to that obtain when sorting the nodes according to - * their x-coordinate. - *

- *

- * An instance of this class can be set to {@link yfiles.hierarchic.HierarchicLayout} using method {@link yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer} and {@link yfiles.hierarchic.HierarchicLayout#fromScratchSequencer} respectively. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[111.8,0,[[121.47,24.35,10.67,18.7,"1"]]],[0,36.33,[[9.66,60.68,10.67,18.7,"2"]]],[180.9,95.11,[[190.56,119.46,10.67,18.7,"3"]]],[0,153.88,[[9.66,178.23,10.67,18.7,"4"]]],[111.8,190.21,[[121.47,214.56,10.67,18.7,"5"]]]],"e":[[0,1],[0,3],[1,3],[0,2],[2,4],[4,3]],"vp":[0.0,0.0,211.0,221.0]}} Initial graph that will be used as sketch {@graph {"ann":{"s":[30,30],"d":1},"n":[[50,0,[[59.66,24.35,10.67,18.7,"1"]]],[20,60,[[29.66,84.35,10.67,18.7,"2"]]],[80,100,[[89.66,124.35,10.67,18.7,"3"]]],[42.5,145,[[52.16,169.35,10.67,18.7,"4"]]],[72.5,205,[[82.16,229.35,10.67,18.7,"5"]]]],"e":[[0,1,-10,15,0,-15,[55,45,35,45]],[0,3,0,15,7.5,-15],[1,3,0,15,-7.5,-15,[35,130,50,130]],[0,2,10,15,0,-15,[75,45,95,45]],[2,4,0,15,7.5,-15],[4,3,-7.5,-15,0,15,[80,190,57.5,190]]],"vp":[20.0,0.0,90.0,235.0]}} Hierarchic layout when the initial graph is used as sketch - *

- * @class - * @implements {yfiles.hierarchic.ISequencer} - */ - export interface AsIsSequencer extends yfiles.lang.Object,yfiles.hierarchic.ISequencer{} - export class AsIsSequencer { - /** - * Creates a new {@link yfiles.hierarchic.AsIsSequencer} instance. - */ - constructor(); - /** - * Calculates the sequence of the nodes within each layer using the nodes' coordinates. - *

- * This method is called by {@link yfiles.hierarchic.HierarchicLayoutCore} and finally writes back the calculated sequence using - * method {@link yfiles.hierarchic.ILayer#setNodeOrder}. - *

- * @param graph the input graph - * @param layers the given {@link } instance that defines the layering structure - * @param ldp the {@link } containing information about the nodes and edges of the graph - * @param itemFactory the {@link } used for creating and destroying helper structures - */ - sequenceNodeLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.AsIsSequencer; - } - /** - * This class is a wrapper {@link yfiles.hierarchic.ILayerer} implementation that delegates the actual layering to a delegate {@link yfiles.hierarchic.ILayerer} - * object. - *

- * If the graph consists of multiple components, they will be identified and each of the components will be layered - * separately using the delegate {@link yfiles.hierarchic.ILayerer} instance. After that they will all be merged such that the - * desired aspect ratio is fulfilled best. - *

- *

- * {@graph {"ann":{"s":[60,30],"d":1},"styles":{"6":{"f":"#ccccff"}},"n":[[110,160],[20,160],[20,220],[110,220],[20,280],[252.5,160,6],[305,220,6],[380,280,6],[200,220,6],[290,280,6],[290,330,6],[380,330,6],[200,280,6],[27.5,0,180,80],[87.5,100]],"e":[[14,0,15,15,0,-15,[132.5,145,140,145]],[14,1,-15,15,0,-15,[102.5,145,50,145]],[1,2,0,15,0,-15],[0,3,0,15,0,-15],[2,4,0,15,0,-15],[5,6,15,15,0,-15,[297.5,205,335,205]],[6,7,15,15,0,-15,[350,265,410,265]],[5,8,-15,15,0,-15,[267.5,205,230,205]],[6,9,-15,15,0,-15],[9,10,0,15,0,-15],[7,11,0,15,0,-15],[8,12,0,15,0,-15],[13,14,0,40,0,-15]],"vp":[20.0,0.0,420.0,360.0]}} Sample output of {@link yfiles.hierarchic.AspectRatioComponentLayerer} with default settings on a graph with two connected - * components. - *

- * @see yfiles.hierarchic.AspectRatioComponentLayerer#desiredAspectRatio - * @see yfiles.hierarchic.MultiComponentLayerer - * @class - * @implements {yfiles.hierarchic.ILayerer} - */ - export interface AspectRatioComponentLayerer extends yfiles.lang.Object,yfiles.hierarchic.ILayerer{} - export class AspectRatioComponentLayerer { - /** - * Creates a new instance of {@link yfiles.hierarchic.AspectRatioComponentLayerer} using the given delegate {@link yfiles.hierarchic.ILayerer} - * instance. - * @param singleComponentLayerer - * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.ILayerer} is null - */ - constructor(singleComponentLayerer:yfiles.hierarchic.ILayerer); - /** - * Assigns all nodes of the graph to layers and registers them to the {@link yfiles.hierarchic.ILayers} instance based on the given - * aspect ratio. - *

- * If the graph consists of multiple components, they will be identified and each of the components will be layered - * separately using the delegate {@link yfiles.hierarchic.ILayerer} instance. After that, they will all be merged such that the - * desired aspect ratio is best fulfilled. - *

- * @param graph the input graph - * @param layers the {@link } instance that will be filled with the results of the calculation - * @param ldp the {@link } used for query information about the nodes and edges - */ - assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Gets or sets the delegate {@link yfiles.hierarchic.ILayerer} instance. - * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.ILayerer} is null - * @type {yfiles.hierarchic.ILayerer} - */ - singleComponentLayerer:yfiles.hierarchic.ILayerer; - /** - * Gets or sets whether or not the size of the nodes should be considered. - *

- * If this option is disabled, all nodes are considered to be of equal size. Hence, the given aspect ratio specifies the - * ratio between the number of nodes within a layer and the overall number of layers. - *

- * @type {boolean} - */ - considerNodeSize:boolean; - /** - * Gets or sets the desired aspect ratio. - *

- * If the graph consists of multiple components, they will be identified and each of the components will be layered - * separately using the delegate {@link yfiles.hierarchic.ILayerer} instance. After that, they will all be merged such that the - * desired aspect ratio is best fulfilled. - *

- *

- * The given aspect ratio should be greater or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the aspect ratio is negative - * @type {number} - */ - desiredAspectRatio:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.AspectRatioComponentLayerer; - } - /** - * {@link yfiles.hierarchic.BFSLayerer} uses a breadth first search for assigning layers to the nodes. - *

- * The nodes of the first layer can be freely selected (see - * {@link yfiles.hierarchic.BFSLayerer#CORE_NODES_DP_KEY}). The nodes that belong to a subsequent layer are determined as follows: - * Add all yet unassigned nodes to the new layer that are connected to nodes already assigned. As a consequence, all - * connected nodes will be at most one layer apart. Also, edges between nodes that belong to the same layer are possible. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[46.17,0,[[55.83,24.35,10.67,18.7,"1"]]],[100,70,[[109.66,94.35,10.67,18.7,"2"]]],[0,70,[[9.66,94.35,10.67,18.7,"3"]]],[211.77,0,[[221.43,24.35,10.67,18.7,"6"]]],[211.77,70,[[221.43,94.35,10.67,18.7,"7"]]],[100,0,[[109.66,24.35,10.67,18.7,"8"]]],[50,70,[[56.33,94.35,17.35,18.7,"12"]]],[3.17,140,[[12.83,164.35,10.67,18.7,"8"]]],[113.17,140,[[122.83,164.35,10.67,18.7,"9"]]]],"e":[[5,1,0,15,7.5,-15,[115,50,122.5,50]],[0,1,10,15,-7.5,-15,[71.17,50,107.5,50]],[0,2,-10,15,0,-15,[51.17,50,15,50]],[4,1,-15,0,15,0],[3,4,0,15,0,-15],[0,6,-0,15,0,-15,[61.17,50,65,50]],[6,7,-7.5,15,7.5,-15,[57.5,120,25.67,120]],[6,8,7.5,15,0,-15,[72.5,120,128.17,120]],[8,7,-15,0,15,0],[2,7,0,15,-7.5,-15,[15,120,10.67,120]]],"vp":[0.0,0.0,242.0,170.0]}} - *

- * @class - * @implements {yfiles.hierarchic.ILayerer} - */ - export interface BFSLayerer extends yfiles.lang.Object,yfiles.hierarchic.ILayerer{} - export class BFSLayerer { - /** - * Creates an instance of {@link yfiles.hierarchic.BFSLayerer}. - */ - constructor(); - /** - * Assigns all nodes of the graph to layers and adds them to the {@link yfiles.hierarchic.ILayers} instance. - * @param graph the input graph - * @param layers the {@link } instance that will be filled with the results of the calculation - * @param ldp the {@link } used for query information about the nodes and edges - */ - assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Data provider key for identifying the core nodes of the BFS layering - *

- * The {@link yfiles.algorithms.IDataProvider} registered with this key should provide boolean values for the nodes of the graph. - * The boolean value determines whether or not a node is to be placed in the first layer. If there are no nodes marked as - * core nodes, then nodes with in-degree 0 are considered to be the core nodes. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static CORE_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.BFSLayerer; - } - /** - * This class is a {@link yfiles.hierarchic.ILayerer} implementation that observes relative and absolute layering constraints - * defined by the {@link yfiles.hierarchic.ILayerConstraintFactory layer constraint factory}. - *

- * Furthermore, it can handle the edge directedness as specified by {@link yfiles.algorithms.IDataProvider} key - * {@link yfiles.hierarchic.HierarchicLayout#EDGE_DIRECTEDNESS_DP_KEY}. - *

- *

- * For a given graph instance, the layer constraint factory can be created using method - * {@link yfiles.hierarchic.HierarchicLayout#createLayerConstraintFactory}. The {@link yfiles.hierarchic.ILayerer} can be used for both - * common layering and layering of incremental nodes. - *

- *

- * {@graph {"ann":{"s":[60,30],"d":1},"styles":{"6":{"f":"#ff0000"},"7":{"f":"#0099ff"}, "8":{"f":"#00cc66"}},"n":[[120,0,6,[[144.66,24.35,10.67,18.7,"1"]]],[10,50,7,[[34.66,74.35,10.67,18.7,"2"]]],[120,50,7,[[144.66,74.35,10.67,18.7,"3"]]],[280,125,8,[[304.66,149.35,10.67,18.7,"7"]]],[10,125,8,[[34.66,149.35,10.67,18.7,"4"]]],[100,125,8,[[124.66,149.35,10.67,18.7,"5"]]],[190,125,8,[[214.66,149.35,10.67,18.7,"6"]]]],"e":[[2,0,0,-15,0,15],[2,1,-30,0,30,0],[3,2,0,-15,22.5,15,[310,95,172.5,95]],[2,4,-22.5,15,0,-15,[127.5,90,40,90]],[2,5,-7.5,15,0,-15,[142.5,100,130,100]],[2,6,7.5,15,0,-15,[157.5,105,220,105]]],"vp":[10.0,0.0,330.0,155.0]}} Sample output of applying {@link yfiles.hierarchic.ConstraintIncrementalLayerer}. The red colored node should reside in the - * topmost layer, blue nodes in the medium layer while green nodes in the bottommost layer. {@graph {"ann":{"s":[60,30],"d":1},"styles":{"6":{"f":"#0099ff"},"7":{"f":"#e3e3ff", "s":"#e3e3ff"}, "8":{"f":"#00cc66"}},"n":[[330,136.5,380,67,7],[330,206.5,380,127,7],[330,337,380,80,7],[490,156.5,[[514.66,180.85,10.67,18.7,"1"]]],[350,226.5,6,[[374.66,250.85,10.67,18.7,"2"]]],[440,226.5,6,[[464.66,250.85,10.67,18.7,"3"]]],[450,286.5,6,[[474.66,310.85,10.67,18.7,"4"]]],[415,346.5,8,[[439.66,370.85,10.67,18.7,"5"]]],[505,346.5,8,[[529.66,370.85,10.67,18.7,"6"]]],[595,346.5,8,[[619.66,370.85,10.67,18.7,"7"]]]],"e":[[3,4,-25,15,0,-15,[495,196.5,380,196.5]],[3,5,-15,15,0,-15,[505,206.5,470,206.5]],[3,6,-5,15,15,-15,[515,266.5,495,266.5]],[5,6,0,15,-15,-15,[470,266.5,465,266.5]],[3,7,5,15,0,-15,[525,326.5,445,326.5]],[3,8,15,15,0,-15],[3,9,25,15,0,-15,[545,196.5,625,196.5]]],"vp":[330.0,136.0,380.0,281.0]}} Sample output of applying {@link yfiles.hierarchic.ConstraintIncrementalLayerer} - * on a graph with a - * {@link yfiles.layout.PartitionGrid}. Same colors represent nodes that belong to the same partition grid cell and should be - * layered with respect to the partition grid cell to which they belong. - *

- * @see yfiles.hierarchic.ILayerConstraintFactory - * @see yfiles.hierarchic.HierarchicLayout - * @class - * @implements {yfiles.hierarchic.ILayerer} - */ - export interface ConstraintIncrementalLayerer extends yfiles.lang.Object,yfiles.hierarchic.ILayerer{} - export class ConstraintIncrementalLayerer { - /** - * Creates a new {@link yfiles.hierarchic.ConstraintIncrementalLayerer} with the given {@link yfiles.hierarchic.ILayerer} instance. - * @param coreLayerer the given {@link } instance - */ - constructor(coreLayerer:yfiles.hierarchic.ILayerer); - /** - * Assigns all nodes of the graph to layers and adds them to the {@link yfiles.hierarchic.ILayers} instance based on relative and - * absolute layering constraints defined by the given layering constraints. - * @param graph the input graph - * @param layers the {@link } instance that will be filled with the results of the calculation - * @param ldp the {@link } used for query information about the nodes and edges - */ - assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Checks if the current setting of constraints is consistent (i.e. - *

- * the induced constraint graph has no cycles). - *

- * @throws {Stubs.Exceptions.ArgumentError} if the constraint graph is inconsistent - * @protected - */ - checkConstraints():void; - /** - * Data provider key for assigning additional edge weights - *

- * The {@link yfiles.hierarchic.ILayerer} tries to maintain edges with higher weights short. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static ADDITIONAL_EDGE_WEIGHT_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets whether or not same-layer edges can be created by this {@link yfiles.hierarchic.ILayerer} instance. - *

- * This only concerns edges between nodes that have no hard constraints that will force a same-layer edge (i.e. a - * same-layer constraint). - *

- * @type {boolean} - */ - allowSameLayerEdges:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.ConstraintIncrementalLayerer; - } - /** - * This class is a default {@link yfiles.hierarchic.IDrawingDistanceCalculator} implementation that is used by {@link yfiles.hierarchic.HierarchicLayoutCore} - * to configure the {@link yfiles.hierarchic.INodePlacer}. - * @class - * @implements {yfiles.hierarchic.IDrawingDistanceCalculator} - */ - export interface DefaultDrawingDistanceCalculator extends yfiles.lang.Object,yfiles.hierarchic.IDrawingDistanceCalculator{} - export class DefaultDrawingDistanceCalculator { - /** - * Creates a new instance of {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} with default settings. - */ - constructor(); - /** - * - * @param graph - * @param layers - * @param ldp - */ - dispose(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Determines the minimum distance between two {@link yfiles.algorithms.Node}s of the same layer. - * @param graph the input graph - * @param layer the {@link } object that will be used during subsequent calls - * @param ldp the {@link } used for querying information - * @param left the left of the two {@link }s whose minimum distance is to be determined or null if only the left border - * of the right {@link } is of interest - * @param right the right of the two {@link }s whose minimum distance is to be determined or null if only the right border - * of the left {@link } is of interest - * @returns the minimum distances between {@link }s of same layer - */ - getMinDistance(graph:yfiles.layout.LayoutGraph,layer:yfiles.hierarchic.ILayer,ldp:yfiles.hierarchic.ILayoutDataProvider,left:yfiles.algorithms.Node,right:yfiles.algorithms.Node):number; - /** - * - * @param graph - * @param layers - * @param ldp - */ - initialize(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Gets or sets whether or not an adaptive minimum edge distance is used. - *

- * If this option is enabled the minimum distance between two adjacent edges is the minimum of the current minimum edge - * distance and the distance of the edges' source/target points. - *

- * @type {boolean} - */ - adaptiveMinimumEdgeDistanceEnabled:boolean; - /** - * Gets or sets whether or not the compaction option is enabled. - * @type {boolean} - */ - compaction:boolean; - /** - * Gets or sets the minimum distance between two {@link yfiles.algorithms.Node}s. - *

- * Minimum distance should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum distance is negative - * @type {number} - */ - nodeToNodeDistance:number; - /** - * Gets or sets the minimum distance between a {@link yfiles.algorithms.Node} and an (non-adjacent) {@link yfiles.algorithms.Edge}. - *

- * Minimum distance should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum distance is negative - * @type {number} - */ - nodeToEdgeDistance:number; - /** - * Gets or sets the minimum distance between two edges. - *

- * Minimum distance should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum distance is negative - * @type {number} - */ - edgeToEdgeDistance:number; - /** - * Gets or sets whether or not to use an optimized minimum distance calculation for swimlane layouts. - *

- * If set to true this instance will report 0.0d as the minimum distance between two nodes if they belong to different - * swimlanes. This avoids unwanted feedback between different swimlanes during node placement. - *

- * @type {boolean} - */ - optimizeSwimlaneDistances:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.DefaultDrawingDistanceCalculator; - } - /** - * This class is a {@link yfiles.hierarchic.ISequencer} implementation that performs the second phase of the Sugiyama algorithm. - *

- * It minimizes the crossings in the diagram by using either the barycentric or median heuristic. - *

- * @class - * @implements {yfiles.hierarchic.ISequencer} - */ - export interface DefaultLayerSequencer extends yfiles.lang.Object,yfiles.hierarchic.ISequencer{} - export class DefaultLayerSequencer { - /** - * Creates a new instance of {@link yfiles.hierarchic.DefaultLayerSequencer}. - */ - constructor(); - /** - * - * @param graph - * @param glayers - * @param ldp - * @param itemFactory - */ - sequenceNodeLayers(graph:yfiles.layout.LayoutGraph,glayers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Gets or sets whether or not to apply an additional crossing minimization heuristic. - *

- * Activating this heuristic can reduce the overall number of edge crossings. On the other hand, it may increase the - * running time. - *

- * @type {boolean} - */ - transposition:boolean; - /** - * Gets or sets whether or not an additional crossing minimization heuristic should be used in the presence of grouped - * graphs. - *

- * Activating this heuristic can reduce the overall number of edge crossings in grouped graphs. On the other hand, it may - * increase running time. - *

- * @type {boolean} - */ - groupTransposition:boolean; - /** - * Gets or sets the weight heuristic that should be used. - * @throws {Stubs.Exceptions.ArgumentError} if the constant is unknown - * @type {yfiles.hierarchic.WeightHeuristic} - */ - weightHeuristic:yfiles.hierarchic.WeightHeuristic; - /** - * Gets or sets the time limit (in milliseconds) set for this sequencer per execution. - *

- * Values have to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the maximum duration is negative. - * @type {number} - */ - maximumDuration:number; - /** - * Gets or sets the number of randomized rounds that this algorithm performs, if there was no optimal solution. - *

- * Values have to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if a negative value is given - * @type {number} - */ - randomizationRounds:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.DefaultLayerSequencer; - } - /** - * A default implementation of a {@link yfiles.hierarchic.ILayeredComponentsMerger} that provides simple default behaviors. - *

- * Instances of this class are used internally by {@link yfiles.hierarchic.HierarchicLayoutCore} and {@link yfiles.hierarchic.MultiComponentLayerer} - * when e.g. the graph is grouped or it consists of more than one connected component. - *

- * @class - * @implements {yfiles.hierarchic.ILayeredComponentsMerger} - */ - export interface DefaultLayeredComponentsMerger extends yfiles.lang.Object,yfiles.hierarchic.ILayeredComponentsMerger{} - export class DefaultLayeredComponentsMerger { - /** - * Creates a new instance of {@link yfiles.hierarchic.DefaultLayeredComponentsMerger} using the given merging policy. - * @param policy one of the predefined merging constants - * @throws {Stubs.Exceptions.ArgumentError} if an unknown policy is given - */ - constructor(policy:yfiles.hierarchic.MergingPolicy); - /** - * Creates a new instance of {@link yfiles.hierarchic.DefaultLayeredComponentsMerger} with default settings. - */ - constructor(); - /** - * - * @param graph - * @param ldp - * @param srcLayers - * @param targetLayers - */ - merge(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,srcLayers:yfiles.hierarchic.ILayers,targetLayers:yfiles.hierarchic.ILayers):void; - /** - * Gets or sets the merging policy constant as defined in {@link yfiles.hierarchic.DefaultLayeredComponentsMerger}. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown policy is given - * @type {yfiles.hierarchic.MergingPolicy} - */ - policy:yfiles.hierarchic.MergingPolicy; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.DefaultLayeredComponentsMerger; - } - /** - * This class is a default {@link yfiles.hierarchic.IPortAllocator} implementation. - *

- * It is used by {@link yfiles.hierarchic.HierarchicLayoutCore} after the sequencing phase. - *

- * @class - * @implements {yfiles.hierarchic.IPortAllocator} - */ - export interface DefaultPortAllocator extends yfiles.lang.Object,yfiles.hierarchic.IPortAllocator{} - export class DefaultPortAllocator { - /** - * Creates a new instance of {@link yfiles.hierarchic.DefaultPortAllocator} with default settings. - * @see yfiles.hierarchic.DefaultPortAllocator#defaultPortBorderGapRatio - */ - constructor(); - /** - * Assigns source and target port coordinates to each edge of the graph. - *

- * This method assigns: - *

- *
    - *
  • {@link yfiles.layout.PortSide#ANY} ports to appropriate sides.
  • - *
  • {@link yfiles.layout.PortConstraint#strong Weak} ports to appropriate positions between strong ones.
  • - *
- *

- * This method is called by {@link yfiles.hierarchic.HierarchicLayoutCore} after the sequencing phase. - *

- * @param graph the input graph - * @param layers the given {@link } instance containing the layering structure - * @param ldp the {@link } containing information about the nodes and edges of the graph - * @param itemFactory the {@link } used for creating and destroying helper structures - */ - assignPorts(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Callback method used for determining the port border gap for each node and side. - *

- * It may be overridden for a custom calculation of port border gap on a given node. - *

- * @param graph the input graph - * @param ldp the {@link } containing information about the nodes and edges of the graph - * @param node the given node - * @param sideIndex the zero-based (top is 0) clock-wise index of the side of the node (for top-to-bottom layouts) - * @param sideLength the width/height of the side - * @param edgeCount the number of edges/ports that connect to this side - * @returns the absolute gap on both sides of the ports - * @see yfiles.hierarchic.DefaultPortAllocator#getPortDistanceDelta - * @protected - */ - getPortBorderGap(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,node:yfiles.algorithms.Node,sideIndex:number,sideLength:number,edgeCount:number):number; - /** - * Callback method used for determining the port border gap ratio. - *

- * See {@link yfiles.hierarchic.DefaultPortAllocator#defaultPortBorderGapRatio} for an explanation. - *

- *

- * It may be overridden for a custom calculation of port border gap ratio on a given node. - *

- * @param graph the input graph - * @param ldp the {@link } containing information about the nodes and edges of the graph - * @param node the given node - * @param sideIndex the zero-based (top is 0) clock-wise index of the side of the node (for top-to-bottom layouts) - * @param sideLength the width/height of the side - * @param edgeCount the number of edges/ports that connect to this side - * @returns the border gap ratio - * @protected - */ - getPortBorderGapRatio(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,node:yfiles.algorithms.Node,sideIndex:number,sideLength:number,edgeCount:number):number; - /** - * Callback method used for determining the distance between two adjacent ports. - *

- * It may be overridden for a custom calculation of the distance between two adjacent ports.. - *

- * @param graph the input graph - * @param ldp the {@link } containing information about the nodes and edges of the graph - * @param node the given node - * @param sideIndex the zero-based (top is 0) clock-wise index of the side of the node (for top-to-bottom layouts) - * @param sideLength the width/height of the side - * @param edgeCount the number of edges/ports that connect to this side - * @param portBorderGap the previously calculated port border gap - * @returns the absolute distance between two adjacent ports - * @protected - */ - getPortDistanceDelta(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,node:yfiles.algorithms.Node,sideIndex:number,sideLength:number,edgeCount:number,portBorderGap:number):number; - /** - * Gets or sets the border gap ratio for the default port. - *

- * This ratio determines the gap between a corner of the node and the first assigned port. - *

- *

- * The ratio should be greater than 0. - *

- *

- * A value of 0.0d results in ports being placed directly on the corner of the node (if there is more than one port). - *

- *

- * A value of 0.5d results in ports being distributed along the side of the node so that the distance between the corner of - * the node and the first port is half as wide as the distance between two adjacent ports. - *

- *

- * A value of Double.POSITIVE_INFINITY results in all ports being centered at the side in one point. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given ratio is negative - * @type {number} - */ - defaultPortBorderGapRatio:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.DefaultPortAllocator; - } - /** - * This class is used by {@link yfiles.hierarchic.HierarchicLayoutCore} during the various phases to provide routing details for - * the edges of the graph. - *

- * An {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance can be specified individually for single edges using a {@link yfiles.algorithms.IDataProvider} - * that returns an {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance for each edge of the graph, or null if no {@link yfiles.hierarchic.EdgeLayoutDescriptor} - * is bound to an edge. The {@link yfiles.algorithms.IDataProvider} is registered with the graph using key - * {@link yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. - *

- *

- * This class is designed as a class to allow future additions of new getter methods. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @see yfiles.hierarchic.NodeLayoutDescriptor - * @class - */ - export interface EdgeLayoutDescriptor extends yfiles.lang.Object{} - export class EdgeLayoutDescriptor { - /** - * Creates a new instance of an {@link yfiles.hierarchic.EdgeLayoutDescriptor} with the default values. - */ - constructor(); - /** - * Creates a copy of this {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance. - * @returns a copy of this {@link } instance - */ - createCopy():yfiles.hierarchic.EdgeLayoutDescriptor; - /** - * Gets or sets the minimum length of the first segment of the edge path (at the source node). - *

- * The minimum length should be greater than 0. - *

- *

- * If the value is 0.0d the first segment does not need to be orthogonal. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum length of the first segment is negative - * @type {number} - */ - minimumFirstSegmentLength:number; - /** - * Gets or sets the minimum length of the last segment of the edge path (at the target node). - *

- * The minimum length should be greater than 0. - *

- *

- * If the value is 0.0d the last segment does not need to be orthogonal. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum length of the last segment is negative - * @type {number} - */ - minimumLastSegmentLength:number; - /** - * Gets or sets the minimum length of an edge. - *

- * If this is used for polyline routing, it describes the minimum vertical length of the mid segment. If it is used for - * orthogonal routing, it describes the minimum length of the whole edge. - *

- *

- * The minimum length should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum length is negative - * @type {number} - */ - minimumLength:number; - /** - * Gets or sets the preferred minimum distance to obstacles. - *

- * The minimum distance should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum length is negative - * @type {number} - */ - minimumDistance:number; - /** - * Gets or sets the minimum slope that the mid segments of this edge should have, if the edge is routed polyline in - * vertical layouts. - *

- * The minimum slope should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given minimum slope is negative - * @type {number} - */ - minimumSlope:number; - /** - * Gets or sets whether or not source port optimization is enabled. - *

- * This means that the algorithm should try to find a better source {@link yfiles.layout.PortConstraint port constraint} if the current constraint is null or - * {@link yfiles.layout.PortSide#ANY}. - *

- * @type {boolean} - */ - sourcePortOptimization:boolean; - /** - * Gets or sets whether or not target port optimization is enabled. - *

- * This means that the algorithm should try to find a better target {@link yfiles.layout.PortConstraint port constraint} if the current constraint is null or - * {@link yfiles.layout.PortSide#ANY}. - *

- * @type {boolean} - */ - targetPortOptimization:boolean; - /** - * Gets or sets the routing style for this edge. - * @see yfiles.hierarchic.RoutingStyle - * @type {yfiles.hierarchic.RoutingStyle} - */ - routingStyle:yfiles.hierarchic.RoutingStyle; - /** - * Gets or sets the minimum length of octilinear segments for this edge. - * @throws {Stubs.Exceptions.ArgumentError} if the minimum length of the first segment is negative - * @see yfiles.hierarchic.EdgeLayoutDescriptor#routingStyle - * @type {number} - */ - minimumOctilinearSegmentLength:number; - /** - * Gets or sets how edges in grouped graphs are routed between the content of different groups. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown style is specified - * @type {yfiles.hierarchic.RecursiveEdgeStyle} - */ - recursiveEdgeStyle:yfiles.hierarchic.RecursiveEdgeStyle; - /** - * Gets or sets whether or not this edge is routed directly to a group node's border if it connects the group node with one - * of its descendants. - *

- * When enabled, the edge will connect to the inner side of the group node's border instead of leaving the group node and - * connect from outside. - *

- * @type {boolean} - */ - directGroupContentEdgeRouting:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.EdgeLayoutDescriptor; - } - export enum WeightHeuristic{ - /** - * A weight assignment specifier based on a barycenter heuristic. - *

- * The position of a node within a layer will be determined by the barycenter of its successor (downward pass) and - * predecessor (upward pass) nodes. - *

- * @see yfiles.hierarchic.DefaultLayerSequencer#weightHeuristic - */ - BARYCENTER, - /** - * A weight assignment specifier based on a median heuristic. - *

- * The position of a node within a layer will be determined by the median position of its successor (downward pass) and - * predecessor (upward pass) nodes. - *

- * @see yfiles.hierarchic.DefaultLayerSequencer#weightHeuristic - */ - MEDIAN - } - export enum MergingPolicy{ - /** - * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} below the layers of the target {@link yfiles.hierarchic.ILayers layering}. - * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy - */ - ADD_BELOW, - /** - * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} above the layers of the target {@link yfiles.hierarchic.ILayers layering}. - * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy - */ - ADD_ABOVE, - /** - * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} to the right of the layers of the target layering. - *

- * Both {@link yfiles.hierarchic.ILayers layering}s will become top-aligned before the merge. - *

- * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy - */ - ADD_RIGHT_TOP_ALIGNED, - /** - * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} to the right of the layers of the target {@link yfiles.hierarchic.ILayers layering}. - *

- * Both {@link yfiles.hierarchic.ILayers layering}s will become bottom-aligned before the merge. - *

- * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy - */ - ADD_RIGHT_BOTTOM_ALIGNED, - /** - * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} to the right of the layers of the target {@link yfiles.hierarchic.ILayers layering}. - *

- * Both {@link yfiles.hierarchic.ILayers layering}s will become center-aligned before the merge. - *

- * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy - */ - ADD_RIGHT_CENTER_ALIGNED, - /** - * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} to the left of the layers of the target {@link yfiles.hierarchic.ILayers layering}. - *

- * Both {@link yfiles.hierarchic.ILayers layering}s will become top-aligned before the merge. - *

- * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy - */ - ADD_LEFT_TOP_ALIGNED, - /** - * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} to the left of the layers of the target {@link yfiles.hierarchic.ILayers layering}. - *

- * Both {@link yfiles.hierarchic.ILayers layering}s will become bottom-aligned before the merge. - *

- * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy - */ - ADD_LEFT_BOTTOM_ALIGNED, - /** - * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} to the left of the layers of the target {@link yfiles.hierarchic.ILayers layering}. - *

- * Both {@link yfiles.hierarchic.ILayers layering}s will become center-aligned before the merge. - *

- * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy - */ - ADD_LEFT_CENTER_ALIGNED - } - export enum EdgeDataType{ - /** - * A constant describing a normal edge. - * @see yfiles.hierarchic.IEdgeData#type - */ - NORMAL, - /** - * A constant describing an edge that connects to a source group node. - * @see yfiles.hierarchic.IEdgeData#type - */ - SOURCE_GROUP_NODE_CONNECTOR, - /** - * A constant describing an edge that connects to a target group node. - * @see yfiles.hierarchic.IEdgeData#type - */ - TARGET_GROUP_NODE_CONNECTOR, - /** - * A constant describing an edge that connects two group nodes. - * @see yfiles.hierarchic.IEdgeData#type - */ - GROUP_NODE_INTERCONNECTOR, - /** - * A constant describing a same-layer edge that connects directly two neighboring nodes. - * @see yfiles.hierarchic.IEdgeData#type - */ - DIRECT_SAME_LAYER_EDGE, - /** - * A constant describing a same-layer edge that does not connect directly two neighboring nodes. - *

- * This means that two nodes of the same layer are not connected directly with a straight-line edge, but with an edge - * consisting of polyline segments. - *

- * @see yfiles.hierarchic.IEdgeData#type - */ - NON_DIRECT_SAME_LAYER_EDGE, - /** - * A constant describing an edge that connects group border nodes in adjacent layers. - * @see yfiles.hierarchic.IEdgeData#type - */ - BORDER_EDGE, - /** - * A constant describing an edge that has been added temporarily to replace an edge connected to a group node. - * @see yfiles.hierarchic.IEdgeData#type - */ - REDIRECTED_GROUP_EDGE - } - export enum RecursiveEdgeStyle{ - /** - * Routing specifier that routes edges between different group contents non-recursively. - * {@link yfiles.algorithms.Edge}s may leave and enter group nodes at the left and right side in order to connect as directly as - * possible. - * @see yfiles.hierarchic.EdgeLayoutDescriptor#recursiveEdgeStyle - */ - OFF, - /** - * Routing specifier that routes edges between different group contents recursively and directed. - * {@link yfiles.algorithms.Edge}s can only leave the groups at the bottom side and enter them at the top side. - * @see yfiles.hierarchic.EdgeLayoutDescriptor#recursiveEdgeStyle - */ - DIRECTED, - /** - * Routing specifier that routes edges between different group contents recursively and undirected. - * {@link yfiles.algorithms.Edge}s can leave the groups at the bottom or top side and enter them at the bottom or top side. This - * style is more compact than the directed edge style. - * @see yfiles.hierarchic.EdgeLayoutDescriptor#recursiveEdgeStyle - */ - UNDIRECTED - } - export enum ComponentArrangementPolicy{ - /** - * A component arrangement policy that achieves a 1:1 aspect ratio for the graph. - *

- * After layering the single components with the core layerer, the components will be merged such that an 1:1 aspect ratio - * is fulfilled best. - *

- * @see yfiles.hierarchic.HierarchicLayout#componentArrangementPolicy - */ - COMPACT, - /** - * A component arrangement policy that aligns the components with their topmost layer. - *

- * After layering the single components with the core layerer, the components are aligned with their topmost layer. - *

- * @see yfiles.hierarchic.HierarchicLayout#componentArrangementPolicy - */ - TOPMOST - } - export enum LayoutMode{ - /** - * A layout mode that allows to keep some nodes fixed and insert the remaining nodes incrementally. - *

- * Fixed elements will be handled by the {@link yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer fixed elements sequencer} and {@link yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer fixed elements layerer}. Incremental elements will be - * added during the layering or the sequencing phase. They are handled by {@link yfiles.hierarchic.HierarchicLayout#fromScratchLayerer from scratch layerer} and {@link yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer fixed elements layerer} - * respectively. - *

- * @see yfiles.hierarchic.IIncrementalHintsFactory#createLayerIncrementallyHint - * @see yfiles.hierarchic.HierarchicLayout#layoutMode - * @see yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer - * @see yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer - */ - INCREMENTAL, - /** - * A layout mode that will recompute the complete layout from scratch. - *

- * All elements will be handled by the same {@link yfiles.hierarchic.HierarchicLayout#fromScratchLayerer layerer} and {@link yfiles.hierarchic.HierarchicLayout#fromScratchSequencer sequencer}. - *

- * @see yfiles.hierarchic.HierarchicLayout#layoutMode - * @see yfiles.hierarchic.HierarchicLayout#fromScratchSequencer - * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayerer - */ - FROM_SCRATCH - } - export enum LayeringStrategy{ - /** - * A layering strategy which places each node in the highest possible layer without passing its predecessor in the - * topological order of nodes. - *

- * All nodes with indegree zero will be assigned to the topmost layer of the layout. The number of separate layers will be - * as small as possible. - *

- * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy - */ - HIERARCHICAL_TOPMOST, - /** - * A layering strategy which places each node in the optimal layer to minimize the layer distances. - *

- * The layer distance of an edge is the absolute difference between the layer numbers of its source and target node. The - * layer assignment will minimize the overall sum of the layer distances of all edges in the layout. - *

- * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy - */ - HIERARCHICAL_OPTIMAL, - /** - * A layering strategy which applies a heuristic to approximate the {@link yfiles.hierarchic.LayeringStrategy#HIERARCHICAL_OPTIMAL optimal layering}. - *

- * The quality of the result may not be as good as with {@link yfiles.hierarchic.LayeringStrategy#HIERARCHICAL_OPTIMAL optimal layering} but it is usually achieved faster. - *

- * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy - */ - HIERARCHICAL_TIGHT_TREE, - /** - * A layering strategy which applies a fast heuristic that improves the layering done by {@link yfiles.hierarchic.LayeringStrategy#HIERARCHICAL_TOPMOST} - * by shifting some nodes down. - *

- * The quality of the result is usually worse than the one produced by - * {@link yfiles.hierarchic.LayeringStrategy#HIERARCHICAL_TIGHT_TREE}. - *

- * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy - */ - HIERARCHICAL_DOWNSHIFT, - /** - * A layering strategy based on a breadth first search (BFS). - *

- * All edges will span at most one layer in the resulting drawing. Edges between nodes that belong to the same layer are - * possible. - *

- *

- * The nodes that will be placed in the first layer can be provided by a data provider bound to the input graph using the - * key - * {@link yfiles.hierarchic.BFSLayerer#CORE_NODES_DP_KEY}. If this data provider is not given, then nodes that have no incoming - * edges are placed in the first layer. - *

- * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy - */ - BFS, - /** - * A layering strategy which derives the layers from the initial coordinates of the nodes. - *

- * It tries to find a layering that is similar to the one in the input graph. The layout algorithm may place nodes in the - * same layer, even though they are connected by an edge. - *

- *

- * In a vertically oriented layout, nodes that overlap vertically are placed in the same layer. The same holds for a - * horizontally oriented layout in the case where the nodes overlap horizontally. - *

- * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy - */ - FROM_SKETCH, - /** - * A layering strategy which uses a layer assignment specified by the user. - *

- * The nodes' layer assignment must be provided by a data provider bound to the input graph using the key - * {@link yfiles.hierarchic.GivenLayersLayerer#LAYER_ID_DP_KEY}. - *

- *

- * This layering strategy allows edges whose source and target share a layer. - *

- * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy - */ - USER_DEFINED, - /** - * A dummy layering strategy which describes a strategy that is not part of the default strategies. - * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy - */ - UNKNOWN - } - export enum GroupAlignmentPolicy{ - /** - * A group layering alignment strategy which aligns groups and normal nodes that occupy the same layer to the top with - * respect to their inner layers. - * @see yfiles.hierarchic.HierarchicLayout#groupAlignmentPolicy - * @see yfiles.hierarchic.HierarchicLayout#recursiveGroupLayering - */ - TOP, - /** - * A group layering alignment strategy which aligns groups and normal nodes that occupy the same layer to the center with - * respect to their inner layers. - * @see yfiles.hierarchic.HierarchicLayout#groupAlignmentPolicy - * @see yfiles.hierarchic.HierarchicLayout#recursiveGroupLayering - */ - CENTER, - /** - * A group layering alignment strategy which aligns groups and normal nodes that occupy the same layer to the bottom with - * respect to their inner layers. - * @see yfiles.hierarchic.HierarchicLayout#groupAlignmentPolicy - * @see yfiles.hierarchic.HierarchicLayout#recursiveGroupLayering - */ - BOTTOM - } - export enum LayerType{ - /** - * A constant describing a normal layer consisting mainly of normal nodes. - */ - NORMAL, - /** - * A constant describing a layer consisting mainly of label nodes or dummy nodes. - */ - LABEL, - /** - * A constant describing a layer consisting of source group nodes and dummy nodes. - */ - SOURCE_GROUP_NODES, - /** - * A constant describing a layer consisting of target group nodes and dummy nodes. - */ - TARGET_GROUP_NODES, - /** - * Describes a layer above a group to store the connector proxies where edges connect to groups. - */ - UPPER_GROUP_CONNECTOR_NODES, - /** - * Describes a layer below a group to store the connector proxies where edges connect to groups. - */ - LOWER_GROUP_CONNECTOR_NODES - } - export enum NodeDataType{ - /** - * A constant describing a normal {@link yfiles.algorithms.Node}. - *

- * A normal node may have any degree, any size and any number of connected same-layer edges. - *

- * @see yfiles.hierarchic.INodeData#type - */ - NORMAL, - /** - * A constant describing a bend {@link yfiles.algorithms.Node}. - *

- * A bend node has degree 2, small size and no same-layer edges. - *

- * @see yfiles.hierarchic.INodeData#type - */ - BEND, - /** - * A constant describing a side proxy {@link yfiles.algorithms.Node}. - *

- * A side proxy node, in case port constraints are used for the drawing phase, has degree - * 1, small size and no same-layer edges. The associated node is the one of which this node is the proxy. - *

- * @see yfiles.hierarchic.INodeData#type - */ - SIDE_PROXY, - /** - * A constant describing a side proxy {@link yfiles.algorithms.Node} for drawing same-layer edges. - *

- * A side proxy node for drawing same-layer edges has degree - * 0, small size and one same-layer edge. The associated node is the one of which this node is the proxy. The associated - * edge is the same-layer edge of which this node is the proxy. - *

- * @see yfiles.hierarchic.INodeData#type - */ - SAME_LAYER_SIDE_PROXY, - /** - * A constant describing a label {@link yfiles.algorithms.Node}. - *

- * A label node has degree - * 2, size of the labels and no same-layer edges. The borders of this node describe the layout of the labels. - *

- * @see yfiles.hierarchic.INodeData#type - */ - LABEL, - /** - * A constant describing a group {@link yfiles.algorithms.Node} for nested graph layouts. - *

- * This group node carries additional {@link yfiles.hierarchic.ILayers} information. - *

- * @see yfiles.hierarchic.INodeData#type - * @see yfiles.hierarchic.INodeData#groupLayers - */ - GROUP, - /** - * A constant describing a source group {@link yfiles.algorithms.Node} for bus edges. - *

- * This node serves as a dummy node in a {@link yfiles.hierarchic.LayerType#SOURCE_GROUP_NODES} layer. - *

- * @see yfiles.hierarchic.INodeData#type - * @see yfiles.hierarchic.INodeData#groupId - */ - SOURCE_GROUP_NODE, - /** - * A constant describing a target group {@link yfiles.algorithms.Node} for bus edges. - *

- * This node serves as a dummy node in a {@link yfiles.hierarchic.LayerType#TARGET_GROUP_NODES} layer. - *

- * @see yfiles.hierarchic.INodeData#type - * @see yfiles.hierarchic.INodeData#groupId - */ - TARGET_GROUP_NODE, - /** - * A constant describing a back-loop proxy that belongs to the source of an edge. - *

- * A back-loop proxy that belongs to the source of an edge has degree 2, small size and exactly one same-layer edge. - *

- * @see yfiles.hierarchic.INodeData#type - */ - SOURCE_BACK_LOOP_PROXY, - /** - * A constant describing a back-loop proxy that belongs to the target of an edge. - *

- * A back-loop proxy that belongs to the target of an edge has degree 2, small size and exactly one same-layer edge. - *

- * @see yfiles.hierarchic.INodeData#type - */ - TARGET_BACK_LOOP_PROXY, - /** - * A constant describing a same-layer edge crossing dummy {@link yfiles.algorithms.Node}. - *

- * A same-layer edge crossing dummy node has degree - * 2, small size and exactly two same-layer edges. It is used for marking the crossing of the layer, if source and target - * port are at opposite layer sides. - *

- * @see yfiles.hierarchic.INodeData#type - */ - SAME_LAYER_CENTER_NODE, - /** - * A constant describing a {@link yfiles.algorithms.Node} used for the drawing phase to keep the distance between two nodes. - * @see yfiles.hierarchic.INodeData#type - */ - DISTANCE_NODE, - /** - * A constant describing a {@link yfiles.algorithms.Node} used during the drawing phase for marking the beginning of a node group - * interval. - * @see yfiles.hierarchic.INodeData#type - */ - GROUP_BEGIN, - /** - * A constant describing a {@link yfiles.algorithms.Node} used during the drawing phase for marking the ending of a node group - * interval. - * @see yfiles.hierarchic.INodeData#type - */ - GROUP_END, - /** - * A constant describing a {@link yfiles.algorithms.Node} used during the sequencing and drawing phase for marking a dummy node - * inserted to guarantee that a group is non-empty on the layer on which it is defined. - * @see yfiles.hierarchic.INodeData#type - */ - GROUP_LAYER_DUMMY, - /** - * A constant describing a {@link yfiles.algorithms.Node} used during the sequencing and drawing phase for marking a dummy node - * inserted as a legal endpoint of an edge connecting to a group node. - * @see yfiles.hierarchic.INodeData#type - */ - PROXY_FOR_EDGE_AT_GROUP, - /** - * A constant describing a {@link yfiles.algorithms.Node} used during the sequencing and drawing phase for marking a dummy node - * inserted as a legal endpoint of an edge connecting a descendant node to a group node. It has degree 0 or 1 depending on - * whether or not the opposite node of the edge is assigned to the same layer. This kind of proxy nodes is only used if - * there are edges that shall connect to the group node without backloops. - * @see yfiles.hierarchic.EdgeLayoutDescriptor#directGroupContentEdgeRouting - */ - PROXY_FOR_CONTENT_EDGE_AT_GROUP, - /** - * A constant describing a {@link yfiles.algorithms.Node} used during sequencing and drawing phase for routing an {@link yfiles.algorithms.Edge} - * recursively. An {@link yfiles.algorithms.Edge} that connects to the content of a group node has to leave the group node at the - * bottom side and enter it at the top side. - * @see yfiles.hierarchic.INodeData#type - */ - RECURSIVE_EDGE_DUMMY - } - export enum PortAssignmentMode{ - /** - * A port assignment strategy that distributes ports evenly along the border of the node. - *

- * This is the default port assignment strategy of {@link yfiles.hierarchic.HierarchicLayout}. - *

- * @see yfiles.hierarchic.NodeLayoutDescriptor#portAssignment - */ - DEFAULT, - /** - * A port assignment strategy that places all edges on grid lines. - *

- * If there are not enough grid lines for each port, ports may overlap. In case there is no grid line available at the side - * of a node, the ports are placed centered at that side. - *

- * @see yfiles.hierarchic.NodeLayoutDescriptor#portAssignment - */ - ON_GRID, - /** - * A port assignment strategy that places all edges on grid lines or sub-grid lines. - *

- * If there are not enough grid lines for each port, the grid gets subdivided with sub-grid lines until each edge has space - * for its port. - *

- * @see yfiles.hierarchic.NodeLayoutDescriptor#portAssignment - */ - ON_SUBGRID - } - export enum NodeLabelMode{ - /** - * A constant that prevents node labels from being considered during the layout. - *

- * It is used by {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode} and {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode}. - *

- * @see yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode - */ - NEVER, - /** - * A constant that makes the algorithm consider node labels for self-loops, node placement and routing. - *

- * It is used by {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode} and {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode}. - *

- * @see yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode - */ - CONSIDER_FOR_SELF_LOOPS, - /** - * A constant that makes the algorithm consider node labels for node placement and routing, but not for self-loops. - *

- * It is used by {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode} and {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode}. - *

- * @see yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode - */ - CONSIDER_FOR_DRAWING, - /** - * A constant that makes the algorithm consider node labels during routing only. - *

- * It is used by {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode} and {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode}. - *

- * @see yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode - */ - CONSIDER_FOR_ROUTING - } - export enum EdgeRoutingStyle{ - /** - * A routing style constant specifying that the edges should be orthogonal. Orthogonal edges only consist of vertical and - * horizontal segments. - */ - ORTHOGONAL, - /** - * A routing style constant specifying that the edges should be octilinear. Octilinear edges consist of vertical and - * horizontal segments as well as segments with slope -1 and 1. - */ - OCTILINEAR, - /** - * A routing style constant specifying that the edges should be polyline. - */ - POLYLINE - } - export enum GroupCompactionPolicy{ - /** - * A strategy specifying no horizontal group compaction. - *

- * This means that group node contents will occupy nearly the same horizontal positions as when not grouped at all. - *

- * @see yfiles.hierarchic.SimplexNodePlacer#groupCompactionStrategy - */ - NONE, - /** - * A strategy specifying maximal horizontal group compaction. - *

- * This means that the node placer will try to minimize the horizontally occupied space for a group node. - *

- * @see yfiles.hierarchic.SimplexNodePlacer#groupCompactionStrategy - */ - MAXIMAL - } - export enum RankingPolicy{ - /** - * A ranking policy that specifies that nodes are not re-ranked after the initial topological layering step. - */ - NO_RERANKING, - /** - * A ranking policy that specifies that nodes are re-ranked by an inexpensive downshift rule. - */ - DOWN_SHIFT, - /** - * A ranking policy that specifies that nodes are re-ranked by finding a spanning tree that contains only tight (length - * 1) edges. - */ - TIGHT_TREE - } - /** - * This layering algorithm implementation assigns nodes to layers given a mapping of nodes to layer IDs. - *

- * The layer IDs are given by a {@link yfiles.algorithms.IDataProvider} that returns the integer layer ID of each node of the - * graph. Nodes with the same ID are in the same layer while the layers are sorted according to their IDs such that the - * smallest ID represents the top layer. - *

- * @class - * @implements {yfiles.hierarchic.ILayerer} - */ - export interface GivenLayersLayerer extends yfiles.lang.Object,yfiles.hierarchic.ILayerer{} - export class GivenLayersLayerer { - /** - * Creates an instance of {@link yfiles.hierarchic.GivenLayersLayerer}. - */ - constructor(); - /** - * Assigns all nodes of the graph to layers and adds them to the {@link yfiles.hierarchic.ILayers} instance. - * @param graph the input graph - * @param layers the {@link } instance that will be filled with the results of the calculation - * @param ldp the {@link } used for querying information about the nodes and edges - */ - assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Convenience method that removes empty layers and ensures that the smallest layer has value 0. - * @param graph the graph - * @param layerId the {@link } that returns an integer value (layer) for each node; the first layer has the number - * 0 - * @param normalizedLayerId the {@link } that will be filled by the layout algorithm and holds an integer value (layer ID - * after normalization) for each node - * @returns the number of layers after the removal of empty layers - */ - normalize(graph:yfiles.algorithms.Graph,layerId:yfiles.algorithms.IDataProvider,normalizedLayerId:yfiles.algorithms.IDataAcceptor):number; - /** - * Data provider key for storing the layer IDs - *

- * This {@link yfiles.algorithms.IDataProvider} stores for each node the layer ID to which it belongs. Nodes with the same ID are - * in the same layer while the layers are sorted according to their IDs such that the smallest ID represents the top - * layer. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static LAYER_ID_DP_KEY:yfiles.algorithms.NodeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.GivenLayersLayerer; - } - /** - * This class is a {@link yfiles.hierarchic.ISequencer} implementation that determines the sequence of nodes of the same {@link yfiles.hierarchic.ILayer layer} - * based on a given {@link yfiles.collections.IComparer. comparator} constraint. - * @class - * @implements {yfiles.hierarchic.ISequencer} - */ - export interface GivenSequenceSequencer extends yfiles.lang.Object,yfiles.hierarchic.ISequencer{} - export class GivenSequenceSequencer { - /** - * Creates a new instance of {@link yfiles.hierarchic.GivenSequenceSequencer} using a given {@link yfiles.collections.IComparer.} for the sequencing. - * @param [c=null] - */ - constructor(c?:yfiles.collections.IComparer); - /** - * Calculates the sequence of the nodes within a {@link yfiles.hierarchic.ILayers} instance based on the given {@link yfiles.collections.IComparer.} instance. - *

- * This method is called by {@link yfiles.hierarchic.HierarchicLayoutCore} during the sequencing phase and finally writes back the - * calculated sequence using the {@link yfiles.hierarchic.ILayer#setNodeOrder} method. - *

- * @param graph the input graph - * @param layers the given {@link } instance containing the elements of the layers - * @param ldp the {@link } containing information about the nodes and edges of the graph - * @param itemFactory the {@link } used for creating and destroying helper structures - */ - sequenceNodeLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Gets or sets the {@link yfiles.collections.IComparer.} used by this {@link yfiles.hierarchic.GivenSequenceSequencer} to determine the sequence of the nodes. - * @type {yfiles.collections.IComparer.} - */ - sequenceComparer:yfiles.collections.IComparer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.GivenSequenceSequencer; - } - /** - * Visitor interface that can be used to traverse the descendants of a group node - * @interface - */ - export interface IVisitor extends yfiles.lang.Object{ - /** - * Visits the descendants of a group node. - * @param node A descandant of the group node. - * @param parentNode A group node. - * @abstract - */ - visit(node:yfiles.algorithms.Node,parentNode:yfiles.algorithms.Node):void; - } - var IVisitor:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.IVisitor; - }; - /** - * This class is responsible for managing hierarchically grouped graphs. - *

- * The grouping information is provided through {@link yfiles.algorithms.IDataProvider}s registered with the graph with keys - * {@link yfiles.layout.GroupingKeys#NODE_ID_DP_KEY}, {@link yfiles.layout.GroupingKeys#PARENT_NODE_ID_DP_KEY} and - * {@link yfiles.layout.GroupingKeys#GROUP_DP_KEY}. - *

- * @see yfiles.layout.GroupingSupport - * @see yfiles.layout.GroupingKeys - * @class - */ - export interface GroupingSupport extends yfiles.lang.Object{} - export class GroupingSupport { - /** - * Assigns edge group nodes to groups based on a given {@link yfiles.hierarchic.ILayers} instance. - * @param layers the given {@link } instance containing the elements in the layering - * @see yfiles.hierarchic.NodeDataType#SOURCE_GROUP_NODE - * @see yfiles.hierarchic.NodeDataType#TARGET_GROUP_NODE - */ - assignEdgeGroupNodesToGroups(layers:yfiles.hierarchic.ILayers):void; - /** - * Assigns label nodes to groups. - * @param layers the given {@link } instance containing the elements in the layering - * @param itemFactory the {@link } used temporarily for modifying the graph instance - * @see yfiles.hierarchic.NodeDataType#LABEL - * @see yfiles.hierarchic.NodeDataType#BEND - * @see yfiles.hierarchic.NodeDataType#GROUP_BEGIN - * @see yfiles.hierarchic.NodeDataType#GROUP_END - */ - assignLabelNodesToGroups(layers:yfiles.hierarchic.ILayers,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Returns the direct children of the given group node. - * @param groupNode the given group node - * @returns a {@link } of all direct children or null if {@link } {@link #active is not active} - */ - getChildren(groupNode:yfiles.algorithms.Node):yfiles.algorithms.NodeList; - /** - * Returns the descendant {@link yfiles.algorithms.Node}s of the given group node. - *

- * The descendants are all direct or indirect children of a group node. - *

- * @param groupNode the given group node - * @returns a {@link } of all descendants or null if {@link } {@link #active is not active} - */ - getDescendants(groupNode:yfiles.algorithms.Node):yfiles.algorithms.NodeList; - /** - * Returns the parent group node of the given {@link yfiles.algorithms.Node} or null if the given node is a top-level node. - * @param node the given {@link } - * @returns the parent group node or null if the given node is a top-level node or if {@link } - * {@link #active is not active} - */ - getParentNode(node:yfiles.algorithms.Node):yfiles.algorithms.Node; - /** - * Hides the group nodes and incident edges from the graph. - */ - hideGroupNodes():void; - /** - * Returns whether or not the given node is a descendant {@link yfiles.algorithms.Node} of the given group node. - *

- * The descendants are all direct or indirect children of a group node. - *

- * @param node the given node - * @param groupNode the given group node - * @returns true if the given node is a descendant of the given group node, false otherwise - */ - isDescendant(node:yfiles.algorithms.Node,groupNode:yfiles.algorithms.Node):boolean; - /** - * Returns whether or not the given {@link yfiles.algorithms.Node} is a non-empty group node. - * @param node the given {@link } - * @returns true if the given node is a non-empty group node, false otherwise - */ - isGroupNode(node:yfiles.algorithms.Node):boolean; - /** - * Removes the current assignment of source/target edge groups from a given {@link yfiles.hierarchic.ILayers} instance. - * @param layers the given {@link } instance containing the elements in the layering - * @see yfiles.hierarchic.NodeDataType#SOURCE_GROUP_NODE - * @see yfiles.hierarchic.NodeDataType#TARGET_GROUP_NODE - */ - removeEdgeGroupAssignment(layers:yfiles.hierarchic.ILayers):void; - /** - * Un-hides all previously hidden group nodes and incident edges. - */ - unhideGroupNodes():void; - /** - * Visits all descendant {@link yfiles.algorithms.Node}s of the given group node. - *

- * The descendants are all direct or indirect children of a group node. - *

- * @param groupNode the given group node - * @param visitor a {@link } implementation - */ - visitDescendants(groupNode:yfiles.algorithms.Node,visitor:yfiles.hierarchic.IVisitor):void; - /** - * Gets or sets the minimum distance between group nodes. - *

- * The minimum distance should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum distance is negative - * @type {number} - */ - minimumGroupDistance:number; - /** - * Gets whether or not {@link yfiles.hierarchic.GroupingSupport} is active. - * @type {boolean} - */ - active:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.GroupingSupport; - } - /** - * This layout algorithm arranges graphs in a hierarchic fashion. - *

- * Layout Style The nodes are distributed into layers so that most of the edges point to the main layout direction. The order of the - * nodes within the layers ensures that the number of edge crossings is as small as possible. There are different edge - * routing styles available. Edges can be orthogonal, polyline or octilinear. - *

- *

- * Hierarchical diagrams are commonly used for the visualization of hierarchical data, since they facilitate the - * identification of dependencies and relationships among the nodes of the graph. Possible application domains are the - * following: workflow visualization, call graph visualization, entity-relationship diagrams, biochemical pathways and - * network management. - *

- *

- * {@graph {"ann":{"s":[37.5,37.5],"d":1},"n":[[137.81,67.5],[137.81,135],[718.44,67.5],[147.19,202.5],[305.62,135],[296.25,202.5],[771.88,450],[354.38,285],[290,367.5],[366.88,367.5],[400.62,67.5],[709.06,135],[709.06,202.5],[366.88,450],[79.69,202.5],[492.5,285],[501.88,367.5],[627.5,285],[357.5,532.5],[363.75,202.5],[286.88,285],[425,532.5],[400.62,135],[569.38,450],[569.38,367.5],[155,450],[434.38,367.5],[636.88,367.5],[84.38,285],[151.88,285],[222.5,532.5],[290,532.5],[155,532.5],[87.5,532.5],[20,532.5],[219.38,285],[69.38,367.5],[713.75,285],[704.38,367.5],[771.88,367.5],[848.75,285],[906.88,367.5],[839.38,367.5],[400.62,0]],"e":[[0,1,0,18.75,0,-18.75],[1,3,9.38,18.75,0,-18.75],[0,4,12.5,18.75,0,-18.75,[169.06,120,324.38,120]],[4,5,-9.38,18.75,0,-18.75],[2,6,9.38,18.75,12.5,-18.75,[746.56,120,959.38,120,959.38,420,803.12,420]],[5,7,9.38,18.75,0,-18.75,[324.38,255,373.12,255]],[7,8,0,18.75,0,-18.75,[373.12,352.5,308.75,352.5]],[7,9,12.5,18.75,0,-18.75],[2,11,-9.38,18.75,0,-18.75],[11,12,0,18.75,0,-18.75],[9,13,0,18.75,0,-18.75],[1,14,-9.38,18.75,0,-18.75,[147.19,187.5,98.44,187.5]],[12,15,-14.06,18.75,0,-18.75,[713.75,255,511.25,255]],[15,16,9.38,18.75,0,-18.75],[12,17,-4.69,18.75,0,-18.75,[723.13,270,646.25,270]],[13,18,-9.38,18.75,0,-18.75],[4,19,9.38,18.75,0,-18.75,[333.75,187.5,382.5,187.5]],[5,20,-9.38,18.75,0,-18.75],[13,21,9.38,18.75,0,-18.75,[395,502.5,443.75,502.5]],[10,22,0,18.75,0,-18.75],[22,23,0,18.75,-12.5,-18.75,[419.38,420,575.62,420]],[17,24,-9.38,18.75,0,-18.75,[636.88,337.5,588.12,337.5]],[24,23,0,18.75,0,-18.75],[0,25,-12.5,18.75,-9.38,-18.75,[144.06,120,54.38,120,54.38,420,164.38,420]],[8,25,-9.38,18.75,9.38,-18.75,[299.38,420,183.12,420]],[15,26,-9.38,18.75,0,-18.75,[501.88,337.5,453.12,337.5]],[17,27,9.38,18.75,0,-18.75],[27,6,0,18.75,-12.5,-18.75,[655.62,420,778.12,420]],[3,28,-4.69,18.75,0,-18.75,[161.25,270,103.12,270]],[3,29,4.69,18.75,0,-18.75],[25,30,7.5,18.75,0,-18.75,[181.25,517.5,241.25,517.5]],[25,31,15,18.75,-9.38,-18.75,[188.75,502.5,299.38,502.5]],[8,31,9.38,18.75,9.38,-18.75],[25,32,0,18.75,0,-18.75],[25,33,-7.5,18.75,0,-18.75,[166.25,517.5,106.25,517.5]],[25,34,-15,18.75,0,-18.75,[158.75,502.5,38.75,502.5]],[3,35,14.06,18.75,0,-18.75,[180,255,238.12,255]],[3,36,-14.06,18.75,-9.38,-18.75,[151.88,255,69.38,255,69.38,337.5,78.75,337.5]],[7,36,-12.5,18.75,9.38,-18.75,[360.62,337.5,97.5,337.5]],[12,37,4.69,18.75,0,-18.75],[37,38,-9.38,18.75,0,-18.75],[38,23,0,18.75,12.5,-18.75,[723.12,435,600.62,435]],[37,39,9.38,18.75,0,-18.75,[741.88,337.5,790.62,337.5]],[39,6,0,18.75,0,-18.75],[12,40,14.06,18.75,0,-18.75,[741.88,255,867.5,255]],[40,41,9.38,18.75,0,-18.75,[876.88,337.5,925.62,337.5]],[40,42,-9.38,18.75,0,-18.75],[43,0,-12.5,18.75,0,-18.75,[406.88,52.5,156.56,52.5]],[43,2,12.5,18.75,0,-18.75,[431.88,52.5,737.19,52.5]],[43,10,0,18.75,0,-18.75]],"vp":[20.0,0.0,940.0,570.0]}} Hierarchic Layout obtained with default settingsConceptThe layout algorithm runs in three main phases: - *

- *
    - *
  • - * Layering – The nodes are distributed into layers by means of {@link yfiles.hierarchic.HierarchicLayout#fromScratchLayerer} or - * {@link yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer}, respectively. If the layout orientation is top-to-bottom, the nodes in each layer are arranged horizontally while the - * layers are ordered vertically top-to-bottom. - *
  • - *
  • - * Sequencing – The order of the nodes in each layer is determined such that the number of edge crossings is as small as possible. To - * specify the sequencing algorithm, use {@link yfiles.hierarchic.HierarchicLayout#fromScratchSequencer} or {@link yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer}. - *
  • - *
  • Drawing – The layout algorithm assigns the final coordinates to all nodes and routes the edges.
  • - *
- *

- * Features - *

- *

- * This layout algorithm is able to create hierarchic layouts from scratch or add new elements to the existing sketch - * drawing incrementally. In order to add elements incrementally to the current sketch or let the algorithm optimize - * certain elements in the current sketch, set the layout mode to {@link yfiles.hierarchic.LayoutMode#INCREMENTAL}. Then register a - * {@link yfiles.algorithms.IDataProvider} (e.g. use {@link yfiles.algorithms.Maps#createHashedDataMap}) with the graph using the {@link yfiles.hierarchic.HierarchicLayout#INCREMENTAL_HINTS_DP_KEY} - * DataProvider key and associate the hints obtained from the {@link yfiles.hierarchic.IIncrementalHintsFactory} with the elements - * to be added incrementally. - *

- *

- * {@link yfiles.hierarchic.NodeLayoutDescriptor} and {@link yfiles.hierarchic.EdgeLayoutDescriptor} instances can be used for specifying - * individual information (e.g. distances or routing styles) for each node and edge in the graph. The descriptors are bound - * to the graph using {@link yfiles.algorithms.IDataProvider}s registered with {@link yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY} - * or {@link yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. If there is no descriptor assigned to some - * nodes/edges, a default descriptor will be used. To set default descriptors use {@link yfiles.hierarchic.HierarchicLayout#nodeLayoutDescriptor} and {@link yfiles.hierarchic.HierarchicLayout#edgeLayoutDescriptor}. - *

- *

- * {@link yfiles.hierarchic.HierarchicLayout} supports two approaches to connect edges on a specific side or even an exact location - * to a node. {@link yfiles.layout.PortConstraint}s define a single constraint for the ports of an edge. To realize more complex - * port restrictions, several {@link yfiles.layout.PortCandidate}s or {@link yfiles.layout.PortCandidateSet}s can be assigned to edges or - * nodes. If an edge with registered {@link yfiles.layout.PortCandidate}s connects to nodes with {@link yfiles.layout.PortCandidateSet}s, - * the layouter will try to match both collections to find an appropriate port. In case there is no matching port - * candidate, a {@link yfiles.layout.PortCandidate} specified for the edge is preferred. For the matching to work properly, the - * candidates in both collection need to be the same instances. Since their simultaneous existence at the same node may be - * ambiguous, it is not recommended to use a combination of {@link yfiles.layout.PortConstraint}s and - * {@link yfiles.layout.PortCandidate}s in the same layout. - *

- *

- * The edge grouping feature of this layout algorithm is restricted to normal, hierarchic edges. Edges with {@link yfiles.hierarchic.EdgeLayoutDescriptor#recursiveEdgeStyle recursive edge style} - * {@link yfiles.hierarchic.RecursiveEdgeStyle#DIRECTED} or {@link yfiles.hierarchic.RecursiveEdgeStyle#UNDIRECTED} will not be grouped. - * They are also not grouped when enabling {@link yfiles.hierarchic.HierarchicLayout#automaticEdgeGrouping automatic edge grouping}. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface HierarchicLayout extends yfiles.layout.MultiStageLayout{} - export class HierarchicLayout { - /** - * Creates a new {@link yfiles.hierarchic.HierarchicLayout} instance with the default settings. - */ - constructor(); - /** - * Configures the core layout algorithm with the settings of this {@link yfiles.hierarchic.HierarchicLayout} instance. - *

- * This method is called by {@link yfiles.hierarchic.HierarchicLayout#applyLayoutCore} before the actual layout is calculated. It - * may be overridden in order to manually reconfigure the core layout algorithm. - *

- *

- * This implementation will temporarily set a {@link yfiles.hierarchic.PortCandidateOptimizer} if a {@link yfiles.algorithms.IDataProvider} - * is registered with {@link yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY} and no {@link yfiles.hierarchic.HierarchicLayoutCore#portConstraintOptimizer} is assigned. - *

- * @param graph the input graph - * @param coreLayouter the given core layout algorithm instance - * @protected - */ - configureCoreLayout(graph:yfiles.layout.LayoutGraph,coreLayouter:yfiles.hierarchic.HierarchicLayoutCore):void; - /** - * Returns a new {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance that will be used during the various phases of the layout - * algorithm to determine the drawing details of the edges of the graph. - *

- * This method may be overridden to create a new {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance with different - * configuration settings. - *

- * @returns a new {@link } instance - * @protected - */ - createEdgeLayoutDescriptor():yfiles.hierarchic.EdgeLayoutDescriptor; - /** - * Returns a new {@link yfiles.hierarchic.HierarchicLayoutCore} instance. - *

- * This method may be overridden to create a new {@link yfiles.hierarchic.HierarchicLayoutCore} object with different configuration - * settings. - *

- *

- * This factory method provides the initial {@link yfiles.hierarchic.HierarchicLayoutCore} instance. - *

- * @returns a new {@link } instance - * @protected - */ - createHierarchicLayoutCore():yfiles.hierarchic.HierarchicLayoutCore; - /** - * Returns a {@link yfiles.hierarchic.IIncrementalHintsFactory} instance that must be used to obtain hints to be associated with - * graph elements that should be laid out incrementally. - *

- * Use this factory and a {@link yfiles.algorithms.IDataProvider} that is registered to the graph using the {@link yfiles.hierarchic.HierarchicLayout#INCREMENTAL_HINTS_DP_KEY} - * key to associate appropriate hints with the graph elements that should be laid out incrementally by the algorithm. - *

- * @returns a new {@link } instance - * @see yfiles.hierarchic.HierarchicLayoutCore#createIncrementalHintsFactory - * @see yfiles.hierarchic.HierarchicLayout#INCREMENTAL_HINTS_DP_KEY - * @see yfiles.algorithms.Graph#addDataProvider - * @see yfiles.hierarchic.HierarchicLayout#layoutMode - * @see yfiles.hierarchic.LayoutMode#INCREMENTAL - */ - createIncrementalHintsFactory():yfiles.hierarchic.IIncrementalHintsFactory; - /** - * Creates and registers an incremental layer constraint factory for an {@link yfiles.graph.IGraph}. - * @param graph The graph for which the factory is created - * @returns the sequence constraint factory - */ - createLayerConstraintFactory(graph:yfiles.graph.IGraph):yfiles.hierarchic.ILayerConstraintFactory; - /** - * Returns a {@link yfiles.hierarchic.ILayerConstraintFactory} instance that can be used for specifying layer constraints for the - * given graph. - *

- * The instance is usually bound to {@link yfiles.algorithms.Graph} instance - * graph, i.e., if the input graph for the layerer changes, a new instance must be retrieved. This instance can be used for - * creating constraints for this graph instance. - *

- *

- * You can create an instance without binding it to a graph instance initially by passing a null parameter. In that case, - * you must bind the returned instance to the graph, see {@link yfiles.hierarchic.HierarchicLayout#LAYER_CONSTRAINTS_MEMENTO_DP_KEY} - * and {@link yfiles.hierarchic.ILayerConstraintFactory#memento}. - *

- * @param graph the input graph - * @returns a new {@link } instance - */ - createLayerConstraintFactory(graph:yfiles.algorithms.Graph):yfiles.hierarchic.ILayerConstraintFactory; - /** - * Returns a new {@link yfiles.hierarchic.NodeLayoutDescriptor} instance that will be used during the various phases of the layout - * algorithm to determine the drawing details of the nodes of the graph. - *

- * This method may be overridden to create a new {@link yfiles.hierarchic.NodeLayoutDescriptor} instance with different - * configuration settings. - *

- * @returns a new {@link } instance - * @protected - */ - createNodeLayoutDescriptor():yfiles.hierarchic.NodeLayoutDescriptor; - /** - * Creates and registers a sequencer constraint factory for an {@link yfiles.graph.IGraph}. - * @param graph The graph. - * @returns the sequence constraint factory - */ - createSequenceConstraintFactory(graph:yfiles.graph.IGraph):yfiles.hierarchic.ISequenceConstraintFactory; - /** - * Returns a {@link yfiles.hierarchic.ISequenceConstraintFactory} instance that can be used for specifying sequence constraints for - * the given graph. - *

- * For these sequence constraints to have any effect, the {@link yfiles.hierarchic.ISequencer} that determines the in-layer node - * order (sequence) has to support constraints. Both, {@link yfiles.hierarchic.DefaultLayerSequencer DefaultLayerSequencer} and the incremental sequencer used internally support - * sequence constraints. - *

- * @param graph the input graph - * @returns a {@link } instance - * @see yfiles.hierarchic.HierarchicLayout#fromScratchSequencer - * @see yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer - */ - createSequenceConstraintFactory(graph:yfiles.layout.LayoutGraph):yfiles.hierarchic.ISequenceConstraintFactory; - /** - * Disposes of the core layout algorithm. - *

- * This method is called by {@link yfiles.hierarchic.HierarchicLayout#applyLayoutCore} after the actual layout is calculated. It - * may be overridden in order to revert a custom configuration made in - * {@link yfiles.hierarchic.HierarchicLayout#configureCoreLayout}. - *

- *

- * This implementation will remove the {@link yfiles.hierarchic.PortCandidateOptimizer} that was created in case a {@link yfiles.algorithms.IDataProvider} - * is registered with {@link yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY} and no {@link yfiles.hierarchic.HierarchicLayoutCore#portConstraintOptimizer} was initially assigned. - *

- * @param graph the input graph - * @param coreLayouter the given core layout algorithm instance - * @protected - */ - disposeCoreLayout(graph:yfiles.layout.LayoutGraph,coreLayouter:yfiles.hierarchic.HierarchicLayoutCore):void; - /** - * Returns the mirror mask of the {@link yfiles.layout.MultiStageLayout#orientationLayout orientation layouter}. - *

- * It may be overridden in order to configure a different mirror mask. - *

- * @returns the mirror mask - * @protected - */ - getMirrorMode():yfiles.layout.MirrorModes; - /** - * Data provider key for specifying the directedness of edges - *

- * Generally, the hierarchic layout algorithm assigns nodes to layers such that most of the edges point in the - * {@link yfiles.layout.MultiStageLayout#layoutOrientation main layout direction}. The directedness of an edge specifies whether it should comply with this strategy. More - * precisely, a value of 1 means that the edge should fully comply, a value of -1 that it should comply inversely (the edge - * should point against the main layout direction), and a value of 0 means that the direction doesn't matter at all and the - * endpoints of the edges may be placed at the same layer. If there are conflicting preferences, edges with higher absolute - * values are more likely to point in the desired direction. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_DIRECTEDNESS_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for defining the priority of critical edges - *

- * Critical edges highlight different edge paths that are relevant for a user. The layouter tries to vertically align each - * node pair that is connected by a critical edge. Conflicts between different critical edges are always resolved in favor - * of the higher priority. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static CRITICAL_EDGE_PRIORITY_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for specifying the thickness of the edges - *

- * The specified non-negative thickness is considered when calculating minimum distances so that there are no overlaps - * between edges and other graph elements. By default, each edge has thickness 0. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_THICKNESS_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for specifying incremental hints - *

- * Incremental hints are created using an {@link yfiles.hierarchic.HierarchicLayout#createIncrementalHintsFactory incremental hints factory}. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY - * @see yfiles.hierarchic.IIncrementalHintsFactory - * @const - * @static - * @type {yfiles.algorithms.GraphObjectDpKey.} - */ - static INCREMENTAL_HINTS_DP_KEY:yfiles.algorithms.GraphObjectDpKey; - /** - * Data acceptor key for publishing the layer IDs for all nodes in the graph - * @see yfiles.hierarchic.HierarchicLayoutCore#LAYER_INDEX_DP_KEY - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static LAYER_INDEX_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data acceptor key for publishing the index inside their layer for all nodes in the graph - * @see yfiles.hierarchic.HierarchicLayoutCore#SEQUENCE_INDEX_DP_KEY - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static SEQUENCE_INDEX_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for defining swimlanes for the nodes - *

- * The layout algorithm will arrange nodes in swimlanes according to the registered descriptors. - *

- *

- * Layout information about the swimlanes is finally written back to the descriptor instances. Instances can be shared - * among multiple nodes in the same lane. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#SWIMLANE_DESCRIPTOR_DP_KEY - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static SWIMLANE_DESCRIPTOR_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for associating an alternative bounds with the collapsed/expanded group - *

- * When running in {@link yfiles.hierarchic.LayoutMode#INCREMENTAL incremental} - * {@link yfiles.hierarchic.HierarchicLayout#layoutMode layout mode}, the alternative bounds of the collapsed/expanded group will be used during the layering and sequencing - * phase of the algorithm. - *

- * @see yfiles.hierarchic.HierarchicLayout#ALTERNATIVE_EDGE_PATH_DP_KEY - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static ALTERNATIVE_GROUP_BOUNDS_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for associating alternative paths for edges connecting to groups, group content or folder nodes - *

- * When running in {@link yfiles.hierarchic.LayoutMode#INCREMENTAL incremental} - * {@link yfiles.hierarchic.HierarchicLayout#layoutMode layout mode}, the alternative edge paths are considered during the routing of fixed (i.e., non-incremental) edges. - *

- *

- * The alternative paths should be used in conjunction with {@link yfiles.hierarchic.HierarchicLayout#ALTERNATIVE_GROUP_BOUNDS_DP_KEY alternative group bounds} to achieve more stable layout results - * when collapsing/expanding a group node as follows: - *

- *
    - *
  1. - * Collapsing: edges adjacent to the group itself and edges where one of the endpoints (source/target) lies inside the - * group should get the path before collapsing the group as alternative path. If both endpoints are either inside or outside the - * group, no alternative path is required. - *
  2. - *
  3. - * Expanding: edges adjacent to the expanded folder node (which is now a group) should get the path before expanding as - * alternative path. - *
  4. - *
- * @see yfiles.hierarchic.HierarchicLayout#ALTERNATIVE_GROUP_BOUNDS_DP_KEY - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static ALTERNATIVE_EDGE_PATH_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for marking folder nodes - *

- * When using recursive edge styles in incremental mode, edges will also start at the bottom and end at the top of marked - * folder nodes. This will keep the edge routes more stable since the connection sides won't change. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static FOLDER_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for storing the constraint graph - *

- * A v1 before v2 constraint is represented as an edge between the representatives of v1 and v2 in the constraint graph. - *

- * @const - * @static - * @type {yfiles.algorithms.GraphDpKey.} - */ - static SEQUENCE_CONSTRAINTS_MEMENTO_DP_KEY:yfiles.algorithms.GraphDpKey; - /** - * Data provider key for storing the constraint graph - * @const - * @static - * @type {yfiles.algorithms.GraphDpKey.} - */ - static LAYER_CONSTRAINTS_MEMENTO_DP_KEY:yfiles.algorithms.GraphDpKey; - /** - * Gets or sets the group layer alignment strategy used for recursive group layering. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown group alignment policy is given - * @see yfiles.hierarchic.HierarchicLayout#recursiveGroupLayering - * @type {yfiles.hierarchic.GroupAlignmentPolicy} - */ - groupAlignmentPolicy:yfiles.hierarchic.GroupAlignmentPolicy; - /** - * Gets or sets whether or not layer compaction for recursive group layering is active. - *

- * The number of node layers is decreased if possible without reversing edge directions. The resulting layering tries to - * keep the layer span of a group node minimum while minimizing the overall vertical space. - *

- * @see yfiles.hierarchic.HierarchicLayout#recursiveGroupLayering - * @type {boolean} - */ - compactGroups:boolean; - /** - * Gets or sets the policy that specifies how to arrange connected components. - * @throws {Stubs.Exceptions.ArgumentError} if the specified policy does not match a default component arrangement policy - * @type {yfiles.hierarchic.ComponentArrangementPolicy} - */ - componentArrangementPolicy:yfiles.hierarchic.ComponentArrangementPolicy; - /** - * Gets or sets the time limit (in milliseconds) set for the layout algorithm. - *

- * Values have to be greater or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the maximum duration is negative - * @type {number} - */ - maximumDuration:number; - /** - * Gets or sets whether or not groups are respected during the layering stage. - *

- * If this option is enabled, groups are layered recursively, i.e. - *

- *
    - *
  • nodes in the same group always occupy adjacent layers
  • - *
  • layer intervals spanned by different group nodes are either disjoint or are nested
  • - *
- *

- * If it is disabled, group information is ignored for the layering step. - *

- *

- * If the graph is flat, this setting is ignored. - *

- * @see yfiles.hierarchic.HierarchicLayout#compactGroups - * @type {boolean} - */ - recursiveGroupLayering:boolean; - /** - * Gets or sets the equidistant spacing between the horizontal and vertical grid lines. - *

- * When the spacing is negative or zero, no grid is defined, otherwise nodes and edges are placed on multiples of the grid - * spacing. - *

- * @see yfiles.hierarchic.IIncrementalHintsFactory - * @type {number} - */ - gridSpacing:number; - /** - * Gets or sets whether or not reversed edges should be routed as back-loops. - *

- * When this option is enabled, back-loops attach to the same node sides as the other edges, i.e., for layout orientation - * top-to-bottom, they leave their source at the bottom and enter their target at the top. - *

- * @type {boolean} - */ - backLoopRouting:boolean; - /** - * Gets or sets whether or not self-loops should be routed in a similar manner as back-loops. - *

- * Self-loops will start at the bottom of their attached nodes and end at the top of them. - *

- * @see yfiles.hierarchic.HierarchicLayout#backLoopRouting - * @type {boolean} - */ - backLoopRoutingForSelfLoops:boolean; - /** - * Gets or sets whether or not edges are grouped automatically. - *

- * The automatic edge grouping tries to group a high number of edges without changing the semantic of the graph, i.e., it - * groups edges either at a common source node or a common target node. Edge groupings often allow more compact layouts - * since grouped edges are routed in a bus-style manner. - *

- * @type {boolean} - */ - automaticEdgeGrouping:boolean; - /** - * Gets or sets whether or not edges should be routed orthogonally. - *

- * When orthogonal routing is enabled, all resulting edge paths will be composed of vertical and horizontal segments, - * only. - *

- * @type {boolean} - */ - orthogonalRouting:boolean; - /** - * Gets or sets whether or not the layout algorithm reserves space for labels and places them. - *

- * To define the desired placement for each label add a {@link yfiles.layout.PreferredPlacementDescriptor} on - * {@link yfiles.layout.IEdgeLabelLayout}. - *

- *

- * This method is a convenience method that assures that the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm} is of type {@link yfiles.layout.LabelLayoutTranslator} - * and {@link yfiles.layout.LabelLayoutTranslator#translateEdgeLabels} is set to true. - *

- * @throws {Stubs.Exceptions.InvalidOperationError} if integrated labeling should be enabled but the current {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm} is not of type - * {@link yfiles.layout.LabelLayoutTranslator} - * @throws {Stubs.Exceptions.InvalidOperationError} if no properly configured {@link yfiles.layout.LabelLayoutTranslator} is registered even though integrated labeling was enabled - * earlier (can happen when manually specifying the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm}). - * @type {boolean} - */ - integratedEdgeLabeling:boolean; - /** - * Gets or sets whether or not the layout algorithm considers node labels when calculating node positions to avoid - * overlaps. - *

- * This method is a convenience method that assures that the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm} is of type {@link yfiles.layout.LabelLayoutTranslator} - * and {@link yfiles.layout.LabelLayoutTranslator#translateNodeLabels} is set to true. - *

- * @throws {Stubs.Exceptions.InvalidOperationError} if this property should be enabled but the current {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm} is not of type - * {@link yfiles.layout.LabelLayoutTranslator} - * @throws {Stubs.Exceptions.InvalidOperationError} if no properly configured {@link yfiles.layout.LabelLayoutTranslator} is registered even though this property was enabled - * earlier (can happen when manually specifying the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm}). - * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Gets or sets the minimum distance between two adjacent layers. - *

- * The specified distance should have a non-negative value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the distance is negative - * @type {number} - */ - minimumLayerDistance:number; - /** - * Gets or sets whether or not to stop the layout algorithm after the layering step. - *

- * By then, each node will be assigned to a layer. Since the sequencing and drawing phases are skipped, the order of the - * nodes within a layer matches the initial order of the nodes, edges won't be routed and the nodes won't get coordinates - * assigned. - *

- *

- * The calculated layering information can be retrieved from the {@link yfiles.algorithms.IDataProvider} registered with the key - * {@link yfiles.hierarchic.HierarchicLayout#LAYER_INDEX_DP_KEY}. - *

- * @see yfiles.hierarchic.HierarchicLayout#LAYER_INDEX_DP_KEY - * @type {boolean} - */ - stopAfterLayering:boolean; - /** - * Gets or sets whether or not to stop the layout algorithm after the sequencing step. - *

- * By then, each node will be assigned to a layer and will have a place in the sequence of nodes in this layer. Since the - * drawing phase is skipped, edges won't be routed and the nodes won't get coordinates assigned. - *

- *

- * The calculated layering and sequencing information can be retrieved from the {@link yfiles.algorithms.IDataProvider}s registered - * with the keys {@link yfiles.hierarchic.HierarchicLayout#LAYER_INDEX_DP_KEY} and - * {@link yfiles.hierarchic.HierarchicLayout#SEQUENCE_INDEX_DP_KEY}. - *

- * @see yfiles.hierarchic.HierarchicLayout#SEQUENCE_INDEX_DP_KEY - * @see yfiles.hierarchic.HierarchicLayout#LAYER_INDEX_DP_KEY - * @type {boolean} - */ - stopAfterSequencing:boolean; - /** - * Gets or sets the minimum distance between two adjacent nodes in one layer. - *

- * All values have to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the distance is negative - * @throws {Stubs.Exceptions.InvalidOperationError} if the current {@link yfiles.hierarchic.IDrawingDistanceCalculator} is not an instance of - * {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} - * @type {number} - */ - nodeToNodeDistance:number; - /** - * Gets or sets the minimum distance between an edge and an adjacent node in one layer. - *

- * All values have to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the distance is negative - * @throws {Stubs.Exceptions.InvalidOperationError} if the current {@link yfiles.hierarchic.IDrawingDistanceCalculator} is not an instance of - * {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} - * @type {number} - */ - nodeToEdgeDistance:number; - /** - * Gets or sets the minimum distance between two adjacent edges in one layer. - *

- * All values have to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the distance is negative - * @throws {Stubs.Exceptions.InvalidOperationError} if the current {@link yfiles.hierarchic.IDrawingDistanceCalculator} is not an instance of - * {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} - * @type {number} - */ - edgeToEdgeDistance:number; - /** - * Gets or sets whether or not to separate layers. - *

- * In case layers are not separated, nodes of a layer may extend into adjacent layers. Otherwise, nodes of different layers - * are strictly separated, i.e., layers are placed below each other. - *

- * @type {boolean} - */ - separateLayers:boolean; - /** - * Gets the {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} that is registered with the layout algorithm by default. - * @throws {Stubs.Exceptions.InvalidOperationError} if the current instance returned by {@link yfiles.hierarchic.HierarchicLayoutCore#drawingDistanceCalculator} is not an instance of {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} - * @protected - * @type {yfiles.hierarchic.DefaultDrawingDistanceCalculator} - */ - defaultDrawingDistanceCalculator:yfiles.hierarchic.DefaultDrawingDistanceCalculator; - /** - * Gets the current layout algorithm instance. - *

- * By default, this method will return a {@link yfiles.hierarchic.HierarchicLayoutCore} instance created with - * {@link yfiles.hierarchic.HierarchicLayout#createHierarchicLayoutCore}. - *

- * @see yfiles.hierarchic.HierarchicLayout#createHierarchicLayoutCore - * @type {yfiles.hierarchic.HierarchicLayoutCore} - */ - hierarchicLayoutCore:yfiles.hierarchic.HierarchicLayoutCore; - /** - * Gets or sets a predefined layering strategy for the {@link yfiles.hierarchic.HierarchicLayout#fromScratchLayerer from scratch} layerer. - *

- * The layouter assigns the nodes to separate layers. The nodes within each layer will be placed on the same horizontal - * layer. The layers will be arranged vertically starting with the small-numbered layers. - *

- *

- * An important layering strategy for the hierarchic layout style is called Hierarchical Layering. A hierarchical layering - * tries to assign nodes to layers in a way such that as much edges of the graph as possible will point to the main layout - * direction, i.e., the start nodes of the edges will be in a layer with a smaller number than the corresponding end nodes. - * Also, a hierarchical layering will never put two connected nodes in the same layer. - *

- *

- * This method wraps the internal implementations into a {@link yfiles.hierarchic.MultiComponentLayerer} instance so that it is - * possible to specify the behavior of the algorithm if the {@link yfiles.layout.MultiStageLayout#componentLayoutEnabled component layouter} is disabled. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an unknown strategy is given - * @type {yfiles.hierarchic.LayeringStrategy} - */ - fromScratchLayeringStrategy:yfiles.hierarchic.LayeringStrategy; - /** - * Gets or sets the {@link yfiles.hierarchic.ILayerer} instance that obtains the layering for the nodes if the layout algorithm - * runs in {@link yfiles.hierarchic.LayoutMode#FROM_SCRATCH From Scratch mode}. - *

- * If the graph consists of multiple components, then the {@link yfiles.hierarchic.ILayerer} instance should be wrapped in - * {@link yfiles.hierarchic.MultiComponentLayerer}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the {@link yfiles.hierarchic.ILayerer} is null - * @see yfiles.hierarchic.HierarchicLayout#layoutMode - * @type {yfiles.hierarchic.ILayerer} - */ - fromScratchLayerer:yfiles.hierarchic.ILayerer; - /** - * Gets or sets the {@link yfiles.hierarchic.ISequencer} instance that calculates the node sequence if the layout algorithm runs in - * {@link yfiles.hierarchic.LayoutMode#FROM_SCRATCH From Scratch mode}. - * @throws {Stubs.Exceptions.ArgumentError} if the {@link yfiles.hierarchic.ISequencer} is null - * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayerer - * @see yfiles.hierarchic.HierarchicLayout#layoutMode - * @type {yfiles.hierarchic.ISequencer} - */ - fromScratchSequencer:yfiles.hierarchic.ISequencer; - /** - * Gets or sets the {@link yfiles.hierarchic.INodePlacer} instance that will calculate the final node placement of the layout. - * @throws {Stubs.Exceptions.ArgumentError} if the {@link yfiles.hierarchic.INodePlacer} is null - * @type {yfiles.hierarchic.INodePlacer} - */ - nodePlacer:yfiles.hierarchic.INodePlacer; - /** - * Gets or sets the {@link yfiles.hierarchic.ILayerer} instance that obtains the layering for fixed nodes during the incremental - * layout run. - * @throws {Stubs.Exceptions.ArgumentError} if the {@link yfiles.hierarchic.ILayerer} is null - * @see yfiles.hierarchic.HierarchicLayout#layoutMode - * @type {yfiles.hierarchic.ILayerer} - */ - fixedElementsLayerer:yfiles.hierarchic.ILayerer; - /** - * Gets or sets the {@link yfiles.hierarchic.ISequencer} instance that calculates the sequence of the fixed nodes during the - * incremental layout run. - * @throws {Stubs.Exceptions.ArgumentError} if the given {@link yfiles.hierarchic.ISequencer} is null - * @see yfiles.hierarchic.HierarchicLayout#layoutMode - * @type {yfiles.hierarchic.ISequencer} - */ - fixedElementsSequencer:yfiles.hierarchic.ISequencer; - /** - * Gets or sets the layout mode this layouter should use for upcoming layouts. - *

- * Depending on the mode the layout algorithm will use different {@link yfiles.hierarchic.ILayerer} and {@link yfiles.hierarchic.ISequencer} - * implementations. - *
- *

- * @throws {Stubs.Exceptions.ArgumentError} if the given layout mode is unknown - * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayerer - * @see yfiles.hierarchic.HierarchicLayout#fromScratchSequencer - * @see yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer - * @see yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer - * @type {yfiles.hierarchic.LayoutMode} - */ - layoutMode:yfiles.hierarchic.LayoutMode; - /** - * Gets or sets the {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance used for all those edges that do not have a specific - * layout descriptor assigned. - *

- * By default, this method will return a {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance created with - * {@link yfiles.hierarchic.HierarchicLayout#createEdgeLayoutDescriptor}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the {@link yfiles.hierarchic.EdgeLayoutDescriptor} is null - * @see yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @type {yfiles.hierarchic.EdgeLayoutDescriptor} - */ - edgeLayoutDescriptor:yfiles.hierarchic.EdgeLayoutDescriptor; - /** - * Gets or sets the {@link yfiles.hierarchic.NodeLayoutDescriptor} instance used for all those nodes that do not have a specific - * layout descriptor assigned. - *

- * By default, this method will return a {@link yfiles.hierarchic.NodeLayoutDescriptor} instance created with - * {@link yfiles.hierarchic.HierarchicLayout#createNodeLayoutDescriptor}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given {@link yfiles.hierarchic.NodeLayoutDescriptor} is null - * @see yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY - * @see yfiles.hierarchic.HierarchicLayout#createNodeLayoutDescriptor - * @type {yfiles.hierarchic.NodeLayoutDescriptor} - */ - nodeLayoutDescriptor:yfiles.hierarchic.NodeLayoutDescriptor; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.HierarchicLayout; - } - /** - * This class arranges graphs in a hierarchic/layered fashion and supports complete re-layout as well as incremental graph - * layout. - *

- * Note that class {@link yfiles.hierarchic.HierarchicLayout} offers a facade to this class which is easier to use. Hence, we - * strongly recommend to not directly use class {@link yfiles.hierarchic.HierarchicLayoutCore}. - *

- *

- * Layout Style The nodes are distributed into layers such that most of the edges point to the main layout direction. The order of the - * nodes within the layers ensures that the number of edge crossings is as small as possible. There are different edge - * routing styles available. Edges can be orthogonal, polyline or octilinear. - *

- *

- * Hierarchical diagrams are commonly used for the visualization of hierarchical data, since they facilitate the - * identification of dependencies and relationships among the nodes of the graph. Possible application domains are the - * following: workflow visualization, call graph visualization, entity-relationship diagrams, biochemical pathways and - * network management. - *

- *

- * {@graph {"ann":{"s":[37.5,37.5],"d":1},"n":[[137.81,67.5],[137.81,135],[718.44,67.5],[147.19,202.5],[305.62,135],[296.25,202.5],[771.88,450],[354.38,285],[290,367.5],[366.88,367.5],[400.62,67.5],[709.06,135],[709.06,202.5],[366.88,450],[79.69,202.5],[492.5,285],[501.88,367.5],[627.5,285],[357.5,532.5],[363.75,202.5],[286.88,285],[425,532.5],[400.62,135],[569.38,450],[569.38,367.5],[155,450],[434.38,367.5],[636.88,367.5],[84.38,285],[151.88,285],[222.5,532.5],[290,532.5],[155,532.5],[87.5,532.5],[20,532.5],[219.38,285],[69.38,367.5],[713.75,285],[704.38,367.5],[771.88,367.5],[848.75,285],[906.88,367.5],[839.38,367.5],[400.62,0]],"e":[[0,1,0,18.75,0,-18.75],[1,3,9.38,18.75,0,-18.75],[0,4,12.5,18.75,0,-18.75,[169.06,120,324.38,120]],[4,5,-9.38,18.75,0,-18.75],[2,6,9.38,18.75,12.5,-18.75,[746.56,120,959.38,120,959.38,420,803.12,420]],[5,7,9.38,18.75,0,-18.75,[324.38,255,373.12,255]],[7,8,0,18.75,0,-18.75,[373.12,352.5,308.75,352.5]],[7,9,12.5,18.75,0,-18.75],[2,11,-9.38,18.75,0,-18.75],[11,12,0,18.75,0,-18.75],[9,13,0,18.75,0,-18.75],[1,14,-9.38,18.75,0,-18.75,[147.19,187.5,98.44,187.5]],[12,15,-14.06,18.75,0,-18.75,[713.75,255,511.25,255]],[15,16,9.38,18.75,0,-18.75],[12,17,-4.69,18.75,0,-18.75,[723.13,270,646.25,270]],[13,18,-9.38,18.75,0,-18.75],[4,19,9.38,18.75,0,-18.75,[333.75,187.5,382.5,187.5]],[5,20,-9.38,18.75,0,-18.75],[13,21,9.38,18.75,0,-18.75,[395,502.5,443.75,502.5]],[10,22,0,18.75,0,-18.75],[22,23,0,18.75,-12.5,-18.75,[419.38,420,575.62,420]],[17,24,-9.38,18.75,0,-18.75,[636.88,337.5,588.12,337.5]],[24,23,0,18.75,0,-18.75],[0,25,-12.5,18.75,-9.38,-18.75,[144.06,120,54.38,120,54.38,420,164.38,420]],[8,25,-9.38,18.75,9.38,-18.75,[299.38,420,183.12,420]],[15,26,-9.38,18.75,0,-18.75,[501.88,337.5,453.12,337.5]],[17,27,9.38,18.75,0,-18.75],[27,6,0,18.75,-12.5,-18.75,[655.62,420,778.12,420]],[3,28,-4.69,18.75,0,-18.75,[161.25,270,103.12,270]],[3,29,4.69,18.75,0,-18.75],[25,30,7.5,18.75,0,-18.75,[181.25,517.5,241.25,517.5]],[25,31,15,18.75,-9.38,-18.75,[188.75,502.5,299.38,502.5]],[8,31,9.38,18.75,9.38,-18.75],[25,32,0,18.75,0,-18.75],[25,33,-7.5,18.75,0,-18.75,[166.25,517.5,106.25,517.5]],[25,34,-15,18.75,0,-18.75,[158.75,502.5,38.75,502.5]],[3,35,14.06,18.75,0,-18.75,[180,255,238.12,255]],[3,36,-14.06,18.75,-9.38,-18.75,[151.88,255,69.38,255,69.38,337.5,78.75,337.5]],[7,36,-12.5,18.75,9.38,-18.75,[360.62,337.5,97.5,337.5]],[12,37,4.69,18.75,0,-18.75],[37,38,-9.38,18.75,0,-18.75],[38,23,0,18.75,12.5,-18.75,[723.12,435,600.62,435]],[37,39,9.38,18.75,0,-18.75,[741.88,337.5,790.62,337.5]],[39,6,0,18.75,0,-18.75],[12,40,14.06,18.75,0,-18.75,[741.88,255,867.5,255]],[40,41,9.38,18.75,0,-18.75,[876.88,337.5,925.62,337.5]],[40,42,-9.38,18.75,0,-18.75],[43,0,-12.5,18.75,0,-18.75,[406.88,52.5,156.56,52.5]],[43,2,12.5,18.75,0,-18.75,[431.88,52.5,737.19,52.5]],[43,10,0,18.75,0,-18.75]],"vp":[20.0,0.0,940.0,570.0]}} Hierarchic Layout obtained with default settingsConceptThe layout algorithm runs in three main phases: - *

- *
    - *
  • - * Layering – The nodes are distributed into layers by means of - * {@link yfiles.hierarchic.HierarchicLayoutCore#layerer}. If the layout orientation is top-to-bottom, the nodes in each layer are arranged horizontally while the layers are - * ordered vertically top-to-bottom. - *
  • - *
  • - * Sequencing – The order of the nodes in each layer is determined such that the number of edge crossings is as small as possible. To - * specify the sequencing algorithm, use {@link yfiles.hierarchic.HierarchicLayoutCore#sequencer}. - *
  • - *
  • Drawing – The layout algorithm assigns the final coordinates to all nodes and routes the edges.
  • - *
- *

- * Features - *

- *

- * In order to customize this layout algorithm, modify the {@link yfiles.hierarchic.HierarchicLayoutCore#layerer Layerer}, {@link yfiles.hierarchic.HierarchicLayoutCore#sequencer Sequencer}, {@link yfiles.hierarchic.HierarchicLayoutCore#portAllocator PortAllocator}, {@link yfiles.hierarchic.HierarchicLayoutCore#drawingDistanceCalculator DrawingDistanceCalculator}, - * and {@link yfiles.hierarchic.HierarchicLayoutCore#nodePlacer NodePlacer} instances. - *

- *

- * This layout algorithm is able to incrementally add new elements to an existing drawing of a graph. In order to add - * elements incrementally, register a {@link yfiles.algorithms.IDataProvider} with the graph using the {@link yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY} - * DataProvider key and associate the hints obtained from the {@link yfiles.hierarchic.IIncrementalHintsFactory} with the elements - * to be added incrementally. - *

- *

- * {@link yfiles.hierarchic.NodeLayoutDescriptor} and {@link yfiles.hierarchic.EdgeLayoutDescriptor} instances can be used for specifying - * individual information (e.g. distances or routing styles) for each node and edge in the graph. The descriptors are bound - * to the graph using {@link yfiles.algorithms.IDataProvider}s registered with {@link yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY} - * or {@link yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. - *

- *

- * {@link yfiles.hierarchic.HierarchicLayoutCore} supports two approaches to connect edges on a specific side or even an exact - * location to a node. {@link yfiles.layout.PortConstraint}s define a single constraint for the ports of an edge. To realize more - * complex port restrictions, several {@link yfiles.layout.PortCandidate}s or {@link yfiles.layout.PortCandidateSet}s can be assigned to - * edges or nodes. If an edge with registered {@link yfiles.layout.PortCandidate}s connects to nodes with - * {@link yfiles.layout.PortCandidateSet}s, the layouter will try to match both collections to find an appropriate port. In case - * there is no matching port candidate, a {@link yfiles.layout.PortCandidate} specified for the edge is preferred. Since their - * simultaneous existence at the same node may be ambiguous, it is not recommended to use a combination of - * {@link yfiles.layout.PortConstraint}s and {@link yfiles.layout.PortCandidate}s in the same layout. - *

- *

- * This algorithm specifies a {@link yfiles.layout.LabelLayoutTranslator} instance as the current {@link yfiles.layout.MultiStageLayout#labeling} and configures it such that the - * node labels are passed to it by setting {@link yfiles.layout.LabelLayoutTranslator#translateNodeLabels} to true. - *

- *

- * In order to enable integrated edge labeling of this algorithm, make sure {@link yfiles.layout.LabelLayoutTranslator} is - * registered and edge labels are being translated and written back after the layout. - *

- *

- * Moreover, this algorithm supports layer and sequence constraints. These constraints can be specified using a {@link yfiles.hierarchic.ILayerConstraintFactory} - * and {@link yfiles.hierarchic.ISequenceConstraintFactory}, respectively. - *

- * @see yfiles.hierarchic.HierarchicLayout - * @see yfiles.hierarchic.ILayerer - * @see yfiles.hierarchic.ISequencer - * @see yfiles.hierarchic.IPortAllocator - * @see yfiles.hierarchic.IDrawingDistanceCalculator - * @see yfiles.hierarchic.INodePlacer - * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface HierarchicLayoutCore extends yfiles.layout.MultiStageLayout{} - export class HierarchicLayoutCore { - /** - * Creates a new {@link yfiles.hierarchic.HierarchicLayoutCore} instance with the default settings. - * @see yfiles.hierarchic.HierarchicLayoutCore#createLayerer - * @see yfiles.hierarchic.HierarchicLayoutCore#createIncrementalLayerer - * @see yfiles.hierarchic.HierarchicLayoutCore#createSequencer - * @see yfiles.hierarchic.HierarchicLayoutCore#createDrawingDistanceCalculator - * @see yfiles.hierarchic.HierarchicLayoutCore#createNodePlacer - */ - constructor(); - /** - * Factory method that is called lazily upon first usage by {@link yfiles.hierarchic.HierarchicLayoutCore#drawingDistanceCalculator} if the given {@link yfiles.hierarchic.IDrawingDistanceCalculator} - * instance is null. - *

- * The default implementation returns a {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} instance. It may be overridden - * to return a custom {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} instance. - *

- * @returns a {@link } instance - * @see yfiles.hierarchic.HierarchicLayoutCore#drawingDistanceCalculator - * @protected - */ - createDrawingDistanceCalculator():yfiles.hierarchic.IDrawingDistanceCalculator; - /** - * Factory method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and reates an appropriate {@link yfiles.hierarchic.IEdgeReverser} - * implementation. - *

- * By default, a suitable private implementation of {@link yfiles.hierarchic.IEdgeReverser} is returned. It may be overridden to - * return a custom {@link yfiles.hierarchic.IEdgeReverser} implementation. - *

- * @returns an implementation - * @protected - */ - createEdgeReverser():yfiles.hierarchic.IEdgeReverser; - /** - * Factory method that is called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and creates a {@link yfiles.layout.GroupingSupport} - * instance in case of a grouped graph. - * @param graph the input graph - * @returns a {@link } instance or null if the graph is not grouped - * @protected - */ - createGrouping(graph:yfiles.layout.LayoutGraph):yfiles.layout.GroupingSupport; - /** - * Creates an {@link yfiles.hierarchic.IIncrementalHintsFactory} implementation used for obtaining hint objects associated with - * nodes and edges of the graph prior to the invocation of the layout algorithm. - *

- * Incremental hints can be obtained from a {@link yfiles.algorithms.IDataProvider} that is registered with the graph using key - * {@link yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY}. - *

- * @returns an {@link } instance - * @see yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY - */ - createIncrementalHintsFactory():yfiles.hierarchic.IIncrementalHintsFactory; - /** - * Factory method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and creates an appropriate {@link yfiles.hierarchic.ILayerer} - * implementation. - *

- * By default, a {@link yfiles.hierarchic.ConstraintIncrementalLayerer} instance with a {@link yfiles.hierarchic.TopologicalLayerer} - * instance as argument is returned. This method may be overridden to return a custom {@link yfiles.hierarchic.ILayerer} - * implementation. - *

- * @returns a {@link } implementation - * @protected - */ - createIncrementalLayerer():yfiles.hierarchic.ILayerer; - /** - * Callback method that is called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore}, creates the {@link yfiles.hierarchic.INodeData} - * and {@link yfiles.hierarchic.IEdgeData} instances and binds them to the elements using the given {@link yfiles.hierarchic.IItemFactory itemFactory}. - * @param g the input graph - * @param itemFactory the given {@link } instance - * @protected - */ - createItemData(g:yfiles.layout.LayoutGraph,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Creates a {@link yfiles.hierarchic.ILayerConstraintFactory layer constraint factory} that allows to create hints that affect the assignment of the nodes to layers. - *

- * By default, a suitable private implementation of {@link yfiles.hierarchic.ILayerConstraintFactory} is returned. - *

- * @param graph the given graph - * @returns a {@link } instance - */ - createLayerConstraintFactory(graph:yfiles.algorithms.Graph):yfiles.hierarchic.ILayerConstraintFactory; - /** - * Factory method that is called lazily upon first usage by {@link yfiles.hierarchic.HierarchicLayoutCore#layerer} if no {@link yfiles.hierarchic.ILayerer} instance is given as input. - *

- * The default implementation returns a new MultiComponentLayerer(new WeightedLayerer()) instance. It may be overridden to - * return a custom {@link yfiles.hierarchic.ILayerer} instance. - *

- * @returns a {@link } instance - * @see yfiles.hierarchic.HierarchicLayoutCore#layerer - * @see yfiles.hierarchic.MultiComponentLayerer - * @see yfiles.hierarchic.WeightedLayerer - * @protected - */ - createLayerer():yfiles.hierarchic.ILayerer; - /** - * Factory method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and creates an appropriate {@link yfiles.hierarchic.ILayers} - * implementation using the given {@link yfiles.hierarchic.ILayoutDataProvider} instance. - *

- * By default, a suitable private implementation of {@link yfiles.hierarchic.ILayers} is returned. It may be overridden to return - * custom implementations of the {@link yfiles.hierarchic.ILayers} interface. - *

- * @param ldp the given {@link } instance - * @returns a {@link } implementation - * @protected - */ - createLayers(ldp:yfiles.hierarchic.ILayoutDataProvider):yfiles.hierarchic.ILayers; - /** - * Factory method that is called lazily upon first usage by {@link yfiles.hierarchic.HierarchicLayoutCore#nodePlacer} if the given {@link yfiles.hierarchic.INodePlacer} instance is null. - *

- * The default implementation returns a {@link yfiles.hierarchic.SimplexNodePlacer} instance. It may be overridden to return a - * custom {@link yfiles.hierarchic.INodePlacer} instance. - *

- * @returns a {@link } instance - * @see yfiles.hierarchic.HierarchicLayoutCore#nodePlacer - * @see yfiles.hierarchic.SimplexNodePlacer - * @protected - */ - createNodePlacer():yfiles.hierarchic.INodePlacer; - /** - * Factory method that is called lazily upon first usage by {@link yfiles.hierarchic.HierarchicLayoutCore#portAllocator} if the given {@link yfiles.hierarchic.IPortAllocator} instance is - * null. - *

- * The default implementation returns a {@link yfiles.hierarchic.DefaultPortAllocator} instance. It may be overridden to return a - * custom {@link yfiles.hierarchic.IPortAllocator} instance. - *

- * @returns a {@link } instance - * @see yfiles.hierarchic.HierarchicLayoutCore#portAllocator - * @protected - */ - createPortAllocator():yfiles.hierarchic.IPortAllocator; - /** - * Factory method that is called lazily upon first usage by {@link yfiles.hierarchic.HierarchicLayoutCore#portConstraintOptimizer} if the given {@link yfiles.hierarchic.IPortConstraintOptimizer} - * instance is null. - *

- * The default implementation returns null. It may be overridden to return a custom {@link yfiles.hierarchic.IPortConstraintOptimizer} - * instance. - *

- * @returns null - * @see yfiles.hierarchic.HierarchicLayoutCore#portConstraintOptimizer - * @protected - */ - createPortConstraintOptimizer():yfiles.hierarchic.IPortConstraintOptimizer; - /** - * Creates sequence constraints that affect the sequence of the nodes within each layer. - *

- * By default, a suitable private implementation of {@link yfiles.hierarchic.ISequenceConstraintFactory} is returned. - *

- * @param graph the given graph - * @returns a {@link } instance - */ - createSequenceConstraintFactory(graph:yfiles.algorithms.Graph):yfiles.hierarchic.ISequenceConstraintFactory; - /** - * Factory method that is called lazily upon first usage by {@link yfiles.hierarchic.HierarchicLayoutCore#sequencer} if the given {@link yfiles.hierarchic.ISequencer} instance is null. - *

- * The default implementation returns a {@link yfiles.hierarchic.DefaultLayerSequencer} instance. It may be overridden to return a - * custom {@link yfiles.hierarchic.ISequencer} instance. - *

- * @returns a {@link } instance - * @see yfiles.hierarchic.HierarchicLayoutCore#sequencer - * @see yfiles.hierarchic.DefaultLayerSequencer - * @protected - */ - createSequencer():yfiles.hierarchic.ISequencer; - /** - * Factory method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and creates a {@link yfiles.hierarchic.ISequencer} - * implementation that can sequence subgraphs incrementally. - *

- * By default, a suitable private implementation of {@link yfiles.hierarchic.ISequencer} is returned. It may be overridden to - * return custom implementations of the {@link yfiles.hierarchic.ISequencer} interface. - *

- * @returns a {@link } implementation - * @protected - */ - createSubgraphLayerSequencer():yfiles.hierarchic.ISequencer; - /** - * Provides access to implementation specific properties of the algorithms used. - *

- * Used for internal purposes. - *

- * @param key the key to a property - * @returns the associated value or null - * @see yfiles.hierarchic.HierarchicLayoutCore#setAlgorithmProperty - */ - getAlgorithmProperty(key:any):any; - /** - * Callback method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and returns a {@link yfiles.algorithms.IDataProvider} - * that holds the {@link yfiles.hierarchic.EdgeLayoutDescriptor} information. - *

- * The {@link yfiles.algorithms.IDataProvider} holding the information about the node layout is registered with the graph using key - * {@link yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. - *

- * @param graph the input graph - * @returns a {@link } instance or null - * @see yfiles.hierarchic.EdgeLayoutDescriptor - * @see yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @protected - */ - getEdgeLayoutDescriptors(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.IDataProvider; - /** - * Callback method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and returns a {@link yfiles.algorithms.IDataProvider} - * that holds the incremental hints information. - *

- * The {@link yfiles.algorithms.IDataProvider} holding the information about incremental hints is registered with the graph using - * key {@link yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY}. - *

- * @param graph the input graph - * @returns a {@link } instance or null - * @see yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY - * @protected - */ - getIncrementalHints(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.IDataProvider; - /** - * Callback method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and returns a {@link yfiles.algorithms.IDataProvider} - * that holds the {@link yfiles.hierarchic.NodeLayoutDescriptor} information. - *

- * The {@link yfiles.algorithms.IDataProvider} holding the information about the node layout is registered with the graph using key - * {@link yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY}. - *

- * @param graph the input graph - * @returns a {@link } instance or null - * @see yfiles.hierarchic.NodeLayoutDescriptor - * @see yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY - * @protected - */ - getNodeLayoutDescriptors(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.IDataProvider; - /** - * Callback method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and returns a {@link yfiles.algorithms.IDataProvider} - * that holds the {@link yfiles.hierarchic.SwimlaneDescriptor} information. - *

- * The {@link yfiles.algorithms.IDataProvider} holding the information about swimlanes is registered with the graph using key - * {@link yfiles.hierarchic.HierarchicLayoutCore#SWIMLANE_DESCRIPTOR_DP_KEY}. - *

- * @param graph the input graph - * @returns a {@link } instance or null - * @see yfiles.hierarchic.SwimlaneDescriptor - * @see yfiles.hierarchic.HierarchicLayoutCore#SWIMLANE_DESCRIPTOR_DP_KEY - * @protected - */ - getSwimLaneDescriptors(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.IDataProvider; - /** - * Callback method that publishes the layering information. - *

- * The layering information is stored in a {@link yfiles.algorithms.IDataProvider} registered with the graph using key - * {@link yfiles.hierarchic.HierarchicLayoutCore#LAYER_INDEX_DP_KEY}. - *

- * @param graph the input graph - * @param layers the {@link } implementation that provides the layering information - * @see yfiles.hierarchic.HierarchicLayoutCore#LAYER_INDEX_DP_KEY - * @protected - */ - publishLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers):void; - /** - * Callback method that publishes the sequencing information. - *

- * The sequencing information is stored in a {@link yfiles.algorithms.IDataProvider} registered with the graph using key - * {@link yfiles.hierarchic.HierarchicLayoutCore#SEQUENCE_INDEX_DP_KEY}. - *

- * @param graph the input graph - * @param layers the {@link } implementation that provides the layering information - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @see yfiles.hierarchic.HierarchicLayoutCore#LAYER_INDEX_DP_KEY - * @protected - */ - publishSequences(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Removes the bends which are obviously not necessary. - *

- * By default, this method removes collinear bends from the graph. A bend point is considered to be collinear if it lies on - * a line with its preceding and succeeding bend point. It may be overridden for a custom implementation of bend removal. - *

- * @param graph the input graph - * @param bendReductionThreshold this method removes a bend, if its horizontal/vertical distance to the closest collinear bend is above this value - * @protected - */ - reduceBendCount(graph:yfiles.layout.LayoutGraph,bendReductionThreshold:number):void; - /** - * Removes the bends which are obviously not necessary. - *

- * By default, this method removes collinear bends from the graph. A bend point is considered to be collinear if it lies on - * a line with its preceding and succeeding bend point. It may be overridden for a custom implementation of bend removal. - *

- * @param graph the input graph - * @protected - */ - reduceBendCount(graph:yfiles.layout.LayoutGraph):void; - /** - * Provides access to implementation specific properties of the algorithms used. - *

- * Used for internal purposes. - *

- * @param key the key to a property - * @param value the value to associate with the key - * @see yfiles.hierarchic.HierarchicLayoutCore#setAlgorithmProperty - */ - setAlgorithmProperty(key:any,value:any):void; - /** - * Data provider key for specifying incremental hints - *

- * Incremental hints are created using an {@link yfiles.hierarchic.HierarchicLayoutCore#createIncrementalHintsFactory incremental hints factory}. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY - * @see yfiles.hierarchic.IIncrementalHintsFactory - * @const - * @static - * @type {yfiles.algorithms.GraphObjectDpKey.} - */ - static INCREMENTAL_HINTS_DP_KEY:yfiles.algorithms.GraphObjectDpKey; - /** - * Data provider key for providing layout information for each edge - * @see yfiles.hierarchic.IEdgeData#edgeLayoutDescriptor - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_LAYOUT_DESCRIPTOR_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for providing layout information for each node - * @see yfiles.hierarchic.INodeData#nodeLayoutDescriptor - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_LAYOUT_DESCRIPTOR_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for providing information about swimlanes - *

- * If this key is present during the layout, the layout algorithm will arrange nodes in swimlanes. The information about - * the swimlanes is finally written back to the descriptor instances. - *

- *

- * Instances can be shared among multiple nodes in the same lane, but don't have to be shared. - *

- * @see yfiles.hierarchic.SwimlaneDescriptor - * @see yfiles.hierarchic.INodeData#swimLaneDescriptor - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static SWIMLANE_DESCRIPTOR_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data acceptor key for publishing the layer IDs for all nodes in the graph - * @see yfiles.hierarchic.HierarchicLayout#LAYER_INDEX_DP_KEY - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static LAYER_INDEX_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data acceptor key for publishing the index inside their layer for all nodes in the graph - * @see yfiles.hierarchic.HierarchicLayout#SEQUENCE_INDEX_DP_KEY - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static SEQUENCE_INDEX_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for internal use only - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static INCREMENTAL_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Factory method called during the initialization of this {@link yfiles.hierarchic.HierarchicLayoutCore} instance that creates a - * {@link yfiles.layout.MultiStageLayout#labeling label layouter}. - *

- * In order to use the integrated node label awareness feature one has to use a {@link yfiles.layout.LabelLayoutTranslator} - * instance and set {@link yfiles.layout.LabelLayoutTranslator#translateNodeLabels} to true. Likewise, in order to make use of the integrated edge labeling {@link yfiles.layout.LabelLayoutTranslator#translateEdgeLabels} must be set to true and also - * {@link yfiles.layout.LabelLayoutTranslator#writeBackEdgeLabels} must be set to true (which is the default). - *

- * @protected - * @type {yfiles.layout.ILayoutStage} - */ - createLabelLayout:yfiles.layout.ILayoutStage; - /** - * Gets or sets whether or not the {@link yfiles.layout.ComponentLayout} should be enabled. - * @type {boolean} - */ - componentLayoutEnabled:boolean; - /** - * Gets or sets the time limit (in milliseconds) set for the layout algorithm. - *

- * Values have to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the maximum duration is negative - * @type {number} - */ - maximumDuration:number; - /** - * Gets or sets the {@link yfiles.hierarchic.ILayerer} instance responsible for generating the layer assignment (first phase of the - * layout algorithm). - *

- * To set the default layerer, see {@link yfiles.hierarchic.HierarchicLayoutCore#createLayerer}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.ILayerer} is null - * @see yfiles.hierarchic.HierarchicLayoutCore#createLayerer - * @type {yfiles.hierarchic.ILayerer} - */ - layerer:yfiles.hierarchic.ILayerer; - /** - * Gets or sets the {@link yfiles.hierarchic.ISequencer} instance responsible for calculating the sequence of nodes within each - * layer (second phase of the layout algorithm). - *

- * To set the default sequencer, see {@link yfiles.hierarchic.HierarchicLayoutCore#createSequencer}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.ISequencer} is null - * @see yfiles.hierarchic.HierarchicLayoutCore#createSequencer - * @type {yfiles.hierarchic.ISequencer} - */ - sequencer:yfiles.hierarchic.ISequencer; - /** - * Gets or sets the {@link yfiles.hierarchic.INodePlacer} instance responsible for the assignment of the x-(sequence) and - * preliminary y-coordinates of the nodes. - *

- * To set the default node placer, see {@link yfiles.hierarchic.HierarchicLayoutCore#createNodePlacer}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.INodePlacer} is null - * @see yfiles.hierarchic.HierarchicLayoutCore#createNodePlacer - * @type {yfiles.hierarchic.INodePlacer} - */ - nodePlacer:yfiles.hierarchic.INodePlacer; - /** - * Gets or sets the {@link yfiles.hierarchic.IPortAllocator} instance responsible for assigning port coordinates to the adjacent - * edges of each node. - *

- * To set the default port allocator, see {@link yfiles.hierarchic.HierarchicLayoutCore#createPortAllocator}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.IPortAllocator} is null - * @see yfiles.hierarchic.HierarchicLayoutCore#createPortAllocator - * @type {yfiles.hierarchic.IPortAllocator} - */ - portAllocator:yfiles.hierarchic.IPortAllocator; - /** - * Gets or sets the {@link yfiles.hierarchic.IPortConstraintOptimizer} instance responsible for optimizing the assignment of port - * constraints to the adjacent edges of each node. - *

- * To set the default port allocator, see {@link yfiles.hierarchic.HierarchicLayoutCore#createPortConstraintOptimizer}. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#createPortConstraintOptimizer - * @type {yfiles.hierarchic.IPortConstraintOptimizer} - */ - portConstraintOptimizer:yfiles.hierarchic.IPortConstraintOptimizer; - /** - * Gets or sets the {@link yfiles.hierarchic.IDrawingDistanceCalculator} instance responsible for determining the minimum distances - * between elements that belong to the same layer. - *

- * To set the default port allocator, see {@link yfiles.hierarchic.HierarchicLayoutCore#createDrawingDistanceCalculator}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.IDrawingDistanceCalculator} is null - * @see yfiles.hierarchic.HierarchicLayoutCore#createDrawingDistanceCalculator - * @type {yfiles.hierarchic.IDrawingDistanceCalculator} - */ - drawingDistanceCalculator:yfiles.hierarchic.IDrawingDistanceCalculator; - /** - * Gets or sets the equidistant spacing between the horizontal and vertical grid lines. - *

- * When the spacing is negative or zero, no grid is defined, otherwise nodes and edges are placed on multiples of the grid - * spacing. - *

- * @see yfiles.hierarchic.IIncrementalHintsFactory - * @type {number} - */ - gridSpacing:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.HierarchicLayoutCore; - } - /** - * This interface determines the minimum distances between elements that belong to the same layer. - *

- * {@link yfiles.hierarchic.IDrawingDistanceCalculator} is implemented by a helper class used by {@link yfiles.hierarchic.HierarchicLayoutCore} - * during the phase of node placement (i.e. when the final coordinates for all nodes are calculated). {@link yfiles.hierarchic.INodePlacer} - * uses instances of this interface to determine the minimum distances between elements that belong to the same layer. - *

- *

- * Information about graph elements (i.e. nodes or edges) is given using a {@link yfiles.hierarchic.ILayoutDataProvider} while - * information about layers is given through {@link yfiles.hierarchic.ILayer} (describes a single layer of the hierarchic layout) - * or {@link yfiles.hierarchic.ILayers} (manages multiple {@link yfiles.hierarchic.ILayer layers} of the hierarchic layout). - *

- *

- * Implementations not needed any more should be {@link yfiles.hierarchic.IDrawingDistanceCalculator#dispose disposed of}. - *

- *

- * The default implementation used by the {@link yfiles.hierarchic.HierarchicLayoutCore} is - * {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator}. - *

- * @interface - */ - export interface IDrawingDistanceCalculator extends yfiles.lang.Object{ - /** - * Disposes of internal data structures. - *

- * Implementations should release internally held data structures when they are not needed any more. - *

- * @param graph the input graph that contains all elements that are used during the node placement - * @param layers the {@link } object that will be used during subsequent calls - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @see yfiles.hierarchic.IDrawingDistanceCalculator#initialize - * @abstract - */ - dispose(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Main interface method called by {@link yfiles.hierarchic.INodePlacer} instances to determine the minimum distance between - * {@link yfiles.algorithms.Node}s of same layer. - * @param graph the input graph - * @param layer the {@link } object that will be used during subsequent calls - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param left the left of the two {@link }s whose minimum distance is to be determined or null if only the left border - * of the right {@link } is of interest - * @param right the right of the two {@link }s whose minimum distance is to be determined or null if only the right border - * of the left {@link } is of interest - * @returns the minimum distance between two {@link }s of the same layer - * @abstract - */ - getMinDistance(graph:yfiles.layout.LayoutGraph,layer:yfiles.hierarchic.ILayer,ldp:yfiles.hierarchic.ILayoutDataProvider,left:yfiles.algorithms.Node,right:yfiles.algorithms.Node):number; - /** - * Initializes internal data structures. - *

- * Implementations may cache lengthy calculations in the initialization phase. - *

- * @param graph the input graph that contains all elements that are used during the node placement - * @param layers the {@link } object that will be used during subsequent calls - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @see yfiles.hierarchic.IDrawingDistanceCalculator#dispose - * @abstract - */ - initialize(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - } - var IDrawingDistanceCalculator:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.IDrawingDistanceCalculator; - }; - /** - * This interface provides layout information about the edges of the graph during the layout. - *

- * {@link yfiles.hierarchic.IEdgeData} is a multi-purpose edge descriptor for each edge, holding information about the {@link yfiles.hierarchic.IEdgeData#type type} of an - * edge, associated {@link yfiles.layout.PortConstraint port constraints}, {@link yfiles.layout.PortCandidate port candidates}, edge groups as well as the current edge state. - *

- *

- * It is used in all phases of the {@link yfiles.hierarchic.HierarchicLayoutCore} to store edge information. - *

- * @interface - */ - export interface IEdgeData extends yfiles.lang.Object{ - /** - * Gets the type of the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} instance. - * @abstract - * @type {yfiles.hierarchic.EdgeDataType} - */ - type:yfiles.hierarchic.EdgeDataType; - /** - * Gets the {@link yfiles.algorithms.Node} associated with this {@link yfiles.hierarchic.IEdgeData} instance. - *

- * If no {@link yfiles.algorithms.Node} is associated with this {@link yfiles.hierarchic.IEdgeData} instance, null should be returned. - *

- * @abstract - * @type {yfiles.algorithms.Node} - */ - associatedNode:yfiles.algorithms.Node; - /** - * Gets the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} instance. - *

- * If no {@link yfiles.algorithms.Edge} is associated with this {@link yfiles.hierarchic.IEdgeData} instance, null should be returned. - *

- * @abstract - * @type {yfiles.algorithms.Edge} - */ - associatedEdge:yfiles.algorithms.Edge; - /** - * Gets the {@link yfiles.layout.PortConstraint port constraints} for the source port of the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} - * instance. - *

- * {@link yfiles.layout.PortConstraint}s are obtained by a {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY}. - *

- * @abstract - * @type {yfiles.layout.PortConstraint} - */ - sourcePortConstraint:yfiles.layout.PortConstraint; - /** - * Gets the ID of the edge port group at the source node to which the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} - * instance belongs (if any). - *

- * Information about edge port grouping at the source node is obtained by a {@link yfiles.algorithms.IDataProvider} registered with - * the graph with key {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_GROUP_ID_DP_KEY}. - *

- * @abstract - * @type {any} - */ - sourcePortGroup:any; - /** - * Gets the {@link yfiles.collections.ICollection. collection} of {@link yfiles.layout.PortCandidate}s for the source port of the {@link yfiles.algorithms.Edge} associated with - * this {@link yfiles.hierarchic.IEdgeData} instance. - *

- * {@link yfiles.layout.PortCandidate Source port candidates} are obtained by a {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY}. - *

- * @abstract - * @type {yfiles.collections.ICollection.} - */ - sourcePortCandidates:yfiles.collections.ICollection; - /** - * Gets the {@link yfiles.layout.PortConstraint port constraints} for the target port of the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} - * instance. - *

- * {@link yfiles.layout.PortConstraint}s are obtained by a {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY}. - *

- * @abstract - * @type {yfiles.layout.PortConstraint} - */ - targetPortConstraint:yfiles.layout.PortConstraint; - /** - * Gets the ID of the edge port group at the target node to which the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} - * instance belongs (if any). - *

- * Information about edge port grouping at the target node is obtained by a {@link yfiles.algorithms.IDataProvider} registered with - * the graph with key {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_GROUP_ID_DP_KEY}. - *

- * @abstract - * @type {any} - */ - targetPortGroup:any; - /** - * Gets the {@link yfiles.collections.ICollection. collection} of {@link yfiles.layout.PortCandidate}s for the target port of the {@link yfiles.algorithms.Edge} associated with - * this {@link yfiles.hierarchic.IEdgeData} instance. - *

- * {@link yfiles.layout.PortCandidate Target port candidates} are obtained by a {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY}. - *

- * @abstract - * @type {yfiles.collections.ICollection.} - */ - targetPortCandidates:yfiles.collections.ICollection; - /** - * Gets the ID of the edge group at the source node to which the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} - * instance belongs (if any). - *

- * Information about edge grouping at the source node is obtained by a {@link yfiles.algorithms.IDataProvider} registered with the - * graph with key {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY}. - *

- * @abstract - * @type {any} - */ - sourceGroup:any; - /** - * Gets the ID of the edge group at the target node to which the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} - * instance belongs (if any). - *

- * Information about edge grouping at the target node is obtained by a {@link yfiles.algorithms.IDataProvider} registered with the - * graph with key {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY}. - *

- * @abstract - * @type {any} - */ - targetGroup:any; - /** - * Gets the group that is represented by the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} - * instance. - * @abstract - * @type {any} - */ - group:any; - /** - * Gets whether or not the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} instance has been - * reversed. - * @abstract - * @type {boolean} - */ - reversed:boolean; - /** - * Gets whether or not the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} instance is an upper - * same-layer edge. - *

- * An upper same-layer edge is an edge connecting two nodes of the same layer with polyline segments (not directly, with a - * straight-line) and is routed above the layer. - *

- * @abstract - * @type {boolean} - */ - upperSameLayerEdge:boolean; - /** - * Gets the {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance bound to the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} - * instance. - *

- * If no {@link yfiles.hierarchic.EdgeLayoutDescriptor} is bound to the edge, null should be returned. - *

- * @abstract - * @type {yfiles.hierarchic.EdgeLayoutDescriptor} - */ - edgeLayoutDescriptor:yfiles.hierarchic.EdgeLayoutDescriptor; - /** - * Gets or sets whether or not the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} instance should - * be an upper same-layer edge (if it is a same-layer edge). - *

- * An upper same-layer edge is an edge connecting two nodes of the same layer with polyline segments (not directly, with a - * straight-line) and is routed above the layer. - *

- *

- * If enabled the edge will be routed above the layer, otherwise below it. - *

- * @abstract - * @type {boolean} - */ - fallbackUpperSameLayerEdge:boolean; - /** - * Gets the thickness of the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} instance. - *

- * The thickness is considered when calculating minimum distances so that there are no overlaps between edges and other - * graph elements. - *

- *

- * The thickness must have a non-negative value. - *

- * @abstract - * @type {number} - */ - thickness:number; - } - var IEdgeData:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.IEdgeData; - }; - /** - * This interface handles edges that should be reversed during the hierarchic layout process. - *

- * {@link yfiles.hierarchic.IEdgeReverser} contains methods for reversing all (or a given edge) that point to the wrong direction, - * i.e. the layer indices of the source nodes are greater than the layer indices of the target nodes. It also provides - * methods to restore the edges that have been reversed at the end of the layout algorithm. - *

- *

- * Implementations of this interface perform operations after the layering phase of the hierarchic layout algorithm. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore - * @interface - */ - export interface IEdgeReverser extends yfiles.lang.Object{ - /** - * Reverses all edges which point to the wrong direction. - *

- * It is called after the layering phase of the {@link yfiles.hierarchic.HierarchicLayoutCore hierarchic layout algorithm}. - *

- *

- * An edge is reversed if the layer index of its source node is greater than the layer index of its target node. - *

- * @param graph the input graph - * @param ldp the {@link } containing layering information about the nodes and edges of the graph - * @see yfiles.hierarchic.ILayoutDataProvider#getNodeData - * @see yfiles.hierarchic.INodeData#layer - * @abstract - */ - normalizeEdges(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Restores the original direction of edges marked as reversed. - *

- * It is called at the end of the {@link yfiles.hierarchic.HierarchicLayoutCore hierarchic layout algorithm}. - *

- * @param graph the input graph - * @param ldp the {@link } containing information about the nodes and edges of the graph - * @abstract - */ - restoreEdgeDirections(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Reverses a given edge which points to the wrong direction. - *

- * It may be called by the incremental parts of the {@link yfiles.hierarchic.HierarchicLayoutCore hierarchic layout algorithm}. - *

- * @param graph the input graph - * @param ldp the {@link } containing layering information about the nodes and edges of the graph - * @param edge the edge to be reversed - * @see yfiles.hierarchic.ILayoutDataProvider#getNodeData - * @see yfiles.hierarchic.INodeData#layer - * @abstract - */ - reverse(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,edge:yfiles.algorithms.Edge):void; - } - var IEdgeReverser:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.IEdgeReverser; - }; - /** - * This interface provides factory methods for creating incremental hints for the hierarchic layout. - *

- * Incremental hints can be used for specifying that a subset of nodes (called incremental nodes) should be added to an existing graph - * layout. A layer hint specifies that both, a node's layer and its position within the layer should be freely determined - * by the algorithm. A sequence hint specifies that the algorithm should consider the current layer of a node while its - * position within the layer should be freely determined by the algorithm. A node without any hint is called a fixed node. - *

- *

- * Sequence hints can also be specified for edges. These incremental edges are inserted in a suitable position within the layers - * crossed by the edges. For fixed edges the given input route is considered to calculate the position with the layers. - *

- *

- * Information about incremental hints is provided by a {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.hierarchic.HierarchicLayout#INCREMENTAL_HINTS_DP_KEY}. - *

- *

- * An instance of a class implementing this interface can be obtained through method - * {@link yfiles.hierarchic.HierarchicLayout#createIncrementalHintsFactory}. - *

- * @interface - */ - export interface IIncrementalHintsFactory extends yfiles.lang.Object{ - /** - * Creates a hint {@link any} for a group {@link yfiles.algorithms.Node} that should be inserted incrementally during the layering phase. - *

- * The group will be placed on a suitable position. The descendants of the group may be associated with hints created by - * methods {@link yfiles.hierarchic.IIncrementalHintsFactory#createLayerIncrementallyHint}, {@link yfiles.hierarchic.IIncrementalHintsFactory#createSequenceIncrementallyHint} - * or this method (if the descendant is an inner group). - *

- *

- * All hints of the descendants of a group are interpreted relative to the group node. Descendants without hints maintain - * their relative order within the group node (but not with elements outside the group). - *

- *

- * The positions of groups without incremental hints depend on the position of their descendants (i.e., the group is not - * interpreted as fixed - it is simply ignored). - *

- * @param forItemId the group node to be inserted incrementally - * @returns an {@link } that can be interpreted as a hint by {@link } - * @abstract - */ - createIncrementalGroupHint(forItemId:any):any; - /** - * Creates a hint {@link any} for a {@link yfiles.algorithms.Node} that should be inserted incrementally during the layering phase. - *

- * This will place the node in a suitable layer, possibly creating new layers. - *

- *

- * Neighbors of this node may be also marked such that they are laid out incrementally. This makes it possible to - * incrementally add whole subgraphs to the current layout. - *

- * @param forNodeId the node to be layered and sequenced incrementally - * @returns an {@link } that can be interpreted as a hint by {@link } - * @abstract - */ - createLayerIncrementallyHint(forNodeId:any):any; - /** - * Creates a hint {@link any} for a {@link yfiles.algorithms.Node} or {@link yfiles.algorithms.Edge} that should be inserted incrementally during the - * sequencing phase. - *

- * All nodes that are not incrementally inserted during the layering phase (see - * {@link yfiles.hierarchic.IIncrementalHintsFactory#createLayerIncrementallyHint}) stay in their current layer. More precisely, - * the default {@link yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer} implementation is an instance of {@link yfiles.hierarchic.AsIsLayerer} that determines the layer of the "fixed" - * nodes by analyzing the current node coordinates. Note that for the other nodes, the layout algorithm may insert new - * layers in between the existing layers. - *

- *

- * For edges associated with this hint (or which are incident to an incremental node), the algorithm automatically - * calculates a suitable sequencing (position within the layer). For edges between two non-incremental nodes that do not - * have a hint, the sequencing phase considers the current route. - *

- * @param forItemId the node or edge to be sequenced/inserted incrementally - * @returns an {@link } that can be interpreted as a hint by {@link } - * @abstract - */ - createSequenceIncrementallyHint(forItemId:any):any; - /** - * Creates a hint {@link any} for a {@link yfiles.algorithms.Node} that should be inserted incrementally into the graph on its exact current - * position. - *

- * As for nodes without hints, the algorithm uses the {@link yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer} instance to determine the layer of such nodes and the {@link yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer} instance to - * determine the position within the layer. By default, both implementations use the current coordinates of the nodes to - * derive the layer/position. However, for nodes marked with this hint, the algorithm should also preserve the exact - * coordinates while for nodes without hints the coordinates may be changed (these nodes only keep their relative - * positions). - *

- * @param forNodeId the node to be placed on its exact current position - * @returns an {@link } that can be interpreted as a hint by {@link } - * @see yfiles.hierarchic.IIncrementalHintsFactory#createUseExactSequenceCoordinatesHint - * @see yfiles.hierarchic.IIncrementalHintsFactory#createUseExactLayerCoordinatesHint - * @see yfiles.hierarchic.SimplexNodePlacer#exactPlacement - * @abstract - */ - createUseExactCoordinatesHint(forNodeId:any):any; - /** - * Creates a hint {@link any} for a {@link yfiles.algorithms.Node} that should be inserted incrementally into the graph on its exact current - * layer position. - *

- * The algorithm uses the {@link yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer} instance to determine the layer of such nodes and the {@link yfiles.hierarchic.HierarchicLayout#fromScratchSequencer} instance to determine the sequencing. - *

- * @param forNodeId the node to be placed on its exact current layer position - * @returns an {@link } that can be interpreted as a hint by {@link } - * @see yfiles.hierarchic.IIncrementalHintsFactory#createUseExactCoordinatesHint - * @see yfiles.hierarchic.IIncrementalHintsFactory#createUseExactSequenceCoordinatesHint - * @see yfiles.hierarchic.SimplexNodePlacer#exactPlacement - * @abstract - */ - createUseExactLayerCoordinatesHint(forNodeId:any):any; - /** - * Creates a hint {@link any} for a {@link yfiles.algorithms.Node} that should be inserted incrementally into the graph on its exact current - * sequence position. - *

- * The algorithm uses the {@link yfiles.hierarchic.HierarchicLayout#fromScratchLayerer} instance to determine the layer of such nodes and the {@link yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer} instance to determine the sequencing. - *

- * @param forNodeId the node to be placed on its exact current sequence position - * @returns an {@link } that can be interpreted as a hint by {@link } - * @see yfiles.hierarchic.IIncrementalHintsFactory#createUseExactCoordinatesHint - * @see yfiles.hierarchic.IIncrementalHintsFactory#createUseExactLayerCoordinatesHint - * @see yfiles.hierarchic.SimplexNodePlacer#exactPlacement - * @abstract - */ - createUseExactSequenceCoordinatesHint(forNodeId:any):any; - } - var IIncrementalHintsFactory:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.IIncrementalHintsFactory; - }; - /** - * This interface is a factory for creating and destroying helper structures used in the graph during layout. - *

- * An implementation of this interface is provided by the {@link yfiles.hierarchic.HierarchicLayoutCore} during the layout for the - * different sub-modules. - *

- * @interface - */ - export interface IItemFactory extends yfiles.lang.Object{ - /** - * Converts a given {@link yfiles.algorithms.Node} to a label node. - * @param dummyNode the given {@link } to be converted - * @abstract - */ - convertToLabelNode(dummyNode:yfiles.algorithms.Node):void; - /** - * Creates a bend {@link yfiles.algorithms.Node} for the given {@link yfiles.algorithms.Edge} in the given {@link yfiles.hierarchic.ILayer} and - * assigns it to the given {@link yfiles.hierarchic.SwimlaneDescriptor} instance. - * @param layer the given {@link } instance - * @param edge the given {@link } - * @param [laneDescriptor=null] a given {@link } instance - * @returns the new bend {@link } - * @abstract - */ - createBendNode(layer:yfiles.hierarchic.ILayer,edge:yfiles.algorithms.Edge,laneDescriptor?:yfiles.hierarchic.SwimlaneDescriptor):yfiles.algorithms.Node; - /** - * Creates a {@link yfiles.hierarchic.INodeData} object for a bend {@link yfiles.algorithms.Node} and associates it with the - * {@link yfiles.algorithms.Node}. - *

- * The bend is assigned to the given {@link yfiles.hierarchic.SwimlaneDescriptor} instance. - *

- * @param node the given {@link } - * @param edge the given {@link } - * @param [laneDescriptor=null] the given {@link } instance - * @returns a {@link } object for the given bend {@link } - * @abstract - */ - createBendNodeData(node:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge,laneDescriptor?:yfiles.hierarchic.SwimlaneDescriptor):yfiles.hierarchic.INodeData; - /** - * Creates a dummy {@link yfiles.algorithms.Node} that mimics a connector to a group {@link yfiles.algorithms.Node}. - * @param groupNode the given group {@link } - * @param groupId the given group ID - * @param layer the given {@link } instance - * @param edge the given {@link } - * @returns the new {@link } - * @abstract - */ - createConnectorProxyForGroup(groupNode:yfiles.algorithms.Node,groupId:any,layer:yfiles.hierarchic.ILayer,edge:yfiles.algorithms.Edge):yfiles.algorithms.Node; - /** - * Creates a dummy node that mimics a connector to a group node from a descendant. - * @param groupNode the group node to which the edge is connected - * @param groupId the id of the group node - * @param layer the layer to which the dummy node will be assigned - * @param e the edge that connects to the dummy node - * @returns the dummy node - * @abstract - */ - createContentConnectorProxyForGroup(groupNode:yfiles.algorithms.Node,groupId:any,layer:yfiles.hierarchic.ILayer,e:yfiles.algorithms.Edge):yfiles.algorithms.Node; - /** - * Creates a spacer {@link yfiles.algorithms.Node} for the drawing phase using the given bounds in the given - * {@link yfiles.hierarchic.ILayer}. - * @param layer the given {@link } instance - * @param size the given bounds - * @param edges an array of {@link }s - * @returns the new spacer {@link } - * @abstract - */ - createDistanceNode(layer:yfiles.hierarchic.ILayer,size:yfiles.algorithms.Rectangle2D,edges:yfiles.algorithms.Edge[]):yfiles.algorithms.Node; - /** - * Creates a dummy {@link yfiles.algorithms.Edge} using the given data. - * @param newSource the source node of the {@link } - * @param newTarget the target node of the {@link } - * @param oldEdge the old {@link } from which to retrieve the data - * @param sourceEnd true if the source node of the edge is referred, false otherwise - * @param targetEnd true if the target node of the edge is referred, false otherwise - * @returns a new dummy {@link } - * @abstract - */ - createDummyEdge(newSource:yfiles.algorithms.Node,newTarget:yfiles.algorithms.Node,oldEdge:yfiles.algorithms.Edge,sourceEnd:boolean,targetEnd:boolean):yfiles.algorithms.Edge; - /** - * Creates an edge group {@link yfiles.algorithms.Node} in the given {@link yfiles.hierarchic.ILayer}. - * @param layer the given {@link } instance - * @param groupId the ID of the edge group - * @returns the new group {@link } - * @abstract - */ - createEdgeGroupNode(layer:yfiles.hierarchic.ILayer,groupId:any):yfiles.algorithms.Node; - /** - * Creates a {@link yfiles.hierarchic.INodeData} object for an edge group {@link yfiles.algorithms.Node} and associates it with the - * {@link yfiles.algorithms.Node}. - * @param node the given {@link } - * @param groupId the given group ID - * @param source true if the edge group is referred to the source node, false otherwise - * @returns a {@link } object for the given edge group {@link } - * @abstract - */ - createEdgeGroupNodeData(node:yfiles.algorithms.Node,groupId:any,source:boolean):yfiles.hierarchic.INodeData; - /** - * Creates an {@link yfiles.algorithms.Edge} that connects two group border {@link yfiles.algorithms.Node}s. - * @param source the source {@link } - * @param target the target {@link } - * @returns the new {@link } connecting the two group {@link }s - * @abstract - */ - createGroupBorderEdge(source:yfiles.algorithms.Node,target:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Creates a group boundary {@link yfiles.algorithms.Node} for a group node in the given {@link yfiles.hierarchic.ILayer}. - * @param groupNode the given group {@link } - * @param layer the given {@link } - * @param type one of {@link #GROUP_BEGIN} or {@link #GROUP_END} - * @returns the new group boundary {@link } - * @abstract - */ - createGroupBorderNode(groupNode:yfiles.algorithms.Node,layer:yfiles.hierarchic.ILayer,type:yfiles.hierarchic.NodeDataType):yfiles.algorithms.Node; - /** - * Create a dummy {@link yfiles.algorithms.Node} for a group {@link yfiles.hierarchic.ILayer layer}. - * @returns a new dummy {@link } - * @abstract - */ - createGroupLayerDummyNode():yfiles.algorithms.Node; - /** - * Creates a group node connector {@link yfiles.algorithms.Edge} between two group {@link yfiles.algorithms.Node}s. - * @param groupNode1 the first group node - * @param groupNode2 the first group node - * @param representative the given representative {@link } - * @returns a new connector {@link } between two group {@link }s - * @abstract - */ - createGroupNodeConnectorEdge(groupNode1:yfiles.algorithms.Node,groupNode2:yfiles.algorithms.Node,representative:yfiles.algorithms.Edge):yfiles.algorithms.Edge; - /** - * Creates an {@link yfiles.hierarchic.IEdgeData} object for a normal {@link yfiles.algorithms.Edge} and associates it with the edge. - * @param edge the given {@link } - * @returns an {@link } object for the given {@link } - * @abstract - */ - createNormalEdgeData(edge:yfiles.algorithms.Edge):yfiles.hierarchic.IEdgeData; - /** - * Creates a {@link yfiles.hierarchic.INodeData} object for a normal {@link yfiles.algorithms.Node} and associates it with the - * {@link yfiles.algorithms.Node}. - * @param node the given {@link } - * @returns a {@link } object for the given {@link } - * @abstract - */ - createNormalNodeData(node:yfiles.algorithms.Node):yfiles.hierarchic.INodeData; - /** - * Creates a proxy {@link yfiles.algorithms.Node} for an {@link yfiles.algorithms.Edge} during the drawing phase, changing the {@link yfiles.algorithms.Edge} - * to end/start at the proxy and assigns it to a {@link yfiles.hierarchic.SwimlaneDescriptor} instance. - * @param edge the given {@link } - * @param source true if the node is the source node of the edge, false otherwise - * @param [laneDescriptor=null] a given {@link } instance - * @returns the new proxy {@link } - * @abstract - */ - createProxyNode(edge:yfiles.algorithms.Edge,source:boolean,laneDescriptor?:yfiles.hierarchic.SwimlaneDescriptor):yfiles.algorithms.Node; - /** - * Creates a {@link yfiles.hierarchic.INodeData} object for a proxy {@link yfiles.algorithms.Node} and associates it with the proxy node. - * @param node the given {@link } - * @param proxy the given proxy node - * @param edge the given {@link } - * @returns a {@link } object for the given proxy node - * @abstract - */ - createProxyNodeData(node:yfiles.algorithms.Node,proxy:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge):yfiles.hierarchic.INodeData; - /** - * Creates a dummy edge that belongs to a recursive {@link yfiles.algorithms.Edge}. - * @param newSource the source node of the {@link } - * @param newTarget the target node of the {@link } - * @param oldEdge the old {@link } from which to retrieve the data - * @param sourceEnd true if the source node of the edge is referred, false otherwise - * @param targetEnd true if the target node of the edge is referred, false otherwise - * @returns a new dummy {@link } - * @abstract - */ - createRecursiveDummyEdge(newSource:yfiles.algorithms.Node,newTarget:yfiles.algorithms.Node,oldEdge:yfiles.algorithms.Edge,sourceEnd:boolean,targetEnd:boolean):yfiles.algorithms.Edge; - /** - * Creates a dummy {@link yfiles.algorithms.Node} that represents a bend node of a recursive {@link yfiles.algorithms.Edge}. - * @param layer the given {@link } to which the dummy {@link } is assigned - * @param edge the given {@link } to which the dummy {@link } belongs - * @param laneDescriptor the given {@link } instance - * @returns the new {@link } - * @abstract - */ - createRecursiveEdgeDummy(layer:yfiles.hierarchic.ILayer,edge:yfiles.algorithms.Edge,laneDescriptor:yfiles.hierarchic.SwimlaneDescriptor):yfiles.algorithms.Node; - /** - * Creates a {@link yfiles.hierarchic.INodeData} for a dummy {@link yfiles.algorithms.Node} of a recursive {@link yfiles.algorithms.Edge}. - * @param node the given {@link } - * @param edge the given {@link } to which the dummy {@link } belongs - * @param laneDescriptor the given {@link } instance - * @returns the new {@link } instance - * @abstract - */ - createRecursiveEdgeNodeData(node:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge,laneDescriptor:yfiles.hierarchic.SwimlaneDescriptor):yfiles.hierarchic.INodeData; - /** - * Creates an {@link yfiles.hierarchic.IEdgeData} object for a same-layer recursive {@link yfiles.algorithms.Edge} and associates it with - * the edge. - * @param edge the given {@link } - * @param originalEdgeData the {@link } object of the original edge - * @param isUpper true is the recursive edge is an upper same layer edge, false otherwise - * @returns an {@link } object for the recursive same-layer {@link } - * @abstract - */ - createRecursiveSameLayerEdgeData(edge:yfiles.algorithms.Edge,originalEdgeData:yfiles.hierarchic.IEdgeData,isUpper:boolean):yfiles.hierarchic.IEdgeData; - /** - * Creates a redirected {@link yfiles.algorithms.Edge} to replace an {@link yfiles.algorithms.Edge} connected to a group - * {@link yfiles.algorithms.Node}. - * @param newSource the source node of the {@link } - * @param newTarget the target node of the {@link } - * @param groupEdge the given group {@link } - * @returns a new redirected {@link } - * @abstract - */ - createRedirectedGroupEdge(newSource:yfiles.algorithms.Node,newTarget:yfiles.algorithms.Node,groupEdge:yfiles.algorithms.Edge):yfiles.algorithms.Edge; - /** - * Creates a reversed dummy {@link yfiles.algorithms.Edge} using the given data. - * @param newSource the source node of the {@link } - * @param newTarget the target node of the {@link } - * @param oldEdge the old {@link } from which to retrieve the data - * @param sourceEnd true if the source node of the edge is referred, false otherwise - * @param targetEnd true if the target node of the edge is referred, false otherwise - * @returns a new reversed dummy {@link } - * @abstract - */ - createReverseDummyEdge(newSource:yfiles.algorithms.Node,newTarget:yfiles.algorithms.Node,oldEdge:yfiles.algorithms.Edge,sourceEnd:boolean,targetEnd:boolean):yfiles.algorithms.Edge; - /** - * Creates an {@link yfiles.hierarchic.IEdgeData} object for a same-layer {@link yfiles.algorithms.Edge} and associates it with the edge. - * @param edge the given {@link } - * @returns an {@link } object for the same-layer {@link } - * @abstract - */ - createSameLayerEdgeData(edge:yfiles.algorithms.Edge):yfiles.hierarchic.IEdgeData; - /** - * Creates a same-layer {@link yfiles.algorithms.Edge} proxy connecting a newly created proxy {@link yfiles.algorithms.Node} and a given - * proxy {@link yfiles.algorithms.Node} in the given {@link yfiles.hierarchic.ILayer}. - * @param layer the given {@link } - * @param edge the given {@link } - * @param toProxy the given proxy {@link } - * @returns a new redefined same-layer {@link } - * @abstract - */ - createSameLayerProxy(layer:yfiles.hierarchic.ILayer,edge:yfiles.algorithms.Edge,toProxy:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Creates a proxy {@link yfiles.algorithms.Node} for a same-layer {@link yfiles.algorithms.Edge} during the drawing phase that ends at the - * side of a node. - * @param inLayer the given {@link } instance - * @param forNode the given {@link } - * @param edge the given {@link } - * @param [sld=null] a given {@link } instance - * @returns the new proxy {@link } - * @abstract - */ - createSameLayerSideProxy(inLayer:yfiles.hierarchic.ILayer,forNode:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge,sld?:yfiles.hierarchic.SwimlaneDescriptor):yfiles.algorithms.Node; - /** - * Creates a same-layer switch proxy {@link yfiles.algorithms.Node} (switching between two same-layer - * {@link yfiles.algorithms.Edge}s on two different sides of the layer). - * @param layer the given {@link } - * @param edge the given {@link } - * @returns the new same-layer switch proxy {@link } - * @abstract - */ - createSameLayerSwitchProxy(layer:yfiles.hierarchic.ILayer,edge:yfiles.algorithms.Edge):yfiles.algorithms.Node; - /** - * Creates an {@link yfiles.hierarchic.IEdgeData} object for a self-loop {@link yfiles.algorithms.Edge} and associates it with the edge. - * @param edge the given {@link } - * @returns an {@link } object for a self-loop {@link } - * @abstract - */ - createSelfLoopEdgeData(edge:yfiles.algorithms.Edge):yfiles.hierarchic.IEdgeData; - /** - * Destroys a spacer {@link yfiles.algorithms.Node} for the drawing phase created using - * {@link yfiles.hierarchic.IItemFactory#createDistanceNode}. - * @param distanceNode the {@link } to be destroyed - * @abstract - */ - destroyDistanceNode(distanceNode:yfiles.algorithms.Node):void; - /** - * Removes the given layer for proxies at groups to handle direct group content connector edges between a node in the - * first/last layer of the group node and the groups border. - * @param layer the layer to destroy - * @param useInEdges whether the incoming edges should be used as the resulting edges - * @see yfiles.hierarchic.EdgeLayoutDescriptor#directGroupContentEdgeRouting - * @abstract - */ - destroyGroupConnectorLayer(layer:yfiles.hierarchic.ILayer,useInEdges:boolean):void; - /** - * Destroys a previously created label layer - * @param layer the layer to destroy - * @param useInEdges whether the incoming edges should be used as the resulting edges - * @abstract - */ - destroyLabelNodeLayer(layer:yfiles.hierarchic.ILayer,useInEdges:boolean):void; - /** - * Destroys a proxy {@link yfiles.algorithms.Node} created using {@link yfiles.hierarchic.IItemFactory#createProxyNode} for the drawing - * phase. - * @param proxyNode the proxy {@link } to be destroyed - * @returns - * @abstract - */ - destroyProxyNode(proxyNode:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Destroys a same-layer {@link yfiles.algorithms.Edge} proxy created using {@link yfiles.hierarchic.IItemFactory#createSameLayerProxy}. - * @param edge the {@link } whose proxy will be destroyed - * @returns the redefined {@link } after the removal of the proxy {@link } - * @abstract - */ - destroySameLayerProxy(edge:yfiles.algorithms.Edge):yfiles.algorithms.Edge; - /** - * Destroys a proxy {@link yfiles.algorithms.Node} created using {@link yfiles.hierarchic.IItemFactory#createProxyNode} for the drawing - * phase. - * @param proxyNode the proxy {@link } to be destroyed - * @abstract - */ - destroySameLayerSideProxy(proxyNode:yfiles.algorithms.Node):void; - /** - * Destroys a same-layer switch proxy {@link yfiles.algorithms.Node} created using - * {@link yfiles.hierarchic.IItemFactory#createSameLayerSwitchProxy}. - * @param node the {@link } to be destroyed - * @returns the redefined {@link } after the removal of the same-layer switch proxy {@link } - * @abstract - */ - destroySameLayerSwitchProxy(node:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Inserts a same-layer {@link yfiles.algorithms.Edge} or an {@link yfiles.algorithms.Edge} that may span multiple layers into the data - * structure and returns the resulting list of - * {@link yfiles.algorithms.Edge}s that has been created if this edge spans multiple layers. - * @param edge the given {@link } - * @returns the resulting list of {@link }s that has been created if this edge spans multiple layers - * @abstract - */ - insertEdge(edge:yfiles.algorithms.Edge):yfiles.algorithms.EdgeList; - /** - * Inserts a layer for proxies at groups to handle direct group content connector edges between a node in the first/last - * layer of the group node and the groups border. - * @param top true if this layer is placed above a group nodes, false if placed below - * @param index the index where the layer is inserted - * @returns the new layer - * @see yfiles.hierarchic.EdgeLayoutDescriptor#directGroupContentEdgeRouting - * @abstract - */ - insertGroupConnectorLayer(top:boolean,index:number):yfiles.hierarchic.ILayer; - /** - * Inserts a {@link yfiles.hierarchic.ILayer layer} for group {@link yfiles.algorithms.Node}s. - * @param source true if the group refers to the source node of an edge, false otherwise - * @param index the index at which the specified {@link layer} is to be inserted - * @returns a {@link layer} instance - * @abstract - */ - insertGroupNodeLayer(source:boolean,index:number):yfiles.hierarchic.ILayer; - /** - * Inserts a {@link yfiles.hierarchic.ILayer} for labels. - * @param source true if the source node of the edge, false otherwise - * @param index the index at which the specified {@link } is to be inserted - * @returns a {@link layer} instance - * @abstract - */ - insertLabelNodeLayer(source:boolean,index:number):yfiles.hierarchic.ILayer; - /** - * Registers an {@link yfiles.algorithms.Edge} as a same-layer {@link yfiles.algorithms.Edge} appropriately into all data structures. - * @param edge the given {@link } to be registered - * @abstract - */ - registerSameLayerEdge(edge:yfiles.algorithms.Edge):void; - /** - * Converts a same-layer {@link yfiles.algorithms.Edge} to an {@link yfiles.algorithms.Edge} of type - * {@link yfiles.hierarchic.EdgeDataType#DIRECT_SAME_LAYER_EDGE}. - * @param sameLayerEdge the given same-layer {@link } - * @abstract - */ - setDirectlyConnectSameLayerEdge(sameLayerEdge:yfiles.algorithms.Edge):void; - /** - * Specifies an edge group constraint for an {@link yfiles.algorithms.Edge} and assigns it to an {@link yfiles.hierarchic.IEdgeData} - * object. - * @param edge the given {@link } - * @param sgId the ID of the edge group at the source node - * @param tgId the ID of the edge group at the target node - * @returns an {@link } object - * @abstract - */ - setTemporaryEdgeGroups(edge:yfiles.algorithms.Edge,sgId:any,tgId:any):yfiles.hierarchic.IEdgeData; - /** - * Specifies the thickness for an {@link yfiles.algorithms.Edge} and defines it in an {@link yfiles.hierarchic.IEdgeData} object. - * @param edge the given {@link } - * @param thickness the new edge thickness - * @returns an {@link } object with an adjusted {@link } - * @abstract - */ - setTemporaryEdgeThickness(edge:yfiles.algorithms.Edge,thickness:number):yfiles.hierarchic.IEdgeData; - /** - * Specifies a port constraint for an {@link yfiles.algorithms.Edge} at the given side and assigns it to an {@link yfiles.hierarchic.IEdgeData} - * object. - * @param edge the given {@link } - * @param source true of the port constraint is defined on the source node of the {@link }, false otherwise - * @param pc the given {@link } instance - * @returns an {@link } object - * @abstract - */ - setTemporaryPortConstraint(edge:yfiles.algorithms.Edge,source:boolean,pc:yfiles.layout.PortConstraint):yfiles.hierarchic.IEdgeData; - /** - * Reverts a label node to the normal {@link yfiles.algorithms.Node}. - * @param labelNode the given label node to be converted - * @abstract - */ - unconvertToLabelNode(labelNode:yfiles.algorithms.Node):void; - } - var IItemFactory:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.IItemFactory; - }; - /** - * This interface describes a single layer in a hierarchic layout. - *

- * A layer consists of nodes along with the associated same-layer edges. Each layer has a {@link yfiles.hierarchic.ILayer#type type} and an index representing - * its order in the {@link yfiles.hierarchic.ILayers list of layers}. - *

- * @see yfiles.hierarchic.ILayers - * @see yfiles.hierarchic.HierarchicLayoutCore - * @see yfiles.hierarchic.ILayerer - * @interface - */ - export interface ILayer extends yfiles.lang.Object{ - /** - * Adds a newly created {@link yfiles.algorithms.Node} to this {@link yfiles.hierarchic.ILayer} instance. - * @param node the {@link } to be added - * @abstract - */ - add(node:yfiles.algorithms.Node):void; - /** - * Adds a same-layer {@link yfiles.algorithms.Edge} to this {@link yfiles.hierarchic.ILayer} instance. - * @param edge the same-layer {@link } to be added - * @abstract - */ - addSameLayerEdge(edge:yfiles.algorithms.Edge):void; - /** - * Removes a {@link yfiles.algorithms.Node} from this {@link yfiles.hierarchic.ILayer} instance. - * @param node the {@link } to be removed - * @abstract - */ - remove(node:yfiles.algorithms.Node):void; - /** - * Removes the current layer from the {@link yfiles.hierarchic.ILayers list of layers}. - * @abstract - */ - remove():void; - /** - * Adjusts the order of the {@link yfiles.algorithms.Node}s of this {@link yfiles.hierarchic.ILayer} instance according to the given - * order. - * @param list the given list to be used - * @abstract - */ - setNodeOrder(list:yfiles.algorithms.YList):void; - /** - * Gets a list of all same-layer {@link yfiles.algorithms.Edge}s associated with this {@link yfiles.hierarchic.ILayer} instance. - * @abstract - * @type {yfiles.algorithms.YList} - */ - sameLayerEdges:yfiles.algorithms.YList; - /** - * Gets a list of the {@link yfiles.algorithms.Node}s associated with this {@link yfiles.hierarchic.ILayer} instance. - * @abstract - * @type {yfiles.algorithms.NodeList} - */ - list:yfiles.algorithms.NodeList; - /** - * Gets the type of this {@link yfiles.hierarchic.ILayer} instance. - * @abstract - * @type {yfiles.hierarchic.LayerType} - */ - type:yfiles.hierarchic.LayerType; - /** - * Gets the index of this {@link yfiles.hierarchic.ILayer} instance in the {@link yfiles.hierarchic.ILayers list of all layers}. - * @abstract - * @type {number} - */ - index:number; - /** - * Gets or sets the {@link yfiles.layout.RowDescriptor} associated with this {@link yfiles.hierarchic.ILayer} instance. - * @abstract - * @type {yfiles.layout.RowDescriptor} - */ - row:yfiles.layout.RowDescriptor; - } - var ILayer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.ILayer; - }; - /** - * This interface merges two {@link yfiles.hierarchic.ILayers} instances whose nodes reside in the same graph. - *

- * Implementations of this interface may provide different strategies for merging. - *

- *

- * {@link yfiles.hierarchic.DefaultLayeredComponentsMerger Default implementations} of this interface are used internally by {@link yfiles.hierarchic.HierarchicLayoutCore} and {@link yfiles.hierarchic.MultiComponentLayerer} - * when e.g. the graph is grouped or it consists of more than one connected component. - *

- * @interface - */ - export interface ILayeredComponentsMerger extends yfiles.lang.Object{ - /** - * Merges two {@link yfiles.hierarchic.ILayers} instances. - *

- * All nodes that belong to the source and target {@link yfiles.hierarchic.ILayers} are part of the graph at the moment of - * invocation. - *

- *

- * The state of the source {@link yfiles.hierarchic.ILayers} instance is discarded after this call and does not need to be updated - * to reflect the changes. The target {@link yfiles.hierarchic.ILayers} instance must be updated accordingly. - *

- * @param graph the graph containing the nodes of source and target {@link } instances - * @param ldp the {@link } used for querying the layer indices - * @param srcLayers the source {@link } instance that will be merged into the target {@link } instance - * @param targetLayers the {@link } instance that will be modified to contain the resulting layering - * @abstract - */ - merge(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,srcLayers:yfiles.hierarchic.ILayers,targetLayers:yfiles.hierarchic.ILayers):void; - } - var ILayeredComponentsMerger:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.ILayeredComponentsMerger; - }; - /** - * This interface is used by classes capable of generating a layer assignment. - *

- * Layer assignment takes place during the first part of the hierarchic layout algorithms. During this phase, each node of - * the graph is assigned to a {@link yfiles.hierarchic.ILayer layer}. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#layerer - * @see yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer - * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayerer - * @interface - */ - export interface ILayerer extends yfiles.lang.Object{ - /** - * Assigns all nodes of the graph to layers and adds them to the {@link yfiles.hierarchic.ILayers} instance. - *

- * In order to create new layers, factory method {@link yfiles.hierarchic.ILayers#insert} has to be used. - *

- *

- * Information about the nodes is provided by a {@link yfiles.hierarchic.ILayoutDataProvider}. However, positional information (see - * {@link yfiles.hierarchic.INodeData#position} and {@link yfiles.hierarchic.INodeData#layer}) is not available during this phase. - *

- * @param graph the input graph - * @param layers the {@link } instance that will be filled with the results of the calculation - * @param ldp the {@link } used for querying information about the nodes and edges - * @see yfiles.hierarchic.ILayers#insert - * @see yfiles.hierarchic.ILayer#add - * @abstract - */ - assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - } - var ILayerer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.ILayerer; - }; - /** - * This interface manages multiple {@link yfiles.hierarchic.ILayer} instances. - *

- * {@link yfiles.hierarchic.HierarchicLayoutCore} creates instances of this class and passes them to the instances that handle the - * various sub-tasks of the layout process during automatic layout. - *

- *

- * Method {@link yfiles.hierarchic.ILayers#createInstance} can be used as a factory method to obtain temporary {@link yfiles.hierarchic.ILayers} - * instances. - *

- * @see yfiles.hierarchic.ILayer - * @interface - */ - export interface ILayers extends yfiles.lang.Object{ - /** - * Creates a new and empty {@link yfiles.hierarchic.ILayers} instance that can be used on the same graph instance for temporary - * results. - * @returns a new and empty {@link } instance - * @abstract - */ - createInstance():yfiles.hierarchic.ILayers; - /** - * Returns the {@link yfiles.hierarchic.ILayer layer} at the specified position in this {@link yfiles.hierarchic.ILayers list of layers}. - * @param i the zero-based index of the {@link layer} to return - * @returns the {@link layer} at the specified position - * @abstract - */ - getLayer(i:number):yfiles.hierarchic.ILayer; - /** - * Creates, inserts and returns a {@link yfiles.hierarchic.ILayer layer} of a given type associated with this {@link yfiles.hierarchic.ILayers list of layers}. - * @param type one of the predefined layer types as defined in {@link } interface - * @param position the index at which the specified {@link layer} is to be inserted - * @returns a new {@link } instance - * @abstract - */ - insert(type:yfiles.hierarchic.LayerType,position:number):yfiles.hierarchic.ILayer; - /** - * Removes the {@link yfiles.hierarchic.ILayer layer} at the specified position from this {@link yfiles.hierarchic.ILayers list of layers}. - * @param index the zero-based index of the {@link layer} to remove - * @abstract - */ - remove(index:number):void; - /** - * Returns the number of {@link yfiles.hierarchic.ILayer layers} associated with this {@link yfiles.hierarchic.ILayers} instance. - * @returns the number of layers of this {@link } instance - * @abstract - */ - size():number; - } - var ILayers:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.ILayers; - }; - /** - * This interface retrieves {@link yfiles.hierarchic.INodeData} and {@link yfiles.hierarchic.IEdgeData} instances for elements in the - * current layout graph. - *

- * Instances of this interface are provided by {@link yfiles.hierarchic.HierarchicLayoutCore} for instances implementing sub-tasks - * during the layout. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore - * @interface - */ - export interface ILayoutDataProvider extends yfiles.lang.Object{ - /** - * Returns the {@link yfiles.hierarchic.IEdgeData} instance associated with the given {@link yfiles.algorithms.Edge}. - * @param edge the given edge - * @returns the {@link } instance associated with the edge - * @abstract - */ - getEdgeData(edge:yfiles.algorithms.Edge):yfiles.hierarchic.IEdgeData; - /** - * Returns the {@link yfiles.hierarchic.INodeData} instance associated with the given {@link yfiles.algorithms.Node}. - * @param node the given node - * @returns the {@link } instance associated with the node - * @abstract - */ - getNodeData(node:yfiles.algorithms.Node):yfiles.hierarchic.INodeData; - } - var ILayoutDataProvider:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.ILayoutDataProvider; - }; - /** - * This interface provides layout information about the nodes of the graph during the layout. - *

- * {@link yfiles.hierarchic.INodeData} is a multi-purpose node descriptor for each node of the graph during the hierarchic layout - * used internally by the algorithm implementations. - *

- *

- * Instances of this interface can be obtained during the layout from instances of the {@link yfiles.hierarchic.ILayoutDataProvider} - * interface. - *

- *

- * {@link yfiles.hierarchic.INodeData} typically carries the {@link yfiles.hierarchic.INodeData#type type} of the node and depending on the type an optional {@link yfiles.hierarchic.INodeData#associatedEdge associated edge} - * and - * {@link yfiles.hierarchic.INodeData#associatedNode associated node}. Optionally, it may carry a geometric description of the borders of the node and descriptors for various - * aspects of the layout. - *

- * @interface - */ - export interface INodeData extends yfiles.lang.Object{ - /** - * Creates, stores and returns a {@link yfiles.algorithms.BorderLine} for the given side or returns the current {@link yfiles.algorithms.BorderLine} - * instance if it already exists. - *

- * Not every {@link yfiles.hierarchic.INodeData#type type} of node supports this operation. {@link yfiles.hierarchic.NodeDataType#NORMAL} supports - * {@link yfiles.algorithms.BorderLine}s. - *

- *

- * Side value must be inside [0,3] interval, where 0 corresponds to the top side, 1 to the right side, 2 to the bottom side - * and 3 to the left side. - *

- * @param side an integer value from [0,3] interval - * @param nodeLayout the {@link } of the current node - * @returns a {@link } instance - * @throws {Stubs.Exceptions.NotSupportedError} if this {@link yfiles.hierarchic.INodeData#type type} of node does not support node borders - * @see yfiles.hierarchic.INodeData#getNormalizedBorderLine - * @abstract - */ - createBorderLine(side:number,nodeLayout:yfiles.layout.INodeLayout):yfiles.algorithms.BorderLine; - /** - * Returns a {@link yfiles.algorithms.BorderLine} for the given side which is treated as if the position of the node is at (0,0). - *

- * Clients may modify this instance but should always reset it to the original position, since this is a shared instance. - *

- *

- * It may return null to indicate that the {@link yfiles.algorithms.BorderLine} can be determined through the {@link yfiles.layout.INodeLayout} - * instance. - *

- *

- * Side value must be inside [0,3] interval, where 0 corresponds to the top side, 1 to the right side, 2 to the bottom side - * and 3 to the left side. - *

- * @param side an integer value from [0,3] interval - * @returns a {@link } instance or null - * @see yfiles.hierarchic.INodeData#createBorderLine - * @abstract - */ - getNormalizedBorderLine(side:number):yfiles.algorithms.BorderLine; - /** - * Returns the number of same-layer edges associated with the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} - * instance. - * @returns the number of same-layer edges associated with the node - * @abstract - */ - sameLayerEdgeCount():number; - /** - * Gets the group node this node belongs to. - * @abstract - * @type {yfiles.algorithms.Node} - */ - groupNode:yfiles.algorithms.Node; - /** - * Gets the first same-layer edge {@link yfiles.algorithms.ListCell} of all same-layer edges or null if there exists no same-layer - * edge. - * @abstract - * @type {yfiles.algorithms.ListCell} - */ - firstSameLayerEdgeCell:yfiles.algorithms.ListCell; - /** - * Gets the type constant for the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance. - * @abstract - * @type {yfiles.hierarchic.NodeDataType} - */ - type:yfiles.hierarchic.NodeDataType; - /** - * Gets the group ID of the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance if it is a bus-group node. - * @see yfiles.hierarchic.NodeDataType#SOURCE_GROUP_NODE - * @see yfiles.hierarchic.NodeDataType#TARGET_GROUP_NODE - * @abstract - * @type {any} - */ - groupId:any; - /** - * Gets the associated {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance (in case of e.g. - *

- * back-loop proxy and side proxy). - *

- * @abstract - * @type {yfiles.algorithms.Node} - */ - associatedNode:yfiles.algorithms.Node; - /** - * Gets the associated {@link yfiles.algorithms.Edge} of the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance - * (in case of e.g. - *

- * bend or same-layer center node). - *

- * @abstract - * @type {yfiles.algorithms.Edge} - */ - associatedEdge:yfiles.algorithms.Edge; - /** - * Gets the index of the {@link yfiles.hierarchic.ILayer} instance to which the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} - * instance belongs. - * @abstract - * @type {number} - */ - layer:number; - /** - * Gets the current position of the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance within its layer. - * @abstract - * @type {number} - */ - position:number; - /** - * Gets the parent group node of the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance (if any). - * @abstract - * @type {yfiles.algorithms.Node} - */ - parentGroupNode:yfiles.algorithms.Node; - /** - * Gets the inner layers of the group {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance. - *

- * If this node is of type {@link yfiles.hierarchic.NodeDataType#GROUP}, this method returns the {@link yfiles.hierarchic.ILayers} object - * that describes the layering in the subgraph. - *

- * @abstract - * @type {yfiles.hierarchic.ILayers} - */ - groupLayers:yfiles.hierarchic.ILayers; - /** - * Gets the hint of the incremental mode of the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance if this - * node is of type {@link yfiles.hierarchic.NodeDataType#NORMAL}. - *

- * The corresponding hint has been set by a {@link yfiles.algorithms.IDataProvider} using key - * {@link yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY}. - *

- * @abstract - * @type {any} - */ - incrementalHint:any; - /** - * Gets the {@link yfiles.hierarchic.NodeLayoutDescriptor} instance initially bound to the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} - * instance or null if no {@link yfiles.hierarchic.NodeLayoutDescriptor} has been registered. - * @abstract - * @type {yfiles.hierarchic.NodeLayoutDescriptor} - */ - nodeLayoutDescriptor:yfiles.hierarchic.NodeLayoutDescriptor; - /** - * Gets the {@link yfiles.hierarchic.SwimlaneDescriptor} instance initially bound to the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} - * instance or null if no {@link yfiles.hierarchic.SwimlaneDescriptor} has been registered. - * @abstract - * @type {yfiles.hierarchic.SwimlaneDescriptor} - */ - swimLaneDescriptor:yfiles.hierarchic.SwimlaneDescriptor; - } - var INodeData:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.INodeData; - }; - /** - * This interface is responsible for the assignment of the x-(sequence) and preliminary y-coordinates of the nodes in a - * hierarchic layout. - *

- * Implementations of this interface are used during the drawing phase of - * {@link yfiles.hierarchic.HierarchicLayoutCore}. They determine preliminary y-coordinates (which may be adjusted during the final - * edge routing) and the resulting x-coordinates of all elements that are part of the graph during the node placement - * phase. - *

- *

- * The minimum distance between each pair of nodes of the graph is determined by a {@link yfiles.hierarchic.IDrawingDistanceCalculator} - * instance. - *

- *

- * The default implementation used by the {@link yfiles.hierarchic.HierarchicLayoutCore} is {@link yfiles.hierarchic.SimplexNodePlacer}. - * Custom implementations of {@link yfiles.hierarchic.INodePlacer} interface can be used for hierarchic layout algorithms using - * methods {@link yfiles.hierarchic.HierarchicLayoutCore#nodePlacer} or {@link yfiles.hierarchic.HierarchicLayout#nodePlacer}. - *

- * @see yfiles.hierarchic.SimplexNodePlacer - * @see yfiles.hierarchic.IDrawingDistanceCalculator - * @see yfiles.hierarchic.HierarchicLayoutCore - * @see yfiles.hierarchic.HierarchicLayoutCore#nodePlacer - * @see yfiles.hierarchic.HierarchicLayout#nodePlacer - * @interface - */ - export interface INodePlacer extends yfiles.lang.Object{ - /** - * Assigns preliminary y-coordinates for each layer of a hierarchic layout. - *

- * The distance between two layers will be adjusted later by the edge routing algorithm. This method is responsible for - * assigning the relative positions of the nodes within each layer. - *

- * @param graph the input graph - * @param layoutDataProvider the {@link } containing information about the elements - * @param layers the {@link } instance that will be calculated by this method - * @abstract - */ - assignLayerCoordinates(graph:yfiles.layout.LayoutGraph,layoutDataProvider:yfiles.hierarchic.ILayoutDataProvider,layers:yfiles.hierarchic.ILayers):void; - /** - * Determines the resulting x-coordinates of a hierarchic layout. - *

- * The minimum distance between each pair of nodes of the graph is determined by a {@link yfiles.hierarchic.IDrawingDistanceCalculator} - * instance. - *

- * @param graph the input graph - * @param layoutDataProvider the {@link } containing information about the elements - * @param layers the {@link } instance that will be calculated by this method - * @param drawingDistanceCalculator the given {@link } instance - * @abstract - */ - assignSequenceCoordinates(graph:yfiles.layout.LayoutGraph,layoutDataProvider:yfiles.hierarchic.ILayoutDataProvider,layers:yfiles.hierarchic.ILayers,drawingDistanceCalculator:yfiles.hierarchic.IDrawingDistanceCalculator):void; - } - var INodePlacer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.INodePlacer; - }; - /** - * This interface is responsible for assigning port coordinates to the adjacent edges of each node of the graph. - *

- * {@link yfiles.hierarchic.IPortAllocator} is used by {@link yfiles.hierarchic.HierarchicLayoutCore} after the sequencing phase. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore - * @interface - */ - export interface IPortAllocator extends yfiles.lang.Object{ - /** - * Assigns to each edge of the graph a source port and target port coordinate pair. - *

- * This method is called by {@link yfiles.hierarchic.HierarchicLayoutCore} after the sequencing phase. - *

- * @param graph the input graph - * @param layers the given {@link } instance containing the elements in the layering - * @param ldp the {@link } containing layering information about the nodes and edges of the graph - * @param itemFactory the {@link } used temporarily for modifying the graph instance - * @abstract - */ - assignPorts(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - } - var IPortAllocator:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.IPortAllocator; - }; - /** - * This interface serves as a callback for {@link yfiles.hierarchic.HierarchicLayoutCore} after the layering and sequencing - * phases. - *

- * Implementations of this interface may modify the {@link yfiles.layout.PortConstraint port constraint} information via - * {@link yfiles.hierarchic.IItemFactory#setTemporaryPortConstraint}. - *

- * @interface - */ - export interface IPortConstraintOptimizer extends yfiles.lang.Object{ - /** - * Assigns new temporary port constraints after the layering information has been determined. - * @param graph the input graph - * @param layers the given {@link } instance - * @param ldp the {@link } containing information about the elements - * @param itemFactory the {@link } to set the temporary port constraints with - * @see yfiles.hierarchic.IItemFactory#setTemporaryPortConstraint - * @abstract - */ - optimizeAfterLayering(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Assigns new temporary port constraints after the sequence of the nodes has been determined. - * @param graph the input graph - * @param layers the given {@link } instance - * @param ldp the {@link } containing information about the elements - * @param itemFactory the {@link } to set the temporary port constraints with - * @see yfiles.hierarchic.IItemFactory#setTemporaryPortConstraint - * @abstract - */ - optimizeAfterSequencing(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - } - var IPortConstraintOptimizer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.IPortConstraintOptimizer; - }; - /** - * This interface is used by {@link yfiles.hierarchic.HierarchicLayoutCore} to calculate the order of the nodes within each {@link yfiles.hierarchic.ILayers layer}. - *

- * Implementations are used during the second phase of the hierarchic layout process and can be set using method {@link yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer} or {@link yfiles.hierarchic.HierarchicLayout#fromScratchSequencer}). - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#sequencer - * @see yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer - * @see yfiles.hierarchic.HierarchicLayout#fromScratchSequencer - * @interface - */ - export interface ISequencer extends yfiles.lang.Object{ - /** - * Calculates the sequence of the nodes within each {@link yfiles.hierarchic.ILayers layer}. - *

- * This method is called by {@link yfiles.hierarchic.HierarchicLayoutCore} during the second phase and finally writes back the - * calculated sequence using the {@link yfiles.hierarchic.ILayer#setNodeOrder} method. - *

- * @param graph the input graph - * @param layers the given {@link } instance containing the elements in the layering - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param itemFactory the {@link } used temporarily for modifying the graph instance - * @abstract - */ - sequenceNodeLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - } - var ISequencer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.hierarchic.ISequencer; - }; - /** - * This class is a wrapper {@link yfiles.hierarchic.ILayerer} implementation that delegates the actual layering to a delegate - * {@link yfiles.hierarchic.ILayerer}. - *

- * If the graph consists of multiple components, they will be identified and sorted and each of the components will be - * layered separately using the delegate {@link yfiles.hierarchic.ILayerer} instance. After that they will all be merged using the - * specified {@link yfiles.hierarchic.ILayeredComponentsMerger} instance. - *

- * @class - * @implements {yfiles.hierarchic.ILayerer} - */ - export interface MultiComponentLayerer extends yfiles.lang.Object,yfiles.hierarchic.ILayerer{} - export class MultiComponentLayerer { - /** - * Creates a new instance of {@link yfiles.hierarchic.MultiComponentLayerer} using the given {@link yfiles.hierarchic.ILayeredComponentsMerger} - * and {@link yfiles.collections.IComparer.} instances. - * @param singleComponentLayerer - * @param merger - * @param componentComparer - * @throws {Stubs.Exceptions.ArgumentError} if the given layerer or merger is null - */ - constructor(singleComponentLayerer:yfiles.hierarchic.ILayerer,merger:yfiles.hierarchic.ILayeredComponentsMerger,componentComparer:yfiles.collections.IComparer); - /** - * Creates a new instance of {@link yfiles.hierarchic.MultiComponentLayerer} using the given delegate {@link yfiles.hierarchic.ILayerer}. - *

- * A new instance of {@link yfiles.hierarchic.DefaultLayeredComponentsMerger} will be used as merger while no component {@link yfiles.collections.IComparer.} will be - * used. - *

- * @param singleComponentLayerer - * @throws {Stubs.Exceptions.ArgumentError} if the given layerer is null - */ - constructor(singleComponentLayerer:yfiles.hierarchic.ILayerer); - /** - * - * @param graph - * @param layers - * @param ldp - */ - assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Sorts an array which consists of - * {@link yfiles.algorithms.NodeList}s each of which contains nodes that belong to the same component. - *

- * It is called during {@link yfiles.hierarchic.MultiComponentLayerer#assignLayers}. - *

- *

- * By default this method uses the {@link yfiles.hierarchic.MultiComponentLayerer#componentComparer ComponentComparator} to sort the list and has no effect if the instance is null. - *

- * @param nodeLists the array of {@link }s each of which containing nodes that belong to the same component - * @param componentIndexProvider the {@link } that returns an object (the component index) for each node (this value can be either - * integer or object) - * @protected - */ - sort(nodeLists:yfiles.algorithms.NodeList[],componentIndexProvider:yfiles.algorithms.IDataProvider):void; - /** - * Gets or sets the delegate {@link yfiles.hierarchic.ILayerer} instance. - * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.ILayerer} is null - * @type {yfiles.hierarchic.ILayerer} - */ - singleComponentLayerer:yfiles.hierarchic.ILayerer; - /** - * Gets or sets the {@link yfiles.hierarchic.ILayeredComponentsMerger merger} instance. - * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.ILayeredComponentsMerger} is null - * @type {yfiles.hierarchic.ILayeredComponentsMerger} - */ - merger:yfiles.hierarchic.ILayeredComponentsMerger; - /** - * Gets or sets the component {@link yfiles.collections.IComparer.} instance. - * @type {yfiles.collections.IComparer.} - */ - componentComparer:yfiles.collections.IComparer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.MultiComponentLayerer; - } - /** - * This class is used by {@link yfiles.hierarchic.HierarchicLayoutCore} during the various phases to provide the drawing details of - * the nodes of the graph. - *

- * A {@link yfiles.hierarchic.NodeLayoutDescriptor} instance can be specified individually for single nodes using a {@link yfiles.algorithms.IDataProvider} - * that returns a {@link yfiles.hierarchic.NodeLayoutDescriptor} instance for each node of the graph, or null if no {@link yfiles.hierarchic.NodeLayoutDescriptor} - * is bound to an edge. The {@link yfiles.algorithms.IDataProvider} is registered with the graph with key - * {@link yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY}. - *

- *

- * This class is designed as a class to allow future additions of new getter methods. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY - * @see yfiles.hierarchic.EdgeLayoutDescriptor - * @class - */ - export interface NodeLayoutDescriptor extends yfiles.lang.Object{} - export class NodeLayoutDescriptor { - /** - * Creates a new instance of a {@link yfiles.hierarchic.NodeLayoutDescriptor} with the default values. - */ - constructor(); - /** - * Returns the port border gap ratio for the port distribution at a given side of the node. - *

- * This ratio determines the gap between a corner of the node and the first assigned port. - *

- *

- * The ratio should be greater than 0. - *

- *

- * A value of 0.0d results in ports being placed directly on the corner of the node (if there is more than one port). - *

- *

- * A value of 0.5d results in ports being distributed along the side of the node so that the distance between the corner of - * the node and the first port is half as wide as the distance between two adjacent ports. - *

- *

- * A value of Double.POSITIVE_INFINITY results in all ports being centered at the side in one point. - *

- * @param side the zero-based clockwise side index for top-to-bottom layouts (i.e., top is 0) - * @returns the border gap ratio of a given side - * @see yfiles.hierarchic.NodeLayoutDescriptor#portBorderGapRatios - * @see yfiles.hierarchic.NodeLayoutDescriptor#setPortBorderGapRatio - */ - getPortBorderGapRatio(side:number):number; - /** - * Specifies the port border gap ratio for the port distribution at a given side of the node. - *

- * This ratio determines the gap between a corner of the node and the first assigned port. - *

- *

- * The ratio should be greater than 0. - *

- *

- * A value of 0.0d results in ports being placed directly on the corner of the node (if there is more than one port). - *

- *

- * A value of 0.5d results in ports being distributed along the side of the node so that the distance between the corner of - * the node and the first port is half as wide as the distance between two adjacent ports. - *

- *

- * A value of Double.POSITIVE_INFINITY results in all ports being centered at the side in one point. - *

- * @param side the zero-based clockwise side index for top-to-bottom layouts (i.e., top is 0) - * @param ratio the given ratio - * @throws {Stubs.Exceptions.ArgumentError} if the given ratio is negative - * @see yfiles.hierarchic.NodeLayoutDescriptor#portBorderGapRatios - */ - setPortBorderGapRatio(side:number,ratio:number):void; - /** - * Sets the port border gap ratio for the port distribution on all sides of the node. - *

- * This ratio determines the gap between a corner of the node and the first assigned port. - *

- *

- * The ratio should be greater than 0. - *

- *

- * A value of 0.0d results in ports being placed directly on the corner of the node (if there is more than one port). - *

- *

- * A value of 0.5d results in ports being distributed along the side of the node so that the distance between the corner of - * the node and the first port is half as wide as the distance between two adjacent ports. - *

- *

- * A value of Double.POSITIVE_INFINITY results in all ports being centered at the side in one point. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given ratio is negative - * @see yfiles.hierarchic.NodeLayoutDescriptor#setPortBorderGapRatio - * @type {number} - */ - portBorderGapRatios:number; - /** - * Gets or sets the alignment of the {@link yfiles.algorithms.Node node} of this {@link yfiles.hierarchic.NodeLayoutDescriptor} instance within its layer. - *
    - *
  • A value of 0.0d corresponds to top-alignment.
  • - *
  • A value of 0.5d corresponds to center-alignment.
  • - *
  • A value of 1.0d corresponds to bottom-alignment.
  • - *
- *

- * This value should be within [0,1] interval. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the alignment is not within [0.0d .. 1.0d] - * @type {number} - */ - layerAlignment:number; - /** - * Gets or sets the mode that determines how node labels are handled by the algorithm during the layout. - * @throws {Stubs.Exceptions.ArgumentError} if the constant is unknown. - * @see yfiles.hierarchic.HierarchicLayout#considerNodeLabels - * @type {yfiles.hierarchic.NodeLabelMode} - */ - nodeLabelMode:yfiles.hierarchic.NodeLabelMode; - /** - * Gets or sets the minimum height of the layer to which this node is assigned. - *

- * Values should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum height is negative - * @type {number} - */ - minimumLayerHeight:number; - /** - * Gets or sets the preferred minimum distance to obstacles. - *

- * The minimum distance should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum length is negative - * @type {number} - */ - minimumDistance:number; - /** - * Gets or sets a reference point relative to the center of the node which will be placed on a grid coordinate. - * @type {yfiles.algorithms.YPoint} - */ - gridReference:yfiles.algorithms.YPoint; - /** - * Gets or sets the assignment strategy which distributes the ports along the node borders. - * @type {yfiles.hierarchic.PortAssignmentMode} - */ - portAssignment:yfiles.hierarchic.PortAssignmentMode; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.NodeLayoutDescriptor; - } - /** - * This class implements a {@link yfiles.layout.ILayoutStage layout stage} that handles a given {@link yfiles.layout.PartitionGrid partition grid} structure. - *

- * Information about the {@link yfiles.layout.PartitionGrid partition grid} structure are held by a {@link yfiles.algorithms.IDataProvider} registered with the graph - * with key {@link yfiles.layout.PartitionGrid#PARTITION_GRID_DP_KEY}. - *

- * @see yfiles.layout.PartitionGrid - * @see yfiles.hierarchic.HierarchicLayout - * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface PartitionGridLayoutStage extends yfiles.layout.LayoutStageBase{} - export class PartitionGridLayoutStage { - /** - * Creates a new instance of {@link yfiles.hierarchic.PartitionGridLayoutStage}. - */ - constructor(); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.PartitionGridLayoutStage; - } - /** - * This class is an implementation of the {@link yfiles.hierarchic.IPortConstraintOptimizer} interface that tries to assign the - * edges of the graph to {@link yfiles.layout.PortConstraint ports} considering the specified {@link yfiles.layout.PortCandidate}s. - *

- * Instances of this class can be set using property {@link yfiles.hierarchic.HierarchicLayoutCore#portConstraintOptimizer}. - *

- *

- * This implementation will query for {@link yfiles.algorithms.IDataProvider}s registered with the graph with keys - * {@link yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY}, {@link yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY} - * and {@link yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY}. It will try to assign each edge one of the matching - * {@link yfiles.layout.PortCandidate}s without introducing too many crossings and without violating the {@link yfiles.layout.PortCandidate#cost cost} or {@link yfiles.layout.PortCandidateSet#connectionCount capacity} - * constraints. - *

- * @see yfiles.layout.PortCandidate#cost - * @see yfiles.layout.PortCandidateSet#entries - * @see yfiles.layout.PortCandidateSet#connectionCount - * @class - * @extends {yfiles.hierarchic.PortConstraintOptimizerBase} - */ - export interface PortCandidateOptimizer extends yfiles.hierarchic.PortConstraintOptimizerBase{} - export class PortCandidateOptimizer { - /** - * Creates a new instance of {@link yfiles.hierarchic.PortCandidateOptimizer} with the default settings. - */ - constructor(); - /** - * Returns the data provider that provides the port candidate sets for nodes. - * @param graph The graph that stores the data provider - * @returns - * @protected - */ - getPortCandidateSetDataProvider(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.IDataProvider; - /** - * Gets or sets whether or not this implementation uses a deterministic algorithm to assign the - * {@link yfiles.layout.PortCandidate}s. - * @type {boolean} - */ - deterministic:boolean; - /** - * Gets or sets the penalty cost associated with each back-loop. - *

- * Values should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the penalty cost is negative - * @type {number} - */ - backLoopPenalty:number; - /** - * Gets or sets the penalty cost associated with a crossing that would occur if a given combination of - * {@link yfiles.layout.PortCandidate}s would be chosen. - *

- * Values should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the crossing penalty is negative - * @type {number} - */ - crossingPenalty:number; - /** - * Gets or sets the penalty cost associated with each edge being assigned to a port which has already reached its - * {@link yfiles.layout.IPortCandidateSetEntry#connections capacity}. - *

- * Values should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the penalty cost is negative - * @see yfiles.layout.IPortCandidateSetEntry#connections - * @type {number} - */ - overUsagePenalty:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.PortCandidateOptimizer; - } - /** - * This static class provides information about the same-layer structures created by class - * {@link yfiles.hierarchic.PortConstraintOptimizerBase}. - * @class - */ - export interface PortConstraintOptimizerSameLayerData extends yfiles.lang.Object{} - export class PortConstraintOptimizerSameLayerData { - /** - * Creates a new {@link yfiles.hierarchic.PortConstraintOptimizerSameLayerData} instance. - */ - constructor(); - /** - * Adds a given dummy {@link yfiles.algorithms.Node} to this {@link yfiles.hierarchic.PortConstraintOptimizerSameLayerData} instance and - * associates it with the given original (same-layer) {@link yfiles.algorithms.Edge}. - * @param sameLayerDummy a dummy node - * @param originalEdge the original (same-layer) edge - */ - addDummyNode(sameLayerDummy:yfiles.algorithms.Node,originalEdge:yfiles.algorithms.Edge):void; - /** - * Returns the original (same-layer) edge associated with the given dummy {@link yfiles.algorithms.Node}. - * @param sameLayerDummy a given dummy node - * @returns the original (same-layer) edge associated with the given dummy node - */ - getOriginalEdge(sameLayerDummy:yfiles.algorithms.Node):yfiles.algorithms.Edge; - /** - * Gets all dummy nodes of this {@link yfiles.hierarchic.PortConstraintOptimizerSameLayerData} instance. - * @type {yfiles.algorithms.NodeList} - */ - dummyNodes:yfiles.algorithms.NodeList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.PortConstraintOptimizerSameLayerData; - } - /** - * This class is an abstract implementation of the {@link yfiles.hierarchic.IPortConstraintOptimizer} interface that minimizes the - * effort required to modify the port assignment after the sequencing phase of hierarchic layout algorithm. - *

- * The {@link yfiles.hierarchic.PortConstraintOptimizerBase#optimizeAfterSequencing callback method invoked after sequencing} performs the following three steps: - *

- *
    - *
  1. - * Restores temporarily all same-layer edges which are not currently present in the layout graph at this time of the layout - * algorithm. - *
  2. - *
  3. Invokes {@link yfiles.hierarchic.PortConstraintOptimizerBase#optimizeAfterSequencingForSingleNode the hook} in which the custom port assignment should be done.
  4. - *
  5. Restores the original state of the layout graph by removing the temporary same-layer edges added in Step 1.
  6. - *
- * @class - * @implements {yfiles.hierarchic.IPortConstraintOptimizer} - */ - export interface PortConstraintOptimizerBase extends yfiles.lang.Object,yfiles.hierarchic.IPortConstraintOptimizer{} - export class PortConstraintOptimizerBase { - /** - * Creates a new {@link yfiles.hierarchic.PortConstraintOptimizerBase} instance with default settings. - * @protected - */ - constructor(); - /** - * Inserts a same-layer edge structure for each same-layer edge of the original graph. - * @param graph the input graph - * @param layers the given {@link } instance holding the layering information - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param itemFactory the {@link factory} that sets the temporary port constraints - * @returns - * @see yfiles.hierarchic.IItemFactory#setTemporaryPortConstraint - * @protected - */ - insertSameLayerStructures(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):yfiles.hierarchic.PortConstraintOptimizerSameLayerData; - /** - * Assigns new temporary port constraints after the nodes have been assigned to layers. - *

- * More precisely, it is called after the layering information has been determined. In this phase, it is possible to create - * back-loops by assigning incoming edges to the south (i.e. bottom) side or outgoing edges to the north (i.e. top) side, - * respectively. - *

- * @param graph the input graph - * @param layers the given {@link } instance holding the layering information - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param itemFactory the {@link factory} that sets the temporary port constraints - * @see yfiles.hierarchic.IItemFactory#setTemporaryPortConstraint - * @abstract - */ - optimizeAfterLayering(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Assigns new temporary port constraints after the order of the nodes in each layer has been determined. - *

- * More precisely, it is called after the sequence of the nodes has been determined. It {@link yfiles.hierarchic.PortConstraintOptimizerBase#insertSameLayerStructures inserts the same-layer structures}, - * invokes {@link yfiles.hierarchic.PortConstraintOptimizerBase#optimizeAfterSequencingForSingleNode the hook} in which the custom port assignment should be done, and finally {@link yfiles.hierarchic.PortConstraintOptimizerBase#removeSameLayerStructures restores the original state} of the - * layout graph by removing the temporary edges. - *

- * @param graph the input graph - * @param layers the given {@link } instance holding the layering information - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param itemFactory the {@link factory} that sets the temporary port constraints - * @see yfiles.hierarchic.PortConstraintOptimizerBase#insertSameLayerStructures - * @see yfiles.hierarchic.PortConstraintOptimizerBase#optimizeAfterSequencing - * @see yfiles.hierarchic.PortConstraintOptimizerBase#removeSameLayerStructures - */ - optimizeAfterSequencing(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Assigns new temporary port constraints after the order of the nodes in each layer has been determined. - *

- * More precisely, it is called after the sequence of the nodes has been determined. It invokes {@link yfiles.hierarchic.PortConstraintOptimizerBase#optimizeAfterSequencingForSingleNode} - * for every node of the original layout graph and omits the nodes of the same-layer structures. - *

- *

- * Incoming and outgoing edges are sorted using {@link yfiles.collections.IComparer.} instances which define the preferred ordering of the incoming and outgoing - * edges from left to right. - *

- * @param inEdgeOrder a given {@link } instance for incoming edges - * @param outEdgeOrder a given {@link } instance for outgoing edges - * @param graph the input graph - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param itemFactory the {@link factory} that sets the temporary port constraints - * @param layers - * @see yfiles.hierarchic.PortConstraintOptimizerBase#optimizeAfterSequencing - * @protected - */ - optimizeAfterSequencingForAllNodes(inEdgeOrder:yfiles.collections.IComparer,outEdgeOrder:yfiles.collections.IComparer,graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Assigns new temporary port constraints to a given node of the graph after the order of the nodes in each layer has been - * determined. - *

- * More precisely, it is called after the sequence of the nodes has been determined. - *

- *

- * Incoming and outgoing edges are sorted using {@link yfiles.collections.IComparer.} instances which define the preferred ordering of the incoming and outgoing - * edges from left to right. - *

- * @param node the original node to set temporary port constraints - * @param inEdgeOrder a given {@link } instance for incoming edges - * @param outEdgeOrder a given {@link } instance for outgoing edges - * @param graph the input graph - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param itemFactory the {@link factory} that sets the temporary port constraints - * @see yfiles.hierarchic.PortConstraintOptimizerBase#optimizeAfterSequencing - * @protected - * @abstract - */ - optimizeAfterSequencingForSingleNode(node:yfiles.algorithms.Node,inEdgeOrder:yfiles.collections.IComparer,outEdgeOrder:yfiles.collections.IComparer,graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Removes the same-layer edge structure created using - * {@link yfiles.hierarchic.PortConstraintOptimizerBase#insertSameLayerStructures}. - * @param sameLayerData a given {@link } instance holding the information about the same-layer - * structures. - * @param graph the input graph - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param itemFactory the {@link factory} that sets the temporary port constraints - * @see yfiles.hierarchic.IItemFactory#setTemporaryPortConstraint - * @protected - */ - removeSameLayerStructures(sameLayerData:yfiles.hierarchic.PortConstraintOptimizerSameLayerData,graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; - /** - * Gets or sets the mirror mask that defines which orientations should be mirrored. - *

- * Setting a layout orientation can be considered as rotating the graph by 90, 180 or 270 degrees. Afterwards, the graph - * can be mirrored at the x-axis (for horizontal layout orientations) or y-axis (for vertical layout orientations). Which - * directions are mirrored can be defined by the given mask. - *

- * @see yfiles.layout.OrientationLayout - * @see yfiles.layout.LayoutOrientation - * @type {yfiles.layout.MirrorModes} - */ - mirrorMode:yfiles.layout.MirrorModes; - /** - * Gets or sets the layout orientation. - *

- * This setting is necessary to correctly interpret the values provided by the {@link yfiles.layout.PortCandidate}s since the {@link yfiles.layout.OrientationLayout} - * cannot automatically adjust these values. - *

- * @see yfiles.layout.MultiStageLayout#layoutOrientation - * @type {yfiles.layout.LayoutOrientation} - */ - layoutOrientation:yfiles.layout.LayoutOrientation; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.PortConstraintOptimizerBase; - } - /** - * This class is used by {@link yfiles.hierarchic.EdgeLayoutDescriptor} to specify the routing style for different types of edges. - * @see yfiles.hierarchic.EdgeLayoutDescriptor#routingStyle - * @see yfiles.hierarchic.IEdgeData#type - * @class - */ - export interface RoutingStyle extends yfiles.lang.Object{} - export class RoutingStyle { - /** - * Creates a new {@link yfiles.hierarchic.RoutingStyle} instance with the given routing style for each edge. - * @param routingStyle one of the predefined routing styles - * @throws {Stubs.Exceptions.ArgumentError} if an unknown routing style is given - */ - constructor(routingStyle:yfiles.hierarchic.EdgeRoutingStyle); - /** - * Gets or sets the routing style for back-loop edges. - *

- * This style is used for routing U-turns of common edges (i.e., edges that are neither self-loops nor same-layer edges). A - * U-turn is a non-monotonic part of the edge route that is required for reversed edges if option {@link yfiles.hierarchic.HierarchicLayout#backLoopRouting} is enabled or in some - * other scenarios with port constraints/candidates. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an unknown routing style is given - * @type {yfiles.hierarchic.EdgeRoutingStyle} - */ - backLoopRoutingStyle:yfiles.hierarchic.EdgeRoutingStyle; - /** - * Gets or sets the routing style for grouped edges at the common segments. - *

- * More precisely, grouped edges are routed in a bus-style fashion (i.e., the paths of the edges will share a common edge - * segment) and this option allows to specify the routing style at the bus. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an unknown routing style is given - * @type {yfiles.hierarchic.EdgeRoutingStyle} - */ - edgeGroupRoutingStyle:yfiles.hierarchic.EdgeRoutingStyle; - /** - * Gets or sets the default routing style for edges that have no individual routing style. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown routing style is given - * @type {yfiles.hierarchic.EdgeRoutingStyle} - */ - defaultEdgeRoutingStyle:yfiles.hierarchic.EdgeRoutingStyle; - /** - * Gets or sets the routing style for same-layer edges. - *

- * A same-layer edge is an edge whose source/target are assigned to the same layer. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an unknown routing style is given - * @type {yfiles.hierarchic.EdgeRoutingStyle} - */ - sameLayerEdgeRoutingStyle:yfiles.hierarchic.EdgeRoutingStyle; - /** - * Gets or sets the routing style for self-loops. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown routing style is given - * @type {yfiles.hierarchic.EdgeRoutingStyle} - */ - selfLoopRoutingStyle:yfiles.hierarchic.EdgeRoutingStyle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.RoutingStyle; - } - /** - * This class calculates bend points for self-loops routed in orthogonal or octilinear fashion. - *

- * It is used during the layout phase of {@link yfiles.hierarchic.HierarchicLayoutCore}, but can be used as a stand-alone tool. - *

- * @class - */ - export interface SelfLoopCalculator extends yfiles.lang.Object{} - export class SelfLoopCalculator { - /** - * Creates a new instance of {@link yfiles.hierarchic.SelfLoopCalculator} using the given parameters. - * @param minFirstSegmentLength the minimum length of the first and last segment of an orthogonally routed self-loop - * @param minEdgeDistance the minimum distance between a pair of self-loops - */ - constructor(minFirstSegmentLength:number,minEdgeDistance:number); - /** - * Convenience method that calculates a list of self-loops that belong to a given node. - *

- * The current port positions will be used for determining the start and end ports. The {@link yfiles.algorithms.IDataProvider} - * instances hold information about the source/target ports of the edges and can be used for specifying the direction of - * first and last segments. - *

- * @param graph the input graph - * @param node the node whose self-loops will be routed - * @param selfLoops a list of {@link }s that will be routed - * @param spc the {@link } that returns the {@link } object associated with the source - * ports of the edges - * @param tpc the {@link } that returns the {@link } object associated with the target - * ports of the edges - */ - calculateSelfLoops(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node,selfLoops:yfiles.algorithms.YList,spc:yfiles.algorithms.IDataProvider,tpc:yfiles.algorithms.IDataProvider):void; - /** - * Calculates all self-loops at the given node of the given input graph. - *

- * The current port positions will be used for determining the start and end ports. The {@link yfiles.algorithms.IDataProvider} - * instances hold information about the source/target ports of the edges and can be used for specifying the direction of - * first and last segments. - *

- * @param graph the input graph - * @param node the node whose self-loops will be routed - * @param spc the {@link } that returns the {@link } object associated with the source - * ports of the edges - * @param tpc the {@link } that returns the {@link } object associated with the target - * ports of the edges - */ - calculateSelfLoops(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node,spc:yfiles.algorithms.IDataProvider,tpc:yfiles.algorithms.IDataProvider):void; - /** - * Returns the minimum length between two edges associated with the given edge. - *

- * The value is fetched from the corresponding {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.hierarchic.SelfLoopCalculator#MINIMUM_EDGE_DISTANCE_DP_KEY}. - *

- * @param graph the input graph - * @param edge the given edge - * @returns the minimum length between two edges - * @protected - */ - getMinimumDistance(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):number; - /** - * Returns the minimum length of the first segment of the given edge. - *

- * The value is fetched from the corresponding {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.hierarchic.SelfLoopCalculator#MINIMUM_FIRST_SEGMENT_LENGTH_DP_KEY}. - *

- * @param graph the input graph - * @param edge the given edge - * @returns the minimum length of the first segment of an edge - * @protected - */ - getMinimumFirstSegmentLength(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):number; - /** - * Returns the minimum length of the last segment of the given edge. - *

- * The value is fetched from the corresponding {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.hierarchic.SelfLoopCalculator#MINIMUM_LAST_SEGMENT_LENGTH_DP_KEY}. - *

- * @param graph the input graph - * @param edge the given edge - * @returns the minimum length of the last segment of the given edge - * @protected - */ - getMinimumLastSegmentLength(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):number; - /** - * Returns the minimum distance between two nodes associated with the given node. - *

- * The value is fetched from the corresponding {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.hierarchic.SelfLoopCalculator#MINIMUM_NODE_DISTANCE_DP_KEY}. - *

- * @param graph the input graph - * @param node the given node - * @returns the minimum distance between two nodes - * @protected - */ - getMinimumNodeDistance(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):number; - /** - * Returns the minimum octilinear segment length of the given edge. - *

- * The value is fetched from the corresponding {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.hierarchic.SelfLoopCalculator#MINIMUM_OCTILINEAR_SEGMENT_LENGTH_DP_KEY}. - *

- * @param graph the input graph - * @param edge the given edge - * @returns the minimum octilinear segment length of the given edge - * @protected - */ - getMinimumOctilinearSegmentLength(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):number; - /** - * Returns whether or not the given edge is octilinear. - *

- * The value is fetched from the corresponding {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.hierarchic.SelfLoopCalculator#OCTILINEAR_EDGES_DP_KEY}. - *

- * @param graph the input graph - * @param edge the given edge - * @returns true if the edge is octilinear, false otherwise - * @protected - */ - isOctilinearEdge(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):boolean; - /** - * Data provider key for defining for each node a minimum distance to the self-loop edges - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static MINIMUM_NODE_DISTANCE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for specifying whether or not an edge is octilinear - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static OCTILINEAR_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for specifying the minimum length of the octilinear segments of an octilinear edge - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static MINIMUM_OCTILINEAR_SEGMENT_LENGTH_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for specifying the minimum length of the first segment of each edge - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static MINIMUM_FIRST_SEGMENT_LENGTH_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for specifying the minimum length of the last segment of each edge - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static MINIMUM_LAST_SEGMENT_LENGTH_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for specifying the minimum distance to the next edge or node side - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static MINIMUM_EDGE_DISTANCE_DP_KEY:yfiles.algorithms.EdgeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.SelfLoopCalculator; - } - /** - * This class is a {@link yfiles.hierarchic.INodePlacer} implementation based on {@link yfiles.algorithms.RankAssignments rank assignment}. - *

- * The drawer works with integer values and rounds double values to integers using sophisticated quantizing. - *

- * @class - * @implements {yfiles.hierarchic.INodePlacer} - */ - export interface SimplexNodePlacer extends yfiles.lang.Object,yfiles.hierarchic.INodePlacer{} - export class SimplexNodePlacer { - constructor(); - /** - * - * @param graph - * @param layoutDataProvider - * @param layers - */ - assignLayerCoordinates(graph:yfiles.layout.LayoutGraph,layoutDataProvider:yfiles.hierarchic.ILayoutDataProvider,layers:yfiles.hierarchic.ILayers):void; - /** - * Assigns the nodes of a given layer to the corresponding upper/lower sublayer if {@link yfiles.hierarchic.SimplexNodePlacer#nodeCompaction node compaction} is enabled. - *

- * Information about sublayers is given by a {@link yfiles.algorithms.INodeMap} whose GetBool method has to return true for each - * node that should be placed in the lower sublayer (values are set by this method). - *

- * @param layerNodes a {@link list} of all @link y.layout.hierarchic.incremental.NodeData#TYPE_NORMAL normal nodes} of a layer - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param graph the given graph - * @param lowerSublayer the {@link } holding sublayer information - * @see yfiles.hierarchic.SimplexNodePlacer#nodeCompaction - * @protected - */ - assignNodesToSublayer(layerNodes:yfiles.algorithms.NodeList,ldp:yfiles.hierarchic.ILayoutDataProvider,graph:yfiles.layout.LayoutGraph,lowerSublayer:yfiles.algorithms.INodeMap):void; - /** - * - * @param graph - * @param layoutDataProvider - * @param layers - * @param drawingDistanceCalculator - */ - assignSequenceCoordinates(graph:yfiles.layout.LayoutGraph,layoutDataProvider:yfiles.hierarchic.ILayoutDataProvider,layers:yfiles.hierarchic.ILayers,drawingDistanceCalculator:yfiles.hierarchic.IDrawingDistanceCalculator):void; - /** - * Returns the alignment of the node with a specified layer. - *

- * This callback method used by {@link yfiles.hierarchic.SimplexNodePlacer#assignLayerCoordinates}. - *

- * @param graph the input graph - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param node the given node - * @param layerIndex the index of the layer - * @param minLayerHeight the minimum height of the layer - * @returns - * @protected - */ - getLayerAlignment(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,node:yfiles.algorithms.Node,layerIndex:number,minLayerHeight:number):number; - /** - * Specifies the minimum allowed distance between two nodes of the same given layer. - *

- * This callback method is used by {@link yfiles.hierarchic.SimplexNodePlacer#assignSequenceCoordinates}. - *

- * @param graph the graph that contains the nodes - * @param layer the layer that contains the nodes - * @param predNode the node to the left of the other one, may be null to indicate a border line - * @param succ the node to the right of the other one, may be null to indicate a border line - * @returns the minimum distance allowed between those two nodes ( >=0 ) - * @see yfiles.hierarchic.IDrawingDistanceCalculator - * @protected - */ - getMinDistance(graph:yfiles.layout.LayoutGraph,layer:yfiles.hierarchic.ILayer,predNode:yfiles.algorithms.Node,succ:yfiles.algorithms.Node):number; - /** - * Returns the minimum height of a given {@link yfiles.hierarchic.ILayer layer}. - *

- * This callback method is used by {@link yfiles.hierarchic.SimplexNodePlacer#assignLayerCoordinates}. - *

- * @param graph the given graph - * @param ldp the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param layer the given {@link } object - * @returns the minimum height - * @protected - */ - getMinimumLayerHeight(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,layer:yfiles.hierarchic.ILayer):number; - /** - * Returns whether or not the given node should be treated as a node with fixed (given) coordinates. - *

- * This callback method is used by both {@link yfiles.hierarchic.SimplexNodePlacer#assignLayerCoordinates} and - * {@link yfiles.hierarchic.SimplexNodePlacer#assignSequenceCoordinates}. - *

- *

- * If inLayer argument is true, this method is called from within the {@link yfiles.hierarchic.SimplexNodePlacer#assignLayerCoordinates} - * method. - *

- * @param graph the given graph - * @param provider the {@link } implementation which provides access to the {@link } and {@link } - * instances - * @param node the given node - * @param inLayer true if the layer coordinate of the node is queried, false if the sequence coordinate is queried - * @returns true if the node should be treated as fixed, false otherwise - * @protected - */ - isFixedNode(graph:yfiles.layout.LayoutGraph,provider:yfiles.hierarchic.ILayoutDataProvider,node:yfiles.algorithms.Node,inLayer:boolean):boolean; - /** - * Gets or sets whether or not nodes should be placed in a more compact style with respect to layout width. - *

- * If enabled, the algorithm may place the nodes of a layer in a stacked style (horizontally interleaving), i.e., it splits - * the layer into an upper and lower sublayer and places adjacent nodes into different sublayers if this reduces the width - * of the layer. - *

- * @see yfiles.hierarchic.SimplexNodePlacer#minimumSublayerDistance - * @see yfiles.hierarchic.SimplexNodePlacer#assignNodesToSublayer - * @type {boolean} - */ - nodeCompaction:boolean; - /** - * Gets or sets the minimum distance between the upper and lower sublayer. - *

- * A too small distance value may prevent adjacent nodes from being placed in a stacked style (horizontally interleaving) - * because the vertical distance between these nodes must be greater than or equal to the value specified by {@link yfiles.hierarchic.NodeLayoutDescriptor#minimumDistance}. - *

- *

- * Values should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if minimum sublayer distance is negative - * @see yfiles.hierarchic.SimplexNodePlacer#nodeCompaction - * @type {number} - */ - minimumSublayerDistance:number; - /** - * Gets or sets whether or not the {@link yfiles.hierarchic.SimplexNodePlacer} places labels in a more compact style. - *

- * If this option is enabled the algorithm tries to place adjacent label elements in a stacked style, i.e., horizontally - * interleaving. - *

- * @type {boolean} - */ - labelCompaction:boolean; - /** - * Gets or sets whether or not an optimization step should be applied that tries to further reduce the number of bends. - * @see yfiles.hierarchic.SimplexNodePlacer#maximumDuration - * @type {boolean} - */ - bendReduction:boolean; - /** - * Gets or sets whether or not the {@link yfiles.hierarchic.SimplexNodePlacer} tries to create a maximally compact horizontal - * layout at the cost of more bends. - *

- * For best results, {@link yfiles.hierarchic.SimplexNodePlacer#breakLongSegments} and {@link yfiles.hierarchic.SimplexNodePlacer#labelCompaction} should also be enabled. - *

- * @see yfiles.hierarchic.SimplexNodePlacer#labelCompaction - * @see yfiles.hierarchic.SimplexNodePlacer#breakLongSegments - * @type {boolean} - */ - horizontalCompaction:boolean; - /** - * Gets or sets whether or not a postprocessing step should be applied to reduce the number of bends. - *

- * Furthermore, enabling this option may violate some minimum distances specified by the user and the edge distribution is - * no longer uniform. - *

- * @type {boolean} - */ - straightenEdges:boolean; - /** - * Gets or sets the strategy used for controlling the horizontal compactness of group nodes. - * @type {yfiles.hierarchic.GroupCompactionPolicy} - */ - groupCompactionStrategy:yfiles.hierarchic.GroupCompactionPolicy; - /** - * Gets or sets whether or not the {@link yfiles.hierarchic.SimplexNodePlacer} enforces the placement of nodes at their exact - * current positions, even if this violates minimum distance constraints. - * @type {boolean} - */ - exactPlacement:boolean; - /** - * Gets or sets whether or not the {@link yfiles.hierarchic.SimplexNodePlacer} should try to use the coordinates given from the - * current sketch for the determination of the layer coordinates. - * @type {boolean} - */ - fromSketchLayerAssignment:boolean; - /** - * Gets or sets the time limit (in milliseconds) set for the layout algorithm. - *

- * Values have to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the maximum duration is negative - * @type {number} - */ - maximumDuration:number; - /** - * Gets or sets the relative weight of edges crossing a swimlane relative to edges that stay in their lane. - *

- * Higher values lead to more compact drawings but may cause additional bends. - *

- *

- * Values should lie within [0,1] interval. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the relative weight does not lie within [0,1] - * @type {number} - */ - swimLaneCrossingWeight:number; - /** - * Gets or sets whether or not a barycenter drawing mode should be used. - *

- * If this mode is enabled the resulting drawing is likely to have more bends, but may be more symmetric. - *

- * @type {boolean} - */ - barycenterMode:boolean; - /** - * Gets or sets whether or not the {@link yfiles.hierarchic.SimplexNodePlacer} should break long edge segments in favor of a - * potentially more compact layout. - *

- * A long edge is an edge that spans multiple layers. For each layer, a dummy node is necessary to model the edge path from - * source to target. - *

- *
    - *
  • - * Not breaking such edges means that there is a constraint that enforces the alignment of all these dummy nodes (same - * x-coordinate). This favors straight edge paths. - *
  • - *
  • - * Breaking an edge means that the dummy nodes are not necessarily aligned, but additional bends can be generated if that - * leads to a horizontally more compact layout result. - *
  • - *
- * @type {boolean} - */ - breakLongSegments:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.SimplexNodePlacer; - } - /** - * This class is used by {@link yfiles.hierarchic.HierarchicLayoutCore} during the various phases and models a swimlane structure. - *

- * For layout orientation - * {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM}, swimlanes partition the drawing area into vertical stripes. Each node is - * placed within a user-specified lane. Swimlanes are, for example, often used in flow diagrams to separate logical units. - *

- *

- * Each node should be associated with a SwimLaneDescriptor instance; nodes in the same lane may share one instance. The - * results of the calculation of the swimlanes' geometry will be stored by the instances after the layout. - *

- *

- * A {@link yfiles.hierarchic.SwimlaneDescriptor} instance can be bound to the layout algorithm using a {@link yfiles.algorithms.IDataProvider} - * registered with the graph using key {@link yfiles.hierarchic.HierarchicLayoutCore#SWIMLANE_DESCRIPTOR_DP_KEY} that returns a {@link yfiles.hierarchic.SwimlaneDescriptor} - * instance for each node of the graph. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#SWIMLANE_DESCRIPTOR_DP_KEY - * @class - * @implements {yfiles.lang.IComparable} - */ - export interface SwimlaneDescriptor extends yfiles.lang.Object,yfiles.lang.IComparable{} - export class SwimlaneDescriptor { - /** - * Creates a new {@link yfiles.hierarchic.SwimlaneDescriptor} instance with a given client {@link any} and a given {@link yfiles.collections.IComparer.}. - *

- * The given client {@link any} should be an instance of {@link yfiles.lang.IComparable} if the given {@link yfiles.collections.IComparer.} is null. - *

- * @param clientObject a client {@link } used for sorting the lanes - * @param comparer a {@link } used for comparing the client objects - * @throws {Stubs.Exceptions.ArgumentError} if the specified client {@link any} is null or the specified {@link yfiles.collections.IComparer.} is null but the specified client {@link any} is not an instance of - * {@link yfiles.lang.IComparable}. - */ - constructor(clientObject:any,comparer:yfiles.collections.IComparer); - /** - * Creates a new {@link yfiles.hierarchic.SwimlaneDescriptor} instance with a given {@link yfiles.lang.IComparable} object. - * @param clientObject a {@link } used for determining the order of the lanes - * @throws {Stubs.Exceptions.ArgumentError} if the specified client object is null. - */ - constructor(clientObject:yfiles.lang.IComparable); - /** - * Implements the {@link yfiles.lang.IComparable} interface using the {@link yfiles.hierarchic.SwimlaneDescriptor#comparer} and {@link yfiles.hierarchic.SwimlaneDescriptor#clientObject} fields. - * @param o - * @returns - */ - compareTo(o:any):number; - /** - * Gets or sets whether or not an index of a swimlane is fixed (based on the result of the comparison with the other - * swimlanes) or whether the index should be chosen automatically in order to minimize edge lengths. - *

- * For all swimlanes where this property is set to - * true, the relative ordering given by the client objects is preserved. The remaining swimlanes may be sorted again so - * that the overall edge lengths are minimized. - *

- * @type {boolean} - */ - indexFixed:boolean; - /** - * Gets or sets the client {@link any object}. - *

- * The given client {@link any} should be an instance of {@link yfiles.lang.IComparable}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if there is currently no {@link yfiles.collections.IComparer. comparator} and the specified object is not a {@link yfiles.lang.IComparable} instance - * @see yfiles.hierarchic.SwimlaneDescriptor#comparer - * @see yfiles.hierarchic.SwimlaneDescriptor#comparer - * @type {any} - */ - clientObject:any; - /** - * Gets or sets the tightness factor of the lane. - *

- * This value should lie within [0,1] interval. - *

- *

- * The greater the value, the more will the lane be forced to obtain its minimum possible width. - *

- *
    - *
  • A value of 0.0d will disable compression of the lane.
  • - *
  • A value of 1.0d will try to force the lane to obtain its {@link yfiles.hierarchic.SwimlaneDescriptor#minimumLaneWidth minimum width}.
  • - *
- * @throws {Stubs.Exceptions.ArgumentError} if the tightness value is outside [0,1] interval - * @type {number} - */ - laneTightness:number; - /** - * Gets or sets the {@link yfiles.collections.IComparer.} instance used for sorting the lanes. - * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.collections.IComparer.} is null. - * @type {yfiles.collections.IComparer.} - */ - comparer:yfiles.collections.IComparer; - /** - * Gets or sets the minimum width of the swimlane. - *

- * The minimum width should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified value negative - * @type {number} - */ - minimumLaneWidth:number; - /** - * Gets or sets the left insets of the swimlane in which no element will lie in the resulting layout. - *

- * The inset should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified value is less than 0. - * @type {number} - */ - leftLaneInset:number; - /** - * Gets or sets the right insets of the swimlane in which no element will lie in the resulting layout. - *

- * The inset should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified value is less than 0. - * @type {number} - */ - rightLaneInset:number; - /** - * Gets the computed position (smaller coordinate) of the swimlane after the layout has been calculated. - * @type {number} - */ - computedLanePosition:number; - /** - * Gets the computed width of the swimlane after the layout has been calculated. - * @type {number} - */ - computedLaneWidth:number; - /** - * Gets the computed zero-based index of the swimlane after the layout has been calculated. - * @type {number} - */ - computedLaneIndex:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.SwimlaneDescriptor; - } - /** - * This {@link yfiles.layout.ILayoutStage layout stage} can be used for automatically assigning {@link yfiles.hierarchic.SwimlaneDescriptor} instances to nodes by - * treating top-level group nodes as swimlanes. - *

- * This stage will modify the hierarchy by temporarily removing the top-level group nodes and assigning corresponding - * descriptors to the remaining nodes. After running the core layout, the top-level group nodes will be arranged to - * function as swimlanes. This class allows using the current coordinates of the group nodes to - * {@link yfiles.hierarchic.TopLevelGroupToSwimlaneStage#orderSwimlanesFromSketch arrange the swimlanes from sketch}. Also, the {@link yfiles.hierarchic.TopLevelGroupToSwimlaneStage#spacing spacing} between swimlanes may be specified. - *

- *

- * This stage can be {@link yfiles.layout.MultiStageLayout#appendStage appended} to the {@link yfiles.hierarchic.HierarchicLayout}. - *

- * @see yfiles.hierarchic.HierarchicLayout - * @see yfiles.hierarchic.SwimlaneDescriptor - * @see yfiles.layout.GroupingKeys - * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface TopLevelGroupToSwimlaneStage extends yfiles.layout.LayoutStageBase{} - export class TopLevelGroupToSwimlaneStage { - /** - * Creates a new instance of {@link yfiles.hierarchic.TopLevelGroupToSwimlaneStage} with the default settings. - */ - constructor(); - /** - * Gets or sets the spacing between the swimlanes. - *

- * The spacing should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the spacing is negative - * @type {number} - */ - spacing:number; - /** - * Gets or sets whether or not the order of the swimlanes should be determined based on the current sketch. - * @type {boolean} - */ - orderSwimlanesFromSketch:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.TopLevelGroupToSwimlaneStage; - } - /** - * This class implements the layering phase of the {@link yfiles.hierarchic.HierarchicLayout} (i.e., assignment of the nodes to - * layers). - *

- * It uses topological sorting to assign layers to the nodes. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[63.79,0,[[73.45,24.35,10.67,18.7,"1"]]],[121,150,[[130.66,174.35,10.67,18.7,"2"]]],[71,150,[[80.66,174.35,10.67,18.7,"3"]]],[162.99,0,[[172.65,24.35,10.67,18.7,"6"]]],[162.99,70,[[172.65,94.35,10.67,18.7,"7"]]],[112.99,70,[[122.65,94.35,10.67,18.7,"8"]]],[30.99,70,[[37.31,94.35,17.35,18.7,"12"]]],[35.5,220,[[45.16,244.35,10.67,18.7,"8"]]],[0,150,[[9.66,174.35,10.67,18.7,"9"]]]],"e":[[5,1,0,15,0,-15,[127.99,120,136,120]],[0,1,10,15,-10,-15,[88.79,50,92.49,50,92.49,130,126,130]],[0,2,0,15,0,-15,[78.79,50,81.49,50,81.49,120,86,120]],[4,1,0,15,10,-15,[177.99,120,146,120]],[3,4,0,15,0,-15],[0,6,-10,15,0,-15,[68.79,50,45.99,50]],[6,7,7.5,15,0,-15,[53.49,120,50.5,120]],[6,8,-7.5,15,0,-15,[38.49,120,15,120]],[8,7,0,15,-10,-15,[15,200,40.5,200]],[2,7,0,15,10,-15,[86,200,60.5,200]]],"vp":[0.0,0.0,193.0,250.0]}} - *

- * @class - * @implements {yfiles.hierarchic.ILayerer} - */ - export interface TopologicalLayerer extends yfiles.lang.Object,yfiles.hierarchic.ILayerer{} - export class TopologicalLayerer { - /** - * Creates a new instance of {@link yfiles.hierarchic.TopologicalLayerer} with default settings. - */ - constructor(); - /** - * Assigns all nodes of the graph to layers and adds them to the {@link yfiles.hierarchic.ILayers} instance. - * @param graph the input graph - * @param layers the {@link } instance that will be filled with the results of the calculation - * @param ldp the {@link } used for querying information about the nodes and edges - */ - assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Gets or sets the (re-)ranking policy used by this {@link yfiles.hierarchic.TopologicalLayerer} instance. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown ranking policy is given - * @type {yfiles.hierarchic.RankingPolicy} - */ - rankingPolicy:yfiles.hierarchic.RankingPolicy; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.TopologicalLayerer; - } - /** - * This class is a {@link yfiles.hierarchic.IDrawingDistanceCalculator} implementation that returns the minimum distances for each - * kind of node pair based on their type as returned by {@link yfiles.hierarchic.INodeData#type}. - * @class - * @implements {yfiles.hierarchic.IDrawingDistanceCalculator} - */ - export interface TypeBasedDrawingDistanceCalculator extends yfiles.lang.Object,yfiles.hierarchic.IDrawingDistanceCalculator{} - export class TypeBasedDrawingDistanceCalculator { - /** - * Creates a new instance of {@link yfiles.hierarchic.TypeBasedDrawingDistanceCalculator} with default settings. - */ - constructor(); - /** - * - * @param graph - * @param layers - * @param ldp - */ - dispose(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * - * @param graph - * @param layer - * @param ldp - * @param left - * @param right - * @returns - */ - getMinDistance(graph:yfiles.layout.LayoutGraph,layer:yfiles.hierarchic.ILayer,ldp:yfiles.hierarchic.ILayoutDataProvider,left:yfiles.algorithms.Node,right:yfiles.algorithms.Node):number; - /** - * - * @param graph - * @param layers - * @param ldp - */ - initialize(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Gets or sets whether or not the compaction option is enabled. - * @see yfiles.hierarchic.SimplexNodePlacer#nodeCompaction - * @see yfiles.hierarchic.SimplexNodePlacer#labelCompaction - * @type {boolean} - */ - compaction:boolean; - /** - * Gets or sets the minimum distance between two {@link yfiles.algorithms.Node}s. - *

- * Minimum distance should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum distance is negative - * @type {number} - */ - nodeToNodeDistance:number; - /** - * Gets or sets the minimum distance between a {@link yfiles.algorithms.Node} and an (non-adjacent) {@link yfiles.algorithms.Edge}. - *

- * Minimum distance should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum distance is negative - * @type {number} - */ - nodeToEdgeDistance:number; - /** - * Gets or sets the minimum distance between two edges. - *

- * Minimum distance should be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum distance is negative - * @type {number} - */ - edgeToEdgeDistance:number; - /** - * Gets or sets the minimum length of the first segment of the edge path (at the source node). - *

- * The minimum length should be greater than 0. - *

- *

- * If the value is 0.0d the first segment does not need to be orthogonal. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum length of the first segment is negative - * @type {number} - */ - minimumFirstSegmentLength:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.TypeBasedDrawingDistanceCalculator; - } - /** - * This class implements the layering phase of the {@link yfiles.hierarchic.HierarchicLayout} (i.e., the assignment of the nodes to - * layers). - *

- * It first makes the directed graph acyclic. Then, it assigns the layers such that edge weights are respected. A weight - * defines a minimum distance between the two end points of an edge. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[100,70,[[109.66,94.35,10.67,18.7,"1"]]],[45.59,140,[[55.25,164.35,10.67,18.7,"2"]]],[95.59,140,[[105.25,164.35,10.67,18.7,"3"]]],[0,0,[[9.66,24.35,10.67,18.7,"6"]]],[0,70,[[9.66,94.35,10.67,18.7,"7"]]],[50,70,[[59.66,94.35,10.67,18.7,"8"]]],[145.59,140,[[151.91,164.35,17.35,18.7,"12"]]],[125.59,280,[[135.25,304.35,10.67,18.7,"8"]]],[125.59,210,[[135.25,234.35,10.67,18.7,"9"]]]],"e":[[5,1,0,15,0,-15,[65,120,60.59,120]],[0,1,-10,15,10,-15,[105,120,70.59,120]],[0,2,0,15,0,-15,[115,120,110.59,120]],[4,1,0,15,-10,-15,[15,120,50.59,120]],[3,4,0,15,0,-15],[0,6,10,15,0,-15,[125,120,160.59,120]],[6,7,7.5,15,10,-15,[168.09,190,176.09,190,176.09,260,150.59,260]],[6,8,-7.5,15,0,-15,[153.09,190,140.59,190]],[8,7,0,15,0,-15],[2,7,0,15,-10,-15,[110.59,190,105.09,190,105.09,260,130.59,260]]],"vp":[0.0,0.0,177.0,310.0]}} - *

- * @class - * @implements {yfiles.hierarchic.ILayerer} - */ - export interface WeightedLayerer extends yfiles.lang.Object,yfiles.hierarchic.ILayerer{} - export class WeightedLayerer { - /** - * Creates an instance of {@link yfiles.hierarchic.WeightedLayerer} with the given key that provides access to the {@link yfiles.algorithms.IDataProvider} - * that holds the edge weights and unlimited maximum duration for the {@link yfiles.hierarchic.WeightedLayerer}. - * @param [key=null] the key to access the {@link } that holds the edge weights - */ - constructor(key?:any); - /** - * Assigns all nodes of the graph to layers and adds them to the {@link yfiles.hierarchic.ILayers} instance. - * @param graph the input graph - * @param layers the {@link } instance that will be filled with the results of the calculation - * @param ldp the {@link } used for querying information about the nodes and edges - */ - assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; - /** - * Assigns all nodes of the graph to layers. - * @param graph the graph for which the layers are determined - * @param layerID the {@link } that will be filled by the layout algorithm and returns a zero-based layer index for each - * node - * @returns the number of layers - */ - assignLayersFast(graph:yfiles.algorithms.Graph,layerID:yfiles.algorithms.INodeMap):number; - /** - * Assigns all nodes of the graph to layers. - * @param graph the graph for which the layers are determined - * @param layerID the {@link } that will be filled by the layout algorithm and returns the zero-based index of the layer - * to which each node belongs - * @returns the number of layers - */ - assignLayersToMap(graph:yfiles.algorithms.Graph,layerID:yfiles.algorithms.INodeMap):number; - /** - * Assigns all nodes of the graph to layers. - * @param graph the graph for which the layers are determined - * @param layerID the {@link } that will be filled by the layout algorithm and returns a zero-based layer index for each - * node - * @param reversedEdges an {@link } containing the edges which had been reversed - * @param weight the {@link } that returns an integer value (weight) for each edge - * @returns the number of layers - */ - assignNodeLayerWithDataProvider(graph:yfiles.layout.LayoutGraph,layerID:yfiles.algorithms.INodeMap,reversedEdges:yfiles.algorithms.EdgeList,weight:yfiles.algorithms.IDataProvider):number; - /** - * Returns the edge weight of the given edge using the weight based cycle removal heuristic. - *

- * By default, all edges are considered to have weight 1.0. - *

- *

- * It may be overridden if non-uniform weights are desired. - *

- * @param edge given edge - * @returns the edge weight of the specified edge - * @see yfiles.hierarchic.WeightedLayerer#weightedCycleRemoval - * @see yfiles.hierarchic.WeightedLayerer#weightedCycleRemoval - * @protected - */ - getWeight(edge:yfiles.algorithms.Edge):number; - /** - * Removes cycles from the graph using a depth first search. - * @param graph the graph - * @param reversedEdges an {@link } containing the edges which will be reversed - */ - makeDFSAcyclic(graph:yfiles.algorithms.Graph,reversedEdges:yfiles.algorithms.EdgeList):void; - /** - * This is a {@link yfiles.algorithms.IDataProvider} that holds for each {@link yfiles.algorithms.Edge} an integer value representing its - * weight. - * @protected - * @type {yfiles.algorithms.IDataProvider} - */ - weight:yfiles.algorithms.IDataProvider; - /** - * The key to access the {@link yfiles.algorithms.IDataProvider} that holds the edge weights. - *

- * More precisely, the corresponding {@link yfiles.algorithms.IDataProvider} maps each edge of the input graph to an integer value - * representing the edge's weight. - *

- * @protected - * @type {any} - */ - key:any; - /** - * Gets or sets whether or not the edges that need to be reversed are determined using an edge weight based heuristic or - * using a depth first search based approach. - *

- * The weight based approach may result in fewer reversed edges (especially for cases with many multi-edges) whereas the - * DFS based approach is likely to be faster. - *

- * @type {boolean} - */ - weightedCycleRemoval:boolean; - /** - * Gets or sets the time limit in milliseconds set for the layout algorithm. - *

- * Values have to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the maximum duration is negative - * @type {number} - */ - maximumDuration:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.WeightedLayerer; - } - /** - * Specifies custom data for the {@link yfiles.hierarchic.HierarchicLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface HierarchicLayoutData extends yfiles.layout.LayoutData{} - export class HierarchicLayoutData { - constructor(); - /** - * Gets or sets a mapping from edges to alternative paths for edges connecting to groups, group content or folder nodes. - * @see yfiles.hierarchic.HierarchicLayout#ALTERNATIVE_EDGE_PATH_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - alternativeEdgePath:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from group/folder nodes to alternative bounds for these nodes. - * @see yfiles.hierarchic.HierarchicLayout#ALTERNATIVE_GROUP_BOUNDS_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - alternativeGroupBounds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their priority to be a 'critical' edge. - *

- * The layout tries to vertically align each node pair that is connected by a critical edge (integer value > 0). - *

- * @see yfiles.hierarchic.HierarchicLayout#CRITICAL_EDGE_PRIORITY_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - criticalEdgePriorities:yfiles.layout.ItemMapping; - /** - * Gets or sets the collection of folder nodes used for recursive edge styles in incremental mode. - * @see yfiles.hierarchic.HierarchicLayout#FOLDER_NODES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - folderNodes:yfiles.layout.ItemCollection; - /** - * Gets or sets the mapping of edges to their {@link yfiles.hierarchic.EdgeLayoutDescriptor}. - *

- * If an edge is mapped to null, the {@link yfiles.hierarchic.HierarchicLayout#edgeLayoutDescriptor default descriptor} is used. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLayoutDescriptors:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping of nodes to their {@link yfiles.hierarchic.NodeLayoutDescriptor} - *

- * If a node is mapped to null, the {@link yfiles.hierarchic.HierarchicLayout#nodeLayoutDescriptor default descriptor} is used. - *

- * @see yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeLayoutDescriptors:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to a collection of their source port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - sourcePortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from edges to a collection of their target port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - targetPortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from nodes to their {@link yfiles.layout.PortCandidateSet}. - * @see yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodePortCandidateSets:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their source edge group. - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourceGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their source port group. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their target edge group. - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their target port group. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the factory to specify layer constraints. - * @see yfiles.hierarchic.HierarchicLayout#createLayerConstraintFactory - * @see yfiles.hierarchic.ILayerConstraintFactory - * @type {yfiles.hierarchic.ILayerConstraintFactory} - */ - layerConstraintFactory:yfiles.hierarchic.ILayerConstraintFactory; - /** - * Gets or sets the factory to specify sequence constraints. - * @see yfiles.hierarchic.HierarchicLayout#createSequenceConstraintFactory - * @see yfiles.hierarchic.ISequenceConstraintFactory - * @type {yfiles.hierarchic.ISequenceConstraintFactory} - */ - sequenceConstraintFactory:yfiles.hierarchic.ISequenceConstraintFactory; - /** - * Gets or sets a mapping from nodes and edges to their incrementally hints. - * @see yfiles.hierarchic.HierarchicLayout#INCREMENTAL_HINTS_DP_KEY - * @type {yfiles.hierarchic.IncrementalHintItemMapping} - */ - incrementalHints:yfiles.hierarchic.IncrementalHintItemMapping; - /** - * Gets or sets a mapper from nodes to the index of their layer. - *

- * If this property is set, the mapper is filled by the layout with the layer information. - *

- * @see yfiles.hierarchic.HierarchicLayout#LAYER_INDEX_DP_KEY - * @type {yfiles.collections.IMapper.} - */ - layerIndices:yfiles.collections.IMapper; - /** - * Gets or sets a mapper from nodes to the sequence index in their layer. - *

- * If this property is set, the mapper is filled by the layout with the sequence information. - *

- * @see yfiles.hierarchic.HierarchicLayout#SEQUENCE_INDEX_DP_KEY - * @type {yfiles.collections.IMapper.} - */ - sequenceIndices:yfiles.collections.IMapper; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the partition grid layout data. - * @type {yfiles.layout.PartitionGridData} - */ - partitionGridData:yfiles.layout.PartitionGridData; - /** - * Gets or sets the layout data for the {@link yfiles.hierarchic.SelfLoopCalculator}. - * @type {yfiles.hierarchic.SelfLoopCalculatorData} - */ - selfLoopCalculatorData:yfiles.hierarchic.SelfLoopCalculatorData; - /** - * Gets or sets the mapping from edges to an additional weight used by the {@link yfiles.hierarchic.ConstraintIncrementalLayerer}. - *

- * The Layerer tries to keep edges with higher weights short. - *

- * @see yfiles.hierarchic.ConstraintIncrementalLayerer#ADDITIONAL_EDGE_WEIGHT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - constraintIncrementalLayererAdditionalEdgeWeights:yfiles.layout.ItemMapping; - /** - * Gets or sets the collection of core nodes used by the {@link yfiles.hierarchic.BFSLayerer}. - *

- * The {@link yfiles.hierarchic.BFSLayerer} is used when {@link yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy} is set to {@link yfiles.hierarchic.LayeringStrategy#BFS}. - *

- * @see yfiles.hierarchic.BFSLayerer#CORE_NODES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - bfsLayererCoreNodes:yfiles.layout.ItemCollection; - /** - * Gets or set the mapping from nodes to their layer index when using the {@link yfiles.hierarchic.GivenLayersLayerer}. - *

- * The {@link yfiles.hierarchic.GivenLayersLayerer} is used when {@link yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy} is set to {@link yfiles.hierarchic.LayeringStrategy#USER_DEFINED}. - *

- * @see yfiles.hierarchic.GivenLayersLayerer#LAYER_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - givenLayersLayererIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from edges to their directedness. - *

- * Generally, the hierarchic layout algorithm assigns nodes to layers such that most of the edges point in the - * {@link yfiles.layout.MultiStageLayout#layoutOrientation main layout direction}. The directedness of an edge specifies whether it should comply with this strategy. More - * precisely, a value of 1 means that the edge should fully comply, a value of -1 that it should comply inversely (the edge - * should point against the main layout direction), and a value of 0 means that the direction doesn't matter at all and the - * endpoints of the edges may be placed at the same layer. If there are conflicting preferences, edges with higher absolute - * values are more likely to point in the desired direction. - *

- * @see yfiles.hierarchic.HierarchicLayout#EDGE_DIRECTEDNESS_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeDirectedness:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from edges to their thickness. - *

- * The specified non-negative thickness is considered when calculating minimum distances so that there are no overlaps - * between edges and other graph elements. By default, each edge has thickness 0. - *

- * @see yfiles.hierarchic.HierarchicLayout#EDGE_THICKNESS_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeThickness:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping that provides a {@link yfiles.layout.PreferredPlacementDescriptor} instance for edge - * {@link yfiles.graph.ILabel}s. - * @see yfiles.layout.PreferredPlacementDescriptor - * @see yfiles.layout.LayoutGraphAdapter#EDGE_LABEL_LAYOUT_PREFERRED_PLACEMENT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLabelPreferredPlacement:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.HierarchicLayoutData; - } - /** - * Provides different ways to define a mapping from model items to incremental hints for use with - * {@link yfiles.hierarchic.HierarchicLayoutData}. - *

- * Only one of the provided ways to define a mapping can be used at the same time, therefore only one of the properties of - * this class should be set on an instance. - *

- * @class - * @extends {yfiles.layout.ContextItemMapping.} - * @final - */ - export interface IncrementalHintItemMapping extends yfiles.layout.ContextItemMapping{} - export class IncrementalHintItemMapping { - constructor(); - /** - * Gets or sets an item collection of nodes that are mapped to {@link yfiles.hierarchic.IIncrementalHintsFactory#createLayerIncrementallyHint incremental layering hints}. - * @type {yfiles.layout.ItemCollection.} - */ - incrementalLayeringNodes:yfiles.layout.ItemCollection; - /** - * Gets or sets an item collection of nodes that are mapped to {@link yfiles.hierarchic.IIncrementalHintsFactory#createSequenceIncrementallyHint incremental sequencing hints}. - * @type {yfiles.layout.ItemCollection.} - */ - incrementalSequencingItems:yfiles.layout.ItemCollection; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.IncrementalHintItemMapping; - } - /** - * Specifies custom data for the {@link yfiles.hierarchic.SelfLoopCalculator}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface SelfLoopCalculatorData extends yfiles.layout.LayoutData{} - export class SelfLoopCalculatorData { - constructor(); - /** - * Gets or sets the collection of edges that are octilinear. - * @see yfiles.hierarchic.SelfLoopCalculator#OCTILINEAR_EDGES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - octilinearEdges:yfiles.layout.ItemCollection; - /** - * Gets or sets the mapping from nodes to their minimum distance to selfloop edges. - * @see yfiles.hierarchic.SelfLoopCalculator#MINIMUM_NODE_DISTANCE_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - minimumNodeDistances:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from edges to their minimum distance to the next edge and to node sides. - * @see yfiles.hierarchic.SelfLoopCalculator#MINIMUM_EDGE_DISTANCE_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - minimumEdgeDistances:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from edges to the minimum length of their first segment. - * @see yfiles.hierarchic.SelfLoopCalculator#MINIMUM_FIRST_SEGMENT_LENGTH_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - minimumFirstSegmentLengths:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from edges to the minimum length of their last segment. - * @see yfiles.hierarchic.SelfLoopCalculator#MINIMUM_LAST_SEGMENT_LENGTH_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - minimumLastSegmentLengths:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from edges to the minimum length of their octilinear segments. - * @see yfiles.hierarchic.SelfLoopCalculator#MINIMUM_OCTILINEAR_SEGMENT_LENGTH_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - minimumOctilinearSegmentLengths:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.hierarchic.SelfLoopCalculatorData; - } - }export namespace labeling{ - export enum OptimizationStrategy{ - /** - * An optimization strategy aiming at a good balance between the available optimization options. - * @see yfiles.labeling.MISLabelingBase#optimizationStrategy - */ - BALANCED, - /** - * An optimization strategy that especially reduces overlaps between labels and nodes as well as labels and node halos. - * @see yfiles.labeling.MISLabelingBase#optimizationStrategy - */ - NODE_OVERLAP, - /** - * An optimization strategy that especially reduces overlaps between labels. - * @see yfiles.labeling.MISLabelingBase#optimizationStrategy - */ - LABEL_OVERLAP, - /** - * An optimization strategy that especially reduces overlaps between labels and edges. - * @see yfiles.labeling.MISLabelingBase#optimizationStrategy - */ - EDGE_OVERLAP, - /** - * An optimization strategy that mainly tries to satisfy the preferences described by a {@link yfiles.layout.PreferredPlacementDescriptor} - * associated with edge labels. - * @see yfiles.labeling.MISLabelingBase#optimizationStrategy - */ - PREFERRED_PLACEMENT, - /** - * Use no optimization strategy. - */ - NONE - } - /** - * A generic labeling algorithm for placing the labels of a graph. - *

- * {@graph {"ann":{"s":[30,30],"d":1,"c":1,"lblFlip":1,"lblB":1},"n":[[249.44,602.63,[[212.75,626.98,32.69,18.7,"Node"]]],[306.92,686.94,[[270.24,711.29,32.69,18.7,"Node"]]],[481.7,787.85,[[515.7,812.2,32.69,18.7,"Node"]]],[219.36,505.12,[[182.67,529.47,32.69,18.7,"Node"]]],[386.71,750.57,[[350.02,774.92,32.69,18.7,"Node"]]],[885,353.19,[[883.66,405.89,32.69,18.7,"Node"]]],[840.72,261.25,[[839.38,257.25,32.69,18.7,"Node"]]],[583.46,112.72,[[582.11,108.72,32.69,18.7,"Node"]]],[249.44,305.56,[[212.75,329.91,32.69,18.7,"Node"]]],[682.94,135.42,[[681.6,131.42,32.69,18.7,"Node"]]],[481.7,120.34,[[480.35,116.34,32.69,18.7,"Node"]]],[771.32,186.45,[[769.97,182.45,32.69,18.7,"Node"]]],[219.36,403.07,[[182.67,427.42,32.69,18.7,"Node"]]],[306.92,221.25,[[270.24,245.6,32.69,18.7,"Node"]]],[386.71,157.62,[[385.36,153.62,32.69,18.7,"Node"]]]],"e":[[0,1,[],[[259.45,643.51,32.03,18.7,0.826238774315996,-0.5633200580636204,"Edge"]]],[3,0,[],[[221.61,542.21,32.03,18.7,0.9555728057861415,-0.294755174410902,"Edge"]]],[1,4,[],[[349.3,723.77,32.03,18.7,0.6234898018587343,-0.7818314824680294,"Edge"]]],[4,2,[],[[418.05,771.98,32.03,18.7,0.36534102436639637,-0.9308737486442037,"Edge"]]],[3,5,[],[[262.64,513.66,32.03,18.7,-0.2225209339563144,-0.9749279121818236,"Edge"]]],[2,5,[],[[534.29,789.82,32.03,18.7,-0.7330518718298267,-0.680172737770919,"Edge"]]],[4,5,[],[[427.6,744.91,32.03,18.7,-0.6234898018587336,-0.7818314824680299,"Edge"]]],[1,5,[],[[350.46,685.47,32.03,18.7,-0.5000000000000003,-0.8660254037844386,"Edge"]]],[0,5,[],[[298.89,624.2,32.03,18.7,-0.3653410243663947,-0.9308737486442044,"Edge"]]],[5,6,[],[[878.37,323.28,32.03,18.7,0.9009688679024184,-0.4338837391175598,"Edge"]]],[7,5,[],[[611.91,162.36,32.03,18.7,0.6234898018587336,-0.7818314824680299,"Edge"]]],[8,5,[],[[292.35,341.41,32.03,18.7,0.07473009358642455,-0.9972037971811801,"Edge"]]],[9,7,[],[[645.8,157.7,32.03,18.7,0.2225209339563144,-0.9749279121818236,"Edge"]]],[7,10,[],[[549.55,131.38,32.03,18.7,-0.07473009358642278,-0.9972037971811804,"Edge"]]],[10,5,[],[[515.14,167.59,32.03,18.7,0.5000000000000003,-0.8660254037844386,"Edge"]]],[6,11,[],[[796.42,239.83,32.03,18.7,0.7330518718298267,-0.680172737770919,"Edge"]]],[11,9,[],[[733.51,192.55,32.03,18.7,0.4999999999999995,-0.866025403784439,"Edge"]]],[8,12,[],[[267.76,373.25,32.03,18.7,-0.9555728057861401,-0.29475517441090626,"Edge"]]],[12,3,[],[[253.06,467.1,32.03,18.7,-1.0,-2.7257675990577433E-15,"Edge"]]],[12,5,[],[[265.18,415.76,32.03,18.7,-0.07473009358642366,-0.9972037971811802,"Edge"]]],[13,5,[],[[347.6,261.29,32.03,18.7,0.22252093395631525,-0.9749279121818234,"Edge"]]],[13,8,[],[[284.16,291.63,32.03,18.7,-0.826238774315993,-0.5633200580636247,"Edge"]]],[10,14,[],[[450.54,153.46,32.03,18.7,-0.3653410243663931,-0.930873748644205,"Edge"]]],[14,13,[],[[349.3,214.42,32.03,18.7,-0.6234898018587314,-0.7818314824680315,"Edge"]]],[14,5,[],[[424.24,201.56,32.03,18.7,0.36534102436639554,-0.930873748644204,"Edge"]]]],"vp":[182.0,90.0,735.0,728.0]}} Node labels and edge labels placed by the labeling algorithm - *

- *

- * This algorithm can switch between two internal implementations. By default, it generates high quality label placements - * even for difficult instances. This especially holds if the label models allow a large number of different - * {@link yfiles.layout.LabelCandidate}s, i.e., there is a high potential for optimizations. - *

- *

- * If the duration of the calculation is of utmost importance, the internal algorithm can be changed to a simpler - * implementation by setting {@link yfiles.labeling.GenericLabeling#maximumDuration} to 0. On the downside, the results will not be as good as the ones of the default mode. - *

- *

- * In default mode, this algorithm reduces the labeling problem to the maximum independent set (MIS) problem and solves the - * problem using simulated annealing. It is inspired by the article from Christensen, Marks and Shieber: A General - * Cartographic Labelling Algorithm. - *

- *

- * It is recommended to use {@link yfiles.layout.IEdgeLabelLayoutModel}s and - * {@link yfiles.layout.INodeLabelLayoutModel}s which allow free positioning of labels to achieve best results with this generic - * labeling algorithm. - *

- *

- * This algorithm works according to the general labeling concept defined by {@link yfiles.labeling.LabelingBase}. - *

- * @see yfiles.labeling.LabelingBase - * @class - * @extends {yfiles.labeling.MISLabelingBase} - */ - export interface GenericLabeling extends yfiles.labeling.MISLabelingBase{} - export class GenericLabeling { - /** - * Creates a new instance of {@link yfiles.labeling.GenericLabeling} with default settings. - */ - constructor(); - /** - * Gets or sets whether or not this algorithm behaves deterministically. - *

- * If enabled, it produces the same results given the same input graph and settings. - *

- * @type {boolean} - */ - deterministic:boolean; - /** - * Gets or sets the time limit for this algorithm in milliseconds. - *

- * 0x7FFFFFFF denotes that there is no time limit. Values have to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given maximum duration is negative - * @type {number} - */ - maximumDuration:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.labeling.GenericLabeling; - } - /** - * An abstract base class for generic labeling algorithms which place labels of graphs. - *

- * Labeling algorithms compute positions for labels in a given graph. The main goal is to place labels such that they do - * not overlap with other graph elements. Labeling algorithms do not modify positions of nodes and edges. - *

- *

- * Concept - *

- *

- * Generic labeling algorithms use the model associated with a label (i.e. {@link yfiles.layout.INodeLabelLayout#labelModel node label model} for nodes and {@link yfiles.layout.IEdgeLabelLayout#labelModel edge label model} - * for edges). The models are necessary to compute a set of {@link yfiles.layout.LabelCandidate}s, i.e., candidate positions for a - * label. Then, one best matching candidate from the set will be selected. This selection depends on several preferences, e.g., if {@link yfiles.labeling.LabelingBase#removeNodeOverlaps overlaps with nodes} - * are not allowed, candidates encoding overlapping positions will be ignored. - *

- *

- * After one {@link yfiles.layout.LabelCandidate} has been chosen, the label model's parameter is used for encoding the label - * position. Therefore, the result of a generic labeling algorithm is one model parameter per label. The parameter is {@link yfiles.layout.ILabelLayout#modelParameter stored with the label} - * and expresses the label position with respect to the underlying label model. - *

- *

- * Features - *

- *

- * This class provides a general frame, offering functionality which can be shared by other generic labeling algorithms. - *

- *

- * To only place labels or a subset of labels, the main labeling methods {@link yfiles.labeling.LabelingBase#label}, {@link yfiles.labeling.LabelingBase#label} - * and {@link yfiles.labeling.LabelingBase#label} are offered. - *

- *

- * As this class represents an {@link yfiles.layout.LayoutStageBase}, it allows usage as a generic labeling stage. By combining it - * with a - * {@link yfiles.layout.LayoutStageBase#coreLayout core layouter}, the labeling will take place after the core layouter was executed - * ({@link yfiles.labeling.LabelingBase#applyLayout}). This is especially useful if the core layouter does not support label - * handling. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface LabelingBase extends yfiles.layout.LayoutStageBase{} - export class LabelingBase { - /** - * Creates a new {@link yfiles.labeling.LabelingBase} instance with default settings. - */ - constructor(); - /** - * Returns the profit for placing a {@link yfiles.layout.LabelCandidate} with respect to the current {@link yfiles.labeling.LabelingBase#profitModel profit model}. - *

- * Method {@link yfiles.layout.IProfitModel#getProfit} on the current profit model will be invoked to compute the actual profit - * value. - *

- *

- * The higher the profit (rank) of a candidate is, the more likely it will be chosen as actual position by the algorithm. - *

- * @param candidate a label candidate - * @returns the profit value between 0 and 1 - */ - getProfit(candidate:yfiles.layout.LabelCandidate):number; - /** - * Places the labels of the input graph restricting the placement to labels contained in the given lists. - *

- * The {@link yfiles.labeling.LabelingBase#affectedLabelsDpKey selection} will not be considered; the given lists will define the selection of labels that are to be placed. - *

- * @param graph the input graph - * @param nodeLabels a list of {@link }s defining the set of node labels that will be placed - * @param edgeLabels a list of {@link }s defining the set of edge labels that will be placed - */ - label(graph:yfiles.layout.LayoutGraph,nodeLabels:yfiles.algorithms.YList,edgeLabels:yfiles.algorithms.YList):void; - /** - * Places the labels of the input graph using a {@link yfiles.algorithms.IDataProvider} registered to the input graph with the - * given key for determining which labels to place. - *

- * Instead of considering the current {@link yfiles.labeling.LabelingBase#affectedLabelsDpKey selection key}, the {@link yfiles.algorithms.IDataProvider} registered with the given key will - * be used for selecting labels. Invoking this method has the same effect as first {@link yfiles.labeling.LabelingBase#affectedLabelsDpKey specifying the key} as selection key and - * then invoking {@link yfiles.labeling.LabelingBase#label}. - *

- * @param graph the input graph - * @param [key=null] the {@link } key for label selection - */ - label(graph:yfiles.layout.LayoutGraph,key?:any):void; - /** - * Data provider key for mapping models to edge/node labels - *

- * The {@link yfiles.layout.INodeLabelLayoutModel}s and {@link yfiles.layout.IEdgeLabelLayoutModel}s linked to - * {@link yfiles.layout.INodeLabelLayout}s and {@link yfiles.layout.IEdgeLabelLayout}s by this {@link yfiles.algorithms.IDataProvider} are taken as - * replacement models. This means that the original model is internally replaced by another model when computing valid - * positions for the label. A model parameter that fits the calculated position of the replacement model best is set for - * the original label model. - *

- * @const - * @static - * @type {yfiles.algorithms.ILabelLayoutDpKey.} - */ - static LABEL_MODEL_DP_KEY:yfiles.algorithms.ILabelLayoutDpKey; - /** - * Gets or sets the {@link yfiles.layout.IProfitModel} for ranking the {@link yfiles.layout.LabelCandidate}s for labels. - *

- * The profit model is used when {@link yfiles.labeling.LabelingBase#getProfit calculating the profit} of a candidate. - *

- *

- * The higher the profit (rank) of a candidate is, the more likely it will be chosen as actual position by the algorithm. - *

- * @see yfiles.layout.IProfitModel - * @see yfiles.layout.SimpleProfitModel - * @see yfiles.labeling.LabelingBase#getProfit - * @type {yfiles.layout.IProfitModel} - */ - profitModel:yfiles.layout.IProfitModel; - /** - * Gets or sets whether or not internal node labels are allowed to move. - *

- * A node label is internal if the label's boundaries are completely within the node's boundaries. - *

- * @type {boolean} - */ - moveInternalNodeLabels:boolean; - /** - * Gets or sets whether or not a post-processing step to reduce the number of label overlaps is applied. - * @type {boolean} - */ - reduceLabelOverlaps:boolean; - /** - * Gets or sets whether or not {@link yfiles.layout.LabelCandidate label candidates} that overlap with nodes are removed. - *

- * If overlapping candidates are not removed, they will be considered but get a penalty. Therefore, it is still less likely - * that an overlapping candidate is finally chosen. - *

- *

- * The detection and removal of labels that overlap with nodes may increase the runtime of this algorithm. - *

- * @type {boolean} - */ - removeNodeOverlaps:boolean; - /** - * Gets or sets whether or not {@link yfiles.layout.LabelCandidate label candidates} that overlap with edges are removed. - *

- * If overlapping candidates are not removed, they will be considered but get a penalty. Therefore, it is still less likely - * that an overlapping candidate is finally chosen. - *

- *

- * The detection and removal of labels that overlap with edges may increase the runtime of this algorithm. - *

- * @type {boolean} - */ - removeEdgeOverlaps:boolean; - /** - * Gets or sets whether or not labels assigned to nodes are placed. - * @see yfiles.labeling.LabelingBase#affectedLabelsDpKey - * @type {boolean} - */ - placeNodeLabels:boolean; - /** - * Gets or sets whether or not labels assigned to edges are placed. - * @see yfiles.labeling.LabelingBase#affectedLabelsDpKey - * @type {boolean} - */ - placeEdgeLabels:boolean; - /** - * Gets or sets the {@link yfiles.algorithms.IDataProvider} key to mark labels as selected for placement. - *

- * If a {@link yfiles.algorithms.IDataProvider} is registered with this key, only the selected labels will be placed, while all - * other labels are considered fixed. - *

- *

- * The registered {@link yfiles.algorithms.IDataProvider} needs to map from {@link yfiles.layout.ILabelLayout} to {@link boolean} where true indicates - * that a label should be placed and false indicates that a label should be ignored. - *

- * @type {any} - */ - affectedLabelsDpKey:any; - /** - * Gets or sets whether or not edge labels are automatically flipped if otherwise they would be upside-down. - * @type {boolean} - */ - autoFlipping:boolean; - /** - * Gets or sets whether or not edge labels may overlap with edges belonging to the same edge group as the label's edge. - *

- * An edge group is a set of edges which share a common bus near the target or source node. They are defined using - * {@link yfiles.algorithms.IDataProvider}s registered with {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} and - * {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY}. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @type {boolean} - */ - edgeGroupOverlapAllowed:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.labeling.LabelingBase; - } - /** - * A base class for generic labeling algorithms which solve the labeling problem by reducing it to the maximum independent - * set (MIS) problem. - *

- * Different optimization strategies are available; an optimization strategy defines which criteria the algorithm should - * try to optimize. For example, reducing the number of overlaps between labels and nodes may be considered more important - * than reducing the number of overlaps between labels and edges. - *

- * @see yfiles.labeling.GenericLabeling - * @class - * @extends {yfiles.labeling.LabelingBase} - */ - export interface MISLabelingBase extends yfiles.labeling.LabelingBase{} - export class MISLabelingBase { - /** - * Creates a new {@link yfiles.labeling.MISLabelingBase} instance with default settings. - */ - constructor(); - /** - * Returns a {@link yfiles.algorithms.INodeMap} which assigns a profit value to each node in the {@link yfiles.labeling.MISLabelingBase#conflictGraph conflict graph}. - *

- * As the conflict graph's nodes represent {@link yfiles.layout.LabelCandidate}s, this mapping gives the profit value of label - * candidates. The assigned value is defined as the difference between the {@link yfiles.labeling.LabelingBase#getProfit profit induced by the profit model} and the - * candidate's {@link yfiles.layout.LabelCandidate#overlapPenalty overlap penalty}. - *

- *

- * The returned map is a mapping from each {@link yfiles.algorithms.Node} (representing a label candidate) in the {@link yfiles.labeling.MISLabelingBase#conflictGraph} - * to a {@link number} representing the profit value of the candidate. - *

- * @returns a mapping from nodes (i.e. label candidates) to their profit value - */ - assignProfit():yfiles.algorithms.INodeMap; - /** - * Creates the edges in the conflict graph, i.e., one edge between two nodes if the corresponding - * {@link yfiles.layout.LabelCandidate}s intersect. - *

- * The nodes of the {@link yfiles.labeling.MISLabelingBase#conflictGraph conflict graph} represent - * {@link yfiles.layout.LabelCandidate}s. An edge between candidates signals that they overlap. A maximum independent set will be - * computed on the conflict graph to choose candidates such that no two candidates overlap. - *

- *

- * This method may be overridden to change the structure of the {@link yfiles.labeling.MISLabelingBase#conflictGraph conflict graph}. Edges between two - * {@link yfiles.layout.LabelCandidate}s in the conflict graph signal that the two candidates should not be selected together. By - * overriding this method, arbitrary reasons for indicating that two label candidates should not be chosen at the same time - * can be modeled. - *

- * @see yfiles.labeling.MISLabelingBase#conflictGraph - * @see yfiles.labeling.MISLabelingBase#nodesToBoxes - * @see yfiles.labeling.MISLabelingBase#boxesToNodes - * @see yfiles.labeling.MISLabelingBase#nodesToID - * @protected - */ - createEdges():void; - /** - * Indicates that an overlap between a {@link yfiles.layout.LabelCandidate} and an {@link yfiles.algorithms.Edge} of the input graph has - * been found. - *

- * This method is called when finding overlaps while {@link yfiles.labeling.MISLabelingBase#createEdges creating edges} of the {@link yfiles.labeling.MISLabelingBase#conflictGraph conflict graph}. It will store a factor - * indicating how much the two elements overlap. The factor influences the {@link yfiles.labeling.LabelingBase#getProfit profit} assigned to the given label candidate. - *

- *

- * This method may be overridden to realize a custom strategy for reacting to overlaps between label candidates and edges. - *

- * @param labelCandidate the {@link } overlapping with the given {@link } - * @param edge the {@link } overlapping with the given {@link } - * @param eSegment the {@link } of the given edge overlapping with the given candidate - * @see yfiles.labeling.MISLabelingBase#conflictGraph - * @see yfiles.labeling.MISLabelingBase#createEdges - */ - foundEdgeOverlap(labelCandidate:yfiles.layout.LabelCandidate,edge:yfiles.algorithms.Edge,eSegment:yfiles.algorithms.LineSegment):void; - /** - * Indicates that an overlap between a {@link yfiles.layout.LabelCandidate} and a {@link yfiles.layout.NodeHalo} of the input graph has - * been found. - *

- * This method is called when finding overlaps while {@link yfiles.labeling.MISLabelingBase#createEdges creating edges} of the {@link yfiles.labeling.MISLabelingBase#conflictGraph conflict graph}. It will store a factor - * indicating how much the two elements overlap. The factor influences the {@link yfiles.labeling.LabelingBase#getProfit profit} assigned to the given label candidate. - *

- *

- * This method may be overridden to realize a custom strategy for reacting to overlaps between label candidates and node - * halos. - *

- * @param labelCandidate the {@link } overlapping with a node halo - * @param node the {@link } whose {@link } is overlapping with the given label candidate - * @param haloRect the bounding box of the {@link } overlapping with the given label candidate - * @see yfiles.labeling.MISLabelingBase#conflictGraph - * @see yfiles.labeling.MISLabelingBase#createEdges - */ - foundHaloOverlap(labelCandidate:yfiles.layout.LabelCandidate,node:yfiles.algorithms.Node,haloRect:yfiles.algorithms.YRectangle):void; - /** - * Indicates that an overlap between two {@link yfiles.layout.LabelCandidate}s has been found. - *

- * This method is called when finding overlaps while {@link yfiles.labeling.MISLabelingBase#createEdges creating edges} of the - * {@link yfiles.labeling.MISLabelingBase#conflictGraph conflict graph}. It will store a factor indicating how much the two candidates overlap. The factor influences the penalty - * assigned when both candidates are chosen, i.e., the penalty for the corresponding overlap. - *

- *

- * This method may be overridden to realize a custom strategy for reacting to overlaps among - * {@link yfiles.layout.LabelCandidate}s. - *

- * @param candidate1 the first overlapping {@link } - * @param candidate2 the second overlapping {@link } - * @param edge the {@link } in {@link #conflictGraph} representing the found overlap - * @see yfiles.labeling.MISLabelingBase#conflictGraph - * @see yfiles.labeling.MISLabelingBase#createEdges - */ - foundLabelOverlap(candidate1:yfiles.layout.LabelCandidate,candidate2:yfiles.layout.LabelCandidate,edge:yfiles.algorithms.Edge):void; - /** - * Indicates that an overlap between a {@link yfiles.layout.LabelCandidate} and a {@link yfiles.algorithms.Node} of the input graph has - * been found. - *

- * This method is called when finding overlaps while {@link yfiles.labeling.MISLabelingBase#createEdges creating edges} of the {@link yfiles.labeling.MISLabelingBase#conflictGraph conflict graph}. It will store a factor - * indicating how much the two elements overlap. The factor influences the {@link yfiles.labeling.LabelingBase#getProfit profit} assigned to the given label candidate. - *

- *

- * This method may be overridden to realize a custom strategy for reacting to overlaps between label candidates and nodes. - *

- * @param labelCandidate the {@link } overlapping with the given node - * @param node the {@link } overlapping with the given label candidate - * @param nodeBox the bounding box of the given node - * @see yfiles.labeling.MISLabelingBase#conflictGraph - * @see yfiles.labeling.MISLabelingBase#createEdges - */ - foundNodeOverlap(labelCandidate:yfiles.layout.LabelCandidate,node:yfiles.algorithms.Node,nodeBox:yfiles.algorithms.YRectangle):void; - /** - * The input graph that will be labeled. - * @type {yfiles.layout.LayoutGraph} - */ - graph:yfiles.layout.LayoutGraph; - /** - * The conflict graph modeling - * {@link yfiles.layout.LabelCandidate}s as nodes and edges between them as conflicts, i.e., overlaps among candidates. - * @see yfiles.labeling.MISLabelingBase#createEdges - * @type {yfiles.algorithms.Graph} - */ - conflictGraph:yfiles.algorithms.Graph; - /** - * The mapping from each node in the {@link yfiles.labeling.MISLabelingBase#conflictGraph} to the corresponding {@link yfiles.layout.LabelCandidate} - * instance. - * @see yfiles.labeling.MISLabelingBase#conflictGraph - * @type {yfiles.algorithms.INodeMap} - */ - nodesToBoxes:yfiles.algorithms.INodeMap; - /** - * The mapping from the {@link yfiles.layout.LabelCandidate}s to the corresponding nodes in the - * {@link yfiles.labeling.MISLabelingBase#conflictGraph}. - * @see yfiles.labeling.MISLabelingBase#conflictGraph - * @type {yfiles.collections.IMap.} - */ - boxesToNodes:yfiles.collections.IMap; - /** - * The mapping from nodes in the {@link yfiles.labeling.MISLabelingBase#conflictGraph} to a corresponding integer value (ID). - *

- * The ID denotes the actual label which a {@link yfiles.layout.LabelCandidate} (i.e. a node in the conflict graph) belongs to. - *

- * @type {yfiles.algorithms.INodeMap} - */ - nodesToID:yfiles.algorithms.INodeMap; - /** - * Gets or sets the ratio between the internal profit (ip) and the profit computed using the specified {@link yfiles.labeling.LabelingBase#profitModel profit model} (sp). - *

- * This ratio defines how to weight the two profit values (ip) and (sp). The overall ratio is then computed as - * ratio * sp + (1 - ratio) * ip. The profit of a {@link yfiles.layout.LabelCandidate} defines how likely it is that the candidate - * will be chosen as actual label position. - *

- *

- * The ratio is defined to be a value from the interval [0,1]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given ratio is negative or larger than 1 - * @see yfiles.labeling.LabelingBase#profitModel - * @see yfiles.labeling.MISLabelingBase#optimizationStrategy - * @type {number} - */ - customProfitModelRatio:number; - /** - * Gets or sets the optimization strategy which defines the importance of criteria when optimizing labeling results. - *

- * Depending on the strategy, criteria like label-node overlaps, label-label overlaps and others are more or less - * important. For example, if the number of overlaps between labels and nodes is the most important criterion for the - * result, strategy {@link yfiles.labeling.OptimizationStrategy#NODE_OVERLAP} should be chosen. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given strategy is unknown - * @type {yfiles.labeling.OptimizationStrategy} - */ - optimizationStrategy:yfiles.labeling.OptimizationStrategy; - /** - * Gets or sets whether or not {@link yfiles.layout.LabelCandidate label candidates} that overlap with nodes are removed. - *

- * If overlapping candidates are not removed, they will be considered but get a penalty. Therefore, it is still less likely - * that an overlapping candidate is finally chosen. - *

- *

- * The detection and removal of labels that overlap with nodes may increase the runtime of this algorithm. - *

- * @type {boolean} - */ - removeNodeOverlaps:boolean; - /** - * Gets or sets whether or not {@link yfiles.layout.LabelCandidate label candidates} that overlap with edges are removed. - *

- * If overlapping candidates are not removed, they will be considered but get a penalty. Therefore, it is still less likely - * that an overlapping candidate is finally chosen. - *

- *

- * The detection and removal of labels that overlap with edges may increase the runtime of this algorithm. - *

- * @type {boolean} - */ - removeEdgeOverlaps:boolean; - /** - * Gets or sets whether or not the number of ambiguous label placements is reduced by applying an additional optimization - * step. - *

- * A label position is considered to be ambiguous if it might not be possible to identify to which graph element the label - * belongs. For example, an edge label placed in between two edges is ambiguous. - *

- *

- * Enabling this reduction step does not guarantee that no ambiguous placements are selected. The algorithm will try to - * avoid them if other good positions without ambiguity are available. Other aspects like {@link yfiles.layout.PreferredPlacementDescriptor preferred placement} for edge - * labels will still be more important than the reduction of ambiguity. - *

- * @type {boolean} - */ - reduceAmbiguity:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.labeling.MISLabelingBase; - } - /** - * Specifies custom data for the {@link yfiles.labeling.GenericLabeling}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface LabelingData extends yfiles.layout.LayoutData{} - export class LabelingData { - constructor(); - /** - * Gets or sets the collection of labels that shall be placed by the algorithm. - *

- * Note that the {@link yfiles.layout.DpKeyItemCollection.#dpKey} has to be set to the key assigned to {@link yfiles.labeling.LabelingBase#affectedLabelsDpKey}. - *

- * @see yfiles.labeling.LabelingBase#affectedLabelsDpKey - * @type {yfiles.layout.DpKeyItemCollection.} - */ - affectedLabels:yfiles.layout.DpKeyItemCollection; - /** - * Gets or sets the mapping from node labels to an {@link yfiles.layout.INodeLabelLayoutModel} used by the labeling algorithm - * instead of the original label model. - *

- * If a label has no mapping, the original model is used as normal. - *

- * @see yfiles.labeling.LabelingBase#LABEL_MODEL_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeLabelModels:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from edge labels to an {@link yfiles.layout.IEdgeLabelLayoutModel} used by the labeling algorithm - * instead of the original label model. - *

- * If a label has no mapping, the original model is used as normal. - *

- * @see yfiles.labeling.LabelingBase#LABEL_MODEL_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLabelModels:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their source edge group. - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourceGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their target edge group. - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the mapping that provides a {@link yfiles.layout.PreferredPlacementDescriptor} instance for edge - * {@link yfiles.graph.ILabel}s. - * @see yfiles.layout.PreferredPlacementDescriptor - * @see yfiles.layout.LayoutGraphAdapter#EDGE_LABEL_LAYOUT_PREFERRED_PLACEMENT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLabelPreferredPlacement:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.labeling.LabelingData; - } - }export namespace organic{ - export enum InitialPlacement{ - /** - * Initial placement strategy for starting with randomly chosen node locations. - * @see yfiles.organic.ClassicOrganicLayout#initialPlacement - */ - RANDOM, - /** - * Initial placement strategy for starting with all node location coordinates set to 0. - *

- * This strategy is best if the initial placement should be maximally neutral, ignoring the existing layout of the input - * graph. - *

- * @see yfiles.organic.ClassicOrganicLayout#initialPlacement - */ - ZERO, - /** - * Initial placement strategy for starting with the node locations as they are in the input graph. - *

- * This strategy is best if the existing layout should change as little as possible. - *

- * @see yfiles.organic.ClassicOrganicLayout#initialPlacement - */ - AS_IS - } - export enum GroupsPolicy{ - /** - * Group handling policy for considering and arranging the nodes contained in a group such that their togetherness is - * highlighted. - * @see yfiles.organic.ClassicOrganicLayout#groupNodePolicy - */ - LAYOUT, - /** - * Group handling policy for keeping the relative positions of nodes that belong to the same group fixed. - *

- * The fixed groups will be taken into account when placing the other nodes of the graph. - *

- *

- * By registering a {@link yfiles.algorithms.IDataProvider} with key - * {@link yfiles.organic.ClassicOrganicLayout#FIXED_GROUP_NODES_DP_KEY}, the individual group nodes can be marked as fixed or not - * fixed. If there is no data provider registered with the mentioned key, then all group nodes of the graph will be treated - * as fixed. - *

- * @see yfiles.organic.ClassicOrganicLayout#groupNodePolicy - */ - FIXED, - /** - * Group handling policy for completely ignoring group nodes during the layout process. - * @see yfiles.organic.ClassicOrganicLayout#groupNodePolicy - */ - IGNORE - } - export enum Scope{ - /** - * Scope mode indicating that the algorithm should place all nodes of the graph. - * @see yfiles.organic.ClassicOrganicLayout#scope - */ - ALL, - /** - * Scope mode indicating that the algorithm should mainly place a subset of nodes. - *

- * The subset is determined by a boolean value returned by a {@link yfiles.algorithms.IDataProvider} registered with key - * {@link yfiles.organic.ClassicOrganicLayout#AFFECTED_NODES_DP_KEY}. Nodes that don't belong to the subset may be moved to a - * certain degree but will keep their relative positions to the other nodes outside the subset. - *

- * @see yfiles.organic.ClassicOrganicLayout#scope - * @see yfiles.organic.ClassicOrganicLayout#AFFECTED_NODES_DP_KEY - */ - MAINLY_SUBSET, - /** - * Scope mode indicating that the algorithm should only place a subset of nodes. - *

- * The subset is determined by a boolean value returned by a {@link yfiles.algorithms.IDataProvider} registered with key - * {@link yfiles.organic.ClassicOrganicLayout#AFFECTED_NODES_DP_KEY}. Nodes not being part of the subset will remain at their - * location. - *

- * @see yfiles.organic.ClassicOrganicLayout#scope - * @see yfiles.organic.ClassicOrganicLayout#AFFECTED_NODES_DP_KEY - */ - SUBSET - } - export enum HorizontalOverlapCriterion{ - /** - * Horizontal overlap criterion defining an overlap as horizontal if the overlapping area is greater in height than in - * width. - *

- * Otherwise, if the overlap area's width is greater than or equal to its height, an overlap will be categorized as - * vertical. - *

- *

- * The area of an overlap is defined as the rectangle where two nodes intersect with each other. - *

- * @see yfiles.organic.ShuffleLayout#horizontalOverlapCriterion - */ - INTERSECTION_BOX, - /** - * Horizontal overlap criterion categorizing an overlap as horizontal if the center-to-center difference between the - * overlapping nodes is greater in horizontal direction (x-coordinates) than in vertical direction (y-coordinates). - *

- * Otherwise, if the center-to-center difference between two overlapping nodes is greater in vertical direction - * (y-coordinates), the corresponding overlap is categorized as vertical. The same applies if the differences in vertical - * and horizontal direction are equal. - *

- * @see yfiles.organic.ShuffleLayout#horizontalOverlapCriterion - */ - NODE_CENTER, - /** - * Horizontal overlap criterion categorizing an overlap as horizontal if the required movement for solving the overlap is - * shorter in horizontal direction than in vertical direction. - *

- * Otherwise, an overlap will be categorized as vertical. - *

- *

- * This criterion tries to avoid moving nodes too much because the direction for resolving overlaps will be chosen such - * that the shorter movement is preferred. - *

- * @see yfiles.organic.ShuffleLayout#horizontalOverlapCriterion - */ - LESS_MOVEMENT - } - export enum ChainSubstructureStyle{ - /** - * Substructure style specifier for chains that indicates that the algorithm does not handle such structures in a special - * way. - * @see yfiles.organic.OrganicLayout#chainSubstructureStyle - */ - NONE, - /** - * Substructure style specifier for chains that leads to a compact (rotated) rectangular layout style for chains. - * @see yfiles.organic.OrganicLayout#chainSubstructureStyle - */ - RECTANGULAR, - /** - * Substructure style specifier for chains that leads to a straight-line layout style for chains. - * @see yfiles.organic.OrganicLayout#chainSubstructureStyle - */ - STRAIGHT_LINE - } - export enum StarSubstructureStyle{ - /** - * Substructure style specifier for stars that indicates that the algorithm does not handle such structures in a special - * way. - * @see yfiles.organic.OrganicLayout#starSubstructureStyle - */ - NONE, - /** - * Substructure style specifier for stars that leads to a radial layout style for stars where the root is placed in the - * middle. - * @see yfiles.organic.OrganicLayout#starSubstructureStyle - */ - RADIAL, - /** - * Substructure style specifier for stars that leads to a radial layout style for stars where the root is placed on the - * outside (separated from the nodes with degree one). - * @see yfiles.organic.OrganicLayout#starSubstructureStyle - */ - SEPARATED_RADIAL, - /** - * Substructure style specifier for stars that leads to a circular layout style for stars where the root is placed in the - * middle. In contrast to the radial layout style, all nodes (except the root) are placed on a single cycle. - * @see yfiles.organic.OrganicLayout#starSubstructureStyle - */ - CIRCULAR - } - export enum ParallelSubstructureStyle{ - /** - * Substructure style specifier for parallel structures that indicates that the algorithm does not handle such structures - * in a special way. - * @see yfiles.organic.OrganicLayout#parallelSubstructureStyle - */ - NONE, - /** - * Substructure style specifier for parallel structures that leads to a (rotated) rectangular layout style for the inner - * nodes. - * @see yfiles.organic.OrganicLayout#parallelSubstructureStyle - */ - RECTANGULAR, - /** - * Substructure style specifier for parallel structures that leads to a radial layout style for the inner nodes. - * @see yfiles.organic.OrganicLayout#parallelSubstructureStyle - */ - RADIAL, - /** - * Substructure style specifier for parallel structures that places the inner nodes on a straight-line. - * @see yfiles.organic.OrganicLayout#parallelSubstructureStyle - */ - STRAIGHT_LINE - } - export enum CycleSubstructureStyle{ - /** - * Substructure style specifier for cycle structures that indicates that the algorithm does not handle such structures in a - * special way. - * @see yfiles.organic.OrganicLayout#cycleSubstructureStyle - */ - NONE, - /** - * Substructure style specifier for cycle structures that leads to a circular layout style. - * @see yfiles.organic.OrganicLayout#cycleSubstructureStyle - */ - CIRCULAR - } - export enum GroupNodeMode{ - /** - * A mode constant for placing and resizing the group nodes and their content by the layout algorithm. The size of the - * group is adjusted to the space that is needed by the placement of its contained nodes. - * @see yfiles.organic.OrganicLayout#GROUP_NODE_MODE_DP_KEY - */ - NORMAL, - /** - * A mode constant for placing the group nodes and their content with respect to the original bounds of the group node. The - * bounds of the group nodes are treated as fixed and cannot be exceeded by the content of the group nodes. - * @see yfiles.organic.OrganicLayout#GROUP_NODE_MODE_DP_KEY - */ - FIX_BOUNDS, - /** - * A mode constant for placing group nodes with fixed content. Although these particular group nodes can move like all - * other ordinary group nodes, their content remains fixed relative to the position of the group node. - * @see yfiles.organic.OrganicLayout#GROUP_NODE_MODE_DP_KEY - */ - FIX_CONTENTS - } - /** - * This layout algorithm removes overlaps between nodes in a graph. - *

- * Note: The usage of {@link yfiles.organic.RemoveOverlapsStage} instead of this class is recommended for most use cases involving the - * mere removal of overlaps. That stage offers a more powerful strategy to do the task. - *

- *

- * Layout Style - *

- *

- * The style of results often resembles the look of tiles which have been dropped onto each other, where tiles correspond - * to nodes of the graph. The reason is that overlapping nodes are moved in order to resolve the overlap. During this - * process, several nodes moving in the same direction may be stacked next to or above each other. - *

- *

- * This algorithm does not route the edges of the input graph - edges might although be stretched due to the node - * movement. - *

- *

- * {@graph {"ann":{"s":[88,86],"d":0},"n":[[10,161.5,100,157],[-14,262.5],[-44,292.5],[-74,322.5],[-104,352.5],[-134,382.5],[46,262.5],[76,292.5],[106,322.5],[136,352.5],[166,382.5],[-100,198.5,320,46],[37.5,139,45,45],[195,181.5,30,73.5],[-105,181.5,30,73.5],[537.5,56,100,157],[513.5,219],[483.5,311],[453.5,403],[423.5,495],[393.5,587],[607.5,219],[603.5,311],[633.5,403],[663.5,495],[693.5,587],[458.5,4,320,46],[565,-55.5,45,45],[784.5,-13.25,30,73.5],[422.5,-13.25,30,73.5]],"e":[],"vp":[-134.0,-56.0,949.0,729.0]}} Example with overlaps (left) and after executing the shuffle layout (right) {@graph {"ann":{"s":[65.2,39.6],"d":0},"n":[[360.9,272.2],[360.9,345.2],[575.9,369.2],[378.9,401.2],[494.4,369.2],[528.4,257.7],[538.4,313.2],[657.4,369.2],[619.9,313.2],[-2.6,293],[-2.6,365.8],[173.4,369.2],[15.4,391],[130.6,383],[165.2,278.6],[174.8,296.2],[203.8,383],[191.4,309.2]],"e":[[6,0],[6,3],[1,6],[1,0],[6,5],[8,2],[15,9],[15,12],[10,15],[10,9],[15,14],[17,11]],"vp":[-3.0,257.0,726.0,184.0]}} Example with overlaps (left) and after - * executing the shuffle layout (right) Concept Nodes overlapping with other nodes will be moved in horizontal or vertical - * direction in order to remove overlaps. The concept behind this removal step is based on a famous Russian arcade game. Features - *

- *

- * This layout stage can also be {@link yfiles.organic.ShuffleLayout#applyLayout executed} on its own, without specifying a {@link yfiles.organic.ShuffleLayout#coreLayout core layout algorithm}. - *

- *

- * A minimum distance between nodes can be specified such that not only overlaps will be removed but nodes will keep this - * specified distance to other nodes. This distance can be defined separately for each node using a {@link yfiles.algorithms.IDataProvider} - * registered with key {@link yfiles.organic.ShuffleLayout#MINIMUM_DISTANCE_DP_KEY}. The minimum distance can also be specified - * globally via {@link yfiles.organic.ShuffleLayout#minimumNodeDistance}. - *

- *

- * To specify that specific nodes should not be moved, they can be marked as fixed using a {@link yfiles.algorithms.IDataProvider} - * registered with key {@link yfiles.organic.ShuffleLayout#FIXED_NODE_DP_KEY}. - *

- * @class - * @implements {yfiles.layout.ILayoutStage} - */ - export interface ShuffleLayout extends yfiles.lang.Object,yfiles.layout.ILayoutStage{} - export class ShuffleLayout { - /** - * Creates a new instance of {@link yfiles.organic.ShuffleLayout} with default settings. - */ - constructor(); - /** - * Performs the overlap removal (shuffle) algorithm on the given graph, after the {@link yfiles.organic.ShuffleLayout#coreLayout core layout algorithm} was applied to it. - * @param graph the input graph - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Data provider key for specifying a minimum distance for each node - *

- * The default minimum distance specified by {@link yfiles.organic.ShuffleLayout#minimumNodeDistance} will be ignored for a node if the {@link yfiles.algorithms.IDataProvider} registered - * with this key contains a valid minimum distance for that node. - *

- *

- * Minimum distance values need to be greater than 0. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static MINIMUM_DISTANCE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for marking nodes as fixed - *

- * A node marked as fixed will not be moved by this algorithm but stay at its current position. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static FIXED_NODE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * - * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the criterion for marking an overlap as horizontal. - *

- * This criterion influences how overlaps will be resolved. If an overlap is considered horizontal, it will preferably be solved by - * moving nodes horizontally, else vertically. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given criterion is unknown - * @type {yfiles.organic.HorizontalOverlapCriterion} - */ - horizontalOverlapCriterion:yfiles.organic.HorizontalOverlapCriterion; - /** - * Gets or sets the default minimum distance that has to be obeyed between any two nodes. - *

- * This default distance will be considered for a node if the {@link yfiles.algorithms.IDataProvider} registered with the graph - * with key {@link yfiles.organic.ShuffleLayout#MINIMUM_DISTANCE_DP_KEY} does not contain a valid, positive distance for that node. - * If there is no {@link yfiles.algorithms.IDataProvider} registered with the mentioned key, then this default distance will be - * applied to all nodes. - *

- *

- * The minimum distance needs to be a non-negative value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given distance is negative - * @see yfiles.organic.ShuffleLayout#MINIMUM_DISTANCE_DP_KEY - * @type {number} - */ - minimumNodeDistance:number; - /** - * Gets or sets whether or not the simple, fast layout mode of this algorithm is active. - *

- * Enabling this mode, the overlap removal step will be executed using a simpler and less sophisticated approach. All - * overlaps will only be solved by moving nodes vertically. The algorithm will not try to figure out which direction might - * be better for overlap removal. - *

- *

- * The runtime will improve, but results may be of lower quality when using this mode. - *

- * @type {boolean} - */ - simpleMode:boolean; - /** - * Gets or sets whether or not the barycenter mode is used for node shuffling when removing overlaps. - *

- * If this mode is active, the overlap removal step will be executed two times for each direction, once with the normal - * node ordering and once with the reversed ordering. Finally, the barycenter between both results will be used for - * assigning the node coordinates. - *

- *

- * Activating the barycenter mode allows more symmetric results for some graphs. However, the runtime might increase. - *

- * @type {boolean} - */ - barycenterMode:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.ShuffleLayout; - } - /** - * A layout algorithm that arranges graphs in an organic fashion, using a force-directed drawing approach. - *

- * Layout Style - *

- *

- * The organic layout style is characterized by a natural distribution of nodes. It is well suited to exhibit clusters and - * symmetric properties of a graph. Nodes are placed in a space-saving manner, close to their adjacent nodes. Distances - * between neighbors and edge lengths are highly uniform and edges are drawn as straight-line segments without bends. - *

- *

- * Organic diagrams are well suited for visualizing relations in large networks, for example, in bioinformatics, enterprise - * networking, social networks visualization, mesh visualization or system management. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":0,"c":1},"n":[[595.38,758.73,90,90],[1117.49,809.3],[536.78,520.64],[1003.62,223.83,60,60],[144.24,1098.18,60,60],[821.57,320.27,60,60],[1021.74,95.55],[546.05,952.52],[339.03,1117.6],[619.72,286.05,60,60],[459.77,255.26],[819.8,180.32],[352.63,758.67],[602.52,1268.98],[418.51,994.58],[1203,194.02],[474.19,1194.71],[1369.52,207.86],[1229.77,66.55],[1130.53,480.76],[1026.12,377.23],[416.54,865.26],[1405.72,431.59],[742.7,1277.43],[576.4,127.48],[818.41,57.66],[609.01,0],[107.77,1267.45],[468.43,35.76],[168.05,858.48],[1479.05,113.81],[347.41,29.93],[363.19,151.7],[1317.66,551.96],[648.62,1164.37],[1213.89,683.56],[1463.15,308.66],[343.86,303.87],[1583.67,28.36],[221.25,1242],[551.17,1091.78],[652.84,482.26,90,90],[257.56,950.62],[1317.11,333.14],[1249.57,431.4],[1180.69,326.71],[1213.95,579.36],[987.92,896.99],[798.79,926.46,60,60],[766.38,1113.01,60,60],[1027.6,1013.7],[921.45,1059.25],[900.59,1191.83],[863.5,1315.51],[0,1086.46],[73.01,996.02],[17.49,1193.73],[1112.66,599.54],[1026.84,506.48]],"e":[[5,3,-2.34,-4.42,-2.34,-4.42],[5,3,-0,5.66,0,5.66],[6,3],[0,7],[8,4],[5,9,-0.84,4.93,-0.84,4.93],[5,9,0,-5.07,0,-5.07],[9,10],[5,11],[7,14],[14,8],[3,15],[8,16],[13,16],[15,17],[15,18],[5,20],[3,20],[20,19],[14,21],[0,21,1.55,4.23,1.55,4.23],[0,21,0,-4.79,0,-4.79],[21,12],[23,13],[9,24],[11,25],[24,26],[4,27],[24,28],[17,30],[28,31],[10,32],[32,31],[22,33],[34,13],[33,35],[35,1],[17,36],[36,22],[10,37],[30,38],[4,39],[7,40],[34,40],[40,16],[0,41,-4.9,-1.02,-4.9,-1.02],[0,41,15.32,0,15.32,0],[0,41,5.11,0,5.11,0],[0,41,-15.32,0,-15.32,0],[41,2],[41,9,-4.88,1.11,-4.88,1.11],[41,5],[41,9,5.13,0,5.13,0],[41,5,0,15.25,13.25,0],[41,5,0,-15.25,-13.25,0],[4,42],[21,42],[42,29],[17,43],[22,43],[33,44],[43,44],[44,19],[15,45],[43,45],[45,44],[45,20],[33,46],[46,19],[46,35],[47,1],[0,48],[0,48,0,-12.87,0,-12.87],[48,47],[48,0,0,12.87,0,12.87],[49,34],[49,23],[49,48,-4.93,-0.86,-4.93,-0.86],[49,48,5.07,0,5.07,0],[50,47],[50,51],[51,48],[51,52],[52,49],[52,53],[53,23],[54,4],[55,4],[4,56],[19,57],[57,46],[57,35],[20,58],[58,19],[58,57]],"vp":[0.0,0.0,1614.0,1346.0]}} Organic layout obtained using default settings {@graph {"ann":{"s":[30,30],"d":0,"c":1},"n":[[791.09,783.74],[562.01,0],[0,578.93],[654.52,397.12],[398.71,661.82],[289.49,301.35],[607.55,181.65],[486.39,286.91],[431.7,133.95],[585.61,83.22],[526.07,132.08],[499.31,59.31],[643.49,286.85],[577.45,334.93],[570.46,256.07],[384.63,282.87],[349.44,208.68],[428.89,217.67],[735.86,604.59],[609.97,735.23],[576.81,577.73],[708.83,495.34],[664.78,560.98],[627.87,490.62],[768.83,700.17],[706.56,764.55],[692.13,688.28],[499.4,712.48],[490.84,632.17],[563.39,666.04],[178.72,621.75],[126.84,449.31],[282.43,497.82],[287.3,654.44],[253.43,582.88],[333.1,587.05],[74.97,603.05],[57.42,516.13],[124.98,543.53],[198.43,365.41],[274.03,396.79],[209.79,443.73]],"e":[[1,9],[9,6],[6,10],[10,9],[10,8],[9,11],[8,11],[11,1],[11,10],[6,12],[12,3],[3,13],[13,12],[13,7],[12,14],[7,14],[14,6],[14,13],[7,15],[15,5],[5,16],[16,15],[16,8],[15,17],[8,17],[17,7],[17,16],[3,21],[21,18],[18,22],[22,21],[22,20],[21,23],[20,23],[23,3],[23,22],[18,24],[24,0],[0,25],[25,24],[25,19],[24,26],[19,26],[26,18],[26,25],[19,27],[27,4],[4,28],[28,27],[28,20],[27,29],[20,29],[29,19],[29,28],[4,33],[33,30],[30,34],[34,33],[34,32],[33,35],[32,35],[35,4],[35,34],[30,36],[36,2],[2,37],[37,36],[37,31],[36,38],[31,38],[38,30],[38,37],[31,39],[39,5],[5,40],[40,39],[40,32],[39,41],[32,41],[41,31],[41,40]],"vp":[0.0,0.0,822.0,814.0]}} Organic layout exposing symmetries of the graph structureConcept - *

- *

- * This algorithm uses a force-directed approach to place the nodes of the input graph. The graph is modeled as a physical - * system with forces acting on it. Nodes are considered as electrically charged particles with mutually repulsive forces. - * Edges are modeled as springs that attract adjacent nodes. A good diagram is obtained from an equilibrium state of the - * system, i.e., the nodes are rearranged based on the physical forces until the system reaches a (local) minimum of the - * sum of the forces. - *

- *

- * Features - *

- *

- * The {@link yfiles.organic.ClassicOrganicLayout#activateTreeBeautifier tree beautifier} feature activates a special layout style for subgraphs with a tree structure. These subgraphs will - * be arranged using an algorithm dedicated to tree graphs and incorporated into the main organic diagram. - *

- *

- * Several parameters for the internal force-directed drawing algorithm can be modified. For example, the {@link yfiles.organic.ClassicOrganicLayout#repulsion repulsion}, {@link yfiles.organic.ClassicOrganicLayout#attraction attraction} - * and {@link yfiles.organic.ClassicOrganicLayout#initialTemperature initial temperature} can be controlled. This allows experts to configure and fine-tune the algorithm with respect to - * their needs. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface ClassicOrganicLayout extends yfiles.layout.MultiStageLayout{} - export class ClassicOrganicLayout { - /** - * Creates a new {@link yfiles.organic.ClassicOrganicLayout} with default settings. - */ - constructor(); - /** - * Frees internal resources which were in use during a previous algorithm run. - */ - dispose():void; - /** - * Data provider key for marking the nodes that are part of the current scope - * @see yfiles.organic.ClassicOrganicLayout#scope - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static AFFECTED_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for marking group nodes as fixed - *

- * The content of a fixed group node will not be changed by this algorithm but be treated as fixed. - *

- *

- * The groups marked as fixed will be considered for the {@link yfiles.organic.ClassicOrganicLayout#groupNodePolicy group node policy} settings {@link yfiles.organic.GroupsPolicy#FIXED} and - * {@link yfiles.organic.GroupsPolicy#LAYOUT}. When {@link yfiles.organic.GroupsPolicy#IGNORE} is chosen, the data provider registered with - * this key will be ignored. - *

- * @see yfiles.organic.ClassicOrganicLayout#groupNodePolicy - * @see yfiles.organic.GroupsPolicy#FIXED - * @see yfiles.organic.GroupsPolicy#LAYOUT - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static FIXED_GROUP_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for defining an individual preferred length for each edge - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static PREFERRED_EDGE_LENGTH_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets the node repulsion value. - *

- * The repulsion influences the forces between nodes. A higher repulsion value can lead to more compact drawings, whereas a - * lower repulsion value potentially enlarges drawings. - *

- *

- * The repulsion is defined to range from 0 to 2. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the repulsion value is negative or greater than 2 - * @type {number} - */ - repulsion:number; - /** - * Gets or sets the edge attraction value. - *

- * The attraction influences the attractive force associated with edges. A higher attraction value can lead to more compact - * drawings, whereas a lower value potentially enlarges drawings. - *

- *

- * The attraction is defined to range from 0 to 2. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the attraction value is negative or greater than 2 - * @type {number} - */ - attraction:number; - /** - * Gets or sets the {@link yfiles.layout.IGroupBoundsCalculator} instance used for calculating the size of group nodes. - * @type {yfiles.layout.IGroupBoundsCalculator} - */ - groupBoundsCalculator:yfiles.layout.IGroupBoundsCalculator; - /** - * Gets or sets the compactness of group nodes. - *

- * The compactness ranges from 0 to 1 where 0 results in group nodes not affecting the overall layout too much while 1 - * forces nodes in the same group to be clustered tightly. - *

- *

- * The compactness values needs to lie within [0,1]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if compactness value does not lie within the interval [0,1] - * @type {number} - */ - groupNodeCompactness:number; - /** - * Gets or sets the policy for the handling of group nodes. - *

- * The group policy defines whether this algorithm {@link yfiles.organic.GroupsPolicy#IGNORE ignores} groups, leaves them {@link yfiles.organic.GroupsPolicy#FIXED fixed} or actively {@link yfiles.organic.GroupsPolicy#LAYOUT arranges} them. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given policy is unknown - * @type {yfiles.organic.GroupsPolicy} - */ - groupNodePolicy:yfiles.organic.GroupsPolicy; - /** - * Gets or sets the initial temperature for the force-directed layout process. - *

- * The algorithm starts with an initial temperature. During the iterations of the layout process, this temperature - * decreases and if it reaches a certain limit, the process terminates. This limit can be controlled using {@link yfiles.organic.ClassicOrganicLayout#finalTemperature}. - *

- *

- * The initial temperature will be multiplied by the {@link yfiles.organic.ClassicOrganicLayout#preferredEdgeLength preferred edge length} and then assigned as the actual initial heat of - * nodes. - *

- * @see yfiles.organic.ClassicOrganicLayout#finalTemperature - * @type {number} - */ - initialTemperature:number; - /** - * Gets or sets the absolute, final temperature value, which will cause the algorithm to stop if the average temperature - * falls under this value. - *

- * The algorithm starts with an initial temperature. During the iterations of the layout process, this temperature - * decreases. - *

- * @see yfiles.organic.ClassicOrganicLayout#initialTemperature - * @type {number} - */ - finalTemperature:number; - /** - * Gets or sets whether or not the deterministic mode of the layout algorithm is enabled. - *

- * In deterministic mode, the layout algorithm will yield the same results if the exact same input and same settings are - * given as input. - *

- * @type {boolean} - */ - deterministic:boolean; - /** - * Gets or sets whether or not to arrange subtrees of the input graph in a special, optimized tree style. - *

- * Subtrees will be arranged in a {@link yfiles.tree.BalloonLayout balloon-like fashion}. - *

- *

- * If this feature is disabled, subgraphs with a tree structure are arranged using the same style as for the rest of the - * graph. - *

- *

- * In case that the input graph is a {@link yfiles.algorithms.Trees#isRootedTree tree} and this feature is enabled, the whole graph will be drawn in a tree-like style. - *

- * @type {boolean} - */ - activateTreeBeautifier:boolean; - /** - * Gets or sets the gravity factor whose magnitude determines the strength of the force towards the barycenter of the - * graph. - *
    - *
  • A high gravity factor value leads to layouts with nodes clustered around the barycenter of the graph.
  • - *
  • A low gravity factor value stretches the outskirts of the graph far away from the barycenter.
  • - *
- * @type {number} - */ - gravityFactor:number; - /** - * Gets or sets the scope that determines which nodes are placed by this algorithm. - * @throws {Stubs.Exceptions.ArgumentError} if the given scope is unknown - * @see yfiles.organic.ClassicOrganicLayout#AFFECTED_NODES_DP_KEY - * @type {yfiles.organic.Scope} - */ - scope:yfiles.organic.Scope; - /** - * Gets or sets the strategy for the initial placement of nodes. - *

- * The initial placement has an influence on the final result, because this force-directed algorithm starts with some - * positions and then uses forces between nodes to finally aim for a stable result drawing. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given initial placement mode is unknown - * @type {yfiles.organic.InitialPlacement} - */ - initialPlacement:yfiles.organic.InitialPlacement; - /** - * Gets or sets the maximum duration in milliseconds that this layout algorithm is allowed to run. - *

- * The duration needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified duration has a negative value - * @type {number} - */ - maximumDuration:number; - /** - * Gets or sets the iteration factor which influences the maximum number of optimization iterations the algorithm may - * perform. - * @type {number} - */ - iterationFactor:number; - /** - * Gets or sets the default preferred edge length. - *

- * The default preferred edge length will be used for edges that don't have an individual length preference defined via a {@link yfiles.algorithms.IDataProvider} - * registered with key {@link yfiles.organic.ClassicOrganicLayout#PREFERRED_EDGE_LENGTH_DP_KEY}. - *

- *

- * The preferred edge length needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified edge length is negative - * @type {number} - */ - preferredEdgeLength:number; - /** - * Gets or sets whether or not to consider node sizes during layout calculation. - *

- * If this feature is disabled, overlaps between nodes (e.g. due to large node sizes) may occur. - *

- * @type {boolean} - */ - considerNodeSizes:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. - * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled - * @see yfiles.layout.MultiStageLayout#orientationLayout - * @see yfiles.layout.MultiStageLayout#layoutOrientation - * @see yfiles.layout.OrientationLayout - * @type {boolean} - */ - orientationLayoutEnabled:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.ClassicOrganicLayout; - } - /** - * A {@link yfiles.organic.InteractiveOrganicLayoutExecutionContext} provides control over the layout calculation in the case of - * single-threaded algorithm execution. - * @see yfiles.organic.InteractiveOrganicLayout#startLayout - * @interface - */ - export interface InteractiveOrganicLayoutExecutionContext extends yfiles.lang.Object{ - /** - * Starts the layout calculation, continuing where it has stopped before and allowing a certain maximum duration in - * milliseconds. - * @param duration the duration in milliseconds the layout calculation is allowed to run - * @abstract - */ - continueLayout(duration:number):void; - /** - * Stops the layout calculation. - * @abstract - */ - stopLayout():void; - } - var InteractiveOrganicLayoutExecutionContext:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.organic.InteractiveOrganicLayoutExecutionContext; - }; - /** - * This algorithm arranges graphs in an organic fashion and offers special functionality to interact with the graph while - * the algorithm is running. - *

- * Besides the organic graph arrangement, this algorithm enables to immediately visualize changes made to a graph. Changes - * can be committed and the layout will be locally updated. That way, live interactions with an adapting graph layout are - * possible. Another advantage is that it is not necessary to compute a completely new layout if only small changes were - * made. - *

- *

- * Layout Style - *

- *

- * This algorithm supports the organic layout style which is characterized by a natural distribution of nodes. It is well - * suited to exhibit clusters and symmetric properties of a graph. Nodes are placed in a space-saving manner and distances - * between neighbors are highly uniform. Edges maintain uniform lengths too and are routed with straight-line segments - * without bends. - *

- *

- * Organic diagrams are well suited for visualizing relations in large networks, for example, in bioinformatics, enterprise - * networking, social networks visualization, mesh visualization or system management. - *

- *

- * {@graph {"ann":{"s":[48,48],"d":0,"c":1},"n":[[-2901.1,82.94],[-2776.3,150.06],[-3044.96,-84.47],[-3100.49,54.95],[-3341.59,-232.28],[-3150.07,-159.49],[-2593.59,-25.02],[-2797.37,369.15],[-2792.54,582.9],[-2408.44,-110.43],[-3646.34,-1285.02],[-2406.36,-423.92],[-2508.48,535.38],[-3061.33,-181.39],[-3576.11,-153.25],[-3291.19,-446.62],[-3232.03,168.75],[-2991.88,23.83],[-2875.69,-19.77],[-3311.02,255.49],[-3211.58,273.66],[-3238.43,-589.82],[-3371.25,-336.26],[-3780.22,-96.13],[-2438.22,451.91],[-2348.8,552.52],[-2524.48,-582.24],[-2397.54,-234.83],[-3717.44,-1204.02],[-3539.82,-1255.44],[-2280.66,-209.75],[-2305.78,-69.98],[-2710.41,513.62],[-2747.74,704.16],[-2823.23,749.08],[-2354.53,12.96],[-2918.36,-219.22],[-2746.37,809.37],[-2657.24,754.28],[-3054.29,380.79],[-2235.49,-319.69],[-3521.75,-1120.87],[-3498.17,-1358.62],[-3729.27,-1087.89],[-2661.13,-725.91],[-2220.36,485.66],[-2577.32,481.65],[-2278.76,391.75],[-3911.01,-117.89],[-3889.39,-12.86],[-3449.65,-560.78],[-3236.89,-238.15],[-3271.16,-341.32],[-3062.01,-674.62],[-3372.21,-829.48],[-3343.54,161.81],[-3403.91,-648.81],[-2650.26,75.72],[-2655.19,191.31],[-2482.07,33.2],[-2545.18,138.92],[-3389.07,735.04],[-3233.93,-696.37],[-3571.23,-672.16],[-3451.64,-420.88],[-3550.73,-949.47],[-3331.67,-944.96],[-3058.81,-774.77],[-2903.06,-735.09],[-3508.46,-749.04],[-3962.39,59.51],[-4014.76,-33.26],[-4162.59,-51.88],[-2213.5,331.67],[-2143.12,434.04],[-2082.3,582.85],[-2563.73,-859.16],[-3872.43,-1134.67],[-2276.55,-427.33],[-3065.02,511.6],[-3216.65,13.18],[-3228.93,507],[-2666.53,647.27],[-2828.44,878.41],[-2888.55,-350.13],[-2803.46,-224.75],[-2274.13,227.36],[-2702.86,-255.45],[-2938.6,-442.63],[-2801.51,-416.97],[-2850.68,986.11],[-3315.58,637.75],[-3335,498.26],[-3322.98,-0.08],[-2999.45,592.68],[-3121.13,611.43],[-2191.35,-498.52],[-3933.14,-1230.72],[-3975.46,-1097.6],[-2618.48,-953.77],[-2458.11,-831.59],[-2490.11,-956.72],[-2049.18,482.82],[-1967.47,616.36],[-2076.61,696.43],[-4236.41,-130.92],[-4253.91,12.07],[-4056.39,65.42],[-2834.31,-815.64],[-2994.48,-872.19],[-3118.99,-869],[-3291.19,-1046.13],[-3606.59,-1027.04],[-3652.5,-907.63],[-3531.64,-338.57],[-3562.98,-455.05],[-3659.45,-608.85],[-3667.52,-730.4],[-3453.32,820.54],[-2454.91,197.69],[-2634.6,286.15]],"e":[[0,1],[0,2],[2,3],[2,4],[2,5],[1,6],[1,7],[7,8],[6,9],[5,13],[13,2],[4,14],[4,15],[3,16],[3,17],[17,18],[18,2],[16,19],[16,20],[20,19],[15,21],[22,4],[14,23],[12,24],[12,25],[11,26],[11,27],[10,28],[10,29],[9,30],[9,31],[8,32],[32,12],[8,33],[8,34],[34,33],[31,35],[27,35],[36,2],[34,37],[37,33],[33,38],[38,37],[32,39],[30,40],[29,41],[29,42],[28,43],[26,44],[25,45],[24,46],[46,12],[46,32],[24,47],[47,45],[23,48],[23,49],[22,50],[22,51],[51,5],[21,52],[21,53],[21,54],[19,55],[55,16],[50,56],[18,57],[57,58],[57,59],[59,35],[57,60],[56,62],[62,21],[56,63],[52,64],[50,64],[54,65],[43,65],[41,65],[54,66],[53,67],[62,67],[53,68],[44,68],[68,67],[50,69],[69,63],[69,65],[49,70],[49,71],[48,71],[70,71],[72,71],[47,73],[73,45],[47,74],[45,74],[45,75],[44,76],[43,77],[40,78],[78,11],[39,79],[39,80],[80,52],[39,81],[38,82],[82,33],[82,32],[37,83],[83,34],[36,84],[36,85],[35,86],[86,47],[86,73],[85,87],[84,88],[84,89],[83,90],[81,91],[61,91],[81,92],[80,93],[79,94],[79,95],[78,96],[77,97],[77,98],[76,99],[76,100],[76,101],[75,102],[74,102],[75,103],[75,104],[72,105],[72,106],[71,107],[70,107],[68,108],[67,109],[67,110],[66,111],[65,112],[65,113],[64,114],[64,115],[63,116],[63,117],[61,118],[60,119],[58,120]],"vp":[-4254.0,-1359.0,2335.0,2394.0]}} Organic layout obtained using this algorithmConcept - *

- *

- * The internal basis for computing actual layouts is a force-directed approach placing the nodes of the input graph. The - * graph is modeled as a physical system with appropriate forces acting on it. Nodes are considered as electrically charged - * particles with mutually repulsive forces. Edges are modeled as forces that attract adjacent nodes. A good diagram is - * obtained from an equilibrium state of the system, i.e., the nodes are rearranged based on the physical forces until the - * system reaches a (local) minimum of the sum of the forces. - *

- *

- * Features - *

- *

- * Several update methods allow to indicate lightweight changes on the graph, for example, {@link yfiles.organic.InteractiveOrganicLayout#setCenter} - * for node location updates. These updates will be scheduled and executed at a specific point within the life-cycle of the - * layout algorithm. They are ideally suited for usage in interactive scenarios, where users, for example, change node - * positions via mouse-dragging. - *

- *

- * Method {@link yfiles.organic.InteractiveOrganicLayout#addStructureUpdate} allows to schedule a custom event handler instance - * that is executed in a synchronized context and can safely update the structure of the graph. - *

- *

- * Usage Hints - *

- *

- * It is easiest to start the algorithm using {@link yfiles.organic.InteractiveOrganicLayout#startLayout}. Furthermore, it is - * strongly recommended to start it by passing a copy of the original graph (i.e. a {@link yfiles.layout.CopiedLayoutGraph} - * instance) as parameter to the mentioned method. - *

- *

- * Importantly, changes will not be automatically applied to the input graph. Updates can be scheduled via various methods (e.g. - * {@link yfiles.organic.InteractiveOrganicLayout#setCenter}). The whole layout will then internally be adjusted accordingly and - * changes are stored as intermediate results. Such intermediate results can be {@link yfiles.organic.InteractiveOrganicLayout#commitPositions committed} in order to apply them to the - * actual graph. - *

- * @class - * @implements {yfiles.layout.ILayoutAlgorithm} - */ - export interface InteractiveOrganicLayout extends yfiles.lang.Object,yfiles.layout.ILayoutAlgorithm{} - export class InteractiveOrganicLayout { - /** - * Creates a new instance of the {@link yfiles.organic.InteractiveOrganicLayout} with default settings. - */ - constructor(); - /** - * Schedules an update for the structure of the graph, which will automatically be executed at a later point in the - * life-cycle of this algorithm. - *

- * The given event handler will be queued and executed at a specific time. The event handler can make structural changes - * (e.g. removal/creation of edges or nodes). They will be synchronized with the rest of the layout algorithm. - *

- * @param handler The handler delegate that will be invoked using null as the sender and evt as the event arguments - * @param evt The event argument that will be piped to the handler invocation. - */ - addStructureUpdate(handler:(sender:any,evt:yfiles.lang.EventArgs)=>void,evt:yfiles.lang.EventArgs):void; - /** - * Calculates an organic layout for the given input graph, however, the layout is not automatically applied to the graph. - *

- * Changes have to be {@link yfiles.organic.InteractiveOrganicLayout#commitPositions committed} to update the graph with the actual calculated positions. - *

- * @param graph the input graph - * @see yfiles.organic.InteractiveOrganicLayout#startLayout - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Writes calculated intermediate locations of nodes and edges to the actual graph. - *

- * Update methods like {@link yfiles.organic.InteractiveOrganicLayout#setCenter} schedule changes which cause that the whole layout - * will internally be adjusted. All adjustments are stored as intermediate results. This method immediately transfers all - * these intermediate results to the actual input graph. - *

- * @see yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly - */ - commitPositions():void; - /** - * Writes calculated intermediate locations of nodes and edges to the actual graph and returns the largest movement value. - *

- * Update methods like {@link yfiles.organic.InteractiveOrganicLayout#setCenter} schedule changes which cause that the whole layout - * will internally be adjusted. All adjustments are stored as intermediate results. This method smoothly transfers all - * these intermediate results to the actual input graph. - *

- *

- * Positions are, however, not transferred directly (use {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} if that is intended). Instead, the - * nodes are moved towards the calculated position. The movement is restricted to the given maximum distance. - *

- *

- * The movement will be calculated as (movement) = (factor) * (distance between calculated and actual location) - *

- *

- * The returned largest movement can be used for estimating the difference between calculated layout and actual positions. - * If the return value is 0, the calculated layout was completely transferred. - *

- * @param maxMovement the maximum distance a node will be moved - * @param factor a factor that determines the node movement - * @returns the largest movement value or 0, if the calculated layout has been transferred completely - * @see yfiles.organic.InteractiveOrganicLayout#commitPositions - */ - commitPositionsSmoothly(maxMovement:number,factor:number):number; - /** - * Disables all predefined {@link yfiles.layout.ILayoutStage}s so that upon {@link yfiles.organic.InteractiveOrganicLayout#applyLayout} - * only the internal organic layout algorithm will be executed. - *

- * This method is called upon construction of this class so that by default additional - * {@link yfiles.layout.ILayoutStage}s are deactivated. This method may be overridden if the additional stages should stay active - * (e.g. override the method and return silently). - *

- * @see yfiles.layout.MultiStageLayout#disableAllStages - */ - disableAllStages():void; - /** - * Polls the current coordinates of the center of the given node. - *

- * The returned coordinates do not necessarily correspond to the actual location of the node in the input graph. They may - * only be intermediate results stored in the algorithm. This will be the case if scheduled updates were not yet completely - * {@link yfiles.organic.InteractiveOrganicLayout#commitPositions committed} to the actual graph. - *

- * @param node the node for which the center should be polled - * @returns the {@link } representing the center location of the given node, or null if nothing about the node is - * known - * @see yfiles.organic.InteractiveOrganicLayout#setCenter - */ - getCenter(node:yfiles.algorithms.Node):yfiles.algorithms.YPoint; - /** - * Polls the current x-coordinate of the center location of the given node. - *

- * The returned coordinate is not necessarily the actual x-coordinate of the node in the input graph but only an - * intermediate result stored in the algorithm. This will be the case if scheduled updates were not yet completely {@link yfiles.organic.InteractiveOrganicLayout#commitPositions committed} - * to the actual graph. - *

- * @param node the node for which the x-coordinate should be polled - * @returns the x-coordinate of the center location of the given node - * @see yfiles.organic.InteractiveOrganicLayout#setCenterX - */ - getCenterX(node:yfiles.algorithms.Node):number; - /** - * Polls the current y-coordinate of the center location of the given node. - *

- * The returned coordinate is not necessarily the actual y-coordinate of the node in the input graph but only an - * intermediate result stored in the algorithm. This will be the case if scheduled updates were not yet completely {@link yfiles.organic.InteractiveOrganicLayout#commitPositions committed} - * to the actual graph. - *

- * @param node the node for which the y-coordinate should be polled - * @returns the y-coordinate of the center location of the given node - * @see yfiles.organic.InteractiveOrganicLayout#setCenterY - */ - getCenterY(node:yfiles.algorithms.Node):number; - /** - * Polls the current stress value of a given node. - *

- * The stress value indicates how far a node will possibly move. The higher the stress of a node is, the farther it may - * move. - *

- *

- * The stress value is defined to be a value from the interval [0,1]. - *

- * @param node the node for which the stress value should be polled - * @returns the stress value of the given node - * @see yfiles.organic.InteractiveOrganicLayout#setStress - */ - getStress(node:yfiles.algorithms.Node):number; - /** - * Schedules an update for the center location of the given node. - *

- * This method can be used while layout calculation is in progress (e.g. for interactive layout scenarios). However, the - * change will not directly be applied to the graph itself but only stored internally as an intermediate result. Scheduled updates can be - * committed to the graph while the algorithm is running using methods {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} - * or {@link yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly}. - *

- * @param node the node that should be updated - * @param x the desired x-coordinate of the given node - * @param y the desired y-coordinate of the given node - */ - setCenter(node:yfiles.algorithms.Node,x:number,y:number):void; - /** - * Schedules an update for the center location's x-coordinate of the given node. - *

- * This method can be used while layout calculation is in progress (e.g. for interactive layout scenarios). However, the - * change will not directly be applied to the graph itself but only stored internally as an intermediate result. Scheduled updates can be - * committed to the graph while the algorithm is running using methods {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} - * or {@link yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly}. - *

- * @param node the node that should be updated - * @param x the desired x-coordinate of the given node - * @see yfiles.organic.InteractiveOrganicLayout#setCenterY - * @see yfiles.organic.InteractiveOrganicLayout#setCenter - */ - setCenterX(node:yfiles.algorithms.Node,x:number):void; - /** - * Schedules an update for the center location's y-coordinate of the given node. - *

- * This method can be used while layout calculation is in progress (e.g. for interactive layout scenarios). However, the - * change will not directly be applied to the graph itself but only stored internally as an intermediate result. Scheduled updates can be - * committed to the graph while the algorithm is running using methods {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} - * or {@link yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly}. - *

- * @param node the node that should be updated - * @param y the desired y-coordinate of the given node - * @see yfiles.organic.InteractiveOrganicLayout#setCenterX - * @see yfiles.organic.InteractiveOrganicLayout#setCenter - */ - setCenterY(node:yfiles.algorithms.Node,y:number):void; - /** - * Schedules an update for the inertia of the given node. - *

- * The inertia is defined to be a value from the interval [0,1]. - *

- *
    - *
  • 1.0: The node will not move.
  • - *
  • 0.5: The node will only move half as far as it would with an inertia of 0.0.
  • - *
  • 0.0: The node will move as fast as possible.
  • - *
- *

- * This method can be used while layout calculation is in progress (e.g. for interactive layout scenarios). However, the - * change will not directly be applied to the graph itself but only stored internally as an intermediate result. Scheduled updates can be - * committed to the graph while the algorithm is running using methods {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} - * or {@link yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly}. - *

- * @param node the node whose inertia to set - * @param inertia an inertia value between 0 and 1 - * @throws {Stubs.Exceptions.ArgumentError} if the given inertia value is negative or greater than 1 - */ - setInertia(node:yfiles.algorithms.Node,inertia:number):void; - /** - * Schedules an update for the preferred length of the given edge. - *

- * This method can be used while layout calculation is in progress (e.g. for interactive layout scenarios). However, the - * change will not directly be applied to the graph itself but only stored internally as an intermediate result. Scheduled updates can be - * committed to the graph while the algorithm is running using methods {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} - * or {@link yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly}. - *

- * @param edge the edge whose preferred length should be updated - * @param newEdgeLength the new preferred edge length - */ - setPreferredEdgeLength(edge:yfiles.algorithms.Edge,newEdgeLength:number):void; - /** - * Schedules an update for the radius of the given node. - *

- * This method can be used while layout calculation is in progress (e.g. for interactive layout scenarios). However, the - * change will not directly be applied to the graph itself but only stored internally as an intermediate result. Scheduled updates can be - * committed to the graph while the algorithm is running using methods {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} - * or {@link yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly}. - *

- * @param node the node whose radius should be updated - * @param radius the desired radius for the given node - */ - setRadius(node:yfiles.algorithms.Node,radius:number):void; - /** - * Schedules an update for the stress value of the given node. - *

- * The stress value indicates how far a node will possibly move. The higher the stress of a node is, the farther it may - * move. - *

- *

- * This method can be used while layout calculation is in progress (e.g. for interactive layout scenarios). However, the - * change will not directly be applied to the graph itself but only stored internally as an intermediate result. Scheduled updates can be - * committed to the graph while the algorithm is running using methods {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} - * or {@link yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly}. - *

- *

- * The stress value is defined to be a value from the interval [0,1]. - *

- * @param node the node whose stress value should be updated - * @param stress a stress value from the interval [0,1] - * @throws {Stubs.Exceptions.ArgumentError} if the given stress value is negative or greater than 1 - */ - setStress(node:yfiles.algorithms.Node,stress:number):void; - /** - * Creates a {@link yfiles.organic.InteractiveOrganicLayoutExecutionContext context object} that provides methods to continue and {@link yfiles.organic.InteractiveOrganicLayoutExecutionContext#stopLayout stop} the layout calculation for running this layout - * algorithm in a single-threaded environment. - *

- * Usage: Call doLayout(long) on the created instance to run the actual layout calculation for some specified period of time, - * whenever the layout should be recalculated. To actually transfer the changes, {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} - * should be called subsequently. - *

- * @param graph the input graph - * @returns a {@link context instance} to control layout calculation - * @see yfiles.organic.InteractiveOrganicLayoutExecutionContext - * @see yfiles.organic.InteractiveOrganicLayout#applyLayout - */ - startLayout(graph:yfiles.layout.LayoutGraph):yfiles.organic.InteractiveOrganicLayoutExecutionContext; - /** - * Stops the layout algorithm. - *

- * In contrast to - * {@link yfiles.organic.InteractiveOrganicLayout#stopAndWait}, the algorithm terminates immediately and will not wait until the - * ongoing layout calculation is finished. - *

- * @see yfiles.organic.InteractiveOrganicLayout#stopped - * @see yfiles.organic.InteractiveOrganicLayout#stopAndWait - */ - stop():void; - /** - * Stops a previously {@link yfiles.organic.InteractiveOrganicLayout#startLayout started} algorithm and then blocks until the current layout calculation is completed. - * @see yfiles.organic.InteractiveOrganicLayout#stopped - * @see yfiles.organic.InteractiveOrganicLayout#stop - */ - stopAndWait():void; - /** - * Synchronizes the structure of the graph copy with the original graph. - * @throws {Stubs.Exceptions.InvalidOperationError} if the currently handled graph is not of type {@link yfiles.layout.CopiedLayoutGraph} - */ - syncStructure():void; - /** - * Wakes up the algorithm with the effect that it will restart/continue the layout calculation. - *

- * This method is useful if the layouter is {@link yfiles.organic.InteractiveOrganicLayout#sleeping sleeping} but should be notified of changes (e.g. due to user interaction). - *

- * @see yfiles.organic.InteractiveOrganicLayout#sleeping - */ - wakeUp():void; - /** - * Gets the time when the last wake-up, that is, call to {@link yfiles.organic.InteractiveOrganicLayout#wakeUp}, occurred. - *

- * The time is defined in terms of the difference between the current time and midnight, January 1, 1970 UTC, measured in - * milliseconds. - *

- * @type {number} - */ - lastWakeupTime:number; - /** - * Gets whether or not this layout algorithm has stopped. - *

- * If the algorithm has stopped, it terminated all its layout calculations. It is not {@link yfiles.organic.InteractiveOrganicLayout#running running} anymore and can not be - * restarted/continued by calling {@link yfiles.organic.InteractiveOrganicLayout#wakeUp}. - *

- * @type {boolean} - */ - stopped:boolean; - /** - * Gets whether or not this layout algorithm is currently sleeping. - *

- * Sleeping indicates that the algorithm has not {@link yfiles.organic.InteractiveOrganicLayout#stopped stopped} yet but is waiting (i.e. doing nothing). It can be notified to - * continue its work using {@link yfiles.organic.InteractiveOrganicLayout#wakeUp}. - *

- * @see yfiles.organic.InteractiveOrganicLayout#wakeUp - * @type {boolean} - */ - sleeping:boolean; - /** - * Gets whether or not this layout algorithm is currently running. - *

- * The algorithm is running if the layout process is still active, the algorithm has not {@link yfiles.organic.InteractiveOrganicLayout#stopped stopped} yet and is not {@link yfiles.organic.InteractiveOrganicLayout#sleeping sleeping}. - *

- * @type {boolean} - */ - running:boolean; - /** - * Gets or sets the working ratio which defines the amount of processor time this algorithm tries to get. - *

- * A working ratio value of 1 means that the algorithm will try to run as fast as possible. Lower values will lead to small - * breaks after each internal round. - *

- *

- * The ratio needs to be a value in (0,1]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given ratio is not in (0,1]. - * @type {number} - */ - workingRatio:number; - /** - * Gets or sets the default preferred edge length. - *

- * This length does not define the actual absolute length of edges, but the layout algorithm considers the specified - * preference where possible. - *

- *

- * The preferred edge length needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified edge length is negative - * @see yfiles.organic.InteractiveOrganicLayout#setPreferredEdgeLength - * @type {number} - */ - preferredEdgeLength:number; - /** - * Gets or sets the preferred distance between nodes. - *

- * The minimum node distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified minimum node distance is negative - * @type {number} - */ - preferredNodeDistance:number; - /** - * Gets or sets the maximum duration in milliseconds that this algorithm is allowed to run. - *

- * The duration needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified maximum duration has a negative value - * @type {number} - */ - maximumDuration:number; - /** - * Gets or sets the ratio of layout quality versus running time. - *

- * The larger the ratio, the better the quality of the resulting layout but the longer it may take to perform the layout - * calculation. - *

- *

- * The value needs to lie within [0,1]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified ratio is outside the interval [0,1] - * @type {number} - */ - qualityTimeRatio:number; - /** - * Gets or sets an {@link yfiles.organic.OutputRestriction} which restricts the area for the layout result of this algorithm. - * @see yfiles.organic.OutputRestriction - * @type {yfiles.organic.OutputRestriction} - */ - outputRestriction:yfiles.organic.OutputRestriction; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.InteractiveOrganicLayout; - } - /** - * This layout algorithm arranges graphs in an organic fashion. - *

- * Layout Style The organic layout style is characterized by a natural distribution of nodes that exhibits clusters and symmetric - * properties of the graph. Nodes are placed space-saving, close to their adjacent nodes. Edges maintain uniform lengths - * and are routed with straight-line segments without bends. - *

- *

- * Organic diagrams are commonly used for visualizing relations in large networks for example in bioinformatics, enterprise - * networking, visualizing social networks, mesh visualization or system management. - *

- *

- * {@graph {"ann": {"s": [30,30], "d": 1},"n": [[623,552], [719,500], [460,606], [461,312], [650,830], [467,417], [399,245], [710,595], [712,756], [423,492], [336,473], [387,373], [545,645], [883,702], [688,675], [507,226], [796,722], [667,62], [572,158], [470,158], [594,354], [520,352], [615,651], [687,222], [731,111], [950,654], [361,553], [309,325], [365,631], [722,895], [282,570], [496,729], [554,76], [211,540], [308,103], [256,489], [703,312], [850,621], [720,405], [333,181], [658,141], [281,421], [159,261], [791,555], [541,0], [574,864], [777,646], [513,518], [590,745], [611,221], [630,289], [557,278], [663,366], [237,274], [809,470], [874,520], [923,583], [889,446], [958,478], [999,550], [1020,624], [722,835], [626,922], [678,895], [251,867], [406,695], [235,779], [63,939], [130,979], [238,810], [355,820], [166,734], [147,828], [317,756], [94,705], [194,852], [127,898], [195,927], [68,863], [761,971], [693,970], [518,920], [637,1005], [714,1036], [255,203], [330,260], [976,402], [1039,447], [1078,551], [1105,411], [893,782], [958,741], [826,393], [0,980], [734,1109]], "e": [[0,1], [5,3], [6,3], [0,7], [8,4], [5,9,3.45,2.02,3.45,2.02], [5,9,-4.64,0,-4.64,0], [9,10], [5,11], [7,14], [14,8], [3,15], [8,16], [13,16], [15,18], [15,19], [5,21], [3,21], [21,20], [14,22], [0,22], [22,12], [25,13], [9,26], [11,27], [26,28], [4,29], [26,30], [18,32], [30,33], [10,35], [35,33], [23,36], [37,13], [36,38], [38,1], [6,39], [39,34], [18,40], [40,17], [40,24], [40,23], [10,41], [37,43], [43,1], [43,7], [32,44], [4,45], [7,46], [37,46], [46,16], [0,47], [0,47,0,-7.33,0,-7.33], [0,47,0,7.33,0,7.33], [47,2], [47,9,-1.25,4.32,-1.25,4.32], [47,5,-4.1,1.87,-4.1,1.87], [47,9,0,-4.68,0,-4.68], [47,5,4.94,0,4.94,0], [4,48], [22,48], [48,31], [18,49], [23,49], [36,50], [49,50], [50,20], [15,51], [49,51], [51,50], [51,21], [36,52], [52,20], [42,53], [53,27], [54,1], [55,43], [55,54], [56,37], [56,55], [56,25], [57,54], [57,58], [58,55], [58,59], [59,56], [59,60], [60,25], [61,4], [62,4], [4,63], [63,61], [2,65], [31,65], [28,65], [64,66], [68,67], [66,71], [69,72], [66,73], [73,65], [73,70], [73,69], [71,74], [66,75], [69,75], [72,76], [75,76], [76,67], [64,77], [75,77], [77,76], [77,68], [72,78], [78,67], [29,79], [63,80], [45,81], [62,82], [79,83], [80,83], [83,82], [39,84], [84,53], [85,6], [85,27], [58,86], [58,87], [59,88], [87,89], [13,90], [13,91], [54,92], [67,93], [83,94]], "vp": [0.0,0.0,1135.0,1139.0]}} Organic Layout obtained with default settings {@graph {"ann": {"s": [30,30], "d": 1},"n": [[563.5,1043.5], [1196.5,36.5], [-0.5,15.5], [871.5,537.5], [598.5,41.5], [315.5,513.5], [717.5,813.5], [590.5,599.5], [439.5,797.5], [635.5,935.5], [576.5,835.5], [502.5,928.5], [597.5,992.5], [568.5,943.5], [532.5,989.5], [682.5,878.5], [649.5,826.5], [622.5,877.5], [507.5,821.5], [464.5,867.5], [525.5,873.5], [809.5,683.5], [737.5,582.5], [688.5,691.5], [773.5,756.5], [750.5,704.5], [714.5,751.5], [846.5,612.5], [807.5,565.5], [788.5,622.5], [663.5,586.5], [641.5,642.5], [699.5,631.5], [446.5,567.5], [364.5,660.5], [482.5,680.5], [520.5,577.5], [478.5,619.5], [535.5,637.5], [378.5,544.5], [334.5,587.5], [391.5,602.5], [391.5,735.5], [451.5,736.5], [419.5,685.5], [1050.5,277.5], [915.5,36.5], [799.5,257.5], [974.5,416.5], [926.5,304.5], [851.5,397.5], [926.5,481.5], [910.5,424.5], [867.5,467.5], [1022.5,351.5], [991.5,300.5], [965.5,354.5], [861.5,283.5], [820.5,328.5], [877.5,341.5], [1127.5,150.5], [1065.5,34.5], [1011.5,140.5], [1095.5,217.5], [1070.5,162.5], [1035.5,209.5], [1165.5,90.5], [1134.5,34.5], [1107.5,87.5], [990.5,29.5], [966.5,84.5], [1024.5,79.5], [756.5,25.5], [706.5,139.5], [823.5,125.5], [837.5,19.5], [804.5,65.5], [863.5,73.5], [676.5,29.5], [655.5,86.5], [713.5,74.5], [748.5,202.5], [807.5,191.5], [766.5,147.5], [282.5,15.5], [142.5,256.5], [392.5,237.5], [442.5,8.5], [368.5,105.5], [486.5,125.5], [522.5,18.5], [481.5,59.5], [538.5,77.5], [360.5,-0.5], [332.5,51.5], [392.5,46.5], [383.5,171.5], [442.5,185.5], [425.5,128.5], [132.5,15.5], [64.5,127.5], [184.5,121.5], [207.5,9.5], [173.5,58.5], [231.5,64.5], [63.5,14.5], [28.5,68.5], [86.5,65.5], [97.5,194.5], [158.5,188.5], [122.5,141.5], [215.5,393.5], [339.5,373.5], [265.5,282.5], [168.5,329.5], [225.5,332.5], [200.5,278.5], [261.5,457.5], [321.5,442.5], [279.5,401.5], [371.5,307.5], [330.5,261.5], [313.5,318.5]], "e": [[0,12], [12,9], [9,13], [13,12], [13,11], [12,14], [11,14], [14,0], [14,13], [9,15], [15,6], [6,16], [16,15], [16,10], [15,17], [10,17], [17,9], [17,16], [10,18], [18,8], [8,19], [19,18], [19,11], [18,20], [11,20], [20,10], [20,19], [6,24], [24,21], [21,25], [25,24], [25,23], [24,26], [23,26], [26,6], [26,25], [21,27], [27,3], [3,28], [28,27], [28,22], [27,29], [22,29], [29,21], [29,28], [22,30], [30,7], [7,31], [31,30], [31,23], [30,32], [23,32], [32,22], [32,31], [7,36], [36,33], [33,37], [37,36], [37,35], [36,38], [35,38], [38,7], [38,37], [33,39], [39,5], [5,40], [40,39], [40,34], [39,41], [34,41], [41,33], [41,40], [34,42], [42,8], [8,43], [43,42], [43,35], [42,44], [35,44], [44,34], [44,43], [3,51], [51,48], [48,52], [52,51], [52,50], [51,53], [50,53], [53,3], [53,52], [48,54], [54,45], [45,55], [55,54], [55,49], [54,56], [49,56], [56,48], [56,55], [49,57], [57,47], [47,58], [58,57], [58,50], [57,59], [50,59], [59,49], [59,58], [45,63], [63,60], [60,64], [64,63], [64,62], [63,65], [62,65], [65,45], [65,64], [60,66], [66,1], [1,67], [67,66], [67,61], [66,68], [61,68], [68,60], [68,67], [61,69], [69,46], [46,70], [70,69], [70,62], [69,71], [62,71], [71,61], [71,70], [46,75], [75,72], [72,76], [76,75], [76,74], [75,77], [74,77], [77,46], [77,76], [72,78], [78,4], [4,79], [79,78], [79,73], [78,80], [73,80], [80,72], [80,79], [73,81], [81,47], [47,82], [82,81], [82,74], [81,83], [74,83], [83,73], [83,82], [4,90], [90,87], [87,91], [91,90], [91,89], [90,92], [89,92], [92,4], [92,91], [87,93], [93,84], [84,94], [94,93], [94,88], [93,95], [88,95], [95,87], [95,94], [88,96], [96,86], [86,97], [97,96], [97,89], [96,98], [89,98], [98,88], [98,97], [84,102], [102,99], [99,103], [103,102], [103,101], [102,104], [101,104], [104,84], [104,103], [99,105], [105,2], [2,106], [106,105], [106,100], [105,107], [100,107], [107,99], [107,106], [100,108], [108,85], [85,109], [109,108], [109,101], [108,110], [101,110], [110,100], [110,109], [85,114], [114,111], [111,115], [115,114], [115,113], [114,116], [113,116], [116,85], [116,115], [111,117], [117,5], [5,118], [118,117], [118,112], [117,119], [112,119], [119,111], [119,118], [112,120], [120,86], [86,121], [121,120], [121,113], [120,122], [113,122], [122,112], [122,121]], "vp": [-1.0,-1.0,1228.0,1075.0]}} Organic Layout exhibiting symmetric propertiesConcept{@link yfiles.organic.OrganicLayout} - * uses a force-directed approach to place the nodes of the input graph. According to this approach, the graph is modeled - * as a physical system with appropriate forces acting on it. Nodes are considered as electrically charged particles with - * mutually repulsive forces. Edges are modeled as springs that attract adjacent nodes. A good diagram is obtained from an - * equilibrium state of the system, i.e., the nodes are rearranged based on the physical forces until the system reaches a - * (local) minimum of the sum of the forces. Features - *

- *

- * The ratio between the layout quality and the running time is conveniently adjustable. - *

- *

- * This layout algorithm is able to consider a {@link yfiles.layout.PartitionGrid} structure. However, for common nodes (i.e. - * non-group nodes) it only considers single partition cells. Furthermore, the layout algorithm will throw a {@link yfiles.lang.Exception} - * if there is a partition grid and the descendants of a group node are assigned to different partition grid cells or if - * there are group nodes that are associated with a group node mode other than {@link yfiles.organic.GroupNodeMode#NORMAL}. - *

- *

- * Although overlaps between edges and nodes are avoided, this layout algorithm doesn't guarantee that they won't appear in - * the resulting layout. To avoid overlaps, it is possible to route the edges afterwards using an edge routing algorithm, - * e.g., {@link yfiles.router.OrganicEdgeRouter}. - *

- *

- * The algorithm is also able to detect certain types of substructures in a graph (i.e., {@link yfiles.organic.OrganicLayout#chainSubstructureStyle chains}, {@link yfiles.organic.OrganicLayout#starSubstructureStyle stars}, {@link yfiles.organic.OrganicLayout#cycleSubstructureStyle cycles} and - * {@link yfiles.organic.OrganicLayout#parallelSubstructureStyle parallel structures}) and arrange these structures with special-purpose layout styles. Using substructure styles ensures - * that the corrsponding structures are easily recognized in the graph. - *

- *

- * {@graph {"ann":{"s":[50,50],"d":0, "c":1},"n":[[651.02,746.2],[499.25,376.34],[757.43,840.9],[574.93,802.49],[772.23,780.83],[712.08,729.69],[591.5,342.9],[630.22,404.23],[511.3,574.88],[356.15,353.31],[488.74,447.78],[566.25,739.99],[832.31,791.39],[152.43,610.4],[689.57,879.35],[248.1,596.17],[120.25,697.57],[639.18,467.72],[427.77,458.88],[408.48,519.6],[691.9,669.45],[818.01,882.83],[539.8,660.71],[585.22,875.17],[636.28,814.7],[714.64,608.38],[656.9,343.12],[511.04,217.28],[470.75,277.59],[422.59,338.16],[565.7,413.55],[531.15,295.7],[348.61,180.63],[402.12,271.28],[284.34,91.79],[321.78,0],[381.55,66.78],[214.95,158.82],[187.52,306.65],[287.7,278.04],[92.76,309.88],[631.56,613.97],[513.18,814.11],[775.66,700.72],[601.82,679.52],[504.9,731.91],[697.17,813.09],[606.93,266.97],[450.55,583.13],[728.3,327.65],[717.42,253.29],[543.5,154.51],[614.76,150.96],[500.57,513.16],[360.14,445.09],[293.67,694],[348.53,611.5],[206.29,734.57],[571.37,553.51],[0,313.72],[233.88,6.24],[182.4,76.67],[420.47,398.21],[561.25,487.65],[680.21,183.49]],"e":[[0,2],[0,5],[0,3],[0,4],[1,7],[1,6],[1,8],[1,10],[1,9],[0,12],[0,14],[0,11],[15,13],[16,13],[1,17],[1,19],[1,18],[0,24],[0,22],[0,20],[0,23],[0,21],[1,58],[0,25],[0,58],[1,29],[1,31],[1,26],[1,27],[1,28],[1,30],[32,34],[1,33],[32,33],[36,34],[35,34],[37,34],[38,40],[38,39],[0,44],[0,41],[0,46],[0,43],[0,45],[0,42],[1,47],[48,8],[48,58],[48,10],[48,18],[48,19],[50,47],[51,47],[52,47],[49,47],[48,53],[48,54],[1,54],[1,53],[55,56],[56,15],[16,57],[57,55],[56,48],[39,33],[59,40],[60,34],[61,34],[1,62],[48,62],[1,63],[48,63],[64,47]],"vp":[0.0,0.0,883.0,933.0]}} Organic Layout without applying specific layout styles to substructures {@graph {"ann":{"s":[50,50],"d":0,"c":1},"n":[[222.41,751.98],[933.19,715.06],[333.12,751.98],[167.05,656.1],[111.7,751.98],[277.76,656.1],[1075.74,818.63],[987.64,882.64],[826.53,1248.81],[1109.39,715.06],[923.05,1325.6],[250.02,979.37],[167.05,847.86],[283.81,1327.29],[277.76,847.86],[357.8,1251.78],[312.21,1429.13],[1075.74,611.5],[946.75,1221.23],[879.92,1137.62],[451.47,751.98],[352.53,563.47],[425.23,858.43],[425.23,645.53],[352.53,940.5],[250.02,524.59],[790.64,611.5],[756.99,715.06],[790.64,818.63],[987.64,547.49],[878.74,882.64],[878.74,547.49],[1282.21,484.89],[1243.62,401.08],[1488.63,603.97],[1399.06,538.9],[1522.84,498.68],[1399.06,669.05],[1287.59,215.47],[1262.1,323.21],[1313.08,107.74],[50.95,600.08],[141.18,966.16],[0,806.8],[141.18,537.8],[50.95,903.88],[0,697.16],[765.65,208.84],[592.77,1142.94],[799.86,314.13],[799.86,103.55],[676.08,143.76],[676.08,273.91],[772.89,1137.75],[706.25,1221.5],[488.59,1379.94],[460.19,1278.11],[414.6,1455.45],[619.49,1010.84],[1338.57,0],[1522.84,709.26],[1599.34,603.97],[730.18,1325.82],[826.67,1372.15],[876.36,208.84]],"e":[[0,2],[0,5],[0,3],[0,4],[1,7],[1,6],[1,8],[1,10],[1,9],[0,12],[0,14],[0,11],[15,13],[16,13],[1,17],[1,19],[1,18],[0,24],[0,22],[0,20],[0,23],[0,21],[1,58],[0,25],[0,58],[1,29],[1,31],[1,26],[1,27],[1,28],[1,30],[32,34],[1,33],[32,33],[36,34],[35,34],[37,34],[38,40],[38,39],[0,44],[0,41],[0,46],[0,43],[0,45],[0,42],[1,47],[48,8],[48,58],[48,10],[48,18],[48,19],[50,47],[51,47],[52,47],[49,47],[48,53],[48,54],[1,54],[1,53],[55,56],[56,15],[16,57],[57,55],[56,48],[39,33],[59,40],[60,34],[61,34],[1,62],[48,62],[1,63],[48,63],[64,47]],"vp":[0.0,0.0,1650.0,1506.0]}} Organic Layout of the same graph applying - * specific layout styles to the detected substructures - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface OrganicLayout extends yfiles.layout.MultiStageLayout{} - export class OrganicLayout { - /** - * Creates a new {@link yfiles.organic.OrganicLayout} instance with default settings. - */ - constructor(); - /** - * Configures the given {@link yfiles.layout.ComponentLayout} to take fixed nodes in components into account. - *

- * Components that contain fixed nodes will not be rearranged. - *

- *

- * This method is called by {@link yfiles.organic.OrganicLayout#applyLayout} before the actual layout is calculated. It may be - * overridden in order to manually configure the {@link yfiles.layout.ComponentLayout}. - *

- * @param graph the input graph - * @param layouter the {@link } instance to reconfigure - * @see yfiles.organic.OrganicLayout#smartComponentLayout - * @protected - */ - configureComponentLayout(graph:yfiles.layout.LayoutGraph,layouter:yfiles.layout.ComponentLayout):void; - /** - * Disposes of the {@link yfiles.layout.ComponentLayout} instance. - *

- * This method is called by {@link yfiles.organic.OrganicLayout#applyLayout} after the actual layout is calculated. It may be - * overridden in order to revert a custom configuration made in {@link yfiles.organic.OrganicLayout#configureComponentLayout}. - *

- * @param graph the input graph - * @param layouter the {@link } to reset - * @see yfiles.organic.OrganicLayout#smartComponentLayout - * @protected - */ - disposeComponentLayout(graph:yfiles.layout.LayoutGraph,layouter:yfiles.layout.ComponentLayout):void; - /** - * Data provider key for specifying the directedness of edges - *

- * Generally, the organic layout algorithm doesn't consider the edge direction. Nevertheless, this {@link yfiles.algorithms.IDataProvider} - * allows the user to specify hints on the directedness of edges. More precisely, a value of 1 indicates that the edge - * should be considered to be directed from source to target, a value of -1 that it is directed from target to source, and - * a value of 0 means that it is undirected. - *

- *

- * Currently, the specified values are only considered during the detection of special substructures, see {@link yfiles.organic.OrganicLayout#chainSubstructureStyle}, {@link yfiles.organic.OrganicLayout#cycleSubstructureStyle}, {@link yfiles.organic.OrganicLayout#parallelSubstructureStyle} and {@link yfiles.organic.OrganicLayout#starSubstructureStyle}. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_DIRECTEDNESS_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for marking the nodes that are part of the relevant subset - * @see yfiles.organic.OrganicLayout#scope - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static AFFECTED_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for assigning individual modes for all group nodes - *

- * The modes specify how a group's content is handled and if it is resized during layout calculation. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static GROUP_NODE_MODE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for defining an individual preferred length for each edge - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static PREFERRED_EDGE_LENGTH_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * The group node compactness factor. - *

- * Values should be in the range [0..1], where 0 results in group nodes not affecting the overall layout too much, whereas - * a value of 1 forces nodes in the same group to be clustered tightly. - *
- * Note: the specified value is only considered if option AutomaticGroupNodeCompactionEnabled is disabled and if there is - * no partition grid structure. - *

- *

- * By default this value is 0.4. - *

- * @throws {Stubs.Exceptions.ArgumentError} if compactness value does not lie in [0..1] - * @type {number} - */ - groupNodeCompactness:number; - /** - * Gets or sets whether or not group nodes are compacted automatically. - *

- * When enabled, the compactness factor is determined automatically, i.e. it only depends on the general compactness - * specified by option {@link yfiles.organic.OrganicLayout#compactnessFactor}. - *

- * @see yfiles.organic.OrganicLayout#groupNodeCompactness - * @see yfiles.organic.OrganicLayout#compactnessFactor - * @type {boolean} - */ - automaticGroupNodeCompaction:boolean; - /** - * Gets or sets whether or not a clustering algorithm should be applied to the input graph. - *

- * When this option is enabled, the following steps are performed during the layout: - *

- *
    - *
  1. A clustering algorithm is applied to the input graph.
  2. - *
  3. All nodes of the same cluster are put into a newly created group node.
  4. - *
  5. The layout is applied to the modified graph.
  6. - *
  7. Group nodes denoting clusters (inserted during step 2) are removed.
  8. - *
- *

- * The user can also specify customized clusters by defining appropriate groups. - *

- * @see yfiles.organic.OrganicLayout#maximumDuration - * @type {boolean} - */ - clusterNodes:boolean; - /** - * Gets or sets the quality measure of the clustering algorithm. - *

- * The higher the value, the higher the clustering quality. - *

- *

- * The value needs to lie in [0,1]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified quality measure is outside the interval [0,1] - * @see yfiles.organic.OrganicLayout#clusterNodes - * @see yfiles.organic.OrganicLayout#maximumDuration - * @type {number} - */ - clusteringQuality:number; - /** - * Gets or sets whether or not to reserve space for node labels during layout calculation. - * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Gets or sets the {@link yfiles.layout.IGroupBoundsCalculator} instance used for calculating the size of group nodes. - * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.layout.IGroupBoundsCalculator} is null - * @type {yfiles.layout.IGroupBoundsCalculator} - */ - groupBoundsCalculator:yfiles.layout.IGroupBoundsCalculator; - /** - * Gets or sets whether or not this instance should configure the {@link yfiles.layout.ComponentLayout} to respect subsets of - * nodes. - *

- * When only a subset of nodes is placed by the layout algorithm, the fixed nodes will keep their locations even if they - * reside in different components. - *

- * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled - * @see yfiles.layout.MultiStageLayout#componentLayout - * @see yfiles.organic.OrganicLayout#scope - * @type {boolean} - */ - smartComponentLayout:boolean; - /** - * Gets or sets whether or not the layout algorithm tries to avoid node/edge overlaps. - * @see yfiles.organic.OrganicLayout#nodeOverlapsAllowed - * @type {boolean} - */ - nodeEdgeOverlapAvoided:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. - * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled - * @see yfiles.layout.MultiStageLayout#orientationLayout - * @see yfiles.layout.MultiStageLayout#layoutOrientation - * @see yfiles.layout.OrientationLayout - * @type {boolean} - */ - orientationLayoutEnabled:boolean; - /** - * Gets or sets the ratio of layout quality versus running time. - *

- * The larger the ratio, the better the quality of the resulting layout but the longer it may take to perform the layout - * calculation. - *

- *

- * The value needs to lie within [0,1]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified ratio is outside the interval [0,1] - * @type {number} - */ - qualityTimeRatio:number; - /** - * Gets or sets the maximum duration in milliseconds that this layout algorithm is allowed to run. - *

- * The duration needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified duration has a negative value - * @type {number} - */ - maximumDuration:number; - /** - * Gets or sets the scope that determines which nodes are placed by this algorithm. - * @throws {Stubs.Exceptions.ArgumentError} if the given scope is unknown - * @see yfiles.organic.OrganicLayout#AFFECTED_NODES_DP_KEY - * @type {yfiles.organic.Scope} - */ - scope:yfiles.organic.Scope; - /** - * Gets or sets the style specifier for chain substructures. - *

- * A chain is a simple edge path where the degree of the nodes is less than or equal to 2. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given style is unknown - * @see yfiles.organic.OrganicLayout#scope - * @see yfiles.organic.OrganicLayout#EDGE_DIRECTEDNESS_DP_KEY - * @type {yfiles.organic.ChainSubstructureStyle} - */ - chainSubstructureStyle:yfiles.organic.ChainSubstructureStyle; - /** - * Gets or sets the style specifier for cycle substructures. - *

- * A cycle is a simple edge path where the first and last node are identical. The algorithm only considers cycles where the - * number of edges connecting nodes of the cycle with the remaining nodes is less than or equal to 2. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given style is unknown - * @see yfiles.organic.OrganicLayout#scope - * @see yfiles.organic.OrganicLayout#EDGE_DIRECTEDNESS_DP_KEY - * @type {yfiles.organic.CycleSubstructureStyle} - */ - cycleSubstructureStyle:yfiles.organic.CycleSubstructureStyle; - /** - * Gets or sets the style specifier for parallel substructures. - *

- * A parallel structure consists of a set of nodes (called the inner nodes) such that all nodes have degree two and are - * connected to the same pair of neighbors (called the outer nodes). - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given style is unknown - * @see yfiles.organic.OrganicLayout#scope - * @see yfiles.organic.OrganicLayout#EDGE_DIRECTEDNESS_DP_KEY - * @type {yfiles.organic.ParallelSubstructureStyle} - */ - parallelSubstructureStyle:yfiles.organic.ParallelSubstructureStyle; - /** - * Gets or sets the style specifier for star substructures. - *

- * A star consists of a set of degree one nodes that are all connected to the same node (called the root of the star). - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given style is unknown - * @see yfiles.organic.OrganicLayout#scope - * @see yfiles.organic.OrganicLayout#EDGE_DIRECTEDNESS_DP_KEY - * @type {yfiles.organic.StarSubstructureStyle} - */ - starSubstructureStyle:yfiles.organic.StarSubstructureStyle; - /** - * Gets or sets the compactness factor for the layout algorithm. - *

- * Smaller values result in less compact drawings, greater values result in more compact drawings. - *

- *

- * The compactness value needs to lie in [0,1]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified value is outside the interval [0,1] - * @type {number} - */ - compactnessFactor:number; - /** - * Gets or sets the default preferred edge length. - *

- * If there is no specific preferred edge length assigned to an edge, this default preferred edge length is used. - *

- *

- * The preferred edge length needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified edge length is negative - * @see yfiles.organic.OrganicLayout#PREFERRED_EDGE_LENGTH_DP_KEY - * @type {number} - */ - preferredEdgeLength:number; - /** - * Gets or sets the minimum preferred distance between nodes and edges when node-edge overlaps are not allowed. - *

- * The minimum preferred distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - preferredMinimumNodeToEdgeDistance:number; - /** - * Gets or sets whether or not to consider node sizes during layout calculation. - *

- * If this option is enabled, the circumcircles of the nodes are used. If it is disabled, points will be used instead. - *

- * @type {boolean} - */ - considerNodeSizes:boolean; - /** - * Gets or sets whether or not the deterministic mode of this algorithm is enabled. - *

- * In deterministic mode, the layout algorithm will yield the same results if the exact same input and same settings are - * given as input. - *

- * @type {boolean} - */ - deterministic:boolean; - /** - * Gets or sets the minimum node distance that this algorithm should enforce between all pairs of nodes. - *

- * The minimum node distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified minimum node distance is negative - * @see yfiles.organic.OrganicLayout#nodeOverlapsAllowed - * @type {number} - */ - minimumNodeDistance:number; - /** - * Gets or sets whether or not overlaps between nodes are allowed. - * @see yfiles.organic.OrganicLayout#minimumNodeDistance - * @see yfiles.organic.OrganicLayout#scope - * @type {boolean} - */ - nodeOverlapsAllowed:boolean; - /** - * Gets or sets the area restriction for the result of the layout algorithm. - * @type {yfiles.organic.OutputRestriction} - */ - outputRestriction:yfiles.organic.OutputRestriction; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.OrganicLayout; - } - /** - * This layout stage enables support for handling a graph with a {@link yfiles.layout.PartitionGrid} structure. - *

- * Concept - *

- *

- * Before executing the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}, this stage prepares the grid structure of the graph accordingly, e.g., by hiding top-level grid - * nodes. Then, the core layout algorithm is applied to the graph. Finally, the grid is restored, configured and positioned - * such that it is consistent with the layout computed by the core algorithm. - *

- *

- * Information about the {@link yfiles.layout.PartitionGrid} structure is retrieved from a {@link yfiles.algorithms.IDataProvider} - * registered with the graph using key {@link yfiles.layout.PartitionGrid#PARTITION_GRID_DP_KEY}. - *

- *

- * Usage - *

- *

- * When using {@link yfiles.organic.OrganicLayout}, this stage will automatically be used, if required. It is not necessary to - * append this stage manually to {@link yfiles.organic.OrganicLayout}. - *

- *

- * Appending this stage can be useful to add support for {@link yfiles.layout.PartitionGrid partition grid} structures to other - * {@link yfiles.layout.ILayoutAlgorithm}s. - *

- *

- * The stage can be appended to all algorithms of type {@link yfiles.layout.MultiStageLayout} by using method - * {@link yfiles.layout.MultiStageLayout#appendStage}. - *

- * @see yfiles.layout.PartitionGrid - * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface OrganicPartitionGridLayoutStage extends yfiles.layout.LayoutStageBase{} - export class OrganicPartitionGridLayoutStage { - /** - * Creates a new instance of {@link yfiles.organic.OrganicPartitionGridLayoutStage} with the given layout algorithm as - * {@link yfiles.layout.LayoutStageBase#coreLayout core algorithm}. - * @param core the core layout algorithm - */ - constructor(core:yfiles.layout.ILayoutAlgorithm); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.OrganicPartitionGridLayoutStage; - } - /** - * This layout stage removes node overlaps while changes to the original layout structure are avoided and a specified - * minimum node distance is guaranteed. - *

- * Layout Style - *

- *

- * Unlike the overlap removal approach implemented by - * {@link yfiles.organic.RemoveOverlapsStage}, this stage tries to keep the original layout structure, i.e., it tries to keep the - * geometric distances between the nodes. - *

- *

- * The strategy for removing overlaps is similar to the layout strategy used by organic (force-directed) layout algorithms - * (e.g. - * {@link yfiles.organic.OrganicLayout}). Therefore, this stage is especially well suited to remove node overlaps in undirected - * graph drawings with straight-line edges, as produced by organic layout approaches. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":0,"c":1},"n":[[-264.13,89.64],[-109.95,153.19],[-68.91,-95.12],[-178.12,-35.61,60,60],[-88.42,-54.43],[-134.12,41.2],[-214.95,40.96,60,60],[-96.74,81.55,60,60],[-145.17,111.32],[-255.82,6.45],[-272.91,49.11],[-47.42,-39.94,60,60],[-645,65.04],[-507.21,54.41],[-586.74,40.54,60,60],[-488.66,89.42,60,60],[-539.17,115.13],[-488.66,132.42],[-636.26,24.59],[-645,46.48],[-468.9,-54.43],[-546.97,19.76,60,60],[-456.97,-40.24],[-447.21,-40.24,60,60],[-320.5,-180,1,1,4],[-320.5,251.5,1,1,4]],"e":[[2,3],[8,7],[5,7],[9,6],[6,5],[8,6],[0,6],[10,6],[3,6],[8,5],[7,6],[3,4],[4,2],[7,1],[8,1],[7,11],[20,21],[16,15],[13,15],[18,14],[14,13],[16,14],[12,14],[19,14],[21,14],[16,13],[15,14],[21,22],[22,20],[15,17],[16,17],[15,23],[24,25]],"vp":[-645.0,-182.0,658.0,436.0]}} A graph containing overlaps (left) and the result after applying this layout stageFeatures - *

- *

- * It is possible to define a {@link yfiles.organic.OrganicRemoveOverlapsStage#minimumNodeDistance minimum distance} between nodes. This feature allows to not only remove overlaps but forces - * nodes to keep the specified distance to other nodes. - *

- *

- * Nodes can be marked as fixed. Such nodes will not be moved during the overlap removal process. A {@link yfiles.algorithms.IDataProvider} - * with key {@link yfiles.organic.OrganicRemoveOverlapsStage#FIXED_NODE_DP_KEY} can be registered to mark the fixed nodes. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface OrganicRemoveOverlapsStage extends yfiles.layout.LayoutStageBase{} - export class OrganicRemoveOverlapsStage { - /** - * Creates a new instance of {@link yfiles.organic.OrganicRemoveOverlapsStage} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [core=null] The core layout algorithm. - */ - constructor(core?:yfiles.layout.ILayoutAlgorithm); - /** - * Data provider key for marking nodes as fixed - *

- * A node marked as fixed will not be moved by this algorithm but stay at its current position. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static FIXED_NODE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets the maximum duration in milliseconds that this layout stage is allowed to run. - *

- * This maximum time does not include the time required for the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- *

- * The duration needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified duration has a negative value - * @type {number} - */ - maximumDuration:number; - /** - * Gets or sets the minimum distance to be kept between any two nodes of the graph. - *

- * Due to this distance not only nodes that overlap will be moved to resolve the overlap, but also nodes which are too - * close to each other with respect to this distance will be displaced. - *

- *

- * The distance needs to be a non-negative value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given minimum distance is negative - * @type {number} - */ - minimumNodeDistance:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.OrganicRemoveOverlapsStage; - } - /** - * {@link yfiles.organic.OutputRestriction}s restrict the output area and the shape of a layout in conjunction with organic layout - * algorithms such as {@link yfiles.organic.OrganicLayout} or {@link yfiles.organic.InteractiveOrganicLayout}. - *

- * In consequence, all nodes need to be placed inside a specific restricted area. - *

- * @see yfiles.organic.OrganicLayout#outputRestriction - * @see yfiles.organic.InteractiveOrganicLayout#outputRestriction - * @class - */ - export interface OutputRestriction extends yfiles.lang.Object{} - export class OutputRestriction { - /** - * Creates an {@link yfiles.organic.OutputRestriction} that confines the layout result to a rectangular area which roughly complies - * with the given aspect ratio. - *

- * The aspect ratio is defined as the ratio between the width and the height of a layout. - *

- *
    - *
  • aspect ratio 1: width and height of the layout should be equal
  • - *
  • aspect ratio between 0 and 1: the height of a layout should be greater than its width
  • - *
  • aspect ratio larger than 1: the width of a layout should be greater than its height
  • - *
- *

- * The aspect ratio needs to be strictly positive. - *

- * @param ratio the preferred aspect ratio of the output - * @returns an {@link } imposing the given aspect ratio on the layout - * @throws {Stubs.Exceptions.ArgumentError} if the given aspect ratio is 0 or negative - * @see yfiles.organic.OrganicLayout#outputRestriction - * @see yfiles.organic.InteractiveOrganicLayout#outputRestriction - * @static - */ - static createAspectRatioRestriction(ratio:number):yfiles.organic.OutputRestriction; - /** - * Creates an {@link yfiles.organic.OutputRestriction} that confines the layout result to a circle. - *

- * The actual restriction circle is defined by the given coordinates and radius. - *

- *

- * The radius of the restriction circle needs to be greater than zero. - *

- * @param x the x-coordinate of the restriction circle's center - * @param y the y-coordinate of the restriction circle's center - * @param radius the radius of the restriction circle - * @returns the {@link } confining the layout to a circular area - * @throws {Stubs.Exceptions.ArgumentError} if the given radius is less than or equal to zero - * @see yfiles.organic.OrganicLayout#outputRestriction - * @see yfiles.organic.InteractiveOrganicLayout#outputRestriction - * @static - */ - static createCircularCageRestriction(x:number,y:number,radius:number):yfiles.organic.OutputRestriction; - /** - * Creates an {@link yfiles.organic.OutputRestriction} that confines the layout result to an elliptical area. - *

- * The restriction ellipse is defined by its bounding box specified by the given coordinates and size values. - *

- *

- * The main axes of the ellipse are parallel to the coordinate axes. - *

- *

- * The values for height and width of the ellipse's bounding box need to be greater than zero. - *

- * @param x the x-coordinate of the bounding box's upper left corner - * @param y the y-coordinate of the bounding box's upper left corner - * @param w the width of the bounding box - * @param h the height of the bounding box - * @returns the {@link } confining the layout to an elliptical area - * @throws {Stubs.Exceptions.ArgumentError} if the given width or height is 0 or negative - * @see yfiles.organic.OrganicLayout#outputRestriction - * @see yfiles.organic.InteractiveOrganicLayout#outputRestriction - * @static - */ - static createEllipticalCageRestriction(x:number,y:number,w:number,h:number):yfiles.organic.OutputRestriction; - /** - * Creates an {@link yfiles.organic.OutputRestriction} that confines the layout to a rectangular area. - *

- * This restriction rectangle is defined by the given coordinates and size values. - *

- *

- * The values for height and width of the rectangle need to be greater than zero. - *

- * @param x the x-coordinate of the restriction rectangle's upper-left corner - * @param y the y-coordinate of the restriction rectangle's upper-left corner - * @param w width of the restriction rectangle - * @param h height of the restriction rectangle - * @returns the {@link } confining the layout to a rectangular area - * @throws {Stubs.Exceptions.ArgumentError} if the given width or height is less than or equal to zero - * @see yfiles.organic.OrganicLayout#outputRestriction - * @see yfiles.organic.InteractiveOrganicLayout#outputRestriction - * @static - */ - static createRectangularCageRestriction(x:number,y:number,w:number,h:number):yfiles.organic.OutputRestriction; - /** - * This {@link yfiles.organic.OutputRestriction} does not restrict the output by any means. - *

- * It is a no-op that can be used when the output area and shape of a layout should be unrestricted. - *

- * @see yfiles.organic.OrganicLayout#outputRestriction - * @see yfiles.organic.InteractiveOrganicLayout#outputRestriction - * @const - * @static - * @type {yfiles.organic.OutputRestriction} - */ - static NONE:yfiles.organic.OutputRestriction; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.OutputRestriction; - } - /** - * This algorithm recursively removes node overlaps from a graph with a hierarchic group structure. - *

- * Basically, this algorithm combines a {@link yfiles.layout.RecursiveGroupLayout} with a specific customizable {@link yfiles.organic.RecursiveShuffleLayout#shuffleLayout shuffle algorithm} - * as its - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. The shuffle algorithm will be recursively applied to all groups of the input graph to remove node - * overlaps. - *

- *

- * {@graph {"ann":{"s":[50,50],"d":1},"n":[[158,104.94,384.5,224.75,2,[[158,127.31,384.5,22.38,"Group 1"]]],[173,142.31,175,172.38,2,[[173,164.69,175,22.38,"Group 2"]]],[205,187.69,60,30],[235,179.69,60,30],[225,249.69,60,30],[188,239.69,60,30],[407.5,177.69],[445,187.69,60,30],[432.5,203.38],[382.5,218.75],[295,242.31,155,177.88,2,[[295,264.69,155,22.38,"Group 3"]]],[310,279.69],[335,305.19],[360,329.69],[385,355.19],[469,265.25,50,154.94],[737.5,104.94,386,204.75,2,[[737.5,127.31,386,22.38,"Group 1"]]],[752.5,142.31,170,152.38,2,[[752.5,164.69,170,22.38,"Group 2"]]],[781.5,187.69,60,30],[847.5,179.69,60,30],[833.5,249.69,60,30],[767.5,239.69,60,30],[987,169.5],[1048.5,176.5,60,30],[1042,212.5],[974,225.5],[889.5,315.62,155,270.38,2,[[889.5,338,155,22.38,"Group 3"]]],[904.5,353],[929.5,409],[954.5,465],[979.5,521],[1063.5,324.84,50,154.94],[569.5,329.5,1,1,4],[706.5,329.5,1,1,4]],"e":[[32,33]],"vp":[158.0,104.0,966.0,482.0]}} Input graph (left) and result (right) after executing this algorithm with default settings - *

- *

- * Since this algorithm is a {@link yfiles.layout.ILayoutStage}, a {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} can be specified. In consequence, this - * algorithm will perform its work after the core algorithm was executed. - *

- * @see yfiles.organic.ShuffleLayout - * @see yfiles.layout.RecursiveGroupLayout - * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface RecursiveShuffleLayout extends yfiles.layout.LayoutStageBase{} - export class RecursiveShuffleLayout { - /** - * Creates a new {@link yfiles.organic.RecursiveShuffleLayout} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [core=null] The core layout algorithm. - */ - constructor(core?:yfiles.layout.ILayoutAlgorithm); - /** - * Gets or sets the {@link yfiles.layout.IGroupBoundsCalculator} instance that computes the sizes of all group nodes. - * @type {yfiles.layout.IGroupBoundsCalculator} - */ - groupBoundsCalculator:yfiles.layout.IGroupBoundsCalculator; - /** - * Gets or sets the {@link yfiles.layout.ILayoutAlgorithm} instance that is used for removing node overlaps. - *

- * This instance will be applied recursively to all group nodes of the graph. - *

- * @type {yfiles.layout.ILayoutAlgorithm} - */ - shuffleLayout:yfiles.layout.ILayoutAlgorithm; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.RecursiveShuffleLayout; - } - /** - * This {@link yfiles.layout.ILayoutStage} removes node overlaps and guarantees a certain minimum distance between nodes. - *

- * Layout Style This stage only removes overlaps between nodes of the input graph. To do so, overlapping nodes will be moved apart. - * Results often look like a stretched version of the original graph. {@graph {"ann":{"s":[30,30],"d":0,"c":1},"n":[[206,563.54],[343.79,552.91],[264.26,539.04,60,60],[362.34,587.92,60,60],[311.83,613.63],[362.34,630.92],[214.74,523.09],[206,544.98],[382.1,444.07],[304.03,518.26,60,60],[394.03,458.26],[403.79,458.26,60,60],[530.5,318.5,1,1,4],[530.5,750,1,1,4],[587.5,574.26],[819.5,549.26],[677.5,536.26,60,60],[847.5,609.26,60,60],[757.5,647.26],[838.5,680.26],[601.5,492.26],[587.5,533.26],[870.5,365.26],[748.5,503.26,60,60],[881.5,406.26],[922.5,406.26,60,60]],"e":[[8,9],[4,3],[1,3],[6,2],[2,1],[4,2],[0,2],[7,2],[9,2],[4,1],[3,2],[9,10],[10,8],[3,5],[4,5],[3,11],[12,13],[22,23],[18,17],[15,17],[20,16],[16,15],[18,16],[14,16],[21,16],[23,16],[18,15],[17,16],[23,24],[24,22],[17,19],[18,19],[17,25]],"vp":[206.0,317.0,777.0,436.0]}} A graph containing overlaps (left) and the result after the - * overlap removal Features - *

- *

- * It is possible to define a {@link yfiles.organic.RemoveOverlapsStage#minimumNodeDistance minimum distance} between nodes. This feature allows to not only remove overlaps but forces - * nodes to keep a specified distance to other nodes. - *

- * @class - * @implements {yfiles.layout.ILayoutStage} - */ - export interface RemoveOverlapsStage extends yfiles.lang.Object,yfiles.layout.ILayoutStage{} - export class RemoveOverlapsStage { - /** - * Creates a new {@link yfiles.organic.RemoveOverlapsStage} instance with a given {@link yfiles.organic.RemoveOverlapsStage#minimumNodeDistance minimum node distance}. - *

- * The minimum node distance needs to be non-negative. - *

- * @param minimumNodeDistance a non-negative minimum distance value - * @throws {Stubs.Exceptions.ArgumentError} if the given distance is negative - */ - constructor(minimumNodeDistance:number); - /** - * Removes node overlaps and displaces nodes of the given graph such that they keep the specified {@link yfiles.organic.RemoveOverlapsStage#minimumNodeDistance minimum distance} to each - * other. - *

- * If a {@link yfiles.organic.RemoveOverlapsStage#coreLayout core layout algorithm} is specified, it will be executed first. - *

- * @param graph the input graph - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Gets or sets the minimum distance to be kept between any two nodes of the graph. - *

- * Due to this distance not only nodes that overlap will be moved to resolve the overlap, but also nodes which are too - * close to each other with respect to this distance will be displaced. - *

- *

- * The minimum node distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given minimum distance is negative - * @type {number} - */ - minimumNodeDistance:number; - /** - * - * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.RemoveOverlapsStage; - } - /** - * This layout stage replaces edges by a path of split-edges with a specified length before it calls a {@link yfiles.organic.SplitEdgeStage#coreLayout core layout algorithm}. - *

- * Concept - *

- *

- * Each edge segment (or only segments that belong to a particular subset of edges) in the input graph will be split up - * into several segments such that all segments have a maximum length defined by the specified - * {@link yfiles.organic.SplitEdgeStage#splitSegmentLength split segment length}. If an edge segment is already shorter than the split segment length, then it will not be split - * up. - *

- *

- * At each split location, a dummy node (the so-called split-node) will be inserted. Split-nodes inserted for the same original edge - * and the actual source and target node of the original edge will be connected by so called - * split-edges. In consequence, the original source and target node are not connected by a single edge but by a path consisting of - * split-edges. Furthermore, all edges are simple straight lines. - *

- *

- * After this replacement step, the {@link yfiles.organic.SplitEdgeStage#coreLayout core layout algorithm} will be invoked. - *

- *

- * When the core layout algorithm has finished, the split-nodes will be removed from the graph and the original edge will - * be restored. The coordinates of the bends will be the center-coordinates of the corresponding split-node. - *

- *

- * Features - *

- *

- * The {@link yfiles.algorithms.IDataProvider} registered with key {@link yfiles.organic.SplitEdgeStage#splitNodesDpKey} can be used by the {@link yfiles.organic.SplitEdgeStage#coreLayout core layout algorithm} to determine whether - * or not a certain node is a split-node that was created by this stage. This information may be useful when providing a - * custom core layout algorithm which should handle split-nodes in a different way than normal nodes. If no {@link yfiles.algorithms.IDataProvider} - * is registered with this key, this information is dropped. - *

- *

- * By registering a {@link yfiles.algorithms.IDataProvider} with key {@link yfiles.organic.SplitEdgeStage#affectedEdgesDpKey}, the subset of edges that should be split by this layout - * stage can be specified. If no {@link yfiles.algorithms.IDataProvider} with this key is registered, all edges of the input graph - * will be split by the layout stage. - *

- *

- * The amount of split-nodes replacing a single original edge can be controlled via the - * {@link yfiles.organic.SplitEdgeStage#splitSegmentLength split segment length}. The smaller the value, the more split-nodes this stage will insert. - *

- * @class - * @implements {yfiles.layout.ILayoutStage} - */ - export interface SplitEdgeStage extends yfiles.lang.Object,yfiles.layout.ILayoutStage{} - export class SplitEdgeStage { - /** - * Creates a new {@link yfiles.organic.SplitEdgeStage} with default settings. - */ - constructor(); - /** - * Replaces the edges of the given graph by a path of split-edges, executes the {@link yfiles.organic.SplitEdgeStage#coreLayout core layout algorithm} and restores the - * original edges, introducing bends at the locations of the split-nodes. - * @param graph the input graph - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Gets or sets the {@link yfiles.algorithms.IDataProvider} key to determine which edges are to be split by this layout stage. - *

- * If no {@link yfiles.algorithms.IDataProvider} is registered with this key, all edges will be split. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @type {any} - */ - affectedEdgesDpKey:any; - /** - * Gets or sets the {@link yfiles.algorithms.IDataProvider} key for marking the nodes that were created by splitting edges, i.e., - * the split-nodes. - *

- * The information provided by the {@link yfiles.algorithms.IDataProvider} registered with this key is useful for the {@link yfiles.organic.SplitEdgeStage#coreLayout core layout algorithm} - * to know whether or not some node is a (dummy) split-node. After {@link yfiles.organic.SplitEdgeStage#applyLayout} finishes, the - * split-nodes will have been removed and this information will not be available anymore. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @type {any} - */ - splitNodesDpKey:any; - /** - * Gets or sets the maximum length for a split-edge. - *

- * The length of the original edge path divided by the given split segment length yields the number of nodes on the new - * path. - *

- *

- * The split segment length must be a strictly positive value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given split segment length is smaller than or equal to zero - * @type {number} - */ - splitSegmentLength:number; - /** - * Gets or sets the size of the split-nodes that are inserted when splitting edges. - *

- * The given size will be used for defining the height and the width of the split-nodes. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given size is negative - * @type {number} - */ - splitNodeSize:number; - /** - * - * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.SplitEdgeStage; - } - /** - * Specifies custom data for the {@link yfiles.organic.OrganicLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface OrganicLayoutData extends yfiles.layout.LayoutData{} - export class OrganicLayoutData { - constructor(); - /** - * Gets or sets the collection of nodes that is laid out by the layout. - * @see yfiles.organic.OrganicLayout#AFFECTED_NODES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - affectedNodes:yfiles.layout.ItemCollection; - /** - * Gets or sets the mapping from edges to their preferred edge length. - * @see yfiles.organic.OrganicLayout#PREFERRED_EDGE_LENGTH_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - preferredEdgeLengths:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their minimum distance to other nodes. - *

- * Note that the distances are only considered by the internally used {@link yfiles.organic.ShuffleLayout} when {@link yfiles.organic.OrganicLayout#nodeOverlapsAllowed} is true and {@link yfiles.organic.OrganicLayout#scope} is - * not {@link yfiles.organic.Scope#ALL}. - *

- * @see yfiles.organic.ShuffleLayout#MINIMUM_DISTANCE_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - minimumNodeDistances:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from group nodes to a mode constant describing how to handle the group node. - *

- * The algorithm expects for each group node to find one of the following constants or null: - *

    - *
  • - * {@link yfiles.organic.GroupNodeMode#NORMAL} - *
  • - *
  • - * {@link yfiles.organic.GroupNodeMode#FIX_BOUNDS} - *
  • - *
  • - * {@link yfiles.organic.GroupNodeMode#FIX_CONTENTS} - *
  • - *
- *

- * @see yfiles.organic.OrganicLayout#GROUP_NODE_MODE_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - groupNodeModes:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the partition grid layout data. - * @type {yfiles.layout.PartitionGridData} - */ - partitionGridData:yfiles.layout.PartitionGridData; - /** - * Gets or sets the mapping from edges to their directedness. - *

- * Generally, the organic layout algorithm doesn't consider the edge direction. Nevertheless, this property allows the user - * to specify hints on the directedness of edges. More precisely, a value of 1 indicates that the edge should be considered - * to be directed from source to target, a value of -1 that it is directed from target to source, and a value of 0 means - * that it is undirected. - *

- *

- * Currently, the specified values are only considered during the detection of special substructures, see {@link yfiles.organic.OrganicLayout#chainSubstructureStyle}, {@link yfiles.organic.OrganicLayout#cycleSubstructureStyle}, {@link yfiles.organic.OrganicLayout#parallelSubstructureStyle} and {@link yfiles.organic.OrganicLayout#starSubstructureStyle}. - *

- * @see yfiles.organic.OrganicLayout#EDGE_DIRECTEDNESS_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeDirectedness:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.organic.OrganicLayoutData; - } - }export namespace router{ - /** - * {@link yfiles.router.ParallelEdgeRouter} is a {@link yfiles.layout.ILayoutStage} that routes parallel edges which connect the same pair - * of nodes in a graph. - *

- * Layout Style The edge paths of parallel edges consist of parallel segments. At the end points, the edges can either still be - * parallel or {@link yfiles.router.ParallelEdgeRouter#joinEnds joined in one point}. {@graph {"ann":{"s":[30,30],"d":0,"c":1},"n":[[198,216],[54,226],[0,93],[110,0],[232,76],[119,122]],"e":[[1,0],[2,1],[3,2],[0,4],[4,3],[2,5,[43.96,125.35,100.3,139.08]],[2,5,[48.7,105.92,105.04,119.65]],[2,5,[51.07,96.2,107.4,109.93]],[3,5,[147.32,45.67,151.57,103.38]],[1,5,[77.62,208.34,108.42,159.06]],[1,5,[69.14,203.04,99.94,153.76]],[0,5,[184.58,212.72,147.11,168.14]],[0,5,[176.92,219.16,139.46,174.58]],[5,3,[141.6,104.12,137.34,46.41]],[5,3,[121.66,105.59,117.4,47.88]],[5,3,[111.68,106.33,107.43,48.62]],[5,4,[171.36,143.38,224.72,121.66]],[5,4,[167.59,134.12,220.95,112.4]],[5,4,[160.05,115.6,213.41,93.88]],[5,2,[97.93,148.8,41.6,135.07]],[5,4,[156.28,106.34,209.64,84.62]],[5,0,[162.42,155.28,199.89,199.86]],[5,0,[170.08,148.84,207.54,193.42]],[5,1,[125.38,169.66,94.58,218.94]],[5,1,[133.86,174.96,103.06,224.24]],[1,5,1],[2,5,1],[0,5,1],[5,3,1],[5,4,1]],"vp":[0.0,0.0,262.0,256.0]}} - *

- *

- * The master edge determining the routing is highlighted - *

- *

- * Concept {@link yfiles.router.ParallelEdgeRouter} performs four basic steps: - *

- *
    - *
  1. Remove all parallel edges from the input graph, leaving one master edge in the graph
  2. - *
  3. Invoke the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} on the graph without parallel edges
  4. - *
  5. Reinsert all previously removed edges
  6. - *
  7. Route the parallel edges
  8. - *
- *

- * Features - *

- *

- * {@link yfiles.router.ParallelEdgeRouter} can either be used as a {@link yfiles.layout.ILayoutStage} wrapping a {@link yfiles.layout.ILayoutAlgorithm layout algorithm} which - * cannot handle parallel edges. Then it will hide the parallel edges from this {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} and take over the - * routing of them. - *
- * If no {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} is specified, {@link yfiles.router.ParallelEdgeRouter} can work alone. It will route only the - * parallel edges and keep the remaining graph unchanged. - *

- *

- * Parallel edges can either be all edges between the same two nodes, ignoring the direction, or edges are only considered - * parallel if they share the same source node and target node. Hence, they share the same {@link yfiles.router.ParallelEdgeRouter#directedMode direction}. - *

- *

- * To make sure that the ports of all parallel edges are on the end nodes, the first and last segments can be - * {@link yfiles.router.ParallelEdgeRouter#joinEnds joined}. However, these segments won't be parallel. - *

- *

- * There are two ways to define the distance between two parallel edges. First, an absolute distance can be {@link yfiles.router.ParallelEdgeRouter#lineDistance defined}. - * Parallel segments will keep this distance. Second, the distance can be - * {@link yfiles.router.ParallelEdgeRouter#adaptiveLineDistances determined relative to the node bounds}. Depending on the size of the nodes and the number of parallel edges between - * them, the distance between parallel edges is adjusted. This will keep the edges straight in most cases. - *

- *

- * It is possible to select - * {@link yfiles.router.ParallelEdgeRouter#LEADING_EDGE_DP_KEY custom master edges}. All edges that are parallel to the selected edges will be temporarily removed. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface ParallelEdgeRouter extends yfiles.layout.LayoutStageBase{} - export class ParallelEdgeRouter { - /** - * Creates a new {@link yfiles.router.ParallelEdgeRouter} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] The core layout algorithm. - * @see yfiles.layout.LayoutStageBase#coreLayout - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Hides all parallel edges leaving a master edge in the graph. - *

- * {@link yfiles.router.ParallelEdgeRouter} detects parallel edges of the given graph. From each set of parallel edges it hides all - * but one edge from the given graph. - *

- *

- * This method is called before invoking the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. It may be overridden to change the selection of leading - * edges. Hidden edges should be stored in {@link yfiles.router.ParallelEdgeRouter#hiddenEdges} to enable un-hiding later on. - *

- * @param graph the input graph - * @see yfiles.router.ParallelEdgeRouter#directedMode - * @see yfiles.router.ParallelEdgeRouter#AFFECTED_EDGES_DP_KEY - * @protected - */ - findAndHideParallelEdges(graph:yfiles.algorithms.Graph):void; - /** - * Assigns a layout to all parallel edges. - *

- * The layout for each parallel edge follows the layout of the master edge which was not removed from the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- *

- * This method is called when the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} is finished. It may be overridden to introduce a custom routing for - * parallel edges. - *

- * @param graph the graph after the core layout - * @param parallelEdges the map that provides all parallel edges for each master edge - * @see yfiles.router.ParallelEdgeRouter#joinEnds - * @see yfiles.router.ParallelEdgeRouter#adaptiveLineDistances - * @see yfiles.router.ParallelEdgeRouter#adjustLeadingEdge - * @protected - */ - layoutParallelEdges(graph:yfiles.layout.LayoutGraph,parallelEdges:yfiles.algorithms.IEdgeMap):void; - /** - * Data provider key for marking edges that will be routed - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for specifying the master edges - *

- * Marked edges won't be removed for the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. All edges parallel to the master edges will get parallel paths. - *

- *

- * If no leading edge is specified for a bundle of parallel edges, it will be determined automatically. If there is more - * than one leading edge, the first one is chosen. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static LEADING_EDGE_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Holds the list of parallel edges that are hidden from the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @protected - * @type {yfiles.algorithms.EdgeList} - */ - hiddenEdges:yfiles.algorithms.EdgeList; - /** - * {@link yfiles.algorithms.IEdgeMap} that associates a hidden edge with the unique parallel edge not hidden from the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @type {yfiles.algorithms.IEdgeMap} - */ - parallelEdges:yfiles.algorithms.IEdgeMap; - /** - * Gets or sets whether or not the direction of edges should be considered. - *

- * In directed mode, only edges that share the same source and target node will be routed in parallel. Edges that connect - * to the same nodes but in different directions won't be considered parallel. - *

- *

- * In undirected mode, all edges connecting the same pair of nodes will be routed in parallel. - *

- * @type {boolean} - */ - directedMode:boolean; - /** - * Gets or sets whether or not the distances between parallel edges should be determined automatically according to the - * sizes of their source and target nodes. - *

- * If enabled, the distances between edges are chosen such that all parallel edges can be drawn as straight lines and still - * connect to the nodes' bounds. - *

- * @see yfiles.router.ParallelEdgeRouter#lineDistance - * @type {boolean} - */ - adaptiveLineDistances:boolean; - /** - * Gets or sets the distance between two adjacent edge paths that run in parallel. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is less than 0 - * @see yfiles.router.ParallelEdgeRouter#adaptiveLineDistances - * @type {number} - */ - lineDistance:number; - /** - * Gets or sets whether or not to join end points of parallel edges. - *

- * If enabled, all edges end with non-parallel segments that connect at the same point to the node. Otherwise, all segments - * of the edges are parallel. In this case, some edges may not connect to the nodes' bounds. - *

- * @see yfiles.router.ParallelEdgeRouter#absJoinEndDistance - * @see yfiles.router.ParallelEdgeRouter#relJoinEndDistance - * @type {boolean} - */ - joinEnds:boolean; - /** - * Gets or sets the absolute distance from the end point of the joined lines to the first parallel segments. - *

- * The absolute distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @see yfiles.router.ParallelEdgeRouter#joinEnds - * @see yfiles.router.ParallelEdgeRouter#relJoinEndDistance - * @type {number} - */ - absJoinEndDistance:number; - /** - * Gets or sets the relative distance from the end point of the joined lines to the first parallel segments. - *

- * The length is relative to the corresponding original segment's length. It needs to have a value in the interval [0,1]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified relative distance is less than 0 or greater than 1 - * @see yfiles.router.ParallelEdgeRouter#joinEnds - * @see yfiles.router.ParallelEdgeRouter#absJoinEndDistance - * @type {number} - */ - relJoinEndDistance:number; - /** - * Gets or sets whether or not to adjust the leading edge to obtain more symmetric results. - * @type {boolean} - */ - adjustLeadingEdge:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.ParallelEdgeRouter; - } - export enum Scope{ - /** - * A scope specifier which defines that all edges of the input graph will be routed. - * @see yfiles.router.BusRouter#scope - */ - ROUTE_ALL_EDGES, - /** - * A scope specifier which defines that only the selected edges of the input graph will be routed. - *

- * The selection state of an edge is determined by a boolean value returned by a {@link yfiles.algorithms.IDataProvider} registered - * with key {@link yfiles.router.BusRouter#affectedEdgesDpKey}. - *

- *

- * All other non-selected edges will be considered to have fixed routes. - *

- * @see yfiles.router.BusRouter#scope - * @see yfiles.router.BusRouter#affectedEdgesDpKey - * @see yfiles.router.BusRouter#DEFAULT_AFFECTED_EDGES_DP_KEY - */ - ROUTE_AFFECTED_EDGES, - /** - * A scope specifier which defines that only edges incident to selected nodes will be routed. - *

- * The selection state of a node is determined by a boolean value returned by a {@link yfiles.algorithms.IDataProvider} registered - * with key {@link yfiles.router.EdgeRouter#affectedNodesDpKey}. - *

- *

- * All other edges that are incident to non-selected nodes will be considered to have fixed routes. - *

- * @see yfiles.router.EdgeRouter#scope - * @see yfiles.router.EdgeRouter#affectedNodesDpKey - */ - ROUTE_EDGES_AT_AFFECTED_NODES - } - export enum MonotonicPathRestriction{ - /** - * A constant specifying that there are no monotonic edge path restrictions. - * @see yfiles.router.EdgeLayoutDescriptor#monotonicPathRestriction - */ - NONE, - /** - * A constant specifying monotonic edge path restrictions for the vertical direction. - *

- * This implies that each vertical edge segment is directed from the source to the target. - *

- * @see yfiles.router.EdgeLayoutDescriptor#monotonicPathRestriction - */ - VERTICAL, - /** - * A constant specifying monotonic edge path restrictions for the horizontal direction. - *

- * This implies that each horizontal edge segment is directed from the source to the target. - *

- * @see yfiles.router.EdgeLayoutDescriptor#monotonicPathRestriction - */ - HORIZONTAL, - /** - * A constant specifying monotonic edge path restrictions for the horizontal and vertical direction. - *

- * This implies that each horizontal as well as each vertical edge segment is directed from the source to the target. - *

- * @see yfiles.router.EdgeLayoutDescriptor#monotonicPathRestriction - */ - BOTH - } - /** - * This edge routing algorithm routes edges as straight-lines considering the specified {@link yfiles.layout.PortConstraint}s. - *

- * Layout Style The edges connect to their ports with straight-lines. This may lead to edges crossing nodes. {@graph {"ann":{"s":[30,30],"d":1},"n":[[591,590],[157,454],[558,361],[665,476],[466,502],[335,663],[230,267],[350,325],[17,519],[187,590],[248,387],[145,310],[464,337],[310,506],[670,151],[220,106],[697,285],[522,187],[457,2],[111,0],[305,5],[375,139],[0,260]],"e":[[0,3],[3,2],[4,0],[1,6],[6,7],[7,2],[1,8],[1,9],[10,7],[10,11],[11,7],[12,4],[12,7],[5,13],[9,13],[1,13],[7,13],[4,13],[15,6],[14,16],[16,2],[12,17],[17,14],[15,19],[15,20],[18,21],[20,21],[15,21],[17,21],[7,21],[11,22]],"vp":[0.0,0.0,727.0,693.0]}}Concept{@link yfiles.router.StraightLineEdgeRouter} - * will first invoke the {@link yfiles.layout.LayoutStageBase#coreLayout} if one exists. Then, it will remove all bends from the edges and will place the ports either on - * the center of the nodes or at a location specified by a {@link yfiles.layout.PortConstraint}. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface StraightLineEdgeRouter extends yfiles.layout.LayoutStageBase{} - export class StraightLineEdgeRouter { - /** - * Creates a new instance of {@link yfiles.router.StraightLineEdgeRouter} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [core=null] The core layout algorithm. - */ - constructor(core?:yfiles.layout.ILayoutAlgorithm); - /** - * Gets or sets the (sub-)set of edges to be routed. - *

- * {@link yfiles.router.StraightLineEdgeRouter} will only route those edges and leave the remaining edges unchanged. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given argument is an unknown specifier - * @see yfiles.router.StraightLineEdgeRouter#affectedEdgesDpKey - * @see yfiles.router.StraightLineEdgeRouter#affectedNodesDpKey - * @type {yfiles.router.Scope} - */ - scope:yfiles.router.Scope; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that provides the selected state of the nodes of the - * graph. - *

- * If the scope only includes {@link yfiles.router.Scope#ROUTE_EDGES_AT_AFFECTED_NODES edges at selected nodes}, only edges of the nodes marked in this {@link yfiles.algorithms.IDataProvider} - * are routed while all other edges are considered to have fixed routes. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @see yfiles.router.StraightLineEdgeRouter#scope - * @type {any} - */ - affectedNodesDpKey:any; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that provides the selected state of the edges of the - * graph. - *

- * If the scope only includes {@link yfiles.router.Scope#ROUTE_AFFECTED_EDGES selected edges}, only edges of the nodes marked in this {@link yfiles.algorithms.IDataProvider} are - * routed while all other edges are considered to have fixed routes. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @see yfiles.router.StraightLineEdgeRouter#scope - * @type {any} - */ - affectedEdgesDpKey:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.StraightLineEdgeRouter; - } - /** - * This class describes the location and the direction from which a given {@link yfiles.router.PartitionCell partition cell} has been entered during a path - * search. - *

- * The path that was followed in order to reach a given {@link yfiles.router.PartitionCell partition cell} can be reconstructed by traversing all - * {@link yfiles.router.CellEntrance#previousEntrance previous entrances}. The {@link yfiles.router.CellEntrance#enterInterval enter interval} and {@link yfiles.router.CellEntrance#enterDirection enter direction} determine how the {@link yfiles.router.PartitionCell partition cell} was entered. - *

- * @class - */ - export interface CellEntrance extends yfiles.lang.Object{} - export class CellEntrance { - /** - * Creates a new {@link yfiles.router.CellEntrance} instance that is a copy of a given other {@link yfiles.router.CellEntrance}. - * @param other the {@link } to be copied - */ - constructor(other:yfiles.router.CellEntrance); - /** - * Creates a new {@link yfiles.router.CellEntrance} instance for a given {@link yfiles.router.PartitionCell}. - * @param cell the {@link } that is entered - */ - constructor(cell:yfiles.router.PartitionCell); - /** - * Gets the {@link yfiles.router.PartitionCell partition cell} of this {@link yfiles.router.CellEntrance} instance. - * @type {yfiles.router.PartitionCell} - */ - cell:yfiles.router.PartitionCell; - /** - * Gets or sets the previous {@link yfiles.router.CellEntrance} along the path that was traversed in order to reach the {@link yfiles.router.CellEntrance#cell cell}. - * @type {yfiles.router.CellEntrance} - */ - previousEntrance:yfiles.router.CellEntrance; - /** - * Gets or sets the {@link yfiles.router.OrthogonalInterval} that was used for entering this {@link yfiles.router.CellEntrance#cell cell}. - * @type {yfiles.router.OrthogonalInterval} - */ - enterInterval:yfiles.router.OrthogonalInterval; - /** - * Gets or sets the direction from which this {@link yfiles.router.CellEntrance#cell cell} was entered. - * @type {yfiles.layout.Direction} - */ - enterDirection:yfiles.layout.Direction; - /** - * Gets or sets the costs for the implicit path given by the {@link yfiles.router.CellEntrance#previousEntrance previous entrances}. - *

- * The costs must be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the costs are negative - * @type {number} - */ - costs:number; - /** - * Gets or sets the heuristic costs for the implicit path given by the {@link yfiles.router.CellEntrance#previousEntrance previous entrances}. - *

- * Heuristic costs must be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the heuristic costs are negative - * @type {number} - */ - heuristicCosts:number; - /** - * Gets or sets the {@link yfiles.router.EdgeCellInfo} describing how the previous {@link yfiles.router.PartitionCell partition cell} was traversed. - * @type {yfiles.router.EdgeCellInfo} - */ - previousEdgeCellInfo:yfiles.router.EdgeCellInfo; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.CellEntrance; - } - /** - * This class stores information about the part of an edge segment that lies inside a specified {@link yfiles.router.PartitionCell partition cell}. - * @class - * @extends {yfiles.router.SegmentInfoBase} - */ - export interface CellSegmentInfo extends yfiles.router.SegmentInfoBase{} - export class CellSegmentInfo { - /** - * Creates a new {@link yfiles.router.CellSegmentInfo} instance. - * @param edge the edge to which the segment of this info belongs - * @param segmentIndex the index of the segment to which this info belongs - * @param direction the direction to which the segment of this info points - * @param locationRange the range within which the common location of this segment has to lie - * @param minExtension the minimum interval in extension direction this segment part is known to intersect - * @param maxExtension the maximum interval in extension direction this segment part will span - * @param cell the partition cell within which this part of the edge segment lies - */ - constructor(edge:yfiles.algorithms.Edge,segmentIndex:number,direction:yfiles.layout.Direction,locationRange:yfiles.router.Interval,minExtension:yfiles.router.Interval,maxExtension:yfiles.router.Interval,cell:yfiles.router.PartitionCell); - /** - * Gets the direction to which the segment of this info points. - * @type {yfiles.layout.Direction} - */ - direction:yfiles.layout.Direction; - /** - * Gets the {@link yfiles.router.PartitionCell partition cell} within which this part of the edge segment lies. - * @type {yfiles.router.PartitionCell} - */ - cell:yfiles.router.PartitionCell; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.CellSegmentInfo; - } - /** - * This class describes a channel, i.e., a set of vertical or horizontal edge segments whose locations depend on each - * other. - *

- * Channels are used by the {@link yfiles.router.ChannelBasedPathRouting} to route edges using - * {@link yfiles.router.SegmentInfo}s describing their path. - *

- * @class - */ - export interface Channel extends yfiles.lang.Object{} - export class Channel { - /** - * Creates a new {@link yfiles.router.Channel} that contains the given {@link yfiles.router.SegmentInfo segment info}. - * @param segment the given segment info for which the {@link } is created - * @throws {Stubs.Exceptions.ArgumentError} if the given segment has a different orientation than the other segments already contained in the channel - */ - constructor(segment:yfiles.router.SegmentInfo); - /** - * Adds a new {@link yfiles.router.SegmentInfo segment info} to the {@link yfiles.router.Channel channel}. - * @param segment the segment info to be added to this channel - * @throws {Stubs.Exceptions.ArgumentError} if the given segment has a different orientation than the other segments already contained in the channel - */ - addSegment(segment:yfiles.router.SegmentInfo):void; - /** - * Adds a {@link yfiles.router.SegmentGroup segment group} to this {@link yfiles.router.Channel channel}. - * @param group the segment group to be added - */ - addSegmentGroup(group:yfiles.router.SegmentGroup):void; - /** - * Returns the current location that the given {@link yfiles.router.SegmentInfo segment info} has been assigned within its {@link yfiles.router.SegmentInfoBase#locationRange location range}. - * @param segmentInfo the segment info for which the current location will be returned - * @returns the current location of the segment info or {@link #NaN} if no location has been assigned before - * @see yfiles.router.Channel#setCurrentLocation - */ - getCurrentLocation(segmentInfo:yfiles.router.SegmentInfo):number; - /** - * Returns the {@link yfiles.router.SegmentInfo segment info} with the given index in the list of segments of this {@link yfiles.router.Channel channel}. - * @param index the index of the segment in the list of segments - * @returns the {@link segment info} with the given index in the list of segments - */ - getSegment(index:number):yfiles.router.SegmentInfo; - /** - * Returns the {@link yfiles.router.SegmentGroup segment group} with the given index in this {@link yfiles.router.Channel channel}. - * @param index the index of the segment group - * @returns the {@link segment group} with the given index in this channel - */ - getSegmentGroup(index:number):yfiles.router.SegmentGroup; - /** - * Returns the number of {@link yfiles.router.SegmentInfo segment infos} in this channel. - * @returns the number of segment infos in this channel - */ - segmentCount():number; - /** - * Returns the number of {@link yfiles.router.SegmentGroup segment groups} in this {@link yfiles.router.Channel channel}. - * @returns the number of segment groups in this channel - */ - segmentGroupCount():number; - /** - * Specifies the current location that the given {@link yfiles.router.SegmentInfo segment info} has been assigned within its {@link yfiles.router.SegmentInfoBase#locationRange location range}. - *

- * During the distribution of the segments in the channel, different locations can be assigned but only the last one is - * finally assigned to the {@link yfiles.router.SegmentInfo segment info}. - *

- * @param segmentInfo the segment info for which the current location will be set - * @param location the location of the segment info within its location range - * @see yfiles.router.SegmentInfoBase#location - */ - setCurrentLocation(segmentInfo:yfiles.router.SegmentInfo,location:number):void; - /** - * Gets an {@link yfiles.router.Interval interval} spanning the union of the location ranges of the {@link yfiles.router.SegmentInfo segment infos}. - * @see yfiles.router.SegmentInfoBase#locationRange - * @type {yfiles.router.Interval} - */ - widthInterval:yfiles.router.Interval; - /** - * Gets an {@link yfiles.router.Interval interval} spanning the union of the maximum extension of the {@link yfiles.router.SegmentInfo segment infos}. - * @see yfiles.router.SegmentInfoBase#maxExtension - * @type {yfiles.router.Interval} - */ - lengthInterval:yfiles.router.Interval; - /** - * Gets whether or not the segments in this {@link yfiles.router.Channel channel} are vertical. - * @type {boolean} - */ - vertical:boolean; - /** - * Gets the bounds of this {@link yfiles.router.Channel channel}. - *

- * These bounds are determined by the channel's {@link yfiles.router.Channel#widthInterval width} and {@link yfiles.router.Channel#lengthInterval length}. - *

- * @see yfiles.router.Channel#widthInterval - * @see yfiles.router.Channel#lengthInterval - * @type {yfiles.algorithms.YRectangle} - */ - bounds:yfiles.algorithms.YRectangle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.Channel; - } - /** - * This class routes edges using their pre-calculated {@link yfiles.router.Path} information. - *

- * The concept of this algorithm is to bundle edge {@link yfiles.router.SegmentInfo segment}s into so-called {@link yfiles.router.Channel}s and route each {@link yfiles.router.Channel} - * individually. - *

- *

- * This class is initialized using {@link yfiles.router.ChannelBasedPathRouting#initialize} which must have been called before the - * edges are {@link yfiles.router.ChannelBasedPathRouting#route routed}. - *

- *

- * After a {@link yfiles.router.ChannelBasedPathRouting} instance is no longer in use, the {@link yfiles.router.Channel} information and - * the reference to the {@link yfiles.router.PathSearchConfiguration configuration} must be reset using method {@link yfiles.router.ChannelBasedPathRouting#cleanup}. - *

- * @see yfiles.router.EdgeInfo#getSegmentInfo - * @see yfiles.layout.LayoutGraph#setPath - * @class - */ - export interface ChannelBasedPathRouting extends yfiles.lang.Object{} - export class ChannelBasedPathRouting { - /** - * Creates a new instance of {@link yfiles.router.ChannelBasedPathRouting}. - */ - constructor(); - /** - * Adjusts the location assigned to a {@link yfiles.router.SegmentInfo segment info} in the {@link yfiles.router.Channel channel} considering the preferred alignment of the segment. - *

- * This method is called after the segments have been distributed in the channel but before the final locations of the - * segments are assigned to the {@link yfiles.router.SegmentInfo segment info}s. - *

- * @param channel the channel that contains the segment infos for which the alignment should be considered - * @see yfiles.router.Channel#getCurrentLocation - * @see yfiles.router.SegmentInfoBase#preferredAlignment - * @protected - */ - adjustSegmentLocations(channel:yfiles.router.Channel):void; - /** - * Calculates the locations of the {@link yfiles.router.SegmentInfo segment infos} in the given {@link yfiles.router.Channel channel}. - *

- * This method is called after the order of the {@link yfiles.router.SegmentInfo segment infos} within a channel has been {@link yfiles.router.ChannelBasedPathRouting#optimizeSegmentOrder optimized}. - *

- * @param channel the channel that contains the segment infos for which the locations will be calculated - * @see yfiles.router.Channel#setCurrentLocation - * @protected - */ - calculateSegmentLocations(channel:yfiles.router.Channel):void; - /** - * Resets all {@link yfiles.router.Channel channel} information and the reference to the {@link yfiles.router.PathSearchConfiguration configuration}. - *

- * Afterwards, {@link yfiles.router.ChannelBasedPathRouting} is ready to calculate paths for a new layout. - *

- */ - cleanup():void; - /** - * Creates a {@link yfiles.collections.IComparer. comparator} for sorting the {@link yfiles.router.SegmentInfo}s in a {@link yfiles.router.Channel} from left to right (for - * vertical segments) or top to bottom (for horizontal segments), respectively. - *

- * This method is called in {@link yfiles.router.ChannelBasedPathRouting#route} before edge segments are distributed within the - * channels. - *

- * @param channels the channels whose segments will be sorted by the {@link comparator} - * @param pathSearchResult the {@link path search result} containing the {@link }s with the - * {@link }s for which the comparator will be used - * @param configuration the {@link configuration} used during this path search - * @returns a {@link comparator} used for sorting the {@link }s in a {@link channel} - * @protected - */ - createSegmentInfoComparer(channels:yfiles.algorithms.YList,pathSearchResult:yfiles.router.PathSearchResult,configuration:yfiles.router.PathSearchConfiguration):yfiles.collections.IComparer; - /** - * Initializes this {@link yfiles.router.ChannelBasedPathRouting} instance for routing paths that have been found with the given - * {@link yfiles.router.PathSearchConfiguration configuration}. - *

- * This method must be called before the edges are {@link yfiles.router.ChannelBasedPathRouting#route routed}. - *

- * @param configuration the {@link configuration} used for the following path routing - * @see yfiles.router.ChannelBasedPathRouting#route - */ - initialize(configuration:yfiles.router.PathSearchConfiguration):void; - /** - * Optimizes the order of the {@link yfiles.router.SegmentInfo segments} in the given {@link yfiles.router.Channel channel}. - *

- * After the segments in the channel have been sorted using the comparator created by method - * {@link yfiles.router.ChannelBasedPathRouting#createSegmentInfoComparer}, segments having a common {@link yfiles.router.SegmentGroup} are - * replaced by their common {@link yfiles.router.SegmentGroup#commonSegmentInfo representative segment info}. - *

- *

- * This method further improves the order of the resulting segment info list to make sure that the subsequent {@link yfiles.router.ChannelBasedPathRouting#calculateSegmentLocations location calculation} - * is able to respect the {@link yfiles.router.SegmentInfoBase#locationRange location ranges} of the - * {@link yfiles.router.SegmentInfo}s and, if possible, the minimum edge to edge distances and possible grid constraints for the - * segments. - *

- * @param channel the channel for which the order of the {@link }s is optimized - * @protected - */ - optimizeSegmentOrder(channel:yfiles.router.Channel):void; - /** - * Routes the given edges. - *

- * Before calling this method, method {@link yfiles.router.ChannelBasedPathRouting#initialize} must have been called. - *

- *

- * As a first step, the {@link yfiles.router.SegmentInfo}s of all edge paths are distributed to {@link yfiles.router.Channel}s. After that, - * the segments in each of these - * {@link yfiles.router.Channel}s are sorted and locations are assigned respecting the segments' location ranges by calling the - * subsequent methods: - *

- *
    - *
  1. {@link yfiles.router.ChannelBasedPathRouting#optimizeSegmentOrder}
  2. - *
  3. {@link yfiles.router.ChannelBasedPathRouting#calculateSegmentLocations}
  4. - *
  5. {@link yfiles.router.ChannelBasedPathRouting#adjustSegmentLocations}
  6. - *
- *

- * Finally, the control points for the paths are calculated. - *

- * @param edges the {@link list of edges} to be routed - * @param pathSearchResult the {@link path search result} containing the {@link } objects for the edges - * @throws {Stubs.Exceptions.InvalidOperationError} if the locations are not within the segment's location range - * @see yfiles.router.PathSearchResult#getPath - * @see yfiles.router.SegmentInfoBase#locationRange - * @see yfiles.router.SegmentInfoBase#location - */ - route(edges:yfiles.algorithms.EdgeList,pathSearchResult:yfiles.router.PathSearchResult):void; - /** - * Sorts the given list of {@link yfiles.router.SegmentInfo}s using the given {@link yfiles.collections.IComparer. comparator}. - *

- * This method is called in {@link yfiles.router.ChannelBasedPathRouting#route} when the edge segments are distributed within the - * channels. - *

- * @param segmentInfos the list of {@link }s to be sorted - * @param segmentInfoComparer the comparator used for sorting the list of {@link }s - * @protected - */ - sortSegmentInfos(segmentInfos:yfiles.collections.IList,segmentInfoComparer:yfiles.collections.IComparer):void; - /** - * Gets the {@link yfiles.router.PathSearchConfiguration path search configuration} with which the {@link yfiles.router.ChannelBasedPathRouting} has been {@link yfiles.router.ChannelBasedPathRouting#initialize initialized}. - * @see yfiles.router.ChannelBasedPathRouting#initialize - * @protected - * @type {yfiles.router.PathSearchConfiguration} - */ - configuration:yfiles.router.PathSearchConfiguration; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.ChannelBasedPathRouting; - } - /** - * This class describes an {@link yfiles.router.IObstaclePartition} that decomposes its area dynamically. - *

- * The partitioning strategy is based on binary space partitioning. It divides the partition space recursively in two {@link yfiles.router.PartitionCell cells} - * until each cell is completely covered by one or more {@link yfiles.router.Obstacle}s or completely empty. - *

- * @class - * @implements {yfiles.router.IObstaclePartition} - * @implements {yfiles.router.IDynamicDecomposition} - */ - export interface DynamicObstacleDecomposition extends yfiles.lang.Object,yfiles.router.IObstaclePartition,yfiles.router.IDynamicDecomposition{} - export class DynamicObstacleDecomposition { - /** - * Constructs a new instance of {@link yfiles.router.DynamicObstacleDecomposition}. - */ - constructor(); - /** - * Adds the given {@link yfiles.router.IDecompositionListener dynamic decomposition listener} to receive {@link yfiles.router.PartitionCell} subdivision and creation events - * from this decomposition. - *

- * These events occur when the decomposition changes the partition by subdividing cells into sub-cells or when new cells - * are created. - *

- * @param listener the dynamic decomposition listener to add - * @see yfiles.router.IDecompositionListener - */ - addDynamicDecompositionListener(listener:yfiles.router.IDecompositionListener):void; - /** - * Clears the partition data such that the {@link yfiles.router.DynamicObstacleDecomposition} can be reused and {@link yfiles.router.DynamicObstacleDecomposition#init initialized} with - * new {@link yfiles.router.Obstacle}s. - * @see yfiles.router.DynamicObstacleDecomposition#init - */ - clear():void; - /** - * Notifies all registered {@link yfiles.router.IDecompositionListener dynamic decomposition listeners} that the given {@link yfiles.router.PartitionCell partition cell} has been created. - *

- * This method is also called in {@link yfiles.router.DynamicObstacleDecomposition#init}. - *

- * @param createdCell the newly created cell - * @see yfiles.router.IDecompositionListener - * @protected - */ - fireCreateCellEvent(createdCell:yfiles.router.PartitionCell):void; - /** - * Notifies all registered {@link yfiles.router.IDecompositionListener dynamic decomposition listeners} that the given {@link yfiles.router.PartitionCell partition cell} has been finalized. - * @param finalizedCell the cell that has been finalized - * @see yfiles.router.IDecompositionListener - * @protected - */ - fireFinalizeCellEvent(finalizedCell:yfiles.router.PartitionCell):void; - /** - * Notifies all registered {@link yfiles.router.IDecompositionListener dynamic decomposition listeners} of a subdivision of a given {@link yfiles.router.PartitionCell partition cell}. - * @param cell the cell that has been subdivided - * @param subCells the new sub-cells resulting from the subdivision of the given cell - * @see yfiles.router.IDecompositionListener - * @protected - */ - fireSubdividedEvent(cell:yfiles.router.PartitionCell,subCells:yfiles.collections.IList):void; - /** - * Returns a list of all {@link yfiles.router.PartitionCell}s that intersect or cover the given rectangle. - * @param rect the rectangular area whose (partially) covered cells will be returned - * @returns a list of {@link }s that (partially) cover the given rectangular area - */ - getCells(rect:yfiles.algorithms.YRectangle):yfiles.collections.IList; - /** - * Returns all {@link yfiles.router.PartitionCell partition cells} that are completely covered by the given {@link yfiles.router.Obstacle}. - * @param obstacle the obstacle for which the covered cells will be returned - * @returns an unmodifiable list of {@link } instances that are completely covered by the given obstacle - */ - getCellsForObstacle(obstacle:yfiles.router.Obstacle):yfiles.collections.IList; - /** - * Calculates the cost of a cut with respect to the geometry of the sub-cells. - *

- * The cost can take values between 0 and 1. - *

- *

- * This method is called while a {@link yfiles.router.PartitionCell} is divided into upper and lower or left and right child cells - * depending on the cut costs (during {@link yfiles.router.DynamicObstacleDecomposition#getCellsForObstacle}, {@link yfiles.router.DynamicObstacleDecomposition#getCells} - * and {@link yfiles.router.DynamicObstacleDecomposition#getNeighbors} methods). - *

- * @param cut the coordinate of the cut - * @param min the left side of the subdivided cell - * @param max the right side of the subdivided cell - * @param orthogonalMin the upper side of the subdivided cell - * @param orthogonalMax the lower side of the subdivided cell - * @returns the cost of a cut with respect to the geometry of the sub-cells - * @protected - */ - getGeometricCutCosts(cut:number,min:number,max:number,orthogonalMin:number,orthogonalMax:number):number; - /** - * Returns the neighbor {@link yfiles.router.PartitionCell partition cells} of the given cell. - * @param cell the cell whose neighbors will be returned - * @returns the neighbor cells of the given cell - */ - getNeighbors(cell:yfiles.router.PartitionCell):yfiles.collections.IList; - /** - * Calculates the cost of a cut with respect to the subdivided obstacles. - *

- * The cost can take values between 0 and 1. - *

- *

- * This method is called while a {@link yfiles.router.PartitionCell} is divided into upper and lower or left and right child cells - * depending on the cut costs (during {@link yfiles.router.DynamicObstacleDecomposition#getCellsForObstacle}, {@link yfiles.router.DynamicObstacleDecomposition#getCells} - * and {@link yfiles.router.DynamicObstacleDecomposition#getNeighbors} methods). - *

- * @param numObstaclesInFirstHalf the number of obstacles that lie completely in the first half - * @param numObstaclesInSecondHalf the number of obstacles that lie completely in the second half - * @param numObstaclesOnCut the number of obstacles that lie on the cut - * @returns the cost of a cut with respect to the subdivided obstacles - * @protected - */ - getObstacleCutCosts(numObstaclesInFirstHalf:number,numObstaclesInSecondHalf:number,numObstaclesOnCut:number):number; - /** - * Returns all {@link yfiles.router.Obstacle}s that cover the given {@link yfiles.router.PartitionCell partition cell}. - * @param cell the partition cell for which the obstacles will be returned - * @returns an unmodifiable list of {@link } instances that cover the given cell - */ - getObstacles(cell:yfiles.router.PartitionCell):yfiles.collections.IList; - /** - * Initializes this {@link yfiles.router.DynamicObstacleDecomposition} instance with the given obstacles and partition bounds. - *

- * This method must be called before any other method is invoked. - *

- * @param obstacles a list of {@link } objects - * @param partitionBounds the bounds of the partition - */ - init(obstacles:yfiles.collections.IList,partitionBounds:yfiles.algorithms.YRectangle):void; - /** - * Removes the given {@link yfiles.router.IDecompositionListener dynamic decomposition listener} such that it no longer receives {@link yfiles.router.PartitionCell} subdivision - * and creation events from this decomposition. - * @param listener the dynamic decomposition listener to remove - * @see yfiles.router.IDecompositionListener - */ - removeDynamicDecompositionListener(listener:yfiles.router.IDecompositionListener):void; - /** - * Gets or sets the costs incurred for every {@link yfiles.router.Obstacle} that must be cut in a subdivision. - *

- * Values need to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the cost is negative - * @type {number} - */ - cutObstacleCost:number; - /** - * Gets or sets the costs incurred if the distribution after a subdivision of obstacles is unbalanced in sub-cells. - *

- * Values need to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the cost is negative - * @type {number} - */ - unbalancedObstaclesCost:number; - /** - * Gets or sets the costs incurred if the subdivision produces unbalanced rectangles. - *

- * Values need to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the cost is negative - * @type {number} - */ - unbalancedRatioCost:number; - /** - * Gets the bounds of the original rectangular area that is being partitioned. - * @type {yfiles.algorithms.YRectangle} - */ - bounds:yfiles.algorithms.YRectangle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.DynamicObstacleDecomposition; - } - /** - * This class encapsulates the information that determines the route of a specific edge within a specific {@link yfiles.router.PartitionCell partition cell}. - * @class - */ - export interface EdgeCellInfo extends yfiles.lang.Object{} - export class EdgeCellInfo { - /** - * Creates a new {@link yfiles.router.EdgeCellInfo} instance. - * @param edge the edge whose routing in the cell is described - * @param cell the cell in which the edge is routed - * @param enterInterval the interval that the edge uses to enter the cell - * @param exitInterval the interval that the edge uses to exit the cell - * @param enterDirection the direction in which the edge enters the cell - * @param exitDirection the direction in which the edge exits the cell - * @param enterSegmentNo the index of the edge segment that enters the cell - */ - constructor(edge:yfiles.algorithms.Edge,cell:yfiles.router.PartitionCell,enterInterval:yfiles.router.OrthogonalInterval,exitInterval:yfiles.router.OrthogonalInterval,enterDirection:yfiles.layout.Direction,exitDirection:yfiles.layout.Direction,enterSegmentNo:number); - /** - * Gets the number of bends of the edge within this cell. - * @type {number} - */ - bendCount:number; - /** - * Gets the routing type of the edge within this cell. - * @type {yfiles.router.RoutingType} - */ - type:yfiles.router.RoutingType; - /** - * Gets or sets the index of the edge segment that enters this cell. - *

- * Values should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given index is negative - * @type {number} - */ - enterSegmentIndex:number; - /** - * Gets or sets the index of the edge segment that exits this cell. - *

- * Values should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given index is negative - * @type {number} - */ - exitSegmentIndex:number; - /** - * Gets or sets the {@link yfiles.router.SegmentGroup segment group} containing the entering segment. - *

- * When specifying the segment group, the {@link yfiles.router.EdgeCellInfo#enterInterval enter interval} is updated to use the segment group's common enter interval. - *

- * @see yfiles.router.SegmentGroup#commonLocationRange - * @type {yfiles.router.SegmentGroup} - */ - enterSegmentGroup:yfiles.router.SegmentGroup; - /** - * Gets or sets the {@link yfiles.router.SegmentGroup segment group} containing the exiting segment. - *

- * When specifying the segment group, the {@link yfiles.router.EdgeCellInfo#exitInterval exit interval} is updated to use the segment group's common exit interval. - *

- * @see yfiles.router.SegmentGroup#commonLocationRange - * @type {yfiles.router.SegmentGroup} - */ - exitSegmentGroup:yfiles.router.SegmentGroup; - /** - * Gets the edge that is routed within the {@link yfiles.router.EdgeCellInfo#cell partition cell}. - * @type {yfiles.algorithms.Edge} - */ - edge:yfiles.algorithms.Edge; - /** - * Gets the {@link yfiles.router.PartitionCell partition cell} within which the edge is routed. - * @type {yfiles.router.PartitionCell} - */ - cell:yfiles.router.PartitionCell; - /** - * Gets the {@link yfiles.router.OrthogonalInterval interval} that the edge uses to enter this cell. - * @type {yfiles.router.OrthogonalInterval} - */ - enterInterval:yfiles.router.OrthogonalInterval; - /** - * Gets the {@link yfiles.router.OrthogonalInterval interval} that the edge uses to exit this cell. - * @type {yfiles.router.OrthogonalInterval} - */ - exitInterval:yfiles.router.OrthogonalInterval; - /** - * Gets the {@link yfiles.layout.Direction direction} in which the edge enters this cell. - * @type {yfiles.layout.Direction} - */ - enterDirection:yfiles.layout.Direction; - /** - * Gets the {@link yfiles.layout.Direction direction} in which the edge exits this cell. - * @type {yfiles.layout.Direction} - */ - exitDirection:yfiles.layout.Direction; - /** - * Calculates the list of {@link yfiles.router.CellSegmentInfo}s for the segment parts of this edge that lie within the associated - * {@link yfiles.router.EdgeCellInfo#cell partition cell}. - * @type {yfiles.algorithms.YList} - */ - cellSegmentInfos:yfiles.algorithms.YList; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.EdgeCellInfo; - } - /** - * This class encapsulates the information required to route an edge with a path routing algorithm. - * @see yfiles.router.ChannelBasedPathRouting - * @class - */ - export interface EdgeInfo extends yfiles.lang.Object{} - export class EdgeInfo { - /** - * Creates a new {@link yfiles.router.EdgeInfo} instance. - * @param path the path that will be used for routing the edge - * @param configuration the {@link configuration} of the path search algorithm - */ - constructor(path:yfiles.router.Path,configuration:yfiles.router.PathSearchConfiguration); - /** - * Calculates an array of {@link yfiles.algorithms.LineSegment}s created by the {@link yfiles.router.EdgeInfo#calculatePathPoints calculated path points}. - * @returns an array of {@link }s created by the calculated path points - */ - calculateLineSegments():yfiles.algorithms.LineSegment[]; - /** - * Calculates a list of {@link yfiles.algorithms.YPoint}s containing the source port, bend and target port locations. - * @returns a list of {@link }s containing the source port, bend and target port locations - */ - calculatePathPoints():yfiles.algorithms.YList; - /** - * Returns the {@link yfiles.router.EdgeCellInfo} of the given {@link yfiles.router.CellEntrance} in the path. - * @param entrance the entrance for which the {@link } will be returned - * @returns the {@link } of the given {@link } in the path - */ - getEdgeCellInfo(entrance:yfiles.router.CellEntrance):yfiles.router.EdgeCellInfo; - /** - * Returns the {@link yfiles.router.SegmentInfo} of the segment following the segment of the given {@link yfiles.router.SegmentInfo}. - * @param segment the segment info for which the next segment info will be returned - * @returns the segment info of the segment following the segment of the given segment info - */ - getNextSegment(segment:yfiles.router.SegmentInfo):yfiles.router.SegmentInfo; - /** - * Returns the {@link yfiles.router.SegmentInfo} of the segment preceding the segment of the given {@link yfiles.router.SegmentInfo}. - * @param segment the segment info for which the previous segment info will be returned - * @returns the segment info of the segment preceding the segment of the given segment info - */ - getPreviousSegment(segment:yfiles.router.SegmentInfo):yfiles.router.SegmentInfo; - /** - * Returns the {@link yfiles.router.SegmentInfo} of the edge segment with the given index. - * @param segmentIndex the index of the edge segment for which the segment info will be returned - * @returns the {@link } of the edge segment with the given index - */ - getSegmentInfo(segmentIndex:number):yfiles.router.SegmentInfo; - /** - * Returns the number of segments of the edge. - * @returns the number of segments of the edge - */ - segmentCount():number; - /** - * Gets whether the path of this {@link yfiles.router.EdgeInfo#edge edge} is fixed or should be routed by the path search algorithm. - * @type {boolean} - */ - fixed:boolean; - /** - * Gets the edge whose route is described by this {@link yfiles.router.EdgeInfo} instance. - * @type {yfiles.algorithms.Edge} - */ - edge:yfiles.algorithms.Edge; - /** - * Gets a list of {@link yfiles.router.EdgeCellInfo}s describing how the edge traverses each {@link yfiles.router.PartitionCell} on its - * path. - * @type {yfiles.collections.IList.} - */ - edgeCellInfos:yfiles.collections.IList; - /** - * Gets or sets the location of the strong source port that the edge uses. - *

- * Defining a new strong source port also updates the first {@link yfiles.router.SegmentInfo} to use this fixed port location. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the first segment is already fixed and the given port location contradicts the segment's fixed location - * @see yfiles.router.SegmentInfoBase#location - * @see yfiles.router.SegmentInfo#atStrongPortConstraint - * @type {yfiles.algorithms.YPoint} - */ - strongSourcePort:yfiles.algorithms.YPoint; - /** - * Gets or sets the location of the strong target port that the edge uses. - *

- * Defining a new strong target port also updates the last {@link yfiles.router.SegmentInfo} to use this fixed port location. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the last segment is already fixed and the given port location contradicts the segment's fixed location - * @see yfiles.router.SegmentInfoBase#location - * @see yfiles.router.SegmentInfo#atStrongPortConstraint - * @type {yfiles.algorithms.YPoint} - */ - strongTargetPort:yfiles.algorithms.YPoint; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.EdgeInfo; - } - /** - * This class is used by {@link yfiles.router.EdgeRouter} to provide routing details for the edges of the graph. - *

- * An {@link yfiles.router.EdgeLayoutDescriptor} instance can be specified individually for single edges using a {@link yfiles.algorithms.IDataProvider} - * that returns an {@link yfiles.router.EdgeLayoutDescriptor} instance for each edge of the graph, or null if no {@link yfiles.router.EdgeLayoutDescriptor} - * is bound to an edge. The {@link yfiles.algorithms.IDataProvider} is registered with the graph using key - * {@link yfiles.router.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. - *

- *

- * This class is designed such that it allows future additions of new getter methods. - *

- * @see yfiles.router.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @class - */ - export interface EdgeLayoutDescriptor extends yfiles.lang.Object{} - export class EdgeLayoutDescriptor { - /** - * Creates a new instance of an {@link yfiles.router.EdgeLayoutDescriptor} with the default settings. - */ - constructor(); - /** - * Creates a copy of this {@link yfiles.router.EdgeLayoutDescriptor} instance. - * @returns a copy of this {@link } instance - */ - createCopy():yfiles.router.EdgeLayoutDescriptor; - /** - * Gets or sets the minimum length of the first segment of the edge path (at the source node). - *

- * The minimum length should be greater than or equal to 0. If a negative value is given as input, the default value, i.e., - * 5.0, will be used instead. - *

- * @type {number} - */ - minimumFirstSegmentLength:number; - /** - * Gets or sets the minimum length of the last segment of the edge path (at the target node). - *

- * The minimum length should be greater than or equal to 0. If a negative value is given as input, the default value, i.e., - * 10.0, will be used instead. - *

- * @type {number} - */ - minimumLastSegmentLength:number; - /** - * Gets or sets the minimum distance between a pair of edges. - *

- * The minimum distance should be greater than or equal to 0. If a negative value is given as input, the default value, - * i.e., 3.0, will be used instead. - *

- * @type {number} - */ - minimumEdgeToEdgeDistance:number; - /** - * Gets or sets the minimum distance that the edge should maintain from node corners when entering or leaving the node. - *

- * The minimum distance should be greater than or equal to 0. If a negative value is given as input, the default value, - * i.e., 3.0, will be used instead. - *

- * @type {number} - */ - minimumNodeCornerDistance:number; - /** - * Gets or sets the monotonic path restrictions that should be applied. - *

- * Monotonic path restrictions imply that (ideally) the vertical and/or horizontal segments of an edge path are directed - * from the source node towards the target node without ever changing their direction back towards the source node. - *

- *

- * If an unknown restriction is specified, {@link yfiles.router.MonotonicPathRestriction#NONE} will be used instead. - *

- * @type {yfiles.router.MonotonicPathRestriction} - */ - monotonicPathRestriction:yfiles.router.MonotonicPathRestriction; - /** - * Gets or sets the {@link yfiles.router.PenaltySettings} used for this edge. - *

- * Besides specifying a completely customized setting, the user can choose between four predefined optimization strategies: - * {@link yfiles.router.PenaltySettings#OPTIMIZATION_BALANCED}, {@link yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_BENDS}, {@link yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_CROSSINGS} - * and {@link yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_LENGTHS}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given penalty settings are null - * @see yfiles.router.PenaltySettings#OPTIMIZATION_BALANCED - * @see yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_BENDS - * @see yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_CROSSINGS - * @see yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_LENGTHS - * @type {yfiles.router.PenaltySettings} - */ - penaltySettings:yfiles.router.PenaltySettings; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.EdgeLayoutDescriptor; - } - /** - * This edge routing algorithm applies polyline routes to the edges of the graph. - *

- * Layout Style Edges are normally routed in an orthogonal fashion, i.e., they only consist of horizontal and vertical segments. There - * is also a {@link yfiles.router.EdgeRouter#polylineRouting routing style} in which, between horizontal and vertical segments, additional segments with other slopes are - * inserted. - *

- *

- * During the routing process, the positions of the nodes are considered to be fixed and the routing algorithm will not - * modify their locations or their sizes in any way. - *

- *

- * The edge routing algorithm can be applied wherever it is needed to route the edges as polyline or orthogonal segments - * without crossing any nodes, while keeping the positions of the nodes in the diagram fixed. Some potential applications - * include electric circuit design, floor planning and navigation maps. - *

- *

- * {@graph {"ann":{"s":[80,100],"d":1},"n":[[217.75,668.75],[447.12,732.5,135,30],[582,230.25],[582,530.75],[738,668.75],[497.5,372],[770.38,245.25,30,70],[674,419.5],[447.12,525.12,30,30],[357.12,253.38,30,82.5],[369.62,441.38,30,60]],"e":[[0,1,40,28.75,-67.5,0],[0,2,-9.25,-50,-40,-41.94,[248.5,238.31]],[1,3,67.5,-6,3.56,50,[625.56,741.5]],[0,4,40,-8.94,-40,-8.94],[1,4,67.5,6,-40,34.75],[0,5,27.75,-50,-40,-4.72,[285.5,417.28]],[0,6,-27.75,-50,0,-35,[230,220.25,785.38,220.25]],[4,6,7.38,-50,0,35],[2,6,40,0,-15,0],[5,7,40,44.95,-40,-2.55],[4,7,-32,-50,32,50],[7,2,-40,-17.6,19.12,50,[641.12,451.9]],[0,8,40,-34.31,0,15,[462.12,684.44]],[0,9,9.25,-50,-15,0,[267,294.62]],[5,9,-40,-32.91,0,41.25,[372.12,389.09]],[9,2,15,-2.81,-40,11.56],[10,8,15,21.54,0,-15,[462.12,492.92]],[10,3,15,10.62,-16.62,-50,[605.38,482]],[10,5,15,-19.48,-40,29.9]],"vp":[217.0,220.0,601.0,549.0]}} Sample output of the edge routing algorithm with default settings {@graph {"ann":{"s":[80,100],"d":1},"n":[[-80.25,263.5,30,30],[-309.62,407.12],[-170.25,-8.25,30,82.5],[-80.25,470.88,135,30],[54.62,-31.38],[54.62,269.12],[-157.75,179.75,30,60],[210.62,407.12],[-29.88,110.38],[243,-16.38,30,70],[146.62,157.88]],"e":[[1,0,40,28.75,-15,0,[-207.88,485.88,-199.94,477.94,-199.94,300.94,-177.5,278.5]],[1,2,40,28.75,-6,41.25,[-207.88,485.88,-199.94,477.94,-199.94,152.94,-188.56,141.56,-172.56,141.56,-161.25,130.25]],[1,3,40,28.75,-67.5,0],[1,4,40,28.75,0,-50,[-207.88,485.88,-199.94,477.94,-199.94,-19.06,-177.62,-41.38,94.62,-41.38]],[2,4,15,-2.81,-40,11.56],[3,5,67.5,0,3.56,50,[86.12,485.88,98.19,473.81]],[6,0,15,-14.69,0,-15,[-80.94,195.06,-65.25,210.75]],[6,5,15,-14.69,-18.5,-50,[-80.94,195.06,-65.25,210.75,-65.25,233.75,-49.25,249.75,70.75,249.75,76.12,255.12]],[1,7,40,28.75,34.69,-50,[-207.88,485.88,-199.94,477.94,-199.94,-19.06,-177.62,-41.38,268.62,-41.38,285.31,-24.69]],[3,7,67.5,0,-40,28.75],[6,8,15,-14.69,-40,34.69],[1,8,40,28.75,-40,-18.81,[-207.88,485.88,-199.94,477.94,-199.94,152.94,-188.56,141.56]],[8,2,40,47,6,41.25,[60.12,207.38,60.12,100.12,52.31,92.31,-144.69,92.31,-149.25,87.75]],[1,9,40,28.75,0,-35,[-207.88,485.88,-199.94,477.94,-199.94,-19.06,-177.62,-41.38,250.62,-41.38,258,-34]],[7,9,-32,-50,0,35,[218.62,334.38,229.5,323.5,246.5,323.5,258,312]],[4,9,40,0,-15,0],[8,10,40,47,-40,-0.5],[7,10,-32,-50,32,50],[10,4,-40,-29.22,18.5,50,[122.65,178.65,113.12,169.12]]],"vp":[-310.0,-42.0,601.0,550.0]}} Sample output of the edge routing algorithm with - * polyline routing and grouped edges {@graph {"ann":{"s":[80,100],"d":1},"n":[[556.12,477.62],[648.12,366.38],[471.62,318.88],[316.25,181.25,150,335.75,2],[421.25,472,30,30],[331.25,200.25,30,82.5],[343.75,388.25,30,60],[191.88,615.62],[421.25,679.38,135,30],[712.12,615.62],[541.12,158.12,248.38,134,2],[556.12,177.12],[744.5,192.12,30,70]],"e":[[2,1,40,36.2,-40,-11.3],[2,5,-7.94,-50,15,19.12,[503.69,277.69,486.62,260.62]],[6,4,15,21.54,0,-15,[426.79,439.79,436.25,449.25]],[6,0,15,10.62,-16.62,-50,[564.88,428.88,579.5,443.5]],[6,2,15,-14.69,-40,34.69],[7,4,40,-38.54,0,15,[413.92,627.08,436.25,604.75]],[7,2,40,-21.62,-0.44,50,[489,644,511.19,621.81]],[7,5,24.67,-50,-15,0,[256.54,263.46,278.5,241.5]],[7,8,40,28.75,-67.5,0],[8,0,67.5,-6,3.56,50,[587.62,688.38,599.69,676.31]],[7,9,40,-4.71,-40,-4.71],[8,9,67.5,6,-40,34.75],[9,1,-32,-50,32,50],[7,11,0,-50,0,-50,[231.88,189.12,253.88,167.12,596.12,167.12]],[5,11,15,-19.12,-40,-4.75],[1,11,-40,-35.1,19.12,50,[624.27,381.27,615.25,372.25]],[7,12,-24.67,-50,0,-35,[207.21,186.79,229.87,164.12,751.12,164.12,759.5,172.5]],[9,12,7.38,-50,0,35],[11,12,40,0,-15,0]],"vp":[191.0,158.0,602.0,558.0]}} Sample output of the edge routing algorithm with polyline routing and group - * nodesConceptThe edge routing algorithm basically performs three (four) steps to achieve an orthogonal (polyline) edge routing. - *

- *
    - *
  1. Creating a {@link yfiles.router.IPartition} which divides the area of the graph area into several {@link yfiles.router.PartitionCell}s.
  2. - *
  3. Finding the shortest/cheapest paths for all edges through the {@link yfiles.router.IPartition} using {@link yfiles.router.PathSearch}.
  4. - *
  5. - * Assigning coordinates to the segments of the edges based on the paths that were calculated before with - * {@link yfiles.router.ChannelBasedPathRouting}. - *
  6. - *
  7. Inserting non-orthogonal segments where horizontal and vertical segments meet (only if {@link yfiles.router.EdgeRouter#polylineRouting polyline routing} is enabled).
  8. - *
- *

- * The first two steps are customizable. {@link yfiles.router.IGraphPartitionExtension}s are able to influence how the {@link yfiles.router.IPartition} - * is created. They add {@link yfiles.router.PartitionCell}s and/or mark them for adding costs later in the process. The currently - * used {@link yfiles.router.EdgeRouter#registeredPartitionExtensions partition extensions} can be dropped or extended by custom implementations. - *

- *

- * For example, the extension 'Node Partition' adds a {@link yfiles.router.PartitionCell} to the {@link yfiles.router.IPartition} for each - * node and marks it as belonging to a node. During {@link yfiles.router.PathSearch}, the extension 'Node Crossing' recognizes - * these - * {@link yfiles.router.PartitionCell}s and adds costs that penalizes crossing a node. The edge will be routed around the nodes. - *

- *

- * {@link yfiles.router.PathSearchExtension}s influence the {@link yfiles.router.PathSearch} by adding costs for traversing - * {@link yfiles.router.PartitionCell}s or narrowing their intervals to allow a less expensive traversal of a - * {@link yfiles.router.PartitionCell}. The currently used {@link yfiles.router.EdgeRouter#registeredPathSearchExtensions partition extensions} can be dropped or extended by custom - * implementations. - *

- *

- * Using {@link yfiles.router.EdgeLayoutDescriptor}s, it is possible to add individual layout settings like routing styles to - * edges. They are registered with the graph with key {@link yfiles.router.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. If no - * descriptor is provided for an edge, a {@link yfiles.router.EdgeRouter#defaultEdgeLayoutDescriptor default edge layout descriptor} is used as fallback value. - *

- *

- * Features - *

- *

- * The routing algorithm supports two approaches to connect edges on a specific side or even on an exact location to a - * node. {@link yfiles.layout.PortConstraint}s define a single constraint for the ports of an edge. To realize more complex port - * restrictions, several {@link yfiles.layout.PortCandidate}s or {@link yfiles.layout.PortCandidateSet}s can be assigned to edges or nodes. - * If an edge with registered {@link yfiles.layout.PortCandidate}s connects to nodes with {@link yfiles.layout.PortCandidateSet}s, the edge - * router will try to match both collections in order to find an appropriate port. In case there is no matching port - * candidate, a {@link yfiles.layout.PortCandidate} specified for the edge is preferred. Since their simultaneous existence at the - * same node may be ambiguous, it is not recommended to use a combination of {@link yfiles.layout.PortConstraint}s and - * {@link yfiles.layout.PortCandidate}s in the same diagram. - *

- *

- * Edges can be grouped so that they share common segments at the beginning or end of their routes. Although a graph may - * contain source and target grouped edges, an edge can only either be part of a source or a target group. Edge groups are - * specified using {@link yfiles.algorithms.IDataProvider}s that provide the same ID object for all edges in the same group. Those - * {@link yfiles.algorithms.IDataProvider}s are registered with the graph with key {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} - * for source groups or key {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY} for target groups. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface EdgeRouter extends yfiles.layout.LayoutStageBase{} - export class EdgeRouter { - /** - * Creates a new {@link yfiles.router.EdgeRouter} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [core=null] The core layout algorithm. - */ - constructor(core?:yfiles.layout.ILayoutAlgorithm); - /** - * Checks the sizes of the nodes to be non-zero. - * @param g The graph to check. - * @protected - */ - checkNodeSize(g:yfiles.layout.LayoutGraph):void; - /** - * Removes all registered {@link yfiles.router.IGraphPartitionExtension}s from a given {@link yfiles.router.GraphPartition} instance. - *

- * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} after the edge routes are calculated. It may be overridden - * in order to provide a custom implementation for cleaning up a {@link yfiles.router.GraphPartition} instance. - *

- * @param partition the given {@link } instance - * @see yfiles.router.EdgeRouter#configureGraphPartition - * @see yfiles.router.EdgeRouter#registeredPartitionExtensions - * @protected - */ - cleanUpGraphPartition(partition:yfiles.router.GraphPartition):void; - /** - * Adds all registered {@link yfiles.router.IGraphPartitionExtension}s instances to a given {@link yfiles.router.GraphPartition} instance. - *

- * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be - * overridden in order to adjust the configuration of the {@link yfiles.router.GraphPartition} instance. - *

- * @param partition the given {@link } instance - * @see yfiles.router.EdgeRouter#registeredPartitionExtensions - * @see yfiles.router.EdgeRouter#cleanUpGraphPartition - * @protected - */ - configureGraphPartition(partition:yfiles.router.GraphPartition):void; - /** - * Adds all registered {@link yfiles.router.PathSearchExtension}s to a given {@link yfiles.router.PathSearch} instance. - *

- * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be - * overridden in order to adjust the configuration of a {@link yfiles.router.PathSearch} instance. - *

- * @param pathSearch a {@link } instance - * @see yfiles.router.EdgeRouter#createPathSearch - * @see yfiles.router.EdgeRouter#registeredPathSearchExtensions - * @protected - */ - configurePathSearch(pathSearch:yfiles.router.PathSearch):void; - /** - * Creates a {@link yfiles.router.PathSearchConfiguration} that is used during the path searching process. - *

- * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be - * overridden in order to create a new {@link yfiles.router.PathSearchConfiguration} object with custom configuration. - *

- * @param graph the input graph - * @param grouping the grouping structure of the graph - * @returns a {@link } instance - * @protected - */ - createConfiguration(graph:yfiles.layout.LayoutGraph,grouping:yfiles.layout.GroupingSupport):yfiles.router.PathSearchConfiguration; - /** - * Creates a default {@link yfiles.collections.IComparer.} instance to determine the order of the edges according to which they will be routed. - *

- * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be - * overridden in order to create a new {@link yfiles.collections.IComparer.} object with a custom configuration. - *

- *

- * By default, this method returns an instance of the default implementation. - *

- * @param graph the input graph - * @param configuration the given configuration for the path searching process - * @returns a {@link } instance - * @protected - */ - createDefaultEdgeOrderComparer(graph:yfiles.layout.LayoutGraph,configuration:yfiles.router.PathSearchConfiguration):yfiles.collections.IComparer; - /** - * Creates a {@link yfiles.router.GraphPartition} instance that divides the area of the graph into several rectangles. - *

- * This implementation creates a {@link yfiles.router.GraphPartition} using the current {@link yfiles.router.IObstaclePartition} instance. - *

- *

- * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be - * overridden in order to create a new {@link yfiles.router.GraphPartition} object with a custom configuration. - *

- * @param decomposition the current {@link } - * @returns a {@link } instance - * @see yfiles.router.EdgeRouter#configureGraphPartition - * @see yfiles.router.EdgeRouter#registeredPartitionExtensions - */ - createGraphPartition(decomposition:yfiles.router.IObstaclePartition):yfiles.router.GraphPartition; - /** - * Creates a {@link yfiles.router.DynamicObstacleDecomposition} that is used by the {@link yfiles.router.GraphPartition} to divide the - * graph area in rectangles. - *

- * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be - * overridden in order to create a new {@link yfiles.router.DynamicObstacleDecomposition} object with custom configuration. - *

- * @returns a {@link } instance - * @see yfiles.router.EdgeRouter#createGraphPartition - * @protected - */ - createObstacleDecomposition():yfiles.router.DynamicObstacleDecomposition; - /** - * Creates a {@link yfiles.router.ChannelBasedPathRouting} instance that routes the edges using pre-calculated {@link yfiles.router.Path} - * objects. - *

- * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be - * overridden in order to create a new {@link yfiles.router.ChannelBasedPathRouting} object with custom configuration. - *

- * @returns a {@link } instance - * @protected - */ - createPathRouting():yfiles.router.ChannelBasedPathRouting; - /** - * Creates a {@link yfiles.router.PathSearch} instance that finds the paths of the edges through the {@link yfiles.router.GraphPartition}. - *

- * This method may be overridden in order to create a new {@link yfiles.router.PathSearch} object with custom configuration. - *

- * @returns a {@link } instance - * @see yfiles.router.EdgeRouter#configurePathSearch - * @see yfiles.router.EdgeRouter#registeredPathSearchExtensions - * @protected - */ - createPathSearch():yfiles.router.PathSearch; - /** - * Creates a {@link yfiles.router.PathSearchContext} that provides context information for the path searching algorithm. - *

- * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be - * overridden in order to create a new {@link yfiles.router.PathSearchContext} object with custom configuration. - *

- * @param pathSearch a given {@link } instance - * @param configuration a given configuration for the path searching process - * @returns a {@link } instance - * @protected - */ - createPathSearchContext(pathSearch:yfiles.router.PathSearch,configuration:yfiles.router.PathSearchConfiguration):yfiles.router.PathSearchContext; - /** - * Returns the {@link yfiles.router.EdgeLayoutDescriptor} instance for a given edge that is provided by a {@link yfiles.algorithms.IDataProvider} - * which is registered with the graph with key {@link yfiles.router.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. - *

- * For all those edges that do not have a specific layout descriptor assigned, the default layout descriptor returned by {@link yfiles.router.EdgeRouter#defaultEdgeLayoutDescriptor} - * will be assigned. - *

- *

- * This method may be overridden in order to create an {@link yfiles.router.EdgeLayoutDescriptor} with custom configuration. - *

- * @param edge the given edge - * @returns the current {@link } instance for a given edge - * @see yfiles.router.EdgeRouter#defaultEdgeLayoutDescriptor - * @see yfiles.router.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - */ - getEdgeLayoutDescriptor(edge:yfiles.algorithms.Edge):yfiles.router.EdgeLayoutDescriptor; - /** - * Returns whether or not a given edge is selected. - *

- * If all the edges of the graph will be routed by {@link yfiles.router.EdgeRouter}, i.e., the {@link yfiles.router.EdgeRouter#scope scope} is set to - * {@link yfiles.router.Scope#ROUTE_ALL_EDGES}, this utility method returns true for all edges. - *

- *

- * This method may be overridden in order to determine differently whether or not a given edge is considered to be - * selected. - *

- * @param edge the given edge - * @param graph the input graph - * @returns true if the given edge is selected, false otherwise - */ - isAffected(edge:yfiles.algorithms.Edge,graph:yfiles.algorithms.Graph):boolean; - /** - * Data provider key for specifying individual edge layout information - *

- * If this {@link yfiles.algorithms.IDataProvider} does not contain an {@link yfiles.router.EdgeLayoutDescriptor} for an edge, then the - * layout algorithm will use the {@link yfiles.router.EdgeRouter#defaultEdgeLayoutDescriptor default descriptor}. - *

- * @see yfiles.router.EdgeRouter#defaultEdgeLayoutDescriptor - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_LAYOUT_DESCRIPTOR_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for weighting the costs for crossing each label individually - *

- * If the factor for a label is 0 then it is allowed to cross it. Very important labels should get a high factor. - *

- *

- * This factor is multiplied by the basic penalty arising when an edge must cross a {@link yfiles.router.PenaltySettings#nodeLabelCrossingPenalty node label} or an {@link yfiles.router.PenaltySettings#edgeLabelCrossingPenalty edge label} in order to - * determine the final costs arising when this label is crossed. - *

- * @see yfiles.router.EdgeRouter#defaultEdgeLayoutDescriptor - * @see yfiles.router.EdgeLayoutDescriptor#penaltySettings - * @const - * @static - * @type {yfiles.algorithms.ILabelLayoutDpKey.} - */ - static LABEL_CROSSING_PENALTY_FACTOR_DP_KEY:yfiles.algorithms.ILabelLayoutDpKey; - /** - * Gets or sets the time limit (in milliseconds) set for the edge routing algorithm. - *

- * The maximum duration has to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the maximum duration is negative - * @type {number} - */ - maximumDuration:number; - /** - * Gets the {@link yfiles.router.EdgeLayoutDescriptor} instance used for all those edges that do not have a specific edge layout - * descriptor assigned. - * @see yfiles.router.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @type {yfiles.router.EdgeLayoutDescriptor} - */ - defaultEdgeLayoutDescriptor:yfiles.router.EdgeLayoutDescriptor; - /** - * Gets or sets whether or not the routing algorithm will route the edges of the graph with (non-orthogonal) polyline - * segments. - * @see yfiles.router.EdgeRouter#preferredPolylineSegmentLength - * @see yfiles.router.EdgeRouter#maximumPolylineSegmentRatio - * @type {boolean} - */ - polylineRouting:boolean; - /** - * Gets or sets the preferred length of (non-orthogonal) polyline segments. - *

- * If there is not enough space to use this preferred length, polyline segments may also be shorter. - *

- *

- * The preferred length of (non-orthogonal) polyline segments has to be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the preferred polyline segment length is negative - * @see yfiles.router.EdgeRouter#maximumPolylineSegmentRatio - * @type {number} - */ - preferredPolylineSegmentLength:number; - /** - * Gets or sets the maximum ratio between the horizontal/vertical part of a segment and the (non-orthogonal) polyline - * part. - *

- * When polyline segments are added to an edge path, corners between horizontal and vertical segments are cut and replaced - * by the new segment. This ratio describes the cutting points on a segment. If it is zero, the route stays orthogonal. The - * value cannot be larger than 0.5 because there may be another polyline segment at the other side of the segment. For long - * orthogonal segments the length of the polyline segment is determined by the value returned by {@link yfiles.router.EdgeRouter#preferredPolylineSegmentLength}. - *

- *

- * The maximum polyline segment ratio must be between 0 and 0.5. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the maximum segment length is negative or greater than 0.5 - * @type {number} - */ - maximumPolylineSegmentRatio:number; - /** - * Gets or sets whether or not the routing algorithm uses an additional step to reroute the edges that are considered to - * have the worst paths. - * @type {boolean} - */ - rerouting:boolean; - /** - * Gets or sets a (sub-)set of edges that shall be routed. - * @throws {Stubs.Exceptions.ArgumentError} if the given scope is unknown - * @see yfiles.router.EdgeRouter#affectedEdgesDpKey - * @type {yfiles.router.Scope} - */ - scope:yfiles.router.Scope; - /** - * Gets or sets the {@link yfiles.algorithms.IDataProvider} key to look up the selection state of the nodes. - *

- * If the {@link yfiles.router.EdgeRouter#scope scope} is set to - * {@link yfiles.router.Scope#ROUTE_EDGES_AT_AFFECTED_NODES}, only the edges that are incident to selected nodes will be routed, - * while all other edges will be considered to have fixed routes. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.algorithms.IDataProvider} key is null - * @see yfiles.router.EdgeRouter#scope - * @type {any} - */ - affectedNodesDpKey:any; - /** - * Gets or sets the {@link yfiles.algorithms.IDataProvider} key to look up the selection state of the edges. - *

- * If the {@link yfiles.router.EdgeRouter#scope scope} is set to - * {@link yfiles.router.Scope#ROUTE_AFFECTED_EDGES}, only the selected edges will be routed, while all other edges will be - * considered to have fixed routes. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.algorithms.IDataProvider} key is null - * @see yfiles.router.EdgeRouter#scope - * @type {any} - */ - affectedEdgesDpKey:any; - /** - * Gets or sets a custom {@link yfiles.collections.IComparer.} to define the processing order of the edges. - * @see yfiles.router.EdgeRouter#createDefaultEdgeOrderComparer - * @type {yfiles.collections.IComparer.} - */ - edgeComparer:yfiles.collections.IComparer; - /** - * Gets or sets whether or not the routing algorithm considers the labels of the nodes as obstacles when calculating the - * edge routes to avoid overlaps. - * @see yfiles.router.PenaltySettings#nodeLabelCrossingPenalty - * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Gets or sets whether or not this routing algorithm ignores node labels that are inside the bounds of their owner as - * obstacles for edge routes. - * @see yfiles.router.EdgeRouter#considerNodeLabels - * @see yfiles.router.PenaltySettings#nodeLabelCrossingPenalty - * @see yfiles.router.EdgeRouter#LABEL_CROSSING_PENALTY_FACTOR_DP_KEY - * @type {boolean} - */ - ignoreInnerNodeLabels:boolean; - /** - * Gets or sets whether or not the routing algorithm considers as obstacles the edge labels that do not belong to the - * (sub-)set of edges to be routed when calculating the edge routes. - * @see yfiles.router.EdgeRouter#scope - * @see yfiles.router.EdgeRouter#affectedEdgesDpKey - * @see yfiles.router.PenaltySettings#nodeLabelCrossingPenalty - * @type {boolean} - */ - considerEdgeLabels:boolean; - /** - * Gets or sets the {@link yfiles.router.Grid} instance on which the routing algorithm places the orthogonal segments. - * @type {yfiles.router.Grid} - */ - grid:yfiles.router.Grid; - /** - * Gets or sets the minimum distance between edges and node bounds. - *

- * The minimum distance should have a non-negative value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum node-to-edge distance is negative - * @see yfiles.router.PenaltySettings#minimumNodeToEdgeDistancePenalty - * @type {number} - */ - minimumNodeToEdgeDistance:number; - /** - * Gets a list of all registered {@link yfiles.router.IGraphPartitionExtension}s. - *

- * {@link yfiles.router.IGraphPartitionExtension}s can be added to a {@link yfiles.router.GraphPartition} in order to create new - * {@link yfiles.router.Obstacle}s or can be removed from a {@link yfiles.router.GraphPartition} instance. - *

- *

- * By default, the following {@link yfiles.router.IGraphPartitionExtension}s are registered with a given {@link yfiles.router.GraphPartition} - * instance: - *

- *
    - *
  • Minimum Node To Edge Distance Partition
  • - *
  • Node Partition
  • - *
  • Partition Grid Partition
  • - *
  • Node Label Partition
  • - *
  • Edge Label Partition
  • - *
  • Fixed Edges Partition
  • - *
  • External Strong Port Restriction Partition
  • - *
- * @see yfiles.router.EdgeRouter#createGraphPartition - * @see yfiles.router.EdgeRouter#configureGraphPartition - * @type {yfiles.collections.IList.} - */ - registeredPartitionExtensions:yfiles.collections.IList; - /** - * Gets a list of all registered {@link yfiles.router.PathSearchExtension}s. - *

- * {@link yfiles.router.PathSearchExtension}s can be added to a {@link yfiles.router.PathSearch} instance in order to influence the path - * searching process or can be removed from a {@link yfiles.router.PathSearch} instance. - *

- *

- * By default, the following {@link yfiles.router.PathSearchExtension}s are registered with a {@link yfiles.router.PathSearch} instance: - *

- *
    - *
  • Fixed Grouped Edges
  • - *
  • Node Crossing
  • - *
  • Minimum Node To Edge Distance
  • - *
  • Group Node Crossing
  • - *
  • Minimum Group Node To Edge Distance
  • - *
  • Node Label Crossing
  • - *
  • Edge Label Crossing
  • - *
  • Bends In Node To Edge Distance
  • - *
  • Bend
  • - *
  • Monotonic Route
  • - *
  • Edge Length
  • - *
  • Partition Grid
  • - *
  • Port Restriction
  • - *
  • Edge Grouping
  • - *
  • Minimum Node Corner Distance
  • - *
  • Interval Based Crossing
  • - *
  • Minimum Edge To Edge Distance And Grid
  • - *
  • Minimum First Last Segment Length
  • - *
  • Intersecting Source And Target
  • - *
- * @see yfiles.router.EdgeRouter#createPathSearch - * @see yfiles.router.EdgeRouter#configurePathSearch - * @type {yfiles.collections.IList.} - */ - registeredPathSearchExtensions:yfiles.collections.IList; - /** - * Gets the {@link yfiles.router.GraphPartition} instance used during the routing process. - * @type {yfiles.router.GraphPartition} - */ - partition:yfiles.router.GraphPartition; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.EdgeRouter; - } - export enum Alignment{ - /** - * A constant specifying that the segment prefers to be placed close to the lower bound of its location range. - * @see yfiles.router.SegmentInfoBase#preferredAlignment - * @see yfiles.router.SegmentInfoBase#preferredAlignment - */ - MIN, - /** - * A constant specifying that the segment prefers to be placed close to the upper bound of its location range. - * @see yfiles.router.SegmentInfoBase#preferredAlignment - * @see yfiles.router.SegmentInfoBase#preferredAlignment - */ - MAX, - /** - * A constant specifying that the segment can be placed anywhere within its location range. - * @see yfiles.router.SegmentInfoBase#preferredAlignment - * @see yfiles.router.SegmentInfoBase#preferredAlignment - */ - ANY - } - export enum RoutingType{ - /** - * A routing type representing a straight crossing of the - * {@link yfiles.router.PartitionCell partition cell}, i.e., a single orthogonal edge segment enters and exits the cell. - * @see yfiles.router.EdgeCellInfo#type - */ - STRAIGHT, - /** - * A routing type representing a crossing of the {@link yfiles.router.PartitionCell partition cell} with three segments, i.e., the edge enters and exits the - * cell using the same direction but has an orthogonal middle segment between the entering and exiting segment. - * @see yfiles.router.EdgeCellInfo#type - */ - STRAIGHT_BENDING, - /** - * A routing type representing a crossing of the {@link yfiles.router.PartitionCell partition cell} with a single bend, i.e., the edge enters the cell in one - * direction, makes a bend and exits the cell in an orthogonal direction. - * @see yfiles.router.EdgeCellInfo#type - */ - BENDING, - /** - * A routing type representing a crossing of the {@link yfiles.router.PartitionCell partition cell} by making a U-turn, i.e., the edge enters and exits the - * cell on the same side using two turns and an orthogonal middle segment. - * @see yfiles.router.EdgeCellInfo#type - */ - U_TURN, - /** - * A routing type representing the source or target end of an edge being in the cell, i.e., the enter and/or exit interval - * is null. - * @see yfiles.router.EdgeCellInfo#type - */ - END - } - /** - * A {@link yfiles.router.GraphPartition} partitions the bounding box of a graph into rectangles using the graph elements as - * {@link yfiles.router.Obstacle}s. - *

- * All {@link yfiles.router.Obstacle}s used during the partitioning are {@link yfiles.router.GraphPartition#createObstacle created} by {@link yfiles.router.IGraphPartitionExtension}s. - * {@link yfiles.router.IGraphPartitionExtension}s have been {@link yfiles.router.GraphPartition#addDynamicDecompositionListener registered} before using method {@link yfiles.router.IGraphPartitionExtension#preparePartition} - * which is called during the {@link yfiles.router.GraphPartition#init initialization} of a {@link yfiles.router.GraphPartition}. - *

- *

- * The core partitioning is delegated to an {@link yfiles.router.IObstaclePartition} that is {@link yfiles.router.IObstaclePartition#init initialized} with these - * {@link yfiles.router.Obstacle}s. - *

- *

- * If the {@link yfiles.router.IObstaclePartition} is of type {@link yfiles.router.IDynamicDecomposition}, {@link yfiles.router.GraphPartition} - * re-dispatches the decomposition notifications to its extensions. - *

- * @see yfiles.router.IGraphPartitionExtension - * @class - * @implements {yfiles.router.IPartition} - * @implements {yfiles.router.IDynamicDecomposition} - * @implements {yfiles.router.IDecompositionListener} - */ - export interface GraphPartition extends yfiles.lang.Object,yfiles.router.IPartition,yfiles.router.IDynamicDecomposition,yfiles.router.IDecompositionListener{} - export class GraphPartition { - /** - * Creates a new {@link yfiles.router.GraphPartition} instance using the given {@link yfiles.router.GraphPartition#partition delegate inner obstacle partition}. - * @param partition the delegate inner obstacle partition - */ - constructor(partition:yfiles.router.IObstaclePartition); - /** - * Adds the given listener to the {@link yfiles.router.GraphPartition}. - *

- * The listener will be notified upon dynamic decomposition events. If it is a {@link yfiles.router.IGraphPartitionExtension}, - * method {@link yfiles.router.IGraphPartitionExtension#preparePartition} is called during {@link yfiles.router.GraphPartition#init initialization}. - *

- * @param listener the listener to be added - */ - addDynamicDecompositionListener(listener:yfiles.router.IDecompositionListener):void; - /** - * Clears the {@link yfiles.router.GraphPartition partition} data such that the {@link yfiles.router.GraphPartition} can be reused and {@link yfiles.router.GraphPartition#init initialized} with a new - * configuration. - *

- * All {@link yfiles.router.IGraphPartitionExtension}s are {@link yfiles.router.IGraphPartitionExtension#cleanup cleaned up}; partition listeners and obstacles are {@link yfiles.router.GraphPartition#removeDynamicDecompositionListener removed}. - *

- * @see yfiles.router.GraphPartition#init - */ - clear():void; - /** - * Creates and returns a new {@link yfiles.router.Obstacle} using the given bounds and data. - *

- * All obstacles created via this method are delegated to the {@link yfiles.router.GraphPartition#partition inner partition} upon {@link yfiles.router.GraphPartition#init initialization}. - *

- * @param bounds the bounds of the obstacle - * @param data the additional data that should be associated with the obstacle - * @returns a new {@link } using the given bounds and data - */ - createObstacle(bounds:yfiles.algorithms.YRectangle,data:any):yfiles.router.Obstacle; - /** - * Returns a list of all {@link yfiles.router.PartitionCell}s that intersect or cover the given rectangle by delegating to the - * corresponding method of the {@link yfiles.router.GraphPartition#partition inner partition}. - * @param rect the rectangular area whose (partially) covered cells will be returned - * @returns a list containing (partially) covered {@link }s - * @see yfiles.router.IPartition#getCells - */ - getCells(rect:yfiles.algorithms.YRectangle):yfiles.collections.IList; - /** - * Returns all {@link yfiles.router.PartitionCell}s that are completely covered by the bounds of the given node. - * @param node the node for which the covered cells will be returned - * @returns an unmodifiable list of {@link } instances that are completely covered by the bounds of the given - * node - * @throws {Stubs.Exceptions.ArgumentError} if the node is unknown - */ - getCellsForNode(node:yfiles.algorithms.Node):yfiles.collections.IList; - /** - * Returns a list of all - * {@link yfiles.router.PartitionCell}s that are neighbors of the given cell, i.e., those cells that have a common border segment - * with the given cell. - * @param cell the cell whose neighbors will be returned - * @returns a list of {@link }s that are neighbors of the given cell - */ - getNeighbors(cell:yfiles.router.PartitionCell):yfiles.collections.IList; - /** - * Returns a list of all {@link yfiles.algorithms.Node}s whose bounds intersect or cover the bounds of the given cell. - * @param cell the cell - * @returns a list of {@link }s that are intersected by the given cell - */ - getNodes(cell:yfiles.router.PartitionCell):yfiles.collections.IList; - /** - * Returns the {@link yfiles.router.Obstacle} that has been created earlier for the given data object. - * @param data the given data for which the obstacle will be returned - * @returns the {@link } that has been created earlier for the given data object - */ - getObstacle(data:any):yfiles.router.Obstacle; - /** - * Returns all {@link yfiles.router.Obstacle}s covering the given {@link yfiles.router.PartitionCell} by delegating to the corresponding - * method of the {@link yfiles.router.GraphPartition#partition inner partition}. - * @param cell the cell whose obstacles will be returned - * @returns a list of {@link }s that cover the given cell - * @see yfiles.router.IObstaclePartition#getObstacles - */ - getObstacles(cell:yfiles.router.PartitionCell):yfiles.collections.IList; - /** - * Initializes the {@link yfiles.router.GraphPartition} with the given graph instance based on the given {@link yfiles.router.PathSearchConfiguration configuration} used by path - * search algorithms. - *

- * Before calling this method, any old partitioning information must be {@link yfiles.router.GraphPartition#clear cleared}. - *

- *

- * This initialization method calls {@link yfiles.router.IGraphPartitionExtension#preparePartition} of all registered extensions. - * Then, the {@link yfiles.router.GraphPartition#partition inner delegate partition} is initialized passing all {@link yfiles.router.GraphPartition#createObstacle added} obstacles as well as the given graph's bounds - * extended by a small padding. - *

- *

- * In the case where the {@link yfiles.router.GraphPartition#partition delegate partition} is of type {@link yfiles.router.IDynamicDecomposition}, this {@link yfiles.router.GraphPartition} - * will also be added as {@link yfiles.router.IDecompositionListener} to it. - *

- * @param configuration the configuration used by path search algorithms - * @see yfiles.router.GraphPartition#clear - * @see yfiles.router.IGraphPartitionExtension#preparePartition - * @see yfiles.router.GraphPartition#addDynamicDecompositionListener - */ - init(configuration:yfiles.router.PathSearchConfiguration):void; - /** - * Re-dispatches the event of the creation of a new {@link yfiles.router.PartitionCell} to all registered - * {@link yfiles.router.IDecompositionListener}s. - *

- * This method is a callback after a {@link yfiles.router.PartitionCell} has been created. - *

- * @param createdCell the newly created {@link } - */ - onCellCreated(createdCell:yfiles.router.PartitionCell):void; - /** - * Re-dispatches the event of having completed the process of subdivisions of a given {@link yfiles.router.PartitionCell} to all - * registered {@link yfiles.router.IDecompositionListener}s. - *

- * This method is a callback after a {@link yfiles.router.PartitionCell} has been finalized and won't be further subdivided. - *

- * @param finalizedCell the cell that has been finalized - */ - onCellFinalized(finalizedCell:yfiles.router.PartitionCell):void; - /** - * Re-dispatches the event of the subdivision of a given {@link yfiles.router.PartitionCell} into several sub-cells to all - * registered {@link yfiles.router.IDecompositionListener}s. - *

- * This method is a callback after a {@link yfiles.router.PartitionCell} has been subdivided into several sub-cells. - *

- * @param cell the cell that has been subdivided - * @param subCells the sub-cells resulting from the subdivision of the given {@link } - */ - onCellSubdivided(cell:yfiles.router.PartitionCell,subCells:yfiles.collections.IList):void; - /** - * Removes the given listener from the {@link yfiles.router.GraphPartition}. - *

- * The listener will not be notified of dynamic decomposition events anymore. - *

- * @param listener the listener to be removed - */ - removeDynamicDecompositionListener(listener:yfiles.router.IDecompositionListener):void; - /** - * Gets the delegate inner obstacle partition. - * @protected - * @type {yfiles.router.IObstaclePartition} - */ - partition:yfiles.router.IObstaclePartition; - /** - * Gets the bounds of the original rectangular area that is being partitioned. - *

- * This method delegates to the corresponding method of the {@link yfiles.router.GraphPartition#partition inner partition}. - *

- * @see yfiles.router.IPartition#bounds - * @type {yfiles.algorithms.YRectangle} - */ - bounds:yfiles.algorithms.YRectangle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.GraphPartition; - } - /** - * {@link yfiles.router.GraphPartitionExtensionAdapter} provides an empty implementation of - * {@link yfiles.router.IGraphPartitionExtension}. - *

- * The only real functionality is contained in method {@link yfiles.router.IGraphPartitionExtension#preparePartition} which stores - * the given {@link yfiles.router.PathSearchConfiguration} and {@link yfiles.router.GraphPartition} in properties. - *

- * @see yfiles.router.GraphPartitionExtensionAdapter#configuration - * @see yfiles.router.GraphPartitionExtensionAdapter#graphPartition - * @class - * @implements {yfiles.router.IGraphPartitionExtension} - */ - export interface GraphPartitionExtensionAdapter extends yfiles.lang.Object,yfiles.router.IGraphPartitionExtension{} - export class GraphPartitionExtensionAdapter { - /** - * Creates a new instance of {@link yfiles.router.GraphPartitionExtensionAdapter}. - */ - constructor(); - /** - * - */ - cleanup():void; - /** - * - * @param createdCell - */ - onCellCreated(createdCell:yfiles.router.PartitionCell):void; - /** - * - * @param finalizedCell - */ - onCellFinalized(finalizedCell:yfiles.router.PartitionCell):void; - /** - * - * @param cell - * @param subCells - */ - onCellSubdivided(cell:yfiles.router.PartitionCell,subCells:yfiles.collections.IList):void; - /** - * Stores the given {@link yfiles.router.PathSearchConfiguration} and {@link yfiles.router.GraphPartition} such that they are accessible - * through {@link yfiles.router.GraphPartitionExtensionAdapter#configuration} and {@link yfiles.router.GraphPartitionExtensionAdapter#graphPartition}, respectively. - * @param configuration the configuration used for the path search - * @param graphPartition the graph partition that uses this extension - */ - preparePartition(configuration:yfiles.router.PathSearchConfiguration,graphPartition:yfiles.router.GraphPartition):void; - /** - * Gets the {@link yfiles.router.GraphPartition} passed to {@link yfiles.router.IGraphPartitionExtension#preparePartition}. - * @protected - * @type {yfiles.router.GraphPartition} - */ - graphPartition:yfiles.router.GraphPartition; - /** - * Gets the configuration of the {@link yfiles.router.PathSearch} passed to - * {@link yfiles.router.IGraphPartitionExtension#preparePartition}. - * @protected - * @type {yfiles.router.PathSearchConfiguration} - */ - configuration:yfiles.router.PathSearchConfiguration; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.GraphPartitionExtensionAdapter; - } - /** - * This class provides support for routing edges on equidistant grid lines. - *

- * The grid is defined by its origin and the spacing between the equidistant grid lines. - *

- * @class - * @final - */ - export interface Grid extends yfiles.lang.Object{} - export class Grid { - /** - * Creates a new {@link yfiles.router.Grid} instance. - *

- * The spacing between the grid lines must be at least 1. If the given spacing is smaller, value 1 is assumed. - *

- * @param originX the x-coordinate of the origin of the grid - * @param originY the y-coordinate of the origin of the grid - * @param spacing the spacing between the grid lines - */ - constructor(originX:number,originY:number,spacing:number); - /** - * Gets the x-coordinate of the origin. - * @type {number} - */ - originX:number; - /** - * Gets the y-coordinate of the origin. - * @type {number} - */ - originY:number; - /** - * Gets the spacing between the horizontal and vertical grid lines. - * @type {number} - */ - spacing:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.Grid; - } - /** - * This interface should be implemented by classes that dispatch notifications about changes in {@link yfiles.router.IPartition}s. - *

- * Such classes can be notified when {@link yfiles.router.PartitionCell}s are created, divided, and/or finalized. - *

- * @see yfiles.router.IDecompositionListener - * @interface - */ - export interface IDynamicDecomposition extends yfiles.lang.Object{ - /** - * Adds the given {@link yfiles.router.IDecompositionListener} that will be notified of dynamic decomposition events to the - * {@link yfiles.router.IPartition}. - * @param listener the listener to be added - * @abstract - */ - addDynamicDecompositionListener(listener:yfiles.router.IDecompositionListener):void; - /** - * Removes the given {@link yfiles.router.IDecompositionListener} from the {@link yfiles.router.IPartition}. - *

- * The {@link yfiles.router.IDecompositionListener} will be no more notified of dynamic decomposition events. - *

- * @param listener the listener to be removed - * @abstract - */ - removeDynamicDecompositionListener(listener:yfiles.router.IDecompositionListener):void; - } - var IDynamicDecomposition:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.router.IDynamicDecomposition; - }; - /** - * This interface is implemented by classes that require to be notified of changes in {@link yfiles.router.IPartition}s. - *

- * Implementations are notified when {@link yfiles.router.PartitionCell}s are created, divided, and/or finalized. - *

- * @interface - */ - export interface IDecompositionListener extends yfiles.lang.Object{ - /** - * Callback after the new given {@link yfiles.router.PartitionCell} has been created. - * @param createdCell the newly created {@link } - * @abstract - */ - onCellCreated(createdCell:yfiles.router.PartitionCell):void; - /** - * Callback after the given {@link yfiles.router.PartitionCell} has been finalized and won't be further subdivided. - * @param finalizedCell the cell that has been finalized - * @abstract - */ - onCellFinalized(finalizedCell:yfiles.router.PartitionCell):void; - /** - * Callback after the given {@link yfiles.router.PartitionCell} has been subdivided into several sub-cells. - *

- * {@link yfiles.router.IDecompositionListener} may not modify the list of sub-cells. - *

- * @param cell the cell that has been subdivided - * @param subCells the sub-cells resulting from the subdivision of the given {@link } - * @abstract - */ - onCellSubdivided(cell:yfiles.router.PartitionCell,subCells:yfiles.collections.IList):void; - } - var IDecompositionListener:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.router.IDecompositionListener; - }; - /** - * This interface provides additional intervals in order to move from one {@link yfiles.router.PartitionCell partition cell} into an adjacent one. - *

- * To find a {@link yfiles.router.Path} for an edge, the {@link yfiles.router.PathSearch} algorithm moves from the current partition cell - * to an adjacent partition cell. By default, the orthogonal interval shared by these two cells is used. Implementations of - * this interface may be added to the {@link yfiles.router.PathSearch} to calculate additional enter intervals that might - * accumulate lower costs for entering the adjacent cell. - *

- * @see yfiles.router.PartitionCell - * @see yfiles.router.PathSearch#addAdditionalEnterIntervalCalculator - * @interface - */ - export interface IEnterIntervalCalculator extends yfiles.lang.Object{ - /** - * Appends additional enter intervals to the given list of enter intervals for moving from the {@link yfiles.router.PartitionCell partition cell} of the - * current {@link yfiles.router.CellEntrance} to the neighboring cell. - * @param currentEntrance the current {@link } that is exited - * @param enteredCell the neighboring cell that will be entered - * @param commonInterval the common interval of the left and entered partition cells - * @param allEnterIntervals the list to which additional enter intervals have to be appended - * @param context the context of the path search - * @abstract - */ - appendEnterIntervals(currentEntrance:yfiles.router.CellEntrance,enteredCell:yfiles.router.PartitionCell,commonInterval:yfiles.router.OrthogonalInterval,allEnterIntervals:yfiles.collections.IList,context:yfiles.router.PathSearchContext):void; - } - var IEnterIntervalCalculator:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.router.IEnterIntervalCalculator; - }; - /** - * This interface provides methods for extending the functionality of a {@link yfiles.router.GraphPartition}. - *

- * A {@link yfiles.router.IGraphPartitionExtension} can be used for {@link yfiles.router.GraphPartition#createObstacle creating} new {@link yfiles.router.Obstacle}s that will be given to the - * initializer of the {@link yfiles.router.IObstaclePartition} where they can react to the {@link yfiles.router.IObstaclePartition}'s - * decomposition events if it implements the {@link yfiles.router.IDynamicDecomposition} interface. - *

- *

- * A {@link yfiles.router.IGraphPartitionExtension} has to be {@link yfiles.router.GraphPartition#addDynamicDecompositionListener added} to the {@link yfiles.router.GraphPartition} which will call method {@link yfiles.router.IGraphPartitionExtension#preparePartition} - * before the {@link yfiles.router.IObstaclePartition} is initialized. - *

- * @interface - * @implements {yfiles.router.IDecompositionListener} - */ - export interface IGraphPartitionExtension extends yfiles.lang.Object,yfiles.router.IDecompositionListener{ - /** - * Cleans up the extension from the last partitioning with the current {@link yfiles.router.PathSearchConfiguration configuration} and {@link yfiles.router.GraphPartition}. - * @abstract - */ - cleanup():void; - /** - * Adds a {@link yfiles.router.IGraphPartitionExtension} to the {@link yfiles.router.GraphPartition}. - *

- * It is called by the given {@link yfiles.router.GraphPartition} upon initialization before its {@link yfiles.router.IObstaclePartition} - * is initialized. Implementations may use the graph upon which the given {@link yfiles.router.GraphPartition} is based to - * initialize themselves and/or to {@link yfiles.router.GraphPartition#createObstacle add obstacles} to the list with which {@link yfiles.router.IObstaclePartition} is initialized. - *

- * @param configuration the configuration used for the path search - * @param graphPartition the graph partition that uses this extension - * @abstract - */ - preparePartition(configuration:yfiles.router.PathSearchConfiguration,graphPartition:yfiles.router.GraphPartition):void; - } - var IGraphPartitionExtension:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.router.IGraphPartitionExtension; - }; - /** - * This class implements a {@link yfiles.router.IPartition} that takes a list of {@link yfiles.router.Obstacle}s as input to subdivide an - * area into {@link yfiles.router.PartitionCell}s. - *

- * Implementations have to satisfy the following condition for each pair of {@link yfiles.router.Obstacle} and - * {@link yfiles.router.PartitionCell}: - *

- *
    - *
  • - * {@link yfiles.router.Obstacle}s either completely cover {@link yfiles.router.PartitionCell}s or do not intersect - * {@link yfiles.router.PartitionCell}s at all. - *
  • - *
- *

- * {@graph {"ann":{"s":[40,40],"d":1},"styles":{"6":{"s":"#0000ff", "f":null}},"n":[[380,280,[[394.66,309.35,10.67,18.7,"1"]]],[580,400,[[594.66,429.35,10.67,18.7,"2"]]],[240.2,280,139.8,40,6],[240.2,159.2,179.8,120.8,6],[240.2,320,179.95,280,6],[420.15,440,200,160,6],[420.15,400,159.85,40,6],[420.15,159.2,319.2,240.8,6],[620,400,119.35,200,6]],"e":[[0,1,[400,420]]],"vp":[240.0,159.0,500.0,441.0]}} Example of an {@link yfiles.router.IObstaclePartition} of a graph consisting of two nodes connected by one edge. The two nodes - * are considered to be obstacles. The colored partition cells subdivide the area such that each obstacle either completely - * covers a partition cell or does not intersect with a partition cell. - *

- * @interface - * @implements {yfiles.router.IPartition} - */ - export interface IObstaclePartition extends yfiles.lang.Object,yfiles.router.IPartition{ - /** - * Clears the partition data such that the {@link yfiles.router.IObstaclePartition} can be reused and {@link yfiles.router.IObstaclePartition#init initialized} with new - * {@link yfiles.router.Obstacle}s. - * @see yfiles.router.IObstaclePartition#init - * @abstract - */ - clear():void; - /** - * Returns all {@link yfiles.router.PartitionCell}s that are completely covered by the given {@link yfiles.router.Obstacle}. - * @param obstacle the obstacle for which the covered cells will be returned - * @returns an unmodifiable list of {@link } instances that are completely covered by the given obstacle - * @abstract - */ - getCellsForObstacle(obstacle:yfiles.router.Obstacle):yfiles.collections.IList; - /** - * Returns all {@link yfiles.router.Obstacle}s that cover the given {@link yfiles.router.PartitionCell}. - * @param cell the partition cell for which the obstacles will be returned - * @returns an unmodifiable list of {@link } instances that cover the given cell - * @abstract - */ - getObstacles(cell:yfiles.router.PartitionCell):yfiles.collections.IList; - /** - * Initializes a new {@link yfiles.router.IObstaclePartition} of the area with the given bounds using the given list of - * {@link yfiles.router.Obstacle}s. - *

- * Unused partitions must be cleared using method {@link yfiles.router.IObstaclePartition#clear}. - *

- * @param obstacles a list of {@link }s that have to be considered by the partition - * @param bounds the bounds of the partition - * @see yfiles.router.IObstaclePartition#clear - * @abstract - */ - init(obstacles:yfiles.collections.IList,bounds:yfiles.algorithms.YRectangle):void; - } - var IObstaclePartition:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.router.IObstaclePartition; - }; - /** - * This class divides a rectangular area into one or more {@link yfiles.router.PartitionCell}s. - *

- * {@link yfiles.router.PartitionCell}s have to be disjoint. The union of all - * {@link yfiles.router.PartitionCell}s covers the original area. - *

- * @interface - */ - export interface IPartition extends yfiles.lang.Object{ - /** - * Returns a list of all {@link yfiles.router.PartitionCell}s that intersect or cover the given rectangle. - * @param rect the rectangular area whose (partially) covered cells will be returned - * @returns a list of {@link }s that (partially) cover the given rectangular area - * @abstract - */ - getCells(rect:yfiles.algorithms.YRectangle):yfiles.collections.IList; - /** - * Returns a list of all - * {@link yfiles.router.PartitionCell}s that are neighbors of the given cell, i.e., those cells that have a common border segment - * with the given cell. - * @param cell the cell whose neighbors will be returned - * @returns a list of {@link }s that are neighbors of the given cell - * @abstract - */ - getNeighbors(cell:yfiles.router.PartitionCell):yfiles.collections.IList; - /** - * Gets the bounds of the original rectangular area that is partitioned. - * @abstract - * @type {yfiles.algorithms.YRectangle} - */ - bounds:yfiles.algorithms.YRectangle; - } - var IPartition:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.router.IPartition; - }; - /** - * This class represents a one-dimensional closed interval. - * @class - */ - export interface Interval extends yfiles.lang.Object{} - export class Interval { - /** - * Creates a new {@link yfiles.router.Interval} between the given bounds. - *

- * The upper and lower bound of the two given values are determined automatically, i.e., the smaller one will be treated as - * the lower bound and the larger one as the upper bound. - *

- * @param bound1 the first interval bound - * @param bound2 the second interval bound - */ - constructor(bound1:number,bound2:number); - /** - * Returns the bridging {@link yfiles.router.Interval interval} between the given {@link yfiles.router.Interval intervals}. - *

- * The bridging interval is null if the given intervals intersect each other. Otherwise, the bridging interval is - * [minimum of upper bounds, maximum of lower bounds]. - *

- * @param i1 the first interval - * @param i2 the second interval - * @returns the bridging interval between the given intervals or null if the intervals intersect - * @static - */ - static calculateBridge(i1:yfiles.router.Interval,i2:yfiles.router.Interval):yfiles.router.Interval; - /** - * Returns the intersection of the given {@link yfiles.router.Interval intervals}. - *

- * The intersection is null if the given intervals do not intersect each other. Otherwise, the intersection is - * [maximum of lower bounds, minimum of upper bounds]. - *

- * @param i1 the first interval - * @param i2 the second interval - * @returns the intersection of the given intervals or null if the intervals do not intersect - * @static - */ - static calculateIntersection(i1:yfiles.router.Interval,i2:yfiles.router.Interval):yfiles.router.Interval; - /** - * Returns the spanning rectangle between the given {@link yfiles.router.Interval intervals}. - *

- * The first interval spans the rectangle in horizontal dimension, the second interval in vertical dimension. - *

- * @param horizontal the interval that defines the location and length of the rectangle in horizontal dimension - * @param vertical the interval that defines the location and length of the rectangle in vertical dimension - * @returns the spanning rectangle between the given intervals - * @static - */ - static calculateSpanningRectangle(horizontal:yfiles.router.Interval,vertical:yfiles.router.Interval):yfiles.algorithms.YRectangle; - /** - * Returns the union of the given {@link yfiles.router.Interval intervals} and the given value. - *

- * The union is between the minimum of the lower bound of the given interval and the given value and the maximum of the - * upper bound of the given interval and the given value. - *

- * @param interval the interval to be extended - * @param value the value to be in the union - * @returns the union of the given interval and the given value - * @static - */ - static calculateUnion(interval:yfiles.router.Interval,value:number):yfiles.router.Interval; - /** - * Returns the union of the given {@link yfiles.router.Interval intervals}. - *

- * The union is [minimum of lower bounds, maximum of upper bounds]. - *

- * @param i1 the first interval - * @param i2 the second interval - * @returns the union of the given intervals - * @static - */ - static calculateUnion(i1:yfiles.router.Interval,i2:yfiles.router.Interval):yfiles.router.Interval; - /** - * Checks whether or not the given value lies within the interval. - * @param value the value to check - * @returns true if the value lies within the interval, false otherwise - */ - contains(value:number):boolean; - /** - * Checks whether or not the given {@link yfiles.router.Interval interval} fully covers this {@link yfiles.router.Interval interval} given a small epsilon value. - *

- * The given interval covers this interval, if other lower bound - epsilon <= this lower bound and - * this upper bound <= other upper bound + epsilon. - *

- * @param other the other interval - * @param [eps=1E-06] the epsilon value that determines the extended range of the other interval - * @returns true if this interval is fully covered by the other interval, false otherwise - */ - coveredBy(other:yfiles.router.Interval,eps?:number):boolean; - /** - * Returns the distance between this {@link yfiles.router.Interval interval} and the given {@link yfiles.router.Interval interval}. - *

- * If the intervals {@link yfiles.router.Interval#intersects intersect}, the distance is 0. Otherwise, it is equal to - * dist(minimum of upper bounds, maximum of lower bounds). - *

- * @param other the other interval to which the distance is calculated - * @returns the distance between this interval and the given interval - */ - distanceTo(other:yfiles.router.Interval):number; - /** - * Returns the distance between the value and this {@link yfiles.router.Interval interval}. - *

- * If this interval contains the specified value, the distance is 0. Otherwise, it is the minimum of dist(value, lower bound) - * and dist(value, upper bound). - *

- * @param value the value to which the distance is calculated - * @returns the distance between the value and the interval - */ - distanceTo(value:number):number; - /** - * Returns the {@link yfiles.router.Interval interval} bound that is closest to the given value. - * @param value the value for which the closest interval bound will be returned - * @returns - *
    - *
  • the value, if the given value lies within the interval, or
  • - *
  • the lower bound, if the given value is smaller than or equal to the lower bound, or
  • - *
  • the upper bound, if the given value is greater than or equal to the upper bound
  • - *
- */ - getClosest(value:number):number; - /** - * Checks whether or not this {@link yfiles.router.Interval interval} and the given {@link yfiles.router.Interval interval} cover the same range. - *

- * The intervals are considered to cover the same range, if their minimum values as well as their maximum values differ - * only in the given epsilon value. - *

- * @param other the other interval - * @param [eps=1E-06] the maximum distance between the two minimum and the two maximum values - * @returns true if the intervals cover the same range, false otherwise - */ - hasSameRange(other:yfiles.router.Interval,eps?:number):boolean; - /** - * Checks whether or not this {@link yfiles.router.Interval interval} intersects with the given - * {@link yfiles.router.Interval interval}, considering the given minimum intersection length. - * @param other the other interval to check - * @param [minIntersection=0] the minimum length of the intersection of the intervals - * @returns true if the intervals intersect at least by the given minimum length, false otherwise - */ - intersects(other:yfiles.router.Interval,minIntersection?:number):boolean; - /** - * Checks whether or not the lower bound of this {@link yfiles.router.Interval interval} is greater than the upper bound of the given interval. - * @param other the interval to compare - * @returns true if the current interval is on the right of the given one, false otherwise - */ - isGreaterThan(other:yfiles.router.Interval):boolean; - /** - * Checks whether or not the upper bound of this {@link yfiles.router.Interval interval} is smaller than the lower bound of the given interval. - * @param other the interval to compare - * @returns true if the current interval is on the left of the given one, false otherwise - */ - isLessThan(other:yfiles.router.Interval):boolean; - /** - * Gets the lower bound of the interval. - * @type {number} - */ - min:number; - /** - * Gets the upper bound of the interval. - * @type {number} - */ - max:number; - /** - * Gets the midpoint of the interval. - * @type {number} - */ - center:number; - /** - * Gets the size of the interval, i.e., the difference between the {@link yfiles.router.Interval#max upper bound} and the {@link yfiles.router.Interval#min lower bound}. - * @type {number} - */ - size:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.Interval; - } - /** - * This class describes the obstacles that are used by implementations of {@link yfiles.router.IObstaclePartition} to subdivide an - * area into {@link yfiles.router.PartitionCell}s. - * @class - */ - export interface Obstacle extends yfiles.lang.Object{} - export class Obstacle { - /** - * Creates a new {@link yfiles.router.Obstacle} instance with the given bounds and additional data. - * @param bounds the bounds of the obstacle - * @param data the additional data associated to the obstacle - */ - constructor(bounds:yfiles.algorithms.YRectangle,data:any); - /** - * Gets the bounds of the obstacle. - * @type {yfiles.algorithms.YRectangle} - */ - bounds:yfiles.algorithms.YRectangle; - /** - * Gets the additional data related to the obstacle. - * @type {any} - */ - data:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.Obstacle; - } - /** - * A horizontal or vertical {@link yfiles.router.Interval} that additionally stores a y- (in the horizontal case) or x-coordinate - * (in the vertical case). - *

- * During a {@link yfiles.router.PathSearch}, orthogonal intervals are used for specifying the location where an edge enters or - * exits a {@link yfiles.router.PartitionCell partition cell}. - *

- * @see yfiles.router.PathSearch - * @class - */ - export interface OrthogonalInterval extends yfiles.lang.Object{} - export class OrthogonalInterval { - /** - * Creates a new {@link yfiles.router.OrthogonalInterval} instance using the from and to value as interval bounds. - * @param from the start of the interval bounds - * @param to the end of the interval bounds - * @param location the location in the two-dimensional coordinate system - * @param isVertical true if the orthogonal interval is vertical, false if it is horizontal - * @throws {Stubs.Exceptions.ArgumentError} if the given range is null - */ - constructor(from:number,to:number,location:number,isVertical:boolean); - /** - * Creates a new {@link yfiles.router.OrthogonalInterval} instance with the given interval bounds. - * @param range the given range - * @param location the location in the two-dimensional coordinate system - * @param isVertical true if the orthogonal interval is vertical, false if it is horizontal - * @throws {Stubs.Exceptions.ArgumentError} if the given range is null - */ - constructor(range:yfiles.router.Interval,location:number,isVertical:boolean); - /** - * Calculates the intersection of the given {@link yfiles.router.OrthogonalInterval orthogonal intervals}. - *

- * If the returned orthogonal interval is vertical, it will have the same horizontal location as i2 and the shared vertical - * range of both intervals. If it is horizontal, it will have the same vertical location as i2 and the shared horizontal - * range of both intervals. The orthogonal intervals must have same orientation. - *

- * @param i1 the first orthogonal interval - * @param i2 the second orthogonal interval - * @returns the shared orthogonal interval of both given orthogonal intervals - * @throws {Stubs.Exceptions.ArgumentError} if the orthogonal intervals have different orientations - * @see yfiles.router.OrthogonalInterval#intersects - * @static - */ - static calculateIntersection(i1:yfiles.router.OrthogonalInterval,i2:yfiles.router.OrthogonalInterval):yfiles.router.OrthogonalInterval; - /** - * Calculates the union of the given {@link yfiles.router.OrthogonalInterval orthogonal intervals}. - *

- * If the returned orthogonal interval is vertical, it will have the same horizontal location as i2 and the shared vertical - * range of both orthogonal intervals. If it is horizontal, it will have the same vertical location as i2 and the shared - * vertical range of both orthogonal intervals. The orthogonal intervals must have same orientation. - *

- * @param i1 the first orthogonal interval - * @param i2 the second orthogonal interval - * @returns the union of both given orthogonal intervals - * @throws {Stubs.Exceptions.ArgumentError} if the orthogonal intervals have different orientations - * @see yfiles.router.OrthogonalInterval#intersects - * @static - */ - static calculateUnion(i1:yfiles.router.OrthogonalInterval,i2:yfiles.router.OrthogonalInterval):yfiles.router.OrthogonalInterval; - /** - * Checks whether or not this {@link yfiles.router.OrthogonalInterval orthogonal interval} is fully covered by the given {@link yfiles.router.OrthogonalInterval orthogonal interval}. - *

- * The given orthogonal interval covers this orthogonal interval, if this interval's range is covered by the given - * interval's range. The location of both orthogonal intervals is ignored. The orthogonal intervals must have the same - * orientation. - *

- * @param other the other orthogonal interval - * @returns true if this orthogonal interval is fully covered by the other orthogonal interval, false otherwise - * @throws {Stubs.Exceptions.ArgumentError} if the orthogonal intervals have different orientations - * @see yfiles.router.PartitionCell - */ - coveredBy(other:yfiles.router.OrthogonalInterval):boolean; - /** - * Determines whether or not this {@link yfiles.router.OrthogonalInterval orthogonal interval} crosses the given one. - *

- * The orthogonal intervals must have different orientations. - *

- * @param other the other orthogonal interval - * @returns true if this orthogonal interval crosses the given one, false otherwise - * @throws {Stubs.Exceptions.ArgumentError} if the given orthogonal intervals have the same orientation - */ - crosses(other:yfiles.router.OrthogonalInterval):boolean; - /** - * Returns the distance of the {@link yfiles.router.OrthogonalInterval#range ranges} of this {@link yfiles.router.OrthogonalInterval orthogonal interval} and the given {@link yfiles.router.OrthogonalInterval orthogonal interval}. - *

- * The orthogonal intervals must have the same orientation. - *

- * @param other the other orthogonal interval - * @returns 0 if the orthogonal intervals {@link #intersects intersect} each other, otherwise the minimal distance between the orthogonal intervals is - * returned - * @throws {Stubs.Exceptions.ArgumentError} if the orthogonal intervals have different orientations - */ - distanceTo(other:yfiles.router.OrthogonalInterval):number; - /** - * Checks whether or not this {@link yfiles.router.OrthogonalInterval orthogonal interval} and the given {@link yfiles.router.OrthogonalInterval orthogonal interval} cover the same range. - *

- * If both orthogonal intervals cover the same range, they are considered the same. The location of both orthogonal - * intervals is ignored. The orthogonal intervals must have the same orientation. - *

- * @param other the other orthogonal interval - * @returns true if the orthogonal intervals cover the same range, false otherwise - * @throws {Stubs.Exceptions.ArgumentError} if the orthogonal intervals have different orientations - * @see yfiles.router.PartitionCell - */ - hasSameRange(other:yfiles.router.OrthogonalInterval):boolean; - /** - * Checks whether or not this {@link yfiles.router.OrthogonalInterval orthogonal interval} intersects the given {@link yfiles.router.OrthogonalInterval orthogonal interval} and the intersection has a given - * minimum intersection size. - *

- * Orthogonal intervals intersect each other, if their ranges intersect each other by at least the given minimum - * intersection size. The location of both orthogonal intervals is ignored. The orthogonal intervals must have the same - * orientation. - *

- * @param other the other orthogonal interval - * @param [minIntersection=0] the minimum size of the intersection - * @returns true if this interval intersects the given other orthogonal interval, false otherwise - * @throws {Stubs.Exceptions.ArgumentError} if the orthogonal intervals have different orientations - * @see yfiles.router.PartitionCell - */ - intersects(other:yfiles.router.OrthogonalInterval,minIntersection?:number):boolean; - /** - * Returns the Manhattan distance of this {@link yfiles.router.OrthogonalInterval orthogonal interval} and the given {@link yfiles.router.OrthogonalInterval orthogonal interval}. - *

- * If both intervals have the same orientation, the Manhattan distance is the sum of the distance between the intervals' - * ranges and the distance between the intervals' locations. - *

- *

- * If the intervals have different orientations, the Manhattan distance is the sum of the distances between one interval's - * range and the other interval's location. - *

- * @param other the other orthogonal interval - * @returns the Manhattan distance between this interval and the given one - */ - manhattanDistanceTo(other:yfiles.router.OrthogonalInterval):number; - /** - * Gets whether or not the {@link yfiles.router.OrthogonalInterval orthogonal interval} is oriented vertically. - * @type {boolean} - */ - vertical:boolean; - /** - * Gets the lower bound of the {@link yfiles.router.OrthogonalInterval orthogonal interval}. - * @type {number} - */ - min:number; - /** - * Gets the upper bound of the {@link yfiles.router.OrthogonalInterval orthogonal interval}. - * @type {number} - */ - max:number; - /** - * Gets the length of the {@link yfiles.router.OrthogonalInterval orthogonal interval}. - * @see yfiles.router.Interval#size - * @type {number} - */ - size:number; - /** - * Gets the range of this {@link yfiles.router.OrthogonalInterval orthogonal interval}. - * @type {yfiles.router.Interval} - */ - range:yfiles.router.Interval; - /** - * Gets the vertical coordinate for horizontal intervals or the horizontal coordinate for vertical intervals, - * respectively. - * @type {number} - */ - location:number; - /** - * Gets the center of this {@link yfiles.router.OrthogonalInterval orthogonal interval} in the 2D-coordinate system. - * @type {yfiles.algorithms.YPoint} - */ - center:yfiles.algorithms.YPoint; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.OrthogonalInterval; - } - /** - * This class is a type-safe enumeration used for defining the border of a {@link yfiles.router.PartitionCell}. - * @see yfiles.router.PartitionCell#createBorderInterval - * @class - */ - export interface PartitionCellBorder extends yfiles.lang.Object{} - export class PartitionCellBorder { - /** - * Returns the type of the border that is passed through when entering a {@link yfiles.router.PartitionCell} in the given - * direction. - * @param direction the direction in which a {@link } has been entered - * @returns the type of the border that is passed through when entering a {@link } - * @see yfiles.router.PartitionCell - * @static - */ - static valueOfEnterDirection(direction:yfiles.layout.Direction):yfiles.router.PartitionCellBorder; - /** - * Returns the type of the border that is passed through when exiting a {@link yfiles.router.PartitionCell} in the given - * direction. - * @param direction the direction in which a {@link } has been exited - * @returns the type of the border that is passed through when exiting a {@link } - * @see yfiles.router.PartitionCell - * @static - */ - static valueOfExitDirection(direction:yfiles.layout.Direction):yfiles.router.PartitionCellBorder; - /** - * Returns the type of the border that is defined by the given {@link yfiles.layout.PortCandidate}. - *

- * The border type corresponds to the {@link yfiles.layout.PortCandidate#direction direction} of the given {@link yfiles.layout.PortCandidate}. - *

- * @param pc the port candidate for which the border type is returned - * @returns the type of the border that is defined by the given port candidate - * @see yfiles.layout.PortCandidate - * @static - */ - static valueOfPortCandidate(pc:yfiles.layout.PortCandidate):yfiles.router.PartitionCellBorder; - /** - * Returns the type of the border that is defined by the given {@link yfiles.layout.PortConstraint}. - *

- * The border type corresponds to the {@link yfiles.layout.PortConstraint#side side} of the given {@link yfiles.layout.PortConstraint}. - *

- * @param pc the port constraint for which the border type is returned - * @returns the type of the border that is defined by the given port constraint - * @see yfiles.layout.PortConstraint - * @static - */ - static valueOfPortConstraint(pc:yfiles.layout.PortConstraint):yfiles.router.PartitionCellBorder; - /** - * A type constant that defines the upper border of a {@link yfiles.router.PartitionCell}. - * @see yfiles.router.PartitionCell#createBorderInterval - * @const - * @static - * @type {yfiles.router.PartitionCellBorder} - */ - static NORTH:yfiles.router.PartitionCellBorder; - /** - * A type constant that defines the bottom border of a {@link yfiles.router.PartitionCell}. - * @see yfiles.router.PartitionCell#createBorderInterval - * @const - * @static - * @type {yfiles.router.PartitionCellBorder} - */ - static SOUTH:yfiles.router.PartitionCellBorder; - /** - * A type constant that defines the right border of a {@link yfiles.router.PartitionCell}. - * @see yfiles.router.PartitionCell#createBorderInterval - * @const - * @static - * @type {yfiles.router.PartitionCellBorder} - */ - static EAST:yfiles.router.PartitionCellBorder; - /** - * A type constant that defines the left border of a {@link yfiles.router.PartitionCell}. - * @see yfiles.router.PartitionCell#createBorderInterval - * @const - * @static - * @type {yfiles.router.PartitionCellBorder} - */ - static WEST:yfiles.router.PartitionCellBorder; - /** - * Gets the type of the border that is on the opposite side of the border defined by this type. - * @type {yfiles.router.PartitionCellBorder} - */ - mirrorBorder:yfiles.router.PartitionCellBorder; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PartitionCellBorder; - } - /** - * A {@link yfiles.router.PartitionCell} represents a rectangular part of a {@link yfiles.router.IPartition} as result of the decomposition - * process. - *

- * Each instance of {@link yfiles.router.PartitionCell} can hold arbitrary additional information (e.g. what element of the graph - * is covered by a {@link yfiles.router.PartitionCell}) which can be provided using method {@link yfiles.router.PartitionCell#putData}. - * Accessing and removing this information can be done using {@link yfiles.router.PartitionCell#getData} and - * {@link yfiles.router.PartitionCell#removeData}, respectively. - *

- * @see yfiles.router.PartitionCellKeys - * @class - */ - export interface PartitionCell extends yfiles.lang.Object{} - export class PartitionCell { - /** - * Creates a new {@link yfiles.router.PartitionCell} instance of the given {@link yfiles.router.IPartition} with the given bounds. - * @param x the x-coordinate of the upper-left corner of the partition cell - * @param y the y-coordinate of the upper-left corner of the partition cell - * @param width the width of the partition cell - * @param height the height of the partition cell - * @param partition the partition to which the partition cell belongs - * @see yfiles.router.IPartition - */ - constructor(x:number,y:number,width:number,height:number,partition:yfiles.router.IPartition); - /** - * Creates a new {@link yfiles.router.PartitionCell} of the given {@link yfiles.router.IPartition} with the location and the size of the - * given rectangle. - * @param bounds the bounds describing the size and location of the partition cell - * @param partition the partition to which the partition cell belongs - * @see yfiles.router.IPartition - */ - constructor(bounds:yfiles.algorithms.YRectangle,partition:yfiles.router.IPartition); - /** - * Clears all additional data for this {@link yfiles.router.PartitionCell}. - * @see yfiles.router.PartitionCell#getData - * @see yfiles.router.PartitionCell#putData - * @see yfiles.router.PartitionCell#removeData - */ - clearData():void; - /** - * Returns an {@link yfiles.router.OrthogonalInterval} that defines the location, the size and the orientation of the given - * {@link yfiles.router.PartitionCellBorder}. - *

- * The values defining the border are: - *

- *
    - *
  • {@link yfiles.router.PartitionCellBorder#WEST}
  • - *
  • {@link yfiles.router.PartitionCellBorder#EAST}
  • - *
  • {@link yfiles.router.PartitionCellBorder#NORTH}
  • - *
  • {@link yfiles.router.PartitionCellBorder#SOUTH}
  • - *
- * @param border a border of this partition cell - * @returns an {@link } that defines the location, the size and the orientation of the given border - * @see yfiles.router.PartitionCellBorder - */ - createBorderInterval(border:yfiles.router.PartitionCellBorder):yfiles.router.OrthogonalInterval; - /** - * Returns the additional data associated with the given key for this {@link yfiles.router.PartitionCell}. - * @param key the key whose associated data will be returned - * @returns the additional data associated with the given key or null if there is no data associated with the given key - * @see yfiles.router.PartitionCell#putData - * @see yfiles.router.PartitionCell#removeData - * @see yfiles.router.PartitionCell#clearData - * @see yfiles.router.PartitionCellKeys - */ - getData(key:any):any; - /** - * Stores the additional data associated with the given key for this {@link yfiles.router.PartitionCell}. - * @param key the key with which the additional data will be associated - * @param data the additional data - * @returns the previous data associated with the given key or null if there was no data associated with the given key - * @see yfiles.router.PartitionCell#getData - * @see yfiles.router.PartitionCell#removeData - * @see yfiles.router.PartitionCell#clearData - * @see yfiles.router.PartitionCellKeys - */ - putData(key:any,data:any):any; - /** - * Removes the additional data associated with the given key for this {@link yfiles.router.PartitionCell}. - * @param key the key for which the associated data will be removed - * @returns the additional data associated with the given key or null if there is no data associated with the given key - * @see yfiles.router.PartitionCell#getData - * @see yfiles.router.PartitionCell#putData - * @see yfiles.router.PartitionCell#clearData - * @see yfiles.router.PartitionCellKeys - */ - removeData(key:any):any; - /** - * Gets the {@link yfiles.router.IPartition partition} to which this {@link yfiles.router.PartitionCell} belongs. - * @see yfiles.router.IPartition - * @type {yfiles.router.IPartition} - */ - partition:yfiles.router.IPartition; - /** - * Gets a unique identifier of this {@link yfiles.router.PartitionCell}. - * @type {number} - */ - id:number; - /** - * Gets the bounds of this {@link yfiles.router.PartitionCell}. - * @type {yfiles.algorithms.YRectangle} - */ - bounds:yfiles.algorithms.YRectangle; - /** - * Gets the x-coordinate of the left border of this {@link yfiles.router.PartitionCell}. - * @type {number} - */ - minX:number; - /** - * Gets the y-coordinate of the upper border of this {@link yfiles.router.PartitionCell}. - * @type {number} - */ - minY:number; - /** - * Gets the x-coordinate of the right border of this {@link yfiles.router.PartitionCell}. - * @type {number} - */ - maxX:number; - /** - * Gets the y-coordinate of the bottom border of this {@link yfiles.router.PartitionCell}. - * @type {number} - */ - maxY:number; - /** - * Gets the width of this {@link yfiles.router.PartitionCell}. - * @type {number} - */ - width:number; - /** - * Gets the height of this {@link yfiles.router.PartitionCell}. - * @type {number} - */ - height:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PartitionCell; - } - /** - * This class defines keys to obtain additional information about a {@link yfiles.router.PartitionCell}. - *

- * In order to get the data of the {@link yfiles.router.PartitionCell} that is associated with the given key, method {@link yfiles.router.PartitionCell#getData} - * should be used. - *

- * @class - * @static - */ - export interface PartitionCellKeys extends yfiles.lang.Object{} - export class PartitionCellKeys { - /** - * The key references a {@link yfiles.collections.IList.} of nodes whose bounds are covering a certain {@link yfiles.router.PartitionCell}. - * @const - * @static - * @type {any} - */ - static NODES_KEY:any; - /** - * The key references a {@link yfiles.collections.IList.} of nodes being in node to edge distance to a certain {@link yfiles.router.PartitionCell}. - * @const - * @static - * @type {any} - */ - static NODES_IN_NODE_TO_EDGE_DISTANCE_KEY:any; - /** - * The key references a {@link yfiles.collections.IList.} of {@link yfiles.layout.INodeLabelLayout}s covering a certain {@link yfiles.router.PartitionCell}. - * @const - * @static - * @type {any} - */ - static NODE_LABEL_LAYOUTS_KEY:any; - /** - * The key references a {@link yfiles.collections.IList.} of {@link number} values representing factors that are multiplied by an edge's {@link yfiles.router.PenaltySettings#nodeLabelCrossingPenalty node label crossing costs} in case - * the edge crosses the corresponding {@link yfiles.layout.INodeLabelLayout node label} registered with key - * {@link yfiles.router.PartitionCellKeys#NODE_LABEL_LAYOUTS_KEY}. - * @const - * @static - * @type {any} - */ - static NODE_LABEL_CROSSING_COST_FACTORS_KEY:any; - /** - * The key references a {@link yfiles.collections.IList.} of {@link yfiles.layout.IEdgeLabelLayout}s covering a certain {@link yfiles.router.PartitionCell}. - * @const - * @static - * @type {any} - */ - static EDGE_LABEL_LAYOUTS_KEY:any; - /** - * The key references a {@link yfiles.collections.IList.} of {@link number} values representing factors that are multiplied by an edge's {@link yfiles.router.PenaltySettings#edgeLabelCrossingPenalty edge label crossing costs} in case - * the edge crosses the corresponding {@link yfiles.layout.IEdgeLabelLayout edge label} registered with key - * {@link yfiles.router.PartitionCellKeys#EDGE_LABEL_LAYOUTS_KEY}. - * @const - * @static - * @type {any} - */ - static EDGE_LABEL_CROSSING_COST_FACTORS_KEY:any; - /** - * The key references the {@link yfiles.layout.PartitionCellId} of the {@link yfiles.layout.PartitionGrid} cell covering a certain - * {@link yfiles.router.PartitionCell}. - * @const - * @static - * @type {any} - */ - static PARTITION_GRID_CELL_ID_KEY:any; - /** - * The key references the row index of the {@link yfiles.layout.PartitionGrid} cell covering a certain - * {@link yfiles.router.PartitionCell}. - * @const - * @static - * @type {any} - */ - static PARTITION_GRID_ROW_INDEX_KEY:any; - /** - * The key references the column index of the {@link yfiles.layout.PartitionGrid} cell covering a certain - * {@link yfiles.router.PartitionCell}. - * @const - * @static - * @type {any} - */ - static PARTITION_GRID_COLUMN_INDEX_KEY:any; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PartitionCellKeys; - } - /** - * A {@link yfiles.router.Path} represents the result of a path search as a list of consecutive {@link yfiles.router.CellEntrance}s. - *

- * A path starts with a {@link yfiles.router.CellEntrance} for a {@link yfiles.router.PartitionCell} of the source node and ends with one - * for a {@link yfiles.router.PartitionCell} of the target node. - *

- * @see yfiles.router.PathSearch - * @see yfiles.router.PathSearchResult - * @class - */ - export interface Path extends yfiles.lang.Object{} - export class Path { - /** - * Creates a new instance of {@link yfiles.router.Path} for the given edge, {@link yfiles.router.CellEntrance cell entrances} and cost. - * @param edge the edge for which the path was calculated - * @param entrances the list of {@link } objects describing the edge path from source node to target node - * @param cost the overall cost of this path - */ - constructor(edge:yfiles.algorithms.Edge,entrances:yfiles.collections.IList,cost:number); - /** - * Returns the {@link yfiles.router.CellEntrance} at the given position of this path. - * @param position the position of the {@link } to return - * @returns the {@link } at the given position of this path - * @see yfiles.router.Path#setEntrance - */ - getEntrance(position:number):yfiles.router.CellEntrance; - /** - * Returns the number of {@link yfiles.router.CellEntrance} objects in this path. - * @returns the number of {@link } objects in this path - */ - length():number; - /** - * Returns the position of the first occurrence of the given {@link yfiles.router.CellEntrance} in this path, or -1 if this path - * does not contain this {@link yfiles.router.CellEntrance}. - * @param entrance the {@link } for which the position is retrieved - * @returns the position of the first occurrence of the given {@link } in this path, or -1 if this path does not - * contain this {@link } - */ - positionOf(entrance:yfiles.router.CellEntrance):number; - /** - * Replaces the {@link yfiles.router.CellEntrance} at the given position of this path with the given {@link yfiles.router.CellEntrance}. - * @param position the position of the {@link } to replace - * @param entrance the {@link } to be stored at the given position - * @see yfiles.router.Path#getEntrance - */ - setEntrance(position:number,entrance:yfiles.router.CellEntrance):void; - /** - * Gets the edge for which this path was calculated. - * @type {yfiles.algorithms.Edge} - */ - edge:yfiles.algorithms.Edge; - /** - * Gets the overall cost of this path. - * @type {number} - */ - cost:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.Path; - } - /** - * This is a pathfinding algorithm that calculates the shortest (i.e., the cheapest) paths for a set of edges through a - * {@link yfiles.router.GraphPartition}. - *

- * It is based on an A*-algorithm and uses {@link yfiles.router.PartitionCell}s as steps between source node and target node. - *

- *

- * In each step, the algorithm takes a {@link yfiles.router.CellEntrance}, that consists mainly of a {@link yfiles.router.PartitionCell} - * and from where it was entered, from a queue with all seen {@link yfiles.router.CellEntrance}s, determines all possible neighbor - * cells and their enter intervals and enqueues the resulting {@link yfiles.router.CellEntrance}. To influence the order in which - * the {@link yfiles.router.CellEntrance}s will be processed, the path search assigns real costs (like Dijkstra) as well as - * heuristic costs (A*-algorithm's heuristic) to the enqueued {@link yfiles.router.CellEntrance}s. The real costs arise from - * entering a neighbor cell, e.g., a bend has to be created, while the heuristic costs are an estimation of how expensive - * it will be to reach the target node continuing the path with this neighboring cell. Therefore, the path search prefers - * searching in the direction in which the target node lies. The {@link yfiles.router.CellEntrance} with the lowest combined costs - * is processed next until the target cell is reached. - *

- *

- * {@link yfiles.router.PathSearchExtension}s modify the path search as they are able to add start entrances and weight them with - * costs. They also add real and heuristic costs to {@link yfiles.router.CellEntrance}s that are created for the currently entered - * {@link yfiles.router.PartitionCell} and calculate shorter enter intervals that are less expensive to pass. - *

- *

- * The algorithm gets a {@link yfiles.router.PathSearchContext} which provides information about the graph and the currently routed - * edge. It stores the results of the path search that can then be retrieved calling {@link yfiles.router.PathSearchContext#pathSearchResult}. - *

- * @see yfiles.router.PathSearch#addPathSearchExtension - * @see yfiles.router.PathSearch#addAdditionalEnterIntervalCalculator - * @class - */ - export interface PathSearch extends yfiles.lang.Object{} - export class PathSearch { - /** - * Creates a new instance of {@link yfiles.router.PathSearch}. - */ - constructor(); - /** - * Adds a new interval calculator to the list of registered {@link yfiles.router.IEnterIntervalCalculator}s. - *

- * {@link yfiles.router.IEnterIntervalCalculator}s may add - * {@link yfiles.router.CellEntrance}s with narrowed intervals to the queue. The interval is more specific and will be judged with - * lower costs. - *

- * @param enterIntervalCalculator the calculator to add - * @returns true if the calculator was successfully added, false otherwise - */ - addAdditionalEnterIntervalCalculator(enterIntervalCalculator:yfiles.router.IEnterIntervalCalculator):boolean; - /** - * Adds the given extension to the list of {@link yfiles.router.PathSearchExtension}s. - *

- * An extension can influence the pathfinding process by adding costs for entering certain {@link yfiles.router.CellEntrance}s. - *

- * @param extension the extension to add to this path search - * @returns true if the extension has been added, false otherwise - */ - addPathSearchExtension(extension:yfiles.router.PathSearchExtension):boolean; - /** - * Calculates the costs for moving from the current {@link yfiles.router.CellEntrance} to the neighboring {@link yfiles.router.PartitionCell} - * using different enter intervals. - *

- * It is called by {@link yfiles.router.PathSearch#handleNeighbor} to determine the costs for all - * {@link yfiles.router.CellEntrance}s that it will create and enqueue afterwards. - *

- *

- * The costs for the given enter intervals are retrieved from all registered - * {@link yfiles.router.PathSearchExtension}s. The calculation stops when it reaches the given maximum cost value. - *

- * @param currentEntrance the current cell entrance - * @param enteredCell the partition cell to enter - * @param enterIntervals the different entering intervals of the entered cell - * @param lastEdgeCellInfos the information about how the last cell was crossed - * @param context the context information - * @param costs the array in which the calculated costs for entering the neighbor cell via the according enter intervals shall be - * written - * @param maxAllowedCosts the maximum costs an enter interval may induce. If this cost is exceeded, no further additional costs for this interval - * are calculated. Note that the entries in this array get modified during cost calculation - * @see yfiles.router.PathSearchExtension#calculateCosts - * @protected - */ - calculateCosts(currentEntrance:yfiles.router.CellEntrance,enteredCell:yfiles.router.PartitionCell,enterIntervals:yfiles.router.OrthogonalInterval[],lastEdgeCellInfos:yfiles.router.EdgeCellInfo[],context:yfiles.router.PathSearchContext,costs:number[],maxAllowedCosts:number[]):void; - /** - * Returns the estimated costs for the rest of the path when using the given {@link yfiles.router.CellEntrance} for the next step - * in the path search. - *

- * It is called by {@link yfiles.router.PathSearch#handleNeighbor} to determine the heuristic part of the costs with which the - * entrance will be enqueued. - *

- *

- * The heuristic costs for the given entrance are retrieved from all registered {@link yfiles.router.PathSearchExtension}s. - *

- * @param entrance the current entrance - * @param context the context information - * @returns the heuristic costs for the rest of the path if the given entrance is used - * @see yfiles.router.PathSearchExtension#calculateHeuristicCosts - * @protected - */ - calculateHeuristicCosts(entrance:yfiles.router.CellEntrance,context:yfiles.router.PathSearchContext):number; - /** - * Resets all registered {@link yfiles.router.PathSearchExtension}s and {@link yfiles.algorithms.DataProviders} added to this - * {@link yfiles.router.PathSearch}. - *

- * So, {@link yfiles.router.PathSearch} is ready to calculate paths for a new layout. - *

- * @see yfiles.router.PathSearchExtension#cleanUp - */ - clear():void; - /** - * Decreases the given penalty settings for the current edge. - *

- * If finding a path for the current edge takes too long according to the {@link yfiles.router.EdgeRouter#maximumDuration maximum duration} of the {@link yfiles.router.EdgeRouter edge routing algorithm}, - * the path search for the current edge is canceled and restarted using decreased penalties. The decreaseFactor indicates, - * how much the penalties shall be reduced. - *

- *

- * This method is called by - * {@link yfiles.router.PathSearch#findPathsForCurrentEdge}. If overriding this method, note that the penalty for creating bends - * should not be reduced as this results in more possible turns of the edge path and, therefore, a longer runtime of the - * path search. Furthermore, not all penalties should be decreased equally as these decreases would neutralize each other. - *

- *

- * The decreaseFactor takes values from [0,1], where 0 means no reduction while 1 means the strongest reduction. - *

- * @param penaltySettings the penalty settings whose penalties shall be reduced - * @param decreaseFactor the factor with values between 0 and 1 that indicates how strong to reduce the penalties - * @param context the context information of the current path search - * @protected - */ - decreasePenaltySettings(penaltySettings:yfiles.router.PenaltySettings,decreaseFactor:number,context:yfiles.router.PathSearchContext):void; - /** - * Informs all registered path search extensions about completing a path by calling their {@link yfiles.router.PathSearchExtension#finalizePath finalizePath(Path)} method. - *

- * That way, extensions can collect data about this path to use it later during path search. - *

- *

- * This method is called by {@link yfiles.router.PathSearch#findPathsForCurrentEdge} and may be overridden to use a custom - * finalization step. - *

- * @param path the path to finalize - * @protected - */ - finalizePath(path:yfiles.router.Path):void; - /** - * Finds paths for the edges in the given context and stores them in its {@link yfiles.router.PathSearchContext#pathSearchResult PathSearchResult}. - *

- * This is the main method of {@link yfiles.router.PathSearch}. - *

- *

- * It initializes its extensions using {@link yfiles.router.PathSearchExtension#initializeEdges} and delegates the path search for - * each edge to {@link yfiles.router.PathSearch#findPathsForCurrentEdge}. - *

- *

- * The path calculations for all edges are finalized by calling the extensions' {@link yfiles.router.PathSearchExtension#finalizeEdges} - * method and, after that, the path search result is filled with the path for each edge. - *

- *

- * At last, the extensions are asked to finalize the path search result using their {@link yfiles.router.PathSearchExtension#finalizePathSearchResult} - * callback. - *

- * @param context the context to use during the path search - * @see yfiles.router.PathSearchContext#edges - * @see yfiles.router.PathSearchContext#pathSearchResult - */ - findPaths(context:yfiles.router.PathSearchContext):void; - /** - * Finds the path for the current edge in the given context. - *

- * This method: - *

- *
    - *
  • Calls {@link yfiles.router.PathSearchExtension#initializeCurrentEdge} for all extensions.
  • - *
  • Collects and enqueues all start entrances.
  • - *
  • Iteratively processes the next cheapest cell entrance and
  • - *
  • Calls {@link yfiles.router.PathSearchExtension#finalizeCurrentEdge} for all extensions.
  • - *
- *

- * It is called by {@link yfiles.router.PathSearch#findPaths} and may be overridden to skip certain edges or implement a custom - * path search. - *

- * @param context the context information needed for finding a path - * @protected - */ - findPathsForCurrentEdge(context:yfiles.router.PathSearchContext):void; - /** - * Returns the path for the given edge if it has already been finalized. - *

- * The path is finalized if the {@link yfiles.router.PathSearch} chose it as the best result for the edge. - *

- * @param edge the edge for which the path is returned - * @returns the finalized path for the given edge or null if no path has been found and finalized - */ - getFinalizedPath(edge:yfiles.algorithms.Edge):yfiles.router.Path; - /** - * Adds - * {@link yfiles.router.CellEntrance}s for every interval through which the neighboring cell can be entered from the current - * entrance to the queue. - *

- * The algorithm calls this method in every step for each neighbor of the current cell to collect all next possible - * entrances for the current path. This path consists of several entrances where each knows the entrance through which it - * has been entered. - *

- *

- * After calculating all possible enter intervals to the given neighboring cell, each interval gets rated with costs. If - * there is already an entrance for the neighboring cell whose interval is the same with one of these intervals, this - * entrance will be used and re-enqueued, so that the path search can still reach it. The current entrance is set as its - * predecessor within the current path and its enter interval and costs will be updated. - *

- *

- * If there is an entrance for the neighboring cell whose interval is intersected by a current interval, new entrances will - * be created with the new enter intervals and enqueued. The same happens if there is no entrance that has been matched - * with one of the current intervals, yet. Costs will be added. If there are some entries afterwards that are intersected - * by the current interval and have higher costs, they will be removed from the queue. - *

- *

- * This method is called during cost calculation. It may be overridden to change the interval handling for the - * {@link yfiles.router.CellEntrance}s. - *

- * @param currentEntrance the current cell entrance - * @param neighborCell the neighboring cell that is handled. - * @param context the context information - * @see yfiles.router.PathSearch#calculateCosts - * @see yfiles.router.PathSearch#calculateHeuristicCosts - * @protected - */ - handleNeighbor(currentEntrance:yfiles.router.CellEntrance,neighborCell:yfiles.router.PartitionCell,context:yfiles.router.PathSearchContext):void; - /** - * Initializes the fields of this {@link yfiles.router.PathSearch}. - *

- * This method also calls {@link yfiles.router.PathSearchExtension#initialize} for all registered path search extensions. - *

- * @param configuration the configuration that the path search shall use - */ - init(configuration:yfiles.router.PathSearchConfiguration):void; - /** - * Removes the given interval calculator from the list of registered {@link yfiles.router.IEnterIntervalCalculator}s. - * @param enterIntervalCalculator the calculator to remove - * @returns true if an interval calculator was removed as a result of this call, false if the given calculator was not part of the - * list - */ - removeAdditionalEnterIntervalCalculator(enterIntervalCalculator:yfiles.router.IEnterIntervalCalculator):boolean; - /** - * Removes the given extension from the list of {@link yfiles.router.PathSearchExtension}s. - * @param extension the extension to remove from the path search - * @returns true if an extension was removed as a result of this call, false if the given extension was not contained in the list - */ - removePathSearchExtension(extension:yfiles.router.PathSearchExtension):boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PathSearch; - } - /** - * This class contains the basic configuration used by path search algorithms. - * @class - */ - export interface PathSearchConfiguration extends yfiles.lang.Object{} - export class PathSearchConfiguration { - /** - * Creates a new instance of {@link yfiles.router.PathSearchConfiguration} used for a path search. - * @param graph the graph containing the edges whose path will be searched - * @param grouping the grouping information of the graph - * @param edgeRouter the edge routing algorithm using this configuration - */ - constructor(graph:yfiles.layout.LayoutGraph,grouping:yfiles.layout.GroupingSupport,edgeRouter:yfiles.router.EdgeRouter); - /** - * Gets the graph containing the edges whose path is searched. - * @type {yfiles.layout.LayoutGraph} - */ - graph:yfiles.layout.LayoutGraph; - /** - * Gets the grouping information of the graph. - * @type {yfiles.layout.GroupingSupport} - */ - grouping:yfiles.layout.GroupingSupport; - /** - * Gets the edge routing algorithm using this configuration. - * @type {yfiles.router.EdgeRouter} - */ - edgeRouter:yfiles.router.EdgeRouter; - /** - * Gets the remaining time (in milliseconds) within which the algorithm should complete its calculation. - * @type {number} - */ - remainingTime:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PathSearchConfiguration; - } - /** - * This class provides context information that is useful for the {@link yfiles.router.PathSearch} algorithm. - *

- * Most notably, the context provides access to the edge that is currently being routed (see {@link yfiles.router.PathSearchContext#currentEdge}). - *

- * @class - */ - export interface PathSearchContext extends yfiles.lang.Object{} - export class PathSearchContext { - /** - * Creates a new instance of {@link yfiles.router.PathSearchContext}. - * @param pathSearch the path search that uses this context - * @param configuration the configuration used for the path search - */ - constructor(pathSearch:yfiles.router.PathSearch,configuration:yfiles.router.PathSearchConfiguration); - /** - * Adds an additional source cell of the {@link yfiles.router.PathSearchContext#currentEdge current edge} if it is not already contained in the list of source cells. - * @param cell the new source cell to add - * @see yfiles.router.PathSearchContext#sourceCellCount - * @see yfiles.router.PathSearchContext#getSourceCell - */ - addSourceCell(cell:yfiles.router.PartitionCell):void; - /** - * Adds an additional target cell of the {@link yfiles.router.PathSearchContext#currentEdge current edge} if it is not already contained in the list of target cells. - * @param cell the new target cell to add - * @see yfiles.router.PathSearchContext#targetCellCount - * @see yfiles.router.PathSearchContext#getTargetCell - */ - addTargetCell(cell:yfiles.router.PartitionCell):void; - /** - * Returns the source cell with the given index in the list of all cells that are covered by the source node of the - * {@link yfiles.router.PathSearchContext#currentEdge current edge}. - * @param index the index of the source cell - * @returns the source cell with the given index in the list of all source cells - */ - getSourceCell(index:number):yfiles.router.PartitionCell; - /** - * Returns the target cell with the given index in the list of all cells that are covered by the target node of the - * {@link yfiles.router.PathSearchContext#currentEdge current edge}. - * @param index the index of the target cell - * @returns the target cell with the given index in the list of all cells that are covered by the target node of the {@link #currentEdge current edge} - */ - getTargetCell(index:number):yfiles.router.PartitionCell; - /** - * Determines whether or not the given cell is a source cell of the {@link yfiles.router.PathSearchContext#currentEdge current edge}. - * @param cell the cell - * @returns true if the given cell is in the list of source cells, false otherwise - * @see yfiles.router.PathSearchContext#sourceCellCount - * @see yfiles.router.PathSearchContext#getSourceCell - */ - isSourceCell(cell:yfiles.router.PartitionCell):boolean; - /** - * Determines whether or not the given cell is a target cell of the {@link yfiles.router.PathSearchContext#currentEdge current edge}. - * @param cell the cell - * @returns true if the given cell is in the list of target cells, false otherwise - * @see yfiles.router.PathSearchContext#targetCellCount - * @see yfiles.router.PathSearchContext#getTargetCell - */ - isTargetCell(cell:yfiles.router.PartitionCell):boolean; - /** - * Specifies the edges that shall be routed. - * @param edges the list of edges that shall be routed - */ - setEdges(edges:yfiles.algorithms.EdgeList):void; - /** - * Returns the number of all cells that are covered by the source node of the {@link yfiles.router.PathSearchContext#currentEdge current edge}. - * @returns the number of all cells that are covered by the source node - */ - sourceCellCount():number; - /** - * Returns the number of all cells that are covered by the target node of the {@link yfiles.router.PathSearchContext#currentEdge current edge}. - * @returns the number of all cells that are covered by the target node - */ - targetCellCount():number; - /** - * Gets the {@link yfiles.router.PathSearch} that uses this context. - * @type {yfiles.router.PathSearch} - */ - pathSearch:yfiles.router.PathSearch; - /** - * Gets the configuration used for the {@link yfiles.router.PathSearch}. - * @type {yfiles.router.PathSearchConfiguration} - */ - configuration:yfiles.router.PathSearchConfiguration; - /** - * Gets the {@link yfiles.algorithms.IEdgeCursor} to iterate over the edges that are routed. - * @type {yfiles.algorithms.IEdgeCursor} - */ - edges:yfiles.algorithms.IEdgeCursor; - /** - * Gets or sets the edge that is currently routed. - *

- * This edge is one of those returned by {@link yfiles.router.PathSearchContext#edges}. - *

- * @type {yfiles.algorithms.Edge} - */ - currentEdge:yfiles.algorithms.Edge; - /** - * Gets the {@link yfiles.router.EdgeLayoutDescriptor} for the {@link yfiles.router.PathSearchContext#currentEdge current edge} containing edge specific settings for the path search. - * @type {yfiles.router.EdgeLayoutDescriptor} - */ - currentEdgeLayoutDescriptor:yfiles.router.EdgeLayoutDescriptor; - /** - * Gets an artificial {@link yfiles.router.PartitionCell partition cell} with the size of the bounding box of all source cells of the {@link yfiles.router.PathSearchContext#currentEdge current edge}. - * @see yfiles.router.PathSearchContext#getSourceCell - * @type {yfiles.router.PartitionCell} - */ - combinedSourceCell:yfiles.router.PartitionCell; - /** - * Gets an artificial {@link yfiles.router.PartitionCell partition cell} with the size of the bounding box of all target cells of the {@link yfiles.router.PathSearchContext#currentEdge current edge}. - * @see yfiles.router.PathSearchContext#getTargetCell - * @type {yfiles.router.PartitionCell} - */ - combinedTargetCell:yfiles.router.PartitionCell; - /** - * Gets the results of the {@link yfiles.router.PathSearch}. - * @type {yfiles.router.PathSearchResult} - */ - pathSearchResult:yfiles.router.PathSearchResult; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PathSearchContext; - } - /** - * Extensions are added to a {@link yfiles.router.PathSearch} to influence the search process. - *

- * An extension contains several callback methods that are used by the {@link yfiles.router.PathSearch} to, e.g., calculate the - * costs for the next possible steps (i.e., entering the next partition cell) and to decide when the target is reached. - *

- *

- * The {@link yfiles.router.PathSearch} uses the callbacks in the following order: - *

- *
    - *
  1. {@link yfiles.router.PathSearchExtension#initialize}
  2. - *
  3. {@link yfiles.router.PathSearchExtension#initializeEdges}
  4. - *
  5. {@link yfiles.router.PathSearchExtension#initializeCurrentEdge}
  6. - *
  7. {@link yfiles.router.PathSearchExtension#appendStartEntrances}
  8. - *
  9. {@link yfiles.router.PathSearchExtension#calculateStartEntranceCost}
  10. - *
  11. {@link yfiles.router.PathSearchExtension#calculateCosts}
  12. - *
  13. {@link yfiles.router.PathSearchExtension#calculateHeuristicCosts}
  14. - *
  15. {@link yfiles.router.PathSearchExtension#isValidTargetEntrance}
  16. - *
  17. {@link yfiles.router.PathSearchExtension#finalizePath}
  18. - *
  19. {@link yfiles.router.PathSearchExtension#finalizeCurrentEdge} or {@link yfiles.router.PathSearchExtension#cancelCurrentEdge}
  20. - *
  21. {@link yfiles.router.PathSearchExtension#finalizeEdges}
  22. - *
  23. {@link yfiles.router.PathSearchExtension#finalizePathSearchResult}
  24. - *
  25. {@link yfiles.router.PathSearchExtension#cleanUp}
  26. - *
- * @see yfiles.router.PathSearch#addPathSearchExtension - * @see yfiles.router.PathSearchContext#currentEdge - * @class - */ - export interface PathSearchExtension extends yfiles.lang.Object{} - export class PathSearchExtension { - /** - * Creates a new instance of {@link yfiles.router.PathSearchExtension}. - */ - constructor(); - /** - * Appends additional start {@link yfiles.router.CellEntrance entrances} for the path search of the current edge to the given list of all previously generated - * entrances. - *

- * This method is called before starting the actual path search to determine possible starting points. The current - * implementation doesn't add any {@link yfiles.router.CellEntrance}s. It may be overridden to add {@link yfiles.router.CellEntrance}s with - * specific enter intervals, e.g., to consider {@link yfiles.layout.PortConstraint}s. - *

- * @param allStartEntrances a list of all previously generated entrances - */ - appendStartEntrances(allStartEntrances:yfiles.collections.IList):void; - /** - * Calculates the costs for entering the given {@link yfiles.router.PartitionCell} via the given enter - * {@link yfiles.router.OrthogonalInterval}. - *

- * The given {@link yfiles.router.EdgeCellInfo} describes how the partition cell that has been entered by the current entrance - * would be traversed if this enter interval to the neighboring cell would be chosen. - *

- *

- * The maxAllowedCosts describe the maximum costs that entering the neighboring cell via the given enter interval may - * induce. If the maximum cost is exceeded, calculations that may further increase its cost may be skipped because this - * interval won't be chosen anyway. - *

- *

- * This implementation doesn't add any costs. It may be overridden to add costs, e.g., if entering through the given - * interval would create a bend. - *

- * @param currentEntrance the entrance that was used for entering the current cell - * @param enteredCell the neighboring cell that shall be entered - * @param enterInterval the interval that shall be used for entering the neighboring cell - * @param edgeCellInfo the information about how the current cell would be traversed if the neighboring cell would be entered by this enter - * interval - * @param maxAllowedCosts the maximum allowed costs for this enter interval - * @returns the costs for entering the neighboring cell via the enter interval - * @protected - */ - calculateCosts(currentEntrance:yfiles.router.CellEntrance,enteredCell:yfiles.router.PartitionCell,enterInterval:yfiles.router.OrthogonalInterval,edgeCellInfo:yfiles.router.EdgeCellInfo,maxAllowedCosts:number):number; - /** - * Calculates the heuristic costs for the given {@link yfiles.router.CellEntrance} that describe the minimal costs that will arise - * to finish the path if the given cell entrance is used as next step. - *

- * After evaluating the costs for each enter interval to a neighboring cell, this method is called for each of the - * resulting {@link yfiles.router.CellEntrance}s. - *

- *

- * This implementation doesn't add any costs. It may be overridden to add some heuristic costs, e.g., if the edge would - * have to bend to reach the target node from the given {@link yfiles.router.CellEntrance}. - *

- * @param entrance the entrance to calculate the heuristic costs for the rest of the path - * @returns the minimal costs that will arise to finish the path if the given cell entrance is used as next step - */ - calculateHeuristicCosts(entrance:yfiles.router.CellEntrance):number; - /** - * Returns the cost for starting the path in the given entrance. - *

- * This method is called for each start entrance of the current edge. - *

- *

- * The current implementation doesn't add any costs for the given {@link yfiles.router.CellEntrance}. It may be overridden to make - * start entrances with less specific intervals more expensive. For example, intervals that allow more than just the {@link yfiles.layout.PortConstraint} - * location to connect to the source node become more expensive. - *

- * @param startEntrance the start entrance for which the cost is calculated - * @returns the cost for starting the path in the given entrance - */ - calculateStartEntranceCost(startEntrance:yfiles.router.CellEntrance):number; - /** - * Handles the cancellation of the path search for the current edge. - *

- * This callback notifies the extension when the path search for the current edge is canceled. Then, the path search will - * proceed with altering the penalties of the current edge and reinitializing it again. - *

- *

- * This implementation does nothing. It may be overridden to reset some edge specific information, e.g., removing - * previously added listeners. - *

- * @param context the context containing the current edge for which the path search has been canceled - * @see yfiles.router.PathSearchExtension#initializeCurrentEdge - * @see yfiles.router.PathSearchExtension#finalizeEdges - */ - cancelCurrentEdge(context:yfiles.router.PathSearchContext):void; - /** - * Cleans up the extension from the path searches with the current {@link yfiles.router.PathSearchExtension#configuration configuration} and {@link yfiles.router.PathSearchExtension#context context}. - */ - cleanUp():void; - /** - * Handles the completion of the path search for the current edge. - *

- * This callback notifies the extension when enough paths are found for the current edge. After that, the path search - * either proceeds with initializing the next current edge in the context's edge list or calls {@link yfiles.router.PathSearchExtension#finalizeEdges} - * if all edges in this list have been handled. - *

- *

- * This implementation does nothing. It may be overridden to add/reset some edge specific information, e.g., removing - * previously added listeners or adding new start entrances. - *

- * @param context the context containing the current edge for which the path search has been finished - * @see yfiles.router.PathSearchExtension#initializeCurrentEdge - * @see yfiles.router.PathSearchExtension#finalizeEdges - */ - finalizeCurrentEdge(context:yfiles.router.PathSearchContext):void; - /** - * Handles the completion of all marked edges. - *

- * This callback notifies the extension if enough paths have been found for all edges in the context's edge list. - *

- * @param context the context containing the list of edges for which paths have been found - * @see yfiles.router.PathSearchContext#edges - */ - finalizeEdges(context:yfiles.router.PathSearchContext):void; - /** - * After finding a valid target entrance and creating a {@link yfiles.router.Path}, the extension is notified of the found path. - *

- * If the path search is configured to calculate several possible paths for an edge, the path search proceeds with choosing - * another unhandled {@link yfiles.router.CellEntrance}. - *

- *

- * This implementation does nothing. It may be overridden to collect some information about the given path that may - * influence the path search of later edges. - *

- * @param path the path found for the current edge in the context - * @see yfiles.router.PathSearchContext#currentEdge - */ - finalizePath(path:yfiles.router.Path):void; - /** - * Completes the path search result. - *

- * This callback notifies the extensions of the paths chosen for the edges in the current context. After calling - * {@link yfiles.router.PathSearchExtension#finalizeEdges finalizeEdges}, the {@link yfiles.router.PathSearch} decides, which of the found paths to use for each edge and adds them to the - * {@link yfiles.router.PathSearchResult}. - *

- *

- * With this callback, the registered extensions are notified of this result before the path search either initializes the - * next list of edges to route or ends the path search by calling - * {@link yfiles.router.PathSearchExtension#cleanUp}. This implementation does nothing. - *

- * @param pathSearchResult the path search result for the edge in the current context's edge list - * @see yfiles.router.PathSearchExtension#initializeEdges - * @see yfiles.router.PathSearchExtension#cleanUp - */ - finalizePathSearchResult(pathSearchResult:yfiles.router.PathSearchResult):void; - /** - * Initializes this extension for path searches using the given configuration. - *

- * This method is the first one to be called by the {@link yfiles.router.PathSearch}. It may be overridden to initialize this - * extension with necessary settings like {@link yfiles.layout.GroupingSupport}. - *

- * @param configuration the configuration to use for the following path searches - */ - initialize(configuration:yfiles.router.PathSearchConfiguration):void; - /** - * Initializes this extension with the current edge set in the given context. - *

- * This method is called for each edge of the {@link yfiles.router.PathSearchExtension#context context}. Each call will be balanced by a call to either {@link yfiles.router.PathSearchExtension#finalizeCurrentEdge} - * or {@link yfiles.router.PathSearchExtension#cancelCurrentEdge}. - *

- *

- * It may be overridden to initialize/reset the settings for the current edge (e.g. minimum distances). - *

- * @param context the context containing the current edge - * @see yfiles.router.PathSearchContext#currentEdge - */ - initializeCurrentEdge(context:yfiles.router.PathSearchContext):void; - /** - * Initializes this extension with the context that contains the list of edges for which paths are calculated. - *

- * This method may be called several times during a path search. Each call will be balanced by calls to {@link yfiles.router.PathSearchExtension#finalizeEdges} - * and {@link yfiles.router.PathSearchExtension#finalizePathSearchResult}. - *

- *

- * It may be overridden to initialize/reset the settings for the routed edges (e.g. minimum distances). - *

- * @param context the context containing the list of edges for which paths shall be found - * @see yfiles.router.PathSearchContext#edges - */ - initializeEdges(context:yfiles.router.PathSearchContext):void; - /** - * Determines whether or not this extension considers the given {@link yfiles.router.CellEntrance} as a valid target entrance, - * i.e., the path may end with the given entrance. - *

- * Each time a {@link yfiles.router.CellEntrance} is chosen as next step, all registered extensions are asked if this entrance is a - * valid target entrance. Only if none of the extensions returns false, a {@link yfiles.router.Path} is created. - *

- *

- * This implementation accepts all - * {@link yfiles.router.CellEntrance}s as valid targets. It may be overridden to only activate the target if the route fulfills a - * certain condition. - *

- * @param entrance the entrance to decide if it is a valid target entrance - * @returns true if the path may end with this entrance, false otherwise - */ - isValidTargetEntrance(entrance:yfiles.router.CellEntrance):boolean; - /** - * Gets the configuration used for the path search. - *

- * This property is initialized in {@link yfiles.router.PathSearchExtension#initialize}. - *

- * @type {yfiles.router.PathSearchConfiguration} - */ - configuration:yfiles.router.PathSearchConfiguration; - /** - * Gets the current context of the path search. - *

- * This property is initialized in {@link yfiles.router.PathSearchExtension#initializeEdges}. - *

- * @protected - * @type {yfiles.router.PathSearchContext} - */ - context:yfiles.router.PathSearchContext; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PathSearchExtension; - } - /** - * This class manages the best {@link yfiles.router.Path}s found for each edge and provides according {@link yfiles.router.EdgeInfo}s. - *

- * These are used by the {@link yfiles.router.ChannelBasedPathRouting} algorithm to calculate the final segment locations for the - * segments of an edge path. - *

- * @class - */ - export interface PathSearchResult extends yfiles.lang.Object{} - export class PathSearchResult { - /** - * Creates a new instance of {@link yfiles.router.PathSearchResult}. - * @param configuration the configuration used for the path search - */ - constructor(configuration:yfiles.router.PathSearchConfiguration); - /** - * Returns an {@link yfiles.router.EdgeInfo} for the given edge. - *

- * If the given edge shall be routed but no path has been set for it, yet, null is returned. If no {@link yfiles.router.EdgeInfo} - * has been created for the path by this context before, a new one is instantiated, otherwise the stored one is returned. - *

- * @param edge the edge for which the {@link } will be returned - * @returns an {@link } describing the path of the edge - * @see yfiles.router.PathSearchResult#setPath - */ - getEdgeInfo(edge:yfiles.algorithms.Edge):yfiles.router.EdgeInfo; - /** - * Returns an {@link yfiles.router.EdgeInfo} for the given path. - *

- * If no {@link yfiles.router.EdgeInfo} has been created for this path by this context before, a new one is instantiated, otherwise - * the stored one is returned. - *

- * @param path the path for which the {@link } will be returned - * @returns an {@link } describing the given path - */ - getEdgeInfo(path:yfiles.router.Path):yfiles.router.EdgeInfo; - /** - * Returns the previously registered path found for the edge. - * @param edge the edge for which the path is provided - * @returns the previously registered path found for the edge or null if no path has been registered, yet - */ - getPath(edge:yfiles.algorithms.Edge):yfiles.router.Path; - /** - * Specifies a found path for an edge. - * @param edge the edge for which the path is set - * @param path the found path - */ - setPath(edge:yfiles.algorithms.Edge,path:yfiles.router.Path):void; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PathSearchResult; - } - /** - * This class provides the cost penalties that are applied for violating restrictions during a {@link yfiles.router.PathSearch}. - *

- * The {@link yfiles.router.PathSearch} calculates the shortest path from the source to the target, where shortest path means the path with the - * lowest costs. Costs result from violations of restrictions that are defined by the different - * {@link yfiles.router.PathSearchExtension}s. This class defines penalties for the various violations. The {@link yfiles.router.PathSearch} - * can be adapted to specific needs by varying these penalties. In order to avoid a certain violation, the appropriate - * penalty must be increased. - *

- *

- * There are some predefined penalty settings which set a different focus for the path search: - * {@link yfiles.router.PenaltySettings#OPTIMIZATION_BALANCED}, {@link yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_BENDS}, {@link yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_LENGTHS} - * and {@link yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_CROSSINGS}. - *

- * @class - */ - export interface PenaltySettings extends yfiles.lang.Object{} - export class PenaltySettings { - /** - * Creates a new instance of {@link yfiles.router.PenaltySettings}. - */ - constructor(); - /** - * Creates a copy of this {@link yfiles.router.PenaltySettings} instance. - *

- * This implementation uses method {@link yfiles.router.PenaltySettings#newInstance} to obtain a new instance which adopts all - * settings. - *

- * @returns a copy of this instance - */ - createCopy():yfiles.router.PenaltySettings; - /** - * Creates a new instance of {@link yfiles.router.PenaltySettings}. - *

- * This factory method is used by - * {@link yfiles.router.PenaltySettings#createCopy}. Subclasses can override this method in order to return a more specialized - * version. - *

- * @returns a specialized {@link } - * @protected - */ - newInstance():yfiles.router.PenaltySettings; - /** - * Optimization strategy that balances bends and edge crossings in the edge routes. - *

- * By default, this strategy is used for the path search. - *

- * @const - * @static - * @type {yfiles.router.PenaltySettings} - */ - static OPTIMIZATION_BALANCED:yfiles.router.PenaltySettings; - /** - * Optimization strategy that minimizes bends in the edge routes. - *

- * Edges may cross other edges to prevent bends occurring around them. - *

- * @const - * @static - * @type {yfiles.router.PenaltySettings} - */ - static OPTIMIZATION_EDGE_BENDS:yfiles.router.PenaltySettings; - /** - * Optimization strategy that minimizes edge crossings in the edge routes. - *

- * This may cause more bends. - *

- * @const - * @static - * @type {yfiles.router.PenaltySettings} - */ - static OPTIMIZATION_EDGE_CROSSINGS:yfiles.router.PenaltySettings; - /** - * Optimization strategy that minimizes the length of the edge routes. - *

- * In consequence, there may be more edge crossings. - *

- * @const - * @static - * @type {yfiles.router.PenaltySettings} - */ - static OPTIMIZATION_EDGE_LENGTHS:yfiles.router.PenaltySettings; - /** - * Gets or sets the penalty for the edge length. - *

- * This penalty will make long routes more expensive than short routes so edges will preferably be kept short. - *

- *

- * Increasing the edge length penalty will raise the importance of short edges in relation to all other penalties while - * decreasing this penalty will raise the importance of all other restrictions. A high edge length penalty will result in - * routes that have less bends and more edge crossings to maintain the edge as short as possible. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @type {number} - */ - edgeLengthPenalty:number; - /** - * Gets or sets the penalty for an edge bend. - *

- * This penalty will make routes with many bends more expensive than routes with few or no bends. Hence, edges will have - * preferably few bends. - *

- *

- * Increasing bend penalty will raise the importance of avoiding bends in relation to other penalties while decreasing this - * penalty will raise the importance of all other restrictions. A high bend penalty will result in routes that will - * preferably cross other edges instead of bending to avoid other edges. When increasing the edge bend penalty, the - * resulting routes will have more edge crossings. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @type {number} - */ - bendPenalty:number; - /** - * Gets or sets the penalty for a crossing of two edges. - *

- * This penalty will make routes that cross many other edges more expensive than routes that cross few other edges or no - * edges at all. Hence, edges preferably won't cross other edges. - *

- *

- * Increasing the edge crossing penalty will raise the importance of avoiding edge crossings in relation to other - * penalties, while decreasing this penalty will raise the importance of all other restrictions. When increasing the edge - * crossing penalty, the resulting route will be longer and have more bends because crossing other edges needs to be - * avoided. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @type {number} - */ - edgeCrossingPenalty:number; - /** - * Gets or sets the penalty for an edge crossing a regular node. - *

- * This penalty will make routes that cross normal nodes more expensive than routes that avoid crossing nodes. Hence, edges - * won't preferably cross any nodes. - *

- *

- * Increasing the node crossing penalty will raise the importance of avoiding node crossings in relation to other - * penalties, while decreasing this penalty will raise the importance of all other restrictions. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @type {number} - */ - nodeCrossingPenalty:number; - /** - * Gets or sets the penalty for an edge crossing a group node. - *

- * This penalty will make routes that cross group nodes more expensive than routes that avoid crossing group nodes. Hence, - * edges won't preferably cross any group nodes. - *

- *

- * Increasing the group node crossing penalty will raise the importance of avoiding group node crossings in relation to - * other penalties, while decreasing this penalty will raise the importance of all other restrictions. - *

- * @type {number} - */ - groupNodeCrossingPenalty:number; - /** - * Gets or sets the penalty for an edge crossing a node label. - *

- * This penalty will make routes that cross node labels more expensive than routes that avoid crossing node labels. Hence, - * edges won't preferably cross any node labels. - *

- *

- * Increasing the node label crossing penalty will raise the importance of avoiding node labels crossings in relation to - * other penalties, while decreasing this penalty will raise the importance of all other restrictions. A high label - * crossing penalty will cause edges to bend more often to avoid passing straight through labels. - *

- *

- * The crossing penalty can be weighted for each label individually using the - * {@link yfiles.router.EdgeRouter#LABEL_CROSSING_PENALTY_FACTOR_DP_KEY}. - *

- *

- * Use {@link yfiles.router.EdgeRouter#considerNodeLabels} to set whether node labels should be considered when routing the edges. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.router.EdgeRouter#considerNodeLabels - * @type {number} - */ - nodeLabelCrossingPenalty:number; - /** - * Gets or sets the penalty for an edge crossing an edge label. - *

- * This penalty will make routes that cross edge labels of fixed edges more expensive than routes that avoid crossing edge - * labels, so edges won't preferably cross any edge labels that belong to fixed edges. - *

- *

- * Increasing the edge label crossing penalty will raise the importance of avoiding edge labels crossings in relation to - * other penalties, while decreasing this penalty will raise the importance of all other restrictions. A high label - * crossing penalty will cause edges to bend more often to avoid passing straight through labels. - *

- *

- * The crossing penalty can be weighted for each label individually using the - * {@link yfiles.router.EdgeRouter#LABEL_CROSSING_PENALTY_FACTOR_DP_KEY}. - *

- *

- * Use {@link yfiles.router.EdgeRouter#considerEdgeLabels} to set whether edge labels should be considered when routing the edges. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.router.EdgeRouter#considerEdgeLabels - * @type {number} - */ - edgeLabelCrossingPenalty:number; - /** - * Gets or sets the penalty for violations of the minimum distance between any edge and any normal node side. - *

- * This penalty will make routes that pass too close to normal nodes more expensive than routes that maintain the specified - * minimum node to edge distance. - *

- *

- * Increasing the minimum node to edge distance penalty will raise the importance of maintaining the minimum distance to - * nodes, while decreasing this penalty will raise the importance of all other restrictions. A high penalty for violating - * the minimum distance between edges and nodes will produce edges that rather use a long route around nodes to maintain - * the specified distance than pass through a small channel between two nodes. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.router.EdgeRouter#minimumNodeToEdgeDistance - * @type {number} - */ - minimumNodeToEdgeDistancePenalty:number; - /** - * Gets or sets the penalty for violations of the minimum distance between any edge and any group node side. - *

- * This penalty will make routes that pass group nodes too close more expensive than routes that maintain the specified - * minimum node to edge distance. - *

- *

- * Increasing the minimum group node to edge distance penalty will raise the importance of maintaining the minimum distance - * to group nodes, while decreasing this penalty will raise the importance of all other restrictions. A high penalty for - * violating the minimum distance between edges and group nodes will produce edges that rather use a long route around - * group nodes to maintain the specified distance than pass through a small channel between two group nodes. - *

- *

- * Use {@link yfiles.router.EdgeRouter#minimumNodeToEdgeDistance} to set the minimum distance. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.router.EdgeRouter#minimumNodeToEdgeDistance - * @type {number} - */ - minimumGroupNodeToEdgeDistancePenalty:number; - /** - * Gets or sets the penalty for violations of the minimum distance between any two edges. - *

- * This penalty will make routes that pass other edges too close more expensive than routes that maintain the specified - * minimum edge to edge distance. - *

- *

- * Increasing the minimum edge to edge distance penalty will raise the importance of maintaining the minimum distance to - * other edges, while decreasing this penalty will raise the importance of all other restrictions. When this penalty has a - * high value, edges will maintain the specified distance. This may also reduce the number of edges that pass through a - * small channel between nodes. So, if such a channel is part of the shortest routes for many edges, some of them will take - * a longer way. - *

- *

- * Use {@link yfiles.router.EdgeLayoutDescriptor#minimumEdgeToEdgeDistance} to set the minimum distance for a certain edge to any other edge. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.router.EdgeLayoutDescriptor#minimumEdgeToEdgeDistance - * @type {number} - */ - minimumEdgeToEdgeDistancePenalty:number; - /** - * Gets or sets the penalty for violations of the minimum distance the edge shall maintain from node corners when entering - * or leaving the node. - *

- * This penalty will make routes that end too close to the corner of their source or target node more expensive than routes - * that maintain the specified minimum node corner distance. - *

- *

- * Increasing the node corner distance penalty will raise the importance of maintaining the minimum distance to the corner - * of the adjacent nodes, while decreasing this penalty will raise the importance of all other restrictions. - *

- *

- * Use {@link yfiles.router.EdgeLayoutDescriptor#minimumNodeCornerDistance} to set the minimum node corner distance for a certain edge. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.router.EdgeLayoutDescriptor#minimumNodeCornerDistance - * @type {number} - */ - minimumNodeCornerDistancePenalty:number; - /** - * Gets or sets the penalty for violations of the minimum length of the first and last segment of an edge. - *

- * This penalty will make routes whose first/last bend is too close to their source or target node more expensive than - * routes that maintain the specified minimum first/last segment length. - *

- *

- * Increasing the minimum first last segment length penalty will raise the importance of maintaining the first and last - * segment as long as they fit the minimum first/last segment length, while decreasing this penalty will raise the - * importance of all other restrictions. - *

- *

- * Use {@link yfiles.router.EdgeLayoutDescriptor#minimumFirstSegmentLength} to set the minimum length of the first segment and {@link yfiles.router.EdgeLayoutDescriptor#minimumLastSegmentLength} to set the minimum length of the last segment of a certain - * edge. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.router.EdgeLayoutDescriptor#minimumFirstSegmentLength - * @see yfiles.router.EdgeLayoutDescriptor#minimumLastSegmentLength - * @type {number} - */ - minimumFirstLastSegmentLengthPenalty:number; - /** - * Gets or sets the penalty for an edge bend being closer to the border of the source node, the target node or one of their - * ancestor group nodes than the minimum node to edge distance. - *

- * This penalty will make routes that bend too close to their source or target node more expensive than routes that - * maintain the specified minimum node to edge distance. - *

- *

- * Increasing the bends in node to edge distance penalty will raise the importance of avoiding bends that violate the - * minimum node to edge distance, while decreasing this penalty will raise the importance of all other restrictions. This - * penalty supports - * {@link yfiles.router.EdgeRouter#minimumNodeToEdgeDistance}. In case the path search finally reaches the target node, the minimum node to edge distance for this node must be - * violated. Penalizing bends that are too close to the node forces the edge to directly cross this distance and connect to - * the node. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.router.EdgeRouter#minimumNodeToEdgeDistance - * @type {number} - */ - bendsInNodeToEdgeDistancePenalty:number; - /** - * Gets or sets the penalty for violating the monotonic path restrictions of an edge. - *

- * This penalty will make routes with detours m ore expensive than routes that stay monotone. - *

- *

- * Increasing the monotony violation penalty will raise the importance of avoiding detours in the specified direction, - * while decreasing this penalty will raise the importance of all other restrictions. - *

- *

- * Use {@link yfiles.router.EdgeLayoutDescriptor#monotonicPathRestriction} to set the monotonic path restrictions of a certain edge. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.router.EdgeLayoutDescriptor#monotonicPathRestriction - * @type {number} - */ - monotonyViolationPenalty:number; - /** - * Gets or sets the penalty for an edge leaving and reentering in the same {@link yfiles.layout.PartitionGrid partition grid} cell. - *

- * This penalty will make routes that re-enter the same partition grid cell more expensive than routes taking a more direct - * way. - *

- *

- * Increasing the partition grid reentrance penalty will raise the importance of taking the most direct way through the - * partition grid, while decreasing this penalty will raise the importance of all other restrictions. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.layout.PartitionGrid - * @type {number} - */ - partitionGridCellReentrancePenalty:number; - /** - * Gets or sets the penalty if an edge does not comply with its {@link yfiles.layout.PortCandidate}s or - * {@link yfiles.layout.PortConstraint}s. - *

- * This penalty will make routes that start or end at a point that doesn't comply with its port constraints more expensive - * than routes that obey them. - *

- *

- * Increasing the port violation penalty will raise the importance of maintaining port constraints, while decreasing this - * penalty will raise the importance of all other restrictions. It is recommended to have high penalties for port violation - * since the constraints lose purpose if they are disregarded. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.layout.PortCandidate - * @see yfiles.layout.PortConstraint - * @type {number} - */ - portViolationPenalty:number; - /** - * Gets or sets the penalty for an edge with a group ID that is not grouped at source or target side. - *

- * This penalty will make routes for grouped edges that don't use partly the same path as the other edges in this group - * more expensive than routes that stick to the group. - *

- *

- * Increasing the invalid edge grouping penalty will raise the importance of grouping edges with the same group ID, while - * decreasing this penalty will raise the importance of all other restrictions. As edge groups require that the route of an - * edge belonging to an edge group stays partly identical to the other edges of the group, the route may not be optimal - * with respect to the other restrictions. To maintain the edges together as long as possible, this penalty should be - * higher than most others. - *

- *

- * Grouped edges have the same source or target group ID assigned in the data provider registered with the graph with the {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} - * or {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY} key. - *

- *

- * The value must be greater than or equal to 0, otherwise the default value will be assigned. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @type {number} - */ - invalidEdgeGroupingPenalty:number; - /** - * Gets or sets the penalty for bends of a self-loop edge. - *

- * This penalty will make self-loops leave and enter the node at different sides unless they are forced to one side by - * {@link yfiles.layout.PortConstraint}s or {@link yfiles.layout.PortCandidate}s. - *

- *

- * Increasing this penalty will stronger enforce routing the self-loops between two sides of the node but it will also - * require more time for determining the edge path. Decreasing the penalty may result in self-loops that only connect to - * one side of the node. - *

- *

- * By default this value is set to 9. The value must be >= 0, otherwise the default value will be assigned. - *

- * @type {number} - */ - singleSideSelfLoopPenalty:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PenaltySettings; - } - /** - * {@link yfiles.router.PolylineLayoutStage} extends the orthogonal edge paths with polyline segments. - *

- * The current implementation only adds octilinear segments to all orthogonal edges. Non-orthogonal edges are completely - * ignored. - *

- *

- * An octilinear segment is added between two consecutive vertical and horizontal segments. The length of an octilinear - * segment can be influenced by the {@link yfiles.router.PolylineLayoutStage#maximumNonOrthogonalSegmentRatio maximum non-orthogonal segment ratio} and the {@link yfiles.router.PolylineLayoutStage#preferredPolylineSegmentLength preferred polyline segment length}. The new - * octilinear segments maintain a {@link yfiles.router.PolylineLayoutStage#minimumNodeToEdgeDistance minimum distance} between the edges and all nodes in the graph if possible. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface PolylineLayoutStage extends yfiles.layout.LayoutStageBase{} - export class PolylineLayoutStage { - /** - * Creates a new instance of {@link yfiles.router.PolylineLayoutStage} using the given {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - * @param [coreLayouter=null] the core layout routine - */ - constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * Gets or sets the {@link yfiles.algorithms.IDataProvider} key used for looking up the selected state of the nodes of the graph to - * be laid out. - *

- * If the {@link yfiles.router.PolylineLayoutStage#scope scope} is set to - * {@link yfiles.router.Scope#ROUTE_EDGES_AT_AFFECTED_NODES}, only edges of selected nodes are routed, while all other edges are - * considered to have fixed routes. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @see yfiles.router.PolylineLayoutStage#scope - * @type {any} - */ - affectedNodesDpKey:any; - /** - * Gets or sets the {@link yfiles.algorithms.IDataProvider} key used for looking up the selected state of the edges of the graph to - * be laid out. - *

- * If the {@link yfiles.router.PolylineLayoutStage#scope scope} is set to - * {@link yfiles.router.Scope#ROUTE_AFFECTED_EDGES}, only the selected edges are routed, while all other edges are considered to - * have fixed routes. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @see yfiles.router.PolylineLayoutStage#scope - * @type {any} - */ - affectedEdgesDpKey:any; - /** - * Gets or sets the (sub-)set of edges to be routed in a polyline fashion. - * @throws {Stubs.Exceptions.ArgumentError} if the given argument is none of the predefined scope values - * @see yfiles.router.PolylineLayoutStage#affectedEdgesDpKey - * @see yfiles.router.PolylineLayoutStage#affectedNodesDpKey - * @type {yfiles.router.Scope} - */ - scope:yfiles.router.Scope; - /** - * Gets or sets the minimum distance between edges and node bounds. - *

- * Values should be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the distance is negative - * @type {number} - */ - minimumNodeToEdgeDistance:number; - /** - * Gets or sets the maximum segment length ratio at each end of an orthogonal segment that may get converted into a - * (non-orthogonal) polyline segment. - *

- * The ratio must be between 0 and 0.5. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the ratio does not lie within [0,0.5] interval - * @type {number} - */ - maximumNonOrthogonalSegmentRatio:number; - /** - * Gets or sets the preferred segment length for (non-orthogonal) polyline segments. - *

- * Values should be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the length is negative - * @type {number} - */ - preferredPolylineSegmentLength:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PolylineLayoutStage; - } - /** - * Represents a group of segments of different edges that shall be combined at their common source or target. - *

- * Grouped edges have the same source or target group ID assigned in the {@link yfiles.algorithms.IDataProvider} registered with - * the graph with {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} or {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY} - * keys. - *

- *

- * The {@link yfiles.router.SegmentGroup} contains the {@link yfiles.router.SegmentGroup#commonLocationRange common location range} for the edge group and provides a {@link yfiles.router.SegmentGroup#commonSegmentInfo common segment info} - * representing the grouped segments. - *

- * @class - */ - export interface SegmentGroup extends yfiles.lang.Object{} - export class SegmentGroup { - /** - * Creates a new instance of {@link yfiles.router.SegmentGroup} that contains the given segments and a range to place them. - * @param commonLocationRange the location range of the given {@link }s - * @param segmentInfos the list containing the grouped {@link }s - */ - constructor(commonLocationRange:yfiles.router.Interval,segmentInfos:yfiles.collections.IList); - /** - * Gets the common location range for the {@link yfiles.router.SegmentGroup#segmentInfos segments} in this group. - *

- * For vertical grouped segments, this interval describes the horizontal range where this segment can be placed. Horizontal - * grouped segments are placed in a vertical range. - *

- * @type {yfiles.router.Interval} - */ - commonLocationRange:yfiles.router.Interval; - /** - * Gets the list of {@link yfiles.router.SegmentInfo}s contained in this group. - * @type {yfiles.collections.IList.} - */ - segmentInfos:yfiles.collections.IList; - /** - * Gets the common {@link yfiles.router.SegmentInfo} representing the grouped segments. - *

- * The returned segment info is used for placing the common segment. The coordinates are applied to all edges in the bundle - * later. - *

- * @type {yfiles.router.SegmentInfo} - */ - commonSegmentInfo:yfiles.router.SegmentInfo; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.SegmentGroup; - } - /** - * A {@link yfiles.router.SegmentInfo} holds information about the possible location of an orthogonal edge segment. - *

- * Most notably, it stores the {@link yfiles.router.SegmentInfoBase#direction direction} of the segment and the {@link yfiles.router.SegmentInfoBase#locationRange interval} that restricts the location of the segment. - *

- * @class - * @extends {yfiles.router.SegmentInfoBase} - */ - export interface SegmentInfo extends yfiles.router.SegmentInfoBase{} - export class SegmentInfo { - /** - * Creates a new instance of {@link yfiles.router.SegmentInfo} with the given information. - * @param edge the edge to which the segment of this info belongs - * @param segmentIndex the index of the segment to which this info belongs - * @param direction the direction to which the segment of this info points - * @param locationRange the range within which the common location of this segment has to lie - * @param minExtension the minimum interval in extension direction this segment is known to intersect - * @param maxExtension the maximum interval in extension direction this segment will span - * @param cellSegmentInfos the list of {@link } objects upon which this segment info is built - */ - constructor(edge:yfiles.algorithms.Edge,segmentIndex:number,direction:yfiles.layout.Direction,locationRange:yfiles.router.Interval,minExtension:yfiles.router.Interval,maxExtension:yfiles.router.Interval,cellSegmentInfos:yfiles.collections.IList); - /** - * Creates a new instance of {@link yfiles.router.SegmentInfo} using a {@link yfiles.algorithms.LineSegment} to describe the edge segment. - * @param edge the edge to which the segment of this info belongs - * @param segmentIndex the index of the segment to which this info belongs - * @param segment a line segment describing the edge segment - */ - constructor(edge:yfiles.algorithms.Edge,segmentIndex:number,segment:yfiles.algorithms.LineSegment); - /** - * Returns the number of {@link yfiles.router.CellSegmentInfo} of this segment info. - * @returns the number of {@link } of this segment info - */ - cellSegmentInfoCount():number; - /** - * Returns the {@link yfiles.router.CellSegmentInfo} at the given index of this segment info. - * @param index the index of the {@link } to return - * @returns the {@link } at the given index of this segment info - */ - getCellSegmentInfo(index:number):yfiles.router.CellSegmentInfo; - /** - * Sets the {@link yfiles.router.SegmentGroup segment group} for this segment info and its associated {@link yfiles.router.CellSegmentInfo}s. - *

- * The {@link yfiles.router.SegmentInfoBase#locationRange location ranges} are adjusted to use the {@link yfiles.router.SegmentGroup#commonLocationRange}. - *

- * @see yfiles.router.SegmentGroup - * @type {yfiles.router.SegmentGroup} - */ - segmentGroup:yfiles.router.SegmentGroup; - /** - * Gets or sets whether or not this edge segment has the restriction of a strong {@link yfiles.layout.PortConstraint}. - * @type {boolean} - */ - atStrongPortConstraint:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.SegmentInfo; - } - /** - * This class stores location information for orthogonal edge segments. - *

- * Most notably, {@link yfiles.router.SegmentInfoBase} stores the {@link yfiles.router.SegmentInfoBase#direction direction} to which the segment points and the {@link yfiles.router.SegmentInfoBase#locationRange interval} describing - * possible locations and extensions of a segment. - *

- * @class - */ - export interface SegmentInfoBase extends yfiles.lang.Object{} - export class SegmentInfoBase { - /** - * Creates a new instance of {@link yfiles.router.SegmentInfoBase}. - * @param edge the edge to which the segment of this info belongs - * @param segmentIndex the index of the segment to which this info belongs - * @param direction the direction to which the segment of this info points - * @param locationRange the range within which the common location of this segment has to lie - * @param minExtension the minimum interval in extension direction this segment is known to intersect - * @param maxExtension the maximum interval in extension direction this segment will span - * @protected - */ - constructor(edge:yfiles.algorithms.Edge,segmentIndex:number,direction:yfiles.layout.Direction,locationRange:yfiles.router.Interval,minExtension:yfiles.router.Interval,maxExtension:yfiles.router.Interval); - /** - * Creates a new instance of {@link yfiles.router.SegmentInfoBase} using a line segment to describe the edge segment. - *

- * This constructor is meant to be used for fixed orthogonal edge segments. - *

- * @param edge the edge to which this segment info belongs - * @param segmentIndex the index of the segment to which this info belongs - * @param segment a line segment describing the edge segment - * @protected - */ - constructor(edge:yfiles.algorithms.Edge,segmentIndex:number,segment:yfiles.algorithms.LineSegment); - /** - * Gets the minimum known extension of the segment, i.e., the minimum interval that this segment will cover in any case. - *

- * For horizontal intervals, this is the minimum horizontal extension; for vertical intervals, this is the minimum vertical - * extension. - *

- * @type {yfiles.router.Interval} - */ - minExtension:yfiles.router.Interval; - /** - * Gets the maximum extension that this segment can span. - *

- * For horizontal intervals, this is the maximum horizontal extension; for vertical intervals, this is the maximum vertical - * extension. - *

- * @type {yfiles.router.Interval} - */ - maxExtension:yfiles.router.Interval; - /** - * Gets the range, i.e., the interval within which the segment should be placed. - *

- * For horizontal segments, this is the range containing the vertical location; for vertical segments, this is the range - * containing the horizontal location. - *

- * @type {yfiles.router.Interval} - */ - locationRange:yfiles.router.Interval; - /** - * Gets or sets the preferred placement of this segment within its location range. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown alignment is given - * @type {yfiles.router.Alignment} - */ - preferredAlignment:yfiles.router.Alignment; - /** - * Gets or sets the {@link yfiles.router.SegmentInfoBase#fixed fixed} location within the {@link yfiles.router.SegmentInfoBase#locationRange location range} for this segment info. - *

- * For horizontal segments, this is the vertical location; for vertical segments, this is the horizontal location. - *

- * @throws {Stubs.Exceptions.InvalidOperationError} if the segment info already has a fixed location - * @throws {Stubs.Exceptions.ArgumentError} if the given location does not lie within the location range - * @see yfiles.router.SegmentInfoBase#fixed - * @see yfiles.router.SegmentInfoBase#locationRange - * @type {number} - */ - location:number; - /** - * Gets whether or not this segment info is fixed, i.e., a {@link yfiles.router.SegmentInfoBase#location fixed location} has been determined within its {@link yfiles.router.SegmentInfoBase#locationRange location range}. - * @type {boolean} - */ - fixed:boolean; - /** - * Gets whether or not the associated segment is vertical. - * @type {boolean} - */ - vertical:boolean; - /** - * Gets the {@link yfiles.layout.Direction} to which the segment of this info points. - * @type {yfiles.layout.Direction} - */ - direction:yfiles.layout.Direction; - /** - * Gets the edge to which the segment of this info belongs. - * @type {yfiles.algorithms.Edge} - */ - edge:yfiles.algorithms.Edge; - /** - * Gets the index of the segment of this info. - * @type {number} - */ - segmentIndex:number; - /** - * Gets or sets the segment group to which this segment info belongs. - *

- * When defining the segment group, the {@link yfiles.router.SegmentInfoBase#locationRange location range} will be adjusted to use the common interval of the segment group. - *

- * @see yfiles.router.SegmentGroup#commonLocationRange - * @type {yfiles.router.SegmentGroup} - */ - segmentGroup:yfiles.router.SegmentGroup; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.SegmentInfoBase; - } - /** - * A descriptor for bus-related information to be associated with an edge. - *

- * It consists of a bus ID defining the bus of the associated edge, two optional edge group IDs for specifying the edge - * grouping at the source and target side, respectively, and an optional boolean flag to mark the edge as fixed. - *

- *

- * Every object except null can be used as a valid bus ID. Every edge of ID null forms a group of its own. Also, every - * object except null can be used as a valid edge group ID. If there is no group ID defined for an edge or if null is set, - * a default group ID is used. Therefore, all such edges ending at the same node belong to the same group. - *

- * @see yfiles.router.BusRouter#EDGE_DESCRIPTOR_DP_KEY - * @class - */ - export interface BusDescriptor extends yfiles.lang.Object{} - export class BusDescriptor { - /** - * Creates a new instance of {@link yfiles.router.BusDescriptor} for the specified parameters. - * @param busID the ID of the bus to which the associated edge belongs - * @param fixed true if associated edge is fixed, false otherwise - * @param sourceGroupID the group ID of the source side - * @param targetGroupID the group ID of the target side - */ - constructor(busID:any,fixed:boolean,sourceGroupID:any,targetGroupID:any); - /** - * Creates a new instance of {@link yfiles.router.BusDescriptor} for the specified parameters and default group IDs. - * @param busID the ID of the bus to which the associated edge belongs - * @param fixed true if associated edge is fixed, false otherwise - */ - constructor(busID:any,fixed:boolean); - /** - * Creates a new instance of {@link yfiles.router.BusDescriptor} for the specified parameters and marks it as not fixed. - * @param busID the ID of the bus to which the associated edge belongs - * @param sourceGroupID the group ID of the source side - * @param targetGroupID the group ID of the target side - */ - constructor(busID:any,sourceGroupID:any,targetGroupID:any); - /** - * Creates a new instance of {@link yfiles.router.BusDescriptor} for the specified bus ID which is marked as not fixed and uses the - * default edge group IDs. - * @param busID the ID of the bus to which the associated edge belongs - */ - constructor(busID:any); - /** - * Gets or sets the bus ID. - *

- * Edges associated with {@link yfiles.router.BusDescriptor descriptor instances} having the same bus ID belong to a common bus. Every edge associated with ID - * null forms a group of its own. - *

- * @type {any} - */ - busId:any; - /** - * Gets or sets the group ID for the source side of the edge. - *

- * Edges incident to the same node v but associated with different group IDs at this endpoint, use separate bus connections - * at v. - *

- * @type {any} - */ - sourceGroupId:any; - /** - * Gets or sets the group ID for the target side of the edge. - *

- * Edges incident to the same node v but associated with different group IDs at this endpoint, use separate bus connections - * at v. - *

- * @type {any} - */ - targetGroupId:any; - /** - * Gets or sets whether or not the associated edge is fixed. - *

- * The algorithm doesn't change the route of fixed edges but tries to prevent overlaps with non-fixed edges. - *

- * @type {boolean} - */ - fixed:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.BusDescriptor; - } - /** - * This class provides helper methods to convert between buses given by complete subgraphs and buses represented by - * specific hub nodes. - *

- * In a representation by means of hubs, each connected subgraph induced by hubs establishes a bus. All regular nodes - * (non-hubs) which are connected to hubs of the same component are end-nodes of the same bus. In other words, nodes which - * are reachable on paths consisting of only hubs belong to the same bus. Of course, a node can be an end-node of more than - * one bus. - *

- *

- * Since a bus models a group of nodes in which every node is connected to every other node, it can be represented as a - * complete subgraph of these nodes. To distinguish buses in this representation, each edge must be associated with a - * unique ID which identifies the bus to which it is associated. This is the representation expected by - * {@link yfiles.router.BusRouter}. - *

- * @class - */ - export interface BusRepresentations extends yfiles.lang.Object{} - export class BusRepresentations { - /** - * Changes the representation of buses from hubs to complete subgraphs by creating new edges between regular nodes and - * removing the hubs. - *

- * This method respects multiple connections of nodes and creates appropriate - * {@link yfiles.router.BusDescriptor}s consisting of the bus ID as well as source and target group IDs. - *

- *

- * The path of each new edge follows the route defined by the component of the hubs. If the subgraph of hubs is not a tree, - * these paths are ambiguous. In this case, an arbitrary tree is computed from the hub's subgraph which defines all the - * paths. - *

- * @param graph the graph of the bus - * @param hubEdgesLists an array of {@link }s each containing the edges of a bus - * @param hubMarker a {@link } that marks hub nodes - * @param fixedMarker a {@link } that marks fixed edges - * @param descriptorAcceptor a {@link } for storing the created bus descriptors - * @returns a list of the created edges - * @static - */ - static replaceHubsBySubgraph(graph:yfiles.layout.LayoutGraph,hubEdgesLists:yfiles.algorithms.EdgeList[],hubMarker:yfiles.algorithms.IDataProvider,fixedMarker:yfiles.algorithms.IDataProvider,descriptorAcceptor:yfiles.algorithms.IDataAcceptor):yfiles.algorithms.EdgeList; - /** - * Changes the representation of buses from hubs to complete subgraphs. - *

- * This method delegates to {@link yfiles.router.BusRepresentations#replaceHubsBySubgraph}. - *

- * @param graph the graph of the bus - * @param hubMarker a {@link } that marks hub nodes - * @param descriptorAcceptor a {@link } for storing the created bus descriptors - * @returns a list of the created edges - * @see yfiles.router.BusRepresentations#replaceHubsBySubgraph - * @see yfiles.router.BusRepresentations#toEdgeLists - * @static - */ - static replaceHubsBySubgraph(graph:yfiles.layout.LayoutGraph,hubMarker:yfiles.algorithms.IDataProvider,descriptorAcceptor:yfiles.algorithms.IDataAcceptor):yfiles.algorithms.EdgeList; - /** - * Changes the representation of buses from complete subgraphs to hubs by replacing intersection points by hubs. - *

- * The edges of the given graph must form an orthogonal, cycle-free bus, otherwise an {@link yfiles.lang.Exception} is thrown. - *

- * @param graph the graph where each bus is represented by a complete subgraph of the corresponding nodes - * @param edgeCursor an {@link } of the regular edges - * @param descriptorProvider a {@link } that provides a {@link } for each edge - * @param busIDAcceptor an optional {@link } that stores the bus ID for each new edge - * @throws {Stubs.Exceptions.InvalidOperationError} if the path of an edge is not orthogonal or if some paths form a cycle - * @static - */ - static replaceSubgraphByHubs(graph:yfiles.layout.LayoutGraph,edgeCursor:yfiles.algorithms.IEdgeCursor,descriptorProvider:yfiles.algorithms.IDataProvider,busIDAcceptor:yfiles.algorithms.IDataAcceptor):void; - /** - * Calculates for every bus represented by hubs a list of all of its edges. - * @param graph the graph where buses are represented by means of hubs - * @param hubMarker a {@link } which marks hub nodes - * @returns an array of {@link }s where each list contains all edges of a bus - * @static - */ - static toEdgeLists(graph:yfiles.algorithms.Graph,hubMarker:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList[]; - /** - * Data acceptor key to transfer a user-defined object from each original edge to the respective newly created edge - *

- * Since there is no one-to-one mapping between original and new edges, the data provider of this key is responsible for - * the edges whose source endpoint is a regular node. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static SOURCE_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data acceptor key to transfer a user-defined object from each original edge to the respective newly created edge - *

- * Since there is no one-to-one mapping between original and new edges, the data provider of this key is responsible for - * the edges whose target endpoint is a regular node. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static TARGET_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.BusRepresentations; - } - /** - * An edge routing algorithm which routes edges of a graph in an orthogonal bus-style. - *

- * Carefully observe that the resulting representation, with many edge segments drawn on top of each other, leaves little - * room for a sensible interpretation of edge direction. - *

- *

- * Layout Style - *

- *

- * Edge segments are bundled to buses. A bus is a segment shared by multiple edges to which shorter segments that connect - * to actual nodes are attached. Buses and all other segments are routed orthogonally. - *

- *

- * A bus can, for example, be created in parts of a diagram where each node is connected to each other node. There are no - * cycles induced by any two edge paths of the same bus, that is, the combination of all edge routes looks like an - * orthogonal tree. - *

- *

- * The algorithm tries to produce routes where the edges share as much of their paths as possible. It yields long line - * segments (so-called backbone segments) where ideally all but the first and last segments of all edge paths are drawn on top of each other - * (forming a - * bus), with short connections branching off to the nodes - * (bus connections). These short connections bundle the respective first or last segments of a node's incident edges. - *

- *

- * This algorithm will not modify positions or sizes of nodes in any way, but will route the edges of the graph. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":0},"n":[[375,165],[375,255],[585,165],[585,255],[585,345],[705,345],[705,165],[705,255],[825,165],[495,435],[585,435],[585,525]],"e":[[2,1,-15,0,0,15,[555,180,555,315,390,315]],[2,3,-15,0,-15,0,[555,180,555,270]],[3,1,-15,0,0,15,[555,270,555,315,390,315]],[2,4,-15,0,-15,0,[555,180,555,360]],[3,4,-15,0,-15,0,[555,270,555,360]],[1,4,0,15,-15,0,[390,315,555,315,555,360]],[5,4,0,-15,-15,0,[720,315,555,315,555,360]],[5,1,0,-15,0,15,[720,315,390,315]],[5,3,0,-15,-15,0,[720,315,555,315,555,270]],[5,2,0,-15,-15,0,[720,315,555,315,555,180]],[5,7,0,-15,0,15],[7,4,0,15,-15,0,[720,315,555,315,555,360]],[7,1,0,15,0,15,[720,315,390,315]],[7,3,0,15,-15,0,[720,315,555,315,555,270]],[7,2,0,15,-15,0,[720,315,555,315,555,180]],[5,9,0,-15,15,0,[720,315,555,315,555,450]],[7,9,0,15,15,0,[720,315,555,315,555,450]],[2,9,-15,0,15,0,[555,180,555,450]],[3,9,-15,0,15,0,[555,270,555,450]],[1,9,0,15,15,0,[390,315,555,315,555,450]],[4,9,-15,0,15,0,[555,360,555,450]],[5,10,0,-15,-15,0,[720,315,555,315,555,450]],[7,10,0,15,-15,0,[720,315,555,315,555,450]],[2,10,-15,0,-15,0,[555,180,555,450]],[3,10,-15,0,-15,0,[555,270,555,450]],[1,10,0,15,-15,0,[390,315,555,315,555,450]],[4,10,-15,0,-15,0,[555,360,555,450]],[9,10,15,0,-15,0],[5,11,0,-15,-15,0,[720,315,555,315,555,540]],[7,11,0,15,-15,0,[720,315,555,315,555,540]],[2,11,-15,0,-15,0,[555,180,555,540]],[3,11,-15,0,-15,0,[555,270,555,540]],[1,11,0,15,-15,0,[390,315,555,315,555,540]],[4,11,-15,0,-15,0,[555,360,555,540]],[9,11,15,0,-15,0,[555,450,555,540]],[10,11,-15,0,-15,0,[555,450,555,540]],[0,1,0,15,0,-15,1],[0,2,0,15,0,15,1,[390,225,600,225]],[1,2,0,-15,0,15,1,[390,225,600,225]],[0,3,0,15,0,-15,1,[390,225,600,225]],[1,3,0,-15,0,-15,1,[390,225,600,225]],[3,2,0,-15,0,15,1],[0,6,0,15,0,15,1,[390,225,720,225]],[1,6,0,-15,0,15,1,[390,225,720,225]],[3,6,0,-15,0,15,1,[600,225,720,225]],[6,2,0,15,0,15,1,[720,225,600,225]],[0,7,0,15,0,-15,1,[390,225,720,225]],[1,7,0,-15,0,-15,1,[390,225,720,225]],[3,7,0,-15,0,-15,1,[600,225,720,225]],[7,2,0,-15,0,15,1,[720,225,600,225]],[7,6,0,-15,0,15,1],[0,8,0,15,0,15,1,[390,225,840,225]],[1,8,0,-15,0,15,1,[390,225,840,225]],[3,8,0,-15,0,15,1,[600,225,840,225]],[7,8,0,-15,0,15,1,[720,225,840,225]],[8,2,0,15,0,15,1,[840,225,600,225]],[8,6,0,15,0,15,1,[840,225,720,225]]],"vp":[375.0,165.0,480.0,390.0]}} Bus-style edge routing with default settings {@graph {"ann":{"s":[30,30],"d":0},"n":[[529,405,120,120],[765,405],[765,495],[945,405],[945,495],[255,405],[255,495],[435,405],[345,495],[435,495],[345,405],[765,212],[765,302],[945,212],[855,302],[945,302],[855,212],[675,302],[900,302],[900,212],[810,212],[810,302],[511,212],[435,212],[359,212],[283,212],[555,105],[622,105],[555,30],[622,30],[622,-45]],"e":[[0,1,60,0,0,15,[780,465]],[0,2,60,0,0,-15,[780,465]],[0,3,60,0,0,15,[960,465]],[0,4,60,0,0,-15,[960,465]],[0,5,-60,0,0,15,[270,465]],[0,6,-60,0,0,-15,[270,465]],[0,7,-60,0,0,15,[450,465]],[0,8,-60,0,0,-15,[360,465]],[0,9,-60,0,0,-15,[450,465]],[0,10,-60,0,0,15,[360,465]],[0,11,0,-60,0,15,[589,272,780,272]],[0,12,0,-60,0,-15,[589,272,780,272]],[0,13,0,-60,0,15,[589,272,960,272]],[0,14,0,-60,0,-15,[589,272,870,272]],[0,15,0,-60,0,-15,[589,272,960,272]],[0,16,0,-60,0,15,[589,272,870,272]],[0,17,0,-60,0,-15,[589,272,690,272]],[0,18,0,-60,0,-15,[589,272,915,272]],[0,19,0,-60,0,15,[589,272,915,272]],[0,20,0,-60,0,15,[589,272,825,272]],[0,21,0,-60,0,-15,[589,272,825,272]],[0,22,0,-60,0,15,[589,272,526,272]],[0,23,0,-60,0,15,[589,272,450,272]],[0,24,0,-60,0,15,[589,272,374,272]],[0,25,0,-60,0,15,[589,272,298,272]],[0,26,15,-60,15,0,[604,120]],[0,27,15,-60,-15,0,[604,120]],[0,28,15,-60,15,0,[604,45]],[0,29,15,-60,-15,0,[604,45]],[0,30,15,-60,-15,0,[604,-30]]],"vp":[255.0,-45.0,720.0,570.0]}} Edge routing sample including four different busesConcept - *

- *

- * The algorithm uses a two-phase process: - *

- *
    - *
  1. Backbone Selection: a set of suitable initial backbone segments is determined.
  2. - *
  3. - * Routing and Recombination: each initial backbone segment is connected to all other backbone segments and to each node by using orthogonal edge - * paths. Then, the resulting structure is reduced to the most optimal structure where backbone segments are long and - * connections to the nodes are short. - *
  4. - *
- *

- * Features - *

- *

- * To determine which edges belong to a common bus, a mapping that assigns a bus ID to each edge must be specified using - * {@link yfiles.router.BusDescriptor}s. A {@link yfiles.algorithms.IDataProvider} holding {@link yfiles.router.BusDescriptor} instances is - * expected to be registered with the graph using the - * {@link yfiles.router.BusRouter#EDGE_DESCRIPTOR_DP_KEY descriptor key}. In the absence of an individual bus ID for an edge, a bus consisting only of the single edge is - * created. - *

- *

- * This algorithm supports {@link yfiles.layout.PortConstraint}s as well as - * {@link yfiles.layout.PortCandidate}s to control where edges should connect to nodes. - *

- *

- * Note that if edges of the same bus connect to a common node but have inconsistent or contradicting port - * constraints/candidates, then any of these constraints/candidates can determine the actual location of the common port. - * The same applies for edges that, in addition, belong to the same edge group. - *

- *

- * Also, the cardinality defined with a {@link yfiles.layout.PortCandidateSet} object is interpreted in terms of different bus IDs - * (group IDs) instead of number of edges. - *

- *

- * This algorithm supports incremental edge routing, that is, extending or updating an already existing bus-style - * representation. This is useful to rearrange existing edges or to include additional edges in an existing bus. - *
- * Incremental routing is supported by denoting so-called fixed edges using the - * {@link yfiles.router.BusDescriptor#fixed corresponding BusDescriptor property}. The paths of edges which are not marked as fixed are calculated by the algorithm. - * The structure induced by the fixed edges must be orthogonal and cycle-free. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface BusRouter extends yfiles.layout.LayoutStageBase{} - export class BusRouter { - /** - * Creates a new instance of {@link yfiles.router.BusRouter} with default settings. - */ - constructor(); - /** - * Data provider key for specifying a bus descriptor object for each edge - *

- * The {@link yfiles.router.BusDescriptor} for an edge provides the edge's bus ID, its optional group IDs and whether or not the - * edge is fixed. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_DESCRIPTOR_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for specifying the edge subset to be routed - *

- * This key is used if no custom key for specifying the subset is defined using {@link yfiles.router.BusRouter#affectedEdgesDpKey}. - *

- * @see yfiles.router.BusRouter#scope - * @see yfiles.router.BusRouter#affectedEdgesDpKey - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static DEFAULT_AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets the equidistant spacing between the horizontal and vertical grid lines. - *

- * Positive values greater than 2 are allowed. Positive values less than 2 are ignored, while negative values are mapped to - * their absolute value. - *

- * @see yfiles.router.BusRouter#gridRouting - * @type {number} - */ - gridSpacing:number; - /** - * Gets or sets whether or not to route edge segments on grid lines only. - * @type {boolean} - */ - gridRouting:boolean; - /** - * Gets or sets the minimum distance between edge segments and nodes. - *

- * Positive values greater than 2 are allowed. Positive values less than 2 are ignored, while negative values are mapped to - * their absolutes. - *

- * @type {number} - */ - minimumDistanceToNode:number; - /** - * Gets or sets the minimum distance between any two edge segments. - *

- * The edge routing algorithm adheres to this value if possible, but reduces the distance value selectively, i.e., only for - * a currently processed edge, when there is not enough space to find a path with the proper value. - *

- *

- * Positive values greater than 4 are allowed. Positive values less than 4 are ignored, while negative values are mapped to - * their absolute values. - *

- * @type {number} - */ - minimumDistanceToEdge:number; - /** - * Gets or sets the cost for each edge crossing. - *

- * A cost value of n means that it is more profitable for a path to change its direction n times rather than crossing the - * path of an edge. If the cost value is set to 0.0, no global crossing optimization is performed. - *

- *

- * The cost is defined to be a non-negative value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given cost value is negative - * @type {number} - */ - crossingCost:number; - /** - * Gets or sets whether or not to perform an additional step to reroute the edges such that the number of edge crossings is - * reduced. - *

- * This features does not guarantee that the number of crossings will be the minimal. - *

- * @see yfiles.router.BusRouter#crossingCost - * @type {boolean} - */ - rerouting:boolean; - /** - * Gets or sets the maximum number of selected backbone segments with the same orientation. - *

- * This setting defines the number of backbone segments of the same orientation which are computed by the backbone - * selection phase. The final number of backbone segments may be different due to changes in the routing and recombination - * phase. - *

- *

- * The number must be a value greater than or equal to 1. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given preferred number is smaller than 1 - * @type {number} - */ - preferredBackboneSegmentCount:number; - /** - * Gets or sets the preferred minimum length of a backbone segment. - *

- * This number defines the minimum length of backbone segments which are computed by the backbone selection phase. Some of - * the final backbone segments may be shorter due to changes in the routing and recombination phase. - *

- *

- * The minimum length is defined to be a value greater than or equal to 1.0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given minimum length is smaller than 1.0 - * @type {number} - */ - minimumBackboneSegmentLength:number; - /** - * Gets or sets the minimum number of bus connections a backbone segment must have. - *

- * If a backbone segment has less connections, it is removed and the affected nodes connect to another backbone segment. - *

- *

- * The minimum connection count must be a value greater than or equal to 1. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given minimum count is smaller than 1 - * @type {number} - */ - minimumBusConnectionsCount:number; - /** - * Gets or sets whether or not collinear bends are removed from the layout. - *

- * A collinear bend is a bend that lies on a common line with its predecessor bend and successor bend. - *

- *

- * If an edge has a collinear bend, there is another edge which has a real bend at this point, i.e., the bend location is - * an intersection of the bus. Therefore, it may be advantageous for some applications to keep such bends. - *

- * @type {boolean} - */ - removeCollinearBends:boolean; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} for marking edges as selected. - *

- * If the {@link yfiles.router.BusRouter#scope scope} is set to {@link yfiles.router.Scope#ROUTE_AFFECTED_EDGES}, only the edges for which the registered {@link yfiles.algorithms.IDataProvider} - * returns true will be routed. All other edges will be considered to have fixed routes. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @type {any} - */ - affectedEdgesDpKey:any; - /** - * Gets or sets the scope for this routing algorithm that determines which edges are routed. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown scope is given - * @type {yfiles.router.Scope} - */ - scope:yfiles.router.Scope; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.BusRouter; - } - /** - * This edge routing algorithm generates orthogonal routes for the edges of the graph. - *

- * Compared to the routing algorithm implemented by class - * {@link yfiles.router.EdgeRouter}, this implementation is usually faster but supports less constraints and, by default, may - * produce node-edge overlaps. - *

- *

- * Layout Style Edges are routed in an orthogonal fashion, i.e., edge paths consist only of vertical and horizontal segments. - *

- *

- * During the routing process, the positions of the nodes are considered to be fixed and the routing algorithm will not - * modify their locations or their sizes in any way. - *

- *

- * The edge routing algorithm can be applied wherever it is required to route the edges as orthogonal segments, while - * keeping the positions of the nodes in the diagram fixed. Some potential applications include electric circuit design, - * floor planning, UML class diagrams/inheritance diagrams and navigation maps. - *

- *

- * {@graph {"ann":{"s":[45,30],"d":0},"n":[[210,270,60,30],[405,165,60,30],[120,270,60,30],[-7.5,270],[75,375,60,30],[502.5,165],[615,270,60,30],[630,330,30,30],[292.5,225,75,30],[232.5,60],[112.5,165,75,30],[630,60,30,30],[225,0,60,30],[712.5,330],[-7.5,375],[712.5,0],[120,330,60,30],[307.5,330],[712.5,270],[585,165,30,30],[412.5,225],[502.5,225],[232.5,120],[465,105,75,30]],"e":[[7,6,0,-15,0,15],[8,17,0,15,0,-15],[9,3,-22.5,0,-5,-15,[10,75]],[1,9,0,-15,22.5,0,[435,75]],[11,6,0,15,0,-15],[3,2,22.5,0,-30,0],[18,6,-22.5,0,30,0],[3,14,0,15,0,-15],[12,10,-30,0,-5,-15,[145,15]],[10,1,37.5,-5,-30,-5],[10,2,0,15,0,-15],[6,0,-30,0,30,0],[5,19,22.5,0,-15,0],[1,8,-8.75,15,5,-15,[426.25,205,335,205]],[9,11,5,-15,0,-15,[260,50,645,50]],[10,3,-37.5,0,5,-15,[20,180]],[8,0,-37.5,0,0,-15,[240,240]],[18,15,0,-15,0,15],[13,7,-22.5,0,15,0],[2,0,30,0,-30,0],[10,8,37.5,5,-5,-15,[325,185]],[16,17,30,0,-22.5,0],[13,18,0,-15,0,15],[1,5,30,0,-22.5,0],[12,15,30,0,-22.5,0],[12,9,-5,15,-5,-15],[14,4,22.5,0,-30,0],[16,2,0,-15,0,15],[8,20,37.5,0,-22.5,0],[20,1,1.25,-15,1.25,15],[21,5,0,-15,0,15],[22,9,0,-15,0,15],[22,10,-22.5,0,5,-15,[155,135]],[21,20,-22.5,0,22.5,0],[7,17,-15,0,22.5,0],[13,4,0,15,30,0,[735,390]],[23,11,0,-15,-15,0,[502.5,75]],[23,19,37.5,0,0,-15,[600,120]]],"vp":[-8.0,0.0,766.0,405.0]}} Sample output of the orthogonal edge routing algorithm with default settingsConcept This edge routing algorithm combines two - * strategic steps of edge routing and executes them one after the other. The first strategy is called path finder strategy - * and will route the edges, potentially with edge overlaps. The second strategy will then split overlapping edge segments - * inside their channels and distribute them according to the specific distribution strategy. - *

- *

- * The default path finding strategy is {@link yfiles.router.OrthogonalPatternEdgeRouter}. The default edge distribution strategy - * is {@link yfiles.router.OrthogonalSegmentDistributionStage}. - *

- *

- * Features - *

- *

- * This class itself has no special routing options except from specifying the {@link yfiles.router.ChannelEdgeRouter#pathFinderStrategy path finding} and {@link yfiles.router.ChannelEdgeRouter#edgeDistributionStrategy edge distribution} strategy. - * Most of the features like minimum element distances, grid spacing and path restrictions have to be set on the used - * instances for the two routing steps. - *

- *

- * For incremental edge routing, {@link yfiles.algorithms.IDataProvider} key {@link yfiles.router.ChannelEdgeRouter#AFFECTED_EDGES_DP_KEY} - * has to be registered with the graph to mark all edges that should be routed by the algorithm. The routes of the other - * edges remain unchanged. If there is no such key registered, the algorithm routes all edges. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface ChannelEdgeRouter extends yfiles.layout.LayoutStageBase{} - export class ChannelEdgeRouter { - /** - * Creates a new {@link yfiles.router.ChannelEdgeRouter} instance with default settings. - */ - constructor(); - /** - * Checks the sizes of the nodes to be non-zero. - * @param g The graph to check. - * @protected - */ - checkNodeSize(g:yfiles.layout.LayoutGraph):void; - /** - * Data provider key for marking the edges that should be routed - *

- * If this key is not registered with the graph, the algorithm will route all edges. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets the strategy for the path finding step. - *

- * This step routes the edges and may produce edge overlaps which are later resolved in the {@link yfiles.router.ChannelEdgeRouter#edgeDistributionStrategy edge distribution} step. - *

- * @type {yfiles.layout.ILayoutAlgorithm} - */ - pathFinderStrategy:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the strategy for the edge distribution step. - *

- * This step distributes overlapping edge segments in their channel. The channel in which the segments can be distributed - * is defined by the surrounding graph elements. - *

- * @type {yfiles.layout.ILayoutAlgorithm} - */ - edgeDistributionStrategy:yfiles.layout.ILayoutAlgorithm; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.ChannelEdgeRouter; - } - /** - * This edge routing algorithm applies organic routes to the edges of the graph. - *

- * Layout Style Edges are routed organically, i.e. in smooth curves around the nodes observing a {@link yfiles.router.OrganicEdgeRouter#minimumDistance minimum distance} to the nodes. - *

- *

- * During the routing process, the positions of the nodes are considered to be fixed and the router will not modify their - * locations or their sizes in any way. - *

- *

- * The edge routing algorithm can be applied whenever edge paths should avoid crossing any nodes in organic or cyclic - * layout styles. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":0,"c":1},"n":[[339,332],[314,663],[246,391],[112,365],[280,143],[309,245],[521,184],[519,462],[638,200],[118,200],[289,600],[419,153],[194,257],[564,349],[39,419],[266,76],[637,149],[247,23],[663,356],[420,517],[583,496],[183,525],[406,271],[498,406],[519,95],[250,263],[634,471],[340,459],[93,504],[368,110],[488,592],[177,154],[266,548],[470,161],[180,365],[606,400],[0,309],[130,256],[154,631],[60,311],[397,568],[16,241],[421,51],[22,368],[463,102],[67,224],[139,45],[196,95],[238,606],[347,510],[471,535],[365,631],[199,314],[125,96],[99,445],[421,463],[457,281],[497,35],[351,161],[572,190],[288,340],[400,220],[119,147],[570,98],[340,569],[526,513],[416,636],[196,35],[447,412],[242,496],[559,292],[150,416],[348,403],[38,477],[539,581],[228,146],[594,554],[610,280],[297,194],[329,0],[406,0],[181,206],[163,467],[317,66],[661,305],[55,150],[508,307],[180,576],[689,231],[96,555],[240,657],[543,241],[111,308],[555,405],[467,643],[449,352],[232,445],[666,416]],"e":[[0,1,[335.66,406.18,333.37,416.82,331.63,427.45,326.91,469.44,325.45,574.7,326.08,585.88,329.61,608.76,330.67,620.69]],[0,2,[322.18,373.25,310.13,381.03]],[0,3,[324.5,334.9,309.02,329.8,293.4,330.34,236.16,351.02,222.05,355.29,206.97,355.02,192.08,353.11,178.03,357.07]],[0,4,[351.49,268.72,349.88,254.78,343.6,242.42,331.57,234.82,303.36,234.17,292.35,226.33,286.5,215.59,286.02,203.04]],[0,5],[0,6,[428.62,311.49,440.22,302.84,454.41,274.85]],[0,7,[446.52,392.65,474.45,404,484.01,413.8,488.6,427.79,494.98,440.48]],[0,8,[426.01,313.31,439.52,303.87,453.15,277.95,464.34,271.34,476.96,270.23,500.5,273.67,544.26,281.36,555.61,282.65,567.08,280.79,577.87,275.33]],[0,9,[308.77,326.66,262.87,308.22,248.01,300.72,238.93,288.48,235.94,272.58,231.01,257.56,219.51,247.31,188.2,245.93,173.56,238.97]],[0,10,[338.79,396.59,334.49,413.65,328.25,447.31,320.83,497.58,312.44,564.66]],[0,11,[389.21,229.75,395.29,218.04]],[0,12,[317.61,329.41,260.47,307.45,250.73,302.73,241.57,296.79]],[0,13,[455.92,337.29,471.02,338.02,485.35,341.25,511.94,349.47]],[0,14,[322.04,373.66,309.3,379.72,294.9,380.89,266.5,377.98,252.08,379.76,238.85,386.12,213.64,401.5,199.41,406.7,183.85,406.68,167.87,404.99,151.09,407.31,134.98,411.26]],[0,15,[353.71,330.4,350.89,263.48,348.57,246.47,341.24,213.46,336.58,196.79,325.52,164.96,319.31,148.97,310.63,133.49]],[0,16,[414.67,318.85,438.09,305.77,445.29,294.3,450.39,282.07,458.9,273.15,469,266.59,548.02,222.11,556.91,213.74,565.88,190.33,574.87,182.39,586.14,178.03]],[0,17,[351.18,260.4,349.73,248.97,342.55,215.84,336.08,193.14,323.88,159.03,318.91,147.37,310.73,137.35,299.46,130.24,274.92,118.04,263.72,110.5,256.06,98.75,255.2,83.29]],[0,18,[449.23,337.24,460.44,336.84,472.05,337.94,483.25,340.2,515.57,347.93,527.01,348.23,538.21,346.05,570.17,336.94,581.97,336.14,593.53,338.61]],[0,19,[386.75,401.74,391.67,414.2,406.76,475.79,410.7,488.12,416.28,499.76,422.43,510.76,429.28,521.1]],[0,20,[441.16,390.65,454.09,396.14,467.28,401.18,479.65,408.23,486.46,419.97,490.73,433.62,499.82,443.19,513.09,447.19,527.26,449.42,540.69,452.14,552.84,459.14,562.64,469.33]],[0,21,[346.85,359.59,309.35,420.4,300.65,431.95,292.74,444.04,275.05,467.54,264.99,478.94,237.08,493.01,226.61,504.8]],[0,22],[0,23,[441.87,390.83,452.09,395.12,474.02,402.99]],[0,24,[394.9,278.08,405.38,265.78,420.33,260.03,433.54,253.67,440.93,239.63,453.72,194.88,457.41,179.4,462.73,163.54,473.96,151.35,489.87,142.62,505.68,131.98]],[0,25],[0,26,[443.76,391.94,454.52,396.46,465.49,400.4,475.94,405.45,483.96,413.69,487.9,425.26,492.62,436.58,501.97,444.03,513.85,447.54,538.88,451.1,551.26,454.29]],[0,27,[335.47,409.13,335.91,425.89,341.76,442.39]],[0,28,[304.63,401.81,279.42,427.37,264.93,433.6,249.25,434.04,233.94,436,177.31,454.17,162.81,461.08,150.78,471.69]],[0,29,[391.99,183.49,392.17,168.35]],[0,30,[379.7,389.49,387.21,404.3,392.85,419.75,407.6,477.96,412.89,491.58,422.65,501.66,437.13,505.23,451.35,510.41,461.14,523.17,460.71,539.45,459.43,556.24,467.8,571.02]],[0,31,[345.1,335.21,335.76,323.75,326.96,311.7,289.98,263.58,279.75,251.93]],[0,32,[343.55,373.14,315.75,453.99]],[0,33,[395.41,277.39,404.28,266.36,430.24,255.67,439.95,245.33,447.72,233.23,455.38,222.46,462.6,210.62,470.24,199.31]],[0,34,[320.5,374.57,310.3,379.58,299.25,381.01,267,377.27,256.18,376.82]],[0,35,[447.26,393.05,464.75,396.92,517.71,393.94,552.46,393.96,570.56,394.48,588.29,399.05]],[0,36,[324.51,334.8,313.86,330.99,302.52,329.37,291.4,331,229.75,353.05,218.61,355.85,206.54,355.04,194.57,352.53,183.37,351.65,140.67,350.4,74.42,351.92,63.14,348.81,43.25,339.26]],[0,37,[315.65,330.79,302.24,326.14,221.99,302.44,208.11,298.95,194.21,294.54]],[0,38,[291.97,443.38,271.04,472.33,261.99,480.94,249.87,486.16,238.48,492.54,232.04,503.67,229.86,516.59,221.46,592.14,216.53,604.24,208.21,614.3]],[0,39,[322.7,334.1,305.86,329.69,288.77,331.39,222.92,355.38,204.68,355.06,185.55,351.32,166.46,350.31,147.42,349.96,127.91,348.98,109.08,344.26]],[0,40,[385.83,399.93,391.14,415,405.18,536.96]],[0,41,[315.73,330.32,285.46,320.65,224.16,303.07,212.95,301.44,150.12,299.63,138.87,297.96,128.22,294.68]],[0,42,[392.06,206.63]],[0,43,[327.11,335.97,312.77,330.73,298.03,329.65,284.06,333.44,230.99,352.58,217.24,355.83,202.62,354.37,187.97,351.92,130.42,351.25,115.65,353.54]],[0,44,[389.02,229.97,397.45,216.12,410.94,207.76,438.95,194.72,452.19,186.4,459.38,173.33,463.33,158.21]],[0,45,[319.72,332.86,301.9,326.53,232.62,305.39,198.66,296.17,186.46,286.52,170.91,259.6,160.55,248.12,145.88,243.01]],[0,46,[286.25,258.53,248.79,216.04,242.43,206.94,235,197.31,228.43,187.39,221.82,176.16,217.01,162.99,210.26,150.25,198.66,139.63,188.34,129.15,180.36,115.63,173.55,101.92]],[0,47,[280.19,249.76,224.45,181.39,217.36,164.22]],[0,48,[285.9,512.16,276.58,527.31,263.6,539.9,254.29,553.79,252.08,570.91]],[0,49,[337.85,400.86,335.22,412.8,335.86,425.11,341.55,436.2,351.73,443.92,363.37,449.51,373.84,456.56,379.94,467.39,380.17,479.84,376.25,491.95,371.73,503.11]],[0,50,[363.53,357.76,373.66,368.31,383.38,379.43,393.44,390.12,433.18,435.74,454.89,458.54,463.23,472.48]],[0,51,[338.15,399.57,334.71,417.74,339.34,434.34,353.71,444.87,370.07,453.14,380.21,466.15,383.35,483.6,387.37,519.13,387.54,537.38,384.43,573.7]],[0,52,[319.73,332.96,301.78,329.04,283.75,328.69]],[0,53,[301.52,278.38,291.52,264.42,231.87,190.09,222.09,176.91,216.51,161.08,208.24,148.12,194.61,139.94]],[0,54,[328.75,368.24,314.97,377.91,298.88,381.42,264.15,377.59,247.67,381.71,234.12,393.32,188.56,445.62,174.64,454.91,158.8,458.39]],[0,55,[385.81,395.38]],[0,56,[442.78,309.64]],[0,57,[378.17,262.12,383.23,246.33,389.07,230.06,397.76,216.16,410.81,208.08,437.76,195.53,450.07,188.37,458.21,177.78,459.5,164.06,457.17,151.5,451.13,127.97,450.06,115.65,453.12,104.07,460.33,94.22]],[0,58],[0,59,[421.29,315.21,437.79,306.24,446.01,291.77,453.41,277.31,467.69,267.94]],[0,60],[0,61,[391.19,276.52]],[0,62,[343.32,333.1,332.31,319.71,321.89,305.25,289,262.94,276.51,250.23,222.11,206.93,207.08,197.5,173.74,189.82]],[0,63,[397.1,274,408.19,264.17,424.19,258.19,439.83,249.88,494.17,203.53]],[0,64,[336.87,404.08,333.8,419.28,329.35,464.32,329.41,479.8,333.11,509.98,335.6,525.23,339.44,540.66]],[0,65,[440.17,441.81,452.51,453.34]],[0,66,[384.08,396.29,390.86,414.32,393.85,433.39,403.11,506.26,405.93,524.42,409.95,542.54,421.55,555.65,435.45,567.44,440.34,583.83,438.64,600.97]],[0,67,[306.34,281.88,300.22,271.55,295.69,260.61,279.48,207.91,267.29,152.86,263.63,142.28,239.06,94.7]],[0,68],[0,69],[0,70,[469.45,323.87,482.71,319.47,494.32,311.46,505.19,301.93,517.88,296.03,532.51,296.41]],[0,71,[323.13,372.77,310.98,379.24,297.29,381.04,270.49,378.25,256.85,378.74,244.01,383.32,199,411.8]],[0,72],[0,73,[325.78,370.71,315.11,377.72,302.8,380.91,290.09,380.37,265.1,378.01,251.79,380.05,241.04,386.57,231.83,395.9,189.43,444.63,178.23,453.01,164.62,459.94,151.89,468.02,140.08,477.64,127.82,485.49,113.2,489.69,97.78,490.87]],[0,74,[453.85,457.25,464.04,469.46]],[0,75,[306.38,281.75,298.95,269.69]],[0,76,[440.85,442.45,452.16,452.04,509.45,492.6,521.63,499.85,535.67,502.44,550.32,503.97,562.01,512.5,580.43,536.15]],[0,77,[474.36,323,489.4,315.19,502.42,304.25,516.41,296.03,531.84,291.13,562.99,282.6,579.4,281.42,595.17,285.3]],[0,78,[353.21,311.51,351.75,274.78,349.92,255.71,341.42,238.46]],[0,79,[352.32,266.07,350.2,244.99,339.48,182.86,339.24,171.66,340.97,160.66,357.4,88.15,357.65,76.64,355.99,65.74]],[0,80,[375.1,267.1,384.99,225.91,396.91,184.78,409.57,132.2,410.69,121.28,408.94,67.51,410.21,56.22,412.62,45.46]],[0,81,[291.41,265.52,281.99,255.89,270.2,249.04]],[0,82,[289.83,417.4,279.44,426.99,267.12,432.95,253.03,433.84,239.16,435.43,227.3,441.61]],[0,83,[351.51,265.09,349.93,248.44,339.25,182.25,337.18,165.16]],[0,84,[455.7,337.03,469.05,337.55,481.96,339.78,505.92,345.81,518.43,348.12,531.41,347.66,567.71,337.38,580.54,334.73]],[0,85,[316.07,329.16,263.32,308.39,250.39,302.01,240.77,292.16,236.59,279.05,234.5,265.5,228.38,254.17,217.84,247.14,204.95,246.22,191.96,246.62,180.26,242.04,172.3,232.48,166.36,221.23,160.82,209.17,153.71,198.91,143.37,190.93,113.51,182.34]],[0,86],[0,87,[306.22,421.73,276.69,464.63,265.95,478.34,238.46,492.28,231.78,504.76,228.46,518.2,223.15,544.77,217.77,557.47]],[0,88,[476.59,322,487.46,316.77,506.01,301.68,516.62,295.9,628.38,263.9]],[0,89,[304.58,402.64,286.25,421.15,275.66,429.7,262.67,433.71,248.08,433.9,234.11,437.41,223.91,447.62,217.54,460.12,206.11,485.16,198.82,497.66,189.34,507.33]],[0,90,[348.03,366.59,344.43,376.17,335.23,405.79,332.53,416.36,309.42,567.16,304.71,578.23,296.24,587.44,286.64,595.91,279.81,606.85,278.36,620.58,275.34,634.69]],[0,91,[428.72,311.52,440.09,302.99,453.32,277.82,465.13,270.94,478.69,267.74]],[0,92,[327.03,335.9,312.92,330.7,298.41,329.58,284.16,333.41,230.95,352.66,216.96,355.85,202.5,353.87]],[0,93,[444.66,391.69,459.07,395.94,474.15,396.91,503.46,395.07,518.07,396.29,531.89,400.88]],[0,94,[386.41,400.52,390.51,410.75,392.91,421.24,405.97,527.76,408.98,540.16,416.51,551.43,428.68,560.5,438.65,572.18,453.33,600.22]],[0,95],[0,96,[288.85,419.25,275.08,433.27]],[0,97,[435.13,387.04,451.62,394.24,468.82,397.13,501.49,394.44,533.26,393.31,563.5,393.53,578.12,395.81,590.16,403.49,595.24,416.31,599.59,429.12,608.91,437.7,621.12,440.69,633.66,439.71,669.2,433.82]]],"vp":[0.0,0.0,719.0,693.0]}}Concept The edge routing algorithm uses a force-directed approach to calculate the edge paths. Nodes are considered to be - * repulsive forces while edges will try to become as short as possible. - *

- *

- * Each edge is routed separately and is influenced by the nodes in a certain area around it. The algorithm will add bends - * to the edge path that are placed by balancing the forces. - *

- *

- * The quality of the result highly depends on how much space there is between the nodes. More precisely, the distance - * between each pair of nodes should be at least twice the specified {@link yfiles.router.OrganicEdgeRouter#minimumDistance minimum distance}. If it is not necessary that the - * nodes keep their locations, this can be ensured using a combination of {@link yfiles.organic.RemoveOverlapsStage} and - * {@link yfiles.router.OrganicEdgeRouter#createNodeEnlargementStage node enlargement stage}. - *

- *

- * Features - *

- *

- * {@link yfiles.router.OrganicEdgeRouter#minimumDistance} will make edges keep a custom distance to the nodes. However, if there is not enough space between the nodes, this - * distance may be undershot (i.e. edges will be closer to nodes). - *

- *

- * {@link yfiles.router.OrganicEdgeRouter} is able to - * {@link yfiles.router.OrganicEdgeRouter#keepExistingBends reuse existing bends}. Edges will contain those bends along with other bends added by the layout algorithm. - *

- *

- * This edge routing algorithm is realized as a {@link yfiles.layout.ILayoutStage} which can be applied to a graph directly or - * using a {@link yfiles.router.OrganicEdgeRouter#coreLayout core layout algorithm}. - *

- * @class - * @implements {yfiles.layout.ILayoutStage} - */ - export interface OrganicEdgeRouter extends yfiles.lang.Object,yfiles.layout.ILayoutStage{} - export class OrganicEdgeRouter { - /** - * Creates a new {@link yfiles.router.OrganicEdgeRouter} with the given {@link yfiles.router.OrganicEdgeRouter#coreLayout core layout algorithm}. - * @param core the core layout algorithm - */ - constructor(core:yfiles.layout.ILayoutAlgorithm); - /** - * Creates a new {@link yfiles.router.OrganicEdgeRouter} instance with the default settings. - */ - constructor(); - /** - * Performs the organic routing of the edges of the input graph. - * @param graph the input graph - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Checks the sizes of the nodes to be non-zero. - * @param g The graph to check. - * @protected - */ - checkNodeSize(g:yfiles.layout.LayoutGraph):void; - /** - * Returns a {@link yfiles.layout.ILayoutStage} which temporarily increases the sizes of the nodes to avoid overlaps. - *

- * The edges will keep a greater distance to the nodes. Therefore, they won't cross them. - *

- * @returns the {@link } that resizes the nodes - */ - createNodeEnlargementStage():yfiles.layout.ILayoutStage; - /** - * Data provider key for selecting edges that should be routed - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets whether or not edges are allowed to cross nodes. - *

- * Allowing edges to overlap with nodes will produce smoother edges, because the edge paths can be closer to the nodes. - *

- * @see yfiles.router.OrganicEdgeRouter#createNodeEnlargementStage - * @see yfiles.router.OrganicEdgeRouter#minimumDistance - * @type {boolean} - */ - edgeNodeOverlapAllowed:boolean; - /** - * Gets or sets the core layout algorithm which arranges the graph before edge routing. - * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the minimum distance the algorithm should guarantee between nodes and non-incident edges. - *

- * The distance also influences how many bends are added to the path (a higher distance leads to less bends). - *

- *

- * The minimum distance is defined to be a non-negative value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given minimum distance is negative - * @type {number} - */ - minimumDistance:number; - /** - * Gets or sets whether or not the initial bend coordinates are kept when determining the edge path. - *

- * The bends are considered as fixed nodes and stay part of the path. - *

- * @type {boolean} - */ - keepExistingBends:boolean; - /** - * Gets or sets whether a rerouting step is performed on all edges or just on a subset where distances are violated. - *

- * If only a subset of edges is rerouted, only those edges which cross nodes or come too close to a node are included. - * During rerouting, more bends are added to the edges that will be influenced by the repulsive forces. - *

- * @type {boolean} - */ - routeAllEdges:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.OrganicEdgeRouter; - } - /** - * {@link yfiles.router.OrthogonalPatternEdgeRouter} routes edges orthogonally such that the resulting layout of the edges consists - * only of vertical and horizontal segments. - *

- * Note that the location and size of the nodes in a diagram remains unchanged. - *

- *

- * The edge router will not try to find a perfect route from source to edge (unlike to what {@link yfiles.router.EdgeRouter} does) - * but chooses the best path out of a set of fixed paths. The best path out of these possible paths is determined by its - * cost. The costs may be influenced by setting several cost factors. The distance that an edge will have from its source - * and target node is determined by {@link yfiles.router.OrthogonalPatternEdgeRouter#minimumDistance}. - *

- *

- * The edges whose paths have to be routed can be defined registering a {@link yfiles.algorithms.IDataProvider} with key - * {@link yfiles.router.OrthogonalPatternEdgeRouter#DEFAULT_AFFECTED_EDGES_DP_KEY}. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface OrthogonalPatternEdgeRouter extends yfiles.layout.LayoutStageBase{} - export class OrthogonalPatternEdgeRouter { - /** - * Creates a new instance of {@link yfiles.router.OrthogonalPatternEdgeRouter} with default settings. - */ - constructor(); - /** - * Calculates the costs for all bends of the given path. - *

- * This method is called by {@link yfiles.router.OrthogonalPatternEdgeRouter#calculateCost}. The default implementation multiplies - * the number of bends with the according {@link yfiles.router.OrthogonalPatternEdgeRouter#bendCost costs}. It may be overridden to change the calculation of these costs. - *

- * @param edge the edge for which the costs are calculated - * @param path the path of the given edge - * @param spc the source {@link } for this edge - * @param tpc the target {@link } for this edge - * @returns the costs for the bends of this path - * @protected - */ - calculateBendCost(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList,spc:yfiles.layout.PortCandidate,tpc:yfiles.layout.PortCandidate):number; - /** - * Calculates the edge cost of a possible edge path, in order to determine which path is the best, i.e., the cheapest. - *

- * This method is called by {@link yfiles.router.OrthogonalPatternEdgeRouter#applyLayout} in order to decide which path is the - * best. The default implementation considers the edge length, the number of bends, edge crossings, - * {@link yfiles.layout.PortCandidate}s and monotonic path restrictions. It may be overridden to apply a different set of costs or - * a different weighting. - *

- * @param edge the edge whose costs to calculate - * @param path the edge's path - * @param spc the source {@link } for this edge - * @param tpc the target {@link } for this edge - * @returns the sum of all costs for this edge's path - * @protected - */ - calculateCost(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList,spc:yfiles.layout.PortCandidate,tpc:yfiles.layout.PortCandidate):number; - /** - * Calculates the overall crossing costs of the given path, including edge crossings, edge overlaps and node crossings. - *

- * This method is called by - * {@link yfiles.router.OrthogonalPatternEdgeRouter#calculateCost}. The default implementation will determine overlaps and - * crossings between edge segments and nodes and sum up the costs. It may be overridden to use a different combination of - * costs. - *

- * @param edge the edge for which the costs are calculated - * @param path the path of the given edge - * @param spc the source {@link } for this edge - * @param tpc the target {@link } for this edge - * @returns the overall crossing costs of the given path, including edge crossings, edge overlaps and node crossings - * @protected - */ - calculateCrossingCosts(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList,spc:yfiles.layout.PortCandidate,tpc:yfiles.layout.PortCandidate):number; - /** - * Calculates the costs for the length of the given path. - *

- * This method is called by {@link yfiles.router.OrthogonalPatternEdgeRouter#calculateCost}. The default implementation returns - * costs between 0 for short paths and 1 for long paths. Hence, it has relatively little impact on the overall costs. The - * method may be overridden to introduce a different weighting of the edge length. - *

- * @param edge the edge for which the costs are calculated - * @param path the path of the given edge - * @param spc the source {@link } for this edge - * @param tpc the target {@link } for this edge - * @returns the costs for the length of the given path - * @protected - */ - calculateEdgeLength(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList,spc:yfiles.layout.PortCandidate,tpc:yfiles.layout.PortCandidate):number; - /** - * Calculates the costs for the chosen {@link yfiles.layout.PortCandidate}s. - *

- * This method is called by {@link yfiles.router.OrthogonalPatternEdgeRouter#calculateCost}. The default implementation will return - * the {@link yfiles.layout.PortCandidate#cost candidates' costs}. It may be overridden to change the calculation of these costs. - *

- * @param edge the edge for which the costs are calculated - * @param path the path of the given edge - * @param spc the source {@link } for this edge - * @param tpc the target {@link } for this edge - * @returns the costs for the {@link }s - * @protected - */ - calculatePortCandidateCost(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList,spc:yfiles.layout.PortCandidate,tpc:yfiles.layout.PortCandidate):number; - /** - * Calculates the extra penalty that is added to the path's cost if the edge is a self-loop and source and target ports - * have the same direction. - *

- * This method is called by - * {@link yfiles.router.OrthogonalPatternEdgeRouter#calculateCost}. The default implementation adds costs for another bend if - * source and target ports share the same node side. In this manner, paths with different source and target directions are - * cheaper and thus preferred. The method may be overridden to change the calculation of this penalty. - *

- * @param edge the edge for which the costs are calculated - * @param path the path of the given edge - * @param spc the source {@link } for this edge - * @param tpc the target {@link } for this edge - * @returns an extra penalty for specific self-loop paths - * @protected - */ - calculateSelfLoopSelfSidePenaltyCost(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList,spc:yfiles.layout.PortCandidate,tpc:yfiles.layout.PortCandidate):number; - /** - * Checks the sizes of the nodes to be non-zero. - * @param g The graph to check. - * @protected - */ - checkNodeSize(g:yfiles.layout.LayoutGraph):void; - /** - * Data provider key for determining which edges are routed - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static DEFAULT_AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets the monotonic path restriction that should be applied. - * @throws {Stubs.Exceptions.ArgumentError} if the specified path restriction is unknown - * @type {yfiles.router.MonotonicPathRestriction} - */ - monotonicPathRestriction:yfiles.router.MonotonicPathRestriction; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} which determines the edges that shall be routed by - * this algorithm. - * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.algorithms.IDataProvider} key is null - * @type {any} - */ - affectedEdgesDpKey:any; - /** - * Gets or sets the minimum distance that an edge will maintain from its source and target node. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - minimumDistance:number; - /** - * Gets or sets the spacing of the grid on which edges are routed. - *

- * The spacing between two grid lines must be at least 2. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified grid spacing is less than 2 - * @see yfiles.router.OrthogonalPatternEdgeRouter#gridRouting - * @type {number} - */ - gridSpacing:number; - /** - * Gets or sets the origin of the grid. - * @throws {Stubs.Exceptions.ArgumentError} if the specified point is null - * @see yfiles.router.OrthogonalPatternEdgeRouter#gridRouting - * @type {yfiles.algorithms.YPoint} - */ - gridOrigin:yfiles.algorithms.YPoint; - /** - * Gets or sets whether or not to route the edges on a grid. - *

- * The grid can be defined using methods {@link yfiles.router.OrthogonalPatternEdgeRouter#gridOrigin} and {@link yfiles.router.OrthogonalPatternEdgeRouter#gridSpacing}. - *

- * @see yfiles.router.OrthogonalPatternEdgeRouter#gridOrigin - * @see yfiles.router.OrthogonalPatternEdgeRouter#gridSpacing - * @type {boolean} - */ - gridRouting:boolean; - /** - * Gets or sets the costs for a crossing between two edges. - *

- * These costs are used for finding the best path out of the predefined paths from which the router can choose. - *

- *

- * The costs need to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified costs are negative - * @type {number} - */ - edgeCrossingCost:number; - /** - * Gets or sets the costs for edges that cross nodes. - *

- * These costs are used for finding the best path out of the predefined paths from which the router can choose. - *

- *

- * The costs need to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified costs are negative - * @type {number} - */ - nodeCrossingCost:number; - /** - * Gets or sets the costs for creating a bend on the edge's path. - *

- * These costs are used for finding the best path out of the predefined paths from which the router can choose. - *

- *

- * The costs need to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified costs are negative - * @type {number} - */ - bendCost:number; - /** - * Gets or sets the costs for overlapping edge paths. - *

- * These costs are used for finding the best path out of the predefined paths from which the router can choose. - *

- *

- * The costs need to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified costs are negative - * @type {number} - */ - edgeOverlapCost:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.OrthogonalPatternEdgeRouter; - } - /** - * {@link yfiles.router.OrthogonalSegmentDistributionStage} distributes overlapping edge segments of orthogonally routed edges. - *

- * The edge segments are assigned to the so-called channels within which they are distributed. Those channels are defined by the - * surrounding graph elements. - *

- *

- * The algorithm will not distribute the segments, whose endpoints connect to a node using a port that has a strong {@link yfiles.layout.PortConstraint} - * or a fixed {@link yfiles.layout.PortCandidate}. - *

- *

- * Features - *

- *

- * It is possible to define a {@link yfiles.router.OrthogonalSegmentDistributionStage#preferredDistance preferred distance} between distributed edge segments. This distance will only be applied if - * there is enough space in the according channel. In the case where there is not enough space, the preferred distance may - * be {@link yfiles.router.OrthogonalSegmentDistributionStage#flexiblePreferredDistance reduced} for the edges. If the layout algorithm is not allowed to reduce the preferred distance, these edges won't be - * distributed. - *

- *

- * Edges can be distributed on {@link yfiles.router.OrthogonalSegmentDistributionStage#gridRouting grid coordinates}. The grid can only be considered if there is enough space in the according - * channel for at least as many grid lines as the number of segments. In the case where there is not enough space, the {@link yfiles.router.OrthogonalSegmentDistributionStage#gridSpacing grid spacing} - * may be {@link yfiles.router.OrthogonalSegmentDistributionStage#flexibleGridSpacing reduced} in this channel. If the layout algorithm is not allowed to reduce the grid spacing, these edges won't be - * distributed. - *

- *

- * Method {@link yfiles.router.OrthogonalSegmentDistributionStage#lockFirstAndLastSegment} can be used to guarantee that the first and last segment of an edge won't be distributed. So, ports can easily - * be maintained without setting explicit strong {@link yfiles.layout.PortConstraint}s or fixed {@link yfiles.layout.PortCandidate}s. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface OrthogonalSegmentDistributionStage extends yfiles.layout.LayoutStageBase{} - export class OrthogonalSegmentDistributionStage { - /** - * Creates a new instance of {@link yfiles.router.OrthogonalSegmentDistributionStage} with default settings. - */ - constructor(); - /** - * Specifies the coordinates of the origin of the grid. - *

- * The grid coordinates will be multiples of the {@link yfiles.router.OrthogonalSegmentDistributionStage#gridSpacing grid spacing} added to this origin. - *

- * @param offsetX the x-coordinate of the grid origin - * @param offsetY the y-coordinate of the grid origin - * @see yfiles.router.OrthogonalSegmentDistributionStage#gridRouting - */ - setGridOrigin(offsetX:number,offsetY:number):void; - /** - * Data provider key for determining which edges are distributed - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static DEFAULT_AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} which determines the edges that shall be routed by - * this algorithm. - * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.algorithms.IDataProvider} key is null - * @type {any} - */ - affectedEdgesDpKey:any; - /** - * Gets or sets whether or not the preferred distance between edges can be reduced if there is not enough space. - *

- * The space between the nodes restricts the distribution of the orthogonal segments while considering the - * {@link yfiles.router.OrthogonalSegmentDistributionStage#preferredDistance preferred distance}. In case this option is enabled, the layout algorithm may reduce the preferred distance, otherwise - * the algorithm will only distribute segments if there is enough space. - *

- * @type {boolean} - */ - flexiblePreferredDistance:boolean; - /** - * Gets or sets whether or not the grid spacing can be reduced if there is not enough space. - *

- * The space between the nodes limits the number of grid lines on which edges are placed. In case this option is enabled, - * the layout algorithm will divide the given grid spacing by 2 as long as there are not enough grid lines on which the - * segments can be distributed, otherwise the grid spacing remains unchanged. - *

- * @type {boolean} - */ - flexibleGridSpacing:boolean; - /** - * Gets or sets whether or not the orthogonal segments are distributed on grid coordinates. - * @see yfiles.router.OrthogonalSegmentDistributionStage#setGridOrigin - * @see yfiles.router.OrthogonalSegmentDistributionStage#gridSpacing - * @see yfiles.router.OrthogonalSegmentDistributionStage#flexibleGridSpacing - * @type {boolean} - */ - gridRouting:boolean; - /** - * Gets or sets the spacing between two grid lines. - *

- * The spacing should be at least 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified spacing is negative - * @see yfiles.router.OrthogonalSegmentDistributionStage#gridRouting - * @see yfiles.router.OrthogonalSegmentDistributionStage#gridRouting - * @see yfiles.router.OrthogonalSegmentDistributionStage#flexibleGridSpacing - * @type {number} - */ - gridSpacing:number; - /** - * Gets the x-coordinate of the origin of the grid. - *

- * The grid coordinates will be multiples of the {@link yfiles.router.OrthogonalSegmentDistributionStage#gridSpacing grid spacing} added to this origin. - *

- * @see yfiles.router.OrthogonalSegmentDistributionStage#setGridOrigin - * @see yfiles.router.OrthogonalSegmentDistributionStage#gridRouting - * @see yfiles.router.OrthogonalSegmentDistributionStage#gridOriginY - * @type {number} - */ - gridOriginX:number; - /** - * Gets the y-coordinate of the origin of the grid. - *

- * The grid coordinates will be multiples of the {@link yfiles.router.OrthogonalSegmentDistributionStage#gridSpacing grid spacing} added to this origin. - *

- * @see yfiles.router.OrthogonalSegmentDistributionStage#setGridOrigin - * @see yfiles.router.OrthogonalSegmentDistributionStage#gridRouting - * @see yfiles.router.OrthogonalSegmentDistributionStage#gridOriginX - * @type {number} - */ - gridOriginY:number; - /** - * Gets or sets whether or not the first and last segment of an edge will be distributed. - * @type {boolean} - */ - lockFirstAndLastSegment:boolean; - /** - * Gets or sets the preferred distance between each two segments. - *

- * This value also applies to the distance between a segment and the border of the containing channel. - *

- *

- * The preferred distance should be at least 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @see yfiles.router.OrthogonalSegmentDistributionStage#flexiblePreferredDistance - * @type {number} - */ - preferredDistance:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.OrthogonalSegmentDistributionStage; - } - /** - * {@link yfiles.router.SnapOuterPortsToNodeBorderStage} moves edge ports that are outside the corresponding area of the nodes to - * their border. - *

- * Thus, it guarantees that ports are always in the interior of the nodes or on their borders. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface SnapOuterPortsToNodeBorderStage extends yfiles.layout.LayoutStageBase{} - export class SnapOuterPortsToNodeBorderStage { - /** - * Creates a new instance of {@link yfiles.router.SnapOuterPortsToNodeBorderStage}. - */ - constructor(); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.SnapOuterPortsToNodeBorderStage; - } - /** - * Specifies custom data for the {@link yfiles.router.BusRouter}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface BusRouterData extends yfiles.layout.LayoutData{} - export class BusRouterData { - constructor(); - /** - * Gets or sets the collection of edges affected by this router. - *

- * This collection is only used by the router if the {@link yfiles.router.BusRouter#scope} is set to {@link yfiles.router.Scope#ROUTE_AFFECTED_EDGES}. The {@link yfiles.layout.DpKeyItemCollection.#dpKey} only has to - * be specified if the {@link yfiles.router.BusRouter#affectedEdgesDpKey} is not {@link yfiles.router.BusRouter#DEFAULT_AFFECTED_EDGES_DP_KEY} - *

- * @see yfiles.router.BusRouter#affectedEdgesDpKey - * @type {yfiles.layout.DpKeyItemCollection.} - */ - affectedEdges:yfiles.layout.DpKeyItemCollection; - /** - * Gets or sets the mapping of edges to their {@link yfiles.router.BusDescriptor} - * @see yfiles.router.BusRouter#EDGE_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeDescriptors:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to a collection of their source port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - sourcePortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from edges to a collection of their target port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - targetPortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from nodes to their {@link yfiles.layout.PortCandidateSet}. - * @see yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodePortCandidateSets:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.BusRouterData; - } - /** - * Specifies custom data for the {@link yfiles.router.ChannelEdgeRouter}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface ChannelEdgeRouterData extends yfiles.layout.LayoutData{} - export class ChannelEdgeRouterData { - constructor(); - /** - * Gets or sets the collection of edges affected by this router. - * @see yfiles.router.ChannelEdgeRouter#AFFECTED_EDGES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - affectedEdges:yfiles.layout.ItemCollection; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.ChannelEdgeRouterData; - } - /** - * Specifies custom data for the {@link yfiles.router.OrganicEdgeRouter}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface OrganicEdgeRouterData extends yfiles.layout.LayoutData{} - export class OrganicEdgeRouterData { - constructor(); - /** - * Gets or sets the collection of edges routed by this router. - * @see yfiles.router.OrganicEdgeRouter#AFFECTED_EDGES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - affectedEdges:yfiles.layout.ItemCollection; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.OrganicEdgeRouterData; - } - /** - * Specifies custom data for the {@link yfiles.router.OrthogonalPatternEdgeRouter}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface OrthogonalPatternEdgeRouterData extends yfiles.layout.LayoutData{} - export class OrthogonalPatternEdgeRouterData { - constructor(); - /** - * Gets or sets the collection of edges affected by this router. - * @see yfiles.router.OrthogonalPatternEdgeRouter#affectedEdgesDpKey - * @type {yfiles.layout.DpKeyItemCollection.} - */ - affectedEdges:yfiles.layout.DpKeyItemCollection; - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to a collection of their source port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - sourcePortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from edges to a collection of their target port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - targetPortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from nodes to their {@link yfiles.layout.PortCandidateSet}. - * @see yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodePortCandidateSets:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.OrthogonalPatternEdgeRouterData; - } - /** - * Specifies custom data for the {@link yfiles.router.ParallelEdgeRouter}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface ParallelEdgeRouterData extends yfiles.layout.LayoutData{} - export class ParallelEdgeRouterData { - constructor(); - /** - * Gets or sets the collection of edges affected by this router. - * @see yfiles.router.ParallelEdgeRouter#AFFECTED_EDGES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - affectedEdges:yfiles.layout.ItemCollection; - /** - * Gets or sets the collection of leading edges. - *

- * A leading edge is the edge whose layout is used to obtain the layout of the corresponding parallel edges. - *

- * @see yfiles.router.ParallelEdgeRouter#LEADING_EDGE_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - leadingEdges:yfiles.layout.ItemCollection; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.ParallelEdgeRouterData; - } - /** - * Specifies custom data for the {@link yfiles.router.EdgeRouter}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface PolylineEdgeRouterData extends yfiles.layout.LayoutData{} - export class PolylineEdgeRouterData { - constructor(); - /** - * Gets or sets the collection of affected edges. - *

- * This collection is only used by the router if the {@link yfiles.router.EdgeRouter#scope} is set to {@link yfiles.router.Scope#ROUTE_AFFECTED_EDGES}. - *

- * @see yfiles.router.EdgeRouter#affectedEdgesDpKey - * @type {yfiles.layout.DpKeyItemCollection.} - */ - affectedEdges:yfiles.layout.DpKeyItemCollection; - /** - * Gets or sets the collection of affected nodes. - *

- * This collection is only used by the router if the {@link yfiles.router.EdgeRouter#scope} is set to {@link yfiles.router.Scope#ROUTE_EDGES_AT_AFFECTED_NODES}. - *

- * @see yfiles.router.EdgeRouter#affectedNodesDpKey - * @type {yfiles.layout.DpKeyItemCollection.} - */ - affectedNodes:yfiles.layout.DpKeyItemCollection; - /** - * Gets or sets the collection of labels of nodes or fixed edges that are ignored by the router. - * @see yfiles.layout.LabelLayoutKeys#IGNORED_LABELS_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - ignoredLabels:yfiles.layout.ItemCollection; - /** - * Gets or sets the mapping of edges to their {@link yfiles.router.EdgeLayoutDescriptor} - *

- * If an edge is mapped to null, the {@link yfiles.router.EdgeRouter#defaultEdgeLayoutDescriptor default descriptor} is used. - *

- * @see yfiles.router.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLayoutDescriptors:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from labels to a crossing penalty factor. - *

- * The crossing penalty factor of a label is multiplied with the basic penalty for an edge crossing the label so crossing a - * label with a higher cost factor is stronger avoided then crossing one with a lower factor. - *

- * @see yfiles.router.PenaltySettings#edgeLabelCrossingPenalty - * @see yfiles.router.PenaltySettings#nodeLabelCrossingPenalty - * @see yfiles.router.EdgeRouter#LABEL_CROSSING_PENALTY_FACTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - labelCrossingPenaltyFactors:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to a collection of their source port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - sourcePortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from edges to a collection of their target port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - targetPortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from nodes to their {@link yfiles.layout.PortCandidateSet}. - * @see yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodePortCandidateSets:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their source edge group. - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourceGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their target edge group. - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the partition grid layout data. - * @type {yfiles.layout.PartitionGridData} - */ - partitionGridData:yfiles.layout.PartitionGridData; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.PolylineEdgeRouterData; - } - /** - * Specifies custom data for the {@link yfiles.router.StraightLineEdgeRouter}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface StraightLineEdgeRouterData extends yfiles.layout.LayoutData{} - export class StraightLineEdgeRouterData { - constructor(); - /** - * Gets or sets the collection of affected edges. - *

- * This collection is only used by the router if the {@link yfiles.router.StraightLineEdgeRouter#scope} is set to {@link yfiles.router.Scope#ROUTE_AFFECTED_EDGES}. - *

- * @see yfiles.router.StraightLineEdgeRouter#affectedEdgesDpKey - * @type {yfiles.layout.DpKeyItemCollection.} - */ - affectedEdges:yfiles.layout.DpKeyItemCollection; - /** - * Gets or sets the collection of affected nodes. - *

- * This collection is only used by the router if the {@link yfiles.router.StraightLineEdgeRouter#scope} is set to {@link yfiles.router.Scope#ROUTE_EDGES_AT_AFFECTED_NODES}. - *

- * @see yfiles.router.StraightLineEdgeRouter#affectedNodesDpKey - * @type {yfiles.layout.DpKeyItemCollection.} - */ - affectedNodes:yfiles.layout.DpKeyItemCollection; - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.router.StraightLineEdgeRouterData; - } - }export namespace partial{ - export enum EdgeRoutingStrategy{ - /** - * A routing strategy that produces orthogonal routes for partial edges and inter-edges. - *

- * A route of an edge is called orthogonal if it only consists of vertical and horizontal segments. - *

- *

- * Inter-edges are edges between fixed and partial nodes as well as edges between different subgraph components. - *

- * @see yfiles.partial.PartialLayout#edgeRoutingStrategy - */ - ORTHOGONAL, - /** - * A routing strategy that produces straight-line routes for partial edges and inter-edges. - *

- * Inter-edges are edges between fixed and partial nodes as well as edges between different subgraph components. - *

- * @see yfiles.partial.PartialLayout#edgeRoutingStrategy - */ - STRAIGHTLINE, - /** - * Automatically chooses a suitable routing strategy for partial edges and inter-edges by analyzing the routes of the fixed - * edges. If, for example, all fixed edges have orthogonal edge routes, inter-edges will be routed orthogonally, too. - *

- * Inter-edges are edges between fixed and partial nodes as well as edges between different subgraph components. - *

- * @see yfiles.partial.PartialLayout#edgeRoutingStrategy - */ - AUTOMATIC, - /** - * A routing strategy that produces organic routes for partial edges and inter-edges. - *

- * Inter-edges are edges between fixed and partial nodes as well as edges between different subgraph components. - *

- * @see yfiles.partial.PartialLayout#edgeRoutingStrategy - */ - ORGANIC, - /** - * A routing strategy that produces octilinear routes for partial edges and inter-edges. - *

- * A route of an edge is called octilinear if the slope of each segment is a multiple of 45 degrees. - *

- *

- * Inter-edges are edges between fixed and partial nodes as well as edges between different subgraph components. - *

- * @see yfiles.partial.PartialLayout#edgeRoutingStrategy - */ - OCTILINEAR - } - export enum ComponentAssignmentStrategy{ - /** - * A component assignment strategy that assigns each partial node to a separate subgraph component. - * @see yfiles.partial.PartialLayout#componentAssignmentStrategy - */ - SINGLE, - /** - * A component assignment strategy where the subgraph components correspond to the connected components of the graph - * induced by the partial elements. - * @see yfiles.partial.PartialLayout#componentAssignmentStrategy - */ - CONNECTED, - /** - * A component assignment strategy where the subgraph components correspond to the clusters computed by a clustering - * algorithm based on {@link yfiles.algorithms.Groups#edgeBetweennessClustering edge betweenness centrality}. - * @see yfiles.partial.PartialLayout#componentAssignmentStrategy - */ - CLUSTERING, - /** - * A component assignment strategy where the subgraph components are defined by the user. Two partial nodes are considered - * to be in the same component if the {@link yfiles.algorithms.IDataProvider} associated with key {@link yfiles.partial.PartialLayout#COMPONENT_ID_DP_KEY} - * returns the same object for both of them. - * @see yfiles.partial.PartialLayout#COMPONENT_ID_DP_KEY - * @see yfiles.partial.PartialLayout#componentAssignmentStrategy - */ - CUSTOMIZED - } - export enum SubgraphPlacement{ - /** - * A positioning strategy which tries to place each subgraph component close to the barycenter of its graph neighbors. - * @see yfiles.partial.PartialLayout#subgraphPlacement - */ - BARYCENTER, - /** - * A positioning strategy which tries to place each subgraph component close to its original position. - * @see yfiles.partial.PartialLayout#subgraphPlacement - */ - FROM_SKETCH - } - export enum LayoutOrientation{ - /** - * Layout orientation specifier where the algorithm tries to place partial nodes (subgraph components) such that each - * predecessor of a node v is placed above v and each successor below v. - * @see yfiles.partial.PartialLayout#layoutOrientation - */ - TOP_TO_BOTTOM, - /** - * Layout orientation specifier where the algorithm tries to place partial nodes (subgraph components) such that each - * predecessor of a node v is placed below v and each successor above v. - * @see yfiles.partial.PartialLayout#layoutOrientation - */ - BOTTOM_TO_TOP, - /** - * Layout orientation specifier where the algorithm tries to place partial nodes (subgraph components) such that each - * predecessor of a node v is placed to the left of v and each successor to the right of v. - * @see yfiles.partial.PartialLayout#layoutOrientation - */ - LEFT_TO_RIGHT, - /** - * Layout orientation specifier where the algorithm tries to place partial nodes (subgraph components) such that each - * predecessor of a node v is placed to the right of v and each successor to the left of v. - * @see yfiles.partial.PartialLayout#layoutOrientation - */ - RIGHT_TO_LEFT, - /** - * Layout orientation specifier where the algorithm automatically detects the layout orientation. - *

- * The algorithm analyzes the flow direction of fixed edges in the current drawing. If there is no common flow direction, - * the results are the same as for {@link yfiles.partial.LayoutOrientation#NONE}. Otherwise, the layout orientation is either - * {@link yfiles.partial.LayoutOrientation#TOP_TO_BOTTOM}, {@link yfiles.partial.LayoutOrientation#BOTTOM_TO_TOP}, {@link yfiles.partial.LayoutOrientation#LEFT_TO_RIGHT} - * or {@link yfiles.partial.LayoutOrientation#RIGHT_TO_LEFT}. - *

- * @see yfiles.partial.PartialLayout#layoutOrientation - */ - AUTO_DETECT, - /** - * Layout orientation specifier where the layout orientation is completely ignored. - * @see yfiles.partial.PartialLayout#layoutOrientation - */ - NONE - } - /** - * This class represents a partial layout algorithm which changes the coordinates for a given set of graph elements (called - * partial elements) only. - *

- * The location and size of the remaining elements (called fixed elements) is not allowed to be changed.Layout Style - *

- *

- * This partial layout algorithm offers a kind of generic partial layout support for other existing layout algorithms. - * Hence, its layout style heavily depends on the selected {@link yfiles.partial.PartialLayout#coreLayout core layout algorithm} as well as the specified {@link yfiles.partial.PartialLayout#edgeRouter edge router} or - * {@link yfiles.partial.PartialLayout#edgeRoutingStrategy edge routing strategy}. - *

- *

- * The partial layout is suitable for applications where users may incrementally add new elements to an existing drawing. - * The added elements should be arranged so that they fit best possible into the given diagram without making any changes - * to the already existing layout. Hence, the so-called mental map of the existing drawing is preserved. - *

- *

- * {@graph {"ann":{"s":[60,30],"d":1},"n":[[49.74,127.62,295.26,342.38,2,[[49.74,150,295.26,22.38,"Group"]]],[270,425,[[291.33,449.35,17.35,18.7,"16"]]],[270,375,[[291.33,399.35,17.35,18.7,"18"]]],[200,375,[[221.33,399.35,17.35,18.7,"19"]]],[64.74,405.17,1,[[86.07,429.52,17.35,18.7,"13"]]],[200,265,[[221.33,289.35,17.35,18.7,"20"]]],[100,215,[[124.66,239.35,10.67,18.7,"2"]]],[100,165,[[124.66,189.35,10.67,18.7,"3"]]],[100,265,[[121.33,289.35,17.35,18.7,"22"]]],[-420.63,317.87,375.21,302.93,3,[[-420.63,340.25,375.21,22.38,"Group"]]],[-179.98,534.8,1,[[-155.31,559.15,10.67,18.7,"6"]]],[-163.42,363.25,1,[[-142.09,387.6,17.35,18.7,"12"]]],[-371.63,364.65,1,[[-346.96,389,10.67,18.7,"8"]]],[-333.29,532.76,1,[[-308.62,557.11,10.67,18.7,"9"]]],[-176.17,453.25,1,[[-154.84,477.6,17.35,18.7,"11"]]],[370,215,[[394.66,239.35,10.67,18.7,"1"]]],[370,165,[[394.66,189.35,10.67,18.7,"4"]]],[-130.4,215,1,[[-105.74,239.35,10.67,18.7,"5"]]],[-224.19,264.44,1,[[-199.52,288.79,10.67,18.7,"7"]]],[370,425,[[391.33,449.35,17.35,18.7,"10"]]],[370,265,[[391.33,289.35,17.35,18.7,"14"]]],[370,375,[[391.33,399.35,17.35,18.7,"15"]]],[270,505,[[291.33,529.35,17.35,18.7,"17"]]],[440,165,[[461.33,189.35,17.35,18.7,"21"]]]],"e":[[13,12,0,-15,0,15],[13,14],[10,13,-30,4,0,0],[14,11],[6,7,0,-15,0,15],[5,8,-30,0,30,0],[1,2,0,-15,0,15],[2,3,-30,0,30,0],[4,3],[15,6,-30,0,30,0],[15,16,0,-15,0,15],[7,16,30,0,-30,0],[6,17],[17,18],[18,12],[10,19],[15,20,0,15,0,-15],[19,21,0,-15,0,15],[21,20,0,-15,0,15],[19,1,-30,0,30,0],[1,22,0,15,0,-15],[20,5,-30,0,30,0],[16,23,30,0,-30,0],[11,4,-30,0,0,0]],"vp":[-421.0,127.0,921.0,494.0]}} The input graph where marked nodes denote the partial elements that were incrementally added to the existing diagram. {@graph {"ann":{"s":[60,30],"d":1},"n":[[67.37,127.62,260,342.38,2,[[67.37,150,260,22.38,"Group"]]],[252.37,425,[[273.7,449.35,17.35,18.7,"16"]]],[252.37,375,[[273.7,399.35,17.35,18.7,"18"]]],[182.37,375,[[203.7,399.35,17.35,18.7,"19"]]],[182.37,321,1,[[203.7,345.35,17.35,18.7,"13"]]],[182.37,265,[[203.7,289.35,17.35,18.7,"20"]]],[82.37,215,[[107.03,239.35,10.67,18.7,"2"]]],[82.37,165,[[107.03,189.35,10.67,18.7,"3"]]],[82.37,265,[[103.7,289.35,17.35,18.7,"22"]]],[-147.05,387.62,180,185.56,3,[[-147.05,410,180,22.38,"Group"]]],[-42.05,425,1,[[-17.38,449.35,10.67,18.7,"6"]]],[-42.05,474.19,1,[[-20.72,498.54,17.35,18.7,"12"]]],[-132.05,425,1,[[-107.38,449.35,10.67,18.7,"8"]]],[-132.05,474.19,1,[[-107.38,498.54,10.67,18.7,"9"]]],[-42.05,528.19,1,[[-20.72,552.54,17.35,18.7,"11"]]],[352.37,215,[[377.03,239.35,10.67,18.7,"1"]]],[352.37,165,[[377.03,189.35,10.67,18.7,"4"]]],[-13.63,215,1,[[11.03,239.35,10.67,18.7,"5"]]],[-13.63,265,1,[[11.03,289.35,10.67,18.7,"7"]]],[352.37,425,[[373.7,449.35,17.35,18.7,"10"]]],[352.37,265,[[373.7,289.35,17.35,18.7,"14"]]],[352.37,375,[[373.7,399.35,17.35,18.7,"15"]]],[252.37,505,[[273.7,529.35,17.35,18.7,"17"]]],[422.37,165,[[443.7,189.35,17.35,18.7,"21"]]]],"e":[[13,12,0,-15,0,15],[13,14,0,15,-30,0,[-102.05,543.19]],[10,13,-30,0,30,0,[-54.55,440,-54.55,489.19]],[14,11,0,-15,0,15],[6,7,0,-15,0,15],[5,8,-30,0,30,0],[1,2,0,-15,0,15],[2,3,-30,0,30,0],[4,3,0,15,0,-15],[15,6,-30,0,30,0],[15,16,0,-15,0,15],[7,16,30,0,-30,0],[6,17,-30,0,30,0],[17,18,0,15,0,-15],[18,12,-30,0,0,-15,[-102.05,280]],[10,19,30,0,0,15,[27.95,440,27.95,474,382.37,474]],[15,20,0,15,0,-15],[19,21,0,-15,0,15],[21,20,0,-15,0,15],[19,1,-30,0,30,0],[1,22,0,15,0,-15],[20,5,-30,0,30,0],[16,23,30,0,-30,0],[11,4,30,5.2,-30,0,[119.87,494.39,119.87,336]]],"vp":[-148.0,127.0,631.0,447.0]}} - * The result of a partial layout run with {@link yfiles.partial.PartialLayout#componentAssignmentStrategy component assignment strategy} set to {@link yfiles.partial.ComponentAssignmentStrategy#SINGLE} - * and with {@link yfiles.partial.PartialLayout#considerNodeAlignment node alignment} enabled.Features - *

- *

- * Similar to the layout style, the supported feature set mainly depends on the features supported by the specified {@link yfiles.partial.PartialLayout#coreLayout core layout algorithm} - * as well as the specified {@link yfiles.partial.PartialLayout#edgeRouter edge router} or {@link yfiles.partial.PartialLayout#edgeRoutingStrategy edge routing strategy}. The internal step that {@link yfiles.partial.PartialLayout#placeSubgraphs places the components} can handle - * group nodes as well as minimum distance constraints. Furthermore, it is able to consider node labels. - *

- *

- * Concept The layout algorithm tries to place the partial elements such that the resulting drawing (including the fixed elements) - * has a good quality with respect to common graph drawing aesthetics. - *

- *

- * The layout algorithm handles each selected graph element as partial element. For this, it looks up the {@link yfiles.algorithms.IDataProvider} - * keys {@link yfiles.partial.PartialLayout#AFFECTED_NODES_DP_KEY} and {@link yfiles.partial.PartialLayout#AFFECTED_EDGES_DP_KEY}. Partial - * node elements can be assigned to the so-called subgraph components. During the layout process each subgraph induced by the nodes of a - * component is first laid out using the specified {@link yfiles.partial.PartialLayout#coreLayout core layout algorithm}. Then, the different components are placed - * one-by-one onto the drawing area such that the number of overlaps among graph elements is small. The user can specify - * different objectives for finding 'good' positions for subgraph components (see {@link yfiles.partial.PartialLayout#subgraphPlacement}), e.g., {@link yfiles.partial.SubgraphPlacement#BARYCENTER} - * specifies that the component should be placed close to the barycenter of its graph neighbors and {@link yfiles.partial.SubgraphPlacement#FROM_SKETCH} - * specifies that the component should be placed close to its original position. - *

- *

- * Method {@link yfiles.partial.PartialLayout#componentAssignmentStrategy} allows to specify the strategy that assigns partial nodes to subgraph components. Possible values are - * {@link yfiles.partial.ComponentAssignmentStrategy#CLUSTERING}, {@link yfiles.partial.ComponentAssignmentStrategy#CONNECTED}, {@link yfiles.partial.ComponentAssignmentStrategy#SINGLE} - * and - * {@link yfiles.partial.ComponentAssignmentStrategy#CUSTOMIZED}. The last value allows to use a customized component assignment. - * Note that nodes of a component cannot be assigned to different group nodes. - *

- *

- * Furthermore, the user can specify the edge routing strategy (see {@link yfiles.partial.PartialLayout#edgeRoutingStrategy}) that is used for routing partial edges and edges - * between different subgraph components (so-called inter-edges). Possible values are {@link yfiles.partial.EdgeRoutingStrategy#ORGANIC}, - * {@link yfiles.partial.EdgeRoutingStrategy#ORTHOGONAL}, {@link yfiles.partial.EdgeRoutingStrategy#STRAIGHTLINE}, {@link yfiles.partial.EdgeRoutingStrategy#OCTILINEAR} - * and {@link yfiles.partial.EdgeRoutingStrategy#AUTOMATIC}. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface PartialLayout extends yfiles.layout.LayoutStageBase{} - export class PartialLayout { - /** - * Creates a new instance of {@link yfiles.partial.PartialLayout} which uses the specified {@link yfiles.layout.ILayoutAlgorithm} instance - * as the core layout algorithm. - *

- * This instance is applied to each subgraph component, see {@link yfiles.partial.PartialLayout#componentAssignmentStrategy}. - *

- * @param [subgraphLayouter=null] the layout algorithm that is applied to the subgraph components - * @see yfiles.partial.PartialLayout#componentAssignmentStrategy - */ - constructor(subgraphLayouter?:yfiles.layout.ILayoutAlgorithm); - /** - * This method is called each time when edges are routed with an edge router. - *

- * Subclasses may modify the configuration of the given edge router instance. - *

- *

- * The type of the given instance depends on the edge routing strategy, i.e., if the routing strategy is set to {@link yfiles.partial.EdgeRoutingStrategy#OCTILINEAR} - * or {@link yfiles.partial.EdgeRoutingStrategy#ORTHOGONAL} it's an instance of {@link yfiles.router.EdgeRouter}, if the routing strategy - * is set to {@link yfiles.partial.EdgeRoutingStrategy#ORGANIC} it's an instance of {@link yfiles.organic.OrganicLayout}, and, if the - * routing strategy is set to {@link yfiles.partial.EdgeRoutingStrategy#STRAIGHTLINE} it's an instance of a private - * {@link yfiles.router.StraightLineEdgeRouter}. If the edge routing strategy is set to - * {@link yfiles.partial.EdgeRoutingStrategy#AUTOMATIC}, the layout algorithm chooses one of the above strategies that best fits - * the routing style of the fixed edges. - *

- * @param edgeRouter the instance used for routing the edges - * @see yfiles.partial.PartialLayout#edgeRouter - * @see yfiles.partial.PartialLayout#edgeRoutingStrategy - * @protected - */ - configureEdgeRouter(edgeRouter:yfiles.layout.ILayoutAlgorithm):void; - /** - * This method is called during the {@link yfiles.partial.PartialLayout#applyLayout layout process} and calculates the layout for the given subgraph component using the - * specified {@link yfiles.partial.PartialLayout#coreLayout core layout algorithm}. - *

- * It is called once for each subgraph component. - *

- *

- * Subclasses may implement a custom layout strategy or add some additional data. - *

- * @param subGraph the subgraph component - * @protected - */ - layoutSubgraph(subGraph:yfiles.layout.LayoutGraph):void; - /** - * This method is called during the {@link yfiles.partial.PartialLayout#applyLayout layout process} and places the subgraph components one-by-one onto the drawing area. - *

- * Therefore, it considers the {@link yfiles.partial.PartialLayout#subgraphPlacement specified objective} for finding a suitable position. - *

- *

- * Subclasses may implement a custom placement strategy or add some additional data. However, they must not modify the - * given subgraph component lists. - *

- * @param graph the input graph - * @param subgraphComponents each entry contains a {@link } that induces a subgraph component - * @protected - */ - placeSubgraphs(graph:yfiles.layout.LayoutGraph,subgraphComponents:yfiles.algorithms.NodeList[]):void; - /** - * This method is called during the {@link yfiles.partial.PartialLayout#applyLayout layout process} and routes all partial edges that connect two fixed elements. - *

- * It either uses a {@link yfiles.partial.PartialLayout#edgeRouter custom edge router} or an internal edge router that produces routes according to the specified - * {@link yfiles.partial.PartialLayout#edgeRoutingStrategy routing strategy}. - *

- *

- * Subclasses may implement a custom routing strategy or add some additional data. - *

- * @param graph the subgraph of the input graph induced by the fixed nodes - * @param partialEdges the {@link list of partial edges} to be routed - * @protected - */ - routeEdgesBetweenFixedElements(graph:yfiles.layout.LayoutGraph,partialEdges:yfiles.algorithms.EdgeList):void; - /** - * This method is called during the {@link yfiles.partial.PartialLayout#applyLayout layout process} and routes all inter-edges. - *

- * Inter-edges are edges between different subgraph components including edges between fixed and partial elements. For the routing, - * this method uses the edge router instance set with method {@link yfiles.partial.PartialLayout#edgeRouter}. If no edge router was specified by the user, it uses an - * internal edge router with routing strategy {@link yfiles.partial.PartialLayout#edgeRoutingStrategy}. - *

- *

- * Subclasses may implement a custom routing strategy or add some additional data. - *

- * @param graph the relevant subgraph - * @param interEdges the {@link list of inter-edges} to be routed - * @protected - */ - routeInterEdges(graph:yfiles.layout.LayoutGraph,interEdges:yfiles.algorithms.EdgeList):void; - /** - * Data provider key for marking partial nodes - * @see yfiles.partial.PartialLayout#AFFECTED_EDGES_DP_KEY - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static AFFECTED_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for specifying the edges that should be considered to be directed - *

- * If a layout orientation is specified (i.e., {@link yfiles.partial.PartialLayout#layoutOrientation} is not - * {@link yfiles.partial.LayoutOrientation#NONE}), the algorithm tries to route directed edges such that they adhere to that - * orientation. - *

- * @see yfiles.partial.PartialLayout#layoutOrientation - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static DIRECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for marking partial edges - * @see yfiles.partial.PartialLayout#AFFECTED_NODES_DP_KEY - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for obtaining the edges that should be routed by the edge router - * @see yfiles.partial.PartialLayout#edgeRouter - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static ROUTE_EDGE_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for defining custom subgraph components - * @see yfiles.partial.ComponentAssignmentStrategy#CUSTOMIZED - * @see yfiles.partial.PartialLayout#componentAssignmentStrategy - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static COMPONENT_ID_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets the {@link yfiles.layout.ILayoutAlgorithm} instance that is applied to each subgraph component. - *

- * More precisely, during the layout process each subgraph induced by the (partial) nodes of a component (see - * {@link yfiles.partial.PartialLayout#componentAssignmentStrategy}) is first laid out using this instance. - *

- * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the preferred time limit (in milliseconds) for the layout algorithm. - *

- * The specified value has to be greater than or equal to 0. If the value is 0x7FFFFFFF, the time is not limited. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the maximum duration is negative - * @type {number} - */ - maximumDuration:number; - /** - * Gets or sets whether or not edges between different subgraph components should be routed immediately. - *

- * If this option is enabled, edges are routed during the placement of the subgraph components, i.e., immediately after a - * component is placed, its edges to other already placed components are routed. Otherwise, these edges are routed in a - * separate step after placing all subgraph components. Hence, while enabling this option usually leads to shorter edge - * routes, the placement of subgraph components is less compact. - *

- * @see yfiles.partial.PartialLayout#routeInterEdges - * @see yfiles.partial.PartialLayout#placeSubgraphs - * @type {boolean} - */ - routeInterEdgesImmediately:boolean; - /** - * Gets or sets whether or not a subgraph component may be placed within another subgraph component. - *

- * Enabling this option leads to more compact layout results but requires more runtime. - *

- * @type {boolean} - */ - componentCompaction:boolean; - /** - * Gets or sets whether or not fixed (non-partial) group nodes may be resized. - *

- * Enabling this option may lead to better results if there are fixed group nodes, since there is more space for the - * partial elements. - *

- * @type {boolean} - */ - resizeFixedGroups:boolean; - /** - * Gets or sets the objective used for finding 'good' positions for subgraph components. - * @throws {Stubs.Exceptions.ArgumentError} if the specified strategy does not match one of the predefined positioning strategies - * @type {yfiles.partial.SubgraphPlacement} - */ - subgraphPlacement:yfiles.partial.SubgraphPlacement; - /** - * Gets or sets the minimum distance between two adjacent nodes. - *

- * The specified value has to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the distance is negative - * @type {number} - */ - minimumNodeDistance:number; - /** - * Gets or sets whether or not partial nodes should be aligned. - *

- * If this option is enabled, the algorithm tries to align the center of partial nodes with other nodes. - *

- * @type {boolean} - */ - considerNodeAlignment:boolean; - /** - * Gets or sets the strategy that assigns partial nodes to subgraph components. - *

- * The specified core layouter (see {@link yfiles.partial.PartialLayout#coreLayout}) independently calculates the layout for each such subgraph component. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified strategy does not match one of the predefined assignment strategies. - * @see yfiles.partial.PartialLayout#coreLayout - * @type {yfiles.partial.ComponentAssignmentStrategy} - */ - componentAssignmentStrategy:yfiles.partial.ComponentAssignmentStrategy; - /** - * Gets or sets whether or not a postprocessing step should be applied to reduce the number of directed edges that do not - * comply with the specified layout orientation. - * @see yfiles.partial.PartialLayout#layoutOrientation - * @see yfiles.partial.PartialLayout#DIRECTED_EDGES_DP_KEY - * @type {boolean} - */ - optimizeOrientation:boolean; - /** - * Gets or sets the custom edge router instance that is used for partial edges and edges between different subgraph - * components (so-called inter-edges). - * @see yfiles.partial.PartialLayout#ROUTE_EDGE_DP_KEY - * @see yfiles.partial.PartialLayout#edgeRoutingStrategy - * @type {yfiles.layout.ILayoutAlgorithm} - */ - edgeRouter:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the routing strategy that is used for partial edges and edges between different subgraph components - * (so-called inter-edges). - * @throws {Stubs.Exceptions.ArgumentError} if the specified strategy does not match one of the predefined routing strategies - * @see yfiles.partial.PartialLayout#edgeRouter - * @type {yfiles.partial.EdgeRoutingStrategy} - */ - edgeRoutingStrategy:yfiles.partial.EdgeRoutingStrategy; - /** - * Gets or sets the layout orientation that is considered during the placement of partial elements. - *

- * More precisely, the algorithm tries to place each {@link yfiles.partial.PartialLayout#componentAssignmentStrategy subgraph component} such that each predecessor of a component's node v - * is placed before v and each successor after v with respect to the layout orientation. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified orientation does not match one of the predefined orientations - * @see yfiles.partial.PartialLayout#DIRECTED_EDGES_DP_KEY - * @type {yfiles.partial.LayoutOrientation} - */ - layoutOrientation:yfiles.partial.LayoutOrientation; - /** - * Gets or sets whether or not subgraph components are mirrored to improve the layout quality. - *

- * If enabled, the algorithm checks for each component which of the four possible mirrorings minimizes the edge length. - *

- * @type {boolean} - */ - allowMirroring:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.partial.PartialLayout; - } - /** - * Specifies custom data for the {@link yfiles.partial.PartialLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface PartialLayoutData extends yfiles.layout.LayoutData{} - export class PartialLayoutData { - constructor(); - /** - * Gets or sets the collection of nodes placed by the layout. - * @see yfiles.partial.PartialLayout#AFFECTED_NODES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - affectedNodes:yfiles.layout.ItemCollection; - /** - * Gets or sets the collection of edges placed by the layout. - * @see yfiles.partial.PartialLayout#AFFECTED_EDGES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - affectedEdges:yfiles.layout.ItemCollection; - /** - * Gets or sets the collection of edges that are considered as directed by the layout. - *

- * Only if the {@link yfiles.partial.PartialLayout#layoutOrientation} is not {@link yfiles.partial.LayoutOrientation#NONE} the directedness of edges has an effect. - *

- * @see yfiles.partial.PartialLayout#DIRECTED_EDGES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - directedEdges:yfiles.layout.ItemCollection; - /** - * Gets or sets the mapping from partial nodes to an object defining their component assignment. - *

- * All partial nodes associated with the same object are assigned to the same subgraph component. - *

- * @see yfiles.partial.PartialLayout#COMPONENT_ID_DP_KEY - * @see yfiles.partial.ComponentAssignmentStrategy#CUSTOMIZED - * @see yfiles.partial.PartialLayout#componentAssignmentStrategy - * @type {yfiles.layout.ItemMapping.} - */ - componentIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to a collection of their source port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - sourcePortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets a mapping from edges to a collection of their target port {@link yfiles.layout.PortCandidate candidates}. - * @see yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY - * @type {yfiles.layout.ItemMapping.>} - */ - targetPortCandidates:yfiles.layout.ItemMapping>; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the partition grid layout data. - * @type {yfiles.layout.PartitionGridData} - */ - partitionGridData:yfiles.layout.PartitionGridData; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.partial.PartialLayoutData; - } - }export namespace tree{ - /** - * Encapsulates information bound to a node while the algorithm calculates a layout. - * @class - */ - export interface BalloonLayoutNodeInfo extends yfiles.lang.Object{} - export class BalloonLayoutNodeInfo { - /** - * The upper angle of the subtree wedge rooted at the node. - * @type {number} - */ - upperAngle:number; - /** - * The lower angle of the subtree wedge rooted at the node. - * @type {number} - */ - lowerAngle:number; - /** - * The angle of the gap to the wedge of the previous child node. - * @type {number} - */ - gapAngle:number; - /** - * The distance of the node to its root node. - * @type {number} - */ - dist:number; - /** - * Gets the sum of all wedge angles of the subtree rooted at this node. - * @type {number} - */ - angleSum:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.BalloonLayoutNodeInfo; - } - /** - * A tree layout algorithm that arranges the subtrees of the tree in a balloon-like fashion. - *

- * Layout Style {@link yfiles.tree.BalloonLayout} is designed to arrange directed and undirected tree graphs. Subtrees rooted at a node are - * placed in a radial fashion around their root node. All direct children of one node can be placed on a common circle - * around their parent node (depending on the {@link yfiles.tree.BalloonLayout#childAlignmentPolicy alignment policy}). Therefore, subtrees look like balloons or stars, - * especially if subtrees have similar sizes. The edges of the tree are drawn as straight lines. {@graph {"ann":{"s":[30,30],"d":1,"c":1},"n":[[765.94,466.2],[616.19,1035.44],[858.96,1192.81],[289.45,1092.35],[983.21,685.48],[390.63,1191.59],[1141.69,322.61],[1215.22,473.98],[599.06,923.71],[924.21,1082.3],[291.41,844.85],[1077.22,396.06],[999.14,1284.78],[391.43,1274.01],[324.89,753.04],[236.05,1223.63],[930.33,1330.15],[1013.36,1203.58],[1165.73,539.9],[1084.13,551.52],[612.56,192.18],[1004.03,1061.74],[901.39,675.54],[684.7,152.3],[1022.85,458.01],[190.18,1336.4],[767.32,1282.66],[473.05,1190.8],[684.09,233.13],[385.33,871.88],[1139.17,442.18],[925.13,116.39],[353.13,675.6],[334.78,932.43],[685.33,1291.17],[152.25,1056.81],[427.86,640.81],[1239.04,331.19],[1006.49,764.55],[934.86,198.24],[732.68,1169.96],[1046.6,632.79],[412.14,1021.39],[1266.98,538.13],[716.32,76.19],[1068.06,1329.99],[76.94,1090.32],[792.51,44.73],[576.22,1141.17],[944.59,280.09],[718.72,987.86],[132.38,1277.64],[1007.52,113.83],[318.35,600.87],[686.08,946.6],[0,1060.76],[621.34,1239.22],[684.87,0],[47.38,1167.26],[929.76,34.1],[866.88,1320.91],[425.22,944.01],[1181.1,233.18],[374.69,793.72],[118.75,981.5],[903.65,1002.48],[532.13,493.99],[200.85,981.73],[760.81,183.93],[633.38,1355.17],[1177.35,621.5],[775.83,1364.64],[784.35,1446.63],[1237.23,394.55],[272.59,1334.67],[974.02,603.57],[457.46,831.99],[159.13,1412.75],[260.6,752.11],[1069.67,256.55],[1044.67,310.87],[1121.63,226.96],[1225.82,272.87],[597.56,111.13],[530.37,198.46],[610.06,274.57],[555.63,251.79],[547.23,141.92],[1062.07,709.49],[929.94,748.38],[843.55,104.61],[857.02,162.82],[1295.93,457.26],[193.97,837.29],[246.66,931.74],[206.06,892.47],[214.43,784.65],[979.61,1149.06],[838.99,1066.04],[786.55,1086.86],[172.43,1172.3],[317.44,1231.28],[428.9,1117.65],[872.95,52.59],[984.14,58.85],[987.6,170.17],[521.61,289.78],[410.77,300.73],[412.02,412.1],[523.07,420.56],[465.9,437.92],[389.75,356.66],[464.06,273.7],[553.17,340.51],[472.17,355.73]],"e":[[0,1],[1,2],[1,3],[0,4],[3,5],[0,6],[6,7],[1,8],[2,9],[3,10],[6,11],[2,12],[5,13],[10,14],[3,15],[12,16],[12,17],[7,18],[18,19],[0,20],[9,21],[4,22],[20,23],[11,24],[15,25],[2,26],[5,27],[20,28],[10,29],[7,30],[0,31],[14,32],[10,33],[26,34],[3,35],[32,36],[6,37],[4,38],[31,39],[2,40],[4,41],[3,42],[7,43],[23,44],[12,45],[35,46],[44,47],[1,48],[39,49],[1,50],[25,51],[31,52],[32,53],[1,54],[46,55],[34,56],[44,57],[46,58],[31,59],[2,60],[29,61],[6,62],[10,63],[35,64],[9,65],[0,66],[3,67],[23,68],[34,69],[18,70],[26,71],[71,72],[7,73],[25,74],[4,75],[29,76],[25,77],[10,78],[6,79],[6,80],[6,81],[6,82],[20,83],[20,84],[20,85],[20,86],[20,87],[4,88],[4,89],[31,90],[31,91],[7,92],[10,93],[10,94],[10,95],[10,96],[2,97],[2,98],[2,99],[3,100],[3,101],[3,102],[31,103],[31,104],[31,105],[0,114],[114,106],[114,107],[114,108],[114,109],[114,110],[114,111],[114,112],[114,113]],"vp":[0.0,0.0,1326.0,1477.0]}} Sample balloon-drawing of - * a large tree obtained with default settings {@graph {"ann":{"s":[20,20],"d":1,"c":1},"n":[[302.82,325.51,70,70,[[323.15,369.86,29.35,18.7,"Root"]]],[467.87,433.16,35,35],[555.28,457.63,[[581.09,480.55,27.36,18.7,0.20775573281806076,-0.978180737635551,"Leaf"]]],[539.95,490.69,[[558.57,519.19,27.36,18.7,0.6124052098749311,-0.7905440271851036,"Leaf"]]],[511.78,513.79,[[521.49,544.2,27.36,18.7,0.8952174454926904,-0.4456295830457645,"Leaf"]]],[617.42,438.44,[[645.7,457.5,27.36,18.7,-0.01562900399598557,-0.9998778596579152,"Leaf"]]],[604.25,500.42,[[626.78,526.54,27.36,18.7,0.42067550054279435,-0.9072111789672069,"Leaf"]]],[168.96,426.6,35,35],[122.16,495.14,[[108.91,545.35,27.36,18.7,-0.7471310564613752,-0.6646767518658294,"Leaf"]]],[101.02,465.46,[[72.6,501.56,27.36,18.7,-0.38380727069642384,-0.9234132222144982,"Leaf"]]],[94.89,429.54,[[58.95,446.33,27.36,18.7,0.0558744858236695,-0.9984378006836183,"Leaf"]]],[108.08,558.63,[[104.38,613.01,27.36,18.7,-0.8765491095440469,-0.48131243341257923,"Leaf"]]],[60.74,516.51,[[39.11,560.52,27.36,18.7,-0.5800788870754927,-0.8145603014935467,"Leaf"]]],[472.4,260.75,35,35],[534.73,207.69,[[563.84,210.51,27.36,18.7,-0.7413022827299817,-0.6711713086979497,"Leaf"]]],[555.61,237.55,[[585.94,249.4,27.36,18.7,-0.3757344582282841,-0.9267273692407589,"Leaf"]]],[561.43,273.52,[[588.93,294.02,27.36,18.7,0.06458526120504259,-0.997912192547559,"Leaf"]]],[549.36,144.32,[[576.39,143.07,27.36,18.7,-0.8723155432038684,-0.48894334343044304,"Leaf"]]],[596.34,186.85,[[626.56,194.12,27.36,18.7,-0.5729485100623841,-0.8195913645331399,"Leaf"]]],[316.53,515.88,35,35],[349.51,601,[[356.29,631.15,27.36,18.7,0.9501038773669919,-0.3119336823945245,"Leaf"]]],[313.23,604.36,[[326.48,660.69,27.36,18.7,-0.9912225732921417,-0.1322036693745865,"Leaf"]]],[279.09,591.61,[[271.88,644.75,27.36,18.7,-0.8351387927609661,-0.5500392684397689,"Leaf"]]],[397.33,645.07,[[408.68,675.44,27.36,18.7,0.8566078613378385,-0.5159679950289693,"Leaf"]]],[337.13,664.84,[[339.49,693.76,27.36,18.7,0.9957417304784997,-0.09218680048511825,"Leaf"]]],[52.71,198.2,[[17.59,197.15,27.36,18.7,0.42857629306653433,-0.9035055954565794,"Leaf"]]],[39,260.06,[[3.57,279.73,27.36,18.7,-0.006902939255060647,-0.9999761744309916,"Leaf"]]],[145.3,185.63,[[126.97,158.82,27.36,18.7,0.8990721607310399,-0.43780046801987216,"Leaf"]]],[116.92,208.49,[[85.4,197.66,27.36,18.7,0.6192806018773118,-0.7851697498875478,"Leaf"]]],[101.3,241.41,[[64.86,250.7,27.36,18.7,0.21628395104715628,-0.9763305037329477,"Leaf"]]],[173.56,251.58,35,35],[321.26,36.12,[[318.14,1.56,27.36,18.7,0.9965082870714412,-0.08349391473599899,"Leaf"]]],[260.88,55.36,[[239.7,30.94,27.36,18.7,0.861077857359917,-0.5084731296385823,"Leaf"]]],[378.65,109.85,[[406.52,110,27.36,18.7,-0.8303070560332068,-0.557306192950939,"Leaf"]]],[344.63,96.81,[[366.44,90.16,27.36,18.7,-0.9900311505600138,-0.14084857443657478,"Leaf"]]],[308.31,99.85,[[295.59,69.34,27.36,18.7,0.9527898006751772,-0.30363068970273144,"Leaf"]]],[325.62,170.19,35,35],[620.15,245.57,[[649.55,261.91,27.36,18.7,-0.15959409597274285,-0.9871827209441234,"Leaf"]]],[565.45,550.51,[[579.72,580.47,27.36,18.7,0.7732871466592579,-0.6340559823955481,"Leaf"]]],[36.42,458,[[3.15,484.87,27.36,18.7,-0.1682027041762925,-0.9857524285071697,"Leaf"]]],[91.95,148.45,[[66.13,128.88,27.36,18.7,0.7787908142925284,-0.6272837217508362,"Leaf"]]],[383.99,45.04,[[409.22,41.45,27.36,18.7,-0.933684654259895,-0.3580963088326663,"Leaf"]]],[274.32,656.46,[[277.16,712.35,27.36,18.7,-0.9367740425600954,-0.34993484134280844,"Leaf"]]]],"e":[[0,1,[],[[405.66,401.96,61.37,18.7,0.5213485166954306,-0.8533438487148509,"Root-Edge"]]],[1,2],[1,3],[1,4],[1,5],[1,6],[0,7,[],[[268.23,398.95,61.37,18.7,0.4834440722369951,0.8753752504034548,"Root-Edge"]]],[7,8],[7,9],[7,10],[7,11],[7,12],[0,13,[],[[407.74,322.69,61.37,18.7,-0.4757866709710364,-0.8795607106540735,"Root-Edge"]]],[13,14],[13,15],[13,16],[13,17],[13,18],[0,19,[],[[336.08,439.99,61.37,18.7,0.999759704932882,0.02192104907427582,"Root-Edge"]]],[19,20],[19,21],[19,22],[19,23],[19,24],[0,30,[],[[270.35,318.48,61.37,18.7,-0.5287754007295448,0.8487617896579165,"Root-Edge"]]],[30,29],[30,28],[30,27],[30,26],[30,25],[0,36,[],[[340.26,281.05,61.37,18.7,-0.9995303423338449,-0.030644652942837143,"Root-Edge"]]],[36,35],[36,34],[36,33],[36,32],[36,31],[13,37],[1,38],[7,39],[30,40],[36,41],[19,42]],"vp":[-1.0,0.0,678.0,722.0]}} Sample balloon-drawing featuring interleaved child placement and ray-like - * node labels ConceptThe algorithm executes the following steps: - *

- *
    - *
  1. Select a root node according to the specified {@link yfiles.tree.BalloonLayout#rootNodePolicy root policy}.
  2. - *
  3. Determine the placement of subtrees around the root using a bottom-up recursive approach (starting with leaf nodes).
  4. - *
  5. Assign the actual coordinates of nodes, again using a recursive approach (starting with the root node).
  6. - *
- *

- * Features - *

- *

- * The algorithm features integrated {@link yfiles.tree.BalloonLayout#integratedEdgeLabeling edge labeling} as well as {@link yfiles.tree.BalloonLayout#integratedNodeLabeling node labeling}. Edge labels and node labels are placed - * automatically without generating overlaps with other labels or graph elements. There are different {@link yfiles.tree.BalloonLayout#nodeLabelingPolicy ways} to place node - * labels. Edge labeling will take the settings of {@link yfiles.layout.PreferredPlacementDescriptor} into account. - *

- *

- * Defining a {@link yfiles.tree.BalloonLayout#preferredChildWedge preferred wedge angle} has a great influence on the layout style. Subtrees rooted at a node get a certain - * amount of radial space to be placed around the parent node, such that a preferred angle close to 360 degrees will - * generate drawings where subtrees look like balloons, while an angle close to 180 degrees could be chosen to get drawings - * where subtrees look like semicircles. - *

- *

- * Since it is computationally not very complex, {@link yfiles.tree.BalloonLayout} is very well suited for large tree graphs. It - * performs well even for huge graphs. - *

- *

- * This layout algorithm can only handle graphs with a tree structure. To apply it to a general graph, a {@link yfiles.tree.TreeReductionStage} - * can be appended. This stage will temporarily remove some edges of the input graph until a tree is obtained. These edges - * will later be reinserted and routed separately. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface BalloonLayout extends yfiles.layout.MultiStageLayout{} - export class BalloonLayout { - /** - * Creates a new {@link yfiles.tree.BalloonLayout} instance with default settings. - */ - constructor(); - /** - * Calculates the wedge angle that has to be reserved for the subtree rooted at the given node scaling the {@link yfiles.tree.BalloonLayoutNodeInfo#dist distance} with - * the given scale factor. - *

- * Given some {@link yfiles.tree.BalloonLayoutNodeInfo#dist distance} the {@link yfiles.tree.BalloonLayoutNodeInfo#upperAngle upper angle} and {@link yfiles.tree.BalloonLayoutNodeInfo#lowerAngle lower angle} of the wedge belonging to the subtree rooted at root will be - * calculated and stored in the {@link yfiles.tree.BalloonLayoutNodeInfo} instance associated with root - * ({@link yfiles.tree.BalloonLayout#getInfo}). - *

- *

- * This method may be overridden to perform a custom wedge angle assignment scheme. The method is called when - * {@link yfiles.tree.BalloonLayout#calculateChildArrangement arranging child nodes}. Large edge labels on the incoming edge to root need to be considered, if {@link yfiles.tree.BalloonLayout#integratedEdgeLabeling integrated edge labeling} - * should still work properly. - *

- * @param root the node for which the wedge angles are calculated - * @param [scaleFactor=1.0] a factor to be applied to the {@link #dist distance} of root - * @returns the sum of the upper and lower wedge angle of the subtree rooted at the given root node - * @see yfiles.tree.BalloonLayout#calculateChildArrangement - * @protected - */ - calculateAngles(root:yfiles.algorithms.Node,scaleFactor?:number):number; - /** - * Calculates a child node arrangement for a given root node of the tree. - *

- * During the arrangement, child nodes of root will be {@link yfiles.tree.BalloonLayout#sortChildNodes sorted}. Furthermore, distances of the child nodes will be chosen - * such that the wedge of the subtree of root fits into the preferred wedge angle, which is either defined via {@link yfiles.tree.BalloonLayout#preferredRootWedge} or {@link yfiles.tree.BalloonLayout#preferredChildWedge}. - * Calculated distances are stored in {@link yfiles.tree.BalloonLayoutNodeInfo#dist}. - *

- *

- * The angle values - upper and lower wedge angle - may also be updated during this process and stored in {@link yfiles.tree.BalloonLayoutNodeInfo#upperAngle} - * and {@link yfiles.tree.BalloonLayoutNodeInfo#lowerAngle}, respectively. To compute the angles of wedges, method {@link yfiles.tree.BalloonLayout#calculateAngles} - * is used. - *

- *

- * This method may be overridden to perform a custom child node arrangement. If support for available features like {@link yfiles.tree.BalloonLayout#interleavedMode interleaving} - * should be maintained, then these features need to be carefully considered during the arrangement. - *

- * @param root the node for whose children to compute an arrangement - * @protected - */ - calculateChildArrangement(root:yfiles.algorithms.Node):void; - /** - * Determines the root node of {@link yfiles.tree.BalloonLayout#graph} according to the chosen {@link yfiles.tree.BalloonLayout#rootNodePolicy root node policy}. - *

- * This method may be overridden to implement some other strategy for choosing the root node of the input graph. It is - * called before the rest of the layout process within {@link yfiles.tree.BalloonLayout#applyLayoutCore}. - *

- * @returns the root node of {@link #graph} - * @see yfiles.tree.BalloonLayout#rootNodePolicy - * @protected - */ - determineRoot():yfiles.algorithms.Node; - /** - * Returns the {@link yfiles.tree.BalloonLayoutNodeInfo} object associated with the given node while the layout algorithm is - * active. - *

- * The returned object contains detailed information describing the placement of a node in the layout being computed, e.g., - * a node's distance to its parent or the wedge angle of the subtree rooted at a node. - *

- *

- * Subclasses may want to override this method to realize another node information setup. This method is called throughout - * the algorithm, each time some information associated with a node needs to be retrieved or stored. - *

- * @param node the node whose information object should be retrieved - * @returns the {@link } instance associated to the given node - * @see yfiles.tree.BalloonLayoutNodeInfo - */ - getInfo(node:yfiles.algorithms.Node):yfiles.tree.BalloonLayoutNodeInfo; - /** - * Returns the preferred radial amount (wedge) in degrees that child nodes may in total occupy around the given node. - *

- * The wedge angle controls the degree to which the child nodes may radiate from the center of layout. A value close to 360 - * means that the child nodes may radiate in (almost) any direction from their parent node, edge lengths can in consequence - * stay rather small. On the other hand, a small value means that children are restricted to a small angle; thus, edges - * lengths (and drawings) may become large. - *

- *

- * This method returns the {@link yfiles.tree.BalloonLayout#preferredRootWedge preferred root wedge} if node root was selected as global root node ({@link yfiles.tree.BalloonLayout#rootNodePolicy}). Otherwise, it either - * returns {@link yfiles.tree.BalloonLayout#preferredChildWedge} or if the given node has an outdegree equal to 2, it returns the minimum of {@link yfiles.tree.BalloonLayout#preferredChildWedge} and 180. - *

- *

- * This method may be overridden to provide a custom child wedge function. - *

- * @param root the node to get the preferred wedge angle for - * @returns the preferred wedge angle for root in degrees - * @see yfiles.tree.BalloonLayout#preferredChildWedge - * @see yfiles.tree.BalloonLayout#preferredRootWedge - * @protected - */ - getPreferredChildWedge(root:yfiles.algorithms.Node):number; - /** - * Sorts the child nodes (successors) of the given node. - *

- * This implementation uses the original node coordinates if {@link yfiles.tree.BalloonLayout#fromSketchMode From Sketch mode} is enabled. Otherwise it uses {@link yfiles.tree.BalloonLayout#comparer the specified comparator} - * to sort the outgoing edges and thus the children of root. If there is no such comparator, then the sorting depends on - * whether or not the child nodes are placed in an {@link yfiles.tree.BalloonLayout#interleavedMode interleaved} fashion: - *

- *
    - *
  • Normal: Children are sorted according to the chosen {@link yfiles.tree.BalloonLayout#childOrderingPolicy child ordering policy}.
  • - *
  • - * Interleaved: Children are sorted such that the resulting interleaved node placement is compact, while children inducing - * larger subgraphs are placed next to smaller ones. - *
  • - *
- *

- * This method may be overridden to realize a custom child node ordering. It gets called in method {@link yfiles.tree.BalloonLayout#calculateChildArrangement} - * before coordinates are assigned and just after the wedge sizes for all subtrees rooted at root are determined. - *

- * @param root the node whose child nodes will be sorted - * @protected - */ - sortChildNodes(root:yfiles.algorithms.Node):void; - /** - * Data provider key for marking nodes whose child nodes should be placed in an interleaved fashion - *

- * This {@link yfiles.algorithms.IDataProvider} allows to individually configure the interleaving feature for each node in the - * graph. - *

- * @see yfiles.tree.BalloonLayout#interleavedMode - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static INTERLEAVED_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for marking the node that will be used as root node of the tree - * @see yfiles.tree.BalloonLayout#rootNodePolicy - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static SELECTED_ROOT_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * The layout graph being acted upon. - * @protected - * @type {yfiles.layout.LayoutGraph} - */ - graph:yfiles.layout.LayoutGraph; - /** - * Gets or sets the {@link yfiles.collections.IComparer.} instance that determines the order of the outgoing edges for each node of the tree. - *

- * If no {@link yfiles.collections.IComparer.} is specified (i.e. the {@link yfiles.collections.IComparer.} is null), the outgoing edges will be sorted according to the current - * {@link yfiles.tree.BalloonLayout#childOrderingPolicy child ordering policy}. - *

- * @see yfiles.tree.BalloonLayout#childOrderingPolicy - * @see yfiles.tree.BalloonLayout#fromSketchMode - * @type {yfiles.collections.IComparer.} - */ - comparer:yfiles.collections.IComparer; - /** - * Gets or sets the child ordering policy for sorting the child nodes around their parents. - *

- * The sorting policy can affect the compactness of drawings. Advantageous orderings allow adjacent subtrees to be close - * together and can thus make the whole layout more compact. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an unknown ordering policy is given - * @see yfiles.tree.BalloonLayout#fromSketchMode - * @see yfiles.tree.BalloonLayout#comparer - * @type {yfiles.tree.ChildOrderingPolicy} - */ - childOrderingPolicy:yfiles.tree.ChildOrderingPolicy; - /** - * Gets or sets the minimum distance to be kept between the nodes in the tree. - *

- * The distance needs to be a non-negative integer value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given minimum distance is negative - * @see yfiles.tree.BalloonLayout#allowOverlaps - * @type {number} - */ - minimumNodeDistance:number; - /** - * Gets or sets whether or not to consider the given coordinates of the input diagram when arranging the tree. - *

- * Enabling this feature, the original circular order of child nodes around their parent nodes will be maintained according - * to the initial coordinates when determining the order of the child nodes. - *

- * @type {boolean} - */ - fromSketchMode:boolean; - /** - * Gets or sets the root node selection policy of this layout algorithm. - *

- * The policy determines which node is chosen as (virtual) tree root during the layout process. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an unknown root node policy is given - * @type {yfiles.tree.RootNodePolicy} - */ - rootNodePolicy:yfiles.tree.RootNodePolicy; - /** - * Gets or sets the preferred radial amount (wedge) in degrees that child nodes may in total occupy around their parent - * node. - *

- * The wedge angle controls the degree to which the child nodes may radiate from the center of layout. A value close to 360 - * means that the child nodes may radiate in (almost) any direction from their parent node, edge lengths can in consequence - * stay rather small. On the other hand, a small value means that children are restricted to a small angle; thus, edge - * lengths (and drawings) may become large. - *

- *

- * The minimum allowed wedge angle is 1 and the maximum allowed value is 359. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given angle is smaller than 1 or larger than 359 - * @see yfiles.tree.BalloonLayout#preferredRootWedge - * @type {number} - */ - preferredChildWedge:number; - /** - * Gets or sets the preferred radial amount (wedge) in degrees that child nodes may in total occupy around the global - * root. - *

- * This property allows to separately control the wedge angle for the designated root node of the tree, while {@link yfiles.tree.BalloonLayout#preferredChildWedge} controls the - * angles of all child nodes. The root node will be determined depending on the {@link yfiles.tree.BalloonLayout#rootNodePolicy root node policy}. - *

- *

- * The minimum allowed root wedge angle is 1 and the maximum allowed value is 360. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given angle is smaller than 1 or larger than 360 - * @see yfiles.tree.BalloonLayout#preferredChildWedge - * @type {number} - */ - preferredRootWedge:number; - /** - * Gets or sets whether or not (partially) overlapping nodes are allowed. - *

- * If overlaps are allowed, the resulting layouts can become significantly more compact. Overlaps will mostly occur at the - * borders of nodes. Nodes will not be totally covered by other nodes. - *

- * @type {boolean} - */ - allowOverlaps:boolean; - /** - * Gets or sets the factor defining how compact layout results will potentially be, where a smaller factor produces - * potentially more compact layouts. - *

- * The algorithm tries to optimize the child node arrangement around each tree node such that each subtree is as close to - * its root as possible, while still fitting into the {@link yfiles.tree.BalloonLayout#preferredChildWedge preferred wedge angle} and not overlapping with adjacent subtrees. - *

- *

- * High compactness factor values induce the optimization procedure to be less strict and accept less optimal results, - * while low factor values mean that the optimization will only stop when being nearly optimal. Thus, lower values lead to - * a potentially higher runtime. - *

- *

- * The minimum factor value is 0.05 and the maximum is 1.0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the factor is smaller than 0.05 or greater than 1.0 - * @type {number} - */ - compactnessFactor:number; - /** - * Gets or sets the minimum length that this layout algorithm assigns to edges of the graph. - *

- * A lower minimum edge length allows generally more compact layouts. It has the highest effect if most nodes of the graph - * have a low degree, as the minimum can potentially be met for such graphs. - *

- *

- * The minimum length must be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given length is negative - * @type {number} - */ - minimumEdgeLength:number; - /** - * Gets or sets whether or not the layout algorithm reserves space for node labels. - *

- * The size of nodes will temporarily be adjusted such that the label is included. Therefore, result drawings may get - * significantly larger if this feature is enabled. - *

- * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Gets or sets the mode for child node arrangement. - *

- * Child nodes are either placed interleaved or on a single layer around their parent node. Interleaved placement means - * that child nodes are placed around their common parent in two different layers in an alternating fashion. For example, - * the first child is on the inner layer, the second child on the outer layer, the third one again on the inner layer, - * etc. - *

- *

- * Independent of this mode, the alignment of child nodes on the same layer is still defined by the {@link yfiles.tree.BalloonLayout#childAlignmentPolicy alignment policy}. - * However, {@link yfiles.tree.ChildAlignmentPolicy#SMART} is only supported for non-interleaved arrangement. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an unknown mode for interleaved arrangement is given - * @see yfiles.tree.BalloonLayout#childAlignmentPolicy - * @type {yfiles.tree.InterleavedMode} - */ - interleavedMode:yfiles.tree.InterleavedMode; - /** - * Gets or sets the child alignment policy for this layout algorithm. - *

- * This policy influences the distance of child nodes to their parent nodes and the alignment of children with the same - * parent. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an unknown policy is given - * @type {yfiles.tree.ChildAlignmentPolicy} - */ - childAlignmentPolicy:yfiles.tree.ChildAlignmentPolicy; - /** - * Gets or sets whether or not the layout algorithm automatically places node labels. - *

- * If enabled, this layout algorithm will calculate the positions for the node labels assuring that no overlaps occur. - *

- *

- * Different labeling strategies may be selected using {@link yfiles.tree.BalloonLayout#nodeLabelingPolicy}. - *

- * @see yfiles.tree.BalloonLayout#nodeLabelingPolicy - * @type {boolean} - */ - integratedNodeLabeling:boolean; - /** - * Gets or sets whether or not the layout algorithm automatically places edge labels. - *

- * If enabled, this layout algorithm will calculate the positions for the edge labels assuring that no overlaps occur. - *

- * @type {boolean} - */ - integratedEdgeLabeling:boolean; - /** - * Gets or sets the policy defining how node labels are placed by the integrated node labeling mechanism (for example, the - * desired label orientation). - * @throws {Stubs.Exceptions.ArgumentError} if an unknown labeling policy is given - * @see yfiles.tree.BalloonLayout#integratedNodeLabeling - * @type {yfiles.tree.NodeLabelingPolicy} - */ - nodeLabelingPolicy:yfiles.tree.NodeLabelingPolicy; - /** - * Gets or sets the distance between node labels belonging to the same node. - *

- * It also defines the distance between labels and the node they belong to in case of label placement outside of the node - * (e.g. for {@link yfiles.tree.NodeLabelingPolicy#RAY_LIKE ray-like label placement}). - *

- *

- * The spacing must have a non-negative value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given spacing value is negative - * @see yfiles.tree.BalloonLayout#integratedNodeLabeling - * @type {number} - */ - nodeLabelSpacing:number; - /** - * Gets or sets the distance between edge labels belonging to the same edge as well as the distance of the edge labels to - * the target node of the edge. - *

- * The spacing must have a non-negative value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given label spacing value is negative - * @see yfiles.tree.BalloonLayout#integratedEdgeLabeling - * @type {number} - */ - edgeLabelSpacing:number; - /** - * Gets or sets whether or not chains are drawn straight or not. - *

- * A chain is defined as a tree node with exactly one child node. If this feature is enabled, then the incoming edge and - * outgoing edge of the chain will have the same orientation, i.e., the whole chain looks straight. - *

- *

- * Straightening all chains can lead to smoother, more symmetric results. - *

- * @type {boolean} - */ - chainStraighteningMode:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. - * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled - * @see yfiles.layout.MultiStageLayout#componentLayout - * @see yfiles.layout.ComponentLayout - * @type {boolean} - */ - componentLayoutEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for hiding group nodes is activated. - * @see yfiles.layout.MultiStageLayout#hideGroupsStageEnabled - * @see yfiles.layout.MultiStageLayout#hideGroupsStage - * @see yfiles.layout.HideGroupsStage - * @type {boolean} - */ - hideGroupsStageEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. - * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled - * @see yfiles.layout.MultiStageLayout#orientationLayout - * @see yfiles.layout.MultiStageLayout#layoutOrientation - * @see yfiles.layout.OrientationLayout - * @type {boolean} - */ - orientationLayoutEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing parallel edges is activated. - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouterEnabled - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouter - * @see yfiles.router.ParallelEdgeRouter - * @type {boolean} - */ - parallelEdgeRouterEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. - * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled - * @see yfiles.layout.MultiStageLayout#selfLoopRouter - * @see yfiles.layout.SelfLoopRouter - * @type {boolean} - */ - selfLoopRouterEnabled:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.BalloonLayout; - } - export enum FillStyle{ - /** - * Style specifier which defines that rows/columns are aligned with their leading side. - * @see yfiles.tree.AspectRatioNodePlacer#fillStyle - */ - LEADING, - /** - * Style specifier which defines that rows/columns are aligned with their center. - * @see yfiles.tree.AspectRatioNodePlacer#fillStyle - */ - CENTERED, - /** - * Style specifier which defines that rows/columns are justified to have the same width/height. - * @see yfiles.tree.AspectRatioNodePlacer#fillStyle - */ - JUSTIFY, - /** - * Style specifier which defines that rows/columns are aligned with their trailing side. - * @see yfiles.tree.AspectRatioNodePlacer#fillStyle - */ - TRAILING - } - export enum RootPlacement{ - /** - * A root placement specifier for placing the root centered above its subtree, depending on the actual {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation}. - * @see yfiles.tree.AspectRatioTreeLayout#ROOT_PLACEMENT_DP_KEY - */ - TOP, - /** - * A root placement specifier for placing the root in the upper left corner of the subtree bounds with respect to the - * actual {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation}. - *

- * Whether the root is placed entirely beside the subtree with no horizontal overlaps or entirely above the subtree without - * vertical overlaps will be determined by the layout of the subtree. The layout algorithm tries to minimize the bounds of - * the subtree. - *

- * @see yfiles.tree.AspectRatioTreeLayout#ROOT_PLACEMENT_DP_KEY - * @see yfiles.tree.RootPlacement#CORNER_TOP - * @see yfiles.tree.RootPlacement#CORNER_SIDE - */ - CORNER, - /** - * A root placement specifier for placing the root in the upper left corner of the subtree bounds with respect to the - * actual {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation}. - *

- * The root is placed entirely beside the subtree with no horizontal overlaps. This might by important if the root's height - * is very large while its width is small. - *

- * @see yfiles.tree.AspectRatioTreeLayout#ROOT_PLACEMENT_DP_KEY - */ - CORNER_SIDE, - /** - * A root placement specifier for placing the root of a subtree in the upper left corner of the subtree bounds with respect - * to the actual {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation}. - *

- * The root is placed entirely above the subtree with no vertical overlaps. This might by important if the root's width is - * very large while its height is small. - *

- * @see yfiles.tree.AspectRatioTreeLayout#ROOT_PLACEMENT_DP_KEY - */ - CORNER_TOP - } - export enum SubtreeArrangement{ - /** - * A direction specifier for placing the child nodes next to each other in direction of the actual - * {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation}, with the edges connecting in the direction of flow. - * @see yfiles.tree.AspectRatioTreeLayout#SUBTREE_ROUTING_POLICY_DP_KEY - */ - HORIZONTAL, - /** - * A direction specifier for placing the child nodes above each other in direction of the actual - * {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation}, with the edges connecting orthogonally to the direction of flow. - * @see yfiles.tree.AspectRatioTreeLayout#SUBTREE_ROUTING_POLICY_DP_KEY - */ - VERTICAL - } - export enum InterleavedMode{ - /** - * A child placement mode where all child nodes are placed around their parent with equal distances. - * @see yfiles.tree.BalloonLayout#interleavedMode - */ - OFF, - /** - * A child placement mode where nodes are placed in an interleaved fashion, that is, with two different, alternating - * distances to the parent node. - * @see yfiles.tree.BalloonLayout#interleavedMode - */ - ALL_NODES, - /** - * A child placement mode where child nodes of selected nodes are placed in an interleaved fashion, that is, with two - * different, alternating distances to the parent node. - *

- * All other nodes are placed without interleaving. The node selection can be specified by registering an appropriate {@link yfiles.algorithms.IDataProvider} - * for key {@link yfiles.tree.BalloonLayout#INTERLEAVED_NODES_DP_KEY}. - *

- * @see yfiles.tree.BalloonLayout#interleavedMode - */ - MARKED_NODES - } - export enum NodeLabelingPolicy{ - /** - * Node labeling policy for ray-like label placement at nodes with zero or one child node. - *

- * Labels belonging to leaf nodes and nodes with exactly one successor (thus forming a sort of chain) will not be oriented - * horizontal but ray-like; they get the same orientation as their nodes' incoming edge. The labels of the other nodes will - * be oriented horizontally and placed at the center of the corresponding node. - *

- * @see yfiles.tree.BalloonLayout#nodeLabelingPolicy - */ - RAY_LIKE, - /** - * Node labeling policy for ray-like label placement at leaf nodes. - *

- * Labels corresponding to leaf nodes get the same orientation as their nodes' incoming edge and are placed outside the - * node (without overlaps). The labels of the other nodes will be oriented horizontally and placed at the center of the - * corresponding node. - *

- * @see yfiles.tree.BalloonLayout#nodeLabelingPolicy - */ - RAY_LIKE_LEAVES, - /** - * Node labeling policy for horizontal label placement at all nodes. - *

- * The node labels are placed at the center of the corresponding node. - *

- * @see yfiles.tree.BalloonLayout#nodeLabelingPolicy - */ - HORIZONTAL - } - export enum ChildAlignmentPolicy{ - /** - * Alignment policy to align child nodes rooted at the same parent such that the border of their convex hull has the same - * distance to the parent node's center. - * @see yfiles.tree.BalloonLayout#childAlignmentPolicy - */ - PLAIN, - /** - * Alignment policy to align child nodes rooted at the same parent such that each child has the same center-to-center - * distance to the parent node. - *

- * All nodes will be placed on a common radius around their parent, respective to their center coordinates. - *

- * @see yfiles.tree.BalloonLayout#childAlignmentPolicy - */ - SAME_CENTER, - /** - * Alignment policy for aligning child nodes such that the distances to their parent are kept short and drawings can - * potentially become more compact. - *

- * This policy realizes the exact same child alignment as {@link yfiles.tree.ChildAlignmentPolicy#PLAIN} if there are no edge - * labels associated with edges going to child nodes or if {@link yfiles.tree.BalloonLayout#integratedEdgeLabeling integrated edge labeling} is disabled. - *

- *

- * If edge labels need to be considered, edge labels will be added to the convex hull of the child node to which the edge - * connects. This means that child nodes connected with a labeled edge will be aligned at the border where the edge label - * begins. In consequence, edge labels will be aligned with neighboring edge labels as well as neighboring child nodes if a - * child node has no edge label at its incoming edge. - *

- *

- * This alignment strategy is especially effective if large edge labels need to be considered while drawings should still - * be compact and distances from parent to child nodes short. - *

- * @see yfiles.tree.BalloonLayout#childAlignmentPolicy - */ - COMPACT, - /** - * Alignment policy to align child nodes rooted at the same parent using a mixture of the other policies and aiming to - * achieve symmetry and compactness at the same time. - *

- * Similar to - * {@link yfiles.tree.ChildAlignmentPolicy#SAME_CENTER}, this policy aims to achieve alignments featuring equal distances between - * parent and child node centers. However, a much larger distance for all child nodes caused by single large subtrees is - * avoided by this policy. In such cases, the smaller subtrees may be placed on a common radius and the large subtrees are - * placed with different distances. - *

- * @see yfiles.tree.BalloonLayout#childAlignmentPolicy - */ - SMART - } - export enum ChildOrderingPolicy{ - /** - * Child ordering policy which orders child nodes depending on their subtree size such that large subtrees are placed next - * to small ones in order to save space. - *

- * The actual area of a subtree is used as the subtree size. The smallest subtree is placed next to the largest subtree, - * followed by the second smallest subtree and so on. This way, drawings can become more compact, because the adjacent - * placement of large subtrees is avoided (which would require edges to become longer for subtrees to fit next to each - * other). - *

- * @see yfiles.tree.BalloonLayout#childOrderingPolicy - */ - COMPACT, - /** - * Child ordering policy which sorts the child nodes according to their wedge angles. - *

- * The node with the greatest angle gets median position in the sorting order. The smaller the wedges, the farther away a - * node will be placed from the median position. Using this policy, the produced results are often more symmetric. - *

- * @see yfiles.tree.BalloonLayout#childOrderingPolicy - */ - SYMMETRIC - } - export enum RootNodePolicy{ - /** - * Root node policy for choosing a node with indegree 0 as root node of the tree. - *

- * The selection of the root node will happen according to {@link yfiles.algorithms.Trees#getRoot}. - *

- * @see yfiles.tree.BalloonLayout#rootNodePolicy - * @see yfiles.algorithms.Trees#getRoot - */ - DIRECTED_ROOT, - /** - * Root node policy for choosing the center node as root node of the tree. - *

- * A {@link yfiles.algorithms.Trees#getCenterRoot center node} induces a minimum depth tree when being used as the root of that tree. - *

- * @see yfiles.tree.BalloonLayout#rootNodePolicy - * @see yfiles.algorithms.Trees#getCenterRoot - */ - CENTER_ROOT, - /** - * Root node policy for choosing a weighted center node as root node of the tree. - *

- * A {@link yfiles.algorithms.Trees#getWeightedCenterNode weighted center node} is a node which is part of the greatest number of all undirected paths in a graph. - *

- * @see yfiles.tree.BalloonLayout#rootNodePolicy - */ - WEIGHTED_CENTER_ROOT, - /** - * Root node policy for choosing a custom node as the root node of the tree. - *

- * The root node is specified using a {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.tree.BalloonLayout#SELECTED_ROOT_DP_KEY}. - *

- * @see yfiles.tree.BalloonLayout#rootNodePolicy - */ - SELECTED_ROOT - } - export enum ChildPlacement{ - /** - * Placement specifier which defines that subtrees are placed one below the other and left of the root node. - * @see yfiles.tree.DefaultNodePlacer#childPlacement - */ - VERTICAL_TO_LEFT, - /** - * Placement specifier which defines that subtrees are placed one below the other and right of the root node. - * @see yfiles.tree.DefaultNodePlacer#childPlacement - */ - VERTICAL_TO_RIGHT, - /** - * Placement specifier which defines that subtrees are placed horizontally next to each other and above the root node. - * @see yfiles.tree.DefaultNodePlacer#childPlacement - */ - HORIZONTAL_UPWARD, - /** - * Placement specifier which defines that subtrees are placed horizontally next to each other and below the root node. - * @see yfiles.tree.DefaultNodePlacer#childPlacement - */ - HORIZONTAL_DOWNWARD - } - export enum RootAlignment{ - /** - * Alignment specifier which defines that the root node is placed ahead of all its child subtrees. - *

- * Depending on the {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, the root node is placed ahead (e.g. - * {@link yfiles.tree.ChildPlacement#HORIZONTAL_DOWNWARD}: left) of the combined bounding box of all subtrees without labels. - *

- * @see yfiles.tree.DefaultNodePlacer#rootAlignment - */ - LEADING_OFFSET, - /** - * Alignment specifier which defines that the root node is placed aligned with its first subtree. - *

- * Depending on the {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, the root node is placed aligned with the bounding box of its first (e.g. - * {@link yfiles.tree.ChildPlacement#HORIZONTAL_DOWNWARD}: left) subtree. - *

- * @see yfiles.tree.DefaultNodePlacer#rootAlignment - */ - LEADING, - /** - * Alignment specifier which defines that the root node is placed aligned with the center of its subtrees. - * @see yfiles.tree.DefaultNodePlacer#rootAlignment - */ - CENTER, - /** - * Alignment specifier which defines that the root node is placed at the median of the connection points to its subtrees. - * @see yfiles.tree.DefaultNodePlacer#rootAlignment - */ - MEDIAN, - /** - * Alignment specifier which defines that the root node is placed aligned with its last subtree. - *

- * Depending on the {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, the root node is placed aligned with the bounding box of its last (e.g. - * {@link yfiles.tree.ChildPlacement#HORIZONTAL_DOWNWARD}: right) subtree. - *

- * @see yfiles.tree.DefaultNodePlacer#rootAlignment - */ - TRAILING, - /** - * Alignment specifier which defines that the root is placed after all its subtree. - *

- * Depending on the {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, the root node is placed after (e.g. - * {@link yfiles.tree.ChildPlacement#HORIZONTAL_DOWNWARD}: right) of the combined bounding box of all subtrees without labels. - *

- * @see yfiles.tree.DefaultNodePlacer#rootAlignment - */ - TRAILING_OFFSET, - /** - * Alignment specifier which defines that the root is placed after all its subtrees, centered on the bus. - *

- * Depending on the {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, the root node is placed after (e.g. - * {@link yfiles.tree.ChildPlacement#HORIZONTAL_DOWNWARD}: right) of the combined bounding box of all subtrees without labels. The - * bus leaves directly from the root node. - *

- * @see yfiles.tree.DefaultNodePlacer#rootAlignment - */ - TRAILING_ON_BUS, - /** - * Alignment specifier which defines that the root is placed ahead of all its subtrees, centered on the bus. - *

- * Depending on the {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, the root node is placed ahead (e.g. - * {@link yfiles.tree.ChildPlacement#HORIZONTAL_DOWNWARD}: left) of the combined bounding box of all subtrees without labels. The - * bus leaves directly from the root node. - *

- * @see yfiles.tree.DefaultNodePlacer#rootAlignment - */ - LEADING_ON_BUS - } - export enum RoutingStyle{ - /** - * Routing style specifier which defines that edge paths are routed orthogonally with the bends located in the channel - * between the root node and the child nodes. - * @see yfiles.tree.DefaultNodePlacer#routingStyle - */ - FORK, - /** - * Routing style specifier which defines that edge paths are routed orthogonally with just one bend. - *

- * Edges will leave the root node at its sides and bend exactly above the according child node. If the child node is placed - * directly below the root node, the edge will bend inside of the root node and leave it at the bottom. - *

- * @see yfiles.tree.DefaultNodePlacer#routingStyle - */ - FORK_AT_ROOT, - /** - * Routing style specifier which defines that edge paths are routed with a straight segment to the center of the child - * nodes. - * @see yfiles.tree.DefaultNodePlacer#routingStyle - */ - STRAIGHT, - /** - * Routing style constant which defines that edge paths are routed with a straight segment to the connector of the {@link yfiles.tree.SubtreeShape} - * of the child nodes. - * @see yfiles.tree.DefaultNodePlacer#routingStyle - */ - POLYLINE - } - export enum PortAssignmentMode{ - /** - * A port assignment specifier that defines that - * {@link yfiles.layout.PortConstraint}s are considered. Ports are placed using the following rules: - *
    - *
  • edges without a {@link yfiles.layout.PortConstraint} are anchored at the center of the node
  • - *
  • edges with a weak {@link yfiles.layout.PortConstraint} are anchored at the center of their specified side
  • - *
  • edges with a strong {@link yfiles.layout.PortConstraint} are anchored at their initial coordinates
  • - *
- *

- * If edges with - * {@link yfiles.layout.PortConstraint}s are grouped, all edges in the same group will use the port coordinates of the first edge - * in the group. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - */ - PORT_CONSTRAINT, - /** - * A port assignment specifier which defines that edges are distributed evenly at the northern side of their nodes. - *

- * Grouped edges will use the same port coordinate and will be considered as a single edge when calculating the - * distribution. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - */ - DISTRIBUTED_NORTH, - /** - * A port assignment specifier which defines that edges are distributed evenly at the southern side of their nodes. - *

- * Grouped edges will use the same port coordinate and will be considered as a single edge when calculating the - * distribution. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - */ - DISTRIBUTED_SOUTH, - /** - * A port assignment specifier which defines that edges are distributed evenly at the eastern side of their nodes. - *

- * Grouped edges will use the same port coordinate and will be considered as a single edge when calculating the - * distribution. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - */ - DISTRIBUTED_EAST, - /** - * A port assignment specifier which defines that edges are distributed evenly at the western side of their nodes. - *

- * Grouped edges will use the same port coordinate and will be considered as a single edge when calculating the - * distribution. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - */ - DISTRIBUTED_WEST, - /** - * A port assignment specifier which defines that all ports are reset to the center of their nodes. - */ - NONE - } - export enum ConnectorDirection{ - /** - * A direction constant that describes that the last connector segment points up. The edge from the parent will connect to - * the north of the {@link yfiles.tree.SubtreeShape}. - * @see yfiles.tree.SubtreeShape#connectorDirection - */ - NORTH, - /** - * A direction constant that describes that the last connector segment points to the right. The edge from the parent will - * connect to the east of the {@link yfiles.tree.SubtreeShape}. - * @see yfiles.tree.SubtreeShape#connectorDirection - */ - EAST, - /** - * A direction constant that describes that the last connector segment points down. The edge from the parent will connect - * to the south of the {@link yfiles.tree.SubtreeShape}. - * @see yfiles.tree.SubtreeShape#connectorDirection - */ - SOUTH, - /** - * A direction constant that describes that the last connector segment points to the left. The edge from the parent will - * connect to the west of the {@link yfiles.tree.SubtreeShape}. - * @see yfiles.tree.SubtreeShape#connectorDirection - */ - WEST - } - export enum BorderLineSide{ - /** - * Side constant that defines the index of the northern border line. - * @see yfiles.tree.SubtreeShape#getBorderLine - */ - NORTH, - /** - * Side constant that defines the index of the eastern border line. - * @see yfiles.tree.SubtreeShape#getBorderLine - */ - EAST, - /** - * Side constant that defines the index of the southern border line. - * @see yfiles.tree.SubtreeShape#getBorderLine - */ - SOUTH, - /** - * Side constant that defines the index of the western border line. - * @see yfiles.tree.SubtreeShape#getBorderLine - */ - WEST - } - export enum LayeredRoutingStyle{ - /** - * Routing style specifier which defines that edges consist of one straight segment. - * @see yfiles.tree.LayeredNodePlacer#routingStyle - */ - STRAIGHT, - /** - * Routing style specifier which defines that edges are routed in an orthogonal, bus-like fashion. - * @see yfiles.tree.LayeredNodePlacer#routingStyle - */ - ORTHOGONAL - } - export enum MultiParentRoutingStyle{ - /** - * Routing style for routing non-shared edge segments in a polyline fashion. - *

- * The edges connected to a multi-parent structure will share their paths until shortly above/below the multi-parent nodes. - * This style only applies to the part of the edges where they split to connect to different multi-parents. - *

- * @see yfiles.tree.MultiParentDescriptor#edgeStyle - */ - POLYLINE, - /** - * Routing style for routing non-shared edge segments in an orthogonal fashion. - *

- * The edges connected to a multi-parent structure will share their paths until shortly above/below the multi-parent nodes. - * This style only applies to the part of the edges where they split to connect to different multi-parents. - *

- * @see yfiles.tree.MultiParentDescriptor#edgeStyle - */ - ORTHOGONAL, - /** - * Routing style for routing non-shared edge segments straight. This style will route the part of the edges that doesn't - * share the same path directly from the center of the multi-parent to the common point of the edges in the multi-parent - * structure. - *

- * The edges connected to a multi-parent structure will share their paths until shortly above/below the multi-parent nodes. - * This style only applies to the part of the edges where they split to connect to different multi-parents. - *

- * @see yfiles.tree.MultiParentDescriptor#edgeStyle - */ - STRAIGHT - } - export enum ParentConnectorDirection{ - /** - * Direction specifier which indicates that no connector should be calculated. - * @see yfiles.tree.INodePlacer#placeSubtree - */ - NONE, - /** - * Direction specifier which indicates that any direction can be used for the connector to the parent node. - * @see yfiles.tree.INodePlacer#placeSubtree - */ - ANY, - /** - * Direction specifier which indicates that the connector to the parent node should end in a segment that can be extended - * by a segment that goes north. - * @see yfiles.tree.INodePlacer#placeSubtree - */ - NORTH, - /** - * Direction specifier which indicates that the connector to the parent node should end in a segment that can be extended - * by a segment that goes east. - * @see yfiles.tree.INodePlacer#placeSubtree - */ - EAST, - /** - * Direction specifier which indicates that the connector to the parent node should end in a segment that can be extended - * by a segment that goes south. - * @see yfiles.tree.INodePlacer#placeSubtree - */ - SOUTH, - /** - * Direction specifier which indicates that the connector to the parent node should end in a segment that can be extended - * by a segment that goes west. - * @see yfiles.tree.INodePlacer#placeSubtree - */ - WEST - } - export enum PortStyle{ - /** - * A constant defining that ports are placed at the center of the nodes. - *

- * This constant uses (0,0) as port offset. - *

- * @see yfiles.tree.ClassicTreeLayout#portStyle - */ - NODE_CENTER, - /** - * A constant defining that ports are placed at the center of the border of the nodes. - * @see yfiles.tree.ClassicTreeLayout#portStyle - */ - BORDER_CENTER, - /** - * A constant defining that ports are evenly distributed along the border of the nodes. - * @see yfiles.tree.ClassicTreeLayout#portStyle - */ - BORDER_DISTRIBUTED, - /** - * A constant defining that ports are assigned based on given {@link yfiles.layout.PortConstraint port constraints}. - * @see yfiles.tree.ClassicTreeLayout#portStyle - */ - PORT_CONSTRAINTS_AWARE - } - export enum EdgeRoutingStyle{ - /** - * A constant for routing the edges as straight-line segments. - * @see yfiles.tree.ClassicTreeLayout#edgeRoutingStyle - */ - PLAIN, - /** - * A constant for routing the edges orthogonally in a bus-like fashion. - * @see yfiles.tree.ClassicTreeLayout#edgeRoutingStyle - */ - ORTHOGONAL - } - export enum LeafPlacement{ - /** - * A policy for placing the leaf nodes in a stack-like fashion with balanced stack heights. - *

- * In this context, a stack-like fashion means that leaf nodes that connect to the same parent node are placed one upon the - * other, resulting in horizontally compact layouts. - *

- *

- * This policy tries to balance stack heights, i.e., for each subtree that consists only of leaf nodes, {@link yfiles.tree.LeafPlacement#LEAVES_STACKED_RIGHT} - * or {@link yfiles.tree.LeafPlacement#LEAVES_STACKED_LEFT_AND_RIGHT} will be used depending on the number of leaves in the - * subtree. - *

- * @see yfiles.tree.ClassicTreeLayout#leafPlacement - * @see yfiles.tree.ClassicTreeLayout#leafPlacement - */ - LEAVES_STACKED, - /** - * A policy for placing the leaf nodes in a stack-like fashion using a single stack left. - *

- * In this context, a stack-like fashion means that leaf nodes that connect to the same root node are placed one upon the - * other, resulting in horizontally compact layouts. - *

- *

- * This policy uses a single stack that lies to the left relative to the center of the parent node. - *

- * @see yfiles.tree.ClassicTreeLayout#leafPlacement - * @see yfiles.tree.ClassicTreeLayout#leafPlacement - */ - LEAVES_STACKED_LEFT, - /** - * A policy for placing the leaf nodes in a stack-like fashion using a single stack right. - *

- * In this context, a stack-like fashion means that leaf nodes that connect to the same root node are placed one upon the - * other, resulting in horizontally compact layouts. - *

- *

- * This policy uses a single stack that lies to the right relative to the center of the parent node. - *

- * @see yfiles.tree.ClassicTreeLayout#leafPlacement - * @see yfiles.tree.ClassicTreeLayout#leafPlacement - */ - LEAVES_STACKED_RIGHT, - /** - * A policy for placing the leaf nodes in a stack-like fashion using two stacks. - *

- * In this context, a stack-like fashion means that leaf nodes that connect to the same root node are placed one upon the - * other, resulting in horizontally compact layouts. - *

- *

- * This policy distributes leaf nodes among two stacks, one to the left and one to the right relative to the center of the - * parent node. - *

- * @see yfiles.tree.ClassicTreeLayout#leafPlacement - * @see yfiles.tree.ClassicTreeLayout#leafPlacement - */ - LEAVES_STACKED_LEFT_AND_RIGHT, - /** - * A policy for placing the leaf nodes in a Dendrogram-like fashion. - *

- * According to this policy, all leaf nodes are placed in one layer (i.e. all leaves are placed on one horizontal line in a - * top-to-bottom or in a bottom-to-top layout). - *

- * @see yfiles.tree.ClassicTreeLayout#leafPlacement - * @see yfiles.tree.ClassicTreeLayout#leafPlacement - */ - ALL_LEAVES_ON_SAME_LAYER, - /** - * A policy for placing the leaf nodes with the same parent in the same layer. - *

- * For example, siblings are being placed on a horizontal line in a top-to-bottom or in a bottom-to-top layout. - *

- *

- * This policy produces vertically compact layouts. - *

- * @see yfiles.tree.ClassicTreeLayout#leafPlacement - * @see yfiles.tree.ClassicTreeLayout#leafPlacement - */ - SIBLINGS_ON_SAME_LAYER - } - /** - * This {@link yfiles.tree.INodePlacer} places the subtrees such that the overall aspect ratio of the arranged subtree will be - * close to a preferred aspect ratio. - *

- * Layout Style The aspect ratio describes the relation between width and height of the subtree. To achieve the desired aspect ratio, - * this {@link yfiles.tree.INodePlacer} divides the child {@link yfiles.tree.SubtreeShape}s into as much rows as needed. The edges are - * either routed along the rows or along the columns. {@graph {"ann":{"s":[30,30],"d":1},"n":[[0,0],[70,70],[140,70],[210,70],[280,70],[70,140],[140,140],[210,140],[280,140],[70,210],[140,210],[210,210],[280,210],[70,280],[140,280],[210,280],[280,280]],"e":[[0,1,[50,15,50,85]],[0,2,[120,15,120,85]],[0,3,[190,15,190,85]],[0,4,[260,15,260,85]],[0,5,[50,15,50,155]],[0,6,[120,15,120,155]],[0,7,[190,15,190,155]],[0,8,[260,15,260,155]],[0,9,[50,15,50,225]],[0,10,[120,15,120,225]],[0,11,[190,15,190,225]],[0,12,[260,15,260,225]],[0,13,[50,15,50,295]],[0,14,[120,15,120,295]],[0,15,[190,15,190,295]],[0,16,[260,15,260,295]]],"vp":[0.0,0.0,310.0,310.0]}} - *

- *

- * Aspect ratio 1 - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[0,0],[70,70],[140,70],[210,70],[70,140],[140,140],[210,140],[70,210],[140,210],[210,210],[70,280],[140,280],[210,280],[70,350],[140,350],[210,350],[70,420]],"e":[[0,1,[50,15,50,85]],[0,2,[120,15,120,85]],[0,3,[190,15,190,85]],[0,4,[50,15,50,155]],[0,5,[120,15,120,155]],[0,6,[190,15,190,155]],[0,7,[50,15,50,225]],[0,8,[120,15,120,225]],[0,9,[190,15,190,225]],[0,10,[50,15,50,295]],[0,11,[120,15,120,295]],[0,12,[190,15,190,295]],[0,13,[50,15,50,365]],[0,14,[120,15,120,365]],[0,15,[190,15,190,365]],[0,16,[50,15,50,435]]],"vp":[0.0,0.0,240.0,450.0]}} - *

- *

- * Aspect ratio 0.5 - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[0,0],[70,70],[140,70],[210,70],[280,70],[350,70],[420,70],[490,70],[560,70],[70,140],[140,140],[210,140],[280,140],[350,140],[420,140],[490,140],[560,140]],"e":[[0,1,[50,15,50,85]],[0,2,[120,15,120,85]],[0,3,[190,15,190,85]],[0,4,[260,15,260,85]],[0,5,[330,15,330,85]],[0,6,[400,15,400,85]],[0,7,[470,15,470,85]],[0,8,[540,15,540,85]],[0,9,[50,15,50,155]],[0,10,[120,15,120,155]],[0,11,[190,15,190,155]],[0,12,[260,15,260,155]],[0,13,[330,15,330,155]],[0,14,[400,15,400,155]],[0,15,[470,15,470,155]],[0,16,[540,15,540,155]]],"vp":[0.0,0.0,590.0,170.0]}} - *

- *

- * Aspect ratio 2 - *

- * @class - * @extends {yfiles.tree.NodePlacerBase} - * @implements {yfiles.tree.IFromSketchNodePlacer} - */ - export interface AspectRatioNodePlacer extends yfiles.tree.NodePlacerBase,yfiles.tree.IFromSketchNodePlacer{} - export class AspectRatioNodePlacer { - /** - * Creates a new instance of {@link yfiles.tree.AspectRatioNodePlacer} with default settings. - */ - constructor(); - /** - * Creates an {@link yfiles.collections.IComparer. edge comparator} which takes the initial coordinates of the nodes into account. - *

- * This {@link yfiles.collections.IComparer.} defines the order of the outgoing edges of a node before the actual placement of the node's subtree is calculated. - * It also considers whether or not the rows are placed {@link yfiles.tree.AspectRatioNodePlacer#horizontal horiontally}. - *

- * @returns the {@link } for the edges - */ - createFromSketchComparer():yfiles.collections.IComparer; - /** - * Gets or sets whether child nodes are distributed in horizontal rows or vertical columns. - * @type {boolean} - */ - horizontal:boolean; - /** - * Gets or sets the vertical distance between the {@link yfiles.tree.SubtreeShape}s. - *

- * The nodes will be placed below each other, keeping this distance. - *

- *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - verticalDistance:number; - /** - * Gets or sets the horizontal distance between the {@link yfiles.tree.SubtreeShape}s. - *

- * The nodes will be placed next to each other, keeping this distance. - *

- *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - horizontalDistance:number; - /** - * Gets or sets the preferred aspect ratio (width/height) for the subtrees. - *

- * This ratio determines among how many rows/columns the nodes will be distributed. - *

- *

- * The aspect ratio needs to be positive. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified aspect ratio is 0 or negative - * @type {number} - */ - aspectRatio:number; - /** - * Gets or sets how rows/columns are aligned with each other. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown fill style is specified - * @type {yfiles.tree.FillStyle} - */ - fillStyle:yfiles.tree.FillStyle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.AspectRatioNodePlacer; - } - /** - * The {@link yfiles.tree.AspectRatioTreeLayout} arranges tree graphs in a compact fashion. - *

- * Layout Style This layout algorithm tries to generate compact tree layouts with a certain preferred aspect ratio. {@graph {"ann":{"s":[30,30],"d":1},"n":[[0,0],[40,740],[360,740],[480,810],[400,810],[240,810],[80,810],[160,810],[560,810],[200,880],[200,940],[200,1000],[200,1060],[200,1120],[120,880],[120,940],[120,1000],[120,1060],[120,1120],[280,880],[280,940],[320,880],[320,940],[600,880],[600,940],[600,1000],[520,880],[520,940],[520,1000],[440,880],[440,940],[440,1000],[440,1060],[440,1120],[40,70],[390,70],[80,450],[80,640],[200,140],[200,450],[80,140],[150,680],[190,680],[240,210],[240,270],[240,330],[120,520],[120,580],[160,520],[160,580],[270,490],[270,550],[310,490],[310,550],[350,490],[350,550],[120,210],[120,270],[120,330],[120,390],[160,210],[160,270],[160,330],[430,610],[580,510],[430,510],[430,140],[510,140],[590,140],[470,610],[650,550],[500,550],[540,550],[630,210],[630,270],[630,330],[470,210],[470,270],[470,330],[470,390],[470,450],[550,210],[550,270],[550,330],[550,390],[550,450]],"e":[[0,1,-10,0,0,0,[5,50,5,720,55,720]],[0,2,-10,0,0,0,[5,50,5,720,375,720]],[2,3,-10,0,0,0,[365,790,495,790]],[2,4,-10,0,0,0,[365,790,415,790]],[1,5,-10,0,0,0,[45,790,255,790]],[1,6,-10,0,0,0,[45,790,95,790]],[1,7,-10,0,0,0,[45,790,175,790]],[2,8,-10,0,0,0,[365,790,575,790]],[7,9,-10,0,0,0,[165,860,215,860]],[7,10,-10,0,0,0,[165,860,165,920,215,920]],[7,11,-10,0,0,0,[165,860,165,980,215,980]],[7,12,-10,0,0,0,[165,860,165,1040,215,1040]],[7,13,-10,0,0,0,[165,860,165,1100,215,1100]],[6,14,-10,0,0,0,[85,860,135,860]],[6,15,-10,0,0,0,[85,860,85,920,135,920]],[6,16,-10,0,0,0,[85,860,85,980,135,980]],[6,17,-10,0,0,0,[85,860,85,1040,135,1040]],[6,18,-10,0,0,0,[85,860,85,1100,135,1100]],[5,19,-10,0,0,0,[245,860,295,860]],[5,20,-10,0,0,0,[245,860,245,920,295,920]],[5,21,-10,0,0,0,[245,860,335,860]],[5,22,-10,0,0,0,[245,860,245,920,335,920]],[8,23,-10,0,0,0,[565,860,615,860]],[8,24,-10,0,0,0,[565,860,565,920,615,920]],[8,25,-10,0,0,0,[565,860,565,980,615,980]],[3,26,-10,0,0,0,[485,860,535,860]],[3,27,-10,0,0,0,[485,860,485,920,535,920]],[3,28,-10,0,0,0,[485,860,485,980,535,980]],[4,29,-10,0,0,0,[405,860,455,860]],[4,30,-10,0,0,0,[405,860,405,920,455,920]],[4,31,-10,0,0,0,[405,860,405,980,455,980]],[4,32,-10,0,0,0,[405,860,405,1040,455,1040]],[4,33,-10,0,0,0,[405,860,405,1100,455,1100]],[0,34,-10,0,0,0,[5,50,55,50]],[0,35,-10,0,0,0,[5,50,405,50]],[34,36,-10,0,0,0,[45,120,45,430,95,430]],[34,37,-10,0,0,0,[45,120,45,620,95,620]],[34,38,-10,0,0,0,[45,120,215,120]],[34,39,-10,0,0,0,[45,120,45,430,215,430]],[34,40,-10,0,0,0,[45,120,95,120]],[37,41,0,-10,0,0,[130,645,130,660,165,660]],[37,42,0,-10,0,0,[130,645,130,660,205,660]],[38,43,-10,0,0,0,[205,190,255,190]],[38,44,-10,0,0,0,[205,190,205,250,255,250]],[38,45,-10,0,0,0,[205,190,205,310,255,310]],[36,46,-10,0,0,0,[85,500,135,500]],[36,47,-10,0,0,0,[85,500,85,560,135,560]],[36,48,-10,0,0,0,[85,500,175,500]],[36,49,-10,0,0,0,[85,500,85,560,175,560]],[39,50,0,-10,0,0,[250,455,250,470,285,470]],[39,51,0,-10,0,0,[250,455,250,530,285,530]],[39,52,0,-10,0,0,[250,455,250,470,325,470]],[39,53,0,-10,0,0,[250,455,250,530,325,530]],[39,54,0,-10,0,0,[250,455,250,470,365,470]],[39,55,0,-10,0,0,[250,455,250,530,365,530]],[40,56,-10,0,0,0,[85,190,135,190]],[40,57,-10,0,0,0,[85,190,85,250,135,250]],[40,58,-10,0,0,0,[85,190,85,310,135,310]],[40,59,-10,0,0,0,[85,190,85,370,135,370]],[40,60,-10,0,0,0,[85,190,175,190]],[40,61,-10,0,0,0,[85,190,85,250,175,250]],[40,62,-10,0,0,0,[85,190,85,310,175,310]],[35,63,-10,0,0,0,[395,120,395,590,445,590]],[35,64,-10,0,0,0,[395,120,395,490,595,490]],[35,65,-10,0,0,0,[395,120,395,490,445,490]],[35,66,-10,0,0,0,[395,120,445,120]],[35,67,-10,0,0,0,[395,120,525,120]],[35,68,-10,0,0,0,[395,120,605,120]],[35,69,-10,0,0,0,[395,120,395,590,485,590]],[64,70,0,-10,0,0,[630,515,630,530,665,530]],[65,71,0,-10,0,0,[480,515,480,530,515,530]],[65,72,0,-10,0,0,[480,515,480,530,555,530]],[68,73,-10,0,0,0,[595,190,645,190]],[68,74,-10,0,0,0,[595,190,595,250,645,250]],[68,75,-10,0,0,0,[595,190,595,310,645,310]],[66,76,-10,0,0,0,[435,190,485,190]],[66,77,-10,0,0,0,[435,190,435,250,485,250]],[66,78,-10,0,0,0,[435,190,435,310,485,310]],[66,79,-10,0,0,0,[435,190,435,370,485,370]],[66,80,-10,0,0,0,[435,190,435,430,485,430]],[67,81,-10,0,0,0,[515,190,565,190]],[67,82,-10,0,0,0,[515,190,515,250,565,250]],[67,83,-10,0,0,0,[515,190,515,310,565,310]],[67,84,-10,0,0,0,[515,190,515,370,565,370]],[67,85,-10,0,0,0,[515,190,515,430,565,430]]],"vp":[0.0,0.0,680.0,1150.0]}} - *

- *

- * Example layout with an aspect ratio of 0.5 - *

- *

- * Concept - *

- *

- * The layout algorithm starts from the root and recursively assigns coordinates to all tree nodes. In this manner, leaf - * nodes will be placed first, while each parent node is placed centered above its child nodes. - *

- *

- * Features - *

- *

- * The aspect ratio of each subtree can be specified individually. A {@link yfiles.algorithms.IDataProvider} registered with {@link yfiles.tree.AspectRatioTreeLayout#SUBTREE_ASPECT_RATIO_DP_KEY} - * returns the aspect ratio for each local root node. - *

- *

- * A custom node can be defined as root of the tree using a {@link yfiles.algorithms.IDataProvider} registered with the graph with - * key {@link yfiles.tree.AspectRatioTreeLayout#SELECTED_ROOT_DP_KEY}. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface AspectRatioTreeLayout extends yfiles.layout.MultiStageLayout{} - export class AspectRatioTreeLayout { - /** - * Creates a new {@link yfiles.tree.AspectRatioTreeLayout} instance with default settings. - */ - constructor(); - /** - * Adds bends to the given {@link yfiles.layout.IEdgeLayout}. - *

- * This method is called by {@link yfiles.tree.AspectRatioTreeLayout#applyLayoutCore} for each edge, after the nodes are placed, to - * route the path of the edges. It may be overridden to apply a custom routing style. - *

- * @param edgeLayout the layout of the edge that is routed - * @param localRoot the local root of the subtree - * @param child the child connected to the local root with the given edge - * @param rootPlacement the placement specifier of the local root - * @param routingPolicy the direction specifier for the routing - * @protected - */ - createBends(edgeLayout:yfiles.layout.IEdgeLayout,localRoot:yfiles.algorithms.Node,child:yfiles.algorithms.Node,rootPlacement:yfiles.tree.RootPlacement,routingPolicy:yfiles.tree.SubtreeArrangement):void; - /** - * Retrieves the aspect ratio for the subtree that is rooted at the given node. - *

- * If there is an individual aspect ratio for the subtree provided by a {@link yfiles.algorithms.IDataProvider} registered with key - * {@link yfiles.tree.AspectRatioTreeLayout#SUBTREE_ASPECT_RATIO_DP_KEY}, that ratio will be returned. Otherwise, the {@link yfiles.tree.AspectRatioTreeLayout#aspectRatio default aspect ratio} - * will be returned. - *

- *

- * This method is called by {@link yfiles.tree.AspectRatioTreeLayout#applyLayoutCore} before a subtree is arranged. It may be - * overridden to use another approach to define the aspect ratio for subtrees. - *

- * @param localRoot the root node of the subtree - * @returns the aspect ratio of the subtree rooted at the local root node - * @see yfiles.tree.AspectRatioTreeLayout#SUBTREE_ASPECT_RATIO_DP_KEY - * @see yfiles.tree.AspectRatioTreeLayout#aspectRatio - * @protected - */ - getAspectRatio(localRoot:yfiles.algorithms.Node):number; - /** - * Retrieves the root placement for the subtree that is rooted at the given node. - *

- * Either an individual root placement for the subtree (defined via a {@link yfiles.algorithms.IDataProvider} registered with - * {@link yfiles.tree.AspectRatioTreeLayout#ROOT_PLACEMENT_DP_KEY}), or if there is none, the {@link yfiles.tree.AspectRatioTreeLayout#rootPlacement default root placement} is returned. - *

- *

- * This method is called by {@link yfiles.tree.AspectRatioTreeLayout#applyLayoutCore} after a subtree is arranged to align the - * local root node. It may be overridden to use another approach to define the root placement for a subtree. - *

- * @param localRoot the root of the subtree - * @returns the root placement of the subtree - * @see yfiles.tree.AspectRatioTreeLayout#ROOT_PLACEMENT_DP_KEY - * @see yfiles.tree.AspectRatioTreeLayout#rootPlacement - * @protected - */ - getRootPlacement(localRoot:any):yfiles.tree.RootPlacement; - /** - * Retrieves the routing for the subtree that is rooted at the given node. - *

- * Either an individual routing for the subtree (defined via a {@link yfiles.algorithms.IDataProvider} registered with - * {@link yfiles.tree.AspectRatioTreeLayout#SUBTREE_ROUTING_POLICY_DP_KEY}), or if there is none, the {@link yfiles.tree.AspectRatioTreeLayout#subtreeArrangement default routing} is returned. - *

- *

- * This method is called by {@link yfiles.tree.AspectRatioTreeLayout#applyLayoutCore} to determine the direction of the subtrees. - * It may be overridden to use another approach to define the routing for a subtree. - *

- * @param localRoot the root of the subtree - * @returns the routing policy for the subtree - * @see yfiles.tree.AspectRatioTreeLayout#SUBTREE_ROUTING_POLICY_DP_KEY - * @see yfiles.tree.AspectRatioTreeLayout#subtreeArrangement - * @protected - */ - getSubtreeArrangement(localRoot:any):yfiles.tree.SubtreeArrangement; - /** - * Retrieves all children of the given local root. - *

- * This method is called by {@link yfiles.tree.AspectRatioTreeLayout#applyLayoutCore} to arrange the subtrees below the local - * root. - *

- * @param localRoot the root of a subtree - * @returns all successors of the given node - * @protected - */ - getSuccessors(localRoot:yfiles.algorithms.Node):yfiles.algorithms.INodeCursor; - /** - * Data provider key for specifying a target aspect ratio for each subtree - *

- * The aspect ratio needs to be greater than 0. - *

- *
    - *
  • aspect ratio 1: width and height of the layout should be the same
  • - *
  • aspect ratio between 0 and 1: the height of the layout should be greater than its width
  • - *
  • aspect ratio greater than 1: the width of the layout should be greater than its height
  • - *
- *

- * If no specific ratio is defined for a subtree, the layout algorithm falls back to the default {@link yfiles.tree.AspectRatioTreeLayout#aspectRatio aspect ratio}. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static SUBTREE_ASPECT_RATIO_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for specifying the placement of each subtree root - *

- * If no root placement is specified for one of the subtree roots, the default {@link yfiles.tree.AspectRatioTreeLayout#rootPlacement root placement} will be used. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static ROOT_PLACEMENT_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for specifying the routing direction for each subtree root - *

- * The children in a subtree are arranged either horizontally or vertically. The edges are routed to the top of the child - * nodes or at the side, respectively. Directions depend on the {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation} and refer to {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} - * for this description. - *

- *

- * If no specific routing policy is specified for a subtree root, the layout algorithm uses the default {@link yfiles.tree.AspectRatioTreeLayout#subtreeArrangement routing direction}. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static SUBTREE_ROUTING_POLICY_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for marking the node that will be used as root node of the tree - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static SELECTED_ROOT_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * The input graph this algorithm is handling. - * @protected - * @type {yfiles.layout.LayoutGraph} - */ - graph:yfiles.layout.LayoutGraph; - /** - * Gets or sets the horizontal distance between adjacent nodes. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - horizontalDistance:number; - /** - * Gets or sets the vertical distance between adjacent nodes. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - verticalDistance:number; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. - * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled - * @see yfiles.layout.MultiStageLayout#componentLayout - * @see yfiles.layout.ComponentLayout - * @type {boolean} - */ - componentLayoutEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for hiding group nodes is activated. - * @see yfiles.layout.MultiStageLayout#hideGroupsStageEnabled - * @see yfiles.layout.MultiStageLayout#hideGroupsStage - * @see yfiles.layout.HideGroupsStage - * @type {boolean} - */ - hideGroupsStageEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing parallel edges is activated. - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouterEnabled - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouter - * @see yfiles.router.ParallelEdgeRouter - * @type {boolean} - */ - parallelEdgeRouterEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. - * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled - * @see yfiles.layout.MultiStageLayout#selfLoopRouter - * @see yfiles.layout.SelfLoopRouter - * @type {boolean} - */ - selfLoopRouterEnabled:boolean; - /** - * Gets or sets the {@link yfiles.collections.IComparer.} that will be used for sorting the {@link yfiles.algorithms.Node#sortOutEdges outgoing edges} of each local root in the tree before they are being - * arranged. - * @type {yfiles.collections.IComparer.} - */ - comparer:yfiles.collections.IComparer; - /** - * Gets or sets the default aspect ratio for this {@link yfiles.tree.AspectRatioTreeLayout}. - *

- * This aspect ratio is used for all subtrees for which there is no specific aspect ratio defined in a {@link yfiles.algorithms.IDataProvider} - * registered with {@link yfiles.tree.AspectRatioTreeLayout#SUBTREE_ASPECT_RATIO_DP_KEY}. - *

- *

- * The aspect ratio needs to have a positive value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified aspect ratio is 0 or negative - * @type {number} - */ - aspectRatio:number; - /** - * Gets or sets the desired placement of the tree's root node. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown placement specifiers is set - * @type {yfiles.tree.RootPlacement} - */ - rootPlacement:yfiles.tree.RootPlacement; - /** - * Gets or sets how the children of a local root are arranged and how the edges between them are routed. - * @throws {Stubs.Exceptions.ArgumentError} if the specified routing policy is unknown - * @type {yfiles.tree.SubtreeArrangement} - */ - subtreeArrangement:yfiles.tree.SubtreeArrangement; - /** - * Gets or sets the preferred distance between any two bends of an edge. - *

- * Additionally, the preferred bend distance governs the distance between the first and last edges and the corresponding - * ports. - *

- *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - bendDistance:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.AspectRatioTreeLayout; - } - /** - * The {@link yfiles.tree.AssistantNodePlacer} places nodes that are marked as assistants left and right of their parents and all - * other nodes below the assistant nodes. - *

- * Layout Style {@graph {"ann":{"s":[30,30],"d":1},"n":[[75,0],[100,171],[50,171],[0,171],[150,171],[110,50,1],[40,100,1],[40,50,1]],"e":[[0,1,[90,150.5,115,150.5]],[0,2,[90,150.5,65,150.5]],[0,3,[90,150.5,15,150.5]],[0,4,[90,150.5,165,150.5]],[0,5,[90,65]],[0,6,[90,115]],[0,7,[90,65]]],"vp":[0.0,0.0,180.0,201.0]}} - *

- *

- * Assistants are marked - *

- *

- * Concept This {@link yfiles.tree.INodePlacer} delegates the placement of all assistant nodes to an instance of - * {@link yfiles.tree.LeftRightNodePlacer}. The non-assistant nodes are handled by another {@link yfiles.tree.AssistantNodePlacer#childNodePlacer node placer}. To be able to do this, {@link yfiles.tree.AssistantNodePlacer} - * uses a {@link yfiles.tree.IProcessor} which prepares the graph for node placing. - *

- *

- * A {@link yfiles.algorithms.IDataProvider} that is registered using {@link yfiles.tree.AssistantNodePlacer#ASSISTANT_NODE_DP_KEY} returns - * true for assistant nodes and false for all other nodes. - *

- * @class - * @extends {yfiles.tree.RotatableNodePlacerBase} - */ - export interface AssistantNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} - export class AssistantNodePlacer { - /** - * Creates a new {@link yfiles.tree.AssistantNodePlacer} instance that uses the transformation defined by the given matrix. - * @param modificationMatrix the transformation matrix - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix); - /** - * Creates a new {@link yfiles.tree.AssistantNodePlacer} instance with default settings. - */ - constructor(); - /** - * Creates a {@link yfiles.collections.IComparer.} that compares outgoing edges connecting to assistant nodes and edges connecting to non-assistant nodes - * separately. - * @param assistantComparer the {@link } for edges connecting to assistant nodes - * @param childComparer the {@link } for edges connecting to non-assistant nodes - * @returns a {@link } that compares edges to assistant nodes separately from edges to non-assistant nodes - * @static - */ - static createCompoundComparer(assistantComparer:yfiles.collections.IComparer,childComparer:yfiles.collections.IComparer):yfiles.collections.IComparer; - /** - * Data provider key for marking which nodes are placed as assistants - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static ASSISTANT_NODE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets the spacing between subtrees for the delegate {@link yfiles.tree.INodePlacer}. - *

- * The spacing needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given spacing is negative - * @type {number} - */ - spacing:number; - /** - * Gets or sets the {@link yfiles.tree.INodePlacer} instance that places the non-assistant children. - *

- * These non-assistant child nodes will be placed below the assistant child nodes and are arranged by the given - * {@link yfiles.tree.INodePlacer}. Non-assistant child nodes are the ones that are not marked in the {@link yfiles.algorithms.IDataProvider} - * registered with {@link yfiles.tree.AssistantNodePlacer#ASSISTANT_NODE_DP_KEY}. - *

- * @see yfiles.tree.AssistantNodePlacer#ASSISTANT_NODE_DP_KEY - * @type {yfiles.tree.INodePlacer} - */ - childNodePlacer:yfiles.tree.INodePlacer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.AssistantNodePlacer; - } - /** - * The {@link yfiles.tree.BusNodePlacer} creates a bus to which all child nodes and the local root node are connected. - *

- * Layout Style {@graph {"ann":{"s":[30,30],"d":1},"n":[[40,0],[140,0],[190,0],[50,70],[0,70],[100,70],[150,70],[90,0,1]],"e":[[7,0,[105,50,55,50]],[7,1,[105,50,155,50]],[7,2,[105,50,205,50]],[7,3,[105,50,65,50]],[7,4,[105,50,15,50]],[7,5,[105,50,115,50]],[7,6,[105,50,165,50]]],"vp":[0.0,0.0,220.0,100.0]}} - *

- *

- * The root node is marked - *

- * @class - * @extends {yfiles.tree.RotatableNodePlacerBase} - */ - export interface BusNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} - export class BusNodePlacer { - /** - * Creates a new {@link yfiles.tree.BusNodePlacer} instance that uses the transformation defined by the given matrix. - * @param modificationMatrix the transformation matrix - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix); - /** - * Creates a new instance of {@link yfiles.tree.BusNodePlacer} with default settings. - */ - constructor(); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.BusNodePlacer; - } - /** - * This layout algorithm arranges graphs with a tree structure. - *

- * Layout Style {@link yfiles.tree.ClassicTreeLayout} is designed to arrange directed and undirected trees that have a unique root node. All - * children are placed below their parent in relation to the main layout direction. The edges of the graph are routed as - * straight-line segments or in an orthogonal bus-like fashion. - *

- *

- * Tree layout algorithms are commonly used for visualizing relational data and for producing diagrams of high quality that - * are able to reveal possible hierarchic properties of the graph. More precisely, they find applications in dataflow - * analysis, software engineering, bioinformatics and business administration. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[215.62,70],[365.62,0],[706.25,210],[25,140],[331.25,140],[100,280],[512.5,210],[325,280],[762.5,280],[200,210],[150,350],[400,350],[825,350],[350,350],[25,210],[900,420],[700,420],[100,350],[575,280],[575,350],[600,420],[200,280],[150,420],[25,280],[550,420],[300,420],[850,420],[800,420],[400,420],[200,350],[350,420],[50,350],[500,420],[100,420],[750,420],[450,420],[0,420],[50,420],[200,420],[650,280],[250,420],[650,420],[650,350]],"e":[[1,0,0,15,0,-15,[230.62,50]],[1,2,0,15,0,-15,[721.25,50]],[1,3,0,15,0,-15,[40,50]],[0,4,0,15,0,-15,[346.25,120]],[0,5,0,15,0,-15,[115,120]],[4,6,0,15,0,-15,[527.5,190]],[4,7,0,15,0,-15,[340,190]],[2,8,0,15,0,-15,[777.5,260]],[4,9,0,15,0,-15,[215,190]],[4,10,0,15,0,-15,[165,190]],[7,11,0,15,0,-15,[415,330]],[8,12,0,15,0,-15,[840,330]],[7,13,0,15,0,-15,[365,330]],[3,14,0,15,0,-15],[12,15,0,15,0,-15,[915,400]],[8,16,0,15,0,-15,[715,330]],[5,17,0,15,0,-15],[6,18,0,15,0,-15,[590,260]],[18,19,0,15,0,-15],[19,20,0,15,0,-15,[615,400]],[9,21,0,15,0,-15],[10,22,0,15,0,-15],[14,23,0,15,0,-15],[19,24,0,15,0,-15,[565,400]],[7,25,0,15,0,-15,[315,330]],[12,26,0,15,0,-15,[865,400]],[12,27,0,15,0,-15,[815,400]],[11,28,0,15,0,-15],[21,29,0,15,0,-15],[13,30,0,15,0,-15],[23,31,0,15,0,-15,[65,330]],[6,32,0,15,0,-15,[515,260]],[17,33,0,15,0,-15],[12,34,0,15,0,-15,[765,400]],[6,35,0,15,0,-15,[465,260]],[23,36,0,15,0,-15,[15,330]],[31,37,0,15,0,-15],[29,38,0,15,0,-15],[2,39,0,15,0,-15,[665,260]],[7,40,0,15,0,-15,[265,330]],[39,42,0,15,0,-15],[42,41,0,15,0,-15]],"vp":[0.0,0.0,930.0,450.0]}} A Dendrogram {@graph {"ann":{"s":[30,30],"d":1},"n":[[983.12,0],[495,85],[495,170],[151.25,170],[495,240],[42.5,255],[85,325],[0,325],[520,310],[470,310],[520,380],[135,395],[470,380],[85,395],[520,450],[35,395],[185,240,265,270,2],[260,255],[320,325],[405,395],[320,395],[370,465],[320,465],[235,395],[270,465],[200,325],[570,155,560,510,2],[670,170],[1060,240],[670,240],[1060,310],[670,325],[585,240],[1085,380],[670,395],[670,465],[620,325],[1035,380],[720,310,295,340,2],[810,325],[920,395],[835,395],[920,465],[785,395],[835,465],[970,535],[920,535],[735,395],[735,465],[870,535],[920,605],[1150,70,440,495,2],[1471.25,85],[1545,155],[1397.5,155],[1510,240],[1435,240],[1460,310],[1360,240],[1460,380],[1485,450],[1410,310],[1360,310],[1435,450],[1510,310],[1360,380],[1435,520],[1165,225,175,230,2],[1230,240],[1280,310],[1230,310],[1180,310],[1265,380,60,60,2],[1280,395]],"e":[[0,1,[998.12,50,510,50]],[1,2],[1,3,[510,135,166.25,135]],[2,4],[3,5,[166.25,220,57.5,220]],[5,6,[57.5,305,100,305]],[5,7,[57.5,305,15,305]],[4,8,[510,290,535,290]],[4,9,[510,290,485,290]],[8,10],[6,11,[100,375,150,375]],[9,12],[6,13],[10,14],[6,15,[100,375,50,375]],[3,17,[166.25,220,275,220]],[17,18,[275,305,335,305]],[18,19,[335,375,420,375]],[18,20],[20,21,[335,445,385,445]],[20,22],[18,23,[335,375,250,375]],[20,24,[335,445,285,445]],[17,25,[275,305,215,305]],[1,27,[510,135,685,135]],[27,28,[685,220,1075,220]],[27,29],[28,30],[29,31],[27,32,[685,220,600,220]],[30,33,[1075,360,1100,360]],[31,34],[34,35],[29,36,[685,290,635,290]],[30,37,[1075,360,1050,360]],[29,39,[685,290,825,290]],[39,40,[825,375,935,375]],[39,41,[825,375,850,375]],[40,42],[39,43,[825,375,800,375]],[41,44],[42,45,[935,515,985,515]],[42,46],[39,47,[825,375,750,375]],[47,48],[42,49,[935,515,885,515]],[46,50],[0,52,[998.12,50,1486.25,50]],[52,53,[1486.25,135,1560,135]],[52,54,[1486.25,135,1412.5,135]],[54,55,[1412.5,205,1525,205]],[54,56,[1412.5,205,1450,205]],[56,57,[1450,290,1475,290]],[54,58,[1412.5,205,1375,205]],[57,59],[59,60,[1475,430,1500,430]],[56,61,[1450,290,1425,290]],[58,62],[59,63,[1475,430,1450,430]],[55,64],[62,65],[63,66],[54,68,[1412.5,205,1245,205]],[68,69,[1245,290,1295,290]],[68,70],[68,71,[1245,290,1195,290]],[69,73]],"vp":[0.0,0.0,1590.0,665.0]}} A graph containing group nodes {@graph {"ann":{"s":[30,30],"d":1},"n":[[4.33,440.22],[74.33,418.34,73.78,73.78],[188.11,41,48,48],[197.11,417.95],[298,245.33],[298,445.67],[389.89,393.78,73.78,73.78],[411.78,146.89],[298,25],[411.78,243.78],[411.78,293.78],[298,590.56],[503.67,100,73.78,73.78],[197.11,708.56],[188.11,821.45,48,48],[525.56,415.67],[525.56,243.78],[399.84,13.06,53.88,53.88],[276.11,661.67,73.78,73.78],[411.78,343.78],[411.78,497.56],[402.78,547.56,48,48],[402.78,615.56,48,48],[298,755.45],[525.56,472.56],[525.56,293.78],[629.39,243.78],[525.56,0],[525.56,50],[525.56,522.56],[298,805.45],[617.45,485.62,53.88,53.88],[629.39,50],[411.78,755.45],[711.33,38.06,53.88,53.88],[629.39,559.5],[298,75],[411.78,683.56],[525.56,599.56],[411.78,805.45],[723.27,559.5],[629.39,293.78],[525.56,193.78],[723.27,497.56],[298,855.45],[525.56,649.56]],"e":[[0,1],[1,2,[168.11,455.22,168.11,65]],[1,3,[168.11,455.22,168.11,432.95]],[3,4,[256.11,432.95,256.11,260.33]],[3,5,[256.11,432.95,256.11,460.67]],[5,6,[369.89,460.67,369.89,430.67]],[4,7,[369.89,260.33,369.89,161.89]],[2,8,[256.11,65,256.11,40]],[4,9,[369.89,260.33,369.89,258.78]],[4,10,[369.89,260.33,369.89,308.78]],[3,11,[256.11,432.95,256.11,605.56]],[7,12,[483.67,161.89,483.67,136.89]],[1,13,[168.11,455.22,168.11,723.56]],[1,14,[168.11,455.22,168.11,845.45]],[6,15],[9,16],[8,17],[13,18,[256.11,723.56,256.11,698.56]],[4,19,[369.89,260.33,369.89,358.78]],[5,20,[369.89,460.67,369.89,512.56]],[11,21,[369.89,605.56,369.89,571.56]],[11,22,[369.89,605.56,369.89,639.56]],[13,23,[256.11,723.56,256.11,770.45]],[20,24,[483.67,512.56,483.67,487.56]],[10,25],[16,26],[17,27,[483.67,40,483.67,15]],[17,28,[483.67,40,483.67,65]],[20,29,[483.67,512.56,483.67,537.56]],[14,30,[256.11,845.45,256.11,820.45]],[29,31,[597.45,537.56,597.45,512.56]],[28,32],[23,33],[32,34],[29,35,[597.45,537.56,597.45,574.5]],[2,36,[256.11,65,256.11,90]],[18,37],[22,38,[483.67,639.56,483.67,614.56]],[30,39],[35,40],[25,41],[7,42,[483.67,161.89,483.67,208.78]],[31,43],[14,44,[256.11,845.45,256.11,870.45]],[22,45,[483.67,639.56,483.67,664.56]]],"vp":[4.0,0.0,762.0,886.0]}} Left-to-right layout with global layeringConcept - *

- *

- * The layout algorithm starts from the root and recursively assigns coordinates to all tree nodes. In this manner, leaf - * nodes will be placed first, while each parent node is placed centered above its children. - *

- *

- * Features - *

- *

- * The layout algorithm supports custom sorting of sibling nodes by using a specific {@link yfiles.tree.NodeOrderComparer}. Each - * tree node may have an individual {@link yfiles.tree.NodeOrderComparer} that is stored in a {@link yfiles.algorithms.IDataProvider} - * registered with the graph with {@link yfiles.tree.NodeOrderComparer#NODE_ORDER_COMPARABLE_DP_KEY}. If this {@link yfiles.tree.NodeOrderComparer} - * uses the initial coordinates of the nodes, it allows the incremental insertion of child nodes while keeping the relative - * locations of the other nodes. - *

- *

- * A custom node can be defined as root of the tree using a {@link yfiles.algorithms.IDataProvider} registered with the graph with - * key {@link yfiles.tree.ClassicTreeLayout#SELECTED_ROOT_DP_KEY}. - *

- *

- * {@link yfiles.tree.ClassicTreeLayout} can be configured to {@link yfiles.tree.ClassicTreeLayout#considerNodeLabels reserve space for node labels}. It can also {@link yfiles.tree.ClassicTreeLayout#integratedEdgeLabeling place edge labels along edges} - * such that the labels won't overlap with other graph elements. Edge labels are placed according to the information stored - * in a {@link yfiles.layout.PreferredPlacementDescriptor} instance. However, the placement along the edge will only affect the - * order of multiple labels at the same edge. The algorithm will always place the labels close to the target node. - *

- *

- * Grouping of nodes can also be handled by this layout algorithm. It is important that a group node contains a whole - * subtree. Otherwise, the group nodes may overlap with each other or with other nodes. Furthermore, the user may specify - * minimum size constraints for each group node using {@link yfiles.algorithms.IDataProvider} key - * {@link yfiles.layout.GroupingKeys#MINIMUM_NODE_SIZE_DP_KEY}. - *

- *

- * This layout algorithm can only handle graphs with a tree structure. To apply it to a general graph, a {@link yfiles.tree.TreeReductionStage} - * can be appended. This stage will temporarily remove some edges of the input graph until a tree is obtained. After the - * layout calculation, the stage will reinsert the edges that were removed and route them separately. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface ClassicTreeLayout extends yfiles.layout.MultiStageLayout{} - export class ClassicTreeLayout { - /** - * Creates a new {@link yfiles.tree.ClassicTreeLayout} instance with default settings. - */ - constructor(); - /** - * Data provider key for marking the node that will be used as root node of the tree - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static SELECTED_ROOT_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets whether or not a global layering is enforced, that is, each node spans exactly one layer. - *

- * If it is enabled, the algorithm ensures that nodes never span more than one layer. Otherwise, nodes with larger size - * might span two or more layers such that a more compact layout is produced. - *

- *

- * This setting can be advantageous, if the hierarchical structure of the tree should be emphasized. - *

- * @see yfiles.tree.ClassicTreeLayout#verticalAlignment - * @see yfiles.tree.ClassicTreeLayout#verticalAlignment - * @type {boolean} - */ - enforceGlobalLayering:boolean; - /** - * Gets or sets the layout policy for leaf nodes. - * @throws {Stubs.Exceptions.ArgumentError} if the specified policy is unknown - * @type {yfiles.tree.LeafPlacement} - */ - leafPlacement:yfiles.tree.LeafPlacement; - /** - * Gets or sets whether or not group nodes are handled by the layout algorithm. - * @see yfiles.layout.MultiStageLayout#hideGroupsStageEnabled - * @type {boolean} - */ - groupingSupported:boolean; - /** - * Gets or sets the {@link yfiles.collections.IComparer.} instance that is used for sorting the outgoing edges of each node of the tree. - *

- * This comparator defines the relative order of the child nodes in the layout. - *

- * @type {yfiles.collections.IComparer.} - */ - comparer:yfiles.collections.IComparer; - /** - * Gets or sets the port assignment policy that will be applied. - * @type {yfiles.tree.PortStyle} - */ - portStyle:yfiles.tree.PortStyle; - /** - * Gets or sets the edge routing style used by this layout algorithm. - *

- * If {@link yfiles.tree.EdgeRoutingStyle#PLAIN} is set, the edges will be routed as straight-line segments. If {@link yfiles.tree.EdgeRoutingStyle#ORTHOGONAL} - * is set, all edges will be routed orthogonally in a bus-like fashion. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an invalid layout style is provided - * @type {yfiles.tree.EdgeRoutingStyle} - */ - edgeRoutingStyle:yfiles.tree.EdgeRoutingStyle; - /** - * Gets or sets the minimum horizontal distance between adjacent nodes within the same layer. - * @throws {Stubs.Exceptions.ArgumentError} if the given distance is negative - * @type {number} - */ - minimumNodeDistance:number; - /** - * Gets or sets the minimum distance between two adjacent layers. - * @throws {Stubs.Exceptions.ArgumentError} if the given distance is negative - * @type {number} - */ - minimumLayerDistance:number; - /** - * Gets or sets whether or not the layout algorithm reserves space for node labels. - * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Gets or sets whether or not the layout algorithm reserves space for edge labels and places them. - *

- * To define the desired placement for each label add a {@link yfiles.layout.PreferredPlacementDescriptor} on - * {@link yfiles.layout.IEdgeLabelLayout}. - *

- *

- * This method is a convenience method that assures that the {@link yfiles.layout.MultiStageLayout#labeling label layouter} is of type {@link yfiles.layout.LabelLayoutTranslator} - * and {@link yfiles.layout.LabelLayoutTranslator#translateEdgeLabels} is set to true. - *

- * @type {boolean} - */ - integratedEdgeLabeling:boolean; - /** - * Gets or sets the vertical bus alignment for orthogonally routed edge buses. - *

- * The bus alignment determines the relative position of an edge bus between two subsequent layers. The value of this - * property must lie within the interval [0,1] where: - *

- *
    - *
  • A value of 0 places the bus at the top, directly below the parent node.
  • - *
  • A value of 0.5 places the bus in the middle between parent and child nodes.
  • - *
  • A value of 1 places the bus at the bottom, directly above the child nodes.
  • - *
- * @throws {Stubs.Exceptions.ArgumentError} if busAlignment is not in [0,1] - * @see yfiles.tree.ClassicTreeLayout#edgeRoutingStyle - * @see yfiles.tree.ClassicTreeLayout#enforceGlobalLayering - * @see yfiles.tree.ClassicTreeLayout#leafPlacement - * @type {number} - */ - busAlignment:number; - /** - * Gets or sets the vertical alignment of the nodes within their corresponding layers. - *

- * The value for the vertical alignment is considered as relative to the height of the corresponding layer, which is - * determined by the maximum height of the nodes that belong to the particular layer. - *

- *

- * The value of this property must lie within the interval [0,1], where: - *

- *
    - *
  • A value of 0 corresponds to top-alignment.
  • - *
  • A value of 0.5 corresponds to center-alignment.
  • - *
  • A value of 1 corresponds to bottom-alignment.
  • - *
- * @throws {Stubs.Exceptions.ArgumentError} if vertical alignment value does not lie within [0,1] - * @see yfiles.tree.ClassicTreeLayout#enforceGlobalLayering - * @type {number} - */ - verticalAlignment:number; - /** - * Gets or sets the modification matrix used for rotating / mirroring the layout. - * @type {yfiles.tree.RotatableNodePlacerMatrix} - */ - modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. - * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled - * @see yfiles.layout.MultiStageLayout#componentLayout - * @see yfiles.layout.ComponentLayout - * @type {boolean} - */ - componentLayoutEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing parallel edges is activated. - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouterEnabled - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouter - * @see yfiles.router.ParallelEdgeRouter - * @type {boolean} - */ - parallelEdgeRouterEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. - * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled - * @see yfiles.layout.MultiStageLayout#selfLoopRouter - * @see yfiles.layout.SelfLoopRouter - * @type {boolean} - */ - selfLoopRouterEnabled:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.ClassicTreeLayout; - } - /** - * {@link yfiles.tree.DefaultNodePlacer} is the default implementation of interface {@link yfiles.tree.INodePlacer}. - *

- * Layout Style The layout style can be customized in several ways. Subtrees sharing the same local root node are either placed above - * or below each other. {@graph {"ann":{"s":[30,30],"d":1},"n":[[135,0],[0,70],[70,70],[120,149],[170,149],[220,149],[270,149],[70,199],[120,278],[170,278],[220,278],[270,278]],"e":[[0,1,0,15,0,0,[150,50,15,50]],[1,2],[2,3,-11.25,15,0,0,[73.75,116,135,133]],[2,4,-3.75,15,0,0,[81.25,116,185,133]],[2,5,3.75,15,0,0,[88.75,116,235,133]],[2,6,11.25,15,0,0,[96.25,116,285,133]],[1,7,[50,85,50,214]],[7,8,-11.25,15,0,0,[73.75,245,135,262]],[7,9,-3.75,15,0,0,[81.25,245,185,262]],[7,10,3.75,15,0,0,[88.75,245,235,262]],[7,11,11.25,15,0,0,[96.25,245,285,262]]],"vp":[0.0,0.0,300.0,308.0]}} - *

- *

- * Each layer in the tree uses different configurations of {@link yfiles.tree.DefaultNodePlacer} - *

- *

- * Features - *

- *

- * {@link yfiles.tree.SubtreeShape}s can be arranged in each main direction specified in - * {@link yfiles.tree.DefaultNodePlacer#childPlacement}. That way, the subtrees of the same graph can have different directions. - *

- *

- * This node placer aligns the local root node according to a chosen {@link yfiles.tree.DefaultNodePlacer#rootAlignment alignment}. - *

- *

- * There are various {@link yfiles.tree.DefaultNodePlacer#routingStyle routing styles} that result in different edge routes. - *

- * @class - * @extends {yfiles.tree.NodePlacerBase} - * @implements {yfiles.tree.IFromSketchNodePlacer} - * @implements {yfiles.lang.ICloneable} - */ - export interface DefaultNodePlacer extends yfiles.tree.NodePlacerBase,yfiles.tree.IFromSketchNodePlacer,yfiles.lang.ICloneable{} - export class DefaultNodePlacer { - /** - * Creates a new {@link yfiles.tree.DefaultNodePlacer} instance with custom settings. - * @param childPlacement the child placement specifier describing the style of the arrangement - * @param rootAlignment the alignment specifier describing how the root node is aligned with its child nodes - * @param routingStyle the routing style specifier - * @param verticalDistance the vertical distance between the {@link }s - * @param horizontalDistance the horizontal distance between the {@link }s - * @param minFirstSegmentLength the minimum length of the first edge segment (connected to the root node) - * @param minLastSegmentLength the minimum length of the last edge segment (connected to the child node) - * @param minSlope the minimum slope between the root node and the {@link }s - * @param minSlopeHeight the minimum vertical height of sloped edge segments - * @throws {Stubs.Exceptions.ArgumentError} if the placement specifier or the root alignment or the routing style is unknown or if the horizontal/vertical distance - * or the minimum first/last segment length or the minimum slope or the minimum vertical height is negative - * @see yfiles.tree.DefaultNodePlacer#childPlacement - * @see yfiles.tree.DefaultNodePlacer#rootAlignment - * @see yfiles.tree.DefaultNodePlacer#routingStyle - * @see yfiles.tree.DefaultNodePlacer#verticalDistance - * @see yfiles.tree.DefaultNodePlacer#horizontalDistance - * @see yfiles.tree.DefaultNodePlacer#minimumFirstSegmentLength - * @see yfiles.tree.DefaultNodePlacer#minimumLastSegmentLength - * @see yfiles.tree.DefaultNodePlacer#minimumSlope - * @see yfiles.tree.DefaultNodePlacer#minimumSlopeHeight - */ - constructor(childPlacement:yfiles.tree.ChildPlacement,rootAlignment:yfiles.tree.RootAlignment,routingStyle:yfiles.tree.RoutingStyle,verticalDistance:number,horizontalDistance:number,minFirstSegmentLength:number,minLastSegmentLength:number,minSlope:number,minSlopeHeight:number); - /** - * Creates a new {@link yfiles.tree.DefaultNodePlacer} instance with customized {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, {@link yfiles.tree.DefaultNodePlacer#rootAlignment root alignment}, {@link yfiles.tree.DefaultNodePlacer#routingStyle routing style}, {@link yfiles.tree.DefaultNodePlacer#verticalDistance vertical} - * and {@link yfiles.tree.DefaultNodePlacer#horizontalDistance horizontal distance}. - * @param childPlacement the child placement specifier describing the style of the arrangement - * @param rootAlignment the alignment specifier describing how the root node is aligned with its child nodes - * @param routingStyle the routing style specifier - * @param verticalDistance the vertical distance between the {@link }s - * @param horizontalDistance the horizontal distance between the {@link }s - * @throws {Stubs.Exceptions.ArgumentError} if the placement specifier or the root alignment or the routing style is unknown or if the horizontal/vertical distance - * is negative - * @see yfiles.tree.DefaultNodePlacer#childPlacement - * @see yfiles.tree.DefaultNodePlacer#rootAlignment - * @see yfiles.tree.DefaultNodePlacer#routingStyle - * @see yfiles.tree.DefaultNodePlacer#verticalDistance - * @see yfiles.tree.DefaultNodePlacer#horizontalDistance - */ - constructor(childPlacement:yfiles.tree.ChildPlacement,rootAlignment:yfiles.tree.RootAlignment,routingStyle:yfiles.tree.RoutingStyle,verticalDistance:number,horizontalDistance:number); - /** - * Creates a new {@link yfiles.tree.DefaultNodePlacer} instance with customized {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, {@link yfiles.tree.DefaultNodePlacer#rootAlignment root alignment}, {@link yfiles.tree.DefaultNodePlacer#verticalDistance vertical} and - * {@link yfiles.tree.DefaultNodePlacer#horizontalDistance horizontal distance}. - * @param childPlacement the child placement specifier describing the style of the arrangement - * @param rootAlignment the alignment specifier describing how the root node is aligned with its child nodes - * @param verticalDistance the vertical distance between the {@link }s - * @param horizontalDistance the horizontal distance between the {@link }s - * @throws {Stubs.Exceptions.ArgumentError} if the placement specifier or the root alignment specifier is unknown or if the horizontal/vertical distance is - * negative - * @see yfiles.tree.DefaultNodePlacer#childPlacement - * @see yfiles.tree.DefaultNodePlacer#rootAlignment - * @see yfiles.tree.DefaultNodePlacer#verticalDistance - * @see yfiles.tree.DefaultNodePlacer#horizontalDistance - */ - constructor(childPlacement:yfiles.tree.ChildPlacement,rootAlignment:yfiles.tree.RootAlignment,verticalDistance:number,horizontalDistance:number); - /** - * Creates a new {@link yfiles.tree.DefaultNodePlacer} instance with customized {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, {@link yfiles.tree.DefaultNodePlacer#verticalDistance vertical} and {@link yfiles.tree.DefaultNodePlacer#horizontalDistance horizontal distance}. - * @param childPlacement the child placement specifier describing the style of the arrangement - * @param verticalDistance the vertical distance between the {@link }s - * @param horizontalDistance the horizontal distance between the {@link }s - * @throws {Stubs.Exceptions.ArgumentError} if the placement specifier is unknown or if the horizontal/vertical distance is negative - * @see yfiles.tree.DefaultNodePlacer#childPlacement - * @see yfiles.tree.DefaultNodePlacer#verticalDistance - * @see yfiles.tree.DefaultNodePlacer#horizontalDistance - */ - constructor(childPlacement:yfiles.tree.ChildPlacement,verticalDistance:number,horizontalDistance:number); - /** - * Creates a new {@link yfiles.tree.DefaultNodePlacer} instance with default settings. - */ - constructor(); - /** - * Calculates the bends for the connector to the parent node. - *

- * This implementation adds bends to the connector for edges that route the edges around the child node in case there are - * {@link yfiles.layout.PortConstraint}s that conflict with the direction of the {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}. - *

- *

- * This method is called in {@link yfiles.tree.DefaultNodePlacer#placeSubtreeOfNode} to route the edges after the - * {@link yfiles.tree.SubtreeShape}s are arranged. It may be overridden to customize the routing style. - *

- * @param graph the input graph - * @param localRoot the local root node whose connector is calculated and stored in the given subtree shape - * @param rootLayout the {@link } of the root node - * @param subtreeShape the shape of the whole subtree of the local root - * @param parentEdge the incoming edge of the local root node that will be the connector for the given subtree shape - * @param parentEdgeLayout the current {@link } of the connector edge - * @param direction the direction specifier as defined in the {@link } interface which should be used for the connector - * @see yfiles.tree.NodePlacerBase#determineChildConnectors - * @protected - */ - calculateParentConnector(graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,rootLayout:yfiles.layout.INodeLayout,subtreeShape:yfiles.tree.SubtreeShape,parentEdge:yfiles.algorithms.Edge,parentEdgeLayout:yfiles.layout.IEdgeLayout,direction:number):void; - /** - * Calculates the routing of the source side of the edge to the given child node. - *

- * This method delegates to {@link yfiles.tree.DefaultNodePlacer#calculateSourceEdgeLayout} if the {@link yfiles.tree.DefaultNodePlacer#routingStyle routing style} is not - * {@link yfiles.tree.RoutingStyle#FORK}. It may be overridden to implement a custom routing style. - *

- * @param rootLayout the {@link } of the local root node - * @param childShape the {@link } instance of the corresponding child's subtree - * @param edge the edge - * @param rootForkCoordinate the y-coordinate of the first bend of the edge if the placement is horizontal, the x-coordinate otherwise - * @param childForkCoordinate the y-coordinate of the second (= last) bend of the edge if the placement is horizontal, the x-coordinate otherwise - * @protected - */ - calculateSlopedSourceEdgeLayout(rootLayout:yfiles.layout.INodeLayout,childShape:yfiles.tree.SubtreeShape,edge:yfiles.algorithms.Edge,childForkCoordinate:number,rootForkCoordinate:number):void; - /** - * Calculates the routing of the source side of the edge to the given child node. - *

- * This implementation adds bends to the {@link yfiles.layout.IEdgeLayout} of the given edge according to the specified {@link yfiles.tree.DefaultNodePlacer#routingStyle routing style} - * and {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}. It also updates the target points in the {@link yfiles.tree.SubtreeShape}. - *

- *

- * This method is called by {@link yfiles.tree.DefaultNodePlacer#calculateSlopedSourceEdgeLayout} to route the edges. It may be - * overridden to implement a custom edge routing style. - *

- * @param rootLayout the {@link } of the local root node - * @param childShape the {@link } of the child's subtree that is connected through the given edge - * @param edge the edge - * @protected - */ - calculateSourceEdgeLayout(rootLayout:yfiles.layout.INodeLayout,childShape:yfiles.tree.SubtreeShape,edge:yfiles.algorithms.Edge):void; - /** - * Calculates the routing of the target side of the edge to the given child node. - *

- * This implementation just resets the current {@link yfiles.layout.IEdgeLayout}. - *

- *

- * This method is called by {@link yfiles.tree.DefaultNodePlacer#placeSubtreeOfNode} after the {@link yfiles.tree.SubtreeShape shapes} of the local root's children - * are placed. It may be overridden to add some {@link yfiles.tree.SubtreeShape#addTargetPoint target points} to the edge. - *

- * @param rootLayout the {@link } of the local root node - * @param childShape the {@link } of the child's subtree that is connected through the given edge - * @param edge the edge - * @protected - */ - calculateTargetEdgeLayout(rootLayout:yfiles.layout.INodeLayout,childShape:yfiles.tree.SubtreeShape,edge:yfiles.algorithms.Edge):void; - /** - * Creates a {@link yfiles.collections.IComparer.} for outgoing edges which takes the initial coordinates of the edges' targets into account. - *

- * Child nodes are sorted in a way that the layout will resemble the current arrangement of the nodes. This is especially - * useful for interactive or incremental layout calculation. - *

- * @returns a {@link } that considers the initial coordinates of the nodes - */ - createComparer():yfiles.collections.IComparer; - /** - * Delegates to {@link yfiles.tree.DefaultNodePlacer#createComparer}. - * @returns the From Sketch {@link } - * @see yfiles.tree.DefaultNodePlacer#createComparer - */ - createFromSketchComparer():yfiles.collections.IComparer; - /** - * Gets or sets the direction in which the child nodes are placed with respect to their parent node. - *

- * Subtrees can be placed below, above, left or right of their roots. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an unknown placement specifier is set - * @type {yfiles.tree.ChildPlacement} - */ - childPlacement:yfiles.tree.ChildPlacement; - /** - * Gets or sets how the root node is aligned with its children and their {@link yfiles.tree.SubtreeShape}s. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown root alignment specifier is set - * @type {yfiles.tree.RootAlignment} - */ - rootAlignment:yfiles.tree.RootAlignment; - /** - * Gets or sets the relative vertical alignment of nodes with the same parent. - *

- * All values between 0 and 1 result in a valid alignment. - *

- *
    - *
  • 0 - nodes are top-aligned
  • - *
  • 0.5 - nodes are center-aligned
  • - *
  • 1 - nodes are bottom-aligned
  • - *
- *

- * Values outside the interval [0,1] will result in a more compact node placement with unaligned nodes. - *

- * @type {number} - */ - verticalAlignment:number; - /** - * Gets or sets the style in which edge paths are routed. - * @throws {Stubs.Exceptions.ArgumentError} if the specified routing style is unknown - * @type {yfiles.tree.RoutingStyle} - */ - routingStyle:yfiles.tree.RoutingStyle; - /** - * Gets or sets the vertical distance between nodes or {@link yfiles.tree.SubtreeShape}s. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - verticalDistance:number; - /** - * Gets or sets the minimum length for the first segment of an edge. - *

- * During layout calculation, the edges of the tree are directed. Hence, the first segment is always the segment that is - * attached to the source, which is the local root node. - *

- *

- * The length needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum segment length is negative - * @type {number} - */ - minimumFirstSegmentLength:number; - /** - * Gets or sets the minimum length for the last segment of an edge. - *

- * During layout calculation, the edges of the tree are directed. Hence, the last segment is always the segment that is - * attached to the target, which is a child node. - *

- *

- * The length needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum segment length is negative - * @type {number} - */ - minimumLastSegmentLength:number; - /** - * Gets or sets the minimum slope of the edge segments. - *

- * These sloped segments are between the vertical first and last segment of the edge. - *

- *

- * The segments may become steeper but they will have at least the specified slope. Negative minimum slopes can lead to - * edge routes looking like spider legs. - *

- * @see yfiles.tree.DefaultNodePlacer#minimumSlopeHeight - * @type {number} - */ - minimumSlope:number; - /** - * Gets or sets the minimum height for sloped edge segments. - *

- * These sloped segments are between the vertical first and last segment of the edge. - *

- *

- * The segments may become steeper to reach the specified height. - *

- * @see yfiles.tree.DefaultNodePlacer#minimumSlope - * @type {number} - */ - minimumSlopeHeight:number; - /** - * Gets or sets the horizontal distance between nodes or {@link yfiles.tree.SubtreeShape}s. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - horizontalDistance:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.DefaultNodePlacer; - } - /** - * The {@link yfiles.tree.DefaultPortAssignment} provides some simple {@link yfiles.tree.DefaultPortAssignment#mode port assignment styles}. - *

- * Ports are either {@link yfiles.tree.PortAssignmentMode#NONE centered} on the node, distributed at one side of the node or placed considering - * {@link yfiles.layout.PortConstraint}s. - *

- * @class - * @implements {yfiles.tree.IPortAssignment} - */ - export interface DefaultPortAssignment extends yfiles.lang.Object,yfiles.tree.IPortAssignment{} - export class DefaultPortAssignment { - /** - * Creates a new {@link yfiles.tree.DefaultPortAssignment} instance using the given port assignment mode and ratio between the - * border and the ports and the gap between the ports themselves. - * @param mode one of the predefined port assignment specifiers - * @param [ratio=0.5] the ratio of the distance between outer ports and the border to the distance between any two ports - * @throws {Stubs.Exceptions.ArgumentError} if an unknown mode is specified or if the specified ratio is negative - */ - constructor(mode:yfiles.tree.PortAssignmentMode,ratio?:number); - /** - * Creates a new {@link yfiles.tree.DefaultPortAssignment} instance with default settings. - */ - constructor(); - /** - * Assigns relative coordinates to the source port of the outgoing edge to a child of the given node. - *

- * This method is called by {@link yfiles.tree.DefaultPortAssignment#assignPorts} for each outgoing edge of the given node. It may - * be overridden to assign a custom location to the source port of outgoing edges. - *

- * @param graph the input graph - * @param node the node - * @param edge the edge to the child node - * @param index the zero-based index of the child edge - * @see yfiles.layout.IEdgeLayout#sourcePoint - * @protected - */ - assignChildEdgeSourcePort(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge,index:number):void; - /** - * Assigns relative coordinates to the target port of the incoming edge from the parent of the given node. - *

- * This method is called by {@link yfiles.tree.DefaultPortAssignment#assignPorts} if the given node has a parent node. It may be - * overridden to assign a custom location to the target port of the incoming edge. - *

- * @param graph the input graph - * @param node the node - * @param edge the edge from the parent node - * @see yfiles.layout.IEdgeLayout#targetPoint - * @protected - */ - assignParentEdgeTargetPort(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge):void; - /** - * Places the ports of edges connecting to the given node according to the {@link yfiles.tree.DefaultPortAssignment#mode port assignment mode}. - * @param graph the input graph - * @param node the node whose adjacent edges' ports should be placed - * @see yfiles.tree.DefaultPortAssignment#mode - */ - assignPorts(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):void; - /** - * Determines the distance between the outer ports and the border of the node. - *

- * This implementation calculates the gap according to the number of edges at one side of the node. It also includes the - * {@link yfiles.tree.DefaultPortAssignment#borderGapToPortGapRatio ratio between border gap and port gap}. - *

- *

- * This method is called by {@link yfiles.tree.DefaultPortAssignment#assignChildEdgeSourcePort} to calculate the location of the - * first port. It may be overridden to implement a different distribution of ports on the node's side. - *

- * @param sideLength the width/height of the side - * @param edgeCount the number of edges that connect to this side - * @returns the absolute gap to be used on both sides of the ports - * @see yfiles.tree.DefaultPortAssignment#assignChildEdgeSourcePort - * @see yfiles.tree.DefaultPortAssignment#borderGapToPortGapRatio - * @protected - */ - getPortBorderGap(sideLength:number,edgeCount:number):number; - /** - * Determines the distance between two adjacent ports. - *

- * This implementation calculates the gap according to the number of edges at one side of the node. The edges are - * distributed keeping the given gap to the border of the node. - *

- *

- * This method is called by {@link yfiles.tree.DefaultPortAssignment#assignChildEdgeSourcePort} to calculate the distance between - * two ports. It may be overridden to implement a different distribution of ports on the node's side. - *

- * @param sideLength the width/height of the side - * @param edgeCount the number of edges/ports that connect to this side - * @param portBorderGap the port border gap (i.e. calculated by {@link #getPortBorderGap}) - * @returns the absolute distance to be used between two adjacent ports - * @see yfiles.tree.DefaultPortAssignment#assignChildEdgeSourcePort - * @see yfiles.tree.DefaultPortAssignment#getPortBorderGap - * @protected - */ - getPortDistanceDelta(sideLength:number,edgeCount:number,portBorderGap:number):number; - /** - * Retrieves the source {@link yfiles.layout.PortConstraint} for the given edge. - *

- * This implementation accesses the {@link yfiles.algorithms.IDataProvider} registered with - * {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY}. - *

- *

- * This method is called by {@link yfiles.tree.DefaultPortAssignment#assignChildEdgeSourcePort} in - * {@link yfiles.tree.PortAssignmentMode#PORT_CONSTRAINT}. - *

- * @param graph the input graph - * @param edge the edge - * @param index the index of the child that is the target of the given edge - * @returns the source {@link } or null if no source {@link } is specified - * @see yfiles.layout.PortConstraint - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @see yfiles.tree.DefaultPortAssignment#assignChildEdgeSourcePort - * @protected - */ - getSourcePortConstraint(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge,index:number):yfiles.layout.PortConstraint; - /** - * Retrieves the target {@link yfiles.layout.PortConstraint} for the given edge. - *

- * This implementation accesses the {@link yfiles.algorithms.IDataProvider} registered with - * {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY}. - *

- *

- * This method is called by {@link yfiles.tree.DefaultPortAssignment#assignParentEdgeTargetPort} in - * {@link yfiles.tree.PortAssignmentMode#PORT_CONSTRAINT}. - *

- * @param graph the input graph - * @param edge the edge - * @returns the target {@link } or null if no target {@link } is specified - * @see yfiles.layout.PortConstraint - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @see yfiles.tree.DefaultPortAssignment#assignParentEdgeTargetPort - * @protected - */ - getTargetPortConstraint(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):yfiles.layout.PortConstraint; - /** - * Gets or sets the mode that describes how ports are placed. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown mode is specified - * @type {yfiles.tree.PortAssignmentMode} - */ - mode:yfiles.tree.PortAssignmentMode; - /** - * Gets or sets the ratio of the border gap (distance between the outer ports to the node border) to the port gap (distance between adjacent - * ports). - *

- * The ratio must have a positive value. When the ratio is 0 the ports will be distributed along the whole side of the node - * without a gap between the last port and the corner. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified ratio is negative - * @type {number} - */ - borderGapToPortGapRatio:number; - /** - * Gets or sets whether or not the port assignment should reverse the order of the ports. - *

- * The normal order is from left to right and from top to bottom. It will be reversed if this option is enabled. - *

- * @type {boolean} - */ - reversedPortOrder:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.DefaultPortAssignment; - } - /** - * {@link yfiles.tree.DelegatingNodePlacer} delegates the arrangement of the children to two different {@link yfiles.tree.INodePlacer}s. - *

- * Layout Style This {@link yfiles.tree.INodePlacer} can, for example, be used for creating mind maps or a playing schedule of a sports - * competition. {@graph {"ann":{"s":[130,30],"d":1},"n":[[662,400,[[669.97,424.35,114.05,18.7]]],[662,175,[[669.97,199.35,114.05,18.7]]],[662,625,[[685.65,649.35,82.7,18.7]]],[812,175,[[829.98,199.35,94.04,18.7]]],[982,275,[[999.98,299.35,94.04,18.7]]],[812,625,[[835.65,649.35,82.7,18.7]]],[512,175,[[519.97,199.35,114.05,18.7]]],[982,725,[[1010.64,749.35,72.71,18.7]]],[1152,775,[[1180.64,799.35,72.71,18.7]]],[1322,800,[[1341.97,824.35,90.05,18.7]]],[982,75,[[1004.32,99.35,85.37,18.7]]],[1152,675,[[1163.65,699.35,106.71,18.7]]],[1152,325,[[1177.32,349.35,79.36,18.7]]],[982,525,[[1005.65,549.35,82.7,18.7]]],[1152,125,[[1190.32,149.35,53.37,18.7]]],[1152,575,[[1175.65,599.35,82.7,18.7]]],[1322,350,[[1347.32,374.35,79.36,18.7]]],[1322,150,[[1343.65,174.35,86.7,18.7]]],[1322,300,[[1347.32,324.35,79.36,18.7]]],[1152,225,[[1169.98,249.35,94.04,18.7]]],[1152,25,[[1174.32,49.35,85.37,18.7]]],[342,75,[[372.66,99.35,68.69,18.7]]],[1152,475,[[1165.65,499.35,102.7,18.7]]],[1322,500,[[1326,524.35,122.06,18.7]]],[1322,250,[[1339.98,274.35,94.04,18.7]]],[1322,600,[[1330.31,624.35,113.38,18.7]]],[172,25,[[188.64,49.35,96.72,18.7]]],[342,275,[[349.97,299.35,114.05,18.7]]],[2,0,[[26.32,24.35,81.36,18.7]]],[1322,550,[[1345.65,574.35,82.7,18.7]]],[172,125,[[202.66,149.35,68.69,18.7]]],[1322,200,[[1344.32,224.35,85.36,18.7]]],[2,100,[[32.32,124.35,69.37,18.7]]],[1322,450,[[1335.65,474.35,102.7,18.7]]],[1322,750,[[1350.64,774.35,72.71,18.7]]],[512,625,[[532.65,649.35,88.69,18.7]]],[172,225,[[179.97,249.35,114.05,18.7]]],[1322,700,[[1329.63,724.35,114.74,18.7]]],[172,325,[[200.98,349.35,72.03,18.7]]],[1322,50,[[1344.32,74.35,85.37,18.7]]],[2,300,[[4.98,324.35,124.05,18.7]]],[2,50,[[18.64,74.35,96.72,18.7]]],[2,150,[[32.66,174.35,68.69,18.7]]],[1322,650,[[1333.65,674.35,106.71,18.7]]],[1322,0,[[1356.66,24.35,60.69,18.7]]],[1322,100,[[1360.32,124.35,53.37,18.7]]],[342,525,[[347.31,549.35,119.39,18.7]]],[172,475,[[171.97,499.35,130.06,18.7]]],[2,350,[[30.98,374.35,72.03,18.7]]],[2,450,[[1.97,474.35,130.06,18.7]]],[342,725,[[362.65,749.35,88.69,18.7]]],[2,200,[[25.31,224.35,83.37,18.7]]],[172,575,[[177.31,599.35,119.39,18.7]]],[172,675,[[197.32,699.35,79.35,18.7]]],[2,500,[[15.98,524.35,102.04,18.7]]],[2,550,[[14.63,574.35,104.73,18.7]]],[2,600,[[7.31,624.35,119.39,18.7]]],[2,250,[[9.97,274.35,114.05,18.7]]],[172,775,[[192.65,799.35,88.69,18.7]]],[2,750,[[22.65,774.35,88.69,18.7]]],[2,800,[[16.64,824.35,100.72,18.7]]],[2,650,[[11.97,674.35,110.07,18.7]]],[2,700,[[27.32,724.35,79.35,18.7]]]],"e":[[0,1],[0,2],[1,3],[3,4,[954,190,954,290]],[2,5],[1,6],[5,7,[954,640,954,740]],[7,8,[1124,740,1124,790]],[8,9,[1294,790,1294,815]],[3,10,[954,190,954,90]],[7,11,[1124,740,1124,690]],[4,12,[1124,290,1124,340]],[5,13,[954,640,954,540]],[10,14,[1124,90,1124,140]],[13,15,[1124,540,1124,590]],[12,16,[1294,340,1294,365]],[14,17,[1294,140,1294,165]],[12,18,[1294,340,1294,315]],[4,19,[1124,290,1124,240]],[10,20,[1124,90,1124,40]],[6,21,[500,190,500,90]],[13,22,[1124,540,1124,490]],[22,23,[1294,490,1294,515]],[19,24,[1294,240,1294,265]],[15,25,[1294,590,1294,615]],[21,26,[330,90,330,40]],[6,27,[500,190,500,290]],[26,28,[160,40,160,15]],[15,29,[1294,590,1294,565]],[21,30,[330,90,330,140]],[19,31,[1294,240,1294,215]],[30,32,[160,140,160,115]],[22,33,[1294,490,1294,465]],[8,34,[1294,790,1294,765]],[2,35],[27,36,[330,290,330,240]],[11,37,[1294,690,1294,715]],[27,38,[330,290,330,340]],[20,39,[1294,40,1294,65]],[38,40,[160,340,160,315]],[26,41,[160,40,160,65]],[30,42,[160,140,160,165]],[11,43,[1294,690,1294,665]],[20,44,[1294,40,1294,15]],[14,45,[1294,140,1294,115]],[35,46,[500,640,500,540]],[46,47,[330,540,330,490]],[38,48,[160,340,160,365]],[47,49,[160,490,160,465]],[35,50,[500,640,500,740]],[36,51,[160,240,160,215]],[46,52,[330,540,330,590]],[50,53,[330,740,330,690]],[47,54,[160,490,160,515]],[52,55,[160,590,160,565]],[52,56,[160,590,160,615]],[36,57,[160,240,160,265]],[50,58,[330,740,330,790]],[58,59,[160,790,160,765]],[58,60,[160,790,160,815]],[53,61,[160,690,160,665]],[53,62,[160,690,160,715]]],"vp":[1.0,0.0,1451.0,830.0]}} - *

- *

- * There are two subtrees that are placed above and below the root; Both subtrees consist of two subtrees that are placed - * left and right of their local root - *

- * @class - * @extends {yfiles.tree.RotatableNodePlacerBase} - */ - export interface DelegatingNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} - export class DelegatingNodePlacer { - /** - * Creates a new {@link yfiles.tree.DefaultNodePlacer} instance with default settings using the given modification matrix and the - * given node placers as delegates. - * @param modificationMatrix the transformation matrix - * @param placerUpperLeft the first delegate {@link } which places the left subtrees - * @param placerLowerRight the second delegate {@link } which places the right subtrees - * @see yfiles.tree.DelegatingNodePlacer#PRIMARY_NODES_DP_KEY - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix,placerUpperLeft:yfiles.tree.INodePlacer,placerLowerRight:yfiles.tree.INodePlacer); - /** - * Returns all upper-left children of the local root node. - *

- * Which children belong to this list is determined using the {@link yfiles.algorithms.IDataProvider} registered with - * {@link yfiles.tree.DelegatingNodePlacer#PRIMARY_NODES_DP_KEY}. If no such {@link yfiles.algorithms.IDataProvider} is registered, the - * first half of the children is returned. - *

- *

- * These children are placed using the {@link yfiles.tree.INodePlacer} returned by {@link yfiles.tree.DelegatingNodePlacer#primaryPlacer}. - *

- * @param localRoot the local root node - * @param graph the input graph - * @returns the list of upper-left child {@link }s - * @see yfiles.tree.DelegatingNodePlacer#PRIMARY_NODES_DP_KEY - */ - primaryChildren(localRoot:yfiles.algorithms.Node,graph:yfiles.layout.LayoutGraph):yfiles.algorithms.NodeList; - /** - * Returns all lower-right children of the local root node. - *

- * Which children belong to this list is determined using the {@link yfiles.algorithms.IDataProvider} registered with - * {@link yfiles.tree.DelegatingNodePlacer#PRIMARY_NODES_DP_KEY}. If no such {@link yfiles.algorithms.IDataProvider} is registered, the - * second half of the children is returned. - *

- *

- * These children are placed using the {@link yfiles.tree.INodePlacer} returned by {@link yfiles.tree.DelegatingNodePlacer#secondaryPlacer}. - *

- * @param localRoot the local root node - * @param graph the input graph - * @returns the list of lower-right child {@link }s - * @see yfiles.tree.DelegatingNodePlacer#PRIMARY_NODES_DP_KEY - */ - secondaryChildren(localRoot:yfiles.algorithms.Node,graph:yfiles.layout.LayoutGraph):yfiles.algorithms.NodeList; - /** - * Data provider key for dividing the children into two sets - *

- * If there is no {@link yfiles.algorithms.IDataProvider} registered with this key, half of the nodes are placed left of the root - * and the remaining nodes are placed right of the root. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static PRIMARY_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets the {@link yfiles.tree.INodePlacer} instance that will arrange the lower-right part of the graph. - * @see yfiles.tree.DelegatingNodePlacer#primaryPlacer - * @see yfiles.tree.DelegatingNodePlacer#secondaryChildren - * @type {yfiles.tree.INodePlacer} - */ - secondaryPlacer:yfiles.tree.INodePlacer; - /** - * Gets the {@link yfiles.tree.INodePlacer} instance that will arrange the upper-left part of the graph. - * @see yfiles.tree.DelegatingNodePlacer#secondaryPlacer - * @see yfiles.tree.DelegatingNodePlacer#primaryChildren - * @type {yfiles.tree.INodePlacer} - */ - primaryPlacer:yfiles.tree.INodePlacer; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.DelegatingNodePlacer; - } - /** - * The {@link yfiles.tree.DendrogramNodePlacer} arranges subtrees as dendrograms. - *

- * Layout Style This {@link yfiles.tree.INodePlacer} arranges nodes from top to bottom. It arranges subtrees in such a way that all subtrees of - * a single local root are aligned with their bottom border. {@graph {"ann":{"s":[30,30],"d":1},"n":[[212.5,0],[400,70],[450,140],[300,210],[400,210],[450,210],[150,140],[25,70],[200,280],[150,280],[50,210],[450,280],[350,280],[25,140],[100,210],[400,280],[0,280],[300,280],[50,280],[100,280],[250,280]],"e":[[0,1,[227.5,50,415,50]],[1,2,[415,120,465,120]],[0,3,[227.5,50,315,50]],[1,4],[2,5],[0,6,[227.5,50,165,50]],[0,7,[227.5,50,40,50]],[6,8,[165,190,215,190]],[6,9],[5,11],[1,12,[415,120,365,120]],[7,13],[13,10,[40,190,65,190]],[6,14,[165,190,115,190]],[4,15],[13,16,[40,190,15,190]],[3,17],[10,18],[14,19],[0,20,[227.5,50,265,50]]],"vp":[0.0,0.0,480.0,310.0]}} - *

- *

- * Note: This implementation does not support {@link yfiles.layout.PortConstraint}s. - *

- * @class - * @implements {yfiles.tree.IFromSketchNodePlacer} - */ - export interface DendrogramNodePlacer extends yfiles.lang.Object,yfiles.tree.IFromSketchNodePlacer{} - export class DendrogramNodePlacer { - /** - * Creates a new {@link yfiles.tree.DendrogramNodePlacer} instance with default settings. - */ - constructor(); - /** - * Creates a {@link yfiles.collections.IComparer.} that sorts outgoing edges according to the x-coordinate of their target nodes. - *

- * This {@link yfiles.collections.IComparer.} can be used for achieving a From Sketch layout. - *

- * @returns the {@link } - * @see yfiles.tree.DendrogramNodePlacer#createFromSketchComparer - */ - createComparer():yfiles.collections.IComparer; - /** - * Creates a {@link yfiles.collections.IComparer.} for the edges which takes the initial x-coordinates of the nodes into account. - *

- * This implementation delegates to {@link yfiles.tree.DendrogramNodePlacer#createComparer}. - *

- * @returns the {@link } for the edges - * @see yfiles.tree.DendrogramNodePlacer#createComparer - */ - createFromSketchComparer():yfiles.collections.IComparer; - /** - * Creates an optional {@link yfiles.tree.IProcessor} for pre- and post-processing. - *

- * This implementation returns null. Hence, no pre- or post-processing is done. - *

- * @param layouter the current {@link } instance - * @param graph the input graph - * @param currentRoot the root node handled by this {@link } - * @returns null - */ - createProcessor(layouter:yfiles.tree.TreeLayout,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; - /** - * Provides {@link yfiles.tree.ParentConnectorDirection#NORTH} for all children. - *

- * Edges will always connect to the top of the child nodes. - *

- * @param localRoot the local root node - * @param connectorMap the map that is used for storing the direction specifiers of the child nodes - */ - determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; - /** - * Arranges the {@link yfiles.tree.SubtreeShape SubtreeShapes} of the local root and its children as a dendrogram. - * @param nodeShapeProvider the {@link } for obtaining an initial shape of the root node - * @param subtreeShapeProvider the {@link } for accessing the pre-calculated shapes of the subtrees - * @param graph the input graph - * @param localRoot the root of the subtree that should be arranged by this method - * @param parentConnectorDirection the direction specifier for the connector of the local root node to its parent node - * @returns the combined shape of the whole subtree rooted at the given local root node - */ - placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShape; - /** - * Gets or sets the minimum distance between the {@link yfiles.tree.SubtreeShape} of a root node and the bus connecting to all of - * its children. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - minimumRootDistance:number; - /** - * Gets or sets the minimum horizontal distance between adjacent {@link yfiles.tree.SubtreeShape SubtreeShapes}. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - minimumSubtreeDistance:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.DendrogramNodePlacer; - } - /** - * The {@link yfiles.tree.DoubleLineNodePlacer} arranges the children of a local root alternating in two lines. - *

- * Layout Style This {@link yfiles.tree.INodePlacer} arranges nodes from top to bottom. It places the subtrees in two horizontal lines below - * the root. They are distributed in an alternating fashion, i.e., adjacent subtrees are in different lines. - *

- *

- * This node placer is especially useful for leaves with a large width. - *

- *

- * {@graph {"ann":{"s":[141.67,30],"d":1},"n":[[298.33,0,60,30],[0,60],[85.83,99.9],[171.67,60],[257.5,99.9],[343.33,60],[429.17,99.9],[515,60]],"e":[[0,1,[70.83,15]],[0,2,[156.67,15]],[0,3,[242.5,15]],[0,4],[0,5,[414.17,15]],[0,6,[500,15]],[0,7,[585.83,15]]],"vp":[0.0,0.0,657.0,130.0]}} - *

- * @class - * @extends {yfiles.tree.RotatableNodePlacerBase} - */ - export interface DoubleLineNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} - export class DoubleLineNodePlacer { - /** - * Creates a new {@link yfiles.tree.DoubleLineNodePlacer} instance whose direction is specified by the given modification matrix. - * @param modificationMatrix the transformation matrix for this {@link } - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix); - /** - * Creates a new {@link yfiles.tree.DoubleLineNodePlacer} instance with the default settings. - */ - constructor(); - /** - * Gets or sets the {@link yfiles.tree.RootNodeAlignment RootAlginment} that defines how the root node is aligned with its children and their shapes. - * @type {yfiles.tree.RootNodeAlignment} - */ - rootAlignment:yfiles.tree.RootNodeAlignment; - /** - * Gets or sets the ratio of the {@link yfiles.tree.RotatableNodePlacerBase#spacing spacing} between the root and the children in the upper line and the spacing between the - * two lines of subtrees. - * @type {number} - */ - doubleLineSpacingRatio:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.DoubleLineNodePlacer; - } - /** - * A {@link yfiles.tree.FreeNodePlacer} is a simple pseudo-placer. - *

- * The children of local root nodes are not moved. The {@link yfiles.tree.INodePlacer} just merges their rotated shapes and routes - * the edges. - *

- *

- * This {@link yfiles.tree.INodePlacer} may be useful if a local root node does not have any children or you want to place them - * manually. - *

- * @class - * @extends {yfiles.tree.RotatableNodePlacerBase} - */ - export interface FreeNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} - export class FreeNodePlacer { - /** - * Creates a new instance of {@link yfiles.tree.FreeNodePlacer} with default settings. - */ - constructor(); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.FreeNodePlacer; - } - /** - * The {@link yfiles.tree.GridNodePlacer} arranges the shapes of the children of a local root in a grid. - *

- * Layout Style The grid consists of a number of rows. The subtrees are assigned to the rows using a {@link yfiles.algorithms.IDataProvider} - * that is registered with the graph with {@link yfiles.tree.GridNodePlacer#ROW_INDEX_DP_KEY}. {@graph {"ann":{"s":[30,30],"d":1},"n":[[0,0],[50,140],[50,210],[50,70],[100,140],[100,210],[100,70],[150,140],[150,210],[150,70],[200,140],[200,210],[200,70]],"e":[[0,1,[40,15,40,120,65,120]],[0,2,[40,15,40,190,65,190]],[0,3,[40,15,40,50,65,50]],[0,4,[40,15,40,120,115,120]],[0,5,[40,15,40,190,115,190]],[0,6,[40,15,40,50,115,50]],[0,7,[40,15,40,120,165,120]],[0,8,[40,15,40,190,165,190]],[0,9,[40,15,40,50,165,50]],[0,10,[40,15,40,120,215,120]],[0,11,[40,15,40,190,215,190]],[0,12,[40,15,40,50,215,50]]],"vp":[0.0,0.0,230.0,240.0]}} - *

- *

- * Child nodes placed in a grid using three rows and four columns - *

- * @class - * @extends {yfiles.tree.RotatableNodePlacerBase} - */ - export interface GridNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} - export class GridNodePlacer { - /** - * Creates a new {@link yfiles.tree.GridNodePlacer} instance with the given {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix modification matrix} and {@link yfiles.tree.GridNodePlacer#rootAlignment root alignment}. - * @param modificationMatrix the transformation matrix for this {@link } - * @param rootAlignment the alignment of the local root with its subtrees - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix,rootAlignment:yfiles.tree.RootNodeAlignment); - /** - * Creates a new {@link yfiles.tree.GridNodePlacer} instance whose direction is specified by the given modification matrix. - * @param modificationMatrix the transformation matrix for this {@link } - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix); - /** - * Creates a new {@link yfiles.tree.GridNodePlacer} with default settings. - */ - constructor(); - /** - * Data provider key for assigning nodes to the rows in the grid - *

- * If no {@link yfiles.algorithms.IDataProvider} is registered with this key, all nodes will be placed in the same row. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static ROW_INDEX_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets the {@link yfiles.tree.RootNodeAlignment RootAlginment} that defines how the root node is aligned with its children and their shapes. - * @type {yfiles.tree.RootNodeAlignment} - */ - rootAlignment:yfiles.tree.RootNodeAlignment; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.GridNodePlacer; - } - /** - * This {@link yfiles.tree.INodePlacer} places the children of a local root in groups. - *

- * The groups are determined by the grouping of the edges that connect the children to its root. The placement of the - * groups is specified by a {@link yfiles.tree.INodePlacer} which will consider grouped children as one child. The children within - * a group are placed by another {@link yfiles.tree.INodePlacer}. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[70.15,0,91.19,30],[0,91],[111,91],[201.5,91],[0,141],[111,141],[201.5,141]],"e":[[0,1,-30,15,0,0,[85.75,50,50,50,50,106]],[0,2,0,15,0,0,[115.75,50,91,50,91,106]],[0,3,30,15,0,0,[145.75,50,181.5,50,181.5,106]],[0,4,-30,15,0,0,[85.75,50,50,50,50,156]],[0,5,0,15,0,0,[115.75,50,91,50,91,156]],[0,6,30,15,0,0,[145.75,50,181.5,50,181.5,156]]],"vp":[0.0,0.0,232.0,171.0]}} There are three edge groups whose target nodes are placed above each other - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @class - * @implements {yfiles.tree.INodePlacer} - */ - export interface GroupedNodePlacer extends yfiles.lang.Object,yfiles.tree.INodePlacer{} - export class GroupedNodePlacer { - /** - * Creates a new {@link yfiles.tree.GroupedNodePlacer} instance. - * @param groupPlacer the {@link } which places the child groups - * @param childPlacer the {@link } which places the children within their group - */ - constructor(groupPlacer:yfiles.tree.INodePlacer,childPlacer:yfiles.tree.INodePlacer); - /** - * Creates a {@link yfiles.tree.IProcessor} that prepares the graph for edge grouping. - *

- * In a pre-processing step, the {@link yfiles.tree.IProcessor} inserts a dummy node for each edge group and connects it to the - * local root and the edges of the according group. The child node placer is assigned to those dummy nodes and will arrange - * them during the layout calculation. - *

- *

- * The changes to the graph are restored in a post-processing step. - *

- * @param layouter the current {@link } instance - * @param graph the input graph - * @param currentRoot the root node handled by this {@link } - * @returns the {@link } responsible for preparing the graph - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - */ - createProcessor(layouter:yfiles.tree.TreeLayout,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; - /** - * Delegates to the {@link yfiles.tree.INodePlacer} responsible for arranging the nodes in one group. - * @param localRoot the local root node - * @param connectorMap the map used for storing the direction specifiers of the child nodes - */ - determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; - /** - * Places the groups of {@link yfiles.tree.SubtreeShape}s according to their group IDs. - * @param nodeShapeProvider the {@link } for obtaining an initial shape of the root node - * @param subtreeShapeProvider the {@link } for accessing the pre-calculated shapes of the subtrees - * @param graph the input graph - * @param localRoot the root of the subtree that should be arranged by this method - * @param parentConnectorDirection the direction specifier for the connector of the local root node to its parent node - * @returns the merged {@link }s of the local root and its children - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - */ - placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShape; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.GroupedNodePlacer; - } - /** - * A {@link yfiles.tree.IFromSketchNodePlacer} arranges the subtrees while taking the initial locations of the nodes into account. - *

- * It provides a {@link yfiles.collections.IComparer.} which sorts the outgoing edges of a node according to the initial coordinates of their target nodes. - * Keeping the original order of nodes, this {@link yfiles.collections.IComparer.} allows to incrementally add new nodes to the graph. - *

- * @interface - * @implements {yfiles.tree.INodePlacer} - */ - export interface IFromSketchNodePlacer extends yfiles.lang.Object,yfiles.tree.INodePlacer{ - /** - * Creates an {@link yfiles.collections.IComparer. edge comparator} which takes the initial coordinates of the nodes into account. - *

- * This {@link yfiles.collections.IComparer.} defines the order of the outgoing edges of a node before the actual placement of the node's subtree is - * calculated. - *

- * @returns the {@link } for the edges - * @abstract - */ - createFromSketchComparer():yfiles.collections.IComparer; - } - var IFromSketchNodePlacer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.tree.IFromSketchNodePlacer; - }; - /** - * A {@link yfiles.tree.INodePlacer} is responsible for the arrangement of a local root node and all of its subtrees. - *

- * Subtrees are represented as {@link yfiles.tree.SubtreeShape SubtreeShape}s with a connecting edge to the root of the subtree. - *

- *

- * Implementations of this interface have to: - *

- *
    - *
  • - * arrange the {@link yfiles.tree.SubtreeShape SubtreeShapes} and the root node (only the relative position matters, shapes can be placed at any absolute - * location, {@link yfiles.tree.TreeLayout} will perform the final alignment). - *
  • - *
  • - * perform the edge routing from the root node to all child nodes with respect to the connector provided by the - * {@link yfiles.tree.SubtreeShape SubtreeShapes} - *
  • - *
  • calculate the union of the {@link yfiles.tree.SubtreeShape SubtreeShapes} and the shape of the root node as well as any added edges
  • - *
  • initialize the connector of the root node with respect to the preferred connection direction
  • - *
  • return the {@link yfiles.tree.SubtreeShape SubtreeShape} for the subtree including the local root
  • - *
- * @interface - */ - export interface INodePlacer extends yfiles.lang.Object{ - /** - * Creates an optional {@link yfiles.tree.IProcessor} for pre- and post-processing. - *

- * This method is called by {@link yfiles.tree.TreeLayout} before arranging the {@link yfiles.tree.SubtreeShape SubtreeShapes}. If no pre- or post-processing is - * needed, this method may return null. - *

- * @param layouter the current {@link } instance - * @param graph the input graph - * @param currentRoot the root node handled by this {@link } - * @returns a {@link } instance or null - * @abstract - */ - createProcessor(layouter:yfiles.tree.TreeLayout,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; - /** - * Provides the direction of the connector to the {@link yfiles.tree.SubtreeShape SubtreeShape} for each child node. - *

- * This method is called by {@link yfiles.tree.TreeLayout} before the {@link yfiles.tree.SubtreeShape SubtreeShapes} for the children of the local root node are - * calculated. The direction specifiers are stored in the given map for all child nodes of the local root. - *

- * @param localRoot the local root node - * @param connectorMap the map that must be used for storing the direction specifiers of the child nodes - * @abstract - */ - determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; - /** - * Arranges the {@link yfiles.tree.SubtreeShape SubtreeShapes} of the local root and its children and routes the edges that connect them. - *

- * This method is the main method of the tree layout algorithm. It is called by {@link yfiles.tree.TreeLayout} in each recursion - * step to place the local root in relation to its children. Their shapes will be merged into one - * {@link yfiles.tree.SubtreeShape SubtreeShape}, which is returned by this method. - *

- *

- * The {@link yfiles.tree.SubtreeShape SubtreeShape} for the local root can be obtained from the nodeShapeProvider. subtreeShapeProvider contains the {@link yfiles.tree.SubtreeShape SubtreeShapes} - * assigned to the child nodes. - *

- *

- * Due to the order in which the tree nodes are processed, it is guaranteed that at the time of the invocation of this - * method the {@link yfiles.tree.SubtreeShape SubtreeShape} of every descendant node has already been calculated. - *

- * @param nodeShapeProvider the {@link } for obtaining an initial shape of the root node - * @param subtreeShapeProvider the {@link } for accessing the pre-calculated shapes of the subtrees - * @param graph the input graph - * @param localRoot the root of the subtree that should be arranged by this method - * @param parentConnectorDirection the direction specifier for the connector of the local root node to its parent node - * @returns the combined shape of the whole subtree - * @abstract - */ - placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShape; - } - var INodePlacer:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.tree.INodePlacer; - }; - /** - * A {@link yfiles.tree.IPortAssignment} places the ports of edges connecting to the same node. - *

- * Classes implementing this interface are responsible for the assignment of the edges' ports. {@link yfiles.tree.INodePlacer} - * instances need to obey the currently set ports. - *

- * @interface - */ - export interface IPortAssignment extends yfiles.lang.Object{ - /** - * Places the ports of edges connecting to the given node. - *

- * This method is called by {@link yfiles.tree.TreeLayout} before the actual layout calculation takes place. It assigns both the - * single incoming edge's target port as well as all source ports of all outgoing child edges. - *

- * @param graph the graph - * @param node the node whose adjacent edges' ports should be set - * @abstract - */ - assignPorts(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):void; - } - var IPortAssignment:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.tree.IPortAssignment; - }; - /** - * A {@link yfiles.tree.IProcessor} provides the possibility for each {@link yfiles.tree.INodePlacer} to prepare (and clean up) the graph - * for the children of the local root. - *

- * It is created by {@link yfiles.tree.INodePlacer#createProcessor} and called by the {@link yfiles.tree.TreeLayout} before and after the - * actual arrangement of the nodes. - *

- *

- * A {@link yfiles.tree.IProcessor} may change values within the - * {@link yfiles.algorithms.IDataMap}s for its children. It can also temporarily change the graph by hiding nodes or adding dummy - * nodes. - *

- * @interface - */ - export interface IProcessor extends yfiles.lang.Object{ - /** - * This method is called by the {@link yfiles.tree.TreeLayout} after the layout has finished. - *

- * It can be used for cleanup tasks. - *

- *

- * Changes on the graph structure that have been made in {@link yfiles.tree.IProcessor#preProcess} can be undone here. - *

- * @abstract - */ - postProcess():void; - /** - * Performs preparations for the actual tree layout in a pre-processing step. - *

- * This method is called by {@link yfiles.tree.TreeLayout} before the {@link yfiles.tree.INodePlacer}s are called recursively. A {@link yfiles.tree.IProcessor} - * may change some settings within this method. This can be used for specifying values for the children of the local root, - * manipulate the graph structure or do anything else that needs to be done. - *

- * @param nodePlacerDataProvider the map that stores a {@link } instance for each node - * @param portAssignmentDataProvider The map that stores a {@link } instance for each node - * @param childComparatorProvider the map that stores a {@link } instance for each node - * @abstract - */ - preProcess(nodePlacerDataProvider:yfiles.algorithms.IDataMap,portAssignmentDataProvider:yfiles.algorithms.IDataMap,childComparatorProvider:yfiles.algorithms.IDataMap):void; - } - var IProcessor:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.tree.IProcessor; - }; - /** - * A {@link yfiles.tree.LayeredNodePlacer} arranges the nodes of a subtree respecting layers. - *

- * Layout Style Nodes that have the same depth in the tree will be placed in the same horizontal layer. They will be vertically - * {@link yfiles.tree.LayeredNodePlacer#verticalAlignment aligned}. {@graph {"ann":{"s":[30,30],"d":1},"n":[[245.52,0],[69.46,77.5],[7.5,162.5],[181.42,240,45,45],[57.5,155,45,45],[0,240,45,45],[246.42,77.5],[406.58,70,45,45],[181.42,155,45,45],[246.42,155,45,45],[375.88,247.5],[7.5,332.5],[122.5,158.04,38.92,38.92],[409.62,158.04,38.92,38.92],[311.42,162.5],[65,247.5],[443.38,243.04,38.92,38.92],[138.92,332.5],[338.92,325,45,45],[311.42,247.5],[403.92,328.04,38.92,38.92],[188.92,332.5],[238.92,332.5]],"e":[[0,1,[260.52,42,84.46,42]],[1,2,[84.46,127,22.5,127]],[1,4,[84.46,127,80,127]],[2,5],[0,6,[260.52,42,261.42,42]],[0,7,[260.52,42,429.08,42]],[6,8,[261.42,127,203.92,127]],[8,3],[6,9,[261.42,127,268.92,127]],[5,11],[1,12,[84.46,127,141.96,127]],[7,13],[13,10,[429.08,212,390.88,212]],[6,14,[261.42,127,326.42,127]],[4,15],[13,16,[429.08,212,462.83,212]],[3,17,[203.92,297,153.92,297]],[10,18,[390.88,297,361.42,297]],[14,19],[10,20,[390.88,297,423.38,297]],[3,21],[3,22,[203.92,297,253.92,297]]],"vp":[0.0,0.0,483.0,370.0]}} - *

- * @class - * @extends {yfiles.tree.RotatableNodePlacerBase} - */ - export interface LayeredNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} - export class LayeredNodePlacer { - /** - * Creates a new {@link yfiles.tree.LayeredNodePlacer} instance whose direction is specified by the given modification matrix. - *

- * The given ID identifies different {@link yfiles.tree.LayeredNodePlacer} instances that share the same layer heights. - *

- * @param modificationMatrix the transformation matrix for this {@link } - * @param id the {@link } ID - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix,id:any); - /** - * Creates a new {@link yfiles.tree.LayeredNodePlacer} instance with the default settings. - */ - constructor(); - /** - * Gets or sets whether or not the layering is done dendrogram-like. - *

- * When enabled, leaves are placed in the same layer and remaining tree nodes are assigned to a layer as close to their - * children as possible. - *

- * @type {boolean} - */ - dendrogramStyle:boolean; - /** - * Gets or sets the {@link yfiles.tree.RootNodeAlignment RootAlginment} that defines how the root node is aligned with its children and their shapes. - * @type {yfiles.tree.RootNodeAlignment} - */ - rootAlignment:yfiles.tree.RootNodeAlignment; - /** - * Gets or sets the relative vertical alignment of nodes within their respective layers. - *

- * A value of 0 means that nodes are top-aligned; a value of 0.5 means that nodes are center-aligned; a value of 1 means - * that nodes are bottom-aligned; - *

- *

- * Values for a valid vertical alignment are in the range [0..1]. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified alignment is outside [0..1] - * @type {number} - */ - verticalAlignment:number; - /** - * Gets the ID of this {@link yfiles.tree.LayeredNodePlacer}. - *

- * The ID is used for identifying - * {@link yfiles.tree.LayeredNodePlacer}s that share information about the layer height. Using different IDs allows aligned layouts - * within different subtrees. - *

- * @type {any} - */ - id:any; - /** - * Gets or sets the distance between two adjacent layers. - *

- * The spacing needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified spacing is negative - * @type {number} - */ - layerSpacing:number; - /** - * Gets or sets the routing style for the edges in the subtree. - * @throws {Stubs.Exceptions.ArgumentError} if the specified routing style specifier is unknown - * @type {yfiles.tree.LayeredRoutingStyle} - */ - routingStyle:yfiles.tree.LayeredRoutingStyle; - /** - * Gets or sets the vertical bus alignment for orthogonally routed edges. - *

- * The bus alignment determines the relative position of an edge bus in between two subsequent layers of nodes. - *

- *

- * Values for a valid vertical alignment are in the range [0..1], such that: - *

- *
    - *
  • A value of 0.0 places the bus at the top, right below the parent node.
  • - *
  • A value of 0.5 places the bus in the middle between parent and child nodes.
  • - *
  • A value of 1.0 places the bus at the bottom, right above the child nodes.
  • - *
- * @throws {Stubs.Exceptions.ArgumentError} if the specified alignment is outside [0..1] - * @type {number} - */ - busAlignment:number; - /** - * Gets or sets whether or not straight edges are extended to avoid label overlaps. - *

- * If enabled, polyline connectors between the parent and its children are added to the according subtree shape. Node or - * edge labels will not be crossed. - *

- * @type {boolean} - */ - polylineLabeling:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.LayeredNodePlacer; - } - /** - * A {@link yfiles.tree.LeafNodePlacer} creates a {@link yfiles.tree.SubtreeShape SubtreeShape} for a leaf node and routes its incoming edge at the target side. - * @class - * @implements {yfiles.tree.INodePlacer} - */ - export interface LeafNodePlacer extends yfiles.lang.Object,yfiles.tree.INodePlacer{} - export class LeafNodePlacer { - /** - * Creates a new {@link yfiles.tree.LeafNodePlacer} instance with default settings. - */ - constructor(); - /** - * Creates an optional {@link yfiles.tree.IProcessor} for pre- and post-processing. - *

- * This implementation returns null. Hence, no pre- or post-processing is done. - *

- * @param layouter the current {@link } instance - * @param graph the input graph - * @param currentRoot the root node handled by this {@link } - * @returns null - */ - createProcessor(layouter:yfiles.tree.TreeLayout,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; - /** - * Does nothing because leaf nodes don't have children so there are no child connectors. - * @param localRoot the local root node - * @param connectorMap the map that must be used for storing the direction specifiers of the child nodes - */ - determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; - /** - * Creates a {@link yfiles.tree.SubtreeShape} for the local root node (a leaf node in this case) and adds target points to the - * incoming edge. - *

- * The incoming edge is routed according to possibly assigned {@link yfiles.layout.PortConstraint}s. - *

- * @param nodeShapeProvider the {@link } for obtaining an initial shape of the root node - * @param subtreeShapeProvider the {@link } for accessing the pre-calculated shapes of the subtrees - * @param graph the input graph - * @param localRoot the root of the subtree that should be arranged by this method - * @param parentConnectorDirection the direction specifier for the connector of the local root node to its parent node - * @returns the {@link } of the leaf node including the connector - */ - placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShape; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.LeafNodePlacer; - } - /** - * The {@link yfiles.tree.LeftRightNodePlacer} arranges the children in a subtree on the left and the right of a vertical bus. - *

- * Layout Style {@graph {"ann":{"s":[30,30],"d":1},"n":[[35,0],[0,50],[70,50],[0,100],[70,100],[0,150],[70,150],[0,200],[70,200],[35,250]],"e":[[0,1,[50,65]],[0,2,[50,65]],[0,3,[50,115]],[0,4,[50,115]],[0,5,[50,165]],[0,6,[50,165]],[0,7,[50,215]],[0,8,[50,215]],[0,9]],"vp":[0.0,0.0,100.0,280.0]}} - *

- * @class - * @extends {yfiles.tree.RotatableNodePlacerBase} - */ - export interface LeftRightNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} - export class LeftRightNodePlacer { - /** - * Creates a new {@link yfiles.tree.LeftRightNodePlacer} instance using the given modification matrix. - * @param modificationMatrix the transformation matrix for this {@link } - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix); - /** - * Creates a new {@link yfiles.tree.LeftRightNodePlacer} instance with default settings. - */ - constructor(); - /** - * Creates a special {@link yfiles.algorithms.IDataProvider} that determines whether a given node is placed left or right of the - * parent node. - *

- * This {@link yfiles.algorithms.IDataProvider} can be registered with the graph with key - * {@link yfiles.tree.LeftRightNodePlacer#LEFT_RIGHT_DP_KEY}. It calculates the side with respect to the initial coordinates of the - * nodes in the graph, considering the orientation of the subtree. - *

- *

- * If a node is assigned to the left side, this {@link yfiles.algorithms.IDataProvider} will return true. For the right side, it - * will return false. - *

- * @param nodePlacerMap a {@link } containing the corresponding {@link }s for the node - * @returns - * @static - */ - static createLeftRightDataProvider(nodePlacerMap:yfiles.algorithms.IDataProvider):yfiles.algorithms.IDataProvider; - /** - * Data provider key for assigning nodes to the left or the right side of the bus - *

- * If no {@link yfiles.algorithms.IDataProvider} is specified using this key, the nodes will be placed alternating from left to - * right. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static LEFT_RIGHT_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets the horizontal distance between nodes or subtrees. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - horizontalDistance:number; - /** - * Gets or sets the vertical distance between nodes or subtrees. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative - * @type {number} - */ - verticalDistance:number; - /** - * Sets a uniform horizontal and vertical spacing between subtrees. - *

- * This method sets the given distance value for the {@link yfiles.tree.LeftRightNodePlacer#horizontalDistance horizontal spacing} and for the {@link yfiles.tree.LeftRightNodePlacer#verticalDistance vertical spacing}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified spacing value is negative - * @see yfiles.tree.LeftRightNodePlacer#horizontalDistance - * @see yfiles.tree.LeftRightNodePlacer#verticalDistance - * @type {number} - */ - spacing:number; - /** - * Gets or sets whether or not the last child is placed centered, aligned with the bus and below the other child nodes. - *

- * When enabled, the last child will always be centered independent of the number of siblings. - *

- * @type {boolean} - */ - placeLastOnBottom:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.LeftRightNodePlacer; - } - /** - * The {@link yfiles.tree.MultiParentDescriptor} provides style information for multi-parent structures. - *

- * This class is used by {@link yfiles.tree.TreeLayout} to determine the desired layout of nodes that constitute a multi-parent - * structure. All nodes of such a structure are placed side by side and the incident edges are routed over common points - * for incoming edges and for outgoing edges. - *

- *

- * {@graph {"ann":{"s":[40,40],"d":1},"n":[[411.25,0],[682.5,85],[210,155],[612.5,165],[35,225],[577.5,235],[385,320.5],[682.5,155,40,60],[70,305],[210,85],[0,295,40,60],[0,385],[210,225],[700,320.5],[175,295],[245,295],[315,225],[752.5,165],[420,405.5],[647.5,235],[752.5,235],[770,406],[140,380.5,40,60],[210,390.5],[315,295,40,60],[490,405.5],[175,485.5],[455,320.5],[481.25,0],[700,406],[560,406],[630,406],[560,491],[630,491],[525,320.5],[280,380.5,40,60],[70,390.5]],"e":[[0,1,[431.25,55.5,466.25,55.5,466.25,70,702.5,70]],[1,3,[702.5,140,632.5,140]],[2,4,[230,210,55,210]],[3,5,[632.5,220,597.5,220]],[5,6,[597.5,290,475,290,475,305,405,305]],[1,7],[4,8,[55,280,90,280]],[0,9,[431.25,55.5,466.25,55.5,466.25,70,230,70]],[9,2],[4,10,[55,280,20,280]],[10,11],[2,12],[5,13,[597.5,290,720,290]],[12,14,[230,280,195,280]],[12,15,[230,280,265,280]],[2,16,[230,210,335,210]],[1,17,[702.5,140,772.5,140]],[6,18,[405,376,475,376,475,390.5,440,390.5]],[3,19,[632.5,220,667.5,220]],[17,20],[13,21,[720,375.5,790,375.5]],[14,22,[195,365,160,365]],[14,23,[195,365,230,365]],[16,24],[6,25,[405,376,475,376,475,390.5,510,390.5]],[22,26,[160,456,195,456]],[23,26,[230,456,195,456]],[5,27,[597.5,290,475,290]],[27,18,[475,390.5,440,390.5]],[27,25,[475,390.5,510,390.5]],[28,9,[501.25,55.5,466.25,55.5,466.25,70,230,70]],[28,1,[501.25,55.5,466.25,55.5,466.25,70,702.5,70]],[13,29],[13,30,[720,375.5,615,375.5,615,390.5,580,390.5]],[13,31,[720,375.5,615,375.5,615,390.5,650,390.5]],[30,32,[580,461.5,615,461.5,615,476,580,476]],[31,32,[650,461.5,615,461.5,615,476,580,476]],[30,33,[580,461.5,615,461.5,615,476,650,476]],[31,33,[650,461.5,615,461.5,615,476,650,476]],[5,34,[597.5,290,475,290,475,305,545,305]],[34,18,[545,376,475,376,475,390.5,440,390.5]],[34,25,[545,376,475,376,475,390.5,510,390.5]],[14,35,[195,365,300,365]],[35,26,[300,456,195,456]],[14,36,[195,365,90,365]],[36,26,[90,456,195,456]]],"vp":[0.0,0.0,810.0,531.0]}} - *

- *

- * A tree graph containing multi-parent structures - *

- * @see yfiles.tree.TreeLayout#MULTI_PARENT_DESCRIPTOR_DP_KEY - * @class - */ - export interface MultiParentDescriptor extends yfiles.lang.Object{} - export class MultiParentDescriptor { - /** - * Creates a new {@link yfiles.tree.MultiParentDescriptor} instance with default settings. - */ - constructor(); - /** - * Gets or sets the minimum distance between two nodes belonging to the same multi-parent structure. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given node distance is negative - * @type {number} - */ - minimumNodeDistance:number; - /** - * Gets or sets the minimum distance between the nodes of a multi-parent structure and the bus connecting these nodes. - *

- * In case the edge style is not orthogonal, the bus only consists of a common point. - *

- *

- * The minimum distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given bus distance is negative - * @type {number} - */ - minimumBusDistance:number; - /** - * Gets or sets the relative vertical alignment of nodes belonging to the same multi-parent structure. - *

- * A value of 0 means that nodes are top-aligned; a value of 1 means that nodes are bottom-aligned; a value of 0.5 means - * that nodes are center-aligned. - *

- *

- * Values outside the interval [0,1] will result in a compact node placement with unaligned nodes, especially when labels - * are considered. - *

- * @type {number} - */ - verticalAlignment:number; - /** - * Gets or sets the routing style for edges that connect to nodes which constitute a multi-parent structure. - * @throws {Stubs.Exceptions.ArgumentError} if the given routing style is unknown - * @type {yfiles.tree.MultiParentRoutingStyle} - */ - edgeStyle:yfiles.tree.MultiParentRoutingStyle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.MultiParentDescriptor; - } - /** - * The {@link yfiles.tree.NodeOrderComparer} compares edges according to a specified order. - *

- * It obtains the order from a {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.tree.NodeOrderComparer#NODE_ORDER_COMPARABLE_DP_KEY}. - *

- *

- * Various tree layout algorithms can use this {@link yfiles.collections.IComparer.} to influence the resulting layout. To achieve this, use this comparator and - * assign it to the comparator property of the layout algorithm classes. - *

- * @see yfiles.tree.ClassicTreeLayout#comparer - * @see yfiles.tree.TreeLayout#defaultOutEdgeComparer - * @see yfiles.tree.TreeLayout#OUT_EDGE_COMPARER_DP_KEY - * @see yfiles.tree.BalloonLayout#comparer - * @see yfiles.tree.AspectRatioTreeLayout#comparer - * @see yfiles.tree.NodeOrderComparer#NODE_ORDER_COMPARABLE_DP_KEY - * @class - * @implements {yfiles.collections.IComparer.} - */ - export interface NodeOrderComparer extends yfiles.lang.Object,yfiles.collections.IComparer{} - export class NodeOrderComparer { - /** - * Creates a new {@link yfiles.tree.NodeOrderComparer} instance. - */ - constructor(); - /** - * Compares two edges according to their index in the order specified using a {@link yfiles.algorithms.IDataProvider}. - *

- * Target nodes for which the {@link yfiles.algorithms.IDataProvider} registered with {@link yfiles.tree.NodeOrderComparer#NODE_ORDER_COMPARABLE_DP_KEY} - * returns null or an {@link any} that does not implement {@link yfiles.lang.IComparable} are treated as being smaller than other target - * nodes. - *

- * @param edge1 the first edge - * @param edge2 the second edge - * @returns - * @see yfiles.tree.NodeOrderComparer#NODE_ORDER_COMPARABLE_DP_KEY - */ - compare(edge1:any,edge2:any):number; - /** - * Data provider key for registering an order for each node in the graph - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_ORDER_COMPARABLE_DP_KEY:yfiles.algorithms.NodeDpKey; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.NodeOrderComparer; - } - /** - * Abstract base class for implementations of the {@link yfiles.tree.INodePlacer} interface. - *

- * This class provides convenience methods for sub-tasks that are often used during the arrangement of a local root and its - * children. It also offers prepared implementations for the methods of the {@link yfiles.tree.INodePlacer} interface. - *

- *

- * Subclasses just need to override the following two abstract methods: {@link yfiles.tree.NodePlacerBase#placeSubtreeOfNode} and - * {@link yfiles.tree.NodePlacerBase#determineChildConnectors}. - *

- * @class - * @implements {yfiles.tree.INodePlacer} - * @implements {yfiles.lang.ICloneable} - */ - export interface NodePlacerBase extends yfiles.lang.Object,yfiles.tree.INodePlacer,yfiles.lang.ICloneable{} - export class NodePlacerBase { - /** - * Creates a new instance of {@link yfiles.tree.NodePlacerBase}. - */ - constructor(); - /** - * Returns a clone of this {@link yfiles.tree.INodePlacer} instance. - * @returns an exact copy of this {@link } instance - */ - clone():any; - /** - * Creates an optional {@link yfiles.tree.IProcessor} for pre- and post-processing. - *

- * This implementation returns null. Hence, no pre- or post-processing will be done. - *

- * @param layouter the current {@link } instance - * @param graph the input graph - * @param currentRoot the root node handled by this {@link } - * @returns null - */ - createProcessor(layouter:yfiles.tree.TreeLayout,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; - /** - * Determines a connector direction for the given child node. - *

- * This method is used in {@link yfiles.tree.NodePlacerBase#determineChildConnectors} and must be implemented by subclasses. - *

- * @param child the child node - * @returns a direction specifier as defined in the {@link } interface - * @protected - * @abstract - */ - determineChildConnector(child:yfiles.algorithms.Node):yfiles.tree.ParentConnectorDirection; - /** - * Provides the direction of the connector to the {@link yfiles.tree.SubtreeShape SubtreeShape} for each child node. - *

- * This implementation uses {@link yfiles.tree.NodePlacerBase#determineChildConnector} to retrieve the direction for the - * connectors. - *

- * @param localRoot the local root node - * @param connectorMap the map that must be used for storing the direction specifiers of the child nodes - */ - determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; - /** - * Returns the {@link yfiles.tree.SubtreeShape} for the given node. - *

- * This is a convenience method that retrieves a {@link yfiles.tree.SubtreeShape} for a single node from the corresponding - * {@link yfiles.algorithms.IDataProvider}. - *

- *

- * This method is used in {@link yfiles.tree.NodePlacerBase#placeSubtreeOfNode} for retrieving the {@link yfiles.tree.SubtreeShape}s for - * the local root nodes. It may be overridden to return a custom implementation of {@link yfiles.tree.SubtreeShape}. - *

- * @param node the node - * @returns the {@link } for the given node - * @protected - */ - getNodeShape(node:yfiles.algorithms.Node):yfiles.tree.SubtreeShape; - /** - * Returns the {@link yfiles.tree.SubtreeShape} for the subtree rooted at the given node. - *

- * This is a convenience method that retrieves a {@link yfiles.tree.SubtreeShape} of a complete subtree from the corresponding - * {@link yfiles.algorithms.IDataProvider}. - *

- *

- * This method is used in {@link yfiles.tree.NodePlacerBase#placeSubtreeOfNode} for retrieving the {@link yfiles.tree.SubtreeShape}s for - * the subtrees that are arranged. It may be overridden to return a custom implementation of {@link yfiles.tree.SubtreeShape}. - *

- * @param node the local root node - * @returns the {@link } of the subtree rooted at the given local root node - * @protected - */ - getSubtreeShape(node:yfiles.algorithms.Node):yfiles.tree.SubtreeShape; - /** - * Initializes the local data structures and then delegates the work to the abstract variant of this method - * ({@link yfiles.tree.NodePlacerBase#placeSubtreeOfNode}) - * @param nodeShapeProvider the {@link } for obtaining an initial shape of the root node - * @param subtreeShapeProvider the {@link } for accessing the pre-calculated shapes of the subtrees - * @param graph the input graph - * @param localRoot the root of the subtree that should be arranged by this method - * @param parentConnectorDirection the direction specifier for the connector of the local root node to its parent node - * @returns the merged {@link } for the subtree rooted at the local root node - * @see yfiles.tree.NodePlacerBase#placeSubtreeOfNode - */ - placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShape; - /** - * Arranges the local root relative to the {@link yfiles.tree.SubtreeShape} of its children. - *

- * This is the main method that must be implemented by subclasses. It is called by - * {@link yfiles.tree.NodePlacerBase#placeSubtree}. - *

- * @param localRoot the local root node - * @param parentConnectorDirection the direction of the connector - * @returns a {@link } instance that describes the shape of the whole subtree rooted at the given local root - * @protected - * @abstract - */ - placeSubtreeOfNode(localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShape; - /** - * The graph instance this class is working on. - * @protected - * @type {yfiles.layout.LayoutGraph} - */ - graph:yfiles.layout.LayoutGraph; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.NodePlacerBase; - } - /** - * A {@link yfiles.tree.RootNodeAlignment} describes how a local root node is arranged in relation to its children. - *

- * The actual placement depends on the orientation of the subtree rooted at the current local root node. All descriptions - * of the provided alignments refer to the top-to-bottom orientation described by - * {@link yfiles.tree.RotatableNodePlacerMatrix#DEFAULT}. In this case, the subtrees are placed below the local root and the local - * root is aligned horizontally above them. - *

- * @class - */ - export interface RootNodeAlignment extends yfiles.lang.Object{} - export class RootNodeAlignment { - /** - * Calculates the common bounds of the given subtree shapes. - *

- * This method can be used when placing the local root above its subtrees in method - * {@link yfiles.tree.RootNodeAlignment#placeParentHorizontal}. - *

- * @param shapes a list of rotated subtree shapes - * @returns the rectangle describing the bounds containing all given shapes - * @protected - * @static - */ - static getBounds(shapes:yfiles.collections.IList):yfiles.algorithms.Rectangle2D; - /** - * Moves the shape of the local root to a suitable position relative to the children's shapes. - *

- * The movement should only be done on the x-axis (horizontally). - *

- *

- * This method is called by {@link yfiles.tree.RotatableNodePlacerBase}s when they {@link yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode place the subtrees}. - *

- * @param rootShape the shape of the local root node that will be moved - * @param shapes a list of rotated subtree shapes, representing the shapes of the child nodes - * @param shapeBounds accumulated bounds of the shapes of all child nodes - * @param spacing the spacing value that should be used - * @protected - * @abstract - */ - placeParentHorizontal(rootShape:yfiles.tree.RotatedSubtreeShape,shapes:yfiles.collections.IList,shapeBounds:yfiles.algorithms.Rectangle2D,spacing:number):void; - /** - * Horizontal {@link yfiles.tree.RootNodeAlignment} at the center of the subtrees. - *

- * The root node is placed centered above its whole subgraph. To determine the alignment, only {@link yfiles.layout.INodeLayout}s - * are considered. Node labels are not included although they are also contained in {@link yfiles.tree.SubtreeShape}s. - *

- * @const - * @static - * @type {yfiles.tree.RootNodeAlignment} - */ - static CENTER:yfiles.tree.RootNodeAlignment; - /** - * Horizontal {@link yfiles.tree.RootNodeAlignment} at the median child node. - *

- * The root node is placed above the median of its children. To determine the alignment, only {@link yfiles.layout.INodeLayout}s - * are considered. Node labels are not included although they are also contained in {@link yfiles.tree.SubtreeShape}s. - *

- * @const - * @static - * @type {yfiles.tree.RootNodeAlignment} - */ - static MEDIAN:yfiles.tree.RootNodeAlignment; - /** - * Horizontal {@link yfiles.tree.RootNodeAlignment} left of the children. - *

- * The local root node leaves a distance specified by the given spacing to the leftmost child. To determine the alignment, - * only {@link yfiles.layout.INodeLayout}s are considered. Node labels are not included although they are also contained in - * {@link yfiles.tree.SubtreeShape}s. - *

- * @const - * @static - * @type {yfiles.tree.RootNodeAlignment} - */ - static LEADING:yfiles.tree.RootNodeAlignment; - /** - * Horizontal {@link yfiles.tree.RootNodeAlignment} right of the children. - *

- * The root node leaves a distance specified by the given spacing to the rightmost child. To determine the alignment, only - * {@link yfiles.layout.INodeLayout}s are considered. Node labels are not included although they are also contained in - * {@link yfiles.tree.SubtreeShape}s. - *

- * @const - * @static - * @type {yfiles.tree.RootNodeAlignment} - */ - static TRAILING:yfiles.tree.RootNodeAlignment; - /** - * Horizontal {@link yfiles.tree.RootNodeAlignment} at the left side. - *

- * The root node is placed left aligned with its leftmost child. To determine the alignment, only - * {@link yfiles.layout.INodeLayout}s are considered. Node labels are not included although they are also contained in - * {@link yfiles.tree.SubtreeShape}s. - *

- * @const - * @static - * @type {yfiles.tree.RootNodeAlignment} - */ - static LEFT:yfiles.tree.RootNodeAlignment; - /** - * Horizontal {@link yfiles.tree.RootNodeAlignment} at the right side. - *

- * The root node is placed right aligned with its rightmost child. To determine the alignment, only - * {@link yfiles.layout.INodeLayout}s are considered. Node labels are not included although they are also contained in - * {@link yfiles.tree.SubtreeShape}s. - *

- * @const - * @static - * @type {yfiles.tree.RootNodeAlignment} - */ - static RIGHT:yfiles.tree.RootNodeAlignment; - /** - * Horizontal alignment at the center of the children. - *

- * The root node is placed centered over its direct children. To determine the alignment, only {@link yfiles.layout.INodeLayout}s - * are considered. Node labels are not included although they are also contained in {@link yfiles.tree.SubtreeShape}s. - *

- * @const - * @static - * @type {yfiles.tree.RootNodeAlignment} - */ - static CENTER_OVER_CHILDREN:yfiles.tree.RootNodeAlignment; - /** - * An array containing all supported {@link yfiles.tree.RootNodeAlignment}s. - * @const - * @static - * @type {Array.} - */ - static ALL:yfiles.tree.RootNodeAlignment[]; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.RootNodeAlignment; - } - /** - * A matrix describes the rotation of the subtree handled by {@link yfiles.tree.RotatableNodePlacerBase}. - *

- * Subtrees may be rotated or mirrored. Also, matrices offering a combination of rotation and mirroring are provided. - *

- * @class - */ - export interface RotatableNodePlacerMatrix extends yfiles.lang.Object{} - export class RotatableNodePlacerMatrix { - /** - * Compares the values of the current {@link yfiles.tree.RotatableNodePlacerMatrix} with the values of the given - * {@link yfiles.tree.RotatableNodePlacerMatrix}. - * @param other the matrix - * @returns true if this matrix and the given other matrix contain the same values, false otherwise - */ - equalValues(other:yfiles.tree.RotatableNodePlacerMatrix):boolean; - /** - * Multiplies this {@link yfiles.tree.RotatableNodePlacerMatrix} with the given other {@link yfiles.tree.RotatableNodePlacerMatrix}. - * @param other the other matrix - * @returns the product of both matrices - */ - multiply(other:yfiles.tree.RotatableNodePlacerMatrix):yfiles.tree.RotatableNodePlacerMatrix; - /** - * The identity matrix which does not apply any rotation or mirroring. - * @const - * @static - * @type {yfiles.tree.RotatableNodePlacerMatrix} - */ - static DEFAULT:yfiles.tree.RotatableNodePlacerMatrix; - /** - * A matrix which applies a counter-clockwise rotation by 90 degrees. - * @const - * @static - * @type {yfiles.tree.RotatableNodePlacerMatrix} - */ - static ROT90:yfiles.tree.RotatableNodePlacerMatrix; - /** - * A matrix which applies a rotation by 180 degrees. - * @const - * @static - * @type {yfiles.tree.RotatableNodePlacerMatrix} - */ - static ROT180:yfiles.tree.RotatableNodePlacerMatrix; - /** - * A matrix which applies a counter-clockwise rotation by 270 degrees. - * @const - * @static - * @type {yfiles.tree.RotatableNodePlacerMatrix} - */ - static ROT270:yfiles.tree.RotatableNodePlacerMatrix; - /** - * A matrix which applies a horizontal mirroring. - * @const - * @static - * @type {yfiles.tree.RotatableNodePlacerMatrix} - */ - static MIR_HOR:yfiles.tree.RotatableNodePlacerMatrix; - /** - * A matrix which applies a vertical mirroring. - * @const - * @static - * @type {yfiles.tree.RotatableNodePlacerMatrix} - */ - static MIR_VERT:yfiles.tree.RotatableNodePlacerMatrix; - /** - * A matrix which applies a horizontal mirroring and a counter-clockwise rotation by 90 degrees. - * @const - * @static - * @type {yfiles.tree.RotatableNodePlacerMatrix} - */ - static MIR_HOR_ROT90:yfiles.tree.RotatableNodePlacerMatrix; - /** - * A matrix which applies a vertical mirroring and a counter-clockwise rotation by 90 degrees. - * @const - * @static - * @type {yfiles.tree.RotatableNodePlacerMatrix} - */ - static MIR_VERT_ROT90:yfiles.tree.RotatableNodePlacerMatrix; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.RotatableNodePlacerMatrix; - } - /** - * Abstract base class for {@link yfiles.tree.INodePlacer}s that support rotations of the subtrees. - *

- * The direction specified in this {@link yfiles.tree.RotatableNodePlacerBase} (defined by a - * {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix transformation matrix}) rotates the subtree that is placed. This is the final direction of this subtree. Rotations are - * not accumulated. - *

- *

- * {@link yfiles.tree.INodePlacer}s of this type will only implement the default direction (i.e. top-to-bottom). The other - * directions are calculated using the specified modification {@link yfiles.tree.RotatableNodePlacerMatrix}. The direction used by - * the implementing - * {@link yfiles.tree.INodePlacer}s is called the model direction while the actual direction in the graph is the real direction. - *

- *

- * Note that using rotatable {@link yfiles.tree.INodePlacer}s has some pitfalls. Calculations must be aware of the rotations. - * Especially operations on {@link yfiles.algorithms.BorderLine}s should not be called directly (e.g. - * {@link yfiles.algorithms.BorderLine#mergeWithMin}, {@link yfiles.algorithms.BorderLine#mergeWithMax}). The corresponding methods of {@link yfiles.tree.RotatableNodePlacerBase} - * already support the different directions. - *

- *

- * Subclasses just need to override the following two abstract methods: {@link yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode} - * and {@link yfiles.tree.RotatableNodePlacerBase#determineChildConnectors}. - *

- * @class - * @implements {yfiles.tree.IFromSketchNodePlacer} - */ - export interface RotatableNodePlacerBase extends yfiles.lang.Object,yfiles.tree.IFromSketchNodePlacer{} - export class RotatableNodePlacerBase { - /** - * Creates a new instance of {@link yfiles.tree.RotatableNodePlacerBase} whose direction is specified by the given modification - * matrix. - * @param modificationMatrix the transformation matrix for the {@link } - * @protected - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix); - /** - * Creates a {@link yfiles.collections.IComparer.} for outgoing edges that takes the rotation into account. - * @returns the {@link } that considers the rotation - */ - createComparer():yfiles.collections.IComparer; - /** - * Delegates to {@link yfiles.tree.RotatableNodePlacerBase#createComparer}. - * @returns the From Sketch {@link } - * @see yfiles.tree.RotatableNodePlacerBase#createComparer - */ - createFromSketchComparer():yfiles.collections.IComparer; - /** - * Creates an optional {@link yfiles.tree.IProcessor} for pre- and post-processing. - *

- * This implementation returns null. Hence, no pre- or post-processing is done. - *

- * @param layouter the current {@link } instance - * @param graph the input graph - * @param currentRoot the root node handled by this {@link } - * @returns null - */ - createProcessor(layouter:yfiles.tree.TreeLayout,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; - /** - * Determines a connector direction for the given child node. - *

- * This method is called by {@link yfiles.tree.RotatableNodePlacerBase#determineChildConnectors} and must be implemented by - * subclasses. Implementations can assume the default direction (top-to-bottom) for their arrangement. - *

- * @param child the child node - * @returns a direction specifier as defined in the {@link } interface - * @protected - * @abstract - */ - determineChildConnector(child:yfiles.algorithms.Node):yfiles.tree.ParentConnectorDirection; - /** - * Provides the direction of the connector to the {@link yfiles.tree.SubtreeShape SubtreeShape} for each child node. - *

- * This implementation uses {@link yfiles.tree.RotatableNodePlacerBase#determineChildConnector} and the {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix modification matrix} to - * retrieve the direction for the connectors. - *

- * @param localRoot the local root - * @param connectorMap the map that must be used for storing the direction specifiers of the child nodes - * @see yfiles.tree.RotatableNodePlacerBase#determineChildConnector - */ - determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; - /** - * Returns the rotated subtree shape for the given node. - *

- * This is a convenience method that retrieves a rotated subtree shape for a single node from the corresponding - * {@link yfiles.algorithms.IDataProvider}. This shape may be modified and returned by - * {@link yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode}. - *

- * @param node the node - * @returns the subtree shape for the given node - * @protected - */ - getNodeShape(node:yfiles.algorithms.Node):yfiles.tree.RotatedSubtreeShape; - /** - * Returns the target {@link yfiles.layout.PortConstraint} for the local root's incoming edge. - *

- * This method translates the {@link yfiles.layout.PortConstraint} according to the rotation described by the {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix modification matrix}. - * It should be used instead of {@link yfiles.layout.PortConstraint#getTPC}. - *

- *

- * This method may be used in {@link yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode} to route the edges to the according - * port. It may be overridden to provide constant {@link yfiles.layout.PortConstraint}s for each node. - *

- * @param localRoot the local root - * @returns the {@link } for the incoming edge of the local root or {@link #ANY} if no {@link } - * is assigned for that edge - * @protected - */ - getPortConstraint(localRoot:yfiles.algorithms.Node):yfiles.layout.PortConstraint; - /** - * Returns the absolute source point of the given edge depending on the rotation of this {@link yfiles.tree.INodePlacer}. - *

- * This method translates the source point according to the rotation described by the {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix modification matrix}. It should be - * used instead of {@link yfiles.layout.LayoutGraph#getSourcePointAbs}. - *

- *

- * It can be used in an implementation of {@link yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode}. - *

- * @param edge the edge whose absolute source point should be calculated - * @returns the translated absolute source point for the given edge and current modification matrix - * @protected - */ - getSourcePointAbs(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPoint; - /** - * Returns the rotated subtree shape for the subtree rooted at the given node. - *

- * This is a convenience method that retrieves a subtree shape of a complete subtree from the corresponding - * {@link yfiles.algorithms.IDataProvider}. - *

- * @param node the local root node - * @returns the rotated subtree shape of the subtree rooted at the given local root node - * @protected - */ - getSubtreeShape(node:yfiles.algorithms.Node):yfiles.tree.RotatedSubtreeShape; - /** - * Initializes the local data structures and then delegates the work to the abstract variant of this method - * ({@link yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode}). - * @param nodeShapeProvider the {@link } for obtaining an initial shape of the root node - * @param subtreeShapeProvider the {@link } for accessing the pre-calculated shapes of the subtrees - * @param graph the input graph - * @param localRoot the root of the subtree that should be arranged by this method - * @param parentConnectorDirection the direction specifier for the connector of the local root node to its parent node - * @returns the merged {@link } for the subtree rooted at the local root node - * @see yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode - */ - placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShape; - /** - * Arranges the local root relative to the rotated subtree shapes of its children. - *

- * This is the main method that must be implemented by subclasses. For calculations and locations subclasses should use the - * corresponding methods of {@link yfiles.tree.RotatableNodePlacerBase} which already consider the {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix modification matrix}. - *

- * @param localRoot the local root node - * @param parentConnectorDirection the direction specifier for the connector of the local root node to its parent node - * @returns the merged subtree shape that contains the local root node and all its children - * @protected - * @abstract - */ - placeSubtreeOfNode(localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.RotatedSubtreeShape; - /** - * Translates the given real direction of the resulting layout to the model direction of this - * {@link yfiles.tree.RotatableNodePlacerBase}. - *

- * This method is used in {@link yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode} to be able to retrieve the model direction - * for the connector - *

- * @param realDirection the real direction - * @returns the model direction - * @throws {Stubs.Exceptions.ArgumentError} if translation for the given real direction is not implemented - * @protected - */ - translateDirectionToModel(realDirection:yfiles.tree.ParentConnectorDirection):number; - /** - * Translates the given model direction to the real direction in the resulting layout. - *

- * This method is used in {@link yfiles.tree.RotatableNodePlacerBase#determineChildConnectors} to be able to return the real - * connector direction. - *

- * @param modelDirection the model direction - * @returns the real direction - * @throws {Stubs.Exceptions.ArgumentError} if translation for the given model direction is not implemented - * @protected - */ - translateDirectionToReal(modelDirection:yfiles.tree.ParentConnectorDirection):number; - /** - * Translates a point from the real layout direction to the model direction using the given modification matrix. - * @param modificationMatrix the modification matrix to use for the translation - * @param realWorldPoint the point with coordinates from the real world - * @returns the translated point with coordinates from the model - * @static - */ - static translatePoint(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix,realWorldPoint:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; - /** - * The graph instance this {@link yfiles.tree.INodePlacer} is working on. - * @protected - * @type {yfiles.layout.LayoutGraph} - */ - graph:yfiles.layout.LayoutGraph; - /** - * The provider of {@link yfiles.tree.SubtreeShape}s for whole subtrees. - * @protected - * @type {yfiles.algorithms.IDataProvider} - */ - subtreeShapeProvider:yfiles.algorithms.IDataProvider; - /** - * The provider of {@link yfiles.tree.SubtreeShape}s for single nodes. - * @protected - * @type {yfiles.algorithms.IDataProvider} - */ - nodeShapeProvider:yfiles.algorithms.IDataProvider; - /** - * The list containing the created children. - * @protected - * @type {yfiles.collections.IList.} - */ - createdChildren:yfiles.collections.IList; - /** - * Gets the modification matrix that defines the direction of the subtree. - * @type {yfiles.tree.RotatableNodePlacerMatrix} - */ - modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix; - /** - * Gets or sets the spacing between subtrees. - *

- * The spacing needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given spacing is negative - * @type {number} - */ - spacing:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.RotatableNodePlacerBase; - } - /** - * Decorates a SubtreeShape and provides rotated access on it. - * @class - */ - export interface RotatedSubtreeShape extends yfiles.lang.Object{} - export class RotatedSubtreeShape { - /** - * For testing purposes only - * @protected - */ - constructor(); - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.RotatedSubtreeShape; - } - /** - * The {@link yfiles.tree.SimpleNodePlacer} arranges all children of a local root in a single row. - *

- * Layout Style {@graph {"ann":{"s":[30,30],"d":1},"n":[[0,0],[50,50],[235,50],[370,50],[720,50],[100,100],[770,100],[285,100],[420,50],[520,50],[570,100],[670,100],[150,150],[720,150],[470,100],[335,100],[620,150],[820,150],[520,150],[185,100]],"e":[[0,1,[65,15]],[0,2,[250,15]],[0,3,[385,15]],[0,4,[735,15]],[1,5,[115,65]],[4,6,[785,65]],[2,7,[300,65]],[0,8,[435,15]],[0,9,[535,15]],[9,10,[585,65]],[9,11,[685,65]],[5,12,[165,115]],[11,13,[735,115]],[8,14,[485,65]],[2,15,[350,65]],[10,16,[635,115]],[6,17,[835,115]],[14,18,[535,115]],[1,19,[200,65]]],"vp":[0.0,0.0,850.0,180.0]}} - *

- * @class - * @extends {yfiles.tree.RotatableNodePlacerBase} - */ - export interface SimpleNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} - export class SimpleNodePlacer { - /** - * Creates a new {@link yfiles.tree.SimpleNodePlacer} instance that uses the given {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix modification matrix} and {@link yfiles.tree.SimpleNodePlacer#rootAlignment root alignment}. - * @param modificationMatrix the transformation matrix for this {@link } - * @param rootAlignment the alignment for the local root in relation to its subtrees - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix,rootAlignment:yfiles.tree.RootNodeAlignment); - /** - * Creates a new {@link yfiles.tree.SimpleNodePlacer} instance that uses the given {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix modification matrix}. - * @param modificationMatrix the transformation matrix for this {@link } - */ - constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix); - /** - * Creates a new {@link yfiles.tree.SimpleNodePlacer} instance with default settings. - */ - constructor(); - /** - * Gets or sets the {@link yfiles.tree.RootNodeAlignment RootAlignment} that defines how the root node is aligned with its children and their shapes. - * @type {yfiles.tree.RootNodeAlignment} - */ - rootAlignment:yfiles.tree.RootNodeAlignment; - /** - * Gets or sets the relative vertical alignment of nodes with the same parent. - *

- * All values between 0 and 1 result in a valid alignment. - *

- *
    - *
  • 0 - nodes are top-aligned
  • - *
  • 0.5 - nodes are center-aligned
  • - *
  • 1 - nodes are bottom-aligned
  • - *
- *

- * Values outside the interval [0,1] may result in a more compact node placement with unaligned nodes, especially when - * labels are considered. - *

- * @type {number} - */ - verticalAlignment:number; - /** - * Gets or sets whether or not a bus is created in the space between the parent and its children. - * @type {boolean} - */ - createBus:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.SimpleNodePlacer; - } - /** - * The {@link yfiles.tree.TreeComponentLayout} arranges tree-like subgraph structures in a mixed layout style. - *

- * {@graph {"ann":{"s":[37.5,37.5],"d":1},"n":[[-18.75,231.25],[56.25,231.25],[131.25,231.25],[-18.75,631.25],[631.25,231.25],[631.25,631.25],[131.25,631.25],[-18.75,-18.75],[631.25,-18.75],[631.25,131.25],[631.25,56.25],[131.25,406.25],[131.25,556.25],[447.5,75,1],[560,162.5,1],[497.5,162.5,1],[391.25,343.75,1],[328.75,343.75,1],[247.5,500,1],[247.5,587.5,1],[310,500,1],[310,587.5,1],[266.25,343.75,1],[272.5,75,1],[385,162.5,1],[322.5,162.5,1],[97.5,75,1],[210,162.5,1],[147.5,162.5,1]],"e":[[0,1,18.75,-0,-18.75,-0],[1,2,18.75,-0,-18.75,-0],[0,3,-0,18.75,-0,-18.75],[2,4,18.75,-0,-18.75,-0],[4,5,-0,18.75,-0,-18.75],[5,6,-18.75,-0,18.75,-0],[6,3,-18.75,-0,18.75,-0],[0,7,-0,-18.75,-0,18.75],[7,8,18.75,-0,-18.75,-0],[4,9,-0,-18.75,-0,18.75],[8,10,-0,18.75,-0,-18.75],[10,9,-0,18.75,-0,-18.75],[11,2,-0,-18.75,-0,18.75],[11,12,-0,18.75,-0,-18.75],[6,12,-0,-18.75,-0,18.75],[7,13,18.75,12.5,0,0,[52.5,12.5,52.5,50,466.25,50]],[13,14,-13.75,0,-0,-0,[452.5,137.5,578.75,137.5]],[13,15,-13.75,0,-0,-0,[452.5,137.5,516.25,137.5]],[2,16,18.75,12.5,0,0,[221.25,262.5,221.25,318.75,410,318.75]],[2,17,18.75,12.5,0,0,[221.25,262.5,221.25,318.75,347.5,318.75]],[11,18,18.75,-0,0,0,[202.5,425,202.5,475,266.25,475]],[11,19,18.75,-0,0,0,[202.5,425,202.5,562.5,266.25,562.5]],[11,20,18.75,-0,0,0,[202.5,425,202.5,475,328.75,475]],[11,21,18.75,-0,0,0,[202.5,425,202.5,562.5,328.75,562.5]],[2,22,18.75,12.5,0,0,[221.25,262.5,221.25,318.75,285,318.75]],[7,23,18.75,12.5,0,0,[52.5,12.5,52.5,50,291.25,50]],[23,24,-13.75,0,-0,-0,[277.5,137.5,403.75,137.5]],[23,25,-13.75,0,-0,-0,[277.5,137.5,341.25,137.5]],[7,26,18.75,12.5,0,0,[52.5,12.5,52.5,50,116.25,50]],[26,27,-13.75,0,-0,-0,[102.5,137.5,228.75,137.5]],[26,28,-13.75,0,-0,-0,[102.5,137.5,166.25,137.5]]],"vp":[-19.0,-19.0,688.0,688.0]}} - *

- *

- * The tree components are marked - *

- * @class - * @implements {yfiles.layout.ILayoutStage} - */ - export interface TreeComponentLayout extends yfiles.lang.Object,yfiles.layout.ILayoutStage{} - export class TreeComponentLayout { - /** - * Creates a new {@link yfiles.tree.TreeComponentLayout} instance using the specified layouter for arranging the subtrees. - * @param treeCoreLayouter the layout algorithm used for arranging the tree components - * @throws {Stubs.Exceptions.ArgumentError} if the specified layout algorithm is null - */ - constructor(treeCoreLayouter:yfiles.layout.ILayoutAlgorithm); - /** - * Finds the tree components inside the given graph and applies a {@link yfiles.tree.TreeComponentLayout#treeComponentCoreLayout tree layout} to them. - * @param graph the input graph - */ - applyLayout(graph:yfiles.layout.LayoutGraph):void; - /** - * Delegates the layout calculation to the {@link yfiles.tree.TreeComponentLayout#coreLayout core layout algorithm} and handles the dummy nodes. - *

- * The dummy nodes are marked using the given {@link yfiles.algorithms.IDataProvider}. - *

- *

- * This implementation just registers the dummy node {@link yfiles.algorithms.IDataProvider} with the graph with key - * {@link yfiles.tree.TreeComponentLayout#DUMMY_NODE_DP_KEY}, executes the core layout algorithm and finally removes the data - * provider again. - *

- *

- * This method is called by {@link yfiles.tree.TreeComponentLayout#applyLayout} to invoke the core layout algorithm. It may be - * overridden to customize the handling of the dummy nodes. - *

- * @param graph the input graph - * @param dummyDp the {@link } which marks the dummy nodes - * @protected - */ - applyLayoutUsingDummies(graph:yfiles.layout.LayoutGraph,dummyDp:yfiles.algorithms.IDataProvider):void; - /** - * Data provider key for identifying dummy nodes during the layout calculation - *

- * This {@link yfiles.algorithms.IDataProvider} is registered and also removed in - * {@link yfiles.tree.TreeComponentLayout#applyLayoutUsingDummies}. - *

- * @see yfiles.tree.TreeComponentLayout#applyLayoutUsingDummies - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static DUMMY_NODE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * - * @type {yfiles.layout.ILayoutAlgorithm} - */ - coreLayout:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the layout algorithm that is applied to tree components. - * @type {yfiles.layout.ILayoutAlgorithm} - */ - treeComponentCoreLayout:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets whether or not tree component arrangement is improved by changing the orientation of components. - * @type {boolean} - */ - optimizeOrientation:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.TreeComponentLayout; - } - /** - * A {@link yfiles.tree.SubtreeShape} represents the position and the borders of a subtree. - *

- * {@link yfiles.tree.INodePlacer}s will move {@link yfiles.tree.SubtreeShape}s and use the borders to calculate distances between the - * subtrees. When two subtrees are placed in relation to their common root, their - * {@link yfiles.tree.SubtreeShape}s are merged to represent the new subtree. - *

- *

- * The borders on each side of the {@link yfiles.tree.SubtreeShape} are modeled with - * {@link yfiles.algorithms.BorderLine}s. The resulting area includes the borders of each node and edge in the corresponding - * subtree. It can also contain the bounds of labels belonging to those nodes and edges. - *

- *

- * The {@link yfiles.tree.SubtreeShape} also describes a connector defining the location to which the edge from its parent is - * attached. It is possible to add some bends (target points) at the end of this edge and include them in the - * {@link yfiles.tree.SubtreeShape}. During layout calculation, the last target point is the connection point for the edge. - *

- * @see yfiles.tree.SubtreeShape#getBorderLine - * @see yfiles.tree.SubtreeShape#connectorX - * @see yfiles.tree.SubtreeShape#connectorY - * @see yfiles.tree.SubtreeShape#addBoundsToShape - * @see yfiles.tree.SubtreeShape#addTargetPoint - * @class - * @final - */ - export interface SubtreeShape extends yfiles.lang.Object{} - export class SubtreeShape { - /** - * Extends this {@link yfiles.tree.SubtreeShape} instance by the given rectangle. - *

- * The border lines are updated with this segment. - *

- * @param x the x-coordinate of the upper-left corner of the rectangle - * @param y the y-coordinate of the upper-left corner of the rectangle - * @param width the width of the rectangle - * @param height the height of the rectangle - * @see yfiles.tree.SubtreeShape#getBorderLine - */ - addBoundsToShape(x:number,y:number,width:number,height:number):void; - /** - * Adds all edge segments of the given edge to this {@link yfiles.tree.SubtreeShape} instance. - *

- * The border lines are updated. - *

- * @param graph the input graph - * @param edge the given edge - * @see yfiles.tree.SubtreeShape#getBorderLine - * @see yfiles.tree.SubtreeShape#addLineSegment - */ - addEdgeSegments(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; - /** - * Extends this {@link yfiles.tree.SubtreeShape} instance by the given segment. - *

- * The border lines are updated with this segment. - *

- * @param x1 the x-coordinate of the first point of the segment - * @param y1 the y-coordinate of the first point of the segment - * @param x2 the x-coordinate of the second point of the segment - * @param y2 the y-coordinate of the second point of the segment - * @see yfiles.tree.SubtreeShape#getBorderLine - * @see yfiles.tree.SubtreeShape#addEdgeSegments - * @see yfiles.tree.SubtreeShape#updateConnectorShape - */ - addLineSegment(x1:number,y1:number,x2:number,y2:number):void; - /** - * Adds another point to the connector. - *

- * The points will appear as bend of the incoming edge. Points are added in reverse direction of the edge. Hence, the last - * target point is further away from the target node than the points before. - *

- * @param x the current x-coordinate of the point - * @param y the current y-coordinate of the point - */ - addTargetPoint(x:number,y:number):void; - /** - * Appends all target points that have previously been added to this shape to the given {@link yfiles.layout.IEdgeLayout} - * instance. - *

- * This method is used by {@link yfiles.tree.INodePlacer} instances for the final edge paths. - *

- * @param edgeLayout the {@link } that will be modified - * @see yfiles.tree.SubtreeShape#addTargetPoint - */ - appendTargetPoints(edgeLayout:yfiles.layout.IEdgeLayout):void; - /** - * Copies the state of this {@link yfiles.tree.SubtreeShape} instance to the given shape applying a modification matrix. - * @param toShape the given shape that gets the assigned values - * @param modificationMatrix the matrix that may add geometrical modifications - */ - assignValuesTo(toShape:yfiles.tree.SubtreeShape,modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix):void; - /** - * Creates a clone of this {@link yfiles.tree.SubtreeShape} instance, modifying it using the provided modification matrix. - * @param matrix the matrix that defines the modification for the new instance - * @returns the clone of this {@link } instance - * @see yfiles.tree.RotatableNodePlacerMatrix#DEFAULT - */ - createCopy(matrix:yfiles.tree.RotatableNodePlacerMatrix):yfiles.tree.SubtreeShape; - /** - * Returns the {@link yfiles.algorithms.BorderLine} instance that describes the {@link yfiles.tree.SubtreeShape} at the given side. - * @param index one of the predefined borderline directions - * @returns the {@link } instance for the given side - * @throws {Stubs.Exceptions.ArgumentError} if the given index is invalid - */ - getBorderLine(index:number):yfiles.algorithms.BorderLine; - /** - * Merges the given {@link yfiles.tree.SubtreeShape} instance with this {@link yfiles.tree.SubtreeShape} instance. - *

- * The border lines are updated. - *

- * @param other the {@link } to be merged with this {@link } - */ - mergeWith(other:yfiles.tree.SubtreeShape):void; - /** - * Moves this {@link yfiles.tree.SubtreeShape} instance and its connector by the given offsets. - *

- * Border lines are updated. - *

- * @param dx the delta x-offset by which this shape will be moved - * @param dy the delta y-offset by which this shape will be moved - */ - move(dx:number,dy:number):void; - /** - * Adds the line segments of the connector to the bounds of this {@link yfiles.tree.SubtreeShape} instance. - *

- * The line segments result from the target points. - *

- * @see yfiles.tree.SubtreeShape#addTargetPoint - */ - updateConnectorShape():void; - /** - * Gets the bounds of the {@link yfiles.layout.INodeLayout} of the root node of this {@link yfiles.tree.SubtreeShape} instance. - * @type {yfiles.algorithms.Rectangle2D} - */ - coreBounds:yfiles.algorithms.Rectangle2D; - /** - * Gets the current bounds of this {@link yfiles.tree.SubtreeShape} instance. - * @type {yfiles.algorithms.Rectangle2D} - */ - bounds:yfiles.algorithms.Rectangle2D; - /** - * Gets the current x-coordinate of the connection point to which the layout algorithm connects the ingoing edge. - *

- * The connection point can change when target points are added to the {@link yfiles.tree.SubtreeShape} instance. - *

- * @see yfiles.tree.SubtreeShape#addTargetPoint - * @see yfiles.tree.SubtreeShape#appendTargetPoints - * @type {number} - */ - connectorX:number; - /** - * Gets the current y-coordinate of the connection point to which the layout algorithm connects the ingoing edge. - *

- * The connection point can change when target points are added to the {@link yfiles.tree.SubtreeShape} instance. - *

- * @see yfiles.tree.SubtreeShape#addTargetPoint - * @see yfiles.tree.SubtreeShape#appendTargetPoints - * @type {number} - */ - connectorY:number; - /** - * Gets the direction of the last connector segment. - * @type {yfiles.tree.ConnectorDirection} - */ - connectorDirection:yfiles.tree.ConnectorDirection; - /** - * Gets the current minimum x-coordinate of this {@link yfiles.tree.SubtreeShape} instance. - * @type {number} - */ - minX:number; - /** - * Gets the current minimum y-coordinate of this {@link yfiles.tree.SubtreeShape} instance. - * @type {number} - */ - minY:number; - /** - * Gets the current maximum x-coordinate of this {@link yfiles.tree.SubtreeShape} instance. - * @type {number} - */ - maxX:number; - /** - * Gets the current maximum y-coordinate of this {@link yfiles.tree.SubtreeShape} instance. - * @type {number} - */ - maxY:number; - /** - * Gets the current x-coordinate of the origin of this {@link yfiles.tree.SubtreeShape} instance. - *

- * The origin is defined as the upper left corner of the {@link yfiles.layout.INodeLayout} of the local root of this shape. - *

- * @type {number} - */ - originX:number; - /** - * Gets the current y-coordinate of the origin of this {@link yfiles.tree.SubtreeShape} instance. - *

- * The origin is defined as the upper left corner of the {@link yfiles.layout.INodeLayout} of the local root of this shape. - *

- * @type {number} - */ - originY:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.SubtreeShape; - } - /** - * This layout algorithm arranges graphs with a tree structure. - *

- * Layout Style {@link yfiles.tree.TreeLayout} provides multiple different arrangements of trees and subtrees. It is easy to customize the - * {@link yfiles.tree.TreeLayout#OUT_EDGE_COMPARER_DP_KEY order of edges}, the {@link yfiles.tree.TreeLayout#PORT_ASSIGNMENT_DP_KEY port assignment} and the {@link yfiles.tree.TreeLayout#NODE_PLACER_DP_KEY arrangement of the nodes} for each subtree. - *

- *

- * Tree layout algorithms are commonly applied to visualize relational data and produce diagrams of high quality that are - * able to reveal possible hierarchic properties of the graph. More precisely, they find applications in dataflow analysis, - * software engineering, bioinformatics and business administration. - *

- *

- * {@graph {"ann": {"s": [37.5,37.5], "d": 1},"n": [[209.96,0], [71.88,77.5], [348.04,77.5], [348.04,155], [202.77,232.5], [172.5,310], [71.88,232.5], [115,387.5], [115,310], [233.04,310], [71.88,155], [348.04,232.5], [319.29,310], [376.79,310], [463.04,232.5], [491.79,310], [434.29,310], [28.75,310], [57.5,387.5], [0,387.5], [376.79,387.5], [261.79,387.5], [204.29,387.5]], "e": [[0,1], [0,2], [2,3], [3,4], [4,5], [6,8], [8,7], [4,9], [1,10], [10,6], [3,11], [11,12], [11,13], [3,14], [14,15], [14,16], [6,17], [17,18], [17,19], [13,20], [9,21], [9,22]], "vp": [0.0,0.0,530.0,425.0]}} Example graph with a layout calculated by {@link yfiles.tree.TreeLayout} using default settings {@graph {"ann": {"s": [60,30], "d": 1},"n": [[1190,0], [0,50], [160,120], [80,120], [240,120], [120,190], [200,190], [280,190], [160,310], [80,310], [240,310], [120,240], [200,240], [280,240], [330,50], [460,256.6], [410,306.6], [510,306.6], [410,356.6], [510,356.6], [460,406.6], [650,441.6], [410,491.6], [490,491.6], [570,491.6], [710,50], [790,100], [870,170], [950,170], [1030,170], [1110,170], [1190,170], [870,240], [950,240], [1030,240], [1110,240], [1190,240], [870,310], [950,310], [1030,310], [1110,310], [1190,310], [870,380], [950,380], [1030,380], [1110,380], [1190,380], [430,120], [500,170], [540,206.6], [580,170], [620,206.6], [660,170], [80,520], [160,430], [160,480], [226.6,405], [226.6,455], [160,380], [790,465], [870,430], [950,430], [950,500], [1030,465], [870,500]], "e": [[0,1,[30,15]], [1,2,[30,100,190,100]], [2,3,[190,170,110,170]], [2,4,[190,170,270,170]], [2,5,[190,170,150,170]], [2,6,[190,170,230,170]], [2,7,[190,170,310,170]], [1,8,[30,360,190,360]], [8,9,[190,290,110,290]], [8,10,[190,290,270,290]], [8,11,[190,290,150,290]], [8,12,[190,290,230,290]], [8,13,[190,290,310,290]], [0,14,[360,15]], [14,15,[360,271.6]], [15,16,[490,321.6]], [15,17,[490,321.6]], [15,18,[490,371.6]], [15,19,[490,371.6]], [15,20], [14,21,[360,456.6]], [21,22,[440,456.6]], [21,23,[520,456.6]], [21,24,[600,456.6]], [0,25,[740,15]], [25,26,[740,115]], [26,27,[860,115,860,150,900,150]], [26,28,[860,115,860,150,980,150]], [26,29,[860,115,860,150,1060,150]], [26,30,[860,115,860,150,1140,150]], [26,31,[860,115,860,150,1220,150]], [26,32,[860,115,860,220,900,220]], [26,33,[860,115,860,220,980,220]], [26,34,[860,115,860,220,1060,220]], [26,35,[860,115,860,220,1140,220]], [26,36,[860,115,860,220,1220,220]], [26,37,[860,115,860,290,900,290]], [26,38,[860,115,860,290,980,290]], [26,39,[860,115,860,290,1060,290]], [26,40,[860,115,860,290,1140,290]], [26,41,[860,115,860,290,1220,290]], [26,42,[860,115,860,360,900,360]], [26,43,[860,115,860,360,980,360]], [26,44,[860,115,860,360,1060,360]], [26,45,[860,115,860,360,1140,360]], [26,46,[860,115,860,360,1220,360]], [14,47,[360,100,410,100,410,135]], [47,48,[530,135]], [47,49,[570,135]], [47,50,[610,135]], [47,51,[650,135]], [47,52,[690,135]], [1,53,[30,535]], [53,54,[110,445]], [53,55,[110,495]], [53,56,[110,420]], [53,57,[110,470]], [53,58,[110,395]], [25,59,[740,480]], [59,60,[900,480]], [59,61,[980,480]], [59,62,[980,480]], [59,63], [59,64,[900,480]]], "vp": [0.0,0.0,1250.0,550.0]}} Tree layout using different - * {@link yfiles.tree.INodePlacer}s and rotationsConcept - *

- *

- * The layout algorithm starts from the leaves and continues with their parents, then with the parents of the parents and - * so on. When a node is processed, the algorithm will use the corresponding {@link yfiles.tree.INodePlacer} instance to move its - * children (along with their subtrees) to a suitable position and to route the outgoing edges of this node. Then, the next - * local root node will be processed. - *

- *

- * To avoid moving all nodes several times and to know the area that the subtrees occupy, the layout algorithm uses - * {@link yfiles.tree.SubtreeShape}s. These {@link yfiles.tree.SubtreeShape}s are moved and merged during layout calculation. - *

- *

- * Features - *

- *

- * Each subtree can have a different style of node placement. {@link yfiles.tree.INodePlacer}s are responsible for arranging - * subtrees and their common root node. They can be specified separately for each local root with a {@link yfiles.algorithms.IDataProvider} - * registered with the graph using key {@link yfiles.tree.TreeLayout#NODE_PLACER_DP_KEY}. - *

- *

- * A custom node can be defined as root of the tree using a {@link yfiles.algorithms.IDataProvider} registered with the graph with - * key {@link yfiles.tree.TreeLayout#SELECTED_ROOT_DP_KEY}. - *

- *

- * The layout algorithm can be configured to reserve space for node labels and place the edge labels along edges such that - * the labels won't overlap with other graph elements. Edge labels are placed according to the information stored in a {@link yfiles.layout.PreferredPlacementDescriptor} - * instance. However, the placement along the edge will only affect the order of multiple labels at the same edge. The - * algorithm will always place the labels close to the target node. - *

- *

- * Grouping of nodes can also be handled by this layout algorithm. It is important that a group node contains a whole - * subtree. Otherwise, the group nodes may overlap with each other or with other nodes. Furthermore, the user may specify - * minimum size constraints for each group node using {@link yfiles.algorithms.IDataProvider} key - * {@link yfiles.layout.GroupingKeys#MINIMUM_NODE_SIZE_DP_KEY}. - *

- *

- * {@link yfiles.tree.TreeLayout} supports custom sorting of the outgoing edges of a node. For example, a {@link yfiles.tree.INodePlacer} - * instance that implements {@link yfiles.tree.IFromSketchNodePlacer} provides a comparator that keeps the current order of - * siblings, allowing to extend the graph incrementally. - *

- *

- * This layout algorithm can only handle graphs with a tree structure. To apply it to a general graph, a {@link yfiles.tree.TreeReductionStage} - * can be appended. This stage will temporarily remove some edges of the input graph until a tree is obtained. After the - * layout calculation, the stage will reinsert the edges that were removed and route them separately. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface TreeLayout extends yfiles.layout.MultiStageLayout{} - export class TreeLayout { - /** - * Creates a new {@link yfiles.tree.TreeLayout} instance with default settings. - */ - constructor(); - /** - * Creates a {@link yfiles.tree.SubtreeShape} for the given node that consists only of the bounds of this particular node. - *

- * It may also include node labels or {@link yfiles.layout.NodeHalo}s. - *

- *

- * This method may be overridden to return a custom {@link yfiles.tree.SubtreeShape} for the given node. - *

- * @param node the given node - * @returns a {@link } instance - */ - createNodeShape(node:yfiles.algorithms.Node):yfiles.tree.SubtreeShape; - /** - * Returns a list of edges that need to be reversed in order to obtain a valid rooted and directed tree from the input - * graph. - *

- * The root node of the tree is either a node marked by a {@link yfiles.algorithms.IDataProvider} registered with the graph with - * key {@link yfiles.tree.TreeLayout#SELECTED_ROOT_DP_KEY} or is defined according to {@link yfiles.algorithms.Trees#getRoot}. - *

- *

- * This method is called initially to calculate a rooted tree from the input graph. It may be overridden to apply a custom - * algorithm that determines which edges need to be reversed. - *

- * @returns a list of edges that need to be reversed - * @see yfiles.tree.TreeLayout#reverseEdges - * @protected - */ - directTree():yfiles.algorithms.EdgeList; - /** - * Returns the {@link yfiles.tree.INodePlacer} instance that is used for the placement of the local root node and the - * {@link yfiles.tree.SubtreeShape}s. - *

- * The method may be overridden to return custom {@link yfiles.tree.INodePlacer} instances. It is possible to return a shared - * instance for multiple different nodes because the instances are not used after subsequent calls to this method. - *

- *

- * The current implementation returns the {@link yfiles.tree.INodePlacer} defined by the {@link yfiles.algorithms.IDataProvider} registered - * with key {@link yfiles.tree.TreeLayout#NODE_PLACER_DP_KEY}. It falls back to the default {@link yfiles.tree.INodePlacer} if there is no - * specific {@link yfiles.tree.INodePlacer} for the given node. - *

- * @param localRoot the root of the local subtree - * @returns the {@link } instance that places the subtree below the given local root node - * @see yfiles.tree.TreeLayout#NODE_PLACER_DP_KEY - * @see yfiles.tree.TreeLayout#defaultNodePlacer - * @protected - */ - getNodePlacer(localRoot:yfiles.algorithms.Node):yfiles.tree.INodePlacer; - /** - * Returns the {@link yfiles.collections.IComparer.} instance that will sort the outgoing edges connecting to the given node. - *

- * The {@link yfiles.collections.IComparer.} can be null in case the initial edge order shall be used. - *

- *

- * The method may be overridden to return custom {@link yfiles.collections.IComparer.} instances. It is possible to return a shared instance for multiple - * different nodes because the instances are not used after subsequent calls to this method. - *

- *

- * The current implementation returns the {@link yfiles.collections.IComparer.} defined in the {@link yfiles.algorithms.IDataProvider} registered with key - * {@link yfiles.tree.TreeLayout#OUT_EDGE_COMPARER_DP_KEY}. It falls back to the default {@link yfiles.collections.IComparer.} if there is no specific {@link yfiles.collections.IComparer.} for the given - * node. - *

- * @param localRoot the root of the local subtree - * @returns the {@link } or null that sorts the outgoing edges of the given node - * @see yfiles.tree.TreeLayout#OUT_EDGE_COMPARER_DP_KEY - * @see yfiles.tree.TreeLayout#defaultOutEdgeComparer - */ - getOutEdgeComparer(localRoot:yfiles.algorithms.Node):yfiles.collections.IComparer; - /** - * Returns the {@link yfiles.tree.IPortAssignment} instance that places the ports of the connecting edges of the given node. - *

- * The method may be overridden to return customized {@link yfiles.tree.IPortAssignment} instances. It is possible to return a - * shared instance for multiple different nodes because the instances are not used after subsequent calls to this method. - *

- *

- * The current implementation returns the {@link yfiles.tree.IPortAssignment} defined by the {@link yfiles.algorithms.IDataProvider} - * registered with key {@link yfiles.tree.TreeLayout#OUT_EDGE_COMPARER_DP_KEY}. It falls back to the default {@link yfiles.tree.IPortAssignment} - * if there is no specific {@link yfiles.tree.IPortAssignment} for the given node. - *

- * @param localRoot the root of the local subtree - * @returns the {@link } instance that assigns the ports of the edges at the given node - * @see yfiles.tree.TreeLayout#PORT_ASSIGNMENT_DP_KEY - * @see yfiles.tree.TreeLayout#defaultPortAssignment - * @protected - */ - getPortAssignment(localRoot:yfiles.algorithms.Node):yfiles.tree.IPortAssignment; - /** - * Returns an array of the nodes that will be laid out. - *

- * The given node will be considered as the root of the tree. The order of the elements ensures that no parent is processed - * before one of its successors. - *

- *

- * This method may be overridden to change the order in which the nodes (and their subtrees) are handled. However, it is - * important to keep the parents after the successors. Only siblings can change places. - *

- * @param root the node to be considered as root of the tree - * @returns an array of nodes that will be laid out - * @protected - */ - getRootsArray(root:yfiles.algorithms.Node):yfiles.algorithms.Node[]; - /** - * Provides access to the {@link yfiles.tree.SubtreeShape} for the given node. - *

- * The {@link yfiles.tree.SubtreeShape} contains information about the current extent and location of the subtree rooted at the - * node. It should only be modified during the layout of the parent node. Also, it won't be initialized before the layout - * of the corresponding subtree is calculated. - *

- *

- * This method updates the {@link yfiles.tree.SubtreeShape} in {@link yfiles.tree.TreeLayout#layoutRoot}. - *

- * @param localRoot the root of the subtree - * @returns the {@link } instance if it has already been calculated, null otherwise - * @protected - */ - getSubtreeShape(localRoot:yfiles.algorithms.Node):yfiles.tree.SubtreeShape; - /** - * Calculates the layout for the given root node and its subtrees. - *

- * This method is invoked for each node in the tree exactly once. Thus, children are always handled before their parents. - * In this manner, the subtrees already have a layout and can be arranged with their parent. - *

- *

- * To retrieve the shapes of the subtrees of all children of the local root, this method uses - * {@link yfiles.tree.TreeLayout#getSubtreeShape}. - *

- *

- * The method may be overridden to add configuration code. - *

- * @param localRoot the root of the subtree that whose layout is calculated - * @returns the combined {@link } of the local root node and all of its children and connecting edges - * @protected - */ - layoutRoot(localRoot:yfiles.algorithms.Node):yfiles.tree.SubtreeShape; - /** - * Reverses the direction of given edges. - *

- * This method will be called initially after the {@link yfiles.tree.TreeLayout#directTree} method and finally after the layout has - * been calculated. It may be overridden to additionally reverse data that depends on the direction of the edges. - *

- * @param reversedEdges the edges that will be reversed - * @protected - */ - reverseEdges(reversedEdges:yfiles.algorithms.EdgeList):void; - /** - * Data provider key for specifying a child node placer for each node - * @see yfiles.tree.TreeLayout#defaultNodePlacer - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_PLACER_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for assigning ports to nodes - * @see yfiles.tree.TreeLayout#defaultPortAssignment - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static PORT_ASSIGNMENT_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for specifying the comparator for the outgoing edges - * @see yfiles.tree.TreeLayout#defaultOutEdgeComparer - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.>} - */ - static OUT_EDGE_COMPARER_DP_KEY:yfiles.algorithms.NodeDpKey>; - /** - * Data provider key for defining the priority of critical edges - *

- * The layout algorithm tries to align each node pair that is connected by a critical edge (integer value > - * 0). This feature can, for example, be used for highlighting different edge paths that are important for a user. - * Conflicts between different critical edges are always resolved in favor of the higher priority. - *

- *

- * Critical edges will always align the centers of source and target node, thus replacing the current root alignment of the - * {@link yfiles.tree.INodePlacer}. - *

- *

- * The critical edge may not be straight if subtrees are rotated or port constraints are assigned. - *

- *

- * This feature is only supported by the following {@link yfiles.tree.INodePlacer}s: - *

- *
    - *
  • {@link yfiles.tree.DefaultNodePlacer}
  • - *
  • {@link yfiles.tree.SimpleNodePlacer}
  • - *
  • {@link yfiles.tree.LayeredNodePlacer}
  • - *
  • {@link yfiles.tree.DoubleLineNodePlacer}
  • - *
  • {@link yfiles.tree.DendrogramNodePlacer}
  • - *
- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static CRITICAL_EDGE_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for retrieving descriptors for nodes in multi-parent structures - *

- * The returned descriptor affects the layout of the multi-parent structure. - *

- * @see yfiles.tree.TreeLayout#multiParentAllowed - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static MULTI_PARENT_DESCRIPTOR_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for marking the node that will be used as root node of the tree - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static SELECTED_ROOT_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * The input graph for which a layout is calculated. - * @protected - * @type {yfiles.layout.LayoutGraph} - */ - graph:yfiles.layout.LayoutGraph; - /** - * Gets or sets whether or not group nodes are handled by the layout algorithm. - * @type {boolean} - */ - groupingSupported:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. - * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled - * @see yfiles.layout.MultiStageLayout#componentLayout - * @see yfiles.layout.ComponentLayout - * @type {boolean} - */ - componentLayoutEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing parallel edges is activated. - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouterEnabled - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouter - * @see yfiles.router.ParallelEdgeRouter - * @type {boolean} - */ - parallelEdgeRouterEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. - * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled - * @see yfiles.layout.MultiStageLayout#selfLoopRouter - * @see yfiles.layout.SelfLoopRouter - * @type {boolean} - */ - selfLoopRouterEnabled:boolean; - /** - * Gets a {@link yfiles.algorithms.IDataAcceptor} that can overwrite the source {@link yfiles.layout.PortConstraint port contraint} temporarily used during the layout. - *

- * This method sets temporary source {@link yfiles.layout.PortConstraint}s, e.g., after edge reversal. It may be overridden to - * handle those {@link yfiles.layout.PortConstraint}s separately. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.algorithms.IDataAcceptor} - */ - sourcePortConstraintDataAcceptor:yfiles.algorithms.IDataAcceptor; - /** - * Gets a {@link yfiles.algorithms.IDataAcceptor} that can overwrite the target {@link yfiles.layout.PortConstraint port contraint} temporarily used during the layout. - *

- * This method sets temporary target {@link yfiles.layout.PortConstraint}s, e.g., after edge reversal. It may be overridden to - * handle those {@link yfiles.layout.PortConstraint}s separately. - *

- * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @protected - * @type {yfiles.algorithms.IDataAcceptor} - */ - targetPortConstraintDataAcceptor:yfiles.algorithms.IDataAcceptor; - /** - * Gets a {@link yfiles.algorithms.IDataAcceptor} that can be used for temporarily overwriting the source group information used - * during the layout. - *

- * This method may be overridden to handle those edge groups separately. - *

- * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @protected - * @type {yfiles.algorithms.IDataAcceptor} - */ - sourceGroupDataAcceptor:yfiles.algorithms.IDataAcceptor; - /** - * Gets a {@link yfiles.algorithms.IDataAcceptor} that can be used for temporarily overwriting the target group information used - * during the layout. - *

- * This method may be overridden to handle those edge groups separately. - *

- * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @protected - * @type {yfiles.algorithms.IDataAcceptor} - */ - targetGroupDataAcceptor:yfiles.algorithms.IDataAcceptor; - /** - * Gets or sets the default {@link yfiles.tree.INodePlacer} instance that arranges all subtrees that do not have a specific {@link yfiles.tree.INodePlacer} - * assigned using a {@link yfiles.algorithms.IDataProvider}. - * @throws {Stubs.Exceptions.ArgumentError} if the default {@link yfiles.tree.INodePlacer} is set to null - * @see yfiles.tree.TreeLayout#NODE_PLACER_DP_KEY - * @type {yfiles.tree.INodePlacer} - */ - defaultNodePlacer:yfiles.tree.INodePlacer; - /** - * Gets or sets the default {@link yfiles.tree.INodePlacer} instance that places the leaf nodes of the tree. - * @throws {Stubs.Exceptions.ArgumentError} if the default {@link yfiles.tree.INodePlacer} is set to null - * @see yfiles.tree.TreeLayout#defaultNodePlacer - * @type {yfiles.tree.INodePlacer} - */ - defaultLeafPlacer:yfiles.tree.INodePlacer; - /** - * Gets or sets the default {@link yfiles.tree.IPortAssignment} instance for all subtrees that do not have a specific {@link yfiles.tree.IPortAssignment} - * assigned using a {@link yfiles.algorithms.IDataProvider}. - * @throws {Stubs.Exceptions.ArgumentError} if the default {@link yfiles.tree.IPortAssignment} is set to null - * @see yfiles.tree.TreeLayout#PORT_ASSIGNMENT_DP_KEY - * @type {yfiles.tree.IPortAssignment} - */ - defaultPortAssignment:yfiles.tree.IPortAssignment; - /** - * Gets or sets the default {@link yfiles.collections.IComparer.} instance that sorts the outgoing edges in all subtrees that do not have a specific {@link yfiles.collections.IComparer.} assigned - * using a {@link yfiles.algorithms.IDataProvider}. - * @see yfiles.tree.TreeLayout#OUT_EDGE_COMPARER_DP_KEY - * @type {yfiles.collections.IComparer.} - */ - defaultOutEdgeComparer:yfiles.collections.IComparer; - /** - * Gets or sets whether or not the layout algorithm reserves space for node labels. - *

- * If this feature is enabled, the {@link yfiles.tree.SubtreeShape} of the nodes will also hold the shapes of its labels. - *

- * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Gets or sets whether or not edge labels are placed by the layout algorithm. - *

- * If this is enabled, the {@link yfiles.tree.SubtreeShape}s of the subtrees are extended by the edge labels. - *

- *

- * The layout algorithm uses the information of {@link yfiles.layout.PreferredPlacementDescriptor} for an edge label to determine - * the corresponding placement. However, edge labels are always placed at the target side of the edge. The placement along - * the edge only affects the order of the edge labels at the same edge. - *

- * @type {boolean} - */ - integratedEdgeLabeling:boolean; - /** - * Gets or sets whether or not multi-parent structures are allowed for this tree layout. - *

- * If multi-parent structures are allowed, the directed input graph may contain structures of multiple nodes that share the - * same predecessors as well as the same successors. All nodes belonging to such a structure are placed side by side and - * the incident edges are routed in a bus-style manner. - *

- * @type {boolean} - */ - multiParentAllowed:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.TreeLayout; - } - /** - * The {@link yfiles.tree.TreeReductionStage} temporarily reduces general graphs to trees. - *

- * Layout Style - *

- *

- * This stage prepares a non-tree graph such that it can be processed by a tree layout algorithm. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[150,0],[260,70],[210,70],[260,140],[310,210],[335,280],[75,70],[285,280],[25,70],[25,140],[75,140],[150,70],[25,210],[185,280],[175,140],[50,280],[0,280],[210,210],[235,280],[125,140]],"e":[[0,1,[165,50,275,50]],[0,2,[165,50,225,50]],[1,3],[3,4,[275,190,325,190]],[4,5,[325,260,350,260]],[0,6,[165,50,90,50]],[4,7,[325,260,300,260]],[0,8,[165,50,40,50]],[8,9],[6,10],[0,11],[9,12],[11,14,[165,120,190,120]],[12,15,[40,260,65,260]],[12,16,[40,260,15,260]],[3,17,[275,190,225,190]],[17,13,[225,260,200,260]],[17,18,[225,260,250,260]],[11,19,[165,120,140,120]],[2,11,1],[12,13,1],[17,14,1]],"vp":[0.0,0.0,365.0,310.0]}} - *

- *

- * The non-tree edges are marked - *

- *

- * Concept This {@link yfiles.layout.ILayoutStage} works in three steps: - *

- *
    - *
  1. Remove some edges to get a tree or forest from the graph
  2. - *
  3. Invoke the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} which supports tree graph handling
  4. - *
  5. Reinsert all previously removed edges
  6. - *
  7. - * Optionally route these edges using the non-tree edge router and place their labels using the non-tree edge labeling - * algorithm. - *
  8. - *
- *

- * Features - *

- *

- * The routing of the temporarily hidden non-tree edges can be customized by specifying an {@link yfiles.tree.TreeReductionStage#nonTreeEdgeRouter edge routing algorithm} for those - * edges. Similarly, the placement of edge labels of non-tree edges can be delegated to a custom - * {@link yfiles.tree.TreeReductionStage#nonTreeEdgeLabelingAlgorithm edge labeling algorithm}. As default, both custom algorithms are not specified and, thus, non-tree edges are not routed - * and edge labels not placed. - *

- *

- * This stage is also able to handle multi-parent structures, i.e., structures of multiple nodes that share the same - * predecessors as well as the same successors. More precisely, if the specified {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} supports - * multi-parent structures (see {@link yfiles.tree.TreeLayout#multiParentAllowed}) and option {@link yfiles.tree.TreeReductionStage#multiParentAllowed} is enabled, this stage does not hide such structures, i.e., the multi-parent - * structures are passed to the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- *

- * Non-tree edges can also be bundled together such that their common parts are to some degree merged into a bundled part. - * The edge bundling can be specified by means of method {@link yfiles.tree.TreeReductionStage#edgeBundling}. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface TreeReductionStage extends yfiles.layout.LayoutStageBase{} - export class TreeReductionStage { - /** - * Creates a new {@link yfiles.tree.TreeReductionStage} instance with the given core layout algorithm and default settings. - * @param core the core layout algorithm - */ - constructor(core:yfiles.layout.ILayoutAlgorithm); - /** - * Creates a new {@link yfiles.tree.TreeReductionStage} instance with default settings. - */ - constructor(); - /** - * Creates a routing algorithm that routes edges as a single straight segment. - *

- * The created instance can be used for {@link yfiles.tree.TreeReductionStage#nonTreeEdgeRouter routing non-tree edges}. - *

- * @returns an edge routing algorithm that produces straight-line edges - * @see yfiles.tree.TreeReductionStage#nonTreeEdgeRouter - */ - createStraightLineRouter():yfiles.layout.ILayoutAlgorithm; - /** - * Routes all edges that do not belong to the chosen spanning tree. - *

- * This method is called by {@link yfiles.tree.TreeReductionStage#applyLayout} after the tree was arranged by the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. It may be overridden to apply custom edge routes. - *

- * @param graph the graph containing tree and non-tree edges - * @param nonTreeEdgeMap the {@link } that marks all non-tree edges in the graph - * @protected - */ - routeNonTreeEdges(graph:yfiles.layout.LayoutGraph,nonTreeEdgeMap:yfiles.algorithms.IEdgeMap):void; - /** - * Data provider key for explicitly marking (some) edges that should not be considered for the tree - * @see yfiles.tree.TreeReductionStage#nonTreeEdgeRouter - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static NON_TREE_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets whether or not multi-parent structures (structures of multiple nodes that share the same predecessors as - * well as the same successors) are allowed. - *

- * More precisely, if this option is enabled and the specified {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} can handle multi-parent structures - * (see {@link yfiles.tree.TreeLayout#multiParentAllowed}), this stage does not hide such structures, but the multi-parent structures are passed on to the {@link yfiles.layout.LayoutStageBase#coreLayout} core layout - * algorithm}. - *

- * @type {boolean} - */ - multiParentAllowed:boolean; - /** - * Gets or sets the edge routing algorithm that is applied to all non-tree edges. - * @see yfiles.tree.TreeReductionStage#nonTreeEdgeSelectionKey - * @type {yfiles.layout.ILayoutAlgorithm} - */ - nonTreeEdgeRouter:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that will be used by the {@link yfiles.tree.TreeReductionStage#nonTreeEdgeRouter non-tree edge routing algorithm} - * to determine the edges that need to be routed. - * @see yfiles.tree.TreeReductionStage#nonTreeEdgeRouter - * @type {any} - */ - nonTreeEdgeSelectionKey:any; - /** - * Gets or sets the labeling algorithm that is applied to all edge labels that belong to non-tree edges. - *

- * It is required that a suitable {@link yfiles.tree.TreeReductionStage#nonTreeEdgeLabelSelectionKey edge label selection key} is set. Otherwise, the edge labeling algorithm might also place - * labels of tree edges. - *

- * @see yfiles.tree.TreeReductionStage#nonTreeEdgeLabelSelectionKey - * @type {yfiles.layout.ILayoutAlgorithm} - */ - nonTreeEdgeLabelingAlgorithm:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that is used by the {@link yfiles.tree.TreeReductionStage#nonTreeEdgeLabelingAlgorithm non-tree edge labeling algorithm} - * to determine which edge labels it should place. - * @see yfiles.tree.TreeReductionStage#nonTreeEdgeLabelingAlgorithm - * @type {any} - */ - nonTreeEdgeLabelSelectionKey:any; - /** - * Gets the {@link yfiles.layout.EdgeBundling} instance that defines the settings of the edge bundling feature. - *

- * The specified {@link yfiles.layout.EdgeBundling} defines global bundling properties. Settings for individual edges can be - * defined by assigning an {@link yfiles.layout.EdgeBundleDescriptor} to an edge using a {@link yfiles.algorithms.IDataProvider} registered - * with key {@link yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY}. To enable bundling for all non-tree edges, set a {@link yfiles.layout.EdgeBundling#defaultBundleDescriptor default bundle descriptor} - * which has {@link yfiles.layout.EdgeBundleDescriptor#bundled bundling} enabled. - *

- *

- * If the graph contains self-loops that belong to the set of non-tree edges, the stage will invoke the router defined for - * the non-tree edges in order to route them. In the case where this is not desired, the user has to hide them from the - * stage and route them afterwards as desired. - *

- * @type {yfiles.layout.EdgeBundling} - */ - edgeBundling:yfiles.layout.EdgeBundling; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.TreeReductionStage; - } - /** - * Specifies custom data for the {@link yfiles.tree.AspectRatioTreeLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface AspectRatioTreeLayoutData extends yfiles.layout.LayoutData{} - export class AspectRatioTreeLayoutData { - constructor(); - /** - * Gets or sets the mapping from nodes to the aspect ratio of their sub tree. - * @see yfiles.tree.AspectRatioTreeLayout#SUBTREE_ASPECT_RATIO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - subtreeAspectRatios:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes with sub trees to their placements. - * @see yfiles.tree.AspectRatioTreeLayout#ROOT_PLACEMENT_DP_KEY - * @see yfiles.tree.AspectRatioTreeLayout#getRootPlacement - * @type {yfiles.layout.ItemMapping.} - */ - rootPlacements:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to the routing policies of their sub trees. - * @see yfiles.tree.AspectRatioTreeLayout#SUBTREE_ROUTING_POLICY_DP_KEY - * @see yfiles.tree.AspectRatioTreeLayout#getSubtreeArrangement - * @type {yfiles.layout.ItemMapping.} - */ - subtreeRoutingPolicies:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.AspectRatioTreeLayoutData; - } - /** - * Specifies custom data for the {@link yfiles.tree.BalloonLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface BalloonLayoutData extends yfiles.layout.LayoutData{} - export class BalloonLayoutData { - constructor(); - /** - * Gets or sets the collection of nodes that should be arranged in an interleaved fashion. - * @see yfiles.tree.BalloonLayout#INTERLEAVED_NODES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - interleavedNodes:yfiles.layout.ItemCollection; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the mapping for marking the node that will be used as root node of the tree. - *

- * The custom root node selection induced by this property is only considered if the {@link yfiles.tree.BalloonLayout#rootNodePolicy root node policy} is set to - * {@link yfiles.tree.RootNodePolicy#SELECTED_ROOT}. - *

- * @see yfiles.tree.BalloonLayout#SELECTED_ROOT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - treeRoot:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping that provides a {@link yfiles.layout.PreferredPlacementDescriptor} instance for edge - * {@link yfiles.graph.ILabel}s. - * @see yfiles.layout.PreferredPlacementDescriptor - * @see yfiles.layout.LayoutGraphAdapter#EDGE_LABEL_LAYOUT_PREFERRED_PLACEMENT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLabelPreferredPlacement:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.BalloonLayoutData; - } - /** - * Specifies custom data for the {@link yfiles.tree.TreeLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface TreeLayoutData extends yfiles.layout.LayoutData{} - export class TreeLayoutData { - constructor(); - /** - * Gets or sets the mapping from nodes to their {@link yfiles.tree.INodePlacer}. - * @see yfiles.tree.TreeLayout#NODE_PLACER_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodePlacers:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.tree.IPortAssignment}. - * @see yfiles.tree.TreeLayout#PORT_ASSIGNMENT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - portAssignments:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to comparison functions used to sort the nodes' outgoing edges. - * @see yfiles.tree.TreeLayout#OUT_EDGE_COMPARER_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - outEdgeComparers:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourcePortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. - * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetPortConstraints:yfiles.layout.ItemMapping; - /** - * Gets or sets the collection of nodes the {@link yfiles.tree.AssistantNodePlacer} considers as assistants. - *

- * This collection is only considered if {@link yfiles.tree.TreeLayoutData#nodePlacers} returns any {@link yfiles.tree.AssistantNodePlacer} . - *

- * @see yfiles.tree.AssistantNodePlacer#ASSISTANT_NODE_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - assistantNodes:yfiles.layout.ItemCollection; - /** - * Gets or sets the collection of nodes the {@link yfiles.tree.DelegatingNodePlacer} places with its {@link yfiles.tree.DelegatingNodePlacer#primaryPlacer}. - *

- * This collection is only considered if {@link yfiles.tree.TreeLayoutData#nodePlacers} returns any {@link yfiles.tree.DelegatingNodePlacer} . - *

- * @see yfiles.tree.DelegatingNodePlacer#PRIMARY_NODES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - delegatingNodePlacersPrimaryNodes:yfiles.layout.ItemCollection; - /** - * Gets or sets a mapping from nodes to a boolean value that specifies whether a node should be placed left of the bus - * (true) or right of the bus (false). - *

- * This mapping is only considered if {@link yfiles.tree.TreeLayoutData#nodePlacers} returns a {@link yfiles.tree.LeftRightNodePlacer} . - *

- * @see yfiles.tree.LeftRightNodePlacer#LEFT_RIGHT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - leftRightPlacersLeftNodes:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to the index of the row the {@link yfiles.tree.GridNodePlacer} shall place the node in. - *

- * This collection is only considered if {@link yfiles.tree.TreeLayoutData#nodePlacers} returns any {@link yfiles.tree.GridNodePlacer} . - *

- * @see yfiles.tree.GridNodePlacer#ROW_INDEX_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - gridNodePlacerRowIndices:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the mapping for marking the node that will be used as root node of the tree. - * @see yfiles.tree.TreeLayout#SELECTED_ROOT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - treeRoot:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping that provides a {@link yfiles.layout.PreferredPlacementDescriptor} instance for edge - * {@link yfiles.graph.ILabel}s. - * @see yfiles.layout.PreferredPlacementDescriptor - * @see yfiles.layout.LayoutGraphAdapter#EDGE_LABEL_LAYOUT_PREFERRED_PLACEMENT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLabelPreferredPlacement:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.TreeLayoutData; - } - /** - * Specifies custom data for the {@link yfiles.tree.TreeReductionStage}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface TreeReductionStageData extends yfiles.layout.LayoutData{} - export class TreeReductionStageData { - constructor(); - /** - * Gets or sets the collection of edges explicitly marked as not belonging to a tree. - * @see yfiles.tree.TreeReductionStage#NON_TREE_EDGES_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - nonTreeEdges:yfiles.layout.ItemCollection; - /** - * Gets or sets the mapping of edges to their {@link yfiles.layout.EdgeBundleDescriptor}. - *

- * Bundling together multiple edges means that their common parts are to some degree merged into a bundled part. At the - * source and target point, the edges are again clearly split. - *

- *

- * If an edge is mapped to null, the {@link yfiles.layout.EdgeBundling#defaultBundleDescriptor default descriptor} is used. - *

- * @see yfiles.layout.EdgeBundleDescriptor - * @see yfiles.tree.TreeReductionStage#edgeBundling - * @type {yfiles.layout.ItemMapping.} - */ - edgeBundleDescriptors:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.tree.TreeReductionStageData; - } - }export namespace genealogy{ - /** - * This layout algorithm arranges genealogical graphs (family trees). - *

- * Layout Style The family trees consist of nodes that represent individuals and nodes that represent families. Individuals are - * connected via these family nodes. The graph is arranged in layers that describe generations. {@graph {"ann":{"s":[122.27,30],"d":1},"styles":{"5":{"c":1}},"n":[[364.55,210,[[405.01,234.35,41.35,18.7,"Mother"]]],[364.55,140,[[406.35,164.35,38.68,18.7,"Father"]]],[182.27,385,[[206.06,409.35,74.7,18.7,"Grandmother"]]],[182.27,315,[[209.39,339.35,68.04,18.7,"Grandfather"]]],[182.27,175,[[206.06,199.35,74.7,18.7,"Grandmother"]]],[182.27,105,[[209.39,129.35,68.04,18.7,"Grandfather"]]],[0,490,[[6.78,514.35,108.71,18.7,"Great-Grandmother"]]],[0,420,[[10.11,444.35,102.04,18.7,"Great-Grandfather"]]],[0,350,[[6.78,374.35,108.71,18.7,"Great-Grandmother"]]],[0,280,[[10.11,304.35,102.04,18.7,"Great-Grandfather"]]],[0,210,[[6.78,234.35,108.71,18.7,"Great-Grandmother"]]],[0,140,[[10.11,164.35,102.04,18.7,"Great-Grandfather"]]],[0,70,[[6.78,94.35,108.71,18.7,"Great-Grandmother"]]],[0,0,[[10.11,24.35,102.04,18.7,"Great-Grandfather"]]],[56.14,45,10,10,5],[56.14,185,10,10,5],[56.14,325,10,10,5],[56.14,465,10,10,5],[238.41,360,10,10,5],[238.41,150,10,10,5],[420.69,185,10,10,5],[556.82,245,[[597.95,269.35,40.02,18.7,"Sibling"]]],[556.82,315,[[597.95,339.35,40.02,18.7,"Sibling"]]],[556.82,175,[[602.29,199.35,31.35,18.7,"Child"]]]],"e":[[12,14],[13,14],[14,5,5,0,-61.14,0,[132.27,50,132.27,120]],[11,15],[10,15],[15,4,5,0,-61.14,0],[8,16],[9,16],[16,3,5,0,-61.14,0],[6,17],[7,17],[17,2,5,0,-61.14,0,[132.27,470,132.27,400]],[2,18],[3,18],[18,0,5,0,-61.14,0,[314.55,365,314.55,225]],[4,19],[5,19],[19,1,5,0,-61.14,0],[0,20],[1,20],[20,21,5,0,-61.14,0,[536.82,190,536.82,260]],[20,22,5,0,-61.14,0,[536.82,190,536.82,330]],[20,23,5,0,-61.14,0]],"vp":[0.0,0.0,680.0,520.0]}} - *

- *

- * Basic Family Tree - *

- *

- * Concept - *

- *

- * In order to determine whether a node represents an individual or a partnership, a {@link yfiles.algorithms.IDataProvider} has to - * be registered with key {@link yfiles.genealogy.FamilyTreeLayout#FAMILY_TYPE_DP_KEY}. If this {@link yfiles.algorithms.IDataProvider} is - * missing, an {@link yfiles.lang.Exception} will be thrown. - *

- *

- * This {@link yfiles.algorithms.IDataProvider} provides: - *

- *
    - *
  • {@link yfiles.genealogy.FamilyType#MALE} for a node representing a male individual.
  • - *
  • {@link yfiles.genealogy.FamilyType#FEMALE} for a node representing a female individual.
  • - *
  • {@link yfiles.genealogy.FamilyType#FAMILY} for a node representing a family.
  • - *
- *

- * All other values will be interpreted as if the node represents an individual. - *

- *

- * A {@link yfiles.genealogy.FamilyType#FAMILY} node links all members of a family. It can only have two incoming edges from the - * parents. Two nodes of the same type (families or individuals) cannot be directly connected. If the input graph violates - * these specifications, a {@link yfiles.lang.Exception} exception will be thrown. - *

- *

- * The layout is calculated basically in two steps: - *

- *
    - *
  • The families are laid out by the inner layouter in a compact way.
  • - *
  • - * The relations between these "family groups" and their children and other families are laid out by the - * {@link yfiles.genealogy.FamilyTreeLayout#topLayout top layout algorithm}. - *
  • - *
- *

- * Features - *

- *

- * The distances between nodes {@link yfiles.genealogy.FamilyTreeLayout#spacingBetweenFamilyMembers in the same generation} as well as between {@link yfiles.genealogy.FamilyTreeLayout#offsetForFamilyNodes individuals and family nodes} can be adjusted. - *

- *

- * Nodes in the same generation can be {@link yfiles.genealogy.FamilyTreeLayout#alignment aligned} at three different coordinates: top, center, bottom. - *

- *

- * The location of {@link yfiles.genealogy.FamilyType#FAMILY} nodes can be {@link yfiles.genealogy.FamilyTreeLayout#familyNodesAlwaysBelow specified} in relation to the partners. This placement - * can be set independently for {@link yfiles.genealogy.FamilyTreeLayout#partnerlessBelow parents}. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface FamilyTreeLayout extends yfiles.layout.MultiStageLayout{} - export class FamilyTreeLayout { - /** - * Creates a new instance of {@link yfiles.genealogy.FamilyTreeLayout} with default settings. - */ - constructor(); - /** - * Data provider key for assigning a node type for each node - *

- * The layout algorithm will handle the nodes according to this type. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static FAMILY_TYPE_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets the {@link yfiles.layout.ILayoutAlgorithm layout algorithm} that is responsible for the layout between family groups. - *

- * If the specified layout algorithm is null, fallback algorithm {@link yfiles.hierarchic.HierarchicLayout} is used. - *

- * @type {yfiles.layout.ILayoutAlgorithm} - */ - topLayout:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the spacing between two nodes representing members of the same family in one generation. - *

- * Values should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given spacing is negative - * @type {number} - */ - spacingBetweenFamilyMembers:number; - /** - * Gets or sets the offset by which a {@link yfiles.genealogy.FamilyType#FAMILY} node is shifted down if its parents are not direct - * neighbors. - *

- * Values should be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given offset is negative - * @type {number} - */ - offsetForFamilyNodes:number; - /** - * Gets or sets whether or not {@link yfiles.genealogy.FamilyType#FAMILY} nodes of individuals that have only children but no - * partners are placed below this individual or next to it. - * @type {boolean} - */ - partnerlessBelow:boolean; - /** - * Gets or sets whether or not {@link yfiles.genealogy.FamilyType#FAMILY} nodes are placed between or below the partners. - * @see yfiles.genealogy.FamilyType#FAMILY - * @type {boolean} - */ - familyNodesAlwaysBelow:boolean; - /** - * Gets or sets the vertical alignment of the individual nodes in the same generation. - * @throws {Stubs.Exceptions.ArgumentError} if the specified alignment is unknown - * @type {yfiles.genealogy.VerticalNodeAlignment} - */ - alignment:yfiles.genealogy.VerticalNodeAlignment; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing parallel edges is activated. - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouterEnabled - * @see yfiles.layout.MultiStageLayout#parallelEdgeRouter - * @see yfiles.router.ParallelEdgeRouter - * @type {boolean} - */ - parallelEdgeRouterEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. - * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled - * @see yfiles.layout.MultiStageLayout#selfLoopRouter - * @see yfiles.layout.SelfLoopRouter - * @type {boolean} - */ - selfLoopRouterEnabled:boolean; - /** - * Gets or sets the order of individuals in the same generation (siblings, partners) based on their sex. - * @throws {Stubs.Exceptions.ArgumentError} if the specified order is unknown - * @type {yfiles.genealogy.FamilyMembersSortingPolicy} - */ - familyMembersSortingPolicy:yfiles.genealogy.FamilyMembersSortingPolicy; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.genealogy.FamilyTreeLayout; - } - export enum FamilyType{ - /** - * Type specifier for nodes that connect partners with each other and their children. - * @see yfiles.genealogy.FamilyTreeLayout#FAMILY_TYPE_DP_KEY - */ - FAMILY, - /** - * Type specifier for nodes that represent men. - * @see yfiles.genealogy.FamilyTreeLayout#FAMILY_TYPE_DP_KEY - */ - MALE, - /** - * Type specifier for nodes that represent women. - * @see yfiles.genealogy.FamilyTreeLayout#FAMILY_TYPE_DP_KEY - */ - FEMALE - } - export enum VerticalNodeAlignment{ - /** - * Alignment specifier that defines that all nodes in the same layer (generation) are aligned based on their top - * coordinate. - *

- * The descriptions of the directions are based on {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM}. - *

- * @see yfiles.genealogy.FamilyTreeLayout#alignment - */ - TOP, - /** - * Alignment specifier that defines that all nodes in the same layer (generation) are aligned based on their center - * coordinate. - *

- * The descriptions of the directions are based on {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM}. - *

- * @see yfiles.genealogy.FamilyTreeLayout#alignment - */ - CENTER, - /** - * Alignment specifier that defines that all nodes in the same layer (generation) are aligned based on their bottom - * coordinate. - *

- * The descriptions of the directions are based on {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM}. - *

- * @see yfiles.genealogy.FamilyTreeLayout#alignment - */ - BOTTOM - } - export enum FamilyMembersSortingPolicy{ - /** - * Order specifier that disables sorting of individuals according to their sex. - * @see yfiles.genealogy.FamilyTreeLayout#familyMembersSortingPolicy - */ - NO_SORTING, - /** - * Order specifier that places female individuals before their male siblings and partners, if possible. - * @see yfiles.genealogy.FamilyTreeLayout#familyMembersSortingPolicy - */ - FEMALE_FIRST, - /** - * Order specifier that places female individuals before their male siblings and partners. - * @see yfiles.genealogy.FamilyTreeLayout#familyMembersSortingPolicy - */ - FEMALE_ALWAYS_FIRST, - /** - * Order specifier that places male individuals before their female siblings and partners, if possible. - * @see yfiles.genealogy.FamilyTreeLayout#familyMembersSortingPolicy - */ - MALE_FIRST, - /** - * Order specifier that places male individuals before their female siblings and partners. - * @see yfiles.genealogy.FamilyTreeLayout#familyMembersSortingPolicy - */ - MALE_ALWAYS_FIRST - } - /** - * Specifies custom data for the {@link yfiles.genealogy.FamilyTreeLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface FamilyTreeLayoutData extends yfiles.layout.LayoutData{} - export class FamilyTreeLayoutData { - constructor(); - /** - * Gets or sets the mapping from nodes to their family type. - * @see yfiles.genealogy.FamilyTreeLayout#FAMILY_TYPE_DP_KEY - * @see yfiles.genealogy.FamilyType - * @type {yfiles.layout.ItemMapping.} - */ - familyTypes:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.genealogy.FamilyTreeLayoutData; - } - }export namespace multipage{ - /** - * This class is a default implementation of interface {@link yfiles.multipage.IElementFactory}. - * @see yfiles.multipage.IElementFactory - * @class - * @implements {yfiles.multipage.IElementFactory} - */ - export interface DefaultElementFactory extends yfiles.lang.Object,yfiles.multipage.IElementFactory{} - export class DefaultElementFactory { - /** - * Creates a new instance of {@link yfiles.multipage.DefaultElementFactory}. - */ - constructor(); - /** - * - * @param context - * @param connector - * @param opposite - * @param origEdgeId - * @param atTarget - * @returns - */ - createConnectorEdge(context:yfiles.multipage.LayoutContext,connector:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,origEdgeId:any,atTarget:boolean):yfiles.algorithms.Edge; - /** - * - * @param context - * @param edgeIds - * @param representedNodeId - * @returns - */ - createConnectorNode(context:yfiles.multipage.LayoutContext,edgeIds:yfiles.algorithms.YList,representedNodeId:any):yfiles.algorithms.Node; - /** - * - * @param context - * @param proxyNode - * @param opposite - * @param replacingEdgeId - * @param origNodeId - * @returns - */ - createProxyEdge(context:yfiles.multipage.LayoutContext,proxyNode:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,replacingEdgeId:any,origNodeId:any):yfiles.algorithms.Edge; - /** - * - * @param context - * @param origNodeId - * @returns - */ - createProxyNode(context:yfiles.multipage.LayoutContext,origNodeId:any):yfiles.algorithms.Node; - /** - * - * @param context - * @param proxyReference - * @param opposite - * @param referencingCopyId - * @returns - */ - createProxyReferenceEdge(context:yfiles.multipage.LayoutContext,proxyReference:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,referencingCopyId:any):yfiles.algorithms.Edge; - /** - * - * @param context - * @param referringProxyId - * @returns - */ - createProxyReferenceNode(context:yfiles.multipage.LayoutContext,referringProxyId:any):yfiles.algorithms.Node; - /** - * Returns the default size for nodes created by this factory. - *

- * This method is called from {@link yfiles.multipage.DefaultElementFactory#createConnectorNode}, - * {@link yfiles.multipage.DefaultElementFactory#createProxyReferenceNode}, and/or - * {@link yfiles.multipage.DefaultElementFactory#createProxyNode}. It must return a non-null size with positive width and height. - *

- *

- * Subclasses may implement this method to use custom size values. - *

- * @param context an object providing relevant layout information, for example, the current graph as well as various information about the - * graph elements - * @param id the element ID - * @param type the type of the node to be created - * @returns the default size of the new node - * @protected - */ - getDefaultNodeSize(context:yfiles.multipage.LayoutContext,id:any,type:number):yfiles.algorithms.YDimension; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.multipage.DefaultElementFactory; - } - export enum EdgeType{ - /** - * An edge type that specifies a normal edge. - *

- * An edge is called normal if it does not belong to any other type. - *

- * @see yfiles.multipage.IEdgeInfo#type - */ - NORMAL, - /** - * An edge type that specifies a connector edge. - *

- * An edge is called connector if it is connected to a connector node (a node of {@link yfiles.multipage.INodeInfo#type type} - * {@link yfiles.multipage.NodeType#CONNECTOR}), i.e., it represents an edge of the input graph whose endpoints lie on different - * pages. - *

- * @see yfiles.multipage.IEdgeInfo#representedEdge - * @see yfiles.multipage.IEdgeInfo#type - * @see yfiles.multipage.NodeType#CONNECTOR - */ - CONNECTOR, - /** - * An edge type that specifies a proxy reference edge. - *

- * An edge is called proxy reference if it is connected to a proxy reference node (a node of {@link yfiles.multipage.INodeInfo#type type} - * {@link yfiles.multipage.NodeType#PROXY_REFERENCE}), i.e., a node that refers to a proxy of an original node lying on another - * page. - *

- * @see yfiles.multipage.IEdgeInfo#type - * @see yfiles.multipage.NodeType#PROXY_REFERENCE - */ - PROXY_REFERENCE, - /** - * An edge type that specifies a proxy edge. - *

- * An edge is called proxy if it is connected to a proxy node (a node of {@link yfiles.multipage.INodeInfo#type type} - * {@link yfiles.multipage.NodeType#PROXY}), i.e., a node that is a proxy of an original node lying on another page. - *

- * @see yfiles.multipage.IEdgeInfo#type - * @see yfiles.multipage.NodeType#PROXY - */ - PROXY - } - export enum GroupingMode{ - /** - * Node grouping specifier used when group nodes should be ignored. - * @see yfiles.multipage.MultiPageLayout#groupingMode - */ - IGNORE, - /** - * Node grouping specifier used when only original nodes should be assigned to group nodes. Hence, connector and proxy - * nodes (see {@link yfiles.multipage.NodeType#CONNECTOR} and - * {@link yfiles.multipage.NodeType#PROXY}) are never assigned to group nodes even though the associated node lies within a group. - * @see yfiles.multipage.MultiPageLayout#groupingMode - */ - ORIGINAL_NODES_ONLY, - /** - * Node grouping specifier used when special nodes like, e.g., connector and proxy nodes (see {@link yfiles.multipage.NodeType#CONNECTOR} - * and {@link yfiles.multipage.NodeType#PROXY}) should be assigned to group nodes, too. - * @see yfiles.multipage.MultiPageLayout#groupingMode - */ - ALL_NODES - } - export enum EdgeBundleModes{ - /** - * Edge bundle mode constant that specifies that all multi-edges (edges with same endpoints) should be distinguished. - * Hence, if such edges connect two nodes on different pages, a separate connector pair (see - * {@link yfiles.multipage.NodeType#CONNECTOR}) is used for each of them. - * @see yfiles.multipage.MultiPageLayout#edgeBundleModeMask - */ - DISTINGUISH_MULTI_EDGES, - /** - * Edge bundle mode constant that specifies that multi-edges (edges with same endpoints) should be distinguished if they - * have different directions. Hence, two edges with the same endpoints may share a connector pair (see - * {@link yfiles.multipage.NodeType#CONNECTOR}) if they point in the same direction (i.e., both have the same source and target - * node). - * @see yfiles.multipage.MultiPageLayout#edgeBundleModeMask - */ - DISTINGUISH_DIRECTIONS, - /** - * Edge bundle mode constant that specifies that multi-edges (edges with same endpoints) should be distinguished if they - * are of different (user specified) type, see {@link yfiles.multipage.MultiPageLayout#EDGE_TYPE_DP_KEY}. Hence, two edges with the - * same endpoints and same type may share a connector pair (see {@link yfiles.multipage.NodeType#CONNECTOR}). - * @see yfiles.multipage.MultiPageLayout#edgeBundleModeMask - * @see yfiles.multipage.MultiPageLayout#EDGE_TYPE_DP_KEY - */ - DISTINGUISH_TYPES - } - export enum NodeType{ - /** - * A node type that specifies a normal node. - *

- * A node is called normal if it does not belong to any other type. - *

- * @see yfiles.multipage.INodeInfo#type - */ - NORMAL, - /** - * A node type that specifies a group node. - *

- * A group node is a node that may contain other nodes. - *

- * @see yfiles.multipage.INodeInfo#type - */ - GROUP, - /** - * A node type that specifies a proxy node. - *

- * A proxy node is a copy of a {@link yfiles.multipage.NodeType#NORMAL normal node}. It is created by the algorithm if a normal node and its neighbors or associated {@link yfiles.multipage.NodeType#CONNECTOR connectors} - * do not fit onto a single page. Hence, in such cases, the neighbors/connectors associated with a normal node may be - * distributed among different proxy nodes associated with this node. - *

- * @see yfiles.multipage.INodeInfo#type - * @see yfiles.multipage.NodeType#NORMAL - * @see yfiles.multipage.NodeType#PROXY_REFERENCE - */ - PROXY, - /** - * A node type that specifies a proxy reference node. - *

- * For each {@link yfiles.multipage.NodeType#PROXY proxy node} there is exactly one matching proxy reference node. The reference node refers to the proxy and is - * either connected to the {@link yfiles.multipage.NodeType#NORMAL normal node} associated with this proxy or one of its other proxy nodes (a normal node may be - * associated with multiple proxy nodes). Hence, for a node connected to a proxy reference node there always exists a copy - * located on another page. - *

- * @see yfiles.multipage.INodeInfo#type - * @see yfiles.multipage.NodeType#PROXY - */ - PROXY_REFERENCE, - /** - * A node type that specifies a connector node. - *

- * Each edge of the input graph that connects two nodes v and w that are placed on different pages is split by a pair of - * matching connector nodes (one for each of the two pages). One of the connector nodes is connected to v and the other to - * w. Hence, each connector represents a jump mark to the matching connector and guarantees that no information is lost as - * it would be the case if such edges are simply removed. - *

- * @see yfiles.multipage.INodeInfo#type - */ - CONNECTOR - } - /** - * A class that holds all information associated with an edge. - * @interface - */ - export interface IEdgeInfo extends yfiles.lang.Object{ - /** - * Gets the unique ID of the associated edge. - * @see yfiles.multipage.MultiPageLayoutResult#getEdgeInfo - * @see yfiles.multipage.IElementInfoManager#getEdgeInfo - * @abstract - * @type {any} - */ - id:any; - /** - * Gets the type of the associated edge. - * @abstract - * @type {yfiles.multipage.EdgeType} - */ - type:yfiles.multipage.EdgeType; - /** - * Gets the original edge associated with this {@link yfiles.multipage.IEdgeInfo}. - *

- * More precisely, for edges of {@link yfiles.multipage.IEdgeInfo#type type} {@link yfiles.multipage.EdgeType#CONNECTOR}, this method returns the edge of the input graph - * that was split by the connector edge. Otherwise, it returns null. - *

- * @see yfiles.multipage.EdgeType#CONNECTOR - * @abstract - * @type {yfiles.algorithms.Edge} - */ - representedEdge:yfiles.algorithms.Edge; - } - var IEdgeInfo:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.multipage.IEdgeInfo; - }; - /** - * A class that holds all information related to an edge label. - * @interface - */ - export interface IEdgeLabelInfo extends yfiles.lang.Object{ - /** - * Gets the unique ID of the associated edge label. - * @see yfiles.multipage.MultiPageLayoutResult#getEdgeLabelInfo - * @see yfiles.multipage.IElementInfoManager#getEdgeLabelInfo - * @abstract - * @type {any} - */ - id:any; - } - var IEdgeLabelInfo:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.multipage.IEdgeLabelInfo; - }; - /** - * Factory used by class {@link yfiles.multipage.MultiPageLayout} to create special nodes and edges. - * @interface - */ - export interface IElementFactory extends yfiles.lang.Object{ - /** - * Callback method for creating an edge of type {@link yfiles.multipage.EdgeType#CONNECTOR}. - *

- * Such an edge connects the given {@link yfiles.multipage.NodeType#CONNECTOR connector} and opposite node. - *

- * @param context an object providing relevant layout information, for example, the current graph as well as various information about the - * graph elements - * @param connector the endpoint of the edge that represents the connector node - * @param opposite the other endpoint of the edge - * @param origEdgeId the ID of the edge that is split by the connector edge - * @param atTarget true if the connector node is the target of the edge, false otherwise - * @returns the created connector edge - * @see yfiles.multipage.EdgeType#CONNECTOR - * @see yfiles.multipage.NodeType#CONNECTOR - * @see yfiles.multipage.LayoutContext#createEdge - * @abstract - */ - createConnectorEdge(context:yfiles.multipage.LayoutContext,connector:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,origEdgeId:any,atTarget:boolean):yfiles.algorithms.Edge; - /** - * Callback method for creating a node of type {@link yfiles.multipage.NodeType#CONNECTOR}. - * @param context an object providing relevant layout information, for example, the current graph as well as various information about the - * graph elements - * @param edgesIds a {@link list} that contains the IDs of edges that are split by this connector - * @param representedNodeId the ID of the node that is represented by this connector - * @returns the created connector node - * @see yfiles.multipage.NodeType#CONNECTOR - * @see yfiles.multipage.LayoutContext#createNode - * @see yfiles.multipage.INodeInfo#representedNode - * @abstract - */ - createConnectorNode(context:yfiles.multipage.LayoutContext,edgesIds:yfiles.algorithms.YList,representedNodeId:any):yfiles.algorithms.Node; - /** - * Callback method for creating an edge of type {@link yfiles.multipage.EdgeType#PROXY}. - *

- * Such an edge should connect the given {@link yfiles.multipage.NodeType#PROXY proxy} and opposite node. - *

- * @param context an object providing relevant layout information, for example, the current graph as well as various information about the - * graph elements - * @param proxyNode the endpoint of the edge that represents the proxy node - * @param opposite the other endpoint of the new edge - * @param replacingEdgeId the ID of the related edge that is connected to the original node - * @param origNodeId the ID of the original node to which the proxy node refers - * @returns the created proxy edge - * @see yfiles.multipage.EdgeType#PROXY - * @see yfiles.multipage.NodeType#PROXY - * @see yfiles.multipage.LayoutContext#createEdge - * @abstract - */ - createProxyEdge(context:yfiles.multipage.LayoutContext,proxyNode:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,replacingEdgeId:any,origNodeId:any):yfiles.algorithms.Edge; - /** - * Callback method for creating a node of type {@link yfiles.multipage.NodeType#PROXY}. - * @param context an object providing relevant layout information, for example, the current graph as well as various information about the - * graph elements - * @param origNodeId the ID of the node for which a proxy has to be created - * @returns the created proxy node - * @see yfiles.multipage.LayoutContext#createNode - * @see yfiles.multipage.NodeType#PROXY_REFERENCE - * @see yfiles.multipage.NodeType#PROXY - * @abstract - */ - createProxyNode(context:yfiles.multipage.LayoutContext,origNodeId:any):yfiles.algorithms.Node; - /** - * Callback method for creating an edge of type {@link yfiles.multipage.EdgeType#PROXY_REFERENCE}. - *

- * Such an (undirected) edge should connect the given {@link yfiles.multipage.NodeType#PROXY_REFERENCE proxy reference} and opposite node. - *

- * @param context an object providing relevant layout information, for example, the current graph as well as various information about the - * graph elements - * @param proxyReference the endpoint of the edge that represents the proxy reference node - * @param opposite the other endpoint of the new edge - * @param referencingCopyId the ID of the proxy node that is referenced by the proxy reference node - * @returns the created proxy reference edge - * @see yfiles.multipage.EdgeType#PROXY_REFERENCE - * @see yfiles.multipage.NodeType#PROXY_REFERENCE - * @see yfiles.multipage.LayoutContext#createEdge - * @abstract - */ - createProxyReferenceEdge(context:yfiles.multipage.LayoutContext,proxyReference:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,referencingCopyId:any):yfiles.algorithms.Edge; - /** - * Callback method for creating a node of type {@link yfiles.multipage.NodeType#PROXY_REFERENCE}. - * @param context an object providing relevant layout information, for example, the current graph as well as various information about the - * graph elements - * @param referringProxyId the ID of the proxy to which the created node refers - * @returns the new proxy reference node - * @see yfiles.multipage.NodeType#PROXY_REFERENCE - * @see yfiles.multipage.LayoutContext#createNode - * @see yfiles.multipage.NodeType#PROXY - * @abstract - */ - createProxyReferenceNode(context:yfiles.multipage.LayoutContext,referringProxyId:any):yfiles.algorithms.Node; - } - var IElementFactory:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.multipage.IElementFactory; - }; - /** - * Interface that offers access to the information objects of graph elements. - * @interface - */ - export interface IElementInfoManager extends yfiles.lang.Object{ - /** - * Returns the edge information object of the given edge. - * @param edge the edge for which the information object should be returned - * @returns the edge information object of the given edge - * @abstract - */ - getEdgeInfo(edge:yfiles.algorithms.Edge):yfiles.multipage.IEdgeInfo; - /** - * Returns the edge label information object of the given edge label layout. - * @param edgeLabelLayout the edge label layout for which the information object should be returned - * @returns the edge label information object of the given edge label layout - * @abstract - */ - getEdgeLabelInfo(edgeLabelLayout:yfiles.layout.IEdgeLabelLayout):yfiles.multipage.IEdgeLabelInfo; - /** - * Returns the node information object of the given node. - * @param node the node for which the information object should be returned - * @returns the node information object of the given node - * @abstract - */ - getNodeInfo(node:yfiles.algorithms.Node):yfiles.multipage.INodeInfo; - /** - * Returns the node label layout information object of the given node label layout. - * @param nodeLabelLayout the node label layout for which the information object should be returned - * @returns the node label information object of the given node label layout - * @abstract - */ - getNodeLabelInfo(nodeLabelLayout:yfiles.layout.INodeLabelLayout):yfiles.multipage.INodeLabelInfo; - } - var IElementInfoManager:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.multipage.IElementInfoManager; - }; - /** - * Callback that is invoked when a {@link yfiles.multipage.MultiPageLayout} has calculated a new multi-page layout. - * @interface - */ - export interface ILayoutCallback extends yfiles.lang.Object{ - /** - * Invoked from {@link yfiles.multipage.MultiPageLayout#applyLayout} when a new multi-page layout has been calculated. - * @param result the result of the layout calculation - * @see yfiles.multipage.MultiPageLayout#applyLayout - * @abstract - */ - layoutDone(result:yfiles.multipage.MultiPageLayoutResult):void; - } - var ILayoutCallback:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.multipage.ILayoutCallback; - }; - /** - * This interface offers access to information associated with a node. - *

- * The information can be either obtained from {@link yfiles.multipage.MultiPageLayoutResult#getNodeInfo} or - * {@link yfiles.multipage.LayoutContext#getNodeInfo}. - *

- * @interface - */ - export interface INodeInfo extends yfiles.lang.Object{ - /** - * Gets the node of the input graph that is represented by the node associated with this {@link yfiles.multipage.INodeInfo info object}. - *

- * Note that, for the special nodes inserted to guarantee that no information is lost, there are no corresponding nodes in - * the input graph. Hence, special nodes are mapped to common nodes in the following way: - *

- *
    - *
  • A {@link yfiles.multipage.NodeType#CONNECTOR connector node} is mapped to the common node connected to the matching connector.
  • - *
  • A {@link yfiles.multipage.NodeType#PROXY proxy node} is mapped to the associated common node (i.e., the proxy is a copy of that node).
  • - *
  • A {@link yfiles.multipage.NodeType#PROXY_REFERENCE proxy reference node} is not mapped to any node, and, thus this method returns null for such nodes.
  • - *
- * @abstract - * @type {yfiles.algorithms.Node} - */ - representedNode:yfiles.algorithms.Node; - /** - * Gets the page number of the {@link yfiles.multipage.MultiPageLayoutResult#getPage page graph} that contains the node associated with this {@link yfiles.multipage.INodeInfo info object}. - * @abstract - * @type {number} - */ - pageNo:number; - /** - * Gets the type of the node associated with this {@link yfiles.multipage.INodeInfo info object}. - * @abstract - * @type {yfiles.multipage.NodeType} - */ - type:yfiles.multipage.NodeType; - /** - * Gets the unique ID of the node associated with this {@link yfiles.multipage.INodeInfo info object}. - * @see yfiles.multipage.MultiPageLayout#NODE_ID_DP_KEY - * @abstract - * @type {any} - */ - id:any; - /** - * Gets the node that refers to the one associated with this {@link yfiles.multipage.INodeInfo info object}. - *

- * More precisely, if the node associated with this info object - *

- *
    - *
  • is a {@link yfiles.multipage.NodeType#CONNECTOR connector node}, this method returns the matching connector node,
  • - *
  • is a {@link yfiles.multipage.NodeType#PROXY proxy node}, it returns the corresponding {@link yfiles.multipage.NodeType#PROXY_REFERENCE proxy reference node},
  • - *
  • is a {@link yfiles.multipage.NodeType#PROXY_REFERENCE proxy reference node}, it returns the corresponding {@link yfiles.multipage.NodeType#PROXY proxy node},
  • - *
  • or otherwise, it returns null.
  • - *
- * @see yfiles.multipage.NodeType#CONNECTOR - * @see yfiles.multipage.NodeType#PROXY - * @see yfiles.multipage.NodeType#PROXY_REFERENCE - * @abstract - * @type {yfiles.algorithms.Node} - */ - referencingNode:yfiles.algorithms.Node; - } - var INodeInfo:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.multipage.INodeInfo; - }; - /** - * A class that holds all information related to a node label. - * @interface - */ - export interface INodeLabelInfo extends yfiles.lang.Object{ - /** - * Gets the unique ID of the associated node label. - * @see yfiles.multipage.MultiPageLayoutResult#getNodeLabelInfo - * @see yfiles.multipage.IElementInfoManager#getNodeLabelInfo - * @abstract - * @type {any} - */ - id:any; - } - var INodeLabelInfo:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.multipage.INodeLabelInfo; - }; - /** - * This class represents the layout context. - *

- * It provides several methods to access data as well as adding and removing elements. - *

- * @class - * @implements {yfiles.multipage.IElementInfoManager} - */ - export interface LayoutContext extends yfiles.lang.Object,yfiles.multipage.IElementInfoManager{} - export class LayoutContext { - /** - * Adds a label to a given edge. - * @param label the label that should be added to the given edge - * @param labeledElement the edge to which the label should be added - */ - addEdgeLabel(label:yfiles.layout.IEdgeLabelLayout,labeledElement:yfiles.algorithms.Edge):void; - /** - * Adds a label to a given node. - * @param label the label that should be added to the given node - * @param labeledElement the node to which the label should be added - */ - addNodeLabel(label:yfiles.layout.INodeLabelLayout,labeledElement:yfiles.algorithms.Node):void; - /** - * All methods of the {@link yfiles.multipage.IElementFactory} have to use this method to create an edge. - * @param source the source of the edge - * @param target the target of the edge - * @param sameDataElementId the ID of the edge whose data should be copied to the created edge (or null if no data should be copied) - * @returns the created edge - * @see yfiles.multipage.IElementFactory - */ - createEdge(source:yfiles.algorithms.Node,target:yfiles.algorithms.Node,sameDataElementId:any):yfiles.algorithms.Edge; - /** - * All methods of the {@link yfiles.multipage.IElementFactory} have to use this method to create a node. - * @param sameDataElementId the ID of the node whose data should be copied to the created node (or null if no data should be copied) - * @returns the created node - * @see yfiles.multipage.IElementFactory - */ - createNode(sameDataElementId:any):yfiles.algorithms.Node; - /** - * - * @param edge - * @returns - */ - getEdgeInfo(edge:yfiles.algorithms.Edge):yfiles.multipage.IEdgeInfo; - /** - * - * @param edgeLabelLayout - * @returns - */ - getEdgeLabelInfo(edgeLabelLayout:yfiles.layout.IEdgeLabelLayout):yfiles.multipage.IEdgeLabelInfo; - /** - * - * @param node - * @returns - */ - getNodeInfo(node:yfiles.algorithms.Node):yfiles.multipage.INodeInfo; - /** - * - * @param nodeLabelLayout - * @returns - */ - getNodeLabelInfo(nodeLabelLayout:yfiles.layout.INodeLabelLayout):yfiles.multipage.INodeLabelInfo; - /** - * Returns the edge of the input graph with the given ID or null if there is no such edge. - * @param id the ID of the edge that should be returned - * @returns the edge of the input graph with the given ID or null if there is no such edge - */ - getOriginalEdge(id:any):yfiles.algorithms.Edge; - /** - * Returns the node of the input graph with the given ID or null if there is no such node. - * @param id the ID of the node that should be returned - * @returns the node of the input graph with the given ID or null if there is no such node - */ - getOriginalNode(id:any):yfiles.algorithms.Node; - /** - * Returns the edge of a page graph (a graph that represents the result of the multi-page layout) with the given ID or null - * if there is no such edge. - * @param id the ID of the edge that should be returned - * @returns the edge of a page graph with the given ID or null if there is no such edge - */ - getPageEdge(id:any):yfiles.algorithms.Edge; - /** - * Returns the node of a page graph (a graph that represents the result of the multi-page layout) with the given ID or null - * if there is no such node. - * @param id the ID of the node that should be returned - * @returns the node of a page graph with the given ID or null if there is no such node - */ - getPageNode(id:any):yfiles.algorithms.Node; - /** - * Removes a label from a given edge. - * @param label the label that should be removed - * @param labeledElement the edge owning the label - * @returns - */ - removeEdgeLabel(label:yfiles.layout.IEdgeLabelLayout,labeledElement:yfiles.algorithms.Edge):boolean; - /** - * Removes a label from a given node. - * @param label the label that should be removed - * @param labeledElement the node owning the label - * @returns - */ - removeNodeLabel(label:yfiles.layout.INodeLabelLayout,labeledElement:yfiles.algorithms.Node):boolean; - /** - * Gets the relevant graph. - * @type {yfiles.layout.LayoutGraph} - */ - graph:yfiles.layout.LayoutGraph; - /** - * Gets the layouter object that belongs to this layout context. - * @type {yfiles.multipage.MultiPageLayout} - */ - layout:yfiles.multipage.MultiPageLayout; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.multipage.LayoutContext; - } - /** - * This layout algorithm subdivides the input graph into several {@link yfiles.layout.LayoutGraph}s (called page graphs) such that - * the layout (calculated by the specified {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}) of each graph fits the {@link yfiles.multipage.MultiPageLayout#maximumPageSize specified maximum page size}. - *

- * The algorithm adds special nodes to guarantee that no information is lost when splitting edges that connect nodes placed - * on different pages (for more details take a look at the concept described below). {@graph {"ann":{"s":[45,30],"d":1},"n":[[165,210,60,30,[[187.94,234.96,14.11,19.93,"G"]]],[271.88,210,30,30,[[280.18,234.96,13.39,19.93,"H"]]],[148.12,450,60,30,[[171.79,474.96,12.67,19.93,"V"]]],[166.88,375,[[183.04,399.96,12.67,19.93,"P"]]],[391.88,510,60,30,[[415.9,534.96,11.94,19.93,"Z"]]],[23.12,510,[[39.29,534.96,12.67,19.93,"Y"]]],[436.88,375,[[453.4,399.96,11.94,19.93,"T"]]],[376.88,375,30,30,[[385.54,399.96,12.67,19.93,"S"]]],[455.62,210,30,30,[[466.82,234.96,7.61,19.93,"I"]]],[30,450,60,30,[[53.31,474.96,13.39,19.93,"U"]]],[436.88,450,[[453.04,474.96,12.67,19.93,"X"]]],[15,375,30,30,[[23.31,399.96,13.39,19.93,"N"]]],[455.62,285,30,30,[[463.21,309.96,14.83,19.93,"M"]]],[350.62,285,75,30,[[382.51,309.96,11.23,19.93,"L"]]],[165,285,[[182.25,309.96,10.5,19.93,"J"]]],[166.88,135,75,30,[[198.04,159.96,12.67,19.93,"E"]]],[241.88,375,30,30,[[249.82,399.96,14.11,19.93,"Q"]]],[75,375,30,30,[[82.94,399.96,14.11,19.93,"O"]]],[120,60,60,30,[[143.31,84.96,13.39,19.93,"C"]]],[33.75,0,[[49.91,24.96,12.67,19.93,"A"]]],[358.12,450,[[372.49,474.96,16.27,19.93,"W"]]],[75,135,[[90.81,159.96,13.39,19.93,"D"]]],[256.88,285,60,30,[[280.54,309.96,12.67,19.93,"K"]]],[301.88,375,[[317.68,399.96,13.39,19.93,"R"]]],[45,60,[[61.16,84.96,12.67,19.93,"B"]]],[271.88,135,30,30,[[280.9,159.96,11.94,19.93,"F"]]]],"e":[[11,9,0,15,-20,-15,[30,420,40,420]],[13,6,25,15,-11.25,-15,[413.12,330,448.12,330]],[7,20,0,15,11.25,-15],[25,1,0,15,0,-15],[13,23,-25,15,11.25,-15,[363.12,330,335.62,330]],[10,4,0,15,20,-15,[459.38,495,441.88,495]],[1,22,0,15,0,-15],[22,16,-20,15,0,-15,[266.88,330,256.88,330]],[14,3,11.25,15,-11.25,-15,[198.75,345,178.12,345]],[0,14,0,15,11.25,-15,[195,255,198.75,255]],[17,9,0,15,20,-15,[90,420,80,420]],[3,2,-11.25,15,0,-15],[24,9,-11.25,15,0,-15,[56.25,105,60,105]],[3,20,11.25,15,-11.25,-15,[200.62,420,369.38,420]],[18,15,20,15,0,-15,[170,105,204.38,105]],[15,0,-9.38,15,0,-15],[9,5,0,15,11.25,-15,[60,495,56.88,495]],[15,2,-28.12,15,-20,-15,[176.25,180,150,180,150,420,158.12,420]],[12,6,0,15,11.25,-15],[0,13,20,15,-18.75,-15,[215,255,369.38,255]],[14,17,-11.25,15,0,-15,[176.25,330,90,330]],[15,3,9.38,15,11.25,-15,[213.75,195,240,195,240,360,200.62,360]],[24,21,11.25,15,-11.25,-15,[78.75,105,86.25,105]],[19,11,-11.25,15,0,-15,[45,45,30,45]],[15,13,28.12,15,18.75,-15,[232.5,180,406.88,180]],[22,23,20,15,-11.25,-15,[306.88,330,313.12,330]],[19,24,11.25,15,0,-15],[0,5,-20,15,-11.25,-15,[175,255,0,255,0,495,34.38,495]],[8,12,0,15,0,-15],[18,21,-20,15,11.25,-15,[130,105,108.75,105]],[18,14,0,15,-11.25,-15,[150,120,135,120,135,270,176.25,270]],[20,4,0,15,-20,-15,[380.62,495,401.88,495]],[13,4,0,15,0,-15,[388.12,345,421.88,345]],[22,2,0,15,20,-15,[286.88,435,198.12,435]]],"vp":[0.0,0.0,486.0,540.0]}} - *

- *

- * The input graph. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"styles":{"1":{"c": 1}},"n":[[523.12,293.69,500,500,2,[[523.12,316.06,500,22.38,"Page 2"]]],[-80.94,293.69,500,500,2,[[-80.94,316.06,500,22.38,"Page 1"]]],[261.56,588.69,45,30,[[277.73,613.65,12.67,19.93,"X"]]],[239.06,528.69,[[247.73,553.65,12.67,19.93,"S"]]],[186.56,588.69,45,30,[[200.93,613.65,16.27,19.93,"W"]]],[164.06,528.69,45,30,[[180.23,553.65,12.67,19.93,"P"]]],[15.94,458.69,75,30,[[47.1,483.65,12.67,19.93,"E"]]],[99.06,528.69,1,[[107.4,553.04,13.33,18.7,"G"]]],[29.06,528.69,1,[[38.73,553.04,10.67,18.7,"L"]]],[38.44,398.69,1,[[47.1,423.04,12.67,18.7,"C"]]],[322.81,458.69,45,30,[[340.06,483.65,10.5,19.93,"J"]]],[271.56,398.69,1,[[279.9,423.04,13.33,18.7,"G"]]],[341.56,398.69,1,[[350.23,423.04,12.67,18.7,"C"]]],[179.06,648.69,60,30,[[203.09,673.65,11.94,19.93,"Z"]]],[121.56,588.69,1,[[131.23,613.04,10.67,18.7,"L"]]],[341.56,528.69,[[349.51,553.65,14.11,19.93,"O"]]],[341.56,588.69,1,[[350.23,613.04,12.67,18.7,"U"]]],[-40.94,528.69,1,[[-31.94,553.04,12,18.7,"K"]]],[-20.94,588.69,60,30,[[2.73,613.65,12.67,19.93,"V"]]],[961.88,408.69,[[973.07,433.65,7.61,19.93,"I"]]],[961.88,468.69,[[969.46,493.65,14.83,19.93,"M"]]],[943.12,528.69,45,30,[[959.65,553.65,11.94,19.93,"T"]]],[855.62,468.69,75,30,[[887.51,493.65,11.23,19.93,"L"]]],[878.12,528.69,1,[[887.46,553.04,11.33,18.7,"Z"]]],[896.88,408.69,1,[[905.87,433.04,12,18.7,"E"]]],[775.62,408.69,60,30,[[798.57,433.65,14.11,19.93,"G"]]],[790.62,468.69,1,[[800.62,493.04,10,18.7,"J"]]],[790.62,358.69,1,[[799.62,383.04,12,18.7,"E"]]],[798.12,528.69,45,30,[[813.93,553.65,13.39,19.93,"R"]]],[620.62,468.69,60,30,[[644.29,493.65,12.67,19.93,"K"]]],[570.62,528.69,1,[[579.62,553.04,12,18.7,"V"]]],[710.62,468.69,45,30,[[726.79,493.65,12.67,19.93,"Y"]]],[635.62,408.69,[[643.93,433.65,13.39,19.93,"H"]]],[635.62,528.69,[[643.57,553.65,14.11,19.93,"Q"]]],[635.62,358.69,[[644.65,383.65,11.94,19.93,"F"]]],[615.62,728.69,60,30,[[638.93,753.65,13.39,19.93,"U"]]],[630.62,668.69,1,[[638.96,693.04,13.33,18.7,"O"]]],[695.62,668.69,45,30,[[711.79,693.65,12.67,19.93,"B"]]],[565.62,668.69,[[573.93,693.65,13.39,19.93,"N"]]],[718.12,728.69,45,30,[[733.93,753.65,13.39,19.93,"D"]]],[783.12,668.69,60,30,[[806.43,693.65,13.39,19.93,"C"]]],[798.12,728.69,1,[[807.12,753.04,12,18.7,"E"]]],[868.12,728.69,1,[[878.12,753.04,10,18.7,"J"]]],[569.38,608.69,45,30,[[585.54,633.65,12.67,19.93,"A"]]]],"e":[[9,6,0,15,0,-15],[4,13,0,15,0,-15],[15,16,0,15,0,-15],[3,4,0,15,11.25,-15,[254.06,568.69,220.31,568.69]],[12,10,0,15,11.25,-15],[6,7,9.38,15,0,-15,[62.81,508.69,114.06,508.69]],[10,15,11.25,15,0,-15],[5,4,11.25,15,-11.25,-15],[11,10,0,15,-11.25,-15,[286.56,438.69,334.06,438.69]],[17,18,0,15,-20,-15,[-25.94,568.69,-10.94,568.69]],[6,8,-9.38,15,0,-15],[14,13,0,15,-20,-15,[136.56,628.69,189.06,628.69]],[2,13,0,15,20,-15,[284.06,628.69,229.06,628.69]],[6,5,28.12,15,-11.25,-15,[81.56,498.69,175.31,498.69]],[5,18,-11.25,15,20,-15,[175.31,568.69,29.06,568.69]],[10,5,-11.25,15,11.25,-15,[334.06,498.69,197.81,498.69]],[6,18,-28.12,15,0,-15,[25.31,498.69,9.06,498.69]],[27,25,0,15,0,-15],[34,32,0,15,0,-15],[19,20,0,15,0,-15],[22,23,0,15,0,-15],[25,26,0,15,0,-15],[32,29,0,15,0,-15],[29,33,0,15,0,-15],[36,35,0,15,0,-15],[40,41,0,15,0,-15],[20,21,0,15,11.25,-15],[43,38,-11.25,15,0,-15],[24,22,0,15,18.75,-15],[37,39,11.25,15,-11.25,-15],[29,30,-20,15,0,-15,[630.62,508.69,585.62,508.69]],[38,35,0,15,-20,-15,[580.62,708.69,625.62,708.69]],[40,42,20,15,0,-15,[833.12,708.69,883.12,708.69]],[22,21,25,15,-11.25,-15,[918.12,508.69,954.38,508.69]],[22,28,-25,15,11.25,-15,[868.12,508.69,831.88,508.69]],[25,31,-20,15,11.25,-15,[785.62,448.69,744.38,448.69]],[37,35,-11.25,15,20,-15,[706.88,708.69,665.62,708.69]],[40,39,-20,15,11.25,-15,[793.12,708.69,751.88,708.69]],[25,22,20,15,-18.75,-15,[825.62,448.69,874.38,448.69]],[43,37,11.25,15,0,-15,[603.12,648.69,718.12,648.69]],[29,28,20,15,-11.25,-15,[670.62,508.69,809.38,508.69]],[35,31,-30,0,-14.5,-15,[555.62,743.69,555.62,348.69,718.62,348.69]]],"vp":[-81.0,293.0,1105.0,501.0]}} - *

- *

- * The input graph is subdivided into two pages with size 500x500. Circular nodes denote the so-called {@link yfiles.multipage.NodeType#CONNECTOR connectors} that - * split edges to nodes placed on other pages. The label of a connector corresponds to that of the opposite node of the - * split edge. - *

- *

- * Layout Style - *

- *

- * This multi-page layout algorithm subdivides the input graph into several smaller ones and applies existing layout - * algorithms to each of them. Hence, its layout style heavily depends on the selected {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} used for each - * single page. Furthermore, the algorithm uses several refinement steps to produce more compact results. - *

- *

- * Features - *

- *

- * Similar to the layout style, the supported feature set mainly depends on the features supported by the specified - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. Note that due to the underlying approach of the {@link yfiles.multipage.MultiPageLayout} it doesn't - * support {@link yfiles.layout.PartitionGrid}s. Furthermore, while the {@link yfiles.multipage.MultiPageLayout} is able to support groups - * (see {@link yfiles.multipage.MultiPageLayout#groupingMode}), it doesn't support edges incident to group nodes. - *

- *

- * Concept - *

- *

- * To guarantee that no information is lost, this layout algorithm replaces edges between nodes on different pages by - * so-called {@link yfiles.multipage.NodeType#CONNECTOR connector nodes}. Furthermore, it may replicate nodes (the clones are called {@link yfiles.multipage.NodeType#PROXY proxy nodes}) and insert special - * nodes to refer to such nodes (so-called {@link yfiles.multipage.NodeType#PROXY_REFERENCE proxy reference nodes}). - *

- *

- * Unlike other yFiles layout algorithms, {@link yfiles.multipage.MultiPageLayout} does not modify its input graph but returns its - * result as a {@link yfiles.multipage.MultiPageLayoutResult}. To be able to profit as much as possible from existing layout - * support, this layout algorithm implements the {@link yfiles.layout.ILayoutAlgorithm} interface, although method {@link yfiles.layout.ILayoutAlgorithm#applyLayout doLayout} does - * not specify a return value. Therefore, client code has to {@link yfiles.multipage.MultiPageLayout#layoutCallback register} a {@link yfiles.multipage.ILayoutCallback} that is invoked - * when the algorithm has calculated a new multi-page result. - *

- * @class - * @extends {yfiles.layout.LayoutStageBase} - */ - export interface MultiPageLayout extends yfiles.layout.LayoutStageBase{} - export class MultiPageLayout { - /** - * Creates a new {@link yfiles.multipage.MultiPageLayout} instance. - * @param core the layout algorithm used for a single page - */ - constructor(core:yfiles.layout.ILayoutAlgorithm); - /** - * This method is called to further improve the layout results. - *

- * The marked nodes have to be placed without changing the coordinates of the fixed (non-marked) elements and without - * exceeding the specified maximum page size. Furthermore, the basic layout properties should be maintained. - *

- *

- * Subclasses may implement a custom layout strategy for this step. - *

- * @param graph the input graph - * @param incrementalNodesDP a {@link } that returns a boolean value indicating whether or not a node is marked; the positions - * of the non-marked nodes are not allowed to change - * @param context the current layout context - * @see yfiles.multipage.LayoutContext - * @protected - */ - applyIncrementalLayout(graph:yfiles.layout.LayoutGraph,incrementalNodesDP:yfiles.algorithms.IDataProvider,context:yfiles.multipage.LayoutContext):void; - /** - * Calculates a new multi-page layout for the specified graph. - *

- * Unlike method {@link yfiles.multipage.MultiPageLayout#applyLayout}, this method ignores the registered {@link yfiles.multipage.MultiPageLayout#layoutCallback layout callback} and - * directly returns the calculated {@link yfiles.multipage.MultiPageLayoutResult}. - *

- * @param graph the input graph - * @returns an instance of {@link } that represents the result of the layout run - * @throws {Stubs.Exceptions.ArgumentError} if for one of the keys {@link yfiles.multipage.MultiPageLayout#NODE_ID_DP_KEY}, {@link yfiles.multipage.MultiPageLayout#EDGE_ID_DP_KEY}, - * {@link yfiles.multipage.MultiPageLayout#NODE_LABEL_ID_DP_KEY} and {@link yfiles.multipage.MultiPageLayout#EDGE_LABEL_ID_DP_KEY} no {@link yfiles.algorithms.IDataProvider} - * is registered with the given graph - * @see yfiles.multipage.MultiPageLayoutResult - */ - calculateLayout(graph:yfiles.layout.LayoutGraph):yfiles.multipage.MultiPageLayoutResult; - /** - * This method creates the {@link yfiles.multipage.IElementFactory element factory} for multi-page layouts. - *

- * It is called once from {@link yfiles.multipage.MultiPageLayout#elementFactory} if no factory has been explicitly set using {@link yfiles.multipage.MultiPageLayout#elementFactory}. By default, this method returns an instance of - * {@link yfiles.multipage.DefaultElementFactory}. - *

- *

- * Subclasses may create a custom implementation of the element factory. - *

- * @returns the created element factory - * @see yfiles.multipage.MultiPageLayout#elementFactory - * @see yfiles.multipage.MultiPageLayout#elementFactory - * @see yfiles.multipage.IElementFactory - * @protected - */ - createElementFactory():yfiles.multipage.IElementFactory; - /** - * This method is called during a postprocessing step that reduces the number of connectors. - *

- * A pair of connectors can be removed if both connector nodes are placed on the same page. The method removes both - * connector nodes and restores the original edges by calling {@link yfiles.multipage.MultiPageLayout#routeRestoredEdges}. - *

- *

- * Subclasses may implement a custom remove/restore strategy. - *

- * @param connector1 the first connector of the connector pair - * @param connector2 the second connector of the connector pair - * @param originalEdgeIds the IDs of the original edges that have to be restored - * @param context the current layout context - * @returns true if the removal of the connector pair was successful, false otherwise - * @see yfiles.multipage.MultiPageLayout#routeRestoredEdges - * @protected - */ - removeConnectorPair(connector1:yfiles.algorithms.Node,connector2:yfiles.algorithms.Node,originalEdgeIds:yfiles.algorithms.YList,context:yfiles.multipage.LayoutContext):boolean; - /** - * This method is called whenever some single edges have to be routed without changing the position of nodes (e.g., by {@link yfiles.multipage.MultiPageLayout#removeConnectorPair} - * to route the restored edges). - *

- * It has to guarantee that the routes are fully contained within the given bounding rectangle. - *

- *

- * Subclasses may implement a custom routing strategy for the restored edges. - *

- * @param graph the relevant graph - * @param selectedEdgesDP a {@link } that returns a boolean value indicating whether or not an edge should be rerouted - * @param boundingRectangle the edge routes should be fully contained within this rectangle - * @see yfiles.multipage.MultiPageLayout#removeConnectorPair - * @protected - */ - routeRestoredEdges(graph:yfiles.layout.LayoutGraph,selectedEdgesDP:yfiles.algorithms.IDataProvider,boundingRectangle:yfiles.algorithms.YRectangle):void; - /** - * Data provider key for assigning a cluster ID to common (non-group) nodes - * @see yfiles.multipage.MultiPageLayout#strictClusterSeparation - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_CLUSTER_ID_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for mapping each node of the input graph to a unique ID - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_ID_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for mapping each edge of the input graph to a unique ID - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for mapping each edge label of the input graph to a unique ID - * @const - * @static - * @type {yfiles.algorithms.IEdgeLabelLayoutDpKey.} - */ - static EDGE_LABEL_ID_DP_KEY:yfiles.algorithms.IEdgeLabelLayoutDpKey; - /** - * Data provider key for mapping each node label of the input graph to a unique ID - * @const - * @static - * @type {yfiles.algorithms.INodeLabelLayoutDpKey.} - */ - static NODE_LABEL_ID_DP_KEY:yfiles.algorithms.INodeLabelLayoutDpKey; - /** - * Data provider key for specifying the type of multi-edges - *

- * If {@link yfiles.multipage.MultiPageLayout#edgeBundleModeMask} & {@link yfiles.multipage.EdgeBundleModes#DISTINGUISH_TYPES} == 1, multi-edges (edges with same endpoints) associated with - * different types (objects) are distinguished, i.e., they are split by different connector pairs (see - * {@link yfiles.multipage.NodeType#CONNECTOR}). - *

- * @see yfiles.multipage.EdgeBundleModes#DISTINGUISH_TYPES - * @see yfiles.multipage.MultiPageLayout#edgeBundleModeMask - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_TYPE_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets whether or not the algorithm should separate nodes with different {@link yfiles.multipage.MultiPageLayout#NODE_CLUSTER_ID_DP_KEY cluster IDs}. - *

- * More precisely, if this option is enabled, the algorithm doesn't place nodes with different cluster IDs onto the same - * page. Otherwise, such a placement is possible. - *

- * @see yfiles.multipage.MultiPageLayout#NODE_CLUSTER_ID_DP_KEY - * @type {boolean} - */ - strictClusterSeparation:boolean; - /** - * Gets or sets whether or not the given {@link yfiles.multipage.MultiPageLayout#labeling labeling algorithm} places the labels of the input graph. - *

- * If this option is disabled, the labels are either ignored or placed by the integrated labeling approach of the - * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. - *

- * @see yfiles.multipage.MultiPageLayout#labeling - * @type {boolean} - */ - labelingEnabled:boolean; - /** - * Gets or sets the {@link yfiles.multipage.IElementFactory element factory} for creating special nodes and edges in a multi-page layout. - *

- * If no element factory is set explicitly (see method {@link yfiles.multipage.MultiPageLayout#elementFactory}), a new instance is created and set by method {@link yfiles.multipage.MultiPageLayout#createElementFactory} - * during the first layout run. - *

- * @see yfiles.multipage.MultiPageLayout#createElementFactory - * @see yfiles.multipage.IElementFactory - * @type {yfiles.multipage.IElementFactory} - */ - elementFactory:yfiles.multipage.IElementFactory; - /** - * Gets or sets the {@link yfiles.multipage.ILayoutCallback callback} that is notified upon completion of multi-page layout calculation runs. - * @see yfiles.multipage.ILayoutCallback - * @type {yfiles.multipage.ILayoutCallback} - */ - layoutCallback:yfiles.multipage.ILayoutCallback; - /** - * Gets or sets the bit mask for defining edge bundles. - *

- * All multi-edges (edges with same endpoints) belonging to the same edge bundle are split by the same connector pair (see - * {@link yfiles.multipage.NodeType#CONNECTOR}). - *

- * @see yfiles.multipage.NodeType#CONNECTOR - * @type {yfiles.multipage.EdgeBundleModes} - */ - edgeBundleModeMask:yfiles.multipage.EdgeBundleModes; - /** - * Gets or sets how to handle special nodes (like connector and proxy nodes) with respect to groups. - * @throws {Stubs.Exceptions.ArgumentError} if the specified group mode is unknown - * @see yfiles.multipage.NodeType#CONNECTOR - * @see yfiles.multipage.NodeType#PROXY - * @type {yfiles.multipage.GroupingMode} - */ - groupingMode:yfiles.multipage.GroupingMode; - /** - * Gets or sets the preferred time limit (in milliseconds) for the layout algorithm. - *

- * The specified value has to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the preferred time limit is negative - * @type {number} - */ - maximumDuration:number; - /** - * Gets or sets the {@link yfiles.layout.ILayoutStage} that places the labels of the input graph. - * @see yfiles.multipage.MultiPageLayout#labelingEnabled - * @see yfiles.labeling.GenericLabeling - * @type {yfiles.layout.ILayoutStage} - */ - labeling:yfiles.layout.ILayoutStage; - /** - * Gets or sets the maximum size of a single page. - *

- * The layout algorithm subdivides the input graph such that each part is placed on a different page that fits the - * specified maximum size. - *

- *

- * Both the specified width and height have to be positive. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified width or height is not positive - * @see yfiles.multipage.MultiPageLayout#maximumDuration - * @type {yfiles.algorithms.YDimension} - */ - maximumPageSize:yfiles.algorithms.YDimension; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.multipage.MultiPageLayout; - } - /** - * This class represents the result of a layout run of {@link yfiles.multipage.MultiPageLayout}. - *

- * A layout run subdivides the input graph into several {@link yfiles.layout.LayoutGraph}s (called page graphs) such that the - * layout of each graph fits the {@link yfiles.multipage.MultiPageLayout#maximumPageSize specified maximum page size}. This class provides access to the different page graphs (see - * method {@link yfiles.multipage.MultiPageLayoutResult#getPage}). - *

- *

- * An instance of this class can be either obtained by calling {@link yfiles.multipage.MultiPageLayout#calculateLayout} or - * {@link yfiles.multipage.MultiPageLayout#applyLayout}. In the latter case, a {@link yfiles.multipage.ILayoutCallback} has to be {@link yfiles.multipage.MultiPageLayout#layoutCallback set} - * before starting the layout run. - *

- * @class - * @implements {yfiles.multipage.IElementInfoManager} - */ - export interface MultiPageLayoutResult extends yfiles.lang.Object,yfiles.multipage.IElementInfoManager{} - export class MultiPageLayoutResult { - /** - * - * @param edge - * @returns - */ - getEdgeInfo(edge:yfiles.algorithms.Edge):yfiles.multipage.IEdgeInfo; - /** - * - * @param edgeLabelLayout - * @returns - */ - getEdgeLabelInfo(edgeLabelLayout:yfiles.layout.IEdgeLabelLayout):yfiles.multipage.IEdgeLabelInfo; - /** - * - * @param node - * @returns - */ - getNodeInfo(node:yfiles.algorithms.Node):yfiles.multipage.INodeInfo; - /** - * - * @param nodeLabelLayout - * @returns - */ - getNodeLabelInfo(nodeLabelLayout:yfiles.layout.INodeLabelLayout):yfiles.multipage.INodeLabelInfo; - /** - * Returns the page graph associated with the given page number. - *

- * A page graph is a subgraph of the input graph whose layout fits the {@link yfiles.multipage.MultiPageLayout#maximumPageSize specified maximum page size}. - *

- * @param pageNo the given page number - * @returns the page graph associated with the given page number - * @throws {Stubs.Exceptions.IndexOutOfRangeError} if pageNo >= pageCount or pageNo < 0 - * @see yfiles.multipage.MultiPageLayoutResult#pageCount - */ - getPage(pageNo:number):yfiles.layout.LayoutGraph; - /** - * Returns the number of pages available in this {@link yfiles.multipage.MultiPageLayoutResult}. - *

- * Each page contains a {@link yfiles.multipage.MultiPageLayoutResult#getPage page graph} whose layout fits the {@link yfiles.multipage.MultiPageLayout#maximumPageSize specified maximum page size}. - *

- * @returns the number of available pages - * @see yfiles.multipage.MultiPageLayoutResult#getPage - */ - pageCount():number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.multipage.MultiPageLayoutResult; - } - /** - * Specifies custom data for the {@link yfiles.multipage.MultiPageLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface MultiPageLayoutData extends yfiles.layout.LayoutData{} - export class MultiPageLayoutData { - constructor(); - /** - * Gets or sets the mapping from nodes to their unique IDs. - * @see yfiles.multipage.MultiPageLayout#NODE_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from edges to their unique IDs. - * @see yfiles.multipage.MultiPageLayout#EDGE_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from node labels to their unique IDs. - * @see yfiles.multipage.MultiPageLayout#NODE_LABEL_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeLabelIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from edge labels to their unique IDs. - * @see yfiles.multipage.MultiPageLayout#EDGE_LABEL_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLabelIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their cluster id. - *

- * Nodes with the same cluster id should preferably be placed on the same page. - *

- * @see yfiles.multipage.MultiPageLayout#NODE_CLUSTER_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeClusterIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from edges to their type. - *

- * Multi-edges (edges with same endpoints) of different kind are distinguished if {@link yfiles.multipage.MultiPageLayout#edgeBundleModeMask} & {@link yfiles.multipage.EdgeBundleModes#DISTINGUISH_TYPES} - * == 1. - *

- * @see yfiles.multipage.MultiPageLayout#EDGE_TYPE_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeTypes:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.multipage.MultiPageLayoutData; - } - }export namespace circular{ - /** - * This layout algorithm arranges graphs in a circular fashion. - *

- * Layout Style The nodes are arranged in circles and stars which emphasize group and tree structures inside a graph. Circular layout - * algorithms find applications in many areas such as social networking, network management, WWW visualization, eCommerce, - * telecommunications. {@graph {"ann": {"s": [30,30], "d": 0, "c": 1},"n": [[558.09,362.1], [95.35,12.18], [0,148.17], [441.83,243.3], [540.68,299.26], [142.21,0], [298.88,449.09], [347.79,497.99], [232.08,466.99], [143.67,101.87], [100.64,154.2], [137.11,211.3], [206.74,126.62], [202.69,194.26], [263.08,582.7], [329.89,564.8], [214.18,533.79], [453.2,487.29], [528.46,21.5], [587.42,54.88], [478.49,67.27], [573.89,121.27], [506.57,128.93], [603.52,281.85], [620.93,344.69], [285.81,262.6], [259.33,689.12], [213.12,676.73], [311.63,331.4], [358.3,274.64]], "e": [[4,0], [4,3], [6,7], [6,8], [8,7], [1,9], [9,5], [9,10], [10,2], [10,11], [12,9], [11,13], [13,12], [15,14], [15,7], [14,16], [16,8], [16,7], [7,17], [18,19], [20,18], [19,21], [21,20], [20,22], [22,21], [22,3], [4,23], [0,24], [24,23], [25,13], [14,26], [14,27], [25,28], [28,6], [28,29], [29,25], [29,3]], "vp": [0.0,0.0,651.0,720.0]}} Circular layout with default settings {@graph {"ann": {"s": [30,30], "d": 0, "c" : 1},"n": [[452.67,672.8], [684.06,272.02], [661.72,203.26], [518.72,643.4], [29.9,484.57], [238.95,672.8], [661.72,484.57], [238.95,15.03], [0,343.92], [309.66,0], [114.42,600.9], [29.9,203.26], [452.67,15.03], [7.56,415.81], [114.42,86.93], [309.66,687.83], [381.96,0], [625.58,140.65], [172.91,643.4], [577.2,86.93], [381.96,687.83], [691.62,343.92], [7.56,272.02], [577.2,600.9], [625.58,547.18], [66.04,140.65], [684.06,415.81], [66.04,547.18], [518.72,44.44], [172.91,44.44]], "e": [[1,0], [1,2], [3,0], [1,5], [5,4], [4,6], [8,4], [9,7], [1,12], [13,4], [4,15], [5,15], [10,18], [18,7], [18,5], [18,1], [17,19], [19,2], [15,20], [20,0], [4,21], [8,21], [21,6], [11,22], [22,8], [20,23], [23,3], [23,13], [23,4], [23,24], [6,24], [14,25], [25,11], [25,22], [22,26], [2,26], [17,26], [26,24], [26,21], [1,27], [27,10], [27,18], [12,28], [28,2], [28,19], [7,29], [12,29], [29,14], [29,16], [29,18]], "vp": [0.0,0.0,722.0,718.0]}} Circular layout with {@link yfiles.circular.LayoutStyle#SINGLE_CYCLE} - * layout style ConceptThe layout algorithm performs three steps when calculating a circular arrangement for a graph: - *

- *
    - *
  1. - * It searches for partitions in the input graph depending on connectivity and on the given - * {@link yfiles.circular.CircularLayout#layoutStyle layout style}. Considering each partition as a node, the resulting graph has a tree-like structure. - *
  2. - *
  3. The partitions are laid out as circles using the selected {@link yfiles.circular.CircularLayout#partitionStyle partition style}.
  4. - *
  5. - * The algorithm delegates the layout calculation for the underlying tree (in which each node corresponds to a partition) - * to a specialized layout algorithm accessible by {@link yfiles.circular.CircularLayout#singleCycleLayout} or {@link yfiles.circular.CircularLayout#balloonLayout}. The partitions are moved to their final location. - *
  6. - *
- *

- * Features - *

- *

- * The layout algorithm places the nodes in circles that represent a partition. There are several ways to find partitions - * in the input graph. Which one is applied is defined using {@link yfiles.circular.CircularLayout#layoutStyle}. - *

- *

- * The nodes in a partition can either lie on or in the interior of a circle. The placement of the nodes affects the - * compactness of the layout and can be specified using {@link yfiles.circular.CircularLayout#partitionStyle}. - *

- *

- * Since edges are routed as straight lines, they may overlap with nodes or node labels. To resolve these overlaps, an edge - * routing algorithm (e.g. {@link yfiles.router.EdgeRouter} or {@link yfiles.router.OrganicEdgeRouter}) can be appended. - *

- *

- * This layout algorithm supports {@link yfiles.circular.CircularLayout#edgeBundling edge bundling}. In order to bundle the edges, the nodes of the graph are clustered in - * groups. Edge bundling is supported only if {@link yfiles.circular.CircularLayout#partitionStyle partition layout style} is set to {@link yfiles.circular.PartitionStyle#CYCLE} and {@link yfiles.circular.CircularLayout#layoutStyle layout style} - * is other than {@link yfiles.circular.LayoutStyle#BCC_ISOLATED}. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface CircularLayout extends yfiles.layout.MultiStageLayout{} - export class CircularLayout { - /** - * Creates a new {@link yfiles.circular.CircularLayout} instance with the default settings. - */ - constructor(); - /** - * Data acceptor key for publishing the final circle information - *

- * For each node, the ID of the circle on which it was placed will be stored. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static CIRCLE_ID_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for defining custom node partitions - *

- * The {@link yfiles.algorithms.IDataProvider} needs to provide a mapping from {@link yfiles.algorithms.Node}s to unique {@link any} IDs for each - * group of nodes. These groups will form the circles in the layout. - *

- * @see yfiles.circular.LayoutStyle#CUSTOM_GROUPS - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static CUSTOM_GROUPS_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets whether or not the layout algorithm reserves space for node labels preventing possible overlaps. - *

- * Nodes get temporarily enlarged such that they contain their labels. - *

- *

- * This might result in layouts that need much space. - *

- * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Gets or sets whether or not, in the underlying tree, the children of a tree node are placed on a common radius. - *

- * Disabling this feature may produce more compact layout results. - *

- * @type {boolean} - */ - placeChildrenOnCommonRadius:boolean; - /** - * Gets or sets whether or not to take the coordinates of the input diagram into account when arranging the nodes of the - * partitions and the partitions themselves. - *

- * If enabled: - *

- *
    - *
  • - * For complex partitions (those consisting of more than one node), the layout algorithm tries to keep peripheral nodes and - * maintain their circular order around the center of the disk/circle. Other partitions that connect to this node are moved - * accordingly, if possible. - *
  • - *
  • - * For multiple partitions that connect to the same node, the layout algorithm tries to keep their circular order around - * this node. This only works as expected for {@link yfiles.circular.LayoutStyle#BCC_COMPACT} as layout style, since otherwise the - * underlying tree structure is not well defined. - *
  • - *
- * @type {boolean} - */ - fromSketchMode:boolean; - /** - * Gets or sets the maximum deviation angle allowed for an edge. - *

- * The deviation angle for an edge is the difference between its optimal angle away from the parent cycle and its actual - * angle. - *

- * @type {number} - */ - maximumDeviationAngle:number; - /** - * Gets or sets the global layout style for this layout algorithm. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown layout style is set - * @type {yfiles.circular.LayoutStyle} - */ - layoutStyle:yfiles.circular.LayoutStyle; - /** - * Gets the {@link yfiles.circular.SingleCycleLayout} instance used for laying out nodes on a single cycle. - *

- * Configuring this layout algorithm only affects layouts with only one partition. - *

- * @see yfiles.circular.CircularLayout#layoutStyle - * @type {yfiles.circular.SingleCycleLayout} - */ - singleCycleLayout:yfiles.circular.SingleCycleLayout; - /** - * Gets the {@link yfiles.tree.BalloonLayout} instance used for arranging multiple partitions. - *

- * Configuring this layout algorithm affects the arrangement of the partitions within the overall layout. - *

- * @see yfiles.circular.CircularLayout#layoutStyle - * @type {yfiles.tree.BalloonLayout} - */ - balloonLayout:yfiles.tree.BalloonLayout; - /** - * Gets or sets the style for the arrangement of each partition. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown style is given - * @type {yfiles.circular.PartitionStyle} - */ - partitionStyle:yfiles.circular.PartitionStyle; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. - * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled - * @see yfiles.layout.MultiStageLayout#componentLayout - * @see yfiles.layout.ComponentLayout - * @type {boolean} - */ - componentLayoutEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for hiding group nodes is activated. - * @see yfiles.layout.MultiStageLayout#hideGroupsStageEnabled - * @see yfiles.layout.MultiStageLayout#hideGroupsStage - * @see yfiles.layout.HideGroupsStage - * @type {boolean} - */ - hideGroupsStageEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. - * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled - * @see yfiles.layout.MultiStageLayout#orientationLayout - * @see yfiles.layout.MultiStageLayout#layoutOrientation - * @see yfiles.layout.OrientationLayout - * @type {boolean} - */ - orientationLayoutEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. - * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled - * @see yfiles.layout.MultiStageLayout#selfLoopRouter - * @see yfiles.layout.SelfLoopRouter - * @type {boolean} - */ - selfLoopRouterEnabled:boolean; - /** - * Gets the {@link yfiles.layout.EdgeBundling} instance that defines the settings of the edge bundling feature. - *

- * The specified {@link yfiles.layout.EdgeBundling} defines global bundling properties. Settings for individual edges can be - * defined by assigning an {@link yfiles.layout.EdgeBundleDescriptor} to an edge using a {@link yfiles.algorithms.IDataProvider} registered - * with key {@link yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY}. - *

- * @type {yfiles.layout.EdgeBundling} - */ - edgeBundling:yfiles.layout.EdgeBundling; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.circular.CircularLayout; - } - export enum LayoutStyle{ - /** - * The specifier for a layout style where the nodes within a biconnected component of the input graph are treated as - * separate partitions. - *

- * If a node belongs to more than one biconnected component, it will be assigned to the one that seems to be more - * suitable. - *

- * @see yfiles.circular.CircularLayout#layoutStyle - */ - BCC_COMPACT, - /** - * The specifier for a layout style where the nodes within a biconnected component of the input graph are treated as - * separate partitions. - *

- * If a node belongs to more than one biconnected component, it will form an isolated partition and will be laid out in - * between of all its biconnected component cycles. - *

- * @see yfiles.circular.CircularLayout#layoutStyle - */ - BCC_ISOLATED, - /** - * The specifier for a layout style where the user can specify groups that will form separate partitions. To define the - * groups, a {@link yfiles.algorithms.IDataProvider} with key {@link yfiles.circular.CircularLayout#CUSTOM_GROUPS_DP_KEY} must be - * registered. - * @see yfiles.circular.CircularLayout#layoutStyle - */ - CUSTOM_GROUPS, - /** - * The specifier for a layout style where all nodes of the input graph will be placed on or in the interior of a single - * cycle. - * @see yfiles.circular.CircularLayout#layoutStyle - */ - SINGLE_CYCLE - } - export enum PartitionStyle{ - /** - * Specifier for a partition layout style where all nodes of a partition are placed on the boundary of a circle. - * @see yfiles.circular.CircularLayout#partitionStyle - */ - CYCLE, - /** - * Specifier for a partition style with a semi-compact layout for each partition. - *

- * This style places nodes in the interior and on the border of a circle and arranges them in an organic manner, leading to - * a more compact layout. Only nodes with connections to other partitions are guaranteed to lie on the boundary of the - * resulting disk. - *

- * @see yfiles.circular.CircularLayout#partitionStyle - */ - DISK, - /** - * Specifier for a partition style with a compact layout for each partition. - *

- * This style creates an organic circular layout for each partition. Even nodes that connect to different partitions may be - * placed in the interior of the resulting disk. - *

- * @see yfiles.circular.CircularLayout#partitionStyle - */ - ORGANIC - } - /** - * This layout algorithm places all nodes of a graph on a single cycle. - *

- * Layout Style - *

- *

- * All nodes of a graph are placed on one common circle, generating circular layouts. The edges are drawn as simple, straight lines. The - * resulting layouts look like a ring. Edges connecting nodes which are not next to each other on the ring are routed inside of the - * circle. If a graph contains many edges, the number of edge crossings inside the circle may be quite high. - *

- *

- * Single-cycle circular layouts are suitable for the visualization of networks such as ring networks or smaller social - * networks. They are also useful to layout cyclic subgraphs of a larger graph. - *

- *

- * {@graph {"ann":{"s":[40,40],"d":1,"c":1},"n":[[39.45,439.2],[459.2,19.45],[336.26,-5],[39.45,193.32],[109.09,543.42],[563.42,89.09],[633.06,193.32],[15,316.26],[213.32,613.06],[563.42,543.42],[336.26,637.52],[459.2,613.06],[633.06,439.2],[657.52,316.26],[213.32,19.45],[109.09,89.09]],"e":[[2,1,0,-4.59,0,-4.59],[4,0,-6.01,0,-6.01,0],[0,4,4.16,-2.78,4.16,-2.78],[1,5],[5,6],[1,2,-0.88,4.41,-0.88,4.41],[11,9],[10,11],[9,12,-4.16,-2.78,-4.16,-2.78],[13,12],[12,9,6.01,0,6.01,0],[14,15],[15,13,0,-4.87,0,-4.87],[7,12,0.88,-4.41,0.88,-4.41],[6,8],[8,14,-5,0,-5,0],[14,8,5,0,5,0],[7,3],[3,15,-4.16,-2.78,-4.16,-2.78],[15,3,6.01,0,6.01,0],[12,7,0,4.59,0,4.59],[0,7],[10,8],[6,13],[4,8]],"vp":[15.0,-5.0,683.0,683.0]}} An example of a single cycle layoutConceptFirst, the nodes are sorted by applying either a custom or some default - * {@link yfiles.algorithms.INodeSequencer}. Then, all nodes are placed on a circle with an appropriate radius according to the - * calculated order. Features - *

- *

- * The order in which the nodes are placed on the circle is a crucial aspect of this algorithm. By specifying a {@link yfiles.algorithms.INodeSequencer} - * instance via {@link yfiles.circular.SingleCycleLayout#nodeSequencer}, the order can be customized. - *

- *

- * There are two options to determine the radius of the circle on which nodes are placed: - *

- *
    - *
  1. The radius can be determined automatically. A specified {@link yfiles.circular.SingleCycleLayout#minimumRadius minimum radius} will be obeyed when choosing the radius.
  2. - *
  3. The radius can be chosen manually. To do so, disable the {@link yfiles.circular.SingleCycleLayout#automaticRadius automatic radius selection} and specify the custom radius via {@link yfiles.circular.SingleCycleLayout#fixedRadius}.
  4. - *
- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface SingleCycleLayout extends yfiles.layout.MultiStageLayout{} - export class SingleCycleLayout { - /** - * Creates a new {@link yfiles.circular.SingleCycleLayout} instance with default settings. - */ - constructor(); - /** - * Gets or sets the angle that describes the location on the circle of the first node. - *

- * The angle is measured in radians and world coordinates, e.g., 0 means east, Pi/2 means south. - *

- * @type {number} - */ - initialAngle:number; - /** - * Gets or sets whether or not to consider the coordinates of the input diagram when arranging the graph. - *

- * If this feature is enabled, the original circular order of peripheral nodes around an estimated circle center will be - * preserved. - *

- * @type {boolean} - */ - fromSketchModeEnabled:boolean; - /** - * Gets or sets the minimum distance between nodes that are next to each other on the circle. - * @throws {Stubs.Exceptions.ArgumentError} if the given distance is negative - * @type {number} - */ - minimumNodeDistance:number; - /** - * Gets or sets a fixed radius for the circle on which the nodes will be placed. - * @throws {Stubs.Exceptions.ArgumentError} if the given radius is negative - * @see yfiles.circular.SingleCycleLayout#minimumRadius - * @see yfiles.circular.SingleCycleLayout#automaticRadius - * @type {number} - */ - fixedRadius:number; - /** - * Gets or sets the minimum radius for the circle on which the nodes are placed. - * @throws {Stubs.Exceptions.ArgumentError} if the given minimum radius is negative - * @see yfiles.circular.SingleCycleLayout#fixedRadius - * @see yfiles.circular.SingleCycleLayout#automaticRadius - * @type {number} - */ - minimumRadius:number; - /** - * Gets or sets whether or not the radius of the circle should be determined automatically. - *

- * If enabled, the radius will be chosen such that the distance between nodes which are next to each other on the circle is - * approximately the same as the {@link yfiles.circular.SingleCycleLayout#minimumNodeDistance minimum node distance}. - *

- *

- * If this feature is disabled, the radius specified via {@link yfiles.circular.SingleCycleLayout#fixedRadius} will be applied. - *

- * @see yfiles.circular.SingleCycleLayout#minimumRadius - * @see yfiles.circular.SingleCycleLayout#fixedRadius - * @type {boolean} - */ - automaticRadius:boolean; - /** - * Gets or sets the custom {@link yfiles.algorithms.INodeSequencer} that will be used for determining the order of the nodes for - * the circle placement. - * @type {yfiles.algorithms.INodeSequencer} - */ - nodeSequencer:yfiles.algorithms.INodeSequencer; - /** - * Gets the radius that was applied to the last layout calculated by this algorithm. - *

- * This method is useful if one wants to know the actual radius of a layout calculated by this algorithm. - *

- * @type {number} - */ - lastAppliedRadius:number; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. - * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled - * @see yfiles.layout.MultiStageLayout#orientationLayout - * @see yfiles.layout.MultiStageLayout#layoutOrientation - * @see yfiles.layout.OrientationLayout - * @type {boolean} - */ - orientationLayoutEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. - * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled - * @see yfiles.layout.MultiStageLayout#selfLoopRouter - * @see yfiles.layout.SelfLoopRouter - * @type {boolean} - */ - selfLoopRouterEnabled:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.circular.SingleCycleLayout; - } - /** - * Specifies custom data for the {@link yfiles.circular.CircularLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface CircularLayoutData extends yfiles.layout.LayoutData{} - export class CircularLayoutData { - constructor(); - /** - * Gets or sets the mapper from nodes to their circle id. - *

- * If this property is set, the mapper is filled by the layout with the circle information. - *

- * @see yfiles.circular.CircularLayout#CIRCLE_ID_DP_KEY - * @type {yfiles.collections.IMapper.} - */ - circleIds:yfiles.collections.IMapper; - /** - * Gets or sets the mapping from nodes to their custom group object. - *

- * The custom groups are only considered if {@link yfiles.circular.CircularLayout#layoutStyle} is set to {@link yfiles.circular.LayoutStyle#CUSTOM_GROUPS} - *

- * @see yfiles.circular.CircularLayout#CUSTOM_GROUPS_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - customGroups:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the mapping of edges to their {@link yfiles.layout.EdgeBundleDescriptor}. - *

- * Bundling together multiple edges means that their common parts are to some degree merged into a bundled part. At the - * source and target point, the edges are again clearly split. - *

- *

- * If an edge is mapped to null, the {@link yfiles.layout.EdgeBundling#defaultBundleDescriptor default descriptor} is used. - *

- * @see yfiles.layout.EdgeBundleDescriptor - * @see yfiles.circular.CircularLayout#edgeBundling - * @type {yfiles.layout.ItemMapping.} - */ - edgeBundleDescriptors:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.circular.CircularLayoutData; - } - }export namespace orthogonal{ - /** - * This class provides layout information for the edges of the graph. - *

- * {@link yfiles.orthogonal.EdgeLayoutDescriptor} is used by {@link yfiles.orthogonal.OrthogonalLayout} to determine the routing details - * for the edges (e.g. the segment length). - *

- *

- * An {@link yfiles.orthogonal.EdgeLayoutDescriptor} can be specified individually for each edge by using a {@link yfiles.algorithms.IDataProvider} - * which maps from an {@link yfiles.algorithms.Edge} to an {@link yfiles.orthogonal.EdgeLayoutDescriptor} instance. The {@link yfiles.algorithms.IDataProvider} - * is registered with the graph with key {@link yfiles.orthogonal.OrthogonalLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. - *

- * @see yfiles.orthogonal.OrthogonalLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @class - */ - export interface EdgeLayoutDescriptor extends yfiles.lang.Object{} - export class EdgeLayoutDescriptor { - /** - * Creates a new instance of {@link yfiles.orthogonal.EdgeLayoutDescriptor} with the default settings. - */ - constructor(); - /** - * Creates a copy of this {@link yfiles.orthogonal.EdgeLayoutDescriptor} instance. - * @returns a copy of this {@link } instance - */ - createCopy():yfiles.orthogonal.EdgeLayoutDescriptor; - /** - * Gets or sets the minimum length of the first segment of the edge path (at the source node). - *

- * The minimum length must be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum length of the first segment is negative - * @type {number} - */ - minimumFirstSegmentLength:number; - /** - * Gets or sets the minimum length of the last segment of the edge path (at the target node). - *

- * The minimum length must be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum length of the last segment is negative - * @type {number} - */ - minimumLastSegmentLength:number; - /** - * Gets or sets the minimum segment length of an edge. - *

- * The minimum length must be greater than or equal to 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the minimum length is negative - * @type {number} - */ - minimumSegmentLength:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.orthogonal.EdgeLayoutDescriptor; - } - export enum LayoutStyle{ - /** - * A layout style that produces orthogonal edges while maintaining the original node size. - * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle - */ - NORMAL, - /** - * A layout style that produces orthogonal edges and nodes of uniform size. - *

- * Before calculating the layout, all nodes will be assigned equal sizes. - *

- * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle - */ - UNIFORM, - /** - * A layout style that modifies the size of nodes to minimize the overall number of bends. - *

- * The layout algorithm will enlarge nodes based on the number and position of their neighbors in order to minimize the - * number of required bends. The segments of all edges are either horizontal or vertical. - *

- * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle - */ - BOX, - /** - * A layout style that produces non-orthogonal edges and resizes the nodes to a small uniform size. - *

- * This layout style resembles {@link yfiles.orthogonal.LayoutStyle#BOX}, but it resizes all nodes to equal size. - *

- *

- * It introduces additional bends into some edges and routes the last edge segment of these edges non-orthogonally to their - * adjacent nodes. - *

- * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle - */ - MIXED, - /** - * A layout style similar to {@link yfiles.orthogonal.LayoutStyle#NORMAL} that is best-suited for tree-like structures. - *

- * Larger subtrees are processed using a specialized tree layout algorithm which arranges all directed subtree structures - * in an optimized way. - *

- * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle - */ - NORMAL_TREE, - /** - * A layout style similar to {@link yfiles.orthogonal.LayoutStyle#MIXED} that maintains the original node size. - *

- * This style introduces additional bends into some edges and routes the last edge segment of these edges non-orthogonally - * to their adjacent nodes. - *

- * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle - */ - FIXED_MIXED, - /** - * A layout style similar to {@link yfiles.orthogonal.LayoutStyle#BOX} that maintains the original node size. - *

- * Nodes will be placed at the same positions as with - * {@link yfiles.orthogonal.LayoutStyle#FIXED_MIXED}, but edges will be routed strictly orthogonally. - *

- * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle - */ - FIXED_BOX - } - /** - * This layout algorithm arranges graphs in an orthogonal fashion. - *

- * Layout Style - *

- *

- * This layout algorithm arranges the nodes of a given graph such that each edge is drawn as an alternating sequence of - * horizontal and vertical segments. - *

- *

- * It produces compact drawings with no overlapping nodes, few crossings and few bends and is well suited for small and - * medium-sized sparse graphs. - *

- *

- * Orthogonal drawings are common in engineering applications since they are able to provide clear representations of - * complex networks that can also be optimal with respect to diverse objective functions such as bend minimization or area - * minimization. Application domains of orthogonal drawings include software engineering, database schema representation, - * system management, knowledge representation, VLSI circuits and floor planning applications. - *

- *

- * {@graph {"ann": {"s": [30,30], "d": 0},"n": [[135,160], [210,385], [210,60], [285,160], [360,60], [435,285], [60,110], [135,385], [60,435], [210,160], [-15,110], [285,335], [360,235], [360,160], [435,385]], "e": [[3,4,0,-15,-15,10,[300,85]], [0,4,0,-15,0,-15,[150,25,375,25]], [2,4,15,0,-15,0], [3,5,5,15,-15,0,[305,300]], [4,5,15,0,0,-15,[450,75]], [0,6,-15,0,10,15,[85,175]], [5,6,15,0,0,-15,[500,300,500,0,75,0]], [7,1,15,0,-15,0], [7,0,0,-15,0,15], [1,8,0,15,15,0,[225,450]], [8,6,0,-15,0,15], [0,9,15,0,-15,0], [9,6,-10,-15,15,0,[215,125]], [9,3,15,0,-15,0], [9,2,0,-15,0,15], [9,1,0,15,0,-15], [10,8,0,15,-15,0,[0,450]], [10,6,15,0,-15,0], [3,11,0,15,0,-15], [11,1,0,15,15,-10,[300,390]], [12,5,15,0,-10,-15,[440,250]], [12,3,-15,0,10,15,[310,250]], [4,13,0,15,0,-15], [13,12,0,15,0,-15], [13,3,-15,0,15,0], [14,5,0,-15,0,15], [14,1,-15,0,15,0]], "vp": [-15.0,0.0,515.0,465.0]}} Orthogonal layout with default settings - *

- *

- * This algorithm also optionally supports {@link yfiles.orthogonal.OrthogonalLayout#DIRECTED_EDGE_DP_KEY directed edge drawings} (although not in combination with hierarchically nested - * graphs or the non-default - * {@link yfiles.orthogonal.OrthogonalLayout#layoutStyle layout styles}). Application domains of directed orthogonal drawings include, for example, software engineering, database - * schema and system management. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[165,-15],[205,305],[45,345],[45,65],[205,145],[105,105],[45,405],[-15,405],[285,-15],[205,225],[125,185]],"e":[[5,0,15,-0,-5,15,[175,120]],[5,4,0,15,-15,-0,[120,160]],[5,2,-15,-0,10,-15,[70,120]],[6,4,15,-0,15,-0,[280,420,280,160]],[6,2,0,-15,0,15],[6,7,-15,-0,15,-0],[7,3,0,-15,-15,-0,[0,80]],[8,0,-15,-0,15,-0],[8,7,0,15,0,15,[300,460,0,460]],[2,9,15,-0,15,-0,[260,360,260,240]],[4,10,-10,15,15,-0,[210,200]],[10,1,0,15,-15,-0,[140,320]],[0,1,0,15,-10,-15,1,[180,280,210,280]],[0,3,-10,15,0,-15,1,[170,40,60,40]],[3,2,0,15,0,-15,1],[0,4,10,15,0,-15,1,[190,120,220,120]],[4,9,0,15,0,-15,1],[9,1,0,15,0,-15,1]],"vp":[-15.0,-15.0,330.0,475.0]}} Sample output of {@link yfiles.orthogonal.OrthogonalLayout} with default settings. Marked edges are considered as directed and - * the layout orientation is top-to-bottom. {@graph {"ann":{"s":[30,30],"d":1},"n":[[85,45],[265,105],[185,-15],[-15,165],[485,165],[265,225],[365,165],[85,225]],"e":[[0,1,15,-0,-15,-0,[160,60,160,120]],[0,2,15,-0,-15,-0,[160,60,160,0]],[2,1,15,10,-15,-10,[240,10,240,110]],[3,0,15,-0,-15,-0,[60,180,60,60]],[2,4,15,-0,-15,-0,[440,0,440,180]],[5,4,15,10,-15,-0,[340,250,340,280,440,280,440,180]],[1,6,15,-0,-15,-0,[320,120,320,180]],[5,6,15,-0,-15,-0,[320,240,320,180]],[6,4,15,-0,-15,-0],[3,7,15,-0,-15,-0,[60,180,60,240]],[7,5,15,-0,-15,-0]],"vp":[-15.0,-15.0,530.0,295.0]}} Sample output of {@link yfiles.orthogonal.OrthogonalLayout} with edge grouping. All - * edges are considered directed and the layout orientation is left-to-right. - *

- *

- * Also this algorithm supports hierarchically nested graphs (although not in combination with the directed edge drawings, - * the {@link yfiles.orthogonal.OrthogonalLayout#fromSketchMode from sketch} option, or the non-default {@link yfiles.orthogonal.OrthogonalLayout#layoutStyle layout styles}) feature: - *

- *

- * {@graph {"ann":{"s":[30,30],"d":0},"n":[[165,585],[0,220,240,340,2,[[0,242.38,240,22.38,"Group 2"]]],[165,385],[165,485],[45,485],[45,385],[105,385],[260,200,200,260,2,[[260,222.38,200,22.38,"Group 3"]]],[305,325],[305,265],[365,325],[305,385],[0,0,240,200,2,[[0,22.38,240,22.38,"Group 1"]]],[165,125],[105,125],[45,125],[45,65],[165,65],[265,485]],"e":[[3,2,0,-15,0,15],[3,0,0,15,0,-15],[4,3,15,0,-15,0],[5,4,0,15,0,-15],[2,6,-15,0,15,0],[6,5,-15,0,15,0],[8,9,0,-15,0,15],[2,9,0,-15,-15,0,[180,280]],[8,10,15,0,-15,0],[10,9,0,-15,15,10,[380,290]],[9,11,15,0,15,0,[420,280,420,400]],[8,11,0,15,0,-15],[2,11,15,0,-15,0],[11,10,15,-10,0,15,[380,390]],[6,14,0,-15,0,15],[14,13,15,0,-15,0],[5,15,0,-15,0,15],[15,14,15,0,-15,0],[16,15,0,15,0,-15],[13,17,0,-15,0,15],[17,16,-15,0,15,0],[3,18,15,0,-15,0]],"vp":[0.0,0.0,460.0,615.0]}} Orthogonal layout of a grouped graph with default settings {@graph {"ann":{"s":[30,30],"d":1},"n":[[-15,-17.38,670,794.75,2,[[-15,5,670,22.38,"Group 6"]]],[0,20,620,680,2,[[0,42.38,620,22.38,"Group 5"]]],[40,460,240,200,2,[[40,482.38,240,22.38,"Group 2"]]],[205,585,[[214.66,609.35,10.67,18.7,"9"]]],[205,525,[[211.33,549.35,17.35,18.7,"10"]]],[85,525,[[91.33,549.35,17.35,18.7,"11"]]],[85,585,[[91.33,609.35,17.35,18.7,"10"]]],[120,80,460,360,2,[[120,102.38,460,22.38,"Group 4"]]],[160,140,180,260,2,[[160,162.38,180,22.38,"Group 1"]]],[265,325,[[274.66,349.35,10.67,18.7,"1"]]],[205,325,[[214.66,349.35,10.67,18.7,"2"]]],[205,205,[[214.66,229.35,10.67,18.7,"3"]]],[265,205,[[274.66,229.35,10.67,18.7,"4"]]],[265,265,[[274.66,289.35,10.67,18.7,"5"]]],[360,160,180,240,2,[[360,182.38,180,22.38,"Group 3"]]],[405,325,[[411.33,349.35,17.35,18.7,"12"]]],[405,265,[[411.33,289.35,17.35,18.7,"13"]]],[465,265,[[471.33,289.35,17.35,18.7,"14"]]],[85,725,[[91.33,749.35,17.35,18.7,"19"]]],[205,725,[[211.33,749.35,17.35,18.7,"18"]]]],"e":[[4,3,0,15,0,-15],[4,5,-15,0,15,0],[3,6,-15,0,15,0],[6,5,0,-15,0,15],[9,10,-15,0,15,0],[10,5,-15,0,0,-15,[100,340]],[10,4,0,15,0,-15],[10,11,0,-15,0,15],[11,12,15,0,-15,0],[12,13,0,15,0,-15],[13,9,0,15,0,-15],[15,16,0,-15,0,15],[16,13,-15,0,15,0],[16,12,0,-15,15,0,[420,220]],[16,17,15,0,-15,0],[6,18,0,15,0,-15],[3,19,0,15,0,-15]],"vp":[-15.0,-18.0,670.0,796.0]}} Orthogonal layout of a graph with nested - * groupsConceptThe orthogonal layout algorithm is based on the topology-shape-metrics approach and runs in three phases: - *

- *
    - *
  • Planarization – A planar embedding is computed.
  • - *
  • Orthogonalization – The bends and the angles are computed.
  • - *
  • Compaction – The coordinates for the nodes and edges are determined.
  • - *
- *

- * Features - *

- *

- * There exist several different layout styles that the orthogonal layout algorithm supports depending on whether or not - * the edges should be routed completely orthogonal, or whether or not the original size of the nodes should be maintained. - * Such layout styles are {@link yfiles.orthogonal.LayoutStyle#NORMAL}, {@link yfiles.orthogonal.LayoutStyle#UNIFORM}, - * {@link yfiles.orthogonal.LayoutStyle#BOX}, {@link yfiles.orthogonal.LayoutStyle#NORMAL_TREE}, {@link yfiles.orthogonal.LayoutStyle#MIXED}, - * {@link yfiles.orthogonal.LayoutStyle#FIXED_BOX}, {@link yfiles.orthogonal.LayoutStyle#FIXED_MIXED} and can be applied using {@link yfiles.orthogonal.OrthogonalLayout#layoutStyle}. - *

- *

- * {@link yfiles.orthogonal.OrthogonalLayout} is able to consider edge label data when arranging a graph. This means that the - * layout algorithm will determine the positions of the nodes and edges such that the edge labels do not overlap with the - * rest of the layout. Integrated edge labeling can be activated using method {@link yfiles.orthogonal.OrthogonalLayout#integratedEdgeLabeling}. - *

- *

- * {@link yfiles.orthogonal.EdgeLayoutDescriptor} instances can be used for specifying individual information (e.g. distances) for - * each edge in the graph. The descriptors are bound to the graph using {@link yfiles.algorithms.IDataProvider}s registered with - * key {@link yfiles.orthogonal.OrthogonalLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. If there is no descriptor assigned to some edges, - * a default descriptor will be used. To set default descriptors, use {@link yfiles.orthogonal.OrthogonalLayout#edgeLayoutDescriptor}. - *

- *

- * {@link yfiles.orthogonal.OrthogonalLayout} tries to optimize diverse objective functions such as bend minimization, number of - * edge crossings, edge length minimization or face maximization. These settings can be enabled using the corresponding - * methods {@link yfiles.orthogonal.OrthogonalLayout#optimizePerceivedBends}, {@link yfiles.orthogonal.OrthogonalLayout#crossingReduction}, {@link yfiles.orthogonal.OrthogonalLayout#edgeLengthReduction}, and - * {@link yfiles.orthogonal.OrthogonalLayout#faceMaximization}, respectively. The drawback when these settings are enabled is that the running time of the algorithm may be - * drastically increased. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface OrthogonalLayout extends yfiles.layout.MultiStageLayout{} - export class OrthogonalLayout { - /** - * Creates a new {@link yfiles.orthogonal.OrthogonalLayout} instance with default settings. - */ - constructor(); - /** - * Returns a new {@link yfiles.orthogonal.EdgeLayoutDescriptor} instance that will be used during the various phases of the layout - * algorithm to determine the drawing details of the edges of the graph. - *

- * This method may be overridden to create a new {@link yfiles.orthogonal.EdgeLayoutDescriptor} instance with different - * configuration settings. - *

- * @returns a new {@link } instance - * @protected - */ - createEdgeLayoutDescriptor():yfiles.orthogonal.EdgeLayoutDescriptor; - /** - * Data provider key for providing layout information for each edge - *

- * If no edge layout descriptor is mapped for an edge, a default edge layout descriptor will be obtained using method - * {@link yfiles.orthogonal.OrthogonalLayout#createEdgeLayoutDescriptor}. - *

- * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_LAYOUT_DESCRIPTOR_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for marking edges which should be routed such that they point to the main layout orientation - *

- * The main layout orientation can be set using method {@link yfiles.layout.MultiStageLayout#layoutOrientation}. - *

- * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static DIRECTED_EDGE_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Gets or sets the {@link yfiles.orthogonal.EdgeLayoutDescriptor} instance used for all those edges that do not have a specific - * layout descriptor assigned. - *

- * By default, this method will return an {@link yfiles.orthogonal.EdgeLayoutDescriptor} instance created with - * {@link yfiles.orthogonal.OrthogonalLayout#createEdgeLayoutDescriptor}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.orthogonal.EdgeLayoutDescriptor} is null - * @see yfiles.orthogonal.OrthogonalLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @type {yfiles.orthogonal.EdgeLayoutDescriptor} - */ - edgeLayoutDescriptor:yfiles.orthogonal.EdgeLayoutDescriptor; - /** - * Gets or sets whether or not the layout algorithm considers node labels when calculating node positions to avoid - * overlaps. - *

- * This method is a convenience method that assures that the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm} is of type {@link yfiles.layout.LabelLayoutTranslator} - * and {@link yfiles.layout.LabelLayoutTranslator#translateNodeLabels} is set to true. - *

- * @throws {Stubs.Exceptions.InvalidOperationError} if no properly configured {@link yfiles.layout.LabelLayoutTranslator} is registered even though this property was enabled - * earlier (can happen when manually specifying the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm}). - * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Gets or sets whether or not the layout algorithm preserves space and places edge labels. - *

- * To define the desired placement for each label add a {@link yfiles.layout.PreferredPlacementDescriptor} on - * {@link yfiles.layout.IEdgeLabelLayout}. - *

- *

- * This method also assures that the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm} is of type {@link yfiles.layout.LabelLayoutTranslator} and {@link yfiles.layout.LabelLayoutTranslator#translateEdgeLabels} is set to - * true. - *

- * @throws {Stubs.Exceptions.InvalidOperationError} if no properly configured {@link yfiles.layout.LabelLayoutTranslator} is registered even though integrated labeling was enabled - * earlier (can happen when manually specifying the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm}). - * @type {boolean} - */ - integratedEdgeLabeling:boolean; - /** - * Gets or sets whether or not a randomization strategy should be performed. - *

- * The randomization will increase the overall layout quality with high probability. The drawback is that the running time - * of the layout algorithm may increase. - *

- * @type {boolean} - */ - randomization:boolean; - /** - * Gets or sets whether or not degree-one nodes that have the same neighbor should be aligned. - * @type {boolean} - */ - alignDegreeOneNodes:boolean; - /** - * Gets or sets whether or not one face of the embedding of the graph should be maximized. - *

- * An embedding of a graph is uniquely specified by the cyclic order of edges incident to the same node in a graph - * drawing. - *

- *

- * In any planar drawing of a planar graph, the edges divide the plane into different regions called faces. If one of these - * faces (the outer face) gets maximized, all other faces will be more compact. - *

- * @see yfiles.orthogonal.OrthogonalLayout#randomization - * @type {boolean} - */ - faceMaximization:boolean; - /** - * Gets or sets whether or not the number of edge crossings should be reduced. - *

- * The layout algorithm will try to significantly reduce the number of crossings in a post-processing step. - *

- * @type {boolean} - */ - crossingReduction:boolean; - /** - * Gets or sets whether or not the number of perceived bends should be minimized. - *

- * A perceived bend is not an actual bend but it is created when a helical arrangement of chains of nodes occurs. - *

- * @type {boolean} - */ - optimizePerceivedBends:boolean; - /** - * Gets or sets the equidistant spacing between the horizontal and vertical grid lines. - *

- * Each node will be placed on a grid point. Edges will be routed such that all segments but the first and last one lie on - * grid lines. (The first and last segments of an edge may or may not lie on grid lines.) Edges consisting of a single - * segment always lie on grid lines. - *

- *

- * The grid spacing has to be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the grid spacing is negative - * @type {number} - */ - gridSpacing:number; - /** - * Gets or sets the layout style for this layout algorithm. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown layout style is given - * @type {yfiles.orthogonal.LayoutStyle} - */ - layoutStyle:yfiles.orthogonal.LayoutStyle; - /** - * Gets or sets whether or not the overall edge length should be optimized. - *

- * The algorithm will try to significantly reduce the length of some edges. - *

- * @type {boolean} - */ - edgeLengthReduction:boolean; - /** - * Gets or sets whether or not the existing drawing should be used as a sketch of the resulting orthogonal layout. - *

- * The layout algorithm will try to orthogonalize the given sketch without making too many modifications with respect to - * the original drawing. - *

- * @type {boolean} - */ - fromSketchMode:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. - * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled - * @see yfiles.layout.MultiStageLayout#componentLayout - * @see yfiles.layout.ComponentLayout - * @type {boolean} - */ - componentLayoutEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for hiding group nodes is activated. - * @see yfiles.layout.MultiStageLayout#hideGroupsStageEnabled - * @see yfiles.layout.MultiStageLayout#hideGroupsStage - * @see yfiles.layout.HideGroupsStage - * @type {boolean} - */ - hideGroupsStageEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. - * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled - * @see yfiles.layout.MultiStageLayout#orientationLayout - * @see yfiles.layout.MultiStageLayout#layoutOrientation - * @see yfiles.layout.OrientationLayout - * @type {boolean} - */ - orientationLayoutEnabled:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.orthogonal.OrthogonalLayout; - } - /** - * This layout algorithm arranges a graph in a compact, orthogonal fashion. - *

- * Layout Style - *

- *

- * This layout algorithm is a variant of {@link yfiles.orthogonal.OrthogonalLayout} that tries to arrange nodes in a more compact - * way. It allows to specify a desired aspect ratio for the bounds of the calculated layout. Nodes of a given graph are - * arranged such that each edge is drawn as an alternating sequence of horizontal and vertical segments. - *

- *

- * {@link yfiles.orthogonal.CompactOrthogonalLayout} is well suited for small and medium-sized sparse graphs and produces compact - * drawings with no overlapping nodes, few crossings and few bends. It is also especially suitable for printing the diagram - * on a paper of predefined size. As a disadvantage, this algorithm will usually produce less elegant edge routes than the - * ones of {@link yfiles.orthogonal.OrthogonalLayout}. - *

- *

- * Application domains of orthogonal drawings are software engineering, project management, function call graphs and - * object-oriented class diagrams. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":0},"n":[[165,65],[285,405],[285,125],[225,285],[25,285],[225,365],[105,365],[285,205],[105,285],[165,205],[165,-15],[365,205]],"e":[[0,2,15,0,-5,-15,[295,80]],[4,1,-5,15,-15,0,[35,420]],[5,3,0,-15,0,15],[5,6,-15,5,15,5],[6,4,-15,0,5,15,[45,380]],[1,7,0,-15,0,15],[3,7,5,-15,-15,5,[245,225]],[2,7,0,15,0,-15],[4,8,15,0,-15,0],[3,8,-15,0,15,0],[6,8,0,-15,0,15],[4,9,-0,-15,-15,-5,[40,215]],[0,9,-5,15,-5,-15],[3,9,-5,-15,5,15,[235,261,185,261]],[8,9,-0,-15,-15,5,[120,225]],[9,5,-5,15,-15,-5,[175,375]],[9,7,15,-5,-15,-5],[9,2,5,-15,-15,0,[185,140]],[0,10,0,-15,0,15],[4,10,-15,0,-15,0,[23,300,23,0]],[10,3,15,-5,15,0,[397,-5,397,300]],[10,2,15,5,5,-15,[305,5]],[2,11,15,0,0,-15,[380,140]],[11,5,0,15,15,0,[380,380]],[11,7,-15,0,15,0]],"vp":[23.0,-15.0,374.0,450.0]}} Sample output of the layout algorithm with aspect ratio 1.0Concept - *

- *

- * This algorithm is implemented as a {@link yfiles.layout.PartitionLayout} and applies the following steps: - *

- *
    - *
  • - * Divides the graph into smaller partitions using the partition finder instance created by - * {@link yfiles.layout.PartitionLayout#createEdgeBetweennessPartitionFinder}. - *
  • - *
  • Arranges the nodes of each graph partition using {@link yfiles.orthogonal.OrthogonalLayout}.
  • - *
  • - * Arranges the partitions themselves in a compact manner using the partition placer instance created by - * {@link yfiles.layout.PartitionLayout#createComponentPartitionPlacer}. - *
  • - *
  • Routes the edges between partitions (inter-edges) using the router instance created by CreateChannelInterEdgeRouter.
  • - *
- *

- * Each of these steps can be individually configured and/or replaced. To do so, use methods {@link yfiles.layout.PartitionLayout#partitionFinder}, {@link yfiles.layout.LayoutStageBase#coreLayout}, {@link yfiles.layout.PartitionLayout#partitionPlacer} and {@link yfiles.layout.PartitionLayout#interEdgeRouter}, respectively. - *

- *

- * Features - *

- *

- * The aspect ratio of the resulting layout bounds, i.e., the ratio of width/height of the layout, can be configured using - * {@link yfiles.orthogonal.CompactOrthogonalLayout#aspectRatio}. {@link yfiles.orthogonal.CompactOrthogonalLayout} tries to reach this preferred value. However, depending on the actual graph - * structure, this may not always be possible. - *

- *

- * Octilinear routing of edges can be supported by appending {@link yfiles.router.PolylineLayoutStage}. - *

- * @class - * @extends {yfiles.layout.PartitionLayout} - */ - export interface CompactOrthogonalLayout extends yfiles.layout.PartitionLayout{} - export class CompactOrthogonalLayout { - /** - * Creates a new {@link yfiles.orthogonal.CompactOrthogonalLayout} instance with default settings. - */ - constructor(); - /** - * Gets or sets the equidistant spacing between the horizontal and vertical grid lines. - *

- * Each node will be placed on a grid point. Edges will be routed such that their segments lie on grid lines, if the - * endpoints of the edges allow to place the ports accordingly. - *

- *

- * The grid spacing has to be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the grid spacing is negative or zero - * @type {number} - */ - gridSpacing:number; - /** - * Gets or sets the desired aspect ratio (i.e. - *

- * the quotient width/height) of the resulting layout bounds. - *

- *

- * The aspect ratio needs to be greater than 0. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given aspect ratio is less than or equal to zero - * @see yfiles.layout.PartitionLayout#partitionPlacer - * @see yfiles.layout.PartitionLayout.T1 - * @type {number} - */ - aspectRatio:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.orthogonal.CompactOrthogonalLayout; - } - /** - * Specifies custom data for the {@link yfiles.orthogonal.OrthogonalLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface OrthogonalLayoutData extends yfiles.layout.LayoutData{} - export class OrthogonalLayoutData { - constructor(); - /** - * Gets or sets the mapping from edges to their {@link yfiles.orthogonal.EdgeLayoutDescriptor}. - * @see yfiles.orthogonal.EdgeLayoutDescriptor - * @see yfiles.orthogonal.OrthogonalLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLayoutDescriptors:yfiles.layout.ItemMapping; - /** - * Gets or sets the collection of edges that should be routed in a way that point in the main layout direction. - * @see yfiles.orthogonal.OrthogonalLayout#DIRECTED_EDGE_DP_KEY - * @type {yfiles.layout.ItemCollection.} - */ - directedEdges:yfiles.layout.ItemCollection; - /** - * Gets or sets a mapping from edges to an object representing their source edge group. - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourceGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their target edge group. - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the mapping that provides a {@link yfiles.layout.PreferredPlacementDescriptor} instance for edge - * {@link yfiles.graph.ILabel}s. - * @see yfiles.layout.PreferredPlacementDescriptor - * @see yfiles.layout.LayoutGraphAdapter#EDGE_LABEL_LAYOUT_PREFERRED_PLACEMENT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLabelPreferredPlacement:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.orthogonal.OrthogonalLayoutData; - } - }export namespace radial{ - export enum CenterNodesPolicy{ - /** - * Specifier for a center nodes policy which chooses all nodes with in-degree equal to 0 as center nodes. If no node with - * this property is present, an arbitrary node will be selected. - * @see yfiles.radial.RadialLayout#centerNodesPolicy - * @see yfiles.algorithms.Trees#getRoot - */ - DIRECTED, - /** - * Specifier for a center nodes policy which chooses the node with the highest centrality as center node. - * @see yfiles.radial.RadialLayout#centerNodesPolicy - * @see yfiles.algorithms.Trees#getCenterRoot - */ - CENTRALITY, - /** - * Specifier for a center nodes policy which chooses the node with the highest weighted centrality as center node. - * @see yfiles.radial.RadialLayout#centerNodesPolicy - * @see yfiles.algorithms.Trees#getWeightedCenterNode - */ - WEIGHTED_CENTRALITY, - /** - * Specifier for a center nodes policy which uses center nodes specified by the user. The center nodes have to be specified - * using a {@link yfiles.algorithms.IDataProvider} registered with the {@link yfiles.radial.RadialLayout#centerNodesDpKey according key}. The {@link yfiles.algorithms.IDataProvider} returns true - * for nodes that should be placed in the center. - *

- * If there exists more than one center node, they will be placed on the innermost circle while the center position stays - * empty. - *

- * @see yfiles.radial.RadialLayout#centerNodesPolicy - * @see yfiles.radial.RadialLayout#centerNodesDpKey - */ - CUSTOM - } - export enum LayeringStrategy{ - /** - * Specifier for a layering strategy that uses breadth first search (BFS) to determine a layering for the graph. All edges - * will span at most one layer in the resulting drawing. Edges between nodes that belong to the same layer are possible. - * @see yfiles.radial.RadialLayout#layeringStrategy - */ - BFS, - /** - * Specifier for a layering strategy that uses an optimal hierarchical layering strategy. The layer distance of an edge is - * the absolute difference between the layer numbers of its source and target node. Layer assignment will be done such that - * the overall sum of the layer distances of all edges in the layout is minimal. - * @see yfiles.radial.RadialLayout#layeringStrategy - */ - HIERARCHICAL - } - export enum EdgeRoutingStrategy{ - /** - * Specifier for an edge routing strategy that will route edges with polyline segments from source to target with one bend - * on each spanned circle. - * @see yfiles.radial.RadialLayout#edgeRoutingStrategy - */ - POLYLINE, - /** - * Specifier for an edge routing strategy that will route edges as arcs. The source and target of an edge as well as one - * bend on each spanned circle are used as main control points. An easing function is applied in order to calculate - * additional control points between the polar coordinates of the main control points. - * @see yfiles.radial.RadialLayout#edgeRoutingStrategy - */ - ARC - } - /** - * Info object used for retrieving information about each node from the layout algorithm. - *

- * The information can be retrieved by registering with the graph a {@link yfiles.algorithms.IDataProvider} (which should also - * implement the {@link yfiles.algorithms.IDataAcceptor} interface) using key {@link yfiles.radial.RadialLayout#NODE_INFO_DP_KEY}. The - * layout algorithm will return a {@link yfiles.radial.RadialLayoutNodeInfo} object with appropriately filled fields for each {@link yfiles.algorithms.Node} - * when the layout is calculated. - *

- * @class - */ - export interface RadialLayoutNodeInfo extends yfiles.lang.Object{} - export class RadialLayoutNodeInfo { - /** - * Creates a new {@link yfiles.radial.RadialLayoutNodeInfo} instance. - */ - constructor(); - /** - * Gets the index of the circle the node is placed on. - *

- * The circles used by the {@link yfiles.radial.RadialLayout} are indexed from the innermost to the outermost circle. Index 0 - * represents the center, i.e. the circle with radius 0. - *

- * @type {number} - */ - circleIndex:number; - /** - * Gets the radius of the circle the node is placed on. - * @type {number} - */ - radius:number; - /** - * Gets the offset from the center of the circle, the node is placed on, to the center of the node. - * @type {yfiles.algorithms.YPoint} - */ - centerOffset:yfiles.algorithms.YPoint; - /** - * Gets the start angle in degrees of the sector the node is placed in. - *

- * The angle refers to a counter-clockwise rotation starting at the 3 o'clock position. - *

- * @see yfiles.radial.RadialLayoutNodeInfo#sectorSize - * @type {number} - */ - sectorStart:number; - /** - * Gets the size in degrees of the sector the node is placed in. - * @see yfiles.radial.RadialLayoutNodeInfo#sectorStart - * @type {number} - */ - sectorSize:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.radial.RadialLayoutNodeInfo; - } - /** - * This layout algorithm arranges graphs in a radial fashion. - *

- * Layout Style The nodes are distributed into circles (layers) around a common center based on predefined {@link yfiles.radial.RadialLayout#layeringStrategy layering strategies}. Some - * potential applications include visualization of social networks, data clustering and bioinformatics. {@graph {"ann":{"s":[30,30],"d":1, "c":1, "bg": 0}, "styles" : {"6" : {"a" : 0.5,"c" : 1,"bg" : 1,"f" : null}},"n":[[-15,-15,1],[13.93,106.61],[65.6,80.55],[109.84,-8.76],[64.87,-111.16],[-81.77,-120.67],[-13.62,-139.99],[-133.34,-55.24],[-132.35,28.06],[-74.13,95.13],[-51.74,-262.29],[27.21,-261.41],[144.74,-207.31],[217.89,-105.89],[279.81,-246.76],[224.61,-303.47],[158.73,-347.33],[207.67,98.65],[230.47,32.36],[233.97,-37.66],[-114.67,214.27],[-185.45,167.88],[-53,232.09],[-295.24,234.18],[-243.87,282.06],[-220.04,-158.04],[-251.69,-95.49],[-264.73,-26.61],[-375,-381.52,750,750,6],[-255.95,-247.77,500,500,6],[-120,-120,240.76,240,6]],"e":[[0,1],[0,2],[0,3],[0,4],[0,5],[0,6],[0,7],[0,8],[0,9],[9,8,[-70.52,125.91,-86.2,136.85,-105.19,140.56,-124.87,135.74,-141.6,122.91,-151.95,104.54,-153.96,84.38,-147.61,66.1,-134.58,52.11]],[6,10,[-1.65,-142.85,-15.61,-195.81,-28.91,-230.34]],[6,11,[4.82,-142.78,19.94,-195.41,34,-229.64]],[4,11,[82.38,-111.82,83.32,-128.06,82.62,-144.75,80.23,-161.75,76.13,-178.92,70.29,-196.12,62.69,-213.2,53.33,-230.01]],[4,12],[4,13,[94.6,-101.69,110.18,-105.84,126.49,-108.53,143.41,-109.7,160.83,-109.28,178.62,-107.22,214.79,-98.06]],[3,13,[138.89,0.42,165.98,-15.1,191.14,-35.68,213.67,-61.05,223.74,-75.44]],[12,14,[175.06,-199.78,223.92,-217.98,276.56,-229.49]],[12,15],[12,16,[164.26,-208.75,173.19,-260.12,174.85,-313.97]],[3,17,[138.24,13.42,163.65,31.57,186.64,54.55,206.52,82.04,215.1,97.36]],[3,18,[142.51,9.99,211.87,32.11,228.78,39.39]],[3,19,[142.79,4.26,214.01,-10.83,231.56,-16.39]],[9,20,[-67.21,129.42,-94.25,208.89]],[9,21,[-72.16,123.29,-101.29,147.07,-134.19,167.07,-151.93,175.53]],[21,7,[-170.54,166.68,-181.84,45.73,-180.63,25.53,-175.63,6.64,-167.31,-9.76,-156.5,-22.85,-144.15,-32.21,-131.17,-37.89]],[9,22,[-61.2,126.61,-61.38,160.54,-56.17,195.2,-45.44,229.93]],[21,23,[-185.24,193.48,-263.69,240.87]],[21,24,[-179.99,198.37,-221.74,279.97]],[7,25,[-131.46,-49.93,-155.99,-72.16,-177.9,-98.03,-196.82,-127.26]],[7,26],[7,27,[-134.65,-40.57,-167.65,-37.89,-200.78,-30.75,-233.59,-19.11]]],"vp":[-375.0,-382.0,750.0,751.0]}} Sample output of - * the layout algorithm with default settings and one center node {@graph {"ann":{"s":[30,30],"d":1, "c":1, "bg": 0}, "styles" : {"6" : {"a" : 0.5,"c" : 1,"bg" : 1,"f" : null}},"n":[[-168.28,-179.72],[-227.35,-89.37],[195.73,63.85],[208.34,-42.28],[-239.94,-9.73],[-217.86,82.33],[154.4,133.08],[-136.84,174.15],[96.65,-210.34],[-286.03,-236.46],[-80.8,-230.16],[-216.41,-301.24],[-345.33,-130.69],[-330.56,136.4],[-204.53,279.24],[-48.25,207.53],[170.9,-141.76],[-0.72,-239.55],[59.22,197.41],[153.75,291.63],[64.99,325.74],[93.56,447.43],[158.68,-318.87],[-415.1,241.02],[-465.07,136.87],[-272.22,384.33],[332.42,-57.43],[0.83,-113.74,1],[49.15,61.71,1],[80.56,-44.46,1],[-89.99,51.16,1],[-97,-72.24,1],[-465.42,-448.52,920,920,6],[-355.1,-344.73,700,700,6],[-226.03,-218.04,445,445,6],[-97,-100.15,194,194,6]],"e":[[0,9],[0,10],[0,11],[1,12],[1,13],[13,5],[7,14],[19,18],[20,18],[20,21],[8,22],[13,23],[23,14],[13,24],[14,25],[3,26],[10,27],[16,27],[27,17],[27,8],[28,18],[28,6],[28,2],[29,28],[29,16],[29,27],[29,3],[7,30],[30,28],[30,15],[30,4],[30,5],[31,27],[31,0],[31,1],[31,30]],"vp":[-466.0,-449.0,921.0,927.0]}} Sample output of the layout algorithm with straight-line - * edges and five center nodes using {@link yfiles.radial.CenterNodesPolicy#CUSTOM} policyConcept The layout algorithm creates a virtual - * tree structure for the input graph whose root node is placed in the center of the circles. All children of a tree node - * are placed on a higher layer (i.e. on a circle of larger radius) than their parent. A sector is calculated for each node - * such that the sector of each child node in the virtual tree is a sub-sector of its parent's sector. The radii of the - * circles are calculated based on the sizes of the sectors required to accommodate each whole subtree. Features - *

- *

- * There are different {@link yfiles.radial.RadialLayout#centerNodesPolicy center nodes policies} that can be applied in order to determine the nodes that will be placed in the - * center (single center node) or on the innermost circle (more than one center node). The distribution of the nodes to the - * circles is specified by a {@link yfiles.radial.RadialLayout#layeringStrategy layering strategy}. - *

- *

- * The edges are routed based on the - * {@link yfiles.radial.RadialLayout#edgeRoutingStrategy edge routing strategy}. Note that the edge routing cannot always prevent node-edge overlaps. - *

- *

- * The minimum distance between nodes of the same circle is specified using - * {@link yfiles.radial.RadialLayout#minimumNodeToNodeDistance}. If there are too many nodes assigned to a circle, the radius of the particular circle will be increased until all - * nodes fit onto it. - *

- *

- * The distance between consecutive layers is specified using {@link yfiles.radial.RadialLayout#layerSpacing}. The radii of the circles are a multiple of this spacing - * value. If the layer spacing is 0, the radii are chosen such that all nodes fit on their corresponding circles. A minimum - * layer distance is specified by {@link yfiles.radial.RadialLayout#minimumLayerDistance}. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface RadialLayout extends yfiles.layout.MultiStageLayout{} - export class RadialLayout { - /** - * Creates a new {@link yfiles.radial.RadialLayout} instance with the default settings. - */ - constructor(); - /** - * Data acceptor key for publishing the circle ID and sector data - *

- * For each node, the ID of the circle and data regarding the circular sector on which it was placed will be stored. - *

- * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static NODE_INFO_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Gets or sets the minimum distance between two neighboring nodes of the same circle. - * @throws {Stubs.Exceptions.ArgumentError} if the given minimum distance is negative - * @type {number} - */ - minimumNodeToNodeDistance:number; - /** - * Gets or sets the spacing between two consecutive circles (layers). - *

- * The spacing is a non-negative value, where 0 means that no spacing is considered. - *

- *

- * The radius of each circle will be a multiple of this value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the spacing value is negative - * @type {number} - */ - layerSpacing:number; - /** - * Gets or sets the minimum distance between two circles. - * @throws {Stubs.Exceptions.ArgumentError} if the minimum layer distance is negative - * @type {number} - */ - minimumLayerDistance:number; - /** - * Gets or sets the maximum sector angle around a node within which the node's children will be placed. - *

- * Based on the location of a given node, the sector of its children that lie on the next outer layer is described by this - * angle. The vertex of the angle is located in the center of the node while its sides point away from the inner circles. - * The child nodes are placed inside this angle. If there is not enough space, the radius of the child circle is - * increased. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the sector angle is negative or greater than 360 degrees - * @type {number} - */ - maximumChildSectorAngle:number; - /** - * Gets or sets the minimum bend angle (in degrees) between two adjacent edge segments. - *

- * The minimum bend angle is defined to be a value between 0 and 90 degrees. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given minimum bend angle is negative or greater than 90 - * @type {number} - */ - minimumBendAngle:number; - /** - * Gets or sets the policy that determines which nodes are selected as roots of the (virtual) tree for the layout process - * and are set in the center of the circles. - * @throws {Stubs.Exceptions.ArgumentError} if an invalid center node policy is given - * @type {yfiles.radial.CenterNodesPolicy} - */ - centerNodesPolicy:yfiles.radial.CenterNodesPolicy; - /** - * Gets or sets the {@link yfiles.algorithms.IDataProvider} key used for looking up the selected nodes that should be placed in the - * center. - * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null - * @type {any} - */ - centerNodesDpKey:any; - /** - * Gets or sets the layering strategy that determines how nodes are distributed into different layers. - *

- * All nodes of a given layer will be placed on the same circle. - *

- * @throws {Stubs.Exceptions.ArgumentError} if an invalid layering strategy is set - * @type {yfiles.radial.LayeringStrategy} - */ - layeringStrategy:yfiles.radial.LayeringStrategy; - /** - * Gets or sets the edge routing strategy. - * @throws {Stubs.Exceptions.ArgumentError} if an invalid edge routing strategy is set - * @type {yfiles.radial.EdgeRoutingStrategy} - */ - edgeRoutingStrategy:yfiles.radial.EdgeRoutingStrategy; - /** - * Gets or sets whether or not node labels are taken into account when calculating node positions. - *

- * Thereby, possible node/node label or node label/node label overlaps are prevented. - *

- * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. - * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled - * @see yfiles.layout.MultiStageLayout#orientationLayout - * @see yfiles.layout.MultiStageLayout#layoutOrientation - * @see yfiles.layout.OrientationLayout - * @type {boolean} - */ - orientationLayoutEnabled:boolean; - /** - * Gets the {@link yfiles.layout.EdgeBundling} instance that defines the settings of the edge bundling feature. - *

- * The specified {@link yfiles.layout.EdgeBundling} defines global bundling properties. Settings for individual edges can be - * defined by assigning an {@link yfiles.layout.EdgeBundleDescriptor} to an edge using a {@link yfiles.algorithms.IDataProvider} registered - * with key {@link yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY}. - *

- * @type {yfiles.layout.EdgeBundling} - */ - edgeBundling:yfiles.layout.EdgeBundling; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.radial.RadialLayout; - } - /** - * Specifies custom data for the {@link yfiles.radial.RadialLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface RadialLayoutData extends yfiles.layout.LayoutData{} - export class RadialLayoutData { - constructor(); - /** - * Gets or sets the collection of nodes that shall be placed in the center with {@link yfiles.radial.RadialLayout#centerNodesPolicy center node policy} set to {@link yfiles.radial.CenterNodesPolicy#CUSTOM} - * . - * @see yfiles.radial.RadialLayout#centerNodesDpKey - * @type {yfiles.layout.DpKeyItemCollection.} - */ - centerNodes:yfiles.layout.DpKeyItemCollection; - /** - * Gets or sets the mapping from nodes to a {@link yfiles.radial.RadialLayoutNodeInfo} describing on which circle and in which - * sector the node is placed. - *

- * If the mapper contains a {@link yfiles.radial.RadialLayoutNodeInfo} for a node, the layout will update its property during the - * layout. - *

- * @see yfiles.radial.RadialLayout#NODE_INFO_DP_KEY - * @type {yfiles.collections.IMapper.} - */ - nodeInfos:yfiles.collections.IMapper; - /** - * Gets or sets a mapping from edges to an object representing their source edge group. - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourceGroups:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their target edge group. - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetGroups:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. - * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - nodeHalos:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the mapping of edges to their {@link yfiles.layout.EdgeBundleDescriptor}. - *

- * Bundling together multiple edges means that their common parts are to some degree merged into a bundled part. At the - * source and target point, the edges are again clearly split. - *

- *

- * If an edge is mapped to null, the {@link yfiles.layout.EdgeBundling#defaultBundleDescriptor default descriptor} is used. - *

- * @see yfiles.layout.EdgeBundleDescriptor - * @see yfiles.radial.RadialLayout#edgeBundling - * @type {yfiles.layout.ItemMapping.} - */ - edgeBundleDescriptors:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.radial.RadialLayoutData; - } - }export namespace seriesparallel{ - /** - * {@link yfiles.seriesparallel.DefaultOutEdgeComparer} is the default implementation for the out-edge comparator used in - * {@link yfiles.seriesparallel.SeriesParallelLayout}. - *

- * It keeps the order of the edges in the graph for edges without {@link yfiles.layout.PortConstraint}s and considers the - * {@link yfiles.layout.PortConstraint}s such that the order of the target nodes of the outgoing edges is similar to the port - * location at the source node. Note that this won't work for all cases because the target nodes may not be completely - * independent. - *

- * @see yfiles.seriesparallel.SeriesParallelLayout#defaultOutEdgeComparer - * @class - * @implements {yfiles.collections.IComparer.} - */ - export interface DefaultOutEdgeComparer extends yfiles.lang.Object,yfiles.collections.IComparer{} - export class DefaultOutEdgeComparer { - /** - * Creates a {@link yfiles.seriesparallel.DefaultOutEdgeComparer} instance with default settings. - */ - constructor(); - /** - * Compares the two given edges considering their {@link yfiles.layout.PortConstraint}s. - *

- * The order of edges is kept unless there are - * {@link yfiles.layout.PortConstraint}s assigned. Then the edges will be sorted to avoid edge crossings. - *

- * @param o1 the first edge - * @param o2 the second edge - * @returns the order of the given two edges - */ - compare(o1:any,o2:any):number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.seriesparallel.DefaultOutEdgeComparer; - } - /** - * {@link yfiles.seriesparallel.DefaultPortAssignment} implements the default port assignment strategy. - *

- * Ports are either placed at the {@link yfiles.seriesparallel.PortAssignmentMode#CENTER center} or get {@link yfiles.seriesparallel.PortAssignmentMode#DISTRIBUTED distributed} at the sides of the node. - *

- *

- * If {@link yfiles.layout.PortConstraint}s are specified, the strong {@link yfiles.layout.PortConstraint}s are handled separately and keep - * their initial location relative to the node while weak - * {@link yfiles.layout.PortConstraint}s just influence on which side of the node the port is placed. - *

- *

- * If there are edge groups specified, the edges which belong to the same group get the same port locations. - *

- * @see yfiles.layout.PortConstraint - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @class - * @implements {yfiles.seriesparallel.IPortAssignment} - */ - export interface DefaultPortAssignment extends yfiles.lang.Object,yfiles.seriesparallel.IPortAssignment{} - export class DefaultPortAssignment { - /** - * Creates a new {@link yfiles.seriesparallel.DefaultPortAssignment} instance using the given {@link yfiles.seriesparallel.DefaultPortAssignment#mode mode} and a given value for the {@link yfiles.seriesparallel.DefaultPortAssignment#borderGapToPortGapRatio ratio} - * of the gap between the border and the ports to the gap between the ports themselves. - * @param mode one of the predefined port assignment modes - * @param [ratio=0.5] the ratio of the distance between outer ports and the border to the distance between any two ports - * @throws {Stubs.Exceptions.ArgumentError} if the given mode is unknown or the given ratio is negative - */ - constructor(mode:yfiles.seriesparallel.PortAssignmentMode,ratio?:number); - /** - * Creates a new {@link yfiles.seriesparallel.DefaultPortAssignment} with default settings. - */ - constructor(); - /** - * Places the ports of edges connecting to the given node according to the {@link yfiles.seriesparallel.DefaultPortAssignment#mode port assignment mode}. - * @param graph the input graph - * @param node the node whose adjacent edges' ports should be placed - * @see yfiles.seriesparallel.DefaultPortAssignment#mode - */ - assignPorts(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):void; - /** - * Determines the distance between the outer ports and the border of the node. - *

- * This implementation calculates the gap according to the number of edges at one side of the node. It also includes the - * {@link yfiles.seriesparallel.DefaultPortAssignment#borderGapToPortGapRatio ratio between border gap and port gap}. - *

- *

- * This method is called by {@link yfiles.seriesparallel.DefaultPortAssignment#assignPorts} to calculate the location of the first - * port. It may be overridden to implement a different distribution of ports on the node's side. - *

- * @param sideLength the width/height of the side - * @param edgeCount the number of edges that connect to this side - * @returns the absolute gap to be used on both sides of the ports - * @see yfiles.seriesparallel.DefaultPortAssignment#assignPorts - * @see yfiles.seriesparallel.DefaultPortAssignment#borderGapToPortGapRatio - * @protected - */ - getPortBorderGap(sideLength:number,edgeCount:number):number; - /** - * Determines the distance between two adjacent ports. - *

- * This implementation calculates the gap according to the number of edges at one side of the node. The edges are - * distributed keeping the given gap to the border of the node. - *

- *

- * This method is called by {@link yfiles.seriesparallel.DefaultPortAssignment#assignPorts} to calculate the distance between two - * ports. It may be overridden to implement a different distribution of ports on the node's side. - *

- * @param sideLength the width/height of the side - * @param edgeCount the number of edges/ports that connect to this side - * @param portBorderGap the port border gap (i.e. calculated by {@link #getPortBorderGap}) - * @returns the absolute distance to be used between two adjacent ports - * @see yfiles.seriesparallel.DefaultPortAssignment#assignPorts - * @see yfiles.seriesparallel.DefaultPortAssignment#getPortBorderGap - * @protected - */ - getPortDistanceDelta(sideLength:number,edgeCount:number,portBorderGap:number):number; - /** - * Gets or sets the mode that describes how ports are placed. - * @throws {Stubs.Exceptions.ArgumentError} if an unknown mode is specified - * @type {yfiles.seriesparallel.PortAssignmentMode} - */ - mode:yfiles.seriesparallel.PortAssignmentMode; - /** - * Gets or sets the ratio of the border gap (distance between the outer ports and the node border) to the port gap (distance between adjacent - * ports). - *

- * The ratio must have a positive value. If the ratio is - * 0, the ports will be distributed along the whole side of the node without a gap between the last port and the corner. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified ratio is negative - * @type {number} - */ - borderGapToPortGapRatio:number; - /** - * Gets or sets the fork style which influences the port assignment. - *

- * If the fork style is set to - * {@link yfiles.seriesparallel.ForkStyle#OUTSIDE_NODE}, edges without port constraints will be assigned in flow direction. - *

- *

- * If the fork style is set to - * {@link yfiles.seriesparallel.ForkStyle#AT_NODE}, the ports of edges in flow direction also get distributed to the sides unless - * they are without bends. Due to large minimum first/last segment lengths edges may overlap. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified fork style is unknown - * @type {yfiles.seriesparallel.ForkStyle} - */ - forkStyle:yfiles.seriesparallel.ForkStyle; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.seriesparallel.DefaultPortAssignment; - } - /** - * An {@link yfiles.seriesparallel.EdgeLayoutDescriptor} provides routing details for an edge that are considered by - * {@link yfiles.seriesparallel.SeriesParallelLayout}. - *

- * Such an {@link yfiles.seriesparallel.EdgeLayoutDescriptor} can either be specified for a single edge or shared by several edges. - * It is assigned by registering a {@link yfiles.algorithms.IDataProvider} with key - * {@link yfiles.seriesparallel.SeriesParallelLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. If no {@link yfiles.algorithms.IDataProvider} is - * registered with this key, {@link yfiles.seriesparallel.SeriesParallelLayout#defaultEdgeLayoutDescriptor a default descriptor} is used. - *

- * @see yfiles.seriesparallel.SeriesParallelLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @see yfiles.seriesparallel.SeriesParallelLayout#defaultEdgeLayoutDescriptor - * @class - */ - export interface EdgeLayoutDescriptor extends yfiles.lang.Object{} - export class EdgeLayoutDescriptor { - /** - * Creates a new instance of {@link yfiles.seriesparallel.EdgeLayoutDescriptor} with default settings. - */ - constructor(); - /** - * Creates a copy of this {@link yfiles.seriesparallel.EdgeLayoutDescriptor} instance. - * @returns a copy of this {@link } instance - */ - createCopy():yfiles.seriesparallel.EdgeLayoutDescriptor; - /** - * Gets or sets the minimum length for the associated edge. - *

- * The minimum length needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} for negative edge lengths - * @type {number} - */ - minimumLength:number; - /** - * Gets or sets the minimum length for the first segment of the associated edge. - *

- * The minimum first segment length needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} for negative minimum segment lengths - * @type {number} - */ - minimumFirstSegmentLength:number; - /** - * Gets or sets the minimum length for the last segment of the associated edge. - *

- * The minimum last segment length needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} for negative minimum segment lengths - * @type {number} - */ - minimumLastSegmentLength:number; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.seriesparallel.EdgeLayoutDescriptor; - } - export enum PortAssignmentMode{ - /** - * A port assignment specifier which defines that all ports are reset to the center of their nodes. - * @see yfiles.layout.PortConstraint - */ - CENTER, - /** - * A port assignment specifier which defines that the ports of incoming and outgoing edges are distributed evenly at the - * side of their nodes. - *

- * The source ports of edges without {@link yfiles.layout.PortConstraint}s will be distributed at the sides of their source and - * target nodes. Edges with weak {@link yfiles.layout.PortConstraint}s are distributed at the side of the nodes which is specified - * in the {@link yfiles.layout.PortConstraint}. - *

- *

- * Grouped edges will get the same port location. - *

- * @see yfiles.layout.PortConstraint - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - */ - DISTRIBUTED - } - export enum ForkStyle{ - /** - * Fork style specifier that defines that the edges will fork outside a node. Edges leave/enter the nodes south/north and - * bend between their source and target. - */ - OUTSIDE_NODE, - /** - * Fork style specifier that defines that the edges will fork on a node. Edges leave/enter the nodes south/north if they - * are straight (no bends) or east and west of the node. - */ - AT_NODE - } - export enum RoutingStyle{ - /** - * Style constant describing an orthogonal edge style. If this style is used, edges will contain only horizontal and - * vertical segments. - * @see yfiles.seriesparallel.SeriesParallelLayout#routingStyle - */ - ORTHOGONAL, - /** - * Style constant describing an octilinear edge style. If this style is used, edges will contain horizontal, vertical and - * 45-degree sloped segments. - * @see yfiles.seriesparallel.SeriesParallelLayout#routingStyle - */ - OCTILINEAR, - /** - * Style constant describing a polyline edge style. If this style is used, edges will contain vertical and other sloped - * segments. - * @see yfiles.seriesparallel.SeriesParallelLayout#routingStyle - */ - POLYLINE - } - /** - * A {@link yfiles.seriesparallel.IPortAssignment} is used by {@link yfiles.seriesparallel.SeriesParallelLayout} for determining the - * locations of the edges' ports at their incident nodes. - * @interface - */ - export interface IPortAssignment extends yfiles.lang.Object{ - /** - * Assigns both the incoming edges' target ports as well as all source ports for the outgoing edges. - *

- * Outgoing edges are sorted according to the specified out-edge comparator from left to right and incoming edges are in - * the order of the subgraphs they are coming from. - *

- *

- * This method is called by {@link yfiles.seriesparallel.SeriesParallelLayout} before the actual layout of the graph takes place. - *

- * @param graph the graph instance the node is part of - * @param node the node whose incident edges' ports are assigned - * @see yfiles.seriesparallel.SeriesParallelLayout#OUT_EDGE_COMPARER_DP_KEY - * @see yfiles.seriesparallel.SeriesParallelLayout#defaultOutEdgeComparer - * @abstract - */ - assignPorts(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):void; - } - var IPortAssignment:{ - $class:yfiles.lang.Class; - isInstance(o:any):o is yfiles.seriesparallel.IPortAssignment; - }; - /** - * This layout algorithm arranges series-parallel graphs. - *

- * Layout Style Series-parallel graphs are directed graphs with a single source (node without incoming edges) and a single sink (node - * without outgoing edges). The layout algorithm highlights the main layout direction (from source to sink). It also - * emphasizes the paths through the graph because edges are routed with few bends. - *

- *

- * {@link yfiles.seriesparallel.SeriesParallelLayout} is suitable for the visualization of circuits, call trees or flowcharts. - *

- *

- * {@graph {"ann":{"s":[30,30],"d":1},"n":[[226,0],[226,480],[278,60],[278,420],[0,270],[360,300],[300,300],[240,300],[240,180],[60,240],[0,330],[180,120],[120,240],[0,150],[180,270],[180,210],[338,180],[300,240],[436,240],[0,210],[240,240],[180,360],[360,240]],"e":[[0,1,[241,45,481.5,45,481.5,465,241,465]],[0,2,[241,45,293,45]],[3,1,[293,465,241,465]],[5,3,[375,405,293,405]],[6,3,[315,405,293,405]],[0,9,[241,45,75,45]],[9,1,[75,465,241,465]],[4,10],[10,1,[15,465,241,465]],[2,11,[293,105,195,105]],[11,8,[195,165,255,165]],[11,12,[195,165,135,165]],[0,13,[241,45,15,45]],[11,15],[15,14],[2,16,[293,105,353,105]],[16,3,[353,225,405.5,225,405.5,405,293,405]],[16,17,[353,225,315,225]],[17,6],[2,18,[293,105,451,105]],[18,3,[451,405,293,405]],[13,19],[19,4],[8,20],[20,7],[7,21,[255,345,195,345]],[14,21],[12,21,[135,345,195,345]],[21,3,[195,405,293,405]],[16,22,[353,225,375,225]],[22,5]],"vp":[0.0,0.0,482.0,510.0]}}Concept Series-parallel graphs are directed graphs with a single source (node without incoming edges) and a single sink (node - * without outgoing edges) that are built using only the following two rules: - *

- *
    - *
  1. Series composition: The source of a subgraph is merged with the sink of a second subgraph.
  2. - *
  3. Parallel composition: The sources and sinks of two subgraphs are merged.
  4. - *
- *

- * From the recursive structure of series-parallel graphs, the layout algorithm retrieves a decomposition tree where each - * node represents one of the decomposition types. Then, this tree is traversed recursively from bottom to top, aligning - * subgraphs above (series) or next to (parallel) each other until the whole graph is arranged. The edges are routed when - * both end nodes are placed. Different {@link yfiles.seriesparallel.SeriesParallelLayout#routingStyle routing styles} can be used. - *

- *

- * To avoid moving all nodes several times and to be aware of the area that the subtrees occupy, the layout algorithm keeps - * track of the shape of the subtrees. These shapes are moved and merged during the layout calculation. The layout - * algorithm also stores the connections between nodes and nodes that haven't already been placed in these shapes. - *

- *

- * Features - *

- *

- * {@link yfiles.seriesparallel.SeriesParallelLayout} can take strong - * {@link yfiles.layout.PortConstraint}s into account. It will connect the edges to the specified locations, the directions, - * however, will be ignored. - *

- *

- * Grouping of nodes can also be handled by this layout algorithm. It is important that a group node contains a whole - * series-parallel subgraph. Otherwise, the group nodes may overlap with each other or with other nodes. Edges which are - * connected to non-empty group nodes are not allowed. Furthermore, the user may specify minimum size constraints for each - * group node using {@link yfiles.algorithms.IDataProvider} key {@link yfiles.layout.GroupingKeys#MINIMUM_NODE_SIZE_DP_KEY}. - *

- *

- * The layout algorithm can be configured to reserve space for node labels and to place the edge labels along the edge such - * that the labels won't overlap with other graph elements. Edge labels are placed according to the information stored in a - * {@link yfiles.layout.PreferredPlacementDescriptor} instance. However, labels that should be centered between source and target - * are placed close to the target node, unless this edge connects to the local source and sink of a subgraph. - *

- *

- * Parallel subgraphs can be aligned in different ways. Depending on the node sizes, a different alignment can increase the - * compactness of the layout. - *

- *

- * The way in which edges are distributed around their incident nodes is computed by an instance of - * {@link yfiles.seriesparallel.IPortAssignment}. The {@link yfiles.seriesparallel.DefaultPortAssignment default assignment} is able to consider - * {@link yfiles.layout.PortConstraint}s and edge groups. - *

- *

- * The {@link yfiles.seriesparallel.SeriesParallelLayout#fromSketchMode From Sketch mode} allows to take the initial locations of the nodes into account. However, the layout algorithm won't - * insert crossings because it maintains the order of children of each node. - *

- *

- * {@link yfiles.seriesparallel.SeriesParallelLayout} supports custom sorting of the outgoing edges of a node. A {@link yfiles.collections.IComparer.} can be assigned - * individually for the nodes using a {@link yfiles.algorithms.IDataProvider} registered with key - * {@link yfiles.seriesparallel.SeriesParallelLayout#OUT_EDGE_COMPARER_DP_KEY}. For all nodes for which the {@link yfiles.algorithms.IDataProvider} - * returns null, the layout algorithm falls back to the {@link yfiles.seriesparallel.SeriesParallelLayout#defaultOutEdgeComparer default comparator}. - *

- *

- * By default, this layout algorithm can only handle graphs with a series-parallel structure. To apply it to a general - * graph, {@link yfiles.seriesparallel.SeriesParallelLayout#generalGraphHandling general graph handling} needs to be activated. Then, the layout algorithm will temporarily add and/or remove some - * edges from the input graph until a series-parallel graph is obtained. The edges that were removed will be routed - * separately afterwards. - *

- * @class - * @extends {yfiles.layout.MultiStageLayout} - */ - export interface SeriesParallelLayout extends yfiles.layout.MultiStageLayout{} - export class SeriesParallelLayout { - /** - * Creates a new {@link yfiles.seriesparallel.SeriesParallelLayout} instance with default settings. - */ - constructor(); - /** - * Determines whether or not the given graph has a series-parallel structure. - *

- * The current implementation detects the series-parallel graph structure in linear time. - *

- * @param graph the input graph - * @returns true if the given graph is series-parallel, false otherwise - * @static - */ - static isSeriesParallelGraph(graph:yfiles.algorithms.Graph):boolean; - /** - * Data provider key for storing individual settings for edges - *

- * If no edge layout descriptor is mapped for an edge, a default edge layout descriptor will be obtained by method {@link yfiles.seriesparallel.SeriesParallelLayout#defaultEdgeLayoutDescriptor}. - *

- * @see yfiles.seriesparallel.SeriesParallelLayout#defaultEdgeLayoutDescriptor - * @const - * @static - * @type {yfiles.algorithms.EdgeDpKey.} - */ - static EDGE_LAYOUT_DESCRIPTOR_DP_KEY:yfiles.algorithms.EdgeDpKey; - /** - * Data provider key for assigning different orderings for outgoing edges of the nodes - *

- * If the {@link yfiles.collections.IComparer.} associated with a node is null, the outgoing edges maintain their initial order. - *

- * @see yfiles.seriesparallel.SeriesParallelLayout#defaultOutEdgeComparer - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.>} - */ - static OUT_EDGE_COMPARER_DP_KEY:yfiles.algorithms.NodeDpKey>; - /** - * Data provider key for providing an individual port distribution at nodes - *

- * If there is no {@link yfiles.seriesparallel.IPortAssignment} specified for a node, the layout algorithm uses the - * {@link yfiles.seriesparallel.SeriesParallelLayout#defaultPortAssignment default assignment}. - *

- * @see yfiles.seriesparallel.SeriesParallelLayout#defaultPortAssignment - * @const - * @static - * @type {yfiles.algorithms.NodeDpKey.} - */ - static PORT_ASSIGNMENT_DP_KEY:yfiles.algorithms.NodeDpKey; - /** - * Data provider key for marking edge labels of non-series-parallel edges - * @see yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeLabelSelectionKey - * @see yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeLabelingAlgorithm - * @const - * @static - * @type {yfiles.algorithms.IEdgeLabelLayoutDpKey.} - */ - static NON_SERIES_PARALLEL_EDGE_LABELS_DP_KEY:yfiles.algorithms.IEdgeLabelLayoutDpKey; - /** - * Gets or sets whether or not the layout algorithm reserves space for node labels to avoid overlaps. - * @type {boolean} - */ - considerNodeLabels:boolean; - /** - * Gets or sets whether or not the layout algorithm will place edge labels and reserve space for them. - * @type {boolean} - */ - integratedEdgeLabeling:boolean; - /** - * Gets or sets the vertical alignment of parallel subgraphs. - *

- * The alignment is defined by a ratio: - *

- *
    - *
  • Ratio 0 means that nodes are top-aligned
  • - *
  • Ratio 0.5 means that nodes are center-aligned
  • - *
  • Ratio 1 means that nodes are bottom-aligned
  • - *
- * @type {number} - */ - verticalAlignment:number; - /** - * Gets or sets whether or not the layout algorithm can handle general graphs. - *

- * General graphs are required to be transformed before being laid out (by adding or removing some edges) such that they - * satisfy the criteria of a series-parallel graph. After the layout, the graph will be restored and the initial edges - * which weren't included in the series-parallel graph are routed by a separate {@link yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeRouter edge routing algorithm}. Furthermore, the - * labels of these edges are placed by a customizable {@link yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeLabelingAlgorithm edge labeling algorithm}. - *

- * @type {boolean} - */ - generalGraphHandling:boolean; - /** - * Gets or sets the edge routing algorithm used for the edges of a general graph that are not part of the series-parallel - * subgraph whose layout is calculated. - * @throws {Stubs.Exceptions.ArgumentError} if null is specified - * @see yfiles.seriesparallel.SeriesParallelLayout#generalGraphHandling - * @see yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgesDpKey - * @type {yfiles.layout.ILayoutAlgorithm} - */ - nonSeriesParallelEdgeRouter:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that is used for marking non-series-parallel edges. - *

- * This key is used for determining the edges that are not part of the series-parallel structure in a general graph, such - * that the specified non-series-parallel edge router only routes marked edges. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the given key is set to null - * @see yfiles.seriesparallel.SeriesParallelLayout#generalGraphHandling - * @see yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeRouter - * @type {any} - */ - nonSeriesParallelEdgesDpKey:any; - /** - * Gets or sets the labeling algorithm that is applied to all edge labels that belong to non-series-parallel edges. - * @see yfiles.seriesparallel.SeriesParallelLayout#generalGraphHandling - * @see yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeLabelSelectionKey - * @type {yfiles.layout.ILayoutAlgorithm} - */ - nonSeriesParallelEdgeLabelingAlgorithm:yfiles.layout.ILayoutAlgorithm; - /** - * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that is used by the {@link yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeLabelingAlgorithm non-series-parallel edge labeling algorithm} - * to determine which edge labels it should place. - *

- * During the layout, a {@link yfiles.algorithms.IDataProvider} with this key will be registered with the graph. It will mark all - * {@link yfiles.layout.IEdgeLabelLayout}s that belong to non-series-parallel edges. A specified custom non-series-parallel edge - * labeling algorithm needs to obey this selection. If using {@link yfiles.labeling.GenericLabeling} as labeling algorithm, set - * this key as value of property {@link yfiles.labeling.LabelingBase#affectedLabelsDpKey}. - *

- *

- * The labeling algorithm set as default is already configured such that it uses the correct selection key. - *

- * @see yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeLabelingAlgorithm - * @type {any} - */ - nonSeriesParallelEdgeLabelSelectionKey:any; - /** - * Gets or sets the default {@link yfiles.seriesparallel.IPortAssignment} used for those nodes that do not have their own specific - * instance. - *

- * A {@link yfiles.seriesparallel.IPortAssignment} instance is defined using a {@link yfiles.algorithms.IDataProvider} registered with the - * graph with key {@link yfiles.seriesparallel.SeriesParallelLayout#PORT_ASSIGNMENT_DP_KEY}. - *

- * @throws {Stubs.Exceptions.ArgumentError} if null is specified - * @type {yfiles.seriesparallel.IPortAssignment} - */ - defaultPortAssignment:yfiles.seriesparallel.IPortAssignment; - /** - * Gets or sets the default {@link yfiles.collections.IComparer.} used for sorting the outgoing edges incident to nodes that do not have a specific {@link yfiles.collections.IComparer.}. - *

- * Such a comparator is defined using a {@link yfiles.algorithms.IDataProvider} registered with the graph with key - * {@link yfiles.seriesparallel.SeriesParallelLayout#OUT_EDGE_COMPARER_DP_KEY}. - *

- * @type {yfiles.collections.IComparer.} - */ - defaultOutEdgeComparer:yfiles.collections.IComparer; - /** - * Gets or sets the currently used routing style for edges. - * @type {yfiles.seriesparallel.RoutingStyle} - */ - routingStyle:yfiles.seriesparallel.RoutingStyle; - /** - * Gets or sets the minimum vertical distance of the edge segments that are not orthogonal. - *

- * The distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified length is smaller than 0 - * @see yfiles.seriesparallel.SeriesParallelLayout#minimumSlope - * @see yfiles.seriesparallel.SeriesParallelLayout#routingStyle - * @see yfiles.seriesparallel.RoutingStyle#POLYLINE - * @type {number} - */ - minimumPolylineSegmentLength:number; - /** - * Gets or sets the minimum slope which a non-orthogonal edge segment should have. - *

- * A higher minimum slope prevents those segments in very wide graphs from becoming nearly horizontal. The slope needs to - * have a non-negative value. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified slope is smaller than 0 - * @see yfiles.seriesparallel.SeriesParallelLayout#minimumPolylineSegmentLength - * @see yfiles.seriesparallel.SeriesParallelLayout#routingStyle - * @see yfiles.seriesparallel.RoutingStyle#POLYLINE - * @type {number} - */ - minimumSlope:number; - /** - * Gets or sets the preferred length for non-orthogonal segments in octilinear edge routes. - *

- * If there is not enough space, those segments may be shorter than the specified length. The length needs to be - * non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified length is smaller than 0 - * @see yfiles.seriesparallel.SeriesParallelLayout#routingStyle - * @see yfiles.seriesparallel.RoutingStyle#OCTILINEAR - * @type {number} - */ - preferredOctilinearSegmentLength:number; - /** - * Gets or sets the {@link yfiles.seriesparallel.EdgeLayoutDescriptor} instance used for all those edges that do not have a - * specific layout descriptor assigned. - * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.seriesparallel.EdgeLayoutDescriptor} is null - * @see yfiles.seriesparallel.SeriesParallelLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @type {yfiles.seriesparallel.EdgeLayoutDescriptor} - */ - defaultEdgeLayoutDescriptor:yfiles.seriesparallel.EdgeLayoutDescriptor; - /** - * Gets or sets the minimum distance between nodes. - *

- * This distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is smaller than 0 - * @type {number} - */ - minimumNodeToNodeDistance:number; - /** - * Gets or sets the minimum distance between nodes and edges. - *

- * This distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is smaller than 0 - * @type {number} - */ - minimumNodeToEdgeDistance:number; - /** - * Gets or sets the minimum distance between edges. - *

- * This distance needs to be non-negative. - *

- * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is smaller than 0 - * @type {number} - */ - minimumEdgeToEdgeDistance:number; - /** - * Gets or sets whether or not to take the coordinates of the input diagram into account when arranging the nodes. - *

- * The order of edges incident to the same source node will remain the same as in the original layout. - *

- * @type {boolean} - */ - fromSketchMode:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. - * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled - * @see yfiles.layout.MultiStageLayout#componentLayout - * @see yfiles.layout.ComponentLayout - * @type {boolean} - */ - componentLayoutEnabled:boolean; - /** - * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. - * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled - * @see yfiles.layout.MultiStageLayout#selfLoopRouter - * @see yfiles.layout.SelfLoopRouter - * @type {boolean} - */ - selfLoopRouterEnabled:boolean; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.seriesparallel.SeriesParallelLayout; - } - /** - * Specifies custom data for the {@link yfiles.seriesparallel.SeriesParallelLayout}. - * @class - * @extends {yfiles.layout.LayoutData} - */ - export interface SeriesParallelLayoutData extends yfiles.layout.LayoutData{} - export class SeriesParallelLayoutData { - constructor(); - /** - * Gets or sets the mapping from edges to their {@link yfiles.seriesparallel.EdgeLayoutDescriptor}. - * @see yfiles.seriesparallel.EdgeLayoutDescriptor - * @see yfiles.seriesparallel.SeriesParallelLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLayoutDescriptors:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to their {@link yfiles.seriesparallel.IPortAssignment}. - * @see yfiles.seriesparallel.SeriesParallelLayout#PORT_ASSIGNMENT_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - portAssignments:yfiles.layout.ItemMapping; - /** - * Gets or sets the mapping from nodes to comparison functions used to sort the nodes' outgoing edges. - * @see yfiles.seriesparallel.SeriesParallelLayout#OUT_EDGE_COMPARER_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - outEdgeComparers:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their source edge group. - * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - sourceGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets a mapping from edges to an object representing their target edge group. - * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - targetGroupIds:yfiles.layout.ItemMapping; - /** - * Gets or sets the AbortHandler used during the layout. - * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY - * @type {yfiles.algorithms.AbortHandler} - */ - abortHandler:yfiles.algorithms.AbortHandler; - /** - * Gets or sets the mapping that provides a {@link yfiles.layout.PreferredPlacementDescriptor} instance for edge - * {@link yfiles.graph.ILabel}s. - * @see yfiles.layout.PreferredPlacementDescriptor - * @see yfiles.layout.LayoutGraphAdapter#EDGE_LABEL_LAYOUT_PREFERRED_PLACEMENT_DESCRIPTOR_DP_KEY - * @type {yfiles.layout.ItemMapping.} - */ - edgeLabelPreferredPlacement:yfiles.layout.ItemMapping; - static $class:yfiles.lang.Class; - static isInstance(o:any):o is yfiles.seriesparallel.SeriesParallelLayoutData; - } - }} - -type yfiles_namespace = typeof yfiles; -declare module 'yfiles/algorithms' { export = yfiles; } -declare module 'yfiles/complete' { export = yfiles; } -declare module 'yfiles/lang' { export = yfiles.lang; } -declare module 'yfiles/layout' { export = yfiles; } -declare module 'yfiles/layout-familytree' { export = yfiles; } -declare module 'yfiles/layout-hierarchic' { export = yfiles; } -declare module 'yfiles/layout-multipage' { export = yfiles; } -declare module 'yfiles/layout-organic' { export = yfiles; } -declare module 'yfiles/layout-orthogonal' { export = yfiles; } -declare module 'yfiles/layout-orthogonal-compact' { export = yfiles; } -declare module 'yfiles/layout-partial' { export = yfiles; } -declare module 'yfiles/layout-radial' { export = yfiles; } -declare module 'yfiles/layout-seriesparallel' { export = yfiles; } -declare module 'yfiles/layout-tree' { export = yfiles; } -declare module 'yfiles/router-other' { export = yfiles; } -declare module 'yfiles/router-polyline' { export = yfiles; } -declare module 'yfiles/view' { export = yfiles; } -declare module 'yfiles/view-component' { export = yfiles; } -declare module 'yfiles/view-editor' { export = yfiles; } -declare module 'yfiles/view-folding' { export = yfiles; } -declare module 'yfiles/view-graphml' { export = yfiles; } -declare module 'yfiles/view-layout-bridge' { export = yfiles; } -declare module 'yfiles/view-table' { export = yfiles; } \ No newline at end of file diff --git a/types/yfiles/tslint.json b/types/yfiles/tslint.json deleted file mode 100644 index a41bf5d19a..0000000000 --- a/types/yfiles/tslint.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "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 - } -} diff --git a/types/yfiles/yfiles-tests.ts b/types/yfiles/yfiles-tests.ts deleted file mode 100644 index 5d13f4de75..0000000000 --- a/types/yfiles/yfiles-tests.ts +++ /dev/null @@ -1,175 +0,0 @@ -class BasicTest { - private readonly graphComponent:yfiles.view.GraphComponent; - - constructor() { - this.graphComponent = new yfiles.view.GraphComponent("graphControl"); - - let graphEditorInputMode = new yfiles.input.GraphEditorInputMode(); - - // Modify the MyHitTestable class to be usable with our class framework - yfiles.lang.Class.injectInterfaces(MyHitTestable.prototype, [yfiles.input.IHitTestable]); - let myHitTestable = new MyHitTestable(); - - if (yfiles.input.IHitTestable.isInstance(myHitTestable)) { - // If myHitTestable is recognized as instance of yfiles.drawing.IHitTestable by the yFiles class - // framework, set it as hit testable to prevent clicking any item. - // If you cannot click-select the nodes in the GraphControl, this worked correctly. - graphEditorInputMode.clickInputMode.validClickHitTestable = myHitTestable; - } - - this.graphComponent.inputMode = graphEditorInputMode; - - this.graphComponent.graph.nodeDefaults.style = new yfiles.styles.ShinyPlateNodeStyle({ fill: yfiles.view.Fill.ORANGE }); - - this.graphComponent.graph.createNode(new yfiles.geometry.Rect(0, 0, 10, 10), new MyNodeStyle()); - - this.layout(); - } - - start() { - for (let i = 0; i < 5; i++) { - for (let j = 0; j < 5; j++) { - this.graphComponent.graph.createNodeAt(new yfiles.geometry.Point(100 * i, 100 * j)); - } - } - this.graphComponent.graph.nodes.forEach((node) => this.graphComponent.graph.addLabel(node, "Label")); - this.graphComponent.fitGraphBounds(); - } - - /** - * Runs a layout algorithm and animates the transition to the new layout. - */ - layout() { - let layouter = new yfiles.hierarchic.HierarchicLayout(); - let layoutExecutor = new yfiles.layout.LayoutExecutor(this.graphComponent, - new yfiles.layout.MinimumNodeSizeStage(layouter)); - - layoutExecutor.duration = yfiles.lang.TimeSpan.fromSeconds(1); - layoutExecutor.animateViewport = true; - layoutExecutor.updateContentRect = true; - layoutExecutor.start().then(() => { - return null; - }) - .catch(error => { - throw error; - }); - } - - /** - * Runs a shortest path analysis. - */ - analyze() { - let graph = this.graphComponent.graph; - - // Create the graph model adapter to get a proper analysis graph structure. - let graphAdapter = new yfiles.layout.YGraphAdapter(graph); - - // Create an array the size of the edge set with costs for each edge. - let cost = new Array(graph.edges.size); - for (let i = 0; i < graph.edges.size; i++) { - cost[i] = Math.random(); - } - - let pred:yfiles.algorithms.Edge[] = null; - - // Suppose the first node from the graph is the node named "Start." - let startNode = graphAdapter.getCopiedNode(graph.nodes.first()); - // Suppose the last node from the graph is the node named "Destination." - let destinationNode = graphAdapter.getCopiedNode(graph.nodes.last()); - - // Run the single-source single-sink algorithm on the graph. - let result = yfiles.algorithms.ShortestPaths.singleSourceSingleSink(graphAdapter.yGraph, startNode, - destinationNode, true, cost, pred); - // Transfer back the result. - let predIGraph = new Array(pred.length); - for (let i = 0; i < pred.length; i++) { - predIGraph[i] = graphAdapter.getOriginalEdge(pred[i]); - } - } - - coreLib() { - new yfiles.lang.AttributeDefinition(() => { return {} }); - new yfiles.lang.ClassDefinition(() => { return {} }); - new yfiles.lang.EnumDefinition(() => { return {} }); - new yfiles.lang.StructDefinition(() => { return {} }); - } - - namespacesExist() { - let a01 = new yfiles.algorithms.AbortHandler(); - let a02 = new yfiles.binding.AdjacentNodesGraphBuilder(this.graphComponent.graph); - let a03 = new yfiles.circular.CircularLayout(); - let a04 = new yfiles.collections.List(); - let a05 = new yfiles.genealogy.FamilyTreeLayout(); - let a06 = new yfiles.geometry.Matrix(); - let a07 = new yfiles.graph.GraphClipboard(); - let a08:yfiles.graphml.ChildParseContext; - let a09 = new yfiles.hierarchic.AsIsLayerer(); - let a10 = new yfiles.input.GraphEditorInputMode(); - let a11 = new yfiles.labeling.GenericLabeling(); - let a12 = new yfiles.lang.Attribute(); - let a13 = new yfiles.layout.BendConverter(); - let a14 = new yfiles.multipage.DefaultElementFactory(); - let a15 = new yfiles.organic.OrganicLayout(); - let a16 = new yfiles.orthogonal.CompactOrthogonalLayout(); - let a17 = new yfiles.partial.PartialLayout(); - let a18 = new yfiles.radial.RadialLayout(); - let a19 = new yfiles.router.BusRouter(); - let a20 = new yfiles.seriesparallel.SeriesParallelLayout(); - let a21 = new yfiles.styles.ArcEdgeStyle(); - let a22 = new yfiles.tree.AspectRatioTreeLayout(); - let a23 = new yfiles.view.GraphComponent(); - let yfilesNamespace : yfiles_namespace; - } - - testsForVersion2001() { - var element:SVGElement; - yfiles.view.SvgVisual.setScale(element, 4, 2); - yfiles.view.SvgVisual.setTranslate(element, 4, 2); - - var args = new yfiles.lang.EventArgs(); - yfiles.input.KeyEventRecognizers.META_PRESSED(null, args); - } - - testsForVersion2012() { - //isInstance type-guard - let r : any; - let p : any; - if(yfiles.geometry.Rect.isInstance(r) && yfiles.geometry.Point.isInstance(p)) { - r.contains(p); - } - - //Typings for yfiles.lang.Object instance methods. - let r2 : yfiles.geometry.Rect = new yfiles.geometry.Rect(0,0,100,100); - let r3 : yfiles.geometry.Rect = new yfiles.geometry.Rect(0,0,100,100); - r2.equals(r3); - } -} - -class MyHitTestable extends yfiles.lang.BaseClass(yfiles.input.IHitTestable) implements yfiles.input.IHitTestable { - isHit(ctx:yfiles.input.IInputModeContext, p:yfiles.geometry.Point):boolean { - return false; - } -} - -class MyNodeStyle extends yfiles.styles.NodeStyleBase { - createVisual(renderContext:yfiles.view.IRenderContext, node:yfiles.graph.INode):yfiles.view.SvgVisual { - let g = document.createElementNS("http://www.w3.org/2000/svg", "g"); - return new yfiles.view.SvgVisual(g); - } -} - -// tests for version 2.0.1.2 - -// parameterless baseclass call. -class MyHitTestable2 extends yfiles.lang.BaseClass(yfiles.input.IHitTestable) implements yfiles.input.IHitTestable { - isHit(context: yfiles.input.IInputModeContext, location: yfiles.geometry.Point): boolean { - return null; - } -} - -// yfiles.lang.Object as baseclass. -class MyHitTestable3 extends yfiles.lang.BaseClass(yfiles.input.IHitTestable) implements yfiles.input.IHitTestable { - isHit(context: yfiles.input.IInputModeContext, location: yfiles.geometry.Point): boolean { - return null; - } -} diff --git a/types/yog-bigpipe/tsconfig.json b/types/yog-bigpipe/tsconfig.json index 74dfc3ae1e..c45bd9de69 100644 --- a/types/yog-bigpipe/tsconfig.json +++ b/types/yog-bigpipe/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/yog-log/tsconfig.json b/types/yog-log/tsconfig.json index 056d458bf6..8e78df5624 100644 --- a/types/yog-log/tsconfig.json +++ b/types/yog-log/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/yog2-kernel/tsconfig.json b/types/yog2-kernel/tsconfig.json index 56155a7fec..b3b149bdcb 100644 --- a/types/yog2-kernel/tsconfig.json +++ b/types/yog2-kernel/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/yosay/tsconfig.json b/types/yosay/tsconfig.json index 884e37fabf..20a91a2203 100644 --- a/types/yosay/tsconfig.json +++ b/types/yosay/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/youtube-dl/tsconfig.json b/types/youtube-dl/tsconfig.json index 2634bd2234..38ff7be5c1 100644 --- a/types/youtube-dl/tsconfig.json +++ b/types/youtube-dl/tsconfig.json @@ -5,7 +5,9 @@ ], "compilerOptions": { "module": "commonjs", - "lib": ["es6"], + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, @@ -16,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/youtube/index.d.ts b/types/youtube/index.d.ts index a636894060..b9e45aab2d 100644 --- a/types/youtube/index.d.ts +++ b/types/youtube/index.d.ts @@ -383,7 +383,7 @@ declare namespace YT /** * ID of the video to load. */ - videoId: string; + videoId?: string; /** * Player parameters. diff --git a/types/youtube/tsconfig.json b/types/youtube/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/youtube/tsconfig.json +++ b/types/youtube/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/youtube/tslint.json b/types/youtube/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/youtube/tslint.json +++ b/types/youtube/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/yui/tsconfig.json b/types/yui/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/yui/tsconfig.json +++ b/types/yui/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/yup/index.d.ts b/types/yup/index.d.ts index 6c03557c60..99e67121d8 100644 --- a/types/yup/index.d.ts +++ b/types/yup/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for yup 0.23 +// Type definitions for yup 0.24 // Project: https://github.com/jquense/yup // Definitions by: Dominik Hardtke , Vladyslav Tserman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -89,6 +89,8 @@ export interface NumberSchemaConstructor { export interface NumberSchema extends Schema { min(limit: number | Ref, message?: string): NumberSchema; max(limit: number | Ref, message?: string): NumberSchema; + lessThan(limit: number | Ref, message?: string): NumberSchema; + moreThan(limit: number | Ref, message?: string): NumberSchema; positive(message?: string): NumberSchema; negative(message?: string): NumberSchema; integer(message?: string): NumberSchema; @@ -240,3 +242,14 @@ export interface Ref { // tslint:disable-next-line:no-empty-interface export interface Lazy extends Schema { } + +export interface LocaleObject { + mixed?: { [key in keyof MixedSchema]?: string }; + string?: { [key in keyof StringSchema]?: string }; + number?: { [key in keyof NumberSchema]?: string }; + boolean?: { [key in keyof BooleanSchema]?: string }; + bool?: { [key in keyof BooleanSchema]?: string }; + date?: { [key in keyof DateSchema]?: string }; + array?: { [key in keyof ArraySchema]?: string }; + object?: { [key in keyof ObjectSchema]?: string }; +} diff --git a/types/yup/lib/customLocale.d.ts b/types/yup/lib/customLocale.d.ts new file mode 100644 index 0000000000..b0abe418f3 --- /dev/null +++ b/types/yup/lib/customLocale.d.ts @@ -0,0 +1,5 @@ +import { + LocaleObject, +} from "../index"; + +export function setLocale(customLocale: LocaleObject): void; diff --git a/types/yup/tsconfig.json b/types/yup/tsconfig.json index 7a38726edd..4c10bc70c7 100644 --- a/types/yup/tsconfig.json +++ b/types/yup/tsconfig.json @@ -14,10 +14,12 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ "index.d.ts", + "lib/customLocale.d.ts", "yup-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/yup/yup-tests.ts b/types/yup/yup-tests.ts index 24c47fb418..8d84bbf42d 100644 --- a/types/yup/yup-tests.ts +++ b/types/yup/yup-tests.ts @@ -1,4 +1,6 @@ import * as yup from 'yup'; +import { setLocale } from 'yup/lib/customLocale'; + // tslint:disable-next-line:no-duplicate-imports import { reach, date, Schema, ObjectSchema, ValidationError, MixedSchema, SchemaDescription, TestOptions, ValidateOptions, NumberSchema } from 'yup'; @@ -176,6 +178,8 @@ numSchema.min(5, 'message'); numSchema.max(5, 'message'); numSchema.positive(); numSchema.negative(); +numSchema.lessThan(5); +numSchema.moreThan(5); numSchema.integer(); numSchema.truncate(); numSchema.round('floor'); @@ -252,3 +256,8 @@ const validateOptions: ValidateOptions = { key: 'value' } }; + +setLocale({ + number: { max: "Max message", min: "Min message" }, + string: { email: "String message"} +}); diff --git a/types/z-schema/tsconfig.json b/types/z-schema/tsconfig.json index 54782d4c86..e96a6c3643 100644 --- a/types/z-schema/tsconfig.json +++ b/types/z-schema/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/zapier-platform-core/index.d.ts b/types/zapier-platform-core/index.d.ts index 0bea385f05..525421abbf 100644 --- a/types/zapier-platform-core/index.d.ts +++ b/types/zapier-platform-core/index.d.ts @@ -8,6 +8,9 @@ import * as http from "http"; +export function createAppHandler(appRawOrPath: object | string): (event: any, context: any, callback: any) => void; +export function createAppTester(appRawOrPath: object | string): Promise; +export function integrationTestHandler(event: any, context: any, callback: any): any; export const version: string; export interface HttpRequestOptions { diff --git a/types/zapier-platform-core/tsconfig.json b/types/zapier-platform-core/tsconfig.json index c197914893..d4ce3793e1 100644 --- a/types/zapier-platform-core/tsconfig.json +++ b/types/zapier-platform-core/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/zapier-platform-core/zapier-platform-core-tests.ts b/types/zapier-platform-core/zapier-platform-core-tests.ts index 76592204ae..6c6c490edd 100644 --- a/types/zapier-platform-core/zapier-platform-core-tests.ts +++ b/types/zapier-platform-core/zapier-platform-core-tests.ts @@ -1,10 +1,10 @@ -import { OAuth2Authentication } from "zapier-platform-core"; +import * as zapier from "zapier-platform-core"; const BASE_URL = "http://example.com"; const OAUTH2_CLIENT_ID = "12345"; const OAUTH2_CLIENT_SECRET = "abcdef"; -const authentication: OAuth2Authentication = { +const authentication: zapier.OAuth2Authentication = { type: "oauth2", connectionLabel: "User account", oauth2Config: { @@ -91,3 +91,10 @@ const authentication: OAuth2Authentication = { return true; } }; + +zapier.version; + +const testCreateAppTester = async () => { + const zapierApp = {}; + const appTester = await zapier.createAppTester(zapierApp); +}; diff --git a/types/zen-observable/tsconfig.json b/types/zen-observable/tsconfig.json index 8f7b9ad757..b31226f4a1 100644 --- a/types/zen-observable/tsconfig.json +++ b/types/zen-observable/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/zen-push/tsconfig.json b/types/zen-push/tsconfig.json index d3e8efb833..ab99022dc4 100644 --- a/types/zen-push/tsconfig.json +++ b/types/zen-push/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "zen-push-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/zenscroll/tsconfig.json b/types/zenscroll/tsconfig.json index 89fc59c020..0629a445a4 100644 --- a/types/zenscroll/tsconfig.json +++ b/types/zenscroll/tsconfig.json @@ -8,17 +8,18 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, - "strictFunctionTypes": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", - "zenscroll-tests.ts" + "zenscroll-tests.ts" ] } \ No newline at end of file diff --git a/types/zepto/tsconfig.json b/types/zepto/tsconfig.json index cc7da64133..c2da9656bf 100644 --- a/types/zepto/tsconfig.json +++ b/types/zepto/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/zeroclipboard/tsconfig.json b/types/zeroclipboard/tsconfig.json index 135f2186a1..4844201b54 100644 --- a/types/zeroclipboard/tsconfig.json +++ b/types/zeroclipboard/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/zeroclipboard/v1/tsconfig.json b/types/zeroclipboard/v1/tsconfig.json index 357f8f8784..70c6d4cc6a 100644 --- a/types/zeroclipboard/v1/tsconfig.json +++ b/types/zeroclipboard/v1/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/zeromq/index.d.ts b/types/zeromq/index.d.ts index 949a5f567b..189d60fc29 100644 --- a/types/zeromq/index.d.ts +++ b/types/zeromq/index.d.ts @@ -1,6 +1,8 @@ -// Type definitions for zeromq 4.5 +// Type definitions for zeromq 4.6 // Project: https://github.com/zeromq/zeromq.js -// Definitions by: Dave McKeown , Erik Mavrinac +// Definitions by: Dave McKeown +// Erik Mavrinac +// Philippe D'Alva // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // // Forked from the DefinitelyTyped 'zmq' project originally created by Dave McKeown, @@ -149,9 +151,10 @@ export class Socket { * Each event receives the parameters: (eventValue, eventEndpointAddrress, error) * * @param timer interval in ms > 0 or Undefined for default + * @param numOfEvents The maximum number of events to read on each interval, default is 1, use 0 for reading all events * @return for chaining */ - monitor(interval?: number): Socket; + monitor(interval?: number, numOfEvents?: number): Socket; /** * Close the socket. diff --git a/types/zeromq/tsconfig.json b/types/zeromq/tsconfig.json index ada0d8a1c7..8191817265 100644 --- a/types/zeromq/tsconfig.json +++ b/types/zeromq/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/zeromq/zeromq-tests.ts b/types/zeromq/zeromq-tests.ts index a49de9cc7d..a1230957a7 100644 --- a/types/zeromq/zeromq-tests.ts +++ b/types/zeromq/zeromq-tests.ts @@ -37,6 +37,7 @@ function test5() { }); sock.monitor(); sock.monitor(10); + sock.monitor(10, 2); } function test6() { diff --git a/types/zip.js/tsconfig.json b/types/zip.js/tsconfig.json index a655a790d8..ef85f2f086 100644 --- a/types/zip.js/tsconfig.json +++ b/types/zip.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/zipcodes/tsconfig.json b/types/zipcodes/tsconfig.json index ff98ed05f8..8c2869c026 100644 --- a/types/zipcodes/tsconfig.json +++ b/types/zipcodes/tsconfig.json @@ -1,23 +1,24 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "zipcodes-tests.ts" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "zipcodes-tests.ts" + ] } \ No newline at end of file diff --git a/types/zipkin-context-cls/index.d.ts b/types/zipkin-context-cls/index.d.ts new file mode 100644 index 0000000000..df1b9f57aa --- /dev/null +++ b/types/zipkin-context-cls/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for zipkin-context-cls 0.11 +// Project: https://github.com/openzipkin/zipkin-js#readme +// Definitions by: York Yao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Context, TraceId } from 'zipkin'; + +declare class CLSContext implements Context { + setContext(ctx: TraceId): void; + getContext(): TraceId; + scoped(callback: () => V): V; + letContext(ctx: TraceId, callback: () => V): V; + constructor(name: string) +} + +export = CLSContext; diff --git a/types/zipkin-context-cls/package.json b/types/zipkin-context-cls/package.json new file mode 100644 index 0000000000..371d115490 --- /dev/null +++ b/types/zipkin-context-cls/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "zipkin": "^0.11.2" + } +} diff --git a/types/zipkin-context-cls/tsconfig.json b/types/zipkin-context-cls/tsconfig.json new file mode 100644 index 0000000000..5b2ca84bc2 --- /dev/null +++ b/types/zipkin-context-cls/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "zipkin-context-cls-tests.ts" + ] +} \ No newline at end of file diff --git a/types/zipkin-context-cls/tslint.json b/types/zipkin-context-cls/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/zipkin-context-cls/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/zipkin-context-cls/zipkin-context-cls-tests.ts b/types/zipkin-context-cls/zipkin-context-cls-tests.ts new file mode 100644 index 0000000000..31168e824b --- /dev/null +++ b/types/zipkin-context-cls/zipkin-context-cls-tests.ts @@ -0,0 +1,9 @@ +import { + Tracer, + BatchRecorder, + jsonEncoder, +} from 'zipkin'; + +import CLSContext = require('zipkin-context-cls'); + +const ctxImpl = new CLSContext('zipkin'); diff --git a/types/zipkin-instrumentation-express/index.d.ts b/types/zipkin-instrumentation-express/index.d.ts new file mode 100644 index 0000000000..ab587b3cae --- /dev/null +++ b/types/zipkin-instrumentation-express/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for zipkin-instrumentation-express 0.11 +// Project: https://github.com/openzipkin/zipkin-js#readme +// Definitions by: York Yao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import express = require('express'); +import { Tracer } from 'zipkin'; + +export interface Options { + tracer: Tracer; +} + +export function expressMiddleware(options: Options): express.RequestHandler; diff --git a/types/zipkin-instrumentation-express/package.json b/types/zipkin-instrumentation-express/package.json new file mode 100644 index 0000000000..371d115490 --- /dev/null +++ b/types/zipkin-instrumentation-express/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "zipkin": "^0.11.2" + } +} diff --git a/types/zipkin-instrumentation-express/tsconfig.json b/types/zipkin-instrumentation-express/tsconfig.json new file mode 100644 index 0000000000..16d973e846 --- /dev/null +++ b/types/zipkin-instrumentation-express/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "zipkin-instrumentation-express-tests.ts" + ] +} \ No newline at end of file diff --git a/types/zipkin-instrumentation-express/tslint.json b/types/zipkin-instrumentation-express/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/zipkin-instrumentation-express/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/zipkin-instrumentation-express/zipkin-instrumentation-express-tests.ts b/types/zipkin-instrumentation-express/zipkin-instrumentation-express-tests.ts new file mode 100644 index 0000000000..bcfb82ec46 --- /dev/null +++ b/types/zipkin-instrumentation-express/zipkin-instrumentation-express-tests.ts @@ -0,0 +1,12 @@ +import express = require('express'); +import { Tracer, ExplicitContext, ConsoleRecorder } from 'zipkin'; +import { expressMiddleware as zipkinMiddleware } from 'zipkin-instrumentation-express'; + +const ctxImpl = new ExplicitContext(); +const recorder = new ConsoleRecorder(); +const localServiceName = 'service-a'; +const tracer = new Tracer({ ctxImpl, recorder, localServiceName }); + +const app = express(); + +app.use(zipkinMiddleware({ tracer })); diff --git a/types/zipkin-instrumentation-fetch/index.d.ts b/types/zipkin-instrumentation-fetch/index.d.ts new file mode 100644 index 0000000000..b9236c94fa --- /dev/null +++ b/types/zipkin-instrumentation-fetch/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for zipkin-instrumentation-fetch 0.11 +// Project: https://github.com/openzipkin/zipkin-js#readme +// Definitions by: York Yao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Tracer } from 'zipkin'; +import fetch from 'node-fetch'; + +interface Options { + tracer: Tracer; + remoteServiceName: string; +} + +declare function wrapFetch(rawFetch: typeof fetch, options: Options): typeof fetch; + +export = wrapFetch; diff --git a/types/zipkin-instrumentation-fetch/package.json b/types/zipkin-instrumentation-fetch/package.json new file mode 100644 index 0000000000..371d115490 --- /dev/null +++ b/types/zipkin-instrumentation-fetch/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "zipkin": "^0.11.2" + } +} diff --git a/types/zipkin-instrumentation-fetch/tsconfig.json b/types/zipkin-instrumentation-fetch/tsconfig.json new file mode 100644 index 0000000000..c334eb552c --- /dev/null +++ b/types/zipkin-instrumentation-fetch/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "zipkin-instrumentation-fetch-tests.ts" + ] +} \ No newline at end of file diff --git a/types/zipkin-instrumentation-fetch/tslint.json b/types/zipkin-instrumentation-fetch/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/zipkin-instrumentation-fetch/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/zipkin-instrumentation-fetch/zipkin-instrumentation-fetch-tests.ts b/types/zipkin-instrumentation-fetch/zipkin-instrumentation-fetch-tests.ts new file mode 100644 index 0000000000..5790413e0a --- /dev/null +++ b/types/zipkin-instrumentation-fetch/zipkin-instrumentation-fetch-tests.ts @@ -0,0 +1,26 @@ +import wrapFetch = require('zipkin-instrumentation-fetch'); +import fetch from 'node-fetch'; + +import { + Tracer, + BatchRecorder, + jsonEncoder, +} from 'zipkin'; + +import CLSContext = require('zipkin-context-cls'); +import { HttpLogger } from 'zipkin-transport-http'; + +// Setup the tracer to use http and implicit trace context +const tracer = new Tracer({ + ctxImpl: new CLSContext('zipkin'), + recorder: new BatchRecorder({ + logger: new HttpLogger({ + endpoint: 'http://localhost:9411/api/v2/spans', + jsonEncoder: jsonEncoder.JSON_V2 + }) + }), + localServiceName: 'service-a' +}); + +const remoteServiceName = 'youtube'; +const zipkinFetch = wrapFetch(fetch, { tracer, remoteServiceName }); diff --git a/types/zipkin-transport-http/index.d.ts b/types/zipkin-transport-http/index.d.ts new file mode 100644 index 0000000000..2cc34f0893 --- /dev/null +++ b/types/zipkin-transport-http/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for zipkin-transport-http 0.11 +// Project: https://github.com/openzipkin/zipkin-js#readme +// Definitions by: York Yao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { JsonEncoder, Logger, model } from 'zipkin'; + +export interface Options { + endpoint: string; + jsonEncoder?: JsonEncoder; + httpInterval?: number; + headers?: { [name: string]: string }; +} + +export class HttpLogger implements Logger { + logSpan(span: model.Span): void; + constructor(options: Options) +} diff --git a/types/zipkin-transport-http/package.json b/types/zipkin-transport-http/package.json new file mode 100644 index 0000000000..371d115490 --- /dev/null +++ b/types/zipkin-transport-http/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "zipkin": "^0.11.2" + } +} diff --git a/types/zipkin-transport-http/tsconfig.json b/types/zipkin-transport-http/tsconfig.json new file mode 100644 index 0000000000..8d1b312d10 --- /dev/null +++ b/types/zipkin-transport-http/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "zipkin-transport-http-tests.ts" + ] +} \ No newline at end of file diff --git a/types/zipkin-transport-http/tslint.json b/types/zipkin-transport-http/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/zipkin-transport-http/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/zipkin-transport-http/zipkin-transport-http-tests.ts b/types/zipkin-transport-http/zipkin-transport-http-tests.ts new file mode 100644 index 0000000000..4b5b91d218 --- /dev/null +++ b/types/zipkin-transport-http/zipkin-transport-http-tests.ts @@ -0,0 +1,20 @@ +import { + Tracer, + BatchRecorder, + jsonEncoder, +} from 'zipkin'; + +import CLSContext = require('zipkin-context-cls'); +import { HttpLogger } from 'zipkin-transport-http'; + +// Setup the tracer to use http and implicit trace context +const tracer = new Tracer({ + ctxImpl: new CLSContext('zipkin'), + recorder: new BatchRecorder({ + logger: new HttpLogger({ + endpoint: 'http://localhost:9411/api/v2/spans', + jsonEncoder: jsonEncoder.JSON_V2 + }) + }), + localServiceName: 'service-a' +}); diff --git a/types/zmq/tsconfig.json b/types/zmq/tsconfig.json index 03a35a4048..1224fce889 100644 --- a/types/zmq/tsconfig.json +++ b/types/zmq/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/zookeeper/tsconfig.json b/types/zookeeper/tsconfig.json index 281f393e23..c3c04d56cc 100644 --- a/types/zookeeper/tsconfig.json +++ b/types/zookeeper/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "zookeeper-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/zui/tsconfig.json b/types/zui/tsconfig.json index a2d866908a..32b9886589 100644 --- a/types/zui/tsconfig.json +++ b/types/zui/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/zxcvbn/tsconfig.json b/types/zxcvbn/tsconfig.json index 72bae94375..9361d06492 100644 --- a/types/zxcvbn/tsconfig.json +++ b/types/zxcvbn/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "zxcvbn-tests.ts" ] -} +} \ No newline at end of file